pmxt-core 2.34.1 → 2.34.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.
- 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/limitless/index.d.ts +11 -0
- package/dist/exchanges/limitless/index.js +43 -4
- 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/opinion/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/probable/api.d.ts +1 -1
- package/dist/exchanges/probable/api.js +1 -1
- package/package.json +3 -3
|
@@ -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-
|
|
3
|
+
* Generated at: 2026-04-24T12:14:13.697Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-04-24T12:14:13.697Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-04-24T12:14:13.734Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-04-24T12:14:13.734Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.limitlessApiSpec = {
|
|
@@ -20,6 +20,7 @@ export declare class LimitlessExchange extends PredictionMarketExchange {
|
|
|
20
20
|
private ws?;
|
|
21
21
|
private readonly fetcher;
|
|
22
22
|
private readonly normalizer;
|
|
23
|
+
private readonly outcomeToSlug;
|
|
23
24
|
constructor(options?: ExchangeCredentials | LimitlessExchangeOptions);
|
|
24
25
|
get name(): string;
|
|
25
26
|
private getHeaders;
|
|
@@ -88,6 +89,16 @@ export declare class LimitlessExchange extends PredictionMarketExchange {
|
|
|
88
89
|
private ensureClient;
|
|
89
90
|
private ensureAuth;
|
|
90
91
|
private ensureWs;
|
|
92
|
+
/**
|
|
93
|
+
* Populate the outcomeId -> slug lookup from a list of unified markets.
|
|
94
|
+
*/
|
|
95
|
+
private indexOutcomeSlugs;
|
|
96
|
+
/**
|
|
97
|
+
* Resolve an outcomeId to the market slug required by the Limitless API.
|
|
98
|
+
* Returns the id unchanged if it already looks like a slug (no digits-only check)
|
|
99
|
+
* or if no mapping is found.
|
|
100
|
+
*/
|
|
101
|
+
private resolveSlug;
|
|
91
102
|
/**
|
|
92
103
|
* Fetch a composite activity snapshot for a Base-chain address from the Limitless
|
|
93
104
|
* public portfolio API and Base RPC. Used internally by the BaseSubscriber polling loop.
|
|
@@ -26,6 +26,7 @@ class LimitlessExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
26
26
|
ws;
|
|
27
27
|
fetcher;
|
|
28
28
|
normalizer;
|
|
29
|
+
outcomeToSlug = new Map();
|
|
29
30
|
constructor(options) {
|
|
30
31
|
// Support both old signature (credentials only) and new signature (options object)
|
|
31
32
|
let credentials;
|
|
@@ -87,22 +88,27 @@ class LimitlessExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
87
88
|
const rawMarkets = await this.fetcher.fetchRawMarkets(params);
|
|
88
89
|
// Handle outcomeId filtering (client-side)
|
|
89
90
|
if (params?.outcomeId) {
|
|
90
|
-
|
|
91
|
+
const results = rawMarkets
|
|
91
92
|
.map((raw) => this.normalizer.normalizeMarket(raw))
|
|
92
93
|
.filter((m) => m !== null && m.outcomes.length > 0)
|
|
93
94
|
.filter(m => m.outcomes.some(o => o.outcomeId === params.outcomeId));
|
|
95
|
+
this.indexOutcomeSlugs(results);
|
|
96
|
+
return results;
|
|
94
97
|
}
|
|
95
98
|
// Handle search results -- filter and limit
|
|
96
99
|
if (params?.query) {
|
|
97
|
-
|
|
100
|
+
const results = rawMarkets
|
|
98
101
|
.map((raw) => this.normalizer.normalizeMarket(raw))
|
|
99
102
|
.filter((m) => m !== null && m.outcomes.length > 0)
|
|
100
103
|
.slice(0, params?.limit || 250000);
|
|
104
|
+
this.indexOutcomeSlugs(results);
|
|
105
|
+
return results;
|
|
101
106
|
}
|
|
102
107
|
// Default fetch -- normalize, filter, sort, apply offset/limit
|
|
103
108
|
const unifiedMarkets = rawMarkets
|
|
104
109
|
.map((raw) => this.normalizer.normalizeMarket(raw))
|
|
105
110
|
.filter((m) => m !== null && m.outcomes.length > 0);
|
|
111
|
+
this.indexOutcomeSlugs(unifiedMarkets);
|
|
106
112
|
if (params?.sort === 'volume') {
|
|
107
113
|
unifiedMarkets.sort((a, b) => (b.volume ?? 0) - (a.volume ?? 0));
|
|
108
114
|
}
|
|
@@ -118,11 +124,13 @@ class LimitlessExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
118
124
|
.filter((e) => e !== null);
|
|
119
125
|
}
|
|
120
126
|
async fetchOHLCV(id, params) {
|
|
121
|
-
const
|
|
127
|
+
const slug = await this.resolveSlug(id);
|
|
128
|
+
const rawPrices = await this.fetcher.fetchRawOHLCV(slug, params);
|
|
122
129
|
return this.normalizer.normalizeOHLCV(rawPrices, params);
|
|
123
130
|
}
|
|
124
131
|
async fetchOrderBook(id) {
|
|
125
|
-
const
|
|
132
|
+
const slug = await this.resolveSlug(id);
|
|
133
|
+
const rawOrderBook = await this.fetcher.fetchRawOrderBook(slug);
|
|
126
134
|
return this.normalizer.normalizeOrderBook(rawOrderBook, id);
|
|
127
135
|
}
|
|
128
136
|
async fetchTrades(id, params) {
|
|
@@ -421,6 +429,37 @@ class LimitlessExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
421
429
|
}
|
|
422
430
|
return this.ws;
|
|
423
431
|
}
|
|
432
|
+
/**
|
|
433
|
+
* Populate the outcomeId -> slug lookup from a list of unified markets.
|
|
434
|
+
*/
|
|
435
|
+
indexOutcomeSlugs(markets) {
|
|
436
|
+
for (const market of markets) {
|
|
437
|
+
if (!market.slug)
|
|
438
|
+
continue;
|
|
439
|
+
for (const outcome of market.outcomes) {
|
|
440
|
+
this.outcomeToSlug.set(outcome.outcomeId, market.slug);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Resolve an outcomeId to the market slug required by the Limitless API.
|
|
446
|
+
* Returns the id unchanged if it already looks like a slug (no digits-only check)
|
|
447
|
+
* or if no mapping is found.
|
|
448
|
+
*/
|
|
449
|
+
async resolveSlug(outcomeId) {
|
|
450
|
+
const cached = this.outcomeToSlug.get(outcomeId);
|
|
451
|
+
if (cached)
|
|
452
|
+
return cached;
|
|
453
|
+
// If the id doesn't look like a numeric token ID, assume it's already a slug.
|
|
454
|
+
if (!/^\d+$/.test(outcomeId))
|
|
455
|
+
return outcomeId;
|
|
456
|
+
// Attempt to discover the slug by fetching markets filtered by outcomeId.
|
|
457
|
+
const markets = await this.fetchMarketsImpl({ outcomeId });
|
|
458
|
+
if (markets.length > 0 && markets[0].slug) {
|
|
459
|
+
return markets[0].slug;
|
|
460
|
+
}
|
|
461
|
+
return outcomeId;
|
|
462
|
+
}
|
|
424
463
|
/**
|
|
425
464
|
* Fetch a composite activity snapshot for a Base-chain address from the Limitless
|
|
426
465
|
* public portfolio API and Base RPC. Used internally by the BaseSubscriber polling loop.
|
|
@@ -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-
|
|
3
|
+
* Generated at: 2026-04-24T12:14:13.746Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-04-24T12:14:13.746Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-04-24T12:14:13.751Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-04-24T12:14:13.751Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.opinionApiSpec = {
|
|
@@ -230,7 +230,7 @@ class OpinionNormalizer {
|
|
|
230
230
|
title: child.marketTitle || '',
|
|
231
231
|
description: child.rules || '',
|
|
232
232
|
outcomes: [yesOutcome, noOutcome],
|
|
233
|
-
resolutionDate: new Date((0, utils_1.toMillis)(child.cutoffAt)),
|
|
233
|
+
resolutionDate: new Date((0, utils_1.toMillis)(child.cutoffAt || parent.cutoffAt)),
|
|
234
234
|
volume24h: 0, // child markets do not have volume24h
|
|
235
235
|
volume: (0, utils_1.parseNumStr)(child.volume),
|
|
236
236
|
liquidity: 0,
|
|
@@ -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-
|
|
3
|
+
* Generated at: 2026-04-24T12:14:13.704Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-04-24T12:14:13.704Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-04-24T12:14:13.717Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-04-24T12:14:13.717Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-04-24T12:14:13.715Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-04-24T12:14:13.715Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-04-24T12:14:13.739Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-04-24T12:14:13.739Z
|
|
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.34.
|
|
3
|
+
"version": "2.34.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.34.
|
|
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.34.
|
|
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.34.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.34.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",
|