@atomiqlabs/base
Version:
Base classes and interfaces for atomiq protocol
34 lines (28 loc) • 785 B
text/typescript
import {SwapData} from "../../../swaps/SwapData";
import {ChainEvent} from "../ChainEvent";
/**
* Enum of the different types of escrow-swap specific events
*
* @category Events
*/
export enum SwapEventType {
INITIALIZE = 0,
REFUND = 1,
CLAIM = 2
}
/**
* Represents an escrow-specific event
*
* @category Events
*/
export abstract class SwapEvent<T extends SwapData, C extends SwapEventType = SwapEventType> extends ChainEvent<T> {
abstract readonly eventType: C;
/**
* Identifier of the escrow, usually a hash of the full escrow swap data
*/
escrowHash: string;
constructor(escrowHash: string, contractVersion?: string) {
super(contractVersion);
this.escrowHash = escrowHash;
}
}