pmxt-core 2.52.0 → 2.53.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/errors.js +4 -4
- 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/utils.js +26 -27
- 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
|
@@ -7,11 +7,11 @@ const errors_1 = require("../../errors");
|
|
|
7
7
|
const PROGRAM_ERRORS = {
|
|
8
8
|
6000: { type: 'bad_request', message: 'Unauthorized' },
|
|
9
9
|
6001: { type: 'bad_request', message: 'Market not found' },
|
|
10
|
+
6013: { type: 'bad_request', message: 'Betting is closed' }, // Changed from 6018
|
|
11
|
+
6014: { type: 'bad_request', message: 'Betting is frozen' }, // Changed from 6040
|
|
10
12
|
6015: { type: 'bad_request', message: 'Market is not open for betting' },
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
6040: { type: 'bad_request', message: 'Betting is frozen' },
|
|
14
|
-
6041: { type: 'invalid_order', message: 'Bet amount too large' },
|
|
13
|
+
6023: { type: 'invalid_order', message: 'Bet amount too small' }, // Changed from 6020
|
|
14
|
+
6024: { type: 'invalid_order', message: 'Bet amount too large' }, // Changed from 6041
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Maps Solana/Anchor errors to pmxt unified error types.
|
|
@@ -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-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:24:08.960Z
|
|
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-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:24:08.960Z
|
|
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-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:24:08.996Z
|
|
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-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:24:08.996Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.limitlessApiSpec = {
|
|
@@ -173,39 +173,38 @@ function mapIntervalToFidelity(interval) {
|
|
|
173
173
|
async function paginateLimitlessMarkets(fetcher, requestedLimit, sortBy) {
|
|
174
174
|
const PAGE_SIZE = 25;
|
|
175
175
|
const targetLimit = requestedLimit || PAGE_SIZE;
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
// Over-fetch by 70% because ~30% of markets lack tokens and get filtered out
|
|
177
|
+
// This ensures enough raw markets survive the token filter
|
|
178
|
+
const OVER_FETCH_FACTOR = 1.7;
|
|
179
|
+
const rawTargetLimit = Math.ceil(targetLimit * OVER_FETCH_FACTOR);
|
|
180
|
+
if (rawTargetLimit <= PAGE_SIZE) {
|
|
178
181
|
const response = await fetcher.getActiveMarkets({
|
|
179
|
-
limit:
|
|
182
|
+
limit: rawTargetLimit,
|
|
180
183
|
page: 1,
|
|
181
184
|
sortBy: sortBy,
|
|
182
185
|
});
|
|
183
186
|
return response.data || [];
|
|
184
187
|
}
|
|
185
|
-
//
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
188
|
+
// Sequential pagination using totalMarketsCount
|
|
189
|
+
const allMarkets = [];
|
|
190
|
+
let page = 1;
|
|
191
|
+
const MAX_PAGES = 50; // Safety limit
|
|
192
|
+
while (page <= MAX_PAGES && allMarkets.length < rawTargetLimit) {
|
|
193
|
+
const response = await fetcher.getActiveMarkets({
|
|
194
|
+
limit: PAGE_SIZE,
|
|
195
|
+
page: page,
|
|
196
|
+
sortBy: sortBy,
|
|
197
|
+
});
|
|
198
|
+
const markets = response.data || [];
|
|
199
|
+
if (markets.length === 0)
|
|
200
|
+
break;
|
|
201
|
+
allMarkets.push(...markets);
|
|
202
|
+
// Use totalMarketsCount to check if we're done
|
|
203
|
+
const totalCount = response.totalMarketsCount;
|
|
204
|
+
if (totalCount && allMarkets.length >= totalCount)
|
|
205
|
+
break;
|
|
206
|
+
page++;
|
|
193
207
|
}
|
|
194
|
-
|
|
195
|
-
try {
|
|
196
|
-
const response = await fetcher.getActiveMarkets({
|
|
197
|
-
limit: PAGE_SIZE,
|
|
198
|
-
page: page,
|
|
199
|
-
sortBy: sortBy,
|
|
200
|
-
});
|
|
201
|
-
return response.data || [];
|
|
202
|
-
}
|
|
203
|
-
catch (e) {
|
|
204
|
-
return [];
|
|
205
|
-
}
|
|
206
|
-
}));
|
|
207
|
-
const allMarkets = pages.flat();
|
|
208
|
-
// Don't slice here - let the caller handle limiting after filtering
|
|
209
|
-
// This ensures we return enough raw markets for the caller to filter
|
|
208
|
+
// Return raw markets - caller will filter tokens and apply actual limit
|
|
210
209
|
return allMarkets;
|
|
211
210
|
}
|
|
@@ -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-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:24:09.008Z
|
|
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-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:24:09.008Z
|
|
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-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:24:09.013Z
|
|
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-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:24:09.013Z
|
|
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-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:24:08.966Z
|
|
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-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:24:08.966Z
|
|
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-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:24:08.979Z
|
|
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-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:24:08.979Z
|
|
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-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:24:08.976Z
|
|
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-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:24:08.976Z
|
|
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-07-
|
|
3
|
+
* Generated at: 2026-07-18T01:24:09.002Z
|
|
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-07-
|
|
6
|
+
* Generated at: 2026-07-18T01:24:09.002Z
|
|
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.53.0",
|
|
4
4
|
"description": "Local sidecar API for supported 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.53.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.53.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",
|