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
|
@@ -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>;
|
package/dist/pmxt/client.d.ts
CHANGED
|
@@ -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[]>;
|
package/dist/pmxt/client.js
CHANGED
|
@@ -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 {
|
|
@@ -1070,28 +1102,25 @@ class Exchange {
|
|
|
1070
1102
|
}
|
|
1071
1103
|
async unwatchOrderBook(outcomeId) {
|
|
1072
1104
|
await this.initPromise;
|
|
1073
|
-
const resolvedOutcomeId = resolveOutcomeId(outcomeId);
|
|
1074
|
-
const args = [resolvedOutcomeId];
|
|
1075
1105
|
try {
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
await this.sendWsMessage(ws, {
|
|
1083
|
-
id: requestId,
|
|
1084
|
-
action: "unsubscribe",
|
|
1085
|
-
exchange: this.exchangeName,
|
|
1086
|
-
method: "unwatchOrderBook",
|
|
1087
|
-
args,
|
|
1106
|
+
const args = [];
|
|
1107
|
+
args.push(resolveOutcomeId(outcomeId));
|
|
1108
|
+
const response = await this.fetchWithRetry(`${this.resolveBaseUrl()}/api/${this.exchangeName}/unwatchOrderBook`, {
|
|
1109
|
+
method: 'POST',
|
|
1110
|
+
headers: { 'Content-Type': 'application/json', ...this.getAuthHeaders() },
|
|
1111
|
+
body: JSON.stringify({ args, credentials: this.getCredentials() }),
|
|
1088
1112
|
});
|
|
1089
|
-
|
|
1113
|
+
if (!response.ok) {
|
|
1114
|
+
const body = await response.json().catch(() => ({}));
|
|
1115
|
+
if (body.error && typeof body.error === "object") {
|
|
1116
|
+
throw (0, errors_js_1.fromServerError)(body.error);
|
|
1117
|
+
}
|
|
1118
|
+
throw new errors_js_1.PmxtError(body.error?.message || response.statusText);
|
|
1119
|
+
}
|
|
1120
|
+
const json = await response.json();
|
|
1121
|
+
this.handleResponse(json);
|
|
1090
1122
|
}
|
|
1091
1123
|
catch (error) {
|
|
1092
|
-
if (this.isWsTransportUnavailableError(error)) {
|
|
1093
|
-
throw this.wsTransportUnavailableError("unwatchOrderBook");
|
|
1094
|
-
}
|
|
1095
1124
|
if (error instanceof errors_js_1.PmxtError)
|
|
1096
1125
|
throw error;
|
|
1097
1126
|
throw new errors_js_1.PmxtError(`Failed to unwatchOrderBook: ${error}`);
|
package/dist/pmxt/models.d.ts
CHANGED
|
@@ -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
|
*/
|
|
@@ -64,6 +64,7 @@ docs/FetchOrderBookParams.md
|
|
|
64
64
|
docs/FetchOrderBooks200Response.md
|
|
65
65
|
docs/FetchOrderBooksRequest.md
|
|
66
66
|
docs/FetchPositions200Response.md
|
|
67
|
+
docs/FetchSeries200Response.md
|
|
67
68
|
docs/FetchTrades200Response.md
|
|
68
69
|
docs/FilterEventsRequest.md
|
|
69
70
|
docs/FilterEventsRequestArgsInner.md
|
|
@@ -105,6 +106,7 @@ docs/Trade.md
|
|
|
105
106
|
docs/TradesParams.md
|
|
106
107
|
docs/UnifiedEvent.md
|
|
107
108
|
docs/UnifiedMarket.md
|
|
109
|
+
docs/UnifiedSeries.md
|
|
108
110
|
docs/UserTrade.md
|
|
109
111
|
package.json
|
|
110
112
|
src/apis/DataFeedsApi.ts
|
|
@@ -171,6 +173,7 @@ src/models/FetchOrderBookParams.ts
|
|
|
171
173
|
src/models/FetchOrderBooks200Response.ts
|
|
172
174
|
src/models/FetchOrderBooksRequest.ts
|
|
173
175
|
src/models/FetchPositions200Response.ts
|
|
176
|
+
src/models/FetchSeries200Response.ts
|
|
174
177
|
src/models/FetchTrades200Response.ts
|
|
175
178
|
src/models/FilterEventsRequest.ts
|
|
176
179
|
src/models/FilterEventsRequestArgsInner.ts
|
|
@@ -212,6 +215,7 @@ src/models/Trade.ts
|
|
|
212
215
|
src/models/TradesParams.ts
|
|
213
216
|
src/models/UnifiedEvent.ts
|
|
214
217
|
src/models/UnifiedMarket.ts
|
|
218
|
+
src/models/UnifiedSeries.ts
|
|
215
219
|
src/models/UserTrade.ts
|
|
216
220
|
src/models/index.ts
|
|
217
221
|
src/runtime.ts
|
|
@@ -32,6 +32,7 @@ All URIs are relative to *http://localhost:3847*
|
|
|
32
32
|
| [**fetchOrderBooks**](DefaultApi.md#fetchorderbooksoperation) | **POST** /api/{exchange}/fetchOrderBooks | Fetch Order Books |
|
|
33
33
|
| [**fetchPositions**](DefaultApi.md#fetchpositions) | **GET** /api/{exchange}/fetchPositions | Fetch Positions |
|
|
34
34
|
| [**fetchRelatedMarkets**](DefaultApi.md#fetchrelatedmarkets) | **GET** /api/{exchange}/fetchRelatedMarkets | Find Related Markets |
|
|
35
|
+
| [**fetchSeries**](DefaultApi.md#fetchseries) | **GET** /api/{exchange}/fetchSeries | Fetch Series |
|
|
35
36
|
| [**fetchTrades**](DefaultApi.md#fetchtrades) | **GET** /api/{exchange}/fetchTrades | Fetch Trades |
|
|
36
37
|
| [**filterEvents**](DefaultApi.md#filtereventsoperation) | **POST** /api/{exchange}/filterEvents | Filter Events |
|
|
37
38
|
| [**filterMarkets**](DefaultApi.md#filtermarketsoperation) | **POST** /api/{exchange}/filterMarkets | Filter Markets |
|
|
@@ -702,7 +703,7 @@ No authorization required
|
|
|
702
703
|
|
|
703
704
|
## fetchEvent
|
|
704
705
|
|
|
705
|
-
> FetchEvent200Response fetchEvent(exchange, query, limit, cursor, offset, sort, status, searchIn, eventId, slug, filter, category, tags)
|
|
706
|
+
> FetchEvent200Response fetchEvent(exchange, query, limit, cursor, offset, sort, status, searchIn, eventId, slug, series, filter, category, tags)
|
|
706
707
|
|
|
707
708
|
Fetch Event
|
|
708
709
|
|
|
@@ -742,6 +743,8 @@ async function example() {
|
|
|
742
743
|
eventId: eventId_example,
|
|
743
744
|
// string | Lookup by event slug (optional)
|
|
744
745
|
slug: slug_example,
|
|
746
|
+
// string | 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. (optional)
|
|
747
|
+
series: series_example,
|
|
745
748
|
// EventFilterCriteria | Optional client-side filter applied after fetching (optional)
|
|
746
749
|
filter: ...,
|
|
747
750
|
// string | Filter by category. Each event belongs to a venue-assigned category such as \"Sports\", \"Politics\", \"Crypto\", \"Bitcoin\", \"Soccer\", \"Economic Policy\" (Polymarket) or \"Sports\", \"Mentions\" (Kalshi). (optional)
|
|
@@ -777,6 +780,7 @@ example().catch(console.error);
|
|
|
777
780
|
| **searchIn** | `title`, `description`, `both` | Where to search (default: \'title\') | [Optional] [Defaults to `undefined`] [Enum: title, description, both] |
|
|
778
781
|
| **eventId** | `string` | Direct lookup by event ID | [Optional] [Defaults to `undefined`] |
|
|
779
782
|
| **slug** | `string` | Lookup by event slug | [Optional] [Defaults to `undefined`] |
|
|
783
|
+
| **series** | `string` | 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. | [Optional] [Defaults to `undefined`] |
|
|
780
784
|
| **filter** | [](.md) | Optional client-side filter applied after fetching | [Optional] [Defaults to `undefined`] |
|
|
781
785
|
| **category** | `string` | Filter by category. Each event belongs to a venue-assigned category such as \"Sports\", \"Politics\", \"Crypto\", \"Bitcoin\", \"Soccer\", \"Economic Policy\" (Polymarket) or \"Sports\", \"Mentions\" (Kalshi). | [Optional] [Defaults to `undefined`] |
|
|
782
786
|
| **tags** | `Array<string>` | Filter by tags. Returns events matching ANY of the provided tags. Tags are more specific than categories -- for example a \"Politics\" event might carry tags [\"Politics\", \"Geopolitics\", \"Middle East\", \"Iran\"]. Common tags include \"Crypto\", \"Elections\", \"Fed Rates\", \"FIFA World Cup\", \"Trump\". | [Optional] |
|
|
@@ -899,7 +903,7 @@ No authorization required
|
|
|
899
903
|
|
|
900
904
|
## fetchEvents
|
|
901
905
|
|
|
902
|
-
> FetchEvents200Response fetchEvents(exchange, query, limit, cursor, offset, sort, status, searchIn, eventId, slug, filter, category, tags)
|
|
906
|
+
> FetchEvents200Response fetchEvents(exchange, query, limit, cursor, offset, sort, status, searchIn, eventId, slug, series, filter, category, tags)
|
|
903
907
|
|
|
904
908
|
Fetch Events
|
|
905
909
|
|
|
@@ -939,6 +943,8 @@ async function example() {
|
|
|
939
943
|
eventId: eventId_example,
|
|
940
944
|
// string | Lookup by event slug (optional)
|
|
941
945
|
slug: slug_example,
|
|
946
|
+
// string | 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. (optional)
|
|
947
|
+
series: series_example,
|
|
942
948
|
// EventFilterCriteria | Optional client-side filter applied after fetching (optional)
|
|
943
949
|
filter: ...,
|
|
944
950
|
// string | Filter by category. Each event belongs to a venue-assigned category such as \"Sports\", \"Politics\", \"Crypto\", \"Bitcoin\", \"Soccer\", \"Economic Policy\" (Polymarket) or \"Sports\", \"Mentions\" (Kalshi). (optional)
|
|
@@ -974,6 +980,7 @@ example().catch(console.error);
|
|
|
974
980
|
| **searchIn** | `title`, `description`, `both` | Where to search (default: \'title\') | [Optional] [Defaults to `undefined`] [Enum: title, description, both] |
|
|
975
981
|
| **eventId** | `string` | Direct lookup by event ID | [Optional] [Defaults to `undefined`] |
|
|
976
982
|
| **slug** | `string` | Lookup by event slug | [Optional] [Defaults to `undefined`] |
|
|
983
|
+
| **series** | `string` | 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. | [Optional] [Defaults to `undefined`] |
|
|
977
984
|
| **filter** | [](.md) | Optional client-side filter applied after fetching | [Optional] [Defaults to `undefined`] |
|
|
978
985
|
| **category** | `string` | Filter by category. Each event belongs to a venue-assigned category such as \"Sports\", \"Politics\", \"Crypto\", \"Bitcoin\", \"Soccer\", \"Economic Policy\" (Polymarket) or \"Sports\", \"Mentions\" (Kalshi). | [Optional] [Defaults to `undefined`] |
|
|
979
986
|
| **tags** | `Array<string>` | Filter by tags. Returns events matching ANY of the provided tags. Tags are more specific than categories -- for example a \"Politics\" event might carry tags [\"Politics\", \"Geopolitics\", \"Middle East\", \"Iran\"]. Common tags include \"Crypto\", \"Elections\", \"Fed Rates\", \"FIFA World Cup\", \"Trump\". | [Optional] |
|
|
@@ -2349,6 +2356,73 @@ No authorization required
|
|
|
2349
2356
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
2350
2357
|
|
|
2351
2358
|
|
|
2359
|
+
## fetchSeries
|
|
2360
|
+
|
|
2361
|
+
> FetchSeries200Response fetchSeries(exchange)
|
|
2362
|
+
|
|
2363
|
+
Fetch Series
|
|
2364
|
+
|
|
2365
|
+
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.
|
|
2366
|
+
|
|
2367
|
+
### Example
|
|
2368
|
+
|
|
2369
|
+
```ts
|
|
2370
|
+
import {
|
|
2371
|
+
Configuration,
|
|
2372
|
+
DefaultApi,
|
|
2373
|
+
} from 'pmxtjs';
|
|
2374
|
+
import type { FetchSeriesRequest } from 'pmxtjs';
|
|
2375
|
+
|
|
2376
|
+
async function example() {
|
|
2377
|
+
console.log("🚀 Testing pmxtjs SDK...");
|
|
2378
|
+
const api = new DefaultApi();
|
|
2379
|
+
|
|
2380
|
+
const body = {
|
|
2381
|
+
// 'polymarket' | 'kalshi' | 'kalshi-demo' | 'limitless' | 'probable' | 'baozi' | 'myriad' | 'opinion' | 'metaculus' | 'smarkets' | 'polymarket_us' | 'gemini-titan' | 'hyperliquid' | 'suibets' | 'mock' | 'router' | The prediction market exchange to target.
|
|
2382
|
+
exchange: exchange_example,
|
|
2383
|
+
} satisfies FetchSeriesRequest;
|
|
2384
|
+
|
|
2385
|
+
try {
|
|
2386
|
+
const data = await api.fetchSeries(body);
|
|
2387
|
+
console.log(data);
|
|
2388
|
+
} catch (error) {
|
|
2389
|
+
console.error(error);
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
// Run the test
|
|
2394
|
+
example().catch(console.error);
|
|
2395
|
+
```
|
|
2396
|
+
|
|
2397
|
+
### Parameters
|
|
2398
|
+
|
|
2399
|
+
|
|
2400
|
+
| Name | Type | Description | Notes |
|
|
2401
|
+
|------------- | ------------- | ------------- | -------------|
|
|
2402
|
+
| **exchange** | `polymarket`, `kalshi`, `kalshi-demo`, `limitless`, `probable`, `baozi`, `myriad`, `opinion`, `metaculus`, `smarkets`, `polymarket_us`, `gemini-titan`, `hyperliquid`, `suibets`, `mock`, `router` | The prediction market exchange to target. | [Defaults to `undefined`] [Enum: polymarket, kalshi, kalshi-demo, limitless, probable, baozi, myriad, opinion, metaculus, smarkets, polymarket_us, gemini-titan, hyperliquid, suibets, mock, router] |
|
|
2403
|
+
|
|
2404
|
+
### Return type
|
|
2405
|
+
|
|
2406
|
+
[**FetchSeries200Response**](FetchSeries200Response.md)
|
|
2407
|
+
|
|
2408
|
+
### Authorization
|
|
2409
|
+
|
|
2410
|
+
No authorization required
|
|
2411
|
+
|
|
2412
|
+
### HTTP request headers
|
|
2413
|
+
|
|
2414
|
+
- **Content-Type**: Not defined
|
|
2415
|
+
- **Accept**: `application/json`
|
|
2416
|
+
|
|
2417
|
+
|
|
2418
|
+
### HTTP response details
|
|
2419
|
+
| Status code | Description | Response headers |
|
|
2420
|
+
|-------------|-------------|------------------|
|
|
2421
|
+
| **200** | Fetch Series response | - |
|
|
2422
|
+
|
|
2423
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
2424
|
+
|
|
2425
|
+
|
|
2352
2426
|
## fetchTrades
|
|
2353
2427
|
|
|
2354
2428
|
> FetchTrades200Response fetchTrades(exchange, outcomeId, start, end, limit)
|
|
@@ -15,6 +15,7 @@ Name | Type
|
|
|
15
15
|
`searchIn` | string
|
|
16
16
|
`eventId` | string
|
|
17
17
|
`slug` | string
|
|
18
|
+
`series` | string
|
|
18
19
|
`filter` | [EventFilterCriteria](EventFilterCriteria.md)
|
|
19
20
|
`category` | string
|
|
20
21
|
`tags` | Array<string>
|
|
@@ -35,6 +36,7 @@ const example = {
|
|
|
35
36
|
"searchIn": null,
|
|
36
37
|
"eventId": null,
|
|
37
38
|
"slug": null,
|
|
39
|
+
"series": null,
|
|
38
40
|
"filter": null,
|
|
39
41
|
"category": null,
|
|
40
42
|
"tags": null,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# FetchSeries200Response
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`success` | boolean
|
|
10
|
+
`error` | [ErrorDetail](ErrorDetail.md)
|
|
11
|
+
`data` | [Array<UnifiedSeries>](UnifiedSeries.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { FetchSeries200Response } from 'pmxtjs'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"success": true,
|
|
21
|
+
"error": null,
|
|
22
|
+
"data": null,
|
|
23
|
+
} satisfies FetchSeries200Response
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as FetchSeries200Response
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -18,6 +18,7 @@ Name | Type
|
|
|
18
18
|
`image` | string
|
|
19
19
|
`category` | string
|
|
20
20
|
`tags` | Array<string>
|
|
21
|
+
`sourceMetadata` | { [key: string]: any; }
|
|
21
22
|
`sourceExchange` | string
|
|
22
23
|
|
|
23
24
|
## Example
|
|
@@ -38,6 +39,7 @@ const example = {
|
|
|
38
39
|
"image": null,
|
|
39
40
|
"category": null,
|
|
40
41
|
"tags": null,
|
|
42
|
+
"sourceMetadata": null,
|
|
41
43
|
"sourceExchange": null,
|
|
42
44
|
} satisfies UnifiedEvent
|
|
43
45
|
|
|
@@ -24,6 +24,7 @@ Name | Type
|
|
|
24
24
|
`tickSize` | number
|
|
25
25
|
`status` | string
|
|
26
26
|
`contractAddress` | string
|
|
27
|
+
`sourceMetadata` | { [key: string]: any; }
|
|
27
28
|
`sourceExchange` | string
|
|
28
29
|
`yes` | [MarketOutcome](MarketOutcome.md)
|
|
29
30
|
`no` | [MarketOutcome](MarketOutcome.md)
|
|
@@ -55,6 +56,7 @@ const example = {
|
|
|
55
56
|
"tickSize": null,
|
|
56
57
|
"status": null,
|
|
57
58
|
"contractAddress": null,
|
|
59
|
+
"sourceMetadata": null,
|
|
58
60
|
"sourceExchange": null,
|
|
59
61
|
"yes": null,
|
|
60
62
|
"no": null,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
# UnifiedSeries
|
|
3
|
+
|
|
4
|
+
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`.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`id` | string
|
|
11
|
+
`ticker` | string
|
|
12
|
+
`slug` | string
|
|
13
|
+
`title` | string
|
|
14
|
+
`description` | string
|
|
15
|
+
`recurrence` | string
|
|
16
|
+
`events` | [Array<UnifiedEvent>](UnifiedEvent.md)
|
|
17
|
+
`url` | string
|
|
18
|
+
`image` | string
|
|
19
|
+
`sourceExchange` | string
|
|
20
|
+
`sourceMetadata` | { [key: string]: any; }
|
|
21
|
+
|
|
22
|
+
## Example
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import type { UnifiedSeries } from 'pmxtjs'
|
|
26
|
+
|
|
27
|
+
// TODO: Update the object below with actual values
|
|
28
|
+
const example = {
|
|
29
|
+
"id": null,
|
|
30
|
+
"ticker": null,
|
|
31
|
+
"slug": null,
|
|
32
|
+
"title": null,
|
|
33
|
+
"description": null,
|
|
34
|
+
"recurrence": null,
|
|
35
|
+
"events": null,
|
|
36
|
+
"url": null,
|
|
37
|
+
"image": null,
|
|
38
|
+
"sourceExchange": null,
|
|
39
|
+
"sourceMetadata": null,
|
|
40
|
+
} satisfies UnifiedSeries
|
|
41
|
+
|
|
42
|
+
console.log(example)
|
|
43
|
+
|
|
44
|
+
// Convert the instance to a JSON string
|
|
45
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
46
|
+
console.log(exampleJSON)
|
|
47
|
+
|
|
48
|
+
// Parse the JSON string back to an object
|
|
49
|
+
const exampleParsed = JSON.parse(exampleJSON) as UnifiedSeries
|
|
50
|
+
console.log(exampleParsed)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
54
|
+
|
|
55
|
+
|