kaia_getTransactionReceipt
The eth_getTransactionReceipt method returns the receipt of a transaction by transaction hash. The receipt contains post-execution information including whether the transaction succeeded or failed, gas used, logs emitted by smart contracts, and the contract address for contract deployments.
This method is crucial for confirming transaction execution, parsing event logs, and determining transaction outcomes. Developers use this to verify that transactions have been mined, check if they succeeded or reverted, extract emitted events from smart contracts, determine the actual gas consumed, and obtain the contract address for newly deployed contracts. The receipt is only available after the transaction has been included in a block and will return null for pending transactions.
Parameters
parameter | type | description |
|---|---|---|
transactionHash | string (required) | Hash of the transaction (32-byte hex string with 0x prefix) |
Return Object
The method returns a transaction receipt object, or null if the transaction has not been mined yet:
field | type | description |
|---|---|---|
transactionHash | string | Hash of the transaction (32 bytes) |
transactionIndex | string | Integer position of the transaction within the block (hex) |
blockHash | string | Hash of the block where this transaction was included (32 bytes) |
blockNumber | string | Number of the block where this transaction was included (hex) |
from | string | Address of the sender (20 bytes) |
to | string | Address of the receiver, null for contract creation transactions (20 bytes) |
cumulativeGasUsed | string | Total amount of gas used when this transaction was executed in the block (hex) |
gasUsed | string | Amount of gas used by this specific transaction (hex) |
contractAddress | string | The contract address created if the transaction was a contract creation, otherwise null (20 bytes) |
logs | array | Array of log objects generated by this transaction, each containing address, topics, data, blockNumber, transactionHash, transactionIndex, blockHash, logIndex, and removed fields |
logsBloom | string | Bloom filter for light clients to quickly retrieve related logs (256 bytes) |
status | string | Either 1 (success) or 0 (failure) encoded as hex |
effectiveGasPrice | string | The actual value per gas deducted from the sender's account (hex) |
type | string | The transaction type: 0 for legacy, 1 for access list, 2 for dynamic fee (EIP-1559) |
Request Example
Response Example