@nktkas/hyperliquid 0.23.1 → 0.24.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/CONTRIBUTING.md +3 -2
- package/README.md +178 -194
- package/esm/mod.d.ts +2 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/src/base.d.ts +0 -5
- package/esm/src/base.d.ts.map +1 -1
- package/esm/src/clients/exchange.d.ts +485 -392
- package/esm/src/clients/exchange.d.ts.map +1 -1
- package/esm/src/clients/exchange.js +517 -912
- package/esm/src/clients/info.d.ts +249 -203
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +258 -368
- package/esm/src/clients/multiSign.d.ts +14 -1184
- package/esm/src/clients/multiSign.d.ts.map +1 -1
- package/esm/src/clients/multiSign.js +37 -2004
- package/esm/src/clients/subscription.d.ts +101 -99
- package/esm/src/clients/subscription.d.ts.map +1 -1
- package/esm/src/clients/subscription.js +107 -152
- package/esm/src/signing/_signTypedData/ethers.d.ts +16 -4
- package/esm/src/signing/_signTypedData/ethers.d.ts.map +1 -1
- package/esm/src/signing/_signTypedData/ethers.js +1 -1
- package/esm/src/signing/_signTypedData/mod.d.ts +12 -12
- package/esm/src/signing/_signTypedData/mod.d.ts.map +1 -1
- package/esm/src/signing/_signTypedData/mod.js +52 -24
- package/esm/src/signing/_signTypedData/private_key.d.ts +6 -5
- package/esm/src/signing/_signTypedData/private_key.d.ts.map +1 -1
- package/esm/src/signing/_signTypedData/private_key.js +40 -19
- package/esm/src/signing/_signTypedData/viem.d.ts +27 -6
- package/esm/src/signing/_signTypedData/viem.d.ts.map +1 -1
- package/esm/src/signing/_signTypedData/viem.js +1 -1
- package/esm/src/signing/_sorter.d.ts +18 -19
- package/esm/src/signing/_sorter.d.ts.map +1 -1
- package/esm/src/signing/_sorter.js +57 -59
- package/esm/src/signing/mod.d.ts +179 -129
- package/esm/src/signing/mod.d.ts.map +1 -1
- package/esm/src/signing/mod.js +184 -132
- package/esm/src/transports/base.d.ts +2 -1
- package/esm/src/transports/base.d.ts.map +1 -1
- package/esm/src/transports/http/http_transport.d.ts +3 -2
- package/esm/src/transports/http/http_transport.d.ts.map +1 -1
- package/esm/src/transports/http/http_transport.js +4 -4
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +14 -6
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -2
- package/esm/src/transports/websocket/_reconnecting_websocket.d.ts +2 -1
- package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
- package/esm/src/transports/websocket/_reconnecting_websocket.js +1 -0
- package/esm/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
- package/esm/src/transports/websocket/_websocket_async_request.js +17 -21
- package/esm/src/transports/websocket/websocket_transport.d.ts +4 -4
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.js +6 -6
- package/esm/src/types/exchange/requests.d.ts +547 -306
- package/esm/src/types/exchange/requests.d.ts.map +1 -1
- package/esm/src/types/exchange/responses.d.ts +105 -25
- package/esm/src/types/exchange/responses.d.ts.map +1 -1
- package/esm/src/types/explorer/requests.d.ts +3 -3
- package/esm/src/types/explorer/requests.d.ts.map +1 -1
- package/esm/src/types/explorer/responses.d.ts +1 -1
- package/esm/src/types/explorer/responses.d.ts.map +1 -1
- package/esm/src/types/info/accounts.d.ts +405 -98
- package/esm/src/types/info/accounts.d.ts.map +1 -1
- package/esm/src/types/info/assets.d.ts +131 -35
- package/esm/src/types/info/assets.d.ts.map +1 -1
- package/esm/src/types/info/markets.d.ts +29 -8
- package/esm/src/types/info/markets.d.ts.map +1 -1
- package/esm/src/types/info/orders.d.ts +64 -17
- package/esm/src/types/info/orders.d.ts.map +1 -1
- package/esm/src/types/info/requests.d.ts +126 -51
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/esm/src/types/info/validators.d.ts +44 -14
- package/esm/src/types/info/validators.d.ts.map +1 -1
- package/esm/src/types/info/vaults.d.ts +25 -10
- 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 +21 -66
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/esm/src/types/subscriptions/responses.d.ts +46 -55
- package/esm/src/types/subscriptions/responses.d.ts.map +1 -1
- package/package.json +2 -3
- package/script/mod.d.ts +2 -1
- package/script/mod.d.ts.map +1 -1
- package/script/src/base.d.ts +0 -5
- package/script/src/base.d.ts.map +1 -1
- package/script/src/clients/exchange.d.ts +485 -392
- package/script/src/clients/exchange.d.ts.map +1 -1
- package/script/src/clients/exchange.js +516 -911
- package/script/src/clients/info.d.ts +249 -203
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +258 -368
- package/script/src/clients/multiSign.d.ts +14 -1184
- package/script/src/clients/multiSign.d.ts.map +1 -1
- package/script/src/clients/multiSign.js +38 -2005
- package/script/src/clients/subscription.d.ts +101 -99
- package/script/src/clients/subscription.d.ts.map +1 -1
- package/script/src/clients/subscription.js +107 -152
- package/script/src/signing/_signTypedData/ethers.d.ts +16 -4
- package/script/src/signing/_signTypedData/ethers.d.ts.map +1 -1
- package/script/src/signing/_signTypedData/ethers.js +2 -2
- package/script/src/signing/_signTypedData/mod.d.ts +12 -12
- package/script/src/signing/_signTypedData/mod.d.ts.map +1 -1
- package/script/src/signing/_signTypedData/mod.js +51 -26
- package/script/src/signing/_signTypedData/private_key.d.ts +6 -5
- package/script/src/signing/_signTypedData/private_key.d.ts.map +1 -1
- package/script/src/signing/_signTypedData/private_key.js +40 -18
- package/script/src/signing/_signTypedData/viem.d.ts +27 -6
- package/script/src/signing/_signTypedData/viem.d.ts.map +1 -1
- package/script/src/signing/_signTypedData/viem.js +2 -2
- package/script/src/signing/_sorter.d.ts +18 -19
- package/script/src/signing/_sorter.d.ts.map +1 -1
- package/script/src/signing/_sorter.js +57 -59
- package/script/src/signing/mod.d.ts +179 -129
- package/script/src/signing/mod.d.ts.map +1 -1
- package/script/src/signing/mod.js +187 -150
- package/script/src/transports/base.d.ts +2 -1
- package/script/src/transports/base.d.ts.map +1 -1
- package/script/src/transports/http/http_transport.d.ts +3 -2
- package/script/src/transports/http/http_transport.d.ts.map +1 -1
- package/script/src/transports/http/http_transport.js +4 -4
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +14 -6
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.js +1 -2
- package/script/src/transports/websocket/_reconnecting_websocket.d.ts +2 -1
- package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
- package/script/src/transports/websocket/_reconnecting_websocket.js +1 -0
- package/script/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
- package/script/src/transports/websocket/_websocket_async_request.js +17 -21
- package/script/src/transports/websocket/websocket_transport.d.ts +4 -4
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.js +6 -6
- package/script/src/types/exchange/requests.d.ts +547 -306
- package/script/src/types/exchange/requests.d.ts.map +1 -1
- package/script/src/types/exchange/responses.d.ts +105 -25
- package/script/src/types/exchange/responses.d.ts.map +1 -1
- package/script/src/types/explorer/requests.d.ts +3 -3
- package/script/src/types/explorer/requests.d.ts.map +1 -1
- package/script/src/types/explorer/responses.d.ts +1 -1
- package/script/src/types/explorer/responses.d.ts.map +1 -1
- package/script/src/types/info/accounts.d.ts +405 -98
- package/script/src/types/info/accounts.d.ts.map +1 -1
- package/script/src/types/info/assets.d.ts +131 -35
- package/script/src/types/info/assets.d.ts.map +1 -1
- package/script/src/types/info/markets.d.ts +29 -8
- package/script/src/types/info/markets.d.ts.map +1 -1
- package/script/src/types/info/orders.d.ts +64 -17
- package/script/src/types/info/orders.d.ts.map +1 -1
- package/script/src/types/info/requests.d.ts +126 -51
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/info/validators.d.ts +44 -14
- package/script/src/types/info/validators.d.ts.map +1 -1
- package/script/src/types/info/vaults.d.ts +25 -10
- package/script/src/types/info/vaults.d.ts.map +1 -1
- package/script/src/types/mod.d.ts +1 -1
- package/script/src/types/mod.d.ts.map +1 -1
- package/script/src/types/subscriptions/requests.d.ts +21 -66
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
- package/script/src/types/subscriptions/responses.d.ts +46 -55
- package/script/src/types/subscriptions/responses.d.ts.map +1 -1
- package/esm/src/signing/_signTypedData/window.d.ts +0 -29
- package/esm/src/signing/_signTypedData/window.d.ts.map +0 -1
- package/esm/src/signing/_signTypedData/window.js +0 -30
- package/script/src/signing/_signTypedData/window.d.ts +0 -29
- package/script/src/signing/_signTypedData/window.d.ts.map +0 -1
- package/script/src/signing/_signTypedData/window.js +0 -34
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isValidPrivateKey, signTypedData as signTypedDataWithPrivateKey } from "./private_key.js";
|
|
3
|
-
import {
|
|
4
|
-
import { isAbstractWindowEthereum, signTypedDataWithWindowEthereum } from "./window.js";
|
|
5
|
-
export { isAbstractEthersSigner, isAbstractEthersV5Signer, isAbstractViemWalletClient, isAbstractWindowEthereum, isValidPrivateKey, };
|
|
1
|
+
import { isAbstractEthersV5Signer, isAbstractEthersV6Signer, } from "./ethers.js";
|
|
2
|
+
import { isValidPrivateKey, privateKeyToAddress, signTypedData as signTypedDataWithPrivateKey } from "./private_key.js";
|
|
3
|
+
import { isAbstractViemWallet } from "./viem.js";
|
|
6
4
|
export async function signTypedData(args) {
|
|
7
5
|
const { wallet, domain, types, primaryType, message } = args;
|
|
8
6
|
let signature;
|
|
9
|
-
if (
|
|
10
|
-
signature = await signTypedDataWithPrivateKey({
|
|
11
|
-
privateKey: wallet,
|
|
12
|
-
domain,
|
|
13
|
-
types,
|
|
14
|
-
primaryType,
|
|
15
|
-
message,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
else if (isAbstractViemWalletClient(wallet)) {
|
|
7
|
+
if (isAbstractViemWallet(wallet)) {
|
|
19
8
|
signature = await wallet.signTypedData({
|
|
20
9
|
domain,
|
|
21
10
|
types: {
|
|
@@ -31,20 +20,14 @@ export async function signTypedData(args) {
|
|
|
31
20
|
message,
|
|
32
21
|
});
|
|
33
22
|
}
|
|
34
|
-
else if (
|
|
23
|
+
else if (isAbstractEthersV6Signer(wallet)) {
|
|
35
24
|
signature = await wallet.signTypedData(domain, types, message);
|
|
36
25
|
}
|
|
37
26
|
else if (isAbstractEthersV5Signer(wallet)) {
|
|
38
27
|
signature = await wallet._signTypedData(domain, types, message);
|
|
39
28
|
}
|
|
40
|
-
else if (
|
|
41
|
-
signature = await
|
|
42
|
-
ethereum: wallet,
|
|
43
|
-
domain,
|
|
44
|
-
types,
|
|
45
|
-
primaryType,
|
|
46
|
-
message,
|
|
47
|
-
});
|
|
29
|
+
else if (isValidPrivateKey(wallet)) {
|
|
30
|
+
signature = await signTypedDataWithPrivateKey({ privateKey: wallet, domain, types, primaryType, message });
|
|
48
31
|
}
|
|
49
32
|
else {
|
|
50
33
|
throw new Error("Unsupported wallet for signing typed data");
|
|
@@ -57,3 +40,48 @@ function splitSignature(signature) {
|
|
|
57
40
|
const v = parseInt(signature.slice(130, 132), 16);
|
|
58
41
|
return { r, s, v };
|
|
59
42
|
}
|
|
43
|
+
/** Get the chain ID of the wallet. */
|
|
44
|
+
export async function getWalletChainId(wallet) {
|
|
45
|
+
if (isAbstractViemWallet(wallet)) {
|
|
46
|
+
if ("getChainId" in wallet && wallet.getChainId) {
|
|
47
|
+
const chainId = await wallet.getChainId();
|
|
48
|
+
return `0x${chainId.toString(16)}`;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return "0x1";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (isAbstractEthersV6Signer(wallet) || isAbstractEthersV5Signer(wallet)) {
|
|
55
|
+
if ("provider" in wallet && wallet.provider) {
|
|
56
|
+
const network = await wallet.provider.getNetwork();
|
|
57
|
+
return `0x${network.chainId.toString(16)}`;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return "0x1";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return "0x1";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** Get the wallet address from various wallet types. */
|
|
68
|
+
export async function getWalletAddress(wallet) {
|
|
69
|
+
if (isAbstractViemWallet(wallet)) {
|
|
70
|
+
if ("address" in wallet && wallet.address) {
|
|
71
|
+
return wallet.address;
|
|
72
|
+
}
|
|
73
|
+
else if ("getAddresses" in wallet && wallet.getAddresses) {
|
|
74
|
+
const addresses = await wallet.getAddresses();
|
|
75
|
+
return addresses[0];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else if (isAbstractEthersV6Signer(wallet) || isAbstractEthersV5Signer(wallet)) {
|
|
79
|
+
if ("getAddress" in wallet && wallet.getAddress) {
|
|
80
|
+
return await wallet.getAddress();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (isValidPrivateKey(wallet)) {
|
|
84
|
+
return privateKeyToAddress(wallet);
|
|
85
|
+
}
|
|
86
|
+
throw new Error("Unsupported wallet for getting address");
|
|
87
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
type Hex = `0x${string}`;
|
|
2
1
|
interface Types {
|
|
3
2
|
[type: string]: {
|
|
4
3
|
name: string;
|
|
@@ -8,9 +7,9 @@ interface Types {
|
|
|
8
7
|
interface Domain extends Record<string, unknown> {
|
|
9
8
|
name?: string;
|
|
10
9
|
version?: string;
|
|
11
|
-
chainId?: number | string | bigint |
|
|
12
|
-
verifyingContract?:
|
|
13
|
-
salt?:
|
|
10
|
+
chainId?: number | string | bigint | `0x${string}`;
|
|
11
|
+
verifyingContract?: `0x${string}`;
|
|
12
|
+
salt?: `0x${string}`;
|
|
14
13
|
}
|
|
15
14
|
/** Signs typed data with a private key. */
|
|
16
15
|
export declare function signTypedData(args: {
|
|
@@ -19,8 +18,10 @@ export declare function signTypedData(args: {
|
|
|
19
18
|
types: Types;
|
|
20
19
|
primaryType: string;
|
|
21
20
|
message: Record<string, unknown>;
|
|
22
|
-
}): Promise
|
|
21
|
+
}): Promise<`0x${string}`>;
|
|
23
22
|
/** Validates if a string is a valid secp256k1 private key. */
|
|
24
23
|
export declare function isValidPrivateKey(privateKey: unknown): privateKey is string;
|
|
24
|
+
/** Converts a private key to an Ethereum address. */
|
|
25
|
+
export declare function privateKeyToAddress(privateKey: string): `0x${string}`;
|
|
25
26
|
export {};
|
|
26
27
|
//# sourceMappingURL=private_key.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_key.d.ts","sourceRoot":"","sources":["../../../../src/src/signing/_signTypedData/private_key.ts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"private_key.d.ts","sourceRoot":"","sources":["../../../../src/src/signing/_signTypedData/private_key.ts"],"names":[],"mappings":"AAGA,UAAU,KAAK;IACX,CAAC,IAAI,EAAE,MAAM,GAAG;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KAChB,EAAE,CAAC;CACP;AAED,UAAU,MAAO,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,MAAM,EAAE,CAAC;IACnD,iBAAiB,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAClC,IAAI,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;CACxB;AAED,2CAA2C;AAC3C,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAkBzB;AAsKD,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,MAAM,CAG3E;AAED,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAYrE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { keccak_256 } from "@noble/hashes/sha3";
|
|
2
|
-
import { etc, signAsync, utils } from "@noble/secp256k1";
|
|
2
|
+
import { etc, getPublicKey, signAsync, utils } from "@noble/secp256k1";
|
|
3
3
|
/** Signs typed data with a private key. */
|
|
4
4
|
export async function signTypedData(args) {
|
|
5
5
|
const { privateKey, domain = {}, types, primaryType, message, } = args;
|
|
@@ -47,20 +47,27 @@ function encodeType(primaryType, types) {
|
|
|
47
47
|
const deps = findTypeDependencies(primaryType, types);
|
|
48
48
|
const sortedDeps = [primaryType, ...deps.filter((d) => d !== primaryType).sort()];
|
|
49
49
|
return sortedDeps
|
|
50
|
-
.map((type) => `${type}(${types[type].map((field) => `${field.type} ${field.name}`).join(",")})`)
|
|
50
|
+
.map((type) => `${type}(${types[type].map((field) => `${resolveTypeAlias(field.type)} ${field.name}`).join(",")})`)
|
|
51
51
|
.join("");
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
if (
|
|
53
|
+
function resolveTypeAlias(type) {
|
|
54
|
+
if (type === "uint")
|
|
55
|
+
return "uint256";
|
|
56
|
+
if (type === "int")
|
|
57
|
+
return "int256";
|
|
58
|
+
return type;
|
|
59
|
+
}
|
|
60
|
+
function findTypeDependencies(primaryType, types, _found = new Set()) {
|
|
61
|
+
if (_found.has(primaryType) || !types[primaryType])
|
|
55
62
|
return [];
|
|
56
|
-
|
|
63
|
+
_found.add(primaryType);
|
|
57
64
|
for (const field of types[primaryType]) {
|
|
58
|
-
const baseType = field.type.replace(/\[
|
|
65
|
+
const baseType = field.type.replace(/\[.*?\]/g, "");
|
|
59
66
|
if (types[baseType]) {
|
|
60
|
-
findTypeDependencies(baseType, types,
|
|
67
|
+
findTypeDependencies(baseType, types, _found);
|
|
61
68
|
}
|
|
62
69
|
}
|
|
63
|
-
return Array.from(
|
|
70
|
+
return Array.from(_found);
|
|
64
71
|
}
|
|
65
72
|
function encodeValue(type, value, types) {
|
|
66
73
|
const arrayMatch = type.match(/^(.*)\[(\d*)\]$/);
|
|
@@ -68,10 +75,10 @@ function encodeValue(type, value, types) {
|
|
|
68
75
|
// Extract type info: base type and optional length
|
|
69
76
|
const [, baseType, len] = arrayMatch;
|
|
70
77
|
if (!Array.isArray(value)) {
|
|
71
|
-
throw new Error(`Expected array for ${type}
|
|
78
|
+
throw new Error(`Expected array for ${type}. Received: ${typeof value}`);
|
|
72
79
|
}
|
|
73
80
|
if (len && value.length !== +len) {
|
|
74
|
-
throw new Error(`Invalid length for ${type}: expected ${len}
|
|
81
|
+
throw new Error(`Invalid length for ${type}: expected ${len}. Received: ${value.length}`);
|
|
75
82
|
}
|
|
76
83
|
// Encode each element in the array and hash them together
|
|
77
84
|
const encodedElements = value.map((v) => encodeValue(baseType, v, types));
|
|
@@ -87,8 +94,9 @@ function encodeValue(type, value, types) {
|
|
|
87
94
|
}
|
|
88
95
|
if (type === "address") {
|
|
89
96
|
const bytes = etc.hexToBytes(cleanHex(value));
|
|
90
|
-
if (bytes.length !== 20)
|
|
91
|
-
throw new Error(
|
|
97
|
+
if (bytes.length !== 20) {
|
|
98
|
+
throw new Error(`Address must be 20 bytes.`);
|
|
99
|
+
}
|
|
92
100
|
const padded = new Uint8Array(32);
|
|
93
101
|
padded.set(bytes, 12);
|
|
94
102
|
return padded;
|
|
@@ -96,9 +104,10 @@ function encodeValue(type, value, types) {
|
|
|
96
104
|
if (type.startsWith("uint") || type.startsWith("int")) {
|
|
97
105
|
// Extract type info: uint/int and bit size
|
|
98
106
|
const isUint = type.startsWith("uint");
|
|
99
|
-
const
|
|
107
|
+
const bitsStr = type.slice(isUint ? 4 : 3);
|
|
108
|
+
const bits = parseInt(bitsStr || "256");
|
|
100
109
|
if (bits > 256 || bits % 8 !== 0) {
|
|
101
|
-
throw new Error(`
|
|
110
|
+
throw new Error(`Invalid ${isUint ? "uint" : "int"} size: ${bitsStr}. Must be 8-256 in steps of 8`);
|
|
102
111
|
}
|
|
103
112
|
// Apply Two's complement for specified bit size
|
|
104
113
|
const bigIntValue = BigInt(value);
|
|
@@ -120,18 +129,20 @@ function encodeValue(type, value, types) {
|
|
|
120
129
|
if (bytesMatch) {
|
|
121
130
|
// Extract type info: bytes size
|
|
122
131
|
const size = parseInt(bytesMatch[1]);
|
|
123
|
-
if (size === 0 || size > 32)
|
|
124
|
-
throw new Error(`
|
|
132
|
+
if (size === 0 || size > 32) {
|
|
133
|
+
throw new Error(`bytesN size must be 1-32. Received: ${size}`);
|
|
134
|
+
}
|
|
125
135
|
// Convert hex to bytes
|
|
126
136
|
const bytes = etc.hexToBytes(cleanHex(value));
|
|
127
|
-
if (bytes.length !== size)
|
|
128
|
-
throw new Error(
|
|
137
|
+
if (bytes.length !== size) {
|
|
138
|
+
throw new Error(`${type} requires exactly ${size} bytes. Received: ${bytes.length} from '${value}'`);
|
|
139
|
+
}
|
|
129
140
|
// Pad to 32 bytes
|
|
130
141
|
const padded = new Uint8Array(32);
|
|
131
142
|
padded.set(bytes, 0);
|
|
132
143
|
return padded;
|
|
133
144
|
}
|
|
134
|
-
throw new Error(`Unsupported type: ${type}
|
|
145
|
+
throw new Error(`Unsupported type: '${type}'.`);
|
|
135
146
|
}
|
|
136
147
|
function cleanHex(hex) {
|
|
137
148
|
return hex.startsWith("0x") ? hex.slice(2) : hex;
|
|
@@ -142,3 +153,13 @@ export function isValidPrivateKey(privateKey) {
|
|
|
142
153
|
return false;
|
|
143
154
|
return utils.isValidPrivateKey(cleanHex(privateKey));
|
|
144
155
|
}
|
|
156
|
+
/** Converts a private key to an Ethereum address. */
|
|
157
|
+
export function privateKeyToAddress(privateKey) {
|
|
158
|
+
const cleanPrivKey = cleanHex(privateKey);
|
|
159
|
+
const publicKey = getPublicKey(cleanPrivKey, false);
|
|
160
|
+
const publicKeyWithoutPrefix = publicKey.slice(1);
|
|
161
|
+
const hash = keccak_256(publicKeyWithoutPrefix);
|
|
162
|
+
const addressBytes = hash.slice(-20);
|
|
163
|
+
const address = etc.bytesToHex(addressBytes);
|
|
164
|
+
return `0x${address}`;
|
|
165
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface AbstractViemWalletClient {
|
|
1
|
+
/** Abstract interface for a viem {@link https://viem.sh/docs/accounts/jsonRpc#json-rpc-account | JSON-RPC Account}. */
|
|
2
|
+
export interface AbstractViemJsonRpcAccount {
|
|
4
3
|
signTypedData(params: {
|
|
5
4
|
domain: {
|
|
6
5
|
name: string;
|
|
7
6
|
version: string;
|
|
8
7
|
chainId: number;
|
|
9
|
-
verifyingContract:
|
|
8
|
+
verifyingContract: `0x${string}`;
|
|
10
9
|
};
|
|
11
10
|
types: {
|
|
12
11
|
[key: string]: {
|
|
@@ -16,8 +15,30 @@ export interface AbstractViemWalletClient {
|
|
|
16
15
|
};
|
|
17
16
|
primaryType: string;
|
|
18
17
|
message: Record<string, unknown>;
|
|
19
|
-
}, options?: unknown): Promise
|
|
18
|
+
}, options?: unknown): Promise<`0x${string}`>;
|
|
19
|
+
getAddresses?(): Promise<`0x${string}`[]>;
|
|
20
|
+
getChainId?(): Promise<number>;
|
|
21
|
+
}
|
|
22
|
+
/** Abstract interface for a viem {@link https://viem.sh/docs/accounts/local | Local Account}. */
|
|
23
|
+
export interface AbstractViemLocalAccount {
|
|
24
|
+
signTypedData(params: {
|
|
25
|
+
domain: {
|
|
26
|
+
name: string;
|
|
27
|
+
version: string;
|
|
28
|
+
chainId: number;
|
|
29
|
+
verifyingContract: `0x${string}`;
|
|
30
|
+
};
|
|
31
|
+
types: {
|
|
32
|
+
[key: string]: {
|
|
33
|
+
name: string;
|
|
34
|
+
type: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
primaryType: string;
|
|
38
|
+
message: Record<string, unknown>;
|
|
39
|
+
}, options?: unknown): Promise<`0x${string}`>;
|
|
40
|
+
address?: `0x${string}`;
|
|
20
41
|
}
|
|
21
42
|
/** Checks if the given value is an abstract viem wallet. */
|
|
22
|
-
export declare function
|
|
43
|
+
export declare function isAbstractViemWallet(client: unknown): client is AbstractViemJsonRpcAccount | AbstractViemLocalAccount;
|
|
23
44
|
//# sourceMappingURL=viem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viem.d.ts","sourceRoot":"","sources":["../../../../src/src/signing/_signTypedData/viem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"viem.d.ts","sourceRoot":"","sources":["../../../../src/src/signing/_signTypedData/viem.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,MAAM,WAAW,0BAA0B;IACvC,aAAa,CACT,MAAM,EAAE;QACJ,MAAM,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,iBAAiB,EAAE,KAAK,MAAM,EAAE,CAAC;SACpC,CAAC;QACF,KAAK,EAAE;YACH,CAAC,GAAG,EAAE,MAAM,GAAG;gBACX,IAAI,EAAE,MAAM,CAAC;gBACb,IAAI,EAAE,MAAM,CAAC;aAChB,EAAE,CAAC;SACP,CAAC;QACF,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,EACD,OAAO,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC;IAC1B,YAAY,CAAC,IAAI,OAAO,CAAC,KAAK,MAAM,EAAE,EAAE,CAAC,CAAC;IAC1C,UAAU,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,iGAAiG;AACjG,MAAM,WAAW,wBAAwB;IACrC,aAAa,CACT,MAAM,EAAE;QACJ,MAAM,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,iBAAiB,EAAE,KAAK,MAAM,EAAE,CAAC;SACpC,CAAC;QACF,KAAK,EAAE;YACH,CAAC,GAAG,EAAE,MAAM,GAAG;gBACX,IAAI,EAAE,MAAM,CAAC;gBACb,IAAI,EAAE,MAAM,CAAC;aAChB,EAAE,CAAC;SACP,CAAC;QACF,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,EACD,OAAO,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;CAC3B;AAED,4DAA4D;AAC5D,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,0BAA0B,GAAG,wBAAwB,CAIrH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Checks if the given value is an abstract viem wallet. */
|
|
2
|
-
export function
|
|
2
|
+
export function isAbstractViemWallet(client) {
|
|
3
3
|
return typeof client === "object" && client !== null &&
|
|
4
4
|
"signTypedData" in client && typeof client.signTypedData === "function" &&
|
|
5
5
|
(client.signTypedData.length === 1 || client.signTypedData.length === 2);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { ApproveAgentRequest, ApproveBuilderFeeRequest, BatchModifyRequest, CancelByCloidRequest, CancelRequest, CDepositRequest, ClaimRewardsRequest, ConvertToMultiSigUserRequest, ConvertToMultiSigUserRequestWithoutStringify, CreateSubAccountRequest, CreateVaultRequest, CSignerActionRequest, CValidatorActionRequest, CWithdrawRequest, EvmUserModifyRequest, ModifyRequest, MultiSigRequest, NoopRequest, OrderRequest, PerpDeployRequest, RegisterReferrerRequest, ReserveRequestWeightRequest, ScheduleCancelRequest, SendAssetRequest, SetDisplayNameRequest, SetReferrerRequest, SpotDeployRequest, SpotSendRequest, SpotUserRequest, SubAccountModifyRequest, SubAccountSpotTransferRequest, SubAccountTransferRequest, TokenDelegateRequest, TwapCancelRequest, TwapOrderRequest, UpdateIsolatedMarginRequest, UpdateLeverageRequest, UsdClassTransferRequest, UsdSendRequest, VaultDistributeRequest, VaultModifyRequest, VaultTransferRequest, Withdraw3Request } from "../types/mod.js";
|
|
2
|
+
/** @see https://github.com/microsoft/TypeScript/issues/13923#issuecomment-2191862501 */
|
|
3
|
+
type DeepImmutable<T> = {
|
|
4
|
+
readonly [K in keyof T]: DeepImmutable<T[K]>;
|
|
5
|
+
};
|
|
3
6
|
/** Action sorter and formatter for correct signature generation. */
|
|
4
7
|
export declare const actionSorter: {
|
|
5
8
|
approveAgent: (action: DeepImmutable<ApproveAgentRequest["action"]>) => ApproveAgentRequest["action"];
|
|
@@ -9,27 +12,28 @@ export declare const actionSorter: {
|
|
|
9
12
|
cancelByCloid: (action: DeepImmutable<CancelByCloidRequest["action"]>) => CancelByCloidRequest["action"];
|
|
10
13
|
cDeposit: (action: DeepImmutable<CDepositRequest["action"]>) => CDepositRequest["action"];
|
|
11
14
|
claimRewards: (action: DeepImmutable<ClaimRewardsRequest["action"]>) => ClaimRewardsRequest["action"];
|
|
12
|
-
convertToMultiSigUser: (action: DeepImmutable<ConvertToMultiSigUserRequest["action"]>) => ConvertToMultiSigUserRequest["action"];
|
|
15
|
+
convertToMultiSigUser: (action: DeepImmutable<ConvertToMultiSigUserRequest["action"] | ConvertToMultiSigUserRequestWithoutStringify["action"]>) => ConvertToMultiSigUserRequest["action"];
|
|
13
16
|
createSubAccount: (action: DeepImmutable<CreateSubAccountRequest["action"]>) => CreateSubAccountRequest["action"];
|
|
14
17
|
createVault: (action: DeepImmutable<CreateVaultRequest["action"]>) => CreateVaultRequest["action"];
|
|
15
|
-
CSignerAction: (action: DeepImmutable<
|
|
16
|
-
CValidatorAction: (action: DeepImmutable<
|
|
18
|
+
CSignerAction: (action: DeepImmutable<CSignerActionRequest["action"]>) => CSignerActionRequest["action"];
|
|
19
|
+
CValidatorAction: (action: DeepImmutable<CValidatorActionRequest["action"]>) => CValidatorActionRequest["action"];
|
|
17
20
|
cWithdraw: (action: DeepImmutable<CWithdrawRequest["action"]>) => CWithdrawRequest["action"];
|
|
18
21
|
evmUserModify: (action: DeepImmutable<EvmUserModifyRequest["action"]>) => EvmUserModifyRequest["action"];
|
|
19
22
|
modify: (action: DeepImmutable<ModifyRequest["action"]>) => ModifyRequest["action"];
|
|
20
23
|
multiSig: (action: DeepImmutable<MultiSigRequest["action"]>) => MultiSigRequest["action"];
|
|
24
|
+
noop: (action: DeepImmutable<NoopRequest["action"]>) => NoopRequest["action"];
|
|
21
25
|
order: (action: DeepImmutable<OrderRequest["action"]>) => OrderRequest["action"];
|
|
22
|
-
perpDeploy: (action: DeepImmutable<
|
|
23
|
-
PerpDexClassTransfer: (action: DeepImmutable<PerpDexClassTransferRequest["action"]>) => PerpDexClassTransferRequest["action"];
|
|
24
|
-
PerpDexTransfer: (action: DeepImmutable<PerpDexTransferRequest["action"]>) => PerpDexTransferRequest["action"];
|
|
26
|
+
perpDeploy: (action: DeepImmutable<PerpDeployRequest["action"]>) => PerpDeployRequest["action"];
|
|
25
27
|
registerReferrer: (action: DeepImmutable<RegisterReferrerRequest["action"]>) => RegisterReferrerRequest["action"];
|
|
26
28
|
reserveRequestWeight: (action: DeepImmutable<ReserveRequestWeightRequest["action"]>) => ReserveRequestWeightRequest["action"];
|
|
27
29
|
scheduleCancel: (action: DeepImmutable<ScheduleCancelRequest["action"]>) => ScheduleCancelRequest["action"];
|
|
30
|
+
sendAsset: (action: DeepImmutable<SendAssetRequest["action"]>) => SendAssetRequest["action"];
|
|
28
31
|
setDisplayName: (action: DeepImmutable<SetDisplayNameRequest["action"]>) => SetDisplayNameRequest["action"];
|
|
29
32
|
setReferrer: (action: DeepImmutable<SetReferrerRequest["action"]>) => SetReferrerRequest["action"];
|
|
30
|
-
spotDeploy: (action: DeepImmutable<
|
|
33
|
+
spotDeploy: (action: DeepImmutable<SpotDeployRequest["action"]>) => SpotDeployRequest["action"];
|
|
31
34
|
spotSend: (action: DeepImmutable<SpotSendRequest["action"]>) => SpotSendRequest["action"];
|
|
32
35
|
spotUser: (action: DeepImmutable<SpotUserRequest["action"]>) => SpotUserRequest["action"];
|
|
36
|
+
subAccountModify: (action: DeepImmutable<SubAccountModifyRequest["action"]>) => SubAccountModifyRequest["action"];
|
|
33
37
|
subAccountSpotTransfer: (action: DeepImmutable<SubAccountSpotTransferRequest["action"]>) => SubAccountSpotTransferRequest["action"];
|
|
34
38
|
subAccountTransfer: (action: DeepImmutable<SubAccountTransferRequest["action"]>) => SubAccountTransferRequest["action"];
|
|
35
39
|
tokenDelegate: (action: DeepImmutable<TokenDelegateRequest["action"]>) => TokenDelegateRequest["action"];
|
|
@@ -76,20 +80,14 @@ export declare const userSignedActionEip712Types: {
|
|
|
76
80
|
type: string;
|
|
77
81
|
}[];
|
|
78
82
|
};
|
|
79
|
-
|
|
80
|
-
"HyperliquidTransaction:
|
|
81
|
-
name: string;
|
|
82
|
-
type: string;
|
|
83
|
-
}[];
|
|
84
|
-
};
|
|
85
|
-
PerpDexTransfer: {
|
|
86
|
-
"HyperliquidTransaction:PerpDexTransfer": {
|
|
83
|
+
multiSig: {
|
|
84
|
+
"HyperliquidTransaction:SendMultiSig": {
|
|
87
85
|
name: string;
|
|
88
86
|
type: string;
|
|
89
87
|
}[];
|
|
90
88
|
};
|
|
91
|
-
|
|
92
|
-
"HyperliquidTransaction:
|
|
89
|
+
sendAsset: {
|
|
90
|
+
"HyperliquidTransaction:SendAsset": {
|
|
93
91
|
name: string;
|
|
94
92
|
type: string;
|
|
95
93
|
}[];
|
|
@@ -125,4 +123,5 @@ export declare const userSignedActionEip712Types: {
|
|
|
125
123
|
}[];
|
|
126
124
|
};
|
|
127
125
|
};
|
|
126
|
+
export {};
|
|
128
127
|
//# sourceMappingURL=_sorter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_sorter.d.ts","sourceRoot":"","sources":["../../../src/src/signing/_sorter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"_sorter.d.ts","sourceRoot":"","sources":["../../../src/src/signing/_sorter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,4BAA4B,EAC5B,4CAA4C,EAC5C,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,6BAA6B,EAC7B,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,uBAAuB,EACvB,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,wFAAwF;AACxF,K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