get Token Account Balance
Returns the token balance of a single SPL Token or Token-2022 account.
getTokenAccountBalance returns a token account's balance as a raw integer and pre-divided by the mint's decimals. It only accepts a token account address; a wallet address returns an error, since a wallet's tokens live in its associated token accounts.
With only a wallet address and mint, getTokenAccountsByOwner locates the token account first; its result also carries the balance directly, detailed in Notes.
Parameters
params is a JSON array, with values in this order: pubkey, config.
Address of the token account to check, base-58 encoded.
Commitment configuration.
Show propertiesProperties
Bank state to read the balance from.
finalizedconfirmedprocessedResult
The token amount, wrapped with context.
Show propertiesProperties
Show propertiesProperties
Show propertiesProperties
Raw token amount in the mint's smallest unit, as a string (can exceed safe JS integer range).
Number of decimal places the mint uses.
Amount divided by 10^decimals, as a float. Deprecated in favor of uiAmountString for anything precision-sensitive.
Amount divided by 10^decimals, as an exact decimal string.
Notes
uiAmountStringavoids the precisionuiAmountcan lose, as a float, on tokens with many decimals or large balances.- This errors if the address is not a token account, for example a wallet or mint address.