import { PriceFeedResponse } from "../types"; /** * Callback function type for price updates */ export type PriceUpdateCallback = (priceData: PriceFeedResponse) => void; /** * WebSocket client for real-time price feeds from Pyth Network */ export declare class FeedClient { private url; private ws?; private callbacks; private onError?; private onClose?; private pairFeedMap; private reconnectAttempts; private maxReconnectAttempts; private reconnectDelay; constructor(url?: string, onError?: (error: Error) => void, onClose?: () => void); /** * Register a callback for a specific price feed */ registerPriceFeedCallback(feedId: string, callback: PriceUpdateCallback): void; /** * Unregister a callback for a specific price feed */ unregisterPriceFeedCallback(feedId: string, callback: PriceUpdateCallback): void; /** * Load pair to feed ID mappings */ loadPairFeeds(pairFeeds: Map): void; /** * Get feed ID for a trading pair */ getFeedIdForPair(pairName: string): string | undefined; /** * Connect to WebSocket and listen for price updates */ listenForPriceUpdates(): Promise; /** * Subscribe to specific price feeds */ private subscribeToPriceFeeds; /** * Unsubscribe from specific price feeds */ private unsubscribeFromPriceFeeds; /** * Handle incoming price update */ private handlePriceUpdate; /** * Attempt to reconnect to WebSocket */ private attemptReconnect; /** * Get latest prices via HTTP */ getLatestPriceUpdates(feedIds: string[]): Promise; /** * Close the WebSocket connection */ close(): void; /** * Check if WebSocket is connected */ isConnected(): boolean; }