pmxt-core 2.6.0 → 2.8.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/BaseExchange.d.ts +14 -0
- package/dist/BaseExchange.js +76 -0
- package/dist/exchanges/kalshi/fetchEvents.d.ts +2 -1
- package/dist/exchanges/kalshi/fetchEvents.js +6 -6
- package/dist/exchanges/kalshi/fetchMarkets.d.ts +2 -1
- package/dist/exchanges/kalshi/fetchMarkets.js +22 -24
- package/dist/exchanges/kalshi/fetchOHLCV.d.ts +2 -1
- package/dist/exchanges/kalshi/fetchOHLCV.js +2 -2
- package/dist/exchanges/kalshi/fetchOrderBook.d.ts +2 -1
- package/dist/exchanges/kalshi/fetchOrderBook.js +2 -2
- package/dist/exchanges/kalshi/fetchTrades.d.ts +2 -1
- package/dist/exchanges/kalshi/fetchTrades.js +2 -2
- package/dist/exchanges/kalshi/index.js +11 -15
- package/dist/exchanges/kalshi/kalshi.test.js +47 -18
- package/dist/exchanges/limitless/fetchEvents.d.ts +2 -1
- package/dist/exchanges/limitless/fetchEvents.js +6 -4
- package/dist/exchanges/limitless/fetchMarkets.d.ts +2 -1
- package/dist/exchanges/limitless/fetchMarkets.js +7 -7
- package/dist/exchanges/limitless/fetchOHLCV.d.ts +2 -1
- package/dist/exchanges/limitless/fetchOHLCV.js +2 -2
- package/dist/exchanges/limitless/fetchOrderBook.d.ts +2 -1
- package/dist/exchanges/limitless/fetchOrderBook.js +2 -2
- package/dist/exchanges/limitless/fetchTrades.d.ts +2 -1
- package/dist/exchanges/limitless/fetchTrades.js +5 -1
- package/dist/exchanges/limitless/index.js +5 -5
- package/dist/exchanges/myriad/fetchEvents.d.ts +2 -1
- package/dist/exchanges/myriad/fetchEvents.js +6 -6
- package/dist/exchanges/myriad/fetchMarkets.d.ts +2 -1
- package/dist/exchanges/myriad/fetchMarkets.js +10 -10
- package/dist/exchanges/myriad/fetchOHLCV.d.ts +2 -1
- package/dist/exchanges/myriad/fetchOHLCV.js +2 -2
- package/dist/exchanges/myriad/fetchOrderBook.d.ts +2 -1
- package/dist/exchanges/myriad/fetchOrderBook.js +2 -2
- package/dist/exchanges/myriad/fetchTrades.d.ts +2 -1
- package/dist/exchanges/myriad/fetchTrades.js +2 -2
- package/dist/exchanges/myriad/index.js +8 -12
- package/dist/exchanges/polymarket/fetchEvents.d.ts +2 -1
- package/dist/exchanges/polymarket/fetchEvents.js +8 -8
- package/dist/exchanges/polymarket/fetchMarkets.d.ts +2 -1
- package/dist/exchanges/polymarket/fetchMarkets.js +19 -19
- package/dist/exchanges/polymarket/fetchOHLCV.d.ts +2 -1
- package/dist/exchanges/polymarket/fetchOHLCV.js +2 -2
- package/dist/exchanges/polymarket/fetchOrderBook.d.ts +2 -1
- package/dist/exchanges/polymarket/fetchOrderBook.js +2 -2
- package/dist/exchanges/polymarket/fetchTrades.d.ts +2 -1
- package/dist/exchanges/polymarket/fetchTrades.js +2 -2
- package/dist/exchanges/polymarket/index.js +5 -5
- package/dist/exchanges/polymarket/utils.d.ts +2 -2
- package/dist/exchanges/polymarket/utils.js +7 -42
- package/dist/exchanges/probable/fetchEvents.d.ts +4 -3
- package/dist/exchanges/probable/fetchEvents.js +13 -13
- package/dist/exchanges/probable/fetchMarkets.d.ts +2 -1
- package/dist/exchanges/probable/fetchMarkets.js +16 -16
- package/dist/exchanges/probable/fetchOHLCV.d.ts +2 -1
- package/dist/exchanges/probable/fetchOHLCV.js +2 -2
- package/dist/exchanges/probable/fetchOrderBook.d.ts +2 -1
- package/dist/exchanges/probable/fetchOrderBook.js +2 -2
- package/dist/exchanges/probable/fetchTrades.d.ts +2 -2
- package/dist/exchanges/probable/fetchTrades.js +5 -1
- package/dist/exchanges/probable/index.js +7 -7
- package/dist/server/app.js +9 -0
- package/dist/types.d.ts +1 -0
- package/package.json +4 -4
|
@@ -54,22 +54,22 @@ class ProbableExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
54
54
|
// Market Data (read-only, no auth needed)
|
|
55
55
|
// --------------------------------------------------------------------------
|
|
56
56
|
async fetchMarketsImpl(params) {
|
|
57
|
-
return (0, fetchMarkets_1.fetchMarkets)(params);
|
|
57
|
+
return (0, fetchMarkets_1.fetchMarkets)(params, this.http);
|
|
58
58
|
}
|
|
59
59
|
async fetchEventsImpl(params) {
|
|
60
|
-
return (0, fetchEvents_1.fetchEvents)(params);
|
|
60
|
+
return (0, fetchEvents_1.fetchEvents)(params, this.http);
|
|
61
61
|
}
|
|
62
62
|
async getEventById(id) {
|
|
63
|
-
return (0, fetchEvents_1.fetchEventById)(id);
|
|
63
|
+
return (0, fetchEvents_1.fetchEventById)(id, this.http);
|
|
64
64
|
}
|
|
65
65
|
async getEventBySlug(slug) {
|
|
66
|
-
return (0, fetchEvents_1.fetchEventBySlug)(slug);
|
|
66
|
+
return (0, fetchEvents_1.fetchEventBySlug)(slug, this.http);
|
|
67
67
|
}
|
|
68
68
|
async fetchOrderBook(id) {
|
|
69
|
-
return (0, fetchOrderBook_1.fetchOrderBook)(id);
|
|
69
|
+
return (0, fetchOrderBook_1.fetchOrderBook)(id, this.http);
|
|
70
70
|
}
|
|
71
71
|
async fetchOHLCV(id, params) {
|
|
72
|
-
return (0, fetchOHLCV_1.fetchOHLCV)(id, params);
|
|
72
|
+
return (0, fetchOHLCV_1.fetchOHLCV)(id, params, this.http);
|
|
73
73
|
}
|
|
74
74
|
// --------------------------------------------------------------------------
|
|
75
75
|
// Trading Methods
|
|
@@ -286,7 +286,7 @@ class ProbableExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
286
286
|
async fetchTrades(id, params) {
|
|
287
287
|
const auth = this.ensureAuth();
|
|
288
288
|
const client = auth.getClobClient();
|
|
289
|
-
return (0, fetchTrades_1.fetchTrades)(id, params, client);
|
|
289
|
+
return (0, fetchTrades_1.fetchTrades)(id, params, client, this.http);
|
|
290
290
|
}
|
|
291
291
|
// --------------------------------------------------------------------------
|
|
292
292
|
// WebSocket Streaming (public, no auth needed)
|
package/dist/server/app.js
CHANGED
|
@@ -74,6 +74,15 @@ async function startServer(port, accessToken) {
|
|
|
74
74
|
}
|
|
75
75
|
exchange = defaultExchanges[exchangeName];
|
|
76
76
|
}
|
|
77
|
+
// Set verbose flag if present in request
|
|
78
|
+
if (req.body.verbose === true) {
|
|
79
|
+
exchange.verbose = true;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
// Reset to false for singleton instances to avoid leaking state between requests
|
|
83
|
+
// For new instances it defaults to false anyway
|
|
84
|
+
exchange.verbose = false;
|
|
85
|
+
}
|
|
77
86
|
// 2. Validate Method
|
|
78
87
|
if (typeof exchange[methodName] !== 'function') {
|
|
79
88
|
res.status(404).json({ success: false, error: `Method '${methodName}' not found on ${exchangeName}` });
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmxt-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.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.8.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.8.0,supportsES6=true,typescriptThreePlus=true && node ../sdks/typescript/scripts/fix-generated.js",
|
|
34
34
|
"extract:jsdoc": "node ../scripts/extract-jsdoc.js",
|
|
35
35
|
"generate:docs": "npm run extract:jsdoc && node ../scripts/generate-api-docs.js",
|
|
36
36
|
"generate:sdk:all": "npm run generate:sdk:python && npm run generate:sdk:typescript && npm run generate:docs"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@prob/clob": "0.5.0",
|
|
46
46
|
"@solana/web3.js": "^1.98.4",
|
|
47
47
|
"@types/express": "^5.0.6",
|
|
48
|
-
"axios": "^1.
|
|
48
|
+
"axios": "^1.13.2",
|
|
49
49
|
"bs58": "^6.0.0",
|
|
50
50
|
"cors": "^2.8.5",
|
|
51
51
|
"dotenv": "^17.2.3",
|