pmxt-core 2.17.2 → 2.17.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.
@@ -28,7 +28,6 @@ async function fetchEvents(connection, params) {
28
28
  category: m.category,
29
29
  tags: m.tags,
30
30
  };
31
- m.event = unifiedEvent;
32
31
  return unifiedEvent;
33
32
  });
34
33
  }
@@ -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-02-24T11:57:32.958Z
3
+ * Generated at: 2026-02-24T13:56:16.070Z
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-02-24T11:57:32.958Z
6
+ * Generated at: 2026-02-24T13:56:16.070Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.kalshiApiSpec = {
@@ -32,9 +32,6 @@ async function fetchEventByTicker(eventTicker, callApi) {
32
32
  category: event.category,
33
33
  tags: event.tags || [],
34
34
  };
35
- for (const market of markets) {
36
- market.event = unifiedEvent;
37
- }
38
35
  return [unifiedEvent];
39
36
  }
40
37
  function rawEventToUnified(event) {
@@ -58,9 +55,6 @@ function rawEventToUnified(event) {
58
55
  category: event.category,
59
56
  tags: event.tags || [],
60
57
  };
61
- for (const market of markets) {
62
- market.event = unifiedEvent;
63
- }
64
58
  return unifiedEvent;
65
59
  }
66
60
  async function fetchAllWithStatus(callApi, apiStatus) {
@@ -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-02-24T11:57:33.000Z
3
+ * Generated at: 2026-02-24T13:56:16.119Z
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-02-24T11:57:33.000Z
6
+ * Generated at: 2026-02-24T13:56:16.119Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.limitlessApiSpec = {
@@ -69,9 +69,6 @@ async function fetchEventBySlug(slug, http = axios_1.default) {
69
69
  category: market.categories?.[0],
70
70
  tags: market.tags || []
71
71
  };
72
- for (const m of marketsList) {
73
- m.event = unifiedEvent;
74
- }
75
72
  return unifiedEvent;
76
73
  }
77
74
  function rawMarketToEvent(market) {
@@ -97,9 +94,6 @@ function rawMarketToEvent(market) {
97
94
  category: market.categories?.[0],
98
95
  tags: market.tags || []
99
96
  };
100
- for (const m of marketsList) {
101
- m.event = unifiedEvent;
102
- }
103
97
  return unifiedEvent;
104
98
  }
105
99
  async function fetchEvents(params, callApi, http = axios_1.default) {
@@ -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-02-24T11:57:33.012Z
3
+ * Generated at: 2026-02-24T13:56:16.133Z
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-02-24T11:57:33.012Z
6
+ * Generated at: 2026-02-24T13:56:16.133Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.myriadApiSpec = {
@@ -97,8 +97,5 @@ function mapQuestionToEvent(question) {
97
97
  markets,
98
98
  url: `https://myriad.markets`,
99
99
  };
100
- for (const m of markets) {
101
- m.event = unifiedEvent;
102
- }
103
100
  return unifiedEvent;
104
101
  }
@@ -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-02-24T11:57:32.965Z
3
+ * Generated at: 2026-02-24T13:56:16.077Z
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-02-24T11:57:32.965Z
6
+ * Generated at: 2026-02-24T13:56:16.077Z
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-02-24T11:57:32.981Z
3
+ * Generated at: 2026-02-24T13:56:16.096Z
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-02-24T11:57:32.981Z
6
+ * Generated at: 2026-02-24T13:56:16.096Z
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-02-24T11:57:32.978Z
3
+ * Generated at: 2026-02-24T13:56:16.092Z
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-02-24T11:57:32.978Z
6
+ * Generated at: 2026-02-24T13:56:16.092Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.polymarketGammaSpec = {
@@ -28,9 +28,6 @@ function mapRawEventToUnified(event) {
28
28
  category: event.category || event.tags?.[0]?.label,
29
29
  tags: event.tags?.map((t) => t.label) || []
30
30
  };
31
- for (const market of markets) {
32
- market.event = unifiedEvent;
33
- }
34
31
  return unifiedEvent;
35
32
  }
36
33
  async function fetchEvents(params, http = axios_1.default) {
@@ -57,6 +57,16 @@ class PolymarketExchange extends BaseExchange_1.PredictionMarketExchange {
57
57
  super(credentials);
58
58
  this.rateLimit = 200;
59
59
  this.wsConfig = wsConfig;
60
+ // Add browser-mimicking headers to help pass Cloudflare bot detection on the Gamma API.
61
+ // Origin/Referer make requests look like same-site CORS calls from the Polymarket frontend.
62
+ Object.assign(this.http.defaults.headers.common, {
63
+ 'Accept': 'application/json, */*',
64
+ 'Accept-Language': 'en-US,en;q=0.9',
65
+ 'Origin': 'https://polymarket.com',
66
+ 'Referer': 'https://polymarket.com/',
67
+ 'sec-fetch-mode': 'cors',
68
+ 'sec-fetch-site': 'same-site',
69
+ });
60
70
  // Initialize auth if credentials are provided
61
71
  if (credentials?.privateKey) {
62
72
  this.auth = new auth_1.PolymarketAuth(credentials);
@@ -157,9 +167,6 @@ class PolymarketExchange extends BaseExchange_1.PredictionMarketExchange {
157
167
  category: event.category || event.tags?.[0]?.label,
158
168
  tags: event.tags?.map((t) => t.label) || [],
159
169
  };
160
- for (const market of markets) {
161
- market.event = unifiedEvent;
162
- }
163
170
  return unifiedEvent;
164
171
  });
165
172
  }
@@ -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-02-24T11:57:33.006Z
3
+ * Generated at: 2026-02-24T13:56:16.126Z
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-02-24T11:57:33.006Z
6
+ * Generated at: 2026-02-24T13:56:16.126Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.probableApiSpec = {
@@ -68,9 +68,6 @@ function mapEventToUnified(event) {
68
68
  category: event.category || undefined,
69
69
  tags: event.tags || [],
70
70
  };
71
- for (const market of markets) {
72
- market.event = unifiedEvent;
73
- }
74
71
  return unifiedEvent;
75
72
  }
76
73
  async function enrichMarketsWithPrices(markets, callMidpoint) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxt-core",
3
- "version": "2.17.2",
3
+ "version": "2.17.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.17.2,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.17.2,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.17.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.17.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",