import { SpotConfig } from "../../shared/catalog-config.js"; import { PublicApiTransports } from "../../shared/transports.js"; import { PolyesterRequestOptions } from "../../shared/request-options.js"; import { PolyesterRealtime } from "../../realtime/types.js"; import { BaseSubscribeInput } from "../../shared/types.js"; import { SdkScales } from "../../shared/decimal-surface.js"; import { GetMarketTradesInput, MarketTrade, TradeBackfill } from "./market-data.schemas.js"; //#region src/services/market-data/market-data.d.ts interface SubscribeTradesInput extends BaseSubscribeInput { symbolId: number; } /** * Exposes public spot trades, spot configuration, and live trade streams. */ declare class MarketDataService { #private; constructor(transports: PublicApiTransports, realtime: PolyesterRealtime, scales: SdkScales); /** * Returns recent public trades for one spot market, ordered newest-first by execution timestamp with match id as a tie-breaker. Supports limit, time bounds, side filtering, and match-id pagination. * * With `afterTradeId`, it instead walks the symbol's trades by `matchId`, oldest first and * gap-free, to backfill trades missed on a live stream, and the result carries `backfill`. * Start from `"0"`, then pass `backfill.nextAfterTradeId`; when it equals the `afterTradeId` * sent, nothing newer is available yet, so retry later with backoff. `afterTradeId` cannot * be combined with `side`, `startTsNs`, `endTsNs` or `pageToken`. */ listTrades(input: GetMarketTradesInput, options?: PolyesterRequestOptions): Promise<{ trades: MarketTrade[]; nextPageToken: string; backfill?: TradeBackfill; }>; /** * Returns the cacheable spot reference-data snapshot, including asset metadata, pair trading constraints, display scales, statuses, and market slippage defaults. * * This is the catalog's own data source, so it must never wait on catalog * readiness (that would deadlock the initial catalog refresh) and carries * no decimal conversion. */ getSpotConfig(options?: PolyesterRequestOptions): Promise; /** * Subscribes to public trade prints on public:spot:market:trades:{symbolId}:proto for the requested symbol and emits parsed market trades. * Each publication batches trades, emitted one at a time in execution order; a trade * whose `matchId` was already emitted replaces the earlier copy. */ subscribeTrades(input: SubscribeTradesInput): () => void; } //#endregion export { MarketDataService }; //# sourceMappingURL=market-data.d.ts.map