eth_getTransactionReceipt
https://api.triport.io/Returns the receipt of a transaction by its hash — including execution status, gas used, emitted logs, and (for contract deployments) the new contract address.
eth_getTransactionReceipt retrieves the receipt produced when a transaction was
mined into a block. The receipt is the authoritative record of what actually
happened on-chain: whether the transaction succeeded, how much gas it consumed,
the logs (events) it emitted, and — when the transaction created a contract — the
address of the deployed contract.
Use this method to confirm a transaction's outcome after you have submitted it
with eth_sendRawTransaction. A common pattern is to
poll this method with the transaction hash until a non-null receipt is returned,
then read status to determine success or failure.
The method returns null when the transaction is still pending (not yet
mined) or unknown (never seen by the node, or dropped from the mempool). A
null result is not an error — it simply means there is no receipt yet. Note that
a non-null receipt does not by itself guarantee finality; for high-value flows,
wait for a sufficient number of block confirmations after the receipt appears.
Parameters
eth_getTransactionReceipt takes a single positional parameter.
transactionHashstring (32-byte hex, 0x-prefixed)requiredResponse
For a pending or unknown transaction:
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}statusstring (hex)0x1 if the transaction succeeded, 0x0 if it was reverted.transactionHashstringtransactionIndexstring (hex)blockHashstringblockNumberstring (hex)fromstringtostring | nullnull for contract-creation transactions.gasUsedstring (hex)cumulativeGasUsedstring (hex)effectiveGasPricestring (hex)contractAddressstring | nullnull.logsarraylogsBloomstringtypestring (hex)0x0 legacy, 0x1 access-list, 0x2 EIP-1559).Errors
Errors are returned in the standard JSON-RPC envelope (error.code +
error.message). See errors.md for the full envelope and
shared codes.
| Code | Meaning | When it happens |
|---|---|---|
-32001 | trial_expired | The API key's trial period has ended; upgrade to a paid tier to continue. |
-32003 | rate_limited | You exceeded the requests-per-second limit for your tier. Back off and retry. |
A non-existent or still-pending transaction is not an error — the call
succeeds with "result": null.
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: ["0x1f2a90d6c0a8b4d7c9e3f1a2b3c4d5e6f70819203a4b5c6d7e8f90112233e9c4"],
}),
});
const { result } = await res.json();
if (result === null) {
console.log("Transaction is pending or unknown");
} else {
console.log("Succeeded?", result.status === "0x1");
console.log("Gas used:", parseInt(result.gasUsed, 16));
}TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const receipt = await client.eth.getTransactionReceipt(
"0x1f2a90d6c0a8b4d7c9e3f1a2b3c4d5e6f70819203a4b5c6d7e8f90112233e9c4",
);
if (!receipt) {
console.log("Pending or unknown");
} 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.eth.get_transaction_receipt(
"0x1f2a90d6c0a8b4d7c9e3f1a2b3c4d5e6f70819203a4b5c6d7e8f90112233e9c4",
)
if receipt is None:
print("Pending or unknown")
else:
print("succeeded" if receipt["status"] == "0x1" else "reverted")
print("gas used:", int(receipt["gasUsed"], 16))Notes
- Polling for confirmation. After submitting a transaction, poll this method
with the returned hash until you get a non-null receipt, then inspect
status. Add a short backoff between polls to stay within your tier's RPS limit. - Reverted transactions still get a receipt. A
statusof0x0means the transaction was mined but reverted — gas was still consumed. Always checkstatusrather than assuming a non-null receipt implies success. - Contract deployments. When a transaction creates a contract,
toisnullandcontractAddressholds the new contract's address. - All numeric fields are hex strings. Convert with
parseInt(value, 16)(JS) orint(value, 16)(Python) before doing arithmetic. - Rate limits are enforced per second per tier (no daily cap). On
-32003, honor exponential backoff rather than retrying immediately. - Related methods: eth_getTransactionByHash (the transaction itself, available before it is mined), eth_sendRawTransaction (submit a transaction), and eth_getLogs (query events across many blocks).