@nktkas/hyperliquid 0.22.2 → 0.23.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.
- package/README.md +79 -67
- package/esm/mod.d.ts +1 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/src/base.d.ts +4 -1
- package/esm/src/base.d.ts.map +1 -1
- package/esm/src/base.js +2 -2
- package/esm/src/clients/exchange.d.ts +289 -207
- package/esm/src/clients/exchange.d.ts.map +1 -1
- package/esm/src/clients/exchange.js +605 -410
- package/esm/src/clients/info.d.ts +264 -48
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +273 -31
- package/esm/src/clients/multiSign.d.ts +285 -204
- package/esm/src/clients/multiSign.d.ts.map +1 -1
- package/esm/src/clients/multiSign.js +521 -493
- package/esm/src/clients/subscription.d.ts +38 -3
- package/esm/src/clients/subscription.d.ts.map +1 -1
- package/esm/src/clients/subscription.js +36 -3
- package/esm/src/signing/{_ethers.d.ts → _signTypedData/ethers.d.ts} +1 -1
- package/esm/src/signing/_signTypedData/ethers.d.ts.map +1 -0
- package/esm/src/signing/_signTypedData/mod.d.ts +35 -0
- package/esm/src/signing/_signTypedData/mod.d.ts.map +1 -0
- package/esm/src/signing/_signTypedData/mod.js +59 -0
- package/esm/src/signing/_signTypedData/private_key.d.ts +26 -0
- package/esm/src/signing/_signTypedData/private_key.d.ts.map +1 -0
- package/esm/src/signing/_signTypedData/private_key.js +144 -0
- package/esm/src/signing/{_viem.d.ts → _signTypedData/viem.d.ts} +2 -2
- package/esm/src/signing/_signTypedData/viem.d.ts.map +1 -0
- package/{script/src/signing/_window.d.ts → esm/src/signing/_signTypedData/window.d.ts} +18 -12
- package/esm/src/signing/_signTypedData/window.d.ts.map +1 -0
- package/esm/src/signing/{_window.js → _signTypedData/window.js} +3 -2
- package/esm/src/signing/_sorter.d.ts +56 -82
- package/esm/src/signing/_sorter.d.ts.map +1 -1
- package/esm/src/signing/_sorter.js +36 -49
- package/esm/src/signing/mod.d.ts +151 -130
- package/esm/src/signing/mod.d.ts.map +1 -1
- package/esm/src/signing/mod.js +182 -228
- package/esm/src/transports/base.d.ts +1 -1
- package/esm/src/transports/base.d.ts.map +1 -1
- package/esm/src/transports/base.js +2 -2
- package/esm/src/transports/http/http_transport.d.ts +9 -15
- package/esm/src/transports/http/http_transport.d.ts.map +1 -1
- package/esm/src/transports/http/http_transport.js +64 -59
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -1
- package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
- package/esm/src/transports/websocket/_reconnecting_websocket.js +17 -4
- package/esm/src/transports/websocket/_websocket_async_request.d.ts +0 -9
- package/esm/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
- package/esm/src/transports/websocket/_websocket_async_request.js +14 -20
- package/esm/src/transports/websocket/websocket_transport.d.ts +8 -4
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.js +83 -54
- package/esm/src/types/exchange/requests.d.ts +27 -51
- package/esm/src/types/exchange/requests.d.ts.map +1 -1
- package/esm/src/types/explorer/requests.d.ts +5 -8
- package/esm/src/types/explorer/requests.d.ts.map +1 -1
- package/esm/src/types/info/accounts.d.ts +5 -5
- package/esm/src/types/info/accounts.d.ts.map +1 -1
- package/esm/src/types/info/markets.d.ts +6 -0
- package/esm/src/types/info/markets.d.ts.map +1 -1
- package/esm/src/types/info/orders.d.ts +1 -1
- package/esm/src/types/info/orders.d.ts.map +1 -1
- package/esm/src/types/info/requests.d.ts +129 -124
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/{script/src/types/info/delegations.d.ts → esm/src/types/info/validators.d.ts} +2 -2
- package/esm/src/types/info/validators.d.ts.map +1 -0
- package/esm/src/types/info/vaults.d.ts +7 -0
- package/esm/src/types/info/vaults.d.ts.map +1 -1
- package/esm/src/types/mod.d.ts +1 -1
- package/esm/src/types/mod.d.ts.map +1 -1
- package/esm/src/types/subscriptions/requests.d.ts +72 -18
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/esm/src/types/subscriptions/responses.d.ts +2 -0
- package/esm/src/types/subscriptions/responses.d.ts.map +1 -1
- package/package.json +8 -5
- package/script/mod.d.ts +1 -1
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +13 -23
- package/script/src/base.d.ts +4 -1
- package/script/src/base.d.ts.map +1 -1
- package/script/src/base.js +10 -20
- package/script/src/clients/exchange.d.ts +289 -207
- package/script/src/clients/exchange.d.ts.map +1 -1
- package/script/src/clients/exchange.js +2000 -1815
- package/script/src/clients/info.d.ts +264 -48
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +1442 -1210
- package/script/src/clients/multiSign.d.ts +285 -204
- package/script/src/clients/multiSign.d.ts.map +1 -1
- package/script/src/clients/multiSign.js +2043 -2025
- package/script/src/clients/subscription.d.ts +38 -3
- package/script/src/clients/subscription.d.ts.map +1 -1
- package/script/src/clients/subscription.js +568 -545
- package/script/src/signing/{_ethers.d.ts → _signTypedData/ethers.d.ts} +1 -1
- package/script/src/signing/_signTypedData/ethers.d.ts.map +1 -0
- package/script/src/signing/_signTypedData/ethers.js +16 -0
- package/script/src/signing/_signTypedData/mod.d.ts +35 -0
- package/script/src/signing/_signTypedData/mod.d.ts.map +1 -0
- package/script/src/signing/_signTypedData/mod.js +67 -0
- package/script/src/signing/_signTypedData/private_key.d.ts +26 -0
- package/script/src/signing/_signTypedData/private_key.d.ts.map +1 -0
- package/script/src/signing/_signTypedData/private_key.js +148 -0
- package/script/src/signing/{_viem.d.ts → _signTypedData/viem.d.ts} +2 -2
- package/script/src/signing/_signTypedData/viem.d.ts.map +1 -0
- package/script/src/signing/_signTypedData/viem.js +9 -0
- package/{esm/src/signing/_window.d.ts → script/src/signing/_signTypedData/window.d.ts} +18 -12
- package/script/src/signing/_signTypedData/window.d.ts.map +1 -0
- package/script/src/signing/_signTypedData/window.js +34 -0
- package/script/src/signing/_sorter.d.ts +56 -82
- package/script/src/signing/_sorter.d.ts.map +1 -1
- package/script/src/signing/_sorter.js +655 -678
- package/script/src/signing/mod.d.ts +151 -130
- package/script/src/signing/mod.d.ts.map +1 -1
- package/script/src/signing/mod.js +286 -342
- package/script/src/transports/base.d.ts +1 -1
- package/script/src/transports/base.d.ts.map +1 -1
- package/script/src/transports/base.js +11 -21
- package/script/src/transports/http/http_transport.d.ts +9 -15
- package/script/src/transports/http/http_transport.d.ts.map +1 -1
- package/script/src/transports/http/http_transport.js +97 -102
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.js +51 -61
- package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
- package/script/src/transports/websocket/_reconnecting_websocket.js +271 -268
- package/script/src/transports/websocket/_websocket_async_request.d.ts +0 -9
- package/script/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
- package/script/src/transports/websocket/_websocket_async_request.js +157 -174
- package/script/src/transports/websocket/websocket_transport.d.ts +8 -4
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.js +209 -189
- package/script/src/types/exchange/requests.d.ts +27 -51
- package/script/src/types/exchange/requests.d.ts.map +1 -1
- package/script/src/types/exchange/requests.js +2 -12
- package/script/src/types/exchange/responses.js +2 -12
- package/script/src/types/explorer/requests.d.ts +5 -8
- package/script/src/types/explorer/requests.d.ts.map +1 -1
- package/script/src/types/explorer/requests.js +2 -12
- package/script/src/types/explorer/responses.js +2 -12
- package/script/src/types/info/accounts.d.ts +5 -5
- package/script/src/types/info/accounts.d.ts.map +1 -1
- package/script/src/types/info/accounts.js +2 -12
- package/script/src/types/info/assets.js +2 -12
- package/script/src/types/info/markets.d.ts +6 -0
- package/script/src/types/info/markets.d.ts.map +1 -1
- package/script/src/types/info/markets.js +2 -12
- package/script/src/types/info/orders.d.ts +1 -1
- package/script/src/types/info/orders.d.ts.map +1 -1
- package/script/src/types/info/orders.js +2 -12
- package/script/src/types/info/requests.d.ts +129 -124
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/info/requests.js +2 -12
- package/{esm/src/types/info/delegations.d.ts → script/src/types/info/validators.d.ts} +2 -2
- package/script/src/types/info/validators.d.ts.map +1 -0
- package/script/src/types/info/validators.js +2 -0
- package/script/src/types/info/vaults.d.ts +7 -0
- package/script/src/types/info/vaults.d.ts.map +1 -1
- package/script/src/types/info/vaults.js +2 -12
- package/script/src/types/mod.d.ts +1 -1
- package/script/src/types/mod.d.ts.map +1 -1
- package/script/src/types/mod.js +2 -12
- package/script/src/types/subscriptions/requests.d.ts +72 -18
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
- package/script/src/types/subscriptions/requests.js +2 -12
- package/script/src/types/subscriptions/responses.d.ts +2 -0
- package/script/src/types/subscriptions/responses.d.ts.map +1 -1
- package/script/src/types/subscriptions/responses.js +2 -12
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts +0 -2
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +0 -1
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts +0 -95
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts.map +0 -1
- package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +0 -10
- package/esm/deps/jsr.io/@std/async/1.0.13/delay.d.ts +0 -43
- package/esm/deps/jsr.io/@std/async/1.0.13/delay.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/async/1.0.13/delay.js +0 -63
- package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +0 -9
- package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.js +0 -2
- package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +0 -21
- package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.js +0 -32
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +0 -23
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.js +0 -51
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -13
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -2
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +0 -39
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.js +0 -87
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +0 -9
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.js +0 -2
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts +0 -39
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.js +0 -237
- package/esm/src/signing/_ethers.d.ts.map +0 -1
- package/esm/src/signing/_private_key.d.ts +0 -22
- package/esm/src/signing/_private_key.d.ts.map +0 -1
- package/esm/src/signing/_private_key.js +0 -124
- package/esm/src/signing/_viem.d.ts.map +0 -1
- package/esm/src/signing/_window.d.ts.map +0 -1
- package/esm/src/types/info/delegations.d.ts.map +0 -1
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts +0 -2
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +0 -27
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts +0 -95
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts.map +0 -1
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +0 -24
- package/script/deps/jsr.io/@std/async/1.0.13/delay.d.ts +0 -43
- package/script/deps/jsr.io/@std/async/1.0.13/delay.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/async/1.0.13/delay.js +0 -76
- package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +0 -9
- package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/bytes/1.0.6/_types.js +0 -13
- package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +0 -21
- package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/bytes/1.0.6/concat.js +0 -45
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +0 -23
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.js +0 -67
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -26
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -13
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +0 -39
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.js +0 -101
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +0 -9
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.js +0 -13
- package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts +0 -39
- package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.js +0 -250
- package/script/src/signing/_ethers.d.ts.map +0 -1
- package/script/src/signing/_ethers.js +0 -26
- package/script/src/signing/_private_key.d.ts +0 -22
- package/script/src/signing/_private_key.d.ts.map +0 -1
- package/script/src/signing/_private_key.js +0 -138
- package/script/src/signing/_viem.d.ts.map +0 -1
- package/script/src/signing/_viem.js +0 -19
- package/script/src/signing/_window.d.ts.map +0 -1
- package/script/src/signing/_window.js +0 -43
- package/script/src/types/info/delegations.d.ts.map +0 -1
- package/script/src/types/info/delegations.js +0 -12
- /package/esm/src/signing/{_ethers.js → _signTypedData/ethers.js} +0 -0
- /package/esm/src/signing/{_viem.js → _signTypedData/viem.js} +0 -0
- /package/esm/src/types/info/{delegations.js → validators.js} +0 -0
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import type { Hex } from "../base.js";
|
|
2
2
|
import type { IRequestTransport } from "../transports/base.js";
|
|
3
|
-
import type { BaseExchangeRequest } from "../types/exchange/requests.js";
|
|
4
3
|
import type { CreateSubAccountResponse, CreateVaultResponse, SuccessResponse } from "../types/exchange/responses.js";
|
|
5
4
|
import { type AbstractEthersSigner, type AbstractEthersV5Signer, type AbstractViemWalletClient, type AbstractWallet, type AbstractWindowEthereum, type Signature, userSignedActionEip712Types } from "../signing/mod.js";
|
|
6
|
-
import { type CancelResponseSuccess,
|
|
5
|
+
import { type CancelResponseSuccess, ExchangeClient, type ExchangeClientParameters, type OrderResponseSuccess, type ScheduleCancelParameters, type TwapCancelResponseSuccess, type TwapOrderResponseSuccess } from "./exchange.js";
|
|
6
|
+
type Signers = [AbstractWalletWithAddress, ...AbstractWallet[]];
|
|
7
7
|
/** Parameters for the {@linkcode MultiSignClient} constructor. */
|
|
8
|
-
export interface MultiSignClientParameters<T extends IRequestTransport = IRequestTransport, S extends
|
|
9
|
-
AbstractWalletWithAddress,
|
|
10
|
-
...AbstractWallet[]
|
|
11
|
-
]> extends Omit<ExchangeClientParameters<T, S[0]>, "wallet"> {
|
|
8
|
+
export interface MultiSignClientParameters<T extends IRequestTransport = IRequestTransport, S extends Readonly<Signers> = Signers> extends Omit<ExchangeClientParameters<T, S[0]>, "wallet"> {
|
|
12
9
|
/** The multi-signature account address. */
|
|
13
10
|
multiSignAddress: Hex;
|
|
14
11
|
/** Array of wallets used for multi-signature operations. The first wallet acts as the leader. */
|
|
@@ -33,10 +30,7 @@ export interface AbstractEthersV5SignerWithAddress extends AbstractEthersV5Signe
|
|
|
33
30
|
* @typeParam T The transport used to connect to the Hyperliquid API.
|
|
34
31
|
* @typeParam S Array of wallets where the first wallet acts as the leader.
|
|
35
32
|
*/
|
|
36
|
-
export declare class MultiSignClient<T extends IRequestTransport = IRequestTransport, S extends
|
|
37
|
-
AbstractWalletWithAddress,
|
|
38
|
-
...AbstractWallet[]
|
|
39
|
-
]> extends ExchangeClient<T, S[0]> implements MultiSignClientParameters<T, S> {
|
|
33
|
+
export declare class MultiSignClient<T extends IRequestTransport = IRequestTransport, S extends Readonly<Signers> = Signers> extends ExchangeClient<T, S[0]> implements MultiSignClientParameters<T, S> {
|
|
40
34
|
multiSignAddress: Hex;
|
|
41
35
|
signers: S;
|
|
42
36
|
/**
|
|
@@ -62,10 +56,13 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
62
56
|
*/
|
|
63
57
|
constructor(args: MultiSignClientParameters<T, S>);
|
|
64
58
|
/**
|
|
59
|
+
* Approve an agent to sign on behalf of the master account.
|
|
65
60
|
* @param args - The parameters for the request.
|
|
66
61
|
* @param signal - An optional abort signal
|
|
67
62
|
* @returns Successful response without specific data.
|
|
68
|
-
*
|
|
63
|
+
*
|
|
64
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
65
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
69
66
|
*
|
|
70
67
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-an-api-wallet
|
|
71
68
|
* @example
|
|
@@ -80,15 +77,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
80
77
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
81
78
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
82
79
|
*
|
|
83
|
-
*
|
|
80
|
+
* await multiSignClient.approveAgent({ agentAddress: "0x...", agentName: "..." });
|
|
84
81
|
* ```
|
|
85
82
|
*/
|
|
86
83
|
approveAgent(...[args, signal]: Parameters<ExchangeClient["approveAgent"]>): ReturnType<ExchangeClient["approveAgent"]>;
|
|
87
84
|
/**
|
|
85
|
+
* Approve a maximum fee rate for a builder.
|
|
88
86
|
* @param args - The parameters for the request.
|
|
89
87
|
* @param signal - An optional abort signal.
|
|
90
88
|
* @returns Successful response without specific data.
|
|
91
|
-
*
|
|
89
|
+
*
|
|
90
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
91
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
92
92
|
*
|
|
93
93
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-a-builder-fee
|
|
94
94
|
* @example
|
|
@@ -103,15 +103,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
103
103
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
104
104
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
105
105
|
*
|
|
106
|
-
*
|
|
106
|
+
* await multiSignClient.approveBuilderFee({ maxFeeRate: "0.01%", builder: "0x..." });
|
|
107
107
|
* ```
|
|
108
108
|
*/
|
|
109
109
|
approveBuilderFee(...[args, signal]: Parameters<ExchangeClient["approveBuilderFee"]>): ReturnType<ExchangeClient["approveBuilderFee"]>;
|
|
110
110
|
/**
|
|
111
|
+
* Modify multiple orders.
|
|
111
112
|
* @param args - The parameters for the request.
|
|
112
113
|
* @param signal - An optional abort signal.
|
|
113
114
|
* @returns Successful variant of {@link OrderResponse} without error statuses.
|
|
114
|
-
*
|
|
115
|
+
*
|
|
116
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
117
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
115
118
|
*
|
|
116
119
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
|
|
117
120
|
* @example
|
|
@@ -127,31 +130,31 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
127
130
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
128
131
|
*
|
|
129
132
|
* const data = await multiSignClient.batchModify({
|
|
130
|
-
* modifies: [
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
* limit: {
|
|
140
|
-
* tif: "Gtc", // Good-til-cancelled
|
|
141
|
-
* },
|
|
133
|
+
* modifies: [
|
|
134
|
+
* {
|
|
135
|
+
* oid: 123,
|
|
136
|
+
* order: {
|
|
137
|
+
* a: 0,
|
|
138
|
+
* b: true,
|
|
139
|
+
* p: "31000",
|
|
140
|
+
* s: "0.2",
|
|
141
|
+
* r: false,
|
|
142
|
+
* t: { limit: { tif: "Gtc" } },
|
|
142
143
|
* },
|
|
143
|
-
* c: "0x...", // Client Order ID (optional)
|
|
144
144
|
* },
|
|
145
|
-
*
|
|
145
|
+
* ],
|
|
146
146
|
* });
|
|
147
147
|
* ```
|
|
148
148
|
*/
|
|
149
149
|
batchModify(...[args, signal]: Parameters<ExchangeClient["batchModify"]>): ReturnType<ExchangeClient["batchModify"]>;
|
|
150
150
|
/**
|
|
151
|
+
* Cancel order(s).
|
|
151
152
|
* @param args - The parameters for the request.
|
|
152
153
|
* @param signal - An optional abort signal.
|
|
153
154
|
* @returns Successful variant of {@link CancelResponse} without error statuses.
|
|
154
|
-
*
|
|
155
|
+
*
|
|
156
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
157
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
155
158
|
*
|
|
156
159
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
157
160
|
* @example
|
|
@@ -167,19 +170,21 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
167
170
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
168
171
|
*
|
|
169
172
|
* const data = await multiSignClient.cancel({
|
|
170
|
-
* cancels: [
|
|
171
|
-
* a: 0,
|
|
172
|
-
*
|
|
173
|
-
* }],
|
|
173
|
+
* cancels: [
|
|
174
|
+
* { a: 0, o: 123 },
|
|
175
|
+
* ],
|
|
174
176
|
* });
|
|
175
177
|
* ```
|
|
176
178
|
*/
|
|
177
179
|
cancel(...[args, signal]: Parameters<ExchangeClient["cancel"]>): ReturnType<ExchangeClient["cancel"]>;
|
|
178
180
|
/**
|
|
181
|
+
* Cancel order(s) by cloid.
|
|
179
182
|
* @param args - The parameters for the request.
|
|
180
183
|
* @param signal - An optional abort signal.
|
|
181
184
|
* @returns Successful variant of {@link CancelResponse} without error statuses.
|
|
182
|
-
*
|
|
185
|
+
*
|
|
186
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
187
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
183
188
|
*
|
|
184
189
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
185
190
|
* @example
|
|
@@ -203,10 +208,13 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
203
208
|
*/
|
|
204
209
|
cancelByCloid(...[args, signal]: Parameters<ExchangeClient["cancelByCloid"]>): ReturnType<ExchangeClient["cancelByCloid"]>;
|
|
205
210
|
/**
|
|
211
|
+
* Transfer native token from the user's spot account into staking for delegating to validators.
|
|
206
212
|
* @param args - The parameters for the request.
|
|
207
213
|
* @param signal - An optional abort signal.
|
|
208
214
|
* @returns Successful response without specific data.
|
|
209
|
-
*
|
|
215
|
+
*
|
|
216
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
217
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
210
218
|
*
|
|
211
219
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-into-staking
|
|
212
220
|
* @example
|
|
@@ -221,17 +229,20 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
221
229
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
222
230
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
223
231
|
*
|
|
224
|
-
*
|
|
232
|
+
* await multiSignClient.cDeposit({ wei: 1 * 1e8 });
|
|
225
233
|
* ```
|
|
226
234
|
*/
|
|
227
235
|
cDeposit(...[args, signal]: Parameters<ExchangeClient["cDeposit"]>): ReturnType<ExchangeClient["cDeposit"]>;
|
|
228
236
|
/**
|
|
237
|
+
* Claim rewards from referral program.
|
|
229
238
|
* @param args - The parameters for the request.
|
|
230
239
|
* @param signal - An optional abort signal.
|
|
231
240
|
* @returns Successful response without specific data.
|
|
232
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
233
241
|
*
|
|
234
|
-
* @
|
|
242
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
243
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
244
|
+
*
|
|
245
|
+
* @see null
|
|
235
246
|
* @example
|
|
236
247
|
* ```ts
|
|
237
248
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -244,15 +255,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
244
255
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
245
256
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
246
257
|
*
|
|
247
|
-
*
|
|
258
|
+
* await multiSignClient.claimRewards();
|
|
248
259
|
* ```
|
|
249
260
|
*/
|
|
250
261
|
claimRewards(...[signal]: Parameters<ExchangeClient["claimRewards"]>): ReturnType<ExchangeClient["claimRewards"]>;
|
|
251
262
|
/**
|
|
263
|
+
* Convert a single-signature account to a multi-signature account or vice versa.
|
|
252
264
|
* @param args - The parameters for the request.
|
|
253
265
|
* @param signal - An optional abort signal.
|
|
254
266
|
* @returns Successful response without specific data.
|
|
255
|
-
*
|
|
267
|
+
*
|
|
268
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
269
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
256
270
|
*
|
|
257
271
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/multi-sig
|
|
258
272
|
* @example
|
|
@@ -267,20 +281,27 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
267
281
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
268
282
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
269
283
|
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
*
|
|
284
|
+
* // Convert to multi-sig user
|
|
285
|
+
* await multiSignClient.convertToMultiSigUser({
|
|
286
|
+
* authorizedUsers: ["0x...", "0x...", "0x..."],
|
|
287
|
+
* threshold: 2,
|
|
273
288
|
* });
|
|
289
|
+
*
|
|
290
|
+
* // Convert to single-sig user
|
|
291
|
+
* await multiSignClient.convertToMultiSigUser(null);
|
|
274
292
|
* ```
|
|
275
293
|
*/
|
|
276
294
|
convertToMultiSigUser(...[args, signal]: Parameters<ExchangeClient["convertToMultiSigUser"]>): ReturnType<ExchangeClient["convertToMultiSigUser"]>;
|
|
277
295
|
/**
|
|
296
|
+
* Create a sub-account.
|
|
278
297
|
* @param args - The parameters for the request.
|
|
279
298
|
* @param signal - An optional abort signal.
|
|
280
299
|
* @returns Response for creating a sub-account.
|
|
281
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
282
300
|
*
|
|
283
|
-
* @
|
|
301
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
302
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
303
|
+
*
|
|
304
|
+
* @see null
|
|
284
305
|
* @example
|
|
285
306
|
* ```ts
|
|
286
307
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -293,17 +314,20 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
293
314
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
294
315
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
295
316
|
*
|
|
296
|
-
* const data = await multiSignClient.createSubAccount({ name: "
|
|
317
|
+
* const data = await multiSignClient.createSubAccount({ name: "..." });
|
|
297
318
|
* ```
|
|
298
319
|
*/
|
|
299
320
|
createSubAccount(...[args, signal]: Parameters<ExchangeClient["createSubAccount"]>): ReturnType<ExchangeClient["createSubAccount"]>;
|
|
300
321
|
/**
|
|
322
|
+
* Create a vault.
|
|
301
323
|
* @param args - The parameters for the request.
|
|
302
324
|
* @param signal - An optional abort signal.
|
|
303
325
|
* @returns Response for creating a vault.
|
|
304
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
305
326
|
*
|
|
306
|
-
* @
|
|
327
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
328
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
329
|
+
*
|
|
330
|
+
* @see null
|
|
307
331
|
* @example
|
|
308
332
|
* ```ts
|
|
309
333
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -316,21 +340,20 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
316
340
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
317
341
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
318
342
|
*
|
|
319
|
-
* const data = await multiSignClient.createVault({
|
|
320
|
-
* name: "VaultName",
|
|
321
|
-
* description: "Vault description",
|
|
322
|
-
* initialUsd: 100 * 1e6,
|
|
323
|
-
* });
|
|
343
|
+
* const data = await multiSignClient.createVault({ name: "...", description: "...", initialUsd: 100 * 1e6 });
|
|
324
344
|
* ```
|
|
325
345
|
*/
|
|
326
346
|
createVault(...[args, signal]: Parameters<ExchangeClient["createVault"]>): ReturnType<ExchangeClient["createVault"]>;
|
|
327
347
|
/**
|
|
348
|
+
* Jail or unjail self as a validator signer.
|
|
328
349
|
* @param args - The parameters for the request.
|
|
329
350
|
* @param signal - An optional abort signal.
|
|
330
351
|
* @returns Successful response without specific data.
|
|
331
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
332
352
|
*
|
|
333
|
-
* @
|
|
353
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
354
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
355
|
+
*
|
|
356
|
+
* @see null
|
|
334
357
|
* @example
|
|
335
358
|
* ```ts
|
|
336
359
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -344,19 +367,21 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
344
367
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
345
368
|
*
|
|
346
369
|
* // Jail self
|
|
347
|
-
*
|
|
370
|
+
* await multiSignClient.cSignerAction({ jailSelf: null });
|
|
348
371
|
*
|
|
349
372
|
* // Unjail self
|
|
350
|
-
*
|
|
373
|
+
* await multiSignClient.cSignerAction({ unjailSelf: null });
|
|
351
374
|
* ```
|
|
352
375
|
*/
|
|
353
|
-
cSignerAction(args
|
|
354
|
-
cSignerAction(args: CSignerActionParameters_UnjailSelf, signal?: AbortSignal): ReturnType<ExchangeClient["cSignerAction"]>;
|
|
376
|
+
cSignerAction(...[args, signal]: Parameters<ExchangeClient["cSignerAction"]>): ReturnType<ExchangeClient["cSignerAction"]>;
|
|
355
377
|
/**
|
|
378
|
+
* Action related to validator management.
|
|
356
379
|
* @param args - The parameters for the request.
|
|
357
380
|
* @param signal - An optional abort signal.
|
|
358
381
|
* @returns Successful response without specific data.
|
|
359
|
-
*
|
|
382
|
+
*
|
|
383
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
384
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
360
385
|
*
|
|
361
386
|
* @example
|
|
362
387
|
* ```ts
|
|
@@ -371,23 +396,43 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
371
396
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
372
397
|
*
|
|
373
398
|
* // Change validator profile
|
|
374
|
-
*
|
|
399
|
+
* await multiSignClient.cValidatorAction({
|
|
375
400
|
* changeProfile: {
|
|
376
|
-
* name: "
|
|
377
|
-
* description: "
|
|
401
|
+
* name: "...",
|
|
402
|
+
* description: "...",
|
|
378
403
|
* unjailed: true,
|
|
379
404
|
* }
|
|
380
405
|
* });
|
|
406
|
+
*
|
|
407
|
+
* // Register a new validator
|
|
408
|
+
* await multiSignClient.cValidatorAction({
|
|
409
|
+
* register: {
|
|
410
|
+
* profile: {
|
|
411
|
+
* node_ip: { Ip: "1.2.3.4" },
|
|
412
|
+
* name: "...",
|
|
413
|
+
* description: "...",
|
|
414
|
+
* delegations_disabled: true,
|
|
415
|
+
* commission_bps: 1,
|
|
416
|
+
* signer: "0x...",
|
|
417
|
+
* },
|
|
418
|
+
* unjailed: false,
|
|
419
|
+
* initial_wei: 1,
|
|
420
|
+
* },
|
|
421
|
+
* });
|
|
422
|
+
*
|
|
423
|
+
* // Unregister a validator
|
|
424
|
+
* await multiSignClient.cValidatorAction({ unregister: null });
|
|
381
425
|
* ```
|
|
382
426
|
*/
|
|
383
|
-
cValidatorAction(args
|
|
384
|
-
cValidatorAction(args: CValidatorActionParameters_Register, signal?: AbortSignal): ReturnType<ExchangeClient["cSignerAction"]>;
|
|
385
|
-
cValidatorAction(args: CValidatorActionParameters_Unregister, signal?: AbortSignal): ReturnType<ExchangeClient["cSignerAction"]>;
|
|
427
|
+
cValidatorAction(...[args, signal]: Parameters<ExchangeClient["cValidatorAction"]>): ReturnType<ExchangeClient["cSignerAction"]>;
|
|
386
428
|
/**
|
|
429
|
+
* Transfer native token from staking into the user's spot account.
|
|
387
430
|
* @param args - The parameters for the request.
|
|
388
431
|
* @param signal - An optional abort signal.
|
|
389
432
|
* @returns Successful response without specific data.
|
|
390
|
-
*
|
|
433
|
+
*
|
|
434
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
435
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
391
436
|
*
|
|
392
437
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#withdraw-from-staking
|
|
393
438
|
* @example
|
|
@@ -402,15 +447,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
402
447
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
403
448
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
404
449
|
*
|
|
405
|
-
*
|
|
450
|
+
* await multiSignClient.cWithdraw({ wei: 1 * 1e8 });
|
|
406
451
|
* ```
|
|
407
452
|
*/
|
|
408
453
|
cWithdraw(...[args, signal]: Parameters<ExchangeClient["cWithdraw"]>): ReturnType<ExchangeClient["cWithdraw"]>;
|
|
409
454
|
/**
|
|
455
|
+
* Configure block type for EVM transactions.
|
|
410
456
|
* @param args - The parameters for the request.
|
|
411
457
|
* @param signal - An optional abort signal.
|
|
412
458
|
* @returns Response for creating a sub-account.
|
|
413
|
-
*
|
|
459
|
+
*
|
|
460
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
461
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
414
462
|
*
|
|
415
463
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/evm/dual-block-architecture
|
|
416
464
|
* @example
|
|
@@ -430,10 +478,13 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
430
478
|
*/
|
|
431
479
|
evmUserModify(...[args, signal]: Parameters<ExchangeClient["evmUserModify"]>): ReturnType<ExchangeClient["evmUserModify"]>;
|
|
432
480
|
/**
|
|
481
|
+
* Modify an order.
|
|
433
482
|
* @param args - The parameters for the request.
|
|
434
483
|
* @param signal - An optional abort signal.
|
|
435
484
|
* @returns Successful response without specific data.
|
|
436
|
-
*
|
|
485
|
+
*
|
|
486
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
487
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
437
488
|
*
|
|
438
489
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
|
|
439
490
|
* @example
|
|
@@ -448,20 +499,16 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
448
499
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
449
500
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
450
501
|
*
|
|
451
|
-
*
|
|
502
|
+
* await multiSignClient.modify({
|
|
452
503
|
* oid: 123,
|
|
453
504
|
* order: {
|
|
454
|
-
* a: 0,
|
|
455
|
-
* b: true,
|
|
456
|
-
* p: "31000",
|
|
457
|
-
* s: "0.2",
|
|
458
|
-
* r: false,
|
|
459
|
-
* t: {
|
|
460
|
-
*
|
|
461
|
-
* tif: "Gtc", // Good-til-cancelled
|
|
462
|
-
* },
|
|
463
|
-
* },
|
|
464
|
-
* c: "0x...", // Client Order ID (optional)
|
|
505
|
+
* a: 0,
|
|
506
|
+
* b: true,
|
|
507
|
+
* p: "31000",
|
|
508
|
+
* s: "0.2",
|
|
509
|
+
* r: false,
|
|
510
|
+
* t: { limit: { tif: "Gtc" } },
|
|
511
|
+
* c: "0x...",
|
|
465
512
|
* },
|
|
466
513
|
* });
|
|
467
514
|
* ```
|
|
@@ -472,10 +519,13 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
472
519
|
*/
|
|
473
520
|
multiSig<T extends SuccessResponse | CancelResponseSuccess | CreateSubAccountResponse | CreateVaultResponse | OrderResponseSuccess | TwapOrderResponseSuccess | TwapCancelResponseSuccess>(...[_args, _signal]: Parameters<ExchangeClient["multiSig"]>): Promise<T>;
|
|
474
521
|
/**
|
|
522
|
+
* Place an order(s).
|
|
475
523
|
* @param args - The parameters for the request.
|
|
476
524
|
* @param signal - An optional abort signal.
|
|
477
525
|
* @returns Successful variant of {@link OrderResponse} without error statuses.
|
|
478
|
-
*
|
|
526
|
+
*
|
|
527
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
528
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
479
529
|
*
|
|
480
530
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
|
|
481
531
|
* @example
|
|
@@ -491,29 +541,30 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
491
541
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
492
542
|
*
|
|
493
543
|
* const data = await multiSignClient.order({
|
|
494
|
-
* orders: [
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
* limit: {
|
|
502
|
-
*
|
|
503
|
-
* },
|
|
544
|
+
* orders: [
|
|
545
|
+
* {
|
|
546
|
+
* a: 0,
|
|
547
|
+
* b: true,
|
|
548
|
+
* p: "30000",
|
|
549
|
+
* s: "0.1",
|
|
550
|
+
* r: false,
|
|
551
|
+
* t: { limit: { tif: "Gtc" } },
|
|
552
|
+
* c: "0x...",
|
|
504
553
|
* },
|
|
505
|
-
*
|
|
506
|
-
*
|
|
507
|
-
* grouping: "na", // No grouping
|
|
554
|
+
* ],
|
|
555
|
+
* grouping: "na",
|
|
508
556
|
* });
|
|
509
557
|
* ```
|
|
510
558
|
*/
|
|
511
559
|
order(...[args, signal]: Parameters<ExchangeClient["order"]>): ReturnType<ExchangeClient["order"]>;
|
|
512
560
|
/**
|
|
561
|
+
* Deploying HIP-3 assets.
|
|
513
562
|
* @param args - The parameters for the request.
|
|
514
563
|
* @param signal - An optional abort signal.
|
|
515
564
|
* @returns Successful response without specific data.
|
|
516
|
-
*
|
|
565
|
+
*
|
|
566
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
567
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
517
568
|
*
|
|
518
569
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-3-assets
|
|
519
570
|
* @example
|
|
@@ -528,7 +579,7 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
528
579
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
529
580
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
530
581
|
*
|
|
531
|
-
*
|
|
582
|
+
* await multiSignClient.perpDeploy({
|
|
532
583
|
* registerAsset: {
|
|
533
584
|
* maxGas: 1000000,
|
|
534
585
|
* assetRequest: {
|
|
@@ -543,13 +594,15 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
543
594
|
* });
|
|
544
595
|
* ```
|
|
545
596
|
*/
|
|
546
|
-
perpDeploy(args
|
|
547
|
-
perpDeploy(args: PerpDeployParameters_SetOracle, signal?: AbortSignal): ReturnType<ExchangeClient["perpDeploy"]>;
|
|
597
|
+
perpDeploy(...[args, signal]: Parameters<ExchangeClient["perpDeploy"]>): ReturnType<ExchangeClient["perpDeploy"]>;
|
|
548
598
|
/**
|
|
599
|
+
* Transfer funds between Spot account and Perp dex account.
|
|
549
600
|
* @param args - The parameters for the request.
|
|
550
601
|
* @param signal - An optional abort signal.
|
|
551
602
|
* @returns Successful response without specific data.
|
|
552
|
-
*
|
|
603
|
+
*
|
|
604
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
605
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
553
606
|
*
|
|
554
607
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#transfer-from-spot-account-to-perp-account-and-vice-versa
|
|
555
608
|
* @example
|
|
@@ -564,22 +617,20 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
564
617
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
565
618
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
566
619
|
*
|
|
567
|
-
*
|
|
568
|
-
* dex: "test",
|
|
569
|
-
* token: "USDC",
|
|
570
|
-
* amount: "1",
|
|
571
|
-
* toPerp: true,
|
|
572
|
-
* });
|
|
620
|
+
* await multiSignClient.perpDexClassTransfer({ dex: "test", token: "USDC", amount: "1", toPerp: true });
|
|
573
621
|
* ```
|
|
574
622
|
*/
|
|
575
623
|
perpDexClassTransfer(...[args, signal]: Parameters<ExchangeClient["perpDexClassTransfer"]>): ReturnType<ExchangeClient["perpDexClassTransfer"]>;
|
|
576
624
|
/**
|
|
625
|
+
* Create a referral code.
|
|
577
626
|
* @param args - The parameters for the request.
|
|
578
627
|
* @param signal - An optional abort signal.
|
|
579
628
|
* @returns Successful response without specific data.
|
|
580
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
581
629
|
*
|
|
582
|
-
* @
|
|
630
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
631
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
632
|
+
*
|
|
633
|
+
* @see null
|
|
583
634
|
* @example
|
|
584
635
|
* ```ts
|
|
585
636
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -592,15 +643,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
592
643
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
593
644
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
594
645
|
*
|
|
595
|
-
*
|
|
646
|
+
* await multiSignClient.registerReferrer({ code: "..." });
|
|
596
647
|
* ```
|
|
597
648
|
*/
|
|
598
649
|
registerReferrer(...[args, signal]: Parameters<ExchangeClient["registerReferrer"]>): ReturnType<ExchangeClient["registerReferrer"]>;
|
|
599
650
|
/**
|
|
651
|
+
* Reserve additional rate-limited actions for a fee.
|
|
600
652
|
* @param args - The parameters for the request.
|
|
601
653
|
* @param signal - An optional abort signal.
|
|
602
654
|
* @returns Successful response without specific data.
|
|
603
|
-
*
|
|
655
|
+
*
|
|
656
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
657
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
604
658
|
*
|
|
605
659
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#reserve-additional-actions
|
|
606
660
|
* @example
|
|
@@ -615,15 +669,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
615
669
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
616
670
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
617
671
|
*
|
|
618
|
-
*
|
|
672
|
+
* await multiSignClient.reserveRequestWeight({ weight: 10 });
|
|
619
673
|
* ```
|
|
620
674
|
*/
|
|
621
675
|
reserveRequestWeight(...[args, signal]: Parameters<ExchangeClient["reserveRequestWeight"]>): ReturnType<ExchangeClient["reserveRequestWeight"]>;
|
|
622
676
|
/**
|
|
677
|
+
* Schedule a cancel-all operation at a future time.
|
|
623
678
|
* @param args - The parameters for the request.
|
|
624
679
|
* @param signal - An optional abort signal.
|
|
625
680
|
* @returns Successful response without specific data.
|
|
626
|
-
*
|
|
681
|
+
*
|
|
682
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
683
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
627
684
|
*
|
|
628
685
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#schedule-cancel-dead-mans-switch
|
|
629
686
|
* @example
|
|
@@ -638,18 +695,21 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
638
695
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
639
696
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
640
697
|
*
|
|
641
|
-
*
|
|
698
|
+
* await multiSignClient.scheduleCancel({ time: Date.now() + 10_000 });
|
|
642
699
|
* ```
|
|
643
700
|
*/
|
|
644
701
|
scheduleCancel(args?: ScheduleCancelParameters, signal?: AbortSignal): ReturnType<ExchangeClient["scheduleCancel"]>;
|
|
645
702
|
scheduleCancel(signal?: AbortSignal): ReturnType<ExchangeClient["scheduleCancel"]>;
|
|
646
703
|
/**
|
|
704
|
+
* Set the display name in the leaderboard.
|
|
647
705
|
* @param args - The parameters for the request.
|
|
648
706
|
* @param signal - An optional abort signal.
|
|
649
707
|
* @returns Successful response without specific data.
|
|
650
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
651
708
|
*
|
|
652
|
-
* @
|
|
709
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
710
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
711
|
+
*
|
|
712
|
+
* @see null
|
|
653
713
|
* @example
|
|
654
714
|
* ```ts
|
|
655
715
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -662,17 +722,20 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
662
722
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
663
723
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
664
724
|
*
|
|
665
|
-
*
|
|
725
|
+
* await multiSignClient.setDisplayName({ displayName: "..." });
|
|
666
726
|
* ```
|
|
667
727
|
*/
|
|
668
728
|
setDisplayName(...[args, signal]: Parameters<ExchangeClient["setDisplayName"]>): ReturnType<ExchangeClient["setDisplayName"]>;
|
|
669
729
|
/**
|
|
730
|
+
* Set a referral code.
|
|
670
731
|
* @param args - The parameters for the request.
|
|
671
732
|
* @param signal - An optional abort signal.
|
|
672
733
|
* @returns Successful response without specific data.
|
|
673
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
674
734
|
*
|
|
675
|
-
* @
|
|
735
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
736
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
737
|
+
*
|
|
738
|
+
* @see null
|
|
676
739
|
* @example
|
|
677
740
|
* ```ts
|
|
678
741
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -685,15 +748,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
685
748
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
686
749
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
687
750
|
*
|
|
688
|
-
*
|
|
751
|
+
* await multiSignClient.setReferrer({ code: "..." });
|
|
689
752
|
* ```
|
|
690
753
|
*/
|
|
691
754
|
setReferrer(...[args, signal]: Parameters<ExchangeClient["setReferrer"]>): ReturnType<ExchangeClient["setReferrer"]>;
|
|
692
755
|
/**
|
|
756
|
+
* Deploying HIP-1 and HIP-2 assets.
|
|
693
757
|
* @param args - The parameters for the request.
|
|
694
758
|
* @param signal - An optional abort signal.
|
|
695
759
|
* @returns Successful response without specific data.
|
|
696
|
-
*
|
|
760
|
+
*
|
|
761
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
762
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
697
763
|
*
|
|
698
764
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-1-and-hip-2-assets
|
|
699
765
|
* @example
|
|
@@ -708,7 +774,7 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
708
774
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
709
775
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
710
776
|
*
|
|
711
|
-
*
|
|
777
|
+
* await multiSignClient.spotDeploy({
|
|
712
778
|
* registerToken2: {
|
|
713
779
|
* spec: {
|
|
714
780
|
* name: "USDC",
|
|
@@ -721,17 +787,15 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
721
787
|
* });
|
|
722
788
|
* ```
|
|
723
789
|
*/
|
|
724
|
-
spotDeploy(args
|
|
725
|
-
spotDeploy(args: SpotDeployParameters_RegisterHyperliquidity, signal?: AbortSignal): ReturnType<ExchangeClient["spotDeploy"]>;
|
|
726
|
-
spotDeploy(args: SpotDeployParameters_RegisterSpot, signal?: AbortSignal): ReturnType<ExchangeClient["spotDeploy"]>;
|
|
727
|
-
spotDeploy(args: SpotDeployParameters_RegisterToken2, signal?: AbortSignal): ReturnType<ExchangeClient["spotDeploy"]>;
|
|
728
|
-
spotDeploy(args: SpotDeployParameters_SetDeployerTradingFeeShare, signal?: AbortSignal): ReturnType<ExchangeClient["spotDeploy"]>;
|
|
729
|
-
spotDeploy(args: SpotDeployParameters_UserGenesis, signal?: AbortSignal): ReturnType<ExchangeClient["spotDeploy"]>;
|
|
790
|
+
spotDeploy(...[args, signal]: Parameters<ExchangeClient["spotDeploy"]>): ReturnType<ExchangeClient["spotDeploy"]>;
|
|
730
791
|
/**
|
|
792
|
+
* Send spot assets to another address.
|
|
731
793
|
* @param args - The parameters for the request.
|
|
732
794
|
* @param signal - An optional abort signal.
|
|
733
795
|
* @returns Successful response without specific data.
|
|
734
|
-
*
|
|
796
|
+
*
|
|
797
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
798
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
735
799
|
*
|
|
736
800
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-spot-transfer
|
|
737
801
|
* @example
|
|
@@ -746,7 +810,7 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
746
810
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
747
811
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
748
812
|
*
|
|
749
|
-
*
|
|
813
|
+
* await multiSignClient.spotSend({
|
|
750
814
|
* destination: "0x...",
|
|
751
815
|
* token: "USDC:0xeb62eee3685fc4c43992febcd9e75443",
|
|
752
816
|
* amount: "1",
|
|
@@ -755,12 +819,15 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
755
819
|
*/
|
|
756
820
|
spotSend(...[args, signal]: Parameters<ExchangeClient["spotSend"]>): ReturnType<ExchangeClient["spotSend"]>;
|
|
757
821
|
/**
|
|
822
|
+
* Opt Out of Spot Dusting.
|
|
758
823
|
* @param args - The parameters for the request.
|
|
759
824
|
* @param signal - An optional abort signal.
|
|
760
825
|
* @returns Successful response without specific data.
|
|
761
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
762
826
|
*
|
|
763
|
-
* @
|
|
827
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
828
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
829
|
+
*
|
|
830
|
+
* @see null
|
|
764
831
|
* @example
|
|
765
832
|
* ```ts
|
|
766
833
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -773,17 +840,20 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
773
840
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
774
841
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
775
842
|
*
|
|
776
|
-
*
|
|
843
|
+
* await multiSignClient.spotUser({ toggleSpotDusting: { optOut: false } });
|
|
777
844
|
* ```
|
|
778
845
|
*/
|
|
779
846
|
spotUser(...[args, signal]: Parameters<ExchangeClient["spotUser"]>): ReturnType<ExchangeClient["spotUser"]>;
|
|
780
847
|
/**
|
|
848
|
+
* Transfer between sub-accounts (spot).
|
|
781
849
|
* @param args - The parameters for the request.
|
|
782
850
|
* @param signal - An optional abort signal.
|
|
783
851
|
* @returns Successful response without specific data.
|
|
784
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
785
852
|
*
|
|
786
|
-
* @
|
|
853
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
854
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
855
|
+
*
|
|
856
|
+
* @see null
|
|
787
857
|
* @example
|
|
788
858
|
* ```ts
|
|
789
859
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -796,7 +866,7 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
796
866
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
797
867
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
798
868
|
*
|
|
799
|
-
*
|
|
869
|
+
* await multiSignClient.subAccountSpotTransfer({
|
|
800
870
|
* subAccountUser: "0x...",
|
|
801
871
|
* isDeposit: true,
|
|
802
872
|
* token: "USDC:0xeb62eee3685fc4c43992febcd9e75443",
|
|
@@ -806,12 +876,15 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
806
876
|
*/
|
|
807
877
|
subAccountSpotTransfer(...[args, signal]: Parameters<ExchangeClient["subAccountSpotTransfer"]>): ReturnType<ExchangeClient["subAccountSpotTransfer"]>;
|
|
808
878
|
/**
|
|
879
|
+
* Transfer between sub-accounts (perpetual).
|
|
809
880
|
* @param args - The parameters for the request.
|
|
810
881
|
* @param signal - An optional abort signal.
|
|
811
882
|
* @returns Successful response without specific data.
|
|
812
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
813
883
|
*
|
|
814
|
-
* @
|
|
884
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
885
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
886
|
+
*
|
|
887
|
+
* @see null
|
|
815
888
|
* @example
|
|
816
889
|
* ```ts
|
|
817
890
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -824,19 +897,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
824
897
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
825
898
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
826
899
|
*
|
|
827
|
-
*
|
|
828
|
-
* subAccountUser: "0x...",
|
|
829
|
-
* isDeposit: true,
|
|
830
|
-
* usd: 1 * 1e6,
|
|
831
|
-
* });
|
|
900
|
+
* await multiSignClient.subAccountTransfer({ subAccountUser: "0x...", isDeposit: true, usd: 1 * 1e6 });
|
|
832
901
|
* ```
|
|
833
902
|
*/
|
|
834
903
|
subAccountTransfer(...[args, signal]: Parameters<ExchangeClient["subAccountTransfer"]>): ReturnType<ExchangeClient["subAccountTransfer"]>;
|
|
835
904
|
/**
|
|
905
|
+
* Delegate or undelegate native tokens to or from a validator.
|
|
836
906
|
* @param args - The parameters for the request.
|
|
837
907
|
* @param signal - An optional abort signal.
|
|
838
908
|
* @returns Successful response without specific data.
|
|
839
|
-
*
|
|
909
|
+
*
|
|
910
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
911
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
840
912
|
*
|
|
841
913
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#delegate-or-undelegate-stake-from-validator
|
|
842
914
|
* @example
|
|
@@ -851,19 +923,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
851
923
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
852
924
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
853
925
|
*
|
|
854
|
-
*
|
|
855
|
-
* validator: "0x...",
|
|
856
|
-
* isUndelegate: true,
|
|
857
|
-
* wei: 1 * 1e8,
|
|
858
|
-
* });
|
|
926
|
+
* await multiSignClient.tokenDelegate({ validator: "0x...", isUndelegate: true, wei: 1 * 1e8 });
|
|
859
927
|
* ```
|
|
860
928
|
*/
|
|
861
929
|
tokenDelegate(...[args, signal]: Parameters<ExchangeClient["tokenDelegate"]>): ReturnType<ExchangeClient["tokenDelegate"]>;
|
|
862
930
|
/**
|
|
931
|
+
* Cancel a TWAP order.
|
|
863
932
|
* @param args - The parameters for the request.
|
|
864
933
|
* @param signal - An optional abort signal.
|
|
865
934
|
* @returns Successful variant of {@link TwapCancelResponse} without error status.
|
|
866
|
-
*
|
|
935
|
+
*
|
|
936
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
937
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
867
938
|
*
|
|
868
939
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-a-twap-order
|
|
869
940
|
* @example
|
|
@@ -878,18 +949,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
878
949
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
879
950
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
880
951
|
*
|
|
881
|
-
* const data = await multiSignClient.twapCancel({
|
|
882
|
-
* a: 0, // Asset index
|
|
883
|
-
* t: 1, // TWAP ID
|
|
884
|
-
* });
|
|
952
|
+
* const data = await multiSignClient.twapCancel({ a: 0, t: 1 });
|
|
885
953
|
* ```
|
|
886
954
|
*/
|
|
887
955
|
twapCancel(...[args, signal]: Parameters<ExchangeClient["twapCancel"]>): ReturnType<ExchangeClient["twapCancel"]>;
|
|
888
956
|
/**
|
|
957
|
+
* Place a TWAP order.
|
|
889
958
|
* @param args - The parameters for the request.
|
|
890
959
|
* @param signal - An optional abort signal.
|
|
891
960
|
* @returns Successful variant of {@link TwapOrderResponse} without error status.
|
|
892
|
-
*
|
|
961
|
+
*
|
|
962
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
963
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
893
964
|
*
|
|
894
965
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-a-twap-order
|
|
895
966
|
* @example
|
|
@@ -905,21 +976,24 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
905
976
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
906
977
|
*
|
|
907
978
|
* const data = await multiSignClient.twapOrder({
|
|
908
|
-
* a: 0,
|
|
909
|
-
* b: true,
|
|
910
|
-
* s: "1",
|
|
911
|
-
* r: false,
|
|
912
|
-
* m: 10,
|
|
913
|
-
* t: true,
|
|
979
|
+
* a: 0,
|
|
980
|
+
* b: true,
|
|
981
|
+
* s: "1",
|
|
982
|
+
* r: false,
|
|
983
|
+
* m: 10,
|
|
984
|
+
* t: true,
|
|
914
985
|
* });
|
|
915
986
|
* ```
|
|
916
987
|
*/
|
|
917
988
|
twapOrder(...[args, signal]: Parameters<ExchangeClient["twapOrder"]>): ReturnType<ExchangeClient["twapOrder"]>;
|
|
918
989
|
/**
|
|
990
|
+
* Add or remove margin from isolated position.
|
|
919
991
|
* @param args - The parameters for the request.
|
|
920
992
|
* @param signal - An optional abort signal.
|
|
921
993
|
* @returns Successful response without specific data.
|
|
922
|
-
*
|
|
994
|
+
*
|
|
995
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
996
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
923
997
|
*
|
|
924
998
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
|
|
925
999
|
* @example
|
|
@@ -934,19 +1008,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
934
1008
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
935
1009
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
936
1010
|
*
|
|
937
|
-
*
|
|
938
|
-
* asset: 0,
|
|
939
|
-
* isBuy: true,
|
|
940
|
-
* ntli: 1 * 1e6,
|
|
941
|
-
* });
|
|
1011
|
+
* await multiSignClient.updateIsolatedMargin({ asset: 0, isBuy: true, ntli: 1 * 1e6 });
|
|
942
1012
|
* ```
|
|
943
1013
|
*/
|
|
944
1014
|
updateIsolatedMargin(...[args, signal]: Parameters<ExchangeClient["updateIsolatedMargin"]>): ReturnType<ExchangeClient["updateIsolatedMargin"]>;
|
|
945
1015
|
/**
|
|
1016
|
+
* Update cross or isolated leverage on a coin.
|
|
946
1017
|
* @param args - The parameters for the request.
|
|
947
1018
|
* @param signal - An optional abort signal.
|
|
948
1019
|
* @returns Successful response without specific data.
|
|
949
|
-
*
|
|
1020
|
+
*
|
|
1021
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
1022
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
950
1023
|
*
|
|
951
1024
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-leverage
|
|
952
1025
|
* @example
|
|
@@ -961,19 +1034,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
961
1034
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
962
1035
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
963
1036
|
*
|
|
964
|
-
*
|
|
965
|
-
* asset: 0,
|
|
966
|
-
* isCross: true,
|
|
967
|
-
* leverage: 5,
|
|
968
|
-
* });
|
|
1037
|
+
* await multiSignClient.updateLeverage({ asset: 0, isCross: true, leverage: 5 });
|
|
969
1038
|
* ```
|
|
970
1039
|
*/
|
|
971
1040
|
updateLeverage(...[args, signal]: Parameters<ExchangeClient["updateLeverage"]>): ReturnType<ExchangeClient["updateLeverage"]>;
|
|
972
1041
|
/**
|
|
1042
|
+
* Transfer funds between Spot account and Perp account.
|
|
973
1043
|
* @param args - The parameters for the request.
|
|
974
1044
|
* @param signal - An optional abort signal.
|
|
975
1045
|
* @returns Successful response without specific data.
|
|
976
|
-
*
|
|
1046
|
+
*
|
|
1047
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
1048
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
977
1049
|
*
|
|
978
1050
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#transfer-from-spot-account-to-perp-account-and-vice-versa
|
|
979
1051
|
* @example
|
|
@@ -988,15 +1060,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
988
1060
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
989
1061
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
990
1062
|
*
|
|
991
|
-
*
|
|
1063
|
+
* await multiSignClient.usdClassTransfer({ amount: "1", toPerp: true });
|
|
992
1064
|
* ```
|
|
993
1065
|
*/
|
|
994
1066
|
usdClassTransfer(...[args, signal]: Parameters<ExchangeClient["usdClassTransfer"]>): ReturnType<ExchangeClient["usdClassTransfer"]>;
|
|
995
1067
|
/**
|
|
1068
|
+
* Send usd to another address.
|
|
996
1069
|
* @param args - The parameters for the request.
|
|
997
1070
|
* @param signal - An optional abort signal.
|
|
998
1071
|
* @returns Successful response without specific data.
|
|
999
|
-
*
|
|
1072
|
+
*
|
|
1073
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
1074
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
1000
1075
|
*
|
|
1001
1076
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-usdc-transfer
|
|
1002
1077
|
* @example
|
|
@@ -1011,17 +1086,20 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
1011
1086
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1012
1087
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
1013
1088
|
*
|
|
1014
|
-
*
|
|
1089
|
+
* await multiSignClient.usdSend({ destination: "0x...", amount: "1" });
|
|
1015
1090
|
* ```
|
|
1016
1091
|
*/
|
|
1017
1092
|
usdSend(...[args, signal]: Parameters<ExchangeClient["usdSend"]>): ReturnType<ExchangeClient["usdSend"]>;
|
|
1018
1093
|
/**
|
|
1094
|
+
* Distribute funds from a vault between followers.
|
|
1019
1095
|
* @param args - The parameters for the request.
|
|
1020
1096
|
* @param signal - An optional abort signal.
|
|
1021
1097
|
* @returns Successful response without specific data.
|
|
1022
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
1023
1098
|
*
|
|
1024
|
-
* @
|
|
1099
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
1100
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
1101
|
+
*
|
|
1102
|
+
* @see null
|
|
1025
1103
|
* @example
|
|
1026
1104
|
* ```ts
|
|
1027
1105
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -1034,17 +1112,20 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
1034
1112
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1035
1113
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
1036
1114
|
*
|
|
1037
|
-
*
|
|
1115
|
+
* await multiSignClient.vaultDistribute({ vaultAddress: "0x...", usd: 10 * 1e6 });
|
|
1038
1116
|
* ```
|
|
1039
1117
|
*/
|
|
1040
1118
|
vaultDistribute(...[args, signal]: Parameters<ExchangeClient["vaultDistribute"]>): ReturnType<ExchangeClient["vaultDistribute"]>;
|
|
1041
1119
|
/**
|
|
1120
|
+
* Modify a vault's configuration.
|
|
1042
1121
|
* @param args - The parameters for the request.
|
|
1043
1122
|
* @param signal - An optional abort signal.
|
|
1044
1123
|
* @returns Successful response without specific data.
|
|
1045
|
-
* @throws {ApiRequestError} When the API returns an error response.
|
|
1046
1124
|
*
|
|
1047
|
-
* @
|
|
1125
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
1126
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
1127
|
+
*
|
|
1128
|
+
* @see null
|
|
1048
1129
|
* @example
|
|
1049
1130
|
* ```ts
|
|
1050
1131
|
* import * as hl from "@nktkas/hyperliquid";
|
|
@@ -1057,7 +1138,7 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
1057
1138
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1058
1139
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
1059
1140
|
*
|
|
1060
|
-
*
|
|
1141
|
+
* await multiSignClient.vaultModify({
|
|
1061
1142
|
* vaultAddress: "0x...",
|
|
1062
1143
|
* allowDeposits: true,
|
|
1063
1144
|
* alwaysCloseOnWithdraw: false,
|
|
@@ -1066,10 +1147,13 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
1066
1147
|
*/
|
|
1067
1148
|
vaultModify(...[args, signal]: Parameters<ExchangeClient["vaultModify"]>): ReturnType<ExchangeClient["vaultModify"]>;
|
|
1068
1149
|
/**
|
|
1150
|
+
* Deposit or withdraw from a vault.
|
|
1069
1151
|
* @param args - The parameters for the request.
|
|
1070
1152
|
* @param signal - An optional abort signal.
|
|
1071
1153
|
* @returns Successful response without specific data.
|
|
1072
|
-
*
|
|
1154
|
+
*
|
|
1155
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
1156
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
1073
1157
|
*
|
|
1074
1158
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault
|
|
1075
1159
|
* @example
|
|
@@ -1084,19 +1168,18 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
1084
1168
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1085
1169
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
1086
1170
|
*
|
|
1087
|
-
*
|
|
1088
|
-
* vaultAddress: "0x...",
|
|
1089
|
-
* isDeposit: true,
|
|
1090
|
-
* usd: 10 * 1e6,
|
|
1091
|
-
* });
|
|
1171
|
+
* await multiSignClient.vaultTransfer({ vaultAddress: "0x...", isDeposit: true, usd: 10 * 1e6 });
|
|
1092
1172
|
* ```
|
|
1093
1173
|
*/
|
|
1094
1174
|
vaultTransfer(...[args, signal]: Parameters<ExchangeClient["vaultTransfer"]>): ReturnType<ExchangeClient["vaultTransfer"]>;
|
|
1095
1175
|
/**
|
|
1176
|
+
* Initiate a withdrawal request.
|
|
1096
1177
|
* @param args - The parameters for the request.
|
|
1097
1178
|
* @param signal - An optional abort signal.
|
|
1098
1179
|
* @returns Successful response without specific data.
|
|
1099
|
-
*
|
|
1180
|
+
*
|
|
1181
|
+
* @throws {ApiRequestError} When the API returns an unsuccessful response.
|
|
1182
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
1100
1183
|
*
|
|
1101
1184
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
|
|
1102
1185
|
* @example
|
|
@@ -1111,30 +1194,28 @@ export declare class MultiSignClient<T extends IRequestTransport = IRequestTrans
|
|
|
1111
1194
|
* const transport = new hl.HttpTransport(); // or `WebSocketTransport`
|
|
1112
1195
|
* const multiSignClient = new hl.MultiSignClient({ transport, multiSignAddress, signers });
|
|
1113
1196
|
*
|
|
1114
|
-
*
|
|
1197
|
+
* await multiSignClient.withdraw3({ destination: "0x...", amount: "1" });
|
|
1115
1198
|
* ```
|
|
1116
1199
|
*/
|
|
1117
1200
|
withdraw3(...[args, signal]: Parameters<ExchangeClient["withdraw3"]>): ReturnType<ExchangeClient["withdraw3"]>;
|
|
1118
1201
|
/** Extracts the wallet address from different wallet types. */
|
|
1119
|
-
protected _getWalletAddress(wallet: AbstractWalletWithAddress): Promise
|
|
1202
|
+
protected _getWalletAddress(wallet: AbstractWalletWithAddress): Promise<Hex>;
|
|
1120
1203
|
/** Signs L1 action with all signers for multi-signature operations. */
|
|
1121
1204
|
protected _multiSignL1Action(args: {
|
|
1122
|
-
action:
|
|
1205
|
+
action: Record<string, unknown>;
|
|
1123
1206
|
nonce: number;
|
|
1124
1207
|
outerSigner: Hex;
|
|
1125
1208
|
vaultAddress?: Hex;
|
|
1126
1209
|
expiresAfter?: number;
|
|
1127
1210
|
}): Promise<Signature[]>;
|
|
1128
1211
|
/** Signs user-signed action with all signers for multi-signature operations. */
|
|
1129
|
-
protected _multiSignUserSignedAction(
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
}
|
|
1136
|
-
time: number;
|
|
1137
|
-
nonce?: undefined;
|
|
1138
|
-
}), outerSigner: Hex): Promise<Signature[]>;
|
|
1212
|
+
protected _multiSignUserSignedAction(args: {
|
|
1213
|
+
action: Record<string, unknown> & {
|
|
1214
|
+
type: keyof typeof userSignedActionEip712Types;
|
|
1215
|
+
signatureChainId: Hex;
|
|
1216
|
+
};
|
|
1217
|
+
outerSigner: Hex;
|
|
1218
|
+
}): Promise<Signature[]>;
|
|
1139
1219
|
}
|
|
1220
|
+
export {};
|
|
1140
1221
|
//# sourceMappingURL=multiSign.d.ts.map
|