curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance \
--header 'Content-Type: application/json' \
--data '
{
"account_identifier": {
"address": "41608f8da72479edc7dd921e4c30bb7e7cddbe722e"
},
"block_identifier": {
"hash": "0000000004986736812cbf15ffbcdd229bd3d76a595db895719867cc2da3a5bd",
"number": 77096758
},
"visible": false
}
'{
"balance": 123,
"frozen": [
{
"frozen_balance": 123,
"expire_time": 123
}
],
"delegated_frozenV2": [
{
"type": "<string>",
"frozen_balance": 123
}
],
"undelegated_frozenV2": [
{
"type": "<string>",
"unfreeze_amount": 123,
"unfreeze_expire_time": 123
}
]
}curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance \
--header 'Content-Type: application/json' \
--data '
{
"account_identifier": {
"address": "41608f8da72479edc7dd921e4c30bb7e7cddbe722e"
},
"block_identifier": {
"hash": "0000000004986736812cbf15ffbcdd229bd3d76a595db895719867cc2da3a5bd",
"number": 77096758
},
"visible": false
}
'{
"balance": 123,
"frozen": [
{
"frozen_balance": 123,
"expire_time": 123
}
],
"delegated_frozenV2": [
{
"type": "<string>",
"frozen_balance": 123
}
],
"undelegated_frozenV2": [
{
"type": "<string>",
"unfreeze_amount": 123,
"unfreeze_expire_time": 123
}
]
}account_identifier.address — the account address to query. Use base58 with visible: true, or hex with visible: false.block_identifier — required object specifying the block to query. Provide both the 32‑byte hash (64 hex chars) and the matching number.visible — optional boolean for address format. Default is false (hex).balance — available TRX balance (in sun, where 1 TRX = 1,000,000 sun)frozen — array of frozen balance information
frozen_balance — amount of TRX frozenexpire_time — expiration timestamp for frozen balancedelegated_frozenV2 — delegated frozen balance information for v2 stakingundelegated_frozenV2 — undelegated frozen balance information for v2 stakingwallet/getaccountbalance method is used for:
curl --request POST \
--url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance' \
--header 'Content-Type: application/json' \
--data '{
"account_identifier": { "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" },
"block_identifier": { "hash": "0000000004986736812cbf15ffbcdd229bd3d76a595db895719867cc2da3a5bd", "number": 77096758 },
"visible": true
}'
curl --request POST \
--url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance' \
--header 'Content-Type: application/json' \
--data '{
"account_identifier": { "address": "41608f8da72479edc7dd921e4c30bb7e7cddbe722e" },
"block_identifier": { "hash": "0000000004986736812cbf15ffbcdd229bd3d76a595db895719867cc2da3a5bd", "number": 77096758 },
"visible": false
}'
INVALID hex String by providing a real 32‑byte block hash (64 hex chars).account_identifier is null by passing account_identifier: { address: ... } rather than a top‑level address.block_identifier null and hash length not equals 32 by always including block_identifier.hash with 64 hex chars, and block_identifier.number that matches the same block.wallet/getnowblock to fetch the latest block and copy the blockID field as the block_identifier.hash value.curl --request POST \
--url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getnowblock' \
--header 'Content-Type: application/json'
wallet/getblockbynum and use its blockID.blockID, resolve its block number, and immediately query the balance at that block.# requires jq
BLOCK_ID=$(curl -s -X POST \
'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getnowblock' \
-H 'Content-Type: application/json' | jq -r '.blockID')
NUMBER=$(curl -s -X POST \
'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getblockbyid' \
-H 'Content-Type: application/json' \
--data "{\"value\": \"$BLOCK_ID\"}" | jq -r '.block_header.raw_data.number')
curl --request POST \
--url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance' \
--header 'Content-Type: application/json' \
--data "{\n \"account_identifier\": { \"address\": \"41608f8da72479edc7dd921e4c30bb7e7cddbe722e\" },\n \"block_identifier\": { \"hash\": \"$BLOCK_ID\", \"number\": $NUMBER },\n \"visible\": false\n}"
jq is not available, use Python instead:BLOCK_ID=$(curl -s -X POST \
'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getnowblock' \
-H 'Content-Type: application/json' | python3 -c 'import sys,json; print(json.load(sys.stdin)["blockID"])')
NUMBER=$(curl -s -X POST \
'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getblockbyid' \
-H 'Content-Type: application/json' \
--data "{\"value\": \"$BLOCK_ID\"}" | python3 -c 'import sys,json; print(json.load(sys.stdin)["block_header"]["raw_data"]["number"])')
curl --request POST \
--url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance' \
--header 'Content-Type: application/json' \
--data "{\n \"account_identifier\": { \"address\": \"41608f8da72479edc7dd921e4c30bb7e7cddbe722e\" },\n \"block_identifier\": { \"hash\": \"$BLOCK_ID\", \"number\": $NUMBER },\n \"visible\": false\n}"
Account balance information
Available TRX balance in sun
Was this page helpful?