@waterx/sdk 2.1.0 → 2.3.1-dev.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 +52 -2
- package/dist/src/client.js +76 -6
- package/dist/src/config.d.ts +57 -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 +35 -3
- package/dist/src/utils/pyth.js +145 -14
- package/package.json +129 -34
|
@@ -33,27 +33,8 @@ import * as table from "./deps/sui/table.js";
|
|
|
33
33
|
import * as vec_map from "./deps/sui/vec_map.js";
|
|
34
34
|
import * as type_name from "./deps/std/type_name.js";
|
|
35
35
|
import * as vec_set from "./deps/sui/vec_set.js";
|
|
36
|
-
import * as type_name_1 from "./deps/std/type_name.js";
|
|
37
|
-
import * as vec_map_1 from "./deps/sui/vec_map.js";
|
|
38
|
-
import * as type_name_2 from "./deps/std/type_name.js";
|
|
39
|
-
import * as vec_set_1 from "./deps/sui/vec_set.js";
|
|
40
|
-
import * as type_name_3 from "./deps/std/type_name.js";
|
|
41
|
-
import * as vec_map_2 from "./deps/sui/vec_map.js";
|
|
42
|
-
import * as type_name_4 from "./deps/std/type_name.js";
|
|
43
|
-
import * as vec_set_2 from "./deps/sui/vec_set.js";
|
|
44
|
-
import * as type_name_5 from "./deps/std/type_name.js";
|
|
45
|
-
import * as vec_map_3 from "./deps/sui/vec_map.js";
|
|
46
|
-
import * as type_name_6 from "./deps/std/type_name.js";
|
|
47
|
-
import * as vec_set_3 from "./deps/sui/vec_set.js";
|
|
48
|
-
import * as vec_set_4 from "./deps/sui/vec_set.js";
|
|
49
36
|
import * as balance_1 from "./deps/sui/balance.js";
|
|
50
37
|
import * as sheet from "./deps/bucket_v2_framework/sheet.js";
|
|
51
|
-
import * as vec_map_4 from "./deps/sui/vec_map.js";
|
|
52
|
-
import * as type_name_7 from "./deps/std/type_name.js";
|
|
53
|
-
import * as vec_map_5 from "./deps/sui/vec_map.js";
|
|
54
|
-
import * as type_name_8 from "./deps/std/type_name.js";
|
|
55
|
-
import * as balance_2 from "./deps/sui/balance.js";
|
|
56
|
-
import * as balance_3 from "./deps/sui/balance.js";
|
|
57
38
|
const $moduleName = '@waterx/account::account';
|
|
58
39
|
export const ACCOUNT = new MoveStruct({ name: `${$moduleName}::ACCOUNT`, fields: {
|
|
59
40
|
dummy_field: bcs.bool()
|
|
@@ -91,7 +72,7 @@ export const AccountRegistry = new MoveStruct({ name: `${$moduleName}::AccountRe
|
|
|
91
72
|
* - `new_data<P, _>` / `borrow_data_mut<P, _>` / `remove_data<P, _>` require only
|
|
92
73
|
* `P` whitelisted.
|
|
93
74
|
*/
|
|
94
|
-
protocol_whitelist: vec_map.VecMap(type_name.TypeName, vec_set.VecSet(
|
|
75
|
+
protocol_whitelist: vec_map.VecMap(type_name.TypeName, vec_set.VecSet(type_name.TypeName)),
|
|
95
76
|
/**
|
|
96
77
|
* `T → registered DepositPolicy witness TypeName`. Presence means
|
|
97
78
|
* `request_deposit<T>` / `request_deposit_from_receivings<T>` are permitted; only
|
|
@@ -104,21 +85,21 @@ export const AccountRegistry = new MoveStruct({ name: `${$moduleName}::AccountRe
|
|
|
104
85
|
* migration (both coexist while consumers switch). `request_deposit<T>` requires
|
|
105
86
|
* the set to be non-empty; `consume_deposit<T, P>` requires P to be in the set.
|
|
106
87
|
*/
|
|
107
|
-
deposit_policies:
|
|
88
|
+
deposit_policies: vec_map.VecMap(type_name.TypeName, vec_set.VecSet(type_name.TypeName)),
|
|
108
89
|
/**
|
|
109
90
|
* `T → set of WithdrawPolicy witness TypeNames`. Symmetric to `deposit_policies`
|
|
110
91
|
* for `request_withdraw<T>` / `consume_withdraw`.
|
|
111
92
|
*/
|
|
112
|
-
withdraw_policies:
|
|
93
|
+
withdraw_policies: vec_map.VecMap(type_name.TypeName, vec_set.VecSet(type_name.TypeName)),
|
|
113
94
|
/**
|
|
114
95
|
* Per-T aggregate of `Balance<T>` currently held inside accounts. Incremented in
|
|
115
96
|
* `put<T, P>`, decremented in `take<T, P>` and `request_withdraw<T>`. Does _not_
|
|
116
97
|
* include balance held by protocols (after `take`) or sitting in flight inside a
|
|
117
98
|
* `DepositRequest` / `WithdrawRequest` hot potato.
|
|
118
99
|
*/
|
|
119
|
-
balances:
|
|
120
|
-
allowed_versions:
|
|
121
|
-
managers:
|
|
100
|
+
balances: vec_map.VecMap(type_name.TypeName, bcs.u64()),
|
|
101
|
+
allowed_versions: vec_set.VecSet(bcs.u16()),
|
|
102
|
+
managers: vec_set.VecSet(bcs.Address),
|
|
122
103
|
paused: bcs.bool()
|
|
123
104
|
} });
|
|
124
105
|
export const VaultKey = new MoveTuple({ name: `${$moduleName}::VaultKey<phantom T>`, fields: [bcs.bool()] });
|
|
@@ -137,7 +118,7 @@ export const Delegate = new MoveStruct({ name: `${$moduleName}::Delegate`, field
|
|
|
137
118
|
* protocol's module interprets its own bits. Owner always has `PERM_ALL` per
|
|
138
119
|
* protocol regardless of this field.
|
|
139
120
|
*/
|
|
140
|
-
protocol_permissions:
|
|
121
|
+
protocol_permissions: vec_map.VecMap(type_name.TypeName, bcs.u32()),
|
|
141
122
|
expires_at_ms: bcs.option(bcs.u64())
|
|
142
123
|
} });
|
|
143
124
|
export const Account = new MoveStruct({ name: `${$moduleName}::Account`, fields: {
|
|
@@ -150,19 +131,20 @@ export const Account = new MoveStruct({ name: `${$moduleName}::Account`, fields:
|
|
|
150
131
|
* `BalanceKey<T>()` on this UID. Always equals the matching stored balance's
|
|
151
132
|
* `value()`.
|
|
152
133
|
*/
|
|
153
|
-
balances:
|
|
134
|
+
balances: vec_map.VecMap(type_name.TypeName, bcs.u64())
|
|
154
135
|
} });
|
|
155
136
|
export const DepositRequest = new MoveStruct({ name: `${$moduleName}::DepositRequest<phantom T>`, fields: {
|
|
156
137
|
account_id: bcs.Address,
|
|
157
|
-
balance:
|
|
138
|
+
balance: balance_1.Balance,
|
|
158
139
|
extra_data: bcs.vector(bcs.u8())
|
|
159
140
|
} });
|
|
160
141
|
export const WithdrawRequest = new MoveStruct({ name: `${$moduleName}::WithdrawRequest<phantom T>`, fields: {
|
|
161
142
|
account_id: bcs.Address,
|
|
162
|
-
balance:
|
|
143
|
+
balance: balance_1.Balance,
|
|
163
144
|
recipient: bcs.Address,
|
|
164
145
|
extra_data: bcs.vector(bcs.u8())
|
|
165
146
|
} });
|
|
147
|
+
export const PausedProtocolsKey = new MoveTuple({ name: `${$moduleName}::PausedProtocolsKey`, fields: [bcs.bool()] });
|
|
166
148
|
export const AccountKey = new MoveStruct({ name: `${$moduleName}::AccountKey`, fields: {
|
|
167
149
|
owner: bcs.Address,
|
|
168
150
|
index: bcs.u64()
|
|
@@ -490,6 +472,59 @@ export function delistProtocol(options) {
|
|
|
490
472
|
typeArguments: options.typeArguments
|
|
491
473
|
});
|
|
492
474
|
}
|
|
475
|
+
/**
|
|
476
|
+
* Admin: pause protocol `P` WITHOUT delisting it. A paused protocol cannot
|
|
477
|
+
* `take<_, P>` (new outbound debits) or `new_data<P, _>` (new account state), but
|
|
478
|
+
* `put<_, P>`, `borrow_data_mut<P, _>`, and `remove_data<P, _>` keep working — so
|
|
479
|
+
* in-flight refunds, claims, and close/cleanup can complete. Use this instead of
|
|
480
|
+
* `delist_protocol` for emergency stops; delisting blocks the exit paths too and
|
|
481
|
+
* strands active per-account state (see audit M09).
|
|
482
|
+
*/
|
|
483
|
+
export function pauseProtocol(options) {
|
|
484
|
+
const packageAddress = options.package ?? '@waterx/account';
|
|
485
|
+
const argumentsTypes = [
|
|
486
|
+
null,
|
|
487
|
+
null
|
|
488
|
+
];
|
|
489
|
+
const parameterNames = ["registry", "_"];
|
|
490
|
+
return (tx) => tx.moveCall({
|
|
491
|
+
package: packageAddress,
|
|
492
|
+
module: 'account',
|
|
493
|
+
function: 'pause_protocol',
|
|
494
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
495
|
+
typeArguments: options.typeArguments
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
/** Admin: lift a `pause_protocol<P>`. Idempotent on a non-paused protocol. */
|
|
499
|
+
export function unpauseProtocol(options) {
|
|
500
|
+
const packageAddress = options.package ?? '@waterx/account';
|
|
501
|
+
const argumentsTypes = [
|
|
502
|
+
null,
|
|
503
|
+
null
|
|
504
|
+
];
|
|
505
|
+
const parameterNames = ["registry", "_"];
|
|
506
|
+
return (tx) => tx.moveCall({
|
|
507
|
+
package: packageAddress,
|
|
508
|
+
module: 'account',
|
|
509
|
+
function: 'unpause_protocol',
|
|
510
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
511
|
+
typeArguments: options.typeArguments
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
export function isProtocolPaused(options) {
|
|
515
|
+
const packageAddress = options.package ?? '@waterx/account';
|
|
516
|
+
const argumentsTypes = [
|
|
517
|
+
null
|
|
518
|
+
];
|
|
519
|
+
const parameterNames = ["registry"];
|
|
520
|
+
return (tx) => tx.moveCall({
|
|
521
|
+
package: packageAddress,
|
|
522
|
+
module: 'account',
|
|
523
|
+
function: 'is_protocol_paused',
|
|
524
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
525
|
+
typeArguments: options.typeArguments
|
|
526
|
+
});
|
|
527
|
+
}
|
|
493
528
|
/**
|
|
494
529
|
* Admin: add asset type `T` to protocol `P`'s allowed-asset set. After this,
|
|
495
530
|
* `take<T, P>` is permitted (subject to per-account auth). Aborts if `P` is not
|
|
@@ -6,13 +6,11 @@ import { MoveTuple, MoveStruct } from "../../../utils/index.js";
|
|
|
6
6
|
import * as type_name from "../std/type_name.js";
|
|
7
7
|
import * as vec_map from "../sui/vec_map.js";
|
|
8
8
|
import * as liability from "./liability.js";
|
|
9
|
-
import * as vec_map_1 from "../sui/vec_map.js";
|
|
10
|
-
import * as liability_1 from "./liability.js";
|
|
11
9
|
import * as vec_set from "../sui/vec_set.js";
|
|
12
10
|
const $moduleName = 'bucket_v2_framework::sheet';
|
|
13
11
|
export const Entity = new MoveTuple({ name: `${$moduleName}::Entity`, fields: [type_name.TypeName] });
|
|
14
12
|
export const Sheet = new MoveStruct({ name: `${$moduleName}::Sheet<phantom CoinType, phantom SelfEntity>`, fields: {
|
|
15
13
|
credits: vec_map.VecMap(Entity, liability.Credit),
|
|
16
|
-
debts:
|
|
14
|
+
debts: vec_map.VecMap(Entity, liability.Debt),
|
|
17
15
|
blacklist: vec_set.VecSet(Entity)
|
|
18
16
|
} });
|
|
@@ -30,19 +30,19 @@
|
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
33
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
33
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
34
34
|
export declare const DirectRule: MoveStruct<{
|
|
35
35
|
dummy_field: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
36
36
|
}, "@waterx/account::direct_rule::DirectRule">;
|
|
37
37
|
export interface ConsumeDepositDirectArguments {
|
|
38
38
|
registry: RawTransactionArgument<string>;
|
|
39
|
-
req:
|
|
39
|
+
req: TransactionArgument;
|
|
40
40
|
}
|
|
41
41
|
export interface ConsumeDepositDirectOptions {
|
|
42
42
|
package?: string;
|
|
43
43
|
arguments: ConsumeDepositDirectArguments | [
|
|
44
44
|
registry: RawTransactionArgument<string>,
|
|
45
|
-
req:
|
|
45
|
+
req: TransactionArgument
|
|
46
46
|
];
|
|
47
47
|
typeArguments: [
|
|
48
48
|
string
|
|
@@ -55,13 +55,13 @@ export interface ConsumeDepositDirectOptions {
|
|
|
55
55
|
export declare function consumeDepositDirect(options: ConsumeDepositDirectOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
56
56
|
export interface ConsumeWithdrawDirectArguments {
|
|
57
57
|
registry: RawTransactionArgument<string>;
|
|
58
|
-
req:
|
|
58
|
+
req: TransactionArgument;
|
|
59
59
|
}
|
|
60
60
|
export interface ConsumeWithdrawDirectOptions {
|
|
61
61
|
package?: string;
|
|
62
62
|
arguments: ConsumeWithdrawDirectArguments | [
|
|
63
63
|
registry: RawTransactionArgument<string>,
|
|
64
|
-
req:
|
|
64
|
+
req: TransactionArgument
|
|
65
65
|
];
|
|
66
66
|
typeArguments: [
|
|
67
67
|
string
|
|
@@ -55,6 +55,16 @@ export declare const ProtocolDelisted: MoveStruct<{
|
|
|
55
55
|
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
56
56
|
}, "std::type_name::TypeName">;
|
|
57
57
|
}, "@waterx/account::events::ProtocolDelisted">;
|
|
58
|
+
export declare const ProtocolPaused: MoveStruct<{
|
|
59
|
+
protocol: MoveStruct<{
|
|
60
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
61
|
+
}, "std::type_name::TypeName">;
|
|
62
|
+
}, "@waterx/account::events::ProtocolPaused">;
|
|
63
|
+
export declare const ProtocolUnpaused: MoveStruct<{
|
|
64
|
+
protocol: MoveStruct<{
|
|
65
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
66
|
+
}, "std::type_name::TypeName">;
|
|
67
|
+
}, "@waterx/account::events::ProtocolUnpaused">;
|
|
58
68
|
export declare const ProtocolAssetAllowed: MoveStruct<{
|
|
59
69
|
protocol: MoveStruct<{
|
|
60
70
|
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
@@ -4,31 +4,6 @@
|
|
|
4
4
|
import { MoveStruct } from "../utils/index.js";
|
|
5
5
|
import { bcs } from '@mysten/sui/bcs';
|
|
6
6
|
import * as type_name from "./deps/std/type_name.js";
|
|
7
|
-
import * as type_name_1 from "./deps/std/type_name.js";
|
|
8
|
-
import * as type_name_2 from "./deps/std/type_name.js";
|
|
9
|
-
import * as type_name_3 from "./deps/std/type_name.js";
|
|
10
|
-
import * as type_name_4 from "./deps/std/type_name.js";
|
|
11
|
-
import * as type_name_5 from "./deps/std/type_name.js";
|
|
12
|
-
import * as type_name_6 from "./deps/std/type_name.js";
|
|
13
|
-
import * as type_name_7 from "./deps/std/type_name.js";
|
|
14
|
-
import * as type_name_8 from "./deps/std/type_name.js";
|
|
15
|
-
import * as type_name_9 from "./deps/std/type_name.js";
|
|
16
|
-
import * as type_name_10 from "./deps/std/type_name.js";
|
|
17
|
-
import * as type_name_11 from "./deps/std/type_name.js";
|
|
18
|
-
import * as type_name_12 from "./deps/std/type_name.js";
|
|
19
|
-
import * as type_name_13 from "./deps/std/type_name.js";
|
|
20
|
-
import * as type_name_14 from "./deps/std/type_name.js";
|
|
21
|
-
import * as type_name_15 from "./deps/std/type_name.js";
|
|
22
|
-
import * as type_name_16 from "./deps/std/type_name.js";
|
|
23
|
-
import * as type_name_17 from "./deps/std/type_name.js";
|
|
24
|
-
import * as type_name_18 from "./deps/std/type_name.js";
|
|
25
|
-
import * as type_name_19 from "./deps/std/type_name.js";
|
|
26
|
-
import * as type_name_20 from "./deps/std/type_name.js";
|
|
27
|
-
import * as type_name_21 from "./deps/std/type_name.js";
|
|
28
|
-
import * as type_name_22 from "./deps/std/type_name.js";
|
|
29
|
-
import * as type_name_23 from "./deps/std/type_name.js";
|
|
30
|
-
import * as type_name_24 from "./deps/std/type_name.js";
|
|
31
|
-
import * as type_name_25 from "./deps/std/type_name.js";
|
|
32
7
|
const $moduleName = '@waterx/account::events';
|
|
33
8
|
export const AccountCreated = new MoveStruct({ name: `${$moduleName}::AccountCreated`, fields: {
|
|
34
9
|
owner: bcs.Address,
|
|
@@ -67,73 +42,79 @@ export const DelegateProtocolPermissionSet = new MoveStruct({ name: `${$moduleNa
|
|
|
67
42
|
export const DelegateProtocolPermissionUnset = new MoveStruct({ name: `${$moduleName}::DelegateProtocolPermissionUnset`, fields: {
|
|
68
43
|
account_object_address: bcs.Address,
|
|
69
44
|
delegate: bcs.Address,
|
|
70
|
-
protocol:
|
|
45
|
+
protocol: type_name.TypeName
|
|
71
46
|
} });
|
|
72
47
|
export const ProtocolWhitelisted = new MoveStruct({ name: `${$moduleName}::ProtocolWhitelisted`, fields: {
|
|
73
|
-
protocol:
|
|
48
|
+
protocol: type_name.TypeName
|
|
74
49
|
} });
|
|
75
50
|
export const ProtocolDelisted = new MoveStruct({ name: `${$moduleName}::ProtocolDelisted`, fields: {
|
|
76
|
-
protocol:
|
|
51
|
+
protocol: type_name.TypeName
|
|
52
|
+
} });
|
|
53
|
+
export const ProtocolPaused = new MoveStruct({ name: `${$moduleName}::ProtocolPaused`, fields: {
|
|
54
|
+
protocol: type_name.TypeName
|
|
55
|
+
} });
|
|
56
|
+
export const ProtocolUnpaused = new MoveStruct({ name: `${$moduleName}::ProtocolUnpaused`, fields: {
|
|
57
|
+
protocol: type_name.TypeName
|
|
77
58
|
} });
|
|
78
59
|
export const ProtocolAssetAllowed = new MoveStruct({ name: `${$moduleName}::ProtocolAssetAllowed`, fields: {
|
|
79
|
-
protocol:
|
|
80
|
-
asset:
|
|
60
|
+
protocol: type_name.TypeName,
|
|
61
|
+
asset: type_name.TypeName
|
|
81
62
|
} });
|
|
82
63
|
export const ProtocolAssetDisallowed = new MoveStruct({ name: `${$moduleName}::ProtocolAssetDisallowed`, fields: {
|
|
83
|
-
protocol:
|
|
84
|
-
asset:
|
|
64
|
+
protocol: type_name.TypeName,
|
|
65
|
+
asset: type_name.TypeName
|
|
85
66
|
} });
|
|
86
67
|
export const DepositPolicyRegistered = new MoveStruct({ name: `${$moduleName}::DepositPolicyRegistered`, fields: {
|
|
87
|
-
token_type:
|
|
88
|
-
policy:
|
|
68
|
+
token_type: type_name.TypeName,
|
|
69
|
+
policy: type_name.TypeName
|
|
89
70
|
} });
|
|
90
71
|
export const DepositPolicyUnregistered = new MoveStruct({ name: `${$moduleName}::DepositPolicyUnregistered`, fields: {
|
|
91
|
-
token_type:
|
|
92
|
-
policy:
|
|
72
|
+
token_type: type_name.TypeName,
|
|
73
|
+
policy: type_name.TypeName
|
|
93
74
|
} });
|
|
94
75
|
export const WithdrawPolicyRegistered = new MoveStruct({ name: `${$moduleName}::WithdrawPolicyRegistered`, fields: {
|
|
95
|
-
token_type:
|
|
96
|
-
policy:
|
|
76
|
+
token_type: type_name.TypeName,
|
|
77
|
+
policy: type_name.TypeName
|
|
97
78
|
} });
|
|
98
79
|
export const WithdrawPolicyUnregistered = new MoveStruct({ name: `${$moduleName}::WithdrawPolicyUnregistered`, fields: {
|
|
99
|
-
token_type:
|
|
100
|
-
policy:
|
|
80
|
+
token_type: type_name.TypeName,
|
|
81
|
+
policy: type_name.TypeName
|
|
101
82
|
} });
|
|
102
83
|
export const DepositRequested = new MoveStruct({ name: `${$moduleName}::DepositRequested`, fields: {
|
|
103
84
|
account_object_address: bcs.Address,
|
|
104
|
-
token_type:
|
|
85
|
+
token_type: type_name.TypeName,
|
|
105
86
|
amount: bcs.u64()
|
|
106
87
|
} });
|
|
107
88
|
export const DepositConsumed = new MoveStruct({ name: `${$moduleName}::DepositConsumed`, fields: {
|
|
108
89
|
account_object_address: bcs.Address,
|
|
109
|
-
token_type:
|
|
110
|
-
policy:
|
|
90
|
+
token_type: type_name.TypeName,
|
|
91
|
+
policy: type_name.TypeName,
|
|
111
92
|
amount: bcs.u64()
|
|
112
93
|
} });
|
|
113
94
|
export const WithdrawRequested = new MoveStruct({ name: `${$moduleName}::WithdrawRequested`, fields: {
|
|
114
95
|
account_object_address: bcs.Address,
|
|
115
|
-
token_type:
|
|
96
|
+
token_type: type_name.TypeName,
|
|
116
97
|
amount: bcs.u64(),
|
|
117
98
|
requested_by: bcs.Address,
|
|
118
99
|
recipient: bcs.Address
|
|
119
100
|
} });
|
|
120
101
|
export const WithdrawConsumed = new MoveStruct({ name: `${$moduleName}::WithdrawConsumed`, fields: {
|
|
121
102
|
account_object_address: bcs.Address,
|
|
122
|
-
token_type:
|
|
123
|
-
policy:
|
|
103
|
+
token_type: type_name.TypeName,
|
|
104
|
+
policy: type_name.TypeName,
|
|
124
105
|
amount: bcs.u64(),
|
|
125
106
|
recipient: bcs.Address
|
|
126
107
|
} });
|
|
127
108
|
export const TakenByProtocol = new MoveStruct({ name: `${$moduleName}::TakenByProtocol`, fields: {
|
|
128
109
|
account_object_address: bcs.Address,
|
|
129
|
-
protocol:
|
|
130
|
-
token_type:
|
|
110
|
+
protocol: type_name.TypeName,
|
|
111
|
+
token_type: type_name.TypeName,
|
|
131
112
|
amount: bcs.u64()
|
|
132
113
|
} });
|
|
133
114
|
export const ReturnedByProtocol = new MoveStruct({ name: `${$moduleName}::ReturnedByProtocol`, fields: {
|
|
134
115
|
account_object_address: bcs.Address,
|
|
135
|
-
protocol:
|
|
136
|
-
token_type:
|
|
116
|
+
protocol: type_name.TypeName,
|
|
117
|
+
token_type: type_name.TypeName,
|
|
137
118
|
amount: bcs.u64()
|
|
138
119
|
} });
|
|
139
120
|
export const ManagerAdded = new MoveStruct({ name: `${$moduleName}::ManagerAdded`, fields: {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
5
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
6
|
+
export declare const ConstantRule: MoveStruct<{
|
|
7
|
+
dummy_field: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
8
|
+
}, "@waterx/constant-rule::constant_rule::ConstantRule">;
|
|
9
|
+
export declare const Config: MoveStruct<{
|
|
10
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
11
|
+
/** Ticker (e.g. `b"USD".to_string()`) → constant `Float` price returned by `feed`. */
|
|
12
|
+
prices: MoveStruct<{
|
|
13
|
+
contents: import("@mysten/sui/bcs").BcsType<{
|
|
14
|
+
key: string;
|
|
15
|
+
value: {
|
|
16
|
+
value: string;
|
|
17
|
+
};
|
|
18
|
+
}[], Iterable<{
|
|
19
|
+
key: string;
|
|
20
|
+
value: {
|
|
21
|
+
value: string | number | bigint;
|
|
22
|
+
};
|
|
23
|
+
}> & {
|
|
24
|
+
length: number;
|
|
25
|
+
}, string>;
|
|
26
|
+
}, "0x2::vec_map::VecMap<string, bucket_v2_framework::float::Float>">;
|
|
27
|
+
}, "@waterx/constant-rule::constant_rule::Config">;
|
|
28
|
+
export declare const ConstantPriceSet: MoveStruct<{
|
|
29
|
+
symbol: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
30
|
+
scaled_price: import("@mysten/sui/bcs").BcsType<string | null, string | number | bigint | null | undefined, "Option<u128>">;
|
|
31
|
+
}, "@waterx/constant-rule::constant_rule::ConstantPriceSet">;
|
|
32
|
+
export interface FeedArguments {
|
|
33
|
+
collector: TransactionArgument;
|
|
34
|
+
config: RawTransactionArgument<string>;
|
|
35
|
+
}
|
|
36
|
+
export interface FeedOptions {
|
|
37
|
+
package?: string;
|
|
38
|
+
arguments: FeedArguments | [
|
|
39
|
+
collector: TransactionArgument,
|
|
40
|
+
config: RawTransactionArgument<string>
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Contributes the configured constant for `collector.symbol()` to the
|
|
45
|
+
* `PriceCollector`. Abstains (records `none`) when no constant is configured so
|
|
46
|
+
* other rules in the same collector can still satisfy `weight_threshold`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function feed(options: FeedOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
49
|
+
export interface SetConstantPriceArguments {
|
|
50
|
+
config: RawTransactionArgument<string>;
|
|
51
|
+
Cap: RawTransactionArgument<string>;
|
|
52
|
+
symbol: RawTransactionArgument<string>;
|
|
53
|
+
scaledPrice: RawTransactionArgument<number | bigint | null>;
|
|
54
|
+
}
|
|
55
|
+
export interface SetConstantPriceOptions {
|
|
56
|
+
package?: string;
|
|
57
|
+
arguments: SetConstantPriceArguments | [
|
|
58
|
+
config: RawTransactionArgument<string>,
|
|
59
|
+
Cap: RawTransactionArgument<string>,
|
|
60
|
+
symbol: RawTransactionArgument<string>,
|
|
61
|
+
scaledPrice: RawTransactionArgument<number | bigint | null>
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Sets the constant `Float` price for `symbol` (passed as the raw 1e9-scaled
|
|
66
|
+
* `u128`). Passing `none` removes the entry. Emits `ConstantPriceSet`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function setConstantPrice(options: SetConstantPriceOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
5
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
+
import * as vec_map from "./deps/sui/vec_map.js";
|
|
7
|
+
import * as float from "./deps/bucket_v2_framework/float.js";
|
|
8
|
+
const $moduleName = '@waterx/constant-rule::constant_rule';
|
|
9
|
+
export const ConstantRule = new MoveStruct({ name: `${$moduleName}::ConstantRule`, fields: {
|
|
10
|
+
dummy_field: bcs.bool()
|
|
11
|
+
} });
|
|
12
|
+
export const Config = new MoveStruct({ name: `${$moduleName}::Config`, fields: {
|
|
13
|
+
id: bcs.Address,
|
|
14
|
+
/** Ticker (e.g. `b"USD".to_string()`) → constant `Float` price returned by `feed`. */
|
|
15
|
+
prices: vec_map.VecMap(bcs.string(), float.Float)
|
|
16
|
+
} });
|
|
17
|
+
export const ConstantPriceSet = new MoveStruct({ name: `${$moduleName}::ConstantPriceSet`, fields: {
|
|
18
|
+
symbol: bcs.string(),
|
|
19
|
+
scaled_price: bcs.option(bcs.u128())
|
|
20
|
+
} });
|
|
21
|
+
/**
|
|
22
|
+
* Contributes the configured constant for `collector.symbol()` to the
|
|
23
|
+
* `PriceCollector`. Abstains (records `none`) when no constant is configured so
|
|
24
|
+
* other rules in the same collector can still satisfy `weight_threshold`.
|
|
25
|
+
*/
|
|
26
|
+
export function feed(options) {
|
|
27
|
+
const packageAddress = options.package ?? '@waterx/constant-rule';
|
|
28
|
+
const argumentsTypes = [
|
|
29
|
+
null,
|
|
30
|
+
null
|
|
31
|
+
];
|
|
32
|
+
const parameterNames = ["collector", "config"];
|
|
33
|
+
return (tx) => tx.moveCall({
|
|
34
|
+
package: packageAddress,
|
|
35
|
+
module: 'constant_rule',
|
|
36
|
+
function: 'feed',
|
|
37
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Sets the constant `Float` price for `symbol` (passed as the raw 1e9-scaled
|
|
42
|
+
* `u128`). Passing `none` removes the entry. Emits `ConstantPriceSet`.
|
|
43
|
+
*/
|
|
44
|
+
export function setConstantPrice(options) {
|
|
45
|
+
const packageAddress = options.package ?? '@waterx/constant-rule';
|
|
46
|
+
const argumentsTypes = [
|
|
47
|
+
null,
|
|
48
|
+
null,
|
|
49
|
+
'0x1::string::String',
|
|
50
|
+
'0x1::option::Option<u128>'
|
|
51
|
+
];
|
|
52
|
+
const parameterNames = ["config", "Cap", "symbol", "scaledPrice"];
|
|
53
|
+
return (tx) => tx.moveCall({
|
|
54
|
+
package: packageAddress,
|
|
55
|
+
module: 'constant_rule',
|
|
56
|
+
function: 'set_constant_price',
|
|
57
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Module for floating points */
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.ts';
|
|
6
|
+
export declare const Float: MoveStruct<{
|
|
7
|
+
value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u128">;
|
|
8
|
+
}, "bucket_v2_framework::float::Float">;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Module for floating points */
|
|
5
|
+
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
7
|
+
const $moduleName = 'bucket_v2_framework::float';
|
|
8
|
+
export const Float = new MoveStruct({ name: `${$moduleName}::Float`, fields: {
|
|
9
|
+
value: bcs.u128()
|
|
10
|
+
} });
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { type BcsType } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.ts';
|
|
6
|
+
/** An entry in the map */
|
|
7
|
+
export declare function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
|
|
8
|
+
K,
|
|
9
|
+
V
|
|
10
|
+
]): MoveStruct<{
|
|
11
|
+
key: K;
|
|
12
|
+
value: V;
|
|
13
|
+
}, `0x2::vec_map::Entry<${K["name"]}, ${V["name"]}>`>;
|
|
14
|
+
/**
|
|
15
|
+
* A map data structure backed by a vector. The map is guaranteed not to contain
|
|
16
|
+
* duplicate keys, but entries are _not_ sorted by key--entries are included in
|
|
17
|
+
* insertion order. All operations are O(N) in the size of the map--the intention
|
|
18
|
+
* of this data structure is only to provide the convenience of programming against
|
|
19
|
+
* a map API. Large maps should use handwritten parent/child relationships instead.
|
|
20
|
+
* Maps that need sorted iteration rather than insertion order iteration should
|
|
21
|
+
* also be handwritten.
|
|
22
|
+
*/
|
|
23
|
+
export declare function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
|
|
24
|
+
K,
|
|
25
|
+
V
|
|
26
|
+
]): MoveStruct<{
|
|
27
|
+
contents: BcsType<{
|
|
28
|
+
key: K extends BcsType<infer U, any, string> ? U : never;
|
|
29
|
+
value: V extends BcsType<infer U, any, string> ? U : never;
|
|
30
|
+
}[], Iterable<{
|
|
31
|
+
key: K extends BcsType<any, infer U_1, string> ? U_1 : never;
|
|
32
|
+
value: V extends BcsType<any, infer U_1, string> ? U_1 : never;
|
|
33
|
+
}> & {
|
|
34
|
+
length: number;
|
|
35
|
+
}, string>;
|
|
36
|
+
}, `0x2::vec_map::VecMap<${K["name"]}, ${V["name"]}>`>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct } from "../../../utils/index.js";
|
|
6
|
+
const $moduleName = '0x2::vec_map';
|
|
7
|
+
/** An entry in the map */
|
|
8
|
+
export function Entry(...typeParameters) {
|
|
9
|
+
return new MoveStruct({ name: `${$moduleName}::Entry<${typeParameters[0].name}, ${typeParameters[1].name}>`, fields: {
|
|
10
|
+
key: typeParameters[0],
|
|
11
|
+
value: typeParameters[1]
|
|
12
|
+
} });
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A map data structure backed by a vector. The map is guaranteed not to contain
|
|
16
|
+
* duplicate keys, but entries are _not_ sorted by key--entries are included in
|
|
17
|
+
* insertion order. All operations are O(N) in the size of the map--the intention
|
|
18
|
+
* of this data structure is only to provide the convenience of programming against
|
|
19
|
+
* a map API. Large maps should use handwritten parent/child relationships instead.
|
|
20
|
+
* Maps that need sorted iteration rather than insertion order iteration should
|
|
21
|
+
* also be handwritten.
|
|
22
|
+
*/
|
|
23
|
+
export function VecMap(...typeParameters) {
|
|
24
|
+
return new MoveStruct({ name: `${$moduleName}::VecMap<${typeParameters[0].name}, ${typeParameters[1].name}>`, fields: {
|
|
25
|
+
contents: bcs.vector(Entry(typeParameters[0], typeParameters[1]))
|
|
26
|
+
} });
|
|
27
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**************************************************************/
|
|
4
4
|
import { MoveTuple, MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
5
5
|
import { type BcsType } from '@mysten/sui/bcs';
|
|
6
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
6
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
7
7
|
export declare const CapKey: MoveTuple<readonly [BcsType<boolean, boolean, "bool">], "@waterx/credit::credit_registry::CapKey">;
|
|
8
8
|
export declare const Mint: MoveStruct<{
|
|
9
9
|
amount: BcsType<string, string | number | bigint, "u64">;
|
|
@@ -428,7 +428,7 @@ export interface CollectArguments<M extends BcsType<any>> {
|
|
|
428
428
|
Witness: RawTransactionArgument<M>;
|
|
429
429
|
version: RawTransactionArgument<number>;
|
|
430
430
|
memo: RawTransactionArgument<string>;
|
|
431
|
-
balance:
|
|
431
|
+
balance: TransactionArgument;
|
|
432
432
|
}
|
|
433
433
|
export interface CollectOptions<M extends BcsType<any>> {
|
|
434
434
|
package?: string;
|
|
@@ -437,7 +437,7 @@ export interface CollectOptions<M extends BcsType<any>> {
|
|
|
437
437
|
Witness: RawTransactionArgument<M>,
|
|
438
438
|
version: RawTransactionArgument<number>,
|
|
439
439
|
memo: RawTransactionArgument<string>,
|
|
440
|
-
balance:
|
|
440
|
+
balance: TransactionArgument
|
|
441
441
|
];
|
|
442
442
|
typeArguments: [
|
|
443
443
|
string,
|
|
@@ -449,13 +449,13 @@ export interface CollectOptions<M extends BcsType<any>> {
|
|
|
449
449
|
export declare function collect<M extends BcsType<any>>(options: CollectOptions<M>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
450
450
|
export interface ClaimArguments {
|
|
451
451
|
registry: RawTransactionArgument<string>;
|
|
452
|
-
request:
|
|
452
|
+
request: TransactionArgument;
|
|
453
453
|
}
|
|
454
454
|
export interface ClaimOptions {
|
|
455
455
|
package?: string;
|
|
456
456
|
arguments: ClaimArguments | [
|
|
457
457
|
registry: RawTransactionArgument<string>,
|
|
458
|
-
request:
|
|
458
|
+
request: TransactionArgument
|
|
459
459
|
];
|
|
460
460
|
typeArguments: [
|
|
461
461
|
string,
|
|
@@ -498,22 +498,22 @@ export interface ModuleConfigMapOptions {
|
|
|
498
498
|
}
|
|
499
499
|
export declare function moduleConfigMap(options: ModuleConfigMapOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
500
500
|
export interface LimitedSupplyArguments {
|
|
501
|
-
config:
|
|
501
|
+
config: TransactionArgument;
|
|
502
502
|
}
|
|
503
503
|
export interface LimitedSupplyOptions {
|
|
504
504
|
package?: string;
|
|
505
505
|
arguments: LimitedSupplyArguments | [
|
|
506
|
-
config:
|
|
506
|
+
config: TransactionArgument
|
|
507
507
|
];
|
|
508
508
|
}
|
|
509
509
|
export declare function limitedSupply(options: LimitedSupplyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
510
510
|
export interface ValidVersionsArguments {
|
|
511
|
-
config:
|
|
511
|
+
config: TransactionArgument;
|
|
512
512
|
}
|
|
513
513
|
export interface ValidVersionsOptions {
|
|
514
514
|
package?: string;
|
|
515
515
|
arguments: ValidVersionsArguments | [
|
|
516
|
-
config:
|
|
516
|
+
config: TransactionArgument
|
|
517
517
|
];
|
|
518
518
|
}
|
|
519
519
|
export declare function validVersions(options: ValidVersionsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|