New Here? Claim Your 30% Discount on Your First Blockchain Node Access!

banner image

Last updated on January 1, 1970

2 min read

Method eth_getTransactionByBlockHashAndIndex undefined ()
connect with WS protocol

eth_getTransactionByBlockHashAndIndex

info-circle-fill

Returns transaction information for the specified block hash andtransaction index position.

Parameters

DATA - hex string

32-byte hash of a block.

QUANTITY - hex string

Integer representing the transaction index position.

Request

wscat -c wss://bsc.getblock.io/YOUR-API-KEY/mainnet/ 
# wait for connection and send the request body 
{"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockHashAndIndex",
"params": ["0x94c626286c237e187454ddd993adc534f0ce3468aaec134a39fbd52185cc3a5f", "0x2"],
"id": "getblock.io"}

Response

{
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": {
        "blockHash": "0x94c626286c237e187454ddd993adc534f0ce3468aaec134a39fbd52185cc3a5f",
        "blockNumber": "0x52a96e",
        "from": "0xb13680c4161df038ebd1d99130f545eb1dfc8c9e",
        "gas": "0x62337",
        "gasPrice": "0x6fc23ac00",
        "hash": "0x69a6475787756f33fe02522a6cea90bebae36cdd724d2c8796cd411ebba3f2fb",
        "input": "0xe86ad1470000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000042b570e20a97e0000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d560000000000000000000000008c784c49097dcc637b93232e15810d53871992bf000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d560000000000000000000000000000000000000000000000000000000000000003000000000000000000000000bcbf0c95c94798ffef0e71a087a7e98f29d5c0ee000000000000000000000000981db69f2f2f96e0f08d6519befda0b927c221900000000000000000000000001b96b92314c44b159149f7e0303511fb2fc4774f000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000003e600000000000000000000000000000000000000000000000000000000000003e600000000000000000000000000000000000000000000000000000000000003e6",
        "nonce": "0x11fc",
        "r": "0x8f3f7f084873f91105934243c6cc22a0e6fc5d76de7e1ae346413f95bfa5f69c",
        "s": "0x712326f6df10af62ab6c00dd00255e954f9e6c9eb5ae59cc3ae6c1767d5d53e",
        "to": "0x5fa296cca27a14d26aca6fd7c7e5db6294f16613",
        "transactionIndex": "0x2",
        "type": "0x0",
        "v": "0x93",
        "value": "0x0"
    }
}
banner icon

Start Building with GetBlock RPCs for Free