Bitcoin Forum
January 28, 2022, 04:32:28 PM *
News: Latest Bitcoin Core release: 22.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Alternate cryptocurrencies / Altcoin Discussion / How can I find out what token was sent from the transaction "input"? on: December 10, 2021, 02:58:07 PM
Hello everyone!

I'm working on something for my project and my goals are to get the value of a transaction and what coin was sent. I'm currently at the point where everything works fine but the problem is I can't find out what token is being sent within the transaction. The issue shows up only for Ethereum tokens transactions (for the other coins I found different ways to distinguish what was sent). I'm using Etherscan's API to retrieve all the raw information for the transactions of an address. The API is returning JSON arrays with objects. Example of an API return:

Code:
results:
       0:
            ......... (SOME NECESSARY DATA)

            hash: "TRANSACTION HASH"

            ......... (SOME NECESSARY DATA)

            value: "0" (BECAUSE IT IS ETHEREUM TOKEN TRANSACTION)

            ......... (SOME NECESSARY DATA)

            input: "0xa9059cbb000000000000000000000000e59cd29be3be4461d79c0881d238cbe87d64595a0000000000000000000000000000000000000000000000000000000077359400" (EXAMPLE INPUT)

       1:
            ..........

       2:
            ..........

Above is shown all the useful information that can somehow help me to retrieve the information I need. How can I get what token is being transferred within the transaction?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!