pmxtjs 2.50.12 → 2.50.14
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 +8 -0
- package/dist/esm/generated/src/apis/DefaultApi.js +24 -0
- package/dist/esm/generated/src/models/EventFetchParams.d.ts +12 -0
- package/dist/esm/generated/src/models/EventFetchParams.js +4 -0
- package/dist/esm/generated/src/models/MarketFilterParams.d.ts +12 -0
- package/dist/esm/generated/src/models/MarketFilterParams.js +4 -0
- package/dist/esm/pmxt/client.d.ts +5 -0
- package/dist/esm/pmxt/client.js +48 -0
- package/dist/generated/src/apis/DefaultApi.d.ts +8 -0
- package/dist/generated/src/apis/DefaultApi.js +24 -0
- package/dist/generated/src/models/EventFetchParams.d.ts +12 -0
- package/dist/generated/src/models/EventFetchParams.js +4 -0
- package/dist/generated/src/models/MarketFilterParams.d.ts +12 -0
- package/dist/generated/src/models/MarketFilterParams.js +4 -0
- package/dist/pmxt/client.d.ts +5 -0
- package/dist/pmxt/client.js +48 -0
- package/generated/docs/DefaultApi.md +28 -4
- package/generated/docs/EventFetchParams.md +4 -0
- package/generated/docs/MarketFilterParams.md +4 -0
- package/generated/package.json +1 -1
- package/generated/src/apis/DefaultApi.ts +40 -0
- package/generated/src/models/EventFetchParams.ts +16 -0
- package/generated/src/models/MarketFilterParams.ts +16 -0
- package/package.json +2 -2
- package/pmxt/client.ts +53 -0
|
@@ -73,6 +73,8 @@ export interface FetchEventRequest {
|
|
|
73
73
|
filter?: EventFilterCriteria;
|
|
74
74
|
category?: string;
|
|
75
75
|
tags?: Array<string>;
|
|
76
|
+
sourceExchange?: string;
|
|
77
|
+
exchange2?: string;
|
|
76
78
|
}
|
|
77
79
|
export interface FetchEventMatchesRequest {
|
|
78
80
|
exchange: FetchEventMatchesExchangeEnum;
|
|
@@ -101,6 +103,8 @@ export interface FetchEventsRequest {
|
|
|
101
103
|
filter?: EventFilterCriteria;
|
|
102
104
|
category?: string;
|
|
103
105
|
tags?: Array<string>;
|
|
106
|
+
sourceExchange?: string;
|
|
107
|
+
exchange2?: string;
|
|
104
108
|
}
|
|
105
109
|
export interface FetchEventsPaginatedRequest {
|
|
106
110
|
exchange: FetchEventsPaginatedExchangeEnum;
|
|
@@ -137,6 +141,8 @@ export interface FetchMarketRequest {
|
|
|
137
141
|
eventId?: string;
|
|
138
142
|
page?: number;
|
|
139
143
|
similarityThreshold?: number;
|
|
144
|
+
sourceExchange?: string;
|
|
145
|
+
exchange2?: string;
|
|
140
146
|
}
|
|
141
147
|
export interface FetchMarketMatchesRequest {
|
|
142
148
|
exchange: FetchMarketMatchesExchangeEnum;
|
|
@@ -167,6 +173,8 @@ export interface FetchMarketsRequest {
|
|
|
167
173
|
eventId?: string;
|
|
168
174
|
page?: number;
|
|
169
175
|
similarityThreshold?: number;
|
|
176
|
+
sourceExchange?: string;
|
|
177
|
+
exchange2?: string;
|
|
170
178
|
}
|
|
171
179
|
export interface FetchMarketsPaginatedRequest {
|
|
172
180
|
exchange: FetchMarketsPaginatedExchangeEnum;
|
|
@@ -368,6 +368,12 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
368
368
|
if (requestParameters['tags'] != null) {
|
|
369
369
|
queryParameters['tags'] = requestParameters['tags'];
|
|
370
370
|
}
|
|
371
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
372
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
373
|
+
}
|
|
374
|
+
if (requestParameters['exchange2'] != null) {
|
|
375
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
376
|
+
}
|
|
371
377
|
const headerParameters = {};
|
|
372
378
|
let urlPath = `/api/{exchange}/fetchEvent`;
|
|
373
379
|
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
@@ -490,6 +496,12 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
490
496
|
if (requestParameters['tags'] != null) {
|
|
491
497
|
queryParameters['tags'] = requestParameters['tags'];
|
|
492
498
|
}
|
|
499
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
500
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
501
|
+
}
|
|
502
|
+
if (requestParameters['exchange2'] != null) {
|
|
503
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
504
|
+
}
|
|
493
505
|
const headerParameters = {};
|
|
494
506
|
let urlPath = `/api/{exchange}/fetchEvents`;
|
|
495
507
|
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
@@ -655,6 +667,12 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
655
667
|
if (requestParameters['similarityThreshold'] != null) {
|
|
656
668
|
queryParameters['similarityThreshold'] = requestParameters['similarityThreshold'];
|
|
657
669
|
}
|
|
670
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
671
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
672
|
+
}
|
|
673
|
+
if (requestParameters['exchange2'] != null) {
|
|
674
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
675
|
+
}
|
|
658
676
|
const headerParameters = {};
|
|
659
677
|
let urlPath = `/api/{exchange}/fetchMarket`;
|
|
660
678
|
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
@@ -783,6 +801,12 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
783
801
|
if (requestParameters['similarityThreshold'] != null) {
|
|
784
802
|
queryParameters['similarityThreshold'] = requestParameters['similarityThreshold'];
|
|
785
803
|
}
|
|
804
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
805
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
806
|
+
}
|
|
807
|
+
if (requestParameters['exchange2'] != null) {
|
|
808
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
809
|
+
}
|
|
786
810
|
const headerParameters = {};
|
|
787
811
|
let urlPath = `/api/{exchange}/fetchMarkets`;
|
|
788
812
|
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
@@ -94,6 +94,18 @@ export interface EventFetchParams {
|
|
|
94
94
|
* @memberof EventFetchParams
|
|
95
95
|
*/
|
|
96
96
|
tags?: Array<string>;
|
|
97
|
+
/**
|
|
98
|
+
* Filter by source venue (e.g. 'polymarket', 'kalshi', 'myriad'). `exchange` is an alias.
|
|
99
|
+
* @type {string}
|
|
100
|
+
* @memberof EventFetchParams
|
|
101
|
+
*/
|
|
102
|
+
sourceExchange?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Alias for `sourceExchange`.
|
|
105
|
+
* @type {string}
|
|
106
|
+
* @memberof EventFetchParams
|
|
107
|
+
*/
|
|
108
|
+
exchange?: string;
|
|
97
109
|
}
|
|
98
110
|
/**
|
|
99
111
|
* @export
|
|
@@ -64,6 +64,8 @@ export function EventFetchParamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
64
64
|
'filter': json['filter'] == null ? undefined : EventFilterCriteriaFromJSON(json['filter']),
|
|
65
65
|
'category': json['category'] == null ? undefined : json['category'],
|
|
66
66
|
'tags': json['tags'] == null ? undefined : json['tags'],
|
|
67
|
+
'sourceExchange': json['sourceExchange'] == null ? undefined : json['sourceExchange'],
|
|
68
|
+
'exchange': json['exchange'] == null ? undefined : json['exchange'],
|
|
67
69
|
};
|
|
68
70
|
}
|
|
69
71
|
export function EventFetchParamsToJSON(json) {
|
|
@@ -87,5 +89,7 @@ export function EventFetchParamsToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
87
89
|
'filter': EventFilterCriteriaToJSON(value['filter']),
|
|
88
90
|
'category': value['category'],
|
|
89
91
|
'tags': value['tags'],
|
|
92
|
+
'sourceExchange': value['sourceExchange'],
|
|
93
|
+
'exchange': value['exchange'],
|
|
90
94
|
};
|
|
91
95
|
}
|
|
@@ -87,6 +87,18 @@ export interface MarketFilterParams {
|
|
|
87
87
|
* @memberof MarketFilterParams
|
|
88
88
|
*/
|
|
89
89
|
similarityThreshold?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Filter by source venue (e.g. 'polymarket', 'kalshi', 'myriad'). `exchange` is an alias.
|
|
92
|
+
* @type {string}
|
|
93
|
+
* @memberof MarketFilterParams
|
|
94
|
+
*/
|
|
95
|
+
sourceExchange?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Alias for `sourceExchange`.
|
|
98
|
+
* @type {string}
|
|
99
|
+
* @memberof MarketFilterParams
|
|
100
|
+
*/
|
|
101
|
+
exchange?: string;
|
|
90
102
|
}
|
|
91
103
|
/**
|
|
92
104
|
* @export
|
|
@@ -62,6 +62,8 @@ export function MarketFilterParamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
62
62
|
'eventId': json['eventId'] == null ? undefined : json['eventId'],
|
|
63
63
|
'page': json['page'] == null ? undefined : json['page'],
|
|
64
64
|
'similarityThreshold': json['similarityThreshold'] == null ? undefined : json['similarityThreshold'],
|
|
65
|
+
'sourceExchange': json['sourceExchange'] == null ? undefined : json['sourceExchange'],
|
|
66
|
+
'exchange': json['exchange'] == null ? undefined : json['exchange'],
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
69
|
export function MarketFilterParamsToJSON(json) {
|
|
@@ -84,5 +86,7 @@ export function MarketFilterParamsToJSONTyped(value, ignoreDiscriminator = false
|
|
|
84
86
|
'eventId': value['eventId'],
|
|
85
87
|
'page': value['page'],
|
|
86
88
|
'similarityThreshold': value['similarityThreshold'],
|
|
89
|
+
'sourceExchange': value['sourceExchange'],
|
|
90
|
+
'exchange': value['exchange'],
|
|
87
91
|
};
|
|
88
92
|
}
|
|
@@ -449,6 +449,11 @@ export declare abstract class Exchange {
|
|
|
449
449
|
* pull-leg route name for Opinion sells and Limitless cross-chain orders.
|
|
450
450
|
*/
|
|
451
451
|
private _hostedTypedDataRoute;
|
|
452
|
+
/**
|
|
453
|
+
* Hosted-mode cancelOrder: build → sign → cancel single-call wrapper.
|
|
454
|
+
* Mirrors the Python SDK's `_hosted_cancel_order`.
|
|
455
|
+
*/
|
|
456
|
+
private _hostedCancelOrder;
|
|
452
457
|
private _hostedCancelTypedDataRoute;
|
|
453
458
|
/**
|
|
454
459
|
* Construct the hosted build-order request body and validate inputs
|
package/dist/esm/pmxt/client.js
CHANGED
|
@@ -952,6 +952,9 @@ export class Exchange {
|
|
|
952
952
|
}
|
|
953
953
|
async cancelOrder(orderId) {
|
|
954
954
|
await this.initPromise;
|
|
955
|
+
if (this.isHosted) {
|
|
956
|
+
return this._hostedCancelOrder(orderId);
|
|
957
|
+
}
|
|
955
958
|
try {
|
|
956
959
|
const args = [];
|
|
957
960
|
args.push(orderId);
|
|
@@ -2110,6 +2113,51 @@ export class Exchange {
|
|
|
2110
2113
|
return "opinion_buy";
|
|
2111
2114
|
return isPull ? "opinion_sell_bsc_pull" : "opinion_sell_polygon";
|
|
2112
2115
|
}
|
|
2116
|
+
/**
|
|
2117
|
+
* Hosted-mode cancelOrder: build → sign → cancel single-call wrapper.
|
|
2118
|
+
* Mirrors the Python SDK's `_hosted_cancel_order`.
|
|
2119
|
+
*/
|
|
2120
|
+
async _hostedCancelOrder(orderId) {
|
|
2121
|
+
const signer = this.requireHostedSigner();
|
|
2122
|
+
if (!this.walletAddress) {
|
|
2123
|
+
throw new MissingWalletAddress("hosted cancelOrder requires walletAddress");
|
|
2124
|
+
}
|
|
2125
|
+
const buildRequest = { order_id: orderId, user_address: this.walletAddress };
|
|
2126
|
+
const buildRoute = HOSTED_METHOD_ROUTES.get("cancelOrderBuild");
|
|
2127
|
+
const buildPayload = await _tradingRequest(this, {
|
|
2128
|
+
method: buildRoute.method,
|
|
2129
|
+
path: buildRoute.path,
|
|
2130
|
+
body: buildRequest,
|
|
2131
|
+
});
|
|
2132
|
+
const typedData = buildPayload["typed_data"];
|
|
2133
|
+
if (!typedData) {
|
|
2134
|
+
throw new HostedInvalidSignature(0, "typed_data missing from hosted cancel build response");
|
|
2135
|
+
}
|
|
2136
|
+
const primaryRoute = this._hostedCancelTypedDataRoute(false);
|
|
2137
|
+
validateTypedData(typedData, primaryRoute, this.walletAddress);
|
|
2138
|
+
const signature = await signer.signTypedData(typedData);
|
|
2139
|
+
verifySignature(typedData, signature, signer.address);
|
|
2140
|
+
const cancelId = buildPayload["cancel_id"];
|
|
2141
|
+
if (!cancelId) {
|
|
2142
|
+
throw new HostedInvalidSignature(0, "cancel_id missing from hosted cancel build response");
|
|
2143
|
+
}
|
|
2144
|
+
const body = { cancel_id: cancelId, signature };
|
|
2145
|
+
const pullTypedData = buildPayload["pull_typed_data"];
|
|
2146
|
+
if (pullTypedData) {
|
|
2147
|
+
const pullRoute = this._hostedCancelTypedDataRoute(true);
|
|
2148
|
+
validateTypedData(pullTypedData, pullRoute, this.walletAddress);
|
|
2149
|
+
const pullSig = await signer.signTypedData(pullTypedData);
|
|
2150
|
+
verifySignature(pullTypedData, pullSig, signer.address);
|
|
2151
|
+
body["pull_signature"] = pullSig;
|
|
2152
|
+
}
|
|
2153
|
+
const cancelRoute = HOSTED_METHOD_ROUTES.get("cancelOrder");
|
|
2154
|
+
const data = await _tradingRequest(this, {
|
|
2155
|
+
method: cancelRoute.method,
|
|
2156
|
+
path: cancelRoute.path,
|
|
2157
|
+
body,
|
|
2158
|
+
});
|
|
2159
|
+
return orderFromV0(data);
|
|
2160
|
+
}
|
|
2113
2161
|
_hostedCancelTypedDataRoute(isPull) {
|
|
2114
2162
|
const venue = this.exchangeName;
|
|
2115
2163
|
if (venue === "polymarket")
|
|
@@ -73,6 +73,8 @@ export interface FetchEventRequest {
|
|
|
73
73
|
filter?: EventFilterCriteria;
|
|
74
74
|
category?: string;
|
|
75
75
|
tags?: Array<string>;
|
|
76
|
+
sourceExchange?: string;
|
|
77
|
+
exchange2?: string;
|
|
76
78
|
}
|
|
77
79
|
export interface FetchEventMatchesRequest {
|
|
78
80
|
exchange: FetchEventMatchesExchangeEnum;
|
|
@@ -101,6 +103,8 @@ export interface FetchEventsRequest {
|
|
|
101
103
|
filter?: EventFilterCriteria;
|
|
102
104
|
category?: string;
|
|
103
105
|
tags?: Array<string>;
|
|
106
|
+
sourceExchange?: string;
|
|
107
|
+
exchange2?: string;
|
|
104
108
|
}
|
|
105
109
|
export interface FetchEventsPaginatedRequest {
|
|
106
110
|
exchange: FetchEventsPaginatedExchangeEnum;
|
|
@@ -137,6 +141,8 @@ export interface FetchMarketRequest {
|
|
|
137
141
|
eventId?: string;
|
|
138
142
|
page?: number;
|
|
139
143
|
similarityThreshold?: number;
|
|
144
|
+
sourceExchange?: string;
|
|
145
|
+
exchange2?: string;
|
|
140
146
|
}
|
|
141
147
|
export interface FetchMarketMatchesRequest {
|
|
142
148
|
exchange: FetchMarketMatchesExchangeEnum;
|
|
@@ -167,6 +173,8 @@ export interface FetchMarketsRequest {
|
|
|
167
173
|
eventId?: string;
|
|
168
174
|
page?: number;
|
|
169
175
|
similarityThreshold?: number;
|
|
176
|
+
sourceExchange?: string;
|
|
177
|
+
exchange2?: string;
|
|
170
178
|
}
|
|
171
179
|
export interface FetchMarketsPaginatedRequest {
|
|
172
180
|
exchange: FetchMarketsPaginatedExchangeEnum;
|
|
@@ -405,6 +405,12 @@ class DefaultApi extends runtime.BaseAPI {
|
|
|
405
405
|
if (requestParameters['tags'] != null) {
|
|
406
406
|
queryParameters['tags'] = requestParameters['tags'];
|
|
407
407
|
}
|
|
408
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
409
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
410
|
+
}
|
|
411
|
+
if (requestParameters['exchange2'] != null) {
|
|
412
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
413
|
+
}
|
|
408
414
|
const headerParameters = {};
|
|
409
415
|
let urlPath = `/api/{exchange}/fetchEvent`;
|
|
410
416
|
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
@@ -527,6 +533,12 @@ class DefaultApi extends runtime.BaseAPI {
|
|
|
527
533
|
if (requestParameters['tags'] != null) {
|
|
528
534
|
queryParameters['tags'] = requestParameters['tags'];
|
|
529
535
|
}
|
|
536
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
537
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
538
|
+
}
|
|
539
|
+
if (requestParameters['exchange2'] != null) {
|
|
540
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
541
|
+
}
|
|
530
542
|
const headerParameters = {};
|
|
531
543
|
let urlPath = `/api/{exchange}/fetchEvents`;
|
|
532
544
|
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
@@ -692,6 +704,12 @@ class DefaultApi extends runtime.BaseAPI {
|
|
|
692
704
|
if (requestParameters['similarityThreshold'] != null) {
|
|
693
705
|
queryParameters['similarityThreshold'] = requestParameters['similarityThreshold'];
|
|
694
706
|
}
|
|
707
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
708
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
709
|
+
}
|
|
710
|
+
if (requestParameters['exchange2'] != null) {
|
|
711
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
712
|
+
}
|
|
695
713
|
const headerParameters = {};
|
|
696
714
|
let urlPath = `/api/{exchange}/fetchMarket`;
|
|
697
715
|
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
@@ -820,6 +838,12 @@ class DefaultApi extends runtime.BaseAPI {
|
|
|
820
838
|
if (requestParameters['similarityThreshold'] != null) {
|
|
821
839
|
queryParameters['similarityThreshold'] = requestParameters['similarityThreshold'];
|
|
822
840
|
}
|
|
841
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
842
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
843
|
+
}
|
|
844
|
+
if (requestParameters['exchange2'] != null) {
|
|
845
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
846
|
+
}
|
|
823
847
|
const headerParameters = {};
|
|
824
848
|
let urlPath = `/api/{exchange}/fetchMarkets`;
|
|
825
849
|
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
@@ -94,6 +94,18 @@ export interface EventFetchParams {
|
|
|
94
94
|
* @memberof EventFetchParams
|
|
95
95
|
*/
|
|
96
96
|
tags?: Array<string>;
|
|
97
|
+
/**
|
|
98
|
+
* Filter by source venue (e.g. 'polymarket', 'kalshi', 'myriad'). `exchange` is an alias.
|
|
99
|
+
* @type {string}
|
|
100
|
+
* @memberof EventFetchParams
|
|
101
|
+
*/
|
|
102
|
+
sourceExchange?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Alias for `sourceExchange`.
|
|
105
|
+
* @type {string}
|
|
106
|
+
* @memberof EventFetchParams
|
|
107
|
+
*/
|
|
108
|
+
exchange?: string;
|
|
97
109
|
}
|
|
98
110
|
/**
|
|
99
111
|
* @export
|
|
@@ -72,6 +72,8 @@ function EventFetchParamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
72
72
|
'filter': json['filter'] == null ? undefined : (0, EventFilterCriteria_1.EventFilterCriteriaFromJSON)(json['filter']),
|
|
73
73
|
'category': json['category'] == null ? undefined : json['category'],
|
|
74
74
|
'tags': json['tags'] == null ? undefined : json['tags'],
|
|
75
|
+
'sourceExchange': json['sourceExchange'] == null ? undefined : json['sourceExchange'],
|
|
76
|
+
'exchange': json['exchange'] == null ? undefined : json['exchange'],
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
79
|
function EventFetchParamsToJSON(json) {
|
|
@@ -95,5 +97,7 @@ function EventFetchParamsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
95
97
|
'filter': (0, EventFilterCriteria_1.EventFilterCriteriaToJSON)(value['filter']),
|
|
96
98
|
'category': value['category'],
|
|
97
99
|
'tags': value['tags'],
|
|
100
|
+
'sourceExchange': value['sourceExchange'],
|
|
101
|
+
'exchange': value['exchange'],
|
|
98
102
|
};
|
|
99
103
|
}
|
|
@@ -87,6 +87,18 @@ export interface MarketFilterParams {
|
|
|
87
87
|
* @memberof MarketFilterParams
|
|
88
88
|
*/
|
|
89
89
|
similarityThreshold?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Filter by source venue (e.g. 'polymarket', 'kalshi', 'myriad'). `exchange` is an alias.
|
|
92
|
+
* @type {string}
|
|
93
|
+
* @memberof MarketFilterParams
|
|
94
|
+
*/
|
|
95
|
+
sourceExchange?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Alias for `sourceExchange`.
|
|
98
|
+
* @type {string}
|
|
99
|
+
* @memberof MarketFilterParams
|
|
100
|
+
*/
|
|
101
|
+
exchange?: string;
|
|
90
102
|
}
|
|
91
103
|
/**
|
|
92
104
|
* @export
|
|
@@ -70,6 +70,8 @@ function MarketFilterParamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
70
70
|
'eventId': json['eventId'] == null ? undefined : json['eventId'],
|
|
71
71
|
'page': json['page'] == null ? undefined : json['page'],
|
|
72
72
|
'similarityThreshold': json['similarityThreshold'] == null ? undefined : json['similarityThreshold'],
|
|
73
|
+
'sourceExchange': json['sourceExchange'] == null ? undefined : json['sourceExchange'],
|
|
74
|
+
'exchange': json['exchange'] == null ? undefined : json['exchange'],
|
|
73
75
|
};
|
|
74
76
|
}
|
|
75
77
|
function MarketFilterParamsToJSON(json) {
|
|
@@ -92,5 +94,7 @@ function MarketFilterParamsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
92
94
|
'eventId': value['eventId'],
|
|
93
95
|
'page': value['page'],
|
|
94
96
|
'similarityThreshold': value['similarityThreshold'],
|
|
97
|
+
'sourceExchange': value['sourceExchange'],
|
|
98
|
+
'exchange': value['exchange'],
|
|
95
99
|
};
|
|
96
100
|
}
|
package/dist/pmxt/client.d.ts
CHANGED
|
@@ -449,6 +449,11 @@ export declare abstract class Exchange {
|
|
|
449
449
|
* pull-leg route name for Opinion sells and Limitless cross-chain orders.
|
|
450
450
|
*/
|
|
451
451
|
private _hostedTypedDataRoute;
|
|
452
|
+
/**
|
|
453
|
+
* Hosted-mode cancelOrder: build → sign → cancel single-call wrapper.
|
|
454
|
+
* Mirrors the Python SDK's `_hosted_cancel_order`.
|
|
455
|
+
*/
|
|
456
|
+
private _hostedCancelOrder;
|
|
452
457
|
private _hostedCancelTypedDataRoute;
|
|
453
458
|
/**
|
|
454
459
|
* Construct the hosted build-order request body and validate inputs
|
package/dist/pmxt/client.js
CHANGED
|
@@ -955,6 +955,9 @@ class Exchange {
|
|
|
955
955
|
}
|
|
956
956
|
async cancelOrder(orderId) {
|
|
957
957
|
await this.initPromise;
|
|
958
|
+
if (this.isHosted) {
|
|
959
|
+
return this._hostedCancelOrder(orderId);
|
|
960
|
+
}
|
|
958
961
|
try {
|
|
959
962
|
const args = [];
|
|
960
963
|
args.push(orderId);
|
|
@@ -2113,6 +2116,51 @@ class Exchange {
|
|
|
2113
2116
|
return "opinion_buy";
|
|
2114
2117
|
return isPull ? "opinion_sell_bsc_pull" : "opinion_sell_polygon";
|
|
2115
2118
|
}
|
|
2119
|
+
/**
|
|
2120
|
+
* Hosted-mode cancelOrder: build → sign → cancel single-call wrapper.
|
|
2121
|
+
* Mirrors the Python SDK's `_hosted_cancel_order`.
|
|
2122
|
+
*/
|
|
2123
|
+
async _hostedCancelOrder(orderId) {
|
|
2124
|
+
const signer = this.requireHostedSigner();
|
|
2125
|
+
if (!this.walletAddress) {
|
|
2126
|
+
throw new hosted_errors_js_1.MissingWalletAddress("hosted cancelOrder requires walletAddress");
|
|
2127
|
+
}
|
|
2128
|
+
const buildRequest = { order_id: orderId, user_address: this.walletAddress };
|
|
2129
|
+
const buildRoute = hosted_routing_js_1.HOSTED_METHOD_ROUTES.get("cancelOrderBuild");
|
|
2130
|
+
const buildPayload = await (0, hosted_routing_js_1._tradingRequest)(this, {
|
|
2131
|
+
method: buildRoute.method,
|
|
2132
|
+
path: buildRoute.path,
|
|
2133
|
+
body: buildRequest,
|
|
2134
|
+
});
|
|
2135
|
+
const typedData = buildPayload["typed_data"];
|
|
2136
|
+
if (!typedData) {
|
|
2137
|
+
throw new hosted_errors_js_1.InvalidSignature(0, "typed_data missing from hosted cancel build response");
|
|
2138
|
+
}
|
|
2139
|
+
const primaryRoute = this._hostedCancelTypedDataRoute(false);
|
|
2140
|
+
(0, hosted_typed_data_js_1.validateTypedData)(typedData, primaryRoute, this.walletAddress);
|
|
2141
|
+
const signature = await signer.signTypedData(typedData);
|
|
2142
|
+
(0, hosted_typed_data_js_1.verifySignature)(typedData, signature, signer.address);
|
|
2143
|
+
const cancelId = buildPayload["cancel_id"];
|
|
2144
|
+
if (!cancelId) {
|
|
2145
|
+
throw new hosted_errors_js_1.InvalidSignature(0, "cancel_id missing from hosted cancel build response");
|
|
2146
|
+
}
|
|
2147
|
+
const body = { cancel_id: cancelId, signature };
|
|
2148
|
+
const pullTypedData = buildPayload["pull_typed_data"];
|
|
2149
|
+
if (pullTypedData) {
|
|
2150
|
+
const pullRoute = this._hostedCancelTypedDataRoute(true);
|
|
2151
|
+
(0, hosted_typed_data_js_1.validateTypedData)(pullTypedData, pullRoute, this.walletAddress);
|
|
2152
|
+
const pullSig = await signer.signTypedData(pullTypedData);
|
|
2153
|
+
(0, hosted_typed_data_js_1.verifySignature)(pullTypedData, pullSig, signer.address);
|
|
2154
|
+
body["pull_signature"] = pullSig;
|
|
2155
|
+
}
|
|
2156
|
+
const cancelRoute = hosted_routing_js_1.HOSTED_METHOD_ROUTES.get("cancelOrder");
|
|
2157
|
+
const data = await (0, hosted_routing_js_1._tradingRequest)(this, {
|
|
2158
|
+
method: cancelRoute.method,
|
|
2159
|
+
path: cancelRoute.path,
|
|
2160
|
+
body,
|
|
2161
|
+
});
|
|
2162
|
+
return (0, hosted_mappers_js_1.orderFromV0)(data);
|
|
2163
|
+
}
|
|
2116
2164
|
_hostedCancelTypedDataRoute(isPull) {
|
|
2117
2165
|
const venue = this.exchangeName;
|
|
2118
2166
|
if (venue === "polymarket")
|
|
@@ -703,7 +703,7 @@ No authorization required
|
|
|
703
703
|
|
|
704
704
|
## fetchEvent
|
|
705
705
|
|
|
706
|
-
> FetchEvent200Response fetchEvent(exchange, query, limit, cursor, offset, sort, status, searchIn, eventId, slug, series, filter, category, tags)
|
|
706
|
+
> FetchEvent200Response fetchEvent(exchange, query, limit, cursor, offset, sort, status, searchIn, eventId, slug, series, filter, category, tags, sourceExchange, exchange2)
|
|
707
707
|
|
|
708
708
|
Fetch Event
|
|
709
709
|
|
|
@@ -751,6 +751,10 @@ async function example() {
|
|
|
751
751
|
category: category_example,
|
|
752
752
|
// Array<string> | Filter by tags. Returns events matching ANY of the provided tags. Tags are more specific than categories -- for example a \"Politics\" event might carry tags [\"Politics\", \"Geopolitics\", \"Middle East\", \"Iran\"]. Common tags include \"Crypto\", \"Elections\", \"Fed Rates\", \"FIFA World Cup\", \"Trump\". (optional)
|
|
753
753
|
tags: ...,
|
|
754
|
+
// string | Filter by source venue (e.g. \'polymarket\', \'kalshi\', \'myriad\'). `exchange` is an alias. (optional)
|
|
755
|
+
sourceExchange: sourceExchange_example,
|
|
756
|
+
// string | Alias for `sourceExchange`. (optional)
|
|
757
|
+
exchange2: exchange_example,
|
|
754
758
|
} satisfies FetchEventRequest;
|
|
755
759
|
|
|
756
760
|
try {
|
|
@@ -784,6 +788,8 @@ example().catch(console.error);
|
|
|
784
788
|
| **filter** | [](.md) | Optional client-side filter applied after fetching | [Optional] [Defaults to `undefined`] |
|
|
785
789
|
| **category** | `string` | Filter by category. Each event belongs to a venue-assigned category such as \"Sports\", \"Politics\", \"Crypto\", \"Bitcoin\", \"Soccer\", \"Economic Policy\" (Polymarket) or \"Sports\", \"Mentions\" (Kalshi). | [Optional] [Defaults to `undefined`] |
|
|
786
790
|
| **tags** | `Array<string>` | Filter by tags. Returns events matching ANY of the provided tags. Tags are more specific than categories -- for example a \"Politics\" event might carry tags [\"Politics\", \"Geopolitics\", \"Middle East\", \"Iran\"]. Common tags include \"Crypto\", \"Elections\", \"Fed Rates\", \"FIFA World Cup\", \"Trump\". | [Optional] |
|
|
791
|
+
| **sourceExchange** | `string` | Filter by source venue (e.g. \'polymarket\', \'kalshi\', \'myriad\'). `exchange` is an alias. | [Optional] [Defaults to `undefined`] |
|
|
792
|
+
| **exchange2** | `string` | Alias for `sourceExchange`. | [Optional] [Defaults to `undefined`] |
|
|
787
793
|
|
|
788
794
|
### Return type
|
|
789
795
|
|
|
@@ -903,7 +909,7 @@ No authorization required
|
|
|
903
909
|
|
|
904
910
|
## fetchEvents
|
|
905
911
|
|
|
906
|
-
> FetchEvents200Response fetchEvents(exchange, query, limit, cursor, offset, sort, status, searchIn, eventId, slug, series, filter, category, tags)
|
|
912
|
+
> FetchEvents200Response fetchEvents(exchange, query, limit, cursor, offset, sort, status, searchIn, eventId, slug, series, filter, category, tags, sourceExchange, exchange2)
|
|
907
913
|
|
|
908
914
|
Fetch Events
|
|
909
915
|
|
|
@@ -951,6 +957,10 @@ async function example() {
|
|
|
951
957
|
category: category_example,
|
|
952
958
|
// Array<string> | Filter by tags. Returns events matching ANY of the provided tags. Tags are more specific than categories -- for example a \"Politics\" event might carry tags [\"Politics\", \"Geopolitics\", \"Middle East\", \"Iran\"]. Common tags include \"Crypto\", \"Elections\", \"Fed Rates\", \"FIFA World Cup\", \"Trump\". (optional)
|
|
953
959
|
tags: ...,
|
|
960
|
+
// string | Filter by source venue (e.g. \'polymarket\', \'kalshi\', \'myriad\'). `exchange` is an alias. (optional)
|
|
961
|
+
sourceExchange: sourceExchange_example,
|
|
962
|
+
// string | Alias for `sourceExchange`. (optional)
|
|
963
|
+
exchange2: exchange_example,
|
|
954
964
|
} satisfies FetchEventsRequest;
|
|
955
965
|
|
|
956
966
|
try {
|
|
@@ -984,6 +994,8 @@ example().catch(console.error);
|
|
|
984
994
|
| **filter** | [](.md) | Optional client-side filter applied after fetching | [Optional] [Defaults to `undefined`] |
|
|
985
995
|
| **category** | `string` | Filter by category. Each event belongs to a venue-assigned category such as \"Sports\", \"Politics\", \"Crypto\", \"Bitcoin\", \"Soccer\", \"Economic Policy\" (Polymarket) or \"Sports\", \"Mentions\" (Kalshi). | [Optional] [Defaults to `undefined`] |
|
|
986
996
|
| **tags** | `Array<string>` | Filter by tags. Returns events matching ANY of the provided tags. Tags are more specific than categories -- for example a \"Politics\" event might carry tags [\"Politics\", \"Geopolitics\", \"Middle East\", \"Iran\"]. Common tags include \"Crypto\", \"Elections\", \"Fed Rates\", \"FIFA World Cup\", \"Trump\". | [Optional] |
|
|
997
|
+
| **sourceExchange** | `string` | Filter by source venue (e.g. \'polymarket\', \'kalshi\', \'myriad\'). `exchange` is an alias. | [Optional] [Defaults to `undefined`] |
|
|
998
|
+
| **exchange2** | `string` | Alias for `sourceExchange`. | [Optional] [Defaults to `undefined`] |
|
|
987
999
|
|
|
988
1000
|
### Return type
|
|
989
1001
|
|
|
@@ -1186,7 +1198,7 @@ No authorization required
|
|
|
1186
1198
|
|
|
1187
1199
|
## fetchMarket
|
|
1188
1200
|
|
|
1189
|
-
> FetchMarket200Response fetchMarket(exchange, limit, offset, sort, status, searchIn, query, slug, marketId, outcomeId, eventId, page, similarityThreshold)
|
|
1201
|
+
> FetchMarket200Response fetchMarket(exchange, limit, offset, sort, status, searchIn, query, slug, marketId, outcomeId, eventId, page, similarityThreshold, sourceExchange, exchange2)
|
|
1190
1202
|
|
|
1191
1203
|
Fetch Market
|
|
1192
1204
|
|
|
@@ -1232,6 +1244,10 @@ async function example() {
|
|
|
1232
1244
|
page: 8.14,
|
|
1233
1245
|
// number | For semantic search (used by Limitless) (optional)
|
|
1234
1246
|
similarityThreshold: 8.14,
|
|
1247
|
+
// string | Filter by source venue (e.g. \'polymarket\', \'kalshi\', \'myriad\'). `exchange` is an alias. (optional)
|
|
1248
|
+
sourceExchange: sourceExchange_example,
|
|
1249
|
+
// string | Alias for `sourceExchange`. (optional)
|
|
1250
|
+
exchange2: exchange_example,
|
|
1235
1251
|
} satisfies FetchMarketRequest;
|
|
1236
1252
|
|
|
1237
1253
|
try {
|
|
@@ -1264,6 +1280,8 @@ example().catch(console.error);
|
|
|
1264
1280
|
| **eventId** | `string` | Find markets belonging to an event | [Optional] [Defaults to `undefined`] |
|
|
1265
1281
|
| **page** | `number` | For pagination (used by Limitless) | [Optional] [Defaults to `undefined`] |
|
|
1266
1282
|
| **similarityThreshold** | `number` | For semantic search (used by Limitless) | [Optional] [Defaults to `undefined`] |
|
|
1283
|
+
| **sourceExchange** | `string` | Filter by source venue (e.g. \'polymarket\', \'kalshi\', \'myriad\'). `exchange` is an alias. | [Optional] [Defaults to `undefined`] |
|
|
1284
|
+
| **exchange2** | `string` | Alias for `sourceExchange`. | [Optional] [Defaults to `undefined`] |
|
|
1267
1285
|
|
|
1268
1286
|
### Return type
|
|
1269
1287
|
|
|
@@ -1392,7 +1410,7 @@ No authorization required
|
|
|
1392
1410
|
|
|
1393
1411
|
## fetchMarkets
|
|
1394
1412
|
|
|
1395
|
-
> FetchMarkets200Response fetchMarkets(exchange, limit, offset, sort, status, searchIn, query, slug, marketId, outcomeId, eventId, page, similarityThreshold)
|
|
1413
|
+
> FetchMarkets200Response fetchMarkets(exchange, limit, offset, sort, status, searchIn, query, slug, marketId, outcomeId, eventId, page, similarityThreshold, sourceExchange, exchange2)
|
|
1396
1414
|
|
|
1397
1415
|
Fetch Markets
|
|
1398
1416
|
|
|
@@ -1438,6 +1456,10 @@ async function example() {
|
|
|
1438
1456
|
page: 8.14,
|
|
1439
1457
|
// number | For semantic search (used by Limitless) (optional)
|
|
1440
1458
|
similarityThreshold: 8.14,
|
|
1459
|
+
// string | Filter by source venue (e.g. \'polymarket\', \'kalshi\', \'myriad\'). `exchange` is an alias. (optional)
|
|
1460
|
+
sourceExchange: sourceExchange_example,
|
|
1461
|
+
// string | Alias for `sourceExchange`. (optional)
|
|
1462
|
+
exchange2: exchange_example,
|
|
1441
1463
|
} satisfies FetchMarketsRequest;
|
|
1442
1464
|
|
|
1443
1465
|
try {
|
|
@@ -1470,6 +1492,8 @@ example().catch(console.error);
|
|
|
1470
1492
|
| **eventId** | `string` | Find markets belonging to an event | [Optional] [Defaults to `undefined`] |
|
|
1471
1493
|
| **page** | `number` | For pagination (used by Limitless) | [Optional] [Defaults to `undefined`] |
|
|
1472
1494
|
| **similarityThreshold** | `number` | For semantic search (used by Limitless) | [Optional] [Defaults to `undefined`] |
|
|
1495
|
+
| **sourceExchange** | `string` | Filter by source venue (e.g. \'polymarket\', \'kalshi\', \'myriad\'). `exchange` is an alias. | [Optional] [Defaults to `undefined`] |
|
|
1496
|
+
| **exchange2** | `string` | Alias for `sourceExchange`. | [Optional] [Defaults to `undefined`] |
|
|
1473
1497
|
|
|
1474
1498
|
### Return type
|
|
1475
1499
|
|
|
@@ -19,6 +19,8 @@ Name | Type
|
|
|
19
19
|
`filter` | [EventFilterCriteria](EventFilterCriteria.md)
|
|
20
20
|
`category` | string
|
|
21
21
|
`tags` | Array<string>
|
|
22
|
+
`sourceExchange` | string
|
|
23
|
+
`exchange` | string
|
|
22
24
|
|
|
23
25
|
## Example
|
|
24
26
|
|
|
@@ -40,6 +42,8 @@ const example = {
|
|
|
40
42
|
"filter": null,
|
|
41
43
|
"category": null,
|
|
42
44
|
"tags": null,
|
|
45
|
+
"sourceExchange": null,
|
|
46
|
+
"exchange": null,
|
|
43
47
|
} satisfies EventFetchParams
|
|
44
48
|
|
|
45
49
|
console.log(example)
|
|
@@ -18,6 +18,8 @@ Name | Type
|
|
|
18
18
|
`eventId` | string
|
|
19
19
|
`page` | number
|
|
20
20
|
`similarityThreshold` | number
|
|
21
|
+
`sourceExchange` | string
|
|
22
|
+
`exchange` | string
|
|
21
23
|
|
|
22
24
|
## Example
|
|
23
25
|
|
|
@@ -38,6 +40,8 @@ const example = {
|
|
|
38
40
|
"eventId": null,
|
|
39
41
|
"page": null,
|
|
40
42
|
"similarityThreshold": null,
|
|
43
|
+
"sourceExchange": null,
|
|
44
|
+
"exchange": null,
|
|
41
45
|
} satisfies MarketFilterParams
|
|
42
46
|
|
|
43
47
|
console.log(example)
|
package/generated/package.json
CHANGED
|
@@ -219,6 +219,8 @@ export interface FetchEventRequest {
|
|
|
219
219
|
filter?: EventFilterCriteria;
|
|
220
220
|
category?: string;
|
|
221
221
|
tags?: Array<string>;
|
|
222
|
+
sourceExchange?: string;
|
|
223
|
+
exchange2?: string;
|
|
222
224
|
}
|
|
223
225
|
|
|
224
226
|
export interface FetchEventMatchesRequest {
|
|
@@ -249,6 +251,8 @@ export interface FetchEventsRequest {
|
|
|
249
251
|
filter?: EventFilterCriteria;
|
|
250
252
|
category?: string;
|
|
251
253
|
tags?: Array<string>;
|
|
254
|
+
sourceExchange?: string;
|
|
255
|
+
exchange2?: string;
|
|
252
256
|
}
|
|
253
257
|
|
|
254
258
|
export interface FetchEventsPaginatedRequest {
|
|
@@ -288,6 +292,8 @@ export interface FetchMarketRequest {
|
|
|
288
292
|
eventId?: string;
|
|
289
293
|
page?: number;
|
|
290
294
|
similarityThreshold?: number;
|
|
295
|
+
sourceExchange?: string;
|
|
296
|
+
exchange2?: string;
|
|
291
297
|
}
|
|
292
298
|
|
|
293
299
|
export interface FetchMarketMatchesRequest {
|
|
@@ -320,6 +326,8 @@ export interface FetchMarketsRequest {
|
|
|
320
326
|
eventId?: string;
|
|
321
327
|
page?: number;
|
|
322
328
|
similarityThreshold?: number;
|
|
329
|
+
sourceExchange?: string;
|
|
330
|
+
exchange2?: string;
|
|
323
331
|
}
|
|
324
332
|
|
|
325
333
|
export interface FetchMarketsPaginatedRequest {
|
|
@@ -945,6 +953,14 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
945
953
|
queryParameters['tags'] = requestParameters['tags'];
|
|
946
954
|
}
|
|
947
955
|
|
|
956
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
957
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
if (requestParameters['exchange2'] != null) {
|
|
961
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
962
|
+
}
|
|
963
|
+
|
|
948
964
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
949
965
|
|
|
950
966
|
|
|
@@ -1111,6 +1127,14 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
1111
1127
|
queryParameters['tags'] = requestParameters['tags'];
|
|
1112
1128
|
}
|
|
1113
1129
|
|
|
1130
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
1131
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
if (requestParameters['exchange2'] != null) {
|
|
1135
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1114
1138
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
1115
1139
|
|
|
1116
1140
|
|
|
@@ -1336,6 +1360,14 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
1336
1360
|
queryParameters['similarityThreshold'] = requestParameters['similarityThreshold'];
|
|
1337
1361
|
}
|
|
1338
1362
|
|
|
1363
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
1364
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
if (requestParameters['exchange2'] != null) {
|
|
1368
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1339
1371
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
1340
1372
|
|
|
1341
1373
|
|
|
@@ -1510,6 +1542,14 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
1510
1542
|
queryParameters['similarityThreshold'] = requestParameters['similarityThreshold'];
|
|
1511
1543
|
}
|
|
1512
1544
|
|
|
1545
|
+
if (requestParameters['sourceExchange'] != null) {
|
|
1546
|
+
queryParameters['sourceExchange'] = requestParameters['sourceExchange'];
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
if (requestParameters['exchange2'] != null) {
|
|
1550
|
+
queryParameters['exchange'] = requestParameters['exchange2'];
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1513
1553
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
1514
1554
|
|
|
1515
1555
|
|
|
@@ -105,6 +105,18 @@ export interface EventFetchParams {
|
|
|
105
105
|
* @memberof EventFetchParams
|
|
106
106
|
*/
|
|
107
107
|
tags?: Array<string>;
|
|
108
|
+
/**
|
|
109
|
+
* Filter by source venue (e.g. 'polymarket', 'kalshi', 'myriad'). `exchange` is an alias.
|
|
110
|
+
* @type {string}
|
|
111
|
+
* @memberof EventFetchParams
|
|
112
|
+
*/
|
|
113
|
+
sourceExchange?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Alias for `sourceExchange`.
|
|
116
|
+
* @type {string}
|
|
117
|
+
* @memberof EventFetchParams
|
|
118
|
+
*/
|
|
119
|
+
exchange?: string;
|
|
108
120
|
}
|
|
109
121
|
|
|
110
122
|
|
|
@@ -170,6 +182,8 @@ export function EventFetchParamsFromJSONTyped(json: any, ignoreDiscriminator: bo
|
|
|
170
182
|
'filter': json['filter'] == null ? undefined : EventFilterCriteriaFromJSON(json['filter']),
|
|
171
183
|
'category': json['category'] == null ? undefined : json['category'],
|
|
172
184
|
'tags': json['tags'] == null ? undefined : json['tags'],
|
|
185
|
+
'sourceExchange': json['sourceExchange'] == null ? undefined : json['sourceExchange'],
|
|
186
|
+
'exchange': json['exchange'] == null ? undefined : json['exchange'],
|
|
173
187
|
};
|
|
174
188
|
}
|
|
175
189
|
|
|
@@ -197,6 +211,8 @@ export function EventFetchParamsToJSONTyped(value?: EventFetchParams | null, ign
|
|
|
197
211
|
'filter': EventFilterCriteriaToJSON(value['filter']),
|
|
198
212
|
'category': value['category'],
|
|
199
213
|
'tags': value['tags'],
|
|
214
|
+
'sourceExchange': value['sourceExchange'],
|
|
215
|
+
'exchange': value['exchange'],
|
|
200
216
|
};
|
|
201
217
|
}
|
|
202
218
|
|
|
@@ -91,6 +91,18 @@ export interface MarketFilterParams {
|
|
|
91
91
|
* @memberof MarketFilterParams
|
|
92
92
|
*/
|
|
93
93
|
similarityThreshold?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Filter by source venue (e.g. 'polymarket', 'kalshi', 'myriad'). `exchange` is an alias.
|
|
96
|
+
* @type {string}
|
|
97
|
+
* @memberof MarketFilterParams
|
|
98
|
+
*/
|
|
99
|
+
sourceExchange?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Alias for `sourceExchange`.
|
|
102
|
+
* @type {string}
|
|
103
|
+
* @memberof MarketFilterParams
|
|
104
|
+
*/
|
|
105
|
+
exchange?: string;
|
|
94
106
|
}
|
|
95
107
|
|
|
96
108
|
|
|
@@ -155,6 +167,8 @@ export function MarketFilterParamsFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
155
167
|
'eventId': json['eventId'] == null ? undefined : json['eventId'],
|
|
156
168
|
'page': json['page'] == null ? undefined : json['page'],
|
|
157
169
|
'similarityThreshold': json['similarityThreshold'] == null ? undefined : json['similarityThreshold'],
|
|
170
|
+
'sourceExchange': json['sourceExchange'] == null ? undefined : json['sourceExchange'],
|
|
171
|
+
'exchange': json['exchange'] == null ? undefined : json['exchange'],
|
|
158
172
|
};
|
|
159
173
|
}
|
|
160
174
|
|
|
@@ -181,6 +195,8 @@ export function MarketFilterParamsToJSONTyped(value?: MarketFilterParams | null,
|
|
|
181
195
|
'eventId': value['eventId'],
|
|
182
196
|
'page': value['page'],
|
|
183
197
|
'similarityThreshold': value['similarityThreshold'],
|
|
198
|
+
'sourceExchange': value['sourceExchange'],
|
|
199
|
+
'exchange': value['exchange'],
|
|
184
200
|
};
|
|
185
201
|
}
|
|
186
202
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmxtjs",
|
|
3
|
-
"version": "2.50.
|
|
3
|
+
"version": "2.50.14",
|
|
4
4
|
"description": "Unified prediction market data API - The ccxt for prediction markets",
|
|
5
5
|
"author": "PMXT Contributors",
|
|
6
6
|
"repository": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"unified"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"pmxt-core": "2.50.
|
|
46
|
+
"pmxt-core": "2.50.14",
|
|
47
47
|
"ws": "^8.18.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
package/pmxt/client.ts
CHANGED
|
@@ -1162,6 +1162,9 @@ export abstract class Exchange {
|
|
|
1162
1162
|
|
|
1163
1163
|
async cancelOrder(orderId: string): Promise<Order> {
|
|
1164
1164
|
await this.initPromise;
|
|
1165
|
+
if (this.isHosted) {
|
|
1166
|
+
return this._hostedCancelOrder(orderId);
|
|
1167
|
+
}
|
|
1165
1168
|
try {
|
|
1166
1169
|
const args: any[] = [];
|
|
1167
1170
|
args.push(orderId);
|
|
@@ -2341,6 +2344,56 @@ export abstract class Exchange {
|
|
|
2341
2344
|
return isPull ? "opinion_sell_bsc_pull" : "opinion_sell_polygon";
|
|
2342
2345
|
}
|
|
2343
2346
|
|
|
2347
|
+
/**
|
|
2348
|
+
* Hosted-mode cancelOrder: build → sign → cancel single-call wrapper.
|
|
2349
|
+
* Mirrors the Python SDK's `_hosted_cancel_order`.
|
|
2350
|
+
*/
|
|
2351
|
+
private async _hostedCancelOrder(orderId: string): Promise<Order> {
|
|
2352
|
+
const signer = this.requireHostedSigner();
|
|
2353
|
+
if (!this.walletAddress) {
|
|
2354
|
+
throw new MissingWalletAddress("hosted cancelOrder requires walletAddress");
|
|
2355
|
+
}
|
|
2356
|
+
const buildRequest = { order_id: orderId, user_address: this.walletAddress };
|
|
2357
|
+
const buildRoute = HOSTED_METHOD_ROUTES.get("cancelOrderBuild")!;
|
|
2358
|
+
const buildPayload = await _tradingRequest(this, {
|
|
2359
|
+
method: buildRoute.method,
|
|
2360
|
+
path: buildRoute.path,
|
|
2361
|
+
body: buildRequest,
|
|
2362
|
+
}) as Record<string, unknown>;
|
|
2363
|
+
|
|
2364
|
+
const typedData = buildPayload["typed_data"] as TypedData | undefined;
|
|
2365
|
+
if (!typedData) {
|
|
2366
|
+
throw new HostedInvalidSignature(0, "typed_data missing from hosted cancel build response");
|
|
2367
|
+
}
|
|
2368
|
+
const primaryRoute = this._hostedCancelTypedDataRoute(false);
|
|
2369
|
+
validateTypedData(typedData, primaryRoute, this.walletAddress);
|
|
2370
|
+
const signature = await signer.signTypedData(typedData);
|
|
2371
|
+
verifySignature(typedData, signature, signer.address);
|
|
2372
|
+
|
|
2373
|
+
const cancelId = buildPayload["cancel_id"];
|
|
2374
|
+
if (!cancelId) {
|
|
2375
|
+
throw new HostedInvalidSignature(0, "cancel_id missing from hosted cancel build response");
|
|
2376
|
+
}
|
|
2377
|
+
const body: Record<string, unknown> = { cancel_id: cancelId, signature };
|
|
2378
|
+
|
|
2379
|
+
const pullTypedData = buildPayload["pull_typed_data"] as TypedData | undefined;
|
|
2380
|
+
if (pullTypedData) {
|
|
2381
|
+
const pullRoute = this._hostedCancelTypedDataRoute(true);
|
|
2382
|
+
validateTypedData(pullTypedData, pullRoute, this.walletAddress);
|
|
2383
|
+
const pullSig = await signer.signTypedData(pullTypedData);
|
|
2384
|
+
verifySignature(pullTypedData, pullSig, signer.address);
|
|
2385
|
+
body["pull_signature"] = pullSig;
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
const cancelRoute = HOSTED_METHOD_ROUTES.get("cancelOrder")!;
|
|
2389
|
+
const data = await _tradingRequest(this, {
|
|
2390
|
+
method: cancelRoute.method,
|
|
2391
|
+
path: cancelRoute.path,
|
|
2392
|
+
body,
|
|
2393
|
+
});
|
|
2394
|
+
return orderFromV0(data as Record<string, unknown>);
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2344
2397
|
private _hostedCancelTypedDataRoute(isPull: boolean): string {
|
|
2345
2398
|
const venue = this.exchangeName;
|
|
2346
2399
|
if (venue === "polymarket") return "cancel_polymarket";
|