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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/README.md +46 -14
  2. package/esm/mod.js +1 -0
  3. package/esm/mod.js.map +1 -0
  4. package/esm/src/clients/exchange.d.ts +0 -7
  5. package/esm/src/clients/exchange.d.ts.map +1 -1
  6. package/esm/src/clients/exchange.js +4 -5
  7. package/esm/src/clients/exchange.js.map +1 -0
  8. package/esm/src/clients/info.d.ts +64 -2
  9. package/esm/src/clients/info.d.ts.map +1 -1
  10. package/esm/src/clients/info.js +77 -1
  11. package/esm/src/clients/info.js.map +1 -0
  12. package/esm/src/clients/multiSign.js +2 -1
  13. package/esm/src/clients/multiSign.js.map +1 -0
  14. package/esm/src/clients/subscription.js +1 -0
  15. package/esm/src/clients/subscription.js.map +1 -0
  16. package/esm/src/errors.js +1 -0
  17. package/esm/src/errors.js.map +1 -0
  18. package/esm/src/schemas/_base.d.ts +6 -2
  19. package/esm/src/schemas/_base.d.ts.map +1 -1
  20. package/esm/src/schemas/_base.js +4 -1
  21. package/esm/src/schemas/_base.js.map +1 -0
  22. package/esm/src/schemas/exchange/requests.d.ts +284 -284
  23. package/esm/src/schemas/exchange/requests.js +260 -259
  24. package/esm/src/schemas/exchange/requests.js.map +1 -0
  25. package/esm/src/schemas/exchange/responses.d.ts +47 -47
  26. package/esm/src/schemas/exchange/responses.js +55 -54
  27. package/esm/src/schemas/exchange/responses.js.map +1 -0
  28. package/esm/src/schemas/explorer/requests.d.ts +3 -3
  29. package/esm/src/schemas/explorer/requests.js +6 -5
  30. package/esm/src/schemas/explorer/requests.js.map +1 -0
  31. package/esm/src/schemas/explorer/responses.d.ts +10 -10
  32. package/esm/src/schemas/explorer/responses.js +12 -11
  33. package/esm/src/schemas/explorer/responses.js.map +1 -0
  34. package/esm/src/schemas/info/accounts.d.ts +121 -121
  35. package/esm/src/schemas/info/accounts.js +110 -109
  36. package/esm/src/schemas/info/accounts.js.map +1 -0
  37. package/esm/src/schemas/info/assets.d.ts +68 -39
  38. package/esm/src/schemas/info/assets.d.ts.map +1 -1
  39. package/esm/src/schemas/info/assets.js +69 -49
  40. package/esm/src/schemas/info/assets.js.map +1 -0
  41. package/esm/src/schemas/info/markets.d.ts +25 -8
  42. package/esm/src/schemas/info/markets.d.ts.map +1 -1
  43. package/esm/src/schemas/info/markets.js +27 -15
  44. package/esm/src/schemas/info/markets.js.map +1 -0
  45. package/esm/src/schemas/info/orders.d.ts +56 -56
  46. package/esm/src/schemas/info/orders.js +37 -36
  47. package/esm/src/schemas/info/orders.js.map +1 -0
  48. package/esm/src/schemas/info/requests.d.ts +98 -56
  49. package/esm/src/schemas/info/requests.d.ts.map +1 -1
  50. package/esm/src/schemas/info/requests.js +103 -71
  51. package/esm/src/schemas/info/requests.js.map +1 -0
  52. package/esm/src/schemas/info/validators.d.ts +44 -23
  53. package/esm/src/schemas/info/validators.d.ts.map +1 -1
  54. package/esm/src/schemas/info/validators.js +40 -26
  55. package/esm/src/schemas/info/validators.js.map +1 -0
  56. package/esm/src/schemas/info/vaults.d.ts +40 -40
  57. package/esm/src/schemas/info/vaults.js +20 -19
  58. package/esm/src/schemas/info/vaults.js.map +1 -0
  59. package/esm/src/schemas/mod.d.ts +1 -0
  60. package/esm/src/schemas/mod.d.ts.map +1 -1
  61. package/esm/src/schemas/mod.js +2 -0
  62. package/esm/src/schemas/mod.js.map +1 -0
  63. package/esm/src/schemas/subscriptions/requests.d.ts +21 -21
  64. package/esm/src/schemas/subscriptions/requests.js +22 -21
  65. package/esm/src/schemas/subscriptions/requests.js.map +1 -0
  66. package/esm/src/schemas/subscriptions/responses.d.ts +192 -192
  67. package/esm/src/schemas/subscriptions/responses.js +41 -40
  68. package/esm/src/schemas/subscriptions/responses.js.map +1 -0
  69. package/esm/src/signing/_signTypedData/ethers.js +1 -0
  70. package/esm/src/signing/_signTypedData/ethers.js.map +1 -0
  71. package/esm/src/signing/_signTypedData/mod.js +1 -0
  72. package/esm/src/signing/_signTypedData/mod.js.map +1 -0
  73. package/esm/src/signing/_signTypedData/private_key.js +1 -0
  74. package/esm/src/signing/_signTypedData/private_key.js.map +1 -0
  75. package/esm/src/signing/_signTypedData/viem.js +1 -0
  76. package/esm/src/signing/_signTypedData/viem.js.map +1 -0
  77. package/esm/src/signing/mod.js +1 -0
  78. package/esm/src/signing/mod.js.map +1 -0
  79. package/esm/src/transports/base.d.ts +2 -2
  80. package/esm/src/transports/base.d.ts.map +1 -1
  81. package/esm/src/transports/base.js +1 -0
  82. package/esm/src/transports/base.js.map +1 -0
  83. package/esm/src/transports/http/http_transport.d.ts +1 -1
  84. package/esm/src/transports/http/http_transport.js +1 -0
  85. package/esm/src/transports/http/http_transport.js.map +1 -0
  86. package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -0
  87. package/esm/src/transports/websocket/_hyperliquid_event_target.js.map +1 -0
  88. package/esm/src/transports/websocket/_reconnecting_websocket.js +1 -0
  89. package/esm/src/transports/websocket/_reconnecting_websocket.js.map +1 -0
  90. package/esm/src/transports/websocket/_websocket_async_request.js +1 -0
  91. package/esm/src/transports/websocket/_websocket_async_request.js.map +1 -0
  92. package/esm/src/transports/websocket/websocket_transport.d.ts +7 -0
  93. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  94. package/esm/src/transports/websocket/websocket_transport.js +4 -0
  95. package/esm/src/transports/websocket/websocket_transport.js.map +1 -0
  96. package/package.json +1 -1
  97. package/script/mod.js +1 -0
  98. package/script/mod.js.map +1 -0
  99. package/script/src/clients/exchange.d.ts +0 -7
  100. package/script/src/clients/exchange.d.ts.map +1 -1
  101. package/script/src/clients/exchange.js +4 -5
  102. package/script/src/clients/exchange.js.map +1 -0
  103. package/script/src/clients/info.d.ts +64 -2
  104. package/script/src/clients/info.d.ts.map +1 -1
  105. package/script/src/clients/info.js +76 -0
  106. package/script/src/clients/info.js.map +1 -0
  107. package/script/src/clients/multiSign.js +2 -1
  108. package/script/src/clients/multiSign.js.map +1 -0
  109. package/script/src/clients/subscription.js +1 -0
  110. package/script/src/clients/subscription.js.map +1 -0
  111. package/script/src/errors.js +1 -0
  112. package/script/src/errors.js.map +1 -0
  113. package/script/src/schemas/_base.d.ts +6 -2
  114. package/script/src/schemas/_base.d.ts.map +1 -1
  115. package/script/src/schemas/_base.js +5 -2
  116. package/script/src/schemas/_base.js.map +1 -0
  117. package/script/src/schemas/exchange/requests.d.ts +284 -284
  118. package/script/src/schemas/exchange/requests.js +259 -258
  119. package/script/src/schemas/exchange/requests.js.map +1 -0
  120. package/script/src/schemas/exchange/responses.d.ts +47 -47
  121. package/script/src/schemas/exchange/responses.js +54 -53
  122. package/script/src/schemas/exchange/responses.js.map +1 -0
  123. package/script/src/schemas/explorer/requests.d.ts +3 -3
  124. package/script/src/schemas/explorer/requests.js +5 -4
  125. package/script/src/schemas/explorer/requests.js.map +1 -0
  126. package/script/src/schemas/explorer/responses.d.ts +10 -10
  127. package/script/src/schemas/explorer/responses.js +11 -10
  128. package/script/src/schemas/explorer/responses.js.map +1 -0
  129. package/script/src/schemas/info/accounts.d.ts +121 -121
  130. package/script/src/schemas/info/accounts.js +109 -108
  131. package/script/src/schemas/info/accounts.js.map +1 -0
  132. package/script/src/schemas/info/assets.d.ts +68 -39
  133. package/script/src/schemas/info/assets.d.ts.map +1 -1
  134. package/script/src/schemas/info/assets.js +69 -49
  135. package/script/src/schemas/info/assets.js.map +1 -0
  136. package/script/src/schemas/info/markets.d.ts +25 -8
  137. package/script/src/schemas/info/markets.d.ts.map +1 -1
  138. package/script/src/schemas/info/markets.js +27 -15
  139. package/script/src/schemas/info/markets.js.map +1 -0
  140. package/script/src/schemas/info/orders.d.ts +56 -56
  141. package/script/src/schemas/info/orders.js +36 -35
  142. package/script/src/schemas/info/orders.js.map +1 -0
  143. package/script/src/schemas/info/requests.d.ts +98 -56
  144. package/script/src/schemas/info/requests.d.ts.map +1 -1
  145. package/script/src/schemas/info/requests.js +103 -71
  146. package/script/src/schemas/info/requests.js.map +1 -0
  147. package/script/src/schemas/info/validators.d.ts +44 -23
  148. package/script/src/schemas/info/validators.d.ts.map +1 -1
  149. package/script/src/schemas/info/validators.js +40 -26
  150. package/script/src/schemas/info/validators.js.map +1 -0
  151. package/script/src/schemas/info/vaults.d.ts +40 -40
  152. package/script/src/schemas/info/vaults.js +19 -18
  153. package/script/src/schemas/info/vaults.js.map +1 -0
  154. package/script/src/schemas/mod.d.ts +1 -0
  155. package/script/src/schemas/mod.d.ts.map +1 -1
  156. package/script/src/schemas/mod.js +4 -1
  157. package/script/src/schemas/mod.js.map +1 -0
  158. package/script/src/schemas/subscriptions/requests.d.ts +21 -21
  159. package/script/src/schemas/subscriptions/requests.js +22 -21
  160. package/script/src/schemas/subscriptions/requests.js.map +1 -0
  161. package/script/src/schemas/subscriptions/responses.d.ts +192 -192
  162. package/script/src/schemas/subscriptions/responses.js +40 -39
  163. package/script/src/schemas/subscriptions/responses.js.map +1 -0
  164. package/script/src/signing/_signTypedData/ethers.js +1 -0
  165. package/script/src/signing/_signTypedData/ethers.js.map +1 -0
  166. package/script/src/signing/_signTypedData/mod.js +1 -0
  167. package/script/src/signing/_signTypedData/mod.js.map +1 -0
  168. package/script/src/signing/_signTypedData/private_key.js +1 -0
  169. package/script/src/signing/_signTypedData/private_key.js.map +1 -0
  170. package/script/src/signing/_signTypedData/viem.js +1 -0
  171. package/script/src/signing/_signTypedData/viem.js.map +1 -0
  172. package/script/src/signing/mod.js +1 -0
  173. package/script/src/signing/mod.js.map +1 -0
  174. package/script/src/transports/base.d.ts +2 -2
  175. package/script/src/transports/base.d.ts.map +1 -1
  176. package/script/src/transports/base.js +1 -0
  177. package/script/src/transports/base.js.map +1 -0
  178. package/script/src/transports/http/http_transport.d.ts +1 -1
  179. package/script/src/transports/http/http_transport.js +1 -0
  180. package/script/src/transports/http/http_transport.js.map +1 -0
  181. package/script/src/transports/websocket/_hyperliquid_event_target.js +1 -0
  182. package/script/src/transports/websocket/_hyperliquid_event_target.js.map +1 -0
  183. package/script/src/transports/websocket/_reconnecting_websocket.js +1 -0
  184. package/script/src/transports/websocket/_reconnecting_websocket.js.map +1 -0
  185. package/script/src/transports/websocket/_websocket_async_request.js +1 -0
  186. package/script/src/transports/websocket/_websocket_async_request.js.map +1 -0
  187. package/script/src/transports/websocket/websocket_transport.d.ts +7 -0
  188. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  189. package/script/src/transports/websocket/websocket_transport.js +4 -0
  190. package/script/src/transports/websocket/websocket_transport.js.map +1 -0
  191. package/src/mod.ts +28 -0
  192. package/src/src/clients/exchange.ts +2246 -0
  193. package/src/src/clients/info.ts +2076 -0
  194. package/src/src/clients/multiSign.ts +183 -0
  195. package/src/src/clients/subscription.ts +841 -0
  196. package/src/src/errors.ts +7 -0
  197. package/src/src/schemas/_base.ts +43 -0
  198. package/src/src/schemas/exchange/requests.ts +3057 -0
  199. package/src/src/schemas/exchange/responses.ts +540 -0
  200. package/src/src/schemas/explorer/requests.ts +65 -0
  201. package/src/src/schemas/explorer/responses.ts +138 -0
  202. package/src/src/schemas/info/accounts.ts +1490 -0
  203. package/src/src/schemas/info/assets.ts +693 -0
  204. package/src/src/schemas/info/markets.ts +171 -0
  205. package/src/src/schemas/info/orders.ts +597 -0
  206. package/src/src/schemas/info/requests.ts +1369 -0
  207. package/src/src/schemas/info/validators.ts +299 -0
  208. package/src/src/schemas/info/vaults.ts +262 -0
  209. package/src/src/schemas/mod.ts +121 -0
  210. package/src/src/schemas/subscriptions/requests.ts +504 -0
  211. package/src/src/schemas/subscriptions/responses.ts +576 -0
  212. package/src/src/signing/_signTypedData/ethers.ts +59 -0
  213. package/src/src/signing/_signTypedData/mod.ts +121 -0
  214. package/src/src/signing/_signTypedData/private_key.ts +229 -0
  215. package/src/src/signing/_signTypedData/viem.ts +55 -0
  216. package/src/src/signing/mod.ts +572 -0
  217. package/src/src/transports/base.ts +54 -0
  218. package/src/src/transports/http/http_transport.ts +208 -0
  219. package/src/src/transports/websocket/_hyperliquid_event_target.ts +118 -0
  220. package/src/src/transports/websocket/_reconnecting_websocket.ts +404 -0
  221. package/src/src/transports/websocket/_websocket_async_request.ts +229 -0
  222. package/src/src/transports/websocket/websocket_transport.ts +394 -0
@@ -1,60 +1,60 @@
1
1
  import * as v from "valibot";
2
- import { Hex, SignedDecimal, UnsignedDecimal } from "../_base.js";
2
+ import { Decimal, Hex, UnsignedDecimal, UnsignedInteger } from "../_base.js";
3
3
  /** User active asset data. */
4
- export const ActiveAssetData = v.pipe(v.strictObject({
4
+ export const ActiveAssetData = v.pipe(v.object({
5
5
  /** User address. */
6
6
  user: v.pipe(v.pipe(Hex, v.length(42)), v.description("User address.")),
7
7
  /** Asset symbol (e.g., BTC). */
8
8
  coin: v.pipe(v.string(), v.description("Asset symbol (e.g., BTC).")),
9
9
  /** Leverage configuration. */
10
10
  leverage: v.pipe(v.union([
11
- v.strictObject({
11
+ v.object({
12
12
  /** Leverage type. */
13
13
  type: v.pipe(v.literal("isolated"), v.description("Leverage type.")),
14
14
  /** Leverage value used. */
15
- value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
15
+ value: v.pipe(UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
16
16
  /** Amount of USD used (1 = 1$). */
17
17
  rawUsd: v.pipe(UnsignedDecimal, v.description("Amount of USD used (1 = 1$).")),
18
18
  }),
19
- v.strictObject({
19
+ v.object({
20
20
  /** Leverage type. */
21
21
  type: v.pipe(v.literal("cross"), v.description("Leverage type.")),
22
22
  /** Leverage value used. */
23
- value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
23
+ value: v.pipe(UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
24
24
  }),
25
25
  ]), v.description("Leverage configuration.")),
26
26
  /** Maximum trade size range [min, max]. */
27
- maxTradeSzs: v.pipe(v.strictTuple([UnsignedDecimal, UnsignedDecimal]), v.description("Maximum trade size range [min, max].")),
27
+ maxTradeSzs: v.pipe(v.tuple([UnsignedDecimal, UnsignedDecimal]), v.description("Maximum trade size range [min, max].")),
28
28
  /** Available to trade range [min, max]. */
29
- availableToTrade: v.pipe(v.strictTuple([UnsignedDecimal, UnsignedDecimal]), v.description("Available to trade range [min, max].")),
29
+ availableToTrade: v.pipe(v.tuple([UnsignedDecimal, UnsignedDecimal]), v.description("Available to trade range [min, max].")),
30
30
  /** Mark price. */
31
31
  markPx: v.pipe(UnsignedDecimal, v.description("Mark price.")),
32
32
  }), v.description("User active asset data."));
33
33
  /** Position for a specific asset. */
34
- export const AssetPosition = v.pipe(v.strictObject({
34
+ export const AssetPosition = v.pipe(v.object({
35
35
  /** Position type. */
36
36
  type: v.pipe(v.literal("oneWay"), v.description("Position type.")),
37
37
  /** Position details. */
38
- position: v.pipe(v.strictObject({
38
+ position: v.pipe(v.object({
39
39
  /** Asset symbol. */
40
40
  coin: v.pipe(v.string(), v.description("Asset symbol.")),
41
41
  /** Signed position size. */
42
- szi: v.pipe(SignedDecimal, v.description("Signed position size.")),
42
+ szi: v.pipe(Decimal, v.description("Signed position size.")),
43
43
  /** Leverage details. */
44
44
  leverage: v.pipe(v.union([
45
- v.strictObject({
45
+ v.object({
46
46
  /** Leverage type. */
47
47
  type: v.pipe(v.literal("isolated"), v.description("Leverage type.")),
48
48
  /** Leverage value used. */
49
- value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
49
+ value: v.pipe(UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
50
50
  /** Amount of USD used (1 = 1$). */
51
51
  rawUsd: v.pipe(UnsignedDecimal, v.description("Amount of USD used (1 = 1$).")),
52
52
  }),
53
- v.strictObject({
53
+ v.object({
54
54
  /** Leverage type. */
55
55
  type: v.pipe(v.literal("cross"), v.description("Leverage type.")),
56
56
  /** Leverage value used. */
57
- value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
57
+ value: v.pipe(UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
58
58
  }),
59
59
  ]), v.description("Leverage details.")),
60
60
  /** Average entry price. */
@@ -62,46 +62,46 @@ export const AssetPosition = v.pipe(v.strictObject({
62
62
  /** Position value. */
63
63
  positionValue: v.pipe(UnsignedDecimal, v.description("Position value.")),
64
64
  /** Unrealized profit and loss. */
65
- unrealizedPnl: v.pipe(SignedDecimal, v.description("Unrealized profit and loss.")),
65
+ unrealizedPnl: v.pipe(Decimal, v.description("Unrealized profit and loss.")),
66
66
  /** Return on equity. */
67
- returnOnEquity: v.pipe(SignedDecimal, v.description("Return on equity.")),
67
+ returnOnEquity: v.pipe(Decimal, v.description("Return on equity.")),
68
68
  /** Liquidation price. */
69
69
  liquidationPx: v.pipe(v.union([UnsignedDecimal, v.null()]), v.description("Liquidation price.")),
70
70
  /** Margin used. */
71
71
  marginUsed: v.pipe(UnsignedDecimal, v.description("Margin used.")),
72
72
  /** Maximum allowed leverage. */
73
- maxLeverage: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Maximum allowed leverage.")),
73
+ maxLeverage: v.pipe(UnsignedInteger, v.minValue(1), v.description("Maximum allowed leverage.")),
74
74
  /** Cumulative funding details. */
75
- cumFunding: v.pipe(v.strictObject({
75
+ cumFunding: v.pipe(v.object({
76
76
  /** Total funding paid or received since account opening. */
77
- allTime: v.pipe(SignedDecimal, v.description("Total funding paid or received since account opening.")),
77
+ allTime: v.pipe(Decimal, v.description("Total funding paid or received since account opening.")),
78
78
  /** Funding accumulated since the position was opened. */
79
- sinceOpen: v.pipe(SignedDecimal, v.description("Funding accumulated since the position was opened.")),
79
+ sinceOpen: v.pipe(Decimal, v.description("Funding accumulated since the position was opened.")),
80
80
  /** Funding accumulated since the last change in position size. */
81
- sinceChange: v.pipe(SignedDecimal, v.description("Funding accumulated since the last change in position size.")),
81
+ sinceChange: v.pipe(Decimal, v.description("Funding accumulated since the last change in position size.")),
82
82
  }), v.description("Cumulative funding details.")),
83
83
  }), v.description("Position details.")),
84
84
  }), v.description("Position for a specific asset."));
85
85
  /** Escrowed balance for a specific asset. */
86
- export const EvmEscrowsBalance = v.pipe(v.strictObject({
86
+ export const EvmEscrowsBalance = v.pipe(v.object({
87
87
  /** Asset symbol. */
88
88
  coin: v.pipe(v.string(), v.description("Asset symbol.")),
89
89
  /** Unique identifier for the token. */
90
- token: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Unique identifier for the token.")),
90
+ token: v.pipe(UnsignedInteger, v.description("Unique identifier for the token.")),
91
91
  /** Total balance. */
92
92
  total: v.pipe(UnsignedDecimal, v.description("Total balance.")),
93
93
  }), v.description("Escrowed balance for a specific asset."));
94
94
  /** Extra agent details for a user. */
95
- export const ExtraAgent = v.pipe(v.strictObject({
95
+ export const ExtraAgent = v.pipe(v.object({
96
96
  /** Extra agent address. */
97
97
  address: v.pipe(v.pipe(Hex, v.length(42)), v.description("Extra agent address.")),
98
98
  /** Extra agent name. */
99
99
  name: v.pipe(v.string(), v.minLength(1), v.description("Extra agent name.")),
100
100
  /** Validity period as a timestamp (in ms since epoch). */
101
- validUntil: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Validity period as a timestamp (in ms since epoch).")),
101
+ validUntil: v.pipe(UnsignedInteger, v.description("Validity period as a timestamp (in ms since epoch).")),
102
102
  }), v.description("Extra agent details for a user."));
103
103
  /** Legal verification status for a user. */
104
- export const LegalCheck = v.pipe(v.strictObject({
104
+ export const LegalCheck = v.pipe(v.object({
105
105
  /** Whether the user IP address is allowed. */
106
106
  ipAllowed: v.pipe(v.boolean(), v.description("Whether the user IP address is allowed.")),
107
107
  /** Whether the user has accepted the terms of service. */
@@ -110,16 +110,16 @@ export const LegalCheck = v.pipe(v.strictObject({
110
110
  userAllowed: v.pipe(v.boolean(), v.description("Whether the user is allowed to use the platform.")),
111
111
  }), v.description("Legal verification status for a user."));
112
112
  /** Multi-sig signers for a user. */
113
- export const MultiSigSigners = v.pipe(v.strictObject({
113
+ export const MultiSigSigners = v.pipe(v.object({
114
114
  /** Authorized users addresses. */
115
115
  authorizedUsers: v.pipe(v.array(v.pipe(Hex, v.length(42))), v.minLength(1), v.description("Authorized users addresses.")),
116
116
  /** Threshold number of signatures required. */
117
- threshold: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Threshold number of signatures required.")),
117
+ threshold: v.pipe(UnsignedInteger, v.minValue(1), v.description("Threshold number of signatures required.")),
118
118
  }), v.description("Multi-sig signers for a user."));
119
119
  /** Account summary for perpetual trading. */
120
- export const PerpsClearinghouseState = v.pipe(v.strictObject({
120
+ export const PerpsClearinghouseState = v.pipe(v.object({
121
121
  /** Margin summary details. */
122
- marginSummary: v.pipe(v.strictObject({
122
+ marginSummary: v.pipe(v.object({
123
123
  /** Total account value. */
124
124
  accountValue: v.pipe(UnsignedDecimal, v.description("Total account value.")),
125
125
  /** Total notional position value. */
@@ -130,7 +130,7 @@ export const PerpsClearinghouseState = v.pipe(v.strictObject({
130
130
  totalMarginUsed: v.pipe(UnsignedDecimal, v.description("Total margin used.")),
131
131
  }), v.description("Margin summary details.")),
132
132
  /** Cross-margin summary details. */
133
- crossMarginSummary: v.pipe(v.strictObject({
133
+ crossMarginSummary: v.pipe(v.object({
134
134
  /** Total account value. */
135
135
  accountValue: v.pipe(UnsignedDecimal, v.description("Total account value.")),
136
136
  /** Total notional position value. */
@@ -147,30 +147,30 @@ export const PerpsClearinghouseState = v.pipe(v.strictObject({
147
147
  /** List of asset positions. */
148
148
  assetPositions: v.pipe(v.array(AssetPosition), v.description("List of asset positions.")),
149
149
  /** Timestamp when data was retrieved (in ms since epoch). */
150
- time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when data was retrieved (in ms since epoch).")),
150
+ time: v.pipe(UnsignedInteger, v.description("Timestamp when data was retrieved (in ms since epoch).")),
151
151
  }), v.description("Account summary for perpetual trading."));
152
152
  /** Portfolio metrics snapshot. */
153
- export const Portfolio = v.pipe(v.strictObject({
153
+ export const Portfolio = v.pipe(v.object({
154
154
  /** History entries for account value as [timestamp, value]. */
155
- accountValueHistory: v.pipe(v.array(v.strictTuple([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), UnsignedDecimal])), v.description("History entries for account value as [timestamp, value].")),
155
+ accountValueHistory: v.pipe(v.array(v.tuple([UnsignedInteger, UnsignedDecimal])), v.description("History entries for account value as [timestamp, value].")),
156
156
  /** History entries for profit and loss as [timestamp, value]. */
157
- pnlHistory: v.pipe(v.array(v.strictTuple([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), SignedDecimal])), v.description("History entries for profit and loss as [timestamp, value].")),
157
+ pnlHistory: v.pipe(v.array(v.tuple([UnsignedInteger, Decimal])), v.description("History entries for profit and loss as [timestamp, value].")),
158
158
  /** Volume metric for the portfolio. */
159
159
  vlm: v.pipe(UnsignedDecimal, v.description("Volume metric for the portfolio.")),
160
160
  }), v.description("Portfolio metrics snapshot."));
161
161
  /** Portfolio metrics grouped by time periods. */
162
- export const PortfolioPeriods = v.pipe(v.strictTuple([
163
- v.strictTuple([v.literal("day"), Portfolio]),
164
- v.strictTuple([v.literal("week"), Portfolio]),
165
- v.strictTuple([v.literal("month"), Portfolio]),
166
- v.strictTuple([v.literal("allTime"), Portfolio]),
167
- v.strictTuple([v.literal("perpDay"), Portfolio]),
168
- v.strictTuple([v.literal("perpWeek"), Portfolio]),
169
- v.strictTuple([v.literal("perpMonth"), Portfolio]),
170
- v.strictTuple([v.literal("perpAllTime"), Portfolio]),
162
+ export const PortfolioPeriods = v.pipe(v.tuple([
163
+ v.tuple([v.literal("day"), Portfolio]),
164
+ v.tuple([v.literal("week"), Portfolio]),
165
+ v.tuple([v.literal("month"), Portfolio]),
166
+ v.tuple([v.literal("allTime"), Portfolio]),
167
+ v.tuple([v.literal("perpDay"), Portfolio]),
168
+ v.tuple([v.literal("perpWeek"), Portfolio]),
169
+ v.tuple([v.literal("perpMonth"), Portfolio]),
170
+ v.tuple([v.literal("perpAllTime"), Portfolio]),
171
171
  ]), v.description("Portfolio metrics grouped by time periods."));
172
172
  /** Pre-transfer user existence check result. */
173
- export const PreTransferCheck = v.pipe(v.strictObject({
173
+ export const PreTransferCheck = v.pipe(v.object({
174
174
  /** Activation fee. */
175
175
  fee: v.pipe(UnsignedDecimal, v.description("Activation fee.")),
176
176
  /** Whether the user is sanctioned. */
@@ -181,10 +181,10 @@ export const PreTransferCheck = v.pipe(v.strictObject({
181
181
  userHasSentTx: v.pipe(v.boolean(), v.description("Whether the user has sent a transaction.")),
182
182
  }), v.description("Pre-transfer user existence check result."));
183
183
  /** Referral details for a user. */
184
- export const Referral = v.pipe(v.strictObject({
184
+ export const Referral = v.pipe(v.object({
185
185
  /** Referrer details. */
186
186
  referredBy: v.pipe(v.union([
187
- v.strictObject({
187
+ v.object({
188
188
  /** Referrer address. */
189
189
  referrer: v.pipe(v.pipe(Hex, v.length(42)), v.description("Referrer address.")),
190
190
  /** Referral code used. */
@@ -202,17 +202,17 @@ export const Referral = v.pipe(v.strictObject({
202
202
  builderRewards: v.pipe(UnsignedDecimal, v.description("Builder reward amount.")),
203
203
  /** Current state of the referrer. */
204
204
  referrerState: v.pipe(v.union([
205
- v.strictObject({
205
+ v.object({
206
206
  /** Referrer is ready to receive rewards. */
207
207
  stage: v.pipe(v.literal("ready"), v.description("Referrer is ready to receive rewards.")),
208
208
  /** Referral program details. */
209
- data: v.pipe(v.strictObject({
209
+ data: v.pipe(v.object({
210
210
  /** Assigned referral code. */
211
211
  code: v.pipe(v.string(), v.minLength(1), v.description("Assigned referral code.")),
212
212
  /** Total number of referrals. */
213
- nReferrals: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Total number of referrals.")),
213
+ nReferrals: v.pipe(UnsignedInteger, v.description("Total number of referrals.")),
214
214
  /** Summary of each referral state. */
215
- referralStates: v.pipe(v.array(v.strictObject({
215
+ referralStates: v.pipe(v.array(v.object({
216
216
  /** Cumulative traded volume. */
217
217
  cumVlm: v.pipe(UnsignedDecimal, v.description("Cumulative traded volume.")),
218
218
  /** Total fees rewarded to the referred user since referral. */
@@ -220,13 +220,13 @@ export const Referral = v.pipe(v.strictObject({
220
220
  /** Total fees rewarded to the referrer from referred trades. */
221
221
  cumFeesRewardedToReferrer: v.pipe(UnsignedDecimal, v.description("Total fees rewarded to the referrer from referred trades.")),
222
222
  /** Timestamp when the referred user joined (in ms since epoch). */
223
- timeJoined: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when the referred user joined (in ms since epoch).")),
223
+ timeJoined: v.pipe(UnsignedInteger, v.description("Timestamp when the referred user joined (in ms since epoch).")),
224
224
  /** Address of the referred user. */
225
225
  user: v.pipe(v.pipe(Hex, v.length(42)), v.description("Address of the referred user.")),
226
226
  /** Mapping of token IDs to referral reward states. */
227
- tokenToState: v.pipe(v.array(v.strictTuple([
228
- v.pipe(v.number(), v.safeInteger(), v.minValue(0)),
229
- v.strictObject({
227
+ tokenToState: v.pipe(v.array(v.tuple([
228
+ UnsignedInteger,
229
+ v.object({
230
230
  /** Cumulative traded volume. */
231
231
  cumVlm: v.pipe(UnsignedDecimal, v.description("Cumulative traded volume.")),
232
232
  /** Total fees rewarded to the referred user since referral. */
@@ -238,22 +238,22 @@ export const Referral = v.pipe(v.strictObject({
238
238
  })), v.description("Summary of each referral state.")),
239
239
  }), v.description("Referral program details.")),
240
240
  }),
241
- v.strictObject({
241
+ v.object({
242
242
  /** Referrer needs to create a referral code. */
243
243
  stage: v.pipe(v.literal("needToCreateCode"), v.description("Referrer needs to create a referral code.")),
244
244
  }),
245
- v.strictObject({
245
+ v.object({
246
246
  /** Referrer must complete a trade before earning rewards. */
247
247
  stage: v.pipe(v.literal("needToTrade"), v.description("Referrer must complete a trade before earning rewards.")),
248
248
  /** Required trading volume details for activation. */
249
- data: v.pipe(v.strictObject({
249
+ data: v.pipe(v.object({
250
250
  /** Required trading volume. */
251
251
  required: v.pipe(UnsignedDecimal, v.description("Required trading volume.")),
252
252
  }), v.description("Required trading volume details for activation.")),
253
253
  }),
254
254
  ]), v.description("Current state of the referrer.")),
255
255
  /** History of referral rewards. */
256
- rewardHistory: v.pipe(v.array(v.strictObject({
256
+ rewardHistory: v.pipe(v.array(v.object({
257
257
  /** Amount of earned rewards. */
258
258
  earned: v.pipe(UnsignedDecimal, v.description("Amount of earned rewards.")),
259
259
  /** Traded volume at the time of reward. */
@@ -261,12 +261,12 @@ export const Referral = v.pipe(v.strictObject({
261
261
  /** Traded volume via referrals. */
262
262
  referralVlm: v.pipe(UnsignedDecimal, v.description("Traded volume via referrals.")),
263
263
  /** Timestamp when the reward was earned (in ms since epoch). */
264
- time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when the reward was earned (in ms since epoch).")),
264
+ time: v.pipe(UnsignedInteger, v.description("Timestamp when the reward was earned (in ms since epoch).")),
265
265
  })), v.description("History of referral rewards.")),
266
266
  /** Mapping of token IDs to referral reward states. */
267
- tokenToState: v.pipe(v.array(v.strictTuple([
268
- v.pipe(v.number(), v.safeInteger(), v.minValue(0)),
269
- v.strictObject({
267
+ tokenToState: v.pipe(v.array(v.tuple([
268
+ UnsignedInteger,
269
+ v.object({
270
270
  /** Cumulative traded volume. */
271
271
  cumVlm: v.pipe(UnsignedDecimal, v.description("Cumulative traded volume.")),
272
272
  /** Rewards earned but not yet claimed. */
@@ -279,11 +279,11 @@ export const Referral = v.pipe(v.strictObject({
279
279
  ])), v.description("Mapping of token IDs to referral reward states.")),
280
280
  }), v.description("Referral details for a user."));
281
281
  /** Balance for a specific spot token. */
282
- export const SpotBalance = v.pipe(v.strictObject({
282
+ export const SpotBalance = v.pipe(v.object({
283
283
  /** Asset symbol. */
284
284
  coin: v.pipe(v.string(), v.description("Asset symbol.")),
285
285
  /** Unique identifier for the token. */
286
- token: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Unique identifier for the token.")),
286
+ token: v.pipe(UnsignedInteger, v.description("Unique identifier for the token.")),
287
287
  /** Total balance. */
288
288
  total: v.pipe(UnsignedDecimal, v.description("Total balance.")),
289
289
  /** Amount on hold. */
@@ -292,14 +292,14 @@ export const SpotBalance = v.pipe(v.strictObject({
292
292
  entryNtl: v.pipe(UnsignedDecimal, v.description("Entry notional value.")),
293
293
  }), v.description("Balance for a specific spot token."));
294
294
  /** Account summary for spot trading. */
295
- export const SpotClearinghouseState = v.pipe(v.strictObject({
295
+ export const SpotClearinghouseState = v.pipe(v.object({
296
296
  /** Balance for each token. */
297
297
  balances: v.pipe(v.array(SpotBalance), v.description("Balance for each token.")),
298
298
  /** Escrowed balances. */
299
299
  evmEscrows: v.pipe(v.optional(v.array(EvmEscrowsBalance)), v.description("Escrowed balances.")),
300
300
  }), v.description("Account summary for spot trading."));
301
301
  /** Sub-account details for a user. */
302
- export const SubAccount = v.pipe(v.strictObject({
302
+ export const SubAccount = v.pipe(v.object({
303
303
  /** Sub-account name. */
304
304
  name: v.pipe(v.string(), v.minLength(1), v.description("Sub-account name.")),
305
305
  /** Sub-account address. */
@@ -312,9 +312,9 @@ export const SubAccount = v.pipe(v.strictObject({
312
312
  spotState: v.pipe(SpotClearinghouseState, v.description("Spot tokens clearinghouse state.")),
313
313
  }), v.description("Sub-account details for a user."));
314
314
  /** User fees. */
315
- export const UserFees = v.pipe(v.strictObject({
315
+ export const UserFees = v.pipe(v.object({
316
316
  /** Daily user volume metrics. */
317
- dailyUserVlm: v.pipe(v.array(v.strictObject({
317
+ dailyUserVlm: v.pipe(v.array(v.object({
318
318
  /** Date in YYYY-M-D format. */
319
319
  date: v.pipe(v.string(), v.isoDate(), v.description("Date in YYYY-M-D format.")),
320
320
  /** User cross-trade volume. */
@@ -325,7 +325,7 @@ export const UserFees = v.pipe(v.strictObject({
325
325
  exchange: v.pipe(UnsignedDecimal, v.description("Exchange total volume.")),
326
326
  })), v.description("Daily user volume metrics.")),
327
327
  /** Fee schedule information. */
328
- feeSchedule: v.pipe(v.strictObject({
328
+ feeSchedule: v.pipe(v.object({
329
329
  /** Cross-trade fee rate. */
330
330
  cross: v.pipe(UnsignedDecimal, v.description("Cross-trade fee rate.")),
331
331
  /** Add-liquidity fee rate. */
@@ -335,9 +335,9 @@ export const UserFees = v.pipe(v.strictObject({
335
335
  /** Spot add-liquidity fee rate. */
336
336
  spotAdd: v.pipe(UnsignedDecimal, v.description("Spot add-liquidity fee rate.")),
337
337
  /** Fee tiers details. */
338
- tiers: v.pipe(v.strictObject({
338
+ tiers: v.pipe(v.object({
339
339
  /** VIP fee tier information. */
340
- vip: v.pipe(v.array(v.strictObject({
340
+ vip: v.pipe(v.array(v.object({
341
341
  /** Notional volume cutoff. */
342
342
  ntlCutoff: v.pipe(UnsignedDecimal, v.description("Notional volume cutoff.")),
343
343
  /** Cross-trade fee rate. */
@@ -350,17 +350,17 @@ export const UserFees = v.pipe(v.strictObject({
350
350
  spotAdd: v.pipe(UnsignedDecimal, v.description("Spot add-liquidity fee rate.")),
351
351
  })), v.description("VIP fee tier information.")),
352
352
  /** Market maker fee tier information. */
353
- mm: v.pipe(v.array(v.strictObject({
353
+ mm: v.pipe(v.array(v.object({
354
354
  /** Maker fraction cutoff. */
355
355
  makerFractionCutoff: v.pipe(UnsignedDecimal, v.description("Maker fraction cutoff.")),
356
356
  /** Add-liquidity fee rate. */
357
- add: v.pipe(SignedDecimal, v.description("Add-liquidity fee rate.")),
357
+ add: v.pipe(Decimal, v.description("Add-liquidity fee rate.")),
358
358
  })), v.description("Market maker fee tier information.")),
359
359
  }), v.description("Fee tiers details.")),
360
360
  /** Referral discount rate. */
361
361
  referralDiscount: v.pipe(UnsignedDecimal, v.description("Referral discount rate.")),
362
362
  /** Staking discount tiers details. */
363
- stakingDiscountTiers: v.pipe(v.array(v.strictObject({
363
+ stakingDiscountTiers: v.pipe(v.array(v.object({
364
364
  /** Basis points of maximum supply. */
365
365
  bpsOfMaxSupply: v.pipe(UnsignedDecimal, v.description("Basis points of maximum supply.")),
366
366
  /** Discount rate applied. */
@@ -385,7 +385,7 @@ export const UserFees = v.pipe(v.strictObject({
385
385
  nextTrialAvailableTimestamp: v.pipe(v.union([v.unknown(), v.null()]), v.description("Timestamp when next trial becomes available.")),
386
386
  stakingLink: v.union([v.unknown(), v.null()]),
387
387
  /** Active staking discount details. */
388
- activeStakingDiscount: v.pipe(v.strictObject({
388
+ activeStakingDiscount: v.pipe(v.object({
389
389
  /** Basis points of maximum supply. */
390
390
  bpsOfMaxSupply: v.pipe(UnsignedDecimal, v.description("Basis points of maximum supply.")),
391
391
  /** Discount rate applied. */
@@ -393,65 +393,65 @@ export const UserFees = v.pipe(v.strictObject({
393
393
  }), v.description("Active staking discount details.")),
394
394
  }), v.description("User fees."));
395
395
  /** Funding update details. */
396
- export const FundingUpdate = v.pipe(v.strictObject({
396
+ export const FundingUpdate = v.pipe(v.object({
397
397
  /** Update type. */
398
398
  type: v.pipe(v.literal("funding"), v.description("Update type.")),
399
399
  /** Asset symbol. */
400
400
  coin: v.pipe(v.string(), v.description("Asset symbol.")),
401
401
  /** Amount transferred in USDC. */
402
- usdc: v.pipe(SignedDecimal, v.description("Amount transferred in USDC.")),
402
+ usdc: v.pipe(Decimal, v.description("Amount transferred in USDC.")),
403
403
  /** Signed position size. */
404
- szi: v.pipe(SignedDecimal, v.description("Signed position size.")),
404
+ szi: v.pipe(Decimal, v.description("Signed position size.")),
405
405
  /** Applied funding rate. */
406
- fundingRate: v.pipe(SignedDecimal, v.description("Applied funding rate.")),
406
+ fundingRate: v.pipe(Decimal, v.description("Applied funding rate.")),
407
407
  /** Number of samples. */
408
- nSamples: v.pipe(v.union([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.null()]), v.description("Number of samples.")),
408
+ nSamples: v.pipe(v.union([UnsignedInteger, v.null()]), v.description("Number of samples.")),
409
409
  }), v.description("Funding update details."));
410
410
  /** Funding ledger update for a user. */
411
- export const UserFundingUpdate = v.pipe(v.strictObject({
411
+ export const UserFundingUpdate = v.pipe(v.object({
412
412
  /** Timestamp of the update (in ms since epoch). */
413
- time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp of the update (in ms since epoch).")),
413
+ time: v.pipe(UnsignedInteger, v.description("Timestamp of the update (in ms since epoch).")),
414
414
  /** L1 transaction hash. */
415
415
  hash: v.pipe(v.pipe(Hex, v.length(66)), v.description("L1 transaction hash.")),
416
416
  /** Update details. */
417
417
  delta: v.pipe(FundingUpdate, v.description("Update details.")),
418
418
  }), v.description("Funding ledger update for a user."));
419
419
  /** User rate limits. */
420
- export const UserRateLimit = v.pipe(v.strictObject({
420
+ export const UserRateLimit = v.pipe(v.object({
421
421
  /** Cumulative trading volume. */
422
422
  cumVlm: v.pipe(UnsignedDecimal, v.description("Cumulative trading volume.")),
423
423
  /** Number of API requests used. */
424
- nRequestsUsed: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Number of API requests used.")),
424
+ nRequestsUsed: v.pipe(UnsignedInteger, v.description("Number of API requests used.")),
425
425
  /** Maximum allowed API requests. */
426
- nRequestsCap: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Maximum allowed API requests.")),
426
+ nRequestsCap: v.pipe(UnsignedInteger, v.description("Maximum allowed API requests.")),
427
427
  }), v.description("User rate limits."));
428
428
  /** User role. */
429
429
  export const UserRole = v.pipe(v.union([
430
- v.strictObject({
430
+ v.object({
431
431
  /** Role identifier. */
432
432
  role: v.pipe(v.union([v.literal("missing"), v.literal("user"), v.literal("vault")]), v.description("Role identifier.")),
433
433
  }),
434
- v.strictObject({
434
+ v.object({
435
435
  /** Role identifier. */
436
436
  role: v.pipe(v.literal("agent"), v.description("Role identifier.")),
437
437
  /** Details for agent role. */
438
- data: v.pipe(v.strictObject({
438
+ data: v.pipe(v.object({
439
439
  /** Master account address associated with the agent. */
440
440
  user: v.pipe(v.pipe(Hex, v.length(42)), v.description("Master account address associated with the agent.")),
441
441
  }), v.description("Details for agent role.")),
442
442
  }),
443
- v.strictObject({
443
+ v.object({
444
444
  /** Role identifier. */
445
445
  role: v.pipe(v.literal("subAccount"), v.description("Role identifier.")),
446
446
  /** Details for sub-account role. */
447
- data: v.pipe(v.strictObject({
447
+ data: v.pipe(v.object({
448
448
  /** Master account address associated with the sub-account. */
449
449
  master: v.pipe(v.pipe(Hex, v.length(42)), v.description("Master account address associated with the sub-account.")),
450
450
  }), v.description("Details for sub-account role.")),
451
451
  }),
452
452
  ]), v.description("User role."));
453
453
  /** Transfer between spot and perpetual accounts. */
454
- export const AccountClassTransferUpdate = v.pipe(v.strictObject({
454
+ export const AccountClassTransferUpdate = v.pipe(v.object({
455
455
  /** Update type. */
456
456
  type: v.pipe(v.literal("accountClassTransfer"), v.description("Update type.")),
457
457
  /** Amount transferred in USDC. */
@@ -460,14 +460,14 @@ export const AccountClassTransferUpdate = v.pipe(v.strictObject({
460
460
  toPerp: v.pipe(v.boolean(), v.description("Indicates if the transfer is to the perpetual account.")),
461
461
  }), v.description("Transfer between spot and perpetual accounts."));
462
462
  /** Deposit update to an account. */
463
- export const DepositUpdate = v.pipe(v.strictObject({
463
+ export const DepositUpdate = v.pipe(v.object({
464
464
  /** Update type. */
465
465
  type: v.pipe(v.literal("deposit"), v.description("Update type.")),
466
466
  /** Amount deposited in USDC. */
467
467
  usdc: v.pipe(UnsignedDecimal, v.description("Amount deposited in USDC.")),
468
468
  }), v.description("Deposit update to an account."));
469
469
  /** Internal transfer between accounts. */
470
- export const InternalTransferUpdate = v.pipe(v.strictObject({
470
+ export const InternalTransferUpdate = v.pipe(v.object({
471
471
  /** Update type. */
472
472
  type: v.pipe(v.literal("internalTransfer"), v.description("Update type.")),
473
473
  /** Amount transferred in USDC. */
@@ -480,7 +480,7 @@ export const InternalTransferUpdate = v.pipe(v.strictObject({
480
480
  fee: v.pipe(UnsignedDecimal, v.description("Transfer fee.")),
481
481
  }), v.description("Internal transfer between accounts."));
482
482
  /** Liquidation event update. */
483
- export const LiquidationUpdate = v.pipe(v.strictObject({
483
+ export const LiquidationUpdate = v.pipe(v.object({
484
484
  /** Update type. */
485
485
  type: v.pipe(v.literal("liquidation"), v.description("Update type.")),
486
486
  /** Total notional value of liquidated positions. */
@@ -490,15 +490,15 @@ export const LiquidationUpdate = v.pipe(v.strictObject({
490
490
  /** Leverage type for liquidated positions. */
491
491
  leverageType: v.pipe(v.union([v.literal("Cross"), v.literal("Isolated")]), v.description("Leverage type for liquidated positions.")),
492
492
  /** Details of each liquidated position. */
493
- liquidatedPositions: v.pipe(v.array(v.strictObject({
493
+ liquidatedPositions: v.pipe(v.array(v.object({
494
494
  /** Asset symbol of the liquidated position. */
495
495
  coin: v.pipe(v.string(), v.description("Asset symbol of the liquidated position.")),
496
496
  /** Signed position size liquidated. */
497
- szi: v.pipe(SignedDecimal, v.description("Signed position size liquidated.")),
497
+ szi: v.pipe(Decimal, v.description("Signed position size liquidated.")),
498
498
  })), v.description("Details of each liquidated position.")),
499
499
  }), v.description("Liquidation event update."));
500
500
  /** Rewards claim event update. */
501
- export const RewardsClaimUpdate = v.pipe(v.strictObject({
501
+ export const RewardsClaimUpdate = v.pipe(v.object({
502
502
  /** Update type. */
503
503
  type: v.pipe(v.literal("rewardsClaim"), v.description("Update type.")),
504
504
  /** Amount of rewards claimed. */
@@ -507,7 +507,7 @@ export const RewardsClaimUpdate = v.pipe(v.strictObject({
507
507
  token: v.pipe(v.string(), v.description("Token symbol.")),
508
508
  }), v.description("Rewards claim event update."));
509
509
  /** Spot transfer update between accounts. */
510
- export const SpotTransferUpdate = v.pipe(v.strictObject({
510
+ export const SpotTransferUpdate = v.pipe(v.object({
511
511
  /** Update type. */
512
512
  type: v.pipe(v.literal("spotTransfer"), v.description("Update type.")),
513
513
  /** Token symbol. */
@@ -529,7 +529,7 @@ export const SpotTransferUpdate = v.pipe(v.strictObject({
529
529
  feeToken: v.pipe(v.string(), v.description('Token in which the fee is denominated (e.g., "USDC").')),
530
530
  }), v.description("Spot transfer update between accounts."));
531
531
  /** Transfer update between sub-accounts. */
532
- export const SubAccountTransferUpdate = v.pipe(v.strictObject({
532
+ export const SubAccountTransferUpdate = v.pipe(v.object({
533
533
  /** Update type. */
534
534
  type: v.pipe(v.literal("subAccountTransfer"), v.description("Update type.")),
535
535
  /** Amount transferred in USDC. */
@@ -540,7 +540,7 @@ export const SubAccountTransferUpdate = v.pipe(v.strictObject({
540
540
  destination: v.pipe(v.pipe(Hex, v.length(42)), v.description("Destination address.")),
541
541
  }), v.description("Transfer update between sub-accounts."));
542
542
  /** Vault creation update. */
543
- export const VaultCreateUpdate = v.pipe(v.strictObject({
543
+ export const VaultCreateUpdate = v.pipe(v.object({
544
544
  /** Update type. */
545
545
  type: v.pipe(v.literal("vaultCreate"), v.description("Update type.")),
546
546
  /** Address of the created vault. */
@@ -551,7 +551,7 @@ export const VaultCreateUpdate = v.pipe(v.strictObject({
551
551
  fee: v.pipe(UnsignedDecimal, v.description("Vault creation fee.")),
552
552
  }), v.description("Vault creation update."));
553
553
  /** Vault deposit update. */
554
- export const VaultDepositUpdate = v.pipe(v.strictObject({
554
+ export const VaultDepositUpdate = v.pipe(v.object({
555
555
  /** Update type. */
556
556
  type: v.pipe(v.literal("vaultDeposit"), v.description("Update type.")),
557
557
  /** Address of the target vault. */
@@ -560,7 +560,7 @@ export const VaultDepositUpdate = v.pipe(v.strictObject({
560
560
  usdc: v.pipe(UnsignedDecimal, v.description("Amount deposited in USDC.")),
561
561
  }), v.description("Vault deposit update."));
562
562
  /** Vault distribution update. */
563
- export const VaultDistributionUpdate = v.pipe(v.strictObject({
563
+ export const VaultDistributionUpdate = v.pipe(v.object({
564
564
  /** Update type. */
565
565
  type: v.pipe(v.literal("vaultDistribution"), v.description("Update type.")),
566
566
  /** Address of the vault distributing funds. */
@@ -569,7 +569,7 @@ export const VaultDistributionUpdate = v.pipe(v.strictObject({
569
569
  usdc: v.pipe(UnsignedDecimal, v.description("Amount distributed in USDC.")),
570
570
  }), v.description("Vault distribution update."));
571
571
  /** Vault withdrawal event update. */
572
- export const VaultWithdrawUpdate = v.pipe(v.strictObject({
572
+ export const VaultWithdrawUpdate = v.pipe(v.object({
573
573
  /** Update type. */
574
574
  type: v.pipe(v.literal("vaultWithdraw"), v.description("Update type.")),
575
575
  /** Vault address. */
@@ -588,20 +588,20 @@ export const VaultWithdrawUpdate = v.pipe(v.strictObject({
588
588
  netWithdrawnUsd: v.pipe(UnsignedDecimal, v.description("Net withdrawn amount in USD after fees and costs.")),
589
589
  }), v.description("Vault withdrawal event update."));
590
590
  /** Withdrawal update from an account. */
591
- export const WithdrawUpdate = v.pipe(v.strictObject({
591
+ export const WithdrawUpdate = v.pipe(v.object({
592
592
  /** Update type. */
593
593
  type: v.pipe(v.literal("withdraw"), v.description("Update type.")),
594
594
  /** Amount withdrawn in USDC. */
595
595
  usdc: v.pipe(UnsignedDecimal, v.description("Amount withdrawn in USDC.")),
596
596
  /** Unique nonce for the withdrawal request. */
597
- nonce: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Unique nonce for the withdrawal request.")),
597
+ nonce: v.pipe(UnsignedInteger, v.description("Unique nonce for the withdrawal request.")),
598
598
  /** Withdrawal fee. */
599
599
  fee: v.pipe(UnsignedDecimal, v.description("Withdrawal fee.")),
600
600
  }), v.description("Withdrawal update from an account."));
601
601
  /** Non-funding ledger update for a user. */
602
- export const UserNonFundingLedgerUpdate = v.pipe(v.strictObject({
602
+ export const UserNonFundingLedgerUpdate = v.pipe(v.object({
603
603
  /** Timestamp of the update (in ms since epoch). */
604
- time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp of the update (in ms since epoch).")),
604
+ time: v.pipe(UnsignedInteger, v.description("Timestamp of the update (in ms since epoch).")),
605
605
  /** L1 transaction hash. */
606
606
  hash: v.pipe(v.pipe(Hex, v.length(66)), v.description("L1 transaction hash.")),
607
607
  /** Update details. */
@@ -620,3 +620,4 @@ export const UserNonFundingLedgerUpdate = v.pipe(v.strictObject({
620
620
  WithdrawUpdate,
621
621
  ]), v.description("Update details.")),
622
622
  }), v.description("Non-funding ledger update for a user."));
623
+ //# sourceMappingURL=accounts.js.map