pmxtjs 2.47.0 → 2.48.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 (43) hide show
  1. package/dist/esm/generated/src/apis/DefaultApi.d.ts +38 -1
  2. package/dist/esm/generated/src/apis/DefaultApi.js +56 -1
  3. package/dist/esm/generated/src/models/EventFetchParams.d.ts +6 -0
  4. package/dist/esm/generated/src/models/EventFetchParams.js +2 -0
  5. package/dist/esm/generated/src/models/FetchSeries200Response.d.ts +46 -0
  6. package/dist/esm/generated/src/models/FetchSeries200Response.js +47 -0
  7. package/dist/esm/generated/src/models/UnifiedSeries.d.ts +95 -0
  8. package/dist/esm/generated/src/models/UnifiedSeries.js +66 -0
  9. package/dist/esm/generated/src/models/index.d.ts +2 -0
  10. package/dist/esm/generated/src/models/index.js +2 -0
  11. package/dist/esm/index.d.ts +1 -0
  12. package/dist/esm/pmxt/client.d.ts +2 -1
  13. package/dist/esm/pmxt/client.js +32 -0
  14. package/dist/esm/pmxt/models.d.ts +47 -0
  15. package/dist/generated/src/apis/DefaultApi.d.ts +38 -1
  16. package/dist/generated/src/apis/DefaultApi.js +56 -1
  17. package/dist/generated/src/models/EventFetchParams.d.ts +6 -0
  18. package/dist/generated/src/models/EventFetchParams.js +2 -0
  19. package/dist/generated/src/models/FetchSeries200Response.d.ts +46 -0
  20. package/dist/generated/src/models/FetchSeries200Response.js +54 -0
  21. package/dist/generated/src/models/UnifiedSeries.d.ts +95 -0
  22. package/dist/generated/src/models/UnifiedSeries.js +73 -0
  23. package/dist/generated/src/models/index.d.ts +2 -0
  24. package/dist/generated/src/models/index.js +2 -0
  25. package/dist/index.d.ts +1 -0
  26. package/dist/pmxt/client.d.ts +2 -1
  27. package/dist/pmxt/client.js +32 -0
  28. package/dist/pmxt/models.d.ts +47 -0
  29. package/generated/.openapi-generator/FILES +4 -0
  30. package/generated/docs/DefaultApi.md +76 -2
  31. package/generated/docs/EventFetchParams.md +2 -0
  32. package/generated/docs/FetchSeries200Response.md +38 -0
  33. package/generated/docs/UnifiedSeries.md +55 -0
  34. package/generated/package.json +1 -1
  35. package/generated/src/apis/DefaultApi.ts +78 -0
  36. package/generated/src/models/EventFetchParams.ts +8 -0
  37. package/generated/src/models/FetchSeries200Response.ts +96 -0
  38. package/generated/src/models/UnifiedSeries.ts +155 -0
  39. package/generated/src/models/index.ts +2 -0
  40. package/index.ts +1 -0
  41. package/package.json +2 -2
  42. package/pmxt/client.ts +32 -0
  43. package/pmxt/models.ts +59 -0
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { BaseResponse, BuildOrder200Response, BuildOrderRequest, CancelOrderRequest, CloseRequest, CompareMarketPrices200Response, CompareMarketPricesRequest, CreateOrder200Response, CreateOrderRequest, EventFilterCriteria, FetchArbitrage200Response, FetchBalance200Response, FetchEvent200Response, FetchEventMatches200Response, FetchEvents200Response, FetchEventsPaginated200Response, FetchMarket200Response, FetchMarketMatches200Response, FetchMarkets200Response, FetchMarketsPaginated200Response, FetchMatchedMarkets200Response, FetchMyTrades200Response, FetchOHLCV200Response, FetchOpenOrders200Response, FetchOrderBook200Response, FetchOrderBooks200Response, FetchOrderBooksRequest, FetchPositions200Response, FetchTrades200Response, FilterEventsRequest, FilterMarketsRequest, GetExecutionPrice200Response, GetExecutionPriceDetailed200Response, GetExecutionPriceDetailedRequest, GetExecutionPriceRequest, HealthCheck200Response, LoadMarkets200Response, LoadMarketsRequest, MarketFilterCriteria, SubmitOrderRequest, UnifiedEvent, UnifiedMarket } from '../models/index';
13
+ import type { BaseResponse, BuildOrder200Response, BuildOrderRequest, CancelOrderRequest, CloseRequest, CompareMarketPrices200Response, CompareMarketPricesRequest, CreateOrder200Response, CreateOrderRequest, EventFilterCriteria, FetchArbitrage200Response, FetchBalance200Response, FetchEvent200Response, FetchEventMatches200Response, FetchEvents200Response, FetchEventsPaginated200Response, FetchMarket200Response, FetchMarketMatches200Response, FetchMarkets200Response, FetchMarketsPaginated200Response, FetchMatchedMarkets200Response, FetchMyTrades200Response, FetchOHLCV200Response, FetchOpenOrders200Response, FetchOrderBook200Response, FetchOrderBooks200Response, FetchOrderBooksRequest, FetchPositions200Response, FetchSeries200Response, FetchTrades200Response, FilterEventsRequest, FilterMarketsRequest, GetExecutionPrice200Response, GetExecutionPriceDetailed200Response, GetExecutionPriceDetailedRequest, GetExecutionPriceRequest, HealthCheck200Response, LoadMarkets200Response, LoadMarketsRequest, MarketFilterCriteria, SubmitOrderRequest, UnifiedEvent, UnifiedMarket } from '../models/index';
14
14
  export interface BuildOrderOperationRequest {
15
15
  exchange: BuildOrderOperationExchangeEnum;
16
16
  buildOrderRequest?: BuildOrderRequest;
@@ -69,6 +69,7 @@ export interface FetchEventRequest {
69
69
  searchIn?: FetchEventSearchInEnum;
70
70
  eventId?: string;
71
71
  slug?: string;
72
+ series?: string;
72
73
  filter?: EventFilterCriteria;
73
74
  category?: string;
74
75
  tags?: Array<string>;
@@ -96,6 +97,7 @@ export interface FetchEventsRequest {
96
97
  searchIn?: FetchEventsSearchInEnum;
97
98
  eventId?: string;
98
99
  slug?: string;
100
+ series?: string;
99
101
  filter?: EventFilterCriteria;
100
102
  category?: string;
101
103
  tags?: Array<string>;
@@ -243,6 +245,9 @@ export interface FetchRelatedMarketsRequest {
243
245
  minDifference?: number;
244
246
  sort?: FetchRelatedMarketsSortEnum;
245
247
  }
248
+ export interface FetchSeriesRequest {
249
+ exchange: FetchSeriesExchangeEnum;
250
+ }
246
251
  export interface FetchTradesRequest {
247
252
  exchange: FetchTradesExchangeEnum;
248
253
  outcomeId: string;
@@ -552,6 +557,16 @@ export declare class DefaultApi extends runtime.BaseAPI {
552
557
  * Find Related Markets
553
558
  */
554
559
  fetchRelatedMarkets(requestParameters: FetchRelatedMarketsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CompareMarketPrices200Response>;
560
+ /**
561
+ * Fetch the recurring series (fourth tier above Event -> Market -> Outcome) that this venue exposes. Returns an empty array on venues without a series concept (Limitless, Smarkets, Probable, Metaculus, Baozi, Hyperliquid, SuiBets, Polymarket US). - `params.id` -> a single matching series with its events populated where supported. - no params -> the full list, typically without nested events for payload size.
562
+ * Fetch Series
563
+ */
564
+ fetchSeriesRaw(requestParameters: FetchSeriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FetchSeries200Response>>;
565
+ /**
566
+ * Fetch the recurring series (fourth tier above Event -> Market -> Outcome) that this venue exposes. Returns an empty array on venues without a series concept (Limitless, Smarkets, Probable, Metaculus, Baozi, Hyperliquid, SuiBets, Polymarket US). - `params.id` -> a single matching series with its events populated where supported. - no params -> the full list, typically without nested events for payload size.
567
+ * Fetch Series
568
+ */
569
+ fetchSeries(requestParameters: FetchSeriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FetchSeries200Response>;
555
570
  /**
556
571
  * Fetch raw trade history for a specific outcome.
557
572
  * Fetch Trades
@@ -1358,6 +1373,28 @@ export declare const FetchRelatedMarketsSortEnum: {
1358
1373
  readonly PriceDifference: "priceDifference";
1359
1374
  };
1360
1375
  export type FetchRelatedMarketsSortEnum = typeof FetchRelatedMarketsSortEnum[keyof typeof FetchRelatedMarketsSortEnum];
1376
+ /**
1377
+ * @export
1378
+ */
1379
+ export declare const FetchSeriesExchangeEnum: {
1380
+ readonly Polymarket: "polymarket";
1381
+ readonly Kalshi: "kalshi";
1382
+ readonly KalshiDemo: "kalshi-demo";
1383
+ readonly Limitless: "limitless";
1384
+ readonly Probable: "probable";
1385
+ readonly Baozi: "baozi";
1386
+ readonly Myriad: "myriad";
1387
+ readonly Opinion: "opinion";
1388
+ readonly Metaculus: "metaculus";
1389
+ readonly Smarkets: "smarkets";
1390
+ readonly PolymarketUs: "polymarket_us";
1391
+ readonly GeminiTitan: "gemini-titan";
1392
+ readonly Hyperliquid: "hyperliquid";
1393
+ readonly Suibets: "suibets";
1394
+ readonly Mock: "mock";
1395
+ readonly Router: "router";
1396
+ };
1397
+ export type FetchSeriesExchangeEnum = typeof FetchSeriesExchangeEnum[keyof typeof FetchSeriesExchangeEnum];
1361
1398
  /**
1362
1399
  * @export
1363
1400
  */
@@ -47,7 +47,7 @@ var __importStar = (this && this.__importStar) || (function () {
47
47
  })();
48
48
  Object.defineProperty(exports, "__esModule", { value: true });
49
49
  exports.FetchRelatedMarketsExchangeEnum = exports.FetchPositionsExchangeEnum = exports.FetchOrderBooksOperationExchangeEnum = exports.FetchOrderBookSideEnum = exports.FetchOrderBookExchangeEnum = exports.FetchOrderExchangeEnum = exports.FetchOpenOrdersExchangeEnum = exports.FetchOHLCVExchangeEnum = exports.FetchMyTradesExchangeEnum = exports.FetchMatchedPricesRelationsEnum = exports.FetchMatchedPricesExchangeEnum = exports.FetchMatchedMarketsRelationsEnum = exports.FetchMatchedMarketsExchangeEnum = exports.FetchMarketsPaginatedExchangeEnum = exports.FetchMarketsSearchInEnum = exports.FetchMarketsStatusEnum = exports.FetchMarketsSortEnum = exports.FetchMarketsExchangeEnum = exports.FetchMarketMatchesSortEnum = exports.FetchMarketMatchesRelationEnum = exports.FetchMarketMatchesExchangeEnum = exports.FetchMarketSearchInEnum = exports.FetchMarketStatusEnum = exports.FetchMarketSortEnum = exports.FetchMarketExchangeEnum = exports.FetchHedgesSortEnum = exports.FetchHedgesRelationEnum = exports.FetchHedgesExchangeEnum = exports.FetchEventsPaginatedExchangeEnum = exports.FetchEventsSearchInEnum = exports.FetchEventsStatusEnum = exports.FetchEventsSortEnum = exports.FetchEventsExchangeEnum = exports.FetchEventMatchesRelationEnum = exports.FetchEventMatchesExchangeEnum = exports.FetchEventSearchInEnum = exports.FetchEventStatusEnum = exports.FetchEventSortEnum = exports.FetchEventExchangeEnum = exports.FetchClosedOrdersExchangeEnum = exports.FetchBalanceExchangeEnum = exports.FetchArbitrageRelationsEnum = exports.FetchArbitrageExchangeEnum = exports.FetchAllOrdersExchangeEnum = exports.CreateOrderOperationExchangeEnum = exports.CompareMarketPricesOperationExchangeEnum = exports.CloseOperationExchangeEnum = exports.CancelOrderOperationExchangeEnum = exports.BuildOrderOperationExchangeEnum = exports.DefaultApi = void 0;
50
- exports.SubmitOrderOperationExchangeEnum = exports.LoadMarketsOperationExchangeEnum = exports.GetExecutionPriceDetailedOperationExchangeEnum = exports.GetExecutionPriceOperationExchangeEnum = exports.FilterMarketsOperationExchangeEnum = exports.FilterEventsOperationExchangeEnum = exports.FetchTradesExchangeEnum = exports.FetchRelatedMarketsSortEnum = exports.FetchRelatedMarketsRelationEnum = void 0;
50
+ exports.SubmitOrderOperationExchangeEnum = exports.LoadMarketsOperationExchangeEnum = exports.GetExecutionPriceDetailedOperationExchangeEnum = exports.GetExecutionPriceOperationExchangeEnum = exports.FilterMarketsOperationExchangeEnum = exports.FilterEventsOperationExchangeEnum = exports.FetchTradesExchangeEnum = exports.FetchSeriesExchangeEnum = exports.FetchRelatedMarketsSortEnum = exports.FetchRelatedMarketsRelationEnum = void 0;
51
51
  const runtime = __importStar(require("../runtime"));
52
52
  const index_1 = require("../models/index");
53
53
  /**
@@ -393,6 +393,9 @@ class DefaultApi extends runtime.BaseAPI {
393
393
  if (requestParameters['slug'] != null) {
394
394
  queryParameters['slug'] = requestParameters['slug'];
395
395
  }
396
+ if (requestParameters['series'] != null) {
397
+ queryParameters['series'] = requestParameters['series'];
398
+ }
396
399
  if (requestParameters['filter'] != null) {
397
400
  queryParameters['filter'] = requestParameters['filter'];
398
401
  }
@@ -512,6 +515,9 @@ class DefaultApi extends runtime.BaseAPI {
512
515
  if (requestParameters['slug'] != null) {
513
516
  queryParameters['slug'] = requestParameters['slug'];
514
517
  }
518
+ if (requestParameters['series'] != null) {
519
+ queryParameters['series'] = requestParameters['series'];
520
+ }
515
521
  if (requestParameters['filter'] != null) {
516
522
  queryParameters['filter'] = requestParameters['filter'];
517
523
  }
@@ -1279,6 +1285,34 @@ class DefaultApi extends runtime.BaseAPI {
1279
1285
  const response = await this.fetchRelatedMarketsRaw(requestParameters, initOverrides);
1280
1286
  return await response.value();
1281
1287
  }
1288
+ /**
1289
+ * Fetch the recurring series (fourth tier above Event -> Market -> Outcome) that this venue exposes. Returns an empty array on venues without a series concept (Limitless, Smarkets, Probable, Metaculus, Baozi, Hyperliquid, SuiBets, Polymarket US). - `params.id` -> a single matching series with its events populated where supported. - no params -> the full list, typically without nested events for payload size.
1290
+ * Fetch Series
1291
+ */
1292
+ async fetchSeriesRaw(requestParameters, initOverrides) {
1293
+ if (requestParameters['exchange'] == null) {
1294
+ throw new runtime.RequiredError('exchange', 'Required parameter "exchange" was null or undefined when calling fetchSeries().');
1295
+ }
1296
+ const queryParameters = {};
1297
+ const headerParameters = {};
1298
+ let urlPath = `/api/{exchange}/fetchSeries`;
1299
+ urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
1300
+ const response = await this.request({
1301
+ path: urlPath,
1302
+ method: 'GET',
1303
+ headers: headerParameters,
1304
+ query: queryParameters,
1305
+ }, initOverrides);
1306
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FetchSeries200ResponseFromJSON)(jsonValue));
1307
+ }
1308
+ /**
1309
+ * Fetch the recurring series (fourth tier above Event -> Market -> Outcome) that this venue exposes. Returns an empty array on venues without a series concept (Limitless, Smarkets, Probable, Metaculus, Baozi, Hyperliquid, SuiBets, Polymarket US). - `params.id` -> a single matching series with its events populated where supported. - no params -> the full list, typically without nested events for payload size.
1310
+ * Fetch Series
1311
+ */
1312
+ async fetchSeries(requestParameters, initOverrides) {
1313
+ const response = await this.fetchSeriesRaw(requestParameters, initOverrides);
1314
+ return await response.value();
1315
+ }
1282
1316
  /**
1283
1317
  * Fetch raw trade history for a specific outcome.
1284
1318
  * Fetch Trades
@@ -2202,6 +2236,27 @@ exports.FetchRelatedMarketsSortEnum = {
2202
2236
  Volume: 'volume',
2203
2237
  PriceDifference: 'priceDifference'
2204
2238
  };
2239
+ /**
2240
+ * @export
2241
+ */
2242
+ exports.FetchSeriesExchangeEnum = {
2243
+ Polymarket: 'polymarket',
2244
+ Kalshi: 'kalshi',
2245
+ KalshiDemo: 'kalshi-demo',
2246
+ Limitless: 'limitless',
2247
+ Probable: 'probable',
2248
+ Baozi: 'baozi',
2249
+ Myriad: 'myriad',
2250
+ Opinion: 'opinion',
2251
+ Metaculus: 'metaculus',
2252
+ Smarkets: 'smarkets',
2253
+ PolymarketUs: 'polymarket_us',
2254
+ GeminiTitan: 'gemini-titan',
2255
+ Hyperliquid: 'hyperliquid',
2256
+ Suibets: 'suibets',
2257
+ Mock: 'mock',
2258
+ Router: 'router'
2259
+ };
2205
2260
  /**
2206
2261
  * @export
2207
2262
  */
@@ -70,6 +70,12 @@ export interface EventFetchParams {
70
70
  * @memberof EventFetchParams
71
71
  */
72
72
  slug?: string;
73
+ /**
74
+ * Filter events by their parent series. Accepts the venue-native series id / ticker / slug (e.g. Kalshi `"KXATPMATCH"`, Polymarket `"wta"`). Passed through to the vendor where supported, otherwise applied to `sourceMetadata` after fetch.
75
+ * @type {string}
76
+ * @memberof EventFetchParams
77
+ */
78
+ series?: string;
73
79
  /**
74
80
  * Optional client-side filter applied after fetching
75
81
  * @type {EventFilterCriteria}
@@ -68,6 +68,7 @@ function EventFetchParamsFromJSONTyped(json, ignoreDiscriminator) {
68
68
  'searchIn': json['searchIn'] == null ? undefined : json['searchIn'],
69
69
  'eventId': json['eventId'] == null ? undefined : json['eventId'],
70
70
  'slug': json['slug'] == null ? undefined : json['slug'],
71
+ 'series': json['series'] == null ? undefined : json['series'],
71
72
  'filter': json['filter'] == null ? undefined : (0, EventFilterCriteria_1.EventFilterCriteriaFromJSON)(json['filter']),
72
73
  'category': json['category'] == null ? undefined : json['category'],
73
74
  'tags': json['tags'] == null ? undefined : json['tags'],
@@ -90,6 +91,7 @@ function EventFetchParamsToJSONTyped(value, ignoreDiscriminator = false) {
90
91
  'searchIn': value['searchIn'],
91
92
  'eventId': value['eventId'],
92
93
  'slug': value['slug'],
94
+ 'series': value['series'],
93
95
  'filter': (0, EventFilterCriteria_1.EventFilterCriteriaToJSON)(value['filter']),
94
96
  'category': value['category'],
95
97
  'tags': value['tags'],
@@ -0,0 +1,46 @@
1
+ /**
2
+ * PMXT Sidecar API
3
+ * A unified local sidecar API for prediction markets (Polymarket, Kalshi, Limitless). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
4
+ *
5
+ * The version of the OpenAPI document: 0.4.4
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { ErrorDetail } from './ErrorDetail';
13
+ import type { UnifiedSeries } from './UnifiedSeries';
14
+ /**
15
+ *
16
+ * @export
17
+ * @interface FetchSeries200Response
18
+ */
19
+ export interface FetchSeries200Response {
20
+ /**
21
+ *
22
+ * @type {boolean}
23
+ * @memberof FetchSeries200Response
24
+ */
25
+ success?: boolean;
26
+ /**
27
+ *
28
+ * @type {ErrorDetail}
29
+ * @memberof FetchSeries200Response
30
+ */
31
+ error?: ErrorDetail;
32
+ /**
33
+ *
34
+ * @type {Array<UnifiedSeries>}
35
+ * @memberof FetchSeries200Response
36
+ */
37
+ data?: Array<UnifiedSeries>;
38
+ }
39
+ /**
40
+ * Check if a given object implements the FetchSeries200Response interface.
41
+ */
42
+ export declare function instanceOfFetchSeries200Response(value: object): value is FetchSeries200Response;
43
+ export declare function FetchSeries200ResponseFromJSON(json: any): FetchSeries200Response;
44
+ export declare function FetchSeries200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FetchSeries200Response;
45
+ export declare function FetchSeries200ResponseToJSON(json: any): FetchSeries200Response;
46
+ export declare function FetchSeries200ResponseToJSONTyped(value?: FetchSeries200Response | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * PMXT Sidecar API
6
+ * A unified local sidecar API for prediction markets (Polymarket, Kalshi, Limitless). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
7
+ *
8
+ * The version of the OpenAPI document: 0.4.4
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfFetchSeries200Response = instanceOfFetchSeries200Response;
17
+ exports.FetchSeries200ResponseFromJSON = FetchSeries200ResponseFromJSON;
18
+ exports.FetchSeries200ResponseFromJSONTyped = FetchSeries200ResponseFromJSONTyped;
19
+ exports.FetchSeries200ResponseToJSON = FetchSeries200ResponseToJSON;
20
+ exports.FetchSeries200ResponseToJSONTyped = FetchSeries200ResponseToJSONTyped;
21
+ const ErrorDetail_1 = require("./ErrorDetail");
22
+ const UnifiedSeries_1 = require("./UnifiedSeries");
23
+ /**
24
+ * Check if a given object implements the FetchSeries200Response interface.
25
+ */
26
+ function instanceOfFetchSeries200Response(value) {
27
+ return true;
28
+ }
29
+ function FetchSeries200ResponseFromJSON(json) {
30
+ return FetchSeries200ResponseFromJSONTyped(json, false);
31
+ }
32
+ function FetchSeries200ResponseFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'success': json['success'] == null ? undefined : json['success'],
38
+ 'error': json['error'] == null ? undefined : (0, ErrorDetail_1.ErrorDetailFromJSON)(json['error']),
39
+ 'data': json['data'] == null ? undefined : (json['data'].map(UnifiedSeries_1.UnifiedSeriesFromJSON)),
40
+ };
41
+ }
42
+ function FetchSeries200ResponseToJSON(json) {
43
+ return FetchSeries200ResponseToJSONTyped(json, false);
44
+ }
45
+ function FetchSeries200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
46
+ if (value == null) {
47
+ return value;
48
+ }
49
+ return {
50
+ 'success': value['success'],
51
+ 'error': (0, ErrorDetail_1.ErrorDetailToJSON)(value['error']),
52
+ 'data': value['data'] == null ? undefined : (value['data'].map(UnifiedSeries_1.UnifiedSeriesToJSON)),
53
+ };
54
+ }
@@ -0,0 +1,95 @@
1
+ /**
2
+ * PMXT Sidecar API
3
+ * A unified local sidecar API for prediction markets (Polymarket, Kalshi, Limitless). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
4
+ *
5
+ * The version of the OpenAPI document: 0.4.4
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { UnifiedEvent } from './UnifiedEvent';
13
+ /**
14
+ * A recurring grouping of events on a venue — the fourth tier above Event -> Market -> Outcome. Examples: Kalshi `KXATPMATCH` (every ATP tennis match), Polymarket `wta` (every WTA match), Opinion's daily `collection`. Series only exists where the venue exposes a recurring-event concept; venues without one return an empty array from `fetchSeries`.
15
+ * @export
16
+ * @interface UnifiedSeries
17
+ */
18
+ export interface UnifiedSeries {
19
+ /**
20
+ * Stable venue-native series identifier (e.g. "KXATPMATCH" on Kalshi, "atp" on Polymarket Gamma, numeric Gamma id).
21
+ * @type {string}
22
+ * @memberof UnifiedSeries
23
+ */
24
+ id: string;
25
+ /**
26
+ * Venue-native ticker, when distinct from `id`.
27
+ * @type {string}
28
+ * @memberof UnifiedSeries
29
+ */
30
+ ticker?: string;
31
+ /**
32
+ * Venue-native slug.
33
+ * @type {string}
34
+ * @memberof UnifiedSeries
35
+ */
36
+ slug?: string;
37
+ /**
38
+ * Human-readable series title (e.g. "ATP Match Winner", "WTA").
39
+ * @type {string}
40
+ * @memberof UnifiedSeries
41
+ */
42
+ title: string;
43
+ /**
44
+ *
45
+ * @type {string}
46
+ * @memberof UnifiedSeries
47
+ */
48
+ description?: string | null;
49
+ /**
50
+ *
51
+ * @type {string}
52
+ * @memberof UnifiedSeries
53
+ */
54
+ recurrence?: string | null;
55
+ /**
56
+ * Child events. Populated when fetched by id; the list form usually omits this to keep payloads small.
57
+ * @type {Array<UnifiedEvent>}
58
+ * @memberof UnifiedSeries
59
+ */
60
+ events?: Array<UnifiedEvent>;
61
+ /**
62
+ *
63
+ * @type {string}
64
+ * @memberof UnifiedSeries
65
+ */
66
+ url?: string | null;
67
+ /**
68
+ *
69
+ * @type {string}
70
+ * @memberof UnifiedSeries
71
+ */
72
+ image?: string | null;
73
+ /**
74
+ * The exchange this series originates from. Populated by the Router.
75
+ * @type {string}
76
+ * @memberof UnifiedSeries
77
+ */
78
+ sourceExchange?: string;
79
+ /**
80
+ * Raw venue-specific fields not promoted to first-class columns.
81
+ * @type {{ [key: string]: any; }}
82
+ * @memberof UnifiedSeries
83
+ */
84
+ sourceMetadata?: {
85
+ [key: string]: any;
86
+ };
87
+ }
88
+ /**
89
+ * Check if a given object implements the UnifiedSeries interface.
90
+ */
91
+ export declare function instanceOfUnifiedSeries(value: object): value is UnifiedSeries;
92
+ export declare function UnifiedSeriesFromJSON(json: any): UnifiedSeries;
93
+ export declare function UnifiedSeriesFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnifiedSeries;
94
+ export declare function UnifiedSeriesToJSON(json: any): UnifiedSeries;
95
+ export declare function UnifiedSeriesToJSONTyped(value?: UnifiedSeries | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * PMXT Sidecar API
6
+ * A unified local sidecar API for prediction markets (Polymarket, Kalshi, Limitless). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
7
+ *
8
+ * The version of the OpenAPI document: 0.4.4
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfUnifiedSeries = instanceOfUnifiedSeries;
17
+ exports.UnifiedSeriesFromJSON = UnifiedSeriesFromJSON;
18
+ exports.UnifiedSeriesFromJSONTyped = UnifiedSeriesFromJSONTyped;
19
+ exports.UnifiedSeriesToJSON = UnifiedSeriesToJSON;
20
+ exports.UnifiedSeriesToJSONTyped = UnifiedSeriesToJSONTyped;
21
+ const UnifiedEvent_1 = require("./UnifiedEvent");
22
+ /**
23
+ * Check if a given object implements the UnifiedSeries interface.
24
+ */
25
+ function instanceOfUnifiedSeries(value) {
26
+ if (!('id' in value) || value['id'] === undefined)
27
+ return false;
28
+ if (!('title' in value) || value['title'] === undefined)
29
+ return false;
30
+ return true;
31
+ }
32
+ function UnifiedSeriesFromJSON(json) {
33
+ return UnifiedSeriesFromJSONTyped(json, false);
34
+ }
35
+ function UnifiedSeriesFromJSONTyped(json, ignoreDiscriminator) {
36
+ if (json == null) {
37
+ return json;
38
+ }
39
+ return {
40
+ 'id': json['id'],
41
+ 'ticker': json['ticker'] == null ? undefined : json['ticker'],
42
+ 'slug': json['slug'] == null ? undefined : json['slug'],
43
+ 'title': json['title'],
44
+ 'description': json['description'] == null ? undefined : json['description'],
45
+ 'recurrence': json['recurrence'] == null ? undefined : json['recurrence'],
46
+ 'events': json['events'] == null ? undefined : (json['events'].map(UnifiedEvent_1.UnifiedEventFromJSON)),
47
+ 'url': json['url'] == null ? undefined : json['url'],
48
+ 'image': json['image'] == null ? undefined : json['image'],
49
+ 'sourceExchange': json['sourceExchange'] == null ? undefined : json['sourceExchange'],
50
+ 'sourceMetadata': json['sourceMetadata'] == null ? undefined : json['sourceMetadata'],
51
+ };
52
+ }
53
+ function UnifiedSeriesToJSON(json) {
54
+ return UnifiedSeriesToJSONTyped(json, false);
55
+ }
56
+ function UnifiedSeriesToJSONTyped(value, ignoreDiscriminator = false) {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+ return {
61
+ 'id': value['id'],
62
+ 'ticker': value['ticker'],
63
+ 'slug': value['slug'],
64
+ 'title': value['title'],
65
+ 'description': value['description'],
66
+ 'recurrence': value['recurrence'],
67
+ 'events': value['events'] == null ? undefined : (value['events'].map(UnifiedEvent_1.UnifiedEventToJSON)),
68
+ 'url': value['url'],
69
+ 'image': value['image'],
70
+ 'sourceExchange': value['sourceExchange'],
71
+ 'sourceMetadata': value['sourceMetadata'],
72
+ };
73
+ }
@@ -58,6 +58,7 @@ export * from './FetchOrderBookParams';
58
58
  export * from './FetchOrderBooks200Response';
59
59
  export * from './FetchOrderBooksRequest';
60
60
  export * from './FetchPositions200Response';
61
+ export * from './FetchSeries200Response';
61
62
  export * from './FetchTrades200Response';
62
63
  export * from './FilterEventsRequest';
63
64
  export * from './FilterEventsRequestArgsInner';
@@ -99,4 +100,5 @@ export * from './Trade';
99
100
  export * from './TradesParams';
100
101
  export * from './UnifiedEvent';
101
102
  export * from './UnifiedMarket';
103
+ export * from './UnifiedSeries';
102
104
  export * from './UserTrade';
@@ -76,6 +76,7 @@ __exportStar(require("./FetchOrderBookParams"), exports);
76
76
  __exportStar(require("./FetchOrderBooks200Response"), exports);
77
77
  __exportStar(require("./FetchOrderBooksRequest"), exports);
78
78
  __exportStar(require("./FetchPositions200Response"), exports);
79
+ __exportStar(require("./FetchSeries200Response"), exports);
79
80
  __exportStar(require("./FetchTrades200Response"), exports);
80
81
  __exportStar(require("./FilterEventsRequest"), exports);
81
82
  __exportStar(require("./FilterEventsRequestArgsInner"), exports);
@@ -117,4 +118,5 @@ __exportStar(require("./Trade"), exports);
117
118
  __exportStar(require("./TradesParams"), exports);
118
119
  __exportStar(require("./UnifiedEvent"), exports);
119
120
  __exportStar(require("./UnifiedMarket"), exports);
121
+ __exportStar(require("./UnifiedSeries"), exports);
120
122
  __exportStar(require("./UserTrade"), exports);
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export { Router } from "./pmxt/router.js";
27
27
  export { ServerManager } from "./pmxt/server-manager.js";
28
28
  export { HOSTED_URL, LOCAL_URL, ENV, resolvePmxtBaseUrl } from "./pmxt/constants.js";
29
29
  export { MarketList } from "./pmxt/models.js";
30
+ export type { UnifiedSeries } from "./pmxt/models.js";
30
31
  export type * from "./pmxt/models.js";
31
32
  export * from "./pmxt/errors.js";
32
33
  declare function stopServer(): Promise<void>;
@@ -5,7 +5,7 @@
5
5
  * OpenAPI client, matching the Python API exactly.
6
6
  */
7
7
  import { Configuration, DefaultApi, ExchangeCredentials } from "../generated/src/index.js";
8
- import { Balance, BuiltOrder, CreateOrderParams, EventFetchParams, EventFilterCriteria, EventFilterFunction, ExecutionPriceResult, FetchOrderBookParams, MarketFetchParams, MarketFilterCriteria, MarketFilterFunction, MarketOutcome, MyTradesParams, Order, OrderBook, OrderHistoryParams, PaginatedMarketsResult, Position, PriceCandle, SubscribedAddressSnapshot, SubscriptionOption, Trade, UnifiedEvent, UnifiedMarket, UserTrade, FirehoseEvent } from "./models.js";
8
+ import { Balance, BuiltOrder, CreateOrderParams, EventFetchParams, EventFilterCriteria, EventFilterFunction, ExecutionPriceResult, FetchOrderBookParams, MarketFetchParams, MarketFilterCriteria, MarketFilterFunction, MarketOutcome, MyTradesParams, Order, OrderBook, OrderHistoryParams, PaginatedMarketsResult, Position, SeriesFetchParams, PriceCandle, SubscribedAddressSnapshot, SubscriptionOption, Trade, UnifiedEvent, UnifiedMarket, UnifiedSeries, UserTrade, FirehoseEvent } from "./models.js";
9
9
  import { ServerManager } from "./server-manager.js";
10
10
  /**
11
11
  * Base exchange client options.
@@ -178,6 +178,7 @@ export declare abstract class Exchange {
178
178
  fetchMarkets(params?: MarketFetchParams): Promise<UnifiedMarket[]>;
179
179
  fetchMarketsPaginated(params?: any): Promise<PaginatedMarketsResult>;
180
180
  fetchEvents(params?: EventFetchParams): Promise<UnifiedEvent[]>;
181
+ fetchSeries(params?: SeriesFetchParams): Promise<UnifiedSeries[]>;
181
182
  fetchMarket(params?: MarketFetchParams): Promise<UnifiedMarket>;
182
183
  fetchEvent(params?: EventFetchParams): Promise<UnifiedEvent>;
183
184
  fetchOrderBook(outcomeId: string | MarketOutcome, limit?: number, params?: FetchOrderBookParams): Promise<OrderBook | OrderBook[]>;
@@ -114,6 +114,10 @@ function convertEvent(raw) {
114
114
  const markets = models_js_1.MarketList.from((raw.markets || []).map(convertMarket));
115
115
  return { ...raw, markets };
116
116
  }
117
+ function convertSeries(raw) {
118
+ const events = Array.isArray(raw.events) ? raw.events.map(convertEvent) : undefined;
119
+ return { ...raw, ...(events !== undefined ? { events } : {}) };
120
+ }
117
121
  function convertSubscriptionSnapshot(raw) {
118
122
  return {
119
123
  ...raw,
@@ -695,6 +699,34 @@ class Exchange {
695
699
  throw new errors_js_1.PmxtError(`Failed to fetchEvents: ${error}`);
696
700
  }
697
701
  }
702
+ async fetchSeries(params) {
703
+ await this.initPromise;
704
+ try {
705
+ const args = [];
706
+ if (params !== undefined)
707
+ args.push(params);
708
+ const response = await this.fetchWithRetry(`${this.resolveBaseUrl()}/api/${this.exchangeName}/fetchSeries`, {
709
+ method: 'POST',
710
+ headers: { 'Content-Type': 'application/json', ...this.getAuthHeaders() },
711
+ body: JSON.stringify({ args, credentials: this.getCredentials() }),
712
+ });
713
+ if (!response.ok) {
714
+ const body = await response.json().catch(() => ({}));
715
+ if (body.error && typeof body.error === "object") {
716
+ throw (0, errors_js_1.fromServerError)(body.error);
717
+ }
718
+ throw new errors_js_1.PmxtError(body.error?.message || response.statusText);
719
+ }
720
+ const json = await response.json();
721
+ const data = this.handleResponse(json);
722
+ return data.map(convertSeries);
723
+ }
724
+ catch (error) {
725
+ if (error instanceof errors_js_1.PmxtError)
726
+ throw error;
727
+ throw new errors_js_1.PmxtError(`Failed to fetchSeries: ${error}`);
728
+ }
729
+ }
698
730
  async fetchMarket(params) {
699
731
  await this.initPromise;
700
732
  try {
@@ -371,6 +371,24 @@ export interface CreateOrderParams {
371
371
  }
372
372
  /** Alias matching the core MarketFetchParams name. */
373
373
  export type MarketFetchParams = MarketFilterParams;
374
+ /**
375
+ * Parameters for fetching series.
376
+ * Venues without a recurring-event concept return an empty array regardless of the filters.
377
+ */
378
+ export interface SeriesFetchParams {
379
+ /** Direct lookup by venue-native series id (e.g. "KXATPMATCH" on Kalshi, "atp" on Polymarket Gamma). When set, the result includes events where the venue supports it. */
380
+ id?: string;
381
+ /** Lookup by series slug (e.g. "wta", "nfl"). */
382
+ slug?: string;
383
+ /** Keyword search across series title / description. */
384
+ query?: string;
385
+ /** Filter by recurrence cadence ('daily', 'weekly', 'annual', ...). */
386
+ recurrence?: string;
387
+ /** Maximum number of results to return. */
388
+ limit?: number;
389
+ /** Pagination offset. */
390
+ offset?: number;
391
+ }
374
392
  /**
375
393
  * Parameters for fetching OHLCV candle data.
376
394
  */
@@ -475,6 +493,35 @@ export declare class MarketList extends Array<UnifiedMarket> {
475
493
  */
476
494
  match(query: string, searchIn?: ('title' | 'description' | 'category' | 'tags' | 'outcomes')[]): UnifiedMarket;
477
495
  }
496
+ /**
497
+ * A recurring grouping of events on a venue — the tier above Event.
498
+ * Examples: Kalshi "KXATPMATCH" (every ATP match), Polymarket "wta" (every WTA match).
499
+ * Venues without a recurring-event concept return an empty array from fetchSeries.
500
+ */
501
+ export interface UnifiedSeries {
502
+ /** Stable venue-native series identifier. */
503
+ id: string;
504
+ /** Venue-native ticker, when distinct from id. */
505
+ ticker?: string;
506
+ /** Venue-native slug. */
507
+ slug?: string;
508
+ /** Human-readable series title. */
509
+ title: string;
510
+ /** Long-form series description. */
511
+ description?: string | null;
512
+ /** Recurrence cadence the venue reports ('daily', 'weekly', 'annual', ...). */
513
+ recurrence?: string | null;
514
+ /** Child events. Populated when fetched by id; the list form usually omits this. */
515
+ events?: UnifiedEvent[];
516
+ /** Canonical venue URL for the series. */
517
+ url?: string | null;
518
+ /** Venue-hosted image. */
519
+ image?: string | null;
520
+ /** The exchange this series originates from. Populated by the Router. */
521
+ sourceExchange?: string;
522
+ /** Raw venue-specific fields not promoted to first-class columns. */
523
+ sourceMetadata?: Record<string, unknown>;
524
+ }
478
525
  /**
479
526
  * A grouped collection of related markets (e.g., "Who will be Fed Chair?" contains multiple candidate markets)
480
527
  */