pmxtjs 2.13.2 → 2.15.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.
@@ -17,10 +17,10 @@
17
17
  * console.log(markets[0].title);
18
18
  * ```
19
19
  */
20
- import { Exchange, Polymarket, Kalshi, Limitless } from "./pmxt/client.js";
20
+ import { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi } from "./pmxt/client.js";
21
21
  import { ServerManager } from "./pmxt/server-manager.js";
22
22
  import * as models from "./pmxt/models.js";
23
- export { Exchange, Polymarket, Kalshi, Limitless, PolymarketOptions } from "./pmxt/client.js";
23
+ export { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi, PolymarketOptions } from "./pmxt/client.js";
24
24
  export { ServerManager } from "./pmxt/server-manager.js";
25
25
  export { MarketList } from "./pmxt/models.js";
26
26
  export type * from "./pmxt/models.js";
@@ -31,7 +31,11 @@ declare const pmxt: {
31
31
  Exchange: typeof Exchange;
32
32
  Polymarket: typeof Polymarket;
33
33
  Kalshi: typeof Kalshi;
34
+ KalshiDemo: typeof KalshiDemo;
34
35
  Limitless: typeof Limitless;
36
+ Myriad: typeof Myriad;
37
+ Probable: typeof Probable;
38
+ Baozi: typeof Baozi;
35
39
  ServerManager: typeof ServerManager;
36
40
  stopServer: typeof stopServer;
37
41
  restartServer: typeof restartServer;
package/dist/esm/index.js CHANGED
@@ -17,10 +17,10 @@
17
17
  * console.log(markets[0].title);
18
18
  * ```
19
19
  */
20
- import { Exchange, Polymarket, Kalshi, Limitless } from "./pmxt/client.js";
20
+ import { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi } from "./pmxt/client.js";
21
21
  import { ServerManager } from "./pmxt/server-manager.js";
22
22
  import * as models from "./pmxt/models.js";
23
- export { Exchange, Polymarket, Kalshi, Limitless } from "./pmxt/client.js";
23
+ export { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi } from "./pmxt/client.js";
24
24
  export { ServerManager } from "./pmxt/server-manager.js";
25
25
  export { MarketList } from "./pmxt/models.js";
26
26
  const defaultManager = new ServerManager();
@@ -34,7 +34,11 @@ const pmxt = {
34
34
  Exchange,
35
35
  Polymarket,
36
36
  Kalshi,
37
+ KalshiDemo,
37
38
  Limitless,
39
+ Myriad,
40
+ Probable,
41
+ Baozi,
38
42
  ServerManager,
39
43
  stopServer,
40
44
  restartServer,
@@ -5,7 +5,7 @@
5
5
  * OpenAPI client, matching the Python API exactly.
6
6
  */
7
7
  import { DefaultApi, Configuration, ExchangeCredentials } from "../generated/src/index.js";
8
- import { UnifiedMarket, PriceCandle, OrderBook, Trade, Order, Position, Balance, UnifiedEvent, ExecutionPriceResult, MarketFilterCriteria, MarketFilterFunction, EventFilterCriteria, EventFilterFunction } from "./models.js";
8
+ import { UnifiedMarket, PriceCandle, OrderBook, Trade, UserTrade, Order, Position, Balance, UnifiedEvent, ExecutionPriceResult, PaginatedMarketsResult, MarketFilterCriteria, MarketFilterFunction, EventFilterCriteria, EventFilterFunction } from "./models.js";
9
9
  import { ServerManager } from "./server-manager.js";
10
10
  /**
11
11
  * Base exchange client options.
@@ -60,49 +60,22 @@ export declare abstract class Exchange {
60
60
  * ```
61
61
  */
62
62
  callApi(operationId: string, params?: Record<string, any>): Promise<any>;
63
- /**
64
- * Get active markets from the exchange.
65
- *
66
- * @param params - Optional filter parameters
67
- * @returns List of unified markets
68
- *
69
- * @example
70
- * ```typescript
71
- * const markets = await exchange.fetchMarkets({ limit: 20, sort: "volume" });
72
- * ```
73
- */
63
+ loadMarkets(reload?: boolean): Promise<Record<string, UnifiedMarket>>;
74
64
  fetchMarkets(params?: any): Promise<UnifiedMarket[]>;
75
- /**
76
- * Fetch a single market by lookup parameters.
77
- * Returns the first matching market or throws if not found.
78
- *
79
- * @param params - Lookup parameters (marketId, outcomeId, slug, eventId, query)
80
- * @returns A single unified market
81
- * @throws Error if no market matches
82
- *
83
- * @example
84
- * ```typescript
85
- * const market = await exchange.fetchMarket({ marketId: '663583' });
86
- * const market = await exchange.fetchMarket({ outcomeId: '10991849...' });
87
- * const market = await exchange.fetchMarket({ slug: 'will-trump-win' });
88
- * ```
89
- */
65
+ fetchMarketsPaginated(params?: any): Promise<PaginatedMarketsResult>;
66
+ fetchEvents(params?: any): Promise<UnifiedEvent[]>;
90
67
  fetchMarket(params?: any): Promise<UnifiedMarket>;
91
- /**
92
- * Fetch a single event by lookup parameters.
93
- * Returns the first matching event or throws if not found.
94
- *
95
- * @param params - Lookup parameters (eventId, slug, query)
96
- * @returns A single unified event
97
- * @throws Error if no event matches
98
- *
99
- * @example
100
- * ```typescript
101
- * const event = await exchange.fetchEvent({ eventId: 'TRUMP25DEC' });
102
- * const event = await exchange.fetchEvent({ slug: 'us-election' });
103
- * ```
104
- */
105
68
  fetchEvent(params?: any): Promise<UnifiedEvent>;
69
+ fetchOrderBook(id: string): Promise<OrderBook>;
70
+ cancelOrder(orderId: string): Promise<Order>;
71
+ fetchOrder(orderId: string): Promise<Order>;
72
+ fetchOpenOrders(marketId?: string): Promise<Order[]>;
73
+ fetchMyTrades(params?: any): Promise<UserTrade[]>;
74
+ fetchClosedOrders(params?: any): Promise<Order[]>;
75
+ fetchAllOrders(params?: any): Promise<Order[]>;
76
+ fetchPositions(): Promise<Position[]>;
77
+ fetchBalance(): Promise<Balance[]>;
78
+ close(): Promise<void>;
106
79
  /**
107
80
  * Get historical price candles.
108
81
  *
@@ -121,20 +94,6 @@ export declare abstract class Exchange {
121
94
  * ```
122
95
  */
123
96
  fetchOHLCV(outcomeId: string, params: any): Promise<PriceCandle[]>;
124
- /**
125
- * Get current order book for an outcome.
126
- *
127
- * @param outcomeId - Outcome ID
128
- * @returns Current order book
129
- *
130
- * @example
131
- * ```typescript
132
- * const orderBook = await exchange.fetchOrderBook(outcomeId);
133
- * console.log(`Best bid: ${orderBook.bids[0].price}`);
134
- * console.log(`Best ask: ${orderBook.asks[0].price}`);
135
- * ```
136
- */
137
- fetchOrderBook(outcomeId: string): Promise<OrderBook>;
138
97
  /**
139
98
  * Get trade history for an outcome.
140
99
  *
@@ -208,39 +167,6 @@ export declare abstract class Exchange {
208
167
  * ```
209
168
  */
210
169
  createOrder(params: any): Promise<Order>;
211
- /**
212
- * Cancel an open order.
213
- *
214
- * @param orderId - Order ID to cancel
215
- * @returns Cancelled order
216
- */
217
- cancelOrder(orderId: string): Promise<Order>;
218
- /**
219
- * Get details of a specific order.
220
- *
221
- * @param orderId - Order ID
222
- * @returns Order details
223
- */
224
- fetchOrder(orderId: string): Promise<Order>;
225
- /**
226
- * Get all open orders, optionally filtered by market.
227
- *
228
- * @param marketId - Optional market ID to filter by
229
- * @returns List of open orders
230
- */
231
- fetchOpenOrders(marketId?: string): Promise<Order[]>;
232
- /**
233
- * Get current positions across all markets.
234
- *
235
- * @returns List of positions
236
- */
237
- fetchPositions(): Promise<Position[]>;
238
- /**
239
- * Get account balance.
240
- *
241
- * @returns List of balances (by currency)
242
- */
243
- fetchBalance(): Promise<Balance[]>;
244
170
  /**
245
171
  * Calculate the average execution price for a given amount by walking the order book.
246
172
  * Uses the sidecar server for calculation to ensure consistency.
@@ -379,3 +305,87 @@ export declare class Kalshi extends Exchange {
379
305
  export declare class Limitless extends Exchange {
380
306
  constructor(options?: ExchangeOptions);
381
307
  }
308
+ /**
309
+ * Kalshi Demo exchange client (paper trading / sandbox environment).
310
+ *
311
+ * Uses Kalshi's demo environment — same API as Kalshi but against test accounts.
312
+ * Credentials are separate from production Kalshi credentials.
313
+ *
314
+ * @example
315
+ * ```typescript
316
+ * const kalshiDemo = new KalshiDemo({
317
+ * apiKey: process.env.KALSHI_DEMO_API_KEY,
318
+ * privateKey: process.env.KALSHI_DEMO_PRIVATE_KEY
319
+ * });
320
+ * const balance = await kalshiDemo.fetchBalance();
321
+ * ```
322
+ */
323
+ export declare class KalshiDemo extends Exchange {
324
+ constructor(options?: ExchangeOptions);
325
+ }
326
+ /**
327
+ * Myriad exchange client.
328
+ *
329
+ * AMM-based prediction market exchange. Requires an API key for trading.
330
+ * The `privateKey` field is used as the wallet address.
331
+ *
332
+ * @example
333
+ * ```typescript
334
+ * // Public data (no auth)
335
+ * const myriad = new Myriad();
336
+ * const markets = await myriad.fetchMarkets();
337
+ *
338
+ * // Trading (requires auth)
339
+ * const myriad = new Myriad({
340
+ * apiKey: process.env.MYRIAD_API_KEY,
341
+ * privateKey: process.env.MYRIAD_WALLET_ADDRESS
342
+ * });
343
+ * ```
344
+ */
345
+ export declare class Myriad extends Exchange {
346
+ constructor(options?: ExchangeOptions);
347
+ }
348
+ /**
349
+ * Probable exchange client.
350
+ *
351
+ * BSC-based CLOB exchange. Requires all four credential fields for trading.
352
+ *
353
+ * @example
354
+ * ```typescript
355
+ * // Public data (no auth)
356
+ * const probable = new Probable();
357
+ * const markets = await probable.fetchMarkets();
358
+ *
359
+ * // Trading (requires auth)
360
+ * const probable = new Probable({
361
+ * privateKey: process.env.PROBABLE_PRIVATE_KEY,
362
+ * apiKey: process.env.PROBABLE_API_KEY,
363
+ * apiSecret: process.env.PROBABLE_API_SECRET,
364
+ * passphrase: process.env.PROBABLE_PASSPHRASE
365
+ * });
366
+ * ```
367
+ */
368
+ export declare class Probable extends Exchange {
369
+ constructor(options?: ExchangeOptions);
370
+ }
371
+ /**
372
+ * Baozi exchange client.
373
+ *
374
+ * Solana-based on-chain pari-mutuel betting exchange.
375
+ * Requires a Solana private key for trading.
376
+ *
377
+ * @example
378
+ * ```typescript
379
+ * // Public data (no auth)
380
+ * const baozi = new Baozi();
381
+ * const markets = await baozi.fetchMarkets();
382
+ *
383
+ * // Trading (requires auth)
384
+ * const baozi = new Baozi({
385
+ * privateKey: process.env.BAOZI_PRIVATE_KEY
386
+ * });
387
+ * ```
388
+ */
389
+ export declare class Baozi extends Exchange {
390
+ constructor(options?: ExchangeOptions);
391
+ }