eth_getTransactionByBlockNumberAndIndex

The eth_getTransactionByBlockNumberAndIndex method returns information about a transaction by block number and transaction index position on the Optimism network. Similar to eth_getTransactionByBlockHashAndIndex but uses block number instead of hash, making it more convenient when working with sequential block processing or when you know the block height.


Parameters

parameter
type
description
blockParameter
string (required)
Block number in hex or tag (latest, earliest, pending)
transactionIndex
string (required)
Transaction index position in hex
Return Object

Returns the transaction object at the specified position in the block. Includes complete transaction details including sender, recipient, gas parameters, value, and transaction data.

Request Example
Request
Response Example
Response

Share on
Share on FacebookShare on XShare on LinkedIn
Did you find this page useful?