@nktkas/hyperliquid 0.25.0-beta.3 → 0.25.0-beta.4

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.
Files changed (223) hide show
  1. package/README.md +108 -116
  2. package/esm/bin/_utils.d.ts +80 -0
  3. package/esm/bin/_utils.d.ts.map +1 -0
  4. package/esm/bin/_utils.js +112 -0
  5. package/esm/bin/_utils.js.map +1 -0
  6. package/esm/bin/cli.js +43 -161
  7. package/esm/bin/cli.js.map +1 -1
  8. package/esm/src/clients/exchange.d.ts +93 -93
  9. package/esm/src/clients/exchange.d.ts.map +1 -1
  10. package/esm/src/clients/exchange.js +63 -58
  11. package/esm/src/clients/exchange.js.map +1 -1
  12. package/esm/src/clients/info.d.ts +113 -113
  13. package/esm/src/clients/info.d.ts.map +1 -1
  14. package/esm/src/clients/info.js +70 -73
  15. package/esm/src/clients/info.js.map +1 -1
  16. package/esm/src/clients/multiSign.d.ts +3 -3
  17. package/esm/src/clients/multiSign.d.ts.map +1 -1
  18. package/esm/src/clients/multiSign.js +4 -2
  19. package/esm/src/clients/multiSign.js.map +1 -1
  20. package/esm/src/clients/subscription.d.ts +23 -23
  21. package/esm/src/clients/subscription.d.ts.map +1 -1
  22. package/esm/src/clients/subscription.js +8 -11
  23. package/esm/src/clients/subscription.js.map +1 -1
  24. package/esm/src/schemas/_base.d.ts +6 -8
  25. package/esm/src/schemas/_base.d.ts.map +1 -1
  26. package/esm/src/schemas/_base.js +5 -28
  27. package/esm/src/schemas/_base.js.map +1 -1
  28. package/esm/src/schemas/exchange/requests.d.ts +1676 -1657
  29. package/esm/src/schemas/exchange/requests.d.ts.map +1 -1
  30. package/esm/src/schemas/exchange/requests.js +195 -199
  31. package/esm/src/schemas/exchange/requests.js.map +1 -1
  32. package/esm/src/schemas/exchange/responses.d.ts +10 -10
  33. package/esm/src/schemas/exchange/responses.js +3 -3
  34. package/esm/src/schemas/exchange/responses.js.map +1 -1
  35. package/esm/src/schemas/explorer/requests.d.ts +2 -2
  36. package/esm/src/schemas/explorer/requests.js +3 -3
  37. package/esm/src/schemas/explorer/requests.js.map +1 -1
  38. package/esm/src/schemas/explorer/responses.d.ts +16 -16
  39. package/esm/src/schemas/explorer/responses.js +3 -3
  40. package/esm/src/schemas/explorer/responses.js.map +1 -1
  41. package/esm/src/schemas/info/accounts.d.ts +298 -298
  42. package/esm/src/schemas/info/accounts.js +24 -24
  43. package/esm/src/schemas/info/accounts.js.map +1 -1
  44. package/esm/src/schemas/info/assets.d.ts +110 -110
  45. package/esm/src/schemas/info/assets.js +9 -9
  46. package/esm/src/schemas/info/assets.js.map +1 -1
  47. package/esm/src/schemas/info/markets.d.ts +25 -25
  48. package/esm/src/schemas/info/markets.js +3 -3
  49. package/esm/src/schemas/info/markets.js.map +1 -1
  50. package/esm/src/schemas/info/orders.d.ts +104 -104
  51. package/esm/src/schemas/info/orders.js +3 -3
  52. package/esm/src/schemas/info/orders.js.map +1 -1
  53. package/esm/src/schemas/info/requests.d.ts +32 -32
  54. package/esm/src/schemas/info/requests.js +55 -55
  55. package/esm/src/schemas/info/requests.js.map +1 -1
  56. package/esm/src/schemas/info/validators.d.ts +27 -27
  57. package/esm/src/schemas/info/validators.js +6 -6
  58. package/esm/src/schemas/info/validators.js.map +1 -1
  59. package/esm/src/schemas/info/vaults.d.ts +46 -46
  60. package/esm/src/schemas/info/vaults.js +10 -10
  61. package/esm/src/schemas/info/vaults.js.map +1 -1
  62. package/esm/src/schemas/subscriptions/requests.d.ts +4 -4
  63. package/esm/src/schemas/subscriptions/requests.js +17 -17
  64. package/esm/src/schemas/subscriptions/requests.js.map +1 -1
  65. package/esm/src/schemas/subscriptions/responses.d.ts +401 -401
  66. package/esm/src/schemas/subscriptions/responses.js +14 -14
  67. package/esm/src/schemas/subscriptions/responses.js.map +1 -1
  68. package/esm/src/signing/mod.js +4 -4
  69. package/esm/src/signing/mod.js.map +1 -1
  70. package/esm/src/signing/signTypedData/private_key.js +16 -16
  71. package/esm/src/signing/signTypedData/private_key.js.map +1 -1
  72. package/esm/src/transports/_polyfills.d.ts +12 -0
  73. package/esm/src/transports/_polyfills.d.ts.map +1 -0
  74. package/esm/src/transports/_polyfills.js +40 -0
  75. package/esm/src/transports/_polyfills.js.map +1 -0
  76. package/esm/src/transports/base.d.ts +6 -6
  77. package/esm/src/transports/base.d.ts.map +1 -1
  78. package/esm/src/transports/http/http_transport.d.ts +11 -4
  79. package/esm/src/transports/http/http_transport.d.ts.map +1 -1
  80. package/esm/src/transports/http/http_transport.js +17 -6
  81. package/esm/src/transports/http/http_transport.js.map +1 -1
  82. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +8 -7
  83. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  84. package/esm/src/transports/websocket/_hyperliquid_event_target.js +14 -33
  85. package/esm/src/transports/websocket/_hyperliquid_event_target.js.map +1 -1
  86. package/esm/src/transports/websocket/_reconnecting_websocket.d.ts +26 -29
  87. package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  88. package/esm/src/transports/websocket/_reconnecting_websocket.js +82 -76
  89. package/esm/src/transports/websocket/_reconnecting_websocket.js.map +1 -1
  90. package/esm/src/transports/websocket/_websocket_async_request.d.ts +6 -0
  91. package/esm/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
  92. package/esm/src/transports/websocket/_websocket_async_request.js +49 -41
  93. package/esm/src/transports/websocket/_websocket_async_request.js.map +1 -1
  94. package/esm/src/transports/websocket/websocket_transport.d.ts +48 -70
  95. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  96. package/esm/src/transports/websocket/websocket_transport.js +90 -103
  97. package/esm/src/transports/websocket/websocket_transport.js.map +1 -1
  98. package/package.json +3 -7
  99. package/script/bin/_utils.d.ts +80 -0
  100. package/script/bin/_utils.d.ts.map +1 -0
  101. package/script/bin/_utils.js +116 -0
  102. package/script/bin/_utils.js.map +1 -0
  103. package/script/bin/cli.js +43 -164
  104. package/script/bin/cli.js.map +1 -1
  105. package/script/src/clients/exchange.d.ts +93 -93
  106. package/script/src/clients/exchange.d.ts.map +1 -1
  107. package/script/src/clients/exchange.js +62 -57
  108. package/script/src/clients/exchange.js.map +1 -1
  109. package/script/src/clients/info.d.ts +113 -113
  110. package/script/src/clients/info.d.ts.map +1 -1
  111. package/script/src/clients/info.js +70 -73
  112. package/script/src/clients/info.js.map +1 -1
  113. package/script/src/clients/multiSign.d.ts +3 -3
  114. package/script/src/clients/multiSign.d.ts.map +1 -1
  115. package/script/src/clients/multiSign.js +10 -8
  116. package/script/src/clients/multiSign.js.map +1 -1
  117. package/script/src/clients/subscription.d.ts +23 -23
  118. package/script/src/clients/subscription.d.ts.map +1 -1
  119. package/script/src/clients/subscription.js +8 -11
  120. package/script/src/clients/subscription.js.map +1 -1
  121. package/script/src/schemas/_base.d.ts +6 -8
  122. package/script/src/schemas/_base.d.ts.map +1 -1
  123. package/script/src/schemas/_base.js +6 -29
  124. package/script/src/schemas/_base.js.map +1 -1
  125. package/script/src/schemas/exchange/requests.d.ts +1676 -1657
  126. package/script/src/schemas/exchange/requests.d.ts.map +1 -1
  127. package/script/src/schemas/exchange/requests.js +194 -198
  128. package/script/src/schemas/exchange/requests.js.map +1 -1
  129. package/script/src/schemas/exchange/responses.d.ts +10 -10
  130. package/script/src/schemas/exchange/responses.js +2 -2
  131. package/script/src/schemas/exchange/responses.js.map +1 -1
  132. package/script/src/schemas/explorer/requests.d.ts +2 -2
  133. package/script/src/schemas/explorer/requests.js +2 -2
  134. package/script/src/schemas/explorer/requests.js.map +1 -1
  135. package/script/src/schemas/explorer/responses.d.ts +16 -16
  136. package/script/src/schemas/explorer/responses.js +2 -2
  137. package/script/src/schemas/explorer/responses.js.map +1 -1
  138. package/script/src/schemas/info/accounts.d.ts +298 -298
  139. package/script/src/schemas/info/accounts.js +23 -23
  140. package/script/src/schemas/info/accounts.js.map +1 -1
  141. package/script/src/schemas/info/assets.d.ts +110 -110
  142. package/script/src/schemas/info/assets.js +8 -8
  143. package/script/src/schemas/info/assets.js.map +1 -1
  144. package/script/src/schemas/info/markets.d.ts +25 -25
  145. package/script/src/schemas/info/markets.js +2 -2
  146. package/script/src/schemas/info/markets.js.map +1 -1
  147. package/script/src/schemas/info/orders.d.ts +104 -104
  148. package/script/src/schemas/info/orders.js +2 -2
  149. package/script/src/schemas/info/orders.js.map +1 -1
  150. package/script/src/schemas/info/requests.d.ts +32 -32
  151. package/script/src/schemas/info/requests.js +54 -54
  152. package/script/src/schemas/info/requests.js.map +1 -1
  153. package/script/src/schemas/info/validators.d.ts +27 -27
  154. package/script/src/schemas/info/validators.js +5 -5
  155. package/script/src/schemas/info/validators.js.map +1 -1
  156. package/script/src/schemas/info/vaults.d.ts +46 -46
  157. package/script/src/schemas/info/vaults.js +9 -9
  158. package/script/src/schemas/info/vaults.js.map +1 -1
  159. package/script/src/schemas/subscriptions/requests.d.ts +4 -4
  160. package/script/src/schemas/subscriptions/requests.js +16 -16
  161. package/script/src/schemas/subscriptions/requests.js.map +1 -1
  162. package/script/src/schemas/subscriptions/responses.d.ts +401 -401
  163. package/script/src/schemas/subscriptions/responses.js +13 -13
  164. package/script/src/schemas/subscriptions/responses.js.map +1 -1
  165. package/script/src/signing/mod.js +37 -4
  166. package/script/src/signing/mod.js.map +1 -1
  167. package/script/src/signing/signTypedData/private_key.js +49 -16
  168. package/script/src/signing/signTypedData/private_key.js.map +1 -1
  169. package/script/src/transports/_polyfills.d.ts +12 -0
  170. package/script/src/transports/_polyfills.d.ts.map +1 -0
  171. package/script/src/transports/_polyfills.js +43 -0
  172. package/script/src/transports/_polyfills.js.map +1 -0
  173. package/script/src/transports/base.d.ts +6 -6
  174. package/script/src/transports/base.d.ts.map +1 -1
  175. package/script/src/transports/http/http_transport.d.ts +11 -4
  176. package/script/src/transports/http/http_transport.d.ts.map +1 -1
  177. package/script/src/transports/http/http_transport.js +17 -6
  178. package/script/src/transports/http/http_transport.js.map +1 -1
  179. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +8 -7
  180. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  181. package/script/src/transports/websocket/_hyperliquid_event_target.js +47 -33
  182. package/script/src/transports/websocket/_hyperliquid_event_target.js.map +1 -1
  183. package/script/src/transports/websocket/_reconnecting_websocket.d.ts +26 -29
  184. package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  185. package/script/src/transports/websocket/_reconnecting_websocket.js +82 -76
  186. package/script/src/transports/websocket/_reconnecting_websocket.js.map +1 -1
  187. package/script/src/transports/websocket/_websocket_async_request.d.ts +6 -0
  188. package/script/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
  189. package/script/src/transports/websocket/_websocket_async_request.js +52 -43
  190. package/script/src/transports/websocket/_websocket_async_request.js.map +1 -1
  191. package/script/src/transports/websocket/websocket_transport.d.ts +48 -70
  192. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  193. package/script/src/transports/websocket/websocket_transport.js +92 -105
  194. package/script/src/transports/websocket/websocket_transport.js.map +1 -1
  195. package/src/bin/_utils.ts +185 -0
  196. package/src/bin/cli.ts +49 -171
  197. package/src/src/clients/exchange.ts +160 -149
  198. package/src/src/clients/info.ts +128 -128
  199. package/src/src/clients/multiSign.ts +15 -13
  200. package/src/src/clients/subscription.ts +32 -32
  201. package/src/src/schemas/_base.ts +18 -40
  202. package/src/src/schemas/exchange/requests.ts +202 -199
  203. package/src/src/schemas/exchange/responses.ts +3 -3
  204. package/src/src/schemas/explorer/requests.ts +3 -3
  205. package/src/src/schemas/explorer/responses.ts +3 -3
  206. package/src/src/schemas/info/accounts.ts +24 -24
  207. package/src/src/schemas/info/assets.ts +9 -9
  208. package/src/src/schemas/info/markets.ts +3 -3
  209. package/src/src/schemas/info/orders.ts +3 -3
  210. package/src/src/schemas/info/requests.ts +55 -55
  211. package/src/src/schemas/info/validators.ts +6 -6
  212. package/src/src/schemas/info/vaults.ts +10 -10
  213. package/src/src/schemas/subscriptions/requests.ts +17 -17
  214. package/src/src/schemas/subscriptions/responses.ts +14 -14
  215. package/src/src/signing/mod.ts +4 -4
  216. package/src/src/signing/signTypedData/private_key.ts +17 -17
  217. package/src/src/transports/_polyfills.ts +41 -0
  218. package/src/src/transports/base.ts +6 -6
  219. package/src/src/transports/http/http_transport.ts +25 -14
  220. package/src/src/transports/websocket/_hyperliquid_event_target.ts +24 -51
  221. package/src/src/transports/websocket/_reconnecting_websocket.ts +107 -119
  222. package/src/src/transports/websocket/_websocket_async_request.ts +57 -59
  223. package/src/src/transports/websocket/websocket_transport.ts +126 -167
@@ -1,5 +1,5 @@
1
1
  import * as v from "valibot";
2
- import { Hex, TokenId, UnsignedDecimalMayInputNumber, UnsignedIntegerMayInputString } from "../_base.js";
2
+ import { Address, Hex, Integer, TokenId, UnsignedDecimal, UnsignedInteger } from "../_base.js";
3
3
  import { TIF } from "../info/orders.js";
4
4
 
5
5
  /** Deeply removes undefined keys from an object. */
@@ -48,7 +48,10 @@ export const Signature = v.pipe(
48
48
  ),
49
49
  /** Recovery identifier. */
50
50
  v: v.pipe(
51
- v.union([v.literal(27), v.literal(28)]),
51
+ v.pipe(
52
+ Integer,
53
+ v.union([v.literal(27), v.literal(28)]),
54
+ ),
52
55
  v.description("Recovery identifier."),
53
56
  ),
54
57
  }),
@@ -61,7 +64,7 @@ export const OrderParams = v.pipe(
61
64
  v.object({
62
65
  /** Asset ID. */
63
66
  a: v.pipe(
64
- UnsignedIntegerMayInputString,
67
+ UnsignedInteger,
65
68
  v.description("Asset ID."),
66
69
  ),
67
70
  /** Position side (`true` for long, `false` for short). */
@@ -71,12 +74,12 @@ export const OrderParams = v.pipe(
71
74
  ),
72
75
  /** Price. */
73
76
  p: v.pipe(
74
- UnsignedDecimalMayInputNumber,
77
+ UnsignedDecimal,
75
78
  v.description("Price."),
76
79
  ),
77
80
  /** Size (in base currency units). */
78
81
  s: v.pipe(
79
- UnsignedDecimalMayInputNumber,
82
+ UnsignedDecimal,
80
83
  v.description("Size (in base currency units)."),
81
84
  ),
82
85
  /** Is reduce-only? */
@@ -111,7 +114,7 @@ export const OrderParams = v.pipe(
111
114
  ),
112
115
  /** Trigger price. */
113
116
  triggerPx: v.pipe(
114
- UnsignedDecimalMayInputNumber,
117
+ UnsignedDecimal,
115
118
  v.description("Trigger price."),
116
119
  ),
117
120
  /** Indicates whether it is take profit or stop loss. */
@@ -164,17 +167,17 @@ export const ApproveAgentRequest = v.pipe(
164
167
  ),
165
168
  /** Agent address. */
166
169
  agentAddress: v.pipe(
167
- v.pipe(Hex, v.length(42)),
170
+ Address,
168
171
  v.description("Agent address."),
169
172
  ),
170
- /** Agent name or null for unnamed agent. */
173
+ /** Agent name or null for unnamed agent (default: null). */
171
174
  agentName: v.pipe(
172
- v.nullable(v.string()),
175
+ v.optional(v.nullable(v.string()), null),
173
176
  v.description("Agent name or null for unnamed agent."),
174
177
  ),
175
178
  /** Unique request identifier (current timestamp in ms). */
176
179
  nonce: v.pipe(
177
- UnsignedIntegerMayInputString,
180
+ UnsignedInteger,
178
181
  v.description("Unique request identifier (current timestamp in ms)."),
179
182
  ),
180
183
  }),
@@ -182,7 +185,7 @@ export const ApproveAgentRequest = v.pipe(
182
185
  ),
183
186
  /** Unique request identifier (current timestamp in ms). */
184
187
  nonce: v.pipe(
185
- UnsignedIntegerMayInputString,
188
+ UnsignedInteger,
186
189
  v.description("Unique request identifier (current timestamp in ms)."),
187
190
  ),
188
191
  /** Cryptographic signature. */
@@ -228,12 +231,12 @@ export const ApproveBuilderFeeRequest = v.pipe(
228
231
  ),
229
232
  /** Builder address. */
230
233
  builder: v.pipe(
231
- v.pipe(Hex, v.length(42)),
234
+ Address,
232
235
  v.description("Builder address."),
233
236
  ),
234
237
  /** Unique request identifier (current timestamp in ms). */
235
238
  nonce: v.pipe(
236
- UnsignedIntegerMayInputString,
239
+ UnsignedInteger,
237
240
  v.description("Unique request identifier (current timestamp in ms)."),
238
241
  ),
239
242
  }),
@@ -241,7 +244,7 @@ export const ApproveBuilderFeeRequest = v.pipe(
241
244
  ),
242
245
  /** Unique request identifier (current timestamp in ms). */
243
246
  nonce: v.pipe(
244
- UnsignedIntegerMayInputString,
247
+ UnsignedInteger,
245
248
  v.description("Unique request identifier (current timestamp in ms)."),
246
249
  ),
247
250
  /** Cryptographic signature. */
@@ -276,7 +279,7 @@ export const BatchModifyRequest = v.pipe(
276
279
  /** Order ID or Client Order ID. */
277
280
  oid: v.pipe(
278
281
  v.union([
279
- UnsignedIntegerMayInputString,
282
+ UnsignedInteger,
280
283
  v.pipe(Hex, v.length(34)),
281
284
  ]),
282
285
  v.description("Order ID or Client Order ID."),
@@ -294,7 +297,7 @@ export const BatchModifyRequest = v.pipe(
294
297
  ),
295
298
  /** Unique request identifier (current timestamp in ms). */
296
299
  nonce: v.pipe(
297
- UnsignedIntegerMayInputString,
300
+ UnsignedInteger,
298
301
  v.description("Unique request identifier (current timestamp in ms)."),
299
302
  ),
300
303
  /** Cryptographic signature. */
@@ -304,12 +307,12 @@ export const BatchModifyRequest = v.pipe(
304
307
  ),
305
308
  /** Vault address (for vault trading). */
306
309
  vaultAddress: v.pipe(
307
- v.optional(v.pipe(Hex, v.length(42))),
310
+ v.optional(Address),
308
311
  v.description("Vault address (for vault trading)."),
309
312
  ),
310
313
  /** Expiration time of the action. */
311
314
  expiresAfter: v.pipe(
312
- v.optional(UnsignedIntegerMayInputString),
315
+ v.optional(UnsignedInteger),
313
316
  v.description("Expiration time of the action."),
314
317
  ),
315
318
  }),
@@ -338,12 +341,12 @@ export const CancelRequest = v.pipe(
338
341
  v.array(v.object({
339
342
  /** Asset ID. */
340
343
  a: v.pipe(
341
- UnsignedIntegerMayInputString,
344
+ UnsignedInteger,
342
345
  v.description("Asset ID."),
343
346
  ),
344
347
  /** Order ID. */
345
348
  o: v.pipe(
346
- UnsignedIntegerMayInputString,
349
+ UnsignedInteger,
347
350
  v.description("Order ID."),
348
351
  ),
349
352
  })),
@@ -354,7 +357,7 @@ export const CancelRequest = v.pipe(
354
357
  ),
355
358
  /** Unique request identifier (current timestamp in ms). */
356
359
  nonce: v.pipe(
357
- UnsignedIntegerMayInputString,
360
+ UnsignedInteger,
358
361
  v.description("Unique request identifier (current timestamp in ms)."),
359
362
  ),
360
363
  /** Cryptographic signature. */
@@ -364,12 +367,12 @@ export const CancelRequest = v.pipe(
364
367
  ),
365
368
  /** Vault address (for vault trading). */
366
369
  vaultAddress: v.pipe(
367
- v.optional(v.pipe(Hex, v.length(42))),
370
+ v.optional(Address),
368
371
  v.description("Vault address (for vault trading)."),
369
372
  ),
370
373
  /** Expiration time of the action. */
371
374
  expiresAfter: v.pipe(
372
- v.optional(UnsignedIntegerMayInputString),
375
+ v.optional(UnsignedInteger),
373
376
  v.description("Expiration time of the action."),
374
377
  ),
375
378
  }),
@@ -398,7 +401,7 @@ export const CancelByCloidRequest = v.pipe(
398
401
  v.array(v.object({
399
402
  /** Asset ID. */
400
403
  asset: v.pipe(
401
- UnsignedIntegerMayInputString,
404
+ UnsignedInteger,
402
405
  v.description("Asset ID."),
403
406
  ),
404
407
  /** Client Order ID. */
@@ -414,7 +417,7 @@ export const CancelByCloidRequest = v.pipe(
414
417
  ),
415
418
  /** Unique request identifier (current timestamp in ms). */
416
419
  nonce: v.pipe(
417
- UnsignedIntegerMayInputString,
420
+ UnsignedInteger,
418
421
  v.description("Unique request identifier (current timestamp in ms)."),
419
422
  ),
420
423
  /** Cryptographic signature. */
@@ -424,12 +427,12 @@ export const CancelByCloidRequest = v.pipe(
424
427
  ),
425
428
  /** Vault address (for vault trading). */
426
429
  vaultAddress: v.pipe(
427
- v.optional(v.pipe(Hex, v.length(42))),
430
+ v.optional(Address),
428
431
  v.description("Vault address (for vault trading)."),
429
432
  ),
430
433
  /** Expiration time of the action. */
431
434
  expiresAfter: v.pipe(
432
- v.optional(UnsignedIntegerMayInputString),
435
+ v.optional(UnsignedInteger),
433
436
  v.description("Expiration time of the action."),
434
437
  ),
435
438
  }),
@@ -465,12 +468,12 @@ export const CDepositRequest = v.pipe(
465
468
  ),
466
469
  /** Amount of wei to deposit into staking balance (float * 1e8). */
467
470
  wei: v.pipe(
468
- UnsignedIntegerMayInputString,
471
+ UnsignedInteger,
469
472
  v.description("Amount of wei to deposit into staking balance (float * 1e8)."),
470
473
  ),
471
474
  /** Unique request identifier (current timestamp in ms). */
472
475
  nonce: v.pipe(
473
- UnsignedIntegerMayInputString,
476
+ UnsignedInteger,
474
477
  v.description("Unique request identifier (current timestamp in ms)."),
475
478
  ),
476
479
  }),
@@ -478,7 +481,7 @@ export const CDepositRequest = v.pipe(
478
481
  ),
479
482
  /** Unique request identifier (current timestamp in ms). */
480
483
  nonce: v.pipe(
481
- UnsignedIntegerMayInputString,
484
+ UnsignedInteger,
482
485
  v.description("Unique request identifier (current timestamp in ms)."),
483
486
  ),
484
487
  /** Cryptographic signature. */
@@ -512,7 +515,7 @@ export const ClaimRewardsRequest = v.pipe(
512
515
  ),
513
516
  /** Unique request identifier (current timestamp in ms). */
514
517
  nonce: v.pipe(
515
- UnsignedIntegerMayInputString,
518
+ UnsignedInteger,
516
519
  v.description("Unique request identifier (current timestamp in ms)."),
517
520
  ),
518
521
  /** Cryptographic signature. */
@@ -522,7 +525,7 @@ export const ClaimRewardsRequest = v.pipe(
522
525
  ),
523
526
  /** Expiration time of the action. */
524
527
  expiresAfter: v.pipe(
525
- v.optional(UnsignedIntegerMayInputString),
528
+ v.optional(UnsignedInteger),
526
529
  v.description("Expiration time of the action."),
527
530
  ),
528
531
  }),
@@ -537,12 +540,12 @@ export const ConvertToMultiSigUserRequestSigners = v.pipe(
537
540
  v.object({
538
541
  /** List of authorized user addresses. */
539
542
  authorizedUsers: v.pipe(
540
- v.array(v.pipe(Hex, v.length(42))),
543
+ v.array(Address),
541
544
  v.description("List of authorized user addresses."),
542
545
  ),
543
546
  /** Minimum number of signatures required. */
544
547
  threshold: v.pipe(
545
- UnsignedIntegerMayInputString,
548
+ UnsignedInteger,
546
549
  v.description("Minimum number of signatures required."),
547
550
  ),
548
551
  }),
@@ -606,7 +609,7 @@ export const ConvertToMultiSigUserRequest = v.pipe(
606
609
  ),
607
610
  /** Unique request identifier (current timestamp in ms). */
608
611
  nonce: v.pipe(
609
- UnsignedIntegerMayInputString,
612
+ UnsignedInteger,
610
613
  v.description("Unique request identifier (current timestamp in ms)."),
611
614
  ),
612
615
  }),
@@ -614,7 +617,7 @@ export const ConvertToMultiSigUserRequest = v.pipe(
614
617
  ),
615
618
  /** Unique request identifier (current timestamp in ms). */
616
619
  nonce: v.pipe(
617
- UnsignedIntegerMayInputString,
620
+ UnsignedInteger,
618
621
  v.description("Unique request identifier (current timestamp in ms)."),
619
622
  ),
620
623
  /** Cryptographic signature. */
@@ -654,7 +657,7 @@ export const CreateSubAccountRequest = v.pipe(
654
657
  ),
655
658
  /** Unique request identifier (current timestamp in ms). */
656
659
  nonce: v.pipe(
657
- UnsignedIntegerMayInputString,
660
+ UnsignedInteger,
658
661
  v.description("Unique request identifier (current timestamp in ms)."),
659
662
  ),
660
663
  /** Cryptographic signature. */
@@ -664,7 +667,7 @@ export const CreateSubAccountRequest = v.pipe(
664
667
  ),
665
668
  /** Expiration time of the action. */
666
669
  expiresAfter: v.pipe(
667
- v.optional(UnsignedIntegerMayInputString),
670
+ v.optional(UnsignedInteger),
668
671
  v.description("Expiration time of the action."),
669
672
  ),
670
673
  }),
@@ -702,13 +705,13 @@ export const CreateVaultRequest = v.pipe(
702
705
  ),
703
706
  /** Initial balance (float * 1e6). */
704
707
  initialUsd: v.pipe(
705
- UnsignedIntegerMayInputString,
708
+ UnsignedInteger,
706
709
  v.minValue(100000000), // 100 USDC
707
710
  v.description("Initial balance (float * 1e6)."),
708
711
  ),
709
- /** Unique request identifier (current timestamp in ms). */
712
+ /** Unique request identifier (current timestamp in ms) (default: Date.now()). */
710
713
  nonce: v.pipe(
711
- UnsignedIntegerMayInputString,
714
+ v.optional(UnsignedInteger, () => Date.now()), // default value is allowed because this is an L1 action
712
715
  v.description("Unique request identifier (current timestamp in ms)."),
713
716
  ),
714
717
  }),
@@ -716,7 +719,7 @@ export const CreateVaultRequest = v.pipe(
716
719
  ),
717
720
  /** Unique request identifier (current timestamp in ms). */
718
721
  nonce: v.pipe(
719
- UnsignedIntegerMayInputString,
722
+ UnsignedInteger,
720
723
  v.description("Unique request identifier (current timestamp in ms)."),
721
724
  ),
722
725
  /** Cryptographic signature. */
@@ -726,7 +729,7 @@ export const CreateVaultRequest = v.pipe(
726
729
  ),
727
730
  /** Expiration time of the action. */
728
731
  expiresAfter: v.pipe(
729
- v.optional(UnsignedIntegerMayInputString),
732
+ v.optional(UnsignedInteger),
730
733
  v.description("Expiration time of the action."),
731
734
  ),
732
735
  }),
@@ -776,7 +779,7 @@ export const CSignerActionRequest = v.pipe(
776
779
  ),
777
780
  /** Unique request identifier (current timestamp in ms). */
778
781
  nonce: v.pipe(
779
- UnsignedIntegerMayInputString,
782
+ UnsignedInteger,
780
783
  v.description("Unique request identifier (current timestamp in ms)."),
781
784
  ),
782
785
  /** Cryptographic signature. */
@@ -786,7 +789,7 @@ export const CSignerActionRequest = v.pipe(
786
789
  ),
787
790
  /** Expiration time of the action. */
788
791
  expiresAfter: v.pipe(
789
- v.optional(UnsignedIntegerMayInputString),
792
+ v.optional(UnsignedInteger),
790
793
  v.description("Expiration time of the action."),
791
794
  ),
792
795
  }),
@@ -858,12 +861,12 @@ export const CValidatorActionRequest = v.pipe(
858
861
  ),
859
862
  /** Commission rate in basis points (1 = 0.0001%). */
860
863
  commission_bps: v.pipe(
861
- v.nullable(UnsignedIntegerMayInputString),
864
+ v.nullable(UnsignedInteger),
862
865
  v.description("Commission rate in basis points (1 = 0.0001%)."),
863
866
  ),
864
867
  /** Signer address. */
865
868
  signer: v.pipe(
866
- v.nullable(v.pipe(Hex, v.length(42))),
869
+ v.nullable(Address),
867
870
  v.description("Signer address."),
868
871
  ),
869
872
  }),
@@ -911,12 +914,12 @@ export const CValidatorActionRequest = v.pipe(
911
914
  ),
912
915
  /** Commission rate in basis points (1 = 0.0001%). */
913
916
  commission_bps: v.pipe(
914
- UnsignedIntegerMayInputString,
917
+ UnsignedInteger,
915
918
  v.description("Commission rate in basis points (1 = 0.0001%)."),
916
919
  ),
917
920
  /** Signer address. */
918
921
  signer: v.pipe(
919
- v.pipe(Hex, v.length(42)),
922
+ Address,
920
923
  v.description("Signer address."),
921
924
  ),
922
925
  }),
@@ -929,7 +932,7 @@ export const CValidatorActionRequest = v.pipe(
929
932
  ),
930
933
  /** Initial stake amount in wei. */
931
934
  initial_wei: v.pipe(
932
- UnsignedIntegerMayInputString,
935
+ UnsignedInteger,
933
936
  v.description("Initial stake amount in wei."),
934
937
  ),
935
938
  }),
@@ -953,7 +956,7 @@ export const CValidatorActionRequest = v.pipe(
953
956
  ),
954
957
  /** Unique request identifier (current timestamp in ms). */
955
958
  nonce: v.pipe(
956
- UnsignedIntegerMayInputString,
959
+ UnsignedInteger,
957
960
  v.description("Unique request identifier (current timestamp in ms)."),
958
961
  ),
959
962
  /** Cryptographic signature. */
@@ -963,7 +966,7 @@ export const CValidatorActionRequest = v.pipe(
963
966
  ),
964
967
  /** Expiration time of the action. */
965
968
  expiresAfter: v.pipe(
966
- v.optional(UnsignedIntegerMayInputString),
969
+ v.optional(UnsignedInteger),
967
970
  v.description("Expiration time of the action."),
968
971
  ),
969
972
  }),
@@ -1004,12 +1007,12 @@ export const CWithdrawRequest = v.pipe(
1004
1007
  ),
1005
1008
  /** Amount of wei to withdraw from staking balance (float * 1e8). */
1006
1009
  wei: v.pipe(
1007
- UnsignedIntegerMayInputString,
1010
+ UnsignedInteger,
1008
1011
  v.description("Amount of wei to withdraw from staking balance (float * 1e8)."),
1009
1012
  ),
1010
1013
  /** Unique request identifier (current timestamp in ms). */
1011
1014
  nonce: v.pipe(
1012
- UnsignedIntegerMayInputString,
1015
+ UnsignedInteger,
1013
1016
  v.description("Unique request identifier (current timestamp in ms)."),
1014
1017
  ),
1015
1018
  }),
@@ -1017,7 +1020,7 @@ export const CWithdrawRequest = v.pipe(
1017
1020
  ),
1018
1021
  /** Unique request identifier (current timestamp in ms). */
1019
1022
  nonce: v.pipe(
1020
- UnsignedIntegerMayInputString,
1023
+ UnsignedInteger,
1021
1024
  v.description("Unique request identifier (current timestamp in ms)."),
1022
1025
  ),
1023
1026
  /** Cryptographic signature. */
@@ -1056,7 +1059,7 @@ export const EvmUserModifyRequest = v.pipe(
1056
1059
  ),
1057
1060
  /** Unique request identifier (current timestamp in ms). */
1058
1061
  nonce: v.pipe(
1059
- UnsignedIntegerMayInputString,
1062
+ UnsignedInteger,
1060
1063
  v.description("Unique request identifier (current timestamp in ms)."),
1061
1064
  ),
1062
1065
  /** Cryptographic signature. */
@@ -1066,7 +1069,7 @@ export const EvmUserModifyRequest = v.pipe(
1066
1069
  ),
1067
1070
  /** Expiration time of the action. */
1068
1071
  expiresAfter: v.pipe(
1069
- v.optional(UnsignedIntegerMayInputString),
1072
+ v.optional(UnsignedInteger),
1070
1073
  v.description("Expiration time of the action."),
1071
1074
  ),
1072
1075
  }),
@@ -1093,7 +1096,7 @@ export const ModifyRequest = v.pipe(
1093
1096
  /** Order ID or Client Order ID. */
1094
1097
  oid: v.pipe(
1095
1098
  v.union([
1096
- UnsignedIntegerMayInputString,
1099
+ UnsignedInteger,
1097
1100
  v.pipe(Hex, v.length(34)),
1098
1101
  ]),
1099
1102
  v.description("Order ID or Client Order ID."),
@@ -1108,7 +1111,7 @@ export const ModifyRequest = v.pipe(
1108
1111
  ),
1109
1112
  /** Unique request identifier (current timestamp in ms). */
1110
1113
  nonce: v.pipe(
1111
- UnsignedIntegerMayInputString,
1114
+ UnsignedInteger,
1112
1115
  v.description("Unique request identifier (current timestamp in ms)."),
1113
1116
  ),
1114
1117
  /** Cryptographic signature. */
@@ -1118,12 +1121,12 @@ export const ModifyRequest = v.pipe(
1118
1121
  ),
1119
1122
  /** Vault address (for vault trading). */
1120
1123
  vaultAddress: v.pipe(
1121
- v.optional(v.pipe(Hex, v.length(42))),
1124
+ v.optional(Address),
1122
1125
  v.description("Vault address (for vault trading)."),
1123
1126
  ),
1124
1127
  /** Expiration time of the action. */
1125
1128
  expiresAfter: v.pipe(
1126
- v.optional(UnsignedIntegerMayInputString),
1129
+ v.optional(UnsignedInteger),
1127
1130
  v.description("Expiration time of the action."),
1128
1131
  ),
1129
1132
  }),
@@ -1152,7 +1155,7 @@ export const NoopRequest = v.pipe(
1152
1155
  ),
1153
1156
  /** Unique request identifier (current timestamp in ms). */
1154
1157
  nonce: v.pipe(
1155
- UnsignedIntegerMayInputString,
1158
+ UnsignedInteger,
1156
1159
  v.description("Unique request identifier (current timestamp in ms)."),
1157
1160
  ),
1158
1161
  /** Cryptographic signature. */
@@ -1162,7 +1165,7 @@ export const NoopRequest = v.pipe(
1162
1165
  ),
1163
1166
  /** Expiration time of the action. */
1164
1167
  expiresAfter: v.pipe(
1165
- v.optional(UnsignedIntegerMayInputString),
1168
+ v.optional(UnsignedInteger),
1166
1169
  v.description("Expiration time of the action."),
1167
1170
  ),
1168
1171
  }),
@@ -1193,16 +1196,12 @@ export const OrderRequest = v.pipe(
1193
1196
  ),
1194
1197
  /**
1195
1198
  * Order grouping strategy:
1196
- * - `na`: Standard order without grouping.
1199
+ * - `na`: Standard order without grouping (default).
1197
1200
  * - `normalTpsl`: TP/SL order with fixed size that doesn't adjust with position changes.
1198
1201
  * - `positionTpsl`: TP/SL order that adjusts proportionally with the position size.
1199
1202
  */
1200
1203
  grouping: v.pipe(
1201
- v.union([
1202
- v.literal("na"),
1203
- v.literal("normalTpsl"),
1204
- v.literal("positionTpsl"),
1205
- ]),
1204
+ v.optional(v.union([v.literal("na"), v.literal("normalTpsl"), v.literal("positionTpsl")]), "na"),
1206
1205
  v.description(
1207
1206
  "Order grouping strategy:" +
1208
1207
  "\n- `na`: Standard order without grouping." +
@@ -1215,12 +1214,12 @@ export const OrderRequest = v.pipe(
1215
1214
  v.optional(v.object({
1216
1215
  /** Builder address. */
1217
1216
  b: v.pipe(
1218
- v.pipe(Hex, v.length(42)),
1217
+ Address,
1219
1218
  v.description("Builder address."),
1220
1219
  ),
1221
1220
  /** Builder fee in 0.1bps (1 = 0.0001%). */
1222
1221
  f: v.pipe(
1223
- UnsignedIntegerMayInputString,
1222
+ UnsignedInteger,
1224
1223
  v.description("Builder fee in 0.1bps (1 = 0.0001%)."),
1225
1224
  ),
1226
1225
  })),
@@ -1231,7 +1230,7 @@ export const OrderRequest = v.pipe(
1231
1230
  ),
1232
1231
  /** Unique request identifier (current timestamp in ms). */
1233
1232
  nonce: v.pipe(
1234
- UnsignedIntegerMayInputString,
1233
+ UnsignedInteger,
1235
1234
  v.description("Unique request identifier (current timestamp in ms)."),
1236
1235
  ),
1237
1236
  /** Cryptographic signature. */
@@ -1241,12 +1240,12 @@ export const OrderRequest = v.pipe(
1241
1240
  ),
1242
1241
  /** Vault address (for vault trading). */
1243
1242
  vaultAddress: v.pipe(
1244
- v.optional(v.pipe(Hex, v.length(42))),
1243
+ v.optional(Address),
1245
1244
  v.description("Vault address (for vault trading)."),
1246
1245
  ),
1247
1246
  /** Expiration time of the action. */
1248
1247
  expiresAfter: v.pipe(
1249
- v.optional(UnsignedIntegerMayInputString),
1248
+ v.optional(UnsignedInteger),
1250
1249
  v.description("Expiration time of the action."),
1251
1250
  ),
1252
1251
  }),
@@ -1279,7 +1278,7 @@ export const PerpDeployRequest = v.pipe(
1279
1278
  v.object({
1280
1279
  /** Max gas in native token wei. If not provided, then uses current deploy auction price. */
1281
1280
  maxGas: v.pipe(
1282
- v.nullable(UnsignedIntegerMayInputString),
1281
+ v.nullable(UnsignedInteger),
1283
1282
  v.description(
1284
1283
  "Max gas in native token wei. If not provided, then uses current deploy auction price.",
1285
1284
  ),
@@ -1294,17 +1293,17 @@ export const PerpDeployRequest = v.pipe(
1294
1293
  ),
1295
1294
  /** Number of decimal places for size. */
1296
1295
  szDecimals: v.pipe(
1297
- UnsignedIntegerMayInputString,
1296
+ UnsignedInteger,
1298
1297
  v.description("Number of decimal places for size."),
1299
1298
  ),
1300
1299
  /** Initial oracle price for the asset. */
1301
1300
  oraclePx: v.pipe(
1302
- UnsignedDecimalMayInputNumber,
1301
+ UnsignedDecimal,
1303
1302
  v.description("Initial oracle price for the asset."),
1304
1303
  ),
1305
1304
  /** Margin table identifier for risk management. */
1306
1305
  marginTableId: v.pipe(
1307
- UnsignedIntegerMayInputString,
1306
+ UnsignedInteger,
1308
1307
  v.description("Margin table identifier for risk management."),
1309
1308
  ),
1310
1309
  /** Whether the asset can only be traded with isolated margin. */
@@ -1330,12 +1329,12 @@ export const PerpDeployRequest = v.pipe(
1330
1329
  ),
1331
1330
  /** Collateral token index. */
1332
1331
  collateralToken: v.pipe(
1333
- UnsignedIntegerMayInputString,
1332
+ UnsignedInteger,
1334
1333
  v.description("Collateral token index."),
1335
1334
  ),
1336
1335
  /** User to update oracles. If not provided, then deployer is assumed to be oracle updater. */
1337
1336
  oracleUpdater: v.pipe(
1338
- v.nullable(v.pipe(Hex, v.length(42))),
1337
+ v.nullable(Address),
1339
1338
  v.description(
1340
1339
  "User to update oracles. If not provided, then deployer is assumed to be oracle updater.",
1341
1340
  ),
@@ -1367,16 +1366,23 @@ export const PerpDeployRequest = v.pipe(
1367
1366
  ),
1368
1367
  /** A list (sorted by key) of asset and oracle prices. */
1369
1368
  oraclePxs: v.pipe(
1370
- v.array(v.tuple([v.string(), UnsignedDecimalMayInputNumber])),
1369
+ v.array(v.tuple([v.string(), UnsignedDecimal])),
1371
1370
  v.description("A list (sorted by key) of asset and oracle prices."),
1372
1371
  ),
1373
1372
  /** An outer list of inner lists (inner list sorted by key) of asset and mark prices. */
1374
1373
  markPxs: v.pipe(
1375
- v.array(v.array(v.tuple([v.string(), UnsignedDecimalMayInputNumber]))),
1374
+ v.array(v.array(v.tuple([v.string(), UnsignedDecimal]))),
1376
1375
  v.description(
1377
1376
  "An outer list of inner lists (inner list sorted by key) of asset and mark prices.",
1378
1377
  ),
1379
1378
  ),
1379
+ /** A list (sorted by key) of asset and external prices which prevent sudden mark price deviations. */
1380
+ externalPerpPxs: v.pipe(
1381
+ v.array(v.tuple([v.string(), UnsignedDecimal])),
1382
+ v.description(
1383
+ "A list (sorted by key) of asset and external prices which prevent sudden mark price deviations.",
1384
+ ),
1385
+ ),
1380
1386
  }),
1381
1387
  v.description("Parameters for setting oracle and mark prices for assets."),
1382
1388
  ),
@@ -1388,7 +1394,7 @@ export const PerpDeployRequest = v.pipe(
1388
1394
  ),
1389
1395
  /** Unique request identifier (current timestamp in ms). */
1390
1396
  nonce: v.pipe(
1391
- UnsignedIntegerMayInputString,
1397
+ UnsignedInteger,
1392
1398
  v.description("Unique request identifier (current timestamp in ms)."),
1393
1399
  ),
1394
1400
  /** Cryptographic signature. */
@@ -1398,7 +1404,7 @@ export const PerpDeployRequest = v.pipe(
1398
1404
  ),
1399
1405
  /** Expiration time of the action. */
1400
1406
  expiresAfter: v.pipe(
1401
- v.optional(UnsignedIntegerMayInputString),
1407
+ v.optional(UnsignedInteger),
1402
1408
  v.description("Expiration time of the action."),
1403
1409
  ),
1404
1410
  }),
@@ -1437,7 +1443,7 @@ export const RegisterReferrerRequest = v.pipe(
1437
1443
  ),
1438
1444
  /** Unique request identifier (current timestamp in ms). */
1439
1445
  nonce: v.pipe(
1440
- UnsignedIntegerMayInputString,
1446
+ UnsignedInteger,
1441
1447
  v.description("Unique request identifier (current timestamp in ms)."),
1442
1448
  ),
1443
1449
  /** Cryptographic signature. */
@@ -1447,7 +1453,7 @@ export const RegisterReferrerRequest = v.pipe(
1447
1453
  ),
1448
1454
  /** Expiration time of the action. */
1449
1455
  expiresAfter: v.pipe(
1450
- v.optional(UnsignedIntegerMayInputString),
1456
+ v.optional(UnsignedInteger),
1451
1457
  v.description("Expiration time of the action."),
1452
1458
  ),
1453
1459
  }),
@@ -1473,7 +1479,7 @@ export const ReserveRequestWeightRequest = v.pipe(
1473
1479
  ),
1474
1480
  /** Amount of request weight to reserve. */
1475
1481
  weight: v.pipe(
1476
- UnsignedIntegerMayInputString,
1482
+ UnsignedInteger,
1477
1483
  v.description("Amount of request weight to reserve."),
1478
1484
  ),
1479
1485
  }),
@@ -1481,7 +1487,7 @@ export const ReserveRequestWeightRequest = v.pipe(
1481
1487
  ),
1482
1488
  /** Unique request identifier (current timestamp in ms). */
1483
1489
  nonce: v.pipe(
1484
- UnsignedIntegerMayInputString,
1490
+ UnsignedInteger,
1485
1491
  v.description("Unique request identifier (current timestamp in ms)."),
1486
1492
  ),
1487
1493
  /** Cryptographic signature. */
@@ -1491,7 +1497,7 @@ export const ReserveRequestWeightRequest = v.pipe(
1491
1497
  ),
1492
1498
  /** Expiration time of the action. */
1493
1499
  expiresAfter: v.pipe(
1494
- v.optional(UnsignedIntegerMayInputString),
1500
+ v.optional(UnsignedInteger),
1495
1501
  v.description("Expiration time of the action."),
1496
1502
  ),
1497
1503
  }),
@@ -1522,7 +1528,7 @@ export const ScheduleCancelRequest = v.pipe(
1522
1528
  * If not specified, will cause all scheduled cancel operations to be deleted.
1523
1529
  */
1524
1530
  time: v.pipe(
1525
- v.optional(UnsignedIntegerMayInputString),
1531
+ v.optional(UnsignedInteger),
1526
1532
  v.description(
1527
1533
  "Scheduled time (in ms since epoch)." +
1528
1534
  "\nMust be at least 5 seconds in the future." +
@@ -1534,7 +1540,7 @@ export const ScheduleCancelRequest = v.pipe(
1534
1540
  ),
1535
1541
  /** Unique request identifier (current timestamp in ms). */
1536
1542
  nonce: v.pipe(
1537
- UnsignedIntegerMayInputString,
1543
+ UnsignedInteger,
1538
1544
  v.description("Unique request identifier (current timestamp in ms)."),
1539
1545
  ),
1540
1546
  /** Cryptographic signature. */
@@ -1544,12 +1550,12 @@ export const ScheduleCancelRequest = v.pipe(
1544
1550
  ),
1545
1551
  /** Vault address (for vault trading). */
1546
1552
  vaultAddress: v.pipe(
1547
- v.optional(v.pipe(Hex, v.length(42))),
1553
+ v.optional(Address),
1548
1554
  v.description("Vault address (for vault trading)."),
1549
1555
  ),
1550
1556
  /** Expiration time of the action. */
1551
1557
  expiresAfter: v.pipe(
1552
- v.optional(UnsignedIntegerMayInputString),
1558
+ v.optional(UnsignedInteger),
1553
1559
  v.description("Expiration time of the action."),
1554
1560
  ),
1555
1561
  }),
@@ -1585,7 +1591,7 @@ export const SendAssetRequest = v.pipe(
1585
1591
  ),
1586
1592
  /** Destination address. */
1587
1593
  destination: v.pipe(
1588
- v.pipe(Hex, v.length(42)),
1594
+ Address,
1589
1595
  v.description("Destination address."),
1590
1596
  ),
1591
1597
  /** Source DEX ("" for default USDC perp DEX, "spot" for spot). */
@@ -1605,20 +1611,17 @@ export const SendAssetRequest = v.pipe(
1605
1611
  ),
1606
1612
  /** Amount to send (not in wei). */
1607
1613
  amount: v.pipe(
1608
- UnsignedDecimalMayInputNumber,
1614
+ UnsignedDecimal,
1609
1615
  v.description("Amount to send (not in wei)."),
1610
1616
  ),
1611
- /** Source sub-account address ("" for main account). */
1617
+ /** Source sub-account address ("" for main account) (default: ""). */
1612
1618
  fromSubAccount: v.pipe(
1613
- v.union([
1614
- v.literal(""),
1615
- v.pipe(Hex, v.length(42)),
1616
- ]),
1619
+ v.optional(v.union([v.literal(""), Address]), ""),
1617
1620
  v.description('Source sub-account address ("" for main account).'),
1618
1621
  ),
1619
1622
  /** Unique request identifier (current timestamp in ms). */
1620
1623
  nonce: v.pipe(
1621
- UnsignedIntegerMayInputString,
1624
+ UnsignedInteger,
1622
1625
  v.description("Unique request identifier (current timestamp in ms)."),
1623
1626
  ),
1624
1627
  }),
@@ -1626,7 +1629,7 @@ export const SendAssetRequest = v.pipe(
1626
1629
  ),
1627
1630
  /** Unique request identifier (current timestamp in ms). */
1628
1631
  nonce: v.pipe(
1629
- UnsignedIntegerMayInputString,
1632
+ UnsignedInteger,
1630
1633
  v.description("Unique request identifier (current timestamp in ms)."),
1631
1634
  ),
1632
1635
  /** Cryptographic signature. */
@@ -1672,7 +1675,7 @@ export const SetDisplayNameRequest = v.pipe(
1672
1675
  ),
1673
1676
  /** Unique request identifier (current timestamp in ms). */
1674
1677
  nonce: v.pipe(
1675
- UnsignedIntegerMayInputString,
1678
+ UnsignedInteger,
1676
1679
  v.description("Unique request identifier (current timestamp in ms)."),
1677
1680
  ),
1678
1681
  /** Cryptographic signature. */
@@ -1682,7 +1685,7 @@ export const SetDisplayNameRequest = v.pipe(
1682
1685
  ),
1683
1686
  /** Expiration time of the action. */
1684
1687
  expiresAfter: v.pipe(
1685
- v.optional(UnsignedIntegerMayInputString),
1688
+ v.optional(UnsignedInteger),
1686
1689
  v.description("Expiration time of the action."),
1687
1690
  ),
1688
1691
  }),
@@ -1717,7 +1720,7 @@ export const SetReferrerRequest = v.pipe(
1717
1720
  ),
1718
1721
  /** Unique request identifier (current timestamp in ms). */
1719
1722
  nonce: v.pipe(
1720
- UnsignedIntegerMayInputString,
1723
+ UnsignedInteger,
1721
1724
  v.description("Unique request identifier (current timestamp in ms)."),
1722
1725
  ),
1723
1726
  /** Cryptographic signature. */
@@ -1727,7 +1730,7 @@ export const SetReferrerRequest = v.pipe(
1727
1730
  ),
1728
1731
  /** Expiration time of the action. */
1729
1732
  expiresAfter: v.pipe(
1730
- v.optional(UnsignedIntegerMayInputString),
1733
+ v.optional(UnsignedInteger),
1731
1734
  v.description("Expiration time of the action."),
1732
1735
  ),
1733
1736
  }),
@@ -1764,12 +1767,12 @@ export const SpotDeployRequest = v.pipe(
1764
1767
  v.object({
1765
1768
  /** Token identifier. */
1766
1769
  token: v.pipe(
1767
- UnsignedIntegerMayInputString,
1770
+ UnsignedInteger,
1768
1771
  v.description("Token identifier."),
1769
1772
  ),
1770
1773
  /** Maximum token supply. */
1771
1774
  maxSupply: v.pipe(
1772
- UnsignedDecimalMayInputNumber,
1775
+ UnsignedDecimal,
1773
1776
  v.description("Maximum token supply."),
1774
1777
  ),
1775
1778
  /** Set hyperliquidity balance to 0. */
@@ -1795,27 +1798,27 @@ export const SpotDeployRequest = v.pipe(
1795
1798
  v.object({
1796
1799
  /** Spot index (distinct from base token index). */
1797
1800
  spot: v.pipe(
1798
- UnsignedIntegerMayInputString,
1801
+ UnsignedInteger,
1799
1802
  v.description("Spot index (distinct from base token index)."),
1800
1803
  ),
1801
1804
  /** Starting price for liquidity seeding. */
1802
1805
  startPx: v.pipe(
1803
- UnsignedDecimalMayInputNumber,
1806
+ UnsignedDecimal,
1804
1807
  v.description("Starting price for liquidity seeding."),
1805
1808
  ),
1806
1809
  /** Order size as a float (not in wei). */
1807
1810
  orderSz: v.pipe(
1808
- UnsignedDecimalMayInputNumber,
1811
+ UnsignedDecimal,
1809
1812
  v.description("Order size as a float (not in wei)."),
1810
1813
  ),
1811
1814
  /** Total number of orders to place. */
1812
1815
  nOrders: v.pipe(
1813
- UnsignedIntegerMayInputString,
1816
+ UnsignedInteger,
1814
1817
  v.description("Total number of orders to place."),
1815
1818
  ),
1816
1819
  /** Number of levels to seed with USDC. */
1817
1820
  nSeededLevels: v.pipe(
1818
- v.optional(UnsignedIntegerMayInputString),
1821
+ v.optional(UnsignedInteger),
1819
1822
  v.description("Number of levels to seed with USDC."),
1820
1823
  ),
1821
1824
  }),
@@ -1837,8 +1840,8 @@ export const SpotDeployRequest = v.pipe(
1837
1840
  /** Tuple containing base and quote token indices. */
1838
1841
  tokens: v.pipe(
1839
1842
  v.tuple([
1840
- UnsignedIntegerMayInputString,
1841
- UnsignedIntegerMayInputString,
1843
+ UnsignedInteger,
1844
+ UnsignedInteger,
1842
1845
  ]),
1843
1846
  v.description("Tuple containing base and quote token indices."),
1844
1847
  ),
@@ -1868,12 +1871,12 @@ export const SpotDeployRequest = v.pipe(
1868
1871
  ),
1869
1872
  /** Number of decimals for token size. */
1870
1873
  szDecimals: v.pipe(
1871
- UnsignedIntegerMayInputString,
1874
+ UnsignedInteger,
1872
1875
  v.description("Number of decimals for token size."),
1873
1876
  ),
1874
1877
  /** Number of decimals for token amounts in wei. */
1875
1878
  weiDecimals: v.pipe(
1876
- UnsignedIntegerMayInputString,
1879
+ UnsignedInteger,
1877
1880
  v.description("Number of decimals for token amounts in wei."),
1878
1881
  ),
1879
1882
  }),
@@ -1881,7 +1884,7 @@ export const SpotDeployRequest = v.pipe(
1881
1884
  ),
1882
1885
  /** Maximum gas allowed for registration. */
1883
1886
  maxGas: v.pipe(
1884
- UnsignedIntegerMayInputString,
1887
+ UnsignedInteger,
1885
1888
  v.description("Maximum gas allowed for registration."),
1886
1889
  ),
1887
1890
  /** Optional full token name. */
@@ -1907,7 +1910,7 @@ export const SpotDeployRequest = v.pipe(
1907
1910
  v.object({
1908
1911
  /** Token identifier. */
1909
1912
  token: v.pipe(
1910
- UnsignedIntegerMayInputString,
1913
+ UnsignedInteger,
1911
1914
  v.description("Token identifier."),
1912
1915
  ),
1913
1916
  /** The deployer trading fee share. Range is 0% to 100%. */
@@ -1933,20 +1936,20 @@ export const SpotDeployRequest = v.pipe(
1933
1936
  v.object({
1934
1937
  /** Token identifier. */
1935
1938
  token: v.pipe(
1936
- UnsignedIntegerMayInputString,
1939
+ UnsignedInteger,
1937
1940
  v.description("Token identifier."),
1938
1941
  ),
1939
1942
  /** Array of tuples: [user address, genesis amount in wei]. */
1940
1943
  userAndWei: v.pipe(
1941
- v.array(v.tuple([v.pipe(Hex, v.length(42)), UnsignedDecimalMayInputNumber])),
1944
+ v.array(v.tuple([Address, UnsignedDecimal])),
1942
1945
  v.description("Array of tuples: [user address, genesis amount in wei]."),
1943
1946
  ),
1944
1947
  /** Array of tuples: [existing token identifier, genesis amount in wei]. */
1945
1948
  existingTokenAndWei: v.pipe(
1946
1949
  v.array(
1947
1950
  v.tuple([
1948
- UnsignedIntegerMayInputString,
1949
- UnsignedDecimalMayInputNumber,
1951
+ UnsignedInteger,
1952
+ UnsignedDecimal,
1950
1953
  ]),
1951
1954
  ),
1952
1955
  v.description(
@@ -1955,7 +1958,7 @@ export const SpotDeployRequest = v.pipe(
1955
1958
  ),
1956
1959
  /** Array of tuples: [user address, blacklist status] (`true` for blacklist, `false` to remove existing blacklisted user). */
1957
1960
  blacklistUsers: v.pipe(
1958
- v.optional(v.array(v.tuple([v.pipe(Hex, v.length(42)), v.boolean()]))),
1961
+ v.optional(v.array(v.tuple([Address, v.boolean()]))),
1959
1962
  v.description(
1960
1963
  "Array of tuples: [user address, blacklist status] (`true` for blacklist, `false` to remove existing blacklisted user).",
1961
1964
  ),
@@ -1971,7 +1974,7 @@ export const SpotDeployRequest = v.pipe(
1971
1974
  ),
1972
1975
  /** Unique request identifier (current timestamp in ms). */
1973
1976
  nonce: v.pipe(
1974
- UnsignedIntegerMayInputString,
1977
+ UnsignedInteger,
1975
1978
  v.description("Unique request identifier (current timestamp in ms)."),
1976
1979
  ),
1977
1980
  /** Cryptographic signature. */
@@ -1981,7 +1984,7 @@ export const SpotDeployRequest = v.pipe(
1981
1984
  ),
1982
1985
  /** Expiration time of the action. */
1983
1986
  expiresAfter: v.pipe(
1984
- v.optional(UnsignedIntegerMayInputString),
1987
+ v.optional(UnsignedInteger),
1985
1988
  v.description("Expiration time of the action."),
1986
1989
  ),
1987
1990
  }),
@@ -2025,7 +2028,7 @@ export const SpotSendRequest = v.pipe(
2025
2028
  ),
2026
2029
  /** Destination address. */
2027
2030
  destination: v.pipe(
2028
- v.pipe(Hex, v.length(42)),
2031
+ Address,
2029
2032
  v.description("Destination address."),
2030
2033
  ),
2031
2034
  /** Token identifier. */
@@ -2035,12 +2038,12 @@ export const SpotSendRequest = v.pipe(
2035
2038
  ),
2036
2039
  /** Amount to send (not in wei). */
2037
2040
  amount: v.pipe(
2038
- UnsignedDecimalMayInputNumber,
2041
+ UnsignedDecimal,
2039
2042
  v.description("Amount to send (not in wei)."),
2040
2043
  ),
2041
2044
  /** Unique request identifier (current timestamp in ms). */
2042
2045
  time: v.pipe(
2043
- UnsignedIntegerMayInputString,
2046
+ UnsignedInteger,
2044
2047
  v.description("Unique request identifier (current timestamp in ms)."),
2045
2048
  ),
2046
2049
  }),
@@ -2048,7 +2051,7 @@ export const SpotSendRequest = v.pipe(
2048
2051
  ),
2049
2052
  /** Unique request identifier (current timestamp in ms). */
2050
2053
  nonce: v.pipe(
2051
- UnsignedIntegerMayInputString,
2054
+ UnsignedInteger,
2052
2055
  v.description("Unique request identifier (current timestamp in ms)."),
2053
2056
  ),
2054
2057
  /** Cryptographic signature. */
@@ -2093,7 +2096,7 @@ export const SpotUserRequest = v.pipe(
2093
2096
  ),
2094
2097
  /** Unique request identifier (current timestamp in ms). */
2095
2098
  nonce: v.pipe(
2096
- UnsignedIntegerMayInputString,
2099
+ UnsignedInteger,
2097
2100
  v.description("Unique request identifier (current timestamp in ms)."),
2098
2101
  ),
2099
2102
  /** Cryptographic signature. */
@@ -2103,7 +2106,7 @@ export const SpotUserRequest = v.pipe(
2103
2106
  ),
2104
2107
  /** Expiration time of the action. */
2105
2108
  expiresAfter: v.pipe(
2106
- v.optional(UnsignedIntegerMayInputString),
2109
+ v.optional(UnsignedInteger),
2107
2110
  v.description("Expiration time of the action."),
2108
2111
  ),
2109
2112
  }),
@@ -2129,7 +2132,7 @@ export const SubAccountModifyRequest = v.pipe(
2129
2132
  ),
2130
2133
  /** Sub-account address to modify. */
2131
2134
  subAccountUser: v.pipe(
2132
- v.pipe(Hex, v.length(42)),
2135
+ Address,
2133
2136
  v.description("Sub-account address to modify."),
2134
2137
  ),
2135
2138
  /** New sub-account name. */
@@ -2143,7 +2146,7 @@ export const SubAccountModifyRequest = v.pipe(
2143
2146
  ),
2144
2147
  /** Unique request identifier (current timestamp in ms). */
2145
2148
  nonce: v.pipe(
2146
- UnsignedIntegerMayInputString,
2149
+ UnsignedInteger,
2147
2150
  v.description("Unique request identifier (current timestamp in ms)."),
2148
2151
  ),
2149
2152
  /** Cryptographic signature. */
@@ -2153,7 +2156,7 @@ export const SubAccountModifyRequest = v.pipe(
2153
2156
  ),
2154
2157
  /** Expiration time of the action. */
2155
2158
  expiresAfter: v.pipe(
2156
- v.optional(UnsignedIntegerMayInputString),
2159
+ v.optional(UnsignedInteger),
2157
2160
  v.description("Expiration time of the action."),
2158
2161
  ),
2159
2162
  }),
@@ -2179,7 +2182,7 @@ export const SubAccountSpotTransferRequest = v.pipe(
2179
2182
  ),
2180
2183
  /** Sub-account address. */
2181
2184
  subAccountUser: v.pipe(
2182
- v.pipe(Hex, v.length(42)),
2185
+ Address,
2183
2186
  v.description("Sub-account address."),
2184
2187
  ),
2185
2188
  /** `true` for deposit, `false` for withdrawal. */
@@ -2194,7 +2197,7 @@ export const SubAccountSpotTransferRequest = v.pipe(
2194
2197
  ),
2195
2198
  /** Amount to send (not in wei). */
2196
2199
  amount: v.pipe(
2197
- UnsignedDecimalMayInputNumber,
2200
+ UnsignedDecimal,
2198
2201
  v.description("Amount to send (not in wei)."),
2199
2202
  ),
2200
2203
  }),
@@ -2202,7 +2205,7 @@ export const SubAccountSpotTransferRequest = v.pipe(
2202
2205
  ),
2203
2206
  /** Unique request identifier (current timestamp in ms). */
2204
2207
  nonce: v.pipe(
2205
- UnsignedIntegerMayInputString,
2208
+ UnsignedInteger,
2206
2209
  v.description("Unique request identifier (current timestamp in ms)."),
2207
2210
  ),
2208
2211
  /** Cryptographic signature. */
@@ -2212,7 +2215,7 @@ export const SubAccountSpotTransferRequest = v.pipe(
2212
2215
  ),
2213
2216
  /** Expiration time of the action. */
2214
2217
  expiresAfter: v.pipe(
2215
- v.optional(UnsignedIntegerMayInputString),
2218
+ v.optional(UnsignedInteger),
2216
2219
  v.description("Expiration time of the action."),
2217
2220
  ),
2218
2221
  }),
@@ -2238,7 +2241,7 @@ export const SubAccountTransferRequest = v.pipe(
2238
2241
  ),
2239
2242
  /** Sub-account address. */
2240
2243
  subAccountUser: v.pipe(
2241
- v.pipe(Hex, v.length(42)),
2244
+ Address,
2242
2245
  v.description("Sub-account address."),
2243
2246
  ),
2244
2247
  /** `true` for deposit, `false` for withdrawal. */
@@ -2248,7 +2251,7 @@ export const SubAccountTransferRequest = v.pipe(
2248
2251
  ),
2249
2252
  /** Amount to transfer (float * 1e6). */
2250
2253
  usd: v.pipe(
2251
- UnsignedIntegerMayInputString,
2254
+ UnsignedInteger,
2252
2255
  v.description("Amount to transfer (float * 1e6)."),
2253
2256
  ),
2254
2257
  }),
@@ -2256,7 +2259,7 @@ export const SubAccountTransferRequest = v.pipe(
2256
2259
  ),
2257
2260
  /** Unique request identifier (current timestamp in ms). */
2258
2261
  nonce: v.pipe(
2259
- UnsignedIntegerMayInputString,
2262
+ UnsignedInteger,
2260
2263
  v.description("Unique request identifier (current timestamp in ms)."),
2261
2264
  ),
2262
2265
  /** Cryptographic signature. */
@@ -2266,7 +2269,7 @@ export const SubAccountTransferRequest = v.pipe(
2266
2269
  ),
2267
2270
  /** Expiration time of the action. */
2268
2271
  expiresAfter: v.pipe(
2269
- v.optional(UnsignedIntegerMayInputString),
2272
+ v.optional(UnsignedInteger),
2270
2273
  v.description("Expiration time of the action."),
2271
2274
  ),
2272
2275
  }),
@@ -2302,12 +2305,12 @@ export const TokenDelegateRequest = v.pipe(
2302
2305
  ),
2303
2306
  /** Validator address. */
2304
2307
  validator: v.pipe(
2305
- v.pipe(Hex, v.length(42)),
2308
+ Address,
2306
2309
  v.description("Validator address."),
2307
2310
  ),
2308
2311
  /** Amount for delegate/undelegate (float * 1e8). */
2309
2312
  wei: v.pipe(
2310
- UnsignedIntegerMayInputString,
2313
+ UnsignedInteger,
2311
2314
  v.description("Amount for delegate/undelegate (float * 1e8)."),
2312
2315
  ),
2313
2316
  /** `true` for undelegate, `false` for delegate. */
@@ -2317,7 +2320,7 @@ export const TokenDelegateRequest = v.pipe(
2317
2320
  ),
2318
2321
  /** Unique request identifier (current timestamp in ms). */
2319
2322
  nonce: v.pipe(
2320
- UnsignedIntegerMayInputString,
2323
+ UnsignedInteger,
2321
2324
  v.description("Unique request identifier (current timestamp in ms)."),
2322
2325
  ),
2323
2326
  }),
@@ -2325,7 +2328,7 @@ export const TokenDelegateRequest = v.pipe(
2325
2328
  ),
2326
2329
  /** Unique request identifier (current timestamp in ms). */
2327
2330
  nonce: v.pipe(
2328
- UnsignedIntegerMayInputString,
2331
+ UnsignedInteger,
2329
2332
  v.description("Unique request identifier (current timestamp in ms)."),
2330
2333
  ),
2331
2334
  /** Cryptographic signature. */
@@ -2356,12 +2359,12 @@ export const TwapCancelRequest = v.pipe(
2356
2359
  ),
2357
2360
  /** Asset ID. */
2358
2361
  a: v.pipe(
2359
- UnsignedIntegerMayInputString,
2362
+ UnsignedInteger,
2360
2363
  v.description("Asset ID."),
2361
2364
  ),
2362
2365
  /** Twap ID. */
2363
2366
  t: v.pipe(
2364
- UnsignedIntegerMayInputString,
2367
+ UnsignedInteger,
2365
2368
  v.description("Twap ID."),
2366
2369
  ),
2367
2370
  }),
@@ -2369,7 +2372,7 @@ export const TwapCancelRequest = v.pipe(
2369
2372
  ),
2370
2373
  /** Unique request identifier (current timestamp in ms). */
2371
2374
  nonce: v.pipe(
2372
- UnsignedIntegerMayInputString,
2375
+ UnsignedInteger,
2373
2376
  v.description("Unique request identifier (current timestamp in ms)."),
2374
2377
  ),
2375
2378
  /** Cryptographic signature. */
@@ -2379,12 +2382,12 @@ export const TwapCancelRequest = v.pipe(
2379
2382
  ),
2380
2383
  /** Vault address (for vault trading). */
2381
2384
  vaultAddress: v.pipe(
2382
- v.optional(v.pipe(Hex, v.length(42))),
2385
+ v.optional(Address),
2383
2386
  v.description("Vault address (for vault trading)."),
2384
2387
  ),
2385
2388
  /** Expiration time of the action. */
2386
2389
  expiresAfter: v.pipe(
2387
- v.optional(UnsignedIntegerMayInputString),
2390
+ v.optional(UnsignedInteger),
2388
2391
  v.description("Expiration time of the action."),
2389
2392
  ),
2390
2393
  }),
@@ -2413,7 +2416,7 @@ export const TwapOrderRequest = v.pipe(
2413
2416
  v.object({
2414
2417
  /** Asset ID. */
2415
2418
  a: v.pipe(
2416
- UnsignedIntegerMayInputString,
2419
+ UnsignedInteger,
2417
2420
  v.description("Asset ID."),
2418
2421
  ),
2419
2422
  /** Position side (`true` for long, `false` for short). */
@@ -2423,7 +2426,7 @@ export const TwapOrderRequest = v.pipe(
2423
2426
  ),
2424
2427
  /** Size (in base currency units). */
2425
2428
  s: v.pipe(
2426
- UnsignedDecimalMayInputNumber,
2429
+ UnsignedDecimal,
2427
2430
  v.description("Size (in base currency units)."),
2428
2431
  ),
2429
2432
  /** Is reduce-only? */
@@ -2433,7 +2436,7 @@ export const TwapOrderRequest = v.pipe(
2433
2436
  ),
2434
2437
  /** TWAP duration in minutes. */
2435
2438
  m: v.pipe(
2436
- UnsignedIntegerMayInputString,
2439
+ UnsignedInteger,
2437
2440
  v.description("TWAP duration in minutes."),
2438
2441
  ),
2439
2442
  /** Enable random order timing. */
@@ -2449,7 +2452,7 @@ export const TwapOrderRequest = v.pipe(
2449
2452
  ),
2450
2453
  /** Unique request identifier (current timestamp in ms). */
2451
2454
  nonce: v.pipe(
2452
- UnsignedIntegerMayInputString,
2455
+ UnsignedInteger,
2453
2456
  v.description("Unique request identifier (current timestamp in ms)."),
2454
2457
  ),
2455
2458
  /** Cryptographic signature. */
@@ -2459,12 +2462,12 @@ export const TwapOrderRequest = v.pipe(
2459
2462
  ),
2460
2463
  /** Vault address (for vault trading). */
2461
2464
  vaultAddress: v.pipe(
2462
- v.optional(v.pipe(Hex, v.length(42))),
2465
+ v.optional(Address),
2463
2466
  v.description("Vault address (for vault trading)."),
2464
2467
  ),
2465
2468
  /** Expiration time of the action. */
2466
2469
  expiresAfter: v.pipe(
2467
- v.optional(UnsignedIntegerMayInputString),
2470
+ v.optional(UnsignedInteger),
2468
2471
  v.description("Expiration time of the action."),
2469
2472
  ),
2470
2473
  }),
@@ -2490,7 +2493,7 @@ export const UpdateIsolatedMarginRequest = v.pipe(
2490
2493
  ),
2491
2494
  /** Asset ID. */
2492
2495
  asset: v.pipe(
2493
- UnsignedIntegerMayInputString,
2496
+ UnsignedInteger,
2494
2497
  v.description("Asset ID."),
2495
2498
  ),
2496
2499
  /** Position side (`true` for long, `false` for short). */
@@ -2500,7 +2503,7 @@ export const UpdateIsolatedMarginRequest = v.pipe(
2500
2503
  ),
2501
2504
  /** Amount to adjust (float * 1e6). */
2502
2505
  ntli: v.pipe(
2503
- UnsignedIntegerMayInputString,
2506
+ UnsignedInteger,
2504
2507
  v.description("Amount to adjust (float * 1e6)."),
2505
2508
  ),
2506
2509
  }),
@@ -2508,7 +2511,7 @@ export const UpdateIsolatedMarginRequest = v.pipe(
2508
2511
  ),
2509
2512
  /** Unique request identifier (current timestamp in ms). */
2510
2513
  nonce: v.pipe(
2511
- UnsignedIntegerMayInputString,
2514
+ UnsignedInteger,
2512
2515
  v.description("Unique request identifier (current timestamp in ms)."),
2513
2516
  ),
2514
2517
  /** Cryptographic signature. */
@@ -2518,12 +2521,12 @@ export const UpdateIsolatedMarginRequest = v.pipe(
2518
2521
  ),
2519
2522
  /** Vault address (for vault trading). */
2520
2523
  vaultAddress: v.pipe(
2521
- v.optional(v.pipe(Hex, v.length(42))),
2524
+ v.optional(Address),
2522
2525
  v.description("Vault address (for vault trading)."),
2523
2526
  ),
2524
2527
  /** Expiration time of the action. */
2525
2528
  expiresAfter: v.pipe(
2526
- v.optional(UnsignedIntegerMayInputString),
2529
+ v.optional(UnsignedInteger),
2527
2530
  v.description("Expiration time of the action."),
2528
2531
  ),
2529
2532
  }),
@@ -2549,7 +2552,7 @@ export const UpdateLeverageRequest = v.pipe(
2549
2552
  ),
2550
2553
  /** Asset ID. */
2551
2554
  asset: v.pipe(
2552
- UnsignedIntegerMayInputString,
2555
+ UnsignedInteger,
2553
2556
  v.description("Asset ID."),
2554
2557
  ),
2555
2558
  /** `true` for cross leverage, `false` for isolated leverage. */
@@ -2559,7 +2562,7 @@ export const UpdateLeverageRequest = v.pipe(
2559
2562
  ),
2560
2563
  /** New leverage value. */
2561
2564
  leverage: v.pipe(
2562
- v.pipe(UnsignedIntegerMayInputString, v.minValue(1)),
2565
+ v.pipe(UnsignedInteger, v.minValue(1)),
2563
2566
  v.description("New leverage value."),
2564
2567
  ),
2565
2568
  }),
@@ -2567,7 +2570,7 @@ export const UpdateLeverageRequest = v.pipe(
2567
2570
  ),
2568
2571
  /** Unique request identifier (current timestamp in ms). */
2569
2572
  nonce: v.pipe(
2570
- UnsignedIntegerMayInputString,
2573
+ UnsignedInteger,
2571
2574
  v.description("Unique request identifier (current timestamp in ms)."),
2572
2575
  ),
2573
2576
  /** Cryptographic signature. */
@@ -2577,12 +2580,12 @@ export const UpdateLeverageRequest = v.pipe(
2577
2580
  ),
2578
2581
  /** Vault address (for vault trading). */
2579
2582
  vaultAddress: v.pipe(
2580
- v.optional(v.pipe(Hex, v.length(42))),
2583
+ v.optional(Address),
2581
2584
  v.description("Vault address (for vault trading)."),
2582
2585
  ),
2583
2586
  /** Expiration time of the action. */
2584
2587
  expiresAfter: v.pipe(
2585
- v.optional(UnsignedIntegerMayInputString),
2588
+ v.optional(UnsignedInteger),
2586
2589
  v.description("Expiration time of the action."),
2587
2590
  ),
2588
2591
  }),
@@ -2618,7 +2621,7 @@ export const UsdClassTransferRequest = v.pipe(
2618
2621
  ),
2619
2622
  /** Amount to transfer (1 = 1$). */
2620
2623
  amount: v.pipe(
2621
- UnsignedDecimalMayInputNumber,
2624
+ UnsignedDecimal,
2622
2625
  v.description("Amount to transfer (1 = 1$)."),
2623
2626
  ),
2624
2627
  /** `true` for Spot to Perp, `false` for Perp to Spot. */
@@ -2628,7 +2631,7 @@ export const UsdClassTransferRequest = v.pipe(
2628
2631
  ),
2629
2632
  /** Unique request identifier (current timestamp in ms). */
2630
2633
  nonce: v.pipe(
2631
- UnsignedIntegerMayInputString,
2634
+ UnsignedInteger,
2632
2635
  v.description("Unique request identifier (current timestamp in ms)."),
2633
2636
  ),
2634
2637
  }),
@@ -2636,7 +2639,7 @@ export const UsdClassTransferRequest = v.pipe(
2636
2639
  ),
2637
2640
  /** Unique request identifier (current timestamp in ms). */
2638
2641
  nonce: v.pipe(
2639
- UnsignedIntegerMayInputString,
2642
+ UnsignedInteger,
2640
2643
  v.description("Unique request identifier (current timestamp in ms)."),
2641
2644
  ),
2642
2645
  /** Cryptographic signature. */
@@ -2677,17 +2680,17 @@ export const UsdSendRequest = v.pipe(
2677
2680
  ),
2678
2681
  /** Destination address. */
2679
2682
  destination: v.pipe(
2680
- v.pipe(Hex, v.length(42)),
2683
+ Address,
2681
2684
  v.description("Destination address."),
2682
2685
  ),
2683
2686
  /** Amount to send (1 = 1$). */
2684
2687
  amount: v.pipe(
2685
- UnsignedDecimalMayInputNumber,
2688
+ UnsignedDecimal,
2686
2689
  v.description("Amount to send (1 = 1$)."),
2687
2690
  ),
2688
2691
  /** Unique request identifier (current timestamp in ms). */
2689
2692
  time: v.pipe(
2690
- UnsignedIntegerMayInputString,
2693
+ UnsignedInteger,
2691
2694
  v.description("Unique request identifier (current timestamp in ms)."),
2692
2695
  ),
2693
2696
  }),
@@ -2695,7 +2698,7 @@ export const UsdSendRequest = v.pipe(
2695
2698
  ),
2696
2699
  /** Unique request identifier (current timestamp in ms). */
2697
2700
  nonce: v.pipe(
2698
- UnsignedIntegerMayInputString,
2701
+ UnsignedInteger,
2699
2702
  v.description("Unique request identifier (current timestamp in ms)."),
2700
2703
  ),
2701
2704
  /** Cryptographic signature. */
@@ -2726,7 +2729,7 @@ export const VaultDistributeRequest = v.pipe(
2726
2729
  ),
2727
2730
  /** Vault address. */
2728
2731
  vaultAddress: v.pipe(
2729
- v.pipe(Hex, v.length(42)),
2732
+ Address,
2730
2733
  v.description("Vault address."),
2731
2734
  ),
2732
2735
  /**
@@ -2735,7 +2738,7 @@ export const VaultDistributeRequest = v.pipe(
2735
2738
  * Set to 0 to close the vault.
2736
2739
  */
2737
2740
  usd: v.pipe(
2738
- UnsignedIntegerMayInputString,
2741
+ UnsignedInteger,
2739
2742
  v.description(
2740
2743
  "Amount to distribute (float * 1e6)." +
2741
2744
  "\n\nSet to 0 to close the vault.",
@@ -2746,7 +2749,7 @@ export const VaultDistributeRequest = v.pipe(
2746
2749
  ),
2747
2750
  /** Unique request identifier (current timestamp in ms). */
2748
2751
  nonce: v.pipe(
2749
- UnsignedIntegerMayInputString,
2752
+ UnsignedInteger,
2750
2753
  v.description("Unique request identifier (current timestamp in ms)."),
2751
2754
  ),
2752
2755
  /** Cryptographic signature. */
@@ -2756,7 +2759,7 @@ export const VaultDistributeRequest = v.pipe(
2756
2759
  ),
2757
2760
  /** Expiration time of the action. */
2758
2761
  expiresAfter: v.pipe(
2759
- v.optional(UnsignedIntegerMayInputString),
2762
+ v.optional(UnsignedInteger),
2760
2763
  v.description("Expiration time of the action."),
2761
2764
  ),
2762
2765
  }),
@@ -2782,17 +2785,17 @@ export const VaultModifyRequest = v.pipe(
2782
2785
  ),
2783
2786
  /** Vault address. */
2784
2787
  vaultAddress: v.pipe(
2785
- v.pipe(Hex, v.length(42)),
2788
+ Address,
2786
2789
  v.description("Vault address."),
2787
2790
  ),
2788
- /** Allow deposits from followers. */
2791
+ /** Allow deposits from followers (default: null). */
2789
2792
  allowDeposits: v.pipe(
2790
- v.nullable(v.boolean()),
2793
+ v.optional(v.nullable(v.boolean()), null),
2791
2794
  v.description("Allow deposits from followers."),
2792
2795
  ),
2793
- /** Always close positions on withdrawal. */
2796
+ /** Always close positions on withdrawal (default: null). */
2794
2797
  alwaysCloseOnWithdraw: v.pipe(
2795
- v.nullable(v.boolean()),
2798
+ v.optional(v.nullable(v.boolean()), null),
2796
2799
  v.description("Always close positions on withdrawal."),
2797
2800
  ),
2798
2801
  }),
@@ -2800,7 +2803,7 @@ export const VaultModifyRequest = v.pipe(
2800
2803
  ),
2801
2804
  /** Unique request identifier (current timestamp in ms). */
2802
2805
  nonce: v.pipe(
2803
- UnsignedIntegerMayInputString,
2806
+ UnsignedInteger,
2804
2807
  v.description("Unique request identifier (current timestamp in ms)."),
2805
2808
  ),
2806
2809
  /** Cryptographic signature. */
@@ -2810,7 +2813,7 @@ export const VaultModifyRequest = v.pipe(
2810
2813
  ),
2811
2814
  /** Expiration time of the action. */
2812
2815
  expiresAfter: v.pipe(
2813
- v.optional(UnsignedIntegerMayInputString),
2816
+ v.optional(UnsignedInteger),
2814
2817
  v.description("Expiration time of the action."),
2815
2818
  ),
2816
2819
  }),
@@ -2836,7 +2839,7 @@ export const VaultTransferRequest = v.pipe(
2836
2839
  ),
2837
2840
  /** Vault address. */
2838
2841
  vaultAddress: v.pipe(
2839
- v.pipe(Hex, v.length(42)),
2842
+ Address,
2840
2843
  v.description("Vault address."),
2841
2844
  ),
2842
2845
  /** `true` for deposit, `false` for withdrawal. */
@@ -2846,7 +2849,7 @@ export const VaultTransferRequest = v.pipe(
2846
2849
  ),
2847
2850
  /** Amount for deposit/withdrawal (float * 1e6). */
2848
2851
  usd: v.pipe(
2849
- UnsignedIntegerMayInputString,
2852
+ UnsignedInteger,
2850
2853
  v.description("Amount for deposit/withdrawal (float * 1e6)."),
2851
2854
  ),
2852
2855
  }),
@@ -2854,7 +2857,7 @@ export const VaultTransferRequest = v.pipe(
2854
2857
  ),
2855
2858
  /** Unique request identifier (current timestamp in ms). */
2856
2859
  nonce: v.pipe(
2857
- UnsignedIntegerMayInputString,
2860
+ UnsignedInteger,
2858
2861
  v.description("Unique request identifier (current timestamp in ms)."),
2859
2862
  ),
2860
2863
  /** Cryptographic signature. */
@@ -2864,7 +2867,7 @@ export const VaultTransferRequest = v.pipe(
2864
2867
  ),
2865
2868
  /** Expiration time of the action. */
2866
2869
  expiresAfter: v.pipe(
2867
- v.optional(UnsignedIntegerMayInputString),
2870
+ v.optional(UnsignedInteger),
2868
2871
  v.description("Expiration time of the action."),
2869
2872
  ),
2870
2873
  }),
@@ -2900,17 +2903,17 @@ export const Withdraw3Request = v.pipe(
2900
2903
  ),
2901
2904
  /** Destination address. */
2902
2905
  destination: v.pipe(
2903
- v.pipe(Hex, v.length(42)),
2906
+ Address,
2904
2907
  v.description("Destination address."),
2905
2908
  ),
2906
2909
  /** Amount to withdraw (1 = 1$). */
2907
2910
  amount: v.pipe(
2908
- UnsignedDecimalMayInputNumber,
2911
+ UnsignedDecimal,
2909
2912
  v.description("Amount to withdraw (1 = 1$)."),
2910
2913
  ),
2911
2914
  /** Unique request identifier (current timestamp in ms). */
2912
2915
  time: v.pipe(
2913
- UnsignedIntegerMayInputString,
2916
+ UnsignedInteger,
2914
2917
  v.description("Unique request identifier (current timestamp in ms)."),
2915
2918
  ),
2916
2919
  }),
@@ -2918,7 +2921,7 @@ export const Withdraw3Request = v.pipe(
2918
2921
  ),
2919
2922
  /** Unique request identifier (current timestamp in ms). */
2920
2923
  nonce: v.pipe(
2921
- UnsignedIntegerMayInputString,
2924
+ UnsignedInteger,
2922
2925
  v.description("Unique request identifier (current timestamp in ms)."),
2923
2926
  ),
2924
2927
  /** Cryptographic signature. */
@@ -2962,12 +2965,12 @@ export const MultiSigRequest = v.pipe(
2962
2965
  v.object({
2963
2966
  /** Address of the multi-signature user account. */
2964
2967
  multiSigUser: v.pipe(
2965
- v.pipe(Hex, v.length(42)),
2968
+ Address,
2966
2969
  v.description("Address of the multi-signature user account."),
2967
2970
  ),
2968
2971
  /** Address of the authorized user initiating the request (any authorized user). */
2969
2972
  outerSigner: v.pipe(
2970
- v.pipe(Hex, v.length(42)),
2973
+ Address,
2971
2974
  v.description(
2972
2975
  "Address of the authorized user initiating the request (any authorized user).",
2973
2976
  ),
@@ -3027,7 +3030,7 @@ export const MultiSigRequest = v.pipe(
3027
3030
  ),
3028
3031
  /** Unique request identifier (current timestamp in ms). */
3029
3032
  nonce: v.pipe(
3030
- UnsignedIntegerMayInputString,
3033
+ UnsignedInteger,
3031
3034
  v.description("Unique request identifier (current timestamp in ms)."),
3032
3035
  ),
3033
3036
  /** Cryptographic signature. */
@@ -3037,12 +3040,12 @@ export const MultiSigRequest = v.pipe(
3037
3040
  ),
3038
3041
  /** Vault address (for vault trading). */
3039
3042
  vaultAddress: v.pipe(
3040
- v.optional(v.pipe(Hex, v.length(42))),
3043
+ v.optional(Address),
3041
3044
  v.description("Vault address (for vault trading)."),
3042
3045
  ),
3043
3046
  /** Expiration time of the action. */
3044
3047
  expiresAfter: v.pipe(
3045
- v.optional(UnsignedIntegerMayInputString),
3048
+ v.optional(UnsignedInteger),
3046
3049
  v.description("Expiration time of the action."),
3047
3050
  ),
3048
3051
  }),