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": {}
}
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": {}
}
getTokenAccountBalance
methodgetTokenAccountBalance
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.
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.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.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.Token account balance details
The response is of type object
.
Was this page helpful?