pmxt-core 2.35.21 → 2.35.22

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-04-28T18:19:17.647Z
3
+ * Generated at: 2026-04-28T19:17:51.976Z
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-04-28T18:19:17.647Z
6
+ * Generated at: 2026-04-28T19:17:51.976Z
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-04-28T18:19:17.686Z
3
+ * Generated at: 2026-04-28T19:17:52.015Z
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-04-28T18:19:17.686Z
6
+ * Generated at: 2026-04-28T19:17:52.015Z
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-04-28T18:19:17.697Z
3
+ * Generated at: 2026-04-28T19:17:52.026Z
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-04-28T18:19:17.697Z
6
+ * Generated at: 2026-04-28T19:17:52.026Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.myriadApiSpec = {
@@ -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-04-28T18:19:17.700Z
3
+ * Generated at: 2026-04-28T19:17:52.030Z
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-04-28T18:19:17.700Z
6
+ * Generated at: 2026-04-28T19:17:52.030Z
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-04-28T18:19:17.654Z
3
+ * Generated at: 2026-04-28T19:17:51.984Z
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-04-28T18:19:17.654Z
6
+ * Generated at: 2026-04-28T19:17:51.984Z
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-04-28T18:19:17.668Z
3
+ * Generated at: 2026-04-28T19:17:51.999Z
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-04-28T18:19:17.668Z
6
+ * Generated at: 2026-04-28T19:17:51.999Z
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-04-28T18:19:17.666Z
3
+ * Generated at: 2026-04-28T19:17:51.996Z
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-04-28T18:19:17.666Z
6
+ * Generated at: 2026-04-28T19:17:51.996Z
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-04-28T18:19:17.691Z
3
+ * Generated at: 2026-04-28T19:17:52.020Z
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-04-28T18:19:17.691Z
6
+ * Generated at: 2026-04-28T19:17:52.020Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.probableApiSpec = {
@@ -40,7 +40,12 @@ class Router extends BaseExchange_1.PredictionMarketExchange {
40
40
  // -----------------------------------------------------------------------
41
41
  async fetchMarketMatches(params = {}) {
42
42
  if (params.market && !params.marketId) {
43
- params = { ...params, marketId: params.market.marketId };
43
+ if (params.market.slug && !params.slug) {
44
+ params = { ...params, slug: params.market.slug };
45
+ }
46
+ else {
47
+ params = { ...params, marketId: params.market.marketId };
48
+ }
44
49
  }
45
50
  // Browse mode: no specific market identifier → return all matches
46
51
  // from the catalog, with both sides of each pair.
@@ -65,22 +70,8 @@ class Router extends BaseExchange_1.PredictionMarketExchange {
65
70
  * Each result includes sourceMarket (one side) and market (the other).
66
71
  */
67
72
  async fetchMarketMatchesBrowse(params) {
68
- const bulkParams = {
69
- minSpread: params.minDifference,
70
- category: params.category,
71
- limit: params.limit,
72
- relations: params.relation ? [params.relation] : undefined,
73
- };
74
- const pairs = await this.fetchArbitrageInternal(bulkParams);
75
- return pairs.map((opp) => ({
76
- sourceMarket: opp.marketA,
77
- market: opp.marketB,
78
- relation: opp.relation ?? 'identity',
79
- confidence: opp.confidence ?? 0,
80
- reasoning: opp.reasoning ?? null,
81
- bestBid: opp.sellPrice ?? null,
82
- bestAsk: null,
83
- }));
73
+ const results = await this.client.browseMarketMatches(params);
74
+ return Array.isArray(results) ? results : [];
84
75
  }
85
76
  /** @deprecated Use {@link fetchMarketMatches} instead. */
86
77
  async fetchMatches(params) {
@@ -92,7 +83,12 @@ class Router extends BaseExchange_1.PredictionMarketExchange {
92
83
  // -----------------------------------------------------------------------
93
84
  async fetchEventMatches(params = {}) {
94
85
  if (params.event && !params.eventId) {
95
- params = { ...params, eventId: params.event.id };
86
+ if (params.event.slug && !params.slug) {
87
+ params = { ...params, slug: params.event.slug };
88
+ }
89
+ else {
90
+ params = { ...params, eventId: params.event.id };
91
+ }
96
92
  }
97
93
  // Browse mode: no specific event identifier → return all matches
98
94
  const hasIdentifier = params.eventId || params.slug;
@@ -1,9 +1,10 @@
1
- import type { FetchMatchesParams, FetchEventMatchesParams, RouterMarketSearchParams, RouterEventSearchParams } from './types';
1
+ import type { FetchMatchesParams, FetchMarketMatchesParams, FetchEventMatchesParams, RouterMarketSearchParams, RouterEventSearchParams } from './types';
2
2
  export declare class PmxtApiClient {
3
3
  private readonly http;
4
4
  constructor(apiKey: string, baseUrl?: string);
5
5
  getMarketMatches(params: FetchMatchesParams): Promise<any>;
6
6
  getEventMatches(params: FetchEventMatchesParams): Promise<any>;
7
+ browseMarketMatches(params: FetchMarketMatchesParams): Promise<any>;
7
8
  browseEventMatches(params: FetchEventMatchesParams): Promise<any>;
8
9
  searchMarkets(params?: RouterMarketSearchParams): Promise<any>;
9
10
  searchEvents(params?: RouterEventSearchParams): Promise<any>;
@@ -51,6 +51,31 @@ class PmxtApiClient {
51
51
  const res = await this.request('GET', `/v0/events/${encodeURIComponent(id)}/matches`, query);
52
52
  return res.data;
53
53
  }
54
+ async browseMarketMatches(params) {
55
+ const query = {};
56
+ if (params.query)
57
+ query.query = params.query;
58
+ if (params.category)
59
+ query.category = params.category;
60
+ if (params.relation)
61
+ query.relation = params.relation;
62
+ if (params.minConfidence !== undefined)
63
+ query.minConfidence = String(params.minConfidence);
64
+ if (params.limit !== undefined)
65
+ query.limit = String(params.limit);
66
+ const res = await this.request('GET', '/v0/matched-markets', query);
67
+ // Reshape { marketA, marketB, ... } pairs into MatchResult shape
68
+ const pairs = Array.isArray(res.data) ? res.data : [];
69
+ return pairs.map((pair) => ({
70
+ sourceMarket: pair.marketA,
71
+ market: pair.marketB,
72
+ relation: pair.relation || 'identity',
73
+ confidence: pair.confidence || 0,
74
+ reasoning: pair.reasoning || null,
75
+ bestBid: null,
76
+ bestAsk: null,
77
+ }));
78
+ }
54
79
  async browseEventMatches(params) {
55
80
  const query = {};
56
81
  if (params.query)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxt-core",
3
- "version": "2.35.21",
3
+ "version": "2.35.22",
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.35.21,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.35.21,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.35.22,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.35.22,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",