Schemas
ReceiptSchema — Full receipt: status, gas usage, logs.Types
See Also
- Transaction - Transaction that produced this receipt
- EventLog - Decoded event logs
- GasUsed - Gas consumption tracking
Effect-based schemas for Ethereum transaction receipts and event logs
import * as Receipt from 'voltaire-effect/primitives/Receipt'
import * as Schema from 'effect/Schema'
const receipt = Schema.decodeSync(Receipt.JSON)(receiptData)
Schema.decodeSync(Receipt.JSON)({
transactionHash: txHash,
blockNumber: 12345n,
blockHash: blockHash,
transactionIndex: 0,
from: '0x1234567890123456789012345678901234567890',
to: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
cumulativeGasUsed: 21000n,
gasUsed: 21000n,
contractAddress: null,
logs: [],
logsBloom: new Uint8Array(256),
status: 1
})
interface ReceiptType {
readonly transactionHash: HashType
readonly blockNumber: bigint
readonly blockHash: HashType
readonly transactionIndex: number
readonly from: AddressType
readonly to: AddressType | null
readonly cumulativeGasUsed: bigint
readonly gasUsed: bigint
readonly contractAddress: AddressType | null
readonly logs: readonly LogType[]
readonly logsBloom: Uint8Array
readonly status: 0 | 1 // 0 = failed, 1 = success
}
interface LogType {
readonly address: AddressType
readonly topics: readonly HashType[]
readonly data: Uint8Array
readonly blockNumber: bigint
readonly transactionHash: HashType
readonly transactionIndex: number
readonly blockHash: HashType
readonly logIndex: number
readonly removed: boolean
}