@nktkas/hyperliquid 0.24.2 → 0.25.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/README.md +197 -117
  2. package/esm/mod.d.ts +11 -11
  3. package/esm/mod.d.ts.map +1 -1
  4. package/esm/mod.js +1 -1
  5. package/esm/src/clients/exchange.d.ts +29 -18
  6. package/esm/src/clients/exchange.d.ts.map +1 -1
  7. package/esm/src/clients/exchange.js +50 -48
  8. package/esm/src/clients/info.d.ts +79 -75
  9. package/esm/src/clients/info.d.ts.map +1 -1
  10. package/esm/src/clients/info.js +294 -163
  11. package/esm/src/clients/multiSign.d.ts +11 -7
  12. package/esm/src/clients/multiSign.d.ts.map +1 -1
  13. package/esm/src/clients/subscription.d.ts +105 -32
  14. package/esm/src/clients/subscription.d.ts.map +1 -1
  15. package/esm/src/clients/subscription.js +114 -33
  16. package/esm/src/{base.d.ts → errors.d.ts} +1 -1
  17. package/esm/src/errors.d.ts.map +1 -0
  18. package/esm/src/schemas/_base.d.ts +10 -0
  19. package/esm/src/schemas/_base.d.ts.map +1 -0
  20. package/esm/src/schemas/_base.js +12 -0
  21. package/esm/src/schemas/exchange/requests.d.ts +8953 -0
  22. package/esm/src/schemas/exchange/requests.d.ts.map +1 -0
  23. package/esm/src/schemas/exchange/requests.js +1413 -0
  24. package/esm/src/schemas/exchange/responses.d.ts +567 -0
  25. package/esm/src/schemas/exchange/responses.d.ts.map +1 -0
  26. package/esm/src/schemas/exchange/responses.js +243 -0
  27. package/esm/src/schemas/explorer/requests.d.ts +44 -0
  28. package/esm/src/schemas/explorer/requests.d.ts.map +1 -0
  29. package/esm/src/schemas/explorer/requests.js +32 -0
  30. package/esm/src/schemas/explorer/responses.d.ts +360 -0
  31. package/esm/src/schemas/explorer/responses.d.ts.map +1 -0
  32. package/esm/src/schemas/explorer/responses.js +56 -0
  33. package/esm/src/schemas/info/accounts.d.ts +2159 -0
  34. package/esm/src/schemas/info/accounts.d.ts.map +1 -0
  35. package/esm/src/schemas/info/accounts.js +622 -0
  36. package/esm/src/schemas/info/assets.d.ts +945 -0
  37. package/esm/src/schemas/info/assets.d.ts.map +1 -0
  38. package/esm/src/schemas/info/assets.js +265 -0
  39. package/esm/src/schemas/info/markets.d.ts +138 -0
  40. package/esm/src/schemas/info/markets.d.ts.map +1 -0
  41. package/esm/src/schemas/info/markets.js +58 -0
  42. package/esm/src/schemas/info/orders.d.ts +957 -0
  43. package/esm/src/schemas/info/orders.d.ts.map +1 -0
  44. package/esm/src/schemas/info/orders.js +297 -0
  45. package/esm/src/schemas/info/requests.d.ts +882 -0
  46. package/esm/src/schemas/info/requests.d.ts.map +1 -0
  47. package/esm/src/schemas/info/requests.js +655 -0
  48. package/esm/src/schemas/info/validators.d.ts +305 -0
  49. package/esm/src/schemas/info/validators.d.ts.map +1 -0
  50. package/esm/src/schemas/info/validators.js +112 -0
  51. package/esm/src/schemas/info/vaults.d.ts +447 -0
  52. package/esm/src/schemas/info/vaults.d.ts.map +1 -0
  53. package/esm/src/schemas/info/vaults.js +110 -0
  54. package/esm/src/schemas/mod.d.ts +100 -0
  55. package/esm/src/schemas/mod.d.ts.map +1 -0
  56. package/esm/src/schemas/mod.js +113 -0
  57. package/esm/src/schemas/subscriptions/requests.d.ts +332 -0
  58. package/esm/src/schemas/subscriptions/requests.d.ts.map +1 -0
  59. package/esm/src/schemas/subscriptions/requests.js +258 -0
  60. package/esm/src/schemas/subscriptions/responses.d.ts +3643 -0
  61. package/esm/src/schemas/subscriptions/responses.d.ts.map +1 -0
  62. package/esm/src/schemas/subscriptions/responses.js +233 -0
  63. package/esm/src/signing/mod.d.ts +109 -29
  64. package/esm/src/signing/mod.d.ts.map +1 -1
  65. package/esm/src/signing/mod.js +135 -29
  66. package/esm/src/transports/base.d.ts +2 -2
  67. package/esm/src/transports/base.d.ts.map +1 -1
  68. package/esm/src/transports/base.js +2 -2
  69. package/esm/src/transports/http/http_transport.d.ts +2 -1
  70. package/esm/src/transports/http/http_transport.d.ts.map +1 -1
  71. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  72. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  73. package/esm/src/transports/websocket/websocket_transport.d.ts +2 -1
  74. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  75. package/package.json +6 -5
  76. package/script/mod.d.ts +11 -11
  77. package/script/mod.d.ts.map +1 -1
  78. package/script/mod.js +1 -1
  79. package/script/src/clients/exchange.d.ts +29 -18
  80. package/script/src/clients/exchange.d.ts.map +1 -1
  81. package/script/src/clients/exchange.js +56 -54
  82. package/script/src/clients/info.d.ts +79 -75
  83. package/script/src/clients/info.d.ts.map +1 -1
  84. package/script/src/clients/info.js +294 -163
  85. package/script/src/clients/multiSign.d.ts +11 -7
  86. package/script/src/clients/multiSign.d.ts.map +1 -1
  87. package/script/src/clients/subscription.d.ts +105 -32
  88. package/script/src/clients/subscription.d.ts.map +1 -1
  89. package/script/src/clients/subscription.js +114 -33
  90. package/script/src/{base.d.ts → errors.d.ts} +1 -1
  91. package/script/src/errors.d.ts.map +1 -0
  92. package/script/src/schemas/_base.d.ts +10 -0
  93. package/script/src/schemas/_base.d.ts.map +1 -0
  94. package/script/src/schemas/_base.js +48 -0
  95. package/script/src/schemas/exchange/requests.d.ts +8953 -0
  96. package/script/src/schemas/exchange/requests.d.ts.map +1 -0
  97. package/script/src/schemas/exchange/requests.js +1449 -0
  98. package/script/src/schemas/exchange/responses.d.ts +567 -0
  99. package/script/src/schemas/exchange/responses.d.ts.map +1 -0
  100. package/script/src/schemas/exchange/responses.js +279 -0
  101. package/script/src/schemas/explorer/requests.d.ts +44 -0
  102. package/script/src/schemas/explorer/requests.d.ts.map +1 -0
  103. package/script/src/schemas/explorer/requests.js +68 -0
  104. package/script/src/schemas/explorer/responses.d.ts +360 -0
  105. package/script/src/schemas/explorer/responses.d.ts.map +1 -0
  106. package/script/src/schemas/explorer/responses.js +92 -0
  107. package/script/src/schemas/info/accounts.d.ts +2159 -0
  108. package/script/src/schemas/info/accounts.d.ts.map +1 -0
  109. package/script/src/schemas/info/accounts.js +658 -0
  110. package/script/src/schemas/info/assets.d.ts +945 -0
  111. package/script/src/schemas/info/assets.d.ts.map +1 -0
  112. package/script/src/schemas/info/assets.js +301 -0
  113. package/script/src/schemas/info/markets.d.ts +138 -0
  114. package/script/src/schemas/info/markets.d.ts.map +1 -0
  115. package/script/src/schemas/info/markets.js +94 -0
  116. package/script/src/schemas/info/orders.d.ts +957 -0
  117. package/script/src/schemas/info/orders.d.ts.map +1 -0
  118. package/script/src/schemas/info/orders.js +333 -0
  119. package/script/src/schemas/info/requests.d.ts +882 -0
  120. package/script/src/schemas/info/requests.d.ts.map +1 -0
  121. package/script/src/schemas/info/requests.js +692 -0
  122. package/script/src/schemas/info/validators.d.ts +305 -0
  123. package/script/src/schemas/info/validators.d.ts.map +1 -0
  124. package/script/src/schemas/info/validators.js +148 -0
  125. package/script/src/schemas/info/vaults.d.ts +447 -0
  126. package/script/src/schemas/info/vaults.d.ts.map +1 -0
  127. package/script/src/schemas/info/vaults.js +146 -0
  128. package/script/src/schemas/mod.d.ts +100 -0
  129. package/script/src/schemas/mod.d.ts.map +1 -0
  130. package/script/src/schemas/mod.js +154 -0
  131. package/script/src/schemas/subscriptions/requests.d.ts +332 -0
  132. package/script/src/schemas/subscriptions/requests.d.ts.map +1 -0
  133. package/script/src/schemas/subscriptions/requests.js +294 -0
  134. package/script/src/schemas/subscriptions/responses.d.ts +3643 -0
  135. package/script/src/schemas/subscriptions/responses.d.ts.map +1 -0
  136. package/script/src/schemas/subscriptions/responses.js +269 -0
  137. package/script/src/signing/mod.d.ts +109 -29
  138. package/script/src/signing/mod.d.ts.map +1 -1
  139. package/script/src/signing/mod.js +137 -33
  140. package/script/src/transports/base.d.ts +2 -2
  141. package/script/src/transports/base.d.ts.map +1 -1
  142. package/script/src/transports/base.js +3 -3
  143. package/script/src/transports/http/http_transport.d.ts +2 -1
  144. package/script/src/transports/http/http_transport.d.ts.map +1 -1
  145. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  146. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  147. package/script/src/transports/websocket/websocket_transport.d.ts +2 -1
  148. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  149. package/esm/src/base.d.ts.map +0 -1
  150. package/esm/src/signing/_sorter.d.ts +0 -127
  151. package/esm/src/signing/_sorter.d.ts.map +0 -1
  152. package/esm/src/signing/_sorter.js +0 -693
  153. package/esm/src/types/exchange/requests.d.ts +0 -1345
  154. package/esm/src/types/exchange/requests.d.ts.map +0 -1
  155. package/esm/src/types/exchange/requests.js +0 -1
  156. package/esm/src/types/exchange/responses.d.ts +0 -233
  157. package/esm/src/types/exchange/responses.d.ts.map +0 -1
  158. package/esm/src/types/exchange/responses.js +0 -1
  159. package/esm/src/types/explorer/requests.d.ts +0 -32
  160. package/esm/src/types/explorer/requests.d.ts.map +0 -1
  161. package/esm/src/types/explorer/requests.js +0 -1
  162. package/esm/src/types/explorer/responses.d.ts +0 -58
  163. package/esm/src/types/explorer/responses.d.ts.map +0 -1
  164. package/esm/src/types/explorer/responses.js +0 -1
  165. package/esm/src/types/info/accounts.d.ts +0 -864
  166. package/esm/src/types/info/accounts.d.ts.map +0 -1
  167. package/esm/src/types/info/accounts.js +0 -1
  168. package/esm/src/types/info/assets.d.ts +0 -354
  169. package/esm/src/types/info/assets.d.ts.map +0 -1
  170. package/esm/src/types/info/assets.js +0 -1
  171. package/esm/src/types/info/markets.d.ts +0 -79
  172. package/esm/src/types/info/markets.d.ts.map +0 -1
  173. package/esm/src/types/info/markets.js +0 -1
  174. package/esm/src/types/info/orders.d.ts +0 -266
  175. package/esm/src/types/info/orders.d.ts.map +0 -1
  176. package/esm/src/types/info/orders.js +0 -1
  177. package/esm/src/types/info/requests.d.ts +0 -634
  178. package/esm/src/types/info/requests.d.ts.map +0 -1
  179. package/esm/src/types/info/requests.js +0 -1
  180. package/esm/src/types/info/validators.d.ts +0 -147
  181. package/esm/src/types/info/validators.d.ts.map +0 -1
  182. package/esm/src/types/info/validators.js +0 -1
  183. package/esm/src/types/info/vaults.d.ts +0 -119
  184. package/esm/src/types/info/vaults.d.ts.map +0 -1
  185. package/esm/src/types/info/vaults.js +0 -1
  186. package/esm/src/types/mod.d.ts +0 -38
  187. package/esm/src/types/mod.d.ts.map +0 -1
  188. package/esm/src/types/mod.js +0 -24
  189. package/esm/src/types/subscriptions/requests.d.ts +0 -143
  190. package/esm/src/types/subscriptions/requests.d.ts.map +0 -1
  191. package/esm/src/types/subscriptions/requests.js +0 -1
  192. package/esm/src/types/subscriptions/responses.d.ts +0 -213
  193. package/esm/src/types/subscriptions/responses.d.ts.map +0 -1
  194. package/esm/src/types/subscriptions/responses.js +0 -1
  195. package/script/src/base.d.ts.map +0 -1
  196. package/script/src/signing/_sorter.d.ts +0 -127
  197. package/script/src/signing/_sorter.d.ts.map +0 -1
  198. package/script/src/signing/_sorter.js +0 -696
  199. package/script/src/types/exchange/requests.d.ts +0 -1345
  200. package/script/src/types/exchange/requests.d.ts.map +0 -1
  201. package/script/src/types/exchange/requests.js +0 -2
  202. package/script/src/types/exchange/responses.d.ts +0 -233
  203. package/script/src/types/exchange/responses.d.ts.map +0 -1
  204. package/script/src/types/exchange/responses.js +0 -2
  205. package/script/src/types/explorer/requests.d.ts +0 -32
  206. package/script/src/types/explorer/requests.d.ts.map +0 -1
  207. package/script/src/types/explorer/requests.js +0 -2
  208. package/script/src/types/explorer/responses.d.ts +0 -58
  209. package/script/src/types/explorer/responses.d.ts.map +0 -1
  210. package/script/src/types/explorer/responses.js +0 -2
  211. package/script/src/types/info/accounts.d.ts +0 -864
  212. package/script/src/types/info/accounts.d.ts.map +0 -1
  213. package/script/src/types/info/accounts.js +0 -2
  214. package/script/src/types/info/assets.d.ts +0 -354
  215. package/script/src/types/info/assets.d.ts.map +0 -1
  216. package/script/src/types/info/assets.js +0 -2
  217. package/script/src/types/info/markets.d.ts +0 -79
  218. package/script/src/types/info/markets.d.ts.map +0 -1
  219. package/script/src/types/info/markets.js +0 -2
  220. package/script/src/types/info/orders.d.ts +0 -266
  221. package/script/src/types/info/orders.d.ts.map +0 -1
  222. package/script/src/types/info/orders.js +0 -2
  223. package/script/src/types/info/requests.d.ts +0 -634
  224. package/script/src/types/info/requests.d.ts.map +0 -1
  225. package/script/src/types/info/requests.js +0 -2
  226. package/script/src/types/info/validators.d.ts +0 -147
  227. package/script/src/types/info/validators.d.ts.map +0 -1
  228. package/script/src/types/info/validators.js +0 -2
  229. package/script/src/types/info/vaults.d.ts +0 -119
  230. package/script/src/types/info/vaults.d.ts.map +0 -1
  231. package/script/src/types/info/vaults.js +0 -2
  232. package/script/src/types/mod.d.ts +0 -38
  233. package/script/src/types/mod.d.ts.map +0 -1
  234. package/script/src/types/mod.js +0 -25
  235. package/script/src/types/subscriptions/requests.d.ts +0 -143
  236. package/script/src/types/subscriptions/requests.d.ts.map +0 -1
  237. package/script/src/types/subscriptions/requests.js +0 -2
  238. package/script/src/types/subscriptions/responses.d.ts +0 -213
  239. package/script/src/types/subscriptions/responses.d.ts.map +0 -1
  240. package/script/src/types/subscriptions/responses.js +0 -2
  241. /package/esm/src/{base.js → errors.js} +0 -0
  242. /package/script/src/{base.js → errors.js} +0 -0
@@ -0,0 +1,655 @@
1
+ import * as v from "valibot";
2
+ import { Hex } from "../_base.js";
3
+ /**
4
+ * Request user active asset data.
5
+ * @returns {ActiveAssetData}
6
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-active-asset-data
7
+ */
8
+ export const ActiveAssetDataRequest = v.pipe(v.strictObject({
9
+ /** Type of request. */
10
+ type: v.pipe(v.literal("activeAssetData"), v.description("Type of request.")),
11
+ /** Asset symbol (e.g., BTC). */
12
+ coin: v.pipe(v.string(), v.description("Asset symbol (e.g., BTC).")),
13
+ /** User address. */
14
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
15
+ }), v.description("Request user active asset data."));
16
+ /**
17
+ * Request mid coin prices.
18
+ * @returns {AllMids}
19
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-mids-for-all-coins
20
+ */
21
+ export const AllMidsRequest = v.pipe(v.strictObject({
22
+ /** Type of request. */
23
+ type: v.pipe(v.literal("allMids"), v.description("Type of request.")),
24
+ /** DEX name (empty string for main dex). */
25
+ dex: v.pipe(v.optional(v.string()), v.description("DEX name (empty string for main dex).")),
26
+ }), v.description("Request mid coin prices."));
27
+ /**
28
+ * Request candlestick snapshots.
29
+ * @returns {Candle[]}
30
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#candle-snapshot
31
+ */
32
+ export const CandleSnapshotRequest = v.pipe(v.strictObject({
33
+ /** Type of request. */
34
+ type: v.pipe(v.literal("candleSnapshot"), v.description("Type of request.")),
35
+ /** Request parameters. */
36
+ req: v.pipe(v.strictObject({
37
+ /** Asset symbol (e.g., BTC). */
38
+ coin: v.pipe(v.string(), v.description("Asset symbol (e.g., BTC).")),
39
+ /** Time interval. */
40
+ interval: v.pipe(v.union([
41
+ v.literal("1m"),
42
+ v.literal("3m"),
43
+ v.literal("5m"),
44
+ v.literal("15m"),
45
+ v.literal("30m"),
46
+ v.literal("1h"),
47
+ v.literal("2h"),
48
+ v.literal("4h"),
49
+ v.literal("8h"),
50
+ v.literal("12h"),
51
+ v.literal("1d"),
52
+ v.literal("3d"),
53
+ v.literal("1w"),
54
+ v.literal("1M"),
55
+ ]), v.description("Time interval.")),
56
+ /** Start time (in ms since epoch). */
57
+ startTime: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Start time (in ms since epoch).")),
58
+ /** End time (in ms since epoch). */
59
+ endTime: v.pipe(v.nullish(v.pipe(v.number(), v.safeInteger(), v.minValue(0))), v.description("End time (in ms since epoch).")),
60
+ }), v.description("Request parameters.")),
61
+ }), v.description("Request candlestick snapshots."));
62
+ /**
63
+ * Request clearinghouse state.
64
+ * @returns {PerpsClearinghouseState}
65
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
66
+ */
67
+ export const ClearinghouseStateRequest = v.pipe(v.strictObject({
68
+ /** Type of request. */
69
+ type: v.pipe(v.literal("clearinghouseState"), v.description("Type of request.")),
70
+ /** User address. */
71
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
72
+ /** DEX name (empty string for main dex). */
73
+ dex: v.pipe(v.optional(v.string()), v.description("DEX name (empty string for main dex).")),
74
+ }), v.description("Request clearinghouse state."));
75
+ /**
76
+ * Request user staking delegations.
77
+ * @returns {Delegation[]}
78
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-delegations
79
+ */
80
+ export const DelegationsRequest = v.pipe(v.strictObject({
81
+ /** Type of request. */
82
+ type: v.pipe(v.literal("delegations"), v.description("Type of request.")),
83
+ /** User address. */
84
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
85
+ }), v.description("Request user staking delegations."));
86
+ /**
87
+ * Request user staking history.
88
+ * @returns {DelegatorUpdate[]}
89
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-history
90
+ */
91
+ export const DelegatorHistoryRequest = v.pipe(v.strictObject({
92
+ /** Type of request. */
93
+ type: v.pipe(v.literal("delegatorHistory"), v.description("Type of request.")),
94
+ /** User address. */
95
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
96
+ }), v.description("Request user staking history."));
97
+ /**
98
+ * Request user staking rewards.
99
+ * @returns {DelegatorReward[]}
100
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-rewards
101
+ */
102
+ export const DelegatorRewardsRequest = v.pipe(v.strictObject({
103
+ /** Type of request. */
104
+ type: v.pipe(v.literal("delegatorRewards"), v.description("Type of request.")),
105
+ /** User address. */
106
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
107
+ }), v.description("Request user staking rewards."));
108
+ /**
109
+ * Request user staking summary.
110
+ * @returns {DelegatorSummary}
111
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-summary
112
+ */
113
+ export const DelegatorSummaryRequest = v.pipe(v.strictObject({
114
+ /** Type of request. */
115
+ type: v.pipe(v.literal("delegatorSummary"), v.description("Type of request.")),
116
+ /** User address. */
117
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
118
+ }), v.description("Request user staking summary."));
119
+ /**
120
+ * Request exchange status information.
121
+ * @returns {ExchangeStatus}
122
+ * @see null
123
+ */
124
+ export const ExchangeStatusRequest = v.pipe(v.strictObject({
125
+ /** Type of request. */
126
+ type: v.pipe(v.literal("exchangeStatus"), v.description("Type of request.")),
127
+ }), v.description("Request exchange status information."));
128
+ /**
129
+ * Request user extra agents.
130
+ * @returns {ExtraAgent[]}
131
+ * @see null
132
+ */
133
+ export const ExtraAgentsRequest = v.pipe(v.strictObject({
134
+ /** Type of request. */
135
+ type: v.pipe(v.literal("extraAgents"), v.description("Type of request.")),
136
+ /** User address. */
137
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
138
+ }), v.description("Request user extra agents."));
139
+ /**
140
+ * Request frontend open orders.
141
+ * @returns {FrontendOrder[]}
142
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders-with-additional-frontend-info
143
+ */
144
+ export const FrontendOpenOrdersRequest = v.pipe(v.strictObject({
145
+ /** Type of request. */
146
+ type: v.pipe(v.literal("frontendOpenOrders"), v.description("Type of request.")),
147
+ /** User address. */
148
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
149
+ /** DEX name (empty string for main dex). */
150
+ dex: v.pipe(v.optional(v.string()), v.description("DEX name (empty string for main dex).")),
151
+ }), v.description("Request frontend open orders."));
152
+ /**
153
+ * Request funding history.
154
+ * @returns {FundingHistory[]}
155
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-historical-funding-rates
156
+ */
157
+ export const FundingHistoryRequest = v.pipe(v.strictObject({
158
+ /** Type of request. */
159
+ type: v.pipe(v.literal("fundingHistory"), v.description("Type of request.")),
160
+ /** Asset symbol (e.g., BTC). */
161
+ coin: v.pipe(v.string(), v.description("Asset symbol (e.g., BTC).")),
162
+ /** Start time (in ms since epoch). */
163
+ startTime: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Start time (in ms since epoch).")),
164
+ /** End time (in ms since epoch). */
165
+ endTime: v.pipe(v.nullish(v.pipe(v.number(), v.safeInteger(), v.minValue(0))), v.description("End time (in ms since epoch).")),
166
+ }), v.description("Request funding history."));
167
+ /**
168
+ * Request user historical orders.
169
+ * @returns {FrontendOrderStatus[]}
170
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-historical-orders
171
+ */
172
+ export const HistoricalOrdersRequest = v.pipe(v.strictObject({
173
+ /** Type of request. */
174
+ type: v.pipe(v.literal("historicalOrders"), v.description("Type of request.")),
175
+ /** User address. */
176
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
177
+ }), v.description("Request user historical orders."));
178
+ /**
179
+ * Request to check if a user is a VIP.
180
+ * @returns {boolean | null}
181
+ * @see null
182
+ */
183
+ export const IsVipRequest = v.pipe(v.strictObject({
184
+ /** Type of request. */
185
+ type: v.pipe(v.literal("isVip"), v.description("Type of request.")),
186
+ /** User address. */
187
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
188
+ }), v.description("Request to check if a user is a VIP."));
189
+ /**
190
+ * Request L2 order book.
191
+ * @returns {Book}
192
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#l2-book-snapshot
193
+ */
194
+ export const L2BookRequest = v.pipe(v.strictObject({
195
+ /** Type of request. */
196
+ type: v.pipe(v.literal("l2Book"), v.description("Type of request.")),
197
+ /** Asset symbol (e.g., BTC). */
198
+ coin: v.pipe(v.string(), v.description("Asset symbol (e.g., BTC).")),
199
+ /** Number of significant figures. */
200
+ nSigFigs: v.pipe(v.nullish(v.union([v.literal(2), v.literal(3), v.literal(4), v.literal(5)])), v.description("Number of significant figures.")),
201
+ /** Mantissa for aggregation (if `nSigFigs` is 5). */
202
+ mantissa: v.pipe(v.nullish(v.union([v.literal(2), v.literal(5)])), v.description("Mantissa for aggregation (if `nSigFigs` is 5).")),
203
+ }), v.description("Request L2 order book."));
204
+ /**
205
+ * Request leading vaults for a user.
206
+ * @returns {VaultLeading[]}
207
+ * @see null
208
+ */
209
+ export const LeadingVaultsRequest = v.pipe(v.strictObject({
210
+ /** Type of request. */
211
+ type: v.pipe(v.literal("leadingVaults"), v.description("Type of request.")),
212
+ /** User address. */
213
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
214
+ }), v.description("Request leading vaults for a user."));
215
+ /**
216
+ * Request legal verification status of a user.
217
+ * @returns {LegalCheck}
218
+ * @see null
219
+ */
220
+ export const LegalCheckRequest = v.pipe(v.strictObject({
221
+ /** Type of request. */
222
+ type: v.pipe(v.literal("legalCheck"), v.description("Type of request.")),
223
+ /** User address. */
224
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
225
+ }), v.description("Request legal verification status of a user."));
226
+ /**
227
+ * Request liquidatable.
228
+ * @returns {unknown[]} FIXME: Define the return type
229
+ * @see null
230
+ */
231
+ export const LiquidatableRequest = v.pipe(v.strictObject({
232
+ /** Type of request. */
233
+ type: v.pipe(v.literal("liquidatable"), v.description("Type of request.")),
234
+ }), v.description("Request liquidatable."));
235
+ /**
236
+ * Request margin table data.
237
+ * @returns {MarginTable}
238
+ * @see null
239
+ */
240
+ export const MarginTableRequest = v.pipe(v.strictObject({
241
+ /** Type of request. */
242
+ type: v.pipe(v.literal("marginTable"), v.description("Type of request.")),
243
+ /** Margin requirements table. */
244
+ id: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Margin requirements table.")),
245
+ }), v.description("Request margin table data."));
246
+ /**
247
+ * Request builder fee approval.
248
+ * @returns {number}
249
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#check-builder-fee-approval
250
+ */
251
+ export const MaxBuilderFeeRequest = v.pipe(v.strictObject({
252
+ /** Type of request. */
253
+ type: v.pipe(v.literal("maxBuilderFee"), v.description("Type of request.")),
254
+ /** User address. */
255
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
256
+ /** Builder address. */
257
+ builder: v.pipe(v.pipe(Hex, v.length(42)), v.description("Builder address.")),
258
+ }), v.description("Request builder fee approval."));
259
+ /**
260
+ * Request maximum market order notionals.
261
+ * @returns {[number, string][]}
262
+ * @see null
263
+ */
264
+ export const MaxMarketOrderNtlsRequest = v.pipe(v.strictObject({
265
+ /** Type of request. */
266
+ type: v.pipe(v.literal("maxMarketOrderNtls"), v.description("Type of request.")),
267
+ }), v.description("Request maximum market order notionals."));
268
+ /**
269
+ * Request trading metadata.
270
+ * @returns {PerpsMeta}
271
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-metadata-universe-and-margin-tables
272
+ */
273
+ export const MetaRequest = v.pipe(v.strictObject({
274
+ /** Type of request. */
275
+ type: v.pipe(v.literal("meta"), v.description("Type of request.")),
276
+ /** DEX name (empty string for main dex). */
277
+ dex: v.pipe(v.optional(v.string()), v.description("DEX name (empty string for main dex).")),
278
+ }), v.description("Request trading metadata."));
279
+ /**
280
+ * Request metadata and asset contexts.
281
+ * @returns {PerpsMetaAndAssetCtxs}
282
+ * @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
283
+ */
284
+ export const MetaAndAssetCtxsRequest = v.pipe(v.strictObject({
285
+ /** Type of request. */
286
+ type: v.pipe(v.literal("metaAndAssetCtxs"), v.description("Type of request.")),
287
+ /** DEX name (empty string for main dex). */
288
+ dex: v.pipe(v.optional(v.string()), v.description("DEX name (empty string for main dex).")),
289
+ }), v.description("Request metadata and asset contexts."));
290
+ /**
291
+ * Request open orders.
292
+ * @returns {Order[]}
293
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders
294
+ */
295
+ export const OpenOrdersRequest = v.pipe(v.strictObject({
296
+ /** Type of request. */
297
+ type: v.pipe(v.literal("openOrders"), v.description("Type of request.")),
298
+ /** User address. */
299
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
300
+ /** DEX name (empty string for main dex). */
301
+ dex: v.pipe(v.optional(v.string()), v.description("DEX name (empty string for main dex).")),
302
+ }), v.description("Request open orders."));
303
+ /**
304
+ * Request order status.
305
+ * @returns {OrderLookup}
306
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-order-status-by-oid-or-cloid
307
+ */
308
+ export const OrderStatusRequest = v.pipe(v.strictObject({
309
+ /** Type of request. */
310
+ type: v.pipe(v.literal("orderStatus"), v.description("Type of request.")),
311
+ /** User address. */
312
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
313
+ /** Order ID or Client Order ID. */
314
+ oid: v.pipe(v.union([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.pipe(Hex, v.length(34))]), v.description("Order ID or Client Order ID.")),
315
+ }), v.description("Request order status."));
316
+ /**
317
+ * Request for the status of the perpetual deploy auction.
318
+ * @returns {DeployAuctionStatus}
319
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-information-about-the-perp-deploy-auction
320
+ */
321
+ export const PerpDeployAuctionStatusRequest = v.pipe(v.strictObject({
322
+ /** Type of request. */
323
+ type: v.pipe(v.literal("perpDeployAuctionStatus"), v.description("Type of request.")),
324
+ }), v.description("Request for the status of the perpetual deploy auction."));
325
+ /**
326
+ * Request all perpetual dexs.
327
+ * @returns {PerpDexs}
328
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-all-perpetual-dexs
329
+ */
330
+ export const PerpDexsRequest = v.pipe(v.strictObject({
331
+ /** Type of request. */
332
+ type: v.pipe(v.literal("perpDexs"), v.description("Type of request.")),
333
+ }), v.description("Request all perpetual dexs."));
334
+ /**
335
+ * Request perpetuals at open interest cap.
336
+ * @returns {string[]}
337
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#query-perps-at-open-interest-caps
338
+ */
339
+ export const PerpsAtOpenInterestCapRequest = v.pipe(v.strictObject({
340
+ /** Type of request. */
341
+ type: v.pipe(v.literal("perpsAtOpenInterestCap"), v.description("Type of request.")),
342
+ /** DEX name (empty string for main dex). */
343
+ dex: v.pipe(v.optional(v.string()), v.description("DEX name (empty string for main dex).")),
344
+ }), v.description("Request perpetuals at open interest cap."));
345
+ /**
346
+ * Request user portfolio.
347
+ * @returns {PortfolioPeriods}
348
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-portfolio
349
+ */
350
+ export const PortfolioRequest = v.pipe(v.strictObject({
351
+ /** Type of request. */
352
+ type: v.pipe(v.literal("portfolio"), v.description("Type of request.")),
353
+ /** User address. */
354
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
355
+ }), v.description("Request user portfolio."));
356
+ /**
357
+ * Request predicted funding rates.
358
+ * @returns {PredictedFunding[]}
359
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-predicted-funding-rates-for-different-venues
360
+ */
361
+ export const PredictedFundingsRequest = v.pipe(v.strictObject({
362
+ /** Type of request. */
363
+ type: v.pipe(v.literal("predictedFundings"), v.description("Type of request.")),
364
+ }), v.description("Request predicted funding rates."));
365
+ /**
366
+ * Request user existence check before transfer.
367
+ * @returns {PreTransferCheck}
368
+ * @see null
369
+ */
370
+ export const PreTransferCheckRequest = v.pipe(v.strictObject({
371
+ /** Type of request. */
372
+ type: v.pipe(v.literal("preTransferCheck"), v.description("Type of request.")),
373
+ /** User address. */
374
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
375
+ /** Source address. */
376
+ source: v.pipe(v.pipe(Hex, v.length(42)), v.description("Source address.")),
377
+ }), v.description("Request user existence check before transfer."));
378
+ /**
379
+ * Request user referral.
380
+ * @returns {Referral}
381
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-referral-information
382
+ */
383
+ export const ReferralRequest = v.pipe(v.strictObject({
384
+ /** Type of request. */
385
+ type: v.pipe(v.literal("referral"), v.description("Type of request.")),
386
+ /** User address. */
387
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
388
+ }), v.description("Request user referral."));
389
+ /**
390
+ * Request spot clearinghouse state.
391
+ * @returns {SpotClearinghouseState}
392
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-a-users-token-balances
393
+ */
394
+ export const SpotClearinghouseStateRequest = v.pipe(v.strictObject({
395
+ /** Type of request. */
396
+ type: v.pipe(v.literal("spotClearinghouseState"), v.description("Type of request.")),
397
+ /** User address. */
398
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
399
+ /** DEX name (empty string for main dex). */
400
+ dex: v.pipe(v.optional(v.string()), v.description("DEX name (empty string for main dex).")),
401
+ }), v.description("Request spot clearinghouse state."));
402
+ /**
403
+ * Request spot deploy state.
404
+ * @returns {SpotDeployState}
405
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-information-about-the-spot-deploy-auction
406
+ */
407
+ export const SpotDeployStateRequest = v.pipe(v.strictObject({
408
+ /** Type of request. */
409
+ type: v.pipe(v.literal("spotDeployState"), v.description("Type of request.")),
410
+ /** User address. */
411
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
412
+ }), v.description("Request spot deploy state."));
413
+ /**
414
+ * Request spot trading metadata.
415
+ * @returns {SpotMeta}
416
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-metadata
417
+ */
418
+ export const SpotMetaRequest = v.pipe(v.strictObject({
419
+ /** Type of request. */
420
+ type: v.pipe(v.literal("spotMeta"), v.description("Type of request.")),
421
+ }), v.description("Request spot trading metadata."));
422
+ /**
423
+ * Request spot metadata and asset contexts.
424
+ * @returns {SpotMetaAndAssetCtxs}
425
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
426
+ */
427
+ export const SpotMetaAndAssetCtxsRequest = v.pipe(v.strictObject({
428
+ /** Type of request. */
429
+ type: v.pipe(v.literal("spotMetaAndAssetCtxs"), v.description("Type of request.")),
430
+ }), v.description("Request spot metadata and asset contexts."));
431
+ /**
432
+ * Request for the status of the spot deploy auction.
433
+ * @returns {DeployAuctionStatus}
434
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-information-about-the-spot-pair-deploy-auction
435
+ */
436
+ export const SpotPairDeployAuctionStatusRequest = v.pipe(v.strictObject({
437
+ /** Type of request. */
438
+ type: v.pipe(v.literal("spotPairDeployAuctionStatus"), v.description("Type of request.")),
439
+ }), v.description("Request for the status of the spot deploy auction."));
440
+ /**
441
+ * Request user sub-accounts.
442
+ * @returns {SubAccount[] | null}
443
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-subaccounts
444
+ */
445
+ export const SubAccountsRequest = v.pipe(v.strictObject({
446
+ /** Type of request. */
447
+ type: v.pipe(v.literal("subAccounts"), v.description("Type of request.")),
448
+ /** User address. */
449
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
450
+ }), v.description("Request user sub-accounts."));
451
+ /**
452
+ * Request token details.
453
+ * @returns {TokenDetails}
454
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-information-about-a-token
455
+ */
456
+ export const TokenDetailsRequest = v.pipe(v.strictObject({
457
+ /** Type of request. */
458
+ type: v.pipe(v.literal("tokenDetails"), v.description("Type of request.")),
459
+ /** Token ID. */
460
+ tokenId: v.pipe(v.pipe(Hex, v.length(34)), v.description("Token ID.")),
461
+ }), v.description("Request token details."));
462
+ /**
463
+ * Request twap history of a user.
464
+ * @returns {TwapHistory[]}
465
+ * @see null
466
+ */
467
+ export const TwapHistoryRequest = v.pipe(v.strictObject({
468
+ /** Type of request. */
469
+ type: v.pipe(v.literal("twapHistory"), v.description("Type of request.")),
470
+ /** User address. */
471
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
472
+ }), v.description("Request twap history of a user."));
473
+ /**
474
+ * Request user fees.
475
+ * @returns {UserFees}
476
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-fees
477
+ */
478
+ export const UserFeesRequest = v.pipe(v.strictObject({
479
+ /** Type of request. */
480
+ type: v.pipe(v.literal("userFees"), v.description("Type of request.")),
481
+ /** User address. */
482
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
483
+ }), v.description("Request user fees."));
484
+ /**
485
+ * Request user fills.
486
+ * @returns {Fill[]}
487
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills
488
+ */
489
+ export const UserFillsRequest = v.pipe(v.strictObject({
490
+ /** Type of request. */
491
+ type: v.pipe(v.literal("userFills"), v.description("Type of request.")),
492
+ /** User address. */
493
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
494
+ /** If true, partial fills are aggregated when a crossing order fills multiple resting orders. */
495
+ aggregateByTime: v.pipe(v.optional(v.boolean()), v.description("If true, partial fills are aggregated when a crossing order fills multiple resting orders.")),
496
+ }), v.description("Request user fills."));
497
+ /**
498
+ * Request user fills by time.
499
+ * @returns {Fill[]}
500
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time
501
+ */
502
+ export const UserFillsByTimeRequest = v.pipe(v.strictObject({
503
+ /** Type of request. */
504
+ type: v.pipe(v.literal("userFillsByTime"), v.description("Type of request.")),
505
+ /** User address. */
506
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
507
+ /** Start time (in ms since epoch). */
508
+ startTime: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Start time (in ms since epoch).")),
509
+ /** End time (in ms since epoch). */
510
+ endTime: v.pipe(v.nullish(v.pipe(v.number(), v.safeInteger(), v.minValue(0))), v.description("End time (in ms since epoch).")),
511
+ /** If true, partial fills are aggregated when a crossing order fills multiple resting orders. */
512
+ aggregateByTime: v.pipe(v.optional(v.boolean()), v.description("If true, partial fills are aggregated when a crossing order fills multiple resting orders.")),
513
+ }), v.description("Request user fills by time."));
514
+ /**
515
+ * Request user funding.
516
+ * @returns {UserFundingUpdate[]}
517
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-a-users-funding-history-or-non-funding-ledger-updates
518
+ */
519
+ export const UserFundingRequest = v.pipe(v.strictObject({
520
+ /** Type of request. */
521
+ type: v.pipe(v.literal("userFunding"), v.description("Type of request.")),
522
+ /** User address. */
523
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
524
+ /** Start time (in ms since epoch). */
525
+ startTime: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Start time (in ms since epoch).")),
526
+ /** End time (in ms since epoch). */
527
+ endTime: v.pipe(v.nullish(v.pipe(v.number(), v.safeInteger(), v.minValue(0))), v.description("End time (in ms since epoch).")),
528
+ }), v.description("Request user funding."));
529
+ /**
530
+ * Request user non-funding ledger updates.
531
+ * @returns {UserNonFundingLedgerUpdate[]}
532
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-a-users-funding-history-or-non-funding-ledger-updates
533
+ */
534
+ export const UserNonFundingLedgerUpdatesRequest = v.pipe(v.strictObject({
535
+ /** Type of request. */
536
+ type: v.pipe(v.literal("userNonFundingLedgerUpdates"), v.description("Type of request.")),
537
+ /** User address. */
538
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
539
+ /** Start time (in ms since epoch). */
540
+ startTime: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Start time (in ms since epoch).")),
541
+ /** End time (in ms since epoch). */
542
+ endTime: v.pipe(v.nullish(v.pipe(v.number(), v.safeInteger(), v.minValue(0))), v.description("End time (in ms since epoch).")),
543
+ }), v.description("Request user non-funding ledger updates."));
544
+ /**
545
+ * Request user rate limits.
546
+ * @returns {UserRateLimit}
547
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-user-rate-limits
548
+ */
549
+ export const UserRateLimitRequest = v.pipe(v.strictObject({
550
+ /** Type of request. */
551
+ type: v.pipe(v.literal("userRateLimit"), v.description("Type of request.")),
552
+ /** User address. */
553
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
554
+ }), v.description("Request user rate limits."));
555
+ /**
556
+ * Request user role.
557
+ * @returns {UserRole}
558
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-role
559
+ */
560
+ export const UserRoleRequest = v.pipe(v.strictObject({
561
+ /** Type of request. */
562
+ type: v.pipe(v.literal("userRole"), v.description("Type of request.")),
563
+ /** User address. */
564
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
565
+ }), v.description("Request user role."));
566
+ /**
567
+ * Request multi-sig signers for a user.
568
+ * @returns {MultiSigSigners | null}
569
+ * @see null
570
+ */
571
+ export const UserToMultiSigSignersRequest = v.pipe(v.strictObject({
572
+ /** Type of request. */
573
+ type: v.pipe(v.literal("userToMultiSigSigners"), v.description("Type of request.")),
574
+ /** User address. */
575
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
576
+ }), v.description("Request multi-sig signers for a user."));
577
+ /**
578
+ * Request user TWAP slice fills.
579
+ * @returns {TwapSliceFill[]}
580
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-twap-slice-fills
581
+ */
582
+ export const UserTwapSliceFillsRequest = v.pipe(v.strictObject({
583
+ /** Type of request. */
584
+ type: v.pipe(v.literal("userTwapSliceFills"), v.description("Type of request.")),
585
+ /** User address. */
586
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
587
+ }), v.description("Request user TWAP slice fills."));
588
+ /**
589
+ * Request user TWAP slice fills by time.
590
+ * @returns {TwapSliceFill[]}
591
+ * @see null
592
+ */
593
+ export const UserTwapSliceFillsByTimeRequest = v.pipe(v.strictObject({
594
+ /** Type of request. */
595
+ type: v.pipe(v.literal("userTwapSliceFillsByTime"), v.description("Type of request.")),
596
+ /** User address. */
597
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
598
+ /** Start time (in ms since epoch). */
599
+ startTime: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Start time (in ms since epoch).")),
600
+ /** End time (in ms since epoch). */
601
+ endTime: v.pipe(v.nullish(v.pipe(v.number(), v.safeInteger(), v.minValue(0))), v.description("End time (in ms since epoch).")),
602
+ /** If true, partial fills are aggregated when a crossing order fills multiple resting orders. */
603
+ aggregateByTime: v.pipe(v.optional(v.boolean()), v.description("If true, partial fills are aggregated when a crossing order fills multiple resting orders.")),
604
+ }), v.description("Request user TWAP slice fills by time."));
605
+ /**
606
+ * Request user vault deposits.
607
+ * @returns {VaultEquity[]}
608
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-vault-deposits
609
+ */
610
+ export const UserVaultEquitiesRequest = v.pipe(v.strictObject({
611
+ /** Type of request. */
612
+ type: v.pipe(v.literal("userVaultEquities"), v.description("Type of request.")),
613
+ /** User address. */
614
+ user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
615
+ }), v.description("Request user vault deposits."));
616
+ /**
617
+ * Request validator L1 votes.
618
+ * @returns {unknown[]} FIXME: Define the return type
619
+ * @see null
620
+ */
621
+ export const ValidatorL1VotesRequest = v.pipe(v.strictObject({
622
+ /** Type of request. */
623
+ type: v.pipe(v.literal("validatorL1Votes"), v.description("Type of request.")),
624
+ }), v.description("Request validator L1 votes."));
625
+ /**
626
+ * Request validator summaries.
627
+ * @returns {ValidatorSummary[]}
628
+ * @see null
629
+ */
630
+ export const ValidatorSummariesRequest = v.pipe(v.strictObject({
631
+ /** Type of request. */
632
+ type: v.pipe(v.literal("validatorSummaries"), v.description("Type of request.")),
633
+ }), v.description("Request validator summaries."));
634
+ /**
635
+ * Request details of a vault.
636
+ * @returns {VaultDetails | null}
637
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-details-for-a-vault
638
+ */
639
+ export const VaultDetailsRequest = v.pipe(v.strictObject({
640
+ /** Type of request. */
641
+ type: v.pipe(v.literal("vaultDetails"), v.description("Type of request.")),
642
+ /** Vault address. */
643
+ vaultAddress: v.pipe(v.pipe(Hex, v.length(42)), v.description("Vault address.")),
644
+ /** User address. */
645
+ user: v.pipe(v.nullish(v.pipe(Hex, v.length(42))), v.description("User address.")),
646
+ }), v.description("Request details of a vault."));
647
+ /**
648
+ * Request a list of vaults less than 2 hours old.
649
+ * @returns {VaultSummary[]}
650
+ * @see null
651
+ */
652
+ export const VaultSummariesRequest = v.pipe(v.strictObject({
653
+ /** Type of request. */
654
+ type: v.pipe(v.literal("vaultSummaries"), v.description("Type of request.")),
655
+ }), v.description("Request a list of vaults less than 2 hours old."));