eth_getTransactionReceipt
Returns the receipt of a transaction by transaction hash.
Parameters
string
- The transaction hash
Example
["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"]
Returns
object
or null
Returns a transaction receipt object, or null
if no receipt was found:
interface TransactionReceipt {
transactionHash: string; // Hash of the transaction
transactionIndex: string; // Integer of the transaction's index position in the block
blockHash: string; // Hash of the block where this transaction was in
blockNumber: string; // Block number where this transaction was in
from: string; // Address of the sender
to: string | null; // Address of the receiver. null when it's a contract creation transaction
cumulativeGasUsed: string; // The total amount of gas used in the block up to and including this transaction
gasUsed: string; // The amount of gas used by this specific transaction
contractAddress: string | null; // The contract address created, if the transaction was a contract creation, otherwise null
logs: Array<Log>; // Array of log objects, which this transaction generated
logsBloom: string; // Bloom filter for light clients to quickly retrieve related logs
status: string; // Either '0x1' (success) or '0x0' (failure)
}
interface Log {
removed: boolean; // Whether the log was removed due to a chain reorganization
logIndex: string; // Integer of the log index position in the block
transactionIndex: string; // Integer of the transaction's index position the log was created from
transactionHash: string; // Hash of the transaction this log was created from
blockHash: string; // Hash of the block where this log was in
blockNumber: string; // The block number where this log was in
address: string; // Address from which this log originated
data: string; // Contains non-indexed parameters of the log
topics: Array<string>; // Array of up to 4 32-byte topics, topic[0] is the event signature
}
Errors
Code | Message |
---|---|
-32602 | Invalid parameter |