eth_getTransactionReceipt - Monad

This method returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions.

Parameters

ParameterTypeRequiredDescription
transactionHashstringYesThe 32-byte transaction hash.

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getTransactionReceipt",
    "params": ["0x2623a9878543c1b8a1e1c9f6cd58bcde5958edeed4b90c616f03f41e99faa1f8"],
    "id": "getblock.io"
}'
javascriptimport axios from 'axios';

const data = JSON.stringify({
    "jsonrpc": "2.0",
    "method": "eth_getTransactionReceipt",
    "params": ["0x2623a9878543c1b8a1e1c9f6cd58bcde5958edeed4b90c616f03f41e99faa1f8"],
    "id": "getblock.io"
});

const config = {
    method: 'post',
    url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers: {
        'Content-Type': 'application/json'
    },
    data: data
};

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

url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/"

payload = json.dumps({
    "jsonrpc": "2.0",
    "method": "eth_getTransactionReceipt",
    "params": ["0x2623a9878543c1b8a1e1c9f6cd58bcde5958edeed4b90c616f03f41e99faa1f8"],
    "id": "getblock.io"
})

headers = {
    'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, data=payload)
print(response.text)
rustuse reqwest::header;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    
    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header(header::CONTENT_TYPE, "application/json")
        .body(r#"{
            "jsonrpc": "2.0",
            "method": "eth_getTransactionReceipt",
            "params": ["0x2623a9878543c1b8a1e1c9f6cd58bcde5958edeed4b90c616f03f41e99faa1f8"],
            "id": "getblock.io"
        }"#)
        .send()
        .await?;
    
    println!("{}", response.text().await?);
    Ok(())
}

Response

json{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "transactionHash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
        "transactionIndex": "0x0",
        "blockHash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
        "blockNumber": "0x1b4",
        "from": "0x742d35cc6634c0532925a3b844bc9e7595f0beb",
        "to": "0x4bbeeb066ed09b7aed07bf39eee0460dfa261520",
        "cumulativeGasUsed": "0x5208",
        "gasUsed": "0x5208",
        "effectiveGasPrice": "0x3b9aca00",
        "contractAddress": null,
        "logs": [],
        "logsBloom": "0x00000000000000000000000000000000...",
        "status": "0x1",
        "type": "0x2"
    }
}

Response Parameters

FieldTypeDescription
transactionHashstringTransaction hash.
transactionIndexstringIndex position in the block.
blockHashstringHash of the block.
blockNumberstringBlock number.
fromstringSender address.
tostringReceiver address. Null for contract creation.
cumulativeGasUsedstringTotal gas used in the block up to this transaction.
gasUsedstringGas used by this transaction.
effectiveGasPricestringActual gas price paid per gas.
contractAddressstringContract address if this was a contract creation. Null otherwise.
logsarrayArray of log objects generated by this transaction.
logsBloomstringBloom filter for logs.
statusstring0x1 for success, 0x0 for failure.
typestringTransaction type.

Use Case

The eth_getTransactionReceipt method is essential for:

  • Confirming transaction success/failure
  • Getting gas used for cost analysis
  • Extracting event logs
  • Contract deployment verification
  • Payment confirmation systems
  • DeFi transaction tracking

Error Handling

Status CodeError MessageCause
403ForbiddenMissing or invalid ACCESS-TOKEN.
-32602Invalid paramsInvalid transaction hash format.
-32601failed to parsed requestSyntax Error

Web3 Integration

javascriptimport { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/');
const receipt = await provider.getTransactionReceipt(txHash);

if (receipt) {
    console.log('Status:', receipt.status === 1 ? 'Success' : 'Failed');
    console.log('Gas used:', receipt.gasUsed.toString());
    console.log('Block:', receipt.blockNumber);
    console.log('Logs:', receipt.logs.length);
}
javascriptimport { createPublicClient, http } from "viem";
import { monad } from "viem/chains";

// Create Viem client with GetBlock
const client = createPublicClient({
  chain: monad,
  transport: http(
    import.meta.env.MONAD_ACCESS_TOKEN
  ),
});

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