@nktkas/hyperliquid 0.24.2 → 0.25.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +197 -117
- package/esm/mod.d.ts +11 -11
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- package/esm/src/clients/exchange.d.ts +29 -18
- package/esm/src/clients/exchange.d.ts.map +1 -1
- package/esm/src/clients/exchange.js +50 -48
- package/esm/src/clients/info.d.ts +79 -75
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +294 -163
- package/esm/src/clients/multiSign.d.ts +11 -7
- package/esm/src/clients/multiSign.d.ts.map +1 -1
- package/esm/src/clients/subscription.d.ts +105 -32
- package/esm/src/clients/subscription.d.ts.map +1 -1
- package/esm/src/clients/subscription.js +114 -33
- package/esm/src/{base.d.ts → errors.d.ts} +1 -1
- package/esm/src/errors.d.ts.map +1 -0
- package/esm/src/schemas/_base.d.ts +10 -0
- package/esm/src/schemas/_base.d.ts.map +1 -0
- package/esm/src/schemas/_base.js +12 -0
- package/esm/src/schemas/exchange/requests.d.ts +8953 -0
- package/esm/src/schemas/exchange/requests.d.ts.map +1 -0
- package/esm/src/schemas/exchange/requests.js +1413 -0
- package/esm/src/schemas/exchange/responses.d.ts +567 -0
- package/esm/src/schemas/exchange/responses.d.ts.map +1 -0
- package/esm/src/schemas/exchange/responses.js +243 -0
- package/esm/src/schemas/explorer/requests.d.ts +44 -0
- package/esm/src/schemas/explorer/requests.d.ts.map +1 -0
- package/esm/src/schemas/explorer/requests.js +32 -0
- package/esm/src/schemas/explorer/responses.d.ts +360 -0
- package/esm/src/schemas/explorer/responses.d.ts.map +1 -0
- package/esm/src/schemas/explorer/responses.js +56 -0
- package/esm/src/schemas/info/accounts.d.ts +2159 -0
- package/esm/src/schemas/info/accounts.d.ts.map +1 -0
- package/esm/src/schemas/info/accounts.js +622 -0
- package/esm/src/schemas/info/assets.d.ts +945 -0
- package/esm/src/schemas/info/assets.d.ts.map +1 -0
- package/esm/src/schemas/info/assets.js +265 -0
- package/esm/src/schemas/info/markets.d.ts +138 -0
- package/esm/src/schemas/info/markets.d.ts.map +1 -0
- package/esm/src/schemas/info/markets.js +58 -0
- package/esm/src/schemas/info/orders.d.ts +957 -0
- package/esm/src/schemas/info/orders.d.ts.map +1 -0
- package/esm/src/schemas/info/orders.js +297 -0
- package/esm/src/schemas/info/requests.d.ts +882 -0
- package/esm/src/schemas/info/requests.d.ts.map +1 -0
- package/esm/src/schemas/info/requests.js +655 -0
- package/esm/src/schemas/info/validators.d.ts +305 -0
- package/esm/src/schemas/info/validators.d.ts.map +1 -0
- package/esm/src/schemas/info/validators.js +112 -0
- package/esm/src/schemas/info/vaults.d.ts +447 -0
- package/esm/src/schemas/info/vaults.d.ts.map +1 -0
- package/esm/src/schemas/info/vaults.js +110 -0
- package/esm/src/schemas/mod.d.ts +100 -0
- package/esm/src/schemas/mod.d.ts.map +1 -0
- package/esm/src/schemas/mod.js +113 -0
- package/esm/src/schemas/subscriptions/requests.d.ts +332 -0
- package/esm/src/schemas/subscriptions/requests.d.ts.map +1 -0
- package/esm/src/schemas/subscriptions/requests.js +258 -0
- package/esm/src/schemas/subscriptions/responses.d.ts +3643 -0
- package/esm/src/schemas/subscriptions/responses.d.ts.map +1 -0
- package/esm/src/schemas/subscriptions/responses.js +233 -0
- package/esm/src/signing/mod.d.ts +109 -29
- package/esm/src/signing/mod.d.ts.map +1 -1
- package/esm/src/signing/mod.js +135 -29
- package/esm/src/transports/base.d.ts +2 -2
- package/esm/src/transports/base.d.ts.map +1 -1
- package/esm/src/transports/base.js +2 -2
- package/esm/src/transports/http/http_transport.d.ts +2 -1
- package/esm/src/transports/http/http_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.d.ts +2 -1
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/package.json +6 -5
- package/script/mod.d.ts +11 -11
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +1 -1
- package/script/src/clients/exchange.d.ts +29 -18
- package/script/src/clients/exchange.d.ts.map +1 -1
- package/script/src/clients/exchange.js +56 -54
- package/script/src/clients/info.d.ts +79 -75
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +294 -163
- package/script/src/clients/multiSign.d.ts +11 -7
- package/script/src/clients/multiSign.d.ts.map +1 -1
- package/script/src/clients/subscription.d.ts +105 -32
- package/script/src/clients/subscription.d.ts.map +1 -1
- package/script/src/clients/subscription.js +114 -33
- package/script/src/{base.d.ts → errors.d.ts} +1 -1
- package/script/src/errors.d.ts.map +1 -0
- package/script/src/schemas/_base.d.ts +10 -0
- package/script/src/schemas/_base.d.ts.map +1 -0
- package/script/src/schemas/_base.js +48 -0
- package/script/src/schemas/exchange/requests.d.ts +8953 -0
- package/script/src/schemas/exchange/requests.d.ts.map +1 -0
- package/script/src/schemas/exchange/requests.js +1449 -0
- package/script/src/schemas/exchange/responses.d.ts +567 -0
- package/script/src/schemas/exchange/responses.d.ts.map +1 -0
- package/script/src/schemas/exchange/responses.js +279 -0
- package/script/src/schemas/explorer/requests.d.ts +44 -0
- package/script/src/schemas/explorer/requests.d.ts.map +1 -0
- package/script/src/schemas/explorer/requests.js +68 -0
- package/script/src/schemas/explorer/responses.d.ts +360 -0
- package/script/src/schemas/explorer/responses.d.ts.map +1 -0
- package/script/src/schemas/explorer/responses.js +92 -0
- package/script/src/schemas/info/accounts.d.ts +2159 -0
- package/script/src/schemas/info/accounts.d.ts.map +1 -0
- package/script/src/schemas/info/accounts.js +658 -0
- package/script/src/schemas/info/assets.d.ts +945 -0
- package/script/src/schemas/info/assets.d.ts.map +1 -0
- package/script/src/schemas/info/assets.js +301 -0
- package/script/src/schemas/info/markets.d.ts +138 -0
- package/script/src/schemas/info/markets.d.ts.map +1 -0
- package/script/src/schemas/info/markets.js +94 -0
- package/script/src/schemas/info/orders.d.ts +957 -0
- package/script/src/schemas/info/orders.d.ts.map +1 -0
- package/script/src/schemas/info/orders.js +333 -0
- package/script/src/schemas/info/requests.d.ts +882 -0
- package/script/src/schemas/info/requests.d.ts.map +1 -0
- package/script/src/schemas/info/requests.js +692 -0
- package/script/src/schemas/info/validators.d.ts +305 -0
- package/script/src/schemas/info/validators.d.ts.map +1 -0
- package/script/src/schemas/info/validators.js +148 -0
- package/script/src/schemas/info/vaults.d.ts +447 -0
- package/script/src/schemas/info/vaults.d.ts.map +1 -0
- package/script/src/schemas/info/vaults.js +146 -0
- package/script/src/schemas/mod.d.ts +100 -0
- package/script/src/schemas/mod.d.ts.map +1 -0
- package/script/src/schemas/mod.js +154 -0
- package/script/src/schemas/subscriptions/requests.d.ts +332 -0
- package/script/src/schemas/subscriptions/requests.d.ts.map +1 -0
- package/script/src/schemas/subscriptions/requests.js +294 -0
- package/script/src/schemas/subscriptions/responses.d.ts +3643 -0
- package/script/src/schemas/subscriptions/responses.d.ts.map +1 -0
- package/script/src/schemas/subscriptions/responses.js +269 -0
- package/script/src/signing/mod.d.ts +109 -29
- package/script/src/signing/mod.d.ts.map +1 -1
- package/script/src/signing/mod.js +137 -33
- package/script/src/transports/base.d.ts +2 -2
- package/script/src/transports/base.d.ts.map +1 -1
- package/script/src/transports/base.js +3 -3
- package/script/src/transports/http/http_transport.d.ts +2 -1
- package/script/src/transports/http/http_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.d.ts +2 -1
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/base.d.ts.map +0 -1
- package/esm/src/signing/_sorter.d.ts +0 -127
- package/esm/src/signing/_sorter.d.ts.map +0 -1
- package/esm/src/signing/_sorter.js +0 -693
- package/esm/src/types/exchange/requests.d.ts +0 -1345
- package/esm/src/types/exchange/requests.d.ts.map +0 -1
- package/esm/src/types/exchange/requests.js +0 -1
- package/esm/src/types/exchange/responses.d.ts +0 -233
- package/esm/src/types/exchange/responses.d.ts.map +0 -1
- package/esm/src/types/exchange/responses.js +0 -1
- package/esm/src/types/explorer/requests.d.ts +0 -32
- package/esm/src/types/explorer/requests.d.ts.map +0 -1
- package/esm/src/types/explorer/requests.js +0 -1
- package/esm/src/types/explorer/responses.d.ts +0 -58
- package/esm/src/types/explorer/responses.d.ts.map +0 -1
- package/esm/src/types/explorer/responses.js +0 -1
- package/esm/src/types/info/accounts.d.ts +0 -864
- package/esm/src/types/info/accounts.d.ts.map +0 -1
- package/esm/src/types/info/accounts.js +0 -1
- package/esm/src/types/info/assets.d.ts +0 -354
- package/esm/src/types/info/assets.d.ts.map +0 -1
- package/esm/src/types/info/assets.js +0 -1
- package/esm/src/types/info/markets.d.ts +0 -79
- package/esm/src/types/info/markets.d.ts.map +0 -1
- package/esm/src/types/info/markets.js +0 -1
- package/esm/src/types/info/orders.d.ts +0 -266
- package/esm/src/types/info/orders.d.ts.map +0 -1
- package/esm/src/types/info/orders.js +0 -1
- package/esm/src/types/info/requests.d.ts +0 -634
- package/esm/src/types/info/requests.d.ts.map +0 -1
- package/esm/src/types/info/requests.js +0 -1
- package/esm/src/types/info/validators.d.ts +0 -147
- package/esm/src/types/info/validators.d.ts.map +0 -1
- package/esm/src/types/info/validators.js +0 -1
- package/esm/src/types/info/vaults.d.ts +0 -119
- package/esm/src/types/info/vaults.d.ts.map +0 -1
- package/esm/src/types/info/vaults.js +0 -1
- package/esm/src/types/mod.d.ts +0 -38
- package/esm/src/types/mod.d.ts.map +0 -1
- package/esm/src/types/mod.js +0 -24
- package/esm/src/types/subscriptions/requests.d.ts +0 -143
- package/esm/src/types/subscriptions/requests.d.ts.map +0 -1
- package/esm/src/types/subscriptions/requests.js +0 -1
- package/esm/src/types/subscriptions/responses.d.ts +0 -213
- package/esm/src/types/subscriptions/responses.d.ts.map +0 -1
- package/esm/src/types/subscriptions/responses.js +0 -1
- package/script/src/base.d.ts.map +0 -1
- package/script/src/signing/_sorter.d.ts +0 -127
- package/script/src/signing/_sorter.d.ts.map +0 -1
- package/script/src/signing/_sorter.js +0 -696
- package/script/src/types/exchange/requests.d.ts +0 -1345
- package/script/src/types/exchange/requests.d.ts.map +0 -1
- package/script/src/types/exchange/requests.js +0 -2
- package/script/src/types/exchange/responses.d.ts +0 -233
- package/script/src/types/exchange/responses.d.ts.map +0 -1
- package/script/src/types/exchange/responses.js +0 -2
- package/script/src/types/explorer/requests.d.ts +0 -32
- package/script/src/types/explorer/requests.d.ts.map +0 -1
- package/script/src/types/explorer/requests.js +0 -2
- package/script/src/types/explorer/responses.d.ts +0 -58
- package/script/src/types/explorer/responses.d.ts.map +0 -1
- package/script/src/types/explorer/responses.js +0 -2
- package/script/src/types/info/accounts.d.ts +0 -864
- package/script/src/types/info/accounts.d.ts.map +0 -1
- package/script/src/types/info/accounts.js +0 -2
- package/script/src/types/info/assets.d.ts +0 -354
- package/script/src/types/info/assets.d.ts.map +0 -1
- package/script/src/types/info/assets.js +0 -2
- package/script/src/types/info/markets.d.ts +0 -79
- package/script/src/types/info/markets.d.ts.map +0 -1
- package/script/src/types/info/markets.js +0 -2
- package/script/src/types/info/orders.d.ts +0 -266
- package/script/src/types/info/orders.d.ts.map +0 -1
- package/script/src/types/info/orders.js +0 -2
- package/script/src/types/info/requests.d.ts +0 -634
- package/script/src/types/info/requests.d.ts.map +0 -1
- package/script/src/types/info/requests.js +0 -2
- package/script/src/types/info/validators.d.ts +0 -147
- package/script/src/types/info/validators.d.ts.map +0 -1
- package/script/src/types/info/validators.js +0 -2
- package/script/src/types/info/vaults.d.ts +0 -119
- package/script/src/types/info/vaults.d.ts.map +0 -1
- package/script/src/types/info/vaults.js +0 -2
- package/script/src/types/mod.d.ts +0 -38
- package/script/src/types/mod.d.ts.map +0 -1
- package/script/src/types/mod.js +0 -25
- package/script/src/types/subscriptions/requests.d.ts +0 -143
- package/script/src/types/subscriptions/requests.d.ts.map +0 -1
- package/script/src/types/subscriptions/requests.js +0 -2
- package/script/src/types/subscriptions/responses.d.ts +0 -213
- package/script/src/types/subscriptions/responses.d.ts.map +0 -1
- package/script/src/types/subscriptions/responses.js +0 -2
- /package/esm/src/{base.js → errors.js} +0 -0
- /package/script/src/{base.js → errors.js} +0 -0
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import type { Hex } from "../mod.js";
|
|
2
|
-
/** L2 order book snapshot. */
|
|
3
|
-
export interface Book {
|
|
4
|
-
/** Asset symbol. */
|
|
5
|
-
coin: string;
|
|
6
|
-
/** Timestamp of the snapshot (in ms since epoch). */
|
|
7
|
-
time: number;
|
|
8
|
-
/** Bid and ask levels (index 0 = bids, index 1 = asks). */
|
|
9
|
-
levels: [BookLevel[], BookLevel[]];
|
|
10
|
-
}
|
|
11
|
-
/** Order book level. */
|
|
12
|
-
export interface BookLevel {
|
|
13
|
-
/**
|
|
14
|
-
* Price.
|
|
15
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
16
|
-
*/
|
|
17
|
-
px: string;
|
|
18
|
-
/**
|
|
19
|
-
* Total size.
|
|
20
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
21
|
-
*/
|
|
22
|
-
sz: string;
|
|
23
|
-
/** Number of individual orders. */
|
|
24
|
-
n: number;
|
|
25
|
-
}
|
|
26
|
-
/** Trade fill record. */
|
|
27
|
-
export interface Fill {
|
|
28
|
-
/** Asset symbol. */
|
|
29
|
-
coin: string;
|
|
30
|
-
/**
|
|
31
|
-
* Price.
|
|
32
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
33
|
-
*/
|
|
34
|
-
px: string;
|
|
35
|
-
/**
|
|
36
|
-
* Size.
|
|
37
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
38
|
-
*/
|
|
39
|
-
sz: string;
|
|
40
|
-
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
41
|
-
side: "B" | "A";
|
|
42
|
-
/** Timestamp when the trade occurred (in ms since epoch). */
|
|
43
|
-
time: number;
|
|
44
|
-
/**
|
|
45
|
-
* Start position size.
|
|
46
|
-
* @pattern ^-?[0-9]+(\.[0-9]+)?$
|
|
47
|
-
*/
|
|
48
|
-
startPosition: string;
|
|
49
|
-
/** Direction indicator for frontend display. */
|
|
50
|
-
dir: string;
|
|
51
|
-
/**
|
|
52
|
-
* Realized PnL.
|
|
53
|
-
* @pattern ^-?[0-9]+(\.[0-9]+)?$
|
|
54
|
-
*/
|
|
55
|
-
closedPnl: string;
|
|
56
|
-
/** L1 transaction hash. */
|
|
57
|
-
hash: Hex;
|
|
58
|
-
/** Order ID. */
|
|
59
|
-
oid: number;
|
|
60
|
-
/** Indicates if the fill was a taker order. */
|
|
61
|
-
crossed: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Fee charged or rebate received (negative indicates rebate).
|
|
64
|
-
* @pattern ^-?[0-9]+(\.[0-9]+)?$
|
|
65
|
-
*/
|
|
66
|
-
fee: string;
|
|
67
|
-
/** Unique transaction identifier for a partial fill of an order. */
|
|
68
|
-
tid: number;
|
|
69
|
-
/** Client Order ID. */
|
|
70
|
-
cloid?: Hex;
|
|
71
|
-
/** Liquidation details. */
|
|
72
|
-
liquidation?: FillLiquidation;
|
|
73
|
-
/** Token in which the fee is denominated (e.g., "USDC"). */
|
|
74
|
-
feeToken: string;
|
|
75
|
-
/** ID of the TWAP. */
|
|
76
|
-
twapId: number | null;
|
|
77
|
-
}
|
|
78
|
-
/** Liquidation details for a trade fill. */
|
|
79
|
-
export interface FillLiquidation {
|
|
80
|
-
/** Address of the liquidated user. */
|
|
81
|
-
liquidatedUser: Hex;
|
|
82
|
-
/**
|
|
83
|
-
* Mark price at the time of liquidation.
|
|
84
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
85
|
-
*/
|
|
86
|
-
markPx: string;
|
|
87
|
-
/** Liquidation method. */
|
|
88
|
-
method: "market" | "backstop";
|
|
89
|
-
}
|
|
90
|
-
/** Open order with additional display information. */
|
|
91
|
-
export interface FrontendOrder extends Omit<Order, "reduceOnly" | "cloid"> {
|
|
92
|
-
/** Condition for triggering the order. */
|
|
93
|
-
triggerCondition: string;
|
|
94
|
-
/** Indicates if the order is a trigger order. */
|
|
95
|
-
isTrigger: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Trigger price.
|
|
98
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
99
|
-
*/
|
|
100
|
-
triggerPx: string;
|
|
101
|
-
/** Child orders associated with this order. */
|
|
102
|
-
children: FrontendOrder[];
|
|
103
|
-
/** Indicates if the order is a position TP/SL order. */
|
|
104
|
-
isPositionTpsl: boolean;
|
|
105
|
-
/** Indicates whether the order is reduce-only. */
|
|
106
|
-
reduceOnly: boolean;
|
|
107
|
-
/** Order type. */
|
|
108
|
-
orderType: OrderType;
|
|
109
|
-
/** Time-in-force option. */
|
|
110
|
-
tif: TIF | null;
|
|
111
|
-
/** Client Order ID. */
|
|
112
|
-
cloid: Hex | null;
|
|
113
|
-
}
|
|
114
|
-
/** Open order details. */
|
|
115
|
-
export interface Order {
|
|
116
|
-
/** Asset symbol. */
|
|
117
|
-
coin: string;
|
|
118
|
-
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
119
|
-
side: "B" | "A";
|
|
120
|
-
/**
|
|
121
|
-
* Limit price.
|
|
122
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
123
|
-
*/
|
|
124
|
-
limitPx: string;
|
|
125
|
-
/**
|
|
126
|
-
* Size.
|
|
127
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
128
|
-
*/
|
|
129
|
-
sz: string;
|
|
130
|
-
/** Order ID. */
|
|
131
|
-
oid: number;
|
|
132
|
-
/** Timestamp when the order was placed (in ms since epoch). */
|
|
133
|
-
timestamp: number;
|
|
134
|
-
/**
|
|
135
|
-
* Original size at order placement.
|
|
136
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
137
|
-
*/
|
|
138
|
-
origSz: string;
|
|
139
|
-
/** Client Order ID. */
|
|
140
|
-
cloid?: Hex;
|
|
141
|
-
/** Indicates if the order is reduce-only. */
|
|
142
|
-
reduceOnly?: true;
|
|
143
|
-
}
|
|
144
|
-
/** Result of an order status lookup. */
|
|
145
|
-
export type OrderLookup = {
|
|
146
|
-
/** Indicates that the order was found. */
|
|
147
|
-
status: "order";
|
|
148
|
-
/** Order details. */
|
|
149
|
-
order: OrderStatus<FrontendOrder>;
|
|
150
|
-
} | {
|
|
151
|
-
/** Indicates that the order was not found. */
|
|
152
|
-
status: "unknownOid";
|
|
153
|
-
};
|
|
154
|
-
/**
|
|
155
|
-
* Order processing status.
|
|
156
|
-
* - `open`: Order active and waiting to be filled.
|
|
157
|
-
* - `filled`: Order fully executed.
|
|
158
|
-
* - `canceled`: Order canceled by the user.
|
|
159
|
-
* - `triggered`: Order triggered and awaiting execution.
|
|
160
|
-
* - `rejected`: Order rejected by the system.
|
|
161
|
-
* - `marginCanceled`: Order canceled due to insufficient margin.
|
|
162
|
-
* - `vaultWithdrawalCanceled`: Canceled due to a user withdrawal from vault.
|
|
163
|
-
* - `openInterestCapCanceled`: Canceled due to order being too aggressive when open interest was at cap.
|
|
164
|
-
* - `selfTradeCanceled`: Canceled due to self-trade prevention.
|
|
165
|
-
* - `reduceOnlyCanceled`: Canceled reduced-only order that does not reduce position.
|
|
166
|
-
* - `siblingFilledCanceled`: Canceled due to sibling ordering being filled.
|
|
167
|
-
* - `delistedCanceled`: Canceled due to asset delisting.
|
|
168
|
-
* - `liquidatedCanceled`: Canceled due to liquidation.
|
|
169
|
-
* - `scheduledCancel`: Canceled due to exceeding scheduled cancel deadline (dead man's switch).
|
|
170
|
-
*/
|
|
171
|
-
export type OrderProcessingStatus = "open" | "filled" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected";
|
|
172
|
-
/** Order with current processing status. */
|
|
173
|
-
export interface OrderStatus<O extends Order | FrontendOrder> {
|
|
174
|
-
/** Order details. */
|
|
175
|
-
order: O;
|
|
176
|
-
/** Order processing status. */
|
|
177
|
-
status: OrderProcessingStatus;
|
|
178
|
-
/** Timestamp when the status was last updated (in ms since epoch). */
|
|
179
|
-
statusTimestamp: number;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Order types for market execution.
|
|
183
|
-
* - `Market`: Executes immediately at the market price.
|
|
184
|
-
* - `Limit`: Executes at the specified limit price or better.
|
|
185
|
-
* - `Stop Market`: Activates as a market order when a stop price is reached.
|
|
186
|
-
* - `Stop Limit`: Activates as a limit order when a stop price is reached.
|
|
187
|
-
* - `Take Profit Market`: Executes as a market order when a take profit price is reached.
|
|
188
|
-
* - `Take Profit Limit`: Executes as a limit order when a take profit price is reached.
|
|
189
|
-
*
|
|
190
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types
|
|
191
|
-
*/
|
|
192
|
-
export type OrderType = "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
193
|
-
/**
|
|
194
|
-
* Time-in-force options.
|
|
195
|
-
* - `Gtc`: Remains active until filled or canceled.
|
|
196
|
-
* - `Ioc`: Fills immediately or cancels any unfilled portion.
|
|
197
|
-
* - `Alo`: Adds liquidity only.
|
|
198
|
-
* - `FrontendMarket`: Similar to Ioc, used in Hyperliquid UI.
|
|
199
|
-
* - `LiquidationMarket`: Similar to Ioc, used in Hyperliquid UI.
|
|
200
|
-
*/
|
|
201
|
-
export type TIF = "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket";
|
|
202
|
-
/** TWAP history record for a user. */
|
|
203
|
-
export interface TwapHistory {
|
|
204
|
-
/** Creation time of the history record (in seconds since epoch). */
|
|
205
|
-
time: number;
|
|
206
|
-
/** State of the TWAP order. */
|
|
207
|
-
state: TwapState;
|
|
208
|
-
/** Current status of the TWAP order. */
|
|
209
|
-
status: TwapStatus;
|
|
210
|
-
}
|
|
211
|
-
/** TWAP slice fill details. */
|
|
212
|
-
export interface TwapSliceFill {
|
|
213
|
-
/** Fill details for the TWAP slice. */
|
|
214
|
-
fill: Omit<Fill, "cloid" | "liquidation">;
|
|
215
|
-
/** ID of the TWAP. */
|
|
216
|
-
twapId: number;
|
|
217
|
-
}
|
|
218
|
-
/** Current state of a TWAP order. */
|
|
219
|
-
export interface TwapState {
|
|
220
|
-
/** Asset symbol. */
|
|
221
|
-
coin: string;
|
|
222
|
-
/**
|
|
223
|
-
* Executed notional value.
|
|
224
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
225
|
-
*/
|
|
226
|
-
executedNtl: string;
|
|
227
|
-
/**
|
|
228
|
-
* Executed size.
|
|
229
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
230
|
-
*/
|
|
231
|
-
executedSz: string;
|
|
232
|
-
/** Duration in minutes. */
|
|
233
|
-
minutes: number;
|
|
234
|
-
/** Indicates if the TWAP randomizes execution. */
|
|
235
|
-
randomize: boolean;
|
|
236
|
-
/** Indicates if the order is reduce-only. */
|
|
237
|
-
reduceOnly: boolean;
|
|
238
|
-
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
239
|
-
side: "B" | "A";
|
|
240
|
-
/**
|
|
241
|
-
* Order size.
|
|
242
|
-
* @pattern ^[0-9]+(\.[0-9]+)?$
|
|
243
|
-
*/
|
|
244
|
-
sz: string;
|
|
245
|
-
/** Start time of the TWAP order (in ms since epoch). */
|
|
246
|
-
timestamp: number;
|
|
247
|
-
/** User address. */
|
|
248
|
-
user: Hex;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* TWAP order status.
|
|
252
|
-
* - `finished`: Fully executed.
|
|
253
|
-
* - `activated`: Active and executing.
|
|
254
|
-
* - `terminated`: Terminated.
|
|
255
|
-
* - `error`: An error occurred.
|
|
256
|
-
*/
|
|
257
|
-
export type TwapStatus = {
|
|
258
|
-
/** Status of the TWAP order. */
|
|
259
|
-
status: "finished" | "activated" | "terminated";
|
|
260
|
-
} | {
|
|
261
|
-
/** Status of the TWAP order. */
|
|
262
|
-
status: "error";
|
|
263
|
-
/** Error message. */
|
|
264
|
-
description: string;
|
|
265
|
-
};
|
|
266
|
-
//# sourceMappingURL=orders.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../../../src/src/types/info/orders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC,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;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,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;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,kDAAkD;IAClD,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;IAChB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,GAAG,EAA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