@agg-build/sdk 4.34.1 → 4.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -24
- package/dist/{agg-websocket-CsURzWkQ.d.mts → agg-websocket-BRWnvGwU.d.mts} +139 -17
- package/dist/agg-websocket-BRWnvGwU.d.mts.map +1 -0
- package/dist/{agg-websocket-CsURzWkQ.d.ts → agg-websocket-BRWnvGwU.d.ts} +139 -17
- package/dist/agg-websocket-BRWnvGwU.d.ts.map +1 -0
- package/dist/{agg-websocket-C2neMzGT.mjs → agg-websocket-C9ELOadG.mjs} +377 -63
- package/dist/agg-websocket-C9ELOadG.mjs.map +1 -0
- package/dist/{agg-websocket-MYZiMRXn.js → agg-websocket-Cq4E0T0f.js} +376 -62
- package/dist/browser.d.mts +1 -1
- package/dist/browser.d.mts.map +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +2 -1
- package/dist/browser.mjs +2 -1
- package/dist/browser.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +51 -10
- package/dist/index.mjs +49 -11
- package/dist/index.mjs.map +1 -1
- package/dist/market-data.d.mts +1 -1
- package/dist/market-data.d.ts +1 -1
- package/dist/market-data.js +2 -1
- package/dist/market-data.mjs +2 -1
- package/dist/market-data.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/agg-websocket-C2neMzGT.mjs.map +0 -1
- package/dist/agg-websocket-CsURzWkQ.d.mts.map +0 -1
- package/dist/agg-websocket-CsURzWkQ.d.ts.map +0 -1
package/dist/browser.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { La as WsArbFeedBatch, Mt as ChartCandle, Nt as ChartHistoryManifest, i as AggWebSocketOptions, jt as ChartBarsResponse, n as AggWebSocketCallbacks, q as OrderbookState, r as AggWebSocketDiagnostics, t as AggWebSocket, u as MarketDataEngine, za as WsArbMarketUpdate } from "./agg-websocket-BRWnvGwU.mjs";
|
|
2
2
|
//#region src/market-data/worker-adapter.d.ts
|
|
3
3
|
/** The application owns the native module Worker URL so its static bundler fingerprints it. */
|
|
4
4
|
type MarketDataWorkerFactory = () => Worker;
|
package/dist/browser.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.mts","names":[],"sources":["../src/market-data/worker-adapter.ts"],"mappings":";;;KAaY,gCAAgC;qBAE/B,2BAA2B;mBA8BnB;UA7BX;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;MACJ;EAKe,YAAA,QAAQ,qBACzB,SAAS;EA6EI,cAAc,kBAAkB,QAAQ;UAQzC;UAmBN;EACO,YACb,UAAU,sBACV;IAAY,SAAS;MACpB,QAAQ;UAQG;EAsCL,mBAAmB,iBAAiB;EAIpC,kBAAkB;EA+BrB,wBAAwB,QAAQ,WAAW;MAkBpC;EAGJ,QAAQ,aAAa;EAGrB,YAAY;EAGZ,OAAO,aAAa;EAGpB,UAAU,YAAY;EAGtB,gBAAgB;EAGhB,aAAa,YAAY,KAAK,KAAK;EAWnC,iBAAiB,KAAK,KAAK;EAQ3B,aAAa,WAAW;EAKxB,aAAa;EAIb;EAGA;EAGA,WAAW;EAIX;UAwBD;UAeA;UAkCA;UAwBA;UAoBA;UAcA;UAQA;UAOA;UAoBA;;
|
|
1
|
+
{"version":3,"file":"browser.d.mts","names":[],"sources":["../src/market-data/worker-adapter.ts"],"mappings":";;;KAaY,gCAAgC;qBAE/B,2BAA2B;mBA8BnB;UA7BX;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;MACJ;EAKe,YAAA,QAAQ,qBACzB,SAAS;EA6EI,cAAc,kBAAkB,QAAQ;UAQzC;UAmBN;EACO,YACb,UAAU,sBACV;IAAY,SAAS;MACpB,QAAQ;UAQG;EAsCL,mBAAmB,iBAAiB;EAIpC,kBAAkB;EA+BrB,wBAAwB,QAAQ,WAAW;MAkBpC;EAGJ,QAAQ,aAAa;EAGrB,YAAY;EAGZ,OAAO,aAAa;EAGpB,UAAU,YAAY;EAGtB,gBAAgB;EAGhB,aAAa,YAAY,KAAK,KAAK;EAWnC,iBAAiB,KAAK,KAAK;EAQ3B,aAAa,WAAW;EAKxB,aAAa;EAIb;EAGA;EAGA,WAAW;EAIX;UAwBD;UAeA;UAkCA;UAwBA;UAoBA;UAcA;UAQA;UAOA;UAoBA;;wBAoBM,sBACd,SAAS,qBACT,SAAS,0BACR"}
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { La as WsArbFeedBatch, Mt as ChartCandle, Nt as ChartHistoryManifest, i as AggWebSocketOptions, jt as ChartBarsResponse, n as AggWebSocketCallbacks, q as OrderbookState, r as AggWebSocketDiagnostics, t as AggWebSocket, u as MarketDataEngine, za as WsArbMarketUpdate } from "./agg-websocket-BRWnvGwU.js";
|
|
2
2
|
//#region src/market-data/worker-adapter.d.ts
|
|
3
3
|
/** The application owns the native module Worker URL so its static bundler fingerprints it. */
|
|
4
4
|
type MarketDataWorkerFactory = () => Worker;
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","names":[],"sources":["../src/market-data/worker-adapter.ts"],"mappings":";;;KAaY,gCAAgC;qBAE/B,2BAA2B;mBA8BnB;UA7BX;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;MACJ;EAKe,YAAA,QAAQ,qBACzB,SAAS;EA6EI,cAAc,kBAAkB,QAAQ;UAQzC;UAmBN;EACO,YACb,UAAU,sBACV;IAAY,SAAS;MACpB,QAAQ;UAQG;EAsCL,mBAAmB,iBAAiB;EAIpC,kBAAkB;EA+BrB,wBAAwB,QAAQ,WAAW;MAkBpC;EAGJ,QAAQ,aAAa;EAGrB,YAAY;EAGZ,OAAO,aAAa;EAGpB,UAAU,YAAY;EAGtB,gBAAgB;EAGhB,aAAa,YAAY,KAAK,KAAK;EAWnC,iBAAiB,KAAK,KAAK;EAQ3B,aAAa,WAAW;EAKxB,aAAa;EAIb;EAGA;EAGA,WAAW;EAIX;UAwBD;UAeA;UAkCA;UAwBA;UAoBA;UAcA;UAQA;UAOA;UAoBA;;
|
|
1
|
+
{"version":3,"file":"browser.d.ts","names":[],"sources":["../src/market-data/worker-adapter.ts"],"mappings":";;;KAaY,gCAAgC;qBAE/B,2BAA2B;mBA8BnB;UA7BX;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;MACJ;EAKe,YAAA,QAAQ,qBACzB,SAAS;EA6EI,cAAc,kBAAkB,QAAQ;UAQzC;UAmBN;EACO,YACb,UAAU,sBACV;IAAY,SAAS;MACpB,QAAQ;UAQG;EAsCL,mBAAmB,iBAAiB;EAIpC,kBAAkB;EA+BrB,wBAAwB,QAAQ,WAAW;MAkBpC;EAGJ,QAAQ,aAAa;EAGrB,YAAY;EAGZ,OAAO,aAAa;EAGpB,UAAU,YAAY;EAGtB,gBAAgB;EAGhB,aAAa,YAAY,KAAK,KAAK;EAWnC,iBAAiB,KAAK,KAAK;EAQ3B,aAAa,WAAW;EAKxB,aAAa;EAIb;EAGA;EAGA,WAAW;EAIX;UAwBD;UAeA;UAkCA;UAwBA;UAoBA;UAcA;UAQA;UAOA;UAoBA;;wBAoBM,sBACd,SAAS,qBACT,SAAS,0BACR"}
|
package/dist/browser.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
4
4
|
//#endregion
|
|
5
|
-
const require_agg_websocket = require("./agg-websocket-
|
|
5
|
+
const require_agg_websocket = require("./agg-websocket-Cq4E0T0f.js");
|
|
6
6
|
/**
|
|
7
7
|
* @license
|
|
8
8
|
* Copyright 2019 Google LLC
|
|
@@ -336,6 +336,7 @@ var WorkerAggWebSocket = class extends require_agg_websocket.AggWebSocket {
|
|
|
336
336
|
this.resolvedRevisions.clear();
|
|
337
337
|
this.online = false;
|
|
338
338
|
this.handlers.onConnectionStateChange?.(false);
|
|
339
|
+
if (this.config.orderbookUrl) this.handlers.onOrderbookConnectionStateChange?.(false);
|
|
339
340
|
this.fallback = new require_agg_websocket.AggWebSocket({
|
|
340
341
|
...this.config,
|
|
341
342
|
callbacks: this.fallbackCallbacks()
|
package/dist/browser.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as AggWebSocket } from "./agg-websocket-
|
|
1
|
+
import { t as AggWebSocket } from "./agg-websocket-C9ELOadG.mjs";
|
|
2
2
|
import { proxy, releaseProxy, wrap } from "comlink";
|
|
3
3
|
//#region src/market-data/worker-adapter.ts
|
|
4
4
|
var WorkerAggWebSocket = class extends AggWebSocket {
|
|
@@ -41,6 +41,7 @@ var WorkerAggWebSocket = class extends AggWebSocket {
|
|
|
41
41
|
this.resolvedRevisions.clear();
|
|
42
42
|
this.online = false;
|
|
43
43
|
this.handlers.onConnectionStateChange?.(false);
|
|
44
|
+
if (this.config.orderbookUrl) this.handlers.onOrderbookConnectionStateChange?.(false);
|
|
44
45
|
this.fallback = new AggWebSocket({
|
|
45
46
|
...this.config,
|
|
46
47
|
callbacks: this.fallbackCallbacks()
|
package/dist/browser.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.mjs","names":[],"sources":["../src/market-data/worker-adapter.ts"],"sourcesContent":["import { proxy, releaseProxy, wrap, type Endpoint, type Remote } from \"comlink\";\nimport {\n AggWebSocket,\n type AggWebSocketCallbacks,\n type AggWebSocketOptions,\n type AggWebSocketDiagnostics,\n} from \"../agg-websocket\";\nimport type { ChartHistoryManifest, ChartCandle, ChartBarsResponse } from \"../types\";\nimport type { OrderbookState } from \"../orderbook-utils\";\nimport type { WsArbFeedBatch, WsArbMarketUpdate } from \"../ws-types\";\nimport type { MarketDataEngine, MarketSubscription, MarketViewBatch } from \"./engine\";\n\n/** The application owns the native module Worker URL so its static bundler fingerprints it. */\nexport type MarketDataWorkerFactory = () => Worker;\n\nexport class WorkerAggWebSocket extends AggWebSocket {\n private worker: Worker | null;\n private remote: Remote<MarketDataEngine> | null;\n private endpointListeners = new Map<EventListenerOrEventListenerObject, string>();\n private historyOperations = 0;\n private hostProvider?: () => Record<string, unknown>;\n private handlers: AggWebSocketCallbacks;\n private currentBooks = new Map<string, OrderbookState>();\n private recovering = new Set<string>();\n private diagnosticRevisions = new Map<string, number>();\n private deliveredRevisions = new Map<string, number>();\n private resolvedRevisions = new Map<string, number>();\n private refs = new Map<string, { sub: MarketSubscription; count: number }>();\n private arbListeners = new Map<string, Set<(msg: WsArbMarketUpdate) => void>>();\n private feedListeners = new Set<(msg: WsArbFeedBatch) => void>();\n private latest = new Map<string, WsArbMarketUpdate>();\n private generation = 0;\n private online = false;\n private stopped = false;\n private queued = false;\n private ready: Promise<void>;\n private resolveFailure?: () => void;\n private historyFailures = new Set<(error: Error) => void>();\n private fallback: AggWebSocket | null = null;\n private fallbackUnsubs = new Map<string, () => void>();\n get processesCandles(): boolean {\n return !this.fallback;\n }\n\n constructor(\n private readonly config: AggWebSocketOptions,\n factory: MarketDataWorkerFactory,\n ) {\n super(config);\n if (config.callbacks?.onTrade && !config.callbacks.onMarketView)\n throw new Error(\n \"Raw trade callbacks require AggWebSocket; Worker views require onMarketView opt-in\",\n );\n this.handlers = config.callbacks ?? {};\n this.worker = factory();\n const worker = this.worker;\n const endpoint: Endpoint = {\n postMessage: worker.postMessage.bind(worker),\n addEventListener: (type, listener) => {\n this.endpointListeners.set(listener, type);\n worker.addEventListener(type, listener);\n },\n removeEventListener: (type, listener) => {\n this.endpointListeners.delete(listener);\n worker.removeEventListener(type, listener);\n },\n };\n this.remote = wrap<MarketDataEngine>(endpoint);\n this.worker.addEventListener(\"error\", this.fail);\n this.worker.addEventListener(\"messageerror\", this.fail);\n // Functions can't cross into the Worker; the Worker always uses its own\n // global WebSocket (browsers can't send handshake headers anyway).\n const { callbacks: _callbacks, webSocketImpl: _impl, ...options } = config;\n const startup = this.remote\n .start(\n options,\n proxy((event) => {\n if (!this.fallback) this.event(event.name, event.args, event.revision);\n }),\n )\n .then(() => {\n if (this.stopped || this.fallback || !this.remote) return;\n return this.remote.observeViews(\n proxy((batch: MarketViewBatch) => {\n if (batch.generation < this.generation || this.stopped || this.fallback) return;\n for (const view of batch.views) {\n if (\n !this.refs.has(`orderbook:${view.outcomeId}`) &&\n !this.refs.has(`trades:${view.outcomeId}`)\n )\n continue;\n if ((this.resolvedRevisions.get(view.outcomeId) ?? -1) >= view.revision) continue;\n const integrity =\n (this.diagnosticRevisions.get(view.outcomeId) ?? -1) > view.revision\n ? \"resyncing\"\n : view.integrity;\n this.deliveredRevisions.set(view.outcomeId, view.revision);\n this.handlers.onMarketView?.({ ...view, integrity });\n if (view.book) {\n this.currentBooks.set(view.outcomeId, view.book);\n if (integrity === \"ok\") {\n this.recovering.delete(view.outcomeId);\n this.diagnosticRevisions.delete(view.outcomeId);\n } else this.recovering.add(view.outcomeId);\n if (view.snapshot) this.handlers.onSnapshot?.(view.outcomeId, view.book);\n else this.handlers.onDelta?.(view.outcomeId, view.book);\n }\n for (const trade of [...view.trades].reverse()) this.handlers.onTrade?.(trade);\n }\n }),\n );\n })\n .catch(this.fail);\n const failed = new Promise<void>((resolve) => {\n this.resolveFailure = resolve;\n });\n this.ready = Promise.race([startup, failed]);\n const startupTimeout = setTimeout(this.fail, 3000);\n void this.ready.then(() => clearTimeout(startupTimeout));\n if (typeof document !== \"undefined\")\n document.addEventListener(\"visibilitychange\", this.visibility);\n }\n\n override async decodeHistory(payload: string): Promise<ChartBarsResponse> {\n this.historyOperations++;\n try {\n return await this.decodeHistoryRequest(payload);\n } finally {\n this.historyOperations--;\n }\n }\n private async decodeHistoryRequest(payload: string): Promise<ChartBarsResponse> {\n if (this.stopped) throw new Error(\"Market-data worker disposed\");\n await this.ready;\n if (this.stopped) throw new Error(\"Market-data worker disposed\");\n if (this.fallback) return this.fallback.decodeHistory(payload);\n const remote = this.remote;\n if (!remote) throw new Error(\"Market-data worker unavailable\");\n let rejectFailure!: (error: Error) => void;\n const failed = new Promise<never>((_resolve, reject) => {\n rejectFailure = reject;\n this.historyFailures.add(reject);\n });\n try {\n return await Promise.race([remote.decodeHistory(payload), failed]);\n } finally {\n this.historyFailures.delete(rejectFailure);\n }\n }\n\n private historyGeneration = 0;\n override async loadHistory(\n manifest: ChartHistoryManifest,\n options?: { signal?: AbortSignal },\n ): Promise<ChartCandle[]> {\n this.historyOperations++;\n try {\n return await this.loadHistoryRequest(manifest, options);\n } finally {\n this.historyOperations--;\n }\n }\n private async loadHistoryRequest(\n manifest: ChartHistoryManifest,\n options?: { signal?: AbortSignal },\n ): Promise<ChartCandle[]> {\n if (this.stopped) throw new Error(\"Market-data worker disposed\");\n if (this.fallback) return this.fallback.loadHistory(manifest, options);\n const generation = ++this.historyGeneration;\n const key = `${manifest.venueMarketOutcomeId}:${manifest.resolution}:${manifest.from}:${manifest.to}`;\n options?.signal?.throwIfAborted();\n await this.ready;\n if (this.stopped) throw new Error(\"Market-data worker disposed\");\n options?.signal?.throwIfAborted();\n // Startup may switch transports during the await.\n const fallbackAfterStartup = this.fallback as AggWebSocket | null;\n if (fallbackAfterStartup) return fallbackAfterStartup.loadHistory(manifest, options);\n const remote = this.remote;\n if (!remote) throw new Error(\"Market-data worker unavailable\");\n let rejectFailure!: (error: Error) => void;\n const failed = new Promise<never>((_resolve, reject) => {\n rejectFailure = reject;\n this.historyFailures.add(reject);\n });\n const abort = () => {\n void this.remote?.cancelHistoryRange(key, generation);\n };\n options?.signal?.addEventListener(\"abort\", abort, { once: true });\n try {\n const result = await Promise.race([\n remote.loadImmutableRange(key, generation, manifest),\n failed,\n ]);\n options?.signal?.throwIfAborted();\n return result;\n } finally {\n options?.signal?.removeEventListener(\"abort\", abort);\n this.historyFailures.delete(rejectFailure);\n }\n }\n override setHostDiagnostics(provider?: () => Record<string, unknown>): void {\n this.hostProvider = provider;\n }\n\n override getDiagnostics(): AggWebSocketDiagnostics {\n const subscriptions = [...this.refs.values()].map((entry) => entry.sub);\n return this.fallback\n ? {\n ...this.fallback.getDiagnostics(),\n host: this.hostProvider?.(),\n pendingHistoryRequests: this.historyOperations,\n workerAttached: false,\n bridgeListeners: this.endpointListeners.size,\n }\n : {\n connected: this.connected,\n host: this.hostProvider?.(),\n transport: this.stopped ? \"disposed\" : \"worker\",\n orderbookOutcomeIds: subscriptions\n .filter((sub) => sub.channel === \"orderbook\")\n .map((sub) => sub.id),\n tradeOutcomeIds: subscriptions\n .filter((sub) => sub.channel === \"trades\")\n .map((sub) => sub.id),\n arbMarketIds: [...this.arbListeners.keys()],\n arbFeedSubscribers: this.feedListeners.size,\n cachedBooks: this.currentBooks.size,\n cachedArb: this.latest.size,\n resyncingBooks: this.recovering.size,\n pendingResnapshots: 0,\n pendingHistoryRequests: this.historyOperations,\n workerAttached: this.worker !== null,\n bridgeListeners: this.endpointListeners.size,\n };\n }\n async getWorkerDiagnostics(): Promise<ReturnType<MarketDataEngine[\"getMeasurements\"]> | null> {\n await this.ready;\n const remote = this.remote;\n if (this.stopped || !remote || this.fallback) return null;\n let rejectFailure!: (error: Error) => void;\n const failed = new Promise<never>((_resolve, reject) => {\n rejectFailure = reject;\n this.historyFailures.add(reject);\n });\n try {\n return await Promise.race([remote.getMeasurements(), failed]);\n } catch {\n return null;\n } finally {\n this.historyFailures.delete(rejectFailure);\n }\n }\n\n override get connected(): boolean {\n return !this.stopped && (this.fallback?.connected ?? this.online);\n }\n override getBook(id: string): OrderbookState | null {\n return this.fallback?.getBook(id) ?? this.currentBooks.get(id) ?? null;\n }\n override isResyncing(id: string): boolean {\n return this.fallback?.isResyncing(id) ?? this.recovering.has(id);\n }\n override getArb(id: string): WsArbMarketUpdate | null {\n return this.fallback?.getArb(id) ?? this.latest.get(id) ?? null;\n }\n override subscribe(id: string, channel: \"orderbook\" | \"trades\" = \"orderbook\"): () => void {\n return this.ref({ id, channel });\n }\n override subscribeTrades(id: string): () => void {\n return this.subscribe(id, \"trades\");\n }\n override subscribeArb(id: string, cb: (msg: WsArbMarketUpdate) => void): () => void {\n const listeners = this.arbListeners.get(id) ?? new Set();\n listeners.add(cb);\n this.arbListeners.set(id, listeners);\n const unsubscribe = this.ref({ id, channel: \"arb\" });\n return () => {\n unsubscribe();\n listeners.delete(cb);\n if (!listeners.size) this.arbListeners.delete(id);\n };\n }\n override subscribeArbFeed(cb: (msg: WsArbFeedBatch) => void): () => void {\n this.feedListeners.add(cb);\n const unsubscribe = this.ref({ id: \"*\", channel: \"arb-feed\" });\n return () => {\n unsubscribe();\n this.feedListeners.delete(cb);\n };\n }\n override setCallbacks(callbacks: AggWebSocketCallbacks): void {\n this.handlers = callbacks;\n if (callbacks.onTrade && !callbacks.onMarketView && !this.fallback) this.fail();\n this.fallback?.setCallbacks(this.fallbackCallbacks());\n }\n override authenticate(token: string): void {\n this.config.initialToken = token;\n this.run((engine) => engine.authenticate(token));\n }\n override connect(): void {\n this.run((engine) => engine.connect());\n }\n override disconnect(): void {\n this.run((engine) => engine.disconnect());\n }\n override resnapshot(id: string | string[]): void {\n const ids = Array.isArray(id) ? id : [id];\n this.run((engine) => engine.resnapshot(ids));\n }\n override destroy(): void {\n if (this.stopped) return;\n this.stopped = true;\n this.online = false;\n this.resolveFailure?.();\n for (const reject of this.historyFailures) reject(new Error(\"Market-data worker disposed\"));\n this.historyFailures.clear();\n this.refs.clear();\n this.currentBooks.clear();\n this.latest.clear();\n this.arbListeners.clear();\n this.feedListeners.clear();\n this.recovering.clear();\n this.diagnosticRevisions.clear();\n this.deliveredRevisions.clear();\n this.resolvedRevisions.clear();\n this.fallback?.destroy();\n this.fallbackUnsubs.clear();\n this.hostProvider = undefined;\n this.handlers = {};\n if (typeof document !== \"undefined\")\n document.removeEventListener(\"visibilitychange\", this.visibility);\n this.releaseWorker();\n }\n private releaseWorker(): void {\n const worker = this.worker;\n const remote = this.remote;\n this.remote = null;\n this.worker = null;\n if (remote) remote[releaseProxy]();\n if (!worker) return;\n for (const [listener, type] of this.endpointListeners)\n worker.removeEventListener(type, listener);\n this.endpointListeners.clear();\n worker.removeEventListener(\"error\", this.fail);\n worker.removeEventListener(\"messageerror\", this.fail);\n worker.terminate();\n }\n\n private event(name: keyof AggWebSocketCallbacks, args: unknown[], revision = 0): void {\n if (this.stopped) return;\n if (name === \"onConnectionStateChange\") this.online = args[0] as boolean;\n if (name === \"onDiagnostics\") {\n const diagnostic = args[0] as { type: string; outcomeId?: string };\n if (\n diagnostic.outcomeId &&\n revision < (this.deliveredRevisions.get(diagnostic.outcomeId) ?? -1)\n )\n return;\n if (\n diagnostic.outcomeId &&\n (this.refs.has(`orderbook:${diagnostic.outcomeId}`) ||\n this.refs.has(`trades:${diagnostic.outcomeId}`)) &&\n [\"seq_gap\", \"checksum_mismatch\"].includes(diagnostic.type)\n ) {\n this.recovering.add(diagnostic.outcomeId);\n this.diagnosticRevisions.set(diagnostic.outcomeId, revision);\n }\n }\n if (name === \"onMarketResolved\") {\n const id = (args[0] as { outcomeId: string }).outcomeId;\n if (this.refs.has(`orderbook:${id}`) || this.refs.has(`trades:${id}`))\n this.resolvedRevisions.set(id, revision);\n this.currentBooks.delete(id);\n }\n if (name === \"onArbMarket\") {\n const msg = args[0] as WsArbMarketUpdate;\n this.latest.set(msg.marketId, msg);\n for (const cb of this.arbListeners.get(msg.marketId) ?? []) cb(msg);\n }\n if (name === \"onArbFeed\") for (const cb of this.feedListeners) cb(args[0] as WsArbFeedBatch);\n (this.handlers[name] as ((...args: unknown[]) => void) | undefined)?.(...args);\n }\n private ref(sub: MarketSubscription): () => void {\n const key = `${sub.channel}:${sub.id}`;\n const entry = this.refs.get(key) ?? { sub, count: 0 };\n entry.count++;\n this.refs.set(key, entry);\n this.sync();\n let released = false;\n return () => {\n if (released) return;\n released = true;\n if (--entry.count === 0) {\n this.refs.delete(key);\n if (sub.channel === \"orderbook\") this.recovering.delete(sub.id);\n if (!this.refs.has(`orderbook:${sub.id}`) && !this.refs.has(`trades:${sub.id}`)) {\n this.currentBooks.delete(sub.id);\n this.recovering.delete(sub.id);\n this.diagnosticRevisions.delete(sub.id);\n this.deliveredRevisions.delete(sub.id);\n this.resolvedRevisions.delete(sub.id);\n }\n }\n this.sync();\n };\n }\n private sync(): void {\n if (this.queued || this.stopped) return;\n this.queued = true;\n queueMicrotask(() => {\n this.queued = false;\n if (this.stopped) return;\n if (this.fallback) {\n this.syncFallback();\n return;\n }\n const generation = ++this.generation;\n const subscriptions = [...this.refs.values()].map((entry) => entry.sub);\n void this.ready\n .then(() => {\n if (!this.stopped && !this.fallback)\n return this.remote?.setSubscriptions(subscriptions, generation);\n })\n .catch(this.fail);\n });\n }\n private run(action: (engine: Remote<MarketDataEngine> | AggWebSocket) => unknown): void {\n if (this.stopped) return;\n if (this.fallback) {\n action(this.fallback);\n return;\n }\n void this.ready\n .then(() => {\n if (this.stopped) return;\n const engine = this.fallback ?? this.remote;\n if (engine) return action(engine);\n })\n .catch(this.fail);\n }\n private visibility = (): void => {\n if (document.visibilityState === \"visible\")\n this.resnapshot(\n [...this.refs.values()]\n .filter((entry) => entry.sub.channel === \"orderbook\")\n .map((entry) => entry.sub.id),\n );\n };\n private fallbackCallbacks(): AggWebSocketCallbacks {\n return {\n ...this.handlers,\n onArbMarket: (msg) => this.event(\"onArbMarket\", [msg]),\n onArbFeed: (msg) => this.event(\"onArbFeed\", [msg]),\n };\n }\n private syncFallback(): void {\n for (const [key, unsubscribe] of this.fallbackUnsubs) {\n if (!this.refs.has(key)) {\n unsubscribe();\n this.fallbackUnsubs.delete(key);\n }\n }\n for (const [key, { sub }] of this.refs) {\n if (this.fallbackUnsubs.has(key)) continue;\n this.fallbackUnsubs.set(\n key,\n sub.channel === \"arb\"\n ? this.fallback!.subscribeArb(sub.id, () => {})\n : sub.channel === \"arb-feed\"\n ? this.fallback!.subscribeArbFeed(() => {})\n : this.fallback!.subscribe(sub.id, sub.channel),\n );\n }\n }\n\n private fail = (): void => {\n if (this.stopped || this.fallback) return;\n this.releaseWorker();\n this.currentBooks.clear();\n this.latest.clear();\n this.recovering.clear();\n this.diagnosticRevisions.clear();\n this.deliveredRevisions.clear();\n this.resolvedRevisions.clear();\n this.online = false;\n this.handlers.onConnectionStateChange?.(false);\n this.fallback = new AggWebSocket({ ...this.config, callbacks: this.fallbackCallbacks() });\n for (const reject of this.historyFailures) reject(new Error(\"Market-data worker failed\"));\n this.historyFailures.clear();\n this.resolveFailure?.();\n this.syncFallback();\n };\n}\n\nexport function createWorkerWebSocket(\n options: AggWebSocketOptions,\n factory: MarketDataWorkerFactory,\n): AggWebSocket {\n // Raw trade callbacks keep the original lossless synchronous delivery contract.\n // View consumers explicitly opt into bounded presentation batches via onMarketView.\n if (options.callbacks?.onTrade && !options.callbacks.onMarketView)\n return new AggWebSocket(options);\n try {\n return new WorkerAggWebSocket(options, factory);\n } catch {\n return new AggWebSocket(options);\n }\n}\n"],"mappings":";;;AAeA,IAAa,qBAAb,cAAwC,aAAa;CAyBnD,IAAI,mBAA4B;EAC9B,OAAO,CAAC,KAAK;CACf;CAEA,YACE,QACA,SACA;EACA,MAAM,MAAM;EAHK,KAAA,SAAA;EA3BS,KAAA,oCAAA,IAAI,IAAgD;EACpD,KAAA,oBAAA;EAGL,KAAA,+BAAA,IAAI,IAA4B;EAClC,KAAA,6BAAA,IAAI,IAAY;EAC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AS;GAClB,MAAM,SAAS,KAAK,YAAY,KAAK;GACrC,IAAI,QAAQ,OAAO,OAAO,MAAM;EAClC,CAAC,CAAC,CACD,MAAM,KAAK,IAAI;CACpB;CASA,oBAAmD;EACjD,OAAO;GACL,GAAG,KAAK;GACR,cAAc,QAAQ,KAAK,MAAM,eAAe,CAAC,GAAG,CAAC;GACrD,YAAY,QAAQ,KAAK,MAAM,aAAa,CAAC,GAAG,CAAC;EACnD;CACF;CACA,eAA6B;EAC3B,KAAK,MAAM,CAAC,KAAK,gBAAgB,KAAK,gBACpC,IAAI,CAAC,KAAK,KAAK,IAAI,GAAG,GAAG;GACvB,YAAY;GACZ,KAAK,eAAe,OAAO,GAAG;EAChC;EAEF,KAAK,MAAM,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM;GACtC,IAAI,KAAK,eAAe,IAAI,GAAG,GAAG;GAClC,KAAK,eAAe,IAClB,KACA,IAAI,YAAY,QACZ,KAAK,SAAU,aAAa,IAAI,UAAU,CAAC,CAAC,IAC5C,IAAI,YAAY,aACd,KAAK,SAAU,uBAAuB,CAAC,CAAC,IACxC,KAAK,SAAU,UAAU,IAAI,IAAI,IAAI,OAAO,CACpD;EACF;CACF;AAmBF;AAEA,SAAgB,sBACd,SACA,SACc;CAGd,IAAI,QAAQ,WAAW,WAAW,CAAC,QAAQ,UAAU,cACnD,OAAO,IAAI,aAAa,OAAO;CACjC,IAAI;EACF,OAAO,IAAI,mBAAmB,SAAS,OAAO;CAChD,QAAQ;EACN,OAAO,IAAI,aAAa,OAAO;CACjC;AACF"}
|
|
1
|
+
{"version":3,"file":"browser.mjs","names":[],"sources":["../src/market-data/worker-adapter.ts"],"sourcesContent":["import { proxy, releaseProxy, wrap, type Endpoint, type Remote } from \"comlink\";\nimport {\n AggWebSocket,\n type AggWebSocketCallbacks,\n type AggWebSocketOptions,\n type AggWebSocketDiagnostics,\n} from \"../agg-websocket\";\nimport type { ChartHistoryManifest, ChartCandle, ChartBarsResponse } from \"../types\";\nimport type { OrderbookState } from \"../orderbook-utils\";\nimport type { WsArbFeedBatch, WsArbMarketUpdate } from \"../ws-types\";\nimport type { MarketDataEngine, MarketSubscription, MarketViewBatch } from \"./engine\";\n\n/** The application owns the native module Worker URL so its static bundler fingerprints it. */\nexport type MarketDataWorkerFactory = () => Worker;\n\nexport class WorkerAggWebSocket extends AggWebSocket {\n private worker: Worker | null;\n private remote: Remote<MarketDataEngine> | null;\n private endpointListeners = new Map<EventListenerOrEventListenerObject, string>();\n private historyOperations = 0;\n private hostProvider?: () => Record<string, unknown>;\n private handlers: AggWebSocketCallbacks;\n private currentBooks = new Map<string, OrderbookState>();\n private recovering = new Set<string>();\n private diagnosticRevisions = new Map<string, number>();\n private deliveredRevisions = new Map<string, number>();\n private resolvedRevisions = new Map<string, number>();\n private refs = new Map<string, { sub: MarketSubscription; count: number }>();\n private arbListeners = new Map<string, Set<(msg: WsArbMarketUpdate) => void>>();\n private feedListeners = new Set<(msg: WsArbFeedBatch) => void>();\n private latest = new Map<string, WsArbMarketUpdate>();\n private generation = 0;\n private online = false;\n private stopped = false;\n private queued = false;\n private ready: Promise<void>;\n private resolveFailure?: () => void;\n private historyFailures = new Set<(error: Error) => void>();\n private fallback: AggWebSocket | null = null;\n private fallbackUnsubs = new Map<string, () => void>();\n get processesCandles(): boolean {\n return !this.fallback;\n }\n\n constructor(\n private readonly config: AggWebSocketOptions,\n factory: MarketDataWorkerFactory,\n ) {\n super(config);\n if (config.callbacks?.onTrade && !config.callbacks.onMarketView)\n throw new Error(\n \"Raw trade callbacks require AggWebSocket; Worker views require onMarketView opt-in\",\n );\n this.handlers = config.callbacks ?? {};\n this.worker = factory();\n const worker = this.worker;\n const endpoint: Endpoint = {\n postMessage: worker.postMessage.bind(worker),\n addEventListener: (type, listener) => {\n this.endpointListeners.set(listener, type);\n worker.addEventListener(type, listener);\n },\n removeEventListener: (type, listener) => {\n this.endpointListeners.delete(listener);\n worker.removeEventListener(type, listener);\n },\n };\n this.remote = wrap<MarketDataEngine>(endpoint);\n this.worker.addEventListener(\"error\", this.fail);\n this.worker.addEventListener(\"messageerror\", this.fail);\n // Functions can't cross into the Worker; the Worker always uses its own\n // global WebSocket (browsers can't send handshake headers anyway).\n const { callbacks: _callbacks, webSocketImpl: _impl, ...options } = config;\n const startup = this.remote\n .start(\n options,\n proxy((event) => {\n if (!this.fallback) this.event(event.name, event.args, event.revision);\n }),\n )\n .then(() => {\n if (this.stopped || this.fallback || !this.remote) return;\n return this.remote.observeViews(\n proxy((batch: MarketViewBatch) => {\n if (batch.generation < this.generation || this.stopped || this.fallback) return;\n for (const view of batch.views) {\n if (\n !this.refs.has(`orderbook:${view.outcomeId}`) &&\n !this.refs.has(`trades:${view.outcomeId}`)\n )\n continue;\n if ((this.resolvedRevisions.get(view.outcomeId) ?? -1) >= view.revision) continue;\n const integrity =\n (this.diagnosticRevisions.get(view.outcomeId) ?? -1) > view.revision\n ? \"resyncing\"\n : view.integrity;\n this.deliveredRevisions.set(view.outcomeId, view.revision);\n this.handlers.onMarketView?.({ ...view, integrity });\n if (view.book) {\n this.currentBooks.set(view.outcomeId, view.book);\n if (integrity === \"ok\") {\n this.recovering.delete(view.outcomeId);\n this.diagnosticRevisions.delete(view.outcomeId);\n } else this.recovering.add(view.outcomeId);\n if (view.snapshot) this.handlers.onSnapshot?.(view.outcomeId, view.book);\n else this.handlers.onDelta?.(view.outcomeId, view.book);\n }\n for (const trade of [...view.trades].reverse()) this.handlers.onTrade?.(trade);\n }\n }),\n );\n })\n .catch(this.fail);\n const failed = new Promise<void>((resolve) => {\n this.resolveFailure = resolve;\n });\n this.ready = Promise.race([startup, failed]);\n const startupTimeout = setTimeout(this.fail, 3000);\n void this.ready.then(() => clearTimeout(startupTimeout));\n if (typeof document !== \"undefined\")\n document.addEventListener(\"visibilitychange\", this.visibility);\n }\n\n override async decodeHistory(payload: string): Promise<ChartBarsResponse> {\n this.historyOperations++;\n try {\n return await this.decodeHistoryRequest(payload);\n } finally {\n this.historyOperations--;\n }\n }\n private async decodeHistoryRequest(payload: string): Promise<ChartBarsResponse> {\n if (this.stopped) throw new Error(\"Market-data worker disposed\");\n await this.ready;\n if (this.stopped) throw new Error(\"Market-data worker disposed\");\n if (this.fallback) return this.fallback.decodeHistory(payload);\n const remote = this.remote;\n if (!remote) throw new Error(\"Market-data worker unavailable\");\n let rejectFailure!: (error: Error) => void;\n const failed = new Promise<never>((_resolve, reject) => {\n rejectFailure = reject;\n this.historyFailures.add(reject);\n });\n try {\n return await Promise.race([remote.decodeHistory(payload), failed]);\n } finally {\n this.historyFailures.delete(rejectFailure);\n }\n }\n\n private historyGeneration = 0;\n override async loadHistory(\n manifest: ChartHistoryManifest,\n options?: { signal?: AbortSignal },\n ): Promise<ChartCandle[]> {\n this.historyOperations++;\n try {\n return await this.loadHistoryRequest(manifest, options);\n } finally {\n this.historyOperations--;\n }\n }\n private async loadHistoryRequest(\n manifest: ChartHistoryManifest,\n options?: { signal?: AbortSignal },\n ): Promise<ChartCandle[]> {\n if (this.stopped) throw new Error(\"Market-data worker disposed\");\n if (this.fallback) return this.fallback.loadHistory(manifest, options);\n const generation = ++this.historyGeneration;\n const key = `${manifest.venueMarketOutcomeId}:${manifest.resolution}:${manifest.from}:${manifest.to}`;\n options?.signal?.throwIfAborted();\n await this.ready;\n if (this.stopped) throw new Error(\"Market-data worker disposed\");\n options?.signal?.throwIfAborted();\n // Startup may switch transports during the await.\n const fallbackAfterStartup = this.fallback as AggWebSocket | null;\n if (fallbackAfterStartup) return fallbackAfterStartup.loadHistory(manifest, options);\n const remote = this.remote;\n if (!remote) throw new Error(\"Market-data worker unavailable\");\n let rejectFailure!: (error: Error) => void;\n const failed = new Promise<never>((_resolve, reject) => {\n rejectFailure = reject;\n this.historyFailures.add(reject);\n });\n const abort = () => {\n void this.remote?.cancelHistoryRange(key, generation);\n };\n options?.signal?.addEventListener(\"abort\", abort, { once: true });\n try {\n const result = await Promise.race([\n remote.loadImmutableRange(key, generation, manifest),\n failed,\n ]);\n options?.signal?.throwIfAborted();\n return result;\n } finally {\n options?.signal?.removeEventListener(\"abort\", abort);\n this.historyFailures.delete(rejectFailure);\n }\n }\n override setHostDiagnostics(provider?: () => Record<string, unknown>): void {\n this.hostProvider = provider;\n }\n\n override getDiagnostics(): AggWebSocketDiagnostics {\n const subscriptions = [...this.refs.values()].map((entry) => entry.sub);\n return this.fallback\n ? {\n ...this.fallback.getDiagnostics(),\n host: this.hostProvider?.(),\n pendingHistoryRequests: this.historyOperations,\n workerAttached: false,\n bridgeListeners: this.endpointListeners.size,\n }\n : {\n connected: this.connected,\n host: this.hostProvider?.(),\n transport: this.stopped ? \"disposed\" : \"worker\",\n orderbookOutcomeIds: subscriptions\n .filter((sub) => sub.channel === \"orderbook\")\n .map((sub) => sub.id),\n tradeOutcomeIds: subscriptions\n .filter((sub) => sub.channel === \"trades\")\n .map((sub) => sub.id),\n arbMarketIds: [...this.arbListeners.keys()],\n arbFeedSubscribers: this.feedListeners.size,\n cachedBooks: this.currentBooks.size,\n cachedArb: this.latest.size,\n resyncingBooks: this.recovering.size,\n pendingResnapshots: 0,\n pendingHistoryRequests: this.historyOperations,\n workerAttached: this.worker !== null,\n bridgeListeners: this.endpointListeners.size,\n };\n }\n async getWorkerDiagnostics(): Promise<ReturnType<MarketDataEngine[\"getMeasurements\"]> | null> {\n await this.ready;\n const remote = this.remote;\n if (this.stopped || !remote || this.fallback) return null;\n let rejectFailure!: (error: Error) => void;\n const failed = new Promise<never>((_resolve, reject) => {\n rejectFailure = reject;\n this.historyFailures.add(reject);\n });\n try {\n return await Promise.race([remote.getMeasurements(), failed]);\n } catch {\n return null;\n } finally {\n this.historyFailures.delete(rejectFailure);\n }\n }\n\n override get connected(): boolean {\n return !this.stopped && (this.fallback?.connected ?? this.online);\n }\n override getBook(id: string): OrderbookState | null {\n return this.fallback?.getBook(id) ?? this.currentBooks.get(id) ?? null;\n }\n override isResyncing(id: string): boolean {\n return this.fallback?.isResyncing(id) ?? this.recovering.has(id);\n }\n override getArb(id: string): WsArbMarketUpdate | null {\n return this.fallback?.getArb(id) ?? this.latest.get(id) ?? null;\n }\n override subscribe(id: string, channel: \"orderbook\" | \"trades\" = \"orderbook\"): () => void {\n return this.ref({ id, channel });\n }\n override subscribeTrades(id: string): () => void {\n return this.subscribe(id, \"trades\");\n }\n override subscribeArb(id: string, cb: (msg: WsArbMarketUpdate) => void): () => void {\n const listeners = this.arbListeners.get(id) ?? new Set();\n listeners.add(cb);\n this.arbListeners.set(id, listeners);\n const unsubscribe = this.ref({ id, channel: \"arb\" });\n return () => {\n unsubscribe();\n listeners.delete(cb);\n if (!listeners.size) this.arbListeners.delete(id);\n };\n }\n override subscribeArbFeed(cb: (msg: WsArbFeedBatch) => void): () => void {\n this.feedListeners.add(cb);\n const unsubscribe = this.ref({ id: \"*\", channel: \"arb-feed\" });\n return () => {\n unsubscribe();\n this.feedListeners.delete(cb);\n };\n }\n override setCallbacks(callbacks: AggWebSocketCallbacks): void {\n this.handlers = callbacks;\n if (callbacks.onTrade && !callbacks.onMarketView && !this.fallback) this.fail();\n this.fallback?.setCallbacks(this.fallbackCallbacks());\n }\n override authenticate(token: string): void {\n this.config.initialToken = token;\n this.run((engine) => engine.authenticate(token));\n }\n override connect(): void {\n this.run((engine) => engine.connect());\n }\n override disconnect(): void {\n this.run((engine) => engine.disconnect());\n }\n override resnapshot(id: string | string[]): void {\n const ids = Array.isArray(id) ? id : [id];\n this.run((engine) => engine.resnapshot(ids));\n }\n override destroy(): void {\n if (this.stopped) return;\n this.stopped = true;\n this.online = false;\n this.resolveFailure?.();\n for (const reject of this.historyFailures) reject(new Error(\"Market-data worker disposed\"));\n this.historyFailures.clear();\n this.refs.clear();\n this.currentBooks.clear();\n this.latest.clear();\n this.arbListeners.clear();\n this.feedListeners.clear();\n this.recovering.clear();\n this.diagnosticRevisions.clear();\n this.deliveredRevisions.clear();\n this.resolvedRevisions.clear();\n this.fallback?.destroy();\n this.fallbackUnsubs.clear();\n this.hostProvider = undefined;\n this.handlers = {};\n if (typeof document !== \"undefined\")\n document.removeEventListener(\"visibilitychange\", this.visibility);\n this.releaseWorker();\n }\n private releaseWorker(): void {\n const worker = this.worker;\n const remote = this.remote;\n this.remote = null;\n this.worker = null;\n if (remote) remote[releaseProxy]();\n if (!worker) return;\n for (const [listener, type] of this.endpointListeners)\n worker.removeEventListener(type, listener);\n this.endpointListeners.clear();\n worker.removeEventListener(\"error\", this.fail);\n worker.removeEventListener(\"messageerror\", this.fail);\n worker.terminate();\n }\n\n private event(name: keyof AggWebSocketCallbacks, args: unknown[], revision = 0): void {\n if (this.stopped) return;\n if (name === \"onConnectionStateChange\") this.online = args[0] as boolean;\n if (name === \"onDiagnostics\") {\n const diagnostic = args[0] as { type: string; outcomeId?: string };\n if (\n diagnostic.outcomeId &&\n revision < (this.deliveredRevisions.get(diagnostic.outcomeId) ?? -1)\n )\n return;\n if (\n diagnostic.outcomeId &&\n (this.refs.has(`orderbook:${diagnostic.outcomeId}`) ||\n this.refs.has(`trades:${diagnostic.outcomeId}`)) &&\n [\"seq_gap\", \"checksum_mismatch\"].includes(diagnostic.type)\n ) {\n this.recovering.add(diagnostic.outcomeId);\n this.diagnosticRevisions.set(diagnostic.outcomeId, revision);\n }\n }\n if (name === \"onMarketResolved\") {\n const id = (args[0] as { outcomeId: string }).outcomeId;\n if (this.refs.has(`orderbook:${id}`) || this.refs.has(`trades:${id}`))\n this.resolvedRevisions.set(id, revision);\n this.currentBooks.delete(id);\n }\n if (name === \"onArbMarket\") {\n const msg = args[0] as WsArbMarketUpdate;\n this.latest.set(msg.marketId, msg);\n for (const cb of this.arbListeners.get(msg.marketId) ?? []) cb(msg);\n }\n if (name === \"onArbFeed\") for (const cb of this.feedListeners) cb(args[0] as WsArbFeedBatch);\n (this.handlers[name] as ((...args: unknown[]) => void) | undefined)?.(...args);\n }\n private ref(sub: MarketSubscription): () => void {\n const key = `${sub.channel}:${sub.id}`;\n const entry = this.refs.get(key) ?? { sub, count: 0 };\n entry.count++;\n this.refs.set(key, entry);\n this.sync();\n let released = false;\n return () => {\n if (released) return;\n released = true;\n if (--entry.count === 0) {\n this.refs.delete(key);\n if (sub.channel === \"orderbook\") this.recovering.delete(sub.id);\n if (!this.refs.has(`orderbook:${sub.id}`) && !this.refs.has(`trades:${sub.id}`)) {\n this.currentBooks.delete(sub.id);\n this.recovering.delete(sub.id);\n this.diagnosticRevisions.delete(sub.id);\n this.deliveredRevisions.delete(sub.id);\n this.resolvedRevisions.delete(sub.id);\n }\n }\n this.sync();\n };\n }\n private sync(): void {\n if (this.queued || this.stopped) return;\n this.queued = true;\n queueMicrotask(() => {\n this.queued = false;\n if (this.stopped) return;\n if (this.fallback) {\n this.syncFallback();\n return;\n }\n const generation = ++this.generation;\n const subscriptions = [...this.refs.values()].map((entry) => entry.sub);\n void this.ready\n .then(() => {\n if (!this.stopped && !this.fallback)\n return this.remote?.setSubscriptions(subscriptions, generation);\n })\n .catch(this.fail);\n });\n }\n private run(action: (engine: Remote<MarketDataEngine> | AggWebSocket) => unknown): void {\n if (this.stopped) return;\n if (this.fallback) {\n action(this.fallback);\n return;\n }\n void this.ready\n .then(() => {\n if (this.stopped) return;\n const engine = this.fallback ?? this.remote;\n if (engine) return action(engine);\n })\n .catch(this.fail);\n }\n private visibility = (): void => {\n if (document.visibilityState === \"visible\")\n this.resnapshot(\n [...this.refs.values()]\n .filter((entry) => entry.sub.channel === \"orderbook\")\n .map((entry) => entry.sub.id),\n );\n };\n private fallbackCallbacks(): AggWebSocketCallbacks {\n return {\n ...this.handlers,\n onArbMarket: (msg) => this.event(\"onArbMarket\", [msg]),\n onArbFeed: (msg) => this.event(\"onArbFeed\", [msg]),\n };\n }\n private syncFallback(): void {\n for (const [key, unsubscribe] of this.fallbackUnsubs) {\n if (!this.refs.has(key)) {\n unsubscribe();\n this.fallbackUnsubs.delete(key);\n }\n }\n for (const [key, { sub }] of this.refs) {\n if (this.fallbackUnsubs.has(key)) continue;\n this.fallbackUnsubs.set(\n key,\n sub.channel === \"arb\"\n ? this.fallback!.subscribeArb(sub.id, () => {})\n : sub.channel === \"arb-feed\"\n ? this.fallback!.subscribeArbFeed(() => {})\n : this.fallback!.subscribe(sub.id, sub.channel),\n );\n }\n }\n\n private fail = (): void => {\n if (this.stopped || this.fallback) return;\n this.releaseWorker();\n this.currentBooks.clear();\n this.latest.clear();\n this.recovering.clear();\n this.diagnosticRevisions.clear();\n this.deliveredRevisions.clear();\n this.resolvedRevisions.clear();\n this.online = false;\n this.handlers.onConnectionStateChange?.(false);\n if (this.config.orderbookUrl) this.handlers.onOrderbookConnectionStateChange?.(false);\n this.fallback = new AggWebSocket({ ...this.config, callbacks: this.fallbackCallbacks() });\n for (const reject of this.historyFailures) reject(new Error(\"Market-data worker failed\"));\n this.historyFailures.clear();\n this.resolveFailure?.();\n this.syncFallback();\n };\n}\n\nexport function createWorkerWebSocket(\n options: AggWebSocketOptions,\n factory: MarketDataWorkerFactory,\n): AggWebSocket {\n // Raw trade callbacks keep the original lossless synchronous delivery contract.\n // View consumers explicitly opt into bounded presentation batches via onMarketView.\n if (options.callbacks?.onTrade && !options.callbacks.onMarketView)\n return new AggWebSocket(options);\n try {\n return new WorkerAggWebSocket(options, factory);\n } catch {\n return new AggWebSocket(options);\n }\n}\n"],"mappings":";;;AAeA,IAAa,qBAAb,cAAwC,aAAa;CAyBnD,IAAI,mBAA4B;EAC9B,OAAO,CAAC,KAAK;CACf;CAEA,YACE,QACA,SACA;EACA,MAAM,MAAM;EAHK,KAAA,SAAA;EA3BS,KAAA,oCAAA,IAAI,IAAgD;EACpD,KAAA,oBAAA;EAGL,KAAA,+BAAA,IAAI,IAA4B;EAClC,KAAA,6BAAA,IAAI,IAAY;EACP,KAAA,sCAAA,IAAI,IAAoB;EACzB,KAAA,qCAAA,IAAI,IAAoB;EACzB,KAAA,oCAAA,IAAI,IAAoB;EACrC,KAAA,uBAAA,IAAI,IAAwD;EACpD,KAAA,+BAAA,IAAI,IAAmD;EACtD,KAAA,gCAAA,IAAI,IAAmC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mD;EACjD,OAAO;GACL,GAAG,KAAK;GACR,cAAc,QAAQ,KAAK,MAAM,eAAe,CAAC,GAAG,CAAC;GACrD,YAAY,QAAQ,KAAK,MAAM,aAAa,CAAC,GAAG,CAAC;EACnD;CACF;CACA,eAA6B;EAC3B,KAAK,MAAM,CAAC,KAAK,gBAAgB,KAAK,gBACpC,IAAI,CAAC,KAAK,KAAK,IAAI,GAAG,GAAG;GACvB,YAAY;GACZ,KAAK,eAAe,OAAO,GAAG;EAChC;EAEF,KAAK,MAAM,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM;GACtC,IAAI,KAAK,eAAe,IAAI,GAAG,GAAG;GAClC,KAAK,eAAe,IAClB,KACA,IAAI,YAAY,QACZ,KAAK,SAAU,aAAa,IAAI,UAAU,CAAC,CAAC,IAC5C,IAAI,YAAY,aACd,KAAK,SAAU,uBAAuB,CAAC,CAAC,IACxC,KAAK,SAAU,UAAU,IAAI,IAAI,IAAI,OAAO,CACpD;EACF;CACF;AAoBF;AAEA,SAAgB,sBACd,SACA,SACc;CAGd,IAAI,QAAQ,WAAW,WAAW,CAAC,QAAQ,UAAU,cACnD,OAAO,IAAI,aAAa,OAAO;CACjC,IAAI;EACF,OAAO,IAAI,mBAAmB,SAAS,OAAO;CAChD,QAAQ;EACN,OAAO,IAAI,aAAa,OAAO;CACjC;AACF"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as AggAuthStartBody, $a as WsOrderbookDelta, $i as VenueSoloQuote, $n as OrderbookQuoteParams, $o as HostedVenueActivityQuery, $r as RequestedOrderbookMarket, $s as SetupVenueKeyStep, $t as DepositAddressesToken, A as TurnstileChallengeError, Aa as DiagnosticCallback, Ac as TimeInForce, Ai as SportsLiveState, An as MarkSource, Ao as optimizedImageUrl, Ar as RecurrenceFilter, As as HelloResponse, At as ChartResolution, B as userSignerAddresses, Ba as WsBalanceUpdate, Bc as ImageSize, Bi as UserActivityRedeem, Bn as NewsFeedMarketFeedResponse, Bo as isFiniteNonNeg, Br as RecurringCryptoOutcomeOrderbookDepth, Bs as OrderbookHistoryPoint, Bt as CreateBalanceRefillPolicyParams, C as Candle, Ca as CatalogChangeOp, Cc as WalletChainBalance, Ci as SmartRouteSetupCostLine, Cn as LeaderboardSeriesPoint, Co as LimitPriceTickAdjustment, Cr as PositionRedeemStatus, Cs as ExecuteTradeResponse, Ct as CancelManagedExecutionResponse, D as AggApiErrorInit, Da as CatalogFilter, Dc as WithdrawalSourceItem, Di as SportsGameStatus, Dn as ListRecurringCryptoMarketsOptions, Do as sortVenues, Dr as RampSessionRequest, Ds as GetHoldingsResponse, Dt as ChartBarsResponse, E as AggApiError, Ea as CatalogEventSnapshot, Ec as WithdrawalSource, Ei as SmartRouteVenueFill, En as LimitOrderTimeInForce, Eo as buildVenueUrl, Er as RampQuoteRequest, Es as GetHoldingsQuery, Et as ChartBarsMeta, F as isPolymarketOrderSignatureStep, Fa as WsArbMarketUpdate, Fc as MatchType, Fi as UpdateBalanceRefillPolicyParams, Fn as NewsFeedArticleWithSummary, Fo as SafeParseSuccess, Fr as RecurringCryptoMarketMetrics, Fs as MidpointItem, Ft as CorrelatedMarketSide, G as applyOrderbookDelta, Ga as WsError, Gc as VENUE_CHAIN_IDS, Gi as UserActivityWithdrawal, Gn as NewsFeedStatusResponse, Go as safeParse, Gr as RecurringCryptoVenueMarket, Gs as PriceSource, Gt as CryptoReferencePriceResult, H as OrderbookLevel, Ha as WsCatalogChange, Hc as ACTIVE_VENUES, Hi as UserActivityTrade, Hn as NewsFeedMarketNewsResponse, Ho as parse, Hr as RecurringCryptoReferencePrice, Hs as OutcomeMidpoint, Ht as CryptoReferencePriceError, I as isPostFillFeeRequest, Ia as WsAttributedLevel, Ic as Chain, Ii as UserActivityBridge, In as NewsFeedLinkedMarket, Io as enumGuard, Ir as RecurringCryptoMarketsResponse, Is as NonceResponse, It as CorrelatedMarketSignal, J as computeBestSplitsByAmount, Ja as WsMarkSource, Jc as isVenueActive, Ji as VenueGeoPolicyEntry, Jn as OrderListQuery, Jo as formatOutcomeLabel, Jr as RedeemLegResult, Js as ServerWallet, Jt as CryptoReferencePricesResponse, K as computeChecksum, Ka as WsErrorCode, Kc as Venue, Ki as ValidateManagedParams, Kn as OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS, Ko as getWalletAddressFromUserProfile, Kr as RecurringCryptoWindowComparisons, Ks as PricesHistoryResponse, Kt as CryptoReferencePriceSource, L as isSameWalletAddress, La as WsAuthExpired, Lc as AccountProvider, Li as UserActivityDeposit, Ln as NewsFeedListResponse, Lo as hasShape, Lr as RecurringCryptoOrderbookDepthLevel, Ls as NovigExecutionMode, Lt as CorrelatedMarketSignalBatch, M as areOrdersFilled, Ma as WsAppEvent, Mc as CONFIRMED_MATCH_STATUSES, Mi as TERMINAL_EXECUTION_STATES, Mn as MidpointRow, Mo as SplitsByAmountResult, Mr as RecurringCryptoComparisonPriceSource, Ms as MatchedMidpoint, Mt as CorrelatedMarketCascadeItem, N as isOptionalFeeRequest, Na as WsArbFeedBatch, Nc as MarketStatus, Ni as TradeExecutorOrder, Nn as NewsFeedArticleFeedItem, No as SafeParseFailure, Nr as RecurringCryptoDuration, Ns as MatchedMidpointOutcome, Nt as CorrelatedMarketCascadeResponse, O as AggApiFieldError, Oa as CatalogMarketSnapshot, Oc as OrderStatus, Oi as SportsLiveParticipant, On as ManagedBalancesParams, Oo as VenueMarketClusterNode, Or as RampWidgetSession, Os as GetOrdersQuery, Ot as ChartCandle, P as isOrderSignatureStep, Pa as WsArbFeedEntry, Pc as MatchStatus, Pi as TradeExecutorOrderListResponse, Pn as NewsFeedArticleFeedResponse, Po as SafeParseResult, Pr as RecurringCryptoDurationInput, Ps as MatchedVenueMarketOutcomeRef, Pt as CorrelatedMarketQueryResult, Q as AggAuthProviderType, Qa as WsOrderSubmitted, Qi as VenuePriceInfo, Qn as OrderbookQuoteFill, Qo as HostedVenueActivityCode, Qr as RedeemSelfCustodyParams, Qs as SetupDepositAddressStep, Qt as DepositAddressesSupportedChain, R as orderSignatureRound, Ra as WsAuthExpiring, Rc as AccountType, Ri as UserActivityItem, Rn as NewsFeedMarketFeedArticle, Ro as isEmail, Rr as RecurringCryptoOrderbookDepthSide, Rs as OrderListItem, Rt as CorrelatedMarketSignalDirection, S as toChecksumAddress, Sa as CatalogChange, Sc as VerifyResponse, Si as SmartRouteSettlementPlan, Sn as LeaderboardSeries, So as LimitPriceSide, Sr as PlacePaperTradingOrderParams, Ss as ExecuteTradeRequest, St as BatchOrderbooksResponse, T as CandleInterval, Ta as CatalogEntity, Tc as WithdrawManagedRequest, Ti as SmartRouteStatus, Tn as LeaderboardStats, To as BuildVenueUrlOpts, Tr as RampQuote, Ts as GetBalanceResponse, Tt as CancelVenueOrderParams, U as OrderbookState, Ua as WsClientMessage, Uc as INACTIVE_VENUES, Ui as UserActivityType, Un as NewsFeedMarketNewsResult, Uo as parseEmail, Ur as RecurringCryptoResolution, Us as PositionGroup, Ut as CryptoReferencePriceExternalMarketInput, V as withTimeout, Va as WsCandleInterval, Vc as RETINA_IMAGE_SIZES, Vi as UserActivityRedeemLeg, Vn as NewsFeedMarketNewsParams, Vo as isNonEmptyString, Vr as RecurringCryptoPriceComparison, Vs as OrderbookHistoryResponse, Vt as CreatePaperTradingAccountParams, W as VenueOrderbookLevel, Wa as WsConnected, Wc as VENUES, Wi as UserActivityUserOp, Wn as NewsFeedPageOptions, Wo as parseEmailStrict, Wr as RecurringCryptoSourceConfidence, Ws as PricePoint, Wt as CryptoReferencePriceMarketInput, X as AggAuthDeliveryMode, Xa as WsOrderEvent, Xc as isVenueInactive, Xi as VenueMarketRef, Xn as OrderbookBatchItemErrorCode, Xo as HostedVenueAccount, Xr as RedeemRequest, Xs as SettlementDifference, Xt as DepositAddressesReadyResponse, Y as AggClient, Ya as WsMarketResolved, Yc as isVenueDataVisible, Yi as VenueGeoPolicyResponse, Yn as OrderbookBatchItemError, Yo as formatOutcomeTitle, Yr as RedeemLegStatus, Ys as SettlementDiff, Yt as DepositAddressesPendingResponse, Z as AggAuthPrivyVerifyBody, Za as WsOrderEventType, Zi as VenueOrderbookEntry, Zn as OrderbookBatchItemStatus, Zo as HostedVenueActivity, Zr as RedeemResponse, Zs as SettlementSource, Zt as DepositAddressesResponse, _ as LoadImmutableHistoryOptions, _a as CatalogWatchHandle, _c as VenueMarket, _i as SmartRouteFeeBreakdown, _n as GetOrdersParams, _o as DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, _r as PaperTradingPosition, _s as ComputeSplitsResponse, _t as BalanceRefillAttempt, a as BookWatchdogOptions, aa as WithdrawTokenSymbol, ac as UpsertVenueKey, ai as SELF_CUSTODY_FILL_TIMEOUT_MS, an as ExecutionDisplayStepKind, ao as WsSubscribed, ar as PaginatedResponse, as as QuoteError, at as AggClientSessionInput, b as mergeCandles, ba as isCatalogResyncRequired, bc as VenuePositionBalance, bi as SmartRouteResponse, bn as LeaderboardQuery, bo as isBalanceRefillWithinDailyCap, br as PlaceLimitOrderParams, bs as DepositStep, bt as BalanceRefillPolicyStatus, c as HistoryRangeRequest, ca as WithdrawalLegStatus, cc as ValidateBalanceOnClientStep, ci as SearchResponse, cn as ExecutionOrdersQuery, co as WsVenueBook, cr as PaperTradingAppOptions, cs as App, ct as AggLinkAccountResult, d as MarketViewBatch, da as WithdrawalQuoteParams, dc as ValidateTradeResponse, di as SignatureRequestType, dn as ExecutionPositionsQuery, do as WsWithdrawalLegStatus, dr as PaperTradingLiquidityStatus, ds as AuthCodeResponse, dt as AggregatedOrderbookLevel, ea as WithdrawManagedParams, ec as SyncBalancesResponse, ei as ResetPaperTradingAccountParams, en as EventBootstrapResponse, eo as WsOrderbookSnapshot, er as OrderbookQuoteResponse, es as HostedVenueBalance, et as AggAuthStartResult, f as createAggClient, fa as WithdrawalQuoteResponse, fc as VenueEvent, fi as SignerFn, fn as ExecutionStatusOrder, fo as WsWithdrawalLifecycleEvent, fr as PaperTradingListParams, fs as AuthTokenResponse, ft as AggregatedOrderbookResponse, g as prepareHostedVenueRoute, ga as CatalogChangesPage, gc as VenueKeySummary, gi as SmartRouteCustodyWarning, gn as GetCryptoReferencePricesOptions, go as projectedOrderbookChecksum, gr as PaperTradingPortfolio, gs as ComputeSplitsRequest, gt as BalanceCustody, h as prepareHostedVenueFunding, ha as CATALOG_DEFAULT_OVERLAP_MS, hc as VenueKeyStatus, hi as SmartRouteBridgeStep, hn as ExecutionStatusStep, ho as orderbookCrc32, hr as PaperTradingOrdersPage, hs as Category, ht as AuthStatus, i as AggWebSocketOptions, ia as WithdrawPreviewResponse, ic as UpdateUserBody, ii as RpcTokenResponse, in as ExecutionDisplayGroupStatus, io as WsStreamInterrupted, ir as OutcomeOrderbookResponse, is as ProvisionHostedVenueAccountBody, it as AggClientOptions, j as isAggApiError, ja as DiagnosticEvent, jc as TradeSide, ji as SubmitSignature, jn as MatchedOrderbookMarket, jo as retinaImageUrl, jr as RecurringCryptoComparisonPoint, js as MarketPriceHistory, jt as ChartVenueCandles, k as AggRateLimitResponse, ka as CatalogOutcomeRef, kc as OrderType, ki as SportsLiveResponse, kn as ManagedBalancesResponse, ko as normalizeVenueMarketCluster, kr as RecurrenceCadence, ks as GetPositionsQuery, kt as ChartHistoryManifest, la as WithdrawalLegType, lc as ValidateManagedRequest, li as SetPaperTradingBalanceParams, ln as ExecutionOverallState, lo as WsVenueInfo, lr as PaperTradingBalanceAdjustment, ls as AttributedOrderbook, lt as AggLinkAccountWalletConfirmBody, m as HostedVenueFundingOptions, ma as WithdrawalSourceTokenSymbol, mc as VenueEventWithMarkets, mi as SmartRouteAllocation, mn as ExecutionStatusResponse, mo as WsWithdrawalLifecycleStatus, mr as PaperTradingOrder, ms as BookQuality, mt as AppTradingMode, n as AggWebSocketCallbacks, na as WithdrawManagedSourceItem, nc as TradeStep, ni as ResolveCorrelatedMarketsResponse, nn as ExecuteManagedResponse, no as WsResumed, nr as OrderbooksOnlyError, ns as HostedVenueWithdrawal, nt as AggAuthWalletVerifyBody, o as CatalogSubscribeOptions, oa as WithdrawalExpected, oc as UserHolding, oi as SELF_CUSTODY_POLL_INTERVAL_MS, on as ExecutionMode, oo as WsTrade, or as PaperTradingAccount, os as QuoteErrorCode, ot as AggLinkAccountBody, p as HostedVenueFundingIntent, pa as WithdrawalSourceStatus, pc as VenueEventListItem, pi as SimpleOrderbookLevel, pn as ExecutionStatusQuery, po as WsWithdrawalLifecycleLeg, pr as PaperTradingMarkSource, ps as AuthUser, pt as AppClientConfigResponse, q as snapshotToOrderbook, qa as WsHeartbeat, qc as getEffectiveDisabledVenues, qi as ValidateManagedResponse, qn as OPTIONAL_SIGNATURE_TIMEOUT_MS, qo as formatMarketQuestion, qr as RecurringCryptoWindowMarket, qs as ProphetxExecutionMode, qt as CryptoReferencePriceTarget, r as AggWebSocketDiagnostics, ra as WithdrawPreviewParams, rc as UnifiedBalanceResponse, ri as ResolvedCorrelatedMarketsResponse, rn as ExecutionDagProgress, ro as WsServerMessage, rr as OutcomeMidpointRow, rs as HostedVenueWithdrawalRequest, rt as AggClientAuthOptions, s as CandleTail, sa as WithdrawalLeg, sc as UserProfile, si as SearchParams, sn as ExecutionOrderItem, so as WsUnsubscribed, sr as PaperTradingAccountsPage, ss as Account, st as AggLinkAccountConfirmResult, t as AggWebSocket, ta as WithdrawManagedResponse, tc as TradeSplit, ti as ResolveCorrelatedMarketsParams, tn as ExecuteManagedParams, to as WsRedeemEvent, tr as OrderbookServiceUnavailableError, ts as HostedVenueDepositAddress, tt as AggAuthVerifyBody, u as MarketView, ua as WithdrawalLifecycleStatus, uc as ValidateTradeRequest, ui as SignatureRequest, un as ExecutionPositionGroup, uo as WsVenueLevel, ur as PaperTradingBalanceResponse, us as AttributedOrderbookLevel, ut as AggSessionUser, v as loadImmutableHistory, va as GetCatalogChangesParams, vc as VenueMarketListItem, vi as SmartRouteFill, vn as GetPositionsParams, vo as DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, vr as PaperTradingPositionsPage, vs as ComputeSplitsSelection, vt as BalanceRefillAttemptStatus, w as CandleBuilder, wa as CatalogClusterFields, wc as WalletTokenBalance, wi as SmartRouteSide, wn as LeaderboardSeriesQuery, wo as adjustLimitPriceRawToTick, wr as RECURRENCE_CADENCES, ws as GetBalanceQuery, wt as CancelOrderSignature, x as mergeClosedCandles, xa as CatalogCategoryRef, xc as VerifyBody, xi as SmartRouteSettlementLeg, xn as LeaderboardRow, xo as LIMIT_PRICE_RAW_SCALE, xr as PlaceLimitOrderResponse, xs as ExecuteManagedRequest, xt as BatchMidpointsResponse, y as aggregateMidpoint, ya as WatchCatalogOptions, yc as VenueMarketOutcome, yi as SmartRouteParams, yn as LeaderboardMetric, yo as getBalanceRefillMaximumRaw, yr as PersistedAuthSnapshot, ys as CreateApp, yt as BalanceRefillPolicy, z as signatureTimeoutMs, za as WsAuthenticated, zc as IMAGE_SIZES, zi as UserActivityQuery, zn as NewsFeedMarketFeedItem, zo as isEnum, zr as RecurringCryptoOutcome, zs as Orderbook, zt as CorrelatedMarketsStatus } from "./agg-websocket-CsURzWkQ.mjs";
|
|
2
|
-
export { ACTIVE_VENUES, Account, AccountProvider, AccountType, AggApiError, type AggApiErrorInit, type AggApiFieldError, type AggAuthDeliveryMode, type AggAuthPrivyVerifyBody, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, type AggAuthWalletVerifyBody, AggClient, type AggClientAuthOptions, type AggClientOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggLinkAccountWalletConfirmBody, type AggRateLimitResponse, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketDiagnostics, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, App, type AppClientConfigResponse, type AppTradingMode, AttributedOrderbook, AttributedOrderbookLevel, AuthCodeResponse, type AuthStatus, AuthTokenResponse, AuthUser, type BalanceCustody, type BalanceRefillAttempt, type BalanceRefillAttemptStatus, type BalanceRefillPolicy, type BalanceRefillPolicyStatus, type BatchMidpointsResponse, type BatchOrderbooksResponse, BookQuality, type BookWatchdogOptions, type BuildVenueUrlOpts, CATALOG_DEFAULT_OVERLAP_MS, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type CancelOrderSignature, type CancelVenueOrderParams, type Candle, CandleBuilder, type CandleInterval, type CandleTail, type CatalogCategoryRef, type CatalogChange, type CatalogChangeOp, type CatalogChangesPage, type CatalogClusterFields, type CatalogEntity, type CatalogEventSnapshot, type CatalogFilter, type CatalogMarketSnapshot, type CatalogOutcomeRef, type CatalogSubscribeOptions, type CatalogWatchHandle, Category, Chain, type ChartBarsMeta, type ChartBarsResponse, type ChartCandle, type ChartHistoryManifest, type ChartResolution, type ChartVenueCandles, ComputeSplitsRequest, ComputeSplitsResponse, ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, CreateApp, type CreateBalanceRefillPolicyParams, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, DepositAddressesPendingResponse, DepositAddressesReadyResponse, type DepositAddressesResponse, DepositAddressesSupportedChain, type DepositAddressesToken, DepositStep, type DiagnosticCallback, type DiagnosticEvent, type EventBootstrapResponse, type ExecuteManagedParams, ExecuteManagedRequest, ExecuteManagedResponse, ExecuteTradeRequest, ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionDisplayGroupStatus, type ExecutionDisplayStepKind, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, GetBalanceQuery, GetBalanceResponse, type GetCatalogChangesParams, type GetCryptoReferencePricesOptions, GetHoldingsQuery, GetHoldingsResponse, type GetOrdersParams, GetOrdersQuery, type GetPositionsParams, GetPositionsQuery, HelloResponse, type HistoryRangeRequest, type HostedVenueAccount, type HostedVenueActivity, type HostedVenueActivityCode, type HostedVenueActivityQuery, type HostedVenueBalance, type HostedVenueDepositAddress, type HostedVenueFundingIntent, type HostedVenueFundingOptions, type HostedVenueWithdrawal, type HostedVenueWithdrawalRequest, IMAGE_SIZES, INACTIVE_VENUES, ImageSize, LIMIT_PRICE_RAW_SCALE, type LeaderboardMetric, type LeaderboardQuery, type LeaderboardRow, type LeaderboardSeries, type LeaderboardSeriesPoint, type LeaderboardSeriesQuery, type LeaderboardStats, type LimitOrderTimeInForce, type LimitPriceSide, type LimitPriceTickAdjustment, type ListRecurringCryptoMarketsOptions, type LoadImmutableHistoryOptions, type ManagedBalancesParams, type ManagedBalancesResponse, type MarkSource, MarketPriceHistory, MarketStatus, type MarketView, type MarketViewBatch, MatchStatus, MatchType, MatchedMidpoint, MatchedMidpointOutcome, type MatchedOrderbookMarket, MatchedVenueMarketOutcomeRef, MidpointItem, type MidpointRow, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, NonceResponse, NovigExecutionMode, OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS, OPTIONAL_SIGNATURE_TIMEOUT_MS, OrderListItem, type OrderListQuery, OrderStatus, OrderType, Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, OrderbookHistoryPoint, OrderbookHistoryResponse, OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlaceLimitOrderParams, type PlaceLimitOrderResponse, type PlacePaperTradingOrderParams, PositionGroup, type PositionRedeemStatus, PricePoint, PriceSource, PricesHistoryResponse, ProphetxExecutionMode, type ProvisionHostedVenueAccountBody, type QuoteError, type QuoteErrorCode, RECURRENCE_CADENCES, RETINA_IMAGE_SIZES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOrderbookDepthLevel, type RecurringCryptoOrderbookDepthSide, type RecurringCryptoOutcome, type RecurringCryptoOutcomeOrderbookDepth, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RedeemSelfCustodyParams, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type RpcTokenResponse, SELF_CUSTODY_FILL_TIMEOUT_MS, SELF_CUSTODY_POLL_INTERVAL_MS, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type SearchParams, type SearchResponse, ServerWallet, type SetPaperTradingBalanceParams, SettlementDiff, SettlementDifference, SettlementSource, SetupDepositAddressStep, SetupVenueKeyStep, type SignatureRequest, type SignatureRequestType, type SignerFn, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteCustodyWarning, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSettlementLeg, type SmartRouteSettlementPlan, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SportsGameStatus, type SportsLiveParticipant, type SportsLiveResponse, type SportsLiveState, type SubmitSignature, SyncBalancesResponse, TERMINAL_EXECUTION_STATES, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide, TradeSplit, TradeStep, TurnstileChallengeError, UnifiedBalanceResponse, type UpdateBalanceRefillPolicyParams, UpdateUserBody, UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, UserHolding, UserProfile, VENUES, VENUE_CHAIN_IDS, ValidateBalanceOnClientStep, type ValidateManagedParams, ValidateManagedRequest, ValidateManagedResponse, ValidateTradeRequest, ValidateTradeResponse, Venue, VenueEvent, VenueEventListItem, VenueEventWithMarkets, type VenueGeoPolicyEntry, type VenueGeoPolicyResponse, VenueKeyStatus, VenueKeySummary, VenueMarket, type VenueMarketClusterNode, VenueMarketListItem, VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, VerifyBody, VerifyResponse, WalletChainBalance, WalletTokenBalance, type WatchCatalogOptions, type WithdrawManagedParams, WithdrawManagedRequest, WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, WithdrawTokenSymbol, WithdrawalExpected, WithdrawalLeg, WithdrawalLegStatus, WithdrawalLegType, WithdrawalLifecycleStatus, type WithdrawalQuoteParams, type WithdrawalQuoteResponse, WithdrawalSource, WithdrawalSourceItem, WithdrawalSourceStatus, WithdrawalSourceTokenSymbol, type WsAppEvent, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthExpired, type WsAuthExpiring, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsCatalogChange, type WsClientMessage, type WsConnected, type WsError, type WsErrorCode, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsResumed, type WsServerMessage, type WsStreamInterrupted, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, adjustLimitPriceRawToTick, aggregateMidpoint, applyOrderbookDelta, areOrdersFilled, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getBalanceRefillMaximumRaw, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isAggApiError, isBalanceRefillWithinDailyCap, isCatalogResyncRequired, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isOptionalFeeRequest, isOrderSignatureStep, isPolymarketOrderSignatureStep, isPostFillFeeRequest, isSameWalletAddress, isVenueActive, isVenueDataVisible, isVenueInactive, loadImmutableHistory, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, orderSignatureRound, orderbookCrc32, parse, parseEmail, parseEmailStrict, prepareHostedVenueFunding, prepareHostedVenueRoute, projectedOrderbookChecksum, retinaImageUrl, safeParse, signatureTimeoutMs, snapshotToOrderbook, sortVenues, toChecksumAddress, userSignerAddresses, withTimeout };
|
|
1
|
+
import { $ as AggClient, $a as WsMarketResolved, $c as isVenueDataVisible, $i as VenueGeoPolicyResponse, $n as OrderbookBatchItemError, $o as formatOutcomeTitle, $r as RedeemLegStatus, $s as SettlementDiff, $t as DepositAddressesPendingResponse, A as AggApiError, Aa as CatalogEventSnapshot, Ac as WithdrawalSource, Ai as SmartRouteVenueFill, An as LimitOrderTimeInForce, Ao as buildVenueUrl, Ar as RampQuoteRequest, As as GetHoldingsQuery, At as ChartBarsMeta, B as isPostFillFeeRequest, Ba as WsAttributedLevel, Bc as Chain, Bi as UserActivityBridge, Bn as NewsFeedLinkedMarket, Bo as enumGuard, Br as RecurringCryptoMarketsResponse, Bs as NonceResponse, Bt as CorrelatedMarketSignal, C as aggregateMidpoint, Ca as WatchCatalogOptions, Cc as VenueMarketOutcome, Ci as SmartRouteParams, Cn as LeaderboardMetric, Co as getBalanceRefillMaximumRaw, Cr as PersistedAuthSnapshot, Cs as CreateApp, Ct as BalanceRefillPolicy, D as Candle, Da as CatalogChangeOp, Dc as WalletChainBalance, Di as SmartRouteSetupCostLine, Dn as LeaderboardSeriesPoint, Do as LimitPriceTickAdjustment, Dr as PositionRedeemStatus, Ds as ExecuteTradeResponse, Dt as CancelManagedExecutionResponse, E as toChecksumAddress, Ea as CatalogChange, Ec as VerifyResponse, Ei as SmartRouteSettlementPlan, En as LeaderboardSeries, Eo as LimitPriceSide, Er as PlacePaperTradingOrderParams, Es as ExecuteTradeRequest, Et as BatchOrderbooksResponse, F as isAggApiError, Fa as DiagnosticEvent, Fc as TradeSide, Fi as SubmitSignature, Fn as MatchedOrderbookMarket, Fo as retinaImageUrl, Fr as RecurringCryptoComparisonPoint, Fs as MarketPriceHistory, Ft as ChartVenueCandles, G as withTimeout, Ga as WsCandleInterval, Gc as RETINA_IMAGE_SIZES, Gi as UserActivityRedeemLeg, Gn as NewsFeedMarketNewsParams, Go as isNonEmptyString, Gr as RecurringCryptoPriceComparison, Gs as OrderbookHistoryResponse, Gt as CreatePaperTradingAccountParams, H as orderSignatureRound, Ha as WsAuthExpiring, Hc as AccountType, Hi as UserActivityItem, Hn as NewsFeedMarketFeedArticle, Ho as isEmail, Hr as RecurringCryptoOrderbookDepthSide, Hs as OrderListItem, Ht as CorrelatedMarketSignalDirection, I as areOrdersFilled, Ia as WsAppEvent, Ic as CONFIRMED_MATCH_STATUSES, Ii as TERMINAL_EXECUTION_STATES, In as MidpointRow, Io as SplitsByAmountResult, Ir as RecurringCryptoComparisonPriceSource, Is as MatchedMidpoint, It as CorrelatedMarketCascadeItem, J as VenueOrderbookLevel, Ja as WsConnected, Jc as VENUES, Ji as UserActivityUserOp, Jn as NewsFeedPageOptions, Jo as parseEmailStrict, Jr as RecurringCryptoSourceConfidence, Js as PricePoint, Jt as CryptoReferencePriceMarketInput, K as OrderbookLevel, Ka as WsCatalogChange, Kc as ACTIVE_VENUES, Ki as UserActivityTrade, Kn as NewsFeedMarketNewsResponse, Ko as parse, Kr as RecurringCryptoReferencePrice, Ks as OutcomeMidpoint, Kt as CryptoReferencePriceError, L as isOptionalFeeRequest, La as WsArbFeedBatch, Lc as MarketStatus, Li as TradeExecutorOrder, Ln as NewsFeedArticleFeedItem, Lo as SafeParseFailure, Lr as RecurringCryptoDuration, Ls as MatchedMidpointOutcome, Lt as CorrelatedMarketCascadeResponse, M as AggApiFieldError, Ma as CatalogMarketSnapshot, Mc as OrderStatus, Mi as SportsLiveParticipant, Mn as ManagedBalancesParams, Mo as VenueMarketClusterNode, Mr as RampWidgetSession, Ms as GetOrdersQuery, Mt as ChartCandle, N as AggRateLimitResponse, Na as CatalogOutcomeRef, Nc as OrderType, Ni as SportsLiveResponse, Nn as ManagedBalancesResponse, No as normalizeVenueMarketCluster, Nr as RecurrenceCadence, Ns as GetPositionsQuery, Nt as ChartHistoryManifest, O as CandleBuilder, Oa as CatalogClusterFields, Oc as WalletTokenBalance, Oi as SmartRouteSide, On as LeaderboardSeriesQuery, Oo as adjustLimitPriceRawToTick, Or as RECURRENCE_CADENCES, Os as GetBalanceQuery, Ot as CancelOrderSignature, P as TurnstileChallengeError, Pa as DiagnosticCallback, Pc as TimeInForce, Pi as SportsLiveState, Pn as MarkSource, Po as optimizedImageUrl, Pr as RecurrenceFilter, Ps as HelloResponse, Pt as ChartResolution, Q as computeBestSplitsByAmount, Qa as WsMarkSource, Qc as isVenueActive, Qi as VenueGeoPolicyEntry, Qn as OrderListQuery, Qo as formatOutcomeLabel, Qr as RedeemLegResult, Qs as ServerWallet, Qt as CryptoReferencePricesResponse, R as isOrderSignatureStep, Ra as WsArbFeedEntry, Rc as MatchStatus, Ri as TradeExecutorOrderListResponse, Rn as NewsFeedArticleFeedResponse, Ro as SafeParseResult, Rr as RecurringCryptoDurationInput, Rs as MatchedVenueMarketOutcomeRef, Rt as CorrelatedMarketQueryResult, S as loadImmutableHistory, Sa as GetCatalogChangesParams, Sc as VenueMarketListItem, Si as SmartRouteFill, Sn as GetPositionsParams, So as DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, Sr as PaperTradingPositionsPage, Ss as ComputeSplitsSelection, St as BalanceRefillAttemptStatus, T as mergeClosedCandles, Ta as CatalogCategoryRef, Tc as VerifyBody, Ti as SmartRouteSettlementLeg, Tn as LeaderboardRow, To as LIMIT_PRICE_RAW_SCALE, Tr as PlaceLimitOrderResponse, Ts as ExecuteManagedRequest, Tt as BatchMidpointsResponse, U as signatureTimeoutMs, Ua as WsAuthenticated, Uc as IMAGE_SIZES, Ui as UserActivityQuery, Un as NewsFeedMarketFeedItem, Uo as isEnum, Ur as RecurringCryptoOutcome, Us as Orderbook, Ut as CorrelatedMarketsStatus, V as isSameWalletAddress, Va as WsAuthExpired, Vc as AccountProvider, Vi as UserActivityDeposit, Vn as NewsFeedListResponse, Vo as hasShape, Vr as RecurringCryptoOrderbookDepthLevel, Vs as NovigExecutionMode, Vt as CorrelatedMarketSignalBatch, W as userSignerAddresses, Wa as WsBalanceUpdate, Wc as ImageSize, Wi as UserActivityRedeem, Wn as NewsFeedMarketFeedResponse, Wo as isFiniteNonNeg, Wr as RecurringCryptoOutcomeOrderbookDepth, Ws as OrderbookHistoryPoint, Wt as CreateBalanceRefillPolicyParams, X as computeChecksum, Xa as WsErrorCode, Xc as Venue, Xi as ValidateManagedParams, Xn as OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS, Xo as getWalletAddressFromUserProfile, Xr as RecurringCryptoWindowComparisons, Xs as PricesHistoryResponse, Xt as CryptoReferencePriceSource, Y as applyOrderbookDelta, Ya as WsError, Yc as VENUE_CHAIN_IDS, Yi as UserActivityWithdrawal, Yn as NewsFeedStatusResponse, Yo as safeParse, Yr as RecurringCryptoVenueMarket, Ys as PriceSource, Yt as CryptoReferencePriceResult, Z as snapshotToOrderbook, Za as WsHeartbeat, Zc as getEffectiveDisabledVenues, Zi as ValidateManagedResponse, Zn as OPTIONAL_SIGNATURE_TIMEOUT_MS, Zo as formatMarketQuestion, Zr as RecurringCryptoWindowMarket, Zs as ProphetxExecutionMode, Zt as CryptoReferencePriceTarget, _ as HostedVenueFundingIntent, _a as WithdrawalSourceStatus, _c as VenueEventListItem, _i as SimpleOrderbookLevel, _n as ExecutionStatusQuery, _o as WsWithdrawalLifecycleLeg, _r as PaperTradingMarkSource, _s as AuthUser, _t as AppClientConfigResponse, a as BookWatchdogOptions, aa as WithdrawManagedResponse, ac as TradeSplit, ai as ResolveCorrelatedMarketsParams, an as ExecuteManagedParams, ao as WsRedeemEvent, ar as OrderbookServiceUnavailableError, as as HostedVenueDepositAddress, at as AggAuthVerifyBody, b as prepareHostedVenueRoute, ba as CatalogChangesPage, bc as VenueKeySummary, bi as SmartRouteCustodyWarning, bn as GetCryptoReferencePricesOptions, bo as projectedOrderbookChecksum, br as PaperTradingPortfolio, bs as ComputeSplitsRequest, bt as BalanceCustody, c as CandleTail, ca as WithdrawPreviewResponse, cc as UpdateUserBody, ci as RpcTokenResponse, cn as ExecutionDisplayGroupStatus, co as WsStreamInterrupted, cr as OutcomeOrderbookResponse, cs as ProvisionHostedVenueAccountBody, ct as AggClientOptions, d as MarketView, da as WithdrawalLeg, dc as UserProfile, di as SearchParams, dn as ExecutionOrderItem, do as WsUnsubscribed, dr as PaperTradingAccountsPage, ds as Account, dt as AggLinkAccountConfirmResult, ea as VenueMarketRef, ec as SettlementDifference, ei as RedeemRequest, el as isVenueInactive, en as DepositAddressesReadyResponse, eo as WsOrderEvent, er as OrderbookBatchItemErrorCode, es as HostedVenueAccount, et as AggAuthDeliveryMode, f as MarketViewBatch, fa as WithdrawalLegStatus, fc as ValidateBalanceOnClientStep, fi as SearchResponse, fn as ExecutionOrdersQuery, fo as WsVenueBook, fr as PaperTradingAppOptions, fs as App, ft as AggLinkAccountResult, g as lighterOrderDisclosure, ga as WithdrawalQuoteResponse, gc as VenueEvent, gi as SignerFn, gn as ExecutionStatusOrder, go as WsWithdrawalLifecycleEvent, gr as PaperTradingListParams, gs as AuthTokenResponse, gt as AggregatedOrderbookResponse, h as NATIVE_NETTING_SELLS_MAY_OPEN_OPPOSITE_EXPOSURE, ha as WithdrawalQuoteParams, hc as ValidateTradeResponse, hi as SignatureRequestType, hn as ExecutionPositionsQuery, ho as WsWithdrawalLegStatus, hr as PaperTradingLiquidityStatus, hs as AuthCodeResponse, ht as AggregatedOrderbookLevel, i as AggWebSocketOptions, ia as WithdrawManagedParams, ic as SyncBalancesResponse, ii as ResetPaperTradingAccountParams, in as EventBootstrapResponse, io as WsOrderbookSnapshot, ir as OrderbookQuoteResponse, is as HostedVenueBalance, it as AggAuthStartResult, j as AggApiErrorInit, ja as CatalogFilter, jc as WithdrawalSourceItem, ji as SportsGameStatus, jn as ListRecurringCryptoMarketsOptions, jo as sortVenues, jr as RampSessionRequest, js as GetHoldingsResponse, jt as ChartBarsResponse, k as CandleInterval, ka as CatalogEntity, kc as WithdrawManagedRequest, ki as SmartRouteStatus, kn as LeaderboardStats, ko as BuildVenueUrlOpts, kr as RampQuote, ks as GetBalanceResponse, kt as CancelVenueOrderParams, l as HistoryRangeRequest, la as WithdrawTokenSymbol, lc as UpsertVenueKey, li as SELF_CUSTODY_FILL_TIMEOUT_MS, ln as ExecutionDisplayStepKind, lo as WsSubscribed, lr as PaginatedResponse, ls as QuoteError, lt as AggClientSessionInput, m as LIGHTER_REDUCE_ONLY, ma as WithdrawalLifecycleStatus, mc as ValidateTradeRequest, mi as SignatureRequest, mn as ExecutionPositionGroup, mo as WsVenueLevel, mr as PaperTradingBalanceResponse, ms as AttributedOrderbookLevel, mt as AggSessionUser, n as AggWebSocketCallbacks, na as VenuePriceInfo, nc as SetupDepositAddressStep, ni as RedeemSelfCustodyParams, nn as DepositAddressesSupportedChain, no as WsOrderSubmitted, nr as OrderbookQuoteFill, ns as HostedVenueActivityCode, nt as AggAuthProviderType, o as CatalogSubscribeOptions, oa as WithdrawManagedSourceItem, oc as TradeStep, oi as ResolveCorrelatedMarketsResponse, on as ExecuteManagedResponse, oo as WsResumed, or as OrderbooksOnlyError, os as HostedVenueWithdrawal, ot as AggAuthWalletVerifyBody, p as createAggClient, pa as WithdrawalLegType, pc as ValidateManagedRequest, pi as SetPaperTradingBalanceParams, pn as ExecutionOverallState, po as WsVenueInfo, pr as PaperTradingBalanceAdjustment, ps as AttributedOrderbook, pt as AggLinkAccountWalletConfirmBody, q as OrderbookState, qa as WsClientMessage, qc as INACTIVE_VENUES, qi as UserActivityType, qn as NewsFeedMarketNewsResult, qo as parseEmail, qr as RecurringCryptoResolution, qs as PositionGroup, qt as CryptoReferencePriceExternalMarketInput, r as AggWebSocketDiagnostics, ra as VenueSoloQuote, rc as SetupVenueKeyStep, ri as RequestedOrderbookMarket, rn as DepositAddressesToken, ro as WsOrderbookDelta, rr as OrderbookQuoteParams, rs as HostedVenueActivityQuery, rt as AggAuthStartBody, s as OrderbookLatency, sa as WithdrawPreviewParams, sc as UnifiedBalanceResponse, si as ResolvedCorrelatedMarketsResponse, sn as ExecutionDagProgress, so as WsServerMessage, sr as OutcomeMidpointRow, ss as HostedVenueWithdrawalRequest, st as AggClientAuthOptions, t as AggWebSocket, ta as VenueOrderbookEntry, tc as SettlementSource, ti as RedeemResponse, tn as DepositAddressesResponse, to as WsOrderEventType, tr as OrderbookBatchItemStatus, ts as HostedVenueActivity, tt as AggAuthPrivyVerifyBody, ua as WithdrawalExpected, uc as UserHolding, ui as SELF_CUSTODY_POLL_INTERVAL_MS, un as ExecutionMode, uo as WsTrade, ur as PaperTradingAccount, us as QuoteErrorCode, ut as AggLinkAccountBody, v as HostedVenueFundingOptions, va as WithdrawalSourceTokenSymbol, vc as VenueEventWithMarkets, vi as SmartRouteAllocation, vn as ExecutionStatusResponse, vo as WsWithdrawalLifecycleStatus, vr as PaperTradingOrder, vs as BookQuality, vt as AppTradingMode, w as mergeCandles, wa as isCatalogResyncRequired, wc as VenuePositionBalance, wi as SmartRouteResponse, wn as LeaderboardQuery, wo as isBalanceRefillWithinDailyCap, wr as PlaceLimitOrderParams, ws as DepositStep, wt as BalanceRefillPolicyStatus, x as LoadImmutableHistoryOptions, xa as CatalogWatchHandle, xc as VenueMarket, xi as SmartRouteFeeBreakdown, xn as GetOrdersParams, xo as DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, xr as PaperTradingPosition, xs as ComputeSplitsResponse, xt as BalanceRefillAttempt, y as prepareHostedVenueFunding, ya as CATALOG_DEFAULT_OVERLAP_MS, yc as VenueKeyStatus, yi as SmartRouteBridgeStep, yn as ExecutionStatusStep, yo as orderbookCrc32, yr as PaperTradingOrdersPage, ys as Category, yt as AuthStatus, z as isPolymarketOrderSignatureStep, za as WsArbMarketUpdate, zc as MatchType, zi as UpdateBalanceRefillPolicyParams, zn as NewsFeedArticleWithSummary, zo as SafeParseSuccess, zr as RecurringCryptoMarketMetrics, zs as MidpointItem, zt as CorrelatedMarketSide } from "./agg-websocket-BRWnvGwU.mjs";
|
|
2
|
+
export { ACTIVE_VENUES, Account, AccountProvider, AccountType, AggApiError, type AggApiErrorInit, type AggApiFieldError, type AggAuthDeliveryMode, type AggAuthPrivyVerifyBody, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, type AggAuthWalletVerifyBody, AggClient, type AggClientAuthOptions, type AggClientOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggLinkAccountWalletConfirmBody, type AggRateLimitResponse, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketDiagnostics, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, App, type AppClientConfigResponse, type AppTradingMode, AttributedOrderbook, AttributedOrderbookLevel, AuthCodeResponse, type AuthStatus, AuthTokenResponse, AuthUser, type BalanceCustody, type BalanceRefillAttempt, type BalanceRefillAttemptStatus, type BalanceRefillPolicy, type BalanceRefillPolicyStatus, type BatchMidpointsResponse, type BatchOrderbooksResponse, BookQuality, type BookWatchdogOptions, type BuildVenueUrlOpts, CATALOG_DEFAULT_OVERLAP_MS, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type CancelOrderSignature, type CancelVenueOrderParams, type Candle, CandleBuilder, type CandleInterval, type CandleTail, type CatalogCategoryRef, type CatalogChange, type CatalogChangeOp, type CatalogChangesPage, type CatalogClusterFields, type CatalogEntity, type CatalogEventSnapshot, type CatalogFilter, type CatalogMarketSnapshot, type CatalogOutcomeRef, type CatalogSubscribeOptions, type CatalogWatchHandle, Category, Chain, type ChartBarsMeta, type ChartBarsResponse, type ChartCandle, type ChartHistoryManifest, type ChartResolution, type ChartVenueCandles, ComputeSplitsRequest, ComputeSplitsResponse, ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, CreateApp, type CreateBalanceRefillPolicyParams, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, DepositAddressesPendingResponse, DepositAddressesReadyResponse, type DepositAddressesResponse, DepositAddressesSupportedChain, type DepositAddressesToken, DepositStep, type DiagnosticCallback, type DiagnosticEvent, type EventBootstrapResponse, type ExecuteManagedParams, ExecuteManagedRequest, ExecuteManagedResponse, ExecuteTradeRequest, ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionDisplayGroupStatus, type ExecutionDisplayStepKind, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, GetBalanceQuery, GetBalanceResponse, type GetCatalogChangesParams, type GetCryptoReferencePricesOptions, GetHoldingsQuery, GetHoldingsResponse, type GetOrdersParams, GetOrdersQuery, type GetPositionsParams, GetPositionsQuery, HelloResponse, type HistoryRangeRequest, type HostedVenueAccount, type HostedVenueActivity, type HostedVenueActivityCode, type HostedVenueActivityQuery, type HostedVenueBalance, type HostedVenueDepositAddress, type HostedVenueFundingIntent, type HostedVenueFundingOptions, type HostedVenueWithdrawal, type HostedVenueWithdrawalRequest, IMAGE_SIZES, INACTIVE_VENUES, ImageSize, LIGHTER_REDUCE_ONLY, LIMIT_PRICE_RAW_SCALE, type LeaderboardMetric, type LeaderboardQuery, type LeaderboardRow, type LeaderboardSeries, type LeaderboardSeriesPoint, type LeaderboardSeriesQuery, type LeaderboardStats, type LimitOrderTimeInForce, type LimitPriceSide, type LimitPriceTickAdjustment, type ListRecurringCryptoMarketsOptions, type LoadImmutableHistoryOptions, type ManagedBalancesParams, type ManagedBalancesResponse, type MarkSource, MarketPriceHistory, MarketStatus, type MarketView, type MarketViewBatch, MatchStatus, MatchType, MatchedMidpoint, MatchedMidpointOutcome, type MatchedOrderbookMarket, MatchedVenueMarketOutcomeRef, MidpointItem, type MidpointRow, NATIVE_NETTING_SELLS_MAY_OPEN_OPPOSITE_EXPOSURE, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, NonceResponse, NovigExecutionMode, OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS, OPTIONAL_SIGNATURE_TIMEOUT_MS, OrderListItem, type OrderListQuery, OrderStatus, OrderType, Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, OrderbookHistoryPoint, OrderbookHistoryResponse, type OrderbookLatency, OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlaceLimitOrderParams, type PlaceLimitOrderResponse, type PlacePaperTradingOrderParams, PositionGroup, type PositionRedeemStatus, PricePoint, PriceSource, PricesHistoryResponse, ProphetxExecutionMode, type ProvisionHostedVenueAccountBody, type QuoteError, type QuoteErrorCode, RECURRENCE_CADENCES, RETINA_IMAGE_SIZES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOrderbookDepthLevel, type RecurringCryptoOrderbookDepthSide, type RecurringCryptoOutcome, type RecurringCryptoOutcomeOrderbookDepth, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RedeemSelfCustodyParams, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type RpcTokenResponse, SELF_CUSTODY_FILL_TIMEOUT_MS, SELF_CUSTODY_POLL_INTERVAL_MS, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type SearchParams, type SearchResponse, ServerWallet, type SetPaperTradingBalanceParams, SettlementDiff, SettlementDifference, SettlementSource, SetupDepositAddressStep, SetupVenueKeyStep, type SignatureRequest, type SignatureRequestType, type SignerFn, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteCustodyWarning, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSettlementLeg, type SmartRouteSettlementPlan, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SportsGameStatus, type SportsLiveParticipant, type SportsLiveResponse, type SportsLiveState, type SubmitSignature, SyncBalancesResponse, TERMINAL_EXECUTION_STATES, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide, TradeSplit, TradeStep, TurnstileChallengeError, UnifiedBalanceResponse, type UpdateBalanceRefillPolicyParams, UpdateUserBody, UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, UserHolding, UserProfile, VENUES, VENUE_CHAIN_IDS, ValidateBalanceOnClientStep, type ValidateManagedParams, ValidateManagedRequest, ValidateManagedResponse, ValidateTradeRequest, ValidateTradeResponse, Venue, VenueEvent, VenueEventListItem, VenueEventWithMarkets, type VenueGeoPolicyEntry, type VenueGeoPolicyResponse, VenueKeyStatus, VenueKeySummary, VenueMarket, type VenueMarketClusterNode, VenueMarketListItem, VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, VerifyBody, VerifyResponse, WalletChainBalance, WalletTokenBalance, type WatchCatalogOptions, type WithdrawManagedParams, WithdrawManagedRequest, WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, WithdrawTokenSymbol, WithdrawalExpected, WithdrawalLeg, WithdrawalLegStatus, WithdrawalLegType, WithdrawalLifecycleStatus, type WithdrawalQuoteParams, type WithdrawalQuoteResponse, WithdrawalSource, WithdrawalSourceItem, WithdrawalSourceStatus, WithdrawalSourceTokenSymbol, type WsAppEvent, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthExpired, type WsAuthExpiring, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsCatalogChange, type WsClientMessage, type WsConnected, type WsError, type WsErrorCode, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsResumed, type WsServerMessage, type WsStreamInterrupted, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, adjustLimitPriceRawToTick, aggregateMidpoint, applyOrderbookDelta, areOrdersFilled, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getBalanceRefillMaximumRaw, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isAggApiError, isBalanceRefillWithinDailyCap, isCatalogResyncRequired, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isOptionalFeeRequest, isOrderSignatureStep, isPolymarketOrderSignatureStep, isPostFillFeeRequest, isSameWalletAddress, isVenueActive, isVenueDataVisible, isVenueInactive, lighterOrderDisclosure, loadImmutableHistory, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, orderSignatureRound, orderbookCrc32, parse, parseEmail, parseEmailStrict, prepareHostedVenueFunding, prepareHostedVenueRoute, projectedOrderbookChecksum, retinaImageUrl, safeParse, signatureTimeoutMs, snapshotToOrderbook, sortVenues, toChecksumAddress, userSignerAddresses, withTimeout };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as AggAuthStartBody, $a as WsOrderbookDelta, $i as VenueSoloQuote, $n as OrderbookQuoteParams, $o as HostedVenueActivityQuery, $r as RequestedOrderbookMarket, $s as SetupVenueKeyStep, $t as DepositAddressesToken, A as TurnstileChallengeError, Aa as DiagnosticCallback, Ac as TimeInForce, Ai as SportsLiveState, An as MarkSource, Ao as optimizedImageUrl, Ar as RecurrenceFilter, As as HelloResponse, At as ChartResolution, B as userSignerAddresses, Ba as WsBalanceUpdate, Bc as ImageSize, Bi as UserActivityRedeem, Bn as NewsFeedMarketFeedResponse, Bo as isFiniteNonNeg, Br as RecurringCryptoOutcomeOrderbookDepth, Bs as OrderbookHistoryPoint, Bt as CreateBalanceRefillPolicyParams, C as Candle, Ca as CatalogChangeOp, Cc as WalletChainBalance, Ci as SmartRouteSetupCostLine, Cn as LeaderboardSeriesPoint, Co as LimitPriceTickAdjustment, Cr as PositionRedeemStatus, Cs as ExecuteTradeResponse, Ct as CancelManagedExecutionResponse, D as AggApiErrorInit, Da as CatalogFilter, Dc as WithdrawalSourceItem, Di as SportsGameStatus, Dn as ListRecurringCryptoMarketsOptions, Do as sortVenues, Dr as RampSessionRequest, Ds as GetHoldingsResponse, Dt as ChartBarsResponse, E as AggApiError, Ea as CatalogEventSnapshot, Ec as WithdrawalSource, Ei as SmartRouteVenueFill, En as LimitOrderTimeInForce, Eo as buildVenueUrl, Er as RampQuoteRequest, Es as GetHoldingsQuery, Et as ChartBarsMeta, F as isPolymarketOrderSignatureStep, Fa as WsArbMarketUpdate, Fc as MatchType, Fi as UpdateBalanceRefillPolicyParams, Fn as NewsFeedArticleWithSummary, Fo as SafeParseSuccess, Fr as RecurringCryptoMarketMetrics, Fs as MidpointItem, Ft as CorrelatedMarketSide, G as applyOrderbookDelta, Ga as WsError, Gc as VENUE_CHAIN_IDS, Gi as UserActivityWithdrawal, Gn as NewsFeedStatusResponse, Go as safeParse, Gr as RecurringCryptoVenueMarket, Gs as PriceSource, Gt as CryptoReferencePriceResult, H as OrderbookLevel, Ha as WsCatalogChange, Hc as ACTIVE_VENUES, Hi as UserActivityTrade, Hn as NewsFeedMarketNewsResponse, Ho as parse, Hr as RecurringCryptoReferencePrice, Hs as OutcomeMidpoint, Ht as CryptoReferencePriceError, I as isPostFillFeeRequest, Ia as WsAttributedLevel, Ic as Chain, Ii as UserActivityBridge, In as NewsFeedLinkedMarket, Io as enumGuard, Ir as RecurringCryptoMarketsResponse, Is as NonceResponse, It as CorrelatedMarketSignal, J as computeBestSplitsByAmount, Ja as WsMarkSource, Jc as isVenueActive, Ji as VenueGeoPolicyEntry, Jn as OrderListQuery, Jo as formatOutcomeLabel, Jr as RedeemLegResult, Js as ServerWallet, Jt as CryptoReferencePricesResponse, K as computeChecksum, Ka as WsErrorCode, Kc as Venue, Ki as ValidateManagedParams, Kn as OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS, Ko as getWalletAddressFromUserProfile, Kr as RecurringCryptoWindowComparisons, Ks as PricesHistoryResponse, Kt as CryptoReferencePriceSource, L as isSameWalletAddress, La as WsAuthExpired, Lc as AccountProvider, Li as UserActivityDeposit, Ln as NewsFeedListResponse, Lo as hasShape, Lr as RecurringCryptoOrderbookDepthLevel, Ls as NovigExecutionMode, Lt as CorrelatedMarketSignalBatch, M as areOrdersFilled, Ma as WsAppEvent, Mc as CONFIRMED_MATCH_STATUSES, Mi as TERMINAL_EXECUTION_STATES, Mn as MidpointRow, Mo as SplitsByAmountResult, Mr as RecurringCryptoComparisonPriceSource, Ms as MatchedMidpoint, Mt as CorrelatedMarketCascadeItem, N as isOptionalFeeRequest, Na as WsArbFeedBatch, Nc as MarketStatus, Ni as TradeExecutorOrder, Nn as NewsFeedArticleFeedItem, No as SafeParseFailure, Nr as RecurringCryptoDuration, Ns as MatchedMidpointOutcome, Nt as CorrelatedMarketCascadeResponse, O as AggApiFieldError, Oa as CatalogMarketSnapshot, Oc as OrderStatus, Oi as SportsLiveParticipant, On as ManagedBalancesParams, Oo as VenueMarketClusterNode, Or as RampWidgetSession, Os as GetOrdersQuery, Ot as ChartCandle, P as isOrderSignatureStep, Pa as WsArbFeedEntry, Pc as MatchStatus, Pi as TradeExecutorOrderListResponse, Pn as NewsFeedArticleFeedResponse, Po as SafeParseResult, Pr as RecurringCryptoDurationInput, Ps as MatchedVenueMarketOutcomeRef, Pt as CorrelatedMarketQueryResult, Q as AggAuthProviderType, Qa as WsOrderSubmitted, Qi as VenuePriceInfo, Qn as OrderbookQuoteFill, Qo as HostedVenueActivityCode, Qr as RedeemSelfCustodyParams, Qs as SetupDepositAddressStep, Qt as DepositAddressesSupportedChain, R as orderSignatureRound, Ra as WsAuthExpiring, Rc as AccountType, Ri as UserActivityItem, Rn as NewsFeedMarketFeedArticle, Ro as isEmail, Rr as RecurringCryptoOrderbookDepthSide, Rs as OrderListItem, Rt as CorrelatedMarketSignalDirection, S as toChecksumAddress, Sa as CatalogChange, Sc as VerifyResponse, Si as SmartRouteSettlementPlan, Sn as LeaderboardSeries, So as LimitPriceSide, Sr as PlacePaperTradingOrderParams, Ss as ExecuteTradeRequest, St as BatchOrderbooksResponse, T as CandleInterval, Ta as CatalogEntity, Tc as WithdrawManagedRequest, Ti as SmartRouteStatus, Tn as LeaderboardStats, To as BuildVenueUrlOpts, Tr as RampQuote, Ts as GetBalanceResponse, Tt as CancelVenueOrderParams, U as OrderbookState, Ua as WsClientMessage, Uc as INACTIVE_VENUES, Ui as UserActivityType, Un as NewsFeedMarketNewsResult, Uo as parseEmail, Ur as RecurringCryptoResolution, Us as PositionGroup, Ut as CryptoReferencePriceExternalMarketInput, V as withTimeout, Va as WsCandleInterval, Vc as RETINA_IMAGE_SIZES, Vi as UserActivityRedeemLeg, Vn as NewsFeedMarketNewsParams, Vo as isNonEmptyString, Vr as RecurringCryptoPriceComparison, Vs as OrderbookHistoryResponse, Vt as CreatePaperTradingAccountParams, W as VenueOrderbookLevel, Wa as WsConnected, Wc as VENUES, Wi as UserActivityUserOp, Wn as NewsFeedPageOptions, Wo as parseEmailStrict, Wr as RecurringCryptoSourceConfidence, Ws as PricePoint, Wt as CryptoReferencePriceMarketInput, X as AggAuthDeliveryMode, Xa as WsOrderEvent, Xc as isVenueInactive, Xi as VenueMarketRef, Xn as OrderbookBatchItemErrorCode, Xo as HostedVenueAccount, Xr as RedeemRequest, Xs as SettlementDifference, Xt as DepositAddressesReadyResponse, Y as AggClient, Ya as WsMarketResolved, Yc as isVenueDataVisible, Yi as VenueGeoPolicyResponse, Yn as OrderbookBatchItemError, Yo as formatOutcomeTitle, Yr as RedeemLegStatus, Ys as SettlementDiff, Yt as DepositAddressesPendingResponse, Z as AggAuthPrivyVerifyBody, Za as WsOrderEventType, Zi as VenueOrderbookEntry, Zn as OrderbookBatchItemStatus, Zo as HostedVenueActivity, Zr as RedeemResponse, Zs as SettlementSource, Zt as DepositAddressesResponse, _ as LoadImmutableHistoryOptions, _a as CatalogWatchHandle, _c as VenueMarket, _i as SmartRouteFeeBreakdown, _n as GetOrdersParams, _o as DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, _r as PaperTradingPosition, _s as ComputeSplitsResponse, _t as BalanceRefillAttempt, a as BookWatchdogOptions, aa as WithdrawTokenSymbol, ac as UpsertVenueKey, ai as SELF_CUSTODY_FILL_TIMEOUT_MS, an as ExecutionDisplayStepKind, ao as WsSubscribed, ar as PaginatedResponse, as as QuoteError, at as AggClientSessionInput, b as mergeCandles, ba as isCatalogResyncRequired, bc as VenuePositionBalance, bi as SmartRouteResponse, bn as LeaderboardQuery, bo as isBalanceRefillWithinDailyCap, br as PlaceLimitOrderParams, bs as DepositStep, bt as BalanceRefillPolicyStatus, c as HistoryRangeRequest, ca as WithdrawalLegStatus, cc as ValidateBalanceOnClientStep, ci as SearchResponse, cn as ExecutionOrdersQuery, co as WsVenueBook, cr as PaperTradingAppOptions, cs as App, ct as AggLinkAccountResult, d as MarketViewBatch, da as WithdrawalQuoteParams, dc as ValidateTradeResponse, di as SignatureRequestType, dn as ExecutionPositionsQuery, do as WsWithdrawalLegStatus, dr as PaperTradingLiquidityStatus, ds as AuthCodeResponse, dt as AggregatedOrderbookLevel, ea as WithdrawManagedParams, ec as SyncBalancesResponse, ei as ResetPaperTradingAccountParams, en as EventBootstrapResponse, eo as WsOrderbookSnapshot, er as OrderbookQuoteResponse, es as HostedVenueBalance, et as AggAuthStartResult, f as createAggClient, fa as WithdrawalQuoteResponse, fc as VenueEvent, fi as SignerFn, fn as ExecutionStatusOrder, fo as WsWithdrawalLifecycleEvent, fr as PaperTradingListParams, fs as AuthTokenResponse, ft as AggregatedOrderbookResponse, g as prepareHostedVenueRoute, ga as CatalogChangesPage, gc as VenueKeySummary, gi as SmartRouteCustodyWarning, gn as GetCryptoReferencePricesOptions, go as projectedOrderbookChecksum, gr as PaperTradingPortfolio, gs as ComputeSplitsRequest, gt as BalanceCustody, h as prepareHostedVenueFunding, ha as CATALOG_DEFAULT_OVERLAP_MS, hc as VenueKeyStatus, hi as SmartRouteBridgeStep, hn as ExecutionStatusStep, ho as orderbookCrc32, hr as PaperTradingOrdersPage, hs as Category, ht as AuthStatus, i as AggWebSocketOptions, ia as WithdrawPreviewResponse, ic as UpdateUserBody, ii as RpcTokenResponse, in as ExecutionDisplayGroupStatus, io as WsStreamInterrupted, ir as OutcomeOrderbookResponse, is as ProvisionHostedVenueAccountBody, it as AggClientOptions, j as isAggApiError, ja as DiagnosticEvent, jc as TradeSide, ji as SubmitSignature, jn as MatchedOrderbookMarket, jo as retinaImageUrl, jr as RecurringCryptoComparisonPoint, js as MarketPriceHistory, jt as ChartVenueCandles, k as AggRateLimitResponse, ka as CatalogOutcomeRef, kc as OrderType, ki as SportsLiveResponse, kn as ManagedBalancesResponse, ko as normalizeVenueMarketCluster, kr as RecurrenceCadence, ks as GetPositionsQuery, kt as ChartHistoryManifest, la as WithdrawalLegType, lc as ValidateManagedRequest, li as SetPaperTradingBalanceParams, ln as ExecutionOverallState, lo as WsVenueInfo, lr as PaperTradingBalanceAdjustment, ls as AttributedOrderbook, lt as AggLinkAccountWalletConfirmBody, m as HostedVenueFundingOptions, ma as WithdrawalSourceTokenSymbol, mc as VenueEventWithMarkets, mi as SmartRouteAllocation, mn as ExecutionStatusResponse, mo as WsWithdrawalLifecycleStatus, mr as PaperTradingOrder, ms as BookQuality, mt as AppTradingMode, n as AggWebSocketCallbacks, na as WithdrawManagedSourceItem, nc as TradeStep, ni as ResolveCorrelatedMarketsResponse, nn as ExecuteManagedResponse, no as WsResumed, nr as OrderbooksOnlyError, ns as HostedVenueWithdrawal, nt as AggAuthWalletVerifyBody, o as CatalogSubscribeOptions, oa as WithdrawalExpected, oc as UserHolding, oi as SELF_CUSTODY_POLL_INTERVAL_MS, on as ExecutionMode, oo as WsTrade, or as PaperTradingAccount, os as QuoteErrorCode, ot as AggLinkAccountBody, p as HostedVenueFundingIntent, pa as WithdrawalSourceStatus, pc as VenueEventListItem, pi as SimpleOrderbookLevel, pn as ExecutionStatusQuery, po as WsWithdrawalLifecycleLeg, pr as PaperTradingMarkSource, ps as AuthUser, pt as AppClientConfigResponse, q as snapshotToOrderbook, qa as WsHeartbeat, qc as getEffectiveDisabledVenues, qi as ValidateManagedResponse, qn as OPTIONAL_SIGNATURE_TIMEOUT_MS, qo as formatMarketQuestion, qr as RecurringCryptoWindowMarket, qs as ProphetxExecutionMode, qt as CryptoReferencePriceTarget, r as AggWebSocketDiagnostics, ra as WithdrawPreviewParams, rc as UnifiedBalanceResponse, ri as ResolvedCorrelatedMarketsResponse, rn as ExecutionDagProgress, ro as WsServerMessage, rr as OutcomeMidpointRow, rs as HostedVenueWithdrawalRequest, rt as AggClientAuthOptions, s as CandleTail, sa as WithdrawalLeg, sc as UserProfile, si as SearchParams, sn as ExecutionOrderItem, so as WsUnsubscribed, sr as PaperTradingAccountsPage, ss as Account, st as AggLinkAccountConfirmResult, t as AggWebSocket, ta as WithdrawManagedResponse, tc as TradeSplit, ti as ResolveCorrelatedMarketsParams, tn as ExecuteManagedParams, to as WsRedeemEvent, tr as OrderbookServiceUnavailableError, ts as HostedVenueDepositAddress, tt as AggAuthVerifyBody, u as MarketView, ua as WithdrawalLifecycleStatus, uc as ValidateTradeRequest, ui as SignatureRequest, un as ExecutionPositionGroup, uo as WsVenueLevel, ur as PaperTradingBalanceResponse, us as AttributedOrderbookLevel, ut as AggSessionUser, v as loadImmutableHistory, va as GetCatalogChangesParams, vc as VenueMarketListItem, vi as SmartRouteFill, vn as GetPositionsParams, vo as DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, vr as PaperTradingPositionsPage, vs as ComputeSplitsSelection, vt as BalanceRefillAttemptStatus, w as CandleBuilder, wa as CatalogClusterFields, wc as WalletTokenBalance, wi as SmartRouteSide, wn as LeaderboardSeriesQuery, wo as adjustLimitPriceRawToTick, wr as RECURRENCE_CADENCES, ws as GetBalanceQuery, wt as CancelOrderSignature, x as mergeClosedCandles, xa as CatalogCategoryRef, xc as VerifyBody, xi as SmartRouteSettlementLeg, xn as LeaderboardRow, xo as LIMIT_PRICE_RAW_SCALE, xr as PlaceLimitOrderResponse, xs as ExecuteManagedRequest, xt as BatchMidpointsResponse, y as aggregateMidpoint, ya as WatchCatalogOptions, yc as VenueMarketOutcome, yi as SmartRouteParams, yn as LeaderboardMetric, yo as getBalanceRefillMaximumRaw, yr as PersistedAuthSnapshot, ys as CreateApp, yt as BalanceRefillPolicy, z as signatureTimeoutMs, za as WsAuthenticated, zc as IMAGE_SIZES, zi as UserActivityQuery, zn as NewsFeedMarketFeedItem, zo as isEnum, zr as RecurringCryptoOutcome, zs as Orderbook, zt as CorrelatedMarketsStatus } from "./agg-websocket-CsURzWkQ.js";
|
|
2
|
-
export { ACTIVE_VENUES, Account, AccountProvider, AccountType, AggApiError, type AggApiErrorInit, type AggApiFieldError, type AggAuthDeliveryMode, type AggAuthPrivyVerifyBody, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, type AggAuthWalletVerifyBody, AggClient, type AggClientAuthOptions, type AggClientOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggLinkAccountWalletConfirmBody, type AggRateLimitResponse, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketDiagnostics, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, App, type AppClientConfigResponse, type AppTradingMode, AttributedOrderbook, AttributedOrderbookLevel, AuthCodeResponse, type AuthStatus, AuthTokenResponse, AuthUser, type BalanceCustody, type BalanceRefillAttempt, type BalanceRefillAttemptStatus, type BalanceRefillPolicy, type BalanceRefillPolicyStatus, type BatchMidpointsResponse, type BatchOrderbooksResponse, BookQuality, type BookWatchdogOptions, type BuildVenueUrlOpts, CATALOG_DEFAULT_OVERLAP_MS, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type CancelOrderSignature, type CancelVenueOrderParams, type Candle, CandleBuilder, type CandleInterval, type CandleTail, type CatalogCategoryRef, type CatalogChange, type CatalogChangeOp, type CatalogChangesPage, type CatalogClusterFields, type CatalogEntity, type CatalogEventSnapshot, type CatalogFilter, type CatalogMarketSnapshot, type CatalogOutcomeRef, type CatalogSubscribeOptions, type CatalogWatchHandle, Category, Chain, type ChartBarsMeta, type ChartBarsResponse, type ChartCandle, type ChartHistoryManifest, type ChartResolution, type ChartVenueCandles, ComputeSplitsRequest, ComputeSplitsResponse, ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, CreateApp, type CreateBalanceRefillPolicyParams, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, DepositAddressesPendingResponse, DepositAddressesReadyResponse, type DepositAddressesResponse, DepositAddressesSupportedChain, type DepositAddressesToken, DepositStep, type DiagnosticCallback, type DiagnosticEvent, type EventBootstrapResponse, type ExecuteManagedParams, ExecuteManagedRequest, ExecuteManagedResponse, ExecuteTradeRequest, ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionDisplayGroupStatus, type ExecutionDisplayStepKind, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, GetBalanceQuery, GetBalanceResponse, type GetCatalogChangesParams, type GetCryptoReferencePricesOptions, GetHoldingsQuery, GetHoldingsResponse, type GetOrdersParams, GetOrdersQuery, type GetPositionsParams, GetPositionsQuery, HelloResponse, type HistoryRangeRequest, type HostedVenueAccount, type HostedVenueActivity, type HostedVenueActivityCode, type HostedVenueActivityQuery, type HostedVenueBalance, type HostedVenueDepositAddress, type HostedVenueFundingIntent, type HostedVenueFundingOptions, type HostedVenueWithdrawal, type HostedVenueWithdrawalRequest, IMAGE_SIZES, INACTIVE_VENUES, ImageSize, LIMIT_PRICE_RAW_SCALE, type LeaderboardMetric, type LeaderboardQuery, type LeaderboardRow, type LeaderboardSeries, type LeaderboardSeriesPoint, type LeaderboardSeriesQuery, type LeaderboardStats, type LimitOrderTimeInForce, type LimitPriceSide, type LimitPriceTickAdjustment, type ListRecurringCryptoMarketsOptions, type LoadImmutableHistoryOptions, type ManagedBalancesParams, type ManagedBalancesResponse, type MarkSource, MarketPriceHistory, MarketStatus, type MarketView, type MarketViewBatch, MatchStatus, MatchType, MatchedMidpoint, MatchedMidpointOutcome, type MatchedOrderbookMarket, MatchedVenueMarketOutcomeRef, MidpointItem, type MidpointRow, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, NonceResponse, NovigExecutionMode, OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS, OPTIONAL_SIGNATURE_TIMEOUT_MS, OrderListItem, type OrderListQuery, OrderStatus, OrderType, Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, OrderbookHistoryPoint, OrderbookHistoryResponse, OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlaceLimitOrderParams, type PlaceLimitOrderResponse, type PlacePaperTradingOrderParams, PositionGroup, type PositionRedeemStatus, PricePoint, PriceSource, PricesHistoryResponse, ProphetxExecutionMode, type ProvisionHostedVenueAccountBody, type QuoteError, type QuoteErrorCode, RECURRENCE_CADENCES, RETINA_IMAGE_SIZES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOrderbookDepthLevel, type RecurringCryptoOrderbookDepthSide, type RecurringCryptoOutcome, type RecurringCryptoOutcomeOrderbookDepth, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RedeemSelfCustodyParams, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type RpcTokenResponse, SELF_CUSTODY_FILL_TIMEOUT_MS, SELF_CUSTODY_POLL_INTERVAL_MS, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type SearchParams, type SearchResponse, ServerWallet, type SetPaperTradingBalanceParams, SettlementDiff, SettlementDifference, SettlementSource, SetupDepositAddressStep, SetupVenueKeyStep, type SignatureRequest, type SignatureRequestType, type SignerFn, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteCustodyWarning, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSettlementLeg, type SmartRouteSettlementPlan, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SportsGameStatus, type SportsLiveParticipant, type SportsLiveResponse, type SportsLiveState, type SubmitSignature, SyncBalancesResponse, TERMINAL_EXECUTION_STATES, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide, TradeSplit, TradeStep, TurnstileChallengeError, UnifiedBalanceResponse, type UpdateBalanceRefillPolicyParams, UpdateUserBody, UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, UserHolding, UserProfile, VENUES, VENUE_CHAIN_IDS, ValidateBalanceOnClientStep, type ValidateManagedParams, ValidateManagedRequest, ValidateManagedResponse, ValidateTradeRequest, ValidateTradeResponse, Venue, VenueEvent, VenueEventListItem, VenueEventWithMarkets, type VenueGeoPolicyEntry, type VenueGeoPolicyResponse, VenueKeyStatus, VenueKeySummary, VenueMarket, type VenueMarketClusterNode, VenueMarketListItem, VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, VerifyBody, VerifyResponse, WalletChainBalance, WalletTokenBalance, type WatchCatalogOptions, type WithdrawManagedParams, WithdrawManagedRequest, WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, WithdrawTokenSymbol, WithdrawalExpected, WithdrawalLeg, WithdrawalLegStatus, WithdrawalLegType, WithdrawalLifecycleStatus, type WithdrawalQuoteParams, type WithdrawalQuoteResponse, WithdrawalSource, WithdrawalSourceItem, WithdrawalSourceStatus, WithdrawalSourceTokenSymbol, type WsAppEvent, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthExpired, type WsAuthExpiring, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsCatalogChange, type WsClientMessage, type WsConnected, type WsError, type WsErrorCode, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsResumed, type WsServerMessage, type WsStreamInterrupted, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, adjustLimitPriceRawToTick, aggregateMidpoint, applyOrderbookDelta, areOrdersFilled, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getBalanceRefillMaximumRaw, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isAggApiError, isBalanceRefillWithinDailyCap, isCatalogResyncRequired, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isOptionalFeeRequest, isOrderSignatureStep, isPolymarketOrderSignatureStep, isPostFillFeeRequest, isSameWalletAddress, isVenueActive, isVenueDataVisible, isVenueInactive, loadImmutableHistory, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, orderSignatureRound, orderbookCrc32, parse, parseEmail, parseEmailStrict, prepareHostedVenueFunding, prepareHostedVenueRoute, projectedOrderbookChecksum, retinaImageUrl, safeParse, signatureTimeoutMs, snapshotToOrderbook, sortVenues, toChecksumAddress, userSignerAddresses, withTimeout };
|
|
1
|
+
import { $ as AggClient, $a as WsMarketResolved, $c as isVenueDataVisible, $i as VenueGeoPolicyResponse, $n as OrderbookBatchItemError, $o as formatOutcomeTitle, $r as RedeemLegStatus, $s as SettlementDiff, $t as DepositAddressesPendingResponse, A as AggApiError, Aa as CatalogEventSnapshot, Ac as WithdrawalSource, Ai as SmartRouteVenueFill, An as LimitOrderTimeInForce, Ao as buildVenueUrl, Ar as RampQuoteRequest, As as GetHoldingsQuery, At as ChartBarsMeta, B as isPostFillFeeRequest, Ba as WsAttributedLevel, Bc as Chain, Bi as UserActivityBridge, Bn as NewsFeedLinkedMarket, Bo as enumGuard, Br as RecurringCryptoMarketsResponse, Bs as NonceResponse, Bt as CorrelatedMarketSignal, C as aggregateMidpoint, Ca as WatchCatalogOptions, Cc as VenueMarketOutcome, Ci as SmartRouteParams, Cn as LeaderboardMetric, Co as getBalanceRefillMaximumRaw, Cr as PersistedAuthSnapshot, Cs as CreateApp, Ct as BalanceRefillPolicy, D as Candle, Da as CatalogChangeOp, Dc as WalletChainBalance, Di as SmartRouteSetupCostLine, Dn as LeaderboardSeriesPoint, Do as LimitPriceTickAdjustment, Dr as PositionRedeemStatus, Ds as ExecuteTradeResponse, Dt as CancelManagedExecutionResponse, E as toChecksumAddress, Ea as CatalogChange, Ec as VerifyResponse, Ei as SmartRouteSettlementPlan, En as LeaderboardSeries, Eo as LimitPriceSide, Er as PlacePaperTradingOrderParams, Es as ExecuteTradeRequest, Et as BatchOrderbooksResponse, F as isAggApiError, Fa as DiagnosticEvent, Fc as TradeSide, Fi as SubmitSignature, Fn as MatchedOrderbookMarket, Fo as retinaImageUrl, Fr as RecurringCryptoComparisonPoint, Fs as MarketPriceHistory, Ft as ChartVenueCandles, G as withTimeout, Ga as WsCandleInterval, Gc as RETINA_IMAGE_SIZES, Gi as UserActivityRedeemLeg, Gn as NewsFeedMarketNewsParams, Go as isNonEmptyString, Gr as RecurringCryptoPriceComparison, Gs as OrderbookHistoryResponse, Gt as CreatePaperTradingAccountParams, H as orderSignatureRound, Ha as WsAuthExpiring, Hc as AccountType, Hi as UserActivityItem, Hn as NewsFeedMarketFeedArticle, Ho as isEmail, Hr as RecurringCryptoOrderbookDepthSide, Hs as OrderListItem, Ht as CorrelatedMarketSignalDirection, I as areOrdersFilled, Ia as WsAppEvent, Ic as CONFIRMED_MATCH_STATUSES, Ii as TERMINAL_EXECUTION_STATES, In as MidpointRow, Io as SplitsByAmountResult, Ir as RecurringCryptoComparisonPriceSource, Is as MatchedMidpoint, It as CorrelatedMarketCascadeItem, J as VenueOrderbookLevel, Ja as WsConnected, Jc as VENUES, Ji as UserActivityUserOp, Jn as NewsFeedPageOptions, Jo as parseEmailStrict, Jr as RecurringCryptoSourceConfidence, Js as PricePoint, Jt as CryptoReferencePriceMarketInput, K as OrderbookLevel, Ka as WsCatalogChange, Kc as ACTIVE_VENUES, Ki as UserActivityTrade, Kn as NewsFeedMarketNewsResponse, Ko as parse, Kr as RecurringCryptoReferencePrice, Ks as OutcomeMidpoint, Kt as CryptoReferencePriceError, L as isOptionalFeeRequest, La as WsArbFeedBatch, Lc as MarketStatus, Li as TradeExecutorOrder, Ln as NewsFeedArticleFeedItem, Lo as SafeParseFailure, Lr as RecurringCryptoDuration, Ls as MatchedMidpointOutcome, Lt as CorrelatedMarketCascadeResponse, M as AggApiFieldError, Ma as CatalogMarketSnapshot, Mc as OrderStatus, Mi as SportsLiveParticipant, Mn as ManagedBalancesParams, Mo as VenueMarketClusterNode, Mr as RampWidgetSession, Ms as GetOrdersQuery, Mt as ChartCandle, N as AggRateLimitResponse, Na as CatalogOutcomeRef, Nc as OrderType, Ni as SportsLiveResponse, Nn as ManagedBalancesResponse, No as normalizeVenueMarketCluster, Nr as RecurrenceCadence, Ns as GetPositionsQuery, Nt as ChartHistoryManifest, O as CandleBuilder, Oa as CatalogClusterFields, Oc as WalletTokenBalance, Oi as SmartRouteSide, On as LeaderboardSeriesQuery, Oo as adjustLimitPriceRawToTick, Or as RECURRENCE_CADENCES, Os as GetBalanceQuery, Ot as CancelOrderSignature, P as TurnstileChallengeError, Pa as DiagnosticCallback, Pc as TimeInForce, Pi as SportsLiveState, Pn as MarkSource, Po as optimizedImageUrl, Pr as RecurrenceFilter, Ps as HelloResponse, Pt as ChartResolution, Q as computeBestSplitsByAmount, Qa as WsMarkSource, Qc as isVenueActive, Qi as VenueGeoPolicyEntry, Qn as OrderListQuery, Qo as formatOutcomeLabel, Qr as RedeemLegResult, Qs as ServerWallet, Qt as CryptoReferencePricesResponse, R as isOrderSignatureStep, Ra as WsArbFeedEntry, Rc as MatchStatus, Ri as TradeExecutorOrderListResponse, Rn as NewsFeedArticleFeedResponse, Ro as SafeParseResult, Rr as RecurringCryptoDurationInput, Rs as MatchedVenueMarketOutcomeRef, Rt as CorrelatedMarketQueryResult, S as loadImmutableHistory, Sa as GetCatalogChangesParams, Sc as VenueMarketListItem, Si as SmartRouteFill, Sn as GetPositionsParams, So as DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, Sr as PaperTradingPositionsPage, Ss as ComputeSplitsSelection, St as BalanceRefillAttemptStatus, T as mergeClosedCandles, Ta as CatalogCategoryRef, Tc as VerifyBody, Ti as SmartRouteSettlementLeg, Tn as LeaderboardRow, To as LIMIT_PRICE_RAW_SCALE, Tr as PlaceLimitOrderResponse, Ts as ExecuteManagedRequest, Tt as BatchMidpointsResponse, U as signatureTimeoutMs, Ua as WsAuthenticated, Uc as IMAGE_SIZES, Ui as UserActivityQuery, Un as NewsFeedMarketFeedItem, Uo as isEnum, Ur as RecurringCryptoOutcome, Us as Orderbook, Ut as CorrelatedMarketsStatus, V as isSameWalletAddress, Va as WsAuthExpired, Vc as AccountProvider, Vi as UserActivityDeposit, Vn as NewsFeedListResponse, Vo as hasShape, Vr as RecurringCryptoOrderbookDepthLevel, Vs as NovigExecutionMode, Vt as CorrelatedMarketSignalBatch, W as userSignerAddresses, Wa as WsBalanceUpdate, Wc as ImageSize, Wi as UserActivityRedeem, Wn as NewsFeedMarketFeedResponse, Wo as isFiniteNonNeg, Wr as RecurringCryptoOutcomeOrderbookDepth, Ws as OrderbookHistoryPoint, Wt as CreateBalanceRefillPolicyParams, X as computeChecksum, Xa as WsErrorCode, Xc as Venue, Xi as ValidateManagedParams, Xn as OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS, Xo as getWalletAddressFromUserProfile, Xr as RecurringCryptoWindowComparisons, Xs as PricesHistoryResponse, Xt as CryptoReferencePriceSource, Y as applyOrderbookDelta, Ya as WsError, Yc as VENUE_CHAIN_IDS, Yi as UserActivityWithdrawal, Yn as NewsFeedStatusResponse, Yo as safeParse, Yr as RecurringCryptoVenueMarket, Ys as PriceSource, Yt as CryptoReferencePriceResult, Z as snapshotToOrderbook, Za as WsHeartbeat, Zc as getEffectiveDisabledVenues, Zi as ValidateManagedResponse, Zn as OPTIONAL_SIGNATURE_TIMEOUT_MS, Zo as formatMarketQuestion, Zr as RecurringCryptoWindowMarket, Zs as ProphetxExecutionMode, Zt as CryptoReferencePriceTarget, _ as HostedVenueFundingIntent, _a as WithdrawalSourceStatus, _c as VenueEventListItem, _i as SimpleOrderbookLevel, _n as ExecutionStatusQuery, _o as WsWithdrawalLifecycleLeg, _r as PaperTradingMarkSource, _s as AuthUser, _t as AppClientConfigResponse, a as BookWatchdogOptions, aa as WithdrawManagedResponse, ac as TradeSplit, ai as ResolveCorrelatedMarketsParams, an as ExecuteManagedParams, ao as WsRedeemEvent, ar as OrderbookServiceUnavailableError, as as HostedVenueDepositAddress, at as AggAuthVerifyBody, b as prepareHostedVenueRoute, ba as CatalogChangesPage, bc as VenueKeySummary, bi as SmartRouteCustodyWarning, bn as GetCryptoReferencePricesOptions, bo as projectedOrderbookChecksum, br as PaperTradingPortfolio, bs as ComputeSplitsRequest, bt as BalanceCustody, c as CandleTail, ca as WithdrawPreviewResponse, cc as UpdateUserBody, ci as RpcTokenResponse, cn as ExecutionDisplayGroupStatus, co as WsStreamInterrupted, cr as OutcomeOrderbookResponse, cs as ProvisionHostedVenueAccountBody, ct as AggClientOptions, d as MarketView, da as WithdrawalLeg, dc as UserProfile, di as SearchParams, dn as ExecutionOrderItem, do as WsUnsubscribed, dr as PaperTradingAccountsPage, ds as Account, dt as AggLinkAccountConfirmResult, ea as VenueMarketRef, ec as SettlementDifference, ei as RedeemRequest, el as isVenueInactive, en as DepositAddressesReadyResponse, eo as WsOrderEvent, er as OrderbookBatchItemErrorCode, es as HostedVenueAccount, et as AggAuthDeliveryMode, f as MarketViewBatch, fa as WithdrawalLegStatus, fc as ValidateBalanceOnClientStep, fi as SearchResponse, fn as ExecutionOrdersQuery, fo as WsVenueBook, fr as PaperTradingAppOptions, fs as App, ft as AggLinkAccountResult, g as lighterOrderDisclosure, ga as WithdrawalQuoteResponse, gc as VenueEvent, gi as SignerFn, gn as ExecutionStatusOrder, go as WsWithdrawalLifecycleEvent, gr as PaperTradingListParams, gs as AuthTokenResponse, gt as AggregatedOrderbookResponse, h as NATIVE_NETTING_SELLS_MAY_OPEN_OPPOSITE_EXPOSURE, ha as WithdrawalQuoteParams, hc as ValidateTradeResponse, hi as SignatureRequestType, hn as ExecutionPositionsQuery, ho as WsWithdrawalLegStatus, hr as PaperTradingLiquidityStatus, hs as AuthCodeResponse, ht as AggregatedOrderbookLevel, i as AggWebSocketOptions, ia as WithdrawManagedParams, ic as SyncBalancesResponse, ii as ResetPaperTradingAccountParams, in as EventBootstrapResponse, io as WsOrderbookSnapshot, ir as OrderbookQuoteResponse, is as HostedVenueBalance, it as AggAuthStartResult, j as AggApiErrorInit, ja as CatalogFilter, jc as WithdrawalSourceItem, ji as SportsGameStatus, jn as ListRecurringCryptoMarketsOptions, jo as sortVenues, jr as RampSessionRequest, js as GetHoldingsResponse, jt as ChartBarsResponse, k as CandleInterval, ka as CatalogEntity, kc as WithdrawManagedRequest, ki as SmartRouteStatus, kn as LeaderboardStats, ko as BuildVenueUrlOpts, kr as RampQuote, ks as GetBalanceResponse, kt as CancelVenueOrderParams, l as HistoryRangeRequest, la as WithdrawTokenSymbol, lc as UpsertVenueKey, li as SELF_CUSTODY_FILL_TIMEOUT_MS, ln as ExecutionDisplayStepKind, lo as WsSubscribed, lr as PaginatedResponse, ls as QuoteError, lt as AggClientSessionInput, m as LIGHTER_REDUCE_ONLY, ma as WithdrawalLifecycleStatus, mc as ValidateTradeRequest, mi as SignatureRequest, mn as ExecutionPositionGroup, mo as WsVenueLevel, mr as PaperTradingBalanceResponse, ms as AttributedOrderbookLevel, mt as AggSessionUser, n as AggWebSocketCallbacks, na as VenuePriceInfo, nc as SetupDepositAddressStep, ni as RedeemSelfCustodyParams, nn as DepositAddressesSupportedChain, no as WsOrderSubmitted, nr as OrderbookQuoteFill, ns as HostedVenueActivityCode, nt as AggAuthProviderType, o as CatalogSubscribeOptions, oa as WithdrawManagedSourceItem, oc as TradeStep, oi as ResolveCorrelatedMarketsResponse, on as ExecuteManagedResponse, oo as WsResumed, or as OrderbooksOnlyError, os as HostedVenueWithdrawal, ot as AggAuthWalletVerifyBody, p as createAggClient, pa as WithdrawalLegType, pc as ValidateManagedRequest, pi as SetPaperTradingBalanceParams, pn as ExecutionOverallState, po as WsVenueInfo, pr as PaperTradingBalanceAdjustment, ps as AttributedOrderbook, pt as AggLinkAccountWalletConfirmBody, q as OrderbookState, qa as WsClientMessage, qc as INACTIVE_VENUES, qi as UserActivityType, qn as NewsFeedMarketNewsResult, qo as parseEmail, qr as RecurringCryptoResolution, qs as PositionGroup, qt as CryptoReferencePriceExternalMarketInput, r as AggWebSocketDiagnostics, ra as VenueSoloQuote, rc as SetupVenueKeyStep, ri as RequestedOrderbookMarket, rn as DepositAddressesToken, ro as WsOrderbookDelta, rr as OrderbookQuoteParams, rs as HostedVenueActivityQuery, rt as AggAuthStartBody, s as OrderbookLatency, sa as WithdrawPreviewParams, sc as UnifiedBalanceResponse, si as ResolvedCorrelatedMarketsResponse, sn as ExecutionDagProgress, so as WsServerMessage, sr as OutcomeMidpointRow, ss as HostedVenueWithdrawalRequest, st as AggClientAuthOptions, t as AggWebSocket, ta as VenueOrderbookEntry, tc as SettlementSource, ti as RedeemResponse, tn as DepositAddressesResponse, to as WsOrderEventType, tr as OrderbookBatchItemStatus, ts as HostedVenueActivity, tt as AggAuthPrivyVerifyBody, ua as WithdrawalExpected, uc as UserHolding, ui as SELF_CUSTODY_POLL_INTERVAL_MS, un as ExecutionMode, uo as WsTrade, ur as PaperTradingAccount, us as QuoteErrorCode, ut as AggLinkAccountBody, v as HostedVenueFundingOptions, va as WithdrawalSourceTokenSymbol, vc as VenueEventWithMarkets, vi as SmartRouteAllocation, vn as ExecutionStatusResponse, vo as WsWithdrawalLifecycleStatus, vr as PaperTradingOrder, vs as BookQuality, vt as AppTradingMode, w as mergeCandles, wa as isCatalogResyncRequired, wc as VenuePositionBalance, wi as SmartRouteResponse, wn as LeaderboardQuery, wo as isBalanceRefillWithinDailyCap, wr as PlaceLimitOrderParams, ws as DepositStep, wt as BalanceRefillPolicyStatus, x as LoadImmutableHistoryOptions, xa as CatalogWatchHandle, xc as VenueMarket, xi as SmartRouteFeeBreakdown, xn as GetOrdersParams, xo as DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, xr as PaperTradingPosition, xs as ComputeSplitsResponse, xt as BalanceRefillAttempt, y as prepareHostedVenueFunding, ya as CATALOG_DEFAULT_OVERLAP_MS, yc as VenueKeyStatus, yi as SmartRouteBridgeStep, yn as ExecutionStatusStep, yo as orderbookCrc32, yr as PaperTradingOrdersPage, ys as Category, yt as AuthStatus, z as isPolymarketOrderSignatureStep, za as WsArbMarketUpdate, zc as MatchType, zi as UpdateBalanceRefillPolicyParams, zn as NewsFeedArticleWithSummary, zo as SafeParseSuccess, zr as RecurringCryptoMarketMetrics, zs as MidpointItem, zt as CorrelatedMarketSide } from "./agg-websocket-BRWnvGwU.js";
|
|
2
|
+
export { ACTIVE_VENUES, Account, AccountProvider, AccountType, AggApiError, type AggApiErrorInit, type AggApiFieldError, type AggAuthDeliveryMode, type AggAuthPrivyVerifyBody, type AggAuthProviderType, type AggAuthStartBody, type AggAuthStartResult, type AggAuthVerifyBody, type AggAuthWalletVerifyBody, AggClient, type AggClientAuthOptions, type AggClientOptions, type AggClientSessionInput, type AggLinkAccountBody, type AggLinkAccountConfirmResult, type AggLinkAccountResult, type AggLinkAccountWalletConfirmBody, type AggRateLimitResponse, type AggSessionUser, AggWebSocket, type AggWebSocketCallbacks, type AggWebSocketDiagnostics, type AggWebSocketOptions, type AggregatedOrderbookLevel, type AggregatedOrderbookResponse, App, type AppClientConfigResponse, type AppTradingMode, AttributedOrderbook, AttributedOrderbookLevel, AuthCodeResponse, type AuthStatus, AuthTokenResponse, AuthUser, type BalanceCustody, type BalanceRefillAttempt, type BalanceRefillAttemptStatus, type BalanceRefillPolicy, type BalanceRefillPolicyStatus, type BatchMidpointsResponse, type BatchOrderbooksResponse, BookQuality, type BookWatchdogOptions, type BuildVenueUrlOpts, CATALOG_DEFAULT_OVERLAP_MS, CONFIRMED_MATCH_STATUSES, type CancelManagedExecutionResponse, type CancelOrderSignature, type CancelVenueOrderParams, type Candle, CandleBuilder, type CandleInterval, type CandleTail, type CatalogCategoryRef, type CatalogChange, type CatalogChangeOp, type CatalogChangesPage, type CatalogClusterFields, type CatalogEntity, type CatalogEventSnapshot, type CatalogFilter, type CatalogMarketSnapshot, type CatalogOutcomeRef, type CatalogSubscribeOptions, type CatalogWatchHandle, Category, Chain, type ChartBarsMeta, type ChartBarsResponse, type ChartCandle, type ChartHistoryManifest, type ChartResolution, type ChartVenueCandles, ComputeSplitsRequest, ComputeSplitsResponse, ComputeSplitsSelection, type CorrelatedMarketCascadeItem, type CorrelatedMarketCascadeResponse, type CorrelatedMarketQueryResult, type CorrelatedMarketSide, type CorrelatedMarketSignal, type CorrelatedMarketSignalBatch, type CorrelatedMarketSignalDirection, type CorrelatedMarketsStatus, CreateApp, type CreateBalanceRefillPolicyParams, type CreatePaperTradingAccountParams, type CryptoReferencePriceError, type CryptoReferencePriceExternalMarketInput, type CryptoReferencePriceMarketInput, type CryptoReferencePriceResult, type CryptoReferencePriceSource, type CryptoReferencePriceTarget, type CryptoReferencePricesResponse, DEFAULT_BALANCE_REFILL_DAILY_CAP_RAW, DEFAULT_BALANCE_REFILL_MAX_FEE_RAW, DepositAddressesPendingResponse, DepositAddressesReadyResponse, type DepositAddressesResponse, DepositAddressesSupportedChain, type DepositAddressesToken, DepositStep, type DiagnosticCallback, type DiagnosticEvent, type EventBootstrapResponse, type ExecuteManagedParams, ExecuteManagedRequest, ExecuteManagedResponse, ExecuteTradeRequest, ExecuteTradeResponse, type ExecutionDagProgress, type ExecutionDisplayGroupStatus, type ExecutionDisplayStepKind, type ExecutionMode, type ExecutionOrderItem, type ExecutionOrdersQuery, type ExecutionOverallState, type ExecutionPositionGroup, type ExecutionPositionsQuery, type ExecutionStatusOrder, type ExecutionStatusQuery, type ExecutionStatusResponse, type ExecutionStatusStep, GetBalanceQuery, GetBalanceResponse, type GetCatalogChangesParams, type GetCryptoReferencePricesOptions, GetHoldingsQuery, GetHoldingsResponse, type GetOrdersParams, GetOrdersQuery, type GetPositionsParams, GetPositionsQuery, HelloResponse, type HistoryRangeRequest, type HostedVenueAccount, type HostedVenueActivity, type HostedVenueActivityCode, type HostedVenueActivityQuery, type HostedVenueBalance, type HostedVenueDepositAddress, type HostedVenueFundingIntent, type HostedVenueFundingOptions, type HostedVenueWithdrawal, type HostedVenueWithdrawalRequest, IMAGE_SIZES, INACTIVE_VENUES, ImageSize, LIGHTER_REDUCE_ONLY, LIMIT_PRICE_RAW_SCALE, type LeaderboardMetric, type LeaderboardQuery, type LeaderboardRow, type LeaderboardSeries, type LeaderboardSeriesPoint, type LeaderboardSeriesQuery, type LeaderboardStats, type LimitOrderTimeInForce, type LimitPriceSide, type LimitPriceTickAdjustment, type ListRecurringCryptoMarketsOptions, type LoadImmutableHistoryOptions, type ManagedBalancesParams, type ManagedBalancesResponse, type MarkSource, MarketPriceHistory, MarketStatus, type MarketView, type MarketViewBatch, MatchStatus, MatchType, MatchedMidpoint, MatchedMidpointOutcome, type MatchedOrderbookMarket, MatchedVenueMarketOutcomeRef, MidpointItem, type MidpointRow, NATIVE_NETTING_SELLS_MAY_OPEN_OPPOSITE_EXPOSURE, type NewsFeedArticleFeedItem, type NewsFeedArticleFeedResponse, type NewsFeedArticleWithSummary, type NewsFeedLinkedMarket, type NewsFeedListResponse, type NewsFeedMarketFeedArticle, type NewsFeedMarketFeedItem, type NewsFeedMarketFeedResponse, type NewsFeedMarketNewsParams, type NewsFeedMarketNewsResponse, type NewsFeedMarketNewsResult, type NewsFeedPageOptions, type NewsFeedStatusResponse, NonceResponse, NovigExecutionMode, OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS, OPTIONAL_SIGNATURE_TIMEOUT_MS, OrderListItem, type OrderListQuery, OrderStatus, OrderType, Orderbook, type OrderbookBatchItemError, type OrderbookBatchItemErrorCode, type OrderbookBatchItemStatus, OrderbookHistoryPoint, OrderbookHistoryResponse, type OrderbookLatency, OrderbookLevel, type OrderbookQuoteFill, type OrderbookQuoteParams, type OrderbookQuoteResponse, type OrderbookServiceUnavailableError, type OrderbookState, type OrderbooksOnlyError, OutcomeMidpoint, type OutcomeMidpointRow, type OutcomeOrderbookResponse, type PaginatedResponse, type PaperTradingAccount, type PaperTradingAccountsPage, type PaperTradingAppOptions, type PaperTradingBalanceAdjustment, type PaperTradingBalanceResponse, type PaperTradingLiquidityStatus, type PaperTradingListParams, type PaperTradingMarkSource, type PaperTradingOrder, type PaperTradingOrdersPage, type PaperTradingPortfolio, type PaperTradingPosition, type PaperTradingPositionsPage, type PersistedAuthSnapshot, type PlaceLimitOrderParams, type PlaceLimitOrderResponse, type PlacePaperTradingOrderParams, PositionGroup, type PositionRedeemStatus, PricePoint, PriceSource, PricesHistoryResponse, ProphetxExecutionMode, type ProvisionHostedVenueAccountBody, type QuoteError, type QuoteErrorCode, RECURRENCE_CADENCES, RETINA_IMAGE_SIZES, type RampQuote, type RampQuoteRequest, type RampSessionRequest, type RampWidgetSession, type RecurrenceCadence, type RecurrenceFilter, type RecurringCryptoComparisonPoint, type RecurringCryptoComparisonPriceSource, type RecurringCryptoDuration, type RecurringCryptoDurationInput, type RecurringCryptoMarketMetrics, type RecurringCryptoMarketsResponse, type RecurringCryptoOrderbookDepthLevel, type RecurringCryptoOrderbookDepthSide, type RecurringCryptoOutcome, type RecurringCryptoOutcomeOrderbookDepth, type RecurringCryptoPriceComparison, type RecurringCryptoReferencePrice, type RecurringCryptoResolution, type RecurringCryptoSourceConfidence, type RecurringCryptoVenueMarket, type RecurringCryptoWindowComparisons, type RecurringCryptoWindowMarket, type RedeemLegResult, type RedeemLegStatus, type RedeemRequest, type RedeemResponse, type RedeemSelfCustodyParams, type RequestedOrderbookMarket, type ResetPaperTradingAccountParams, type ResolveCorrelatedMarketsParams, type ResolveCorrelatedMarketsResponse, type ResolvedCorrelatedMarketsResponse, type RpcTokenResponse, SELF_CUSTODY_FILL_TIMEOUT_MS, SELF_CUSTODY_POLL_INTERVAL_MS, type SafeParseFailure, type SafeParseResult, type SafeParseSuccess, type SearchParams, type SearchResponse, ServerWallet, type SetPaperTradingBalanceParams, SettlementDiff, SettlementDifference, SettlementSource, SetupDepositAddressStep, SetupVenueKeyStep, type SignatureRequest, type SignatureRequestType, type SignerFn, type SimpleOrderbookLevel, type SmartRouteAllocation, type SmartRouteBridgeStep, type SmartRouteCustodyWarning, type SmartRouteFeeBreakdown, type SmartRouteFill, type SmartRouteParams, type SmartRouteResponse, type SmartRouteSettlementLeg, type SmartRouteSettlementPlan, type SmartRouteSetupCostLine, type SmartRouteSide, type SmartRouteStatus, type SmartRouteVenueFill, type SplitsByAmountResult, type SportsGameStatus, type SportsLiveParticipant, type SportsLiveResponse, type SportsLiveState, type SubmitSignature, SyncBalancesResponse, TERMINAL_EXECUTION_STATES, TimeInForce, type TradeExecutorOrder, type TradeExecutorOrderListResponse, TradeSide, TradeSplit, TradeStep, TurnstileChallengeError, UnifiedBalanceResponse, type UpdateBalanceRefillPolicyParams, UpdateUserBody, UpsertVenueKey, type UserActivityBridge, type UserActivityDeposit, type UserActivityItem, type UserActivityQuery, type UserActivityRedeem, type UserActivityRedeemLeg, type UserActivityTrade, type UserActivityType, type UserActivityUserOp, type UserActivityWithdrawal, UserHolding, UserProfile, VENUES, VENUE_CHAIN_IDS, ValidateBalanceOnClientStep, type ValidateManagedParams, ValidateManagedRequest, ValidateManagedResponse, ValidateTradeRequest, ValidateTradeResponse, Venue, VenueEvent, VenueEventListItem, VenueEventWithMarkets, type VenueGeoPolicyEntry, type VenueGeoPolicyResponse, VenueKeyStatus, VenueKeySummary, VenueMarket, type VenueMarketClusterNode, VenueMarketListItem, VenueMarketOutcome, type VenueMarketRef, type VenueOrderbookEntry, type VenueOrderbookLevel, VenuePositionBalance, type VenuePriceInfo, type VenueSoloQuote, VerifyBody, VerifyResponse, WalletChainBalance, WalletTokenBalance, type WatchCatalogOptions, type WithdrawManagedParams, WithdrawManagedRequest, WithdrawManagedResponse, type WithdrawManagedSourceItem, type WithdrawPreviewParams, type WithdrawPreviewResponse, WithdrawTokenSymbol, WithdrawalExpected, WithdrawalLeg, WithdrawalLegStatus, WithdrawalLegType, WithdrawalLifecycleStatus, type WithdrawalQuoteParams, type WithdrawalQuoteResponse, WithdrawalSource, WithdrawalSourceItem, WithdrawalSourceStatus, WithdrawalSourceTokenSymbol, type WsAppEvent, type WsArbFeedBatch, type WsArbFeedEntry, type WsArbMarketUpdate, type WsAttributedLevel, type WsAuthExpired, type WsAuthExpiring, type WsAuthenticated, type WsBalanceUpdate, type WsCandleInterval, type WsCatalogChange, type WsClientMessage, type WsConnected, type WsError, type WsErrorCode, type WsHeartbeat, type WsMarkSource, type WsMarketResolved, type WsOrderEvent, type WsOrderEventType, type WsOrderSubmitted, type WsOrderbookDelta, type WsOrderbookSnapshot, type WsRedeemEvent, type WsResumed, type WsServerMessage, type WsStreamInterrupted, type WsSubscribed, type WsTrade, type WsUnsubscribed, type WsVenueBook, type WsVenueInfo, type WsVenueLevel, type WsWithdrawalLegStatus, type WsWithdrawalLifecycleEvent, type WsWithdrawalLifecycleLeg, type WsWithdrawalLifecycleStatus, adjustLimitPriceRawToTick, aggregateMidpoint, applyOrderbookDelta, areOrdersFilled, buildVenueUrl, computeBestSplitsByAmount, computeChecksum, createAggClient, enumGuard, formatMarketQuestion, formatOutcomeLabel, formatOutcomeTitle, getBalanceRefillMaximumRaw, getEffectiveDisabledVenues, getWalletAddressFromUserProfile, hasShape, isAggApiError, isBalanceRefillWithinDailyCap, isCatalogResyncRequired, isEmail, isEnum, isFiniteNonNeg, isNonEmptyString, isOptionalFeeRequest, isOrderSignatureStep, isPolymarketOrderSignatureStep, isPostFillFeeRequest, isSameWalletAddress, isVenueActive, isVenueDataVisible, isVenueInactive, lighterOrderDisclosure, loadImmutableHistory, mergeCandles, mergeClosedCandles, normalizeVenueMarketCluster, optimizedImageUrl, orderSignatureRound, orderbookCrc32, parse, parseEmail, parseEmailStrict, prepareHostedVenueFunding, prepareHostedVenueRoute, projectedOrderbookChecksum, retinaImageUrl, safeParse, signatureTimeoutMs, snapshotToOrderbook, sortVenues, toChecksumAddress, userSignerAddresses, withTimeout };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_agg_websocket = require("./agg-websocket-
|
|
2
|
+
const require_agg_websocket = require("./agg-websocket-Cq4E0T0f.js");
|
|
3
3
|
const require_candle_builder = require("./candle-builder-BULYdxB4.js");
|
|
4
4
|
//#region ../common/src/enums/venue.ts
|
|
5
5
|
/** Use these constants instead of hardcoding "kalshi" or "polymarket". */
|
|
@@ -17,6 +17,7 @@ let Venue = /* @__PURE__ */ function(Venue) {
|
|
|
17
17
|
Venue["novig"] = "novig";
|
|
18
18
|
Venue["prophetx"] = "prophetx";
|
|
19
19
|
Venue["betdex"] = "betdex";
|
|
20
|
+
Venue["lighter"] = "lighter";
|
|
20
21
|
return Venue;
|
|
21
22
|
}({});
|
|
22
23
|
/** Single source of truth for venue identifiers. */
|
|
@@ -33,9 +34,12 @@ const VENUES = [
|
|
|
33
34
|
"hyperliquid",
|
|
34
35
|
"novig",
|
|
35
36
|
"prophetx",
|
|
36
|
-
"betdex"
|
|
37
|
+
"betdex",
|
|
38
|
+
"lighter"
|
|
37
39
|
];
|
|
38
|
-
/** Canonical destination chain for venues with on-chain funding or settlement.
|
|
40
|
+
/** Canonical destination chain for venues with on-chain funding or settlement.
|
|
41
|
+
* Lighter is absent: signing chain 304 and Relay funding chain 3586256 are
|
|
42
|
+
* different identities, so one map entry would pick the wrong rail. */
|
|
39
43
|
const VENUE_CHAIN_IDS = {
|
|
40
44
|
["kalshi"]: 792703809,
|
|
41
45
|
["polymarket"]: 137,
|
|
@@ -69,7 +73,8 @@ const ACTIVE_VENUES = [
|
|
|
69
73
|
"hyperliquid",
|
|
70
74
|
"novig",
|
|
71
75
|
"prophetx",
|
|
72
|
-
"betdex"
|
|
76
|
+
"betdex",
|
|
77
|
+
"lighter"
|
|
73
78
|
];
|
|
74
79
|
/**
|
|
75
80
|
* Venues excluded from new user-facing activity. BETDEX is active at the
|
|
@@ -97,7 +102,8 @@ const DEFAULT_DISABLED_VENUES = [
|
|
|
97
102
|
"tiprun",
|
|
98
103
|
"novig",
|
|
99
104
|
"prophetx",
|
|
100
|
-
"betdex"
|
|
105
|
+
"betdex",
|
|
106
|
+
"lighter"
|
|
101
107
|
];
|
|
102
108
|
const ACTIVE_VENUE_SET = new Set(ACTIVE_VENUES);
|
|
103
109
|
const INACTIVE_VENUE_SET = new Set(INACTIVE_VENUES);
|
|
@@ -677,6 +683,7 @@ const VENUE_SORT_ORDER = [
|
|
|
677
683
|
"predict",
|
|
678
684
|
"prophetx",
|
|
679
685
|
"betdex",
|
|
686
|
+
"lighter",
|
|
680
687
|
"kalshi",
|
|
681
688
|
"limitless",
|
|
682
689
|
"myriad",
|
|
@@ -1598,6 +1605,8 @@ var AggClient = class {
|
|
|
1598
1605
|
this.signer = options.signer;
|
|
1599
1606
|
this.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
1600
1607
|
this.wsUrl = options.wsUrl;
|
|
1608
|
+
this.orderbookUrl = options.orderbookUrl;
|
|
1609
|
+
this.orderbookLatency = options.orderbookLatency;
|
|
1601
1610
|
this.preferImmutableHistory = options.preferImmutableHistory ?? false;
|
|
1602
1611
|
this.webSocketFactory = options.webSocketFactory;
|
|
1603
1612
|
this.authOptions = options.auth;
|
|
@@ -2201,14 +2210,16 @@ var AggClient = class {
|
|
|
2201
2210
|
/**
|
|
2202
2211
|
* One user's (or, with no user, the whole app's) leaderboard stats per UTC
|
|
2203
2212
|
* day (default the last 30 days, at most 366) with a running cumulative
|
|
2204
|
-
* realized P&L, optionally for a single category.
|
|
2205
|
-
*
|
|
2213
|
+
* realized P&L, optionally for a single category. `interval: "hour"` gives
|
|
2214
|
+
* one user's stats per hour over a timestamp window (needs `apiKey`). Gross
|
|
2215
|
+
* of fees; unrealized P&L is not included.
|
|
2206
2216
|
*/
|
|
2207
2217
|
async getLeaderboardSeries(params) {
|
|
2208
2218
|
const query = {};
|
|
2209
2219
|
for (const key of [
|
|
2210
2220
|
"from",
|
|
2211
2221
|
"to",
|
|
2222
|
+
"interval",
|
|
2212
2223
|
"userId",
|
|
2213
2224
|
"externalId",
|
|
2214
2225
|
"username",
|
|
@@ -2850,14 +2861,20 @@ var AggClient = class {
|
|
|
2850
2861
|
* browser Origin check). Never in a browser: browsers cannot set handshake
|
|
2851
2862
|
* headers, and keys must not ship there.
|
|
2852
2863
|
*/
|
|
2864
|
+
withAppId(raw) {
|
|
2865
|
+
const url = new URL(raw);
|
|
2866
|
+
if (this._appId) url.searchParams.set("appId", this._appId);
|
|
2867
|
+
return url.toString();
|
|
2868
|
+
}
|
|
2853
2869
|
webSocketOptions(webSocketImpl) {
|
|
2854
2870
|
if (!this.wsUrl) throw new Error("AggClient WebSockets require wsUrl to be set in client options");
|
|
2855
|
-
const url = new URL(this.wsUrl);
|
|
2856
|
-
if (this._appId) url.searchParams.set("appId", this._appId);
|
|
2857
2871
|
const isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
2858
2872
|
const headers = this.apiKey && !isBrowser ? { "x-app-api-key": this.apiKey } : void 0;
|
|
2873
|
+
const orderbookUrl = this.orderbookUrl ? this.withAppId(this.orderbookUrl) : void 0;
|
|
2859
2874
|
return {
|
|
2860
|
-
url:
|
|
2875
|
+
url: this.withAppId(this.wsUrl),
|
|
2876
|
+
...orderbookUrl ? { orderbookUrl } : {},
|
|
2877
|
+
...this.orderbookLatency ? { orderbookLatency: this.orderbookLatency } : {},
|
|
2861
2878
|
...headers ? { headers } : {},
|
|
2862
2879
|
...webSocketImpl ? { webSocketImpl } : {}
|
|
2863
2880
|
};
|
|
@@ -2875,6 +2892,8 @@ var AggClient = class {
|
|
|
2875
2892
|
if (this.apiKey) watchdogHeaders["x-app-api-key"] = this.apiKey;
|
|
2876
2893
|
const socket = createSocket({
|
|
2877
2894
|
...this.webSocketOptions(options?.webSocketImpl),
|
|
2895
|
+
...options?.orderbookUrl ? { orderbookUrl: this.withAppId(options.orderbookUrl) } : {},
|
|
2896
|
+
...options?.orderbookLatency ? { orderbookLatency: options.orderbookLatency } : {},
|
|
2878
2897
|
callbacks,
|
|
2879
2898
|
initialToken: this.accessToken,
|
|
2880
2899
|
enableLogs: options?.enableLogs ?? false,
|
|
@@ -3549,6 +3568,25 @@ async function prepareHostedVenueRoute(client, options) {
|
|
|
3549
3568
|
return quote;
|
|
3550
3569
|
}
|
|
3551
3570
|
//#endregion
|
|
3571
|
+
//#region src/lighter-netting.ts
|
|
3572
|
+
/**
|
|
3573
|
+
* Lighter native netting. A sell may close current exposure and then open
|
|
3574
|
+
* the opposite side, including market and immediate-or-cancel orders.
|
|
3575
|
+
* Reduce-only stays 0. This is not a close-only guarantee.
|
|
3576
|
+
*/
|
|
3577
|
+
const NATIVE_NETTING_SELLS_MAY_OPEN_OPPOSITE_EXPOSURE = true;
|
|
3578
|
+
const LIGHTER_REDUCE_ONLY = 0;
|
|
3579
|
+
const LIGHTER_ORDER_DISCLOSURE_TEXT = "A sell can close current exposure and then open the opposite side. Opposite exposure can follow a sell, including market and immediate-or-cancel orders. Lighter does not offer a close-only guarantee.";
|
|
3580
|
+
function lighterOrderDisclosure() {
|
|
3581
|
+
return {
|
|
3582
|
+
nativeNetting: true,
|
|
3583
|
+
sellsMayOpenOppositeExposure: true,
|
|
3584
|
+
closeOnly: false,
|
|
3585
|
+
reduceOnly: 0,
|
|
3586
|
+
text: LIGHTER_ORDER_DISCLOSURE_TEXT
|
|
3587
|
+
};
|
|
3588
|
+
}
|
|
3589
|
+
//#endregion
|
|
3552
3590
|
//#region src/index.ts
|
|
3553
3591
|
function createAggClient(options) {
|
|
3554
3592
|
return new AggClient(options);
|
|
@@ -3569,10 +3607,12 @@ exports.DEFAULT_BALANCE_REFILL_MAX_FEE_RAW = DEFAULT_BALANCE_REFILL_MAX_FEE_RAW;
|
|
|
3569
3607
|
exports.IMAGE_SIZES = IMAGE_SIZES;
|
|
3570
3608
|
exports.INACTIVE_VENUES = INACTIVE_VENUES;
|
|
3571
3609
|
exports.ImageSize = ImageSize;
|
|
3610
|
+
exports.LIGHTER_REDUCE_ONLY = LIGHTER_REDUCE_ONLY;
|
|
3572
3611
|
exports.LIMIT_PRICE_RAW_SCALE = LIMIT_PRICE_RAW_SCALE;
|
|
3573
3612
|
exports.MarketStatus = MarketStatus;
|
|
3574
3613
|
exports.MatchStatus = MatchStatus;
|
|
3575
3614
|
exports.MatchType = MatchType;
|
|
3615
|
+
exports.NATIVE_NETTING_SELLS_MAY_OPEN_OPPOSITE_EXPOSURE = NATIVE_NETTING_SELLS_MAY_OPEN_OPPOSITE_EXPOSURE;
|
|
3576
3616
|
exports.OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS = OPTIONAL_FEE_SIGNATURE_TIMEOUT_MS;
|
|
3577
3617
|
exports.OPTIONAL_SIGNATURE_TIMEOUT_MS = OPTIONAL_SIGNATURE_TIMEOUT_MS;
|
|
3578
3618
|
exports.OrderStatus = OrderStatus;
|
|
@@ -3619,6 +3659,7 @@ exports.isSameWalletAddress = isSameWalletAddress;
|
|
|
3619
3659
|
exports.isVenueActive = isVenueActive;
|
|
3620
3660
|
exports.isVenueDataVisible = isVenueDataVisible;
|
|
3621
3661
|
exports.isVenueInactive = isVenueInactive;
|
|
3662
|
+
exports.lighterOrderDisclosure = lighterOrderDisclosure;
|
|
3622
3663
|
exports.loadImmutableHistory = require_agg_websocket.loadImmutableHistory;
|
|
3623
3664
|
exports.mergeCandles = mergeCandles;
|
|
3624
3665
|
exports.mergeClosedCandles = mergeClosedCandles;
|