pmxt-core 2.22.2 → 2.24.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.
Files changed (58) hide show
  1. package/dist/BaseExchange.d.ts +2 -0
  2. package/dist/exchanges/kalshi/api.d.ts +1 -1
  3. package/dist/exchanges/kalshi/api.js +1 -1
  4. package/dist/exchanges/limitless/api.d.ts +1 -1
  5. package/dist/exchanges/limitless/api.js +1 -1
  6. package/dist/exchanges/metaculus/api.d.ts +212 -0
  7. package/dist/exchanges/metaculus/api.js +418 -0
  8. package/dist/exchanges/metaculus/cancelOrder.d.ts +38 -0
  9. package/dist/exchanges/metaculus/cancelOrder.js +74 -0
  10. package/dist/exchanges/metaculus/createOrder.d.ts +107 -0
  11. package/dist/exchanges/metaculus/createOrder.js +272 -0
  12. package/dist/exchanges/metaculus/errors.d.ts +21 -0
  13. package/dist/exchanges/metaculus/errors.js +59 -0
  14. package/dist/exchanges/metaculus/fetchEvents.d.ts +5 -0
  15. package/dist/exchanges/metaculus/fetchEvents.js +187 -0
  16. package/dist/exchanges/metaculus/fetchMarkets.d.ts +6 -0
  17. package/dist/exchanges/metaculus/fetchMarkets.js +198 -0
  18. package/dist/exchanges/metaculus/index.d.ts +105 -0
  19. package/dist/exchanges/metaculus/index.js +166 -0
  20. package/dist/exchanges/metaculus/utils.d.ts +40 -0
  21. package/dist/exchanges/metaculus/utils.js +320 -0
  22. package/dist/exchanges/myriad/api.d.ts +1 -1
  23. package/dist/exchanges/myriad/api.js +1 -1
  24. package/dist/exchanges/opinion/api.d.ts +1 -1
  25. package/dist/exchanges/opinion/api.js +1 -1
  26. package/dist/exchanges/polymarket/api-clob.d.ts +1 -1
  27. package/dist/exchanges/polymarket/api-clob.js +1 -1
  28. package/dist/exchanges/polymarket/api-data.d.ts +1 -1
  29. package/dist/exchanges/polymarket/api-data.js +1 -1
  30. package/dist/exchanges/polymarket/api-gamma.d.ts +1 -1
  31. package/dist/exchanges/polymarket/api-gamma.js +1 -1
  32. package/dist/exchanges/polymarket/auth.js +42 -8
  33. package/dist/exchanges/polymarket/index.js +56 -19
  34. package/dist/exchanges/probable/api.d.ts +1 -1
  35. package/dist/exchanges/probable/api.js +1 -1
  36. package/dist/exchanges/probable/auth.js +5 -2
  37. package/dist/exchanges/smarkets/api.d.ts +8067 -0
  38. package/dist/exchanges/smarkets/api.js +10698 -0
  39. package/dist/exchanges/smarkets/auth.d.ts +56 -0
  40. package/dist/exchanges/smarkets/auth.js +105 -0
  41. package/dist/exchanges/smarkets/config.d.ts +41 -0
  42. package/dist/exchanges/smarkets/config.js +47 -0
  43. package/dist/exchanges/smarkets/errors.d.ts +31 -0
  44. package/dist/exchanges/smarkets/errors.js +186 -0
  45. package/dist/exchanges/smarkets/fetcher.d.ts +177 -0
  46. package/dist/exchanges/smarkets/fetcher.js +342 -0
  47. package/dist/exchanges/smarkets/index.d.ts +54 -0
  48. package/dist/exchanges/smarkets/index.js +285 -0
  49. package/dist/exchanges/smarkets/normalizer.d.ts +18 -0
  50. package/dist/exchanges/smarkets/normalizer.js +267 -0
  51. package/dist/exchanges/smarkets/price.d.ts +26 -0
  52. package/dist/exchanges/smarkets/price.js +44 -0
  53. package/dist/exchanges/smarkets/price.test.d.ts +1 -0
  54. package/dist/exchanges/smarkets/price.test.js +50 -0
  55. package/dist/index.d.ts +8 -0
  56. package/dist/index.js +9 -1
  57. package/dist/server/app.js +22 -3
  58. package/package.json +3 -3
@@ -155,6 +155,8 @@ export interface ExchangeCredentials {
155
155
  apiKey?: string;
156
156
  apiSecret?: string;
157
157
  passphrase?: string;
158
+ /** Metaculus: `Authorization: Token <apiToken>` for higher rate limits */
159
+ apiToken?: string;
158
160
  privateKey?: string;
159
161
  signatureType?: number | string;
160
162
  funderAddress?: string;
@@ -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-04-02T13:41:49.085Z
3
+ * Generated at: 2026-04-06T14:01:00.935Z
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-04-02T13:41:49.085Z
6
+ * Generated at: 2026-04-06T14:01:00.935Z
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-04-02T13:41:49.123Z
3
+ * Generated at: 2026-04-06T14:01:00.982Z
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-04-02T13:41:49.123Z
6
+ * Generated at: 2026-04-06T14:01:00.982Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.limitlessApiSpec = {
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Auto-generated from /home/harry-riddle/dev/github.com/0xharryriddle/pmxt/core/specs/metaculus/Metaculus.yaml
3
+ * Generated at: 2026-03-01T14:46:24.859Z
4
+ * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
+ */
6
+ export declare const metaculusApiSpec: {
7
+ openapi: string;
8
+ info: {
9
+ version: string;
10
+ title: string;
11
+ };
12
+ servers: {
13
+ url: string;
14
+ }[];
15
+ security: {
16
+ TokenAuth: never[];
17
+ }[];
18
+ components: {
19
+ securitySchemes: {
20
+ TokenAuth: {
21
+ type: string;
22
+ in: string;
23
+ name: string;
24
+ description: string;
25
+ };
26
+ };
27
+ };
28
+ tags: {
29
+ name: string;
30
+ }[];
31
+ paths: {
32
+ "/posts/": {
33
+ get: {
34
+ operationId: string;
35
+ summary: string;
36
+ tags: string[];
37
+ parameters: ({
38
+ in: string;
39
+ name: string;
40
+ schema: {
41
+ type: string;
42
+ items: {
43
+ type: string;
44
+ enum?: undefined;
45
+ };
46
+ format?: undefined;
47
+ enum?: undefined;
48
+ };
49
+ } | {
50
+ in: string;
51
+ name: string;
52
+ schema: {
53
+ type: string;
54
+ items: {
55
+ type: string;
56
+ enum: string[];
57
+ };
58
+ format?: undefined;
59
+ enum?: undefined;
60
+ };
61
+ } | {
62
+ in: string;
63
+ name: string;
64
+ schema: {
65
+ type: string;
66
+ items?: undefined;
67
+ format?: undefined;
68
+ enum?: undefined;
69
+ };
70
+ } | {
71
+ in: string;
72
+ name: string;
73
+ schema: {
74
+ type: string;
75
+ format: string;
76
+ items?: undefined;
77
+ enum?: undefined;
78
+ };
79
+ } | {
80
+ in: string;
81
+ name: string;
82
+ schema: {
83
+ type: string;
84
+ enum: string[];
85
+ items?: undefined;
86
+ format?: undefined;
87
+ };
88
+ })[];
89
+ };
90
+ };
91
+ "/posts/{postId}/": {
92
+ get: {
93
+ operationId: string;
94
+ summary: string;
95
+ tags: string[];
96
+ parameters: {
97
+ name: string;
98
+ in: string;
99
+ required: boolean;
100
+ schema: {
101
+ type: string;
102
+ };
103
+ }[];
104
+ };
105
+ };
106
+ "/posts/{postId}/download-data/": {
107
+ get: {
108
+ summary: string;
109
+ tags: string[];
110
+ parameters: ({
111
+ name: string;
112
+ in: string;
113
+ required: boolean;
114
+ schema: {
115
+ type: string;
116
+ items?: undefined;
117
+ };
118
+ } | {
119
+ name: string;
120
+ in: string;
121
+ required: boolean;
122
+ schema: {
123
+ type: string;
124
+ items: {
125
+ type: string;
126
+ enum: string[];
127
+ };
128
+ };
129
+ } | {
130
+ name: string;
131
+ in: string;
132
+ required: boolean;
133
+ schema: {
134
+ type: string;
135
+ items: {
136
+ type: string;
137
+ enum?: undefined;
138
+ };
139
+ };
140
+ })[];
141
+ };
142
+ };
143
+ "/projects/{projectId}/download-data/": {
144
+ get: {
145
+ summary: string;
146
+ tags: string[];
147
+ parameters: {
148
+ name: string;
149
+ in: string;
150
+ required: boolean;
151
+ schema: {
152
+ type: string;
153
+ };
154
+ }[];
155
+ };
156
+ };
157
+ "/questions/forecast/": {
158
+ post: {
159
+ operationId: string;
160
+ summary: string;
161
+ tags: string[];
162
+ };
163
+ };
164
+ "/questions/withdraw/": {
165
+ post: {
166
+ operationId: string;
167
+ summary: string;
168
+ tags: string[];
169
+ };
170
+ };
171
+ "/comments/create/": {
172
+ post: {
173
+ summary: string;
174
+ tags: string[];
175
+ };
176
+ };
177
+ "/comments/": {
178
+ get: {
179
+ summary: string;
180
+ tags: string[];
181
+ parameters: ({
182
+ name: string;
183
+ in: string;
184
+ required: boolean;
185
+ schema: {
186
+ type: string;
187
+ default?: undefined;
188
+ enum?: undefined;
189
+ };
190
+ } | {
191
+ name: string;
192
+ in: string;
193
+ required: boolean;
194
+ schema: {
195
+ type: string;
196
+ default: boolean;
197
+ enum?: undefined;
198
+ };
199
+ } | {
200
+ name: string;
201
+ in: string;
202
+ required: boolean;
203
+ schema: {
204
+ type: string;
205
+ enum: string[];
206
+ default?: undefined;
207
+ };
208
+ })[];
209
+ };
210
+ };
211
+ };
212
+ };
@@ -0,0 +1,418 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.metaculusApiSpec = void 0;
4
+ /**
5
+ * Auto-generated from /home/harry-riddle/dev/github.com/0xharryriddle/pmxt/core/specs/metaculus/Metaculus.yaml
6
+ * Generated at: 2026-03-01T14:46:24.859Z
7
+ * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
+ */
9
+ exports.metaculusApiSpec = {
10
+ "openapi": "3.0.0",
11
+ "info": {
12
+ "version": "2.0.0",
13
+ "title": "Metaculus API"
14
+ },
15
+ "servers": [
16
+ {
17
+ "url": "https://www.metaculus.com/api"
18
+ }
19
+ ],
20
+ "security": [
21
+ {
22
+ "TokenAuth": []
23
+ }
24
+ ],
25
+ "components": {
26
+ "securitySchemes": {
27
+ "TokenAuth": {
28
+ "type": "apiKey",
29
+ "in": "header",
30
+ "name": "Authorization",
31
+ "description": "Token-based authentication. Use format: `Token <input token>`"
32
+ }
33
+ }
34
+ },
35
+ "tags": [
36
+ {
37
+ "name": "Feed"
38
+ },
39
+ {
40
+ "name": "Questions & Forecasts"
41
+ },
42
+ {
43
+ "name": "Comments"
44
+ },
45
+ {
46
+ "name": "Utilities & Data"
47
+ }
48
+ ],
49
+ "paths": {
50
+ "/posts/": {
51
+ "get": {
52
+ "operationId": "GetPosts",
53
+ "summary": "Retrieve posts feed",
54
+ "tags": [
55
+ "Feed"
56
+ ],
57
+ "parameters": [
58
+ {
59
+ "in": "query",
60
+ "name": "tournaments",
61
+ "schema": {
62
+ "type": "array",
63
+ "items": {
64
+ "type": "string"
65
+ }
66
+ }
67
+ },
68
+ {
69
+ "in": "query",
70
+ "name": "statuses",
71
+ "schema": {
72
+ "type": "array",
73
+ "items": {
74
+ "type": "string",
75
+ "enum": [
76
+ "upcoming",
77
+ "closed",
78
+ "resolved",
79
+ "open"
80
+ ]
81
+ }
82
+ }
83
+ },
84
+ {
85
+ "in": "query",
86
+ "name": "forecaster_id",
87
+ "schema": {
88
+ "type": "integer"
89
+ }
90
+ },
91
+ {
92
+ "in": "query",
93
+ "name": "with_cp",
94
+ "schema": {
95
+ "type": "boolean"
96
+ }
97
+ },
98
+ {
99
+ "in": "query",
100
+ "name": "not_forecaster_id",
101
+ "schema": {
102
+ "type": "integer"
103
+ }
104
+ },
105
+ {
106
+ "in": "query",
107
+ "name": "open_time__gt",
108
+ "schema": {
109
+ "type": "string",
110
+ "format": "date-time"
111
+ }
112
+ },
113
+ {
114
+ "in": "query",
115
+ "name": "published_at__gt",
116
+ "schema": {
117
+ "type": "string",
118
+ "format": "date-time"
119
+ }
120
+ },
121
+ {
122
+ "in": "query",
123
+ "name": "scheduled_resolve_time__gt",
124
+ "schema": {
125
+ "type": "string",
126
+ "format": "date-time"
127
+ }
128
+ },
129
+ {
130
+ "in": "query",
131
+ "name": "forecast_type",
132
+ "schema": {
133
+ "type": "array",
134
+ "items": {
135
+ "type": "string",
136
+ "enum": [
137
+ "binary",
138
+ "numeric",
139
+ "date",
140
+ "multiple_choice",
141
+ "conditional",
142
+ "group_of_questions",
143
+ "notebook"
144
+ ]
145
+ }
146
+ }
147
+ },
148
+ {
149
+ "in": "query",
150
+ "name": "order_by",
151
+ "schema": {
152
+ "type": "string",
153
+ "enum": [
154
+ "published_at",
155
+ "open_time",
156
+ "vote_score",
157
+ "comment_count",
158
+ "forecasts_count",
159
+ "scheduled_close_time",
160
+ "scheduled_resolve_time",
161
+ "user_last_forecasts_date",
162
+ "unread_comment_count",
163
+ "weekly_movement",
164
+ "divergence",
165
+ "hotness",
166
+ "score"
167
+ ]
168
+ }
169
+ }
170
+ ]
171
+ }
172
+ },
173
+ "/posts/{postId}/": {
174
+ "get": {
175
+ "operationId": "GetPost",
176
+ "summary": "Retrieve post details",
177
+ "tags": [
178
+ "Feed"
179
+ ],
180
+ "parameters": [
181
+ {
182
+ "name": "postId",
183
+ "in": "path",
184
+ "required": true,
185
+ "schema": {
186
+ "type": "integer"
187
+ }
188
+ }
189
+ ]
190
+ }
191
+ },
192
+ "/posts/{postId}/download-data/": {
193
+ "get": {
194
+ "summary": "Download data for a Question. Will open a download prompt in the browser. The return is a Zip file of CSVs.",
195
+ "tags": [
196
+ "Utilities & Data"
197
+ ],
198
+ "parameters": [
199
+ {
200
+ "name": "postId",
201
+ "in": "path",
202
+ "required": true,
203
+ "schema": {
204
+ "type": "integer"
205
+ }
206
+ },
207
+ {
208
+ "name": "sub_question",
209
+ "in": "query",
210
+ "required": false,
211
+ "schema": {
212
+ "type": "integer"
213
+ }
214
+ },
215
+ {
216
+ "name": "aggregation_methods",
217
+ "in": "query",
218
+ "required": false,
219
+ "schema": {
220
+ "type": "array",
221
+ "items": {
222
+ "type": "string",
223
+ "enum": [
224
+ "recency_weighted",
225
+ "unweighted",
226
+ "metaculus_prediction",
227
+ "single_aggregation"
228
+ ]
229
+ }
230
+ }
231
+ },
232
+ {
233
+ "name": "include_bots",
234
+ "in": "query",
235
+ "required": false,
236
+ "schema": {
237
+ "type": "boolean"
238
+ }
239
+ },
240
+ {
241
+ "name": "user_ids",
242
+ "in": "query",
243
+ "required": false,
244
+ "schema": {
245
+ "type": "array",
246
+ "items": {
247
+ "type": "string"
248
+ }
249
+ }
250
+ },
251
+ {
252
+ "name": "minimize",
253
+ "in": "query",
254
+ "required": false,
255
+ "schema": {
256
+ "type": "boolean"
257
+ }
258
+ },
259
+ {
260
+ "name": "include_comments",
261
+ "in": "query",
262
+ "required": false,
263
+ "schema": {
264
+ "type": "boolean"
265
+ }
266
+ },
267
+ {
268
+ "name": "include_scores",
269
+ "in": "query",
270
+ "required": false,
271
+ "schema": {
272
+ "type": "boolean"
273
+ }
274
+ }
275
+ ]
276
+ }
277
+ },
278
+ "/projects/{projectId}/download-data/": {
279
+ "get": {
280
+ "summary": "Download data for a whole Project. Will open a download prompt in the browser. The return is a Zip file of CSVs. Only available to site admins and Whitelisted users.",
281
+ "tags": [
282
+ "Utilities & Data"
283
+ ],
284
+ "parameters": [
285
+ {
286
+ "name": "projectId",
287
+ "in": "path",
288
+ "required": true,
289
+ "schema": {
290
+ "type": "integer"
291
+ }
292
+ },
293
+ {
294
+ "name": "include_comments",
295
+ "in": "query",
296
+ "required": false,
297
+ "schema": {
298
+ "type": "boolean"
299
+ }
300
+ },
301
+ {
302
+ "name": "include_scores",
303
+ "in": "query",
304
+ "required": false,
305
+ "schema": {
306
+ "type": "boolean"
307
+ }
308
+ }
309
+ ]
310
+ }
311
+ },
312
+ "/questions/forecast/": {
313
+ "post": {
314
+ "operationId": "SubmitForecast",
315
+ "summary": "Submit forecasts for questions",
316
+ "tags": [
317
+ "Questions & Forecasts"
318
+ ]
319
+ }
320
+ },
321
+ "/questions/withdraw/": {
322
+ "post": {
323
+ "operationId": "WithdrawForecast",
324
+ "summary": "Withdraw current forecasts for questions",
325
+ "tags": [
326
+ "Questions & Forecasts"
327
+ ]
328
+ }
329
+ },
330
+ "/comments/create/": {
331
+ "post": {
332
+ "summary": "Create a new comment",
333
+ "tags": [
334
+ "Comments"
335
+ ]
336
+ }
337
+ },
338
+ "/comments/": {
339
+ "get": {
340
+ "summary": "Retrieve comments",
341
+ "tags": [
342
+ "Comments"
343
+ ],
344
+ "parameters": [
345
+ {
346
+ "name": "post",
347
+ "in": "query",
348
+ "required": false,
349
+ "schema": {
350
+ "type": "integer"
351
+ }
352
+ },
353
+ {
354
+ "name": "author",
355
+ "in": "query",
356
+ "required": false,
357
+ "schema": {
358
+ "type": "integer"
359
+ }
360
+ },
361
+ {
362
+ "name": "limit",
363
+ "in": "query",
364
+ "required": false,
365
+ "schema": {
366
+ "type": "integer"
367
+ }
368
+ },
369
+ {
370
+ "name": "offset",
371
+ "in": "query",
372
+ "required": false,
373
+ "schema": {
374
+ "type": "integer"
375
+ }
376
+ },
377
+ {
378
+ "name": "is_private",
379
+ "in": "query",
380
+ "required": false,
381
+ "schema": {
382
+ "type": "boolean",
383
+ "default": false
384
+ }
385
+ },
386
+ {
387
+ "name": "use_root_comments_pagination",
388
+ "in": "query",
389
+ "required": false,
390
+ "schema": {
391
+ "type": "boolean"
392
+ }
393
+ },
394
+ {
395
+ "name": "sort",
396
+ "in": "query",
397
+ "required": false,
398
+ "schema": {
399
+ "type": "string",
400
+ "enum": [
401
+ "-created_at",
402
+ "created_at"
403
+ ]
404
+ }
405
+ },
406
+ {
407
+ "name": "focus_comment_id",
408
+ "in": "query",
409
+ "required": false,
410
+ "schema": {
411
+ "type": "integer"
412
+ }
413
+ }
414
+ ]
415
+ }
416
+ }
417
+ }
418
+ };