@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,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Pyth as a price *source*: Hermes REST + the on-chain Pyth update PTB.
|
|
4
|
+
*
|
|
5
|
+
* This file knows nothing about oracle *rules* (pyth_rule / supra_rule /
|
|
6
|
+
* constant_rule / sponsor) — it only fetches price update VAAs from Hermes and
|
|
7
|
+
* appends the Pyth on-chain update block, returning the refreshed
|
|
8
|
+
* `PriceInfoObject` IDs. Feeding rules into a collector and aggregating lives in
|
|
9
|
+
* `aggregate.ts`; the rule wrappers live in `rules/`.
|
|
10
|
+
*
|
|
11
|
+
* On-chain a single PTB:
|
|
12
|
+
* 1. wormhole::vaa::parse_and_verify
|
|
13
|
+
* 2. pyth::create_authenticated_price_infos_using_accumulator
|
|
14
|
+
* 3. pyth::update_single_price_feed (one per feed)
|
|
15
|
+
* 4. hot_potato_vector::destroy
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PythCache = void 0;
|
|
19
|
+
exports.fetchPriceFeedsUpdateData = fetchPriceFeedsUpdateData;
|
|
20
|
+
exports.buildPythPriceUpdateCalls = buildPythPriceUpdateCalls;
|
|
21
|
+
exports.updatePythPrices = updatePythPrices;
|
|
22
|
+
const bcs_1 = require("@mysten/bcs");
|
|
23
|
+
const bcs_2 = require("@mysten/sui/bcs");
|
|
24
|
+
class PythCache {
|
|
25
|
+
pythStateInfo;
|
|
26
|
+
wormholePackageId;
|
|
27
|
+
priceTableInfo;
|
|
28
|
+
priceFeedObjectIdCache = new Map();
|
|
29
|
+
}
|
|
30
|
+
exports.PythCache = PythCache;
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// Hermes REST
|
|
33
|
+
// ============================================================================
|
|
34
|
+
async function fetchPriceFeedsUpdateData(endpoint, priceIds) {
|
|
35
|
+
if (priceIds.length === 0)
|
|
36
|
+
return [];
|
|
37
|
+
const url = new URL("/v2/updates/price/latest", endpoint);
|
|
38
|
+
priceIds.forEach((id) => url.searchParams.append("ids[]", id));
|
|
39
|
+
const res = await fetch(url.toString(), { signal: AbortSignal.timeout(15_000) });
|
|
40
|
+
if (!res.ok)
|
|
41
|
+
throw new Error(`Hermes price fetch failed: ${res.status} ${await res.text()}`);
|
|
42
|
+
const json = (await res.json());
|
|
43
|
+
const data = json.binary?.data;
|
|
44
|
+
if (!Array.isArray(data) || data.length === 0) {
|
|
45
|
+
throw new Error("Hermes returned no binary price data");
|
|
46
|
+
}
|
|
47
|
+
return data.map((hex) => (0, bcs_1.fromHex)(hex));
|
|
48
|
+
}
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// On-chain helpers (cached)
|
|
51
|
+
// ============================================================================
|
|
52
|
+
function pkgFromUpgradeCap(json, objectId) {
|
|
53
|
+
const upgradeCap = json.upgrade_cap ??
|
|
54
|
+
json.fields?.upgrade_cap;
|
|
55
|
+
const nested = upgradeCap?.fields?.package;
|
|
56
|
+
const pkg = typeof upgradeCap?.package === "string"
|
|
57
|
+
? upgradeCap.package
|
|
58
|
+
: typeof nested === "string"
|
|
59
|
+
? nested
|
|
60
|
+
: undefined;
|
|
61
|
+
if (!pkg)
|
|
62
|
+
throw new Error(`Cannot resolve package id for object ${objectId}`);
|
|
63
|
+
return pkg;
|
|
64
|
+
}
|
|
65
|
+
async function getPythStateInfo(client, pythStateId, cache) {
|
|
66
|
+
if (cache?.pythStateInfo)
|
|
67
|
+
return cache.pythStateInfo;
|
|
68
|
+
const result = await client.getObject({ objectId: pythStateId, include: { json: true } });
|
|
69
|
+
const json = result.object?.json;
|
|
70
|
+
if (!json)
|
|
71
|
+
throw new Error("Unable to fetch pyth state");
|
|
72
|
+
const packageId = pkgFromUpgradeCap(json, pythStateId);
|
|
73
|
+
const fields = json.fields;
|
|
74
|
+
const fee = (fields?.base_update_fee ?? json.base_update_fee);
|
|
75
|
+
if (fee === undefined)
|
|
76
|
+
throw new Error("Unable to fetch pyth state base_update_fee");
|
|
77
|
+
const info = { packageId, baseUpdateFee: BigInt(fee) };
|
|
78
|
+
if (cache)
|
|
79
|
+
cache.pythStateInfo = info;
|
|
80
|
+
return info;
|
|
81
|
+
}
|
|
82
|
+
async function getWormholePackageId(client, wormholeStateId, cache) {
|
|
83
|
+
if (cache?.wormholePackageId)
|
|
84
|
+
return cache.wormholePackageId;
|
|
85
|
+
const result = await client.getObject({ objectId: wormholeStateId, include: { json: true } });
|
|
86
|
+
const json = result.object?.json;
|
|
87
|
+
if (!json)
|
|
88
|
+
throw new Error(`Cannot resolve wormhole package id from ${wormholeStateId}`);
|
|
89
|
+
const pkg = pkgFromUpgradeCap(json, wormholeStateId);
|
|
90
|
+
if (cache)
|
|
91
|
+
cache.wormholePackageId = pkg;
|
|
92
|
+
return pkg;
|
|
93
|
+
}
|
|
94
|
+
async function getPriceTableInfo(client, pythStateId, cache) {
|
|
95
|
+
if (cache?.priceTableInfo)
|
|
96
|
+
return cache.priceTableInfo;
|
|
97
|
+
const list = await client.listDynamicFields({ parentId: pythStateId });
|
|
98
|
+
const entry = list.dynamicFields.find((e) => {
|
|
99
|
+
const vt = e.valueType || e.objectType || "";
|
|
100
|
+
return vt.includes("PriceIdentifier") || vt.includes("price_info");
|
|
101
|
+
});
|
|
102
|
+
if (!entry)
|
|
103
|
+
throw new Error("Price table not found in Pyth state dynamic fields");
|
|
104
|
+
const childId = entry.childId ?? entry.objectId;
|
|
105
|
+
const typeStr = entry.valueType || entry.objectType || "";
|
|
106
|
+
if (!childId)
|
|
107
|
+
throw new Error("Price table missing childId");
|
|
108
|
+
const pkgMatch = typeStr.match(/(0x[a-fA-F0-9]+)::price_identifier::PriceIdentifier/);
|
|
109
|
+
if (!pkgMatch)
|
|
110
|
+
throw new Error(`Cannot extract package from price table type: ${typeStr}`);
|
|
111
|
+
const info = { id: childId, fieldType: pkgMatch[1] };
|
|
112
|
+
if (cache)
|
|
113
|
+
cache.priceTableInfo = info;
|
|
114
|
+
return info;
|
|
115
|
+
}
|
|
116
|
+
async function getPriceFeedObjectId(client, table, feedId, cache, pythStateId) {
|
|
117
|
+
const normalized = feedId.replace(/^0x/, "");
|
|
118
|
+
const cacheKey = pythStateId ? `${pythStateId}:${normalized}` : normalized;
|
|
119
|
+
if (cache?.priceFeedObjectIdCache.has(cacheKey)) {
|
|
120
|
+
return cache.priceFeedObjectIdCache.get(cacheKey);
|
|
121
|
+
}
|
|
122
|
+
const keyBytes = bcs_2.bcs
|
|
123
|
+
.struct("PriceIdentifier", { bytes: bcs_2.bcs.vector(bcs_2.bcs.u8()) })
|
|
124
|
+
.serialize({ bytes: (0, bcs_1.fromHex)(normalized) })
|
|
125
|
+
.toBytes();
|
|
126
|
+
const result = await client.getDynamicField({
|
|
127
|
+
parentId: table.id,
|
|
128
|
+
name: { type: `${table.fieldType}::price_identifier::PriceIdentifier`, bcs: keyBytes },
|
|
129
|
+
});
|
|
130
|
+
const value = result.dynamicField?.value;
|
|
131
|
+
const objectId = !value?.bcs || value.bcs.length < 32 ? undefined : "0x" + (0, bcs_1.toHex)(value.bcs);
|
|
132
|
+
if (cache)
|
|
133
|
+
cache.priceFeedObjectIdCache.set(cacheKey, objectId);
|
|
134
|
+
return objectId;
|
|
135
|
+
}
|
|
136
|
+
// ============================================================================
|
|
137
|
+
// Accumulator parsing
|
|
138
|
+
// ============================================================================
|
|
139
|
+
function extractVaaBytes(accumulatorMessage) {
|
|
140
|
+
const view = new DataView(accumulatorMessage.buffer, accumulatorMessage.byteOffset, accumulatorMessage.byteLength);
|
|
141
|
+
const trailingPayloadSize = view.getUint8(6);
|
|
142
|
+
const vaaSizeOffset = 7 + trailingPayloadSize + 1; // +1 for proof_type
|
|
143
|
+
const vaaSize = view.getUint16(vaaSizeOffset, false);
|
|
144
|
+
const vaaOffset = vaaSizeOffset + 2;
|
|
145
|
+
return accumulatorMessage.subarray(vaaOffset, vaaOffset + vaaSize);
|
|
146
|
+
}
|
|
147
|
+
// ============================================================================
|
|
148
|
+
// Pyth update calls
|
|
149
|
+
// ============================================================================
|
|
150
|
+
/**
|
|
151
|
+
* Append the on-chain Pyth update PTB block. Returns `PriceInfoObject` IDs
|
|
152
|
+
* (one per `feedIds`, same order). After this you can feed `pyth_rule` per
|
|
153
|
+
* ticker against the matching `PriceInfoObject` (see `rules/pyth-rule.ts`).
|
|
154
|
+
*
|
|
155
|
+
* If `sponsorFund` is provided, the per-feed update fee comes from the
|
|
156
|
+
* sponsor pool (`pyth_sponsor_rule::split`) instead of `tx.gas`. Opening and
|
|
157
|
+
* reimbursing that fund is the sponsor rule's job (`rules/sponsor.ts`); here we
|
|
158
|
+
* only draw a fee coin from the already-open `fund` hot potato.
|
|
159
|
+
*/
|
|
160
|
+
async function buildPythPriceUpdateCalls(tx, host, updates, feedIds, cache, sponsorFund) {
|
|
161
|
+
if (updates.length === 0) {
|
|
162
|
+
throw new Error("No price update data provided; Hermes returned empty results");
|
|
163
|
+
}
|
|
164
|
+
if (updates.length > 1) {
|
|
165
|
+
throw new Error("Only a single accumulator message is supported per transaction");
|
|
166
|
+
}
|
|
167
|
+
const pyth = host.pyth;
|
|
168
|
+
const [stateInfo, wormholePackageId, table] = await Promise.all([
|
|
169
|
+
getPythStateInfo(host.grpcClient, pyth.state_id, cache),
|
|
170
|
+
getWormholePackageId(host.grpcClient, pyth.wormhole_state_id, cache),
|
|
171
|
+
getPriceTableInfo(host.grpcClient, pyth.state_id, cache),
|
|
172
|
+
]);
|
|
173
|
+
const priceInfoObjectIds = await Promise.all(feedIds.map((feedId) => getPriceFeedObjectId(host.grpcClient, table, feedId, cache, pyth.state_id)));
|
|
174
|
+
const { packageId: pythPackageId, baseUpdateFee } = stateInfo;
|
|
175
|
+
// 1. Verify VAA
|
|
176
|
+
const vaa = extractVaaBytes(updates[0]);
|
|
177
|
+
const [verifiedVaa] = tx.moveCall({
|
|
178
|
+
target: `${wormholePackageId}::vaa::parse_and_verify`,
|
|
179
|
+
arguments: [tx.object(pyth.wormhole_state_id), tx.pure.vector("u8", vaa), tx.object.clock()],
|
|
180
|
+
});
|
|
181
|
+
// 2. Authenticate price infos
|
|
182
|
+
const [hotPotato0] = tx.moveCall({
|
|
183
|
+
target: `${pythPackageId}::pyth::create_authenticated_price_infos_using_accumulator`,
|
|
184
|
+
arguments: [
|
|
185
|
+
tx.object(pyth.state_id),
|
|
186
|
+
tx.pure.vector("u8", updates[0]),
|
|
187
|
+
verifiedVaa,
|
|
188
|
+
tx.object.clock(),
|
|
189
|
+
],
|
|
190
|
+
});
|
|
191
|
+
// 3. Per-feed update
|
|
192
|
+
let hotPotato = hotPotato0;
|
|
193
|
+
for (let i = 0; i < feedIds.length; i++) {
|
|
194
|
+
const priceInfoObjectId = priceInfoObjectIds[i];
|
|
195
|
+
if (!priceInfoObjectId) {
|
|
196
|
+
throw new Error(`Pyth feed ${feedIds[i]} not registered on-chain in Pyth state`);
|
|
197
|
+
}
|
|
198
|
+
const feeCoin = sponsorFund
|
|
199
|
+
? tx.moveCall({
|
|
200
|
+
target: `${sponsorFund.packageId}::pyth_sponsor_rule::split`,
|
|
201
|
+
arguments: [sponsorFund.fund],
|
|
202
|
+
})[0]
|
|
203
|
+
: tx.splitCoins(tx.gas, [tx.pure.u64(baseUpdateFee)])[0];
|
|
204
|
+
[hotPotato] = tx.moveCall({
|
|
205
|
+
target: `${pythPackageId}::pyth::update_single_price_feed`,
|
|
206
|
+
arguments: [
|
|
207
|
+
tx.object(pyth.state_id),
|
|
208
|
+
hotPotato,
|
|
209
|
+
tx.object(priceInfoObjectId),
|
|
210
|
+
feeCoin,
|
|
211
|
+
tx.object.clock(),
|
|
212
|
+
],
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
// 4. Destroy hot potato
|
|
216
|
+
tx.moveCall({
|
|
217
|
+
target: `${pythPackageId}::hot_potato_vector::destroy`,
|
|
218
|
+
arguments: [hotPotato],
|
|
219
|
+
typeArguments: [`${pythPackageId}::price_info::PriceInfo`],
|
|
220
|
+
});
|
|
221
|
+
return priceInfoObjectIds;
|
|
222
|
+
}
|
|
223
|
+
/** All-in-one: fetch from Hermes, append update calls. Returns PriceInfoObject IDs. */
|
|
224
|
+
async function updatePythPrices(tx, host, feedIds, cache, sponsorFund) {
|
|
225
|
+
const updates = await fetchPriceFeedsUpdateData(host.pyth.hermes_endpoint, feedIds);
|
|
226
|
+
return buildPythPriceUpdateCalls(tx, host, updates, feedIds, cache, sponsorFund);
|
|
227
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `constant_rule::feed` — feed a constant-pinned price into the collector. Used
|
|
3
|
+
* for constant tickers ({@link OracleHost.isConstantTicker}); the price comes
|
|
4
|
+
* from the on-chain `constant_rule::Config`, so no Pyth update is needed for a
|
|
5
|
+
* constant-only ticker.
|
|
6
|
+
*/
|
|
7
|
+
import type { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
8
|
+
import type { OracleHost } from "../host.ts";
|
|
9
|
+
export declare function feedConstantRule(tx: Transaction, host: OracleHost, collector: TransactionArgument): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `constant_rule::feed` — feed a constant-pinned price into the collector. Used
|
|
4
|
+
* for constant tickers ({@link OracleHost.isConstantTicker}); the price comes
|
|
5
|
+
* from the on-chain `constant_rule::Config`, so no Pyth update is needed for a
|
|
6
|
+
* constant-only ticker.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.feedConstantRule = feedConstantRule;
|
|
10
|
+
const constant_rule_ts_1 = require("../../generated/waterx_constant_rule/constant_rule.js");
|
|
11
|
+
function feedConstantRule(tx, host, collector) {
|
|
12
|
+
const constant = host.config.packages.constant_rule;
|
|
13
|
+
(0, constant_rule_ts_1.feed)({
|
|
14
|
+
package: constant.published_at,
|
|
15
|
+
arguments: { collector, config: tx.object(constant.config) },
|
|
16
|
+
})(tx);
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyth_rule::feed` — feed a refreshed Pyth `PriceInfoObject` into an oracle
|
|
3
|
+
* `PriceCollector`. The rule resolves the on-chain feed by ticker via its
|
|
4
|
+
* `Config.identifier_map`, so it is not typed `<T>`.
|
|
5
|
+
*
|
|
6
|
+
* Caller must run the Pyth on-chain update first (see `../pyth.ts`) so the
|
|
7
|
+
* `PriceInfoObject` is fresh.
|
|
8
|
+
*/
|
|
9
|
+
import type { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
10
|
+
import type { OracleHost } from "../host.ts";
|
|
11
|
+
export declare function feedPythRule(tx: Transaction, host: OracleHost, collector: TransactionArgument, priceInfoObjectId: string): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `pyth_rule::feed` — feed a refreshed Pyth `PriceInfoObject` into an oracle
|
|
4
|
+
* `PriceCollector`. The rule resolves the on-chain feed by ticker via its
|
|
5
|
+
* `Config.identifier_map`, so it is not typed `<T>`.
|
|
6
|
+
*
|
|
7
|
+
* Caller must run the Pyth on-chain update first (see `../pyth.ts`) so the
|
|
8
|
+
* `PriceInfoObject` is fresh.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.feedPythRule = feedPythRule;
|
|
12
|
+
const pyth_rule_ts_1 = require("../../generated/waterx_pyth_rule/pyth_rule.js");
|
|
13
|
+
function feedPythRule(tx, host, collector, priceInfoObjectId) {
|
|
14
|
+
(0, pyth_rule_ts_1.feed)({
|
|
15
|
+
package: host.config.packages.pyth_rule.published_at,
|
|
16
|
+
arguments: {
|
|
17
|
+
collector,
|
|
18
|
+
config: tx.object(host.config.packages.pyth_rule.config),
|
|
19
|
+
pythState: tx.object(host.pyth.state_id),
|
|
20
|
+
pythPriceInfo: tx.object(priceInfoObjectId),
|
|
21
|
+
},
|
|
22
|
+
})(tx);
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyth_sponsor_rule` — pay Pyth update fees from a shared sponsor pool AND
|
|
3
|
+
* attach the `PythSponsorRule` witness to a `TradingRequest`. Required when the
|
|
4
|
+
* market's `request_checklist` contains `PythSponsorRule`.
|
|
5
|
+
*
|
|
6
|
+
* Flow: {@link openPythSponsorFund} opens a `Fund` hot potato; pass the returned
|
|
7
|
+
* `{ fund, packageId }` to the Pyth update path as its `sponsorFund` (it draws
|
|
8
|
+
* per-feed fees via `pyth_sponsor_rule::split`); then {@link reimbursePythSponsor}
|
|
9
|
+
* consumes the `Fund`, returns leftover SUI, and attaches the witness.
|
|
10
|
+
*/
|
|
11
|
+
import type { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
12
|
+
import type { OracleHost } from "../host.ts";
|
|
13
|
+
/**
|
|
14
|
+
* Opens a `Fund` hot potato from the shared PythSponsor pool. Pass the returned
|
|
15
|
+
* `{ fund, packageId }` straight to `refreshOraclePrices` as `sponsorFund`, then
|
|
16
|
+
* {@link reimbursePythSponsor} once the TradingRequest is built.
|
|
17
|
+
*/
|
|
18
|
+
export declare function openPythSponsorFund(tx: Transaction, host: OracleHost): {
|
|
19
|
+
fund: TransactionArgument;
|
|
20
|
+
packageId: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Consumes the `Fund` hot potato from {@link openPythSponsorFund}, returns any
|
|
24
|
+
* leftover SUI to the sponsor pool, and attaches the `PythSponsorRule` witness to
|
|
25
|
+
* the given `TradingRequest<C_TOKEN>` so `trading::execute` can satisfy a
|
|
26
|
+
* checklist that includes `PythSponsorRule`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function reimbursePythSponsor(tx: Transaction, host: OracleHost, fund: TransactionArgument, tradingRequest: TransactionArgument, collateralType: string): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `pyth_sponsor_rule` — pay Pyth update fees from a shared sponsor pool AND
|
|
4
|
+
* attach the `PythSponsorRule` witness to a `TradingRequest`. Required when the
|
|
5
|
+
* market's `request_checklist` contains `PythSponsorRule`.
|
|
6
|
+
*
|
|
7
|
+
* Flow: {@link openPythSponsorFund} opens a `Fund` hot potato; pass the returned
|
|
8
|
+
* `{ fund, packageId }` to the Pyth update path as its `sponsorFund` (it draws
|
|
9
|
+
* per-feed fees via `pyth_sponsor_rule::split`); then {@link reimbursePythSponsor}
|
|
10
|
+
* consumes the `Fund`, returns leftover SUI, and attaches the witness.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.openPythSponsorFund = openPythSponsorFund;
|
|
14
|
+
exports.reimbursePythSponsor = reimbursePythSponsor;
|
|
15
|
+
const pyth_sponsor_rule_ts_1 = require("../../generated/pyth_sponsor_rule/pyth_sponsor_rule.js");
|
|
16
|
+
/**
|
|
17
|
+
* Opens a `Fund` hot potato from the shared PythSponsor pool. Pass the returned
|
|
18
|
+
* `{ fund, packageId }` straight to `refreshOraclePrices` as `sponsorFund`, then
|
|
19
|
+
* {@link reimbursePythSponsor} once the TradingRequest is built.
|
|
20
|
+
*/
|
|
21
|
+
function openPythSponsorFund(tx, host) {
|
|
22
|
+
const entry = host.config.packages.pyth_sponsor_rule;
|
|
23
|
+
if (!entry?.published_at || !entry.pyth_sponsor) {
|
|
24
|
+
throw new Error("pyth_sponsor_rule.{published_at,pyth_sponsor} missing — sponsor flow unavailable");
|
|
25
|
+
}
|
|
26
|
+
const [fund] = (0, pyth_sponsor_rule_ts_1.request)({
|
|
27
|
+
package: entry.published_at,
|
|
28
|
+
arguments: { self: tx.object(entry.pyth_sponsor) },
|
|
29
|
+
})(tx);
|
|
30
|
+
return { fund: fund, packageId: entry.published_at };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Consumes the `Fund` hot potato from {@link openPythSponsorFund}, returns any
|
|
34
|
+
* leftover SUI to the sponsor pool, and attaches the `PythSponsorRule` witness to
|
|
35
|
+
* the given `TradingRequest<C_TOKEN>` so `trading::execute` can satisfy a
|
|
36
|
+
* checklist that includes `PythSponsorRule`.
|
|
37
|
+
*/
|
|
38
|
+
function reimbursePythSponsor(tx, host, fund, tradingRequest, collateralType) {
|
|
39
|
+
const entry = host.config.packages.pyth_sponsor_rule;
|
|
40
|
+
if (!entry?.published_at || !entry.pyth_sponsor) {
|
|
41
|
+
throw new Error("pyth_sponsor_rule missing from config");
|
|
42
|
+
}
|
|
43
|
+
(0, pyth_sponsor_rule_ts_1.reimburse)({
|
|
44
|
+
package: entry.published_at,
|
|
45
|
+
arguments: {
|
|
46
|
+
self: tx.object(entry.pyth_sponsor),
|
|
47
|
+
fund: fund,
|
|
48
|
+
tradingReq: tradingRequest,
|
|
49
|
+
},
|
|
50
|
+
typeArguments: [collateralType],
|
|
51
|
+
})(tx);
|
|
52
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `supra_rule::feed` — feed Supra as a second weighted rule on the same
|
|
3
|
+
* `PriceCollector` as Pyth, before `aggregate`.
|
|
4
|
+
*
|
|
5
|
+
* `maybeFeedSupra` is a no-op unless the deployment has supra enabled + wired
|
|
6
|
+
* (see {@link OracleHost.getSupraRule}), so Pyth-only deployments are unchanged.
|
|
7
|
+
* On-chain the rule abstains for symbols it has no pair for.
|
|
8
|
+
*/
|
|
9
|
+
import type { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
10
|
+
import type { OracleHost } from "../host.ts";
|
|
11
|
+
export declare function maybeFeedSupra(tx: Transaction, host: OracleHost, collector: TransactionArgument): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `supra_rule::feed` — feed Supra as a second weighted rule on the same
|
|
4
|
+
* `PriceCollector` as Pyth, before `aggregate`.
|
|
5
|
+
*
|
|
6
|
+
* `maybeFeedSupra` is a no-op unless the deployment has supra enabled + wired
|
|
7
|
+
* (see {@link OracleHost.getSupraRule}), so Pyth-only deployments are unchanged.
|
|
8
|
+
* On-chain the rule abstains for symbols it has no pair for.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.maybeFeedSupra = maybeFeedSupra;
|
|
12
|
+
const supra_rule_ts_1 = require("../../generated/waterx_supra_rule/supra_rule.js");
|
|
13
|
+
function maybeFeedSupra(tx, host, collector) {
|
|
14
|
+
const supra = host.getSupraRule();
|
|
15
|
+
if (!supra)
|
|
16
|
+
return;
|
|
17
|
+
(0, supra_rule_ts_1.feed)({
|
|
18
|
+
package: supra.published_at,
|
|
19
|
+
arguments: {
|
|
20
|
+
collector,
|
|
21
|
+
config: tx.object(supra.config),
|
|
22
|
+
oracleHolder: tx.object(supra.oracle_holder),
|
|
23
|
+
},
|
|
24
|
+
})(tx);
|
|
25
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WaterX Perp client — the perp product line (trading, orders, WLP, staking).
|
|
3
|
+
*
|
|
4
|
+
* One of the two sub-clients behind the umbrella `WaterXClient`; reachable as
|
|
5
|
+
* `client.perp` (which also carries the perp builders). Initialization is async —
|
|
6
|
+
* config is fetched from the canonical `waterx-config` JSON (default: GitHub raw).
|
|
7
|
+
* See `PerpClient.create()`.
|
|
8
|
+
*
|
|
9
|
+
* Composition: the gRPC transport half is inherited from {@link BaseLineClient}
|
|
10
|
+
* (shared with `PredictClient`); the canonical-schema lookups are delegated to a
|
|
11
|
+
* {@link PerpConfigView}. This class is just the wiring + factory between them.
|
|
12
|
+
*/
|
|
13
|
+
import { BaseLineClient } from "../base-client.ts";
|
|
14
|
+
import { type LoadConfigOptions, type PythInfraConfig, type WaterXConfig, type WormholeInfraConfig } from "./config.ts";
|
|
15
|
+
import type { Network } from "./constants.ts";
|
|
16
|
+
export interface CreateClientOptions extends LoadConfigOptions {
|
|
17
|
+
grpcUrl?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class PerpClient extends BaseLineClient<WaterXConfig> {
|
|
20
|
+
/** Pyth infra (network defaults unless overridden in JSON). */
|
|
21
|
+
pyth: PythInfraConfig;
|
|
22
|
+
/** Wormhole infra for the credit bridge (network defaults unless overridden). */
|
|
23
|
+
wormhole: WormholeInfraConfig;
|
|
24
|
+
/** Canonical-schema lookups (delegated to below); no transport. */
|
|
25
|
+
private readonly view;
|
|
26
|
+
constructor(network: Network, config: WaterXConfig, opts?: {
|
|
27
|
+
grpcUrl?: string;
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Async factory: fetches the deployment config for `network` and returns
|
|
31
|
+
* a ready-to-use client. Pass `opts.cache=true` to memoize the JSON.
|
|
32
|
+
*/
|
|
33
|
+
static create(network: Network, opts?: CreateClientOptions): Promise<PerpClient>;
|
|
34
|
+
static mainnet(opts?: CreateClientOptions): Promise<PerpClient>;
|
|
35
|
+
static testnet(opts?: CreateClientOptions): Promise<PerpClient>;
|
|
36
|
+
/** @see PerpConfigView.getMarket */
|
|
37
|
+
getMarket(ticker: string): import("./config.ts").WaterxPerpMarketEntry;
|
|
38
|
+
/** @see PerpConfigView.getAggregator */
|
|
39
|
+
getAggregator(ticker: string): string;
|
|
40
|
+
/** @see PerpConfigView.getPythFeed */
|
|
41
|
+
getPythFeed(ticker: string): {
|
|
42
|
+
feed_id: string;
|
|
43
|
+
price_info_object: string;
|
|
44
|
+
};
|
|
45
|
+
/** @see PerpConfigView.isConstantTicker */
|
|
46
|
+
isConstantTicker(ticker: string): boolean;
|
|
47
|
+
/** @see PerpConfigView.getSupraRule */
|
|
48
|
+
getSupraRule(): {
|
|
49
|
+
published_at: string;
|
|
50
|
+
config: string;
|
|
51
|
+
oracle_holder: string;
|
|
52
|
+
} | undefined;
|
|
53
|
+
/** @see PerpConfigView.getPoolTokenType */
|
|
54
|
+
getPoolTokenType(tickerOrName: string): string;
|
|
55
|
+
/** @see PerpConfigView.wlpType */
|
|
56
|
+
wlpType(): string;
|
|
57
|
+
/** @see PerpConfigView.getRewarders */
|
|
58
|
+
getRewarders(stakeAlias: string): {
|
|
59
|
+
alias: string;
|
|
60
|
+
rewarder_id: string;
|
|
61
|
+
coin_type: string;
|
|
62
|
+
decimals: number;
|
|
63
|
+
}[];
|
|
64
|
+
/** @see PerpConfigView.getRewarderTypes */
|
|
65
|
+
getRewarderTypes(stakeAlias: string): string[];
|
|
66
|
+
/** @see PerpConfigView.getCredit */
|
|
67
|
+
getCredit(): import("./config.ts").WaterxCreditPackage;
|
|
68
|
+
/** @see PerpConfigView.creditType */
|
|
69
|
+
creditType(): string;
|
|
70
|
+
/** @see PerpConfigView.getBridge */
|
|
71
|
+
getBridge(): import("./config.ts").WormholeBridgePackage;
|
|
72
|
+
/** @see PerpConfigView.wormholeStateId */
|
|
73
|
+
wormholeStateId(): string;
|
|
74
|
+
/** @see PerpConfigView.getNativeAssets */
|
|
75
|
+
getNativeAssets(): readonly import("./config.ts").NativeCustodyAsset[];
|
|
76
|
+
/** @see PerpConfigView.getNativeAsset */
|
|
77
|
+
getNativeAsset(moveType: string): import("./config.ts").NativeCustodyAsset;
|
|
78
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* WaterX Perp client — the perp product line (trading, orders, WLP, staking).
|
|
4
|
+
*
|
|
5
|
+
* One of the two sub-clients behind the umbrella `WaterXClient`; reachable as
|
|
6
|
+
* `client.perp` (which also carries the perp builders). Initialization is async —
|
|
7
|
+
* config is fetched from the canonical `waterx-config` JSON (default: GitHub raw).
|
|
8
|
+
* See `PerpClient.create()`.
|
|
9
|
+
*
|
|
10
|
+
* Composition: the gRPC transport half is inherited from {@link BaseLineClient}
|
|
11
|
+
* (shared with `PredictClient`); the canonical-schema lookups are delegated to a
|
|
12
|
+
* {@link PerpConfigView}. This class is just the wiring + factory between them.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PerpClient = void 0;
|
|
16
|
+
const base_client_ts_1 = require("../base-client.js");
|
|
17
|
+
const config_view_ts_1 = require("./config-view.js");
|
|
18
|
+
const config_ts_1 = require("./config.js");
|
|
19
|
+
class PerpClient extends base_client_ts_1.BaseLineClient {
|
|
20
|
+
/** Pyth infra (network defaults unless overridden in JSON). */
|
|
21
|
+
pyth;
|
|
22
|
+
/** Wormhole infra for the credit bridge (network defaults unless overridden). */
|
|
23
|
+
wormhole;
|
|
24
|
+
/** Canonical-schema lookups (delegated to below); no transport. */
|
|
25
|
+
view;
|
|
26
|
+
constructor(network, config, opts = {}) {
|
|
27
|
+
super(network, config, opts);
|
|
28
|
+
this.pyth = config.pyth ?? config_ts_1.PYTH_DEFAULTS[network];
|
|
29
|
+
this.wormhole = config.wormhole ?? config_ts_1.WORMHOLE_DEFAULTS[network];
|
|
30
|
+
this.view = new config_view_ts_1.PerpConfigView(() => this.config, () => this.wormhole);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Async factory: fetches the deployment config for `network` and returns
|
|
34
|
+
* a ready-to-use client. Pass `opts.cache=true` to memoize the JSON.
|
|
35
|
+
*/
|
|
36
|
+
static async create(network, opts = {}) {
|
|
37
|
+
const config = await (0, config_ts_1.loadConfig)(network, opts);
|
|
38
|
+
return new PerpClient(network, config, { grpcUrl: opts.grpcUrl });
|
|
39
|
+
}
|
|
40
|
+
static mainnet(opts = {}) {
|
|
41
|
+
return PerpClient.create("MAINNET", opts);
|
|
42
|
+
}
|
|
43
|
+
static testnet(opts = {}) {
|
|
44
|
+
return PerpClient.create("TESTNET", opts);
|
|
45
|
+
}
|
|
46
|
+
// ========================================================
|
|
47
|
+
// Config-schema lookups — delegated to PerpConfigView.
|
|
48
|
+
// (Kept on the client so the ~50 builders typed `PerpClient` call them
|
|
49
|
+
// directly, e.g. `client.wlpType()`. See perp-config-view.ts for docs.)
|
|
50
|
+
// ========================================================
|
|
51
|
+
/** @see PerpConfigView.getMarket */
|
|
52
|
+
getMarket(ticker) {
|
|
53
|
+
return this.view.getMarket(ticker);
|
|
54
|
+
}
|
|
55
|
+
/** @see PerpConfigView.getAggregator */
|
|
56
|
+
getAggregator(ticker) {
|
|
57
|
+
return this.view.getAggregator(ticker);
|
|
58
|
+
}
|
|
59
|
+
/** @see PerpConfigView.getPythFeed */
|
|
60
|
+
getPythFeed(ticker) {
|
|
61
|
+
return this.view.getPythFeed(ticker);
|
|
62
|
+
}
|
|
63
|
+
/** @see PerpConfigView.isConstantTicker */
|
|
64
|
+
isConstantTicker(ticker) {
|
|
65
|
+
return this.view.isConstantTicker(ticker);
|
|
66
|
+
}
|
|
67
|
+
/** @see PerpConfigView.getSupraRule */
|
|
68
|
+
getSupraRule() {
|
|
69
|
+
return this.view.getSupraRule();
|
|
70
|
+
}
|
|
71
|
+
/** @see PerpConfigView.getPoolTokenType */
|
|
72
|
+
getPoolTokenType(tickerOrName) {
|
|
73
|
+
return this.view.getPoolTokenType(tickerOrName);
|
|
74
|
+
}
|
|
75
|
+
/** @see PerpConfigView.wlpType */
|
|
76
|
+
wlpType() {
|
|
77
|
+
return this.view.wlpType();
|
|
78
|
+
}
|
|
79
|
+
/** @see PerpConfigView.getRewarders */
|
|
80
|
+
getRewarders(stakeAlias) {
|
|
81
|
+
return this.view.getRewarders(stakeAlias);
|
|
82
|
+
}
|
|
83
|
+
/** @see PerpConfigView.getRewarderTypes */
|
|
84
|
+
getRewarderTypes(stakeAlias) {
|
|
85
|
+
return this.view.getRewarderTypes(stakeAlias);
|
|
86
|
+
}
|
|
87
|
+
/** @see PerpConfigView.getCredit */
|
|
88
|
+
getCredit() {
|
|
89
|
+
return this.view.getCredit();
|
|
90
|
+
}
|
|
91
|
+
/** @see PerpConfigView.creditType */
|
|
92
|
+
creditType() {
|
|
93
|
+
return this.view.creditType();
|
|
94
|
+
}
|
|
95
|
+
/** @see PerpConfigView.getBridge */
|
|
96
|
+
getBridge() {
|
|
97
|
+
return this.view.getBridge();
|
|
98
|
+
}
|
|
99
|
+
/** @see PerpConfigView.wormholeStateId */
|
|
100
|
+
wormholeStateId() {
|
|
101
|
+
return this.view.wormholeStateId();
|
|
102
|
+
}
|
|
103
|
+
/** @see PerpConfigView.getNativeAssets */
|
|
104
|
+
getNativeAssets() {
|
|
105
|
+
return this.view.getNativeAssets();
|
|
106
|
+
}
|
|
107
|
+
/** @see PerpConfigView.getNativeAsset */
|
|
108
|
+
getNativeAsset(moveType) {
|
|
109
|
+
return this.view.getNativeAsset(moveType);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.PerpClient = PerpClient;
|