BNB Smart Chain
trace_block
A BSC block closes about every three seconds, and on a busy one that can mean a few hundred transactions packed with BEP-20 transfers and DeFi calls. trace_block hands you the call-tree trace for all of them at once. Pass a height in hex or a tag like latest; you get back a single flat array where each entry names a call, create, or self-destruct action and carries the transactionPosition of the transaction that produced it. Point the request at chain ID 56 on https://bsc.therpc.io/YOUR_API_KEY. This is the block-wide view, tuned for fund-flow and MEV work rather than opcode-by-opcode debugging. It is heavy, and it only runs against a trace-enabled archive node.
Use cases
- Pull every internal transaction in a block in one shot to feed an indexer or analytics pipeline.
- Spot sandwiches and back-runs by reading MEV activity across all the transactions in a single block.
- Watch BNB and token value move into and out of a contract over the span of one whole block.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | blockParameter | string | Yes | Block whose transactions to trace. |
Response
| Type | Description |
|---|---|
| array | Flat array of all trace objects across all transactions in the block. Each object has the same shape as individual entries from trace_transaction, with `transactionPosition` indicating which transaction it belongs to. |
Example request
Try it live in the BNB Smart Chain playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32601 | Method not found | trace namespace not enabled or not supported by this client. |
-32602 | Invalid params | blockParameter is malformed or not a recognized tag. |
-32000 | block not found | Block does not exist or trace archive data is unavailable. |
Common pitfalls
- One call returns every trace for every transaction, so a high-throughput BSC block can produce a very large payload.
- The trace namespace runs only on a trace-enabled archive node, and plenty of public endpoints either hide it or throttle it on lower tiers.
- Skip the
pendingtag for production data. Those traces can still change before the block finalizes.
Supported networks
- Mainnet — Chain ID: 56
- Testnet — Chain ID: 97
See also
Parameters
hex block number or "latest" | "earliest" | "pending"