@nktkas/hyperliquid 0.16.0 → 0.17.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 +58 -106
- package/esm/src/clients/event.d.ts.map +1 -1
- package/esm/src/clients/event.js +0 -1
- package/esm/src/clients/public.d.ts +4 -4
- package/esm/src/clients/public.d.ts.map +1 -1
- package/esm/src/clients/public.js +4 -7
- package/esm/src/clients/wallet.d.ts +129 -132
- package/esm/src/clients/wallet.d.ts.map +1 -1
- package/esm/src/clients/wallet.js +290 -268
- package/esm/src/signing.d.ts +149 -32
- package/esm/src/signing.d.ts.map +1 -1
- package/esm/src/signing.js +123 -15
- package/esm/src/transports/http/http_transport.d.ts +14 -24
- package/esm/src/transports/http/http_transport.d.ts.map +1 -1
- package/esm/src/transports/http/http_transport.js +20 -15
- package/esm/src/transports/websocket/websocket_transport.d.ts +6 -2
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/types/exchange/requests.d.ts +52 -38
- package/esm/src/types/exchange/requests.d.ts.map +1 -1
- package/esm/src/types/info/accounts.d.ts +4 -0
- package/esm/src/types/info/accounts.d.ts.map +1 -1
- package/esm/src/types/info/assets.d.ts +4 -6
- package/esm/src/types/info/assets.d.ts.map +1 -1
- package/esm/src/types/info/orders.d.ts +28 -20
- package/esm/src/types/info/orders.d.ts.map +1 -1
- package/esm/src/types/info/requests.d.ts +8 -8
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/esm/src/types/info/vaults.d.ts +2 -0
- package/esm/src/types/info/vaults.d.ts.map +1 -1
- package/esm/src/types/mod.d.ts +21 -0
- package/esm/src/types/mod.d.ts.map +1 -1
- package/esm/src/types/mod.js +21 -0
- package/esm/src/types/subscriptions/requests.d.ts +5 -14
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/package.json +4 -1
- package/script/src/clients/event.d.ts.map +1 -1
- package/script/src/clients/event.js +0 -1
- package/script/src/clients/public.d.ts +4 -4
- package/script/src/clients/public.d.ts.map +1 -1
- package/script/src/clients/public.js +4 -7
- package/script/src/clients/wallet.d.ts +129 -132
- package/script/src/clients/wallet.d.ts.map +1 -1
- package/script/src/clients/wallet.js +290 -268
- package/script/src/signing.d.ts +149 -32
- package/script/src/signing.d.ts.map +1 -1
- package/script/src/signing.js +124 -16
- package/script/src/transports/http/http_transport.d.ts +14 -24
- package/script/src/transports/http/http_transport.d.ts.map +1 -1
- package/script/src/transports/http/http_transport.js +20 -15
- package/script/src/transports/websocket/websocket_transport.d.ts +6 -2
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/types/exchange/requests.d.ts +52 -38
- package/script/src/types/exchange/requests.d.ts.map +1 -1
- package/script/src/types/info/accounts.d.ts +4 -0
- package/script/src/types/info/accounts.d.ts.map +1 -1
- package/script/src/types/info/assets.d.ts +4 -6
- package/script/src/types/info/assets.d.ts.map +1 -1
- package/script/src/types/info/orders.d.ts +28 -20
- package/script/src/types/info/orders.d.ts.map +1 -1
- package/script/src/types/info/requests.d.ts +8 -8
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/info/vaults.d.ts +2 -0
- package/script/src/types/info/vaults.d.ts.map +1 -1
- package/script/src/types/mod.d.ts +21 -0
- package/script/src/types/mod.d.ts.map +1 -1
- package/script/src/types/mod.js +21 -0
- package/script/src/types/subscriptions/requests.d.ts +5 -14
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
package/esm/src/signing.d.ts
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module contains functions for generating Hyperliquid transaction signatures
|
|
3
|
+
* and interfaces to various wallet implementations.
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { signL1Action } from "@nktkas/hyperliquid/signing";
|
|
7
|
+
*
|
|
8
|
+
* const action = {
|
|
9
|
+
* type: "cancel",
|
|
10
|
+
* cancels: [{ a: 0, o: 12345 }],
|
|
11
|
+
* };
|
|
12
|
+
* const nonce = Date.now();
|
|
13
|
+
*
|
|
14
|
+
* const signature = await signL1Action({
|
|
15
|
+
* wallet,
|
|
16
|
+
* action,
|
|
17
|
+
* nonce,
|
|
18
|
+
* isTestnet: true, // Change to false for mainnet
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { signUserSignedAction } from "@nktkas/hyperliquid/signing";
|
|
24
|
+
*
|
|
25
|
+
* const action = {
|
|
26
|
+
* type: "approveAgent",
|
|
27
|
+
* hyperliquidChain: "Testnet", // "Mainnet" or "Testnet"
|
|
28
|
+
* signatureChainId: "0x66eee",
|
|
29
|
+
* nonce: Date.now(),
|
|
30
|
+
* agentAddress: "0x...",
|
|
31
|
+
* agentName: "Agent",
|
|
32
|
+
* };
|
|
33
|
+
*
|
|
34
|
+
* const signature = await signUserSignedAction({
|
|
35
|
+
* wallet,
|
|
36
|
+
* action,
|
|
37
|
+
* types: {
|
|
38
|
+
* "HyperliquidTransaction:ApproveAgent": [
|
|
39
|
+
* { name: "hyperliquidChain", type: "string" },
|
|
40
|
+
* { name: "agentAddress", type: "address" },
|
|
41
|
+
* { name: "agentName", type: "string" },
|
|
42
|
+
* { name: "nonce", type: "uint64" },
|
|
43
|
+
* ],
|
|
44
|
+
* },
|
|
45
|
+
* chainId: parseInt(action.signatureChainId, 16),
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
* @module
|
|
49
|
+
*/
|
|
1
50
|
import { type ValueMap, type ValueType } from "../deps/jsr.io/@std/msgpack/1.0.3/encode.js";
|
|
2
51
|
import type { Hex } from "./base.js";
|
|
3
52
|
export type { Hex };
|
|
@@ -21,25 +70,6 @@ export interface AbstractViemWalletClient {
|
|
|
21
70
|
message: Record<string, unknown>;
|
|
22
71
|
}): Promise<Hex>;
|
|
23
72
|
}
|
|
24
|
-
/** Abstract interface for an extended [viem wallet](https://viem.sh/docs/clients/wallet) (e.g. privy [useSignTypedData](https://docs.privy.io/reference/sdk/react-auth/functions/useSignTypedData#returns)). */
|
|
25
|
-
export interface AbstractExtendedViemWalletClient {
|
|
26
|
-
signTypedData(params: {
|
|
27
|
-
domain: {
|
|
28
|
-
name: string;
|
|
29
|
-
version: string;
|
|
30
|
-
chainId: number;
|
|
31
|
-
verifyingContract: Hex;
|
|
32
|
-
};
|
|
33
|
-
types: {
|
|
34
|
-
[key: string]: {
|
|
35
|
-
name: string;
|
|
36
|
-
type: string;
|
|
37
|
-
}[];
|
|
38
|
-
};
|
|
39
|
-
primaryType: string;
|
|
40
|
-
message: Record<string, unknown>;
|
|
41
|
-
}, options?: unknown): Promise<Hex>;
|
|
42
|
-
}
|
|
43
73
|
/** Abstract interface for an [ethers.js signer](https://docs.ethers.org/v6/api/providers/#Signer). */
|
|
44
74
|
export interface AbstractEthersSigner {
|
|
45
75
|
signTypedData(domain: {
|
|
@@ -68,6 +98,25 @@ export interface AbstractEthersV5Signer {
|
|
|
68
98
|
}[];
|
|
69
99
|
}, value: Record<string, unknown>): Promise<string>;
|
|
70
100
|
}
|
|
101
|
+
/** Abstract interface for an extended [viem wallet](https://viem.sh/docs/clients/wallet) (e.g. privy [useSignTypedData](https://docs.privy.io/reference/sdk/react-auth/functions/useSignTypedData#returns)). */
|
|
102
|
+
export interface AbstractExtendedViemWalletClient {
|
|
103
|
+
signTypedData(params: {
|
|
104
|
+
domain: {
|
|
105
|
+
name: string;
|
|
106
|
+
version: string;
|
|
107
|
+
chainId: number;
|
|
108
|
+
verifyingContract: Hex;
|
|
109
|
+
};
|
|
110
|
+
types: {
|
|
111
|
+
[key: string]: {
|
|
112
|
+
name: string;
|
|
113
|
+
type: string;
|
|
114
|
+
}[];
|
|
115
|
+
};
|
|
116
|
+
primaryType: string;
|
|
117
|
+
message: Record<string, unknown>;
|
|
118
|
+
}, options?: unknown): Promise<Hex>;
|
|
119
|
+
}
|
|
71
120
|
/** Abstract interface for a [window.ethereum](https://eips.ethereum.org/EIPS/eip-1193) object. */
|
|
72
121
|
export interface AbstractWindowEthereum {
|
|
73
122
|
request(args: {
|
|
@@ -89,18 +138,48 @@ export declare function createL1ActionHash(action: ValueType, nonce: number, vau
|
|
|
89
138
|
* Sign an L1 action.
|
|
90
139
|
*
|
|
91
140
|
* Note: Signature generation depends on the order of the action keys.
|
|
92
|
-
* @param args
|
|
93
|
-
* @param args.action - The action to be signed.
|
|
94
|
-
* @param args.nonce - Unique request identifier (recommended current timestamp in ms).
|
|
95
|
-
* @param args.isTestnet - Indicates if the action is for the testnet. Default is `false`.
|
|
96
|
-
* @param args.vaultAddress - Optional vault address used in the action.
|
|
141
|
+
* @param args - Arguments for signing the action.
|
|
97
142
|
* @returns The signature components r, s, and v.
|
|
143
|
+
* @example
|
|
144
|
+
* ```ts
|
|
145
|
+
* import { signL1Action } from "@nktkas/hyperliquid/signing";
|
|
146
|
+
* import { privateKeyToAccount } from "viem/accounts";
|
|
147
|
+
*
|
|
148
|
+
* const wallet = privateKeyToAccount("0x..."); // Change to your private key
|
|
149
|
+
*
|
|
150
|
+
* const action = {
|
|
151
|
+
* type: "cancel",
|
|
152
|
+
* cancels: [
|
|
153
|
+
* { a: 0, o: 12345 }, // Asset index and order ID
|
|
154
|
+
* ],
|
|
155
|
+
* };
|
|
156
|
+
* const nonce = Date.now();
|
|
157
|
+
*
|
|
158
|
+
* const signature = await signL1Action({
|
|
159
|
+
* wallet,
|
|
160
|
+
* action,
|
|
161
|
+
* nonce,
|
|
162
|
+
* isTestnet: true, // Change to false for mainnet
|
|
163
|
+
* });
|
|
164
|
+
*
|
|
165
|
+
* const response = await fetch("https://api.hyperliquid-testnet.xyz/exchange", {
|
|
166
|
+
* method: "POST",
|
|
167
|
+
* headers: { "Content-Type": "application/json" },
|
|
168
|
+
* body: JSON.stringify({ action, signature, nonce }),
|
|
169
|
+
* });
|
|
170
|
+
* const body = await response.json();
|
|
171
|
+
* ```
|
|
98
172
|
*/
|
|
99
173
|
export declare function signL1Action(args: {
|
|
100
|
-
|
|
174
|
+
/** Wallet to sign the action. */
|
|
175
|
+
wallet: AbstractViemWalletClient | AbstractEthersSigner | AbstractEthersV5Signer | AbstractExtendedViemWalletClient | AbstractWindowEthereum;
|
|
176
|
+
/** The action to be signed. */
|
|
101
177
|
action: ValueType;
|
|
178
|
+
/** Unique request identifier (recommended current timestamp in ms). */
|
|
102
179
|
nonce: number;
|
|
180
|
+
/** Indicates if the action is for the testnet. Default is `false`. */
|
|
103
181
|
isTestnet?: boolean;
|
|
182
|
+
/** Optional vault address used in the action. */
|
|
104
183
|
vaultAddress?: Hex;
|
|
105
184
|
}): Promise<{
|
|
106
185
|
r: Hex;
|
|
@@ -111,21 +190,59 @@ export declare function signL1Action(args: {
|
|
|
111
190
|
* Sign a user-signed action.
|
|
112
191
|
*
|
|
113
192
|
* Note: Signature generation depends on the order of types.
|
|
114
|
-
* @param args
|
|
115
|
-
* @param args.action - The action to be signed.
|
|
116
|
-
* @param args.types - The types of the action.
|
|
117
|
-
* @param args.chainId - The chain ID.
|
|
193
|
+
* @param args - Arguments for signing the action.
|
|
118
194
|
* @returns The signature components r, s, and v.
|
|
195
|
+
* @example
|
|
196
|
+
* ```ts
|
|
197
|
+
* import { signUserSignedAction } from "@nktkas/hyperliquid/signing";
|
|
198
|
+
* import { privateKeyToAccount } from "viem/accounts";
|
|
199
|
+
*
|
|
200
|
+
* const wallet = privateKeyToAccount("0x..."); // Change to your private key
|
|
201
|
+
*
|
|
202
|
+
* const action = {
|
|
203
|
+
* type: "approveAgent",
|
|
204
|
+
* hyperliquidChain: "Testnet", // "Mainnet" or "Testnet"
|
|
205
|
+
* signatureChainId: "0x66eee",
|
|
206
|
+
* nonce: Date.now(),
|
|
207
|
+
* agentAddress: "0x...", // Change to your agent address
|
|
208
|
+
* agentName: "Agent",
|
|
209
|
+
* };
|
|
210
|
+
*
|
|
211
|
+
* const signature = await signUserSignedAction({
|
|
212
|
+
* wallet,
|
|
213
|
+
* action,
|
|
214
|
+
* types: {
|
|
215
|
+
* "HyperliquidTransaction:ApproveAgent": [
|
|
216
|
+
* { name: "hyperliquidChain", type: "string" },
|
|
217
|
+
* { name: "agentAddress", type: "address" },
|
|
218
|
+
* { name: "agentName", type: "string" },
|
|
219
|
+
* { name: "nonce", type: "uint64" },
|
|
220
|
+
* ],
|
|
221
|
+
* },
|
|
222
|
+
* chainId: parseInt(action.signatureChainId, 16),
|
|
223
|
+
* });
|
|
224
|
+
*
|
|
225
|
+
* const response = await fetch("https://api.hyperliquid-testnet.xyz/exchange", {
|
|
226
|
+
* method: "POST",
|
|
227
|
+
* headers: { "Content-Type": "application/json" },
|
|
228
|
+
* body: JSON.stringify({ action, signature, nonce: action.nonce }),
|
|
229
|
+
* });
|
|
230
|
+
* const body = await response.json();
|
|
231
|
+
* ```
|
|
119
232
|
*/
|
|
120
233
|
export declare function signUserSignedAction(args: {
|
|
121
|
-
|
|
234
|
+
/** Wallet to sign the action. */
|
|
235
|
+
wallet: AbstractViemWalletClient | AbstractEthersSigner | AbstractEthersV5Signer | AbstractExtendedViemWalletClient | AbstractWindowEthereum;
|
|
236
|
+
/** The action to be signed. */
|
|
122
237
|
action: Record<string, unknown>;
|
|
238
|
+
/** The types of the action. */
|
|
123
239
|
types: {
|
|
124
240
|
[key: string]: {
|
|
125
241
|
name: string;
|
|
126
242
|
type: string;
|
|
127
243
|
}[];
|
|
128
244
|
};
|
|
245
|
+
/** The chain ID. */
|
|
129
246
|
chainId: number;
|
|
130
247
|
}): Promise<{
|
|
131
248
|
r: Hex;
|
|
@@ -134,12 +251,12 @@ export declare function signUserSignedAction(args: {
|
|
|
134
251
|
}>;
|
|
135
252
|
/** Checks if the given value is an abstract viem wallet. */
|
|
136
253
|
export declare function isAbstractViemWalletClient(client: unknown): client is AbstractViemWalletClient;
|
|
137
|
-
/** Checks if the given value is an abstract extended viem wallet (e.g. privy `useSignTypedData`). */
|
|
138
|
-
export declare function isAbstractExtendedViemWalletClient(client: unknown): client is AbstractViemWalletClient;
|
|
139
254
|
/** Checks if the given value is an abstract ethers signer. */
|
|
140
255
|
export declare function isAbstractEthersSigner(client: unknown): client is AbstractEthersSigner;
|
|
141
256
|
/** Checks if the given value is an abstract ethers v5 signer. */
|
|
142
257
|
export declare function isAbstractEthersV5Signer(client: unknown): client is AbstractEthersV5Signer;
|
|
258
|
+
/** Checks if the given value is an abstract extended viem wallet (e.g. privy `useSignTypedData`). */
|
|
259
|
+
export declare function isAbstractExtendedViemWalletClient(client: unknown): client is AbstractViemWalletClient;
|
|
143
260
|
/** Checks if the given value is an abstract `window.ethereum` object. */
|
|
144
261
|
export declare function isAbstractWindowEthereum(client: unknown): client is AbstractWindowEthereum;
|
|
145
262
|
//# sourceMappingURL=signing.d.ts.map
|
package/esm/src/signing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signing.d.ts","sourceRoot":"","sources":["../../src/src/signing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signing.d.ts","sourceRoot":"","sources":["../../src/src/signing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAGH,OAAO,EAAU,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAEpG,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC,YAAY,EAAE,GAAG,EAAE,CAAC;AACpB,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AAEpC,mFAAmF;AACnF,MAAM,WAAW,wBAAwB;IACrC,aAAa,CAAC,MAAM,EAAE;QAClB,MAAM,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,iBAAiB,EAAE,GAAG,CAAC;SAC1B,CAAC;QACF,KAAK,EAAE;YACH,CAAC,GAAG,EAAE,MAAM,GAAG;gBACX,IAAI,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;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC7C,iCAAiC;IACjC,MAAM,EACA,wBAAwB,GACxB,oBAAoB,GACpB,sBAAsB,GACtB,gCAAgC,GAChC,sBAAsB,CAAC;IAC7B,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,+BAA+B;IAC/B,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,CAAC;IAC3D,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC;IAAE,CAAC,EAAE,GAAG,CAAC;IAAC,CAAC,EAAE,GAAG,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAYzC;AA6FD,4DAA4D;AAC5D,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,wBAAwB,CAI9F;AAED,8DAA8D;AAC9D,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,oBAAoB,CAItF;AAED,iEAAiE;AACjE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,sBAAsB,CAI1F;AAED,qGAAqG;AACrG,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,wBAAwB,CAItG;AAED,yEAAyE;AACzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,sBAAsB,CAI1F"}
|
package/esm/src/signing.js
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module contains functions for generating Hyperliquid transaction signatures
|
|
3
|
+
* and interfaces to various wallet implementations.
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { signL1Action } from "@nktkas/hyperliquid/signing";
|
|
7
|
+
*
|
|
8
|
+
* const action = {
|
|
9
|
+
* type: "cancel",
|
|
10
|
+
* cancels: [{ a: 0, o: 12345 }],
|
|
11
|
+
* };
|
|
12
|
+
* const nonce = Date.now();
|
|
13
|
+
*
|
|
14
|
+
* const signature = await signL1Action({
|
|
15
|
+
* wallet,
|
|
16
|
+
* action,
|
|
17
|
+
* nonce,
|
|
18
|
+
* isTestnet: true, // Change to false for mainnet
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { signUserSignedAction } from "@nktkas/hyperliquid/signing";
|
|
24
|
+
*
|
|
25
|
+
* const action = {
|
|
26
|
+
* type: "approveAgent",
|
|
27
|
+
* hyperliquidChain: "Testnet", // "Mainnet" or "Testnet"
|
|
28
|
+
* signatureChainId: "0x66eee",
|
|
29
|
+
* nonce: Date.now(),
|
|
30
|
+
* agentAddress: "0x...",
|
|
31
|
+
* agentName: "Agent",
|
|
32
|
+
* };
|
|
33
|
+
*
|
|
34
|
+
* const signature = await signUserSignedAction({
|
|
35
|
+
* wallet,
|
|
36
|
+
* action,
|
|
37
|
+
* types: {
|
|
38
|
+
* "HyperliquidTransaction:ApproveAgent": [
|
|
39
|
+
* { name: "hyperliquidChain", type: "string" },
|
|
40
|
+
* { name: "agentAddress", type: "address" },
|
|
41
|
+
* { name: "agentName", type: "string" },
|
|
42
|
+
* { name: "nonce", type: "uint64" },
|
|
43
|
+
* ],
|
|
44
|
+
* },
|
|
45
|
+
* chainId: parseInt(action.signatureChainId, 16),
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
* @module
|
|
49
|
+
*/
|
|
1
50
|
import { keccak_256 } from "../deps/jsr.io/@noble/hashes/1.7.1/src/sha3.js";
|
|
2
51
|
import { encode } from "../deps/jsr.io/@std/msgpack/1.0.3/encode.js";
|
|
3
52
|
import { decodeHex, encodeHex } from "../deps/jsr.io/@std/encoding/1.0.7/hex.js";
|
|
@@ -50,12 +99,37 @@ function normalizeIntegersForMsgPack(obj) {
|
|
|
50
99
|
* Sign an L1 action.
|
|
51
100
|
*
|
|
52
101
|
* Note: Signature generation depends on the order of the action keys.
|
|
53
|
-
* @param args
|
|
54
|
-
* @param args.action - The action to be signed.
|
|
55
|
-
* @param args.nonce - Unique request identifier (recommended current timestamp in ms).
|
|
56
|
-
* @param args.isTestnet - Indicates if the action is for the testnet. Default is `false`.
|
|
57
|
-
* @param args.vaultAddress - Optional vault address used in the action.
|
|
102
|
+
* @param args - Arguments for signing the action.
|
|
58
103
|
* @returns The signature components r, s, and v.
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* import { signL1Action } from "@nktkas/hyperliquid/signing";
|
|
107
|
+
* import { privateKeyToAccount } from "viem/accounts";
|
|
108
|
+
*
|
|
109
|
+
* const wallet = privateKeyToAccount("0x..."); // Change to your private key
|
|
110
|
+
*
|
|
111
|
+
* const action = {
|
|
112
|
+
* type: "cancel",
|
|
113
|
+
* cancels: [
|
|
114
|
+
* { a: 0, o: 12345 }, // Asset index and order ID
|
|
115
|
+
* ],
|
|
116
|
+
* };
|
|
117
|
+
* const nonce = Date.now();
|
|
118
|
+
*
|
|
119
|
+
* const signature = await signL1Action({
|
|
120
|
+
* wallet,
|
|
121
|
+
* action,
|
|
122
|
+
* nonce,
|
|
123
|
+
* isTestnet: true, // Change to false for mainnet
|
|
124
|
+
* });
|
|
125
|
+
*
|
|
126
|
+
* const response = await fetch("https://api.hyperliquid-testnet.xyz/exchange", {
|
|
127
|
+
* method: "POST",
|
|
128
|
+
* headers: { "Content-Type": "application/json" },
|
|
129
|
+
* body: JSON.stringify({ action, signature, nonce }),
|
|
130
|
+
* });
|
|
131
|
+
* const body = await response.json();
|
|
132
|
+
* ```
|
|
59
133
|
*/
|
|
60
134
|
export async function signL1Action(args) {
|
|
61
135
|
const { wallet, action, nonce, isTestnet = false, vaultAddress, } = args;
|
|
@@ -83,11 +157,45 @@ export async function signL1Action(args) {
|
|
|
83
157
|
* Sign a user-signed action.
|
|
84
158
|
*
|
|
85
159
|
* Note: Signature generation depends on the order of types.
|
|
86
|
-
* @param args
|
|
87
|
-
* @param args.action - The action to be signed.
|
|
88
|
-
* @param args.types - The types of the action.
|
|
89
|
-
* @param args.chainId - The chain ID.
|
|
160
|
+
* @param args - Arguments for signing the action.
|
|
90
161
|
* @returns The signature components r, s, and v.
|
|
162
|
+
* @example
|
|
163
|
+
* ```ts
|
|
164
|
+
* import { signUserSignedAction } from "@nktkas/hyperliquid/signing";
|
|
165
|
+
* import { privateKeyToAccount } from "viem/accounts";
|
|
166
|
+
*
|
|
167
|
+
* const wallet = privateKeyToAccount("0x..."); // Change to your private key
|
|
168
|
+
*
|
|
169
|
+
* const action = {
|
|
170
|
+
* type: "approveAgent",
|
|
171
|
+
* hyperliquidChain: "Testnet", // "Mainnet" or "Testnet"
|
|
172
|
+
* signatureChainId: "0x66eee",
|
|
173
|
+
* nonce: Date.now(),
|
|
174
|
+
* agentAddress: "0x...", // Change to your agent address
|
|
175
|
+
* agentName: "Agent",
|
|
176
|
+
* };
|
|
177
|
+
*
|
|
178
|
+
* const signature = await signUserSignedAction({
|
|
179
|
+
* wallet,
|
|
180
|
+
* action,
|
|
181
|
+
* types: {
|
|
182
|
+
* "HyperliquidTransaction:ApproveAgent": [
|
|
183
|
+
* { name: "hyperliquidChain", type: "string" },
|
|
184
|
+
* { name: "agentAddress", type: "address" },
|
|
185
|
+
* { name: "agentName", type: "string" },
|
|
186
|
+
* { name: "nonce", type: "uint64" },
|
|
187
|
+
* ],
|
|
188
|
+
* },
|
|
189
|
+
* chainId: parseInt(action.signatureChainId, 16),
|
|
190
|
+
* });
|
|
191
|
+
*
|
|
192
|
+
* const response = await fetch("https://api.hyperliquid-testnet.xyz/exchange", {
|
|
193
|
+
* method: "POST",
|
|
194
|
+
* headers: { "Content-Type": "application/json" },
|
|
195
|
+
* body: JSON.stringify({ action, signature, nonce: action.nonce }),
|
|
196
|
+
* });
|
|
197
|
+
* const body = await response.json();
|
|
198
|
+
* ```
|
|
91
199
|
*/
|
|
92
200
|
export async function signUserSignedAction(args) {
|
|
93
201
|
const { wallet, action, types, chainId } = args;
|
|
@@ -162,12 +270,6 @@ export function isAbstractViemWalletClient(client) {
|
|
|
162
270
|
"signTypedData" in client && typeof client.signTypedData === "function" &&
|
|
163
271
|
client.signTypedData.length === 1;
|
|
164
272
|
}
|
|
165
|
-
/** Checks if the given value is an abstract extended viem wallet (e.g. privy `useSignTypedData`). */
|
|
166
|
-
export function isAbstractExtendedViemWalletClient(client) {
|
|
167
|
-
return typeof client === "object" && client !== null &&
|
|
168
|
-
"signTypedData" in client && typeof client.signTypedData === "function" &&
|
|
169
|
-
client.signTypedData.length === 2;
|
|
170
|
-
}
|
|
171
273
|
/** Checks if the given value is an abstract ethers signer. */
|
|
172
274
|
export function isAbstractEthersSigner(client) {
|
|
173
275
|
return typeof client === "object" && client !== null &&
|
|
@@ -180,6 +282,12 @@ export function isAbstractEthersV5Signer(client) {
|
|
|
180
282
|
"_signTypedData" in client && typeof client._signTypedData === "function" &&
|
|
181
283
|
client._signTypedData.length === 3;
|
|
182
284
|
}
|
|
285
|
+
/** Checks if the given value is an abstract extended viem wallet (e.g. privy `useSignTypedData`). */
|
|
286
|
+
export function isAbstractExtendedViemWalletClient(client) {
|
|
287
|
+
return typeof client === "object" && client !== null &&
|
|
288
|
+
"signTypedData" in client && typeof client.signTypedData === "function" &&
|
|
289
|
+
client.signTypedData.length === 2;
|
|
290
|
+
}
|
|
183
291
|
/** Checks if the given value is an abstract `window.ethereum` object. */
|
|
184
292
|
export function isAbstractWindowEthereum(client) {
|
|
185
293
|
return typeof client === "object" && client !== null &&
|
|
@@ -17,28 +17,10 @@ export declare class HttpRequestError extends TransportError {
|
|
|
17
17
|
/** Configuration options for the HTTP transport layer. */
|
|
18
18
|
export interface HttpTransportOptions {
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* When given as a string or URL, the URL is modified based on the request type:
|
|
23
|
-
* - For `"info"` and `"exchange"`, the hostname is replaced with `api.<baseDomain>`.
|
|
24
|
-
* - For `"explorer"`, the hostname is replaced with `rpc.<baseDomain>`.
|
|
25
|
-
*
|
|
26
|
-
* Alternatively, you can supply an object to specify separate URLs:
|
|
27
|
-
* ```ts
|
|
28
|
-
* {
|
|
29
|
-
* api: "https://api.hyperliquid.xyz",
|
|
30
|
-
* rpc: "https://rpc.hyperliquid.xyz"
|
|
31
|
-
* }
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* - Mainnet: `https://hyperliquid.xyz`
|
|
35
|
-
* - Testnet: `https://hyperliquid-testnet.xyz`
|
|
36
|
-
* @defaultValue `https://hyperliquid.xyz`
|
|
20
|
+
* Specifies whether to use the testnet API endpoints.
|
|
21
|
+
* @defaultValue `false`
|
|
37
22
|
*/
|
|
38
|
-
|
|
39
|
-
api?: string | URL;
|
|
40
|
-
rpc?: string | URL;
|
|
41
|
-
};
|
|
23
|
+
isTestnet?: boolean;
|
|
42
24
|
/**
|
|
43
25
|
* Request timeout in ms.
|
|
44
26
|
* Set to `null` to disable.
|
|
@@ -62,10 +44,18 @@ export interface HttpTransportOptions {
|
|
|
62
44
|
}
|
|
63
45
|
/** HTTP implementation of the REST transport interface. */
|
|
64
46
|
export declare class HttpTransport implements IRequestTransport, HttpTransportOptions {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
47
|
+
/** API endpoint paths for mainnet and testnet. */
|
|
48
|
+
protected static readonly endpointPaths: {
|
|
49
|
+
mainnet: {
|
|
50
|
+
api: string;
|
|
51
|
+
rpc: string;
|
|
52
|
+
};
|
|
53
|
+
testnet: {
|
|
54
|
+
api: string;
|
|
55
|
+
rpc: string;
|
|
56
|
+
};
|
|
68
57
|
};
|
|
58
|
+
isTestnet: boolean;
|
|
69
59
|
timeout: number | null;
|
|
70
60
|
fetchOptions: Omit<RequestInit, "body" | "method">;
|
|
71
61
|
onRequest?: (request: Request) => MaybePromise<Request | void | null | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http_transport.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/http/http_transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE1F;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,cAAc;IAM7B,QAAQ,EAAE,QAAQ;IAAS,YAAY,CAAC,EAAE,MAAM;IALnE;;;;OAIG;gBACgB,QAAQ,EAAE,QAAQ,EAAS,YAAY,CAAC,EAAE,MAAM,YAAA;CAOtE;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACjC
|
|
1
|
+
{"version":3,"file":"http_transport.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/http/http_transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE1F;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,cAAc;IAM7B,QAAQ,EAAE,QAAQ;IAAS,YAAY,CAAC,EAAE,MAAM;IALnE;;;;OAIG;gBACgB,QAAQ,EAAE,QAAQ,EAAS,YAAY,CAAC,EAAE,MAAM,YAAA;CAOtE;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,2IAA2I;IAC3I,YAAY,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC;IAEpD;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,YAAY,CAAC,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAElF;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,YAAY,CAAC,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACzF;AAED,2DAA2D;AAC3D,qBAAa,aAAc,YAAW,iBAAiB,EAAE,oBAAoB;IACzE,kDAAkD;IAClD,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa;;;;;;;;;MASrC;IAEF,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC;IACnD,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,YAAY,CAAC,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAClF,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,YAAY,CAAC,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAEtF;;;OAGG;gBACS,OAAO,CAAC,EAAE,oBAAoB;IAQ1C;;;;;;;;OAQG;IACG,OAAO,CACT,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,EAC1C,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,GACrB,OAAO,CAAC,OAAO,CAAC;CAiDtB"}
|
|
@@ -37,7 +37,7 @@ export class HttpTransport {
|
|
|
37
37
|
* @param options - Configuration options for the HTTP transport layer.
|
|
38
38
|
*/
|
|
39
39
|
constructor(options) {
|
|
40
|
-
Object.defineProperty(this, "
|
|
40
|
+
Object.defineProperty(this, "isTestnet", {
|
|
41
41
|
enumerable: true,
|
|
42
42
|
configurable: true,
|
|
43
43
|
writable: true,
|
|
@@ -67,7 +67,7 @@ export class HttpTransport {
|
|
|
67
67
|
writable: true,
|
|
68
68
|
value: void 0
|
|
69
69
|
});
|
|
70
|
-
this.
|
|
70
|
+
this.isTestnet = options?.isTestnet ?? false;
|
|
71
71
|
this.timeout = options?.timeout === undefined ? 10_000 : options.timeout;
|
|
72
72
|
this.fetchOptions = options?.fetchOptions ?? {};
|
|
73
73
|
this.onRequest = options?.onRequest;
|
|
@@ -84,19 +84,8 @@ export class HttpTransport {
|
|
|
84
84
|
*/
|
|
85
85
|
async request(endpoint, payload, signal) {
|
|
86
86
|
// Construct a Request
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
// If a string is provided, get the base domain and apply the modification to it
|
|
90
|
-
const parsedUrl = new URL(this.url);
|
|
91
|
-
const parts = parsedUrl.hostname.split(".");
|
|
92
|
-
const baseDomain = parts.slice(-2).join(".");
|
|
93
|
-
const baseUrl = `${parsedUrl.protocol}//${endpoint === "explorer" ? "rpc" : "api"}.${baseDomain}`;
|
|
94
|
-
url = new URL(endpoint, baseUrl);
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
// If an object is specified, use the specific url and add a path to it
|
|
98
|
-
url = new URL(endpoint, endpoint === "explorer" ? this.url.rpc : this.url.api);
|
|
99
|
-
}
|
|
87
|
+
const url = new URL(endpoint, HttpTransport
|
|
88
|
+
.endpointPaths[this.isTestnet ? "testnet" : "mainnet"][endpoint === "explorer" ? "rpc" : "api"]);
|
|
100
89
|
const init = mergeRequestInit({
|
|
101
90
|
body: JSON.stringify(payload),
|
|
102
91
|
headers: {
|
|
@@ -133,6 +122,22 @@ export class HttpTransport {
|
|
|
133
122
|
return await response.json();
|
|
134
123
|
}
|
|
135
124
|
}
|
|
125
|
+
/** API endpoint paths for mainnet and testnet. */
|
|
126
|
+
Object.defineProperty(HttpTransport, "endpointPaths", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
configurable: true,
|
|
129
|
+
writable: true,
|
|
130
|
+
value: {
|
|
131
|
+
mainnet: {
|
|
132
|
+
api: "https://api.hyperliquid.xyz",
|
|
133
|
+
rpc: "https://rpc.hyperliquid.xyz",
|
|
134
|
+
},
|
|
135
|
+
testnet: {
|
|
136
|
+
api: "https://api.hyperliquid-testnet.xyz",
|
|
137
|
+
rpc: "https://rpc.hyperliquid-testnet.xyz",
|
|
138
|
+
},
|
|
139
|
+
}
|
|
140
|
+
});
|
|
136
141
|
/**
|
|
137
142
|
* Merges multiple `HeadersInit` objects into one.
|
|
138
143
|
* @param inits - A list of `HeadersInit` objects to merge.
|
|
@@ -8,8 +8,12 @@ export { type MessageBufferStrategy, ReconnectingWebSocketError, type Reconnecti
|
|
|
8
8
|
export interface WebSocketTransportOptions {
|
|
9
9
|
/**
|
|
10
10
|
* The WebSocket URL.
|
|
11
|
-
* - Mainnet:
|
|
12
|
-
*
|
|
11
|
+
* - Mainnet:
|
|
12
|
+
* - API: `wss://api.hyperliquid.xyz/ws`
|
|
13
|
+
* - RPC: `wss://rpc.hyperliquid.xyz/ws`
|
|
14
|
+
* - Testnet:
|
|
15
|
+
* - API: `wss://api.hyperliquid-testnet.xyz/ws`
|
|
16
|
+
* - RPC: `wss://rpc.hyperliquid-testnet.xyz/ws`
|
|
13
17
|
* @defaultValue `wss://api.hyperliquid.xyz/ws`
|
|
14
18
|
*/
|
|
15
19
|
url?: string | URL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket_transport.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/websocket_transport.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,KAAK,4BAA4B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AACvG,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7F,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,OAAO,EAAE,KAAK,qBAAqB,EAAE,0BAA0B,EAAE,KAAK,4BAA4B,EAAE,CAAC;AAErG,+DAA+D;AAC/D,MAAM,WAAW,yBAAyB;IACtC
|
|
1
|
+
{"version":3,"file":"websocket_transport.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/websocket_transport.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,KAAK,4BAA4B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AACvG,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7F,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,OAAO,EAAE,KAAK,qBAAqB,EAAE,0BAA0B,EAAE,KAAK,4BAA4B,EAAE,CAAC;AAErG,+DAA+D;AAC/D,MAAM,WAAW,yBAAyB;IACtC;;;;;;;;;OASG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAEnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE;QACR;;;;WAIG;QACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC5B,CAAC;IAEF;;OAEG;IACH,SAAS,CAAC,EAAE,4BAA4B,CAAC;CAC5C;AAED,kFAAkF;AAClF,qBAAa,kBAAmB,YAAW,iBAAiB,EAAE,sBAAsB;IAChF,qDAAqD;IACrD,SAAS,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEhD,iDAAiD;IACjD,SAAS,CAAC,YAAY,EAAE,0BA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