Unichain
Unichain

eth_getTransactionByBlockNumberAndIndex
The eth_getTransactionByBlockNumberAndIndex method returns detailed information about a transaction by specifying its position (index) within a block identified by the block's number or tag. This method is particularly useful for retrieving transactions from known block heights or special blocks like "latest".
Use Cases
- Real-time transaction monitoring
- Block explorer functionality
- Specific transaction analysis
- Historical data extraction
- Transaction verification
- Sequential transaction processing
- Smart contract interaction analysis
- Mempool investigation (using "pending" tag)
Method Details
This method locates a transaction using both a block number (or tag) and the transaction's index within that block.
Response Example
Block Tag Meanings
latest: The most recently mined blockearliest: Genesis block (block 0)pending: Currently pending block (transactions in mempool)safe: Latest block considered safe by networkfinalized: Latest block that has achieved finality
See also
Parameters
Block number in hex format or tags: latest, earliest, pending, safe, finalized
The transaction's index position in the block (hexadecimal)