@nktkas/hyperliquid 0.24.1 → 0.24.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.
@@ -142,7 +142,7 @@ class ExchangeClient {
142
142
  * ```ts
143
143
  * import * as hl from "@nktkas/hyperliquid";
144
144
  *
145
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
145
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
146
146
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
147
147
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
148
148
  *
@@ -173,7 +173,7 @@ class ExchangeClient {
173
173
  * ```ts
174
174
  * import * as hl from "@nktkas/hyperliquid";
175
175
  *
176
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
176
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
177
177
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
178
178
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
179
179
  *
@@ -204,7 +204,7 @@ class ExchangeClient {
204
204
  * ```ts
205
205
  * import * as hl from "@nktkas/hyperliquid";
206
206
  *
207
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
207
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
208
208
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
209
209
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
210
210
  *
@@ -248,7 +248,7 @@ class ExchangeClient {
248
248
  * ```ts
249
249
  * import * as hl from "@nktkas/hyperliquid";
250
250
  *
251
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
251
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
252
252
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
253
253
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
254
254
  *
@@ -282,7 +282,7 @@ class ExchangeClient {
282
282
  * ```ts
283
283
  * import * as hl from "@nktkas/hyperliquid";
284
284
  *
285
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
285
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
286
286
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
287
287
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
288
288
  *
@@ -316,7 +316,7 @@ class ExchangeClient {
316
316
  * ```ts
317
317
  * import * as hl from "@nktkas/hyperliquid";
318
318
  *
319
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
319
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
320
320
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
321
321
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
322
322
  *
@@ -346,7 +346,7 @@ class ExchangeClient {
346
346
  * ```ts
347
347
  * import * as hl from "@nktkas/hyperliquid";
348
348
  *
349
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
349
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
350
350
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
351
351
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
352
352
  *
@@ -374,7 +374,7 @@ class ExchangeClient {
374
374
  * ```ts
375
375
  * import * as hl from "@nktkas/hyperliquid";
376
376
  *
377
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
377
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
378
378
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
379
379
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
380
380
  *
@@ -414,7 +414,7 @@ class ExchangeClient {
414
414
  * ```ts
415
415
  * import * as hl from "@nktkas/hyperliquid";
416
416
  *
417
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
417
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
418
418
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
419
419
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
420
420
  *
@@ -443,7 +443,7 @@ class ExchangeClient {
443
443
  * ```ts
444
444
  * import * as hl from "@nktkas/hyperliquid";
445
445
  *
446
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
446
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
447
447
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
448
448
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
449
449
  *
@@ -477,7 +477,7 @@ class ExchangeClient {
477
477
  * ```ts
478
478
  * import * as hl from "@nktkas/hyperliquid";
479
479
  *
480
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
480
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
481
481
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
482
482
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
483
483
  *
@@ -510,7 +510,7 @@ class ExchangeClient {
510
510
  * ```ts
511
511
  * import * as hl from "@nktkas/hyperliquid";
512
512
  *
513
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
513
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
514
514
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
515
515
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
516
516
  *
@@ -569,7 +569,7 @@ class ExchangeClient {
569
569
  * ```ts
570
570
  * import * as hl from "@nktkas/hyperliquid";
571
571
  *
572
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
572
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
573
573
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
574
574
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
575
575
  *
@@ -600,7 +600,7 @@ class ExchangeClient {
600
600
  * ```ts
601
601
  * import * as hl from "@nktkas/hyperliquid";
602
602
  *
603
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
603
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
604
604
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
605
605
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
606
606
  *
@@ -629,7 +629,7 @@ class ExchangeClient {
629
629
  * ```ts
630
630
  * import * as hl from "@nktkas/hyperliquid";
631
631
  *
632
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
632
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
633
633
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
634
634
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
635
635
  *
@@ -743,7 +743,7 @@ class ExchangeClient {
743
743
  * ```ts
744
744
  * import * as hl from "@nktkas/hyperliquid";
745
745
  *
746
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
746
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
747
747
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
748
748
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
749
749
  *
@@ -785,7 +785,7 @@ class ExchangeClient {
785
785
  * ```ts
786
786
  * import * as hl from "@nktkas/hyperliquid";
787
787
  *
788
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
788
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
789
789
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
790
790
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
791
791
  *
@@ -813,7 +813,7 @@ class ExchangeClient {
813
813
  * ```ts
814
814
  * import * as hl from "@nktkas/hyperliquid";
815
815
  *
816
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
816
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
817
817
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
818
818
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
819
819
  *
@@ -855,7 +855,7 @@ class ExchangeClient {
855
855
  * ```ts
856
856
  * import * as hl from "@nktkas/hyperliquid";
857
857
  *
858
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
858
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
859
859
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
860
860
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
861
861
  *
@@ -884,7 +884,7 @@ class ExchangeClient {
884
884
  * ```ts
885
885
  * import * as hl from "@nktkas/hyperliquid";
886
886
  *
887
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
887
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
888
888
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
889
889
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
890
890
  *
@@ -925,7 +925,7 @@ class ExchangeClient {
925
925
  * ```ts
926
926
  * import * as hl from "@nktkas/hyperliquid";
927
927
  *
928
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
928
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
929
929
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
930
930
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
931
931
  *
@@ -963,7 +963,7 @@ class ExchangeClient {
963
963
  * ```ts
964
964
  * import * as hl from "@nktkas/hyperliquid";
965
965
  *
966
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
966
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
967
967
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
968
968
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
969
969
  *
@@ -992,7 +992,7 @@ class ExchangeClient {
992
992
  * ```ts
993
993
  * import * as hl from "@nktkas/hyperliquid";
994
994
  *
995
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
995
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
996
996
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
997
997
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
998
998
  *
@@ -1021,7 +1021,7 @@ class ExchangeClient {
1021
1021
  * ```ts
1022
1022
  * import * as hl from "@nktkas/hyperliquid";
1023
1023
  *
1024
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1024
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1025
1025
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1026
1026
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1027
1027
  *
@@ -1060,7 +1060,7 @@ class ExchangeClient {
1060
1060
  * ```ts
1061
1061
  * import * as hl from "@nktkas/hyperliquid";
1062
1062
  *
1063
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1063
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1064
1064
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1065
1065
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1066
1066
  *
@@ -1095,7 +1095,7 @@ class ExchangeClient {
1095
1095
  * ```ts
1096
1096
  * import * as hl from "@nktkas/hyperliquid";
1097
1097
  *
1098
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1098
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1099
1099
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1100
1100
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1101
1101
  *
@@ -1124,7 +1124,7 @@ class ExchangeClient {
1124
1124
  * ```ts
1125
1125
  * import * as hl from "@nktkas/hyperliquid";
1126
1126
  *
1127
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1127
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1128
1128
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1129
1129
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1130
1130
  *
@@ -1153,7 +1153,7 @@ class ExchangeClient {
1153
1153
  * ```ts
1154
1154
  * import * as hl from "@nktkas/hyperliquid";
1155
1155
  *
1156
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1156
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1157
1157
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1158
1158
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1159
1159
  *
@@ -1187,7 +1187,7 @@ class ExchangeClient {
1187
1187
  * ```ts
1188
1188
  * import * as hl from "@nktkas/hyperliquid";
1189
1189
  *
1190
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1190
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1191
1191
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1192
1192
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1193
1193
  *
@@ -1216,7 +1216,7 @@ class ExchangeClient {
1216
1216
  * ```ts
1217
1217
  * import * as hl from "@nktkas/hyperliquid";
1218
1218
  *
1219
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1219
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1220
1220
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1221
1221
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1222
1222
  *
@@ -1247,7 +1247,7 @@ class ExchangeClient {
1247
1247
  * ```ts
1248
1248
  * import * as hl from "@nktkas/hyperliquid";
1249
1249
  *
1250
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1250
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1251
1251
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1252
1252
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1253
1253
  *
@@ -1277,7 +1277,7 @@ class ExchangeClient {
1277
1277
  * ```ts
1278
1278
  * import * as hl from "@nktkas/hyperliquid";
1279
1279
  *
1280
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1280
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1281
1281
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1282
1282
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1283
1283
  *
@@ -1316,7 +1316,7 @@ class ExchangeClient {
1316
1316
  * ```ts
1317
1317
  * import * as hl from "@nktkas/hyperliquid";
1318
1318
  *
1319
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1319
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1320
1320
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1321
1321
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1322
1322
  *
@@ -1346,7 +1346,7 @@ class ExchangeClient {
1346
1346
  * ```ts
1347
1347
  * import * as hl from "@nktkas/hyperliquid";
1348
1348
  *
1349
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1349
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1350
1350
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1351
1351
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1352
1352
  *
@@ -1376,7 +1376,7 @@ class ExchangeClient {
1376
1376
  * ```ts
1377
1377
  * import * as hl from "@nktkas/hyperliquid";
1378
1378
  *
1379
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1379
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1380
1380
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1381
1381
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1382
1382
  *
@@ -1407,7 +1407,7 @@ class ExchangeClient {
1407
1407
  * ```ts
1408
1408
  * import * as hl from "@nktkas/hyperliquid";
1409
1409
  *
1410
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1410
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1411
1411
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1412
1412
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1413
1413
  *
@@ -1438,7 +1438,7 @@ class ExchangeClient {
1438
1438
  * ```ts
1439
1439
  * import * as hl from "@nktkas/hyperliquid";
1440
1440
  *
1441
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1441
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1442
1442
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1443
1443
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1444
1444
  *
@@ -1467,7 +1467,7 @@ class ExchangeClient {
1467
1467
  * ```ts
1468
1468
  * import * as hl from "@nktkas/hyperliquid";
1469
1469
  *
1470
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1470
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1471
1471
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1472
1472
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1473
1473
  *
@@ -1500,7 +1500,7 @@ class ExchangeClient {
1500
1500
  * ```ts
1501
1501
  * import * as hl from "@nktkas/hyperliquid";
1502
1502
  *
1503
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1503
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1504
1504
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1505
1505
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1506
1506
  *
@@ -1529,7 +1529,7 @@ class ExchangeClient {
1529
1529
  * ```ts
1530
1530
  * import * as hl from "@nktkas/hyperliquid";
1531
1531
  *
1532
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1532
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1533
1533
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1534
1534
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1535
1535
  *
@@ -6,7 +6,7 @@
6
6
  * ```ts
7
7
  * import { actionSorter, signL1Action } from "@nktkas/hyperliquid/signing";
8
8
  *
9
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
9
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
10
10
  *
11
11
  * const action = actionSorter.cancel({
12
12
  * type: "cancel",
@@ -31,7 +31,7 @@
31
31
  * ```ts
32
32
  * import { actionSorter, signUserSignedAction, userSignedActionEip712Types } from "@nktkas/hyperliquid/signing";
33
33
  *
34
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
34
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
35
35
  *
36
36
  * const action = actionSorter.approveAgent({
37
37
  * type: "approveAgent",
@@ -153,7 +153,7 @@ export declare function createL1ActionHash(args: {
153
153
  * ```ts
154
154
  * import { actionSorter, signL1Action } from "@nktkas/hyperliquid/signing";
155
155
  *
156
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
156
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
157
157
  *
158
158
  * const action = actionSorter.cancel({
159
159
  * type: "cancel",
@@ -194,7 +194,7 @@ export declare function signL1Action(args: {
194
194
  * ```ts
195
195
  * import { actionSorter, signUserSignedAction, userSignedActionEip712Types } from "@nktkas/hyperliquid/signing";
196
196
  *
197
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
197
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
198
198
  *
199
199
  * const action = actionSorter.approveAgent({
200
200
  * type: "approveAgent",
@@ -7,7 +7,7 @@
7
7
  * ```ts
8
8
  * import { actionSorter, signL1Action } from "@nktkas/hyperliquid/signing";
9
9
  *
10
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
10
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
11
11
  *
12
12
  * const action = actionSorter.cancel({
13
13
  * type: "cancel",
@@ -32,7 +32,7 @@
32
32
  * ```ts
33
33
  * import { actionSorter, signUserSignedAction, userSignedActionEip712Types } from "@nktkas/hyperliquid/signing";
34
34
  *
35
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
35
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
36
36
  *
37
37
  * const action = actionSorter.approveAgent({
38
38
  * type: "approveAgent",
@@ -178,7 +178,7 @@ function toUint64Bytes(n) {
178
178
  * ```ts
179
179
  * import { actionSorter, signL1Action } from "@nktkas/hyperliquid/signing";
180
180
  *
181
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
181
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
182
182
  *
183
183
  * const action = actionSorter.cancel({
184
184
  * type: "cancel",
@@ -230,7 +230,7 @@ async function signL1Action(args) {
230
230
  * ```ts
231
231
  * import { actionSorter, signUserSignedAction, userSignedActionEip712Types } from "@nktkas/hyperliquid/signing";
232
232
  *
233
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
233
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
234
234
  *
235
235
  * const action = actionSorter.approveAgent({
236
236
  * type: "approveAgent",
@@ -107,7 +107,7 @@ class HttpTransport {
107
107
  return body;
108
108
  }
109
109
  catch (error) {
110
- if (error instanceof HttpRequestError)
110
+ if (error instanceof base_js_1.TransportError)
111
111
  throw error; // Re-throw known errors
112
112
  throw new HttpRequestError(undefined, { cause: error });
113
113
  }
@@ -1 +1 @@
1
- {"version":3,"file":"_websocket_async_request.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/_websocket_async_request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAuB,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAkBlG;;;GAGG;AACH,qBAAa,qBAAqB;IAgBlB,SAAS,CAAC,MAAM,EAAE,qBAAqB;IAfnD,SAAS,CAAC,MAAM,EAAE,MAAM,CAAK;IAC7B,SAAS,CAAC,KAAK,EAAE;QACb,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;QAEpB,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;QAE/B,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;KAClC,EAAE,CAAM;IACT,eAAe,EAAE,MAAM,CAAK;IAE5B;;;;OAIG;gBACmB,MAAM,EAAE,qBAAqB,EAAE,QAAQ,EAAE,sBAAsB;IAqFrF;;;OAGG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAC5D,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IA6ClH,6DAA6D;IAC7D,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;CAK7C"}
1
+ {"version":3,"file":"_websocket_async_request.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/_websocket_async_request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAuB,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAkBlG;;;GAGG;AACH,qBAAa,qBAAqB;IAgBlB,SAAS,CAAC,MAAM,EAAE,qBAAqB;IAfnD,SAAS,CAAC,MAAM,EAAE,MAAM,CAAK;IAC7B,SAAS,CAAC,KAAK,EAAE;QACb,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;QAEpB,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;QAE/B,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;KAClC,EAAE,CAAM;IACT,eAAe,EAAE,MAAM,CAAK;IAE5B;;;;OAIG;gBACmB,MAAM,EAAE,qBAAqB,EAAE,QAAQ,EAAE,sBAAsB;IAqFrF;;;OAGG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAC5D,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IAiDlH,6DAA6D;IAC7D,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;CAK7C"}
@@ -98,6 +98,10 @@ class WebSocketAsyncRequest {
98
98
  // Reject the request if the signal is aborted
99
99
  if (signal?.aborted)
100
100
  return Promise.reject(signal.reason);
101
+ // or if the WebSocket connection is permanently closed
102
+ if (this.socket.reconnectAbortController.signal.aborted) {
103
+ return Promise.reject(this.socket.reconnectAbortController.signal.reason);
104
+ }
101
105
  // Create a request
102
106
  let id;
103
107
  let request;
@@ -81,7 +81,7 @@ class WebSocketTransport {
81
81
  }, combinedSignal);
82
82
  }
83
83
  catch (error) {
84
- if (error instanceof WebSocketRequestError)
84
+ if (error instanceof base_js_1.TransportError)
85
85
  throw error; // Re-throw known errors
86
86
  throw new WebSocketRequestError(`Unknown error while making a WebSocket request: ${error}`, { cause: error });
87
87
  }
@@ -135,7 +135,7 @@ class WebSocketTransport {
135
135
  }
136
136
  }
137
137
  catch (error) {
138
- if (error instanceof WebSocketRequestError)
138
+ if (error instanceof base_js_1.TransportError)
139
139
  throw error; // Re-throw known errors
140
140
  throw new WebSocketRequestError(`Unknown error while unsubscribing from a WebSocket channel: ${error}`, { cause: error });
141
141
  }
@@ -153,7 +153,7 @@ class WebSocketTransport {
153
153
  };
154
154
  }
155
155
  catch (error) {
156
- if (error instanceof WebSocketRequestError)
156
+ if (error instanceof base_js_1.TransportError)
157
157
  throw error; // Re-throw known errors
158
158
  throw new WebSocketRequestError(`Unknown error while subscribing to a WebSocket channel: ${error}`, { cause: error });
159
159
  }