UNPKG

@polymarket/real-time-data-client

Version:

A TypeScript client to receive real time data messages

57 lines (56 loc) 1.49 kB
/** * API key credentials for CLOB authentication. */ export interface ClobApiKeyCreds { /** API key used for authentication */ key: string; /** API secret associated with the key */ secret: string; /** Passphrase required for authentication */ passphrase: string; } /** * Authentication details for Gamma authentication. */ export interface GammaAuth { /** Address used for authentication */ address: string; } /** * Message structure for subscription requests. */ export interface SubscriptionMessage { subscriptions: { /** Topic to subscribe to */ topic: string; /** Type of subscription */ type: string; /** Optional filters for the subscription */ filters?: string; /** Optional CLOB authentication credentials */ clob_auth?: ClobApiKeyCreds; /** Optional Gamma authentication credentials */ gamma_auth?: GammaAuth; }[]; } /** * Represents a real-time message received from the WebSocket server. */ export interface Message { /** Topic of the message */ topic: string; /** Type of the message */ type: string; /** Timestamp of when the message was sent */ timestamp: number; /** Payload containing the message data */ payload: object; } /** * Represents websocket connection status */ export declare enum ConnectionStatus { CONNECTING = "CONNECTING", CONNECTED = "CONNECTED", DISCONNECTED = "DISCONNECTED" }