@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,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wxa account reads (`waterx_account`) — work on credit-only deployments
|
|
3
|
+
* (which have no `waterx_perp_view`). Plus the inclusive spendable-credit read.
|
|
4
|
+
*/
|
|
5
|
+
import { type ParkedBackingAssetBalance } from "../../account/funding/balance.ts";
|
|
6
|
+
import type { PerpClient } from "../client.ts";
|
|
7
|
+
/**
|
|
8
|
+
* List the wxa account IDs owned by `owner` (`account::account_ids`).
|
|
9
|
+
* Returns `[]` when the owner has never created an account. Use this to
|
|
10
|
+
* resolve the `account_id` a cross-chain deposit must target before
|
|
11
|
+
* filling the EVM `suiRecipient` field.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getAccountsByOwner(client: PerpClient, owner: string): Promise<string[]>;
|
|
14
|
+
/**
|
|
15
|
+
* A wxa account's stored `Balance<T>` (`account::account_balance<T>`).
|
|
16
|
+
* `coinType` defaults to the deployment's CREDIT type — i.e. the bridged
|
|
17
|
+
* balance available to withdraw. Returns `0n` for an unknown coin type.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAccountBalance(client: PerpClient, accountId: string, coinType?: string): Promise<bigint>;
|
|
20
|
+
/**
|
|
21
|
+
* Inclusive wxUSD credit an account can spend after the default async tx-builder
|
|
22
|
+
* pre-sweep (`appendConsolidateForSpend`).
|
|
23
|
+
*
|
|
24
|
+
* - `internalRaw` — stored `Balance<CREDIT>` (`getAccountBalance`).
|
|
25
|
+
* - `pendingBackingRaw` — native-custody backing assets (USDC, USDSUI, …)
|
|
26
|
+
* parked at the account's Sui address, rescaled to CREDIT decimals at the
|
|
27
|
+
* 1:1 PSM peg (same probe as `appendConsolidateToUsd`).
|
|
28
|
+
* - `pendingCreditAtAddressRaw` — CREDIT at the account address (accumulator +
|
|
29
|
+
* owned coins). Swept into the internal slot by `appendConsolidateAddressCredit`
|
|
30
|
+
* via `consumeDepositDirect`.
|
|
31
|
+
* - `totalRaw` — sum of the three components; matches post-
|
|
32
|
+
* `appendConsolidateForSpend` spendable balance for predict / perp
|
|
33
|
+
* builders with `consolidateToUsd: true` (default).
|
|
34
|
+
*/
|
|
35
|
+
export interface SpendableCreditBalance {
|
|
36
|
+
internalRaw: bigint;
|
|
37
|
+
pendingBackingRaw: bigint;
|
|
38
|
+
pendingCreditAtAddressRaw: bigint;
|
|
39
|
+
totalRaw: bigint;
|
|
40
|
+
/** Per-asset breakdown for the backing-asset probe (empty when nothing parked). */
|
|
41
|
+
parkedBacking: ParkedBackingAssetBalance[];
|
|
42
|
+
}
|
|
43
|
+
export declare function getSpendableCreditBalance(client: PerpClient, accountId: string): Promise<SpendableCreditBalance>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* wxa account reads (`waterx_account`) — work on credit-only deployments
|
|
4
|
+
* (which have no `waterx_perp_view`). Plus the inclusive spendable-credit read.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getAccountsByOwner = getAccountsByOwner;
|
|
8
|
+
exports.getAccountBalance = getAccountBalance;
|
|
9
|
+
exports.getSpendableCreditBalance = getSpendableCreditBalance;
|
|
10
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
|
11
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
12
|
+
const balance_ts_1 = require("../../account/funding/balance.js");
|
|
13
|
+
const account_ts_1 = require("../../generated/waterx_account/account.js");
|
|
14
|
+
const constants_ts_1 = require("../constants.js");
|
|
15
|
+
const simulate_ts_1 = require("./simulate.js");
|
|
16
|
+
/**
|
|
17
|
+
* List the wxa account IDs owned by `owner` (`account::account_ids`).
|
|
18
|
+
* Returns `[]` when the owner has never created an account. Use this to
|
|
19
|
+
* resolve the `account_id` a cross-chain deposit must target before
|
|
20
|
+
* filling the EVM `suiRecipient` field.
|
|
21
|
+
*/
|
|
22
|
+
async function getAccountsByOwner(client, owner) {
|
|
23
|
+
const tx = new transactions_1.Transaction();
|
|
24
|
+
(0, account_ts_1.accountIds)({
|
|
25
|
+
package: client.config.packages.waterx_account.published_at,
|
|
26
|
+
arguments: {
|
|
27
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
28
|
+
owner,
|
|
29
|
+
},
|
|
30
|
+
})(tx);
|
|
31
|
+
const bytes = await (0, simulate_ts_1.simulateAndExtract)(client, tx);
|
|
32
|
+
return bcs_1.bcs.vector(bcs_1.bcs.Address).parse(bytes);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A wxa account's stored `Balance<T>` (`account::account_balance<T>`).
|
|
36
|
+
* `coinType` defaults to the deployment's CREDIT type — i.e. the bridged
|
|
37
|
+
* balance available to withdraw. Returns `0n` for an unknown coin type.
|
|
38
|
+
*/
|
|
39
|
+
async function getAccountBalance(client, accountId, coinType) {
|
|
40
|
+
const tx = new transactions_1.Transaction();
|
|
41
|
+
(0, account_ts_1.accountBalance)({
|
|
42
|
+
package: client.config.packages.waterx_account.published_at,
|
|
43
|
+
arguments: {
|
|
44
|
+
registry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
45
|
+
accountId,
|
|
46
|
+
},
|
|
47
|
+
typeArguments: [coinType ?? client.creditType()],
|
|
48
|
+
})(tx);
|
|
49
|
+
const bytes = await (0, simulate_ts_1.simulateAndExtract)(client, tx);
|
|
50
|
+
return BigInt(bcs_1.bcs.u64().parse(bytes));
|
|
51
|
+
}
|
|
52
|
+
async function getSpendableCreditBalance(client, accountId) {
|
|
53
|
+
const creditType = client.creditType();
|
|
54
|
+
const [internalRaw, parkedBacking, addressCredit] = await Promise.all([
|
|
55
|
+
getAccountBalance(client, accountId, creditType),
|
|
56
|
+
(0, balance_ts_1.probeParkedBackingAssets)(client, accountId),
|
|
57
|
+
(0, balance_ts_1.probeAddressCreditBalance)(client, accountId),
|
|
58
|
+
]);
|
|
59
|
+
const pendingBackingRaw = (0, balance_ts_1.sumParkedBackingAsCreditRaw)(parkedBacking, constants_ts_1.COLLATERAL_DECIMALS);
|
|
60
|
+
const pendingCreditAtAddressRaw = addressCredit.fundsRaw + addressCredit.coinsRaw;
|
|
61
|
+
const totalRaw = internalRaw + pendingBackingRaw + pendingCreditAtAddressRaw;
|
|
62
|
+
return {
|
|
63
|
+
internalRaw,
|
|
64
|
+
pendingBackingRaw,
|
|
65
|
+
pendingCreditAtAddressRaw,
|
|
66
|
+
totalRaw,
|
|
67
|
+
parkedBacking,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge reads: `wormhole_bridge` rate-limit / cap snapshot and the
|
|
3
|
+
* `withdrawal_queue` (Sui → EVM) fee estimate.
|
|
4
|
+
*/
|
|
5
|
+
import type { PerpClient } from "../client.ts";
|
|
6
|
+
/**
|
|
7
|
+
* Live rate-limit / cap snapshot read from the `wormhole_bridge::Bridge`
|
|
8
|
+
* shared object. All amounts are raw base units of the bridged credit coin.
|
|
9
|
+
*
|
|
10
|
+
* `dailyMinted` / `dailyBurned` are the sliding-window sums as the on-chain
|
|
11
|
+
* `daily_minted` / `daily_burned` views report them — buckets that rotated
|
|
12
|
+
* out of the trailing window are evicted lazily on the next mint/burn, so
|
|
13
|
+
* these can read slightly high until then (conservative).
|
|
14
|
+
*/
|
|
15
|
+
export interface BridgeLimitsView {
|
|
16
|
+
paused: boolean;
|
|
17
|
+
dailyMintLimit: bigint;
|
|
18
|
+
dailyMinted: bigint;
|
|
19
|
+
maxMintPerTx: bigint;
|
|
20
|
+
dailyBurnLimit: bigint;
|
|
21
|
+
dailyBurned: bigint;
|
|
22
|
+
maxBurnPerTx: bigint;
|
|
23
|
+
/** Per-account 24h burn cap; 0n means the gate is disabled. */
|
|
24
|
+
personalBurnCapAmount: bigint;
|
|
25
|
+
/** Present only when `accountId` is supplied — burn counted in that
|
|
26
|
+
* account's current window (the per-account cap key is the account id). */
|
|
27
|
+
personalBurned?: bigint;
|
|
28
|
+
/** Present only when `backing` is supplied — `minted_for(chainId, token)`,
|
|
29
|
+
* the amount currently withdrawable to that EVM (chain, token). */
|
|
30
|
+
backingMinted?: bigint;
|
|
31
|
+
}
|
|
32
|
+
export interface BridgeLimitsArgs {
|
|
33
|
+
/** wxa trading account id — enables the per-account `personalBurned` read. */
|
|
34
|
+
accountId?: string;
|
|
35
|
+
/** Wormhole destination chain id + 20-byte EVM token — enables the
|
|
36
|
+
* `mintedFor` backing read. */
|
|
37
|
+
backing?: {
|
|
38
|
+
wormholeChainId: number;
|
|
39
|
+
token: Uint8Array | number[];
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Batched read of the bridge's rate-limit / cap state in a single simulate.
|
|
44
|
+
* Pass `accountId` to also fetch the per-account burn usage, and `backing`
|
|
45
|
+
* to also fetch the destination-chain backing (`minted_for`).
|
|
46
|
+
*
|
|
47
|
+
* Throws if `wormhole_bridge` (or its `Bridge` object id) is absent from the
|
|
48
|
+
* canonical config — e.g. on a network where the Sui bridge isn't published.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getBridgeLimits(client: PerpClient, args?: BridgeLimitsArgs): Promise<BridgeLimitsView>;
|
|
51
|
+
export interface BridgeFeeView {
|
|
52
|
+
/** Raw fee charged on a wormhole (Sui → EVM) exit of `amount`:
|
|
53
|
+
* `max(ceil(effectiveRate * amount), effectiveMinFee)`. */
|
|
54
|
+
feeAmount: bigint;
|
|
55
|
+
/** Whether the exit clears the on-chain net-zero guard — i.e. a strictly
|
|
56
|
+
* positive amount remains after the fee. Gate "estimated fee" UI on THIS,
|
|
57
|
+
* not `feeAmount` alone: a dust `amount`, or a min-fee floor ≥ `amount`,
|
|
58
|
+
* makes `feeAmount >= amount` and the exit would abort (audit L1). */
|
|
59
|
+
wouldExecute: boolean;
|
|
60
|
+
/** Effective % rate for the chain (per-chain override → default → 0),
|
|
61
|
+
* 1e9-scaled (the `Float`-as-`u128` ABI convention). */
|
|
62
|
+
effectiveRate: bigint;
|
|
63
|
+
/** Effective minimum-fee floor for the chain (override → default → 0),
|
|
64
|
+
* in CREDIT base units. */
|
|
65
|
+
effectiveMinFee: bigint;
|
|
66
|
+
/** Net CREDIT the recipient receives after the fee; `0n` when the exit
|
|
67
|
+
* wouldn't execute (`wouldExecute === false`). */
|
|
68
|
+
netAmount: bigint;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Estimate the bridge fee for a wormhole (Sui → EVM) CREDIT exit of `amount`
|
|
72
|
+
* to `evmDestinationChain`, read in a single simulate from the on-chain
|
|
73
|
+
* `withdrawal_queue` views. The charged fee is
|
|
74
|
+
* `max(ceil(effectiveRate * amount), effectiveMinFee)`.
|
|
75
|
+
*
|
|
76
|
+
* Surface UI off `wouldExecute`, NOT `feeAmount` alone — `feeAmount` is the raw
|
|
77
|
+
* fee and can equal/exceed `amount` (ceil rounding on a dust entry, or a min-fee
|
|
78
|
+
* floor larger than the entry), in which case the on-chain exit aborts its
|
|
79
|
+
* net-zero guard (audit L1). `netAmount` is `0n` whenever `wouldExecute` is
|
|
80
|
+
* false.
|
|
81
|
+
*
|
|
82
|
+
* @param args.amount CREDIT base units (the bridged coin's smallest unit).
|
|
83
|
+
* @param args.evmDestinationChain WORMHOLE chain id of the destination EVM.
|
|
84
|
+
* @param args.creditType CREDIT coin type; defaults to `client.creditType()`.
|
|
85
|
+
*/
|
|
86
|
+
export declare function getBridgeFee(client: PerpClient, args: {
|
|
87
|
+
evmDestinationChain: number;
|
|
88
|
+
amount: bigint | number;
|
|
89
|
+
creditType?: string;
|
|
90
|
+
}): Promise<BridgeFeeView>;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Bridge reads: `wormhole_bridge` rate-limit / cap snapshot and the
|
|
4
|
+
* `withdrawal_queue` (Sui → EVM) fee estimate.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getBridgeLimits = getBridgeLimits;
|
|
8
|
+
exports.getBridgeFee = getBridgeFee;
|
|
9
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
|
10
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
11
|
+
const withdrawal_queue_ts_1 = require("../../generated/withdrawal_queue/withdrawal_queue.js");
|
|
12
|
+
const wormhole_bridge_ts_1 = require("../../generated/wormhole_bridge/wormhole_bridge.js");
|
|
13
|
+
const simulate_ts_1 = require("./simulate.js");
|
|
14
|
+
/**
|
|
15
|
+
* Batched read of the bridge's rate-limit / cap state in a single simulate.
|
|
16
|
+
* Pass `accountId` to also fetch the per-account burn usage, and `backing`
|
|
17
|
+
* to also fetch the destination-chain backing (`minted_for`).
|
|
18
|
+
*
|
|
19
|
+
* Throws if `wormhole_bridge` (or its `Bridge` object id) is absent from the
|
|
20
|
+
* canonical config — e.g. on a network where the Sui bridge isn't published.
|
|
21
|
+
*/
|
|
22
|
+
async function getBridgeLimits(client, args = {}) {
|
|
23
|
+
const pkg = client.config.packages.wormhole_bridge;
|
|
24
|
+
if (!pkg?.bridge) {
|
|
25
|
+
throw new Error("wormhole_bridge is not deployed on this network (no `bridge` object id in config)");
|
|
26
|
+
}
|
|
27
|
+
const packageId = pkg.published_at;
|
|
28
|
+
const bridge = pkg.bridge;
|
|
29
|
+
const tx = new transactions_1.Transaction();
|
|
30
|
+
// Fixed-order view calls; indices tracked below.
|
|
31
|
+
(0, wormhole_bridge_ts_1.paused)({ package: packageId, arguments: { bridge } })(tx); // 0
|
|
32
|
+
(0, wormhole_bridge_ts_1.dailyMintLimit)({ package: packageId, arguments: { bridge } })(tx); // 1
|
|
33
|
+
(0, wormhole_bridge_ts_1.dailyMinted)({ package: packageId, arguments: { bridge } })(tx); // 2
|
|
34
|
+
(0, wormhole_bridge_ts_1.maxMintPerTx)({ package: packageId, arguments: { bridge } })(tx); // 3
|
|
35
|
+
(0, wormhole_bridge_ts_1.dailyBurnLimit)({ package: packageId, arguments: { bridge } })(tx); // 4
|
|
36
|
+
(0, wormhole_bridge_ts_1.dailyBurned)({ package: packageId, arguments: { bridge } })(tx); // 5
|
|
37
|
+
(0, wormhole_bridge_ts_1.maxBurnPerTx)({ package: packageId, arguments: { bridge } })(tx); // 6
|
|
38
|
+
(0, wormhole_bridge_ts_1.personalBurnCapAmount)({ package: packageId, arguments: { bridge } })(tx); // 7
|
|
39
|
+
let backingIdx = -1;
|
|
40
|
+
if (args.backing) {
|
|
41
|
+
backingIdx = 8;
|
|
42
|
+
(0, wormhole_bridge_ts_1.mintedFor)({
|
|
43
|
+
package: packageId,
|
|
44
|
+
arguments: {
|
|
45
|
+
bridge,
|
|
46
|
+
chainId: args.backing.wormholeChainId,
|
|
47
|
+
token: Array.from(args.backing.token),
|
|
48
|
+
},
|
|
49
|
+
})(tx);
|
|
50
|
+
}
|
|
51
|
+
let personalIdx = -1;
|
|
52
|
+
if (args.accountId) {
|
|
53
|
+
personalIdx = backingIdx === -1 ? 8 : 9;
|
|
54
|
+
// Clock (0x6) is auto-injected by the generated wrapper.
|
|
55
|
+
(0, wormhole_bridge_ts_1.personalBurned)({
|
|
56
|
+
package: packageId,
|
|
57
|
+
arguments: { bridge, user: args.accountId },
|
|
58
|
+
})(tx);
|
|
59
|
+
}
|
|
60
|
+
const sim = await (0, simulate_ts_1.simulateRaw)(client, tx);
|
|
61
|
+
const u64At = (i) => BigInt(bcs_1.bcs.u64().parse((0, simulate_ts_1.extractAt)(sim, i)));
|
|
62
|
+
const view = {
|
|
63
|
+
paused: bcs_1.bcs.bool().parse((0, simulate_ts_1.extractAt)(sim, 0)),
|
|
64
|
+
dailyMintLimit: u64At(1),
|
|
65
|
+
dailyMinted: u64At(2),
|
|
66
|
+
maxMintPerTx: u64At(3),
|
|
67
|
+
dailyBurnLimit: u64At(4),
|
|
68
|
+
dailyBurned: u64At(5),
|
|
69
|
+
maxBurnPerTx: u64At(6),
|
|
70
|
+
personalBurnCapAmount: u64At(7),
|
|
71
|
+
};
|
|
72
|
+
if (backingIdx >= 0)
|
|
73
|
+
view.backingMinted = u64At(backingIdx);
|
|
74
|
+
if (personalIdx >= 0)
|
|
75
|
+
view.personalBurned = u64At(personalIdx);
|
|
76
|
+
return view;
|
|
77
|
+
}
|
|
78
|
+
function requireWithdrawalQueue(client) {
|
|
79
|
+
const wq = client.config.packages.withdrawal_queue;
|
|
80
|
+
if (!wq?.queue) {
|
|
81
|
+
throw new Error("withdrawal_queue is not deployed on this network (no `queue` object id in config)");
|
|
82
|
+
}
|
|
83
|
+
return { pkg: wq.published_at, queue: wq.queue };
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Estimate the bridge fee for a wormhole (Sui → EVM) CREDIT exit of `amount`
|
|
87
|
+
* to `evmDestinationChain`, read in a single simulate from the on-chain
|
|
88
|
+
* `withdrawal_queue` views. The charged fee is
|
|
89
|
+
* `max(ceil(effectiveRate * amount), effectiveMinFee)`.
|
|
90
|
+
*
|
|
91
|
+
* Surface UI off `wouldExecute`, NOT `feeAmount` alone — `feeAmount` is the raw
|
|
92
|
+
* fee and can equal/exceed `amount` (ceil rounding on a dust entry, or a min-fee
|
|
93
|
+
* floor larger than the entry), in which case the on-chain exit aborts its
|
|
94
|
+
* net-zero guard (audit L1). `netAmount` is `0n` whenever `wouldExecute` is
|
|
95
|
+
* false.
|
|
96
|
+
*
|
|
97
|
+
* @param args.amount CREDIT base units (the bridged coin's smallest unit).
|
|
98
|
+
* @param args.evmDestinationChain WORMHOLE chain id of the destination EVM.
|
|
99
|
+
* @param args.creditType CREDIT coin type; defaults to `client.creditType()`.
|
|
100
|
+
*/
|
|
101
|
+
async function getBridgeFee(client, args) {
|
|
102
|
+
const { pkg, queue } = requireWithdrawalQueue(client);
|
|
103
|
+
const amount = BigInt(args.amount);
|
|
104
|
+
const common = {
|
|
105
|
+
package: pkg,
|
|
106
|
+
typeArguments: [args.creditType ?? client.creditType()],
|
|
107
|
+
};
|
|
108
|
+
const chain = args.evmDestinationChain;
|
|
109
|
+
const tx = new transactions_1.Transaction();
|
|
110
|
+
// Fixed-order view calls; indices tracked below.
|
|
111
|
+
(0, withdrawal_queue_ts_1.bridgeFeeAmount)({
|
|
112
|
+
...common,
|
|
113
|
+
arguments: { queue, evmDestinationChain: chain, amount },
|
|
114
|
+
})(tx); // 0
|
|
115
|
+
(0, withdrawal_queue_ts_1.wouldExecuteWormhole)({
|
|
116
|
+
...common,
|
|
117
|
+
arguments: { queue, evmDestinationChain: chain, amount },
|
|
118
|
+
})(tx); // 1
|
|
119
|
+
(0, withdrawal_queue_ts_1.bridgeFeeRate)({ ...common, arguments: { queue, evmDestinationChain: chain } })(tx); // 2
|
|
120
|
+
(0, withdrawal_queue_ts_1.bridgeMinFee)({ ...common, arguments: { queue, evmDestinationChain: chain } })(tx); // 3
|
|
121
|
+
const sim = await (0, simulate_ts_1.simulateRaw)(client, tx);
|
|
122
|
+
const feeAmount = BigInt(bcs_1.bcs.u64().parse((0, simulate_ts_1.extractAt)(sim, 0)));
|
|
123
|
+
const wouldExecute = bcs_1.bcs.bool().parse((0, simulate_ts_1.extractAt)(sim, 1));
|
|
124
|
+
return {
|
|
125
|
+
feeAmount,
|
|
126
|
+
wouldExecute,
|
|
127
|
+
effectiveRate: BigInt(bcs_1.bcs.u128().parse((0, simulate_ts_1.extractAt)(sim, 2))),
|
|
128
|
+
effectiveMinFee: BigInt(bcs_1.bcs.u64().parse((0, simulate_ts_1.extractAt)(sim, 3))),
|
|
129
|
+
netAmount: wouldExecute ? amount - feeAmount : 0n,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native-custody PSM reads (`custody_vault`).
|
|
3
|
+
*/
|
|
4
|
+
import type { PerpClient } from "../client.ts";
|
|
5
|
+
/** Vault-wide native-custody state. */
|
|
6
|
+
export interface CustodyVaultData {
|
|
7
|
+
/** Total CREDIT minted by the custody vault (`credit_supply`). */
|
|
8
|
+
creditSupply: bigint;
|
|
9
|
+
}
|
|
10
|
+
/** Reads vault-wide native-custody state via `custody_vault::credit_supply`. */
|
|
11
|
+
export declare function getCustodyVaultData(client: PerpClient): Promise<CustodyVaultData>;
|
|
12
|
+
/** Per-asset native-custody state for one backing asset. */
|
|
13
|
+
export interface CustodyAssetData {
|
|
14
|
+
/** Whether the asset is registered as a `SingleVault` on the custody vault. */
|
|
15
|
+
registered: boolean;
|
|
16
|
+
/** 1e9-scaled default mint fee rate (`0n` when the asset is not registered). */
|
|
17
|
+
mintFeeRate: bigint;
|
|
18
|
+
/** 1e9-scaled default burn fee rate (`0n` when the asset is not registered). */
|
|
19
|
+
burnFeeRate: bigint;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Reads per-asset native-custody state for backing asset `assetType`.
|
|
23
|
+
*
|
|
24
|
+
* Fee rates are the vault's default config — queried with the zero address as
|
|
25
|
+
* caller, so no partner discount is applied — as 1e9-scaled `Float` values.
|
|
26
|
+
* When the asset is not registered, returns `registered: false` with `0n` rates.
|
|
27
|
+
*
|
|
28
|
+
* Note: the `SingleVault` balance / decimal / backing / min-burn / deprecated
|
|
29
|
+
* fields are not exposed here — the contract's getters for those return a
|
|
30
|
+
* `&SingleVault<T>` reference, which a PTB simulate cannot read.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getCustodyAssetData(client: PerpClient, assetType: string): Promise<CustodyAssetData>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Native-custody PSM reads (`custody_vault`).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getCustodyVaultData = getCustodyVaultData;
|
|
7
|
+
exports.getCustodyAssetData = getCustodyAssetData;
|
|
8
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
|
9
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
10
|
+
const custody_vault_ts_1 = require("../../generated/native_custody/custody_vault.js");
|
|
11
|
+
const constants_ts_1 = require("../constants.js");
|
|
12
|
+
const simulate_ts_1 = require("./simulate.js");
|
|
13
|
+
function requireCustody(client) {
|
|
14
|
+
const nc = client.config.packages.native_custody;
|
|
15
|
+
if (!nc?.vault) {
|
|
16
|
+
throw new Error("native_custody not configured — set config.packages.native_custody.vault");
|
|
17
|
+
}
|
|
18
|
+
return { pkg: nc.published_at, vault: nc.vault, creditType: client.creditType() };
|
|
19
|
+
}
|
|
20
|
+
/** Reads vault-wide native-custody state via `custody_vault::credit_supply`. */
|
|
21
|
+
async function getCustodyVaultData(client) {
|
|
22
|
+
const { pkg, vault, creditType } = requireCustody(client);
|
|
23
|
+
const tx = new transactions_1.Transaction();
|
|
24
|
+
(0, custody_vault_ts_1.creditSupply)({
|
|
25
|
+
package: pkg,
|
|
26
|
+
arguments: { vault: tx.object(vault) },
|
|
27
|
+
typeArguments: [creditType],
|
|
28
|
+
})(tx);
|
|
29
|
+
const bytes = await (0, simulate_ts_1.simulateAndExtract)(client, tx);
|
|
30
|
+
return { creditSupply: BigInt(bcs_1.bcs.u64().parse(bytes)) };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Reads per-asset native-custody state for backing asset `assetType`.
|
|
34
|
+
*
|
|
35
|
+
* Fee rates are the vault's default config — queried with the zero address as
|
|
36
|
+
* caller, so no partner discount is applied — as 1e9-scaled `Float` values.
|
|
37
|
+
* When the asset is not registered, returns `registered: false` with `0n` rates.
|
|
38
|
+
*
|
|
39
|
+
* Note: the `SingleVault` balance / decimal / backing / min-burn / deprecated
|
|
40
|
+
* fields are not exposed here — the contract's getters for those return a
|
|
41
|
+
* `&SingleVault<T>` reference, which a PTB simulate cannot read.
|
|
42
|
+
*/
|
|
43
|
+
async function getCustodyAssetData(client, assetType) {
|
|
44
|
+
const { pkg, vault, creditType } = requireCustody(client);
|
|
45
|
+
const typeArguments = [assetType, creditType];
|
|
46
|
+
const hasTx = new transactions_1.Transaction();
|
|
47
|
+
(0, custody_vault_ts_1.hasAsset)({ package: pkg, arguments: { vault: hasTx.object(vault) }, typeArguments })(hasTx);
|
|
48
|
+
const registered = bcs_1.bcs.bool().parse(await (0, simulate_ts_1.simulateAndExtract)(client, hasTx));
|
|
49
|
+
if (!registered)
|
|
50
|
+
return { registered: false, mintFeeRate: 0n, burnFeeRate: 0n };
|
|
51
|
+
const mintTx = new transactions_1.Transaction();
|
|
52
|
+
(0, custody_vault_ts_1.mintFeeRate)({
|
|
53
|
+
package: pkg,
|
|
54
|
+
arguments: { vault: mintTx.object(vault), caller: constants_ts_1.DRY_RUN_SENDER },
|
|
55
|
+
typeArguments,
|
|
56
|
+
})(mintTx);
|
|
57
|
+
const mintFeeRate = BigInt(bcs_1.bcs.u128().parse(await (0, simulate_ts_1.simulateAndExtract)(client, mintTx)));
|
|
58
|
+
const burnTx = new transactions_1.Transaction();
|
|
59
|
+
(0, custody_vault_ts_1.burnFeeRate)({
|
|
60
|
+
package: pkg,
|
|
61
|
+
arguments: { vault: burnTx.object(vault), caller: constants_ts_1.DRY_RUN_SENDER },
|
|
62
|
+
typeArguments,
|
|
63
|
+
})(burnTx);
|
|
64
|
+
const burnFeeRate = BigInt(bcs_1.bcs.u128().parse(await (0, simulate_ts_1.simulateAndExtract)(client, burnTx)));
|
|
65
|
+
return { registered: true, mintFeeRate, burnFeeRate };
|
|
66
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Market / pool / token-pool / global-config + account-data reads
|
|
3
|
+
* (`waterx_perp_view`).
|
|
4
|
+
*/
|
|
5
|
+
import { AccountData, GlobalConfigData, MarketData, PoolData, TokenPoolData } from "../../generated/waterx_perp_view/view.ts";
|
|
6
|
+
import type { PerpClient } from "../client.ts";
|
|
7
|
+
export type AccountDataView = ReturnType<typeof AccountData.parse>;
|
|
8
|
+
/**
|
|
9
|
+
* Look up the registered AccountData for a given wxa account ID.
|
|
10
|
+
* Returns `undefined` if the account has no perp data slot installed yet
|
|
11
|
+
* (the slot auto-installs on the first `add_position` / `add_order`).
|
|
12
|
+
* The underlying view fn returns `Option<AccountData>`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getAccountData(client: PerpClient, accountId: string): Promise<AccountDataView | undefined>;
|
|
15
|
+
export type MarketDataView = ReturnType<typeof MarketData.parse>;
|
|
16
|
+
export type PoolDataView = ReturnType<typeof PoolData.parse>;
|
|
17
|
+
export type TokenPoolDataView = ReturnType<typeof TokenPoolData.parse>;
|
|
18
|
+
export type GlobalConfigDataView = ReturnType<typeof GlobalConfigData.parse>;
|
|
19
|
+
export declare function getMarketData(client: PerpClient, args: {
|
|
20
|
+
ticker: string;
|
|
21
|
+
lpType?: string;
|
|
22
|
+
}): Promise<MarketDataView>;
|
|
23
|
+
export declare function getPoolData(client: PerpClient, args?: {
|
|
24
|
+
lpType?: string;
|
|
25
|
+
}): Promise<PoolDataView>;
|
|
26
|
+
export declare function getTokenPoolData(client: PerpClient, args: {
|
|
27
|
+
tokenIndex: bigint | number;
|
|
28
|
+
lpType?: string;
|
|
29
|
+
}): Promise<TokenPoolDataView>;
|
|
30
|
+
export declare function getGlobalConfigData(client: PerpClient): Promise<GlobalConfigDataView>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Market / pool / token-pool / global-config + account-data reads
|
|
4
|
+
* (`waterx_perp_view`).
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getAccountData = getAccountData;
|
|
8
|
+
exports.getMarketData = getMarketData;
|
|
9
|
+
exports.getPoolData = getPoolData;
|
|
10
|
+
exports.getTokenPoolData = getTokenPoolData;
|
|
11
|
+
exports.getGlobalConfigData = getGlobalConfigData;
|
|
12
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
|
13
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
14
|
+
const view_ts_1 = require("../../generated/waterx_perp_view/view.js");
|
|
15
|
+
const simulate_ts_1 = require("./simulate.js");
|
|
16
|
+
/**
|
|
17
|
+
* Look up the registered AccountData for a given wxa account ID.
|
|
18
|
+
* Returns `undefined` if the account has no perp data slot installed yet
|
|
19
|
+
* (the slot auto-installs on the first `add_position` / `add_order`).
|
|
20
|
+
* The underlying view fn returns `Option<AccountData>`.
|
|
21
|
+
*/
|
|
22
|
+
async function getAccountData(client, accountId) {
|
|
23
|
+
const tx = new transactions_1.Transaction();
|
|
24
|
+
(0, view_ts_1.accountData)({
|
|
25
|
+
package: client.config.packages.waterx_perp_view.published_at,
|
|
26
|
+
arguments: {
|
|
27
|
+
wxaRegistry: tx.object(client.config.packages.waterx_account.account_registry),
|
|
28
|
+
accountId,
|
|
29
|
+
},
|
|
30
|
+
})(tx);
|
|
31
|
+
const bytes = await (0, simulate_ts_1.simulateAndExtract)(client, tx);
|
|
32
|
+
const opt = bcs_1.bcs.option(view_ts_1.AccountData).parse(bytes);
|
|
33
|
+
return opt ?? undefined;
|
|
34
|
+
}
|
|
35
|
+
async function getMarketData(client, args) {
|
|
36
|
+
const tx = new transactions_1.Transaction();
|
|
37
|
+
(0, view_ts_1.marketData)({
|
|
38
|
+
package: client.config.packages.waterx_perp_view.published_at,
|
|
39
|
+
arguments: {
|
|
40
|
+
marketRegistry: tx.object(client.config.packages.waterx_perp.market_registry_wlp),
|
|
41
|
+
ticker: args.ticker,
|
|
42
|
+
},
|
|
43
|
+
typeArguments: [(0, simulate_ts_1.withLp)(client, args.lpType)],
|
|
44
|
+
})(tx);
|
|
45
|
+
return view_ts_1.MarketData.parse(await (0, simulate_ts_1.simulateAndExtract)(client, tx));
|
|
46
|
+
}
|
|
47
|
+
async function getPoolData(client, args = {}) {
|
|
48
|
+
const tx = new transactions_1.Transaction();
|
|
49
|
+
(0, view_ts_1.poolData)({
|
|
50
|
+
package: client.config.packages.waterx_perp_view.published_at,
|
|
51
|
+
arguments: { pool: tx.object(client.config.packages.wlp.wlp_pool) },
|
|
52
|
+
typeArguments: [(0, simulate_ts_1.withLp)(client, args.lpType)],
|
|
53
|
+
})(tx);
|
|
54
|
+
return view_ts_1.PoolData.parse(await (0, simulate_ts_1.simulateAndExtract)(client, tx));
|
|
55
|
+
}
|
|
56
|
+
async function getTokenPoolData(client, args) {
|
|
57
|
+
const tx = new transactions_1.Transaction();
|
|
58
|
+
(0, view_ts_1.tokenPoolData)({
|
|
59
|
+
package: client.config.packages.waterx_perp_view.published_at,
|
|
60
|
+
arguments: {
|
|
61
|
+
pool: tx.object(client.config.packages.wlp.wlp_pool),
|
|
62
|
+
tokenIndex: args.tokenIndex,
|
|
63
|
+
},
|
|
64
|
+
typeArguments: [(0, simulate_ts_1.withLp)(client, args.lpType)],
|
|
65
|
+
})(tx);
|
|
66
|
+
return view_ts_1.TokenPoolData.parse(await (0, simulate_ts_1.simulateAndExtract)(client, tx));
|
|
67
|
+
}
|
|
68
|
+
async function getGlobalConfigData(client) {
|
|
69
|
+
const tx = new transactions_1.Transaction();
|
|
70
|
+
(0, view_ts_1.globalConfigData)({
|
|
71
|
+
package: client.config.packages.waterx_perp_view.published_at,
|
|
72
|
+
arguments: { cfg: tx.object(client.config.packages.waterx_perp.global_config) },
|
|
73
|
+
})(tx);
|
|
74
|
+
return view_ts_1.GlobalConfigData.parse(await (0, simulate_ts_1.simulateAndExtract)(client, tx));
|
|
75
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Position / order reads + paginated market & account lists + redeem-request
|
|
3
|
+
* list (`waterx_perp_view`).
|
|
4
|
+
*/
|
|
5
|
+
import { OrderData, PositionData, RedeemRequestData } from "../../generated/waterx_perp_view/view.ts";
|
|
6
|
+
import type { PerpClient } from "../client.ts";
|
|
7
|
+
export type PositionDataView = ReturnType<typeof PositionData.parse>;
|
|
8
|
+
export declare function positionExists(client: PerpClient, args: {
|
|
9
|
+
ticker: string;
|
|
10
|
+
positionId: bigint | number;
|
|
11
|
+
lpType?: string;
|
|
12
|
+
}): Promise<boolean>;
|
|
13
|
+
export declare function getPosition(client: PerpClient, args: {
|
|
14
|
+
ticker: string;
|
|
15
|
+
positionId: bigint | number;
|
|
16
|
+
/** Human-readable USD prices for Pnl / liq price calc; pass 0n if unsure. */
|
|
17
|
+
basePriceUsd: bigint | number;
|
|
18
|
+
collateralPriceUsd: bigint | number;
|
|
19
|
+
lpType?: string;
|
|
20
|
+
}): Promise<PositionDataView>;
|
|
21
|
+
export type OrderDataView = ReturnType<typeof OrderData.parse>;
|
|
22
|
+
export declare function getOrder(client: PerpClient, args: {
|
|
23
|
+
ticker: string;
|
|
24
|
+
orderId: bigint | number;
|
|
25
|
+
orderTypeTag: number;
|
|
26
|
+
triggerPrice: bigint | number;
|
|
27
|
+
basePriceUsd: bigint | number;
|
|
28
|
+
lpType?: string;
|
|
29
|
+
}): Promise<OrderDataView>;
|
|
30
|
+
export interface PageOpts {
|
|
31
|
+
cursor?: bigint | number;
|
|
32
|
+
pageSize?: bigint | number;
|
|
33
|
+
}
|
|
34
|
+
export declare function getMarketOrders(client: PerpClient, args: {
|
|
35
|
+
ticker: string;
|
|
36
|
+
basePriceUsd?: bigint | number;
|
|
37
|
+
lpType?: string;
|
|
38
|
+
} & PageOpts): Promise<{
|
|
39
|
+
orders: OrderDataView[];
|
|
40
|
+
nextCursor?: bigint;
|
|
41
|
+
}>;
|
|
42
|
+
export declare function getMarketPositions(client: PerpClient, args: {
|
|
43
|
+
ticker: string;
|
|
44
|
+
basePriceUsd: bigint | number;
|
|
45
|
+
collateralPriceUsd?: bigint | number;
|
|
46
|
+
lpType?: string;
|
|
47
|
+
} & PageOpts): Promise<{
|
|
48
|
+
positions: PositionDataView[];
|
|
49
|
+
nextCursor?: bigint;
|
|
50
|
+
}>;
|
|
51
|
+
export declare function getAccountPositions(client: PerpClient, args: {
|
|
52
|
+
ticker: string;
|
|
53
|
+
accountObjectAddress: string;
|
|
54
|
+
basePriceUsd: bigint | number;
|
|
55
|
+
collateralPriceUsd?: bigint | number;
|
|
56
|
+
lpType?: string;
|
|
57
|
+
}): Promise<PositionDataView[]>;
|
|
58
|
+
export declare function getAccountOrders(client: PerpClient, args: {
|
|
59
|
+
ticker: string;
|
|
60
|
+
accountObjectAddress: string;
|
|
61
|
+
basePriceUsd?: bigint | number;
|
|
62
|
+
lpType?: string;
|
|
63
|
+
}): Promise<OrderDataView[]>;
|
|
64
|
+
export type RedeemRequestDataView = ReturnType<typeof RedeemRequestData.parse>;
|
|
65
|
+
export declare function getRedeemRequests(client: PerpClient, args?: {
|
|
66
|
+
lpType?: string;
|
|
67
|
+
} & PageOpts): Promise<{
|
|
68
|
+
requests: RedeemRequestDataView[];
|
|
69
|
+
nextCursor?: bigint;
|
|
70
|
+
}>;
|