Updated on 2024-11-14 GMT+08:00

eth_getTransactionReceipt

Introduction

This API returns the receipt of a transaction by transaction hash. It consumes 15 CUs.

Parameter Description

Parameter

Type

Description

Transaction hash

String

The hash of a transaction.

Return Value

  • Object: A transaction receipt object with the following fields, or null when no transaction receipt was found:
    • blockHash: the hash of the block where this transaction was in.
    • blockNumber: the block number where this transaction was added encoded as a hexadecimal.
    • contractAddress: the contract address created for contract creation. It is null for a transaction that is not for contract creation.
    • cumulativeGasUsed: the total gas used when this transaction was executed in the block.
    • effectiveGasPrice: the total base charge plus tip paid for each unit of gas.
    • from: the address of the sender.
    • gasUsed: the amount of gas used by this specific transaction alone.
    • logs: an array of log objects that generated this transaction.
      • address: the address from which this log was generated.
      • topics: an array of zero to four 32-byte data of the index log arguments. In Solidity, the first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declare the event with the anonymous specifier.
      • data: the 32-byte non-indexed argument of the log.
      • blockNumber: the number of the block where this log was in.
      • transactionHash: the hash of the transaction from which this log was created. It is null for a pending log.
      • transactionIndex: the transactions index position from which this log was created. It is null for a pending log.
      • blockHash: the hash of the block where this log was in.
      • logIndex: the integer of log index position in the block encoded as hexadecimal. It is null for a pending log.
      • removed: true if log was removed due to a chain reorganization and false if the log is valid.
    • logsBloom: the bloom filter which is used to retrieve related logs.
    • status: 1 (success) or 0 (failure) encoded as a hexadecimal.
    • to: the address of the receiver. It is null for a contract creation transaction.
    • transactionHash: the hash of the transaction.
    • transactionIndex: the transaction index position encoded as a hexadecimal.
    • type: the value type.

Request

curl https://your-http-endpoint/v1/<API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getTransactionReceipt","params":["0x6d755989f51032147484162c4dc3d6550552dbd8d3b094fe3c221bfa3c5942b2"],"id":1,"jsonrpc":"2.0"}'