eth_getTransactionByBlockNumberAndIndex
Retrieve a transaction by its position within a block using block number and transaction index. Returns details including hash, from, to, value, and gas.
Instructions
Retrieves a transaction by its position within a specific block using block number and transaction index.
Args:
blockNumber (string): Block number as hex (e.g., '0x10d4f') or tag ('latest', 'earliest', 'pending')
transactionIndex (string): Zero-based position of the transaction in the block as hex (e.g., '0x0')
network (string, optional): Ethereum network to query, defaults to 'mainnet'
Returns:
Transaction object with hash, from, to, value, gas, gasPrice, input, nonce, blockHash, blockNumber, transactionIndex; null if not found
Examples:
"Get first transaction in latest block": { "blockNumber": "latest", "transactionIndex": "0x0" }
"Get transaction at index 5 in specific block": { "blockNumber": "0x10d4f", "transactionIndex": "0x5" }
Errors:
InvalidParams: When blockNumber or transactionIndex format is invalid
InternalError: When Infura API is unavailable
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockNumber | Yes | The block number or tag (latest, earliest, pending). | |
| transactionIndex | Yes | The transaction index position. | |
| network | No | The Ethereum network to query, e.g., 'mainnet' or 'sepolia'. | mainnet |
| response_format | No | Output format: 'json' for structured data, 'markdown' for human-readable. | json |