eth_getTransactionByBlockNumberAndIndex
Returns information about a transaction identified by a block number and the transaction’s index position within that block.
Parameters
Section titled “Parameters”| Position | Name | Type | Description |
|---|---|---|---|
| 1 | block | string | Block number in hex, or "latest", "pending", "safe", "finalized", "earliest". Required. |
| 2 | index | string | The transaction index position as a hexadecimal integer. Required. |
Returns
Section titled “Returns”| Field | Type | Description |
|---|---|---|
result | object | null | A transaction object, or null if not found. See eth_getTransactionByHash for the full field list. |
Example
Section titled “Example”Request
Section titled “Request”{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1}Response
Section titled “Response”The example below is a type 0x7e deposit transaction at index 0x0, which carries the OP Stack deposit fields (sourceHash, mint, depositReceiptVersion). See eth_getTransactionByHash for the full field list.
{ "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x491bca01d4bc076d60833dbd973fe031a74e7ae31866bf70d077619e09edb6ff", "blockNumber": "0x2c31b0b", "depositReceiptVersion": "0x1", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0x03c8f106f18ad94190e763e21b584c5825b2f4c61f1274c0e8abe65b4476cd51", "input": "0x3db6be2b...", "mint": "0x0", "nonce": "0x2c31b0e", "r": "0x0", "s": "0x0", "sourceHash": "0xe40ffb1b9f98a24b21e90e3a3cfe49de1eed195618e943da4d029881d3b3e055", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "type": "0x7e", "v": "0x0", "value": "0x0", "yParity": "0x0" }}