/** * WebSocket Feed Manager for Dashboard. * * Connects to exchange WS APIs for real-time account data (balance, positions, orders). * Falls back to REST polling if WS connection fails. * Arb/market data stays on REST (cross-exchange aggregation, no single WS covers it). */ import type { ExchangeBalance, ExchangePosition, ExchangeOrder } from "../exchanges/index.js"; import type { DashboardExchange } from "./server.js"; export interface WsFeedState { balance: ExchangeBalance; positions: ExchangePosition[]; orders: ExchangeOrder[]; lastUpdate: number; mode: "ws" | "rest" | "connecting"; } export interface WsFeedManagerOpts { onUpdate: (exchange: string, state: WsFeedState) => void; signal?: AbortSignal; } export declare class WsFeedManager { private feeds; private onUpdate; constructor(exchanges: DashboardExchange[], opts: WsFeedManagerOpts); start(): Promise; getState(exchange: string): WsFeedState | null; getAllStates(): Map; close(): void; }