BNB Smart Chain
eth_getTransactionReceipt
BNB Smart Chain (chain ID 56, native token BNB) settles transactions in roughly three seconds under its PoSA consensus, and eth_getTransactionReceipt is how you read the outcome once a transaction has been mined. Point it at the TheRPC endpoint https://bsc.therpc.io/YOUR_API_KEY with a transaction hash and it returns the full execution receipt for that mined transaction: the success-or-revert status flag, the exact amount of gas consumed, the effective gas price actually charged, and every BEP-20 event log the call emitted. Until the transaction lands in a block the receipt does not exist, so a null answer simply means it is still in flight.
Use cases
- Confirm after mining whether a BNB transfer or swap succeeded by reading the
statusflag (0x1success,0x0revert). - Decode the emitted
logsto update application state — for example PancakeSwapSwapevents or VenusMintevents. - Read
contractAddressto discover where a freshly deployed BEP-20 contract now lives on chain. - Multiply
gasUsedbyeffectiveGasPriceto compute the precise BNB fee the sender actually paid.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | transactionHash | string (hex) | Yes | The hash of the mined transaction. |
Response
| Type | Description |
|---|---|
| object | null | Receipt object containing: transactionHash, transactionIndex, blockHash, blockNumber, from, to, contractAddress (non-null only for contract deployments), gasUsed, cumulativeGasUsed, effectiveGasPrice, status ("0x1" success / "0x0" revert), logs (array of log objects), logsBloom, type. Returns null f |
Example request
Try it live in the BNB Smart Chain playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Transaction hash is malformed. |
Common pitfalls
- A pending transaction has no receipt yet, so the response is
null; poll on the ~3-second block cadence until it turns non-null instead of assuming instant availability. - A
statusof0x0means the transaction was mined but reverted — the BNB spent on gas is gone even though no state change stuck. - When ingesting whole blocks, call
eth_getBlockReceiptsonce per block rather than firing one receipt request per transaction hash; it is far cheaper at scale.
Supported networks
- Mainnet — Chain ID: 56
- Testnet — Chain ID: 97
See also
Parameters
0x-prefixed 32-byte transaction hash