@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
|
@@ -55,7 +55,7 @@ function removeUndefinedKeys(obj) {
|
|
|
55
55
|
}
|
|
56
56
|
const Percent = v.pipe(v.string(), v.regex(/^[0-9]+(\.[0-9]+)?%$/), v.transform((value) => value));
|
|
57
57
|
/** ECDSA signature components for Ethereum typed data. */
|
|
58
|
-
exports.Signature = v.pipe(v.
|
|
58
|
+
exports.Signature = v.pipe(v.object({
|
|
59
59
|
/** First 32-byte component of ECDSA signature. */
|
|
60
60
|
r: v.pipe(v.pipe(_base_js_1.Hex, v.length(66), v.transform((value) => value.replace(/^0x0+/, "0x"))), v.description("First 32-byte component of ECDSA signature.")),
|
|
61
61
|
/** Second 32-byte component of ECDSA signature. */
|
|
@@ -64,9 +64,9 @@ exports.Signature = v.pipe(v.strictObject({
|
|
|
64
64
|
v: v.pipe(v.union([v.literal(27), v.literal(28)]), v.description("Recovery identifier.")),
|
|
65
65
|
}), v.description("ECDSA signature components for Ethereum typed data."));
|
|
66
66
|
/** Order parameters. */
|
|
67
|
-
exports.OrderParams = v.pipe(v.
|
|
67
|
+
exports.OrderParams = v.pipe(v.object({
|
|
68
68
|
/** Asset ID. */
|
|
69
|
-
a: v.pipe(
|
|
69
|
+
a: v.pipe(_base_js_1.UnsignedInteger, v.description("Asset ID.")),
|
|
70
70
|
/** Position side (`true` for long, `false` for short). */
|
|
71
71
|
b: v.pipe(v.boolean(), v.description("Position side (`true` for long, `false` for short).")),
|
|
72
72
|
/** Price. */
|
|
@@ -77,9 +77,9 @@ exports.OrderParams = v.pipe(v.strictObject({
|
|
|
77
77
|
r: v.pipe(v.boolean(), v.description("Is reduce-only?")),
|
|
78
78
|
/** Order type. */
|
|
79
79
|
t: v.pipe(v.union([
|
|
80
|
-
v.
|
|
80
|
+
v.object({
|
|
81
81
|
/** Limit order parameters. */
|
|
82
|
-
limit: v.pipe(v.
|
|
82
|
+
limit: v.pipe(v.object({
|
|
83
83
|
/** Time-in-force. */
|
|
84
84
|
tif: v.pipe(v.union([
|
|
85
85
|
v.literal("Gtc"),
|
|
@@ -90,9 +90,9 @@ exports.OrderParams = v.pipe(v.strictObject({
|
|
|
90
90
|
]), v.description("Time-in-force.")),
|
|
91
91
|
}), v.description("Limit order parameters.")),
|
|
92
92
|
}),
|
|
93
|
-
v.
|
|
93
|
+
v.object({
|
|
94
94
|
/** Trigger order parameters. */
|
|
95
|
-
trigger: v.pipe(v.
|
|
95
|
+
trigger: v.pipe(v.object({
|
|
96
96
|
/** Is market order? */
|
|
97
97
|
isMarket: v.pipe(v.boolean(), v.description("Is market order?")),
|
|
98
98
|
/** Trigger price. */
|
|
@@ -110,9 +110,9 @@ exports.OrderParams = v.pipe(v.strictObject({
|
|
|
110
110
|
* @returns {SuccessResponse}
|
|
111
111
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-an-api-wallet
|
|
112
112
|
*/
|
|
113
|
-
exports.ApproveAgentRequest = v.pipe(v.
|
|
113
|
+
exports.ApproveAgentRequest = v.pipe(v.object({
|
|
114
114
|
/** Action to perform. */
|
|
115
|
-
action: v.pipe(v.
|
|
115
|
+
action: v.pipe(v.object({
|
|
116
116
|
/** Type of action. */
|
|
117
117
|
type: v.pipe(v.literal("approveAgent"), v.description("Type of action.")),
|
|
118
118
|
/** Chain ID used for signing. */
|
|
@@ -124,10 +124,10 @@ exports.ApproveAgentRequest = v.pipe(v.strictObject({
|
|
|
124
124
|
/** Agent name or null for unnamed agent. */
|
|
125
125
|
agentName: v.pipe(v.nullable(v.string()), v.description("Agent name or null for unnamed agent.")),
|
|
126
126
|
/** Unique request identifier (current timestamp in ms). */
|
|
127
|
-
nonce: v.pipe(
|
|
127
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
128
128
|
}), v.description("Action to perform.")),
|
|
129
129
|
/** Unique request identifier (current timestamp in ms). */
|
|
130
|
-
nonce: v.pipe(
|
|
130
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
131
131
|
/** Cryptographic signature. */
|
|
132
132
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
133
133
|
}), v.transform(removeUndefinedKeys), v.description("Approve an agent to sign on behalf of the master account."));
|
|
@@ -136,9 +136,9 @@ exports.ApproveAgentRequest = v.pipe(v.strictObject({
|
|
|
136
136
|
* @returns {SuccessResponse}
|
|
137
137
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-a-builder-fee
|
|
138
138
|
*/
|
|
139
|
-
exports.ApproveBuilderFeeRequest = v.pipe(v.
|
|
139
|
+
exports.ApproveBuilderFeeRequest = v.pipe(v.object({
|
|
140
140
|
/** Action to perform. */
|
|
141
|
-
action: v.pipe(v.
|
|
141
|
+
action: v.pipe(v.object({
|
|
142
142
|
/** Type of action. */
|
|
143
143
|
type: v.pipe(v.literal("approveBuilderFee"), v.description("Type of action.")),
|
|
144
144
|
/** Chain ID used for signing. */
|
|
@@ -150,10 +150,10 @@ exports.ApproveBuilderFeeRequest = v.pipe(v.strictObject({
|
|
|
150
150
|
/** Builder address. */
|
|
151
151
|
builder: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Builder address.")),
|
|
152
152
|
/** Unique request identifier (current timestamp in ms). */
|
|
153
|
-
nonce: v.pipe(
|
|
153
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
154
154
|
}), v.description("Action to perform.")),
|
|
155
155
|
/** Unique request identifier (current timestamp in ms). */
|
|
156
|
-
nonce: v.pipe(
|
|
156
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
157
157
|
/** Cryptographic signature. */
|
|
158
158
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
159
159
|
}), v.transform(removeUndefinedKeys), v.description("Approve a maximum fee rate for a builder."));
|
|
@@ -162,16 +162,16 @@ exports.ApproveBuilderFeeRequest = v.pipe(v.strictObject({
|
|
|
162
162
|
* @returns {OrderResponse}
|
|
163
163
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
|
|
164
164
|
*/
|
|
165
|
-
exports.BatchModifyRequest = v.pipe(v.
|
|
165
|
+
exports.BatchModifyRequest = v.pipe(v.object({
|
|
166
166
|
/** Action to perform. */
|
|
167
|
-
action: v.pipe(v.
|
|
167
|
+
action: v.pipe(v.object({
|
|
168
168
|
/** Type of action. */
|
|
169
169
|
type: v.pipe(v.literal("batchModify"), v.description("Type of action.")),
|
|
170
170
|
/** Order modifications. */
|
|
171
|
-
modifies: v.pipe(v.array(v.
|
|
171
|
+
modifies: v.pipe(v.array(v.object({
|
|
172
172
|
/** Order ID or Client Order ID. */
|
|
173
173
|
oid: v.pipe(v.union([
|
|
174
|
-
|
|
174
|
+
_base_js_1.UnsignedInteger,
|
|
175
175
|
v.pipe(_base_js_1.Hex, v.length(34)),
|
|
176
176
|
]), v.description("Order ID or Client Order ID.")),
|
|
177
177
|
/** New order parameters. */
|
|
@@ -179,76 +179,76 @@ exports.BatchModifyRequest = v.pipe(v.strictObject({
|
|
|
179
179
|
})), v.description("Order modifications.")),
|
|
180
180
|
}), v.description("Action to perform.")),
|
|
181
181
|
/** Unique request identifier (current timestamp in ms). */
|
|
182
|
-
nonce: v.pipe(
|
|
182
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
183
183
|
/** Cryptographic signature. */
|
|
184
184
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
185
185
|
/** Vault address (for vault trading). */
|
|
186
186
|
vaultAddress: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
187
187
|
/** Expiration time of the action. */
|
|
188
|
-
expiresAfter: v.pipe(v.optional(
|
|
188
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
189
189
|
}), v.transform(removeUndefinedKeys), v.description("Modify multiple orders."));
|
|
190
190
|
/**
|
|
191
191
|
* Cancel order(s).
|
|
192
192
|
* @returns {CancelResponse}
|
|
193
193
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
194
194
|
*/
|
|
195
|
-
exports.CancelRequest = v.pipe(v.
|
|
195
|
+
exports.CancelRequest = v.pipe(v.object({
|
|
196
196
|
/** Action to perform. */
|
|
197
|
-
action: v.pipe(v.
|
|
197
|
+
action: v.pipe(v.object({
|
|
198
198
|
/** Type of action. */
|
|
199
199
|
type: v.pipe(v.literal("cancel"), v.description("Type of action.")),
|
|
200
200
|
/** Orders to cancel. */
|
|
201
|
-
cancels: v.pipe(v.array(v.
|
|
201
|
+
cancels: v.pipe(v.array(v.object({
|
|
202
202
|
/** Asset ID. */
|
|
203
|
-
a: v.pipe(
|
|
203
|
+
a: v.pipe(_base_js_1.UnsignedInteger, v.description("Asset ID.")),
|
|
204
204
|
/** Order ID. */
|
|
205
|
-
o: v.pipe(
|
|
205
|
+
o: v.pipe(_base_js_1.UnsignedInteger, v.description("Order ID.")),
|
|
206
206
|
})), v.description("Orders to cancel.")),
|
|
207
207
|
}), v.description("Action to perform.")),
|
|
208
208
|
/** Unique request identifier (current timestamp in ms). */
|
|
209
|
-
nonce: v.pipe(
|
|
209
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
210
210
|
/** Cryptographic signature. */
|
|
211
211
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
212
212
|
/** Vault address (for vault trading). */
|
|
213
213
|
vaultAddress: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
214
214
|
/** Expiration time of the action. */
|
|
215
|
-
expiresAfter: v.pipe(v.optional(
|
|
215
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
216
216
|
}), v.transform(removeUndefinedKeys), v.description("Cancel order(s)."));
|
|
217
217
|
/**
|
|
218
218
|
* Cancel order(s) by cloid.
|
|
219
219
|
* @returns {CancelResponse}
|
|
220
220
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
221
221
|
*/
|
|
222
|
-
exports.CancelByCloidRequest = v.pipe(v.
|
|
222
|
+
exports.CancelByCloidRequest = v.pipe(v.object({
|
|
223
223
|
/** Action to perform. */
|
|
224
|
-
action: v.pipe(v.
|
|
224
|
+
action: v.pipe(v.object({
|
|
225
225
|
/** Type of action. */
|
|
226
226
|
type: v.pipe(v.literal("cancelByCloid"), v.description("Type of action.")),
|
|
227
227
|
/** Orders to cancel. */
|
|
228
|
-
cancels: v.pipe(v.array(v.
|
|
228
|
+
cancels: v.pipe(v.array(v.object({
|
|
229
229
|
/** Asset ID. */
|
|
230
|
-
asset: v.pipe(
|
|
230
|
+
asset: v.pipe(_base_js_1.UnsignedInteger, v.description("Asset ID.")),
|
|
231
231
|
/** Client Order ID. */
|
|
232
232
|
cloid: v.pipe(v.pipe(_base_js_1.Hex, v.length(34)), v.description("Client Order ID.")),
|
|
233
233
|
})), v.description("Orders to cancel.")),
|
|
234
234
|
}), v.description("Action to perform.")),
|
|
235
235
|
/** Unique request identifier (current timestamp in ms). */
|
|
236
|
-
nonce: v.pipe(
|
|
236
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
237
237
|
/** Cryptographic signature. */
|
|
238
238
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
239
239
|
/** Vault address (for vault trading). */
|
|
240
240
|
vaultAddress: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
241
241
|
/** Expiration time of the action. */
|
|
242
|
-
expiresAfter: v.pipe(v.optional(
|
|
242
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
243
243
|
}), v.transform(removeUndefinedKeys), v.description("Cancel order(s) by cloid."));
|
|
244
244
|
/**
|
|
245
245
|
* Transfer native token from the user spot account into staking for delegating to validators.
|
|
246
246
|
* @returns {SuccessResponse}
|
|
247
247
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-into-staking
|
|
248
248
|
*/
|
|
249
|
-
exports.CDepositRequest = v.pipe(v.
|
|
249
|
+
exports.CDepositRequest = v.pipe(v.object({
|
|
250
250
|
/** Action to perform. */
|
|
251
|
-
action: v.pipe(v.
|
|
251
|
+
action: v.pipe(v.object({
|
|
252
252
|
/** Type of action. */
|
|
253
253
|
type: v.pipe(v.literal("cDeposit"), v.description("Type of action.")),
|
|
254
254
|
/** Chain ID used for signing. */
|
|
@@ -256,12 +256,12 @@ exports.CDepositRequest = v.pipe(v.strictObject({
|
|
|
256
256
|
/** HyperLiquid network. */
|
|
257
257
|
hyperliquidChain: v.pipe(v.union([v.literal("Mainnet"), v.literal("Testnet")]), v.description("HyperLiquid network.")),
|
|
258
258
|
/** Amount of wei to deposit into staking balance (float * 1e8). */
|
|
259
|
-
wei: v.pipe(
|
|
259
|
+
wei: v.pipe(_base_js_1.UnsignedInteger, v.description("Amount of wei to deposit into staking balance (float * 1e8).")),
|
|
260
260
|
/** Unique request identifier (current timestamp in ms). */
|
|
261
|
-
nonce: v.pipe(
|
|
261
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
262
262
|
}), v.description("Action to perform.")),
|
|
263
263
|
/** Unique request identifier (current timestamp in ms). */
|
|
264
|
-
nonce: v.pipe(
|
|
264
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
265
265
|
/** Cryptographic signature. */
|
|
266
266
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
267
267
|
}), v.transform(removeUndefinedKeys), v.description("Transfer native token from the user spot account into staking for delegating to validators."));
|
|
@@ -270,26 +270,26 @@ exports.CDepositRequest = v.pipe(v.strictObject({
|
|
|
270
270
|
* @returns {SuccessResponse}
|
|
271
271
|
* @see null
|
|
272
272
|
*/
|
|
273
|
-
exports.ClaimRewardsRequest = v.pipe(v.
|
|
273
|
+
exports.ClaimRewardsRequest = v.pipe(v.object({
|
|
274
274
|
/** Action to perform. */
|
|
275
|
-
action: v.pipe(v.
|
|
275
|
+
action: v.pipe(v.object({
|
|
276
276
|
/** Type of action. */
|
|
277
277
|
type: v.pipe(v.literal("claimRewards"), v.description("Type of action.")),
|
|
278
278
|
}), v.description("Action to perform.")),
|
|
279
279
|
/** Unique request identifier (current timestamp in ms). */
|
|
280
|
-
nonce: v.pipe(
|
|
280
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
281
281
|
/** Cryptographic signature. */
|
|
282
282
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
283
283
|
/** Expiration time of the action. */
|
|
284
|
-
expiresAfter: v.pipe(v.optional(
|
|
284
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
285
285
|
}), v.transform(removeUndefinedKeys), v.description("Claim rewards from referral program."));
|
|
286
286
|
/** Signers configuration for {@linkcode ConvertToMultiSigUserRequest}. */
|
|
287
287
|
exports.ConvertToMultiSigUserRequestSigners = v.pipe(v.union([
|
|
288
|
-
v.
|
|
288
|
+
v.object({
|
|
289
289
|
/** List of authorized user addresses. */
|
|
290
290
|
authorizedUsers: v.pipe(v.array(v.pipe(_base_js_1.Hex, v.length(42))), v.description("List of authorized user addresses.")),
|
|
291
291
|
/** Minimum number of signatures required. */
|
|
292
|
-
threshold: v.pipe(
|
|
292
|
+
threshold: v.pipe(_base_js_1.UnsignedInteger, v.description("Minimum number of signatures required.")),
|
|
293
293
|
}),
|
|
294
294
|
/** Convert a multi-signature account to a single-signature account. */
|
|
295
295
|
v.pipe(v.null(), v.description("Convert a multi-signature account to a single-signature account.")),
|
|
@@ -299,9 +299,9 @@ exports.ConvertToMultiSigUserRequestSigners = v.pipe(v.union([
|
|
|
299
299
|
* @returns {SuccessResponse}
|
|
300
300
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/multi-sig
|
|
301
301
|
*/
|
|
302
|
-
exports.ConvertToMultiSigUserRequest = v.pipe(v.
|
|
302
|
+
exports.ConvertToMultiSigUserRequest = v.pipe(v.object({
|
|
303
303
|
/** Action to perform. */
|
|
304
|
-
action: v.pipe(v.
|
|
304
|
+
action: v.pipe(v.object({
|
|
305
305
|
/** Type of action. */
|
|
306
306
|
type: v.pipe(v.literal("convertToMultiSigUser"), v.description("Type of action.")),
|
|
307
307
|
/** Chain ID used for signing. */
|
|
@@ -319,10 +319,10 @@ exports.ConvertToMultiSigUserRequest = v.pipe(v.strictObject({
|
|
|
319
319
|
]), v.description("Signers configuration." +
|
|
320
320
|
"\n\nMust be `ConvertToMultiSigUserRequestSigners` converted to a string via `JSON.stringify(...)`.")),
|
|
321
321
|
/** Unique request identifier (current timestamp in ms). */
|
|
322
|
-
nonce: v.pipe(
|
|
322
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
323
323
|
}), v.description("Action to perform.")),
|
|
324
324
|
/** Unique request identifier (current timestamp in ms). */
|
|
325
|
-
nonce: v.pipe(
|
|
325
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
326
326
|
/** Cryptographic signature. */
|
|
327
327
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
328
328
|
}), v.transform(removeUndefinedKeys), v.description("Convert a single-signature account to a multi-signature account."));
|
|
@@ -331,29 +331,29 @@ exports.ConvertToMultiSigUserRequest = v.pipe(v.strictObject({
|
|
|
331
331
|
* @returns {CreateSubAccountResponse}
|
|
332
332
|
* @see null
|
|
333
333
|
*/
|
|
334
|
-
exports.CreateSubAccountRequest = v.pipe(v.
|
|
334
|
+
exports.CreateSubAccountRequest = v.pipe(v.object({
|
|
335
335
|
/** Action to perform. */
|
|
336
|
-
action: v.pipe(v.
|
|
336
|
+
action: v.pipe(v.object({
|
|
337
337
|
/** Type of action. */
|
|
338
338
|
type: v.pipe(v.literal("createSubAccount"), v.description("Type of action.")),
|
|
339
339
|
/** Sub-account name. */
|
|
340
340
|
name: v.pipe(v.string(), v.minLength(1), v.description("Sub-account name.")),
|
|
341
341
|
}), v.description("Action to perform.")),
|
|
342
342
|
/** Unique request identifier (current timestamp in ms). */
|
|
343
|
-
nonce: v.pipe(
|
|
343
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
344
344
|
/** Cryptographic signature. */
|
|
345
345
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
346
346
|
/** Expiration time of the action. */
|
|
347
|
-
expiresAfter: v.pipe(v.optional(
|
|
347
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
348
348
|
}), v.transform(removeUndefinedKeys), v.description("Create a sub-account."));
|
|
349
349
|
/**
|
|
350
350
|
* Create a vault.
|
|
351
351
|
* @returns {CreateVaultResponse}
|
|
352
352
|
* @see null
|
|
353
353
|
*/
|
|
354
|
-
exports.CreateVaultRequest = v.pipe(v.
|
|
354
|
+
exports.CreateVaultRequest = v.pipe(v.object({
|
|
355
355
|
/** Action to perform. */
|
|
356
|
-
action: v.pipe(v.
|
|
356
|
+
action: v.pipe(v.object({
|
|
357
357
|
/** Type of action. */
|
|
358
358
|
type: v.pipe(v.literal("createVault"), v.description("Type of action.")),
|
|
359
359
|
/** Vault name. */
|
|
@@ -361,17 +361,17 @@ exports.CreateVaultRequest = v.pipe(v.strictObject({
|
|
|
361
361
|
/** Vault description. */
|
|
362
362
|
description: v.pipe(v.string(), v.minLength(10), v.description("Vault description.")),
|
|
363
363
|
/** Initial balance (float * 1e6). */
|
|
364
|
-
initialUsd: v.pipe(
|
|
364
|
+
initialUsd: v.pipe(_base_js_1.UnsignedInteger, v.minValue(100000000), // 100 USDC
|
|
365
365
|
v.description("Initial balance (float * 1e6).")),
|
|
366
366
|
/** Unique request identifier (current timestamp in ms). */
|
|
367
|
-
nonce: v.pipe(
|
|
367
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
368
368
|
}), v.description("Action to perform.")),
|
|
369
369
|
/** Unique request identifier (current timestamp in ms). */
|
|
370
|
-
nonce: v.pipe(
|
|
370
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
371
371
|
/** Cryptographic signature. */
|
|
372
372
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
373
373
|
/** Expiration time of the action. */
|
|
374
|
-
expiresAfter: v.pipe(v.optional(
|
|
374
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
375
375
|
}), v.transform(removeUndefinedKeys), v.description("Create a vault."));
|
|
376
376
|
/**
|
|
377
377
|
* Perform an action on a signer:
|
|
@@ -380,16 +380,16 @@ exports.CreateVaultRequest = v.pipe(v.strictObject({
|
|
|
380
380
|
* @returns {SuccessResponse}
|
|
381
381
|
* @see null
|
|
382
382
|
*/
|
|
383
|
-
exports.CSignerActionRequest = v.pipe(v.
|
|
383
|
+
exports.CSignerActionRequest = v.pipe(v.object({
|
|
384
384
|
/** Action to perform. */
|
|
385
385
|
action: v.pipe(v.union([
|
|
386
|
-
v.
|
|
386
|
+
v.object({
|
|
387
387
|
/** Type of action. */
|
|
388
388
|
type: v.pipe(v.literal("CSignerAction"), v.description("Type of action.")),
|
|
389
389
|
/** Jail the signer. */
|
|
390
390
|
jailSelf: v.pipe(v.null(), v.description("Jail the signer.")),
|
|
391
391
|
}),
|
|
392
|
-
v.
|
|
392
|
+
v.object({
|
|
393
393
|
/** Type of action. */
|
|
394
394
|
type: v.pipe(v.literal("CSignerAction"), v.description("Type of action.")),
|
|
395
395
|
/** Unjail the signer. */
|
|
@@ -397,11 +397,11 @@ exports.CSignerActionRequest = v.pipe(v.strictObject({
|
|
|
397
397
|
}),
|
|
398
398
|
]), v.description("Action to perform.")),
|
|
399
399
|
/** Unique request identifier (current timestamp in ms). */
|
|
400
|
-
nonce: v.pipe(
|
|
400
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
401
401
|
/** Cryptographic signature. */
|
|
402
402
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
403
403
|
/** Expiration time of the action. */
|
|
404
|
-
expiresAfter: v.pipe(v.optional(
|
|
404
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
405
405
|
}), v.transform(removeUndefinedKeys), v.description("Perform an action on a signer." +
|
|
406
406
|
"\n- Jail to prevent them from signing transactions." +
|
|
407
407
|
"\n- Unjail to allow them to sign transactions again."));
|
|
@@ -413,17 +413,17 @@ exports.CSignerActionRequest = v.pipe(v.strictObject({
|
|
|
413
413
|
* @returns {SuccessResponse}
|
|
414
414
|
* @see null
|
|
415
415
|
*/
|
|
416
|
-
exports.CValidatorActionRequest = v.pipe(v.
|
|
416
|
+
exports.CValidatorActionRequest = v.pipe(v.object({
|
|
417
417
|
/** Action to perform. */
|
|
418
418
|
action: v.pipe(v.union([
|
|
419
|
-
v.
|
|
419
|
+
v.object({
|
|
420
420
|
/** Type of action. */
|
|
421
421
|
type: v.pipe(v.literal("CValidatorAction"), v.description("Type of action.")),
|
|
422
422
|
/** Profile changes to apply. */
|
|
423
|
-
changeProfile: v.pipe(v.
|
|
423
|
+
changeProfile: v.pipe(v.object({
|
|
424
424
|
/** Validator node IP address. */
|
|
425
425
|
node_ip: v.pipe(v.union([
|
|
426
|
-
v.
|
|
426
|
+
v.object({
|
|
427
427
|
/** IP address. */
|
|
428
428
|
Ip: v.pipe(v.string(), v.ip(), v.description("IP address.")),
|
|
429
429
|
}),
|
|
@@ -438,20 +438,20 @@ exports.CValidatorActionRequest = v.pipe(v.strictObject({
|
|
|
438
438
|
/** Enable or disable delegations. */
|
|
439
439
|
disable_delegations: v.pipe(v.nullable(v.boolean()), v.description("Enable or disable delegations.")),
|
|
440
440
|
/** Commission rate in basis points (1 = 0.0001%). */
|
|
441
|
-
commission_bps: v.pipe(v.nullable(
|
|
441
|
+
commission_bps: v.pipe(v.nullable(_base_js_1.UnsignedInteger), v.description("Commission rate in basis points (1 = 0.0001%).")),
|
|
442
442
|
/** Signer address. */
|
|
443
443
|
signer: v.pipe(v.nullable(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Signer address.")),
|
|
444
444
|
}), v.description("Profile changes to apply.")),
|
|
445
445
|
}),
|
|
446
|
-
v.
|
|
446
|
+
v.object({
|
|
447
447
|
/** Type of action. */
|
|
448
448
|
type: v.pipe(v.literal("CValidatorAction"), v.description("Type of action.")),
|
|
449
449
|
/** Registration parameters. */
|
|
450
|
-
register: v.pipe(v.
|
|
450
|
+
register: v.pipe(v.object({
|
|
451
451
|
/** Validator profile information. */
|
|
452
|
-
profile: v.pipe(v.
|
|
452
|
+
profile: v.pipe(v.object({
|
|
453
453
|
/** Validator node IP address. */
|
|
454
|
-
node_ip: v.pipe(v.
|
|
454
|
+
node_ip: v.pipe(v.object({
|
|
455
455
|
/** IP address. */
|
|
456
456
|
Ip: v.pipe(v.string(), v.ip(), v.description("IP address.")),
|
|
457
457
|
}), v.description("Validator node IP address.")),
|
|
@@ -462,17 +462,17 @@ exports.CValidatorActionRequest = v.pipe(v.strictObject({
|
|
|
462
462
|
/** Whether delegations are disabled. */
|
|
463
463
|
delegations_disabled: v.pipe(v.boolean(), v.description("Whether delegations are disabled.")),
|
|
464
464
|
/** Commission rate in basis points (1 = 0.0001%). */
|
|
465
|
-
commission_bps: v.pipe(
|
|
465
|
+
commission_bps: v.pipe(_base_js_1.UnsignedInteger, v.description("Commission rate in basis points (1 = 0.0001%).")),
|
|
466
466
|
/** Signer address. */
|
|
467
467
|
signer: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Signer address.")),
|
|
468
468
|
}), v.description("Validator profile information.")),
|
|
469
469
|
/** Initial jail status. */
|
|
470
470
|
unjailed: v.pipe(v.boolean(), v.description("Initial jail status.")),
|
|
471
471
|
/** Initial stake amount in wei. */
|
|
472
|
-
initial_wei: v.pipe(
|
|
472
|
+
initial_wei: v.pipe(_base_js_1.UnsignedInteger, v.description("Initial stake amount in wei.")),
|
|
473
473
|
}), v.description("Registration parameters.")),
|
|
474
474
|
}),
|
|
475
|
-
v.
|
|
475
|
+
v.object({
|
|
476
476
|
/** Type of action. */
|
|
477
477
|
type: v.pipe(v.literal("CValidatorAction"), v.description("Type of action.")),
|
|
478
478
|
/** Unregister the validator. */
|
|
@@ -480,11 +480,11 @@ exports.CValidatorActionRequest = v.pipe(v.strictObject({
|
|
|
480
480
|
}),
|
|
481
481
|
]), v.description("Action to perform.")),
|
|
482
482
|
/** Unique request identifier (current timestamp in ms). */
|
|
483
|
-
nonce: v.pipe(
|
|
483
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
484
484
|
/** Cryptographic signature. */
|
|
485
485
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
486
486
|
/** Expiration time of the action. */
|
|
487
|
-
expiresAfter: v.pipe(v.optional(
|
|
487
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
488
488
|
}), v.transform(removeUndefinedKeys), v.description("Perform an action on a validator:" +
|
|
489
489
|
"\n- Change profile information." +
|
|
490
490
|
"\n- Register a new validator." +
|
|
@@ -494,9 +494,9 @@ exports.CValidatorActionRequest = v.pipe(v.strictObject({
|
|
|
494
494
|
* @returns {SuccessResponse}
|
|
495
495
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#withdraw-from-staking
|
|
496
496
|
*/
|
|
497
|
-
exports.CWithdrawRequest = v.pipe(v.
|
|
497
|
+
exports.CWithdrawRequest = v.pipe(v.object({
|
|
498
498
|
/** Action to perform. */
|
|
499
|
-
action: v.pipe(v.
|
|
499
|
+
action: v.pipe(v.object({
|
|
500
500
|
/** Type of action. */
|
|
501
501
|
type: v.pipe(v.literal("cWithdraw"), v.description("Type of action.")),
|
|
502
502
|
/** Chain ID used for signing. */
|
|
@@ -504,12 +504,12 @@ exports.CWithdrawRequest = v.pipe(v.strictObject({
|
|
|
504
504
|
/** HyperLiquid network. */
|
|
505
505
|
hyperliquidChain: v.pipe(v.union([v.literal("Mainnet"), v.literal("Testnet")]), v.description("HyperLiquid network.")),
|
|
506
506
|
/** Amount of wei to withdraw from staking balance (float * 1e8). */
|
|
507
|
-
wei: v.pipe(
|
|
507
|
+
wei: v.pipe(_base_js_1.UnsignedInteger, v.description("Amount of wei to withdraw from staking balance (float * 1e8).")),
|
|
508
508
|
/** Unique request identifier (current timestamp in ms). */
|
|
509
|
-
nonce: v.pipe(
|
|
509
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
510
510
|
}), v.description("Action to perform.")),
|
|
511
511
|
/** Unique request identifier (current timestamp in ms). */
|
|
512
|
-
nonce: v.pipe(
|
|
512
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
513
513
|
/** Cryptographic signature. */
|
|
514
514
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
515
515
|
}), v.transform(removeUndefinedKeys), v.description("Transfer native token from staking into the user spot account."));
|
|
@@ -518,74 +518,74 @@ exports.CWithdrawRequest = v.pipe(v.strictObject({
|
|
|
518
518
|
* @returns {SuccessResponse}
|
|
519
519
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/dual-block-architecture
|
|
520
520
|
*/
|
|
521
|
-
exports.EvmUserModifyRequest = v.pipe(v.
|
|
521
|
+
exports.EvmUserModifyRequest = v.pipe(v.object({
|
|
522
522
|
/** Action to perform. */
|
|
523
|
-
action: v.pipe(v.
|
|
523
|
+
action: v.pipe(v.object({
|
|
524
524
|
/** Type of action. */
|
|
525
525
|
type: v.pipe(v.literal("evmUserModify"), v.description("Type of action.")),
|
|
526
526
|
/** `true` for large blocks, `false` for small blocks. */
|
|
527
527
|
usingBigBlocks: v.pipe(v.boolean(), v.description("`true` for large blocks, `false` for small blocks.")),
|
|
528
528
|
}), v.description("Action to perform.")),
|
|
529
529
|
/** Unique request identifier (current timestamp in ms). */
|
|
530
|
-
nonce: v.pipe(
|
|
530
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
531
531
|
/** Cryptographic signature. */
|
|
532
532
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
533
533
|
/** Expiration time of the action. */
|
|
534
|
-
expiresAfter: v.pipe(v.optional(
|
|
534
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
535
535
|
}), v.transform(removeUndefinedKeys), v.description("Configure block type for EVM transactions."));
|
|
536
536
|
/**
|
|
537
537
|
* Modify an order.
|
|
538
538
|
* @returns {SuccessResponse}
|
|
539
539
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
|
|
540
540
|
*/
|
|
541
|
-
exports.ModifyRequest = v.pipe(v.
|
|
541
|
+
exports.ModifyRequest = v.pipe(v.object({
|
|
542
542
|
/** Action to perform. */
|
|
543
|
-
action: v.pipe(v.
|
|
543
|
+
action: v.pipe(v.object({
|
|
544
544
|
/** Type of action. */
|
|
545
545
|
type: v.pipe(v.literal("modify"), v.description("Type of action.")),
|
|
546
546
|
/** Order ID or Client Order ID. */
|
|
547
547
|
oid: v.pipe(v.union([
|
|
548
|
-
|
|
548
|
+
_base_js_1.UnsignedInteger,
|
|
549
549
|
v.pipe(_base_js_1.Hex, v.length(34)),
|
|
550
550
|
]), v.description("Order ID or Client Order ID.")),
|
|
551
551
|
/** New order parameters. */
|
|
552
552
|
order: v.pipe(exports.OrderParams, v.description("New order parameters.")),
|
|
553
553
|
}), v.description("Action to perform.")),
|
|
554
554
|
/** Unique request identifier (current timestamp in ms). */
|
|
555
|
-
nonce: v.pipe(
|
|
555
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
556
556
|
/** Cryptographic signature. */
|
|
557
557
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
558
558
|
/** Vault address (for vault trading). */
|
|
559
559
|
vaultAddress: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
560
560
|
/** Expiration time of the action. */
|
|
561
|
-
expiresAfter: v.pipe(v.optional(
|
|
561
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
562
562
|
}), v.transform(removeUndefinedKeys), v.description("Modify an order."));
|
|
563
563
|
/**
|
|
564
564
|
* This action does not do anything (no operation), but causes the nonce to be marked as used.
|
|
565
565
|
* @returns {SuccessResponse}
|
|
566
566
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#invalidate-pending-nonce-noop
|
|
567
567
|
*/
|
|
568
|
-
exports.NoopRequest = v.pipe(v.
|
|
568
|
+
exports.NoopRequest = v.pipe(v.object({
|
|
569
569
|
/** Action to perform. */
|
|
570
|
-
action: v.pipe(v.
|
|
570
|
+
action: v.pipe(v.object({
|
|
571
571
|
/** Type of action. */
|
|
572
572
|
type: v.pipe(v.literal("noop"), v.description("Type of action.")),
|
|
573
573
|
}), v.description("Action to perform.")),
|
|
574
574
|
/** Unique request identifier (current timestamp in ms). */
|
|
575
|
-
nonce: v.pipe(
|
|
575
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
576
576
|
/** Cryptographic signature. */
|
|
577
577
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
578
578
|
/** Expiration time of the action. */
|
|
579
|
-
expiresAfter: v.pipe(v.optional(
|
|
579
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
580
580
|
}), v.transform(removeUndefinedKeys), v.description("This action does not do anything (no operation), but causes the nonce to be marked as used."));
|
|
581
581
|
/**
|
|
582
582
|
* Place an order(s).
|
|
583
583
|
* @returns {OrderResponse}
|
|
584
584
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
|
|
585
585
|
*/
|
|
586
|
-
exports.OrderRequest = v.pipe(v.
|
|
586
|
+
exports.OrderRequest = v.pipe(v.object({
|
|
587
587
|
/** Action to perform. */
|
|
588
|
-
action: v.pipe(v.
|
|
588
|
+
action: v.pipe(v.object({
|
|
589
589
|
/** Type of action. */
|
|
590
590
|
type: v.pipe(v.literal("order"), v.description("Type of action.")),
|
|
591
591
|
/** Order parameters. */
|
|
@@ -605,21 +605,21 @@ exports.OrderRequest = v.pipe(v.strictObject({
|
|
|
605
605
|
"\n- `normalTpsl`: TP/SL order with fixed size that doesn't adjust with position changes." +
|
|
606
606
|
"\n- `positionTpsl`: TP/SL order that adjusts proportionally with the position size.")),
|
|
607
607
|
/** Builder fee. */
|
|
608
|
-
builder: v.pipe(v.optional(v.
|
|
608
|
+
builder: v.pipe(v.optional(v.object({
|
|
609
609
|
/** Builder address. */
|
|
610
610
|
b: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Builder address.")),
|
|
611
611
|
/** Builder fee in 0.1bps (1 = 0.0001%). */
|
|
612
|
-
f: v.pipe(
|
|
612
|
+
f: v.pipe(_base_js_1.UnsignedInteger, v.description("Builder fee in 0.1bps (1 = 0.0001%).")),
|
|
613
613
|
})), v.description("Builder fee.")),
|
|
614
614
|
}), v.description("Action to perform.")),
|
|
615
615
|
/** Unique request identifier (current timestamp in ms). */
|
|
616
|
-
nonce: v.pipe(
|
|
616
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
617
617
|
/** Cryptographic signature. */
|
|
618
618
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
619
619
|
/** Vault address (for vault trading). */
|
|
620
620
|
vaultAddress: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
621
621
|
/** Expiration time of the action. */
|
|
622
|
-
expiresAfter: v.pipe(v.optional(
|
|
622
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
623
623
|
}), v.transform(removeUndefinedKeys), v.description("Place an order(s)."));
|
|
624
624
|
/**
|
|
625
625
|
* Deploying HIP-3 assets:
|
|
@@ -628,62 +628,62 @@ exports.OrderRequest = v.pipe(v.strictObject({
|
|
|
628
628
|
* @returns {SuccessResponse}
|
|
629
629
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-3-assets
|
|
630
630
|
*/
|
|
631
|
-
exports.PerpDeployRequest = v.pipe(v.
|
|
631
|
+
exports.PerpDeployRequest = v.pipe(v.object({
|
|
632
632
|
/** Action to perform. */
|
|
633
633
|
action: v.pipe(v.union([
|
|
634
|
-
v.pipe(v.
|
|
634
|
+
v.pipe(v.object({
|
|
635
635
|
/** Type of action. */
|
|
636
636
|
type: v.pipe(v.literal("perpDeploy"), v.description("Type of action.")),
|
|
637
637
|
/** Parameters for registering a new perpetual asset. */
|
|
638
|
-
registerAsset: v.pipe(v.
|
|
638
|
+
registerAsset: v.pipe(v.object({
|
|
639
639
|
/** Max gas in native token wei. If not provided, then uses current deploy auction price. */
|
|
640
|
-
maxGas: v.pipe(v.nullable(
|
|
640
|
+
maxGas: v.pipe(v.nullable(_base_js_1.UnsignedInteger), v.description("Max gas in native token wei. If not provided, then uses current deploy auction price.")),
|
|
641
641
|
/** Contains new asset listing parameters. */
|
|
642
|
-
assetRequest: v.pipe(v.
|
|
642
|
+
assetRequest: v.pipe(v.object({
|
|
643
643
|
/** Coin symbol for the new asset. */
|
|
644
644
|
coin: v.pipe(v.string(), v.description("Coin symbol for the new asset.")),
|
|
645
645
|
/** Number of decimal places for size. */
|
|
646
|
-
szDecimals: v.pipe(
|
|
646
|
+
szDecimals: v.pipe(_base_js_1.UnsignedInteger, v.description("Number of decimal places for size.")),
|
|
647
647
|
/** Initial oracle price for the asset. */
|
|
648
648
|
oraclePx: v.pipe(_base_js_1.UnsignedDecimal, v.description("Initial oracle price for the asset.")),
|
|
649
649
|
/** Margin table identifier for risk management. */
|
|
650
|
-
marginTableId: v.pipe(
|
|
650
|
+
marginTableId: v.pipe(_base_js_1.UnsignedInteger, v.description("Margin table identifier for risk management.")),
|
|
651
651
|
/** Whether the asset can only be traded with isolated margin. */
|
|
652
652
|
onlyIsolated: v.pipe(v.boolean(), v.description("Whether the asset can only be traded with isolated margin.")),
|
|
653
653
|
}), v.description("Contains new asset listing parameters.")),
|
|
654
654
|
/** Name of the dex. */
|
|
655
655
|
dex: v.pipe(v.string(), v.description("Name of the dex.")),
|
|
656
656
|
/** Contains new dex parameters. */
|
|
657
|
-
schema: v.pipe(v.nullable(v.
|
|
657
|
+
schema: v.pipe(v.nullable(v.object({
|
|
658
658
|
/** Full name of the dex. */
|
|
659
659
|
fullName: v.pipe(v.string(), v.description("Full name of the dex.")),
|
|
660
660
|
/** Collateral token index. */
|
|
661
|
-
collateralToken: v.pipe(
|
|
661
|
+
collateralToken: v.pipe(_base_js_1.UnsignedInteger, v.description("Collateral token index.")),
|
|
662
662
|
/** User to update oracles. If not provided, then deployer is assumed to be oracle updater. */
|
|
663
663
|
oracleUpdater: v.pipe(v.nullable(v.pipe(_base_js_1.Hex, v.length(42))), v.description("User to update oracles. If not provided, then deployer is assumed to be oracle updater.")),
|
|
664
664
|
})), v.description("Contains new dex parameters.")),
|
|
665
665
|
}), v.description("Parameters for registering a new perpetual asset.")),
|
|
666
666
|
}), v.description("Register asset variant")),
|
|
667
|
-
v.pipe(v.
|
|
667
|
+
v.pipe(v.object({
|
|
668
668
|
/** Type of action. */
|
|
669
669
|
type: v.pipe(v.literal("perpDeploy"), v.description("Type of action.")),
|
|
670
670
|
/** Parameters for setting oracle and mark prices for assets. */
|
|
671
|
-
setOracle: v.pipe(v.
|
|
671
|
+
setOracle: v.pipe(v.object({
|
|
672
672
|
/** Name of the dex. */
|
|
673
673
|
dex: v.pipe(v.string(), v.minLength(1), v.description("Name of the dex.")),
|
|
674
674
|
/** A list (sorted by key) of asset and oracle prices. */
|
|
675
|
-
oraclePxs: v.pipe(v.array(v.
|
|
675
|
+
oraclePxs: v.pipe(v.array(v.tuple([v.string(), _base_js_1.UnsignedDecimal])), v.description("A list (sorted by key) of asset and oracle prices.")),
|
|
676
676
|
/** An outer list of inner lists (inner list sorted by key) of asset and mark prices. */
|
|
677
|
-
markPxs: v.pipe(v.array(v.array(v.
|
|
677
|
+
markPxs: v.pipe(v.array(v.array(v.tuple([v.string(), _base_js_1.UnsignedDecimal]))), v.description("An outer list of inner lists (inner list sorted by key) of asset and mark prices.")),
|
|
678
678
|
}), v.description("Parameters for setting oracle and mark prices for assets.")),
|
|
679
679
|
}), v.description("Set oracle variant")),
|
|
680
680
|
]), v.description("Action to perform.")),
|
|
681
681
|
/** Unique request identifier (current timestamp in ms). */
|
|
682
|
-
nonce: v.pipe(
|
|
682
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
683
683
|
/** Cryptographic signature. */
|
|
684
684
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
685
685
|
/** Expiration time of the action. */
|
|
686
|
-
expiresAfter: v.pipe(v.optional(
|
|
686
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
687
687
|
}), v.transform(removeUndefinedKeys), v.description("Deploying HIP-3 assets:" +
|
|
688
688
|
"\n- Register Asset" +
|
|
689
689
|
"\n- Set Oracle"));
|
|
@@ -692,49 +692,49 @@ exports.PerpDeployRequest = v.pipe(v.strictObject({
|
|
|
692
692
|
* @returns {SuccessResponse}
|
|
693
693
|
* @see null
|
|
694
694
|
*/
|
|
695
|
-
exports.RegisterReferrerRequest = v.pipe(v.
|
|
695
|
+
exports.RegisterReferrerRequest = v.pipe(v.object({
|
|
696
696
|
/** Action to perform. */
|
|
697
|
-
action: v.pipe(v.
|
|
697
|
+
action: v.pipe(v.object({
|
|
698
698
|
/** Type of action. */
|
|
699
699
|
type: v.pipe(v.literal("registerReferrer"), v.description("Type of action.")),
|
|
700
700
|
/** Referral code to create. */
|
|
701
701
|
code: v.pipe(v.string(), v.minLength(1), v.description("Referral code to create.")),
|
|
702
702
|
}), v.description("Action to perform.")),
|
|
703
703
|
/** Unique request identifier (current timestamp in ms). */
|
|
704
|
-
nonce: v.pipe(
|
|
704
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
705
705
|
/** Cryptographic signature. */
|
|
706
706
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
707
707
|
/** Expiration time of the action. */
|
|
708
|
-
expiresAfter: v.pipe(v.optional(
|
|
708
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
709
709
|
}), v.transform(removeUndefinedKeys), v.description("Create a referral code."));
|
|
710
710
|
/**
|
|
711
711
|
* Reserve additional rate-limited actions for a fee.
|
|
712
712
|
* @returns {SuccessResponse}
|
|
713
713
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#reserve-additional-actions
|
|
714
714
|
*/
|
|
715
|
-
exports.ReserveRequestWeightRequest = v.pipe(v.
|
|
715
|
+
exports.ReserveRequestWeightRequest = v.pipe(v.object({
|
|
716
716
|
/** Action to perform. */
|
|
717
|
-
action: v.pipe(v.
|
|
717
|
+
action: v.pipe(v.object({
|
|
718
718
|
/** Type of action. */
|
|
719
719
|
type: v.pipe(v.literal("reserveRequestWeight"), v.description("Type of action.")),
|
|
720
720
|
/** Amount of request weight to reserve. */
|
|
721
|
-
weight: v.pipe(
|
|
721
|
+
weight: v.pipe(_base_js_1.UnsignedInteger, v.description("Amount of request weight to reserve.")),
|
|
722
722
|
}), v.description("Action to perform.")),
|
|
723
723
|
/** Unique request identifier (current timestamp in ms). */
|
|
724
|
-
nonce: v.pipe(
|
|
724
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
725
725
|
/** Cryptographic signature. */
|
|
726
726
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
727
727
|
/** Expiration time of the action. */
|
|
728
|
-
expiresAfter: v.pipe(v.optional(
|
|
728
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
729
729
|
}), v.transform(removeUndefinedKeys), v.description("Reserve additional rate-limited actions for a fee."));
|
|
730
730
|
/**
|
|
731
731
|
* Schedule a cancel-all operation at a future time.
|
|
732
732
|
* @returns {SuccessResponse}
|
|
733
733
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#schedule-cancel-dead-mans-switch
|
|
734
734
|
*/
|
|
735
|
-
exports.ScheduleCancelRequest = v.pipe(v.
|
|
735
|
+
exports.ScheduleCancelRequest = v.pipe(v.object({
|
|
736
736
|
/** Action to perform. */
|
|
737
|
-
action: v.pipe(v.
|
|
737
|
+
action: v.pipe(v.object({
|
|
738
738
|
/** Type of action. */
|
|
739
739
|
type: v.pipe(v.literal("scheduleCancel"), v.description("Type of action.")),
|
|
740
740
|
/**
|
|
@@ -743,27 +743,27 @@ exports.ScheduleCancelRequest = v.pipe(v.strictObject({
|
|
|
743
743
|
*
|
|
744
744
|
* If not specified, will cause all scheduled cancel operations to be deleted.
|
|
745
745
|
*/
|
|
746
|
-
time: v.pipe(v.optional(
|
|
746
|
+
time: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Scheduled time (in ms since epoch)." +
|
|
747
747
|
"\nMust be at least 5 seconds in the future." +
|
|
748
748
|
"\n\nIf not specified, will cause all scheduled cancel operations to be deleted.")),
|
|
749
749
|
}), v.description("Action to perform.")),
|
|
750
750
|
/** Unique request identifier (current timestamp in ms). */
|
|
751
|
-
nonce: v.pipe(
|
|
751
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
752
752
|
/** Cryptographic signature. */
|
|
753
753
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
754
754
|
/** Vault address (for vault trading). */
|
|
755
755
|
vaultAddress: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
756
756
|
/** Expiration time of the action. */
|
|
757
|
-
expiresAfter: v.pipe(v.optional(
|
|
757
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
758
758
|
}), v.transform(removeUndefinedKeys), v.description("Schedule a cancel-all operation at a future time."));
|
|
759
759
|
/**
|
|
760
760
|
* Transfer tokens between different perp DEXs, spot balance, users, and/or sub-accounts.
|
|
761
761
|
* @returns {SuccessResponse}
|
|
762
762
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#send-asset-testnet-only
|
|
763
763
|
*/
|
|
764
|
-
exports.SendAssetRequest = v.pipe(v.
|
|
764
|
+
exports.SendAssetRequest = v.pipe(v.object({
|
|
765
765
|
/** Action to perform. */
|
|
766
|
-
action: v.pipe(v.
|
|
766
|
+
action: v.pipe(v.object({
|
|
767
767
|
/** Type of action. */
|
|
768
768
|
type: v.pipe(v.literal("sendAsset"), v.description("Type of action.")),
|
|
769
769
|
/** Chain ID used for signing. */
|
|
@@ -786,10 +786,10 @@ exports.SendAssetRequest = v.pipe(v.strictObject({
|
|
|
786
786
|
v.pipe(_base_js_1.Hex, v.length(42)),
|
|
787
787
|
]), v.description('Source sub-account address ("" for main account).')),
|
|
788
788
|
/** Unique request identifier (current timestamp in ms). */
|
|
789
|
-
nonce: v.pipe(
|
|
789
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
790
790
|
}), v.description("Action to perform.")),
|
|
791
791
|
/** Unique request identifier (current timestamp in ms). */
|
|
792
|
-
nonce: v.pipe(
|
|
792
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
793
793
|
/** Cryptographic signature. */
|
|
794
794
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
795
795
|
}), v.transform(removeUndefinedKeys), v.description("Transfer tokens between different perp DEXs, spot balance, users, and/or sub-accounts."));
|
|
@@ -798,9 +798,9 @@ exports.SendAssetRequest = v.pipe(v.strictObject({
|
|
|
798
798
|
* @returns {SuccessResponse}
|
|
799
799
|
* @see null
|
|
800
800
|
*/
|
|
801
|
-
exports.SetDisplayNameRequest = v.pipe(v.
|
|
801
|
+
exports.SetDisplayNameRequest = v.pipe(v.object({
|
|
802
802
|
/** Action to perform. */
|
|
803
|
-
action: v.pipe(v.
|
|
803
|
+
action: v.pipe(v.object({
|
|
804
804
|
/** Type of action. */
|
|
805
805
|
type: v.pipe(v.literal("setDisplayName"), v.description("Type of action.")),
|
|
806
806
|
/**
|
|
@@ -812,31 +812,31 @@ exports.SetDisplayNameRequest = v.pipe(v.strictObject({
|
|
|
812
812
|
"\n\nSet to an empty string to remove the display name.")),
|
|
813
813
|
}), v.description("Action to perform.")),
|
|
814
814
|
/** Unique request identifier (current timestamp in ms). */
|
|
815
|
-
nonce: v.pipe(
|
|
815
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
816
816
|
/** Cryptographic signature. */
|
|
817
817
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
818
818
|
/** Expiration time of the action. */
|
|
819
|
-
expiresAfter: v.pipe(v.optional(
|
|
819
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
820
820
|
}), v.transform(removeUndefinedKeys), v.description("Set the display name in the leaderboard."));
|
|
821
821
|
/**
|
|
822
822
|
* Set a referral code.
|
|
823
823
|
* @returns {SuccessResponse}
|
|
824
824
|
* @see null
|
|
825
825
|
*/
|
|
826
|
-
exports.SetReferrerRequest = v.pipe(v.
|
|
826
|
+
exports.SetReferrerRequest = v.pipe(v.object({
|
|
827
827
|
/** Action to perform. */
|
|
828
|
-
action: v.pipe(v.
|
|
828
|
+
action: v.pipe(v.object({
|
|
829
829
|
/** Type of action. */
|
|
830
830
|
type: v.pipe(v.literal("setReferrer"), v.description("Type of action.")),
|
|
831
831
|
/** Referral code. */
|
|
832
832
|
code: v.pipe(v.string(), v.minLength(1), v.description("Referral code.")),
|
|
833
833
|
}), v.description("Action to perform.")),
|
|
834
834
|
/** Unique request identifier (current timestamp in ms). */
|
|
835
|
-
nonce: v.pipe(
|
|
835
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
836
836
|
/** Cryptographic signature. */
|
|
837
837
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
838
838
|
/** Expiration time of the action. */
|
|
839
|
-
expiresAfter: v.pipe(v.optional(
|
|
839
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
840
840
|
}), v.transform(removeUndefinedKeys), v.description("Set a referral code."));
|
|
841
841
|
/**
|
|
842
842
|
* Deploying HIP-1 and HIP-2 assets:
|
|
@@ -849,107 +849,107 @@ exports.SetReferrerRequest = v.pipe(v.strictObject({
|
|
|
849
849
|
* @returns {SuccessResponse}
|
|
850
850
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-1-and-hip-2-assets
|
|
851
851
|
*/
|
|
852
|
-
exports.SpotDeployRequest = v.pipe(v.
|
|
852
|
+
exports.SpotDeployRequest = v.pipe(v.object({
|
|
853
853
|
/** Action to perform. */
|
|
854
854
|
action: v.pipe(v.union([
|
|
855
|
-
v.pipe(v.
|
|
855
|
+
v.pipe(v.object({
|
|
856
856
|
/** Type of action. */
|
|
857
857
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
858
858
|
/** Genesis parameters. */
|
|
859
|
-
genesis: v.pipe(v.
|
|
859
|
+
genesis: v.pipe(v.object({
|
|
860
860
|
/** Token identifier. */
|
|
861
|
-
token: v.pipe(
|
|
861
|
+
token: v.pipe(_base_js_1.UnsignedInteger, v.description("Token identifier.")),
|
|
862
862
|
/** Maximum token supply. */
|
|
863
863
|
maxSupply: v.pipe(_base_js_1.UnsignedDecimal, v.description("Maximum token supply.")),
|
|
864
864
|
/** Set hyperliquidity balance to 0. */
|
|
865
865
|
noHyperliquidity: v.pipe(v.optional(v.literal(true)), v.description("Set hyperliquidity balance to 0.")),
|
|
866
866
|
}), v.description("Genesis parameters.")),
|
|
867
867
|
}), v.description("Genesis variant")),
|
|
868
|
-
v.pipe(v.
|
|
868
|
+
v.pipe(v.object({
|
|
869
869
|
/** Type of action. */
|
|
870
870
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
871
871
|
/** Register hyperliquidity parameters. */
|
|
872
|
-
registerHyperliquidity: v.pipe(v.
|
|
872
|
+
registerHyperliquidity: v.pipe(v.object({
|
|
873
873
|
/** Spot index (distinct from base token index). */
|
|
874
|
-
spot: v.pipe(
|
|
874
|
+
spot: v.pipe(_base_js_1.UnsignedInteger, v.description("Spot index (distinct from base token index).")),
|
|
875
875
|
/** Starting price for liquidity seeding. */
|
|
876
876
|
startPx: v.pipe(_base_js_1.UnsignedDecimal, v.description("Starting price for liquidity seeding.")),
|
|
877
877
|
/** Order size as a float (not in wei). */
|
|
878
878
|
orderSz: v.pipe(_base_js_1.UnsignedDecimal, v.description("Order size as a float (not in wei).")),
|
|
879
879
|
/** Total number of orders to place. */
|
|
880
|
-
nOrders: v.pipe(
|
|
880
|
+
nOrders: v.pipe(_base_js_1.UnsignedInteger, v.description("Total number of orders to place.")),
|
|
881
881
|
/** Number of levels to seed with USDC. */
|
|
882
|
-
nSeededLevels: v.pipe(v.optional(
|
|
882
|
+
nSeededLevels: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Number of levels to seed with USDC.")),
|
|
883
883
|
}), v.description("Register hyperliquidity parameters.")),
|
|
884
884
|
}), v.description("Register hyperliquidity variant")),
|
|
885
|
-
v.pipe(v.
|
|
885
|
+
v.pipe(v.object({
|
|
886
886
|
/** Type of action. */
|
|
887
887
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
888
888
|
/** Register spot parameters. */
|
|
889
|
-
registerSpot: v.pipe(v.
|
|
889
|
+
registerSpot: v.pipe(v.object({
|
|
890
890
|
/** Tuple containing base and quote token indices. */
|
|
891
|
-
tokens: v.pipe(v.
|
|
892
|
-
|
|
893
|
-
|
|
891
|
+
tokens: v.pipe(v.tuple([
|
|
892
|
+
_base_js_1.UnsignedInteger,
|
|
893
|
+
_base_js_1.UnsignedInteger,
|
|
894
894
|
]), v.description("Tuple containing base and quote token indices.")),
|
|
895
895
|
}), v.description("Register spot parameters.")),
|
|
896
896
|
}), v.description("Register spot variant")),
|
|
897
|
-
v.pipe(v.
|
|
897
|
+
v.pipe(v.object({
|
|
898
898
|
/** Type of action. */
|
|
899
899
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
900
900
|
/** Register token parameters. */
|
|
901
|
-
registerToken2: v.pipe(v.
|
|
901
|
+
registerToken2: v.pipe(v.object({
|
|
902
902
|
/** Token specifications. */
|
|
903
|
-
spec: v.pipe(v.
|
|
903
|
+
spec: v.pipe(v.object({
|
|
904
904
|
/** Token name. */
|
|
905
905
|
name: v.pipe(v.string(), v.description("Token name.")),
|
|
906
906
|
/** Number of decimals for token size. */
|
|
907
|
-
szDecimals: v.pipe(
|
|
907
|
+
szDecimals: v.pipe(_base_js_1.UnsignedInteger, v.description("Number of decimals for token size.")),
|
|
908
908
|
/** Number of decimals for token amounts in wei. */
|
|
909
|
-
weiDecimals: v.pipe(
|
|
909
|
+
weiDecimals: v.pipe(_base_js_1.UnsignedInteger, v.description("Number of decimals for token amounts in wei.")),
|
|
910
910
|
}), v.description("Token specifications.")),
|
|
911
911
|
/** Maximum gas allowed for registration. */
|
|
912
|
-
maxGas: v.pipe(
|
|
912
|
+
maxGas: v.pipe(_base_js_1.UnsignedInteger, v.description("Maximum gas allowed for registration.")),
|
|
913
913
|
/** Optional full token name. */
|
|
914
914
|
fullName: v.pipe(v.optional(v.string()), v.description("Optional full token name.")),
|
|
915
915
|
}), v.description("Register token parameters.")),
|
|
916
916
|
}), v.description("Register token variant")),
|
|
917
|
-
v.pipe(v.
|
|
917
|
+
v.pipe(v.object({
|
|
918
918
|
/** Type of action. */
|
|
919
919
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
920
920
|
/** Set deployer trading fee share parameters. */
|
|
921
|
-
setDeployerTradingFeeShare: v.pipe(v.
|
|
921
|
+
setDeployerTradingFeeShare: v.pipe(v.object({
|
|
922
922
|
/** Token identifier. */
|
|
923
|
-
token: v.pipe(
|
|
923
|
+
token: v.pipe(_base_js_1.UnsignedInteger, v.description("Token identifier.")),
|
|
924
924
|
/** The deployer trading fee share. Range is 0% to 100%. */
|
|
925
925
|
share: v.pipe(Percent, v.description("The deployer trading fee share. Range is 0% to 100%.")),
|
|
926
926
|
}), v.description("Set deployer trading fee share parameters.")),
|
|
927
927
|
}), v.description("Set deployer trading fee share variant")),
|
|
928
|
-
v.pipe(v.
|
|
928
|
+
v.pipe(v.object({
|
|
929
929
|
/** Type of action. */
|
|
930
930
|
type: v.pipe(v.literal("spotDeploy"), v.description("Type of action.")),
|
|
931
931
|
/** User genesis parameters. */
|
|
932
|
-
userGenesis: v.pipe(v.
|
|
932
|
+
userGenesis: v.pipe(v.object({
|
|
933
933
|
/** Token identifier. */
|
|
934
|
-
token: v.pipe(
|
|
934
|
+
token: v.pipe(_base_js_1.UnsignedInteger, v.description("Token identifier.")),
|
|
935
935
|
/** Array of tuples: [user address, genesis amount in wei]. */
|
|
936
|
-
userAndWei: v.pipe(v.array(v.
|
|
936
|
+
userAndWei: v.pipe(v.array(v.tuple([v.pipe(_base_js_1.Hex, v.length(42)), _base_js_1.UnsignedDecimal])), v.description("Array of tuples: [user address, genesis amount in wei].")),
|
|
937
937
|
/** Array of tuples: [existing token identifier, genesis amount in wei]. */
|
|
938
|
-
existingTokenAndWei: v.pipe(v.array(v.
|
|
939
|
-
|
|
938
|
+
existingTokenAndWei: v.pipe(v.array(v.tuple([
|
|
939
|
+
_base_js_1.UnsignedInteger,
|
|
940
940
|
_base_js_1.UnsignedDecimal,
|
|
941
941
|
])), v.description("Array of tuples: [existing token identifier, genesis amount in wei].")),
|
|
942
942
|
/** Array of tuples: [user address, blacklist status] (`true` for blacklist, `false` to remove existing blacklisted user). */
|
|
943
|
-
blacklistUsers: v.pipe(v.optional(v.array(v.
|
|
943
|
+
blacklistUsers: v.pipe(v.optional(v.array(v.tuple([v.pipe(_base_js_1.Hex, v.length(42)), v.boolean()]))), v.description("Array of tuples: [user address, blacklist status] (`true` for blacklist, `false` to remove existing blacklisted user).")),
|
|
944
944
|
}), v.description("User genesis parameters.")),
|
|
945
945
|
}), v.description("User genesis variant")),
|
|
946
946
|
]), v.description("Action to perform.")),
|
|
947
947
|
/** Unique request identifier (current timestamp in ms). */
|
|
948
|
-
nonce: v.pipe(
|
|
948
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
949
949
|
/** Cryptographic signature. */
|
|
950
950
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
951
951
|
/** Expiration time of the action. */
|
|
952
|
-
expiresAfter: v.pipe(v.optional(
|
|
952
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
953
953
|
}), v.transform(removeUndefinedKeys), v.description("Deploying HIP-1 and HIP-2 assets:" +
|
|
954
954
|
"\n- Genesis" +
|
|
955
955
|
"\n- Register Hyperliquidity" +
|
|
@@ -962,9 +962,9 @@ exports.SpotDeployRequest = v.pipe(v.strictObject({
|
|
|
962
962
|
* @returns {SuccessResponse}
|
|
963
963
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-spot-transfer
|
|
964
964
|
*/
|
|
965
|
-
exports.SpotSendRequest = v.pipe(v.
|
|
965
|
+
exports.SpotSendRequest = v.pipe(v.object({
|
|
966
966
|
/** Action to perform. */
|
|
967
|
-
action: v.pipe(v.
|
|
967
|
+
action: v.pipe(v.object({
|
|
968
968
|
/** Type of action. */
|
|
969
969
|
type: v.pipe(v.literal("spotSend"), v.description("Type of action.")),
|
|
970
970
|
/** Chain ID used for signing. */
|
|
@@ -978,10 +978,10 @@ exports.SpotSendRequest = v.pipe(v.strictObject({
|
|
|
978
978
|
/** Amount to send (not in wei). */
|
|
979
979
|
amount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount to send (not in wei).")),
|
|
980
980
|
/** Unique request identifier (current timestamp in ms). */
|
|
981
|
-
time: v.pipe(
|
|
981
|
+
time: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
982
982
|
}), v.description("Action to perform.")),
|
|
983
983
|
/** Unique request identifier (current timestamp in ms). */
|
|
984
|
-
nonce: v.pipe(
|
|
984
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
985
985
|
/** Cryptographic signature. */
|
|
986
986
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
987
987
|
}), v.transform(removeUndefinedKeys), v.description("Send spot assets to another address."));
|
|
@@ -990,32 +990,32 @@ exports.SpotSendRequest = v.pipe(v.strictObject({
|
|
|
990
990
|
* @returns {SuccessResponse}
|
|
991
991
|
* @see null
|
|
992
992
|
*/
|
|
993
|
-
exports.SpotUserRequest = v.pipe(v.
|
|
993
|
+
exports.SpotUserRequest = v.pipe(v.object({
|
|
994
994
|
/** Action to perform. */
|
|
995
|
-
action: v.pipe(v.
|
|
995
|
+
action: v.pipe(v.object({
|
|
996
996
|
/** Type of action. */
|
|
997
997
|
type: v.pipe(v.literal("spotUser"), v.description("Type of action.")),
|
|
998
998
|
/** Spot dusting options. */
|
|
999
|
-
toggleSpotDusting: v.pipe(v.
|
|
999
|
+
toggleSpotDusting: v.pipe(v.object({
|
|
1000
1000
|
/** Opt out of spot dusting. */
|
|
1001
1001
|
optOut: v.pipe(v.boolean(), v.description("Opt out of spot dusting.")),
|
|
1002
1002
|
}), v.description("Spot dusting options.")),
|
|
1003
1003
|
}), v.description("Action to perform.")),
|
|
1004
1004
|
/** Unique request identifier (current timestamp in ms). */
|
|
1005
|
-
nonce: v.pipe(
|
|
1005
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1006
1006
|
/** Cryptographic signature. */
|
|
1007
1007
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1008
1008
|
/** Expiration time of the action. */
|
|
1009
|
-
expiresAfter: v.pipe(v.optional(
|
|
1009
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1010
1010
|
}), v.transform(removeUndefinedKeys), v.description("Opt Out of Spot Dusting."));
|
|
1011
1011
|
/**
|
|
1012
1012
|
* Modify a sub-account.
|
|
1013
1013
|
* @returns {SuccessResponse}
|
|
1014
1014
|
* @see null
|
|
1015
1015
|
*/
|
|
1016
|
-
exports.SubAccountModifyRequest = v.pipe(v.
|
|
1016
|
+
exports.SubAccountModifyRequest = v.pipe(v.object({
|
|
1017
1017
|
/** Action to perform. */
|
|
1018
|
-
action: v.pipe(v.
|
|
1018
|
+
action: v.pipe(v.object({
|
|
1019
1019
|
/** Type of action. */
|
|
1020
1020
|
type: v.pipe(v.literal("subAccountModify"), v.description("Type of action.")),
|
|
1021
1021
|
/** Sub-account address to modify. */
|
|
@@ -1024,20 +1024,20 @@ exports.SubAccountModifyRequest = v.pipe(v.strictObject({
|
|
|
1024
1024
|
name: v.pipe(v.string(), v.minLength(1), v.description("New sub-account name.")),
|
|
1025
1025
|
}), v.description("Action to perform.")),
|
|
1026
1026
|
/** Unique request identifier (current timestamp in ms). */
|
|
1027
|
-
nonce: v.pipe(
|
|
1027
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1028
1028
|
/** Cryptographic signature. */
|
|
1029
1029
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1030
1030
|
/** Expiration time of the action. */
|
|
1031
|
-
expiresAfter: v.pipe(v.optional(
|
|
1031
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1032
1032
|
}), v.transform(removeUndefinedKeys), v.description("Modify a sub-account."));
|
|
1033
1033
|
/**
|
|
1034
1034
|
* Transfer between sub-accounts (spot).
|
|
1035
1035
|
* @returns {SuccessResponse}
|
|
1036
1036
|
* @see null
|
|
1037
1037
|
*/
|
|
1038
|
-
exports.SubAccountSpotTransferRequest = v.pipe(v.
|
|
1038
|
+
exports.SubAccountSpotTransferRequest = v.pipe(v.object({
|
|
1039
1039
|
/** Action to perform. */
|
|
1040
|
-
action: v.pipe(v.
|
|
1040
|
+
action: v.pipe(v.object({
|
|
1041
1041
|
/** Type of action. */
|
|
1042
1042
|
type: v.pipe(v.literal("subAccountSpotTransfer"), v.description("Type of action.")),
|
|
1043
1043
|
/** Sub-account address. */
|
|
@@ -1050,20 +1050,20 @@ exports.SubAccountSpotTransferRequest = v.pipe(v.strictObject({
|
|
|
1050
1050
|
amount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount to send (not in wei).")),
|
|
1051
1051
|
}), v.description("Action to perform.")),
|
|
1052
1052
|
/** Unique request identifier (current timestamp in ms). */
|
|
1053
|
-
nonce: v.pipe(
|
|
1053
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1054
1054
|
/** Cryptographic signature. */
|
|
1055
1055
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1056
1056
|
/** Expiration time of the action. */
|
|
1057
|
-
expiresAfter: v.pipe(v.optional(
|
|
1057
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1058
1058
|
}), v.transform(removeUndefinedKeys), v.description("Transfer between sub-accounts (spot)."));
|
|
1059
1059
|
/**
|
|
1060
1060
|
* Transfer between sub-accounts (perpetual).
|
|
1061
1061
|
* @returns {SuccessResponse}
|
|
1062
1062
|
* @see null
|
|
1063
1063
|
*/
|
|
1064
|
-
exports.SubAccountTransferRequest = v.pipe(v.
|
|
1064
|
+
exports.SubAccountTransferRequest = v.pipe(v.object({
|
|
1065
1065
|
/** Action to perform. */
|
|
1066
|
-
action: v.pipe(v.
|
|
1066
|
+
action: v.pipe(v.object({
|
|
1067
1067
|
/** Type of action. */
|
|
1068
1068
|
type: v.pipe(v.literal("subAccountTransfer"), v.description("Type of action.")),
|
|
1069
1069
|
/** Sub-account address. */
|
|
@@ -1071,23 +1071,23 @@ exports.SubAccountTransferRequest = v.pipe(v.strictObject({
|
|
|
1071
1071
|
/** `true` for deposit, `false` for withdrawal. */
|
|
1072
1072
|
isDeposit: v.pipe(v.boolean(), v.description("`true` for deposit, `false` for withdrawal.")),
|
|
1073
1073
|
/** Amount to transfer (float * 1e6). */
|
|
1074
|
-
usd: v.pipe(
|
|
1074
|
+
usd: v.pipe(_base_js_1.UnsignedInteger, v.description("Amount to transfer (float * 1e6).")),
|
|
1075
1075
|
}), v.description("Action to perform.")),
|
|
1076
1076
|
/** Unique request identifier (current timestamp in ms). */
|
|
1077
|
-
nonce: v.pipe(
|
|
1077
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1078
1078
|
/** Cryptographic signature. */
|
|
1079
1079
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1080
1080
|
/** Expiration time of the action. */
|
|
1081
|
-
expiresAfter: v.pipe(v.optional(
|
|
1081
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1082
1082
|
}), v.transform(removeUndefinedKeys), v.description("Transfer between sub-accounts (perpetual)."));
|
|
1083
1083
|
/**
|
|
1084
1084
|
* Delegate or undelegate native tokens to or from a validator.
|
|
1085
1085
|
* @returns {SuccessResponse}
|
|
1086
1086
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#delegate-or-undelegate-stake-from-validator
|
|
1087
1087
|
*/
|
|
1088
|
-
exports.TokenDelegateRequest = v.pipe(v.
|
|
1088
|
+
exports.TokenDelegateRequest = v.pipe(v.object({
|
|
1089
1089
|
/** Action to perform. */
|
|
1090
|
-
action: v.pipe(v.
|
|
1090
|
+
action: v.pipe(v.object({
|
|
1091
1091
|
/** Type of action. */
|
|
1092
1092
|
type: v.pipe(v.literal("tokenDelegate"), v.description("Type of action.")),
|
|
1093
1093
|
/** Chain ID used for signing. */
|
|
@@ -1097,14 +1097,14 @@ exports.TokenDelegateRequest = v.pipe(v.strictObject({
|
|
|
1097
1097
|
/** Validator address. */
|
|
1098
1098
|
validator: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Validator address.")),
|
|
1099
1099
|
/** Amount for delegate/undelegate (float * 1e8). */
|
|
1100
|
-
wei: v.pipe(
|
|
1100
|
+
wei: v.pipe(_base_js_1.UnsignedInteger, v.description("Amount for delegate/undelegate (float * 1e8).")),
|
|
1101
1101
|
/** `true` for undelegate, `false` for delegate. */
|
|
1102
1102
|
isUndelegate: v.pipe(v.boolean(), v.description("`true` for undelegate, `false` for delegate.")),
|
|
1103
1103
|
/** Unique request identifier (current timestamp in ms). */
|
|
1104
|
-
nonce: v.pipe(
|
|
1104
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1105
1105
|
}), v.description("Action to perform.")),
|
|
1106
1106
|
/** Unique request identifier (current timestamp in ms). */
|
|
1107
|
-
nonce: v.pipe(
|
|
1107
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1108
1108
|
/** Cryptographic signature. */
|
|
1109
1109
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1110
1110
|
}), v.transform(removeUndefinedKeys), v.description("Delegate or undelegate native tokens to or from a validator."));
|
|
@@ -1113,39 +1113,39 @@ exports.TokenDelegateRequest = v.pipe(v.strictObject({
|
|
|
1113
1113
|
* @returns {TwapCancelResponse}
|
|
1114
1114
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-a-twap-order
|
|
1115
1115
|
*/
|
|
1116
|
-
exports.TwapCancelRequest = v.pipe(v.
|
|
1116
|
+
exports.TwapCancelRequest = v.pipe(v.object({
|
|
1117
1117
|
/** Action to perform. */
|
|
1118
|
-
action: v.pipe(v.
|
|
1118
|
+
action: v.pipe(v.object({
|
|
1119
1119
|
/** Type of action. */
|
|
1120
1120
|
type: v.pipe(v.literal("twapCancel"), v.description("Type of action.")),
|
|
1121
1121
|
/** Asset ID. */
|
|
1122
|
-
a: v.pipe(
|
|
1122
|
+
a: v.pipe(_base_js_1.UnsignedInteger, v.description("Asset ID.")),
|
|
1123
1123
|
/** Twap ID. */
|
|
1124
|
-
t: v.pipe(
|
|
1124
|
+
t: v.pipe(_base_js_1.UnsignedInteger, v.description("Twap ID.")),
|
|
1125
1125
|
}), v.description("Action to perform.")),
|
|
1126
1126
|
/** Unique request identifier (current timestamp in ms). */
|
|
1127
|
-
nonce: v.pipe(
|
|
1127
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1128
1128
|
/** Cryptographic signature. */
|
|
1129
1129
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1130
1130
|
/** Vault address (for vault trading). */
|
|
1131
1131
|
vaultAddress: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
1132
1132
|
/** Expiration time of the action. */
|
|
1133
|
-
expiresAfter: v.pipe(v.optional(
|
|
1133
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1134
1134
|
}), v.transform(removeUndefinedKeys), v.description("Cancel a TWAP order."));
|
|
1135
1135
|
/**
|
|
1136
1136
|
* Place a TWAP order.
|
|
1137
1137
|
* @returns {TwapOrderResponse}
|
|
1138
1138
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-a-twap-order
|
|
1139
1139
|
*/
|
|
1140
|
-
exports.TwapOrderRequest = v.pipe(v.
|
|
1140
|
+
exports.TwapOrderRequest = v.pipe(v.object({
|
|
1141
1141
|
/** Action to perform. */
|
|
1142
|
-
action: v.pipe(v.
|
|
1142
|
+
action: v.pipe(v.object({
|
|
1143
1143
|
/** Type of action. */
|
|
1144
1144
|
type: v.pipe(v.literal("twapOrder"), v.description("Type of action.")),
|
|
1145
1145
|
/** Twap parameters. */
|
|
1146
|
-
twap: v.pipe(v.
|
|
1146
|
+
twap: v.pipe(v.object({
|
|
1147
1147
|
/** Asset ID. */
|
|
1148
|
-
a: v.pipe(
|
|
1148
|
+
a: v.pipe(_base_js_1.UnsignedInteger, v.description("Asset ID.")),
|
|
1149
1149
|
/** Position side (`true` for long, `false` for short). */
|
|
1150
1150
|
b: v.pipe(v.boolean(), v.description("Position side (`true` for long, `false` for short).")),
|
|
1151
1151
|
/** Size (in base currency units). */
|
|
@@ -1153,80 +1153,80 @@ exports.TwapOrderRequest = v.pipe(v.strictObject({
|
|
|
1153
1153
|
/** Is reduce-only? */
|
|
1154
1154
|
r: v.pipe(v.boolean(), v.description("Is reduce-only?")),
|
|
1155
1155
|
/** TWAP duration in minutes. */
|
|
1156
|
-
m: v.pipe(
|
|
1156
|
+
m: v.pipe(_base_js_1.UnsignedInteger, v.description("TWAP duration in minutes.")),
|
|
1157
1157
|
/** Enable random order timing. */
|
|
1158
1158
|
t: v.pipe(v.boolean(), v.description("Enable random order timing.")),
|
|
1159
1159
|
}), v.description("Twap parameters.")),
|
|
1160
1160
|
}), v.description("Action to perform.")),
|
|
1161
1161
|
/** Unique request identifier (current timestamp in ms). */
|
|
1162
|
-
nonce: v.pipe(
|
|
1162
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1163
1163
|
/** Cryptographic signature. */
|
|
1164
1164
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1165
1165
|
/** Vault address (for vault trading). */
|
|
1166
1166
|
vaultAddress: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
1167
1167
|
/** Expiration time of the action. */
|
|
1168
|
-
expiresAfter: v.pipe(v.optional(
|
|
1168
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1169
1169
|
}), v.transform(removeUndefinedKeys), v.description("Place a TWAP order."));
|
|
1170
1170
|
/**
|
|
1171
1171
|
* Add or remove margin from isolated position.
|
|
1172
1172
|
* @returns {SuccessResponse}
|
|
1173
1173
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
|
|
1174
1174
|
*/
|
|
1175
|
-
exports.UpdateIsolatedMarginRequest = v.pipe(v.
|
|
1175
|
+
exports.UpdateIsolatedMarginRequest = v.pipe(v.object({
|
|
1176
1176
|
/** Action to perform. */
|
|
1177
|
-
action: v.pipe(v.
|
|
1177
|
+
action: v.pipe(v.object({
|
|
1178
1178
|
/** Type of action. */
|
|
1179
1179
|
type: v.pipe(v.literal("updateIsolatedMargin"), v.description("Type of action.")),
|
|
1180
1180
|
/** Asset ID. */
|
|
1181
|
-
asset: v.pipe(
|
|
1181
|
+
asset: v.pipe(_base_js_1.UnsignedInteger, v.description("Asset ID.")),
|
|
1182
1182
|
/** Position side (`true` for long, `false` for short). */
|
|
1183
1183
|
isBuy: v.pipe(v.boolean(), v.description("Position side (`true` for long, `false` for short).")),
|
|
1184
1184
|
/** Amount to adjust (float * 1e6). */
|
|
1185
|
-
ntli: v.pipe(
|
|
1185
|
+
ntli: v.pipe(_base_js_1.UnsignedInteger, v.description("Amount to adjust (float * 1e6).")),
|
|
1186
1186
|
}), v.description("Action to perform.")),
|
|
1187
1187
|
/** Unique request identifier (current timestamp in ms). */
|
|
1188
|
-
nonce: v.pipe(
|
|
1188
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1189
1189
|
/** Cryptographic signature. */
|
|
1190
1190
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1191
1191
|
/** Vault address (for vault trading). */
|
|
1192
1192
|
vaultAddress: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
1193
1193
|
/** Expiration time of the action. */
|
|
1194
|
-
expiresAfter: v.pipe(v.optional(
|
|
1194
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1195
1195
|
}), v.transform(removeUndefinedKeys), v.description("Add or remove margin from isolated position."));
|
|
1196
1196
|
/**
|
|
1197
1197
|
* Update cross or isolated leverage on a coin.
|
|
1198
1198
|
* @returns {SuccessResponse}
|
|
1199
1199
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-leverage
|
|
1200
1200
|
*/
|
|
1201
|
-
exports.UpdateLeverageRequest = v.pipe(v.
|
|
1201
|
+
exports.UpdateLeverageRequest = v.pipe(v.object({
|
|
1202
1202
|
/** Action to perform. */
|
|
1203
|
-
action: v.pipe(v.
|
|
1203
|
+
action: v.pipe(v.object({
|
|
1204
1204
|
/** Type of action. */
|
|
1205
1205
|
type: v.pipe(v.literal("updateLeverage"), v.description("Type of action.")),
|
|
1206
1206
|
/** Asset ID. */
|
|
1207
|
-
asset: v.pipe(
|
|
1207
|
+
asset: v.pipe(_base_js_1.UnsignedInteger, v.description("Asset ID.")),
|
|
1208
1208
|
/** `true` for cross leverage, `false` for isolated leverage. */
|
|
1209
1209
|
isCross: v.pipe(v.boolean(), v.description("`true` for cross leverage, `false` for isolated leverage.")),
|
|
1210
1210
|
/** New leverage value. */
|
|
1211
|
-
leverage: v.pipe(v.pipe(
|
|
1211
|
+
leverage: v.pipe(v.pipe(_base_js_1.UnsignedInteger, v.minValue(1)), v.description("New leverage value.")),
|
|
1212
1212
|
}), v.description("Action to perform.")),
|
|
1213
1213
|
/** Unique request identifier (current timestamp in ms). */
|
|
1214
|
-
nonce: v.pipe(
|
|
1214
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1215
1215
|
/** Cryptographic signature. */
|
|
1216
1216
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1217
1217
|
/** Vault address (for vault trading). */
|
|
1218
1218
|
vaultAddress: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
1219
1219
|
/** Expiration time of the action. */
|
|
1220
|
-
expiresAfter: v.pipe(v.optional(
|
|
1220
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1221
1221
|
}), v.transform(removeUndefinedKeys), v.description("Update cross or isolated leverage on a coin."));
|
|
1222
1222
|
/**
|
|
1223
1223
|
* Transfer funds between Spot account and Perp account.
|
|
1224
1224
|
* @returns {SuccessResponse}
|
|
1225
1225
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#transfer-from-spot-account-to-perp-account-and-vice-versa
|
|
1226
1226
|
*/
|
|
1227
|
-
exports.UsdClassTransferRequest = v.pipe(v.
|
|
1227
|
+
exports.UsdClassTransferRequest = v.pipe(v.object({
|
|
1228
1228
|
/** Action to perform. */
|
|
1229
|
-
action: v.pipe(v.
|
|
1229
|
+
action: v.pipe(v.object({
|
|
1230
1230
|
/** Type of action. */
|
|
1231
1231
|
type: v.pipe(v.literal("usdClassTransfer"), v.description("Type of action.")),
|
|
1232
1232
|
/** Chain ID used for signing. */
|
|
@@ -1238,10 +1238,10 @@ exports.UsdClassTransferRequest = v.pipe(v.strictObject({
|
|
|
1238
1238
|
/** `true` for Spot to Perp, `false` for Perp to Spot. */
|
|
1239
1239
|
toPerp: v.pipe(v.boolean(), v.description("`true` for Spot to Perp, `false` for Perp to Spot.")),
|
|
1240
1240
|
/** Unique request identifier (current timestamp in ms). */
|
|
1241
|
-
nonce: v.pipe(
|
|
1241
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1242
1242
|
}), v.description("Action to perform.")),
|
|
1243
1243
|
/** Unique request identifier (current timestamp in ms). */
|
|
1244
|
-
nonce: v.pipe(
|
|
1244
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1245
1245
|
/** Cryptographic signature. */
|
|
1246
1246
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1247
1247
|
}), v.transform(removeUndefinedKeys), v.description("Transfer funds between Spot account and Perp account."));
|
|
@@ -1250,9 +1250,9 @@ exports.UsdClassTransferRequest = v.pipe(v.strictObject({
|
|
|
1250
1250
|
* @returns {SuccessResponse}
|
|
1251
1251
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-usdc-transfer
|
|
1252
1252
|
*/
|
|
1253
|
-
exports.UsdSendRequest = v.pipe(v.
|
|
1253
|
+
exports.UsdSendRequest = v.pipe(v.object({
|
|
1254
1254
|
/** Action to perform. */
|
|
1255
|
-
action: v.pipe(v.
|
|
1255
|
+
action: v.pipe(v.object({
|
|
1256
1256
|
/** Type of action. */
|
|
1257
1257
|
type: v.pipe(v.literal("usdSend"), v.description("Type of action.")),
|
|
1258
1258
|
/** Chain ID used for signing. */
|
|
@@ -1264,10 +1264,10 @@ exports.UsdSendRequest = v.pipe(v.strictObject({
|
|
|
1264
1264
|
/** Amount to send (1 = 1$). */
|
|
1265
1265
|
amount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount to send (1 = 1$).")),
|
|
1266
1266
|
/** Unique request identifier (current timestamp in ms). */
|
|
1267
|
-
time: v.pipe(
|
|
1267
|
+
time: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1268
1268
|
}), v.description("Action to perform.")),
|
|
1269
1269
|
/** Unique request identifier (current timestamp in ms). */
|
|
1270
|
-
nonce: v.pipe(
|
|
1270
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1271
1271
|
/** Cryptographic signature. */
|
|
1272
1272
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1273
1273
|
}), v.transform(removeUndefinedKeys), v.description("Send usd to another address."));
|
|
@@ -1276,9 +1276,9 @@ exports.UsdSendRequest = v.pipe(v.strictObject({
|
|
|
1276
1276
|
* @returns {SuccessResponse}
|
|
1277
1277
|
* @see null
|
|
1278
1278
|
*/
|
|
1279
|
-
exports.VaultDistributeRequest = v.pipe(v.
|
|
1279
|
+
exports.VaultDistributeRequest = v.pipe(v.object({
|
|
1280
1280
|
/** Action to perform. */
|
|
1281
|
-
action: v.pipe(v.
|
|
1281
|
+
action: v.pipe(v.object({
|
|
1282
1282
|
/** Type of action. */
|
|
1283
1283
|
type: v.pipe(v.literal("vaultDistribute"), v.description("Type of action.")),
|
|
1284
1284
|
/** Vault address. */
|
|
@@ -1288,24 +1288,24 @@ exports.VaultDistributeRequest = v.pipe(v.strictObject({
|
|
|
1288
1288
|
*
|
|
1289
1289
|
* Set to 0 to close the vault.
|
|
1290
1290
|
*/
|
|
1291
|
-
usd: v.pipe(
|
|
1291
|
+
usd: v.pipe(_base_js_1.UnsignedInteger, v.description("Amount to distribute (float * 1e6)." +
|
|
1292
1292
|
"\n\nSet to 0 to close the vault.")),
|
|
1293
1293
|
}), v.description("Action to perform.")),
|
|
1294
1294
|
/** Unique request identifier (current timestamp in ms). */
|
|
1295
|
-
nonce: v.pipe(
|
|
1295
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1296
1296
|
/** Cryptographic signature. */
|
|
1297
1297
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1298
1298
|
/** Expiration time of the action. */
|
|
1299
|
-
expiresAfter: v.pipe(v.optional(
|
|
1299
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1300
1300
|
}), v.transform(removeUndefinedKeys), v.description("Distribute funds from a vault between followers."));
|
|
1301
1301
|
/**
|
|
1302
1302
|
* Modify a vault configuration.
|
|
1303
1303
|
* @returns {SuccessResponse}
|
|
1304
1304
|
* @see null
|
|
1305
1305
|
*/
|
|
1306
|
-
exports.VaultModifyRequest = v.pipe(v.
|
|
1306
|
+
exports.VaultModifyRequest = v.pipe(v.object({
|
|
1307
1307
|
/** Action to perform. */
|
|
1308
|
-
action: v.pipe(v.
|
|
1308
|
+
action: v.pipe(v.object({
|
|
1309
1309
|
/** Type of action. */
|
|
1310
1310
|
type: v.pipe(v.literal("vaultModify"), v.description("Type of action.")),
|
|
1311
1311
|
/** Vault address. */
|
|
@@ -1316,20 +1316,20 @@ exports.VaultModifyRequest = v.pipe(v.strictObject({
|
|
|
1316
1316
|
alwaysCloseOnWithdraw: v.pipe(v.nullable(v.boolean()), v.description("Always close positions on withdrawal.")),
|
|
1317
1317
|
}), v.description("Action to perform.")),
|
|
1318
1318
|
/** Unique request identifier (current timestamp in ms). */
|
|
1319
|
-
nonce: v.pipe(
|
|
1319
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1320
1320
|
/** Cryptographic signature. */
|
|
1321
1321
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1322
1322
|
/** Expiration time of the action. */
|
|
1323
|
-
expiresAfter: v.pipe(v.optional(
|
|
1323
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1324
1324
|
}), v.transform(removeUndefinedKeys), v.description("Modify a vault configuration."));
|
|
1325
1325
|
/**
|
|
1326
1326
|
* Deposit or withdraw from a vault.
|
|
1327
1327
|
* @returns {SuccessResponse}
|
|
1328
1328
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault
|
|
1329
1329
|
*/
|
|
1330
|
-
exports.VaultTransferRequest = v.pipe(v.
|
|
1330
|
+
exports.VaultTransferRequest = v.pipe(v.object({
|
|
1331
1331
|
/** Action to perform. */
|
|
1332
|
-
action: v.pipe(v.
|
|
1332
|
+
action: v.pipe(v.object({
|
|
1333
1333
|
/** Type of action. */
|
|
1334
1334
|
type: v.pipe(v.literal("vaultTransfer"), v.description("Type of action.")),
|
|
1335
1335
|
/** Vault address. */
|
|
@@ -1337,23 +1337,23 @@ exports.VaultTransferRequest = v.pipe(v.strictObject({
|
|
|
1337
1337
|
/** `true` for deposit, `false` for withdrawal. */
|
|
1338
1338
|
isDeposit: v.pipe(v.boolean(), v.description("`true` for deposit, `false` for withdrawal.")),
|
|
1339
1339
|
/** Amount for deposit/withdrawal (float * 1e6). */
|
|
1340
|
-
usd: v.pipe(
|
|
1340
|
+
usd: v.pipe(_base_js_1.UnsignedInteger, v.description("Amount for deposit/withdrawal (float * 1e6).")),
|
|
1341
1341
|
}), v.description("Action to perform.")),
|
|
1342
1342
|
/** Unique request identifier (current timestamp in ms). */
|
|
1343
|
-
nonce: v.pipe(
|
|
1343
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1344
1344
|
/** Cryptographic signature. */
|
|
1345
1345
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1346
1346
|
/** Expiration time of the action. */
|
|
1347
|
-
expiresAfter: v.pipe(v.optional(
|
|
1347
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1348
1348
|
}), v.transform(removeUndefinedKeys), v.description("Deposit or withdraw from a vault."));
|
|
1349
1349
|
/**
|
|
1350
1350
|
* Initiate a withdrawal request.
|
|
1351
1351
|
* @returns {SuccessResponse}
|
|
1352
1352
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
|
|
1353
1353
|
*/
|
|
1354
|
-
exports.Withdraw3Request = v.pipe(v.
|
|
1354
|
+
exports.Withdraw3Request = v.pipe(v.object({
|
|
1355
1355
|
/** Action to perform. */
|
|
1356
|
-
action: v.pipe(v.
|
|
1356
|
+
action: v.pipe(v.object({
|
|
1357
1357
|
/** Type of action. */
|
|
1358
1358
|
type: v.pipe(v.literal("withdraw3"), v.description("Type of action.")),
|
|
1359
1359
|
/** Chain ID used for signing. */
|
|
@@ -1365,10 +1365,10 @@ exports.Withdraw3Request = v.pipe(v.strictObject({
|
|
|
1365
1365
|
/** Amount to withdraw (1 = 1$). */
|
|
1366
1366
|
amount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount to withdraw (1 = 1$).")),
|
|
1367
1367
|
/** Unique request identifier (current timestamp in ms). */
|
|
1368
|
-
time: v.pipe(
|
|
1368
|
+
time: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1369
1369
|
}), v.description("Action to perform.")),
|
|
1370
1370
|
/** Unique request identifier (current timestamp in ms). */
|
|
1371
|
-
nonce: v.pipe(
|
|
1371
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1372
1372
|
/** Cryptographic signature. */
|
|
1373
1373
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1374
1374
|
}), v.transform(removeUndefinedKeys), v.description("Initiate a withdrawal request."));
|
|
@@ -1377,9 +1377,9 @@ exports.Withdraw3Request = v.pipe(v.strictObject({
|
|
|
1377
1377
|
* @returns {SuccessResponse}
|
|
1378
1378
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/multi-sig
|
|
1379
1379
|
*/
|
|
1380
|
-
exports.MultiSigRequest = v.pipe(v.
|
|
1380
|
+
exports.MultiSigRequest = v.pipe(v.object({
|
|
1381
1381
|
/** Action to perform. */
|
|
1382
|
-
action: v.pipe(v.
|
|
1382
|
+
action: v.pipe(v.object({
|
|
1383
1383
|
/** Type of action. */
|
|
1384
1384
|
type: v.pipe(v.literal("multiSig"), v.description("Type of action.")),
|
|
1385
1385
|
/** Chain ID used for signing. */
|
|
@@ -1387,7 +1387,7 @@ exports.MultiSigRequest = v.pipe(v.strictObject({
|
|
|
1387
1387
|
/** List of signatures from authorized signers. */
|
|
1388
1388
|
signatures: v.pipe(v.array(exports.Signature), v.description("List of signatures from authorized signers.")),
|
|
1389
1389
|
/** Multi-signature payload information. */
|
|
1390
|
-
payload: v.pipe(v.
|
|
1390
|
+
payload: v.pipe(v.object({
|
|
1391
1391
|
/** Address of the multi-signature user account. */
|
|
1392
1392
|
multiSigUser: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the multi-signature user account.")),
|
|
1393
1393
|
/** Address of the authorized user initiating the request (any authorized user). */
|
|
@@ -1439,11 +1439,12 @@ exports.MultiSigRequest = v.pipe(v.strictObject({
|
|
|
1439
1439
|
}), v.description("Multi-signature payload information.")),
|
|
1440
1440
|
}), v.description("Action to perform.")),
|
|
1441
1441
|
/** Unique request identifier (current timestamp in ms). */
|
|
1442
|
-
nonce: v.pipe(
|
|
1442
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique request identifier (current timestamp in ms).")),
|
|
1443
1443
|
/** Cryptographic signature. */
|
|
1444
1444
|
signature: v.pipe(exports.Signature, v.description("Cryptographic signature.")),
|
|
1445
1445
|
/** Vault address (for vault trading). */
|
|
1446
1446
|
vaultAddress: v.pipe(v.optional(v.pipe(_base_js_1.Hex, v.length(42))), v.description("Vault address (for vault trading).")),
|
|
1447
1447
|
/** Expiration time of the action. */
|
|
1448
|
-
expiresAfter: v.pipe(v.optional(
|
|
1448
|
+
expiresAfter: v.pipe(v.optional(_base_js_1.UnsignedInteger), v.description("Expiration time of the action.")),
|
|
1449
1449
|
}), v.transform(removeUndefinedKeys), v.description("A multi-signature request."));
|
|
1450
|
+
//# sourceMappingURL=requests.js.map
|