@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
@@ -2,6 +2,7 @@ import { HyperliquidError } from "../base.js";
2
2
  import { isAbstractEthersSigner, isAbstractEthersV5Signer, isAbstractExtendedViemWalletClient, isAbstractViemWalletClient, isAbstractWindowEthereum, signL1Action, signMultiSigAction, signUserSignedAction, } from "../signing.js";
3
3
  /** Error thrown when the API returns an error response. */
4
4
  export class ApiRequestError extends HyperliquidError {
5
+ response;
5
6
  constructor(response) {
6
7
  let message = "Cannot process API request";
7
8
  if (response.status === "err") {
@@ -29,26 +30,14 @@ export class ApiRequestError extends HyperliquidError {
29
30
  }
30
31
  }
31
32
  super(message);
32
- Object.defineProperty(this, "response", {
33
- enumerable: true,
34
- configurable: true,
35
- writable: true,
36
- value: response
37
- });
33
+ this.response = response;
38
34
  this.name = "ApiRequestError";
39
35
  }
40
36
  }
41
37
  /** Nonce manager for generating unique nonces for signing transactions. */
42
38
  class NonceManager {
43
- constructor() {
44
- /** The last nonce used for signing transactions. */
45
- Object.defineProperty(this, "lastNonce", {
46
- enumerable: true,
47
- configurable: true,
48
- writable: true,
49
- value: 0
50
- });
51
- }
39
+ /** The last nonce used for signing transactions. */
40
+ lastNonce = 0;
52
41
  /**
53
42
  * Gets the next nonce for signing transactions.
54
43
  * @returns The next nonce.
@@ -70,6 +59,13 @@ class NonceManager {
70
59
  * @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.
71
60
  */
72
61
  export class WalletClient {
62
+ transport;
63
+ wallet;
64
+ isTestnet;
65
+ defaultVaultAddress;
66
+ defaultExpiresAfter;
67
+ signatureChainId;
68
+ nonceManager;
73
69
  /**
74
70
  * Initialises a new instance.
75
71
  * @param args - The parameters for the client.
@@ -117,58 +113,6 @@ export class WalletClient {
117
113
  * ```
118
114
  */
119
115
  constructor(args) {
120
- /** The transport used to connect to the Hyperliquid API. */
121
- Object.defineProperty(this, "transport", {
122
- enumerable: true,
123
- configurable: true,
124
- writable: true,
125
- value: void 0
126
- });
127
- /** The `viem`, `ethers.js`, or `window.ethereum` wallet used for signing transactions. */
128
- Object.defineProperty(this, "wallet", {
129
- enumerable: true,
130
- configurable: true,
131
- writable: true,
132
- value: void 0
133
- });
134
- /** Specifies whether the client uses testnet. */
135
- Object.defineProperty(this, "isTestnet", {
136
- enumerable: true,
137
- configurable: true,
138
- writable: true,
139
- value: void 0
140
- });
141
- /** Sets a default vaultAddress to be used if no vaultAddress is explicitly passed to a method. */
142
- Object.defineProperty(this, "defaultVaultAddress", {
143
- enumerable: true,
144
- configurable: true,
145
- writable: true,
146
- value: void 0
147
- });
148
- /** Sets a default expiresAfter to be used if no expiresAfter is explicitly passed to a method. */
149
- Object.defineProperty(this, "defaultExpiresAfter", {
150
- enumerable: true,
151
- configurable: true,
152
- writable: true,
153
- value: void 0
154
- });
155
- /**
156
- * The network that will be used to sign transactions.
157
- * Must match the network of the {@link wallet}.
158
- */
159
- Object.defineProperty(this, "signatureChainId", {
160
- enumerable: true,
161
- configurable: true,
162
- writable: true,
163
- value: void 0
164
- });
165
- /** Function to get the next nonce for signing transactions. */
166
- Object.defineProperty(this, "nonceManager", {
167
- enumerable: true,
168
- configurable: true,
169
- writable: true,
170
- value: void 0
171
- });
172
116
  this.transport = args.transport;
173
117
  this.wallet = args.wallet;
174
118
  this.isTestnet = args.isTestnet ?? false;
@@ -224,11 +168,7 @@ export class WalletClient {
224
168
  if (action.agentName === "")
225
169
  delete action.agentName;
226
170
  // Send a request
227
- const request = { action, signature, nonce: action.nonce };
228
- const response = await this.transport.request("exchange", request, signal);
229
- // Validate a response
230
- this._validateResponse(response);
231
- return response;
171
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
232
172
  }
233
173
  /**
234
174
  * Approve a maximum fee rate for a builder.
@@ -274,11 +214,7 @@ export class WalletClient {
274
214
  chainId: parseInt(action.signatureChainId, 16),
275
215
  });
276
216
  // Send a request
277
- const request = { action, signature, nonce: action.nonce };
278
- const response = await this.transport.request("exchange", request, signal);
279
- // Validate a response
280
- this._validateResponse(response);
281
- return response;
217
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
282
218
  }
283
219
  /**
284
220
  * Modify multiple orders.
@@ -364,11 +300,7 @@ export class WalletClient {
364
300
  expiresAfter,
365
301
  });
366
302
  // Send a request
367
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
368
- const response = await this.transport.request("exchange", request, signal);
369
- // Validate a response
370
- this._validateResponse(response);
371
- return response;
303
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
372
304
  }
373
305
  /**
374
306
  * Cancel order(s).
@@ -417,11 +349,7 @@ export class WalletClient {
417
349
  expiresAfter,
418
350
  });
419
351
  // Send a request
420
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
421
- const response = await this.transport.request("exchange", request, signal);
422
- // Validate a response
423
- this._validateResponse(response);
424
- return response;
352
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
425
353
  }
426
354
  /**
427
355
  * Cancel order(s) by cloid.
@@ -469,11 +397,7 @@ export class WalletClient {
469
397
  expiresAfter,
470
398
  });
471
399
  // Send a request
472
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
473
- const response = await this.transport.request("exchange", request, signal);
474
- // Validate a response
475
- this._validateResponse(response);
476
- return response;
400
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
477
401
  }
478
402
  /**
479
403
  * Transfer native token from the user's spot account into staking for delegating to validators.
@@ -518,11 +442,7 @@ export class WalletClient {
518
442
  chainId: parseInt(action.signatureChainId, 16),
519
443
  });
520
444
  // Send a request
521
- const request = { action, signature, nonce: action.nonce };
522
- const response = await this.transport.request("exchange", request, signal);
523
- // Validate a response
524
- this._validateResponse(response);
525
- return response;
445
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
526
446
  }
527
447
  /**
528
448
  * Claim rewards from referral program.
@@ -556,11 +476,7 @@ export class WalletClient {
556
476
  isTestnet: this.isTestnet,
557
477
  });
558
478
  // Send a request
559
- const request = { action, signature, nonce };
560
- const response = await this.transport.request("exchange", request, signal);
561
- // Validate a response
562
- this._validateResponse(response);
563
- return response;
479
+ return await this._request({ action, signature, nonce }, signal);
564
480
  }
565
481
  /**
566
482
  * Convert a single-signature account to a multi-signature account.
@@ -608,11 +524,7 @@ export class WalletClient {
608
524
  chainId: parseInt(action.signatureChainId, 16),
609
525
  });
610
526
  // Send a request
611
- const request = { action, signature, nonce: action.nonce };
612
- const response = await this.transport.request("exchange", request, signal);
613
- // Validate a response
614
- this._validateResponse(response);
615
- return response;
527
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
616
528
  }
617
529
  /**
618
530
  * Create a sub-account.
@@ -649,11 +561,7 @@ export class WalletClient {
649
561
  isTestnet: this.isTestnet,
650
562
  });
651
563
  // Send a request
652
- const request = { action, signature, nonce };
653
- const response = await this.transport.request("exchange", request, signal);
654
- // Validate a response
655
- this._validateResponse(response);
656
- return response;
564
+ return await this._request({ action, signature, nonce }, signal);
657
565
  }
658
566
  /**
659
567
  * Create a vault.
@@ -697,11 +605,7 @@ export class WalletClient {
697
605
  isTestnet: this.isTestnet,
698
606
  });
699
607
  // Send a request
700
- const request = { action, signature, nonce };
701
- const response = await this.transport.request("exchange", request, signal);
702
- // Validate a response
703
- this._validateResponse(response);
704
- return response;
608
+ return await this._request({ action, signature, nonce }, signal);
705
609
  }
706
610
  async cSignerAction(args, signal) {
707
611
  // Destructure the parameters
@@ -721,11 +625,7 @@ export class WalletClient {
721
625
  expiresAfter,
722
626
  });
723
627
  // Send a request
724
- const request = { action, signature, nonce, expiresAfter };
725
- const response = await this.transport.request("exchange", request, signal);
726
- // Validate a response
727
- this._validateResponse(response);
728
- return response;
628
+ return await this._request({ action, signature, nonce, expiresAfter }, signal);
729
629
  }
730
630
  async cValidatorAction(args, signal) {
731
631
  // Destructure the parameters
@@ -779,11 +679,7 @@ export class WalletClient {
779
679
  expiresAfter,
780
680
  });
781
681
  // Send a request
782
- const request = { action, signature, nonce, expiresAfter };
783
- const response = await this.transport.request("exchange", request, signal);
784
- // Validate a response
785
- this._validateResponse(response);
786
- return response;
682
+ return await this._request({ action, signature, nonce, expiresAfter }, signal);
787
683
  }
788
684
  /**
789
685
  * Transfer native token from staking into the user's spot account.
@@ -828,11 +724,7 @@ export class WalletClient {
828
724
  chainId: parseInt(action.signatureChainId, 16),
829
725
  });
830
726
  // Send a request
831
- const request = { action, signature, nonce: action.nonce };
832
- const response = await this.transport.request("exchange", request, signal);
833
- // Validate a response
834
- this._validateResponse(response);
835
- return response;
727
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
836
728
  }
837
729
  /**
838
730
  * Configure block type for EVM transactions.
@@ -869,11 +761,7 @@ export class WalletClient {
869
761
  isTestnet: this.isTestnet,
870
762
  });
871
763
  // Send a request
872
- const request = { action, signature, nonce };
873
- const response = await this.transport.request("exchange", request, signal);
874
- // Validate a response
875
- this._validateResponse(response);
876
- return response;
764
+ return await this._request({ action, signature, nonce }, signal);
877
765
  }
878
766
  /**
879
767
  * Modify an order.
@@ -952,11 +840,7 @@ export class WalletClient {
952
840
  expiresAfter,
953
841
  });
954
842
  // Send a request
955
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
956
- const response = await this.transport.request("exchange", request, signal);
957
- // Validate a response
958
- this._validateResponse(response);
959
- return response;
843
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
960
844
  }
961
845
  /**
962
846
  * A multi-signature request.
@@ -1031,11 +915,7 @@ export class WalletClient {
1031
915
  signatureChainId: action.signatureChainId,
1032
916
  });
1033
917
  // Send a request
1034
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1035
- const response = await this.transport.request("exchange", request, signal);
1036
- // Validate a response
1037
- this._validateResponse(response);
1038
- return response;
918
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1039
919
  }
1040
920
  /**
1041
921
  * Place an order(s).
@@ -1125,11 +1005,7 @@ export class WalletClient {
1125
1005
  expiresAfter,
1126
1006
  });
1127
1007
  // Send a request
1128
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1129
- const response = await this.transport.request("exchange", request, signal);
1130
- // Validate a response
1131
- this._validateResponse(response);
1132
- return response;
1008
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1133
1009
  }
1134
1010
  async perpDeploy(args, signal) {
1135
1011
  // Construct an action
@@ -1177,11 +1053,7 @@ export class WalletClient {
1177
1053
  isTestnet: this.isTestnet,
1178
1054
  });
1179
1055
  // Send a request
1180
- const request = { action, signature, nonce };
1181
- const response = await this.transport.request("exchange", request, signal);
1182
- // Validate a response
1183
- this._validateResponse(response);
1184
- return response;
1056
+ return await this._request({ action, signature, nonce }, signal);
1185
1057
  }
1186
1058
  /**
1187
1059
  * Transfer funds between Spot account and Perp dex account.
@@ -1234,11 +1106,7 @@ export class WalletClient {
1234
1106
  chainId: parseInt(action.signatureChainId, 16),
1235
1107
  });
1236
1108
  // Send a request
1237
- const request = { action, signature, nonce: action.nonce };
1238
- const response = await this.transport.request("exchange", request, signal);
1239
- // Validate a response
1240
- this._validateResponse(response);
1241
- return response;
1109
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
1242
1110
  }
1243
1111
  /**
1244
1112
  * Create a referral code.
@@ -1275,11 +1143,7 @@ export class WalletClient {
1275
1143
  isTestnet: this.isTestnet,
1276
1144
  });
1277
1145
  // Send a request
1278
- const request = { action, signature, nonce };
1279
- const response = await this.transport.request("exchange", request, signal);
1280
- // Validate a response
1281
- this._validateResponse(response);
1282
- return response;
1146
+ return await this._request({ action, signature, nonce }, signal);
1283
1147
  }
1284
1148
  /**
1285
1149
  * Reserve additional rate-limited actions for a fee.
@@ -1319,11 +1183,7 @@ export class WalletClient {
1319
1183
  expiresAfter,
1320
1184
  });
1321
1185
  // Send a request
1322
- const request = { action, signature, nonce, expiresAfter };
1323
- const response = await this.transport.request("exchange", request, signal);
1324
- // Validate a response
1325
- this._validateResponse(response);
1326
- return response;
1186
+ return await this._request({ action, signature, nonce, expiresAfter }, signal);
1327
1187
  }
1328
1188
  async scheduleCancel(args_or_signal, maybeSignal) {
1329
1189
  const args = args_or_signal instanceof AbortSignal ? {} : args_or_signal ?? {};
@@ -1348,11 +1208,7 @@ export class WalletClient {
1348
1208
  expiresAfter,
1349
1209
  });
1350
1210
  // Send a request
1351
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1352
- const response = await this.transport.request("exchange", request, signal);
1353
- // Validate a response
1354
- this._validateResponse(response);
1355
- return response;
1211
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1356
1212
  }
1357
1213
  /**
1358
1214
  * Set the display name in the leaderboard.
@@ -1389,11 +1245,7 @@ export class WalletClient {
1389
1245
  isTestnet: this.isTestnet,
1390
1246
  });
1391
1247
  // Send a request
1392
- const request = { action, signature, nonce };
1393
- const response = await this.transport.request("exchange", request, signal);
1394
- // Validate a response
1395
- this._validateResponse(response);
1396
- return response;
1248
+ return await this._request({ action, signature, nonce }, signal);
1397
1249
  }
1398
1250
  /**
1399
1251
  * Set a referral code.
@@ -1430,11 +1282,7 @@ export class WalletClient {
1430
1282
  isTestnet: this.isTestnet,
1431
1283
  });
1432
1284
  // Send a request
1433
- const request = { action, signature, nonce };
1434
- const response = await this.transport.request("exchange", request, signal);
1435
- // Validate a response
1436
- this._validateResponse(response);
1437
- return response;
1285
+ return await this._request({ action, signature, nonce }, signal);
1438
1286
  }
1439
1287
  async spotDeploy(args, signal) {
1440
1288
  // Construct an action
@@ -1524,11 +1372,7 @@ export class WalletClient {
1524
1372
  isTestnet: this.isTestnet,
1525
1373
  });
1526
1374
  // Send a request
1527
- const request = { action, signature, nonce };
1528
- const response = await this.transport.request("exchange", request, signal);
1529
- // Validate a response
1530
- this._validateResponse(response);
1531
- return response;
1375
+ return await this._request({ action, signature, nonce }, signal);
1532
1376
  }
1533
1377
  /**
1534
1378
  * Send spot assets to another address.
@@ -1579,11 +1423,7 @@ export class WalletClient {
1579
1423
  chainId: parseInt(action.signatureChainId, 16),
1580
1424
  });
1581
1425
  // Send a request
1582
- const request = { action, signature, nonce: action.time };
1583
- const response = await this.transport.request("exchange", request, signal);
1584
- // Validate a response
1585
- this._validateResponse(response);
1586
- return response;
1426
+ return await this._request({ action, signature, nonce: action.time }, signal);
1587
1427
  }
1588
1428
  /**
1589
1429
  * Opt Out of Spot Dusting.
@@ -1622,11 +1462,7 @@ export class WalletClient {
1622
1462
  isTestnet: this.isTestnet,
1623
1463
  });
1624
1464
  // Send a request
1625
- const request = { action, signature, nonce };
1626
- const response = await this.transport.request("exchange", request, signal);
1627
- // Validate a response
1628
- this._validateResponse(response);
1629
- return response;
1465
+ return await this._request({ action, signature, nonce }, signal);
1630
1466
  }
1631
1467
  /**
1632
1468
  * Transfer between sub-accounts (spot).
@@ -1671,11 +1507,7 @@ export class WalletClient {
1671
1507
  isTestnet: this.isTestnet,
1672
1508
  });
1673
1509
  // Send a request
1674
- const request = { action, signature, nonce };
1675
- const response = await this.transport.request("exchange", request, signal);
1676
- // Validate a response
1677
- this._validateResponse(response);
1678
- return response;
1510
+ return await this._request({ action, signature, nonce }, signal);
1679
1511
  }
1680
1512
  /**
1681
1513
  * Transfer between sub-accounts (perpetual).
@@ -1718,11 +1550,7 @@ export class WalletClient {
1718
1550
  isTestnet: this.isTestnet,
1719
1551
  });
1720
1552
  // Send a request
1721
- const request = { action, signature, nonce };
1722
- const response = await this.transport.request("exchange", request, signal);
1723
- // Validate a response
1724
- this._validateResponse(response);
1725
- return response;
1553
+ return await this._request({ action, signature, nonce }, signal);
1726
1554
  }
1727
1555
  /**
1728
1556
  * Delegate or undelegate native tokens to or from a validator.
@@ -1773,11 +1601,7 @@ export class WalletClient {
1773
1601
  chainId: parseInt(action.signatureChainId, 16),
1774
1602
  });
1775
1603
  // Send a request
1776
- const request = { action, signature, nonce: action.nonce };
1777
- const response = await this.transport.request("exchange", request, signal);
1778
- // Validate a response
1779
- this._validateResponse(response);
1780
- return response;
1604
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
1781
1605
  }
1782
1606
  /**
1783
1607
  * Cancel a TWAP order.
@@ -1822,11 +1646,7 @@ export class WalletClient {
1822
1646
  expiresAfter,
1823
1647
  });
1824
1648
  // Send a request
1825
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1826
- const response = await this.transport.request("exchange", request, signal);
1827
- // Validate a response
1828
- this._validateResponse(response);
1829
- return response;
1649
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1830
1650
  }
1831
1651
  /**
1832
1652
  * Place a TWAP order.
@@ -1881,11 +1701,7 @@ export class WalletClient {
1881
1701
  expiresAfter,
1882
1702
  });
1883
1703
  // Send a request
1884
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1885
- const response = await this.transport.request("exchange", request, signal);
1886
- // Validate a response
1887
- this._validateResponse(response);
1888
- return response;
1704
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1889
1705
  }
1890
1706
  /**
1891
1707
  * Add or remove margin from isolated position.
@@ -1928,11 +1744,7 @@ export class WalletClient {
1928
1744
  expiresAfter,
1929
1745
  });
1930
1746
  // Send a request
1931
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1932
- const response = await this.transport.request("exchange", request, signal);
1933
- // Validate a response
1934
- this._validateResponse(response);
1935
- return response;
1747
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1936
1748
  }
1937
1749
  /**
1938
1750
  * Update cross or isolated leverage on a coin.
@@ -1975,11 +1787,7 @@ export class WalletClient {
1975
1787
  expiresAfter,
1976
1788
  });
1977
1789
  // Send a request
1978
- const request = { action, signature, nonce, vaultAddress, expiresAfter };
1979
- const response = await this.transport.request("exchange", request, signal);
1980
- // Validate a response
1981
- this._validateResponse(response);
1982
- return response;
1790
+ return await this._request({ action, signature, nonce, vaultAddress, expiresAfter }, signal);
1983
1791
  }
1984
1792
  /**
1985
1793
  * Transfer funds between Spot account and Perp account.
@@ -2025,11 +1833,7 @@ export class WalletClient {
2025
1833
  chainId: parseInt(action.signatureChainId, 16),
2026
1834
  });
2027
1835
  // Send a request
2028
- const request = { action, signature, nonce: action.nonce };
2029
- const response = await this.transport.request("exchange", request, signal);
2030
- // Validate a response
2031
- this._validateResponse(response);
2032
- return response;
1836
+ return await this._request({ action, signature, nonce: action.nonce }, signal);
2033
1837
  }
2034
1838
  /**
2035
1839
  * Send usd to another address.
@@ -2075,11 +1879,7 @@ export class WalletClient {
2075
1879
  chainId: parseInt(action.signatureChainId, 16),
2076
1880
  });
2077
1881
  // Send a request
2078
- const request = { action, signature, nonce: action.time };
2079
- const response = await this.transport.request("exchange", request, signal);
2080
- // Validate a response
2081
- this._validateResponse(response);
2082
- return response;
1882
+ return await this._request({ action, signature, nonce: action.time }, signal);
2083
1883
  }
2084
1884
  /**
2085
1885
  * Distribute funds from a vault between followers.
@@ -2117,11 +1917,7 @@ export class WalletClient {
2117
1917
  isTestnet: this.isTestnet,
2118
1918
  });
2119
1919
  // Send a request
2120
- const request = { action, signature, nonce };
2121
- const response = await this.transport.request("exchange", request, signal);
2122
- // Validate a response
2123
- this._validateResponse(response);
2124
- return response;
1920
+ return await this._request({ action, signature, nonce }, signal);
2125
1921
  }
2126
1922
  /**
2127
1923
  * Modify a vault's configuration.
@@ -2164,11 +1960,7 @@ export class WalletClient {
2164
1960
  isTestnet: this.isTestnet,
2165
1961
  });
2166
1962
  // Send a request
2167
- const request = { action, signature, nonce };
2168
- const response = await this.transport.request("exchange", request, signal);
2169
- // Validate a response
2170
- this._validateResponse(response);
2171
- return response;
1963
+ return await this._request({ action, signature, nonce }, signal);
2172
1964
  }
2173
1965
  /**
2174
1966
  * Deposit or withdraw from a vault.
@@ -2214,11 +2006,7 @@ export class WalletClient {
2214
2006
  expiresAfter,
2215
2007
  });
2216
2008
  // Send a request
2217
- const request = { action, signature, nonce, expiresAfter };
2218
- const response = await this.transport.request("exchange", request, signal);
2219
- // Validate a response
2220
- this._validateResponse(response);
2221
- return response;
2009
+ return await this._request({ action, signature, nonce, expiresAfter }, signal);
2222
2010
  }
2223
2011
  /**
2224
2012
  * Initiate a withdrawal request.
@@ -2264,9 +2052,11 @@ export class WalletClient {
2264
2052
  chainId: parseInt(action.signatureChainId, 16),
2265
2053
  });
2266
2054
  // Send a request
2267
- const request = { action, signature, nonce: action.time };
2268
- const response = await this.transport.request("exchange", request, signal);
2269
- // Validate a response
2055
+ return await this._request({ action, signature, nonce: action.time }, signal);
2056
+ }
2057
+ /** Send an API request and validate the response. */
2058
+ async _request(payload, signal) {
2059
+ const response = await this.transport.request("exchange", payload, signal);
2270
2060
  this._validateResponse(response);
2271
2061
  return response;
2272
2062
  }
@@ -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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