0xtrails
Version:
SDK for Trails
69 lines • 2.37 kB
TypeScript
import { TransactionReceipt, Log } from 'viem';
export interface CallSucceededEvent {
type: "CallSucceeded";
opHash: string;
index: bigint;
log: Log;
}
export interface CallFailedEvent {
type: "CallFailed";
opHash: string;
index: bigint;
returnData: string;
log: Log;
}
export interface CallAbortedEvent {
type: "CallAborted";
opHash: string;
index: bigint;
returnData: string;
log: Log;
}
export interface CallSkippedEvent {
type: "CallSkipped";
deploymentId: string;
actionIndex: bigint;
log: Log;
}
export interface RefundEvent {
type: "Refund";
token: string;
recipient: string;
amount: bigint;
log: Log;
}
export interface SweepEvent {
type: "Sweep";
token: string;
recipient: string;
amount: bigint;
log: Log;
}
export interface RefundAndSweepEvent {
type: "RefundAndSweep";
token: string;
refundRecipient: string;
refundAmount: bigint;
sweepRecipient: string;
actualRefund: bigint;
remaining: bigint;
log: Log;
}
export type GuestModuleEvent = CallSucceededEvent | CallFailedEvent | CallAbortedEvent | CallSkippedEvent;
export type TrailsTokenSweeperEvent = RefundEvent | SweepEvent | RefundAndSweepEvent;
export declare function decodeCallSucceeded(log: Log): CallSucceededEvent | null;
export declare function decodeCallFailed(log: Log): CallFailedEvent | null;
export declare function decodeCallAborted(log: Log): CallAbortedEvent | null;
export declare function decodeCallSkipped(log: Log): CallSkippedEvent | null;
export declare function decodeRefund(log: Log): RefundEvent | null;
export declare function decodeRefundAndSweep(log: Log): RefundAndSweepEvent | null;
export declare function decodeSweep(log: Log): SweepEvent | null;
export declare function decodeTrailsTokenSweeperEvents(receipt: TransactionReceipt): TrailsTokenSweeperEvent[];
export declare function decodeGuestModuleEvents(receipt: TransactionReceipt): GuestModuleEvent[];
export declare function getEventsByType<T extends GuestModuleEvent["type"]>(events: GuestModuleEvent[], type: T): Extract<GuestModuleEvent, {
type: T;
}>[];
export declare function getFirstEventByType<T extends GuestModuleEvent["type"]>(events: GuestModuleEvent[], type: T): Extract<GuestModuleEvent, {
type: T;
}> | undefined;
//# sourceMappingURL=decoders.d.ts.map