import type { ExchangeWorkerMessage } from "./base.types"; import { ChaseExtension } from "../extenstions/chase.extension"; import { TWAPExtension } from "../extenstions/twap.extension"; import { type Account, type StoreMemory, type ExchangeName, type Balance, PositionSide, type Position, type Ticker, type FetchOHLCVParams, type Timeframe, type PlaceOrderOpts, type Order, type Candle, type OrderBook, type ExchangeConfig, type UpdateOrderOpts, type PlacePositionStopOpts } from "../types/lib.types"; import type { ObjectChangeCommand, ObjectPaths } from "../types/misc.types"; export declare class BaseWorker { parent: typeof self; name: ExchangeName; config: ExchangeConfig; accounts: Account[]; memory: StoreMemory[ExchangeName]; twapExtension: TWAPExtension; chaseExtension: ChaseExtension; constructor({ parent, config, name, }: { parent: typeof self; config: ExchangeConfig; name: ExchangeName; }); onMessage: ({ data }: ExchangeWorkerMessage) => void | Promise | Promise<(string | number)[]>; stop(): void; start({ accounts, config, }: { accounts: Account[]; requestId: string; config: ExchangeConfig; }): Promise; addAccounts({ accounts }: { accounts: Account[]; requestId?: string; }): Promise; removeAccount({ accountId, requestId, }: { accountId: string; requestId: string; }): Promise; fetchOHLCV(_params: { requestId: string; params: FetchOHLCVParams; }): Promise; listenOHLCV(_params: { symbol: string; timeframe: Timeframe; }): void; unlistenOHLCV(_params: { symbol: string; timeframe: Timeframe; }): void; listenOrderBook(_symbol: string): void; unlistenOrderBook(_symbol: string): void; updateAccountBalance({ accountId, balance, }: { accountId: Account["id"]; balance: Balance; }): void; removeAccountPositions({ accountId, positions, }: { accountId: Account["id"]; positions: { side: PositionSide; symbol: string; }[]; }): void; updateAccountPositions({ accountId, positions, }: { accountId: Account["id"]; positions: Position[]; }): void; updateTicker(ticker: Ticker): void; updateTickerDelta(ticker: Partial & { symbol: string; }): void; placePositionStop(_params: { position: Position; stop: PlacePositionStopOpts; requestId: string; priority?: boolean; }): Promise; placeOrders(_params: { orders: PlaceOrderOpts[]; accountId: string; requestId: string; priority?: boolean; }): Promise>; updateOrders(_params: { updates: UpdateOrderOpts[]; accountId: string; requestId: string; priority?: boolean; }): Promise; mapAccountOrdersFromIds({ orderIds, accountId, }: { orderIds: Order["id"][]; accountId: string; }): Order[]; cancelOrders(_params: { orderIds: Array; accountId: string; requestId: string; priority?: boolean; }): Promise; cancelSymbolOrders(_params: { symbol: string; accountId: string; requestId: string; priority?: boolean; }): Promise; cancelAllOrders(_params: { accountId: string; requestId: string; priority?: boolean; }): Promise; fetchPositionMetadata(_params: { requestId: string; accountId: string; symbol: string; }): Promise; setLeverage(_params: { requestId: string; accountId: string; symbol: string; leverage: number; }): Promise; emitChanges:

>(changes: ObjectChangeCommand[]) => void; log: (message: any) => void; error: (error: any) => void; emitCandle: (candle: Candle) => void; emitOrderBook: ({ symbol, orderBook, }: { symbol: string; orderBook: OrderBook; }) => void; emitResponse: ({ requestId, data }: { requestId: string; data?: any; }) => void; }