TriportRPC

eth_getTransactionReceipt

POSThttps://api.triport.io

Returns the receipt for a mined Polygon transaction — execution status, gas used, and emitted logs — or `null` if the transaction has not yet been mined.

Polygonfree — 15 RPS (free) / 20 RPS (basic) / 100 RPS (pro) / 250 RPS (business)

eth_getTransactionReceipt looks up a single transaction by its 32-byte hash and returns the receipt generated when the transaction was executed. The receipt is the authoritative record of what happened: whether the transaction succeeded (status), how much gas it actually consumed (gasUsed, effectiveGasPrice), which logs it emitted, and — for contract-creation transactions — the address of the new contract.

A receipt exists only once the transaction has been mined. While a transaction is still pending in the mempool the method returns "result": null. This is not an error — the JSON-RPC envelope returns HTTP 200 with a null result. Poll the method (Polygon block time is ~2.1s) until a non-null receipt appears to detect confirmation. To read a pending transaction's calldata before it mines, use eth_getTransactionByHash instead.

For batch processing — pulling every receipt in a block at once for an indexer or analytics pipeline — call eth_getBlockReceipts, which returns all receipts for a block in a single round-trip rather than issuing N separate eth_getTransactionReceipt calls.

Parameters

The params array takes a single positional element.

txHashstringrequired
32-byte transaction hash, 0x-prefixed hex (66 characters total).

Response

While the transaction is still pending (not yet mined):

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
transactionHashstring
32-byte hash of the transaction this receipt belongs to.
transactionIndexstring
Index of the transaction within its block, as 0x-hex.
blockHashstring
Hash of the block the transaction was included in.
blockNumberstring
Block number the transaction was included in, as 0x-hex.
fromstring
20-byte address of the sender.
tostring | null
20-byte address of the receiver; null for contract-creation transactions.
cumulativeGasUsedstring
Total gas used in the block up to and including this transaction, as 0x-hex.
gasUsedstring
Gas used by this transaction alone, as 0x-hex.
effectiveGasPricestring
The actual per-gas price paid in wei, as 0x-hex.
contractAddressstring | null
Address of the contract created, if the transaction was a contract deployment; otherwise null.
logsarray
List of log objects emitted by this transaction.
logsBloomstring
256-byte bloom filter over the receipt's logs, for fast log filtering.
statusstring
0x1 if the transaction succeeded, 0x0 if it was reverted.
typestring
The transaction type, as 0x-hex (0x0 legacy, 0x2 EIP-1559).

Errors

Triport returns standard JSON-RPC error envelopes. The codes most relevant to this method:

CodeMeaningWhen it happens
-32001trial_expiredThe API key's trial period has ended; upgrade to a paid tier to continue.
-32002tier_insufficientThe key's tier is below what this method requires.
-32003rate_limitedThe per-tier RPS limit was exceeded. The data block carries limit_rps, retry_after_sec, and upgrade_url.
-32004subscription_expiredThe subscription tied to the key has lapsed.
-32005unauthorizedThe API key is missing, malformed, or invalid.
-32601method_unknownThe method is not enabled for this key's tier or chain.

A null result for an unmined transaction is not one of these errors — it is a normal HTTP 200 response. A malformed or wrong-length txHash is rejected as an invalid-params error before the lookup runs. See the shared errors reference for the full error envelope and the complete code list.

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "eth_getTransactionReceipt",
    params: [
      "0x4f1f6c8b4f6c1c2a3b4d5e6f70819a2b3c4d5e6f70819a2b3c4d5e6f70819a2b",
    ],
  }),
});


const { result } = await res.json();
if (result === null) {
  console.log("transaction not yet mined");
} else {
  console.log(result.status === "0x1" ? "succeeded" : "reverted");
}

TypeScript SDK (@triport/sdk)

import { Triport } from "@triport/sdk";


const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });


const receipt = await client.polygon.getTransactionReceipt(
  "0x4f1f6c8b4f6c1c2a3b4d5e6f70819a2b3c4d5e6f70819a2b3c4d5e6f70819a2b",
);


if (receipt === null) {
  console.log("transaction not yet mined");
} else {
  console.log(`status=${receipt.status} gasUsed=${receipt.gasUsed}`);
}

Python (triport-sdk)

import os
from triport import Triport


client = Triport(api_key=os.environ["TRIPORT_API_KEY"])


receipt = client.polygon.get_transaction_receipt(
    "0x4f1f6c8b4f6c1c2a3b4d5e6f70819a2b3c4d5e6f70819a2b3c4d5e6f70819a2b"
)


if receipt is None:
    print("transaction not yet mined")
else:
    print("succeeded" if receipt["status"] == "0x1" else "reverted")

Notes

  • null means pending. A receipt is created only after the transaction is mined. Polygon block time is ~2.1s, so poll at roughly that cadence until the result is non-null to detect confirmation. Because Polygon (Bor consensus) can re-org over the last few epochs, wait for additional confirmations (commonly 64–128 blocks, ~2–4 minutes) before treating a receipt as final.
  • Check status, not just presence. A receipt with status: "0x0" means the transaction was included but reverted — gas was still spent. Always inspect status before treating a transaction as successful.
  • Batch reads. When you need every receipt in a block (indexers, analytics), prefer eth_getBlockReceipts — one call returns all receipts instead of issuing N separate eth_getTransactionReceipt lookups.
  • All numeric fields (gasUsed, cumulativeGasUsed, effectiveGasPrice, blockNumber, status, type) are quantity-encoded 0x-hex strings, not JSON numbers.
  • This method belongs to the polygon_read_rpc category, so it draws from the same per-tier RPS budget as the other Polygon read methods. See rate limits and tiers.