pmxt-core 2.43.10 → 2.43.12
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/BaseExchange.d.ts +3 -5
- package/dist/BaseExchange.js +6 -7
- package/dist/exchanges/kalshi/api.d.ts +1 -1
- package/dist/exchanges/kalshi/api.js +1 -1
- package/dist/exchanges/kalshi/fetcher.js +4 -4
- package/dist/exchanges/kalshi/index.js +2 -0
- 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/fetcher.js +2 -1
- package/dist/exchanges/myriad/index.js +2 -0
- 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/polymarket/fetcher.js +2 -0
- package/dist/exchanges/polymarket/index.js +1 -0
- package/dist/exchanges/probable/api.d.ts +1 -1
- package/dist/exchanges/probable/api.js +1 -1
- package/dist/exchanges/probable/index.js +2 -0
- package/dist/exchanges/smarkets/fetcher.d.ts +1 -1
- package/dist/exchanges/smarkets/fetcher.js +6 -4
- package/dist/exchanges/smarkets/index.js +2 -0
- package/dist/server/method-verbs.json +0 -10
- package/dist/server/openapi.yaml +5 -36
- package/dist/utils/validation.d.ts +1 -0
- package/dist/utils/validation.js +7 -0
- package/package.json +3 -3
package/dist/BaseExchange.d.ts
CHANGED
|
@@ -103,12 +103,14 @@ export interface OHLCVParams {
|
|
|
103
103
|
/**
|
|
104
104
|
* Parameters for fetching trade history. No resolution parameter - trades are discrete events.
|
|
105
105
|
*/
|
|
106
|
+
/** Maximum allowed value for `TradesParams.limit`. */
|
|
107
|
+
export declare const MAX_TRADES_LIMIT = 1000;
|
|
106
108
|
export interface TradesParams {
|
|
107
109
|
/** Start of the time range */
|
|
108
110
|
start?: Date;
|
|
109
111
|
/** End of the time range */
|
|
110
112
|
end?: Date;
|
|
111
|
-
/** Maximum number of results to return */
|
|
113
|
+
/** Maximum number of results to return (max {@link MAX_TRADES_LIMIT}) */
|
|
112
114
|
limit?: number;
|
|
113
115
|
}
|
|
114
116
|
export interface MyTradesParams {
|
|
@@ -674,10 +676,6 @@ export declare abstract class PredictionMarketExchange {
|
|
|
674
676
|
* Close all WebSocket connections and clean up resources.
|
|
675
677
|
* Call this when you're done streaming to properly release connections.
|
|
676
678
|
*/
|
|
677
|
-
/**
|
|
678
|
-
* Test method for auto-generation verification.
|
|
679
|
-
*/
|
|
680
|
-
testDummyMethod(param?: string): Promise<string>;
|
|
681
679
|
close(): Promise<void>;
|
|
682
680
|
/**
|
|
683
681
|
* Find the same or related market on other venues. Two modes:
|
package/dist/BaseExchange.js
CHANGED
|
@@ -3,12 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PredictionMarketExchange = void 0;
|
|
6
|
+
exports.PredictionMarketExchange = exports.MAX_TRADES_LIMIT = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const errors_1 = require("./errors");
|
|
9
9
|
const math_1 = require("./utils/math");
|
|
10
10
|
const logger_1 = require("./utils/logger");
|
|
11
11
|
const throttler_1 = require("./utils/throttler");
|
|
12
|
+
/**
|
|
13
|
+
* Parameters for fetching trade history. No resolution parameter - trades are discrete events.
|
|
14
|
+
*/
|
|
15
|
+
/** Maximum allowed value for `TradesParams.limit`. */
|
|
16
|
+
exports.MAX_TRADES_LIMIT = 1000;
|
|
12
17
|
// ----------------------------------------------------------------------------
|
|
13
18
|
// Base Exchange Class
|
|
14
19
|
// ----------------------------------------------------------------------------
|
|
@@ -878,12 +883,6 @@ class PredictionMarketExchange {
|
|
|
878
883
|
* Close all WebSocket connections and clean up resources.
|
|
879
884
|
* Call this when you're done streaming to properly release connections.
|
|
880
885
|
*/
|
|
881
|
-
/**
|
|
882
|
-
* Test method for auto-generation verification.
|
|
883
|
-
*/
|
|
884
|
-
async testDummyMethod(param) {
|
|
885
|
-
throw new Error("Test method not implemented.");
|
|
886
|
-
}
|
|
887
886
|
async close() {
|
|
888
887
|
// Default implementation: no-op
|
|
889
888
|
// Exchanges with WebSocket support should override this
|
|
@@ -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-23T13:25:22.239Z
|
|
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-23T13:25:22.239Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.kalshiApiSpec = {
|
|
@@ -155,10 +155,10 @@ class KalshiFetcher {
|
|
|
155
155
|
// -- Trades ----------------------------------------------------------------
|
|
156
156
|
async fetchRawTrades(id, params) {
|
|
157
157
|
const ticker = id.replace(/-NO$/, '');
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
limit
|
|
161
|
-
|
|
158
|
+
const query = { ticker };
|
|
159
|
+
if (params.limit)
|
|
160
|
+
query.limit = params.limit;
|
|
161
|
+
const data = await this.ctx.callApi('GetTrades', query);
|
|
162
162
|
return data.trades || [];
|
|
163
163
|
}
|
|
164
164
|
// -- User data -------------------------------------------------------------
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.KalshiExchange = void 0;
|
|
4
4
|
const BaseExchange_1 = require("../../BaseExchange");
|
|
5
5
|
const errors_1 = require("../../errors");
|
|
6
|
+
const validation_1 = require("../../utils/validation");
|
|
6
7
|
const openapi_1 = require("../../utils/openapi");
|
|
7
8
|
const logger_1 = require("../../utils/logger");
|
|
8
9
|
const api_1 = require("./api");
|
|
@@ -137,6 +138,7 @@ class KalshiExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
137
138
|
return response;
|
|
138
139
|
}
|
|
139
140
|
async fetchTrades(outcomeId, params) {
|
|
141
|
+
(0, validation_1.validateTradesLimit)(params.limit);
|
|
140
142
|
if ('resolution' in params && params.resolution !== undefined) {
|
|
141
143
|
logger_1.logger.warn('The "resolution" parameter is deprecated for fetchTrades() and will be ignored. ' +
|
|
142
144
|
'It will be removed in v3.0.0. Please remove it from your code.');
|
|
@@ -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-23T13:25:22.282Z
|
|
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-23T13:25:22.282Z
|
|
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-05-
|
|
3
|
+
* Generated at: 2026-05-23T13:25:22.294Z
|
|
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-23T13:25:22.294Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.myriadApiSpec = {
|
|
@@ -166,8 +166,9 @@ class MyriadFetcher {
|
|
|
166
166
|
id: marketId,
|
|
167
167
|
network_id: Number(networkId),
|
|
168
168
|
page: 1,
|
|
169
|
-
limit: params.limit || 100,
|
|
170
169
|
};
|
|
170
|
+
if (params.limit)
|
|
171
|
+
queryParams.limit = params.limit;
|
|
171
172
|
if (params.start)
|
|
172
173
|
queryParams.since = Math.floor(ensureDate(params.start).getTime() / 1000);
|
|
173
174
|
if (params.end)
|
|
@@ -6,6 +6,7 @@ const auth_1 = require("./auth");
|
|
|
6
6
|
const websocket_1 = require("./websocket");
|
|
7
7
|
const errors_1 = require("./errors");
|
|
8
8
|
const errors_2 = require("../../errors");
|
|
9
|
+
const validation_1 = require("../../utils/validation");
|
|
9
10
|
const utils_1 = require("./utils");
|
|
10
11
|
const openapi_1 = require("../../utils/openapi");
|
|
11
12
|
const api_1 = require("./api");
|
|
@@ -109,6 +110,7 @@ class MyriadExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
109
110
|
return this.normalizer.normalizeOrderBook(rawMarket, outcomeId);
|
|
110
111
|
}
|
|
111
112
|
async fetchTrades(outcomeId, params) {
|
|
113
|
+
(0, validation_1.validateTradesLimit)(params.limit);
|
|
112
114
|
if ('resolution' in params && params.resolution !== undefined) {
|
|
113
115
|
logger_1.logger.warn('The "resolution" parameter is deprecated for fetchTrades() and will be ignored. ' +
|
|
114
116
|
'It will be removed in v3.0.0. Please remove it from your code.');
|
|
@@ -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-23T13:25:22.299Z
|
|
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-23T13:25:22.299Z
|
|
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-23T13:25:22.247Z
|
|
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-23T13:25:22.247Z
|
|
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-23T13:25:22.264Z
|
|
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-23T13:25:22.264Z
|
|
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-23T13:25:22.262Z
|
|
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-23T13:25:22.262Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.polymarketGammaSpec = {
|
|
@@ -135,6 +135,7 @@ class PolymarketExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
135
135
|
async fetchTrades(outcomeId, params) {
|
|
136
136
|
(0, validation_1.validateIdFormat)(outcomeId, 'Trades');
|
|
137
137
|
(0, validation_1.validateOutcomeId)(outcomeId, 'Trades');
|
|
138
|
+
(0, validation_1.validateTradesLimit)(params.limit);
|
|
138
139
|
if ('resolution' in params && params.resolution !== undefined) {
|
|
139
140
|
logger_1.logger.warn('The "resolution" parameter is deprecated for fetchTrades() and will be ignored. It will be removed in v3.0.0.');
|
|
140
141
|
}
|
|
@@ -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-23T13:25:22.286Z
|
|
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-23T13:25:22.286Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.probableApiSpec = {
|
|
@@ -6,6 +6,7 @@ const auth_1 = require("./auth");
|
|
|
6
6
|
const websocket_1 = require("./websocket");
|
|
7
7
|
const errors_1 = require("./errors");
|
|
8
8
|
const errors_2 = require("../../errors");
|
|
9
|
+
const validation_1 = require("../../utils/validation");
|
|
9
10
|
const clob_1 = require("@prob/clob");
|
|
10
11
|
const openapi_1 = require("../../utils/openapi");
|
|
11
12
|
const api_1 = require("./api");
|
|
@@ -135,6 +136,7 @@ class ProbableExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
135
136
|
return rawTrades.map((raw, i) => this.normalizer.normalizeUserTrade(raw, i));
|
|
136
137
|
}
|
|
137
138
|
async fetchTrades(outcomeId, params) {
|
|
139
|
+
(0, validation_1.validateTradesLimit)(params.limit);
|
|
138
140
|
const auth = this.ensureAuth();
|
|
139
141
|
const client = auth.getClobClient();
|
|
140
142
|
// Use CLOB client directly for trades (legacy behaviour preserved)
|
|
@@ -158,7 +158,7 @@ export declare class SmarketsFetcher implements IExchangeFetcher<SmarketsRawEven
|
|
|
158
158
|
fetchRawMarkets(params?: MarketFilterParams): Promise<SmarketsRawEventWithMarkets[]>;
|
|
159
159
|
fetchRawEvents(params: EventFetchParams): Promise<SmarketsRawEventWithMarkets[]>;
|
|
160
160
|
fetchRawOrderBook(id: string): Promise<Record<string, SmarketsRawQuote>>;
|
|
161
|
-
fetchRawTradeActivity(marketId: string,
|
|
161
|
+
fetchRawTradeActivity(marketId: string, params: TradesParams): Promise<SmarketsRawActivityRow[]>;
|
|
162
162
|
fetchRawMyTradeActivity(params?: Record<string, any>): Promise<SmarketsRawActivityRow[]>;
|
|
163
163
|
fetchRawBalance(): Promise<SmarketsRawBalance>;
|
|
164
164
|
fetchRawOrders(queryParams?: Record<string, any>): Promise<SmarketsRawOrder[]>;
|
|
@@ -69,13 +69,15 @@ class SmarketsFetcher {
|
|
|
69
69
|
return data;
|
|
70
70
|
}
|
|
71
71
|
// -- Trades (account activity) --------------------------------------------
|
|
72
|
-
async fetchRawTradeActivity(marketId,
|
|
73
|
-
const
|
|
72
|
+
async fetchRawTradeActivity(marketId, params) {
|
|
73
|
+
const query = {
|
|
74
74
|
market_id: [marketId],
|
|
75
75
|
source: ['order.execute', 'order.execute.confirm'],
|
|
76
|
-
limit: 100,
|
|
77
76
|
sort: '-seq,-subseq',
|
|
78
|
-
}
|
|
77
|
+
};
|
|
78
|
+
if (params.limit)
|
|
79
|
+
query.limit = params.limit;
|
|
80
|
+
const data = await this.ctx.callApi('get_activity', query);
|
|
79
81
|
return (data.account_activity || []);
|
|
80
82
|
}
|
|
81
83
|
async fetchRawMyTradeActivity(params = {}) {
|
|
@@ -5,6 +5,7 @@ const BaseExchange_1 = require("../../BaseExchange");
|
|
|
5
5
|
const auth_1 = require("./auth");
|
|
6
6
|
const errors_1 = require("./errors");
|
|
7
7
|
const errors_2 = require("../../errors");
|
|
8
|
+
const validation_1 = require("../../utils/validation");
|
|
8
9
|
const openapi_1 = require("../../utils/openapi");
|
|
9
10
|
const api_1 = require("./api");
|
|
10
11
|
const config_1 = require("./config");
|
|
@@ -164,6 +165,7 @@ class SmarketsExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
164
165
|
return this.normalizer.normalizeOrderBook(raw, outcomeId);
|
|
165
166
|
}
|
|
166
167
|
async fetchTrades(outcomeId, params) {
|
|
168
|
+
(0, validation_1.validateTradesLimit)(params.limit);
|
|
167
169
|
if ('resolution' in params && params.resolution !== undefined) {
|
|
168
170
|
logger_1.logger.warn('The "resolution" parameter is deprecated for fetchTrades() and will be ignored. ' +
|
|
169
171
|
'It will be removed in v3.0.0. Please remove it from your code.');
|
package/dist/server/openapi.yaml
CHANGED
|
@@ -760,7 +760,7 @@ paths:
|
|
|
760
760
|
required: false
|
|
761
761
|
schema:
|
|
762
762
|
type: number
|
|
763
|
-
description: Maximum number of results to return
|
|
763
|
+
description: 'Maximum number of results to return (max {@link MAX_TRADES_LIMIT})'
|
|
764
764
|
responses:
|
|
765
765
|
'200':
|
|
766
766
|
description: Fetch Trades response
|
|
@@ -1364,39 +1364,6 @@ paths:
|
|
|
1364
1364
|
description: >-
|
|
1365
1365
|
Filter a list of events by criteria. Can filter by string query, structured criteria object, or custom filter
|
|
1366
1366
|
function.
|
|
1367
|
-
'/api/{exchange}/testDummyMethod':
|
|
1368
|
-
post:
|
|
1369
|
-
summary: Test Dummy Method
|
|
1370
|
-
operationId: testDummyMethod
|
|
1371
|
-
parameters:
|
|
1372
|
-
- $ref: '#/components/parameters/ExchangeParam'
|
|
1373
|
-
requestBody:
|
|
1374
|
-
content:
|
|
1375
|
-
application/json:
|
|
1376
|
-
schema:
|
|
1377
|
-
title: TestDummyMethodRequest
|
|
1378
|
-
type: object
|
|
1379
|
-
properties:
|
|
1380
|
-
args:
|
|
1381
|
-
type: array
|
|
1382
|
-
maxItems: 1
|
|
1383
|
-
items:
|
|
1384
|
-
type: string
|
|
1385
|
-
credentials:
|
|
1386
|
-
$ref: '#/components/schemas/ExchangeCredentials'
|
|
1387
|
-
responses:
|
|
1388
|
-
'200':
|
|
1389
|
-
description: Test Dummy Method response
|
|
1390
|
-
content:
|
|
1391
|
-
application/json:
|
|
1392
|
-
schema:
|
|
1393
|
-
allOf:
|
|
1394
|
-
- $ref: '#/components/schemas/BaseResponse'
|
|
1395
|
-
- type: object
|
|
1396
|
-
properties:
|
|
1397
|
-
data:
|
|
1398
|
-
type: string
|
|
1399
|
-
description: Test method for auto-generation verification.
|
|
1400
1367
|
'/api/{exchange}/close':
|
|
1401
1368
|
post:
|
|
1402
1369
|
summary: Close
|
|
@@ -1423,6 +1390,9 @@ paths:
|
|
|
1423
1390
|
application/json:
|
|
1424
1391
|
schema:
|
|
1425
1392
|
$ref: '#/components/schemas/BaseResponse'
|
|
1393
|
+
description: >-
|
|
1394
|
+
Close all WebSocket connections and clean up resources. Call this when you're done streaming to properly release
|
|
1395
|
+
connections.
|
|
1426
1396
|
'/api/{exchange}/fetchMarketMatches':
|
|
1427
1397
|
get:
|
|
1428
1398
|
summary: Market Matches
|
|
@@ -3234,7 +3204,6 @@ components:
|
|
|
3234
3204
|
reconstructed L2 OrderBook snapshots between `since` and `until` (hosted API only).
|
|
3235
3205
|
TradesParams:
|
|
3236
3206
|
type: object
|
|
3237
|
-
description: Parameters for fetching trade history. No resolution parameter - trades are discrete events.
|
|
3238
3207
|
properties:
|
|
3239
3208
|
start:
|
|
3240
3209
|
type: string
|
|
@@ -3246,7 +3215,7 @@ components:
|
|
|
3246
3215
|
description: End of the time range
|
|
3247
3216
|
limit:
|
|
3248
3217
|
type: number
|
|
3249
|
-
description: Maximum number of results to return
|
|
3218
|
+
description: 'Maximum number of results to return (max {@link MAX_TRADES_LIMIT})'
|
|
3250
3219
|
CreateOrderParams:
|
|
3251
3220
|
type: object
|
|
3252
3221
|
properties:
|
package/dist/utils/validation.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateOutcomeId = validateOutcomeId;
|
|
4
4
|
exports.validateIdFormat = validateIdFormat;
|
|
5
|
+
exports.validateTradesLimit = validateTradesLimit;
|
|
5
6
|
const errors_1 = require("../errors");
|
|
7
|
+
const BaseExchange_1 = require("../BaseExchange");
|
|
6
8
|
/**
|
|
7
9
|
* Validates that the provided ID is an outcomeId
|
|
8
10
|
* Numeric IDs should be at least 10 digits (CLOB Token IDs for Polymarket)
|
|
@@ -21,3 +23,8 @@ function validateIdFormat(id, context) {
|
|
|
21
23
|
throw new errors_1.ValidationError(`Invalid ID for ${context}: ID cannot be empty`, 'id');
|
|
22
24
|
}
|
|
23
25
|
}
|
|
26
|
+
function validateTradesLimit(limit) {
|
|
27
|
+
if (limit !== undefined && limit > BaseExchange_1.MAX_TRADES_LIMIT) {
|
|
28
|
+
throw new errors_1.ValidationError(`limit exceeds maximum of ${BaseExchange_1.MAX_TRADES_LIMIT}`, 'limit');
|
|
29
|
+
}
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmxt-core",
|
|
3
|
-
"version": "2.43.
|
|
3
|
+
"version": "2.43.12",
|
|
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.43.
|
|
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.43.
|
|
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.43.12,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.43.12,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",
|