Ethereum
Pronto para usar isso em produção?
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
Ethereum
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_getTransactionReceipt returns the execution receipt for a transaction that has already been included in an Ethereum block. Where eth_getTransactionByHash shows you what was submitted, the receipt tells you what actually happened once a validator ran it on the EVM: whether it succeeded or reverted, how much gas it burned, the effectiveGasPrice the sender paid in ETH, and every log event the transaction emitted. Point your client at https://ethereum.therpc.io/YOUR_API_KEY (chain ID 1) and pass the 32-byte transaction hash. The response is a single receipt object, or null if the transaction is still sitting in the mempool and has not been mined yet.
status field to confirm whether a transaction succeeded (0x1) or reverted (0x0) after a validator included it.logs array to decode emitted events, such as an ERC-20 Transfer or a Uniswap Swap, and update your application state from them.contractAddress after a deployment: it is non-null only when the transaction created a contract, giving you the new address without computing it yourself.gasUsed * effectiveGasPrice, which already accounts for the burned EIP-1559 base fee plus the validator tip.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | transactionHash | string (hex) | Sim | The hash of the mined transaction. |
| Tipo | Descrição |
|---|---|
| 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 Ethereum playground.
| Código | Mensagem | Causa |
|---|---|---|
-32602 | Invalid params | Transaction hash is malformed. |
null. Poll on a short interval (Ethereum produces one block roughly every 12 seconds) instead of assuming the receipt is there the moment you broadcast.status of 0x0 does not mean nothing happened. The transaction was included on-chain and reverted; the sender still paid for the gas it consumed before the revert.eth_getBlockReceipts returns every receipt for a block in a single round trip and is far cheaper for indexing workloads.Parâmetros
0x-prefixed 32-byte transaction hash