pmxt-core 2.46.1 → 2.46.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/fetcher.js +8 -1
- package/dist/exchanges/limitless/normalizer.js +8 -1
- package/dist/exchanges/limitless/utils.d.ts +8 -1
- package/dist/exchanges/limitless/utils.js +39 -8
- 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 +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-05-
|
|
3
|
+
* Generated at: 2026-05-25T20:43:29.873Z
|
|
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-25T20:43:29.873Z
|
|
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-25T20:43:29.919Z
|
|
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-25T20:43:29.919Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.limitlessApiSpec = {
|
|
@@ -163,7 +163,14 @@ class LimitlessFetcher {
|
|
|
163
163
|
for (const res of rawResults) {
|
|
164
164
|
if (res.markets && Array.isArray(res.markets)) {
|
|
165
165
|
for (const child of res.markets) {
|
|
166
|
-
allRawMarkets.push(
|
|
166
|
+
allRawMarkets.push({
|
|
167
|
+
...child,
|
|
168
|
+
__pmxtEventId: res.slug,
|
|
169
|
+
__pmxtEventTitle: res.title || res.question,
|
|
170
|
+
__pmxtEventDescription: res.description,
|
|
171
|
+
__pmxtCategories: res.categories,
|
|
172
|
+
__pmxtTags: res.tags,
|
|
173
|
+
});
|
|
167
174
|
}
|
|
168
175
|
}
|
|
169
176
|
else {
|
|
@@ -17,8 +17,15 @@ class LimitlessNormalizer {
|
|
|
17
17
|
return null;
|
|
18
18
|
let marketsList = [];
|
|
19
19
|
if (raw.markets && Array.isArray(raw.markets)) {
|
|
20
|
+
const eventTitle = raw.title || raw.question || '';
|
|
20
21
|
marketsList = raw.markets
|
|
21
|
-
.map((child) => (0, utils_1.mapMarketToUnified)(child
|
|
22
|
+
.map((child) => (0, utils_1.mapMarketToUnified)(child, {
|
|
23
|
+
eventId: raw.slug,
|
|
24
|
+
eventTitle,
|
|
25
|
+
eventDescription: raw.description,
|
|
26
|
+
categories: raw.categories,
|
|
27
|
+
tags: raw.tags,
|
|
28
|
+
}))
|
|
22
29
|
.filter((m) => m !== null);
|
|
23
30
|
}
|
|
24
31
|
else {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { UnifiedMarket, CandleInterval } from '../../types';
|
|
2
2
|
export declare const DEFAULT_LIMITLESS_API_URL = "https://api.limitless.exchange";
|
|
3
|
-
export
|
|
3
|
+
export interface LimitlessMarketContext {
|
|
4
|
+
eventId?: string;
|
|
5
|
+
eventTitle?: string;
|
|
6
|
+
eventDescription?: string;
|
|
7
|
+
categories?: string[];
|
|
8
|
+
tags?: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function mapMarketToUnified(market: any, context?: LimitlessMarketContext): UnifiedMarket | null;
|
|
4
11
|
export declare function mapIntervalToFidelity(interval: CandleInterval): number;
|
|
5
12
|
/**
|
|
6
13
|
* Fetch paginated results from Limitless API.
|
|
@@ -6,10 +6,20 @@ exports.mapIntervalToFidelity = mapIntervalToFidelity;
|
|
|
6
6
|
exports.paginateLimitlessMarkets = paginateLimitlessMarkets;
|
|
7
7
|
const market_utils_1 = require("../../utils/market-utils");
|
|
8
8
|
exports.DEFAULT_LIMITLESS_API_URL = 'https://api.limitless.exchange';
|
|
9
|
-
function mapMarketToUnified(market) {
|
|
9
|
+
function mapMarketToUnified(market, context = {}) {
|
|
10
10
|
if (!market)
|
|
11
11
|
return null;
|
|
12
|
+
const resolvedContext = {
|
|
13
|
+
eventId: getText(market.__pmxtEventId) || context.eventId,
|
|
14
|
+
eventTitle: getText(market.__pmxtEventTitle) || context.eventTitle,
|
|
15
|
+
eventDescription: getText(market.__pmxtEventDescription) || context.eventDescription,
|
|
16
|
+
categories: getStringArray(market.__pmxtCategories) || context.categories,
|
|
17
|
+
tags: getStringArray(market.__pmxtTags) || context.tags,
|
|
18
|
+
};
|
|
12
19
|
const outcomes = [];
|
|
20
|
+
const rawTitle = getText(market.title) || getText(market.question) || market.slug;
|
|
21
|
+
const title = composeMarketTitle(rawTitle, resolvedContext.eventTitle);
|
|
22
|
+
const hasParentContext = Boolean(resolvedContext.eventTitle && rawTitle);
|
|
13
23
|
// The Limitless SDK provides:
|
|
14
24
|
// tokens: { yes: "...", no: "..." }
|
|
15
25
|
// prices: [yesPrice, noPrice] (always [yes, no] per SDK docs)
|
|
@@ -22,10 +32,12 @@ function mapMarketToUnified(market) {
|
|
|
22
32
|
const prices = Array.isArray(market.prices) ? market.prices : [];
|
|
23
33
|
const yesPrice = prices[0] || 0;
|
|
24
34
|
const noPrice = prices[1] || 0;
|
|
35
|
+
const yesLabel = hasParentContext ? rawTitle : 'Yes';
|
|
36
|
+
const noLabel = hasParentContext ? `Not ${rawTitle}` : 'No';
|
|
25
37
|
outcomes.push({
|
|
26
38
|
outcomeId: market.tokens.yes,
|
|
27
39
|
marketId: market.slug,
|
|
28
|
-
label:
|
|
40
|
+
label: yesLabel,
|
|
29
41
|
price: yesPrice,
|
|
30
42
|
priceChange24h: 0,
|
|
31
43
|
metadata: { clobTokenId: market.tokens.yes },
|
|
@@ -33,7 +45,7 @@ function mapMarketToUnified(market) {
|
|
|
33
45
|
outcomes.push({
|
|
34
46
|
outcomeId: market.tokens.no,
|
|
35
47
|
marketId: market.slug,
|
|
36
|
-
label:
|
|
48
|
+
label: noLabel,
|
|
37
49
|
price: noPrice,
|
|
38
50
|
priceChange24h: 0,
|
|
39
51
|
metadata: { clobTokenId: market.tokens.no },
|
|
@@ -49,9 +61,9 @@ function mapMarketToUnified(market) {
|
|
|
49
61
|
const um = {
|
|
50
62
|
id: market.slug,
|
|
51
63
|
marketId: market.slug,
|
|
52
|
-
eventId: market.slug,
|
|
53
|
-
title
|
|
54
|
-
description: market.description,
|
|
64
|
+
eventId: resolvedContext.eventId || market.slug,
|
|
65
|
+
title,
|
|
66
|
+
description: market.description || resolvedContext.eventDescription,
|
|
55
67
|
slug: market.slug,
|
|
56
68
|
outcomes: outcomes,
|
|
57
69
|
resolutionDate: market.expirationTimestamp ? new Date(market.expirationTimestamp) : new Date(),
|
|
@@ -61,13 +73,32 @@ function mapMarketToUnified(market) {
|
|
|
61
73
|
openInterest: 0, // Not directly in the flat market list
|
|
62
74
|
url: `https://limitless.exchange/markets/${market.slug}`,
|
|
63
75
|
image: market.logo || `https://limitless.exchange/api/og?slug=${market.slug}`,
|
|
64
|
-
category: market.categories?.[0],
|
|
65
|
-
tags: market.tags || [],
|
|
76
|
+
category: market.categories?.[0] || resolvedContext.categories?.[0],
|
|
77
|
+
tags: market.tags || resolvedContext.tags || [],
|
|
66
78
|
status,
|
|
67
79
|
};
|
|
68
80
|
(0, market_utils_1.addBinaryOutcomes)(um);
|
|
69
81
|
return um;
|
|
70
82
|
}
|
|
83
|
+
function getText(value) {
|
|
84
|
+
return typeof value === 'string' && value.trim().length > 0 ? value.trim() : undefined;
|
|
85
|
+
}
|
|
86
|
+
function getStringArray(value) {
|
|
87
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === 'string') : undefined;
|
|
88
|
+
}
|
|
89
|
+
function normalizeTitle(value) {
|
|
90
|
+
return value.toLowerCase().replace(/[^\p{L}\p{N}]+/gu, ' ').trim();
|
|
91
|
+
}
|
|
92
|
+
function composeMarketTitle(childTitle, eventTitle) {
|
|
93
|
+
if (!eventTitle)
|
|
94
|
+
return childTitle;
|
|
95
|
+
const normalizedChild = normalizeTitle(childTitle);
|
|
96
|
+
const normalizedEvent = normalizeTitle(eventTitle);
|
|
97
|
+
if (!normalizedChild || !normalizedEvent || normalizedChild.startsWith(normalizedEvent)) {
|
|
98
|
+
return childTitle;
|
|
99
|
+
}
|
|
100
|
+
return `${eventTitle} - ${childTitle}`;
|
|
101
|
+
}
|
|
71
102
|
function mapIntervalToFidelity(interval) {
|
|
72
103
|
const mapping = {
|
|
73
104
|
'1m': 1,
|
|
@@ -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-25T20:43:29.930Z
|
|
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-25T20:43:29.930Z
|
|
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-25T20:43:29.934Z
|
|
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-25T20:43:29.934Z
|
|
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-25T20:43:29.882Z
|
|
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-05-
|
|
6
|
+
* Generated at: 2026-05-25T20:43:29.882Z
|
|
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-05-
|
|
3
|
+
* Generated at: 2026-05-25T20:43:29.900Z
|
|
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-25T20:43:29.900Z
|
|
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-25T20:43:29.896Z
|
|
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-25T20:43:29.896Z
|
|
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-25T20:43:29.924Z
|
|
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-25T20:43:29.924Z
|
|
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.46.
|
|
3
|
+
"version": "2.46.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.46.
|
|
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.46.
|
|
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.46.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.46.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",
|