BNB Smart Chain
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
BNB Smart Chain
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
When you are stepping through BNB Smart Chain by height rather than by hash, eth_getTransactionByBlockNumberAndIndex is the tool to reach a single transaction. Pass a hex block number or a tag such as latest or pending, add a zero-based hex index, and the node returns that one transaction object. You get null if the height or position has no entry. BNB Smart Chain charges gas in BNB and seals blocks about every three seconds, so iterating height-by-height keeps pace with a quick chain. Send each request to https://bsc.therpc.io/YOUR_API_KEY on chain ID 56.
pending tag with its index.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockTag | string | 是 | The block containing the transaction. |
| 2 | transactionIndex | string (hex) | 是 | Zero-based position of the transaction within the block. |
| 类型 | 描述 |
|---|---|
| object | null | Same transaction object as eth_getTransactionByHash. Returns null if block or index not found. |
Try it live in the BNB Smart Chain playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or transaction index is not a valid hex integer. |
"0x0" for the leading transaction, never a plain numeric 0.pending tag orders and exposes queued transactions is not uniform across node clients, so do not depend on stable positions there.参数
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"
0x-prefixed hex integer (e.g. "0x0" for the first transaction)