@nktkas/hyperliquid 0.24.2 → 0.25.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/README.md +197 -117
  2. package/esm/mod.d.ts +11 -11
  3. package/esm/mod.d.ts.map +1 -1
  4. package/esm/mod.js +1 -1
  5. package/esm/src/clients/exchange.d.ts +29 -18
  6. package/esm/src/clients/exchange.d.ts.map +1 -1
  7. package/esm/src/clients/exchange.js +50 -48
  8. package/esm/src/clients/info.d.ts +79 -75
  9. package/esm/src/clients/info.d.ts.map +1 -1
  10. package/esm/src/clients/info.js +294 -163
  11. package/esm/src/clients/multiSign.d.ts +11 -7
  12. package/esm/src/clients/multiSign.d.ts.map +1 -1
  13. package/esm/src/clients/subscription.d.ts +105 -32
  14. package/esm/src/clients/subscription.d.ts.map +1 -1
  15. package/esm/src/clients/subscription.js +114 -33
  16. package/esm/src/{base.d.ts → errors.d.ts} +1 -1
  17. package/esm/src/errors.d.ts.map +1 -0
  18. package/esm/src/schemas/_base.d.ts +10 -0
  19. package/esm/src/schemas/_base.d.ts.map +1 -0
  20. package/esm/src/schemas/_base.js +12 -0
  21. package/esm/src/schemas/exchange/requests.d.ts +8953 -0
  22. package/esm/src/schemas/exchange/requests.d.ts.map +1 -0
  23. package/esm/src/schemas/exchange/requests.js +1413 -0
  24. package/esm/src/schemas/exchange/responses.d.ts +567 -0
  25. package/esm/src/schemas/exchange/responses.d.ts.map +1 -0
  26. package/esm/src/schemas/exchange/responses.js +243 -0
  27. package/esm/src/schemas/explorer/requests.d.ts +44 -0
  28. package/esm/src/schemas/explorer/requests.d.ts.map +1 -0
  29. package/esm/src/schemas/explorer/requests.js +32 -0
  30. package/esm/src/schemas/explorer/responses.d.ts +360 -0
  31. package/esm/src/schemas/explorer/responses.d.ts.map +1 -0
  32. package/esm/src/schemas/explorer/responses.js +56 -0
  33. package/esm/src/schemas/info/accounts.d.ts +2159 -0
  34. package/esm/src/schemas/info/accounts.d.ts.map +1 -0
  35. package/esm/src/schemas/info/accounts.js +622 -0
  36. package/esm/src/schemas/info/assets.d.ts +945 -0
  37. package/esm/src/schemas/info/assets.d.ts.map +1 -0
  38. package/esm/src/schemas/info/assets.js +265 -0
  39. package/esm/src/schemas/info/markets.d.ts +138 -0
  40. package/esm/src/schemas/info/markets.d.ts.map +1 -0
  41. package/esm/src/schemas/info/markets.js +58 -0
  42. package/esm/src/schemas/info/orders.d.ts +957 -0
  43. package/esm/src/schemas/info/orders.d.ts.map +1 -0
  44. package/esm/src/schemas/info/orders.js +297 -0
  45. package/esm/src/schemas/info/requests.d.ts +882 -0
  46. package/esm/src/schemas/info/requests.d.ts.map +1 -0
  47. package/esm/src/schemas/info/requests.js +655 -0
  48. package/esm/src/schemas/info/validators.d.ts +305 -0
  49. package/esm/src/schemas/info/validators.d.ts.map +1 -0
  50. package/esm/src/schemas/info/validators.js +112 -0
  51. package/esm/src/schemas/info/vaults.d.ts +447 -0
  52. package/esm/src/schemas/info/vaults.d.ts.map +1 -0
  53. package/esm/src/schemas/info/vaults.js +110 -0
  54. package/esm/src/schemas/mod.d.ts +100 -0
  55. package/esm/src/schemas/mod.d.ts.map +1 -0
  56. package/esm/src/schemas/mod.js +113 -0
  57. package/esm/src/schemas/subscriptions/requests.d.ts +332 -0
  58. package/esm/src/schemas/subscriptions/requests.d.ts.map +1 -0
  59. package/esm/src/schemas/subscriptions/requests.js +258 -0
  60. package/esm/src/schemas/subscriptions/responses.d.ts +3643 -0
  61. package/esm/src/schemas/subscriptions/responses.d.ts.map +1 -0
  62. package/esm/src/schemas/subscriptions/responses.js +233 -0
  63. package/esm/src/signing/mod.d.ts +109 -29
  64. package/esm/src/signing/mod.d.ts.map +1 -1
  65. package/esm/src/signing/mod.js +135 -29
  66. package/esm/src/transports/base.d.ts +2 -2
  67. package/esm/src/transports/base.d.ts.map +1 -1
  68. package/esm/src/transports/base.js +2 -2
  69. package/esm/src/transports/http/http_transport.d.ts +2 -1
  70. package/esm/src/transports/http/http_transport.d.ts.map +1 -1
  71. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  72. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  73. package/esm/src/transports/websocket/websocket_transport.d.ts +2 -1
  74. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  75. package/package.json +6 -5
  76. package/script/mod.d.ts +11 -11
  77. package/script/mod.d.ts.map +1 -1
  78. package/script/mod.js +1 -1
  79. package/script/src/clients/exchange.d.ts +29 -18
  80. package/script/src/clients/exchange.d.ts.map +1 -1
  81. package/script/src/clients/exchange.js +56 -54
  82. package/script/src/clients/info.d.ts +79 -75
  83. package/script/src/clients/info.d.ts.map +1 -1
  84. package/script/src/clients/info.js +294 -163
  85. package/script/src/clients/multiSign.d.ts +11 -7
  86. package/script/src/clients/multiSign.d.ts.map +1 -1
  87. package/script/src/clients/subscription.d.ts +105 -32
  88. package/script/src/clients/subscription.d.ts.map +1 -1
  89. package/script/src/clients/subscription.js +114 -33
  90. package/script/src/{base.d.ts → errors.d.ts} +1 -1
  91. package/script/src/errors.d.ts.map +1 -0
  92. package/script/src/schemas/_base.d.ts +10 -0
  93. package/script/src/schemas/_base.d.ts.map +1 -0
  94. package/script/src/schemas/_base.js +48 -0
  95. package/script/src/schemas/exchange/requests.d.ts +8953 -0
  96. package/script/src/schemas/exchange/requests.d.ts.map +1 -0
  97. package/script/src/schemas/exchange/requests.js +1449 -0
  98. package/script/src/schemas/exchange/responses.d.ts +567 -0
  99. package/script/src/schemas/exchange/responses.d.ts.map +1 -0
  100. package/script/src/schemas/exchange/responses.js +279 -0
  101. package/script/src/schemas/explorer/requests.d.ts +44 -0
  102. package/script/src/schemas/explorer/requests.d.ts.map +1 -0
  103. package/script/src/schemas/explorer/requests.js +68 -0
  104. package/script/src/schemas/explorer/responses.d.ts +360 -0
  105. package/script/src/schemas/explorer/responses.d.ts.map +1 -0
  106. package/script/src/schemas/explorer/responses.js +92 -0
  107. package/script/src/schemas/info/accounts.d.ts +2159 -0
  108. package/script/src/schemas/info/accounts.d.ts.map +1 -0
  109. package/script/src/schemas/info/accounts.js +658 -0
  110. package/script/src/schemas/info/assets.d.ts +945 -0
  111. package/script/src/schemas/info/assets.d.ts.map +1 -0
  112. package/script/src/schemas/info/assets.js +301 -0
  113. package/script/src/schemas/info/markets.d.ts +138 -0
  114. package/script/src/schemas/info/markets.d.ts.map +1 -0
  115. package/script/src/schemas/info/markets.js +94 -0
  116. package/script/src/schemas/info/orders.d.ts +957 -0
  117. package/script/src/schemas/info/orders.d.ts.map +1 -0
  118. package/script/src/schemas/info/orders.js +333 -0
  119. package/script/src/schemas/info/requests.d.ts +882 -0
  120. package/script/src/schemas/info/requests.d.ts.map +1 -0
  121. package/script/src/schemas/info/requests.js +692 -0
  122. package/script/src/schemas/info/validators.d.ts +305 -0
  123. package/script/src/schemas/info/validators.d.ts.map +1 -0
  124. package/script/src/schemas/info/validators.js +148 -0
  125. package/script/src/schemas/info/vaults.d.ts +447 -0
  126. package/script/src/schemas/info/vaults.d.ts.map +1 -0
  127. package/script/src/schemas/info/vaults.js +146 -0
  128. package/script/src/schemas/mod.d.ts +100 -0
  129. package/script/src/schemas/mod.d.ts.map +1 -0
  130. package/script/src/schemas/mod.js +154 -0
  131. package/script/src/schemas/subscriptions/requests.d.ts +332 -0
  132. package/script/src/schemas/subscriptions/requests.d.ts.map +1 -0
  133. package/script/src/schemas/subscriptions/requests.js +294 -0
  134. package/script/src/schemas/subscriptions/responses.d.ts +3643 -0
  135. package/script/src/schemas/subscriptions/responses.d.ts.map +1 -0
  136. package/script/src/schemas/subscriptions/responses.js +269 -0
  137. package/script/src/signing/mod.d.ts +109 -29
  138. package/script/src/signing/mod.d.ts.map +1 -1
  139. package/script/src/signing/mod.js +137 -33
  140. package/script/src/transports/base.d.ts +2 -2
  141. package/script/src/transports/base.d.ts.map +1 -1
  142. package/script/src/transports/base.js +3 -3
  143. package/script/src/transports/http/http_transport.d.ts +2 -1
  144. package/script/src/transports/http/http_transport.d.ts.map +1 -1
  145. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  146. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  147. package/script/src/transports/websocket/websocket_transport.d.ts +2 -1
  148. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  149. package/esm/src/base.d.ts.map +0 -1
  150. package/esm/src/signing/_sorter.d.ts +0 -127
  151. package/esm/src/signing/_sorter.d.ts.map +0 -1
  152. package/esm/src/signing/_sorter.js +0 -693
  153. package/esm/src/types/exchange/requests.d.ts +0 -1345
  154. package/esm/src/types/exchange/requests.d.ts.map +0 -1
  155. package/esm/src/types/exchange/requests.js +0 -1
  156. package/esm/src/types/exchange/responses.d.ts +0 -233
  157. package/esm/src/types/exchange/responses.d.ts.map +0 -1
  158. package/esm/src/types/exchange/responses.js +0 -1
  159. package/esm/src/types/explorer/requests.d.ts +0 -32
  160. package/esm/src/types/explorer/requests.d.ts.map +0 -1
  161. package/esm/src/types/explorer/requests.js +0 -1
  162. package/esm/src/types/explorer/responses.d.ts +0 -58
  163. package/esm/src/types/explorer/responses.d.ts.map +0 -1
  164. package/esm/src/types/explorer/responses.js +0 -1
  165. package/esm/src/types/info/accounts.d.ts +0 -864
  166. package/esm/src/types/info/accounts.d.ts.map +0 -1
  167. package/esm/src/types/info/accounts.js +0 -1
  168. package/esm/src/types/info/assets.d.ts +0 -354
  169. package/esm/src/types/info/assets.d.ts.map +0 -1
  170. package/esm/src/types/info/assets.js +0 -1
  171. package/esm/src/types/info/markets.d.ts +0 -79
  172. package/esm/src/types/info/markets.d.ts.map +0 -1
  173. package/esm/src/types/info/markets.js +0 -1
  174. package/esm/src/types/info/orders.d.ts +0 -266
  175. package/esm/src/types/info/orders.d.ts.map +0 -1
  176. package/esm/src/types/info/orders.js +0 -1
  177. package/esm/src/types/info/requests.d.ts +0 -634
  178. package/esm/src/types/info/requests.d.ts.map +0 -1
  179. package/esm/src/types/info/requests.js +0 -1
  180. package/esm/src/types/info/validators.d.ts +0 -147
  181. package/esm/src/types/info/validators.d.ts.map +0 -1
  182. package/esm/src/types/info/validators.js +0 -1
  183. package/esm/src/types/info/vaults.d.ts +0 -119
  184. package/esm/src/types/info/vaults.d.ts.map +0 -1
  185. package/esm/src/types/info/vaults.js +0 -1
  186. package/esm/src/types/mod.d.ts +0 -38
  187. package/esm/src/types/mod.d.ts.map +0 -1
  188. package/esm/src/types/mod.js +0 -24
  189. package/esm/src/types/subscriptions/requests.d.ts +0 -143
  190. package/esm/src/types/subscriptions/requests.d.ts.map +0 -1
  191. package/esm/src/types/subscriptions/requests.js +0 -1
  192. package/esm/src/types/subscriptions/responses.d.ts +0 -213
  193. package/esm/src/types/subscriptions/responses.d.ts.map +0 -1
  194. package/esm/src/types/subscriptions/responses.js +0 -1
  195. package/script/src/base.d.ts.map +0 -1
  196. package/script/src/signing/_sorter.d.ts +0 -127
  197. package/script/src/signing/_sorter.d.ts.map +0 -1
  198. package/script/src/signing/_sorter.js +0 -696
  199. package/script/src/types/exchange/requests.d.ts +0 -1345
  200. package/script/src/types/exchange/requests.d.ts.map +0 -1
  201. package/script/src/types/exchange/requests.js +0 -2
  202. package/script/src/types/exchange/responses.d.ts +0 -233
  203. package/script/src/types/exchange/responses.d.ts.map +0 -1
  204. package/script/src/types/exchange/responses.js +0 -2
  205. package/script/src/types/explorer/requests.d.ts +0 -32
  206. package/script/src/types/explorer/requests.d.ts.map +0 -1
  207. package/script/src/types/explorer/requests.js +0 -2
  208. package/script/src/types/explorer/responses.d.ts +0 -58
  209. package/script/src/types/explorer/responses.d.ts.map +0 -1
  210. package/script/src/types/explorer/responses.js +0 -2
  211. package/script/src/types/info/accounts.d.ts +0 -864
  212. package/script/src/types/info/accounts.d.ts.map +0 -1
  213. package/script/src/types/info/accounts.js +0 -2
  214. package/script/src/types/info/assets.d.ts +0 -354
  215. package/script/src/types/info/assets.d.ts.map +0 -1
  216. package/script/src/types/info/assets.js +0 -2
  217. package/script/src/types/info/markets.d.ts +0 -79
  218. package/script/src/types/info/markets.d.ts.map +0 -1
  219. package/script/src/types/info/markets.js +0 -2
  220. package/script/src/types/info/orders.d.ts +0 -266
  221. package/script/src/types/info/orders.d.ts.map +0 -1
  222. package/script/src/types/info/orders.js +0 -2
  223. package/script/src/types/info/requests.d.ts +0 -634
  224. package/script/src/types/info/requests.d.ts.map +0 -1
  225. package/script/src/types/info/requests.js +0 -2
  226. package/script/src/types/info/validators.d.ts +0 -147
  227. package/script/src/types/info/validators.d.ts.map +0 -1
  228. package/script/src/types/info/validators.js +0 -2
  229. package/script/src/types/info/vaults.d.ts +0 -119
  230. package/script/src/types/info/vaults.d.ts.map +0 -1
  231. package/script/src/types/info/vaults.js +0 -2
  232. package/script/src/types/mod.d.ts +0 -38
  233. package/script/src/types/mod.d.ts.map +0 -1
  234. package/script/src/types/mod.js +0 -25
  235. package/script/src/types/subscriptions/requests.d.ts +0 -143
  236. package/script/src/types/subscriptions/requests.d.ts.map +0 -1
  237. package/script/src/types/subscriptions/requests.js +0 -2
  238. package/script/src/types/subscriptions/responses.d.ts +0 -213
  239. package/script/src/types/subscriptions/responses.d.ts.map +0 -1
  240. package/script/src/types/subscriptions/responses.js +0 -2
  241. /package/esm/src/{base.js → errors.js} +0 -0
  242. /package/script/src/{base.js → errors.js} +0 -0
@@ -0,0 +1,305 @@
1
+ import * as v from "valibot";
2
+ /** User delegation to a validator. */
3
+ export declare const Delegation: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
4
+ /** Validator address. */
5
+ readonly validator: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "Validator address.">]>;
6
+ /** Amount of tokens delegated to the validator. */
7
+ readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Amount of tokens delegated to the validator.">]>;
8
+ /** Locked until timestamp (in ms since epoch). */
9
+ readonly lockedUntilTimestamp: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Locked until timestamp (in ms since epoch).">]>;
10
+ }, undefined>, v.DescriptionAction<{
11
+ validator: `0x${string}`;
12
+ amount: string;
13
+ lockedUntilTimestamp: number;
14
+ }, "User delegation to a validator.">]>;
15
+ export type Delegation = v.InferOutput<typeof Delegation>;
16
+ /** Reward received from staking activities. */
17
+ export declare const DelegatorReward: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
18
+ /** Timestamp when the reward was received (in ms since epoch). */
19
+ readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp when the reward was received (in ms since epoch).">]>;
20
+ /** Source of the reward. */
21
+ readonly source: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"delegation", undefined>, v.LiteralSchema<"commission", undefined>], undefined>, v.DescriptionAction<"commission" | "delegation", "Source of the reward.">]>;
22
+ /** Total reward amount. */
23
+ readonly totalAmount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total reward amount.">]>;
24
+ }, undefined>, v.DescriptionAction<{
25
+ time: number;
26
+ source: "commission" | "delegation";
27
+ totalAmount: string;
28
+ }, "Reward received from staking activities.">]>;
29
+ export type DelegatorReward = v.InferOutput<typeof DelegatorReward>;
30
+ /** Summary of a user staking delegations. */
31
+ export declare const DelegatorSummary: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
32
+ /** Total amount of delegated tokens. */
33
+ readonly delegated: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total amount of delegated tokens.">]>;
34
+ /** Total amount of undelegated tokens. */
35
+ readonly undelegated: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total amount of undelegated tokens.">]>;
36
+ /** Total amount of tokens pending withdrawal. */
37
+ readonly totalPendingWithdrawal: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Total amount of tokens pending withdrawal.">]>;
38
+ /** Number of pending withdrawals. */
39
+ readonly nPendingWithdrawals: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Number of pending withdrawals.">]>;
40
+ }, undefined>, v.DescriptionAction<{
41
+ delegated: string;
42
+ undelegated: string;
43
+ totalPendingWithdrawal: string;
44
+ nPendingWithdrawals: number;
45
+ }, "Summary of a user staking delegations.">]>;
46
+ export type DelegatorSummary = v.InferOutput<typeof DelegatorSummary>;
47
+ /** Delegation operation in a delegator update. */
48
+ export declare const DelegatorUpdateDelegate: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
49
+ /** Delegation operation details. */
50
+ readonly delegate: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
51
+ /** Address of the validator receiving or losing delegation. */
52
+ readonly validator: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "Address of the validator receiving or losing delegation.">]>;
53
+ /** Amount of tokens being delegated or undelegated. */
54
+ readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Amount of tokens being delegated or undelegated.">]>;
55
+ /** Whether this is an undelegation operation. */
56
+ readonly isUndelegate: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether this is an undelegation operation.">]>;
57
+ }, undefined>, v.DescriptionAction<{
58
+ validator: `0x${string}`;
59
+ amount: string;
60
+ isUndelegate: boolean;
61
+ }, "Delegation operation details.">]>;
62
+ }, undefined>, v.DescriptionAction<{
63
+ delegate: {
64
+ validator: `0x${string}`;
65
+ amount: string;
66
+ isUndelegate: boolean;
67
+ };
68
+ }, "Delegation operation in a delegator update.">]>;
69
+ export type DelegatorUpdateDelegate = v.InferOutput<typeof DelegatorUpdateDelegate>;
70
+ /** Deposit operation in a delegator update. */
71
+ export declare const DelegatorUpdateDeposit: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
72
+ /** Deposit details. */
73
+ readonly cDeposit: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
74
+ /** Amount of tokens being deposited. */
75
+ readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Amount of tokens being deposited.">]>;
76
+ }, undefined>, v.DescriptionAction<{
77
+ amount: string;
78
+ }, "Deposit details.">]>;
79
+ }, undefined>, v.DescriptionAction<{
80
+ cDeposit: {
81
+ amount: string;
82
+ };
83
+ }, "Deposit operation in a delegator update.">]>;
84
+ export type DelegatorUpdateDeposit = v.InferOutput<typeof DelegatorUpdateDeposit>;
85
+ /** Withdrawal operation in a delegator update. */
86
+ export declare const DelegatorUpdateWithdrawal: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
87
+ /** Withdrawal details. */
88
+ readonly withdrawal: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
89
+ /** Amount of tokens being withdrawn. */
90
+ readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Amount of tokens being withdrawn.">]>;
91
+ /** Phase of the withdrawal process. */
92
+ readonly phase: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"initiated", undefined>, v.LiteralSchema<"finalized", undefined>], undefined>, v.DescriptionAction<"initiated" | "finalized", "Phase of the withdrawal process.">]>;
93
+ }, undefined>, v.DescriptionAction<{
94
+ amount: string;
95
+ phase: "initiated" | "finalized";
96
+ }, "Withdrawal details.">]>;
97
+ }, undefined>, v.DescriptionAction<{
98
+ withdrawal: {
99
+ amount: string;
100
+ phase: "initiated" | "finalized";
101
+ };
102
+ }, "Withdrawal operation in a delegator update.">]>;
103
+ export type DelegatorUpdateWithdrawal = v.InferOutput<typeof DelegatorUpdateWithdrawal>;
104
+ /** Record of a staking event by a delegator. */
105
+ export declare const DelegatorUpdate: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
106
+ /** Timestamp of the delegation event (in ms since epoch). */
107
+ readonly time: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Timestamp of the delegation event (in ms since epoch).">]>;
108
+ /** Transaction hash of the delegation event. */
109
+ readonly hash: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>]>, v.DescriptionAction<`0x${string}`, "Transaction hash of the delegation event.">]>;
110
+ /** Details of the update. */
111
+ readonly delta: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
112
+ /** Delegation operation details. */
113
+ readonly delegate: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
114
+ /** Address of the validator receiving or losing delegation. */
115
+ readonly validator: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "Address of the validator receiving or losing delegation.">]>;
116
+ /** Amount of tokens being delegated or undelegated. */
117
+ readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Amount of tokens being delegated or undelegated.">]>;
118
+ /** Whether this is an undelegation operation. */
119
+ readonly isUndelegate: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether this is an undelegation operation.">]>;
120
+ }, undefined>, v.DescriptionAction<{
121
+ validator: `0x${string}`;
122
+ amount: string;
123
+ isUndelegate: boolean;
124
+ }, "Delegation operation details.">]>;
125
+ }, undefined>, v.DescriptionAction<{
126
+ delegate: {
127
+ validator: `0x${string}`;
128
+ amount: string;
129
+ isUndelegate: boolean;
130
+ };
131
+ }, "Delegation operation in a delegator update.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
132
+ /** Deposit details. */
133
+ readonly cDeposit: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
134
+ /** Amount of tokens being deposited. */
135
+ readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Amount of tokens being deposited.">]>;
136
+ }, undefined>, v.DescriptionAction<{
137
+ amount: string;
138
+ }, "Deposit details.">]>;
139
+ }, undefined>, v.DescriptionAction<{
140
+ cDeposit: {
141
+ amount: string;
142
+ };
143
+ }, "Deposit operation in a delegator update.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
144
+ /** Withdrawal details. */
145
+ readonly withdrawal: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
146
+ /** Amount of tokens being withdrawn. */
147
+ readonly amount: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Amount of tokens being withdrawn.">]>;
148
+ /** Phase of the withdrawal process. */
149
+ readonly phase: v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"initiated", undefined>, v.LiteralSchema<"finalized", undefined>], undefined>, v.DescriptionAction<"initiated" | "finalized", "Phase of the withdrawal process.">]>;
150
+ }, undefined>, v.DescriptionAction<{
151
+ amount: string;
152
+ phase: "initiated" | "finalized";
153
+ }, "Withdrawal details.">]>;
154
+ }, undefined>, v.DescriptionAction<{
155
+ withdrawal: {
156
+ amount: string;
157
+ phase: "initiated" | "finalized";
158
+ };
159
+ }, "Withdrawal operation in a delegator update.">]>], undefined>, v.DescriptionAction<{
160
+ delegate: {
161
+ validator: `0x${string}`;
162
+ amount: string;
163
+ isUndelegate: boolean;
164
+ };
165
+ } | {
166
+ cDeposit: {
167
+ amount: string;
168
+ };
169
+ } | {
170
+ withdrawal: {
171
+ amount: string;
172
+ phase: "initiated" | "finalized";
173
+ };
174
+ }, "Details of the update.">]>;
175
+ }, undefined>, v.DescriptionAction<{
176
+ time: number;
177
+ hash: `0x${string}`;
178
+ delta: {
179
+ delegate: {
180
+ validator: `0x${string}`;
181
+ amount: string;
182
+ isUndelegate: boolean;
183
+ };
184
+ } | {
185
+ cDeposit: {
186
+ amount: string;
187
+ };
188
+ } | {
189
+ withdrawal: {
190
+ amount: string;
191
+ phase: "initiated" | "finalized";
192
+ };
193
+ };
194
+ }, "Record of a staking event by a delegator.">]>;
195
+ export type DelegatorUpdate = v.InferOutput<typeof DelegatorUpdate>;
196
+ /** Statistics for validator performance over a time period. */
197
+ export declare const ValidatorStats: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
198
+ /** Fraction of time the validator was online. */
199
+ readonly uptimeFraction: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Fraction of time the validator was online.">]>;
200
+ /** Predicted annual percentage rate of returns. */
201
+ readonly predictedApr: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Predicted annual percentage rate of returns.">]>;
202
+ /** Number of samples used for statistics calculation. */
203
+ readonly nSamples: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Number of samples used for statistics calculation.">]>;
204
+ }, undefined>, v.DescriptionAction<{
205
+ uptimeFraction: string;
206
+ predictedApr: string;
207
+ nSamples: number;
208
+ }, "Statistics for validator performance over a time period.">]>;
209
+ export type ValidatorStats = v.InferOutput<typeof ValidatorStats>;
210
+ /** Summary of a validator status and performance. */
211
+ export declare const ValidatorSummary: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
212
+ /** Address of the validator. */
213
+ readonly validator: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "Address of the validator.">]>;
214
+ /** Address of the validator signer. */
215
+ readonly signer: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, v.DescriptionAction<`0x${string}`, "Address of the validator signer.">]>;
216
+ /** Name of the validator. */
217
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Name of the validator.">]>;
218
+ /** Description of the validator. */
219
+ readonly description: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Description of the validator.">]>;
220
+ /** Number of blocks produced recently. */
221
+ readonly nRecentBlocks: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Number of blocks produced recently.">]>;
222
+ /** Total amount of tokens staked. */
223
+ readonly stake: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Total amount of tokens staked.">]>;
224
+ /** Whether the validator is currently jailed. */
225
+ readonly isJailed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether the validator is currently jailed.">]>;
226
+ /** Timestamp when the validator can be unjailed (in ms since epoch). */
227
+ readonly unjailableAfter: v.SchemaWithPipe<readonly [v.UnionSchema<[v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.NullSchema<undefined>], undefined>, v.DescriptionAction<number | null, "Timestamp when the validator can be unjailed (in ms since epoch).">]>;
228
+ /** Whether the validator is currently active. */
229
+ readonly isActive: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether the validator is currently active.">]>;
230
+ /** Commission rate charged by the validator. */
231
+ readonly commission: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Commission rate charged by the validator.">]>;
232
+ /** Performance statistics over different time periods. */
233
+ readonly stats: v.SchemaWithPipe<readonly [v.StrictTupleSchema<[v.StrictTupleSchema<[v.LiteralSchema<"day", undefined>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
234
+ /** Fraction of time the validator was online. */
235
+ readonly uptimeFraction: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Fraction of time the validator was online.">]>;
236
+ /** Predicted annual percentage rate of returns. */
237
+ readonly predictedApr: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Predicted annual percentage rate of returns.">]>;
238
+ /** Number of samples used for statistics calculation. */
239
+ readonly nSamples: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Number of samples used for statistics calculation.">]>;
240
+ }, undefined>, v.DescriptionAction<{
241
+ uptimeFraction: string;
242
+ predictedApr: string;
243
+ nSamples: number;
244
+ }, "Statistics for validator performance over a time period.">]>], undefined>, v.StrictTupleSchema<[v.LiteralSchema<"week", undefined>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
245
+ /** Fraction of time the validator was online. */
246
+ readonly uptimeFraction: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Fraction of time the validator was online.">]>;
247
+ /** Predicted annual percentage rate of returns. */
248
+ readonly predictedApr: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Predicted annual percentage rate of returns.">]>;
249
+ /** Number of samples used for statistics calculation. */
250
+ readonly nSamples: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Number of samples used for statistics calculation.">]>;
251
+ }, undefined>, v.DescriptionAction<{
252
+ uptimeFraction: string;
253
+ predictedApr: string;
254
+ nSamples: number;
255
+ }, "Statistics for validator performance over a time period.">]>], undefined>, v.StrictTupleSchema<[v.LiteralSchema<"month", undefined>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
256
+ /** Fraction of time the validator was online. */
257
+ readonly uptimeFraction: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Fraction of time the validator was online.">]>;
258
+ /** Predicted annual percentage rate of returns. */
259
+ readonly predictedApr: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, string>]>, v.DescriptionAction<string, "Predicted annual percentage rate of returns.">]>;
260
+ /** Number of samples used for statistics calculation. */
261
+ readonly nSamples: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Number of samples used for statistics calculation.">]>;
262
+ }, undefined>, v.DescriptionAction<{
263
+ uptimeFraction: string;
264
+ predictedApr: string;
265
+ nSamples: number;
266
+ }, "Statistics for validator performance over a time period.">]>], undefined>], undefined>, v.DescriptionAction<[["day", {
267
+ uptimeFraction: string;
268
+ predictedApr: string;
269
+ nSamples: number;
270
+ }], ["week", {
271
+ uptimeFraction: string;
272
+ predictedApr: string;
273
+ nSamples: number;
274
+ }], ["month", {
275
+ uptimeFraction: string;
276
+ predictedApr: string;
277
+ nSamples: number;
278
+ }]], "Performance statistics over different time periods.">]>;
279
+ }, undefined>, v.DescriptionAction<{
280
+ validator: `0x${string}`;
281
+ signer: `0x${string}`;
282
+ name: string;
283
+ description: string;
284
+ nRecentBlocks: number;
285
+ stake: number;
286
+ isJailed: boolean;
287
+ unjailableAfter: number | null;
288
+ isActive: boolean;
289
+ commission: string;
290
+ stats: [["day", {
291
+ uptimeFraction: string;
292
+ predictedApr: string;
293
+ nSamples: number;
294
+ }], ["week", {
295
+ uptimeFraction: string;
296
+ predictedApr: string;
297
+ nSamples: number;
298
+ }], ["month", {
299
+ uptimeFraction: string;
300
+ predictedApr: string;
301
+ nSamples: number;
302
+ }]];
303
+ }, "Summary of a validator status and performance.">]>;
304
+ export type ValidatorSummary = v.InferOutput<typeof ValidatorSummary>;
305
+ //# sourceMappingURL=validators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../../src/src/schemas/info/validators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAG7B,sCAAsC;AACtC,eAAO,MAAM,UAAU;IAEf,yBAAyB;;IAKzB,mDAAmD;;IAKnD,kDAAkD;;;;;;uCAOzD,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,UAAU,CAAC,CAAC;AAE1D,+CAA+C;AAC/C,eAAO,MAAM,eAAe;IAEpB,kEAAkE;;IAKlE,4BAA4B;;IAK5B,2BAA2B;;;;;;gDAOlC,CAAC;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,eAAe,CAAC,CAAC;AAEpE,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB;IAErB,wCAAwC;;IAKxC,0CAA0C;;IAK1C,iDAAiD;;IAKjD,qCAAqC;;;;;;;8CAO5C,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEtE,kDAAkD;AAClD,eAAO,MAAM,uBAAuB;IAE5B,oCAAoC;;QAG5B,+DAA+D;;QAK/D,uDAAuD;;QAKvD,iDAAiD;;;;;;;;;;;;;mDAUhE,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEpF,+CAA+C;AAC/C,eAAO,MAAM,sBAAsB;IAE3B,uBAAuB;;QAGf,wCAAwC;;;;;;;;;gDAUvD,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAElF,kDAAkD;AAClD,eAAO,MAAM,yBAAyB;IAE9B,0BAA0B;;QAGlB,wCAAwC;;QAKxC,uCAAuC;;;;;;;;;;;mDAUtD,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAExF,gDAAgD;AAChD,eAAO,MAAM,eAAe;IAEpB,6DAA6D;;IAK7D,gDAAgD;;IAKhD,6BAA6B;;QAlF7B,oCAAoC;;YAG5B,+DAA+D;;YAK/D,uDAAuD;;YAKvD,iDAAiD;;;;;;;;;;;;;;QAgBzD,uBAAuB;;YAGf,wCAAwC;;;;;;;;;;QAgBhD,0BAA0B;;YAGlB,wCAAwC;;YAKxC,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAqCtD,CAAC;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,eAAe,CAAC,CAAC;AAEpE,+DAA+D;AAC/D,eAAO,MAAM,cAAc;IAEnB,iDAAiD;;IAKjD,mDAAmD;;IAKnD,yDAAyD;;;;;;gEAOhE,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,cAAc,CAAC,CAAC;AAElE,qDAAqD;AACrD,eAAO,MAAM,gBAAgB;IAErB,gCAAgC;;IAKhC,uCAAuC;;IAKvC,6BAA6B;;IAK7B,oCAAoC;;IAKpC,0CAA0C;;IAK1C,qCAAqC;;IAKrC,iDAAiD;;IAKjD,wEAAwE;;IAKxE,iDAAiD;;IAKjD,gDAAgD;;IAKhD,0DAA0D;;QAzE1D,iDAAiD;;QAKjD,mDAAmD;;QAKnD,yDAAyD;;;;;;;QAVzD,iDAAiD;;QAKjD,mDAAmD;;QAKnD,yDAAyD;;;;;;;QAVzD,iDAAiD;;QAKjD,mDAAmD;;QAKnD,yDAAyD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDA0EhE,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.ValidatorSummary = exports.ValidatorStats = exports.DelegatorUpdate = exports.DelegatorUpdateWithdrawal = exports.DelegatorUpdateDeposit = exports.DelegatorUpdateDelegate = exports.DelegatorSummary = exports.DelegatorReward = exports.Delegation = void 0;
37
+ const v = __importStar(require("valibot"));
38
+ const _base_js_1 = require("../_base.js");
39
+ /** User delegation to a validator. */
40
+ exports.Delegation = v.pipe(v.strictObject({
41
+ /** Validator address. */
42
+ validator: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Validator address.")),
43
+ /** Amount of tokens delegated to the validator. */
44
+ amount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of tokens delegated to the validator.")),
45
+ /** Locked until timestamp (in ms since epoch). */
46
+ lockedUntilTimestamp: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Locked until timestamp (in ms since epoch).")),
47
+ }), v.description("User delegation to a validator."));
48
+ /** Reward received from staking activities. */
49
+ exports.DelegatorReward = v.pipe(v.strictObject({
50
+ /** Timestamp when the reward was received (in ms since epoch). */
51
+ time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when the reward was received (in ms since epoch).")),
52
+ /** Source of the reward. */
53
+ source: v.pipe(v.union([v.literal("delegation"), v.literal("commission")]), v.description("Source of the reward.")),
54
+ /** Total reward amount. */
55
+ totalAmount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total reward amount.")),
56
+ }), v.description("Reward received from staking activities."));
57
+ /** Summary of a user staking delegations. */
58
+ exports.DelegatorSummary = v.pipe(v.strictObject({
59
+ /** Total amount of delegated tokens. */
60
+ delegated: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total amount of delegated tokens.")),
61
+ /** Total amount of undelegated tokens. */
62
+ undelegated: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total amount of undelegated tokens.")),
63
+ /** Total amount of tokens pending withdrawal. */
64
+ totalPendingWithdrawal: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total amount of tokens pending withdrawal.")),
65
+ /** Number of pending withdrawals. */
66
+ nPendingWithdrawals: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Number of pending withdrawals.")),
67
+ }), v.description("Summary of a user staking delegations."));
68
+ /** Delegation operation in a delegator update. */
69
+ exports.DelegatorUpdateDelegate = v.pipe(v.strictObject({
70
+ /** Delegation operation details. */
71
+ delegate: v.pipe(v.strictObject({
72
+ /** Address of the validator receiving or losing delegation. */
73
+ validator: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the validator receiving or losing delegation.")),
74
+ /** Amount of tokens being delegated or undelegated. */
75
+ amount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of tokens being delegated or undelegated.")),
76
+ /** Whether this is an undelegation operation. */
77
+ isUndelegate: v.pipe(v.boolean(), v.description("Whether this is an undelegation operation.")),
78
+ }), v.description("Delegation operation details.")),
79
+ }), v.description("Delegation operation in a delegator update."));
80
+ /** Deposit operation in a delegator update. */
81
+ exports.DelegatorUpdateDeposit = v.pipe(v.strictObject({
82
+ /** Deposit details. */
83
+ cDeposit: v.pipe(v.strictObject({
84
+ /** Amount of tokens being deposited. */
85
+ amount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of tokens being deposited.")),
86
+ }), v.description("Deposit details.")),
87
+ }), v.description("Deposit operation in a delegator update."));
88
+ /** Withdrawal operation in a delegator update. */
89
+ exports.DelegatorUpdateWithdrawal = v.pipe(v.strictObject({
90
+ /** Withdrawal details. */
91
+ withdrawal: v.pipe(v.strictObject({
92
+ /** Amount of tokens being withdrawn. */
93
+ amount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of tokens being withdrawn.")),
94
+ /** Phase of the withdrawal process. */
95
+ phase: v.pipe(v.union([v.literal("initiated"), v.literal("finalized")]), v.description("Phase of the withdrawal process.")),
96
+ }), v.description("Withdrawal details.")),
97
+ }), v.description("Withdrawal operation in a delegator update."));
98
+ /** Record of a staking event by a delegator. */
99
+ exports.DelegatorUpdate = v.pipe(v.strictObject({
100
+ /** Timestamp of the delegation event (in ms since epoch). */
101
+ time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp of the delegation event (in ms since epoch).")),
102
+ /** Transaction hash of the delegation event. */
103
+ hash: v.pipe(v.pipe(_base_js_1.Hex, v.length(66)), v.description("Transaction hash of the delegation event.")),
104
+ /** Details of the update. */
105
+ delta: v.pipe(v.union([
106
+ exports.DelegatorUpdateDelegate,
107
+ exports.DelegatorUpdateDeposit,
108
+ exports.DelegatorUpdateWithdrawal,
109
+ ]), v.description("Details of the update.")),
110
+ }), v.description("Record of a staking event by a delegator."));
111
+ /** Statistics for validator performance over a time period. */
112
+ exports.ValidatorStats = v.pipe(v.strictObject({
113
+ /** Fraction of time the validator was online. */
114
+ uptimeFraction: v.pipe(v.string(), v.description("Fraction of time the validator was online.")),
115
+ /** Predicted annual percentage rate of returns. */
116
+ predictedApr: v.pipe(_base_js_1.UnsignedDecimal, v.description("Predicted annual percentage rate of returns.")),
117
+ /** Number of samples used for statistics calculation. */
118
+ nSamples: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Number of samples used for statistics calculation.")),
119
+ }), v.description("Statistics for validator performance over a time period."));
120
+ /** Summary of a validator status and performance. */
121
+ exports.ValidatorSummary = v.pipe(v.strictObject({
122
+ /** Address of the validator. */
123
+ validator: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the validator.")),
124
+ /** Address of the validator signer. */
125
+ signer: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the validator signer.")),
126
+ /** Name of the validator. */
127
+ name: v.pipe(v.string(), v.description("Name of the validator.")),
128
+ /** Description of the validator. */
129
+ description: v.pipe(v.string(), v.description("Description of the validator.")),
130
+ /** Number of blocks produced recently. */
131
+ nRecentBlocks: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Number of blocks produced recently.")),
132
+ /** Total amount of tokens staked. */
133
+ stake: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Total amount of tokens staked.")),
134
+ /** Whether the validator is currently jailed. */
135
+ isJailed: v.pipe(v.boolean(), v.description("Whether the validator is currently jailed.")),
136
+ /** Timestamp when the validator can be unjailed (in ms since epoch). */
137
+ unjailableAfter: v.pipe(v.union([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.null()]), v.description("Timestamp when the validator can be unjailed (in ms since epoch).")),
138
+ /** Whether the validator is currently active. */
139
+ isActive: v.pipe(v.boolean(), v.description("Whether the validator is currently active.")),
140
+ /** Commission rate charged by the validator. */
141
+ commission: v.pipe(_base_js_1.UnsignedDecimal, v.description("Commission rate charged by the validator.")),
142
+ /** Performance statistics over different time periods. */
143
+ stats: v.pipe(v.strictTuple([
144
+ v.strictTuple([v.literal("day"), exports.ValidatorStats]),
145
+ v.strictTuple([v.literal("week"), exports.ValidatorStats]),
146
+ v.strictTuple([v.literal("month"), exports.ValidatorStats]),
147
+ ]), v.description("Performance statistics over different time periods.")),
148
+ }), v.description("Summary of a validator status and performance."));