UNPKG

okx-api

Version:

Complete Node.js SDK for OKX's REST APIs and WebSockets, with TypeScript & end-to-end tests

34 lines (33 loc) 842 B
import { WsChannel } from './ws-request.js'; export interface MessageEventLike { target: WebSocket; type: 'message'; data: string; } export declare function isMessageEvent(msg: unknown): msg is MessageEventLike; export interface WsEvent { event: 'error' | 'login' | 'subscribe' | 'unsubscribe' | 'channel-conn-count'; code?: string; msg?: string; arg?: any; data?: any; } export interface WsDataEvent<T = any> { arg: { channel: WsChannel; uid?: string; instId?: string; instFamily?: string; }; data: T; } export interface WsLoginEvent extends WsEvent { event: 'login'; } export interface WsChannelConnInfoEvent extends WsEvent { event: 'channel-conn-count'; channel: string; connId: string; connCount: string; } export type WsResponse = WsEvent;