@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.
@@ -138,7 +138,7 @@ export class ExchangeClient {
138
138
  * ```ts
139
139
  * import * as hl from "@nktkas/hyperliquid";
140
140
  *
141
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
141
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
142
142
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
143
143
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
144
144
  *
@@ -169,7 +169,7 @@ export class ExchangeClient {
169
169
  * ```ts
170
170
  * import * as hl from "@nktkas/hyperliquid";
171
171
  *
172
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
172
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
173
173
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
174
174
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
175
175
  *
@@ -200,7 +200,7 @@ export class ExchangeClient {
200
200
  * ```ts
201
201
  * import * as hl from "@nktkas/hyperliquid";
202
202
  *
203
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
203
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
204
204
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
205
205
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
206
206
  *
@@ -244,7 +244,7 @@ export class ExchangeClient {
244
244
  * ```ts
245
245
  * import * as hl from "@nktkas/hyperliquid";
246
246
  *
247
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
247
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
248
248
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
249
249
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
250
250
  *
@@ -278,7 +278,7 @@ export class ExchangeClient {
278
278
  * ```ts
279
279
  * import * as hl from "@nktkas/hyperliquid";
280
280
  *
281
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
281
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
282
282
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
283
283
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
284
284
  *
@@ -312,7 +312,7 @@ export class ExchangeClient {
312
312
  * ```ts
313
313
  * import * as hl from "@nktkas/hyperliquid";
314
314
  *
315
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
315
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
316
316
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
317
317
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
318
318
  *
@@ -342,7 +342,7 @@ export class ExchangeClient {
342
342
  * ```ts
343
343
  * import * as hl from "@nktkas/hyperliquid";
344
344
  *
345
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
345
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
346
346
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
347
347
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
348
348
  *
@@ -370,7 +370,7 @@ export class ExchangeClient {
370
370
  * ```ts
371
371
  * import * as hl from "@nktkas/hyperliquid";
372
372
  *
373
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
373
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
374
374
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
375
375
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
376
376
  *
@@ -410,7 +410,7 @@ export class ExchangeClient {
410
410
  * ```ts
411
411
  * import * as hl from "@nktkas/hyperliquid";
412
412
  *
413
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
413
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
414
414
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
415
415
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
416
416
  *
@@ -439,7 +439,7 @@ export class ExchangeClient {
439
439
  * ```ts
440
440
  * import * as hl from "@nktkas/hyperliquid";
441
441
  *
442
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
442
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
443
443
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
444
444
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
445
445
  *
@@ -473,7 +473,7 @@ export class ExchangeClient {
473
473
  * ```ts
474
474
  * import * as hl from "@nktkas/hyperliquid";
475
475
  *
476
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
476
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
477
477
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
478
478
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
479
479
  *
@@ -506,7 +506,7 @@ export class ExchangeClient {
506
506
  * ```ts
507
507
  * import * as hl from "@nktkas/hyperliquid";
508
508
  *
509
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
509
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
510
510
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
511
511
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
512
512
  *
@@ -565,7 +565,7 @@ export class ExchangeClient {
565
565
  * ```ts
566
566
  * import * as hl from "@nktkas/hyperliquid";
567
567
  *
568
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
568
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
569
569
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
570
570
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
571
571
  *
@@ -596,7 +596,7 @@ export class ExchangeClient {
596
596
  * ```ts
597
597
  * import * as hl from "@nktkas/hyperliquid";
598
598
  *
599
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
599
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
600
600
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
601
601
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
602
602
  *
@@ -625,7 +625,7 @@ export class ExchangeClient {
625
625
  * ```ts
626
626
  * import * as hl from "@nktkas/hyperliquid";
627
627
  *
628
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
628
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
629
629
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
630
630
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
631
631
  *
@@ -739,7 +739,7 @@ export class ExchangeClient {
739
739
  * ```ts
740
740
  * import * as hl from "@nktkas/hyperliquid";
741
741
  *
742
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
742
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
743
743
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
744
744
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
745
745
  *
@@ -781,7 +781,7 @@ export class ExchangeClient {
781
781
  * ```ts
782
782
  * import * as hl from "@nktkas/hyperliquid";
783
783
  *
784
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
784
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
785
785
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
786
786
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
787
787
  *
@@ -809,7 +809,7 @@ export class ExchangeClient {
809
809
  * ```ts
810
810
  * import * as hl from "@nktkas/hyperliquid";
811
811
  *
812
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
812
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
813
813
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
814
814
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
815
815
  *
@@ -851,7 +851,7 @@ export class ExchangeClient {
851
851
  * ```ts
852
852
  * import * as hl from "@nktkas/hyperliquid";
853
853
  *
854
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
854
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
855
855
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
856
856
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
857
857
  *
@@ -880,7 +880,7 @@ export class ExchangeClient {
880
880
  * ```ts
881
881
  * import * as hl from "@nktkas/hyperliquid";
882
882
  *
883
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
883
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
884
884
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
885
885
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
886
886
  *
@@ -921,7 +921,7 @@ export class ExchangeClient {
921
921
  * ```ts
922
922
  * import * as hl from "@nktkas/hyperliquid";
923
923
  *
924
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
924
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
925
925
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
926
926
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
927
927
  *
@@ -959,7 +959,7 @@ export class ExchangeClient {
959
959
  * ```ts
960
960
  * import * as hl from "@nktkas/hyperliquid";
961
961
  *
962
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
962
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
963
963
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
964
964
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
965
965
  *
@@ -988,7 +988,7 @@ export class ExchangeClient {
988
988
  * ```ts
989
989
  * import * as hl from "@nktkas/hyperliquid";
990
990
  *
991
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
991
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
992
992
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
993
993
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
994
994
  *
@@ -1017,7 +1017,7 @@ export class ExchangeClient {
1017
1017
  * ```ts
1018
1018
  * import * as hl from "@nktkas/hyperliquid";
1019
1019
  *
1020
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1020
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1021
1021
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1022
1022
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1023
1023
  *
@@ -1056,7 +1056,7 @@ export class ExchangeClient {
1056
1056
  * ```ts
1057
1057
  * import * as hl from "@nktkas/hyperliquid";
1058
1058
  *
1059
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1059
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1060
1060
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1061
1061
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1062
1062
  *
@@ -1091,7 +1091,7 @@ export class ExchangeClient {
1091
1091
  * ```ts
1092
1092
  * import * as hl from "@nktkas/hyperliquid";
1093
1093
  *
1094
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1094
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1095
1095
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1096
1096
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1097
1097
  *
@@ -1120,7 +1120,7 @@ export class ExchangeClient {
1120
1120
  * ```ts
1121
1121
  * import * as hl from "@nktkas/hyperliquid";
1122
1122
  *
1123
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1123
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1124
1124
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1125
1125
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1126
1126
  *
@@ -1149,7 +1149,7 @@ export class ExchangeClient {
1149
1149
  * ```ts
1150
1150
  * import * as hl from "@nktkas/hyperliquid";
1151
1151
  *
1152
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1152
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1153
1153
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1154
1154
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1155
1155
  *
@@ -1183,7 +1183,7 @@ export class ExchangeClient {
1183
1183
  * ```ts
1184
1184
  * import * as hl from "@nktkas/hyperliquid";
1185
1185
  *
1186
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1186
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1187
1187
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1188
1188
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1189
1189
  *
@@ -1212,7 +1212,7 @@ export class ExchangeClient {
1212
1212
  * ```ts
1213
1213
  * import * as hl from "@nktkas/hyperliquid";
1214
1214
  *
1215
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1215
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1216
1216
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1217
1217
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1218
1218
  *
@@ -1243,7 +1243,7 @@ export class ExchangeClient {
1243
1243
  * ```ts
1244
1244
  * import * as hl from "@nktkas/hyperliquid";
1245
1245
  *
1246
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1246
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1247
1247
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1248
1248
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1249
1249
  *
@@ -1273,7 +1273,7 @@ export class ExchangeClient {
1273
1273
  * ```ts
1274
1274
  * import * as hl from "@nktkas/hyperliquid";
1275
1275
  *
1276
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1276
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1277
1277
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1278
1278
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1279
1279
  *
@@ -1312,7 +1312,7 @@ export class ExchangeClient {
1312
1312
  * ```ts
1313
1313
  * import * as hl from "@nktkas/hyperliquid";
1314
1314
  *
1315
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1315
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1316
1316
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1317
1317
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1318
1318
  *
@@ -1342,7 +1342,7 @@ export class ExchangeClient {
1342
1342
  * ```ts
1343
1343
  * import * as hl from "@nktkas/hyperliquid";
1344
1344
  *
1345
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1345
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1346
1346
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1347
1347
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1348
1348
  *
@@ -1372,7 +1372,7 @@ export class ExchangeClient {
1372
1372
  * ```ts
1373
1373
  * import * as hl from "@nktkas/hyperliquid";
1374
1374
  *
1375
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1375
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1376
1376
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1377
1377
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1378
1378
  *
@@ -1403,7 +1403,7 @@ export class ExchangeClient {
1403
1403
  * ```ts
1404
1404
  * import * as hl from "@nktkas/hyperliquid";
1405
1405
  *
1406
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1406
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1407
1407
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1408
1408
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1409
1409
  *
@@ -1434,7 +1434,7 @@ export class ExchangeClient {
1434
1434
  * ```ts
1435
1435
  * import * as hl from "@nktkas/hyperliquid";
1436
1436
  *
1437
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1437
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1438
1438
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1439
1439
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1440
1440
  *
@@ -1463,7 +1463,7 @@ export class ExchangeClient {
1463
1463
  * ```ts
1464
1464
  * import * as hl from "@nktkas/hyperliquid";
1465
1465
  *
1466
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1466
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1467
1467
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1468
1468
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1469
1469
  *
@@ -1496,7 +1496,7 @@ export class ExchangeClient {
1496
1496
  * ```ts
1497
1497
  * import * as hl from "@nktkas/hyperliquid";
1498
1498
  *
1499
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1499
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1500
1500
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1501
1501
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1502
1502
  *
@@ -1525,7 +1525,7 @@ export class ExchangeClient {
1525
1525
  * ```ts
1526
1526
  * import * as hl from "@nktkas/hyperliquid";
1527
1527
  *
1528
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
1528
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
1529
1529
  * const transport = new hl.HttpTransport(); // or `WebSocketTransport`
1530
1530
  * const exchClient = new hl.ExchangeClient({ wallet: privateKey, transport });
1531
1531
  *
@@ -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",
@@ -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",
@@ -168,7 +168,7 @@ function toUint64Bytes(n) {
168
168
  * ```ts
169
169
  * import { actionSorter, signL1Action } from "@nktkas/hyperliquid/signing";
170
170
  *
171
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
171
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
172
172
  *
173
173
  * const action = actionSorter.cancel({
174
174
  * type: "cancel",
@@ -220,7 +220,7 @@ export async function signL1Action(args) {
220
220
  * ```ts
221
221
  * import { actionSorter, signUserSignedAction, userSignedActionEip712Types } from "@nktkas/hyperliquid/signing";
222
222
  *
223
- * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly`
223
+ * const privateKey = "0x..."; // `viem`, `ethers`, or private key directly
224
224
  *
225
225
  * const action = actionSorter.approveAgent({
226
226
  * type: "approveAgent",
@@ -103,7 +103,7 @@ export class HttpTransport {
103
103
  return body;
104
104
  }
105
105
  catch (error) {
106
- if (error instanceof HttpRequestError)
106
+ if (error instanceof TransportError)
107
107
  throw error; // Re-throw known errors
108
108
  throw new HttpRequestError(undefined, { cause: error });
109
109
  }
@@ -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"}
@@ -95,6 +95,10 @@ export class WebSocketAsyncRequest {
95
95
  // Reject the request if the signal is aborted
96
96
  if (signal?.aborted)
97
97
  return Promise.reject(signal.reason);
98
+ // or if the WebSocket connection is permanently closed
99
+ if (this.socket.reconnectAbortController.signal.aborted) {
100
+ return Promise.reject(this.socket.reconnectAbortController.signal.reason);
101
+ }
98
102
  // Create a request
99
103
  let id;
100
104
  let request;
@@ -77,7 +77,7 @@ export class WebSocketTransport {
77
77
  }, combinedSignal);
78
78
  }
79
79
  catch (error) {
80
- if (error instanceof WebSocketRequestError)
80
+ if (error instanceof TransportError)
81
81
  throw error; // Re-throw known errors
82
82
  throw new WebSocketRequestError(`Unknown error while making a WebSocket request: ${error}`, { cause: error });
83
83
  }
@@ -131,7 +131,7 @@ export class WebSocketTransport {
131
131
  }
132
132
  }
133
133
  catch (error) {
134
- if (error instanceof WebSocketRequestError)
134
+ if (error instanceof TransportError)
135
135
  throw error; // Re-throw known errors
136
136
  throw new WebSocketRequestError(`Unknown error while unsubscribing from a WebSocket channel: ${error}`, { cause: error });
137
137
  }
@@ -149,7 +149,7 @@ export class WebSocketTransport {
149
149
  };
150
150
  }
151
151
  catch (error) {
152
- if (error instanceof WebSocketRequestError)
152
+ if (error instanceof TransportError)
153
153
  throw error; // Re-throw known errors
154
154
  throw new WebSocketRequestError(`Unknown error while subscribing to a WebSocket channel: ${error}`, { cause: error });
155
155
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nktkas/hyperliquid",
3
- "version": "0.24.1",
3
+ "version": "0.24.2",
4
4
  "description": "Unofficial Hyperliquid API SDK for all major JS runtimes, written in TypeScript.",
5
5
  "keywords": [
6
6
  "api",