eth_getTransactionByBlockHashAndIndex
Retrieve a specific transaction from a block using its block hash and transaction index position. Returns transaction details like hash, value, gas, and more.
Instructions
Get a transaction by its position within a block identified by hash.
Args:
blockHash (string): 32-byte block hash (66 chars with 0x prefix).
index (string): Transaction index position as hex (e.g., '0x0' for first tx).
network (string, optional): Ethereum network to query. Defaults to 'mainnet'.
Returns:
Transaction object with hash, from, to, value, gas, gasPrice, input, nonce, etc. Returns null if not found.
Examples:
"Get first tx in block": { "blockHash": "0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238", "index": "0x0" }
"Get third tx on Sepolia": { "blockHash": "0x...", "index": "0x2", "network": "sepolia" }
Errors:
InvalidParams: When blockHash or index format is invalid.
InternalError: When Infura API is unavailable or returns an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockHash | Yes | The 32-byte hash of the block. | |
| index | 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 |