@nktkas/hyperliquid 0.13.2 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +4 -7
- package/README.md +297 -103
- package/esm/mod.d.ts +3 -12
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +2 -2
- package/esm/src/{transports/base.d.ts → base.d.ts} +11 -14
- package/esm/src/base.d.ts.map +1 -0
- package/esm/src/base.js +14 -0
- package/esm/src/clients/event.d.ts +4 -4
- package/esm/src/clients/event.d.ts.map +1 -1
- package/esm/src/clients/event.js +2 -2
- package/esm/src/clients/public.d.ts +109 -6
- package/esm/src/clients/public.d.ts.map +1 -1
- package/esm/src/clients/public.js +106 -3
- package/esm/src/clients/wallet.d.ts +232 -29
- package/esm/src/clients/wallet.d.ts.map +1 -1
- package/esm/src/clients/wallet.js +859 -243
- package/esm/src/signing.d.ts +135 -0
- package/esm/src/signing.d.ts.map +1 -0
- package/esm/src/signing.js +188 -0
- package/esm/src/transports/http/http_transport.d.ts +2 -4
- package/esm/src/transports/http/http_transport.d.ts.map +1 -1
- package/esm/src/transports/http/http_transport.js +8 -13
- package/{script/src/transports/websocket/hyperliquid_event_target.d.ts → esm/src/transports/websocket/_hyperliquid_event_target.d.ts} +7 -15
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -0
- package/esm/src/transports/websocket/{hyperliquid_event_target.js → _hyperliquid_event_target.js} +4 -22
- package/esm/src/transports/websocket/{reconnecting_websocket.d.ts → _reconnecting_websocket.d.ts} +26 -26
- package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -0
- package/esm/src/transports/websocket/{reconnecting_websocket.js → _reconnecting_websocket.js} +91 -76
- package/esm/src/transports/websocket/{websocket_request_dispatcher.d.ts → _websocket_request_dispatcher.d.ts} +3 -7
- package/esm/src/transports/websocket/_websocket_request_dispatcher.d.ts.map +1 -0
- package/esm/src/transports/websocket/{websocket_request_dispatcher.js → _websocket_request_dispatcher.js} +3 -7
- package/esm/src/transports/websocket/websocket_transport.d.ts +13 -16
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.js +49 -49
- package/esm/src/types/exchange/requests.d.ts +172 -20
- package/esm/src/types/exchange/requests.d.ts.map +1 -1
- package/esm/src/types/exchange/responses.d.ts +32 -32
- package/esm/src/types/exchange/responses.d.ts.map +1 -1
- package/esm/src/types/explorer/requests.d.ts +12 -12
- package/esm/src/types/explorer/requests.d.ts.map +1 -1
- package/esm/src/types/explorer/responses.d.ts +36 -1
- package/esm/src/types/explorer/responses.d.ts.map +1 -1
- package/esm/src/types/info/accounts.d.ts +130 -105
- package/esm/src/types/info/accounts.d.ts.map +1 -1
- package/esm/src/types/info/assets.d.ts +154 -152
- package/esm/src/types/info/assets.d.ts.map +1 -1
- package/esm/src/types/info/delegations.d.ts +20 -20
- package/esm/src/types/info/delegations.d.ts.map +1 -1
- package/esm/src/types/info/orders.d.ts +55 -55
- package/esm/src/types/info/orders.d.ts.map +1 -1
- package/esm/src/types/info/requests.d.ts +73 -10
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/esm/src/types/info/vaults.d.ts +1 -1
- package/esm/src/types/info/vaults.d.ts.map +1 -1
- package/esm/src/types/mod.d.ts +14 -0
- package/esm/src/types/mod.d.ts.map +1 -0
- package/esm/src/types/subscriptions/requests.d.ts +1 -1
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/{script/src/types/subscriptions/common.d.ts → esm/src/types/subscriptions/responses.d.ts} +16 -4
- package/esm/src/types/subscriptions/responses.d.ts.map +1 -0
- package/package.json +20 -4
- package/script/mod.d.ts +3 -12
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +3 -5
- package/script/src/{transports/base.d.ts → base.d.ts} +11 -14
- package/script/src/base.d.ts.map +1 -0
- package/script/src/{transports/base.js → base.js} +13 -12
- package/script/src/clients/event.d.ts +4 -4
- package/script/src/clients/event.d.ts.map +1 -1
- package/script/src/clients/event.js +2 -2
- package/script/src/clients/public.d.ts +109 -6
- package/script/src/clients/public.d.ts.map +1 -1
- package/script/src/clients/public.js +106 -3
- package/script/src/clients/wallet.d.ts +232 -29
- package/script/src/clients/wallet.d.ts.map +1 -1
- package/script/src/clients/wallet.js +860 -244
- package/script/src/signing.d.ts +135 -0
- package/script/src/signing.d.ts.map +1 -0
- package/script/src/signing.js +203 -0
- package/script/src/transports/http/http_transport.d.ts +2 -4
- package/script/src/transports/http/http_transport.d.ts.map +1 -1
- package/script/src/transports/http/http_transport.js +9 -14
- package/{esm/src/transports/websocket/hyperliquid_event_target.d.ts → script/src/transports/websocket/_hyperliquid_event_target.d.ts} +7 -15
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -0
- package/script/src/transports/websocket/{hyperliquid_event_target.js → _hyperliquid_event_target.js} +4 -22
- package/script/src/transports/websocket/{reconnecting_websocket.d.ts → _reconnecting_websocket.d.ts} +26 -26
- package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -0
- package/script/src/transports/websocket/{reconnecting_websocket.js → _reconnecting_websocket.js} +94 -78
- package/script/src/transports/websocket/{websocket_request_dispatcher.d.ts → _websocket_request_dispatcher.d.ts} +3 -7
- package/script/src/transports/websocket/_websocket_request_dispatcher.d.ts.map +1 -0
- package/script/src/transports/websocket/{websocket_request_dispatcher.js → _websocket_request_dispatcher.js} +4 -8
- package/script/src/transports/websocket/websocket_transport.d.ts +13 -16
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.js +55 -55
- package/script/src/types/exchange/requests.d.ts +172 -20
- package/script/src/types/exchange/requests.d.ts.map +1 -1
- package/script/src/types/exchange/responses.d.ts +32 -32
- package/script/src/types/exchange/responses.d.ts.map +1 -1
- package/script/src/types/explorer/requests.d.ts +12 -12
- package/script/src/types/explorer/requests.d.ts.map +1 -1
- package/script/src/types/explorer/responses.d.ts +36 -1
- package/script/src/types/explorer/responses.d.ts.map +1 -1
- package/script/src/types/info/accounts.d.ts +130 -105
- package/script/src/types/info/accounts.d.ts.map +1 -1
- package/script/src/types/info/assets.d.ts +154 -152
- package/script/src/types/info/assets.d.ts.map +1 -1
- package/script/src/types/info/delegations.d.ts +20 -20
- package/script/src/types/info/delegations.d.ts.map +1 -1
- package/script/src/types/info/orders.d.ts +55 -55
- package/script/src/types/info/orders.d.ts.map +1 -1
- package/script/src/types/info/requests.d.ts +73 -10
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/info/vaults.d.ts +1 -1
- package/script/src/types/info/vaults.d.ts.map +1 -1
- package/script/src/types/mod.d.ts +14 -0
- package/script/src/types/mod.d.ts.map +1 -0
- package/script/src/types/subscriptions/requests.d.ts +1 -1
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
- package/{esm/src/types/subscriptions/common.d.ts → script/src/types/subscriptions/responses.d.ts} +16 -4
- package/script/src/types/subscriptions/responses.d.ts.map +1 -0
- package/esm/src/transports/base.d.ts.map +0 -1
- package/esm/src/transports/base.js +0 -14
- package/esm/src/transports/websocket/hyperliquid_event_target.d.ts.map +0 -1
- package/esm/src/transports/websocket/reconnecting_websocket.d.ts.map +0 -1
- package/esm/src/transports/websocket/websocket_request_dispatcher.d.ts.map +0 -1
- package/esm/src/types/common.d.ts +0 -3
- package/esm/src/types/common.d.ts.map +0 -1
- package/esm/src/types/exchange/common.d.ts +0 -36
- package/esm/src/types/exchange/common.d.ts.map +0 -1
- package/esm/src/types/explorer/common.d.ts +0 -37
- package/esm/src/types/explorer/common.d.ts.map +0 -1
- package/esm/src/types/explorer/common.js +0 -1
- package/esm/src/types/subscriptions/common.d.ts.map +0 -1
- package/esm/src/types/subscriptions/common.js +0 -1
- package/esm/src/utils/key_sort.d.ts +0 -21
- package/esm/src/utils/key_sort.d.ts.map +0 -1
- package/esm/src/utils/key_sort.js +0 -124
- package/esm/src/utils/signing.d.ts +0 -109
- package/esm/src/utils/signing.d.ts.map +0 -1
- package/esm/src/utils/signing.js +0 -164
- package/script/src/transports/base.d.ts.map +0 -1
- package/script/src/transports/websocket/hyperliquid_event_target.d.ts.map +0 -1
- package/script/src/transports/websocket/reconnecting_websocket.d.ts.map +0 -1
- package/script/src/transports/websocket/websocket_request_dispatcher.d.ts.map +0 -1
- package/script/src/types/common.d.ts +0 -3
- package/script/src/types/common.d.ts.map +0 -1
- package/script/src/types/exchange/common.d.ts +0 -36
- package/script/src/types/exchange/common.d.ts.map +0 -1
- package/script/src/types/explorer/common.d.ts +0 -37
- package/script/src/types/explorer/common.d.ts.map +0 -1
- package/script/src/types/explorer/common.js +0 -12
- package/script/src/types/subscriptions/common.d.ts.map +0 -1
- package/script/src/types/subscriptions/common.js +0 -12
- package/script/src/utils/key_sort.d.ts +0 -21
- package/script/src/utils/key_sort.d.ts.map +0 -1
- package/script/src/utils/key_sort.js +0 -137
- package/script/src/utils/signing.d.ts +0 -109
- package/script/src/utils/signing.d.ts.map +0 -1
- package/script/src/utils/signing.js +0 -182
- /package/esm/src/types/{common.js → mod.js} +0 -0
- /package/esm/src/types/{exchange/common.js → subscriptions/responses.js} +0 -0
- /package/script/src/types/{common.js → mod.js} +0 -0
- /package/script/src/types/{exchange/common.js → subscriptions/responses.js} +0 -0
|
@@ -1,9 +1,43 @@
|
|
|
1
|
-
import type { Hex } from "
|
|
1
|
+
import type { Hex } from "../../base.js";
|
|
2
2
|
/** Mapping of coin symbols to mid prices. */
|
|
3
3
|
export interface AllMids {
|
|
4
4
|
/** Mid prices mapped by coin symbol. */
|
|
5
5
|
[coin: string]: string;
|
|
6
6
|
}
|
|
7
|
+
/** Candlestick data point. */
|
|
8
|
+
export interface Candle {
|
|
9
|
+
/** Opening timestamp (ms since epoch). */
|
|
10
|
+
t: number;
|
|
11
|
+
/** Closing timestamp (ms since epoch). */
|
|
12
|
+
T: number;
|
|
13
|
+
/** Asset symbol. */
|
|
14
|
+
s: string;
|
|
15
|
+
/** Candle interval (e.g., "1m", "5m", "1h", etc.). */
|
|
16
|
+
i: string;
|
|
17
|
+
/** Opening price. */
|
|
18
|
+
o: string;
|
|
19
|
+
/** Closing price. */
|
|
20
|
+
c: string;
|
|
21
|
+
/** Highest price. */
|
|
22
|
+
h: string;
|
|
23
|
+
/** Lowest price. */
|
|
24
|
+
l: string;
|
|
25
|
+
/** Total volume traded in base currency. */
|
|
26
|
+
v: string;
|
|
27
|
+
/** Number of trades executed. */
|
|
28
|
+
n: number;
|
|
29
|
+
}
|
|
30
|
+
/** Historical funding rate record for an asset. */
|
|
31
|
+
export interface FundingHistory {
|
|
32
|
+
/** Asset symbol. */
|
|
33
|
+
coin: string;
|
|
34
|
+
/** Funding rate. */
|
|
35
|
+
fundingRate: string;
|
|
36
|
+
/** Premium price. */
|
|
37
|
+
premium: string;
|
|
38
|
+
/** Funding record timestamp (ms since epoch). */
|
|
39
|
+
time: number;
|
|
40
|
+
}
|
|
7
41
|
/** Context for a perpetual asset. */
|
|
8
42
|
export interface PerpsAssetCtx extends SharedAssetCtx {
|
|
9
43
|
/** Funding rate. */
|
|
@@ -19,6 +53,56 @@ export interface PerpsAssetCtx extends SharedAssetCtx {
|
|
|
19
53
|
/** Daily volume in base currency. */
|
|
20
54
|
dayBaseVlm: string;
|
|
21
55
|
}
|
|
56
|
+
/** Metadata for perpetual assets. */
|
|
57
|
+
export interface PerpsMeta {
|
|
58
|
+
/** Trading universes available for perpetual trading. */
|
|
59
|
+
universe: PerpsUniverse[];
|
|
60
|
+
}
|
|
61
|
+
/** Metadata and context for perpetual assets. */
|
|
62
|
+
export type PerpsMetaAndAssetCtxs = [
|
|
63
|
+
/** Metadata for assets. */
|
|
64
|
+
PerpsMeta,
|
|
65
|
+
/** Context for each perpetual asset. */
|
|
66
|
+
PerpsAssetCtx[]
|
|
67
|
+
];
|
|
68
|
+
/** Trading universe parameters for perpetual assets. */
|
|
69
|
+
export interface PerpsUniverse {
|
|
70
|
+
/** Minimum decimal places for order sizes. */
|
|
71
|
+
szDecimals: number;
|
|
72
|
+
/**
|
|
73
|
+
* Name of the universe.
|
|
74
|
+
*
|
|
75
|
+
* Note: Maximum length 6 characters. No uniqueness constraints.
|
|
76
|
+
*/
|
|
77
|
+
name: string;
|
|
78
|
+
/** Maximum allowed leverage. */
|
|
79
|
+
maxLeverage: number;
|
|
80
|
+
/** Indicates if only isolated margin trading is allowed. */
|
|
81
|
+
onlyIsolated?: true;
|
|
82
|
+
/** Indicates if the universe is delisted. */
|
|
83
|
+
isDelisted?: true;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Predicted funding data.
|
|
87
|
+
*
|
|
88
|
+
* The first element is the asset symbol and the second element is an array of predicted funding data for each exchange.
|
|
89
|
+
*/
|
|
90
|
+
export type PredictedFunding = [
|
|
91
|
+
/** Asset symbol. */
|
|
92
|
+
string,
|
|
93
|
+
/** Array of predicted funding data for each exchange. */
|
|
94
|
+
[
|
|
95
|
+
/** Exchange symbol. */
|
|
96
|
+
string,
|
|
97
|
+
/** Predicted funding data. */
|
|
98
|
+
{
|
|
99
|
+
/** Predicted funding rate. */
|
|
100
|
+
fundingRate: string;
|
|
101
|
+
/** Next funding time (ms since epoch). */
|
|
102
|
+
nextFundingTime: number;
|
|
103
|
+
} | null
|
|
104
|
+
][]
|
|
105
|
+
];
|
|
22
106
|
/** Shared context for assets. */
|
|
23
107
|
export interface SharedAssetCtx {
|
|
24
108
|
/** Previous day's closing price. */
|
|
@@ -41,10 +125,53 @@ export interface SpotAssetCtx extends SharedAssetCtx {
|
|
|
41
125
|
/** Daily volume in base currency. */
|
|
42
126
|
dayBaseVlm: string;
|
|
43
127
|
}
|
|
44
|
-
/**
|
|
45
|
-
export interface
|
|
46
|
-
/**
|
|
47
|
-
|
|
128
|
+
/** Deploy state for spot tokens. */
|
|
129
|
+
export interface SpotDeployState {
|
|
130
|
+
/** Array of deploy states for tokens. */
|
|
131
|
+
states: {
|
|
132
|
+
/** Token ID. */
|
|
133
|
+
token: number;
|
|
134
|
+
/** Token specification. */
|
|
135
|
+
spec: {
|
|
136
|
+
/** Name of the token. */
|
|
137
|
+
name: string;
|
|
138
|
+
/** Minimum decimal places for order sizes. */
|
|
139
|
+
szDecimals: number;
|
|
140
|
+
/** Number of decimals for the token's smallest unit. */
|
|
141
|
+
weiDecimals: number;
|
|
142
|
+
};
|
|
143
|
+
/** Full name of the token. */
|
|
144
|
+
fullName: string | null;
|
|
145
|
+
/** Deployer trading fee share for the token. */
|
|
146
|
+
deployerTradingFeeShare: string;
|
|
147
|
+
/** Spot indices for the token. */
|
|
148
|
+
spots: number[];
|
|
149
|
+
/** Maximum supply of the token. */
|
|
150
|
+
maxSupply: string | null;
|
|
151
|
+
/** Hyperliquidity genesis balance of the token. */
|
|
152
|
+
hyperliquidityGenesisBalance: string;
|
|
153
|
+
/** Total genesis balance (in Wei) for the token. */
|
|
154
|
+
totalGenesisBalanceWei: string;
|
|
155
|
+
/** User genesis balances for the token. */
|
|
156
|
+
userGenesisBalances: [Hex, string][];
|
|
157
|
+
/** Existing token genesis balances for the token. */
|
|
158
|
+
existingTokenGenesisBalances: [number, string][];
|
|
159
|
+
/** Blacklisted users for the token. */
|
|
160
|
+
blacklistUsers: Hex[];
|
|
161
|
+
}[];
|
|
162
|
+
/** Gas auction details. */
|
|
163
|
+
gasAuction: {
|
|
164
|
+
/** Current gas. */
|
|
165
|
+
currentGas: string | null;
|
|
166
|
+
/** Duration in seconds. */
|
|
167
|
+
durationSeconds: number;
|
|
168
|
+
/** Ending gas. */
|
|
169
|
+
endGas: string | null;
|
|
170
|
+
/** Starting gas. */
|
|
171
|
+
startGas: string;
|
|
172
|
+
/** Auction start time (seconds since epoch). */
|
|
173
|
+
startTimeSeconds: number;
|
|
174
|
+
};
|
|
48
175
|
}
|
|
49
176
|
/** Metadata for spot assets. */
|
|
50
177
|
export interface SpotMeta {
|
|
@@ -53,38 +180,13 @@ export interface SpotMeta {
|
|
|
53
180
|
/** Tokens available for spot trading. */
|
|
54
181
|
tokens: SpotToken[];
|
|
55
182
|
}
|
|
56
|
-
/**
|
|
57
|
-
export
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
* Note: Maximum length 6 characters. No uniqueness constraints.
|
|
64
|
-
*/
|
|
65
|
-
name: string;
|
|
66
|
-
/** Maximum allowed leverage. */
|
|
67
|
-
maxLeverage: number;
|
|
68
|
-
/** Indicates if only isolated margin trading is allowed. */
|
|
69
|
-
onlyIsolated?: true;
|
|
70
|
-
/** Indicates if the universe is delisted. */
|
|
71
|
-
isDelisted?: true;
|
|
72
|
-
}
|
|
73
|
-
/** Trading universe parameters for spot assets. */
|
|
74
|
-
export interface SpotUniverse {
|
|
75
|
-
/** Token indices included in this universe. */
|
|
76
|
-
tokens: number[];
|
|
77
|
-
/**
|
|
78
|
-
* Name of the universe.
|
|
79
|
-
*
|
|
80
|
-
* Note: Maximum length 6 characters. No uniqueness constraints.
|
|
81
|
-
*/
|
|
82
|
-
name: string;
|
|
83
|
-
/** Unique identifier of the universe. */
|
|
84
|
-
index: number;
|
|
85
|
-
/** Indicates if the token is the primary representation in the system. */
|
|
86
|
-
isCanonical: boolean;
|
|
87
|
-
}
|
|
183
|
+
/** Metadata and context for spot assets. */
|
|
184
|
+
export type SpotMetaAndAssetCtxs = [
|
|
185
|
+
/** Metadata for assets. */
|
|
186
|
+
SpotMeta,
|
|
187
|
+
/** Context for each spot asset. */
|
|
188
|
+
SpotAssetCtx[]
|
|
189
|
+
];
|
|
88
190
|
/** Details for a trading token in spot markets. */
|
|
89
191
|
export interface SpotToken {
|
|
90
192
|
/**
|
|
@@ -115,6 +217,21 @@ export interface SpotToken {
|
|
|
115
217
|
/** Deployer trading fee share for the token. */
|
|
116
218
|
deployerTradingFeeShare: string;
|
|
117
219
|
}
|
|
220
|
+
/** Trading universe parameters for spot assets. */
|
|
221
|
+
export interface SpotUniverse {
|
|
222
|
+
/** Token indices included in this universe. */
|
|
223
|
+
tokens: number[];
|
|
224
|
+
/**
|
|
225
|
+
* Name of the universe.
|
|
226
|
+
*
|
|
227
|
+
* Note: Maximum length 6 characters. No uniqueness constraints.
|
|
228
|
+
*/
|
|
229
|
+
name: string;
|
|
230
|
+
/** Unique identifier of the universe. */
|
|
231
|
+
index: number;
|
|
232
|
+
/** Indicates if the token is the primary representation in the system. */
|
|
233
|
+
isCanonical: boolean;
|
|
234
|
+
}
|
|
118
235
|
/** Details of a token. */
|
|
119
236
|
export interface TokenDetails {
|
|
120
237
|
/** Name of the token. */
|
|
@@ -157,119 +274,4 @@ export interface TokenDetails {
|
|
|
157
274
|
/** Future emissions amount. */
|
|
158
275
|
futureEmissions: string;
|
|
159
276
|
}
|
|
160
|
-
/** Metadata and context for perpetual assets. */
|
|
161
|
-
export type PerpsMetaAndAssetCtxs = [
|
|
162
|
-
/** Metadata for assets. */
|
|
163
|
-
PerpsMeta,
|
|
164
|
-
/** Context for each perpetual asset. */
|
|
165
|
-
PerpsAssetCtx[]
|
|
166
|
-
];
|
|
167
|
-
/** Metadata and context for spot assets. */
|
|
168
|
-
export type SpotMetaAndAssetCtxs = [
|
|
169
|
-
/** Metadata for assets. */
|
|
170
|
-
SpotMeta,
|
|
171
|
-
/** Context for each spot asset. */
|
|
172
|
-
SpotAssetCtx[]
|
|
173
|
-
];
|
|
174
|
-
/** Candlestick data point. */
|
|
175
|
-
export interface Candle {
|
|
176
|
-
/** Opening timestamp (ms since epoch). */
|
|
177
|
-
t: number;
|
|
178
|
-
/** Closing timestamp (ms since epoch). */
|
|
179
|
-
T: number;
|
|
180
|
-
/** Asset symbol. */
|
|
181
|
-
s: string;
|
|
182
|
-
/** Candle interval (e.g., "1m", "5m", "1h", etc.). */
|
|
183
|
-
i: string;
|
|
184
|
-
/** Opening price. */
|
|
185
|
-
o: string;
|
|
186
|
-
/** Closing price. */
|
|
187
|
-
c: string;
|
|
188
|
-
/** Highest price. */
|
|
189
|
-
h: string;
|
|
190
|
-
/** Lowest price. */
|
|
191
|
-
l: string;
|
|
192
|
-
/** Total volume traded in base currency. */
|
|
193
|
-
v: string;
|
|
194
|
-
/** Number of trades executed. */
|
|
195
|
-
n: number;
|
|
196
|
-
}
|
|
197
|
-
/** Historical funding rate record for an asset. */
|
|
198
|
-
export interface FundingHistory {
|
|
199
|
-
/** Asset symbol. */
|
|
200
|
-
coin: string;
|
|
201
|
-
/** Funding rate. */
|
|
202
|
-
fundingRate: string;
|
|
203
|
-
/** Premium price. */
|
|
204
|
-
premium: string;
|
|
205
|
-
/** Funding record timestamp (ms since epoch). */
|
|
206
|
-
time: number;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Predicted funding data.
|
|
210
|
-
*
|
|
211
|
-
* The first element is the asset symbol and the second element is an array of predicted funding data for each exchange.
|
|
212
|
-
*/
|
|
213
|
-
export type PredictedFunding = [
|
|
214
|
-
/** Asset symbol. */
|
|
215
|
-
string,
|
|
216
|
-
/** Array of predicted funding data for each exchange. */
|
|
217
|
-
[
|
|
218
|
-
/** Exchange symbol. */
|
|
219
|
-
string,
|
|
220
|
-
/** Predicted funding data. */
|
|
221
|
-
{
|
|
222
|
-
/** Predicted funding rate. */
|
|
223
|
-
fundingRate: string;
|
|
224
|
-
/** Next funding time (ms since epoch). */
|
|
225
|
-
nextFundingTime: number;
|
|
226
|
-
} | null
|
|
227
|
-
][]
|
|
228
|
-
];
|
|
229
|
-
/** Deploy state for spot tokens. */
|
|
230
|
-
export interface SpotDeployState {
|
|
231
|
-
/** Array of deploy states for tokens. */
|
|
232
|
-
states: {
|
|
233
|
-
/** Token ID. */
|
|
234
|
-
token: number;
|
|
235
|
-
/** Token specification. */
|
|
236
|
-
spec: {
|
|
237
|
-
/** Name of the token. */
|
|
238
|
-
name: string;
|
|
239
|
-
/** Minimum decimal places for order sizes. */
|
|
240
|
-
szDecimals: number;
|
|
241
|
-
/** Number of decimals for the token's smallest unit. */
|
|
242
|
-
weiDecimals: number;
|
|
243
|
-
};
|
|
244
|
-
/** Full name of the token. */
|
|
245
|
-
fullName: string | null;
|
|
246
|
-
/** Deployer trading fee share for the token. */
|
|
247
|
-
deployerTradingFeeShare: string;
|
|
248
|
-
/** Spot indices for the token. */
|
|
249
|
-
spots: number[];
|
|
250
|
-
/** Maximum supply of the token. */
|
|
251
|
-
maxSupply: string | null;
|
|
252
|
-
/** Hyperliquidity genesis balance of the token. */
|
|
253
|
-
hyperliquidityGenesisBalance: string;
|
|
254
|
-
/** Total genesis balance (in Wei) for the token. */
|
|
255
|
-
totalGenesisBalanceWei: string;
|
|
256
|
-
/** User genesis balances for the token. */
|
|
257
|
-
userGenesisBalances: [Hex, string][];
|
|
258
|
-
/** Existing token genesis balances for the token. */
|
|
259
|
-
existingTokenGenesisBalances: [number, string][];
|
|
260
|
-
}[];
|
|
261
|
-
/** Gas auction details. */
|
|
262
|
-
gasAuction: {
|
|
263
|
-
/** Current gas. */
|
|
264
|
-
currentGas: string | null;
|
|
265
|
-
/** Duration in seconds. */
|
|
266
|
-
durationSeconds: number;
|
|
267
|
-
/** Ending gas. */
|
|
268
|
-
endGas: string | null;
|
|
269
|
-
/** Starting gas. */
|
|
270
|
-
startGas: string;
|
|
271
|
-
/** Auction start time (seconds since epoch). */
|
|
272
|
-
startTimeSeconds: number;
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
277
|
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/assets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/assets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,6CAA6C;AAC7C,MAAM,WAAW,OAAO;IACpB,wCAAwC;IACxC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;C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;IAClB,kCAAkC;IAClC,OAAO,EAAE;QACL,qBAAqB;QACrB,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC;QAC9B,+BAA+B;QAC/B,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;QAC1C,yBAAyB;QACzB,cAAc,EAAE,GAAG,EAAE,CAAC;KACzB,GAAG,IAAI,CAAC;IACT,wBAAwB;IACxB,QAAQ,EAAE,GAAG,GAAG,IAAI,CAAC;IACrB,wCAAwC;IACxC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,uBAAuB;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,0BAA0B,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC;IAC5C,+BAA+B;IAC/B,eAAe,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Hex } from "
|
|
1
|
+
import type { Hex } from "../../base.js";
|
|
2
2
|
/** User delegation to a validator. */
|
|
3
3
|
export interface Delegation {
|
|
4
4
|
/** Validator address. */
|
|
@@ -17,6 +17,17 @@ export interface DelegatorReward {
|
|
|
17
17
|
/** Total reward amount. */
|
|
18
18
|
totalAmount: string;
|
|
19
19
|
}
|
|
20
|
+
/** Summary of a user's staking. */
|
|
21
|
+
export interface DelegatorSummary {
|
|
22
|
+
/** Total amount of delegated tokens. */
|
|
23
|
+
delegated: string;
|
|
24
|
+
/** Total amount of undelegated tokens. */
|
|
25
|
+
undelegated: string;
|
|
26
|
+
/** Total amount of tokens pending withdrawal. */
|
|
27
|
+
totalPendingWithdrawal: string;
|
|
28
|
+
/** Number of pending withdrawals. */
|
|
29
|
+
nPendingWithdrawals: number;
|
|
30
|
+
}
|
|
20
31
|
/** Record of a staking event by a delegator. */
|
|
21
32
|
export interface DelegatorUpdate {
|
|
22
33
|
/** Timestamp of the delegation event (in ms since epoch). */
|
|
@@ -56,16 +67,14 @@ export interface DelegatorUpdateWithdrawal {
|
|
|
56
67
|
phase: "initiated" | "finalized";
|
|
57
68
|
};
|
|
58
69
|
}
|
|
59
|
-
/**
|
|
60
|
-
export interface
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
/** Number of pending withdrawals. */
|
|
68
|
-
nPendingWithdrawals: number;
|
|
70
|
+
/** Statistics for validator performance over a time period. */
|
|
71
|
+
export interface ValidatorStats {
|
|
72
|
+
/** Fraction of time the validator was online. */
|
|
73
|
+
uptimeFraction: string;
|
|
74
|
+
/** Predicted annual percentage rate of returns. */
|
|
75
|
+
predictedApr: string;
|
|
76
|
+
/** Number of samples used for statistics calculation. */
|
|
77
|
+
nSamples: number;
|
|
69
78
|
}
|
|
70
79
|
/** Summary of a validator's status and performance. */
|
|
71
80
|
export interface ValidatorSummary {
|
|
@@ -105,13 +114,4 @@ export interface ValidatorSummary {
|
|
|
105
114
|
]
|
|
106
115
|
];
|
|
107
116
|
}
|
|
108
|
-
/** Statistics for validator performance over a time period. */
|
|
109
|
-
export interface ValidatorStats {
|
|
110
|
-
/** Fraction of time the validator was online. */
|
|
111
|
-
uptimeFraction: string;
|
|
112
|
-
/** Predicted annual percentage rate of returns. */
|
|
113
|
-
predictedApr: string;
|
|
114
|
-
/** Number of samples used for statistics calculation. */
|
|
115
|
-
nSamples: number;
|
|
116
|
-
}
|
|
117
117
|
//# sourceMappingURL=delegations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegations.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/delegations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"delegations.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/delegations.ts"],"names":[],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AAED,kDAAkD;AAClD,MAAM,WAAW,yBAAyB;IACtC,0BAA0B;IAC1B,UAAU,EAAE;QACR,wCAAwC;QACxC,MAAM,EAAE,MAAM,CAAC;QACf,uCAAuC;QACvC,KAAK,EAAE,WAAW,GAAG,WAAW,CAAC;KACpC,CAAC;CACL;AAED,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC3B,iDAAiD;IACjD,cAAc,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAC7B,gCAAgC;IAChC,SAAS,EAAE,GAAG,CAAC;IACf,yCAAyC;IACzC,MAAM,EAAE,GAAG,CAAC;IACZ,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,wEAAwE;IACxE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iDAAiD;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,KAAK,EAAE;QACH;YAAC,KAAK;YAAE,cAAc;SAAC;QACvB;YAAC,MAAM;YAAE,cAAc;SAAC;QACxB;YAAC,OAAO;YAAE,cAAc;SAAC;KAC5B,CAAC;CACL"}
|
|
@@ -1,49 +1,4 @@
|
|
|
1
|
-
import type { Hex } from "
|
|
2
|
-
/**
|
|
3
|
-
* Order types for market execution.
|
|
4
|
-
* - Market: Executes immediately at the market price.
|
|
5
|
-
* - Limit: Executes at the specified limit price or better.
|
|
6
|
-
* - Stop Market: Activates as a market order when a stop price is reached.
|
|
7
|
-
* - Stop Limit: Activates as a limit order when a stop price is reached.
|
|
8
|
-
*
|
|
9
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types
|
|
10
|
-
*/
|
|
11
|
-
export type OrderType = "Market" | "Limit" | "Stop Market" | "Stop Limit";
|
|
12
|
-
/**
|
|
13
|
-
* Time-in-force options.
|
|
14
|
-
* - Gtc: Remains active until filled or canceled.
|
|
15
|
-
* - Ioc: Fills immediately or cancels any unfilled portion.
|
|
16
|
-
* - Alo: Adds liquidity only.
|
|
17
|
-
* - FrontendMarket: Similar to Ioc, used in Hyperliquid UI.
|
|
18
|
-
* - LiquidationMarket: Similar to Ioc, used in Hyperliquid UI.
|
|
19
|
-
*/
|
|
20
|
-
export type TIF = "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket";
|
|
21
|
-
/**
|
|
22
|
-
* TWAP order status.
|
|
23
|
-
* - finished: Fully executed.
|
|
24
|
-
* - activated: Active and executing.
|
|
25
|
-
* - terminated: Terminated.
|
|
26
|
-
* - error: An error occurred.
|
|
27
|
-
*/
|
|
28
|
-
export type TwapStatus = {
|
|
29
|
-
/** Status of the TWAP order. */
|
|
30
|
-
status: "finished" | "activated" | "terminated";
|
|
31
|
-
} | {
|
|
32
|
-
/** Status of the TWAP order. */
|
|
33
|
-
status: "error";
|
|
34
|
-
/** Error message. */
|
|
35
|
-
description: string;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Order processing status.
|
|
39
|
-
* - filled: Order fully executed.
|
|
40
|
-
* - open: Order active and waiting to be filled.
|
|
41
|
-
* - canceled: Order canceled by the user.
|
|
42
|
-
* - triggered: Order triggered and awaiting execution.
|
|
43
|
-
* - rejected: Order rejected by the system.
|
|
44
|
-
* - marginCanceled: Order canceled due to insufficient margin.
|
|
45
|
-
*/
|
|
46
|
-
export type OrderProcessingStatus = "filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled";
|
|
1
|
+
import type { Hex } from "../../base.js";
|
|
47
2
|
/** L2 order book snapshot. */
|
|
48
3
|
export interface Book {
|
|
49
4
|
/** Asset symbol. */
|
|
@@ -148,15 +103,6 @@ export interface Order {
|
|
|
148
103
|
/** Indicates if the order is reduce-only. */
|
|
149
104
|
reduceOnly?: true;
|
|
150
105
|
}
|
|
151
|
-
/** Order status with additional frontend information and current state. */
|
|
152
|
-
export interface OrderStatus<O extends Order | FrontendOrder> {
|
|
153
|
-
/** Order details. */
|
|
154
|
-
order: O;
|
|
155
|
-
/** Order processing status. */
|
|
156
|
-
status: OrderProcessingStatus;
|
|
157
|
-
/** Timestamp when the status was last updated (in ms since epoch). */
|
|
158
|
-
statusTimestamp: number;
|
|
159
|
-
}
|
|
160
106
|
/** Result of an order status lookup. */
|
|
161
107
|
export type OrderLookup = {
|
|
162
108
|
/** Indicates that the order was found. */
|
|
@@ -167,6 +113,44 @@ export type OrderLookup = {
|
|
|
167
113
|
/** Indicates that the order was not found. */
|
|
168
114
|
status: "unknownOid";
|
|
169
115
|
};
|
|
116
|
+
/**
|
|
117
|
+
* Order processing status.
|
|
118
|
+
* - filled: Order fully executed.
|
|
119
|
+
* - open: Order active and waiting to be filled.
|
|
120
|
+
* - canceled: Order canceled by the user.
|
|
121
|
+
* - triggered: Order triggered and awaiting execution.
|
|
122
|
+
* - rejected: Order rejected by the system.
|
|
123
|
+
* - marginCanceled: Order canceled due to insufficient margin.
|
|
124
|
+
*/
|
|
125
|
+
export type OrderProcessingStatus = "filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled";
|
|
126
|
+
/** Order with current processing status. */
|
|
127
|
+
export interface OrderStatus<O extends Order | FrontendOrder> {
|
|
128
|
+
/** Order details. */
|
|
129
|
+
order: O;
|
|
130
|
+
/** Order processing status. */
|
|
131
|
+
status: OrderProcessingStatus;
|
|
132
|
+
/** Timestamp when the status was last updated (in ms since epoch). */
|
|
133
|
+
statusTimestamp: number;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Order types for market execution.
|
|
137
|
+
* - Market: Executes immediately at the market price.
|
|
138
|
+
* - Limit: Executes at the specified limit price or better.
|
|
139
|
+
* - Stop Market: Activates as a market order when a stop price is reached.
|
|
140
|
+
* - Stop Limit: Activates as a limit order when a stop price is reached.
|
|
141
|
+
*
|
|
142
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types
|
|
143
|
+
*/
|
|
144
|
+
export type OrderType = "Market" | "Limit" | "Stop Market" | "Stop Limit";
|
|
145
|
+
/**
|
|
146
|
+
* Time-in-force options.
|
|
147
|
+
* - Gtc: Remains active until filled or canceled.
|
|
148
|
+
* - Ioc: Fills immediately or cancels any unfilled portion.
|
|
149
|
+
* - Alo: Adds liquidity only.
|
|
150
|
+
* - FrontendMarket: Similar to Ioc, used in Hyperliquid UI.
|
|
151
|
+
* - LiquidationMarket: Similar to Ioc, used in Hyperliquid UI.
|
|
152
|
+
*/
|
|
153
|
+
export type TIF = "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket";
|
|
170
154
|
/** TWAP history record for a user. */
|
|
171
155
|
export interface TwapHistory {
|
|
172
156
|
/** Creation time of the history record (in seconds since epoch). */
|
|
@@ -206,4 +190,20 @@ export interface TwapState {
|
|
|
206
190
|
/** User address. */
|
|
207
191
|
user: Hex;
|
|
208
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* TWAP order status.
|
|
195
|
+
* - finished: Fully executed.
|
|
196
|
+
* - activated: Active and executing.
|
|
197
|
+
* - terminated: Terminated.
|
|
198
|
+
* - error: An error occurred.
|
|
199
|
+
*/
|
|
200
|
+
export type TwapStatus = {
|
|
201
|
+
/** Status of the TWAP order. */
|
|
202
|
+
status: "finished" | "activated" | "terminated";
|
|
203
|
+
} | {
|
|
204
|
+
/** Status of the TWAP order. */
|
|
205
|
+
status: "error";
|
|
206
|
+
/** Error message. */
|
|
207
|
+
description: string;
|
|
208
|
+
};
|
|
209
209
|
//# sourceMappingURL=orders.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/orders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/orders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,8BAA8B;AAC9B,MAAM,WAAW,IAAI;IACjB,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;CACtC;AAED,wBAAwB;AACxB,MAAM,WAAW,SAAS;IACtB,aAAa;IACb,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,CAAC,EAAE,MAAM,CAAC;CACb;AAED,yBAAyB;AACzB,MAAM,WAAW,IAAI;IACjB,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa;IACb,EAAE,EAAE,MAAM,CAAC;IACX,YAAY;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,kDAAkD;IAClD,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;IAChB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,IAAI,EAAE,GAAG,CAAC;IACV,gBAAgB;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,kEAAkE;IAClE,GAAG,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