Polygon
Bereit, das in der Produktion aufzurufen?
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
Polygon
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
eth_getTransactionReceipt returns the execution receipt for a transaction once it has been mined into a Polygon PoS block, where gas is paid in the network's native MATIC. The receipt is the authoritative record of what happened on-chain: it tells you whether the transaction succeeded or reverted, how much gas it burned, the effective gas price it paid, and every event (log) the call emitted. Send the request to https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89). Because Polygon seals blocks roughly every two seconds, a receipt usually becomes available within a few seconds of submission.
status: "0x1") or reverted (status: "0x0") once it lands in a block.logs array to pick up emitted events — for example a Transfer from the USDT contract at 0xc2132D05D31c914a87C6611C10748AEb04B58e8F — and update your application state.contractAddress to learn the address of a contract you just deployed; it is non-null only for contract-creation transactions.gasUsed * effectiveGasPrice, useful for accounting given Polygon's typically low per-transaction cost.| # | 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 Polygon playground.
| Code | Meldung | Ursache |
|---|---|---|
-32602 | Invalid params | Transaction hash is malformed. |
null for a transaction still sitting in the mempool. Poll until you get a non-null receipt rather than assuming it is ready — on Polygon this is usually only a couple of blocks (a few seconds), but congestion can stretch it.status of "0x0" means the transaction was included in a block but reverted; the sender still paid for the gas it consumed in MATIC, so always check status before treating an action as successful.eth_getBlockReceipts returns them all in one round trip and is far more efficient than firing one eth_getTransactionReceipt per hash — valuable on a high-throughput chain like Polygon.Parameter
0x-prefixed 32-byte transaction hash