import type { OrderBookId, PubkeyStr, Resolution } from "../shared"; /** * Book subscriptions optionally carry a Hyperliquid-style aggregation * (`nSigFigs`/`mantissa`, wire spelling — omit both for full precision; the * backend rejects unknown/snake_case params). Each `(orderbook, aggregation)` * pair is a distinct subscription: one connection may hold multiple * aggregation views of the same orderbook, and unsubscribe must repeat the * same (normalized) aggregation to match. The wallet-balance variant is an * authenticated wallet identity whose tracked subscription replays on reconnect. */ export type SubscribeParams = { type: "book_update"; orderbook_ids: OrderBookId[]; nSigFigs?: number; mantissa?: number; } | { type: "trades"; orderbook_ids: OrderBookId[]; } | { type: "user"; wallet_address: PubkeyStr; } | { type: "wallet_deposit_balances"; wallet_address: PubkeyStr; } | { type: "price_history"; orderbook_id: OrderBookId; resolution: Resolution; include_ohlcv?: boolean; } | { type: "ticker"; orderbook_ids: OrderBookId[]; } | { type: "market"; market_pubkey: PubkeyStr; } | { type: "deposit_price"; deposit_asset: string; resolution: Resolution; } | { type: "deposit_asset_price"; deposit_asset: string; }; /** Wire unsubscribe identities; wallet streams must repeat the exact wallet. */ export type UnsubscribeParams = { type: "book_update"; orderbook_ids: OrderBookId[]; nSigFigs?: number; mantissa?: number; } | { type: "trades"; orderbook_ids: OrderBookId[]; } | { type: "user"; wallet_address: PubkeyStr; } | { type: "wallet_deposit_balances"; wallet_address: PubkeyStr; } | { type: "price_history"; orderbook_id: OrderBookId; resolution: Resolution; } | { type: "ticker"; orderbook_ids: OrderBookId[]; } | { type: "market"; market_pubkey: PubkeyStr; } | { type: "deposit_price"; deposit_asset: string; resolution: Resolution; } | { type: "deposit_asset_price"; deposit_asset: string; }; export interface Subscription { toSubscribeParams(): SubscribeParams; toUnsubscribeParams(): UnsubscribeParams; matchesUnsubscribe(unsubscribe: UnsubscribeParams): boolean; subscriptionKey(): string; } export declare function isAuthedSubscriptionParams(params: SubscribeParams | UnsubscribeParams): boolean; /** Stable deduplication and reconnect-replay identity for one subscription. */ export declare function subscriptionKey(params: SubscribeParams): string; /** Match a wire unsubscribe against locally tracked replay state. */ export declare function unsubscribeMatches(subscribe: SubscribeParams, unsubscribe: UnsubscribeParams): boolean; //# sourceMappingURL=subscriptions.d.ts.map