POST
/
efb0a5eccd2caa5135eb54eba6f7f300
curl --request POST \
  --url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByBlockHashAndIndex",
  "id": 1,
  "params": [
    "0x7e4aea365093a183b0df5f003f26144ef04ec8a6e7f4910356590c5fc7b1671f",
    "0x1"
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {
    "blockHash": "<string>",
    "blockNumber": "<string>",
    "from": "<string>",
    "gas": "<string>",
    "gasPrice": "<string>",
    "hash": "<string>",
    "input": "<string>",
    "nonce": "<string>",
    "to": "<string>",
    "transactionIndex": "<string>",
    "value": "<string>",
    "v": "<string>",
    "r": "<string>",
    "s": "<string>"
  }
}

Optimism API method eth_getTransactionByBlockHashAndIndex retrieves information about a transaction by specifying the block hash and the transaction’s index position within the block. This method is useful for fetching specific transactions when the block hash and index are known.

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • blockHash — the hash of the block.
  • transactionIndex — the index position of the transaction in the block, specified as a hexadecimal. The example uses "0x1".

Response

  • result — an object containing details about the transaction, including the block hash, block number, from address, gas used, gas price, hash, input data, nonce, to address, transaction index, value transferred, and the signature components (v, r, s).

Use case

The eth_getTransactionByBlockHashAndIndex method is essential for:

  • Applications that need to retrieve specific transactions from a known block for analysis or display.
  • Services that monitor blocks and transactions for security, compliance, or other operational reasons.
  • Tools that reconstruct transaction sequences within blocks for auditing or forensic purposes.

Body

application/json
jsonrpc
string
default:2.0
required
method
string
default:eth_getTransactionByBlockHashAndIndex
required
id
integer
default:1
required
params
string[]
required

Response

200 - application/json
Transaction information for the given block hash and index
jsonrpc
string
id
integer
result
object