@waterx/sdk 2.1.0

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 (245) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +204 -0
  3. package/dist/src/client.d.ts +109 -0
  4. package/dist/src/client.js +197 -0
  5. package/dist/src/config.d.ts +229 -0
  6. package/dist/src/config.js +107 -0
  7. package/dist/src/constants.d.ts +64 -0
  8. package/dist/src/constants.js +71 -0
  9. package/dist/src/fetch.d.ts +144 -0
  10. package/dist/src/fetch.js +419 -0
  11. package/dist/src/generated/bucket_v2_framework/account.d.ts +107 -0
  12. package/dist/src/generated/bucket_v2_framework/account.js +129 -0
  13. package/dist/src/generated/bucket_v2_framework/deps/std/type_name.d.ts +17 -0
  14. package/dist/src/generated/bucket_v2_framework/deps/std/type_name.js +19 -0
  15. package/dist/src/generated/bucket_v2_framework/deps/sui/balance.d.ts +12 -0
  16. package/dist/src/generated/bucket_v2_framework/deps/sui/balance.js +14 -0
  17. package/dist/src/generated/bucket_v2_framework/deps/sui/vec_map.d.ts +36 -0
  18. package/dist/src/generated/bucket_v2_framework/deps/sui/vec_map.js +27 -0
  19. package/dist/src/generated/bucket_v2_framework/deps/sui/vec_set.d.ts +16 -0
  20. package/dist/src/generated/bucket_v2_framework/deps/sui/vec_set.js +19 -0
  21. package/dist/src/generated/bucket_v2_framework/double.d.ts +384 -0
  22. package/dist/src/generated/bucket_v2_framework/double.js +466 -0
  23. package/dist/src/generated/bucket_v2_framework/float.d.ts +364 -0
  24. package/dist/src/generated/bucket_v2_framework/float.js +440 -0
  25. package/dist/src/generated/bucket_v2_framework/liability.d.ts +197 -0
  26. package/dist/src/generated/bucket_v2_framework/liability.js +205 -0
  27. package/dist/src/generated/bucket_v2_framework/linked_table.d.ts +384 -0
  28. package/dist/src/generated/bucket_v2_framework/linked_table.js +382 -0
  29. package/dist/src/generated/bucket_v2_framework/sheet.d.ts +424 -0
  30. package/dist/src/generated/bucket_v2_framework/sheet.js +344 -0
  31. package/dist/src/generated/native_custody/custody_vault.d.ts +572 -0
  32. package/dist/src/generated/native_custody/custody_vault.js +483 -0
  33. package/dist/src/generated/native_custody/deps/bucket_v2_framework/float.d.ts +8 -0
  34. package/dist/src/generated/native_custody/deps/bucket_v2_framework/float.js +10 -0
  35. package/dist/src/generated/native_custody/deps/bucket_v2_framework/liability.d.ts +11 -0
  36. package/dist/src/generated/native_custody/deps/bucket_v2_framework/liability.js +13 -0
  37. package/dist/src/generated/native_custody/deps/bucket_v2_framework/sheet.d.ts +49 -0
  38. package/dist/src/generated/native_custody/deps/bucket_v2_framework/sheet.js +18 -0
  39. package/dist/src/generated/native_custody/deps/std/type_name.d.ts +17 -0
  40. package/dist/src/generated/native_custody/deps/std/type_name.js +19 -0
  41. package/dist/src/generated/native_custody/deps/sui/balance.d.ts +12 -0
  42. package/dist/src/generated/native_custody/deps/sui/balance.js +14 -0
  43. package/dist/src/generated/native_custody/deps/sui/vec_map.d.ts +36 -0
  44. package/dist/src/generated/native_custody/deps/sui/vec_map.js +27 -0
  45. package/dist/src/generated/native_custody/deps/sui/vec_set.d.ts +16 -0
  46. package/dist/src/generated/native_custody/deps/sui/vec_set.js +19 -0
  47. package/dist/src/generated/native_custody/events.d.ts +36 -0
  48. package/dist/src/generated/native_custody/events.js +36 -0
  49. package/dist/src/generated/pyth_sponsor_rule/deps/sui/balance.d.ts +12 -0
  50. package/dist/src/generated/pyth_sponsor_rule/deps/sui/balance.js +14 -0
  51. package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.d.ts +68 -0
  52. package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.js +74 -0
  53. package/dist/src/generated/utils/index.d.ts +30 -0
  54. package/dist/src/generated/utils/index.js +157 -0
  55. package/dist/src/generated/waterx_account/account.d.ts +1818 -0
  56. package/dist/src/generated/waterx_account/account.js +1723 -0
  57. package/dist/src/generated/waterx_account/deps/bucket_v2_framework/liability.d.ts +11 -0
  58. package/dist/src/generated/waterx_account/deps/bucket_v2_framework/liability.js +13 -0
  59. package/dist/src/generated/waterx_account/deps/bucket_v2_framework/sheet.d.ts +49 -0
  60. package/dist/src/generated/waterx_account/deps/bucket_v2_framework/sheet.js +18 -0
  61. package/dist/src/generated/waterx_account/deps/std/type_name.d.ts +17 -0
  62. package/dist/src/generated/waterx_account/deps/std/type_name.js +19 -0
  63. package/dist/src/generated/waterx_account/deps/sui/balance.d.ts +12 -0
  64. package/dist/src/generated/waterx_account/deps/sui/balance.js +14 -0
  65. package/dist/src/generated/waterx_account/deps/sui/object_table.d.ts +17 -0
  66. package/dist/src/generated/waterx_account/deps/sui/object_table.js +19 -0
  67. package/dist/src/generated/waterx_account/deps/sui/table.d.ts +29 -0
  68. package/dist/src/generated/waterx_account/deps/sui/table.js +31 -0
  69. package/dist/src/generated/waterx_account/deps/sui/vec_map.d.ts +36 -0
  70. package/dist/src/generated/waterx_account/deps/sui/vec_map.js +27 -0
  71. package/dist/src/generated/waterx_account/deps/sui/vec_set.d.ts +16 -0
  72. package/dist/src/generated/waterx_account/deps/sui/vec_set.js +19 -0
  73. package/dist/src/generated/waterx_account/direct_rule.d.ts +77 -0
  74. package/dist/src/generated/waterx_account/direct_rule.js +78 -0
  75. package/dist/src/generated/waterx_account/events.d.ts +180 -0
  76. package/dist/src/generated/waterx_account/events.js +156 -0
  77. package/dist/src/generated/waterx_account/version.d.ts +10 -0
  78. package/dist/src/generated/waterx_account/version.js +8 -0
  79. package/dist/src/generated/waterx_credit/credit_registry.d.ts +708 -0
  80. package/dist/src/generated/waterx_credit/credit_registry.js +658 -0
  81. package/dist/src/generated/waterx_credit/deps/std/type_name.d.ts +17 -0
  82. package/dist/src/generated/waterx_credit/deps/std/type_name.js +19 -0
  83. package/dist/src/generated/waterx_credit/deps/sui/table.d.ts +29 -0
  84. package/dist/src/generated/waterx_credit/deps/sui/table.js +31 -0
  85. package/dist/src/generated/waterx_credit/deps/sui/vec_map.d.ts +36 -0
  86. package/dist/src/generated/waterx_credit/deps/sui/vec_map.js +27 -0
  87. package/dist/src/generated/waterx_credit/deps/sui/vec_set.d.ts +16 -0
  88. package/dist/src/generated/waterx_credit/deps/sui/vec_set.js +19 -0
  89. package/dist/src/generated/waterx_credit/limited_supply.d.ts +107 -0
  90. package/dist/src/generated/waterx_credit/limited_supply.js +131 -0
  91. package/dist/src/generated/waterx_oracle/aggregator.d.ts +211 -0
  92. package/dist/src/generated/waterx_oracle/aggregator.js +213 -0
  93. package/dist/src/generated/waterx_oracle/collector.d.ts +119 -0
  94. package/dist/src/generated/waterx_oracle/collector.js +105 -0
  95. package/dist/src/generated/waterx_oracle/deps/bucket_v2_framework/float.d.ts +8 -0
  96. package/dist/src/generated/waterx_oracle/deps/bucket_v2_framework/float.js +10 -0
  97. package/dist/src/generated/waterx_oracle/deps/std/type_name.d.ts +17 -0
  98. package/dist/src/generated/waterx_oracle/deps/std/type_name.js +19 -0
  99. package/dist/src/generated/waterx_oracle/deps/sui/vec_map.d.ts +36 -0
  100. package/dist/src/generated/waterx_oracle/deps/sui/vec_map.js +27 -0
  101. package/dist/src/generated/waterx_oracle/deps/sui/vec_set.d.ts +16 -0
  102. package/dist/src/generated/waterx_oracle/deps/sui/vec_set.js +19 -0
  103. package/dist/src/generated/waterx_oracle/oracle.d.ts +298 -0
  104. package/dist/src/generated/waterx_oracle/oracle.js +323 -0
  105. package/dist/src/generated/waterx_oracle/version.d.ts +10 -0
  106. package/dist/src/generated/waterx_oracle/version.js +8 -0
  107. package/dist/src/generated/waterx_perp/account_data.d.ts +269 -0
  108. package/dist/src/generated/waterx_perp/account_data.js +284 -0
  109. package/dist/src/generated/waterx_perp/admin.d.ts +19 -0
  110. package/dist/src/generated/waterx_perp/admin.js +22 -0
  111. package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/double.d.ts +8 -0
  112. package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/double.js +10 -0
  113. package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/float.d.ts +8 -0
  114. package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/float.js +10 -0
  115. package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/liability.d.ts +11 -0
  116. package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/liability.js +13 -0
  117. package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/linked_table.d.ts +8 -0
  118. package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/linked_table.js +18 -0
  119. package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/sheet.d.ts +49 -0
  120. package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/sheet.js +18 -0
  121. package/dist/src/generated/waterx_perp/deps/std/type_name.d.ts +17 -0
  122. package/dist/src/generated/waterx_perp/deps/std/type_name.js +19 -0
  123. package/dist/src/generated/waterx_perp/deps/sui/balance.d.ts +15 -0
  124. package/dist/src/generated/waterx_perp/deps/sui/balance.js +17 -0
  125. package/dist/src/generated/waterx_perp/deps/sui/coin.d.ts +14 -0
  126. package/dist/src/generated/waterx_perp/deps/sui/coin.js +15 -0
  127. package/dist/src/generated/waterx_perp/deps/sui/vec_map.d.ts +36 -0
  128. package/dist/src/generated/waterx_perp/deps/sui/vec_map.js +27 -0
  129. package/dist/src/generated/waterx_perp/deps/sui/vec_set.d.ts +16 -0
  130. package/dist/src/generated/waterx_perp/deps/sui/vec_set.js +19 -0
  131. package/dist/src/generated/waterx_perp/events.d.ts +1283 -0
  132. package/dist/src/generated/waterx_perp/events.js +1018 -0
  133. package/dist/src/generated/waterx_perp/global_config.d.ts +775 -0
  134. package/dist/src/generated/waterx_perp/global_config.js +836 -0
  135. package/dist/src/generated/waterx_perp/keyed_big_vector.d.ts +553 -0
  136. package/dist/src/generated/waterx_perp/keyed_big_vector.js +554 -0
  137. package/dist/src/generated/waterx_perp/lp_pool.d.ts +1648 -0
  138. package/dist/src/generated/waterx_perp/lp_pool.js +1521 -0
  139. package/dist/src/generated/waterx_perp/market_config.d.ts +715 -0
  140. package/dist/src/generated/waterx_perp/market_config.js +780 -0
  141. package/dist/src/generated/waterx_perp/math.d.ts +63 -0
  142. package/dist/src/generated/waterx_perp/math.js +64 -0
  143. package/dist/src/generated/waterx_perp/memo.d.ts +251 -0
  144. package/dist/src/generated/waterx_perp/memo.js +323 -0
  145. package/dist/src/generated/waterx_perp/order_book.d.ts +290 -0
  146. package/dist/src/generated/waterx_perp/order_book.js +329 -0
  147. package/dist/src/generated/waterx_perp/position.d.ts +1005 -0
  148. package/dist/src/generated/waterx_perp/position.js +1103 -0
  149. package/dist/src/generated/waterx_perp/request.d.ts +544 -0
  150. package/dist/src/generated/waterx_perp/request.js +541 -0
  151. package/dist/src/generated/waterx_perp/response.d.ts +247 -0
  152. package/dist/src/generated/waterx_perp/response.js +280 -0
  153. package/dist/src/generated/waterx_perp/trading.d.ts +2821 -0
  154. package/dist/src/generated/waterx_perp/trading.js +2372 -0
  155. package/dist/src/generated/waterx_perp/version.d.ts +10 -0
  156. package/dist/src/generated/waterx_perp/version.js +8 -0
  157. package/dist/src/generated/waterx_perp/witness.d.ts +18 -0
  158. package/dist/src/generated/waterx_perp/witness.js +21 -0
  159. package/dist/src/generated/waterx_perp_view/deps/std/type_name.d.ts +17 -0
  160. package/dist/src/generated/waterx_perp_view/deps/std/type_name.js +19 -0
  161. package/dist/src/generated/waterx_perp_view/view.d.ts +447 -0
  162. package/dist/src/generated/waterx_perp_view/view.js +414 -0
  163. package/dist/src/generated/waterx_pyth_rule/deps/sui/vec_map.d.ts +36 -0
  164. package/dist/src/generated/waterx_pyth_rule/deps/sui/vec_map.js +27 -0
  165. package/dist/src/generated/waterx_pyth_rule/pyth_rule.d.ts +90 -0
  166. package/dist/src/generated/waterx_pyth_rule/pyth_rule.js +72 -0
  167. package/dist/src/generated/waterx_referral/deps/sui/table.d.ts +29 -0
  168. package/dist/src/generated/waterx_referral/deps/sui/table.js +31 -0
  169. package/dist/src/generated/waterx_referral/deps/sui/vec_set.d.ts +16 -0
  170. package/dist/src/generated/waterx_referral/deps/sui/vec_set.js +19 -0
  171. package/dist/src/generated/waterx_referral/referral_table.d.ts +171 -0
  172. package/dist/src/generated/waterx_referral/referral_table.js +192 -0
  173. package/dist/src/generated/waterx_staking/deps/bucket_v2_framework/double.d.ts +8 -0
  174. package/dist/src/generated/waterx_staking/deps/bucket_v2_framework/double.js +10 -0
  175. package/dist/src/generated/waterx_staking/deps/sui/balance.d.ts +12 -0
  176. package/dist/src/generated/waterx_staking/deps/sui/balance.js +14 -0
  177. package/dist/src/generated/waterx_staking/deps/sui/table.d.ts +29 -0
  178. package/dist/src/generated/waterx_staking/deps/sui/table.js +31 -0
  179. package/dist/src/generated/waterx_staking/deps/sui/vec_set.d.ts +16 -0
  180. package/dist/src/generated/waterx_staking/deps/sui/vec_set.js +19 -0
  181. package/dist/src/generated/waterx_staking/waterx_staking.d.ts +746 -0
  182. package/dist/src/generated/waterx_staking/waterx_staking.js +731 -0
  183. package/dist/src/generated/waterx_staking/witness.d.ts +16 -0
  184. package/dist/src/generated/waterx_staking/witness.js +18 -0
  185. package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/linked_table.d.ts +8 -0
  186. package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/linked_table.js +18 -0
  187. package/dist/src/generated/withdrawal_queue/deps/std/type_name.d.ts +17 -0
  188. package/dist/src/generated/withdrawal_queue/deps/std/type_name.js +19 -0
  189. package/dist/src/generated/withdrawal_queue/deps/sui/balance.d.ts +12 -0
  190. package/dist/src/generated/withdrawal_queue/deps/sui/balance.js +14 -0
  191. package/dist/src/generated/withdrawal_queue/deps/sui/vec_set.d.ts +16 -0
  192. package/dist/src/generated/withdrawal_queue/deps/sui/vec_set.js +19 -0
  193. package/dist/src/generated/withdrawal_queue/withdrawal_queue.d.ts +483 -0
  194. package/dist/src/generated/withdrawal_queue/withdrawal_queue.js +480 -0
  195. package/dist/src/generated/wlp/wlp.d.ts +28 -0
  196. package/dist/src/generated/wlp/wlp.js +32 -0
  197. package/dist/src/generated/wormhole_bridge/deps/sui/table.d.ts +29 -0
  198. package/dist/src/generated/wormhole_bridge/deps/sui/table.js +31 -0
  199. package/dist/src/generated/wormhole_bridge/deps/sui/vec_map.d.ts +36 -0
  200. package/dist/src/generated/wormhole_bridge/deps/sui/vec_map.js +27 -0
  201. package/dist/src/generated/wormhole_bridge/deps/sui/vec_set.d.ts +16 -0
  202. package/dist/src/generated/wormhole_bridge/deps/sui/vec_set.js +19 -0
  203. package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/consumed_vaas.d.ts +12 -0
  204. package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/consumed_vaas.js +9 -0
  205. package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/emitter.d.ts +14 -0
  206. package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/emitter.js +16 -0
  207. package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/set.d.ts +16 -0
  208. package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/set.js +15 -0
  209. package/dist/src/generated/wormhole_bridge/events.d.ts +32 -0
  210. package/dist/src/generated/wormhole_bridge/events.js +28 -0
  211. package/dist/src/generated/wormhole_bridge/wormhole_bridge.d.ts +498 -0
  212. package/dist/src/generated/wormhole_bridge/wormhole_bridge.js +494 -0
  213. package/dist/src/index.d.ts +28 -0
  214. package/dist/src/index.js +34 -0
  215. package/dist/src/tx-builders.d.ts +242 -0
  216. package/dist/src/tx-builders.js +320 -0
  217. package/dist/src/user/account.d.ts +129 -0
  218. package/dist/src/user/account.js +166 -0
  219. package/dist/src/user/credit.d.ts +135 -0
  220. package/dist/src/user/credit.js +255 -0
  221. package/dist/src/user/custody.d.ts +71 -0
  222. package/dist/src/user/custody.js +112 -0
  223. package/dist/src/user/index.d.ts +8 -0
  224. package/dist/src/user/index.js +8 -0
  225. package/dist/src/user/order.d.ts +89 -0
  226. package/dist/src/user/order.js +134 -0
  227. package/dist/src/user/referral.d.ts +21 -0
  228. package/dist/src/user/referral.js +41 -0
  229. package/dist/src/user/staking.d.ts +54 -0
  230. package/dist/src/user/staking.js +109 -0
  231. package/dist/src/user/trading.d.ts +119 -0
  232. package/dist/src/user/trading.js +262 -0
  233. package/dist/src/user/wlp.d.ts +58 -0
  234. package/dist/src/user/wlp.js +99 -0
  235. package/dist/src/utils/account-request.d.ts +9 -0
  236. package/dist/src/utils/account-request.js +17 -0
  237. package/dist/src/utils/config.d.ts +11 -0
  238. package/dist/src/utils/config.js +15 -0
  239. package/dist/src/utils/math.d.ts +201 -0
  240. package/dist/src/utils/math.js +343 -0
  241. package/dist/src/utils/pyth.d.ts +89 -0
  242. package/dist/src/utils/pyth.js +316 -0
  243. package/dist/src/utils/wormhole.d.ts +86 -0
  244. package/dist/src/utils/wormhole.js +154 -0
  245. package/package.json +66 -0
@@ -0,0 +1,213 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Per-ticker price aggregator. Stored as a DOF child on `Oracle`. */
5
+ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
6
+ import { bcs } from '@mysten/sui/bcs';
7
+ import * as vec_map from "./deps/sui/vec_map.js";
8
+ import * as type_name from "./deps/std/type_name.js";
9
+ import * as float from "./deps/bucket_v2_framework/float.js";
10
+ import * as float_1 from "./deps/bucket_v2_framework/float.js";
11
+ const $moduleName = '@waterx/oracle::aggregator';
12
+ export const NewPriceAggregator = new MoveStruct({ name: `${$moduleName}::NewPriceAggregator`, fields: {
13
+ aggregator_id: bcs.Address,
14
+ symbol: bcs.string(),
15
+ weight_threshold: bcs.u64(),
16
+ outlier_tolerance_bps: bcs.u64()
17
+ } });
18
+ export const WeightUpdated = new MoveStruct({ name: `${$moduleName}::WeightUpdated`, fields: {
19
+ aggregator_id: bcs.Address,
20
+ symbol: bcs.string(),
21
+ rule_type: bcs.string(),
22
+ weight: bcs.u8()
23
+ } });
24
+ export const ThresholdUpdated = new MoveStruct({ name: `${$moduleName}::ThresholdUpdated`, fields: {
25
+ aggregator_id: bcs.Address,
26
+ symbol: bcs.string(),
27
+ weight_threshold: bcs.u64()
28
+ } });
29
+ export const OutlierToleranceUpdated = new MoveStruct({ name: `${$moduleName}::OutlierToleranceUpdated`, fields: {
30
+ aggregator_id: bcs.Address,
31
+ symbol: bcs.string(),
32
+ outlier_tolerance_bps: bcs.u64()
33
+ } });
34
+ export const PriceAggregated = new MoveStruct({ name: `${$moduleName}::PriceAggregated`, fields: {
35
+ aggregator_id: bcs.Address,
36
+ symbol: bcs.string(),
37
+ sources: bcs.vector(bcs.string()),
38
+ prices: bcs.vector(bcs.u128()),
39
+ weights: bcs.vector(bcs.u8()),
40
+ current_threshold: bcs.u64(),
41
+ result: bcs.u128(),
42
+ timestamp_ms: bcs.u64()
43
+ } });
44
+ export const HistoricalPriceRegistered = new MoveStruct({ name: `${$moduleName}::HistoricalPriceRegistered`, fields: {
45
+ aggregator_id: bcs.Address,
46
+ symbol: bcs.string(),
47
+ sources: bcs.vector(bcs.string()),
48
+ prices: bcs.vector(bcs.u128()),
49
+ weights: bcs.vector(bcs.u8()),
50
+ current_threshold: bcs.u64(),
51
+ result: bcs.u128(),
52
+ timestamp_ms: bcs.u64()
53
+ } });
54
+ export const PriceAggregator = new MoveStruct({ name: `${$moduleName}::PriceAggregator`, fields: {
55
+ id: bcs.Address,
56
+ /** Ticker, e.g., `b"BTC_USD".to_string()`. */
57
+ symbol: bcs.string(),
58
+ /** Rule type -> weight. Entries with weight=0 are removed. */
59
+ weights: vec_map.VecMap(type_name.TypeName, bcs.u8()),
60
+ /** Minimum total weight of contributing rules required to aggregate. */
61
+ weight_threshold: bcs.u64(),
62
+ /** Maximum allowed deviation from the weighted-average price. */
63
+ outlier_tolerance: float.Float,
64
+ /** Latest aggregated price. */
65
+ latest_price: float_1.Float,
66
+ /** `clock.timestamp_ms()` at the time `aggregate` ran. */
67
+ last_update_ms: bcs.u64(),
68
+ /** Number of exact timestamp snapshots stored as dynamic fields on this aggregator. */
69
+ history_count: bcs.u64()
70
+ } });
71
+ export function symbol(options) {
72
+ const packageAddress = options.package ?? '@waterx/oracle';
73
+ const argumentsTypes = [
74
+ null
75
+ ];
76
+ const parameterNames = ["self"];
77
+ return (tx) => tx.moveCall({
78
+ package: packageAddress,
79
+ module: 'aggregator',
80
+ function: 'symbol',
81
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
82
+ });
83
+ }
84
+ export function weights(options) {
85
+ const packageAddress = options.package ?? '@waterx/oracle';
86
+ const argumentsTypes = [
87
+ null
88
+ ];
89
+ const parameterNames = ["self"];
90
+ return (tx) => tx.moveCall({
91
+ package: packageAddress,
92
+ module: 'aggregator',
93
+ function: 'weights',
94
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
95
+ });
96
+ }
97
+ export function weightThreshold(options) {
98
+ const packageAddress = options.package ?? '@waterx/oracle';
99
+ const argumentsTypes = [
100
+ null
101
+ ];
102
+ const parameterNames = ["self"];
103
+ return (tx) => tx.moveCall({
104
+ package: packageAddress,
105
+ module: 'aggregator',
106
+ function: 'weight_threshold',
107
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
108
+ });
109
+ }
110
+ export function outlierTolerance(options) {
111
+ const packageAddress = options.package ?? '@waterx/oracle';
112
+ const argumentsTypes = [
113
+ null
114
+ ];
115
+ const parameterNames = ["self"];
116
+ return (tx) => tx.moveCall({
117
+ package: packageAddress,
118
+ module: 'aggregator',
119
+ function: 'outlier_tolerance',
120
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
121
+ });
122
+ }
123
+ export function latestPrice(options) {
124
+ const packageAddress = options.package ?? '@waterx/oracle';
125
+ const argumentsTypes = [
126
+ null
127
+ ];
128
+ const parameterNames = ["self"];
129
+ return (tx) => tx.moveCall({
130
+ package: packageAddress,
131
+ module: 'aggregator',
132
+ function: 'latest_price',
133
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
134
+ });
135
+ }
136
+ export function lastUpdateMs(options) {
137
+ const packageAddress = options.package ?? '@waterx/oracle';
138
+ const argumentsTypes = [
139
+ null
140
+ ];
141
+ const parameterNames = ["self"];
142
+ return (tx) => tx.moveCall({
143
+ package: packageAddress,
144
+ module: 'aggregator',
145
+ function: 'last_update_ms',
146
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
147
+ });
148
+ }
149
+ export function historyCount(options) {
150
+ const packageAddress = options.package ?? '@waterx/oracle';
151
+ const argumentsTypes = [
152
+ null
153
+ ];
154
+ const parameterNames = ["self"];
155
+ return (tx) => tx.moveCall({
156
+ package: packageAddress,
157
+ module: 'aggregator',
158
+ function: 'history_count',
159
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
160
+ });
161
+ }
162
+ /**
163
+ * Returns the latest price when `timestamp_ms` is `none`, otherwise the exact
164
+ * historical price written at `timestamp_ms`.
165
+ */
166
+ export function priceAtTimestamp(options) {
167
+ const packageAddress = options.package ?? '@waterx/oracle';
168
+ const argumentsTypes = [
169
+ null,
170
+ '0x1::option::Option<u64>'
171
+ ];
172
+ const parameterNames = ["self", "timestampMs"];
173
+ return (tx) => tx.moveCall({
174
+ package: packageAddress,
175
+ module: 'aggregator',
176
+ function: 'price_at_timestamp',
177
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
178
+ });
179
+ }
180
+ export function hasPriceAtTimestamp(options) {
181
+ const packageAddress = options.package ?? '@waterx/oracle';
182
+ const argumentsTypes = [
183
+ null,
184
+ 'u64'
185
+ ];
186
+ const parameterNames = ["self", "timestampMs"];
187
+ return (tx) => tx.moveCall({
188
+ package: packageAddress,
189
+ module: 'aggregator',
190
+ function: 'has_price_at_timestamp',
191
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
192
+ });
193
+ }
194
+ /**
195
+ * Removes the exact historical price snapshot at `timestamp_ms`.
196
+ *
197
+ * This only deletes history dynamic fields. It never changes `latest_price` or
198
+ * `last_update_ms`, so consumers can still read the latest oracle value.
199
+ */
200
+ export function removePriceAtTimestamp(options) {
201
+ const packageAddress = options.package ?? '@waterx/oracle';
202
+ const argumentsTypes = [
203
+ null,
204
+ 'u64'
205
+ ];
206
+ const parameterNames = ["self", "timestampMs"];
207
+ return (tx) => tx.moveCall({
208
+ package: packageAddress,
209
+ module: 'aggregator',
210
+ function: 'remove_price_at_timestamp',
211
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
212
+ });
213
+ }
@@ -0,0 +1,119 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Hot-potato collector for oracle rules feeding prices for a single ticker. */
5
+ import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
6
+ import { type BcsType } from '@mysten/sui/bcs';
7
+ import { type Transaction } from '@mysten/sui/transactions';
8
+ export declare const PriceObservation: MoveStruct<{
9
+ price: MoveStruct<{
10
+ value: BcsType<string, string | number | bigint, "u128">;
11
+ }, "bucket_v2_framework::float::Float">;
12
+ timestamp_ms: BcsType<string | null, string | number | bigint | null | undefined, "Option<u64>">;
13
+ }, "@waterx/oracle::collector::PriceObservation">;
14
+ export declare const PriceCollector: MoveStruct<{
15
+ symbol: BcsType<string, string, "string">;
16
+ contents: MoveStruct<{
17
+ contents: BcsType<{
18
+ key: {
19
+ name: string;
20
+ };
21
+ value: {
22
+ price: {
23
+ value: string;
24
+ };
25
+ timestamp_ms: string | null;
26
+ } | null;
27
+ }[], Iterable<{
28
+ key: {
29
+ name: string;
30
+ };
31
+ value: {
32
+ price: {
33
+ value: string | number | bigint;
34
+ };
35
+ timestamp_ms: string | number | bigint | null | undefined;
36
+ } | null | undefined;
37
+ }> & {
38
+ length: number;
39
+ }, string>;
40
+ }, "0x2::vec_map::VecMap<std::type_name::TypeName, Option<@waterx/oracle::collector::PriceObservation>>">;
41
+ }, "@waterx/oracle::collector::PriceCollector">;
42
+ export interface SymbolArguments {
43
+ c: RawTransactionArgument<string>;
44
+ }
45
+ export interface SymbolOptions {
46
+ package?: string;
47
+ arguments: SymbolArguments | [
48
+ c: RawTransactionArgument<string>
49
+ ];
50
+ }
51
+ export declare function symbol(options: SymbolOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
52
+ export interface ContentsArguments {
53
+ c: RawTransactionArgument<string>;
54
+ }
55
+ export interface ContentsOptions {
56
+ package?: string;
57
+ arguments: ContentsArguments | [
58
+ c: RawTransactionArgument<string>
59
+ ];
60
+ }
61
+ export declare function contents(options: ContentsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
62
+ export interface CollectArguments<R extends BcsType<any>> {
63
+ c: RawTransactionArgument<string>;
64
+ W: RawTransactionArgument<R>;
65
+ price: RawTransactionArgument<string | null>;
66
+ }
67
+ export interface CollectOptions<R extends BcsType<any>> {
68
+ package?: string;
69
+ arguments: CollectArguments<R> | [
70
+ c: RawTransactionArgument<string>,
71
+ W: RawTransactionArgument<R>,
72
+ price: RawTransactionArgument<string | null>
73
+ ];
74
+ typeArguments: [
75
+ string
76
+ ];
77
+ }
78
+ /** A rule reports its observed price (or `none` if stale / unavailable). */
79
+ export declare function collect<R extends BcsType<any>>(options: CollectOptions<R>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
80
+ export interface CollectAtArguments<R extends BcsType<any>> {
81
+ c: RawTransactionArgument<string>;
82
+ W: RawTransactionArgument<R>;
83
+ price: RawTransactionArgument<string>;
84
+ timestampMs: RawTransactionArgument<number | bigint>;
85
+ }
86
+ export interface CollectAtOptions<R extends BcsType<any>> {
87
+ package?: string;
88
+ arguments: CollectAtArguments<R> | [
89
+ c: RawTransactionArgument<string>,
90
+ W: RawTransactionArgument<R>,
91
+ price: RawTransactionArgument<string>,
92
+ timestampMs: RawTransactionArgument<number | bigint>
93
+ ];
94
+ typeArguments: [
95
+ string
96
+ ];
97
+ }
98
+ /** A rule reports a price that is bound to an exact source timestamp. */
99
+ export declare function collectAt<R extends BcsType<any>>(options: CollectAtOptions<R>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
100
+ export interface ObservationPriceArguments {
101
+ o: RawTransactionArgument<string>;
102
+ }
103
+ export interface ObservationPriceOptions {
104
+ package?: string;
105
+ arguments: ObservationPriceArguments | [
106
+ o: RawTransactionArgument<string>
107
+ ];
108
+ }
109
+ export declare function observationPrice(options: ObservationPriceOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
110
+ export interface ObservationTimestampMsArguments {
111
+ o: RawTransactionArgument<string>;
112
+ }
113
+ export interface ObservationTimestampMsOptions {
114
+ package?: string;
115
+ arguments: ObservationTimestampMsArguments | [
116
+ o: RawTransactionArgument<string>
117
+ ];
118
+ }
119
+ export declare function observationTimestampMs(options: ObservationTimestampMsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
@@ -0,0 +1,105 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Hot-potato collector for oracle rules feeding prices for a single ticker. */
5
+ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
6
+ import { bcs } from '@mysten/sui/bcs';
7
+ import * as float from "./deps/bucket_v2_framework/float.js";
8
+ import * as vec_map from "./deps/sui/vec_map.js";
9
+ import * as type_name from "./deps/std/type_name.js";
10
+ const $moduleName = '@waterx/oracle::collector';
11
+ export const PriceObservation = new MoveStruct({ name: `${$moduleName}::PriceObservation`, fields: {
12
+ price: float.Float,
13
+ timestamp_ms: bcs.option(bcs.u64())
14
+ } });
15
+ export const PriceCollector = new MoveStruct({ name: `${$moduleName}::PriceCollector`, fields: {
16
+ symbol: bcs.string(),
17
+ contents: vec_map.VecMap(type_name.TypeName, bcs.option(PriceObservation))
18
+ } });
19
+ export function symbol(options) {
20
+ const packageAddress = options.package ?? '@waterx/oracle';
21
+ const argumentsTypes = [
22
+ null
23
+ ];
24
+ const parameterNames = ["c"];
25
+ return (tx) => tx.moveCall({
26
+ package: packageAddress,
27
+ module: 'collector',
28
+ function: 'symbol',
29
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
30
+ });
31
+ }
32
+ export function contents(options) {
33
+ const packageAddress = options.package ?? '@waterx/oracle';
34
+ const argumentsTypes = [
35
+ null
36
+ ];
37
+ const parameterNames = ["c"];
38
+ return (tx) => tx.moveCall({
39
+ package: packageAddress,
40
+ module: 'collector',
41
+ function: 'contents',
42
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
43
+ });
44
+ }
45
+ /** A rule reports its observed price (or `none` if stale / unavailable). */
46
+ export function collect(options) {
47
+ const packageAddress = options.package ?? '@waterx/oracle';
48
+ const argumentsTypes = [
49
+ null,
50
+ `${options.typeArguments[0]}`,
51
+ '0x1::option::Option<null>'
52
+ ];
53
+ const parameterNames = ["c", "W", "price"];
54
+ return (tx) => tx.moveCall({
55
+ package: packageAddress,
56
+ module: 'collector',
57
+ function: 'collect',
58
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
59
+ typeArguments: options.typeArguments
60
+ });
61
+ }
62
+ /** A rule reports a price that is bound to an exact source timestamp. */
63
+ export function collectAt(options) {
64
+ const packageAddress = options.package ?? '@waterx/oracle';
65
+ const argumentsTypes = [
66
+ null,
67
+ `${options.typeArguments[0]}`,
68
+ null,
69
+ 'u64'
70
+ ];
71
+ const parameterNames = ["c", "W", "price", "timestampMs"];
72
+ return (tx) => tx.moveCall({
73
+ package: packageAddress,
74
+ module: 'collector',
75
+ function: 'collect_at',
76
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
77
+ typeArguments: options.typeArguments
78
+ });
79
+ }
80
+ export function observationPrice(options) {
81
+ const packageAddress = options.package ?? '@waterx/oracle';
82
+ const argumentsTypes = [
83
+ null
84
+ ];
85
+ const parameterNames = ["o"];
86
+ return (tx) => tx.moveCall({
87
+ package: packageAddress,
88
+ module: 'collector',
89
+ function: 'observation_price',
90
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
91
+ });
92
+ }
93
+ export function observationTimestampMs(options) {
94
+ const packageAddress = options.package ?? '@waterx/oracle';
95
+ const argumentsTypes = [
96
+ null
97
+ ];
98
+ const parameterNames = ["o"];
99
+ return (tx) => tx.moveCall({
100
+ package: packageAddress,
101
+ module: 'collector',
102
+ function: 'observation_timestamp_ms',
103
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
104
+ });
105
+ }
@@ -0,0 +1,8 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Module for floating points */
5
+ import { MoveStruct } from '../../../utils/index.ts';
6
+ export declare const Float: MoveStruct<{
7
+ value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u128">;
8
+ }, "bucket_v2_framework::float::Float">;
@@ -0,0 +1,10 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Module for floating points */
5
+ import { MoveStruct } from "../../../utils/index.js";
6
+ import { bcs } from '@mysten/sui/bcs';
7
+ const $moduleName = 'bucket_v2_framework::float';
8
+ export const Float = new MoveStruct({ name: `${$moduleName}::Float`, fields: {
9
+ value: bcs.u128()
10
+ } });
@@ -0,0 +1,17 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Functionality for converting Move types into values. Use with care! */
5
+ import { MoveStruct } from '../../../utils/index.ts';
6
+ export declare const TypeName: MoveStruct<{
7
+ /**
8
+ * String representation of the type. All types are represented using their source
9
+ * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
10
+ * Struct types are represented as fully qualified type names; e.g.
11
+ * `00000000000000000000000000000001::string::String` or
12
+ * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
13
+ * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
14
+ * 32 depending on the Move platform)
15
+ */
16
+ name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
17
+ }, "std::type_name::TypeName">;
@@ -0,0 +1,19 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Functionality for converting Move types into values. Use with care! */
5
+ import { MoveStruct } from "../../../utils/index.js";
6
+ import { bcs } from '@mysten/sui/bcs';
7
+ const $moduleName = 'std::type_name';
8
+ export const TypeName = new MoveStruct({ name: `${$moduleName}::TypeName`, fields: {
9
+ /**
10
+ * String representation of the type. All types are represented using their source
11
+ * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
12
+ * Struct types are represented as fully qualified type names; e.g.
13
+ * `00000000000000000000000000000001::string::String` or
14
+ * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
15
+ * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
16
+ * 32 depending on the Move platform)
17
+ */
18
+ name: bcs.string()
19
+ } });
@@ -0,0 +1,36 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { type BcsType } from '@mysten/sui/bcs';
5
+ import { MoveStruct } from '../../../utils/index.ts';
6
+ /** An entry in the map */
7
+ export declare function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
8
+ K,
9
+ V
10
+ ]): MoveStruct<{
11
+ key: K;
12
+ value: V;
13
+ }, `0x2::vec_map::Entry<${K["name"]}, ${V["name"]}>`>;
14
+ /**
15
+ * A map data structure backed by a vector. The map is guaranteed not to contain
16
+ * duplicate keys, but entries are _not_ sorted by key--entries are included in
17
+ * insertion order. All operations are O(N) in the size of the map--the intention
18
+ * of this data structure is only to provide the convenience of programming against
19
+ * a map API. Large maps should use handwritten parent/child relationships instead.
20
+ * Maps that need sorted iteration rather than insertion order iteration should
21
+ * also be handwritten.
22
+ */
23
+ export declare function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
24
+ K,
25
+ V
26
+ ]): MoveStruct<{
27
+ contents: BcsType<{
28
+ key: K extends BcsType<infer U, any, string> ? U : never;
29
+ value: V extends BcsType<infer U, any, string> ? U : never;
30
+ }[], Iterable<{
31
+ key: K extends BcsType<any, infer U_1, string> ? U_1 : never;
32
+ value: V extends BcsType<any, infer U_1, string> ? U_1 : never;
33
+ }> & {
34
+ length: number;
35
+ }, string>;
36
+ }, `0x2::vec_map::VecMap<${K["name"]}, ${V["name"]}>`>;
@@ -0,0 +1,27 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { bcs } from '@mysten/sui/bcs';
5
+ import { MoveStruct } from "../../../utils/index.js";
6
+ const $moduleName = '0x2::vec_map';
7
+ /** An entry in the map */
8
+ export function Entry(...typeParameters) {
9
+ return new MoveStruct({ name: `${$moduleName}::Entry<${typeParameters[0].name}, ${typeParameters[1].name}>`, fields: {
10
+ key: typeParameters[0],
11
+ value: typeParameters[1]
12
+ } });
13
+ }
14
+ /**
15
+ * A map data structure backed by a vector. The map is guaranteed not to contain
16
+ * duplicate keys, but entries are _not_ sorted by key--entries are included in
17
+ * insertion order. All operations are O(N) in the size of the map--the intention
18
+ * of this data structure is only to provide the convenience of programming against
19
+ * a map API. Large maps should use handwritten parent/child relationships instead.
20
+ * Maps that need sorted iteration rather than insertion order iteration should
21
+ * also be handwritten.
22
+ */
23
+ export function VecMap(...typeParameters) {
24
+ return new MoveStruct({ name: `${$moduleName}::VecMap<${typeParameters[0].name}, ${typeParameters[1].name}>`, fields: {
25
+ contents: bcs.vector(Entry(typeParameters[0], typeParameters[1]))
26
+ } });
27
+ }
@@ -0,0 +1,16 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { type BcsType } from '@mysten/sui/bcs';
5
+ import { MoveStruct } from '../../../utils/index.ts';
6
+ /**
7
+ * A set data structure backed by a vector. The set is guaranteed not to contain
8
+ * duplicate keys. All operations are O(N) in the size of the set
9
+ *
10
+ * - the intention of this data structure is only to provide the convenience of
11
+ * programming against a set API. Sets that need sorted iteration rather than
12
+ * insertion order iteration should be handwritten.
13
+ */
14
+ export declare function VecSet<K extends BcsType<any>>(...typeParameters: [
15
+ K
16
+ ]): MoveStruct<any, any>;
@@ -0,0 +1,19 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { bcs } from '@mysten/sui/bcs';
5
+ import { MoveStruct } from "../../../utils/index.js";
6
+ const $moduleName = '0x2::vec_set';
7
+ /**
8
+ * A set data structure backed by a vector. The set is guaranteed not to contain
9
+ * duplicate keys. All operations are O(N) in the size of the set
10
+ *
11
+ * - the intention of this data structure is only to provide the convenience of
12
+ * programming against a set API. Sets that need sorted iteration rather than
13
+ * insertion order iteration should be handwritten.
14
+ */
15
+ export function VecSet(...typeParameters) {
16
+ return new MoveStruct({ name: `${$moduleName}::VecSet<${typeParameters[0].name}>`, fields: {
17
+ contents: bcs.vector(typeParameters[0])
18
+ } });
19
+ }