eth_getTransactionReceipt

Returns the receipt of a transaction by transaction hash.

Note That the receipt is not available for pending transactions.

Ethereum.org API Reference

Parameters

DATA, 32 Bytes - hash of a transaction REQUIRED

Returns

Object - A transaction receipt object, or null when no receipt was found:

  • transactionHash : DATA, 32 Bytes - hash of the transaction.

  • transactionIndex: QUANTITY - integer of the transactions index position in the block.

  • blockHash: DATA, 32 Bytes - hash of the block where this transaction was in.

  • blockNumber: QUANTITY - block number where this transaction was in.

  • from: DATA, 20 Bytes - address of the sender.

  • to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction.

  • cumulativeGasUsed : QUANTITY - The total amount of gas used when this transaction was executed in the block.

  • effectiveGasPrice : QUANTITY - The sum of the base fee and tip paid per unit of gas.

  • gasUsed : QUANTITY - The amount of gas used by this specific transaction alone.

  • contractAddress : DATA, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null.

  • logs: Array - Array of log objects, which this transaction generated.

  • logsBloom: DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.

  • type: QUANTITY - integer of the transaction type, 0x0 for legacy transactions, 0x1 for access list types, 0x2 for dynamic fees.

It also returns either :

  • root : DATA 32 bytes of post-transaction stateroot (pre Byzantium)

  • status: QUANTITY either 1 (success) or 0 (failure)

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",
  "params": [
    "0xad5c35020b1ed10cf03b0caf4308df4703acb87f6beee186db0c0fc95c9bb1b4"
  ],
  "method": "eth_getTransactionReceipt"
}
'

Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "blockHash": "0x14834c13eec4b47be4fb4c8a4190f966af5eb9735b446b7ccd8120b5f5763a59",
        "blockNumber": "0x1127101",
        "contractAddress": null,
        "cumulativeGasUsed": "0x4ee626",
        "effectiveGasPrice": "0x6dfe78c4f",
        "from": "0x91aae0aafd9d2d730111b395c6871f248d7bd728",
        "gasUsed": "0x1bf2a",
        "logs": [
            {
                "address": "0x5732046a883704404f284ce41ffadd5b007fd668",
                "topics": [
                    "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                    "0x00000000000000000000000098c3d3183c4b8a650614ad179a1a98be0a8d6b8e",
                    "0x0000000000000000000000005fa9569b0ed6aa01e234468e6a15b77988b950df"
                ],
                "data": "0x0000000000000000000000000000000000000000000002394ff4aa9621fc5166",
                "blockNumber": "0x1127101",
                "transactionHash": "0xad5c35020b1ed10cf03b0caf4308df4703acb87f6beee186db0c0fc95c9bb1b4",
                "transactionIndex": "0x49",
                "blockHash": "0x14834c13eec4b47be4fb4c8a4190f966af5eb9735b446b7ccd8120b5f5763a59",
                "logIndex": "0x8e",
                "removed": false
            },
            {
                "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                "topics": [
                    "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                    "0x0000000000000000000000005fa9569b0ed6aa01e234468e6a15b77988b950df",
                    "0x00000000000000000000000098c3d3183c4b8a650614ad179a1a98be0a8d6b8e"
                ],
                "data": "0x000000000000000000000000000000000000000000000000000000005075f5dd",
                "blockNumber": "0x1127101",
                "transactionHash": "0xad5c35020b1ed10cf03b0caf4308df4703acb87f6beee186db0c0fc95c9bb1b4",
                "transactionIndex": "0x49",
                "blockHash": "0x14834c13eec4b47be4fb4c8a4190f966af5eb9735b446b7ccd8120b5f5763a59",
                "logIndex": "0x8f",
                "removed": false
            },
            {
                "address": "0x5fa9569b0ed6aa01e234468e6a15b77988b950df",
                "topics": [
                    "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1"
                ],
                "data": "0x00000000000000000000000000000000000000000001ae47731be3af5b213fba0000000000000000000000000000000000000000000000000000003cadd1fa4c",
                "blockNumber": "0x1127101",
                "transactionHash": "0xad5c35020b1ed10cf03b0caf4308df4703acb87f6beee186db0c0fc95c9bb1b4",
                "transactionIndex": "0x49",
                "blockHash": "0x14834c13eec4b47be4fb4c8a4190f966af5eb9735b446b7ccd8120b5f5763a59",
                "logIndex": "0x90",
                "removed": false
            },
            {
                "address": "0x5fa9569b0ed6aa01e234468e6a15b77988b950df",
                "topics": [
                    "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822",
                    "0x00000000000000000000000098c3d3183c4b8a650614ad179a1a98be0a8d6b8e",
                    "0x00000000000000000000000098c3d3183c4b8a650614ad179a1a98be0a8d6b8e"
                ],
                "data": "0x0000000000000000000000000000000000000000000002394ff4aa9621fc516600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005075f5dd",
                "blockNumber": "0x1127101",
                "transactionHash": "0xad5c35020b1ed10cf03b0caf4308df4703acb87f6beee186db0c0fc95c9bb1b4",
                "transactionIndex": "0x49",
                "blockHash": "0x14834c13eec4b47be4fb4c8a4190f966af5eb9735b446b7ccd8120b5f5763a59",
                "logIndex": "0x91",
                "removed": false
            }
        ],
        "logsBloom": "0x00200000000000000000000080000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000408000008000000200000000000000000000000000000000000200000000000000000008000000000000000020000000000000010000000000000000000000800000000000000000000000000010000080000004000000000000000000000280000000000000000000000000000000000000000000000000000000002000800000000000000001000000000004000001000000000000000000002000000000000000000000000000000000000000000000000001000000000",
        "status": "0x1",
        "to": "0x98c3d3183c4b8a650614ad179a1a98be0a8d6b8e",
        "transactionHash": "0xad5c35020b1ed10cf03b0caf4308df4703acb87f6beee186db0c0fc95c9bb1b4",
        "transactionIndex": "0x49",
        "type": "0x2"
    }
}

Last updated