pmxtjs 2.51.0 → 2.51.2
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 +28 -0
- package/dist/esm/generated/src/apis/DefaultApi.js +28 -0
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.js +3 -2
- package/dist/esm/pmxt/client.d.ts +21 -3
- package/dist/esm/pmxt/client.js +48 -18
- package/dist/esm/pmxt/escrow.js +109 -10
- package/dist/esm/pmxt/server-manager.js +5 -3
- package/dist/generated/src/apis/DefaultApi.d.ts +28 -0
- package/dist/generated/src/apis/DefaultApi.js +28 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -1
- package/dist/pmxt/client.d.ts +21 -3
- package/dist/pmxt/client.js +48 -17
- package/dist/pmxt/escrow.js +109 -10
- package/dist/pmxt/server-manager.js +5 -3
- package/generated/docs/DefaultApi.md +56 -56
- package/generated/package.json +1 -1
- package/generated/src/apis/DefaultApi.ts +28 -0
- package/index.ts +3 -2
- package/package.json +2 -2
- package/pmxt/client.ts +61 -17
- package/pmxt/escrow.ts +131 -11
- package/pmxt/server-manager.ts +5 -3
package/dist/esm/pmxt/escrow.js
CHANGED
|
@@ -9,6 +9,80 @@
|
|
|
9
9
|
* Mirrors `sdks/python/pmxt/escrow.py`.
|
|
10
10
|
*/
|
|
11
11
|
import { _tradingRequest, formatRoutePath, HOSTED_METHOD_ROUTES, resolveWalletAddress, } from "./hosted-routing.js";
|
|
12
|
+
import { ValidationError } from "./errors.js";
|
|
13
|
+
const APPROVAL_TOKENS = new Set(["usdc", "ctf"]);
|
|
14
|
+
const WITHDRAW_ACTIONS = new Set(["request", "claim", "cancel"]);
|
|
15
|
+
const USDC_SCALE = 1000000n;
|
|
16
|
+
function isDecimalTokenId(token) {
|
|
17
|
+
return /^[0-9]+$/.test(token);
|
|
18
|
+
}
|
|
19
|
+
function normalizeApprovalToken(token) {
|
|
20
|
+
if (typeof token !== "string") {
|
|
21
|
+
throw new ValidationError("token must be 'usdc', 'ctf', or a decimal CTF token_id string", "token");
|
|
22
|
+
}
|
|
23
|
+
const candidate = token.trim();
|
|
24
|
+
const normalized = candidate.toLowerCase();
|
|
25
|
+
if (APPROVAL_TOKENS.has(normalized)) {
|
|
26
|
+
return normalized;
|
|
27
|
+
}
|
|
28
|
+
if (isDecimalTokenId(candidate)) {
|
|
29
|
+
return candidate;
|
|
30
|
+
}
|
|
31
|
+
throw new ValidationError("token must be 'usdc', 'ctf', or a decimal CTF token_id string", "token");
|
|
32
|
+
}
|
|
33
|
+
function normalizeAmountWei(amountWei) {
|
|
34
|
+
if (amountWei === undefined) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
if (typeof amountWei !== "bigint") {
|
|
38
|
+
throw new ValidationError("amount_wei must be a non-negative integer", "amount_wei");
|
|
39
|
+
}
|
|
40
|
+
if (amountWei < 0n) {
|
|
41
|
+
throw new ValidationError("amount_wei must be non-negative", "amount_wei");
|
|
42
|
+
}
|
|
43
|
+
return amountWei.toString();
|
|
44
|
+
}
|
|
45
|
+
function validateUsdcDecimal(value, field) {
|
|
46
|
+
const match = /^([0-9]+)(?:\.([0-9]+))?$/.exec(value);
|
|
47
|
+
if (!match) {
|
|
48
|
+
throw new ValidationError(`${field} must be a finite positive number`, field);
|
|
49
|
+
}
|
|
50
|
+
const fractional = match[2] ?? "";
|
|
51
|
+
if (fractional.length > 6) {
|
|
52
|
+
throw new ValidationError(`${field} precision exceeds 6 decimals; max precision for USDC is 0.000001`, field);
|
|
53
|
+
}
|
|
54
|
+
const scaled = BigInt(match[1]) * USDC_SCALE + BigInt(fractional.padEnd(6, "0"));
|
|
55
|
+
if (scaled <= 0n) {
|
|
56
|
+
throw new ValidationError(`${field} must be positive`, field);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function normalizeUsdcAmount(value, field = "amount") {
|
|
60
|
+
if (typeof value === "bigint") {
|
|
61
|
+
if (value <= 0n) {
|
|
62
|
+
throw new ValidationError(`${field} must be positive`, field);
|
|
63
|
+
}
|
|
64
|
+
return value.toString();
|
|
65
|
+
}
|
|
66
|
+
if (typeof value === "number") {
|
|
67
|
+
if (!Number.isFinite(value)) {
|
|
68
|
+
throw new ValidationError(`${field} must be a finite positive number`, field);
|
|
69
|
+
}
|
|
70
|
+
validateUsdcDecimal(String(value), field);
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
73
|
+
if (typeof value === "string") {
|
|
74
|
+
const trimmed = value.trim();
|
|
75
|
+
validateUsdcDecimal(trimmed, field);
|
|
76
|
+
return trimmed;
|
|
77
|
+
}
|
|
78
|
+
throw new ValidationError(`${field} must be a finite positive number`, field);
|
|
79
|
+
}
|
|
80
|
+
function normalizeWithdrawAction(action) {
|
|
81
|
+
if (typeof action === "string" && WITHDRAW_ACTIONS.has(action)) {
|
|
82
|
+
return action;
|
|
83
|
+
}
|
|
84
|
+
throw new ValidationError("action must be 'request', 'claim', or 'cancel'", "action");
|
|
85
|
+
}
|
|
12
86
|
export class Escrow {
|
|
13
87
|
client;
|
|
14
88
|
constructor(client) {
|
|
@@ -19,13 +93,16 @@ export class Escrow {
|
|
|
19
93
|
* `amountWei` is omitted, the server returns an unlimited approval.
|
|
20
94
|
*/
|
|
21
95
|
async approveTx(token, amountWei) {
|
|
96
|
+
const address = resolveWalletAddress(this.client);
|
|
97
|
+
const approvalAmount = normalizeAmountWei(amountWei);
|
|
22
98
|
const route = HOSTED_METHOD_ROUTES.get("escrowApproveTx");
|
|
23
99
|
return _tradingRequest(this.client, {
|
|
24
100
|
method: route.method,
|
|
25
101
|
path: route.path,
|
|
26
102
|
body: {
|
|
27
|
-
token,
|
|
28
|
-
|
|
103
|
+
token: normalizeApprovalToken(token),
|
|
104
|
+
user_address: address,
|
|
105
|
+
...(approvalAmount === undefined ? {} : { amount_wei: approvalAmount }),
|
|
29
106
|
},
|
|
30
107
|
});
|
|
31
108
|
}
|
|
@@ -34,12 +111,15 @@ export class Escrow {
|
|
|
34
111
|
* grid). Accepts number, decimal string, or BigInt in micro-units.
|
|
35
112
|
*/
|
|
36
113
|
async depositTx(amount) {
|
|
114
|
+
const address = resolveWalletAddress(this.client);
|
|
37
115
|
const route = HOSTED_METHOD_ROUTES.get("escrowDepositTx");
|
|
38
116
|
return _tradingRequest(this.client, {
|
|
39
117
|
method: route.method,
|
|
40
118
|
path: route.path,
|
|
41
119
|
body: {
|
|
42
|
-
|
|
120
|
+
token: "usdc",
|
|
121
|
+
amount: normalizeUsdcAmount(amount),
|
|
122
|
+
user_address: address,
|
|
43
123
|
},
|
|
44
124
|
});
|
|
45
125
|
}
|
|
@@ -49,16 +129,31 @@ export class Escrow {
|
|
|
49
129
|
* the timelock, `cancel` aborts a pending request.
|
|
50
130
|
*/
|
|
51
131
|
async withdrawTx(action, amount) {
|
|
132
|
+
const normalizedAction = normalizeWithdrawAction(action);
|
|
133
|
+
const address = resolveWalletAddress(this.client);
|
|
52
134
|
const route = HOSTED_METHOD_ROUTES.get("escrowWithdrawTx");
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
135
|
+
if (normalizedAction === "request") {
|
|
136
|
+
if (amount === undefined) {
|
|
137
|
+
throw new ValidationError("amount is required when action='request'", "amount");
|
|
138
|
+
}
|
|
139
|
+
return _tradingRequest(this.client, {
|
|
140
|
+
method: route.method,
|
|
141
|
+
path: route.path,
|
|
142
|
+
body: {
|
|
143
|
+
action: normalizedAction,
|
|
144
|
+
token: "usdc",
|
|
145
|
+
amount: normalizeUsdcAmount(amount),
|
|
146
|
+
user_address: address,
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (amount !== undefined) {
|
|
151
|
+
throw new ValidationError(`amount must be omitted when action='${normalizedAction}'`, "amount");
|
|
152
|
+
}
|
|
58
153
|
return _tradingRequest(this.client, {
|
|
59
154
|
method: route.method,
|
|
60
155
|
path: route.path,
|
|
61
|
-
body: { action,
|
|
156
|
+
body: { action: normalizedAction, token: "usdc", user_address: address },
|
|
62
157
|
});
|
|
63
158
|
}
|
|
64
159
|
/**
|
|
@@ -67,12 +162,16 @@ export class Escrow {
|
|
|
67
162
|
*/
|
|
68
163
|
async withdrawals(opts = {}) {
|
|
69
164
|
const address = resolveWalletAddress(this.client, opts.address);
|
|
165
|
+
const include = (opts.include ?? "pending,events").trim();
|
|
166
|
+
if (!include) {
|
|
167
|
+
throw new ValidationError("include must not be empty", "include");
|
|
168
|
+
}
|
|
70
169
|
const route = HOSTED_METHOD_ROUTES.get("escrowWithdrawals");
|
|
71
170
|
const path = formatRoutePath(route, { address });
|
|
72
171
|
return _tradingRequest(this.client, {
|
|
73
172
|
method: route.method,
|
|
74
173
|
path,
|
|
75
|
-
params: { include
|
|
174
|
+
params: { include },
|
|
76
175
|
});
|
|
77
176
|
}
|
|
78
177
|
}
|
|
@@ -81,12 +81,14 @@ export class ServerManager {
|
|
|
81
81
|
* Check if the server is running.
|
|
82
82
|
*/
|
|
83
83
|
async isServerRunning() {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
const info = this.getServerInfo();
|
|
85
|
+
if (!info?.port) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
86
88
|
try {
|
|
87
89
|
// Use native fetch to check health on the actual running port
|
|
88
90
|
// This avoids issues where this.api is configured with the wrong port
|
|
89
|
-
const response = await fetch(`http://localhost:${port}/health`, {
|
|
91
|
+
const response = await fetch(`http://localhost:${info.port}/health`, {
|
|
90
92
|
signal: AbortSignal.timeout(5_000),
|
|
91
93
|
});
|
|
92
94
|
if (response.ok) {
|
|
@@ -673,6 +673,7 @@ export declare const BuildOrderOperationExchangeEnum: {
|
|
|
673
673
|
readonly Hyperliquid: "hyperliquid";
|
|
674
674
|
readonly Suibets: "suibets";
|
|
675
675
|
readonly Rain: "rain";
|
|
676
|
+
readonly Hunch: "hunch";
|
|
676
677
|
readonly Mock: "mock";
|
|
677
678
|
readonly Router: "router";
|
|
678
679
|
};
|
|
@@ -696,6 +697,7 @@ export declare const CancelOrderOperationExchangeEnum: {
|
|
|
696
697
|
readonly Hyperliquid: "hyperliquid";
|
|
697
698
|
readonly Suibets: "suibets";
|
|
698
699
|
readonly Rain: "rain";
|
|
700
|
+
readonly Hunch: "hunch";
|
|
699
701
|
readonly Mock: "mock";
|
|
700
702
|
readonly Router: "router";
|
|
701
703
|
};
|
|
@@ -719,6 +721,7 @@ export declare const CloseOperationExchangeEnum: {
|
|
|
719
721
|
readonly Hyperliquid: "hyperliquid";
|
|
720
722
|
readonly Suibets: "suibets";
|
|
721
723
|
readonly Rain: "rain";
|
|
724
|
+
readonly Hunch: "hunch";
|
|
722
725
|
readonly Mock: "mock";
|
|
723
726
|
readonly Router: "router";
|
|
724
727
|
};
|
|
@@ -749,6 +752,7 @@ export declare const CreateOrderOperationExchangeEnum: {
|
|
|
749
752
|
readonly Hyperliquid: "hyperliquid";
|
|
750
753
|
readonly Suibets: "suibets";
|
|
751
754
|
readonly Rain: "rain";
|
|
755
|
+
readonly Hunch: "hunch";
|
|
752
756
|
readonly Mock: "mock";
|
|
753
757
|
readonly Router: "router";
|
|
754
758
|
};
|
|
@@ -772,6 +776,7 @@ export declare const FetchAllOrdersExchangeEnum: {
|
|
|
772
776
|
readonly Hyperliquid: "hyperliquid";
|
|
773
777
|
readonly Suibets: "suibets";
|
|
774
778
|
readonly Rain: "rain";
|
|
779
|
+
readonly Hunch: "hunch";
|
|
775
780
|
readonly Mock: "mock";
|
|
776
781
|
readonly Router: "router";
|
|
777
782
|
};
|
|
@@ -814,6 +819,7 @@ export declare const FetchBalanceExchangeEnum: {
|
|
|
814
819
|
readonly Hyperliquid: "hyperliquid";
|
|
815
820
|
readonly Suibets: "suibets";
|
|
816
821
|
readonly Rain: "rain";
|
|
822
|
+
readonly Hunch: "hunch";
|
|
817
823
|
readonly Mock: "mock";
|
|
818
824
|
readonly Router: "router";
|
|
819
825
|
};
|
|
@@ -837,6 +843,7 @@ export declare const FetchClosedOrdersExchangeEnum: {
|
|
|
837
843
|
readonly Hyperliquid: "hyperliquid";
|
|
838
844
|
readonly Suibets: "suibets";
|
|
839
845
|
readonly Rain: "rain";
|
|
846
|
+
readonly Hunch: "hunch";
|
|
840
847
|
readonly Mock: "mock";
|
|
841
848
|
readonly Router: "router";
|
|
842
849
|
};
|
|
@@ -860,6 +867,7 @@ export declare const FetchEventExchangeEnum: {
|
|
|
860
867
|
readonly Hyperliquid: "hyperliquid";
|
|
861
868
|
readonly Suibets: "suibets";
|
|
862
869
|
readonly Rain: "rain";
|
|
870
|
+
readonly Hunch: "hunch";
|
|
863
871
|
readonly Mock: "mock";
|
|
864
872
|
readonly Router: "router";
|
|
865
873
|
};
|
|
@@ -930,6 +938,7 @@ export declare const FetchEventsExchangeEnum: {
|
|
|
930
938
|
readonly Hyperliquid: "hyperliquid";
|
|
931
939
|
readonly Suibets: "suibets";
|
|
932
940
|
readonly Rain: "rain";
|
|
941
|
+
readonly Hunch: "hunch";
|
|
933
942
|
readonly Mock: "mock";
|
|
934
943
|
readonly Router: "router";
|
|
935
944
|
};
|
|
@@ -981,6 +990,7 @@ export declare const FetchEventsPaginatedExchangeEnum: {
|
|
|
981
990
|
readonly Hyperliquid: "hyperliquid";
|
|
982
991
|
readonly Suibets: "suibets";
|
|
983
992
|
readonly Rain: "rain";
|
|
993
|
+
readonly Hunch: "hunch";
|
|
984
994
|
readonly Mock: "mock";
|
|
985
995
|
readonly Router: "router";
|
|
986
996
|
};
|
|
@@ -1032,6 +1042,7 @@ export declare const FetchMarketExchangeEnum: {
|
|
|
1032
1042
|
readonly Hyperliquid: "hyperliquid";
|
|
1033
1043
|
readonly Suibets: "suibets";
|
|
1034
1044
|
readonly Rain: "rain";
|
|
1045
|
+
readonly Hunch: "hunch";
|
|
1035
1046
|
readonly Mock: "mock";
|
|
1036
1047
|
readonly Router: "router";
|
|
1037
1048
|
};
|
|
@@ -1111,6 +1122,7 @@ export declare const FetchMarketsExchangeEnum: {
|
|
|
1111
1122
|
readonly Hyperliquid: "hyperliquid";
|
|
1112
1123
|
readonly Suibets: "suibets";
|
|
1113
1124
|
readonly Rain: "rain";
|
|
1125
|
+
readonly Hunch: "hunch";
|
|
1114
1126
|
readonly Mock: "mock";
|
|
1115
1127
|
readonly Router: "router";
|
|
1116
1128
|
};
|
|
@@ -1162,6 +1174,7 @@ export declare const FetchMarketsPaginatedExchangeEnum: {
|
|
|
1162
1174
|
readonly Hyperliquid: "hyperliquid";
|
|
1163
1175
|
readonly Suibets: "suibets";
|
|
1164
1176
|
readonly Rain: "rain";
|
|
1177
|
+
readonly Hunch: "hunch";
|
|
1165
1178
|
readonly Mock: "mock";
|
|
1166
1179
|
readonly Router: "router";
|
|
1167
1180
|
};
|
|
@@ -1223,6 +1236,7 @@ export declare const FetchMyTradesExchangeEnum: {
|
|
|
1223
1236
|
readonly Hyperliquid: "hyperliquid";
|
|
1224
1237
|
readonly Suibets: "suibets";
|
|
1225
1238
|
readonly Rain: "rain";
|
|
1239
|
+
readonly Hunch: "hunch";
|
|
1226
1240
|
readonly Mock: "mock";
|
|
1227
1241
|
readonly Router: "router";
|
|
1228
1242
|
};
|
|
@@ -1246,6 +1260,7 @@ export declare const FetchOHLCVExchangeEnum: {
|
|
|
1246
1260
|
readonly Hyperliquid: "hyperliquid";
|
|
1247
1261
|
readonly Suibets: "suibets";
|
|
1248
1262
|
readonly Rain: "rain";
|
|
1263
|
+
readonly Hunch: "hunch";
|
|
1249
1264
|
readonly Mock: "mock";
|
|
1250
1265
|
readonly Router: "router";
|
|
1251
1266
|
};
|
|
@@ -1269,6 +1284,7 @@ export declare const FetchOpenOrdersExchangeEnum: {
|
|
|
1269
1284
|
readonly Hyperliquid: "hyperliquid";
|
|
1270
1285
|
readonly Suibets: "suibets";
|
|
1271
1286
|
readonly Rain: "rain";
|
|
1287
|
+
readonly Hunch: "hunch";
|
|
1272
1288
|
readonly Mock: "mock";
|
|
1273
1289
|
readonly Router: "router";
|
|
1274
1290
|
};
|
|
@@ -1292,6 +1308,7 @@ export declare const FetchOrderExchangeEnum: {
|
|
|
1292
1308
|
readonly Hyperliquid: "hyperliquid";
|
|
1293
1309
|
readonly Suibets: "suibets";
|
|
1294
1310
|
readonly Rain: "rain";
|
|
1311
|
+
readonly Hunch: "hunch";
|
|
1295
1312
|
readonly Mock: "mock";
|
|
1296
1313
|
readonly Router: "router";
|
|
1297
1314
|
};
|
|
@@ -1315,6 +1332,7 @@ export declare const FetchOrderBookExchangeEnum: {
|
|
|
1315
1332
|
readonly Hyperliquid: "hyperliquid";
|
|
1316
1333
|
readonly Suibets: "suibets";
|
|
1317
1334
|
readonly Rain: "rain";
|
|
1335
|
+
readonly Hunch: "hunch";
|
|
1318
1336
|
readonly Mock: "mock";
|
|
1319
1337
|
readonly Router: "router";
|
|
1320
1338
|
};
|
|
@@ -1346,6 +1364,7 @@ export declare const FetchOrderBooksOperationExchangeEnum: {
|
|
|
1346
1364
|
readonly Hyperliquid: "hyperliquid";
|
|
1347
1365
|
readonly Suibets: "suibets";
|
|
1348
1366
|
readonly Rain: "rain";
|
|
1367
|
+
readonly Hunch: "hunch";
|
|
1349
1368
|
readonly Mock: "mock";
|
|
1350
1369
|
readonly Router: "router";
|
|
1351
1370
|
};
|
|
@@ -1369,6 +1388,7 @@ export declare const FetchPositionsExchangeEnum: {
|
|
|
1369
1388
|
readonly Hyperliquid: "hyperliquid";
|
|
1370
1389
|
readonly Suibets: "suibets";
|
|
1371
1390
|
readonly Rain: "rain";
|
|
1391
|
+
readonly Hunch: "hunch";
|
|
1372
1392
|
readonly Mock: "mock";
|
|
1373
1393
|
readonly Router: "router";
|
|
1374
1394
|
};
|
|
@@ -1420,6 +1440,7 @@ export declare const FetchSeriesExchangeEnum: {
|
|
|
1420
1440
|
readonly Hyperliquid: "hyperliquid";
|
|
1421
1441
|
readonly Suibets: "suibets";
|
|
1422
1442
|
readonly Rain: "rain";
|
|
1443
|
+
readonly Hunch: "hunch";
|
|
1423
1444
|
readonly Mock: "mock";
|
|
1424
1445
|
readonly Router: "router";
|
|
1425
1446
|
};
|
|
@@ -1443,6 +1464,7 @@ export declare const FetchTradesExchangeEnum: {
|
|
|
1443
1464
|
readonly Hyperliquid: "hyperliquid";
|
|
1444
1465
|
readonly Suibets: "suibets";
|
|
1445
1466
|
readonly Rain: "rain";
|
|
1467
|
+
readonly Hunch: "hunch";
|
|
1446
1468
|
readonly Mock: "mock";
|
|
1447
1469
|
readonly Router: "router";
|
|
1448
1470
|
};
|
|
@@ -1466,6 +1488,7 @@ export declare const FilterEventsOperationExchangeEnum: {
|
|
|
1466
1488
|
readonly Hyperliquid: "hyperliquid";
|
|
1467
1489
|
readonly Suibets: "suibets";
|
|
1468
1490
|
readonly Rain: "rain";
|
|
1491
|
+
readonly Hunch: "hunch";
|
|
1469
1492
|
readonly Mock: "mock";
|
|
1470
1493
|
readonly Router: "router";
|
|
1471
1494
|
};
|
|
@@ -1489,6 +1512,7 @@ export declare const FilterMarketsOperationExchangeEnum: {
|
|
|
1489
1512
|
readonly Hyperliquid: "hyperliquid";
|
|
1490
1513
|
readonly Suibets: "suibets";
|
|
1491
1514
|
readonly Rain: "rain";
|
|
1515
|
+
readonly Hunch: "hunch";
|
|
1492
1516
|
readonly Mock: "mock";
|
|
1493
1517
|
readonly Router: "router";
|
|
1494
1518
|
};
|
|
@@ -1512,6 +1536,7 @@ export declare const GetExecutionPriceOperationExchangeEnum: {
|
|
|
1512
1536
|
readonly Hyperliquid: "hyperliquid";
|
|
1513
1537
|
readonly Suibets: "suibets";
|
|
1514
1538
|
readonly Rain: "rain";
|
|
1539
|
+
readonly Hunch: "hunch";
|
|
1515
1540
|
readonly Mock: "mock";
|
|
1516
1541
|
readonly Router: "router";
|
|
1517
1542
|
};
|
|
@@ -1535,6 +1560,7 @@ export declare const GetExecutionPriceDetailedOperationExchangeEnum: {
|
|
|
1535
1560
|
readonly Hyperliquid: "hyperliquid";
|
|
1536
1561
|
readonly Suibets: "suibets";
|
|
1537
1562
|
readonly Rain: "rain";
|
|
1563
|
+
readonly Hunch: "hunch";
|
|
1538
1564
|
readonly Mock: "mock";
|
|
1539
1565
|
readonly Router: "router";
|
|
1540
1566
|
};
|
|
@@ -1558,6 +1584,7 @@ export declare const LoadMarketsOperationExchangeEnum: {
|
|
|
1558
1584
|
readonly Hyperliquid: "hyperliquid";
|
|
1559
1585
|
readonly Suibets: "suibets";
|
|
1560
1586
|
readonly Rain: "rain";
|
|
1587
|
+
readonly Hunch: "hunch";
|
|
1561
1588
|
readonly Mock: "mock";
|
|
1562
1589
|
readonly Router: "router";
|
|
1563
1590
|
};
|
|
@@ -1581,6 +1608,7 @@ export declare const SubmitOrderOperationExchangeEnum: {
|
|
|
1581
1608
|
readonly Hyperliquid: "hyperliquid";
|
|
1582
1609
|
readonly Suibets: "suibets";
|
|
1583
1610
|
readonly Rain: "rain";
|
|
1611
|
+
readonly Hunch: "hunch";
|
|
1584
1612
|
readonly Mock: "mock";
|
|
1585
1613
|
readonly Router: "router";
|
|
1586
1614
|
};
|
|
@@ -1603,6 +1603,7 @@ exports.BuildOrderOperationExchangeEnum = {
|
|
|
1603
1603
|
Hyperliquid: 'hyperliquid',
|
|
1604
1604
|
Suibets: 'suibets',
|
|
1605
1605
|
Rain: 'rain',
|
|
1606
|
+
Hunch: 'hunch',
|
|
1606
1607
|
Mock: 'mock',
|
|
1607
1608
|
Router: 'router'
|
|
1608
1609
|
};
|
|
@@ -1625,6 +1626,7 @@ exports.CancelOrderOperationExchangeEnum = {
|
|
|
1625
1626
|
Hyperliquid: 'hyperliquid',
|
|
1626
1627
|
Suibets: 'suibets',
|
|
1627
1628
|
Rain: 'rain',
|
|
1629
|
+
Hunch: 'hunch',
|
|
1628
1630
|
Mock: 'mock',
|
|
1629
1631
|
Router: 'router'
|
|
1630
1632
|
};
|
|
@@ -1647,6 +1649,7 @@ exports.CloseOperationExchangeEnum = {
|
|
|
1647
1649
|
Hyperliquid: 'hyperliquid',
|
|
1648
1650
|
Suibets: 'suibets',
|
|
1649
1651
|
Rain: 'rain',
|
|
1652
|
+
Hunch: 'hunch',
|
|
1650
1653
|
Mock: 'mock',
|
|
1651
1654
|
Router: 'router'
|
|
1652
1655
|
};
|
|
@@ -1675,6 +1678,7 @@ exports.CreateOrderOperationExchangeEnum = {
|
|
|
1675
1678
|
Hyperliquid: 'hyperliquid',
|
|
1676
1679
|
Suibets: 'suibets',
|
|
1677
1680
|
Rain: 'rain',
|
|
1681
|
+
Hunch: 'hunch',
|
|
1678
1682
|
Mock: 'mock',
|
|
1679
1683
|
Router: 'router'
|
|
1680
1684
|
};
|
|
@@ -1697,6 +1701,7 @@ exports.FetchAllOrdersExchangeEnum = {
|
|
|
1697
1701
|
Hyperliquid: 'hyperliquid',
|
|
1698
1702
|
Suibets: 'suibets',
|
|
1699
1703
|
Rain: 'rain',
|
|
1704
|
+
Hunch: 'hunch',
|
|
1700
1705
|
Mock: 'mock',
|
|
1701
1706
|
Router: 'router'
|
|
1702
1707
|
};
|
|
@@ -1736,6 +1741,7 @@ exports.FetchBalanceExchangeEnum = {
|
|
|
1736
1741
|
Hyperliquid: 'hyperliquid',
|
|
1737
1742
|
Suibets: 'suibets',
|
|
1738
1743
|
Rain: 'rain',
|
|
1744
|
+
Hunch: 'hunch',
|
|
1739
1745
|
Mock: 'mock',
|
|
1740
1746
|
Router: 'router'
|
|
1741
1747
|
};
|
|
@@ -1758,6 +1764,7 @@ exports.FetchClosedOrdersExchangeEnum = {
|
|
|
1758
1764
|
Hyperliquid: 'hyperliquid',
|
|
1759
1765
|
Suibets: 'suibets',
|
|
1760
1766
|
Rain: 'rain',
|
|
1767
|
+
Hunch: 'hunch',
|
|
1761
1768
|
Mock: 'mock',
|
|
1762
1769
|
Router: 'router'
|
|
1763
1770
|
};
|
|
@@ -1780,6 +1787,7 @@ exports.FetchEventExchangeEnum = {
|
|
|
1780
1787
|
Hyperliquid: 'hyperliquid',
|
|
1781
1788
|
Suibets: 'suibets',
|
|
1782
1789
|
Rain: 'rain',
|
|
1790
|
+
Hunch: 'hunch',
|
|
1783
1791
|
Mock: 'mock',
|
|
1784
1792
|
Router: 'router'
|
|
1785
1793
|
};
|
|
@@ -1844,6 +1852,7 @@ exports.FetchEventsExchangeEnum = {
|
|
|
1844
1852
|
Hyperliquid: 'hyperliquid',
|
|
1845
1853
|
Suibets: 'suibets',
|
|
1846
1854
|
Rain: 'rain',
|
|
1855
|
+
Hunch: 'hunch',
|
|
1847
1856
|
Mock: 'mock',
|
|
1848
1857
|
Router: 'router'
|
|
1849
1858
|
};
|
|
@@ -1891,6 +1900,7 @@ exports.FetchEventsPaginatedExchangeEnum = {
|
|
|
1891
1900
|
Hyperliquid: 'hyperliquid',
|
|
1892
1901
|
Suibets: 'suibets',
|
|
1893
1902
|
Rain: 'rain',
|
|
1903
|
+
Hunch: 'hunch',
|
|
1894
1904
|
Mock: 'mock',
|
|
1895
1905
|
Router: 'router'
|
|
1896
1906
|
};
|
|
@@ -1938,6 +1948,7 @@ exports.FetchMarketExchangeEnum = {
|
|
|
1938
1948
|
Hyperliquid: 'hyperliquid',
|
|
1939
1949
|
Suibets: 'suibets',
|
|
1940
1950
|
Rain: 'rain',
|
|
1951
|
+
Hunch: 'hunch',
|
|
1941
1952
|
Mock: 'mock',
|
|
1942
1953
|
Router: 'router'
|
|
1943
1954
|
};
|
|
@@ -2010,6 +2021,7 @@ exports.FetchMarketsExchangeEnum = {
|
|
|
2010
2021
|
Hyperliquid: 'hyperliquid',
|
|
2011
2022
|
Suibets: 'suibets',
|
|
2012
2023
|
Rain: 'rain',
|
|
2024
|
+
Hunch: 'hunch',
|
|
2013
2025
|
Mock: 'mock',
|
|
2014
2026
|
Router: 'router'
|
|
2015
2027
|
};
|
|
@@ -2057,6 +2069,7 @@ exports.FetchMarketsPaginatedExchangeEnum = {
|
|
|
2057
2069
|
Hyperliquid: 'hyperliquid',
|
|
2058
2070
|
Suibets: 'suibets',
|
|
2059
2071
|
Rain: 'rain',
|
|
2072
|
+
Hunch: 'hunch',
|
|
2060
2073
|
Mock: 'mock',
|
|
2061
2074
|
Router: 'router'
|
|
2062
2075
|
};
|
|
@@ -2113,6 +2126,7 @@ exports.FetchMyTradesExchangeEnum = {
|
|
|
2113
2126
|
Hyperliquid: 'hyperliquid',
|
|
2114
2127
|
Suibets: 'suibets',
|
|
2115
2128
|
Rain: 'rain',
|
|
2129
|
+
Hunch: 'hunch',
|
|
2116
2130
|
Mock: 'mock',
|
|
2117
2131
|
Router: 'router'
|
|
2118
2132
|
};
|
|
@@ -2135,6 +2149,7 @@ exports.FetchOHLCVExchangeEnum = {
|
|
|
2135
2149
|
Hyperliquid: 'hyperliquid',
|
|
2136
2150
|
Suibets: 'suibets',
|
|
2137
2151
|
Rain: 'rain',
|
|
2152
|
+
Hunch: 'hunch',
|
|
2138
2153
|
Mock: 'mock',
|
|
2139
2154
|
Router: 'router'
|
|
2140
2155
|
};
|
|
@@ -2157,6 +2172,7 @@ exports.FetchOpenOrdersExchangeEnum = {
|
|
|
2157
2172
|
Hyperliquid: 'hyperliquid',
|
|
2158
2173
|
Suibets: 'suibets',
|
|
2159
2174
|
Rain: 'rain',
|
|
2175
|
+
Hunch: 'hunch',
|
|
2160
2176
|
Mock: 'mock',
|
|
2161
2177
|
Router: 'router'
|
|
2162
2178
|
};
|
|
@@ -2179,6 +2195,7 @@ exports.FetchOrderExchangeEnum = {
|
|
|
2179
2195
|
Hyperliquid: 'hyperliquid',
|
|
2180
2196
|
Suibets: 'suibets',
|
|
2181
2197
|
Rain: 'rain',
|
|
2198
|
+
Hunch: 'hunch',
|
|
2182
2199
|
Mock: 'mock',
|
|
2183
2200
|
Router: 'router'
|
|
2184
2201
|
};
|
|
@@ -2201,6 +2218,7 @@ exports.FetchOrderBookExchangeEnum = {
|
|
|
2201
2218
|
Hyperliquid: 'hyperliquid',
|
|
2202
2219
|
Suibets: 'suibets',
|
|
2203
2220
|
Rain: 'rain',
|
|
2221
|
+
Hunch: 'hunch',
|
|
2204
2222
|
Mock: 'mock',
|
|
2205
2223
|
Router: 'router'
|
|
2206
2224
|
};
|
|
@@ -2230,6 +2248,7 @@ exports.FetchOrderBooksOperationExchangeEnum = {
|
|
|
2230
2248
|
Hyperliquid: 'hyperliquid',
|
|
2231
2249
|
Suibets: 'suibets',
|
|
2232
2250
|
Rain: 'rain',
|
|
2251
|
+
Hunch: 'hunch',
|
|
2233
2252
|
Mock: 'mock',
|
|
2234
2253
|
Router: 'router'
|
|
2235
2254
|
};
|
|
@@ -2252,6 +2271,7 @@ exports.FetchPositionsExchangeEnum = {
|
|
|
2252
2271
|
Hyperliquid: 'hyperliquid',
|
|
2253
2272
|
Suibets: 'suibets',
|
|
2254
2273
|
Rain: 'rain',
|
|
2274
|
+
Hunch: 'hunch',
|
|
2255
2275
|
Mock: 'mock',
|
|
2256
2276
|
Router: 'router'
|
|
2257
2277
|
};
|
|
@@ -2299,6 +2319,7 @@ exports.FetchSeriesExchangeEnum = {
|
|
|
2299
2319
|
Hyperliquid: 'hyperliquid',
|
|
2300
2320
|
Suibets: 'suibets',
|
|
2301
2321
|
Rain: 'rain',
|
|
2322
|
+
Hunch: 'hunch',
|
|
2302
2323
|
Mock: 'mock',
|
|
2303
2324
|
Router: 'router'
|
|
2304
2325
|
};
|
|
@@ -2321,6 +2342,7 @@ exports.FetchTradesExchangeEnum = {
|
|
|
2321
2342
|
Hyperliquid: 'hyperliquid',
|
|
2322
2343
|
Suibets: 'suibets',
|
|
2323
2344
|
Rain: 'rain',
|
|
2345
|
+
Hunch: 'hunch',
|
|
2324
2346
|
Mock: 'mock',
|
|
2325
2347
|
Router: 'router'
|
|
2326
2348
|
};
|
|
@@ -2343,6 +2365,7 @@ exports.FilterEventsOperationExchangeEnum = {
|
|
|
2343
2365
|
Hyperliquid: 'hyperliquid',
|
|
2344
2366
|
Suibets: 'suibets',
|
|
2345
2367
|
Rain: 'rain',
|
|
2368
|
+
Hunch: 'hunch',
|
|
2346
2369
|
Mock: 'mock',
|
|
2347
2370
|
Router: 'router'
|
|
2348
2371
|
};
|
|
@@ -2365,6 +2388,7 @@ exports.FilterMarketsOperationExchangeEnum = {
|
|
|
2365
2388
|
Hyperliquid: 'hyperliquid',
|
|
2366
2389
|
Suibets: 'suibets',
|
|
2367
2390
|
Rain: 'rain',
|
|
2391
|
+
Hunch: 'hunch',
|
|
2368
2392
|
Mock: 'mock',
|
|
2369
2393
|
Router: 'router'
|
|
2370
2394
|
};
|
|
@@ -2387,6 +2411,7 @@ exports.GetExecutionPriceOperationExchangeEnum = {
|
|
|
2387
2411
|
Hyperliquid: 'hyperliquid',
|
|
2388
2412
|
Suibets: 'suibets',
|
|
2389
2413
|
Rain: 'rain',
|
|
2414
|
+
Hunch: 'hunch',
|
|
2390
2415
|
Mock: 'mock',
|
|
2391
2416
|
Router: 'router'
|
|
2392
2417
|
};
|
|
@@ -2409,6 +2434,7 @@ exports.GetExecutionPriceDetailedOperationExchangeEnum = {
|
|
|
2409
2434
|
Hyperliquid: 'hyperliquid',
|
|
2410
2435
|
Suibets: 'suibets',
|
|
2411
2436
|
Rain: 'rain',
|
|
2437
|
+
Hunch: 'hunch',
|
|
2412
2438
|
Mock: 'mock',
|
|
2413
2439
|
Router: 'router'
|
|
2414
2440
|
};
|
|
@@ -2431,6 +2457,7 @@ exports.LoadMarketsOperationExchangeEnum = {
|
|
|
2431
2457
|
Hyperliquid: 'hyperliquid',
|
|
2432
2458
|
Suibets: 'suibets',
|
|
2433
2459
|
Rain: 'rain',
|
|
2460
|
+
Hunch: 'hunch',
|
|
2434
2461
|
Mock: 'mock',
|
|
2435
2462
|
Router: 'router'
|
|
2436
2463
|
};
|
|
@@ -2453,6 +2480,7 @@ exports.SubmitOrderOperationExchangeEnum = {
|
|
|
2453
2480
|
Hyperliquid: 'hyperliquid',
|
|
2454
2481
|
Suibets: 'suibets',
|
|
2455
2482
|
Rain: 'rain',
|
|
2483
|
+
Hunch: 'hunch',
|
|
2456
2484
|
Mock: 'mock',
|
|
2457
2485
|
Router: 'router'
|
|
2458
2486
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
* console.log(markets[0].title);
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
import { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi, Opinion, Metaculus, Smarkets, PolymarketUS, GeminiTitan, Hyperliquid, SuiBets, Rain, Mock } from "./pmxt/client.js";
|
|
20
|
+
import { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi, Opinion, Metaculus, Smarkets, PolymarketUS, GeminiTitan, Hyperliquid, SuiBets, Rain, Hunch, Mock } from "./pmxt/client.js";
|
|
21
21
|
import { Router } from "./pmxt/router.js";
|
|
22
22
|
import { ServerManager } from "./pmxt/server-manager.js";
|
|
23
23
|
import { FeedClient } from "./pmxt/feed-client.js";
|
|
24
24
|
import * as models from "./pmxt/models.js";
|
|
25
25
|
import * as errors from "./pmxt/errors.js";
|
|
26
|
-
export { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi, Opinion, Metaculus, Smarkets, PolymarketUS, GeminiTitan, Hyperliquid, SuiBets, Suibets, Rain, Mock, PolymarketOptions } from "./pmxt/client.js";
|
|
26
|
+
export { Exchange, Polymarket, Kalshi, KalshiDemo, Limitless, Myriad, Probable, Baozi, Opinion, Metaculus, Smarkets, PolymarketUS, GeminiTitan, Hyperliquid, SuiBets, Suibets, Rain, Hunch, Mock, PolymarketOptions } from "./pmxt/client.js";
|
|
27
27
|
export { FeedClient } from "./pmxt/feed-client.js";
|
|
28
28
|
export type { Ticker, Tickers, OHLCV, Market as FeedMarket, OracleRound, FeedClientOptions } from "./pmxt/feed-client.js";
|
|
29
29
|
export { Router } from "./pmxt/router.js";
|
|
@@ -97,6 +97,7 @@ declare const pmxt: {
|
|
|
97
97
|
SuiBets: typeof SuiBets;
|
|
98
98
|
Suibets: typeof SuiBets;
|
|
99
99
|
Rain: typeof Rain;
|
|
100
|
+
Hunch: typeof Hunch;
|
|
100
101
|
Mock: typeof Mock;
|
|
101
102
|
Router: typeof Router;
|
|
102
103
|
ServerManager: typeof ServerManager;
|
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
55
55
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
56
56
|
};
|
|
57
57
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
-
exports.server = exports.MarketList = exports.LIMITLESS_VENUE_ESCROW_ADDRESSES = exports.VENUE_ESCROW_ADDRESSES = exports.PREFUNDED_ESCROW_ADDRESSES = exports.resolvePmxtBaseUrl = exports.ENV = exports.LOCAL_URL = exports.HOSTED_URL = exports.ServerManager = exports.Router = exports.FeedClient = exports.Mock = exports.Rain = exports.Suibets = exports.SuiBets = exports.Hyperliquid = exports.GeminiTitan = exports.PolymarketUS = exports.Smarkets = exports.Metaculus = exports.Opinion = exports.Baozi = exports.Probable = exports.Myriad = exports.Limitless = exports.KalshiDemo = exports.Kalshi = exports.Polymarket = exports.Exchange = void 0;
|
|
58
|
+
exports.server = exports.MarketList = exports.LIMITLESS_VENUE_ESCROW_ADDRESSES = exports.VENUE_ESCROW_ADDRESSES = exports.PREFUNDED_ESCROW_ADDRESSES = exports.resolvePmxtBaseUrl = exports.ENV = exports.LOCAL_URL = exports.HOSTED_URL = exports.ServerManager = exports.Router = exports.FeedClient = exports.Mock = exports.Hunch = exports.Rain = exports.Suibets = exports.SuiBets = exports.Hyperliquid = exports.GeminiTitan = exports.PolymarketUS = exports.Smarkets = exports.Metaculus = exports.Opinion = exports.Baozi = exports.Probable = exports.Myriad = exports.Limitless = exports.KalshiDemo = exports.Kalshi = exports.Polymarket = exports.Exchange = void 0;
|
|
59
59
|
const client_js_1 = require("./pmxt/client.js");
|
|
60
60
|
const router_js_1 = require("./pmxt/router.js");
|
|
61
61
|
const server_manager_js_1 = require("./pmxt/server-manager.js");
|
|
@@ -80,6 +80,7 @@ Object.defineProperty(exports, "Hyperliquid", { enumerable: true, get: function
|
|
|
80
80
|
Object.defineProperty(exports, "SuiBets", { enumerable: true, get: function () { return client_js_2.SuiBets; } });
|
|
81
81
|
Object.defineProperty(exports, "Suibets", { enumerable: true, get: function () { return client_js_2.Suibets; } });
|
|
82
82
|
Object.defineProperty(exports, "Rain", { enumerable: true, get: function () { return client_js_2.Rain; } });
|
|
83
|
+
Object.defineProperty(exports, "Hunch", { enumerable: true, get: function () { return client_js_2.Hunch; } });
|
|
83
84
|
Object.defineProperty(exports, "Mock", { enumerable: true, get: function () { return client_js_2.Mock; } });
|
|
84
85
|
var feed_client_js_2 = require("./pmxt/feed-client.js");
|
|
85
86
|
Object.defineProperty(exports, "FeedClient", { enumerable: true, get: function () { return feed_client_js_2.FeedClient; } });
|
|
@@ -146,6 +147,7 @@ const pmxt = {
|
|
|
146
147
|
SuiBets: client_js_1.SuiBets,
|
|
147
148
|
Suibets: client_js_1.Suibets,
|
|
148
149
|
Rain: client_js_1.Rain,
|
|
150
|
+
Hunch: client_js_1.Hunch,
|
|
149
151
|
Mock: client_js_1.Mock,
|
|
150
152
|
Router: router_js_1.Router,
|
|
151
153
|
ServerManager: server_manager_js_1.ServerManager,
|