Skip to content

eth_getTransactionByBlockNumberAndIndex

Returns information about a transaction identified by a block number and the transaction’s index position within that block.

PositionNameTypeDescription
1blockstringBlock number in hex, or "latest", "pending", "safe", "finalized", "earliest". Required.
2indexstringThe transaction index position as a hexadecimal integer. Required.
FieldTypeDescription
resultobject | nullA transaction object, or null if not found. See eth_getTransactionByHash for the full field list.
{
"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": ["latest", "0x0"],
"id": 1
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hash": "0x7ef8f8a0...",
"blockNumber": "0x158a0e9",
"transactionIndex": "0x0",
"type": "0x7e"
}
}