Get Transactions with correct value

Hi,

with the api call
/{address}/erc20/transfers

i get all the erc20 tokens for my eth chain. For example:

{
      "transaction_hash": "0xa9e033e8d8d9f4a2c50b03ce2e289c9da5e3dea02d3ab2add9d3e730fcc40927",
      "address": "0x0f5d2fb29fb7d3cfee444a200298f468908cc942",
      "block_timestamp": "2022-04-18T11:06:11.000Z",
      "block_number": "14608820",
      "block_hash": "0xc5190b55b2d3cbdb80eba939e3054aa052be56c57a2ce259c1e45f84a0d06035",
      "to_address": "0xaf5dfb1cf63e05a09d06237e6c2f7f85cff17699",
      "from_address": "0x74dec05e5b894b0efec69cdf6316971802a2f9a1",
      **"value": "12718888270000000000"**
    }

My Question: Why cant i get the value in the right format? with etherscan i am able to see, that it has a value of 12.71888827.

Isnt there a way to get the value with the right decimals? Maybe like the request /{address}/erc20 - because there i get at least β€œdecimals”: 18

Thanks for the help

in this particular case, you will have to get the number of decimals for that token address (you can do that with another API request that accepts a list of addresses)

you can add a request on roadmap.moralis.io to also add that decimals value

the value is in WEI and it is easily convertible after you know that decimals value

okey - i will make a request on the roadmap.

thanks cryptokid (Y)

1 Like