Powered By GitBook
eth_getTransactionByBlockNumberAndIndex
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.
1
params: [
2
'latest', // 668
3
'0x0' // 0
4
]
Copied!

Returns

​Example​

Request
Curl
Postman
1
curl https://eth-mainnet.alchemyapi.io/v2/your-api-key \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["latest", "0x0"],"id":0}'
Copied!
1
URL: https://eth-mainnet.alchemyapi.io/v2/your-api-key
2
RequestType: POST
3
Body:
4
{
5
"jsonrpc":"2.0",
6
"method":"eth_getTransactionByBlockNumberAndIndex",
7
"params":["latest", "0x0"],
8
"id":0
9
}
Copied!
Result
1
{
2
"jsonrpc": "2.0",
3
"id": 0,
4
"result": {
5
"blockHash": "0xf345d6ac2cb6290489915178fef0b2fc7f5a7312dd06773c77532de6740b2b4d",
6
"blockNumber": "0xa1c0ff",
7
"from": "0x79c384ac9c32e90f00a214c77caac1392ec8cdea",
8
"gas": "0xafbe",
9
"gasPrice": "0x1270b01800",
10
"hash": "0x61b27f711f58ee3090c0976c7e90d2b7eafeb7b889f0db593234f04f8ce07f22",
11
"input": "0xa9059cbb0000000000000000000000004b1a99467a284cc690e3237bc69105956816f7620000000000000000000000000000000000000000000000000000001919617600",
12
"nonce": "0xa",
13
"to": "0xf9e5af7b42d31d51677c75bbbd37c1986ec79aee",
14
"transactionIndex": "0x0",
15
"value": "0x0",
16
"v": "0x1b",
17
"r": "0x2123cdbd1130f726ebed55fd2295239778dd4161495d2733f374d7863fc42ab1",
18
"s": "0x1f08fd53ff2c3969b88d5e622561d62a799ae68e36f5142689dbfde44bbe1bed"
19
}
20
}
Copied!
Last modified 2mo ago
Copy link