bnb-chain / go-sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I decode token transfer transaction?

qiluge opened this issue · comments

Using client.GetTx("BF45D076F5FFBDA4473C82B325FE2A2C08F65C37F922ACD3DF55F5BDC184B8C4") could get TxResult, but I want to get transafer detail, such as amount, from, to, token symbol. And in your document, there are fee description about decoding result: Please note that this transaction information is amino-encoded. You will see the original transaction information after decoding. So, I want to know how can I decoding the transaction. Or maybe you can return the transaction detail strightly instead of the decoded raw tx.

commented

thks for your report, will support soon. For now you can use function here to parse tx .https://github.com/binance-chain/go-sdk/blob/a208ba1bfa74798aa6b12c5acc437ee585e29982/client/rpc/ws_client.go#L1059

@guagualvcha I use func ParseTx(cdc *amino.Codec, txBytes []byte) (tx.Tx, error) can not decode tx on prod net
tx hash: 178EF17F0F6D4D3EA47DA0E252C192F9FEA28C68B1B75E1BA08C8829B68AF24E , on height :56507
the error is:error reading array contents: expected field number: 1; got: 4

commented

@guagualvcha I use func ParseTx(cdc *amino.Codec, txBytes []byte) (tx.Tx, error) can not decode tx on prod net
tx hash: 178EF17F0F6D4D3EA47DA0E252C192F9FEA28C68B1B75E1BA08C8829B68AF24E , on height :56507
the error is:error reading array contents: expected field number: 1; got: 4