@waterx/sdk 3.0.1 → 3.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.
- 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 +56 -0
- package/dist/cjs/src/prediction/client.js +128 -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 +242 -0
- package/dist/cjs/src/prediction/gift.js +490 -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/dist/src/prediction/client.d.ts +11 -0
- package/dist/src/prediction/client.js +16 -0
- package/dist/src/prediction/gift.d.ts +19 -0
- package/dist/src/prediction/gift.js +26 -1
- package/package.json +119 -31
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Referral queries (`waterx_referral::referral_table`).
|
|
3
|
+
*
|
|
4
|
+
* Account-base reads — typed to {@link WxaClientLike} (just `waterx_referral` +
|
|
5
|
+
* transport), not the perp line. Co-located with the referral builders in
|
|
6
|
+
* `account/referral.ts`; both product lines can use them. The perp `fetch/`
|
|
7
|
+
* barrel re-exports these for back-compat.
|
|
8
|
+
*/
|
|
9
|
+
import type { WxaClientLike } from "../client.ts";
|
|
10
|
+
/** Returns the referrer address bound to `referee`, or `undefined` if none. */
|
|
11
|
+
export declare function getRefererFor(client: WxaClientLike, referee: string): Promise<string | undefined>;
|
|
12
|
+
/** True if `code` is a syntactically valid referral code (matches the contract's char rules). */
|
|
13
|
+
export declare function isValidReferralCode(client: WxaClientLike, code: string): Promise<boolean>;
|
|
14
|
+
/** True if `code` is already claimed in the on-chain ReferralTable. */
|
|
15
|
+
export declare function referralCodeExists(client: WxaClientLike, code: string): Promise<boolean>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Referral queries (`waterx_referral::referral_table`).
|
|
4
|
+
*
|
|
5
|
+
* Account-base reads — typed to {@link WxaClientLike} (just `waterx_referral` +
|
|
6
|
+
* transport), not the perp line. Co-located with the referral builders in
|
|
7
|
+
* `account/referral.ts`; both product lines can use them. The perp `fetch/`
|
|
8
|
+
* barrel re-exports these for back-compat.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.getRefererFor = getRefererFor;
|
|
12
|
+
exports.isValidReferralCode = isValidReferralCode;
|
|
13
|
+
exports.referralCodeExists = referralCodeExists;
|
|
14
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
|
15
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
16
|
+
const referral_table_ts_1 = require("../../generated/waterx_referral/referral_table.js");
|
|
17
|
+
const simulate_ts_1 = require("./simulate.js");
|
|
18
|
+
function requireReferralPackage(client) {
|
|
19
|
+
const pkg = client.config.packages.waterx_referral?.published_at;
|
|
20
|
+
const table = client.config.packages.waterx_referral?.referral_table;
|
|
21
|
+
if (!pkg || !table) {
|
|
22
|
+
throw new Error("referral package not configured: set config.packages.waterx_referral.{published_at,referral_table}");
|
|
23
|
+
}
|
|
24
|
+
return { pkg, table };
|
|
25
|
+
}
|
|
26
|
+
/** Returns the referrer address bound to `referee`, or `undefined` if none. */
|
|
27
|
+
async function getRefererFor(client, referee) {
|
|
28
|
+
const { pkg, table } = requireReferralPackage(client);
|
|
29
|
+
const tx = new transactions_1.Transaction();
|
|
30
|
+
(0, referral_table_ts_1.tryGetRefer)({
|
|
31
|
+
package: pkg,
|
|
32
|
+
arguments: { table: tx.object(table), referee },
|
|
33
|
+
})(tx);
|
|
34
|
+
const bytes = await (0, simulate_ts_1.simulateAndExtract)(client, tx);
|
|
35
|
+
const opt = bcs_1.bcs.option(bcs_1.bcs.Address).parse(bytes);
|
|
36
|
+
return opt ?? undefined;
|
|
37
|
+
}
|
|
38
|
+
/** True if `code` is a syntactically valid referral code (matches the contract's char rules). */
|
|
39
|
+
async function isValidReferralCode(client, code) {
|
|
40
|
+
const { pkg } = requireReferralPackage(client);
|
|
41
|
+
const tx = new transactions_1.Transaction();
|
|
42
|
+
(0, referral_table_ts_1.isValidReferralCode)({ package: pkg, arguments: { code } })(tx);
|
|
43
|
+
const bytes = await (0, simulate_ts_1.simulateAndExtract)(client, tx);
|
|
44
|
+
return bcs_1.bcs.bool().parse(bytes);
|
|
45
|
+
}
|
|
46
|
+
/** True if `code` is already claimed in the on-chain ReferralTable. */
|
|
47
|
+
async function referralCodeExists(client, code) {
|
|
48
|
+
const { pkg, table } = requireReferralPackage(client);
|
|
49
|
+
const tx = new transactions_1.Transaction();
|
|
50
|
+
(0, referral_table_ts_1.referralCodeExists)({
|
|
51
|
+
package: pkg,
|
|
52
|
+
arguments: { table: tx.object(table), code },
|
|
53
|
+
})(tx);
|
|
54
|
+
const bytes = await (0, simulate_ts_1.simulateAndExtract)(client, tx);
|
|
55
|
+
return bcs_1.bcs.bool().parse(bytes);
|
|
56
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared simulate/decode plumbing for the read helpers.
|
|
3
|
+
*
|
|
4
|
+
* Each public read builds a one-shot PTB, runs `client.simulate(tx)` with the
|
|
5
|
+
* zero address as sender, and decodes the command's BCS return values. Typed to
|
|
6
|
+
* the transport base ({@link BaseLineClient}) so any line client satisfies it —
|
|
7
|
+
* this is the **base** copy the perp `fetch/simulate.ts` re-exports, so the
|
|
8
|
+
* plumbing lives once. Internal to `fetch/` — not part of the public surface.
|
|
9
|
+
*/
|
|
10
|
+
import { Transaction } from "@mysten/sui/transactions";
|
|
11
|
+
import type { BaseLineClient } from "../../base-client.ts";
|
|
12
|
+
export interface SimulationCommandResult {
|
|
13
|
+
returnValues?: {
|
|
14
|
+
bcs?: Uint8Array | string;
|
|
15
|
+
value?: {
|
|
16
|
+
bcs?: Uint8Array | string;
|
|
17
|
+
};
|
|
18
|
+
}[];
|
|
19
|
+
}
|
|
20
|
+
export interface SimulationResult {
|
|
21
|
+
$kind?: string;
|
|
22
|
+
FailedTransaction?: {
|
|
23
|
+
status?: {
|
|
24
|
+
error?: {
|
|
25
|
+
message?: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
commandResults?: SimulationCommandResult[] | null;
|
|
30
|
+
}
|
|
31
|
+
export declare function toBytes(b: Uint8Array | string | undefined): Uint8Array | undefined;
|
|
32
|
+
export declare function simulateRaw(client: BaseLineClient, tx: Transaction): Promise<SimulationResult>;
|
|
33
|
+
export declare function extractAt(sim: SimulationResult, commandIndex: number, returnIndex?: number): Uint8Array;
|
|
34
|
+
export declare function simulateAndExtract(client: BaseLineClient, tx: Transaction, commandIndex?: number, returnIndex?: number): Promise<Uint8Array>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared simulate/decode plumbing for the read helpers.
|
|
4
|
+
*
|
|
5
|
+
* Each public read builds a one-shot PTB, runs `client.simulate(tx)` with the
|
|
6
|
+
* zero address as sender, and decodes the command's BCS return values. Typed to
|
|
7
|
+
* the transport base ({@link BaseLineClient}) so any line client satisfies it —
|
|
8
|
+
* this is the **base** copy the perp `fetch/simulate.ts` re-exports, so the
|
|
9
|
+
* plumbing lives once. Internal to `fetch/` — not part of the public surface.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.toBytes = toBytes;
|
|
13
|
+
exports.simulateRaw = simulateRaw;
|
|
14
|
+
exports.extractAt = extractAt;
|
|
15
|
+
exports.simulateAndExtract = simulateAndExtract;
|
|
16
|
+
const bcs_1 = require("@mysten/bcs");
|
|
17
|
+
const constants_ts_1 = require("../../constants.js");
|
|
18
|
+
function toBytes(b) {
|
|
19
|
+
if (!b)
|
|
20
|
+
return undefined;
|
|
21
|
+
if (typeof b === "string")
|
|
22
|
+
return (0, bcs_1.fromBase64)(b);
|
|
23
|
+
// gRPC returns Uint8Array; JSON-RPC serialization may turn it into a
|
|
24
|
+
// numeric-indexed object. Normalize both.
|
|
25
|
+
if (b instanceof Uint8Array)
|
|
26
|
+
return b;
|
|
27
|
+
return new Uint8Array(Object.values(b));
|
|
28
|
+
}
|
|
29
|
+
async function simulateRaw(client, tx) {
|
|
30
|
+
tx.setSender(constants_ts_1.DRY_RUN_SENDER);
|
|
31
|
+
const sim = (await client.simulate(tx));
|
|
32
|
+
if (sim.$kind === "FailedTransaction") {
|
|
33
|
+
const err = sim.FailedTransaction?.status?.error?.message ?? "FailedTransaction";
|
|
34
|
+
throw new Error(`simulate aborted: ${err}`);
|
|
35
|
+
}
|
|
36
|
+
return sim;
|
|
37
|
+
}
|
|
38
|
+
function extractAt(sim, commandIndex, returnIndex = 0) {
|
|
39
|
+
const ret = sim.commandResults?.[commandIndex]?.returnValues?.[returnIndex];
|
|
40
|
+
const bytes = toBytes(ret?.bcs) ?? toBytes(ret?.value?.bcs);
|
|
41
|
+
if (!bytes) {
|
|
42
|
+
throw new Error(`simulate returned no BCS value at commandResults[${commandIndex}].returnValues[${returnIndex}]`);
|
|
43
|
+
}
|
|
44
|
+
return bytes;
|
|
45
|
+
}
|
|
46
|
+
async function simulateAndExtract(client, tx, commandIndex = 0, returnIndex = 0) {
|
|
47
|
+
const sim = await simulateRaw(client, tx);
|
|
48
|
+
return extractAt(sim, commandIndex, returnIndex);
|
|
49
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AccountClientLike } from "../client.ts";
|
|
2
|
+
/** CREDIT parked at a wxa account's Sui address (funds accumulator + owned coins). */
|
|
3
|
+
export interface AddressCreditBalance {
|
|
4
|
+
/** `getBalance.addressBalance` — funds accumulator path. */
|
|
5
|
+
fundsRaw: bigint;
|
|
6
|
+
/** Sum of `listCoins` object balances — TTO'd / owned `Coin<CREDIT>` path. */
|
|
7
|
+
coinsRaw: bigint;
|
|
8
|
+
}
|
|
9
|
+
/** One native-custody backing asset parked at a wxa account's Sui address. */
|
|
10
|
+
export interface ParkedBackingAssetBalance {
|
|
11
|
+
assetType: string;
|
|
12
|
+
decimals: number;
|
|
13
|
+
/** `getBalance.addressBalance` — funds accumulator (`send_funds` path). */
|
|
14
|
+
fundsRaw: bigint;
|
|
15
|
+
/** Sum of `listCoins` object balances — TTO'd / owned `Coin<T>` path. */
|
|
16
|
+
coinsRaw: bigint;
|
|
17
|
+
}
|
|
18
|
+
/** Rescale a u64 raw amount between token decimal precisions (truncates on downscale). */
|
|
19
|
+
export declare function rescaleRawAmount(raw: bigint, fromDecimals: number, toDecimals?: number): bigint;
|
|
20
|
+
/**
|
|
21
|
+
* Probe every backing asset registered on `native_custody` for non-zero balances
|
|
22
|
+
* parked at `accountId`'s Sui address. Matches the pre-tx scan inside
|
|
23
|
+
* {@link appendConsolidateToUsd}.
|
|
24
|
+
*/
|
|
25
|
+
export declare function probeParkedBackingAssets(client: AccountClientLike, accountId: string): Promise<ParkedBackingAssetBalance[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Probe non-zero CREDIT parked at `accountId`'s Sui address. Matches the
|
|
28
|
+
* address-CREDIT legs inside {@link appendConsolidateAddressCredit}.
|
|
29
|
+
*/
|
|
30
|
+
export declare function probeAddressCreditBalance(client: AccountClientLike, accountId: string): Promise<AddressCreditBalance>;
|
|
31
|
+
/** Sum parked backing assets into CREDIT base units at the 1:1 PSM peg. */
|
|
32
|
+
export declare function sumParkedBackingAsCreditRaw(parked: readonly ParkedBackingAssetBalance[], creditDecimals?: number): bigint;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rescaleRawAmount = rescaleRawAmount;
|
|
4
|
+
exports.probeParkedBackingAssets = probeParkedBackingAssets;
|
|
5
|
+
exports.probeAddressCreditBalance = probeAddressCreditBalance;
|
|
6
|
+
exports.sumParkedBackingAsCreditRaw = sumParkedBackingAsCreditRaw;
|
|
7
|
+
/**
|
|
8
|
+
* Shared probe helpers for {@link appendConsolidateToUsd} and
|
|
9
|
+
* {@link getSpendableCreditBalance} — one asset list, one gRPC read pattern,
|
|
10
|
+
* so display totals match what the next async tx-builder would sweep.
|
|
11
|
+
*/
|
|
12
|
+
const constants_ts_1 = require("../../constants.js");
|
|
13
|
+
/** Rescale a u64 raw amount between token decimal precisions (truncates on downscale). */
|
|
14
|
+
function rescaleRawAmount(raw, fromDecimals, toDecimals = constants_ts_1.COLLATERAL_DECIMALS) {
|
|
15
|
+
if (fromDecimals === toDecimals)
|
|
16
|
+
return raw;
|
|
17
|
+
if (fromDecimals < toDecimals) {
|
|
18
|
+
return raw * 10n ** BigInt(toDecimals - fromDecimals);
|
|
19
|
+
}
|
|
20
|
+
return raw / 10n ** BigInt(fromDecimals - toDecimals);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Probe every backing asset registered on `native_custody` for non-zero balances
|
|
24
|
+
* parked at `accountId`'s Sui address. Matches the pre-tx scan inside
|
|
25
|
+
* {@link appendConsolidateToUsd}.
|
|
26
|
+
*/
|
|
27
|
+
async function probeParkedBackingAssets(client, accountId) {
|
|
28
|
+
if (!client.config.packages.native_custody?.vault)
|
|
29
|
+
return [];
|
|
30
|
+
if (!client.config.packages.waterx_credit?.credit_type)
|
|
31
|
+
return [];
|
|
32
|
+
const out = [];
|
|
33
|
+
for (const asset of client.getNativeAssets()) {
|
|
34
|
+
const bal = (await client.getBalance({
|
|
35
|
+
owner: accountId,
|
|
36
|
+
coinType: asset.type,
|
|
37
|
+
}));
|
|
38
|
+
const fundsRaw = BigInt(bal.balance?.addressBalance ?? "0");
|
|
39
|
+
const coins = (await client.listCoins({
|
|
40
|
+
owner: accountId,
|
|
41
|
+
coinType: asset.type,
|
|
42
|
+
}));
|
|
43
|
+
let coinsRaw = 0n;
|
|
44
|
+
for (const coin of coins.objects ?? []) {
|
|
45
|
+
coinsRaw += BigInt(coin.balance ?? "0");
|
|
46
|
+
}
|
|
47
|
+
if (fundsRaw > 0n || coinsRaw > 0n) {
|
|
48
|
+
out.push({
|
|
49
|
+
assetType: asset.type,
|
|
50
|
+
decimals: asset.decimal,
|
|
51
|
+
fundsRaw,
|
|
52
|
+
coinsRaw,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Probe non-zero CREDIT parked at `accountId`'s Sui address. Matches the
|
|
60
|
+
* address-CREDIT legs inside {@link appendConsolidateAddressCredit}.
|
|
61
|
+
*/
|
|
62
|
+
async function probeAddressCreditBalance(client, accountId) {
|
|
63
|
+
if (!client.config.packages.waterx_credit?.credit_type) {
|
|
64
|
+
return { fundsRaw: 0n, coinsRaw: 0n };
|
|
65
|
+
}
|
|
66
|
+
const creditType = client.creditType();
|
|
67
|
+
let fundsRaw = 0n;
|
|
68
|
+
let coinsRaw = 0n;
|
|
69
|
+
try {
|
|
70
|
+
const bal = (await client.getBalance({
|
|
71
|
+
owner: accountId,
|
|
72
|
+
coinType: creditType,
|
|
73
|
+
}));
|
|
74
|
+
fundsRaw = BigInt(bal.balance?.addressBalance ?? "0");
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// ignore — treat as zero parked funds
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const coins = (await client.listCoins({
|
|
81
|
+
owner: accountId,
|
|
82
|
+
coinType: creditType,
|
|
83
|
+
}));
|
|
84
|
+
for (const coin of coins.objects ?? []) {
|
|
85
|
+
coinsRaw += BigInt(coin.balance ?? "0");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
// ignore — treat as zero owned coins
|
|
90
|
+
}
|
|
91
|
+
return { fundsRaw, coinsRaw };
|
|
92
|
+
}
|
|
93
|
+
/** Sum parked backing assets into CREDIT base units at the 1:1 PSM peg. */
|
|
94
|
+
function sumParkedBackingAsCreditRaw(parked, creditDecimals = constants_ts_1.COLLATERAL_DECIMALS) {
|
|
95
|
+
let sum = 0n;
|
|
96
|
+
for (const row of parked) {
|
|
97
|
+
sum += rescaleRawAmount(row.fundsRaw + row.coinsRaw, row.decimals, creditDecimals);
|
|
98
|
+
}
|
|
99
|
+
return sum;
|
|
100
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consolidate parked backing assets → USD credit (pre-action sweep).
|
|
3
|
+
*
|
|
4
|
+
* Drains every backing asset (and address-owned CREDIT) parked at a wxa
|
|
5
|
+
* account's address into spendable wxUSD, so the subsequent trading / WLP /
|
|
6
|
+
* predict action can debit the internal slot. Empty buckets are skipped via
|
|
7
|
+
* gRPC probes, so the sweep is safe to run on any account.
|
|
8
|
+
*/
|
|
9
|
+
import { Transaction } from "@mysten/sui/transactions";
|
|
10
|
+
import type { AccountClientLike } from "../client.ts";
|
|
11
|
+
/**
|
|
12
|
+
* For every backing asset registered on `native_custody`, append two drain
|
|
13
|
+
* legs to `tx`:
|
|
14
|
+
*
|
|
15
|
+
* `requestDepositFromFunds<T>` → `mintCreditFromRequest<T, USD>` → `consumeDepositDirect<USD>`
|
|
16
|
+
* `requestDepositFromReceivings<T>` → `mintCreditFromRequest<T, USD>` → `consumeDepositDirect<USD>`
|
|
17
|
+
*
|
|
18
|
+
* Empty legs are skipped — the on-chain `mint` rejects zero-amount deposits.
|
|
19
|
+
* Returns the number of drain legs added (useful for logging / early-out).
|
|
20
|
+
*
|
|
21
|
+
* Silently no-ops when `native_custody` / `waterx_credit` aren't configured
|
|
22
|
+
* for the loaded deployment.
|
|
23
|
+
*/
|
|
24
|
+
export declare function appendConsolidateToUsd(client: AccountClientLike, tx: Transaction, accountId: string): Promise<number>;
|
|
25
|
+
/**
|
|
26
|
+
* Drain CREDIT parked at `accountId`'s Sui address (funds accumulator +
|
|
27
|
+
* owned `Coin<CREDIT>`) into the wxa internal slot via
|
|
28
|
+
* `consumeDepositDirect<CREDIT>`. Complements {@link appendConsolidateToUsd}
|
|
29
|
+
* for address-owned wxUSD that predict / perp actions debit from the internal
|
|
30
|
+
* balance.
|
|
31
|
+
*/
|
|
32
|
+
export declare function appendConsolidateAddressCredit(client: AccountClientLike, tx: Transaction, accountId: string): Promise<number>;
|
|
33
|
+
/**
|
|
34
|
+
* Full pre-action sweep: backing assets → wxUSD credit (PSM) plus address
|
|
35
|
+
* CREDIT → internal slot. Used by async tx-builders when `consolidateToUsd`
|
|
36
|
+
* is enabled (default).
|
|
37
|
+
*/
|
|
38
|
+
export declare function appendConsolidateForSpend(client: AccountClientLike, tx: Transaction, accountId: string): Promise<number>;
|
|
39
|
+
/**
|
|
40
|
+
* Standalone PTB that drains every backing asset parked at the account's
|
|
41
|
+
* address into USD credit under the account — see {@link appendConsolidateToUsd}.
|
|
42
|
+
*
|
|
43
|
+
* Returns an empty `Transaction` when nothing is parked. Callers can
|
|
44
|
+
* `client.simulate(tx)` to detect a no-op before submitting.
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildConsolidateToUsdTx(client: AccountClientLike, accountId: string, tx?: Transaction): Promise<Transaction>;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Consolidate parked backing assets → USD credit (pre-action sweep).
|
|
4
|
+
*
|
|
5
|
+
* Drains every backing asset (and address-owned CREDIT) parked at a wxa
|
|
6
|
+
* account's address into spendable wxUSD, so the subsequent trading / WLP /
|
|
7
|
+
* predict action can debit the internal slot. Empty buckets are skipped via
|
|
8
|
+
* gRPC probes, so the sweep is safe to run on any account.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.appendConsolidateToUsd = appendConsolidateToUsd;
|
|
12
|
+
exports.appendConsolidateAddressCredit = appendConsolidateAddressCredit;
|
|
13
|
+
exports.appendConsolidateForSpend = appendConsolidateForSpend;
|
|
14
|
+
exports.buildConsolidateToUsdTx = buildConsolidateToUsdTx;
|
|
15
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
16
|
+
const direct_rule_ts_1 = require("../../generated/waterx_account/direct_rule.js");
|
|
17
|
+
const account_ts_1 = require("../account.js");
|
|
18
|
+
const balance_ts_1 = require("./balance.js");
|
|
19
|
+
const custody_ts_1 = require("./custody.js");
|
|
20
|
+
/**
|
|
21
|
+
* For every backing asset registered on `native_custody`, append two drain
|
|
22
|
+
* legs to `tx`:
|
|
23
|
+
*
|
|
24
|
+
* `requestDepositFromFunds<T>` → `mintCreditFromRequest<T, USD>` → `consumeDepositDirect<USD>`
|
|
25
|
+
* `requestDepositFromReceivings<T>` → `mintCreditFromRequest<T, USD>` → `consumeDepositDirect<USD>`
|
|
26
|
+
*
|
|
27
|
+
* Empty legs are skipped — the on-chain `mint` rejects zero-amount deposits.
|
|
28
|
+
* Returns the number of drain legs added (useful for logging / early-out).
|
|
29
|
+
*
|
|
30
|
+
* Silently no-ops when `native_custody` / `waterx_credit` aren't configured
|
|
31
|
+
* for the loaded deployment.
|
|
32
|
+
*/
|
|
33
|
+
async function appendConsolidateToUsd(client, tx, accountId) {
|
|
34
|
+
const parked = await (0, balance_ts_1.probeParkedBackingAssets)(client, accountId);
|
|
35
|
+
let legs = 0;
|
|
36
|
+
for (const row of parked) {
|
|
37
|
+
if (row.fundsRaw > 0n) {
|
|
38
|
+
const fromFunds = (0, account_ts_1.requestDepositFromFunds)(client, tx, {
|
|
39
|
+
accountId,
|
|
40
|
+
coinType: row.assetType,
|
|
41
|
+
});
|
|
42
|
+
foldDepositRequestToUsd(client, tx, fromFunds, row.assetType);
|
|
43
|
+
legs += 1;
|
|
44
|
+
}
|
|
45
|
+
if (row.coinsRaw > 0n) {
|
|
46
|
+
const coins = (await client.listCoins({
|
|
47
|
+
owner: accountId,
|
|
48
|
+
coinType: row.assetType,
|
|
49
|
+
}));
|
|
50
|
+
const refs = (coins.objects ?? []).filter((c) => !!c.objectId && !!c.version && !!c.digest);
|
|
51
|
+
if (refs.length === 0)
|
|
52
|
+
continue;
|
|
53
|
+
const receivings = refs.map((c) => tx.receivingRef({ objectId: c.objectId, version: c.version, digest: c.digest }));
|
|
54
|
+
const fromReceivings = (0, account_ts_1.requestDepositFromReceivings)(client, tx, {
|
|
55
|
+
accountId,
|
|
56
|
+
coinType: row.assetType,
|
|
57
|
+
receivings,
|
|
58
|
+
});
|
|
59
|
+
foldDepositRequestToUsd(client, tx, fromReceivings, row.assetType);
|
|
60
|
+
legs += 1;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return legs;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Drain CREDIT parked at `accountId`'s Sui address (funds accumulator +
|
|
67
|
+
* owned `Coin<CREDIT>`) into the wxa internal slot via
|
|
68
|
+
* `consumeDepositDirect<CREDIT>`. Complements {@link appendConsolidateToUsd}
|
|
69
|
+
* for address-owned wxUSD that predict / perp actions debit from the internal
|
|
70
|
+
* balance.
|
|
71
|
+
*/
|
|
72
|
+
async function appendConsolidateAddressCredit(client, tx, accountId) {
|
|
73
|
+
if (!client.config.packages.waterx_credit?.credit_type)
|
|
74
|
+
return 0;
|
|
75
|
+
const creditType = client.creditType();
|
|
76
|
+
const { fundsRaw, coinsRaw } = await (0, balance_ts_1.probeAddressCreditBalance)(client, accountId);
|
|
77
|
+
let legs = 0;
|
|
78
|
+
if (fundsRaw > 0n) {
|
|
79
|
+
const fromFunds = (0, account_ts_1.requestDepositFromFunds)(client, tx, {
|
|
80
|
+
accountId,
|
|
81
|
+
coinType: creditType,
|
|
82
|
+
});
|
|
83
|
+
consumeDepositRequest(client, tx, fromFunds, creditType);
|
|
84
|
+
legs += 1;
|
|
85
|
+
}
|
|
86
|
+
if (coinsRaw > 0n) {
|
|
87
|
+
const coins = (await client.listCoins({
|
|
88
|
+
owner: accountId,
|
|
89
|
+
coinType: creditType,
|
|
90
|
+
}));
|
|
91
|
+
const refs = (coins.objects ?? []).filter((c) => !!c.objectId && !!c.version && !!c.digest);
|
|
92
|
+
if (refs.length > 0) {
|
|
93
|
+
const receivings = refs.map((c) => tx.receivingRef({ objectId: c.objectId, version: c.version, digest: c.digest }));
|
|
94
|
+
const fromReceivings = (0, account_ts_1.requestDepositFromReceivings)(client, tx, {
|
|
95
|
+
accountId,
|
|
96
|
+
coinType: creditType,
|
|
97
|
+
receivings,
|
|
98
|
+
});
|
|
99
|
+
consumeDepositRequest(client, tx, fromReceivings, creditType);
|
|
100
|
+
legs += 1;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return legs;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Full pre-action sweep: backing assets → wxUSD credit (PSM) plus address
|
|
107
|
+
* CREDIT → internal slot. Used by async tx-builders when `consolidateToUsd`
|
|
108
|
+
* is enabled (default).
|
|
109
|
+
*/
|
|
110
|
+
async function appendConsolidateForSpend(client, tx, accountId) {
|
|
111
|
+
const backingLegs = await appendConsolidateToUsd(client, tx, accountId);
|
|
112
|
+
const creditLegs = await appendConsolidateAddressCredit(client, tx, accountId);
|
|
113
|
+
return backingLegs + creditLegs;
|
|
114
|
+
}
|
|
115
|
+
function consumeDepositRequest(client, tx, depositRequest, coinType) {
|
|
116
|
+
(0, direct_rule_ts_1.consumeDepositDirect)({
|
|
117
|
+
package: client.config.packages.waterx_account.published_at,
|
|
118
|
+
arguments: {
|
|
119
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
120
|
+
req: depositRequest,
|
|
121
|
+
},
|
|
122
|
+
typeArguments: [coinType],
|
|
123
|
+
})(tx);
|
|
124
|
+
}
|
|
125
|
+
function foldDepositRequestToUsd(client, tx, depositRequest, assetType) {
|
|
126
|
+
const usdReq = (0, custody_ts_1.mintCreditFromRequest)(client, tx, {
|
|
127
|
+
depositRequest,
|
|
128
|
+
assetType,
|
|
129
|
+
});
|
|
130
|
+
consumeDepositRequest(client, tx, usdReq, client.creditType());
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Standalone PTB that drains every backing asset parked at the account's
|
|
134
|
+
* address into USD credit under the account — see {@link appendConsolidateToUsd}.
|
|
135
|
+
*
|
|
136
|
+
* Returns an empty `Transaction` when nothing is parked. Callers can
|
|
137
|
+
* `client.simulate(tx)` to detect a no-op before submitting.
|
|
138
|
+
*/
|
|
139
|
+
async function buildConsolidateToUsdTx(client, accountId, tx) {
|
|
140
|
+
const txOut = tx ?? new transactions_1.Transaction();
|
|
141
|
+
await appendConsolidateToUsd(client, txOut, accountId);
|
|
142
|
+
return txOut;
|
|
143
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-chain credit / bridge builders (low-level — one moveCall per fn).
|
|
3
|
+
*
|
|
4
|
+
* Flows (see waterx_credit/sui/*):
|
|
5
|
+
* - Mint (EVM → Sui): `redeemVaa` → `DepositRequest<CREDIT>` hot potato,
|
|
6
|
+
* consumed in the same PTB by `consumeCreditDeposit` (the wxa deposit
|
|
7
|
+
* policy CREDIT is registered under — selected via config).
|
|
8
|
+
* - Withdraw (Sui → EVM / native): `routeWormhole` / `routeNative` encode
|
|
9
|
+
* `extra_data`, fed to `account::request_withdraw` →
|
|
10
|
+
* `enqueueWithdrawal` parks a FIFO `Queue<CREDIT>` entry.
|
|
11
|
+
* - Keeper drains the queue via `executeWithdrawalWormhole` /
|
|
12
|
+
* `executeWithdrawalNative` (caller must be on the executor allowlist).
|
|
13
|
+
* - PSM: `custodyMint` against the native `CustodyVault` (direct burn was
|
|
14
|
+
* removed — audit L03/M14; redeem via the withdraw queue path above).
|
|
15
|
+
*
|
|
16
|
+
* Every builder that emits a hot potato returns its argument so the caller
|
|
17
|
+
* (or the high-level `tx-builders.ts` wrappers) can pair + consume it in the
|
|
18
|
+
* same PTB.
|
|
19
|
+
*/
|
|
20
|
+
import type { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
21
|
+
import type { AccountClientLike } from "../client.ts";
|
|
22
|
+
export interface RedeemVaaParams {
|
|
23
|
+
/** Signed Wormhole MINT VAA (raw bytes / number[] / hex). */
|
|
24
|
+
vaaBytes: Uint8Array | number[] | string;
|
|
25
|
+
/** Override the CREDIT Move type (defaults to `client.creditType()`). */
|
|
26
|
+
creditType?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Build `wormhole_bridge::redeem_vaa<CREDIT>`. Returns the
|
|
30
|
+
* `DepositRequest<CREDIT>` hot-potato argument — **must** be consumed in the
|
|
31
|
+
* same PTB (see {@link consumeCreditDeposit} / `redeemVaaTx`).
|
|
32
|
+
*/
|
|
33
|
+
export declare function redeemVaa(client: AccountClientLike, tx: Transaction, params: RedeemVaaParams): TransactionArgument;
|
|
34
|
+
export interface ConsumeCreditDepositParams {
|
|
35
|
+
/** The `DepositRequest<CREDIT>` returned by {@link redeemVaa} / {@link custodyMint}. */
|
|
36
|
+
depositRequest: TransactionArgument;
|
|
37
|
+
creditType?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Consume a `DepositRequest<CREDIT>` via `direct_rule::consume_deposit_direct`
|
|
41
|
+
* — the wxa deposit policy CREDIT is registered under (deploy.ts phase 2:
|
|
42
|
+
* `register_deposit_policy<CREDIT, DirectRule>`). Must run in the same PTB
|
|
43
|
+
* as the `redeem_vaa` / custody `mint` that produced the request.
|
|
44
|
+
*/
|
|
45
|
+
export declare function consumeCreditDeposit(client: AccountClientLike, tx: Transaction, params: ConsumeCreditDepositParams): void;
|
|
46
|
+
export interface RouteWormholeParams {
|
|
47
|
+
/** Destination EVM chain's Wormhole chain id. */
|
|
48
|
+
evmDestinationChain: number;
|
|
49
|
+
/** 20-byte EVM recipient (Uint8Array / number[] / hex). */
|
|
50
|
+
evmRecipient: Uint8Array | number[] | string;
|
|
51
|
+
/** 20-byte EVM token (Uint8Array / number[] / hex). */
|
|
52
|
+
evmToken: Uint8Array | number[] | string;
|
|
53
|
+
}
|
|
54
|
+
/** Build `withdrawal_queue::route_wormhole`. Returns the `extra_data` argument. */
|
|
55
|
+
export declare function routeWormhole(client: AccountClientLike, tx: Transaction, params: RouteWormholeParams): TransactionArgument;
|
|
56
|
+
export interface RouteNativeParams {
|
|
57
|
+
/** Fully-qualified backing asset Move type `T` (e.g. via `client.getNativeAsset`). */
|
|
58
|
+
assetType: string;
|
|
59
|
+
/**
|
|
60
|
+
* Minimum `Coin<T>` the user will accept after the native burn fee;
|
|
61
|
+
* `execute_native` aborts `EOutputBelowMin` if a later fee change would
|
|
62
|
+
* deliver less (audit M15). Defaults to `0` (opt out).
|
|
63
|
+
*/
|
|
64
|
+
minOutput?: bigint | number;
|
|
65
|
+
}
|
|
66
|
+
/** Build `withdrawal_queue::route_native<T>`. Returns the `extra_data` argument. */
|
|
67
|
+
export declare function routeNative(client: AccountClientLike, tx: Transaction, params: RouteNativeParams): TransactionArgument;
|
|
68
|
+
export interface RequestCreditWithdrawParams {
|
|
69
|
+
accountId: string;
|
|
70
|
+
amount: bigint | number;
|
|
71
|
+
/** Sui-side recipient (honored for native payouts; ignored for wormhole). */
|
|
72
|
+
recipient: string;
|
|
73
|
+
/** `extra_data` argument from {@link routeWormhole} / {@link routeNative}. */
|
|
74
|
+
route: TransactionArgument;
|
|
75
|
+
creditType?: string;
|
|
76
|
+
bucketAccount?: string | TransactionArgument;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Build `account::request_withdraw<CREDIT>` with a route-encoded `extra_data`.
|
|
80
|
+
* Returns the `WithdrawRequest<CREDIT>` hot-potato argument (feed to
|
|
81
|
+
* {@link enqueueWithdrawal} in the same PTB).
|
|
82
|
+
*/
|
|
83
|
+
export declare function requestCreditWithdraw(client: AccountClientLike, tx: Transaction, params: RequestCreditWithdrawParams): TransactionArgument;
|
|
84
|
+
export interface EnqueueWithdrawalParams {
|
|
85
|
+
/** `WithdrawRequest<CREDIT>` from {@link requestCreditWithdraw}. */
|
|
86
|
+
withdrawRequest: TransactionArgument;
|
|
87
|
+
creditType?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Build `withdrawal_queue::enqueue<CREDIT>`. Returns the assigned `u64` key
|
|
91
|
+
* argument (also surfaced on-chain via the `Enqueued` event).
|
|
92
|
+
*/
|
|
93
|
+
export declare function enqueueWithdrawal(client: AccountClientLike, tx: Transaction, params: EnqueueWithdrawalParams): TransactionArgument;
|
|
94
|
+
export interface ExecuteWithdrawalWormholeParams {
|
|
95
|
+
/** Queue entry key (from the `Enqueued` event / `enqueueWithdrawal`). */
|
|
96
|
+
key: bigint | number;
|
|
97
|
+
/** `Coin<SUI>` paying the Wormhole message fee. */
|
|
98
|
+
wormholeFee: TransactionArgument;
|
|
99
|
+
creditType?: string;
|
|
100
|
+
/** Executor identity (must be on the queue allowlist). Defaults to tx sender. */
|
|
101
|
+
bucketAccount?: string | TransactionArgument;
|
|
102
|
+
}
|
|
103
|
+
/** Build `withdrawal_queue::execute_wormhole<CREDIT>` (keeper / executor-gated). */
|
|
104
|
+
export declare function executeWithdrawalWormhole(client: AccountClientLike, tx: Transaction, params: ExecuteWithdrawalWormholeParams): void;
|
|
105
|
+
export interface ExecuteWithdrawalNativeParams {
|
|
106
|
+
key: bigint | number;
|
|
107
|
+
/** Fully-qualified backing asset Move type `T` (must match the entry's route). */
|
|
108
|
+
assetType: string;
|
|
109
|
+
creditType?: string;
|
|
110
|
+
bucketAccount?: string | TransactionArgument;
|
|
111
|
+
}
|
|
112
|
+
/** Build `withdrawal_queue::execute_native<T, CREDIT>` (keeper / executor-gated). */
|
|
113
|
+
export declare function executeWithdrawalNative(client: AccountClientLike, tx: Transaction, params: ExecuteWithdrawalNativeParams): void;
|
|
114
|
+
export interface CustodyMintParams {
|
|
115
|
+
/** wxa account ID the minted CREDIT lands in. */
|
|
116
|
+
accountId: string;
|
|
117
|
+
/** `Coin<T>` of the native backing asset. */
|
|
118
|
+
assetCoin: TransactionArgument;
|
|
119
|
+
/** Fully-qualified backing asset Move type `T`. */
|
|
120
|
+
assetType: string;
|
|
121
|
+
extraData?: Uint8Array | number[] | string;
|
|
122
|
+
creditType?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Build `native_custody::custody_vault::mint<T, CREDIT>`. Returns the
|
|
126
|
+
* `DepositRequest<CREDIT>` hot-potato argument (consume in-PTB via
|
|
127
|
+
* {@link consumeCreditDeposit}).
|
|
128
|
+
*/
|
|
129
|
+
export declare function custodyMint(client: AccountClientLike, tx: Transaction, params: CustodyMintParams): TransactionArgument;
|