import type { FastTradingApi } from "../lib/fast-trading-api.lib"; import type { Account, Position, Candle, ChaseOpts, ExchangeConfig, FetchOHLCVParams, OrderBook, PlaceOrderOpts, StoreMemory, Timeframe, TWAPOpts, UpdateOrderOpts, PlacePositionStopOpts } from "../types/lib.types"; import type { ObjectChangeCommand, ObjectPaths } from "../types/misc.types"; export declare class BaseExchange { name: string; config: ExchangeConfig; parent: FastTradingApi; worker: Worker; workerReady: boolean; pendingRequests: Map void>; ohlcvListeners: Map void>; orderBookListeners: Map void>; constructor({ name, config, parent, createWorker, }: { name: string; config: ExchangeConfig; parent: FastTradingApi; createWorker: () => Worker; }); start: () => Promise; stop: () => void; addAccounts: (accounts: Account[]) => Promise; removeAccount: (accountId: string) => Promise; fetchOHLCV(params: FetchOHLCVParams): Promise; placePositionStop({ position, stop, priority, }: { position: Position; stop: PlacePositionStopOpts; priority?: boolean; }): Promise; placeOrders({ orders, accountId, priority, }: { orders: PlaceOrderOpts[]; accountId: string; priority?: boolean; }): Promise; updateOrders({ updates, accountId, priority, }: { updates: UpdateOrderOpts[]; accountId: string; priority?: boolean; }): Promise; cancelOrders({ orderIds, accountId, priority, }: { orderIds: Array; accountId: string; priority?: boolean; }): Promise; cancelSymbolOrders({ symbol, accountId, priority, }: { symbol: string; accountId: string; priority?: boolean; }): Promise; cancelAllOrders({ accountId, priority, }: { accountId: string; priority?: boolean; }): Promise; fetchPositionMetadata({ accountId, symbol, }: { accountId: string; symbol: string; }): Promise<{ leverage: number; isHedged: boolean; }>; setLeverage({ accountId, symbol, leverage, }: { accountId: string; symbol: string; leverage: number; }): Promise; listenOHLCV({ symbol, timeframe, callback, }: { symbol: string; timeframe: Timeframe; callback: (candle: Candle) => void; }): void; unlistenOHLCV({ symbol, timeframe, }: { symbol: string; timeframe: Timeframe; }): void; listenOrderBook({ symbol, callback, }: { symbol: string; callback: (orderBook: OrderBook) => void; }): void; unlistenOrderBook(symbol: string): void; startTwap({ accountId, twap }: { accountId: string; twap: TWAPOpts; }): Promise; pauseTwap({ accountId, twapId }: { accountId: string; twapId: string; }): Promise; resumeTwap({ accountId, twapId }: { accountId: string; twapId: string; }): Promise; stopTwap({ accountId, twapId }: { accountId: string; twapId: string; }): Promise; startChase({ accountId, chase }: { accountId: string; chase: ChaseOpts; }): Promise; stopChase({ accountId, chaseId }: { accountId: string; chaseId: string; }): Promise; dispatchWorker(message: Record): Promise; waitForWorkerReady: () => Promise; onWorkerMessage:

>({ data, }: MessageEvent<{ type: "ready"; } | { type: "update"; changes: ObjectChangeCommand[]; } | { type: "response"; requestId: string; data: any; } | { type: "log"; message: string; } | { type: "error"; error: Error; } | { type: "candle"; candle: Candle; } | { type: "orderBook"; symbol: string; orderBook: OrderBook; }>) => void; handleResponse: ({ requestId, data }: { requestId: string; data: any; }) => void; handleCandle: (candle: Candle) => void; handleOrderBook: ({ symbol, orderBook, }: { symbol: string; orderBook: OrderBook; }) => void; }