Parameters
chainId
string
default:"solana-devnet"
required
Unique identifier for a blockchain network.
Request identifier used to match responses.
jsonrpc
string
default:"2.0"
required
JSON-RPC version.
method
string
default:"getTokenAccountBalance"
required
JSON-RPC method name.
Parameters for method getTokenAccountBalance: [tokenAccountAddress, config]Positional parameters for getTokenAccountBalance:params[0]: Pubkey of the Token account to query (base-58 encoded string).params[1]: Optional configuration object.
Returns
Token balance information for the given Token account.
The raw token balance without decimals (u64 string representation).
Number of base 10 digits to the right of the decimal place.
Deprecated. The balance using mint-prescribed decimals.
The balance as a string, using mint-prescribed decimals.
curl --request POST \
--url https://api.uniblock.dev/uni/v1/json-rpc?chainId=solana-devnet \
--header 'content-type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "getTokenAccountBalance",
"params": [
"7fUAJdStEuGbc3sM84cKRL6yYaaSstyLSU4ve5oovLS7"
]
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"context": {
"slot": 1114
},
"value": {
"amount": "9864",
"decimals": 2,
"uiAmount": 98.64,
"uiAmountString": "98.64"
}
}
}