pmxt-core 2.38.0 → 2.39.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.
Files changed (47) hide show
  1. package/dist/BaseExchange.d.ts +14 -14
  2. package/dist/BaseExchange.js +19 -19
  3. package/dist/exchanges/baozi/index.d.ts +2 -2
  4. package/dist/exchanges/baozi/index.js +5 -5
  5. package/dist/exchanges/kalshi/api.d.ts +1 -1
  6. package/dist/exchanges/kalshi/api.js +1 -1
  7. package/dist/exchanges/kalshi/index.d.ts +6 -6
  8. package/dist/exchanges/kalshi/index.js +14 -14
  9. package/dist/exchanges/limitless/api.d.ts +1 -1
  10. package/dist/exchanges/limitless/api.js +1 -1
  11. package/dist/exchanges/limitless/index.d.ts +5 -5
  12. package/dist/exchanges/limitless/index.js +15 -12
  13. package/dist/exchanges/myriad/api.d.ts +1 -1
  14. package/dist/exchanges/myriad/api.js +1 -1
  15. package/dist/exchanges/myriad/index.d.ts +5 -5
  16. package/dist/exchanges/myriad/index.js +14 -14
  17. package/dist/exchanges/myriad/websocket.d.ts +2 -2
  18. package/dist/exchanges/myriad/websocket.js +12 -12
  19. package/dist/exchanges/opinion/api.d.ts +1 -1
  20. package/dist/exchanges/opinion/api.js +1 -1
  21. package/dist/exchanges/opinion/index.d.ts +4 -4
  22. package/dist/exchanges/opinion/index.js +9 -9
  23. package/dist/exchanges/polymarket/api-clob.d.ts +1 -1
  24. package/dist/exchanges/polymarket/api-clob.js +1 -1
  25. package/dist/exchanges/polymarket/api-data.d.ts +1 -1
  26. package/dist/exchanges/polymarket/api-data.js +1 -1
  27. package/dist/exchanges/polymarket/api-gamma.d.ts +1 -1
  28. package/dist/exchanges/polymarket/api-gamma.js +1 -1
  29. package/dist/exchanges/polymarket/index.d.ts +6 -6
  30. package/dist/exchanges/polymarket/index.js +19 -19
  31. package/dist/exchanges/polymarket/websocket.d.ts +3 -3
  32. package/dist/exchanges/polymarket/websocket.js +21 -21
  33. package/dist/exchanges/polymarket_us/index.d.ts +3 -3
  34. package/dist/exchanges/polymarket_us/index.js +7 -7
  35. package/dist/exchanges/polymarket_us/websocket.d.ts +2 -2
  36. package/dist/exchanges/polymarket_us/websocket.js +6 -6
  37. package/dist/exchanges/probable/api.d.ts +1 -1
  38. package/dist/exchanges/probable/api.js +1 -1
  39. package/dist/exchanges/probable/index.d.ts +4 -4
  40. package/dist/exchanges/probable/index.js +9 -9
  41. package/dist/exchanges/smarkets/index.d.ts +2 -2
  42. package/dist/exchanges/smarkets/index.js +5 -5
  43. package/dist/router/Router.d.ts +1 -1
  44. package/dist/router/Router.js +3 -3
  45. package/dist/server/method-verbs.json +7 -7
  46. package/dist/server/openapi.yaml +3 -3
  47. package/package.json +3 -3
@@ -449,7 +449,7 @@ export declare abstract class PredictionMarketExchange {
449
449
  /**
450
450
  * Fetch historical OHLCV (candlestick) price data for a specific market outcome.
451
451
  *
452
- * @param id - The Outcome ID (outcomeId). Use outcome.outcomeId, NOT market.marketId
452
+ * @param outcomeId - The Outcome ID (outcomeId). Use outcome.outcomeId, NOT market.marketId
453
453
  * @param params - OHLCV parameters including resolution (required)
454
454
  * @returns Array of price candles
455
455
  *
@@ -457,29 +457,29 @@ export declare abstract class PredictionMarketExchange {
457
457
  * @notes Polymarket: outcomeId is the CLOB Token ID. Kalshi: outcomeId is the Market Ticker.
458
458
  * @notes Common resolutions: '1m' | '5m' | '15m' | '1h' | '6h' | '1d'. Arbitrary intervals (e.g. '30s', '120s', '3h') accepted by venues that support them.
459
459
  */
460
- fetchOHLCV(id: string, params: OHLCVParams): Promise<PriceCandle[]>;
460
+ fetchOHLCV(outcomeId: string, params: OHLCVParams): Promise<PriceCandle[]>;
461
461
  /**
462
462
  * Fetch the current order book (bids/asks) for a specific outcome.
463
463
  * Essential for calculating spread, depth, and execution prices.
464
464
  *
465
- * @param id - The Outcome ID (outcomeId) or market slug
465
+ * @param outcomeId - The Outcome ID (outcomeId) or market slug
466
466
  * @param side - Optional 'yes' or 'no' to explicitly indicate the
467
467
  * outcome side. Required for exchanges where the API returns a
468
468
  * single orderbook per market (e.g. Limitless) and the caller
469
469
  * passes a slug instead of a token ID.
470
470
  * @returns Current order book with bids and asks
471
471
  */
472
- fetchOrderBook(id: string, side?: 'yes' | 'no'): Promise<OrderBook>;
472
+ fetchOrderBook(outcomeId: string, side?: 'yes' | 'no'): Promise<OrderBook>;
473
473
  /**
474
474
  * Fetch raw trade history for a specific outcome.
475
475
  *
476
- * @param id - The Outcome ID (outcomeId)
476
+ * @param outcomeId - The Outcome ID (outcomeId)
477
477
  * @param params - Trade filter parameters
478
478
  * @returns Array of recent trades
479
479
  *
480
480
  * @notes Polymarket requires an API key for trade history. Use fetchOHLCV for public historical data.
481
481
  */
482
- fetchTrades(id: string, params: TradesParams | HistoryFilterParams): Promise<Trade[]>;
482
+ fetchTrades(outcomeId: string, params: TradesParams | HistoryFilterParams): Promise<Trade[]>;
483
483
  /**
484
484
  * Place a new order on the exchange.
485
485
  *
@@ -582,39 +582,39 @@ export declare abstract class PredictionMarketExchange {
582
582
  * Watch order book updates in real-time via WebSocket.
583
583
  * Returns a promise that resolves with the next order book update. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
584
584
  *
585
- * @param id - The Outcome ID to watch
585
+ * @param outcomeId - The Outcome ID to watch
586
586
  * @param limit - Optional limit for orderbook depth
587
587
  * @returns Promise that resolves with the current orderbook state
588
588
  */
589
- watchOrderBook(id: string, limit?: number): Promise<OrderBook>;
589
+ watchOrderBook(outcomeId: string, limit?: number): Promise<OrderBook>;
590
590
  /**
591
591
  * Watch multiple order books simultaneously via WebSocket.
592
592
  * Returns a promise that resolves with a record of order book snapshots keyed by ID.
593
593
  * Exchanges with native batch support (e.g. Kalshi) send a single subscribe message
594
594
  * for all tickers; others fall back to individual watchOrderBook calls.
595
595
  *
596
- * @param ids - Array of Outcome IDs to watch
596
+ * @param outcomeIds - Array of Outcome IDs to watch
597
597
  * @param limit - Optional limit for orderbook depth
598
598
  * @returns Promise that resolves with order books keyed by ID
599
599
  */
600
- watchOrderBooks(ids: string[], limit?: number): Promise<Record<string, OrderBook>>;
600
+ watchOrderBooks(outcomeIds: string[], limit?: number): Promise<Record<string, OrderBook>>;
601
601
  /**
602
602
  * Unsubscribe from a previously watched order book stream.
603
603
  *
604
- * @param id - The Outcome ID to stop watching
604
+ * @param outcomeId - The Outcome ID to stop watching
605
605
  */
606
- unwatchOrderBook(id: string): Promise<void>;
606
+ unwatchOrderBook(outcomeId: string): Promise<void>;
607
607
  /**
608
608
  * Watch trade executions in real-time via WebSocket.
609
609
  * Returns a promise that resolves with the next trade(s). Call repeatedly in a loop to stream updates (CCXT Pro pattern).
610
610
  *
611
- * @param id - The Outcome ID to watch
611
+ * @param outcomeId - The Outcome ID to watch
612
612
  * @param address - Public wallet address
613
613
  * @param since - Optional timestamp to filter trades from
614
614
  * @param limit - Optional limit for number of trades
615
615
  * @returns Promise that resolves with recent trades
616
616
  */
617
- watchTrades(id: string, address?: string, since?: number, limit?: number): Promise<Trade[]>;
617
+ watchTrades(outcomeId: string, address?: string, since?: number, limit?: number): Promise<Trade[]>;
618
618
  /**
619
619
  * Stream activity for a public wallet address
620
620
  * Returns a promise that resolves with the next activity snapshot whenever a change
@@ -391,7 +391,7 @@ class PredictionMarketExchange {
391
391
  /**
392
392
  * Fetch historical OHLCV (candlestick) price data for a specific market outcome.
393
393
  *
394
- * @param id - The Outcome ID (outcomeId). Use outcome.outcomeId, NOT market.marketId
394
+ * @param outcomeId - The Outcome ID (outcomeId). Use outcome.outcomeId, NOT market.marketId
395
395
  * @param params - OHLCV parameters including resolution (required)
396
396
  * @returns Array of price candles
397
397
  *
@@ -399,33 +399,33 @@ class PredictionMarketExchange {
399
399
  * @notes Polymarket: outcomeId is the CLOB Token ID. Kalshi: outcomeId is the Market Ticker.
400
400
  * @notes Common resolutions: '1m' | '5m' | '15m' | '1h' | '6h' | '1d'. Arbitrary intervals (e.g. '30s', '120s', '3h') accepted by venues that support them.
401
401
  */
402
- async fetchOHLCV(id, params) {
402
+ async fetchOHLCV(outcomeId, params) {
403
403
  throw new Error("Method fetchOHLCV not implemented.");
404
404
  }
405
405
  /**
406
406
  * Fetch the current order book (bids/asks) for a specific outcome.
407
407
  * Essential for calculating spread, depth, and execution prices.
408
408
  *
409
- * @param id - The Outcome ID (outcomeId) or market slug
409
+ * @param outcomeId - The Outcome ID (outcomeId) or market slug
410
410
  * @param side - Optional 'yes' or 'no' to explicitly indicate the
411
411
  * outcome side. Required for exchanges where the API returns a
412
412
  * single orderbook per market (e.g. Limitless) and the caller
413
413
  * passes a slug instead of a token ID.
414
414
  * @returns Current order book with bids and asks
415
415
  */
416
- async fetchOrderBook(id, side) {
416
+ async fetchOrderBook(outcomeId, side) {
417
417
  throw new Error("Method fetchOrderBook not implemented.");
418
418
  }
419
419
  /**
420
420
  * Fetch raw trade history for a specific outcome.
421
421
  *
422
- * @param id - The Outcome ID (outcomeId)
422
+ * @param outcomeId - The Outcome ID (outcomeId)
423
423
  * @param params - Trade filter parameters
424
424
  * @returns Array of recent trades
425
425
  *
426
426
  * @notes Polymarket requires an API key for trade history. Use fetchOHLCV for public historical data.
427
427
  */
428
- async fetchTrades(id, params) {
428
+ async fetchTrades(outcomeId, params) {
429
429
  // Deprecation warning for resolution parameter
430
430
  if ('resolution' in params && params.resolution !== undefined) {
431
431
  console.warn('[pmxt] Warning: The "resolution" parameter is deprecated for fetchTrades() and will be ignored. ' +
@@ -761,11 +761,11 @@ class PredictionMarketExchange {
761
761
  * Watch order book updates in real-time via WebSocket.
762
762
  * Returns a promise that resolves with the next order book update. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
763
763
  *
764
- * @param id - The Outcome ID to watch
764
+ * @param outcomeId - The Outcome ID to watch
765
765
  * @param limit - Optional limit for orderbook depth
766
766
  * @returns Promise that resolves with the current orderbook state
767
767
  */
768
- async watchOrderBook(id, limit) {
768
+ async watchOrderBook(outcomeId, limit) {
769
769
  throw new Error(`watchOrderBook() is not supported by ${this.name}`);
770
770
  }
771
771
  /**
@@ -774,30 +774,30 @@ class PredictionMarketExchange {
774
774
  * Exchanges with native batch support (e.g. Kalshi) send a single subscribe message
775
775
  * for all tickers; others fall back to individual watchOrderBook calls.
776
776
  *
777
- * @param ids - Array of Outcome IDs to watch
777
+ * @param outcomeIds - Array of Outcome IDs to watch
778
778
  * @param limit - Optional limit for orderbook depth
779
779
  * @returns Promise that resolves with order books keyed by ID
780
780
  */
781
- async watchOrderBooks(ids, limit) {
781
+ async watchOrderBooks(outcomeIds, limit) {
782
782
  // Default implementation: subscribe to each ID individually.
783
783
  // Exchanges with native batch support (e.g. Kalshi) override this
784
784
  // to send a single subscribe message for all tickers.
785
- const entries = await Promise.all(ids.map(async (id) => {
786
- const book = await this.watchOrderBook(id, limit);
787
- return [id, book];
785
+ const entries = await Promise.all(outcomeIds.map(async (oid) => {
786
+ const book = await this.watchOrderBook(oid, limit);
787
+ return [oid, book];
788
788
  }));
789
789
  const result = {};
790
- for (const [id, book] of entries) {
791
- result[id] = book;
790
+ for (const [oid, book] of entries) {
791
+ result[oid] = book;
792
792
  }
793
793
  return result;
794
794
  }
795
795
  /**
796
796
  * Unsubscribe from a previously watched order book stream.
797
797
  *
798
- * @param id - The Outcome ID to stop watching
798
+ * @param outcomeId - The Outcome ID to stop watching
799
799
  */
800
- async unwatchOrderBook(id) {
800
+ async unwatchOrderBook(outcomeId) {
801
801
  throw new Error(`unwatchOrderBook() is not supported by ${this.name}`);
802
802
  }
803
803
  // ----------------------------------------------------------------------------
@@ -807,13 +807,13 @@ class PredictionMarketExchange {
807
807
  * Watch trade executions in real-time via WebSocket.
808
808
  * Returns a promise that resolves with the next trade(s). Call repeatedly in a loop to stream updates (CCXT Pro pattern).
809
809
  *
810
- * @param id - The Outcome ID to watch
810
+ * @param outcomeId - The Outcome ID to watch
811
811
  * @param address - Public wallet address
812
812
  * @param since - Optional timestamp to filter trades from
813
813
  * @param limit - Optional limit for number of trades
814
814
  * @returns Promise that resolves with recent trades
815
815
  */
816
- async watchTrades(id, address, since, limit) {
816
+ async watchTrades(outcomeId, address, since, limit) {
817
817
  throw new Error(`watchTrades() is not supported by ${this.name}`);
818
818
  }
819
819
  /**
@@ -23,7 +23,7 @@ export declare class BaoziExchange extends PredictionMarketExchange {
23
23
  protected fetchMarketsImpl(params?: MarketFetchParams): Promise<UnifiedMarket[]>;
24
24
  protected fetchEventsImpl(params: EventFetchParams): Promise<UnifiedEvent[]>;
25
25
  fetchOHLCV(): Promise<PriceCandle[]>;
26
- fetchOrderBook(id: string): Promise<OrderBook>;
26
+ fetchOrderBook(outcomeId: string): Promise<OrderBook>;
27
27
  fetchTrades(): Promise<Trade[]>;
28
28
  fetchBalance(): Promise<Balance[]>;
29
29
  fetchPositions(): Promise<Position[]>;
@@ -31,7 +31,7 @@ export declare class BaoziExchange extends PredictionMarketExchange {
31
31
  cancelOrder(): Promise<Order>;
32
32
  fetchOrder(orderId: string): Promise<Order>;
33
33
  fetchOpenOrders(): Promise<Order[]>;
34
- watchOrderBook(id: string): Promise<OrderBook>;
34
+ watchOrderBook(outcomeId: string): Promise<OrderBook>;
35
35
  watchTrades(): Promise<Trade[]>;
36
36
  close(): Promise<void>;
37
37
  private ensureAuth;
@@ -71,9 +71,9 @@ class BaoziExchange extends BaseExchange_1.PredictionMarketExchange {
71
71
  // Baozi has no historical price/trade API without a custom indexer
72
72
  return [];
73
73
  }
74
- async fetchOrderBook(id) {
75
- const rawMarket = await this.fetcher.fetchRawOrderBook(id);
76
- return this.normalizer.normalizeOrderBook(rawMarket, id);
74
+ async fetchOrderBook(outcomeId) {
75
+ const rawMarket = await this.fetcher.fetchRawOrderBook(outcomeId);
76
+ return this.normalizer.normalizeOrderBook(rawMarket, outcomeId);
77
77
  }
78
78
  async fetchTrades() {
79
79
  // Baozi has no trade history API without a custom indexer
@@ -313,11 +313,11 @@ class BaoziExchange extends BaseExchange_1.PredictionMarketExchange {
313
313
  // -----------------------------------------------------------------------
314
314
  // WebSocket
315
315
  // -----------------------------------------------------------------------
316
- async watchOrderBook(id) {
316
+ async watchOrderBook(outcomeId) {
317
317
  if (!this.ws) {
318
318
  this.ws = new websocket_1.BaoziWebSocket();
319
319
  }
320
- return this.ws.watchOrderBook(this.connection, id);
320
+ return this.ws.watchOrderBook(this.connection, outcomeId);
321
321
  }
322
322
  async watchTrades() {
323
323
  throw new errors_1.ExchangeNotAvailable('Trade streaming is not available for Baozi', 'Baozi');
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/kalshi/Kalshi.yaml
3
- * Generated at: 2026-05-08T19:42:37.498Z
3
+ * Generated at: 2026-05-08T20:27:07.004Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const kalshiApiSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.kalshiApiSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/kalshi/Kalshi.yaml
6
- * Generated at: 2026-05-08T19:42:37.498Z
6
+ * Generated at: 2026-05-08T20:27:07.004Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.kalshiApiSpec = {
@@ -23,9 +23,9 @@ export declare class KalshiExchange extends PredictionMarketExchange {
23
23
  private ensureAuth;
24
24
  protected fetchMarketsImpl(params?: MarketFilterParams): Promise<UnifiedMarket[]>;
25
25
  protected fetchEventsImpl(params: EventFetchParams): Promise<UnifiedEvent[]>;
26
- fetchOHLCV(id: string, params: OHLCVParams): Promise<PriceCandle[]>;
27
- fetchOrderBook(id: string): Promise<OrderBook>;
28
- fetchTrades(id: string, params: TradesParams | HistoryFilterParams): Promise<Trade[]>;
26
+ fetchOHLCV(outcomeId: string, params: OHLCVParams): Promise<PriceCandle[]>;
27
+ fetchOrderBook(outcomeId: string): Promise<OrderBook>;
28
+ fetchTrades(outcomeId: string, params: TradesParams | HistoryFilterParams): Promise<Trade[]>;
29
29
  fetchBalance(): Promise<Balance[]>;
30
30
  fetchMyTrades(params?: MyTradesParams): Promise<UserTrade[]>;
31
31
  fetchPositions(): Promise<Position[]>;
@@ -38,8 +38,8 @@ export declare class KalshiExchange extends PredictionMarketExchange {
38
38
  fetchOrder(orderId: string): Promise<Order>;
39
39
  fetchOpenOrders(marketId?: string): Promise<Order[]>;
40
40
  private ws?;
41
- watchOrderBook(id: string, limit?: number): Promise<OrderBook>;
42
- watchOrderBooks(ids: string[], limit?: number): Promise<Record<string, OrderBook>>;
43
- watchTrades(id: string, address?: string, since?: number, limit?: number): Promise<Trade[]>;
41
+ watchOrderBook(outcomeId: string, limit?: number): Promise<OrderBook>;
42
+ watchOrderBooks(outcomeIds: string[], limit?: number): Promise<Record<string, OrderBook>>;
43
+ watchTrades(outcomeId: string, address?: string, since?: number, limit?: number): Promise<Trade[]>;
44
44
  close(): Promise<void>;
45
45
  }
@@ -117,21 +117,21 @@ class KalshiExchange extends BaseExchange_1.PredictionMarketExchange {
117
117
  .filter((e) => e !== null)
118
118
  .slice(0, limit);
119
119
  }
120
- async fetchOHLCV(id, params) {
121
- const rawCandles = await this.fetcher.fetchRawOHLCV(id, params);
120
+ async fetchOHLCV(outcomeId, params) {
121
+ const rawCandles = await this.fetcher.fetchRawOHLCV(outcomeId, params);
122
122
  return this.normalizer.normalizeOHLCV(rawCandles, params);
123
123
  }
124
- async fetchOrderBook(id) {
125
- (0, validation_1.validateIdFormat)(id, "OrderBook");
126
- const raw = await this.fetcher.fetchRawOrderBook(id);
127
- return this.normalizer.normalizeOrderBook(raw, id);
124
+ async fetchOrderBook(outcomeId) {
125
+ (0, validation_1.validateIdFormat)(outcomeId, "OrderBook");
126
+ const raw = await this.fetcher.fetchRawOrderBook(outcomeId);
127
+ return this.normalizer.normalizeOrderBook(raw, outcomeId);
128
128
  }
129
- async fetchTrades(id, params) {
129
+ async fetchTrades(outcomeId, params) {
130
130
  if ("resolution" in params && params.resolution !== undefined) {
131
131
  console.warn('[pmxt] Warning: The "resolution" parameter is deprecated for fetchTrades() and will be ignored. ' +
132
132
  "It will be removed in v3.0.0. Please remove it from your code.");
133
133
  }
134
- const rawTrades = await this.fetcher.fetchRawTrades(id, params);
134
+ const rawTrades = await this.fetcher.fetchRawTrades(outcomeId, params);
135
135
  return rawTrades.map((raw, i) => this.normalizer.normalizeTrade(raw, i));
136
136
  }
137
137
  // ----------------------------------------------------------------------------
@@ -251,7 +251,7 @@ class KalshiExchange extends BaseExchange_1.PredictionMarketExchange {
251
251
  // WebSocket
252
252
  // ----------------------------------------------------------------------------
253
253
  ws;
254
- async watchOrderBook(id, limit) {
254
+ async watchOrderBook(outcomeId, limit) {
255
255
  const auth = this.ensureAuth();
256
256
  if (!this.ws) {
257
257
  const wsConfigWithUrl = {
@@ -260,10 +260,10 @@ class KalshiExchange extends BaseExchange_1.PredictionMarketExchange {
260
260
  };
261
261
  this.ws = new websocket_1.KalshiWebSocket(auth, wsConfigWithUrl);
262
262
  }
263
- const marketTicker = id.replace(/-NO$/, "");
263
+ const marketTicker = outcomeId.replace(/-NO$/, "");
264
264
  return this.ws.watchOrderBook(marketTicker);
265
265
  }
266
- async watchOrderBooks(ids, limit) {
266
+ async watchOrderBooks(outcomeIds, limit) {
267
267
  const auth = this.ensureAuth();
268
268
  if (!this.ws) {
269
269
  const wsConfigWithUrl = {
@@ -272,10 +272,10 @@ class KalshiExchange extends BaseExchange_1.PredictionMarketExchange {
272
272
  };
273
273
  this.ws = new websocket_1.KalshiWebSocket(auth, wsConfigWithUrl);
274
274
  }
275
- const marketTickers = ids.map((id) => id.replace(/-NO$/, ""));
275
+ const marketTickers = outcomeIds.map((oid) => oid.replace(/-NO$/, ""));
276
276
  return this.ws.watchOrderBooks(marketTickers);
277
277
  }
278
- async watchTrades(id, address, since, limit) {
278
+ async watchTrades(outcomeId, address, since, limit) {
279
279
  const auth = this.ensureAuth();
280
280
  if (!this.ws) {
281
281
  const wsConfigWithUrl = {
@@ -284,7 +284,7 @@ class KalshiExchange extends BaseExchange_1.PredictionMarketExchange {
284
284
  };
285
285
  this.ws = new websocket_1.KalshiWebSocket(auth, wsConfigWithUrl);
286
286
  }
287
- const marketTicker = id.replace(/-NO$/, "");
287
+ const marketTicker = outcomeId.replace(/-NO$/, "");
288
288
  return this.ws.watchTrades(marketTicker);
289
289
  }
290
290
  async close() {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/limitless/Limitless.yaml
3
- * Generated at: 2026-05-08T19:42:37.536Z
3
+ * Generated at: 2026-05-08T20:27:07.072Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const limitlessApiSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.limitlessApiSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/limitless/Limitless.yaml
6
- * Generated at: 2026-05-08T19:42:37.536Z
6
+ * Generated at: 2026-05-08T20:27:07.072Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.limitlessApiSpec = {
@@ -27,10 +27,10 @@ export declare class LimitlessExchange extends PredictionMarketExchange {
27
27
  private getHeaders;
28
28
  protected fetchMarketsImpl(params?: MarketFetchParams): Promise<UnifiedMarket[]>;
29
29
  protected fetchEventsImpl(params: EventFetchParams): Promise<UnifiedEvent[]>;
30
- fetchOHLCV(id: string, params: OHLCVParams): Promise<PriceCandle[]>;
31
- fetchOrderBook(id: string, side?: 'yes' | 'no'): Promise<OrderBook>;
30
+ fetchOHLCV(outcomeId: string, params: OHLCVParams): Promise<PriceCandle[]>;
31
+ fetchOrderBook(outcomeId: string, side?: 'yes' | 'no'): Promise<OrderBook>;
32
32
  private isNoOutcome;
33
- fetchTrades(id: string, params: TradesParams | HistoryFilterParams): Promise<Trade[]>;
33
+ fetchTrades(outcomeId: string, params: TradesParams | HistoryFilterParams): Promise<Trade[]>;
34
34
  fetchMyTrades(params?: MyTradesParams): Promise<UserTrade[]>;
35
35
  createOrder(params: CreateOrderParams): Promise<Order>;
36
36
  cancelOrder(orderId: string): Promise<Order>;
@@ -40,8 +40,8 @@ export declare class LimitlessExchange extends PredictionMarketExchange {
40
40
  fetchAllOrders(params?: OrderHistoryParams): Promise<Order[]>;
41
41
  fetchPositions(address?: string): Promise<Position[]>;
42
42
  fetchBalance(address?: string): Promise<Balance[]>;
43
- watchOrderBook(id: string, limit?: number): Promise<OrderBook>;
44
- watchTrades(id: string, address?: string, since?: number, limit?: number): Promise<Trade[]>;
43
+ watchOrderBook(outcomeId: string, limit?: number): Promise<OrderBook>;
44
+ watchTrades(outcomeId: string, address?: string, since?: number, limit?: number): Promise<Trade[]>;
45
45
  /**
46
46
  * Watch AMM price updates for a market address (Limitless only).
47
47
  * Requires WebSocket connection.
@@ -149,19 +149,19 @@ class LimitlessExchange extends BaseExchange_1.PredictionMarketExchange {
149
149
  .map((raw) => this.normalizer.normalizeEvent(raw))
150
150
  .filter((e) => e !== null);
151
151
  }
152
- async fetchOHLCV(id, params) {
153
- const slug = await this.resolveSlug(id);
152
+ async fetchOHLCV(outcomeId, params) {
153
+ const slug = await this.resolveSlug(outcomeId);
154
154
  const rawPrices = await this.fetcher.fetchRawOHLCV(slug, params);
155
155
  return this.normalizer.normalizeOHLCV(rawPrices, params);
156
156
  }
157
- async fetchOrderBook(id, side) {
158
- const slug = await this.resolveSlug(id);
157
+ async fetchOrderBook(outcomeId, side) {
158
+ const slug = await this.resolveSlug(outcomeId);
159
159
  const rawOrderBook = await this.fetcher.fetchRawOrderBook(slug);
160
- const orderBook = this.normalizer.normalizeOrderBook(rawOrderBook, id);
160
+ const orderBook = this.normalizer.normalizeOrderBook(rawOrderBook, outcomeId);
161
161
  // The Limitless API always returns the Yes-side order book regardless
162
162
  // of which token is queried. If the caller asked for the No token,
163
163
  // flip: noBid = 1 - yesAsk, noAsk = 1 - yesBid.
164
- const isNoToken = side === 'no' || (!side && await this.isNoOutcome(id, slug));
164
+ const isNoToken = side === 'no' || (!side && await this.isNoOutcome(outcomeId, slug));
165
165
  if (isNoToken) {
166
166
  return {
167
167
  bids: orderBook.asks.map((level) => ({ price: 1 - level.price, size: level.size }))
@@ -187,12 +187,13 @@ class LimitlessExchange extends BaseExchange_1.PredictionMarketExchange {
187
187
  }
188
188
  return false;
189
189
  }
190
- async fetchTrades(id, params) {
190
+ async fetchTrades(outcomeId, params) {
191
191
  if ('resolution' in params && params.resolution !== undefined) {
192
192
  console.warn('[pmxt] Warning: The "resolution" parameter is deprecated for fetchTrades() and will be ignored. ' +
193
193
  'It will be removed in v3.0.0. Please remove it from your code.');
194
194
  }
195
- const rawTrades = await this.fetcher.fetchRawTrades(id, params);
195
+ const slug = await this.resolveSlug(outcomeId);
196
+ const rawTrades = await this.fetcher.fetchRawTrades(slug, params);
196
197
  return rawTrades.map((raw, i) => this.normalizer.normalizeTrade(raw, i));
197
198
  }
198
199
  async fetchMyTrades(params) {
@@ -358,13 +359,15 @@ class LimitlessExchange extends BaseExchange_1.PredictionMarketExchange {
358
359
  // ------------------------------------------------------------------------
359
360
  // WebSocket
360
361
  // ------------------------------------------------------------------------
361
- async watchOrderBook(id, limit) {
362
+ async watchOrderBook(outcomeId, limit) {
363
+ const slug = await this.resolveSlug(outcomeId);
362
364
  const ws = this.ensureWs();
363
- return ws.watchOrderBook(id);
365
+ return ws.watchOrderBook(slug);
364
366
  }
365
- async watchTrades(id, address, since, limit) {
367
+ async watchTrades(outcomeId, address, since, limit) {
368
+ const slug = await this.resolveSlug(outcomeId);
366
369
  const ws = this.ensureWs();
367
- return ws.watchTrades(id, address);
370
+ return ws.watchTrades(slug, address);
368
371
  }
369
372
  /**
370
373
  * Watch AMM price updates for a market address (Limitless only).
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/myriad/myriad.yaml
3
- * Generated at: 2026-05-08T19:42:37.550Z
3
+ * Generated at: 2026-05-08T20:27:07.090Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const myriadApiSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.myriadApiSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/myriad/myriad.yaml
6
- * Generated at: 2026-05-08T19:42:37.550Z
6
+ * Generated at: 2026-05-08T20:27:07.090Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.myriadApiSpec = {
@@ -23,9 +23,9 @@ export declare class MyriadExchange extends PredictionMarketExchange {
23
23
  private ensureAuth;
24
24
  protected fetchMarketsImpl(params?: MarketFilterParams): Promise<UnifiedMarket[]>;
25
25
  protected fetchEventsImpl(params: EventFetchParams): Promise<UnifiedEvent[]>;
26
- fetchOHLCV(id: string, params: OHLCVParams): Promise<PriceCandle[]>;
27
- fetchOrderBook(id: string): Promise<OrderBook>;
28
- fetchTrades(id: string, params: TradesParams | HistoryFilterParams): Promise<Trade[]>;
26
+ fetchOHLCV(outcomeId: string, params: OHLCVParams): Promise<PriceCandle[]>;
27
+ fetchOrderBook(outcomeId: string): Promise<OrderBook>;
28
+ fetchTrades(outcomeId: string, params: TradesParams | HistoryFilterParams): Promise<Trade[]>;
29
29
  fetchMyTrades(params?: MyTradesParams): Promise<UserTrade[]>;
30
30
  createOrder(params: CreateOrderParams): Promise<Order>;
31
31
  cancelOrder(_orderId: string): Promise<Order>;
@@ -33,7 +33,7 @@ export declare class MyriadExchange extends PredictionMarketExchange {
33
33
  fetchOpenOrders(_marketId?: string): Promise<Order[]>;
34
34
  fetchPositions(): Promise<Position[]>;
35
35
  fetchBalance(): Promise<Balance[]>;
36
- watchOrderBook(id: string, _limit?: number): Promise<OrderBook>;
37
- watchTrades(id: string, address?: string, _since?: number, _limit?: number): Promise<Trade[]>;
36
+ watchOrderBook(outcomeId: string, _limit?: number): Promise<OrderBook>;
37
+ watchTrades(outcomeId: string, address?: string, _since?: number, _limit?: number): Promise<Trade[]>;
38
38
  close(): Promise<void>;
39
39
  }
@@ -79,25 +79,25 @@ class MyriadExchange extends BaseExchange_1.PredictionMarketExchange {
79
79
  .map((raw) => this.normalizer.normalizeEvent(raw))
80
80
  .filter((e) => e !== null);
81
81
  }
82
- async fetchOHLCV(id, params) {
82
+ async fetchOHLCV(outcomeId, params) {
83
83
  if (!params.resolution) {
84
84
  throw new Error('fetchOHLCV requires a resolution parameter.');
85
85
  }
86
- const parts = id.split(':');
87
- const outcomeId = parts.length >= 3 ? parts[2] : undefined;
88
- const rawMarket = await this.fetcher.fetchRawOHLCV(id, params);
89
- return this.normalizer.normalizeOHLCV(rawMarket, params, outcomeId);
86
+ const parts = outcomeId.split(':');
87
+ const parsedOutcomeId = parts.length >= 3 ? parts[2] : undefined;
88
+ const rawMarket = await this.fetcher.fetchRawOHLCV(outcomeId, params);
89
+ return this.normalizer.normalizeOHLCV(rawMarket, params, parsedOutcomeId);
90
90
  }
91
- async fetchOrderBook(id) {
92
- const rawMarket = await this.fetcher.fetchRawOrderBook(id);
93
- return this.normalizer.normalizeOrderBook(rawMarket, id);
91
+ async fetchOrderBook(outcomeId) {
92
+ const rawMarket = await this.fetcher.fetchRawOrderBook(outcomeId);
93
+ return this.normalizer.normalizeOrderBook(rawMarket, outcomeId);
94
94
  }
95
- async fetchTrades(id, params) {
95
+ async fetchTrades(outcomeId, params) {
96
96
  if ('resolution' in params && params.resolution !== undefined) {
97
97
  console.warn('[pmxt] Warning: The "resolution" parameter is deprecated for fetchTrades() and will be ignored. ' +
98
98
  'It will be removed in v3.0.0. Please remove it from your code.');
99
99
  }
100
- const rawTrades = await this.fetcher.fetchRawTrades(id, params);
100
+ const rawTrades = await this.fetcher.fetchRawTrades(outcomeId, params);
101
101
  return rawTrades.map((raw, i) => this.normalizer.normalizeTrade(raw, i));
102
102
  }
103
103
  async fetchMyTrades(params) {
@@ -178,19 +178,19 @@ class MyriadExchange extends BaseExchange_1.PredictionMarketExchange {
178
178
  // ------------------------------------------------------------------------
179
179
  // WebSocket (poll-based)
180
180
  // ------------------------------------------------------------------------
181
- async watchOrderBook(id, _limit) {
181
+ async watchOrderBook(outcomeId, _limit) {
182
182
  this.ensureAuth();
183
183
  if (!this.ws) {
184
184
  this.ws = new websocket_1.MyriadWebSocket(this.callApi.bind(this), (id) => this.fetchOrderBook(id));
185
185
  }
186
- return this.ws.watchOrderBook(id);
186
+ return this.ws.watchOrderBook(outcomeId);
187
187
  }
188
- async watchTrades(id, address, _since, _limit) {
188
+ async watchTrades(outcomeId, address, _since, _limit) {
189
189
  this.ensureAuth();
190
190
  if (!this.ws) {
191
191
  this.ws = new websocket_1.MyriadWebSocket(this.callApi.bind(this), (id) => this.fetchOrderBook(id));
192
192
  }
193
- return this.ws.watchTrades(id);
193
+ return this.ws.watchTrades(outcomeId);
194
194
  }
195
195
  async close() {
196
196
  if (this.ws) {
@@ -11,8 +11,8 @@ export declare class MyriadWebSocket {
11
11
  private lastTradeTimestamp;
12
12
  private closed;
13
13
  constructor(callApi: (operationId: string, params?: Record<string, any>) => Promise<any>, fetchOrderBook: FetchOrderBookFn, pollInterval?: number);
14
- watchOrderBook(id: string): Promise<OrderBook>;
15
- watchTrades(id: string): Promise<Trade[]>;
14
+ watchOrderBook(outcomeId: string): Promise<OrderBook>;
15
+ watchTrades(outcomeId: string): Promise<Trade[]>;
16
16
  close(): Promise<void>;
17
17
  private startOrderBookPolling;
18
18
  private startTradePolling;
@@ -20,29 +20,29 @@ class MyriadWebSocket {
20
20
  this.fetchOrderBook = fetchOrderBook;
21
21
  this.pollInterval = pollInterval || DEFAULT_POLL_INTERVAL;
22
22
  }
23
- async watchOrderBook(id) {
23
+ async watchOrderBook(outcomeId) {
24
24
  if (this.closed)
25
25
  throw new Error('WebSocket connection is closed');
26
26
  return new Promise((resolve) => {
27
- if (!this.orderBookResolvers.has(id)) {
28
- this.orderBookResolvers.set(id, []);
27
+ if (!this.orderBookResolvers.has(outcomeId)) {
28
+ this.orderBookResolvers.set(outcomeId, []);
29
29
  }
30
- this.orderBookResolvers.get(id).push(resolve);
31
- if (!this.orderBookTimers.has(id)) {
32
- this.startOrderBookPolling(id);
30
+ this.orderBookResolvers.get(outcomeId).push(resolve);
31
+ if (!this.orderBookTimers.has(outcomeId)) {
32
+ this.startOrderBookPolling(outcomeId);
33
33
  }
34
34
  });
35
35
  }
36
- async watchTrades(id) {
36
+ async watchTrades(outcomeId) {
37
37
  if (this.closed)
38
38
  throw new Error('WebSocket connection is closed');
39
39
  return new Promise((resolve) => {
40
- if (!this.tradeResolvers.has(id)) {
41
- this.tradeResolvers.set(id, []);
40
+ if (!this.tradeResolvers.has(outcomeId)) {
41
+ this.tradeResolvers.set(outcomeId, []);
42
42
  }
43
- this.tradeResolvers.get(id).push(resolve);
44
- if (!this.tradeTimers.has(id)) {
45
- this.startTradePolling(id);
43
+ this.tradeResolvers.get(outcomeId).push(resolve);
44
+ if (!this.tradeTimers.has(outcomeId)) {
45
+ this.startTradePolling(outcomeId);
46
46
  }
47
47
  });
48
48
  }