BNB Smart Chain
BNB Smart Chain
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
BNB Smart Chain
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Within any BNB Smart Chain block, transactions are stored in a fixed order, and eth_getTransactionByBlockHashAndIndex reaches one of them by its position. Give the method a 32-byte block hash plus a zero-based hex index and it returns that single transaction object, or null when the block or slot does not exist. Because BNB Smart Chain pays its validators in BNB and finalizes blocks in around three seconds under PoSA, addressing a transaction by block hash pins it to one specific, immutable block. Route the lookup through https://bsc.therpc.io/YOUR_API_KEY on chain ID 56.
0x0 until the method returns null.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | 是 | The hash of 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 hash or transaction index is malformed. |
"0x0" — passing a bare integer 0 will be rejected as malformed.null back rather than an error, so guard against the null before reading fields.参数
0x-prefixed 32-byte block hash
0x-prefixed hex integer (e.g. "0x0" for the first transaction)