@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,211 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Per-ticker price aggregator. Stored as a DOF child on `Oracle`. */
|
|
5
|
+
import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
6
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
7
|
+
export declare const NewPriceAggregator: MoveStruct<{
|
|
8
|
+
aggregator_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
9
|
+
symbol: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
10
|
+
weight_threshold: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
11
|
+
outlier_tolerance_bps: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
12
|
+
}, "@waterx/oracle::aggregator::NewPriceAggregator">;
|
|
13
|
+
export declare const WeightUpdated: MoveStruct<{
|
|
14
|
+
aggregator_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
15
|
+
symbol: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
16
|
+
rule_type: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
17
|
+
weight: import("@mysten/sui/bcs").BcsType<number, number, "u8">;
|
|
18
|
+
}, "@waterx/oracle::aggregator::WeightUpdated">;
|
|
19
|
+
export declare const ThresholdUpdated: MoveStruct<{
|
|
20
|
+
aggregator_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
21
|
+
symbol: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
22
|
+
weight_threshold: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
23
|
+
}, "@waterx/oracle::aggregator::ThresholdUpdated">;
|
|
24
|
+
export declare const OutlierToleranceUpdated: MoveStruct<{
|
|
25
|
+
aggregator_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
26
|
+
symbol: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
27
|
+
outlier_tolerance_bps: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
28
|
+
}, "@waterx/oracle::aggregator::OutlierToleranceUpdated">;
|
|
29
|
+
export declare const PriceAggregated: MoveStruct<{
|
|
30
|
+
aggregator_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
31
|
+
symbol: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
32
|
+
sources: import("@mysten/sui/bcs").BcsType<string[], Iterable<string> & {
|
|
33
|
+
length: number;
|
|
34
|
+
}, string>;
|
|
35
|
+
prices: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
36
|
+
length: number;
|
|
37
|
+
}, string>;
|
|
38
|
+
weights: import("@mysten/sui/bcs").BcsType<number[], Iterable<number> & {
|
|
39
|
+
length: number;
|
|
40
|
+
}, string>;
|
|
41
|
+
current_threshold: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
42
|
+
result: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u128">;
|
|
43
|
+
timestamp_ms: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
44
|
+
}, "@waterx/oracle::aggregator::PriceAggregated">;
|
|
45
|
+
export declare const HistoricalPriceRegistered: MoveStruct<{
|
|
46
|
+
aggregator_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
47
|
+
symbol: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
48
|
+
sources: import("@mysten/sui/bcs").BcsType<string[], Iterable<string> & {
|
|
49
|
+
length: number;
|
|
50
|
+
}, string>;
|
|
51
|
+
prices: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
52
|
+
length: number;
|
|
53
|
+
}, string>;
|
|
54
|
+
weights: import("@mysten/sui/bcs").BcsType<number[], Iterable<number> & {
|
|
55
|
+
length: number;
|
|
56
|
+
}, string>;
|
|
57
|
+
current_threshold: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
58
|
+
result: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u128">;
|
|
59
|
+
timestamp_ms: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
60
|
+
}, "@waterx/oracle::aggregator::HistoricalPriceRegistered">;
|
|
61
|
+
export declare const PriceAggregator: MoveStruct<{
|
|
62
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
63
|
+
/** Ticker, e.g., `b"BTC_USD".to_string()`. */
|
|
64
|
+
symbol: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
65
|
+
/** Rule type -> weight. Entries with weight=0 are removed. */
|
|
66
|
+
weights: MoveStruct<{
|
|
67
|
+
contents: import("@mysten/sui/bcs").BcsType<{
|
|
68
|
+
key: {
|
|
69
|
+
name: string;
|
|
70
|
+
};
|
|
71
|
+
value: number;
|
|
72
|
+
}[], Iterable<{
|
|
73
|
+
key: {
|
|
74
|
+
name: string;
|
|
75
|
+
};
|
|
76
|
+
value: number;
|
|
77
|
+
}> & {
|
|
78
|
+
length: number;
|
|
79
|
+
}, string>;
|
|
80
|
+
}, "0x2::vec_map::VecMap<std::type_name::TypeName, u8>">;
|
|
81
|
+
/** Minimum total weight of contributing rules required to aggregate. */
|
|
82
|
+
weight_threshold: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
83
|
+
/** Maximum allowed deviation from the weighted-average price. */
|
|
84
|
+
outlier_tolerance: MoveStruct<{
|
|
85
|
+
value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u128">;
|
|
86
|
+
}, "bucket_v2_framework::float::Float">;
|
|
87
|
+
/** Latest aggregated price. */
|
|
88
|
+
latest_price: MoveStruct<{
|
|
89
|
+
value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u128">;
|
|
90
|
+
}, "bucket_v2_framework::float::Float">;
|
|
91
|
+
/** `clock.timestamp_ms()` at the time `aggregate` ran. */
|
|
92
|
+
last_update_ms: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
93
|
+
/** Number of exact timestamp snapshots stored as dynamic fields on this aggregator. */
|
|
94
|
+
history_count: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
95
|
+
}, "@waterx/oracle::aggregator::PriceAggregator">;
|
|
96
|
+
export interface SymbolArguments {
|
|
97
|
+
self: RawTransactionArgument<string>;
|
|
98
|
+
}
|
|
99
|
+
export interface SymbolOptions {
|
|
100
|
+
package?: string;
|
|
101
|
+
arguments: SymbolArguments | [
|
|
102
|
+
self: RawTransactionArgument<string>
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
export declare function symbol(options: SymbolOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
106
|
+
export interface WeightsArguments {
|
|
107
|
+
self: RawTransactionArgument<string>;
|
|
108
|
+
}
|
|
109
|
+
export interface WeightsOptions {
|
|
110
|
+
package?: string;
|
|
111
|
+
arguments: WeightsArguments | [
|
|
112
|
+
self: RawTransactionArgument<string>
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
export declare function weights(options: WeightsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
116
|
+
export interface WeightThresholdArguments {
|
|
117
|
+
self: RawTransactionArgument<string>;
|
|
118
|
+
}
|
|
119
|
+
export interface WeightThresholdOptions {
|
|
120
|
+
package?: string;
|
|
121
|
+
arguments: WeightThresholdArguments | [
|
|
122
|
+
self: RawTransactionArgument<string>
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
export declare function weightThreshold(options: WeightThresholdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
126
|
+
export interface OutlierToleranceArguments {
|
|
127
|
+
self: RawTransactionArgument<string>;
|
|
128
|
+
}
|
|
129
|
+
export interface OutlierToleranceOptions {
|
|
130
|
+
package?: string;
|
|
131
|
+
arguments: OutlierToleranceArguments | [
|
|
132
|
+
self: RawTransactionArgument<string>
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
export declare function outlierTolerance(options: OutlierToleranceOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
136
|
+
export interface LatestPriceArguments {
|
|
137
|
+
self: RawTransactionArgument<string>;
|
|
138
|
+
}
|
|
139
|
+
export interface LatestPriceOptions {
|
|
140
|
+
package?: string;
|
|
141
|
+
arguments: LatestPriceArguments | [
|
|
142
|
+
self: RawTransactionArgument<string>
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
export declare function latestPrice(options: LatestPriceOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
146
|
+
export interface LastUpdateMsArguments {
|
|
147
|
+
self: RawTransactionArgument<string>;
|
|
148
|
+
}
|
|
149
|
+
export interface LastUpdateMsOptions {
|
|
150
|
+
package?: string;
|
|
151
|
+
arguments: LastUpdateMsArguments | [
|
|
152
|
+
self: RawTransactionArgument<string>
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
export declare function lastUpdateMs(options: LastUpdateMsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
156
|
+
export interface HistoryCountArguments {
|
|
157
|
+
self: RawTransactionArgument<string>;
|
|
158
|
+
}
|
|
159
|
+
export interface HistoryCountOptions {
|
|
160
|
+
package?: string;
|
|
161
|
+
arguments: HistoryCountArguments | [
|
|
162
|
+
self: RawTransactionArgument<string>
|
|
163
|
+
];
|
|
164
|
+
}
|
|
165
|
+
export declare function historyCount(options: HistoryCountOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
166
|
+
export interface PriceAtTimestampArguments {
|
|
167
|
+
self: RawTransactionArgument<string>;
|
|
168
|
+
timestampMs: RawTransactionArgument<number | bigint | null>;
|
|
169
|
+
}
|
|
170
|
+
export interface PriceAtTimestampOptions {
|
|
171
|
+
package?: string;
|
|
172
|
+
arguments: PriceAtTimestampArguments | [
|
|
173
|
+
self: RawTransactionArgument<string>,
|
|
174
|
+
timestampMs: RawTransactionArgument<number | bigint | null>
|
|
175
|
+
];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Returns the latest price when `timestamp_ms` is `none`, otherwise the exact
|
|
179
|
+
* historical price written at `timestamp_ms`.
|
|
180
|
+
*/
|
|
181
|
+
export declare function priceAtTimestamp(options: PriceAtTimestampOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
182
|
+
export interface HasPriceAtTimestampArguments {
|
|
183
|
+
self: RawTransactionArgument<string>;
|
|
184
|
+
timestampMs: RawTransactionArgument<number | bigint>;
|
|
185
|
+
}
|
|
186
|
+
export interface HasPriceAtTimestampOptions {
|
|
187
|
+
package?: string;
|
|
188
|
+
arguments: HasPriceAtTimestampArguments | [
|
|
189
|
+
self: RawTransactionArgument<string>,
|
|
190
|
+
timestampMs: RawTransactionArgument<number | bigint>
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
export declare function hasPriceAtTimestamp(options: HasPriceAtTimestampOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
194
|
+
export interface RemovePriceAtTimestampArguments {
|
|
195
|
+
self: RawTransactionArgument<string>;
|
|
196
|
+
timestampMs: RawTransactionArgument<number | bigint>;
|
|
197
|
+
}
|
|
198
|
+
export interface RemovePriceAtTimestampOptions {
|
|
199
|
+
package?: string;
|
|
200
|
+
arguments: RemovePriceAtTimestampArguments | [
|
|
201
|
+
self: RawTransactionArgument<string>,
|
|
202
|
+
timestampMs: RawTransactionArgument<number | bigint>
|
|
203
|
+
];
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Removes the exact historical price snapshot at `timestamp_ms`.
|
|
207
|
+
*
|
|
208
|
+
* This only deletes history dynamic fields. It never changes `latest_price` or
|
|
209
|
+
* `last_update_ms`, so consumers can still read the latest oracle value.
|
|
210
|
+
*/
|
|
211
|
+
export declare function removePriceAtTimestamp(options: RemovePriceAtTimestampOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**************************************************************
|
|
3
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
4
|
+
**************************************************************/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.PriceAggregator = exports.HistoricalPriceRegistered = exports.PriceAggregated = exports.OutlierToleranceUpdated = exports.ThresholdUpdated = exports.WeightUpdated = exports.NewPriceAggregator = void 0;
|
|
40
|
+
exports.symbol = symbol;
|
|
41
|
+
exports.weights = weights;
|
|
42
|
+
exports.weightThreshold = weightThreshold;
|
|
43
|
+
exports.outlierTolerance = outlierTolerance;
|
|
44
|
+
exports.latestPrice = latestPrice;
|
|
45
|
+
exports.lastUpdateMs = lastUpdateMs;
|
|
46
|
+
exports.historyCount = historyCount;
|
|
47
|
+
exports.priceAtTimestamp = priceAtTimestamp;
|
|
48
|
+
exports.hasPriceAtTimestamp = hasPriceAtTimestamp;
|
|
49
|
+
exports.removePriceAtTimestamp = removePriceAtTimestamp;
|
|
50
|
+
/** Per-ticker price aggregator. Stored as a DOF child on `Oracle`. */
|
|
51
|
+
const index_ts_1 = require("../utils/index.js");
|
|
52
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
|
53
|
+
const vec_map = __importStar(require("./deps/sui/vec_map.js"));
|
|
54
|
+
const type_name = __importStar(require("./deps/std/type_name.js"));
|
|
55
|
+
const float = __importStar(require("./deps/bucket_v2_framework/float.js"));
|
|
56
|
+
const $moduleName = '@waterx/oracle::aggregator';
|
|
57
|
+
exports.NewPriceAggregator = new index_ts_1.MoveStruct({ name: `${$moduleName}::NewPriceAggregator`, fields: {
|
|
58
|
+
aggregator_id: bcs_1.bcs.Address,
|
|
59
|
+
symbol: bcs_1.bcs.string(),
|
|
60
|
+
weight_threshold: bcs_1.bcs.u64(),
|
|
61
|
+
outlier_tolerance_bps: bcs_1.bcs.u64()
|
|
62
|
+
} });
|
|
63
|
+
exports.WeightUpdated = new index_ts_1.MoveStruct({ name: `${$moduleName}::WeightUpdated`, fields: {
|
|
64
|
+
aggregator_id: bcs_1.bcs.Address,
|
|
65
|
+
symbol: bcs_1.bcs.string(),
|
|
66
|
+
rule_type: bcs_1.bcs.string(),
|
|
67
|
+
weight: bcs_1.bcs.u8()
|
|
68
|
+
} });
|
|
69
|
+
exports.ThresholdUpdated = new index_ts_1.MoveStruct({ name: `${$moduleName}::ThresholdUpdated`, fields: {
|
|
70
|
+
aggregator_id: bcs_1.bcs.Address,
|
|
71
|
+
symbol: bcs_1.bcs.string(),
|
|
72
|
+
weight_threshold: bcs_1.bcs.u64()
|
|
73
|
+
} });
|
|
74
|
+
exports.OutlierToleranceUpdated = new index_ts_1.MoveStruct({ name: `${$moduleName}::OutlierToleranceUpdated`, fields: {
|
|
75
|
+
aggregator_id: bcs_1.bcs.Address,
|
|
76
|
+
symbol: bcs_1.bcs.string(),
|
|
77
|
+
outlier_tolerance_bps: bcs_1.bcs.u64()
|
|
78
|
+
} });
|
|
79
|
+
exports.PriceAggregated = new index_ts_1.MoveStruct({ name: `${$moduleName}::PriceAggregated`, fields: {
|
|
80
|
+
aggregator_id: bcs_1.bcs.Address,
|
|
81
|
+
symbol: bcs_1.bcs.string(),
|
|
82
|
+
sources: bcs_1.bcs.vector(bcs_1.bcs.string()),
|
|
83
|
+
prices: bcs_1.bcs.vector(bcs_1.bcs.u128()),
|
|
84
|
+
weights: bcs_1.bcs.vector(bcs_1.bcs.u8()),
|
|
85
|
+
current_threshold: bcs_1.bcs.u64(),
|
|
86
|
+
result: bcs_1.bcs.u128(),
|
|
87
|
+
timestamp_ms: bcs_1.bcs.u64()
|
|
88
|
+
} });
|
|
89
|
+
exports.HistoricalPriceRegistered = new index_ts_1.MoveStruct({ name: `${$moduleName}::HistoricalPriceRegistered`, fields: {
|
|
90
|
+
aggregator_id: bcs_1.bcs.Address,
|
|
91
|
+
symbol: bcs_1.bcs.string(),
|
|
92
|
+
sources: bcs_1.bcs.vector(bcs_1.bcs.string()),
|
|
93
|
+
prices: bcs_1.bcs.vector(bcs_1.bcs.u128()),
|
|
94
|
+
weights: bcs_1.bcs.vector(bcs_1.bcs.u8()),
|
|
95
|
+
current_threshold: bcs_1.bcs.u64(),
|
|
96
|
+
result: bcs_1.bcs.u128(),
|
|
97
|
+
timestamp_ms: bcs_1.bcs.u64()
|
|
98
|
+
} });
|
|
99
|
+
exports.PriceAggregator = new index_ts_1.MoveStruct({ name: `${$moduleName}::PriceAggregator`, fields: {
|
|
100
|
+
id: bcs_1.bcs.Address,
|
|
101
|
+
/** Ticker, e.g., `b"BTC_USD".to_string()`. */
|
|
102
|
+
symbol: bcs_1.bcs.string(),
|
|
103
|
+
/** Rule type -> weight. Entries with weight=0 are removed. */
|
|
104
|
+
weights: vec_map.VecMap(type_name.TypeName, bcs_1.bcs.u8()),
|
|
105
|
+
/** Minimum total weight of contributing rules required to aggregate. */
|
|
106
|
+
weight_threshold: bcs_1.bcs.u64(),
|
|
107
|
+
/** Maximum allowed deviation from the weighted-average price. */
|
|
108
|
+
outlier_tolerance: float.Float,
|
|
109
|
+
/** Latest aggregated price. */
|
|
110
|
+
latest_price: float.Float,
|
|
111
|
+
/** `clock.timestamp_ms()` at the time `aggregate` ran. */
|
|
112
|
+
last_update_ms: bcs_1.bcs.u64(),
|
|
113
|
+
/** Number of exact timestamp snapshots stored as dynamic fields on this aggregator. */
|
|
114
|
+
history_count: bcs_1.bcs.u64()
|
|
115
|
+
} });
|
|
116
|
+
function symbol(options) {
|
|
117
|
+
const packageAddress = options.package ?? '@waterx/oracle';
|
|
118
|
+
const argumentsTypes = [
|
|
119
|
+
null
|
|
120
|
+
];
|
|
121
|
+
const parameterNames = ["self"];
|
|
122
|
+
return (tx) => tx.moveCall({
|
|
123
|
+
package: packageAddress,
|
|
124
|
+
module: 'aggregator',
|
|
125
|
+
function: 'symbol',
|
|
126
|
+
arguments: (0, index_ts_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function weights(options) {
|
|
130
|
+
const packageAddress = options.package ?? '@waterx/oracle';
|
|
131
|
+
const argumentsTypes = [
|
|
132
|
+
null
|
|
133
|
+
];
|
|
134
|
+
const parameterNames = ["self"];
|
|
135
|
+
return (tx) => tx.moveCall({
|
|
136
|
+
package: packageAddress,
|
|
137
|
+
module: 'aggregator',
|
|
138
|
+
function: 'weights',
|
|
139
|
+
arguments: (0, index_ts_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
function weightThreshold(options) {
|
|
143
|
+
const packageAddress = options.package ?? '@waterx/oracle';
|
|
144
|
+
const argumentsTypes = [
|
|
145
|
+
null
|
|
146
|
+
];
|
|
147
|
+
const parameterNames = ["self"];
|
|
148
|
+
return (tx) => tx.moveCall({
|
|
149
|
+
package: packageAddress,
|
|
150
|
+
module: 'aggregator',
|
|
151
|
+
function: 'weight_threshold',
|
|
152
|
+
arguments: (0, index_ts_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function outlierTolerance(options) {
|
|
156
|
+
const packageAddress = options.package ?? '@waterx/oracle';
|
|
157
|
+
const argumentsTypes = [
|
|
158
|
+
null
|
|
159
|
+
];
|
|
160
|
+
const parameterNames = ["self"];
|
|
161
|
+
return (tx) => tx.moveCall({
|
|
162
|
+
package: packageAddress,
|
|
163
|
+
module: 'aggregator',
|
|
164
|
+
function: 'outlier_tolerance',
|
|
165
|
+
arguments: (0, index_ts_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function latestPrice(options) {
|
|
169
|
+
const packageAddress = options.package ?? '@waterx/oracle';
|
|
170
|
+
const argumentsTypes = [
|
|
171
|
+
null
|
|
172
|
+
];
|
|
173
|
+
const parameterNames = ["self"];
|
|
174
|
+
return (tx) => tx.moveCall({
|
|
175
|
+
package: packageAddress,
|
|
176
|
+
module: 'aggregator',
|
|
177
|
+
function: 'latest_price',
|
|
178
|
+
arguments: (0, index_ts_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function lastUpdateMs(options) {
|
|
182
|
+
const packageAddress = options.package ?? '@waterx/oracle';
|
|
183
|
+
const argumentsTypes = [
|
|
184
|
+
null
|
|
185
|
+
];
|
|
186
|
+
const parameterNames = ["self"];
|
|
187
|
+
return (tx) => tx.moveCall({
|
|
188
|
+
package: packageAddress,
|
|
189
|
+
module: 'aggregator',
|
|
190
|
+
function: 'last_update_ms',
|
|
191
|
+
arguments: (0, index_ts_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
function historyCount(options) {
|
|
195
|
+
const packageAddress = options.package ?? '@waterx/oracle';
|
|
196
|
+
const argumentsTypes = [
|
|
197
|
+
null
|
|
198
|
+
];
|
|
199
|
+
const parameterNames = ["self"];
|
|
200
|
+
return (tx) => tx.moveCall({
|
|
201
|
+
package: packageAddress,
|
|
202
|
+
module: 'aggregator',
|
|
203
|
+
function: 'history_count',
|
|
204
|
+
arguments: (0, index_ts_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Returns the latest price when `timestamp_ms` is `none`, otherwise the exact
|
|
209
|
+
* historical price written at `timestamp_ms`.
|
|
210
|
+
*/
|
|
211
|
+
function priceAtTimestamp(options) {
|
|
212
|
+
const packageAddress = options.package ?? '@waterx/oracle';
|
|
213
|
+
const argumentsTypes = [
|
|
214
|
+
null,
|
|
215
|
+
'0x1::option::Option<u64>'
|
|
216
|
+
];
|
|
217
|
+
const parameterNames = ["self", "timestampMs"];
|
|
218
|
+
return (tx) => tx.moveCall({
|
|
219
|
+
package: packageAddress,
|
|
220
|
+
module: 'aggregator',
|
|
221
|
+
function: 'price_at_timestamp',
|
|
222
|
+
arguments: (0, index_ts_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
function hasPriceAtTimestamp(options) {
|
|
226
|
+
const packageAddress = options.package ?? '@waterx/oracle';
|
|
227
|
+
const argumentsTypes = [
|
|
228
|
+
null,
|
|
229
|
+
'u64'
|
|
230
|
+
];
|
|
231
|
+
const parameterNames = ["self", "timestampMs"];
|
|
232
|
+
return (tx) => tx.moveCall({
|
|
233
|
+
package: packageAddress,
|
|
234
|
+
module: 'aggregator',
|
|
235
|
+
function: 'has_price_at_timestamp',
|
|
236
|
+
arguments: (0, index_ts_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Removes the exact historical price snapshot at `timestamp_ms`.
|
|
241
|
+
*
|
|
242
|
+
* This only deletes history dynamic fields. It never changes `latest_price` or
|
|
243
|
+
* `last_update_ms`, so consumers can still read the latest oracle value.
|
|
244
|
+
*/
|
|
245
|
+
function removePriceAtTimestamp(options) {
|
|
246
|
+
const packageAddress = options.package ?? '@waterx/oracle';
|
|
247
|
+
const argumentsTypes = [
|
|
248
|
+
null,
|
|
249
|
+
'u64'
|
|
250
|
+
];
|
|
251
|
+
const parameterNames = ["self", "timestampMs"];
|
|
252
|
+
return (tx) => tx.moveCall({
|
|
253
|
+
package: packageAddress,
|
|
254
|
+
module: 'aggregator',
|
|
255
|
+
function: 'remove_price_at_timestamp',
|
|
256
|
+
arguments: (0, index_ts_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
257
|
+
});
|
|
258
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Hot-potato collector for oracle rules feeding prices for a single ticker. */
|
|
5
|
+
import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
6
|
+
import { type BcsType } from '@mysten/sui/bcs';
|
|
7
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
8
|
+
export declare const PriceObservation: MoveStruct<{
|
|
9
|
+
price: MoveStruct<{
|
|
10
|
+
value: BcsType<string, string | number | bigint, "u128">;
|
|
11
|
+
}, "bucket_v2_framework::float::Float">;
|
|
12
|
+
timestamp_ms: BcsType<string | null, string | number | bigint | null | undefined, "Option<u64>">;
|
|
13
|
+
}, "@waterx/oracle::collector::PriceObservation">;
|
|
14
|
+
export declare const PriceCollector: MoveStruct<{
|
|
15
|
+
symbol: BcsType<string, string, "string">;
|
|
16
|
+
contents: MoveStruct<{
|
|
17
|
+
contents: BcsType<{
|
|
18
|
+
key: {
|
|
19
|
+
name: string;
|
|
20
|
+
};
|
|
21
|
+
value: {
|
|
22
|
+
price: {
|
|
23
|
+
value: string;
|
|
24
|
+
};
|
|
25
|
+
timestamp_ms: string | null;
|
|
26
|
+
} | null;
|
|
27
|
+
}[], Iterable<{
|
|
28
|
+
key: {
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
value: {
|
|
32
|
+
price: {
|
|
33
|
+
value: string | number | bigint;
|
|
34
|
+
};
|
|
35
|
+
timestamp_ms: string | number | bigint | null | undefined;
|
|
36
|
+
} | null | undefined;
|
|
37
|
+
}> & {
|
|
38
|
+
length: number;
|
|
39
|
+
}, string>;
|
|
40
|
+
}, "0x2::vec_map::VecMap<std::type_name::TypeName, Option<@waterx/oracle::collector::PriceObservation>>">;
|
|
41
|
+
}, "@waterx/oracle::collector::PriceCollector">;
|
|
42
|
+
export interface SymbolArguments {
|
|
43
|
+
c: TransactionArgument;
|
|
44
|
+
}
|
|
45
|
+
export interface SymbolOptions {
|
|
46
|
+
package?: string;
|
|
47
|
+
arguments: SymbolArguments | [
|
|
48
|
+
c: TransactionArgument
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
export declare function symbol(options: SymbolOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
52
|
+
export interface ContentsArguments {
|
|
53
|
+
c: TransactionArgument;
|
|
54
|
+
}
|
|
55
|
+
export interface ContentsOptions {
|
|
56
|
+
package?: string;
|
|
57
|
+
arguments: ContentsArguments | [
|
|
58
|
+
c: TransactionArgument
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
export declare function contents(options: ContentsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
62
|
+
export interface CollectArguments<R extends BcsType<any>> {
|
|
63
|
+
c: TransactionArgument;
|
|
64
|
+
W: RawTransactionArgument<R>;
|
|
65
|
+
price: TransactionArgument;
|
|
66
|
+
}
|
|
67
|
+
export interface CollectOptions<R extends BcsType<any>> {
|
|
68
|
+
package?: string;
|
|
69
|
+
arguments: CollectArguments<R> | [
|
|
70
|
+
c: TransactionArgument,
|
|
71
|
+
W: RawTransactionArgument<R>,
|
|
72
|
+
price: TransactionArgument
|
|
73
|
+
];
|
|
74
|
+
typeArguments: [
|
|
75
|
+
string
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
/** A rule reports its observed price (or `none` if stale / unavailable). */
|
|
79
|
+
export declare function collect<R extends BcsType<any>>(options: CollectOptions<R>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
80
|
+
export interface CollectAtArguments<R extends BcsType<any>> {
|
|
81
|
+
c: TransactionArgument;
|
|
82
|
+
W: RawTransactionArgument<R>;
|
|
83
|
+
price: TransactionArgument;
|
|
84
|
+
timestampMs: RawTransactionArgument<number | bigint>;
|
|
85
|
+
}
|
|
86
|
+
export interface CollectAtOptions<R extends BcsType<any>> {
|
|
87
|
+
package?: string;
|
|
88
|
+
arguments: CollectAtArguments<R> | [
|
|
89
|
+
c: TransactionArgument,
|
|
90
|
+
W: RawTransactionArgument<R>,
|
|
91
|
+
price: TransactionArgument,
|
|
92
|
+
timestampMs: RawTransactionArgument<number | bigint>
|
|
93
|
+
];
|
|
94
|
+
typeArguments: [
|
|
95
|
+
string
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
/** A rule reports a price that is bound to an exact source timestamp. */
|
|
99
|
+
export declare function collectAt<R extends BcsType<any>>(options: CollectAtOptions<R>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
100
|
+
export interface ObservationPriceArguments {
|
|
101
|
+
o: TransactionArgument;
|
|
102
|
+
}
|
|
103
|
+
export interface ObservationPriceOptions {
|
|
104
|
+
package?: string;
|
|
105
|
+
arguments: ObservationPriceArguments | [
|
|
106
|
+
o: TransactionArgument
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
export declare function observationPrice(options: ObservationPriceOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
110
|
+
export interface ObservationTimestampMsArguments {
|
|
111
|
+
o: TransactionArgument;
|
|
112
|
+
}
|
|
113
|
+
export interface ObservationTimestampMsOptions {
|
|
114
|
+
package?: string;
|
|
115
|
+
arguments: ObservationTimestampMsArguments | [
|
|
116
|
+
o: TransactionArgument
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
export declare function observationTimestampMs(options: ObservationTimestampMsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|