pmxt-core 2.40.1 → 2.40.3

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-08T23:06:00.095Z
3
+ * Generated at: 2026-05-09T06:13:38.024Z
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-08T23:06:00.095Z
6
+ * Generated at: 2026-05-09T06:13:38.024Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.kalshiApiSpec = {
@@ -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-08T23:06:00.134Z
3
+ * Generated at: 2026-05-09T06:13:38.063Z
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-08T23:06:00.134Z
6
+ * Generated at: 2026-05-09T06:13:38.063Z
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-08T23:06:00.146Z
3
+ * Generated at: 2026-05-09T06:13:38.074Z
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-08T23:06:00.146Z
6
+ * Generated at: 2026-05-09T06:13:38.074Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.myriadApiSpec = {
@@ -83,20 +83,22 @@ class MyriadFetcher {
83
83
  if (params.slug) {
84
84
  return this.fetchRawQuestionById(params.slug);
85
85
  }
86
+ // Use /markets (complete endpoint) instead of /questions (only
87
+ // returns BNB-chain candle markets). Each market is wrapped as a
88
+ // synthetic single-market question for compatibility with the
89
+ // event-based ingest pipeline.
86
90
  const limit = params.limit || 100;
87
- const queryParams = {
88
- page: 1,
89
- limit: Math.min(limit, 100),
90
- };
91
- if (params.query) {
92
- queryParams.keyword = params.query;
93
- }
94
- const response = await this.ctx.http.get(`${this.baseUrl}/questions`, {
95
- params: queryParams,
96
- headers: this.ctx.getHeaders(),
91
+ const markets = await this.fetchRawMarkets({
92
+ limit,
93
+ status: params.status || 'active',
94
+ sort: 'volume',
95
+ query: params.query,
97
96
  });
98
- const questions = response.data.data || response.data.questions || [];
99
- return questions.slice(0, limit);
97
+ return markets.map((m) => ({
98
+ id: m.id,
99
+ title: m.title,
100
+ markets: [m],
101
+ }));
100
102
  }
101
103
  catch (error) {
102
104
  throw errors_1.myriadErrorMapper.mapError(error);
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MyriadNormalizer = void 0;
4
4
  const market_utils_1 = require("../../utils/market-utils");
5
5
  const price_1 = require("./price");
6
+ const utils_1 = require("./utils");
6
7
  function selectTimeframe(interval) {
7
8
  switch (interval) {
8
9
  case '1m':
@@ -29,6 +30,7 @@ class MyriadNormalizer {
29
30
  price: Number(o.price) || 0,
30
31
  priceChange24h: o.priceChange24h != null ? Number(o.priceChange24h) : undefined,
31
32
  }));
33
+ const status = typeof raw.state === 'string' ? (0, utils_1.mapMarketState)(raw.state) : undefined;
32
34
  const um = {
33
35
  marketId: `${raw.networkId}:${raw.id}`,
34
36
  eventId: raw.questionId ? String(raw.questionId) : undefined,
@@ -42,6 +44,7 @@ class MyriadNormalizer {
42
44
  url: `https://myriad.markets/markets/${raw.slug || raw.id}`,
43
45
  image: raw.imageUrl,
44
46
  tags: raw.topics || [],
47
+ status,
45
48
  };
46
49
  (0, market_utils_1.addBinaryOutcomes)(um);
47
50
  return um;
@@ -51,9 +54,37 @@ class MyriadNormalizer {
51
54
  return null;
52
55
  const markets = [];
53
56
  for (const m of raw.markets || []) {
54
- const um = this.normalizeMarket(m);
55
- if (um)
56
- markets.push(um);
57
+ const rawOutcomes = m.outcomes || [];
58
+ // Binary markets (2 outcomes): keep as-is.
59
+ // Multi-outcome markets (>2): expand each outcome into a separate
60
+ // binary market with a specific title (e.g. "Premier League - Arsenal")
61
+ // so the matching engine can find cross-venue identity matches against
62
+ // venues like Polymarket that split each outcome into its own market.
63
+ if (rawOutcomes.length <= 2) {
64
+ const um = this.normalizeMarket(m);
65
+ if (um)
66
+ markets.push(um);
67
+ }
68
+ else {
69
+ const eventTitle = m.title || raw.title || '';
70
+ for (const outcome of rawOutcomes) {
71
+ const outcomeTitle = outcome.title || `Outcome ${outcome.id}`;
72
+ const syntheticMarket = {
73
+ ...m,
74
+ id: m.id,
75
+ title: `${eventTitle} - ${outcomeTitle}`,
76
+ outcomes: [
77
+ { ...outcome, title: outcomeTitle },
78
+ { id: -(outcome.id || 0), title: `Not ${outcomeTitle}`, price: 1 - (Number(outcome.price) || 0) },
79
+ ],
80
+ };
81
+ const um = this.normalizeMarket(syntheticMarket);
82
+ if (um) {
83
+ um.marketId = `${m.networkId}:${m.id}:${outcome.id}`;
84
+ markets.push(um);
85
+ }
86
+ }
87
+ }
57
88
  }
58
89
  return {
59
90
  id: String(raw.id),
@@ -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-08T23:06:00.151Z
3
+ * Generated at: 2026-05-09T06:13:38.077Z
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-08T23:06:00.151Z
6
+ * Generated at: 2026-05-09T06:13:38.077Z
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-08T23:06:00.102Z
3
+ * Generated at: 2026-05-09T06:13:38.032Z
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-08T23:06:00.102Z
6
+ * Generated at: 2026-05-09T06:13:38.032Z
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-08T23:06:00.118Z
3
+ * Generated at: 2026-05-09T06:13:38.046Z
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-08T23:06:00.118Z
6
+ * Generated at: 2026-05-09T06:13:38.046Z
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-08T23:06:00.115Z
3
+ * Generated at: 2026-05-09T06:13:38.043Z
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-08T23:06:00.115Z
6
+ * Generated at: 2026-05-09T06:13:38.043Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.polymarketGammaSpec = {
@@ -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-08T23:06:00.139Z
3
+ * Generated at: 2026-05-09T06:13:38.068Z
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-08T23:06:00.139Z
6
+ * Generated at: 2026-05-09T06:13:38.068Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.probableApiSpec = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxt-core",
3
- "version": "2.40.1",
3
+ "version": "2.40.3",
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.40.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.40.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.40.3,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.40.3,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",