pmxtjs 2.34.3 → 2.35.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 +35 -1
- package/dist/esm/generated/src/apis/DefaultApi.js +55 -1
- package/dist/esm/generated/src/models/FetchEventsPaginated200Response.d.ts +46 -0
- package/dist/esm/generated/src/models/FetchEventsPaginated200Response.js +47 -0
- package/dist/esm/generated/src/models/PaginatedEventsResult.d.ts +45 -0
- package/dist/esm/generated/src/models/PaginatedEventsResult.js +50 -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/pmxt/client.d.ts +2 -1
- package/dist/esm/pmxt/client.js +32 -0
- package/dist/esm/pmxt/models.d.ts +11 -0
- package/dist/generated/src/apis/DefaultApi.d.ts +35 -1
- package/dist/generated/src/apis/DefaultApi.js +56 -2
- package/dist/generated/src/models/FetchEventsPaginated200Response.d.ts +46 -0
- package/dist/generated/src/models/FetchEventsPaginated200Response.js +54 -0
- package/dist/generated/src/models/PaginatedEventsResult.d.ts +45 -0
- package/dist/generated/src/models/PaginatedEventsResult.js +57 -0
- package/dist/generated/src/models/index.d.ts +2 -0
- package/dist/generated/src/models/index.js +2 -0
- package/dist/pmxt/client.d.ts +2 -1
- package/dist/pmxt/client.js +32 -0
- package/dist/pmxt/models.d.ts +11 -0
- package/generated/.openapi-generator/FILES +4 -0
- package/generated/docs/DefaultApi.md +77 -0
- package/generated/docs/FetchEventsPaginated200Response.md +38 -0
- package/generated/docs/PaginatedEventsResult.md +39 -0
- package/generated/package.json +1 -1
- package/generated/src/apis/DefaultApi.ts +79 -0
- package/generated/src/models/FetchEventsPaginated200Response.ts +96 -0
- package/generated/src/models/PaginatedEventsResult.ts +91 -0
- package/generated/src/models/index.ts +2 -0
- package/package.json +2 -2
- package/pmxt/client.ts +31 -0
- package/pmxt/models.ts +14 -0
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime.js';
|
|
13
|
-
import type { BaseResponse, BuildOrder200Response, BuildOrderRequest, CancelOrderRequest, CloseRequest, CompareMarketPrices200Response, CompareMarketPricesRequest, CreateOrder200Response, CreateOrderRequest, EventFilterCriteria, FetchArbitrage200Response, FetchBalance200Response, FetchEvent200Response, FetchEventMatches200Response, FetchEvents200Response, FetchMarket200Response, FetchMarketMatches200Response, FetchMarkets200Response, FetchMarketsPaginated200Response, FetchMyTrades200Response, FetchOHLCV200Response, FetchOpenOrders200Response, FetchOrderBook200Response, FetchPositions200Response, FetchTrades200Response, FilterEventsRequest, FilterMarketsRequest, GetExecutionPrice200Response, GetExecutionPriceDetailed200Response, GetExecutionPriceDetailedRequest, GetExecutionPriceRequest, HealthCheck200Response, LoadMarkets200Response, LoadMarketsRequest, MarketFilterCriteria, SubmitOrderRequest, UnifiedEvent, UnifiedMarket, UnwatchAddressRequest, UnwatchOrderBookRequest, WatchAddress200Response, WatchAddressRequest, WatchOrderBookRequest, WatchTradesRequest } from '../models/index.js';
|
|
13
|
+
import type { BaseResponse, BuildOrder200Response, BuildOrderRequest, CancelOrderRequest, CloseRequest, CompareMarketPrices200Response, CompareMarketPricesRequest, CreateOrder200Response, CreateOrderRequest, EventFilterCriteria, FetchArbitrage200Response, FetchBalance200Response, FetchEvent200Response, FetchEventMatches200Response, FetchEvents200Response, FetchEventsPaginated200Response, FetchMarket200Response, FetchMarketMatches200Response, FetchMarkets200Response, FetchMarketsPaginated200Response, FetchMyTrades200Response, FetchOHLCV200Response, FetchOpenOrders200Response, FetchOrderBook200Response, FetchPositions200Response, FetchTrades200Response, FilterEventsRequest, FilterMarketsRequest, GetExecutionPrice200Response, GetExecutionPriceDetailed200Response, GetExecutionPriceDetailedRequest, GetExecutionPriceRequest, HealthCheck200Response, LoadMarkets200Response, LoadMarketsRequest, MarketFilterCriteria, SubmitOrderRequest, UnifiedEvent, UnifiedMarket, UnwatchAddressRequest, UnwatchOrderBookRequest, WatchAddress200Response, WatchAddressRequest, WatchOrderBookRequest, WatchTradesRequest } from '../models/index.js';
|
|
14
14
|
export interface BuildOrderOperationRequest {
|
|
15
15
|
exchange: BuildOrderOperationExchangeEnum;
|
|
16
16
|
buildOrderRequest?: BuildOrderRequest;
|
|
@@ -96,6 +96,12 @@ export interface FetchEventsRequest {
|
|
|
96
96
|
category?: string;
|
|
97
97
|
tags?: Array<string>;
|
|
98
98
|
}
|
|
99
|
+
export interface FetchEventsPaginatedRequest {
|
|
100
|
+
exchange: FetchEventsPaginatedExchangeEnum;
|
|
101
|
+
limit?: number;
|
|
102
|
+
cursor?: string;
|
|
103
|
+
filter?: EventFilterCriteria;
|
|
104
|
+
}
|
|
99
105
|
export interface FetchHedgesRequest {
|
|
100
106
|
exchange: FetchHedgesExchangeEnum;
|
|
101
107
|
market?: UnifiedMarket;
|
|
@@ -369,6 +375,16 @@ export declare class DefaultApi extends runtime.BaseAPI {
|
|
|
369
375
|
* Fetch Events
|
|
370
376
|
*/
|
|
371
377
|
fetchEvents(requestParameters: FetchEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FetchEvents200Response>;
|
|
378
|
+
/**
|
|
379
|
+
* Paginated variant of {@link fetchEvents}. On the first call (no `cursor`), all events are fetched from the exchange and cached in an in-memory snapshot. A cursor is returned along with the first page. Subsequent calls with that cursor serve additional pages directly from the cached snapshot -- no additional API calls are made. The snapshot is invalidated after `snapshotTTL` ms (configured via `ExchangeOptions` in the constructor). A request using a cursor from an expired snapshot throws `\'Cursor has expired\'`.
|
|
380
|
+
* Fetch Events Paginated
|
|
381
|
+
*/
|
|
382
|
+
fetchEventsPaginatedRaw(requestParameters: FetchEventsPaginatedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FetchEventsPaginated200Response>>;
|
|
383
|
+
/**
|
|
384
|
+
* Paginated variant of {@link fetchEvents}. On the first call (no `cursor`), all events are fetched from the exchange and cached in an in-memory snapshot. A cursor is returned along with the first page. Subsequent calls with that cursor serve additional pages directly from the cached snapshot -- no additional API calls are made. The snapshot is invalidated after `snapshotTTL` ms (configured via `ExchangeOptions` in the constructor). A request using a cursor from an expired snapshot throws `\'Cursor has expired\'`.
|
|
385
|
+
* Fetch Events Paginated
|
|
386
|
+
*/
|
|
387
|
+
fetchEventsPaginated(requestParameters: FetchEventsPaginatedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FetchEventsPaginated200Response>;
|
|
372
388
|
/**
|
|
373
389
|
* Find hedging opportunities across venues. Discovers subset/superset market relationships where one market\'s outcome implies another, enabling cross-venue hedging strategies with live prices.
|
|
374
390
|
* Find Hedging Opportunities
|
|
@@ -910,6 +926,24 @@ export declare const FetchEventsSearchInEnum: {
|
|
|
910
926
|
readonly Both: "both";
|
|
911
927
|
};
|
|
912
928
|
export type FetchEventsSearchInEnum = typeof FetchEventsSearchInEnum[keyof typeof FetchEventsSearchInEnum];
|
|
929
|
+
/**
|
|
930
|
+
* @export
|
|
931
|
+
*/
|
|
932
|
+
export declare const FetchEventsPaginatedExchangeEnum: {
|
|
933
|
+
readonly Polymarket: "polymarket";
|
|
934
|
+
readonly Kalshi: "kalshi";
|
|
935
|
+
readonly KalshiDemo: "kalshi-demo";
|
|
936
|
+
readonly Limitless: "limitless";
|
|
937
|
+
readonly Probable: "probable";
|
|
938
|
+
readonly Baozi: "baozi";
|
|
939
|
+
readonly Myriad: "myriad";
|
|
940
|
+
readonly Opinion: "opinion";
|
|
941
|
+
readonly Metaculus: "metaculus";
|
|
942
|
+
readonly Smarkets: "smarkets";
|
|
943
|
+
readonly PolymarketUs: "polymarket_us";
|
|
944
|
+
readonly Router: "router";
|
|
945
|
+
};
|
|
946
|
+
export type FetchEventsPaginatedExchangeEnum = typeof FetchEventsPaginatedExchangeEnum[keyof typeof FetchEventsPaginatedExchangeEnum];
|
|
913
947
|
/**
|
|
914
948
|
* @export
|
|
915
949
|
*/
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import * as runtime from '../runtime.js';
|
|
15
|
-
import { BaseResponseFromJSON, BuildOrder200ResponseFromJSON, BuildOrderRequestToJSON, CancelOrderRequestToJSON, CloseRequestToJSON, CompareMarketPrices200ResponseFromJSON, CompareMarketPricesRequestToJSON, CreateOrder200ResponseFromJSON, CreateOrderRequestToJSON, FetchArbitrage200ResponseFromJSON, FetchBalance200ResponseFromJSON, FetchEvent200ResponseFromJSON, FetchEventMatches200ResponseFromJSON, FetchEvents200ResponseFromJSON, FetchMarket200ResponseFromJSON, FetchMarketMatches200ResponseFromJSON, FetchMarkets200ResponseFromJSON, FetchMarketsPaginated200ResponseFromJSON, FetchMyTrades200ResponseFromJSON, FetchOHLCV200ResponseFromJSON, FetchOpenOrders200ResponseFromJSON, FetchOrderBook200ResponseFromJSON, FetchPositions200ResponseFromJSON, FetchTrades200ResponseFromJSON, FilterEventsRequestToJSON, FilterMarketsRequestToJSON, GetExecutionPrice200ResponseFromJSON, GetExecutionPriceDetailed200ResponseFromJSON, GetExecutionPriceDetailedRequestToJSON, GetExecutionPriceRequestToJSON, HealthCheck200ResponseFromJSON, LoadMarkets200ResponseFromJSON, LoadMarketsRequestToJSON, SubmitOrderRequestToJSON, UnwatchAddressRequestToJSON, UnwatchOrderBookRequestToJSON, WatchAddress200ResponseFromJSON, WatchAddressRequestToJSON, WatchOrderBookRequestToJSON, WatchTradesRequestToJSON, } from '../models/index.js';
|
|
15
|
+
import { BaseResponseFromJSON, BuildOrder200ResponseFromJSON, BuildOrderRequestToJSON, CancelOrderRequestToJSON, CloseRequestToJSON, CompareMarketPrices200ResponseFromJSON, CompareMarketPricesRequestToJSON, CreateOrder200ResponseFromJSON, CreateOrderRequestToJSON, FetchArbitrage200ResponseFromJSON, FetchBalance200ResponseFromJSON, FetchEvent200ResponseFromJSON, FetchEventMatches200ResponseFromJSON, FetchEvents200ResponseFromJSON, FetchEventsPaginated200ResponseFromJSON, FetchMarket200ResponseFromJSON, FetchMarketMatches200ResponseFromJSON, FetchMarkets200ResponseFromJSON, FetchMarketsPaginated200ResponseFromJSON, FetchMyTrades200ResponseFromJSON, FetchOHLCV200ResponseFromJSON, FetchOpenOrders200ResponseFromJSON, FetchOrderBook200ResponseFromJSON, FetchPositions200ResponseFromJSON, FetchTrades200ResponseFromJSON, FilterEventsRequestToJSON, FilterMarketsRequestToJSON, GetExecutionPrice200ResponseFromJSON, GetExecutionPriceDetailed200ResponseFromJSON, GetExecutionPriceDetailedRequestToJSON, GetExecutionPriceRequestToJSON, HealthCheck200ResponseFromJSON, LoadMarkets200ResponseFromJSON, LoadMarketsRequestToJSON, SubmitOrderRequestToJSON, UnwatchAddressRequestToJSON, UnwatchOrderBookRequestToJSON, WatchAddress200ResponseFromJSON, WatchAddressRequestToJSON, WatchOrderBookRequestToJSON, WatchTradesRequestToJSON, } from '../models/index.js';
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
@@ -491,6 +491,43 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
491
491
|
const response = await this.fetchEventsRaw(requestParameters, initOverrides);
|
|
492
492
|
return await response.value();
|
|
493
493
|
}
|
|
494
|
+
/**
|
|
495
|
+
* Paginated variant of {@link fetchEvents}. On the first call (no `cursor`), all events are fetched from the exchange and cached in an in-memory snapshot. A cursor is returned along with the first page. Subsequent calls with that cursor serve additional pages directly from the cached snapshot -- no additional API calls are made. The snapshot is invalidated after `snapshotTTL` ms (configured via `ExchangeOptions` in the constructor). A request using a cursor from an expired snapshot throws `\'Cursor has expired\'`.
|
|
496
|
+
* Fetch Events Paginated
|
|
497
|
+
*/
|
|
498
|
+
async fetchEventsPaginatedRaw(requestParameters, initOverrides) {
|
|
499
|
+
if (requestParameters['exchange'] == null) {
|
|
500
|
+
throw new runtime.RequiredError('exchange', 'Required parameter "exchange" was null or undefined when calling fetchEventsPaginated().');
|
|
501
|
+
}
|
|
502
|
+
const queryParameters = {};
|
|
503
|
+
if (requestParameters['limit'] != null) {
|
|
504
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
505
|
+
}
|
|
506
|
+
if (requestParameters['cursor'] != null) {
|
|
507
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
508
|
+
}
|
|
509
|
+
if (requestParameters['filter'] != null) {
|
|
510
|
+
queryParameters['filter'] = requestParameters['filter'];
|
|
511
|
+
}
|
|
512
|
+
const headerParameters = {};
|
|
513
|
+
let urlPath = `/api/{exchange}/fetchEventsPaginated`;
|
|
514
|
+
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
515
|
+
const response = await this.request({
|
|
516
|
+
path: urlPath,
|
|
517
|
+
method: 'GET',
|
|
518
|
+
headers: headerParameters,
|
|
519
|
+
query: queryParameters,
|
|
520
|
+
}, initOverrides);
|
|
521
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FetchEventsPaginated200ResponseFromJSON(jsonValue));
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Paginated variant of {@link fetchEvents}. On the first call (no `cursor`), all events are fetched from the exchange and cached in an in-memory snapshot. A cursor is returned along with the first page. Subsequent calls with that cursor serve additional pages directly from the cached snapshot -- no additional API calls are made. The snapshot is invalidated after `snapshotTTL` ms (configured via `ExchangeOptions` in the constructor). A request using a cursor from an expired snapshot throws `\'Cursor has expired\'`.
|
|
525
|
+
* Fetch Events Paginated
|
|
526
|
+
*/
|
|
527
|
+
async fetchEventsPaginated(requestParameters, initOverrides) {
|
|
528
|
+
const response = await this.fetchEventsPaginatedRaw(requestParameters, initOverrides);
|
|
529
|
+
return await response.value();
|
|
530
|
+
}
|
|
494
531
|
/**
|
|
495
532
|
* Find hedging opportunities across venues. Discovers subset/superset market relationships where one market\'s outcome implies another, enabling cross-venue hedging strategies with live prices.
|
|
496
533
|
* Find Hedging Opportunities
|
|
@@ -1702,6 +1739,23 @@ export const FetchEventsSearchInEnum = {
|
|
|
1702
1739
|
Description: 'description',
|
|
1703
1740
|
Both: 'both'
|
|
1704
1741
|
};
|
|
1742
|
+
/**
|
|
1743
|
+
* @export
|
|
1744
|
+
*/
|
|
1745
|
+
export const FetchEventsPaginatedExchangeEnum = {
|
|
1746
|
+
Polymarket: 'polymarket',
|
|
1747
|
+
Kalshi: 'kalshi',
|
|
1748
|
+
KalshiDemo: 'kalshi-demo',
|
|
1749
|
+
Limitless: 'limitless',
|
|
1750
|
+
Probable: 'probable',
|
|
1751
|
+
Baozi: 'baozi',
|
|
1752
|
+
Myriad: 'myriad',
|
|
1753
|
+
Opinion: 'opinion',
|
|
1754
|
+
Metaculus: 'metaculus',
|
|
1755
|
+
Smarkets: 'smarkets',
|
|
1756
|
+
PolymarketUs: 'polymarket_us',
|
|
1757
|
+
Router: 'router'
|
|
1758
|
+
};
|
|
1705
1759
|
/**
|
|
1706
1760
|
* @export
|
|
1707
1761
|
*/
|
|
@@ -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.js';
|
|
13
|
+
import type { PaginatedEventsResult } from './PaginatedEventsResult.js';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @interface FetchEventsPaginated200Response
|
|
18
|
+
*/
|
|
19
|
+
export interface FetchEventsPaginated200Response {
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @type {boolean}
|
|
23
|
+
* @memberof FetchEventsPaginated200Response
|
|
24
|
+
*/
|
|
25
|
+
success?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @type {ErrorDetail}
|
|
29
|
+
* @memberof FetchEventsPaginated200Response
|
|
30
|
+
*/
|
|
31
|
+
error?: ErrorDetail;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @type {PaginatedEventsResult}
|
|
35
|
+
* @memberof FetchEventsPaginated200Response
|
|
36
|
+
*/
|
|
37
|
+
data?: PaginatedEventsResult;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Check if a given object implements the FetchEventsPaginated200Response interface.
|
|
41
|
+
*/
|
|
42
|
+
export declare function instanceOfFetchEventsPaginated200Response(value: object): value is FetchEventsPaginated200Response;
|
|
43
|
+
export declare function FetchEventsPaginated200ResponseFromJSON(json: any): FetchEventsPaginated200Response;
|
|
44
|
+
export declare function FetchEventsPaginated200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FetchEventsPaginated200Response;
|
|
45
|
+
export declare function FetchEventsPaginated200ResponseToJSON(json: any): FetchEventsPaginated200Response;
|
|
46
|
+
export declare function FetchEventsPaginated200ResponseToJSONTyped(value?: FetchEventsPaginated200Response | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* PMXT Sidecar API
|
|
5
|
+
* 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.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.4.4
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import { ErrorDetailFromJSON, ErrorDetailToJSON, } from './ErrorDetail.js';
|
|
15
|
+
import { PaginatedEventsResultFromJSON, PaginatedEventsResultToJSON, } from './PaginatedEventsResult.js';
|
|
16
|
+
/**
|
|
17
|
+
* Check if a given object implements the FetchEventsPaginated200Response interface.
|
|
18
|
+
*/
|
|
19
|
+
export function instanceOfFetchEventsPaginated200Response(value) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
export function FetchEventsPaginated200ResponseFromJSON(json) {
|
|
23
|
+
return FetchEventsPaginated200ResponseFromJSONTyped(json, false);
|
|
24
|
+
}
|
|
25
|
+
export function FetchEventsPaginated200ResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
26
|
+
if (json == null) {
|
|
27
|
+
return json;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
'success': json['success'] == null ? undefined : json['success'],
|
|
31
|
+
'error': json['error'] == null ? undefined : ErrorDetailFromJSON(json['error']),
|
|
32
|
+
'data': json['data'] == null ? undefined : PaginatedEventsResultFromJSON(json['data']),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function FetchEventsPaginated200ResponseToJSON(json) {
|
|
36
|
+
return FetchEventsPaginated200ResponseToJSONTyped(json, false);
|
|
37
|
+
}
|
|
38
|
+
export function FetchEventsPaginated200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
39
|
+
if (value == null) {
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
'success': value['success'],
|
|
44
|
+
'error': ErrorDetailToJSON(value['error']),
|
|
45
|
+
'data': PaginatedEventsResultToJSON(value['data']),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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.js';
|
|
13
|
+
/**
|
|
14
|
+
* Shape returned by fetchEventsPaginated
|
|
15
|
+
* @export
|
|
16
|
+
* @interface PaginatedEventsResult
|
|
17
|
+
*/
|
|
18
|
+
export interface PaginatedEventsResult {
|
|
19
|
+
/**
|
|
20
|
+
* The page of unified events
|
|
21
|
+
* @type {Array<UnifiedEvent>}
|
|
22
|
+
* @memberof PaginatedEventsResult
|
|
23
|
+
*/
|
|
24
|
+
data: Array<UnifiedEvent>;
|
|
25
|
+
/**
|
|
26
|
+
* Total number of events in the snapshot
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @memberof PaginatedEventsResult
|
|
29
|
+
*/
|
|
30
|
+
total: number;
|
|
31
|
+
/**
|
|
32
|
+
* Cursor to pass to the next call, or undefined if this is the last page
|
|
33
|
+
* @type {string}
|
|
34
|
+
* @memberof PaginatedEventsResult
|
|
35
|
+
*/
|
|
36
|
+
nextCursor?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if a given object implements the PaginatedEventsResult interface.
|
|
40
|
+
*/
|
|
41
|
+
export declare function instanceOfPaginatedEventsResult(value: object): value is PaginatedEventsResult;
|
|
42
|
+
export declare function PaginatedEventsResultFromJSON(json: any): PaginatedEventsResult;
|
|
43
|
+
export declare function PaginatedEventsResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedEventsResult;
|
|
44
|
+
export declare function PaginatedEventsResultToJSON(json: any): PaginatedEventsResult;
|
|
45
|
+
export declare function PaginatedEventsResultToJSONTyped(value?: PaginatedEventsResult | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* PMXT Sidecar API
|
|
5
|
+
* 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.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.4.4
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import { UnifiedEventFromJSON, UnifiedEventToJSON, } from './UnifiedEvent.js';
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the PaginatedEventsResult interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfPaginatedEventsResult(value) {
|
|
19
|
+
if (!('data' in value) || value['data'] === undefined)
|
|
20
|
+
return false;
|
|
21
|
+
if (!('total' in value) || value['total'] === undefined)
|
|
22
|
+
return false;
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
export function PaginatedEventsResultFromJSON(json) {
|
|
26
|
+
return PaginatedEventsResultFromJSONTyped(json, false);
|
|
27
|
+
}
|
|
28
|
+
export function PaginatedEventsResultFromJSONTyped(json, ignoreDiscriminator) {
|
|
29
|
+
if (json == null) {
|
|
30
|
+
return json;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
'data': (json['data'].map(UnifiedEventFromJSON)),
|
|
34
|
+
'total': json['total'],
|
|
35
|
+
'nextCursor': json['nextCursor'] == null ? undefined : json['nextCursor'],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function PaginatedEventsResultToJSON(json) {
|
|
39
|
+
return PaginatedEventsResultToJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
export function PaginatedEventsResultToJSONTyped(value, ignoreDiscriminator = false) {
|
|
42
|
+
if (value == null) {
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
'data': (value['data'].map(UnifiedEventToJSON)),
|
|
47
|
+
'total': value['total'],
|
|
48
|
+
'nextCursor': value['nextCursor'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -29,6 +29,7 @@ export * from './FetchEvent200Response.js';
|
|
|
29
29
|
export * from './FetchEventMatches200Response.js';
|
|
30
30
|
export * from './FetchEventMatchesParams.js';
|
|
31
31
|
export * from './FetchEvents200Response.js';
|
|
32
|
+
export * from './FetchEventsPaginated200Response.js';
|
|
32
33
|
export * from './FetchMarket200Response.js';
|
|
33
34
|
export * from './FetchMarketMatches200Response.js';
|
|
34
35
|
export * from './FetchMarketMatchesParams.js';
|
|
@@ -69,6 +70,7 @@ export * from './Order.js';
|
|
|
69
70
|
export * from './OrderBook.js';
|
|
70
71
|
export * from './OrderHistoryParams.js';
|
|
71
72
|
export * from './OrderLevel.js';
|
|
73
|
+
export * from './PaginatedEventsResult.js';
|
|
72
74
|
export * from './PaginatedMarketsResult.js';
|
|
73
75
|
export * from './Position.js';
|
|
74
76
|
export * from './PriceCandle.js';
|
|
@@ -31,6 +31,7 @@ export * from './FetchEvent200Response.js';
|
|
|
31
31
|
export * from './FetchEventMatches200Response.js';
|
|
32
32
|
export * from './FetchEventMatchesParams.js';
|
|
33
33
|
export * from './FetchEvents200Response.js';
|
|
34
|
+
export * from './FetchEventsPaginated200Response.js';
|
|
34
35
|
export * from './FetchMarket200Response.js';
|
|
35
36
|
export * from './FetchMarketMatches200Response.js';
|
|
36
37
|
export * from './FetchMarketMatchesParams.js';
|
|
@@ -71,6 +72,7 @@ export * from './Order.js';
|
|
|
71
72
|
export * from './OrderBook.js';
|
|
72
73
|
export * from './OrderHistoryParams.js';
|
|
73
74
|
export * from './OrderLevel.js';
|
|
75
|
+
export * from './PaginatedEventsResult.js';
|
|
74
76
|
export * from './PaginatedMarketsResult.js';
|
|
75
77
|
export * from './Position.js';
|
|
76
78
|
export * from './PriceCandle.js';
|
|
@@ -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, EventFilterCriteria, EventFilterFunction, ExecutionPriceResult, MarketFilterCriteria, MarketFilterFunction, MarketOutcome, Order, OrderBook, PaginatedMarketsResult, Position, PriceCandle, SubscribedAddressSnapshot, SubscriptionOption, Trade, UnifiedEvent, UnifiedMarket, UserTrade } from "./models.js";
|
|
8
|
+
import { Balance, BuiltOrder, CreateOrderParams, EventFilterCriteria, EventFilterFunction, ExecutionPriceResult, MarketFilterCriteria, MarketFilterFunction, MarketOutcome, Order, OrderBook, PaginatedMarketsResult, PaginatedEventsResult, Position, PriceCandle, SubscribedAddressSnapshot, SubscriptionOption, Trade, UnifiedEvent, UnifiedMarket, UserTrade } from "./models.js";
|
|
9
9
|
import { ServerManager } from "./server-manager.js";
|
|
10
10
|
/**
|
|
11
11
|
* Base exchange client options.
|
|
@@ -136,6 +136,7 @@ export declare abstract class Exchange {
|
|
|
136
136
|
fetchMarkets(params?: any): Promise<UnifiedMarket[]>;
|
|
137
137
|
fetchMarketsPaginated(params?: any): Promise<PaginatedMarketsResult>;
|
|
138
138
|
fetchEvents(params?: any): Promise<UnifiedEvent[]>;
|
|
139
|
+
fetchEventsPaginated(params?: any): Promise<PaginatedEventsResult>;
|
|
139
140
|
fetchMarket(params?: any): Promise<UnifiedMarket>;
|
|
140
141
|
fetchEvent(params?: any): Promise<UnifiedEvent>;
|
|
141
142
|
fetchOrderBook(id: string): Promise<OrderBook>;
|
package/dist/esm/pmxt/client.js
CHANGED
|
@@ -611,6 +611,38 @@ export class Exchange {
|
|
|
611
611
|
throw new PmxtError(`Failed to fetchEvents: ${error}`);
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
|
+
async fetchEventsPaginated(params) {
|
|
615
|
+
await this.initPromise;
|
|
616
|
+
try {
|
|
617
|
+
const args = [];
|
|
618
|
+
if (params !== undefined)
|
|
619
|
+
args.push(params);
|
|
620
|
+
const response = await this.fetchWithRetry(`${this.resolveBaseUrl()}/api/${this.exchangeName}/fetchEventsPaginated`, {
|
|
621
|
+
method: 'POST',
|
|
622
|
+
headers: { 'Content-Type': 'application/json', ...this.getAuthHeaders() },
|
|
623
|
+
body: JSON.stringify({ args, credentials: this.getCredentials() }),
|
|
624
|
+
});
|
|
625
|
+
if (!response.ok) {
|
|
626
|
+
const body = await response.json().catch(() => ({}));
|
|
627
|
+
if (body.error && typeof body.error === "object") {
|
|
628
|
+
throw fromServerError(body.error);
|
|
629
|
+
}
|
|
630
|
+
throw new PmxtError(body.error?.message || response.statusText);
|
|
631
|
+
}
|
|
632
|
+
const json = await response.json();
|
|
633
|
+
const data = this.handleResponse(json);
|
|
634
|
+
return {
|
|
635
|
+
data: (data.data || []).map(convertEvent),
|
|
636
|
+
total: data.total,
|
|
637
|
+
nextCursor: data.nextCursor,
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
catch (error) {
|
|
641
|
+
if (error instanceof PmxtError)
|
|
642
|
+
throw error;
|
|
643
|
+
throw new PmxtError(`Failed to fetchEventsPaginated: ${error}`);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
614
646
|
async fetchMarket(params) {
|
|
615
647
|
await this.initPromise;
|
|
616
648
|
try {
|
|
@@ -155,6 +155,17 @@ export interface PaginatedMarketsResult {
|
|
|
155
155
|
/** Cursor for the next page (pass to fetchMarketsPaginated) */
|
|
156
156
|
nextCursor?: string;
|
|
157
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Result of a paginated event fetch.
|
|
160
|
+
*/
|
|
161
|
+
export interface PaginatedEventsResult {
|
|
162
|
+
/** The events for this page */
|
|
163
|
+
data: UnifiedEvent[];
|
|
164
|
+
/** Total number of events (if available) */
|
|
165
|
+
total?: number;
|
|
166
|
+
/** Cursor for the next page (pass to fetchEventsPaginated) */
|
|
167
|
+
nextCursor?: string;
|
|
168
|
+
}
|
|
158
169
|
/**
|
|
159
170
|
* A historical trade.
|
|
160
171
|
*/
|
|
@@ -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, FetchMarket200Response, FetchMarketMatches200Response, FetchMarkets200Response, FetchMarketsPaginated200Response, FetchMyTrades200Response, FetchOHLCV200Response, FetchOpenOrders200Response, FetchOrderBook200Response, FetchPositions200Response, FetchTrades200Response, FilterEventsRequest, FilterMarketsRequest, GetExecutionPrice200Response, GetExecutionPriceDetailed200Response, GetExecutionPriceDetailedRequest, GetExecutionPriceRequest, HealthCheck200Response, LoadMarkets200Response, LoadMarketsRequest, MarketFilterCriteria, SubmitOrderRequest, UnifiedEvent, UnifiedMarket, UnwatchAddressRequest, UnwatchOrderBookRequest, WatchAddress200Response, WatchAddressRequest, WatchOrderBookRequest, WatchTradesRequest } 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, FetchMyTrades200Response, FetchOHLCV200Response, FetchOpenOrders200Response, FetchOrderBook200Response, FetchPositions200Response, FetchTrades200Response, FilterEventsRequest, FilterMarketsRequest, GetExecutionPrice200Response, GetExecutionPriceDetailed200Response, GetExecutionPriceDetailedRequest, GetExecutionPriceRequest, HealthCheck200Response, LoadMarkets200Response, LoadMarketsRequest, MarketFilterCriteria, SubmitOrderRequest, UnifiedEvent, UnifiedMarket, UnwatchAddressRequest, UnwatchOrderBookRequest, WatchAddress200Response, WatchAddressRequest, WatchOrderBookRequest, WatchTradesRequest } from '../models/index';
|
|
14
14
|
export interface BuildOrderOperationRequest {
|
|
15
15
|
exchange: BuildOrderOperationExchangeEnum;
|
|
16
16
|
buildOrderRequest?: BuildOrderRequest;
|
|
@@ -96,6 +96,12 @@ export interface FetchEventsRequest {
|
|
|
96
96
|
category?: string;
|
|
97
97
|
tags?: Array<string>;
|
|
98
98
|
}
|
|
99
|
+
export interface FetchEventsPaginatedRequest {
|
|
100
|
+
exchange: FetchEventsPaginatedExchangeEnum;
|
|
101
|
+
limit?: number;
|
|
102
|
+
cursor?: string;
|
|
103
|
+
filter?: EventFilterCriteria;
|
|
104
|
+
}
|
|
99
105
|
export interface FetchHedgesRequest {
|
|
100
106
|
exchange: FetchHedgesExchangeEnum;
|
|
101
107
|
market?: UnifiedMarket;
|
|
@@ -369,6 +375,16 @@ export declare class DefaultApi extends runtime.BaseAPI {
|
|
|
369
375
|
* Fetch Events
|
|
370
376
|
*/
|
|
371
377
|
fetchEvents(requestParameters: FetchEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FetchEvents200Response>;
|
|
378
|
+
/**
|
|
379
|
+
* Paginated variant of {@link fetchEvents}. On the first call (no `cursor`), all events are fetched from the exchange and cached in an in-memory snapshot. A cursor is returned along with the first page. Subsequent calls with that cursor serve additional pages directly from the cached snapshot -- no additional API calls are made. The snapshot is invalidated after `snapshotTTL` ms (configured via `ExchangeOptions` in the constructor). A request using a cursor from an expired snapshot throws `\'Cursor has expired\'`.
|
|
380
|
+
* Fetch Events Paginated
|
|
381
|
+
*/
|
|
382
|
+
fetchEventsPaginatedRaw(requestParameters: FetchEventsPaginatedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FetchEventsPaginated200Response>>;
|
|
383
|
+
/**
|
|
384
|
+
* Paginated variant of {@link fetchEvents}. On the first call (no `cursor`), all events are fetched from the exchange and cached in an in-memory snapshot. A cursor is returned along with the first page. Subsequent calls with that cursor serve additional pages directly from the cached snapshot -- no additional API calls are made. The snapshot is invalidated after `snapshotTTL` ms (configured via `ExchangeOptions` in the constructor). A request using a cursor from an expired snapshot throws `\'Cursor has expired\'`.
|
|
385
|
+
* Fetch Events Paginated
|
|
386
|
+
*/
|
|
387
|
+
fetchEventsPaginated(requestParameters: FetchEventsPaginatedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FetchEventsPaginated200Response>;
|
|
372
388
|
/**
|
|
373
389
|
* Find hedging opportunities across venues. Discovers subset/superset market relationships where one market\'s outcome implies another, enabling cross-venue hedging strategies with live prices.
|
|
374
390
|
* Find Hedging Opportunities
|
|
@@ -910,6 +926,24 @@ export declare const FetchEventsSearchInEnum: {
|
|
|
910
926
|
readonly Both: "both";
|
|
911
927
|
};
|
|
912
928
|
export type FetchEventsSearchInEnum = typeof FetchEventsSearchInEnum[keyof typeof FetchEventsSearchInEnum];
|
|
929
|
+
/**
|
|
930
|
+
* @export
|
|
931
|
+
*/
|
|
932
|
+
export declare const FetchEventsPaginatedExchangeEnum: {
|
|
933
|
+
readonly Polymarket: "polymarket";
|
|
934
|
+
readonly Kalshi: "kalshi";
|
|
935
|
+
readonly KalshiDemo: "kalshi-demo";
|
|
936
|
+
readonly Limitless: "limitless";
|
|
937
|
+
readonly Probable: "probable";
|
|
938
|
+
readonly Baozi: "baozi";
|
|
939
|
+
readonly Myriad: "myriad";
|
|
940
|
+
readonly Opinion: "opinion";
|
|
941
|
+
readonly Metaculus: "metaculus";
|
|
942
|
+
readonly Smarkets: "smarkets";
|
|
943
|
+
readonly PolymarketUs: "polymarket_us";
|
|
944
|
+
readonly Router: "router";
|
|
945
|
+
};
|
|
946
|
+
export type FetchEventsPaginatedExchangeEnum = typeof FetchEventsPaginatedExchangeEnum[keyof typeof FetchEventsPaginatedExchangeEnum];
|
|
913
947
|
/**
|
|
914
948
|
* @export
|
|
915
949
|
*/
|
|
@@ -46,8 +46,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
46
46
|
};
|
|
47
47
|
})();
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.
|
|
50
|
-
exports.WatchTradesOperationExchangeEnum = exports.WatchOrderBookOperationExchangeEnum = exports.WatchAddressOperationExchangeEnum = exports.UnwatchOrderBookOperationExchangeEnum = exports.UnwatchAddressOperationExchangeEnum = void 0;
|
|
49
|
+
exports.LoadMarketsOperationExchangeEnum = exports.GetExecutionPriceDetailedOperationExchangeEnum = exports.GetExecutionPriceOperationExchangeEnum = exports.FilterMarketsOperationExchangeEnum = exports.FilterEventsOperationExchangeEnum = exports.FetchTradesExchangeEnum = exports.FetchPositionsExchangeEnum = exports.FetchOrderBookExchangeEnum = exports.FetchOrderExchangeEnum = exports.FetchOpenOrdersExchangeEnum = exports.FetchOHLCVResolutionEnum = exports.FetchOHLCVExchangeEnum = exports.FetchMyTradesExchangeEnum = exports.FetchMatchesRelationEnum = exports.FetchMatchesExchangeEnum = exports.FetchMarketsPaginatedExchangeEnum = exports.FetchMarketsSearchInEnum = exports.FetchMarketsStatusEnum = exports.FetchMarketsSortEnum = exports.FetchMarketsExchangeEnum = exports.FetchMarketMatchesRelationEnum = exports.FetchMarketMatchesExchangeEnum = exports.FetchMarketSearchInEnum = exports.FetchMarketStatusEnum = exports.FetchMarketSortEnum = exports.FetchMarketExchangeEnum = 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.WatchTradesOperationExchangeEnum = exports.WatchOrderBookOperationExchangeEnum = exports.WatchAddressOperationExchangeEnum = exports.UnwatchOrderBookOperationExchangeEnum = exports.UnwatchAddressOperationExchangeEnum = exports.SubmitOrderOperationExchangeEnum = void 0;
|
|
51
51
|
const runtime = __importStar(require("../runtime"));
|
|
52
52
|
const index_1 = require("../models/index");
|
|
53
53
|
/**
|
|
@@ -528,6 +528,43 @@ class DefaultApi extends runtime.BaseAPI {
|
|
|
528
528
|
const response = await this.fetchEventsRaw(requestParameters, initOverrides);
|
|
529
529
|
return await response.value();
|
|
530
530
|
}
|
|
531
|
+
/**
|
|
532
|
+
* Paginated variant of {@link fetchEvents}. On the first call (no `cursor`), all events are fetched from the exchange and cached in an in-memory snapshot. A cursor is returned along with the first page. Subsequent calls with that cursor serve additional pages directly from the cached snapshot -- no additional API calls are made. The snapshot is invalidated after `snapshotTTL` ms (configured via `ExchangeOptions` in the constructor). A request using a cursor from an expired snapshot throws `\'Cursor has expired\'`.
|
|
533
|
+
* Fetch Events Paginated
|
|
534
|
+
*/
|
|
535
|
+
async fetchEventsPaginatedRaw(requestParameters, initOverrides) {
|
|
536
|
+
if (requestParameters['exchange'] == null) {
|
|
537
|
+
throw new runtime.RequiredError('exchange', 'Required parameter "exchange" was null or undefined when calling fetchEventsPaginated().');
|
|
538
|
+
}
|
|
539
|
+
const queryParameters = {};
|
|
540
|
+
if (requestParameters['limit'] != null) {
|
|
541
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
542
|
+
}
|
|
543
|
+
if (requestParameters['cursor'] != null) {
|
|
544
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
545
|
+
}
|
|
546
|
+
if (requestParameters['filter'] != null) {
|
|
547
|
+
queryParameters['filter'] = requestParameters['filter'];
|
|
548
|
+
}
|
|
549
|
+
const headerParameters = {};
|
|
550
|
+
let urlPath = `/api/{exchange}/fetchEventsPaginated`;
|
|
551
|
+
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
552
|
+
const response = await this.request({
|
|
553
|
+
path: urlPath,
|
|
554
|
+
method: 'GET',
|
|
555
|
+
headers: headerParameters,
|
|
556
|
+
query: queryParameters,
|
|
557
|
+
}, initOverrides);
|
|
558
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FetchEventsPaginated200ResponseFromJSON)(jsonValue));
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Paginated variant of {@link fetchEvents}. On the first call (no `cursor`), all events are fetched from the exchange and cached in an in-memory snapshot. A cursor is returned along with the first page. Subsequent calls with that cursor serve additional pages directly from the cached snapshot -- no additional API calls are made. The snapshot is invalidated after `snapshotTTL` ms (configured via `ExchangeOptions` in the constructor). A request using a cursor from an expired snapshot throws `\'Cursor has expired\'`.
|
|
562
|
+
* Fetch Events Paginated
|
|
563
|
+
*/
|
|
564
|
+
async fetchEventsPaginated(requestParameters, initOverrides) {
|
|
565
|
+
const response = await this.fetchEventsPaginatedRaw(requestParameters, initOverrides);
|
|
566
|
+
return await response.value();
|
|
567
|
+
}
|
|
531
568
|
/**
|
|
532
569
|
* Find hedging opportunities across venues. Discovers subset/superset market relationships where one market\'s outcome implies another, enabling cross-venue hedging strategies with live prices.
|
|
533
570
|
* Find Hedging Opportunities
|
|
@@ -1740,6 +1777,23 @@ exports.FetchEventsSearchInEnum = {
|
|
|
1740
1777
|
Description: 'description',
|
|
1741
1778
|
Both: 'both'
|
|
1742
1779
|
};
|
|
1780
|
+
/**
|
|
1781
|
+
* @export
|
|
1782
|
+
*/
|
|
1783
|
+
exports.FetchEventsPaginatedExchangeEnum = {
|
|
1784
|
+
Polymarket: 'polymarket',
|
|
1785
|
+
Kalshi: 'kalshi',
|
|
1786
|
+
KalshiDemo: 'kalshi-demo',
|
|
1787
|
+
Limitless: 'limitless',
|
|
1788
|
+
Probable: 'probable',
|
|
1789
|
+
Baozi: 'baozi',
|
|
1790
|
+
Myriad: 'myriad',
|
|
1791
|
+
Opinion: 'opinion',
|
|
1792
|
+
Metaculus: 'metaculus',
|
|
1793
|
+
Smarkets: 'smarkets',
|
|
1794
|
+
PolymarketUs: 'polymarket_us',
|
|
1795
|
+
Router: 'router'
|
|
1796
|
+
};
|
|
1743
1797
|
/**
|
|
1744
1798
|
* @export
|
|
1745
1799
|
*/
|
|
@@ -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 { PaginatedEventsResult } from './PaginatedEventsResult';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @interface FetchEventsPaginated200Response
|
|
18
|
+
*/
|
|
19
|
+
export interface FetchEventsPaginated200Response {
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @type {boolean}
|
|
23
|
+
* @memberof FetchEventsPaginated200Response
|
|
24
|
+
*/
|
|
25
|
+
success?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @type {ErrorDetail}
|
|
29
|
+
* @memberof FetchEventsPaginated200Response
|
|
30
|
+
*/
|
|
31
|
+
error?: ErrorDetail;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @type {PaginatedEventsResult}
|
|
35
|
+
* @memberof FetchEventsPaginated200Response
|
|
36
|
+
*/
|
|
37
|
+
data?: PaginatedEventsResult;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Check if a given object implements the FetchEventsPaginated200Response interface.
|
|
41
|
+
*/
|
|
42
|
+
export declare function instanceOfFetchEventsPaginated200Response(value: object): value is FetchEventsPaginated200Response;
|
|
43
|
+
export declare function FetchEventsPaginated200ResponseFromJSON(json: any): FetchEventsPaginated200Response;
|
|
44
|
+
export declare function FetchEventsPaginated200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FetchEventsPaginated200Response;
|
|
45
|
+
export declare function FetchEventsPaginated200ResponseToJSON(json: any): FetchEventsPaginated200Response;
|
|
46
|
+
export declare function FetchEventsPaginated200ResponseToJSONTyped(value?: FetchEventsPaginated200Response | null, ignoreDiscriminator?: boolean): any;
|