@waterx/sdk 2.1.0 → 2.4.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 (231) hide show
  1. package/README.md +75 -169
  2. package/dist/src/client.d.ts +40 -2
  3. package/dist/src/client.js +55 -6
  4. package/dist/src/config.d.ts +66 -3
  5. package/dist/src/config.js +10 -4
  6. package/dist/src/constants.d.ts +6 -0
  7. package/dist/src/constants.js +6 -0
  8. package/dist/src/core/waterx-account.d.ts +31 -0
  9. package/dist/src/core/waterx-account.js +26 -0
  10. package/dist/src/fetch.d.ts +110 -0
  11. package/dist/src/fetch.js +149 -4
  12. package/dist/src/generated/bucket_v2_framework/account.d.ts +5 -5
  13. package/dist/src/generated/bucket_v2_framework/double.d.ts +77 -77
  14. package/dist/src/generated/bucket_v2_framework/float.d.ts +73 -73
  15. package/dist/src/generated/bucket_v2_framework/liability.d.ts +33 -33
  16. package/dist/src/generated/bucket_v2_framework/linked_table.d.ts +5 -5
  17. package/dist/src/generated/bucket_v2_framework/linked_table.js +2 -2
  18. package/dist/src/generated/bucket_v2_framework/sheet.d.ts +57 -57
  19. package/dist/src/generated/bucket_v2_framework/sheet.js +5 -11
  20. package/dist/src/generated/native_custody/custody_vault.d.ts +46 -32
  21. package/dist/src/generated/native_custody/custody_vault.js +19 -10
  22. package/dist/src/generated/native_custody/deps/bucket_v2_framework/sheet.js +1 -3
  23. package/dist/src/generated/native_custody/events.js +1 -2
  24. package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.d.ts +7 -7
  25. package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.js +1 -2
  26. package/dist/src/generated/utils/index.d.ts +7 -7
  27. package/dist/src/generated/utils/index.js +9 -6
  28. package/dist/src/generated/waterx_account/account.d.ts +124 -71
  29. package/dist/src/generated/waterx_account/account.js +64 -29
  30. package/dist/src/generated/waterx_account/deps/bucket_v2_framework/sheet.js +1 -3
  31. package/dist/src/generated/waterx_account/direct_rule.d.ts +5 -5
  32. package/dist/src/generated/waterx_account/events.d.ts +10 -0
  33. package/dist/src/generated/waterx_account/events.js +31 -50
  34. package/dist/src/generated/waterx_constant_rule/constant_rule.d.ts +68 -0
  35. package/dist/src/generated/waterx_constant_rule/constant_rule.js +59 -0
  36. package/dist/src/generated/waterx_constant_rule/deps/bucket_v2_framework/float.d.ts +8 -0
  37. package/dist/src/generated/waterx_constant_rule/deps/bucket_v2_framework/float.js +10 -0
  38. package/dist/src/generated/waterx_constant_rule/deps/sui/vec_map.d.ts +36 -0
  39. package/dist/src/generated/waterx_constant_rule/deps/sui/vec_map.js +27 -0
  40. package/dist/src/generated/waterx_credit/credit_registry.d.ts +9 -9
  41. package/dist/src/generated/waterx_credit/credit_registry.js +1 -2
  42. package/dist/src/generated/waterx_credit/limited_supply.d.ts +17 -17
  43. package/dist/src/generated/waterx_oracle/aggregator.js +1 -2
  44. package/dist/src/generated/waterx_oracle/collector.d.ts +17 -17
  45. package/dist/src/generated/waterx_oracle/collector.js +1 -1
  46. package/dist/src/generated/waterx_oracle/oracle.d.ts +5 -5
  47. package/dist/src/generated/waterx_perp/account_data.d.ts +5 -5
  48. package/dist/src/generated/waterx_perp/account_data.js +1 -2
  49. package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/sheet.js +1 -3
  50. package/dist/src/generated/waterx_perp/events.d.ts +181 -181
  51. package/dist/src/generated/waterx_perp/events.js +87 -173
  52. package/dist/src/generated/waterx_perp/global_config.d.ts +3 -3
  53. package/dist/src/generated/waterx_perp/global_config.js +6 -12
  54. package/dist/src/generated/waterx_perp/keyed_big_vector.d.ts +9 -9
  55. package/dist/src/generated/waterx_perp/keyed_big_vector.js +1 -2
  56. package/dist/src/generated/waterx_perp/lp_pool.d.ts +115 -115
  57. package/dist/src/generated/waterx_perp/lp_pool.js +11 -22
  58. package/dist/src/generated/waterx_perp/market_config.d.ts +61 -43
  59. package/dist/src/generated/waterx_perp/market_config.js +29 -22
  60. package/dist/src/generated/waterx_perp/math.d.ts +7 -7
  61. package/dist/src/generated/waterx_perp/order_book.d.ts +47 -47
  62. package/dist/src/generated/waterx_perp/position.d.ts +99 -99
  63. package/dist/src/generated/waterx_perp/position.js +6 -12
  64. package/dist/src/generated/waterx_perp/request.d.ts +67 -67
  65. package/dist/src/generated/waterx_perp/request.js +2 -3
  66. package/dist/src/generated/waterx_perp/response.d.ts +35 -35
  67. package/dist/src/generated/waterx_perp/response.js +1 -2
  68. package/dist/src/generated/waterx_perp/trading.d.ts +303 -179
  69. package/dist/src/generated/waterx_perp/trading.js +99 -14
  70. package/dist/src/generated/waterx_perp_view/view.js +5 -10
  71. package/dist/src/generated/waterx_pyth_rule/pyth_rule.d.ts +5 -5
  72. package/dist/src/generated/waterx_pyth_rule/pyth_rule.js +1 -2
  73. package/dist/src/generated/waterx_referral/referral_table.d.ts +5 -5
  74. package/dist/src/generated/waterx_referral/referral_table.js +1 -2
  75. package/dist/src/generated/waterx_staking/waterx_staking.d.ts +19 -19
  76. package/dist/src/generated/waterx_staking/waterx_staking.js +10 -20
  77. package/dist/src/generated/waterx_supra_rule/deps/sui/vec_map.d.ts +36 -0
  78. package/dist/src/generated/waterx_supra_rule/deps/sui/vec_map.js +27 -0
  79. package/dist/src/generated/waterx_supra_rule/supra_rule.d.ts +158 -0
  80. package/dist/src/generated/waterx_supra_rule/supra_rule.js +148 -0
  81. package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/float.d.ts +8 -0
  82. package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/float.js +10 -0
  83. package/dist/src/generated/withdrawal_queue/deps/sui/vec_map.d.ts +36 -0
  84. package/dist/src/generated/withdrawal_queue/deps/sui/vec_map.js +27 -0
  85. package/dist/src/generated/withdrawal_queue/withdrawal_queue.d.ts +444 -4
  86. package/dist/src/generated/withdrawal_queue/withdrawal_queue.js +417 -4
  87. package/dist/src/generated/wormhole_bridge/wormhole_bridge.d.ts +214 -74
  88. package/dist/src/generated/wormhole_bridge/wormhole_bridge.js +158 -29
  89. package/dist/src/index.d.ts +4 -3
  90. package/dist/src/index.js +3 -2
  91. package/dist/src/prediction/account.d.ts +96 -0
  92. package/dist/src/prediction/account.js +230 -0
  93. package/dist/src/prediction/admin.d.ts +47 -0
  94. package/dist/src/prediction/admin.js +105 -0
  95. package/dist/src/prediction/bcs.d.ts +22 -0
  96. package/dist/src/prediction/bcs.js +240 -0
  97. package/dist/src/prediction/client.d.ts +75 -0
  98. package/dist/src/prediction/client.js +164 -0
  99. package/dist/src/prediction/config.d.ts +60 -0
  100. package/dist/src/prediction/config.js +75 -0
  101. package/dist/src/prediction/constants.d.ts +44 -0
  102. package/dist/src/prediction/constants.js +46 -0
  103. package/dist/src/prediction/fetch.d.ts +82 -0
  104. package/dist/src/prediction/fetch.js +270 -0
  105. package/dist/src/prediction/generated/bucket_v2_framework/account.d.ts +100 -0
  106. package/dist/src/prediction/generated/bucket_v2_framework/account.js +129 -0
  107. package/dist/src/prediction/generated/bucket_v2_framework/deps/std/type_name.d.ts +6 -0
  108. package/dist/src/prediction/generated/bucket_v2_framework/deps/std/type_name.js +19 -0
  109. package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/balance.d.ts +10 -0
  110. package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/balance.js +14 -0
  111. package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_map.d.ts +36 -0
  112. package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_map.js +27 -0
  113. package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_set.d.ts +16 -0
  114. package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_set.js +19 -0
  115. package/dist/src/prediction/generated/bucket_v2_framework/double.d.ts +382 -0
  116. package/dist/src/prediction/generated/bucket_v2_framework/double.js +466 -0
  117. package/dist/src/prediction/generated/bucket_v2_framework/float.d.ts +362 -0
  118. package/dist/src/prediction/generated/bucket_v2_framework/float.js +440 -0
  119. package/dist/src/prediction/generated/bucket_v2_framework/liability.d.ts +193 -0
  120. package/dist/src/prediction/generated/bucket_v2_framework/liability.js +205 -0
  121. package/dist/src/prediction/generated/bucket_v2_framework/linked_table.d.ts +384 -0
  122. package/dist/src/prediction/generated/bucket_v2_framework/linked_table.js +382 -0
  123. package/dist/src/prediction/generated/bucket_v2_framework/sheet.d.ts +344 -0
  124. package/dist/src/prediction/generated/bucket_v2_framework/sheet.js +338 -0
  125. package/dist/src/prediction/generated/utils/index.d.ts +30 -0
  126. package/dist/src/prediction/generated/utils/index.js +160 -0
  127. package/dist/src/prediction/generated/waterx_account/account.d.ts +1589 -0
  128. package/dist/src/prediction/generated/waterx_account/account.js +1758 -0
  129. package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/liability.d.ts +7 -0
  130. package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/liability.js +13 -0
  131. package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/sheet.d.ts +7 -0
  132. package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/sheet.js +16 -0
  133. package/dist/src/prediction/generated/waterx_account/deps/std/type_name.d.ts +6 -0
  134. package/dist/src/prediction/generated/waterx_account/deps/std/type_name.js +19 -0
  135. package/dist/src/prediction/generated/waterx_account/deps/sui/balance.d.ts +10 -0
  136. package/dist/src/prediction/generated/waterx_account/deps/sui/balance.js +14 -0
  137. package/dist/src/prediction/generated/waterx_account/deps/sui/object_table.d.ts +12 -0
  138. package/dist/src/prediction/generated/waterx_account/deps/sui/object_table.js +19 -0
  139. package/dist/src/prediction/generated/waterx_account/deps/sui/table.d.ts +24 -0
  140. package/dist/src/prediction/generated/waterx_account/deps/sui/table.js +31 -0
  141. package/dist/src/prediction/generated/waterx_account/deps/sui/vec_map.d.ts +36 -0
  142. package/dist/src/prediction/generated/waterx_account/deps/sui/vec_map.js +27 -0
  143. package/dist/src/prediction/generated/waterx_account/deps/sui/vec_set.d.ts +16 -0
  144. package/dist/src/prediction/generated/waterx_account/deps/sui/vec_set.js +19 -0
  145. package/dist/src/prediction/generated/waterx_account/direct_rule.d.ts +75 -0
  146. package/dist/src/prediction/generated/waterx_account/direct_rule.js +78 -0
  147. package/dist/src/prediction/generated/waterx_account/events.d.ts +33 -0
  148. package/dist/src/prediction/generated/waterx_account/events.js +137 -0
  149. package/dist/src/prediction/generated/waterx_account/version.d.ts +10 -0
  150. package/dist/src/prediction/generated/waterx_account/version.js +8 -0
  151. package/dist/src/prediction/generated/waterx_prediction/account_data.d.ts +327 -0
  152. package/dist/src/prediction/generated/waterx_prediction/account_data.js +405 -0
  153. package/dist/src/prediction/generated/waterx_prediction/admin.d.ts +5 -0
  154. package/dist/src/prediction/generated/waterx_prediction/admin.js +9 -0
  155. package/dist/src/prediction/generated/waterx_prediction/bet_sharing.d.ts +60 -0
  156. package/dist/src/prediction/generated/waterx_prediction/bet_sharing.js +83 -0
  157. package/dist/src/prediction/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.d.ts +8 -0
  158. package/dist/src/prediction/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.js +18 -0
  159. package/dist/src/prediction/generated/waterx_prediction/deps/sui/balance.d.ts +10 -0
  160. package/dist/src/prediction/generated/waterx_prediction/deps/sui/balance.js +14 -0
  161. package/dist/src/prediction/generated/waterx_prediction/deps/sui/table.d.ts +24 -0
  162. package/dist/src/prediction/generated/waterx_prediction/deps/sui/table.js +31 -0
  163. package/dist/src/prediction/generated/waterx_prediction/deps/sui/vec_set.d.ts +16 -0
  164. package/dist/src/prediction/generated/waterx_prediction/deps/sui/vec_set.js +19 -0
  165. package/dist/src/prediction/generated/waterx_prediction/events.d.ts +22 -0
  166. package/dist/src/prediction/generated/waterx_prediction/events.js +179 -0
  167. package/dist/src/prediction/generated/waterx_prediction/global_config.d.ts +116 -0
  168. package/dist/src/prediction/generated/waterx_prediction/global_config.js +141 -0
  169. package/dist/src/prediction/generated/waterx_prediction/order.d.ts +200 -0
  170. package/dist/src/prediction/generated/waterx_prediction/order.js +284 -0
  171. package/dist/src/prediction/generated/waterx_prediction/outcome.d.ts +58 -0
  172. package/dist/src/prediction/generated/waterx_prediction/outcome.js +73 -0
  173. package/dist/src/prediction/generated/waterx_prediction/position.d.ts +160 -0
  174. package/dist/src/prediction/generated/waterx_prediction/position.js +214 -0
  175. package/dist/src/prediction/generated/waterx_prediction/version.d.ts +10 -0
  176. package/dist/src/prediction/generated/waterx_prediction/version.js +8 -0
  177. package/dist/src/prediction/generated/waterx_prediction/view.d.ts +353 -0
  178. package/dist/src/prediction/generated/waterx_prediction/view.js +432 -0
  179. package/dist/src/prediction/generated/waterx_prediction/waterx_prediction.d.ts +1698 -0
  180. package/dist/src/prediction/generated/waterx_prediction/waterx_prediction.js +1733 -0
  181. package/dist/src/prediction/gift-link.d.ts +6 -0
  182. package/dist/src/prediction/gift-link.js +5 -0
  183. package/dist/src/prediction/gift.d.ts +223 -0
  184. package/dist/src/prediction/gift.js +451 -0
  185. package/dist/src/prediction/index.d.ts +29 -0
  186. package/dist/src/prediction/index.js +21 -0
  187. package/dist/src/prediction/prediction.d.ts +104 -0
  188. package/dist/src/prediction/prediction.js +317 -0
  189. package/dist/src/prediction/tx-builders.d.ts +44 -0
  190. package/dist/src/prediction/tx-builders.js +52 -0
  191. package/dist/src/prediction/types.d.ts +93 -0
  192. package/dist/src/prediction/types.js +1 -0
  193. package/dist/src/prediction/user/account.d.ts +2 -0
  194. package/dist/src/prediction/user/account.js +1 -0
  195. package/dist/src/prediction/user/admin.d.ts +6 -0
  196. package/dist/src/prediction/user/admin.js +3 -0
  197. package/dist/src/prediction/user/gift.d.ts +2 -0
  198. package/dist/src/prediction/user/gift.js +1 -0
  199. package/dist/src/prediction/user/index.d.ts +5 -0
  200. package/dist/src/prediction/user/index.js +3 -0
  201. package/dist/src/prediction/user/keeper.d.ts +2 -0
  202. package/dist/src/prediction/user/keeper.js +1 -0
  203. package/dist/src/prediction/user/order.d.ts +2 -0
  204. package/dist/src/prediction/user/order.js +1 -0
  205. package/dist/src/prediction/user/position.d.ts +2 -0
  206. package/dist/src/prediction/user/position.js +1 -0
  207. package/dist/src/prediction/utils/bcs.d.ts +1 -0
  208. package/dist/src/prediction/utils/bcs.js +1 -0
  209. package/dist/src/prediction/utils/index.d.ts +1 -0
  210. package/dist/src/prediction/utils/index.js +1 -0
  211. package/dist/src/prediction/utils.d.ts +30 -0
  212. package/dist/src/prediction/utils.js +177 -0
  213. package/dist/src/sdk.d.ts +18 -0
  214. package/dist/src/sdk.js +17 -0
  215. package/dist/src/tx-builders.d.ts +54 -0
  216. package/dist/src/tx-builders.js +141 -0
  217. package/dist/src/unified-client.d.ts +407 -0
  218. package/dist/src/unified-client.js +123 -0
  219. package/dist/src/user/account.d.ts +27 -0
  220. package/dist/src/user/account.js +34 -8
  221. package/dist/src/user/credit.d.ts +8 -14
  222. package/dist/src/user/credit.js +9 -23
  223. package/dist/src/user/custody.d.ts +4 -18
  224. package/dist/src/user/custody.js +14 -25
  225. package/dist/src/utils/consolidate-balance.d.ts +37 -0
  226. package/dist/src/utils/consolidate-balance.js +89 -0
  227. package/dist/src/utils/math.d.ts +86 -0
  228. package/dist/src/utils/math.js +100 -0
  229. package/dist/src/utils/pyth.d.ts +42 -7
  230. package/dist/src/utils/pyth.js +107 -31
  231. package/package.json +129 -34
@@ -0,0 +1,405 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * Per-account prediction broker index, stored as a `WaterXPredictionData` blob on
6
+ * the shared `waterx_account::Account` object via `wxa::new_data` /
7
+ * `wxa::borrow_data` / `wxa::borrow_data_mut`.
8
+ *
9
+ * `MarketRegistry` remains the canonical storage for orders and positions. This
10
+ * slot is an account-centric index for wallet UX and indexers: account ->
11
+ * order_ids / position_ids, plus account -> market_key -> ids.
12
+ */
13
+ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
14
+ import { bcs } from '@mysten/sui/bcs';
15
+ import * as linked_table from "./deps/bucket_v2_framework/linked_table.js";
16
+ import * as table from "./deps/sui/table.js";
17
+ const $moduleName = '@waterx/prediction::account_data';
18
+ export const WaterXPrediction = new MoveStruct({ name: `${$moduleName}::WaterXPrediction`, fields: {
19
+ dummy_field: bcs.bool()
20
+ } });
21
+ export const WaterXPredictionData = new MoveStruct({ name: `${$moduleName}::WaterXPredictionData`, fields: {
22
+ /** Pending open/close order IDs for this account. Value = market key. */
23
+ orders: linked_table.LinkedTable(bcs.u64()),
24
+ /** Active position IDs for this account. Value = market key. */
25
+ positions: linked_table.LinkedTable(bcs.u64()),
26
+ /** Per-market pending order ID sets. Key = market key. */
27
+ orders_by_market: table.Table,
28
+ /** Per-market active position ID sets. Key = market key. */
29
+ positions_by_market: table.Table
30
+ } });
31
+ export function permPlaceOrder(options = {}) {
32
+ const packageAddress = options.package ?? '@waterx/prediction';
33
+ return (tx) => tx.moveCall({
34
+ package: packageAddress,
35
+ module: 'account_data',
36
+ function: 'perm_place_order',
37
+ });
38
+ }
39
+ export function permCancelOrder(options = {}) {
40
+ const packageAddress = options.package ?? '@waterx/prediction';
41
+ return (tx) => tx.moveCall({
42
+ package: packageAddress,
43
+ module: 'account_data',
44
+ function: 'perm_cancel_order',
45
+ });
46
+ }
47
+ export function permClaim(options = {}) {
48
+ const packageAddress = options.package ?? '@waterx/prediction';
49
+ return (tx) => tx.moveCall({
50
+ package: packageAddress,
51
+ module: 'account_data',
52
+ function: 'perm_claim',
53
+ });
54
+ }
55
+ export function permRequestClose(options = {}) {
56
+ const packageAddress = options.package ?? '@waterx/prediction';
57
+ return (tx) => tx.moveCall({
58
+ package: packageAddress,
59
+ module: 'account_data',
60
+ function: 'perm_request_close',
61
+ });
62
+ }
63
+ export function permTransferPosition(options = {}) {
64
+ const packageAddress = options.package ?? '@waterx/prediction';
65
+ return (tx) => tx.moveCall({
66
+ package: packageAddress,
67
+ module: 'account_data',
68
+ function: 'perm_transfer_position',
69
+ });
70
+ }
71
+ export function accountOrders(options) {
72
+ const packageAddress = options.package ?? '@waterx/prediction';
73
+ const argumentsTypes = [
74
+ null
75
+ ];
76
+ const parameterNames = ["data"];
77
+ return (tx) => tx.moveCall({
78
+ package: packageAddress,
79
+ module: 'account_data',
80
+ function: 'account_orders',
81
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
82
+ });
83
+ }
84
+ export function accountPositions(options) {
85
+ const packageAddress = options.package ?? '@waterx/prediction';
86
+ const argumentsTypes = [
87
+ null
88
+ ];
89
+ const parameterNames = ["data"];
90
+ return (tx) => tx.moveCall({
91
+ package: packageAddress,
92
+ module: 'account_data',
93
+ function: 'account_positions',
94
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
95
+ });
96
+ }
97
+ export function orderCount(options) {
98
+ const packageAddress = options.package ?? '@waterx/prediction';
99
+ const argumentsTypes = [
100
+ null
101
+ ];
102
+ const parameterNames = ["data"];
103
+ return (tx) => tx.moveCall({
104
+ package: packageAddress,
105
+ module: 'account_data',
106
+ function: 'order_count',
107
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
108
+ });
109
+ }
110
+ export function positionCount(options) {
111
+ const packageAddress = options.package ?? '@waterx/prediction';
112
+ const argumentsTypes = [
113
+ null
114
+ ];
115
+ const parameterNames = ["data"];
116
+ return (tx) => tx.moveCall({
117
+ package: packageAddress,
118
+ module: 'account_data',
119
+ function: 'position_count',
120
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
121
+ });
122
+ }
123
+ export function orderFront(options) {
124
+ const packageAddress = options.package ?? '@waterx/prediction';
125
+ const argumentsTypes = [
126
+ null
127
+ ];
128
+ const parameterNames = ["data"];
129
+ return (tx) => tx.moveCall({
130
+ package: packageAddress,
131
+ module: 'account_data',
132
+ function: 'order_front',
133
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
134
+ });
135
+ }
136
+ export function orderBack(options) {
137
+ const packageAddress = options.package ?? '@waterx/prediction';
138
+ const argumentsTypes = [
139
+ null
140
+ ];
141
+ const parameterNames = ["data"];
142
+ return (tx) => tx.moveCall({
143
+ package: packageAddress,
144
+ module: 'account_data',
145
+ function: 'order_back',
146
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
147
+ });
148
+ }
149
+ export function orderNext(options) {
150
+ const packageAddress = options.package ?? '@waterx/prediction';
151
+ const argumentsTypes = [
152
+ null,
153
+ 'u64'
154
+ ];
155
+ const parameterNames = ["data", "orderId"];
156
+ return (tx) => tx.moveCall({
157
+ package: packageAddress,
158
+ module: 'account_data',
159
+ function: 'order_next',
160
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
161
+ });
162
+ }
163
+ export function positionFront(options) {
164
+ const packageAddress = options.package ?? '@waterx/prediction';
165
+ const argumentsTypes = [
166
+ null
167
+ ];
168
+ const parameterNames = ["data"];
169
+ return (tx) => tx.moveCall({
170
+ package: packageAddress,
171
+ module: 'account_data',
172
+ function: 'position_front',
173
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
174
+ });
175
+ }
176
+ export function positionBack(options) {
177
+ const packageAddress = options.package ?? '@waterx/prediction';
178
+ const argumentsTypes = [
179
+ null
180
+ ];
181
+ const parameterNames = ["data"];
182
+ return (tx) => tx.moveCall({
183
+ package: packageAddress,
184
+ module: 'account_data',
185
+ function: 'position_back',
186
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
187
+ });
188
+ }
189
+ export function positionNext(options) {
190
+ const packageAddress = options.package ?? '@waterx/prediction';
191
+ const argumentsTypes = [
192
+ null,
193
+ 'u64'
194
+ ];
195
+ const parameterNames = ["data", "positionId"];
196
+ return (tx) => tx.moveCall({
197
+ package: packageAddress,
198
+ module: 'account_data',
199
+ function: 'position_next',
200
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
201
+ });
202
+ }
203
+ export function orderMarketKey(options) {
204
+ const packageAddress = options.package ?? '@waterx/prediction';
205
+ const argumentsTypes = [
206
+ null,
207
+ 'u64'
208
+ ];
209
+ const parameterNames = ["data", "orderId"];
210
+ return (tx) => tx.moveCall({
211
+ package: packageAddress,
212
+ module: 'account_data',
213
+ function: 'order_market_key',
214
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
215
+ });
216
+ }
217
+ export function positionMarketKey(options) {
218
+ const packageAddress = options.package ?? '@waterx/prediction';
219
+ const argumentsTypes = [
220
+ null,
221
+ 'u64'
222
+ ];
223
+ const parameterNames = ["data", "positionId"];
224
+ return (tx) => tx.moveCall({
225
+ package: packageAddress,
226
+ module: 'account_data',
227
+ function: 'position_market_key',
228
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
229
+ });
230
+ }
231
+ export function marketOrderCount(options) {
232
+ const packageAddress = options.package ?? '@waterx/prediction';
233
+ const argumentsTypes = [
234
+ null,
235
+ 'u64'
236
+ ];
237
+ const parameterNames = ["data", "marketKey"];
238
+ return (tx) => tx.moveCall({
239
+ package: packageAddress,
240
+ module: 'account_data',
241
+ function: 'market_order_count',
242
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
243
+ });
244
+ }
245
+ export function marketPositionCount(options) {
246
+ const packageAddress = options.package ?? '@waterx/prediction';
247
+ const argumentsTypes = [
248
+ null,
249
+ 'u64'
250
+ ];
251
+ const parameterNames = ["data", "marketKey"];
252
+ return (tx) => tx.moveCall({
253
+ package: packageAddress,
254
+ module: 'account_data',
255
+ function: 'market_position_count',
256
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
257
+ });
258
+ }
259
+ export function marketOrderFront(options) {
260
+ const packageAddress = options.package ?? '@waterx/prediction';
261
+ const argumentsTypes = [
262
+ null,
263
+ 'u64'
264
+ ];
265
+ const parameterNames = ["data", "marketKey"];
266
+ return (tx) => tx.moveCall({
267
+ package: packageAddress,
268
+ module: 'account_data',
269
+ function: 'market_order_front',
270
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
271
+ });
272
+ }
273
+ export function marketOrderBack(options) {
274
+ const packageAddress = options.package ?? '@waterx/prediction';
275
+ const argumentsTypes = [
276
+ null,
277
+ 'u64'
278
+ ];
279
+ const parameterNames = ["data", "marketKey"];
280
+ return (tx) => tx.moveCall({
281
+ package: packageAddress,
282
+ module: 'account_data',
283
+ function: 'market_order_back',
284
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
285
+ });
286
+ }
287
+ export function marketOrderNext(options) {
288
+ const packageAddress = options.package ?? '@waterx/prediction';
289
+ const argumentsTypes = [
290
+ null,
291
+ 'u64',
292
+ 'u64'
293
+ ];
294
+ const parameterNames = ["data", "marketKey", "orderId"];
295
+ return (tx) => tx.moveCall({
296
+ package: packageAddress,
297
+ module: 'account_data',
298
+ function: 'market_order_next',
299
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
300
+ });
301
+ }
302
+ export function marketPositionFront(options) {
303
+ const packageAddress = options.package ?? '@waterx/prediction';
304
+ const argumentsTypes = [
305
+ null,
306
+ 'u64'
307
+ ];
308
+ const parameterNames = ["data", "marketKey"];
309
+ return (tx) => tx.moveCall({
310
+ package: packageAddress,
311
+ module: 'account_data',
312
+ function: 'market_position_front',
313
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
314
+ });
315
+ }
316
+ export function marketPositionBack(options) {
317
+ const packageAddress = options.package ?? '@waterx/prediction';
318
+ const argumentsTypes = [
319
+ null,
320
+ 'u64'
321
+ ];
322
+ const parameterNames = ["data", "marketKey"];
323
+ return (tx) => tx.moveCall({
324
+ package: packageAddress,
325
+ module: 'account_data',
326
+ function: 'market_position_back',
327
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
328
+ });
329
+ }
330
+ export function marketPositionNext(options) {
331
+ const packageAddress = options.package ?? '@waterx/prediction';
332
+ const argumentsTypes = [
333
+ null,
334
+ 'u64',
335
+ 'u64'
336
+ ];
337
+ const parameterNames = ["data", "marketKey", "positionId"];
338
+ return (tx) => tx.moveCall({
339
+ package: packageAddress,
340
+ module: 'account_data',
341
+ function: 'market_position_next',
342
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
343
+ });
344
+ }
345
+ export function orderIdsByMarket(options) {
346
+ const packageAddress = options.package ?? '@waterx/prediction';
347
+ const argumentsTypes = [
348
+ null,
349
+ 'u64'
350
+ ];
351
+ const parameterNames = ["data", "marketKey"];
352
+ return (tx) => tx.moveCall({
353
+ package: packageAddress,
354
+ module: 'account_data',
355
+ function: 'order_ids_by_market',
356
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
357
+ });
358
+ }
359
+ export function positionIdsByMarket(options) {
360
+ const packageAddress = options.package ?? '@waterx/prediction';
361
+ const argumentsTypes = [
362
+ null,
363
+ 'u64'
364
+ ];
365
+ const parameterNames = ["data", "marketKey"];
366
+ return (tx) => tx.moveCall({
367
+ package: packageAddress,
368
+ module: 'account_data',
369
+ function: 'position_ids_by_market',
370
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
371
+ });
372
+ }
373
+ /**
374
+ * True if a `WaterXPredictionData` slot exists on the wxa account. The slot
375
+ * auto-installs on first order/position add.
376
+ */
377
+ export function hasAccount(options) {
378
+ const packageAddress = options.package ?? '@waterx/prediction';
379
+ const argumentsTypes = [
380
+ null,
381
+ '0x2::object::ID'
382
+ ];
383
+ const parameterNames = ["wxaRegistry", "accountId"];
384
+ return (tx) => tx.moveCall({
385
+ package: packageAddress,
386
+ module: 'account_data',
387
+ function: 'has_account',
388
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
389
+ });
390
+ }
391
+ /** Borrow the prediction data blob. Aborts if the account has not traded yet. */
392
+ export function borrowAccount(options) {
393
+ const packageAddress = options.package ?? '@waterx/prediction';
394
+ const argumentsTypes = [
395
+ null,
396
+ '0x2::object::ID'
397
+ ];
398
+ const parameterNames = ["wxaRegistry", "accountId"];
399
+ return (tx) => tx.moveCall({
400
+ package: packageAddress,
401
+ module: 'account_data',
402
+ function: 'borrow_account',
403
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
404
+ });
405
+ }
@@ -0,0 +1,5 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { MoveStruct } from '../utils/index.ts';
5
+ export declare const AdminCap: MoveStruct<any, any>;
@@ -0,0 +1,9 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { MoveStruct } from "../utils/index.js";
5
+ import { bcs } from '@mysten/sui/bcs';
6
+ const $moduleName = '@waterx/prediction::admin';
7
+ export const AdminCap = new MoveStruct({ name: `${$moduleName}::AdminCap`, fields: {
8
+ id: bcs.Address
9
+ } });
@@ -0,0 +1,60 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * On-chain audit trail for `place_order_for`: payer (host) fronts funds while the
6
+ * beneficiary `waterx_account` owns order / position indexing and payouts.
7
+ */
8
+ import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
9
+ import { type Transaction } from '@mysten/sui/transactions';
10
+ export declare const BetSharing: MoveStruct<any, any>;
11
+ export interface HostAccountIdArguments {
12
+ bs: RawTransactionArgument<string>;
13
+ }
14
+ export interface HostAccountIdOptions {
15
+ package?: string;
16
+ arguments: HostAccountIdArguments | [
17
+ bs: RawTransactionArgument<string>
18
+ ];
19
+ }
20
+ export declare function hostAccountId(options: HostAccountIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
21
+ export interface BeneficiaryAccountIdArguments {
22
+ bs: RawTransactionArgument<string>;
23
+ }
24
+ export interface BeneficiaryAccountIdOptions {
25
+ package?: string;
26
+ arguments: BeneficiaryAccountIdArguments | [
27
+ bs: RawTransactionArgument<string>
28
+ ];
29
+ }
30
+ export declare function beneficiaryAccountId(options: BeneficiaryAccountIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
31
+ export interface OrderIdArguments {
32
+ bs: RawTransactionArgument<string>;
33
+ }
34
+ export interface OrderIdOptions {
35
+ package?: string;
36
+ arguments: OrderIdArguments | [
37
+ bs: RawTransactionArgument<string>
38
+ ];
39
+ }
40
+ export declare function orderId(options: OrderIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
41
+ export interface MarketKeyArguments {
42
+ bs: RawTransactionArgument<string>;
43
+ }
44
+ export interface MarketKeyOptions {
45
+ package?: string;
46
+ arguments: MarketKeyArguments | [
47
+ bs: RawTransactionArgument<string>
48
+ ];
49
+ }
50
+ export declare function marketKey(options: MarketKeyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
51
+ export interface CreatedAtMsArguments {
52
+ bs: RawTransactionArgument<string>;
53
+ }
54
+ export interface CreatedAtMsOptions {
55
+ package?: string;
56
+ arguments: CreatedAtMsArguments | [
57
+ bs: RawTransactionArgument<string>
58
+ ];
59
+ }
60
+ export declare function createdAtMs(options: CreatedAtMsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
@@ -0,0 +1,83 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * On-chain audit trail for `place_order_for`: payer (host) fronts funds while the
6
+ * beneficiary `waterx_account` owns order / position indexing and payouts.
7
+ */
8
+ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
9
+ import { bcs } from '@mysten/sui/bcs';
10
+ const $moduleName = '@waterx/prediction::bet_sharing';
11
+ export const BetSharing = new MoveStruct({ name: `${$moduleName}::BetSharing`, fields: {
12
+ id: bcs.Address,
13
+ host_account_id: bcs.Address,
14
+ beneficiary_account_id: bcs.Address,
15
+ order_id: bcs.u64(),
16
+ market_key: bcs.u64(),
17
+ created_at_ms: bcs.u64()
18
+ } });
19
+ export function hostAccountId(options) {
20
+ const packageAddress = options.package ?? '@waterx/prediction';
21
+ const argumentsTypes = [
22
+ null
23
+ ];
24
+ const parameterNames = ["bs"];
25
+ return (tx) => tx.moveCall({
26
+ package: packageAddress,
27
+ module: 'bet_sharing',
28
+ function: 'host_account_id',
29
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
30
+ });
31
+ }
32
+ export function beneficiaryAccountId(options) {
33
+ const packageAddress = options.package ?? '@waterx/prediction';
34
+ const argumentsTypes = [
35
+ null
36
+ ];
37
+ const parameterNames = ["bs"];
38
+ return (tx) => tx.moveCall({
39
+ package: packageAddress,
40
+ module: 'bet_sharing',
41
+ function: 'beneficiary_account_id',
42
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
43
+ });
44
+ }
45
+ export function orderId(options) {
46
+ const packageAddress = options.package ?? '@waterx/prediction';
47
+ const argumentsTypes = [
48
+ null
49
+ ];
50
+ const parameterNames = ["bs"];
51
+ return (tx) => tx.moveCall({
52
+ package: packageAddress,
53
+ module: 'bet_sharing',
54
+ function: 'order_id',
55
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
56
+ });
57
+ }
58
+ export function marketKey(options) {
59
+ const packageAddress = options.package ?? '@waterx/prediction';
60
+ const argumentsTypes = [
61
+ null
62
+ ];
63
+ const parameterNames = ["bs"];
64
+ return (tx) => tx.moveCall({
65
+ package: packageAddress,
66
+ module: 'bet_sharing',
67
+ function: 'market_key',
68
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
69
+ });
70
+ }
71
+ export function createdAtMs(options) {
72
+ const packageAddress = options.package ?? '@waterx/prediction';
73
+ const argumentsTypes = [
74
+ null
75
+ ];
76
+ const parameterNames = ["bs"];
77
+ return (tx) => tx.moveCall({
78
+ package: packageAddress,
79
+ module: 'bet_sharing',
80
+ function: 'created_at_ms',
81
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
82
+ });
83
+ }
@@ -0,0 +1,8 @@
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
+ export declare function LinkedTable<K extends BcsType<any>>(...typeParameters: [
7
+ K
8
+ ]): MoveStruct<any, any>;
@@ -0,0 +1,18 @@
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 = 'bucket_v2_framework::linked_table';
7
+ export function LinkedTable(...typeParameters) {
8
+ return new MoveStruct({ name: `${$moduleName}::LinkedTable<${typeParameters[0].name}, phantom V>`, fields: {
9
+ /** the ID of this table */
10
+ id: bcs.Address,
11
+ /** the number of key-value pairs in the table */
12
+ size: bcs.u64(),
13
+ /** the front of the table, i.e. the key of the first entry */
14
+ head: bcs.option(typeParameters[0]),
15
+ /** the back of the table, i.e. the key of the last entry */
16
+ tail: bcs.option(typeParameters[0])
17
+ } });
18
+ }
@@ -0,0 +1,10 @@
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<any, any>;
@@ -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,24 @@
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<any, any>;
@@ -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
+ } });