Discussions
Getting ERC-20 token balances on testnets
6 months ago by null
I'm hoping to use the Advanced API to get balances for ERC-20 tokens. But when I tried it with the Avalanche Fuji and Polygon Mumbai testnets, calling ankr_getAccountBalance
only shows the native token for each chain. And calling ankr_getCurrencies
always returns null
for both chains. e.g.
{
"jsonrpc": "2.0",
"method": "ankr_getCurrencies",
"params": {
"blockchain": "avalanche_fuji"
},
"id": 2
}
returns
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"currencies": null,
"syncStatus": {
"timestamp": 0,
"lag": "-0s",
"status": "synced"
}
}
}
Am I missing something, or are ERC-20 tokens only supported on mainnet chains?