import { PriceTrigger } from "./plan-types.mjs"; //#region extensions/crypto/src/services/price-watcher.d.ts interface PriceWatch { /** Unique ID for this watch (typically planId). */ id: string; /** Token symbol to watch. */ token: string; /** Trigger condition. */ condition: 'above' | 'below' | 'crosses'; /** Price threshold in USD. */ threshold: number; /** Hysteresis percentage. Default: 1%. */ hysteresisPercent: number; /** Cooldown between triggers in ms. Default: 300_000 (5 min). */ cooldownMs: number; /** If true, trigger fires repeatedly. If false, fires once then removes itself. */ recurring: boolean; } type PriceFetcher = (token: string) => Promise; declare class PriceWatcher { private watches; private state; private tickInterval; private running; private priceFetcher; private tickMs; constructor(opts?: { priceFetcher?: PriceFetcher; tickMs?: number; }); /** Add a price watch. */ addWatch(watch: PriceWatch): void; /** Create a watch from a PriceTrigger (from a plan). */ addFromTrigger(planId: string, trigger: PriceTrigger): void; /** Remove a watch. */ removeWatch(id: string): boolean; /** Get all active watches. */ getWatches(): PriceWatch[]; /** Get the number of active watches. */ get watchCount(): number; /** Start the polling loop. */ start(): void; /** Stop the polling loop. */ stop(): void; /** Check if the watcher is running. */ get isRunning(): boolean; /** Run one price check cycle. Public for testing. */ tick(): Promise; private evaluateCondition; /** Clear all watches and state. */ clear(): void; } declare function getPriceWatcher(opts?: { priceFetcher?: PriceFetcher; tickMs?: number; }): PriceWatcher; declare function resetPriceWatcher(): void; //#endregion export { PriceFetcher, PriceWatch, PriceWatcher, getPriceWatcher, resetPriceWatcher }; //# sourceMappingURL=price-watcher.d.mts.map