@waterx/sdk 2.1.0 → 2.4.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/README.md +75 -169
- package/dist/src/client.d.ts +40 -2
- package/dist/src/client.js +55 -6
- package/dist/src/config.d.ts +66 -3
- package/dist/src/config.js +10 -4
- package/dist/src/constants.d.ts +6 -0
- package/dist/src/constants.js +6 -0
- package/dist/src/core/waterx-account.d.ts +31 -0
- package/dist/src/core/waterx-account.js +26 -0
- package/dist/src/fetch.d.ts +110 -0
- package/dist/src/fetch.js +149 -4
- package/dist/src/generated/bucket_v2_framework/account.d.ts +5 -5
- package/dist/src/generated/bucket_v2_framework/double.d.ts +77 -77
- package/dist/src/generated/bucket_v2_framework/float.d.ts +73 -73
- package/dist/src/generated/bucket_v2_framework/liability.d.ts +33 -33
- package/dist/src/generated/bucket_v2_framework/linked_table.d.ts +5 -5
- package/dist/src/generated/bucket_v2_framework/linked_table.js +2 -2
- package/dist/src/generated/bucket_v2_framework/sheet.d.ts +57 -57
- package/dist/src/generated/bucket_v2_framework/sheet.js +5 -11
- package/dist/src/generated/native_custody/custody_vault.d.ts +46 -32
- package/dist/src/generated/native_custody/custody_vault.js +19 -10
- package/dist/src/generated/native_custody/deps/bucket_v2_framework/sheet.js +1 -3
- package/dist/src/generated/native_custody/events.js +1 -2
- package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.d.ts +7 -7
- package/dist/src/generated/pyth_sponsor_rule/pyth_sponsor_rule.js +1 -2
- package/dist/src/generated/utils/index.d.ts +7 -7
- package/dist/src/generated/utils/index.js +9 -6
- package/dist/src/generated/waterx_account/account.d.ts +124 -71
- package/dist/src/generated/waterx_account/account.js +64 -29
- package/dist/src/generated/waterx_account/deps/bucket_v2_framework/sheet.js +1 -3
- package/dist/src/generated/waterx_account/direct_rule.d.ts +5 -5
- package/dist/src/generated/waterx_account/events.d.ts +10 -0
- package/dist/src/generated/waterx_account/events.js +31 -50
- package/dist/src/generated/waterx_constant_rule/constant_rule.d.ts +68 -0
- package/dist/src/generated/waterx_constant_rule/constant_rule.js +59 -0
- package/dist/src/generated/waterx_constant_rule/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/src/generated/waterx_constant_rule/deps/bucket_v2_framework/float.js +10 -0
- package/dist/src/generated/waterx_constant_rule/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_constant_rule/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_credit/credit_registry.d.ts +9 -9
- package/dist/src/generated/waterx_credit/credit_registry.js +1 -2
- package/dist/src/generated/waterx_credit/limited_supply.d.ts +17 -17
- package/dist/src/generated/waterx_oracle/aggregator.js +1 -2
- package/dist/src/generated/waterx_oracle/collector.d.ts +17 -17
- package/dist/src/generated/waterx_oracle/collector.js +1 -1
- package/dist/src/generated/waterx_oracle/oracle.d.ts +5 -5
- package/dist/src/generated/waterx_perp/account_data.d.ts +5 -5
- package/dist/src/generated/waterx_perp/account_data.js +1 -2
- package/dist/src/generated/waterx_perp/deps/bucket_v2_framework/sheet.js +1 -3
- package/dist/src/generated/waterx_perp/events.d.ts +181 -181
- package/dist/src/generated/waterx_perp/events.js +87 -173
- package/dist/src/generated/waterx_perp/global_config.d.ts +3 -3
- package/dist/src/generated/waterx_perp/global_config.js +6 -12
- package/dist/src/generated/waterx_perp/keyed_big_vector.d.ts +9 -9
- package/dist/src/generated/waterx_perp/keyed_big_vector.js +1 -2
- package/dist/src/generated/waterx_perp/lp_pool.d.ts +115 -115
- package/dist/src/generated/waterx_perp/lp_pool.js +11 -22
- package/dist/src/generated/waterx_perp/market_config.d.ts +61 -43
- package/dist/src/generated/waterx_perp/market_config.js +29 -22
- package/dist/src/generated/waterx_perp/math.d.ts +7 -7
- package/dist/src/generated/waterx_perp/order_book.d.ts +47 -47
- package/dist/src/generated/waterx_perp/position.d.ts +99 -99
- package/dist/src/generated/waterx_perp/position.js +6 -12
- package/dist/src/generated/waterx_perp/request.d.ts +67 -67
- package/dist/src/generated/waterx_perp/request.js +2 -3
- package/dist/src/generated/waterx_perp/response.d.ts +35 -35
- package/dist/src/generated/waterx_perp/response.js +1 -2
- package/dist/src/generated/waterx_perp/trading.d.ts +303 -179
- package/dist/src/generated/waterx_perp/trading.js +99 -14
- package/dist/src/generated/waterx_perp_view/view.js +5 -10
- package/dist/src/generated/waterx_pyth_rule/pyth_rule.d.ts +5 -5
- package/dist/src/generated/waterx_pyth_rule/pyth_rule.js +1 -2
- package/dist/src/generated/waterx_referral/referral_table.d.ts +5 -5
- package/dist/src/generated/waterx_referral/referral_table.js +1 -2
- package/dist/src/generated/waterx_staking/waterx_staking.d.ts +19 -19
- package/dist/src/generated/waterx_staking/waterx_staking.js +10 -20
- package/dist/src/generated/waterx_supra_rule/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/waterx_supra_rule/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/waterx_supra_rule/supra_rule.d.ts +158 -0
- package/dist/src/generated/waterx_supra_rule/supra_rule.js +148 -0
- package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/float.d.ts +8 -0
- package/dist/src/generated/withdrawal_queue/deps/bucket_v2_framework/float.js +10 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/generated/withdrawal_queue/deps/sui/vec_map.js +27 -0
- package/dist/src/generated/withdrawal_queue/withdrawal_queue.d.ts +444 -4
- package/dist/src/generated/withdrawal_queue/withdrawal_queue.js +417 -4
- package/dist/src/generated/wormhole_bridge/wormhole_bridge.d.ts +214 -74
- package/dist/src/generated/wormhole_bridge/wormhole_bridge.js +158 -29
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.js +3 -2
- package/dist/src/prediction/account.d.ts +96 -0
- package/dist/src/prediction/account.js +230 -0
- package/dist/src/prediction/admin.d.ts +47 -0
- package/dist/src/prediction/admin.js +105 -0
- package/dist/src/prediction/bcs.d.ts +22 -0
- package/dist/src/prediction/bcs.js +240 -0
- package/dist/src/prediction/client.d.ts +75 -0
- package/dist/src/prediction/client.js +164 -0
- package/dist/src/prediction/config.d.ts +60 -0
- package/dist/src/prediction/config.js +75 -0
- package/dist/src/prediction/constants.d.ts +44 -0
- package/dist/src/prediction/constants.js +46 -0
- package/dist/src/prediction/fetch.d.ts +82 -0
- package/dist/src/prediction/fetch.js +270 -0
- package/dist/src/prediction/generated/bucket_v2_framework/account.d.ts +100 -0
- package/dist/src/prediction/generated/bucket_v2_framework/account.js +129 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/std/type_name.d.ts +6 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/std/type_name.js +19 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/balance.d.ts +10 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/balance.js +14 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_map.js +27 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_set.js +19 -0
- package/dist/src/prediction/generated/bucket_v2_framework/double.d.ts +382 -0
- package/dist/src/prediction/generated/bucket_v2_framework/double.js +466 -0
- package/dist/src/prediction/generated/bucket_v2_framework/float.d.ts +362 -0
- package/dist/src/prediction/generated/bucket_v2_framework/float.js +440 -0
- package/dist/src/prediction/generated/bucket_v2_framework/liability.d.ts +193 -0
- package/dist/src/prediction/generated/bucket_v2_framework/liability.js +205 -0
- package/dist/src/prediction/generated/bucket_v2_framework/linked_table.d.ts +384 -0
- package/dist/src/prediction/generated/bucket_v2_framework/linked_table.js +382 -0
- package/dist/src/prediction/generated/bucket_v2_framework/sheet.d.ts +344 -0
- package/dist/src/prediction/generated/bucket_v2_framework/sheet.js +338 -0
- package/dist/src/prediction/generated/utils/index.d.ts +30 -0
- package/dist/src/prediction/generated/utils/index.js +160 -0
- package/dist/src/prediction/generated/waterx_account/account.d.ts +1589 -0
- package/dist/src/prediction/generated/waterx_account/account.js +1758 -0
- package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/liability.d.ts +7 -0
- package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/liability.js +13 -0
- package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/sheet.d.ts +7 -0
- package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/sheet.js +16 -0
- package/dist/src/prediction/generated/waterx_account/deps/std/type_name.d.ts +6 -0
- package/dist/src/prediction/generated/waterx_account/deps/std/type_name.js +19 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/balance.d.ts +10 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/balance.js +14 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/object_table.d.ts +12 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/object_table.js +19 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/table.d.ts +24 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/table.js +31 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/vec_map.d.ts +36 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/vec_map.js +27 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/prediction/generated/waterx_account/deps/sui/vec_set.js +19 -0
- package/dist/src/prediction/generated/waterx_account/direct_rule.d.ts +75 -0
- package/dist/src/prediction/generated/waterx_account/direct_rule.js +78 -0
- package/dist/src/prediction/generated/waterx_account/events.d.ts +33 -0
- package/dist/src/prediction/generated/waterx_account/events.js +137 -0
- package/dist/src/prediction/generated/waterx_account/version.d.ts +10 -0
- package/dist/src/prediction/generated/waterx_account/version.js +8 -0
- package/dist/src/prediction/generated/waterx_prediction/account_data.d.ts +327 -0
- package/dist/src/prediction/generated/waterx_prediction/account_data.js +405 -0
- package/dist/src/prediction/generated/waterx_prediction/admin.d.ts +5 -0
- package/dist/src/prediction/generated/waterx_prediction/admin.js +9 -0
- package/dist/src/prediction/generated/waterx_prediction/bet_sharing.d.ts +60 -0
- package/dist/src/prediction/generated/waterx_prediction/bet_sharing.js +83 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.d.ts +8 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/bucket_v2_framework/linked_table.js +18 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/balance.d.ts +10 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/balance.js +14 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/table.d.ts +24 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/table.js +31 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/vec_set.d.ts +16 -0
- package/dist/src/prediction/generated/waterx_prediction/deps/sui/vec_set.js +19 -0
- package/dist/src/prediction/generated/waterx_prediction/events.d.ts +22 -0
- package/dist/src/prediction/generated/waterx_prediction/events.js +179 -0
- package/dist/src/prediction/generated/waterx_prediction/global_config.d.ts +116 -0
- package/dist/src/prediction/generated/waterx_prediction/global_config.js +141 -0
- package/dist/src/prediction/generated/waterx_prediction/order.d.ts +200 -0
- package/dist/src/prediction/generated/waterx_prediction/order.js +284 -0
- package/dist/src/prediction/generated/waterx_prediction/outcome.d.ts +58 -0
- package/dist/src/prediction/generated/waterx_prediction/outcome.js +73 -0
- package/dist/src/prediction/generated/waterx_prediction/position.d.ts +160 -0
- package/dist/src/prediction/generated/waterx_prediction/position.js +214 -0
- package/dist/src/prediction/generated/waterx_prediction/version.d.ts +10 -0
- package/dist/src/prediction/generated/waterx_prediction/version.js +8 -0
- package/dist/src/prediction/generated/waterx_prediction/view.d.ts +353 -0
- package/dist/src/prediction/generated/waterx_prediction/view.js +432 -0
- package/dist/src/prediction/generated/waterx_prediction/waterx_prediction.d.ts +1698 -0
- package/dist/src/prediction/generated/waterx_prediction/waterx_prediction.js +1733 -0
- package/dist/src/prediction/gift-link.d.ts +6 -0
- package/dist/src/prediction/gift-link.js +5 -0
- package/dist/src/prediction/gift.d.ts +223 -0
- package/dist/src/prediction/gift.js +451 -0
- package/dist/src/prediction/index.d.ts +29 -0
- package/dist/src/prediction/index.js +21 -0
- package/dist/src/prediction/prediction.d.ts +104 -0
- package/dist/src/prediction/prediction.js +317 -0
- package/dist/src/prediction/tx-builders.d.ts +44 -0
- package/dist/src/prediction/tx-builders.js +52 -0
- package/dist/src/prediction/types.d.ts +93 -0
- package/dist/src/prediction/types.js +1 -0
- package/dist/src/prediction/user/account.d.ts +2 -0
- package/dist/src/prediction/user/account.js +1 -0
- package/dist/src/prediction/user/admin.d.ts +6 -0
- package/dist/src/prediction/user/admin.js +3 -0
- package/dist/src/prediction/user/gift.d.ts +2 -0
- package/dist/src/prediction/user/gift.js +1 -0
- package/dist/src/prediction/user/index.d.ts +5 -0
- package/dist/src/prediction/user/index.js +3 -0
- package/dist/src/prediction/user/keeper.d.ts +2 -0
- package/dist/src/prediction/user/keeper.js +1 -0
- package/dist/src/prediction/user/order.d.ts +2 -0
- package/dist/src/prediction/user/order.js +1 -0
- package/dist/src/prediction/user/position.d.ts +2 -0
- package/dist/src/prediction/user/position.js +1 -0
- package/dist/src/prediction/utils/bcs.d.ts +1 -0
- package/dist/src/prediction/utils/bcs.js +1 -0
- package/dist/src/prediction/utils/index.d.ts +1 -0
- package/dist/src/prediction/utils/index.js +1 -0
- package/dist/src/prediction/utils.d.ts +30 -0
- package/dist/src/prediction/utils.js +177 -0
- package/dist/src/sdk.d.ts +18 -0
- package/dist/src/sdk.js +17 -0
- package/dist/src/tx-builders.d.ts +54 -0
- package/dist/src/tx-builders.js +141 -0
- package/dist/src/unified-client.d.ts +407 -0
- package/dist/src/unified-client.js +123 -0
- package/dist/src/user/account.d.ts +27 -0
- package/dist/src/user/account.js +34 -8
- package/dist/src/user/credit.d.ts +8 -14
- package/dist/src/user/credit.js +9 -23
- package/dist/src/user/custody.d.ts +4 -18
- package/dist/src/user/custody.js +14 -25
- package/dist/src/utils/consolidate-balance.d.ts +37 -0
- package/dist/src/utils/consolidate-balance.js +89 -0
- package/dist/src/utils/math.d.ts +86 -0
- package/dist/src/utils/math.js +100 -0
- package/dist/src/utils/pyth.d.ts +42 -7
- package/dist/src/utils/pyth.js +107 -31
- package/package.json +129 -34
|
@@ -10,94 +10,8 @@ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
|
10
10
|
import { bcs } from '@mysten/sui/bcs';
|
|
11
11
|
import * as type_name from "./deps/std/type_name.js";
|
|
12
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
13
|
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
14
|
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
15
|
const $moduleName = '@waterx/perp::events';
|
|
102
16
|
export const PositionOpened = new MoveStruct({ name: `${$moduleName}::PositionOpened`, fields: {
|
|
103
17
|
account_object_address: bcs.Address,
|
|
@@ -109,12 +23,12 @@ export const PositionOpened = new MoveStruct({ name: `${$moduleName}::PositionOp
|
|
|
109
23
|
is_long: bcs.bool(),
|
|
110
24
|
size: float.Float,
|
|
111
25
|
collateral_amount: bcs.u64(),
|
|
112
|
-
collateral_type:
|
|
26
|
+
collateral_type: type_name.TypeName,
|
|
113
27
|
leverage_bps: bcs.u64(),
|
|
114
|
-
entry_price:
|
|
28
|
+
entry_price: float.Float,
|
|
115
29
|
open_fee_amount: bcs.u64(),
|
|
116
|
-
volume_usd:
|
|
117
|
-
entry_borrow_index:
|
|
30
|
+
volume_usd: float.Float,
|
|
31
|
+
entry_borrow_index: float.Float,
|
|
118
32
|
entry_funding_sign: bcs.bool(),
|
|
119
33
|
entry_funding_index: double.Double,
|
|
120
34
|
unrealized_borrow_fee: bcs.u64(),
|
|
@@ -128,11 +42,11 @@ export const PositionClosed = new MoveStruct({ name: `${$moduleName}::PositionCl
|
|
|
128
42
|
order_id: bcs.u64(),
|
|
129
43
|
position_id: bcs.u64(),
|
|
130
44
|
symbol: bcs.string(),
|
|
131
|
-
wlp_type:
|
|
45
|
+
wlp_type: type_name.TypeName,
|
|
132
46
|
is_long: bcs.bool(),
|
|
133
|
-
size:
|
|
134
|
-
collateral_type:
|
|
135
|
-
exit_price:
|
|
47
|
+
size: float.Float,
|
|
48
|
+
collateral_type: type_name.TypeName,
|
|
49
|
+
exit_price: float.Float,
|
|
136
50
|
pnl_amount: bcs.u64(),
|
|
137
51
|
pnl_is_profit: bcs.bool(),
|
|
138
52
|
close_fee_amount: bcs.u64(),
|
|
@@ -144,7 +58,7 @@ export const PositionClosed = new MoveStruct({ name: `${$moduleName}::PositionCl
|
|
|
144
58
|
*/
|
|
145
59
|
funding_fee_is_cost: bcs.bool(),
|
|
146
60
|
borrow_fee_amount: bcs.u64(),
|
|
147
|
-
volume_usd:
|
|
61
|
+
volume_usd: float.Float,
|
|
148
62
|
memo: bcs.string()
|
|
149
63
|
} });
|
|
150
64
|
export const PositionModified = new MoveStruct({ name: `${$moduleName}::PositionModified`, fields: {
|
|
@@ -153,15 +67,15 @@ export const PositionModified = new MoveStruct({ name: `${$moduleName}::Position
|
|
|
153
67
|
order_id: bcs.u64(),
|
|
154
68
|
position_id: bcs.u64(),
|
|
155
69
|
symbol: bcs.string(),
|
|
156
|
-
wlp_type:
|
|
70
|
+
wlp_type: type_name.TypeName,
|
|
157
71
|
is_long: bcs.bool(),
|
|
158
72
|
/**
|
|
159
73
|
* `true` when this op grew the position size. Always `false` when `delta_size = 0`
|
|
160
74
|
* (collateral-only changes); read with `delta_size` to disambiguate the direction.
|
|
161
75
|
*/
|
|
162
76
|
is_increase: bcs.bool(),
|
|
163
|
-
delta_size:
|
|
164
|
-
new_size:
|
|
77
|
+
delta_size: float.Float,
|
|
78
|
+
new_size: float.Float,
|
|
165
79
|
/**
|
|
166
80
|
* `true` when this op deposited collateral into the position; `false` when it
|
|
167
81
|
* withdrew collateral. For pure deposit/withdraw ops this is the user's intent;
|
|
@@ -171,8 +85,8 @@ export const PositionModified = new MoveStruct({ name: `${$moduleName}::Position
|
|
|
171
85
|
is_deposit: bcs.bool(),
|
|
172
86
|
delta_collateral_amount: bcs.u64(),
|
|
173
87
|
new_collateral_amount: bcs.u64(),
|
|
174
|
-
collateral_type:
|
|
175
|
-
execution_price:
|
|
88
|
+
collateral_type: type_name.TypeName,
|
|
89
|
+
execution_price: float.Float,
|
|
176
90
|
realized_pnl_amount: bcs.u64(),
|
|
177
91
|
pnl_is_profit: bcs.bool(),
|
|
178
92
|
/**
|
|
@@ -188,10 +102,10 @@ export const PositionModified = new MoveStruct({ name: `${$moduleName}::Position
|
|
|
188
102
|
*/
|
|
189
103
|
funding_fee_is_cost: bcs.bool(),
|
|
190
104
|
borrow_fee_amount: bcs.u64(),
|
|
191
|
-
volume_usd:
|
|
192
|
-
entry_borrow_index:
|
|
105
|
+
volume_usd: float.Float,
|
|
106
|
+
entry_borrow_index: float.Float,
|
|
193
107
|
entry_funding_sign: bcs.bool(),
|
|
194
|
-
entry_funding_index:
|
|
108
|
+
entry_funding_index: double.Double,
|
|
195
109
|
unrealized_borrow_fee: bcs.u64(),
|
|
196
110
|
unrealized_funding_sign: bcs.bool(),
|
|
197
111
|
unrealized_funding_fee: bcs.u64(),
|
|
@@ -203,11 +117,11 @@ export const PositionLiquidated = new MoveStruct({ name: `${$moduleName}::Positi
|
|
|
203
117
|
market_id: bcs.Address,
|
|
204
118
|
position_id: bcs.u64(),
|
|
205
119
|
symbol: bcs.string(),
|
|
206
|
-
wlp_type:
|
|
120
|
+
wlp_type: type_name.TypeName,
|
|
207
121
|
is_long: bcs.bool(),
|
|
208
|
-
size:
|
|
122
|
+
size: float.Float,
|
|
209
123
|
collateral_amount: bcs.u64(),
|
|
210
|
-
collateral_type:
|
|
124
|
+
collateral_type: type_name.TypeName,
|
|
211
125
|
liquidator_fee_amount: bcs.u64(),
|
|
212
126
|
insurance_fee_amount: bcs.u64(),
|
|
213
127
|
lp_pool_amount: bcs.u64(),
|
|
@@ -219,8 +133,8 @@ export const PositionLiquidated = new MoveStruct({ name: `${$moduleName}::Positi
|
|
|
219
133
|
funding_fee_amount: bcs.u64(),
|
|
220
134
|
funding_fee_is_cost: bcs.bool(),
|
|
221
135
|
borrow_fee_amount: bcs.u64(),
|
|
222
|
-
mark_price:
|
|
223
|
-
volume_usd:
|
|
136
|
+
mark_price: float.Float,
|
|
137
|
+
volume_usd: float.Float,
|
|
224
138
|
memo: bcs.string()
|
|
225
139
|
} });
|
|
226
140
|
export const PositionLinkedOrderModified = new MoveStruct({ name: `${$moduleName}::PositionLinkedOrderModified`, fields: {
|
|
@@ -228,7 +142,7 @@ export const PositionLinkedOrderModified = new MoveStruct({ name: `${$moduleName
|
|
|
228
142
|
market_id: bcs.Address,
|
|
229
143
|
position_id: bcs.u64(),
|
|
230
144
|
symbol: bcs.string(),
|
|
231
|
-
wlp_type:
|
|
145
|
+
wlp_type: type_name.TypeName,
|
|
232
146
|
order_id: bcs.u64(),
|
|
233
147
|
linked_order_price_key: bcs.u128(),
|
|
234
148
|
is_added: bcs.bool(),
|
|
@@ -239,15 +153,15 @@ export const OrderCreated = new MoveStruct({ name: `${$moduleName}::OrderCreated
|
|
|
239
153
|
market_id: bcs.Address,
|
|
240
154
|
order_id: bcs.u64(),
|
|
241
155
|
symbol: bcs.string(),
|
|
242
|
-
wlp_type:
|
|
156
|
+
wlp_type: type_name.TypeName,
|
|
243
157
|
order_type: bcs.u8(),
|
|
244
158
|
is_long: bcs.bool(),
|
|
245
159
|
reduce_only: bcs.bool(),
|
|
246
160
|
linked_position_id: bcs.option(bcs.u64()),
|
|
247
|
-
size:
|
|
248
|
-
trigger_price: bcs.option(
|
|
161
|
+
size: float.Float,
|
|
162
|
+
trigger_price: bcs.option(float.Float),
|
|
249
163
|
collateral_amount: bcs.u64(),
|
|
250
|
-
collateral_type:
|
|
164
|
+
collateral_type: type_name.TypeName,
|
|
251
165
|
memo: bcs.string()
|
|
252
166
|
} });
|
|
253
167
|
export const OrderCancelled = new MoveStruct({ name: `${$moduleName}::OrderCancelled`, fields: {
|
|
@@ -255,9 +169,9 @@ export const OrderCancelled = new MoveStruct({ name: `${$moduleName}::OrderCance
|
|
|
255
169
|
market_id: bcs.Address,
|
|
256
170
|
order_id: bcs.u64(),
|
|
257
171
|
symbol: bcs.string(),
|
|
258
|
-
wlp_type:
|
|
172
|
+
wlp_type: type_name.TypeName,
|
|
259
173
|
withdrawal_collateral_amount: bcs.u64(),
|
|
260
|
-
collateral_type:
|
|
174
|
+
collateral_type: type_name.TypeName,
|
|
261
175
|
memo: bcs.string()
|
|
262
176
|
} });
|
|
263
177
|
export const OrderUpdated = new MoveStruct({ name: `${$moduleName}::OrderUpdated`, fields: {
|
|
@@ -265,15 +179,15 @@ export const OrderUpdated = new MoveStruct({ name: `${$moduleName}::OrderUpdated
|
|
|
265
179
|
market_id: bcs.Address,
|
|
266
180
|
order_id: bcs.u64(),
|
|
267
181
|
symbol: bcs.string(),
|
|
268
|
-
wlp_type:
|
|
182
|
+
wlp_type: type_name.TypeName,
|
|
269
183
|
order_type: bcs.u8(),
|
|
270
184
|
is_long: bcs.bool(),
|
|
271
185
|
reduce_only: bcs.bool(),
|
|
272
186
|
linked_position_id: bcs.option(bcs.u64()),
|
|
273
|
-
old_size:
|
|
274
|
-
new_size:
|
|
275
|
-
old_trigger_price:
|
|
276
|
-
new_trigger_price:
|
|
187
|
+
old_size: float.Float,
|
|
188
|
+
new_size: float.Float,
|
|
189
|
+
old_trigger_price: float.Float,
|
|
190
|
+
new_trigger_price: float.Float,
|
|
277
191
|
memo: bcs.string()
|
|
278
192
|
} });
|
|
279
193
|
export const OrderFilled = new MoveStruct({ name: `${$moduleName}::OrderFilled`, fields: {
|
|
@@ -295,18 +209,18 @@ export const OrderFilled = new MoveStruct({ name: `${$moduleName}::OrderFilled`,
|
|
|
295
209
|
is_increase: bcs.bool(),
|
|
296
210
|
reduce_only: bcs.bool(),
|
|
297
211
|
symbol: bcs.string(),
|
|
298
|
-
wlp_type:
|
|
212
|
+
wlp_type: type_name.TypeName,
|
|
299
213
|
position_id: bcs.u64(),
|
|
300
|
-
filled_price:
|
|
301
|
-
filled_size:
|
|
214
|
+
filled_price: float.Float,
|
|
215
|
+
filled_size: float.Float,
|
|
302
216
|
fee_amount: bcs.u64(),
|
|
303
|
-
volume_usd:
|
|
304
|
-
collateral_type:
|
|
217
|
+
volume_usd: float.Float,
|
|
218
|
+
collateral_type: type_name.TypeName,
|
|
305
219
|
/**
|
|
306
220
|
* Post-fill size of the affected position. `Float::zero()` for a linked-reduce
|
|
307
221
|
* that fully closed the position.
|
|
308
222
|
*/
|
|
309
|
-
new_size:
|
|
223
|
+
new_size: float.Float,
|
|
310
224
|
/**
|
|
311
225
|
* Post-fill collateral amount of the affected position. `0` for a linked-reduce
|
|
312
226
|
* full close.
|
|
@@ -316,9 +230,9 @@ export const OrderFilled = new MoveStruct({ name: `${$moduleName}::OrderFilled`,
|
|
|
316
230
|
* Post-`update_fees` snapshot — same six fields as `PositionOpened` /
|
|
317
231
|
* `PositionModified`. All zero for a linked-reduce full close.
|
|
318
232
|
*/
|
|
319
|
-
entry_borrow_index:
|
|
233
|
+
entry_borrow_index: float.Float,
|
|
320
234
|
entry_funding_sign: bcs.bool(),
|
|
321
|
-
entry_funding_index:
|
|
235
|
+
entry_funding_index: double.Double,
|
|
322
236
|
unrealized_borrow_fee: bcs.u64(),
|
|
323
237
|
unrealized_funding_sign: bcs.bool(),
|
|
324
238
|
unrealized_funding_fee: bcs.u64(),
|
|
@@ -330,11 +244,11 @@ export const PreOrderCreated = new MoveStruct({ name: `${$moduleName}::PreOrderC
|
|
|
330
244
|
main_order_id: bcs.u64(),
|
|
331
245
|
pre_order_id: bcs.u64(),
|
|
332
246
|
symbol: bcs.string(),
|
|
333
|
-
wlp_type:
|
|
247
|
+
wlp_type: type_name.TypeName,
|
|
334
248
|
order_type: bcs.u8(),
|
|
335
249
|
is_long: bcs.bool(),
|
|
336
|
-
size:
|
|
337
|
-
trigger_price:
|
|
250
|
+
size: float.Float,
|
|
251
|
+
trigger_price: float.Float,
|
|
338
252
|
memo: bcs.string()
|
|
339
253
|
} });
|
|
340
254
|
export const PreOrderCancelled = new MoveStruct({ name: `${$moduleName}::PreOrderCancelled`, fields: {
|
|
@@ -343,11 +257,11 @@ export const PreOrderCancelled = new MoveStruct({ name: `${$moduleName}::PreOrde
|
|
|
343
257
|
main_order_id: bcs.u64(),
|
|
344
258
|
pre_order_id: bcs.u64(),
|
|
345
259
|
symbol: bcs.string(),
|
|
346
|
-
wlp_type:
|
|
260
|
+
wlp_type: type_name.TypeName,
|
|
347
261
|
order_type: bcs.u8(),
|
|
348
262
|
is_long: bcs.bool(),
|
|
349
|
-
size:
|
|
350
|
-
trigger_price:
|
|
263
|
+
size: float.Float,
|
|
264
|
+
trigger_price: float.Float,
|
|
351
265
|
memo: bcs.string()
|
|
352
266
|
} });
|
|
353
267
|
export const ProtocolFeeCollected = new MoveStruct({ name: `${$moduleName}::ProtocolFeeCollected`, fields: {
|
|
@@ -358,16 +272,16 @@ export const ProtocolFeeCollected = new MoveStruct({ name: `${$moduleName}::Prot
|
|
|
358
272
|
export const WlpEquityChanged = new MoveStruct({ name: `${$moduleName}::WlpEquityChanged`, fields: {
|
|
359
273
|
/** Symbol of the market whose settlement produced this LP-equity move. */
|
|
360
274
|
market_ticker: bcs.string(),
|
|
361
|
-
wlp_type:
|
|
362
|
-
token_type:
|
|
275
|
+
wlp_type: type_name.TypeName,
|
|
276
|
+
token_type: type_name.TypeName,
|
|
363
277
|
amount: bcs.u64(),
|
|
364
278
|
is_profit: bcs.bool(),
|
|
365
279
|
memo: bcs.string()
|
|
366
280
|
} });
|
|
367
281
|
export const WlpMinted = new MoveStruct({ name: `${$moduleName}::WlpMinted`, fields: {
|
|
368
282
|
account_object_address: bcs.Address,
|
|
369
|
-
wlp_type:
|
|
370
|
-
token_type:
|
|
283
|
+
wlp_type: type_name.TypeName,
|
|
284
|
+
token_type: type_name.TypeName,
|
|
371
285
|
deposit_amount: bcs.u64(),
|
|
372
286
|
wlp_amount: bcs.u64(),
|
|
373
287
|
fee_amount: bcs.u64(),
|
|
@@ -376,21 +290,21 @@ export const WlpMinted = new MoveStruct({ name: `${$moduleName}::WlpMinted`, fie
|
|
|
376
290
|
* (`net_deposit_usd / wlp_amount * 10^lp_decimal`). Avoids joining against
|
|
377
291
|
* `snapshots_wlp_pool` for per-mint NAV.
|
|
378
292
|
*/
|
|
379
|
-
share_price:
|
|
293
|
+
share_price: double.Double,
|
|
380
294
|
memo: bcs.string()
|
|
381
295
|
} });
|
|
382
296
|
export const WlpRedeemRequested = new MoveStruct({ name: `${$moduleName}::WlpRedeemRequested`, fields: {
|
|
383
297
|
account_object_address: bcs.Address,
|
|
384
|
-
wlp_type:
|
|
385
|
-
token_type:
|
|
298
|
+
wlp_type: type_name.TypeName,
|
|
299
|
+
token_type: type_name.TypeName,
|
|
386
300
|
wlp_amount: bcs.u64(),
|
|
387
301
|
request_id: bcs.u64(),
|
|
388
302
|
memo: bcs.string()
|
|
389
303
|
} });
|
|
390
304
|
export const WlpRedeemCancelled = new MoveStruct({ name: `${$moduleName}::WlpRedeemCancelled`, fields: {
|
|
391
305
|
account_object_address: bcs.Address,
|
|
392
|
-
wlp_type:
|
|
393
|
-
token_type:
|
|
306
|
+
wlp_type: type_name.TypeName,
|
|
307
|
+
token_type: type_name.TypeName,
|
|
394
308
|
request_id: bcs.u64(),
|
|
395
309
|
wlp_amount: bcs.u64(),
|
|
396
310
|
memo: bcs.string()
|
|
@@ -398,16 +312,16 @@ export const WlpRedeemCancelled = new MoveStruct({ name: `${$moduleName}::WlpRed
|
|
|
398
312
|
export const WlpRedeemRejected = new MoveStruct({ name: `${$moduleName}::WlpRedeemRejected`, fields: {
|
|
399
313
|
account_object_address: bcs.Address,
|
|
400
314
|
operator_address: bcs.Address,
|
|
401
|
-
wlp_type:
|
|
402
|
-
token_type:
|
|
315
|
+
wlp_type: type_name.TypeName,
|
|
316
|
+
token_type: type_name.TypeName,
|
|
403
317
|
request_id: bcs.u64(),
|
|
404
318
|
wlp_amount: bcs.u64(),
|
|
405
319
|
memo: bcs.string()
|
|
406
320
|
} });
|
|
407
321
|
export const WlpRedeemSettled = new MoveStruct({ name: `${$moduleName}::WlpRedeemSettled`, fields: {
|
|
408
322
|
account_object_address: bcs.Address,
|
|
409
|
-
wlp_type:
|
|
410
|
-
token_type:
|
|
323
|
+
wlp_type: type_name.TypeName,
|
|
324
|
+
token_type: type_name.TypeName,
|
|
411
325
|
request_id: bcs.u64(),
|
|
412
326
|
redeem_amount: bcs.u64(),
|
|
413
327
|
fee_amount: bcs.u64(),
|
|
@@ -416,31 +330,31 @@ export const WlpRedeemSettled = new MoveStruct({ name: `${$moduleName}::WlpRedee
|
|
|
416
330
|
* (`gross_redeem_usd / wlp_amount * 10^lp_decimal`). Avoids joining against
|
|
417
331
|
* `snapshots_wlp_pool` for per-redeem NAV.
|
|
418
332
|
*/
|
|
419
|
-
share_price:
|
|
333
|
+
share_price: double.Double,
|
|
420
334
|
memo: bcs.string()
|
|
421
335
|
} });
|
|
422
336
|
export const FundingRateUpdated = new MoveStruct({ name: `${$moduleName}::FundingRateUpdated`, fields: {
|
|
423
337
|
market_id: bcs.Address,
|
|
424
|
-
funding_rate:
|
|
338
|
+
funding_rate: float.Float,
|
|
425
339
|
/**
|
|
426
340
|
* `true` when this period's funding has longs paying shorts; `false` when shorts
|
|
427
341
|
* pay longs.
|
|
428
342
|
*/
|
|
429
343
|
funding_rate_sign: bcs.bool(),
|
|
430
|
-
cumulative_index:
|
|
344
|
+
cumulative_index: double.Double,
|
|
431
345
|
/**
|
|
432
346
|
* `true` when the cumulative funding index is on the "longs pay" side; `false`
|
|
433
347
|
* when it's on the "shorts pay" side.
|
|
434
348
|
*/
|
|
435
349
|
cumulative_funding_sign: bcs.bool(),
|
|
436
|
-
long_oi:
|
|
437
|
-
short_oi:
|
|
350
|
+
long_oi: float.Float,
|
|
351
|
+
short_oi: float.Float,
|
|
438
352
|
memo: bcs.string()
|
|
439
353
|
} });
|
|
440
354
|
export const BorrowRateUpdated = new MoveStruct({ name: `${$moduleName}::BorrowRateUpdated`, fields: {
|
|
441
|
-
token_type:
|
|
442
|
-
borrow_rate:
|
|
443
|
-
cumulative_rate:
|
|
355
|
+
token_type: type_name.TypeName,
|
|
356
|
+
borrow_rate: float.Float,
|
|
357
|
+
cumulative_rate: float.Float,
|
|
444
358
|
utilization_bps: bcs.u64(),
|
|
445
359
|
memo: bcs.string()
|
|
446
360
|
} });
|
|
@@ -449,43 +363,43 @@ export const MarketConfigUpdated = new MoveStruct({ name: `${$moduleName}::Marke
|
|
|
449
363
|
is_paused: bcs.bool(),
|
|
450
364
|
max_leverage_bps: bcs.u64(),
|
|
451
365
|
min_coll_value: bcs.u64(),
|
|
452
|
-
trading_fee:
|
|
453
|
-
max_impact_fee:
|
|
366
|
+
trading_fee: float.Float,
|
|
367
|
+
max_impact_fee: float.Float,
|
|
454
368
|
allocated_lp_exposure_bps: bcs.u64(),
|
|
455
369
|
impact_fee_curvature: bcs.u64(),
|
|
456
370
|
impact_fee_scale: bcs.u64(),
|
|
457
|
-
maintenance_margin:
|
|
458
|
-
max_long_oi:
|
|
459
|
-
max_short_oi:
|
|
371
|
+
maintenance_margin: float.Float,
|
|
372
|
+
max_long_oi: float.Float,
|
|
373
|
+
max_short_oi: float.Float,
|
|
460
374
|
cooldown_ms: bcs.u64(),
|
|
461
|
-
order_price_tick:
|
|
375
|
+
order_price_tick: float.Float,
|
|
462
376
|
max_pre_orders: bcs.u64(),
|
|
463
|
-
basic_funding_rate:
|
|
377
|
+
basic_funding_rate: float.Float,
|
|
464
378
|
funding_interval_ms: bcs.u64(),
|
|
465
|
-
request_checklist: bcs.vector(
|
|
379
|
+
request_checklist: bcs.vector(type_name.TypeName),
|
|
466
380
|
position_locker: vec_set.VecSet(bcs.u64()),
|
|
467
|
-
long_oi:
|
|
468
|
-
short_oi:
|
|
469
|
-
long_avg_entry_price:
|
|
470
|
-
short_avg_entry_price:
|
|
381
|
+
long_oi: float.Float,
|
|
382
|
+
short_oi: float.Float,
|
|
383
|
+
long_avg_entry_price: float.Float,
|
|
384
|
+
short_avg_entry_price: float.Float,
|
|
471
385
|
next_position_id: bcs.u64(),
|
|
472
386
|
next_order_id: bcs.u64(),
|
|
473
387
|
last_funding_timestamp: bcs.u64(),
|
|
474
388
|
cumulative_funding_sign: bcs.bool(),
|
|
475
|
-
cumulative_funding_index:
|
|
389
|
+
cumulative_funding_index: double.Double,
|
|
476
390
|
memo: bcs.string()
|
|
477
391
|
} });
|
|
478
392
|
export const TokenPoolInfoUpdated = new MoveStruct({ name: `${$moduleName}::TokenPoolInfoUpdated`, fields: {
|
|
479
|
-
token_type:
|
|
393
|
+
token_type: type_name.TypeName,
|
|
480
394
|
token_decimal: bcs.u8(),
|
|
481
395
|
target_weight_bps: bcs.u64(),
|
|
482
396
|
mint_fee_bps: bcs.u64(),
|
|
483
397
|
burn_fee_bps: bcs.u64(),
|
|
484
398
|
max_capacity: bcs.u64(),
|
|
485
399
|
min_deposit: bcs.u64(),
|
|
486
|
-
basic_borrow_rate_0:
|
|
487
|
-
basic_borrow_rate_1:
|
|
488
|
-
basic_borrow_rate_2:
|
|
400
|
+
basic_borrow_rate_0: float.Float,
|
|
401
|
+
basic_borrow_rate_1: float.Float,
|
|
402
|
+
basic_borrow_rate_2: float.Float,
|
|
489
403
|
utilization_threshold_0_bps: bcs.u64(),
|
|
490
404
|
utilization_threshold_1_bps: bcs.u64(),
|
|
491
405
|
borrow_interval_ms: bcs.u64(),
|
|
@@ -657,7 +571,7 @@ export function emitOrderCreated(options) {
|
|
|
657
571
|
'bool',
|
|
658
572
|
'0x1::option::Option<u64>',
|
|
659
573
|
null,
|
|
660
|
-
|
|
574
|
+
null,
|
|
661
575
|
'u64',
|
|
662
576
|
null
|
|
663
577
|
];
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* protocol settings.
|
|
7
7
|
*/
|
|
8
8
|
import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
9
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
9
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
10
10
|
export declare const GlobalConfig: MoveStruct<{
|
|
11
11
|
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
12
12
|
/** Allowed protocol versions (admin-managed). */
|
|
@@ -539,13 +539,13 @@ export interface RemovePauserOptions {
|
|
|
539
539
|
export declare function removePauser(options: RemovePauserOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
540
540
|
export interface PauseArguments {
|
|
541
541
|
globalConfig: RawTransactionArgument<string>;
|
|
542
|
-
senderRequest:
|
|
542
|
+
senderRequest: TransactionArgument;
|
|
543
543
|
}
|
|
544
544
|
export interface PauseOptions {
|
|
545
545
|
package?: string;
|
|
546
546
|
arguments: PauseArguments | [
|
|
547
547
|
globalConfig: RawTransactionArgument<string>,
|
|
548
|
-
senderRequest:
|
|
548
|
+
senderRequest: TransactionArgument
|
|
549
549
|
];
|
|
550
550
|
}
|
|
551
551
|
/**
|
|
@@ -8,14 +8,8 @@
|
|
|
8
8
|
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
9
9
|
import { bcs } from '@mysten/sui/bcs';
|
|
10
10
|
import * as vec_set from "./deps/sui/vec_set.js";
|
|
11
|
-
import * as vec_set_1 from "./deps/sui/vec_set.js";
|
|
12
|
-
import * as vec_set_2 from "./deps/sui/vec_set.js";
|
|
13
|
-
import * as vec_set_3 from "./deps/sui/vec_set.js";
|
|
14
|
-
import * as vec_set_4 from "./deps/sui/vec_set.js";
|
|
15
11
|
import * as sheet from "./deps/bucket_v2_framework/sheet.js";
|
|
16
12
|
import * as balance from "./deps/sui/balance.js";
|
|
17
|
-
import * as balance_1 from "./deps/sui/balance.js";
|
|
18
|
-
import * as balance_2 from "./deps/sui/balance.js";
|
|
19
13
|
const $moduleName = '@waterx/perp::global_config';
|
|
20
14
|
export const GlobalConfig = new MoveStruct({ name: `${$moduleName}::GlobalConfig`, fields: {
|
|
21
15
|
id: bcs.Address,
|
|
@@ -27,13 +21,13 @@ export const GlobalConfig = new MoveStruct({ name: `${$moduleName}::GlobalConfig
|
|
|
27
21
|
*/
|
|
28
22
|
is_paused: bcs.bool(),
|
|
29
23
|
/** Authorized addresses that can trigger the global pause (but not unpause). */
|
|
30
|
-
pausers:
|
|
24
|
+
pausers: vec_set.VecSet(bcs.Address),
|
|
31
25
|
/** Authorized keeper addresses. */
|
|
32
|
-
keepers:
|
|
26
|
+
keepers: vec_set.VecSet(bcs.Address),
|
|
33
27
|
/** Authorized WLP redeem operators (can settle/reject redeem requests). */
|
|
34
|
-
redeem_operators:
|
|
28
|
+
redeem_operators: vec_set.VecSet(bcs.Address),
|
|
35
29
|
/** Authorized risk manager addresses (can force-close positions). */
|
|
36
|
-
risk_managers:
|
|
30
|
+
risk_managers: vec_set.VecSet(bcs.Address),
|
|
37
31
|
/**
|
|
38
32
|
* Protocol fee share in bps (of total trading fees). The protocol's cut of every
|
|
39
33
|
* realized trading fee accumulates on `GlobalVault.protocol_fee_balance` and is
|
|
@@ -67,13 +61,13 @@ export const GlobalVault = new MoveStruct({ name: `${$moduleName}::GlobalVault<p
|
|
|
67
61
|
* `mint_wlp` / `settle_redeem` instead of being transferred to a configured
|
|
68
62
|
* `fee_address`. Drained by `claim_protocol_fee` (admin-gated).
|
|
69
63
|
*/
|
|
70
|
-
protocol_fee_balance:
|
|
64
|
+
protocol_fee_balance: balance.Balance,
|
|
71
65
|
/**
|
|
72
66
|
* Accumulated insurance fee from liquidations. Routed here by `execute_liquidate`
|
|
73
67
|
* instead of being transferred to a configured `insurance_address`. Drained by
|
|
74
68
|
* `claim_insurance_fee` (admin-gated).
|
|
75
69
|
*/
|
|
76
|
-
insurance_fee_balance:
|
|
70
|
+
insurance_fee_balance: balance.Balance
|
|
77
71
|
} });
|
|
78
72
|
export function init(options = {}) {
|
|
79
73
|
const packageAddress = options.package ?? '@waterx/perp';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
11
11
|
import { type BcsType } from '@mysten/sui/bcs';
|
|
12
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
12
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
13
13
|
export declare const KeyedBigVector: MoveStruct<{
|
|
14
14
|
/** The unique identifier of the KeyedBigVector object. */
|
|
15
15
|
id: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
@@ -180,12 +180,12 @@ export interface ContainsOptions<K extends BcsType<any>> {
|
|
|
180
180
|
*/
|
|
181
181
|
export declare function contains<K extends BcsType<any>>(options: ContainsOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
182
182
|
export interface GetSliceIdxArguments {
|
|
183
|
-
slice:
|
|
183
|
+
slice: TransactionArgument;
|
|
184
184
|
}
|
|
185
185
|
export interface GetSliceIdxOptions {
|
|
186
186
|
package?: string;
|
|
187
187
|
arguments: GetSliceIdxArguments | [
|
|
188
|
-
slice:
|
|
188
|
+
slice: TransactionArgument
|
|
189
189
|
];
|
|
190
190
|
typeArguments: [
|
|
191
191
|
string,
|
|
@@ -195,12 +195,12 @@ export interface GetSliceIdxOptions {
|
|
|
195
195
|
/** Returns the index of the slice. */
|
|
196
196
|
export declare function getSliceIdx(options: GetSliceIdxOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
197
197
|
export interface GetSliceLengthArguments {
|
|
198
|
-
slice:
|
|
198
|
+
slice: TransactionArgument;
|
|
199
199
|
}
|
|
200
200
|
export interface GetSliceLengthOptions {
|
|
201
201
|
package?: string;
|
|
202
202
|
arguments: GetSliceLengthArguments | [
|
|
203
|
-
slice:
|
|
203
|
+
slice: TransactionArgument
|
|
204
204
|
];
|
|
205
205
|
typeArguments: [
|
|
206
206
|
string,
|
|
@@ -416,13 +416,13 @@ export interface BorrowByKeyMutOptions<K extends BcsType<any>> {
|
|
|
416
416
|
/** Borrows a mutable element by its key from the KeyedBigVector. */
|
|
417
417
|
export declare function borrowByKeyMut<K extends BcsType<any>>(options: BorrowByKeyMutOptions<K>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
418
418
|
export interface BorrowFromSliceArguments {
|
|
419
|
-
slice:
|
|
419
|
+
slice: TransactionArgument;
|
|
420
420
|
i: RawTransactionArgument<number | bigint>;
|
|
421
421
|
}
|
|
422
422
|
export interface BorrowFromSliceOptions {
|
|
423
423
|
package?: string;
|
|
424
424
|
arguments: BorrowFromSliceArguments | [
|
|
425
|
-
slice:
|
|
425
|
+
slice: TransactionArgument,
|
|
426
426
|
i: RawTransactionArgument<number | bigint>
|
|
427
427
|
];
|
|
428
428
|
typeArguments: [
|
|
@@ -433,13 +433,13 @@ export interface BorrowFromSliceOptions {
|
|
|
433
433
|
/** Borrows an element at index `i` from a slice. */
|
|
434
434
|
export declare function borrowFromSlice(options: BorrowFromSliceOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
435
435
|
export interface BorrowFromSliceMutArguments {
|
|
436
|
-
slice:
|
|
436
|
+
slice: TransactionArgument;
|
|
437
437
|
i: RawTransactionArgument<number | bigint>;
|
|
438
438
|
}
|
|
439
439
|
export interface BorrowFromSliceMutOptions {
|
|
440
440
|
package?: string;
|
|
441
441
|
arguments: BorrowFromSliceMutArguments | [
|
|
442
|
-
slice:
|
|
442
|
+
slice: TransactionArgument,
|
|
443
443
|
i: RawTransactionArgument<number | bigint>
|
|
444
444
|
];
|
|
445
445
|
typeArguments: [
|