@nktkas/hyperliquid 0.23.1 → 0.24.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 +3 -2
- package/README.md +154 -170
- package/esm/mod.d.ts +1 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/src/base.d.ts +0 -5
- package/esm/src/base.d.ts.map +1 -1
- package/esm/src/clients/exchange.d.ts +430 -393
- package/esm/src/clients/exchange.d.ts.map +1 -1
- package/esm/src/clients/exchange.js +467 -927
- package/esm/src/clients/info.d.ts +228 -203
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +236 -368
- package/esm/src/clients/multiSign.d.ts +14 -1184
- package/esm/src/clients/multiSign.d.ts.map +1 -1
- package/esm/src/clients/multiSign.js +37 -2004
- package/esm/src/clients/subscription.d.ts +95 -93
- package/esm/src/clients/subscription.d.ts.map +1 -1
- package/esm/src/clients/subscription.js +101 -146
- package/esm/src/signing/_signTypedData/ethers.d.ts +16 -4
- package/esm/src/signing/_signTypedData/ethers.d.ts.map +1 -1
- package/esm/src/signing/_signTypedData/ethers.js +1 -1
- package/esm/src/signing/_signTypedData/mod.d.ts +12 -12
- package/esm/src/signing/_signTypedData/mod.d.ts.map +1 -1
- package/esm/src/signing/_signTypedData/mod.js +52 -24
- package/esm/src/signing/_signTypedData/private_key.d.ts +6 -5
- package/esm/src/signing/_signTypedData/private_key.d.ts.map +1 -1
- package/esm/src/signing/_signTypedData/private_key.js +40 -19
- package/esm/src/signing/_signTypedData/viem.d.ts +27 -6
- package/esm/src/signing/_signTypedData/viem.d.ts.map +1 -1
- package/esm/src/signing/_signTypedData/viem.js +1 -1
- package/esm/src/signing/_sorter.d.ts +12 -21
- package/esm/src/signing/_sorter.d.ts.map +1 -1
- package/esm/src/signing/_sorter.js +30 -63
- package/esm/src/signing/mod.d.ts +177 -127
- package/esm/src/signing/mod.d.ts.map +1 -1
- package/esm/src/signing/mod.js +182 -130
- package/esm/src/transports/base.d.ts +2 -1
- package/esm/src/transports/base.d.ts.map +1 -1
- package/esm/src/transports/http/http_transport.d.ts +3 -2
- package/esm/src/transports/http/http_transport.d.ts.map +1 -1
- package/esm/src/transports/http/http_transport.js +4 -4
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +14 -6
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -2
- package/esm/src/transports/websocket/_reconnecting_websocket.d.ts +2 -1
- package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
- package/esm/src/transports/websocket/_reconnecting_websocket.js +1 -0
- package/esm/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
- package/esm/src/transports/websocket/_websocket_async_request.js +17 -21
- package/esm/src/transports/websocket/websocket_transport.d.ts +4 -4
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.js +6 -6
- package/esm/src/types/exchange/requests.d.ts +492 -306
- package/esm/src/types/exchange/requests.d.ts.map +1 -1
- package/esm/src/types/exchange/responses.d.ts +105 -25
- package/esm/src/types/exchange/responses.d.ts.map +1 -1
- package/esm/src/types/explorer/requests.d.ts +3 -3
- package/esm/src/types/explorer/requests.d.ts.map +1 -1
- package/esm/src/types/explorer/responses.d.ts +1 -1
- package/esm/src/types/explorer/responses.d.ts.map +1 -1
- package/esm/src/types/info/accounts.d.ts +403 -98
- package/esm/src/types/info/accounts.d.ts.map +1 -1
- package/esm/src/types/info/assets.d.ts +131 -35
- package/esm/src/types/info/assets.d.ts.map +1 -1
- package/esm/src/types/info/markets.d.ts +29 -8
- package/esm/src/types/info/markets.d.ts.map +1 -1
- package/esm/src/types/info/orders.d.ts +62 -17
- package/esm/src/types/info/orders.d.ts.map +1 -1
- package/esm/src/types/info/requests.d.ts +117 -51
- package/esm/src/types/info/requests.d.ts.map +1 -1
- package/esm/src/types/info/validators.d.ts +44 -14
- package/esm/src/types/info/validators.d.ts.map +1 -1
- package/esm/src/types/info/vaults.d.ts +25 -10
- package/esm/src/types/info/vaults.d.ts.map +1 -1
- package/esm/src/types/mod.d.ts +1 -1
- package/esm/src/types/mod.d.ts.map +1 -1
- package/esm/src/types/subscriptions/requests.d.ts +21 -66
- package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
- package/esm/src/types/subscriptions/responses.d.ts +46 -55
- package/esm/src/types/subscriptions/responses.d.ts.map +1 -1
- package/package.json +2 -3
- package/script/mod.d.ts +1 -1
- package/script/mod.d.ts.map +1 -1
- package/script/src/base.d.ts +0 -5
- package/script/src/base.d.ts.map +1 -1
- package/script/src/clients/exchange.d.ts +430 -393
- package/script/src/clients/exchange.d.ts.map +1 -1
- package/script/src/clients/exchange.js +466 -926
- package/script/src/clients/info.d.ts +228 -203
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +236 -368
- package/script/src/clients/multiSign.d.ts +14 -1184
- package/script/src/clients/multiSign.d.ts.map +1 -1
- package/script/src/clients/multiSign.js +38 -2005
- package/script/src/clients/subscription.d.ts +95 -93
- package/script/src/clients/subscription.d.ts.map +1 -1
- package/script/src/clients/subscription.js +101 -146
- package/script/src/signing/_signTypedData/ethers.d.ts +16 -4
- package/script/src/signing/_signTypedData/ethers.d.ts.map +1 -1
- package/script/src/signing/_signTypedData/ethers.js +2 -2
- package/script/src/signing/_signTypedData/mod.d.ts +12 -12
- package/script/src/signing/_signTypedData/mod.d.ts.map +1 -1
- package/script/src/signing/_signTypedData/mod.js +51 -26
- package/script/src/signing/_signTypedData/private_key.d.ts +6 -5
- package/script/src/signing/_signTypedData/private_key.d.ts.map +1 -1
- package/script/src/signing/_signTypedData/private_key.js +40 -18
- package/script/src/signing/_signTypedData/viem.d.ts +27 -6
- package/script/src/signing/_signTypedData/viem.d.ts.map +1 -1
- package/script/src/signing/_signTypedData/viem.js +2 -2
- package/script/src/signing/_sorter.d.ts +12 -21
- package/script/src/signing/_sorter.d.ts.map +1 -1
- package/script/src/signing/_sorter.js +30 -63
- package/script/src/signing/mod.d.ts +177 -127
- package/script/src/signing/mod.d.ts.map +1 -1
- package/script/src/signing/mod.js +185 -148
- package/script/src/transports/base.d.ts +2 -1
- package/script/src/transports/base.d.ts.map +1 -1
- package/script/src/transports/http/http_transport.d.ts +3 -2
- package/script/src/transports/http/http_transport.d.ts.map +1 -1
- package/script/src/transports/http/http_transport.js +4 -4
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +14 -6
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.js +1 -2
- package/script/src/transports/websocket/_reconnecting_websocket.d.ts +2 -1
- package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
- package/script/src/transports/websocket/_reconnecting_websocket.js +1 -0
- package/script/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
- package/script/src/transports/websocket/_websocket_async_request.js +17 -21
- package/script/src/transports/websocket/websocket_transport.d.ts +4 -4
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.js +6 -6
- package/script/src/types/exchange/requests.d.ts +492 -306
- package/script/src/types/exchange/requests.d.ts.map +1 -1
- package/script/src/types/exchange/responses.d.ts +105 -25
- package/script/src/types/exchange/responses.d.ts.map +1 -1
- package/script/src/types/explorer/requests.d.ts +3 -3
- package/script/src/types/explorer/requests.d.ts.map +1 -1
- package/script/src/types/explorer/responses.d.ts +1 -1
- package/script/src/types/explorer/responses.d.ts.map +1 -1
- package/script/src/types/info/accounts.d.ts +403 -98
- package/script/src/types/info/accounts.d.ts.map +1 -1
- package/script/src/types/info/assets.d.ts +131 -35
- package/script/src/types/info/assets.d.ts.map +1 -1
- package/script/src/types/info/markets.d.ts +29 -8
- package/script/src/types/info/markets.d.ts.map +1 -1
- package/script/src/types/info/orders.d.ts +62 -17
- package/script/src/types/info/orders.d.ts.map +1 -1
- package/script/src/types/info/requests.d.ts +117 -51
- package/script/src/types/info/requests.d.ts.map +1 -1
- package/script/src/types/info/validators.d.ts +44 -14
- package/script/src/types/info/validators.d.ts.map +1 -1
- package/script/src/types/info/vaults.d.ts +25 -10
- package/script/src/types/info/vaults.d.ts.map +1 -1
- package/script/src/types/mod.d.ts +1 -1
- package/script/src/types/mod.d.ts.map +1 -1
- package/script/src/types/subscriptions/requests.d.ts +21 -66
- package/script/src/types/subscriptions/requests.d.ts.map +1 -1
- package/script/src/types/subscriptions/responses.d.ts +46 -55
- package/script/src/types/subscriptions/responses.d.ts.map +1 -1
- package/esm/src/signing/_signTypedData/window.d.ts +0 -29
- package/esm/src/signing/_signTypedData/window.d.ts.map +0 -1
- package/esm/src/signing/_signTypedData/window.js +0 -30
- package/script/src/signing/_signTypedData/window.d.ts +0 -29
- package/script/src/signing/_signTypedData/window.d.ts.map +0 -1
- package/script/src/signing/_signTypedData/window.js +0 -34
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import type { Hex } from "
|
|
1
|
+
import type { Hex } from "../mod.js";
|
|
2
2
|
/** User delegation to a validator. */
|
|
3
3
|
export interface Delegation {
|
|
4
4
|
/** Validator address. */
|
|
5
5
|
validator: Hex;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Amount of tokens delegated to the validator.
|
|
8
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
9
|
+
*/
|
|
7
10
|
amount: string;
|
|
8
11
|
/** Locked until timestamp (in ms since epoch). */
|
|
9
12
|
lockedUntilTimestamp: number;
|
|
@@ -14,16 +17,28 @@ export interface DelegatorReward {
|
|
|
14
17
|
time: number;
|
|
15
18
|
/** Source of the reward. */
|
|
16
19
|
source: "delegation" | "commission";
|
|
17
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Total reward amount.
|
|
22
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
23
|
+
*/
|
|
18
24
|
totalAmount: string;
|
|
19
25
|
}
|
|
20
|
-
/** Summary of a user
|
|
26
|
+
/** Summary of a user staking delegations. */
|
|
21
27
|
export interface DelegatorSummary {
|
|
22
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Total amount of delegated tokens.
|
|
30
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
31
|
+
*/
|
|
23
32
|
delegated: string;
|
|
24
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Total amount of undelegated tokens.
|
|
35
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
36
|
+
*/
|
|
25
37
|
undelegated: string;
|
|
26
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Total amount of tokens pending withdrawal.
|
|
40
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
41
|
+
*/
|
|
27
42
|
totalPendingWithdrawal: string;
|
|
28
43
|
/** Number of pending withdrawals. */
|
|
29
44
|
nPendingWithdrawals: number;
|
|
@@ -43,7 +58,10 @@ export interface DelegatorUpdateDelegate {
|
|
|
43
58
|
delegate: {
|
|
44
59
|
/** Address of the validator receiving or losing delegation. */
|
|
45
60
|
validator: Hex;
|
|
46
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Amount of tokens being delegated or undelegated.
|
|
63
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
64
|
+
*/
|
|
47
65
|
amount: string;
|
|
48
66
|
/** Whether this is an undelegation operation. */
|
|
49
67
|
isUndelegate: boolean;
|
|
@@ -53,7 +71,10 @@ export interface DelegatorUpdateDelegate {
|
|
|
53
71
|
export interface DelegatorUpdateDeposit {
|
|
54
72
|
/** Deposit details. */
|
|
55
73
|
cDeposit: {
|
|
56
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Amount of tokens being deposited.
|
|
76
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
77
|
+
*/
|
|
57
78
|
amount: string;
|
|
58
79
|
};
|
|
59
80
|
}
|
|
@@ -61,7 +82,10 @@ export interface DelegatorUpdateDeposit {
|
|
|
61
82
|
export interface DelegatorUpdateWithdrawal {
|
|
62
83
|
/** Withdrawal details. */
|
|
63
84
|
withdrawal: {
|
|
64
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Amount of tokens being withdrawn.
|
|
87
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
88
|
+
*/
|
|
65
89
|
amount: string;
|
|
66
90
|
/** Phase of the withdrawal process. */
|
|
67
91
|
phase: "initiated" | "finalized";
|
|
@@ -71,16 +95,19 @@ export interface DelegatorUpdateWithdrawal {
|
|
|
71
95
|
export interface ValidatorStats {
|
|
72
96
|
/** Fraction of time the validator was online. */
|
|
73
97
|
uptimeFraction: string;
|
|
74
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* Predicted annual percentage rate of returns.
|
|
100
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
101
|
+
*/
|
|
75
102
|
predictedApr: string;
|
|
76
103
|
/** Number of samples used for statistics calculation. */
|
|
77
104
|
nSamples: number;
|
|
78
105
|
}
|
|
79
|
-
/** Summary of a validator
|
|
106
|
+
/** Summary of a validator status and performance. */
|
|
80
107
|
export interface ValidatorSummary {
|
|
81
108
|
/** Address of the validator. */
|
|
82
109
|
validator: Hex;
|
|
83
|
-
/** Address of the validator
|
|
110
|
+
/** Address of the validator signer. */
|
|
84
111
|
signer: Hex;
|
|
85
112
|
/** Name of the validator. */
|
|
86
113
|
name: string;
|
|
@@ -96,7 +123,10 @@ export interface ValidatorSummary {
|
|
|
96
123
|
unjailableAfter: number | null;
|
|
97
124
|
/** Whether the validator is currently active. */
|
|
98
125
|
isActive: boolean;
|
|
99
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Commission rate charged by the validator.
|
|
128
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
129
|
+
*/
|
|
100
130
|
commission: string;
|
|
101
131
|
/** Performance statistics over different time periods. */
|
|
102
132
|
stats: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/validators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/validators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC,sCAAsC;AACtC,MAAM,WAAW,UAAU;IACvB,yBAAyB;IACzB,SAAS,EAAE,GAAG,CAAC;IACf;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,oBAAoB,EAAE,MAAM,CAAC;CAChC;AAED,+CAA+C;AAC/C,MAAM,WAAW,eAAe;IAC5B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,MAAM,EAAE,YAAY,GAAG,YAAY,CAAC;IACpC;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,6CAA6C;AAC7C,MAAM,WAAW,gBAAgB;IAC7B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qCAAqC;IACrC,mBAAmB,EAAE,MAAM,CAAC;CAC/B;AAED,gDAAgD;AAChD,MAAM,WAAW,eAAe;IAC5B,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,IAAI,EAAE,GAAG,CAAC;IACV,6BAA6B;IAC7B,KAAK,EAAE,uBAAuB,GAAG,sBAAsB,GAAG,yBAAyB,CAAC;CACvF;AAED,kDAAkD;AAClD,MAAM,WAAW,uBAAuB;IACpC,oCAAoC;IACpC,QAAQ,EAAE;QACN,+DAA+D;QAC/D,SAAS,EAAE,GAAG,CAAC;QACf;;;WAGG;QACH,MAAM,EAAE,MAAM,CAAC;QACf,iDAAi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@
|
|
|
1
|
-
import type { Hex } from "
|
|
1
|
+
import type { Hex } from "../mod.js";
|
|
2
2
|
import type { PortfolioPeriods } from "./accounts.js";
|
|
3
3
|
/** Details about a vault. */
|
|
4
4
|
export interface VaultDetails {
|
|
@@ -14,15 +14,15 @@ export interface VaultDetails {
|
|
|
14
14
|
portfolio: PortfolioPeriods;
|
|
15
15
|
/** Annual percentage rate. */
|
|
16
16
|
apr: number;
|
|
17
|
-
/** Current user
|
|
17
|
+
/** Current user follower state */
|
|
18
18
|
followerState: VaultFollowerState | null;
|
|
19
19
|
/** Ownership percentage held by leader. */
|
|
20
20
|
leaderFraction: number;
|
|
21
|
-
/** Leader
|
|
21
|
+
/** Leader commission percentage. */
|
|
22
22
|
leaderCommission: number;
|
|
23
23
|
/** Vault followers list. */
|
|
24
24
|
followers: (Omit<VaultFollowerState, "user"> & {
|
|
25
|
-
/** Follower
|
|
25
|
+
/** Follower address or Leader. */
|
|
26
26
|
user: Hex | "Leader";
|
|
27
27
|
})[];
|
|
28
28
|
/** Maximum distributable amount. */
|
|
@@ -38,11 +38,14 @@ export interface VaultDetails {
|
|
|
38
38
|
/** Position closure policy on withdrawal. */
|
|
39
39
|
alwaysCloseOnWithdraw: boolean;
|
|
40
40
|
}
|
|
41
|
-
/** User
|
|
41
|
+
/** User vault equity details. */
|
|
42
42
|
export interface VaultEquity {
|
|
43
43
|
/** Vault address. */
|
|
44
44
|
vaultAddress: Hex;
|
|
45
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* User deposited equity.
|
|
47
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
48
|
+
*/
|
|
46
49
|
equity: string;
|
|
47
50
|
/** Timestamp when the user can withdraw their equity. */
|
|
48
51
|
lockedUntilTimestamp: number;
|
|
@@ -51,11 +54,20 @@ export interface VaultEquity {
|
|
|
51
54
|
export interface VaultFollowerState {
|
|
52
55
|
/** Follower address. */
|
|
53
56
|
user: Hex;
|
|
54
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Follower vault equity.
|
|
59
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
60
|
+
*/
|
|
55
61
|
vaultEquity: string;
|
|
56
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Current profit and loss.
|
|
64
|
+
* @pattern ^-?[0-9]+(\.[0-9]+)?$
|
|
65
|
+
*/
|
|
57
66
|
pnl: string;
|
|
58
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* All-time profit and loss.
|
|
69
|
+
* @pattern ^-?[0-9]+(\.[0-9]+)?$
|
|
70
|
+
*/
|
|
59
71
|
allTimePnl: string;
|
|
60
72
|
/** Subscription duration in days. */
|
|
61
73
|
daysFollowing: number;
|
|
@@ -85,7 +97,10 @@ export interface VaultSummary {
|
|
|
85
97
|
vaultAddress: Hex;
|
|
86
98
|
/** Leader address. */
|
|
87
99
|
leader: Hex;
|
|
88
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Total value locked.
|
|
102
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
103
|
+
*/
|
|
89
104
|
tvl: string;
|
|
90
105
|
/** Vault closure status. */
|
|
91
106
|
isClosed: boolean;
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"vaults.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/vaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC,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;IACt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AE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,wCAAwC;AACxC,MAAM,MAAM,iBAAiB,GACvB;IACE,yBAAyB;IACzB,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC5B,GACC;IACE,yBAAyB;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,+BAA+B;IAC/B,IAAI,EAAE;QACF,6BAA6B;QAC7B,cAAc,EAAE,GAAG,EAAE,CAAC;KACzB,CAAC;CACL,CAAC;AAEN,0BAA0B;AAC1B,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;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,+BAA+B;IAC/B,YAAY,EAAE,iBAAiB,CAAC;IAChC,0BAA0B;IAC1B,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED,oCAAoC;AACpC,MAAM,WAAW,YAAY;IACzB,qBAAqB;IACrB,OAAO,EAAE,GAAG,CAAC;IACb,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB"}
|
package/esm/src/types/mod.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/types/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/types/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAEhC,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,yBAAyB,CAAC;AAE7C,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,yBAAyB,CAAC;AAE7C,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,kBAAkB,CAAC;AAEtC,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,6BAA6B,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { Hex } from "
|
|
1
|
+
import type { Hex } from "../mod.js";
|
|
2
2
|
/**
|
|
3
3
|
* Context events for a specific perpetual asset.
|
|
4
4
|
* @returns {WsActiveAssetCtx | WsActiveSpotAssetCtx}
|
|
5
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
5
6
|
*/
|
|
6
7
|
export interface WsActiveAssetCtxRequest {
|
|
7
8
|
/** Type of subscription. */
|
|
@@ -9,31 +10,10 @@ export interface WsActiveAssetCtxRequest {
|
|
|
9
10
|
/** Asset symbol (e.g., BTC). */
|
|
10
11
|
coin: string;
|
|
11
12
|
}
|
|
12
|
-
/**
|
|
13
|
-
* Trading data events for a specific asset and user.
|
|
14
|
-
* @returns {WsActiveAssetData}
|
|
15
|
-
*/
|
|
16
|
-
export interface WsActiveAssetDataRequest {
|
|
17
|
-
/** Type of subscription. */
|
|
18
|
-
type: "activeAssetData";
|
|
19
|
-
/** Asset symbol (e.g., BTC). */
|
|
20
|
-
coin: string;
|
|
21
|
-
/** User's address. */
|
|
22
|
-
user: Hex;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Mid prices for all actively traded assets.
|
|
26
|
-
* @returns {WsAllMids}
|
|
27
|
-
*/
|
|
28
|
-
export interface WsAllMidsRequest {
|
|
29
|
-
/** Type of subscription. */
|
|
30
|
-
type: "allMids";
|
|
31
|
-
/** Name of perp dex. */
|
|
32
|
-
dex?: string;
|
|
33
|
-
}
|
|
34
13
|
/**
|
|
35
14
|
* Best bid and offer events for a specific asset.
|
|
36
15
|
* @returns {WsBbo}
|
|
16
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
37
17
|
*/
|
|
38
18
|
export interface WsBboRequest {
|
|
39
19
|
/** Type of subscription. */
|
|
@@ -44,6 +24,7 @@ export interface WsBboRequest {
|
|
|
44
24
|
/**
|
|
45
25
|
* Candlestick data events for a specific asset.
|
|
46
26
|
* @returns {Candle}
|
|
27
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
47
28
|
*/
|
|
48
29
|
export interface WsCandleRequest {
|
|
49
30
|
/** Type of subscription. */
|
|
@@ -56,6 +37,7 @@ export interface WsCandleRequest {
|
|
|
56
37
|
/**
|
|
57
38
|
* Explorer block events.
|
|
58
39
|
* @returns {WsBlockDetails[]}
|
|
40
|
+
* @see null
|
|
59
41
|
*/
|
|
60
42
|
export interface WsExplorerBlockRequest {
|
|
61
43
|
/** Type of subscription. */
|
|
@@ -64,48 +46,38 @@ export interface WsExplorerBlockRequest {
|
|
|
64
46
|
/**
|
|
65
47
|
* Explorer transaction events.
|
|
66
48
|
* @returns {TxDetails[]}
|
|
49
|
+
* @see null
|
|
67
50
|
*/
|
|
68
51
|
export interface WsExplorerTxsRequest {
|
|
69
52
|
/** Type of subscription. */
|
|
70
53
|
type: "explorerTxs";
|
|
71
54
|
}
|
|
72
|
-
/**
|
|
73
|
-
* L2 order book events for a specific asset.
|
|
74
|
-
* @returns {Book}
|
|
75
|
-
*/
|
|
76
|
-
export interface WsL2BookRequest {
|
|
77
|
-
/** Type of subscription. */
|
|
78
|
-
type: "l2Book";
|
|
79
|
-
/** Asset symbol (e.g., BTC). */
|
|
80
|
-
coin: string;
|
|
81
|
-
/** Number of significant figures. */
|
|
82
|
-
nSigFigs?: 2 | 3 | 4 | 5 | null;
|
|
83
|
-
/** Mantissa for aggregation. */
|
|
84
|
-
mantissa?: 2 | 5 | null;
|
|
85
|
-
}
|
|
86
55
|
/**
|
|
87
56
|
* Notification events for a specific user.
|
|
88
57
|
* @returns {WsNotification}
|
|
58
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
89
59
|
*/
|
|
90
60
|
export interface WsNotificationRequest {
|
|
91
61
|
/** Type of subscription. */
|
|
92
62
|
type: "notification";
|
|
93
|
-
/** User
|
|
63
|
+
/** User address. */
|
|
94
64
|
user: Hex;
|
|
95
65
|
}
|
|
96
66
|
/**
|
|
97
67
|
* Order status events for a specific user.
|
|
98
68
|
* @returns {OrderStatus<Order>[]}
|
|
69
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
99
70
|
*/
|
|
100
71
|
export interface WsOrderUpdatesRequest {
|
|
101
72
|
/** Type of subscription. */
|
|
102
73
|
type: "orderUpdates";
|
|
103
|
-
/** User
|
|
74
|
+
/** User address. */
|
|
104
75
|
user: Hex;
|
|
105
76
|
}
|
|
106
77
|
/**
|
|
107
78
|
* Real-time trade updates for a specific asset.
|
|
108
79
|
* @returns {WsTrade[]}
|
|
80
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
109
81
|
*/
|
|
110
82
|
export interface WsTradesRequest {
|
|
111
83
|
/** Type of subscription. */
|
|
@@ -116,73 +88,56 @@ export interface WsTradesRequest {
|
|
|
116
88
|
/**
|
|
117
89
|
* Non-order events for a specific user.
|
|
118
90
|
* @returns {WsUserEvent}
|
|
91
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
119
92
|
*/
|
|
120
93
|
export interface WsUserEventsRequest {
|
|
121
94
|
/** Type of subscription. */
|
|
122
95
|
type: "userEvents";
|
|
123
|
-
/** User
|
|
96
|
+
/** User address. */
|
|
124
97
|
user: Hex;
|
|
125
98
|
}
|
|
126
|
-
/**
|
|
127
|
-
* Trade fill events for a specific user.
|
|
128
|
-
* @returns {WsUserFills}
|
|
129
|
-
*/
|
|
130
|
-
export interface WsUserFillsRequest {
|
|
131
|
-
/** Type of subscription. */
|
|
132
|
-
type: "userFills";
|
|
133
|
-
/** User's address. */
|
|
134
|
-
user: Hex;
|
|
135
|
-
/** Whether to aggregate fills by time. */
|
|
136
|
-
aggregateByTime?: boolean;
|
|
137
|
-
}
|
|
138
99
|
/**
|
|
139
100
|
* Funding payment events for a specific user.
|
|
140
101
|
* @returns {WsUserFundings}
|
|
102
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
141
103
|
*/
|
|
142
104
|
export interface WsUserFundingsRequest {
|
|
143
105
|
/** Type of subscription. */
|
|
144
106
|
type: "userFundings";
|
|
145
|
-
/** User
|
|
107
|
+
/** User address. */
|
|
146
108
|
user: Hex;
|
|
147
109
|
}
|
|
148
110
|
/**
|
|
149
111
|
* Non-funding ledger events for a specific user.
|
|
150
112
|
* @returns {WsUserNonFundingLedgerUpdates}
|
|
113
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
151
114
|
*/
|
|
152
115
|
export interface WsUserNonFundingLedgerUpdatesRequest {
|
|
153
116
|
/** Type of subscription. */
|
|
154
117
|
type: "userNonFundingLedgerUpdates";
|
|
155
|
-
/** User
|
|
118
|
+
/** User address. */
|
|
156
119
|
user: Hex;
|
|
157
120
|
}
|
|
158
121
|
/**
|
|
159
122
|
* TWAP order history events for a specific user.
|
|
160
123
|
* @returns {WsUserTwapHistory}
|
|
124
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
161
125
|
*/
|
|
162
126
|
export interface WsUserTwapHistoryRequest {
|
|
163
127
|
/** Type of subscription. */
|
|
164
128
|
type: "userTwapHistory";
|
|
165
|
-
/** User
|
|
166
|
-
user: Hex;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* TWAP execution events for a specific user.
|
|
170
|
-
* @returns {WsUserTwapSliceFills}
|
|
171
|
-
*/
|
|
172
|
-
export interface WsUserTwapSliceFillsRequest {
|
|
173
|
-
/** Type of subscription. */
|
|
174
|
-
type: "userTwapSliceFills";
|
|
175
|
-
/** User's address. */
|
|
129
|
+
/** User address. */
|
|
176
130
|
user: Hex;
|
|
177
131
|
}
|
|
178
132
|
/**
|
|
179
133
|
* Comprehensive user and market data events.
|
|
180
134
|
* @returns {WsWebData2}
|
|
135
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
181
136
|
*/
|
|
182
137
|
export interface WsWebData2Request {
|
|
183
138
|
/** Type of subscription. */
|
|
184
139
|
type: "webData2";
|
|
185
|
-
/** User
|
|
140
|
+
/** User address. */
|
|
186
141
|
user: Hex;
|
|
187
142
|
}
|
|
188
143
|
//# sourceMappingURL=requests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/src/types/subscriptions/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/src/types/subscriptions/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC,4BAA4B;IAC5B,IAAI,EAAE,gBAAgB,CAAC;IACvB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IACzB,4BAA4B;IAC5B,IAAI,EAAE,KAAK,CAAC;IACZ,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CAChB;A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ACjD,4BAA4B;IAC5B,IAAI,EAAE,6BAA6B,CAAC;IACpC,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACrC,4BAA4B;IAC5B,IAAI,EAAE,iBAAiB,CAAC;IACxB,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAC9B,4BAA4B;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,oBAAoB;IACpB,IAAI,EAAE,GAAG,CAAC;CACb"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Hex } from "
|
|
1
|
+
import type { Hex } from "../mod.js";
|
|
2
2
|
import type { BlockDetails } from "../explorer/responses.js";
|
|
3
3
|
import type { FundingUpdate, PerpsClearinghouseState, SpotClearinghouseState, UserFundingUpdate, UserNonFundingLedgerUpdate } from "../info/accounts.js";
|
|
4
4
|
import type { AllMids, PerpsAssetCtx, PerpsMeta, SpotAssetCtx } from "../info/assets.js";
|
|
@@ -10,33 +10,6 @@ export interface WsActiveAssetCtx {
|
|
|
10
10
|
/** Context information for the perpetual asset. */
|
|
11
11
|
ctx: PerpsAssetCtx;
|
|
12
12
|
}
|
|
13
|
-
/** Active asset trading data. */
|
|
14
|
-
export interface WsActiveAssetData {
|
|
15
|
-
/** User's address. */
|
|
16
|
-
user: Hex;
|
|
17
|
-
/** Asset symbol (e.g., BTC). */
|
|
18
|
-
coin: string;
|
|
19
|
-
/** Leverage configuration. */
|
|
20
|
-
leverage: {
|
|
21
|
-
/** Leverage type. */
|
|
22
|
-
type: "isolated";
|
|
23
|
-
/** Leverage value used. */
|
|
24
|
-
value: number;
|
|
25
|
-
/** Amount of USD used (1 = 1$). */
|
|
26
|
-
rawUsd: string;
|
|
27
|
-
} | {
|
|
28
|
-
/** Leverage type. */
|
|
29
|
-
type: "cross";
|
|
30
|
-
/** Leverage value used. */
|
|
31
|
-
value: number;
|
|
32
|
-
};
|
|
33
|
-
/** Maximum trade size range [min, max]. */
|
|
34
|
-
maxTradeSzs: [string, string];
|
|
35
|
-
/** Available to trade range [min, max]. */
|
|
36
|
-
availableToTrade: [string, string];
|
|
37
|
-
/** Mark price. */
|
|
38
|
-
markPx: string;
|
|
39
|
-
}
|
|
40
13
|
/** Active spot asset context. */
|
|
41
14
|
export interface WsActiveSpotAssetCtx {
|
|
42
15
|
/** Asset symbol (e.g., BTC). */
|
|
@@ -60,7 +33,7 @@ export interface WsBbo {
|
|
|
60
33
|
}
|
|
61
34
|
/** Block details. */
|
|
62
35
|
export type WsBlockDetails = Omit<BlockDetails, "txs">;
|
|
63
|
-
/** User
|
|
36
|
+
/** User notifications. */
|
|
64
37
|
export interface WsNotification {
|
|
65
38
|
/** Notification content. */
|
|
66
39
|
notification: string;
|
|
@@ -71,9 +44,15 @@ export interface WsTrade {
|
|
|
71
44
|
coin: string;
|
|
72
45
|
/** Trade side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
73
46
|
side: "B" | "A";
|
|
74
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Trade price.
|
|
49
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
50
|
+
*/
|
|
75
51
|
px: string;
|
|
76
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Trade size.
|
|
54
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
55
|
+
*/
|
|
77
56
|
sz: string;
|
|
78
57
|
/** Trade timestamp (in ms since epoch). */
|
|
79
58
|
time: number;
|
|
@@ -84,19 +63,19 @@ export interface WsTrade {
|
|
|
84
63
|
/** Addresses of users involved in the trade [Maker, Taker]. */
|
|
85
64
|
users: [Hex, Hex];
|
|
86
65
|
}
|
|
87
|
-
/** User
|
|
66
|
+
/** User event. */
|
|
88
67
|
export type WsUserEvent = WsUserEventFill | WsUserEventFunding | WsUserEventLiquidation | WsUserEventNonUserCancel | WsUserEventTwapHistory | WsUserEventTwapSliceFills;
|
|
89
|
-
/** User
|
|
68
|
+
/** User fill event. */
|
|
90
69
|
export interface WsUserEventFill {
|
|
91
70
|
/** Array of trade fills. */
|
|
92
71
|
fills: Fill[];
|
|
93
72
|
}
|
|
94
|
-
/** User
|
|
73
|
+
/** User funding event. */
|
|
95
74
|
export interface WsUserEventFunding {
|
|
96
75
|
/** Funding update details. */
|
|
97
76
|
funding: Omit<FundingUpdate, "type">;
|
|
98
77
|
}
|
|
99
|
-
/** User
|
|
78
|
+
/** User liquidation event. */
|
|
100
79
|
export interface WsUserEventLiquidation {
|
|
101
80
|
/** Liquidation event details. */
|
|
102
81
|
liquidation: {
|
|
@@ -106,9 +85,15 @@ export interface WsUserEventLiquidation {
|
|
|
106
85
|
liquidator: Hex;
|
|
107
86
|
/** Address of the liquidated user. */
|
|
108
87
|
liquidated_user: Hex;
|
|
109
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* Notional position size that was liquidated.
|
|
90
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
91
|
+
*/
|
|
110
92
|
liquidated_ntl_pos: string;
|
|
111
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* Account value at time of liquidation.
|
|
95
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
96
|
+
*/
|
|
112
97
|
liquidated_account_value: string;
|
|
113
98
|
};
|
|
114
99
|
}
|
|
@@ -122,55 +107,55 @@ export interface WsUserEventNonUserCancel {
|
|
|
122
107
|
oid: number;
|
|
123
108
|
}[];
|
|
124
109
|
}
|
|
125
|
-
/** User
|
|
110
|
+
/** User TWAP history event. */
|
|
126
111
|
export interface WsUserEventTwapHistory {
|
|
127
112
|
/** Array of historical TWAP fills. */
|
|
128
113
|
twapHistory: TwapHistory[];
|
|
129
114
|
}
|
|
130
|
-
/** User
|
|
115
|
+
/** User TWAP slice fills event. */
|
|
131
116
|
export interface WsUserEventTwapSliceFills {
|
|
132
117
|
/** Array of TWAP slice fills. */
|
|
133
118
|
twapSliceFills: TwapSliceFill[];
|
|
134
119
|
}
|
|
135
|
-
/** User
|
|
120
|
+
/** User fills. */
|
|
136
121
|
export interface WsUserFills {
|
|
137
|
-
/** User
|
|
122
|
+
/** User address. */
|
|
138
123
|
user: Hex;
|
|
139
124
|
/** Array of fill events. */
|
|
140
125
|
fills: Fill[];
|
|
141
126
|
/** Whether this is an initial snapshot. */
|
|
142
127
|
isSnapshot?: true;
|
|
143
128
|
}
|
|
144
|
-
/** User
|
|
129
|
+
/** User fundings. */
|
|
145
130
|
export interface WsUserFundings {
|
|
146
|
-
/** User
|
|
131
|
+
/** User address. */
|
|
147
132
|
user: Hex;
|
|
148
133
|
/** Array of funding events. */
|
|
149
134
|
fundings: (Omit<FundingUpdate, "type"> & Pick<UserFundingUpdate, "time">)[];
|
|
150
135
|
/** Whether this is an initial snapshot. */
|
|
151
136
|
isSnapshot?: true;
|
|
152
137
|
}
|
|
153
|
-
/** User
|
|
138
|
+
/** User non-funding ledger updates. */
|
|
154
139
|
export interface WsUserNonFundingLedgerUpdates {
|
|
155
|
-
/** User
|
|
140
|
+
/** User address. */
|
|
156
141
|
user: Hex;
|
|
157
142
|
/** Array of non-funding ledger updates. */
|
|
158
143
|
nonFundingLedgerUpdates: UserNonFundingLedgerUpdate[];
|
|
159
144
|
/** Whether this is an initial snapshot. */
|
|
160
145
|
isSnapshot?: true;
|
|
161
146
|
}
|
|
162
|
-
/** User
|
|
147
|
+
/** User TWAP history. */
|
|
163
148
|
export interface WsUserTwapHistory {
|
|
164
|
-
/** User
|
|
149
|
+
/** User address. */
|
|
165
150
|
user: Hex;
|
|
166
151
|
/** Array of historical TWAP fills. */
|
|
167
152
|
history: TwapHistory[];
|
|
168
153
|
/** Whether this is an initial snapshot. */
|
|
169
154
|
isSnapshot?: true;
|
|
170
155
|
}
|
|
171
|
-
/** User
|
|
156
|
+
/** User TWAP slice fills. */
|
|
172
157
|
export interface WsUserTwapSliceFills {
|
|
173
|
-
/** User
|
|
158
|
+
/** User address. */
|
|
174
159
|
user: Hex;
|
|
175
160
|
/** Array of TWAP slice fills. */
|
|
176
161
|
twapSliceFills: TwapSliceFill[];
|
|
@@ -188,15 +173,21 @@ export interface WsWebData2 {
|
|
|
188
173
|
/** Name of the vault. */
|
|
189
174
|
name: string;
|
|
190
175
|
}[];
|
|
191
|
-
/**
|
|
176
|
+
/**
|
|
177
|
+
* Total equity in vaults.
|
|
178
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
179
|
+
*/
|
|
192
180
|
totalVaultEquity: string;
|
|
193
|
-
/** User
|
|
181
|
+
/** User open orders with frontend information. */
|
|
194
182
|
openOrders: FrontendOrder[];
|
|
195
|
-
/** Agent
|
|
183
|
+
/** Agent address if one exists. */
|
|
196
184
|
agentAddress: Hex | null;
|
|
197
185
|
/** Timestamp until which the agent is valid. */
|
|
198
186
|
agentValidUntil: number | null;
|
|
199
|
-
/**
|
|
187
|
+
/**
|
|
188
|
+
* Cumulative ledger value.
|
|
189
|
+
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
190
|
+
*/
|
|
200
191
|
cumLedger: string;
|
|
201
192
|
/** Metadata for perpetual assets. */
|
|
202
193
|
meta: PerpsMeta;
|
|
@@ -206,12 +197,12 @@ export interface WsWebData2 {
|
|
|
206
197
|
serverTime: number;
|
|
207
198
|
/** Whether this account is a vault. */
|
|
208
199
|
isVault: boolean;
|
|
209
|
-
/** User
|
|
200
|
+
/** User address. */
|
|
210
201
|
user: Hex;
|
|
211
202
|
/** TWAP states. */
|
|
212
203
|
twapStates: [number, TwapState][];
|
|
213
204
|
/** Account summary for spot trading. */
|
|
214
|
-
spotState
|
|
205
|
+
spotState?: SpotClearinghouseState;
|
|
215
206
|
/** Context information for spot assets. */
|
|
216
207
|
spotAssetCtxs: SpotAssetCtx[];
|
|
217
208
|
/** Whether the user has opted out of spot dusting. */
|