eth_getTransactionReceipt - Arbitrum

This method returns the receipt of a transaction by transaction hash.

Parameters

ParameterTypeRequiredDescription
tx_hashstringyesThe hash of the transaction to fetch the receipt for. Must be a 32-byte hex string prefixed with 0x.

Request

bashcurl --location 'https://shared.us-east-1.getblock.io/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
   "jsonrpc": "2.0",
   "method": "eth_getTransactionReceipt",
    "params": [
        "0x21be7a93a4531a76b1e15d14059582e6b6f9e36cbdc7a85c23667808f4c78b2c"
    ],
    "id": "getblock.io"
}'
javascriptimport axios from 'axios'
let data = JSON.stringify({
    "jsonrpc": "2.0",
     "method": "eth_getTransactionReceipt",
    "params": [
        "0x21be7a93a4531a76b1e15d14059582e6b6f9e36cbdc7a85c23667808f4c78b2c"
    ],
    "id": "getblock.io"
};

let config = {
  method: "post",
  maxBodyLength: Infinity,
  url: "https://shared.us-east-1.getblock.io/<ACCESS_TOKEN>",
  headers: {
    "Content-Type": "application/json",
  },
  data: data,
};

axios
  .request(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });
pythonimport requests
import json

url = "https://shared.us-east-1.getblock.io/<ACESS_TOKEN>"

payload = json.dumps({
   "jsonrpc": "2.0",
    "method": "eth_getTransactionReceipt",
    "params": [
        "0x21be7a93a4531a76b1e15d14059582e6b6f9e36cbdc7a85c23667808f4c78b2c"
    ],
    "id": "getblock.io"
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
rs#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::builder()
        .build()?;

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("Content-Type", "application/json".parse()?);

    let data = r#"{
   "jsonrpc": "2.0",
   "method": "eth_getTransactionReceipt",
    "params": [
        "0x21be7a93a4531a76b1e15d14059582e6b6f9e36cbdc7a85c23667808f4c78b2c"
    ],
    "id": "getblock.io"
}"#;

    let json: serde_json::Value = serde_json::from_str(&data)?;

    let request = client.request(reqwest::Method::POST, "https://shared.us-east-1.getblock.io/<ACCESS_TOKEN>")
        .headers(headers)
        .json(&json);

    let response = request.send().await?;
    let body = response.text().await?;

    println!("{}", body);

    Ok(())
}

Response

java{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "blockHash": "0x2caf14773f5c8854de725d9077918a0ec14bd123163d5f9e479b06f201452320",
        "blockNumber": "0x5259c43",
        "contractAddress": null,
        "cumulativeGasUsed": "0xc69229",
        "effectiveGasPrice": "0x5f5e100",
        "from": "0xb8b2522480f850eb198ada5c3f31ac528538d2f5",
        "gasUsed": "0x1993d7",
        "gasUsedForL1": "0x113076",
        "l1BlockNumber": "0x105fbf6",
        "logs": [
            {
                "address": "0x09e18590e8f76b6cf471b3cd75fe1a1a9d2b2c2b",
                "topics": [
                    "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
                    "0x00000000000000000000000009e18590e8f76b6cf471b3cd75fe1a1a9d2b2c2b",
                    "0x000000000000000000000000c873fecbd354f5a56e00e710b90ef4201db2448d"
                ],
                "data": "0x0000000000000000000000000000000000000000000000000000ad0c364098a8",
                "blockNumber": "0x5259c43",
                "transactionHash": "0x21be7a93a4531a76b1e15d14059582e6b6f9e36cbdc7a85c23667808f4c78b2c",
                "transactionIndex": "0x7",
                "blockHash": "0x2caf14773f5c8854de725d9077918a0ec14bd123163d5f9e479b06f201452320",
                "logIndex": "0x16",
                "removed": false
            }
        ],
        "logsBloom": "0x002000020000100000480000800100000000004000000",
         "status": "0x1",
        "to": "0x5845696f6031bfd57b32e6ce2ddea19a486fa5e5",
        "transactionHash": "0x21be7a93a4531a76b1e15d14059582e6b6f9e36cbdc7a85c23667808f4c78b2c",
        "transactionIndex": "0x7",
        "type": "0x0"
    }
}

Reponse Parameter Definition

Field NameData TypeFormatDescription
transactionHashstring32 bytes (0x + 64 hex chars)Hash that uniquely identifies the transaction
transactionIndexstringHexadecimalInteger position of the transaction within the block (e.g., "0x66")
blockHashstring32 bytes (0x + 64 hex chars)Hash of the block where this transaction was included
blockNumberstringHexadecimalBlock number where this transaction was included (e.g., "0xeff35f")
fromstring20 bytes (0x + 40 hex chars)Address of the sender who initiated the transaction
tostring or null20 bytes (0x + 40 hex chars)Address of the receiver. null when the transaction is a contract creation transaction
cumulativeGasUsedstringHexadecimalTotal amount of gas used when this transaction was executed in the block (sum of gas used by this and all preceding transactions in the same block)
gasUsedstringHexadecimalAmount of gas used by this specific transaction alone
effectiveGasPricestringHexadecimalActual value per gas deducted from sender's account. Before EIP-1559: equals transaction's gas price. After EIP-1559: equals baseFeePerGas + min(maxFeePerGas - baseFeePerGas, maxPriorityFeePerGas)
contractAddressstring or null20 bytes (0x + 40 hex chars)Contract address created if the transaction was a contract creation, otherwise null
logsarray of objects-Array of log objects generated by this transaction (events emitted by smart contracts)
logs[].addressstring20 bytes (0x + 40 hex chars)Address of the contract that generated the log
logs[].topicsarray of strings32 bytes eachArray of indexed log topics (first topic is usually the event signature hash)
logs[].datastringHexadecimalNon-indexed log data
logs[].blockNumberstringHexadecimalBlock number where this log was created
logs[].transactionHashstring32 bytes (0x + 64 hex chars)Hash of the transaction that created this log
logs[].transactionIndexstringHexadecimalTransaction's position in the block
logs[].blockHashstring32 bytes (0x + 64 hex chars)Hash of the block containing this log
logs[].logIndexstringHexadecimalPosition of this log in the block
logs[].removedbooleantrue/falsetrue if log was removed due to chain reorganization, false if valid
logsBloomstring256 bytes (0x + 512 hex chars)Bloom filter for light clients to quickly retrieve related logs
statusstring"0x0" or "0x1"Transaction status: "0x1" for success, "0x0" for failure (only for post-Byzantium transactions)
rootstring or null32 bytesPost-transaction state root (only for pre-Byzantium transactions, otherwise null)
typestringHexadecimalTransaction type: "0x0" (legacy), "0x1" (EIP-2930), "0x2" (EIP-1559), or Arbitrum-specific types (see below)
blobGasUsedstring or nullHexadecimalAmount of blob gas used for this transaction (only for EIP-4844 blob transactions)
blobGasPricestring or nullHexadecimalActual value per gas deducted from sender's account for blob gas (only for EIP-4844 blob transactions)

Use case

The eth_getTransactionReceipt :

  • Track the outcome of a transaction (success/failure)
  • Retrieve events emitted during contract execution
  • Calculate actual gas consumption for analytics or dashboards
  • Determine the address of newly created contracts
  • Power explorers, wallets, and DeFi dashboards with detailed transaction results

Error handling

Status CodeError MessageCause
403ForbiddenMissing or invalid ACCESS_TOKEN.
-32602Invalid argument<ul><li>Invalid transaction hash</li></ul>

Integration with Web3

The eth_getTransactionReceipt method helps developers to:

  • Build real-time transaction status trackers
  • Power dashboards that display events and gas usage
  • Validate smart contract interactions without waiting for confirmations elsewhere
  • Support dApps and DeFi interfaces that rely on logs for updates
  • Ensure trustless monitoring of transaction results
javascriptimport { ethers } from "ethers";
const RPC_URL = "https://shared.us-east-1.getblock.io/<ACCESS_TOKEN>";
const provider = new ethers.JsonRpcProvider(RPC_URL);
async function Call() {
  try {
     const result = await provider.send( "eth_getTransactionReceipt",
  [
   "0x21be7a93a4531a76b1e15d14059582e6b6f9e36cbdc7a85c23667808f4c78b2c"
 ]);    
console.log("The result:", result);
    return result;
  } catch (error) {
    console.error("The error:", error);
    throw error;
  }
}
jsximport { createPublicClient, http } from 'viem';
import { arbitrum } from 'viem/chains';

// Create Viem client with GetBlock
const client = createPublicClient({
  chain: arbitrum,
  transport: http('https://shared.us-east-1.getblock.io/<ACCESS_TOKEN>'),
});

// Using the method through Viem
async function Call() {
    try {
        // Method-specific Viem implementation
        const result = await client.request({
         method: "eth_getTransactionReceipt",
         params: ["0x21be7a93a4531a76b1e15d14059582e6b6f9e36cbdc7a85c23667808f4c78b2c"]});
        console.log('Result:', result);
        return result;
    } catch (error) {
        console.error('Viem Error:', error);
        throw error;
    }
}