POST
/
9de47db917d4f69168e3fed02217d15b
curl --request POST \
  --url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "getTokenAccountBalance",
  "params": [
    "3emsAVdmGKERbHjmGfQ6oZ1e35dkf5iYcS6U4CPKFVaa"
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {}
}

Solana getTokenAccountBalance method

The Solana getTokenAccountBalance method returns the token balance of an account.

This method provides the token balance of a specific account, which is the amount of tokens the account holds. It is useful for tracking the token balance of an account.

The interactive example is querying on the Solana mainnet the top USDC token account holder, which is Circle.

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • accountPubkey — the public key of the account to retrieve the token balance for.
  • commitment — (optional) the level of commitment desired:
    • processed — the node has processed the block and the block may be on a fork.
    • confirmed — the block is confirmed by the cluster as not being on a fork.
    • finalized — the block is finalized by the cluster.

Response

  • value — the token balance of the account:
    • amount — the amount of tokens the account holds.
    • decimals — the number of decimal places the token has.
    • uiAmount — the amount of tokens the account holds, adjusted for decimals.

Use case

A practical use case for getTokenAccountBalance is to track the token balance of an account. This can be useful for wallets or other applications that need to display or make use of this information.

Body

application/json
id
integer
default:1
jsonrpc
string
default:2.0
method
string
default:getTokenAccountBalance
params
any[]

Response

200 - application/json
Token account balance details
jsonrpc
string
id
integer
result
object