pmxtjs 2.19.6 → 2.20.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 +53 -1
- package/dist/esm/generated/src/apis/DefaultApi.js +83 -1
- package/dist/esm/generated/src/models/FetchBalanceRequest.d.ts +2 -2
- package/dist/esm/generated/src/models/FetchPositionsRequest.d.ts +2 -2
- package/dist/esm/generated/src/models/UnwatchAddressRequest.d.ts +39 -0
- package/dist/esm/generated/src/models/UnwatchAddressRequest.js +46 -0
- package/dist/esm/generated/src/models/WatchAddress200Response.d.ts +45 -0
- package/dist/esm/generated/src/models/WatchAddress200Response.js +46 -0
- package/dist/esm/generated/src/models/WatchAddressRequest.d.ts +40 -0
- package/dist/esm/generated/src/models/WatchAddressRequest.js +47 -0
- package/dist/esm/generated/src/models/WatchAddressRequestArgsInner.d.ts +21 -0
- package/dist/esm/generated/src/models/WatchAddressRequestArgsInner.js +37 -0
- package/dist/esm/generated/src/models/index.d.ts +4 -0
- package/dist/esm/generated/src/models/index.js +4 -0
- package/dist/esm/pmxt/args.d.ts +1 -0
- package/dist/esm/pmxt/args.js +3 -0
- package/dist/esm/pmxt/client.d.ts +94 -6
- package/dist/esm/pmxt/client.js +217 -55
- package/dist/esm/pmxt/models.d.ts +45 -0
- package/dist/generated/src/apis/DefaultApi.d.ts +53 -1
- package/dist/generated/src/apis/DefaultApi.js +83 -1
- package/dist/generated/src/models/FetchBalanceRequest.d.ts +2 -2
- package/dist/generated/src/models/FetchPositionsRequest.d.ts +2 -2
- package/dist/generated/src/models/UnwatchAddressRequest.d.ts +39 -0
- package/dist/generated/src/models/UnwatchAddressRequest.js +53 -0
- package/dist/generated/src/models/WatchAddress200Response.d.ts +45 -0
- package/dist/generated/src/models/WatchAddress200Response.js +53 -0
- package/dist/generated/src/models/WatchAddressRequest.d.ts +40 -0
- package/dist/generated/src/models/WatchAddressRequest.js +54 -0
- package/dist/generated/src/models/WatchAddressRequestArgsInner.d.ts +21 -0
- package/dist/generated/src/models/WatchAddressRequestArgsInner.js +43 -0
- package/dist/generated/src/models/index.d.ts +4 -0
- package/dist/generated/src/models/index.js +4 -0
- package/dist/pmxt/args.d.ts +1 -0
- package/dist/pmxt/args.js +6 -0
- package/dist/pmxt/client.d.ts +94 -6
- package/dist/pmxt/client.js +216 -54
- package/dist/pmxt/models.d.ts +45 -0
- package/generated/.openapi-generator/FILES +8 -0
- package/generated/docs/DefaultApi.md +142 -0
- package/generated/docs/FetchBalanceRequest.md +1 -1
- package/generated/docs/FetchPositionsRequest.md +1 -1
- package/generated/docs/UnwatchAddressRequest.md +36 -0
- package/generated/docs/WatchAddress200Response.md +38 -0
- package/generated/docs/WatchAddressRequest.md +36 -0
- package/generated/docs/WatchAddressRequestArgsInner.md +32 -0
- package/generated/package.json +1 -1
- package/generated/src/apis/DefaultApi.ts +127 -0
- package/generated/src/models/FetchBalanceRequest.ts +2 -2
- package/generated/src/models/FetchPositionsRequest.ts +2 -2
- package/generated/src/models/UnwatchAddressRequest.ts +82 -0
- package/generated/src/models/WatchAddress200Response.ts +89 -0
- package/generated/src/models/WatchAddressRequest.ts +89 -0
- package/generated/src/models/WatchAddressRequestArgsInner.ts +49 -0
- package/generated/src/models/index.ts +4 -0
- package/package.json +2 -2
- package/pmxt/args.ts +3 -0
- package/pmxt/client.ts +262 -60
- package/pmxt/models.ts +55 -1
|
@@ -46,7 +46,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
46
46
|
};
|
|
47
47
|
})();
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.WatchTradesOperationExchangeEnum = exports.WatchOrderBookOperationExchangeEnum = exports.SubmitOrderOperationExchangeEnum = exports.LoadMarketsOperationExchangeEnum = exports.GetExecutionPriceDetailedOperationExchangeEnum = exports.GetExecutionPriceOperationExchangeEnum = exports.FilterMarketsOperationExchangeEnum = exports.FilterEventsOperationExchangeEnum = exports.FetchTradesOperationExchangeEnum = exports.FetchPositionsOperationExchangeEnum = exports.FetchOrderBookOperationExchangeEnum = exports.FetchOrderOperationExchangeEnum = exports.FetchOpenOrdersOperationExchangeEnum = exports.FetchOHLCVOperationExchangeEnum = exports.FetchMyTradesOperationExchangeEnum = exports.FetchMarketsPaginatedOperationExchangeEnum = exports.FetchMarketsOperationExchangeEnum = exports.FetchMarketOperationExchangeEnum = exports.FetchEventsOperationExchangeEnum = exports.FetchEventOperationExchangeEnum = exports.FetchClosedOrdersOperationExchangeEnum = exports.FetchBalanceOperationExchangeEnum = exports.FetchAllOrdersOperationExchangeEnum = exports.CreateOrderOperationExchangeEnum = exports.CloseOperationExchangeEnum = exports.CancelOrderOperationExchangeEnum = exports.BuildOrderOperationExchangeEnum = exports.DefaultApi = void 0;
|
|
49
|
+
exports.WatchTradesOperationExchangeEnum = exports.WatchOrderBookOperationExchangeEnum = exports.WatchAddressOperationExchangeEnum = exports.UnwatchAddressOperationExchangeEnum = exports.SubmitOrderOperationExchangeEnum = exports.LoadMarketsOperationExchangeEnum = exports.GetExecutionPriceDetailedOperationExchangeEnum = exports.GetExecutionPriceOperationExchangeEnum = exports.FilterMarketsOperationExchangeEnum = exports.FilterEventsOperationExchangeEnum = exports.FetchTradesOperationExchangeEnum = exports.FetchPositionsOperationExchangeEnum = exports.FetchOrderBookOperationExchangeEnum = exports.FetchOrderOperationExchangeEnum = exports.FetchOpenOrdersOperationExchangeEnum = exports.FetchOHLCVOperationExchangeEnum = exports.FetchMyTradesOperationExchangeEnum = exports.FetchMarketsPaginatedOperationExchangeEnum = exports.FetchMarketsOperationExchangeEnum = exports.FetchMarketOperationExchangeEnum = exports.FetchEventsOperationExchangeEnum = exports.FetchEventOperationExchangeEnum = exports.FetchClosedOrdersOperationExchangeEnum = exports.FetchBalanceOperationExchangeEnum = exports.FetchAllOrdersOperationExchangeEnum = exports.CreateOrderOperationExchangeEnum = exports.CloseOperationExchangeEnum = exports.CancelOrderOperationExchangeEnum = exports.BuildOrderOperationExchangeEnum = exports.DefaultApi = void 0;
|
|
50
50
|
const runtime = __importStar(require("../runtime"));
|
|
51
51
|
const index_1 = require("../models/index");
|
|
52
52
|
/**
|
|
@@ -819,6 +819,66 @@ class DefaultApi extends runtime.BaseAPI {
|
|
|
819
819
|
const response = await this.submitOrderRaw(requestParameters, initOverrides);
|
|
820
820
|
return await response.value();
|
|
821
821
|
}
|
|
822
|
+
/**
|
|
823
|
+
* Stop watching a previously registered wallet address and release its resource updates.
|
|
824
|
+
* Unwatch Address
|
|
825
|
+
*/
|
|
826
|
+
async unwatchAddressRaw(requestParameters, initOverrides) {
|
|
827
|
+
if (requestParameters['exchange'] == null) {
|
|
828
|
+
throw new runtime.RequiredError('exchange', 'Required parameter "exchange" was null or undefined when calling unwatchAddress().');
|
|
829
|
+
}
|
|
830
|
+
const queryParameters = {};
|
|
831
|
+
const headerParameters = {};
|
|
832
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
833
|
+
let urlPath = `/api/{exchange}/unwatchAddress`;
|
|
834
|
+
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
835
|
+
const response = await this.request({
|
|
836
|
+
path: urlPath,
|
|
837
|
+
method: 'POST',
|
|
838
|
+
headers: headerParameters,
|
|
839
|
+
query: queryParameters,
|
|
840
|
+
body: (0, index_1.UnwatchAddressRequestToJSON)(requestParameters['unwatchAddressRequest']),
|
|
841
|
+
}, initOverrides);
|
|
842
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BaseResponseFromJSON)(jsonValue));
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* Stop watching a previously registered wallet address and release its resource updates.
|
|
846
|
+
* Unwatch Address
|
|
847
|
+
*/
|
|
848
|
+
async unwatchAddress(requestParameters, initOverrides) {
|
|
849
|
+
const response = await this.unwatchAddressRaw(requestParameters, initOverrides);
|
|
850
|
+
return await response.value();
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Stream activity for a public wallet address Returns a promise that resolves with the next activity snapshot whenever a change is detected. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
854
|
+
* Watch Address
|
|
855
|
+
*/
|
|
856
|
+
async watchAddressRaw(requestParameters, initOverrides) {
|
|
857
|
+
if (requestParameters['exchange'] == null) {
|
|
858
|
+
throw new runtime.RequiredError('exchange', 'Required parameter "exchange" was null or undefined when calling watchAddress().');
|
|
859
|
+
}
|
|
860
|
+
const queryParameters = {};
|
|
861
|
+
const headerParameters = {};
|
|
862
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
863
|
+
let urlPath = `/api/{exchange}/watchAddress`;
|
|
864
|
+
urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
|
|
865
|
+
const response = await this.request({
|
|
866
|
+
path: urlPath,
|
|
867
|
+
method: 'POST',
|
|
868
|
+
headers: headerParameters,
|
|
869
|
+
query: queryParameters,
|
|
870
|
+
body: (0, index_1.WatchAddressRequestToJSON)(requestParameters['watchAddressRequest']),
|
|
871
|
+
}, initOverrides);
|
|
872
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WatchAddress200ResponseFromJSON)(jsonValue));
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Stream activity for a public wallet address Returns a promise that resolves with the next activity snapshot whenever a change is detected. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
876
|
+
* Watch Address
|
|
877
|
+
*/
|
|
878
|
+
async watchAddress(requestParameters, initOverrides) {
|
|
879
|
+
const response = await this.watchAddressRaw(requestParameters, initOverrides);
|
|
880
|
+
return await response.value();
|
|
881
|
+
}
|
|
822
882
|
/**
|
|
823
883
|
* Watch order book updates in real-time via WebSocket. Returns a promise that resolves with the next order book update. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
824
884
|
* Watch Order Book
|
|
@@ -1156,6 +1216,28 @@ exports.SubmitOrderOperationExchangeEnum = {
|
|
|
1156
1216
|
Baozi: 'baozi',
|
|
1157
1217
|
Myriad: 'myriad'
|
|
1158
1218
|
};
|
|
1219
|
+
/**
|
|
1220
|
+
* @export
|
|
1221
|
+
*/
|
|
1222
|
+
exports.UnwatchAddressOperationExchangeEnum = {
|
|
1223
|
+
Polymarket: 'polymarket',
|
|
1224
|
+
Kalshi: 'kalshi',
|
|
1225
|
+
Limitless: 'limitless',
|
|
1226
|
+
Probable: 'probable',
|
|
1227
|
+
Baozi: 'baozi',
|
|
1228
|
+
Myriad: 'myriad'
|
|
1229
|
+
};
|
|
1230
|
+
/**
|
|
1231
|
+
* @export
|
|
1232
|
+
*/
|
|
1233
|
+
exports.WatchAddressOperationExchangeEnum = {
|
|
1234
|
+
Polymarket: 'polymarket',
|
|
1235
|
+
Kalshi: 'kalshi',
|
|
1236
|
+
Limitless: 'limitless',
|
|
1237
|
+
Probable: 'probable',
|
|
1238
|
+
Baozi: 'baozi',
|
|
1239
|
+
Myriad: 'myriad'
|
|
1240
|
+
};
|
|
1159
1241
|
/**
|
|
1160
1242
|
* @export
|
|
1161
1243
|
*/
|
|
@@ -18,10 +18,10 @@ import type { ExchangeCredentials } from './ExchangeCredentials';
|
|
|
18
18
|
export interface FetchBalanceRequest {
|
|
19
19
|
/**
|
|
20
20
|
*
|
|
21
|
-
* @type {Array<
|
|
21
|
+
* @type {Array<string>}
|
|
22
22
|
* @memberof FetchBalanceRequest
|
|
23
23
|
*/
|
|
24
|
-
args?: Array<
|
|
24
|
+
args?: Array<string>;
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
* @type {ExchangeCredentials}
|
|
@@ -18,10 +18,10 @@ import type { ExchangeCredentials } from './ExchangeCredentials';
|
|
|
18
18
|
export interface FetchPositionsRequest {
|
|
19
19
|
/**
|
|
20
20
|
*
|
|
21
|
-
* @type {Array<
|
|
21
|
+
* @type {Array<string>}
|
|
22
22
|
* @memberof FetchPositionsRequest
|
|
23
23
|
*/
|
|
24
|
-
args?: Array<
|
|
24
|
+
args?: Array<string>;
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
* @type {ExchangeCredentials}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { ExchangeCredentials } from './ExchangeCredentials';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface UnwatchAddressRequest
|
|
17
|
+
*/
|
|
18
|
+
export interface UnwatchAddressRequest {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {Array<string>}
|
|
22
|
+
* @memberof UnwatchAddressRequest
|
|
23
|
+
*/
|
|
24
|
+
args: Array<string>;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {ExchangeCredentials}
|
|
28
|
+
* @memberof UnwatchAddressRequest
|
|
29
|
+
*/
|
|
30
|
+
credentials?: ExchangeCredentials;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check if a given object implements the UnwatchAddressRequest interface.
|
|
34
|
+
*/
|
|
35
|
+
export declare function instanceOfUnwatchAddressRequest(value: object): value is UnwatchAddressRequest;
|
|
36
|
+
export declare function UnwatchAddressRequestFromJSON(json: any): UnwatchAddressRequest;
|
|
37
|
+
export declare function UnwatchAddressRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnwatchAddressRequest;
|
|
38
|
+
export declare function UnwatchAddressRequestToJSON(json: any): UnwatchAddressRequest;
|
|
39
|
+
export declare function UnwatchAddressRequestToJSONTyped(value?: UnwatchAddressRequest | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,53 @@
|
|
|
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.instanceOfUnwatchAddressRequest = instanceOfUnwatchAddressRequest;
|
|
17
|
+
exports.UnwatchAddressRequestFromJSON = UnwatchAddressRequestFromJSON;
|
|
18
|
+
exports.UnwatchAddressRequestFromJSONTyped = UnwatchAddressRequestFromJSONTyped;
|
|
19
|
+
exports.UnwatchAddressRequestToJSON = UnwatchAddressRequestToJSON;
|
|
20
|
+
exports.UnwatchAddressRequestToJSONTyped = UnwatchAddressRequestToJSONTyped;
|
|
21
|
+
const ExchangeCredentials_1 = require("./ExchangeCredentials");
|
|
22
|
+
/**
|
|
23
|
+
* Check if a given object implements the UnwatchAddressRequest interface.
|
|
24
|
+
*/
|
|
25
|
+
function instanceOfUnwatchAddressRequest(value) {
|
|
26
|
+
if (!('args' in value) || value['args'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
function UnwatchAddressRequestFromJSON(json) {
|
|
31
|
+
return UnwatchAddressRequestFromJSONTyped(json, false);
|
|
32
|
+
}
|
|
33
|
+
function UnwatchAddressRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
34
|
+
if (json == null) {
|
|
35
|
+
return json;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
'args': json['args'],
|
|
39
|
+
'credentials': json['credentials'] == null ? undefined : (0, ExchangeCredentials_1.ExchangeCredentialsFromJSON)(json['credentials']),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function UnwatchAddressRequestToJSON(json) {
|
|
43
|
+
return UnwatchAddressRequestToJSONTyped(json, false);
|
|
44
|
+
}
|
|
45
|
+
function UnwatchAddressRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
46
|
+
if (value == null) {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
'args': value['args'],
|
|
51
|
+
'credentials': (0, ExchangeCredentials_1.ExchangeCredentialsToJSON)(value['credentials']),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -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 { ErrorDetail } from './ErrorDetail';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface WatchAddress200Response
|
|
17
|
+
*/
|
|
18
|
+
export interface WatchAddress200Response {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {boolean}
|
|
22
|
+
* @memberof WatchAddress200Response
|
|
23
|
+
*/
|
|
24
|
+
success?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {ErrorDetail}
|
|
28
|
+
* @memberof WatchAddress200Response
|
|
29
|
+
*/
|
|
30
|
+
error?: ErrorDetail;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @type {object}
|
|
34
|
+
* @memberof WatchAddress200Response
|
|
35
|
+
*/
|
|
36
|
+
data?: object;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if a given object implements the WatchAddress200Response interface.
|
|
40
|
+
*/
|
|
41
|
+
export declare function instanceOfWatchAddress200Response(value: object): value is WatchAddress200Response;
|
|
42
|
+
export declare function WatchAddress200ResponseFromJSON(json: any): WatchAddress200Response;
|
|
43
|
+
export declare function WatchAddress200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): WatchAddress200Response;
|
|
44
|
+
export declare function WatchAddress200ResponseToJSON(json: any): WatchAddress200Response;
|
|
45
|
+
export declare function WatchAddress200ResponseToJSONTyped(value?: WatchAddress200Response | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,53 @@
|
|
|
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.instanceOfWatchAddress200Response = instanceOfWatchAddress200Response;
|
|
17
|
+
exports.WatchAddress200ResponseFromJSON = WatchAddress200ResponseFromJSON;
|
|
18
|
+
exports.WatchAddress200ResponseFromJSONTyped = WatchAddress200ResponseFromJSONTyped;
|
|
19
|
+
exports.WatchAddress200ResponseToJSON = WatchAddress200ResponseToJSON;
|
|
20
|
+
exports.WatchAddress200ResponseToJSONTyped = WatchAddress200ResponseToJSONTyped;
|
|
21
|
+
const ErrorDetail_1 = require("./ErrorDetail");
|
|
22
|
+
/**
|
|
23
|
+
* Check if a given object implements the WatchAddress200Response interface.
|
|
24
|
+
*/
|
|
25
|
+
function instanceOfWatchAddress200Response(value) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
function WatchAddress200ResponseFromJSON(json) {
|
|
29
|
+
return WatchAddress200ResponseFromJSONTyped(json, false);
|
|
30
|
+
}
|
|
31
|
+
function WatchAddress200ResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
32
|
+
if (json == null) {
|
|
33
|
+
return json;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
'success': json['success'] == null ? undefined : json['success'],
|
|
37
|
+
'error': json['error'] == null ? undefined : (0, ErrorDetail_1.ErrorDetailFromJSON)(json['error']),
|
|
38
|
+
'data': json['data'] == null ? undefined : json['data'],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function WatchAddress200ResponseToJSON(json) {
|
|
42
|
+
return WatchAddress200ResponseToJSONTyped(json, false);
|
|
43
|
+
}
|
|
44
|
+
function WatchAddress200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
45
|
+
if (value == null) {
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
'success': value['success'],
|
|
50
|
+
'error': (0, ErrorDetail_1.ErrorDetailToJSON)(value['error']),
|
|
51
|
+
'data': value['data'],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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 { WatchAddressRequestArgsInner } from './WatchAddressRequestArgsInner';
|
|
13
|
+
import type { ExchangeCredentials } from './ExchangeCredentials';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @interface WatchAddressRequest
|
|
18
|
+
*/
|
|
19
|
+
export interface WatchAddressRequest {
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @type {Array<WatchAddressRequestArgsInner>}
|
|
23
|
+
* @memberof WatchAddressRequest
|
|
24
|
+
*/
|
|
25
|
+
args: Array<WatchAddressRequestArgsInner>;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @type {ExchangeCredentials}
|
|
29
|
+
* @memberof WatchAddressRequest
|
|
30
|
+
*/
|
|
31
|
+
credentials?: ExchangeCredentials;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Check if a given object implements the WatchAddressRequest interface.
|
|
35
|
+
*/
|
|
36
|
+
export declare function instanceOfWatchAddressRequest(value: object): value is WatchAddressRequest;
|
|
37
|
+
export declare function WatchAddressRequestFromJSON(json: any): WatchAddressRequest;
|
|
38
|
+
export declare function WatchAddressRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): WatchAddressRequest;
|
|
39
|
+
export declare function WatchAddressRequestToJSON(json: any): WatchAddressRequest;
|
|
40
|
+
export declare function WatchAddressRequestToJSONTyped(value?: WatchAddressRequest | 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.instanceOfWatchAddressRequest = instanceOfWatchAddressRequest;
|
|
17
|
+
exports.WatchAddressRequestFromJSON = WatchAddressRequestFromJSON;
|
|
18
|
+
exports.WatchAddressRequestFromJSONTyped = WatchAddressRequestFromJSONTyped;
|
|
19
|
+
exports.WatchAddressRequestToJSON = WatchAddressRequestToJSON;
|
|
20
|
+
exports.WatchAddressRequestToJSONTyped = WatchAddressRequestToJSONTyped;
|
|
21
|
+
const WatchAddressRequestArgsInner_1 = require("./WatchAddressRequestArgsInner");
|
|
22
|
+
const ExchangeCredentials_1 = require("./ExchangeCredentials");
|
|
23
|
+
/**
|
|
24
|
+
* Check if a given object implements the WatchAddressRequest interface.
|
|
25
|
+
*/
|
|
26
|
+
function instanceOfWatchAddressRequest(value) {
|
|
27
|
+
if (!('args' in value) || value['args'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
function WatchAddressRequestFromJSON(json) {
|
|
32
|
+
return WatchAddressRequestFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
function WatchAddressRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
|
+
if (json == null) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
'args': (json['args'].map(WatchAddressRequestArgsInner_1.WatchAddressRequestArgsInnerFromJSON)),
|
|
40
|
+
'credentials': json['credentials'] == null ? undefined : (0, ExchangeCredentials_1.ExchangeCredentialsFromJSON)(json['credentials']),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function WatchAddressRequestToJSON(json) {
|
|
44
|
+
return WatchAddressRequestToJSONTyped(json, false);
|
|
45
|
+
}
|
|
46
|
+
function WatchAddressRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
47
|
+
if (value == null) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
'args': (value['args'].map(WatchAddressRequestArgsInner_1.WatchAddressRequestArgsInnerToJSON)),
|
|
52
|
+
'credentials': (0, ExchangeCredentials_1.ExchangeCredentialsToJSON)(value['credentials']),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
/**
|
|
13
|
+
* @type WatchAddressRequestArgsInner
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
*/
|
|
17
|
+
export type WatchAddressRequestArgsInner = Array<object> | string;
|
|
18
|
+
export declare function WatchAddressRequestArgsInnerFromJSON(json: any): WatchAddressRequestArgsInner;
|
|
19
|
+
export declare function WatchAddressRequestArgsInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): WatchAddressRequestArgsInner;
|
|
20
|
+
export declare function WatchAddressRequestArgsInnerToJSON(json: any): any;
|
|
21
|
+
export declare function WatchAddressRequestArgsInnerToJSONTyped(value?: WatchAddressRequestArgsInner | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,43 @@
|
|
|
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.WatchAddressRequestArgsInnerFromJSON = WatchAddressRequestArgsInnerFromJSON;
|
|
17
|
+
exports.WatchAddressRequestArgsInnerFromJSONTyped = WatchAddressRequestArgsInnerFromJSONTyped;
|
|
18
|
+
exports.WatchAddressRequestArgsInnerToJSON = WatchAddressRequestArgsInnerToJSON;
|
|
19
|
+
exports.WatchAddressRequestArgsInnerToJSONTyped = WatchAddressRequestArgsInnerToJSONTyped;
|
|
20
|
+
function WatchAddressRequestArgsInnerFromJSON(json) {
|
|
21
|
+
return WatchAddressRequestArgsInnerFromJSONTyped(json, false);
|
|
22
|
+
}
|
|
23
|
+
function WatchAddressRequestArgsInnerFromJSONTyped(json, ignoreDiscriminator) {
|
|
24
|
+
if (json == null) {
|
|
25
|
+
return json;
|
|
26
|
+
}
|
|
27
|
+
if (typeof json === 'string') {
|
|
28
|
+
return json;
|
|
29
|
+
}
|
|
30
|
+
return {};
|
|
31
|
+
}
|
|
32
|
+
function WatchAddressRequestArgsInnerToJSON(json) {
|
|
33
|
+
return WatchAddressRequestArgsInnerToJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
function WatchAddressRequestArgsInnerToJSONTyped(value, ignoreDiscriminator = false) {
|
|
36
|
+
if (value == null) {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
if (typeof value === 'string') {
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
return {};
|
|
43
|
+
}
|
|
@@ -77,7 +77,11 @@ export * from './Trade';
|
|
|
77
77
|
export * from './TradesParams';
|
|
78
78
|
export * from './UnifiedEvent';
|
|
79
79
|
export * from './UnifiedMarket';
|
|
80
|
+
export * from './UnwatchAddressRequest';
|
|
80
81
|
export * from './UserTrade';
|
|
82
|
+
export * from './WatchAddress200Response';
|
|
83
|
+
export * from './WatchAddressRequest';
|
|
84
|
+
export * from './WatchAddressRequestArgsInner';
|
|
81
85
|
export * from './WatchOrderBookRequest';
|
|
82
86
|
export * from './WatchOrderBookRequestArgsInner';
|
|
83
87
|
export * from './WatchTradesRequest';
|
|
@@ -95,7 +95,11 @@ __exportStar(require("./Trade"), exports);
|
|
|
95
95
|
__exportStar(require("./TradesParams"), exports);
|
|
96
96
|
__exportStar(require("./UnifiedEvent"), exports);
|
|
97
97
|
__exportStar(require("./UnifiedMarket"), exports);
|
|
98
|
+
__exportStar(require("./UnwatchAddressRequest"), exports);
|
|
98
99
|
__exportStar(require("./UserTrade"), exports);
|
|
100
|
+
__exportStar(require("./WatchAddress200Response"), exports);
|
|
101
|
+
__exportStar(require("./WatchAddressRequest"), exports);
|
|
102
|
+
__exportStar(require("./WatchAddressRequestArgsInner"), exports);
|
|
99
103
|
__exportStar(require("./WatchOrderBookRequest"), exports);
|
|
100
104
|
__exportStar(require("./WatchOrderBookRequestArgsInner"), exports);
|
|
101
105
|
__exportStar(require("./WatchTradesRequest"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildArgsWithOptionalOptions(primary?: any): any[];
|
package/dist/pmxt/client.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This module provides clean, TypeScript-friendly wrappers around the auto-generated
|
|
5
5
|
* OpenAPI client, matching the Python API exactly.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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";
|
|
9
9
|
import { ServerManager } from "./server-manager.js";
|
|
10
10
|
/**
|
|
11
11
|
* Base exchange client options.
|
|
@@ -68,15 +68,14 @@ export declare abstract class Exchange {
|
|
|
68
68
|
fetchMarket(params?: any): Promise<UnifiedMarket>;
|
|
69
69
|
fetchEvent(params?: any): Promise<UnifiedEvent>;
|
|
70
70
|
fetchOrderBook(id: string): Promise<OrderBook>;
|
|
71
|
-
submitOrder(built: any): Promise<Order>;
|
|
72
71
|
cancelOrder(orderId: string): Promise<Order>;
|
|
73
72
|
fetchOrder(orderId: string): Promise<Order>;
|
|
74
73
|
fetchOpenOrders(marketId?: string): Promise<Order[]>;
|
|
75
74
|
fetchMyTrades(params?: any): Promise<UserTrade[]>;
|
|
76
75
|
fetchClosedOrders(params?: any): Promise<Order[]>;
|
|
77
76
|
fetchAllOrders(params?: any): Promise<Order[]>;
|
|
78
|
-
fetchPositions(): Promise<Position[]>;
|
|
79
|
-
fetchBalance(): Promise<Balance[]>;
|
|
77
|
+
fetchPositions(address?: string): Promise<Position[]>;
|
|
78
|
+
fetchBalance(address?: string): Promise<Balance[]>;
|
|
80
79
|
close(): Promise<void>;
|
|
81
80
|
/**
|
|
82
81
|
* Get historical price candles.
|
|
@@ -134,6 +133,7 @@ export declare abstract class Exchange {
|
|
|
134
133
|
* Call repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
135
134
|
*
|
|
136
135
|
* @param outcomeId - Outcome ID to watch
|
|
136
|
+
* @param address - Public wallet to be watched
|
|
137
137
|
* @param since - Optional timestamp to filter trades from
|
|
138
138
|
* @param limit - Optional limit for number of trades
|
|
139
139
|
* @returns Next trade update(s)
|
|
@@ -149,7 +149,95 @@ export declare abstract class Exchange {
|
|
|
149
149
|
* }
|
|
150
150
|
* ```
|
|
151
151
|
*/
|
|
152
|
-
watchTrades(outcomeId: string, since?: number, limit?: number): Promise<Trade[]>;
|
|
152
|
+
watchTrades(outcomeId: string, address?: string, since?: number, limit?: number): Promise<Trade[]>;
|
|
153
|
+
/**
|
|
154
|
+
* Watch real-time updates of a public wallet via WebSocket.
|
|
155
|
+
*
|
|
156
|
+
* Returns a promise that resolves with the next update(s).
|
|
157
|
+
* Call repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
158
|
+
*
|
|
159
|
+
* @param address - Public wallet to be watched
|
|
160
|
+
* @param types - Subscription options including 'trades', 'positions', and 'balances'
|
|
161
|
+
* @returns Next update(s)
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* // Stream updates of a public wallet address
|
|
166
|
+
* while (true) {
|
|
167
|
+
* const snapshots = await exchange.watchAddress(address, types);
|
|
168
|
+
* for (const snapshot of snapshots) {
|
|
169
|
+
* console.log(`Trade: ${snapshot.trades}`);
|
|
170
|
+
* }
|
|
171
|
+
* }
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
watchAddress(address: string, types?: SubscriptionOption[]): Promise<SubscribedAddressSnapshot>;
|
|
175
|
+
/**
|
|
176
|
+
* Stop watching a previously registered wallet address and release its resource updates.
|
|
177
|
+
*
|
|
178
|
+
* @param address - Public wallet to be watched
|
|
179
|
+
* @returns
|
|
180
|
+
*/
|
|
181
|
+
unwatchAddress(address: string): Promise<Trade[]>;
|
|
182
|
+
/**
|
|
183
|
+
* Build an order payload without submitting it to the exchange.
|
|
184
|
+
* Returns the exchange-native signed order or transaction payload for
|
|
185
|
+
* inspection, forwarding through a middleware layer, or deferred
|
|
186
|
+
* submission via {@link submitOrder}.
|
|
187
|
+
*
|
|
188
|
+
* You can specify the market either with explicit marketId/outcomeId,
|
|
189
|
+
* or by passing an outcome object directly (e.g., market.yes).
|
|
190
|
+
*
|
|
191
|
+
* @param params - Order parameters (same as createOrder)
|
|
192
|
+
* @returns A BuiltOrder containing the exchange-native payload
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```typescript
|
|
196
|
+
* // Build, inspect, then submit:
|
|
197
|
+
* const built = await exchange.buildOrder({
|
|
198
|
+
* marketId: "663583",
|
|
199
|
+
* outcomeId: "10991849...",
|
|
200
|
+
* side: "buy",
|
|
201
|
+
* type: "limit",
|
|
202
|
+
* amount: 10,
|
|
203
|
+
* price: 0.55
|
|
204
|
+
* });
|
|
205
|
+
*
|
|
206
|
+
* console.log(built.signedOrder); // inspect before submitting
|
|
207
|
+
* const order = await exchange.submitOrder(built);
|
|
208
|
+
*
|
|
209
|
+
* // Using outcome shorthand:
|
|
210
|
+
* const built2 = await exchange.buildOrder({
|
|
211
|
+
* outcome: market.yes,
|
|
212
|
+
* side: "buy",
|
|
213
|
+
* type: "market",
|
|
214
|
+
* amount: 10
|
|
215
|
+
* });
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
buildOrder(params: CreateOrderParams & {
|
|
219
|
+
outcome?: MarketOutcome;
|
|
220
|
+
}): Promise<BuiltOrder>;
|
|
221
|
+
/**
|
|
222
|
+
* Submit a pre-built order returned by {@link buildOrder}.
|
|
223
|
+
*
|
|
224
|
+
* @param built - The BuiltOrder payload from buildOrder()
|
|
225
|
+
* @returns The submitted order
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* ```typescript
|
|
229
|
+
* const built = await exchange.buildOrder({
|
|
230
|
+
* outcome: market.yes,
|
|
231
|
+
* side: "buy",
|
|
232
|
+
* type: "limit",
|
|
233
|
+
* amount: 10,
|
|
234
|
+
* price: 0.55
|
|
235
|
+
* });
|
|
236
|
+
* const order = await exchange.submitOrder(built);
|
|
237
|
+
* console.log(order.id, order.status);
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
submitOrder(built: BuiltOrder): Promise<Order>;
|
|
153
241
|
/**
|
|
154
242
|
* Create a new order.
|
|
155
243
|
*
|