Base
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Base
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_getTransactionByBlockHashAndIndex returns one transaction from a Base block, located by the block's hash and the transaction's zero-based position within it. It is the positional counterpart to eth_getTransactionByHash: useful when you already hold a block hash and want to walk its transactions in order. Base is Coinbase's OP Stack optimistic rollup that settles to Ethereum L1 and uses ETH for gas, with its sequencer ordering transactions into ~2s blocks. Call it at https://base.therpc.io/YOUR_API_KEY (chain ID 8453, hex 0x2105) with a 32-byte block hash and a hex index. The reply is the full transaction object, or null if the block or index does not exist.
0x0 until the call 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 Base playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | Block hash or transaction index is malformed. |
"0x0" for the first transaction, not the integer 0.null rather than an error, so use that as your stop condition when iterating.参数
0x-prefixed 32-byte block hash
0x-prefixed hex integer (e.g. "0x0" for the first transaction)