@nktkas/hyperliquid 0.13.0 → 0.13.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.
Files changed (118) hide show
  1. package/README.md +9 -0
  2. package/esm/mod.d.ts +14 -14
  3. package/esm/mod.d.ts.map +1 -1
  4. package/esm/src/clients/event.d.ts +8 -6
  5. package/esm/src/clients/event.d.ts.map +1 -1
  6. package/esm/src/clients/event.js +4 -2
  7. package/esm/src/clients/public.d.ts +7 -7
  8. package/esm/src/clients/public.d.ts.map +1 -1
  9. package/esm/src/clients/wallet.d.ts +3 -3
  10. package/esm/src/clients/wallet.d.ts.map +1 -1
  11. package/esm/src/clients/wallet.js +9 -7
  12. package/esm/src/transports/http/http_transport.d.ts.map +1 -1
  13. package/esm/src/transports/http/http_transport.js +4 -1
  14. package/esm/src/transports/websocket/websocket_request_dispatcher.d.ts.map +1 -1
  15. package/esm/src/transports/websocket/websocket_request_dispatcher.js +4 -4
  16. package/esm/src/types/common.d.ts +3 -0
  17. package/esm/src/types/common.d.ts.map +1 -0
  18. package/esm/src/types/common.js +1 -0
  19. package/esm/src/types/exchange/common.d.ts +36 -0
  20. package/esm/src/types/exchange/common.d.ts.map +1 -0
  21. package/esm/src/types/exchange/common.js +1 -0
  22. package/esm/src/types/exchange/requests.d.ts +435 -0
  23. package/esm/src/types/exchange/requests.d.ts.map +1 -0
  24. package/esm/src/types/exchange/requests.js +1 -0
  25. package/esm/src/types/exchange/responses.d.ts +141 -0
  26. package/esm/src/types/exchange/responses.d.ts.map +1 -0
  27. package/esm/src/types/exchange/responses.js +1 -0
  28. package/esm/src/types/explorer/common.d.ts +37 -0
  29. package/esm/src/types/explorer/common.d.ts.map +1 -0
  30. package/esm/src/types/explorer/common.js +1 -0
  31. package/esm/src/types/explorer/requests.d.ts +22 -0
  32. package/esm/src/types/explorer/requests.d.ts.map +1 -0
  33. package/esm/src/types/explorer/requests.js +1 -0
  34. package/esm/src/types/explorer/responses.d.ts +16 -0
  35. package/esm/src/types/explorer/responses.d.ts.map +1 -0
  36. package/esm/src/types/explorer/responses.js +1 -0
  37. package/esm/src/types/info/accounts.d.ts +424 -0
  38. package/esm/src/types/info/accounts.d.ts.map +1 -0
  39. package/esm/src/types/info/accounts.js +1 -0
  40. package/esm/src/types/info/assets.d.ts +271 -0
  41. package/esm/src/types/info/assets.d.ts.map +1 -0
  42. package/esm/src/types/info/assets.js +1 -0
  43. package/esm/src/types/info/orders.d.ts +209 -0
  44. package/esm/src/types/info/orders.d.ts.map +1 -0
  45. package/esm/src/types/info/orders.js +1 -0
  46. package/esm/src/types/info/requests.d.ts +380 -0
  47. package/esm/src/types/info/requests.d.ts.map +1 -0
  48. package/esm/src/types/info/requests.js +1 -0
  49. package/esm/src/types/info/vaults.d.ts +133 -0
  50. package/esm/src/types/info/vaults.d.ts.map +1 -0
  51. package/esm/src/types/info/vaults.js +1 -0
  52. package/esm/src/types/subscriptions/common.d.ts +205 -0
  53. package/esm/src/types/subscriptions/common.d.ts.map +1 -0
  54. package/esm/src/types/subscriptions/common.js +1 -0
  55. package/esm/src/types/subscriptions/requests.d.ts +124 -0
  56. package/esm/src/types/subscriptions/requests.d.ts.map +1 -0
  57. package/esm/src/types/subscriptions/requests.js +1 -0
  58. package/esm/src/utils/key_sort.d.ts +2 -2
  59. package/esm/src/utils/key_sort.d.ts.map +1 -1
  60. package/package.json +2 -2
  61. package/script/mod.d.ts +14 -14
  62. package/script/mod.d.ts.map +1 -1
  63. package/script/src/clients/event.d.ts +8 -6
  64. package/script/src/clients/event.d.ts.map +1 -1
  65. package/script/src/clients/event.js +4 -2
  66. package/script/src/clients/public.d.ts +7 -7
  67. package/script/src/clients/public.d.ts.map +1 -1
  68. package/script/src/clients/wallet.d.ts +3 -3
  69. package/script/src/clients/wallet.d.ts.map +1 -1
  70. package/script/src/clients/wallet.js +9 -7
  71. package/script/src/transports/http/http_transport.d.ts.map +1 -1
  72. package/script/src/transports/http/http_transport.js +4 -1
  73. package/script/src/transports/websocket/websocket_request_dispatcher.d.ts.map +1 -1
  74. package/script/src/transports/websocket/websocket_request_dispatcher.js +4 -4
  75. package/script/src/types/common.d.ts +3 -0
  76. package/script/src/types/common.d.ts.map +1 -0
  77. package/script/src/types/common.js +2 -0
  78. package/script/src/types/exchange/common.d.ts +36 -0
  79. package/script/src/types/exchange/common.d.ts.map +1 -0
  80. package/script/src/types/exchange/common.js +2 -0
  81. package/script/src/types/exchange/requests.d.ts +435 -0
  82. package/script/src/types/exchange/requests.d.ts.map +1 -0
  83. package/script/src/types/exchange/requests.js +2 -0
  84. package/script/src/types/exchange/responses.d.ts +141 -0
  85. package/script/src/types/exchange/responses.d.ts.map +1 -0
  86. package/script/src/types/exchange/responses.js +2 -0
  87. package/script/src/types/explorer/common.d.ts +37 -0
  88. package/script/src/types/explorer/common.d.ts.map +1 -0
  89. package/script/src/types/explorer/common.js +2 -0
  90. package/script/src/types/explorer/requests.d.ts +22 -0
  91. package/script/src/types/explorer/requests.d.ts.map +1 -0
  92. package/script/src/types/explorer/requests.js +2 -0
  93. package/script/src/types/explorer/responses.d.ts +16 -0
  94. package/script/src/types/explorer/responses.d.ts.map +1 -0
  95. package/script/src/types/explorer/responses.js +2 -0
  96. package/script/src/types/info/accounts.d.ts +424 -0
  97. package/script/src/types/info/accounts.d.ts.map +1 -0
  98. package/script/src/types/info/accounts.js +2 -0
  99. package/script/src/types/info/assets.d.ts +271 -0
  100. package/script/src/types/info/assets.d.ts.map +1 -0
  101. package/script/src/types/info/assets.js +2 -0
  102. package/script/src/types/info/orders.d.ts +209 -0
  103. package/script/src/types/info/orders.d.ts.map +1 -0
  104. package/script/src/types/info/orders.js +2 -0
  105. package/script/src/types/info/requests.d.ts +380 -0
  106. package/script/src/types/info/requests.d.ts.map +1 -0
  107. package/script/src/types/info/requests.js +2 -0
  108. package/script/src/types/info/vaults.d.ts +133 -0
  109. package/script/src/types/info/vaults.d.ts.map +1 -0
  110. package/script/src/types/info/vaults.js +2 -0
  111. package/script/src/types/subscriptions/common.d.ts +205 -0
  112. package/script/src/types/subscriptions/common.d.ts.map +1 -0
  113. package/script/src/types/subscriptions/common.js +2 -0
  114. package/script/src/types/subscriptions/requests.d.ts +124 -0
  115. package/script/src/types/subscriptions/requests.d.ts.map +1 -0
  116. package/script/src/types/subscriptions/requests.js +2 -0
  117. package/script/src/utils/key_sort.d.ts +2 -2
  118. package/script/src/utils/key_sort.d.ts.map +1 -1
@@ -0,0 +1,435 @@
1
+ import type { Hex } from "../common.js";
2
+ import type { OrderParms } from "./common.js";
3
+ /** Base structure for exchange requests. */
4
+ export interface BaseExchangeRequest {
5
+ /** Action to perform. */
6
+ action: {
7
+ /** Type of action. */
8
+ type: string;
9
+ /** Additional action parameters. */
10
+ [key: string]: unknown;
11
+ };
12
+ /** Unique request identifier (recommended: current timestamp in ms). */
13
+ nonce: number;
14
+ /** Cryptographic signature. */
15
+ signature: {
16
+ r: Hex;
17
+ s: Hex;
18
+ v: number;
19
+ };
20
+ }
21
+ /**
22
+ * Approve an agent to sign on behalf of the master or sub-accounts.
23
+ * @returns {SuccessResponse}
24
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-an-api-wallet | Hyperliquid GitBook}
25
+ */
26
+ export interface ApproveAgentRequest extends BaseExchangeRequest {
27
+ /** Action to be performed. */
28
+ action: {
29
+ /** Type of action. */
30
+ type: "approveAgent";
31
+ /** HyperLiquid network. */
32
+ hyperliquidChain: "Mainnet" | "Testnet";
33
+ /** Chain ID used for signing. */
34
+ signatureChainId: Hex;
35
+ /** Agent address. */
36
+ agentAddress: Hex;
37
+ /** Agent name. */
38
+ agentName: string;
39
+ /** Unique request identifier (recommended: current timestamp in ms). */
40
+ nonce: number;
41
+ };
42
+ }
43
+ /**
44
+ * Approve a max fee rate for a builder address.
45
+ * @returns {SuccessResponse}
46
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-a-builder-fee | Hyperliquid GitBook}
47
+ */
48
+ export interface ApproveBuilderFeeRequest extends BaseExchangeRequest {
49
+ /** Action to be performed. */
50
+ action: {
51
+ /** Type of action. */
52
+ type: "approveBuilderFee";
53
+ /** HyperLiquid network. */
54
+ hyperliquidChain: "Mainnet" | "Testnet";
55
+ /** Chain ID used for signing. */
56
+ signatureChainId: Hex;
57
+ /** Max fee rate (e.g., "0.01%"). */
58
+ maxFeeRate: `${string}%`;
59
+ /** Builder address. */
60
+ builder: Hex;
61
+ /** Unique request identifier (recommended: current timestamp in ms). */
62
+ nonce: number;
63
+ };
64
+ }
65
+ /**
66
+ * Modify multiple orders.
67
+ * @returns {OrderResponse}
68
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders | Hyperliquid GitBook}
69
+ */
70
+ export interface BatchModifyRequest extends BaseExchangeRequest {
71
+ /** Action to be performed. */
72
+ action: {
73
+ /** Type of action. */
74
+ type: "batchModify";
75
+ /** Order modifications. */
76
+ modifies: {
77
+ /** Order ID to modify. */
78
+ oid: number;
79
+ /** New order parameters. */
80
+ order: OrderParms;
81
+ }[];
82
+ };
83
+ /** Vault address (optional, for vault trading). */
84
+ vaultAddress?: Hex;
85
+ }
86
+ /**
87
+ * Cancel order(s).
88
+ * @returns {CancelResponse}
89
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s | Hyperliquid GitBook}
90
+ */
91
+ export interface CancelRequest extends BaseExchangeRequest {
92
+ /** Action to be performed. */
93
+ action: {
94
+ /** Type of action. */
95
+ type: "cancel";
96
+ /** Orders to cancel. */
97
+ cancels: {
98
+ /** An integer representing the asset being traded. */
99
+ a: number;
100
+ /** Order ID. */
101
+ o: number;
102
+ }[];
103
+ };
104
+ /** Vault address (optional, for vault trading). */
105
+ vaultAddress?: Hex;
106
+ }
107
+ /**
108
+ * Cancel order(s) by Client Order ID.
109
+ * @returns {CancelResponse}
110
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid | Hyperliquid GitBook}
111
+ */
112
+ export interface CancelByCloidRequest extends BaseExchangeRequest {
113
+ /** Action to be performed. */
114
+ action: {
115
+ /** Type of action. */
116
+ type: "cancelByCloid";
117
+ /** Orders to cancel. */
118
+ cancels: {
119
+ /** An integer representing the asset being traded. */
120
+ asset: number;
121
+ /** Client Order ID. */
122
+ cloid: Hex;
123
+ }[];
124
+ };
125
+ /** Vault address (optional, for vault trading). */
126
+ vaultAddress?: Hex;
127
+ }
128
+ /**
129
+ * Create a sub-account.
130
+ * @returns {CreateSubAccountResponse}
131
+ */
132
+ export interface CreateSubAccountRequest extends BaseExchangeRequest {
133
+ /** Action to be performed. */
134
+ action: {
135
+ /** Type of action. */
136
+ type: "createSubAccount";
137
+ /** Sub-account name. */
138
+ name: string;
139
+ };
140
+ }
141
+ /**
142
+ * Modify an order.
143
+ * @returns {SuccessResponse}
144
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order | Hyperliquid GitBook}
145
+ */
146
+ export interface ModifyRequest extends BaseExchangeRequest {
147
+ /** Action to be performed. */
148
+ action: {
149
+ /** Type of action. */
150
+ type: "modify";
151
+ /** Order ID to modify. */
152
+ oid: number;
153
+ /** New order parameters. */
154
+ order: OrderParms;
155
+ };
156
+ /** Vault address (optional, for vault trading). */
157
+ vaultAddress?: Hex;
158
+ }
159
+ /**
160
+ * Place an order(s).
161
+ * @returns {OrderResponse}
162
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order | Hyperliquid GitBook}
163
+ */
164
+ export interface OrderRequest extends BaseExchangeRequest {
165
+ /** Action to be performed. */
166
+ action: {
167
+ /** Type of action. */
168
+ type: "order";
169
+ /** Order parameters. */
170
+ orders: OrderParms[];
171
+ /**
172
+ * Order grouping strategy:
173
+ * - `"na"`: Standard order without grouping.
174
+ * - `"normalTpsl"`: TP/SL order with fixed size that doesn't adjust with position changes.
175
+ * - `"positionTpsl"`: TP/SL order that adjusts proportionally with the position size.
176
+ */
177
+ grouping: "na" | "normalTpsl" | "positionTpsl";
178
+ /** Builder fee. */
179
+ builder?: {
180
+ /** The address of the builder. */
181
+ b: Hex;
182
+ /** The builder fee to charge in tenths of basis points. */
183
+ f: number;
184
+ };
185
+ };
186
+ /** Vault address (optional, for vault trading). */
187
+ vaultAddress?: Hex;
188
+ }
189
+ /**
190
+ * Schedule a time to cancel all open orders.
191
+ * @returns {SuccessResponse}
192
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#schedule-cancel-dead-mans-switch | Hyperliquid GitBook}
193
+ */
194
+ export interface ScheduleCancelRequest extends BaseExchangeRequest {
195
+ /** Action to be performed. */
196
+ action: {
197
+ /** Type of action. */
198
+ type: "scheduleCancel";
199
+ /**
200
+ * Scheduled time (in ms since epoch).
201
+ * Must be at least 5 seconds in the future.
202
+ *
203
+ * If not specified, will cause all scheduled cancel operations to be deleted
204
+ */
205
+ time?: number;
206
+ };
207
+ /** Vault address (optional, for vault trading). */
208
+ vaultAddress?: Hex;
209
+ }
210
+ /**
211
+ * Set a referral code.
212
+ * @returns {SuccessResponse}
213
+ */
214
+ export interface SetReferrerRequest extends BaseExchangeRequest {
215
+ /** Action to be performed. */
216
+ action: {
217
+ /** Type of action. */
218
+ type: "setReferrer";
219
+ /** Referral code. */
220
+ code: string;
221
+ };
222
+ }
223
+ /**
224
+ * Transfer a spot asset on L1 to another address.
225
+ * @returns {SuccessResponse}
226
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#l1-spot-transfer | Hyperliquid GitBook}
227
+ */
228
+ export interface SpotSendRequest extends BaseExchangeRequest {
229
+ /** Action to be performed. */
230
+ action: {
231
+ /** Type of action. */
232
+ type: "spotSend";
233
+ /** HyperLiquid network. */
234
+ hyperliquidChain: "Mainnet" | "Testnet";
235
+ /** Chain ID used for signing. */
236
+ signatureChainId: Hex;
237
+ /** Recipient address. */
238
+ destination: Hex;
239
+ /** Token identifier. */
240
+ token: `${string}:${Hex}`;
241
+ /** Amount to send. */
242
+ amount: string;
243
+ /** Current timestamp in ms. */
244
+ time: number;
245
+ };
246
+ }
247
+ /**
248
+ * Transfer between sub-accounts.
249
+ * @returns {SuccessResponse}
250
+ */
251
+ export interface SubAccountTransferRequest extends BaseExchangeRequest {
252
+ /** Action to be performed. */
253
+ action: {
254
+ /** Type of action. */
255
+ type: "subAccountTransfer";
256
+ /** Sub-account address. */
257
+ subAccountUser: Hex;
258
+ /** `true` for deposit, `false` for withdrawal. */
259
+ isDeposit: boolean;
260
+ /** Amount to transfer (float * 1e6). */
261
+ usd: number;
262
+ };
263
+ }
264
+ /**
265
+ * Cancel a TWAP order.
266
+ * @returns {TwapCancelResponse}
267
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-a-twap-order | Hyperliquid GitBook}
268
+ */
269
+ export interface TwapCancelRequest extends BaseExchangeRequest {
270
+ /** Action to be performed. */
271
+ action: {
272
+ /** Type of action. */
273
+ type: "twapCancel";
274
+ /** An integer representing the asset being traded. */
275
+ a: number;
276
+ /** Twap ID. */
277
+ t: number;
278
+ };
279
+ /** Vault address (optional, for vault trading). */
280
+ vaultAddress?: Hex;
281
+ }
282
+ /**
283
+ * Place a TWAP order.
284
+ * @returns {TwapOrderResponse}
285
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-a-twap-order | Hyperliquid GitBook}
286
+ */
287
+ export interface TwapOrderRequest extends BaseExchangeRequest {
288
+ /** Action to be performed. */
289
+ action: {
290
+ /** Type of action. */
291
+ type: "twapOrder";
292
+ /** Twap parameters. */
293
+ twap: {
294
+ /** An integer representing the asset being traded. */
295
+ a: number;
296
+ /** Position side (`true` for long, `false` for short). */
297
+ b: boolean;
298
+ /** Size (in base currency units). */
299
+ s: string;
300
+ /** Is reduce-only? */
301
+ r: boolean;
302
+ /** TWAP duration in minutes. */
303
+ m: number;
304
+ /** Enable random order timing. */
305
+ t: boolean;
306
+ };
307
+ };
308
+ /** Vault address (optional, for vault trading). */
309
+ vaultAddress?: Hex;
310
+ }
311
+ /**
312
+ * Update isolated margin for a position.
313
+ * @returns {SuccessResponse}
314
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin | Hyperliquid GitBook}
315
+ */
316
+ export interface UpdateIsolatedMarginRequest extends BaseExchangeRequest {
317
+ /** Action to be performed. */
318
+ action: {
319
+ /** Type of action. */
320
+ type: "updateIsolatedMargin";
321
+ /** An integer representing the asset being traded. */
322
+ asset: number;
323
+ /** Position side (`true` for long, `false` for short). */
324
+ isBuy: boolean;
325
+ /** Amount to adjust (in USD). This should be an integer value. */
326
+ ntli: number;
327
+ };
328
+ /** Vault address (optional, for vault trading). */
329
+ vaultAddress?: Hex;
330
+ }
331
+ /**
332
+ * Update leverage for cross or isolated margin.
333
+ * @returns {SuccessResponse}
334
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-leverage | Hyperliquid GitBook}
335
+ */
336
+ export interface UpdateLeverageRequest extends BaseExchangeRequest {
337
+ /** Action to be performed. */
338
+ action: {
339
+ /** Type of action. */
340
+ type: "updateLeverage";
341
+ /** An integer representing the asset being traded. */
342
+ asset: number;
343
+ /** `true` for cross leverage, `false` for isolated leverage. */
344
+ isCross: boolean;
345
+ /** New leverage value. */
346
+ leverage: number;
347
+ };
348
+ /** Vault address (optional, for vault trading). */
349
+ vaultAddress?: Hex;
350
+ }
351
+ /**
352
+ * Transfer funds between Spot and Perp accounts.
353
+ * @returns {SuccessResponse}
354
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#transfer-from-spot-account-to-perp-account-and-vice-versa | Hyperliquid GitBook}
355
+ */
356
+ export interface UsdClassTransferRequest extends BaseExchangeRequest {
357
+ /** Action to be performed. */
358
+ action: {
359
+ /** Type of action. */
360
+ type: "usdClassTransfer";
361
+ /** HyperLiquid network. */
362
+ hyperliquidChain: "Mainnet" | "Testnet";
363
+ /** Chain ID used for signing. */
364
+ signatureChainId: Hex;
365
+ /** USD amount to transfer. */
366
+ amount: string;
367
+ /** `true` for Spot to Perp, `false` for Perp to Spot. */
368
+ toPerp: boolean;
369
+ /** Unique request identifier (recommended: current timestamp in ms). */
370
+ nonce: number;
371
+ };
372
+ }
373
+ /**
374
+ * Transfer USDC on L1 to another address.
375
+ * @returns {SuccessResponse}
376
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#l1-usdc-transfer | Hyperliquid GitBook}
377
+ */
378
+ export interface UsdSendRequest extends BaseExchangeRequest {
379
+ /** Action to be performed. */
380
+ action: {
381
+ /** Type of action. */
382
+ type: "usdSend";
383
+ /** HyperLiquid network. */
384
+ hyperliquidChain: "Mainnet" | "Testnet";
385
+ /** Chain ID used for signing. */
386
+ signatureChainId: Hex;
387
+ /** Recipient address. */
388
+ destination: Hex;
389
+ /** USD amount to send. */
390
+ amount: string;
391
+ /** Current timestamp in ms. */
392
+ time: number;
393
+ };
394
+ }
395
+ /**
396
+ * Transfer funds to/from a vault.
397
+ * @returns {SuccessResponse}
398
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault | Hyperliquid GitBook}
399
+ */
400
+ export interface VaultTransferRequest extends BaseExchangeRequest {
401
+ /** Action to be performed. */
402
+ action: {
403
+ /** Type of action. */
404
+ type: "vaultTransfer";
405
+ /** Vault address. */
406
+ vaultAddress: Hex;
407
+ /** `true` for deposit, `false` for withdrawal. */
408
+ isDeposit: boolean;
409
+ /** Amount to transfer (float * 1e6). */
410
+ usd: number;
411
+ };
412
+ }
413
+ /**
414
+ * Initiate a withdrawal request.
415
+ * @returns {SuccessResponse}
416
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request | Hyperliquid GitBook}
417
+ */
418
+ export interface Withdraw3Request extends BaseExchangeRequest {
419
+ /** Action to be performed. */
420
+ action: {
421
+ /** Type of action. */
422
+ type: "withdraw3";
423
+ /** HyperLiquid network. */
424
+ hyperliquidChain: "Mainnet" | "Testnet";
425
+ /** Chain ID used for signing. */
426
+ signatureChainId: Hex;
427
+ /** USD amount to withdraw. */
428
+ amount: string;
429
+ /** Current timestamp in ms. */
430
+ time: number;
431
+ /** Recipient address. */
432
+ destination: Hex;
433
+ };
434
+ }
435
+ //# sourceMappingURL=requests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/src/types/exchange/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAChC,yBAAyB;IACzB,MAAM,EAAE;QACJ,sBAAsB;QACtB,IAAI,EAAE,MAAM,CAAC;QAEb,oCAAoC;QACpC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KAC1B,CAAC;IAEF,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IAEd,+BAA+B;IAC/B,SAAS,EAAE;QAAE,CAAC,EAAE,GAAG,CAAC;QAAC,CAAC,EAAE,GAAG,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC5D,8BAA8B;IAC9B,MAAM,EAAE;QACJ,sBAAsB;QACtB,IAAI,EAAE,cAAc,CAAC;QAErB,2BAA2B;QAC3B,gBAAgB,EAAE,SAAS,GAAG,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AAM,EAAE;QACJ,sBAAsB;QACtB,IAAI,EAAE,eAAe,CAAC;QAEtB,qBAAqB;QACrB,YAAY,EAAE,GAAG,CAAC;QAElB,kDAAkD;QAClD,SAAS,EAAE,OAAO,CAAC;QAEnB,wCAAwC;QACxC,GAAG,EAAE,MAAM,CAAC;KACf,CAAC;CACL;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IACzD,8BAA8B;IAC9B,MAAM,EAAE;QACJ,sBAAsB;QACtB,IAAI,EAAE,WAAW,CAAC;QAElB,2BAA2B;QAC3B,gBAAgB,EAAE,SAAS,GAAG,SAAS,CAAC;QAExC,iCAAiC;QACjC,gBAAgB,EAAE,GAAG,CAAC;QAEtB,8BAA8B;QAC9B,MAAM,EAAE,MAAM,CAAC;QAEf,+BAA+B;QAC/B,IAAI,EAAE,MAAM,CAAC;QAEb,yBAAyB;QACzB,WAAW,EAAE,GAAG,CAAC;KACpB,CAAC;CACL"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,141 @@
1
+ import type { Hex } from "../common.js";
2
+ /** Base structure for exchange responses. */
3
+ export interface BaseExchangeResponse {
4
+ /** Response status */
5
+ status: "ok" | "err";
6
+ /** Error message or success data */
7
+ response: string | {
8
+ /** Type of operation. */
9
+ type: string;
10
+ /** Specific data for the operation. */
11
+ data?: unknown;
12
+ };
13
+ }
14
+ /** Successful response without specific data. */
15
+ export interface SuccessResponse extends BaseExchangeResponse {
16
+ /** Successful status. */
17
+ status: "ok";
18
+ /** Response details. */
19
+ response: {
20
+ /** Type of operation. */
21
+ type: "default";
22
+ };
23
+ }
24
+ /** Error response for failed operations. */
25
+ export interface ErrorResponse extends BaseExchangeResponse {
26
+ /** Error status. */
27
+ status: "err";
28
+ /** Error message. */
29
+ response: string;
30
+ }
31
+ /** Response for order cancellation. */
32
+ export interface CancelResponse extends BaseExchangeResponse {
33
+ /** Successful status. */
34
+ status: "ok";
35
+ /** Response details. */
36
+ response: {
37
+ /** Type of operation. */
38
+ type: "cancel";
39
+ /** Specific data. */
40
+ data: {
41
+ /** Array of statuses or error messages. */
42
+ statuses: ("success" | {
43
+ /** Error message. */
44
+ error: string;
45
+ })[];
46
+ };
47
+ };
48
+ }
49
+ /** Response for creating a sub-account. */
50
+ export interface CreateSubAccountResponse extends BaseExchangeResponse {
51
+ /** Successful status. */
52
+ status: "ok";
53
+ /** Response details. */
54
+ response: {
55
+ /** Type of operation. */
56
+ type: "createSubAccount";
57
+ /** Sub-account address. */
58
+ data: Hex;
59
+ };
60
+ }
61
+ /** Response for order placement and batch modifications. */
62
+ export interface OrderResponse extends BaseExchangeResponse {
63
+ /** Successful status. */
64
+ status: "ok";
65
+ /** Response details. */
66
+ response: {
67
+ /** Type of operation. */
68
+ type: "order";
69
+ /** Specific data. */
70
+ data: {
71
+ /** Array of statuses or error messages. */
72
+ statuses: ({
73
+ /** Resting order status. */
74
+ resting: {
75
+ /** Order ID. */
76
+ oid: number;
77
+ /** Client Order ID. */
78
+ cloid?: Hex;
79
+ };
80
+ } | {
81
+ /** Filled order status. */
82
+ filled: {
83
+ /** Total size filled. */
84
+ totalSz: string;
85
+ /** Average price of fill. */
86
+ avgPx: string;
87
+ /** Order ID. */
88
+ oid: number;
89
+ /** Client Order ID. */
90
+ cloid?: Hex;
91
+ };
92
+ } | {
93
+ /** Error message. */
94
+ error: string;
95
+ })[];
96
+ };
97
+ };
98
+ }
99
+ /** Response for creating a TWAP order. */
100
+ export interface TwapOrderResponse extends BaseExchangeResponse {
101
+ /** Successful status. */
102
+ status: "ok";
103
+ /** Response details. */
104
+ response: {
105
+ /** Type of operation. */
106
+ type: "twapOrder";
107
+ /** Specific data. */
108
+ data: {
109
+ /** Status of the operation. */
110
+ status: {
111
+ /** Running order status. */
112
+ running: {
113
+ /** TWAP ID. */
114
+ twapId: number;
115
+ };
116
+ } | {
117
+ /** Error message. */
118
+ error: string;
119
+ };
120
+ };
121
+ };
122
+ }
123
+ /** Response for canceling a TWAP order. */
124
+ export interface TwapCancelResponse extends BaseExchangeResponse {
125
+ /** Successful status. */
126
+ status: "ok";
127
+ /** Response details. */
128
+ response: {
129
+ /** Type of operation. */
130
+ type: "twapCancel";
131
+ /** Specific data. */
132
+ data: {
133
+ /** Status of the operation. */
134
+ status: string | {
135
+ /** Error message. */
136
+ error: string;
137
+ };
138
+ };
139
+ };
140
+ }
141
+ //# sourceMappingURL=responses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../../src/src/types/exchange/responses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACjC,sBAAsB;IACtB,MAAM,EAAE,IAAI,GAAG,KAAK,CAAC;IAErB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,GAAG;QACf,yBAAyB;QACzB,IAAI,EAAE,MAAM,CAAC;QAEb,uCAAuC;QACvC,IAAI,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;CACL;AAED,iDAAiD;AACjD,MAAM,WAAW,eAAgB,SAAQ,oBAAoB;IACzD,yBAAyB;IACzB,MAAM,EAAE,IAAI,CAAC;IAEb,wBAAwB;IACxB,QAAQ,EAAE;QACN,yBAAyB;QACzB,IAAI,EAAE,SAAS,CAAC;KACnB,CAAC;CACL;AAED,4CAA4C;AAC5C,MAAM,WAAW,aAAc,SAAQ,oBAAoB;IACvD,oBAAoB;IACpB,MAAM,EAAE,KAAK,CAAC;IAEd,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,uCAAuC;AACvC,MAAM,WAAW,cAAe,SAAQ,oBAAoB;IACxD,yBAAyB;IACzB,MAAM,EAAE,IAAI,CAAC;IAEb,wBAAwB;IACxB,QAAQ,EAAE;QACN,yBAAyB;QACzB,IAAI,EAAE,QAAQ,CAAC;QAEf,qBAAqB;QACrB,IAAI,EAAE;YACF,2CAA2C;Y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IAEb,wBAAwB;IACxB,QAAQ,EAAE;QACN,yBAAyB;QACzB,IAAI,EAAE,WAAW,CAAC;QAElB,qBAAqB;QACrB,IAAI,EAAE;YACF,+BAA+B;YAC/B,MAAM,EACA;gBACE,4BAA4B;gBAC5B,OAAO,EAAE;oBACL,eAAe;oBACf,MAAM,EAAE,MAAM,CAAC;iBAClB,CAAC;aACL,GACC;gBACE,qBAAqB;gBACrB,KAAK,EAAE,MAAM,CAAC;aACjB,CAAC;SACT,CAAC;KACL,CAAC;CACL;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAmB,SAAQ,oBAAoB;IAC5D,yBAAyB;IACzB,MAAM,EAAE,IAAI,CAAC;IAEb,wBAAwB;IACxB,QAAQ,EAAE;QACN,yBAAyB;QACzB,IAAI,EAAE,YAAY,CAAC;QAEnB,qBAAqB;QACrB,IAAI,EAAE;YACF,+BAA+B;YAC/B,MAAM,EACA,MAAM,GACN;gBACE,qBAAqB;gBACrB,KAAK,EAAE,MAAM,CAAC;aACjB,CAAC;SACT,CAAC;KACL,CAAC;CACL"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ import type { Hex } from "../common.js";
2
+ /** The transaction details. */
3
+ export interface TxDetails {
4
+ /** The action of the transaction. */
5
+ action: {
6
+ /** Type of action. */
7
+ type: string;
8
+ /** Additional action parameters. */
9
+ [key: string]: unknown;
10
+ };
11
+ /** The block number in which the transaction was included. */
12
+ block: number;
13
+ /** The error message if the transaction failed. */
14
+ error: string | null;
15
+ /** The hash of the transaction. */
16
+ hash: Hex;
17
+ /** The time at which the transaction was created. */
18
+ time: number;
19
+ /** The user that created the transaction. */
20
+ user: Hex;
21
+ }
22
+ /** The block details. */
23
+ export interface BlockDetails {
24
+ /** The time at which the block was created. */
25
+ blockTime: number;
26
+ /** The hash of the block. */
27
+ hash: Hex;
28
+ /** The height of the block. */
29
+ height: number;
30
+ /** The number of transactions in the block. */
31
+ numTxs: number;
32
+ /** The proposer of the block. */
33
+ proposer: Hex;
34
+ /** The transactions in the block. */
35
+ txs: TxDetails[];
36
+ }
37
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/src/types/explorer/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,+BAA+B;AAC/B,MAAM,WAAW,SAAS;IACtB,qCAAqC;IACrC,MAAM,EAAE;QACJ,sBAAsB;QACtB,IAAI,EAAE,MAAM,CAAC;QAEb,oCAAoC;QACpC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KAC1B,CAAC;IAEF,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IAEd,mDAAmD;IACnD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,mCAAmC;IACnC,IAAI,EAAE,GAAG,CAAC;IAEV,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IAEb,6CAA6C;IAC7C,IAAI,EAAE,GAAG,CAAC;CACb;AAED,yBAAyB;AACzB,MAAM,WAAW,YAAY;IACzB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAElB,6BAA6B;IAC7B,IAAI,EAAE,GAAG,CAAC;IAEV,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IAEf,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;IAEf,iCAAiC;IACjC,QAAQ,EAAE,GAAG,CAAC;IAEd,qCAAqC;IACrC,GAAG,EAAE,SAAS,EAAE,CAAC;CACpB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { Hex } from "../common.js";
2
+ /**
3
+ * The request to get the details of a transaction.
4
+ * @returns {TxDetailsResponse} The details of a transaction.
5
+ */
6
+ export interface TxDetailsRequest {
7
+ /** Type of request. */
8
+ type: "txDetails";
9
+ /** The hash of a transaction. */
10
+ hash: Hex;
11
+ }
12
+ /**
13
+ * The request to get the details of a block.
14
+ * @returns {BlockDetailsResponse} The details of a block.
15
+ */
16
+ export interface BlockDetailsRequest {
17
+ /** Type of request. */
18
+ type: "blockDetails";
19
+ /** The height of a block. */
20
+ height: number;
21
+ }
22
+ //# sourceMappingURL=requests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/src/types/explorer/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,uBAAuB;IACvB,IAAI,EAAE,WAAW,CAAC;IAElB,iCAAiC;IACjC,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,uBAAuB;IACvB,IAAI,EAAE,cAAc,CAAC;IAErB,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1 @@
1
+ export {};