Returns transaction information by block number and transaction index.
eth_getTransactionByBlockNumberAndIndex
JSON-RPC method returns transaction information by block number and transaction index. This method is ideal for sequential transaction processing and building comprehensive blockchain datasets when working with block numbers.
blockNumber
(string, required) — Block identifier: "latest"
, "earliest"
, "pending"
, or a specific block number in hexadecimaltransactionIndex
(string, required) — The index position of the transaction in the block as a hexadecimal string (0-based)null
if the transaction is not found.
hash
— The 32-byte transaction hashnonce
— Transaction nonce (number of transactions sent by sender)blockHash
— Hash of the block containing the transactionblockNumber
— Number of the block containing the transactiontransactionIndex
— Index of the transaction in the blockfrom
— Address of the transaction senderto
— Address of the transaction receiver (null for contract creation)value
— Value transferred in wei as a hexadecimal stringgas
— Gas limit provided by the sendergasPrice
— Gas price provided by the sender in weiinput
— Data sent along with the transactionv
, r
, s
— ECDSA signature componentstype
— Transaction type (0x0 for legacy, 0x1 for EIP-2930, 0x2 for EIP-1559)"latest"
— Most recent block’s transactions"earliest"
— Genesis block transactions (usually none)"pending"
— Pending block transactions"0x0"
— Genesis block"0x9d0c37"
— Block 10,291,255 (decimal)eth_getTransactionByBlockNumberAndIndex
method is essential for applications that need to:
"latest"
and "pending"
, making it suitable for both historical analysis and real-time transaction monitoring.Successful response with transaction information
The response is of type object
.