I'm new to blockchain dev and am using the JS SDK for Algorand. Is it possible to retrieve all the assets in a wallet by its address?
Thank you
I'm new to blockchain dev and am using the JS SDK for Algorand. Is it possible to retrieve all the assets in a wallet by its address?
Thank you
Yes, you can use this: GET /v2/accounts/{address}
This will return an assets
array, as well as some other things - you can read more here.
You can use an endpoint from either algod (algo daemon of the node) or indexer (Postgres database) to get this information.
Algod method:
https://algorand.github.io/js-algorand-sdk/classes/Algodv2.html#accountInformation
Indexer method:
https://algorand.github.io/js-algorand-sdk/classes/Indexer.html#lookupAccountAssets
For demonstration purpose, I just randomly found an address from Algoexplorer.