POST
/
efb0a5eccd2caa5135eb54eba6f7f300
curl --request POST \
  --url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "eth_getRawTransactionByBlockNumberAndIndex",
  "id": 1,
  "params": [
    "0x6ecf0b4",
    "0x1"
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}

Optimism API method eth_getRawTransactionByBlockNumberAndIndex retrieves the raw transaction data as a hexadecimal string for a transaction in a specific block, identified by the block number and the transaction’s index position within that block. This method is useful for obtaining the complete transaction data, including its signature, without needing the transaction hash.

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

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

Response

  • result — the raw transaction data as a hexadecimal string.

Use case

The eth_getRawTransactionByBlockNumberAndIndex method is essential for:

  • Services that need to verify or inspect the complete transaction data and signature.
  • Wallets and exchanges that require the raw transaction for auditing or processing purposes.
  • Developers and tools that analyze transactions at a low level for security, performance, or other research purposes.

Body

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

Response

200 - application/json
Raw transaction data for the given block number and index
jsonrpc
string
id
integer
result
string