eth_getTransactionByHash

Returns the information about a transaction requested by transaction hash.

Ethereum.org API Reference

Parameters

DATA, 32 Bytes - hash of a transaction 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_getTransactionByHash",
  "params": ["0xad5c35020b1ed10cf03b0caf4308df4703acb87f6beee186db0c0fc95c9bb1b4"]
}
'

Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "blockHash": "0x14834c13eec4b47be4fb4c8a4190f966af5eb9735b446b7ccd8120b5f5763a59",
        "blockNumber": "0x1127101",
        "from": "0x91aae0aafd9d2d730111b395c6871f248d7bd728",
        "gas": "0x493ee",
        "gasPrice": "0x6dfe78c4f",
        "maxFeePerGas": "0x8aafc45e4",
        "maxPriorityFeePerGas": "0x3b9aca00",
        "hash": "0xad5c35020b1ed10cf03b0caf4308df4703acb87f6beee186db0c0fc95c9bb1b4",
        "input": "0xce2e62ff0000000000000000000000000000000000000000000002394ff4aa9621fc5166000000000000000000000000000000000000000000000000000000005072bc2b0000000000000000000000005fa9569b0ed6aa01e234468e6a15b77988b950df0000000000000000000000005732046a883704404f284ce41ffadd5b007fd66800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000064e78760",
        "nonce": "0xb1a68",
        "to": "0x98c3d3183c4b8a650614ad179a1a98be0a8d6b8e",
        "transactionIndex": "0x49",
        "value": "0x0",
        "type": "0x2",
        "accessList": [],
        "chainId": "0x1",
        "v": "0x0",
        "r": "0x73c2ae9e22bcd48aacf101051ea98da7c9e60013c51895f8f5b992e4352fb99d",
        "s": "0x1c1034de7e633dc4d851b2770bd4d9922fde32c53f8647a26ed12df5b20b1551"
    }
}

Last updated