eth_getTransactionByBlockNumberAndIndex

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

Parameters

Object NameRequiredTypeDetail
BLOCK PARAMETERStringA hex code of an integer that represents the block number, "latest", "earliest" , "pending" , or hash of a block. The hash of a block is an object specified as: {"blockHash": "\<hash_value>"}. Learn more here.
TRANSACTION INDEX POSITIONStringA hex code of an integer that represents the position of a transaction in the block
"params": [
    "0xdce69b", 
    "0x0"
]

Result

A transaction object, or null if no transaction was found.

Result Fields

KeyTypeDetail
blockHashStringHash of the block where this transaction was in. null if the transaction is pending.
blockNumberStringA hex code of an integer that represents the block number where this transaction was in. null if the transaction is pending.
fromStringAddress the transaction is sent from.
gasStringA hex code of an integer that represents the gas provided by the sender.
gasPriceStringA hex code of an integer that represents the gas price provided by the sender in Wei.
hashStringHash of the transaction.
inputStringThe data send along with the transaction.
nonceStringA hex code of an integer that represents the number of transactions made by the sender prior to this one.
rStringECDSA signature r.
sStringECDSA signature s.
toStringAddress the transaction is directed to. null if it's a contract creation transaction.
transactionIndexStringA hex code of an integer that represents the transactions index position in the block. null when the transaction pending.
vStringECDSA recovery id
valueStringValue transferred in Wei.

Example

Request

curl <your-endpoint> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params": ["0xdce69b","0x0"],"id":1}'

Return

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "accessList": [
            {
                "address": "0x132a6e4fd04b862a83bf95127d23be2c3ab28502",
                "storageKeys": [
                    "0x9c04773acff4c5c42718bd0120c72761f458e43068a3961eb935577d1ed4effb",
                    "0x0000000000000000000000000000000000000000000000000000000000000008",
                    "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "0x0000000000000000000000000000000000000000000000000000000000000004",
                    "0x0000000000000000000000000000000000000000000000000000000000000002"
                ]
            },
            {
                "address": "0x9ab7bb7fdc60f4357ecfef43986818a2a3569c62",
                "storageKeys": [
                    "0x4f3d32a6466af317ba79d742bd642e0d05f4bcf70dfcc7b30862a4cf8e7bc1ca",
                    "0xd7fa724607f0099a23af608d4349fa746ec3dc5c61ec2cb8c207e33f2fb2263d"
                ]
            },
            {
                "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                "storageKeys": [
                    "0x37556f0fb4e18aeca81b9fcd32bc0671f82ce7ed07cafcc2b74f15592cd1044a",
                    "0x773a7876937c5ed0f82d77c27cb4373ce23050c0426752349794d61a1fbf51c6",
                    "0x99884f3adc166cb6bcbe49586c2a7fa85a9a620dd0f05f3f129d14caaeacb523"
                ]
            },
            {
                "address": "0x5c596c6a65f628fc1090853d8eb1927651e9d9b2",
                "storageKeys": [
                    "0x000000000000000000000000000000000000000000000000000000000000000c",
                    "0x0000000000000000000000000000000000000000000000000000000000000008",
                    "0x0000000000000000000000000000000000000000000000000000000000000006",
                    "0x0000000000000000000000000000000000000000000000000000000000000007",
                    "0x0000000000000000000000000000000000000000000000000000000000000009",
                    "0x000000000000000000000000000000000000000000000000000000000000000a"
                ]
            }
        ],
        "blockHash": "0x03512aadeff977a656714df25a7733958b89d94416f921f87d564bbcaf4109b8",
        "blockNumber": "0xdce69b",
        "chainId": "0x1",
        "from": "0x26ccc3a2052be5898d60683c7bb621047153bb19",
        "gas": "0x3a41f",
        "gasPrice": "0xbf1083598",
        "hash": "0x50c0c9fa8dc7bc959291132f6896ce03bec8fd10595d6c0275ea50dd8a89fa51",
        "input": "0x0000000efb24ab7a5c596c6a65f628fc1090853d8eb1927651e9d9b20000000000000000132a6e4fd04b862a83bf95127d23be2c3ab28502002710000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000009ab7bb7fdc60f4357ecfef43986818a2a3569c62000000000000000005e14d4fd67bc1da00000000000000898ec62c43354b51e800000000000000000000000000000000000000000000000005fb6da2043de4e6",
        "maxFeePerGas": "0xbf1083598",
        "maxPriorityFeePerGas": "0xbf1083598",
        "nonce": "0x9267",
        "r": "0xf1e380635c9e4755c9887d5efc62288315c5e0385fe6ea9198d47b45d1ede14b",
        "s": "0x5e320e5ded60d5a7ee255461db1d83b6377b078f209a687e155a76a8c93f36b0",
        "to": "0x000000000035b5e5ad9019092c665357240f594e",
        "transactionIndex": "0x0",
        "type": "0x2",
        "v": "0x0",
        "value": "0x0"
    }
}
Language
Click Try It! to start a request and see the response here!