API Reference

eth_getTransactionByBlockNumberAndIndex - Optimism

Returns information about a transaction by block number and transaction index position.

Parameters

  • QUANTITY|TAG - A block number, or the string "earliest", "latest" or "pending", as in the default block parameter.
  • QUANTITY - the transaction index position.
params: [ "latest", // 668 "0x0", // 0 ];

Returns

See eth_getTransactionByHash


Example

Request

curl https://opt-mainnet.unifra.io/v1/your-api-key \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["latest", "0x0"],"id":0}'
URL: https://opt-mainnet.unifra.io/v1/your-api-key RequestType: POST Body: { "jsonrpc":"2.0", "method":"eth_getTransactionByBlockNumberAndIndex", "params":["latest", "0x0"], "id":0 }

Result

{ "jsonrpc": "2.0", "id": 0, "result": { "blockHash": "0x02b853cf50bc1c335b70790f93d5a390a35a166bea9c895e685cc866e4961cae", "blockNumber": "0x1b4", "from": "0x3b179dcfc5faa677044c27dce958e4bc0ad696a6", "gas": "0x11cbbdc", "gasPrice": "0x0", "hash": "0x2642e960d3150244e298d52b5b0f024782253e6d0b2c9a01dd4858f7b4665a3f", "input": "0xd294f093", "nonce": "0xa2", "to": "0x4a16a42407aa491564643e1dfc1fd50af29794ef", "transactionIndex": "0x0", "value": "0x0", "v": "0x38", "r": "0x6fca94073a0cf3381978662d46cf890602d3e9ccf6a31e4b69e8ecbd995e2bee", "s": "0xe804161a2b56a37ca1f6f4c4b8bce926587afa0d9b1acc5165e6556c959d583", "queueOrigin": "sequencer", "txType": "", "l1TxOrigin": null, "l1BlockNumber": "0xc1a65c", "l1Timestamp": "0x60d34b60", "index": "0x1b3", "queueIndex": null, "rawTransaction": "0xf86681a28084011cbbdc944a16a42407aa491564643e1dfc1fd50af29794ef8084d294f09338a06fca94073a0cf3381978662d46cf890602d3e9ccf6a31e4b69e8ecbd995e2beea00e804161a2b56a37ca1f6f4c4b8bce926587afa0d9b1acc5165e6556c959d583" } }
Path Params
string
required
Body Params
string
Defaults to 2.0
string
Defaults to eth_getTransactionByBlockNumberAndIndex
params
array of strings
params
int32
Defaults to 0
Responses

Language
Click Try It! to start a request and see the response here! Or choose an example:
application/json