stable-layer-sdk 0.0.3 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.test.d.ts +1 -0
- package/dist/client.test.js +146 -0
- package/dist/generated/stable_layer/deps/bucket_v2_framework/liability.d.ts +11 -0
- package/dist/generated/stable_layer/deps/bucket_v2_framework/liability.js +13 -0
- package/dist/generated/stable_layer/deps/bucket_v2_framework/sheet.d.ts +57 -0
- package/dist/generated/stable_layer/deps/bucket_v2_framework/sheet.js +16 -0
- package/dist/generated/stable_layer/deps/std/type_name.d.ts +17 -0
- package/dist/generated/stable_layer/deps/std/type_name.js +19 -0
- package/dist/generated/stable_layer/deps/sui/balance.d.ts +12 -0
- package/dist/generated/stable_layer/deps/sui/balance.js +14 -0
- package/dist/generated/stable_layer/deps/sui/coin.d.ts +16 -0
- package/dist/generated/stable_layer/deps/sui/coin.js +15 -0
- package/dist/generated/stable_layer/deps/sui/object.d.ts +8 -0
- package/dist/generated/stable_layer/deps/sui/object.js +10 -0
- package/dist/generated/stable_layer/deps/sui/vec_map.d.ts +36 -0
- package/dist/generated/stable_layer/deps/sui/vec_map.js +27 -0
- package/dist/generated/stable_layer/deps/sui/vec_set.d.ts +20 -0
- package/dist/generated/stable_layer/deps/sui/vec_set.js +19 -0
- package/dist/generated/stable_layer/stable_layer.d.ts +427 -0
- package/dist/generated/stable_layer/stable_layer.js +365 -0
- package/dist/generated/stable_vault_farm/deps/bucket_v2_framework/liability.d.ts +11 -0
- package/dist/generated/stable_vault_farm/deps/bucket_v2_framework/liability.js +13 -0
- package/dist/generated/stable_vault_farm/deps/bucket_v2_framework/sheet.d.ts +57 -0
- package/dist/generated/stable_vault_farm/deps/bucket_v2_framework/sheet.js +16 -0
- package/dist/generated/stable_vault_farm/deps/std/type_name.d.ts +17 -0
- package/dist/generated/stable_vault_farm/deps/std/type_name.js +19 -0
- package/dist/generated/stable_vault_farm/deps/sui/balance.d.ts +12 -0
- package/dist/generated/stable_vault_farm/deps/sui/balance.js +14 -0
- package/dist/generated/stable_vault_farm/deps/sui/object.d.ts +8 -0
- package/dist/generated/stable_vault_farm/deps/sui/object.js +10 -0
- package/dist/generated/stable_vault_farm/deps/sui/table.d.ts +31 -0
- package/dist/generated/stable_vault_farm/deps/sui/table.js +32 -0
- package/dist/generated/stable_vault_farm/deps/sui/vec_map.d.ts +36 -0
- package/dist/generated/stable_vault_farm/deps/sui/vec_map.js +27 -0
- package/dist/generated/stable_vault_farm/deps/sui/vec_set.d.ts +20 -0
- package/dist/generated/stable_vault_farm/deps/sui/vec_set.js +19 -0
- package/dist/generated/stable_vault_farm/stable_vault_farm.d.ts +242 -0
- package/dist/generated/stable_vault_farm/stable_vault_farm.js +163 -0
- package/dist/generated/utils/index.d.ts +11 -0
- package/dist/generated/utils/index.js +131 -0
- package/dist/generated/yield_usdb/buffer.d.ts +137 -0
- package/dist/generated/yield_usdb/buffer.js +157 -0
- package/dist/generated/yield_usdb/deps/bucket_v2_framework/account.d.ts +11 -0
- package/dist/generated/yield_usdb/deps/bucket_v2_framework/account.js +12 -0
- package/dist/generated/yield_usdb/deps/bucket_v2_framework/double.d.ts +8 -0
- package/dist/generated/yield_usdb/deps/bucket_v2_framework/double.js +10 -0
- package/dist/generated/yield_usdb/deps/sui/balance.d.ts +15 -0
- package/dist/generated/yield_usdb/deps/sui/balance.js +17 -0
- package/dist/generated/yield_usdb/deps/sui/coin.d.ts +16 -0
- package/dist/generated/yield_usdb/deps/sui/coin.js +15 -0
- package/dist/generated/yield_usdb/deps/sui/object.d.ts +8 -0
- package/dist/generated/yield_usdb/deps/sui/object.js +10 -0
- package/dist/generated/yield_usdb/deps/sui/vec_set.d.ts +20 -0
- package/dist/generated/yield_usdb/deps/sui/vec_set.js +19 -0
- package/dist/generated/yield_usdb/yield_usdb.d.ts +475 -0
- package/dist/generated/yield_usdb/yield_usdb.js +444 -0
- package/dist/index.d.ts +16 -19
- package/dist/index.js +235 -30
- package/dist/interface.d.ts +25 -0
- package/dist/interface.js +1 -0
- package/dist/libs/constants.d.ts +15 -0
- package/dist/libs/constants.js +18 -0
- package/package.json +19 -4
|
@@ -0,0 +1,365 @@
|
|
|
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 sheet_1 from './deps/bucket_v2_framework/sheet.js';
|
|
7
|
+
import * as object from './deps/sui/object.js';
|
|
8
|
+
import * as vec_set from './deps/sui/vec_set.js';
|
|
9
|
+
import * as coin from './deps/sui/coin.js';
|
|
10
|
+
const $moduleName = '@local-pkg/stable_factory.move::stable_layer';
|
|
11
|
+
export const NewStable = new MoveStruct({ name: `${$moduleName}::NewStable`, fields: {
|
|
12
|
+
u_type: bcs.string(),
|
|
13
|
+
stable_type: bcs.string(),
|
|
14
|
+
factory_id: bcs.Address,
|
|
15
|
+
factory_cap_id: bcs.Address
|
|
16
|
+
} });
|
|
17
|
+
export const Mint = new MoveStruct({ name: `${$moduleName}::Mint`, fields: {
|
|
18
|
+
u_type: bcs.string(),
|
|
19
|
+
stable_type: bcs.string(),
|
|
20
|
+
mint_amount: bcs.u64(),
|
|
21
|
+
farm_type: bcs.string()
|
|
22
|
+
} });
|
|
23
|
+
export const Burn = new MoveStruct({ name: `${$moduleName}::Burn`, fields: {
|
|
24
|
+
u_type: bcs.string(),
|
|
25
|
+
stable_type: bcs.string(),
|
|
26
|
+
burn_amount: bcs.u64(),
|
|
27
|
+
farm_types: bcs.vector(sheet_1.Entity),
|
|
28
|
+
repayment_amounts: bcs.vector(bcs.u64())
|
|
29
|
+
} });
|
|
30
|
+
export const StableFactoryEntity = new MoveStruct({ name: `${$moduleName}::StableFactoryEntity`, fields: {
|
|
31
|
+
dummy_field: bcs.bool()
|
|
32
|
+
} });
|
|
33
|
+
export const StableRegistry = new MoveStruct({ name: `${$moduleName}::StableRegistry`, fields: {
|
|
34
|
+
id: object.UID,
|
|
35
|
+
versions: vec_set.VecSet(bcs.u16()),
|
|
36
|
+
total_supply: bcs.u64()
|
|
37
|
+
} });
|
|
38
|
+
export const AdminCap = new MoveStruct({ name: `${$moduleName}::AdminCap`, fields: {
|
|
39
|
+
id: object.UID
|
|
40
|
+
} });
|
|
41
|
+
export const StableFactory = new MoveStruct({ name: `${$moduleName}::StableFactory`, fields: {
|
|
42
|
+
id: object.UID,
|
|
43
|
+
treasury_cap: coin.TreasuryCap,
|
|
44
|
+
max_supply: bcs.u64(),
|
|
45
|
+
sheet: sheet_1.Sheet,
|
|
46
|
+
managers: vec_set.VecSet(bcs.Address)
|
|
47
|
+
} });
|
|
48
|
+
export const FactoryCap = new MoveStruct({ name: `${$moduleName}::FactoryCap`, fields: {
|
|
49
|
+
id: object.UID,
|
|
50
|
+
factory_id: bcs.Address
|
|
51
|
+
} });
|
|
52
|
+
export function packageVersion(options = {}) {
|
|
53
|
+
var _a;
|
|
54
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
55
|
+
return (tx) => tx.moveCall({
|
|
56
|
+
package: packageAddress,
|
|
57
|
+
module: 'stable_layer',
|
|
58
|
+
function: 'package_version',
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Admin Funs */
|
|
62
|
+
export function _new(options) {
|
|
63
|
+
var _a;
|
|
64
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
65
|
+
const argumentsTypes = [
|
|
66
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
67
|
+
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::TreasuryCap<${options.typeArguments[0]}>`,
|
|
68
|
+
'u64'
|
|
69
|
+
];
|
|
70
|
+
const parameterNames = ["registry", "treasuryCap", "maxSupply"];
|
|
71
|
+
return (tx) => tx.moveCall({
|
|
72
|
+
package: packageAddress,
|
|
73
|
+
module: 'stable_layer',
|
|
74
|
+
function: 'new',
|
|
75
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
76
|
+
typeArguments: options.typeArguments
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
export function _default(options) {
|
|
80
|
+
var _a;
|
|
81
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
82
|
+
const argumentsTypes = [
|
|
83
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
84
|
+
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::TreasuryCap<${options.typeArguments[0]}>`,
|
|
85
|
+
'u64'
|
|
86
|
+
];
|
|
87
|
+
const parameterNames = ["registry", "treasuryCap", "maxSupply"];
|
|
88
|
+
return (tx) => tx.moveCall({
|
|
89
|
+
package: packageAddress,
|
|
90
|
+
module: 'stable_layer',
|
|
91
|
+
function: 'default',
|
|
92
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
93
|
+
typeArguments: options.typeArguments
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/** Admin Funs */
|
|
97
|
+
export function addVersion(options) {
|
|
98
|
+
var _a;
|
|
99
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
100
|
+
const argumentsTypes = [
|
|
101
|
+
`${packageAddress}::stable_layer::AdminCap`,
|
|
102
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
103
|
+
'u16'
|
|
104
|
+
];
|
|
105
|
+
const parameterNames = ["AdminCap", "registry", "version"];
|
|
106
|
+
return (tx) => tx.moveCall({
|
|
107
|
+
package: packageAddress,
|
|
108
|
+
module: 'stable_layer',
|
|
109
|
+
function: 'add_version',
|
|
110
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
export function removeVersion(options) {
|
|
114
|
+
var _a;
|
|
115
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
116
|
+
const argumentsTypes = [
|
|
117
|
+
`${packageAddress}::stable_layer::AdminCap`,
|
|
118
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
119
|
+
'u16'
|
|
120
|
+
];
|
|
121
|
+
const parameterNames = ["AdminCap", "registry", "version"];
|
|
122
|
+
return (tx) => tx.moveCall({
|
|
123
|
+
package: packageAddress,
|
|
124
|
+
module: 'stable_layer',
|
|
125
|
+
function: 'remove_version',
|
|
126
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/** Factory Cap Funs */
|
|
130
|
+
export function addEntity(options) {
|
|
131
|
+
var _a;
|
|
132
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
133
|
+
const argumentsTypes = [
|
|
134
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
135
|
+
`${packageAddress}::stable_layer::FactoryCap<${options.typeArguments[0]}, ${options.typeArguments[1]}>`
|
|
136
|
+
];
|
|
137
|
+
const parameterNames = ["registry", "FactoryCap"];
|
|
138
|
+
return (tx) => tx.moveCall({
|
|
139
|
+
package: packageAddress,
|
|
140
|
+
module: 'stable_layer',
|
|
141
|
+
function: 'add_entity',
|
|
142
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
143
|
+
typeArguments: options.typeArguments
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
export function banEntity(options) {
|
|
147
|
+
var _a;
|
|
148
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
149
|
+
const argumentsTypes = [
|
|
150
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
151
|
+
`${packageAddress}::stable_layer::FactoryCap<${options.typeArguments[0]}, ${options.typeArguments[1]}>`
|
|
152
|
+
];
|
|
153
|
+
const parameterNames = ["registry", "FactoryCap"];
|
|
154
|
+
return (tx) => tx.moveCall({
|
|
155
|
+
package: packageAddress,
|
|
156
|
+
module: 'stable_layer',
|
|
157
|
+
function: 'ban_entity',
|
|
158
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
159
|
+
typeArguments: options.typeArguments
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
export function addManager(options) {
|
|
163
|
+
var _a;
|
|
164
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
165
|
+
const argumentsTypes = [
|
|
166
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
167
|
+
`${packageAddress}::stable_layer::FactoryCap<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
168
|
+
'address'
|
|
169
|
+
];
|
|
170
|
+
const parameterNames = ["registry", "FactoryCap", "manager"];
|
|
171
|
+
return (tx) => tx.moveCall({
|
|
172
|
+
package: packageAddress,
|
|
173
|
+
module: 'stable_layer',
|
|
174
|
+
function: 'add_manager',
|
|
175
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
176
|
+
typeArguments: options.typeArguments
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
export function removeManager(options) {
|
|
180
|
+
var _a;
|
|
181
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
182
|
+
const argumentsTypes = [
|
|
183
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
184
|
+
`${packageAddress}::stable_layer::FactoryCap<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
185
|
+
'address'
|
|
186
|
+
];
|
|
187
|
+
const parameterNames = ["registry", "FactoryCap", "manager"];
|
|
188
|
+
return (tx) => tx.moveCall({
|
|
189
|
+
package: packageAddress,
|
|
190
|
+
module: 'stable_layer',
|
|
191
|
+
function: 'remove_manager',
|
|
192
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
193
|
+
typeArguments: options.typeArguments
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
export function setMaxSupply(options) {
|
|
197
|
+
var _a;
|
|
198
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
199
|
+
const argumentsTypes = [
|
|
200
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
201
|
+
`${packageAddress}::stable_layer::FactoryCap<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
202
|
+
'u64'
|
|
203
|
+
];
|
|
204
|
+
const parameterNames = ["registry", "FactoryCap", "maxSupply"];
|
|
205
|
+
return (tx) => tx.moveCall({
|
|
206
|
+
package: packageAddress,
|
|
207
|
+
module: 'stable_layer',
|
|
208
|
+
function: 'set_max_supply',
|
|
209
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
210
|
+
typeArguments: options.typeArguments
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
/** Public Funs */
|
|
214
|
+
export function mint(options) {
|
|
215
|
+
var _a;
|
|
216
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
217
|
+
const argumentsTypes = [
|
|
218
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
219
|
+
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[1]}>`
|
|
220
|
+
];
|
|
221
|
+
const parameterNames = ["registry", "uCoin"];
|
|
222
|
+
return (tx) => tx.moveCall({
|
|
223
|
+
package: packageAddress,
|
|
224
|
+
module: 'stable_layer',
|
|
225
|
+
function: 'mint',
|
|
226
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
227
|
+
typeArguments: options.typeArguments
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
export function requestBurn(options) {
|
|
231
|
+
var _a;
|
|
232
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
233
|
+
const argumentsTypes = [
|
|
234
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
235
|
+
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`
|
|
236
|
+
];
|
|
237
|
+
const parameterNames = ["registry", "stableCoin"];
|
|
238
|
+
return (tx) => tx.moveCall({
|
|
239
|
+
package: packageAddress,
|
|
240
|
+
module: 'stable_layer',
|
|
241
|
+
function: 'request_burn',
|
|
242
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
243
|
+
typeArguments: options.typeArguments
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
export function fulfillBurn(options) {
|
|
247
|
+
var _a;
|
|
248
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
249
|
+
const argumentsTypes = [
|
|
250
|
+
`${packageAddress}::stable_layer::StableRegistry`,
|
|
251
|
+
`${packageAddress}::sheet::Request<${options.typeArguments[1]}, ${packageAddress}::stable_layer::StableFactoryEntity<${options.typeArguments[0]}, ${options.typeArguments[1]}>>`
|
|
252
|
+
];
|
|
253
|
+
const parameterNames = ["registry", "burnRequest"];
|
|
254
|
+
return (tx) => tx.moveCall({
|
|
255
|
+
package: packageAddress,
|
|
256
|
+
module: 'stable_layer',
|
|
257
|
+
function: 'fulfill_burn',
|
|
258
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
259
|
+
typeArguments: options.typeArguments
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
/** Getter Fun */
|
|
263
|
+
export function versions(options) {
|
|
264
|
+
var _a;
|
|
265
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
266
|
+
const argumentsTypes = [
|
|
267
|
+
`${packageAddress}::stable_layer::StableRegistry`
|
|
268
|
+
];
|
|
269
|
+
const parameterNames = ["registry"];
|
|
270
|
+
return (tx) => tx.moveCall({
|
|
271
|
+
package: packageAddress,
|
|
272
|
+
module: 'stable_layer',
|
|
273
|
+
function: 'versions',
|
|
274
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
export function totalSupply(options) {
|
|
278
|
+
var _a;
|
|
279
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
280
|
+
const argumentsTypes = [
|
|
281
|
+
`${packageAddress}::stable_layer::StableRegistry`
|
|
282
|
+
];
|
|
283
|
+
const parameterNames = ["registry"];
|
|
284
|
+
return (tx) => tx.moveCall({
|
|
285
|
+
package: packageAddress,
|
|
286
|
+
module: 'stable_layer',
|
|
287
|
+
function: 'total_supply',
|
|
288
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
export function borrowFactory(options) {
|
|
292
|
+
var _a;
|
|
293
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
294
|
+
const argumentsTypes = [
|
|
295
|
+
`${packageAddress}::stable_layer::StableRegistry`
|
|
296
|
+
];
|
|
297
|
+
const parameterNames = ["registry"];
|
|
298
|
+
return (tx) => tx.moveCall({
|
|
299
|
+
package: packageAddress,
|
|
300
|
+
module: 'stable_layer',
|
|
301
|
+
function: 'borrow_factory',
|
|
302
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
303
|
+
typeArguments: options.typeArguments
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
export function sheet(options) {
|
|
307
|
+
var _a;
|
|
308
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
309
|
+
const argumentsTypes = [
|
|
310
|
+
`${packageAddress}::stable_layer::StableFactory<${options.typeArguments[0]}, ${options.typeArguments[1]}>`
|
|
311
|
+
];
|
|
312
|
+
const parameterNames = ["factory"];
|
|
313
|
+
return (tx) => tx.moveCall({
|
|
314
|
+
package: packageAddress,
|
|
315
|
+
module: 'stable_layer',
|
|
316
|
+
function: 'sheet',
|
|
317
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
318
|
+
typeArguments: options.typeArguments
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
export function stableSupply(options) {
|
|
322
|
+
var _a;
|
|
323
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
324
|
+
const argumentsTypes = [
|
|
325
|
+
`${packageAddress}::stable_layer::StableFactory<${options.typeArguments[0]}, ${options.typeArguments[1]}>`
|
|
326
|
+
];
|
|
327
|
+
const parameterNames = ["factory"];
|
|
328
|
+
return (tx) => tx.moveCall({
|
|
329
|
+
package: packageAddress,
|
|
330
|
+
module: 'stable_layer',
|
|
331
|
+
function: 'stable_supply',
|
|
332
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
333
|
+
typeArguments: options.typeArguments
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
export function maxSupply(options) {
|
|
337
|
+
var _a;
|
|
338
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
339
|
+
const argumentsTypes = [
|
|
340
|
+
`${packageAddress}::stable_layer::StableFactory<${options.typeArguments[0]}, ${options.typeArguments[1]}>`
|
|
341
|
+
];
|
|
342
|
+
const parameterNames = ["factory"];
|
|
343
|
+
return (tx) => tx.moveCall({
|
|
344
|
+
package: packageAddress,
|
|
345
|
+
module: 'stable_layer',
|
|
346
|
+
function: 'max_supply',
|
|
347
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
348
|
+
typeArguments: options.typeArguments
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
export function managers(options) {
|
|
352
|
+
var _a;
|
|
353
|
+
const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/stable_factory.move';
|
|
354
|
+
const argumentsTypes = [
|
|
355
|
+
`${packageAddress}::stable_layer::StableFactory<${options.typeArguments[0]}, ${options.typeArguments[1]}>`
|
|
356
|
+
];
|
|
357
|
+
const parameterNames = ["factory"];
|
|
358
|
+
return (tx) => tx.moveCall({
|
|
359
|
+
package: packageAddress,
|
|
360
|
+
module: 'stable_layer',
|
|
361
|
+
function: 'managers',
|
|
362
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
363
|
+
typeArguments: options.typeArguments
|
|
364
|
+
});
|
|
365
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Module for managing Credit and Debt for DeFi protocol usage */
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
6
|
+
export declare const Credit: MoveStruct<{
|
|
7
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
8
|
+
}, "bucket_v2_framework::liability::Credit">;
|
|
9
|
+
export declare const Debt: MoveStruct<{
|
|
10
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
11
|
+
}, "bucket_v2_framework::liability::Debt">;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Module for managing Credit and Debt for DeFi protocol usage */
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
6
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
7
|
+
const $moduleName = 'bucket_v2_framework::liability';
|
|
8
|
+
export const Credit = new MoveStruct({ name: `${$moduleName}::Credit`, fields: {
|
|
9
|
+
value: bcs.u64()
|
|
10
|
+
} });
|
|
11
|
+
export const Debt = new MoveStruct({ name: `${$moduleName}::Debt`, fields: {
|
|
12
|
+
value: bcs.u64()
|
|
13
|
+
} });
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Module for the record of Credit and Debt of certain entity */
|
|
5
|
+
import { MoveTuple, MoveStruct } from '../../../utils/index.js';
|
|
6
|
+
export declare const Entity: MoveTuple<MoveStruct<{
|
|
7
|
+
name: import("@mysten/bcs").BcsType<string, string, "string">;
|
|
8
|
+
}, "std::type_name::TypeName">[], "bucket_v2_framework::sheet::Entity">;
|
|
9
|
+
export declare const Sheet: MoveStruct<{
|
|
10
|
+
credits: MoveStruct<{
|
|
11
|
+
contents: import("@mysten/bcs").BcsType<{
|
|
12
|
+
key: {
|
|
13
|
+
name: string;
|
|
14
|
+
}[];
|
|
15
|
+
value: {
|
|
16
|
+
value: string;
|
|
17
|
+
};
|
|
18
|
+
}[], Iterable<{
|
|
19
|
+
key: {
|
|
20
|
+
name: string;
|
|
21
|
+
}[];
|
|
22
|
+
value: {
|
|
23
|
+
value: string | number | bigint;
|
|
24
|
+
};
|
|
25
|
+
}> & {
|
|
26
|
+
length: number;
|
|
27
|
+
}, string>;
|
|
28
|
+
}, "0x2::vec_map::VecMap<bucket_v2_framework::sheet::Entity, bucket_v2_framework::liability::Credit>">;
|
|
29
|
+
debts: MoveStruct<{
|
|
30
|
+
contents: import("@mysten/bcs").BcsType<{
|
|
31
|
+
key: {
|
|
32
|
+
name: string;
|
|
33
|
+
}[];
|
|
34
|
+
value: {
|
|
35
|
+
value: string;
|
|
36
|
+
};
|
|
37
|
+
}[], Iterable<{
|
|
38
|
+
key: {
|
|
39
|
+
name: string;
|
|
40
|
+
}[];
|
|
41
|
+
value: {
|
|
42
|
+
value: string | number | bigint;
|
|
43
|
+
};
|
|
44
|
+
}> & {
|
|
45
|
+
length: number;
|
|
46
|
+
}, string>;
|
|
47
|
+
}, "0x2::vec_map::VecMap<bucket_v2_framework::sheet::Entity, bucket_v2_framework::liability::Debt>">;
|
|
48
|
+
blacklist: MoveStruct<{
|
|
49
|
+
contents: import("@mysten/bcs").BcsType<{
|
|
50
|
+
name: string;
|
|
51
|
+
}[][], Iterable<{
|
|
52
|
+
name: string;
|
|
53
|
+
}[]> & {
|
|
54
|
+
length: number;
|
|
55
|
+
}, string>;
|
|
56
|
+
}, "0x2::vec_set::VecSet<bucket_v2_framework::sheet::Entity>">;
|
|
57
|
+
}, "bucket_v2_framework::sheet::Sheet">;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Module for the record of Credit and Debt of certain entity */
|
|
5
|
+
import { MoveTuple, MoveStruct } from '../../../utils/index.js';
|
|
6
|
+
import * as type_name from '../std/type_name.js';
|
|
7
|
+
import * as vec_map from '../sui/vec_map.js';
|
|
8
|
+
import * as liability from './liability.js';
|
|
9
|
+
import * as vec_set from '../sui/vec_set.js';
|
|
10
|
+
const $moduleName = 'bucket_v2_framework::sheet';
|
|
11
|
+
export const Entity = new MoveTuple({ name: `${$moduleName}::Entity`, fields: [type_name.TypeName] });
|
|
12
|
+
export const Sheet = new MoveStruct({ name: `${$moduleName}::Sheet`, fields: {
|
|
13
|
+
credits: vec_map.VecMap(Entity, liability.Credit),
|
|
14
|
+
debts: vec_map.VecMap(Entity, liability.Debt),
|
|
15
|
+
blacklist: vec_set.VecSet(Entity)
|
|
16
|
+
} });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Functionality for converting Move types into values. Use with care! */
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
6
|
+
export declare const TypeName: MoveStruct<{
|
|
7
|
+
/**
|
|
8
|
+
* String representation of the type. All types are represented using their source
|
|
9
|
+
* syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
|
|
10
|
+
* Struct types are represented as fully qualified type names; e.g.
|
|
11
|
+
* `00000000000000000000000000000001::string::String` or
|
|
12
|
+
* `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
|
|
13
|
+
* Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
|
|
14
|
+
* 32 depending on the Move platform)
|
|
15
|
+
*/
|
|
16
|
+
name: import("@mysten/bcs").BcsType<string, string, "string">;
|
|
17
|
+
}, "std::type_name::TypeName">;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Functionality for converting Move types into values. Use with care! */
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
6
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
7
|
+
const $moduleName = 'std::type_name';
|
|
8
|
+
export const TypeName = new MoveStruct({ name: `${$moduleName}::TypeName`, fields: {
|
|
9
|
+
/**
|
|
10
|
+
* String representation of the type. All types are represented using their source
|
|
11
|
+
* syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
|
|
12
|
+
* Struct types are represented as fully qualified type names; e.g.
|
|
13
|
+
* `00000000000000000000000000000001::string::String` or
|
|
14
|
+
* `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
|
|
15
|
+
* Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
|
|
16
|
+
* 32 depending on the Move platform)
|
|
17
|
+
*/
|
|
18
|
+
name: bcs.string()
|
|
19
|
+
} });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A storable handler for Balances in general. Is used in the `Coin` module to
|
|
6
|
+
* allow balance operations and can be used to implement custom coins with `Supply`
|
|
7
|
+
* and `Balance`s.
|
|
8
|
+
*/
|
|
9
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
10
|
+
export declare const Balance: MoveStruct<{
|
|
11
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
12
|
+
}, "0x2::balance::Balance">;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A storable handler for Balances in general. Is used in the `Coin` module to
|
|
6
|
+
* allow balance operations and can be used to implement custom coins with `Supply`
|
|
7
|
+
* and `Balance`s.
|
|
8
|
+
*/
|
|
9
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
10
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
11
|
+
const $moduleName = '0x2::balance';
|
|
12
|
+
export const Balance = new MoveStruct({ name: `${$moduleName}::Balance`, fields: {
|
|
13
|
+
value: bcs.u64()
|
|
14
|
+
} });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Sui object identifiers */
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
6
|
+
export declare const UID: MoveStruct<{
|
|
7
|
+
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
8
|
+
}, "0x2::object::UID">;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/** Sui object identifiers */
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
6
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
7
|
+
const $moduleName = '0x2::object';
|
|
8
|
+
export const UID = new MoveStruct({ name: `${$moduleName}::UID`, fields: {
|
|
9
|
+
id: bcs.Address
|
|
10
|
+
} });
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A table is a map-like collection. But unlike a traditional collection, it's keys
|
|
6
|
+
* and values are not stored within the `Table` value, but instead are stored using
|
|
7
|
+
* Sui's object system. The `Table` struct acts only as a handle into the object
|
|
8
|
+
* system to retrieve those keys and values. Note that this means that `Table`
|
|
9
|
+
* values with exactly the same key-value mapping will not be equal, with `==`, at
|
|
10
|
+
* runtime. For example
|
|
11
|
+
*
|
|
12
|
+
* ```
|
|
13
|
+
* let table1 = table::new<u64, bool>();
|
|
14
|
+
* let table2 = table::new<u64, bool>();
|
|
15
|
+
* table::add(&mut table1, 0, false);
|
|
16
|
+
* table::add(&mut table1, 1, true);
|
|
17
|
+
* table::add(&mut table2, 0, false);
|
|
18
|
+
* table::add(&mut table2, 1, true);
|
|
19
|
+
* // table1 does not equal table2, despite having the same entries
|
|
20
|
+
* assert!(&table1 != &table2);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
24
|
+
export declare const Table: MoveStruct<{
|
|
25
|
+
/** the ID of this table */
|
|
26
|
+
id: MoveStruct<{
|
|
27
|
+
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
28
|
+
}, "0x2::object::UID">;
|
|
29
|
+
/** the number of key-value pairs in the table */
|
|
30
|
+
size: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
31
|
+
}, "0x2::table::Table">;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A table is a map-like collection. But unlike a traditional collection, it's keys
|
|
6
|
+
* and values are not stored within the `Table` value, but instead are stored using
|
|
7
|
+
* Sui's object system. The `Table` struct acts only as a handle into the object
|
|
8
|
+
* system to retrieve those keys and values. Note that this means that `Table`
|
|
9
|
+
* values with exactly the same key-value mapping will not be equal, with `==`, at
|
|
10
|
+
* runtime. For example
|
|
11
|
+
*
|
|
12
|
+
* ```
|
|
13
|
+
* let table1 = table::new<u64, bool>();
|
|
14
|
+
* let table2 = table::new<u64, bool>();
|
|
15
|
+
* table::add(&mut table1, 0, false);
|
|
16
|
+
* table::add(&mut table1, 1, true);
|
|
17
|
+
* table::add(&mut table2, 0, false);
|
|
18
|
+
* table::add(&mut table2, 1, true);
|
|
19
|
+
* // table1 does not equal table2, despite having the same entries
|
|
20
|
+
* assert!(&table1 != &table2);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
24
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
25
|
+
import * as object from './object.js';
|
|
26
|
+
const $moduleName = '0x2::table';
|
|
27
|
+
export const Table = new MoveStruct({ name: `${$moduleName}::Table`, fields: {
|
|
28
|
+
/** the ID of this table */
|
|
29
|
+
id: object.UID,
|
|
30
|
+
/** the number of key-value pairs in the table */
|
|
31
|
+
size: bcs.u64()
|
|
32
|
+
} });
|
|
@@ -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.js';
|
|
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"]}>`>;
|