@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,11 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Module for managing Credit and Debt for DeFi protocol usage */
5
+ import { MoveStruct } from '../../../utils/index.ts';
6
+ export declare const Credit: MoveStruct<{
7
+ value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
8
+ }, "bucket_v2_framework::liability::Credit<phantom T>">;
9
+ export declare const Debt: MoveStruct<{
10
+ value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
11
+ }, "bucket_v2_framework::liability::Debt<phantom T>">;
@@ -0,0 +1,13 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Module for managing Credit and Debt for DeFi protocol usage */
5
+ import { MoveStruct } from "../../../utils/index.js";
6
+ import { bcs } from '@mysten/sui/bcs';
7
+ const $moduleName = 'bucket_v2_framework::liability';
8
+ export const Credit = new MoveStruct({ name: `${$moduleName}::Credit<phantom T>`, fields: {
9
+ value: bcs.u64()
10
+ } });
11
+ export const Debt = new MoveStruct({ name: `${$moduleName}::Debt<phantom T>`, fields: {
12
+ value: bcs.u64()
13
+ } });
@@ -0,0 +1,49 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Module for the record of Credit and Debt of certain entity */
5
+ import { MoveTuple, MoveStruct } from '../../../utils/index.ts';
6
+ export declare const Entity: MoveTuple<readonly [MoveStruct<{
7
+ name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
8
+ }, "std::type_name::TypeName">], "bucket_v2_framework::sheet::Entity">;
9
+ export declare const Sheet: MoveStruct<{
10
+ credits: MoveStruct<{
11
+ contents: import("@mysten/sui/bcs").BcsType<{
12
+ key: [{
13
+ name: string;
14
+ }];
15
+ value: {
16
+ value: string;
17
+ };
18
+ }[], Iterable<{
19
+ key: readonly [{
20
+ name: string;
21
+ }];
22
+ value: {
23
+ value: string | number | bigint;
24
+ };
25
+ }> & {
26
+ length: number;
27
+ }, string>;
28
+ }, "0x2::vec_map::VecMap<bucket_v2_framework::sheet::Entity, bucket_v2_framework::liability::Credit<phantom T>>">;
29
+ debts: MoveStruct<{
30
+ contents: import("@mysten/sui/bcs").BcsType<{
31
+ key: [{
32
+ name: string;
33
+ }];
34
+ value: {
35
+ value: string;
36
+ };
37
+ }[], Iterable<{
38
+ key: readonly [{
39
+ name: string;
40
+ }];
41
+ value: {
42
+ value: string | number | bigint;
43
+ };
44
+ }> & {
45
+ length: number;
46
+ }, string>;
47
+ }, "0x2::vec_map::VecMap<bucket_v2_framework::sheet::Entity, bucket_v2_framework::liability::Debt<phantom T>>">;
48
+ blacklist: MoveStruct<any, any>;
49
+ }, "bucket_v2_framework::sheet::Sheet<phantom CoinType, phantom SelfEntity>">;
@@ -0,0 +1,18 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /** Module for the record of Credit and Debt of certain entity */
5
+ import { MoveTuple, MoveStruct } from "../../../utils/index.js";
6
+ import * as type_name from "../std/type_name.js";
7
+ import * as vec_map from "../sui/vec_map.js";
8
+ import * as liability from "./liability.js";
9
+ import * as vec_map_1 from "../sui/vec_map.js";
10
+ import * as liability_1 from "./liability.js";
11
+ import * as vec_set from "../sui/vec_set.js";
12
+ const $moduleName = 'bucket_v2_framework::sheet';
13
+ export const Entity = new MoveTuple({ name: `${$moduleName}::Entity`, fields: [type_name.TypeName] });
14
+ export const Sheet = new MoveStruct({ name: `${$moduleName}::Sheet<phantom CoinType, phantom SelfEntity>`, fields: {
15
+ credits: vec_map.VecMap(Entity, liability.Credit),
16
+ debts: vec_map_1.VecMap(Entity, liability_1.Debt),
17
+ blacklist: vec_set.VecSet(Entity)
18
+ } });
@@ -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,12 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * A storable handler for Balances in general. Is used in the `Coin` module to
6
+ * allow balance operations and can be used to implement custom coins with `Supply`
7
+ * and `Balance`s.
8
+ */
9
+ import { MoveStruct } from '../../../utils/index.ts';
10
+ export declare const Balance: MoveStruct<{
11
+ value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
12
+ }, "0x2::balance::Balance<phantom T>">;
@@ -0,0 +1,14 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * A storable handler for Balances in general. Is used in the `Coin` module to
6
+ * allow balance operations and can be used to implement custom coins with `Supply`
7
+ * and `Balance`s.
8
+ */
9
+ import { MoveStruct } from "../../../utils/index.js";
10
+ import { bcs } from '@mysten/sui/bcs';
11
+ const $moduleName = '0x2::balance';
12
+ export const Balance = new MoveStruct({ name: `${$moduleName}::Balance<phantom T>`, fields: {
13
+ value: bcs.u64()
14
+ } });
@@ -0,0 +1,17 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * Similar to `sui::table`, an `ObjectTable<K, V>` is a map-like collection. But
6
+ * unlike `sui::table`, the values bound to these dynamic fields _must_ be objects
7
+ * themselves. This allows for the objects to still exist within in storage, which
8
+ * may be important for external tools. The difference is otherwise not observable
9
+ * from within Move.
10
+ */
11
+ import { MoveStruct } from '../../../utils/index.ts';
12
+ export declare const ObjectTable: MoveStruct<{
13
+ /** the ID of this table */
14
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
15
+ /** the number of key-value pairs in the table */
16
+ size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
17
+ }, "0x2::object_table::ObjectTable<phantom K, phantom V>">;
@@ -0,0 +1,19 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * Similar to `sui::table`, an `ObjectTable<K, V>` is a map-like collection. But
6
+ * unlike `sui::table`, the values bound to these dynamic fields _must_ be objects
7
+ * themselves. This allows for the objects to still exist within in storage, which
8
+ * may be important for external tools. The difference is otherwise not observable
9
+ * from within Move.
10
+ */
11
+ import { MoveStruct } from "../../../utils/index.js";
12
+ import { bcs } from '@mysten/sui/bcs';
13
+ const $moduleName = '0x2::object_table';
14
+ export const ObjectTable = new MoveStruct({ name: `${$moduleName}::ObjectTable<phantom K, phantom V>`, fields: {
15
+ /** the ID of this table */
16
+ id: bcs.Address,
17
+ /** the number of key-value pairs in the table */
18
+ size: bcs.u64()
19
+ } });
@@ -0,0 +1,29 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * A table is a map-like collection. But unlike a traditional collection, it's keys
6
+ * and values are not stored within the `Table` value, but instead are stored using
7
+ * Sui's object system. The `Table` struct acts only as a handle into the object
8
+ * system to retrieve those keys and values. Note that this means that `Table`
9
+ * values with exactly the same key-value mapping will not be equal, with `==`, at
10
+ * runtime. For example
11
+ *
12
+ * ```
13
+ * let table1 = table::new<u64, bool>();
14
+ * let table2 = table::new<u64, bool>();
15
+ * table::add(&mut table1, 0, false);
16
+ * table::add(&mut table1, 1, true);
17
+ * table::add(&mut table2, 0, false);
18
+ * table::add(&mut table2, 1, true);
19
+ * // table1 does not equal table2, despite having the same entries
20
+ * assert!(&table1 != &table2);
21
+ * ```
22
+ */
23
+ import { MoveStruct } from '../../../utils/index.ts';
24
+ export declare const Table: MoveStruct<{
25
+ /** the ID of this table */
26
+ id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
27
+ /** the number of key-value pairs in the table */
28
+ size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
29
+ }, "0x2::table::Table<phantom K, phantom V>">;
@@ -0,0 +1,31 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * A table is a map-like collection. But unlike a traditional collection, it's keys
6
+ * and values are not stored within the `Table` value, but instead are stored using
7
+ * Sui's object system. The `Table` struct acts only as a handle into the object
8
+ * system to retrieve those keys and values. Note that this means that `Table`
9
+ * values with exactly the same key-value mapping will not be equal, with `==`, at
10
+ * runtime. For example
11
+ *
12
+ * ```
13
+ * let table1 = table::new<u64, bool>();
14
+ * let table2 = table::new<u64, bool>();
15
+ * table::add(&mut table1, 0, false);
16
+ * table::add(&mut table1, 1, true);
17
+ * table::add(&mut table2, 0, false);
18
+ * table::add(&mut table2, 1, true);
19
+ * // table1 does not equal table2, despite having the same entries
20
+ * assert!(&table1 != &table2);
21
+ * ```
22
+ */
23
+ import { MoveStruct } from "../../../utils/index.js";
24
+ import { bcs } from '@mysten/sui/bcs';
25
+ const $moduleName = '0x2::table';
26
+ export const Table = new MoveStruct({ name: `${$moduleName}::Table<phantom K, phantom V>`, fields: {
27
+ /** the ID of this table */
28
+ id: bcs.Address,
29
+ /** the number of key-value pairs in the table */
30
+ size: bcs.u64()
31
+ } });
@@ -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
+ }
@@ -0,0 +1,77 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * Default identity (passthrough) deposit / withdraw policy.
6
+ *
7
+ * Folds `Coin<T>` directly into the account's stored `Balance<T>` on deposit, and
8
+ * pays `Coin<T>` straight to the request's recipient on withdraw — no swap, no
9
+ * conversion. This is the "no-op" policy that most CoinTypes will use; PSM-style
10
+ * policies (T_IN → T_OUT) are still authored per-protocol.
11
+ *
12
+ * Deploy setup (one-time):
13
+ *
14
+ * ```move
15
+ * // Once at deploy:
16
+ * registry.whitelist_protocol<DirectRule>(&admin_cap);
17
+ * // Per CoinType T that should flow direct:
18
+ * registry.register_deposit_policy<T, DirectRule>(&admin_cap);
19
+ * registry.register_withdraw_policy<T, DirectRule>(&admin_cap);
20
+ * ```
21
+ *
22
+ * User flow inside a single PTB:
23
+ *
24
+ * ```move
25
+ * let req = registry.request_deposit<T>(account_id, coin, extra_data);
26
+ * direct_rule::consume_deposit_direct<T>(&mut registry, req);
27
+ * // ...later:
28
+ * let wreq = registry.request_withdraw<T>(&sender_req, account_id, amount, recipient, extra_data, &clock);
29
+ * direct_rule::consume_withdraw_direct<T>(&mut registry, wreq);
30
+ * ```
31
+ */
32
+ import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
33
+ import { type Transaction } from '@mysten/sui/transactions';
34
+ export declare const DirectRule: MoveStruct<{
35
+ dummy_field: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
36
+ }, "@waterx/account::direct_rule::DirectRule">;
37
+ export interface ConsumeDepositDirectArguments {
38
+ registry: RawTransactionArgument<string>;
39
+ req: RawTransactionArgument<string>;
40
+ }
41
+ export interface ConsumeDepositDirectOptions {
42
+ package?: string;
43
+ arguments: ConsumeDepositDirectArguments | [
44
+ registry: RawTransactionArgument<string>,
45
+ req: RawTransactionArgument<string>
46
+ ];
47
+ typeArguments: [
48
+ string
49
+ ];
50
+ }
51
+ /**
52
+ * Consume a `DepositRequest<T>` that was registered against `DirectRule` and
53
+ * credit the entire `Balance<T>` to the account's stored balance.
54
+ */
55
+ export declare function consumeDepositDirect(options: ConsumeDepositDirectOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
56
+ export interface ConsumeWithdrawDirectArguments {
57
+ registry: RawTransactionArgument<string>;
58
+ req: RawTransactionArgument<string>;
59
+ }
60
+ export interface ConsumeWithdrawDirectOptions {
61
+ package?: string;
62
+ arguments: ConsumeWithdrawDirectArguments | [
63
+ registry: RawTransactionArgument<string>,
64
+ req: RawTransactionArgument<string>
65
+ ];
66
+ typeArguments: [
67
+ string
68
+ ];
69
+ }
70
+ /**
71
+ * Consume a `WithdrawRequest<T>` that was registered against `DirectRule` and pay
72
+ * out the `Balance<T>` to the request's recipient via the address accumulator. If
73
+ * the recipient is itself a wxa account, the payout composes with any other inflow
74
+ * and can be folded back into stored balance via `request_deposit_from_funds<T>`
75
+ * in a follow-up PTB leg.
76
+ */
77
+ export declare function consumeWithdrawDirect(options: ConsumeWithdrawDirectOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
@@ -0,0 +1,78 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * Default identity (passthrough) deposit / withdraw policy.
6
+ *
7
+ * Folds `Coin<T>` directly into the account's stored `Balance<T>` on deposit, and
8
+ * pays `Coin<T>` straight to the request's recipient on withdraw — no swap, no
9
+ * conversion. This is the "no-op" policy that most CoinTypes will use; PSM-style
10
+ * policies (T_IN → T_OUT) are still authored per-protocol.
11
+ *
12
+ * Deploy setup (one-time):
13
+ *
14
+ * ```move
15
+ * // Once at deploy:
16
+ * registry.whitelist_protocol<DirectRule>(&admin_cap);
17
+ * // Per CoinType T that should flow direct:
18
+ * registry.register_deposit_policy<T, DirectRule>(&admin_cap);
19
+ * registry.register_withdraw_policy<T, DirectRule>(&admin_cap);
20
+ * ```
21
+ *
22
+ * User flow inside a single PTB:
23
+ *
24
+ * ```move
25
+ * let req = registry.request_deposit<T>(account_id, coin, extra_data);
26
+ * direct_rule::consume_deposit_direct<T>(&mut registry, req);
27
+ * // ...later:
28
+ * let wreq = registry.request_withdraw<T>(&sender_req, account_id, amount, recipient, extra_data, &clock);
29
+ * direct_rule::consume_withdraw_direct<T>(&mut registry, wreq);
30
+ * ```
31
+ */
32
+ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
33
+ import { bcs } from '@mysten/sui/bcs';
34
+ const $moduleName = '@waterx/account::direct_rule';
35
+ export const DirectRule = new MoveStruct({ name: `${$moduleName}::DirectRule`, fields: {
36
+ dummy_field: bcs.bool()
37
+ } });
38
+ /**
39
+ * Consume a `DepositRequest<T>` that was registered against `DirectRule` and
40
+ * credit the entire `Balance<T>` to the account's stored balance.
41
+ */
42
+ export function consumeDepositDirect(options) {
43
+ const packageAddress = options.package ?? '@waterx/account';
44
+ const argumentsTypes = [
45
+ null,
46
+ null
47
+ ];
48
+ const parameterNames = ["registry", "req"];
49
+ return (tx) => tx.moveCall({
50
+ package: packageAddress,
51
+ module: 'direct_rule',
52
+ function: 'consume_deposit_direct',
53
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
54
+ typeArguments: options.typeArguments
55
+ });
56
+ }
57
+ /**
58
+ * Consume a `WithdrawRequest<T>` that was registered against `DirectRule` and pay
59
+ * out the `Balance<T>` to the request's recipient via the address accumulator. If
60
+ * the recipient is itself a wxa account, the payout composes with any other inflow
61
+ * and can be folded back into stored balance via `request_deposit_from_funds<T>`
62
+ * in a follow-up PTB leg.
63
+ */
64
+ export function consumeWithdrawDirect(options) {
65
+ const packageAddress = options.package ?? '@waterx/account';
66
+ const argumentsTypes = [
67
+ null,
68
+ null
69
+ ];
70
+ const parameterNames = ["registry", "req"];
71
+ return (tx) => tx.moveCall({
72
+ package: packageAddress,
73
+ module: 'direct_rule',
74
+ function: 'consume_withdraw_direct',
75
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
76
+ typeArguments: options.typeArguments
77
+ });
78
+ }