pmxt-core 2.41.1 → 2.41.4

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.
@@ -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-15T18:19:35.222Z
3
+ * Generated at: 2026-05-15T20:14:37.286Z
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-15T18:19:35.222Z
6
+ * Generated at: 2026-05-15T20:14:37.286Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.kalshiApiSpec = {
@@ -341,10 +341,12 @@ class KalshiWebSocket {
341
341
  const trade = {
342
342
  id: data.trade_id || `${timestamp}-${Math.random()}`,
343
343
  timestamp,
344
- price: data.yes_price || data.price
345
- ? (data.yes_price || data.price) / 100
344
+ price: data.yes_price_dollars != null
345
+ ? parseFloat(data.yes_price_dollars)
346
346
  : 0.5,
347
- amount: data.count || data.size || 0,
347
+ amount: data.count_fp != null
348
+ ? parseFloat(data.count_fp)
349
+ : 0,
348
350
  side: data.taker_side === "yes" || data.side === "buy"
349
351
  ? "buy"
350
352
  : data.taker_side === "no" || data.side === "sell"
@@ -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-15T18:19:35.272Z
3
+ * Generated at: 2026-05-15T20:14:37.326Z
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-15T18:19:35.272Z
6
+ * Generated at: 2026-05-15T20:14:37.326Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.limitlessApiSpec = {
@@ -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-15T18:19:35.290Z
3
+ * Generated at: 2026-05-15T20:14:37.339Z
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-15T18:19:35.290Z
6
+ * Generated at: 2026-05-15T20:14:37.339Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.myriadApiSpec = {
@@ -8,15 +8,16 @@ class MyriadAuth {
8
8
  this.validateCredentials();
9
9
  }
10
10
  validateCredentials() {
11
- if (!this.credentials.apiKey) {
12
- throw new Error('Myriad requires an apiKey for authentication');
11
+ if (!this.credentials.apiKey && !this.credentials.privateKey) {
12
+ throw new Error('Myriad requires an apiKey or privateKey for authentication');
13
13
  }
14
14
  }
15
15
  getHeaders() {
16
- return {
17
- 'x-api-key': this.credentials.apiKey,
18
- 'Content-Type': 'application/json',
19
- };
16
+ const headers = { 'Content-Type': 'application/json' };
17
+ if (this.credentials.apiKey) {
18
+ headers['x-api-key'] = this.credentials.apiKey;
19
+ }
20
+ return headers;
20
21
  }
21
22
  get walletAddress() {
22
23
  return this.credentials.privateKey;
@@ -29,7 +29,7 @@ class MyriadExchange extends BaseExchange_1.PredictionMarketExchange {
29
29
  constructor(credentials) {
30
30
  super(credentials);
31
31
  this.rateLimit = 500;
32
- if (credentials?.apiKey) {
32
+ if (credentials?.apiKey || credentials?.privateKey) {
33
33
  this.auth = new auth_1.MyriadAuth(credentials);
34
34
  }
35
35
  const myriadBaseUrl = credentials?.baseUrl || utils_1.DEFAULT_BASE_URL;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/opinion/opinion-openapi.yaml
3
- * Generated at: 2026-05-15T18:19:35.296Z
3
+ * Generated at: 2026-05-15T20:14:37.344Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const opinionApiSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.opinionApiSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/opinion/opinion-openapi.yaml
6
- * Generated at: 2026-05-15T18:19:35.296Z
6
+ * Generated at: 2026-05-15T20:14:37.344Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.opinionApiSpec = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketClobAPI.yaml
3
- * Generated at: 2026-05-15T18:19:35.230Z
3
+ * Generated at: 2026-05-15T20:14:37.291Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const polymarketClobSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.polymarketClobSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketClobAPI.yaml
6
- * Generated at: 2026-05-15T18:19:35.230Z
6
+ * Generated at: 2026-05-15T20:14:37.291Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.polymarketClobSpec = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/Polymarket_Data_API.yaml
3
- * Generated at: 2026-05-15T18:19:35.251Z
3
+ * Generated at: 2026-05-15T20:14:37.308Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const polymarketDataSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.polymarketDataSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/Polymarket_Data_API.yaml
6
- * Generated at: 2026-05-15T18:19:35.251Z
6
+ * Generated at: 2026-05-15T20:14:37.308Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.polymarketDataSpec = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketGammaAPI.yaml
3
- * Generated at: 2026-05-15T18:19:35.248Z
3
+ * Generated at: 2026-05-15T20:14:37.304Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const polymarketGammaSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.polymarketGammaSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketGammaAPI.yaml
6
- * Generated at: 2026-05-15T18:19:35.248Z
6
+ * Generated at: 2026-05-15T20:14:37.304Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.polymarketGammaSpec = {
@@ -153,20 +153,19 @@ class PolymarketExchange extends BaseExchange_1.PredictionMarketExchange {
153
153
  const auth = this.ensureAuth();
154
154
  const client = await auth.getClobClient();
155
155
  const side = params.side.toUpperCase() === 'BUY' ? clob_client_v2_1.Side.BUY : clob_client_v2_1.Side.SELL;
156
- const price = params.price || (side === clob_client_v2_1.Side.BUY ? 0.99 : 0.01);
157
156
  const tickSize = params.tickSize ? params.tickSize.toString() : undefined;
158
- const orderArgs = {
159
- tokenID: params.outcomeId,
160
- price,
161
- side,
162
- size: params.amount,
163
- };
164
157
  const options = {};
165
158
  if (tickSize)
166
159
  options.tickSize = tickSize;
167
160
  if (params.negRisk !== undefined)
168
161
  options.negRisk = params.negRisk;
169
- const signedOrder = await client.createOrder(orderArgs, options);
162
+ let signedOrder;
163
+ if (params.type === 'market' || !params.price) {
164
+ signedOrder = await client.createMarketOrder({ tokenID: params.outcomeId, amount: params.amount, side }, options);
165
+ }
166
+ else {
167
+ signedOrder = await client.createOrder({ tokenID: params.outcomeId, price: params.price, side, size: params.amount }, options);
168
+ }
170
169
  return {
171
170
  exchange: this.name,
172
171
  params,
@@ -182,36 +181,31 @@ class PolymarketExchange extends BaseExchange_1.PredictionMarketExchange {
182
181
  try {
183
182
  const auth = this.ensureAuth();
184
183
  const client = await auth.getClobClient();
185
- const response = await client.postOrder(built.raw);
184
+ const isMarket = built.params.type === 'market' || !built.params.price;
185
+ const response = isMarket
186
+ ? await client.postOrder(built.raw, 'FOK')
187
+ : await client.postOrder(built.raw);
186
188
  if (!response || !response.success) {
187
189
  throw new Error(`${response?.errorMsg || 'Order submission failed'} (Response: ${JSON.stringify(response)})`);
188
190
  }
189
191
  const side = built.params.side.toUpperCase() === 'BUY' ? clob_client_v2_1.Side.BUY : clob_client_v2_1.Side.SELL;
190
- const price = built.params.price || (side === clob_client_v2_1.Side.BUY ? 0.99 : 0.01);
191
- // Extract actual fill data from the CLOB OrderResponse.
192
- // response.status: 'MATCHED' | 'CONFIRMED' = immediately filled,
193
- // 'LIVE' = resting on the book (filled: 0 is correct).
194
- // takingAmount / makingAmount are string representations of raw USDC amounts (6 decimals).
195
- const USDC_DECIMALS = 6;
192
+ const price = built.params.price || 0;
196
193
  const responseStatus = (response.status || '').toUpperCase();
197
194
  const isImmediatelyFilled = responseStatus === 'MATCHED' || responseStatus === 'CONFIRMED';
198
195
  let filled = 0;
199
196
  if (isImmediatelyFilled) {
200
- const takingRaw = typeof response.takingAmount === 'string'
197
+ const taking = typeof response.takingAmount === 'string'
201
198
  ? parseFloat(response.takingAmount)
202
199
  : (response.takingAmount ?? 0);
203
- const makingRaw = typeof response.makingAmount === 'string'
200
+ const making = typeof response.makingAmount === 'string'
204
201
  ? parseFloat(response.makingAmount)
205
202
  : (response.makingAmount ?? 0);
206
- // For BUY: makingAmount is USDC spent, takingAmount is shares received.
207
- // For SELL: makingAmount is shares sold, takingAmount is USDC received.
208
- // `filled` should reflect the share size that executed.
209
- filled = side === clob_client_v2_1.Side.BUY
210
- ? takingRaw / Math.pow(10, USDC_DECIMALS)
211
- : makingRaw / Math.pow(10, USDC_DECIMALS);
203
+ // For BUY: makingAmount = shares filled. For SELL: takingAmount = shares filled.
204
+ // Values are already human-readable (not raw 6-decimal units).
205
+ filled = side === clob_client_v2_1.Side.BUY ? making : taking;
212
206
  }
213
207
  const remaining = Math.max(0, built.params.amount - filled);
214
- const orderStatus = filled >= built.params.amount ? 'filled' : 'open';
208
+ const orderStatus = filled >= built.params.amount - 0.001 ? 'filled' : 'open';
215
209
  return {
216
210
  id: response.orderID,
217
211
  marketId: built.params.marketId,
@@ -49,14 +49,16 @@ export interface PolymarketWebSocketConfig {
49
49
  userChannelCreds?: PolymarketUserChannelCreds;
50
50
  }
51
51
  /**
52
- * Wrapper around @nevuamarkets/poly-websockets that provides CCXT Pro-style
53
- * watchOrderBook() and watchTrades() methods.
52
+ * Native WebSocket implementation for Polymarket market data.
53
+ * Replaces the @nevuamarkets/poly-websockets dependency.
54
54
  */
55
55
  export declare class PolymarketWebSocket {
56
- private manager;
56
+ private ws;
57
+ private subscribedAssets;
57
58
  private readonly watcher;
58
59
  private orderBookResolvers;
59
60
  private tradeResolvers;
61
+ private pendingTrades;
60
62
  private orderBooks;
61
63
  private config;
62
64
  private initializationPromise?;
@@ -88,6 +90,7 @@ export declare class PolymarketWebSocket {
88
90
  private scheduleUserReconnect;
89
91
  private closeUserChannel;
90
92
  close(): Promise<void>;
93
+ private subscribe;
91
94
  private ensureInitialized;
92
95
  private handleBookSnapshot;
93
96
  private handlePriceChange;
@@ -44,15 +44,18 @@ exports.PolymarketWebSocket = void 0;
44
44
  const goldsky_1 = require("../../subscriber/external/goldsky");
45
45
  const watcher_1 = require("../../subscriber/watcher");
46
46
  const watch_timeout_1 = require("../../utils/watch-timeout");
47
+ const POLYMARKET_MARKET_WS_URL = 'wss://ws-subscriptions-clob.polymarket.com/ws/market';
47
48
  /**
48
- * Wrapper around @nevuamarkets/poly-websockets that provides CCXT Pro-style
49
- * watchOrderBook() and watchTrades() methods.
49
+ * Native WebSocket implementation for Polymarket market data.
50
+ * Replaces the @nevuamarkets/poly-websockets dependency.
50
51
  */
51
52
  class PolymarketWebSocket {
52
- manager;
53
+ ws;
54
+ subscribedAssets = new Set();
53
55
  watcher;
54
56
  orderBookResolvers = new Map();
55
57
  tradeResolvers = new Map();
58
+ pendingTrades = new Map();
56
59
  orderBooks = new Map();
57
60
  config;
58
61
  initializationPromise;
@@ -70,11 +73,7 @@ class PolymarketWebSocket {
70
73
  }
71
74
  async watchOrderBook(outcomeId) {
72
75
  await this.ensureInitialized();
73
- // Subscribe to the asset if not already subscribed
74
- const currentAssets = this.manager.getAssetIds();
75
- if (!currentAssets.includes(outcomeId)) {
76
- await this.manager.addSubscriptions([outcomeId]);
77
- }
76
+ await this.subscribe([outcomeId]);
78
77
  // Return a promise that resolves on the next orderbook update
79
78
  const dataPromise = new Promise((resolve, reject) => {
80
79
  if (!this.orderBookResolvers.has(outcomeId)) {
@@ -85,10 +84,7 @@ class PolymarketWebSocket {
85
84
  return (0, watch_timeout_1.withWatchTimeout)(dataPromise, this.config.watchTimeoutMs ?? watch_timeout_1.DEFAULT_WATCH_TIMEOUT_MS, `watchOrderBook('${outcomeId}')`);
86
85
  }
87
86
  async unwatchOrderBook(outcomeId) {
88
- if (!this.manager) {
89
- return;
90
- }
91
- await this.manager.removeSubscriptions([outcomeId]);
87
+ this.subscribedAssets.delete(outcomeId);
92
88
  // Clear any pending resolvers for this asset
93
89
  const resolvers = this.orderBookResolvers.get(outcomeId);
94
90
  if (resolvers) {
@@ -104,12 +100,15 @@ class PolymarketWebSocket {
104
100
  return this.watcher.watch(address, ['trades'], outcomeId);
105
101
  }
106
102
  await this.ensureInitialized();
107
- // Subscribe to the asset if not already subscribed
108
- const currentAssets = this.manager.getAssetIds();
109
- if (!currentAssets.includes(outcomeId)) {
110
- await this.manager.addSubscriptions([outcomeId]);
103
+ await this.subscribe([outcomeId]);
104
+ // Return accumulated trades immediately if any arrived between calls
105
+ const accumulated = this.pendingTrades.get(outcomeId);
106
+ if (accumulated && accumulated.length > 0) {
107
+ const result = [...accumulated];
108
+ this.pendingTrades.set(outcomeId, []);
109
+ return result;
111
110
  }
112
- // Return a promise that resolves on the next trade
111
+ // Otherwise wait for the next trade
113
112
  const dataPromise = new Promise((resolve, reject) => {
114
113
  if (!this.tradeResolvers.has(outcomeId)) {
115
114
  this.tradeResolvers.set(outcomeId, []);
@@ -249,52 +248,62 @@ class PolymarketWebSocket {
249
248
  }
250
249
  }
251
250
  async close() {
252
- if (this.manager) {
253
- await this.manager.clearState();
251
+ if (this.ws) {
252
+ this.ws.close();
253
+ this.ws = null;
254
254
  }
255
+ this.subscribedAssets.clear();
255
256
  this.closeUserChannel();
256
257
  this.watcher.close();
257
258
  }
259
+ async subscribe(assetIds) {
260
+ const newIds = assetIds.filter((id) => !this.subscribedAssets.has(id));
261
+ if (newIds.length === 0)
262
+ return;
263
+ for (const id of newIds)
264
+ this.subscribedAssets.add(id);
265
+ if (this.ws && this.ws.readyState === 1) {
266
+ this.ws.send(JSON.stringify({
267
+ assets_ids: newIds,
268
+ type: 'market',
269
+ custom_feature_enabled: true,
270
+ }));
271
+ }
272
+ }
258
273
  async ensureInitialized() {
259
274
  if (this.initializationPromise)
260
275
  return this.initializationPromise;
261
- this.initializationPromise = (async () => {
262
- try {
263
- // Dynamic import to handle optional dependency
264
- const poly = await Promise.resolve().then(() => __importStar(require('@nevuamarkets/poly-websockets')));
265
- this.manager = new poly.WSSubscriptionManager({
266
- onBook: async (events) => {
267
- for (const event of events) {
268
- this.handleBookSnapshot(event);
269
- }
270
- },
271
- onPriceChange: async (events) => {
272
- for (const event of events) {
273
- this.handlePriceChange(event);
274
- }
275
- },
276
- onLastTradePrice: async (events) => {
277
- for (const event of events) {
278
- this.handleTrade(event);
279
- }
280
- },
281
- onError: async (error) => {
282
- console.error('Polymarket WebSocket error:', error.message);
283
- },
284
- }, {
285
- reconnectAndCleanupIntervalMs: this.config.reconnectIntervalMs ?? 5000,
286
- pendingFlushIntervalMs: this.config.flushIntervalMs ?? 100,
287
- });
288
- }
289
- catch (e) {
290
- const error = e;
291
- if (error.message.includes('Cannot find module')) {
292
- throw new Error('Polymarket WebSocket support requires the "@nevuamarkets/poly-websockets" package.\n' +
293
- 'To use this feature, please install it: npm install @nevuamarkets/poly-websockets');
276
+ this.initializationPromise = new Promise((resolve, reject) => {
277
+ const WebSocket = require('ws');
278
+ this.ws = new WebSocket(POLYMARKET_MARKET_WS_URL);
279
+ this.ws.on('open', () => {
280
+ resolve();
281
+ });
282
+ this.ws.on('message', (raw) => {
283
+ try {
284
+ const msgs = JSON.parse(raw.toString());
285
+ const arr = Array.isArray(msgs) ? msgs : [msgs];
286
+ for (const msg of arr) {
287
+ const type = msg.event_type;
288
+ if (type === 'book')
289
+ this.handleBookSnapshot(msg);
290
+ else if (type === 'price_change')
291
+ this.handlePriceChange(msg);
292
+ else if (type === 'last_trade_price')
293
+ this.handleTrade(msg);
294
+ }
294
295
  }
295
- throw e;
296
- }
297
- })();
296
+ catch { }
297
+ });
298
+ this.ws.on('error', (err) => {
299
+ console.error('Polymarket WebSocket error:', err.message);
300
+ reject(err);
301
+ });
302
+ this.ws.on('close', () => {
303
+ this.initializationPromise = undefined;
304
+ this.ws = null;
305
+ });
306
+ });
298
307
  return this.initializationPromise;
299
308
  }
300
309
  handleBookSnapshot(event) {
@@ -316,17 +325,16 @@ class PolymarketWebSocket {
316
325
  this.resolveOrderBook(id, orderBook);
317
326
  }
318
327
  handlePriceChange(event) {
319
- // Apply deltas to existing orderbook
320
- for (const change of event.price_changes) {
321
- const id = change.asset_id;
322
- const existing = this.orderBooks.get(id);
323
- if (!existing) {
324
- // No snapshot yet, skip delta
325
- continue;
326
- }
328
+ const id = event.asset_id;
329
+ const existing = this.orderBooks.get(id);
330
+ if (!existing)
331
+ return;
332
+ // Native API sends individual price_change events (not wrapped in an array)
333
+ const changes = event.price_changes || [event];
334
+ for (const change of changes) {
327
335
  const price = parseFloat(change.price);
328
336
  const size = parseFloat(change.size);
329
- const side = change.side.toUpperCase();
337
+ const side = (change.side || '').toUpperCase();
330
338
  const levels = side === 'BUY' ? existing.bids : existing.asks;
331
339
  const existingIndex = levels.findIndex((l) => l.price === price);
332
340
  if (size === 0) {
@@ -364,11 +372,18 @@ class PolymarketWebSocket {
364
372
  amount: parseFloat(event.size),
365
373
  side: event.side.toLowerCase(),
366
374
  };
375
+ // Resolve waiting promises if any, otherwise buffer for next watchTrades call
367
376
  const resolvers = this.tradeResolvers.get(id);
368
377
  if (resolvers && resolvers.length > 0) {
369
378
  resolvers.forEach((r) => r.resolve([trade]));
370
379
  this.tradeResolvers.set(id, []);
371
380
  }
381
+ else {
382
+ if (!this.pendingTrades.has(id)) {
383
+ this.pendingTrades.set(id, []);
384
+ }
385
+ this.pendingTrades.get(id).push(trade);
386
+ }
372
387
  }
373
388
  resolveOrderBook(id, orderBook) {
374
389
  const resolvers = this.orderBookResolvers.get(id);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/probable/probable.yaml
3
- * Generated at: 2026-05-15T18:19:35.279Z
3
+ * Generated at: 2026-05-15T20:14:37.331Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const probableApiSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.probableApiSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/probable/probable.yaml
6
- * Generated at: 2026-05-15T18:19:35.279Z
6
+ * Generated at: 2026-05-15T20:14:37.331Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.probableApiSpec = {
@@ -1294,403 +1294,6 @@ paths:
1294
1294
  description: >-
1295
1295
  Filter a list of events by criteria. Can filter by string query, structured criteria object, or custom filter
1296
1296
  function.
1297
- '/api/{exchange}/watchOrderBook':
1298
- post:
1299
- summary: Watch Order Book (WebSocket)
1300
- operationId: watchOrderBook
1301
- parameters:
1302
- - $ref: '#/components/parameters/ExchangeParam'
1303
- description: >-
1304
- Watch order book updates in real-time via WebSocket. Returns a promise that resolves with the next order book
1305
- update. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
1306
-
1307
-
1308
- **Transport:** WebSocket
1309
-
1310
-
1311
- | Environment | URL |
1312
-
1313
- |---|---|
1314
-
1315
- | Local sidecar | `ws://localhost:3847/ws` |
1316
-
1317
- | Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
1318
-
1319
-
1320
- **Subscribe:**
1321
-
1322
- ```json
1323
-
1324
- { "id": "req-1", "action": "subscribe", "method": "watchOrderBook", "args": [...] }
1325
-
1326
- ```
1327
-
1328
-
1329
- **Server response:**
1330
-
1331
- ```json
1332
-
1333
- { "event": "data", "id": "req-1", "method": "watchOrderBook", "symbol": "...", "data": { ... } }
1334
-
1335
- ```
1336
-
1337
-
1338
- **Unsubscribe:**
1339
-
1340
- ```json
1341
-
1342
- { "id": "req-1", "action": "unsubscribe" }
1343
-
1344
- ```
1345
- requestBody:
1346
- content:
1347
- application/json:
1348
- schema:
1349
- title: WatchOrderBookRequest
1350
- type: object
1351
- properties:
1352
- args:
1353
- type: array
1354
- items:
1355
- type: string
1356
- credentials:
1357
- $ref: '#/components/schemas/ExchangeCredentials'
1358
- responses:
1359
- '200':
1360
- description: Watch Order Book response (WebSocket data event)
1361
- content:
1362
- application/json:
1363
- schema:
1364
- allOf:
1365
- - $ref: '#/components/schemas/BaseResponse'
1366
- - type: object
1367
- properties:
1368
- data:
1369
- $ref: '#/components/schemas/OrderBook'
1370
- '/api/{exchange}/watchOrderBooks':
1371
- post:
1372
- summary: Watch Order Books (WebSocket)
1373
- operationId: watchOrderBooks
1374
- parameters:
1375
- - $ref: '#/components/parameters/ExchangeParam'
1376
- description: >-
1377
- Watch multiple order books simultaneously via WebSocket. Returns a promise that resolves with a record of order
1378
- book snapshots keyed by ID. Exchanges with native batch support (e.g. Kalshi) send a single subscribe message
1379
- for all tickers; others fall back to individual watchOrderBook calls.
1380
-
1381
-
1382
- **Transport:** WebSocket
1383
-
1384
-
1385
- | Environment | URL |
1386
-
1387
- |---|---|
1388
-
1389
- | Local sidecar | `ws://localhost:3847/ws` |
1390
-
1391
- | Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
1392
-
1393
-
1394
- **Subscribe:**
1395
-
1396
- ```json
1397
-
1398
- { "id": "req-1", "action": "subscribe", "method": "watchOrderBooks", "args": [...] }
1399
-
1400
- ```
1401
-
1402
-
1403
- **Server response:**
1404
-
1405
- ```json
1406
-
1407
- { "event": "data", "id": "req-1", "method": "watchOrderBooks", "symbol": "...", "data": { ... } }
1408
-
1409
- ```
1410
-
1411
-
1412
- **Unsubscribe:**
1413
-
1414
- ```json
1415
-
1416
- { "id": "req-1", "action": "unsubscribe" }
1417
-
1418
- ```
1419
- requestBody:
1420
- content:
1421
- application/json:
1422
- schema:
1423
- title: WatchOrderBooksRequest
1424
- type: object
1425
- properties:
1426
- args:
1427
- type: array
1428
- items:
1429
- type: string
1430
- credentials:
1431
- $ref: '#/components/schemas/ExchangeCredentials'
1432
- responses:
1433
- '200':
1434
- description: Watch Order Books response (WebSocket data event)
1435
- content:
1436
- application/json:
1437
- schema:
1438
- allOf:
1439
- - $ref: '#/components/schemas/BaseResponse'
1440
- - type: object
1441
- properties:
1442
- data:
1443
- type: object
1444
- additionalProperties:
1445
- $ref: '#/components/schemas/OrderBook'
1446
- '/api/{exchange}/unwatchOrderBook':
1447
- post:
1448
- summary: Unwatch Order Book (WebSocket)
1449
- operationId: unwatchOrderBook
1450
- parameters:
1451
- - $ref: '#/components/parameters/ExchangeParam'
1452
- description: |-
1453
- Unsubscribe from a previously watched order book stream.
1454
-
1455
- **Transport:** WebSocket
1456
-
1457
- | Environment | URL |
1458
- |---|---|
1459
- | Local sidecar | `ws://localhost:3847/ws` |
1460
- | Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
1461
-
1462
- **Subscribe:**
1463
- ```json
1464
- { "id": "req-1", "action": "subscribe", "method": "unwatchOrderBook", "args": [...] }
1465
- ```
1466
-
1467
- **Server response:**
1468
- ```json
1469
- { "event": "data", "id": "req-1", "method": "unwatchOrderBook", "symbol": "...", "data": { ... } }
1470
- ```
1471
-
1472
- **Unsubscribe:**
1473
- ```json
1474
- { "id": "req-1", "action": "unsubscribe" }
1475
- ```
1476
- requestBody:
1477
- content:
1478
- application/json:
1479
- schema:
1480
- title: UnwatchOrderBookRequest
1481
- type: object
1482
- properties:
1483
- args:
1484
- type: array
1485
- items:
1486
- type: string
1487
- credentials:
1488
- $ref: '#/components/schemas/ExchangeCredentials'
1489
- responses:
1490
- '200':
1491
- description: Unwatch Order Book response (WebSocket data event)
1492
- content:
1493
- application/json:
1494
- schema:
1495
- $ref: '#/components/schemas/BaseResponse'
1496
- '/api/{exchange}/watchTrades':
1497
- post:
1498
- summary: Watch Trades (WebSocket)
1499
- operationId: watchTrades
1500
- parameters:
1501
- - $ref: '#/components/parameters/ExchangeParam'
1502
- description: >-
1503
- Watch trade executions in real-time via WebSocket. Returns a promise that resolves with the next trade(s). Call
1504
- repeatedly in a loop to stream updates (CCXT Pro pattern).
1505
-
1506
-
1507
- **Transport:** WebSocket
1508
-
1509
-
1510
- | Environment | URL |
1511
-
1512
- |---|---|
1513
-
1514
- | Local sidecar | `ws://localhost:3847/ws` |
1515
-
1516
- | Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
1517
-
1518
-
1519
- **Subscribe:**
1520
-
1521
- ```json
1522
-
1523
- { "id": "req-1", "action": "subscribe", "method": "watchTrades", "args": [...] }
1524
-
1525
- ```
1526
-
1527
-
1528
- **Server response:**
1529
-
1530
- ```json
1531
-
1532
- { "event": "data", "id": "req-1", "method": "watchTrades", "symbol": "...", "data": { ... } }
1533
-
1534
- ```
1535
-
1536
-
1537
- **Unsubscribe:**
1538
-
1539
- ```json
1540
-
1541
- { "id": "req-1", "action": "unsubscribe" }
1542
-
1543
- ```
1544
- requestBody:
1545
- content:
1546
- application/json:
1547
- schema:
1548
- title: WatchTradesRequest
1549
- type: object
1550
- properties:
1551
- args:
1552
- type: array
1553
- items:
1554
- type: string
1555
- credentials:
1556
- $ref: '#/components/schemas/ExchangeCredentials'
1557
- responses:
1558
- '200':
1559
- description: Watch Trades response (WebSocket data event)
1560
- content:
1561
- application/json:
1562
- schema:
1563
- allOf:
1564
- - $ref: '#/components/schemas/BaseResponse'
1565
- - type: object
1566
- properties:
1567
- data:
1568
- type: array
1569
- items:
1570
- $ref: '#/components/schemas/Trade'
1571
- '/api/{exchange}/watchAddress':
1572
- post:
1573
- summary: Watch Address (WebSocket)
1574
- operationId: watchAddress
1575
- parameters:
1576
- - $ref: '#/components/parameters/ExchangeParam'
1577
- description: >-
1578
- Stream activity for a public wallet address Returns a promise that resolves with the next activity snapshot
1579
- whenever a change is detected. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
1580
-
1581
-
1582
- **Transport:** WebSocket
1583
-
1584
-
1585
- | Environment | URL |
1586
-
1587
- |---|---|
1588
-
1589
- | Local sidecar | `ws://localhost:3847/ws` |
1590
-
1591
- | Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
1592
-
1593
-
1594
- **Subscribe:**
1595
-
1596
- ```json
1597
-
1598
- { "id": "req-1", "action": "subscribe", "method": "watchAddress", "args": [...] }
1599
-
1600
- ```
1601
-
1602
-
1603
- **Server response:**
1604
-
1605
- ```json
1606
-
1607
- { "event": "data", "id": "req-1", "method": "watchAddress", "symbol": "...", "data": { ... } }
1608
-
1609
- ```
1610
-
1611
-
1612
- **Unsubscribe:**
1613
-
1614
- ```json
1615
-
1616
- { "id": "req-1", "action": "unsubscribe" }
1617
-
1618
- ```
1619
- requestBody:
1620
- content:
1621
- application/json:
1622
- schema:
1623
- title: WatchAddressRequest
1624
- type: object
1625
- properties:
1626
- args:
1627
- type: array
1628
- items:
1629
- type: string
1630
- credentials:
1631
- $ref: '#/components/schemas/ExchangeCredentials'
1632
- responses:
1633
- '200':
1634
- description: Watch Address response (WebSocket data event)
1635
- content:
1636
- application/json:
1637
- schema:
1638
- allOf:
1639
- - $ref: '#/components/schemas/BaseResponse'
1640
- - type: object
1641
- properties:
1642
- data:
1643
- type: object
1644
- '/api/{exchange}/unwatchAddress':
1645
- post:
1646
- summary: Unwatch Address (WebSocket)
1647
- operationId: unwatchAddress
1648
- parameters:
1649
- - $ref: '#/components/parameters/ExchangeParam'
1650
- description: |-
1651
- Stop watching a previously registered wallet address and release its resource updates.
1652
-
1653
- **Transport:** WebSocket
1654
-
1655
- | Environment | URL |
1656
- |---|---|
1657
- | Local sidecar | `ws://localhost:3847/ws` |
1658
- | Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
1659
-
1660
- **Subscribe:**
1661
- ```json
1662
- { "id": "req-1", "action": "subscribe", "method": "unwatchAddress", "args": [...] }
1663
- ```
1664
-
1665
- **Server response:**
1666
- ```json
1667
- { "event": "data", "id": "req-1", "method": "unwatchAddress", "symbol": "...", "data": { ... } }
1668
- ```
1669
-
1670
- **Unsubscribe:**
1671
- ```json
1672
- { "id": "req-1", "action": "unsubscribe" }
1673
- ```
1674
- requestBody:
1675
- content:
1676
- application/json:
1677
- schema:
1678
- title: UnwatchAddressRequest
1679
- type: object
1680
- properties:
1681
- args:
1682
- type: array
1683
- items:
1684
- type: string
1685
- credentials:
1686
- $ref: '#/components/schemas/ExchangeCredentials'
1687
- responses:
1688
- '200':
1689
- description: Unwatch Address response (WebSocket data event)
1690
- content:
1691
- application/json:
1692
- schema:
1693
- $ref: '#/components/schemas/BaseResponse'
1694
1297
  '/api/{exchange}/testDummyMethod':
1695
1298
  post:
1696
1299
  summary: Test Dummy Method
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxt-core",
3
- "version": "2.41.1",
3
+ "version": "2.41.4",
4
4
  "description": "pmxt is a unified prediction market data API. The ccxt for prediction markets.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,8 +29,8 @@
29
29
  "test": "jest -c jest.config.js",
30
30
  "server": "tsx watch src/server/index.ts",
31
31
  "server:prod": "node dist/server/index.js",
32
- "generate:sdk:python": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g python -o ../sdks/python/generated --package-name pmxt_internal --additional-properties=projectName=pmxt-internal,packageVersion=2.41.1,library=urllib3",
33
- "generate:sdk:typescript": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g typescript-fetch -o ../sdks/typescript/generated --additional-properties=npmName=pmxtjs,npmVersion=2.41.1,supportsES6=true,typescriptThreePlus=true && node ../sdks/typescript/scripts/fix-generated.js",
32
+ "generate:sdk:python": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g python -o ../sdks/python/generated --package-name pmxt_internal --additional-properties=projectName=pmxt-internal,packageVersion=2.41.4,library=urllib3",
33
+ "generate:sdk:typescript": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g typescript-fetch -o ../sdks/typescript/generated --additional-properties=npmName=pmxtjs,npmVersion=2.41.4,supportsES6=true,typescriptThreePlus=true && node ../sdks/typescript/scripts/fix-generated.js",
34
34
  "fetch:openapi": "node scripts/fetch-openapi-specs.js",
35
35
  "extract:jsdoc": "node ../scripts/extract-jsdoc.js",
36
36
  "generate:docs": "npm run extract:jsdoc && node ../scripts/generate-api-docs.js",