pmxt-core 2.35.32 → 2.36.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.
- package/dist/BaseExchange.d.ts +5 -0
- package/dist/BaseExchange.js +3 -3
- package/dist/exchanges/kalshi/api.d.ts +1 -1
- package/dist/exchanges/kalshi/api.js +1 -1
- package/dist/exchanges/limitless/api.d.ts +1 -1
- package/dist/exchanges/limitless/api.js +1 -1
- package/dist/exchanges/myriad/api.d.ts +1 -1
- package/dist/exchanges/myriad/api.js +1 -1
- package/dist/exchanges/opinion/api.d.ts +1 -1
- package/dist/exchanges/opinion/api.js +1 -1
- package/dist/exchanges/polymarket/api-clob.d.ts +2 -1
- package/dist/exchanges/polymarket/api-clob.js +2 -1
- package/dist/exchanges/polymarket/api-data.d.ts +1 -1
- package/dist/exchanges/polymarket/api-data.js +1 -1
- package/dist/exchanges/polymarket/api-gamma.d.ts +1 -1
- package/dist/exchanges/polymarket/api-gamma.js +1 -1
- package/dist/exchanges/probable/api.d.ts +1 -1
- package/dist/exchanges/probable/api.js +1 -1
- package/dist/utils/openapi.js +17 -3
- package/package.json +3 -3
package/dist/BaseExchange.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ export interface ApiEndpoint {
|
|
|
12
12
|
isPrivate?: boolean;
|
|
13
13
|
/** Identifier used to generate the implicit API method name. */
|
|
14
14
|
operationId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* When set, requests use this base URL instead of the descriptor default
|
|
17
|
+
* (OpenAPI path- or operation-level `servers` override).
|
|
18
|
+
*/
|
|
19
|
+
baseUrl?: string;
|
|
15
20
|
}
|
|
16
21
|
export interface ApiDescriptor {
|
|
17
22
|
/** Base URL that all endpoint paths are resolved against. */
|
package/dist/BaseExchange.js
CHANGED
|
@@ -982,7 +982,7 @@ class PredictionMarketExchange {
|
|
|
982
982
|
if (name in this) {
|
|
983
983
|
continue;
|
|
984
984
|
}
|
|
985
|
-
this[name] = this.createImplicitMethod(name, endpoint, descriptor.baseUrl);
|
|
985
|
+
this[name] = this.createImplicitMethod(name, endpoint, endpoint.baseUrl ?? descriptor.baseUrl);
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
/**
|
|
@@ -1002,7 +1002,7 @@ class PredictionMarketExchange {
|
|
|
1002
1002
|
/**
|
|
1003
1003
|
* Creates an async function for an implicit API endpoint.
|
|
1004
1004
|
*/
|
|
1005
|
-
createImplicitMethod(name, endpoint,
|
|
1005
|
+
createImplicitMethod(name, endpoint, resolvedBaseUrl) {
|
|
1006
1006
|
return async (params) => {
|
|
1007
1007
|
const allParams = { ...(params || {}) };
|
|
1008
1008
|
// Substitute path parameters like {ticker} from params
|
|
@@ -1020,7 +1020,7 @@ class PredictionMarketExchange {
|
|
|
1020
1020
|
if (endpoint.isPrivate) {
|
|
1021
1021
|
headers = this.sign(endpoint.method, resolvedPath, allParams);
|
|
1022
1022
|
}
|
|
1023
|
-
const url = `${
|
|
1023
|
+
const url = `${resolvedBaseUrl}${resolvedPath}`;
|
|
1024
1024
|
const method = endpoint.method.toUpperCase();
|
|
1025
1025
|
try {
|
|
1026
1026
|
let response;
|
|
@@ -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-
|
|
3
|
+
* Generated at: 2026-05-03T04:33:34.890Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-05-03T04:33:34.890Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-05-03T04:33:34.936Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-05-03T04:33:34.936Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-05-03T04:33:34.948Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-05-03T04:33:34.948Z
|
|
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-05-
|
|
3
|
+
* Generated at: 2026-05-03T04:33:34.953Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-05-03T04:33:34.953Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-05-03T04:33:34.896Z
|
|
4
4
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
5
5
|
*/
|
|
6
6
|
export declare const polymarketClobSpec: {
|
|
@@ -349,6 +349,7 @@ export declare const polymarketClobSpec: {
|
|
|
349
349
|
};
|
|
350
350
|
"/geoblock": {
|
|
351
351
|
get: {
|
|
352
|
+
operationId: string;
|
|
352
353
|
summary: string;
|
|
353
354
|
tags: string[];
|
|
354
355
|
servers: {
|
|
@@ -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-
|
|
6
|
+
* Generated at: 2026-05-03T04:33:34.896Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.polymarketClobSpec = {
|
|
@@ -520,6 +520,7 @@ exports.polymarketClobSpec = {
|
|
|
520
520
|
},
|
|
521
521
|
"/geoblock": {
|
|
522
522
|
"get": {
|
|
523
|
+
"operationId": "getGeoblock",
|
|
523
524
|
"summary": "Check Geoblock Status",
|
|
524
525
|
"tags": [
|
|
525
526
|
"System"
|
|
@@ -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-
|
|
3
|
+
* Generated at: 2026-05-03T04:33:34.913Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-05-03T04:33:34.913Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-05-03T04:33:34.909Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-05-03T04:33:34.909Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-05-03T04:33:34.941Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-05-03T04:33:34.941Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.probableApiSpec = {
|
package/dist/utils/openapi.js
CHANGED
|
@@ -37,12 +37,25 @@ function parseOpenApiSpec(spec, baseUrl) {
|
|
|
37
37
|
// Inherit top-level security when operations don't define their own
|
|
38
38
|
const topLevelSecurity = !!(spec.security && spec.security.length > 0);
|
|
39
39
|
const paths = spec.paths || {};
|
|
40
|
-
for (const [path,
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
for (const [path, pathItem] of Object.entries(paths)) {
|
|
41
|
+
if (!pathItem || typeof pathItem !== 'object') {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const pathServerUrl = Array.isArray(pathItem.servers) && pathItem.servers[0]?.url
|
|
45
|
+
? String(pathItem.servers[0].url).replace(/\/$/, '')
|
|
46
|
+
: undefined;
|
|
47
|
+
for (const [httpMethod, operation] of Object.entries(pathItem)) {
|
|
48
|
+
// Skip non-HTTP-method keys like "parameters", "servers"
|
|
43
49
|
if (!['get', 'post', 'put', 'patch', 'delete'].includes(httpMethod.toLowerCase())) {
|
|
44
50
|
continue;
|
|
45
51
|
}
|
|
52
|
+
if (!operation || typeof operation !== 'object') {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const opServerUrl = Array.isArray(operation.servers) && operation.servers[0]?.url
|
|
56
|
+
? String(operation.servers[0].url).replace(/\/$/, '')
|
|
57
|
+
: undefined;
|
|
58
|
+
const endpointBaseUrl = opServerUrl || pathServerUrl;
|
|
46
59
|
const name = operation.operationId || generateMethodName(httpMethod, path);
|
|
47
60
|
const isPrivate = operation.security !== undefined
|
|
48
61
|
? !!(operation.security && operation.security.length > 0)
|
|
@@ -52,6 +65,7 @@ function parseOpenApiSpec(spec, baseUrl) {
|
|
|
52
65
|
path,
|
|
53
66
|
isPrivate,
|
|
54
67
|
operationId: operation.operationId,
|
|
68
|
+
...(endpointBaseUrl ? { baseUrl: endpointBaseUrl } : {}),
|
|
55
69
|
};
|
|
56
70
|
}
|
|
57
71
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmxt-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.36.0",
|
|
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.
|
|
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.
|
|
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.36.0,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.36.0,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",
|