@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,410 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.selectionArg = selectionArg;
|
|
4
|
+
exports.outcomeArg = outcomeArg;
|
|
5
|
+
exports.placeOrder = placeOrder;
|
|
6
|
+
exports.selfCancelOrder = selfCancelOrder;
|
|
7
|
+
exports.claim = claim;
|
|
8
|
+
exports.batchClaim = batchClaim;
|
|
9
|
+
exports.requestClose = requestClose;
|
|
10
|
+
exports.requestPartialClose = requestPartialClose;
|
|
11
|
+
exports.selfCancelClose = selfCancelClose;
|
|
12
|
+
exports.transferPosition = transferPosition;
|
|
13
|
+
exports.splitPosition = splitPosition;
|
|
14
|
+
exports.fillOrder = fillOrder;
|
|
15
|
+
exports.cancelOrder = cancelOrder;
|
|
16
|
+
exports.confirmClose = confirmClose;
|
|
17
|
+
exports.cancelClose = cancelClose;
|
|
18
|
+
exports.forceClaim = forceClaim;
|
|
19
|
+
exports.batchForceClaim = batchForceClaim;
|
|
20
|
+
exports.buildBatchForceClaimTransactions = buildBatchForceClaimTransactions;
|
|
21
|
+
exports.resolveMarket = resolveMarket;
|
|
22
|
+
exports.adminPlaceOrderFor = adminPlaceOrderFor;
|
|
23
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
24
|
+
const constants_ts_1 = require("./constants.js");
|
|
25
|
+
const utils_ts_1 = require("./utils.js");
|
|
26
|
+
function selectionArg(client, tx, selection, packageId) {
|
|
27
|
+
if (typeof selection !== "string")
|
|
28
|
+
return selection;
|
|
29
|
+
const validated = (0, utils_ts_1.assertSelection)(selection);
|
|
30
|
+
const fn = validated === "YES" ? "selection_yes" : "selection_no";
|
|
31
|
+
const [arg] = tx.moveCall({
|
|
32
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, packageId)}::position::${fn}`,
|
|
33
|
+
});
|
|
34
|
+
return arg;
|
|
35
|
+
}
|
|
36
|
+
function outcomeArg(client, tx, outcome, packageId) {
|
|
37
|
+
if (typeof outcome !== "string")
|
|
38
|
+
return outcome;
|
|
39
|
+
const validated = (0, utils_ts_1.assertOutcome)(outcome);
|
|
40
|
+
const fn = validated === "YES" ? "yes" : validated === "NO" ? "no" : "invalid";
|
|
41
|
+
const [arg] = tx.moveCall({
|
|
42
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, packageId)}::outcome::${fn}`,
|
|
43
|
+
});
|
|
44
|
+
return arg;
|
|
45
|
+
}
|
|
46
|
+
function placeOrder(client, tx, params) {
|
|
47
|
+
const pkg = (0, utils_ts_1.resolvePackageId)(client, params.packageId);
|
|
48
|
+
const senderRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
49
|
+
const receiverAccountId = params.receiverAccountId ?? params.accountId;
|
|
50
|
+
tx.moveCall({
|
|
51
|
+
target: `${pkg}::waterx_prediction::place_order`,
|
|
52
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
53
|
+
arguments: [
|
|
54
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
55
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
56
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
57
|
+
senderRequest,
|
|
58
|
+
(0, utils_ts_1.idArg)(tx, params.accountId),
|
|
59
|
+
(0, utils_ts_1.idArg)(tx, receiverAccountId),
|
|
60
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.maxSpend)),
|
|
61
|
+
(0, utils_ts_1.marketIdArg)(tx, params.marketId),
|
|
62
|
+
selectionArg(client, tx, params.selection, params.packageId),
|
|
63
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.minShares)),
|
|
64
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.priceCapBps)),
|
|
65
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.expiryTs)),
|
|
66
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
67
|
+
],
|
|
68
|
+
});
|
|
69
|
+
return tx;
|
|
70
|
+
}
|
|
71
|
+
function selfCancelOrder(client, tx, params) {
|
|
72
|
+
const senderRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
73
|
+
tx.moveCall({
|
|
74
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::self_cancel_order`,
|
|
75
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
76
|
+
arguments: [
|
|
77
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
78
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
79
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
80
|
+
senderRequest,
|
|
81
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.orderId)),
|
|
82
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
return tx;
|
|
86
|
+
}
|
|
87
|
+
function claim(client, tx, params) {
|
|
88
|
+
const senderRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
89
|
+
tx.moveCall({
|
|
90
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::claim`,
|
|
91
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
92
|
+
arguments: [
|
|
93
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
94
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
95
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
96
|
+
senderRequest,
|
|
97
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.positionId)),
|
|
98
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
99
|
+
],
|
|
100
|
+
});
|
|
101
|
+
return tx;
|
|
102
|
+
}
|
|
103
|
+
/** Chains multiple `claim` calls in one PTB, reusing a single account request. */
|
|
104
|
+
function batchClaim(client, tx, params) {
|
|
105
|
+
if (params.positionIds.length === 0) {
|
|
106
|
+
throw new Error("batchClaim: positionIds must not be empty");
|
|
107
|
+
}
|
|
108
|
+
const pkg = (0, utils_ts_1.resolvePackageId)(client, params.packageId);
|
|
109
|
+
const coinType = (0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType);
|
|
110
|
+
const globalConfig = tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig));
|
|
111
|
+
const marketRegistry = tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry));
|
|
112
|
+
const accountRegistry = tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry));
|
|
113
|
+
const senderRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
114
|
+
const clock = (0, utils_ts_1.clockArg)(tx);
|
|
115
|
+
for (const positionId of params.positionIds) {
|
|
116
|
+
tx.moveCall({
|
|
117
|
+
target: `${pkg}::waterx_prediction::claim`,
|
|
118
|
+
typeArguments: [coinType],
|
|
119
|
+
arguments: [
|
|
120
|
+
globalConfig,
|
|
121
|
+
marketRegistry,
|
|
122
|
+
accountRegistry,
|
|
123
|
+
senderRequest,
|
|
124
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(positionId)),
|
|
125
|
+
clock,
|
|
126
|
+
],
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return tx;
|
|
130
|
+
}
|
|
131
|
+
function requestClose(client, tx, params) {
|
|
132
|
+
const senderRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
133
|
+
tx.moveCall({
|
|
134
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::request_close`,
|
|
135
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
136
|
+
arguments: [
|
|
137
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
138
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
139
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
140
|
+
senderRequest,
|
|
141
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.positionId)),
|
|
142
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.minProceeds)),
|
|
143
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.expiryTs)),
|
|
144
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
145
|
+
],
|
|
146
|
+
});
|
|
147
|
+
return tx;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Account-backed partial sell. Splits `closeShares` off `positionId` into a new
|
|
151
|
+
* same-account position and runs the close flow on it; the remainder stays
|
|
152
|
+
* `Open` under `positionId`. The on-chain call returns the new PendingClose
|
|
153
|
+
* position id (read it from events / the returned move-call result if needed).
|
|
154
|
+
*/
|
|
155
|
+
function requestPartialClose(client, tx, params) {
|
|
156
|
+
const senderRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
157
|
+
tx.moveCall({
|
|
158
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::request_partial_close`,
|
|
159
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
160
|
+
arguments: [
|
|
161
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
162
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
163
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
164
|
+
senderRequest,
|
|
165
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.positionId)),
|
|
166
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.closeShares)),
|
|
167
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.minProceeds)),
|
|
168
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.expiryTs)),
|
|
169
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
170
|
+
],
|
|
171
|
+
});
|
|
172
|
+
return tx;
|
|
173
|
+
}
|
|
174
|
+
function selfCancelClose(client, tx, params) {
|
|
175
|
+
const senderRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
176
|
+
tx.moveCall({
|
|
177
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::self_cancel_close`,
|
|
178
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
179
|
+
arguments: [
|
|
180
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
181
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
182
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
183
|
+
senderRequest,
|
|
184
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.positionId)),
|
|
185
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
186
|
+
],
|
|
187
|
+
});
|
|
188
|
+
return tx;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Account-backed position transfer. The source account owner moves an open
|
|
192
|
+
* prediction position to another WXA account. Aborts if the position has a
|
|
193
|
+
* pending close.
|
|
194
|
+
*/
|
|
195
|
+
function transferPosition(client, tx, params) {
|
|
196
|
+
const senderRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
197
|
+
tx.moveCall({
|
|
198
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::transfer_position`,
|
|
199
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
200
|
+
arguments: [
|
|
201
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
202
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
203
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
204
|
+
senderRequest,
|
|
205
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.positionId)),
|
|
206
|
+
(0, utils_ts_1.idArg)(tx, params.recipientAccountId),
|
|
207
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
208
|
+
],
|
|
209
|
+
});
|
|
210
|
+
return tx;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Account-backed partial transfer. Splits an open position into two independent
|
|
214
|
+
* positions: the source keeps the remainder and the recipient receives a new
|
|
215
|
+
* position with proportional cost basis. The on-chain call returns the new
|
|
216
|
+
* position id (read it from events / the returned move-call result if needed).
|
|
217
|
+
*/
|
|
218
|
+
function splitPosition(client, tx, params) {
|
|
219
|
+
const senderRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
220
|
+
tx.moveCall({
|
|
221
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::split_position`,
|
|
222
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
223
|
+
arguments: [
|
|
224
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
225
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
226
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
227
|
+
senderRequest,
|
|
228
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.positionId)),
|
|
229
|
+
(0, utils_ts_1.idArg)(tx, params.recipientAccountId),
|
|
230
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.splitShares)),
|
|
231
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
232
|
+
],
|
|
233
|
+
});
|
|
234
|
+
return tx;
|
|
235
|
+
}
|
|
236
|
+
function fillOrder(client, tx, params) {
|
|
237
|
+
const keeperRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
238
|
+
tx.moveCall({
|
|
239
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::fill_order`,
|
|
240
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
241
|
+
arguments: [
|
|
242
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
243
|
+
keeperRequest,
|
|
244
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
245
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
246
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.orderId)),
|
|
247
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.filledShares)),
|
|
248
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.filledCost)),
|
|
249
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
250
|
+
],
|
|
251
|
+
});
|
|
252
|
+
return tx;
|
|
253
|
+
}
|
|
254
|
+
function cancelOrder(client, tx, params) {
|
|
255
|
+
const keeperRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
256
|
+
tx.moveCall({
|
|
257
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::cancel_order`,
|
|
258
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
259
|
+
arguments: [
|
|
260
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
261
|
+
keeperRequest,
|
|
262
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
263
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
264
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.orderId)),
|
|
265
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
266
|
+
],
|
|
267
|
+
});
|
|
268
|
+
return tx;
|
|
269
|
+
}
|
|
270
|
+
function confirmClose(client, tx, params) {
|
|
271
|
+
const keeperRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
272
|
+
tx.moveCall({
|
|
273
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::confirm_close`,
|
|
274
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
275
|
+
arguments: [
|
|
276
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
277
|
+
keeperRequest,
|
|
278
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
279
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
280
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.positionId)),
|
|
281
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.proceeds)),
|
|
282
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
283
|
+
],
|
|
284
|
+
});
|
|
285
|
+
return tx;
|
|
286
|
+
}
|
|
287
|
+
function cancelClose(client, tx, params) {
|
|
288
|
+
const keeperRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
289
|
+
tx.moveCall({
|
|
290
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::cancel_close`,
|
|
291
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
292
|
+
arguments: [
|
|
293
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
294
|
+
keeperRequest,
|
|
295
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
296
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
297
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.positionId)),
|
|
298
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
299
|
+
],
|
|
300
|
+
});
|
|
301
|
+
return tx;
|
|
302
|
+
}
|
|
303
|
+
function forceClaim(client, tx, params) {
|
|
304
|
+
const keeperRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
305
|
+
tx.moveCall({
|
|
306
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::force_claim`,
|
|
307
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
308
|
+
arguments: [
|
|
309
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
310
|
+
keeperRequest,
|
|
311
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
312
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
313
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.positionId)),
|
|
314
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
315
|
+
],
|
|
316
|
+
});
|
|
317
|
+
return tx;
|
|
318
|
+
}
|
|
319
|
+
/** Chains multiple `force_claim` calls in one PTB, reusing a single keeper request. */
|
|
320
|
+
function batchForceClaim(client, tx, params) {
|
|
321
|
+
if (params.positionIds.length === 0) {
|
|
322
|
+
throw new Error("batchForceClaim: positionIds must not be empty");
|
|
323
|
+
}
|
|
324
|
+
const pkg = (0, utils_ts_1.resolvePackageId)(client, params.packageId);
|
|
325
|
+
const coinType = (0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType);
|
|
326
|
+
const globalConfig = tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig));
|
|
327
|
+
const marketRegistry = tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry));
|
|
328
|
+
const accountRegistry = tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry));
|
|
329
|
+
const keeperRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
330
|
+
const clock = (0, utils_ts_1.clockArg)(tx);
|
|
331
|
+
for (const positionId of params.positionIds) {
|
|
332
|
+
tx.moveCall({
|
|
333
|
+
target: `${pkg}::waterx_prediction::force_claim`,
|
|
334
|
+
typeArguments: [coinType],
|
|
335
|
+
arguments: [
|
|
336
|
+
globalConfig,
|
|
337
|
+
keeperRequest,
|
|
338
|
+
marketRegistry,
|
|
339
|
+
accountRegistry,
|
|
340
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(positionId)),
|
|
341
|
+
clock,
|
|
342
|
+
],
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
return tx;
|
|
346
|
+
}
|
|
347
|
+
function assertPositiveIntegerChunkSize(chunkSize, fn) {
|
|
348
|
+
if (!Number.isInteger(chunkSize) || chunkSize <= 0) {
|
|
349
|
+
throw new Error(`${fn}: chunkSize must be a positive integer`);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
function chunkPositionIds(items, chunkSize) {
|
|
353
|
+
const chunks = [];
|
|
354
|
+
for (let i = 0; i < items.length; i += chunkSize) {
|
|
355
|
+
chunks.push(items.slice(i, i + chunkSize));
|
|
356
|
+
}
|
|
357
|
+
return chunks;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Splits `positionIds` into multiple PTBs, each with up to `chunkSize` `force_claim`
|
|
361
|
+
* calls. Returns one unsigned `Transaction` per chunk for keeper signing.
|
|
362
|
+
*/
|
|
363
|
+
function buildBatchForceClaimTransactions(client, params) {
|
|
364
|
+
if (params.positionIds.length === 0) {
|
|
365
|
+
throw new Error("buildBatchForceClaimTransactions: positionIds must not be empty");
|
|
366
|
+
}
|
|
367
|
+
const { positionIds, chunkSize = constants_ts_1.DEFAULT_FORCE_CLAIM_CHUNK_SIZE, ...batchParams } = params;
|
|
368
|
+
assertPositiveIntegerChunkSize(chunkSize, "buildBatchForceClaimTransactions");
|
|
369
|
+
return chunkPositionIds(positionIds, chunkSize).map((ids) => {
|
|
370
|
+
const tx = new transactions_1.Transaction();
|
|
371
|
+
batchForceClaim(client, tx, { ...batchParams, positionIds: ids });
|
|
372
|
+
return tx;
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
function resolveMarket(client, tx, params) {
|
|
376
|
+
const keeperRequest = (0, utils_ts_1.createAccountRequest)(client, tx, params);
|
|
377
|
+
tx.moveCall({
|
|
378
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::resolve_market`,
|
|
379
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
380
|
+
arguments: [
|
|
381
|
+
tx.object((0, utils_ts_1.resolveGlobalConfig)(client, params.globalConfig)),
|
|
382
|
+
keeperRequest,
|
|
383
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
384
|
+
(0, utils_ts_1.marketIdArg)(tx, params.marketId),
|
|
385
|
+
outcomeArg(client, tx, params.outcome, params.packageId),
|
|
386
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
387
|
+
],
|
|
388
|
+
});
|
|
389
|
+
return tx;
|
|
390
|
+
}
|
|
391
|
+
function adminPlaceOrderFor(client, tx, params) {
|
|
392
|
+
tx.moveCall({
|
|
393
|
+
target: `${(0, utils_ts_1.resolvePackageId)(client, params.packageId)}::waterx_prediction::admin_place_order_for`,
|
|
394
|
+
typeArguments: [(0, utils_ts_1.resolveSettlementCoinType)(client, params.settlementCoinType)],
|
|
395
|
+
arguments: [
|
|
396
|
+
(0, utils_ts_1.objectArg)(tx, params.adminCap),
|
|
397
|
+
tx.object((0, utils_ts_1.resolveMarketRegistry)(client, params.marketRegistry)),
|
|
398
|
+
tx.object((0, utils_ts_1.resolveAccountRegistry)(client, params.accountRegistry)),
|
|
399
|
+
(0, utils_ts_1.objectArg)(tx, params.payment),
|
|
400
|
+
(0, utils_ts_1.idArg)(tx, params.accountId),
|
|
401
|
+
(0, utils_ts_1.marketIdArg)(tx, params.marketId),
|
|
402
|
+
selectionArg(client, tx, params.selection, params.packageId),
|
|
403
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.minShares)),
|
|
404
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.priceCapBps)),
|
|
405
|
+
tx.pure.u64((0, utils_ts_1.toBigInt)(params.expiryTs)),
|
|
406
|
+
(0, utils_ts_1.clockArg)(tx),
|
|
407
|
+
],
|
|
408
|
+
});
|
|
409
|
+
return tx;
|
|
410
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Async high-level prediction PTB builders with optional pre-sweep of parked
|
|
3
|
+
* backing assets into wxUSD credit ({@link appendConsolidateForSpend}).
|
|
4
|
+
*
|
|
5
|
+
* Takes both `AccountClientLike` (native_custody / consolidate) and `PredictClient`
|
|
6
|
+
* because sync prediction builders only target the prediction deployment.
|
|
7
|
+
*
|
|
8
|
+
* FE/BE tx services should call these instead of hand-composing
|
|
9
|
+
* `appendConsolidateForSpend` before `placeOrder` / `batchClaim`.
|
|
10
|
+
*/
|
|
11
|
+
import { Transaction } from "@mysten/sui/transactions";
|
|
12
|
+
import type { AccountClientLike } from "../account/client.ts";
|
|
13
|
+
import type { PredictClient } from "./client.ts";
|
|
14
|
+
import { type BatchClaimParams, type PlaceOrderParams } from "./prediction.ts";
|
|
15
|
+
export interface PredictCommonBuildOpts {
|
|
16
|
+
tx?: Transaction;
|
|
17
|
+
/**
|
|
18
|
+
* Pre-sweep parked backing assets (USDC, USDsui, …) and address CREDIT at
|
|
19
|
+
* the wxa account's address into spendable wxUSD before the main action —
|
|
20
|
+
* same semantics as perp {@link CommonBuildOpts.consolidateToUsd}. Default:
|
|
21
|
+
* `true`.
|
|
22
|
+
*
|
|
23
|
+
* Requires `accountId` to be a plain address string (not a PTB argument).
|
|
24
|
+
* When `accountId` is a dynamic `TransactionArgument`, the sweep is skipped.
|
|
25
|
+
*/
|
|
26
|
+
consolidateToUsd?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export type BuildPlaceOrderTxParams = PlaceOrderParams & PredictCommonBuildOpts;
|
|
29
|
+
/** Same as {@link BatchClaimParams} plus `accountId` for the consolidate probe. */
|
|
30
|
+
export interface BuildBatchClaimTxParams extends BatchClaimParams, PredictCommonBuildOpts {
|
|
31
|
+
/** wxa account object id — owner address for the pre-sweep probe. */
|
|
32
|
+
accountId: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Optional pre-sweep + {@link placeOrder} in one PTB.
|
|
36
|
+
*
|
|
37
|
+
* @param perpClient — perp deployment (native_custody probe + PSM mint legs)
|
|
38
|
+
* @param predictClient — prediction deployment (place_order MoveCall)
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildPlaceOrderTx(perpClient: AccountClientLike, predictClient: PredictClient, params: BuildPlaceOrderTxParams): Promise<Transaction>;
|
|
41
|
+
/**
|
|
42
|
+
* Optional pre-sweep + {@link batchClaim} in one PTB.
|
|
43
|
+
*/
|
|
44
|
+
export declare function buildBatchClaimTx(perpClient: AccountClientLike, predictClient: PredictClient, params: BuildBatchClaimTxParams): Promise<Transaction>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildPlaceOrderTx = buildPlaceOrderTx;
|
|
4
|
+
exports.buildBatchClaimTx = buildBatchClaimTx;
|
|
5
|
+
/**
|
|
6
|
+
* Async high-level prediction PTB builders with optional pre-sweep of parked
|
|
7
|
+
* backing assets into wxUSD credit ({@link appendConsolidateForSpend}).
|
|
8
|
+
*
|
|
9
|
+
* Takes both `AccountClientLike` (native_custody / consolidate) and `PredictClient`
|
|
10
|
+
* because sync prediction builders only target the prediction deployment.
|
|
11
|
+
*
|
|
12
|
+
* FE/BE tx services should call these instead of hand-composing
|
|
13
|
+
* `appendConsolidateForSpend` before `placeOrder` / `batchClaim`.
|
|
14
|
+
*/
|
|
15
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
16
|
+
const consolidate_ts_1 = require("../account/funding/consolidate.js");
|
|
17
|
+
const prediction_ts_1 = require("./prediction.js");
|
|
18
|
+
function newTx(opts) {
|
|
19
|
+
return opts?.tx ?? new transactions_1.Transaction();
|
|
20
|
+
}
|
|
21
|
+
async function maybeConsolidate(perpClient, tx, accountId, opts) {
|
|
22
|
+
if (opts?.consolidateToUsd === false)
|
|
23
|
+
return;
|
|
24
|
+
if (typeof accountId !== "string")
|
|
25
|
+
return;
|
|
26
|
+
await (0, consolidate_ts_1.appendConsolidateForSpend)(perpClient, tx, accountId);
|
|
27
|
+
}
|
|
28
|
+
function stripPlaceOrderParams(params) {
|
|
29
|
+
const { tx: _tx, consolidateToUsd: _consolidate, ...rest } = params;
|
|
30
|
+
return rest;
|
|
31
|
+
}
|
|
32
|
+
function stripBatchClaimParams(params) {
|
|
33
|
+
const { tx: _tx, consolidateToUsd: _consolidate, accountId: _accountId, ...rest } = params;
|
|
34
|
+
return rest;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Optional pre-sweep + {@link placeOrder} in one PTB.
|
|
38
|
+
*
|
|
39
|
+
* @param perpClient — perp deployment (native_custody probe + PSM mint legs)
|
|
40
|
+
* @param predictClient — prediction deployment (place_order MoveCall)
|
|
41
|
+
*/
|
|
42
|
+
async function buildPlaceOrderTx(perpClient, predictClient, params) {
|
|
43
|
+
const tx = newTx(params);
|
|
44
|
+
await maybeConsolidate(perpClient, tx, params.accountId, params);
|
|
45
|
+
(0, prediction_ts_1.placeOrder)(predictClient, tx, stripPlaceOrderParams(params));
|
|
46
|
+
return tx;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Optional pre-sweep + {@link batchClaim} in one PTB.
|
|
50
|
+
*/
|
|
51
|
+
async function buildBatchClaimTx(perpClient, predictClient, params) {
|
|
52
|
+
const tx = newTx(params);
|
|
53
|
+
await maybeConsolidate(perpClient, tx, params.accountId, params);
|
|
54
|
+
(0, prediction_ts_1.batchClaim)(predictClient, tx, stripBatchClaimParams(params));
|
|
55
|
+
return tx;
|
|
56
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { TransactionArgument } from "@mysten/sui/transactions";
|
|
2
|
+
export type ObjectArgument = string | TransactionArgument;
|
|
3
|
+
export type IdArgument = string | TransactionArgument;
|
|
4
|
+
export type Selection = "NO" | "YES";
|
|
5
|
+
export type Outcome = "NO" | "YES" | "INVALID";
|
|
6
|
+
export type OrderKind = "OPEN" | "CLOSE";
|
|
7
|
+
export type PositionStatus = "OPEN" | "PENDING_CLOSE";
|
|
8
|
+
export type MarketIdInput = string | Uint8Array | number[];
|
|
9
|
+
export interface AccountIdentityParams {
|
|
10
|
+
bucketAccount?: ObjectArgument;
|
|
11
|
+
}
|
|
12
|
+
export interface RegistryView {
|
|
13
|
+
balance: bigint;
|
|
14
|
+
minReserve: bigint;
|
|
15
|
+
orderCancelCooldownMs: bigint;
|
|
16
|
+
nextOrderId: bigint;
|
|
17
|
+
nextPositionId: bigint;
|
|
18
|
+
orderCount: bigint;
|
|
19
|
+
positionCount: bigint;
|
|
20
|
+
unresolvedMarketCount: bigint;
|
|
21
|
+
resolvedMarketCount: bigint;
|
|
22
|
+
}
|
|
23
|
+
export interface OrderView {
|
|
24
|
+
orderId: bigint;
|
|
25
|
+
kind: OrderKind;
|
|
26
|
+
accountId: string;
|
|
27
|
+
receiverAccountId: string;
|
|
28
|
+
marketId: Uint8Array;
|
|
29
|
+
marketIdHex: string;
|
|
30
|
+
selection: Selection;
|
|
31
|
+
positionId: bigint | null;
|
|
32
|
+
maxSpend: bigint;
|
|
33
|
+
minShares: bigint;
|
|
34
|
+
priceCapBps: bigint;
|
|
35
|
+
minProceeds: bigint;
|
|
36
|
+
expiryTs: bigint;
|
|
37
|
+
selfCancelAfterTs: bigint;
|
|
38
|
+
createdTs: bigint;
|
|
39
|
+
byAdmin: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface PositionView {
|
|
42
|
+
positionId: bigint;
|
|
43
|
+
accountId: string;
|
|
44
|
+
marketId: Uint8Array;
|
|
45
|
+
marketIdHex: string;
|
|
46
|
+
selection: Selection;
|
|
47
|
+
status: PositionStatus;
|
|
48
|
+
filledShares: bigint;
|
|
49
|
+
filledCost: bigint;
|
|
50
|
+
openedTs: bigint;
|
|
51
|
+
payout: bigint;
|
|
52
|
+
closeOrderId: bigint | null;
|
|
53
|
+
closeMinProceeds: bigint;
|
|
54
|
+
closeExpiryTs: bigint;
|
|
55
|
+
closeSelfCancelAfterTs: bigint;
|
|
56
|
+
}
|
|
57
|
+
export interface MarketView {
|
|
58
|
+
marketKey: bigint;
|
|
59
|
+
marketId: Uint8Array;
|
|
60
|
+
marketIdHex: string;
|
|
61
|
+
resolved: boolean;
|
|
62
|
+
paused: boolean;
|
|
63
|
+
outcome: Outcome | null;
|
|
64
|
+
unclaimedCount: bigint;
|
|
65
|
+
yesShares: bigint;
|
|
66
|
+
yesCost: bigint;
|
|
67
|
+
noShares: bigint;
|
|
68
|
+
noCost: bigint;
|
|
69
|
+
}
|
|
70
|
+
export interface MarketExposure {
|
|
71
|
+
yesShares: bigint;
|
|
72
|
+
yesCost: bigint;
|
|
73
|
+
noShares: bigint;
|
|
74
|
+
noCost: bigint;
|
|
75
|
+
}
|
|
76
|
+
export interface AccountDataView {
|
|
77
|
+
accountId: string;
|
|
78
|
+
hasData: boolean;
|
|
79
|
+
orderCount: bigint;
|
|
80
|
+
positionCount: bigint;
|
|
81
|
+
orderFront: bigint | null;
|
|
82
|
+
orderBack: bigint | null;
|
|
83
|
+
positionFront: bigint | null;
|
|
84
|
+
positionBack: bigint | null;
|
|
85
|
+
}
|
|
86
|
+
export interface CursorView {
|
|
87
|
+
count: bigint;
|
|
88
|
+
front: bigint | null;
|
|
89
|
+
back: bigint | null;
|
|
90
|
+
}
|
|
91
|
+
export interface CoinRef {
|
|
92
|
+
objectId: string;
|
|
93
|
+
version: string | bigint | number;
|
|
94
|
+
digest: string;
|
|
95
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { addDelegate, allowPredictionProtocolAsset, consumeDepositDirect, createAccount, deposit, disallowPredictionProtocolAsset, removeDelegate, requestDeposit, requestDepositFromReceivings, requestWithdraw, setDelegatePredictionPermission, transferCoinToAccount, whitelistPredictionProtocol, } from "../account.ts";
|
|
2
|
+
export type { AddDelegateParams, ConsumeDepositDirectParams, CreateAccountParams, PredictionProtocolAssetParams, RemoveDelegateParams, RequestDepositFromReceivingsParams, RequestDepositParams, RequestWithdrawParams, SetDelegatePredictionPermissionParams, TransferCoinToAccountParams, WhitelistPredictionProtocolParams, } from "../account.ts";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.whitelistPredictionProtocol = exports.transferCoinToAccount = exports.setDelegatePredictionPermission = exports.requestWithdraw = exports.requestDepositFromReceivings = exports.requestDeposit = exports.removeDelegate = exports.disallowPredictionProtocolAsset = exports.deposit = exports.createAccount = exports.consumeDepositDirect = exports.allowPredictionProtocolAsset = exports.addDelegate = void 0;
|
|
4
|
+
var account_ts_1 = require("../account.js");
|
|
5
|
+
Object.defineProperty(exports, "addDelegate", { enumerable: true, get: function () { return account_ts_1.addDelegate; } });
|
|
6
|
+
Object.defineProperty(exports, "allowPredictionProtocolAsset", { enumerable: true, get: function () { return account_ts_1.allowPredictionProtocolAsset; } });
|
|
7
|
+
Object.defineProperty(exports, "consumeDepositDirect", { enumerable: true, get: function () { return account_ts_1.consumeDepositDirect; } });
|
|
8
|
+
Object.defineProperty(exports, "createAccount", { enumerable: true, get: function () { return account_ts_1.createAccount; } });
|
|
9
|
+
Object.defineProperty(exports, "deposit", { enumerable: true, get: function () { return account_ts_1.deposit; } });
|
|
10
|
+
Object.defineProperty(exports, "disallowPredictionProtocolAsset", { enumerable: true, get: function () { return account_ts_1.disallowPredictionProtocolAsset; } });
|
|
11
|
+
Object.defineProperty(exports, "removeDelegate", { enumerable: true, get: function () { return account_ts_1.removeDelegate; } });
|
|
12
|
+
Object.defineProperty(exports, "requestDeposit", { enumerable: true, get: function () { return account_ts_1.requestDeposit; } });
|
|
13
|
+
Object.defineProperty(exports, "requestDepositFromReceivings", { enumerable: true, get: function () { return account_ts_1.requestDepositFromReceivings; } });
|
|
14
|
+
Object.defineProperty(exports, "requestWithdraw", { enumerable: true, get: function () { return account_ts_1.requestWithdraw; } });
|
|
15
|
+
Object.defineProperty(exports, "setDelegatePredictionPermission", { enumerable: true, get: function () { return account_ts_1.setDelegatePredictionPermission; } });
|
|
16
|
+
Object.defineProperty(exports, "transferCoinToAccount", { enumerable: true, get: function () { return account_ts_1.transferCoinToAccount; } });
|
|
17
|
+
Object.defineProperty(exports, "whitelistPredictionProtocol", { enumerable: true, get: function () { return account_ts_1.whitelistPredictionProtocol; } });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { adminPlaceOrderFor } from "../prediction.ts";
|
|
2
|
+
export type { AdminPlaceOrderForParams } from "../prediction.ts";
|
|
3
|
+
export { allowPredictionProtocolAsset, disallowPredictionProtocolAsset, whitelistPredictionProtocol, } from "../account.ts";
|
|
4
|
+
export type { PredictionProtocolAssetParams, WhitelistPredictionProtocolParams, } from "../account.ts";
|
|
5
|
+
export { addKeeper, adminWithdraw, createMarketRegistry, depositSettlement, pauseMarket, removeKeeper, setMinReserve, setOrderCancelCooldownMs, unpauseMarket, } from "../admin.ts";
|
|
6
|
+
export type { AdminWithdrawParams, CreateMarketRegistryParams, DepositSettlementParams, KeeperAdminParams, MarketPauseParams, SetMinReserveParams, SetOrderCancelCooldownParams, } from "../admin.ts";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unpauseMarket = exports.setOrderCancelCooldownMs = exports.setMinReserve = exports.removeKeeper = exports.pauseMarket = exports.depositSettlement = exports.createMarketRegistry = exports.adminWithdraw = exports.addKeeper = exports.whitelistPredictionProtocol = exports.disallowPredictionProtocolAsset = exports.allowPredictionProtocolAsset = exports.adminPlaceOrderFor = void 0;
|
|
4
|
+
var prediction_ts_1 = require("../prediction.js");
|
|
5
|
+
Object.defineProperty(exports, "adminPlaceOrderFor", { enumerable: true, get: function () { return prediction_ts_1.adminPlaceOrderFor; } });
|
|
6
|
+
var account_ts_1 = require("../account.js");
|
|
7
|
+
Object.defineProperty(exports, "allowPredictionProtocolAsset", { enumerable: true, get: function () { return account_ts_1.allowPredictionProtocolAsset; } });
|
|
8
|
+
Object.defineProperty(exports, "disallowPredictionProtocolAsset", { enumerable: true, get: function () { return account_ts_1.disallowPredictionProtocolAsset; } });
|
|
9
|
+
Object.defineProperty(exports, "whitelistPredictionProtocol", { enumerable: true, get: function () { return account_ts_1.whitelistPredictionProtocol; } });
|
|
10
|
+
var admin_ts_1 = require("../admin.js");
|
|
11
|
+
Object.defineProperty(exports, "addKeeper", { enumerable: true, get: function () { return admin_ts_1.addKeeper; } });
|
|
12
|
+
Object.defineProperty(exports, "adminWithdraw", { enumerable: true, get: function () { return admin_ts_1.adminWithdraw; } });
|
|
13
|
+
Object.defineProperty(exports, "createMarketRegistry", { enumerable: true, get: function () { return admin_ts_1.createMarketRegistry; } });
|
|
14
|
+
Object.defineProperty(exports, "depositSettlement", { enumerable: true, get: function () { return admin_ts_1.depositSettlement; } });
|
|
15
|
+
Object.defineProperty(exports, "pauseMarket", { enumerable: true, get: function () { return admin_ts_1.pauseMarket; } });
|
|
16
|
+
Object.defineProperty(exports, "removeKeeper", { enumerable: true, get: function () { return admin_ts_1.removeKeeper; } });
|
|
17
|
+
Object.defineProperty(exports, "setMinReserve", { enumerable: true, get: function () { return admin_ts_1.setMinReserve; } });
|
|
18
|
+
Object.defineProperty(exports, "setOrderCancelCooldownMs", { enumerable: true, get: function () { return admin_ts_1.setOrderCancelCooldownMs; } });
|
|
19
|
+
Object.defineProperty(exports, "unpauseMarket", { enumerable: true, get: function () { return admin_ts_1.unpauseMarket; } });
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { base64UrlNoPadDecode, base64UrlNoPadEncode, buildClaimShareFlow, buildCreateGiftFlow, buildGiftClaimMessage, claimShare, createGift, deleteGift, deriveGiftAddress, deriveGiftKeypair, encodeGiftUrl, generateGiftSeed, getCreatorGiftCount, getCreatorGiftIds, getGift, getGiftConfigPaused, getGiftControllerAddress, getGiftHasClaimed, parseGiftUrl, signGiftClaim, } from "../gift.ts";
|
|
2
|
+
export type { BuildClaimShareFlowParams, BuildClaimShareFlowResult, BuildCreateGiftFlowResult, ClaimShareParams, CreateGiftParams, DeleteGiftParams, GiftBaseParams, GiftReferralParams, GiftUrlParts, GiftView, } from "../gift.ts";
|