eth_getTransactionReceipt
https://api.triport.ioReturns the receipt for a mined Polygon transaction — execution status, gas used, and emitted logs — or `null` if the transaction has not yet been mined.
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.
txHashstringrequired0x-prefixed hex (66 characters total).Response
While the transaction is still pending (not yet mined):
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}transactionHashstringtransactionIndexstring0x-hex.blockHashstringblockNumberstring0x-hex.fromstringtostring | nullnull for contract-creation transactions.cumulativeGasUsedstring0x-hex.gasUsedstring0x-hex.effectiveGasPricestring0x-hex.contractAddressstring | nullnull.logsarraylogsBloomstringstatusstring0x1 if the transaction succeeded, 0x0 if it was reverted.typestring0x-hex (0x0 legacy, 0x2 EIP-1559).Errors
Triport returns standard JSON-RPC error envelopes. The codes most relevant to this method:
| Code | Meaning | When it happens |
|---|---|---|
-32001 | trial_expired | The API key's trial period has ended; upgrade to a paid tier to continue. |
-32002 | tier_insufficient | The key's tier is below what this method requires. |
-32003 | rate_limited | The per-tier RPS limit was exceeded. The data block carries limit_rps, retry_after_sec, and upgrade_url. |
-32004 | subscription_expired | The subscription tied to the key has lapsed. |
-32005 | unauthorized | The API key is missing, malformed, or invalid. |
-32601 | method_unknown | The 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
nullmeans 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 withstatus: "0x0"means the transaction was included but reverted — gas was still spent. Always inspectstatusbefore 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 separateeth_getTransactionReceiptlookups. - All numeric fields (
gasUsed,cumulativeGasUsed,effectiveGasPrice,blockNumber,status,type) are quantity-encoded0x-hex strings, not JSON numbers. - This method belongs to the
polygon_read_rpccategory, so it draws from the same per-tier RPS budget as the other Polygon read methods. See rate limits and tiers.