@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
@@ -33,64 +33,66 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.UserNonFundingLedgerUpdate = exports.WithdrawUpdate = exports.VaultWithdrawUpdate = exports.VaultDistributionUpdate = exports.VaultDepositUpdate = exports.VaultCreateUpdate = exports.SubAccountTransferUpdate = exports.SpotTransferUpdate = exports.RewardsClaimUpdate = exports.LiquidationUpdate = exports.InternalTransferUpdate = exports.DepositUpdate = exports.AccountClassTransferUpdate = exports.UserRole = exports.UserRateLimit = exports.UserFundingUpdate = exports.FundingUpdate = exports.UserFees = exports.SubAccount = exports.SpotClearinghouseState = exports.SpotBalance = exports.Referral = exports.PreTransferCheck = exports.PortfolioPeriods = exports.Portfolio = exports.PerpsClearinghouseState = exports.MultiSigSigners = exports.LegalCheck = exports.ExtraAgent = exports.EvmEscrowsBalance = exports.AssetPosition = exports.ActiveAssetData = void 0;
36
+ exports.WebData2 = exports.UserNonFundingLedgerUpdate = exports.WithdrawUpdate = exports.VaultWithdrawUpdate = exports.VaultDistributionUpdate = exports.VaultDepositUpdate = exports.VaultCreateUpdate = exports.SubAccountTransferUpdate = exports.SpotTransferUpdate = exports.RewardsClaimUpdate = exports.LiquidationUpdate = exports.InternalTransferUpdate = exports.DepositUpdate = exports.AccountClassTransferUpdate = exports.UserRole = exports.UserRateLimit = exports.UserFundingUpdate = exports.FundingUpdate = exports.UserFees = exports.SubAccount = exports.SpotClearinghouseState = exports.SpotBalance = exports.Referral = exports.PreTransferCheck = exports.PortfolioPeriods = exports.Portfolio = exports.PerpsClearinghouseState = exports.MultiSigSigners = exports.LegalCheck = exports.ExtraAgent = exports.EvmEscrowsBalance = exports.AssetPosition = exports.ActiveAssetData = void 0;
37
37
  const v = __importStar(require("valibot"));
38
38
  const _base_js_1 = require("../_base.js");
39
+ const orders_js_1 = require("./orders.js");
40
+ const assets_js_1 = require("./assets.js");
39
41
  /** User active asset data. */
40
- exports.ActiveAssetData = v.pipe(v.strictObject({
42
+ exports.ActiveAssetData = v.pipe(v.object({
41
43
  /** User address. */
42
44
  user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("User address.")),
43
45
  /** Asset symbol (e.g., BTC). */
44
46
  coin: v.pipe(v.string(), v.description("Asset symbol (e.g., BTC).")),
45
47
  /** Leverage configuration. */
46
48
  leverage: v.pipe(v.union([
47
- v.strictObject({
49
+ v.object({
48
50
  /** Leverage type. */
49
51
  type: v.pipe(v.literal("isolated"), v.description("Leverage type.")),
50
52
  /** Leverage value used. */
51
- value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
53
+ value: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
52
54
  /** Amount of USD used (1 = 1$). */
53
55
  rawUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of USD used (1 = 1$).")),
54
56
  }),
55
- v.strictObject({
57
+ v.object({
56
58
  /** Leverage type. */
57
59
  type: v.pipe(v.literal("cross"), v.description("Leverage type.")),
58
60
  /** Leverage value used. */
59
- value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
61
+ value: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
60
62
  }),
61
63
  ]), v.description("Leverage configuration.")),
62
64
  /** Maximum trade size range [min, max]. */
63
- maxTradeSzs: v.pipe(v.strictTuple([_base_js_1.UnsignedDecimal, _base_js_1.UnsignedDecimal]), v.description("Maximum trade size range [min, max].")),
65
+ maxTradeSzs: v.pipe(v.tuple([_base_js_1.UnsignedDecimal, _base_js_1.UnsignedDecimal]), v.description("Maximum trade size range [min, max].")),
64
66
  /** Available to trade range [min, max]. */
65
- availableToTrade: v.pipe(v.strictTuple([_base_js_1.UnsignedDecimal, _base_js_1.UnsignedDecimal]), v.description("Available to trade range [min, max].")),
67
+ availableToTrade: v.pipe(v.tuple([_base_js_1.UnsignedDecimal, _base_js_1.UnsignedDecimal]), v.description("Available to trade range [min, max].")),
66
68
  /** Mark price. */
67
69
  markPx: v.pipe(_base_js_1.UnsignedDecimal, v.description("Mark price.")),
68
70
  }), v.description("User active asset data."));
69
71
  /** Position for a specific asset. */
70
- exports.AssetPosition = v.pipe(v.strictObject({
72
+ exports.AssetPosition = v.pipe(v.object({
71
73
  /** Position type. */
72
74
  type: v.pipe(v.literal("oneWay"), v.description("Position type.")),
73
75
  /** Position details. */
74
- position: v.pipe(v.strictObject({
76
+ position: v.pipe(v.object({
75
77
  /** Asset symbol. */
76
78
  coin: v.pipe(v.string(), v.description("Asset symbol.")),
77
79
  /** Signed position size. */
78
- szi: v.pipe(_base_js_1.SignedDecimal, v.description("Signed position size.")),
80
+ szi: v.pipe(_base_js_1.Decimal, v.description("Signed position size.")),
79
81
  /** Leverage details. */
80
82
  leverage: v.pipe(v.union([
81
- v.strictObject({
83
+ v.object({
82
84
  /** Leverage type. */
83
85
  type: v.pipe(v.literal("isolated"), v.description("Leverage type.")),
84
86
  /** Leverage value used. */
85
- value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
87
+ value: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
86
88
  /** Amount of USD used (1 = 1$). */
87
89
  rawUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of USD used (1 = 1$).")),
88
90
  }),
89
- v.strictObject({
91
+ v.object({
90
92
  /** Leverage type. */
91
93
  type: v.pipe(v.literal("cross"), v.description("Leverage type.")),
92
94
  /** Leverage value used. */
93
- value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
95
+ value: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
94
96
  }),
95
97
  ]), v.description("Leverage details.")),
96
98
  /** Average entry price. */
@@ -98,46 +100,46 @@ exports.AssetPosition = v.pipe(v.strictObject({
98
100
  /** Position value. */
99
101
  positionValue: v.pipe(_base_js_1.UnsignedDecimal, v.description("Position value.")),
100
102
  /** Unrealized profit and loss. */
101
- unrealizedPnl: v.pipe(_base_js_1.SignedDecimal, v.description("Unrealized profit and loss.")),
103
+ unrealizedPnl: v.pipe(_base_js_1.Decimal, v.description("Unrealized profit and loss.")),
102
104
  /** Return on equity. */
103
- returnOnEquity: v.pipe(_base_js_1.SignedDecimal, v.description("Return on equity.")),
105
+ returnOnEquity: v.pipe(_base_js_1.Decimal, v.description("Return on equity.")),
104
106
  /** Liquidation price. */
105
107
  liquidationPx: v.pipe(v.union([_base_js_1.UnsignedDecimal, v.null()]), v.description("Liquidation price.")),
106
108
  /** Margin used. */
107
109
  marginUsed: v.pipe(_base_js_1.UnsignedDecimal, v.description("Margin used.")),
108
110
  /** Maximum allowed leverage. */
109
- maxLeverage: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Maximum allowed leverage.")),
111
+ maxLeverage: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Maximum allowed leverage.")),
110
112
  /** Cumulative funding details. */
111
- cumFunding: v.pipe(v.strictObject({
113
+ cumFunding: v.pipe(v.object({
112
114
  /** Total funding paid or received since account opening. */
113
- allTime: v.pipe(_base_js_1.SignedDecimal, v.description("Total funding paid or received since account opening.")),
115
+ allTime: v.pipe(_base_js_1.Decimal, v.description("Total funding paid or received since account opening.")),
114
116
  /** Funding accumulated since the position was opened. */
115
- sinceOpen: v.pipe(_base_js_1.SignedDecimal, v.description("Funding accumulated since the position was opened.")),
117
+ sinceOpen: v.pipe(_base_js_1.Decimal, v.description("Funding accumulated since the position was opened.")),
116
118
  /** Funding accumulated since the last change in position size. */
117
- sinceChange: v.pipe(_base_js_1.SignedDecimal, v.description("Funding accumulated since the last change in position size.")),
119
+ sinceChange: v.pipe(_base_js_1.Decimal, v.description("Funding accumulated since the last change in position size.")),
118
120
  }), v.description("Cumulative funding details.")),
119
121
  }), v.description("Position details.")),
120
122
  }), v.description("Position for a specific asset."));
121
123
  /** Escrowed balance for a specific asset. */
122
- exports.EvmEscrowsBalance = v.pipe(v.strictObject({
124
+ exports.EvmEscrowsBalance = v.pipe(v.object({
123
125
  /** Asset symbol. */
124
126
  coin: v.pipe(v.string(), v.description("Asset symbol.")),
125
127
  /** Unique identifier for the token. */
126
- token: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Unique identifier for the token.")),
128
+ token: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique identifier for the token.")),
127
129
  /** Total balance. */
128
130
  total: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total balance.")),
129
131
  }), v.description("Escrowed balance for a specific asset."));
130
132
  /** Extra agent details for a user. */
131
- exports.ExtraAgent = v.pipe(v.strictObject({
133
+ exports.ExtraAgent = v.pipe(v.object({
132
134
  /** Extra agent address. */
133
135
  address: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Extra agent address.")),
134
136
  /** Extra agent name. */
135
137
  name: v.pipe(v.string(), v.minLength(1), v.description("Extra agent name.")),
136
138
  /** Validity period as a timestamp (in ms since epoch). */
137
- validUntil: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Validity period as a timestamp (in ms since epoch).")),
139
+ validUntil: v.pipe(_base_js_1.UnsignedInteger, v.description("Validity period as a timestamp (in ms since epoch).")),
138
140
  }), v.description("Extra agent details for a user."));
139
141
  /** Legal verification status for a user. */
140
- exports.LegalCheck = v.pipe(v.strictObject({
142
+ exports.LegalCheck = v.pipe(v.object({
141
143
  /** Whether the user IP address is allowed. */
142
144
  ipAllowed: v.pipe(v.boolean(), v.description("Whether the user IP address is allowed.")),
143
145
  /** Whether the user has accepted the terms of service. */
@@ -146,16 +148,16 @@ exports.LegalCheck = v.pipe(v.strictObject({
146
148
  userAllowed: v.pipe(v.boolean(), v.description("Whether the user is allowed to use the platform.")),
147
149
  }), v.description("Legal verification status for a user."));
148
150
  /** Multi-sig signers for a user. */
149
- exports.MultiSigSigners = v.pipe(v.strictObject({
151
+ exports.MultiSigSigners = v.pipe(v.object({
150
152
  /** Authorized users addresses. */
151
153
  authorizedUsers: v.pipe(v.array(v.pipe(_base_js_1.Hex, v.length(42))), v.minLength(1), v.description("Authorized users addresses.")),
152
154
  /** Threshold number of signatures required. */
153
- threshold: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Threshold number of signatures required.")),
155
+ threshold: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Threshold number of signatures required.")),
154
156
  }), v.description("Multi-sig signers for a user."));
155
157
  /** Account summary for perpetual trading. */
156
- exports.PerpsClearinghouseState = v.pipe(v.strictObject({
158
+ exports.PerpsClearinghouseState = v.pipe(v.object({
157
159
  /** Margin summary details. */
158
- marginSummary: v.pipe(v.strictObject({
160
+ marginSummary: v.pipe(v.object({
159
161
  /** Total account value. */
160
162
  accountValue: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total account value.")),
161
163
  /** Total notional position value. */
@@ -166,7 +168,7 @@ exports.PerpsClearinghouseState = v.pipe(v.strictObject({
166
168
  totalMarginUsed: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total margin used.")),
167
169
  }), v.description("Margin summary details.")),
168
170
  /** Cross-margin summary details. */
169
- crossMarginSummary: v.pipe(v.strictObject({
171
+ crossMarginSummary: v.pipe(v.object({
170
172
  /** Total account value. */
171
173
  accountValue: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total account value.")),
172
174
  /** Total notional position value. */
@@ -183,30 +185,30 @@ exports.PerpsClearinghouseState = v.pipe(v.strictObject({
183
185
  /** List of asset positions. */
184
186
  assetPositions: v.pipe(v.array(exports.AssetPosition), v.description("List of asset positions.")),
185
187
  /** Timestamp when data was retrieved (in ms since epoch). */
186
- time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when data was retrieved (in ms since epoch).")),
188
+ time: v.pipe(_base_js_1.UnsignedInteger, v.description("Timestamp when data was retrieved (in ms since epoch).")),
187
189
  }), v.description("Account summary for perpetual trading."));
188
190
  /** Portfolio metrics snapshot. */
189
- exports.Portfolio = v.pipe(v.strictObject({
191
+ exports.Portfolio = v.pipe(v.object({
190
192
  /** History entries for account value as [timestamp, value]. */
191
- accountValueHistory: v.pipe(v.array(v.strictTuple([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), _base_js_1.UnsignedDecimal])), v.description("History entries for account value as [timestamp, value].")),
193
+ accountValueHistory: v.pipe(v.array(v.tuple([_base_js_1.UnsignedInteger, _base_js_1.UnsignedDecimal])), v.description("History entries for account value as [timestamp, value].")),
192
194
  /** History entries for profit and loss as [timestamp, value]. */
193
- pnlHistory: v.pipe(v.array(v.strictTuple([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), _base_js_1.SignedDecimal])), v.description("History entries for profit and loss as [timestamp, value].")),
195
+ pnlHistory: v.pipe(v.array(v.tuple([_base_js_1.UnsignedInteger, _base_js_1.Decimal])), v.description("History entries for profit and loss as [timestamp, value].")),
194
196
  /** Volume metric for the portfolio. */
195
197
  vlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Volume metric for the portfolio.")),
196
198
  }), v.description("Portfolio metrics snapshot."));
197
199
  /** Portfolio metrics grouped by time periods. */
198
- exports.PortfolioPeriods = v.pipe(v.strictTuple([
199
- v.strictTuple([v.literal("day"), exports.Portfolio]),
200
- v.strictTuple([v.literal("week"), exports.Portfolio]),
201
- v.strictTuple([v.literal("month"), exports.Portfolio]),
202
- v.strictTuple([v.literal("allTime"), exports.Portfolio]),
203
- v.strictTuple([v.literal("perpDay"), exports.Portfolio]),
204
- v.strictTuple([v.literal("perpWeek"), exports.Portfolio]),
205
- v.strictTuple([v.literal("perpMonth"), exports.Portfolio]),
206
- v.strictTuple([v.literal("perpAllTime"), exports.Portfolio]),
200
+ exports.PortfolioPeriods = v.pipe(v.tuple([
201
+ v.tuple([v.literal("day"), exports.Portfolio]),
202
+ v.tuple([v.literal("week"), exports.Portfolio]),
203
+ v.tuple([v.literal("month"), exports.Portfolio]),
204
+ v.tuple([v.literal("allTime"), exports.Portfolio]),
205
+ v.tuple([v.literal("perpDay"), exports.Portfolio]),
206
+ v.tuple([v.literal("perpWeek"), exports.Portfolio]),
207
+ v.tuple([v.literal("perpMonth"), exports.Portfolio]),
208
+ v.tuple([v.literal("perpAllTime"), exports.Portfolio]),
207
209
  ]), v.description("Portfolio metrics grouped by time periods."));
208
210
  /** Pre-transfer user existence check result. */
209
- exports.PreTransferCheck = v.pipe(v.strictObject({
211
+ exports.PreTransferCheck = v.pipe(v.object({
210
212
  /** Activation fee. */
211
213
  fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Activation fee.")),
212
214
  /** Whether the user is sanctioned. */
@@ -217,10 +219,10 @@ exports.PreTransferCheck = v.pipe(v.strictObject({
217
219
  userHasSentTx: v.pipe(v.boolean(), v.description("Whether the user has sent a transaction.")),
218
220
  }), v.description("Pre-transfer user existence check result."));
219
221
  /** Referral details for a user. */
220
- exports.Referral = v.pipe(v.strictObject({
222
+ exports.Referral = v.pipe(v.object({
221
223
  /** Referrer details. */
222
224
  referredBy: v.pipe(v.union([
223
- v.strictObject({
225
+ v.object({
224
226
  /** Referrer address. */
225
227
  referrer: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Referrer address.")),
226
228
  /** Referral code used. */
@@ -238,17 +240,17 @@ exports.Referral = v.pipe(v.strictObject({
238
240
  builderRewards: v.pipe(_base_js_1.UnsignedDecimal, v.description("Builder reward amount.")),
239
241
  /** Current state of the referrer. */
240
242
  referrerState: v.pipe(v.union([
241
- v.strictObject({
243
+ v.object({
242
244
  /** Referrer is ready to receive rewards. */
243
245
  stage: v.pipe(v.literal("ready"), v.description("Referrer is ready to receive rewards.")),
244
246
  /** Referral program details. */
245
- data: v.pipe(v.strictObject({
247
+ data: v.pipe(v.object({
246
248
  /** Assigned referral code. */
247
249
  code: v.pipe(v.string(), v.minLength(1), v.description("Assigned referral code.")),
248
250
  /** Total number of referrals. */
249
- nReferrals: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Total number of referrals.")),
251
+ nReferrals: v.pipe(_base_js_1.UnsignedInteger, v.description("Total number of referrals.")),
250
252
  /** Summary of each referral state. */
251
- referralStates: v.pipe(v.array(v.strictObject({
253
+ referralStates: v.pipe(v.array(v.object({
252
254
  /** Cumulative traded volume. */
253
255
  cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative traded volume.")),
254
256
  /** Total fees rewarded to the referred user since referral. */
@@ -256,13 +258,13 @@ exports.Referral = v.pipe(v.strictObject({
256
258
  /** Total fees rewarded to the referrer from referred trades. */
257
259
  cumFeesRewardedToReferrer: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total fees rewarded to the referrer from referred trades.")),
258
260
  /** Timestamp when the referred user joined (in ms since epoch). */
259
- timeJoined: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when the referred user joined (in ms since epoch).")),
261
+ timeJoined: v.pipe(_base_js_1.UnsignedInteger, v.description("Timestamp when the referred user joined (in ms since epoch).")),
260
262
  /** Address of the referred user. */
261
263
  user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the referred user.")),
262
264
  /** Mapping of token IDs to referral reward states. */
263
- tokenToState: v.pipe(v.array(v.strictTuple([
264
- v.pipe(v.number(), v.safeInteger(), v.minValue(0)),
265
- v.strictObject({
265
+ tokenToState: v.pipe(v.array(v.tuple([
266
+ _base_js_1.UnsignedInteger,
267
+ v.object({
266
268
  /** Cumulative traded volume. */
267
269
  cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative traded volume.")),
268
270
  /** Total fees rewarded to the referred user since referral. */
@@ -274,22 +276,22 @@ exports.Referral = v.pipe(v.strictObject({
274
276
  })), v.description("Summary of each referral state.")),
275
277
  }), v.description("Referral program details.")),
276
278
  }),
277
- v.strictObject({
279
+ v.object({
278
280
  /** Referrer needs to create a referral code. */
279
281
  stage: v.pipe(v.literal("needToCreateCode"), v.description("Referrer needs to create a referral code.")),
280
282
  }),
281
- v.strictObject({
283
+ v.object({
282
284
  /** Referrer must complete a trade before earning rewards. */
283
285
  stage: v.pipe(v.literal("needToTrade"), v.description("Referrer must complete a trade before earning rewards.")),
284
286
  /** Required trading volume details for activation. */
285
- data: v.pipe(v.strictObject({
287
+ data: v.pipe(v.object({
286
288
  /** Required trading volume. */
287
289
  required: v.pipe(_base_js_1.UnsignedDecimal, v.description("Required trading volume.")),
288
290
  }), v.description("Required trading volume details for activation.")),
289
291
  }),
290
292
  ]), v.description("Current state of the referrer.")),
291
293
  /** History of referral rewards. */
292
- rewardHistory: v.pipe(v.array(v.strictObject({
294
+ rewardHistory: v.pipe(v.array(v.object({
293
295
  /** Amount of earned rewards. */
294
296
  earned: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of earned rewards.")),
295
297
  /** Traded volume at the time of reward. */
@@ -297,12 +299,12 @@ exports.Referral = v.pipe(v.strictObject({
297
299
  /** Traded volume via referrals. */
298
300
  referralVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Traded volume via referrals.")),
299
301
  /** Timestamp when the reward was earned (in ms since epoch). */
300
- time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when the reward was earned (in ms since epoch).")),
302
+ time: v.pipe(_base_js_1.UnsignedInteger, v.description("Timestamp when the reward was earned (in ms since epoch).")),
301
303
  })), v.description("History of referral rewards.")),
302
304
  /** Mapping of token IDs to referral reward states. */
303
- tokenToState: v.pipe(v.array(v.strictTuple([
304
- v.pipe(v.number(), v.safeInteger(), v.minValue(0)),
305
- v.strictObject({
305
+ tokenToState: v.pipe(v.array(v.tuple([
306
+ _base_js_1.UnsignedInteger,
307
+ v.object({
306
308
  /** Cumulative traded volume. */
307
309
  cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative traded volume.")),
308
310
  /** Rewards earned but not yet claimed. */
@@ -315,11 +317,11 @@ exports.Referral = v.pipe(v.strictObject({
315
317
  ])), v.description("Mapping of token IDs to referral reward states.")),
316
318
  }), v.description("Referral details for a user."));
317
319
  /** Balance for a specific spot token. */
318
- exports.SpotBalance = v.pipe(v.strictObject({
320
+ exports.SpotBalance = v.pipe(v.object({
319
321
  /** Asset symbol. */
320
322
  coin: v.pipe(v.string(), v.description("Asset symbol.")),
321
323
  /** Unique identifier for the token. */
322
- token: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Unique identifier for the token.")),
324
+ token: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique identifier for the token.")),
323
325
  /** Total balance. */
324
326
  total: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total balance.")),
325
327
  /** Amount on hold. */
@@ -328,14 +330,14 @@ exports.SpotBalance = v.pipe(v.strictObject({
328
330
  entryNtl: v.pipe(_base_js_1.UnsignedDecimal, v.description("Entry notional value.")),
329
331
  }), v.description("Balance for a specific spot token."));
330
332
  /** Account summary for spot trading. */
331
- exports.SpotClearinghouseState = v.pipe(v.strictObject({
333
+ exports.SpotClearinghouseState = v.pipe(v.object({
332
334
  /** Balance for each token. */
333
335
  balances: v.pipe(v.array(exports.SpotBalance), v.description("Balance for each token.")),
334
336
  /** Escrowed balances. */
335
337
  evmEscrows: v.pipe(v.optional(v.array(exports.EvmEscrowsBalance)), v.description("Escrowed balances.")),
336
338
  }), v.description("Account summary for spot trading."));
337
339
  /** Sub-account details for a user. */
338
- exports.SubAccount = v.pipe(v.strictObject({
340
+ exports.SubAccount = v.pipe(v.object({
339
341
  /** Sub-account name. */
340
342
  name: v.pipe(v.string(), v.minLength(1), v.description("Sub-account name.")),
341
343
  /** Sub-account address. */
@@ -348,9 +350,9 @@ exports.SubAccount = v.pipe(v.strictObject({
348
350
  spotState: v.pipe(exports.SpotClearinghouseState, v.description("Spot tokens clearinghouse state.")),
349
351
  }), v.description("Sub-account details for a user."));
350
352
  /** User fees. */
351
- exports.UserFees = v.pipe(v.strictObject({
353
+ exports.UserFees = v.pipe(v.object({
352
354
  /** Daily user volume metrics. */
353
- dailyUserVlm: v.pipe(v.array(v.strictObject({
355
+ dailyUserVlm: v.pipe(v.array(v.object({
354
356
  /** Date in YYYY-M-D format. */
355
357
  date: v.pipe(v.string(), v.isoDate(), v.description("Date in YYYY-M-D format.")),
356
358
  /** User cross-trade volume. */
@@ -361,7 +363,7 @@ exports.UserFees = v.pipe(v.strictObject({
361
363
  exchange: v.pipe(_base_js_1.UnsignedDecimal, v.description("Exchange total volume.")),
362
364
  })), v.description("Daily user volume metrics.")),
363
365
  /** Fee schedule information. */
364
- feeSchedule: v.pipe(v.strictObject({
366
+ feeSchedule: v.pipe(v.object({
365
367
  /** Cross-trade fee rate. */
366
368
  cross: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cross-trade fee rate.")),
367
369
  /** Add-liquidity fee rate. */
@@ -371,9 +373,9 @@ exports.UserFees = v.pipe(v.strictObject({
371
373
  /** Spot add-liquidity fee rate. */
372
374
  spotAdd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Spot add-liquidity fee rate.")),
373
375
  /** Fee tiers details. */
374
- tiers: v.pipe(v.strictObject({
376
+ tiers: v.pipe(v.object({
375
377
  /** VIP fee tier information. */
376
- vip: v.pipe(v.array(v.strictObject({
378
+ vip: v.pipe(v.array(v.object({
377
379
  /** Notional volume cutoff. */
378
380
  ntlCutoff: v.pipe(_base_js_1.UnsignedDecimal, v.description("Notional volume cutoff.")),
379
381
  /** Cross-trade fee rate. */
@@ -386,17 +388,17 @@ exports.UserFees = v.pipe(v.strictObject({
386
388
  spotAdd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Spot add-liquidity fee rate.")),
387
389
  })), v.description("VIP fee tier information.")),
388
390
  /** Market maker fee tier information. */
389
- mm: v.pipe(v.array(v.strictObject({
391
+ mm: v.pipe(v.array(v.object({
390
392
  /** Maker fraction cutoff. */
391
393
  makerFractionCutoff: v.pipe(_base_js_1.UnsignedDecimal, v.description("Maker fraction cutoff.")),
392
394
  /** Add-liquidity fee rate. */
393
- add: v.pipe(_base_js_1.SignedDecimal, v.description("Add-liquidity fee rate.")),
395
+ add: v.pipe(_base_js_1.Decimal, v.description("Add-liquidity fee rate.")),
394
396
  })), v.description("Market maker fee tier information.")),
395
397
  }), v.description("Fee tiers details.")),
396
398
  /** Referral discount rate. */
397
399
  referralDiscount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Referral discount rate.")),
398
400
  /** Staking discount tiers details. */
399
- stakingDiscountTiers: v.pipe(v.array(v.strictObject({
401
+ stakingDiscountTiers: v.pipe(v.array(v.object({
400
402
  /** Basis points of maximum supply. */
401
403
  bpsOfMaxSupply: v.pipe(_base_js_1.UnsignedDecimal, v.description("Basis points of maximum supply.")),
402
404
  /** Discount rate applied. */
@@ -421,7 +423,7 @@ exports.UserFees = v.pipe(v.strictObject({
421
423
  nextTrialAvailableTimestamp: v.pipe(v.union([v.unknown(), v.null()]), v.description("Timestamp when next trial becomes available.")),
422
424
  stakingLink: v.union([v.unknown(), v.null()]),
423
425
  /** Active staking discount details. */
424
- activeStakingDiscount: v.pipe(v.strictObject({
426
+ activeStakingDiscount: v.pipe(v.object({
425
427
  /** Basis points of maximum supply. */
426
428
  bpsOfMaxSupply: v.pipe(_base_js_1.UnsignedDecimal, v.description("Basis points of maximum supply.")),
427
429
  /** Discount rate applied. */
@@ -429,65 +431,65 @@ exports.UserFees = v.pipe(v.strictObject({
429
431
  }), v.description("Active staking discount details.")),
430
432
  }), v.description("User fees."));
431
433
  /** Funding update details. */
432
- exports.FundingUpdate = v.pipe(v.strictObject({
434
+ exports.FundingUpdate = v.pipe(v.object({
433
435
  /** Update type. */
434
436
  type: v.pipe(v.literal("funding"), v.description("Update type.")),
435
437
  /** Asset symbol. */
436
438
  coin: v.pipe(v.string(), v.description("Asset symbol.")),
437
439
  /** Amount transferred in USDC. */
438
- usdc: v.pipe(_base_js_1.SignedDecimal, v.description("Amount transferred in USDC.")),
440
+ usdc: v.pipe(_base_js_1.Decimal, v.description("Amount transferred in USDC.")),
439
441
  /** Signed position size. */
440
- szi: v.pipe(_base_js_1.SignedDecimal, v.description("Signed position size.")),
442
+ szi: v.pipe(_base_js_1.Decimal, v.description("Signed position size.")),
441
443
  /** Applied funding rate. */
442
- fundingRate: v.pipe(_base_js_1.SignedDecimal, v.description("Applied funding rate.")),
444
+ fundingRate: v.pipe(_base_js_1.Decimal, v.description("Applied funding rate.")),
443
445
  /** Number of samples. */
444
- nSamples: v.pipe(v.union([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.null()]), v.description("Number of samples.")),
446
+ nSamples: v.pipe(v.union([_base_js_1.UnsignedInteger, v.null()]), v.description("Number of samples.")),
445
447
  }), v.description("Funding update details."));
446
448
  /** Funding ledger update for a user. */
447
- exports.UserFundingUpdate = v.pipe(v.strictObject({
449
+ exports.UserFundingUpdate = v.pipe(v.object({
448
450
  /** Timestamp of the update (in ms since epoch). */
449
- time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp of the update (in ms since epoch).")),
451
+ time: v.pipe(_base_js_1.UnsignedInteger, v.description("Timestamp of the update (in ms since epoch).")),
450
452
  /** L1 transaction hash. */
451
453
  hash: v.pipe(v.pipe(_base_js_1.Hex, v.length(66)), v.description("L1 transaction hash.")),
452
454
  /** Update details. */
453
455
  delta: v.pipe(exports.FundingUpdate, v.description("Update details.")),
454
456
  }), v.description("Funding ledger update for a user."));
455
457
  /** User rate limits. */
456
- exports.UserRateLimit = v.pipe(v.strictObject({
458
+ exports.UserRateLimit = v.pipe(v.object({
457
459
  /** Cumulative trading volume. */
458
460
  cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative trading volume.")),
459
461
  /** Number of API requests used. */
460
- nRequestsUsed: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Number of API requests used.")),
462
+ nRequestsUsed: v.pipe(_base_js_1.UnsignedInteger, v.description("Number of API requests used.")),
461
463
  /** Maximum allowed API requests. */
462
- nRequestsCap: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Maximum allowed API requests.")),
464
+ nRequestsCap: v.pipe(_base_js_1.UnsignedInteger, v.description("Maximum allowed API requests.")),
463
465
  }), v.description("User rate limits."));
464
466
  /** User role. */
465
467
  exports.UserRole = v.pipe(v.union([
466
- v.strictObject({
468
+ v.object({
467
469
  /** Role identifier. */
468
470
  role: v.pipe(v.union([v.literal("missing"), v.literal("user"), v.literal("vault")]), v.description("Role identifier.")),
469
471
  }),
470
- v.strictObject({
472
+ v.object({
471
473
  /** Role identifier. */
472
474
  role: v.pipe(v.literal("agent"), v.description("Role identifier.")),
473
475
  /** Details for agent role. */
474
- data: v.pipe(v.strictObject({
476
+ data: v.pipe(v.object({
475
477
  /** Master account address associated with the agent. */
476
478
  user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Master account address associated with the agent.")),
477
479
  }), v.description("Details for agent role.")),
478
480
  }),
479
- v.strictObject({
481
+ v.object({
480
482
  /** Role identifier. */
481
483
  role: v.pipe(v.literal("subAccount"), v.description("Role identifier.")),
482
484
  /** Details for sub-account role. */
483
- data: v.pipe(v.strictObject({
485
+ data: v.pipe(v.object({
484
486
  /** Master account address associated with the sub-account. */
485
487
  master: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Master account address associated with the sub-account.")),
486
488
  }), v.description("Details for sub-account role.")),
487
489
  }),
488
490
  ]), v.description("User role."));
489
491
  /** Transfer between spot and perpetual accounts. */
490
- exports.AccountClassTransferUpdate = v.pipe(v.strictObject({
492
+ exports.AccountClassTransferUpdate = v.pipe(v.object({
491
493
  /** Update type. */
492
494
  type: v.pipe(v.literal("accountClassTransfer"), v.description("Update type.")),
493
495
  /** Amount transferred in USDC. */
@@ -496,14 +498,14 @@ exports.AccountClassTransferUpdate = v.pipe(v.strictObject({
496
498
  toPerp: v.pipe(v.boolean(), v.description("Indicates if the transfer is to the perpetual account.")),
497
499
  }), v.description("Transfer between spot and perpetual accounts."));
498
500
  /** Deposit update to an account. */
499
- exports.DepositUpdate = v.pipe(v.strictObject({
501
+ exports.DepositUpdate = v.pipe(v.object({
500
502
  /** Update type. */
501
503
  type: v.pipe(v.literal("deposit"), v.description("Update type.")),
502
504
  /** Amount deposited in USDC. */
503
505
  usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount deposited in USDC.")),
504
506
  }), v.description("Deposit update to an account."));
505
507
  /** Internal transfer between accounts. */
506
- exports.InternalTransferUpdate = v.pipe(v.strictObject({
508
+ exports.InternalTransferUpdate = v.pipe(v.object({
507
509
  /** Update type. */
508
510
  type: v.pipe(v.literal("internalTransfer"), v.description("Update type.")),
509
511
  /** Amount transferred in USDC. */
@@ -516,7 +518,7 @@ exports.InternalTransferUpdate = v.pipe(v.strictObject({
516
518
  fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Transfer fee.")),
517
519
  }), v.description("Internal transfer between accounts."));
518
520
  /** Liquidation event update. */
519
- exports.LiquidationUpdate = v.pipe(v.strictObject({
521
+ exports.LiquidationUpdate = v.pipe(v.object({
520
522
  /** Update type. */
521
523
  type: v.pipe(v.literal("liquidation"), v.description("Update type.")),
522
524
  /** Total notional value of liquidated positions. */
@@ -526,15 +528,15 @@ exports.LiquidationUpdate = v.pipe(v.strictObject({
526
528
  /** Leverage type for liquidated positions. */
527
529
  leverageType: v.pipe(v.union([v.literal("Cross"), v.literal("Isolated")]), v.description("Leverage type for liquidated positions.")),
528
530
  /** Details of each liquidated position. */
529
- liquidatedPositions: v.pipe(v.array(v.strictObject({
531
+ liquidatedPositions: v.pipe(v.array(v.object({
530
532
  /** Asset symbol of the liquidated position. */
531
533
  coin: v.pipe(v.string(), v.description("Asset symbol of the liquidated position.")),
532
534
  /** Signed position size liquidated. */
533
- szi: v.pipe(_base_js_1.SignedDecimal, v.description("Signed position size liquidated.")),
535
+ szi: v.pipe(_base_js_1.Decimal, v.description("Signed position size liquidated.")),
534
536
  })), v.description("Details of each liquidated position.")),
535
537
  }), v.description("Liquidation event update."));
536
538
  /** Rewards claim event update. */
537
- exports.RewardsClaimUpdate = v.pipe(v.strictObject({
539
+ exports.RewardsClaimUpdate = v.pipe(v.object({
538
540
  /** Update type. */
539
541
  type: v.pipe(v.literal("rewardsClaim"), v.description("Update type.")),
540
542
  /** Amount of rewards claimed. */
@@ -543,7 +545,7 @@ exports.RewardsClaimUpdate = v.pipe(v.strictObject({
543
545
  token: v.pipe(v.string(), v.description("Token symbol.")),
544
546
  }), v.description("Rewards claim event update."));
545
547
  /** Spot transfer update between accounts. */
546
- exports.SpotTransferUpdate = v.pipe(v.strictObject({
548
+ exports.SpotTransferUpdate = v.pipe(v.object({
547
549
  /** Update type. */
548
550
  type: v.pipe(v.literal("spotTransfer"), v.description("Update type.")),
549
551
  /** Token symbol. */
@@ -565,7 +567,7 @@ exports.SpotTransferUpdate = v.pipe(v.strictObject({
565
567
  feeToken: v.pipe(v.string(), v.description('Token in which the fee is denominated (e.g., "USDC").')),
566
568
  }), v.description("Spot transfer update between accounts."));
567
569
  /** Transfer update between sub-accounts. */
568
- exports.SubAccountTransferUpdate = v.pipe(v.strictObject({
570
+ exports.SubAccountTransferUpdate = v.pipe(v.object({
569
571
  /** Update type. */
570
572
  type: v.pipe(v.literal("subAccountTransfer"), v.description("Update type.")),
571
573
  /** Amount transferred in USDC. */
@@ -576,7 +578,7 @@ exports.SubAccountTransferUpdate = v.pipe(v.strictObject({
576
578
  destination: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Destination address.")),
577
579
  }), v.description("Transfer update between sub-accounts."));
578
580
  /** Vault creation update. */
579
- exports.VaultCreateUpdate = v.pipe(v.strictObject({
581
+ exports.VaultCreateUpdate = v.pipe(v.object({
580
582
  /** Update type. */
581
583
  type: v.pipe(v.literal("vaultCreate"), v.description("Update type.")),
582
584
  /** Address of the created vault. */
@@ -587,7 +589,7 @@ exports.VaultCreateUpdate = v.pipe(v.strictObject({
587
589
  fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Vault creation fee.")),
588
590
  }), v.description("Vault creation update."));
589
591
  /** Vault deposit update. */
590
- exports.VaultDepositUpdate = v.pipe(v.strictObject({
592
+ exports.VaultDepositUpdate = v.pipe(v.object({
591
593
  /** Update type. */
592
594
  type: v.pipe(v.literal("vaultDeposit"), v.description("Update type.")),
593
595
  /** Address of the target vault. */
@@ -596,7 +598,7 @@ exports.VaultDepositUpdate = v.pipe(v.strictObject({
596
598
  usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount deposited in USDC.")),
597
599
  }), v.description("Vault deposit update."));
598
600
  /** Vault distribution update. */
599
- exports.VaultDistributionUpdate = v.pipe(v.strictObject({
601
+ exports.VaultDistributionUpdate = v.pipe(v.object({
600
602
  /** Update type. */
601
603
  type: v.pipe(v.literal("vaultDistribution"), v.description("Update type.")),
602
604
  /** Address of the vault distributing funds. */
@@ -605,7 +607,7 @@ exports.VaultDistributionUpdate = v.pipe(v.strictObject({
605
607
  usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount distributed in USDC.")),
606
608
  }), v.description("Vault distribution update."));
607
609
  /** Vault withdrawal event update. */
608
- exports.VaultWithdrawUpdate = v.pipe(v.strictObject({
610
+ exports.VaultWithdrawUpdate = v.pipe(v.object({
609
611
  /** Update type. */
610
612
  type: v.pipe(v.literal("vaultWithdraw"), v.description("Update type.")),
611
613
  /** Vault address. */
@@ -624,20 +626,20 @@ exports.VaultWithdrawUpdate = v.pipe(v.strictObject({
624
626
  netWithdrawnUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Net withdrawn amount in USD after fees and costs.")),
625
627
  }), v.description("Vault withdrawal event update."));
626
628
  /** Withdrawal update from an account. */
627
- exports.WithdrawUpdate = v.pipe(v.strictObject({
629
+ exports.WithdrawUpdate = v.pipe(v.object({
628
630
  /** Update type. */
629
631
  type: v.pipe(v.literal("withdraw"), v.description("Update type.")),
630
632
  /** Amount withdrawn in USDC. */
631
633
  usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount withdrawn in USDC.")),
632
634
  /** Unique nonce for the withdrawal request. */
633
- nonce: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Unique nonce for the withdrawal request.")),
635
+ nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique nonce for the withdrawal request.")),
634
636
  /** Withdrawal fee. */
635
637
  fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Withdrawal fee.")),
636
638
  }), v.description("Withdrawal update from an account."));
637
639
  /** Non-funding ledger update for a user. */
638
- exports.UserNonFundingLedgerUpdate = v.pipe(v.strictObject({
640
+ exports.UserNonFundingLedgerUpdate = v.pipe(v.object({
639
641
  /** Timestamp of the update (in ms since epoch). */
640
- time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp of the update (in ms since epoch).")),
642
+ time: v.pipe(_base_js_1.UnsignedInteger, v.description("Timestamp of the update (in ms since epoch).")),
641
643
  /** L1 transaction hash. */
642
644
  hash: v.pipe(v.pipe(_base_js_1.Hex, v.length(66)), v.description("L1 transaction hash.")),
643
645
  /** Update details. */
@@ -656,3 +658,46 @@ exports.UserNonFundingLedgerUpdate = v.pipe(v.strictObject({
656
658
  exports.WithdrawUpdate,
657
659
  ]), v.description("Update details.")),
658
660
  }), v.description("Non-funding ledger update for a user."));
661
+ /** Comprehensive user and market data. */
662
+ exports.WebData2 = v.pipe(v.object({
663
+ /** Account summary for perpetual trading. */
664
+ clearinghouseState: v.pipe(exports.PerpsClearinghouseState, v.description("Account summary for perpetual trading.")),
665
+ /** Leading vaults information. */
666
+ leadingVaults: v.pipe(v.array(v.object({
667
+ /** Address of the vault. */
668
+ address: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the vault.")),
669
+ /** Name of the vault. */
670
+ name: v.pipe(v.string(), v.description("Name of the vault.")),
671
+ })), v.description("Leading vaults information.")),
672
+ /** Total equity in vaults. */
673
+ totalVaultEquity: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total equity in vaults.")),
674
+ /** User open orders with frontend information. */
675
+ openOrders: v.pipe(v.array(orders_js_1.FrontendOrder), v.description("User open orders with frontend information.")),
676
+ /** Agent address if one exists. */
677
+ agentAddress: v.pipe(v.union([v.pipe(_base_js_1.Hex, v.length(42)), v.null()]), v.description("Agent address if one exists.")),
678
+ /** Timestamp until which the agent is valid. */
679
+ agentValidUntil: v.pipe(v.union([_base_js_1.UnsignedInteger, v.null()]), v.description("Timestamp until which the agent is valid.")),
680
+ /** Cumulative ledger value. */
681
+ cumLedger: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative ledger value.")),
682
+ /** Metadata for perpetual assets. */
683
+ meta: v.pipe(assets_js_1.PerpsMeta, v.description("Metadata for perpetual assets.")),
684
+ /** Context information for perpetual assets. */
685
+ assetCtxs: v.pipe(v.array(assets_js_1.PerpsAssetCtx), v.description("Context information for perpetual assets.")),
686
+ /** Server timestamp (in ms since epoch). */
687
+ serverTime: v.pipe(_base_js_1.UnsignedInteger, v.description("Server timestamp (in ms since epoch).")),
688
+ /** Whether this account is a vault. */
689
+ isVault: v.pipe(v.boolean(), v.description("Whether this account is a vault.")),
690
+ /** User address. */
691
+ user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("User address.")),
692
+ /** TWAP states. */
693
+ twapStates: v.pipe(v.array(v.tuple([_base_js_1.UnsignedInteger, orders_js_1.TwapState])), v.description("TWAP states.")),
694
+ /** Account summary for spot trading. */
695
+ spotState: v.pipe(v.optional(exports.SpotClearinghouseState), v.description("Account summary for spot trading.")),
696
+ /** Context information for spot assets. */
697
+ spotAssetCtxs: v.pipe(v.array(assets_js_1.SpotAssetCtx), v.description("Context information for spot assets.")),
698
+ /** Whether the user has opted out of spot dusting. */
699
+ optOutOfSpotDusting: v.pipe(v.optional(v.literal(true)), v.description("Whether the user has opted out of spot dusting.")),
700
+ /** Assets currently at their open interest cap. */
701
+ perpsAtOpenInterestCap: v.pipe(v.optional(v.array(v.string())), v.description("Assets currently at their open interest cap.")),
702
+ }), v.description("Comprehensive user and market data."));
703
+ //# sourceMappingURL=accounts.js.map