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

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 (284) hide show
  1. package/README.md +64 -16
  2. package/esm/bin/cli.d.ts +3 -0
  3. package/esm/bin/cli.d.ts.map +1 -0
  4. package/esm/bin/cli.js +452 -0
  5. package/esm/bin/cli.js.map +1 -0
  6. package/{script/src/errors.d.ts → esm/src/_errors.d.ts} +1 -1
  7. package/esm/src/_errors.d.ts.map +1 -0
  8. package/esm/src/{errors.js → _errors.js} +1 -0
  9. package/esm/src/_errors.js.map +1 -0
  10. package/esm/src/clients/exchange.d.ts +4 -11
  11. package/esm/src/clients/exchange.d.ts.map +1 -1
  12. package/esm/src/clients/exchange.js +8 -9
  13. package/esm/src/clients/exchange.js.map +1 -0
  14. package/esm/src/clients/info.d.ts +86 -2
  15. package/esm/src/clients/info.d.ts.map +1 -1
  16. package/esm/src/clients/info.js +103 -1
  17. package/esm/src/clients/info.js.map +1 -0
  18. package/esm/src/clients/multiSign.d.ts +1 -1
  19. package/esm/src/clients/multiSign.d.ts.map +1 -1
  20. package/esm/src/clients/multiSign.js +3 -2
  21. package/esm/src/clients/multiSign.js.map +1 -0
  22. package/esm/src/clients/subscription.js +1 -0
  23. package/esm/src/clients/subscription.js.map +1 -0
  24. package/esm/src/mod.d.ts +21 -0
  25. package/esm/src/mod.d.ts.map +1 -0
  26. package/esm/src/mod.js +14 -0
  27. package/esm/src/mod.js.map +1 -0
  28. package/esm/src/schemas/_base.d.ts +11 -3
  29. package/esm/src/schemas/_base.d.ts.map +1 -1
  30. package/esm/src/schemas/_base.js +30 -2
  31. package/esm/src/schemas/_base.js.map +1 -0
  32. package/esm/src/schemas/exchange/requests.d.ts +1872 -1872
  33. package/esm/src/schemas/exchange/requests.d.ts.map +1 -1
  34. package/esm/src/schemas/exchange/requests.js +277 -281
  35. package/esm/src/schemas/exchange/requests.js.map +1 -0
  36. package/esm/src/schemas/exchange/responses.d.ts +51 -51
  37. package/esm/src/schemas/exchange/responses.js +55 -54
  38. package/esm/src/schemas/exchange/responses.js.map +1 -0
  39. package/esm/src/schemas/explorer/requests.d.ts +5 -5
  40. package/esm/src/schemas/explorer/requests.js +6 -5
  41. package/esm/src/schemas/explorer/requests.js.map +1 -0
  42. package/esm/src/schemas/explorer/responses.d.ts +10 -10
  43. package/esm/src/schemas/explorer/responses.js +12 -11
  44. package/esm/src/schemas/explorer/responses.js.map +1 -0
  45. package/esm/src/schemas/info/accounts.d.ts +1042 -296
  46. package/esm/src/schemas/info/accounts.d.ts.map +1 -1
  47. package/esm/src/schemas/info/accounts.js +154 -109
  48. package/esm/src/schemas/info/accounts.js.map +1 -0
  49. package/esm/src/schemas/info/assets.d.ts +130 -101
  50. package/esm/src/schemas/info/assets.d.ts.map +1 -1
  51. package/esm/src/schemas/info/assets.js +69 -49
  52. package/esm/src/schemas/info/assets.js.map +1 -0
  53. package/esm/src/schemas/info/markets.d.ts +35 -18
  54. package/esm/src/schemas/info/markets.d.ts.map +1 -1
  55. package/esm/src/schemas/info/markets.js +27 -15
  56. package/esm/src/schemas/info/markets.js.map +1 -0
  57. package/esm/src/schemas/info/orders.d.ts +151 -151
  58. package/esm/src/schemas/info/orders.js +37 -36
  59. package/esm/src/schemas/info/orders.js.map +1 -0
  60. package/esm/src/schemas/info/requests.d.ts +145 -88
  61. package/esm/src/schemas/info/requests.d.ts.map +1 -1
  62. package/esm/src/schemas/info/requests.js +116 -73
  63. package/esm/src/schemas/info/requests.js.map +1 -0
  64. package/esm/src/schemas/info/validators.d.ts +60 -39
  65. package/esm/src/schemas/info/validators.d.ts.map +1 -1
  66. package/esm/src/schemas/info/validators.js +40 -26
  67. package/esm/src/schemas/info/validators.js.map +1 -0
  68. package/esm/src/schemas/info/vaults.d.ts +59 -59
  69. package/esm/src/schemas/info/vaults.js +20 -19
  70. package/esm/src/schemas/info/vaults.js.map +1 -0
  71. package/esm/src/schemas/mod.d.ts +4 -3
  72. package/esm/src/schemas/mod.d.ts.map +1 -1
  73. package/esm/src/schemas/mod.js +5 -3
  74. package/esm/src/schemas/mod.js.map +1 -0
  75. package/esm/src/schemas/subscriptions/requests.d.ts +23 -23
  76. package/esm/src/schemas/subscriptions/requests.d.ts.map +1 -1
  77. package/esm/src/schemas/subscriptions/requests.js +25 -24
  78. package/esm/src/schemas/subscriptions/requests.js.map +1 -0
  79. package/esm/src/schemas/subscriptions/responses.d.ts +547 -547
  80. package/esm/src/schemas/subscriptions/responses.js +41 -40
  81. package/esm/src/schemas/subscriptions/responses.js.map +1 -0
  82. package/esm/src/signing/mod.d.ts +1 -1
  83. package/esm/src/signing/mod.d.ts.map +1 -1
  84. package/esm/src/signing/mod.js +3 -2
  85. package/esm/src/signing/mod.js.map +1 -0
  86. package/esm/src/signing/signTypedData/ethers.d.ts.map +1 -0
  87. package/esm/src/signing/{_signTypedData → signTypedData}/ethers.js +1 -0
  88. package/esm/src/signing/signTypedData/ethers.js.map +1 -0
  89. package/esm/src/signing/signTypedData/mod.d.ts.map +1 -0
  90. package/esm/src/signing/{_signTypedData → signTypedData}/mod.js +1 -0
  91. package/esm/src/signing/signTypedData/mod.js.map +1 -0
  92. package/esm/src/signing/signTypedData/private_key.d.ts.map +1 -0
  93. package/esm/src/signing/{_signTypedData → signTypedData}/private_key.js +10 -8
  94. package/esm/src/signing/signTypedData/private_key.js.map +1 -0
  95. package/esm/src/signing/signTypedData/viem.d.ts.map +1 -0
  96. package/esm/src/signing/{_signTypedData → signTypedData}/viem.js +1 -0
  97. package/esm/src/signing/signTypedData/viem.js.map +1 -0
  98. package/esm/src/transports/base.d.ts +4 -4
  99. package/esm/src/transports/base.d.ts.map +1 -1
  100. package/esm/src/transports/base.js +3 -2
  101. package/esm/src/transports/base.js.map +1 -0
  102. package/esm/src/transports/http/http_transport.d.ts +1 -1
  103. package/esm/src/transports/http/http_transport.js +1 -0
  104. package/esm/src/transports/http/http_transport.js.map +1 -0
  105. package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -0
  106. package/esm/src/transports/websocket/_hyperliquid_event_target.js.map +1 -0
  107. package/esm/src/transports/websocket/_reconnecting_websocket.js +1 -0
  108. package/esm/src/transports/websocket/_reconnecting_websocket.js.map +1 -0
  109. package/esm/src/transports/websocket/_websocket_async_request.js +1 -0
  110. package/esm/src/transports/websocket/_websocket_async_request.js.map +1 -0
  111. package/esm/src/transports/websocket/websocket_transport.d.ts +7 -0
  112. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  113. package/esm/src/transports/websocket/websocket_transport.js +4 -0
  114. package/esm/src/transports/websocket/websocket_transport.js.map +1 -0
  115. package/package.json +15 -7
  116. package/script/bin/cli.d.ts +3 -0
  117. package/script/bin/cli.d.ts.map +1 -0
  118. package/script/bin/cli.js +490 -0
  119. package/script/bin/cli.js.map +1 -0
  120. package/{esm/src/errors.d.ts → script/src/_errors.d.ts} +1 -1
  121. package/script/src/_errors.d.ts.map +1 -0
  122. package/script/src/{errors.js → _errors.js} +1 -0
  123. package/script/src/_errors.js.map +1 -0
  124. package/script/src/clients/exchange.d.ts +4 -11
  125. package/script/src/clients/exchange.d.ts.map +1 -1
  126. package/script/src/clients/exchange.js +9 -10
  127. package/script/src/clients/exchange.js.map +1 -0
  128. package/script/src/clients/info.d.ts +86 -2
  129. package/script/src/clients/info.d.ts.map +1 -1
  130. package/script/src/clients/info.js +102 -0
  131. package/script/src/clients/info.js.map +1 -0
  132. package/script/src/clients/multiSign.d.ts +1 -1
  133. package/script/src/clients/multiSign.d.ts.map +1 -1
  134. package/script/src/clients/multiSign.js +3 -2
  135. package/script/src/clients/multiSign.js.map +1 -0
  136. package/script/src/clients/subscription.js +1 -0
  137. package/script/src/clients/subscription.js.map +1 -0
  138. package/script/src/mod.d.ts +21 -0
  139. package/script/src/mod.d.ts.map +1 -0
  140. package/script/{mod.js → src/mod.js} +13 -8
  141. package/script/src/mod.js.map +1 -0
  142. package/script/src/schemas/_base.d.ts +11 -3
  143. package/script/src/schemas/_base.d.ts.map +1 -1
  144. package/script/src/schemas/_base.js +31 -3
  145. package/script/src/schemas/_base.js.map +1 -0
  146. package/script/src/schemas/exchange/requests.d.ts +1872 -1872
  147. package/script/src/schemas/exchange/requests.d.ts.map +1 -1
  148. package/script/src/schemas/exchange/requests.js +276 -280
  149. package/script/src/schemas/exchange/requests.js.map +1 -0
  150. package/script/src/schemas/exchange/responses.d.ts +51 -51
  151. package/script/src/schemas/exchange/responses.js +54 -53
  152. package/script/src/schemas/exchange/responses.js.map +1 -0
  153. package/script/src/schemas/explorer/requests.d.ts +5 -5
  154. package/script/src/schemas/explorer/requests.js +5 -4
  155. package/script/src/schemas/explorer/requests.js.map +1 -0
  156. package/script/src/schemas/explorer/responses.d.ts +10 -10
  157. package/script/src/schemas/explorer/responses.js +11 -10
  158. package/script/src/schemas/explorer/responses.js.map +1 -0
  159. package/script/src/schemas/info/accounts.d.ts +1042 -296
  160. package/script/src/schemas/info/accounts.d.ts.map +1 -1
  161. package/script/src/schemas/info/accounts.js +154 -109
  162. package/script/src/schemas/info/accounts.js.map +1 -0
  163. package/script/src/schemas/info/assets.d.ts +130 -101
  164. package/script/src/schemas/info/assets.d.ts.map +1 -1
  165. package/script/src/schemas/info/assets.js +69 -49
  166. package/script/src/schemas/info/assets.js.map +1 -0
  167. package/script/src/schemas/info/markets.d.ts +35 -18
  168. package/script/src/schemas/info/markets.d.ts.map +1 -1
  169. package/script/src/schemas/info/markets.js +27 -15
  170. package/script/src/schemas/info/markets.js.map +1 -0
  171. package/script/src/schemas/info/orders.d.ts +151 -151
  172. package/script/src/schemas/info/orders.js +36 -35
  173. package/script/src/schemas/info/orders.js.map +1 -0
  174. package/script/src/schemas/info/requests.d.ts +145 -88
  175. package/script/src/schemas/info/requests.d.ts.map +1 -1
  176. package/script/src/schemas/info/requests.js +116 -73
  177. package/script/src/schemas/info/requests.js.map +1 -0
  178. package/script/src/schemas/info/validators.d.ts +60 -39
  179. package/script/src/schemas/info/validators.d.ts.map +1 -1
  180. package/script/src/schemas/info/validators.js +40 -26
  181. package/script/src/schemas/info/validators.js.map +1 -0
  182. package/script/src/schemas/info/vaults.d.ts +59 -59
  183. package/script/src/schemas/info/vaults.js +19 -18
  184. package/script/src/schemas/info/vaults.js.map +1 -0
  185. package/script/src/schemas/mod.d.ts +4 -3
  186. package/script/src/schemas/mod.d.ts.map +1 -1
  187. package/script/src/schemas/mod.js +8 -5
  188. package/script/src/schemas/mod.js.map +1 -0
  189. package/script/src/schemas/subscriptions/requests.d.ts +23 -23
  190. package/script/src/schemas/subscriptions/requests.d.ts.map +1 -1
  191. package/script/src/schemas/subscriptions/requests.js +24 -23
  192. package/script/src/schemas/subscriptions/requests.js.map +1 -0
  193. package/script/src/schemas/subscriptions/responses.d.ts +547 -547
  194. package/script/src/schemas/subscriptions/responses.js +40 -39
  195. package/script/src/schemas/subscriptions/responses.js.map +1 -0
  196. package/script/src/signing/mod.d.ts +1 -1
  197. package/script/src/signing/mod.d.ts.map +1 -1
  198. package/script/src/signing/mod.js +4 -3
  199. package/script/src/signing/mod.js.map +1 -0
  200. package/script/src/signing/signTypedData/ethers.d.ts.map +1 -0
  201. package/script/src/signing/{_signTypedData → signTypedData}/ethers.js +1 -0
  202. package/script/src/signing/signTypedData/ethers.js.map +1 -0
  203. package/script/src/signing/signTypedData/mod.d.ts.map +1 -0
  204. package/script/src/signing/{_signTypedData → signTypedData}/mod.js +1 -0
  205. package/script/src/signing/signTypedData/mod.js.map +1 -0
  206. package/script/src/signing/signTypedData/private_key.d.ts.map +1 -0
  207. package/script/src/signing/{_signTypedData → signTypedData}/private_key.js +17 -15
  208. package/script/src/signing/signTypedData/private_key.js.map +1 -0
  209. package/script/src/signing/signTypedData/viem.d.ts.map +1 -0
  210. package/script/src/signing/{_signTypedData → signTypedData}/viem.js +1 -0
  211. package/script/src/signing/signTypedData/viem.js.map +1 -0
  212. package/script/src/transports/base.d.ts +4 -4
  213. package/script/src/transports/base.d.ts.map +1 -1
  214. package/script/src/transports/base.js +4 -3
  215. package/script/src/transports/base.js.map +1 -0
  216. package/script/src/transports/http/http_transport.d.ts +1 -1
  217. package/script/src/transports/http/http_transport.js +1 -0
  218. package/script/src/transports/http/http_transport.js.map +1 -0
  219. package/script/src/transports/websocket/_hyperliquid_event_target.js +1 -0
  220. package/script/src/transports/websocket/_hyperliquid_event_target.js.map +1 -0
  221. package/script/src/transports/websocket/_reconnecting_websocket.js +1 -0
  222. package/script/src/transports/websocket/_reconnecting_websocket.js.map +1 -0
  223. package/script/src/transports/websocket/_websocket_async_request.js +1 -0
  224. package/script/src/transports/websocket/_websocket_async_request.js.map +1 -0
  225. package/script/src/transports/websocket/websocket_transport.d.ts +7 -0
  226. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  227. package/script/src/transports/websocket/websocket_transport.js +4 -0
  228. package/script/src/transports/websocket/websocket_transport.js.map +1 -0
  229. package/src/bin/cli.ts +481 -0
  230. package/src/src/_errors.ts +7 -0
  231. package/src/src/clients/exchange.ts +2246 -0
  232. package/src/src/clients/info.ts +2110 -0
  233. package/src/src/clients/multiSign.ts +183 -0
  234. package/src/src/clients/subscription.ts +841 -0
  235. package/src/src/mod.ts +29 -0
  236. package/src/src/schemas/_base.ts +82 -0
  237. package/src/src/schemas/exchange/requests.ts +3052 -0
  238. package/src/src/schemas/exchange/responses.ts +540 -0
  239. package/src/src/schemas/explorer/requests.ts +65 -0
  240. package/src/src/schemas/explorer/responses.ts +138 -0
  241. package/src/src/schemas/info/accounts.ts +1598 -0
  242. package/src/src/schemas/info/assets.ts +693 -0
  243. package/src/src/schemas/info/markets.ts +171 -0
  244. package/src/src/schemas/info/orders.ts +597 -0
  245. package/src/src/schemas/info/requests.ts +1401 -0
  246. package/src/src/schemas/info/validators.ts +297 -0
  247. package/src/src/schemas/info/vaults.ts +262 -0
  248. package/src/src/schemas/mod.ts +121 -0
  249. package/src/src/schemas/subscriptions/requests.ts +514 -0
  250. package/src/src/schemas/subscriptions/responses.ts +576 -0
  251. package/src/src/signing/mod.ts +572 -0
  252. package/src/src/signing/signTypedData/ethers.ts +59 -0
  253. package/src/src/signing/signTypedData/mod.ts +121 -0
  254. package/src/src/signing/signTypedData/private_key.ts +234 -0
  255. package/src/src/signing/signTypedData/viem.ts +55 -0
  256. package/src/src/transports/base.ts +54 -0
  257. package/src/src/transports/http/http_transport.ts +208 -0
  258. package/src/src/transports/websocket/_hyperliquid_event_target.ts +118 -0
  259. package/src/src/transports/websocket/_reconnecting_websocket.ts +404 -0
  260. package/src/src/transports/websocket/_websocket_async_request.ts +229 -0
  261. package/src/src/transports/websocket/websocket_transport.ts +394 -0
  262. package/esm/mod.d.ts +0 -20
  263. package/esm/mod.d.ts.map +0 -1
  264. package/esm/mod.js +0 -11
  265. package/esm/src/errors.d.ts.map +0 -1
  266. package/esm/src/signing/_signTypedData/ethers.d.ts.map +0 -1
  267. package/esm/src/signing/_signTypedData/mod.d.ts.map +0 -1
  268. package/esm/src/signing/_signTypedData/private_key.d.ts.map +0 -1
  269. package/esm/src/signing/_signTypedData/viem.d.ts.map +0 -1
  270. package/script/mod.d.ts +0 -20
  271. package/script/mod.d.ts.map +0 -1
  272. package/script/src/errors.d.ts.map +0 -1
  273. package/script/src/signing/_signTypedData/ethers.d.ts.map +0 -1
  274. package/script/src/signing/_signTypedData/mod.d.ts.map +0 -1
  275. package/script/src/signing/_signTypedData/private_key.d.ts.map +0 -1
  276. package/script/src/signing/_signTypedData/viem.d.ts.map +0 -1
  277. /package/esm/src/signing/{_signTypedData → signTypedData}/ethers.d.ts +0 -0
  278. /package/esm/src/signing/{_signTypedData → signTypedData}/mod.d.ts +0 -0
  279. /package/esm/src/signing/{_signTypedData → signTypedData}/private_key.d.ts +0 -0
  280. /package/esm/src/signing/{_signTypedData → signTypedData}/viem.d.ts +0 -0
  281. /package/script/src/signing/{_signTypedData → signTypedData}/ethers.d.ts +0 -0
  282. /package/script/src/signing/{_signTypedData → signTypedData}/mod.d.ts +0 -0
  283. /package/script/src/signing/{_signTypedData → signTypedData}/private_key.d.ts +0 -0
  284. /package/script/src/signing/{_signTypedData → signTypedData}/viem.d.ts +0 -0
@@ -0,0 +1,1401 @@
1
+ import * as v from "valibot";
2
+ import { Hex, UnsignedIntegerMayInputString } from "../_base.js";
3
+
4
+ /**
5
+ * Request user active asset data.
6
+ * @returns {ActiveAssetData}
7
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-active-asset-data
8
+ */
9
+ export const ActiveAssetDataRequest = v.pipe(
10
+ v.object({
11
+ /** Type of request. */
12
+ type: v.pipe(
13
+ v.literal("activeAssetData"),
14
+ v.description("Type of request."),
15
+ ),
16
+ /** Asset symbol (e.g., BTC). */
17
+ coin: v.pipe(
18
+ v.string(),
19
+ v.description("Asset symbol (e.g., BTC)."),
20
+ ),
21
+ /** User address. */
22
+ user: v.pipe(
23
+ v.pipe(Hex, v.length(42)),
24
+ v.description("User address."),
25
+ ),
26
+ }),
27
+ v.description("Request user active asset data."),
28
+ );
29
+ export type ActiveAssetDataRequest = v.InferOutput<typeof ActiveAssetDataRequest>;
30
+
31
+ /**
32
+ * Request mid coin prices.
33
+ * @returns {AllMids}
34
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-mids-for-all-coins
35
+ */
36
+ export const AllMidsRequest = v.pipe(
37
+ v.object({
38
+ /** Type of request. */
39
+ type: v.pipe(
40
+ v.literal("allMids"),
41
+ v.description("Type of request."),
42
+ ),
43
+ /** DEX name (empty string for main dex). */
44
+ dex: v.pipe(
45
+ v.optional(v.string()),
46
+ v.description("DEX name (empty string for main dex)."),
47
+ ),
48
+ }),
49
+ v.description("Request mid coin prices."),
50
+ );
51
+ export type AllMidsRequest = v.InferOutput<typeof AllMidsRequest>;
52
+
53
+ /**
54
+ * Request candlestick snapshots.
55
+ * @returns {Candle[]}
56
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#candle-snapshot
57
+ */
58
+ export const CandleSnapshotRequest = v.pipe(
59
+ v.object({
60
+ /** Type of request. */
61
+ type: v.pipe(
62
+ v.literal("candleSnapshot"),
63
+ v.description("Type of request."),
64
+ ),
65
+ /** Request parameters. */
66
+ req: v.pipe(
67
+ v.object({
68
+ /** Asset symbol (e.g., BTC). */
69
+ coin: v.pipe(
70
+ v.string(),
71
+ v.description("Asset symbol (e.g., BTC)."),
72
+ ),
73
+ /** Time interval. */
74
+ interval: v.pipe(
75
+ v.union([
76
+ v.literal("1m"),
77
+ v.literal("3m"),
78
+ v.literal("5m"),
79
+ v.literal("15m"),
80
+ v.literal("30m"),
81
+ v.literal("1h"),
82
+ v.literal("2h"),
83
+ v.literal("4h"),
84
+ v.literal("8h"),
85
+ v.literal("12h"),
86
+ v.literal("1d"),
87
+ v.literal("3d"),
88
+ v.literal("1w"),
89
+ v.literal("1M"),
90
+ ]),
91
+ v.description("Time interval."),
92
+ ),
93
+ /** Start time (in ms since epoch). */
94
+ startTime: v.pipe(
95
+ UnsignedIntegerMayInputString,
96
+ v.description("Start time (in ms since epoch)."),
97
+ ),
98
+ /** End time (in ms since epoch). */
99
+ endTime: v.pipe(
100
+ v.nullish(UnsignedIntegerMayInputString),
101
+ v.description("End time (in ms since epoch)."),
102
+ ),
103
+ }),
104
+ v.description("Request parameters."),
105
+ ),
106
+ }),
107
+ v.description("Request candlestick snapshots."),
108
+ );
109
+ export type CandleSnapshotRequest = v.InferOutput<typeof CandleSnapshotRequest>;
110
+
111
+ /**
112
+ * Request clearinghouse state.
113
+ * @returns {PerpsClearinghouseState}
114
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
115
+ */
116
+ export const ClearinghouseStateRequest = v.pipe(
117
+ v.object({
118
+ /** Type of request. */
119
+ type: v.pipe(
120
+ v.literal("clearinghouseState"),
121
+ v.description("Type of request."),
122
+ ),
123
+ /** User address. */
124
+ user: v.pipe(
125
+ v.pipe(Hex, v.length(42)),
126
+ v.description("User address."),
127
+ ),
128
+ /** DEX name (empty string for main dex). */
129
+ dex: v.pipe(
130
+ v.optional(v.string()),
131
+ v.description("DEX name (empty string for main dex)."),
132
+ ),
133
+ }),
134
+ v.description("Request clearinghouse state."),
135
+ );
136
+ export type ClearinghouseStateRequest = v.InferOutput<typeof ClearinghouseStateRequest>;
137
+
138
+ /**
139
+ * Request user staking delegations.
140
+ * @returns {Delegation[]}
141
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-delegations
142
+ */
143
+ export const DelegationsRequest = v.pipe(
144
+ v.object({
145
+ /** Type of request. */
146
+ type: v.pipe(
147
+ v.literal("delegations"),
148
+ v.description("Type of request."),
149
+ ),
150
+ /** User address. */
151
+ user: v.pipe(
152
+ v.pipe(Hex, v.length(42)),
153
+ v.description("User address."),
154
+ ),
155
+ }),
156
+ v.description("Request user staking delegations."),
157
+ );
158
+ export type DelegationsRequest = v.InferOutput<typeof DelegationsRequest>;
159
+
160
+ /**
161
+ * Request user staking history.
162
+ * @returns {DelegatorUpdate[]}
163
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-history
164
+ */
165
+ export const DelegatorHistoryRequest = v.pipe(
166
+ v.object({
167
+ /** Type of request. */
168
+ type: v.pipe(
169
+ v.literal("delegatorHistory"),
170
+ v.description("Type of request."),
171
+ ),
172
+ /** User address. */
173
+ user: v.pipe(
174
+ v.pipe(Hex, v.length(42)),
175
+ v.description("User address."),
176
+ ),
177
+ }),
178
+ v.description("Request user staking history."),
179
+ );
180
+ export type DelegatorHistoryRequest = v.InferOutput<typeof DelegatorHistoryRequest>;
181
+
182
+ /**
183
+ * Request user staking rewards.
184
+ * @returns {DelegatorReward[]}
185
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-rewards
186
+ */
187
+ export const DelegatorRewardsRequest = v.pipe(
188
+ v.object({
189
+ /** Type of request. */
190
+ type: v.pipe(
191
+ v.literal("delegatorRewards"),
192
+ v.description("Type of request."),
193
+ ),
194
+ /** User address. */
195
+ user: v.pipe(
196
+ v.pipe(Hex, v.length(42)),
197
+ v.description("User address."),
198
+ ),
199
+ }),
200
+ v.description("Request user staking rewards."),
201
+ );
202
+ export type DelegatorRewardsRequest = v.InferOutput<typeof DelegatorRewardsRequest>;
203
+
204
+ /**
205
+ * Request user staking summary.
206
+ * @returns {DelegatorSummary}
207
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-summary
208
+ */
209
+ export const DelegatorSummaryRequest = v.pipe(
210
+ v.object({
211
+ /** Type of request. */
212
+ type: v.pipe(
213
+ v.literal("delegatorSummary"),
214
+ v.description("Type of request."),
215
+ ),
216
+ /** User address. */
217
+ user: v.pipe(
218
+ v.pipe(Hex, v.length(42)),
219
+ v.description("User address."),
220
+ ),
221
+ }),
222
+ v.description("Request user staking summary."),
223
+ );
224
+ export type DelegatorSummaryRequest = v.InferOutput<typeof DelegatorSummaryRequest>;
225
+
226
+ /**
227
+ * Request exchange status information.
228
+ * @returns {ExchangeStatus}
229
+ * @see null
230
+ */
231
+ export const ExchangeStatusRequest = v.pipe(
232
+ v.object({
233
+ /** Type of request. */
234
+ type: v.pipe(
235
+ v.literal("exchangeStatus"),
236
+ v.description("Type of request."),
237
+ ),
238
+ }),
239
+ v.description("Request exchange status information."),
240
+ );
241
+ export type ExchangeStatusRequest = v.InferOutput<typeof ExchangeStatusRequest>;
242
+
243
+ /**
244
+ * Request user extra agents.
245
+ * @returns {ExtraAgent[]}
246
+ * @see null
247
+ */
248
+ export const ExtraAgentsRequest = v.pipe(
249
+ v.object({
250
+ /** Type of request. */
251
+ type: v.pipe(
252
+ v.literal("extraAgents"),
253
+ v.description("Type of request."),
254
+ ),
255
+ /** User address. */
256
+ user: v.pipe(
257
+ v.pipe(Hex, v.length(42)),
258
+ v.description("User address."),
259
+ ),
260
+ }),
261
+ v.description("Request user extra agents."),
262
+ );
263
+ export type ExtraAgentsRequest = v.InferOutput<typeof ExtraAgentsRequest>;
264
+
265
+ /**
266
+ * Request frontend open orders.
267
+ * @returns {FrontendOrder[]}
268
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders-with-additional-frontend-info
269
+ */
270
+ export const FrontendOpenOrdersRequest = v.pipe(
271
+ v.object({
272
+ /** Type of request. */
273
+ type: v.pipe(
274
+ v.literal("frontendOpenOrders"),
275
+ v.description("Type of request."),
276
+ ),
277
+ /** User address. */
278
+ user: v.pipe(
279
+ v.pipe(Hex, v.length(42)),
280
+ v.description("User address."),
281
+ ),
282
+ /** DEX name (empty string for main dex). */
283
+ dex: v.pipe(
284
+ v.optional(v.string()),
285
+ v.description("DEX name (empty string for main dex)."),
286
+ ),
287
+ }),
288
+ v.description("Request frontend open orders."),
289
+ );
290
+ export type FrontendOpenOrdersRequest = v.InferOutput<typeof FrontendOpenOrdersRequest>;
291
+
292
+ /**
293
+ * Request funding history.
294
+ * @returns {FundingHistory[]}
295
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-historical-funding-rates
296
+ */
297
+ export const FundingHistoryRequest = v.pipe(
298
+ v.object({
299
+ /** Type of request. */
300
+ type: v.pipe(
301
+ v.literal("fundingHistory"),
302
+ v.description("Type of request."),
303
+ ),
304
+ /** Asset symbol (e.g., BTC). */
305
+ coin: v.pipe(
306
+ v.string(),
307
+ v.description("Asset symbol (e.g., BTC)."),
308
+ ),
309
+ /** Start time (in ms since epoch). */
310
+ startTime: v.pipe(
311
+ UnsignedIntegerMayInputString,
312
+ v.description("Start time (in ms since epoch)."),
313
+ ),
314
+ /** End time (in ms since epoch). */
315
+ endTime: v.pipe(
316
+ v.nullish(UnsignedIntegerMayInputString),
317
+ v.description("End time (in ms since epoch)."),
318
+ ),
319
+ }),
320
+ v.description("Request funding history."),
321
+ );
322
+ export type FundingHistoryRequest = v.InferOutput<typeof FundingHistoryRequest>;
323
+
324
+ /**
325
+ * Request user historical orders.
326
+ * @returns {FrontendOrderStatus[]}
327
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-historical-orders
328
+ */
329
+ export const HistoricalOrdersRequest = v.pipe(
330
+ v.object({
331
+ /** Type of request. */
332
+ type: v.pipe(
333
+ v.literal("historicalOrders"),
334
+ v.description("Type of request."),
335
+ ),
336
+ /** User address. */
337
+ user: v.pipe(
338
+ v.pipe(Hex, v.length(42)),
339
+ v.description("User address."),
340
+ ),
341
+ }),
342
+ v.description("Request user historical orders."),
343
+ );
344
+ export type HistoricalOrdersRequest = v.InferOutput<typeof HistoricalOrdersRequest>;
345
+
346
+ /**
347
+ * Request to check if a user is a VIP.
348
+ * @returns {boolean | null}
349
+ * @see null
350
+ */
351
+ export const IsVipRequest = v.pipe(
352
+ v.object({
353
+ /** Type of request. */
354
+ type: v.pipe(
355
+ v.literal("isVip"),
356
+ v.description("Type of request."),
357
+ ),
358
+ /** User address. */
359
+ user: v.pipe(
360
+ v.pipe(Hex, v.length(42)),
361
+ v.description("User address."),
362
+ ),
363
+ }),
364
+ v.description("Request to check if a user is a VIP."),
365
+ );
366
+ export type IsVipRequest = v.InferOutput<typeof IsVipRequest>;
367
+
368
+ /**
369
+ * Request L2 order book.
370
+ * @returns {Book}
371
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#l2-book-snapshot
372
+ */
373
+ export const L2BookRequest = v.pipe(
374
+ v.object({
375
+ /** Type of request. */
376
+ type: v.pipe(
377
+ v.literal("l2Book"),
378
+ v.description("Type of request."),
379
+ ),
380
+ /** Asset symbol (e.g., BTC). */
381
+ coin: v.pipe(
382
+ v.string(),
383
+ v.description("Asset symbol (e.g., BTC)."),
384
+ ),
385
+ /** Number of significant figures. */
386
+ nSigFigs: v.pipe(
387
+ v.nullish(
388
+ v.pipe(
389
+ UnsignedIntegerMayInputString,
390
+ v.union([v.literal(2), v.literal(3), v.literal(4), v.literal(5)]),
391
+ ),
392
+ ),
393
+ v.description("Number of significant figures."),
394
+ ),
395
+ /** Mantissa for aggregation (if `nSigFigs` is 5). */
396
+ mantissa: v.pipe(
397
+ v.nullish(
398
+ v.pipe(
399
+ UnsignedIntegerMayInputString,
400
+ v.union([v.literal(2), v.literal(5)]),
401
+ ),
402
+ ),
403
+ v.description("Mantissa for aggregation (if `nSigFigs` is 5)."),
404
+ ),
405
+ }),
406
+ v.description("Request L2 order book."),
407
+ );
408
+ export type L2BookRequest = v.InferOutput<typeof L2BookRequest>;
409
+
410
+ /**
411
+ * Request leading vaults for a user.
412
+ * @returns {VaultLeading[]}
413
+ * @see null
414
+ */
415
+ export const LeadingVaultsRequest = v.pipe(
416
+ v.object({
417
+ /** Type of request. */
418
+ type: v.pipe(
419
+ v.literal("leadingVaults"),
420
+ v.description("Type of request."),
421
+ ),
422
+ /** User address. */
423
+ user: v.pipe(
424
+ v.pipe(Hex, v.length(42)),
425
+ v.description("User address."),
426
+ ),
427
+ }),
428
+ v.description("Request leading vaults for a user."),
429
+ );
430
+ export type LeadingVaultsRequest = v.InferOutput<typeof LeadingVaultsRequest>;
431
+
432
+ /**
433
+ * Request legal verification status of a user.
434
+ * @returns {LegalCheck}
435
+ * @see null
436
+ */
437
+ export const LegalCheckRequest = v.pipe(
438
+ v.object({
439
+ /** Type of request. */
440
+ type: v.pipe(
441
+ v.literal("legalCheck"),
442
+ v.description("Type of request."),
443
+ ),
444
+ /** User address. */
445
+ user: v.pipe(
446
+ v.pipe(Hex, v.length(42)),
447
+ v.description("User address."),
448
+ ),
449
+ }),
450
+ v.description("Request legal verification status of a user."),
451
+ );
452
+ export type LegalCheckRequest = v.InferOutput<typeof LegalCheckRequest>;
453
+
454
+ /**
455
+ * Request liquidatable.
456
+ * @returns {unknown[]} FIXME: Define the return type
457
+ * @see null
458
+ */
459
+ export const LiquidatableRequest = v.pipe(
460
+ v.object({
461
+ /** Type of request. */
462
+ type: v.pipe(
463
+ v.literal("liquidatable"),
464
+ v.description("Type of request."),
465
+ ),
466
+ }),
467
+ v.description("Request liquidatable."),
468
+ );
469
+ export type LiquidatableRequest = v.InferOutput<typeof LiquidatableRequest>;
470
+
471
+ /**
472
+ * Request margin table data.
473
+ * @returns {MarginTable}
474
+ * @see null
475
+ */
476
+ export const MarginTableRequest = v.pipe(
477
+ v.object({
478
+ /** Type of request. */
479
+ type: v.pipe(
480
+ v.literal("marginTable"),
481
+ v.description("Type of request."),
482
+ ),
483
+ /** Margin requirements table. */
484
+ id: v.pipe(
485
+ UnsignedIntegerMayInputString,
486
+ v.description("Margin requirements table."),
487
+ ),
488
+ }),
489
+ v.description("Request margin table data."),
490
+ );
491
+ export type MarginTableRequest = v.InferOutput<typeof MarginTableRequest>;
492
+
493
+ /**
494
+ * Request builder fee approval.
495
+ * @returns {number}
496
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#check-builder-fee-approval
497
+ */
498
+ export const MaxBuilderFeeRequest = v.pipe(
499
+ v.object({
500
+ /** Type of request. */
501
+ type: v.pipe(
502
+ v.literal("maxBuilderFee"),
503
+ v.description("Type of request."),
504
+ ),
505
+ /** User address. */
506
+ user: v.pipe(
507
+ v.pipe(Hex, v.length(42)),
508
+ v.description("User address."),
509
+ ),
510
+ /** Builder address. */
511
+ builder: v.pipe(
512
+ v.pipe(Hex, v.length(42)),
513
+ v.description("Builder address."),
514
+ ),
515
+ }),
516
+ v.description("Request builder fee approval."),
517
+ );
518
+ export type MaxBuilderFeeRequest = v.InferOutput<typeof MaxBuilderFeeRequest>;
519
+
520
+ /**
521
+ * Request maximum market order notionals.
522
+ * @returns {[number, string][]}
523
+ * @see null
524
+ */
525
+ export const MaxMarketOrderNtlsRequest = v.pipe(
526
+ v.object({
527
+ /** Type of request. */
528
+ type: v.pipe(
529
+ v.literal("maxMarketOrderNtls"),
530
+ v.description("Type of request."),
531
+ ),
532
+ }),
533
+ v.description("Request maximum market order notionals."),
534
+ );
535
+ export type MaxMarketOrderNtlsRequest = v.InferOutput<typeof MaxMarketOrderNtlsRequest>;
536
+
537
+ /**
538
+ * Request trading metadata.
539
+ * @returns {PerpsMeta}
540
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-metadata-universe-and-margin-tables
541
+ */
542
+ export const MetaRequest = v.pipe(
543
+ v.object({
544
+ /** Type of request. */
545
+ type: v.pipe(
546
+ v.literal("meta"),
547
+ v.description("Type of request."),
548
+ ),
549
+ /** DEX name (empty string for main dex). */
550
+ dex: v.pipe(
551
+ v.optional(v.string()),
552
+ v.description("DEX name (empty string for main dex)."),
553
+ ),
554
+ }),
555
+ v.description("Request trading metadata."),
556
+ );
557
+ export type MetaRequest = v.InferOutput<typeof MetaRequest>;
558
+
559
+ /**
560
+ * Request metadata and asset contexts.
561
+ * @returns {PerpsMetaAndAssetCtxs}
562
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
563
+ */
564
+ export const MetaAndAssetCtxsRequest = v.pipe(
565
+ v.object({
566
+ /** Type of request. */
567
+ type: v.pipe(
568
+ v.literal("metaAndAssetCtxs"),
569
+ v.description("Type of request."),
570
+ ),
571
+ /** DEX name (empty string for main dex). */
572
+ dex: v.pipe(
573
+ v.optional(v.string()),
574
+ v.description("DEX name (empty string for main dex)."),
575
+ ),
576
+ }),
577
+ v.description("Request metadata and asset contexts."),
578
+ );
579
+ export type MetaAndAssetCtxsRequest = v.InferOutput<typeof MetaAndAssetCtxsRequest>;
580
+
581
+ /**
582
+ * Request open orders.
583
+ * @returns {Order[]}
584
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders
585
+ */
586
+ export const OpenOrdersRequest = v.pipe(
587
+ v.object({
588
+ /** Type of request. */
589
+ type: v.pipe(
590
+ v.literal("openOrders"),
591
+ v.description("Type of request."),
592
+ ),
593
+ /** User address. */
594
+ user: v.pipe(
595
+ v.pipe(Hex, v.length(42)),
596
+ v.description("User address."),
597
+ ),
598
+ /** DEX name (empty string for main dex). */
599
+ dex: v.pipe(
600
+ v.optional(v.string()),
601
+ v.description("DEX name (empty string for main dex)."),
602
+ ),
603
+ }),
604
+ v.description("Request open orders."),
605
+ );
606
+ export type OpenOrdersRequest = v.InferOutput<typeof OpenOrdersRequest>;
607
+
608
+ /**
609
+ * Request order status.
610
+ * @returns {OrderLookup}
611
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-order-status-by-oid-or-cloid
612
+ */
613
+ export const OrderStatusRequest = v.pipe(
614
+ v.object({
615
+ /** Type of request. */
616
+ type: v.pipe(
617
+ v.literal("orderStatus"),
618
+ v.description("Type of request."),
619
+ ),
620
+ /** User address. */
621
+ user: v.pipe(
622
+ v.pipe(Hex, v.length(42)),
623
+ v.description("User address."),
624
+ ),
625
+ /** Order ID or Client Order ID. */
626
+ oid: v.pipe(
627
+ v.union([UnsignedIntegerMayInputString, v.pipe(Hex, v.length(34))]),
628
+ v.description("Order ID or Client Order ID."),
629
+ ),
630
+ }),
631
+ v.description("Request order status."),
632
+ );
633
+ export type OrderStatusRequest = v.InferOutput<typeof OrderStatusRequest>;
634
+
635
+ /**
636
+ * Request for the status of the perpetual deploy auction.
637
+ * @returns {DeployAuctionStatus}
638
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-information-about-the-perp-deploy-auction
639
+ */
640
+ export const PerpDeployAuctionStatusRequest = v.pipe(
641
+ v.object({
642
+ /** Type of request. */
643
+ type: v.pipe(
644
+ v.literal("perpDeployAuctionStatus"),
645
+ v.description("Type of request."),
646
+ ),
647
+ }),
648
+ v.description("Request for the status of the perpetual deploy auction."),
649
+ );
650
+ export type PerpDeployAuctionStatusRequest = v.InferOutput<typeof PerpDeployAuctionStatusRequest>;
651
+
652
+ /**
653
+ * Request all perpetual dexs.
654
+ * @returns {PerpDexs}
655
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-all-perpetual-dexs
656
+ */
657
+ export const PerpDexsRequest = v.pipe(
658
+ v.object({
659
+ /** Type of request. */
660
+ type: v.pipe(
661
+ v.literal("perpDexs"),
662
+ v.description("Type of request."),
663
+ ),
664
+ }),
665
+ v.description("Request all perpetual dexs."),
666
+ );
667
+ export type PerpDexsRequest = v.InferOutput<typeof PerpDexsRequest>;
668
+
669
+ /**
670
+ * Request perpetuals at open interest cap.
671
+ * @returns {string[]}
672
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#query-perps-at-open-interest-caps
673
+ */
674
+ export const PerpsAtOpenInterestCapRequest = v.pipe(
675
+ v.object({
676
+ /** Type of request. */
677
+ type: v.pipe(
678
+ v.literal("perpsAtOpenInterestCap"),
679
+ v.description("Type of request."),
680
+ ),
681
+ /** DEX name (empty string for main dex). */
682
+ dex: v.pipe(
683
+ v.optional(v.string()),
684
+ v.description("DEX name (empty string for main dex)."),
685
+ ),
686
+ }),
687
+ v.description("Request perpetuals at open interest cap."),
688
+ );
689
+ export type PerpsAtOpenInterestCapRequest = v.InferOutput<typeof PerpsAtOpenInterestCapRequest>;
690
+
691
+ /**
692
+ * Request user portfolio.
693
+ * @returns {PortfolioPeriods}
694
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-portfolio
695
+ */
696
+ export const PortfolioRequest = v.pipe(
697
+ v.object({
698
+ /** Type of request. */
699
+ type: v.pipe(
700
+ v.literal("portfolio"),
701
+ v.description("Type of request."),
702
+ ),
703
+ /** User address. */
704
+ user: v.pipe(
705
+ v.pipe(Hex, v.length(42)),
706
+ v.description("User address."),
707
+ ),
708
+ }),
709
+ v.description("Request user portfolio."),
710
+ );
711
+ export type PortfolioRequest = v.InferOutput<typeof PortfolioRequest>;
712
+
713
+ /**
714
+ * Request predicted funding rates.
715
+ * @returns {PredictedFunding[]}
716
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-predicted-funding-rates-for-different-venues
717
+ */
718
+ export const PredictedFundingsRequest = v.pipe(
719
+ v.object({
720
+ /** Type of request. */
721
+ type: v.pipe(
722
+ v.literal("predictedFundings"),
723
+ v.description("Type of request."),
724
+ ),
725
+ }),
726
+ v.description("Request predicted funding rates."),
727
+ );
728
+ export type PredictedFundingsRequest = v.InferOutput<typeof PredictedFundingsRequest>;
729
+
730
+ /**
731
+ * Request user existence check before transfer.
732
+ * @returns {PreTransferCheck}
733
+ * @see null
734
+ */
735
+ export const PreTransferCheckRequest = v.pipe(
736
+ v.object({
737
+ /** Type of request. */
738
+ type: v.pipe(
739
+ v.literal("preTransferCheck"),
740
+ v.description("Type of request."),
741
+ ),
742
+ /** User address. */
743
+ user: v.pipe(
744
+ v.pipe(Hex, v.length(42)),
745
+ v.description("User address."),
746
+ ),
747
+ /** Source address. */
748
+ source: v.pipe(
749
+ v.pipe(Hex, v.length(42)),
750
+ v.description("Source address."),
751
+ ),
752
+ }),
753
+ v.description("Request user existence check before transfer."),
754
+ );
755
+ export type PreTransferCheckRequest = v.InferOutput<typeof PreTransferCheckRequest>;
756
+
757
+ /**
758
+ * Request user referral.
759
+ * @returns {Referral}
760
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-referral-information
761
+ */
762
+ export const ReferralRequest = v.pipe(
763
+ v.object({
764
+ /** Type of request. */
765
+ type: v.pipe(
766
+ v.literal("referral"),
767
+ v.description("Type of request."),
768
+ ),
769
+ /** User address. */
770
+ user: v.pipe(
771
+ v.pipe(Hex, v.length(42)),
772
+ v.description("User address."),
773
+ ),
774
+ }),
775
+ v.description("Request user referral."),
776
+ );
777
+ export type ReferralRequest = v.InferOutput<typeof ReferralRequest>;
778
+
779
+ /**
780
+ * Request spot clearinghouse state.
781
+ * @returns {SpotClearinghouseState}
782
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-a-users-token-balances
783
+ */
784
+ export const SpotClearinghouseStateRequest = v.pipe(
785
+ v.object({
786
+ /** Type of request. */
787
+ type: v.pipe(
788
+ v.literal("spotClearinghouseState"),
789
+ v.description("Type of request."),
790
+ ),
791
+ /** User address. */
792
+ user: v.pipe(
793
+ v.pipe(Hex, v.length(42)),
794
+ v.description("User address."),
795
+ ),
796
+ /** DEX name (empty string for main dex). */
797
+ dex: v.pipe(
798
+ v.optional(v.string()),
799
+ v.description("DEX name (empty string for main dex)."),
800
+ ),
801
+ }),
802
+ v.description("Request spot clearinghouse state."),
803
+ );
804
+ export type SpotClearinghouseStateRequest = v.InferOutput<typeof SpotClearinghouseStateRequest>;
805
+
806
+ /**
807
+ * Request spot deploy state.
808
+ * @returns {SpotDeployState}
809
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-information-about-the-spot-deploy-auction
810
+ */
811
+ export const SpotDeployStateRequest = v.pipe(
812
+ v.object({
813
+ /** Type of request. */
814
+ type: v.pipe(
815
+ v.literal("spotDeployState"),
816
+ v.description("Type of request."),
817
+ ),
818
+ /** User address. */
819
+ user: v.pipe(
820
+ v.pipe(Hex, v.length(42)),
821
+ v.description("User address."),
822
+ ),
823
+ }),
824
+ v.description("Request spot deploy state."),
825
+ );
826
+ export type SpotDeployStateRequest = v.InferOutput<typeof SpotDeployStateRequest>;
827
+
828
+ /**
829
+ * Request spot trading metadata.
830
+ * @returns {SpotMeta}
831
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-metadata
832
+ */
833
+ export const SpotMetaRequest = v.pipe(
834
+ v.object({
835
+ /** Type of request. */
836
+ type: v.pipe(
837
+ v.literal("spotMeta"),
838
+ v.description("Type of request."),
839
+ ),
840
+ }),
841
+ v.description("Request spot trading metadata."),
842
+ );
843
+ export type SpotMetaRequest = v.InferOutput<typeof SpotMetaRequest>;
844
+
845
+ /**
846
+ * Request spot metadata and asset contexts.
847
+ * @returns {SpotMetaAndAssetCtxs}
848
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
849
+ */
850
+ export const SpotMetaAndAssetCtxsRequest = v.pipe(
851
+ v.object({
852
+ /** Type of request. */
853
+ type: v.pipe(
854
+ v.literal("spotMetaAndAssetCtxs"),
855
+ v.description("Type of request."),
856
+ ),
857
+ }),
858
+ v.description("Request spot metadata and asset contexts."),
859
+ );
860
+ export type SpotMetaAndAssetCtxsRequest = v.InferOutput<typeof SpotMetaAndAssetCtxsRequest>;
861
+
862
+ /**
863
+ * Request for the status of the spot deploy auction.
864
+ * @returns {DeployAuctionStatus}
865
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-information-about-the-spot-pair-deploy-auction
866
+ */
867
+ export const SpotPairDeployAuctionStatusRequest = v.pipe(
868
+ v.object({
869
+ /** Type of request. */
870
+ type: v.pipe(
871
+ v.literal("spotPairDeployAuctionStatus"),
872
+ v.description("Type of request."),
873
+ ),
874
+ }),
875
+ v.description("Request for the status of the spot deploy auction."),
876
+ );
877
+ export type SpotPairDeployAuctionStatusRequest = v.InferOutput<typeof SpotPairDeployAuctionStatusRequest>;
878
+
879
+ /**
880
+ * Request user sub-accounts.
881
+ * @returns {SubAccount[] | null}
882
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-subaccounts
883
+ */
884
+ export const SubAccountsRequest = v.pipe(
885
+ v.object({
886
+ /** Type of request. */
887
+ type: v.pipe(
888
+ v.literal("subAccounts"),
889
+ v.description("Type of request."),
890
+ ),
891
+ /** User address. */
892
+ user: v.pipe(
893
+ v.pipe(Hex, v.length(42)),
894
+ v.description("User address."),
895
+ ),
896
+ }),
897
+ v.description("Request user sub-accounts."),
898
+ );
899
+ export type SubAccountsRequest = v.InferOutput<typeof SubAccountsRequest>;
900
+
901
+ /**
902
+ * Request token details.
903
+ * @returns {TokenDetails}
904
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-information-about-a-token
905
+ */
906
+ export const TokenDetailsRequest = v.pipe(
907
+ v.object({
908
+ /** Type of request. */
909
+ type: v.pipe(
910
+ v.literal("tokenDetails"),
911
+ v.description("Type of request."),
912
+ ),
913
+ /** Token ID. */
914
+ tokenId: v.pipe(
915
+ v.pipe(Hex, v.length(34)),
916
+ v.description("Token ID."),
917
+ ),
918
+ }),
919
+ v.description("Request token details."),
920
+ );
921
+ export type TokenDetailsRequest = v.InferOutput<typeof TokenDetailsRequest>;
922
+
923
+ /**
924
+ * Request twap history of a user.
925
+ * @returns {TwapHistory[]}
926
+ * @see null
927
+ */
928
+ export const TwapHistoryRequest = v.pipe(
929
+ v.object({
930
+ /** Type of request. */
931
+ type: v.pipe(
932
+ v.literal("twapHistory"),
933
+ v.description("Type of request."),
934
+ ),
935
+ /** User address. */
936
+ user: v.pipe(
937
+ v.pipe(Hex, v.length(42)),
938
+ v.description("User address."),
939
+ ),
940
+ }),
941
+ v.description("Request twap history of a user."),
942
+ );
943
+ export type TwapHistoryRequest = v.InferOutput<typeof TwapHistoryRequest>;
944
+
945
+ /**
946
+ * Request user fees.
947
+ * @returns {UserFees}
948
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-fees
949
+ */
950
+ export const UserFeesRequest = v.pipe(
951
+ v.object({
952
+ /** Type of request. */
953
+ type: v.pipe(
954
+ v.literal("userFees"),
955
+ v.description("Type of request."),
956
+ ),
957
+ /** User address. */
958
+ user: v.pipe(
959
+ v.pipe(Hex, v.length(42)),
960
+ v.description("User address."),
961
+ ),
962
+ }),
963
+ v.description("Request user fees."),
964
+ );
965
+ export type UserFeesRequest = v.InferOutput<typeof UserFeesRequest>;
966
+
967
+ /**
968
+ * Request user fills.
969
+ * @returns {Fill[]}
970
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills
971
+ */
972
+ export const UserFillsRequest = v.pipe(
973
+ v.object({
974
+ /** Type of request. */
975
+ type: v.pipe(
976
+ v.literal("userFills"),
977
+ v.description("Type of request."),
978
+ ),
979
+ /** User address. */
980
+ user: v.pipe(
981
+ v.pipe(Hex, v.length(42)),
982
+ v.description("User address."),
983
+ ),
984
+ /** If true, partial fills are aggregated when a crossing order fills multiple resting orders. */
985
+ aggregateByTime: v.pipe(
986
+ v.optional(v.boolean()),
987
+ v.description("If true, partial fills are aggregated when a crossing order fills multiple resting orders."),
988
+ ),
989
+ }),
990
+ v.description("Request user fills."),
991
+ );
992
+ export type UserFillsRequest = v.InferOutput<typeof UserFillsRequest>;
993
+
994
+ /**
995
+ * Request user fills by time.
996
+ * @returns {Fill[]}
997
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time
998
+ */
999
+ export const UserFillsByTimeRequest = v.pipe(
1000
+ v.object({
1001
+ /** Type of request. */
1002
+ type: v.pipe(
1003
+ v.literal("userFillsByTime"),
1004
+ v.description("Type of request."),
1005
+ ),
1006
+ /** User address. */
1007
+ user: v.pipe(
1008
+ v.pipe(Hex, v.length(42)),
1009
+ v.description("User address."),
1010
+ ),
1011
+ /** Start time (in ms since epoch). */
1012
+ startTime: v.pipe(
1013
+ UnsignedIntegerMayInputString,
1014
+ v.description("Start time (in ms since epoch)."),
1015
+ ),
1016
+ /** End time (in ms since epoch). */
1017
+ endTime: v.pipe(
1018
+ v.nullish(UnsignedIntegerMayInputString),
1019
+ v.description("End time (in ms since epoch)."),
1020
+ ),
1021
+ /** If true, partial fills are aggregated when a crossing order fills multiple resting orders. */
1022
+ aggregateByTime: v.pipe(
1023
+ v.optional(v.boolean()),
1024
+ v.description("If true, partial fills are aggregated when a crossing order fills multiple resting orders."),
1025
+ ),
1026
+ }),
1027
+ v.description("Request user fills by time."),
1028
+ );
1029
+ export type UserFillsByTimeRequest = v.InferOutput<typeof UserFillsByTimeRequest>;
1030
+
1031
+ /**
1032
+ * Request user funding.
1033
+ * @returns {UserFundingUpdate[]}
1034
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-a-users-funding-history-or-non-funding-ledger-updates
1035
+ */
1036
+ export const UserFundingRequest = v.pipe(
1037
+ v.object({
1038
+ /** Type of request. */
1039
+ type: v.pipe(
1040
+ v.literal("userFunding"),
1041
+ v.description("Type of request."),
1042
+ ),
1043
+ /** User address. */
1044
+ user: v.pipe(
1045
+ v.pipe(Hex, v.length(42)),
1046
+ v.description("User address."),
1047
+ ),
1048
+ /** Start time (in ms since epoch). */
1049
+ startTime: v.pipe(
1050
+ UnsignedIntegerMayInputString,
1051
+ v.description("Start time (in ms since epoch)."),
1052
+ ),
1053
+ /** End time (in ms since epoch). */
1054
+ endTime: v.pipe(
1055
+ v.nullish(UnsignedIntegerMayInputString),
1056
+ v.description("End time (in ms since epoch)."),
1057
+ ),
1058
+ }),
1059
+ v.description("Request user funding."),
1060
+ );
1061
+ export type UserFundingRequest = v.InferOutput<typeof UserFundingRequest>;
1062
+
1063
+ /**
1064
+ * Request user non-funding ledger updates.
1065
+ * @returns {UserNonFundingLedgerUpdate[]}
1066
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-a-users-funding-history-or-non-funding-ledger-updates
1067
+ */
1068
+ export const UserNonFundingLedgerUpdatesRequest = v.pipe(
1069
+ v.object({
1070
+ /** Type of request. */
1071
+ type: v.pipe(
1072
+ v.literal("userNonFundingLedgerUpdates"),
1073
+ v.description("Type of request."),
1074
+ ),
1075
+ /** User address. */
1076
+ user: v.pipe(
1077
+ v.pipe(Hex, v.length(42)),
1078
+ v.description("User address."),
1079
+ ),
1080
+ /** Start time (in ms since epoch). */
1081
+ startTime: v.pipe(
1082
+ UnsignedIntegerMayInputString,
1083
+ v.description("Start time (in ms since epoch)."),
1084
+ ),
1085
+ /** End time (in ms since epoch). */
1086
+ endTime: v.pipe(
1087
+ v.nullish(UnsignedIntegerMayInputString),
1088
+ v.description("End time (in ms since epoch)."),
1089
+ ),
1090
+ }),
1091
+ v.description("Request user non-funding ledger updates."),
1092
+ );
1093
+ export type UserNonFundingLedgerUpdatesRequest = v.InferOutput<typeof UserNonFundingLedgerUpdatesRequest>;
1094
+
1095
+ /**
1096
+ * Request user rate limits.
1097
+ * @returns {UserRateLimit}
1098
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-user-rate-limits
1099
+ */
1100
+ export const UserRateLimitRequest = v.pipe(
1101
+ v.object({
1102
+ /** Type of request. */
1103
+ type: v.pipe(
1104
+ v.literal("userRateLimit"),
1105
+ v.description("Type of request."),
1106
+ ),
1107
+ /** User address. */
1108
+ user: v.pipe(
1109
+ v.pipe(Hex, v.length(42)),
1110
+ v.description("User address."),
1111
+ ),
1112
+ }),
1113
+ v.description("Request user rate limits."),
1114
+ );
1115
+ export type UserRateLimitRequest = v.InferOutput<typeof UserRateLimitRequest>;
1116
+
1117
+ /**
1118
+ * Request user role.
1119
+ * @returns {UserRole}
1120
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-role
1121
+ */
1122
+ export const UserRoleRequest = v.pipe(
1123
+ v.object({
1124
+ /** Type of request. */
1125
+ type: v.pipe(
1126
+ v.literal("userRole"),
1127
+ v.description("Type of request."),
1128
+ ),
1129
+ /** User address. */
1130
+ user: v.pipe(
1131
+ v.pipe(Hex, v.length(42)),
1132
+ v.description("User address."),
1133
+ ),
1134
+ }),
1135
+ v.description("Request user role."),
1136
+ );
1137
+ export type UserRoleRequest = v.InferOutput<typeof UserRoleRequest>;
1138
+
1139
+ /**
1140
+ * Request multi-sig signers for a user.
1141
+ * @returns {MultiSigSigners | null}
1142
+ * @see null
1143
+ */
1144
+ export const UserToMultiSigSignersRequest = v.pipe(
1145
+ v.object({
1146
+ /** Type of request. */
1147
+ type: v.pipe(
1148
+ v.literal("userToMultiSigSigners"),
1149
+ v.description("Type of request."),
1150
+ ),
1151
+ /** User address. */
1152
+ user: v.pipe(
1153
+ v.pipe(Hex, v.length(42)),
1154
+ v.description("User address."),
1155
+ ),
1156
+ }),
1157
+ v.description("Request multi-sig signers for a user."),
1158
+ );
1159
+ export type UserToMultiSigSignersRequest = v.InferOutput<typeof UserToMultiSigSignersRequest>;
1160
+
1161
+ /**
1162
+ * Request user TWAP slice fills.
1163
+ * @returns {TwapSliceFill[]}
1164
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-twap-slice-fills
1165
+ */
1166
+ export const UserTwapSliceFillsRequest = v.pipe(
1167
+ v.object({
1168
+ /** Type of request. */
1169
+ type: v.pipe(
1170
+ v.literal("userTwapSliceFills"),
1171
+ v.description("Type of request."),
1172
+ ),
1173
+ /** User address. */
1174
+ user: v.pipe(
1175
+ v.pipe(Hex, v.length(42)),
1176
+ v.description("User address."),
1177
+ ),
1178
+ }),
1179
+ v.description("Request user TWAP slice fills."),
1180
+ );
1181
+ export type UserTwapSliceFillsRequest = v.InferOutput<typeof UserTwapSliceFillsRequest>;
1182
+
1183
+ /**
1184
+ * Request user TWAP slice fills by time.
1185
+ * @returns {TwapSliceFill[]}
1186
+ * @see null
1187
+ */
1188
+ export const UserTwapSliceFillsByTimeRequest = v.pipe(
1189
+ v.object({
1190
+ /** Type of request. */
1191
+ type: v.pipe(
1192
+ v.literal("userTwapSliceFillsByTime"),
1193
+ v.description("Type of request."),
1194
+ ),
1195
+ /** User address. */
1196
+ user: v.pipe(
1197
+ v.pipe(Hex, v.length(42)),
1198
+ v.description("User address."),
1199
+ ),
1200
+ /** Start time (in ms since epoch). */
1201
+ startTime: v.pipe(
1202
+ UnsignedIntegerMayInputString,
1203
+ v.description("Start time (in ms since epoch)."),
1204
+ ),
1205
+ /** End time (in ms since epoch). */
1206
+ endTime: v.pipe(
1207
+ v.nullish(UnsignedIntegerMayInputString),
1208
+ v.description("End time (in ms since epoch)."),
1209
+ ),
1210
+ /** If true, partial fills are aggregated when a crossing order fills multiple resting orders. */
1211
+ aggregateByTime: v.pipe(
1212
+ v.optional(v.boolean()),
1213
+ v.description("If true, partial fills are aggregated when a crossing order fills multiple resting orders."),
1214
+ ),
1215
+ }),
1216
+ v.description("Request user TWAP slice fills by time."),
1217
+ );
1218
+ export type UserTwapSliceFillsByTimeRequest = v.InferOutput<typeof UserTwapSliceFillsByTimeRequest>;
1219
+
1220
+ /**
1221
+ * Request user vault deposits.
1222
+ * @returns {VaultEquity[]}
1223
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-vault-deposits
1224
+ */
1225
+ export const UserVaultEquitiesRequest = v.pipe(
1226
+ v.object({
1227
+ /** Type of request. */
1228
+ type: v.pipe(
1229
+ v.literal("userVaultEquities"),
1230
+ v.description("Type of request."),
1231
+ ),
1232
+ /** User address. */
1233
+ user: v.pipe(
1234
+ v.pipe(Hex, v.length(42)),
1235
+ v.description("User address."),
1236
+ ),
1237
+ }),
1238
+ v.description("Request user vault deposits."),
1239
+ );
1240
+ export type UserVaultEquitiesRequest = v.InferOutput<typeof UserVaultEquitiesRequest>;
1241
+
1242
+ /**
1243
+ * Request validator L1 votes.
1244
+ * @returns {unknown[]} FIXME: Define the return type
1245
+ * @see null
1246
+ */
1247
+ export const ValidatorL1VotesRequest = v.pipe(
1248
+ v.object({
1249
+ /** Type of request. */
1250
+ type: v.pipe(
1251
+ v.literal("validatorL1Votes"),
1252
+ v.description("Type of request."),
1253
+ ),
1254
+ }),
1255
+ v.description("Request validator L1 votes."),
1256
+ );
1257
+ export type ValidatorL1VotesRequest = v.InferOutput<typeof ValidatorL1VotesRequest>;
1258
+
1259
+ /**
1260
+ * Request validator summaries.
1261
+ * @returns {ValidatorSummary[]}
1262
+ * @see null
1263
+ */
1264
+ export const ValidatorSummariesRequest = v.pipe(
1265
+ v.object({
1266
+ /** Type of request. */
1267
+ type: v.pipe(
1268
+ v.literal("validatorSummaries"),
1269
+ v.description("Type of request."),
1270
+ ),
1271
+ }),
1272
+ v.description("Request validator summaries."),
1273
+ );
1274
+ export type ValidatorSummariesRequest = v.InferOutput<typeof ValidatorSummariesRequest>;
1275
+
1276
+ /**
1277
+ * Request details of a vault.
1278
+ * @returns {VaultDetails | null}
1279
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-details-for-a-vault
1280
+ */
1281
+ export const VaultDetailsRequest = v.pipe(
1282
+ v.object({
1283
+ /** Type of request. */
1284
+ type: v.pipe(
1285
+ v.literal("vaultDetails"),
1286
+ v.description("Type of request."),
1287
+ ),
1288
+ /** Vault address. */
1289
+ vaultAddress: v.pipe(
1290
+ v.pipe(Hex, v.length(42)),
1291
+ v.description("Vault address."),
1292
+ ),
1293
+ /** User address. */
1294
+ user: v.pipe(
1295
+ v.nullish(v.pipe(Hex, v.length(42))),
1296
+ v.description("User address."),
1297
+ ),
1298
+ }),
1299
+ v.description("Request details of a vault."),
1300
+ );
1301
+ export type VaultDetailsRequest = v.InferOutput<typeof VaultDetailsRequest>;
1302
+
1303
+ /**
1304
+ * Request a list of vaults less than 2 hours old.
1305
+ * @returns {VaultSummary[]}
1306
+ * @see null
1307
+ */
1308
+ export const VaultSummariesRequest = v.pipe(
1309
+ v.object({
1310
+ /** Type of request. */
1311
+ type: v.pipe(
1312
+ v.literal("vaultSummaries"),
1313
+ v.description("Type of request."),
1314
+ ),
1315
+ }),
1316
+ v.description("Request a list of vaults less than 2 hours old."),
1317
+ );
1318
+ export type VaultSummariesRequest = v.InferOutput<typeof VaultSummariesRequest>;
1319
+
1320
+ /**
1321
+ * Request gossip root IPs.
1322
+ * @returns {GossipRootIps[]}
1323
+ * @see null
1324
+ */
1325
+ export const GossipRootIpsRequest = v.pipe(
1326
+ v.object({
1327
+ /** Type of request. */
1328
+ type: v.pipe(
1329
+ v.literal("gossipRootIps"),
1330
+ v.description("Type of request."),
1331
+ ),
1332
+ }),
1333
+ v.description("Request gossip root IPs."),
1334
+ );
1335
+ export type GossipRootIpsRequest = v.InferOutput<typeof GossipRootIpsRequest>;
1336
+
1337
+ /**
1338
+ * Request recent trades.
1339
+ * @returns {Trade[]}
1340
+ * @see null
1341
+ */
1342
+ export const RecentTradesRequest = v.pipe(
1343
+ v.object({
1344
+ /** Type of request. */
1345
+ type: v.pipe(
1346
+ v.literal("recentTrades"),
1347
+ v.description("Type of request."),
1348
+ ),
1349
+ /** Asset symbol (e.g., BTC). */
1350
+ coin: v.pipe(
1351
+ v.string(),
1352
+ v.description("Asset symbol (e.g., BTC)."),
1353
+ ),
1354
+ }),
1355
+ v.description("Request recent trades."),
1356
+ );
1357
+ export type RecentTradesRequest = v.InferOutput<typeof RecentTradesRequest>;
1358
+
1359
+ /**
1360
+ * Request builder deployed perpetual market limits.
1361
+ * @returns {PerpDexLimits}
1362
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-builder-deployed-perp-market-limits
1363
+ */
1364
+ export const PerpDexLimitsRequest = v.pipe(
1365
+ v.object({
1366
+ /** Type of request. */
1367
+ type: v.pipe(
1368
+ v.literal("perpDexLimits"),
1369
+ v.description("Type of request."),
1370
+ ),
1371
+ /** DEX name (empty string for main dex). */
1372
+ dex: v.pipe(
1373
+ v.string(),
1374
+ v.description("DEX name (empty string for main dex)."),
1375
+ ),
1376
+ }),
1377
+ v.description("Request perpetual DEX limits."),
1378
+ );
1379
+ export type PerpDexLimitsRequest = v.InferOutput<typeof PerpDexLimitsRequest>;
1380
+
1381
+ /**
1382
+ * Request comprehensive user and market data.
1383
+ * @returns {WebData2}
1384
+ * @see null
1385
+ */
1386
+ export const WebData2Request = v.pipe(
1387
+ v.object({
1388
+ /** Type of request. */
1389
+ type: v.pipe(
1390
+ v.literal("webData2"),
1391
+ v.description("Type of request."),
1392
+ ),
1393
+ /** User address. */
1394
+ user: v.pipe(
1395
+ v.pipe(Hex, v.length(42)),
1396
+ v.description("User address."),
1397
+ ),
1398
+ }),
1399
+ v.description("Request web data v2."),
1400
+ );
1401
+ export type WebData2Request = v.InferOutput<typeof WebData2Request>;