@nktkas/hyperliquid 0.19.2 → 0.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.
Files changed (123) hide show
  1. package/README.md +21 -29
  2. package/esm/_dnt.polyfills.d.ts +20 -0
  3. package/esm/_dnt.polyfills.d.ts.map +1 -0
  4. package/esm/_dnt.polyfills.js +12 -0
  5. package/esm/mod.d.ts +3 -0
  6. package/esm/mod.d.ts.map +1 -1
  7. package/esm/mod.js +2 -0
  8. package/esm/src/base.d.ts +1 -47
  9. package/esm/src/base.d.ts.map +1 -1
  10. package/esm/src/base.js +1 -8
  11. package/esm/src/clients/event.d.ts +2 -3
  12. package/esm/src/clients/event.d.ts.map +1 -1
  13. package/esm/src/clients/event.js +49 -57
  14. package/esm/src/clients/public.d.ts +24 -5
  15. package/esm/src/clients/public.d.ts.map +1 -1
  16. package/esm/src/clients/public.js +23 -7
  17. package/esm/src/clients/wallet.d.ts +12 -13
  18. package/esm/src/clients/wallet.d.ts.map +1 -1
  19. package/esm/src/clients/wallet.js +55 -265
  20. package/esm/src/signing.d.ts +5 -0
  21. package/esm/src/signing.d.ts.map +1 -1
  22. package/esm/src/signing.js +24 -5
  23. package/esm/src/transports/base.d.ts +49 -0
  24. package/esm/src/transports/base.d.ts.map +1 -0
  25. package/esm/src/transports/base.js +8 -0
  26. package/esm/src/transports/http/http_transport.d.ts +8 -5
  27. package/esm/src/transports/http/http_transport.d.ts.map +1 -1
  28. package/esm/src/transports/http/http_transport.js +15 -62
  29. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +36 -39
  30. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  31. package/esm/src/transports/websocket/_reconnecting_websocket.d.ts +18 -25
  32. package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  33. package/esm/src/transports/websocket/_reconnecting_websocket.js +80 -179
  34. package/{script/src/transports/websocket/_websocket_request_dispatcher.d.ts → esm/src/transports/websocket/_websocket_async_request.d.ts} +14 -18
  35. package/esm/src/transports/websocket/_websocket_async_request.d.ts.map +1 -0
  36. package/esm/src/transports/websocket/{_websocket_request_dispatcher.js → _websocket_async_request.js} +41 -74
  37. package/esm/src/transports/websocket/websocket_transport.d.ts +38 -28
  38. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  39. package/esm/src/transports/websocket/websocket_transport.js +61 -76
  40. package/esm/src/types/info/assets.d.ts +0 -48
  41. package/esm/src/types/info/assets.d.ts.map +1 -1
  42. package/esm/src/types/info/markets.d.ts +52 -0
  43. package/esm/src/types/info/markets.d.ts.map +1 -0
  44. package/esm/src/types/info/markets.js +1 -0
  45. package/esm/src/types/info/requests.d.ts +9 -0
  46. package/esm/src/types/info/requests.d.ts.map +1 -1
  47. package/esm/src/types/mod.d.ts +4 -0
  48. package/esm/src/types/mod.d.ts.map +1 -1
  49. package/esm/src/types/mod.js +3 -1
  50. package/package.json +12 -9
  51. package/script/_dnt.polyfills.d.ts +20 -0
  52. package/script/_dnt.polyfills.d.ts.map +1 -0
  53. package/script/_dnt.polyfills.js +23 -0
  54. package/script/mod.d.ts +3 -0
  55. package/script/mod.d.ts.map +1 -1
  56. package/script/mod.js +3 -1
  57. package/script/src/base.d.ts +1 -47
  58. package/script/src/base.d.ts.map +1 -1
  59. package/script/src/base.js +2 -10
  60. package/script/src/clients/event.d.ts +2 -3
  61. package/script/src/clients/event.d.ts.map +1 -1
  62. package/script/src/clients/event.js +49 -57
  63. package/script/src/clients/public.d.ts +24 -5
  64. package/script/src/clients/public.d.ts.map +1 -1
  65. package/script/src/clients/public.js +23 -7
  66. package/script/src/clients/wallet.d.ts +12 -13
  67. package/script/src/clients/wallet.d.ts.map +1 -1
  68. package/script/src/clients/wallet.js +55 -265
  69. package/script/src/signing.d.ts +5 -0
  70. package/script/src/signing.d.ts.map +1 -1
  71. package/script/src/signing.js +75 -56
  72. package/script/src/transports/base.d.ts +49 -0
  73. package/script/src/transports/base.d.ts.map +1 -0
  74. package/script/src/transports/base.js +22 -0
  75. package/script/src/transports/http/http_transport.d.ts +8 -5
  76. package/script/src/transports/http/http_transport.d.ts.map +1 -1
  77. package/script/src/transports/http/http_transport.js +16 -63
  78. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +36 -39
  79. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  80. package/script/src/transports/websocket/_reconnecting_websocket.d.ts +18 -25
  81. package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  82. package/script/src/transports/websocket/_reconnecting_websocket.js +81 -180
  83. package/{esm/src/transports/websocket/_websocket_request_dispatcher.d.ts → script/src/transports/websocket/_websocket_async_request.d.ts} +14 -18
  84. package/script/src/transports/websocket/_websocket_async_request.d.ts.map +1 -0
  85. package/script/src/transports/websocket/{_websocket_request_dispatcher.js → _websocket_async_request.js} +44 -77
  86. package/script/src/transports/websocket/websocket_transport.d.ts +38 -28
  87. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  88. package/script/src/transports/websocket/websocket_transport.js +63 -78
  89. package/script/src/types/info/assets.d.ts +0 -48
  90. package/script/src/types/info/assets.d.ts.map +1 -1
  91. package/script/src/types/info/markets.d.ts +52 -0
  92. package/script/src/types/info/markets.d.ts.map +1 -0
  93. package/script/{deps/jsr.io/@noble/hashes/1.8.0/src/crypto.js → src/types/info/markets.js} +0 -2
  94. package/script/src/types/info/requests.d.ts +9 -0
  95. package/script/src/types/info/requests.d.ts.map +1 -1
  96. package/script/src/types/mod.d.ts +4 -0
  97. package/script/src/types/mod.d.ts.map +1 -1
  98. package/script/src/types/mod.js +25 -22
  99. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.d.ts +0 -55
  100. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.d.ts.map +0 -1
  101. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.js +0 -66
  102. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/crypto.d.ts +0 -2
  103. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/crypto.d.ts.map +0 -1
  104. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/crypto.js +0 -1
  105. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.d.ts +0 -53
  106. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.d.ts.map +0 -1
  107. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.js +0 -294
  108. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/utils.d.ts +0 -161
  109. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/utils.d.ts.map +0 -1
  110. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/utils.js +0 -280
  111. package/esm/src/transports/websocket/_websocket_request_dispatcher.d.ts.map +0 -1
  112. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.d.ts +0 -55
  113. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.d.ts.map +0 -1
  114. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.js +0 -99
  115. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/crypto.d.ts +0 -2
  116. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/crypto.d.ts.map +0 -1
  117. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.d.ts +0 -53
  118. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.d.ts.map +0 -1
  119. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.js +0 -309
  120. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/utils.d.ts +0 -161
  121. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/utils.d.ts.map +0 -1
  122. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/utils.js +0 -322
  123. package/script/src/transports/websocket/_websocket_request_dispatcher.d.ts.map +0 -1
@@ -14,6 +14,7 @@
14
14
  const signing_js_1 = require("../signing.js");
15
15
  /** Error thrown when the API returns an error response. */
16
16
  class ApiRequestError extends base_js_1.HyperliquidError {
17
+ response;
17
18
  constructor(response) {
18
19
  let message = "Cannot process API request";
19
20
  if (response.status === "err") {
@@ -41,27 +42,15 @@
41
42
  }
42
43
  }
43
44
  super(message);
44
- Object.defineProperty(this, "response", {
45
- enumerable: true,
46
- configurable: true,
47
- writable: true,
48
- value: response
49
- });
45
+ this.response = response;
50
46
  this.name = "ApiRequestError";
51
47
  }
52
48
  }
53
49
  exports.ApiRequestError = ApiRequestError;
54
50
  /** Nonce manager for generating unique nonces for signing transactions. */
55
51
  class NonceManager {
56
- constructor() {
57
- /** The last nonce used for signing transactions. */
58
- Object.defineProperty(this, "lastNonce", {
59
- enumerable: true,
60
- configurable: true,
61
- writable: true,
62
- value: 0
63
- });
64
- }
52
+ /** The last nonce used for signing transactions. */
53
+ lastNonce = 0;
65
54
  /**
66
55
  * Gets the next nonce for signing transactions.
67
56
  * @returns The next nonce.
@@ -83,6 +72,13 @@
83
72
  * @typeParam W The WalletClient/Account ([viem](https://viem.sh/docs/clients/wallet)) or Signer ([ethers.js](https://docs.ethers.io/v6/api/providers/#Signer)) used for signing transactions.
84
73
  */
85
74
  class WalletClient {
75
+ transport;
76
+ wallet;
77
+ isTestnet;
78
+ defaultVaultAddress;
79
+ defaultExpiresAfter;
80
+ signatureChainId;
81
+ nonceManager;
86
82
  /**
87
83
  * Initialises a new instance.
88
84
  * @param args - The parameters for the client.
@@ -130,58 +126,6 @@
130
126
  * ```
131
127
  */
132
128
  constructor(args) {
133
- /** The transport used to connect to the Hyperliquid API. */
134
- Object.defineProperty(this, "transport", {
135
- enumerable: true,
136
- configurable: true,
137
- writable: true,
138
- value: void 0
139
- });
140
- /** The `viem`, `ethers.js`, or `window.ethereum` wallet used for signing transactions. */
141
- Object.defineProperty(this, "wallet", {
142
- enumerable: true,
143
- configurable: true,
144
- writable: true,
145
- value: void 0
146
- });
147
- /** Specifies whether the client uses testnet. */
148
- Object.defineProperty(this, "isTestnet", {
149
- enumerable: true,
150
- configurable: true,
151
- writable: true,
152
- value: void 0
153
- });
154
- /** Sets a default vaultAddress to be used if no vaultAddress is explicitly passed to a method. */
155
- Object.defineProperty(this, "defaultVaultAddress", {
156
- enumerable: true,
157
- configurable: true,
158
- writable: true,
159
- value: void 0
160
- });
161
- /** Sets a default expiresAfter to be used if no expiresAfter is explicitly passed to a method. */
162
- Object.defineProperty(this, "defaultExpiresAfter", {
163
- enumerable: true,
164
- configurable: true,
165
- writable: true,
166
- value: void 0
167
- });
168
- /**
169
- * The network that will be used to sign transactions.
170
- * Must match the network of the {@link wallet}.
171
- */
172
- Object.defineProperty(this, "signatureChainId", {
173
- enumerable: true,
174
- configurable: true,
175
- writable: true,
176
- value: void 0
177
- });
178
- /** Function to get the next nonce for signing transactions. */
179
- Object.defineProperty(this, "nonceManager", {
180
- enumerable: true,
181
- configurable: true,
182
- writable: true,
183
- value: void 0
184
- });
185
129
  this.transport = args.transport;
186
130
  this.wallet = args.wallet;
187
131
  this.isTestnet = args.isTestnet ?? false;
@@ -237,11 +181,7 @@
237
181
  if (action.agentName === "")
238
182
  delete action.agentName;
239
183
  // Send a request
240
- const request = { action, signature, nonce: action.nonce };
241
- const response = await this.transport.request("exchange", request, signal);
242
- // Validate a response
243
- this._validateResponse(response);
244
- return response;
184
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
245
185
  }
246
186
  /**
247
187
  * Approve a maximum fee rate for a builder.
@@ -287,11 +227,7 @@
287
227
  chainId: parseInt(action.signatureChainId, 16),
288
228
  });
289
229
  // Send a request
290
- const request = { action, signature, nonce: action.nonce };
291
- const response = await this.transport.request("exchange", request, signal);
292
- // Validate a response
293
- this._validateResponse(response);
294
- return response;
230
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
295
231
  }
296
232
  /**
297
233
  * Modify multiple orders.
@@ -377,11 +313,7 @@
377
313
  expiresAfter,
378
314
  });
379
315
  // Send a request
380
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
381
- const response = await this.transport.request("exchange", request, signal);
382
- // Validate a response
383
- this._validateResponse(response);
384
- return response;
316
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
385
317
  }
386
318
  /**
387
319
  * Cancel order(s).
@@ -430,11 +362,7 @@
430
362
  expiresAfter,
431
363
  });
432
364
  // Send a request
433
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
434
- const response = await this.transport.request("exchange", request, signal);
435
- // Validate a response
436
- this._validateResponse(response);
437
- return response;
365
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
438
366
  }
439
367
  /**
440
368
  * Cancel order(s) by cloid.
@@ -482,11 +410,7 @@
482
410
  expiresAfter,
483
411
  });
484
412
  // Send a request
485
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
486
- const response = await this.transport.request("exchange", request, signal);
487
- // Validate a response
488
- this._validateResponse(response);
489
- return response;
413
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
490
414
  }
491
415
  /**
492
416
  * Transfer native token from the user's spot account into staking for delegating to validators.
@@ -531,11 +455,7 @@
531
455
  chainId: parseInt(action.signatureChainId, 16),
532
456
  });
533
457
  // Send a request
534
- const request = { action, signature, nonce: action.nonce };
535
- const response = await this.transport.request("exchange", request, signal);
536
- // Validate a response
537
- this._validateResponse(response);
538
- return response;
458
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
539
459
  }
540
460
  /**
541
461
  * Claim rewards from referral program.
@@ -569,11 +489,7 @@
569
489
  isTestnet: this.isTestnet,
570
490
  });
571
491
  // Send a request
572
- const request = { action, signature, nonce };
573
- const response = await this.transport.request("exchange", request, signal);
574
- // Validate a response
575
- this._validateResponse(response);
576
- return response;
492
+ return await this._request({ action, signature, nonce }, signal);
577
493
  }
578
494
  /**
579
495
  * Convert a single-signature account to a multi-signature account.
@@ -621,11 +537,7 @@
621
537
  chainId: parseInt(action.signatureChainId, 16),
622
538
  });
623
539
  // Send a request
624
- const request = { action, signature, nonce: action.nonce };
625
- const response = await this.transport.request("exchange", request, signal);
626
- // Validate a response
627
- this._validateResponse(response);
628
- return response;
540
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
629
541
  }
630
542
  /**
631
543
  * Create a sub-account.
@@ -662,11 +574,7 @@
662
574
  isTestnet: this.isTestnet,
663
575
  });
664
576
  // Send a request
665
- const request = { action, signature, nonce };
666
- const response = await this.transport.request("exchange", request, signal);
667
- // Validate a response
668
- this._validateResponse(response);
669
- return response;
577
+ return await this._request({ action, signature, nonce }, signal);
670
578
  }
671
579
  /**
672
580
  * Create a vault.
@@ -710,11 +618,7 @@
710
618
  isTestnet: this.isTestnet,
711
619
  });
712
620
  // Send a request
713
- const request = { action, signature, nonce };
714
- const response = await this.transport.request("exchange", request, signal);
715
- // Validate a response
716
- this._validateResponse(response);
717
- return response;
621
+ return await this._request({ action, signature, nonce }, signal);
718
622
  }
719
623
  async cSignerAction(args, signal) {
720
624
  // Destructure the parameters
@@ -734,11 +638,7 @@
734
638
  expiresAfter,
735
639
  });
736
640
  // Send a request
737
- const request = { action, signature, nonce, expiresAfter };
738
- const response = await this.transport.request("exchange", request, signal);
739
- // Validate a response
740
- this._validateResponse(response);
741
- return response;
641
+ return await this._request({ action, signature, nonce, expiresAfter }, signal);
742
642
  }
743
643
  async cValidatorAction(args, signal) {
744
644
  // Destructure the parameters
@@ -792,11 +692,7 @@
792
692
  expiresAfter,
793
693
  });
794
694
  // Send a request
795
- const request = { action, signature, nonce, expiresAfter };
796
- const response = await this.transport.request("exchange", request, signal);
797
- // Validate a response
798
- this._validateResponse(response);
799
- return response;
695
+ return await this._request({ action, signature, nonce, expiresAfter }, signal);
800
696
  }
801
697
  /**
802
698
  * Transfer native token from staking into the user's spot account.
@@ -841,11 +737,7 @@
841
737
  chainId: parseInt(action.signatureChainId, 16),
842
738
  });
843
739
  // Send a request
844
- const request = { action, signature, nonce: action.nonce };
845
- const response = await this.transport.request("exchange", request, signal);
846
- // Validate a response
847
- this._validateResponse(response);
848
- return response;
740
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
849
741
  }
850
742
  /**
851
743
  * Configure block type for EVM transactions.
@@ -882,11 +774,7 @@
882
774
  isTestnet: this.isTestnet,
883
775
  });
884
776
  // Send a request
885
- const request = { action, signature, nonce };
886
- const response = await this.transport.request("exchange", request, signal);
887
- // Validate a response
888
- this._validateResponse(response);
889
- return response;
777
+ return await this._request({ action, signature, nonce }, signal);
890
778
  }
891
779
  /**
892
780
  * Modify an order.
@@ -965,11 +853,7 @@
965
853
  expiresAfter,
966
854
  });
967
855
  // Send a request
968
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
969
- const response = await this.transport.request("exchange", request, signal);
970
- // Validate a response
971
- this._validateResponse(response);
972
- return response;
856
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
973
857
  }
974
858
  /**
975
859
  * A multi-signature request.
@@ -1044,11 +928,7 @@
1044
928
  signatureChainId: action.signatureChainId,
1045
929
  });
1046
930
  // Send a request
1047
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1048
- const response = await this.transport.request("exchange", request, signal);
1049
- // Validate a response
1050
- this._validateResponse(response);
1051
- return response;
931
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1052
932
  }
1053
933
  /**
1054
934
  * Place an order(s).
@@ -1138,11 +1018,7 @@
1138
1018
  expiresAfter,
1139
1019
  });
1140
1020
  // Send a request
1141
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1142
- const response = await this.transport.request("exchange", request, signal);
1143
- // Validate a response
1144
- this._validateResponse(response);
1145
- return response;
1021
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1146
1022
  }
1147
1023
  async perpDeploy(args, signal) {
1148
1024
  // Construct an action
@@ -1190,11 +1066,7 @@
1190
1066
  isTestnet: this.isTestnet,
1191
1067
  });
1192
1068
  // Send a request
1193
- const request = { action, signature, nonce };
1194
- const response = await this.transport.request("exchange", request, signal);
1195
- // Validate a response
1196
- this._validateResponse(response);
1197
- return response;
1069
+ return await this._request({ action, signature, nonce }, signal);
1198
1070
  }
1199
1071
  /**
1200
1072
  * Transfer funds between Spot account and Perp dex account.
@@ -1247,11 +1119,7 @@
1247
1119
  chainId: parseInt(action.signatureChainId, 16),
1248
1120
  });
1249
1121
  // Send a request
1250
- const request = { action, signature, nonce: action.nonce };
1251
- const response = await this.transport.request("exchange", request, signal);
1252
- // Validate a response
1253
- this._validateResponse(response);
1254
- return response;
1122
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
1255
1123
  }
1256
1124
  /**
1257
1125
  * Create a referral code.
@@ -1288,11 +1156,7 @@
1288
1156
  isTestnet: this.isTestnet,
1289
1157
  });
1290
1158
  // Send a request
1291
- const request = { action, signature, nonce };
1292
- const response = await this.transport.request("exchange", request, signal);
1293
- // Validate a response
1294
- this._validateResponse(response);
1295
- return response;
1159
+ return await this._request({ action, signature, nonce }, signal);
1296
1160
  }
1297
1161
  /**
1298
1162
  * Reserve additional rate-limited actions for a fee.
@@ -1332,11 +1196,7 @@
1332
1196
  expiresAfter,
1333
1197
  });
1334
1198
  // Send a request
1335
- const request = { action, signature, nonce, expiresAfter };
1336
- const response = await this.transport.request("exchange", request, signal);
1337
- // Validate a response
1338
- this._validateResponse(response);
1339
- return response;
1199
+ return await this._request({ action, signature, nonce, expiresAfter }, signal);
1340
1200
  }
1341
1201
  async scheduleCancel(args_or_signal, maybeSignal) {
1342
1202
  const args = args_or_signal instanceof AbortSignal ? {} : args_or_signal ?? {};
@@ -1361,11 +1221,7 @@
1361
1221
  expiresAfter,
1362
1222
  });
1363
1223
  // Send a request
1364
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1365
- const response = await this.transport.request("exchange", request, signal);
1366
- // Validate a response
1367
- this._validateResponse(response);
1368
- return response;
1224
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1369
1225
  }
1370
1226
  /**
1371
1227
  * Set the display name in the leaderboard.
@@ -1402,11 +1258,7 @@
1402
1258
  isTestnet: this.isTestnet,
1403
1259
  });
1404
1260
  // Send a request
1405
- const request = { action, signature, nonce };
1406
- const response = await this.transport.request("exchange", request, signal);
1407
- // Validate a response
1408
- this._validateResponse(response);
1409
- return response;
1261
+ return await this._request({ action, signature, nonce }, signal);
1410
1262
  }
1411
1263
  /**
1412
1264
  * Set a referral code.
@@ -1443,11 +1295,7 @@
1443
1295
  isTestnet: this.isTestnet,
1444
1296
  });
1445
1297
  // Send a request
1446
- const request = { action, signature, nonce };
1447
- const response = await this.transport.request("exchange", request, signal);
1448
- // Validate a response
1449
- this._validateResponse(response);
1450
- return response;
1298
+ return await this._request({ action, signature, nonce }, signal);
1451
1299
  }
1452
1300
  async spotDeploy(args, signal) {
1453
1301
  // Construct an action
@@ -1537,11 +1385,7 @@
1537
1385
  isTestnet: this.isTestnet,
1538
1386
  });
1539
1387
  // Send a request
1540
- const request = { action, signature, nonce };
1541
- const response = await this.transport.request("exchange", request, signal);
1542
- // Validate a response
1543
- this._validateResponse(response);
1544
- return response;
1388
+ return await this._request({ action, signature, nonce }, signal);
1545
1389
  }
1546
1390
  /**
1547
1391
  * Send spot assets to another address.
@@ -1592,11 +1436,7 @@
1592
1436
  chainId: parseInt(action.signatureChainId, 16),
1593
1437
  });
1594
1438
  // Send a request
1595
- const request = { action, signature, nonce: action.time };
1596
- const response = await this.transport.request("exchange", request, signal);
1597
- // Validate a response
1598
- this._validateResponse(response);
1599
- return response;
1439
+ return await this._request({ action, signature, nonce: action.time }, signal);
1600
1440
  }
1601
1441
  /**
1602
1442
  * Opt Out of Spot Dusting.
@@ -1635,11 +1475,7 @@
1635
1475
  isTestnet: this.isTestnet,
1636
1476
  });
1637
1477
  // Send a request
1638
- const request = { action, signature, nonce };
1639
- const response = await this.transport.request("exchange", request, signal);
1640
- // Validate a response
1641
- this._validateResponse(response);
1642
- return response;
1478
+ return await this._request({ action, signature, nonce }, signal);
1643
1479
  }
1644
1480
  /**
1645
1481
  * Transfer between sub-accounts (spot).
@@ -1684,11 +1520,7 @@
1684
1520
  isTestnet: this.isTestnet,
1685
1521
  });
1686
1522
  // Send a request
1687
- const request = { action, signature, nonce };
1688
- const response = await this.transport.request("exchange", request, signal);
1689
- // Validate a response
1690
- this._validateResponse(response);
1691
- return response;
1523
+ return await this._request({ action, signature, nonce }, signal);
1692
1524
  }
1693
1525
  /**
1694
1526
  * Transfer between sub-accounts (perpetual).
@@ -1731,11 +1563,7 @@
1731
1563
  isTestnet: this.isTestnet,
1732
1564
  });
1733
1565
  // Send a request
1734
- const request = { action, signature, nonce };
1735
- const response = await this.transport.request("exchange", request, signal);
1736
- // Validate a response
1737
- this._validateResponse(response);
1738
- return response;
1566
+ return await this._request({ action, signature, nonce }, signal);
1739
1567
  }
1740
1568
  /**
1741
1569
  * Delegate or undelegate native tokens to or from a validator.
@@ -1786,11 +1614,7 @@
1786
1614
  chainId: parseInt(action.signatureChainId, 16),
1787
1615
  });
1788
1616
  // Send a request
1789
- const request = { action, signature, nonce: action.nonce };
1790
- const response = await this.transport.request("exchange", request, signal);
1791
- // Validate a response
1792
- this._validateResponse(response);
1793
- return response;
1617
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
1794
1618
  }
1795
1619
  /**
1796
1620
  * Cancel a TWAP order.
@@ -1835,11 +1659,7 @@
1835
1659
  expiresAfter,
1836
1660
  });
1837
1661
  // Send a request
1838
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1839
- const response = await this.transport.request("exchange", request, signal);
1840
- // Validate a response
1841
- this._validateResponse(response);
1842
- return response;
1662
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1843
1663
  }
1844
1664
  /**
1845
1665
  * Place a TWAP order.
@@ -1894,11 +1714,7 @@
1894
1714
  expiresAfter,
1895
1715
  });
1896
1716
  // Send a request
1897
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1898
- const response = await this.transport.request("exchange", request, signal);
1899
- // Validate a response
1900
- this._validateResponse(response);
1901
- return response;
1717
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1902
1718
  }
1903
1719
  /**
1904
1720
  * Add or remove margin from isolated position.
@@ -1941,11 +1757,7 @@
1941
1757
  expiresAfter,
1942
1758
  });
1943
1759
  // Send a request
1944
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1945
- const response = await this.transport.request("exchange", request, signal);
1946
- // Validate a response
1947
- this._validateResponse(response);
1948
- return response;
1760
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1949
1761
  }
1950
1762
  /**
1951
1763
  * Update cross or isolated leverage on a coin.
@@ -1988,11 +1800,7 @@
1988
1800
  expiresAfter,
1989
1801
  });
1990
1802
  // Send a request
1991
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1992
- const response = await this.transport.request("exchange", request, signal);
1993
- // Validate a response
1994
- this._validateResponse(response);
1995
- return response;
1803
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1996
1804
  }
1997
1805
  /**
1998
1806
  * Transfer funds between Spot account and Perp account.
@@ -2038,11 +1846,7 @@
2038
1846
  chainId: parseInt(action.signatureChainId, 16),
2039
1847
  });
2040
1848
  // Send a request
2041
- const request = { action, signature, nonce: action.nonce };
2042
- const response = await this.transport.request("exchange", request, signal);
2043
- // Validate a response
2044
- this._validateResponse(response);
2045
- return response;
1849
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
2046
1850
  }
2047
1851
  /**
2048
1852
  * Send usd to another address.
@@ -2088,11 +1892,7 @@
2088
1892
  chainId: parseInt(action.signatureChainId, 16),
2089
1893
  });
2090
1894
  // Send a request
2091
- const request = { action, signature, nonce: action.time };
2092
- const response = await this.transport.request("exchange", request, signal);
2093
- // Validate a response
2094
- this._validateResponse(response);
2095
- return response;
1895
+ return await this._request({ action, signature, nonce: action.time }, signal);
2096
1896
  }
2097
1897
  /**
2098
1898
  * Distribute funds from a vault between followers.
@@ -2130,11 +1930,7 @@
2130
1930
  isTestnet: this.isTestnet,
2131
1931
  });
2132
1932
  // Send a request
2133
- const request = { action, signature, nonce };
2134
- const response = await this.transport.request("exchange", request, signal);
2135
- // Validate a response
2136
- this._validateResponse(response);
2137
- return response;
1933
+ return await this._request({ action, signature, nonce }, signal);
2138
1934
  }
2139
1935
  /**
2140
1936
  * Modify a vault's configuration.
@@ -2177,11 +1973,7 @@
2177
1973
  isTestnet: this.isTestnet,
2178
1974
  });
2179
1975
  // Send a request
2180
- const request = { action, signature, nonce };
2181
- const response = await this.transport.request("exchange", request, signal);
2182
- // Validate a response
2183
- this._validateResponse(response);
2184
- return response;
1976
+ return await this._request({ action, signature, nonce }, signal);
2185
1977
  }
2186
1978
  /**
2187
1979
  * Deposit or withdraw from a vault.
@@ -2227,11 +2019,7 @@
2227
2019
  expiresAfter,
2228
2020
  });
2229
2021
  // Send a request
2230
- const request = { action, signature, nonce, expiresAfter };
2231
- const response = await this.transport.request("exchange", request, signal);
2232
- // Validate a response
2233
- this._validateResponse(response);
2234
- return response;
2022
+ return await this._request({ action, signature, nonce, expiresAfter }, signal);
2235
2023
  }
2236
2024
  /**
2237
2025
  * Initiate a withdrawal request.
@@ -2277,9 +2065,11 @@
2277
2065
  chainId: parseInt(action.signatureChainId, 16),
2278
2066
  });
2279
2067
  // Send a request
2280
- const request = { action, signature, nonce: action.time };
2281
- const response = await this.transport.request("exchange", request, signal);
2282
- // Validate a response
2068
+ return await this._request({ action, signature, nonce: action.time }, signal);
2069
+ }
2070
+ /** Send an API request and validate the response. */
2071
+ async _request(payload, signal) {
2072
+ const response = await this.transport.request("exchange", payload, signal);
2283
2073
  this._validateResponse(response);
2284
2074
  return response;
2285
2075
  }
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * This module contains functions for generating Hyperliquid transaction signatures
3
3
  * and interfaces to various wallet implementations.
4
+ *
4
5
  * @example
5
6
  * ```ts
6
7
  * import { signL1Action } from "@nktkas/hyperliquid/signing";
@@ -45,8 +46,10 @@
45
46
  * chainId: parseInt(action.signatureChainId, 16),
46
47
  * });
47
48
  * ```
49
+ *
48
50
  * @module
49
51
  */
52
+ import "../_dnt.polyfills.js";
50
53
  import { type ValueMap, type ValueType } from "../deps/jsr.io/@std/msgpack/1.0.3/encode.js";
51
54
  import type { Hex } from "./base.js";
52
55
  export type { Hex };
@@ -195,6 +198,7 @@ export declare function signL1Action(args: {
195
198
  * Sign a user-signed action.
196
199
  *
197
200
  * Note: Signature generation depends on the order of types.
201
+ *
198
202
  * @param args - Arguments for signing the action.
199
203
  * @returns The signature components r, s, and v.
200
204
  * @example
@@ -258,6 +262,7 @@ export declare function signUserSignedAction(args: {
258
262
  * Sign a multi-signature action.
259
263
  *
260
264
  * Note: Signature generation depends on the order of the action keys.
265
+ *
261
266
  * @param args - Arguments for signing the action.
262
267
  * @returns The signature components r, s, and v.
263
268
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"signing.d.ts","sourceRoot":"","sources":["../../src/src/signing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAGH,OAAO,EAA2B,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAGrH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC,YAAY,EAAE,GAAG,EAAE,CAAC;AACpB,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AAEpC,gEAAgE;AAChE,MAAM,MAAM,cAAc,GACpB,wBAAwB,GACxB,oBAAoB,GACpB,sBAAsB,GACtB,gCAAgC,GAChC,sBAAsB,CAAC;AAE7B,mFAAmF;AACnF,MAAM,WAAW,wBAAwB;IACrC,aAAa,CAAC,MAAM,EAAE;QAClB,MAAM,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,iBAAiB,EAAE,GAAG,CAAC;SAC1B,CAAC;QACF,KAAK,EAAE;YACH,CAAC,GAAG,EAAE,MAAM,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