@nktkas/hyperliquid 0.21.1 → 0.22.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/CONTRIBUTING.md +19 -34
- package/README.md +212 -87
- package/esm/mod.d.ts +4 -3
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +3 -2
- package/esm/src/clients/exchange.d.ts +102 -59
- package/esm/src/clients/exchange.d.ts.map +1 -1
- package/esm/src/clients/exchange.js +233 -516
- package/esm/src/clients/info.d.ts +55 -55
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +57 -54
- package/esm/src/clients/multiSign.d.ts +1293 -0
- package/esm/src/clients/multiSign.d.ts.map +1 -0
- package/esm/src/clients/multiSign.js +2156 -0
- package/esm/src/clients/subscription.d.ts +19 -19
- package/esm/src/clients/subscription.d.ts.map +1 -1
- package/esm/src/clients/subscription.js +17 -17
- package/esm/src/signing.d.ts +164 -40
- package/esm/src/signing.d.ts.map +1 -1
- package/esm/src/signing.js +710 -9
- package/esm/src/types/exchange/requests.d.ts +240 -245
- package/esm/src/types/exchange/requests.d.ts.map +1 -1
- package/package.json +2 -1
- package/script/mod.d.ts +4 -3
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +4 -3
- package/script/src/clients/exchange.d.ts +102 -59
- package/script/src/clients/exchange.d.ts.map +1 -1
- package/script/src/clients/exchange.js +232 -515
- package/script/src/clients/info.d.ts +55 -55
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +57 -54
- package/script/src/clients/multiSign.d.ts +1293 -0
- package/script/src/clients/multiSign.d.ts.map +1 -0
- package/script/src/clients/multiSign.js +2170 -0
- package/script/src/clients/subscription.d.ts +19 -19
- package/script/src/clients/subscription.d.ts.map +1 -1
- package/script/src/clients/subscription.js +17 -17
- package/script/src/signing.d.ts +164 -40
- package/script/src/signing.d.ts.map +1 -1
- package/script/src/signing.js +711 -10
- package/script/src/types/exchange/requests.d.ts +240 -245
- package/script/src/types/exchange/requests.d.ts.map +1 -1
|
@@ -49,125 +49,8 @@ export interface BaseExchangeRequest {
|
|
|
49
49
|
s: Hex;
|
|
50
50
|
v: number;
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
* Jail a signer to prevent them from signing transactions.
|
|
55
|
-
* @returns {SuccessResponse}
|
|
56
|
-
* @see null - no documentation
|
|
57
|
-
*/
|
|
58
|
-
export interface CSignerActionRequest_JailSelf extends BaseExchangeRequest {
|
|
59
|
-
/** Action to perform. */
|
|
60
|
-
action: {
|
|
61
|
-
/** Type of action. */
|
|
62
|
-
type: "CSignerAction";
|
|
63
|
-
/** Jail the signer. */
|
|
64
|
-
jailSelf: null;
|
|
65
|
-
};
|
|
66
|
-
/** Expiration time of the action. */
|
|
67
|
-
expiresAfter?: number;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Unjail a signer to allow them to sign transactions again.
|
|
71
|
-
* @returns {SuccessResponse}
|
|
72
|
-
* @see null - no documentation
|
|
73
|
-
*/
|
|
74
|
-
export interface CSignerActionRequest_UnjailSelf extends BaseExchangeRequest {
|
|
75
|
-
/** Action to perform. */
|
|
76
|
-
action: {
|
|
77
|
-
/** Type of action. */
|
|
78
|
-
type: "CSignerAction";
|
|
79
|
-
/** Unjail the signer. */
|
|
80
|
-
unjailSelf: null;
|
|
81
|
-
};
|
|
82
|
-
/** Expiration time of the action. */
|
|
83
|
-
expiresAfter?: number;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Change a validator's profile information.
|
|
87
|
-
* @returns {SuccessResponse}
|
|
88
|
-
* @see null - no documentation
|
|
89
|
-
*/
|
|
90
|
-
export interface CValidatorActionRequest_ChangeProfile extends BaseExchangeRequest {
|
|
91
|
-
/** Action to perform. */
|
|
92
|
-
action: {
|
|
93
|
-
/** Type of action. */
|
|
94
|
-
type: "CValidatorAction";
|
|
95
|
-
/** Profile changes to apply. */
|
|
96
|
-
changeProfile: {
|
|
97
|
-
/** Validator node IP address. */
|
|
98
|
-
node_ip?: {
|
|
99
|
-
/** IP address. */
|
|
100
|
-
Ip: string;
|
|
101
|
-
} | null;
|
|
102
|
-
/** Validator name. */
|
|
103
|
-
name?: string | null;
|
|
104
|
-
/** Validator description. */
|
|
105
|
-
description?: string | null;
|
|
106
|
-
/** Validator jail status. */
|
|
107
|
-
unjailed: boolean;
|
|
108
|
-
/** Enable or disable delegations. */
|
|
109
|
-
disable_delegations?: boolean | null;
|
|
110
|
-
/** Commission rate in basis points (1 = 0.0001%). */
|
|
111
|
-
commission_bps?: number | null;
|
|
112
|
-
/** Signer address. */
|
|
113
|
-
signer?: Hex | null;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
/** Expiration time of the action. */
|
|
117
|
-
expiresAfter?: number;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Register a new validator.
|
|
121
|
-
* @returns {SuccessResponse}
|
|
122
|
-
* @see null - no documentation
|
|
123
|
-
*/
|
|
124
|
-
export interface CValidatorActionRequest_Register extends BaseExchangeRequest {
|
|
125
|
-
/** Action to perform. */
|
|
126
|
-
action: {
|
|
127
|
-
/** Type of action. */
|
|
128
|
-
type: "CValidatorAction";
|
|
129
|
-
/** Registration parameters. */
|
|
130
|
-
register: {
|
|
131
|
-
/** Validator profile information. */
|
|
132
|
-
profile: {
|
|
133
|
-
/** Validator node IP address. */
|
|
134
|
-
node_ip: {
|
|
135
|
-
/** IP address. */
|
|
136
|
-
Ip: string;
|
|
137
|
-
};
|
|
138
|
-
/** Validator name. */
|
|
139
|
-
name: string;
|
|
140
|
-
/** Validator description. */
|
|
141
|
-
description: string;
|
|
142
|
-
/** Whether delegations are disabled. */
|
|
143
|
-
delegations_disabled: boolean;
|
|
144
|
-
/** Commission rate in basis points (1 = 0.0001%). */
|
|
145
|
-
commission_bps: number;
|
|
146
|
-
/** Signer address. */
|
|
147
|
-
signer: Hex;
|
|
148
|
-
};
|
|
149
|
-
/** Initial jail status. */
|
|
150
|
-
unjailed: boolean;
|
|
151
|
-
/** Initial stake amount in wei. */
|
|
152
|
-
initial_wei: number;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
/** Expiration time of the action. */
|
|
156
|
-
expiresAfter?: number;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Unregister an existing validator.
|
|
160
|
-
* @returns {SuccessResponse}
|
|
161
|
-
* @see null - no documentation
|
|
162
|
-
*/
|
|
163
|
-
export interface CValidatorActionRequest_Unregister extends BaseExchangeRequest {
|
|
164
|
-
/** Action to perform. */
|
|
165
|
-
action: {
|
|
166
|
-
/** Type of action. */
|
|
167
|
-
type: "CValidatorAction";
|
|
168
|
-
/** Unregister the validator. */
|
|
169
|
-
unregister: null;
|
|
170
|
-
};
|
|
52
|
+
/** Vault address (for vault trading). */
|
|
53
|
+
vaultAddress?: Hex;
|
|
171
54
|
/** Expiration time of the action. */
|
|
172
55
|
expiresAfter?: number;
|
|
173
56
|
}
|
|
@@ -177,21 +60,22 @@ export interface CValidatorActionRequest_Unregister extends BaseExchangeRequest
|
|
|
177
60
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-an-api-wallet
|
|
178
61
|
*/
|
|
179
62
|
export interface ApproveAgentRequest extends BaseExchangeRequest {
|
|
180
|
-
/** Action to be performed. */
|
|
181
63
|
action: {
|
|
182
64
|
/** Type of action. */
|
|
183
65
|
type: "approveAgent";
|
|
184
|
-
/** HyperLiquid network. */
|
|
185
|
-
hyperliquidChain: "Mainnet" | "Testnet";
|
|
186
66
|
/** Chain ID used for signing. */
|
|
187
67
|
signatureChainId: Hex;
|
|
188
|
-
/**
|
|
189
|
-
|
|
68
|
+
/** HyperLiquid network. */
|
|
69
|
+
hyperliquidChain: "Mainnet" | "Testnet";
|
|
190
70
|
/** Agent address. */
|
|
191
71
|
agentAddress: Hex;
|
|
192
72
|
/** Agent name or undefined for unnamed agent. */
|
|
193
73
|
agentName?: string;
|
|
74
|
+
/** Unique request identifier (current timestamp in ms). */
|
|
75
|
+
nonce: number;
|
|
194
76
|
};
|
|
77
|
+
vaultAddress?: undefined;
|
|
78
|
+
expiresAfter?: undefined;
|
|
195
79
|
}
|
|
196
80
|
/**
|
|
197
81
|
* Approve a maximum fee rate for a builder.
|
|
@@ -199,21 +83,22 @@ export interface ApproveAgentRequest extends BaseExchangeRequest {
|
|
|
199
83
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-a-builder-fee
|
|
200
84
|
*/
|
|
201
85
|
export interface ApproveBuilderFeeRequest extends BaseExchangeRequest {
|
|
202
|
-
/** Action to be performed. */
|
|
203
86
|
action: {
|
|
204
87
|
/** Type of action. */
|
|
205
88
|
type: "approveBuilderFee";
|
|
206
|
-
/** HyperLiquid network. */
|
|
207
|
-
hyperliquidChain: "Mainnet" | "Testnet";
|
|
208
89
|
/** Chain ID used for signing. */
|
|
209
90
|
signatureChainId: Hex;
|
|
210
|
-
/**
|
|
211
|
-
|
|
91
|
+
/** HyperLiquid network. */
|
|
92
|
+
hyperliquidChain: "Mainnet" | "Testnet";
|
|
212
93
|
/** Max fee rate (e.g., "0.01%"). */
|
|
213
94
|
maxFeeRate: `${string}%`;
|
|
214
95
|
/** Builder address. */
|
|
215
96
|
builder: Hex;
|
|
97
|
+
/** Unique request identifier (current timestamp in ms). */
|
|
98
|
+
nonce: number;
|
|
216
99
|
};
|
|
100
|
+
vaultAddress?: undefined;
|
|
101
|
+
expiresAfter?: undefined;
|
|
217
102
|
}
|
|
218
103
|
/**
|
|
219
104
|
* Modify multiple orders.
|
|
@@ -221,21 +106,18 @@ export interface ApproveBuilderFeeRequest extends BaseExchangeRequest {
|
|
|
221
106
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
|
|
222
107
|
*/
|
|
223
108
|
export interface BatchModifyRequest extends BaseExchangeRequest {
|
|
224
|
-
/** Action to be performed. */
|
|
225
109
|
action: {
|
|
226
110
|
/** Type of action. */
|
|
227
111
|
type: "batchModify";
|
|
228
112
|
/** Order modifications. */
|
|
229
113
|
modifies: {
|
|
230
|
-
/** Order ID. */
|
|
231
|
-
oid: number;
|
|
114
|
+
/** Order ID or CLient Order ID. */
|
|
115
|
+
oid: number | Hex;
|
|
232
116
|
/** New order parameters. */
|
|
233
117
|
order: OrderParams;
|
|
234
118
|
}[];
|
|
235
119
|
};
|
|
236
|
-
/** Vault address (for vault trading). */
|
|
237
120
|
vaultAddress?: Hex;
|
|
238
|
-
/** Expiration time of the action. */
|
|
239
121
|
expiresAfter?: number;
|
|
240
122
|
}
|
|
241
123
|
/**
|
|
@@ -244,7 +126,6 @@ export interface BatchModifyRequest extends BaseExchangeRequest {
|
|
|
244
126
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
245
127
|
*/
|
|
246
128
|
export interface CancelRequest extends BaseExchangeRequest {
|
|
247
|
-
/** Action to be performed. */
|
|
248
129
|
action: {
|
|
249
130
|
/** Type of action. */
|
|
250
131
|
type: "cancel";
|
|
@@ -256,9 +137,7 @@ export interface CancelRequest extends BaseExchangeRequest {
|
|
|
256
137
|
o: number;
|
|
257
138
|
}[];
|
|
258
139
|
};
|
|
259
|
-
/** Vault address (for vault trading). */
|
|
260
140
|
vaultAddress?: Hex;
|
|
261
|
-
/** Expiration time of the action. */
|
|
262
141
|
expiresAfter?: number;
|
|
263
142
|
}
|
|
264
143
|
/**
|
|
@@ -267,7 +146,6 @@ export interface CancelRequest extends BaseExchangeRequest {
|
|
|
267
146
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
268
147
|
*/
|
|
269
148
|
export interface CancelByCloidRequest extends BaseExchangeRequest {
|
|
270
|
-
/** Action to be performed. */
|
|
271
149
|
action: {
|
|
272
150
|
/** Type of action. */
|
|
273
151
|
type: "cancelByCloid";
|
|
@@ -279,9 +157,7 @@ export interface CancelByCloidRequest extends BaseExchangeRequest {
|
|
|
279
157
|
cloid: Hex;
|
|
280
158
|
}[];
|
|
281
159
|
};
|
|
282
|
-
/** Vault address (for vault trading). */
|
|
283
160
|
vaultAddress?: Hex;
|
|
284
|
-
/** Expiration time of the action. */
|
|
285
161
|
expiresAfter?: number;
|
|
286
162
|
}
|
|
287
163
|
/**
|
|
@@ -290,19 +166,20 @@ export interface CancelByCloidRequest extends BaseExchangeRequest {
|
|
|
290
166
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-into-staking
|
|
291
167
|
*/
|
|
292
168
|
export interface CDepositRequest extends BaseExchangeRequest {
|
|
293
|
-
/** Action to be performed. */
|
|
294
169
|
action: {
|
|
295
170
|
/** Type of action. */
|
|
296
171
|
type: "cDeposit";
|
|
297
|
-
/** HyperLiquid network. */
|
|
298
|
-
hyperliquidChain: "Mainnet" | "Testnet";
|
|
299
172
|
/** Chain ID used for signing. */
|
|
300
173
|
signatureChainId: Hex;
|
|
301
|
-
/**
|
|
302
|
-
|
|
174
|
+
/** HyperLiquid network. */
|
|
175
|
+
hyperliquidChain: "Mainnet" | "Testnet";
|
|
303
176
|
/** Amount of wei to deposit into staking balance (float * 1e8). */
|
|
304
177
|
wei: number;
|
|
178
|
+
/** Unique request identifier (current timestamp in ms). */
|
|
179
|
+
nonce: number;
|
|
305
180
|
};
|
|
181
|
+
vaultAddress?: undefined;
|
|
182
|
+
expiresAfter?: undefined;
|
|
306
183
|
}
|
|
307
184
|
/**
|
|
308
185
|
* Claim rewards from referral program.
|
|
@@ -310,11 +187,12 @@ export interface CDepositRequest extends BaseExchangeRequest {
|
|
|
310
187
|
* @see null - no documentation
|
|
311
188
|
*/
|
|
312
189
|
export interface ClaimRewardsRequest extends BaseExchangeRequest {
|
|
313
|
-
/** Action to be performed. */
|
|
314
190
|
action: {
|
|
315
191
|
/** Type of action. */
|
|
316
192
|
type: "claimRewards";
|
|
317
193
|
};
|
|
194
|
+
vaultAddress?: undefined;
|
|
195
|
+
expiresAfter?: undefined;
|
|
318
196
|
}
|
|
319
197
|
/**
|
|
320
198
|
* Convert a single-signature account to a multi-signature account.
|
|
@@ -322,14 +200,13 @@ export interface ClaimRewardsRequest extends BaseExchangeRequest {
|
|
|
322
200
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/multi-sig
|
|
323
201
|
*/
|
|
324
202
|
export interface ConvertToMultiSigUserRequest extends BaseExchangeRequest {
|
|
325
|
-
/** Action to be performed. */
|
|
326
203
|
action: {
|
|
327
204
|
/** Type of action. */
|
|
328
205
|
type: "convertToMultiSigUser";
|
|
329
|
-
/** HyperLiquid network. */
|
|
330
|
-
hyperliquidChain: "Mainnet" | "Testnet";
|
|
331
206
|
/** Chain ID used for signing. */
|
|
332
207
|
signatureChainId: Hex;
|
|
208
|
+
/** HyperLiquid network. */
|
|
209
|
+
hyperliquidChain: "Mainnet" | "Testnet";
|
|
333
210
|
/**
|
|
334
211
|
* Signers configuration.
|
|
335
212
|
*
|
|
@@ -339,6 +216,8 @@ export interface ConvertToMultiSigUserRequest extends BaseExchangeRequest {
|
|
|
339
216
|
/** Unique request identifier (current timestamp in ms). */
|
|
340
217
|
nonce: number;
|
|
341
218
|
};
|
|
219
|
+
vaultAddress?: undefined;
|
|
220
|
+
expiresAfter?: undefined;
|
|
342
221
|
}
|
|
343
222
|
/** Signers configuration for {@linkcode ConvertToMultiSigUserRequest}. */
|
|
344
223
|
export type ConvertToMultiSigUserRequest_Signers = {
|
|
@@ -355,13 +234,14 @@ export type ConvertToMultiSigUserRequest_Signers = {
|
|
|
355
234
|
* @see null - no documentation
|
|
356
235
|
*/
|
|
357
236
|
export interface CreateSubAccountRequest extends BaseExchangeRequest {
|
|
358
|
-
/** Action to be performed. */
|
|
359
237
|
action: {
|
|
360
238
|
/** Type of action. */
|
|
361
239
|
type: "createSubAccount";
|
|
362
240
|
/** Sub-account name. */
|
|
363
241
|
name: string;
|
|
364
242
|
};
|
|
243
|
+
vaultAddress?: undefined;
|
|
244
|
+
expiresAfter?: undefined;
|
|
365
245
|
}
|
|
366
246
|
/**
|
|
367
247
|
* Create a vault.
|
|
@@ -369,7 +249,6 @@ export interface CreateSubAccountRequest extends BaseExchangeRequest {
|
|
|
369
249
|
* @see null - no documentation
|
|
370
250
|
*/
|
|
371
251
|
export interface CreateVaultRequest extends BaseExchangeRequest {
|
|
372
|
-
/** Action to perform. */
|
|
373
252
|
action: {
|
|
374
253
|
/** Type of action. */
|
|
375
254
|
type: "createVault";
|
|
@@ -382,6 +261,124 @@ export interface CreateVaultRequest extends BaseExchangeRequest {
|
|
|
382
261
|
/** Unique request identifier (current timestamp in ms). */
|
|
383
262
|
nonce: number;
|
|
384
263
|
};
|
|
264
|
+
vaultAddress?: undefined;
|
|
265
|
+
expiresAfter?: undefined;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Jail a signer to prevent them from signing transactions.
|
|
269
|
+
* @returns {SuccessResponse}
|
|
270
|
+
* @see null - no documentation
|
|
271
|
+
*/
|
|
272
|
+
export interface CSignerActionRequest_JailSelf extends BaseExchangeRequest {
|
|
273
|
+
action: {
|
|
274
|
+
/** Type of action. */
|
|
275
|
+
type: "CSignerAction";
|
|
276
|
+
/** Jail the signer. */
|
|
277
|
+
jailSelf: null;
|
|
278
|
+
};
|
|
279
|
+
vaultAddress?: undefined;
|
|
280
|
+
expiresAfter?: number;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Unjail a signer to allow them to sign transactions again.
|
|
284
|
+
* @returns {SuccessResponse}
|
|
285
|
+
* @see null - no documentation
|
|
286
|
+
*/
|
|
287
|
+
export interface CSignerActionRequest_UnjailSelf extends BaseExchangeRequest {
|
|
288
|
+
action: {
|
|
289
|
+
/** Type of action. */
|
|
290
|
+
type: "CSignerAction";
|
|
291
|
+
/** Unjail the signer. */
|
|
292
|
+
unjailSelf: null;
|
|
293
|
+
};
|
|
294
|
+
vaultAddress?: undefined;
|
|
295
|
+
expiresAfter?: number;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Change a validator's profile information.
|
|
299
|
+
* @returns {SuccessResponse}
|
|
300
|
+
* @see null - no documentation
|
|
301
|
+
*/
|
|
302
|
+
export interface CValidatorActionRequest_ChangeProfile extends BaseExchangeRequest {
|
|
303
|
+
action: {
|
|
304
|
+
/** Type of action. */
|
|
305
|
+
type: "CValidatorAction";
|
|
306
|
+
/** Profile changes to apply. */
|
|
307
|
+
changeProfile: {
|
|
308
|
+
/** Validator node IP address. */
|
|
309
|
+
node_ip?: {
|
|
310
|
+
/** IP address. */
|
|
311
|
+
Ip: string;
|
|
312
|
+
} | null;
|
|
313
|
+
/** Validator name. */
|
|
314
|
+
name?: string | null;
|
|
315
|
+
/** Validator description. */
|
|
316
|
+
description?: string | null;
|
|
317
|
+
/** Validator jail status. */
|
|
318
|
+
unjailed: boolean;
|
|
319
|
+
/** Enable or disable delegations. */
|
|
320
|
+
disable_delegations?: boolean | null;
|
|
321
|
+
/** Commission rate in basis points (1 = 0.0001%). */
|
|
322
|
+
commission_bps?: number | null;
|
|
323
|
+
/** Signer address. */
|
|
324
|
+
signer?: Hex | null;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
vaultAddress?: undefined;
|
|
328
|
+
expiresAfter?: number;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Register a new validator.
|
|
332
|
+
* @returns {SuccessResponse}
|
|
333
|
+
* @see null - no documentation
|
|
334
|
+
*/
|
|
335
|
+
export interface CValidatorActionRequest_Register extends BaseExchangeRequest {
|
|
336
|
+
action: {
|
|
337
|
+
/** Type of action. */
|
|
338
|
+
type: "CValidatorAction";
|
|
339
|
+
/** Registration parameters. */
|
|
340
|
+
register: {
|
|
341
|
+
/** Validator profile information. */
|
|
342
|
+
profile: {
|
|
343
|
+
/** Validator node IP address. */
|
|
344
|
+
node_ip: {
|
|
345
|
+
/** IP address. */
|
|
346
|
+
Ip: string;
|
|
347
|
+
};
|
|
348
|
+
/** Validator name. */
|
|
349
|
+
name: string;
|
|
350
|
+
/** Validator description. */
|
|
351
|
+
description: string;
|
|
352
|
+
/** Whether delegations are disabled. */
|
|
353
|
+
delegations_disabled: boolean;
|
|
354
|
+
/** Commission rate in basis points (1 = 0.0001%). */
|
|
355
|
+
commission_bps: number;
|
|
356
|
+
/** Signer address. */
|
|
357
|
+
signer: Hex;
|
|
358
|
+
};
|
|
359
|
+
/** Initial jail status. */
|
|
360
|
+
unjailed: boolean;
|
|
361
|
+
/** Initial stake amount in wei. */
|
|
362
|
+
initial_wei: number;
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
vaultAddress?: undefined;
|
|
366
|
+
expiresAfter?: number;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Unregister an existing validator.
|
|
370
|
+
* @returns {SuccessResponse}
|
|
371
|
+
* @see null - no documentation
|
|
372
|
+
*/
|
|
373
|
+
export interface CValidatorActionRequest_Unregister extends BaseExchangeRequest {
|
|
374
|
+
action: {
|
|
375
|
+
/** Type of action. */
|
|
376
|
+
type: "CValidatorAction";
|
|
377
|
+
/** Unregister the validator. */
|
|
378
|
+
unregister: null;
|
|
379
|
+
};
|
|
380
|
+
vaultAddress?: undefined;
|
|
381
|
+
expiresAfter?: number;
|
|
385
382
|
}
|
|
386
383
|
/**
|
|
387
384
|
* Transfer native token from staking into the user's spot account.
|
|
@@ -389,19 +386,20 @@ export interface CreateVaultRequest extends BaseExchangeRequest {
|
|
|
389
386
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#withdraw-from-staking
|
|
390
387
|
*/
|
|
391
388
|
export interface CWithdrawRequest extends BaseExchangeRequest {
|
|
392
|
-
/** Action to be performed. */
|
|
393
389
|
action: {
|
|
394
390
|
/** Type of action. */
|
|
395
391
|
type: "cWithdraw";
|
|
396
|
-
/** HyperLiquid network. */
|
|
397
|
-
hyperliquidChain: "Mainnet" | "Testnet";
|
|
398
392
|
/** Chain ID used for signing. */
|
|
399
393
|
signatureChainId: Hex;
|
|
400
|
-
/**
|
|
401
|
-
|
|
394
|
+
/** HyperLiquid network. */
|
|
395
|
+
hyperliquidChain: "Mainnet" | "Testnet";
|
|
402
396
|
/** Amount of wei to withdraw from staking balance (float * 1e8). */
|
|
403
397
|
wei: number;
|
|
398
|
+
/** Unique request identifier (current timestamp in ms). */
|
|
399
|
+
nonce: number;
|
|
404
400
|
};
|
|
401
|
+
vaultAddress?: undefined;
|
|
402
|
+
expiresAfter?: undefined;
|
|
405
403
|
}
|
|
406
404
|
/**
|
|
407
405
|
* Configure block type for EVM transactions.
|
|
@@ -409,13 +407,14 @@ export interface CWithdrawRequest extends BaseExchangeRequest {
|
|
|
409
407
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/evm/dual-block-architecture
|
|
410
408
|
*/
|
|
411
409
|
export interface EvmUserModifyRequest extends BaseExchangeRequest {
|
|
412
|
-
/** Action to be performed. */
|
|
413
410
|
action: {
|
|
414
411
|
/** Type of action. */
|
|
415
412
|
type: "evmUserModify";
|
|
416
413
|
/** `true` for large blocks, `false` for small blocks. */
|
|
417
414
|
usingBigBlocks: boolean;
|
|
418
415
|
};
|
|
416
|
+
vaultAddress?: undefined;
|
|
417
|
+
expiresAfter?: undefined;
|
|
419
418
|
}
|
|
420
419
|
/**
|
|
421
420
|
* Modify an order.
|
|
@@ -423,18 +422,15 @@ export interface EvmUserModifyRequest extends BaseExchangeRequest {
|
|
|
423
422
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
|
|
424
423
|
*/
|
|
425
424
|
export interface ModifyRequest extends BaseExchangeRequest {
|
|
426
|
-
/** Action to be performed. */
|
|
427
425
|
action: {
|
|
428
426
|
/** Type of action. */
|
|
429
427
|
type: "modify";
|
|
430
|
-
/** Order ID. */
|
|
431
|
-
oid: number;
|
|
428
|
+
/** Order ID or CLient Order ID. */
|
|
429
|
+
oid: number | Hex;
|
|
432
430
|
/** New order parameters. */
|
|
433
431
|
order: OrderParams;
|
|
434
432
|
};
|
|
435
|
-
/** Vault address (for vault trading). */
|
|
436
433
|
vaultAddress?: Hex;
|
|
437
|
-
/** Expiration time of the action. */
|
|
438
434
|
expiresAfter?: number;
|
|
439
435
|
}
|
|
440
436
|
/**
|
|
@@ -443,7 +439,6 @@ export interface ModifyRequest extends BaseExchangeRequest {
|
|
|
443
439
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/multi-sig
|
|
444
440
|
*/
|
|
445
441
|
export interface MultiSigRequest extends BaseExchangeRequest {
|
|
446
|
-
/** Action to be performed. */
|
|
447
442
|
action: {
|
|
448
443
|
/** Type of action. */
|
|
449
444
|
type: "multiSig";
|
|
@@ -465,9 +460,7 @@ export interface MultiSigRequest extends BaseExchangeRequest {
|
|
|
465
460
|
action: BaseExchangeRequest["action"];
|
|
466
461
|
};
|
|
467
462
|
};
|
|
468
|
-
/** Vault address (for vault trading). */
|
|
469
463
|
vaultAddress?: Hex;
|
|
470
|
-
/** Expiration time of the action. */
|
|
471
464
|
expiresAfter?: number;
|
|
472
465
|
}
|
|
473
466
|
/**
|
|
@@ -476,7 +469,6 @@ export interface MultiSigRequest extends BaseExchangeRequest {
|
|
|
476
469
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
|
|
477
470
|
*/
|
|
478
471
|
export interface OrderRequest extends BaseExchangeRequest {
|
|
479
|
-
/** Action to be performed. */
|
|
480
472
|
action: {
|
|
481
473
|
/** Type of action. */
|
|
482
474
|
type: "order";
|
|
@@ -497,18 +489,15 @@ export interface OrderRequest extends BaseExchangeRequest {
|
|
|
497
489
|
f: number;
|
|
498
490
|
};
|
|
499
491
|
};
|
|
500
|
-
/** Vault address (for vault trading). */
|
|
501
492
|
vaultAddress?: Hex;
|
|
502
|
-
/** Expiration time of the action. */
|
|
503
493
|
expiresAfter?: number;
|
|
504
494
|
}
|
|
505
495
|
/**
|
|
506
496
|
* Deploying HIP-3 assets (Register Asset).
|
|
507
|
-
* @returns {
|
|
497
|
+
* @returns {SuccessResponse}
|
|
508
498
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-3-assets
|
|
509
499
|
*/
|
|
510
500
|
export interface PerpDeployRequest_RegisterAsset extends BaseExchangeRequest {
|
|
511
|
-
/** Action to be performed. */
|
|
512
501
|
action: {
|
|
513
502
|
/** Type of action. */
|
|
514
503
|
type: "perpDeploy";
|
|
@@ -542,14 +531,15 @@ export interface PerpDeployRequest_RegisterAsset extends BaseExchangeRequest {
|
|
|
542
531
|
} | null;
|
|
543
532
|
};
|
|
544
533
|
};
|
|
534
|
+
vaultAddress?: undefined;
|
|
535
|
+
expiresAfter?: undefined;
|
|
545
536
|
}
|
|
546
537
|
/**
|
|
547
538
|
* Deploying HIP-3 assets (Set Oracle).
|
|
548
|
-
* @returns {
|
|
539
|
+
* @returns {SuccessResponse}
|
|
549
540
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-3-assets
|
|
550
541
|
*/
|
|
551
542
|
export interface PerpDeployRequest_SetOracle extends BaseExchangeRequest {
|
|
552
|
-
/** Action to be performed. */
|
|
553
543
|
action: {
|
|
554
544
|
/** Type of action. */
|
|
555
545
|
type: "perpDeploy";
|
|
@@ -563,6 +553,8 @@ export interface PerpDeployRequest_SetOracle extends BaseExchangeRequest {
|
|
|
563
553
|
markPxs: [string, string][];
|
|
564
554
|
};
|
|
565
555
|
};
|
|
556
|
+
vaultAddress?: undefined;
|
|
557
|
+
expiresAfter?: undefined;
|
|
566
558
|
}
|
|
567
559
|
/**
|
|
568
560
|
* Transfer funds between Spot account and Perp dex account.
|
|
@@ -570,16 +562,13 @@ export interface PerpDeployRequest_SetOracle extends BaseExchangeRequest {
|
|
|
570
562
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#transfer-from-spot-account-to-perp-account-for-builder-deployed-dex-and-vice-versa
|
|
571
563
|
*/
|
|
572
564
|
export interface PerpDexClassTransferRequest extends BaseExchangeRequest {
|
|
573
|
-
/** Action to perform. */
|
|
574
565
|
action: {
|
|
575
566
|
/** Type of action. */
|
|
576
567
|
type: "PerpDexClassTransfer";
|
|
577
|
-
/** HyperLiquid network. */
|
|
578
|
-
hyperliquidChain: "Mainnet" | "Testnet";
|
|
579
568
|
/** Chain ID used for signing. */
|
|
580
569
|
signatureChainId: Hex;
|
|
581
|
-
/**
|
|
582
|
-
|
|
570
|
+
/** HyperLiquid network. */
|
|
571
|
+
hyperliquidChain: "Mainnet" | "Testnet";
|
|
583
572
|
/** Name of perp dex. */
|
|
584
573
|
dex: string;
|
|
585
574
|
/** Collateral token of the perp dex as a string. */
|
|
@@ -588,7 +577,11 @@ export interface PerpDexClassTransferRequest extends BaseExchangeRequest {
|
|
|
588
577
|
amount: string;
|
|
589
578
|
/** `true` for transferring from perp dex to spot account, `false` for transferring from spot account to perp dex. */
|
|
590
579
|
toPerp: boolean;
|
|
580
|
+
/** Unique request identifier (current timestamp in ms). */
|
|
581
|
+
nonce: number;
|
|
591
582
|
};
|
|
583
|
+
vaultAddress?: undefined;
|
|
584
|
+
expiresAfter?: undefined;
|
|
592
585
|
}
|
|
593
586
|
/**
|
|
594
587
|
* Create a referral code.
|
|
@@ -596,13 +589,14 @@ export interface PerpDexClassTransferRequest extends BaseExchangeRequest {
|
|
|
596
589
|
* @see null - no documentation
|
|
597
590
|
*/
|
|
598
591
|
export interface RegisterReferrerRequest extends BaseExchangeRequest {
|
|
599
|
-
/** Action to be performed. */
|
|
600
592
|
action: {
|
|
601
593
|
/** Type of action. */
|
|
602
594
|
type: "registerReferrer";
|
|
603
595
|
/** Referral code to create. */
|
|
604
596
|
code: string;
|
|
605
597
|
};
|
|
598
|
+
vaultAddress?: undefined;
|
|
599
|
+
expiresAfter?: undefined;
|
|
606
600
|
}
|
|
607
601
|
/**
|
|
608
602
|
* Reserve additional rate-limited actions for a fee.
|
|
@@ -610,14 +604,13 @@ export interface RegisterReferrerRequest extends BaseExchangeRequest {
|
|
|
610
604
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#reserve-additional-actions
|
|
611
605
|
*/
|
|
612
606
|
export interface ReserveRequestWeightRequest extends BaseExchangeRequest {
|
|
613
|
-
/** Action to perform. */
|
|
614
607
|
action: {
|
|
615
608
|
/** Type of action. */
|
|
616
609
|
type: "reserveRequestWeight";
|
|
617
610
|
/** Amount of request weight to reserve. */
|
|
618
611
|
weight: number;
|
|
619
612
|
};
|
|
620
|
-
|
|
613
|
+
vaultAddress?: undefined;
|
|
621
614
|
expiresAfter?: number;
|
|
622
615
|
}
|
|
623
616
|
/**
|
|
@@ -626,7 +619,6 @@ export interface ReserveRequestWeightRequest extends BaseExchangeRequest {
|
|
|
626
619
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#schedule-cancel-dead-mans-switch
|
|
627
620
|
*/
|
|
628
621
|
export interface ScheduleCancelRequest extends BaseExchangeRequest {
|
|
629
|
-
/** Action to be performed. */
|
|
630
622
|
action: {
|
|
631
623
|
/** Type of action. */
|
|
632
624
|
type: "scheduleCancel";
|
|
@@ -638,9 +630,7 @@ export interface ScheduleCancelRequest extends BaseExchangeRequest {
|
|
|
638
630
|
*/
|
|
639
631
|
time?: number;
|
|
640
632
|
};
|
|
641
|
-
/** Vault address (for vault trading). */
|
|
642
633
|
vaultAddress?: Hex;
|
|
643
|
-
/** Expiration time of the action. */
|
|
644
634
|
expiresAfter?: number;
|
|
645
635
|
}
|
|
646
636
|
/**
|
|
@@ -649,7 +639,6 @@ export interface ScheduleCancelRequest extends BaseExchangeRequest {
|
|
|
649
639
|
* @see null - no documentation
|
|
650
640
|
*/
|
|
651
641
|
export interface SetDisplayNameRequest extends BaseExchangeRequest {
|
|
652
|
-
/** Action to be performed. */
|
|
653
642
|
action: {
|
|
654
643
|
/** Type of action. */
|
|
655
644
|
type: "setDisplayName";
|
|
@@ -660,6 +649,8 @@ export interface SetDisplayNameRequest extends BaseExchangeRequest {
|
|
|
660
649
|
*/
|
|
661
650
|
displayName: string;
|
|
662
651
|
};
|
|
652
|
+
vaultAddress?: undefined;
|
|
653
|
+
expiresAfter?: undefined;
|
|
663
654
|
}
|
|
664
655
|
/**
|
|
665
656
|
* Set a referral code.
|
|
@@ -667,21 +658,21 @@ export interface SetDisplayNameRequest extends BaseExchangeRequest {
|
|
|
667
658
|
* @see null - no documentation
|
|
668
659
|
*/
|
|
669
660
|
export interface SetReferrerRequest extends BaseExchangeRequest {
|
|
670
|
-
/** Action to be performed. */
|
|
671
661
|
action: {
|
|
672
662
|
/** Type of action. */
|
|
673
663
|
type: "setReferrer";
|
|
674
664
|
/** Referral code. */
|
|
675
665
|
code: string;
|
|
676
666
|
};
|
|
667
|
+
vaultAddress?: undefined;
|
|
668
|
+
expiresAfter?: undefined;
|
|
677
669
|
}
|
|
678
670
|
/**
|
|
679
671
|
* Deploying HIP-1 and HIP-2 assets (Genesis).
|
|
680
|
-
* @returns {
|
|
672
|
+
* @returns {SuccessResponse}
|
|
681
673
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-1-and-hip-2-assets
|
|
682
674
|
*/
|
|
683
675
|
export interface SpotDeployRequest_Genesis extends BaseExchangeRequest {
|
|
684
|
-
/** Action to be performed. */
|
|
685
676
|
action: {
|
|
686
677
|
/** Type of action. */
|
|
687
678
|
type: "spotDeploy";
|
|
@@ -695,14 +686,15 @@ export interface SpotDeployRequest_Genesis extends BaseExchangeRequest {
|
|
|
695
686
|
noHyperliquidity?: true;
|
|
696
687
|
};
|
|
697
688
|
};
|
|
689
|
+
vaultAddress?: undefined;
|
|
690
|
+
expiresAfter?: undefined;
|
|
698
691
|
}
|
|
699
692
|
/**
|
|
700
693
|
* Deploying HIP-1 and HIP-2 assets (Register Hyperliquidity).
|
|
701
|
-
* @returns {
|
|
694
|
+
* @returns {SuccessResponse}
|
|
702
695
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-1-and-hip-2-assets
|
|
703
696
|
*/
|
|
704
697
|
export interface SpotDeployRequest_RegisterHyperliquidity extends BaseExchangeRequest {
|
|
705
|
-
/** Action to be performed. */
|
|
706
698
|
action: {
|
|
707
699
|
/** Type of action. */
|
|
708
700
|
type: "spotDeploy";
|
|
@@ -720,14 +712,15 @@ export interface SpotDeployRequest_RegisterHyperliquidity extends BaseExchangeRe
|
|
|
720
712
|
nSeededLevels?: number;
|
|
721
713
|
};
|
|
722
714
|
};
|
|
715
|
+
vaultAddress?: undefined;
|
|
716
|
+
expiresAfter?: undefined;
|
|
723
717
|
}
|
|
724
718
|
/**
|
|
725
719
|
* Deploying HIP-1 and HIP-2 assets (Register Spot).
|
|
726
|
-
* @returns {
|
|
720
|
+
* @returns {SuccessResponse}
|
|
727
721
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-1-and-hip-2-assets
|
|
728
722
|
*/
|
|
729
723
|
export interface SpotDeployRequest_RegisterSpot extends BaseExchangeRequest {
|
|
730
|
-
/** Action to be performed. */
|
|
731
724
|
action: {
|
|
732
725
|
/** Type of action. */
|
|
733
726
|
type: "spotDeploy";
|
|
@@ -737,14 +730,15 @@ export interface SpotDeployRequest_RegisterSpot extends BaseExchangeRequest {
|
|
|
737
730
|
tokens: [number, number];
|
|
738
731
|
};
|
|
739
732
|
};
|
|
733
|
+
vaultAddress?: undefined;
|
|
734
|
+
expiresAfter?: undefined;
|
|
740
735
|
}
|
|
741
736
|
/**
|
|
742
737
|
* Deploying HIP-1 and HIP-2 assets (Register Token).
|
|
743
|
-
* @returns {
|
|
738
|
+
* @returns {SuccessResponse}
|
|
744
739
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-1-and-hip-2-assets
|
|
745
740
|
*/
|
|
746
741
|
export interface SpotDeployRequest_RegisterToken2 extends BaseExchangeRequest {
|
|
747
|
-
/** Action to be performed. */
|
|
748
742
|
action: {
|
|
749
743
|
/** Type of action. */
|
|
750
744
|
type: "spotDeploy";
|
|
@@ -765,14 +759,15 @@ export interface SpotDeployRequest_RegisterToken2 extends BaseExchangeRequest {
|
|
|
765
759
|
fullName?: string;
|
|
766
760
|
};
|
|
767
761
|
};
|
|
762
|
+
vaultAddress?: undefined;
|
|
763
|
+
expiresAfter?: undefined;
|
|
768
764
|
}
|
|
769
765
|
/**
|
|
770
766
|
* Deploying HIP-1 and HIP-2 assets (Set Deployer Trading Fee Share).
|
|
771
|
-
* @returns {
|
|
767
|
+
* @returns {SuccessResponse}
|
|
772
768
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-1-and-hip-2-assets
|
|
773
769
|
*/
|
|
774
770
|
export interface SpotDeployRequest_SetDeployerTradingFeeShare extends BaseExchangeRequest {
|
|
775
|
-
/** Action to be performed. */
|
|
776
771
|
action: {
|
|
777
772
|
/** Type of action. */
|
|
778
773
|
type: "spotDeploy";
|
|
@@ -784,14 +779,15 @@ export interface SpotDeployRequest_SetDeployerTradingFeeShare extends BaseExchan
|
|
|
784
779
|
share: `${string}%`;
|
|
785
780
|
};
|
|
786
781
|
};
|
|
782
|
+
vaultAddress?: undefined;
|
|
783
|
+
expiresAfter?: undefined;
|
|
787
784
|
}
|
|
788
785
|
/**
|
|
789
786
|
* Deploying HIP-1 and HIP-2 assets (User Genesis).
|
|
790
|
-
* @returns {
|
|
787
|
+
* @returns {SuccessResponse}
|
|
791
788
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-1-and-hip-2-assets
|
|
792
789
|
*/
|
|
793
790
|
export interface SpotDeployRequest_UserGenesis extends BaseExchangeRequest {
|
|
794
|
-
/** Action to be performed. */
|
|
795
791
|
action: {
|
|
796
792
|
/** Type of action. */
|
|
797
793
|
type: "spotDeploy";
|
|
@@ -807,6 +803,8 @@ export interface SpotDeployRequest_UserGenesis extends BaseExchangeRequest {
|
|
|
807
803
|
blacklistUsers?: [string, boolean][];
|
|
808
804
|
};
|
|
809
805
|
};
|
|
806
|
+
vaultAddress?: undefined;
|
|
807
|
+
expiresAfter?: undefined;
|
|
810
808
|
}
|
|
811
809
|
/**
|
|
812
810
|
* Send spot assets to another address.
|
|
@@ -814,23 +812,24 @@ export interface SpotDeployRequest_UserGenesis extends BaseExchangeRequest {
|
|
|
814
812
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-spot-transfer
|
|
815
813
|
*/
|
|
816
814
|
export interface SpotSendRequest extends BaseExchangeRequest {
|
|
817
|
-
/** Action to be performed. */
|
|
818
815
|
action: {
|
|
819
816
|
/** Type of action. */
|
|
820
817
|
type: "spotSend";
|
|
821
|
-
/** HyperLiquid network. */
|
|
822
|
-
hyperliquidChain: "Mainnet" | "Testnet";
|
|
823
818
|
/** Chain ID used for signing. */
|
|
824
819
|
signatureChainId: Hex;
|
|
825
|
-
/**
|
|
826
|
-
|
|
820
|
+
/** HyperLiquid network. */
|
|
821
|
+
hyperliquidChain: "Mainnet" | "Testnet";
|
|
827
822
|
/** Destination address. */
|
|
828
823
|
destination: Hex;
|
|
829
824
|
/** Token identifier. */
|
|
830
825
|
token: `${string}:${Hex}`;
|
|
831
826
|
/** Amount to send (not in wei). */
|
|
832
827
|
amount: string;
|
|
828
|
+
/** Unique request identifier (current timestamp in ms). */
|
|
829
|
+
time: number;
|
|
833
830
|
};
|
|
831
|
+
vaultAddress?: undefined;
|
|
832
|
+
expiresAfter?: undefined;
|
|
834
833
|
}
|
|
835
834
|
/**
|
|
836
835
|
* Opt Out of Spot Dusting.
|
|
@@ -838,7 +837,6 @@ export interface SpotSendRequest extends BaseExchangeRequest {
|
|
|
838
837
|
* @see null - no documentation
|
|
839
838
|
*/
|
|
840
839
|
export interface SpotUserRequest extends BaseExchangeRequest {
|
|
841
|
-
/** Action to be performed. */
|
|
842
840
|
action: {
|
|
843
841
|
/** Type of action. */
|
|
844
842
|
type: "spotUser";
|
|
@@ -848,6 +846,8 @@ export interface SpotUserRequest extends BaseExchangeRequest {
|
|
|
848
846
|
optOut: boolean;
|
|
849
847
|
};
|
|
850
848
|
};
|
|
849
|
+
vaultAddress?: undefined;
|
|
850
|
+
expiresAfter?: undefined;
|
|
851
851
|
}
|
|
852
852
|
/**
|
|
853
853
|
* Transfer between sub-accounts (spot).
|
|
@@ -855,7 +855,6 @@ export interface SpotUserRequest extends BaseExchangeRequest {
|
|
|
855
855
|
* @see null - no documentation
|
|
856
856
|
*/
|
|
857
857
|
export interface SubAccountSpotTransferRequest extends BaseExchangeRequest {
|
|
858
|
-
/** Action to be performed. */
|
|
859
858
|
action: {
|
|
860
859
|
/** Type of action. */
|
|
861
860
|
type: "subAccountSpotTransfer";
|
|
@@ -868,6 +867,8 @@ export interface SubAccountSpotTransferRequest extends BaseExchangeRequest {
|
|
|
868
867
|
/** Amount to send (not in wei). */
|
|
869
868
|
amount: string;
|
|
870
869
|
};
|
|
870
|
+
vaultAddress?: undefined;
|
|
871
|
+
expiresAfter?: undefined;
|
|
871
872
|
}
|
|
872
873
|
/**
|
|
873
874
|
* Transfer between sub-accounts (perpetual).
|
|
@@ -875,7 +876,6 @@ export interface SubAccountSpotTransferRequest extends BaseExchangeRequest {
|
|
|
875
876
|
* @see null - no documentation
|
|
876
877
|
*/
|
|
877
878
|
export interface SubAccountTransferRequest extends BaseExchangeRequest {
|
|
878
|
-
/** Action to be performed. */
|
|
879
879
|
action: {
|
|
880
880
|
/** Type of action. */
|
|
881
881
|
type: "subAccountTransfer";
|
|
@@ -886,6 +886,8 @@ export interface SubAccountTransferRequest extends BaseExchangeRequest {
|
|
|
886
886
|
/** Amount to transfer (float * 1e6). */
|
|
887
887
|
usd: number;
|
|
888
888
|
};
|
|
889
|
+
vaultAddress?: undefined;
|
|
890
|
+
expiresAfter?: undefined;
|
|
889
891
|
}
|
|
890
892
|
/**
|
|
891
893
|
* Delegate or undelegate native tokens to or from a validator.
|
|
@@ -893,23 +895,24 @@ export interface SubAccountTransferRequest extends BaseExchangeRequest {
|
|
|
893
895
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#delegate-or-undelegate-stake-from-validator
|
|
894
896
|
*/
|
|
895
897
|
export interface TokenDelegateRequest extends BaseExchangeRequest {
|
|
896
|
-
/** Action to be performed. */
|
|
897
898
|
action: {
|
|
898
899
|
/** Type of action. */
|
|
899
900
|
type: "tokenDelegate";
|
|
900
|
-
/** HyperLiquid network. */
|
|
901
|
-
hyperliquidChain: "Mainnet" | "Testnet";
|
|
902
901
|
/** Chain ID used for signing. */
|
|
903
902
|
signatureChainId: Hex;
|
|
904
|
-
/**
|
|
905
|
-
|
|
903
|
+
/** HyperLiquid network. */
|
|
904
|
+
hyperliquidChain: "Mainnet" | "Testnet";
|
|
906
905
|
/** Validator address. */
|
|
907
906
|
validator: Hex;
|
|
908
|
-
/** `true` for undelegate, `false` for delegate. */
|
|
909
|
-
isUndelegate: boolean;
|
|
910
907
|
/** Amount for delegate/undelegate (float * 1e8). */
|
|
911
908
|
wei: number;
|
|
909
|
+
/** `true` for undelegate, `false` for delegate. */
|
|
910
|
+
isUndelegate: boolean;
|
|
911
|
+
/** Unique request identifier (current timestamp in ms). */
|
|
912
|
+
nonce: number;
|
|
912
913
|
};
|
|
914
|
+
vaultAddress?: undefined;
|
|
915
|
+
expiresAfter?: undefined;
|
|
913
916
|
}
|
|
914
917
|
/**
|
|
915
918
|
* Cancel a TWAP order.
|
|
@@ -917,7 +920,6 @@ export interface TokenDelegateRequest extends BaseExchangeRequest {
|
|
|
917
920
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-a-twap-order
|
|
918
921
|
*/
|
|
919
922
|
export interface TwapCancelRequest extends BaseExchangeRequest {
|
|
920
|
-
/** Action to be performed. */
|
|
921
923
|
action: {
|
|
922
924
|
/** Type of action. */
|
|
923
925
|
type: "twapCancel";
|
|
@@ -926,9 +928,7 @@ export interface TwapCancelRequest extends BaseExchangeRequest {
|
|
|
926
928
|
/** Twap ID. */
|
|
927
929
|
t: number;
|
|
928
930
|
};
|
|
929
|
-
/** Vault address (for vault trading). */
|
|
930
931
|
vaultAddress?: Hex;
|
|
931
|
-
/** Expiration time of the action. */
|
|
932
932
|
expiresAfter?: number;
|
|
933
933
|
}
|
|
934
934
|
/**
|
|
@@ -937,7 +937,6 @@ export interface TwapCancelRequest extends BaseExchangeRequest {
|
|
|
937
937
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-a-twap-order
|
|
938
938
|
*/
|
|
939
939
|
export interface TwapOrderRequest extends BaseExchangeRequest {
|
|
940
|
-
/** Action to be performed. */
|
|
941
940
|
action: {
|
|
942
941
|
/** Type of action. */
|
|
943
942
|
type: "twapOrder";
|
|
@@ -957,9 +956,7 @@ export interface TwapOrderRequest extends BaseExchangeRequest {
|
|
|
957
956
|
t: boolean;
|
|
958
957
|
};
|
|
959
958
|
};
|
|
960
|
-
/** Vault address (for vault trading). */
|
|
961
959
|
vaultAddress?: Hex;
|
|
962
|
-
/** Expiration time of the action. */
|
|
963
960
|
expiresAfter?: number;
|
|
964
961
|
}
|
|
965
962
|
/**
|
|
@@ -968,7 +965,6 @@ export interface TwapOrderRequest extends BaseExchangeRequest {
|
|
|
968
965
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
|
|
969
966
|
*/
|
|
970
967
|
export interface UpdateIsolatedMarginRequest extends BaseExchangeRequest {
|
|
971
|
-
/** Action to be performed. */
|
|
972
968
|
action: {
|
|
973
969
|
/** Type of action. */
|
|
974
970
|
type: "updateIsolatedMargin";
|
|
@@ -979,9 +975,7 @@ export interface UpdateIsolatedMarginRequest extends BaseExchangeRequest {
|
|
|
979
975
|
/** Amount to adjust (float * 1e6). */
|
|
980
976
|
ntli: number;
|
|
981
977
|
};
|
|
982
|
-
/** Vault address (for vault trading). */
|
|
983
978
|
vaultAddress?: Hex;
|
|
984
|
-
/** Expiration time of the action. */
|
|
985
979
|
expiresAfter?: number;
|
|
986
980
|
}
|
|
987
981
|
/**
|
|
@@ -990,7 +984,6 @@ export interface UpdateIsolatedMarginRequest extends BaseExchangeRequest {
|
|
|
990
984
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-leverage
|
|
991
985
|
*/
|
|
992
986
|
export interface UpdateLeverageRequest extends BaseExchangeRequest {
|
|
993
|
-
/** Action to be performed. */
|
|
994
987
|
action: {
|
|
995
988
|
/** Type of action. */
|
|
996
989
|
type: "updateLeverage";
|
|
@@ -1001,9 +994,7 @@ export interface UpdateLeverageRequest extends BaseExchangeRequest {
|
|
|
1001
994
|
/** New leverage value. */
|
|
1002
995
|
leverage: number;
|
|
1003
996
|
};
|
|
1004
|
-
/** Vault address (for vault trading). */
|
|
1005
997
|
vaultAddress?: Hex;
|
|
1006
|
-
/** Expiration time of the action. */
|
|
1007
998
|
expiresAfter?: number;
|
|
1008
999
|
}
|
|
1009
1000
|
/**
|
|
@@ -1012,21 +1003,22 @@ export interface UpdateLeverageRequest extends BaseExchangeRequest {
|
|
|
1012
1003
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#transfer-from-spot-account-to-perp-account-and-vice-versa
|
|
1013
1004
|
*/
|
|
1014
1005
|
export interface UsdClassTransferRequest extends BaseExchangeRequest {
|
|
1015
|
-
/** Action to be performed. */
|
|
1016
1006
|
action: {
|
|
1017
1007
|
/** Type of action. */
|
|
1018
1008
|
type: "usdClassTransfer";
|
|
1019
|
-
/** HyperLiquid network. */
|
|
1020
|
-
hyperliquidChain: "Mainnet" | "Testnet";
|
|
1021
1009
|
/** Chain ID used for signing. */
|
|
1022
1010
|
signatureChainId: Hex;
|
|
1023
|
-
/**
|
|
1024
|
-
|
|
1011
|
+
/** HyperLiquid network. */
|
|
1012
|
+
hyperliquidChain: "Mainnet" | "Testnet";
|
|
1025
1013
|
/** Amount to transfer (1 = 1$). */
|
|
1026
1014
|
amount: string;
|
|
1027
1015
|
/** `true` for Spot to Perp, `false` for Perp to Spot. */
|
|
1028
1016
|
toPerp: boolean;
|
|
1017
|
+
/** Unique request identifier (current timestamp in ms). */
|
|
1018
|
+
nonce: number;
|
|
1029
1019
|
};
|
|
1020
|
+
vaultAddress?: undefined;
|
|
1021
|
+
expiresAfter?: undefined;
|
|
1030
1022
|
}
|
|
1031
1023
|
/**
|
|
1032
1024
|
* Send usd to another address.
|
|
@@ -1034,21 +1026,22 @@ export interface UsdClassTransferRequest extends BaseExchangeRequest {
|
|
|
1034
1026
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-usdc-transfer
|
|
1035
1027
|
*/
|
|
1036
1028
|
export interface UsdSendRequest extends BaseExchangeRequest {
|
|
1037
|
-
/** Action to be performed. */
|
|
1038
1029
|
action: {
|
|
1039
1030
|
/** Type of action. */
|
|
1040
1031
|
type: "usdSend";
|
|
1041
|
-
/** HyperLiquid network. */
|
|
1042
|
-
hyperliquidChain: "Mainnet" | "Testnet";
|
|
1043
1032
|
/** Chain ID used for signing. */
|
|
1044
1033
|
signatureChainId: Hex;
|
|
1045
|
-
/**
|
|
1046
|
-
|
|
1034
|
+
/** HyperLiquid network. */
|
|
1035
|
+
hyperliquidChain: "Mainnet" | "Testnet";
|
|
1047
1036
|
/** Destination address. */
|
|
1048
1037
|
destination: Hex;
|
|
1049
1038
|
/** Amount to send (1 = 1$). */
|
|
1050
1039
|
amount: string;
|
|
1040
|
+
/** Unique request identifier (current timestamp in ms). */
|
|
1041
|
+
time: number;
|
|
1051
1042
|
};
|
|
1043
|
+
vaultAddress?: undefined;
|
|
1044
|
+
expiresAfter?: undefined;
|
|
1052
1045
|
}
|
|
1053
1046
|
/**
|
|
1054
1047
|
* Distribute funds from a vault between followers.
|
|
@@ -1056,7 +1049,6 @@ export interface UsdSendRequest extends BaseExchangeRequest {
|
|
|
1056
1049
|
* @see null - no documentation
|
|
1057
1050
|
*/
|
|
1058
1051
|
export interface VaultDistributeRequest extends BaseExchangeRequest {
|
|
1059
|
-
/** Action to be performed. */
|
|
1060
1052
|
action: {
|
|
1061
1053
|
/** Type of action. */
|
|
1062
1054
|
type: "vaultDistribute";
|
|
@@ -1069,6 +1061,8 @@ export interface VaultDistributeRequest extends BaseExchangeRequest {
|
|
|
1069
1061
|
*/
|
|
1070
1062
|
usd: number;
|
|
1071
1063
|
};
|
|
1064
|
+
vaultAddress?: undefined;
|
|
1065
|
+
expiresAfter?: undefined;
|
|
1072
1066
|
}
|
|
1073
1067
|
/**
|
|
1074
1068
|
* Modify a vault's configuration.
|
|
@@ -1076,7 +1070,6 @@ export interface VaultDistributeRequest extends BaseExchangeRequest {
|
|
|
1076
1070
|
* @see null - no documentation
|
|
1077
1071
|
*/
|
|
1078
1072
|
export interface VaultModifyRequest extends BaseExchangeRequest {
|
|
1079
|
-
/** Action to be performed. */
|
|
1080
1073
|
action: {
|
|
1081
1074
|
/** Type of action. */
|
|
1082
1075
|
type: "vaultModify";
|
|
@@ -1087,6 +1080,8 @@ export interface VaultModifyRequest extends BaseExchangeRequest {
|
|
|
1087
1080
|
/** Always close positions on withdrawal. */
|
|
1088
1081
|
alwaysCloseOnWithdraw: boolean | null;
|
|
1089
1082
|
};
|
|
1083
|
+
vaultAddress?: undefined;
|
|
1084
|
+
expiresAfter?: undefined;
|
|
1090
1085
|
}
|
|
1091
1086
|
/**
|
|
1092
1087
|
* Deposit or withdraw from a vault.
|
|
@@ -1094,7 +1089,6 @@ export interface VaultModifyRequest extends BaseExchangeRequest {
|
|
|
1094
1089
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault
|
|
1095
1090
|
*/
|
|
1096
1091
|
export interface VaultTransferRequest extends BaseExchangeRequest {
|
|
1097
|
-
/** Action to be performed. */
|
|
1098
1092
|
action: {
|
|
1099
1093
|
/** Type of action. */
|
|
1100
1094
|
type: "vaultTransfer";
|
|
@@ -1105,7 +1099,7 @@ export interface VaultTransferRequest extends BaseExchangeRequest {
|
|
|
1105
1099
|
/** Amount for deposit/withdrawal (float * 1e6). */
|
|
1106
1100
|
usd: number;
|
|
1107
1101
|
};
|
|
1108
|
-
|
|
1102
|
+
vaultAddress?: undefined;
|
|
1109
1103
|
expiresAfter?: number;
|
|
1110
1104
|
}
|
|
1111
1105
|
/**
|
|
@@ -1114,20 +1108,21 @@ export interface VaultTransferRequest extends BaseExchangeRequest {
|
|
|
1114
1108
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
|
|
1115
1109
|
*/
|
|
1116
1110
|
export interface Withdraw3Request extends BaseExchangeRequest {
|
|
1117
|
-
/** Action to be performed. */
|
|
1118
1111
|
action: {
|
|
1119
1112
|
/** Type of action. */
|
|
1120
1113
|
type: "withdraw3";
|
|
1121
|
-
/** HyperLiquid network. */
|
|
1122
|
-
hyperliquidChain: "Mainnet" | "Testnet";
|
|
1123
1114
|
/** Chain ID used for signing. */
|
|
1124
1115
|
signatureChainId: Hex;
|
|
1125
|
-
/**
|
|
1126
|
-
|
|
1127
|
-
/** Amount to withdraw (1 = 1$). */
|
|
1128
|
-
amount: string;
|
|
1116
|
+
/** HyperLiquid network. */
|
|
1117
|
+
hyperliquidChain: "Mainnet" | "Testnet";
|
|
1129
1118
|
/** Destination address. */
|
|
1130
1119
|
destination: Hex;
|
|
1120
|
+
/** Amount to withdraw (1 = 1$). */
|
|
1121
|
+
amount: string;
|
|
1122
|
+
/** Unique request identifier (current timestamp in ms). */
|
|
1123
|
+
time: number;
|
|
1131
1124
|
};
|
|
1125
|
+
vaultAddress?: undefined;
|
|
1126
|
+
expiresAfter?: undefined;
|
|
1132
1127
|
}
|
|
1133
1128
|
//# sourceMappingURL=requests.d.ts.map
|