eth_getTransactionByBlockNumberAndIndex
Returns information about a transaction by block number and transaction index position.
This method will use 40 Compute Units.
Reference: Here
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: [
"0x29c", // 668
"0x0", // 0
]Returns
Object - A transaction object, or null when no transaction was found:
blockHash:DATA, 32 Bytes - hash of the block where this transaction was in.nullwhen its pending.blockNumber:QUANTITY- block number where this transaction was in.nullwhen its pending.from:DATA, 20 Bytes - address of the sender.gas:QUANTITY- gas provided by the sender.gasPrice:QUANTITY- gas price provided by the sender in Wei.hash:DATA, 32 Bytes - hash of the transaction.input:DATA- the data send along with the transaction.nonce:QUANTITY- the number of transactions made by the sender prior to this one.to:DATA, 20 Bytes - address of the receiver.nullwhen its a contract creation transaction.transactionIndex:QUANTITY- integer of the transactions index position in the block.nullwhen its pending.value:QUANTITY- value transferred in Wei.v:QUANTITY- ECDSA recovery idr:QUANTITY- ECDSA signature rs:QUANTITY- ECDSA signature s
// Result
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xdf15d721c064ad201f44fa868d19462b264b3ca7ad111b5dafe696c344af15b8",
"blockNumber": "0x8693195",
"from": "0x408ecfba0254d87150956a0fad3c4efb002f3b67",
"to": "0x5e1a6c0d03e52cff49e887468111471b0f134a7a",
"gas": "0x15e32",
"gasPrice": "0x165a0bc00",
"hash": "0x1afd338e7ce7c734895602dfd2ce1ee62225ff86594a8864153d8f7fcf467b2c",
"input": "0xfd221031",
"nonce": "0xe9",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x0",
"chainId": "0xc488",
"v": "0x18933",
"r": "0xe0ceb39b86701942e67365a241289d6e7de2fb2c0618bc814f638ffe9067ac2e",
"s": "0x61125b504737c9096182f781392a10031738c4c5cffcbd3c20f3163eef81bb4a"
}
}curl https://mainnet.somnia.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["0x8693195", "0x0"],"id":1}'
curl https://testnet.somnia.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["0x8693195", "0x0"],"id":1}'
Last updated
Was this helpful?