@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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/** Module for the record of Credit and Debt of certain entity */
|
|
5
5
|
import { MoveTuple, MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
6
6
|
import { type BcsType } from '@mysten/sui/bcs';
|
|
7
|
-
import { type Transaction } from '@mysten/sui/transactions';
|
|
7
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
8
8
|
export declare const Entity: MoveTuple<readonly [MoveStruct<{
|
|
9
9
|
name: BcsType<string, string, "string">;
|
|
10
10
|
}, "std::type_name::TypeName">], "@bucket/framework::sheet::Entity">;
|
|
@@ -105,15 +105,15 @@ export interface NewOptions<E extends BcsType<any>> {
|
|
|
105
105
|
/** Public Funs */
|
|
106
106
|
export declare function _new<E extends BcsType<any>>(options: NewOptions<E>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
107
107
|
export interface LendArguments<L extends BcsType<any>> {
|
|
108
|
-
sheet:
|
|
109
|
-
balance:
|
|
108
|
+
sheet: TransactionArgument;
|
|
109
|
+
balance: TransactionArgument;
|
|
110
110
|
LenderStamp: RawTransactionArgument<L>;
|
|
111
111
|
}
|
|
112
112
|
export interface LendOptions<L extends BcsType<any>> {
|
|
113
113
|
package?: string;
|
|
114
114
|
arguments: LendArguments<L> | [
|
|
115
|
-
sheet:
|
|
116
|
-
balance:
|
|
115
|
+
sheet: TransactionArgument,
|
|
116
|
+
balance: TransactionArgument,
|
|
117
117
|
LenderStamp: RawTransactionArgument<L>
|
|
118
118
|
];
|
|
119
119
|
typeArguments: [
|
|
@@ -124,15 +124,15 @@ export interface LendOptions<L extends BcsType<any>> {
|
|
|
124
124
|
}
|
|
125
125
|
export declare function lend<L extends BcsType<any>>(options: LendOptions<L>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
126
126
|
export interface ReceiveArguments<R extends BcsType<any>> {
|
|
127
|
-
sheet:
|
|
128
|
-
loan:
|
|
127
|
+
sheet: TransactionArgument;
|
|
128
|
+
loan: TransactionArgument;
|
|
129
129
|
ReceiverStamp: RawTransactionArgument<R>;
|
|
130
130
|
}
|
|
131
131
|
export interface ReceiveOptions<R extends BcsType<any>> {
|
|
132
132
|
package?: string;
|
|
133
133
|
arguments: ReceiveArguments<R> | [
|
|
134
|
-
sheet:
|
|
135
|
-
loan:
|
|
134
|
+
sheet: TransactionArgument,
|
|
135
|
+
loan: TransactionArgument,
|
|
136
136
|
ReceiverStamp: RawTransactionArgument<R>
|
|
137
137
|
];
|
|
138
138
|
typeArguments: [
|
|
@@ -144,14 +144,14 @@ export interface ReceiveOptions<R extends BcsType<any>> {
|
|
|
144
144
|
export declare function receive<R extends BcsType<any>>(options: ReceiveOptions<R>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
145
145
|
export interface RequestArguments<C extends BcsType<any>> {
|
|
146
146
|
requirement: RawTransactionArgument<number | bigint>;
|
|
147
|
-
checklist:
|
|
147
|
+
checklist: TransactionArgument;
|
|
148
148
|
CollectorStamp: RawTransactionArgument<C>;
|
|
149
149
|
}
|
|
150
150
|
export interface RequestOptions<C extends BcsType<any>> {
|
|
151
151
|
package?: string;
|
|
152
152
|
arguments: RequestArguments<C> | [
|
|
153
153
|
requirement: RawTransactionArgument<number | bigint>,
|
|
154
|
-
checklist:
|
|
154
|
+
checklist: TransactionArgument,
|
|
155
155
|
CollectorStamp: RawTransactionArgument<C>
|
|
156
156
|
];
|
|
157
157
|
typeArguments: [
|
|
@@ -161,17 +161,17 @@ export interface RequestOptions<C extends BcsType<any>> {
|
|
|
161
161
|
}
|
|
162
162
|
export declare function request<C extends BcsType<any>>(options: RequestOptions<C>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
163
163
|
export interface PayArguments<P extends BcsType<any>> {
|
|
164
|
-
sheet:
|
|
165
|
-
req:
|
|
166
|
-
balance:
|
|
164
|
+
sheet: TransactionArgument;
|
|
165
|
+
req: TransactionArgument;
|
|
166
|
+
balance: TransactionArgument;
|
|
167
167
|
PayerStamp: RawTransactionArgument<P>;
|
|
168
168
|
}
|
|
169
169
|
export interface PayOptions<P extends BcsType<any>> {
|
|
170
170
|
package?: string;
|
|
171
171
|
arguments: PayArguments<P> | [
|
|
172
|
-
sheet:
|
|
173
|
-
req:
|
|
174
|
-
balance:
|
|
172
|
+
sheet: TransactionArgument,
|
|
173
|
+
req: TransactionArgument,
|
|
174
|
+
balance: TransactionArgument,
|
|
175
175
|
PayerStamp: RawTransactionArgument<P>
|
|
176
176
|
];
|
|
177
177
|
typeArguments: [
|
|
@@ -182,15 +182,15 @@ export interface PayOptions<P extends BcsType<any>> {
|
|
|
182
182
|
}
|
|
183
183
|
export declare function pay<P extends BcsType<any>>(options: PayOptions<P>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
184
184
|
export interface CollectArguments<C extends BcsType<any>> {
|
|
185
|
-
sheet:
|
|
186
|
-
req:
|
|
185
|
+
sheet: TransactionArgument;
|
|
186
|
+
req: TransactionArgument;
|
|
187
187
|
Stamp: RawTransactionArgument<C>;
|
|
188
188
|
}
|
|
189
189
|
export interface CollectOptions<C extends BcsType<any>> {
|
|
190
190
|
package?: string;
|
|
191
191
|
arguments: CollectArguments<C> | [
|
|
192
|
-
sheet:
|
|
193
|
-
req:
|
|
192
|
+
sheet: TransactionArgument,
|
|
193
|
+
req: TransactionArgument,
|
|
194
194
|
Stamp: RawTransactionArgument<C>
|
|
195
195
|
];
|
|
196
196
|
typeArguments: [
|
|
@@ -200,15 +200,15 @@ export interface CollectOptions<C extends BcsType<any>> {
|
|
|
200
200
|
}
|
|
201
201
|
export declare function collect<C extends BcsType<any>>(options: CollectOptions<C>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
202
202
|
export interface AddDebtorArguments<E extends BcsType<any>> {
|
|
203
|
-
sheet:
|
|
204
|
-
debtor:
|
|
203
|
+
sheet: TransactionArgument;
|
|
204
|
+
debtor: TransactionArgument;
|
|
205
205
|
Stamp: RawTransactionArgument<E>;
|
|
206
206
|
}
|
|
207
207
|
export interface AddDebtorOptions<E extends BcsType<any>> {
|
|
208
208
|
package?: string;
|
|
209
209
|
arguments: AddDebtorArguments<E> | [
|
|
210
|
-
sheet:
|
|
211
|
-
debtor:
|
|
210
|
+
sheet: TransactionArgument,
|
|
211
|
+
debtor: TransactionArgument,
|
|
212
212
|
Stamp: RawTransactionArgument<E>
|
|
213
213
|
];
|
|
214
214
|
typeArguments: [
|
|
@@ -218,15 +218,15 @@ export interface AddDebtorOptions<E extends BcsType<any>> {
|
|
|
218
218
|
}
|
|
219
219
|
export declare function addDebtor<E extends BcsType<any>>(options: AddDebtorOptions<E>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
220
220
|
export interface AddCreditorArguments<E extends BcsType<any>> {
|
|
221
|
-
sheet:
|
|
222
|
-
creditor:
|
|
221
|
+
sheet: TransactionArgument;
|
|
222
|
+
creditor: TransactionArgument;
|
|
223
223
|
Stamp: RawTransactionArgument<E>;
|
|
224
224
|
}
|
|
225
225
|
export interface AddCreditorOptions<E extends BcsType<any>> {
|
|
226
226
|
package?: string;
|
|
227
227
|
arguments: AddCreditorArguments<E> | [
|
|
228
|
-
sheet:
|
|
229
|
-
creditor:
|
|
228
|
+
sheet: TransactionArgument,
|
|
229
|
+
creditor: TransactionArgument,
|
|
230
230
|
Stamp: RawTransactionArgument<E>
|
|
231
231
|
];
|
|
232
232
|
typeArguments: [
|
|
@@ -236,15 +236,15 @@ export interface AddCreditorOptions<E extends BcsType<any>> {
|
|
|
236
236
|
}
|
|
237
237
|
export declare function addCreditor<E extends BcsType<any>>(options: AddCreditorOptions<E>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
238
238
|
export interface BanArguments<E extends BcsType<any>> {
|
|
239
|
-
sheet:
|
|
240
|
-
entity:
|
|
239
|
+
sheet: TransactionArgument;
|
|
240
|
+
entity: TransactionArgument;
|
|
241
241
|
Stamp: RawTransactionArgument<E>;
|
|
242
242
|
}
|
|
243
243
|
export interface BanOptions<E extends BcsType<any>> {
|
|
244
244
|
package?: string;
|
|
245
245
|
arguments: BanArguments<E> | [
|
|
246
|
-
sheet:
|
|
247
|
-
entity:
|
|
246
|
+
sheet: TransactionArgument,
|
|
247
|
+
entity: TransactionArgument,
|
|
248
248
|
Stamp: RawTransactionArgument<E>
|
|
249
249
|
];
|
|
250
250
|
typeArguments: [
|
|
@@ -254,15 +254,15 @@ export interface BanOptions<E extends BcsType<any>> {
|
|
|
254
254
|
}
|
|
255
255
|
export declare function ban<E extends BcsType<any>>(options: BanOptions<E>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
256
256
|
export interface UnbanArguments<E extends BcsType<any>> {
|
|
257
|
-
sheet:
|
|
258
|
-
entity:
|
|
257
|
+
sheet: TransactionArgument;
|
|
258
|
+
entity: TransactionArgument;
|
|
259
259
|
Stamp: RawTransactionArgument<E>;
|
|
260
260
|
}
|
|
261
261
|
export interface UnbanOptions<E extends BcsType<any>> {
|
|
262
262
|
package?: string;
|
|
263
263
|
arguments: UnbanArguments<E> | [
|
|
264
|
-
sheet:
|
|
265
|
-
entity:
|
|
264
|
+
sheet: TransactionArgument,
|
|
265
|
+
entity: TransactionArgument,
|
|
266
266
|
Stamp: RawTransactionArgument<E>
|
|
267
267
|
];
|
|
268
268
|
typeArguments: [
|
|
@@ -282,12 +282,12 @@ export interface EntityOptions {
|
|
|
282
282
|
/** Getter Funs */
|
|
283
283
|
export declare function entity(options: EntityOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
284
284
|
export interface CreditsArguments {
|
|
285
|
-
sheet:
|
|
285
|
+
sheet: TransactionArgument;
|
|
286
286
|
}
|
|
287
287
|
export interface CreditsOptions {
|
|
288
288
|
package?: string;
|
|
289
289
|
arguments: CreditsArguments | [
|
|
290
|
-
sheet:
|
|
290
|
+
sheet: TransactionArgument
|
|
291
291
|
];
|
|
292
292
|
typeArguments: [
|
|
293
293
|
string,
|
|
@@ -296,12 +296,12 @@ export interface CreditsOptions {
|
|
|
296
296
|
}
|
|
297
297
|
export declare function credits(options: CreditsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
298
298
|
export interface DebtsArguments {
|
|
299
|
-
sheet:
|
|
299
|
+
sheet: TransactionArgument;
|
|
300
300
|
}
|
|
301
301
|
export interface DebtsOptions {
|
|
302
302
|
package?: string;
|
|
303
303
|
arguments: DebtsArguments | [
|
|
304
|
-
sheet:
|
|
304
|
+
sheet: TransactionArgument
|
|
305
305
|
];
|
|
306
306
|
typeArguments: [
|
|
307
307
|
string,
|
|
@@ -310,12 +310,12 @@ export interface DebtsOptions {
|
|
|
310
310
|
}
|
|
311
311
|
export declare function debts(options: DebtsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
312
312
|
export interface BlacklistArguments {
|
|
313
|
-
sheet:
|
|
313
|
+
sheet: TransactionArgument;
|
|
314
314
|
}
|
|
315
315
|
export interface BlacklistOptions {
|
|
316
316
|
package?: string;
|
|
317
317
|
arguments: BlacklistArguments | [
|
|
318
|
-
sheet:
|
|
318
|
+
sheet: TransactionArgument
|
|
319
319
|
];
|
|
320
320
|
typeArguments: [
|
|
321
321
|
string,
|
|
@@ -324,12 +324,12 @@ export interface BlacklistOptions {
|
|
|
324
324
|
}
|
|
325
325
|
export declare function blacklist(options: BlacklistOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
326
326
|
export interface TotalCreditArguments {
|
|
327
|
-
sheet:
|
|
327
|
+
sheet: TransactionArgument;
|
|
328
328
|
}
|
|
329
329
|
export interface TotalCreditOptions {
|
|
330
330
|
package?: string;
|
|
331
331
|
arguments: TotalCreditArguments | [
|
|
332
|
-
sheet:
|
|
332
|
+
sheet: TransactionArgument
|
|
333
333
|
];
|
|
334
334
|
typeArguments: [
|
|
335
335
|
string,
|
|
@@ -338,12 +338,12 @@ export interface TotalCreditOptions {
|
|
|
338
338
|
}
|
|
339
339
|
export declare function totalCredit(options: TotalCreditOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
340
340
|
export interface TotalDebtArguments {
|
|
341
|
-
sheet:
|
|
341
|
+
sheet: TransactionArgument;
|
|
342
342
|
}
|
|
343
343
|
export interface TotalDebtOptions {
|
|
344
344
|
package?: string;
|
|
345
345
|
arguments: TotalDebtArguments | [
|
|
346
|
-
sheet:
|
|
346
|
+
sheet: TransactionArgument
|
|
347
347
|
];
|
|
348
348
|
typeArguments: [
|
|
349
349
|
string,
|
|
@@ -352,12 +352,12 @@ export interface TotalDebtOptions {
|
|
|
352
352
|
}
|
|
353
353
|
export declare function totalDebt(options: TotalDebtOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
354
354
|
export interface LoanValueArguments {
|
|
355
|
-
loan:
|
|
355
|
+
loan: TransactionArgument;
|
|
356
356
|
}
|
|
357
357
|
export interface LoanValueOptions {
|
|
358
358
|
package?: string;
|
|
359
359
|
arguments: LoanValueArguments | [
|
|
360
|
-
loan:
|
|
360
|
+
loan: TransactionArgument
|
|
361
361
|
];
|
|
362
362
|
typeArguments: [
|
|
363
363
|
string,
|
|
@@ -367,12 +367,12 @@ export interface LoanValueOptions {
|
|
|
367
367
|
}
|
|
368
368
|
export declare function loanValue(options: LoanValueOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
369
369
|
export interface RequirementArguments {
|
|
370
|
-
req:
|
|
370
|
+
req: TransactionArgument;
|
|
371
371
|
}
|
|
372
372
|
export interface RequirementOptions {
|
|
373
373
|
package?: string;
|
|
374
374
|
arguments: RequirementArguments | [
|
|
375
|
-
req:
|
|
375
|
+
req: TransactionArgument
|
|
376
376
|
];
|
|
377
377
|
typeArguments: [
|
|
378
378
|
string,
|
|
@@ -381,12 +381,12 @@ export interface RequirementOptions {
|
|
|
381
381
|
}
|
|
382
382
|
export declare function requirement(options: RequirementOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
383
383
|
export interface BalanceArguments {
|
|
384
|
-
req:
|
|
384
|
+
req: TransactionArgument;
|
|
385
385
|
}
|
|
386
386
|
export interface BalanceOptions {
|
|
387
387
|
package?: string;
|
|
388
388
|
arguments: BalanceArguments | [
|
|
389
|
-
req:
|
|
389
|
+
req: TransactionArgument
|
|
390
390
|
];
|
|
391
391
|
typeArguments: [
|
|
392
392
|
string,
|
|
@@ -395,12 +395,12 @@ export interface BalanceOptions {
|
|
|
395
395
|
}
|
|
396
396
|
export declare function balance(options: BalanceOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
397
397
|
export interface ShortageArguments {
|
|
398
|
-
req:
|
|
398
|
+
req: TransactionArgument;
|
|
399
399
|
}
|
|
400
400
|
export interface ShortageOptions {
|
|
401
401
|
package?: string;
|
|
402
402
|
arguments: ShortageArguments | [
|
|
403
|
-
req:
|
|
403
|
+
req: TransactionArgument
|
|
404
404
|
];
|
|
405
405
|
typeArguments: [
|
|
406
406
|
string,
|
|
@@ -409,12 +409,12 @@ export interface ShortageOptions {
|
|
|
409
409
|
}
|
|
410
410
|
export declare function shortage(options: ShortageOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
411
411
|
export interface PayerDebtsArguments {
|
|
412
|
-
req:
|
|
412
|
+
req: TransactionArgument;
|
|
413
413
|
}
|
|
414
414
|
export interface PayerDebtsOptions {
|
|
415
415
|
package?: string;
|
|
416
416
|
arguments: PayerDebtsArguments | [
|
|
417
|
-
req:
|
|
417
|
+
req: TransactionArgument
|
|
418
418
|
];
|
|
419
419
|
typeArguments: [
|
|
420
420
|
string,
|
|
@@ -7,30 +7,24 @@ import { bcs } from '@mysten/sui/bcs';
|
|
|
7
7
|
import * as type_name from "./deps/std/type_name.js";
|
|
8
8
|
import * as vec_map from "./deps/sui/vec_map.js";
|
|
9
9
|
import * as liability from "./liability.js";
|
|
10
|
-
import * as vec_map_1 from "./deps/sui/vec_map.js";
|
|
11
|
-
import * as liability_1 from "./liability.js";
|
|
12
10
|
import * as vec_set from "./deps/sui/vec_set.js";
|
|
13
11
|
import * as balance_1 from "./deps/sui/balance.js";
|
|
14
|
-
import * as liability_2 from "./liability.js";
|
|
15
|
-
import * as balance_2 from "./deps/sui/balance.js";
|
|
16
|
-
import * as vec_map_2 from "./deps/sui/vec_map.js";
|
|
17
|
-
import * as liability_3 from "./liability.js";
|
|
18
12
|
const $moduleName = '@bucket/framework::sheet';
|
|
19
13
|
export const Entity = new MoveTuple({ name: `${$moduleName}::Entity`, fields: [type_name.TypeName] });
|
|
20
14
|
export const Sheet = new MoveStruct({ name: `${$moduleName}::Sheet<phantom CoinType, phantom SelfEntity>`, fields: {
|
|
21
15
|
credits: vec_map.VecMap(Entity, liability.Credit),
|
|
22
|
-
debts:
|
|
16
|
+
debts: vec_map.VecMap(Entity, liability.Debt),
|
|
23
17
|
blacklist: vec_set.VecSet(Entity)
|
|
24
18
|
} });
|
|
25
19
|
export const Loan = new MoveStruct({ name: `${$moduleName}::Loan<phantom CoinType, phantom Lender, phantom Receiver>`, fields: {
|
|
26
20
|
balance: balance_1.Balance,
|
|
27
|
-
debt:
|
|
21
|
+
debt: liability.Debt
|
|
28
22
|
} });
|
|
29
23
|
export const Request = new MoveStruct({ name: `${$moduleName}::Request<phantom CoinType, phantom Collector>`, fields: {
|
|
30
24
|
requirement: bcs.u64(),
|
|
31
|
-
balance:
|
|
25
|
+
balance: balance_1.Balance,
|
|
32
26
|
checklist: bcs.option(bcs.vector(Entity)),
|
|
33
|
-
payer_debts:
|
|
27
|
+
payer_debts: vec_map.VecMap(Entity, liability.Debt)
|
|
34
28
|
} });
|
|
35
29
|
/** Public Funs */
|
|
36
30
|
export function _new(options) {
|
|
@@ -83,7 +77,7 @@ export function request(options) {
|
|
|
83
77
|
const packageAddress = options.package ?? '@bucket/framework';
|
|
84
78
|
const argumentsTypes = [
|
|
85
79
|
'u64',
|
|
86
|
-
|
|
80
|
+
null,
|
|
87
81
|
`${options.typeArguments[1]}`
|
|
88
82
|
];
|
|
89
83
|
const parameterNames = ["requirement", "checklist", "CollectorStamp"];
|
|
@@ -2,31 +2,32 @@
|
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
4
|
import { MoveStruct, MoveTuple, type RawTransactionArgument } from '../utils/index.ts';
|
|
5
|
-
import { type
|
|
5
|
+
import { type BcsType } from '@mysten/sui/bcs';
|
|
6
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
6
7
|
export declare const NativeCustody: MoveStruct<{
|
|
7
|
-
dummy_field:
|
|
8
|
+
dummy_field: BcsType<boolean, boolean, "bool">;
|
|
8
9
|
}, "@waterx/native-custody::custody_vault::NativeCustody">;
|
|
9
10
|
export declare const FeeConfig: MoveStruct<{
|
|
10
11
|
mint_fee_rate: MoveStruct<{
|
|
11
|
-
value:
|
|
12
|
+
value: BcsType<string, string | number | bigint, "u128">;
|
|
12
13
|
}, "bucket_v2_framework::float::Float">;
|
|
13
14
|
burn_fee_rate: MoveStruct<{
|
|
14
|
-
value:
|
|
15
|
+
value: BcsType<string, string | number | bigint, "u128">;
|
|
15
16
|
}, "bucket_v2_framework::float::Float">;
|
|
16
17
|
}, "@waterx/native-custody::custody_vault::FeeConfig">;
|
|
17
18
|
export declare const SingleVault: MoveStruct<{
|
|
18
|
-
id:
|
|
19
|
-
decimal:
|
|
19
|
+
id: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
20
|
+
decimal: BcsType<number, number, "u8">;
|
|
20
21
|
default_fee_config: MoveStruct<{
|
|
21
22
|
mint_fee_rate: MoveStruct<{
|
|
22
|
-
value:
|
|
23
|
+
value: BcsType<string, string | number | bigint, "u128">;
|
|
23
24
|
}, "bucket_v2_framework::float::Float">;
|
|
24
25
|
burn_fee_rate: MoveStruct<{
|
|
25
|
-
value:
|
|
26
|
+
value: BcsType<string, string | number | bigint, "u128">;
|
|
26
27
|
}, "bucket_v2_framework::float::Float">;
|
|
27
28
|
}, "@waterx/native-custody::custody_vault::FeeConfig">;
|
|
28
29
|
partner_fee_configs: MoveStruct<{
|
|
29
|
-
contents:
|
|
30
|
+
contents: BcsType<{
|
|
30
31
|
key: string;
|
|
31
32
|
value: {
|
|
32
33
|
mint_fee_rate: {
|
|
@@ -50,15 +51,15 @@ export declare const SingleVault: MoveStruct<{
|
|
|
50
51
|
length: number;
|
|
51
52
|
}, string>;
|
|
52
53
|
}, "0x2::vec_map::VecMap<bytes[32], @waterx/native-custody::custody_vault::FeeConfig>">;
|
|
53
|
-
min_burn_amount:
|
|
54
|
+
min_burn_amount: BcsType<string, string | number | bigint, "u64">;
|
|
54
55
|
balance: MoveStruct<{
|
|
55
|
-
value:
|
|
56
|
+
value: BcsType<string, string | number | bigint, "u64">;
|
|
56
57
|
}, "0x2::balance::Balance<phantom T>">;
|
|
57
|
-
balance_amount:
|
|
58
|
-
credit_backing:
|
|
58
|
+
balance_amount: BcsType<string, string | number | bigint, "u64">;
|
|
59
|
+
credit_backing: BcsType<string, string | number | bigint, "u64">;
|
|
59
60
|
sheet: MoveStruct<{
|
|
60
61
|
credits: MoveStruct<{
|
|
61
|
-
contents:
|
|
62
|
+
contents: BcsType<{
|
|
62
63
|
key: [{
|
|
63
64
|
name: string;
|
|
64
65
|
}];
|
|
@@ -77,7 +78,7 @@ export declare const SingleVault: MoveStruct<{
|
|
|
77
78
|
}, string>;
|
|
78
79
|
}, "0x2::vec_map::VecMap<bucket_v2_framework::sheet::Entity, bucket_v2_framework::liability::Credit<phantom T>>">;
|
|
79
80
|
debts: MoveStruct<{
|
|
80
|
-
contents:
|
|
81
|
+
contents: BcsType<{
|
|
81
82
|
key: [{
|
|
82
83
|
name: string;
|
|
83
84
|
}];
|
|
@@ -97,11 +98,11 @@ export declare const SingleVault: MoveStruct<{
|
|
|
97
98
|
}, "0x2::vec_map::VecMap<bucket_v2_framework::sheet::Entity, bucket_v2_framework::liability::Debt<phantom T>>">;
|
|
98
99
|
blacklist: MoveStruct<any, any>;
|
|
99
100
|
}, "bucket_v2_framework::sheet::Sheet<phantom CoinType, phantom SelfEntity>">;
|
|
100
|
-
deprecated:
|
|
101
|
+
deprecated: BcsType<boolean, boolean, "bool">;
|
|
101
102
|
}, "@waterx/native-custody::custody_vault::SingleVault<phantom T>">;
|
|
102
103
|
export declare const CustodyVault: MoveStruct<{
|
|
103
|
-
id:
|
|
104
|
-
credit_supply:
|
|
104
|
+
id: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
105
|
+
credit_supply: BcsType<string, string | number | bigint, "u64">;
|
|
105
106
|
/**
|
|
106
107
|
* Admin-managed package-version allowlist used by admin paths that don't already
|
|
107
108
|
* thread `&CreditRegistry`. mint/burn paths keep the CreditRegistry-based
|
|
@@ -111,7 +112,7 @@ export declare const CustodyVault: MoveStruct<{
|
|
|
111
112
|
*/
|
|
112
113
|
allowed_versions: MoveStruct<any, any>;
|
|
113
114
|
}, "@waterx/native-custody::custody_vault::CustodyVault<phantom CREDIT>">;
|
|
114
|
-
export declare const VaultKey: MoveTuple<readonly [
|
|
115
|
+
export declare const VaultKey: MoveTuple<readonly [BcsType<boolean, boolean, "bool">], "@waterx/native-custody::custody_vault::VaultKey<phantom T>">;
|
|
115
116
|
export interface PackageVersionOptions {
|
|
116
117
|
package?: string;
|
|
117
118
|
arguments?: [
|
|
@@ -326,7 +327,7 @@ export interface MintArguments {
|
|
|
326
327
|
accountRegistry: RawTransactionArgument<string>;
|
|
327
328
|
accountId: RawTransactionArgument<string>;
|
|
328
329
|
assetCoin: RawTransactionArgument<string>;
|
|
329
|
-
extraData: RawTransactionArgument<number
|
|
330
|
+
extraData: RawTransactionArgument<Array<number>>;
|
|
330
331
|
}
|
|
331
332
|
export interface MintOptions {
|
|
332
333
|
package?: string;
|
|
@@ -336,7 +337,7 @@ export interface MintOptions {
|
|
|
336
337
|
accountRegistry: RawTransactionArgument<string>,
|
|
337
338
|
accountId: RawTransactionArgument<string>,
|
|
338
339
|
assetCoin: RawTransactionArgument<string>,
|
|
339
|
-
extraData: RawTransactionArgument<number
|
|
340
|
+
extraData: RawTransactionArgument<Array<number>>
|
|
340
341
|
];
|
|
341
342
|
typeArguments: [
|
|
342
343
|
string,
|
|
@@ -356,7 +357,7 @@ export interface MintFromRequestArguments {
|
|
|
356
357
|
vault: RawTransactionArgument<string>;
|
|
357
358
|
registry: RawTransactionArgument<string>;
|
|
358
359
|
accountRegistry: RawTransactionArgument<string>;
|
|
359
|
-
depositRequest:
|
|
360
|
+
depositRequest: TransactionArgument;
|
|
360
361
|
}
|
|
361
362
|
export interface MintFromRequestOptions {
|
|
362
363
|
package?: string;
|
|
@@ -364,7 +365,7 @@ export interface MintFromRequestOptions {
|
|
|
364
365
|
vault: RawTransactionArgument<string>,
|
|
365
366
|
registry: RawTransactionArgument<string>,
|
|
366
367
|
accountRegistry: RawTransactionArgument<string>,
|
|
367
|
-
depositRequest:
|
|
368
|
+
depositRequest: TransactionArgument
|
|
368
369
|
];
|
|
369
370
|
typeArguments: [
|
|
370
371
|
string,
|
|
@@ -379,33 +380,46 @@ export interface MintFromRequestOptions {
|
|
|
379
380
|
* as the input request.
|
|
380
381
|
*/
|
|
381
382
|
export declare function mintFromRequest(options: MintFromRequestOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
382
|
-
export interface
|
|
383
|
+
export interface BurnAuthorizedArguments<M extends BcsType<any>> {
|
|
383
384
|
vault: RawTransactionArgument<string>;
|
|
384
385
|
registry: RawTransactionArgument<string>;
|
|
386
|
+
Witness: RawTransactionArgument<M>;
|
|
387
|
+
version: RawTransactionArgument<number>;
|
|
385
388
|
accountId: RawTransactionArgument<string>;
|
|
386
389
|
creditCoin: RawTransactionArgument<string>;
|
|
387
390
|
}
|
|
388
|
-
export interface
|
|
391
|
+
export interface BurnAuthorizedOptions<M extends BcsType<any>> {
|
|
389
392
|
package?: string;
|
|
390
|
-
arguments:
|
|
393
|
+
arguments: BurnAuthorizedArguments<M> | [
|
|
391
394
|
vault: RawTransactionArgument<string>,
|
|
392
395
|
registry: RawTransactionArgument<string>,
|
|
396
|
+
Witness: RawTransactionArgument<M>,
|
|
397
|
+
version: RawTransactionArgument<number>,
|
|
393
398
|
accountId: RawTransactionArgument<string>,
|
|
394
399
|
creditCoin: RawTransactionArgument<string>
|
|
395
400
|
];
|
|
396
401
|
typeArguments: [
|
|
402
|
+
string,
|
|
397
403
|
string,
|
|
398
404
|
string
|
|
399
405
|
];
|
|
400
406
|
}
|
|
401
407
|
/**
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
408
|
+
* Account-authorized burn. Only callable by a `CreditRegistry`-registered module
|
|
409
|
+
* witness `M` (production: `WithdrawQueue`, via
|
|
410
|
+
* `withdrawal_queue::execute_native`), which vouches that `account_id` is the
|
|
411
|
+
* genuine originating wxa Account. `account_id` keys (a) the credit registry's
|
|
412
|
+
* personal-burn-cap and (b) the partner-fee lookup — so cap accounting and partner
|
|
413
|
+
* discounts bind to the source account, not whoever executes the queue entry
|
|
414
|
+
* (audit findings #3 / L03 / M14).
|
|
415
|
+
*
|
|
416
|
+
* There is intentionally no unauthenticated public burn: a raw `Coin<CREDIT>`
|
|
417
|
+
* holder cannot burn against a spoofed `account_id` to dodge burn fees or
|
|
418
|
+
* per-account burn caps. CREDIT exits route through the withdrawal queue. A
|
|
419
|
+
* direct-burn entrypoint can be re-added later as a new (additive) function if a
|
|
420
|
+
* use case arises.
|
|
407
421
|
*/
|
|
408
|
-
export declare function
|
|
422
|
+
export declare function burnAuthorized<M extends BcsType<any>>(options: BurnAuthorizedOptions<M>): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
409
423
|
export interface CreditSupplyArguments {
|
|
410
424
|
vault: RawTransactionArgument<string>;
|
|
411
425
|
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { MoveStruct, MoveTuple, normalizeMoveArguments } from "../utils/index.js";
|
|
5
5
|
import { bcs } from '@mysten/sui/bcs';
|
|
6
6
|
import * as float from "./deps/bucket_v2_framework/float.js";
|
|
7
|
-
import * as float_1 from "./deps/bucket_v2_framework/float.js";
|
|
8
7
|
import * as vec_map from "./deps/sui/vec_map.js";
|
|
9
8
|
import * as balance_1 from "./deps/sui/balance.js";
|
|
10
9
|
import * as sheet_1 from "./deps/bucket_v2_framework/sheet.js";
|
|
@@ -15,7 +14,7 @@ export const NativeCustody = new MoveStruct({ name: `${$moduleName}::NativeCusto
|
|
|
15
14
|
} });
|
|
16
15
|
export const FeeConfig = new MoveStruct({ name: `${$moduleName}::FeeConfig`, fields: {
|
|
17
16
|
mint_fee_rate: float.Float,
|
|
18
|
-
burn_fee_rate:
|
|
17
|
+
burn_fee_rate: float.Float
|
|
19
18
|
} });
|
|
20
19
|
export const SingleVault = new MoveStruct({ name: `${$moduleName}::SingleVault<phantom T>`, fields: {
|
|
21
20
|
id: bcs.Address,
|
|
@@ -287,26 +286,36 @@ export function mintFromRequest(options) {
|
|
|
287
286
|
});
|
|
288
287
|
}
|
|
289
288
|
/**
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
289
|
+
* Account-authorized burn. Only callable by a `CreditRegistry`-registered module
|
|
290
|
+
* witness `M` (production: `WithdrawQueue`, via
|
|
291
|
+
* `withdrawal_queue::execute_native`), which vouches that `account_id` is the
|
|
292
|
+
* genuine originating wxa Account. `account_id` keys (a) the credit registry's
|
|
293
|
+
* personal-burn-cap and (b) the partner-fee lookup — so cap accounting and partner
|
|
294
|
+
* discounts bind to the source account, not whoever executes the queue entry
|
|
295
|
+
* (audit findings #3 / L03 / M14).
|
|
296
|
+
*
|
|
297
|
+
* There is intentionally no unauthenticated public burn: a raw `Coin<CREDIT>`
|
|
298
|
+
* holder cannot burn against a spoofed `account_id` to dodge burn fees or
|
|
299
|
+
* per-account burn caps. CREDIT exits route through the withdrawal queue. A
|
|
300
|
+
* direct-burn entrypoint can be re-added later as a new (additive) function if a
|
|
301
|
+
* use case arises.
|
|
295
302
|
*/
|
|
296
|
-
export function
|
|
303
|
+
export function burnAuthorized(options) {
|
|
297
304
|
const packageAddress = options.package ?? '@waterx/native-custody';
|
|
298
305
|
const argumentsTypes = [
|
|
299
306
|
null,
|
|
300
307
|
null,
|
|
308
|
+
`${options.typeArguments[2]}`,
|
|
309
|
+
'u16',
|
|
301
310
|
'0x2::object::ID',
|
|
302
311
|
null,
|
|
303
312
|
'0x2::clock::Clock'
|
|
304
313
|
];
|
|
305
|
-
const parameterNames = ["vault", "registry", "accountId", "creditCoin"];
|
|
314
|
+
const parameterNames = ["vault", "registry", "Witness", "version", "accountId", "creditCoin"];
|
|
306
315
|
return (tx) => tx.moveCall({
|
|
307
316
|
package: packageAddress,
|
|
308
317
|
module: 'custody_vault',
|
|
309
|
-
function: '
|
|
318
|
+
function: 'burn_authorized',
|
|
310
319
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
311
320
|
typeArguments: options.typeArguments
|
|
312
321
|
});
|
|
@@ -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
|
} });
|