getTokenAccountBalance RPC Method
Returns the token balance of an SPL Token account.Result Details
The result is an RpcResponse JSON object withvalue containing:
-
amount: <string>- Raw token balance without decimals
- String representation of u64 integer
- Represents the full token amount without decimal adjustment
-
decimals: <u8>- Number of decimal places for the token
- Determines how the raw amount should be displayed
-
uiAmount: <number|null>DEPRECATED- Balance using mint-prescribed decimals
- Will be deprecated in future versions
-
uiAmountString: <string>- Balance as a string
- Formatted using mint-prescribed decimal places
Important Notes
- Similar token balance structure as found in getBlock method
- Provides both raw and user-friendly token balance representations
- Decimals help in correct token amount interpretation