pmxt-core 2.27.2 → 2.27.5

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.
@@ -3,24 +3,37 @@ import { SubscribedAddressSnapshot, SubscriptionOption } from './subscriber/base
3
3
  import { Balance, BuiltOrder, CandleInterval, CreateOrderParams, Order, OrderBook, Position, PriceCandle, Trade, UnifiedEvent, UnifiedMarket, UserTrade } from './types';
4
4
  import { ExecutionPriceResult } from './utils/math';
5
5
  export interface ApiEndpoint {
6
+ /** HTTP verb for the endpoint (e.g. GET, POST). */
6
7
  method: string;
8
+ /** URL path template, relative to the descriptor's baseUrl. */
7
9
  path: string;
10
+ /** Whether this endpoint requires authenticated credentials. */
8
11
  isPrivate?: boolean;
12
+ /** Identifier used to generate the implicit API method name. */
9
13
  operationId?: string;
10
14
  }
11
15
  export interface ApiDescriptor {
16
+ /** Base URL that all endpoint paths are resolved against. */
12
17
  baseUrl: string;
18
+ /** Map of endpoint key to endpoint definition used by the implicit API machinery. */
13
19
  endpoints: Record<string, ApiEndpoint>;
14
20
  }
15
21
  export interface ImplicitApiMethodInfo {
22
+ /** Generated method name exposed on the exchange instance. */
16
23
  name: string;
24
+ /** HTTP verb for the underlying endpoint. */
17
25
  method: string;
26
+ /** URL path template for the underlying endpoint. */
18
27
  path: string;
28
+ /** Whether the underlying endpoint requires authenticated credentials. */
19
29
  isPrivate: boolean;
20
30
  }
21
31
  export interface MarketFilterParams {
32
+ /** Maximum number of results to return */
22
33
  limit?: number;
34
+ /** Pagination offset — number of results to skip */
23
35
  offset?: number;
36
+ /** Sort order for results */
24
37
  sort?: 'volume' | 'liquidity' | 'newest';
25
38
  status?: 'active' | 'inactive' | 'closed' | 'all';
26
39
  searchIn?: 'title' | 'description' | 'both';
@@ -36,44 +49,70 @@ export interface MarketFetchParams extends MarketFilterParams {
36
49
  }
37
50
  export interface EventFetchParams {
38
51
  query?: string;
52
+ /** Maximum number of results to return */
39
53
  limit?: number;
54
+ /** Pagination offset — number of results to skip */
40
55
  offset?: number;
56
+ /** Sort order for results */
41
57
  sort?: 'volume' | 'liquidity' | 'newest';
42
58
  status?: 'active' | 'inactive' | 'closed' | 'all';
59
+ /** Where to search (default: 'title') */
43
60
  searchIn?: 'title' | 'description' | 'both';
44
61
  eventId?: string;
45
62
  slug?: string;
46
63
  }
64
+ /**
65
+ * Deprecated - use OHLCVParams or TradesParams instead. Resolution is optional for backward compatibility.
66
+ */
47
67
  export interface HistoryFilterParams {
48
68
  resolution?: CandleInterval;
69
+ /** Start of the time range */
49
70
  start?: Date;
71
+ /** End of the time range */
50
72
  end?: Date;
73
+ /** Maximum number of results to return */
51
74
  limit?: number;
52
75
  }
53
76
  export interface OHLCVParams {
54
77
  resolution: CandleInterval;
78
+ /** Start of the time range */
55
79
  start?: Date;
80
+ /** End of the time range */
56
81
  end?: Date;
82
+ /** Maximum number of results to return */
57
83
  limit?: number;
58
84
  }
85
+ /**
86
+ * Parameters for fetching trade history. No resolution parameter - trades are discrete events.
87
+ */
59
88
  export interface TradesParams {
89
+ /** Start of the time range */
60
90
  start?: Date;
91
+ /** End of the time range */
61
92
  end?: Date;
93
+ /** Maximum number of results to return */
62
94
  limit?: number;
63
95
  }
64
96
  export interface MyTradesParams {
65
97
  outcomeId?: string;
66
98
  marketId?: string;
99
+ /** Only return records after this date */
67
100
  since?: Date;
101
+ /** Only return records before this date */
68
102
  until?: Date;
103
+ /** Maximum number of results to return */
69
104
  limit?: number;
70
105
  cursor?: string;
71
106
  }
72
107
  export interface OrderHistoryParams {
73
108
  marketId?: string;
109
+ /** Only return records after this date */
74
110
  since?: Date;
111
+ /** Only return records before this date */
75
112
  until?: Date;
113
+ /** Maximum number of results to return */
76
114
  limit?: number;
115
+ /** Opaque pagination cursor from a previous response */
77
116
  cursor?: string;
78
117
  }
79
118
  export type MarketFilterCriteria = {
@@ -83,14 +122,17 @@ export type MarketFilterCriteria = {
83
122
  min?: number;
84
123
  max?: number;
85
124
  };
125
+ /** Filter by total (lifetime) volume range */
86
126
  volume?: {
87
127
  min?: number;
88
128
  max?: number;
89
129
  };
130
+ /** Filter by current liquidity range */
90
131
  liquidity?: {
91
132
  min?: number;
92
133
  max?: number;
93
134
  };
135
+ /** Filter by open interest range */
94
136
  openInterest?: {
95
137
  min?: number;
96
138
  max?: number;
@@ -117,6 +159,7 @@ export type EventFilterCriteria = {
117
159
  text?: string;
118
160
  searchIn?: ('title' | 'description' | 'category' | 'tags')[];
119
161
  category?: string;
162
+ /** Match events that have any of these tags */
120
163
  tags?: string[];
121
164
  marketCount?: {
122
165
  min?: number;
@@ -130,30 +173,55 @@ export type EventFilterCriteria = {
130
173
  export type EventFilterFunction = (event: UnifiedEvent) => boolean;
131
174
  export type ExchangeCapability = true | false | 'emulated';
132
175
  export interface ExchangeHas {
176
+ /** Whether this exchange supports fetching markets. */
133
177
  fetchMarkets: ExchangeCapability;
178
+ /** Whether this exchange supports fetching events. */
134
179
  fetchEvents: ExchangeCapability;
180
+ /** Whether this exchange supports fetching OHLCV candles. */
135
181
  fetchOHLCV: ExchangeCapability;
182
+ /** Whether this exchange supports fetching the order book. */
136
183
  fetchOrderBook: ExchangeCapability;
184
+ /** Whether this exchange supports fetching public trades. */
137
185
  fetchTrades: ExchangeCapability;
186
+ /** Whether this exchange supports creating orders. */
138
187
  createOrder: ExchangeCapability;
188
+ /** Whether this exchange supports cancelling orders. */
139
189
  cancelOrder: ExchangeCapability;
190
+ /** Whether this exchange supports fetching a single order by id. */
140
191
  fetchOrder: ExchangeCapability;
192
+ /** Whether this exchange supports fetching open orders. */
141
193
  fetchOpenOrders: ExchangeCapability;
194
+ /** Whether this exchange supports fetching account positions. */
142
195
  fetchPositions: ExchangeCapability;
196
+ /** Whether this exchange supports fetching account balances. */
143
197
  fetchBalance: ExchangeCapability;
198
+ /** Whether this exchange supports subscribing to an on-chain address for updates. */
144
199
  watchAddress: ExchangeCapability;
200
+ /** Whether this exchange supports unsubscribing from a watched address. */
145
201
  unwatchAddress: ExchangeCapability;
202
+ /** Whether this exchange supports streaming order book updates. */
146
203
  watchOrderBook: ExchangeCapability;
204
+ /** Whether this exchange supports streaming trade updates. */
147
205
  watchTrades: ExchangeCapability;
206
+ /** Whether this exchange supports fetching the authenticated user's trade history. */
148
207
  fetchMyTrades: ExchangeCapability;
208
+ /** Whether this exchange supports fetching closed orders. */
149
209
  fetchClosedOrders: ExchangeCapability;
210
+ /** Whether this exchange supports fetching all orders (open and closed). */
150
211
  fetchAllOrders: ExchangeCapability;
212
+ /** Whether this exchange supports building a signed order without submitting it. */
151
213
  buildOrder: ExchangeCapability;
214
+ /** Whether this exchange supports submitting a pre-built order. */
152
215
  submitOrder: ExchangeCapability;
153
216
  }
217
+ /**
218
+ * Optional authentication credentials for exchange operations.
219
+ */
154
220
  export interface ExchangeCredentials {
155
221
  apiKey?: string;
222
+ /** Standard API secret for HMAC-authenticated exchanges */
156
223
  apiSecret?: string;
224
+ /** Standard API passphrase for HMAC-authenticated exchanges */
157
225
  passphrase?: string;
158
226
  /** Metaculus: `Authorization: Token <apiToken>` for higher rate limits */
159
227
  apiToken?: string;
@@ -171,8 +239,11 @@ export interface ExchangeOptions {
171
239
  }
172
240
  /** Shape returned by fetchMarketsPaginated */
173
241
  export interface PaginatedMarketsResult {
242
+ /** The page of unified markets */
174
243
  data: UnifiedMarket[];
244
+ /** Total number of markets in the snapshot */
175
245
  total: number;
246
+ /** Cursor to pass to the next call, or undefined if this is the last page */
176
247
  nextCursor?: string;
177
248
  }
178
249
  export declare abstract class PredictionMarketExchange {
@@ -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-09T13:37:10.569Z
3
+ * Generated at: 2026-04-09T14:47:02.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-04-09T13:37:10.569Z
6
+ * Generated at: 2026-04-09T14:47:02.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-04-09T13:37:10.614Z
3
+ * Generated at: 2026-04-09T14:47:02.110Z
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-09T13:37:10.614Z
6
+ * Generated at: 2026-04-09T14:47:02.110Z
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-04-09T13:37:10.629Z
3
+ * Generated at: 2026-04-09T14:47:02.124Z
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-04-09T13:37:10.629Z
6
+ * Generated at: 2026-04-09T14:47:02.124Z
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-04-09T13:37:10.634Z
3
+ * Generated at: 2026-04-09T14:47:02.129Z
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-04-09T13:37:10.634Z
6
+ * Generated at: 2026-04-09T14:47:02.129Z
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-04-09T13:37:10.580Z
3
+ * Generated at: 2026-04-09T14:47:02.070Z
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-04-09T13:37:10.580Z
6
+ * Generated at: 2026-04-09T14:47:02.070Z
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-04-09T13:37:10.591Z
3
+ * Generated at: 2026-04-09T14:47:02.088Z
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-04-09T13:37:10.591Z
6
+ * Generated at: 2026-04-09T14:47:02.088Z
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-04-09T13:37:10.589Z
3
+ * Generated at: 2026-04-09T14:47:02.084Z
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-04-09T13:37:10.589Z
6
+ * Generated at: 2026-04-09T14:47:02.084Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.polymarketGammaSpec = {
@@ -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-04-09T13:37:10.620Z
3
+ * Generated at: 2026-04-09T14:47:02.118Z
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-04-09T13:37:10.620Z
6
+ * Generated at: 2026-04-09T14:47:02.118Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.probableApiSpec = {