I'm trying to get the balance of a random USDT account in Solana. I've tried several public gateways and hasn't successed. Here's one example:
curl --request POST \
--url https://solana-mainnet.g.alchemy.com/v2/demo \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "getTokenAccountBalance",
"params": [
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
]
}
'
===>
{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid param: not a Token account"},"id":1}
Why is it "not a token account"? What's the matter?
Here's an account - https://solscan.io/account/TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
update 1
this address won't work either, resulting in the same error:
5Xm6nU1Bi6UewCrhJQFk1CAV97ZJaRiFw4tFNhUbXy3u