@nktkas/hyperliquid 0.22.2 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -49
- 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 +137 -41
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +124 -28
- 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/delegations.d.ts +1 -1
- package/esm/src/types/info/delegations.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 +49 -96
- package/esm/src/types/info/requests.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.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 +137 -41
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +1296 -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/delegations.d.ts +1 -1
- package/script/src/types/info/delegations.d.ts.map +1 -1
- package/script/src/types/info/delegations.js +2 -12
- 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 +49 -96
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/info/requests.js +2 -12
- package/script/src/types/info/vaults.js +2 -12
- 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/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/esm/src/signing/{_ethers.js → _signTypedData/ethers.js} +0 -0
- /package/esm/src/signing/{_viem.js → _signTypedData/viem.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Hex } from "
|
|
1
|
+
import type { Hex } from "../../base.js";
|
|
2
2
|
/** Abstract interface for a [window.ethereum](https://eips.ethereum.org/EIPS/eip-1193) object. */
|
|
3
3
|
export interface AbstractWindowEthereum {
|
|
4
4
|
request(args: {
|
|
@@ -7,17 +7,23 @@ export interface AbstractWindowEthereum {
|
|
|
7
7
|
}): Promise<any>;
|
|
8
8
|
}
|
|
9
9
|
/** Signs typed data using `window.ethereum` (EIP-1193) with `eth_signTypedData_v4` (EIP-712). */
|
|
10
|
-
export declare function signTypedDataWithWindowEthereum(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
chainId: number;
|
|
14
|
-
verifyingContract: Hex;
|
|
15
|
-
}, types: {
|
|
16
|
-
[key: string]: {
|
|
10
|
+
export declare function signTypedDataWithWindowEthereum(args: {
|
|
11
|
+
ethereum: AbstractWindowEthereum;
|
|
12
|
+
domain: {
|
|
17
13
|
name: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
version: string;
|
|
15
|
+
chainId: number;
|
|
16
|
+
verifyingContract: Hex;
|
|
17
|
+
};
|
|
18
|
+
types: {
|
|
19
|
+
[key: string]: {
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
primaryType: string;
|
|
25
|
+
message: Record<string, unknown>;
|
|
26
|
+
}): Promise<Hex>;
|
|
21
27
|
/** Checks if the given value is an abstract `window.ethereum` object. */
|
|
22
28
|
export declare function isAbstractWindowEthereum(client: unknown): client is AbstractWindowEthereum;
|
|
23
|
-
//# sourceMappingURL=
|
|
29
|
+
//# sourceMappingURL=window.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../../src/src/signing/_signTypedData/window.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,kGAAkG;AAClG,MAAM,WAAW,sBAAsB;IAEnC,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,MAAM,EAAE,GAAG,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAC7D;AAED,iGAAiG;AACjG,wBAAsB,+BAA+B,CAAC,IAAI,EAAE;IACxD,QAAQ,EAAE,sBAAsB,CAAC;IACjC,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,GAAG,CAAC;KAC1B,CAAC;IACF,KAAK,EAAE;QACH,CAAC,GAAG,EAAE,MAAM,GAAG;YACX,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SAChB,EAAE,CAAC;KACP,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,GAAG,CAAC,CAwBf;AAED,yEAAyE;AACzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,sBAAsB,CAI1F"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Signs typed data using `window.ethereum` (EIP-1193) with `eth_signTypedData_v4` (EIP-712). */
|
|
2
|
-
export async function signTypedDataWithWindowEthereum(
|
|
2
|
+
export async function signTypedDataWithWindowEthereum(args) {
|
|
3
|
+
const { ethereum, domain, types, primaryType, message } = args;
|
|
3
4
|
const accounts = await ethereum.request({ method: "eth_requestAccounts", params: [] });
|
|
4
5
|
if (!Array.isArray(accounts) || accounts.length === 0) {
|
|
5
6
|
throw new Error("No Ethereum accounts available");
|
|
@@ -16,7 +17,7 @@ export async function signTypedDataWithWindowEthereum(ethereum, domain, types, m
|
|
|
16
17
|
],
|
|
17
18
|
...types,
|
|
18
19
|
},
|
|
19
|
-
primaryType
|
|
20
|
+
primaryType,
|
|
20
21
|
message,
|
|
21
22
|
});
|
|
22
23
|
return await ethereum.request({ method: "eth_signTypedData_v4", params: [from, dataToSign] });
|
|
@@ -1,86 +1,48 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { DeepImmutable } from "../base.js";
|
|
2
|
+
import type { ApproveAgentRequest, ApproveBuilderFeeRequest, BatchModifyRequest, CancelByCloidRequest, CancelRequest, CDepositRequest, ClaimRewardsRequest, ConvertToMultiSigUserRequest, CreateSubAccountRequest, CreateVaultRequest, CSignerActionRequest_JailSelf, CSignerActionRequest_UnjailSelf, CValidatorActionRequest_ChangeProfile, CValidatorActionRequest_Register, CValidatorActionRequest_Unregister, CWithdrawRequest, EvmUserModifyRequest, ModifyRequest, MultiSigRequest, OrderRequest, PerpDeployRequest_RegisterAsset, PerpDeployRequest_SetOracle, PerpDexClassTransferRequest, PerpDexTransferRequest, RegisterReferrerRequest, ReserveRequestWeightRequest, ScheduleCancelRequest, SetDisplayNameRequest, SetReferrerRequest, SpotDeployRequest_Genesis, SpotDeployRequest_RegisterHyperliquidity, SpotDeployRequest_RegisterSpot, SpotDeployRequest_RegisterToken2, SpotDeployRequest_SetDeployerTradingFeeShare, SpotDeployRequest_UserGenesis, SpotSendRequest, SpotUserRequest, SubAccountSpotTransferRequest, SubAccountTransferRequest, TokenDelegateRequest, TwapCancelRequest, TwapOrderRequest, UpdateIsolatedMarginRequest, UpdateLeverageRequest, UsdClassTransferRequest, UsdSendRequest, VaultDistributeRequest, VaultModifyRequest, VaultTransferRequest, Withdraw3Request } from "../types/exchange/requests.js";
|
|
3
|
+
/** Action sorter and formatter for correct signature generation. */
|
|
3
4
|
export declare const actionSorter: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
reserveRequestWeight: (action: ReserveRequestWeightRequest["action"]) => ReserveRequestWeightRequest["action"];
|
|
46
|
-
/** Sorts and formats a `scheduleCancel` action. */
|
|
47
|
-
scheduleCancel: (action: ScheduleCancelRequest["action"]) => ScheduleCancelRequest["action"];
|
|
48
|
-
/** Sorts and formats a `setDisplayName` action. */
|
|
49
|
-
setDisplayName: (action: SetDisplayNameRequest["action"]) => SetDisplayNameRequest["action"];
|
|
50
|
-
/** Sorts and formats a `setReferrer` action. */
|
|
51
|
-
setReferrer: (action: SetReferrerRequest["action"]) => SetReferrerRequest["action"];
|
|
52
|
-
/** Sorts and formats a `spotDeploy` action. */
|
|
53
|
-
spotDeploy: (action: SpotDeployRequest_Genesis["action"] | SpotDeployRequest_RegisterHyperliquidity["action"] | SpotDeployRequest_RegisterSpot["action"] | SpotDeployRequest_RegisterToken2["action"] | SpotDeployRequest_SetDeployerTradingFeeShare["action"] | SpotDeployRequest_UserGenesis["action"]) => SpotDeployRequest_Genesis["action"] | SpotDeployRequest_RegisterHyperliquidity["action"] | SpotDeployRequest_RegisterSpot["action"] | SpotDeployRequest_RegisterToken2["action"] | SpotDeployRequest_SetDeployerTradingFeeShare["action"] | SpotDeployRequest_UserGenesis["action"];
|
|
54
|
-
/** Sorts and formats a `spotSend` action. */
|
|
55
|
-
spotSend: (action: SpotSendRequest["action"]) => SpotSendRequest["action"];
|
|
56
|
-
/** Sorts and formats a `spotUser` action. */
|
|
57
|
-
spotUser: (action: SpotUserRequest["action"]) => SpotUserRequest["action"];
|
|
58
|
-
/** Sorts and formats a `subAccountSpotTransfer` action. */
|
|
59
|
-
subAccountSpotTransfer: (action: SubAccountSpotTransferRequest["action"]) => SubAccountSpotTransferRequest["action"];
|
|
60
|
-
/** Sorts and formats a `subAccountTransfer` action. */
|
|
61
|
-
subAccountTransfer: (action: SubAccountTransferRequest["action"]) => SubAccountTransferRequest["action"];
|
|
62
|
-
/** Sorts and formats a `tokenDelegate` action. */
|
|
63
|
-
tokenDelegate: (action: TokenDelegateRequest["action"]) => TokenDelegateRequest["action"];
|
|
64
|
-
/** Sorts and formats a `twapCancel` action. */
|
|
65
|
-
twapCancel: (action: TwapCancelRequest["action"]) => TwapCancelRequest["action"];
|
|
66
|
-
/** Sorts and formats a `twapOrder` action. */
|
|
67
|
-
twapOrder: (action: TwapOrderRequest["action"]) => TwapOrderRequest["action"];
|
|
68
|
-
/** Sorts and formats an `updateIsolatedMargin` action. */
|
|
69
|
-
updateIsolatedMargin: (action: UpdateIsolatedMarginRequest["action"]) => UpdateIsolatedMarginRequest["action"];
|
|
70
|
-
/** Sorts and formats an `updateLeverage` action. */
|
|
71
|
-
updateLeverage: (action: UpdateLeverageRequest["action"]) => UpdateLeverageRequest["action"];
|
|
72
|
-
/** Sorts and formats an `usdClassTransfer` action. */
|
|
73
|
-
usdClassTransfer: (action: UsdClassTransferRequest["action"]) => UsdClassTransferRequest["action"];
|
|
74
|
-
/** Sorts and formats an `usdSend` action. */
|
|
75
|
-
usdSend: (action: UsdSendRequest["action"]) => UsdSendRequest["action"];
|
|
76
|
-
/** Sorts and formats a `vaultDistribute` action. */
|
|
77
|
-
vaultDistribute: (action: VaultDistributeRequest["action"]) => VaultDistributeRequest["action"];
|
|
78
|
-
/** Sorts and formats a `vaultModify` action. */
|
|
79
|
-
vaultModify: (action: VaultModifyRequest["action"]) => VaultModifyRequest["action"];
|
|
80
|
-
/** Sorts and formats a `vaultTransfer` action. */
|
|
81
|
-
vaultTransfer: (action: VaultTransferRequest["action"]) => VaultTransferRequest["action"];
|
|
82
|
-
/** Sorts and formats a `withdraw3` action. */
|
|
83
|
-
withdraw3: (action: Withdraw3Request["action"]) => Withdraw3Request["action"];
|
|
5
|
+
approveAgent: (action: DeepImmutable<ApproveAgentRequest["action"]>) => ApproveAgentRequest["action"];
|
|
6
|
+
approveBuilderFee: (action: DeepImmutable<ApproveBuilderFeeRequest["action"]>) => ApproveBuilderFeeRequest["action"];
|
|
7
|
+
batchModify: (action: DeepImmutable<BatchModifyRequest["action"]>) => BatchModifyRequest["action"];
|
|
8
|
+
cancel: (action: DeepImmutable<CancelRequest["action"]>) => CancelRequest["action"];
|
|
9
|
+
cancelByCloid: (action: DeepImmutable<CancelByCloidRequest["action"]>) => CancelByCloidRequest["action"];
|
|
10
|
+
cDeposit: (action: DeepImmutable<CDepositRequest["action"]>) => CDepositRequest["action"];
|
|
11
|
+
claimRewards: (action: DeepImmutable<ClaimRewardsRequest["action"]>) => ClaimRewardsRequest["action"];
|
|
12
|
+
convertToMultiSigUser: (action: DeepImmutable<ConvertToMultiSigUserRequest["action"]>) => ConvertToMultiSigUserRequest["action"];
|
|
13
|
+
createSubAccount: (action: DeepImmutable<CreateSubAccountRequest["action"]>) => CreateSubAccountRequest["action"];
|
|
14
|
+
createVault: (action: DeepImmutable<CreateVaultRequest["action"]>) => CreateVaultRequest["action"];
|
|
15
|
+
CSignerAction: (action: DeepImmutable<CSignerActionRequest_JailSelf["action"]> | DeepImmutable<CSignerActionRequest_UnjailSelf["action"]>) => CSignerActionRequest_JailSelf["action"] | CSignerActionRequest_UnjailSelf["action"];
|
|
16
|
+
CValidatorAction: (action: DeepImmutable<CValidatorActionRequest_ChangeProfile["action"]> | DeepImmutable<CValidatorActionRequest_Register["action"]> | DeepImmutable<CValidatorActionRequest_Unregister["action"]>) => CValidatorActionRequest_ChangeProfile["action"] | CValidatorActionRequest_Register["action"] | CValidatorActionRequest_Unregister["action"];
|
|
17
|
+
cWithdraw: (action: DeepImmutable<CWithdrawRequest["action"]>) => CWithdrawRequest["action"];
|
|
18
|
+
evmUserModify: (action: DeepImmutable<EvmUserModifyRequest["action"]>) => EvmUserModifyRequest["action"];
|
|
19
|
+
modify: (action: DeepImmutable<ModifyRequest["action"]>) => ModifyRequest["action"];
|
|
20
|
+
multiSig: (action: DeepImmutable<MultiSigRequest["action"]>) => MultiSigRequest["action"];
|
|
21
|
+
order: (action: DeepImmutable<OrderRequest["action"]>) => OrderRequest["action"];
|
|
22
|
+
perpDeploy: (action: DeepImmutable<PerpDeployRequest_RegisterAsset["action"]> | DeepImmutable<PerpDeployRequest_SetOracle["action"]>) => PerpDeployRequest_RegisterAsset["action"] | PerpDeployRequest_SetOracle["action"];
|
|
23
|
+
PerpDexClassTransfer: (action: DeepImmutable<PerpDexClassTransferRequest["action"]>) => PerpDexClassTransferRequest["action"];
|
|
24
|
+
PerpDexTransfer: (action: DeepImmutable<PerpDexTransferRequest["action"]>) => PerpDexTransferRequest["action"];
|
|
25
|
+
registerReferrer: (action: DeepImmutable<RegisterReferrerRequest["action"]>) => RegisterReferrerRequest["action"];
|
|
26
|
+
reserveRequestWeight: (action: DeepImmutable<ReserveRequestWeightRequest["action"]>) => ReserveRequestWeightRequest["action"];
|
|
27
|
+
scheduleCancel: (action: DeepImmutable<ScheduleCancelRequest["action"]>) => ScheduleCancelRequest["action"];
|
|
28
|
+
setDisplayName: (action: DeepImmutable<SetDisplayNameRequest["action"]>) => SetDisplayNameRequest["action"];
|
|
29
|
+
setReferrer: (action: DeepImmutable<SetReferrerRequest["action"]>) => SetReferrerRequest["action"];
|
|
30
|
+
spotDeploy: (action: DeepImmutable<SpotDeployRequest_Genesis["action"]> | DeepImmutable<SpotDeployRequest_RegisterHyperliquidity["action"]> | DeepImmutable<SpotDeployRequest_RegisterSpot["action"]> | DeepImmutable<SpotDeployRequest_RegisterToken2["action"]> | DeepImmutable<SpotDeployRequest_SetDeployerTradingFeeShare["action"]> | DeepImmutable<SpotDeployRequest_UserGenesis["action"]>) => SpotDeployRequest_Genesis["action"] | SpotDeployRequest_RegisterHyperliquidity["action"] | SpotDeployRequest_RegisterSpot["action"] | SpotDeployRequest_RegisterToken2["action"] | SpotDeployRequest_SetDeployerTradingFeeShare["action"] | SpotDeployRequest_UserGenesis["action"];
|
|
31
|
+
spotSend: (action: DeepImmutable<SpotSendRequest["action"]>) => SpotSendRequest["action"];
|
|
32
|
+
spotUser: (action: DeepImmutable<SpotUserRequest["action"]>) => SpotUserRequest["action"];
|
|
33
|
+
subAccountSpotTransfer: (action: DeepImmutable<SubAccountSpotTransferRequest["action"]>) => SubAccountSpotTransferRequest["action"];
|
|
34
|
+
subAccountTransfer: (action: DeepImmutable<SubAccountTransferRequest["action"]>) => SubAccountTransferRequest["action"];
|
|
35
|
+
tokenDelegate: (action: DeepImmutable<TokenDelegateRequest["action"]>) => TokenDelegateRequest["action"];
|
|
36
|
+
twapCancel: (action: DeepImmutable<TwapCancelRequest["action"]>) => TwapCancelRequest["action"];
|
|
37
|
+
twapOrder: (action: DeepImmutable<TwapOrderRequest["action"]>) => TwapOrderRequest["action"];
|
|
38
|
+
updateIsolatedMargin: (action: DeepImmutable<UpdateIsolatedMarginRequest["action"]>) => UpdateIsolatedMarginRequest["action"];
|
|
39
|
+
updateLeverage: (action: DeepImmutable<UpdateLeverageRequest["action"]>) => UpdateLeverageRequest["action"];
|
|
40
|
+
usdClassTransfer: (action: DeepImmutable<UsdClassTransferRequest["action"]>) => UsdClassTransferRequest["action"];
|
|
41
|
+
usdSend: (action: DeepImmutable<UsdSendRequest["action"]>) => UsdSendRequest["action"];
|
|
42
|
+
vaultDistribute: (action: DeepImmutable<VaultDistributeRequest["action"]>) => VaultDistributeRequest["action"];
|
|
43
|
+
vaultModify: (action: DeepImmutable<VaultModifyRequest["action"]>) => VaultModifyRequest["action"];
|
|
44
|
+
vaultTransfer: (action: DeepImmutable<VaultTransferRequest["action"]>) => VaultTransferRequest["action"];
|
|
45
|
+
withdraw3: (action: DeepImmutable<Withdraw3Request["action"]>) => Withdraw3Request["action"];
|
|
84
46
|
};
|
|
85
47
|
/** EIP-712 type definitions for user-signed actions. */
|
|
86
48
|
export declare const userSignedActionEip712Types: {
|
|
@@ -120,6 +82,18 @@ export declare const userSignedActionEip712Types: {
|
|
|
120
82
|
type: string;
|
|
121
83
|
}[];
|
|
122
84
|
};
|
|
85
|
+
PerpDexTransfer: {
|
|
86
|
+
"HyperliquidTransaction:PerpDexTransfer": {
|
|
87
|
+
name: string;
|
|
88
|
+
type: string;
|
|
89
|
+
}[];
|
|
90
|
+
};
|
|
91
|
+
multiSig: {
|
|
92
|
+
"HyperliquidTransaction:SendMultiSig": {
|
|
93
|
+
name: string;
|
|
94
|
+
type: string;
|
|
95
|
+
}[];
|
|
96
|
+
};
|
|
123
97
|
spotSend: {
|
|
124
98
|
"HyperliquidTransaction:SpotSend": {
|
|
125
99
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_sorter.d.ts","sourceRoot":"","sources":["../../../src/src/signing/_sorter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_sorter.d.ts","sourceRoot":"","sources":["../../../src/src/signing/_sorter.ts"],"names":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AAC;0BAOtF,aAAa,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,KAAG,kBAAkB,CAAC,QAAQ,CAAC;4BAQxE,aAAa,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,KAAG,oBAAoB,CAAC,QAAQ,CAAC;wBAQlF,aAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,KAAG,gBAAgB,CAAC,QAAQ,CAAC;CAU7F,CAAC;AAYF,wDAAwD;AACxD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GvC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** Action sorter for correct signature generation. */
|
|
1
|
+
/** Action sorter and formatter for correct signature generation. */
|
|
2
2
|
export const actionSorter = {
|
|
3
|
-
/** Sorts and formats an `approveAgent` action. */
|
|
4
3
|
approveAgent: (action) => {
|
|
5
4
|
return {
|
|
6
5
|
type: action.type,
|
|
@@ -11,7 +10,6 @@ export const actionSorter = {
|
|
|
11
10
|
nonce: action.nonce,
|
|
12
11
|
};
|
|
13
12
|
},
|
|
14
|
-
/** Sorts and formats an `approveBuilderFee` action. */
|
|
15
13
|
approveBuilderFee: (action) => {
|
|
16
14
|
return {
|
|
17
15
|
type: action.type,
|
|
@@ -22,7 +20,6 @@ export const actionSorter = {
|
|
|
22
20
|
nonce: action.nonce,
|
|
23
21
|
};
|
|
24
22
|
},
|
|
25
|
-
/** Sorts and formats a `batchModify` action. */
|
|
26
23
|
batchModify: (action) => {
|
|
27
24
|
return {
|
|
28
25
|
type: action.type,
|
|
@@ -57,7 +54,6 @@ export const actionSorter = {
|
|
|
57
54
|
}),
|
|
58
55
|
};
|
|
59
56
|
},
|
|
60
|
-
/** Sorts and formats a `cancel` action. */
|
|
61
57
|
cancel: (action) => {
|
|
62
58
|
return {
|
|
63
59
|
type: action.type,
|
|
@@ -67,7 +63,6 @@ export const actionSorter = {
|
|
|
67
63
|
})),
|
|
68
64
|
};
|
|
69
65
|
},
|
|
70
|
-
/** Sorts and formats a `cancelByCloid` action. */
|
|
71
66
|
cancelByCloid: (action) => {
|
|
72
67
|
return {
|
|
73
68
|
type: action.type,
|
|
@@ -77,7 +72,6 @@ export const actionSorter = {
|
|
|
77
72
|
})),
|
|
78
73
|
};
|
|
79
74
|
},
|
|
80
|
-
/** Sorts and formats a `cDeposit` action. */
|
|
81
75
|
cDeposit: (action) => {
|
|
82
76
|
return {
|
|
83
77
|
type: action.type,
|
|
@@ -87,30 +81,26 @@ export const actionSorter = {
|
|
|
87
81
|
nonce: action.nonce,
|
|
88
82
|
};
|
|
89
83
|
},
|
|
90
|
-
/** Sorts and formats a `claimRewards` action. */
|
|
91
84
|
claimRewards: (action) => {
|
|
92
85
|
return {
|
|
93
86
|
type: action.type,
|
|
94
87
|
};
|
|
95
88
|
},
|
|
96
|
-
/** Sorts and formats a `convertToMultiSigUser` action. */
|
|
97
89
|
convertToMultiSigUser: (action) => {
|
|
98
90
|
return {
|
|
99
91
|
type: action.type,
|
|
100
92
|
signatureChainId: action.signatureChainId,
|
|
101
93
|
hyperliquidChain: action.hyperliquidChain,
|
|
102
|
-
signers: action.signers,
|
|
94
|
+
signers: action.signers, // key order is not important
|
|
103
95
|
nonce: action.nonce,
|
|
104
96
|
};
|
|
105
97
|
},
|
|
106
|
-
/** Sorts and formats a `createSubAccount` action. */
|
|
107
98
|
createSubAccount: (action) => {
|
|
108
99
|
return {
|
|
109
100
|
type: action.type,
|
|
110
101
|
name: action.name,
|
|
111
102
|
};
|
|
112
103
|
},
|
|
113
|
-
/** Sorts and formats a `createVault` action. */
|
|
114
104
|
createVault: (action) => {
|
|
115
105
|
return {
|
|
116
106
|
type: action.type,
|
|
@@ -120,7 +110,6 @@ export const actionSorter = {
|
|
|
120
110
|
nonce: action.nonce,
|
|
121
111
|
};
|
|
122
112
|
},
|
|
123
|
-
/** Sorts and formats a `CSignerAction` action (jail/unjail). */
|
|
124
113
|
CSignerAction: (action) => {
|
|
125
114
|
if ("jailSelf" in action) {
|
|
126
115
|
return {
|
|
@@ -135,7 +124,6 @@ export const actionSorter = {
|
|
|
135
124
|
};
|
|
136
125
|
}
|
|
137
126
|
},
|
|
138
|
-
/** Sorts and formats a `CValidatorAction` action (register/unregister/change profile). */
|
|
139
127
|
CValidatorAction: (action) => {
|
|
140
128
|
if ("changeProfile" in action) {
|
|
141
129
|
return {
|
|
@@ -177,7 +165,6 @@ export const actionSorter = {
|
|
|
177
165
|
};
|
|
178
166
|
}
|
|
179
167
|
},
|
|
180
|
-
/** Sorts and formats a `cWithdraw` action. */
|
|
181
168
|
cWithdraw: (action) => {
|
|
182
169
|
return {
|
|
183
170
|
type: action.type,
|
|
@@ -187,14 +174,12 @@ export const actionSorter = {
|
|
|
187
174
|
nonce: action.nonce,
|
|
188
175
|
};
|
|
189
176
|
},
|
|
190
|
-
/** Sorts and formats an `evmUserModify` action. */
|
|
191
177
|
evmUserModify: (action) => {
|
|
192
178
|
return {
|
|
193
179
|
type: action.type,
|
|
194
180
|
usingBigBlocks: action.usingBigBlocks,
|
|
195
181
|
};
|
|
196
182
|
},
|
|
197
|
-
/** Sorts and formats a `modify` action. */
|
|
198
183
|
modify: (action) => {
|
|
199
184
|
const sortedAction = {
|
|
200
185
|
type: action.type,
|
|
@@ -225,7 +210,6 @@ export const actionSorter = {
|
|
|
225
210
|
delete sortedAction.order.c;
|
|
226
211
|
return sortedAction;
|
|
227
212
|
},
|
|
228
|
-
/** Sorts and formats a `multiSig` action. */
|
|
229
213
|
multiSig: (action) => {
|
|
230
214
|
return {
|
|
231
215
|
type: action.type,
|
|
@@ -238,11 +222,10 @@ export const actionSorter = {
|
|
|
238
222
|
payload: {
|
|
239
223
|
multiSigUser: action.payload.multiSigUser.toLowerCase(),
|
|
240
224
|
outerSigner: action.payload.outerSigner.toLowerCase(),
|
|
241
|
-
action: action.payload.action,
|
|
225
|
+
action: structuredClone(action.payload.action),
|
|
242
226
|
},
|
|
243
227
|
};
|
|
244
228
|
},
|
|
245
|
-
/** Sorts and formats an `order` action. */
|
|
246
229
|
order: (action) => {
|
|
247
230
|
const sortedAction = {
|
|
248
231
|
type: action.type,
|
|
@@ -284,7 +267,6 @@ export const actionSorter = {
|
|
|
284
267
|
delete sortedAction.builder;
|
|
285
268
|
return sortedAction;
|
|
286
269
|
},
|
|
287
|
-
/** Sorts and formats a `perpDeploy` action. */
|
|
288
270
|
perpDeploy: (action) => {
|
|
289
271
|
if ("registerAsset" in action) {
|
|
290
272
|
return {
|
|
@@ -314,13 +296,12 @@ export const actionSorter = {
|
|
|
314
296
|
type: action.type,
|
|
315
297
|
setOracle: {
|
|
316
298
|
dex: action.setOracle.dex,
|
|
317
|
-
oraclePxs: action.setOracle.oraclePxs,
|
|
318
|
-
markPxs: action.setOracle.markPxs,
|
|
299
|
+
oraclePxs: action.setOracle.oraclePxs.map((el) => [...el]),
|
|
300
|
+
markPxs: action.setOracle.markPxs.map((el) => [...el]),
|
|
319
301
|
},
|
|
320
302
|
};
|
|
321
303
|
}
|
|
322
304
|
},
|
|
323
|
-
/** Sorts and formats a `PerpDexClassTransfer` action. */
|
|
324
305
|
PerpDexClassTransfer: (action) => {
|
|
325
306
|
return {
|
|
326
307
|
type: action.type,
|
|
@@ -333,21 +314,29 @@ export const actionSorter = {
|
|
|
333
314
|
nonce: action.nonce,
|
|
334
315
|
};
|
|
335
316
|
},
|
|
336
|
-
|
|
317
|
+
PerpDexTransfer: (action) => {
|
|
318
|
+
return {
|
|
319
|
+
type: action.type,
|
|
320
|
+
signatureChainId: action.signatureChainId,
|
|
321
|
+
hyperliquidChain: action.hyperliquidChain,
|
|
322
|
+
sourceDex: action.sourceDex,
|
|
323
|
+
destinationDex: action.destinationDex,
|
|
324
|
+
amount: action.amount,
|
|
325
|
+
nonce: action.nonce,
|
|
326
|
+
};
|
|
327
|
+
},
|
|
337
328
|
registerReferrer: (action) => {
|
|
338
329
|
return {
|
|
339
330
|
type: action.type,
|
|
340
331
|
code: action.code,
|
|
341
332
|
};
|
|
342
333
|
},
|
|
343
|
-
/** Sorts and formats a `reserveRequestWeight` action. */
|
|
344
334
|
reserveRequestWeight: (action) => {
|
|
345
335
|
return {
|
|
346
336
|
type: action.type,
|
|
347
337
|
weight: action.weight,
|
|
348
338
|
};
|
|
349
339
|
},
|
|
350
|
-
/** Sorts and formats a `scheduleCancel` action. */
|
|
351
340
|
scheduleCancel: (action) => {
|
|
352
341
|
const sortedAction = {
|
|
353
342
|
type: action.type,
|
|
@@ -357,21 +346,18 @@ export const actionSorter = {
|
|
|
357
346
|
delete sortedAction.time;
|
|
358
347
|
return sortedAction;
|
|
359
348
|
},
|
|
360
|
-
/** Sorts and formats a `setDisplayName` action. */
|
|
361
349
|
setDisplayName: (action) => {
|
|
362
350
|
return {
|
|
363
351
|
type: action.type,
|
|
364
352
|
displayName: action.displayName,
|
|
365
353
|
};
|
|
366
354
|
},
|
|
367
|
-
/** Sorts and formats a `setReferrer` action. */
|
|
368
355
|
setReferrer: (action) => {
|
|
369
356
|
return {
|
|
370
357
|
type: action.type,
|
|
371
358
|
code: action.code,
|
|
372
359
|
};
|
|
373
360
|
},
|
|
374
|
-
/** Sorts and formats a `spotDeploy` action. */
|
|
375
361
|
spotDeploy: (action) => {
|
|
376
362
|
if ("genesis" in action) {
|
|
377
363
|
const sortedAction = {
|
|
@@ -407,7 +393,7 @@ export const actionSorter = {
|
|
|
407
393
|
return {
|
|
408
394
|
type: action.type,
|
|
409
395
|
registerSpot: {
|
|
410
|
-
tokens: action.registerSpot.tokens,
|
|
396
|
+
tokens: [...action.registerSpot.tokens],
|
|
411
397
|
},
|
|
412
398
|
};
|
|
413
399
|
}
|
|
@@ -443,9 +429,9 @@ export const actionSorter = {
|
|
|
443
429
|
type: action.type,
|
|
444
430
|
userGenesis: {
|
|
445
431
|
token: action.userGenesis.token,
|
|
446
|
-
userAndWei: action.userGenesis.userAndWei,
|
|
447
|
-
existingTokenAndWei: action.userGenesis.existingTokenAndWei,
|
|
448
|
-
blacklistUsers: action.userGenesis.blacklistUsers,
|
|
432
|
+
userAndWei: action.userGenesis.userAndWei.map((el) => [...el]),
|
|
433
|
+
existingTokenAndWei: action.userGenesis.existingTokenAndWei.map((el) => [...el]),
|
|
434
|
+
blacklistUsers: action.userGenesis.blacklistUsers?.map((el) => [...el]),
|
|
449
435
|
},
|
|
450
436
|
};
|
|
451
437
|
if (sortedAction.userGenesis.blacklistUsers === undefined) {
|
|
@@ -454,7 +440,6 @@ export const actionSorter = {
|
|
|
454
440
|
return sortedAction;
|
|
455
441
|
}
|
|
456
442
|
},
|
|
457
|
-
/** Sorts and formats a `spotSend` action. */
|
|
458
443
|
spotSend: (action) => {
|
|
459
444
|
return {
|
|
460
445
|
type: action.type,
|
|
@@ -466,7 +451,6 @@ export const actionSorter = {
|
|
|
466
451
|
time: action.time,
|
|
467
452
|
};
|
|
468
453
|
},
|
|
469
|
-
/** Sorts and formats a `spotUser` action. */
|
|
470
454
|
spotUser: (action) => {
|
|
471
455
|
return {
|
|
472
456
|
type: action.type,
|
|
@@ -475,7 +459,6 @@ export const actionSorter = {
|
|
|
475
459
|
},
|
|
476
460
|
};
|
|
477
461
|
},
|
|
478
|
-
/** Sorts and formats a `subAccountSpotTransfer` action. */
|
|
479
462
|
subAccountSpotTransfer: (action) => {
|
|
480
463
|
return {
|
|
481
464
|
type: action.type,
|
|
@@ -485,7 +468,6 @@ export const actionSorter = {
|
|
|
485
468
|
amount: action.amount,
|
|
486
469
|
};
|
|
487
470
|
},
|
|
488
|
-
/** Sorts and formats a `subAccountTransfer` action. */
|
|
489
471
|
subAccountTransfer: (action) => {
|
|
490
472
|
return {
|
|
491
473
|
type: action.type,
|
|
@@ -494,7 +476,6 @@ export const actionSorter = {
|
|
|
494
476
|
usd: action.usd,
|
|
495
477
|
};
|
|
496
478
|
},
|
|
497
|
-
/** Sorts and formats a `tokenDelegate` action. */
|
|
498
479
|
tokenDelegate: (action) => {
|
|
499
480
|
return {
|
|
500
481
|
type: action.type,
|
|
@@ -506,7 +487,6 @@ export const actionSorter = {
|
|
|
506
487
|
nonce: action.nonce,
|
|
507
488
|
};
|
|
508
489
|
},
|
|
509
|
-
/** Sorts and formats a `twapCancel` action. */
|
|
510
490
|
twapCancel: (action) => {
|
|
511
491
|
return {
|
|
512
492
|
type: action.type,
|
|
@@ -514,7 +494,6 @@ export const actionSorter = {
|
|
|
514
494
|
t: action.t,
|
|
515
495
|
};
|
|
516
496
|
},
|
|
517
|
-
/** Sorts and formats a `twapOrder` action. */
|
|
518
497
|
twapOrder: (action) => {
|
|
519
498
|
return {
|
|
520
499
|
type: action.type,
|
|
@@ -528,7 +507,6 @@ export const actionSorter = {
|
|
|
528
507
|
},
|
|
529
508
|
};
|
|
530
509
|
},
|
|
531
|
-
/** Sorts and formats an `updateIsolatedMargin` action. */
|
|
532
510
|
updateIsolatedMargin: (action) => {
|
|
533
511
|
return {
|
|
534
512
|
type: action.type,
|
|
@@ -537,7 +515,6 @@ export const actionSorter = {
|
|
|
537
515
|
ntli: action.ntli,
|
|
538
516
|
};
|
|
539
517
|
},
|
|
540
|
-
/** Sorts and formats an `updateLeverage` action. */
|
|
541
518
|
updateLeverage: (action) => {
|
|
542
519
|
return {
|
|
543
520
|
type: action.type,
|
|
@@ -546,7 +523,6 @@ export const actionSorter = {
|
|
|
546
523
|
leverage: action.leverage,
|
|
547
524
|
};
|
|
548
525
|
},
|
|
549
|
-
/** Sorts and formats an `usdClassTransfer` action. */
|
|
550
526
|
usdClassTransfer: (action) => {
|
|
551
527
|
return {
|
|
552
528
|
type: action.type,
|
|
@@ -557,7 +533,6 @@ export const actionSorter = {
|
|
|
557
533
|
nonce: action.nonce,
|
|
558
534
|
};
|
|
559
535
|
},
|
|
560
|
-
/** Sorts and formats an `usdSend` action. */
|
|
561
536
|
usdSend: (action) => {
|
|
562
537
|
return {
|
|
563
538
|
type: action.type,
|
|
@@ -568,7 +543,6 @@ export const actionSorter = {
|
|
|
568
543
|
time: action.time,
|
|
569
544
|
};
|
|
570
545
|
},
|
|
571
|
-
/** Sorts and formats a `vaultDistribute` action. */
|
|
572
546
|
vaultDistribute: (action) => {
|
|
573
547
|
return {
|
|
574
548
|
type: action.type,
|
|
@@ -576,7 +550,6 @@ export const actionSorter = {
|
|
|
576
550
|
usd: action.usd,
|
|
577
551
|
};
|
|
578
552
|
},
|
|
579
|
-
/** Sorts and formats a `vaultModify` action. */
|
|
580
553
|
vaultModify: (action) => {
|
|
581
554
|
return {
|
|
582
555
|
type: action.type,
|
|
@@ -585,7 +558,6 @@ export const actionSorter = {
|
|
|
585
558
|
alwaysCloseOnWithdraw: action.alwaysCloseOnWithdraw,
|
|
586
559
|
};
|
|
587
560
|
},
|
|
588
|
-
/** Sorts and formats a `vaultTransfer` action. */
|
|
589
561
|
vaultTransfer: (action) => {
|
|
590
562
|
return {
|
|
591
563
|
type: action.type,
|
|
@@ -594,7 +566,6 @@ export const actionSorter = {
|
|
|
594
566
|
usd: action.usd,
|
|
595
567
|
};
|
|
596
568
|
},
|
|
597
|
-
/** Sorts and formats a `withdraw3` action. */
|
|
598
569
|
withdraw3: (action) => {
|
|
599
570
|
return {
|
|
600
571
|
type: action.type,
|
|
@@ -663,6 +634,22 @@ export const userSignedActionEip712Types = {
|
|
|
663
634
|
{ name: "nonce", type: "uint64" },
|
|
664
635
|
],
|
|
665
636
|
},
|
|
637
|
+
PerpDexTransfer: {
|
|
638
|
+
"HyperliquidTransaction:PerpDexTransfer": [
|
|
639
|
+
{ name: "hyperliquidChain", type: "string" },
|
|
640
|
+
{ name: "sourceDex", type: "string" },
|
|
641
|
+
{ name: "destinationDex", type: "string" },
|
|
642
|
+
{ name: "amount", type: "string" },
|
|
643
|
+
{ name: "nonce", type: "uint64" },
|
|
644
|
+
],
|
|
645
|
+
},
|
|
646
|
+
multiSig: {
|
|
647
|
+
"HyperliquidTransaction:SendMultiSig": [
|
|
648
|
+
{ name: "hyperliquidChain", type: "string" },
|
|
649
|
+
{ name: "multiSigActionHash", type: "bytes32" },
|
|
650
|
+
{ name: "nonce", type: "uint64" },
|
|
651
|
+
],
|
|
652
|
+
},
|
|
666
653
|
spotSend: {
|
|
667
654
|
"HyperliquidTransaction:SpotSend": [
|
|
668
655
|
{ name: "hyperliquidChain", type: "string" },
|