Ethereum
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Ethereum
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
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.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | transactionHash | string (hex) | 是 | The hash of the mined transaction. |
| 类型 | 描述 |
|---|---|
| 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.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-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.参数
0x-prefixed 32-byte transaction hash