pmxt-core 2.20.2 → 2.21.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/exchanges/baozi/normalizer.js +1 -1
- package/dist/exchanges/kalshi/api.d.ts +1 -1
- package/dist/exchanges/kalshi/api.js +1 -1
- package/dist/exchanges/kalshi/fetcher.d.ts +14 -4
- package/dist/exchanges/kalshi/normalizer.js +24 -5
- 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/myriad/normalizer.js +1 -1
- package/dist/exchanges/polymarket/api-clob.d.ts +1 -1
- package/dist/exchanges/polymarket/api-clob.js +1 -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/polymarket/auth.js +0 -1
- package/dist/exchanges/probable/api.d.ts +1 -1
- package/dist/exchanges/probable/api.js +1 -1
- package/package.json +5 -3
|
@@ -70,7 +70,7 @@ class BaoziNormalizer {
|
|
|
70
70
|
throw new Error(`Could not parse market for outcome: ${outcomeId}`);
|
|
71
71
|
}
|
|
72
72
|
const outcome = market.outcomes.find(o => o.outcomeId === outcomeId);
|
|
73
|
-
const price = outcome?.price ?? 0
|
|
73
|
+
const price = outcome?.price ?? 0;
|
|
74
74
|
const totalLiquidity = market.liquidity;
|
|
75
75
|
return {
|
|
76
76
|
bids: [{ price, size: totalLiquidity }],
|
|
@@ -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-03-
|
|
3
|
+
* Generated at: 2026-03-15T11:08:08.917Z
|
|
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-03-
|
|
6
|
+
* Generated at: 2026-03-15T11:08:08.917Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.kalshiApiSpec = {
|
|
@@ -61,16 +61,26 @@ export interface KalshiRawOrderBookFp {
|
|
|
61
61
|
export interface KalshiRawTrade {
|
|
62
62
|
trade_id: string;
|
|
63
63
|
created_time: string;
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
/** @deprecated Old API field — new API uses yes_price_dollars */
|
|
65
|
+
yes_price?: number;
|
|
66
|
+
/** New API field: price as a dollar string e.g. "0.4540" */
|
|
67
|
+
yes_price_dollars?: string;
|
|
68
|
+
/** @deprecated Old API field — new API uses count_fp */
|
|
69
|
+
count?: number;
|
|
70
|
+
/** New API field: count as a string e.g. "424.00" */
|
|
71
|
+
count_fp?: string;
|
|
66
72
|
taker_side: string;
|
|
67
73
|
[key: string]: unknown;
|
|
68
74
|
}
|
|
69
75
|
export interface KalshiRawFill {
|
|
70
76
|
fill_id: string;
|
|
71
77
|
created_time: string;
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
/** @deprecated Old API field */
|
|
79
|
+
yes_price?: number;
|
|
80
|
+
yes_price_dollars?: string;
|
|
81
|
+
/** @deprecated Old API field */
|
|
82
|
+
count?: number;
|
|
83
|
+
count_fp?: string;
|
|
74
84
|
side: string;
|
|
75
85
|
order_id: string;
|
|
76
86
|
[key: string]: unknown;
|
|
@@ -24,7 +24,7 @@ class KalshiNormalizer {
|
|
|
24
24
|
normalizeRawMarket(event, market) {
|
|
25
25
|
if (!market)
|
|
26
26
|
return null;
|
|
27
|
-
let price = 0
|
|
27
|
+
let price = 0;
|
|
28
28
|
if (market.last_price) {
|
|
29
29
|
price = (0, price_1.fromKalshiCents)(market.last_price);
|
|
30
30
|
}
|
|
@@ -166,20 +166,39 @@ class KalshiNormalizer {
|
|
|
166
166
|
return { bids, asks, timestamp: Date.now() };
|
|
167
167
|
}
|
|
168
168
|
normalizeTrade(raw, _index) {
|
|
169
|
+
// Kalshi API v2 changed field names:
|
|
170
|
+
// yes_price (cents int) → yes_price_dollars (dollar string)
|
|
171
|
+
// count (int) → count_fp (string)
|
|
172
|
+
const price = raw.yes_price_dollars != null
|
|
173
|
+
? parseFloat(raw.yes_price_dollars)
|
|
174
|
+
: raw.yes_price != null
|
|
175
|
+
? (0, price_1.fromKalshiCents)(raw.yes_price)
|
|
176
|
+
: 0;
|
|
177
|
+
const amount = raw.count_fp != null
|
|
178
|
+
? parseFloat(raw.count_fp)
|
|
179
|
+
: raw.count ?? 0;
|
|
169
180
|
return {
|
|
170
181
|
id: raw.trade_id,
|
|
171
182
|
timestamp: new Date(raw.created_time).getTime(),
|
|
172
|
-
price
|
|
173
|
-
amount
|
|
183
|
+
price,
|
|
184
|
+
amount,
|
|
174
185
|
side: raw.taker_side === 'yes' ? 'buy' : 'sell',
|
|
175
186
|
};
|
|
176
187
|
}
|
|
177
188
|
normalizeUserTrade(raw, _index) {
|
|
189
|
+
const price = raw.yes_price_dollars != null
|
|
190
|
+
? parseFloat(raw.yes_price_dollars)
|
|
191
|
+
: raw.yes_price != null
|
|
192
|
+
? (0, price_1.fromKalshiCents)(raw.yes_price)
|
|
193
|
+
: 0;
|
|
194
|
+
const amount = raw.count_fp != null
|
|
195
|
+
? parseFloat(raw.count_fp)
|
|
196
|
+
: raw.count ?? 0;
|
|
178
197
|
return {
|
|
179
198
|
id: raw.fill_id,
|
|
180
199
|
timestamp: new Date(raw.created_time).getTime(),
|
|
181
|
-
price
|
|
182
|
-
amount
|
|
200
|
+
price,
|
|
201
|
+
amount,
|
|
183
202
|
side: raw.side === 'yes' ? 'buy' : 'sell',
|
|
184
203
|
orderId: raw.order_id,
|
|
185
204
|
};
|
|
@@ -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-03-
|
|
3
|
+
* Generated at: 2026-03-15T11:08:08.957Z
|
|
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-03-
|
|
6
|
+
* Generated at: 2026-03-15T11:08:08.957Z
|
|
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-03-
|
|
3
|
+
* Generated at: 2026-03-15T11:08:08.968Z
|
|
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-03-
|
|
6
|
+
* Generated at: 2026-03-15T11:08:08.968Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.myriadApiSpec = {
|
|
@@ -113,7 +113,7 @@ class MyriadNormalizer {
|
|
|
113
113
|
if (!outcome) {
|
|
114
114
|
return { bids: [], asks: [], timestamp: Date.now() };
|
|
115
115
|
}
|
|
116
|
-
const price = Number(outcome.price) || 0
|
|
116
|
+
const price = Number(outcome.price) || 0;
|
|
117
117
|
const liquidity = Number(raw.liquidity || 0);
|
|
118
118
|
const size = liquidity > 0 ? liquidity : 1;
|
|
119
119
|
return {
|
|
@@ -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-03-
|
|
3
|
+
* Generated at: 2026-03-15T11:08:08.924Z
|
|
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-03-
|
|
6
|
+
* Generated at: 2026-03-15T11:08:08.924Z
|
|
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-03-
|
|
3
|
+
* Generated at: 2026-03-15T11:08:08.939Z
|
|
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-03-
|
|
6
|
+
* Generated at: 2026-03-15T11:08:08.939Z
|
|
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-03-
|
|
3
|
+
* Generated at: 2026-03-15T11:08:08.936Z
|
|
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-03-
|
|
6
|
+
* Generated at: 2026-03-15T11:08:08.936Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.polymarketGammaSpec = {
|
|
@@ -71,7 +71,6 @@ class PolymarketAuth {
|
|
|
71
71
|
console.log('[PolymarketAuth] Attempting to create new API key...');
|
|
72
72
|
try {
|
|
73
73
|
creds = await l1Client.createApiKey();
|
|
74
|
-
console.log('[PolymarketAuth] createApiKey returned:', JSON.stringify(creds, null, 2));
|
|
75
74
|
}
|
|
76
75
|
catch (createError) {
|
|
77
76
|
throw errors_1.polymarketErrorMapper.mapError(createError);
|
|
@@ -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-03-
|
|
3
|
+
* Generated at: 2026-03-15T11:08:08.962Z
|
|
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-03-
|
|
6
|
+
* Generated at: 2026-03-15T11:08:08.962Z
|
|
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.
|
|
3
|
+
"version": "2.21.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.21.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.21.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",
|
|
@@ -66,11 +66,13 @@
|
|
|
66
66
|
"@types/cors": "^2.8.19",
|
|
67
67
|
"@types/jest": "^30.0.0",
|
|
68
68
|
"@types/node": "^25.0.3",
|
|
69
|
+
"@types/supertest": "^7.2.0",
|
|
69
70
|
"@types/ws": "^8.5.10",
|
|
70
71
|
"esbuild": "^0.24.2",
|
|
71
72
|
"handlebars": "^4.7.8",
|
|
72
73
|
"identity-obj-proxy": "^3.0.0",
|
|
73
74
|
"js-yaml": "^3.14.2",
|
|
75
|
+
"supertest": "^7.2.2",
|
|
74
76
|
"ts-jest": "^29.4.6",
|
|
75
77
|
"typescript": "^5.9.3"
|
|
76
78
|
},
|