to be
a problem slover

get signed tx by type.transactions

func (t *Txn) SignedTxn() string {
    tx, _, err := eth.EthClient.TransactionByHash(context.Background(), common.HexToHash(t.Params.Result.TxHash))
    if err != nil {
        return ""
    }
    bs, err := tx.MarshalBinary()
    if err != nil {
        return ""
    }
    return hexutil.Encode(bs)
}

context

After get signedRawTx, it can be use to send by rpc like

{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],"id":1}

赞(1) 打赏
欢迎转载,注明出处:刘世明的博客 » get signed tx by type.transactions

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下作者

支付宝扫一扫打赏

微信扫一扫打赏