@waterx/sdk 2.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/LICENSE +21 -0
- package/README.md +204 -0
- package/dist/src/client.d.ts +109 -0
- package/dist/src/client.js +197 -0
- package/dist/src/config.d.ts +229 -0
- package/dist/src/config.js +107 -0
- package/dist/src/constants.d.ts +64 -0
- package/dist/src/constants.js +71 -0
- package/dist/src/fetch.d.ts +144 -0
- package/dist/src/fetch.js +419 -0
- package/dist/src/generated/bucket_v2_framework/account.d.ts +107 -0
- package/dist/src/generated/bucket_v2_framework/account.js +129 -0
- package/dist/src/generated/bucket_v2_framework/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/bucket_v2_framework/deps/std/type_name.js +19 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/balance.js +14 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/bucket_v2_framework/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/bucket_v2_framework/double.d.ts +384 -0
- package/dist/src/generated/bucket_v2_framework/double.js +466 -0
- package/dist/src/generated/bucket_v2_framework/float.d.ts +364 -0
- package/dist/src/generated/bucket_v2_framework/float.js +440 -0
- package/dist/src/generated/bucket_v2_framework/liability.d.ts +197 -0
- package/dist/src/generated/bucket_v2_framework/liability.js +205 -0
- package/dist/src/generated/bucket_v2_framework/linked_table.d.ts +384 -0
- package/dist/src/generated/bucket_v2_framework/linked_table.js +382 -0
- package/dist/src/generated/bucket_v2_framework/sheet.d.ts +424 -0
- package/dist/src/generated/bucket_v2_framework/sheet.js +344 -0
- package/dist/src/generated/native_custody/custody_vault.d.ts +572 -0
- package/dist/src/generated/native_custody/custody_vault.js +483 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/float.js +10 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/liability.d.ts +11 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/liability.js +13 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/sheet.d.ts +49 -0
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/sheet.js +18 -0
- package/dist/src/generated/native_custody/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/native_custody/deps/std/type_name.js +19 -0
- package/dist/src/generated/native_custody/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/native_custody/deps/sui/balance.js +14 -0
- package/dist/src/generated/native_custody/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/native_custody/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/native_custody/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/native_custody/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/native_custody/events.d.ts +36 -0
- package/dist/src/generated/native_custody/events.js +36 -0
- package/dist/src/generated/pyth_sponsor_rule/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/pyth_sponsor_rule/deps/sui/balance.js +14 -0
- package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.d.ts +68 -0
- package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.js +74 -0
- package/dist/src/generated/utils/index.d.ts +30 -0
- package/dist/src/generated/utils/index.js +157 -0
- package/dist/src/generated/waterx_account/account.d.ts +1818 -0
- package/dist/src/generated/waterx_account/account.js +1723 -0
- package/dist/src/generated/waterx_account/deps/bucket_v2_framework/liability.d.ts +11 -0
- package/dist/src/generated/waterx_account/deps/bucket_v2_framework/liability.js +13 -0
- package/dist/src/generated/waterx_account/deps/bucket_v2_framework/sheet.d.ts +49 -0
- package/dist/src/generated/waterx_account/deps/bucket_v2_framework/sheet.js +18 -0
- package/dist/src/generated/waterx_account/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/waterx_account/deps/std/type_name.js +19 -0
- package/dist/src/generated/waterx_account/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/waterx_account/deps/sui/balance.js +14 -0
- package/dist/src/generated/waterx_account/deps/sui/object_table.d.ts +17 -0
- package/dist/src/generated/waterx_account/deps/sui/object_table.js +19 -0
- package/dist/src/generated/waterx_account/deps/sui/table.d.ts +29 -0
- package/dist/src/generated/waterx_account/deps/sui/table.js +31 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_account/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_account/direct_rule.d.ts +77 -0
- package/dist/src/generated/waterx_account/direct_rule.js +78 -0
- package/dist/src/generated/waterx_account/events.d.ts +180 -0
- package/dist/src/generated/waterx_account/events.js +156 -0
- package/dist/src/generated/waterx_account/version.d.ts +10 -0
- package/dist/src/generated/waterx_account/version.js +8 -0
- package/dist/src/generated/waterx_credit/credit_registry.d.ts +708 -0
- package/dist/src/generated/waterx_credit/credit_registry.js +658 -0
- package/dist/src/generated/waterx_credit/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/waterx_credit/deps/std/type_name.js +19 -0
- package/dist/src/generated/waterx_credit/deps/sui/table.d.ts +29 -0
- package/dist/src/generated/waterx_credit/deps/sui/table.js +31 -0
- package/dist/src/generated/waterx_credit/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_credit/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_credit/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_credit/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_credit/limited_supply.d.ts +107 -0
- package/dist/src/generated/waterx_credit/limited_supply.js +131 -0
- package/dist/src/generated/waterx_oracle/aggregator.d.ts +211 -0
- package/dist/src/generated/waterx_oracle/aggregator.js +213 -0
- package/dist/src/generated/waterx_oracle/collector.d.ts +119 -0
- package/dist/src/generated/waterx_oracle/collector.js +105 -0
- package/dist/src/generated/waterx_oracle/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/src/generated/waterx_oracle/deps/bucket_v2_framework/float.js +10 -0
- package/dist/src/generated/waterx_oracle/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/waterx_oracle/deps/std/type_name.js +19 -0
- package/dist/src/generated/waterx_oracle/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_oracle/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_oracle/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_oracle/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_oracle/oracle.d.ts +298 -0
- package/dist/src/generated/waterx_oracle/oracle.js +323 -0
- package/dist/src/generated/waterx_oracle/version.d.ts +10 -0
- package/dist/src/generated/waterx_oracle/version.js +8 -0
- package/dist/src/generated/waterx_perp/account_data.d.ts +269 -0
- package/dist/src/generated/waterx_perp/account_data.js +284 -0
- package/dist/src/generated/waterx_perp/admin.d.ts +19 -0
- package/dist/src/generated/waterx_perp/admin.js +22 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/double.d.ts +8 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/double.js +10 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/float.js +10 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/liability.d.ts +11 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/liability.js +13 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/linked_table.d.ts +8 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/linked_table.js +18 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/sheet.d.ts +49 -0
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/sheet.js +18 -0
- package/dist/src/generated/waterx_perp/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/waterx_perp/deps/std/type_name.js +19 -0
- package/dist/src/generated/waterx_perp/deps/sui/balance.d.ts +15 -0
- package/dist/src/generated/waterx_perp/deps/sui/balance.js +17 -0
- package/dist/src/generated/waterx_perp/deps/sui/coin.d.ts +14 -0
- package/dist/src/generated/waterx_perp/deps/sui/coin.js +15 -0
- package/dist/src/generated/waterx_perp/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_perp/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_perp/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_perp/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_perp/events.d.ts +1283 -0
- package/dist/src/generated/waterx_perp/events.js +1018 -0
- package/dist/src/generated/waterx_perp/global_config.d.ts +775 -0
- package/dist/src/generated/waterx_perp/global_config.js +836 -0
- package/dist/src/generated/waterx_perp/keyed_big_vector.d.ts +553 -0
- package/dist/src/generated/waterx_perp/keyed_big_vector.js +554 -0
- package/dist/src/generated/waterx_perp/lp_pool.d.ts +1648 -0
- package/dist/src/generated/waterx_perp/lp_pool.js +1521 -0
- package/dist/src/generated/waterx_perp/market_config.d.ts +715 -0
- package/dist/src/generated/waterx_perp/market_config.js +780 -0
- package/dist/src/generated/waterx_perp/math.d.ts +63 -0
- package/dist/src/generated/waterx_perp/math.js +64 -0
- package/dist/src/generated/waterx_perp/memo.d.ts +251 -0
- package/dist/src/generated/waterx_perp/memo.js +323 -0
- package/dist/src/generated/waterx_perp/order_book.d.ts +290 -0
- package/dist/src/generated/waterx_perp/order_book.js +329 -0
- package/dist/src/generated/waterx_perp/position.d.ts +1005 -0
- package/dist/src/generated/waterx_perp/position.js +1103 -0
- package/dist/src/generated/waterx_perp/request.d.ts +544 -0
- package/dist/src/generated/waterx_perp/request.js +541 -0
- package/dist/src/generated/waterx_perp/response.d.ts +247 -0
- package/dist/src/generated/waterx_perp/response.js +280 -0
- package/dist/src/generated/waterx_perp/trading.d.ts +2821 -0
- package/dist/src/generated/waterx_perp/trading.js +2372 -0
- package/dist/src/generated/waterx_perp/version.d.ts +10 -0
- package/dist/src/generated/waterx_perp/version.js +8 -0
- package/dist/src/generated/waterx_perp/witness.d.ts +18 -0
- package/dist/src/generated/waterx_perp/witness.js +21 -0
- package/dist/src/generated/waterx_perp_view/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/waterx_perp_view/deps/std/type_name.js +19 -0
- package/dist/src/generated/waterx_perp_view/view.d.ts +447 -0
- package/dist/src/generated/waterx_perp_view/view.js +414 -0
- package/dist/src/generated/waterx_pyth_rule/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_pyth_rule/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_pyth_rule/pyth_rule.d.ts +90 -0
- package/dist/src/generated/waterx_pyth_rule/pyth_rule.js +72 -0
- package/dist/src/generated/waterx_referral/deps/sui/table.d.ts +29 -0
- package/dist/src/generated/waterx_referral/deps/sui/table.js +31 -0
- package/dist/src/generated/waterx_referral/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_referral/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_referral/referral_table.d.ts +171 -0
- package/dist/src/generated/waterx_referral/referral_table.js +192 -0
- package/dist/src/generated/waterx_staking/deps/bucket_v2_framework/double.d.ts +8 -0
- package/dist/src/generated/waterx_staking/deps/bucket_v2_framework/double.js +10 -0
- package/dist/src/generated/waterx_staking/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/waterx_staking/deps/sui/balance.js +14 -0
- package/dist/src/generated/waterx_staking/deps/sui/table.d.ts +29 -0
- package/dist/src/generated/waterx_staking/deps/sui/table.js +31 -0
- package/dist/src/generated/waterx_staking/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/waterx_staking/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/waterx_staking/waterx_staking.d.ts +746 -0
- package/dist/src/generated/waterx_staking/waterx_staking.js +731 -0
- package/dist/src/generated/waterx_staking/witness.d.ts +16 -0
- package/dist/src/generated/waterx_staking/witness.js +18 -0
- package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/linked_table.d.ts +8 -0
- package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/linked_table.js +18 -0
- package/dist/src/generated/withdrawal_queue/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/withdrawal_queue/deps/std/type_name.js +19 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/balance.js +14 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/withdrawal_queue/withdrawal_queue.d.ts +483 -0
- package/dist/src/generated/withdrawal_queue/withdrawal_queue.js +480 -0
- package/dist/src/generated/wlp/wlp.d.ts +28 -0
- package/dist/src/generated/wlp/wlp.js +32 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/table.d.ts +29 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/table.js +31 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/generated/wormhole_bridge/deps/sui/vec_set.js +19 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/consumed_vaas.d.ts +12 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/consumed_vaas.js +9 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/emitter.d.ts +14 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/emitter.js +16 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/set.d.ts +16 -0
- package/dist/src/generated/wormhole_bridge/deps/wormhole_sdk/set.js +15 -0
- package/dist/src/generated/wormhole_bridge/events.d.ts +32 -0
- package/dist/src/generated/wormhole_bridge/events.js +28 -0
- package/dist/src/generated/wormhole_bridge/wormhole_bridge.d.ts +498 -0
- package/dist/src/generated/wormhole_bridge/wormhole_bridge.js +494 -0
- package/dist/src/index.d.ts +28 -0
- package/dist/src/index.js +34 -0
- package/dist/src/tx-builders.d.ts +242 -0
- package/dist/src/tx-builders.js +320 -0
- package/dist/src/user/account.d.ts +129 -0
- package/dist/src/user/account.js +166 -0
- package/dist/src/user/credit.d.ts +135 -0
- package/dist/src/user/credit.js +255 -0
- package/dist/src/user/custody.d.ts +71 -0
- package/dist/src/user/custody.js +112 -0
- package/dist/src/user/index.d.ts +8 -0
- package/dist/src/user/index.js +8 -0
- package/dist/src/user/order.d.ts +89 -0
- package/dist/src/user/order.js +134 -0
- package/dist/src/user/referral.d.ts +21 -0
- package/dist/src/user/referral.js +41 -0
- package/dist/src/user/staking.d.ts +54 -0
- package/dist/src/user/staking.js +109 -0
- package/dist/src/user/trading.d.ts +119 -0
- package/dist/src/user/trading.js +262 -0
- package/dist/src/user/wlp.d.ts +58 -0
- package/dist/src/user/wlp.js +99 -0
- package/dist/src/utils/account-request.d.ts +9 -0
- package/dist/src/utils/account-request.js +17 -0
- package/dist/src/utils/config.d.ts +11 -0
- package/dist/src/utils/config.js +15 -0
- package/dist/src/utils/math.d.ts +201 -0
- package/dist/src/utils/math.js +343 -0
- package/dist/src/utils/pyth.d.ts +89 -0
- package/dist/src/utils/pyth.js +316 -0
- package/dist/src/utils/wormhole.d.ts +86 -0
- package/dist/src/utils/wormhole.js +154 -0
- package/package.json +66 -0
|
@@ -0,0 +1,1018 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* All event structs for the WaterX Perpetual Protocol. Follows Bucket naming
|
|
6
|
+
* conventions: \_amount, \_address suffixes. Per-tx timestamp and sender are
|
|
7
|
+
* available as Sui event metadata, so they're not duplicated on any event struct.
|
|
8
|
+
*/
|
|
9
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
10
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
11
|
+
import * as type_name from "./deps/std/type_name.js";
|
|
12
|
+
import * as float from "./deps/bucket_v2_framework/float.js";
|
|
13
|
+
import * as type_name_1 from "./deps/std/type_name.js";
|
|
14
|
+
import * as float_1 from "./deps/bucket_v2_framework/float.js";
|
|
15
|
+
import * as float_2 from "./deps/bucket_v2_framework/float.js";
|
|
16
|
+
import * as float_3 from "./deps/bucket_v2_framework/float.js";
|
|
17
|
+
import * as double from "./deps/bucket_v2_framework/double.js";
|
|
18
|
+
import * as type_name_2 from "./deps/std/type_name.js";
|
|
19
|
+
import * as float_4 from "./deps/bucket_v2_framework/float.js";
|
|
20
|
+
import * as type_name_3 from "./deps/std/type_name.js";
|
|
21
|
+
import * as float_5 from "./deps/bucket_v2_framework/float.js";
|
|
22
|
+
import * as float_6 from "./deps/bucket_v2_framework/float.js";
|
|
23
|
+
import * as type_name_4 from "./deps/std/type_name.js";
|
|
24
|
+
import * as float_7 from "./deps/bucket_v2_framework/float.js";
|
|
25
|
+
import * as float_8 from "./deps/bucket_v2_framework/float.js";
|
|
26
|
+
import * as type_name_5 from "./deps/std/type_name.js";
|
|
27
|
+
import * as float_9 from "./deps/bucket_v2_framework/float.js";
|
|
28
|
+
import * as float_10 from "./deps/bucket_v2_framework/float.js";
|
|
29
|
+
import * as float_11 from "./deps/bucket_v2_framework/float.js";
|
|
30
|
+
import * as double_1 from "./deps/bucket_v2_framework/double.js";
|
|
31
|
+
import * as type_name_6 from "./deps/std/type_name.js";
|
|
32
|
+
import * as float_12 from "./deps/bucket_v2_framework/float.js";
|
|
33
|
+
import * as type_name_7 from "./deps/std/type_name.js";
|
|
34
|
+
import * as float_13 from "./deps/bucket_v2_framework/float.js";
|
|
35
|
+
import * as float_14 from "./deps/bucket_v2_framework/float.js";
|
|
36
|
+
import * as type_name_8 from "./deps/std/type_name.js";
|
|
37
|
+
import * as type_name_9 from "./deps/std/type_name.js";
|
|
38
|
+
import * as float_15 from "./deps/bucket_v2_framework/float.js";
|
|
39
|
+
import * as float_16 from "./deps/bucket_v2_framework/float.js";
|
|
40
|
+
import * as type_name_10 from "./deps/std/type_name.js";
|
|
41
|
+
import * as type_name_11 from "./deps/std/type_name.js";
|
|
42
|
+
import * as type_name_12 from "./deps/std/type_name.js";
|
|
43
|
+
import * as type_name_13 from "./deps/std/type_name.js";
|
|
44
|
+
import * as float_17 from "./deps/bucket_v2_framework/float.js";
|
|
45
|
+
import * as float_18 from "./deps/bucket_v2_framework/float.js";
|
|
46
|
+
import * as float_19 from "./deps/bucket_v2_framework/float.js";
|
|
47
|
+
import * as float_20 from "./deps/bucket_v2_framework/float.js";
|
|
48
|
+
import * as type_name_14 from "./deps/std/type_name.js";
|
|
49
|
+
import * as float_21 from "./deps/bucket_v2_framework/float.js";
|
|
50
|
+
import * as float_22 from "./deps/bucket_v2_framework/float.js";
|
|
51
|
+
import * as float_23 from "./deps/bucket_v2_framework/float.js";
|
|
52
|
+
import * as type_name_15 from "./deps/std/type_name.js";
|
|
53
|
+
import * as float_24 from "./deps/bucket_v2_framework/float.js";
|
|
54
|
+
import * as float_25 from "./deps/bucket_v2_framework/float.js";
|
|
55
|
+
import * as double_2 from "./deps/bucket_v2_framework/double.js";
|
|
56
|
+
import * as type_name_16 from "./deps/std/type_name.js";
|
|
57
|
+
import * as float_26 from "./deps/bucket_v2_framework/float.js";
|
|
58
|
+
import * as float_27 from "./deps/bucket_v2_framework/float.js";
|
|
59
|
+
import * as type_name_17 from "./deps/std/type_name.js";
|
|
60
|
+
import * as float_28 from "./deps/bucket_v2_framework/float.js";
|
|
61
|
+
import * as float_29 from "./deps/bucket_v2_framework/float.js";
|
|
62
|
+
import * as type_name_18 from "./deps/std/type_name.js";
|
|
63
|
+
import * as type_name_19 from "./deps/std/type_name.js";
|
|
64
|
+
import * as type_name_20 from "./deps/std/type_name.js";
|
|
65
|
+
import * as type_name_21 from "./deps/std/type_name.js";
|
|
66
|
+
import * as double_3 from "./deps/bucket_v2_framework/double.js";
|
|
67
|
+
import * as type_name_22 from "./deps/std/type_name.js";
|
|
68
|
+
import * as type_name_23 from "./deps/std/type_name.js";
|
|
69
|
+
import * as type_name_24 from "./deps/std/type_name.js";
|
|
70
|
+
import * as type_name_25 from "./deps/std/type_name.js";
|
|
71
|
+
import * as type_name_26 from "./deps/std/type_name.js";
|
|
72
|
+
import * as type_name_27 from "./deps/std/type_name.js";
|
|
73
|
+
import * as type_name_28 from "./deps/std/type_name.js";
|
|
74
|
+
import * as type_name_29 from "./deps/std/type_name.js";
|
|
75
|
+
import * as double_4 from "./deps/bucket_v2_framework/double.js";
|
|
76
|
+
import * as float_30 from "./deps/bucket_v2_framework/float.js";
|
|
77
|
+
import * as double_5 from "./deps/bucket_v2_framework/double.js";
|
|
78
|
+
import * as float_31 from "./deps/bucket_v2_framework/float.js";
|
|
79
|
+
import * as float_32 from "./deps/bucket_v2_framework/float.js";
|
|
80
|
+
import * as type_name_30 from "./deps/std/type_name.js";
|
|
81
|
+
import * as float_33 from "./deps/bucket_v2_framework/float.js";
|
|
82
|
+
import * as float_34 from "./deps/bucket_v2_framework/float.js";
|
|
83
|
+
import * as float_35 from "./deps/bucket_v2_framework/float.js";
|
|
84
|
+
import * as float_36 from "./deps/bucket_v2_framework/float.js";
|
|
85
|
+
import * as float_37 from "./deps/bucket_v2_framework/float.js";
|
|
86
|
+
import * as float_38 from "./deps/bucket_v2_framework/float.js";
|
|
87
|
+
import * as float_39 from "./deps/bucket_v2_framework/float.js";
|
|
88
|
+
import * as float_40 from "./deps/bucket_v2_framework/float.js";
|
|
89
|
+
import * as float_41 from "./deps/bucket_v2_framework/float.js";
|
|
90
|
+
import * as type_name_31 from "./deps/std/type_name.js";
|
|
91
|
+
import * as vec_set from "./deps/sui/vec_set.js";
|
|
92
|
+
import * as float_42 from "./deps/bucket_v2_framework/float.js";
|
|
93
|
+
import * as float_43 from "./deps/bucket_v2_framework/float.js";
|
|
94
|
+
import * as float_44 from "./deps/bucket_v2_framework/float.js";
|
|
95
|
+
import * as float_45 from "./deps/bucket_v2_framework/float.js";
|
|
96
|
+
import * as double_6 from "./deps/bucket_v2_framework/double.js";
|
|
97
|
+
import * as type_name_32 from "./deps/std/type_name.js";
|
|
98
|
+
import * as float_46 from "./deps/bucket_v2_framework/float.js";
|
|
99
|
+
import * as float_47 from "./deps/bucket_v2_framework/float.js";
|
|
100
|
+
import * as float_48 from "./deps/bucket_v2_framework/float.js";
|
|
101
|
+
const $moduleName = '@waterx/perp::events';
|
|
102
|
+
export const PositionOpened = new MoveStruct({ name: `${$moduleName}::PositionOpened`, fields: {
|
|
103
|
+
account_object_address: bcs.Address,
|
|
104
|
+
market_id: bcs.Address,
|
|
105
|
+
order_id: bcs.u64(),
|
|
106
|
+
position_id: bcs.u64(),
|
|
107
|
+
symbol: bcs.string(),
|
|
108
|
+
wlp_type: type_name.TypeName,
|
|
109
|
+
is_long: bcs.bool(),
|
|
110
|
+
size: float.Float,
|
|
111
|
+
collateral_amount: bcs.u64(),
|
|
112
|
+
collateral_type: type_name_1.TypeName,
|
|
113
|
+
leverage_bps: bcs.u64(),
|
|
114
|
+
entry_price: float_1.Float,
|
|
115
|
+
open_fee_amount: bcs.u64(),
|
|
116
|
+
volume_usd: float_2.Float,
|
|
117
|
+
entry_borrow_index: float_3.Float,
|
|
118
|
+
entry_funding_sign: bcs.bool(),
|
|
119
|
+
entry_funding_index: double.Double,
|
|
120
|
+
unrealized_borrow_fee: bcs.u64(),
|
|
121
|
+
unrealized_funding_sign: bcs.bool(),
|
|
122
|
+
unrealized_funding_fee: bcs.u64(),
|
|
123
|
+
memo: bcs.string()
|
|
124
|
+
} });
|
|
125
|
+
export const PositionClosed = new MoveStruct({ name: `${$moduleName}::PositionClosed`, fields: {
|
|
126
|
+
account_object_address: bcs.Address,
|
|
127
|
+
market_id: bcs.Address,
|
|
128
|
+
order_id: bcs.u64(),
|
|
129
|
+
position_id: bcs.u64(),
|
|
130
|
+
symbol: bcs.string(),
|
|
131
|
+
wlp_type: type_name_2.TypeName,
|
|
132
|
+
is_long: bcs.bool(),
|
|
133
|
+
size: float_4.Float,
|
|
134
|
+
collateral_type: type_name_3.TypeName,
|
|
135
|
+
exit_price: float_5.Float,
|
|
136
|
+
pnl_amount: bcs.u64(),
|
|
137
|
+
pnl_is_profit: bcs.bool(),
|
|
138
|
+
close_fee_amount: bcs.u64(),
|
|
139
|
+
funding_fee_amount: bcs.u64(),
|
|
140
|
+
/**
|
|
141
|
+
* `true` when the position paid funding (cost); `false` when the position received
|
|
142
|
+
* funding (income). Without this companion the `funding_fee_amount` magnitude is
|
|
143
|
+
* sign-blind.
|
|
144
|
+
*/
|
|
145
|
+
funding_fee_is_cost: bcs.bool(),
|
|
146
|
+
borrow_fee_amount: bcs.u64(),
|
|
147
|
+
volume_usd: float_6.Float,
|
|
148
|
+
memo: bcs.string()
|
|
149
|
+
} });
|
|
150
|
+
export const PositionModified = new MoveStruct({ name: `${$moduleName}::PositionModified`, fields: {
|
|
151
|
+
account_object_address: bcs.Address,
|
|
152
|
+
market_id: bcs.Address,
|
|
153
|
+
order_id: bcs.u64(),
|
|
154
|
+
position_id: bcs.u64(),
|
|
155
|
+
symbol: bcs.string(),
|
|
156
|
+
wlp_type: type_name_4.TypeName,
|
|
157
|
+
is_long: bcs.bool(),
|
|
158
|
+
/**
|
|
159
|
+
* `true` when this op grew the position size. Always `false` when `delta_size = 0`
|
|
160
|
+
* (collateral-only changes); read with `delta_size` to disambiguate the direction.
|
|
161
|
+
*/
|
|
162
|
+
is_increase: bcs.bool(),
|
|
163
|
+
delta_size: float_7.Float,
|
|
164
|
+
new_size: float_8.Float,
|
|
165
|
+
/**
|
|
166
|
+
* `true` when this op deposited collateral into the position; `false` when it
|
|
167
|
+
* withdrew collateral. For pure deposit/withdraw ops this is the user's intent;
|
|
168
|
+
* for size-change ops it's the net direction after PnL + fees settle into stored
|
|
169
|
+
* collateral.
|
|
170
|
+
*/
|
|
171
|
+
is_deposit: bcs.bool(),
|
|
172
|
+
delta_collateral_amount: bcs.u64(),
|
|
173
|
+
new_collateral_amount: bcs.u64(),
|
|
174
|
+
collateral_type: type_name_5.TypeName,
|
|
175
|
+
execution_price: float_9.Float,
|
|
176
|
+
realized_pnl_amount: bcs.u64(),
|
|
177
|
+
pnl_is_profit: bcs.bool(),
|
|
178
|
+
/**
|
|
179
|
+
* Sign-blind aggregate of all realized fees on this op. Kept for backwards
|
|
180
|
+
* compatibility; new consumers should read the four component fields below.
|
|
181
|
+
*/
|
|
182
|
+
fee_amount: bcs.u64(),
|
|
183
|
+
close_fee_amount: bcs.u64(),
|
|
184
|
+
funding_fee_amount: bcs.u64(),
|
|
185
|
+
/**
|
|
186
|
+
* `true` when the position paid funding (cost); `false` when the position received
|
|
187
|
+
* funding (income).
|
|
188
|
+
*/
|
|
189
|
+
funding_fee_is_cost: bcs.bool(),
|
|
190
|
+
borrow_fee_amount: bcs.u64(),
|
|
191
|
+
volume_usd: float_10.Float,
|
|
192
|
+
entry_borrow_index: float_11.Float,
|
|
193
|
+
entry_funding_sign: bcs.bool(),
|
|
194
|
+
entry_funding_index: double_1.Double,
|
|
195
|
+
unrealized_borrow_fee: bcs.u64(),
|
|
196
|
+
unrealized_funding_sign: bcs.bool(),
|
|
197
|
+
unrealized_funding_fee: bcs.u64(),
|
|
198
|
+
memo: bcs.string()
|
|
199
|
+
} });
|
|
200
|
+
export const PositionLiquidated = new MoveStruct({ name: `${$moduleName}::PositionLiquidated`, fields: {
|
|
201
|
+
account_object_address: bcs.Address,
|
|
202
|
+
liquidator_address: bcs.Address,
|
|
203
|
+
market_id: bcs.Address,
|
|
204
|
+
position_id: bcs.u64(),
|
|
205
|
+
symbol: bcs.string(),
|
|
206
|
+
wlp_type: type_name_6.TypeName,
|
|
207
|
+
is_long: bcs.bool(),
|
|
208
|
+
size: float_12.Float,
|
|
209
|
+
collateral_amount: bcs.u64(),
|
|
210
|
+
collateral_type: type_name_7.TypeName,
|
|
211
|
+
liquidator_fee_amount: bcs.u64(),
|
|
212
|
+
insurance_fee_amount: bcs.u64(),
|
|
213
|
+
lp_pool_amount: bcs.u64(),
|
|
214
|
+
/**
|
|
215
|
+
* Position-level fees realized at liquidation. Without these the disposition
|
|
216
|
+
* (liquidator/insurance/pool) doesn't add up to gross PnL and per-fee-type
|
|
217
|
+
* liquidation analytics aren't recoverable from the event stream.
|
|
218
|
+
*/
|
|
219
|
+
funding_fee_amount: bcs.u64(),
|
|
220
|
+
funding_fee_is_cost: bcs.bool(),
|
|
221
|
+
borrow_fee_amount: bcs.u64(),
|
|
222
|
+
mark_price: float_13.Float,
|
|
223
|
+
volume_usd: float_14.Float,
|
|
224
|
+
memo: bcs.string()
|
|
225
|
+
} });
|
|
226
|
+
export const PositionLinkedOrderModified = new MoveStruct({ name: `${$moduleName}::PositionLinkedOrderModified`, fields: {
|
|
227
|
+
account_object_address: bcs.Address,
|
|
228
|
+
market_id: bcs.Address,
|
|
229
|
+
position_id: bcs.u64(),
|
|
230
|
+
symbol: bcs.string(),
|
|
231
|
+
wlp_type: type_name_8.TypeName,
|
|
232
|
+
order_id: bcs.u64(),
|
|
233
|
+
linked_order_price_key: bcs.u128(),
|
|
234
|
+
is_added: bcs.bool(),
|
|
235
|
+
memo: bcs.string()
|
|
236
|
+
} });
|
|
237
|
+
export const OrderCreated = new MoveStruct({ name: `${$moduleName}::OrderCreated`, fields: {
|
|
238
|
+
account_object_address: bcs.Address,
|
|
239
|
+
market_id: bcs.Address,
|
|
240
|
+
order_id: bcs.u64(),
|
|
241
|
+
symbol: bcs.string(),
|
|
242
|
+
wlp_type: type_name_9.TypeName,
|
|
243
|
+
order_type: bcs.u8(),
|
|
244
|
+
is_long: bcs.bool(),
|
|
245
|
+
reduce_only: bcs.bool(),
|
|
246
|
+
linked_position_id: bcs.option(bcs.u64()),
|
|
247
|
+
size: float_15.Float,
|
|
248
|
+
trigger_price: bcs.option(float_16.Float),
|
|
249
|
+
collateral_amount: bcs.u64(),
|
|
250
|
+
collateral_type: type_name_10.TypeName,
|
|
251
|
+
memo: bcs.string()
|
|
252
|
+
} });
|
|
253
|
+
export const OrderCancelled = new MoveStruct({ name: `${$moduleName}::OrderCancelled`, fields: {
|
|
254
|
+
account_object_address: bcs.Address,
|
|
255
|
+
market_id: bcs.Address,
|
|
256
|
+
order_id: bcs.u64(),
|
|
257
|
+
symbol: bcs.string(),
|
|
258
|
+
wlp_type: type_name_11.TypeName,
|
|
259
|
+
withdrawal_collateral_amount: bcs.u64(),
|
|
260
|
+
collateral_type: type_name_12.TypeName,
|
|
261
|
+
memo: bcs.string()
|
|
262
|
+
} });
|
|
263
|
+
export const OrderUpdated = new MoveStruct({ name: `${$moduleName}::OrderUpdated`, fields: {
|
|
264
|
+
account_object_address: bcs.Address,
|
|
265
|
+
market_id: bcs.Address,
|
|
266
|
+
order_id: bcs.u64(),
|
|
267
|
+
symbol: bcs.string(),
|
|
268
|
+
wlp_type: type_name_13.TypeName,
|
|
269
|
+
order_type: bcs.u8(),
|
|
270
|
+
is_long: bcs.bool(),
|
|
271
|
+
reduce_only: bcs.bool(),
|
|
272
|
+
linked_position_id: bcs.option(bcs.u64()),
|
|
273
|
+
old_size: float_17.Float,
|
|
274
|
+
new_size: float_18.Float,
|
|
275
|
+
old_trigger_price: float_19.Float,
|
|
276
|
+
new_trigger_price: float_20.Float,
|
|
277
|
+
memo: bcs.string()
|
|
278
|
+
} });
|
|
279
|
+
export const OrderFilled = new MoveStruct({ name: `${$moduleName}::OrderFilled`, fields: {
|
|
280
|
+
account_object_address: bcs.Address,
|
|
281
|
+
market_id: bcs.Address,
|
|
282
|
+
order_id: bcs.u64(),
|
|
283
|
+
order_type: bcs.u8(),
|
|
284
|
+
/**
|
|
285
|
+
* Side of the **order** (may differ from the affected position when
|
|
286
|
+
* `reduce_only=true`; reduce-only fills sit on the opposite side of the position
|
|
287
|
+
* they close).
|
|
288
|
+
*/
|
|
289
|
+
is_long: bcs.bool(),
|
|
290
|
+
/**
|
|
291
|
+
* `true` if the fill grew the linked/new position (open or linked-increase);
|
|
292
|
+
* `false` if it reduced a position (linked-reduce, including full close).
|
|
293
|
+
* Standalone opens emit `true`.
|
|
294
|
+
*/
|
|
295
|
+
is_increase: bcs.bool(),
|
|
296
|
+
reduce_only: bcs.bool(),
|
|
297
|
+
symbol: bcs.string(),
|
|
298
|
+
wlp_type: type_name_14.TypeName,
|
|
299
|
+
position_id: bcs.u64(),
|
|
300
|
+
filled_price: float_21.Float,
|
|
301
|
+
filled_size: float_22.Float,
|
|
302
|
+
fee_amount: bcs.u64(),
|
|
303
|
+
volume_usd: float_23.Float,
|
|
304
|
+
collateral_type: type_name_15.TypeName,
|
|
305
|
+
/**
|
|
306
|
+
* Post-fill size of the affected position. `Float::zero()` for a linked-reduce
|
|
307
|
+
* that fully closed the position.
|
|
308
|
+
*/
|
|
309
|
+
new_size: float_24.Float,
|
|
310
|
+
/**
|
|
311
|
+
* Post-fill collateral amount of the affected position. `0` for a linked-reduce
|
|
312
|
+
* full close.
|
|
313
|
+
*/
|
|
314
|
+
new_collateral_amount: bcs.u64(),
|
|
315
|
+
/**
|
|
316
|
+
* Post-`update_fees` snapshot — same six fields as `PositionOpened` /
|
|
317
|
+
* `PositionModified`. All zero for a linked-reduce full close.
|
|
318
|
+
*/
|
|
319
|
+
entry_borrow_index: float_25.Float,
|
|
320
|
+
entry_funding_sign: bcs.bool(),
|
|
321
|
+
entry_funding_index: double_2.Double,
|
|
322
|
+
unrealized_borrow_fee: bcs.u64(),
|
|
323
|
+
unrealized_funding_sign: bcs.bool(),
|
|
324
|
+
unrealized_funding_fee: bcs.u64(),
|
|
325
|
+
memo: bcs.string()
|
|
326
|
+
} });
|
|
327
|
+
export const PreOrderCreated = new MoveStruct({ name: `${$moduleName}::PreOrderCreated`, fields: {
|
|
328
|
+
account_object_address: bcs.Address,
|
|
329
|
+
market_id: bcs.Address,
|
|
330
|
+
main_order_id: bcs.u64(),
|
|
331
|
+
pre_order_id: bcs.u64(),
|
|
332
|
+
symbol: bcs.string(),
|
|
333
|
+
wlp_type: type_name_16.TypeName,
|
|
334
|
+
order_type: bcs.u8(),
|
|
335
|
+
is_long: bcs.bool(),
|
|
336
|
+
size: float_26.Float,
|
|
337
|
+
trigger_price: float_27.Float,
|
|
338
|
+
memo: bcs.string()
|
|
339
|
+
} });
|
|
340
|
+
export const PreOrderCancelled = new MoveStruct({ name: `${$moduleName}::PreOrderCancelled`, fields: {
|
|
341
|
+
account_object_address: bcs.Address,
|
|
342
|
+
market_id: bcs.Address,
|
|
343
|
+
main_order_id: bcs.u64(),
|
|
344
|
+
pre_order_id: bcs.u64(),
|
|
345
|
+
symbol: bcs.string(),
|
|
346
|
+
wlp_type: type_name_17.TypeName,
|
|
347
|
+
order_type: bcs.u8(),
|
|
348
|
+
is_long: bcs.bool(),
|
|
349
|
+
size: float_28.Float,
|
|
350
|
+
trigger_price: float_29.Float,
|
|
351
|
+
memo: bcs.string()
|
|
352
|
+
} });
|
|
353
|
+
export const ProtocolFeeCollected = new MoveStruct({ name: `${$moduleName}::ProtocolFeeCollected`, fields: {
|
|
354
|
+
amount: bcs.u64(),
|
|
355
|
+
market_id: bcs.Address,
|
|
356
|
+
memo: bcs.string()
|
|
357
|
+
} });
|
|
358
|
+
export const WlpEquityChanged = new MoveStruct({ name: `${$moduleName}::WlpEquityChanged`, fields: {
|
|
359
|
+
/** Symbol of the market whose settlement produced this LP-equity move. */
|
|
360
|
+
market_ticker: bcs.string(),
|
|
361
|
+
wlp_type: type_name_18.TypeName,
|
|
362
|
+
token_type: type_name_19.TypeName,
|
|
363
|
+
amount: bcs.u64(),
|
|
364
|
+
is_profit: bcs.bool(),
|
|
365
|
+
memo: bcs.string()
|
|
366
|
+
} });
|
|
367
|
+
export const WlpMinted = new MoveStruct({ name: `${$moduleName}::WlpMinted`, fields: {
|
|
368
|
+
account_object_address: bcs.Address,
|
|
369
|
+
wlp_type: type_name_20.TypeName,
|
|
370
|
+
token_type: type_name_21.TypeName,
|
|
371
|
+
deposit_amount: bcs.u64(),
|
|
372
|
+
wlp_amount: bcs.u64(),
|
|
373
|
+
fee_amount: bcs.u64(),
|
|
374
|
+
/**
|
|
375
|
+
* USD price per 1 WLP at this mint
|
|
376
|
+
* (`net_deposit_usd / wlp_amount * 10^lp_decimal`). Avoids joining against
|
|
377
|
+
* `snapshots_wlp_pool` for per-mint NAV.
|
|
378
|
+
*/
|
|
379
|
+
share_price: double_3.Double,
|
|
380
|
+
memo: bcs.string()
|
|
381
|
+
} });
|
|
382
|
+
export const WlpRedeemRequested = new MoveStruct({ name: `${$moduleName}::WlpRedeemRequested`, fields: {
|
|
383
|
+
account_object_address: bcs.Address,
|
|
384
|
+
wlp_type: type_name_22.TypeName,
|
|
385
|
+
token_type: type_name_23.TypeName,
|
|
386
|
+
wlp_amount: bcs.u64(),
|
|
387
|
+
request_id: bcs.u64(),
|
|
388
|
+
memo: bcs.string()
|
|
389
|
+
} });
|
|
390
|
+
export const WlpRedeemCancelled = new MoveStruct({ name: `${$moduleName}::WlpRedeemCancelled`, fields: {
|
|
391
|
+
account_object_address: bcs.Address,
|
|
392
|
+
wlp_type: type_name_24.TypeName,
|
|
393
|
+
token_type: type_name_25.TypeName,
|
|
394
|
+
request_id: bcs.u64(),
|
|
395
|
+
wlp_amount: bcs.u64(),
|
|
396
|
+
memo: bcs.string()
|
|
397
|
+
} });
|
|
398
|
+
export const WlpRedeemRejected = new MoveStruct({ name: `${$moduleName}::WlpRedeemRejected`, fields: {
|
|
399
|
+
account_object_address: bcs.Address,
|
|
400
|
+
operator_address: bcs.Address,
|
|
401
|
+
wlp_type: type_name_26.TypeName,
|
|
402
|
+
token_type: type_name_27.TypeName,
|
|
403
|
+
request_id: bcs.u64(),
|
|
404
|
+
wlp_amount: bcs.u64(),
|
|
405
|
+
memo: bcs.string()
|
|
406
|
+
} });
|
|
407
|
+
export const WlpRedeemSettled = new MoveStruct({ name: `${$moduleName}::WlpRedeemSettled`, fields: {
|
|
408
|
+
account_object_address: bcs.Address,
|
|
409
|
+
wlp_type: type_name_28.TypeName,
|
|
410
|
+
token_type: type_name_29.TypeName,
|
|
411
|
+
request_id: bcs.u64(),
|
|
412
|
+
redeem_amount: bcs.u64(),
|
|
413
|
+
fee_amount: bcs.u64(),
|
|
414
|
+
/**
|
|
415
|
+
* USD price per 1 WLP at this redeem
|
|
416
|
+
* (`gross_redeem_usd / wlp_amount * 10^lp_decimal`). Avoids joining against
|
|
417
|
+
* `snapshots_wlp_pool` for per-redeem NAV.
|
|
418
|
+
*/
|
|
419
|
+
share_price: double_4.Double,
|
|
420
|
+
memo: bcs.string()
|
|
421
|
+
} });
|
|
422
|
+
export const FundingRateUpdated = new MoveStruct({ name: `${$moduleName}::FundingRateUpdated`, fields: {
|
|
423
|
+
market_id: bcs.Address,
|
|
424
|
+
funding_rate: float_30.Float,
|
|
425
|
+
/**
|
|
426
|
+
* `true` when this period's funding has longs paying shorts; `false` when shorts
|
|
427
|
+
* pay longs.
|
|
428
|
+
*/
|
|
429
|
+
funding_rate_sign: bcs.bool(),
|
|
430
|
+
cumulative_index: double_5.Double,
|
|
431
|
+
/**
|
|
432
|
+
* `true` when the cumulative funding index is on the "longs pay" side; `false`
|
|
433
|
+
* when it's on the "shorts pay" side.
|
|
434
|
+
*/
|
|
435
|
+
cumulative_funding_sign: bcs.bool(),
|
|
436
|
+
long_oi: float_31.Float,
|
|
437
|
+
short_oi: float_32.Float,
|
|
438
|
+
memo: bcs.string()
|
|
439
|
+
} });
|
|
440
|
+
export const BorrowRateUpdated = new MoveStruct({ name: `${$moduleName}::BorrowRateUpdated`, fields: {
|
|
441
|
+
token_type: type_name_30.TypeName,
|
|
442
|
+
borrow_rate: float_33.Float,
|
|
443
|
+
cumulative_rate: float_34.Float,
|
|
444
|
+
utilization_bps: bcs.u64(),
|
|
445
|
+
memo: bcs.string()
|
|
446
|
+
} });
|
|
447
|
+
export const MarketConfigUpdated = new MoveStruct({ name: `${$moduleName}::MarketConfigUpdated`, fields: {
|
|
448
|
+
market_id: bcs.Address,
|
|
449
|
+
is_paused: bcs.bool(),
|
|
450
|
+
max_leverage_bps: bcs.u64(),
|
|
451
|
+
min_coll_value: bcs.u64(),
|
|
452
|
+
trading_fee: float_35.Float,
|
|
453
|
+
max_impact_fee: float_36.Float,
|
|
454
|
+
allocated_lp_exposure_bps: bcs.u64(),
|
|
455
|
+
impact_fee_curvature: bcs.u64(),
|
|
456
|
+
impact_fee_scale: bcs.u64(),
|
|
457
|
+
maintenance_margin: float_37.Float,
|
|
458
|
+
max_long_oi: float_38.Float,
|
|
459
|
+
max_short_oi: float_39.Float,
|
|
460
|
+
cooldown_ms: bcs.u64(),
|
|
461
|
+
order_price_tick: float_40.Float,
|
|
462
|
+
max_pre_orders: bcs.u64(),
|
|
463
|
+
basic_funding_rate: float_41.Float,
|
|
464
|
+
funding_interval_ms: bcs.u64(),
|
|
465
|
+
request_checklist: bcs.vector(type_name_31.TypeName),
|
|
466
|
+
position_locker: vec_set.VecSet(bcs.u64()),
|
|
467
|
+
long_oi: float_42.Float,
|
|
468
|
+
short_oi: float_43.Float,
|
|
469
|
+
long_avg_entry_price: float_44.Float,
|
|
470
|
+
short_avg_entry_price: float_45.Float,
|
|
471
|
+
next_position_id: bcs.u64(),
|
|
472
|
+
next_order_id: bcs.u64(),
|
|
473
|
+
last_funding_timestamp: bcs.u64(),
|
|
474
|
+
cumulative_funding_sign: bcs.bool(),
|
|
475
|
+
cumulative_funding_index: double_6.Double,
|
|
476
|
+
memo: bcs.string()
|
|
477
|
+
} });
|
|
478
|
+
export const TokenPoolInfoUpdated = new MoveStruct({ name: `${$moduleName}::TokenPoolInfoUpdated`, fields: {
|
|
479
|
+
token_type: type_name_32.TypeName,
|
|
480
|
+
token_decimal: bcs.u8(),
|
|
481
|
+
target_weight_bps: bcs.u64(),
|
|
482
|
+
mint_fee_bps: bcs.u64(),
|
|
483
|
+
burn_fee_bps: bcs.u64(),
|
|
484
|
+
max_capacity: bcs.u64(),
|
|
485
|
+
min_deposit: bcs.u64(),
|
|
486
|
+
basic_borrow_rate_0: float_46.Float,
|
|
487
|
+
basic_borrow_rate_1: float_47.Float,
|
|
488
|
+
basic_borrow_rate_2: float_48.Float,
|
|
489
|
+
utilization_threshold_0_bps: bcs.u64(),
|
|
490
|
+
utilization_threshold_1_bps: bcs.u64(),
|
|
491
|
+
borrow_interval_ms: bcs.u64(),
|
|
492
|
+
max_reserve_ratio_bps: bcs.u64(),
|
|
493
|
+
memo: bcs.string()
|
|
494
|
+
} });
|
|
495
|
+
export function emitPositionOpened(options) {
|
|
496
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
497
|
+
const argumentsTypes = [
|
|
498
|
+
'address',
|
|
499
|
+
'0x2::object::ID',
|
|
500
|
+
'u64',
|
|
501
|
+
'u64',
|
|
502
|
+
'0x1::string::String',
|
|
503
|
+
null,
|
|
504
|
+
'bool',
|
|
505
|
+
null,
|
|
506
|
+
'u64',
|
|
507
|
+
null,
|
|
508
|
+
'u64',
|
|
509
|
+
null,
|
|
510
|
+
'u64',
|
|
511
|
+
null,
|
|
512
|
+
null,
|
|
513
|
+
'bool',
|
|
514
|
+
null,
|
|
515
|
+
'u64',
|
|
516
|
+
'bool',
|
|
517
|
+
'u64'
|
|
518
|
+
];
|
|
519
|
+
const parameterNames = ["accountObjectAddress", "marketId", "orderId", "positionId", "symbol", "wlpType", "isLong", "size", "collateralAmount", "collateralType", "leverageBps", "entryPrice", "openFeeAmount", "volumeUsd", "entryBorrowIndex", "entryFundingSign", "entryFundingIndex", "unrealizedBorrowFee", "unrealizedFundingSign", "unrealizedFundingFee"];
|
|
520
|
+
return (tx) => tx.moveCall({
|
|
521
|
+
package: packageAddress,
|
|
522
|
+
module: 'events',
|
|
523
|
+
function: 'emit_position_opened',
|
|
524
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
export function emitPositionClosed(options) {
|
|
528
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
529
|
+
const argumentsTypes = [
|
|
530
|
+
'address',
|
|
531
|
+
'0x2::object::ID',
|
|
532
|
+
'u64',
|
|
533
|
+
'u64',
|
|
534
|
+
'0x1::string::String',
|
|
535
|
+
null,
|
|
536
|
+
'bool',
|
|
537
|
+
null,
|
|
538
|
+
null,
|
|
539
|
+
null,
|
|
540
|
+
'u64',
|
|
541
|
+
'bool',
|
|
542
|
+
'u64',
|
|
543
|
+
'u64',
|
|
544
|
+
'bool',
|
|
545
|
+
'u64',
|
|
546
|
+
null
|
|
547
|
+
];
|
|
548
|
+
const parameterNames = ["accountObjectAddress", "marketId", "orderId", "positionId", "symbol", "wlpType", "isLong", "size", "collateralType", "exitPrice", "pnlAmount", "pnlIsProfit", "closeFeeAmount", "fundingFeeAmount", "fundingFeeIsCost", "borrowFeeAmount", "volumeUsd"];
|
|
549
|
+
return (tx) => tx.moveCall({
|
|
550
|
+
package: packageAddress,
|
|
551
|
+
module: 'events',
|
|
552
|
+
function: 'emit_position_closed',
|
|
553
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
export function emitPositionModified(options) {
|
|
557
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
558
|
+
const argumentsTypes = [
|
|
559
|
+
'address',
|
|
560
|
+
'0x2::object::ID',
|
|
561
|
+
'u64',
|
|
562
|
+
'u64',
|
|
563
|
+
'0x1::string::String',
|
|
564
|
+
null,
|
|
565
|
+
'bool',
|
|
566
|
+
'bool',
|
|
567
|
+
null,
|
|
568
|
+
null,
|
|
569
|
+
'bool',
|
|
570
|
+
'u64',
|
|
571
|
+
'u64',
|
|
572
|
+
null,
|
|
573
|
+
null,
|
|
574
|
+
'u64',
|
|
575
|
+
'bool',
|
|
576
|
+
'u64',
|
|
577
|
+
'u64',
|
|
578
|
+
'u64',
|
|
579
|
+
'bool',
|
|
580
|
+
'u64',
|
|
581
|
+
null,
|
|
582
|
+
null,
|
|
583
|
+
'bool',
|
|
584
|
+
null,
|
|
585
|
+
'u64',
|
|
586
|
+
'bool',
|
|
587
|
+
'u64'
|
|
588
|
+
];
|
|
589
|
+
const parameterNames = ["accountObjectAddress", "marketId", "orderId", "positionId", "symbol", "wlpType", "isLong", "isIncrease", "deltaSize", "newSize", "isDeposit", "deltaCollateralAmount", "newCollateralAmount", "collateralType", "executionPrice", "realizedPnlAmount", "pnlIsProfit", "feeAmount", "closeFeeAmount", "fundingFeeAmount", "fundingFeeIsCost", "borrowFeeAmount", "volumeUsd", "entryBorrowIndex", "entryFundingSign", "entryFundingIndex", "unrealizedBorrowFee", "unrealizedFundingSign", "unrealizedFundingFee"];
|
|
590
|
+
return (tx) => tx.moveCall({
|
|
591
|
+
package: packageAddress,
|
|
592
|
+
module: 'events',
|
|
593
|
+
function: 'emit_position_modified',
|
|
594
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
export function emitPositionLiquidated(options) {
|
|
598
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
599
|
+
const argumentsTypes = [
|
|
600
|
+
'address',
|
|
601
|
+
'address',
|
|
602
|
+
'0x2::object::ID',
|
|
603
|
+
'u64',
|
|
604
|
+
'0x1::string::String',
|
|
605
|
+
null,
|
|
606
|
+
'bool',
|
|
607
|
+
null,
|
|
608
|
+
'u64',
|
|
609
|
+
null,
|
|
610
|
+
'u64',
|
|
611
|
+
'u64',
|
|
612
|
+
'u64',
|
|
613
|
+
'u64',
|
|
614
|
+
'bool',
|
|
615
|
+
'u64',
|
|
616
|
+
null,
|
|
617
|
+
null
|
|
618
|
+
];
|
|
619
|
+
const parameterNames = ["accountObjectAddress", "liquidatorAddress", "marketId", "positionId", "symbol", "wlpType", "isLong", "size", "collateralAmount", "collateralType", "liquidatorFeeAmount", "insuranceFeeAmount", "lpPoolAmount", "fundingFeeAmount", "fundingFeeIsCost", "borrowFeeAmount", "markPrice", "volumeUsd"];
|
|
620
|
+
return (tx) => tx.moveCall({
|
|
621
|
+
package: packageAddress,
|
|
622
|
+
module: 'events',
|
|
623
|
+
function: 'emit_position_liquidated',
|
|
624
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
export function emitPositionLinkedOrderModified(options) {
|
|
628
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
629
|
+
const argumentsTypes = [
|
|
630
|
+
'address',
|
|
631
|
+
'0x2::object::ID',
|
|
632
|
+
'u64',
|
|
633
|
+
'0x1::string::String',
|
|
634
|
+
null,
|
|
635
|
+
'u64',
|
|
636
|
+
'u128',
|
|
637
|
+
'bool'
|
|
638
|
+
];
|
|
639
|
+
const parameterNames = ["accountObjectAddress", "marketId", "positionId", "symbol", "wlpType", "orderId", "linkedOrderPriceKey", "isAdded"];
|
|
640
|
+
return (tx) => tx.moveCall({
|
|
641
|
+
package: packageAddress,
|
|
642
|
+
module: 'events',
|
|
643
|
+
function: 'emit_position_linked_order_modified',
|
|
644
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
export function emitOrderCreated(options) {
|
|
648
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
649
|
+
const argumentsTypes = [
|
|
650
|
+
'address',
|
|
651
|
+
'0x2::object::ID',
|
|
652
|
+
'u64',
|
|
653
|
+
'0x1::string::String',
|
|
654
|
+
null,
|
|
655
|
+
'u8',
|
|
656
|
+
'bool',
|
|
657
|
+
'bool',
|
|
658
|
+
'0x1::option::Option<u64>',
|
|
659
|
+
null,
|
|
660
|
+
'0x1::option::Option<null>',
|
|
661
|
+
'u64',
|
|
662
|
+
null
|
|
663
|
+
];
|
|
664
|
+
const parameterNames = ["accountObjectAddress", "marketId", "orderId", "symbol", "wlpType", "orderType", "isLong", "reduceOnly", "linkedPositionId", "size", "triggerPrice", "collateralAmount", "collateralType"];
|
|
665
|
+
return (tx) => tx.moveCall({
|
|
666
|
+
package: packageAddress,
|
|
667
|
+
module: 'events',
|
|
668
|
+
function: 'emit_order_created',
|
|
669
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
export function emitOrderCancelled(options) {
|
|
673
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
674
|
+
const argumentsTypes = [
|
|
675
|
+
'address',
|
|
676
|
+
'0x2::object::ID',
|
|
677
|
+
'u64',
|
|
678
|
+
'0x1::string::String',
|
|
679
|
+
null,
|
|
680
|
+
'u64',
|
|
681
|
+
null,
|
|
682
|
+
'0x1::string::String'
|
|
683
|
+
];
|
|
684
|
+
const parameterNames = ["accountObjectAddress", "marketId", "orderId", "symbol", "wlpType", "withdrawalCollateralAmount", "collateralType", "memo"];
|
|
685
|
+
return (tx) => tx.moveCall({
|
|
686
|
+
package: packageAddress,
|
|
687
|
+
module: 'events',
|
|
688
|
+
function: 'emit_order_cancelled',
|
|
689
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
export function emitOrderUpdated(options) {
|
|
693
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
694
|
+
const argumentsTypes = [
|
|
695
|
+
'address',
|
|
696
|
+
'0x2::object::ID',
|
|
697
|
+
'u64',
|
|
698
|
+
'0x1::string::String',
|
|
699
|
+
null,
|
|
700
|
+
'u8',
|
|
701
|
+
'bool',
|
|
702
|
+
'bool',
|
|
703
|
+
'0x1::option::Option<u64>',
|
|
704
|
+
null,
|
|
705
|
+
null,
|
|
706
|
+
null,
|
|
707
|
+
null
|
|
708
|
+
];
|
|
709
|
+
const parameterNames = ["accountObjectAddress", "marketId", "orderId", "symbol", "wlpType", "orderType", "isLong", "reduceOnly", "linkedPositionId", "oldSize", "newSize", "oldTriggerPrice", "newTriggerPrice"];
|
|
710
|
+
return (tx) => tx.moveCall({
|
|
711
|
+
package: packageAddress,
|
|
712
|
+
module: 'events',
|
|
713
|
+
function: 'emit_order_updated',
|
|
714
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
export function emitOrderFilled(options) {
|
|
718
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
719
|
+
const argumentsTypes = [
|
|
720
|
+
'address',
|
|
721
|
+
'0x2::object::ID',
|
|
722
|
+
'u64',
|
|
723
|
+
'u8',
|
|
724
|
+
'bool',
|
|
725
|
+
'bool',
|
|
726
|
+
'bool',
|
|
727
|
+
'0x1::string::String',
|
|
728
|
+
null,
|
|
729
|
+
'u64',
|
|
730
|
+
null,
|
|
731
|
+
null,
|
|
732
|
+
'u64',
|
|
733
|
+
null,
|
|
734
|
+
null,
|
|
735
|
+
null,
|
|
736
|
+
'u64',
|
|
737
|
+
null,
|
|
738
|
+
'bool',
|
|
739
|
+
null,
|
|
740
|
+
'u64',
|
|
741
|
+
'bool',
|
|
742
|
+
'u64'
|
|
743
|
+
];
|
|
744
|
+
const parameterNames = ["accountObjectAddress", "marketId", "orderId", "orderType", "isLong", "isIncrease", "reduceOnly", "symbol", "wlpType", "positionId", "filledPrice", "filledSize", "feeAmount", "volumeUsd", "collateralType", "newSize", "newCollateralAmount", "entryBorrowIndex", "entryFundingSign", "entryFundingIndex", "unrealizedBorrowFee", "unrealizedFundingSign", "unrealizedFundingFee"];
|
|
745
|
+
return (tx) => tx.moveCall({
|
|
746
|
+
package: packageAddress,
|
|
747
|
+
module: 'events',
|
|
748
|
+
function: 'emit_order_filled',
|
|
749
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
export function emitPreOrderCreated(options) {
|
|
753
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
754
|
+
const argumentsTypes = [
|
|
755
|
+
'address',
|
|
756
|
+
'0x2::object::ID',
|
|
757
|
+
'u64',
|
|
758
|
+
'u64',
|
|
759
|
+
'0x1::string::String',
|
|
760
|
+
null,
|
|
761
|
+
'u8',
|
|
762
|
+
'bool',
|
|
763
|
+
null,
|
|
764
|
+
null
|
|
765
|
+
];
|
|
766
|
+
const parameterNames = ["accountObjectAddress", "marketId", "mainOrderId", "preOrderId", "symbol", "wlpType", "orderType", "isLong", "size", "triggerPrice"];
|
|
767
|
+
return (tx) => tx.moveCall({
|
|
768
|
+
package: packageAddress,
|
|
769
|
+
module: 'events',
|
|
770
|
+
function: 'emit_pre_order_created',
|
|
771
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
export function emitPreOrderCancelled(options) {
|
|
775
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
776
|
+
const argumentsTypes = [
|
|
777
|
+
'address',
|
|
778
|
+
'0x2::object::ID',
|
|
779
|
+
'u64',
|
|
780
|
+
'u64',
|
|
781
|
+
'0x1::string::String',
|
|
782
|
+
null,
|
|
783
|
+
'u8',
|
|
784
|
+
'bool',
|
|
785
|
+
null,
|
|
786
|
+
null
|
|
787
|
+
];
|
|
788
|
+
const parameterNames = ["accountObjectAddress", "marketId", "mainOrderId", "preOrderId", "symbol", "wlpType", "orderType", "isLong", "size", "triggerPrice"];
|
|
789
|
+
return (tx) => tx.moveCall({
|
|
790
|
+
package: packageAddress,
|
|
791
|
+
module: 'events',
|
|
792
|
+
function: 'emit_pre_order_cancelled',
|
|
793
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
export function emitProtocolFeeCollected(options) {
|
|
797
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
798
|
+
const argumentsTypes = [
|
|
799
|
+
'u64',
|
|
800
|
+
'0x2::object::ID'
|
|
801
|
+
];
|
|
802
|
+
const parameterNames = ["amount", "marketId"];
|
|
803
|
+
return (tx) => tx.moveCall({
|
|
804
|
+
package: packageAddress,
|
|
805
|
+
module: 'events',
|
|
806
|
+
function: 'emit_protocol_fee_collected',
|
|
807
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
export function emitWlpEquityChanged(options) {
|
|
811
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
812
|
+
const argumentsTypes = [
|
|
813
|
+
'0x1::string::String',
|
|
814
|
+
null,
|
|
815
|
+
null,
|
|
816
|
+
'u64',
|
|
817
|
+
'bool',
|
|
818
|
+
'0x1::string::String'
|
|
819
|
+
];
|
|
820
|
+
const parameterNames = ["marketTicker", "wlpType", "tokenType", "amount", "isProfit", "memo"];
|
|
821
|
+
return (tx) => tx.moveCall({
|
|
822
|
+
package: packageAddress,
|
|
823
|
+
module: 'events',
|
|
824
|
+
function: 'emit_wlp_equity_changed',
|
|
825
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
export function emitWlpMinted(options) {
|
|
829
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
830
|
+
const argumentsTypes = [
|
|
831
|
+
'address',
|
|
832
|
+
null,
|
|
833
|
+
null,
|
|
834
|
+
'u64',
|
|
835
|
+
'u64',
|
|
836
|
+
'u64',
|
|
837
|
+
null
|
|
838
|
+
];
|
|
839
|
+
const parameterNames = ["accountObjectAddress", "wlpType", "tokenType", "depositAmount", "wlpAmount", "feeAmount", "sharePrice"];
|
|
840
|
+
return (tx) => tx.moveCall({
|
|
841
|
+
package: packageAddress,
|
|
842
|
+
module: 'events',
|
|
843
|
+
function: 'emit_wlp_minted',
|
|
844
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
export function emitWlpRedeemRequested(options) {
|
|
848
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
849
|
+
const argumentsTypes = [
|
|
850
|
+
'address',
|
|
851
|
+
null,
|
|
852
|
+
null,
|
|
853
|
+
'u64',
|
|
854
|
+
'u64'
|
|
855
|
+
];
|
|
856
|
+
const parameterNames = ["accountObjectAddress", "wlpType", "tokenType", "wlpAmount", "requestId"];
|
|
857
|
+
return (tx) => tx.moveCall({
|
|
858
|
+
package: packageAddress,
|
|
859
|
+
module: 'events',
|
|
860
|
+
function: 'emit_wlp_redeem_requested',
|
|
861
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
export function emitWlpRedeemCancelled(options) {
|
|
865
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
866
|
+
const argumentsTypes = [
|
|
867
|
+
'address',
|
|
868
|
+
null,
|
|
869
|
+
null,
|
|
870
|
+
'u64',
|
|
871
|
+
'u64'
|
|
872
|
+
];
|
|
873
|
+
const parameterNames = ["accountObjectAddress", "wlpType", "tokenType", "requestId", "wlpAmount"];
|
|
874
|
+
return (tx) => tx.moveCall({
|
|
875
|
+
package: packageAddress,
|
|
876
|
+
module: 'events',
|
|
877
|
+
function: 'emit_wlp_redeem_cancelled',
|
|
878
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
export function emitWlpRedeemRejected(options) {
|
|
882
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
883
|
+
const argumentsTypes = [
|
|
884
|
+
'address',
|
|
885
|
+
'address',
|
|
886
|
+
null,
|
|
887
|
+
null,
|
|
888
|
+
'u64',
|
|
889
|
+
'u64'
|
|
890
|
+
];
|
|
891
|
+
const parameterNames = ["accountObjectAddress", "operatorAddress", "wlpType", "tokenType", "requestId", "wlpAmount"];
|
|
892
|
+
return (tx) => tx.moveCall({
|
|
893
|
+
package: packageAddress,
|
|
894
|
+
module: 'events',
|
|
895
|
+
function: 'emit_wlp_redeem_rejected',
|
|
896
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
export function emitWlpRedeemSettled(options) {
|
|
900
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
901
|
+
const argumentsTypes = [
|
|
902
|
+
'address',
|
|
903
|
+
null,
|
|
904
|
+
null,
|
|
905
|
+
'u64',
|
|
906
|
+
'u64',
|
|
907
|
+
'u64',
|
|
908
|
+
null
|
|
909
|
+
];
|
|
910
|
+
const parameterNames = ["accountObjectAddress", "wlpType", "tokenType", "requestId", "redeemAmount", "feeAmount", "sharePrice"];
|
|
911
|
+
return (tx) => tx.moveCall({
|
|
912
|
+
package: packageAddress,
|
|
913
|
+
module: 'events',
|
|
914
|
+
function: 'emit_wlp_redeem_settled',
|
|
915
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
export function emitFundingRateUpdated(options) {
|
|
919
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
920
|
+
const argumentsTypes = [
|
|
921
|
+
'0x2::object::ID',
|
|
922
|
+
null,
|
|
923
|
+
'bool',
|
|
924
|
+
null,
|
|
925
|
+
'bool',
|
|
926
|
+
null,
|
|
927
|
+
null
|
|
928
|
+
];
|
|
929
|
+
const parameterNames = ["marketId", "fundingRate", "fundingRateSign", "cumulativeIndex", "cumulativeFundingSign", "longOi", "shortOi"];
|
|
930
|
+
return (tx) => tx.moveCall({
|
|
931
|
+
package: packageAddress,
|
|
932
|
+
module: 'events',
|
|
933
|
+
function: 'emit_funding_rate_updated',
|
|
934
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
export function emitBorrowRateUpdated(options) {
|
|
938
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
939
|
+
const argumentsTypes = [
|
|
940
|
+
null,
|
|
941
|
+
null,
|
|
942
|
+
null,
|
|
943
|
+
'u64'
|
|
944
|
+
];
|
|
945
|
+
const parameterNames = ["tokenType", "borrowRate", "cumulativeRate", "utilizationBps"];
|
|
946
|
+
return (tx) => tx.moveCall({
|
|
947
|
+
package: packageAddress,
|
|
948
|
+
module: 'events',
|
|
949
|
+
function: 'emit_borrow_rate_updated',
|
|
950
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
export function emitMarketConfigUpdated(options) {
|
|
954
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
955
|
+
const argumentsTypes = [
|
|
956
|
+
'0x2::object::ID',
|
|
957
|
+
'bool',
|
|
958
|
+
'u64',
|
|
959
|
+
'u64',
|
|
960
|
+
null,
|
|
961
|
+
null,
|
|
962
|
+
'u64',
|
|
963
|
+
'u64',
|
|
964
|
+
'u64',
|
|
965
|
+
null,
|
|
966
|
+
null,
|
|
967
|
+
null,
|
|
968
|
+
'u64',
|
|
969
|
+
null,
|
|
970
|
+
'u64',
|
|
971
|
+
null,
|
|
972
|
+
'u64',
|
|
973
|
+
'vector<null>',
|
|
974
|
+
null,
|
|
975
|
+
null,
|
|
976
|
+
null,
|
|
977
|
+
null,
|
|
978
|
+
null,
|
|
979
|
+
'u64',
|
|
980
|
+
'u64',
|
|
981
|
+
'u64',
|
|
982
|
+
'bool',
|
|
983
|
+
null
|
|
984
|
+
];
|
|
985
|
+
const parameterNames = ["marketId", "isPaused", "maxLeverageBps", "minCollValue", "tradingFee", "maxImpactFee", "allocatedLpExposureBps", "impactFeeCurvature", "impactFeeScale", "maintenanceMargin", "maxLongOi", "maxShortOi", "cooldownMs", "orderPriceTick", "maxPreOrders", "basicFundingRate", "fundingIntervalMs", "requestChecklist", "positionLocker", "longOi", "shortOi", "longAvgEntryPrice", "shortAvgEntryPrice", "nextPositionId", "nextOrderId", "lastFundingTimestamp", "cumulativeFundingSign", "cumulativeFundingIndex"];
|
|
986
|
+
return (tx) => tx.moveCall({
|
|
987
|
+
package: packageAddress,
|
|
988
|
+
module: 'events',
|
|
989
|
+
function: 'emit_market_config_updated',
|
|
990
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
991
|
+
});
|
|
992
|
+
}
|
|
993
|
+
export function emitTokenPoolInfoUpdated(options) {
|
|
994
|
+
const packageAddress = options.package ?? '@waterx/perp';
|
|
995
|
+
const argumentsTypes = [
|
|
996
|
+
null,
|
|
997
|
+
'u8',
|
|
998
|
+
'u64',
|
|
999
|
+
'u64',
|
|
1000
|
+
'u64',
|
|
1001
|
+
'u64',
|
|
1002
|
+
'u64',
|
|
1003
|
+
null,
|
|
1004
|
+
null,
|
|
1005
|
+
null,
|
|
1006
|
+
'u64',
|
|
1007
|
+
'u64',
|
|
1008
|
+
'u64',
|
|
1009
|
+
'u64'
|
|
1010
|
+
];
|
|
1011
|
+
const parameterNames = ["tokenType", "tokenDecimal", "targetWeightBps", "mintFeeBps", "burnFeeBps", "maxCapacity", "minDeposit", "basicBorrowRate_0", "basicBorrowRate_1", "basicBorrowRate_2", "utilizationThreshold_0Bps", "utilizationThreshold_1Bps", "borrowIntervalMs", "maxReserveRatioBps"];
|
|
1012
|
+
return (tx) => tx.moveCall({
|
|
1013
|
+
package: packageAddress,
|
|
1014
|
+
module: 'events',
|
|
1015
|
+
function: 'emit_token_pool_info_updated',
|
|
1016
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1017
|
+
});
|
|
1018
|
+
}
|