@nktkas/hyperliquid 0.21.1 → 0.22.1

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 (43) hide show
  1. package/CONTRIBUTING.md +19 -34
  2. package/README.md +212 -87
  3. package/esm/mod.d.ts +4 -3
  4. package/esm/mod.d.ts.map +1 -1
  5. package/esm/mod.js +3 -2
  6. package/esm/src/clients/exchange.d.ts +102 -59
  7. package/esm/src/clients/exchange.d.ts.map +1 -1
  8. package/esm/src/clients/exchange.js +234 -517
  9. package/esm/src/clients/info.d.ts +55 -55
  10. package/esm/src/clients/info.d.ts.map +1 -1
  11. package/esm/src/clients/info.js +57 -54
  12. package/esm/src/clients/multiSign.d.ts +1299 -0
  13. package/esm/src/clients/multiSign.d.ts.map +1 -0
  14. package/esm/src/clients/multiSign.js +2158 -0
  15. package/esm/src/clients/subscription.d.ts +19 -19
  16. package/esm/src/clients/subscription.d.ts.map +1 -1
  17. package/esm/src/clients/subscription.js +17 -17
  18. package/esm/src/signing.d.ts +164 -40
  19. package/esm/src/signing.d.ts.map +1 -1
  20. package/esm/src/signing.js +710 -9
  21. package/esm/src/types/exchange/requests.d.ts +241 -246
  22. package/esm/src/types/exchange/requests.d.ts.map +1 -1
  23. package/package.json +2 -1
  24. package/script/mod.d.ts +4 -3
  25. package/script/mod.d.ts.map +1 -1
  26. package/script/mod.js +4 -3
  27. package/script/src/clients/exchange.d.ts +102 -59
  28. package/script/src/clients/exchange.d.ts.map +1 -1
  29. package/script/src/clients/exchange.js +233 -516
  30. package/script/src/clients/info.d.ts +55 -55
  31. package/script/src/clients/info.d.ts.map +1 -1
  32. package/script/src/clients/info.js +57 -54
  33. package/script/src/clients/multiSign.d.ts +1299 -0
  34. package/script/src/clients/multiSign.d.ts.map +1 -0
  35. package/script/src/clients/multiSign.js +2172 -0
  36. package/script/src/clients/subscription.d.ts +19 -19
  37. package/script/src/clients/subscription.d.ts.map +1 -1
  38. package/script/src/clients/subscription.js +17 -17
  39. package/script/src/signing.d.ts +164 -40
  40. package/script/src/signing.d.ts.map +1 -1
  41. package/script/src/signing.js +711 -10
  42. package/script/src/types/exchange/requests.d.ts +241 -246
  43. package/script/src/types/exchange/requests.d.ts.map +1 -1
@@ -0,0 +1,1299 @@
1
+ import type { Hex } from "../base.js";
2
+ import type { IRequestTransport } from "../transports/base.js";
3
+ import type { BaseExchangeRequest } from "../types/exchange/requests.js";
4
+ import type { CreateSubAccountResponse, CreateVaultResponse, SuccessResponse } from "../types/exchange/responses.js";
5
+ import { type AbstractEthersSigner, type AbstractEthersV5Signer, type AbstractViemWalletClient, type AbstractWallet, type AbstractWindowEthereum, type Signature, userSignedActionEip712Types } from "../signing.js";
6
+ import { type CancelResponseSuccess, type CSignerActionParameters_JailSelf, type CSignerActionParameters_UnjailSelf, type CValidatorActionParameters_ChangeProfile, type CValidatorActionParameters_Register, type CValidatorActionParameters_Unregister, ExchangeClient, type ExchangeClientParameters, type OrderResponseSuccess, type PerpDeployParameters_RegisterAsset, type PerpDeployParameters_SetOracle, type ScheduleCancelParameters, type SpotDeployParameters_Genesis, type SpotDeployParameters_RegisterHyperliquidity, type SpotDeployParameters_RegisterSpot, type SpotDeployParameters_RegisterToken2, type SpotDeployParameters_SetDeployerTradingFeeShare, type SpotDeployParameters_UserGenesis, type TwapCancelResponseSuccess, type TwapOrderResponseSuccess } from "./exchange.js";
7
+ /** Parameters for the {@linkcode MultiSignClient} constructor. */
8
+ export interface MultiSignClientParameters<T extends IRequestTransport = IRequestTransport, S extends readonly [AbstractWalletWithAddress, ...AbstractWallet[]] = [
9
+ AbstractWalletWithAddress,
10
+ ...AbstractWallet[]
11
+ ]> extends Omit<ExchangeClientParameters<T, S[0]>, "wallet"> {
12
+ /** The multi-signature account address. */
13
+ multiSignAddress: Hex;
14
+ /** Array of wallets used for multi-signature operations. The first wallet acts as the leader. */
15
+ signers: S;
16
+ }
17
+ /** Abstract interface for a wallet that can sign typed data and has wallet address. */
18
+ export type AbstractWalletWithAddress = AbstractViemWalletClientWithAddress | AbstractEthersSignerWithAddress | AbstractEthersV5SignerWithAddress | AbstractWindowEthereum;
19
+ /** Abstract interface for a [viem wallet](https://viem.sh/docs/clients/wallet) with wallet address. */
20
+ export interface AbstractViemWalletClientWithAddress extends AbstractViemWalletClient {
21
+ address: Hex;
22
+ }
23
+ /** Abstract interface for an [ethers.js signer](https://docs.ethers.org/v6/api/providers/#Signer) with wallet address. */
24
+ export interface AbstractEthersSignerWithAddress extends AbstractEthersSigner {
25
+ getAddress(): Promise<string>;
26
+ }
27
+ /** Abstract interface for an [ethers.js v5 signer](https://docs.ethers.org/v5/api/signer/) with wallet address. */
28
+ export interface AbstractEthersV5SignerWithAddress extends AbstractEthersV5Signer {
29
+ getAddress(): Promise<string>;
30
+ }
31
+ /**
32
+ * Multi-signature exchange client for interacting with the Hyperliquid API.
33
+ * @typeParam T The transport used to connect to the Hyperliquid API.
34
+ * @typeParam S Array of wallets where the first wallet acts as the leader.
35
+ */
36
+ export declare class MultiSignClient<T extends IRequestTransport = IRequestTransport, S extends readonly [AbstractWalletWithAddress, ...AbstractWallet[]] = [
37
+ AbstractWalletWithAddress,
38
+ ...AbstractWallet[]
39
+ ]> extends ExchangeClient<T, S[0]> implements MultiSignClientParameters<T, S> {
40
+ multiSignAddress: Hex;
41
+ signers: S;
42
+ /**
43
+ * @multisign Is the first wallet from {@linkcode signers}.
44
+ */
45
+ wallet: S[0];
46
+ /**
47
+ * Initialises a new multi-signature client instance.
48
+ * @param args - The parameters for the multi-signature client.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * import * as hl from "@nktkas/hyperliquid";
53
+ * import { privateKeyToAccount } from "viem/accounts";
54
+ *
55
+ * const multiSignAddress = "0x...";
56
+ * const signers = [
57
+ * privateKeyToAccount("0x..."), // first is leader
58
+ * privateKeyToAccount("0x..."),
59
+ * privateKeyToAccount("0x..."),
60
+ * ];
61
+ *
62
+ * const transport = new hl.HttpTransport();
63
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
64
+ * ```
65
+ */
66
+ constructor(args: MultiSignClientParameters<T, S>);
67
+ /**
68
+ * @param args - The parameters for the request.
69
+ * @param signal - An optional abort signal
70
+ * @returns Successful response without specific data.
71
+ * @throws {ApiRequestError} When the API returns an error response.
72
+ *
73
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-an-api-wallet
74
+ * @example
75
+ * ```ts
76
+ * import * as hl from "@nktkas/hyperliquid";
77
+ * import { privateKeyToAccount } from "viem/accounts";
78
+ *
79
+ * const multiSignAddress = "0x...";
80
+ * const signers = [
81
+ * privateKeyToAccount("0x..."), // first is leader
82
+ * privateKeyToAccount("0x..."),
83
+ * // ...
84
+ * privateKeyToAccount("0x..."),
85
+ * ];
86
+ *
87
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
88
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
89
+ *
90
+ * const data = await multiSignClient.approveAgent({ agentAddress: "0x...", agentName: "agentName" });
91
+ * ```
92
+ */
93
+ approveAgent(...[args, signal]: Parameters<ExchangeClient["approveAgent"]>): ReturnType<ExchangeClient["approveAgent"]>;
94
+ /**
95
+ * @param args - The parameters for the request.
96
+ * @param signal - An optional abort signal.
97
+ * @returns Successful response without specific data.
98
+ * @throws {ApiRequestError} When the API returns an error response.
99
+ *
100
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-a-builder-fee
101
+ * @example
102
+ * ```ts
103
+ * import * as hl from "@nktkas/hyperliquid";
104
+ * import { privateKeyToAccount } from "viem/accounts";
105
+ *
106
+ * const multiSignAddress = "0x...";
107
+ * const signers = [
108
+ * privateKeyToAccount("0x..."), // first is leader
109
+ * privateKeyToAccount("0x..."),
110
+ * // ...
111
+ * privateKeyToAccount("0x..."),
112
+ * ];
113
+ *
114
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
115
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
116
+ *
117
+ * const data = await multiSignClient.approveBuilderFee({ maxFeeRate: "0.01%", builder: "0x..." });
118
+ * ```
119
+ */
120
+ approveBuilderFee(...[args, signal]: Parameters<ExchangeClient["approveBuilderFee"]>): ReturnType<ExchangeClient["approveBuilderFee"]>;
121
+ /**
122
+ * @param args - The parameters for the request.
123
+ * @param signal - An optional abort signal.
124
+ * @returns Successful variant of {@link OrderResponse} without error statuses.
125
+ * @throws {ApiRequestError} When the API returns an error response.
126
+ *
127
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
128
+ * @example
129
+ * ```ts
130
+ * import * as hl from "@nktkas/hyperliquid";
131
+ * import { privateKeyToAccount } from "viem/accounts";
132
+ *
133
+ * const multiSignAddress = "0x...";
134
+ * const signers = [
135
+ * privateKeyToAccount("0x..."), // first is leader
136
+ * privateKeyToAccount("0x..."),
137
+ * // ...
138
+ * privateKeyToAccount("0x..."),
139
+ * ];
140
+ *
141
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
142
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
143
+ *
144
+ * const data = await multiSignClient.batchModify({
145
+ * modifies: [{
146
+ * oid: 123,
147
+ * order: {
148
+ * a: 0, // Asset index
149
+ * b: true, // Buy order
150
+ * p: "31000", // New price
151
+ * s: "0.2", // New size
152
+ * r: false, // Not reduce-only
153
+ * t: {
154
+ * limit: {
155
+ * tif: "Gtc", // Good-til-cancelled
156
+ * },
157
+ * },
158
+ * c: "0x...", // Client Order ID (optional)
159
+ * },
160
+ * }],
161
+ * });
162
+ * ```
163
+ */
164
+ batchModify(...[args, signal]: Parameters<ExchangeClient["batchModify"]>): ReturnType<ExchangeClient["batchModify"]>;
165
+ /**
166
+ * @param args - The parameters for the request.
167
+ * @param signal - An optional abort signal.
168
+ * @returns Successful variant of {@link CancelResponse} without error statuses.
169
+ * @throws {ApiRequestError} When the API returns an error response.
170
+ *
171
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
172
+ * @example
173
+ * ```ts
174
+ * import * as hl from "@nktkas/hyperliquid";
175
+ * import { privateKeyToAccount } from "viem/accounts";
176
+ *
177
+ * const multiSignAddress = "0x...";
178
+ * const signers = [
179
+ * privateKeyToAccount("0x..."), // first is leader
180
+ * privateKeyToAccount("0x..."),
181
+ * // ...
182
+ * privateKeyToAccount("0x..."),
183
+ * ];
184
+ *
185
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
186
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
187
+ *
188
+ * const data = await multiSignClient.cancel({
189
+ * cancels: [{
190
+ * a: 0, // Asset index
191
+ * o: 123, // Order ID
192
+ * }],
193
+ * });
194
+ * ```
195
+ */
196
+ cancel(...[args, signal]: Parameters<ExchangeClient["cancel"]>): ReturnType<ExchangeClient["cancel"]>;
197
+ /**
198
+ * @param args - The parameters for the request.
199
+ * @param signal - An optional abort signal.
200
+ * @returns Successful variant of {@link CancelResponse} without error statuses.
201
+ * @throws {ApiRequestError} When the API returns an error response.
202
+ *
203
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
204
+ * @example
205
+ * ```ts
206
+ * import * as hl from "@nktkas/hyperliquid";
207
+ * import { privateKeyToAccount } from "viem/accounts";
208
+ *
209
+ * const multiSignAddress = "0x...";
210
+ * const signers = [
211
+ * privateKeyToAccount("0x..."), // first is leader
212
+ * privateKeyToAccount("0x..."),
213
+ * // ...
214
+ * privateKeyToAccount("0x..."),
215
+ * ];
216
+ *
217
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
218
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
219
+ *
220
+ * const data = await multiSignClient.cancelByCloid({
221
+ * cancels: [
222
+ * { asset: 0, cloid: "0x..." },
223
+ * ],
224
+ * });
225
+ * ```
226
+ */
227
+ cancelByCloid(...[args, signal]: Parameters<ExchangeClient["cancelByCloid"]>): ReturnType<ExchangeClient["cancelByCloid"]>;
228
+ /**
229
+ * @param args - The parameters for the request.
230
+ * @param signal - An optional abort signal.
231
+ * @returns Successful response without specific data.
232
+ * @throws {ApiRequestError} When the API returns an error response.
233
+ *
234
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-into-staking
235
+ * @example
236
+ * ```ts
237
+ * import * as hl from "@nktkas/hyperliquid";
238
+ * import { privateKeyToAccount } from "viem/accounts";
239
+ *
240
+ * const multiSignAddress = "0x...";
241
+ * const signers = [
242
+ * privateKeyToAccount("0x..."), // first is leader
243
+ * privateKeyToAccount("0x..."),
244
+ * // ...
245
+ * privateKeyToAccount("0x..."),
246
+ * ];
247
+ *
248
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
249
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
250
+ *
251
+ * const data = await multiSignClient.cDeposit({ wei: 1 * 1e8 });
252
+ * ```
253
+ */
254
+ cDeposit(...[args, signal]: Parameters<ExchangeClient["cDeposit"]>): ReturnType<ExchangeClient["cDeposit"]>;
255
+ /**
256
+ * @param args - The parameters for the request.
257
+ * @param signal - An optional abort signal.
258
+ * @returns Successful response without specific data.
259
+ * @throws {ApiRequestError} When the API returns an error response.
260
+ *
261
+ * @see null - no documentation
262
+ * @example
263
+ * ```ts
264
+ * import * as hl from "@nktkas/hyperliquid";
265
+ * import { privateKeyToAccount } from "viem/accounts";
266
+ *
267
+ * const multiSignAddress = "0x...";
268
+ * const signers = [
269
+ * privateKeyToAccount("0x..."), // first is leader
270
+ * privateKeyToAccount("0x..."),
271
+ * // ...
272
+ * privateKeyToAccount("0x..."),
273
+ * ];
274
+ *
275
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
276
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
277
+ *
278
+ * const data = await multiSignClient.claimRewards();
279
+ * ```
280
+ */
281
+ claimRewards(...[signal]: Parameters<ExchangeClient["claimRewards"]>): ReturnType<ExchangeClient["claimRewards"]>;
282
+ /**
283
+ * @param args - The parameters for the request.
284
+ * @param signal - An optional abort signal.
285
+ * @returns Successful response without specific data.
286
+ * @throws {ApiRequestError} When the API returns an error response.
287
+ *
288
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/multi-sig
289
+ * @example
290
+ * ```ts
291
+ * import * as hl from "@nktkas/hyperliquid";
292
+ * import { privateKeyToAccount } from "viem/accounts";
293
+ *
294
+ * const multiSignAddress = "0x...";
295
+ * const signers = [
296
+ * privateKeyToAccount("0x..."), // first is leader
297
+ * privateKeyToAccount("0x..."),
298
+ * // ...
299
+ * privateKeyToAccount("0x..."),
300
+ * ];
301
+ *
302
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
303
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
304
+ *
305
+ * const data = await multiSignClient.convertToMultiSigUser({ // convert to normal user
306
+ * authorizedUsers: [],
307
+ * threshold: 0,
308
+ * });
309
+ * ```
310
+ */
311
+ convertToMultiSigUser(...[args, signal]: Parameters<ExchangeClient["convertToMultiSigUser"]>): ReturnType<ExchangeClient["convertToMultiSigUser"]>;
312
+ /**
313
+ * @param args - The parameters for the request.
314
+ * @param signal - An optional abort signal.
315
+ * @returns Response for creating a sub-account.
316
+ * @throws {ApiRequestError} When the API returns an error response.
317
+ *
318
+ * @see null - no documentation
319
+ * @example
320
+ * ```ts
321
+ * import * as hl from "@nktkas/hyperliquid";
322
+ * import { privateKeyToAccount } from "viem/accounts";
323
+ *
324
+ * const multiSignAddress = "0x...";
325
+ * const signers = [
326
+ * privateKeyToAccount("0x..."), // first is leader
327
+ * privateKeyToAccount("0x..."),
328
+ * // ...
329
+ * privateKeyToAccount("0x..."),
330
+ * ];
331
+ *
332
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
333
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
334
+ *
335
+ * const data = await multiSignClient.createSubAccount({ name: "subAccountName" });
336
+ * ```
337
+ */
338
+ createSubAccount(...[args, signal]: Parameters<ExchangeClient["createSubAccount"]>): ReturnType<ExchangeClient["createSubAccount"]>;
339
+ /**
340
+ * @param args - The parameters for the request.
341
+ * @param signal - An optional abort signal.
342
+ * @returns Response for creating a vault.
343
+ * @throws {ApiRequestError} When the API returns an error response.
344
+ *
345
+ * @see null - no documentation
346
+ * @example
347
+ * ```ts
348
+ * import * as hl from "@nktkas/hyperliquid";
349
+ * import { privateKeyToAccount } from "viem/accounts";
350
+ *
351
+ * const multiSignAddress = "0x...";
352
+ * const signers = [
353
+ * privateKeyToAccount("0x..."), // first is leader
354
+ * privateKeyToAccount("0x..."),
355
+ * // ...
356
+ * privateKeyToAccount("0x..."),
357
+ * ];
358
+ *
359
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
360
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
361
+ *
362
+ * const data = await multiSignClient.createVault({
363
+ * name: "VaultName",
364
+ * description: "Vault description",
365
+ * initialUsd: 100 * 1e6,
366
+ * });
367
+ * ```
368
+ */
369
+ createVault(...[args, signal]: Parameters<ExchangeClient["createVault"]>): ReturnType<ExchangeClient["createVault"]>;
370
+ /**
371
+ * @param args - The parameters for the request.
372
+ * @param signal - An optional abort signal.
373
+ * @returns Successful response without specific data.
374
+ * @throws {ApiRequestError} When the API returns an error response.
375
+ *
376
+ * @see null - no documentation
377
+ * @example
378
+ * ```ts
379
+ * import * as hl from "@nktkas/hyperliquid";
380
+ * import { privateKeyToAccount } from "viem/accounts";
381
+ *
382
+ * const multiSignAddress = "0x...";
383
+ * const signers = [
384
+ * privateKeyToAccount("0x..."), // first is leader
385
+ * privateKeyToAccount("0x..."),
386
+ * // ...
387
+ * privateKeyToAccount("0x..."),
388
+ * ];
389
+ *
390
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
391
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
392
+ *
393
+ * // Jail self
394
+ * const data = await multiSignClient.cSignerAction({ jailSelf: null });
395
+ *
396
+ * // Unjail self
397
+ * const data = await multiSignClient.cSignerAction({ unjailSelf: null });
398
+ * ```
399
+ */
400
+ cSignerAction(args: CSignerActionParameters_JailSelf, signal?: AbortSignal): ReturnType<ExchangeClient["cSignerAction"]>;
401
+ cSignerAction(args: CSignerActionParameters_UnjailSelf, signal?: AbortSignal): ReturnType<ExchangeClient["cSignerAction"]>;
402
+ /**
403
+ * @param args - The parameters for the request.
404
+ * @param signal - An optional abort signal.
405
+ * @returns Successful response without specific data.
406
+ * @throws {ApiRequestError} When the API returns an error response.
407
+ *
408
+ * @example
409
+ * ```ts
410
+ * import * as hl from "@nktkas/hyperliquid";
411
+ * import { privateKeyToAccount } from "viem/accounts";
412
+ *
413
+ * const multiSignAddress = "0x...";
414
+ * const signers = [
415
+ * privateKeyToAccount("0x..."), // first is leader
416
+ * privateKeyToAccount("0x..."),
417
+ * // ...
418
+ * privateKeyToAccount("0x..."),
419
+ * ];
420
+ *
421
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
422
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
423
+ *
424
+ * // Change validator profile
425
+ * const data = await multiSignClient.cValidatorAction({
426
+ * changeProfile: {
427
+ * name: "My Validator",
428
+ * description: "Validator description",
429
+ * unjailed: true,
430
+ * }
431
+ * });
432
+ * ```
433
+ */
434
+ cValidatorAction(args: CValidatorActionParameters_ChangeProfile, signal?: AbortSignal): ReturnType<ExchangeClient["cSignerAction"]>;
435
+ cValidatorAction(args: CValidatorActionParameters_Register, signal?: AbortSignal): ReturnType<ExchangeClient["cSignerAction"]>;
436
+ cValidatorAction(args: CValidatorActionParameters_Unregister, signal?: AbortSignal): ReturnType<ExchangeClient["cSignerAction"]>;
437
+ /**
438
+ * @param args - The parameters for the request.
439
+ * @param signal - An optional abort signal.
440
+ * @returns Successful response without specific data.
441
+ * @throws {ApiRequestError} When the API returns an error response.
442
+ *
443
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#withdraw-from-staking
444
+ * @example
445
+ * ```ts
446
+ * import * as hl from "@nktkas/hyperliquid";
447
+ * import { privateKeyToAccount } from "viem/accounts";
448
+ *
449
+ * const multiSignAddress = "0x...";
450
+ * const signers = [
451
+ * privateKeyToAccount("0x..."), // first is leader
452
+ * privateKeyToAccount("0x..."),
453
+ * // ...
454
+ * privateKeyToAccount("0x..."),
455
+ * ];
456
+ *
457
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
458
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
459
+ *
460
+ * const data = await multiSignClient.cWithdraw({ wei: 1 * 1e8 });
461
+ * ```
462
+ */
463
+ cWithdraw(...[args, signal]: Parameters<ExchangeClient["cWithdraw"]>): ReturnType<ExchangeClient["cWithdraw"]>;
464
+ /**
465
+ * @param args - The parameters for the request.
466
+ * @param signal - An optional abort signal.
467
+ * @returns Response for creating a sub-account.
468
+ * @throws {ApiRequestError} When the API returns an error response.
469
+ *
470
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/evm/dual-block-architecture
471
+ * @example
472
+ * ```ts
473
+ * import * as hl from "@nktkas/hyperliquid";
474
+ * import { privateKeyToAccount } from "viem/accounts";
475
+ *
476
+ * const multiSignAddress = "0x...";
477
+ * const signers = [
478
+ * privateKeyToAccount("0x..."), // first is leader
479
+ * privateKeyToAccount("0x..."),
480
+ * // ...
481
+ * privateKeyToAccount("0x..."),
482
+ * ];
483
+ *
484
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
485
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
486
+ *
487
+ * const data = await multiSignClient.evmUserModify({ usingBigBlocks: true });
488
+ * ```
489
+ */
490
+ evmUserModify(...[args, signal]: Parameters<ExchangeClient["evmUserModify"]>): ReturnType<ExchangeClient["evmUserModify"]>;
491
+ /**
492
+ * @param args - The parameters for the request.
493
+ * @param signal - An optional abort signal.
494
+ * @returns Successful response without specific data.
495
+ * @throws {ApiRequestError} When the API returns an error response.
496
+ *
497
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
498
+ * @example
499
+ * ```ts
500
+ * import * as hl from "@nktkas/hyperliquid";
501
+ * import { privateKeyToAccount } from "viem/accounts";
502
+ *
503
+ * const multiSignAddress = "0x...";
504
+ * const signers = [
505
+ * privateKeyToAccount("0x..."), // first is leader
506
+ * privateKeyToAccount("0x..."),
507
+ * // ...
508
+ * privateKeyToAccount("0x..."),
509
+ * ];
510
+ *
511
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
512
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
513
+ *
514
+ * const data = await multiSignClient.modify({
515
+ * oid: 123,
516
+ * order: {
517
+ * a: 0, // Asset index
518
+ * b: true, // Buy order
519
+ * p: "31000", // New price
520
+ * s: "0.2", // New size
521
+ * r: false, // Not reduce-only
522
+ * t: {
523
+ * limit: {
524
+ * tif: "Gtc", // Good-til-cancelled
525
+ * },
526
+ * },
527
+ * c: "0x...", // Client Order ID (optional)
528
+ * },
529
+ * });
530
+ * ```
531
+ */
532
+ modify(...[args, signal]: Parameters<ExchangeClient["modify"]>): ReturnType<ExchangeClient["modify"]>;
533
+ /**
534
+ * @multisign Not implemented
535
+ */
536
+ multiSig<T extends SuccessResponse | CancelResponseSuccess | CreateSubAccountResponse | CreateVaultResponse | OrderResponseSuccess | TwapOrderResponseSuccess | TwapCancelResponseSuccess>(...[_args, _signal]: Parameters<ExchangeClient["multiSig"]>): Promise<T>;
537
+ /**
538
+ * @param args - The parameters for the request.
539
+ * @param signal - An optional abort signal.
540
+ * @returns Successful variant of {@link OrderResponse} without error statuses.
541
+ * @throws {ApiRequestError} When the API returns an error response.
542
+ *
543
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
544
+ * @example
545
+ * ```ts
546
+ * import * as hl from "@nktkas/hyperliquid";
547
+ * import { privateKeyToAccount } from "viem/accounts";
548
+ *
549
+ * const multiSignAddress = "0x...";
550
+ * const signers = [
551
+ * privateKeyToAccount("0x..."), // first is leader
552
+ * privateKeyToAccount("0x..."),
553
+ * // ...
554
+ * privateKeyToAccount("0x..."),
555
+ * ];
556
+ *
557
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
558
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
559
+ *
560
+ * const data = await multiSignClient.order({
561
+ * orders: [{
562
+ * a: 0, // Asset index
563
+ * b: true, // Buy order
564
+ * p: "30000", // Price
565
+ * s: "0.1", // Size
566
+ * r: false, // Not reduce-only
567
+ * t: {
568
+ * limit: {
569
+ * tif: "Gtc", // Good-til-cancelled
570
+ * },
571
+ * },
572
+ * c: "0x...", // Client Order ID (optional)
573
+ * }],
574
+ * grouping: "na", // No grouping
575
+ * });
576
+ * ```
577
+ */
578
+ order(...[args, signal]: Parameters<ExchangeClient["order"]>): ReturnType<ExchangeClient["order"]>;
579
+ /**
580
+ * @param args - The parameters for the request.
581
+ * @param signal - An optional abort signal.
582
+ * @returns Successful response without specific data.
583
+ * @throws {ApiRequestError} When the API returns an error response.
584
+ *
585
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-3-assets
586
+ * @example
587
+ * ```ts
588
+ * import * as hl from "@nktkas/hyperliquid";
589
+ * import { privateKeyToAccount } from "viem/accounts";
590
+ *
591
+ * const multiSignAddress = "0x...";
592
+ * const signers = [
593
+ * privateKeyToAccount("0x..."), // first is leader
594
+ * privateKeyToAccount("0x..."),
595
+ * // ...
596
+ * privateKeyToAccount("0x..."),
597
+ * ];
598
+ *
599
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
600
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
601
+ *
602
+ * const data = await multiSignClient.perpDeploy({
603
+ * registerAsset: {
604
+ * maxGas: 1000000,
605
+ * assetRequest: {
606
+ * coin: "USDC",
607
+ * szDecimals: 8,
608
+ * oraclePx: "1",
609
+ * marginTableId: 1,
610
+ * onlyIsolated: false,
611
+ * },
612
+ * dex: "test",
613
+ * },
614
+ * });
615
+ * ```
616
+ */
617
+ perpDeploy(args: PerpDeployParameters_RegisterAsset, signal?: AbortSignal): ReturnType<ExchangeClient["perpDeploy"]>;
618
+ perpDeploy(args: PerpDeployParameters_SetOracle, signal?: AbortSignal): ReturnType<ExchangeClient["perpDeploy"]>;
619
+ /**
620
+ * @param args - The parameters for the request.
621
+ * @param signal - An optional abort signal.
622
+ * @returns Successful response without specific data.
623
+ * @throws {ApiRequestError} When the API returns an error response.
624
+ *
625
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#transfer-from-spot-account-to-perp-account-and-vice-versa
626
+ * @example
627
+ * ```ts
628
+ * import * as hl from "@nktkas/hyperliquid";
629
+ * import { privateKeyToAccount } from "viem/accounts";
630
+ *
631
+ * const multiSignAddress = "0x...";
632
+ * const signers = [
633
+ * privateKeyToAccount("0x..."), // first is leader
634
+ * privateKeyToAccount("0x..."),
635
+ * // ...
636
+ * privateKeyToAccount("0x..."),
637
+ * ];
638
+ *
639
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
640
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
641
+ *
642
+ * const data = await multiSignClient.perpDexClassTransfer({
643
+ * dex: "test",
644
+ * token: "USDC",
645
+ * amount: "1",
646
+ * toPerp: true,
647
+ * });
648
+ * ```
649
+ */
650
+ perpDexClassTransfer(...[args, signal]: Parameters<ExchangeClient["perpDexClassTransfer"]>): ReturnType<ExchangeClient["perpDexClassTransfer"]>;
651
+ /**
652
+ * @param args - The parameters for the request.
653
+ * @param signal - An optional abort signal.
654
+ * @returns Successful response without specific data.
655
+ * @throws {ApiRequestError} When the API returns an error response.
656
+ *
657
+ * @see null - no documentation
658
+ * @example
659
+ * ```ts
660
+ * import * as hl from "@nktkas/hyperliquid";
661
+ * import { privateKeyToAccount } from "viem/accounts";
662
+ *
663
+ * const multiSignAddress = "0x...";
664
+ * const signers = [
665
+ * privateKeyToAccount("0x..."), // first is leader
666
+ * privateKeyToAccount("0x..."),
667
+ * // ...
668
+ * privateKeyToAccount("0x..."),
669
+ * ];
670
+ *
671
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
672
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
673
+ *
674
+ * const data = await multiSignClient.registerReferrer({ code: "TEST" });
675
+ * ```
676
+ */
677
+ registerReferrer(...[args, signal]: Parameters<ExchangeClient["registerReferrer"]>): ReturnType<ExchangeClient["registerReferrer"]>;
678
+ /**
679
+ * @param args - The parameters for the request.
680
+ * @param signal - An optional abort signal.
681
+ * @returns Successful response without specific data.
682
+ * @throws {ApiRequestError} When the API returns an error response.
683
+ *
684
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#reserve-additional-actions
685
+ * @example
686
+ * ```ts
687
+ * import * as hl from "@nktkas/hyperliquid";
688
+ * import { privateKeyToAccount } from "viem/accounts";
689
+ *
690
+ * const multiSignAddress = "0x...";
691
+ * const signers = [
692
+ * privateKeyToAccount("0x..."), // first is leader
693
+ * privateKeyToAccount("0x..."),
694
+ * // ...
695
+ * privateKeyToAccount("0x..."),
696
+ * ];
697
+ *
698
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
699
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
700
+ *
701
+ * const data = await multiSignClient.reserveRequestWeight({ weight: 10 });
702
+ * ```
703
+ */
704
+ reserveRequestWeight(...[args, signal]: Parameters<ExchangeClient["reserveRequestWeight"]>): ReturnType<ExchangeClient["reserveRequestWeight"]>;
705
+ /**
706
+ * @param args - The parameters for the request.
707
+ * @param signal - An optional abort signal.
708
+ * @returns Successful response without specific data.
709
+ * @throws {ApiRequestError} When the API returns an error response.
710
+ *
711
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#schedule-cancel-dead-mans-switch
712
+ * @example
713
+ * ```ts
714
+ * import * as hl from "@nktkas/hyperliquid";
715
+ * import { privateKeyToAccount } from "viem/accounts";
716
+ *
717
+ * const multiSignAddress = "0x...";
718
+ * const signers = [
719
+ * privateKeyToAccount("0x..."), // first is leader
720
+ * privateKeyToAccount("0x..."),
721
+ * // ...
722
+ * privateKeyToAccount("0x..."),
723
+ * ];
724
+ *
725
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
726
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
727
+ *
728
+ * const data = await multiSignClient.scheduleCancel({ time: Date.now() + 3600000 });
729
+ * ```
730
+ */
731
+ scheduleCancel(args?: ScheduleCancelParameters, signal?: AbortSignal): ReturnType<ExchangeClient["scheduleCancel"]>;
732
+ scheduleCancel(signal?: AbortSignal): ReturnType<ExchangeClient["scheduleCancel"]>;
733
+ /**
734
+ * @param args - The parameters for the request.
735
+ * @param signal - An optional abort signal.
736
+ * @returns Successful response without specific data.
737
+ * @throws {ApiRequestError} When the API returns an error response.
738
+ *
739
+ * @see null - no documentation
740
+ * @example
741
+ * ```ts
742
+ * import * as hl from "@nktkas/hyperliquid";
743
+ * import { privateKeyToAccount } from "viem/accounts";
744
+ *
745
+ * const multiSignAddress = "0x...";
746
+ * const signers = [
747
+ * privateKeyToAccount("0x..."), // first is leader
748
+ * privateKeyToAccount("0x..."),
749
+ * // ...
750
+ * privateKeyToAccount("0x..."),
751
+ * ];
752
+ *
753
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
754
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
755
+ *
756
+ * const data = await multiSignClient.setDisplayName({ displayName: "My Name" });
757
+ * ```
758
+ */
759
+ setDisplayName(...[args, signal]: Parameters<ExchangeClient["setDisplayName"]>): ReturnType<ExchangeClient["setDisplayName"]>;
760
+ /**
761
+ * @param args - The parameters for the request.
762
+ * @param signal - An optional abort signal.
763
+ * @returns Successful response without specific data.
764
+ * @throws {ApiRequestError} When the API returns an error response.
765
+ *
766
+ * @see null - no documentation
767
+ * @example
768
+ * ```ts
769
+ * import * as hl from "@nktkas/hyperliquid";
770
+ * import { privateKeyToAccount } from "viem/accounts";
771
+ *
772
+ * const multiSignAddress = "0x...";
773
+ * const signers = [
774
+ * privateKeyToAccount("0x..."), // first is leader
775
+ * privateKeyToAccount("0x..."),
776
+ * // ...
777
+ * privateKeyToAccount("0x..."),
778
+ * ];
779
+ *
780
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
781
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
782
+ *
783
+ * const data = await multiSignClient.setReferrer({ code: "TEST" });
784
+ * ```
785
+ */
786
+ setReferrer(...[args, signal]: Parameters<ExchangeClient["setReferrer"]>): ReturnType<ExchangeClient["setReferrer"]>;
787
+ /**
788
+ * @param args - The parameters for the request.
789
+ * @param signal - An optional abort signal.
790
+ * @returns Successful response without specific data.
791
+ * @throws {ApiRequestError} When the API returns an error response.
792
+ *
793
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-1-and-hip-2-assets
794
+ * @example
795
+ * ```ts
796
+ * import * as hl from "@nktkas/hyperliquid";
797
+ * import { privateKeyToAccount } from "viem/accounts";
798
+ *
799
+ * const multiSignAddress = "0x...";
800
+ * const signers = [
801
+ * privateKeyToAccount("0x..."), // first is leader
802
+ * privateKeyToAccount("0x..."),
803
+ * // ...
804
+ * privateKeyToAccount("0x..."),
805
+ * ];
806
+ *
807
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
808
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
809
+ *
810
+ * const data = await multiSignClient.spotDeploy({
811
+ * registerToken2: {
812
+ * spec: {
813
+ * name: "USDC",
814
+ * szDecimals: 8,
815
+ * weiDecimals: 8,
816
+ * },
817
+ * maxGas: 1000000,
818
+ * fullName: "USD Coin",
819
+ * },
820
+ * });
821
+ * ```
822
+ */
823
+ spotDeploy(args: SpotDeployParameters_Genesis, signal?: AbortSignal): ReturnType<ExchangeClient["spotDeploy"]>;
824
+ spotDeploy(args: SpotDeployParameters_RegisterHyperliquidity, signal?: AbortSignal): ReturnType<ExchangeClient["spotDeploy"]>;
825
+ spotDeploy(args: SpotDeployParameters_RegisterSpot, signal?: AbortSignal): ReturnType<ExchangeClient["spotDeploy"]>;
826
+ spotDeploy(args: SpotDeployParameters_RegisterToken2, signal?: AbortSignal): ReturnType<ExchangeClient["spotDeploy"]>;
827
+ spotDeploy(args: SpotDeployParameters_SetDeployerTradingFeeShare, signal?: AbortSignal): ReturnType<ExchangeClient["spotDeploy"]>;
828
+ spotDeploy(args: SpotDeployParameters_UserGenesis, signal?: AbortSignal): ReturnType<ExchangeClient["spotDeploy"]>;
829
+ /**
830
+ * @param args - The parameters for the request.
831
+ * @param signal - An optional abort signal.
832
+ * @returns Successful response without specific data.
833
+ * @throws {ApiRequestError} When the API returns an error response.
834
+ *
835
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-spot-transfer
836
+ * @example
837
+ * ```ts
838
+ * import * as hl from "@nktkas/hyperliquid";
839
+ * import { privateKeyToAccount } from "viem/accounts";
840
+ *
841
+ * const multiSignAddress = "0x...";
842
+ * const signers = [
843
+ * privateKeyToAccount("0x..."), // first is leader
844
+ * privateKeyToAccount("0x..."),
845
+ * // ...
846
+ * privateKeyToAccount("0x..."),
847
+ * ];
848
+ *
849
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
850
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
851
+ *
852
+ * const data = await multiSignClient.spotSend({
853
+ * destination: "0x...",
854
+ * token: "USDC:0xeb62eee3685fc4c43992febcd9e75443",
855
+ * amount: "1",
856
+ * });
857
+ * ```
858
+ */
859
+ spotSend(...[args, signal]: Parameters<ExchangeClient["spotSend"]>): ReturnType<ExchangeClient["spotSend"]>;
860
+ /**
861
+ * @param args - The parameters for the request.
862
+ * @param signal - An optional abort signal.
863
+ * @returns Successful response without specific data.
864
+ * @throws {ApiRequestError} When the API returns an error response.
865
+ *
866
+ * @see null - no documentation
867
+ * @example
868
+ * ```ts
869
+ * import * as hl from "@nktkas/hyperliquid";
870
+ * import { privateKeyToAccount } from "viem/accounts";
871
+ *
872
+ * const multiSignAddress = "0x...";
873
+ * const signers = [
874
+ * privateKeyToAccount("0x..."), // first is leader
875
+ * privateKeyToAccount("0x..."),
876
+ * // ...
877
+ * privateKeyToAccount("0x..."),
878
+ * ];
879
+ *
880
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
881
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
882
+ *
883
+ * const data = await multiSignClient.spotUser({ toggleSpotDusting: { optOut: false } });
884
+ * ```
885
+ */
886
+ spotUser(...[args, signal]: Parameters<ExchangeClient["spotUser"]>): ReturnType<ExchangeClient["spotUser"]>;
887
+ /**
888
+ * @param args - The parameters for the request.
889
+ * @param signal - An optional abort signal.
890
+ * @returns Successful response without specific data.
891
+ * @throws {ApiRequestError} When the API returns an error response.
892
+ *
893
+ * @see null - no documentation
894
+ * @example
895
+ * ```ts
896
+ * import * as hl from "@nktkas/hyperliquid";
897
+ * import { privateKeyToAccount } from "viem/accounts";
898
+ *
899
+ * const multiSignAddress = "0x...";
900
+ * const signers = [
901
+ * privateKeyToAccount("0x..."), // first is leader
902
+ * privateKeyToAccount("0x..."),
903
+ * // ...
904
+ * privateKeyToAccount("0x..."),
905
+ * ];
906
+ *
907
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
908
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
909
+ *
910
+ * const data = await multiSignClient.subAccountSpotTransfer({
911
+ * subAccountUser: "0x...",
912
+ * isDeposit: true,
913
+ * token: "USDC:0xeb62eee3685fc4c43992febcd9e75443",
914
+ * amount: "1",
915
+ * });
916
+ * ```
917
+ */
918
+ subAccountSpotTransfer(...[args, signal]: Parameters<ExchangeClient["subAccountSpotTransfer"]>): ReturnType<ExchangeClient["subAccountSpotTransfer"]>;
919
+ /**
920
+ * @param args - The parameters for the request.
921
+ * @param signal - An optional abort signal.
922
+ * @returns Successful response without specific data.
923
+ * @throws {ApiRequestError} When the API returns an error response.
924
+ *
925
+ * @see null - no documentation
926
+ * @example
927
+ * ```ts
928
+ * import * as hl from "@nktkas/hyperliquid";
929
+ * import { privateKeyToAccount } from "viem/accounts";
930
+ *
931
+ * const multiSignAddress = "0x...";
932
+ * const signers = [
933
+ * privateKeyToAccount("0x..."), // first is leader
934
+ * privateKeyToAccount("0x..."),
935
+ * // ...
936
+ * privateKeyToAccount("0x..."),
937
+ * ];
938
+ *
939
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
940
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
941
+ *
942
+ * const data = await multiSignClient.subAccountTransfer({
943
+ * subAccountUser: "0x...",
944
+ * isDeposit: true,
945
+ * usd: 1 * 1e6,
946
+ * });
947
+ * ```
948
+ */
949
+ subAccountTransfer(...[args, signal]: Parameters<ExchangeClient["subAccountTransfer"]>): ReturnType<ExchangeClient["subAccountTransfer"]>;
950
+ /**
951
+ * @param args - The parameters for the request.
952
+ * @param signal - An optional abort signal.
953
+ * @returns Successful response without specific data.
954
+ * @throws {ApiRequestError} When the API returns an error response.
955
+ *
956
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#delegate-or-undelegate-stake-from-validator
957
+ * @example
958
+ * ```ts
959
+ * import * as hl from "@nktkas/hyperliquid";
960
+ * import { privateKeyToAccount } from "viem/accounts";
961
+ *
962
+ * const multiSignAddress = "0x...";
963
+ * const signers = [
964
+ * privateKeyToAccount("0x..."), // first is leader
965
+ * privateKeyToAccount("0x..."),
966
+ * // ...
967
+ * privateKeyToAccount("0x..."),
968
+ * ];
969
+ *
970
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
971
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
972
+ *
973
+ * const data = await multiSignClient.tokenDelegate({
974
+ * validator: "0x...",
975
+ * isUndelegate: true,
976
+ * wei: 1 * 1e8,
977
+ * });
978
+ * ```
979
+ */
980
+ tokenDelegate(...[args, signal]: Parameters<ExchangeClient["tokenDelegate"]>): ReturnType<ExchangeClient["tokenDelegate"]>;
981
+ /**
982
+ * @param args - The parameters for the request.
983
+ * @param signal - An optional abort signal.
984
+ * @returns Successful variant of {@link TwapCancelResponse} without error status.
985
+ * @throws {ApiRequestError} When the API returns an error response.
986
+ *
987
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-a-twap-order
988
+ * @example
989
+ * ```ts
990
+ * import * as hl from "@nktkas/hyperliquid";
991
+ * import { privateKeyToAccount } from "viem/accounts";
992
+ *
993
+ * const multiSignAddress = "0x...";
994
+ * const signers = [
995
+ * privateKeyToAccount("0x..."), // first is leader
996
+ * privateKeyToAccount("0x..."),
997
+ * // ...
998
+ * privateKeyToAccount("0x..."),
999
+ * ];
1000
+ *
1001
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
1002
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
1003
+ *
1004
+ * const data = await multiSignClient.twapCancel({
1005
+ * a: 0, // Asset index
1006
+ * t: 1, // TWAP ID
1007
+ * });
1008
+ * ```
1009
+ */
1010
+ twapCancel(...[args, signal]: Parameters<ExchangeClient["twapCancel"]>): ReturnType<ExchangeClient["twapCancel"]>;
1011
+ /**
1012
+ * @param args - The parameters for the request.
1013
+ * @param signal - An optional abort signal.
1014
+ * @returns Successful variant of {@link TwapOrderResponse} without error status.
1015
+ * @throws {ApiRequestError} When the API returns an error response.
1016
+ *
1017
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-a-twap-order
1018
+ * @example
1019
+ * ```ts
1020
+ * import * as hl from "@nktkas/hyperliquid";
1021
+ * import { privateKeyToAccount } from "viem/accounts";
1022
+ *
1023
+ * const multiSignAddress = "0x...";
1024
+ * const signers = [
1025
+ * privateKeyToAccount("0x..."), // first is leader
1026
+ * privateKeyToAccount("0x..."),
1027
+ * // ...
1028
+ * privateKeyToAccount("0x..."),
1029
+ * ];
1030
+ *
1031
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
1032
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
1033
+ *
1034
+ * const data = await multiSignClient.twapOrder({
1035
+ * a: 0, // Asset index
1036
+ * b: true, // Buy order
1037
+ * s: "1", // Size
1038
+ * r: false, // Not reduce-only
1039
+ * m: 10, // Duration in minutes
1040
+ * t: true, // Randomize order timing
1041
+ * });
1042
+ * ```
1043
+ */
1044
+ twapOrder(...[args, signal]: Parameters<ExchangeClient["twapOrder"]>): ReturnType<ExchangeClient["twapOrder"]>;
1045
+ /**
1046
+ * @param args - The parameters for the request.
1047
+ * @param signal - An optional abort signal.
1048
+ * @returns Successful response without specific data.
1049
+ * @throws {ApiRequestError} When the API returns an error response.
1050
+ *
1051
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
1052
+ * @example
1053
+ * ```ts
1054
+ * import * as hl from "@nktkas/hyperliquid";
1055
+ * import { privateKeyToAccount } from "viem/accounts";
1056
+ *
1057
+ * const multiSignAddress = "0x...";
1058
+ * const signers = [
1059
+ * privateKeyToAccount("0x..."), // first is leader
1060
+ * privateKeyToAccount("0x..."),
1061
+ * // ...
1062
+ * privateKeyToAccount("0x..."),
1063
+ * ];
1064
+ *
1065
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
1066
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
1067
+ *
1068
+ * const data = await multiSignClient.updateIsolatedMargin({
1069
+ * asset: 0,
1070
+ * isBuy: true,
1071
+ * ntli: 1 * 1e6,
1072
+ * });
1073
+ * ```
1074
+ */
1075
+ updateIsolatedMargin(...[args, signal]: Parameters<ExchangeClient["updateIsolatedMargin"]>): ReturnType<ExchangeClient["updateIsolatedMargin"]>;
1076
+ /**
1077
+ * @param args - The parameters for the request.
1078
+ * @param signal - An optional abort signal.
1079
+ * @returns Successful response without specific data.
1080
+ * @throws {ApiRequestError} When the API returns an error response.
1081
+ *
1082
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-leverage
1083
+ * @example
1084
+ * ```ts
1085
+ * import * as hl from "@nktkas/hyperliquid";
1086
+ * import { privateKeyToAccount } from "viem/accounts";
1087
+ *
1088
+ * const multiSignAddress = "0x...";
1089
+ * const signers = [
1090
+ * privateKeyToAccount("0x..."), // first is leader
1091
+ * privateKeyToAccount("0x..."),
1092
+ * // ...
1093
+ * privateKeyToAccount("0x..."),
1094
+ * ];
1095
+ *
1096
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
1097
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
1098
+ *
1099
+ * const data = await multiSignClient.updateLeverage({
1100
+ * asset: 0,
1101
+ * isCross: true,
1102
+ * leverage: 5,
1103
+ * });
1104
+ * ```
1105
+ */
1106
+ updateLeverage(...[args, signal]: Parameters<ExchangeClient["updateLeverage"]>): ReturnType<ExchangeClient["updateLeverage"]>;
1107
+ /**
1108
+ * @param args - The parameters for the request.
1109
+ * @param signal - An optional abort signal.
1110
+ * @returns Successful response without specific data.
1111
+ * @throws {ApiRequestError} When the API returns an error response.
1112
+ *
1113
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#transfer-from-spot-account-to-perp-account-and-vice-versa
1114
+ * @example
1115
+ * ```ts
1116
+ * import * as hl from "@nktkas/hyperliquid";
1117
+ * import { privateKeyToAccount } from "viem/accounts";
1118
+ *
1119
+ * const multiSignAddress = "0x...";
1120
+ * const signers = [
1121
+ * privateKeyToAccount("0x..."), // first is leader
1122
+ * privateKeyToAccount("0x..."),
1123
+ * // ...
1124
+ * privateKeyToAccount("0x..."),
1125
+ * ];
1126
+ *
1127
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
1128
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
1129
+ *
1130
+ * const data = await multiSignClient.usdClassTransfer({ amount: "1", toPerp: true });
1131
+ * ```
1132
+ */
1133
+ usdClassTransfer(...[args, signal]: Parameters<ExchangeClient["usdClassTransfer"]>): ReturnType<ExchangeClient["usdClassTransfer"]>;
1134
+ /**
1135
+ * @param args - The parameters for the request.
1136
+ * @param signal - An optional abort signal.
1137
+ * @returns Successful response without specific data.
1138
+ * @throws {ApiRequestError} When the API returns an error response.
1139
+ *
1140
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-usdc-transfer
1141
+ * @example
1142
+ * ```ts
1143
+ * import * as hl from "@nktkas/hyperliquid";
1144
+ * import { privateKeyToAccount } from "viem/accounts";
1145
+ *
1146
+ * const multiSignAddress = "0x...";
1147
+ * const signers = [
1148
+ * privateKeyToAccount("0x..."), // first is leader
1149
+ * privateKeyToAccount("0x..."),
1150
+ * // ...
1151
+ * privateKeyToAccount("0x..."),
1152
+ * ];
1153
+ *
1154
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
1155
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
1156
+ *
1157
+ * const data = await multiSignClient.usdSend({ destination: "0x...", amount: "1" });
1158
+ * ```
1159
+ */
1160
+ usdSend(...[args, signal]: Parameters<ExchangeClient["usdSend"]>): ReturnType<ExchangeClient["usdSend"]>;
1161
+ /**
1162
+ * @param args - The parameters for the request.
1163
+ * @param signal - An optional abort signal.
1164
+ * @returns Successful response without specific data.
1165
+ * @throws {ApiRequestError} When the API returns an error response.
1166
+ *
1167
+ * @see null - no documentation
1168
+ * @example
1169
+ * ```ts
1170
+ * import * as hl from "@nktkas/hyperliquid";
1171
+ * import { privateKeyToAccount } from "viem/accounts";
1172
+ *
1173
+ * const multiSignAddress = "0x...";
1174
+ * const signers = [
1175
+ * privateKeyToAccount("0x..."), // first is leader
1176
+ * privateKeyToAccount("0x..."),
1177
+ * // ...
1178
+ * privateKeyToAccount("0x..."),
1179
+ * ];
1180
+ *
1181
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
1182
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
1183
+ *
1184
+ * const data = await multiSignClient.vaultDistribute({ vaultAddress: "0x...", usd: 10 * 1e6 });
1185
+ * ```
1186
+ */
1187
+ vaultDistribute(...[args, signal]: Parameters<ExchangeClient["vaultDistribute"]>): ReturnType<ExchangeClient["vaultDistribute"]>;
1188
+ /**
1189
+ * @param args - The parameters for the request.
1190
+ * @param signal - An optional abort signal.
1191
+ * @returns Successful response without specific data.
1192
+ * @throws {ApiRequestError} When the API returns an error response.
1193
+ *
1194
+ * @see null - no documentation
1195
+ * @example
1196
+ * ```ts
1197
+ * import * as hl from "@nktkas/hyperliquid";
1198
+ * import { privateKeyToAccount } from "viem/accounts";
1199
+ *
1200
+ * const multiSignAddress = "0x...";
1201
+ * const signers = [
1202
+ * privateKeyToAccount("0x..."), // first is leader
1203
+ * privateKeyToAccount("0x..."),
1204
+ * // ...
1205
+ * privateKeyToAccount("0x..."),
1206
+ * ];
1207
+ *
1208
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
1209
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
1210
+ *
1211
+ * const data = await multiSignClient.vaultModify({
1212
+ * vaultAddress: "0x...",
1213
+ * allowDeposits: true,
1214
+ * alwaysCloseOnWithdraw: false,
1215
+ * });
1216
+ * ```
1217
+ */
1218
+ vaultModify(...[args, signal]: Parameters<ExchangeClient["vaultModify"]>): ReturnType<ExchangeClient["vaultModify"]>;
1219
+ /**
1220
+ * @param args - The parameters for the request.
1221
+ * @param signal - An optional abort signal.
1222
+ * @returns Successful response without specific data.
1223
+ * @throws {ApiRequestError} When the API returns an error response.
1224
+ *
1225
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault
1226
+ * @example
1227
+ * ```ts
1228
+ * import * as hl from "@nktkas/hyperliquid";
1229
+ * import { privateKeyToAccount } from "viem/accounts";
1230
+ *
1231
+ * const multiSignAddress = "0x...";
1232
+ * const signers = [
1233
+ * privateKeyToAccount("0x..."), // first is leader
1234
+ * privateKeyToAccount("0x..."),
1235
+ * // ...
1236
+ * privateKeyToAccount("0x..."),
1237
+ * ];
1238
+ *
1239
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
1240
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
1241
+ *
1242
+ * const data = await multiSignClient.vaultTransfer({
1243
+ * vaultAddress: "0x...",
1244
+ * isDeposit: true,
1245
+ * usd: 10 * 1e6,
1246
+ * });
1247
+ * ```
1248
+ */
1249
+ vaultTransfer(...[args, signal]: Parameters<ExchangeClient["vaultTransfer"]>): ReturnType<ExchangeClient["vaultTransfer"]>;
1250
+ /**
1251
+ * @param args - The parameters for the request.
1252
+ * @param signal - An optional abort signal.
1253
+ * @returns Successful response without specific data.
1254
+ * @throws {ApiRequestError} When the API returns an error response.
1255
+ *
1256
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
1257
+ * @example
1258
+ * ```ts
1259
+ * import * as hl from "@nktkas/hyperliquid";
1260
+ * import { privateKeyToAccount } from "viem/accounts";
1261
+ *
1262
+ * const multiSignAddress = "0x...";
1263
+ * const signers = [
1264
+ * privateKeyToAccount("0x..."), // first is leader
1265
+ * privateKeyToAccount("0x..."),
1266
+ * // ...
1267
+ * privateKeyToAccount("0x..."),
1268
+ * ];
1269
+ *
1270
+ * const transport = new hl.HttpTransport(); // or WebSocketTransport
1271
+ * const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
1272
+ *
1273
+ * const data = await multiSignClient.withdraw3({ destination: "0x...", amount: "1" });
1274
+ * ```
1275
+ */
1276
+ withdraw3(...[args, signal]: Parameters<ExchangeClient["withdraw3"]>): ReturnType<ExchangeClient["withdraw3"]>;
1277
+ /** Extracts the wallet address from different wallet types. */
1278
+ protected _getWalletAddress(wallet: AbstractWalletWithAddress): Promise<`0x${string}`>;
1279
+ /** Signs L1 action with all signers for multi-signature operations. */
1280
+ protected _multiSignL1Action(args: {
1281
+ action: BaseExchangeRequest["action"];
1282
+ nonce: number;
1283
+ outerSigner: Hex;
1284
+ vaultAddress?: Hex;
1285
+ expiresAfter?: number;
1286
+ }): Promise<Signature[]>;
1287
+ /** Signs user-signed action with all signers for multi-signature operations. */
1288
+ protected _multiSignUserSignedAction(action: BaseExchangeRequest["action"] & {
1289
+ type: keyof typeof userSignedActionEip712Types;
1290
+ signatureChainId: string;
1291
+ } & ({
1292
+ nonce: number;
1293
+ time?: undefined;
1294
+ } | {
1295
+ time: number;
1296
+ nonce?: undefined;
1297
+ }), outerSigner: Hex): Promise<Signature[]>;
1298
+ }
1299
+ //# sourceMappingURL=multiSign.d.ts.map