Optimism
Bereit, das in der Produktion aufzurufen?
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
Optimism
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
eth_getTransactionReceipt returns the execution receipt for a transaction that has already been included in an OP Mainnet block — the canonical OP Stack rollup (chain ID 10, 0xa) that settles to Ethereum L1 and pays gas in ETH. Given a transaction hash, it reports whether execution succeeded or reverted, how much gas was burned, the effective gas price paid, and every log the transaction emitted. Because OP Mainnet produces a fresh block roughly every 2 seconds from its single sequencer, receipts become available quickly after submission. Send the request to https://optimism.therpc.io/YOUR_API_KEY.
status field (0x1 success, 0x0 revert).logs to update application state — for example, picking up Transfer events from an ERC-20 or a Swap from a Velodrome pool.contractAddress field, which is non-null only for deployment transactions.gasUsed * effectiveGasPrice (note that OP Stack also charges a separate L1 data fee for posting the transaction to Ethereum).| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | transactionHash | string (hex) | Ja | The hash of the mined transaction. |
| Typ | Beschreibung |
|---|---|
| object | null | Receipt object containing: transactionHash, transactionIndex, blockHash, blockNumber, from, to, contractAddress (non-null only for contract deployments), gasUsed, cumulativeGasUsed, effectiveGasPrice, status ("0x1" success / "0x0" revert), logs (array of log objects), logsBloom, type. Returns null f |
Try it live in the Optimism playground.
| Code | Meldung | Ursache |
|---|---|---|
-32602 | Invalid params | Transaction hash is malformed. |
null. Poll until you get a non-null receipt rather than assuming it is ready; on OP Mainnet's ~2s blocks this is usually only a brief wait, but never treat the first null as a failure.status: "0x0" means the transaction was included in a block but reverted — gas was still consumed and the L1 data fee still applies, so the sender pays even though no state change stuck.eth_getBlockReceipts returns them all in a single call and is far more efficient than one eth_getTransactionReceipt per transaction.Parameter
0x-prefixed 32-byte transaction hash