pmxtjs 2.2.0 → 2.4.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/README.md +2 -2
- package/dist/esm/generated/src/apis/DefaultApi.d.ts +21 -0
- package/dist/esm/generated/src/apis/DefaultApi.js +42 -21
- package/dist/esm/generated/src/models/MarketOutcome.d.ts +6 -0
- package/dist/esm/generated/src/models/MarketOutcome.js +2 -0
- package/dist/esm/pmxt/client.js +18 -2
- package/dist/esm/pmxt/models.d.ts +2 -0
- package/dist/generated/src/apis/DefaultApi.d.ts +21 -0
- package/dist/generated/src/apis/DefaultApi.js +42 -21
- package/dist/generated/src/models/MarketOutcome.d.ts +6 -0
- package/dist/generated/src/models/MarketOutcome.js +2 -0
- package/dist/pmxt/client.js +18 -2
- package/dist/pmxt/models.d.ts +2 -0
- package/generated/docs/DefaultApi.md +42 -42
- package/generated/docs/MarketOutcome.md +2 -0
- package/generated/package.json +1 -1
- package/generated/src/apis/DefaultApi.ts +42 -21
- package/generated/src/models/MarketOutcome.ts +8 -0
- package/package.json +2 -2
- package/pmxt/client.ts +24 -2
- package/pmxt/models.ts +3 -0
package/generated/package.json
CHANGED
|
@@ -1103,7 +1103,8 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
1103
1103
|
export const CancelOrderOperationExchangeEnum = {
|
|
1104
1104
|
Polymarket: 'polymarket',
|
|
1105
1105
|
Kalshi: 'kalshi',
|
|
1106
|
-
Limitless: 'limitless'
|
|
1106
|
+
Limitless: 'limitless',
|
|
1107
|
+
Probable: 'probable'
|
|
1107
1108
|
} as const;
|
|
1108
1109
|
export type CancelOrderOperationExchangeEnum = typeof CancelOrderOperationExchangeEnum[keyof typeof CancelOrderOperationExchangeEnum];
|
|
1109
1110
|
/**
|
|
@@ -1112,7 +1113,8 @@ export type CancelOrderOperationExchangeEnum = typeof CancelOrderOperationExchan
|
|
|
1112
1113
|
export const CloseExchangeEnum = {
|
|
1113
1114
|
Polymarket: 'polymarket',
|
|
1114
1115
|
Kalshi: 'kalshi',
|
|
1115
|
-
Limitless: 'limitless'
|
|
1116
|
+
Limitless: 'limitless',
|
|
1117
|
+
Probable: 'probable'
|
|
1116
1118
|
} as const;
|
|
1117
1119
|
export type CloseExchangeEnum = typeof CloseExchangeEnum[keyof typeof CloseExchangeEnum];
|
|
1118
1120
|
/**
|
|
@@ -1121,7 +1123,8 @@ export type CloseExchangeEnum = typeof CloseExchangeEnum[keyof typeof CloseExcha
|
|
|
1121
1123
|
export const CreateOrderOperationExchangeEnum = {
|
|
1122
1124
|
Polymarket: 'polymarket',
|
|
1123
1125
|
Kalshi: 'kalshi',
|
|
1124
|
-
Limitless: 'limitless'
|
|
1126
|
+
Limitless: 'limitless',
|
|
1127
|
+
Probable: 'probable'
|
|
1125
1128
|
} as const;
|
|
1126
1129
|
export type CreateOrderOperationExchangeEnum = typeof CreateOrderOperationExchangeEnum[keyof typeof CreateOrderOperationExchangeEnum];
|
|
1127
1130
|
/**
|
|
@@ -1130,7 +1133,8 @@ export type CreateOrderOperationExchangeEnum = typeof CreateOrderOperationExchan
|
|
|
1130
1133
|
export const FetchBalanceExchangeEnum = {
|
|
1131
1134
|
Polymarket: 'polymarket',
|
|
1132
1135
|
Kalshi: 'kalshi',
|
|
1133
|
-
Limitless: 'limitless'
|
|
1136
|
+
Limitless: 'limitless',
|
|
1137
|
+
Probable: 'probable'
|
|
1134
1138
|
} as const;
|
|
1135
1139
|
export type FetchBalanceExchangeEnum = typeof FetchBalanceExchangeEnum[keyof typeof FetchBalanceExchangeEnum];
|
|
1136
1140
|
/**
|
|
@@ -1139,7 +1143,8 @@ export type FetchBalanceExchangeEnum = typeof FetchBalanceExchangeEnum[keyof typ
|
|
|
1139
1143
|
export const FetchEventsOperationExchangeEnum = {
|
|
1140
1144
|
Polymarket: 'polymarket',
|
|
1141
1145
|
Kalshi: 'kalshi',
|
|
1142
|
-
Limitless: 'limitless'
|
|
1146
|
+
Limitless: 'limitless',
|
|
1147
|
+
Probable: 'probable'
|
|
1143
1148
|
} as const;
|
|
1144
1149
|
export type FetchEventsOperationExchangeEnum = typeof FetchEventsOperationExchangeEnum[keyof typeof FetchEventsOperationExchangeEnum];
|
|
1145
1150
|
/**
|
|
@@ -1148,7 +1153,8 @@ export type FetchEventsOperationExchangeEnum = typeof FetchEventsOperationExchan
|
|
|
1148
1153
|
export const FetchMarketsOperationExchangeEnum = {
|
|
1149
1154
|
Polymarket: 'polymarket',
|
|
1150
1155
|
Kalshi: 'kalshi',
|
|
1151
|
-
Limitless: 'limitless'
|
|
1156
|
+
Limitless: 'limitless',
|
|
1157
|
+
Probable: 'probable'
|
|
1152
1158
|
} as const;
|
|
1153
1159
|
export type FetchMarketsOperationExchangeEnum = typeof FetchMarketsOperationExchangeEnum[keyof typeof FetchMarketsOperationExchangeEnum];
|
|
1154
1160
|
/**
|
|
@@ -1157,7 +1163,8 @@ export type FetchMarketsOperationExchangeEnum = typeof FetchMarketsOperationExch
|
|
|
1157
1163
|
export const FetchOHLCVOperationExchangeEnum = {
|
|
1158
1164
|
Polymarket: 'polymarket',
|
|
1159
1165
|
Kalshi: 'kalshi',
|
|
1160
|
-
Limitless: 'limitless'
|
|
1166
|
+
Limitless: 'limitless',
|
|
1167
|
+
Probable: 'probable'
|
|
1161
1168
|
} as const;
|
|
1162
1169
|
export type FetchOHLCVOperationExchangeEnum = typeof FetchOHLCVOperationExchangeEnum[keyof typeof FetchOHLCVOperationExchangeEnum];
|
|
1163
1170
|
/**
|
|
@@ -1166,7 +1173,8 @@ export type FetchOHLCVOperationExchangeEnum = typeof FetchOHLCVOperationExchange
|
|
|
1166
1173
|
export const FetchOpenOrdersOperationExchangeEnum = {
|
|
1167
1174
|
Polymarket: 'polymarket',
|
|
1168
1175
|
Kalshi: 'kalshi',
|
|
1169
|
-
Limitless: 'limitless'
|
|
1176
|
+
Limitless: 'limitless',
|
|
1177
|
+
Probable: 'probable'
|
|
1170
1178
|
} as const;
|
|
1171
1179
|
export type FetchOpenOrdersOperationExchangeEnum = typeof FetchOpenOrdersOperationExchangeEnum[keyof typeof FetchOpenOrdersOperationExchangeEnum];
|
|
1172
1180
|
/**
|
|
@@ -1175,7 +1183,8 @@ export type FetchOpenOrdersOperationExchangeEnum = typeof FetchOpenOrdersOperati
|
|
|
1175
1183
|
export const FetchOrderExchangeEnum = {
|
|
1176
1184
|
Polymarket: 'polymarket',
|
|
1177
1185
|
Kalshi: 'kalshi',
|
|
1178
|
-
Limitless: 'limitless'
|
|
1186
|
+
Limitless: 'limitless',
|
|
1187
|
+
Probable: 'probable'
|
|
1179
1188
|
} as const;
|
|
1180
1189
|
export type FetchOrderExchangeEnum = typeof FetchOrderExchangeEnum[keyof typeof FetchOrderExchangeEnum];
|
|
1181
1190
|
/**
|
|
@@ -1184,7 +1193,8 @@ export type FetchOrderExchangeEnum = typeof FetchOrderExchangeEnum[keyof typeof
|
|
|
1184
1193
|
export const FetchOrderBookOperationExchangeEnum = {
|
|
1185
1194
|
Polymarket: 'polymarket',
|
|
1186
1195
|
Kalshi: 'kalshi',
|
|
1187
|
-
Limitless: 'limitless'
|
|
1196
|
+
Limitless: 'limitless',
|
|
1197
|
+
Probable: 'probable'
|
|
1188
1198
|
} as const;
|
|
1189
1199
|
export type FetchOrderBookOperationExchangeEnum = typeof FetchOrderBookOperationExchangeEnum[keyof typeof FetchOrderBookOperationExchangeEnum];
|
|
1190
1200
|
/**
|
|
@@ -1193,7 +1203,8 @@ export type FetchOrderBookOperationExchangeEnum = typeof FetchOrderBookOperation
|
|
|
1193
1203
|
export const FetchPositionsOperationExchangeEnum = {
|
|
1194
1204
|
Polymarket: 'polymarket',
|
|
1195
1205
|
Kalshi: 'kalshi',
|
|
1196
|
-
Limitless: 'limitless'
|
|
1206
|
+
Limitless: 'limitless',
|
|
1207
|
+
Probable: 'probable'
|
|
1197
1208
|
} as const;
|
|
1198
1209
|
export type FetchPositionsOperationExchangeEnum = typeof FetchPositionsOperationExchangeEnum[keyof typeof FetchPositionsOperationExchangeEnum];
|
|
1199
1210
|
/**
|
|
@@ -1202,7 +1213,8 @@ export type FetchPositionsOperationExchangeEnum = typeof FetchPositionsOperation
|
|
|
1202
1213
|
export const FetchTradesOperationExchangeEnum = {
|
|
1203
1214
|
Polymarket: 'polymarket',
|
|
1204
1215
|
Kalshi: 'kalshi',
|
|
1205
|
-
Limitless: 'limitless'
|
|
1216
|
+
Limitless: 'limitless',
|
|
1217
|
+
Probable: 'probable'
|
|
1206
1218
|
} as const;
|
|
1207
1219
|
export type FetchTradesOperationExchangeEnum = typeof FetchTradesOperationExchangeEnum[keyof typeof FetchTradesOperationExchangeEnum];
|
|
1208
1220
|
/**
|
|
@@ -1211,7 +1223,8 @@ export type FetchTradesOperationExchangeEnum = typeof FetchTradesOperationExchan
|
|
|
1211
1223
|
export const FilterEventsOperationExchangeEnum = {
|
|
1212
1224
|
Polymarket: 'polymarket',
|
|
1213
1225
|
Kalshi: 'kalshi',
|
|
1214
|
-
Limitless: 'limitless'
|
|
1226
|
+
Limitless: 'limitless',
|
|
1227
|
+
Probable: 'probable'
|
|
1215
1228
|
} as const;
|
|
1216
1229
|
export type FilterEventsOperationExchangeEnum = typeof FilterEventsOperationExchangeEnum[keyof typeof FilterEventsOperationExchangeEnum];
|
|
1217
1230
|
/**
|
|
@@ -1220,7 +1233,8 @@ export type FilterEventsOperationExchangeEnum = typeof FilterEventsOperationExch
|
|
|
1220
1233
|
export const FilterMarketsOperationExchangeEnum = {
|
|
1221
1234
|
Polymarket: 'polymarket',
|
|
1222
1235
|
Kalshi: 'kalshi',
|
|
1223
|
-
Limitless: 'limitless'
|
|
1236
|
+
Limitless: 'limitless',
|
|
1237
|
+
Probable: 'probable'
|
|
1224
1238
|
} as const;
|
|
1225
1239
|
export type FilterMarketsOperationExchangeEnum = typeof FilterMarketsOperationExchangeEnum[keyof typeof FilterMarketsOperationExchangeEnum];
|
|
1226
1240
|
/**
|
|
@@ -1229,7 +1243,8 @@ export type FilterMarketsOperationExchangeEnum = typeof FilterMarketsOperationEx
|
|
|
1229
1243
|
export const GetExecutionPriceOperationExchangeEnum = {
|
|
1230
1244
|
Polymarket: 'polymarket',
|
|
1231
1245
|
Kalshi: 'kalshi',
|
|
1232
|
-
Limitless: 'limitless'
|
|
1246
|
+
Limitless: 'limitless',
|
|
1247
|
+
Probable: 'probable'
|
|
1233
1248
|
} as const;
|
|
1234
1249
|
export type GetExecutionPriceOperationExchangeEnum = typeof GetExecutionPriceOperationExchangeEnum[keyof typeof GetExecutionPriceOperationExchangeEnum];
|
|
1235
1250
|
/**
|
|
@@ -1238,7 +1253,8 @@ export type GetExecutionPriceOperationExchangeEnum = typeof GetExecutionPriceOpe
|
|
|
1238
1253
|
export const GetExecutionPriceDetailedExchangeEnum = {
|
|
1239
1254
|
Polymarket: 'polymarket',
|
|
1240
1255
|
Kalshi: 'kalshi',
|
|
1241
|
-
Limitless: 'limitless'
|
|
1256
|
+
Limitless: 'limitless',
|
|
1257
|
+
Probable: 'probable'
|
|
1242
1258
|
} as const;
|
|
1243
1259
|
export type GetExecutionPriceDetailedExchangeEnum = typeof GetExecutionPriceDetailedExchangeEnum[keyof typeof GetExecutionPriceDetailedExchangeEnum];
|
|
1244
1260
|
/**
|
|
@@ -1247,7 +1263,8 @@ export type GetExecutionPriceDetailedExchangeEnum = typeof GetExecutionPriceDeta
|
|
|
1247
1263
|
export const WatchOrderBookOperationExchangeEnum = {
|
|
1248
1264
|
Polymarket: 'polymarket',
|
|
1249
1265
|
Kalshi: 'kalshi',
|
|
1250
|
-
Limitless: 'limitless'
|
|
1266
|
+
Limitless: 'limitless',
|
|
1267
|
+
Probable: 'probable'
|
|
1251
1268
|
} as const;
|
|
1252
1269
|
export type WatchOrderBookOperationExchangeEnum = typeof WatchOrderBookOperationExchangeEnum[keyof typeof WatchOrderBookOperationExchangeEnum];
|
|
1253
1270
|
/**
|
|
@@ -1256,7 +1273,8 @@ export type WatchOrderBookOperationExchangeEnum = typeof WatchOrderBookOperation
|
|
|
1256
1273
|
export const WatchPricesOperationExchangeEnum = {
|
|
1257
1274
|
Polymarket: 'polymarket',
|
|
1258
1275
|
Kalshi: 'kalshi',
|
|
1259
|
-
Limitless: 'limitless'
|
|
1276
|
+
Limitless: 'limitless',
|
|
1277
|
+
Probable: 'probable'
|
|
1260
1278
|
} as const;
|
|
1261
1279
|
export type WatchPricesOperationExchangeEnum = typeof WatchPricesOperationExchangeEnum[keyof typeof WatchPricesOperationExchangeEnum];
|
|
1262
1280
|
/**
|
|
@@ -1265,7 +1283,8 @@ export type WatchPricesOperationExchangeEnum = typeof WatchPricesOperationExchan
|
|
|
1265
1283
|
export const WatchTradesOperationExchangeEnum = {
|
|
1266
1284
|
Polymarket: 'polymarket',
|
|
1267
1285
|
Kalshi: 'kalshi',
|
|
1268
|
-
Limitless: 'limitless'
|
|
1286
|
+
Limitless: 'limitless',
|
|
1287
|
+
Probable: 'probable'
|
|
1269
1288
|
} as const;
|
|
1270
1289
|
export type WatchTradesOperationExchangeEnum = typeof WatchTradesOperationExchangeEnum[keyof typeof WatchTradesOperationExchangeEnum];
|
|
1271
1290
|
/**
|
|
@@ -1274,7 +1293,8 @@ export type WatchTradesOperationExchangeEnum = typeof WatchTradesOperationExchan
|
|
|
1274
1293
|
export const WatchUserPositionsOperationExchangeEnum = {
|
|
1275
1294
|
Polymarket: 'polymarket',
|
|
1276
1295
|
Kalshi: 'kalshi',
|
|
1277
|
-
Limitless: 'limitless'
|
|
1296
|
+
Limitless: 'limitless',
|
|
1297
|
+
Probable: 'probable'
|
|
1278
1298
|
} as const;
|
|
1279
1299
|
export type WatchUserPositionsOperationExchangeEnum = typeof WatchUserPositionsOperationExchangeEnum[keyof typeof WatchUserPositionsOperationExchangeEnum];
|
|
1280
1300
|
/**
|
|
@@ -1283,6 +1303,7 @@ export type WatchUserPositionsOperationExchangeEnum = typeof WatchUserPositionsO
|
|
|
1283
1303
|
export const WatchUserTransactionsExchangeEnum = {
|
|
1284
1304
|
Polymarket: 'polymarket',
|
|
1285
1305
|
Kalshi: 'kalshi',
|
|
1286
|
-
Limitless: 'limitless'
|
|
1306
|
+
Limitless: 'limitless',
|
|
1307
|
+
Probable: 'probable'
|
|
1287
1308
|
} as const;
|
|
1288
1309
|
export type WatchUserTransactionsExchangeEnum = typeof WatchUserTransactionsExchangeEnum[keyof typeof WatchUserTransactionsExchangeEnum];
|
|
@@ -25,6 +25,12 @@ export interface MarketOutcome {
|
|
|
25
25
|
* @memberof MarketOutcome
|
|
26
26
|
*/
|
|
27
27
|
outcomeId?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The market this outcome belongs to (set automatically)
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof MarketOutcome
|
|
32
|
+
*/
|
|
33
|
+
marketId?: string;
|
|
28
34
|
/**
|
|
29
35
|
*
|
|
30
36
|
* @type {string}
|
|
@@ -69,6 +75,7 @@ export function MarketOutcomeFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
69
75
|
return {
|
|
70
76
|
|
|
71
77
|
'outcomeId': json['outcomeId'] == null ? undefined : json['outcomeId'],
|
|
78
|
+
'marketId': json['marketId'] == null ? undefined : json['marketId'],
|
|
72
79
|
'label': json['label'] == null ? undefined : json['label'],
|
|
73
80
|
'price': json['price'] == null ? undefined : json['price'],
|
|
74
81
|
'priceChange24h': json['priceChange24h'] == null ? undefined : json['priceChange24h'],
|
|
@@ -88,6 +95,7 @@ export function MarketOutcomeToJSONTyped(value?: MarketOutcome | null, ignoreDis
|
|
|
88
95
|
return {
|
|
89
96
|
|
|
90
97
|
'outcomeId': value['outcomeId'],
|
|
98
|
+
'marketId': value['marketId'],
|
|
91
99
|
'label': value['label'],
|
|
92
100
|
'price': value['price'],
|
|
93
101
|
'priceChange24h': value['priceChange24h'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmxtjs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Unified prediction market data API - The ccxt for prediction markets",
|
|
5
5
|
"author": "PMXT Contributors",
|
|
6
6
|
"repository": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"unified"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"pmxt-core": "2.
|
|
45
|
+
"pmxt-core": "2.4.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/jest": "^30.0.0",
|
package/pmxt/client.ts
CHANGED
|
@@ -45,6 +45,7 @@ import { ServerManager } from "./server-manager.js";
|
|
|
45
45
|
function convertMarket(raw: any): UnifiedMarket {
|
|
46
46
|
const outcomes: MarketOutcome[] = (raw.outcomes || []).map((o: any) => ({
|
|
47
47
|
outcomeId: o.outcomeId,
|
|
48
|
+
marketId: o.marketId,
|
|
48
49
|
label: o.label,
|
|
49
50
|
price: o.price,
|
|
50
51
|
priceChange24h: o.priceChange24h,
|
|
@@ -53,6 +54,7 @@ function convertMarket(raw: any): UnifiedMarket {
|
|
|
53
54
|
|
|
54
55
|
const convertOutcome = (o: any) => o ? ({
|
|
55
56
|
outcomeId: o.outcomeId,
|
|
57
|
+
marketId: o.marketId,
|
|
56
58
|
label: o.label,
|
|
57
59
|
price: o.price,
|
|
58
60
|
priceChange24h: o.priceChange24h,
|
|
@@ -571,9 +573,29 @@ export abstract class Exchange {
|
|
|
571
573
|
async createOrder(params: any): Promise<Order> {
|
|
572
574
|
await this.initPromise;
|
|
573
575
|
try {
|
|
576
|
+
// Resolve outcome shorthand: extract marketId/outcomeId from outcome object
|
|
577
|
+
let marketId = params.marketId;
|
|
578
|
+
let outcomeId = params.outcomeId;
|
|
579
|
+
|
|
580
|
+
if (params.outcome) {
|
|
581
|
+
if (marketId !== undefined || outcomeId !== undefined) {
|
|
582
|
+
throw new Error(
|
|
583
|
+
"Cannot specify both 'outcome' and 'marketId'/'outcomeId'. Use one or the other."
|
|
584
|
+
);
|
|
585
|
+
}
|
|
586
|
+
const outcome: MarketOutcome = params.outcome;
|
|
587
|
+
if (!outcome.marketId) {
|
|
588
|
+
throw new Error(
|
|
589
|
+
"outcome.marketId is not set. Ensure the outcome comes from a fetched market."
|
|
590
|
+
);
|
|
591
|
+
}
|
|
592
|
+
marketId = outcome.marketId;
|
|
593
|
+
outcomeId = outcome.outcomeId;
|
|
594
|
+
}
|
|
595
|
+
|
|
574
596
|
const paramsDict: any = {
|
|
575
|
-
marketId
|
|
576
|
-
outcomeId
|
|
597
|
+
marketId,
|
|
598
|
+
outcomeId,
|
|
577
599
|
side: params.side,
|
|
578
600
|
type: params.type,
|
|
579
601
|
amount: params.amount,
|
package/pmxt/models.ts
CHANGED