BNB Smart Chain
eth_getTransactionByHash
A transaction hash is the canonical handle for any payment or contract call on BNB Smart Chain, and eth_getTransactionByHash turns that handle back into the full object: sender, recipient, BNB value, gas fields, input calldata, signature, and the block it landed in. The hash is the same value bscscan.com shows on its explorer pages, so you can copy one straight across. Point the query at https://bsc.therpc.io/YOUR_API_KEY on chain ID 56; a still-pending or unknown transaction comes back with null block fields or null outright, which is how you tell mined from unmined.
Use cases
- Check that a transaction you broadcast actually made it into a BSC block by testing whether
blockNumberis no longer null. - Decode the
inputcalldata against an ABI to discover which contract function the transaction invoked and with what arguments. - Pull the
fromaddress and BNBvalueto verify an incoming payment matches what your application expected.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | transactionHash | string (hex) | Yes | The hash of the transaction to retrieve. |
Response
| Type | Description |
|---|---|
| object | null | Transaction object containing: hash, nonce, blockHash, blockNumber, transactionIndex, from, to (null for contract creation), value (hex wei), gas, gasPrice / maxFeePerGas / maxPriorityFeePerGas, input, type, accessList (type-1/2), chainId, v, r, s. Returns null if not found or still pending (blockHa |
Example request
Try it live in the BNB Smart Chain playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Transaction hash is malformed or not 32 bytes. |
Common pitfalls
- Getting an object back proves only that the transaction exists, not that it succeeded. Fetch the receipt and read its
statusfield to learn whether execution reverted. - A transaction still sitting in the mempool comes back populated but with
blockHash,blockNumber, andtransactionIndexall set to null. - Dropped or never-broadcast hashes resolve to
null, so always null-check the response before you reach into its fields.
Supported networks
- Mainnet — Chain ID: 56
- Testnet — Chain ID: 97
See also
- eth_getTransactionReceipt
- eth_getTransactionByBlockHashAndIndex
- eth_getTransactionByBlockNumberAndIndex
Parameters
0x-prefixed 32-byte transaction hash