BNB Smart Chain

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 status flag (0x1 success, 0x0 revert).
  • Decode the emitted logs to update application state — for example PancakeSwap Swap events or Venus Mint events.
  • Read contractAddress to discover where a freshly deployed BEP-20 contract now lives on chain.
  • Multiply gasUsed by effectiveGasPrice to compute the precise BNB fee the sender actually paid.

Parameters

#NameTypeRequiredDescription
1transactionHashstring (hex)YesThe hash of the mined transaction.

Response

TypeDescription
object | nullReceipt 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

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionReceipt",
"params": ["0x0000000000000000000000000000000000000000000000000000000000000000"],
"id": 1
}'

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32602Invalid paramsTransaction 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 status of 0x0 means 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_getBlockReceipts once 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

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionReceipt","params":[""]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.