eth_getTransactionByHash

zkLink Nova chain RPC Methods & API Documentation


eth_getTransactionByHash RPC Method

The eth_getTransactionByHash returns an object that contains the details of the transaction.

Parameters

  • transaction hash - String - The hash of a transaction.

💡 Confusing?

Ask our experienced blockchain developers in Telegram

Returns

  • blockHash - 32 Bytes - The hash of the block including this transaction. Null when it's pending.

  • blockNumber - The number of the block including this transaction. Null when it's pending.

  • from - The address of the sender.

  • gas - The gas provided by the sender.

  • gasPrice - The gas price provided by the sender in wei.

  • maxFeePerGas - The maximum fee per gas set in the transaction.

  • maxPriorityFeePerGas - The maximum priority gas fee set in the transaction.

  • hash - The hash of the transaction.

  • input - The data sent along with the transaction.

  • nonce - The number of transactions made by the sender before this one.

  • to - The address of the receiver. null when it's a contract creation transaction.

  • transactionIndex - The index position of the transaction in the block. Null when it's pending.

  • value - The value transferred in wei encoded as hexadecimal.

  • type - The transaction type.

  • accesslist - A list of addresses and storage keys that the transaction plans to access.

  • chainId - The chain id of the transaction, if any.

  • v [optional] - ECDSA recovery ID.

  • r - The R field of the signature.

  • s - The S field of the signature

Request

POST https://<network>.chainnodes.org/YOUR-API-KEY

Example

Need RPC API keys?

Get 12.5M archival requests for free today.

  • HTTPS POST Request with a JSON RPC call in the body
  • Replace YOUR-API-KEY with the API key from your CHAINNODES.ORG Dashboard
  • You can use a different supported network by replacing zklink-nova-mainnet
curl https://zklink-nova-mainnet.chainnodes.org/YOUR-API-KEY \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params": ["0x60900e7a4db282ae1250407147eaa7f3a9e165bfe6dfb87bf0f85e2a1e7447a1"],"id":1}'

Body

{
   "jsonrpc": "2.0",
   "id": 1,
   "result": {
      "blockHash": "0xb5b9f6f96501a9219b2eaf011af0ecc40b073abe5e15205906f24c70f1d17c0b",
      "blockNumber": "0x102d444",
      "from": "0x5f927395213ee6b95de97bddcb1b2b1c0f16844f",
      "gas": "0x7530",
      "gasPrice": "0x484f2c086",
      "hash": "0x60900e7a4db282ae1250407147eaa7f3a9e165bfe6dfb87bf0f85e2a1e7447a1",
      "input": "0x",
      "nonce": "0x448e",
      "to": "0xc457c11e2d7b6ed68516cded897c2ab9f41e022c",
      "transactionIndex": "0x87",
      "value": "0xb182a4ab236ace",
      "type": "0x0",
      "chainId": "0x1",
      "v": "0x25",
      "r": "0x629d5395f7d60976d547aeae0fd57d502e8431e1f9dd35aa81950fad1744ed76",
      "s": "0x75f7bdf74020ddfa041555bee810828cf434cf4df72dc6c576f682dd3fd579d3"
   }
}