I am building very simple Golang program to get transaction details from HASH. I am able to get the information of any transaction but I am unable to get information what ERC20 token was transferred and how many.
Transfer 700 ERC20 (GLOBALALTCOIN) TOKEN From 0xaacc58c7c85f7ea78f36ea700edf6a15f9b74aac to 0x01e574ab996f8fbd6adbd92c82ffd9b293bc6349
Can someone please advise me how to get it?
I am getting this information
{
nonce: "0x7",
gasPrice: "0x14b8d03a00",
gas: "0x134cb",
to: "0xb3c8826e2c5bc48415c1618384e1aa544d32f69b",
value: "0x0",
input: "0xa9059cbb00000000000000000000000001e574ab996f8fbd6adbd92c82ffd9b293bc634900000000000000000000000000000000000000000000000000000000000002bc",
v: "0x29",
r: "0x2712c5a09046d61c809865c6a716c34c4bde3c8d1b84f2a18c60b7d77d52d402",
s: "0x6d1a322fa417ffa8c21c746616fab0036830772c597156981e761ff66e44ebd0",
hash: "0xcbf739a96f23b7bb5a62802e0389257f5f872aebbd03cbeeee023dfee2c7e3dc"
}
My code is very simple from example:
conn, err := ethclient.Dial("https://ropsten.infura.io/")
if err != nil {
ApiUtility.Log("GetTransactionStatus: Unable to connect to ETH Client. "+ err.Error())
return nil, false, err
}
ctx := context.Background()
txt, pending, err := conn.TransactionByHash(ctx, common.HexToHash(id))
if err != nil {
ApiUtility.Log("GetTransactionStatus: Unable to get Transaction hash. "+ err.Error())
return nil, false, err
}
return txt, pending, nil
I have searched a lot. In Web3, they mentioned that Event logs must be used but there is nothing about go library.
Please help.
Thanks