smartcontractsalgorand

Why am i getting different asset amount using algorand Indexer vs daemon?


So I created a new ASA (AKA: Algorand Standard Asset) and set the total amount of that asset to be maximum.

Here's a quick snippet of how I did it:

const UINT64_MAX: bigint = BigInt('18446744073709551615');

Now, When I check how many tokens asset creator has with Algorand's Daemon API

curl http://localhost:8980/v2/accounts/3IELQKOD...3C5IB3BP4V4A/assets

I get it exactly right as: 18446744073709551615

But when i check it with the indexer in the sdk its something different.

It shows total assets as "18446744073709552000" to be exact which is not true.

What am i doing wrong here or this is error in library?


Solution

  • you need to set your client to support big int or mixed.

    as JS Only supports 2^^53

    enter image description here

    You can easily set it by setting IntDecoding method for all JSON requests created by client here.