@waterx/sdk 3.0.1 → 3.0.3
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.
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/src/account/account-request.d.ts +9 -0
- package/dist/cjs/src/account/account-request.js +20 -0
- package/dist/cjs/src/account/account.d.ts +158 -0
- package/dist/cjs/src/account/account.js +238 -0
- package/dist/cjs/src/account/client.d.ts +42 -0
- package/dist/cjs/src/account/client.js +18 -0
- package/dist/cjs/src/account/config.d.ts +151 -0
- package/dist/cjs/src/account/config.js +9 -0
- package/dist/cjs/src/account/constants.d.ts +5 -0
- package/dist/cjs/src/account/constants.js +8 -0
- package/dist/cjs/src/account/fetch/referral.d.ts +15 -0
- package/dist/cjs/src/account/fetch/referral.js +56 -0
- package/dist/cjs/src/account/fetch/simulate.d.ts +34 -0
- package/dist/cjs/src/account/fetch/simulate.js +49 -0
- package/dist/cjs/src/account/funding/balance.d.ts +32 -0
- package/dist/cjs/src/account/funding/balance.js +100 -0
- package/dist/cjs/src/account/funding/consolidate.d.ts +46 -0
- package/dist/cjs/src/account/funding/consolidate.js +143 -0
- package/dist/cjs/src/account/funding/credit.d.ts +129 -0
- package/dist/cjs/src/account/funding/credit.js +252 -0
- package/dist/cjs/src/account/funding/custody.d.ts +57 -0
- package/dist/cjs/src/account/funding/custody.js +139 -0
- package/dist/cjs/src/account/funding/wormhole.d.ts +86 -0
- package/dist/cjs/src/account/funding/wormhole.js +166 -0
- package/dist/cjs/src/account/index.d.ts +29 -0
- package/dist/cjs/src/account/index.js +45 -0
- package/dist/cjs/src/account/referral.d.ts +21 -0
- package/dist/cjs/src/account/referral.js +78 -0
- package/dist/cjs/src/account/waterx-account.d.ts +31 -0
- package/dist/cjs/src/account/waterx-account.js +29 -0
- package/dist/cjs/src/base-client.d.ts +74 -0
- package/dist/cjs/src/base-client.js +101 -0
- package/dist/cjs/src/constants.d.ts +32 -0
- package/dist/cjs/src/constants.js +41 -0
- package/dist/cjs/src/generated/bucket_v2_framework/account.d.ts +107 -0
- package/dist/cjs/src/generated/bucket_v2_framework/account.js +141 -0
- package/dist/cjs/src/generated/bucket_v2_framework/deps/std/type_name.d.ts +17 -0
- package/dist/cjs/src/generated/bucket_v2_framework/deps/std/type_name.js +22 -0
- package/dist/cjs/src/generated/bucket_v2_framework/deps/sui/balance.d.ts +12 -0
- package/dist/cjs/src/generated/bucket_v2_framework/deps/sui/balance.js +17 -0
- package/dist/cjs/src/generated/bucket_v2_framework/deps/sui/vec_map.d.ts +36 -0
- package/dist/cjs/src/generated/bucket_v2_framework/deps/sui/vec_map.js +31 -0
- package/dist/cjs/src/generated/bucket_v2_framework/deps/sui/vec_set.d.ts +16 -0
- package/dist/cjs/src/generated/bucket_v2_framework/deps/sui/vec_set.js +22 -0
- package/dist/cjs/src/generated/bucket_v2_framework/double.d.ts +384 -0
- package/dist/cjs/src/generated/bucket_v2_framework/double.js +504 -0
- package/dist/cjs/src/generated/bucket_v2_framework/float.d.ts +364 -0
- package/dist/cjs/src/generated/bucket_v2_framework/float.js +476 -0
- package/dist/cjs/src/generated/bucket_v2_framework/liability.d.ts +171 -0
- package/dist/cjs/src/generated/bucket_v2_framework/liability.js +192 -0
- package/dist/cjs/src/generated/bucket_v2_framework/linked_table.d.ts +384 -0
- package/dist/cjs/src/generated/bucket_v2_framework/linked_table.js +405 -0
- package/dist/cjs/src/generated/bucket_v2_framework/sheet.d.ts +424 -0
- package/dist/cjs/src/generated/bucket_v2_framework/sheet.js +395 -0
- package/dist/cjs/src/generated/native_custody/custody_vault.d.ts +586 -0
- package/dist/cjs/src/generated/native_custody/custody_vault.js +555 -0
- package/dist/cjs/src/generated/native_custody/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/cjs/src/generated/native_custody/deps/bucket_v2_framework/float.js +13 -0
- package/dist/cjs/src/generated/native_custody/deps/bucket_v2_framework/liability.d.ts +11 -0
- package/dist/cjs/src/generated/native_custody/deps/bucket_v2_framework/liability.js +16 -0
- package/dist/cjs/src/generated/native_custody/deps/bucket_v2_framework/sheet.d.ts +49 -0
- package/dist/cjs/src/generated/native_custody/deps/bucket_v2_framework/sheet.js +52 -0
- package/dist/cjs/src/generated/native_custody/deps/std/type_name.d.ts +17 -0
- package/dist/cjs/src/generated/native_custody/deps/std/type_name.js +22 -0
- package/dist/cjs/src/generated/native_custody/deps/sui/balance.d.ts +12 -0
- package/dist/cjs/src/generated/native_custody/deps/sui/balance.js +17 -0
- package/dist/cjs/src/generated/native_custody/deps/sui/vec_map.d.ts +36 -0
- package/dist/cjs/src/generated/native_custody/deps/sui/vec_map.js +31 -0
- package/dist/cjs/src/generated/native_custody/deps/sui/vec_set.d.ts +16 -0
- package/dist/cjs/src/generated/native_custody/deps/sui/vec_set.js +22 -0
- package/dist/cjs/src/generated/native_custody/events.d.ts +36 -0
- package/dist/cjs/src/generated/native_custody/events.js +71 -0
- package/dist/cjs/src/generated/pyth_sponsor_rule/deps/sui/balance.d.ts +12 -0
- package/dist/cjs/src/generated/pyth_sponsor_rule/deps/sui/balance.js +17 -0
- package/dist/cjs/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.d.ts +68 -0
- package/dist/cjs/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.js +113 -0
- package/dist/cjs/src/generated/utils/index.d.ts +30 -0
- package/dist/cjs/src/generated/utils/index.js +168 -0
- package/dist/cjs/src/generated/waterx_account/account.d.ts +1906 -0
- package/dist/cjs/src/generated/waterx_account/account.js +1929 -0
- package/dist/cjs/src/generated/waterx_account/deps/bucket_v2_framework/liability.d.ts +11 -0
- package/dist/cjs/src/generated/waterx_account/deps/bucket_v2_framework/liability.js +16 -0
- package/dist/cjs/src/generated/waterx_account/deps/bucket_v2_framework/sheet.d.ts +49 -0
- package/dist/cjs/src/generated/waterx_account/deps/bucket_v2_framework/sheet.js +52 -0
- package/dist/cjs/src/generated/waterx_account/deps/std/type_name.d.ts +17 -0
- package/dist/cjs/src/generated/waterx_account/deps/std/type_name.js +22 -0
- package/dist/cjs/src/generated/waterx_account/deps/sui/balance.d.ts +12 -0
- package/dist/cjs/src/generated/waterx_account/deps/sui/balance.js +17 -0
- package/dist/cjs/src/generated/waterx_account/deps/sui/object_table.d.ts +17 -0
- package/dist/cjs/src/generated/waterx_account/deps/sui/object_table.js +22 -0
- package/dist/cjs/src/generated/waterx_account/deps/sui/table.d.ts +29 -0
- package/dist/cjs/src/generated/waterx_account/deps/sui/table.js +34 -0
- package/dist/cjs/src/generated/waterx_account/deps/sui/vec_map.d.ts +36 -0
- package/dist/cjs/src/generated/waterx_account/deps/sui/vec_map.js +31 -0
- package/dist/cjs/src/generated/waterx_account/deps/sui/vec_set.d.ts +16 -0
- package/dist/cjs/src/generated/waterx_account/deps/sui/vec_set.js +22 -0
- package/dist/cjs/src/generated/waterx_account/direct_rule.d.ts +77 -0
- package/dist/cjs/src/generated/waterx_account/direct_rule.js +83 -0
- package/dist/cjs/src/generated/waterx_account/events.d.ts +190 -0
- package/dist/cjs/src/generated/waterx_account/events.js +173 -0
- package/dist/cjs/src/generated/waterx_account/version.d.ts +10 -0
- package/dist/cjs/src/generated/waterx_account/version.js +11 -0
- package/dist/cjs/src/generated/waterx_constant_rule/constant_rule.d.ts +68 -0
- package/dist/cjs/src/generated/waterx_constant_rule/constant_rule.js +97 -0
- package/dist/cjs/src/generated/waterx_constant_rule/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/cjs/src/generated/waterx_constant_rule/deps/bucket_v2_framework/float.js +13 -0
- package/dist/cjs/src/generated/waterx_constant_rule/deps/sui/vec_map.d.ts +36 -0
- package/dist/cjs/src/generated/waterx_constant_rule/deps/sui/vec_map.js +31 -0
- package/dist/cjs/src/generated/waterx_credit/credit_registry.d.ts +708 -0
- package/dist/cjs/src/generated/waterx_credit/credit_registry.js +728 -0
- package/dist/cjs/src/generated/waterx_credit/deps/std/type_name.d.ts +17 -0
- package/dist/cjs/src/generated/waterx_credit/deps/std/type_name.js +22 -0
- package/dist/cjs/src/generated/waterx_credit/deps/sui/table.d.ts +29 -0
- package/dist/cjs/src/generated/waterx_credit/deps/sui/table.js +34 -0
- package/dist/cjs/src/generated/waterx_credit/deps/sui/vec_map.d.ts +36 -0
- package/dist/cjs/src/generated/waterx_credit/deps/sui/vec_map.js +31 -0
- package/dist/cjs/src/generated/waterx_credit/deps/sui/vec_set.d.ts +16 -0
- package/dist/cjs/src/generated/waterx_credit/deps/sui/vec_set.js +22 -0
- package/dist/cjs/src/generated/waterx_credit/limited_supply.d.ts +107 -0
- package/dist/cjs/src/generated/waterx_credit/limited_supply.js +143 -0
- package/dist/cjs/src/generated/waterx_oracle/aggregator.d.ts +211 -0
- package/dist/cjs/src/generated/waterx_oracle/aggregator.js +258 -0
- package/dist/cjs/src/generated/waterx_oracle/collector.d.ts +119 -0
- package/dist/cjs/src/generated/waterx_oracle/collector.js +147 -0
- package/dist/cjs/src/generated/waterx_oracle/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/cjs/src/generated/waterx_oracle/deps/bucket_v2_framework/float.js +13 -0
- package/dist/cjs/src/generated/waterx_oracle/deps/std/type_name.d.ts +17 -0
- package/dist/cjs/src/generated/waterx_oracle/deps/std/type_name.js +22 -0
- package/dist/cjs/src/generated/waterx_oracle/deps/sui/vec_map.d.ts +36 -0
- package/dist/cjs/src/generated/waterx_oracle/deps/sui/vec_map.js +31 -0
- package/dist/cjs/src/generated/waterx_oracle/deps/sui/vec_set.d.ts +16 -0
- package/dist/cjs/src/generated/waterx_oracle/deps/sui/vec_set.js +22 -0
- package/dist/cjs/src/generated/waterx_oracle/oracle.d.ts +304 -0
- package/dist/cjs/src/generated/waterx_oracle/oracle.js +381 -0
- package/dist/cjs/src/generated/waterx_oracle/version.d.ts +10 -0
- package/dist/cjs/src/generated/waterx_oracle/version.js +11 -0
- package/dist/cjs/src/generated/waterx_perp/account_data.d.ts +269 -0
- package/dist/cjs/src/generated/waterx_perp/account_data.js +340 -0
- package/dist/cjs/src/generated/waterx_perp/admin.d.ts +19 -0
- package/dist/cjs/src/generated/waterx_perp/admin.js +26 -0
- package/dist/cjs/src/generated/waterx_perp/deps/bucket_v2_framework/double.d.ts +8 -0
- package/dist/cjs/src/generated/waterx_perp/deps/bucket_v2_framework/double.js +13 -0
- package/dist/cjs/src/generated/waterx_perp/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/cjs/src/generated/waterx_perp/deps/bucket_v2_framework/float.js +13 -0
- package/dist/cjs/src/generated/waterx_perp/deps/bucket_v2_framework/liability.d.ts +11 -0
- package/dist/cjs/src/generated/waterx_perp/deps/bucket_v2_framework/liability.js +16 -0
- package/dist/cjs/src/generated/waterx_perp/deps/bucket_v2_framework/linked_table.d.ts +8 -0
- package/dist/cjs/src/generated/waterx_perp/deps/bucket_v2_framework/linked_table.js +21 -0
- package/dist/cjs/src/generated/waterx_perp/deps/bucket_v2_framework/sheet.d.ts +49 -0
- package/dist/cjs/src/generated/waterx_perp/deps/bucket_v2_framework/sheet.js +52 -0
- package/dist/cjs/src/generated/waterx_perp/deps/std/type_name.d.ts +17 -0
- package/dist/cjs/src/generated/waterx_perp/deps/std/type_name.js +22 -0
- package/dist/cjs/src/generated/waterx_perp/deps/sui/balance.d.ts +15 -0
- package/dist/cjs/src/generated/waterx_perp/deps/sui/balance.js +20 -0
- package/dist/cjs/src/generated/waterx_perp/deps/sui/coin.d.ts +14 -0
- package/dist/cjs/src/generated/waterx_perp/deps/sui/coin.js +51 -0
- package/dist/cjs/src/generated/waterx_perp/deps/sui/vec_map.d.ts +36 -0
- package/dist/cjs/src/generated/waterx_perp/deps/sui/vec_map.js +31 -0
- package/dist/cjs/src/generated/waterx_perp/deps/sui/vec_set.d.ts +16 -0
- package/dist/cjs/src/generated/waterx_perp/deps/sui/vec_set.js +22 -0
- package/dist/cjs/src/generated/waterx_perp/events.d.ts +1283 -0
- package/dist/cjs/src/generated/waterx_perp/events.js +990 -0
- package/dist/cjs/src/generated/waterx_perp/global_config.d.ts +775 -0
- package/dist/cjs/src/generated/waterx_perp/global_config.js +918 -0
- package/dist/cjs/src/generated/waterx_perp/keyed_big_vector.d.ts +553 -0
- package/dist/cjs/src/generated/waterx_perp/keyed_big_vector.js +626 -0
- package/dist/cjs/src/generated/waterx_perp/lp_pool.d.ts +1648 -0
- package/dist/cjs/src/generated/waterx_perp/lp_pool.js +1630 -0
- package/dist/cjs/src/generated/waterx_perp/market_config.d.ts +733 -0
- package/dist/cjs/src/generated/waterx_perp/market_config.js +871 -0
- package/dist/cjs/src/generated/waterx_perp/math.d.ts +63 -0
- package/dist/cjs/src/generated/waterx_perp/math.js +70 -0
- package/dist/cjs/src/generated/waterx_perp/memo.d.ts +251 -0
- package/dist/cjs/src/generated/waterx_perp/memo.js +360 -0
- package/dist/cjs/src/generated/waterx_perp/order_book.d.ts +290 -0
- package/dist/cjs/src/generated/waterx_perp/order_book.js +388 -0
- package/dist/cjs/src/generated/waterx_perp/position.d.ts +1005 -0
- package/dist/cjs/src/generated/waterx_perp/position.js +1200 -0
- package/dist/cjs/src/generated/waterx_perp/request.d.ts +544 -0
- package/dist/cjs/src/generated/waterx_perp/request.js +609 -0
- package/dist/cjs/src/generated/waterx_perp/response.d.ts +247 -0
- package/dist/cjs/src/generated/waterx_perp/response.js +331 -0
- package/dist/cjs/src/generated/waterx_perp/trading.d.ts +2945 -0
- package/dist/cjs/src/generated/waterx_perp/trading.js +2616 -0
- package/dist/cjs/src/generated/waterx_perp/version.d.ts +10 -0
- package/dist/cjs/src/generated/waterx_perp/version.js +11 -0
- package/dist/cjs/src/generated/waterx_perp/witness.d.ts +18 -0
- package/dist/cjs/src/generated/waterx_perp/witness.js +25 -0
- package/dist/cjs/src/generated/waterx_perp_view/deps/std/type_name.d.ts +17 -0
- package/dist/cjs/src/generated/waterx_perp_view/deps/std/type_name.js +22 -0
- package/dist/cjs/src/generated/waterx_perp_view/view.d.ts +447 -0
- package/dist/cjs/src/generated/waterx_perp_view/view.js +459 -0
- package/dist/cjs/src/generated/waterx_prediction/account_data.d.ts +344 -0
- package/dist/cjs/src/generated/waterx_prediction/account_data.js +470 -0
- package/dist/cjs/src/generated/waterx_prediction/admin.d.ts +7 -0
- package/dist/cjs/src/generated/waterx_prediction/admin.js +12 -0
- package/dist/cjs/src/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.d.ts +8 -0
- package/dist/cjs/src/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.js +21 -0
- package/dist/cjs/src/generated/waterx_prediction/deps/sui/balance.d.ts +12 -0
- package/dist/cjs/src/generated/waterx_prediction/deps/sui/balance.js +17 -0
- package/dist/cjs/src/generated/waterx_prediction/deps/sui/table.d.ts +29 -0
- package/dist/cjs/src/generated/waterx_prediction/deps/sui/table.js +34 -0
- package/dist/cjs/src/generated/waterx_prediction/deps/sui/vec_set.d.ts +16 -0
- package/dist/cjs/src/generated/waterx_prediction/deps/sui/vec_set.js +22 -0
- package/dist/cjs/src/generated/waterx_prediction/events.d.ts +288 -0
- package/dist/cjs/src/generated/waterx_prediction/events.js +254 -0
- package/dist/cjs/src/generated/waterx_prediction/global_config.d.ts +121 -0
- package/dist/cjs/src/generated/waterx_prediction/global_config.js +186 -0
- package/dist/cjs/src/generated/waterx_prediction/order.d.ts +233 -0
- package/dist/cjs/src/generated/waterx_prediction/order.js +339 -0
- package/dist/cjs/src/generated/waterx_prediction/outcome.d.ts +58 -0
- package/dist/cjs/src/generated/waterx_prediction/outcome.js +82 -0
- package/dist/cjs/src/generated/waterx_prediction/position.d.ts +175 -0
- package/dist/cjs/src/generated/waterx_prediction/position.js +232 -0
- package/dist/cjs/src/generated/waterx_prediction/version.d.ts +10 -0
- package/dist/cjs/src/generated/waterx_prediction/version.js +11 -0
- package/dist/cjs/src/generated/waterx_prediction/view.d.ts +418 -0
- package/dist/cjs/src/generated/waterx_prediction/view.js +492 -0
- package/dist/cjs/src/generated/waterx_prediction/waterx_prediction.d.ts +1858 -0
- package/dist/cjs/src/generated/waterx_prediction/waterx_prediction.js +1972 -0
- package/dist/cjs/src/generated/waterx_pyth_rule/deps/sui/vec_map.d.ts +36 -0
- package/dist/cjs/src/generated/waterx_pyth_rule/deps/sui/vec_map.js +31 -0
- package/dist/cjs/src/generated/waterx_pyth_rule/pyth_rule.d.ts +192 -0
- package/dist/cjs/src/generated/waterx_pyth_rule/pyth_rule.js +214 -0
- package/dist/cjs/src/generated/waterx_referral/deps/sui/table.d.ts +29 -0
- package/dist/cjs/src/generated/waterx_referral/deps/sui/table.js +34 -0
- package/dist/cjs/src/generated/waterx_referral/deps/sui/vec_set.d.ts +16 -0
- package/dist/cjs/src/generated/waterx_referral/deps/sui/vec_set.js +22 -0
- package/dist/cjs/src/generated/waterx_referral/referral_table.d.ts +171 -0
- package/dist/cjs/src/generated/waterx_referral/referral_table.js +239 -0
- package/dist/cjs/src/generated/waterx_staking/deps/bucket_v2_framework/double.d.ts +8 -0
- package/dist/cjs/src/generated/waterx_staking/deps/bucket_v2_framework/double.js +13 -0
- package/dist/cjs/src/generated/waterx_staking/deps/sui/balance.d.ts +12 -0
- package/dist/cjs/src/generated/waterx_staking/deps/sui/balance.js +17 -0
- package/dist/cjs/src/generated/waterx_staking/deps/sui/table.d.ts +29 -0
- package/dist/cjs/src/generated/waterx_staking/deps/sui/table.js +34 -0
- package/dist/cjs/src/generated/waterx_staking/deps/sui/vec_set.d.ts +16 -0
- package/dist/cjs/src/generated/waterx_staking/deps/sui/vec_set.js +22 -0
- package/dist/cjs/src/generated/waterx_staking/waterx_staking.d.ts +746 -0
- package/dist/cjs/src/generated/waterx_staking/waterx_staking.js +797 -0
- package/dist/cjs/src/generated/waterx_staking/witness.d.ts +16 -0
- package/dist/cjs/src/generated/waterx_staking/witness.js +21 -0
- package/dist/cjs/src/generated/waterx_supra_rule/deps/sui/vec_map.d.ts +36 -0
- package/dist/cjs/src/generated/waterx_supra_rule/deps/sui/vec_map.js +31 -0
- package/dist/cjs/src/generated/waterx_supra_rule/supra_rule.d.ts +158 -0
- package/dist/cjs/src/generated/waterx_supra_rule/supra_rule.js +189 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/bucket_v2_framework/float.js +13 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/bucket_v2_framework/linked_table.d.ts +8 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/bucket_v2_framework/linked_table.js +21 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/std/type_name.d.ts +17 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/std/type_name.js +22 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/sui/balance.d.ts +12 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/sui/balance.js +17 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/sui/vec_map.d.ts +36 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/sui/vec_map.js +31 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/sui/vec_set.d.ts +16 -0
- package/dist/cjs/src/generated/withdrawal_queue/deps/sui/vec_set.js +22 -0
- package/dist/cjs/src/generated/withdrawal_queue/withdrawal_queue.d.ts +923 -0
- package/dist/cjs/src/generated/withdrawal_queue/withdrawal_queue.js +965 -0
- package/dist/cjs/src/generated/wlp/wlp.d.ts +28 -0
- package/dist/cjs/src/generated/wlp/wlp.js +37 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/sui/table.d.ts +29 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/sui/table.js +34 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/sui/vec_map.d.ts +36 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/sui/vec_map.js +31 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/sui/vec_set.d.ts +16 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/sui/vec_set.js +22 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/wormhole_sdk/consumed_vaas.d.ts +12 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/wormhole_sdk/consumed_vaas.js +45 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/wormhole_sdk/emitter.d.ts +14 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/wormhole_sdk/emitter.js +19 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/wormhole_sdk/set.d.ts +16 -0
- package/dist/cjs/src/generated/wormhole_bridge/deps/wormhole_sdk/set.js +51 -0
- package/dist/cjs/src/generated/wormhole_bridge/events.d.ts +32 -0
- package/dist/cjs/src/generated/wormhole_bridge/events.js +31 -0
- package/dist/cjs/src/generated/wormhole_bridge/wormhole_bridge.d.ts +638 -0
- package/dist/cjs/src/generated/wormhole_bridge/wormhole_bridge.js +692 -0
- package/dist/cjs/src/oracle/aggregate.d.ts +74 -0
- package/dist/cjs/src/oracle/aggregate.js +118 -0
- package/dist/cjs/src/oracle/config.d.ts +99 -0
- package/dist/cjs/src/oracle/config.js +26 -0
- package/dist/cjs/src/oracle/host.d.ts +32 -0
- package/dist/cjs/src/oracle/host.js +11 -0
- package/dist/cjs/src/oracle/index.d.ts +16 -0
- package/dist/cjs/src/oracle/index.js +31 -0
- package/dist/cjs/src/oracle/pyth.d.ts +52 -0
- package/dist/cjs/src/oracle/pyth.js +227 -0
- package/dist/cjs/src/oracle/rules/constant-rule.d.ts +9 -0
- package/dist/cjs/src/oracle/rules/constant-rule.js +17 -0
- package/dist/cjs/src/oracle/rules/pyth-rule.d.ts +11 -0
- package/dist/cjs/src/oracle/rules/pyth-rule.js +23 -0
- package/dist/cjs/src/oracle/rules/sponsor.d.ts +28 -0
- package/dist/cjs/src/oracle/rules/sponsor.js +52 -0
- package/dist/cjs/src/oracle/rules/supra-rule.d.ts +11 -0
- package/dist/cjs/src/oracle/rules/supra-rule.js +25 -0
- package/dist/cjs/src/perp/client.d.ts +78 -0
- package/dist/cjs/src/perp/client.js +112 -0
- package/dist/cjs/src/perp/config-view.d.ts +102 -0
- package/dist/cjs/src/perp/config-view.js +178 -0
- package/dist/cjs/src/perp/config.d.ts +126 -0
- package/dist/cjs/src/perp/config.js +119 -0
- package/dist/cjs/src/perp/constants.d.ts +49 -0
- package/dist/cjs/src/perp/constants.js +79 -0
- package/dist/cjs/src/perp/fetch/account.d.ts +43 -0
- package/dist/cjs/src/perp/fetch/account.js +69 -0
- package/dist/cjs/src/perp/fetch/bridge.d.ts +90 -0
- package/dist/cjs/src/perp/fetch/bridge.js +131 -0
- package/dist/cjs/src/perp/fetch/custody.d.ts +32 -0
- package/dist/cjs/src/perp/fetch/custody.js +66 -0
- package/dist/cjs/src/perp/fetch/market.d.ts +30 -0
- package/dist/cjs/src/perp/fetch/market.js +75 -0
- package/dist/cjs/src/perp/fetch/positions.d.ts +70 -0
- package/dist/cjs/src/perp/fetch/positions.js +195 -0
- package/dist/cjs/src/perp/fetch/simulate.d.ts +12 -0
- package/dist/cjs/src/perp/fetch/simulate.js +21 -0
- package/dist/cjs/src/perp/fetch.d.ts +23 -0
- package/dist/cjs/src/perp/fetch.js +39 -0
- package/dist/cjs/src/perp/index.d.ts +29 -0
- package/dist/cjs/src/perp/index.js +183 -0
- package/dist/cjs/src/perp/tx-builders/common.d.ts +83 -0
- package/dist/cjs/src/perp/tx-builders/common.js +76 -0
- package/dist/cjs/src/perp/tx-builders/credit.d.ts +65 -0
- package/dist/cjs/src/perp/tx-builders/credit.js +67 -0
- package/dist/cjs/src/perp/tx-builders/rewards.d.ts +30 -0
- package/dist/cjs/src/perp/tx-builders/rewards.js +37 -0
- package/dist/cjs/src/perp/tx-builders/trading.d.ts +51 -0
- package/dist/cjs/src/perp/tx-builders/trading.js +71 -0
- package/dist/cjs/src/perp/tx-builders/wlp.d.ts +90 -0
- package/dist/cjs/src/perp/tx-builders/wlp.js +126 -0
- package/dist/cjs/src/perp/tx-builders.d.ts +23 -0
- package/dist/cjs/src/perp/tx-builders.js +45 -0
- package/dist/cjs/src/perp/user/index.d.ts +8 -0
- package/dist/cjs/src/perp/user/index.js +24 -0
- package/dist/cjs/src/perp/user/order.d.ts +89 -0
- package/dist/cjs/src/perp/user/order.js +175 -0
- package/dist/cjs/src/perp/user/staking.d.ts +54 -0
- package/dist/cjs/src/perp/user/staking.js +147 -0
- package/dist/cjs/src/perp/user/trading.d.ts +119 -0
- package/dist/cjs/src/perp/user/trading.js +310 -0
- package/dist/cjs/src/perp/user/wlp.d.ts +58 -0
- package/dist/cjs/src/perp/user/wlp.js +139 -0
- package/dist/cjs/src/prediction/account.d.ts +96 -0
- package/dist/cjs/src/prediction/account.js +212 -0
- package/dist/cjs/src/prediction/admin.d.ts +47 -0
- package/dist/cjs/src/prediction/admin.js +116 -0
- package/dist/cjs/src/prediction/bcs.d.ts +28 -0
- package/dist/cjs/src/prediction/bcs.js +189 -0
- package/dist/cjs/src/prediction/client.d.ts +45 -0
- package/dist/cjs/src/prediction/client.js +112 -0
- package/dist/cjs/src/prediction/config.d.ts +74 -0
- package/dist/cjs/src/prediction/config.js +86 -0
- package/dist/cjs/src/prediction/constants.d.ts +44 -0
- package/dist/cjs/src/prediction/constants.js +49 -0
- package/dist/cjs/src/prediction/fetch.d.ts +82 -0
- package/dist/cjs/src/prediction/fetch.js +294 -0
- package/dist/cjs/src/prediction/gift-link.d.ts +6 -0
- package/dist/cjs/src/prediction/gift-link.js +16 -0
- package/dist/cjs/src/prediction/gift.d.ts +223 -0
- package/dist/cjs/src/prediction/gift.js +465 -0
- package/dist/cjs/src/prediction/index.d.ts +29 -0
- package/dist/cjs/src/prediction/index.js +154 -0
- package/dist/cjs/src/prediction/prediction.d.ts +149 -0
- package/dist/cjs/src/prediction/prediction.js +410 -0
- package/dist/cjs/src/prediction/tx-builders.d.ts +44 -0
- package/dist/cjs/src/prediction/tx-builders.js +56 -0
- package/dist/cjs/src/prediction/types.d.ts +95 -0
- package/dist/cjs/src/prediction/types.js +2 -0
- package/dist/cjs/src/prediction/user/account.d.ts +2 -0
- package/dist/cjs/src/prediction/user/account.js +17 -0
- package/dist/cjs/src/prediction/user/admin.d.ts +6 -0
- package/dist/cjs/src/prediction/user/admin.js +19 -0
- package/dist/cjs/src/prediction/user/gift.d.ts +2 -0
- package/dist/cjs/src/prediction/user/gift.js +24 -0
- package/dist/cjs/src/prediction/user/index.d.ts +5 -0
- package/dist/cjs/src/prediction/user/index.js +60 -0
- package/dist/cjs/src/prediction/user/keeper.d.ts +2 -0
- package/dist/cjs/src/prediction/user/keeper.js +13 -0
- package/dist/cjs/src/prediction/user/order.d.ts +2 -0
- package/dist/cjs/src/prediction/user/order.js +6 -0
- package/dist/cjs/src/prediction/user/position.d.ts +2 -0
- package/dist/cjs/src/prediction/user/position.js +11 -0
- package/dist/cjs/src/prediction/utils/bcs.d.ts +6 -0
- package/dist/cjs/src/prediction/utils/bcs.js +29 -0
- package/dist/cjs/src/prediction/utils/index.d.ts +8 -0
- package/dist/cjs/src/prediction/utils/index.js +31 -0
- package/dist/cjs/src/prediction/utils.d.ts +30 -0
- package/dist/cjs/src/prediction/utils.js +200 -0
- package/dist/cjs/src/sdk.d.ts +22 -0
- package/dist/cjs/src/sdk.js +62 -0
- package/dist/cjs/src/unified-client.d.ts +402 -0
- package/dist/cjs/src/unified-client.js +218 -0
- package/dist/cjs/src/utils/config.d.ts +11 -0
- package/dist/cjs/src/utils/config.js +19 -0
- package/dist/cjs/src/utils/math.d.ts +287 -0
- package/dist/cjs/src/utils/math.js +469 -0
- package/package.json +119 -31
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper for building `bucket_v2_framework::account::AccountRequest` (or
|
|
3
|
+
* `request_with_account`) with the configured `bucket_framework` package id
|
|
4
|
+
* injected. Used by every user/* builder to authenticate the caller.
|
|
5
|
+
*/
|
|
6
|
+
import type { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
7
|
+
import type { WxaClientLike } from "./client.ts";
|
|
8
|
+
export type BucketAccount = string | TransactionArgument | undefined;
|
|
9
|
+
export declare function makeSenderRequest(client: WxaClientLike, tx: Transaction, bucketAccount: BucketAccount): TransactionArgument;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Helper for building `bucket_v2_framework::account::AccountRequest` (or
|
|
4
|
+
* `request_with_account`) with the configured `bucket_framework` package id
|
|
5
|
+
* injected. Used by every user/* builder to authenticate the caller.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.makeSenderRequest = makeSenderRequest;
|
|
9
|
+
const account_ts_1 = require("../generated/bucket_v2_framework/account.js");
|
|
10
|
+
function makeSenderRequest(client, tx, bucketAccount) {
|
|
11
|
+
const pkg = client.config.packages.bucket_framework.published_at;
|
|
12
|
+
if (bucketAccount === undefined) {
|
|
13
|
+
return (0, account_ts_1.request)({ package: pkg })(tx);
|
|
14
|
+
}
|
|
15
|
+
const accArg = typeof bucketAccount === "string" ? tx.object(bucketAccount) : bucketAccount;
|
|
16
|
+
return (0, account_ts_1.requestWithAccount)({
|
|
17
|
+
package: pkg,
|
|
18
|
+
arguments: { account: accArg },
|
|
19
|
+
})(tx);
|
|
20
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account-side builders for the `waterx_account` framework.
|
|
3
|
+
*
|
|
4
|
+
* In v3, `waterx_account` is the only account abstraction — `waterx_perp`
|
|
5
|
+
* stores per-account state under `ProtocolDataKey<WaterXPerp>()` on a wxa
|
|
6
|
+
* `Account` and uses witness-gated `take` / `put` for collateral.
|
|
7
|
+
*
|
|
8
|
+
* All builders that mutate the account pass `account::request()` or
|
|
9
|
+
* `account::request_with_account(&Account)` internally. To act through
|
|
10
|
+
* a Bucket `Account` object, pass `bucketAccount` (an object ID string
|
|
11
|
+
* or a `TransactionArgument`).
|
|
12
|
+
*/
|
|
13
|
+
import type { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
14
|
+
import type { WxaClientLike } from "./client.ts";
|
|
15
|
+
export interface CreateAccountParams {
|
|
16
|
+
/** Alias / display name for the new account (max length checked on-chain). */
|
|
17
|
+
alias: string;
|
|
18
|
+
/** Optional Bucket Account to act through (otherwise tx.sender). */
|
|
19
|
+
bucketAccount?: string | TransactionArgument;
|
|
20
|
+
}
|
|
21
|
+
/** Build `waterx_account::create_account`. Returns the new account ID (Move return value). */
|
|
22
|
+
export declare function createAccount(client: WxaClientLike, tx: Transaction, params: CreateAccountParams): TransactionArgument;
|
|
23
|
+
export interface SetAliasParams {
|
|
24
|
+
accountId: string;
|
|
25
|
+
alias: string;
|
|
26
|
+
bucketAccount?: string | TransactionArgument;
|
|
27
|
+
}
|
|
28
|
+
export declare function setAlias(client: WxaClientLike, tx: Transaction, params: SetAliasParams): void;
|
|
29
|
+
export interface AddDelegateParams {
|
|
30
|
+
/** Account ID — an `0x2::object::ID` string or a PTB argument. */
|
|
31
|
+
accountId: string | TransactionArgument;
|
|
32
|
+
delegateAddress: string;
|
|
33
|
+
alias: string;
|
|
34
|
+
/** Bitmask matching `waterx_account` permission constants. */
|
|
35
|
+
permissions: number;
|
|
36
|
+
/** Optional millisecond timestamp at which the delegate expires. */
|
|
37
|
+
expiresAtMs?: bigint | number;
|
|
38
|
+
bucketAccount?: string | TransactionArgument;
|
|
39
|
+
}
|
|
40
|
+
export declare function addDelegate(client: WxaClientLike, tx: Transaction, params: AddDelegateParams): void;
|
|
41
|
+
export interface RemoveDelegateParams {
|
|
42
|
+
/** Account ID — an `0x2::object::ID` string or a PTB argument. */
|
|
43
|
+
accountId: string | TransactionArgument;
|
|
44
|
+
delegateAddress: string;
|
|
45
|
+
bucketAccount?: string | TransactionArgument;
|
|
46
|
+
}
|
|
47
|
+
export declare function removeDelegate(client: WxaClientLike, tx: Transaction, params: RemoveDelegateParams): void;
|
|
48
|
+
export interface SetDelegateProtocolPermissionParams {
|
|
49
|
+
accountId: string;
|
|
50
|
+
delegateAddress: string;
|
|
51
|
+
/** Bitmask of per-protocol permissions (e.g. perm_open_position | perm_close_position). */
|
|
52
|
+
permissions: number;
|
|
53
|
+
/** Fully-qualified Move type of the protocol witness (e.g. `0x…::account_data::WaterXPerp`). */
|
|
54
|
+
protocolType: string;
|
|
55
|
+
bucketAccount?: string | TransactionArgument;
|
|
56
|
+
}
|
|
57
|
+
export declare function setDelegateProtocolPermission(client: WxaClientLike, tx: Transaction, params: SetDelegateProtocolPermissionParams): void;
|
|
58
|
+
export interface RequestDepositParams {
|
|
59
|
+
/** wxa account ID receiving the deposit (ID string or PTB argument). */
|
|
60
|
+
accountId: string | TransactionArgument;
|
|
61
|
+
/** Coin or coin transaction argument to deposit. */
|
|
62
|
+
coin: TransactionArgument;
|
|
63
|
+
/** Fully-qualified coin type. */
|
|
64
|
+
coinType: string;
|
|
65
|
+
/** Optional opaque extra data forwarded to the policy. */
|
|
66
|
+
extraData?: Uint8Array;
|
|
67
|
+
}
|
|
68
|
+
/** Build `account::request_deposit<T>`. Returns the `DepositRequest<T>` argument. */
|
|
69
|
+
export declare function requestDeposit(client: WxaClientLike, tx: Transaction, params: RequestDepositParams): TransactionArgument;
|
|
70
|
+
export interface RequestDepositFromReceivingsParams {
|
|
71
|
+
/** wxa account ID receiving the deposit (ID string or PTB argument). */
|
|
72
|
+
accountId: string | TransactionArgument;
|
|
73
|
+
/**
|
|
74
|
+
* `Receiving<Coin<T>>` arguments — one per `Coin<T>` previously transferred
|
|
75
|
+
* onto the account's address. Build each with
|
|
76
|
+
* `tx.receivingRef({ objectId, version, digest })`.
|
|
77
|
+
*/
|
|
78
|
+
receivings: TransactionArgument[];
|
|
79
|
+
/** Fully-qualified coin type `T`. */
|
|
80
|
+
coinType: string;
|
|
81
|
+
/** Optional opaque extra data forwarded to the policy. */
|
|
82
|
+
extraData?: Uint8Array;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Build `account::request_deposit_from_receivings<T>` — drains `Coin<T>`
|
|
86
|
+
* objects previously transferred onto the account's address (the
|
|
87
|
+
* transfer-to-object path) into a single `DepositRequest<T>`. Returns the
|
|
88
|
+
* `DepositRequest<T>` argument.
|
|
89
|
+
*/
|
|
90
|
+
export declare function requestDepositFromReceivings(client: WxaClientLike, tx: Transaction, params: RequestDepositFromReceivingsParams): TransactionArgument;
|
|
91
|
+
export interface RequestDepositFromFundsParams {
|
|
92
|
+
/** wxa account ID receiving the deposit. */
|
|
93
|
+
accountId: string;
|
|
94
|
+
/** Fully-qualified coin type `T`. */
|
|
95
|
+
coinType: string;
|
|
96
|
+
/**
|
|
97
|
+
* Sui native funds-accumulator root shared object. Defaults to the
|
|
98
|
+
* well-known `ACCUMULATOR_ROOT` (`0xacc`); override only for a custom
|
|
99
|
+
* deployment.
|
|
100
|
+
*/
|
|
101
|
+
accumulatorRoot?: string | TransactionArgument;
|
|
102
|
+
/** Optional opaque extra data forwarded to the policy. */
|
|
103
|
+
extraData?: Uint8Array;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Build `account::request_deposit_from_funds<T>` — drains every `Balance<T>`
|
|
107
|
+
* parked at the account's address in Sui's native funds accumulator (the
|
|
108
|
+
* path taken by `transfer_coin` / `0x2::balance::send_funds<T>`) into a
|
|
109
|
+
* single `DepositRequest<T>`. Returns the `DepositRequest<T>` argument.
|
|
110
|
+
*
|
|
111
|
+
* The drained total reflects the balance as of the last consensus commit,
|
|
112
|
+
* so the value isn't readable within the same PTB — treat it as a
|
|
113
|
+
* between-tx drain. Returns a zero-balance request when the address holds
|
|
114
|
+
* no `T`, so check `settled_funds_value<T>` off-chain first if you want to
|
|
115
|
+
* skip empty drains.
|
|
116
|
+
*/
|
|
117
|
+
export declare function requestDepositFromFunds(client: WxaClientLike, tx: Transaction, params: RequestDepositFromFundsParams): TransactionArgument;
|
|
118
|
+
export interface RequestWithdrawParams {
|
|
119
|
+
accountId: string | TransactionArgument;
|
|
120
|
+
amount: bigint | number;
|
|
121
|
+
/** Recipient for the eventual coin payout (policy decides exact mechanics). */
|
|
122
|
+
recipient: string;
|
|
123
|
+
/** Fully-qualified coin type. */
|
|
124
|
+
coinType: string;
|
|
125
|
+
/** Optional opaque extra data forwarded to the policy. */
|
|
126
|
+
extraData?: Uint8Array;
|
|
127
|
+
bucketAccount?: string | TransactionArgument;
|
|
128
|
+
}
|
|
129
|
+
/** Build `account::request_withdraw<T>`. Returns the `WithdrawRequest<T>` argument. */
|
|
130
|
+
export declare function requestWithdraw(client: WxaClientLike, tx: Transaction, params: RequestWithdrawParams): TransactionArgument;
|
|
131
|
+
export interface TransferToAccountParams {
|
|
132
|
+
accountId: string | TransactionArgument;
|
|
133
|
+
coin: TransactionArgument;
|
|
134
|
+
coinType: string;
|
|
135
|
+
}
|
|
136
|
+
export declare function transferToAccount(client: WxaClientLike, tx: Transaction, params: TransferToAccountParams): void;
|
|
137
|
+
export interface ReceiveParams {
|
|
138
|
+
accountId: string;
|
|
139
|
+
/**
|
|
140
|
+
* `Receiving<T>` argument for the TTO'd object. Construct via
|
|
141
|
+
* `tx.receivingRef({ objectId, version, digest })` from the on-chain
|
|
142
|
+
* object's ID/version/digest (e.g. from
|
|
143
|
+
* `FundsReaderService.listUnreceivedRewardCoins` on the BE).
|
|
144
|
+
*/
|
|
145
|
+
receiving: TransactionArgument;
|
|
146
|
+
/** Fully-qualified `T` Move type — typically `Coin<R>` for reward coins. */
|
|
147
|
+
receivingType: string;
|
|
148
|
+
bucketAccount?: string | TransactionArgument;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Calls `waterx_account::receive<T>` to drain a TTO'd object on the
|
|
152
|
+
* account's UID. Returns the received object to the caller's PTB so it
|
|
153
|
+
* can be merged / transferred / consumed downstream in the same tx.
|
|
154
|
+
*
|
|
155
|
+
* Bypasses the deposit-policy flow — use for reward coins (and other
|
|
156
|
+
* tokens / objects) that have no registered deposit policy.
|
|
157
|
+
*/
|
|
158
|
+
export declare function receive(client: WxaClientLike, tx: Transaction, params: ReceiveParams): TransactionArgument;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Account-side builders for the `waterx_account` framework.
|
|
4
|
+
*
|
|
5
|
+
* In v3, `waterx_account` is the only account abstraction — `waterx_perp`
|
|
6
|
+
* stores per-account state under `ProtocolDataKey<WaterXPerp>()` on a wxa
|
|
7
|
+
* `Account` and uses witness-gated `take` / `put` for collateral.
|
|
8
|
+
*
|
|
9
|
+
* All builders that mutate the account pass `account::request()` or
|
|
10
|
+
* `account::request_with_account(&Account)` internally. To act through
|
|
11
|
+
* a Bucket `Account` object, pass `bucketAccount` (an object ID string
|
|
12
|
+
* or a `TransactionArgument`).
|
|
13
|
+
*/
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.createAccount = createAccount;
|
|
49
|
+
exports.setAlias = setAlias;
|
|
50
|
+
exports.addDelegate = addDelegate;
|
|
51
|
+
exports.removeDelegate = removeDelegate;
|
|
52
|
+
exports.setDelegateProtocolPermission = setDelegateProtocolPermission;
|
|
53
|
+
exports.requestDeposit = requestDeposit;
|
|
54
|
+
exports.requestDepositFromReceivings = requestDepositFromReceivings;
|
|
55
|
+
exports.requestDepositFromFunds = requestDepositFromFunds;
|
|
56
|
+
exports.requestWithdraw = requestWithdraw;
|
|
57
|
+
exports.transferToAccount = transferToAccount;
|
|
58
|
+
exports.receive = receive;
|
|
59
|
+
const wxa = __importStar(require("../generated/waterx_account/account.js"));
|
|
60
|
+
const account_request_ts_1 = require("./account-request.js");
|
|
61
|
+
const constants_ts_1 = require("./constants.js");
|
|
62
|
+
const waterx_account_ts_1 = require("./waterx-account.js");
|
|
63
|
+
/** Build `waterx_account::create_account`. Returns the new account ID (Move return value). */
|
|
64
|
+
function createAccount(client, tx, params) {
|
|
65
|
+
const req = (0, account_request_ts_1.makeSenderRequest)(client, tx, params.bucketAccount);
|
|
66
|
+
return (0, waterx_account_ts_1.createAccountCall)(tx, {
|
|
67
|
+
packageId: client.config.packages.waterx_account.published_at,
|
|
68
|
+
registry: client.config.packages.waterx_account.account_registry,
|
|
69
|
+
}, { senderRequest: req, alias: params.alias });
|
|
70
|
+
}
|
|
71
|
+
function setAlias(client, tx, params) {
|
|
72
|
+
const req = (0, account_request_ts_1.makeSenderRequest)(client, tx, params.bucketAccount);
|
|
73
|
+
wxa.setAlias({
|
|
74
|
+
package: client.config.packages.waterx_account.published_at,
|
|
75
|
+
arguments: {
|
|
76
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
77
|
+
senderRequest: req,
|
|
78
|
+
accountId: params.accountId,
|
|
79
|
+
alias: params.alias,
|
|
80
|
+
},
|
|
81
|
+
})(tx);
|
|
82
|
+
}
|
|
83
|
+
function addDelegate(client, tx, params) {
|
|
84
|
+
const req = (0, account_request_ts_1.makeSenderRequest)(client, tx, params.bucketAccount);
|
|
85
|
+
wxa.addDelegate({
|
|
86
|
+
package: client.config.packages.waterx_account.published_at,
|
|
87
|
+
arguments: {
|
|
88
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
89
|
+
senderRequest: req,
|
|
90
|
+
accountId: params.accountId,
|
|
91
|
+
delegateAddress: params.delegateAddress,
|
|
92
|
+
alias: params.alias,
|
|
93
|
+
permissions: params.permissions,
|
|
94
|
+
expiresAtMs: params.expiresAtMs ?? null,
|
|
95
|
+
},
|
|
96
|
+
})(tx);
|
|
97
|
+
}
|
|
98
|
+
function removeDelegate(client, tx, params) {
|
|
99
|
+
const req = (0, account_request_ts_1.makeSenderRequest)(client, tx, params.bucketAccount);
|
|
100
|
+
wxa.removeDelegate({
|
|
101
|
+
package: client.config.packages.waterx_account.published_at,
|
|
102
|
+
arguments: {
|
|
103
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
104
|
+
senderRequest: req,
|
|
105
|
+
accountId: params.accountId,
|
|
106
|
+
delegateAddress: params.delegateAddress,
|
|
107
|
+
},
|
|
108
|
+
})(tx);
|
|
109
|
+
}
|
|
110
|
+
function setDelegateProtocolPermission(client, tx, params) {
|
|
111
|
+
const req = (0, account_request_ts_1.makeSenderRequest)(client, tx, params.bucketAccount);
|
|
112
|
+
wxa.setDelegateProtocolPermission({
|
|
113
|
+
package: client.config.packages.waterx_account.published_at,
|
|
114
|
+
arguments: {
|
|
115
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
116
|
+
senderRequest: req,
|
|
117
|
+
accountId: params.accountId,
|
|
118
|
+
delegateAddress: params.delegateAddress,
|
|
119
|
+
permissions: params.permissions,
|
|
120
|
+
},
|
|
121
|
+
typeArguments: [params.protocolType],
|
|
122
|
+
})(tx);
|
|
123
|
+
}
|
|
124
|
+
/** Build `account::request_deposit<T>`. Returns the `DepositRequest<T>` argument. */
|
|
125
|
+
function requestDeposit(client, tx, params) {
|
|
126
|
+
const [req] = wxa.requestDeposit({
|
|
127
|
+
package: client.config.packages.waterx_account.published_at,
|
|
128
|
+
arguments: {
|
|
129
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
130
|
+
accountId: params.accountId,
|
|
131
|
+
coin: params.coin,
|
|
132
|
+
extraData: Array.from(params.extraData ?? new Uint8Array()),
|
|
133
|
+
},
|
|
134
|
+
typeArguments: [params.coinType],
|
|
135
|
+
})(tx);
|
|
136
|
+
return req;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Build `account::request_deposit_from_receivings<T>` — drains `Coin<T>`
|
|
140
|
+
* objects previously transferred onto the account's address (the
|
|
141
|
+
* transfer-to-object path) into a single `DepositRequest<T>`. Returns the
|
|
142
|
+
* `DepositRequest<T>` argument.
|
|
143
|
+
*/
|
|
144
|
+
function requestDepositFromReceivings(client, tx, params) {
|
|
145
|
+
const receivings = tx.makeMoveVec({
|
|
146
|
+
type: `0x2::transfer::Receiving<0x2::coin::Coin<${params.coinType}>>`,
|
|
147
|
+
elements: params.receivings,
|
|
148
|
+
});
|
|
149
|
+
const [req] = wxa.requestDepositFromReceivings({
|
|
150
|
+
package: client.config.packages.waterx_account.published_at,
|
|
151
|
+
arguments: {
|
|
152
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
153
|
+
accountId: params.accountId,
|
|
154
|
+
receivings: receivings,
|
|
155
|
+
extraData: Array.from(params.extraData ?? new Uint8Array()),
|
|
156
|
+
},
|
|
157
|
+
typeArguments: [params.coinType],
|
|
158
|
+
})(tx);
|
|
159
|
+
return req;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Build `account::request_deposit_from_funds<T>` — drains every `Balance<T>`
|
|
163
|
+
* parked at the account's address in Sui's native funds accumulator (the
|
|
164
|
+
* path taken by `transfer_coin` / `0x2::balance::send_funds<T>`) into a
|
|
165
|
+
* single `DepositRequest<T>`. Returns the `DepositRequest<T>` argument.
|
|
166
|
+
*
|
|
167
|
+
* The drained total reflects the balance as of the last consensus commit,
|
|
168
|
+
* so the value isn't readable within the same PTB — treat it as a
|
|
169
|
+
* between-tx drain. Returns a zero-balance request when the address holds
|
|
170
|
+
* no `T`, so check `settled_funds_value<T>` off-chain first if you want to
|
|
171
|
+
* skip empty drains.
|
|
172
|
+
*/
|
|
173
|
+
function requestDepositFromFunds(client, tx, params) {
|
|
174
|
+
const root = params.accumulatorRoot ?? constants_ts_1.ACCUMULATOR_ROOT;
|
|
175
|
+
const [req] = wxa.requestDepositFromFunds({
|
|
176
|
+
package: client.config.packages.waterx_account.published_at,
|
|
177
|
+
arguments: {
|
|
178
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
179
|
+
accountId: params.accountId,
|
|
180
|
+
accumulatorRoot: (typeof root === "string"
|
|
181
|
+
? tx.object(root)
|
|
182
|
+
: root),
|
|
183
|
+
extraData: Array.from(params.extraData ?? new Uint8Array()),
|
|
184
|
+
},
|
|
185
|
+
typeArguments: [params.coinType],
|
|
186
|
+
})(tx);
|
|
187
|
+
return req;
|
|
188
|
+
}
|
|
189
|
+
/** Build `account::request_withdraw<T>`. Returns the `WithdrawRequest<T>` argument. */
|
|
190
|
+
function requestWithdraw(client, tx, params) {
|
|
191
|
+
const req = (0, account_request_ts_1.makeSenderRequest)(client, tx, params.bucketAccount);
|
|
192
|
+
const [out] = wxa.requestWithdraw({
|
|
193
|
+
package: client.config.packages.waterx_account.published_at,
|
|
194
|
+
arguments: {
|
|
195
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
196
|
+
senderRequest: req,
|
|
197
|
+
accountId: params.accountId,
|
|
198
|
+
amount: params.amount,
|
|
199
|
+
recipient: params.recipient,
|
|
200
|
+
extraData: Array.from(params.extraData ?? new Uint8Array()),
|
|
201
|
+
},
|
|
202
|
+
typeArguments: [params.coinType],
|
|
203
|
+
})(tx);
|
|
204
|
+
return out;
|
|
205
|
+
}
|
|
206
|
+
function transferToAccount(client, tx, params) {
|
|
207
|
+
wxa.transferCoin({
|
|
208
|
+
package: client.config.packages.waterx_account.published_at,
|
|
209
|
+
arguments: {
|
|
210
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
211
|
+
accountId: params.accountId,
|
|
212
|
+
coin: params.coin,
|
|
213
|
+
},
|
|
214
|
+
typeArguments: [params.coinType],
|
|
215
|
+
})(tx);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Calls `waterx_account::receive<T>` to drain a TTO'd object on the
|
|
219
|
+
* account's UID. Returns the received object to the caller's PTB so it
|
|
220
|
+
* can be merged / transferred / consumed downstream in the same tx.
|
|
221
|
+
*
|
|
222
|
+
* Bypasses the deposit-policy flow — use for reward coins (and other
|
|
223
|
+
* tokens / objects) that have no registered deposit policy.
|
|
224
|
+
*/
|
|
225
|
+
function receive(client, tx, params) {
|
|
226
|
+
const req = (0, account_request_ts_1.makeSenderRequest)(client, tx, params.bucketAccount);
|
|
227
|
+
const out = wxa.receive({
|
|
228
|
+
package: client.config.packages.waterx_account.published_at,
|
|
229
|
+
arguments: {
|
|
230
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
231
|
+
senderRequest: req,
|
|
232
|
+
accountId: params.accountId,
|
|
233
|
+
receiving: params.receiving,
|
|
234
|
+
},
|
|
235
|
+
typeArguments: [params.receivingType],
|
|
236
|
+
})(tx);
|
|
237
|
+
return out;
|
|
238
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `AccountClientLike` — the narrow capability slice the account/funding builders
|
|
3
|
+
* read, instead of the concrete `PerpClient`.
|
|
4
|
+
*
|
|
5
|
+
* The account framework + funding (credit / custody / bridge / consolidate) is
|
|
6
|
+
* the contract's **base** layer: both product lines depend down onto it. Typing
|
|
7
|
+
* these builders to `PerpClient` inverted that — so they take this structural
|
|
8
|
+
* interface instead. `PerpClient` satisfies it without an `implements` clause
|
|
9
|
+
* (it `extends BaseLineClient<WaterXConfig>` and carries the config-view slice +
|
|
10
|
+
* the `wormhole` infra block); a future funding-capable client can too.
|
|
11
|
+
*
|
|
12
|
+
* The config schema it reads lives in `account/config.ts` (the base layer), so
|
|
13
|
+
* this file imports **nothing** from `perp/` — `account/` no longer depends on the
|
|
14
|
+
* perp line even at the type level. `PerpClient`'s `WaterXConfig` is assignable to
|
|
15
|
+
* the narrower `AccountConfig` (`WaterXPackages extends AccountPackages`).
|
|
16
|
+
*/
|
|
17
|
+
import type { BaseLineClient } from "../base-client.ts";
|
|
18
|
+
import type { AccountConfig, NativeCustodyAsset, WaterxCreditPackage, WormholeBridgePackage, WormholeInfraConfig, WxaConfig } from "./config.ts";
|
|
19
|
+
/**
|
|
20
|
+
* The slice the **generic wxa builders** (create account / delegates / alias /
|
|
21
|
+
* deposit-request) read — just the `waterx_account` + `bucket_framework` package
|
|
22
|
+
* ids and transport. Both `PerpClient` and `PredictClient` satisfy it (their full
|
|
23
|
+
* configs are assignable to {@link WxaConfig}), so these builders are shared by
|
|
24
|
+
* both lines. The funding-capable {@link AccountClientLike} is a superset.
|
|
25
|
+
*/
|
|
26
|
+
export type WxaClientLike = BaseLineClient<WxaConfig>;
|
|
27
|
+
export interface AccountClientLike extends BaseLineClient<AccountConfig> {
|
|
28
|
+
/** External Wormhole infra (network default, overridable via config). */
|
|
29
|
+
readonly wormhole: WormholeInfraConfig;
|
|
30
|
+
/** Fully-qualified CREDIT coin Move type; throws if `waterx_credit.credit_type` is unset. */
|
|
31
|
+
creditType(): string;
|
|
32
|
+
/** `waterx_credit` package entry; throws if absent. */
|
|
33
|
+
getCredit(): WaterxCreditPackage;
|
|
34
|
+
/** `wormhole_bridge` package entry; throws if absent. */
|
|
35
|
+
getBridge(): WormholeBridgePackage;
|
|
36
|
+
/** Sui Wormhole `State` object id (per-deployment, falls back to `wormhole` infra). */
|
|
37
|
+
wormholeStateId(): string;
|
|
38
|
+
/** All native-custody backing-asset rows; throws if no custody vault. */
|
|
39
|
+
getNativeAssets(): readonly NativeCustodyAsset[];
|
|
40
|
+
/** A native-custody asset row by its fully-qualified Move type; throws if unknown. */
|
|
41
|
+
getNativeAsset(moveType: string): NativeCustodyAsset;
|
|
42
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `AccountClientLike` — the narrow capability slice the account/funding builders
|
|
4
|
+
* read, instead of the concrete `PerpClient`.
|
|
5
|
+
*
|
|
6
|
+
* The account framework + funding (credit / custody / bridge / consolidate) is
|
|
7
|
+
* the contract's **base** layer: both product lines depend down onto it. Typing
|
|
8
|
+
* these builders to `PerpClient` inverted that — so they take this structural
|
|
9
|
+
* interface instead. `PerpClient` satisfies it without an `implements` clause
|
|
10
|
+
* (it `extends BaseLineClient<WaterXConfig>` and carries the config-view slice +
|
|
11
|
+
* the `wormhole` infra block); a future funding-capable client can too.
|
|
12
|
+
*
|
|
13
|
+
* The config schema it reads lives in `account/config.ts` (the base layer), so
|
|
14
|
+
* this file imports **nothing** from `perp/` — `account/` no longer depends on the
|
|
15
|
+
* perp line even at the type level. `PerpClient`'s `WaterXConfig` is assignable to
|
|
16
|
+
* the narrower `AccountConfig` (`WaterXPackages extends AccountPackages`).
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account-layer config schema — the package entries + config slice the base
|
|
3
|
+
* (`waterx_account` framework + funding: credit / custody / bridge / queue +
|
|
4
|
+
* referral) reads. This is the **base**: `perp/config.ts` imports these and
|
|
5
|
+
* `WaterXPackages extends AccountPackages`; nothing here imports `perp/` or
|
|
6
|
+
* `prediction/`. Snake_case mirrors the canonical `waterx-config` JSON 1:1.
|
|
7
|
+
*/
|
|
8
|
+
import type { BaseLineConfig } from "../base-client.ts";
|
|
9
|
+
export interface BasePackageEntry {
|
|
10
|
+
published_at: string;
|
|
11
|
+
original_id: string;
|
|
12
|
+
version: number;
|
|
13
|
+
upgrade_capability?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface WxaAccountPackage extends BasePackageEntry {
|
|
16
|
+
admin_cap: string;
|
|
17
|
+
account_registry: string;
|
|
18
|
+
}
|
|
19
|
+
export interface WaterxReferralPackage extends BasePackageEntry {
|
|
20
|
+
/** Shared `ReferralTable`. */
|
|
21
|
+
referral_table: string;
|
|
22
|
+
}
|
|
23
|
+
export interface WaterxCreditPackage {
|
|
24
|
+
published_at: string;
|
|
25
|
+
/** Shared `CreditRegistry<CREDIT>` (phase-1 output). */
|
|
26
|
+
credit_registry?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Fully-qualified CREDIT coin Move type, e.g. `0x..::usd::USD`. Required for
|
|
29
|
+
* any credit/bridge flow — `client.creditType()` returns it as-is.
|
|
30
|
+
*/
|
|
31
|
+
credit_type?: string;
|
|
32
|
+
}
|
|
33
|
+
/** One backing-asset row on the native custody vault (PSM). */
|
|
34
|
+
export interface NativeCustodyAsset {
|
|
35
|
+
/** Human-readable asset label, e.g. `"MOCK_USDC"` / `"USDC"` (from `add_asset`). */
|
|
36
|
+
name?: string;
|
|
37
|
+
/** Fully-qualified backing asset Move type `T`. */
|
|
38
|
+
type: string;
|
|
39
|
+
decimal: number;
|
|
40
|
+
mint_fee_scaled: string;
|
|
41
|
+
burn_fee_scaled: string;
|
|
42
|
+
min_burn_amount: string;
|
|
43
|
+
}
|
|
44
|
+
export interface NativeCustodyPackage {
|
|
45
|
+
published_at: string;
|
|
46
|
+
/** Shared `CustodyVault<CREDIT>` (phase-4 output). */
|
|
47
|
+
vault?: string;
|
|
48
|
+
/** Backing assets registered via `add_asset` (array, identified by `type`). */
|
|
49
|
+
assets: NativeCustodyAsset[];
|
|
50
|
+
}
|
|
51
|
+
export interface TrustedEmitterRow {
|
|
52
|
+
/** Source EVM chain's Wormhole chain id (e.g. 10002 = Sepolia). */
|
|
53
|
+
chain_id: number;
|
|
54
|
+
/** 32-byte left-padded EVM bridge address (0x form). */
|
|
55
|
+
evm_bridge_address_32b: string;
|
|
56
|
+
/** Whitelisted 20-byte EVM token addresses (0x form). */
|
|
57
|
+
evm_tokens_20b: string[];
|
|
58
|
+
}
|
|
59
|
+
export interface WormholeBridgePackage {
|
|
60
|
+
published_at: string;
|
|
61
|
+
/** Shared Sui Wormhole `State` object id for this deployment. */
|
|
62
|
+
wormhole_state: string;
|
|
63
|
+
hourly_mint_limit?: string;
|
|
64
|
+
max_mint_per_tx?: string;
|
|
65
|
+
hourly_burn_limit?: string;
|
|
66
|
+
max_burn_per_tx?: string;
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated EVM emitter↔token config now lives solely under `evm.bridge.chains`
|
|
69
|
+
* (deposit_vault = emitter, wormhole_chain_id = chain key). The runtime allowlist is
|
|
70
|
+
* read from the on-chain `Bridge` object, not from config. Kept optional for back-compat.
|
|
71
|
+
*/
|
|
72
|
+
trusted_emitters?: TrustedEmitterRow[];
|
|
73
|
+
/** Shared `Bridge` (phase-5 output). */
|
|
74
|
+
bridge?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The bridge's `EmitterCap` object id (Sui-side Wormhole emitter address
|
|
77
|
+
* for burn-relay Wormholescan lookups). Not written by the deploy script
|
|
78
|
+
* — resolve from the on-chain `Bridge` object if absent.
|
|
79
|
+
*/
|
|
80
|
+
emitter_cap?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface WithdrawalQueuePackage {
|
|
83
|
+
published_at: string;
|
|
84
|
+
/** Addresses on the queue executor allowlist (keepers). */
|
|
85
|
+
executors?: string[];
|
|
86
|
+
/** Shared `Queue<CREDIT>` (phase-6 output). */
|
|
87
|
+
queue?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Wormhole infra for the cross-chain credit bridge. `state_id` is the same
|
|
91
|
+
* shared Sui Wormhole `State` object Pyth uses (kept in sync with
|
|
92
|
+
* `PYTH_DEFAULTS[*].wormhole_state_id`). Override per-deployment via
|
|
93
|
+
* `WaterXConfig.wormhole` if a deployment ever points elsewhere.
|
|
94
|
+
*/
|
|
95
|
+
export interface WormholeInfraConfig {
|
|
96
|
+
/** Shared Sui Wormhole `State` object. */
|
|
97
|
+
state_id: string;
|
|
98
|
+
/** Wormhole core package id on Sui. */
|
|
99
|
+
core_package: string;
|
|
100
|
+
/** Sui's Wormhole chain id (21 on both mainnet and testnet). */
|
|
101
|
+
sui_chain_id: number;
|
|
102
|
+
/** Wormholescan REST base for VAA lookups (no trailing slash). */
|
|
103
|
+
wormholescan_api: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The minimal package slice the **generic wxa builders** (create / delegate /
|
|
107
|
+
* alias …) read — only the fields BOTH the perp and prediction line configs are
|
|
108
|
+
* guaranteed to carry (prediction makes `original_id` / `version` / `admin_cap`
|
|
109
|
+
* optional, so the strict {@link WxaAccountPackage} is too narrow a target here).
|
|
110
|
+
*/
|
|
111
|
+
export interface WxaPackages {
|
|
112
|
+
bucket_framework: {
|
|
113
|
+
published_at: string;
|
|
114
|
+
};
|
|
115
|
+
waterx_account: {
|
|
116
|
+
published_at: string;
|
|
117
|
+
account_registry: string;
|
|
118
|
+
};
|
|
119
|
+
waterx_referral?: {
|
|
120
|
+
published_at: string;
|
|
121
|
+
referral_table: string;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/** Narrow config for the generic wxa builders — both line configs are assignable. */
|
|
125
|
+
export interface WxaConfig extends BaseLineConfig {
|
|
126
|
+
packages: WxaPackages;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The package subset the account base + funding builders read. The full
|
|
130
|
+
* line config (`WaterXPackages`) **extends** this, so any line client's config
|
|
131
|
+
* is structurally an account config.
|
|
132
|
+
*/
|
|
133
|
+
export interface AccountPackages extends WxaPackages {
|
|
134
|
+
bucket_framework: BasePackageEntry;
|
|
135
|
+
waterx_account: WxaAccountPackage;
|
|
136
|
+
waterx_referral?: WaterxReferralPackage;
|
|
137
|
+
waterx_credit?: WaterxCreditPackage;
|
|
138
|
+
wormhole_bridge?: WormholeBridgePackage;
|
|
139
|
+
withdrawal_queue?: WithdrawalQueuePackage;
|
|
140
|
+
native_custody?: NativeCustodyPackage;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The narrow config shape the account/funding builders need. `WaterXConfig`
|
|
144
|
+
* (the perp line's full config) is assignable to this, so `PerpClient` satisfies
|
|
145
|
+
* {@link import("./client.ts").AccountClientLike} without importing `perp/`.
|
|
146
|
+
*/
|
|
147
|
+
export interface AccountConfig extends BaseLineConfig {
|
|
148
|
+
packages: AccountPackages;
|
|
149
|
+
/** Wormhole infra override (defaults from `WORMHOLE_DEFAULTS[network]`). */
|
|
150
|
+
wormhole?: WormholeInfraConfig;
|
|
151
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Account-layer config schema — the package entries + config slice the base
|
|
4
|
+
* (`waterx_account` framework + funding: credit / custody / bridge / queue +
|
|
5
|
+
* referral) reads. This is the **base**: `perp/config.ts` imports these and
|
|
6
|
+
* `WaterXPackages extends AccountPackages`; nothing here imports `perp/` or
|
|
7
|
+
* `prediction/`. Snake_case mirrors the canonical `waterx-config` JSON 1:1.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Account-framework constants (shared base — neither perp- nor prediction-specific).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ACCUMULATOR_ROOT = void 0;
|
|
7
|
+
/** Sentinel "accumulator root" address passed to `waterx_account` add-position/order. */
|
|
8
|
+
exports.ACCUMULATOR_ROOT = "0xacc";
|