/// import EventEmitter from 'events'; import { InstrumentType } from './type/meta'; import { WsPush } from './type/push'; import { WsCancelOrderParameter, WsPlaceOrderParams } from './type/request'; import { WsAmendOrderResponse, WsCancelOrderResponse, WsMassCancelResponse, WsPlaceOrderResponse } from './type/response'; export interface WsPushOrdersArg { channel: 'orders'; instType: InstrumentType; instId: string; uid: string; } export interface WsOrder { accFillSz: string; amendResult: string; avgPx: string; cTime: string; category: string; ccy: string; clOrdId: string; code: string; execType: string; fee: string; feeCcy: string; fillFee: string; fillFeeCcy: string; fillNotionalUsd: string; fillPx: string; fillSz: string; fillPnl: string; fillTime: string; instId: string; instType: string; lever: string; msg: string; notionalUsd: string; ordId: string; ordType: string; pnl: string; posSide: string; px: string; rebate: string; rebateCcy: string; reduceOnly: string; reqId: string; side: string; attachAlgoClOrdId: string; slOrdPx: string; slTriggerPx: string; slTriggerPxType: string; source: string; state: string; stpId: string; stpMode: string; sz: string; tag: string; tdMode: string; tgtCcy: string; tpOrdPx: string; tpTriggerPx: string; tpTriggerPxType: string; tradeId: string; quickMgnType: string; algoClOrdId: string; algoId: string; amendSource: string; cancelSource: string; uTime: string; } export type WsPushOrders = WsPush; export type TradeEvent = 'push-orders'; export interface Trade { emit(event: TradeEvent, data: WsOrder[]): boolean; emit(event: 'order' | 'batch-orders', data: WsPlaceOrderResponse): boolean; emit(event: 'cancel-order' | 'batch-cancel-orders', data: WsCancelOrderResponse): boolean; emit(event: 'amend-order' | 'batch-amend-orders', data: WsAmendOrderResponse): boolean; emit(event: 'mass-cancel', data: WsMassCancelResponse): boolean; on(event: TradeEvent, listener: (push: WsOrder) => void): this; on(event: 'order' | 'batch-orders', listener: (push: WsPlaceOrderResponse) => void): this; on(event: 'cancel-order' | 'batch-cancel-orders', listener: (push: WsCancelOrderResponse) => void): this; on(event: 'amend-order' | 'batch-amend-orders', listener: (push: WsAmendOrderResponse) => void): this; on(event: 'mass-cancel', listener: (push: WsMassCancelResponse) => void): this; off(event: TradeEvent, listener: (push: WsOrder) => void): this; off(event: 'order' | 'batch-orders', listener: (push: WsPlaceOrderResponse) => void): this; off(event: 'cancel-order' | 'batch-cancel-orders', listener: (push: WsCancelOrderResponse) => void): this; off(event: 'amend-order' | 'batch-amend-orders', listener: (push: WsAmendOrderResponse) => void): this; off(event: 'mass-cancel', listener: (push: WsMassCancelResponse) => void): this; } export declare class Trade extends EventEmitter { private _okxWsClient; constructor(); private _subscribe; private _handleOrdersPush; placeOrder(params: WsPlaceOrderParams[]): Promise; cancelOrder(params: WsCancelOrderParameter[]): Promise; static getUuid(): string; }