Returns the token balance for an SPL Token account.
$ curl https://api.devnet.solana.com -s -X \> POST -H "Content-Type: application/json" -d '> {> "jsonrpc": "2.0",> "id": 1,> "method": "getTokenAccountBalance",> "params": [> "48gpnn8nsmkvkgso7462Z1nFhUrprGQ71u1YLBPzizbY",> {> "commitment": "finalized"> }> ]> }> '
params
stringrequired
Pubkey of Token account to query, as base-58 encoded string
objectoptional
Configuration object containing the following fields:
result
Response
{"jsonrpc": "2.0","result": {"context": { "apiVersion": "3.1.8", "slot": 1114 },"value": {"amount": "9864","decimals": 2,"uiAmount": 98.64,"uiAmountString": "98.64"}},"id": 1}
object
RpcResponse object containing:
Is this page helpful?