eth_getTransactionByBlockHashAndIndex

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

Ethereum.org API Reference

Parameters

  1. DATA, 32 Bytes - hash of a block. REQUIRED

  2. QUANTITY - integer of the transaction index position. REQUIRED

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. null when its pending.

  • blockNumber: QUANTITY - block number where this transaction was in. null when 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. null when its a contract creation transaction.

  • transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending.

  • value: QUANTITY - value transferred in Wei.

  • v: QUANTITY - ECDSA recovery id

  • r: QUANTITY - ECDSA signature r

  • s: QUANTITY - ECDSA signature s

Example

Request

curl --request POST \
     --url https://endpoints.omniatech.io/v1/RPC_ENDPOINT \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByBlockHashAndIndex",
  "params": ["0x14834c13eec4b47be4fb4c8a4190f966af5eb9735b446b7ccd8120b5f5763a59", "0x0"]
}
'

Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "blockHash": "0x14834c13eec4b47be4fb4c8a4190f966af5eb9735b446b7ccd8120b5f5763a59",
        "blockNumber": "0x1127101",
        "from": "0xae2fc483527b8ef99eb5d9b44875f005ba1fae13",
        "gas": "0x4515f",
        "gasPrice": "0x6a44cc24f",
        "maxFeePerGas": "0x6a44cc24f",
        "maxPriorityFeePerGas": "0x0",
        "hash": "0x6ac3b69c7cf01be86bb4600781fc9840e5f46ec714e17c3bd1e1d00fc05c30dc",
        "input": "0x01341996a0e584d8f99dec32b9d2f4edfa7c2036769c8d0536cfcb391a81a460ea6fd96a73d5672f1f4aa684697d4b44cc038d27280023bc80c92d",
        "nonce": "0x11f0f9",
        "to": "0x6b75d8af000000e20b7a7ddf000ba900b4009a80",
        "transactionIndex": "0x0",
        "value": "0x34327eb",
        "type": "0x2",
        "accessList": [
            {
                "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                "storageKeys": [
                    "0x12231cd4c753cb5530a43a74c45106c24765e6f81dc8927d4f4be7e53315d5a8",
                    "0x22005c0d64c5ceb5918f111eba7d3133da5f1edf0b66edb57b7122083bc72305",
                    "0x69cca0f4d624fd4aace8d6acb115f9667fa5fb9dbc2f95c1ba1dac3dfa772a23"
                ]
            },
            {
                "address": "0x96a0e584d8f99dec32b9d2f4edfa7c2036769c8d",
                "storageKeys": [
                    "0x0000000000000000000000000000000000000000000000000000000000000007",
                    "0x0000000000000000000000000000000000000000000000000000000000000009",
                    "0x000000000000000000000000000000000000000000000000000000000000000a",
                    "0x000000000000000000000000000000000000000000000000000000000000000c",
                    "0x0000000000000000000000000000000000000000000000000000000000000008",
                    "0x0000000000000000000000000000000000000000000000000000000000000006"
                ]
            },
            {
                "address": "0x374887ef78222c6bff0b0047e44ad2ed3ace07f3",
                "storageKeys": [
                    "0x0000000000000000000000000000000000000000000000000000000000000005",
                    "0x59c5a0582853b22cec98b71efaf11d4e6e716112079a141dde18505c4b33c6eb",
                    "0x001ad44e8e7a5296af41ce323084e494eda0e398ff1a7eb16db0503d31de5e6f",
                    "0xfc9f954ca7b2f8f907ce8f2fb41f6b47a0b71f38ddb5bf6d35bf28c11437ce30",
                    "0x000000000000000000000000000000000000000000000000000000000000000e",
                    "0xb39e9ba92c3c47c76d4f70e3bc9c3270ab78d2592718d377c8f5433a34d3470a",
                    "0x000000000000000000000000000000000000000000000000000000000000000a",
                    "0x0000000000000000000000000000000000000000000000000000000000000008",
                    "0x9d47075c5aa4f61816fd5980980bfffbeb5144c1418ad15362d36c673ab74c51",
                    "0x5360a0c34bd7ba8a6e2c5a58cd447e1919ba274a38195a871f7b24f5009b16d4",
                    "0x49d38e34930b9aaa105cc332325d4a561402847e01bf67532467755731c9cb6e"
                ]
            },
            {
                "address": "0x81a460ea6fd96a73d5672f1f4aa684697d4b44cc",
                "storageKeys": [
                    "0x0000000000000000000000000000000000000000000000000000000000000008",
                    "0x0000000000000000000000000000000000000000000000000000000000000006",
                    "0x0000000000000000000000000000000000000000000000000000000000000007",
                    "0x0000000000000000000000000000000000000000000000000000000000000009",
                    "0x000000000000000000000000000000000000000000000000000000000000000a",
                    "0x000000000000000000000000000000000000000000000000000000000000000c"
                ]
            },
            {
                "address": "0x43d7e65b8ff49698d9550a7f315c87e67344fb59",
                "storageKeys": [
                    "0xc2bb861d233e1c95a905a377a41b39fea66a8e7909a8176255695b218b60dd2e",
                    "0x0000000000000000000000000000000000000000000000000000000000000005",
                    "0x0000000000000000000000000000000000000000000000000000000000000006",
                    "0xb39e9ba92c3c47c76d4f70e3bc9c3270ab78d2592718d377c8f5433a34d3470a",
                    "0x0000000000000000000000000000000000000000000000000000000000000007",
                    "0xa73ce99dd8ac76dea6de890fa71300accfde755b97bf1c541aef9615de6bbc24",
                    "0x9bb3e24e1534bce24e9896f3377327d742d6c1d430477b7ebc070c2eb64e3147"
                ]
            }
        ],
        "chainId": "0x1",
        "v": "0x0",
        "r": "0x93d386d4ce5dc9ea07b3d5a244328ff4af3c3512ac3bd9a84ae57379fc81a9fd",
        "s": "0x4aba43edb73da88422b9503135efdb5a6df82cc76805992a6413384a3170d78"
    }
}

Last updated