BNB Smart Chain
BNB Smart Chain
eth_getBalance
eth_getBalance reports how much BNB an address holds at a chosen block. BNB is the native gas token of BNB Smart Chain. Pass an account and a block tag to https://bsc.therpc.io/YOUR_API_KEY (chain ID 56), and the node returns that account's spendable balance as hex wei, snapshotted at the height you named. BSC reaches deterministic finality, so a balance read at a finalized block is a stable, reorg-safe figure you can record with confidence.
Use cases
- Show an account's BNB holdings in a wallet header or portfolio view.
- Confirm the sender has enough BNB to cover value plus gas before estimating or broadcasting.
- Poll an address across new blocks to spot an incoming BNB deposit within seconds.
- Read the balance at a specific historical height for accounting, audits, or on-chain forensics (archive node required).
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | address | string (hex) | Yes | The account address to query. |
| 2 | blockTag | string | No | Block at which to read the balance.Default: latest |
Response
| Type | Description |
|---|---|
| string (hex) | Hex-encoded balance in wei. Convert with BigInt(value); divide by 10n**18n to get the chain's base unit. |
Example request
Try it live in the BNB Smart Chain playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Address is malformed, missing 0x prefix, or block tag is unrecognised. |
-32000 | Missing trie node | Queried a historical block that the node has pruned (non-archive node). |
Common pitfalls
- A BNB balance in wei easily exceeds 2^53, so
Number()silently loses precision. Parse withBigInt(value)every time. - A balance read at
latestcan still be unwound by a reorg before finality; for any system of record, read at"finalized"instead. - This only covers native BNB; a BEP-20 token balance lives in the token contract and must be fetched with
eth_callto itsbalanceOf.
Supported networks
- Mainnet — Chain ID: 56
- Testnet — Chain ID: 97
See also
Parameters
0x-prefixed 20-byte address
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"