eth_getTransactionByBlockHashAndIndex - Optimism
Returns information about a transaction by block hash and transaction index position.

Parameters

DATA, 32 Bytes - hash of a block.
QUANTITY - integer of the transaction index position.
1
params: [
2
'0x02b853cf50bc1c335b70790f93d5a390a35a166bea9c895e685cc866e4961cae',
3
'0x0' // 0
4
]
Copied!

Returns

Request
Curl
Postman
1
curl https://opt-mainnet.g.alchemyapi.io/v2/your-api-key \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params":["0x02b853cf50bc1c335b70790f93d5a390a35a166bea9c895e685cc866e4961cae", "0x0"],"id":0}'
Copied!
1
URL: https://opt-mainnet.g.alchemyapi.io/v2/your-api-key
2
RequestType: POST
3
Body:
4
{
5
"jsonrpc":"2.0",
6
"method":"eth_getTransactionByBlockHashAndIndex",
7
"params":["0x02b853cf50bc1c335b70790f93d5a390a35a166bea9c895e685cc866e4961cae", "0x0"],
8
"id":0
9
}
Copied!
Result
1
{
2
"jsonrpc": "2.0",
3
"id": 0,
4
"result": {
5
"blockHash": "0x02b853cf50bc1c335b70790f93d5a390a35a166bea9c895e685cc866e4961cae",
6
"blockNumber": "0x1b4",
7
"from": "0x3b179dcfc5faa677044c27dce958e4bc0ad696a6",
8
"gas": "0x11cbbdc",
9
"gasPrice": "0x0",
10
"hash": "0x2642e960d3150244e298d52b5b0f024782253e6d0b2c9a01dd4858f7b4665a3f",
11
"input": "0xd294f093",
12
"nonce": "0xa2",
13
"to": "0x4a16a42407aa491564643e1dfc1fd50af29794ef",
14
"transactionIndex": "0x0",
15
"value": "0x0",
16
"v": "0x38",
17
"r": "0x6fca94073a0cf3381978662d46cf890602d3e9ccf6a31e4b69e8ecbd995e2bee",
18
"s": "0xe804161a2b56a37ca1f6f4c4b8bce926587afa0d9b1acc5165e6556c959d583",
19
"queueOrigin": "sequencer",
20
"txType": "",
21
"l1TxOrigin": null,
22
"l1BlockNumber": "0xc1a65c",
23
"l1Timestamp": "0x60d34b60",
24
"index": "0x1b3",
25
"queueIndex": null,
26
"rawTransaction": "0xf86681a28084011cbbdc944a16a42407aa491564643e1dfc1fd50af29794ef8084d294f09338a06fca94073a0cf3381978662d46cf890602d3e9ccf6a31e4b69e8ecbd995e2beea00e804161a2b56a37ca1f6f4c4b8bce926587afa0d9b1acc5165e6556c959d583"
27
}
28
}
Copied!
Optimism API
Alchemy Documentation
Copy link
Contents