@nktkas/hyperliquid 0.25.0-beta.1 → 0.25.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -14
- package/esm/mod.js +1 -0
- package/esm/mod.js.map +1 -0
- package/esm/src/clients/exchange.d.ts +0 -7
- package/esm/src/clients/exchange.d.ts.map +1 -1
- package/esm/src/clients/exchange.js +4 -5
- package/esm/src/clients/exchange.js.map +1 -0
- package/esm/src/clients/info.d.ts +64 -2
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +77 -1
- package/esm/src/clients/info.js.map +1 -0
- package/esm/src/clients/multiSign.js +2 -1
- package/esm/src/clients/multiSign.js.map +1 -0
- package/esm/src/clients/subscription.js +1 -0
- package/esm/src/clients/subscription.js.map +1 -0
- package/esm/src/errors.js +1 -0
- package/esm/src/errors.js.map +1 -0
- package/esm/src/schemas/_base.d.ts +6 -2
- package/esm/src/schemas/_base.d.ts.map +1 -1
- package/esm/src/schemas/_base.js +4 -1
- package/esm/src/schemas/_base.js.map +1 -0
- package/esm/src/schemas/exchange/requests.d.ts +284 -284
- package/esm/src/schemas/exchange/requests.js +260 -259
- package/esm/src/schemas/exchange/requests.js.map +1 -0
- package/esm/src/schemas/exchange/responses.d.ts +47 -47
- package/esm/src/schemas/exchange/responses.js +55 -54
- package/esm/src/schemas/exchange/responses.js.map +1 -0
- package/esm/src/schemas/explorer/requests.d.ts +3 -3
- package/esm/src/schemas/explorer/requests.js +6 -5
- package/esm/src/schemas/explorer/requests.js.map +1 -0
- package/esm/src/schemas/explorer/responses.d.ts +10 -10
- package/esm/src/schemas/explorer/responses.js +12 -11
- package/esm/src/schemas/explorer/responses.js.map +1 -0
- package/esm/src/schemas/info/accounts.d.ts +121 -121
- package/esm/src/schemas/info/accounts.js +110 -109
- package/esm/src/schemas/info/accounts.js.map +1 -0
- package/esm/src/schemas/info/assets.d.ts +68 -39
- package/esm/src/schemas/info/assets.d.ts.map +1 -1
- package/esm/src/schemas/info/assets.js +69 -49
- package/esm/src/schemas/info/assets.js.map +1 -0
- package/esm/src/schemas/info/markets.d.ts +25 -8
- package/esm/src/schemas/info/markets.d.ts.map +1 -1
- package/esm/src/schemas/info/markets.js +27 -15
- package/esm/src/schemas/info/markets.js.map +1 -0
- package/esm/src/schemas/info/orders.d.ts +56 -56
- package/esm/src/schemas/info/orders.js +37 -36
- package/esm/src/schemas/info/orders.js.map +1 -0
- package/esm/src/schemas/info/requests.d.ts +98 -56
- package/esm/src/schemas/info/requests.d.ts.map +1 -1
- package/esm/src/schemas/info/requests.js +103 -71
- package/esm/src/schemas/info/requests.js.map +1 -0
- package/esm/src/schemas/info/validators.d.ts +44 -23
- package/esm/src/schemas/info/validators.d.ts.map +1 -1
- package/esm/src/schemas/info/validators.js +40 -26
- package/esm/src/schemas/info/validators.js.map +1 -0
- package/esm/src/schemas/info/vaults.d.ts +40 -40
- package/esm/src/schemas/info/vaults.js +20 -19
- package/esm/src/schemas/info/vaults.js.map +1 -0
- package/esm/src/schemas/mod.d.ts +1 -0
- package/esm/src/schemas/mod.d.ts.map +1 -1
- package/esm/src/schemas/mod.js +2 -0
- package/esm/src/schemas/mod.js.map +1 -0
- package/esm/src/schemas/subscriptions/requests.d.ts +21 -21
- package/esm/src/schemas/subscriptions/requests.js +22 -21
- package/esm/src/schemas/subscriptions/requests.js.map +1 -0
- package/esm/src/schemas/subscriptions/responses.d.ts +192 -192
- package/esm/src/schemas/subscriptions/responses.js +41 -40
- package/esm/src/schemas/subscriptions/responses.js.map +1 -0
- package/esm/src/signing/_signTypedData/ethers.js +1 -0
- package/esm/src/signing/_signTypedData/ethers.js.map +1 -0
- package/esm/src/signing/_signTypedData/mod.js +1 -0
- package/esm/src/signing/_signTypedData/mod.js.map +1 -0
- package/esm/src/signing/_signTypedData/private_key.js +1 -0
- package/esm/src/signing/_signTypedData/private_key.js.map +1 -0
- package/esm/src/signing/_signTypedData/viem.js +1 -0
- package/esm/src/signing/_signTypedData/viem.js.map +1 -0
- package/esm/src/signing/mod.js +1 -0
- package/esm/src/signing/mod.js.map +1 -0
- 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 +1 -0
- package/esm/src/transports/base.js.map +1 -0
- package/esm/src/transports/http/http_transport.d.ts +1 -1
- package/esm/src/transports/http/http_transport.js +1 -0
- package/esm/src/transports/http/http_transport.js.map +1 -0
- package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -0
- package/esm/src/transports/websocket/_hyperliquid_event_target.js.map +1 -0
- package/esm/src/transports/websocket/_reconnecting_websocket.js +1 -0
- package/esm/src/transports/websocket/_reconnecting_websocket.js.map +1 -0
- package/esm/src/transports/websocket/_websocket_async_request.js +1 -0
- package/esm/src/transports/websocket/_websocket_async_request.js.map +1 -0
- package/esm/src/transports/websocket/websocket_transport.d.ts +7 -0
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.js +4 -0
- package/esm/src/transports/websocket/websocket_transport.js.map +1 -0
- package/package.json +1 -1
- package/script/mod.js +1 -0
- package/script/mod.js.map +1 -0
- package/script/src/clients/exchange.d.ts +0 -7
- package/script/src/clients/exchange.d.ts.map +1 -1
- package/script/src/clients/exchange.js +4 -5
- package/script/src/clients/exchange.js.map +1 -0
- package/script/src/clients/info.d.ts +64 -2
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +76 -0
- package/script/src/clients/info.js.map +1 -0
- package/script/src/clients/multiSign.js +2 -1
- package/script/src/clients/multiSign.js.map +1 -0
- package/script/src/clients/subscription.js +1 -0
- package/script/src/clients/subscription.js.map +1 -0
- package/script/src/errors.js +1 -0
- package/script/src/errors.js.map +1 -0
- package/script/src/schemas/_base.d.ts +6 -2
- package/script/src/schemas/_base.d.ts.map +1 -1
- package/script/src/schemas/_base.js +5 -2
- package/script/src/schemas/_base.js.map +1 -0
- package/script/src/schemas/exchange/requests.d.ts +284 -284
- package/script/src/schemas/exchange/requests.js +259 -258
- package/script/src/schemas/exchange/requests.js.map +1 -0
- package/script/src/schemas/exchange/responses.d.ts +47 -47
- package/script/src/schemas/exchange/responses.js +54 -53
- package/script/src/schemas/exchange/responses.js.map +1 -0
- package/script/src/schemas/explorer/requests.d.ts +3 -3
- package/script/src/schemas/explorer/requests.js +5 -4
- package/script/src/schemas/explorer/requests.js.map +1 -0
- package/script/src/schemas/explorer/responses.d.ts +10 -10
- package/script/src/schemas/explorer/responses.js +11 -10
- package/script/src/schemas/explorer/responses.js.map +1 -0
- package/script/src/schemas/info/accounts.d.ts +121 -121
- package/script/src/schemas/info/accounts.js +109 -108
- package/script/src/schemas/info/accounts.js.map +1 -0
- package/script/src/schemas/info/assets.d.ts +68 -39
- package/script/src/schemas/info/assets.d.ts.map +1 -1
- package/script/src/schemas/info/assets.js +69 -49
- package/script/src/schemas/info/assets.js.map +1 -0
- package/script/src/schemas/info/markets.d.ts +25 -8
- package/script/src/schemas/info/markets.d.ts.map +1 -1
- package/script/src/schemas/info/markets.js +27 -15
- package/script/src/schemas/info/markets.js.map +1 -0
- package/script/src/schemas/info/orders.d.ts +56 -56
- package/script/src/schemas/info/orders.js +36 -35
- package/script/src/schemas/info/orders.js.map +1 -0
- package/script/src/schemas/info/requests.d.ts +98 -56
- package/script/src/schemas/info/requests.d.ts.map +1 -1
- package/script/src/schemas/info/requests.js +103 -71
- package/script/src/schemas/info/requests.js.map +1 -0
- package/script/src/schemas/info/validators.d.ts +44 -23
- package/script/src/schemas/info/validators.d.ts.map +1 -1
- package/script/src/schemas/info/validators.js +40 -26
- package/script/src/schemas/info/validators.js.map +1 -0
- package/script/src/schemas/info/vaults.d.ts +40 -40
- package/script/src/schemas/info/vaults.js +19 -18
- package/script/src/schemas/info/vaults.js.map +1 -0
- package/script/src/schemas/mod.d.ts +1 -0
- package/script/src/schemas/mod.d.ts.map +1 -1
- package/script/src/schemas/mod.js +4 -1
- package/script/src/schemas/mod.js.map +1 -0
- package/script/src/schemas/subscriptions/requests.d.ts +21 -21
- package/script/src/schemas/subscriptions/requests.js +22 -21
- package/script/src/schemas/subscriptions/requests.js.map +1 -0
- package/script/src/schemas/subscriptions/responses.d.ts +192 -192
- package/script/src/schemas/subscriptions/responses.js +40 -39
- package/script/src/schemas/subscriptions/responses.js.map +1 -0
- package/script/src/signing/_signTypedData/ethers.js +1 -0
- package/script/src/signing/_signTypedData/ethers.js.map +1 -0
- package/script/src/signing/_signTypedData/mod.js +1 -0
- package/script/src/signing/_signTypedData/mod.js.map +1 -0
- package/script/src/signing/_signTypedData/private_key.js +1 -0
- package/script/src/signing/_signTypedData/private_key.js.map +1 -0
- package/script/src/signing/_signTypedData/viem.js +1 -0
- package/script/src/signing/_signTypedData/viem.js.map +1 -0
- package/script/src/signing/mod.js +1 -0
- package/script/src/signing/mod.js.map +1 -0
- 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 +1 -0
- package/script/src/transports/base.js.map +1 -0
- package/script/src/transports/http/http_transport.d.ts +1 -1
- package/script/src/transports/http/http_transport.js +1 -0
- package/script/src/transports/http/http_transport.js.map +1 -0
- package/script/src/transports/websocket/_hyperliquid_event_target.js +1 -0
- package/script/src/transports/websocket/_hyperliquid_event_target.js.map +1 -0
- package/script/src/transports/websocket/_reconnecting_websocket.js +1 -0
- package/script/src/transports/websocket/_reconnecting_websocket.js.map +1 -0
- package/script/src/transports/websocket/_websocket_async_request.js +1 -0
- package/script/src/transports/websocket/_websocket_async_request.js.map +1 -0
- package/script/src/transports/websocket/websocket_transport.d.ts +7 -0
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.js +4 -0
- package/script/src/transports/websocket/websocket_transport.js.map +1 -0
- package/src/mod.ts +28 -0
- package/src/src/clients/exchange.ts +2246 -0
- package/src/src/clients/info.ts +2076 -0
- package/src/src/clients/multiSign.ts +183 -0
- package/src/src/clients/subscription.ts +841 -0
- package/src/src/errors.ts +7 -0
- package/src/src/schemas/_base.ts +43 -0
- package/src/src/schemas/exchange/requests.ts +3057 -0
- package/src/src/schemas/exchange/responses.ts +540 -0
- package/src/src/schemas/explorer/requests.ts +65 -0
- package/src/src/schemas/explorer/responses.ts +138 -0
- package/src/src/schemas/info/accounts.ts +1490 -0
- package/src/src/schemas/info/assets.ts +693 -0
- package/src/src/schemas/info/markets.ts +171 -0
- package/src/src/schemas/info/orders.ts +597 -0
- package/src/src/schemas/info/requests.ts +1369 -0
- package/src/src/schemas/info/validators.ts +299 -0
- package/src/src/schemas/info/vaults.ts +262 -0
- package/src/src/schemas/mod.ts +121 -0
- package/src/src/schemas/subscriptions/requests.ts +504 -0
- package/src/src/schemas/subscriptions/responses.ts +576 -0
- package/src/src/signing/_signTypedData/ethers.ts +59 -0
- package/src/src/signing/_signTypedData/mod.ts +121 -0
- package/src/src/signing/_signTypedData/private_key.ts +229 -0
- package/src/src/signing/_signTypedData/viem.ts +55 -0
- package/src/src/signing/mod.ts +572 -0
- package/src/src/transports/base.ts +54 -0
- package/src/src/transports/http/http_transport.ts +208 -0
- package/src/src/transports/websocket/_hyperliquid_event_target.ts +118 -0
- package/src/src/transports/websocket/_reconnecting_websocket.ts +404 -0
- package/src/src/transports/websocket/_websocket_async_request.ts +229 -0
- package/src/src/transports/websocket/websocket_transport.ts +394 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import { Hex, TokenId, UnsignedDecimal } from "../_base.js";
|
|
2
|
+
import { Hex, TokenId, UnsignedDecimal, UnsignedInteger } from "../_base.js";
|
|
3
3
|
/** Deeply removes undefined keys from an object. */
|
|
4
4
|
function removeUndefinedKeys(obj) {
|
|
5
5
|
if (typeof obj !== "object" || obj === null) {
|
|
@@ -19,7 +19,7 @@ function removeUndefinedKeys(obj) {
|
|
|
19
19
|
}
|
|
20
20
|
const Percent = v.pipe(v.string(), v.regex(/^[0-9]+(\.[0-9]+)?%$/), v.transform((value) => value));
|
|
21
21
|
/** ECDSA signature components for Ethereum typed data. */
|
|
22
|
-
export const Signature = v.pipe(v.
|
|
22
|
+
export const Signature = v.pipe(v.object({
|
|
23
23
|
/** First 32-byte component of ECDSA signature. */
|
|
24
24
|
r: v.pipe(v.pipe(Hex, v.length(66), v.transform((value) => value.replace(/^0x0+/, "0x"))), v.description("First 32-byte component of ECDSA signature.")),
|
|
25
25
|
/** Second 32-byte component of ECDSA signature. */
|
|
@@ -28,9 +28,9 @@ export const Signature = v.pipe(v.strictObject({
|
|
|
28
28
|
v: v.pipe(v.union([v.literal(27), v.literal(28)]), v.description("Recovery identifier.")),
|
|
29
29
|
}), v.description("ECDSA signature components for Ethereum typed data."));
|
|
30
30
|
/** Order parameters. */
|
|
31
|
-
export const OrderParams = v.pipe(v.
|
|
31
|
+
export const OrderParams = v.pipe(v.object({
|
|
32
32
|
/** Asset ID. */
|
|
33
|
-
a: v.pipe(
|
|
33
|
+
a: v.pipe(UnsignedInteger, v.description("Asset ID.")),
|
|
34
34
|
/** Position side (`true` for long, `false` for short). */
|
|
35
35
|
b: v.pipe(v.boolean(), v.description("Position side (`true` for long, `false` for short).")),
|
|
36
36
|
/** Price. */
|
|
@@ -41,9 +41,9 @@ export const OrderParams = v.pipe(v.strictObject({
|
|
|
41
41
|
r: v.pipe(v.boolean(), v.description("Is reduce-only?")),
|
|
42
42
|
/** Order type. */
|
|
43
43
|
t: v.pipe(v.union([
|
|
44
|
-
v.
|
|
44
|
+
v.object({
|
|
45
45
|
/** Limit order parameters. */
|
|
46
|
-
limit: v.pipe(v.
|
|
46
|
+
limit: v.pipe(v.object({
|
|
47
47
|
/** Time-in-force. */
|
|
48
48
|
tif: v.pipe(v.union([
|
|
49
49
|
v.literal("Gtc"),
|
|
@@ -54,9 +54,9 @@ export const OrderParams = v.pipe(v.strictObject({
|
|
|
54
54
|
]), v.description("Time-in-force.")),
|
|
55
55
|
}), v.description("Limit order parameters.")),
|
|
56
56
|
}),
|
|
57
|
-
v.
|
|
57
|
+
v.object({
|
|
58
58
|
/** Trigger order parameters. */
|
|
59
|
-
trigger: v.pipe(v.
|
|
59
|
+
trigger: v.pipe(v.object({
|
|
60
60
|
/** Is market order? */
|
|
61
61
|
isMarket: v.pipe(v.boolean(), v.description("Is market order?")),
|
|
62
62
|
/** Trigger price. */
|
|
@@ -74,9 +74,9 @@ export const OrderParams = v.pipe(v.strictObject({
|
|
|
74
74
|
* @returns {SuccessResponse}
|
|
75
75
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-an-api-wallet
|
|
76
76
|
*/
|
|
77
|
-
export const ApproveAgentRequest = v.pipe(v.
|
|
77
|
+
export const ApproveAgentRequest = v.pipe(v.object({
|
|
78
78
|
/** Action to perform. */
|
|
79
|
-
action: v.pipe(v.
|
|
79
|
+
action: v.pipe(v.object({
|
|
80
80
|
/** Type of action. */
|
|
81
81
|
type: v.pipe(v.literal("approveAgent"), v.description("Type of action.")),
|
|
82
82
|
/** Chain ID used for signing. */
|
|
@@ -88,10 +88,10 @@ export const ApproveAgentRequest = v.pipe(v.strictObject({
|
|
|
88
88
|
/** Agent name or null for unnamed agent. */
|
|
89
89
|
agentName: v.pipe(v.nullable(v.string()), v.description("Agent name or null for unnamed agent.")),
|
|
90
90
|
/** Unique request identifier (current timestamp in ms). */
|
|
91
|
-
nonce: v.pipe(
|
|
91
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
92
92
|
}), v.description("Action to perform.")),
|
|
93
93
|
/** Unique request identifier (current timestamp in ms). */
|
|
94
|
-
nonce: v.pipe(
|
|
94
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
95
95
|
/** Cryptographic signature. */
|
|
96
96
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
97
97
|
}), v.transform(removeUndefinedKeys), v.description("Approve an agent to sign on behalf of the master account."));
|
|
@@ -100,9 +100,9 @@ export const ApproveAgentRequest = v.pipe(v.strictObject({
|
|
|
100
100
|
* @returns {SuccessResponse}
|
|
101
101
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-a-builder-fee
|
|
102
102
|
*/
|
|
103
|
-
export const ApproveBuilderFeeRequest = v.pipe(v.
|
|
103
|
+
export const ApproveBuilderFeeRequest = v.pipe(v.object({
|
|
104
104
|
/** Action to perform. */
|
|
105
|
-
action: v.pipe(v.
|
|
105
|
+
action: v.pipe(v.object({
|
|
106
106
|
/** Type of action. */
|
|
107
107
|
type: v.pipe(v.literal("approveBuilderFee"), v.description("Type of action.")),
|
|
108
108
|
/** Chain ID used for signing. */
|
|
@@ -114,10 +114,10 @@ export const ApproveBuilderFeeRequest = v.pipe(v.strictObject({
|
|
|
114
114
|
/** Builder address. */
|
|
115
115
|
builder: v.pipe(v.pipe(Hex, v.length(42)), v.description("Builder address.")),
|
|
116
116
|
/** Unique request identifier (current timestamp in ms). */
|
|
117
|
-
nonce: v.pipe(
|
|
117
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
118
118
|
}), v.description("Action to perform.")),
|
|
119
119
|
/** Unique request identifier (current timestamp in ms). */
|
|
120
|
-
nonce: v.pipe(
|
|
120
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
121
121
|
/** Cryptographic signature. */
|
|
122
122
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
123
123
|
}), v.transform(removeUndefinedKeys), v.description("Approve a maximum fee rate for a builder."));
|
|
@@ -126,16 +126,16 @@ export const ApproveBuilderFeeRequest = v.pipe(v.strictObject({
|
|
|
126
126
|
* @returns {OrderResponse}
|
|
127
127
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
|
|
128
128
|
*/
|
|
129
|
-
export const BatchModifyRequest = v.pipe(v.
|
|
129
|
+
export const BatchModifyRequest = v.pipe(v.object({
|
|
130
130
|
/** Action to perform. */
|
|
131
|
-
action: v.pipe(v.
|
|
131
|
+
action: v.pipe(v.object({
|
|
132
132
|
/** Type of action. */
|
|
133
133
|
type: v.pipe(v.literal("batchModify"), v.description("Type of action.")),
|
|
134
134
|
/** Order modifications. */
|
|
135
|
-
modifies: v.pipe(v.array(v.
|
|
135
|
+
modifies: v.pipe(v.array(v.object({
|
|
136
136
|
/** Order ID or Client Order ID. */
|
|
137
137
|
oid: v.pipe(v.union([
|
|
138
|
-
|
|
138
|
+
UnsignedInteger,
|
|
139
139
|
v.pipe(Hex, v.length(34)),
|
|
140
140
|
]), v.description("Order ID or Client Order ID.")),
|
|
141
141
|
/** New order parameters. */
|
|
@@ -143,76 +143,76 @@ export const BatchModifyRequest = v.pipe(v.strictObject({
|
|
|
143
143
|
})), v.description("Order modifications.")),
|
|
144
144
|
}), v.description("Action to perform.")),
|
|
145
145
|
/** Unique request identifier (current timestamp in ms). */
|
|
146
|
-
nonce: v.pipe(
|
|
146
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
147
147
|
/** Cryptographic signature. */
|
|
148
148
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
149
149
|
/** Vault address (for vault trading). */
|
|
150
150
|
vaultAddress: v.pipe(v.optional(v.pipe(Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
151
151
|
/** Expiration time of the action. */
|
|
152
|
-
expiresAfter: v.pipe(v.optional(
|
|
152
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
153
153
|
}), v.transform(removeUndefinedKeys), v.description("Modify multiple orders."));
|
|
154
154
|
/**
|
|
155
155
|
* Cancel order(s).
|
|
156
156
|
* @returns {CancelResponse}
|
|
157
157
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
158
158
|
*/
|
|
159
|
-
export const CancelRequest = v.pipe(v.
|
|
159
|
+
export const CancelRequest = v.pipe(v.object({
|
|
160
160
|
/** Action to perform. */
|
|
161
|
-
action: v.pipe(v.
|
|
161
|
+
action: v.pipe(v.object({
|
|
162
162
|
/** Type of action. */
|
|
163
163
|
type: v.pipe(v.literal("cancel"), v.description("Type of action.")),
|
|
164
164
|
/** Orders to cancel. */
|
|
165
|
-
cancels: v.pipe(v.array(v.
|
|
165
|
+
cancels: v.pipe(v.array(v.object({
|
|
166
166
|
/** Asset ID. */
|
|
167
|
-
a: v.pipe(
|
|
167
|
+
a: v.pipe(UnsignedInteger, v.description("Asset ID.")),
|
|
168
168
|
/** Order ID. */
|
|
169
|
-
o: v.pipe(
|
|
169
|
+
o: v.pipe(UnsignedInteger, v.description("Order ID.")),
|
|
170
170
|
})), v.description("Orders to cancel.")),
|
|
171
171
|
}), v.description("Action to perform.")),
|
|
172
172
|
/** Unique request identifier (current timestamp in ms). */
|
|
173
|
-
nonce: v.pipe(
|
|
173
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
174
174
|
/** Cryptographic signature. */
|
|
175
175
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
176
176
|
/** Vault address (for vault trading). */
|
|
177
177
|
vaultAddress: v.pipe(v.optional(v.pipe(Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
178
178
|
/** Expiration time of the action. */
|
|
179
|
-
expiresAfter: v.pipe(v.optional(
|
|
179
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
180
180
|
}), v.transform(removeUndefinedKeys), v.description("Cancel order(s)."));
|
|
181
181
|
/**
|
|
182
182
|
* Cancel order(s) by cloid.
|
|
183
183
|
* @returns {CancelResponse}
|
|
184
184
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
185
185
|
*/
|
|
186
|
-
export const CancelByCloidRequest = v.pipe(v.
|
|
186
|
+
export const CancelByCloidRequest = v.pipe(v.object({
|
|
187
187
|
/** Action to perform. */
|
|
188
|
-
action: v.pipe(v.
|
|
188
|
+
action: v.pipe(v.object({
|
|
189
189
|
/** Type of action. */
|
|
190
190
|
type: v.pipe(v.literal("cancelByCloid"), v.description("Type of action.")),
|
|
191
191
|
/** Orders to cancel. */
|
|
192
|
-
cancels: v.pipe(v.array(v.
|
|
192
|
+
cancels: v.pipe(v.array(v.object({
|
|
193
193
|
/** Asset ID. */
|
|
194
|
-
asset: v.pipe(
|
|
194
|
+
asset: v.pipe(UnsignedInteger, v.description("Asset ID.")),
|
|
195
195
|
/** Client Order ID. */
|
|
196
196
|
cloid: v.pipe(v.pipe(Hex, v.length(34)), v.description("Client Order ID.")),
|
|
197
197
|
})), v.description("Orders to cancel.")),
|
|
198
198
|
}), v.description("Action to perform.")),
|
|
199
199
|
/** Unique request identifier (current timestamp in ms). */
|
|
200
|
-
nonce: v.pipe(
|
|
200
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
201
201
|
/** Cryptographic signature. */
|
|
202
202
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
203
203
|
/** Vault address (for vault trading). */
|
|
204
204
|
vaultAddress: v.pipe(v.optional(v.pipe(Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
205
205
|
/** Expiration time of the action. */
|
|
206
|
-
expiresAfter: v.pipe(v.optional(
|
|
206
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
207
207
|
}), v.transform(removeUndefinedKeys), v.description("Cancel order(s) by cloid."));
|
|
208
208
|
/**
|
|
209
209
|
* Transfer native token from the user spot account into staking for delegating to validators.
|
|
210
210
|
* @returns {SuccessResponse}
|
|
211
211
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-into-staking
|
|
212
212
|
*/
|
|
213
|
-
export const CDepositRequest = v.pipe(v.
|
|
213
|
+
export const CDepositRequest = v.pipe(v.object({
|
|
214
214
|
/** Action to perform. */
|
|
215
|
-
action: v.pipe(v.
|
|
215
|
+
action: v.pipe(v.object({
|
|
216
216
|
/** Type of action. */
|
|
217
217
|
type: v.pipe(v.literal("cDeposit"), v.description("Type of action.")),
|
|
218
218
|
/** Chain ID used for signing. */
|
|
@@ -220,12 +220,12 @@ export const CDepositRequest = v.pipe(v.strictObject({
|
|
|
220
220
|
/** HyperLiquid network. */
|
|
221
221
|
hyperliquidChain: v.pipe(v.union([v.literal("Mainnet"), v.literal("Testnet")]), v.description("HyperLiquid network.")),
|
|
222
222
|
/** Amount of wei to deposit into staking balance (float * 1e8). */
|
|
223
|
-
wei: v.pipe(
|
|
223
|
+
wei: v.pipe(UnsignedInteger, v.description("Amount of wei to deposit into staking balance (float * 1e8).")),
|
|
224
224
|
/** Unique request identifier (current timestamp in ms). */
|
|
225
|
-
nonce: v.pipe(
|
|
225
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
226
226
|
}), v.description("Action to perform.")),
|
|
227
227
|
/** Unique request identifier (current timestamp in ms). */
|
|
228
|
-
nonce: v.pipe(
|
|
228
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
229
229
|
/** Cryptographic signature. */
|
|
230
230
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
231
231
|
}), v.transform(removeUndefinedKeys), v.description("Transfer native token from the user spot account into staking for delegating to validators."));
|
|
@@ -234,26 +234,26 @@ export const CDepositRequest = v.pipe(v.strictObject({
|
|
|
234
234
|
* @returns {SuccessResponse}
|
|
235
235
|
* @see null
|
|
236
236
|
*/
|
|
237
|
-
export const ClaimRewardsRequest = v.pipe(v.
|
|
237
|
+
export const ClaimRewardsRequest = v.pipe(v.object({
|
|
238
238
|
/** Action to perform. */
|
|
239
|
-
action: v.pipe(v.
|
|
239
|
+
action: v.pipe(v.object({
|
|
240
240
|
/** Type of action. */
|
|
241
241
|
type: v.pipe(v.literal("claimRewards"), v.description("Type of action.")),
|
|
242
242
|
}), v.description("Action to perform.")),
|
|
243
243
|
/** Unique request identifier (current timestamp in ms). */
|
|
244
|
-
nonce: v.pipe(
|
|
244
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
245
245
|
/** Cryptographic signature. */
|
|
246
246
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
247
247
|
/** Expiration time of the action. */
|
|
248
|
-
expiresAfter: v.pipe(v.optional(
|
|
248
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
249
249
|
}), v.transform(removeUndefinedKeys), v.description("Claim rewards from referral program."));
|
|
250
250
|
/** Signers configuration for {@linkcode ConvertToMultiSigUserRequest}. */
|
|
251
251
|
export const ConvertToMultiSigUserRequestSigners = v.pipe(v.union([
|
|
252
|
-
v.
|
|
252
|
+
v.object({
|
|
253
253
|
/** List of authorized user addresses. */
|
|
254
254
|
authorizedUsers: v.pipe(v.array(v.pipe(Hex, v.length(42))), v.description("List of authorized user addresses.")),
|
|
255
255
|
/** Minimum number of signatures required. */
|
|
256
|
-
threshold: v.pipe(
|
|
256
|
+
threshold: v.pipe(UnsignedInteger, v.description("Minimum number of signatures required.")),
|
|
257
257
|
}),
|
|
258
258
|
/** Convert a multi-signature account to a single-signature account. */
|
|
259
259
|
v.pipe(v.null(), v.description("Convert a multi-signature account to a single-signature account.")),
|
|
@@ -263,9 +263,9 @@ export const ConvertToMultiSigUserRequestSigners = v.pipe(v.union([
|
|
|
263
263
|
* @returns {SuccessResponse}
|
|
264
264
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/multi-sig
|
|
265
265
|
*/
|
|
266
|
-
export const ConvertToMultiSigUserRequest = v.pipe(v.
|
|
266
|
+
export const ConvertToMultiSigUserRequest = v.pipe(v.object({
|
|
267
267
|
/** Action to perform. */
|
|
268
|
-
action: v.pipe(v.
|
|
268
|
+
action: v.pipe(v.object({
|
|
269
269
|
/** Type of action. */
|
|
270
270
|
type: v.pipe(v.literal("convertToMultiSigUser"), v.description("Type of action.")),
|
|
271
271
|
/** Chain ID used for signing. */
|
|
@@ -283,10 +283,10 @@ export const ConvertToMultiSigUserRequest = v.pipe(v.strictObject({
|
|
|
283
283
|
]), v.description("Signers configuration." +
|
|
284
284
|
"\n\nMust be `ConvertToMultiSigUserRequestSigners` converted to a string via `JSON.stringify(...)`.")),
|
|
285
285
|
/** Unique request identifier (current timestamp in ms). */
|
|
286
|
-
nonce: v.pipe(
|
|
286
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
287
287
|
}), v.description("Action to perform.")),
|
|
288
288
|
/** Unique request identifier (current timestamp in ms). */
|
|
289
|
-
nonce: v.pipe(
|
|
289
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
290
290
|
/** Cryptographic signature. */
|
|
291
291
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
292
292
|
}), v.transform(removeUndefinedKeys), v.description("Convert a single-signature account to a multi-signature account."));
|
|
@@ -295,29 +295,29 @@ export const ConvertToMultiSigUserRequest = v.pipe(v.strictObject({
|
|
|
295
295
|
* @returns {CreateSubAccountResponse}
|
|
296
296
|
* @see null
|
|
297
297
|
*/
|
|
298
|
-
export const CreateSubAccountRequest = v.pipe(v.
|
|
298
|
+
export const CreateSubAccountRequest = v.pipe(v.object({
|
|
299
299
|
/** Action to perform. */
|
|
300
|
-
action: v.pipe(v.
|
|
300
|
+
action: v.pipe(v.object({
|
|
301
301
|
/** Type of action. */
|
|
302
302
|
type: v.pipe(v.literal("createSubAccount"), v.description("Type of action.")),
|
|
303
303
|
/** Sub-account name. */
|
|
304
304
|
name: v.pipe(v.string(), v.minLength(1), v.description("Sub-account name.")),
|
|
305
305
|
}), v.description("Action to perform.")),
|
|
306
306
|
/** Unique request identifier (current timestamp in ms). */
|
|
307
|
-
nonce: v.pipe(
|
|
307
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
308
308
|
/** Cryptographic signature. */
|
|
309
309
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
310
310
|
/** Expiration time of the action. */
|
|
311
|
-
expiresAfter: v.pipe(v.optional(
|
|
311
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
312
312
|
}), v.transform(removeUndefinedKeys), v.description("Create a sub-account."));
|
|
313
313
|
/**
|
|
314
314
|
* Create a vault.
|
|
315
315
|
* @returns {CreateVaultResponse}
|
|
316
316
|
* @see null
|
|
317
317
|
*/
|
|
318
|
-
export const CreateVaultRequest = v.pipe(v.
|
|
318
|
+
export const CreateVaultRequest = v.pipe(v.object({
|
|
319
319
|
/** Action to perform. */
|
|
320
|
-
action: v.pipe(v.
|
|
320
|
+
action: v.pipe(v.object({
|
|
321
321
|
/** Type of action. */
|
|
322
322
|
type: v.pipe(v.literal("createVault"), v.description("Type of action.")),
|
|
323
323
|
/** Vault name. */
|
|
@@ -325,17 +325,17 @@ export const CreateVaultRequest = v.pipe(v.strictObject({
|
|
|
325
325
|
/** Vault description. */
|
|
326
326
|
description: v.pipe(v.string(), v.minLength(10), v.description("Vault description.")),
|
|
327
327
|
/** Initial balance (float * 1e6). */
|
|
328
|
-
initialUsd: v.pipe(
|
|
328
|
+
initialUsd: v.pipe(UnsignedInteger, v.minValue(100000000), // 100 USDC
|
|
329
329
|
v.description("Initial balance (float * 1e6).")),
|
|
330
330
|
/** Unique request identifier (current timestamp in ms). */
|
|
331
|
-
nonce: v.pipe(
|
|
331
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
332
332
|
}), v.description("Action to perform.")),
|
|
333
333
|
/** Unique request identifier (current timestamp in ms). */
|
|
334
|
-
nonce: v.pipe(
|
|
334
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
335
335
|
/** Cryptographic signature. */
|
|
336
336
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
337
337
|
/** Expiration time of the action. */
|
|
338
|
-
expiresAfter: v.pipe(v.optional(
|
|
338
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
339
339
|
}), v.transform(removeUndefinedKeys), v.description("Create a vault."));
|
|
340
340
|
/**
|
|
341
341
|
* Perform an action on a signer:
|
|
@@ -344,16 +344,16 @@ export const CreateVaultRequest = v.pipe(v.strictObject({
|
|
|
344
344
|
* @returns {SuccessResponse}
|
|
345
345
|
* @see null
|
|
346
346
|
*/
|
|
347
|
-
export const CSignerActionRequest = v.pipe(v.
|
|
347
|
+
export const CSignerActionRequest = v.pipe(v.object({
|
|
348
348
|
/** Action to perform. */
|
|
349
349
|
action: v.pipe(v.union([
|
|
350
|
-
v.
|
|
350
|
+
v.object({
|
|
351
351
|
/** Type of action. */
|
|
352
352
|
type: v.pipe(v.literal("CSignerAction"), v.description("Type of action.")),
|
|
353
353
|
/** Jail the signer. */
|
|
354
354
|
jailSelf: v.pipe(v.null(), v.description("Jail the signer.")),
|
|
355
355
|
}),
|
|
356
|
-
v.
|
|
356
|
+
v.object({
|
|
357
357
|
/** Type of action. */
|
|
358
358
|
type: v.pipe(v.literal("CSignerAction"), v.description("Type of action.")),
|
|
359
359
|
/** Unjail the signer. */
|
|
@@ -361,11 +361,11 @@ export const CSignerActionRequest = v.pipe(v.strictObject({
|
|
|
361
361
|
}),
|
|
362
362
|
]), v.description("Action to perform.")),
|
|
363
363
|
/** Unique request identifier (current timestamp in ms). */
|
|
364
|
-
nonce: v.pipe(
|
|
364
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
365
365
|
/** Cryptographic signature. */
|
|
366
366
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
367
367
|
/** Expiration time of the action. */
|
|
368
|
-
expiresAfter: v.pipe(v.optional(
|
|
368
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
369
369
|
}), v.transform(removeUndefinedKeys), v.description("Perform an action on a signer." +
|
|
370
370
|
"\n- Jail to prevent them from signing transactions." +
|
|
371
371
|
"\n- Unjail to allow them to sign transactions again."));
|
|
@@ -377,17 +377,17 @@ export const CSignerActionRequest = v.pipe(v.strictObject({
|
|
|
377
377
|
* @returns {SuccessResponse}
|
|
378
378
|
* @see null
|
|
379
379
|
*/
|
|
380
|
-
export const CValidatorActionRequest = v.pipe(v.
|
|
380
|
+
export const CValidatorActionRequest = v.pipe(v.object({
|
|
381
381
|
/** Action to perform. */
|
|
382
382
|
action: v.pipe(v.union([
|
|
383
|
-
v.
|
|
383
|
+
v.object({
|
|
384
384
|
/** Type of action. */
|
|
385
385
|
type: v.pipe(v.literal("CValidatorAction"), v.description("Type of action.")),
|
|
386
386
|
/** Profile changes to apply. */
|
|
387
|
-
changeProfile: v.pipe(v.
|
|
387
|
+
changeProfile: v.pipe(v.object({
|
|
388
388
|
/** Validator node IP address. */
|
|
389
389
|
node_ip: v.pipe(v.union([
|
|
390
|
-
v.
|
|
390
|
+
v.object({
|
|
391
391
|
/** IP address. */
|
|
392
392
|
Ip: v.pipe(v.string(), v.ip(), v.description("IP address.")),
|
|
393
393
|
}),
|
|
@@ -402,20 +402,20 @@ export const CValidatorActionRequest = v.pipe(v.strictObject({
|
|
|
402
402
|
/** Enable or disable delegations. */
|
|
403
403
|
disable_delegations: v.pipe(v.nullable(v.boolean()), v.description("Enable or disable delegations.")),
|
|
404
404
|
/** Commission rate in basis points (1 = 0.0001%). */
|
|
405
|
-
commission_bps: v.pipe(v.nullable(
|
|
405
|
+
commission_bps: v.pipe(v.nullable(UnsignedInteger), v.description("Commission rate in basis points (1 = 0.0001%).")),
|
|
406
406
|
/** Signer address. */
|
|
407
407
|
signer: v.pipe(v.nullable(v.pipe(Hex, v.length(42))), v.description("Signer address.")),
|
|
408
408
|
}), v.description("Profile changes to apply.")),
|
|
409
409
|
}),
|
|
410
|
-
v.
|
|
410
|
+
v.object({
|
|
411
411
|
/** Type of action. */
|
|
412
412
|
type: v.pipe(v.literal("CValidatorAction"), v.description("Type of action.")),
|
|
413
413
|
/** Registration parameters. */
|
|
414
|
-
register: v.pipe(v.
|
|
414
|
+
register: v.pipe(v.object({
|
|
415
415
|
/** Validator profile information. */
|
|
416
|
-
profile: v.pipe(v.
|
|
416
|
+
profile: v.pipe(v.object({
|
|
417
417
|
/** Validator node IP address. */
|
|
418
|
-
node_ip: v.pipe(v.
|
|
418
|
+
node_ip: v.pipe(v.object({
|
|
419
419
|
/** IP address. */
|
|
420
420
|
Ip: v.pipe(v.string(), v.ip(), v.description("IP address.")),
|
|
421
421
|
}), v.description("Validator node IP address.")),
|
|
@@ -426,17 +426,17 @@ export const CValidatorActionRequest = v.pipe(v.strictObject({
|
|
|
426
426
|
/** Whether delegations are disabled. */
|
|
427
427
|
delegations_disabled: v.pipe(v.boolean(), v.description("Whether delegations are disabled.")),
|
|
428
428
|
/** Commission rate in basis points (1 = 0.0001%). */
|
|
429
|
-
commission_bps: v.pipe(
|
|
429
|
+
commission_bps: v.pipe(UnsignedInteger, v.description("Commission rate in basis points (1 = 0.0001%).")),
|
|
430
430
|
/** Signer address. */
|
|
431
431
|
signer: v.pipe(v.pipe(Hex, v.length(42)), v.description("Signer address.")),
|
|
432
432
|
}), v.description("Validator profile information.")),
|
|
433
433
|
/** Initial jail status. */
|
|
434
434
|
unjailed: v.pipe(v.boolean(), v.description("Initial jail status.")),
|
|
435
435
|
/** Initial stake amount in wei. */
|
|
436
|
-
initial_wei: v.pipe(
|
|
436
|
+
initial_wei: v.pipe(UnsignedInteger, v.description("Initial stake amount in wei.")),
|
|
437
437
|
}), v.description("Registration parameters.")),
|
|
438
438
|
}),
|
|
439
|
-
v.
|
|
439
|
+
v.object({
|
|
440
440
|
/** Type of action. */
|
|
441
441
|
type: v.pipe(v.literal("CValidatorAction"), v.description("Type of action.")),
|
|
442
442
|
/** Unregister the validator. */
|
|
@@ -444,11 +444,11 @@ export const CValidatorActionRequest = v.pipe(v.strictObject({
|
|
|
444
444
|
}),
|
|
445
445
|
]), v.description("Action to perform.")),
|
|
446
446
|
/** Unique request identifier (current timestamp in ms). */
|
|
447
|
-
nonce: v.pipe(
|
|
447
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
448
448
|
/** Cryptographic signature. */
|
|
449
449
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
450
450
|
/** Expiration time of the action. */
|
|
451
|
-
expiresAfter: v.pipe(v.optional(
|
|
451
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
452
452
|
}), v.transform(removeUndefinedKeys), v.description("Perform an action on a validator:" +
|
|
453
453
|
"\n- Change profile information." +
|
|
454
454
|
"\n- Register a new validator." +
|
|
@@ -458,9 +458,9 @@ export const CValidatorActionRequest = v.pipe(v.strictObject({
|
|
|
458
458
|
* @returns {SuccessResponse}
|
|
459
459
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#withdraw-from-staking
|
|
460
460
|
*/
|
|
461
|
-
export const CWithdrawRequest = v.pipe(v.
|
|
461
|
+
export const CWithdrawRequest = v.pipe(v.object({
|
|
462
462
|
/** Action to perform. */
|
|
463
|
-
action: v.pipe(v.
|
|
463
|
+
action: v.pipe(v.object({
|
|
464
464
|
/** Type of action. */
|
|
465
465
|
type: v.pipe(v.literal("cWithdraw"), v.description("Type of action.")),
|
|
466
466
|
/** Chain ID used for signing. */
|
|
@@ -468,12 +468,12 @@ export const CWithdrawRequest = v.pipe(v.strictObject({
|
|
|
468
468
|
/** HyperLiquid network. */
|
|
469
469
|
hyperliquidChain: v.pipe(v.union([v.literal("Mainnet"), v.literal("Testnet")]), v.description("HyperLiquid network.")),
|
|
470
470
|
/** Amount of wei to withdraw from staking balance (float * 1e8). */
|
|
471
|
-
wei: v.pipe(
|
|
471
|
+
wei: v.pipe(UnsignedInteger, v.description("Amount of wei to withdraw from staking balance (float * 1e8).")),
|
|
472
472
|
/** Unique request identifier (current timestamp in ms). */
|
|
473
|
-
nonce: v.pipe(
|
|
473
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
474
474
|
}), v.description("Action to perform.")),
|
|
475
475
|
/** Unique request identifier (current timestamp in ms). */
|
|
476
|
-
nonce: v.pipe(
|
|
476
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
477
477
|
/** Cryptographic signature. */
|
|
478
478
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
479
479
|
}), v.transform(removeUndefinedKeys), v.description("Transfer native token from staking into the user spot account."));
|
|
@@ -482,74 +482,74 @@ export const CWithdrawRequest = v.pipe(v.strictObject({
|
|
|
482
482
|
* @returns {SuccessResponse}
|
|
483
483
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/dual-block-architecture
|
|
484
484
|
*/
|
|
485
|
-
export const EvmUserModifyRequest = v.pipe(v.
|
|
485
|
+
export const EvmUserModifyRequest = v.pipe(v.object({
|
|
486
486
|
/** Action to perform. */
|
|
487
|
-
action: v.pipe(v.
|
|
487
|
+
action: v.pipe(v.object({
|
|
488
488
|
/** Type of action. */
|
|
489
489
|
type: v.pipe(v.literal("evmUserModify"), v.description("Type of action.")),
|
|
490
490
|
/** `true` for large blocks, `false` for small blocks. */
|
|
491
491
|
usingBigBlocks: v.pipe(v.boolean(), v.description("`true` for large blocks, `false` for small blocks.")),
|
|
492
492
|
}), v.description("Action to perform.")),
|
|
493
493
|
/** Unique request identifier (current timestamp in ms). */
|
|
494
|
-
nonce: v.pipe(
|
|
494
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
495
495
|
/** Cryptographic signature. */
|
|
496
496
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
497
497
|
/** Expiration time of the action. */
|
|
498
|
-
expiresAfter: v.pipe(v.optional(
|
|
498
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
499
499
|
}), v.transform(removeUndefinedKeys), v.description("Configure block type for EVM transactions."));
|
|
500
500
|
/**
|
|
501
501
|
* Modify an order.
|
|
502
502
|
* @returns {SuccessResponse}
|
|
503
503
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
|
|
504
504
|
*/
|
|
505
|
-
export const ModifyRequest = v.pipe(v.
|
|
505
|
+
export const ModifyRequest = v.pipe(v.object({
|
|
506
506
|
/** Action to perform. */
|
|
507
|
-
action: v.pipe(v.
|
|
507
|
+
action: v.pipe(v.object({
|
|
508
508
|
/** Type of action. */
|
|
509
509
|
type: v.pipe(v.literal("modify"), v.description("Type of action.")),
|
|
510
510
|
/** Order ID or Client Order ID. */
|
|
511
511
|
oid: v.pipe(v.union([
|
|
512
|
-
|
|
512
|
+
UnsignedInteger,
|
|
513
513
|
v.pipe(Hex, v.length(34)),
|
|
514
514
|
]), v.description("Order ID or Client Order ID.")),
|
|
515
515
|
/** New order parameters. */
|
|
516
516
|
order: v.pipe(OrderParams, v.description("New order parameters.")),
|
|
517
517
|
}), v.description("Action to perform.")),
|
|
518
518
|
/** Unique request identifier (current timestamp in ms). */
|
|
519
|
-
nonce: v.pipe(
|
|
519
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
520
520
|
/** Cryptographic signature. */
|
|
521
521
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
522
522
|
/** Vault address (for vault trading). */
|
|
523
523
|
vaultAddress: v.pipe(v.optional(v.pipe(Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
524
524
|
/** Expiration time of the action. */
|
|
525
|
-
expiresAfter: v.pipe(v.optional(
|
|
525
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
526
526
|
}), v.transform(removeUndefinedKeys), v.description("Modify an order."));
|
|
527
527
|
/**
|
|
528
528
|
* This action does not do anything (no operation), but causes the nonce to be marked as used.
|
|
529
529
|
* @returns {SuccessResponse}
|
|
530
530
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#invalidate-pending-nonce-noop
|
|
531
531
|
*/
|
|
532
|
-
export const NoopRequest = v.pipe(v.
|
|
532
|
+
export const NoopRequest = v.pipe(v.object({
|
|
533
533
|
/** Action to perform. */
|
|
534
|
-
action: v.pipe(v.
|
|
534
|
+
action: v.pipe(v.object({
|
|
535
535
|
/** Type of action. */
|
|
536
536
|
type: v.pipe(v.literal("noop"), v.description("Type of action.")),
|
|
537
537
|
}), v.description("Action to perform.")),
|
|
538
538
|
/** Unique request identifier (current timestamp in ms). */
|
|
539
|
-
nonce: v.pipe(
|
|
539
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
540
540
|
/** Cryptographic signature. */
|
|
541
541
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
542
542
|
/** Expiration time of the action. */
|
|
543
|
-
expiresAfter: v.pipe(v.optional(
|
|
543
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
544
544
|
}), v.transform(removeUndefinedKeys), v.description("This action does not do anything (no operation), but causes the nonce to be marked as used."));
|
|
545
545
|
/**
|
|
546
546
|
* Place an order(s).
|
|
547
547
|
* @returns {OrderResponse}
|
|
548
548
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
|
|
549
549
|
*/
|
|
550
|
-
export const OrderRequest = v.pipe(v.
|
|
550
|
+
export const OrderRequest = v.pipe(v.object({
|
|
551
551
|
/** Action to perform. */
|
|
552
|
-
action: v.pipe(v.
|
|
552
|
+
action: v.pipe(v.object({
|
|
553
553
|
/** Type of action. */
|
|
554
554
|
type: v.pipe(v.literal("order"), v.description("Type of action.")),
|
|
555
555
|
/** Order parameters. */
|
|
@@ -569,21 +569,21 @@ export const OrderRequest = v.pipe(v.strictObject({
|
|
|
569
569
|
"\n- `normalTpsl`: TP/SL order with fixed size that doesn't adjust with position changes." +
|
|
570
570
|
"\n- `positionTpsl`: TP/SL order that adjusts proportionally with the position size.")),
|
|
571
571
|
/** Builder fee. */
|
|
572
|
-
builder: v.pipe(v.optional(v.
|
|
572
|
+
builder: v.pipe(v.optional(v.object({
|
|
573
573
|
/** Builder address. */
|
|
574
574
|
b: v.pipe(v.pipe(Hex, v.length(42)), v.description("Builder address.")),
|
|
575
575
|
/** Builder fee in 0.1bps (1 = 0.0001%). */
|
|
576
|
-
f: v.pipe(
|
|
576
|
+
f: v.pipe(UnsignedInteger, v.description("Builder fee in 0.1bps (1 = 0.0001%).")),
|
|
577
577
|
})), v.description("Builder fee.")),
|
|
578
578
|
}), v.description("Action to perform.")),
|
|
579
579
|
/** Unique request identifier (current timestamp in ms). */
|
|
580
|
-
nonce: v.pipe(
|
|
580
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
581
581
|
/** Cryptographic signature. */
|
|
582
582
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
583
583
|
/** Vault address (for vault trading). */
|
|
584
584
|
vaultAddress: v.pipe(v.optional(v.pipe(Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
585
585
|
/** Expiration time of the action. */
|
|
586
|
-
expiresAfter: v.pipe(v.optional(
|
|
586
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
587
587
|
}), v.transform(removeUndefinedKeys), v.description("Place an order(s)."));
|
|
588
588
|
/**
|
|
589
589
|
* Deploying HIP-3 assets:
|
|
@@ -592,62 +592,62 @@ export const OrderRequest = v.pipe(v.strictObject({
|
|
|
592
592
|
* @returns {SuccessResponse}
|
|
593
593
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-3-assets
|
|
594
594
|
*/
|
|
595
|
-
export const PerpDeployRequest = v.pipe(v.
|
|
595
|
+
export const PerpDeployRequest = v.pipe(v.object({
|
|
596
596
|
/** Action to perform. */
|
|
597
597
|
action: v.pipe(v.union([
|
|
598
|
-
v.pipe(v.
|
|
598
|
+
v.pipe(v.object({
|
|
599
599
|
/** Type of action. */
|
|
600
600
|
type: v.pipe(v.literal("perpDeploy"), v.description("Type of action.")),
|
|
601
601
|
/** Parameters for registering a new perpetual asset. */
|
|
602
|
-
registerAsset: v.pipe(v.
|
|
602
|
+
registerAsset: v.pipe(v.object({
|
|
603
603
|
/** Max gas in native token wei. If not provided, then uses current deploy auction price. */
|
|
604
|
-
maxGas: v.pipe(v.nullable(
|
|
604
|
+
maxGas: v.pipe(v.nullable(UnsignedInteger), v.description("Max gas in native token wei. If not provided, then uses current deploy auction price.")),
|
|
605
605
|
/** Contains new asset listing parameters. */
|
|
606
|
-
assetRequest: v.pipe(v.
|
|
606
|
+
assetRequest: v.pipe(v.object({
|
|
607
607
|
/** Coin symbol for the new asset. */
|
|
608
608
|
coin: v.pipe(v.string(), v.description("Coin symbol for the new asset.")),
|
|
609
609
|
/** Number of decimal places for size. */
|
|
610
|
-
szDecimals: v.pipe(
|
|
610
|
+
szDecimals: v.pipe(UnsignedInteger, v.description("Number of decimal places for size.")),
|
|
611
611
|
/** Initial oracle price for the asset. */
|
|
612
612
|
oraclePx: v.pipe(UnsignedDecimal, v.description("Initial oracle price for the asset.")),
|
|
613
613
|
/** Margin table identifier for risk management. */
|
|
614
|
-
marginTableId: v.pipe(
|
|
614
|
+
marginTableId: v.pipe(UnsignedInteger, v.description("Margin table identifier for risk management.")),
|
|
615
615
|
/** Whether the asset can only be traded with isolated margin. */
|
|
616
616
|
onlyIsolated: v.pipe(v.boolean(), v.description("Whether the asset can only be traded with isolated margin.")),
|
|
617
617
|
}), v.description("Contains new asset listing parameters.")),
|
|
618
618
|
/** Name of the dex. */
|
|
619
619
|
dex: v.pipe(v.string(), v.description("Name of the dex.")),
|
|
620
620
|
/** Contains new dex parameters. */
|
|
621
|
-
schema: v.pipe(v.nullable(v.
|
|
621
|
+
schema: v.pipe(v.nullable(v.object({
|
|
622
622
|
/** Full name of the dex. */
|
|
623
623
|
fullName: v.pipe(v.string(), v.description("Full name of the dex.")),
|
|
624
624
|
/** Collateral token index. */
|
|
625
|
-
collateralToken: v.pipe(
|
|
625
|
+
collateralToken: v.pipe(UnsignedInteger, v.description("Collateral token index.")),
|
|
626
626
|
/** User to update oracles. If not provided, then deployer is assumed to be oracle updater. */
|
|
627
627
|
oracleUpdater: v.pipe(v.nullable(v.pipe(Hex, v.length(42))), v.description("User to update oracles. If not provided, then deployer is assumed to be oracle updater.")),
|
|
628
628
|
})), v.description("Contains new dex parameters.")),
|
|
629
629
|
}), v.description("Parameters for registering a new perpetual asset.")),
|
|
630
630
|
}), v.description("Register asset variant")),
|
|
631
|
-
v.pipe(v.
|
|
631
|
+
v.pipe(v.object({
|
|
632
632
|
/** Type of action. */
|
|
633
633
|
type: v.pipe(v.literal("perpDeploy"), v.description("Type of action.")),
|
|
634
634
|
/** Parameters for setting oracle and mark prices for assets. */
|
|
635
|
-
setOracle: v.pipe(v.
|
|
635
|
+
setOracle: v.pipe(v.object({
|
|
636
636
|
/** Name of the dex. */
|
|
637
637
|
dex: v.pipe(v.string(), v.minLength(1), v.description("Name of the dex.")),
|
|
638
638
|
/** A list (sorted by key) of asset and oracle prices. */
|
|
639
|
-
oraclePxs: v.pipe(v.array(v.
|
|
639
|
+
oraclePxs: v.pipe(v.array(v.tuple([v.string(), UnsignedDecimal])), v.description("A list (sorted by key) of asset and oracle prices.")),
|
|
640
640
|
/** An outer list of inner lists (inner list sorted by key) of asset and mark prices. */
|
|
641
|
-
markPxs: v.pipe(v.array(v.array(v.
|
|
641
|
+
markPxs: v.pipe(v.array(v.array(v.tuple([v.string(), UnsignedDecimal]))), v.description("An outer list of inner lists (inner list sorted by key) of asset and mark prices.")),
|
|
642
642
|
}), v.description("Parameters for setting oracle and mark prices for assets.")),
|
|
643
643
|
}), v.description("Set oracle variant")),
|
|
644
644
|
]), v.description("Action to perform.")),
|
|
645
645
|
/** Unique request identifier (current timestamp in ms). */
|
|
646
|
-
nonce: v.pipe(
|
|
646
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
647
647
|
/** Cryptographic signature. */
|
|
648
648
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
649
649
|
/** Expiration time of the action. */
|
|
650
|
-
expiresAfter: v.pipe(v.optional(
|
|
650
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
651
651
|
}), v.transform(removeUndefinedKeys), v.description("Deploying HIP-3 assets:" +
|
|
652
652
|
"\n- Register Asset" +
|
|
653
653
|
"\n- Set Oracle"));
|
|
@@ -656,49 +656,49 @@ export const PerpDeployRequest = v.pipe(v.strictObject({
|
|
|
656
656
|
* @returns {SuccessResponse}
|
|
657
657
|
* @see null
|
|
658
658
|
*/
|
|
659
|
-
export const RegisterReferrerRequest = v.pipe(v.
|
|
659
|
+
export const RegisterReferrerRequest = v.pipe(v.object({
|
|
660
660
|
/** Action to perform. */
|
|
661
|
-
action: v.pipe(v.
|
|
661
|
+
action: v.pipe(v.object({
|
|
662
662
|
/** Type of action. */
|
|
663
663
|
type: v.pipe(v.literal("registerReferrer"), v.description("Type of action.")),
|
|
664
664
|
/** Referral code to create. */
|
|
665
665
|
code: v.pipe(v.string(), v.minLength(1), v.description("Referral code to create.")),
|
|
666
666
|
}), v.description("Action to perform.")),
|
|
667
667
|
/** Unique request identifier (current timestamp in ms). */
|
|
668
|
-
nonce: v.pipe(
|
|
668
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
669
669
|
/** Cryptographic signature. */
|
|
670
670
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
671
671
|
/** Expiration time of the action. */
|
|
672
|
-
expiresAfter: v.pipe(v.optional(
|
|
672
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
673
673
|
}), v.transform(removeUndefinedKeys), v.description("Create a referral code."));
|
|
674
674
|
/**
|
|
675
675
|
* Reserve additional rate-limited actions for a fee.
|
|
676
676
|
* @returns {SuccessResponse}
|
|
677
677
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#reserve-additional-actions
|
|
678
678
|
*/
|
|
679
|
-
export const ReserveRequestWeightRequest = v.pipe(v.
|
|
679
|
+
export const ReserveRequestWeightRequest = v.pipe(v.object({
|
|
680
680
|
/** Action to perform. */
|
|
681
|
-
action: v.pipe(v.
|
|
681
|
+
action: v.pipe(v.object({
|
|
682
682
|
/** Type of action. */
|
|
683
683
|
type: v.pipe(v.literal("reserveRequestWeight"), v.description("Type of action.")),
|
|
684
684
|
/** Amount of request weight to reserve. */
|
|
685
|
-
weight: v.pipe(
|
|
685
|
+
weight: v.pipe(UnsignedInteger, v.description("Amount of request weight to reserve.")),
|
|
686
686
|
}), v.description("Action to perform.")),
|
|
687
687
|
/** Unique request identifier (current timestamp in ms). */
|
|
688
|
-
nonce: v.pipe(
|
|
688
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
689
689
|
/** Cryptographic signature. */
|
|
690
690
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
691
691
|
/** Expiration time of the action. */
|
|
692
|
-
expiresAfter: v.pipe(v.optional(
|
|
692
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
693
693
|
}), v.transform(removeUndefinedKeys), v.description("Reserve additional rate-limited actions for a fee."));
|
|
694
694
|
/**
|
|
695
695
|
* Schedule a cancel-all operation at a future time.
|
|
696
696
|
* @returns {SuccessResponse}
|
|
697
697
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#schedule-cancel-dead-mans-switch
|
|
698
698
|
*/
|
|
699
|
-
export const ScheduleCancelRequest = v.pipe(v.
|
|
699
|
+
export const ScheduleCancelRequest = v.pipe(v.object({
|
|
700
700
|
/** Action to perform. */
|
|
701
|
-
action: v.pipe(v.
|
|
701
|
+
action: v.pipe(v.object({
|
|
702
702
|
/** Type of action. */
|
|
703
703
|
type: v.pipe(v.literal("scheduleCancel"), v.description("Type of action.")),
|
|
704
704
|
/**
|
|
@@ -707,27 +707,27 @@ export const ScheduleCancelRequest = v.pipe(v.strictObject({
|
|
|
707
707
|
*
|
|
708
708
|
* If not specified, will cause all scheduled cancel operations to be deleted.
|
|
709
709
|
*/
|
|
710
|
-
time: v.pipe(v.optional(
|
|
710
|
+
time: v.pipe(v.optional(UnsignedInteger), v.description("Scheduled time (in ms since epoch)." +
|
|
711
711
|
"\nMust be at least 5 seconds in the future." +
|
|
712
712
|
"\n\nIf not specified, will cause all scheduled cancel operations to be deleted.")),
|
|
713
713
|
}), v.description("Action to perform.")),
|
|
714
714
|
/** Unique request identifier (current timestamp in ms). */
|
|
715
|
-
nonce: v.pipe(
|
|
715
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
716
716
|
/** Cryptographic signature. */
|
|
717
717
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
718
718
|
/** Vault address (for vault trading). */
|
|
719
719
|
vaultAddress: v.pipe(v.optional(v.pipe(Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
720
720
|
/** Expiration time of the action. */
|
|
721
|
-
expiresAfter: v.pipe(v.optional(
|
|
721
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
722
722
|
}), v.transform(removeUndefinedKeys), v.description("Schedule a cancel-all operation at a future time."));
|
|
723
723
|
/**
|
|
724
724
|
* Transfer tokens between different perp DEXs, spot balance, users, and/or sub-accounts.
|
|
725
725
|
* @returns {SuccessResponse}
|
|
726
726
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#send-asset-testnet-only
|
|
727
727
|
*/
|
|
728
|
-
export const SendAssetRequest = v.pipe(v.
|
|
728
|
+
export const SendAssetRequest = v.pipe(v.object({
|
|
729
729
|
/** Action to perform. */
|
|
730
|
-
action: v.pipe(v.
|
|
730
|
+
action: v.pipe(v.object({
|
|
731
731
|
/** Type of action. */
|
|
732
732
|
type: v.pipe(v.literal("sendAsset"), v.description("Type of action.")),
|
|
733
733
|
/** Chain ID used for signing. */
|
|
@@ -750,10 +750,10 @@ export const SendAssetRequest = v.pipe(v.strictObject({
|
|
|
750
750
|
v.pipe(Hex, v.length(42)),
|
|
751
751
|
]), v.description('Source sub-account address ("" for main account).')),
|
|
752
752
|
/** Unique request identifier (current timestamp in ms). */
|
|
753
|
-
nonce: v.pipe(
|
|
753
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
754
754
|
}), v.description("Action to perform.")),
|
|
755
755
|
/** Unique request identifier (current timestamp in ms). */
|
|
756
|
-
nonce: v.pipe(
|
|
756
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
757
757
|
/** Cryptographic signature. */
|
|
758
758
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
759
759
|
}), v.transform(removeUndefinedKeys), v.description("Transfer tokens between different perp DEXs, spot balance, users, and/or sub-accounts."));
|
|
@@ -762,9 +762,9 @@ export const SendAssetRequest = v.pipe(v.strictObject({
|
|
|
762
762
|
* @returns {SuccessResponse}
|
|
763
763
|
* @see null
|
|
764
764
|
*/
|
|
765
|
-
export const SetDisplayNameRequest = v.pipe(v.
|
|
765
|
+
export const SetDisplayNameRequest = v.pipe(v.object({
|
|
766
766
|
/** Action to perform. */
|
|
767
|
-
action: v.pipe(v.
|
|
767
|
+
action: v.pipe(v.object({
|
|
768
768
|
/** Type of action. */
|
|
769
769
|
type: v.pipe(v.literal("setDisplayName"), v.description("Type of action.")),
|
|
770
770
|
/**
|
|
@@ -776,31 +776,31 @@ export const SetDisplayNameRequest = v.pipe(v.strictObject({
|
|
|
776
776
|
"\n\nSet to an empty string to remove the display name.")),
|
|
777
777
|
}), v.description("Action to perform.")),
|
|
778
778
|
/** Unique request identifier (current timestamp in ms). */
|
|
779
|
-
nonce: v.pipe(
|
|
779
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
780
780
|
/** Cryptographic signature. */
|
|
781
781
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
782
782
|
/** Expiration time of the action. */
|
|
783
|
-
expiresAfter: v.pipe(v.optional(
|
|
783
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
784
784
|
}), v.transform(removeUndefinedKeys), v.description("Set the display name in the leaderboard."));
|
|
785
785
|
/**
|
|
786
786
|
* Set a referral code.
|
|
787
787
|
* @returns {SuccessResponse}
|
|
788
788
|
* @see null
|
|
789
789
|
*/
|
|
790
|
-
export const SetReferrerRequest = v.pipe(v.
|
|
790
|
+
export const SetReferrerRequest = v.pipe(v.object({
|
|
791
791
|
/** Action to perform. */
|
|
792
|
-
action: v.pipe(v.
|
|
792
|
+
action: v.pipe(v.object({
|
|
793
793
|
/** Type of action. */
|
|
794
794
|
type: v.pipe(v.literal("setReferrer"), v.description("Type of action.")),
|
|
795
795
|
/** Referral code. */
|
|
796
796
|
code: v.pipe(v.string(), v.minLength(1), v.description("Referral code.")),
|
|
797
797
|
}), v.description("Action to perform.")),
|
|
798
798
|
/** Unique request identifier (current timestamp in ms). */
|
|
799
|
-
nonce: v.pipe(
|
|
799
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
800
800
|
/** Cryptographic signature. */
|
|
801
801
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
802
802
|
/** Expiration time of the action. */
|
|
803
|
-
expiresAfter: v.pipe(v.optional(
|
|
803
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
804
804
|
}), v.transform(removeUndefinedKeys), v.description("Set a referral code."));
|
|
805
805
|
/**
|
|
806
806
|
* Deploying HIP-1 and HIP-2 assets:
|
|
@@ -813,107 +813,107 @@ export const SetReferrerRequest = v.pipe(v.strictObject({
|
|
|
813
813
|
* @returns {SuccessResponse}
|
|
814
814
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-1-and-hip-2-assets
|
|
815
815
|
*/
|
|
816
|
-
export const SpotDeployRequest = v.pipe(v.
|
|
816
|
+
export const SpotDeployRequest = v.pipe(v.object({
|
|
817
817
|
/** Action to perform. */
|
|
818
818
|
action: v.pipe(v.union([
|
|
819
|
-
v.pipe(v.
|
|
819
|
+
v.pipe(v.object({
|
|
820
820
|
/** Type of action. */
|
|
821
821
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
822
822
|
/** Genesis parameters. */
|
|
823
|
-
genesis: v.pipe(v.
|
|
823
|
+
genesis: v.pipe(v.object({
|
|
824
824
|
/** Token identifier. */
|
|
825
|
-
token: v.pipe(
|
|
825
|
+
token: v.pipe(UnsignedInteger, v.description("Token identifier.")),
|
|
826
826
|
/** Maximum token supply. */
|
|
827
827
|
maxSupply: v.pipe(UnsignedDecimal, v.description("Maximum token supply.")),
|
|
828
828
|
/** Set hyperliquidity balance to 0. */
|
|
829
829
|
noHyperliquidity: v.pipe(v.optional(v.literal(true)), v.description("Set hyperliquidity balance to 0.")),
|
|
830
830
|
}), v.description("Genesis parameters.")),
|
|
831
831
|
}), v.description("Genesis variant")),
|
|
832
|
-
v.pipe(v.
|
|
832
|
+
v.pipe(v.object({
|
|
833
833
|
/** Type of action. */
|
|
834
834
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
835
835
|
/** Register hyperliquidity parameters. */
|
|
836
|
-
registerHyperliquidity: v.pipe(v.
|
|
836
|
+
registerHyperliquidity: v.pipe(v.object({
|
|
837
837
|
/** Spot index (distinct from base token index). */
|
|
838
|
-
spot: v.pipe(
|
|
838
|
+
spot: v.pipe(UnsignedInteger, v.description("Spot index (distinct from base token index).")),
|
|
839
839
|
/** Starting price for liquidity seeding. */
|
|
840
840
|
startPx: v.pipe(UnsignedDecimal, v.description("Starting price for liquidity seeding.")),
|
|
841
841
|
/** Order size as a float (not in wei). */
|
|
842
842
|
orderSz: v.pipe(UnsignedDecimal, v.description("Order size as a float (not in wei).")),
|
|
843
843
|
/** Total number of orders to place. */
|
|
844
|
-
nOrders: v.pipe(
|
|
844
|
+
nOrders: v.pipe(UnsignedInteger, v.description("Total number of orders to place.")),
|
|
845
845
|
/** Number of levels to seed with USDC. */
|
|
846
|
-
nSeededLevels: v.pipe(v.optional(
|
|
846
|
+
nSeededLevels: v.pipe(v.optional(UnsignedInteger), v.description("Number of levels to seed with USDC.")),
|
|
847
847
|
}), v.description("Register hyperliquidity parameters.")),
|
|
848
848
|
}), v.description("Register hyperliquidity variant")),
|
|
849
|
-
v.pipe(v.
|
|
849
|
+
v.pipe(v.object({
|
|
850
850
|
/** Type of action. */
|
|
851
851
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
852
852
|
/** Register spot parameters. */
|
|
853
|
-
registerSpot: v.pipe(v.
|
|
853
|
+
registerSpot: v.pipe(v.object({
|
|
854
854
|
/** Tuple containing base and quote token indices. */
|
|
855
|
-
tokens: v.pipe(v.
|
|
856
|
-
|
|
857
|
-
|
|
855
|
+
tokens: v.pipe(v.tuple([
|
|
856
|
+
UnsignedInteger,
|
|
857
|
+
UnsignedInteger,
|
|
858
858
|
]), v.description("Tuple containing base and quote token indices.")),
|
|
859
859
|
}), v.description("Register spot parameters.")),
|
|
860
860
|
}), v.description("Register spot variant")),
|
|
861
|
-
v.pipe(v.
|
|
861
|
+
v.pipe(v.object({
|
|
862
862
|
/** Type of action. */
|
|
863
863
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
864
864
|
/** Register token parameters. */
|
|
865
|
-
registerToken2: v.pipe(v.
|
|
865
|
+
registerToken2: v.pipe(v.object({
|
|
866
866
|
/** Token specifications. */
|
|
867
|
-
spec: v.pipe(v.
|
|
867
|
+
spec: v.pipe(v.object({
|
|
868
868
|
/** Token name. */
|
|
869
869
|
name: v.pipe(v.string(), v.description("Token name.")),
|
|
870
870
|
/** Number of decimals for token size. */
|
|
871
|
-
szDecimals: v.pipe(
|
|
871
|
+
szDecimals: v.pipe(UnsignedInteger, v.description("Number of decimals for token size.")),
|
|
872
872
|
/** Number of decimals for token amounts in wei. */
|
|
873
|
-
weiDecimals: v.pipe(
|
|
873
|
+
weiDecimals: v.pipe(UnsignedInteger, v.description("Number of decimals for token amounts in wei.")),
|
|
874
874
|
}), v.description("Token specifications.")),
|
|
875
875
|
/** Maximum gas allowed for registration. */
|
|
876
|
-
maxGas: v.pipe(
|
|
876
|
+
maxGas: v.pipe(UnsignedInteger, v.description("Maximum gas allowed for registration.")),
|
|
877
877
|
/** Optional full token name. */
|
|
878
878
|
fullName: v.pipe(v.optional(v.string()), v.description("Optional full token name.")),
|
|
879
879
|
}), v.description("Register token parameters.")),
|
|
880
880
|
}), v.description("Register token variant")),
|
|
881
|
-
v.pipe(v.
|
|
881
|
+
v.pipe(v.object({
|
|
882
882
|
/** Type of action. */
|
|
883
883
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
884
884
|
/** Set deployer trading fee share parameters. */
|
|
885
|
-
setDeployerTradingFeeShare: v.pipe(v.
|
|
885
|
+
setDeployerTradingFeeShare: v.pipe(v.object({
|
|
886
886
|
/** Token identifier. */
|
|
887
|
-
token: v.pipe(
|
|
887
|
+
token: v.pipe(UnsignedInteger, v.description("Token identifier.")),
|
|
888
888
|
/** The deployer trading fee share. Range is 0% to 100%. */
|
|
889
889
|
share: v.pipe(Percent, v.description("The deployer trading fee share. Range is 0% to 100%.")),
|
|
890
890
|
}), v.description("Set deployer trading fee share parameters.")),
|
|
891
891
|
}), v.description("Set deployer trading fee share variant")),
|
|
892
|
-
v.pipe(v.
|
|
892
|
+
v.pipe(v.object({
|
|
893
893
|
/** Type of action. */
|
|
894
894
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
895
895
|
/** User genesis parameters. */
|
|
896
|
-
userGenesis: v.pipe(v.
|
|
896
|
+
userGenesis: v.pipe(v.object({
|
|
897
897
|
/** Token identifier. */
|
|
898
|
-
token: v.pipe(
|
|
898
|
+
token: v.pipe(UnsignedInteger, v.description("Token identifier.")),
|
|
899
899
|
/** Array of tuples: [user address, genesis amount in wei]. */
|
|
900
|
-
userAndWei: v.pipe(v.array(v.
|
|
900
|
+
userAndWei: v.pipe(v.array(v.tuple([v.pipe(Hex, v.length(42)), UnsignedDecimal])), v.description("Array of tuples: [user address, genesis amount in wei].")),
|
|
901
901
|
/** Array of tuples: [existing token identifier, genesis amount in wei]. */
|
|
902
|
-
existingTokenAndWei: v.pipe(v.array(v.
|
|
903
|
-
|
|
902
|
+
existingTokenAndWei: v.pipe(v.array(v.tuple([
|
|
903
|
+
UnsignedInteger,
|
|
904
904
|
UnsignedDecimal,
|
|
905
905
|
])), v.description("Array of tuples: [existing token identifier, genesis amount in wei].")),
|
|
906
906
|
/** Array of tuples: [user address, blacklist status] (`true` for blacklist, `false` to remove existing blacklisted user). */
|
|
907
|
-
blacklistUsers: v.pipe(v.optional(v.array(v.
|
|
907
|
+
blacklistUsers: v.pipe(v.optional(v.array(v.tuple([v.pipe(Hex, v.length(42)), v.boolean()]))), v.description("Array of tuples: [user address, blacklist status] (`true` for blacklist, `false` to remove existing blacklisted user).")),
|
|
908
908
|
}), v.description("User genesis parameters.")),
|
|
909
909
|
}), v.description("User genesis variant")),
|
|
910
910
|
]), v.description("Action to perform.")),
|
|
911
911
|
/** Unique request identifier (current timestamp in ms). */
|
|
912
|
-
nonce: v.pipe(
|
|
912
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
913
913
|
/** Cryptographic signature. */
|
|
914
914
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
915
915
|
/** Expiration time of the action. */
|
|
916
|
-
expiresAfter: v.pipe(v.optional(
|
|
916
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
917
917
|
}), v.transform(removeUndefinedKeys), v.description("Deploying HIP-1 and HIP-2 assets:" +
|
|
918
918
|
"\n- Genesis" +
|
|
919
919
|
"\n- Register Hyperliquidity" +
|
|
@@ -926,9 +926,9 @@ export const SpotDeployRequest = v.pipe(v.strictObject({
|
|
|
926
926
|
* @returns {SuccessResponse}
|
|
927
927
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-spot-transfer
|
|
928
928
|
*/
|
|
929
|
-
export const SpotSendRequest = v.pipe(v.
|
|
929
|
+
export const SpotSendRequest = v.pipe(v.object({
|
|
930
930
|
/** Action to perform. */
|
|
931
|
-
action: v.pipe(v.
|
|
931
|
+
action: v.pipe(v.object({
|
|
932
932
|
/** Type of action. */
|
|
933
933
|
type: v.pipe(v.literal("spotSend"), v.description("Type of action.")),
|
|
934
934
|
/** Chain ID used for signing. */
|
|
@@ -942,10 +942,10 @@ export const SpotSendRequest = v.pipe(v.strictObject({
|
|
|
942
942
|
/** Amount to send (not in wei). */
|
|
943
943
|
amount: v.pipe(UnsignedDecimal, v.description("Amount to send (not in wei).")),
|
|
944
944
|
/** Unique request identifier (current timestamp in ms). */
|
|
945
|
-
time: v.pipe(
|
|
945
|
+
time: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
946
946
|
}), v.description("Action to perform.")),
|
|
947
947
|
/** Unique request identifier (current timestamp in ms). */
|
|
948
|
-
nonce: v.pipe(
|
|
948
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
949
949
|
/** Cryptographic signature. */
|
|
950
950
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
951
951
|
}), v.transform(removeUndefinedKeys), v.description("Send spot assets to another address."));
|
|
@@ -954,32 +954,32 @@ export const SpotSendRequest = v.pipe(v.strictObject({
|
|
|
954
954
|
* @returns {SuccessResponse}
|
|
955
955
|
* @see null
|
|
956
956
|
*/
|
|
957
|
-
export const SpotUserRequest = v.pipe(v.
|
|
957
|
+
export const SpotUserRequest = v.pipe(v.object({
|
|
958
958
|
/** Action to perform. */
|
|
959
|
-
action: v.pipe(v.
|
|
959
|
+
action: v.pipe(v.object({
|
|
960
960
|
/** Type of action. */
|
|
961
961
|
type: v.pipe(v.literal("spotUser"), v.description("Type of action.")),
|
|
962
962
|
/** Spot dusting options. */
|
|
963
|
-
toggleSpotDusting: v.pipe(v.
|
|
963
|
+
toggleSpotDusting: v.pipe(v.object({
|
|
964
964
|
/** Opt out of spot dusting. */
|
|
965
965
|
optOut: v.pipe(v.boolean(), v.description("Opt out of spot dusting.")),
|
|
966
966
|
}), v.description("Spot dusting options.")),
|
|
967
967
|
}), v.description("Action to perform.")),
|
|
968
968
|
/** Unique request identifier (current timestamp in ms). */
|
|
969
|
-
nonce: v.pipe(
|
|
969
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
970
970
|
/** Cryptographic signature. */
|
|
971
971
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
972
972
|
/** Expiration time of the action. */
|
|
973
|
-
expiresAfter: v.pipe(v.optional(
|
|
973
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
974
974
|
}), v.transform(removeUndefinedKeys), v.description("Opt Out of Spot Dusting."));
|
|
975
975
|
/**
|
|
976
976
|
* Modify a sub-account.
|
|
977
977
|
* @returns {SuccessResponse}
|
|
978
978
|
* @see null
|
|
979
979
|
*/
|
|
980
|
-
export const SubAccountModifyRequest = v.pipe(v.
|
|
980
|
+
export const SubAccountModifyRequest = v.pipe(v.object({
|
|
981
981
|
/** Action to perform. */
|
|
982
|
-
action: v.pipe(v.
|
|
982
|
+
action: v.pipe(v.object({
|
|
983
983
|
/** Type of action. */
|
|
984
984
|
type: v.pipe(v.literal("subAccountModify"), v.description("Type of action.")),
|
|
985
985
|
/** Sub-account address to modify. */
|
|
@@ -988,20 +988,20 @@ export const SubAccountModifyRequest = v.pipe(v.strictObject({
|
|
|
988
988
|
name: v.pipe(v.string(), v.minLength(1), v.description("New sub-account name.")),
|
|
989
989
|
}), v.description("Action to perform.")),
|
|
990
990
|
/** Unique request identifier (current timestamp in ms). */
|
|
991
|
-
nonce: v.pipe(
|
|
991
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
992
992
|
/** Cryptographic signature. */
|
|
993
993
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
994
994
|
/** Expiration time of the action. */
|
|
995
|
-
expiresAfter: v.pipe(v.optional(
|
|
995
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
996
996
|
}), v.transform(removeUndefinedKeys), v.description("Modify a sub-account."));
|
|
997
997
|
/**
|
|
998
998
|
* Transfer between sub-accounts (spot).
|
|
999
999
|
* @returns {SuccessResponse}
|
|
1000
1000
|
* @see null
|
|
1001
1001
|
*/
|
|
1002
|
-
export const SubAccountSpotTransferRequest = v.pipe(v.
|
|
1002
|
+
export const SubAccountSpotTransferRequest = v.pipe(v.object({
|
|
1003
1003
|
/** Action to perform. */
|
|
1004
|
-
action: v.pipe(v.
|
|
1004
|
+
action: v.pipe(v.object({
|
|
1005
1005
|
/** Type of action. */
|
|
1006
1006
|
type: v.pipe(v.literal("subAccountSpotTransfer"), v.description("Type of action.")),
|
|
1007
1007
|
/** Sub-account address. */
|
|
@@ -1014,20 +1014,20 @@ export const SubAccountSpotTransferRequest = v.pipe(v.strictObject({
|
|
|
1014
1014
|
amount: v.pipe(UnsignedDecimal, v.description("Amount to send (not in wei).")),
|
|
1015
1015
|
}), v.description("Action to perform.")),
|
|
1016
1016
|
/** Unique request identifier (current timestamp in ms). */
|
|
1017
|
-
nonce: v.pipe(
|
|
1017
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1018
1018
|
/** Cryptographic signature. */
|
|
1019
1019
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1020
1020
|
/** Expiration time of the action. */
|
|
1021
|
-
expiresAfter: v.pipe(v.optional(
|
|
1021
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1022
1022
|
}), v.transform(removeUndefinedKeys), v.description("Transfer between sub-accounts (spot)."));
|
|
1023
1023
|
/**
|
|
1024
1024
|
* Transfer between sub-accounts (perpetual).
|
|
1025
1025
|
* @returns {SuccessResponse}
|
|
1026
1026
|
* @see null
|
|
1027
1027
|
*/
|
|
1028
|
-
export const SubAccountTransferRequest = v.pipe(v.
|
|
1028
|
+
export const SubAccountTransferRequest = v.pipe(v.object({
|
|
1029
1029
|
/** Action to perform. */
|
|
1030
|
-
action: v.pipe(v.
|
|
1030
|
+
action: v.pipe(v.object({
|
|
1031
1031
|
/** Type of action. */
|
|
1032
1032
|
type: v.pipe(v.literal("subAccountTransfer"), v.description("Type of action.")),
|
|
1033
1033
|
/** Sub-account address. */
|
|
@@ -1035,23 +1035,23 @@ export const SubAccountTransferRequest = v.pipe(v.strictObject({
|
|
|
1035
1035
|
/** `true` for deposit, `false` for withdrawal. */
|
|
1036
1036
|
isDeposit: v.pipe(v.boolean(), v.description("`true` for deposit, `false` for withdrawal.")),
|
|
1037
1037
|
/** Amount to transfer (float * 1e6). */
|
|
1038
|
-
usd: v.pipe(
|
|
1038
|
+
usd: v.pipe(UnsignedInteger, v.description("Amount to transfer (float * 1e6).")),
|
|
1039
1039
|
}), v.description("Action to perform.")),
|
|
1040
1040
|
/** Unique request identifier (current timestamp in ms). */
|
|
1041
|
-
nonce: v.pipe(
|
|
1041
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1042
1042
|
/** Cryptographic signature. */
|
|
1043
1043
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1044
1044
|
/** Expiration time of the action. */
|
|
1045
|
-
expiresAfter: v.pipe(v.optional(
|
|
1045
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1046
1046
|
}), v.transform(removeUndefinedKeys), v.description("Transfer between sub-accounts (perpetual)."));
|
|
1047
1047
|
/**
|
|
1048
1048
|
* Delegate or undelegate native tokens to or from a validator.
|
|
1049
1049
|
* @returns {SuccessResponse}
|
|
1050
1050
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#delegate-or-undelegate-stake-from-validator
|
|
1051
1051
|
*/
|
|
1052
|
-
export const TokenDelegateRequest = v.pipe(v.
|
|
1052
|
+
export const TokenDelegateRequest = v.pipe(v.object({
|
|
1053
1053
|
/** Action to perform. */
|
|
1054
|
-
action: v.pipe(v.
|
|
1054
|
+
action: v.pipe(v.object({
|
|
1055
1055
|
/** Type of action. */
|
|
1056
1056
|
type: v.pipe(v.literal("tokenDelegate"), v.description("Type of action.")),
|
|
1057
1057
|
/** Chain ID used for signing. */
|
|
@@ -1061,14 +1061,14 @@ export const TokenDelegateRequest = v.pipe(v.strictObject({
|
|
|
1061
1061
|
/** Validator address. */
|
|
1062
1062
|
validator: v.pipe(v.pipe(Hex, v.length(42)), v.description("Validator address.")),
|
|
1063
1063
|
/** Amount for delegate/undelegate (float * 1e8). */
|
|
1064
|
-
wei: v.pipe(
|
|
1064
|
+
wei: v.pipe(UnsignedInteger, v.description("Amount for delegate/undelegate (float * 1e8).")),
|
|
1065
1065
|
/** `true` for undelegate, `false` for delegate. */
|
|
1066
1066
|
isUndelegate: v.pipe(v.boolean(), v.description("`true` for undelegate, `false` for delegate.")),
|
|
1067
1067
|
/** Unique request identifier (current timestamp in ms). */
|
|
1068
|
-
nonce: v.pipe(
|
|
1068
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1069
1069
|
}), v.description("Action to perform.")),
|
|
1070
1070
|
/** Unique request identifier (current timestamp in ms). */
|
|
1071
|
-
nonce: v.pipe(
|
|
1071
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1072
1072
|
/** Cryptographic signature. */
|
|
1073
1073
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1074
1074
|
}), v.transform(removeUndefinedKeys), v.description("Delegate or undelegate native tokens to or from a validator."));
|
|
@@ -1077,39 +1077,39 @@ export const TokenDelegateRequest = v.pipe(v.strictObject({
|
|
|
1077
1077
|
* @returns {TwapCancelResponse}
|
|
1078
1078
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-a-twap-order
|
|
1079
1079
|
*/
|
|
1080
|
-
export const TwapCancelRequest = v.pipe(v.
|
|
1080
|
+
export const TwapCancelRequest = v.pipe(v.object({
|
|
1081
1081
|
/** Action to perform. */
|
|
1082
|
-
action: v.pipe(v.
|
|
1082
|
+
action: v.pipe(v.object({
|
|
1083
1083
|
/** Type of action. */
|
|
1084
1084
|
type: v.pipe(v.literal("twapCancel"), v.description("Type of action.")),
|
|
1085
1085
|
/** Asset ID. */
|
|
1086
|
-
a: v.pipe(
|
|
1086
|
+
a: v.pipe(UnsignedInteger, v.description("Asset ID.")),
|
|
1087
1087
|
/** Twap ID. */
|
|
1088
|
-
t: v.pipe(
|
|
1088
|
+
t: v.pipe(UnsignedInteger, v.description("Twap ID.")),
|
|
1089
1089
|
}), v.description("Action to perform.")),
|
|
1090
1090
|
/** Unique request identifier (current timestamp in ms). */
|
|
1091
|
-
nonce: v.pipe(
|
|
1091
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1092
1092
|
/** Cryptographic signature. */
|
|
1093
1093
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1094
1094
|
/** Vault address (for vault trading). */
|
|
1095
1095
|
vaultAddress: v.pipe(v.optional(v.pipe(Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
1096
1096
|
/** Expiration time of the action. */
|
|
1097
|
-
expiresAfter: v.pipe(v.optional(
|
|
1097
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1098
1098
|
}), v.transform(removeUndefinedKeys), v.description("Cancel a TWAP order."));
|
|
1099
1099
|
/**
|
|
1100
1100
|
* Place a TWAP order.
|
|
1101
1101
|
* @returns {TwapOrderResponse}
|
|
1102
1102
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-a-twap-order
|
|
1103
1103
|
*/
|
|
1104
|
-
export const TwapOrderRequest = v.pipe(v.
|
|
1104
|
+
export const TwapOrderRequest = v.pipe(v.object({
|
|
1105
1105
|
/** Action to perform. */
|
|
1106
|
-
action: v.pipe(v.
|
|
1106
|
+
action: v.pipe(v.object({
|
|
1107
1107
|
/** Type of action. */
|
|
1108
1108
|
type: v.pipe(v.literal("twapOrder"), v.description("Type of action.")),
|
|
1109
1109
|
/** Twap parameters. */
|
|
1110
|
-
twap: v.pipe(v.
|
|
1110
|
+
twap: v.pipe(v.object({
|
|
1111
1111
|
/** Asset ID. */
|
|
1112
|
-
a: v.pipe(
|
|
1112
|
+
a: v.pipe(UnsignedInteger, v.description("Asset ID.")),
|
|
1113
1113
|
/** Position side (`true` for long, `false` for short). */
|
|
1114
1114
|
b: v.pipe(v.boolean(), v.description("Position side (`true` for long, `false` for short).")),
|
|
1115
1115
|
/** Size (in base currency units). */
|
|
@@ -1117,80 +1117,80 @@ export const TwapOrderRequest = v.pipe(v.strictObject({
|
|
|
1117
1117
|
/** Is reduce-only? */
|
|
1118
1118
|
r: v.pipe(v.boolean(), v.description("Is reduce-only?")),
|
|
1119
1119
|
/** TWAP duration in minutes. */
|
|
1120
|
-
m: v.pipe(
|
|
1120
|
+
m: v.pipe(UnsignedInteger, v.description("TWAP duration in minutes.")),
|
|
1121
1121
|
/** Enable random order timing. */
|
|
1122
1122
|
t: v.pipe(v.boolean(), v.description("Enable random order timing.")),
|
|
1123
1123
|
}), v.description("Twap parameters.")),
|
|
1124
1124
|
}), v.description("Action to perform.")),
|
|
1125
1125
|
/** Unique request identifier (current timestamp in ms). */
|
|
1126
|
-
nonce: v.pipe(
|
|
1126
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1127
1127
|
/** Cryptographic signature. */
|
|
1128
1128
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1129
1129
|
/** Vault address (for vault trading). */
|
|
1130
1130
|
vaultAddress: v.pipe(v.optional(v.pipe(Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
1131
1131
|
/** Expiration time of the action. */
|
|
1132
|
-
expiresAfter: v.pipe(v.optional(
|
|
1132
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1133
1133
|
}), v.transform(removeUndefinedKeys), v.description("Place a TWAP order."));
|
|
1134
1134
|
/**
|
|
1135
1135
|
* Add or remove margin from isolated position.
|
|
1136
1136
|
* @returns {SuccessResponse}
|
|
1137
1137
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
|
|
1138
1138
|
*/
|
|
1139
|
-
export const UpdateIsolatedMarginRequest = v.pipe(v.
|
|
1139
|
+
export const UpdateIsolatedMarginRequest = v.pipe(v.object({
|
|
1140
1140
|
/** Action to perform. */
|
|
1141
|
-
action: v.pipe(v.
|
|
1141
|
+
action: v.pipe(v.object({
|
|
1142
1142
|
/** Type of action. */
|
|
1143
1143
|
type: v.pipe(v.literal("updateIsolatedMargin"), v.description("Type of action.")),
|
|
1144
1144
|
/** Asset ID. */
|
|
1145
|
-
asset: v.pipe(
|
|
1145
|
+
asset: v.pipe(UnsignedInteger, v.description("Asset ID.")),
|
|
1146
1146
|
/** Position side (`true` for long, `false` for short). */
|
|
1147
1147
|
isBuy: v.pipe(v.boolean(), v.description("Position side (`true` for long, `false` for short).")),
|
|
1148
1148
|
/** Amount to adjust (float * 1e6). */
|
|
1149
|
-
ntli: v.pipe(
|
|
1149
|
+
ntli: v.pipe(UnsignedInteger, v.description("Amount to adjust (float * 1e6).")),
|
|
1150
1150
|
}), v.description("Action to perform.")),
|
|
1151
1151
|
/** Unique request identifier (current timestamp in ms). */
|
|
1152
|
-
nonce: v.pipe(
|
|
1152
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1153
1153
|
/** Cryptographic signature. */
|
|
1154
1154
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1155
1155
|
/** Vault address (for vault trading). */
|
|
1156
1156
|
vaultAddress: v.pipe(v.optional(v.pipe(Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
1157
1157
|
/** Expiration time of the action. */
|
|
1158
|
-
expiresAfter: v.pipe(v.optional(
|
|
1158
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1159
1159
|
}), v.transform(removeUndefinedKeys), v.description("Add or remove margin from isolated position."));
|
|
1160
1160
|
/**
|
|
1161
1161
|
* Update cross or isolated leverage on a coin.
|
|
1162
1162
|
* @returns {SuccessResponse}
|
|
1163
1163
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-leverage
|
|
1164
1164
|
*/
|
|
1165
|
-
export const UpdateLeverageRequest = v.pipe(v.
|
|
1165
|
+
export const UpdateLeverageRequest = v.pipe(v.object({
|
|
1166
1166
|
/** Action to perform. */
|
|
1167
|
-
action: v.pipe(v.
|
|
1167
|
+
action: v.pipe(v.object({
|
|
1168
1168
|
/** Type of action. */
|
|
1169
1169
|
type: v.pipe(v.literal("updateLeverage"), v.description("Type of action.")),
|
|
1170
1170
|
/** Asset ID. */
|
|
1171
|
-
asset: v.pipe(
|
|
1171
|
+
asset: v.pipe(UnsignedInteger, v.description("Asset ID.")),
|
|
1172
1172
|
/** `true` for cross leverage, `false` for isolated leverage. */
|
|
1173
1173
|
isCross: v.pipe(v.boolean(), v.description("`true` for cross leverage, `false` for isolated leverage.")),
|
|
1174
1174
|
/** New leverage value. */
|
|
1175
|
-
leverage: v.pipe(v.pipe(
|
|
1175
|
+
leverage: v.pipe(v.pipe(UnsignedInteger, v.minValue(1)), v.description("New leverage value.")),
|
|
1176
1176
|
}), v.description("Action to perform.")),
|
|
1177
1177
|
/** Unique request identifier (current timestamp in ms). */
|
|
1178
|
-
nonce: v.pipe(
|
|
1178
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1179
1179
|
/** Cryptographic signature. */
|
|
1180
1180
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1181
1181
|
/** Vault address (for vault trading). */
|
|
1182
1182
|
vaultAddress: v.pipe(v.optional(v.pipe(Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
1183
1183
|
/** Expiration time of the action. */
|
|
1184
|
-
expiresAfter: v.pipe(v.optional(
|
|
1184
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1185
1185
|
}), v.transform(removeUndefinedKeys), v.description("Update cross or isolated leverage on a coin."));
|
|
1186
1186
|
/**
|
|
1187
1187
|
* Transfer funds between Spot account and Perp account.
|
|
1188
1188
|
* @returns {SuccessResponse}
|
|
1189
1189
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#transfer-from-spot-account-to-perp-account-and-vice-versa
|
|
1190
1190
|
*/
|
|
1191
|
-
export const UsdClassTransferRequest = v.pipe(v.
|
|
1191
|
+
export const UsdClassTransferRequest = v.pipe(v.object({
|
|
1192
1192
|
/** Action to perform. */
|
|
1193
|
-
action: v.pipe(v.
|
|
1193
|
+
action: v.pipe(v.object({
|
|
1194
1194
|
/** Type of action. */
|
|
1195
1195
|
type: v.pipe(v.literal("usdClassTransfer"), v.description("Type of action.")),
|
|
1196
1196
|
/** Chain ID used for signing. */
|
|
@@ -1202,10 +1202,10 @@ export const UsdClassTransferRequest = v.pipe(v.strictObject({
|
|
|
1202
1202
|
/** `true` for Spot to Perp, `false` for Perp to Spot. */
|
|
1203
1203
|
toPerp: v.pipe(v.boolean(), v.description("`true` for Spot to Perp, `false` for Perp to Spot.")),
|
|
1204
1204
|
/** Unique request identifier (current timestamp in ms). */
|
|
1205
|
-
nonce: v.pipe(
|
|
1205
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1206
1206
|
}), v.description("Action to perform.")),
|
|
1207
1207
|
/** Unique request identifier (current timestamp in ms). */
|
|
1208
|
-
nonce: v.pipe(
|
|
1208
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1209
1209
|
/** Cryptographic signature. */
|
|
1210
1210
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1211
1211
|
}), v.transform(removeUndefinedKeys), v.description("Transfer funds between Spot account and Perp account."));
|
|
@@ -1214,9 +1214,9 @@ export const UsdClassTransferRequest = v.pipe(v.strictObject({
|
|
|
1214
1214
|
* @returns {SuccessResponse}
|
|
1215
1215
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-usdc-transfer
|
|
1216
1216
|
*/
|
|
1217
|
-
export const UsdSendRequest = v.pipe(v.
|
|
1217
|
+
export const UsdSendRequest = v.pipe(v.object({
|
|
1218
1218
|
/** Action to perform. */
|
|
1219
|
-
action: v.pipe(v.
|
|
1219
|
+
action: v.pipe(v.object({
|
|
1220
1220
|
/** Type of action. */
|
|
1221
1221
|
type: v.pipe(v.literal("usdSend"), v.description("Type of action.")),
|
|
1222
1222
|
/** Chain ID used for signing. */
|
|
@@ -1228,10 +1228,10 @@ export const UsdSendRequest = v.pipe(v.strictObject({
|
|
|
1228
1228
|
/** Amount to send (1 = 1$). */
|
|
1229
1229
|
amount: v.pipe(UnsignedDecimal, v.description("Amount to send (1 = 1$).")),
|
|
1230
1230
|
/** Unique request identifier (current timestamp in ms). */
|
|
1231
|
-
time: v.pipe(
|
|
1231
|
+
time: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1232
1232
|
}), v.description("Action to perform.")),
|
|
1233
1233
|
/** Unique request identifier (current timestamp in ms). */
|
|
1234
|
-
nonce: v.pipe(
|
|
1234
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1235
1235
|
/** Cryptographic signature. */
|
|
1236
1236
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1237
1237
|
}), v.transform(removeUndefinedKeys), v.description("Send usd to another address."));
|
|
@@ -1240,9 +1240,9 @@ export const UsdSendRequest = v.pipe(v.strictObject({
|
|
|
1240
1240
|
* @returns {SuccessResponse}
|
|
1241
1241
|
* @see null
|
|
1242
1242
|
*/
|
|
1243
|
-
export const VaultDistributeRequest = v.pipe(v.
|
|
1243
|
+
export const VaultDistributeRequest = v.pipe(v.object({
|
|
1244
1244
|
/** Action to perform. */
|
|
1245
|
-
action: v.pipe(v.
|
|
1245
|
+
action: v.pipe(v.object({
|
|
1246
1246
|
/** Type of action. */
|
|
1247
1247
|
type: v.pipe(v.literal("vaultDistribute"), v.description("Type of action.")),
|
|
1248
1248
|
/** Vault address. */
|
|
@@ -1252,24 +1252,24 @@ export const VaultDistributeRequest = v.pipe(v.strictObject({
|
|
|
1252
1252
|
*
|
|
1253
1253
|
* Set to 0 to close the vault.
|
|
1254
1254
|
*/
|
|
1255
|
-
usd: v.pipe(
|
|
1255
|
+
usd: v.pipe(UnsignedInteger, v.description("Amount to distribute (float * 1e6)." +
|
|
1256
1256
|
"\n\nSet to 0 to close the vault.")),
|
|
1257
1257
|
}), v.description("Action to perform.")),
|
|
1258
1258
|
/** Unique request identifier (current timestamp in ms). */
|
|
1259
|
-
nonce: v.pipe(
|
|
1259
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1260
1260
|
/** Cryptographic signature. */
|
|
1261
1261
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1262
1262
|
/** Expiration time of the action. */
|
|
1263
|
-
expiresAfter: v.pipe(v.optional(
|
|
1263
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1264
1264
|
}), v.transform(removeUndefinedKeys), v.description("Distribute funds from a vault between followers."));
|
|
1265
1265
|
/**
|
|
1266
1266
|
* Modify a vault configuration.
|
|
1267
1267
|
* @returns {SuccessResponse}
|
|
1268
1268
|
* @see null
|
|
1269
1269
|
*/
|
|
1270
|
-
export const VaultModifyRequest = v.pipe(v.
|
|
1270
|
+
export const VaultModifyRequest = v.pipe(v.object({
|
|
1271
1271
|
/** Action to perform. */
|
|
1272
|
-
action: v.pipe(v.
|
|
1272
|
+
action: v.pipe(v.object({
|
|
1273
1273
|
/** Type of action. */
|
|
1274
1274
|
type: v.pipe(v.literal("vaultModify"), v.description("Type of action.")),
|
|
1275
1275
|
/** Vault address. */
|
|
@@ -1280,20 +1280,20 @@ export const VaultModifyRequest = v.pipe(v.strictObject({
|
|
|
1280
1280
|
alwaysCloseOnWithdraw: v.pipe(v.nullable(v.boolean()), v.description("Always close positions on withdrawal.")),
|
|
1281
1281
|
}), v.description("Action to perform.")),
|
|
1282
1282
|
/** Unique request identifier (current timestamp in ms). */
|
|
1283
|
-
nonce: v.pipe(
|
|
1283
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1284
1284
|
/** Cryptographic signature. */
|
|
1285
1285
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1286
1286
|
/** Expiration time of the action. */
|
|
1287
|
-
expiresAfter: v.pipe(v.optional(
|
|
1287
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1288
1288
|
}), v.transform(removeUndefinedKeys), v.description("Modify a vault configuration."));
|
|
1289
1289
|
/**
|
|
1290
1290
|
* Deposit or withdraw from a vault.
|
|
1291
1291
|
* @returns {SuccessResponse}
|
|
1292
1292
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault
|
|
1293
1293
|
*/
|
|
1294
|
-
export const VaultTransferRequest = v.pipe(v.
|
|
1294
|
+
export const VaultTransferRequest = v.pipe(v.object({
|
|
1295
1295
|
/** Action to perform. */
|
|
1296
|
-
action: v.pipe(v.
|
|
1296
|
+
action: v.pipe(v.object({
|
|
1297
1297
|
/** Type of action. */
|
|
1298
1298
|
type: v.pipe(v.literal("vaultTransfer"), v.description("Type of action.")),
|
|
1299
1299
|
/** Vault address. */
|
|
@@ -1301,23 +1301,23 @@ export const VaultTransferRequest = v.pipe(v.strictObject({
|
|
|
1301
1301
|
/** `true` for deposit, `false` for withdrawal. */
|
|
1302
1302
|
isDeposit: v.pipe(v.boolean(), v.description("`true` for deposit, `false` for withdrawal.")),
|
|
1303
1303
|
/** Amount for deposit/withdrawal (float * 1e6). */
|
|
1304
|
-
usd: v.pipe(
|
|
1304
|
+
usd: v.pipe(UnsignedInteger, v.description("Amount for deposit/withdrawal (float * 1e6).")),
|
|
1305
1305
|
}), v.description("Action to perform.")),
|
|
1306
1306
|
/** Unique request identifier (current timestamp in ms). */
|
|
1307
|
-
nonce: v.pipe(
|
|
1307
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1308
1308
|
/** Cryptographic signature. */
|
|
1309
1309
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1310
1310
|
/** Expiration time of the action. */
|
|
1311
|
-
expiresAfter: v.pipe(v.optional(
|
|
1311
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1312
1312
|
}), v.transform(removeUndefinedKeys), v.description("Deposit or withdraw from a vault."));
|
|
1313
1313
|
/**
|
|
1314
1314
|
* Initiate a withdrawal request.
|
|
1315
1315
|
* @returns {SuccessResponse}
|
|
1316
1316
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
|
|
1317
1317
|
*/
|
|
1318
|
-
export const Withdraw3Request = v.pipe(v.
|
|
1318
|
+
export const Withdraw3Request = v.pipe(v.object({
|
|
1319
1319
|
/** Action to perform. */
|
|
1320
|
-
action: v.pipe(v.
|
|
1320
|
+
action: v.pipe(v.object({
|
|
1321
1321
|
/** Type of action. */
|
|
1322
1322
|
type: v.pipe(v.literal("withdraw3"), v.description("Type of action.")),
|
|
1323
1323
|
/** Chain ID used for signing. */
|
|
@@ -1329,10 +1329,10 @@ export const Withdraw3Request = v.pipe(v.strictObject({
|
|
|
1329
1329
|
/** Amount to withdraw (1 = 1$). */
|
|
1330
1330
|
amount: v.pipe(UnsignedDecimal, v.description("Amount to withdraw (1 = 1$).")),
|
|
1331
1331
|
/** Unique request identifier (current timestamp in ms). */
|
|
1332
|
-
time: v.pipe(
|
|
1332
|
+
time: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1333
1333
|
}), v.description("Action to perform.")),
|
|
1334
1334
|
/** Unique request identifier (current timestamp in ms). */
|
|
1335
|
-
nonce: v.pipe(
|
|
1335
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1336
1336
|
/** Cryptographic signature. */
|
|
1337
1337
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1338
1338
|
}), v.transform(removeUndefinedKeys), v.description("Initiate a withdrawal request."));
|
|
@@ -1341,9 +1341,9 @@ export const Withdraw3Request = v.pipe(v.strictObject({
|
|
|
1341
1341
|
* @returns {SuccessResponse}
|
|
1342
1342
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/multi-sig
|
|
1343
1343
|
*/
|
|
1344
|
-
export const MultiSigRequest = v.pipe(v.
|
|
1344
|
+
export const MultiSigRequest = v.pipe(v.object({
|
|
1345
1345
|
/** Action to perform. */
|
|
1346
|
-
action: v.pipe(v.
|
|
1346
|
+
action: v.pipe(v.object({
|
|
1347
1347
|
/** Type of action. */
|
|
1348
1348
|
type: v.pipe(v.literal("multiSig"), v.description("Type of action.")),
|
|
1349
1349
|
/** Chain ID used for signing. */
|
|
@@ -1351,7 +1351,7 @@ export const MultiSigRequest = v.pipe(v.strictObject({
|
|
|
1351
1351
|
/** List of signatures from authorized signers. */
|
|
1352
1352
|
signatures: v.pipe(v.array(Signature), v.description("List of signatures from authorized signers.")),
|
|
1353
1353
|
/** Multi-signature payload information. */
|
|
1354
|
-
payload: v.pipe(v.
|
|
1354
|
+
payload: v.pipe(v.object({
|
|
1355
1355
|
/** Address of the multi-signature user account. */
|
|
1356
1356
|
multiSigUser: v.pipe(v.pipe(Hex, v.length(42)), v.description("Address of the multi-signature user account.")),
|
|
1357
1357
|
/** Address of the authorized user initiating the request (any authorized user). */
|
|
@@ -1403,11 +1403,12 @@ export const MultiSigRequest = v.pipe(v.strictObject({
|
|
|
1403
1403
|
}), v.description("Multi-signature payload information.")),
|
|
1404
1404
|
}), v.description("Action to perform.")),
|
|
1405
1405
|
/** Unique request identifier (current timestamp in ms). */
|
|
1406
|
-
nonce: v.pipe(
|
|
1406
|
+
nonce: v.pipe(UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1407
1407
|
/** Cryptographic signature. */
|
|
1408
1408
|
signature: v.pipe(Signature, v.description("Cryptographic signature.")),
|
|
1409
1409
|
/** Vault address (for vault trading). */
|
|
1410
1410
|
vaultAddress: v.pipe(v.optional(v.pipe(Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
1411
1411
|
/** Expiration time of the action. */
|
|
1412
|
-
expiresAfter: v.pipe(v.optional(
|
|
1412
|
+
expiresAfter: v.pipe(v.optional(UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1413
1413
|
}), v.transform(removeUndefinedKeys), v.description("A multi-signature request."));
|
|
1414
|
+
//# sourceMappingURL=requests.js.map
|