@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
|
@@ -0,0 +1,957 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
/** Order book level. */
|
|
3
|
+
export declare const BookLevel: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
4
|
+
/** Price. */
|
|
5
|
+
readonly px: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Price.">]>;
|
|
6
|
+
/** Total size. */
|
|
7
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total size.">]>;
|
|
8
|
+
/** Number of individual orders. */
|
|
9
|
+
readonly n: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Number of individual orders.">]>;
|
|
10
|
+
}, undefined>, v.DescriptionAction<{
|
|
11
|
+
px: string;
|
|
12
|
+
sz: string;
|
|
13
|
+
n: number;
|
|
14
|
+
}, "Order book level.">]>;
|
|
15
|
+
export type BookLevel = v.InferOutput<typeof BookLevel>;
|
|
16
|
+
/** L2 order book snapshot. */
|
|
17
|
+
export declare const Book: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
18
|
+
/** Asset symbol. */
|
|
19
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
20
|
+
/** Timestamp of the snapshot (in ms since epoch). */
|
|
21
|
+
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp of the snapshot (in ms since epoch).">]>;
|
|
22
|
+
/** Bid and ask levels (index 0 = bids, index 1 = asks). */
|
|
23
|
+
readonly levels: v.SchemaWithPipe<readonly [v.StrictTupleSchema<[v.ArraySchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
24
|
+
/** Price. */
|
|
25
|
+
readonly px: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Price.">]>;
|
|
26
|
+
/** Total size. */
|
|
27
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total size.">]>;
|
|
28
|
+
/** Number of individual orders. */
|
|
29
|
+
readonly n: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Number of individual orders.">]>;
|
|
30
|
+
}, undefined>, v.DescriptionAction<{
|
|
31
|
+
px: string;
|
|
32
|
+
sz: string;
|
|
33
|
+
n: number;
|
|
34
|
+
}, "Order book level.">]>, undefined>, v.ArraySchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
35
|
+
/** Price. */
|
|
36
|
+
readonly px: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Price.">]>;
|
|
37
|
+
/** Total size. */
|
|
38
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total size.">]>;
|
|
39
|
+
/** Number of individual orders. */
|
|
40
|
+
readonly n: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Number of individual orders.">]>;
|
|
41
|
+
}, undefined>, v.DescriptionAction<{
|
|
42
|
+
px: string;
|
|
43
|
+
sz: string;
|
|
44
|
+
n: number;
|
|
45
|
+
}, "Order book level.">]>, undefined>], undefined>, v.DescriptionAction<[{
|
|
46
|
+
px: string;
|
|
47
|
+
sz: string;
|
|
48
|
+
n: number;
|
|
49
|
+
}[], {
|
|
50
|
+
px: string;
|
|
51
|
+
sz: string;
|
|
52
|
+
n: number;
|
|
53
|
+
}[]], "Bid and ask levels (index 0 = bids, index 1 = asks).">]>;
|
|
54
|
+
}, undefined>, v.DescriptionAction<{
|
|
55
|
+
coin: string;
|
|
56
|
+
time: number;
|
|
57
|
+
levels: [{
|
|
58
|
+
px: string;
|
|
59
|
+
sz: string;
|
|
60
|
+
n: number;
|
|
61
|
+
}[], {
|
|
62
|
+
px: string;
|
|
63
|
+
sz: string;
|
|
64
|
+
n: number;
|
|
65
|
+
}[]];
|
|
66
|
+
}, "L2 order book snapshot.">]>;
|
|
67
|
+
export type Book = v.InferOutput<typeof Book>;
|
|
68
|
+
/** Liquidation details for a trade fill. */
|
|
69
|
+
export declare const FillLiquidation: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
70
|
+
/** Address of the liquidated user. */
|
|
71
|
+
readonly liquidatedUser: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "Address of the liquidated user.">]>;
|
|
72
|
+
/** Mark price at the time of liquidation. */
|
|
73
|
+
readonly markPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Mark price at the time of liquidation.">]>;
|
|
74
|
+
/** Liquidation method. */
|
|
75
|
+
readonly method: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"market", undefined>, v.LiteralSchema<"backstop", undefined>], undefined>, v.DescriptionAction<"market" | "backstop", "Liquidation method.">]>;
|
|
76
|
+
}, undefined>, v.DescriptionAction<{
|
|
77
|
+
liquidatedUser: `0x${string}`;
|
|
78
|
+
markPx: string;
|
|
79
|
+
method: "market" | "backstop";
|
|
80
|
+
}, "Liquidation details for a trade fill.">]>;
|
|
81
|
+
export type FillLiquidation = v.InferOutput<typeof FillLiquidation>;
|
|
82
|
+
/** Trade fill record. */
|
|
83
|
+
export declare const Fill: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
84
|
+
/** Asset symbol. */
|
|
85
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
86
|
+
/** Price. */
|
|
87
|
+
readonly px: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Price.">]>;
|
|
88
|
+
/** Size. */
|
|
89
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Size.">]>;
|
|
90
|
+
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
91
|
+
readonly side: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"B", undefined>, v.LiteralSchema<"A", undefined>], undefined>, v.DescriptionAction<"B" | "A", "Order side (\"B\" = Bid/Buy, \"A\" = Ask/Sell).">]>;
|
|
92
|
+
/** Timestamp when the trade occurred (in ms since epoch). */
|
|
93
|
+
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the trade occurred (in ms since epoch).">]>;
|
|
94
|
+
/** Start position size. */
|
|
95
|
+
readonly startPosition: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Start position size.">]>;
|
|
96
|
+
/** Direction indicator for frontend display. */
|
|
97
|
+
readonly dir: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Direction indicator for frontend display.">]>;
|
|
98
|
+
/** Realized PnL. */
|
|
99
|
+
readonly closedPnl: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Realized PnL.">]>;
|
|
100
|
+
/** L1 transaction hash. */
|
|
101
|
+
readonly hash: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>]>, v.DescriptionAction<`0x${string}`, "L1 transaction hash.">]>;
|
|
102
|
+
/** Order ID. */
|
|
103
|
+
readonly oid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Order ID.">]>;
|
|
104
|
+
/** Indicates if the fill was a taker order. */
|
|
105
|
+
readonly crossed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the fill was a taker order.">]>;
|
|
106
|
+
/** Fee charged or rebate received (negative indicates rebate). */
|
|
107
|
+
readonly fee: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Fee charged or rebate received (negative indicates rebate).">]>;
|
|
108
|
+
/** Unique transaction identifier for a partial fill of an order. */
|
|
109
|
+
readonly tid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Unique transaction identifier for a partial fill of an order.">]>;
|
|
110
|
+
/** Client Order ID. */
|
|
111
|
+
readonly cloid: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 34, undefined>]>, undefined>, v.DescriptionAction<`0x${string}` | undefined, "Client Order ID.">]>;
|
|
112
|
+
/** Liquidation details. */
|
|
113
|
+
readonly liquidation: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
114
|
+
/** Address of the liquidated user. */
|
|
115
|
+
readonly liquidatedUser: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "Address of the liquidated user.">]>;
|
|
116
|
+
/** Mark price at the time of liquidation. */
|
|
117
|
+
readonly markPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Mark price at the time of liquidation.">]>;
|
|
118
|
+
/** Liquidation method. */
|
|
119
|
+
readonly method: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"market", undefined>, v.LiteralSchema<"backstop", undefined>], undefined>, v.DescriptionAction<"market" | "backstop", "Liquidation method.">]>;
|
|
120
|
+
}, undefined>, v.DescriptionAction<{
|
|
121
|
+
liquidatedUser: `0x${string}`;
|
|
122
|
+
markPx: string;
|
|
123
|
+
method: "market" | "backstop";
|
|
124
|
+
}, "Liquidation details for a trade fill.">]>, undefined>, v.DescriptionAction<{
|
|
125
|
+
liquidatedUser: `0x${string}`;
|
|
126
|
+
markPx: string;
|
|
127
|
+
method: "market" | "backstop";
|
|
128
|
+
} | undefined, "Liquidation details.">]>;
|
|
129
|
+
/** Token in which the fee is denominated (e.g., "USDC"). */
|
|
130
|
+
readonly feeToken: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Token in which the fee is denominated (e.g., \"USDC\").">]>;
|
|
131
|
+
/** ID of the TWAP. */
|
|
132
|
+
readonly twapId: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.NullSchema<undefined>], undefined>, v.DescriptionAction<number | null, "ID of the TWAP.">]>;
|
|
133
|
+
}, undefined>, v.DescriptionAction<{
|
|
134
|
+
coin: string;
|
|
135
|
+
px: string;
|
|
136
|
+
sz: string;
|
|
137
|
+
side: "B" | "A";
|
|
138
|
+
time: number;
|
|
139
|
+
startPosition: string;
|
|
140
|
+
dir: string;
|
|
141
|
+
closedPnl: string;
|
|
142
|
+
hash: `0x${string}`;
|
|
143
|
+
oid: number;
|
|
144
|
+
crossed: boolean;
|
|
145
|
+
fee: string;
|
|
146
|
+
tid: number;
|
|
147
|
+
cloid?: `0x${string}` | undefined;
|
|
148
|
+
liquidation?: {
|
|
149
|
+
liquidatedUser: `0x${string}`;
|
|
150
|
+
markPx: string;
|
|
151
|
+
method: "market" | "backstop";
|
|
152
|
+
} | undefined;
|
|
153
|
+
feeToken: string;
|
|
154
|
+
twapId: number | null;
|
|
155
|
+
}, "Trade fill record.">]>;
|
|
156
|
+
export type Fill = v.InferOutput<typeof Fill>;
|
|
157
|
+
/** Open order details. */
|
|
158
|
+
export declare const Order: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
159
|
+
/** Asset symbol. */
|
|
160
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
161
|
+
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
162
|
+
readonly side: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"B", undefined>, v.LiteralSchema<"A", undefined>], undefined>, v.DescriptionAction<"B" | "A", "Order side (\"B\" = Bid/Buy, \"A\" = Ask/Sell).">]>;
|
|
163
|
+
/** Limit price. */
|
|
164
|
+
readonly limitPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Limit price.">]>;
|
|
165
|
+
/** Size. */
|
|
166
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Size.">]>;
|
|
167
|
+
/** Order ID. */
|
|
168
|
+
readonly oid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Order ID.">]>;
|
|
169
|
+
/** Timestamp when the order was placed (in ms since epoch). */
|
|
170
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the order was placed (in ms since epoch).">]>;
|
|
171
|
+
/** Original size at order placement. */
|
|
172
|
+
readonly origSz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Original size at order placement.">]>;
|
|
173
|
+
/** Client Order ID. */
|
|
174
|
+
readonly cloid: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 34, undefined>]>, undefined>, v.DescriptionAction<`0x${string}` | undefined, "Client Order ID.">]>;
|
|
175
|
+
/** Indicates if the order is reduce-only. */
|
|
176
|
+
readonly reduceOnly: v.SchemaWithPipe<readonly [v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>, v.DescriptionAction<true | undefined, "Indicates if the order is reduce-only.">]>;
|
|
177
|
+
}, undefined>, v.DescriptionAction<{
|
|
178
|
+
coin: string;
|
|
179
|
+
side: "B" | "A";
|
|
180
|
+
limitPx: string;
|
|
181
|
+
sz: string;
|
|
182
|
+
oid: number;
|
|
183
|
+
timestamp: number;
|
|
184
|
+
origSz: string;
|
|
185
|
+
cloid?: `0x${string}` | undefined;
|
|
186
|
+
reduceOnly?: true | undefined;
|
|
187
|
+
}, "Open order details.">]>;
|
|
188
|
+
export type Order = v.InferOutput<typeof Order>;
|
|
189
|
+
/**
|
|
190
|
+
* Order types for market execution.
|
|
191
|
+
* - `Market`: Executes immediately at the market price.
|
|
192
|
+
* - `Limit`: Executes at the specified limit price or better.
|
|
193
|
+
* - `Stop Market`: Activates as a market order when a stop price is reached.
|
|
194
|
+
* - `Stop Limit`: Activates as a limit order when a stop price is reached.
|
|
195
|
+
* - `Take Profit Market`: Executes as a market order when a take profit price is reached.
|
|
196
|
+
* - `Take Profit Limit`: Executes as a limit order when a take profit price is reached.
|
|
197
|
+
*
|
|
198
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types
|
|
199
|
+
*/
|
|
200
|
+
export declare const OrderType: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"Market", undefined>, v.LiteralSchema<"Limit", undefined>, v.LiteralSchema<"Stop Market", undefined>, v.LiteralSchema<"Stop Limit", undefined>, v.LiteralSchema<"Take Profit Market", undefined>, v.LiteralSchema<"Take Profit Limit", undefined>], undefined>, v.DescriptionAction<"Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit", string>]>;
|
|
201
|
+
export type OrderType = v.InferOutput<typeof OrderType>;
|
|
202
|
+
/**
|
|
203
|
+
* Time-in-force options.
|
|
204
|
+
* - `Gtc`: Remains active until filled or canceled.
|
|
205
|
+
* - `Ioc`: Fills immediately or cancels any unfilled portion.
|
|
206
|
+
* - `Alo`: Adds liquidity only.
|
|
207
|
+
* - `FrontendMarket`: Similar to Ioc, used in Hyperliquid UI.
|
|
208
|
+
* - `LiquidationMarket`: Similar to Ioc, used in Hyperliquid UI.
|
|
209
|
+
*/
|
|
210
|
+
export declare const TIF: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"Gtc", undefined>, v.LiteralSchema<"Ioc", undefined>, v.LiteralSchema<"Alo", undefined>, v.LiteralSchema<"FrontendMarket", undefined>, v.LiteralSchema<"LiquidationMarket", undefined>], undefined>, v.DescriptionAction<"Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket", string>]>;
|
|
211
|
+
export type TIF = v.InferOutput<typeof TIF>;
|
|
212
|
+
/** Open order with additional display information. */
|
|
213
|
+
export declare const FrontendOrder: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
214
|
+
/** Condition for triggering the order. */
|
|
215
|
+
readonly triggerCondition: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Condition for triggering the order.">]>;
|
|
216
|
+
/** Indicates if the order is a trigger order. */
|
|
217
|
+
readonly isTrigger: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the order is a trigger order.">]>;
|
|
218
|
+
/** Trigger price. */
|
|
219
|
+
readonly triggerPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Trigger price.">]>;
|
|
220
|
+
/** Child orders associated with this order. */
|
|
221
|
+
readonly children: v.SchemaWithPipe<readonly [v.ArraySchema<v.LazySchema<any>, undefined>, v.DescriptionAction<any[], "Child orders associated with this order.">]>;
|
|
222
|
+
/** Indicates if the order is a position TP/SL order. */
|
|
223
|
+
readonly isPositionTpsl: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the order is a position TP/SL order.">]>;
|
|
224
|
+
/** Indicates whether the order is reduce-only. */
|
|
225
|
+
readonly reduceOnly: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates whether the order is reduce-only.">]>;
|
|
226
|
+
/** Order type. */
|
|
227
|
+
readonly orderType: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"Market", undefined>, v.LiteralSchema<"Limit", undefined>, v.LiteralSchema<"Stop Market", undefined>, v.LiteralSchema<"Stop Limit", undefined>, v.LiteralSchema<"Take Profit Market", undefined>, v.LiteralSchema<"Take Profit Limit", undefined>], undefined>, v.DescriptionAction<"Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit", string>]>, v.DescriptionAction<"Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit", "Order type.">]>;
|
|
228
|
+
/** Time-in-force option. */
|
|
229
|
+
readonly tif: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"Gtc", undefined>, v.LiteralSchema<"Ioc", undefined>, v.LiteralSchema<"Alo", undefined>, v.LiteralSchema<"FrontendMarket", undefined>, v.LiteralSchema<"LiquidationMarket", undefined>], undefined>, v.DescriptionAction<"Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket", string>]>, v.NullSchema<undefined>], undefined>, v.DescriptionAction<"Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null, "Time-in-force option.">]>;
|
|
230
|
+
/** Client Order ID. */
|
|
231
|
+
readonly cloid: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 34, undefined>]>, v.NullSchema<undefined>], undefined>, v.DescriptionAction<`0x${string}` | null, "Client Order ID.">]>;
|
|
232
|
+
readonly oid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Order ID.">]>;
|
|
233
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
234
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Size.">]>;
|
|
235
|
+
readonly side: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"B", undefined>, v.LiteralSchema<"A", undefined>], undefined>, v.DescriptionAction<"B" | "A", "Order side (\"B\" = Bid/Buy, \"A\" = Ask/Sell).">]>;
|
|
236
|
+
readonly limitPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Limit price.">]>;
|
|
237
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the order was placed (in ms since epoch).">]>;
|
|
238
|
+
readonly origSz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Original size at order placement.">]>;
|
|
239
|
+
}, undefined>, v.DescriptionAction<{
|
|
240
|
+
triggerCondition: string;
|
|
241
|
+
isTrigger: boolean;
|
|
242
|
+
triggerPx: string;
|
|
243
|
+
children: any[];
|
|
244
|
+
isPositionTpsl: boolean;
|
|
245
|
+
reduceOnly: boolean;
|
|
246
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
247
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
248
|
+
cloid: `0x${string}` | null;
|
|
249
|
+
oid: number;
|
|
250
|
+
coin: string;
|
|
251
|
+
sz: string;
|
|
252
|
+
side: "B" | "A";
|
|
253
|
+
limitPx: string;
|
|
254
|
+
timestamp: number;
|
|
255
|
+
origSz: string;
|
|
256
|
+
}, "Open order with additional display information.">]>;
|
|
257
|
+
export type FrontendOrder = v.InferOutput<typeof FrontendOrder>;
|
|
258
|
+
/**
|
|
259
|
+
* Order processing status.
|
|
260
|
+
* - `open`: Order active and waiting to be filled.
|
|
261
|
+
* - `filled`: Order fully executed.
|
|
262
|
+
* - `canceled`: Order canceled by the user.
|
|
263
|
+
* - `triggered`: Order triggered and awaiting execution.
|
|
264
|
+
* - `rejected`: Order rejected by the system.
|
|
265
|
+
* - `marginCanceled`: Order canceled due to insufficient margin.
|
|
266
|
+
* - `vaultWithdrawalCanceled`: Canceled due to a user withdrawal from vault.
|
|
267
|
+
* - `openInterestCapCanceled`: Canceled due to order being too aggressive when open interest was at cap.
|
|
268
|
+
* - `selfTradeCanceled`: Canceled due to self-trade prevention.
|
|
269
|
+
* - `reduceOnlyCanceled`: Canceled reduced-only order that does not reduce position.
|
|
270
|
+
* - `siblingFilledCanceled`: Canceled due to sibling ordering being filled.
|
|
271
|
+
* - `delistedCanceled`: Canceled due to asset delisting.
|
|
272
|
+
* - `liquidatedCanceled`: Canceled due to liquidation.
|
|
273
|
+
* - `scheduledCancel`: Canceled due to exceeding scheduled cancel deadline (dead man's switch).
|
|
274
|
+
*/
|
|
275
|
+
export declare const OrderProcessingStatus: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"open", undefined>, v.LiteralSchema<"filled", undefined>, v.LiteralSchema<"canceled", undefined>, v.LiteralSchema<"triggered", undefined>, v.LiteralSchema<"rejected", undefined>, v.LiteralSchema<"marginCanceled", undefined>, v.LiteralSchema<"vaultWithdrawalCanceled", undefined>, v.LiteralSchema<"openInterestCapCanceled", undefined>, v.LiteralSchema<"selfTradeCanceled", undefined>, v.LiteralSchema<"reduceOnlyCanceled", undefined>, v.LiteralSchema<"siblingFilledCanceled", undefined>, v.LiteralSchema<"delistedCanceled", undefined>, v.LiteralSchema<"liquidatedCanceled", undefined>, v.LiteralSchema<"scheduledCancel", undefined>, v.LiteralSchema<"reduceOnlyRejected", undefined>], undefined>, v.DescriptionAction<"filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected", string>]>;
|
|
276
|
+
export type OrderProcessingStatus = v.InferOutput<typeof OrderProcessingStatus>;
|
|
277
|
+
/** Order with current processing status. */
|
|
278
|
+
export declare const OrderStatus: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
279
|
+
/** Order details. */
|
|
280
|
+
readonly order: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
281
|
+
/** Asset symbol. */
|
|
282
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
283
|
+
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
284
|
+
readonly side: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"B", undefined>, v.LiteralSchema<"A", undefined>], undefined>, v.DescriptionAction<"B" | "A", "Order side (\"B\" = Bid/Buy, \"A\" = Ask/Sell).">]>;
|
|
285
|
+
/** Limit price. */
|
|
286
|
+
readonly limitPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Limit price.">]>;
|
|
287
|
+
/** Size. */
|
|
288
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Size.">]>;
|
|
289
|
+
/** Order ID. */
|
|
290
|
+
readonly oid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Order ID.">]>;
|
|
291
|
+
/** Timestamp when the order was placed (in ms since epoch). */
|
|
292
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the order was placed (in ms since epoch).">]>;
|
|
293
|
+
/** Original size at order placement. */
|
|
294
|
+
readonly origSz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Original size at order placement.">]>;
|
|
295
|
+
/** Client Order ID. */
|
|
296
|
+
readonly cloid: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 34, undefined>]>, undefined>, v.DescriptionAction<`0x${string}` | undefined, "Client Order ID.">]>;
|
|
297
|
+
/** Indicates if the order is reduce-only. */
|
|
298
|
+
readonly reduceOnly: v.SchemaWithPipe<readonly [v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>, v.DescriptionAction<true | undefined, "Indicates if the order is reduce-only.">]>;
|
|
299
|
+
}, undefined>, v.DescriptionAction<{
|
|
300
|
+
coin: string;
|
|
301
|
+
side: "B" | "A";
|
|
302
|
+
limitPx: string;
|
|
303
|
+
sz: string;
|
|
304
|
+
oid: number;
|
|
305
|
+
timestamp: number;
|
|
306
|
+
origSz: string;
|
|
307
|
+
cloid?: `0x${string}` | undefined;
|
|
308
|
+
reduceOnly?: true | undefined;
|
|
309
|
+
}, "Open order details.">]>, v.DescriptionAction<{
|
|
310
|
+
coin: string;
|
|
311
|
+
side: "B" | "A";
|
|
312
|
+
limitPx: string;
|
|
313
|
+
sz: string;
|
|
314
|
+
oid: number;
|
|
315
|
+
timestamp: number;
|
|
316
|
+
origSz: string;
|
|
317
|
+
cloid?: `0x${string}` | undefined;
|
|
318
|
+
reduceOnly?: true | undefined;
|
|
319
|
+
}, "Order details.">]>;
|
|
320
|
+
/** Order processing status. */
|
|
321
|
+
readonly status: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"open", undefined>, v.LiteralSchema<"filled", undefined>, v.LiteralSchema<"canceled", undefined>, v.LiteralSchema<"triggered", undefined>, v.LiteralSchema<"rejected", undefined>, v.LiteralSchema<"marginCanceled", undefined>, v.LiteralSchema<"vaultWithdrawalCanceled", undefined>, v.LiteralSchema<"openInterestCapCanceled", undefined>, v.LiteralSchema<"selfTradeCanceled", undefined>, v.LiteralSchema<"reduceOnlyCanceled", undefined>, v.LiteralSchema<"siblingFilledCanceled", undefined>, v.LiteralSchema<"delistedCanceled", undefined>, v.LiteralSchema<"liquidatedCanceled", undefined>, v.LiteralSchema<"scheduledCancel", undefined>, v.LiteralSchema<"reduceOnlyRejected", undefined>], undefined>, v.DescriptionAction<"filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected", string>]>, v.DescriptionAction<"filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected", "Order processing status.">]>;
|
|
322
|
+
/** Timestamp when the status was last updated (in ms since epoch). */
|
|
323
|
+
readonly statusTimestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the status was last updated (in ms since epoch).">]>;
|
|
324
|
+
}, undefined>, v.DescriptionAction<{
|
|
325
|
+
order: {
|
|
326
|
+
coin: string;
|
|
327
|
+
side: "B" | "A";
|
|
328
|
+
limitPx: string;
|
|
329
|
+
sz: string;
|
|
330
|
+
oid: number;
|
|
331
|
+
timestamp: number;
|
|
332
|
+
origSz: string;
|
|
333
|
+
cloid?: `0x${string}` | undefined;
|
|
334
|
+
reduceOnly?: true | undefined;
|
|
335
|
+
};
|
|
336
|
+
status: "filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected";
|
|
337
|
+
statusTimestamp: number;
|
|
338
|
+
}, "Order with current processing status.">]>;
|
|
339
|
+
export type OrderStatus = v.InferOutput<typeof OrderStatus>;
|
|
340
|
+
/** Frontend order with current processing status. */
|
|
341
|
+
export declare const FrontendOrderStatus: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
342
|
+
/** Order details. */
|
|
343
|
+
readonly order: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
344
|
+
/** Condition for triggering the order. */
|
|
345
|
+
readonly triggerCondition: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Condition for triggering the order.">]>;
|
|
346
|
+
/** Indicates if the order is a trigger order. */
|
|
347
|
+
readonly isTrigger: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the order is a trigger order.">]>;
|
|
348
|
+
/** Trigger price. */
|
|
349
|
+
readonly triggerPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Trigger price.">]>;
|
|
350
|
+
/** Child orders associated with this order. */
|
|
351
|
+
readonly children: v.SchemaWithPipe<readonly [v.ArraySchema<v.LazySchema<any>, undefined>, v.DescriptionAction<any[], "Child orders associated with this order.">]>;
|
|
352
|
+
/** Indicates if the order is a position TP/SL order. */
|
|
353
|
+
readonly isPositionTpsl: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the order is a position TP/SL order.">]>;
|
|
354
|
+
/** Indicates whether the order is reduce-only. */
|
|
355
|
+
readonly reduceOnly: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates whether the order is reduce-only.">]>;
|
|
356
|
+
/** Order type. */
|
|
357
|
+
readonly orderType: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"Market", undefined>, v.LiteralSchema<"Limit", undefined>, v.LiteralSchema<"Stop Market", undefined>, v.LiteralSchema<"Stop Limit", undefined>, v.LiteralSchema<"Take Profit Market", undefined>, v.LiteralSchema<"Take Profit Limit", undefined>], undefined>, v.DescriptionAction<"Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit", string>]>, v.DescriptionAction<"Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit", "Order type.">]>;
|
|
358
|
+
/** Time-in-force option. */
|
|
359
|
+
readonly tif: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"Gtc", undefined>, v.LiteralSchema<"Ioc", undefined>, v.LiteralSchema<"Alo", undefined>, v.LiteralSchema<"FrontendMarket", undefined>, v.LiteralSchema<"LiquidationMarket", undefined>], undefined>, v.DescriptionAction<"Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket", string>]>, v.NullSchema<undefined>], undefined>, v.DescriptionAction<"Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null, "Time-in-force option.">]>;
|
|
360
|
+
/** Client Order ID. */
|
|
361
|
+
readonly cloid: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 34, undefined>]>, v.NullSchema<undefined>], undefined>, v.DescriptionAction<`0x${string}` | null, "Client Order ID.">]>;
|
|
362
|
+
readonly oid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Order ID.">]>;
|
|
363
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
364
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Size.">]>;
|
|
365
|
+
readonly side: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"B", undefined>, v.LiteralSchema<"A", undefined>], undefined>, v.DescriptionAction<"B" | "A", "Order side (\"B\" = Bid/Buy, \"A\" = Ask/Sell).">]>;
|
|
366
|
+
readonly limitPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Limit price.">]>;
|
|
367
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the order was placed (in ms since epoch).">]>;
|
|
368
|
+
readonly origSz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Original size at order placement.">]>;
|
|
369
|
+
}, undefined>, v.DescriptionAction<{
|
|
370
|
+
triggerCondition: string;
|
|
371
|
+
isTrigger: boolean;
|
|
372
|
+
triggerPx: string;
|
|
373
|
+
children: any[];
|
|
374
|
+
isPositionTpsl: boolean;
|
|
375
|
+
reduceOnly: boolean;
|
|
376
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
377
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
378
|
+
cloid: `0x${string}` | null;
|
|
379
|
+
oid: number;
|
|
380
|
+
coin: string;
|
|
381
|
+
sz: string;
|
|
382
|
+
side: "B" | "A";
|
|
383
|
+
limitPx: string;
|
|
384
|
+
timestamp: number;
|
|
385
|
+
origSz: string;
|
|
386
|
+
}, "Open order with additional display information.">]>, v.DescriptionAction<{
|
|
387
|
+
triggerCondition: string;
|
|
388
|
+
isTrigger: boolean;
|
|
389
|
+
triggerPx: string;
|
|
390
|
+
children: any[];
|
|
391
|
+
isPositionTpsl: boolean;
|
|
392
|
+
reduceOnly: boolean;
|
|
393
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
394
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
395
|
+
cloid: `0x${string}` | null;
|
|
396
|
+
oid: number;
|
|
397
|
+
coin: string;
|
|
398
|
+
sz: string;
|
|
399
|
+
side: "B" | "A";
|
|
400
|
+
limitPx: string;
|
|
401
|
+
timestamp: number;
|
|
402
|
+
origSz: string;
|
|
403
|
+
}, "Order details.">]>;
|
|
404
|
+
/** Order processing status. */
|
|
405
|
+
readonly status: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"open", undefined>, v.LiteralSchema<"filled", undefined>, v.LiteralSchema<"canceled", undefined>, v.LiteralSchema<"triggered", undefined>, v.LiteralSchema<"rejected", undefined>, v.LiteralSchema<"marginCanceled", undefined>, v.LiteralSchema<"vaultWithdrawalCanceled", undefined>, v.LiteralSchema<"openInterestCapCanceled", undefined>, v.LiteralSchema<"selfTradeCanceled", undefined>, v.LiteralSchema<"reduceOnlyCanceled", undefined>, v.LiteralSchema<"siblingFilledCanceled", undefined>, v.LiteralSchema<"delistedCanceled", undefined>, v.LiteralSchema<"liquidatedCanceled", undefined>, v.LiteralSchema<"scheduledCancel", undefined>, v.LiteralSchema<"reduceOnlyRejected", undefined>], undefined>, v.DescriptionAction<"filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected", string>]>, v.DescriptionAction<"filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected", "Order processing status.">]>;
|
|
406
|
+
/** Timestamp when the status was last updated (in ms since epoch). */
|
|
407
|
+
readonly statusTimestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the status was last updated (in ms since epoch).">]>;
|
|
408
|
+
}, undefined>, v.DescriptionAction<{
|
|
409
|
+
order: {
|
|
410
|
+
triggerCondition: string;
|
|
411
|
+
isTrigger: boolean;
|
|
412
|
+
triggerPx: string;
|
|
413
|
+
children: any[];
|
|
414
|
+
isPositionTpsl: boolean;
|
|
415
|
+
reduceOnly: boolean;
|
|
416
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
417
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
418
|
+
cloid: `0x${string}` | null;
|
|
419
|
+
oid: number;
|
|
420
|
+
coin: string;
|
|
421
|
+
sz: string;
|
|
422
|
+
side: "B" | "A";
|
|
423
|
+
limitPx: string;
|
|
424
|
+
timestamp: number;
|
|
425
|
+
origSz: string;
|
|
426
|
+
};
|
|
427
|
+
status: "filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected";
|
|
428
|
+
statusTimestamp: number;
|
|
429
|
+
}, "Frontend order with current processing status.">]>;
|
|
430
|
+
export type FrontendOrderStatus = v.InferOutput<typeof FrontendOrderStatus>;
|
|
431
|
+
/** Result of an order status lookup. */
|
|
432
|
+
export declare const OrderLookup: v.SchemaWithPipe<readonly [v.UnionSchema<[v.StrictObjectSchema<{
|
|
433
|
+
/** Indicates that the order was found. */
|
|
434
|
+
readonly status: v.SchemaWithPipe<readonly [v.LiteralSchema<"order", undefined>, v.DescriptionAction<"order", "Indicates that the order was found.">]>;
|
|
435
|
+
/** Order details. */
|
|
436
|
+
readonly order: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
437
|
+
/** Order details. */
|
|
438
|
+
readonly order: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
439
|
+
/** Condition for triggering the order. */
|
|
440
|
+
readonly triggerCondition: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Condition for triggering the order.">]>;
|
|
441
|
+
/** Indicates if the order is a trigger order. */
|
|
442
|
+
readonly isTrigger: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the order is a trigger order.">]>;
|
|
443
|
+
/** Trigger price. */
|
|
444
|
+
readonly triggerPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Trigger price.">]>;
|
|
445
|
+
/** Child orders associated with this order. */
|
|
446
|
+
readonly children: v.SchemaWithPipe<readonly [v.ArraySchema<v.LazySchema<any>, undefined>, v.DescriptionAction<any[], "Child orders associated with this order.">]>;
|
|
447
|
+
/** Indicates if the order is a position TP/SL order. */
|
|
448
|
+
readonly isPositionTpsl: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the order is a position TP/SL order.">]>;
|
|
449
|
+
/** Indicates whether the order is reduce-only. */
|
|
450
|
+
readonly reduceOnly: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates whether the order is reduce-only.">]>;
|
|
451
|
+
/** Order type. */
|
|
452
|
+
readonly orderType: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"Market", undefined>, v.LiteralSchema<"Limit", undefined>, v.LiteralSchema<"Stop Market", undefined>, v.LiteralSchema<"Stop Limit", undefined>, v.LiteralSchema<"Take Profit Market", undefined>, v.LiteralSchema<"Take Profit Limit", undefined>], undefined>, v.DescriptionAction<"Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit", string>]>, v.DescriptionAction<"Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit", "Order type.">]>;
|
|
453
|
+
/** Time-in-force option. */
|
|
454
|
+
readonly tif: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"Gtc", undefined>, v.LiteralSchema<"Ioc", undefined>, v.LiteralSchema<"Alo", undefined>, v.LiteralSchema<"FrontendMarket", undefined>, v.LiteralSchema<"LiquidationMarket", undefined>], undefined>, v.DescriptionAction<"Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket", string>]>, v.NullSchema<undefined>], undefined>, v.DescriptionAction<"Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null, "Time-in-force option.">]>;
|
|
455
|
+
/** Client Order ID. */
|
|
456
|
+
readonly cloid: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 34, undefined>]>, v.NullSchema<undefined>], undefined>, v.DescriptionAction<`0x${string}` | null, "Client Order ID.">]>;
|
|
457
|
+
readonly oid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Order ID.">]>;
|
|
458
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
459
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Size.">]>;
|
|
460
|
+
readonly side: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"B", undefined>, v.LiteralSchema<"A", undefined>], undefined>, v.DescriptionAction<"B" | "A", "Order side (\"B\" = Bid/Buy, \"A\" = Ask/Sell).">]>;
|
|
461
|
+
readonly limitPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Limit price.">]>;
|
|
462
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the order was placed (in ms since epoch).">]>;
|
|
463
|
+
readonly origSz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Original size at order placement.">]>;
|
|
464
|
+
}, undefined>, v.DescriptionAction<{
|
|
465
|
+
triggerCondition: string;
|
|
466
|
+
isTrigger: boolean;
|
|
467
|
+
triggerPx: string;
|
|
468
|
+
children: any[];
|
|
469
|
+
isPositionTpsl: boolean;
|
|
470
|
+
reduceOnly: boolean;
|
|
471
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
472
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
473
|
+
cloid: `0x${string}` | null;
|
|
474
|
+
oid: number;
|
|
475
|
+
coin: string;
|
|
476
|
+
sz: string;
|
|
477
|
+
side: "B" | "A";
|
|
478
|
+
limitPx: string;
|
|
479
|
+
timestamp: number;
|
|
480
|
+
origSz: string;
|
|
481
|
+
}, "Open order with additional display information.">]>, v.DescriptionAction<{
|
|
482
|
+
triggerCondition: string;
|
|
483
|
+
isTrigger: boolean;
|
|
484
|
+
triggerPx: string;
|
|
485
|
+
children: any[];
|
|
486
|
+
isPositionTpsl: boolean;
|
|
487
|
+
reduceOnly: boolean;
|
|
488
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
489
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
490
|
+
cloid: `0x${string}` | null;
|
|
491
|
+
oid: number;
|
|
492
|
+
coin: string;
|
|
493
|
+
sz: string;
|
|
494
|
+
side: "B" | "A";
|
|
495
|
+
limitPx: string;
|
|
496
|
+
timestamp: number;
|
|
497
|
+
origSz: string;
|
|
498
|
+
}, "Order details.">]>;
|
|
499
|
+
/** Order processing status. */
|
|
500
|
+
readonly status: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"open", undefined>, v.LiteralSchema<"filled", undefined>, v.LiteralSchema<"canceled", undefined>, v.LiteralSchema<"triggered", undefined>, v.LiteralSchema<"rejected", undefined>, v.LiteralSchema<"marginCanceled", undefined>, v.LiteralSchema<"vaultWithdrawalCanceled", undefined>, v.LiteralSchema<"openInterestCapCanceled", undefined>, v.LiteralSchema<"selfTradeCanceled", undefined>, v.LiteralSchema<"reduceOnlyCanceled", undefined>, v.LiteralSchema<"siblingFilledCanceled", undefined>, v.LiteralSchema<"delistedCanceled", undefined>, v.LiteralSchema<"liquidatedCanceled", undefined>, v.LiteralSchema<"scheduledCancel", undefined>, v.LiteralSchema<"reduceOnlyRejected", undefined>], undefined>, v.DescriptionAction<"filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected", string>]>, v.DescriptionAction<"filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected", "Order processing status.">]>;
|
|
501
|
+
/** Timestamp when the status was last updated (in ms since epoch). */
|
|
502
|
+
readonly statusTimestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the status was last updated (in ms since epoch).">]>;
|
|
503
|
+
}, undefined>, v.DescriptionAction<{
|
|
504
|
+
order: {
|
|
505
|
+
triggerCondition: string;
|
|
506
|
+
isTrigger: boolean;
|
|
507
|
+
triggerPx: string;
|
|
508
|
+
children: any[];
|
|
509
|
+
isPositionTpsl: boolean;
|
|
510
|
+
reduceOnly: boolean;
|
|
511
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
512
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
513
|
+
cloid: `0x${string}` | null;
|
|
514
|
+
oid: number;
|
|
515
|
+
coin: string;
|
|
516
|
+
sz: string;
|
|
517
|
+
side: "B" | "A";
|
|
518
|
+
limitPx: string;
|
|
519
|
+
timestamp: number;
|
|
520
|
+
origSz: string;
|
|
521
|
+
};
|
|
522
|
+
status: "filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected";
|
|
523
|
+
statusTimestamp: number;
|
|
524
|
+
}, "Frontend order with current processing status.">]>, v.DescriptionAction<{
|
|
525
|
+
order: {
|
|
526
|
+
triggerCondition: string;
|
|
527
|
+
isTrigger: boolean;
|
|
528
|
+
triggerPx: string;
|
|
529
|
+
children: any[];
|
|
530
|
+
isPositionTpsl: boolean;
|
|
531
|
+
reduceOnly: boolean;
|
|
532
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
533
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
534
|
+
cloid: `0x${string}` | null;
|
|
535
|
+
oid: number;
|
|
536
|
+
coin: string;
|
|
537
|
+
sz: string;
|
|
538
|
+
side: "B" | "A";
|
|
539
|
+
limitPx: string;
|
|
540
|
+
timestamp: number;
|
|
541
|
+
origSz: string;
|
|
542
|
+
};
|
|
543
|
+
status: "filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected";
|
|
544
|
+
statusTimestamp: number;
|
|
545
|
+
}, "Order details.">]>;
|
|
546
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
547
|
+
/** Indicates that the order was not found. */
|
|
548
|
+
readonly status: v.SchemaWithPipe<readonly [v.LiteralSchema<"unknownOid", undefined>, v.DescriptionAction<"unknownOid", "Indicates that the order was not found.">]>;
|
|
549
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
550
|
+
status: "order";
|
|
551
|
+
order: {
|
|
552
|
+
order: {
|
|
553
|
+
triggerCondition: string;
|
|
554
|
+
isTrigger: boolean;
|
|
555
|
+
triggerPx: string;
|
|
556
|
+
children: any[];
|
|
557
|
+
isPositionTpsl: boolean;
|
|
558
|
+
reduceOnly: boolean;
|
|
559
|
+
orderType: "Market" | "Limit" | "Stop Market" | "Stop Limit" | "Take Profit Market" | "Take Profit Limit";
|
|
560
|
+
tif: "Gtc" | "Ioc" | "Alo" | "FrontendMarket" | "LiquidationMarket" | null;
|
|
561
|
+
cloid: `0x${string}` | null;
|
|
562
|
+
oid: number;
|
|
563
|
+
coin: string;
|
|
564
|
+
sz: string;
|
|
565
|
+
side: "B" | "A";
|
|
566
|
+
limitPx: string;
|
|
567
|
+
timestamp: number;
|
|
568
|
+
origSz: string;
|
|
569
|
+
};
|
|
570
|
+
status: "filled" | "open" | "canceled" | "triggered" | "rejected" | "marginCanceled" | "vaultWithdrawalCanceled" | "openInterestCapCanceled" | "selfTradeCanceled" | "reduceOnlyCanceled" | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" | "scheduledCancel" | "reduceOnlyRejected";
|
|
571
|
+
statusTimestamp: number;
|
|
572
|
+
};
|
|
573
|
+
} | {
|
|
574
|
+
status: "unknownOid";
|
|
575
|
+
}, "Result of an order status lookup.">]>;
|
|
576
|
+
export type OrderLookup = v.InferOutput<typeof OrderLookup>;
|
|
577
|
+
/** Current state of a TWAP order. */
|
|
578
|
+
export declare const TwapState: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
579
|
+
/** Asset symbol. */
|
|
580
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
581
|
+
/** Executed notional value. */
|
|
582
|
+
readonly executedNtl: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Executed notional value.">]>;
|
|
583
|
+
/** Executed size. */
|
|
584
|
+
readonly executedSz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Executed size.">]>;
|
|
585
|
+
/** Duration in minutes. */
|
|
586
|
+
readonly minutes: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Duration in minutes.">]>;
|
|
587
|
+
/** Indicates if the TWAP randomizes execution. */
|
|
588
|
+
readonly randomize: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the TWAP randomizes execution.">]>;
|
|
589
|
+
/** Indicates if the order is reduce-only. */
|
|
590
|
+
readonly reduceOnly: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the order is reduce-only.">]>;
|
|
591
|
+
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
592
|
+
readonly side: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"B", undefined>, v.LiteralSchema<"A", undefined>], undefined>, v.DescriptionAction<"B" | "A", "Order side (\"B\" = Bid/Buy, \"A\" = Ask/Sell).">]>;
|
|
593
|
+
/** Order size. */
|
|
594
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Order size.">]>;
|
|
595
|
+
/** Start time of the TWAP order (in ms since epoch). */
|
|
596
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Start time of the TWAP order (in ms since epoch).">]>;
|
|
597
|
+
/** User address. */
|
|
598
|
+
readonly user: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "User address.">]>;
|
|
599
|
+
}, undefined>, v.DescriptionAction<{
|
|
600
|
+
coin: string;
|
|
601
|
+
executedNtl: string;
|
|
602
|
+
executedSz: string;
|
|
603
|
+
minutes: number;
|
|
604
|
+
randomize: boolean;
|
|
605
|
+
reduceOnly: boolean;
|
|
606
|
+
side: "B" | "A";
|
|
607
|
+
sz: string;
|
|
608
|
+
timestamp: number;
|
|
609
|
+
user: `0x${string}`;
|
|
610
|
+
}, "Current state of a TWAP order.">]>;
|
|
611
|
+
export type TwapState = v.InferOutput<typeof TwapState>;
|
|
612
|
+
/**
|
|
613
|
+
* TWAP order status.
|
|
614
|
+
* - `finished`: Fully executed.
|
|
615
|
+
* - `activated`: Active and executing.
|
|
616
|
+
* - `terminated`: Terminated.
|
|
617
|
+
* - `error`: An error occurred.
|
|
618
|
+
*/
|
|
619
|
+
export declare const TwapStatus: v.SchemaWithPipe<readonly [v.UnionSchema<[v.StrictObjectSchema<{
|
|
620
|
+
/** Status of the TWAP order. */
|
|
621
|
+
readonly status: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"finished", undefined>, v.LiteralSchema<"activated", undefined>, v.LiteralSchema<"terminated", undefined>], undefined>, v.DescriptionAction<"finished" | "activated" | "terminated", "Status of the TWAP order.">]>;
|
|
622
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
623
|
+
/** Status of the TWAP order. */
|
|
624
|
+
readonly status: v.SchemaWithPipe<readonly [v.LiteralSchema<"error", undefined>, v.DescriptionAction<"error", "Status of the TWAP order.">]>;
|
|
625
|
+
/** Error message. */
|
|
626
|
+
readonly description: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Error message.">]>;
|
|
627
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
628
|
+
status: "finished" | "activated" | "terminated";
|
|
629
|
+
} | {
|
|
630
|
+
status: "error";
|
|
631
|
+
description: string;
|
|
632
|
+
}, string>]>;
|
|
633
|
+
export type TwapStatus = v.InferOutput<typeof TwapStatus>;
|
|
634
|
+
/** TWAP history record for a user. */
|
|
635
|
+
export declare const TwapHistory: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
636
|
+
/** Creation time of the history record (in seconds since epoch). */
|
|
637
|
+
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Creation time of the history record (in seconds since epoch).">]>;
|
|
638
|
+
/** State of the TWAP order. */
|
|
639
|
+
readonly state: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
640
|
+
/** Asset symbol. */
|
|
641
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
642
|
+
/** Executed notional value. */
|
|
643
|
+
readonly executedNtl: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Executed notional value.">]>;
|
|
644
|
+
/** Executed size. */
|
|
645
|
+
readonly executedSz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Executed size.">]>;
|
|
646
|
+
/** Duration in minutes. */
|
|
647
|
+
readonly minutes: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Duration in minutes.">]>;
|
|
648
|
+
/** Indicates if the TWAP randomizes execution. */
|
|
649
|
+
readonly randomize: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the TWAP randomizes execution.">]>;
|
|
650
|
+
/** Indicates if the order is reduce-only. */
|
|
651
|
+
readonly reduceOnly: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the order is reduce-only.">]>;
|
|
652
|
+
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
653
|
+
readonly side: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"B", undefined>, v.LiteralSchema<"A", undefined>], undefined>, v.DescriptionAction<"B" | "A", "Order side (\"B\" = Bid/Buy, \"A\" = Ask/Sell).">]>;
|
|
654
|
+
/** Order size. */
|
|
655
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Order size.">]>;
|
|
656
|
+
/** Start time of the TWAP order (in ms since epoch). */
|
|
657
|
+
readonly timestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Start time of the TWAP order (in ms since epoch).">]>;
|
|
658
|
+
/** User address. */
|
|
659
|
+
readonly user: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "User address.">]>;
|
|
660
|
+
}, undefined>, v.DescriptionAction<{
|
|
661
|
+
coin: string;
|
|
662
|
+
executedNtl: string;
|
|
663
|
+
executedSz: string;
|
|
664
|
+
minutes: number;
|
|
665
|
+
randomize: boolean;
|
|
666
|
+
reduceOnly: boolean;
|
|
667
|
+
side: "B" | "A";
|
|
668
|
+
sz: string;
|
|
669
|
+
timestamp: number;
|
|
670
|
+
user: `0x${string}`;
|
|
671
|
+
}, "Current state of a TWAP order.">]>, v.DescriptionAction<{
|
|
672
|
+
coin: string;
|
|
673
|
+
executedNtl: string;
|
|
674
|
+
executedSz: string;
|
|
675
|
+
minutes: number;
|
|
676
|
+
randomize: boolean;
|
|
677
|
+
reduceOnly: boolean;
|
|
678
|
+
side: "B" | "A";
|
|
679
|
+
sz: string;
|
|
680
|
+
timestamp: number;
|
|
681
|
+
user: `0x${string}`;
|
|
682
|
+
}, "State of the TWAP order.">]>;
|
|
683
|
+
/** Current status of the TWAP order. */
|
|
684
|
+
readonly status: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StrictObjectSchema<{
|
|
685
|
+
/** Status of the TWAP order. */
|
|
686
|
+
readonly status: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"finished", undefined>, v.LiteralSchema<"activated", undefined>, v.LiteralSchema<"terminated", undefined>], undefined>, v.DescriptionAction<"finished" | "activated" | "terminated", "Status of the TWAP order.">]>;
|
|
687
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
688
|
+
/** Status of the TWAP order. */
|
|
689
|
+
readonly status: v.SchemaWithPipe<readonly [v.LiteralSchema<"error", undefined>, v.DescriptionAction<"error", "Status of the TWAP order.">]>;
|
|
690
|
+
/** Error message. */
|
|
691
|
+
readonly description: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Error message.">]>;
|
|
692
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
693
|
+
status: "finished" | "activated" | "terminated";
|
|
694
|
+
} | {
|
|
695
|
+
status: "error";
|
|
696
|
+
description: string;
|
|
697
|
+
}, string>]>, v.DescriptionAction<{
|
|
698
|
+
status: "finished" | "activated" | "terminated";
|
|
699
|
+
} | {
|
|
700
|
+
status: "error";
|
|
701
|
+
description: string;
|
|
702
|
+
}, "Current status of the TWAP order.">]>;
|
|
703
|
+
}, undefined>, v.DescriptionAction<{
|
|
704
|
+
time: number;
|
|
705
|
+
state: {
|
|
706
|
+
coin: string;
|
|
707
|
+
executedNtl: string;
|
|
708
|
+
executedSz: string;
|
|
709
|
+
minutes: number;
|
|
710
|
+
randomize: boolean;
|
|
711
|
+
reduceOnly: boolean;
|
|
712
|
+
side: "B" | "A";
|
|
713
|
+
sz: string;
|
|
714
|
+
timestamp: number;
|
|
715
|
+
user: `0x${string}`;
|
|
716
|
+
};
|
|
717
|
+
status: {
|
|
718
|
+
status: "finished" | "activated" | "terminated";
|
|
719
|
+
} | {
|
|
720
|
+
status: "error";
|
|
721
|
+
description: string;
|
|
722
|
+
};
|
|
723
|
+
}, "TWAP history record for a user.">]>;
|
|
724
|
+
export type TwapHistory = v.InferOutput<typeof TwapHistory>;
|
|
725
|
+
/** TWAP slice fill details. */
|
|
726
|
+
export declare const TwapSliceFill: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
727
|
+
/** Fill details for the TWAP slice. */
|
|
728
|
+
readonly fill: v.SchemaWithPipe<readonly [Omit<v.StrictObjectSchema<{
|
|
729
|
+
/** Asset symbol. */
|
|
730
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
731
|
+
/** Price. */
|
|
732
|
+
readonly px: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Price.">]>;
|
|
733
|
+
/** Size. */
|
|
734
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Size.">]>;
|
|
735
|
+
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
736
|
+
readonly side: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"B", undefined>, v.LiteralSchema<"A", undefined>], undefined>, v.DescriptionAction<"B" | "A", "Order side (\"B\" = Bid/Buy, \"A\" = Ask/Sell).">]>;
|
|
737
|
+
/** Timestamp when the trade occurred (in ms since epoch). */
|
|
738
|
+
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the trade occurred (in ms since epoch).">]>;
|
|
739
|
+
/** Start position size. */
|
|
740
|
+
readonly startPosition: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Start position size.">]>;
|
|
741
|
+
/** Direction indicator for frontend display. */
|
|
742
|
+
readonly dir: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Direction indicator for frontend display.">]>;
|
|
743
|
+
/** Realized PnL. */
|
|
744
|
+
readonly closedPnl: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Realized PnL.">]>;
|
|
745
|
+
/** L1 transaction hash. */
|
|
746
|
+
readonly hash: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>]>, v.DescriptionAction<`0x${string}`, "L1 transaction hash.">]>;
|
|
747
|
+
/** Order ID. */
|
|
748
|
+
readonly oid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Order ID.">]>;
|
|
749
|
+
/** Indicates if the fill was a taker order. */
|
|
750
|
+
readonly crossed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the fill was a taker order.">]>;
|
|
751
|
+
/** Fee charged or rebate received (negative indicates rebate). */
|
|
752
|
+
readonly fee: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Fee charged or rebate received (negative indicates rebate).">]>;
|
|
753
|
+
/** Unique transaction identifier for a partial fill of an order. */
|
|
754
|
+
readonly tid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Unique transaction identifier for a partial fill of an order.">]>;
|
|
755
|
+
/** Client Order ID. */
|
|
756
|
+
readonly cloid: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 34, undefined>]>, undefined>, v.DescriptionAction<`0x${string}` | undefined, "Client Order ID.">]>;
|
|
757
|
+
/** Liquidation details. */
|
|
758
|
+
readonly liquidation: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
759
|
+
/** Address of the liquidated user. */
|
|
760
|
+
readonly liquidatedUser: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "Address of the liquidated user.">]>;
|
|
761
|
+
/** Mark price at the time of liquidation. */
|
|
762
|
+
readonly markPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Mark price at the time of liquidation.">]>;
|
|
763
|
+
/** Liquidation method. */
|
|
764
|
+
readonly method: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"market", undefined>, v.LiteralSchema<"backstop", undefined>], undefined>, v.DescriptionAction<"market" | "backstop", "Liquidation method.">]>;
|
|
765
|
+
}, undefined>, v.DescriptionAction<{
|
|
766
|
+
liquidatedUser: `0x${string}`;
|
|
767
|
+
markPx: string;
|
|
768
|
+
method: "market" | "backstop";
|
|
769
|
+
}, "Liquidation details for a trade fill.">]>, undefined>, v.DescriptionAction<{
|
|
770
|
+
liquidatedUser: `0x${string}`;
|
|
771
|
+
markPx: string;
|
|
772
|
+
method: "market" | "backstop";
|
|
773
|
+
} | undefined, "Liquidation details.">]>;
|
|
774
|
+
/** Token in which the fee is denominated (e.g., "USDC"). */
|
|
775
|
+
readonly feeToken: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Token in which the fee is denominated (e.g., \"USDC\").">]>;
|
|
776
|
+
/** ID of the TWAP. */
|
|
777
|
+
readonly twapId: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.NullSchema<undefined>], undefined>, v.DescriptionAction<number | null, "ID of the TWAP.">]>;
|
|
778
|
+
}, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
|
|
779
|
+
readonly entries: Omit<{
|
|
780
|
+
/** Asset symbol. */
|
|
781
|
+
readonly coin: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Asset symbol.">]>;
|
|
782
|
+
/** Price. */
|
|
783
|
+
readonly px: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Price.">]>;
|
|
784
|
+
/** Size. */
|
|
785
|
+
readonly sz: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Size.">]>;
|
|
786
|
+
/** Order side ("B" = Bid/Buy, "A" = Ask/Sell). */
|
|
787
|
+
readonly side: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"B", undefined>, v.LiteralSchema<"A", undefined>], undefined>, v.DescriptionAction<"B" | "A", "Order side (\"B\" = Bid/Buy, \"A\" = Ask/Sell).">]>;
|
|
788
|
+
/** Timestamp when the trade occurred (in ms since epoch). */
|
|
789
|
+
readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the trade occurred (in ms since epoch).">]>;
|
|
790
|
+
/** Start position size. */
|
|
791
|
+
readonly startPosition: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Start position size.">]>;
|
|
792
|
+
/** Direction indicator for frontend display. */
|
|
793
|
+
readonly dir: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Direction indicator for frontend display.">]>;
|
|
794
|
+
/** Realized PnL. */
|
|
795
|
+
readonly closedPnl: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Realized PnL.">]>;
|
|
796
|
+
/** L1 transaction hash. */
|
|
797
|
+
readonly hash: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>]>, v.DescriptionAction<`0x${string}`, "L1 transaction hash.">]>;
|
|
798
|
+
/** Order ID. */
|
|
799
|
+
readonly oid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Order ID.">]>;
|
|
800
|
+
/** Indicates if the fill was a taker order. */
|
|
801
|
+
readonly crossed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Indicates if the fill was a taker order.">]>;
|
|
802
|
+
/** Fee charged or rebate received (negative indicates rebate). */
|
|
803
|
+
readonly fee: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Fee charged or rebate received (negative indicates rebate).">]>;
|
|
804
|
+
/** Unique transaction identifier for a partial fill of an order. */
|
|
805
|
+
readonly tid: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Unique transaction identifier for a partial fill of an order.">]>;
|
|
806
|
+
/** Client Order ID. */
|
|
807
|
+
readonly cloid: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 34, undefined>]>, undefined>, v.DescriptionAction<`0x${string}` | undefined, "Client Order ID.">]>;
|
|
808
|
+
/** Liquidation details. */
|
|
809
|
+
readonly liquidation: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
810
|
+
/** Address of the liquidated user. */
|
|
811
|
+
readonly liquidatedUser: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "Address of the liquidated user.">]>;
|
|
812
|
+
/** Mark price at the time of liquidation. */
|
|
813
|
+
readonly markPx: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Mark price at the time of liquidation.">]>;
|
|
814
|
+
/** Liquidation method. */
|
|
815
|
+
readonly method: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"market", undefined>, v.LiteralSchema<"backstop", undefined>], undefined>, v.DescriptionAction<"market" | "backstop", "Liquidation method.">]>;
|
|
816
|
+
}, undefined>, v.DescriptionAction<{
|
|
817
|
+
liquidatedUser: `0x${string}`;
|
|
818
|
+
markPx: string;
|
|
819
|
+
method: "market" | "backstop";
|
|
820
|
+
}, "Liquidation details for a trade fill.">]>, undefined>, v.DescriptionAction<{
|
|
821
|
+
liquidatedUser: `0x${string}`;
|
|
822
|
+
markPx: string;
|
|
823
|
+
method: "market" | "backstop";
|
|
824
|
+
} | undefined, "Liquidation details.">]>;
|
|
825
|
+
/** Token in which the fee is denominated (e.g., "USDC"). */
|
|
826
|
+
readonly feeToken: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Token in which the fee is denominated (e.g., \"USDC\").">]>;
|
|
827
|
+
/** ID of the TWAP. */
|
|
828
|
+
readonly twapId: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.NullSchema<undefined>], undefined>, v.DescriptionAction<number | null, "ID of the TWAP.">]>;
|
|
829
|
+
}, "cloid" | "liquidation">;
|
|
830
|
+
readonly '~standard': v.StandardProps<{
|
|
831
|
+
time: number;
|
|
832
|
+
oid: number;
|
|
833
|
+
coin: string;
|
|
834
|
+
twapId: number | null;
|
|
835
|
+
hash: string;
|
|
836
|
+
fee: string;
|
|
837
|
+
feeToken: string;
|
|
838
|
+
px: string;
|
|
839
|
+
sz: string;
|
|
840
|
+
side: "B" | "A";
|
|
841
|
+
startPosition: string;
|
|
842
|
+
dir: string;
|
|
843
|
+
closedPnl: string;
|
|
844
|
+
crossed: boolean;
|
|
845
|
+
tid: number;
|
|
846
|
+
}, {
|
|
847
|
+
time: number;
|
|
848
|
+
oid: number;
|
|
849
|
+
coin: string;
|
|
850
|
+
twapId: number | null;
|
|
851
|
+
hash: `0x${string}`;
|
|
852
|
+
fee: string;
|
|
853
|
+
feeToken: string;
|
|
854
|
+
px: string;
|
|
855
|
+
sz: string;
|
|
856
|
+
side: "B" | "A";
|
|
857
|
+
startPosition: string;
|
|
858
|
+
dir: string;
|
|
859
|
+
closedPnl: string;
|
|
860
|
+
crossed: boolean;
|
|
861
|
+
tid: number;
|
|
862
|
+
}>;
|
|
863
|
+
readonly '~run': (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
864
|
+
time: number;
|
|
865
|
+
oid: number;
|
|
866
|
+
coin: string;
|
|
867
|
+
twapId: number | null;
|
|
868
|
+
hash: `0x${string}`;
|
|
869
|
+
fee: string;
|
|
870
|
+
feeToken: string;
|
|
871
|
+
px: string;
|
|
872
|
+
sz: string;
|
|
873
|
+
side: "B" | "A";
|
|
874
|
+
startPosition: string;
|
|
875
|
+
dir: string;
|
|
876
|
+
closedPnl: string;
|
|
877
|
+
crossed: boolean;
|
|
878
|
+
tid: number;
|
|
879
|
+
}, v.StringIssue | v.RegexIssue<string> | v.StrictObjectIssue | v.LengthIssue<`0x${string}`, 66> | v.LiteralIssue | v.UnionIssue<v.LiteralIssue> | v.NumberIssue | v.SafeIntegerIssue<number> | v.MinValueIssue<number, 0> | v.BooleanIssue | v.NullIssue | v.UnionIssue<v.NumberIssue | v.SafeIntegerIssue<number> | v.MinValueIssue<number, 0> | v.NullIssue>>;
|
|
880
|
+
readonly '~types'?: {
|
|
881
|
+
readonly input: {
|
|
882
|
+
time: number;
|
|
883
|
+
oid: number;
|
|
884
|
+
coin: string;
|
|
885
|
+
twapId: number | null;
|
|
886
|
+
hash: string;
|
|
887
|
+
fee: string;
|
|
888
|
+
feeToken: string;
|
|
889
|
+
px: string;
|
|
890
|
+
sz: string;
|
|
891
|
+
side: "B" | "A";
|
|
892
|
+
startPosition: string;
|
|
893
|
+
dir: string;
|
|
894
|
+
closedPnl: string;
|
|
895
|
+
crossed: boolean;
|
|
896
|
+
tid: number;
|
|
897
|
+
};
|
|
898
|
+
readonly output: {
|
|
899
|
+
time: number;
|
|
900
|
+
oid: number;
|
|
901
|
+
coin: string;
|
|
902
|
+
twapId: number | null;
|
|
903
|
+
hash: `0x${string}`;
|
|
904
|
+
fee: string;
|
|
905
|
+
feeToken: string;
|
|
906
|
+
px: string;
|
|
907
|
+
sz: string;
|
|
908
|
+
side: "B" | "A";
|
|
909
|
+
startPosition: string;
|
|
910
|
+
dir: string;
|
|
911
|
+
closedPnl: string;
|
|
912
|
+
crossed: boolean;
|
|
913
|
+
tid: number;
|
|
914
|
+
};
|
|
915
|
+
readonly issue: v.StringIssue | v.RegexIssue<string> | v.StrictObjectIssue | v.LengthIssue<`0x${string}`, 66> | v.LiteralIssue | v.UnionIssue<v.LiteralIssue> | v.NumberIssue | v.SafeIntegerIssue<number> | v.MinValueIssue<number, 0> | v.BooleanIssue | v.NullIssue | v.UnionIssue<v.NumberIssue | v.SafeIntegerIssue<number> | v.MinValueIssue<number, 0> | v.NullIssue>;
|
|
916
|
+
} | undefined;
|
|
917
|
+
}, v.DescriptionAction<{
|
|
918
|
+
time: number;
|
|
919
|
+
oid: number;
|
|
920
|
+
coin: string;
|
|
921
|
+
twapId: number | null;
|
|
922
|
+
hash: `0x${string}`;
|
|
923
|
+
fee: string;
|
|
924
|
+
feeToken: string;
|
|
925
|
+
px: string;
|
|
926
|
+
sz: string;
|
|
927
|
+
side: "B" | "A";
|
|
928
|
+
startPosition: string;
|
|
929
|
+
dir: string;
|
|
930
|
+
closedPnl: string;
|
|
931
|
+
crossed: boolean;
|
|
932
|
+
tid: number;
|
|
933
|
+
}, "Fill details for the TWAP slice.">]>;
|
|
934
|
+
/** ID of the TWAP. */
|
|
935
|
+
readonly twapId: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "ID of the TWAP.">]>;
|
|
936
|
+
}, undefined>, v.DescriptionAction<{
|
|
937
|
+
fill: {
|
|
938
|
+
time: number;
|
|
939
|
+
oid: number;
|
|
940
|
+
coin: string;
|
|
941
|
+
twapId: number | null;
|
|
942
|
+
hash: `0x${string}`;
|
|
943
|
+
fee: string;
|
|
944
|
+
feeToken: string;
|
|
945
|
+
px: string;
|
|
946
|
+
sz: string;
|
|
947
|
+
side: "B" | "A";
|
|
948
|
+
startPosition: string;
|
|
949
|
+
dir: string;
|
|
950
|
+
closedPnl: string;
|
|
951
|
+
crossed: boolean;
|
|
952
|
+
tid: number;
|
|
953
|
+
};
|
|
954
|
+
twapId: number;
|
|
955
|
+
}, "TWAP slice fill details.">]>;
|
|
956
|
+
export type TwapSliceFill = v.InferOutput<typeof TwapSliceFill>;
|
|
957
|
+
//# sourceMappingURL=orders.d.ts.map
|