@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,836 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ /**
5
+ * Global protocol configuration for WaterX Perp. AdminCap-gated operations for
6
+ * protocol settings.
7
+ */
8
+ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
9
+ import { bcs } from '@mysten/sui/bcs';
10
+ import * as vec_set from "./deps/sui/vec_set.js";
11
+ import * as vec_set_1 from "./deps/sui/vec_set.js";
12
+ import * as vec_set_2 from "./deps/sui/vec_set.js";
13
+ import * as vec_set_3 from "./deps/sui/vec_set.js";
14
+ import * as vec_set_4 from "./deps/sui/vec_set.js";
15
+ import * as sheet from "./deps/bucket_v2_framework/sheet.js";
16
+ import * as balance from "./deps/sui/balance.js";
17
+ import * as balance_1 from "./deps/sui/balance.js";
18
+ import * as balance_2 from "./deps/sui/balance.js";
19
+ const $moduleName = '@waterx/perp::global_config';
20
+ export const GlobalConfig = new MoveStruct({ name: `${$moduleName}::GlobalConfig`, fields: {
21
+ id: bcs.Address,
22
+ /** Allowed protocol versions (admin-managed). */
23
+ allowed_versions: vec_set.VecSet(bcs.u16()),
24
+ /**
25
+ * Protocol-wide pause. When true, every trading and WLP action aborts. Triggered
26
+ * by any pauser; only AdminCap can unpause.
27
+ */
28
+ is_paused: bcs.bool(),
29
+ /** Authorized addresses that can trigger the global pause (but not unpause). */
30
+ pausers: vec_set_1.VecSet(bcs.Address),
31
+ /** Authorized keeper addresses. */
32
+ keepers: vec_set_2.VecSet(bcs.Address),
33
+ /** Authorized WLP redeem operators (can settle/reject redeem requests). */
34
+ redeem_operators: vec_set_3.VecSet(bcs.Address),
35
+ /** Authorized risk manager addresses (can force-close positions). */
36
+ risk_managers: vec_set_4.VecSet(bcs.Address),
37
+ /**
38
+ * Protocol fee share in bps (of total trading fees). The protocol's cut of every
39
+ * realized trading fee accumulates on `GlobalVault.protocol_fee_balance` and is
40
+ * drained via `claim_protocol_fee` (admin-gated).
41
+ */
42
+ protocol_fee_share_bps: bcs.u64(),
43
+ /** Optional keeper reward fee in bps of position notional. */
44
+ liquidator_fee_bps: bcs.u64(),
45
+ /**
46
+ * Insurance fund fee in bps of position notional. The insurance cut of every
47
+ * liquidation accumulates on `GlobalVault.insurance_fee_balance` and is drained
48
+ * via `claim_insurance_fee` (admin-gated).
49
+ */
50
+ insurance_fee_bps: bcs.u64(),
51
+ /** Maximum stale/invalid orders a keeper match call may skip or cancel. */
52
+ max_skipped_orders_per_match: bcs.u64(),
53
+ /** OI cap as bps of pool TVL (0 = no cap). */
54
+ oi_cap_bps: bcs.u64(),
55
+ /** Maximum allowed age for WLP token price refreshes in ms. */
56
+ price_refresh_threshold_ms: bcs.u64()
57
+ } });
58
+ export const GlobalVault = new MoveStruct({ name: `${$moduleName}::GlobalVault<phantom C_TOKEN>`, fields: {
59
+ sheet: sheet.Sheet,
60
+ /**
61
+ * Trader collateral + LP liquidity — drained / topped up by every trading and WLP
62
+ * action.
63
+ */
64
+ balance: balance.Balance,
65
+ /**
66
+ * Accumulated protocol-fee share. Routed here by `execute_*` / `match_orders` /
67
+ * `mint_wlp` / `settle_redeem` instead of being transferred to a configured
68
+ * `fee_address`. Drained by `claim_protocol_fee` (admin-gated).
69
+ */
70
+ protocol_fee_balance: balance_1.Balance,
71
+ /**
72
+ * Accumulated insurance fee from liquidations. Routed here by `execute_liquidate`
73
+ * instead of being transferred to a configured `insurance_address`. Drained by
74
+ * `claim_insurance_fee` (admin-gated).
75
+ */
76
+ insurance_fee_balance: balance_2.Balance
77
+ } });
78
+ export function init(options = {}) {
79
+ const packageAddress = options.package ?? '@waterx/perp';
80
+ return (tx) => tx.moveCall({
81
+ package: packageAddress,
82
+ module: 'global_config',
83
+ function: 'init',
84
+ });
85
+ }
86
+ export function assertVersion(options) {
87
+ const packageAddress = options.package ?? '@waterx/perp';
88
+ const argumentsTypes = [
89
+ null
90
+ ];
91
+ const parameterNames = ["globalConfig"];
92
+ return (tx) => tx.moveCall({
93
+ package: packageAddress,
94
+ module: 'global_config',
95
+ function: 'assert_version',
96
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
97
+ });
98
+ }
99
+ export function allowVersion(options) {
100
+ const packageAddress = options.package ?? '@waterx/perp';
101
+ const argumentsTypes = [
102
+ null,
103
+ null,
104
+ 'u16'
105
+ ];
106
+ const parameterNames = ["globalConfig", "_", "v"];
107
+ return (tx) => tx.moveCall({
108
+ package: packageAddress,
109
+ module: 'global_config',
110
+ function: 'allow_version',
111
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
112
+ });
113
+ }
114
+ export function disallowVersion(options) {
115
+ const packageAddress = options.package ?? '@waterx/perp';
116
+ const argumentsTypes = [
117
+ null,
118
+ null,
119
+ 'u16'
120
+ ];
121
+ const parameterNames = ["globalConfig", "_", "v"];
122
+ return (tx) => tx.moveCall({
123
+ package: packageAddress,
124
+ module: 'global_config',
125
+ function: 'disallow_version',
126
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
127
+ });
128
+ }
129
+ export function setLiquidatorFeeBps(options) {
130
+ const packageAddress = options.package ?? '@waterx/perp';
131
+ const argumentsTypes = [
132
+ null,
133
+ null,
134
+ 'u64'
135
+ ];
136
+ const parameterNames = ["globalConfig", "_", "v"];
137
+ return (tx) => tx.moveCall({
138
+ package: packageAddress,
139
+ module: 'global_config',
140
+ function: 'set_liquidator_fee_bps',
141
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
142
+ });
143
+ }
144
+ export function setInsuranceFeeBps(options) {
145
+ const packageAddress = options.package ?? '@waterx/perp';
146
+ const argumentsTypes = [
147
+ null,
148
+ null,
149
+ 'u64'
150
+ ];
151
+ const parameterNames = ["globalConfig", "_", "v"];
152
+ return (tx) => tx.moveCall({
153
+ package: packageAddress,
154
+ module: 'global_config',
155
+ function: 'set_insurance_fee_bps',
156
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
157
+ });
158
+ }
159
+ export function setMaxSkippedOrdersPerMatch(options) {
160
+ const packageAddress = options.package ?? '@waterx/perp';
161
+ const argumentsTypes = [
162
+ null,
163
+ null,
164
+ 'u64'
165
+ ];
166
+ const parameterNames = ["globalConfig", "_", "v"];
167
+ return (tx) => tx.moveCall({
168
+ package: packageAddress,
169
+ module: 'global_config',
170
+ function: 'set_max_skipped_orders_per_match',
171
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
172
+ });
173
+ }
174
+ export function setOiCapBps(options) {
175
+ const packageAddress = options.package ?? '@waterx/perp';
176
+ const argumentsTypes = [
177
+ null,
178
+ null,
179
+ 'u64'
180
+ ];
181
+ const parameterNames = ["globalConfig", "_", "v"];
182
+ return (tx) => tx.moveCall({
183
+ package: packageAddress,
184
+ module: 'global_config',
185
+ function: 'set_oi_cap_bps',
186
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
187
+ });
188
+ }
189
+ export function setPriceRefreshThresholdMs(options) {
190
+ const packageAddress = options.package ?? '@waterx/perp';
191
+ const argumentsTypes = [
192
+ null,
193
+ null,
194
+ 'u64'
195
+ ];
196
+ const parameterNames = ["globalConfig", "_", "v"];
197
+ return (tx) => tx.moveCall({
198
+ package: packageAddress,
199
+ module: 'global_config',
200
+ function: 'set_price_refresh_threshold_ms',
201
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
202
+ });
203
+ }
204
+ export function liquidatorFeeBps(options) {
205
+ const packageAddress = options.package ?? '@waterx/perp';
206
+ const argumentsTypes = [
207
+ null
208
+ ];
209
+ const parameterNames = ["globalConfig"];
210
+ return (tx) => tx.moveCall({
211
+ package: packageAddress,
212
+ module: 'global_config',
213
+ function: 'liquidator_fee_bps',
214
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
215
+ });
216
+ }
217
+ export function insuranceFeeBps(options) {
218
+ const packageAddress = options.package ?? '@waterx/perp';
219
+ const argumentsTypes = [
220
+ null
221
+ ];
222
+ const parameterNames = ["globalConfig"];
223
+ return (tx) => tx.moveCall({
224
+ package: packageAddress,
225
+ module: 'global_config',
226
+ function: 'insurance_fee_bps',
227
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
228
+ });
229
+ }
230
+ export function maxSkippedOrdersPerMatch(options) {
231
+ const packageAddress = options.package ?? '@waterx/perp';
232
+ const argumentsTypes = [
233
+ null
234
+ ];
235
+ const parameterNames = ["globalConfig"];
236
+ return (tx) => tx.moveCall({
237
+ package: packageAddress,
238
+ module: 'global_config',
239
+ function: 'max_skipped_orders_per_match',
240
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
241
+ });
242
+ }
243
+ export function oiCapBps(options) {
244
+ const packageAddress = options.package ?? '@waterx/perp';
245
+ const argumentsTypes = [
246
+ null
247
+ ];
248
+ const parameterNames = ["globalConfig"];
249
+ return (tx) => tx.moveCall({
250
+ package: packageAddress,
251
+ module: 'global_config',
252
+ function: 'oi_cap_bps',
253
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
254
+ });
255
+ }
256
+ export function priceRefreshThresholdMs(options) {
257
+ const packageAddress = options.package ?? '@waterx/perp';
258
+ const argumentsTypes = [
259
+ null
260
+ ];
261
+ const parameterNames = ["globalConfig"];
262
+ return (tx) => tx.moveCall({
263
+ package: packageAddress,
264
+ module: 'global_config',
265
+ function: 'price_refresh_threshold_ms',
266
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
267
+ });
268
+ }
269
+ export function protocolFeeShareBps(options) {
270
+ const packageAddress = options.package ?? '@waterx/perp';
271
+ const argumentsTypes = [
272
+ null
273
+ ];
274
+ const parameterNames = ["globalConfig"];
275
+ return (tx) => tx.moveCall({
276
+ package: packageAddress,
277
+ module: 'global_config',
278
+ function: 'protocol_fee_share_bps',
279
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
280
+ });
281
+ }
282
+ export function keeperCount(options) {
283
+ const packageAddress = options.package ?? '@waterx/perp';
284
+ const argumentsTypes = [
285
+ null
286
+ ];
287
+ const parameterNames = ["globalConfig"];
288
+ return (tx) => tx.moveCall({
289
+ package: packageAddress,
290
+ module: 'global_config',
291
+ function: 'keeper_count',
292
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
293
+ });
294
+ }
295
+ export function keeperAddresses(options) {
296
+ const packageAddress = options.package ?? '@waterx/perp';
297
+ const argumentsTypes = [
298
+ null
299
+ ];
300
+ const parameterNames = ["globalConfig"];
301
+ return (tx) => tx.moveCall({
302
+ package: packageAddress,
303
+ module: 'global_config',
304
+ function: 'keeper_addresses',
305
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
306
+ });
307
+ }
308
+ export function redeemOperatorCount(options) {
309
+ const packageAddress = options.package ?? '@waterx/perp';
310
+ const argumentsTypes = [
311
+ null
312
+ ];
313
+ const parameterNames = ["globalConfig"];
314
+ return (tx) => tx.moveCall({
315
+ package: packageAddress,
316
+ module: 'global_config',
317
+ function: 'redeem_operator_count',
318
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
319
+ });
320
+ }
321
+ export function redeemOperatorAddresses(options) {
322
+ const packageAddress = options.package ?? '@waterx/perp';
323
+ const argumentsTypes = [
324
+ null
325
+ ];
326
+ const parameterNames = ["globalConfig"];
327
+ return (tx) => tx.moveCall({
328
+ package: packageAddress,
329
+ module: 'global_config',
330
+ function: 'redeem_operator_addresses',
331
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
332
+ });
333
+ }
334
+ export function riskManagerAddresses(options) {
335
+ const packageAddress = options.package ?? '@waterx/perp';
336
+ const argumentsTypes = [
337
+ null
338
+ ];
339
+ const parameterNames = ["globalConfig"];
340
+ return (tx) => tx.moveCall({
341
+ package: packageAddress,
342
+ module: 'global_config',
343
+ function: 'risk_manager_addresses',
344
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
345
+ });
346
+ }
347
+ export function allowedVersions(options) {
348
+ const packageAddress = options.package ?? '@waterx/perp';
349
+ const argumentsTypes = [
350
+ null
351
+ ];
352
+ const parameterNames = ["globalConfig"];
353
+ return (tx) => tx.moveCall({
354
+ package: packageAddress,
355
+ module: 'global_config',
356
+ function: 'allowed_versions',
357
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
358
+ });
359
+ }
360
+ /** Adds a keeper address. */
361
+ export function addKeeper(options) {
362
+ const packageAddress = options.package ?? '@waterx/perp';
363
+ const argumentsTypes = [
364
+ null,
365
+ null,
366
+ 'address'
367
+ ];
368
+ const parameterNames = ["globalConfig", "Cap", "keeper"];
369
+ return (tx) => tx.moveCall({
370
+ package: packageAddress,
371
+ module: 'global_config',
372
+ function: 'add_keeper',
373
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
374
+ });
375
+ }
376
+ /** Removes a keeper address. */
377
+ export function removeKeeper(options) {
378
+ const packageAddress = options.package ?? '@waterx/perp';
379
+ const argumentsTypes = [
380
+ null,
381
+ null,
382
+ 'address'
383
+ ];
384
+ const parameterNames = ["globalConfig", "Cap", "keeper"];
385
+ return (tx) => tx.moveCall({
386
+ package: packageAddress,
387
+ module: 'global_config',
388
+ function: 'remove_keeper',
389
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
390
+ });
391
+ }
392
+ /** Adds a WLP redeem operator address. */
393
+ export function addRedeemOperator(options) {
394
+ const packageAddress = options.package ?? '@waterx/perp';
395
+ const argumentsTypes = [
396
+ null,
397
+ null,
398
+ 'address'
399
+ ];
400
+ const parameterNames = ["globalConfig", "Cap", "redeemOperator"];
401
+ return (tx) => tx.moveCall({
402
+ package: packageAddress,
403
+ module: 'global_config',
404
+ function: 'add_redeem_operator',
405
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
406
+ });
407
+ }
408
+ /** Removes a WLP redeem operator address. */
409
+ export function removeRedeemOperator(options) {
410
+ const packageAddress = options.package ?? '@waterx/perp';
411
+ const argumentsTypes = [
412
+ null,
413
+ null,
414
+ 'address'
415
+ ];
416
+ const parameterNames = ["globalConfig", "Cap", "redeemOperator"];
417
+ return (tx) => tx.moveCall({
418
+ package: packageAddress,
419
+ module: 'global_config',
420
+ function: 'remove_redeem_operator',
421
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
422
+ });
423
+ }
424
+ /** Adds a risk manager address. */
425
+ export function addRiskManager(options) {
426
+ const packageAddress = options.package ?? '@waterx/perp';
427
+ const argumentsTypes = [
428
+ null,
429
+ null,
430
+ 'address'
431
+ ];
432
+ const parameterNames = ["globalConfig", "Cap", "riskManager"];
433
+ return (tx) => tx.moveCall({
434
+ package: packageAddress,
435
+ module: 'global_config',
436
+ function: 'add_risk_manager',
437
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
438
+ });
439
+ }
440
+ /** Removes a risk manager address. */
441
+ export function removeRiskManager(options) {
442
+ const packageAddress = options.package ?? '@waterx/perp';
443
+ const argumentsTypes = [
444
+ null,
445
+ null,
446
+ 'address'
447
+ ];
448
+ const parameterNames = ["globalConfig", "Cap", "riskManager"];
449
+ return (tx) => tx.moveCall({
450
+ package: packageAddress,
451
+ module: 'global_config',
452
+ function: 'remove_risk_manager',
453
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
454
+ });
455
+ }
456
+ /** Sets protocol fee share. */
457
+ export function setProtocolFeeShare(options) {
458
+ const packageAddress = options.package ?? '@waterx/perp';
459
+ const argumentsTypes = [
460
+ null,
461
+ null,
462
+ 'u64'
463
+ ];
464
+ const parameterNames = ["globalConfig", "Cap", "feeShareBps"];
465
+ return (tx) => tx.moveCall({
466
+ package: packageAddress,
467
+ module: 'global_config',
468
+ function: 'set_protocol_fee_share',
469
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
470
+ });
471
+ }
472
+ /** Aborts if the protocol is globally paused. */
473
+ export function assertNotPaused(options) {
474
+ const packageAddress = options.package ?? '@waterx/perp';
475
+ const argumentsTypes = [
476
+ null
477
+ ];
478
+ const parameterNames = ["globalConfig"];
479
+ return (tx) => tx.moveCall({
480
+ package: packageAddress,
481
+ module: 'global_config',
482
+ function: 'assert_not_paused',
483
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
484
+ });
485
+ }
486
+ /**
487
+ * Combined pre-flight check used by every public entrypoint: protocol must not be
488
+ * paused AND the on-chain package must be on an allowed version. Folded into one
489
+ * helper so call sites can `gc.assert_active()` instead of pairing the two checks
490
+ * each time.
491
+ */
492
+ export function assertActive(options) {
493
+ const packageAddress = options.package ?? '@waterx/perp';
494
+ const argumentsTypes = [
495
+ null
496
+ ];
497
+ const parameterNames = ["globalConfig"];
498
+ return (tx) => tx.moveCall({
499
+ package: packageAddress,
500
+ module: 'global_config',
501
+ function: 'assert_active',
502
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
503
+ });
504
+ }
505
+ export function isPaused(options) {
506
+ const packageAddress = options.package ?? '@waterx/perp';
507
+ const argumentsTypes = [
508
+ null
509
+ ];
510
+ const parameterNames = ["globalConfig"];
511
+ return (tx) => tx.moveCall({
512
+ package: packageAddress,
513
+ module: 'global_config',
514
+ function: 'is_paused',
515
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
516
+ });
517
+ }
518
+ export function pauserCount(options) {
519
+ const packageAddress = options.package ?? '@waterx/perp';
520
+ const argumentsTypes = [
521
+ null
522
+ ];
523
+ const parameterNames = ["globalConfig"];
524
+ return (tx) => tx.moveCall({
525
+ package: packageAddress,
526
+ module: 'global_config',
527
+ function: 'pauser_count',
528
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
529
+ });
530
+ }
531
+ export function pauserAddresses(options) {
532
+ const packageAddress = options.package ?? '@waterx/perp';
533
+ const argumentsTypes = [
534
+ null
535
+ ];
536
+ const parameterNames = ["globalConfig"];
537
+ return (tx) => tx.moveCall({
538
+ package: packageAddress,
539
+ module: 'global_config',
540
+ function: 'pauser_addresses',
541
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
542
+ });
543
+ }
544
+ /** Adds an authorized pauser. Admin-gated. */
545
+ export function addPauser(options) {
546
+ const packageAddress = options.package ?? '@waterx/perp';
547
+ const argumentsTypes = [
548
+ null,
549
+ null,
550
+ 'address'
551
+ ];
552
+ const parameterNames = ["globalConfig", "Cap", "pauser"];
553
+ return (tx) => tx.moveCall({
554
+ package: packageAddress,
555
+ module: 'global_config',
556
+ function: 'add_pauser',
557
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
558
+ });
559
+ }
560
+ /** Removes an authorized pauser. Admin-gated. */
561
+ export function removePauser(options) {
562
+ const packageAddress = options.package ?? '@waterx/perp';
563
+ const argumentsTypes = [
564
+ null,
565
+ null,
566
+ 'address'
567
+ ];
568
+ const parameterNames = ["globalConfig", "Cap", "pauser"];
569
+ return (tx) => tx.moveCall({
570
+ package: packageAddress,
571
+ module: 'global_config',
572
+ function: 'remove_pauser',
573
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
574
+ });
575
+ }
576
+ /**
577
+ * Triggers the global pause. Callable by any registered pauser. Unpause requires
578
+ * `AdminCap` (see `unpause`).
579
+ */
580
+ export function pause(options) {
581
+ const packageAddress = options.package ?? '@waterx/perp';
582
+ const argumentsTypes = [
583
+ null,
584
+ null
585
+ ];
586
+ const parameterNames = ["globalConfig", "senderRequest"];
587
+ return (tx) => tx.moveCall({
588
+ package: packageAddress,
589
+ module: 'global_config',
590
+ function: 'pause',
591
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
592
+ });
593
+ }
594
+ /** Lifts the global pause. Admin-only. */
595
+ export function unpause(options) {
596
+ const packageAddress = options.package ?? '@waterx/perp';
597
+ const argumentsTypes = [
598
+ null,
599
+ null
600
+ ];
601
+ const parameterNames = ["globalConfig", "Cap"];
602
+ return (tx) => tx.moveCall({
603
+ package: packageAddress,
604
+ module: 'global_config',
605
+ function: 'unpause',
606
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
607
+ });
608
+ }
609
+ /** Returns true if the address is a registered keeper. */
610
+ export function isKeeper(options) {
611
+ const packageAddress = options.package ?? '@waterx/perp';
612
+ const argumentsTypes = [
613
+ null,
614
+ 'address'
615
+ ];
616
+ const parameterNames = ["globalConfig", "addr"];
617
+ return (tx) => tx.moveCall({
618
+ package: packageAddress,
619
+ module: 'global_config',
620
+ function: 'is_keeper',
621
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
622
+ });
623
+ }
624
+ /** Verifies the caller is a keeper. */
625
+ export function verifyKeeper(options) {
626
+ const packageAddress = options.package ?? '@waterx/perp';
627
+ const argumentsTypes = [
628
+ null,
629
+ 'address'
630
+ ];
631
+ const parameterNames = ["globalConfig", "keeper"];
632
+ return (tx) => tx.moveCall({
633
+ package: packageAddress,
634
+ module: 'global_config',
635
+ function: 'verify_keeper',
636
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
637
+ });
638
+ }
639
+ /** Verifies the caller is a WLP redeem operator. */
640
+ export function verifyRedeemOperator(options) {
641
+ const packageAddress = options.package ?? '@waterx/perp';
642
+ const argumentsTypes = [
643
+ null,
644
+ 'address'
645
+ ];
646
+ const parameterNames = ["globalConfig", "addr"];
647
+ return (tx) => tx.moveCall({
648
+ package: packageAddress,
649
+ module: 'global_config',
650
+ function: 'verify_redeem_operator',
651
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
652
+ });
653
+ }
654
+ /** Verifies the caller is a risk manager. */
655
+ export function verifyRiskManager(options) {
656
+ const packageAddress = options.package ?? '@waterx/perp';
657
+ const argumentsTypes = [
658
+ null,
659
+ 'address'
660
+ ];
661
+ const parameterNames = ["globalConfig", "addr"];
662
+ return (tx) => tx.moveCall({
663
+ package: packageAddress,
664
+ module: 'global_config',
665
+ function: 'verify_risk_manager',
666
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
667
+ });
668
+ }
669
+ /** Gets the global_config UID for sub-account storage. */
670
+ export function globalConfigUid(options) {
671
+ const packageAddress = options.package ?? '@waterx/perp';
672
+ const argumentsTypes = [
673
+ null
674
+ ];
675
+ const parameterNames = ["globalConfig"];
676
+ return (tx) => tx.moveCall({
677
+ package: packageAddress,
678
+ module: 'global_config',
679
+ function: 'global_config_uid',
680
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
681
+ });
682
+ }
683
+ /** Gets the mutable global_config UID for sub-account storage. */
684
+ export function globalConfigUidMut(options) {
685
+ const packageAddress = options.package ?? '@waterx/perp';
686
+ const argumentsTypes = [
687
+ null
688
+ ];
689
+ const parameterNames = ["globalConfig"];
690
+ return (tx) => tx.moveCall({
691
+ package: packageAddress,
692
+ module: 'global_config',
693
+ function: 'global_config_uid_mut',
694
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
695
+ });
696
+ }
697
+ /** Gets the current vault balance for a given collateral type (read-only). */
698
+ export function vaultBalance(options) {
699
+ const packageAddress = options.package ?? '@waterx/perp';
700
+ const argumentsTypes = [
701
+ null
702
+ ];
703
+ const parameterNames = ["globalConfig"];
704
+ return (tx) => tx.moveCall({
705
+ package: packageAddress,
706
+ module: 'global_config',
707
+ function: 'vault_balance',
708
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
709
+ typeArguments: options.typeArguments
710
+ });
711
+ }
712
+ /** Gets the mutable balance of collateral */
713
+ export function balanceMut(options) {
714
+ const packageAddress = options.package ?? '@waterx/perp';
715
+ const argumentsTypes = [
716
+ null
717
+ ];
718
+ const parameterNames = ["globalConfig"];
719
+ return (tx) => tx.moveCall({
720
+ package: packageAddress,
721
+ module: 'global_config',
722
+ function: 'balance_mut',
723
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
724
+ typeArguments: options.typeArguments
725
+ });
726
+ }
727
+ /** Mutable accessor for the protocol-fee accumulator. */
728
+ export function protocolFeeBalanceMut(options) {
729
+ const packageAddress = options.package ?? '@waterx/perp';
730
+ const argumentsTypes = [
731
+ null
732
+ ];
733
+ const parameterNames = ["globalConfig"];
734
+ return (tx) => tx.moveCall({
735
+ package: packageAddress,
736
+ module: 'global_config',
737
+ function: 'protocol_fee_balance_mut',
738
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
739
+ typeArguments: options.typeArguments
740
+ });
741
+ }
742
+ /** Mutable accessor for the insurance-fee accumulator. */
743
+ export function insuranceFeeBalanceMut(options) {
744
+ const packageAddress = options.package ?? '@waterx/perp';
745
+ const argumentsTypes = [
746
+ null
747
+ ];
748
+ const parameterNames = ["globalConfig"];
749
+ return (tx) => tx.moveCall({
750
+ package: packageAddress,
751
+ module: 'global_config',
752
+ function: 'insurance_fee_balance_mut',
753
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
754
+ typeArguments: options.typeArguments
755
+ });
756
+ }
757
+ /** Read-only accumulator views. */
758
+ export function protocolFeeValue(options) {
759
+ const packageAddress = options.package ?? '@waterx/perp';
760
+ const argumentsTypes = [
761
+ null
762
+ ];
763
+ const parameterNames = ["globalConfig"];
764
+ return (tx) => tx.moveCall({
765
+ package: packageAddress,
766
+ module: 'global_config',
767
+ function: 'protocol_fee_value',
768
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
769
+ typeArguments: options.typeArguments
770
+ });
771
+ }
772
+ export function insuranceFeeValue(options) {
773
+ const packageAddress = options.package ?? '@waterx/perp';
774
+ const argumentsTypes = [
775
+ null
776
+ ];
777
+ const parameterNames = ["globalConfig"];
778
+ return (tx) => tx.moveCall({
779
+ package: packageAddress,
780
+ module: 'global_config',
781
+ function: 'insurance_fee_value',
782
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
783
+ typeArguments: options.typeArguments
784
+ });
785
+ }
786
+ /**
787
+ * Admin: drain the protocol-fee accumulator for `C_TOKEN` and return the full
788
+ * balance as a `Coin<C_TOKEN>` the admin can route wherever (typically into a
789
+ * multisig treasury). No-op when the vault hasn't been opened yet; returns a zero
790
+ * coin if there's nothing to claim.
791
+ */
792
+ export function claimProtocolFee(options) {
793
+ const packageAddress = options.package ?? '@waterx/perp';
794
+ const argumentsTypes = [
795
+ null,
796
+ null
797
+ ];
798
+ const parameterNames = ["globalConfig", "Cap"];
799
+ return (tx) => tx.moveCall({
800
+ package: packageAddress,
801
+ module: 'global_config',
802
+ function: 'claim_protocol_fee',
803
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
804
+ typeArguments: options.typeArguments
805
+ });
806
+ }
807
+ /** Admin: drain the insurance-fee accumulator for `C_TOKEN`. */
808
+ export function claimInsuranceFee(options) {
809
+ const packageAddress = options.package ?? '@waterx/perp';
810
+ const argumentsTypes = [
811
+ null,
812
+ null
813
+ ];
814
+ const parameterNames = ["globalConfig", "Cap"];
815
+ return (tx) => tx.moveCall({
816
+ package: packageAddress,
817
+ module: 'global_config',
818
+ function: 'claim_insurance_fee',
819
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
820
+ typeArguments: options.typeArguments
821
+ });
822
+ }
823
+ export function ensureVault(options) {
824
+ const packageAddress = options.package ?? '@waterx/perp';
825
+ const argumentsTypes = [
826
+ null
827
+ ];
828
+ const parameterNames = ["globalConfig"];
829
+ return (tx) => tx.moveCall({
830
+ package: packageAddress,
831
+ module: 'global_config',
832
+ function: 'ensure_vault',
833
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
834
+ typeArguments: options.typeArguments
835
+ });
836
+ }