eth_getTransactionByHash

Returns information about a transaction by hash.

Parameters

Name
Type
Description

TransactionHash

HexString<Hash>

Hash of the selected transaction.

Return Type

Transaction | null - Transaction object or null if not found.

Transaction

type Transaction = {
  hash: HexString<Hash>; // Hash of the transaction.
  from: Address; // Address of the sender.
  to: Address | null; // Address of the receiver or null for contract creations.
  value: HexString<Number>; // Value sent in WEI.

  blockHash: HexString<Hash> | null; // Block hash of transaction or null if transaction is pending.
  blockNumber: HexString<Number> | null; // Block number of transaction or null if transaction is pending.
  nonce: HexString<Number>; // Number of transactions made by the sender before.

  gas: HexString<Number>; // Gas units provider by the sender.
  gasPrice: HexString<Number>; // Gas price provider by the sender in WEI.
  maxFeePerGas?: HexString<Number>; // Maximum fee in WEI per gas unit. EIP-1559.
  maxPriorityFeePerGas?: HexString<Number>; // Maximum fee in WEI per gas unit above the base fee. EIP-1559.

  input: HexString; // Data sent with the transaction.

  r: HexString; // ECDSA signature r.
  s: HexString; // ECDSA signature s.
  v: HexString; // ECDSA recovery ID.

  transactionIndex: HexString<Number> | null; // Transaction index in block or null if transaction is pending.
  type: HexString<Number>; // Transaction type
};

Example

Last updated

Was this helpful?