eth_getTransactionReceipt

eth_getTransactionReceipt(txHash) → receipt | null

Returns the receipt of a transaction once it's been included in a block. Returns null while the transaction is still pending — poll until non-null, or use tx.wait() in ethers.js. The receipt contains the final status (success/revert), gas used, emitted logs, and contract address (if a deployment).

Parameters

Name Type Required Description
txHash string ✓ The transaction hash (32 bytes, hex-encoded with 0x prefix)

Returns

Type: object | null

Receipt object with status (0x1 = success, 0x0 = revert), blockNumber, gasUsed, logs, contractAddress (for deployments), effectiveGasPrice. Returns null if the transaction is still pending or unknown.

Examples

ethers.js v6 — wait for confirmation

Replace the example hash with your transaction's: a hash the chain has never seen returns null, so the example prints "Still pending". If you have the tx object from sendTransaction, prefer await tx.wait() — it polls automatically and returns the receipt once mined.

import { JsonRpcProvider } from "ethers";

const provider = new JsonRpcProvider("https://rpc-testnet.maroo.io");

const receipt = await provider.getTransactionReceipt("0x0f8e3c4d2a1b9c7e6f5d4c3b2a19087f6e5d4c3b2a19087f6e5d4c3b2a190871"); // replace with your transaction hash
if (receipt === null) {
  console.log("Still pending");
} else {
  console.log("Status:", receipt.status === 1 ? "success" : "reverted");
  console.log("Block:", receipt.blockNumber, "Gas used:", receipt.gasUsed.toString());
}

Raw cURL

Returns the full receipt object as JSON. Put the hash your eth_sendRawTransaction returned in params, then poll until result is non-null. A hash the chain has never seen stays null.

# replace the hash in "params" with your own transaction hash
curl -X POST https://rpc-testnet.maroo.io \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_getTransactionReceipt",
    "params": ["0x0f8e3c4d2a1b9c7e6f5d4c3b2a19087f6e5d4c3b2a19087f6e5d4c3b2a190871"],
    "id": 1
  }'
ESC
Type to search