pmxtjs 2.34.2 → 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 +24 -1
- package/dist/esm/pmxt/client.js +418 -88
- package/dist/esm/pmxt/models.d.ts +11 -0
- package/dist/esm/pmxt/server-manager.js +16 -2
- 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 +24 -1
- package/dist/pmxt/client.js +418 -88
- package/dist/pmxt/models.d.ts +11 -0
- package/dist/pmxt/server-manager.js +16 -2
- 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 +394 -88
- package/pmxt/models.ts +14 -0
- package/pmxt/server-manager.ts +15 -2
|
@@ -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.
|
|
@@ -80,6 +80,22 @@ export declare abstract class Exchange {
|
|
|
80
80
|
protected handleResponse(response: any): any;
|
|
81
81
|
protected getCredentials(): ExchangeCredentials | undefined;
|
|
82
82
|
protected getAuthHeaders(): Record<string, string>;
|
|
83
|
+
/**
|
|
84
|
+
* Resolve the current sidecar base URL.
|
|
85
|
+
*
|
|
86
|
+
* For hosted mode the configured basePath is returned as-is.
|
|
87
|
+
* For local mode the port is re-read from the lock file on every
|
|
88
|
+
* call so we pick up sidecar restarts that land on a different port.
|
|
89
|
+
*/
|
|
90
|
+
private resolveBaseUrl;
|
|
91
|
+
/**
|
|
92
|
+
* Execute a fetch with retry on connection failures.
|
|
93
|
+
*
|
|
94
|
+
* Only retries on connection-level errors (ECONNREFUSED, ECONNRESET) —
|
|
95
|
+
* never on HTTP responses (4xx, 5xx). On first connection failure,
|
|
96
|
+
* attempts to restart the sidecar.
|
|
97
|
+
*/
|
|
98
|
+
private fetchWithRetry;
|
|
83
99
|
/**
|
|
84
100
|
* Call an exchange-specific REST endpoint by its operationId.
|
|
85
101
|
* This provides direct access to all implicit API methods defined in
|
|
@@ -120,6 +136,7 @@ export declare abstract class Exchange {
|
|
|
120
136
|
fetchMarkets(params?: any): Promise<UnifiedMarket[]>;
|
|
121
137
|
fetchMarketsPaginated(params?: any): Promise<PaginatedMarketsResult>;
|
|
122
138
|
fetchEvents(params?: any): Promise<UnifiedEvent[]>;
|
|
139
|
+
fetchEventsPaginated(params?: any): Promise<PaginatedEventsResult>;
|
|
123
140
|
fetchMarket(params?: any): Promise<UnifiedMarket>;
|
|
124
141
|
fetchEvent(params?: any): Promise<UnifiedEvent>;
|
|
125
142
|
fetchOrderBook(id: string): Promise<OrderBook>;
|
|
@@ -135,6 +152,12 @@ export declare abstract class Exchange {
|
|
|
135
152
|
unwatchOrderBook(id: string): Promise<void>;
|
|
136
153
|
unwatchAddress(address: string): Promise<void>;
|
|
137
154
|
close(): Promise<void>;
|
|
155
|
+
fetchMarketMatches(params: any): Promise<any[]>;
|
|
156
|
+
fetchMatches(params: any): Promise<any[]>;
|
|
157
|
+
fetchEventMatches(params: any): Promise<any[]>;
|
|
158
|
+
compareMarketPrices(params: any): Promise<any[]>;
|
|
159
|
+
fetchHedges(params: any): Promise<any[]>;
|
|
160
|
+
fetchArbitrage(params?: any): Promise<any[]>;
|
|
138
161
|
/**
|
|
139
162
|
* Get historical price candles.
|
|
140
163
|
*
|