@glowlabs-org/events-sdk
Version:
Typed event SDK for Glow, powered by RabbitMQ and Zod.
106 lines (105 loc) • 3 kB
TypeScript
import { z } from "zod";
import { EventType } from "./event-types";
export declare const baseEventZ: z.ZodObject<{
id: z.ZodString;
zoneId: z.ZodEffects<z.ZodNumber, number, number>;
zoneName: z.ZodEnum<[string, ...string[]]>;
schemaVersion: z.ZodEnum<["v1", "v2", "v2-alpha"]>;
eventType: z.ZodEnum<[EventType, ...EventType[]]>;
timeStamp: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v1" | "v2" | "v2-alpha";
eventType: EventType;
timeStamp: number;
}, {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v1" | "v2" | "v2-alpha";
eventType: EventType;
timeStamp: number;
}>;
export interface BaseEventAuditPushedV1 {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v1";
eventType: "audit.pushed";
timeStamp: number;
}
export interface BaseEventAuditSlashedV1 {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v1";
eventType: "audit.slashed";
timeStamp: number;
}
export interface BaseEventAuditPfeesPaidV1 {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v1";
eventType: "audit.pfees.paid";
timeStamp: number;
}
export interface BaseEventAuditPfeesPaidV2 {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v2";
eventType: "audit.pfees.paid";
timeStamp: number;
}
export interface BaseEventAuditPfeesPaidV2Alpha {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v2-alpha";
eventType: "audit.pfees.paid";
timeStamp: number;
}
export interface BaseEventApplicationCreatedV1 {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v1";
eventType: "application.created";
timeStamp: number;
}
export interface BaseEventApplicationCreatedV2Alpha {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v2-alpha";
eventType: "application.created";
timeStamp: number;
}
export interface BaseEventApplicationPriceQuoteV2Alpha {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v2-alpha";
eventType: "application.price.quote";
timeStamp: number;
}
export interface BaseEventGctlMintedV2Alpha {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v2-alpha";
eventType: "gctl.minted";
timeStamp: number;
}
export interface BaseEventAuditorFeesPaidV2Alpha {
id: string;
zoneId: number;
zoneName: string;
schemaVersion: "v2-alpha";
eventType: "auditor.fees.paid";
timeStamp: number;
}
export type BaseEvent = BaseEventAuditPushedV1 | BaseEventAuditSlashedV1 | BaseEventAuditPfeesPaidV1 | BaseEventAuditPfeesPaidV2 | BaseEventAuditPfeesPaidV2Alpha | BaseEventApplicationCreatedV1 | BaseEventApplicationCreatedV2Alpha | BaseEventApplicationPriceQuoteV2Alpha | BaseEventGctlMintedV2Alpha | BaseEventAuditorFeesPaidV2Alpha;