pmxt-core 2.41.0 → 2.41.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/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/polymarket/index.js +18 -24
- package/dist/exchanges/probable/api.d.ts +1 -1
- package/dist/exchanges/probable/api.js +1 -1
- package/dist/server/method-verbs.json +6 -6
- package/dist/server/openapi.yaml +217 -131
- 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-15T19:10:58.060Z
|
|
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-15T19:10:58.060Z
|
|
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-15T19:10:58.097Z
|
|
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-15T19:10:58.097Z
|
|
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-15T19:10:58.109Z
|
|
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-15T19:10:58.109Z
|
|
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-15T19:10:58.114Z
|
|
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-15T19:10:58.114Z
|
|
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-15T19:10:58.068Z
|
|
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-15T19:10:58.068Z
|
|
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-15T19:10:58.080Z
|
|
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-15T19:10:58.080Z
|
|
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-15T19:10:58.078Z
|
|
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-15T19:10:58.078Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.polymarketGammaSpec = {
|
|
@@ -153,20 +153,19 @@ class PolymarketExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
153
153
|
const auth = this.ensureAuth();
|
|
154
154
|
const client = await auth.getClobClient();
|
|
155
155
|
const side = params.side.toUpperCase() === 'BUY' ? clob_client_v2_1.Side.BUY : clob_client_v2_1.Side.SELL;
|
|
156
|
-
const price = params.price || (side === clob_client_v2_1.Side.BUY ? 0.99 : 0.01);
|
|
157
156
|
const tickSize = params.tickSize ? params.tickSize.toString() : undefined;
|
|
158
|
-
const orderArgs = {
|
|
159
|
-
tokenID: params.outcomeId,
|
|
160
|
-
price,
|
|
161
|
-
side,
|
|
162
|
-
size: params.amount,
|
|
163
|
-
};
|
|
164
157
|
const options = {};
|
|
165
158
|
if (tickSize)
|
|
166
159
|
options.tickSize = tickSize;
|
|
167
160
|
if (params.negRisk !== undefined)
|
|
168
161
|
options.negRisk = params.negRisk;
|
|
169
|
-
|
|
162
|
+
let signedOrder;
|
|
163
|
+
if (params.type === 'market' || !params.price) {
|
|
164
|
+
signedOrder = await client.createMarketOrder({ tokenID: params.outcomeId, amount: params.amount, side }, options);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
signedOrder = await client.createOrder({ tokenID: params.outcomeId, price: params.price, side, size: params.amount }, options);
|
|
168
|
+
}
|
|
170
169
|
return {
|
|
171
170
|
exchange: this.name,
|
|
172
171
|
params,
|
|
@@ -182,36 +181,31 @@ class PolymarketExchange extends BaseExchange_1.PredictionMarketExchange {
|
|
|
182
181
|
try {
|
|
183
182
|
const auth = this.ensureAuth();
|
|
184
183
|
const client = await auth.getClobClient();
|
|
185
|
-
const
|
|
184
|
+
const isMarket = built.params.type === 'market' || !built.params.price;
|
|
185
|
+
const response = isMarket
|
|
186
|
+
? await client.postOrder(built.raw, 'FOK')
|
|
187
|
+
: await client.postOrder(built.raw);
|
|
186
188
|
if (!response || !response.success) {
|
|
187
189
|
throw new Error(`${response?.errorMsg || 'Order submission failed'} (Response: ${JSON.stringify(response)})`);
|
|
188
190
|
}
|
|
189
191
|
const side = built.params.side.toUpperCase() === 'BUY' ? clob_client_v2_1.Side.BUY : clob_client_v2_1.Side.SELL;
|
|
190
|
-
const price = built.params.price ||
|
|
191
|
-
// Extract actual fill data from the CLOB OrderResponse.
|
|
192
|
-
// response.status: 'MATCHED' | 'CONFIRMED' = immediately filled,
|
|
193
|
-
// 'LIVE' = resting on the book (filled: 0 is correct).
|
|
194
|
-
// takingAmount / makingAmount are string representations of raw USDC amounts (6 decimals).
|
|
195
|
-
const USDC_DECIMALS = 6;
|
|
192
|
+
const price = built.params.price || 0;
|
|
196
193
|
const responseStatus = (response.status || '').toUpperCase();
|
|
197
194
|
const isImmediatelyFilled = responseStatus === 'MATCHED' || responseStatus === 'CONFIRMED';
|
|
198
195
|
let filled = 0;
|
|
199
196
|
if (isImmediatelyFilled) {
|
|
200
|
-
const
|
|
197
|
+
const taking = typeof response.takingAmount === 'string'
|
|
201
198
|
? parseFloat(response.takingAmount)
|
|
202
199
|
: (response.takingAmount ?? 0);
|
|
203
|
-
const
|
|
200
|
+
const making = typeof response.makingAmount === 'string'
|
|
204
201
|
? parseFloat(response.makingAmount)
|
|
205
202
|
: (response.makingAmount ?? 0);
|
|
206
|
-
// For BUY: makingAmount
|
|
207
|
-
//
|
|
208
|
-
|
|
209
|
-
filled = side === clob_client_v2_1.Side.BUY
|
|
210
|
-
? takingRaw / Math.pow(10, USDC_DECIMALS)
|
|
211
|
-
: makingRaw / Math.pow(10, USDC_DECIMALS);
|
|
203
|
+
// For BUY: makingAmount = shares filled. For SELL: takingAmount = shares filled.
|
|
204
|
+
// Values are already human-readable (not raw 6-decimal units).
|
|
205
|
+
filled = side === clob_client_v2_1.Side.BUY ? making : taking;
|
|
212
206
|
}
|
|
213
207
|
const remaining = Math.max(0, built.params.amount - filled);
|
|
214
|
-
const orderStatus = filled >= built.params.amount ? 'filled' : 'open';
|
|
208
|
+
const orderStatus = filled >= built.params.amount - 0.001 ? 'filled' : 'open';
|
|
215
209
|
return {
|
|
216
210
|
id: response.orderID,
|
|
217
211
|
marketId: built.params.marketId,
|
|
@@ -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-15T19:10:58.102Z
|
|
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-15T19:10:58.102Z
|
|
7
7
|
* Do not edit manually -- run "npm run fetch:openapi" to regenerate.
|
|
8
8
|
*/
|
|
9
9
|
exports.probableApiSpec = {
|
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
]
|
|
296
296
|
},
|
|
297
297
|
"watchOrderBook": {
|
|
298
|
-
"verb": "
|
|
298
|
+
"verb": "ws",
|
|
299
299
|
"args": [
|
|
300
300
|
{
|
|
301
301
|
"name": "outcomeId",
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
]
|
|
311
311
|
},
|
|
312
312
|
"watchOrderBooks": {
|
|
313
|
-
"verb": "
|
|
313
|
+
"verb": "ws",
|
|
314
314
|
"args": [
|
|
315
315
|
{
|
|
316
316
|
"name": "outcomeIds",
|
|
@@ -325,7 +325,7 @@
|
|
|
325
325
|
]
|
|
326
326
|
},
|
|
327
327
|
"unwatchOrderBook": {
|
|
328
|
-
"verb": "
|
|
328
|
+
"verb": "ws",
|
|
329
329
|
"args": [
|
|
330
330
|
{
|
|
331
331
|
"name": "outcomeId",
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
]
|
|
336
336
|
},
|
|
337
337
|
"watchTrades": {
|
|
338
|
-
"verb": "
|
|
338
|
+
"verb": "ws",
|
|
339
339
|
"args": [
|
|
340
340
|
{
|
|
341
341
|
"name": "outcomeId",
|
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
]
|
|
361
361
|
},
|
|
362
362
|
"watchAddress": {
|
|
363
|
-
"verb": "
|
|
363
|
+
"verb": "ws",
|
|
364
364
|
"args": [
|
|
365
365
|
{
|
|
366
366
|
"name": "address",
|
|
@@ -375,7 +375,7 @@
|
|
|
375
375
|
]
|
|
376
376
|
},
|
|
377
377
|
"unwatchAddress": {
|
|
378
|
-
"verb": "
|
|
378
|
+
"verb": "ws",
|
|
379
379
|
"args": [
|
|
380
380
|
{
|
|
381
381
|
"name": "address",
|
package/dist/server/openapi.yaml
CHANGED
|
@@ -1300,25 +1300,48 @@ paths:
|
|
|
1300
1300
|
operationId: watchOrderBook
|
|
1301
1301
|
parameters:
|
|
1302
1302
|
- $ref: '#/components/parameters/ExchangeParam'
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1303
|
+
description: >-
|
|
1304
|
+
Watch order book updates in real-time via WebSocket. Returns a promise that resolves with the next order book
|
|
1305
|
+
update. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
1306
|
+
|
|
1307
|
+
|
|
1308
|
+
**Transport:** WebSocket
|
|
1309
|
+
|
|
1310
|
+
|
|
1311
|
+
| Environment | URL |
|
|
1312
|
+
|
|
1313
|
+
|---|---|
|
|
1314
|
+
|
|
1315
|
+
| Local sidecar | `ws://localhost:3847/ws` |
|
|
1316
|
+
|
|
1317
|
+
| Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
**Subscribe:**
|
|
1321
|
+
|
|
1322
|
+
```json
|
|
1323
|
+
|
|
1324
|
+
{ "id": "req-1", "action": "subscribe", "method": "watchOrderBook", "args": [...] }
|
|
1325
|
+
|
|
1326
|
+
```
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
**Server response:**
|
|
1330
|
+
|
|
1331
|
+
```json
|
|
1332
|
+
|
|
1333
|
+
{ "event": "data", "id": "req-1", "method": "watchOrderBook", "symbol": "...", "data": { ... } }
|
|
1334
|
+
|
|
1335
|
+
```
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
**Unsubscribe:**
|
|
1339
|
+
|
|
1340
|
+
```json
|
|
1341
|
+
|
|
1342
|
+
{ "id": "req-1", "action": "unsubscribe" }
|
|
1343
|
+
|
|
1344
|
+
```
|
|
1322
1345
|
responses:
|
|
1323
1346
|
'200':
|
|
1324
1347
|
description: Watch Order Book response
|
|
@@ -1331,36 +1354,55 @@ paths:
|
|
|
1331
1354
|
properties:
|
|
1332
1355
|
data:
|
|
1333
1356
|
$ref: '#/components/schemas/OrderBook'
|
|
1334
|
-
description: >-
|
|
1335
|
-
Watch order book updates in real-time via WebSocket. Returns a promise that resolves with the next order book
|
|
1336
|
-
update. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
1337
1357
|
'/api/{exchange}/watchOrderBooks':
|
|
1338
1358
|
post:
|
|
1339
1359
|
summary: Watch Order Books
|
|
1340
1360
|
operationId: watchOrderBooks
|
|
1341
1361
|
parameters:
|
|
1342
1362
|
- $ref: '#/components/parameters/ExchangeParam'
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1363
|
+
description: >-
|
|
1364
|
+
Watch multiple order books simultaneously via WebSocket. Returns a promise that resolves with a record of order
|
|
1365
|
+
book snapshots keyed by ID. Exchanges with native batch support (e.g. Kalshi) send a single subscribe message
|
|
1366
|
+
for all tickers; others fall back to individual watchOrderBook calls.
|
|
1367
|
+
|
|
1368
|
+
|
|
1369
|
+
**Transport:** WebSocket
|
|
1370
|
+
|
|
1371
|
+
|
|
1372
|
+
| Environment | URL |
|
|
1373
|
+
|
|
1374
|
+
|---|---|
|
|
1375
|
+
|
|
1376
|
+
| Local sidecar | `ws://localhost:3847/ws` |
|
|
1377
|
+
|
|
1378
|
+
| Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
|
|
1379
|
+
|
|
1380
|
+
|
|
1381
|
+
**Subscribe:**
|
|
1382
|
+
|
|
1383
|
+
```json
|
|
1384
|
+
|
|
1385
|
+
{ "id": "req-1", "action": "subscribe", "method": "watchOrderBooks", "args": [...] }
|
|
1386
|
+
|
|
1387
|
+
```
|
|
1388
|
+
|
|
1389
|
+
|
|
1390
|
+
**Server response:**
|
|
1391
|
+
|
|
1392
|
+
```json
|
|
1393
|
+
|
|
1394
|
+
{ "event": "data", "id": "req-1", "method": "watchOrderBooks", "symbol": "...", "data": { ... } }
|
|
1395
|
+
|
|
1396
|
+
```
|
|
1397
|
+
|
|
1398
|
+
|
|
1399
|
+
**Unsubscribe:**
|
|
1400
|
+
|
|
1401
|
+
```json
|
|
1402
|
+
|
|
1403
|
+
{ "id": "req-1", "action": "unsubscribe" }
|
|
1404
|
+
|
|
1405
|
+
```
|
|
1364
1406
|
responses:
|
|
1365
1407
|
'200':
|
|
1366
1408
|
description: Watch Order Books response
|
|
@@ -1375,33 +1417,36 @@ paths:
|
|
|
1375
1417
|
type: object
|
|
1376
1418
|
additionalProperties:
|
|
1377
1419
|
$ref: '#/components/schemas/OrderBook'
|
|
1378
|
-
description: >-
|
|
1379
|
-
Watch multiple order books simultaneously via WebSocket. Returns a promise that resolves with a record of order
|
|
1380
|
-
book snapshots keyed by ID. Exchanges with native batch support (e.g. Kalshi) send a single subscribe message
|
|
1381
|
-
for all tickers; others fall back to individual watchOrderBook calls.
|
|
1382
1420
|
'/api/{exchange}/unwatchOrderBook':
|
|
1383
1421
|
post:
|
|
1384
1422
|
summary: Unwatch Order Book
|
|
1385
1423
|
operationId: unwatchOrderBook
|
|
1386
1424
|
parameters:
|
|
1387
1425
|
- $ref: '#/components/parameters/ExchangeParam'
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1426
|
+
description: |-
|
|
1427
|
+
Unsubscribe from a previously watched order book stream.
|
|
1428
|
+
|
|
1429
|
+
**Transport:** WebSocket
|
|
1430
|
+
|
|
1431
|
+
| Environment | URL |
|
|
1432
|
+
|---|---|
|
|
1433
|
+
| Local sidecar | `ws://localhost:3847/ws` |
|
|
1434
|
+
| Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
|
|
1435
|
+
|
|
1436
|
+
**Subscribe:**
|
|
1437
|
+
```json
|
|
1438
|
+
{ "id": "req-1", "action": "subscribe", "method": "unwatchOrderBook", "args": [...] }
|
|
1439
|
+
```
|
|
1440
|
+
|
|
1441
|
+
**Server response:**
|
|
1442
|
+
```json
|
|
1443
|
+
{ "event": "data", "id": "req-1", "method": "unwatchOrderBook", "symbol": "...", "data": { ... } }
|
|
1444
|
+
```
|
|
1445
|
+
|
|
1446
|
+
**Unsubscribe:**
|
|
1447
|
+
```json
|
|
1448
|
+
{ "id": "req-1", "action": "unsubscribe" }
|
|
1449
|
+
```
|
|
1405
1450
|
responses:
|
|
1406
1451
|
'200':
|
|
1407
1452
|
description: Unwatch Order Book response
|
|
@@ -1409,34 +1454,54 @@ paths:
|
|
|
1409
1454
|
application/json:
|
|
1410
1455
|
schema:
|
|
1411
1456
|
$ref: '#/components/schemas/BaseResponse'
|
|
1412
|
-
description: Unsubscribe from a previously watched order book stream.
|
|
1413
1457
|
'/api/{exchange}/watchTrades':
|
|
1414
1458
|
post:
|
|
1415
1459
|
summary: Watch Trades
|
|
1416
1460
|
operationId: watchTrades
|
|
1417
1461
|
parameters:
|
|
1418
1462
|
- $ref: '#/components/parameters/ExchangeParam'
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1463
|
+
description: >-
|
|
1464
|
+
Watch trade executions in real-time via WebSocket. Returns a promise that resolves with the next trade(s). Call
|
|
1465
|
+
repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
1466
|
+
|
|
1467
|
+
|
|
1468
|
+
**Transport:** WebSocket
|
|
1469
|
+
|
|
1470
|
+
|
|
1471
|
+
| Environment | URL |
|
|
1472
|
+
|
|
1473
|
+
|---|---|
|
|
1474
|
+
|
|
1475
|
+
| Local sidecar | `ws://localhost:3847/ws` |
|
|
1476
|
+
|
|
1477
|
+
| Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
**Subscribe:**
|
|
1481
|
+
|
|
1482
|
+
```json
|
|
1483
|
+
|
|
1484
|
+
{ "id": "req-1", "action": "subscribe", "method": "watchTrades", "args": [...] }
|
|
1485
|
+
|
|
1486
|
+
```
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
**Server response:**
|
|
1490
|
+
|
|
1491
|
+
```json
|
|
1492
|
+
|
|
1493
|
+
{ "event": "data", "id": "req-1", "method": "watchTrades", "symbol": "...", "data": { ... } }
|
|
1494
|
+
|
|
1495
|
+
```
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
**Unsubscribe:**
|
|
1499
|
+
|
|
1500
|
+
```json
|
|
1501
|
+
|
|
1502
|
+
{ "id": "req-1", "action": "unsubscribe" }
|
|
1503
|
+
|
|
1504
|
+
```
|
|
1440
1505
|
responses:
|
|
1441
1506
|
'200':
|
|
1442
1507
|
description: Watch Trades response
|
|
@@ -1451,36 +1516,54 @@ paths:
|
|
|
1451
1516
|
type: array
|
|
1452
1517
|
items:
|
|
1453
1518
|
$ref: '#/components/schemas/Trade'
|
|
1454
|
-
description: >-
|
|
1455
|
-
Watch trade executions in real-time via WebSocket. Returns a promise that resolves with the next trade(s). Call
|
|
1456
|
-
repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
1457
1519
|
'/api/{exchange}/watchAddress':
|
|
1458
1520
|
post:
|
|
1459
1521
|
summary: Watch Address
|
|
1460
1522
|
operationId: watchAddress
|
|
1461
1523
|
parameters:
|
|
1462
1524
|
- $ref: '#/components/parameters/ExchangeParam'
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1525
|
+
description: >-
|
|
1526
|
+
Stream activity for a public wallet address Returns a promise that resolves with the next activity snapshot
|
|
1527
|
+
whenever a change is detected. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
**Transport:** WebSocket
|
|
1531
|
+
|
|
1532
|
+
|
|
1533
|
+
| Environment | URL |
|
|
1534
|
+
|
|
1535
|
+
|---|---|
|
|
1536
|
+
|
|
1537
|
+
| Local sidecar | `ws://localhost:3847/ws` |
|
|
1538
|
+
|
|
1539
|
+
| Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
|
|
1540
|
+
|
|
1541
|
+
|
|
1542
|
+
**Subscribe:**
|
|
1543
|
+
|
|
1544
|
+
```json
|
|
1545
|
+
|
|
1546
|
+
{ "id": "req-1", "action": "subscribe", "method": "watchAddress", "args": [...] }
|
|
1547
|
+
|
|
1548
|
+
```
|
|
1549
|
+
|
|
1550
|
+
|
|
1551
|
+
**Server response:**
|
|
1552
|
+
|
|
1553
|
+
```json
|
|
1554
|
+
|
|
1555
|
+
{ "event": "data", "id": "req-1", "method": "watchAddress", "symbol": "...", "data": { ... } }
|
|
1556
|
+
|
|
1557
|
+
```
|
|
1558
|
+
|
|
1559
|
+
|
|
1560
|
+
**Unsubscribe:**
|
|
1561
|
+
|
|
1562
|
+
```json
|
|
1563
|
+
|
|
1564
|
+
{ "id": "req-1", "action": "unsubscribe" }
|
|
1565
|
+
|
|
1566
|
+
```
|
|
1484
1567
|
responses:
|
|
1485
1568
|
'200':
|
|
1486
1569
|
description: Watch Address response
|
|
@@ -1493,32 +1576,36 @@ paths:
|
|
|
1493
1576
|
properties:
|
|
1494
1577
|
data:
|
|
1495
1578
|
type: object
|
|
1496
|
-
description: >-
|
|
1497
|
-
Stream activity for a public wallet address Returns a promise that resolves with the next activity snapshot
|
|
1498
|
-
whenever a change is detected. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
1499
1579
|
'/api/{exchange}/unwatchAddress':
|
|
1500
1580
|
post:
|
|
1501
1581
|
summary: Unwatch Address
|
|
1502
1582
|
operationId: unwatchAddress
|
|
1503
1583
|
parameters:
|
|
1504
1584
|
- $ref: '#/components/parameters/ExchangeParam'
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1585
|
+
description: |-
|
|
1586
|
+
Stop watching a previously registered wallet address and release its resource updates.
|
|
1587
|
+
|
|
1588
|
+
**Transport:** WebSocket
|
|
1589
|
+
|
|
1590
|
+
| Environment | URL |
|
|
1591
|
+
|---|---|
|
|
1592
|
+
| Local sidecar | `ws://localhost:3847/ws` |
|
|
1593
|
+
| Hosted API | `wss://api.pmxt.dev/ws?apiKey=YOUR_KEY` |
|
|
1594
|
+
|
|
1595
|
+
**Subscribe:**
|
|
1596
|
+
```json
|
|
1597
|
+
{ "id": "req-1", "action": "subscribe", "method": "unwatchAddress", "args": [...] }
|
|
1598
|
+
```
|
|
1599
|
+
|
|
1600
|
+
**Server response:**
|
|
1601
|
+
```json
|
|
1602
|
+
{ "event": "data", "id": "req-1", "method": "unwatchAddress", "symbol": "...", "data": { ... } }
|
|
1603
|
+
```
|
|
1604
|
+
|
|
1605
|
+
**Unsubscribe:**
|
|
1606
|
+
```json
|
|
1607
|
+
{ "id": "req-1", "action": "unsubscribe" }
|
|
1608
|
+
```
|
|
1522
1609
|
responses:
|
|
1523
1610
|
'200':
|
|
1524
1611
|
description: Unwatch Address response
|
|
@@ -1526,7 +1613,6 @@ paths:
|
|
|
1526
1613
|
application/json:
|
|
1527
1614
|
schema:
|
|
1528
1615
|
$ref: '#/components/schemas/BaseResponse'
|
|
1529
|
-
description: Stop watching a previously registered wallet address and release its resource updates.
|
|
1530
1616
|
'/api/{exchange}/testDummyMethod':
|
|
1531
1617
|
post:
|
|
1532
1618
|
summary: Test Dummy Method
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmxt-core",
|
|
3
|
-
"version": "2.41.
|
|
3
|
+
"version": "2.41.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.41.
|
|
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.41.
|
|
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.41.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.41.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",
|