testnet
GitHub

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

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("0xYourTxHash");
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. Poll until `result` is non-null.

curl -X POST https://rpc-testnet.maroo.io \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_getTransactionReceipt",
    "params": ["0xYourTxHash"],
    "id": 1
  }'
Source: maroo
ESC
Type to search