@nktkas/hyperliquid 0.13.1 → 0.13.2
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/LICENSE +20 -20
- package/README.md +33 -17
- package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +9 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.js +2 -0
- package/esm/deps/jsr.io/@std/bytes/{1.0.4 → 1.0.5}/concat.d.ts +3 -1
- package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/{1.0.4 → 1.0.5}/concat.js +1 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts +9 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.7/_types.js +2 -0
- package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.js +1 -1
- package/{script/deps/jsr.io/@std/encoding/1.0.6 → esm/deps/jsr.io/@std/encoding/1.0.7}/hex.d.ts +3 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/hex.js +1 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +9 -0
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.js +2 -0
- package/esm/deps/jsr.io/@std/msgpack/{1.0.2 → 1.0.3}/encode.d.ts +3 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/msgpack/{1.0.2 → 1.0.3}/encode.js +2 -2
- package/esm/mod.d.ts +1 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/src/clients/event.d.ts +57 -16
- package/esm/src/clients/event.d.ts.map +1 -1
- package/esm/src/clients/event.js +72 -16
- package/esm/src/clients/public.d.ts +241 -49
- package/esm/src/clients/public.d.ts.map +1 -1
- package/esm/src/clients/public.js +243 -47
- package/esm/src/clients/wallet.d.ts +120 -51
- package/esm/src/clients/wallet.d.ts.map +1 -1
- package/esm/src/clients/wallet.js +192 -58
- package/esm/src/transports/websocket/hyperliquid_event_target.d.ts +27 -21
- package/esm/src/transports/websocket/hyperliquid_event_target.d.ts.map +1 -1
- package/esm/src/transports/websocket/hyperliquid_event_target.js +37 -0
- package/esm/src/transports/websocket/websocket_request_dispatcher.js +3 -3
- package/esm/src/transports/websocket/websocket_transport.d.ts +7 -10
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.js +41 -35
- package/esm/src/types/exchange/common.d.ts +6 -6
- package/esm/src/types/exchange/common.d.ts.map +1 -1
- package/esm/src/types/exchange/requests.d.ts +131 -64
- package/esm/src/types/exchange/requests.d.ts.map +1 -1
- package/esm/src/types/exchange/responses.d.ts +7 -7
- package/esm/src/types/exchange/responses.d.ts.map +1 -1
- package/esm/src/types/explorer/common.d.ts +15 -15
- package/esm/src/types/explorer/common.d.ts.map +1 -1
- package/esm/src/types/explorer/requests.d.ts +19 -6
- package/esm/src/types/explorer/requests.d.ts.map +1 -1
- package/esm/src/types/explorer/responses.d.ts +9 -2
- package/esm/src/types/explorer/responses.d.ts.map +1 -1
- package/esm/src/types/info/accounts.d.ts +189 -124
- package/esm/src/types/info/accounts.d.ts.map +1 -1
- package/esm/src/types/info/assets.d.ts +82 -78
- package/esm/src/types/info/assets.d.ts.map +1 -1
- package/esm/src/types/info/delegations.d.ts +117 -0
- package/esm/src/types/info/delegations.d.ts.map +1 -0
- package/esm/src/types/info/delegations.js +1 -0
- package/esm/src/types/info/orders.d.ts +67 -67
- package/esm/src/types/info/orders.d.ts.map +1 -1
- package/esm/src/types/info/requests.d.ts +128 -63
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/esm/src/types/info/vaults.d.ts +41 -84
- package/esm/src/types/info/vaults.d.ts.map +1 -1
- package/esm/src/types/subscriptions/common.d.ts +3 -0
- package/esm/src/types/subscriptions/common.d.ts.map +1 -1
- package/esm/src/types/subscriptions/requests.d.ts +10 -0
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/esm/src/utils/key_sort.d.ts +2 -2
- package/esm/src/utils/key_sort.d.ts.map +1 -1
- package/esm/src/utils/signing.d.ts +1 -1
- package/esm/src/utils/signing.js +2 -2
- package/package.json +1 -1
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +13 -3
- package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +23 -13
- package/script/deps/jsr.io/@noble/hashes/1.7.1/src/_assert.js +55 -45
- package/script/deps/jsr.io/@noble/hashes/1.7.1/src/_u64.js +97 -87
- package/script/deps/jsr.io/@noble/hashes/1.7.1/src/crypto.js +14 -4
- package/script/deps/jsr.io/@noble/hashes/1.7.1/src/sha3.js +288 -278
- package/script/deps/jsr.io/@noble/hashes/1.7.1/src/utils.js +238 -228
- package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +9 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/_types.js +13 -0
- package/script/deps/jsr.io/@std/bytes/{1.0.4 → 1.0.5}/concat.d.ts +3 -1
- package/script/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/concat.js +45 -0
- package/script/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts +9 -0
- package/script/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.7/_types.js +13 -0
- package/script/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.js +39 -0
- package/{esm/deps/jsr.io/@std/encoding/1.0.6 → script/deps/jsr.io/@std/encoding/1.0.7}/hex.d.ts +3 -1
- package/script/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.7/hex.js +123 -0
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +9 -0
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.js +13 -0
- package/script/deps/jsr.io/@std/msgpack/{1.0.2 → 1.0.3}/encode.d.ts +3 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.js +250 -0
- package/script/mod.d.ts +1 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +23 -13
- package/script/src/clients/event.d.ts +57 -16
- package/script/src/clients/event.d.ts.map +1 -1
- package/script/src/clients/event.js +551 -485
- package/script/src/clients/public.d.ts +241 -49
- package/script/src/clients/public.d.ts.map +1 -1
- package/script/src/clients/public.js +914 -708
- package/script/src/clients/wallet.d.ts +120 -51
- package/script/src/clients/wallet.d.ts.map +1 -1
- package/script/src/clients/wallet.js +1121 -977
- package/script/src/transports/base.js +25 -15
- package/script/src/transports/http/http_transport.js +174 -164
- package/script/src/transports/websocket/hyperliquid_event_target.d.ts +27 -21
- package/script/src/transports/websocket/hyperliquid_event_target.d.ts.map +1 -1
- package/script/src/transports/websocket/hyperliquid_event_target.js +80 -33
- package/script/src/transports/websocket/reconnecting_websocket.js +364 -354
- package/script/src/transports/websocket/websocket_request_dispatcher.js +196 -186
- package/script/src/transports/websocket/websocket_transport.d.ts +7 -10
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.js +236 -220
- package/script/src/types/common.js +12 -2
- package/script/src/types/exchange/common.d.ts +6 -6
- package/script/src/types/exchange/common.d.ts.map +1 -1
- package/script/src/types/exchange/common.js +12 -2
- package/script/src/types/exchange/requests.d.ts +131 -64
- package/script/src/types/exchange/requests.d.ts.map +1 -1
- package/script/src/types/exchange/requests.js +12 -2
- package/script/src/types/exchange/responses.d.ts +7 -7
- package/script/src/types/exchange/responses.d.ts.map +1 -1
- package/script/src/types/exchange/responses.js +12 -2
- package/script/src/types/explorer/common.d.ts +15 -15
- package/script/src/types/explorer/common.d.ts.map +1 -1
- package/script/src/types/explorer/common.js +12 -2
- package/script/src/types/explorer/requests.d.ts +19 -6
- package/script/src/types/explorer/requests.d.ts.map +1 -1
- package/script/src/types/explorer/requests.js +12 -2
- package/script/src/types/explorer/responses.d.ts +9 -2
- package/script/src/types/explorer/responses.d.ts.map +1 -1
- package/script/src/types/explorer/responses.js +12 -2
- package/script/src/types/info/accounts.d.ts +189 -124
- package/script/src/types/info/accounts.d.ts.map +1 -1
- package/script/src/types/info/accounts.js +12 -2
- package/script/src/types/info/assets.d.ts +82 -78
- package/script/src/types/info/assets.d.ts.map +1 -1
- package/script/src/types/info/assets.js +12 -2
- package/script/src/types/info/delegations.d.ts +117 -0
- package/script/src/types/info/delegations.d.ts.map +1 -0
- package/script/src/types/info/delegations.js +12 -0
- package/script/src/types/info/orders.d.ts +67 -67
- package/script/src/types/info/orders.d.ts.map +1 -1
- package/script/src/types/info/orders.js +12 -2
- package/script/src/types/info/requests.d.ts +128 -63
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/info/requests.js +12 -2
- package/script/src/types/info/vaults.d.ts +41 -84
- package/script/src/types/info/vaults.d.ts.map +1 -1
- package/script/src/types/info/vaults.js +12 -2
- package/script/src/types/subscriptions/common.d.ts +3 -0
- package/script/src/types/subscriptions/common.d.ts.map +1 -1
- package/script/src/types/subscriptions/common.js +12 -2
- package/script/src/types/subscriptions/requests.d.ts +10 -0
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
- package/script/src/types/subscriptions/requests.js +12 -2
- package/script/src/utils/key_sort.d.ts +2 -2
- package/script/src/utils/key_sort.d.ts.map +1 -1
- package/script/src/utils/key_sort.js +133 -123
- package/script/src/utils/signing.d.ts +1 -1
- package/script/src/utils/signing.js +172 -162
- package/esm/deps/jsr.io/@std/bytes/1.0.4/concat.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.6/hex.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/msgpack/1.0.2/encode.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/bytes/1.0.4/concat.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/bytes/1.0.4/concat.js +0 -35
- package/script/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.js +0 -29
- package/script/deps/jsr.io/@std/encoding/1.0.6/hex.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.6/hex.js +0 -113
- package/script/deps/jsr.io/@std/msgpack/1.0.2/encode.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/msgpack/1.0.2/encode.js +0 -240
- /package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts +0 -0
- /package/script/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts +0 -0
|
@@ -2,7 +2,7 @@ import type { Hex } from "../common.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Request mid coin prices.
|
|
4
4
|
* @returns {AllMids} Mid coin prices.
|
|
5
|
-
* @see
|
|
5
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-mids-for-all-coins
|
|
6
6
|
*/
|
|
7
7
|
export interface AllMidsRequest {
|
|
8
8
|
/** Type of request. */
|
|
@@ -11,7 +11,7 @@ export interface AllMidsRequest {
|
|
|
11
11
|
/**
|
|
12
12
|
* Request candlestick snapshots.
|
|
13
13
|
* @returns {Candle[]} Array of candlestick data points.
|
|
14
|
-
* @see
|
|
14
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#candle-snapshot
|
|
15
15
|
*/
|
|
16
16
|
export interface CandleSnapshotRequest {
|
|
17
17
|
/** Type of request. */
|
|
@@ -31,7 +31,7 @@ export interface CandleSnapshotRequest {
|
|
|
31
31
|
/**
|
|
32
32
|
* Request clearinghouse state.
|
|
33
33
|
* @returns {PerpsClearinghouseState} Account summary for perpetual trading.
|
|
34
|
-
* @see
|
|
34
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
35
35
|
*/
|
|
36
36
|
export interface ClearinghouseStateRequest {
|
|
37
37
|
/** Type of request. */
|
|
@@ -39,9 +39,54 @@ export interface ClearinghouseStateRequest {
|
|
|
39
39
|
/** User's address. */
|
|
40
40
|
user: Hex;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Request user staking delegations.
|
|
44
|
+
* @returns {Delegation[]} Array of user's staking delegations.
|
|
45
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-user-staking-delegations
|
|
46
|
+
*/
|
|
47
|
+
export interface DelegationsRequest {
|
|
48
|
+
/** Type of request. */
|
|
49
|
+
type: "delegations";
|
|
50
|
+
/** User's address. */
|
|
51
|
+
user: Hex;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Request user staking history.
|
|
55
|
+
* @returns {DelegatorUpdate[]} Array of user's staking history.
|
|
56
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-user-staking-history
|
|
57
|
+
*/
|
|
58
|
+
export interface DelegatorHistoryRequest {
|
|
59
|
+
/** Type of request. */
|
|
60
|
+
type: "delegatorHistory";
|
|
61
|
+
/** User's address. */
|
|
62
|
+
user: Hex;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Request user staking rewards.
|
|
66
|
+
* @returns {DelegatorReward[]} Array of user's staking rewards.
|
|
67
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-user-staking-rewards
|
|
68
|
+
*/
|
|
69
|
+
export interface DelegatorRewardsRequest {
|
|
70
|
+
/** Type of request. */
|
|
71
|
+
type: "delegatorRewards";
|
|
72
|
+
/** User's address. */
|
|
73
|
+
user: Hex;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Request user staking summary.
|
|
77
|
+
* @returns {DelegatorSummary} Summary of a user's staking.
|
|
78
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-user-staking-summary
|
|
79
|
+
*/
|
|
80
|
+
export interface DelegatorSummaryRequest {
|
|
81
|
+
/** Type of request. */
|
|
82
|
+
type: "delegatorSummary";
|
|
83
|
+
/** User's address. */
|
|
84
|
+
user: Hex;
|
|
85
|
+
}
|
|
42
86
|
/**
|
|
43
87
|
* Request user's extra agents.
|
|
44
88
|
* @returns {ExtraAgent[]} The extra agents of a user.
|
|
89
|
+
* @see null - no documentation
|
|
45
90
|
*/
|
|
46
91
|
export interface ExtraAgentsRequest {
|
|
47
92
|
/** Type of request. */
|
|
@@ -52,7 +97,7 @@ export interface ExtraAgentsRequest {
|
|
|
52
97
|
/**
|
|
53
98
|
* Request frontend open orders.
|
|
54
99
|
* @returns {FrontendOrder[]} Array of open orders with additional frontend information.
|
|
55
|
-
* @see
|
|
100
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders-with-additional-frontend-info
|
|
56
101
|
*/
|
|
57
102
|
export interface FrontendOpenOrdersRequest {
|
|
58
103
|
/** Type of request. */
|
|
@@ -63,7 +108,7 @@ export interface FrontendOpenOrdersRequest {
|
|
|
63
108
|
/**
|
|
64
109
|
* Request funding history.
|
|
65
110
|
* @returns {FundingHistory[]} Array of historical funding rate data for an asset.
|
|
66
|
-
* @see
|
|
111
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-historical-funding-rates
|
|
67
112
|
*/
|
|
68
113
|
export interface FundingHistoryRequest {
|
|
69
114
|
/** Type of request. */
|
|
@@ -78,7 +123,7 @@ export interface FundingHistoryRequest {
|
|
|
78
123
|
/**
|
|
79
124
|
* Request user historical orders.
|
|
80
125
|
* @returns {OrderStatus[]} Array of user's historical orders.
|
|
81
|
-
* @see
|
|
126
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-historical-orders
|
|
82
127
|
*/
|
|
83
128
|
export interface HistoricalOrdersRequest {
|
|
84
129
|
/** Type of request. */
|
|
@@ -89,7 +134,7 @@ export interface HistoricalOrdersRequest {
|
|
|
89
134
|
/**
|
|
90
135
|
* Request L2 order book ({@link L2Book}).
|
|
91
136
|
* @returns {Book} L2 order book snapshot.
|
|
92
|
-
* @see
|
|
137
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#l2-book-snapshot
|
|
93
138
|
*/
|
|
94
139
|
export interface L2BookRequest {
|
|
95
140
|
/** Type of request. */
|
|
@@ -104,7 +149,7 @@ export interface L2BookRequest {
|
|
|
104
149
|
/**
|
|
105
150
|
* Request builder fee approval.
|
|
106
151
|
* @returns {number} 1 (means 0.001%)
|
|
107
|
-
* @see
|
|
152
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#check-builder-fee-approval
|
|
108
153
|
*/
|
|
109
154
|
export interface MaxBuilderFeeRequest {
|
|
110
155
|
/** Type of request. */
|
|
@@ -114,28 +159,10 @@ export interface MaxBuilderFeeRequest {
|
|
|
114
159
|
/** Builder address. */
|
|
115
160
|
builder: Hex;
|
|
116
161
|
}
|
|
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
162
|
/**
|
|
136
163
|
* Request open orders.
|
|
137
|
-
* @returns {Order[]} Array of open
|
|
138
|
-
* @see
|
|
164
|
+
* @returns {Order[]} Array of open orders.
|
|
165
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders
|
|
139
166
|
*/
|
|
140
167
|
export interface OpenOrdersRequest {
|
|
141
168
|
/** Type of request. */
|
|
@@ -146,20 +173,40 @@ export interface OpenOrdersRequest {
|
|
|
146
173
|
/**
|
|
147
174
|
* Request order status.
|
|
148
175
|
* @returns {OrderLookup} Result of an order status lookup.
|
|
149
|
-
* @see
|
|
176
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-order-status-by-oid-or-cloid
|
|
150
177
|
*/
|
|
151
178
|
export interface OrderStatusRequest {
|
|
152
179
|
/** Type of request. */
|
|
153
180
|
type: "orderStatus";
|
|
154
181
|
/** User's address. */
|
|
155
182
|
user: Hex;
|
|
156
|
-
/**
|
|
183
|
+
/** Order ID or client order ID. */
|
|
157
184
|
oid: number | Hex;
|
|
158
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Request user portfolio.
|
|
188
|
+
* @returns {Portfolio} User's portfolio.
|
|
189
|
+
* @see null - no documentation
|
|
190
|
+
*/
|
|
191
|
+
export interface PortfolioRequest {
|
|
192
|
+
/** Type of request. */
|
|
193
|
+
type: "portfolio";
|
|
194
|
+
/** User's address. */
|
|
195
|
+
user: Hex;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Request perpetuals at open interest cap.
|
|
199
|
+
* @returns {string[]} Array of perpetuals at open interest caps.
|
|
200
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#query-perps-at-open-interest-caps
|
|
201
|
+
*/
|
|
202
|
+
export interface PerpsAtOpenInterestCapRequest {
|
|
203
|
+
/** Type of request. */
|
|
204
|
+
type: "perpsAtOpenInterestCap";
|
|
205
|
+
}
|
|
159
206
|
/**
|
|
160
207
|
* Request predicted funding rates.
|
|
161
208
|
* @returns {PredictedFunding[]} Array of predicted funding rates.
|
|
162
|
-
* @see
|
|
209
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-predicted-funding-rates-for-different-venues
|
|
163
210
|
*/
|
|
164
211
|
export interface PredictedFundingsRequest {
|
|
165
212
|
/** Type of request. */
|
|
@@ -168,6 +215,7 @@ export interface PredictedFundingsRequest {
|
|
|
168
215
|
/**
|
|
169
216
|
* Request user referral.
|
|
170
217
|
* @returns {Referral} Referral information for a user.
|
|
218
|
+
* @see null - no documentation
|
|
171
219
|
*/
|
|
172
220
|
export interface ReferralRequest {
|
|
173
221
|
/** Type of request. */
|
|
@@ -178,7 +226,7 @@ export interface ReferralRequest {
|
|
|
178
226
|
/**
|
|
179
227
|
* Request spot clearinghouse state.
|
|
180
228
|
* @returns {SpotClearinghouseState} Balances for spot tokens.
|
|
181
|
-
* @see
|
|
229
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-a-users-token-balances
|
|
182
230
|
*/
|
|
183
231
|
export interface SpotClearinghouseStateRequest {
|
|
184
232
|
/** Type of request. */
|
|
@@ -189,7 +237,7 @@ export interface SpotClearinghouseStateRequest {
|
|
|
189
237
|
/**
|
|
190
238
|
* Request spot deploy state.
|
|
191
239
|
* @returns {SpotDeployState} The deploy state of a user.
|
|
192
|
-
* @see
|
|
240
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-information-about-the-spot-deploy-auction
|
|
193
241
|
*/
|
|
194
242
|
export interface SpotDeployStateRequest {
|
|
195
243
|
/** Type of request. */
|
|
@@ -200,7 +248,7 @@ export interface SpotDeployStateRequest {
|
|
|
200
248
|
/**
|
|
201
249
|
* Request spot metadata and asset contexts.
|
|
202
250
|
* @returns {SpotMetaAndAssetCtxs} Metadata and context information for each spot asset.
|
|
203
|
-
* @see
|
|
251
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
204
252
|
*/
|
|
205
253
|
export interface SpotMetaAndAssetCtxsRequest {
|
|
206
254
|
/** Type of request. */
|
|
@@ -209,7 +257,7 @@ export interface SpotMetaAndAssetCtxsRequest {
|
|
|
209
257
|
/**
|
|
210
258
|
* Request spot trading metadata.
|
|
211
259
|
* @returns {SpotMeta} Metadata for spot assets.
|
|
212
|
-
* @see
|
|
260
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-metadata
|
|
213
261
|
*/
|
|
214
262
|
export interface SpotMetaRequest {
|
|
215
263
|
/** Type of request. */
|
|
@@ -217,8 +265,8 @@ export interface SpotMetaRequest {
|
|
|
217
265
|
}
|
|
218
266
|
/**
|
|
219
267
|
* Request user sub-accounts.
|
|
220
|
-
* @returns {SubAccount[]} Array of user sub-
|
|
221
|
-
* @see
|
|
268
|
+
* @returns {SubAccount[]} Array of user sub-accounts.
|
|
269
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-subaccounts
|
|
222
270
|
*/
|
|
223
271
|
export interface SubAccountsRequest {
|
|
224
272
|
/** Type of request. */
|
|
@@ -227,9 +275,9 @@ export interface SubAccountsRequest {
|
|
|
227
275
|
user: Hex;
|
|
228
276
|
}
|
|
229
277
|
/**
|
|
230
|
-
*
|
|
278
|
+
* Request token details.
|
|
231
279
|
* @returns {TokenDetails} The details of a token.
|
|
232
|
-
* @see
|
|
280
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-information-about-a-token
|
|
233
281
|
*/
|
|
234
282
|
export interface TokenDetailsRequest {
|
|
235
283
|
/** Type of request. */
|
|
@@ -238,8 +286,9 @@ export interface TokenDetailsRequest {
|
|
|
238
286
|
tokenId: Hex;
|
|
239
287
|
}
|
|
240
288
|
/**
|
|
241
|
-
* Request
|
|
242
|
-
* @returns {TwapHistory[]} The
|
|
289
|
+
* Request TWAP history.
|
|
290
|
+
* @returns {TwapHistory[]} The TWAP history of a user.
|
|
291
|
+
* @see null - no documentation
|
|
243
292
|
*/
|
|
244
293
|
export interface TwapHistoryRequest {
|
|
245
294
|
/** Type of request. */
|
|
@@ -250,6 +299,7 @@ export interface TwapHistoryRequest {
|
|
|
250
299
|
/**
|
|
251
300
|
* Request user fees.
|
|
252
301
|
* @returns {UserFees} User fees.
|
|
302
|
+
* @see null - no documentation
|
|
253
303
|
*/
|
|
254
304
|
export interface UserFeesRequest {
|
|
255
305
|
/** Type of request. */
|
|
@@ -259,8 +309,8 @@ export interface UserFeesRequest {
|
|
|
259
309
|
}
|
|
260
310
|
/**
|
|
261
311
|
* Request user fills by time.
|
|
262
|
-
* @returns {Fill[]} Array of user's trade
|
|
263
|
-
* @see
|
|
312
|
+
* @returns {Fill[]} Array of user's trade fills.
|
|
313
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time
|
|
264
314
|
*/
|
|
265
315
|
export interface UserFillsByTimeRequest {
|
|
266
316
|
/** Type of request. */
|
|
@@ -271,32 +321,26 @@ export interface UserFillsByTimeRequest {
|
|
|
271
321
|
startTime: number;
|
|
272
322
|
/** End time (in ms since epoch). */
|
|
273
323
|
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
|
-
*/
|
|
324
|
+
/** If true, partial fills are aggregated when a crossing order fills multiple resting orders. */
|
|
278
325
|
aggregateByTime?: boolean;
|
|
279
326
|
}
|
|
280
327
|
/**
|
|
281
328
|
* Request user fills.
|
|
282
|
-
* @returns {Fill[]} Array of user's trade
|
|
283
|
-
* @see
|
|
329
|
+
* @returns {Fill[]} Array of user's trade fills.
|
|
330
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills
|
|
284
331
|
*/
|
|
285
332
|
export interface UserFillsRequest {
|
|
286
333
|
/** Type of request. */
|
|
287
334
|
type: "userFills";
|
|
288
335
|
/** User's address. */
|
|
289
336
|
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
|
-
*/
|
|
337
|
+
/** If true, partial fills are aggregated when a crossing order fills multiple resting orders. */
|
|
294
338
|
aggregateByTime?: boolean;
|
|
295
339
|
}
|
|
296
340
|
/**
|
|
297
341
|
* Request user funding.
|
|
298
|
-
* @returns {UserFundingUpdate[]} Array of user's funding ledger
|
|
299
|
-
* @see
|
|
342
|
+
* @returns {UserFundingUpdate[]} Array of user's funding ledger updates.
|
|
343
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-a-users-funding-history-or-non-funding-ledger-updates
|
|
300
344
|
*/
|
|
301
345
|
export interface UserFundingRequest {
|
|
302
346
|
/** Type of request. */
|
|
@@ -310,8 +354,8 @@ export interface UserFundingRequest {
|
|
|
310
354
|
}
|
|
311
355
|
/**
|
|
312
356
|
* Request user non-funding ledger updates.
|
|
313
|
-
* @returns {
|
|
314
|
-
* @see
|
|
357
|
+
* @returns {UserNonFundingLedgerUpdate[]} Array of user's non-funding ledger updates.
|
|
358
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-a-users-funding-history-or-non-funding-ledger-updates
|
|
315
359
|
*/
|
|
316
360
|
export interface UserNonFundingLedgerUpdatesRequest {
|
|
317
361
|
/** Type of request. */
|
|
@@ -326,7 +370,7 @@ export interface UserNonFundingLedgerUpdatesRequest {
|
|
|
326
370
|
/**
|
|
327
371
|
* Request user rate limits.
|
|
328
372
|
* @returns {UserRateLimit} User's rate limits.
|
|
329
|
-
* @see
|
|
373
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-user-rate-limits
|
|
330
374
|
*/
|
|
331
375
|
export interface UserRateLimitRequest {
|
|
332
376
|
/** Type of request. */
|
|
@@ -335,9 +379,20 @@ export interface UserRateLimitRequest {
|
|
|
335
379
|
user: Hex;
|
|
336
380
|
}
|
|
337
381
|
/**
|
|
338
|
-
* Request user
|
|
339
|
-
* @returns {
|
|
340
|
-
* @see
|
|
382
|
+
* Request user role.
|
|
383
|
+
* @returns {UserRole} User role.
|
|
384
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-role
|
|
385
|
+
*/
|
|
386
|
+
export interface UserRoleRequest {
|
|
387
|
+
/** Type of request. */
|
|
388
|
+
type: "userRole";
|
|
389
|
+
/** User's address. */
|
|
390
|
+
user: Hex;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Request user TWAP slice fills.
|
|
394
|
+
* @returns {TwapSliceFill[]} Array of user's TWAP slice fills.
|
|
395
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-twap-slice-fills
|
|
341
396
|
*/
|
|
342
397
|
export interface UserTwapSliceFillsRequest {
|
|
343
398
|
/** Type of request. */
|
|
@@ -348,7 +403,7 @@ export interface UserTwapSliceFillsRequest {
|
|
|
348
403
|
/**
|
|
349
404
|
* Request user vault deposits.
|
|
350
405
|
* @returns {VaultEquity[]} Array of user's vault deposits.
|
|
351
|
-
* @see
|
|
406
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-vault-deposits
|
|
352
407
|
*/
|
|
353
408
|
export interface UserVaultEquitiesRequest {
|
|
354
409
|
/** Type of request. */
|
|
@@ -356,10 +411,19 @@ export interface UserVaultEquitiesRequest {
|
|
|
356
411
|
/** User's address. */
|
|
357
412
|
user: Hex;
|
|
358
413
|
}
|
|
414
|
+
/**
|
|
415
|
+
* Request validator summaries.
|
|
416
|
+
* @returns {ValidatorSummary[]} Array of validator summaries.
|
|
417
|
+
* @see null - no documentation
|
|
418
|
+
*/
|
|
419
|
+
export interface ValidatorSummariesRequest {
|
|
420
|
+
/** Type of request. */
|
|
421
|
+
type: "validatorSummaries";
|
|
422
|
+
}
|
|
359
423
|
/**
|
|
360
424
|
* Request details of a vault.
|
|
361
425
|
* @returns {VaultDetails} Details of a vault.
|
|
362
|
-
* @see
|
|
426
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-details-for-a-vault
|
|
363
427
|
*/
|
|
364
428
|
export interface VaultDetailsRequest {
|
|
365
429
|
/** Type of request. */
|
|
@@ -372,6 +436,7 @@ export interface VaultDetailsRequest {
|
|
|
372
436
|
/**
|
|
373
437
|
* Request a list of vaults less than 2 hours old.
|
|
374
438
|
* @returns {VaultSummary[]} Array of vault summaries.
|
|
439
|
+
* @see null - no documentation
|
|
375
440
|
*/
|
|
376
441
|
export interface VaultSummariesRequest {
|
|
377
442
|
/** Type of request. */
|
|
@@ -1 +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
|
|
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,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AAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B,uBAAuB;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,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,yBAAyB;IACtC,uBAAuB;IACvB,IAAI,EAAE,oBAAoB,CAAC;CAC9B;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;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,uBAAuB;IACvB,IAAI,EAAE,gBAAgB,CAAC;CAC1B"}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
});
|
|
@@ -1,133 +1,90 @@
|
|
|
1
1
|
import type { Hex } from "../common.js";
|
|
2
|
+
import type { PortfolioPeriods } from "./accounts.js";
|
|
2
3
|
/** Details about a vault. */
|
|
3
4
|
export interface VaultDetails {
|
|
4
|
-
/**
|
|
5
|
+
/** Vault name. */
|
|
5
6
|
name: string;
|
|
6
|
-
/**
|
|
7
|
+
/** Vault address. */
|
|
7
8
|
vaultAddress: Hex;
|
|
8
|
-
/**
|
|
9
|
+
/** Leader address. */
|
|
9
10
|
leader: Hex;
|
|
10
|
-
/**
|
|
11
|
+
/** Vault description. */
|
|
11
12
|
description: string;
|
|
12
|
-
/**
|
|
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. */
|
|
13
|
+
/** Vault portfolio metrics grouped by time periods. */
|
|
14
|
+
portfolio: PortfolioPeriods;
|
|
15
|
+
/** Annual percentage rate. */
|
|
48
16
|
apr: number;
|
|
17
|
+
/** unknown */
|
|
49
18
|
followerState: unknown | null;
|
|
50
|
-
/**
|
|
19
|
+
/** Ownership percentage held by leader. */
|
|
51
20
|
leaderFraction: number;
|
|
52
|
-
/**
|
|
21
|
+
/** Leader's commission percentage. */
|
|
53
22
|
leaderCommission: number;
|
|
54
|
-
/**
|
|
23
|
+
/** Vault followers list. */
|
|
55
24
|
followers: {
|
|
56
|
-
/**
|
|
25
|
+
/** Follower address or "Leader". */
|
|
57
26
|
user: Hex | "Leader";
|
|
58
|
-
/**
|
|
27
|
+
/** Follower's vault equity. */
|
|
59
28
|
vaultEquity: string;
|
|
60
|
-
/**
|
|
29
|
+
/** Current profit and loss. */
|
|
61
30
|
pnl: string;
|
|
62
|
-
/**
|
|
31
|
+
/** All-time profit and loss. */
|
|
63
32
|
allTimePnl: string;
|
|
64
|
-
/**
|
|
33
|
+
/** Subscription duration in days. */
|
|
65
34
|
daysFollowing: number;
|
|
66
|
-
/**
|
|
35
|
+
/** Vault entry timestamp. */
|
|
67
36
|
vaultEntryTime: number;
|
|
68
|
-
/**
|
|
37
|
+
/** Timestamp when funds become unlocked. */
|
|
69
38
|
lockupUntil: number;
|
|
70
39
|
}[];
|
|
71
|
-
/**
|
|
40
|
+
/** Maximum distributable amount. */
|
|
72
41
|
maxDistributable: number;
|
|
73
|
-
/**
|
|
42
|
+
/** Maximum withdrawable amount. */
|
|
74
43
|
maxWithdrawable: number;
|
|
75
|
-
/**
|
|
44
|
+
/** Vault closure status. */
|
|
76
45
|
isClosed: boolean;
|
|
77
|
-
/**
|
|
46
|
+
/** Vault relationship type. */
|
|
78
47
|
relationship: VaultRelationship;
|
|
79
|
-
/**
|
|
48
|
+
/** Deposit permission status. */
|
|
80
49
|
allowDeposits: boolean;
|
|
81
|
-
/**
|
|
50
|
+
/** Position closure policy on withdrawal. */
|
|
82
51
|
alwaysCloseOnWithdraw: boolean;
|
|
83
52
|
}
|
|
84
|
-
/**
|
|
53
|
+
/** User's vault equity details. */
|
|
85
54
|
export interface VaultEquity {
|
|
86
|
-
/**
|
|
55
|
+
/** Vault address. */
|
|
87
56
|
vaultAddress: Hex;
|
|
88
|
-
/**
|
|
57
|
+
/** User's deposited equity. */
|
|
89
58
|
equity: string;
|
|
90
59
|
}
|
|
91
|
-
/**
|
|
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. */
|
|
60
|
+
/** Vault relationship configuration. */
|
|
101
61
|
export type VaultRelationship = {
|
|
102
|
-
/**
|
|
103
|
-
type: "normal";
|
|
62
|
+
/** Relationship type. */
|
|
63
|
+
type: "normal" | "child";
|
|
104
64
|
} | {
|
|
105
|
-
/**
|
|
65
|
+
/** Relationship type. */
|
|
106
66
|
type: "parent";
|
|
107
|
-
/**
|
|
67
|
+
/** Child vault information. */
|
|
108
68
|
data: {
|
|
109
|
-
/**
|
|
69
|
+
/** Child vault addresses. */
|
|
110
70
|
childAddresses: Hex[];
|
|
111
71
|
};
|
|
112
|
-
} | {
|
|
113
|
-
/** The type of relationship. */
|
|
114
|
-
type: "child";
|
|
115
72
|
};
|
|
116
73
|
/** Summary of a vault. */
|
|
117
74
|
export interface VaultSummary {
|
|
118
|
-
/**
|
|
75
|
+
/** Vault name. */
|
|
119
76
|
name: string;
|
|
120
|
-
/**
|
|
77
|
+
/** Vault address. */
|
|
121
78
|
vaultAddress: Hex;
|
|
122
|
-
/**
|
|
79
|
+
/** Leader address. */
|
|
123
80
|
leader: Hex;
|
|
124
|
-
/**
|
|
81
|
+
/** Total value locked. */
|
|
125
82
|
tvl: string;
|
|
126
|
-
/**
|
|
83
|
+
/** Vault closure status. */
|
|
127
84
|
isClosed: boolean;
|
|
128
|
-
/**
|
|
85
|
+
/** Vault relationship type. */
|
|
129
86
|
relationship: VaultRelationship;
|
|
130
|
-
/**
|
|
87
|
+
/** Creation timestamp. */
|
|
131
88
|
createTimeMillis: number;
|
|
132
89
|
}
|
|
133
90
|
//# sourceMappingURL=vaults.d.ts.map
|
|
@@ -1 +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;
|
|
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;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,6BAA6B;AAC7B,MAAM,WAAW,YAAY;IACzB,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,YAAY,EAAE,GAAG,CAAC;IAClB,sBAAsB;IACtB,MAAM,EAAE,GAAG,CAAC;IACZ,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,SAAS,EAAE,gBAAgB,CAAC;IAC5B,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc;IAEd,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,gBAAgB,EAAE,MAAM,CAAC;IACzB,4BAA4B;IAC5B,SAAS,EAAE;QACP,oCAAoC;QACpC,IAAI,EAAE,GAAG,GAAG,QAAQ,CAAC;QACrB,+BAA+B;QAC/B,WAAW,EAAE,MAAM,CAAC;QACpB,+BAA+B;QAC/B,GAAG,EAAE,MAAM,CAAC;QACZ,gCAAgC;QAChC,UAAU,EAAE,MAAM,CAAC;QACnB,qCAAqC;QACrC,aAAa,EAAE,MAAM,CAAC;QACtB,6BAA6B;QAC7B,cAAc,EAAE,MAAM,CAAC;QACvB,4CAA4C;QAC5C,WAAW,EAAE,MAAM,CAAC;KACvB,EA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