eth_getTransactionByBlockHashAndIndex

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

Parameters

Object NameRequiredTypeDetail
BLOCK HASHStringA hex code of an integer that represents the hash of a block.
TRANSACTION INDEX POSITIONStringA hex code of an integer that represents the position of a transaction in the block.
"params": [
    "0xef0c14940f208ee5d2928d4a46828e29e40bc0cfe260fe65f5c98f957e844730", 
    "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, 32 Bytes.
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 if the transaction is 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_getTransactionByBlockHashAndIndex","params": ["0xef0c14940f208ee5d2928d4a46828e29e40bc0cfe260fe65f5c98f957e844730","0x0"],"id":1}'

Return

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "blockHash": "0xef0c14940f208ee5d2928d4a46828e29e40bc0cfe260fe65f5c98f957e844730",
        "blockNumber": "0xfb8fbe",
        "from": "0x6259d6f5e29a9023341a9f2ff13ef189a8865ae9",
        "gas": "0x34503",
        "gasPrice": "0x1cbcb113206",
        "hash": "0x2a032638e61f1c229783dab7f35ddf0bcf78a0fed8b67668cf81a991a47e1f9c",
        "input": "0xe72f160e0208640212783e862fd1fd8287ccd70ba4ff885c1300ad7832b1a2290000000000034503000000000004eaece8880dd232f80000000000007d479423f22e05c200038e8d0000000000000de0b6b3a7640000000000afa587d51a936000000000000000000000000000000000624338b51f400000009e14fa3fcb1e3ccccccccc000000000000000000000000ee0c4d2a7778aa0e6dd08441c5179f1dcb7e3eba0000000000000000000000007a2bd6f3004d15064cf66454cecf878e264124370e",
        "nonce": "0x17494",
        "r": "0x388feb21a00881d5510979e0af36106261e504d257899a89b37c8f97a6d016f7",
        "s": "0x479077edfe970a6cbdf206003d85ab2b462451e83cc97a162996585cb8d03f71",
        "to": "0x0000000000dba7f30ba877d1d66e5324858b1278",
        "transactionIndex": "0x0",
        "type": "0x0",
        "v": "0x94",
        "value": "0x0"
    }
}
Language
Click Try It! to start a request and see the response here!