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
|
@@ -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
|
*/
|
|
@@ -305,11 +305,25 @@ export class ServerManager {
|
|
|
305
305
|
if (info && info.pid) {
|
|
306
306
|
try {
|
|
307
307
|
process.kill(info.pid, 'SIGTERM');
|
|
308
|
-
// Brief wait
|
|
309
308
|
await new Promise(resolve => setTimeout(resolve, 500));
|
|
310
309
|
}
|
|
311
310
|
catch {
|
|
312
|
-
//
|
|
311
|
+
// Process already dead — fall through to lock cleanup
|
|
312
|
+
}
|
|
313
|
+
// Verify the process is actually dead; escalate to SIGKILL if not
|
|
314
|
+
try {
|
|
315
|
+
process.kill(info.pid, 0); // throws if dead
|
|
316
|
+
// Still alive — force kill
|
|
317
|
+
try {
|
|
318
|
+
process.kill(info.pid, 'SIGKILL');
|
|
319
|
+
await new Promise(resolve => setTimeout(resolve, 200));
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
// Ignore — SIGKILL may race with natural exit
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
// Process is dead — good
|
|
313
327
|
}
|
|
314
328
|
}
|
|
315
329
|
// Remove lock file (best effort)
|
|
@@ -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;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* PMXT Sidecar API
|
|
6
|
+
* A unified local sidecar API for prediction markets (Polymarket, Kalshi, Limitless). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.4.4
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfFetchEventsPaginated200Response = instanceOfFetchEventsPaginated200Response;
|
|
17
|
+
exports.FetchEventsPaginated200ResponseFromJSON = FetchEventsPaginated200ResponseFromJSON;
|
|
18
|
+
exports.FetchEventsPaginated200ResponseFromJSONTyped = FetchEventsPaginated200ResponseFromJSONTyped;
|
|
19
|
+
exports.FetchEventsPaginated200ResponseToJSON = FetchEventsPaginated200ResponseToJSON;
|
|
20
|
+
exports.FetchEventsPaginated200ResponseToJSONTyped = FetchEventsPaginated200ResponseToJSONTyped;
|
|
21
|
+
const ErrorDetail_1 = require("./ErrorDetail");
|
|
22
|
+
const PaginatedEventsResult_1 = require("./PaginatedEventsResult");
|
|
23
|
+
/**
|
|
24
|
+
* Check if a given object implements the FetchEventsPaginated200Response interface.
|
|
25
|
+
*/
|
|
26
|
+
function instanceOfFetchEventsPaginated200Response(value) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
function FetchEventsPaginated200ResponseFromJSON(json) {
|
|
30
|
+
return FetchEventsPaginated200ResponseFromJSONTyped(json, false);
|
|
31
|
+
}
|
|
32
|
+
function FetchEventsPaginated200ResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
|
+
if (json == null) {
|
|
34
|
+
return json;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
'success': json['success'] == null ? undefined : json['success'],
|
|
38
|
+
'error': json['error'] == null ? undefined : (0, ErrorDetail_1.ErrorDetailFromJSON)(json['error']),
|
|
39
|
+
'data': json['data'] == null ? undefined : (0, PaginatedEventsResult_1.PaginatedEventsResultFromJSON)(json['data']),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function FetchEventsPaginated200ResponseToJSON(json) {
|
|
43
|
+
return FetchEventsPaginated200ResponseToJSONTyped(json, false);
|
|
44
|
+
}
|
|
45
|
+
function FetchEventsPaginated200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
46
|
+
if (value == null) {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
'success': value['success'],
|
|
51
|
+
'error': (0, ErrorDetail_1.ErrorDetailToJSON)(value['error']),
|
|
52
|
+
'data': (0, PaginatedEventsResult_1.PaginatedEventsResultToJSON)(value['data']),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -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';
|
|
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,57 @@
|
|
|
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.instanceOfPaginatedEventsResult = instanceOfPaginatedEventsResult;
|
|
17
|
+
exports.PaginatedEventsResultFromJSON = PaginatedEventsResultFromJSON;
|
|
18
|
+
exports.PaginatedEventsResultFromJSONTyped = PaginatedEventsResultFromJSONTyped;
|
|
19
|
+
exports.PaginatedEventsResultToJSON = PaginatedEventsResultToJSON;
|
|
20
|
+
exports.PaginatedEventsResultToJSONTyped = PaginatedEventsResultToJSONTyped;
|
|
21
|
+
const UnifiedEvent_1 = require("./UnifiedEvent");
|
|
22
|
+
/**
|
|
23
|
+
* Check if a given object implements the PaginatedEventsResult interface.
|
|
24
|
+
*/
|
|
25
|
+
function instanceOfPaginatedEventsResult(value) {
|
|
26
|
+
if (!('data' in value) || value['data'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
if (!('total' in value) || value['total'] === undefined)
|
|
29
|
+
return false;
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
function PaginatedEventsResultFromJSON(json) {
|
|
33
|
+
return PaginatedEventsResultFromJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
function PaginatedEventsResultFromJSONTyped(json, ignoreDiscriminator) {
|
|
36
|
+
if (json == null) {
|
|
37
|
+
return json;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
'data': (json['data'].map(UnifiedEvent_1.UnifiedEventFromJSON)),
|
|
41
|
+
'total': json['total'],
|
|
42
|
+
'nextCursor': json['nextCursor'] == null ? undefined : json['nextCursor'],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function PaginatedEventsResultToJSON(json) {
|
|
46
|
+
return PaginatedEventsResultToJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
function PaginatedEventsResultToJSONTyped(value, ignoreDiscriminator = false) {
|
|
49
|
+
if (value == null) {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
'data': (value['data'].map(UnifiedEvent_1.UnifiedEventToJSON)),
|
|
54
|
+
'total': value['total'],
|
|
55
|
+
'nextCursor': value['nextCursor'],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -29,6 +29,7 @@ export * from './FetchEvent200Response';
|
|
|
29
29
|
export * from './FetchEventMatches200Response';
|
|
30
30
|
export * from './FetchEventMatchesParams';
|
|
31
31
|
export * from './FetchEvents200Response';
|
|
32
|
+
export * from './FetchEventsPaginated200Response';
|
|
32
33
|
export * from './FetchMarket200Response';
|
|
33
34
|
export * from './FetchMarketMatches200Response';
|
|
34
35
|
export * from './FetchMarketMatchesParams';
|
|
@@ -69,6 +70,7 @@ export * from './Order';
|
|
|
69
70
|
export * from './OrderBook';
|
|
70
71
|
export * from './OrderHistoryParams';
|
|
71
72
|
export * from './OrderLevel';
|
|
73
|
+
export * from './PaginatedEventsResult';
|
|
72
74
|
export * from './PaginatedMarketsResult';
|
|
73
75
|
export * from './Position';
|
|
74
76
|
export * from './PriceCandle';
|
|
@@ -47,6 +47,7 @@ __exportStar(require("./FetchEvent200Response"), exports);
|
|
|
47
47
|
__exportStar(require("./FetchEventMatches200Response"), exports);
|
|
48
48
|
__exportStar(require("./FetchEventMatchesParams"), exports);
|
|
49
49
|
__exportStar(require("./FetchEvents200Response"), exports);
|
|
50
|
+
__exportStar(require("./FetchEventsPaginated200Response"), exports);
|
|
50
51
|
__exportStar(require("./FetchMarket200Response"), exports);
|
|
51
52
|
__exportStar(require("./FetchMarketMatches200Response"), exports);
|
|
52
53
|
__exportStar(require("./FetchMarketMatchesParams"), exports);
|
|
@@ -87,6 +88,7 @@ __exportStar(require("./Order"), exports);
|
|
|
87
88
|
__exportStar(require("./OrderBook"), exports);
|
|
88
89
|
__exportStar(require("./OrderHistoryParams"), exports);
|
|
89
90
|
__exportStar(require("./OrderLevel"), exports);
|
|
91
|
+
__exportStar(require("./PaginatedEventsResult"), exports);
|
|
90
92
|
__exportStar(require("./PaginatedMarketsResult"), exports);
|
|
91
93
|
__exportStar(require("./Position"), exports);
|
|
92
94
|
__exportStar(require("./PriceCandle"), exports);
|
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, 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
|
*
|