pmxtjs 2.46.14 → 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.
- package/dist/esm/generated/src/apis/DefaultApi.d.ts +38 -1
- package/dist/esm/generated/src/apis/DefaultApi.js +56 -1
- package/dist/esm/generated/src/models/EventFetchParams.d.ts +6 -0
- package/dist/esm/generated/src/models/EventFetchParams.js +2 -0
- package/dist/esm/generated/src/models/FetchSeries200Response.d.ts +46 -0
- package/dist/esm/generated/src/models/FetchSeries200Response.js +47 -0
- package/dist/esm/generated/src/models/UnifiedEvent.d.ts +8 -0
- package/dist/esm/generated/src/models/UnifiedEvent.js +2 -0
- package/dist/esm/generated/src/models/UnifiedMarket.d.ts +8 -0
- package/dist/esm/generated/src/models/UnifiedMarket.js +2 -0
- package/dist/esm/generated/src/models/UnifiedSeries.d.ts +95 -0
- package/dist/esm/generated/src/models/UnifiedSeries.js +66 -0
- package/dist/esm/generated/src/models/index.d.ts +2 -0
- package/dist/esm/generated/src/models/index.js +2 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/pmxt/client.d.ts +2 -1
- package/dist/esm/pmxt/client.js +47 -18
- package/dist/esm/pmxt/models.d.ts +47 -0
- package/dist/generated/src/apis/DefaultApi.d.ts +38 -1
- package/dist/generated/src/apis/DefaultApi.js +56 -1
- package/dist/generated/src/models/EventFetchParams.d.ts +6 -0
- package/dist/generated/src/models/EventFetchParams.js +2 -0
- package/dist/generated/src/models/FetchSeries200Response.d.ts +46 -0
- package/dist/generated/src/models/FetchSeries200Response.js +54 -0
- package/dist/generated/src/models/UnifiedEvent.d.ts +8 -0
- package/dist/generated/src/models/UnifiedEvent.js +2 -0
- package/dist/generated/src/models/UnifiedMarket.d.ts +8 -0
- package/dist/generated/src/models/UnifiedMarket.js +2 -0
- package/dist/generated/src/models/UnifiedSeries.d.ts +95 -0
- package/dist/generated/src/models/UnifiedSeries.js +73 -0
- package/dist/generated/src/models/index.d.ts +2 -0
- package/dist/generated/src/models/index.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/pmxt/client.d.ts +2 -1
- package/dist/pmxt/client.js +47 -18
- package/dist/pmxt/models.d.ts +47 -0
- package/generated/.openapi-generator/FILES +4 -0
- package/generated/docs/DefaultApi.md +76 -2
- package/generated/docs/EventFetchParams.md +2 -0
- package/generated/docs/FetchSeries200Response.md +38 -0
- package/generated/docs/UnifiedEvent.md +2 -0
- package/generated/docs/UnifiedMarket.md +2 -0
- package/generated/docs/UnifiedSeries.md +55 -0
- package/generated/package.json +1 -1
- package/generated/src/apis/DefaultApi.ts +78 -0
- package/generated/src/models/EventFetchParams.ts +8 -0
- package/generated/src/models/FetchSeries200Response.ts +96 -0
- package/generated/src/models/UnifiedEvent.ts +8 -0
- package/generated/src/models/UnifiedMarket.ts +8 -0
- package/generated/src/models/UnifiedSeries.ts +155 -0
- package/generated/src/models/index.ts +2 -0
- package/index.ts +1 -0
- package/package.json +2 -2
- package/pmxt/client.ts +47 -23
- package/pmxt/models.ts +59 -0
package/dist/esm/pmxt/client.js
CHANGED
|
@@ -111,6 +111,10 @@ function convertEvent(raw) {
|
|
|
111
111
|
const markets = MarketList.from((raw.markets || []).map(convertMarket));
|
|
112
112
|
return { ...raw, markets };
|
|
113
113
|
}
|
|
114
|
+
function convertSeries(raw) {
|
|
115
|
+
const events = Array.isArray(raw.events) ? raw.events.map(convertEvent) : undefined;
|
|
116
|
+
return { ...raw, ...(events !== undefined ? { events } : {}) };
|
|
117
|
+
}
|
|
114
118
|
function convertSubscriptionSnapshot(raw) {
|
|
115
119
|
return {
|
|
116
120
|
...raw,
|
|
@@ -692,6 +696,34 @@ export class Exchange {
|
|
|
692
696
|
throw new PmxtError(`Failed to fetchEvents: ${error}`);
|
|
693
697
|
}
|
|
694
698
|
}
|
|
699
|
+
async fetchSeries(params) {
|
|
700
|
+
await this.initPromise;
|
|
701
|
+
try {
|
|
702
|
+
const args = [];
|
|
703
|
+
if (params !== undefined)
|
|
704
|
+
args.push(params);
|
|
705
|
+
const response = await this.fetchWithRetry(`${this.resolveBaseUrl()}/api/${this.exchangeName}/fetchSeries`, {
|
|
706
|
+
method: 'POST',
|
|
707
|
+
headers: { 'Content-Type': 'application/json', ...this.getAuthHeaders() },
|
|
708
|
+
body: JSON.stringify({ args, credentials: this.getCredentials() }),
|
|
709
|
+
});
|
|
710
|
+
if (!response.ok) {
|
|
711
|
+
const body = await response.json().catch(() => ({}));
|
|
712
|
+
if (body.error && typeof body.error === "object") {
|
|
713
|
+
throw fromServerError(body.error);
|
|
714
|
+
}
|
|
715
|
+
throw new PmxtError(body.error?.message || response.statusText);
|
|
716
|
+
}
|
|
717
|
+
const json = await response.json();
|
|
718
|
+
const data = this.handleResponse(json);
|
|
719
|
+
return data.map(convertSeries);
|
|
720
|
+
}
|
|
721
|
+
catch (error) {
|
|
722
|
+
if (error instanceof PmxtError)
|
|
723
|
+
throw error;
|
|
724
|
+
throw new PmxtError(`Failed to fetchSeries: ${error}`);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
695
727
|
async fetchMarket(params) {
|
|
696
728
|
await this.initPromise;
|
|
697
729
|
try {
|
|
@@ -1067,28 +1099,25 @@ export class Exchange {
|
|
|
1067
1099
|
}
|
|
1068
1100
|
async unwatchOrderBook(outcomeId) {
|
|
1069
1101
|
await this.initPromise;
|
|
1070
|
-
const resolvedOutcomeId = resolveOutcomeId(outcomeId);
|
|
1071
|
-
const args = [resolvedOutcomeId];
|
|
1072
1102
|
try {
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
await this.sendWsMessage(ws, {
|
|
1080
|
-
id: requestId,
|
|
1081
|
-
action: "unsubscribe",
|
|
1082
|
-
exchange: this.exchangeName,
|
|
1083
|
-
method: "unwatchOrderBook",
|
|
1084
|
-
args,
|
|
1103
|
+
const args = [];
|
|
1104
|
+
args.push(resolveOutcomeId(outcomeId));
|
|
1105
|
+
const response = await this.fetchWithRetry(`${this.resolveBaseUrl()}/api/${this.exchangeName}/unwatchOrderBook`, {
|
|
1106
|
+
method: 'POST',
|
|
1107
|
+
headers: { 'Content-Type': 'application/json', ...this.getAuthHeaders() },
|
|
1108
|
+
body: JSON.stringify({ args, credentials: this.getCredentials() }),
|
|
1085
1109
|
});
|
|
1086
|
-
|
|
1110
|
+
if (!response.ok) {
|
|
1111
|
+
const body = await response.json().catch(() => ({}));
|
|
1112
|
+
if (body.error && typeof body.error === "object") {
|
|
1113
|
+
throw fromServerError(body.error);
|
|
1114
|
+
}
|
|
1115
|
+
throw new PmxtError(body.error?.message || response.statusText);
|
|
1116
|
+
}
|
|
1117
|
+
const json = await response.json();
|
|
1118
|
+
this.handleResponse(json);
|
|
1087
1119
|
}
|
|
1088
1120
|
catch (error) {
|
|
1089
|
-
if (this.isWsTransportUnavailableError(error)) {
|
|
1090
|
-
throw this.wsTransportUnavailableError("unwatchOrderBook");
|
|
1091
|
-
}
|
|
1092
1121
|
if (error instanceof PmxtError)
|
|
1093
1122
|
throw error;
|
|
1094
1123
|
throw new PmxtError(`Failed to unwatchOrderBook: ${error}`);
|
|
@@ -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
|
*/
|
|
@@ -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
|
+
}
|
|
@@ -82,6 +82,14 @@ export interface UnifiedEvent {
|
|
|
82
82
|
* @memberof UnifiedEvent
|
|
83
83
|
*/
|
|
84
84
|
tags?: Array<string>;
|
|
85
|
+
/**
|
|
86
|
+
* Raw venue-specific metadata not captured by first-class fields (e.g. Kalshi series_ticker / series_title, Polymarket series). Passed through verbatim so downstream consumers can recover anything the unified shape omits. Each venue populates what it has.
|
|
87
|
+
* @type {{ [key: string]: any; }}
|
|
88
|
+
* @memberof UnifiedEvent
|
|
89
|
+
*/
|
|
90
|
+
sourceMetadata?: {
|
|
91
|
+
[key: string]: any;
|
|
92
|
+
};
|
|
85
93
|
/**
|
|
86
94
|
* The exchange/venue this event originates from (e.g. 'polymarket', 'kalshi'). Populated by the Router.
|
|
87
95
|
* @type {string}
|
|
@@ -58,6 +58,7 @@ function UnifiedEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
58
58
|
'image': json['image'] == null ? undefined : json['image'],
|
|
59
59
|
'category': json['category'] == null ? undefined : json['category'],
|
|
60
60
|
'tags': json['tags'] == null ? undefined : json['tags'],
|
|
61
|
+
'sourceMetadata': json['sourceMetadata'] == null ? undefined : json['sourceMetadata'],
|
|
61
62
|
'sourceExchange': json['sourceExchange'] == null ? undefined : json['sourceExchange'],
|
|
62
63
|
};
|
|
63
64
|
}
|
|
@@ -80,6 +81,7 @@ function UnifiedEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
80
81
|
'image': value['image'],
|
|
81
82
|
'category': value['category'],
|
|
82
83
|
'tags': value['tags'],
|
|
84
|
+
'sourceMetadata': value['sourceMetadata'],
|
|
83
85
|
'sourceExchange': value['sourceExchange'],
|
|
84
86
|
};
|
|
85
87
|
}
|
|
@@ -124,6 +124,14 @@ export interface UnifiedMarket {
|
|
|
124
124
|
* @memberof UnifiedMarket
|
|
125
125
|
*/
|
|
126
126
|
contractAddress?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Raw venue-specific metadata not captured by first-class fields (e.g. Kalshi series_ticker / series_title from the parent event, Polymarket series). Passed through verbatim so downstream consumers can recover anything the unified shape omits. Each venue populates what it has.
|
|
129
|
+
* @type {{ [key: string]: any; }}
|
|
130
|
+
* @memberof UnifiedMarket
|
|
131
|
+
*/
|
|
132
|
+
sourceMetadata?: {
|
|
133
|
+
[key: string]: any;
|
|
134
|
+
};
|
|
127
135
|
/**
|
|
128
136
|
* The exchange/venue this market originates from (e.g. 'polymarket', 'kalshi'). Populated by the Router.
|
|
129
137
|
* @type {string}
|
|
@@ -67,6 +67,7 @@ function UnifiedMarketFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
67
67
|
'tickSize': json['tickSize'] == null ? undefined : json['tickSize'],
|
|
68
68
|
'status': json['status'] == null ? undefined : json['status'],
|
|
69
69
|
'contractAddress': json['contractAddress'] == null ? undefined : json['contractAddress'],
|
|
70
|
+
'sourceMetadata': json['sourceMetadata'] == null ? undefined : json['sourceMetadata'],
|
|
70
71
|
'sourceExchange': json['sourceExchange'] == null ? undefined : json['sourceExchange'],
|
|
71
72
|
'yes': json['yes'] == null ? undefined : (0, MarketOutcome_1.MarketOutcomeFromJSON)(json['yes']),
|
|
72
73
|
'no': json['no'] == null ? undefined : (0, MarketOutcome_1.MarketOutcomeFromJSON)(json['no']),
|
|
@@ -100,6 +101,7 @@ function UnifiedMarketToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
100
101
|
'tickSize': value['tickSize'],
|
|
101
102
|
'status': value['status'],
|
|
102
103
|
'contractAddress': value['contractAddress'],
|
|
104
|
+
'sourceMetadata': value['sourceMetadata'],
|
|
103
105
|
'sourceExchange': value['sourceExchange'],
|
|
104
106
|
'yes': (0, MarketOutcome_1.MarketOutcomeToJSON)(value['yes']),
|
|
105
107
|
'no': (0, MarketOutcome_1.MarketOutcomeToJSON)(value['no']),
|
|
@@ -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;
|