Avalanche
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Avalanche
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_getTransactionByBlockNumberAndIndex returns a single transaction by its position inside an Avalanche C-Chain block, where the block is named by a height (hex) or a tag like latest or pending, and the transaction by its zero-based index. The payload is the same transaction object as eth_getTransactionByHash — sender, recipient, AVAX value, gas fields, input — but addressed by block-and-position rather than by hash. With the C-Chain producing blocks every 1–2 seconds under Snowman consensus, this is handy for sequential height-based scans. Send the request to https://avalanche.therpc.io/YOUR_API_KEY (chain ID 43114, 0xa86a).
pending tag to peek at queued mempool transactions.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 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 Avalanche playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or transaction index is not a valid hex integer. |
"0x0" for the first transaction, not the integer 0.pending tag's behavior (which transactions appear and in what order) depends on the node client, so treat pending results as a best-effort snapshot, not a settled C-Chain block.参数
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"
0x-prefixed hex integer (e.g. "0x0" for the first transaction)