pmxt-core 2.9.2 → 2.10.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/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/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/index.d.ts +19 -3
- package/dist/exchanges/polymarket/index.js +19 -3
- package/dist/exchanges/probable/api.d.ts +1 -1
- package/dist/exchanges/probable/api.js +1 -1
- package/dist/exchanges/probable/index.d.ts +36 -0
- package/dist/exchanges/probable/index.js +36 -0
- 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-02-
|
|
3
|
+
* Generated at: 2026-02-19T11:56:56.608Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-02-19T11:56:56.608Z
|
|
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-02-
|
|
3
|
+
* Generated at: 2026-02-19T11:56:56.657Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-02-19T11:56:56.657Z
|
|
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-02-
|
|
3
|
+
* Generated at: 2026-02-19T11:56:56.675Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-02-19T11:56:56.675Z
|
|
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/polymarket/PolymarketClobAPI.yaml
|
|
3
|
-
* Generated at: 2026-02-
|
|
3
|
+
* Generated at: 2026-02-19T11:56:56.616Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-02-19T11:56:56.616Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-02-19T11:56:56.634Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-02-19T11:56:56.634Z
|
|
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-
|
|
3
|
+
* Generated at: 2026-02-19T11:56:56.631Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-02-19T11:56:56.631Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.polymarketGammaSpec = {
|
|
@@ -46,9 +46,25 @@ export declare class PolymarketExchange extends PredictionMarketExchange {
|
|
|
46
46
|
*/
|
|
47
47
|
private ensureAuth;
|
|
48
48
|
/**
|
|
49
|
-
* Pre-warm the SDK's internal caches for a
|
|
50
|
-
*
|
|
51
|
-
*
|
|
49
|
+
* Pre-warm the SDK's internal caches for a market outcome.
|
|
50
|
+
*
|
|
51
|
+
* Fetches tick size, fee rate, and neg-risk in parallel so that subsequent
|
|
52
|
+
* `createOrder` calls skip those lookups and hit only `POST /order`.
|
|
53
|
+
* Call this when you start watching a market.
|
|
54
|
+
*
|
|
55
|
+
* @param outcomeId - The CLOB Token ID for the outcome (use `outcome.outcomeId`)
|
|
56
|
+
*
|
|
57
|
+
* @example-ts Pre-warm before placing orders
|
|
58
|
+
* const markets = await exchange.fetchMarkets({ query: 'Trump' });
|
|
59
|
+
* const outcomeId = markets[0].outcomes[0].outcomeId;
|
|
60
|
+
* await exchange.preWarmMarket(outcomeId);
|
|
61
|
+
* // Subsequent createOrder calls are faster
|
|
62
|
+
*
|
|
63
|
+
* @example-python Pre-warm before placing orders
|
|
64
|
+
* markets = exchange.fetch_markets(query='Trump')
|
|
65
|
+
* outcome_id = markets[0].outcomes[0].outcome_id
|
|
66
|
+
* exchange.pre_warm_market(outcome_id)
|
|
67
|
+
* # Subsequent create_order calls are faster
|
|
52
68
|
*/
|
|
53
69
|
preWarmMarket(outcomeId: string): Promise<void>;
|
|
54
70
|
createOrder(params: CreateOrderParams): Promise<Order>;
|
|
@@ -185,9 +185,25 @@ class PolymarketExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
185
185
|
return this.auth;
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
188
|
-
* Pre-warm the SDK's internal caches for a
|
|
189
|
-
*
|
|
190
|
-
*
|
|
188
|
+
* Pre-warm the SDK's internal caches for a market outcome.
|
|
189
|
+
*
|
|
190
|
+
* Fetches tick size, fee rate, and neg-risk in parallel so that subsequent
|
|
191
|
+
* `createOrder` calls skip those lookups and hit only `POST /order`.
|
|
192
|
+
* Call this when you start watching a market.
|
|
193
|
+
*
|
|
194
|
+
* @param outcomeId - The CLOB Token ID for the outcome (use `outcome.outcomeId`)
|
|
195
|
+
*
|
|
196
|
+
* @example-ts Pre-warm before placing orders
|
|
197
|
+
* const markets = await exchange.fetchMarkets({ query: 'Trump' });
|
|
198
|
+
* const outcomeId = markets[0].outcomes[0].outcomeId;
|
|
199
|
+
* await exchange.preWarmMarket(outcomeId);
|
|
200
|
+
* // Subsequent createOrder calls are faster
|
|
201
|
+
*
|
|
202
|
+
* @example-python Pre-warm before placing orders
|
|
203
|
+
* markets = exchange.fetch_markets(query='Trump')
|
|
204
|
+
* outcome_id = markets[0].outcomes[0].outcome_id
|
|
205
|
+
* exchange.pre_warm_market(outcome_id)
|
|
206
|
+
* # Subsequent create_order calls are faster
|
|
191
207
|
*/
|
|
192
208
|
async preWarmMarket(outcomeId) {
|
|
193
209
|
const auth = this.ensureAuth();
|
|
@@ -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-
|
|
3
|
+
* Generated at: 2026-02-19T11:56:56.667Z
|
|
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-
|
|
6
|
+
* Generated at: 2026-02-19T11:56:56.667Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.probableApiSpec = {
|
|
@@ -26,7 +26,43 @@ export declare class ProbableExchange extends PredictionMarketExchange {
|
|
|
26
26
|
private ensureAuth;
|
|
27
27
|
protected fetchMarketsImpl(params?: MarketFetchParams): Promise<UnifiedMarket[]>;
|
|
28
28
|
protected fetchEventsImpl(params: EventFetchParams): Promise<UnifiedEvent[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Fetch a single event by its numeric ID (Probable only).
|
|
31
|
+
*
|
|
32
|
+
* @param id - The numeric event ID
|
|
33
|
+
* @returns The UnifiedEvent, or null if not found
|
|
34
|
+
*
|
|
35
|
+
* @example-ts Get event by ID
|
|
36
|
+
* const event = await exchange.getEventById('42');
|
|
37
|
+
* if (event) {
|
|
38
|
+
* console.log(event.title);
|
|
39
|
+
* console.log(event.markets.length, 'markets');
|
|
40
|
+
* }
|
|
41
|
+
*
|
|
42
|
+
* @example-python Get event by ID
|
|
43
|
+
* event = exchange.get_event_by_id('42')
|
|
44
|
+
* if event:
|
|
45
|
+
* print(event.title)
|
|
46
|
+
* print(len(event.markets), 'markets')
|
|
47
|
+
*/
|
|
29
48
|
getEventById(id: string): Promise<UnifiedEvent | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Fetch a single event by its URL slug (Probable only).
|
|
51
|
+
*
|
|
52
|
+
* @param slug - The event's URL slug (e.g. `"trump-2024-election"`)
|
|
53
|
+
* @returns The UnifiedEvent, or null if not found
|
|
54
|
+
*
|
|
55
|
+
* @example-ts Get event by slug
|
|
56
|
+
* const event = await exchange.getEventBySlug('trump-2024-election');
|
|
57
|
+
* if (event) {
|
|
58
|
+
* console.log(event.title);
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* @example-python Get event by slug
|
|
62
|
+
* event = exchange.get_event_by_slug('trump-2024-election')
|
|
63
|
+
* if event:
|
|
64
|
+
* print(event.title)
|
|
65
|
+
*/
|
|
30
66
|
getEventBySlug(slug: string): Promise<UnifiedEvent | null>;
|
|
31
67
|
fetchOrderBook(id: string): Promise<OrderBook>;
|
|
32
68
|
fetchOHLCV(id: string, params: OHLCVParams | HistoryFilterParams): Promise<PriceCandle[]>;
|
|
@@ -82,9 +82,45 @@ class ProbableExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
82
82
|
async fetchEventsImpl(params) {
|
|
83
83
|
return (0, fetchEvents_1.fetchEvents)(params, this.http, (tokenId) => this.callApi('getPublicApiV1Midpoint', { token_id: tokenId }), (queryParams) => this.callApi('getPublicApiV1PublicSearch', queryParams));
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Fetch a single event by its numeric ID (Probable only).
|
|
87
|
+
*
|
|
88
|
+
* @param id - The numeric event ID
|
|
89
|
+
* @returns The UnifiedEvent, or null if not found
|
|
90
|
+
*
|
|
91
|
+
* @example-ts Get event by ID
|
|
92
|
+
* const event = await exchange.getEventById('42');
|
|
93
|
+
* if (event) {
|
|
94
|
+
* console.log(event.title);
|
|
95
|
+
* console.log(event.markets.length, 'markets');
|
|
96
|
+
* }
|
|
97
|
+
*
|
|
98
|
+
* @example-python Get event by ID
|
|
99
|
+
* event = exchange.get_event_by_id('42')
|
|
100
|
+
* if event:
|
|
101
|
+
* print(event.title)
|
|
102
|
+
* print(len(event.markets), 'markets')
|
|
103
|
+
*/
|
|
85
104
|
async getEventById(id) {
|
|
86
105
|
return (0, fetchEvents_1.fetchEventById)(id, this.http, (tokenId) => this.callApi('getPublicApiV1Midpoint', { token_id: tokenId }));
|
|
87
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Fetch a single event by its URL slug (Probable only).
|
|
109
|
+
*
|
|
110
|
+
* @param slug - The event's URL slug (e.g. `"trump-2024-election"`)
|
|
111
|
+
* @returns The UnifiedEvent, or null if not found
|
|
112
|
+
*
|
|
113
|
+
* @example-ts Get event by slug
|
|
114
|
+
* const event = await exchange.getEventBySlug('trump-2024-election');
|
|
115
|
+
* if (event) {
|
|
116
|
+
* console.log(event.title);
|
|
117
|
+
* }
|
|
118
|
+
*
|
|
119
|
+
* @example-python Get event by slug
|
|
120
|
+
* event = exchange.get_event_by_slug('trump-2024-election')
|
|
121
|
+
* if event:
|
|
122
|
+
* print(event.title)
|
|
123
|
+
*/
|
|
88
124
|
async getEventBySlug(slug) {
|
|
89
125
|
return (0, fetchEvents_1.fetchEventBySlug)(slug, this.http, (tokenId) => this.callApi('getPublicApiV1Midpoint', { token_id: tokenId }));
|
|
90
126
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmxt-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.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.10.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.10.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",
|