eth_getTransactionReceipt

Returns a recipt object given a transaction hash.

📘

Supported on Avalanche C-Chain (mainnet) only.

Parameters

  • hash - The hash of a transaction.

Returns

  • object - A transaction receipt object, or null when no receipt was found:
    • transactionHash - Hash of the transaction.
    • transactionIndex - Integer of the transactions index position in the block encoded as a hexadecimal.
    • from - Address of the sender.
    • to - Address of the receiver. null when its a contract creation transaction.
    • blockHash - Hash of the block where this transaction was in.
    • blockNumber - Block number where this transaction was added encoded as a hexadecimal.
    • cumulativeGasUsed - The total gas used when this transaction was executed in the block.
    • gasUsed - The amount of gas used by this specific transaction alone.
    • contractAddress - The contract address created for contract creation, otherwise null.
    • logs - Array of log objects, which this transaction generated.
    • logsBloom - Bloom filter for light clients to quickly retrieve related logs.
    • value - Value transferred in Wei encoded as a hexadecimal.
    • v - ECDSA recovery id encoded as a hexadecimal.
    • r - ECDSA signature r
    • s - ECDSA signature s
      It also returns either :
    • root - 32 bytes of post-transaction stateroot (pre Byzantium).
    • status - Either 1 (success) or 0 (failure) encoded as a hexadecimal.

API Endpoint

The format of an Avalanche C-Chain API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/avalanche-c/ext/bc/C/rpc - for RPC API
https://open-platform.nodereal.io/{{apiKey}}/avalanche-c/ext/bc/C/avax - for AVAX API

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/avalanche-c/ext/bc/C/rpc
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/avalanche-c/ext/bc/C/avax

Example

Request

curl https://open-platform.nodereal.io/{{apiKey}}/avalanche-c/ext/bc/C/rpc \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getTransactionReceipt","params":["0x9c7c5b4b6ea006843298ebbdc4494ebee427ab8d794f62c2c06373e70e296d84"],"id":1,"jsonrpc":"2.0"}'

Result

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blockHash":
      "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3",
    "blockNumber": "0xeff35f",
    "contractAddress": null, // string of the address if it was created
    "cumulativeGasUsed": "0xa12515",
    "effectiveGasPrice": "0x5a9c688d4",
    "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7",
    "gasUsed": "0xb4c8",
    "logs": [{
      // logs as returned by getFilterLogs, etc.
    }],
    "logsBloom": "0x00...0", // 256 byte bloom filter
    "status": "0x1",
    "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "transactionHash":
      "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5",
    "transactionIndex": "0x66",
    "type": "0x2"
  }
}