@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,380 @@
1
+ import type { Hex } from "../common.js";
2
+ /**
3
+ * Request mid coin prices.
4
+ * @returns {AllMids} Mid coin prices.
5
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-mids-for-all-coins | Hyperliquid GitBook}
6
+ */
7
+ export interface AllMidsRequest {
8
+ /** Type of request. */
9
+ type: "allMids";
10
+ }
11
+ /**
12
+ * Request candlestick snapshots.
13
+ * @returns {Candle[]} Array of candlestick data points.
14
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#candle-snapshot | Hyperliquid GitBook}
15
+ */
16
+ export interface CandleSnapshotRequest {
17
+ /** Type of request. */
18
+ type: "candleSnapshot";
19
+ /** Request parameters. */
20
+ req: {
21
+ /** Asset symbol. */
22
+ coin: string;
23
+ /** Time interval (e.g., "15m"). */
24
+ interval: string;
25
+ /** Start time (in ms since epoch). */
26
+ startTime: number;
27
+ /** End time (in ms since epoch). */
28
+ endTime?: number | null;
29
+ };
30
+ }
31
+ /**
32
+ * Request clearinghouse state.
33
+ * @returns {PerpsClearinghouseState} Account summary for perpetual trading.
34
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary | Hyperliquid GitBook}
35
+ */
36
+ export interface ClearinghouseStateRequest {
37
+ /** Type of request. */
38
+ type: "clearinghouseState";
39
+ /** User's address. */
40
+ user: Hex;
41
+ }
42
+ /**
43
+ * Request user's extra agents.
44
+ * @returns {ExtraAgent[]} The extra agents of a user.
45
+ */
46
+ export interface ExtraAgentsRequest {
47
+ /** Type of request. */
48
+ type: "extraAgents";
49
+ /** User's address. */
50
+ user: Hex;
51
+ }
52
+ /**
53
+ * Request frontend open orders.
54
+ * @returns {FrontendOrder[]} Array of open orders with additional frontend information.
55
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders-with-additional-frontend-info | Hyperliquid GitBook}
56
+ */
57
+ export interface FrontendOpenOrdersRequest {
58
+ /** Type of request. */
59
+ type: "frontendOpenOrders";
60
+ /** User's address. */
61
+ user: Hex;
62
+ }
63
+ /**
64
+ * Request funding history.
65
+ * @returns {FundingHistory[]} Array of historical funding rate data for an asset.
66
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-historical-funding-rates | Hyperliquid GitBook}
67
+ */
68
+ export interface FundingHistoryRequest {
69
+ /** Type of request. */
70
+ type: "fundingHistory";
71
+ /** Asset symbol. */
72
+ coin: string;
73
+ /** Start time (in ms since epoch). */
74
+ startTime: number;
75
+ /** End time (in ms since epoch). */
76
+ endTime?: number | null;
77
+ }
78
+ /**
79
+ * Request user historical orders.
80
+ * @returns {OrderStatus[]} Array of user's historical orders.
81
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-historical-orders | Hyperliquid GitBook}
82
+ */
83
+ export interface HistoricalOrdersRequest {
84
+ /** Type of request. */
85
+ type: "historicalOrders";
86
+ /** User's address. */
87
+ user: Hex;
88
+ }
89
+ /**
90
+ * Request L2 order book ({@link L2Book}).
91
+ * @returns {Book} L2 order book snapshot.
92
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#l2-book-snapshot | Hyperliquid GitBook}
93
+ */
94
+ export interface L2BookRequest {
95
+ /** Type of request. */
96
+ type: "l2Book";
97
+ /** Asset symbol. */
98
+ coin: string;
99
+ /** Number of significant figures. */
100
+ nSigFigs?: 2 | 3 | 4 | 5 | null;
101
+ /** Mantissa for aggregation (if {@linkcode nSigFigs} is 5). */
102
+ mantissa?: 2 | 5 | null;
103
+ }
104
+ /**
105
+ * Request builder fee approval.
106
+ * @returns {number} 1 (means 0.001%)
107
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#check-builder-fee-approval | Hyperliquid GitBook}
108
+ */
109
+ export interface MaxBuilderFeeRequest {
110
+ /** Type of request. */
111
+ type: "maxBuilderFee";
112
+ /** User's address. */
113
+ user: Hex;
114
+ /** Builder address. */
115
+ builder: Hex;
116
+ }
117
+ /**
118
+ * Request metadata and asset contexts.
119
+ * @returns {PerpsMetaAndAssetCtxs} Metadata and context information for each perpetual asset.
120
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc | Hyperliquid GitBook}
121
+ */
122
+ export interface MetaAndAssetCtxsRequest {
123
+ /** Type of request. */
124
+ type: "metaAndAssetCtxs";
125
+ }
126
+ /**
127
+ * Request trading metadata.
128
+ * @returns {PerpsMeta} Metadata for perpetual assets.
129
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-metadata | Hyperliquid GitBook}
130
+ */
131
+ export interface MetaRequest {
132
+ /** Type of request. */
133
+ type: "meta";
134
+ }
135
+ /**
136
+ * Request open orders.
137
+ * @returns {Order[]} Array of open order.
138
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders | Hyperliquid GitBook}
139
+ */
140
+ export interface OpenOrdersRequest {
141
+ /** Type of request. */
142
+ type: "openOrders";
143
+ /** User's address. */
144
+ user: Hex;
145
+ }
146
+ /**
147
+ * Request order status.
148
+ * @returns {OrderLookup} Result of an order status lookup.
149
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-order-status-by-oid-or-cloid | Hyperliquid GitBook}
150
+ */
151
+ export interface OrderStatusRequest {
152
+ /** Type of request. */
153
+ type: "orderStatus";
154
+ /** User's address. */
155
+ user: Hex;
156
+ /** oid (order id) or cloid (client order id). */
157
+ oid: number | Hex;
158
+ }
159
+ /**
160
+ * Request predicted funding rates.
161
+ * @returns {PredictedFunding[]} Array of predicted funding rates.
162
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-predicted-funding-rates-for-different-venues | Hyperliquid GitBook}
163
+ */
164
+ export interface PredictedFundingsRequest {
165
+ /** Type of request. */
166
+ type: "predictedFundings";
167
+ }
168
+ /**
169
+ * Request user referral.
170
+ * @returns {Referral} Referral information for a user.
171
+ */
172
+ export interface ReferralRequest {
173
+ /** Type of request. */
174
+ type: "referral";
175
+ /** User's address. */
176
+ user: Hex;
177
+ }
178
+ /**
179
+ * Request spot clearinghouse state.
180
+ * @returns {SpotClearinghouseState} Balances for spot tokens.
181
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-a-users-token-balances | Hyperliquid GitBook}
182
+ */
183
+ export interface SpotClearinghouseStateRequest {
184
+ /** Type of request. */
185
+ type: "spotClearinghouseState";
186
+ /** User's address. */
187
+ user: Hex;
188
+ }
189
+ /**
190
+ * Request spot deploy state.
191
+ * @returns {SpotDeployState} The deploy state of a user.
192
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-information-about-the-spot-deploy-auction | Hyperliquid GitBook}
193
+ */
194
+ export interface SpotDeployStateRequest {
195
+ /** Type of request. */
196
+ type: "spotDeployState";
197
+ /** User's address. */
198
+ user: Hex;
199
+ }
200
+ /**
201
+ * Request spot metadata and asset contexts.
202
+ * @returns {SpotMetaAndAssetCtxs} Metadata and context information for each spot asset.
203
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts | Hyperliquid GitBook}
204
+ */
205
+ export interface SpotMetaAndAssetCtxsRequest {
206
+ /** Type of request. */
207
+ type: "spotMetaAndAssetCtxs";
208
+ }
209
+ /**
210
+ * Request spot trading metadata.
211
+ * @returns {SpotMeta} Metadata for spot assets.
212
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-metadata | Hyperliquid GitBook}
213
+ */
214
+ export interface SpotMetaRequest {
215
+ /** Type of request. */
216
+ type: "spotMeta";
217
+ }
218
+ /**
219
+ * Request user sub-accounts.
220
+ * @returns {SubAccount[]} Array of user sub-account.
221
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-subaccounts | Hyperliquid GitBook}
222
+ */
223
+ export interface SubAccountsRequest {
224
+ /** Type of request. */
225
+ type: "subAccounts";
226
+ /** User's address. */
227
+ user: Hex;
228
+ }
229
+ /**
230
+ * The request to get the details of a token.
231
+ * @returns {TokenDetails} The details of a token.
232
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-information-about-a-token | Hyperliquid GitBook}
233
+ */
234
+ export interface TokenDetailsRequest {
235
+ /** Type of request. */
236
+ type: "tokenDetails";
237
+ /** Token ID. */
238
+ tokenId: Hex;
239
+ }
240
+ /**
241
+ * Request twap history.
242
+ * @returns {TwapHistory[]} The twap history of a user.
243
+ */
244
+ export interface TwapHistoryRequest {
245
+ /** Type of request. */
246
+ type: "twapHistory";
247
+ /** User's address. */
248
+ user: Hex;
249
+ }
250
+ /**
251
+ * Request user fees.
252
+ * @returns {UserFees} User fees.
253
+ */
254
+ export interface UserFeesRequest {
255
+ /** Type of request. */
256
+ type: "userFees";
257
+ /** User's address. */
258
+ user: Hex;
259
+ }
260
+ /**
261
+ * Request user fills by time.
262
+ * @returns {Fill[]} Array of user's trade fill.
263
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time | Hyperliquid GitBook}
264
+ */
265
+ export interface UserFillsByTimeRequest {
266
+ /** Type of request. */
267
+ type: "userFillsByTime";
268
+ /** User's address. */
269
+ user: Hex;
270
+ /** Start time (in ms since epoch). */
271
+ startTime: number;
272
+ /** End time (in ms since epoch). */
273
+ endTime?: number | null;
274
+ /**
275
+ * When `true`, partial fills are combined when a crossing order gets filled by multiple different resting orders.
276
+ * Resting orders filled by multiple crossing orders will not be aggregated.
277
+ */
278
+ aggregateByTime?: boolean;
279
+ }
280
+ /**
281
+ * Request user fills.
282
+ * @returns {Fill[]} Array of user's trade fill.
283
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills | Hyperliquid GitBook}
284
+ */
285
+ export interface UserFillsRequest {
286
+ /** Type of request. */
287
+ type: "userFills";
288
+ /** User's address. */
289
+ user: Hex;
290
+ /**
291
+ * When `true`, partial fills are combined when a crossing order gets filled by multiple different resting orders.
292
+ * Resting orders filled by multiple crossing orders will not be aggregated.
293
+ */
294
+ aggregateByTime?: boolean;
295
+ }
296
+ /**
297
+ * Request user funding.
298
+ * @returns {UserFundingUpdate[]} Array of user's funding ledger update.
299
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-a-users-funding-history-or-non-funding-ledger-updates | Hyperliquid GitBook}
300
+ */
301
+ export interface UserFundingRequest {
302
+ /** Type of request. */
303
+ type: "userFunding";
304
+ /** User's address. */
305
+ user: Hex;
306
+ /** Start time (in ms since epoch). */
307
+ startTime: number;
308
+ /** End time (in ms since epoch). */
309
+ endTime?: number | null;
310
+ }
311
+ /**
312
+ * Request user non-funding ledger updates.
313
+ * @returns {UserNonFundingLedgerUpdates[]} Array of user's non-funding ledger update.
314
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-a-users-funding-history-or-non-funding-ledger-updates | Hyperliquid GitBook}
315
+ */
316
+ export interface UserNonFundingLedgerUpdatesRequest {
317
+ /** Type of request. */
318
+ type: "userNonFundingLedgerUpdates";
319
+ /** User's address. */
320
+ user: Hex;
321
+ /** Start time (in ms since epoch). */
322
+ startTime: number;
323
+ /** End time (in ms since epoch). */
324
+ endTime?: number | null;
325
+ }
326
+ /**
327
+ * Request user rate limits.
328
+ * @returns {UserRateLimit} User's rate limits.
329
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-user-rate-limits | Hyperliquid GitBook}
330
+ */
331
+ export interface UserRateLimitRequest {
332
+ /** Type of request. */
333
+ type: "userRateLimit";
334
+ /** User's address. */
335
+ user: Hex;
336
+ }
337
+ /**
338
+ * Request user twap slice fills.
339
+ * @returns {TwapSliceFill[]} Array of user's twap slice fills.
340
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-twap-slice-fills | Hyperliquid GitBook}
341
+ */
342
+ export interface UserTwapSliceFillsRequest {
343
+ /** Type of request. */
344
+ type: "userTwapSliceFills";
345
+ /** User's address. */
346
+ user: Hex;
347
+ }
348
+ /**
349
+ * Request user vault deposits.
350
+ * @returns {VaultEquity[]} Array of user's vault deposits.
351
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-vault-deposits | Hyperliquid GitBook}
352
+ */
353
+ export interface UserVaultEquitiesRequest {
354
+ /** Type of request. */
355
+ type: "userVaultEquities";
356
+ /** User's address. */
357
+ user: Hex;
358
+ }
359
+ /**
360
+ * Request details of a vault.
361
+ * @returns {VaultDetails} Details of a vault.
362
+ * @see {@link https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-details-for-a-vault | Hyperliquid GitBook}
363
+ */
364
+ export interface VaultDetailsRequest {
365
+ /** Type of request. */
366
+ type: "vaultDetails";
367
+ /** Vault address. */
368
+ vaultAddress: Hex;
369
+ /** User's address. */
370
+ user?: Hex | null;
371
+ }
372
+ /**
373
+ * Request a list of vaults less than 2 hours old.
374
+ * @returns {VaultSummary[]} Array of vault summaries.
375
+ */
376
+ export interface VaultSummariesRequest {
377
+ /** Type of request. */
378
+ type: "vaultSummaries";
379
+ }
380
+ //# sourceMappingURL=requests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC3B,uBAAuB;IACvB,IAAI,EAAE,SAAS,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,uBAAuB;IACvB,IAAI,EAAE,gBAAgB,CAAC;IACvB,0BAA0B;IAC1B,GAAG,EAAE;QACD,oBAAoB;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,mCAAmC;QACnC,QAAQ,EAAE,MAAM,CAAC;QACjB,sCAAsC;QACtC,SAAS,EAAE,MAAM,CAAC;QAClB,oCAAoC;QACpC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,CAAC;CACL;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,uBAAuB;IACvB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,sBAAsB;IACtB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B,uBAAuB;IACvB,IAAI,EAAE,aAAa,CAAC;IACpB,sBAAsB;IACtB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,uBAAuB;IACvB,IAAI,EAAE,oBAAoB,CAA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IACtB,sBAAsB;IACtB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,uBAAuB;IACvB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,sBAAsB;IACtB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACrC,uBAAuB;IACvB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,sBAAsB;IACtB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,uBAAuB;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB,qBAAqB;IACrB,YAAY,EAAE,GAAG,CAAC;IAClB,sBAAsB;IACtB,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC,uBAAuB;IACvB,IAAI,EAAE,gBAAgB,CAAC;CAC1B"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,133 @@
1
+ import type { Hex } from "../common.js";
2
+ /** Details about a vault. */
3
+ export interface VaultDetails {
4
+ /** The name of the vault. */
5
+ name: string;
6
+ /** The address of the vault. */
7
+ vaultAddress: Hex;
8
+ /** The address of the leader. */
9
+ leader: Hex;
10
+ /** The description of the vault. */
11
+ description: string;
12
+ /** The portfolio of the vault. */
13
+ portfolio: [
14
+ [
15
+ "day",
16
+ VaultMetrics
17
+ ],
18
+ [
19
+ "week",
20
+ VaultMetrics
21
+ ],
22
+ [
23
+ "month",
24
+ VaultMetrics
25
+ ],
26
+ [
27
+ "allTime",
28
+ VaultMetrics
29
+ ],
30
+ [
31
+ "perpDay",
32
+ VaultMetrics
33
+ ],
34
+ [
35
+ "perpWeek",
36
+ VaultMetrics
37
+ ],
38
+ [
39
+ "perpMonth",
40
+ VaultMetrics
41
+ ],
42
+ [
43
+ "perpAllTime",
44
+ VaultMetrics
45
+ ]
46
+ ];
47
+ /** The annual percentage rate (APR) of the vault. */
48
+ apr: number;
49
+ followerState: unknown | null;
50
+ /** The fraction of the vault owned by the leader. */
51
+ leaderFraction: number;
52
+ /** The commission percentage taken by the leader. */
53
+ leaderCommission: number;
54
+ /** The followers of the vault. */
55
+ followers: {
56
+ /** The address of the follower or "Leader" for the leader. */
57
+ user: Hex | "Leader";
58
+ /** The equity of the follower in the vault. */
59
+ vaultEquity: string;
60
+ /** The current profit and loss (PnL) of the follower. */
61
+ pnl: string;
62
+ /** The all-time profit and loss (PnL) of the follower. */
63
+ allTimePnl: string;
64
+ /** The number of days the follower has been subscribed. */
65
+ daysFollowing: number;
66
+ /** The timestamp when the follower joined the vault. */
67
+ vaultEntryTime: number;
68
+ /** The timestamp until which the funds are locked. */
69
+ lockupUntil: number;
70
+ }[];
71
+ /** The maximum amount that can be distributed from the vault. */
72
+ maxDistributable: number;
73
+ /** The maximum amount that can be withdrawn from the vault. */
74
+ maxWithdrawable: number;
75
+ /** Indicates if the vault is closed. */
76
+ isClosed: boolean;
77
+ /** The type of relationship between vaults. */
78
+ relationship: VaultRelationship;
79
+ /** Indicates whether deposits are allowed. */
80
+ allowDeposits: boolean;
81
+ /** Indicates whether to always close positions on withdrawal. */
82
+ alwaysCloseOnWithdraw: boolean;
83
+ }
84
+ /** The equity of a user in a vault. */
85
+ export interface VaultEquity {
86
+ /** The address of the vault. */
87
+ vaultAddress: Hex;
88
+ /** The user's deposited equity in the vault. */
89
+ equity: string;
90
+ }
91
+ /** Metrics data for a vault */
92
+ export interface VaultMetrics {
93
+ /** The account value history as [timestamp, value]. */
94
+ accountValueHistory: [number, string][];
95
+ /** The profit and loss (PnL) history as [timestamp, value]. */
96
+ pnlHistory: [number, string][];
97
+ /** The volume or related metric of the portfolio. */
98
+ vlm: string;
99
+ }
100
+ /** The type of relationship between vaults. */
101
+ export type VaultRelationship = {
102
+ /** The type of relationship. */
103
+ type: "normal";
104
+ } | {
105
+ /** The type of relationship. */
106
+ type: "parent";
107
+ /** Data about child vault addresses. */
108
+ data: {
109
+ /** List of child vault addresses. */
110
+ childAddresses: Hex[];
111
+ };
112
+ } | {
113
+ /** The type of relationship. */
114
+ type: "child";
115
+ };
116
+ /** Summary of a vault. */
117
+ export interface VaultSummary {
118
+ /** The name of the vault. */
119
+ name: string;
120
+ /** The address of the vault. */
121
+ vaultAddress: Hex;
122
+ /** The address of the leader. */
123
+ leader: Hex;
124
+ /** The total value locked (TVL) in the vault. */
125
+ tvl: string;
126
+ /** Indicates if the vault is closed. */
127
+ isClosed: boolean;
128
+ /** The type of relationship between vaults. */
129
+ relationship: VaultRelationship;
130
+ /** The timestamp when the vault was created. */
131
+ createTimeMillis: number;
132
+ }
133
+ //# sourceMappingURL=vaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vaults.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/vaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,6BAA6B;AAC7B,MAAM,WAAW,YAAY;IACzB,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IAEb,gCAAgC;IAChC,YAAY,EAAE,GAAG,CAAC;IAElB,iCAAiC;IACjC,MAAM,EAAE,GAAG,CAAC;IAEZ,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAC;IAEpB,kCAAkC;IAClC,SAAS,EAAE;QACP;YAAC,KAAK;YAAE,YAAY;SAAC;QACrB;YAAC,MAAM;YAAE,YAAY;SAAC;QACtB;YAAC,OAAO;YAAE,YAAY;SAAC;QACvB;YAAC,SAAS;YAAE,YAAY;SAAC;QACzB;YAAC,SAAS;YAAE,YAAY;SAAC;QACzB;YAAC,UAAU;YAAE,YAAY;SAAC;QAC1B;YAAC,WAAW;YAAE,YAAY;SAAC;QAC3B;YAAC,aAAa;YAAE,YAAY;SAAC;KAChC,CAAC;IAEF,qDAAqD;IACrD,GAAG,EAAE,MAAM,CAAC;IAEZ,aAAa,EAA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