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.
Files changed (63) hide show
  1. package/dist/client.test.d.ts +1 -0
  2. package/dist/client.test.js +146 -0
  3. package/dist/generated/stable_layer/deps/bucket_v2_framework/liability.d.ts +11 -0
  4. package/dist/generated/stable_layer/deps/bucket_v2_framework/liability.js +13 -0
  5. package/dist/generated/stable_layer/deps/bucket_v2_framework/sheet.d.ts +57 -0
  6. package/dist/generated/stable_layer/deps/bucket_v2_framework/sheet.js +16 -0
  7. package/dist/generated/stable_layer/deps/std/type_name.d.ts +17 -0
  8. package/dist/generated/stable_layer/deps/std/type_name.js +19 -0
  9. package/dist/generated/stable_layer/deps/sui/balance.d.ts +12 -0
  10. package/dist/generated/stable_layer/deps/sui/balance.js +14 -0
  11. package/dist/generated/stable_layer/deps/sui/coin.d.ts +16 -0
  12. package/dist/generated/stable_layer/deps/sui/coin.js +15 -0
  13. package/dist/generated/stable_layer/deps/sui/object.d.ts +8 -0
  14. package/dist/generated/stable_layer/deps/sui/object.js +10 -0
  15. package/dist/generated/stable_layer/deps/sui/vec_map.d.ts +36 -0
  16. package/dist/generated/stable_layer/deps/sui/vec_map.js +27 -0
  17. package/dist/generated/stable_layer/deps/sui/vec_set.d.ts +20 -0
  18. package/dist/generated/stable_layer/deps/sui/vec_set.js +19 -0
  19. package/dist/generated/stable_layer/stable_layer.d.ts +427 -0
  20. package/dist/generated/stable_layer/stable_layer.js +365 -0
  21. package/dist/generated/stable_vault_farm/deps/bucket_v2_framework/liability.d.ts +11 -0
  22. package/dist/generated/stable_vault_farm/deps/bucket_v2_framework/liability.js +13 -0
  23. package/dist/generated/stable_vault_farm/deps/bucket_v2_framework/sheet.d.ts +57 -0
  24. package/dist/generated/stable_vault_farm/deps/bucket_v2_framework/sheet.js +16 -0
  25. package/dist/generated/stable_vault_farm/deps/std/type_name.d.ts +17 -0
  26. package/dist/generated/stable_vault_farm/deps/std/type_name.js +19 -0
  27. package/dist/generated/stable_vault_farm/deps/sui/balance.d.ts +12 -0
  28. package/dist/generated/stable_vault_farm/deps/sui/balance.js +14 -0
  29. package/dist/generated/stable_vault_farm/deps/sui/object.d.ts +8 -0
  30. package/dist/generated/stable_vault_farm/deps/sui/object.js +10 -0
  31. package/dist/generated/stable_vault_farm/deps/sui/table.d.ts +31 -0
  32. package/dist/generated/stable_vault_farm/deps/sui/table.js +32 -0
  33. package/dist/generated/stable_vault_farm/deps/sui/vec_map.d.ts +36 -0
  34. package/dist/generated/stable_vault_farm/deps/sui/vec_map.js +27 -0
  35. package/dist/generated/stable_vault_farm/deps/sui/vec_set.d.ts +20 -0
  36. package/dist/generated/stable_vault_farm/deps/sui/vec_set.js +19 -0
  37. package/dist/generated/stable_vault_farm/stable_vault_farm.d.ts +242 -0
  38. package/dist/generated/stable_vault_farm/stable_vault_farm.js +163 -0
  39. package/dist/generated/utils/index.d.ts +11 -0
  40. package/dist/generated/utils/index.js +131 -0
  41. package/dist/generated/yield_usdb/buffer.d.ts +137 -0
  42. package/dist/generated/yield_usdb/buffer.js +157 -0
  43. package/dist/generated/yield_usdb/deps/bucket_v2_framework/account.d.ts +11 -0
  44. package/dist/generated/yield_usdb/deps/bucket_v2_framework/account.js +12 -0
  45. package/dist/generated/yield_usdb/deps/bucket_v2_framework/double.d.ts +8 -0
  46. package/dist/generated/yield_usdb/deps/bucket_v2_framework/double.js +10 -0
  47. package/dist/generated/yield_usdb/deps/sui/balance.d.ts +15 -0
  48. package/dist/generated/yield_usdb/deps/sui/balance.js +17 -0
  49. package/dist/generated/yield_usdb/deps/sui/coin.d.ts +16 -0
  50. package/dist/generated/yield_usdb/deps/sui/coin.js +15 -0
  51. package/dist/generated/yield_usdb/deps/sui/object.d.ts +8 -0
  52. package/dist/generated/yield_usdb/deps/sui/object.js +10 -0
  53. package/dist/generated/yield_usdb/deps/sui/vec_set.d.ts +20 -0
  54. package/dist/generated/yield_usdb/deps/sui/vec_set.js +19 -0
  55. package/dist/generated/yield_usdb/yield_usdb.d.ts +475 -0
  56. package/dist/generated/yield_usdb/yield_usdb.js +444 -0
  57. package/dist/index.d.ts +16 -19
  58. package/dist/index.js +235 -30
  59. package/dist/interface.d.ts +25 -0
  60. package/dist/interface.js +1 -0
  61. package/dist/libs/constants.d.ts +15 -0
  62. package/dist/libs/constants.js +18 -0
  63. package/package.json +19 -4
@@ -0,0 +1,444 @@
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 object from './deps/sui/object.js';
7
+ import * as coin from './deps/sui/coin.js';
8
+ import * as account from './deps/bucket_v2_framework/account.js';
9
+ import * as buffer_1 from './buffer.js';
10
+ import * as vec_set from './deps/sui/vec_set.js';
11
+ const $moduleName = '@local-pkg/yield_usdb.move::yield_usdb';
12
+ export const Created = new MoveStruct({ name: `${$moduleName}::Created`, fields: {
13
+ vault_id: bcs.Address,
14
+ max_lp_supply: bcs.u64(),
15
+ abstract_address: bcs.Address
16
+ } });
17
+ export const MaxSupplyUpdated = new MoveStruct({ name: `${$moduleName}::MaxSupplyUpdated`, fields: {
18
+ vault_id: bcs.Address,
19
+ previous_max_lp_supply: bcs.u64(),
20
+ current_max_lp_supply: bcs.u64()
21
+ } });
22
+ export const Minted = new MoveStruct({ name: `${$moduleName}::Minted`, fields: {
23
+ vault_id: bcs.Address,
24
+ usdb_amount: bcs.u64(),
25
+ lp_amount: bcs.u64()
26
+ } });
27
+ export const Burned = new MoveStruct({ name: `${$moduleName}::Burned`, fields: {
28
+ vault_id: bcs.Address,
29
+ lp_amount: bcs.u64(),
30
+ usdb_amount: bcs.u64()
31
+ } });
32
+ export const Claimed = new MoveStruct({ name: `${$moduleName}::Claimed`, fields: {
33
+ vault_id: bcs.Address,
34
+ reward_type: bcs.string(),
35
+ reward_amount: bcs.u64()
36
+ } });
37
+ export const Collected = new MoveStruct({ name: `${$moduleName}::Collected`, fields: {
38
+ vault_id: bcs.Address,
39
+ usdb_amount: bcs.u64()
40
+ } });
41
+ export const YieldVault = new MoveStruct({ name: `${$moduleName}::YieldVault`, fields: {
42
+ id: object.UID,
43
+ max_lp_supply: bcs.u64(),
44
+ lp_treasury_cap: coin.TreasuryCap,
45
+ abstract_account: account.Account,
46
+ buffer: buffer_1.Buffer,
47
+ managers: vec_set.VecSet(bcs.Address),
48
+ versions: vec_set.VecSet(bcs.u16())
49
+ } });
50
+ export function packageVersion(options = {}) {
51
+ var _a;
52
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
53
+ return (tx) => tx.moveCall({
54
+ package: packageAddress,
55
+ module: 'yield_usdb',
56
+ function: 'package_version',
57
+ });
58
+ }
59
+ /** Admin Funs */
60
+ export function _new(options) {
61
+ var _a;
62
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
63
+ const argumentsTypes = [
64
+ `${packageAddress}::admin::AdminCap`,
65
+ `${packageAddress}::saving::SavingPool<${options.typeArguments[1]}>`,
66
+ `0x0000000000000000000000000000000000000000000000000000000000000002::coin::TreasuryCap<${options.typeArguments[0]}>`,
67
+ `${packageAddress}::account::Account`,
68
+ 'u64',
69
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
70
+ ];
71
+ const parameterNames = ["AdminCap", "savingPool", "lpTreasuryCap", "accountObj", "maxLpSupply"];
72
+ return (tx) => tx.moveCall({
73
+ package: packageAddress,
74
+ module: 'yield_usdb',
75
+ function: 'new',
76
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
77
+ typeArguments: options.typeArguments
78
+ });
79
+ }
80
+ export function _default(options) {
81
+ var _a;
82
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
83
+ const argumentsTypes = [
84
+ `${packageAddress}::admin::AdminCap`,
85
+ `${packageAddress}::saving::SavingPool<${options.typeArguments[1]}>`,
86
+ `0x0000000000000000000000000000000000000000000000000000000000000002::coin::TreasuryCap<${options.typeArguments[0]}>`,
87
+ `${packageAddress}::account::Account`,
88
+ 'u64',
89
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
90
+ ];
91
+ const parameterNames = ["adminCap", "savingPool", "lpTreasuryCap", "accountObj", "maxLpSupply"];
92
+ return (tx) => tx.moveCall({
93
+ package: packageAddress,
94
+ module: 'yield_usdb',
95
+ function: 'default',
96
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
97
+ typeArguments: options.typeArguments
98
+ });
99
+ }
100
+ export function destroy(options) {
101
+ var _a;
102
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
103
+ const argumentsTypes = [
104
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
105
+ `${packageAddress}::admin::AdminCap`
106
+ ];
107
+ const parameterNames = ["vault", "AdminCap"];
108
+ return (tx) => tx.moveCall({
109
+ package: packageAddress,
110
+ module: 'yield_usdb',
111
+ function: 'destroy',
112
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
113
+ typeArguments: options.typeArguments
114
+ });
115
+ }
116
+ export function addManager(options) {
117
+ var _a;
118
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
119
+ const argumentsTypes = [
120
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
121
+ `${packageAddress}::admin::AdminCap`,
122
+ 'address'
123
+ ];
124
+ const parameterNames = ["vault", "AdminCap", "manager"];
125
+ return (tx) => tx.moveCall({
126
+ package: packageAddress,
127
+ module: 'yield_usdb',
128
+ function: 'add_manager',
129
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
130
+ typeArguments: options.typeArguments
131
+ });
132
+ }
133
+ export function removeManager(options) {
134
+ var _a;
135
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
136
+ const argumentsTypes = [
137
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
138
+ `${packageAddress}::admin::AdminCap`,
139
+ 'address'
140
+ ];
141
+ const parameterNames = ["vault", "AdminCap", "manager"];
142
+ return (tx) => tx.moveCall({
143
+ package: packageAddress,
144
+ module: 'yield_usdb',
145
+ function: 'remove_manager',
146
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
147
+ typeArguments: options.typeArguments
148
+ });
149
+ }
150
+ export function addVersion(options) {
151
+ var _a;
152
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
153
+ const argumentsTypes = [
154
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
155
+ `${packageAddress}::admin::AdminCap`,
156
+ 'u16'
157
+ ];
158
+ const parameterNames = ["vault", "AdminCap", "version"];
159
+ return (tx) => tx.moveCall({
160
+ package: packageAddress,
161
+ module: 'yield_usdb',
162
+ function: 'add_version',
163
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
164
+ typeArguments: options.typeArguments
165
+ });
166
+ }
167
+ export function removeVersion(options) {
168
+ var _a;
169
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
170
+ const argumentsTypes = [
171
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
172
+ `${packageAddress}::admin::AdminCap`,
173
+ 'u16'
174
+ ];
175
+ const parameterNames = ["vault", "AdminCap", "version"];
176
+ return (tx) => tx.moveCall({
177
+ package: packageAddress,
178
+ module: 'yield_usdb',
179
+ function: 'remove_version',
180
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
181
+ typeArguments: options.typeArguments
182
+ });
183
+ }
184
+ export function updateMaxLpSupply(options) {
185
+ var _a;
186
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
187
+ const argumentsTypes = [
188
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
189
+ `${packageAddress}::admin::AdminCap`,
190
+ 'u64'
191
+ ];
192
+ const parameterNames = ["vault", "AdminCap", "maxLpSupply"];
193
+ return (tx) => tx.moveCall({
194
+ package: packageAddress,
195
+ module: 'yield_usdb',
196
+ function: 'update_max_lp_supply',
197
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
198
+ typeArguments: options.typeArguments
199
+ });
200
+ }
201
+ /** Public Fun */
202
+ export function mint(options) {
203
+ var _a;
204
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
205
+ const argumentsTypes = [
206
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
207
+ `${packageAddress}::usdb::Treasury`,
208
+ `${packageAddress}::saving::SavingPool<${options.typeArguments[1]}>`,
209
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
210
+ `0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${packageAddress}::usdb::USDB>`
211
+ ];
212
+ const parameterNames = ["vault", "treasury", "savingPool", "usdbCoin"];
213
+ return (tx) => tx.moveCall({
214
+ package: packageAddress,
215
+ module: 'yield_usdb',
216
+ function: 'mint',
217
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
218
+ typeArguments: options.typeArguments
219
+ });
220
+ }
221
+ export function release(options) {
222
+ var _a;
223
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
224
+ const argumentsTypes = [
225
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
226
+ `${packageAddress}::usdb::Treasury`,
227
+ `${packageAddress}::saving::SavingPool<${options.typeArguments[1]}>`,
228
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
229
+ ];
230
+ const parameterNames = ["vault", "treasury", "savingPool"];
231
+ return (tx) => tx.moveCall({
232
+ package: packageAddress,
233
+ module: 'yield_usdb',
234
+ function: 'release',
235
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
236
+ typeArguments: options.typeArguments
237
+ });
238
+ }
239
+ export function burn(options) {
240
+ var _a;
241
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
242
+ const argumentsTypes = [
243
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
244
+ `${packageAddress}::usdb::Treasury`,
245
+ `${packageAddress}::saving::SavingPool<${options.typeArguments[1]}>`,
246
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
247
+ `0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`
248
+ ];
249
+ const parameterNames = ["vault", "treasury", "savingPool", "lpCoin"];
250
+ return (tx) => tx.moveCall({
251
+ package: packageAddress,
252
+ module: 'yield_usdb',
253
+ function: 'burn',
254
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
255
+ typeArguments: options.typeArguments
256
+ });
257
+ }
258
+ /** Manager Funs */
259
+ export function claim(options) {
260
+ var _a;
261
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
262
+ const argumentsTypes = [
263
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
264
+ `${packageAddress}::saving_incentive::RewardManager<${options.typeArguments[1]}>`,
265
+ `${packageAddress}::incentive_config::GlobalConfig`,
266
+ `${packageAddress}::saving::SavingPool<${options.typeArguments[1]}>`,
267
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
268
+ `${packageAddress}::account::AccountRequest`
269
+ ];
270
+ const parameterNames = ["vault", "rewardManager", "config", "savingPool", "accountReq"];
271
+ return (tx) => tx.moveCall({
272
+ package: packageAddress,
273
+ module: 'yield_usdb',
274
+ function: 'claim',
275
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
276
+ typeArguments: options.typeArguments
277
+ });
278
+ }
279
+ export function collect(options) {
280
+ var _a;
281
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
282
+ const argumentsTypes = [
283
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
284
+ `${packageAddress}::usdb::Treasury`,
285
+ `${packageAddress}::saving::SavingPool<${options.typeArguments[1]}>`,
286
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
287
+ `0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${packageAddress}::usdb::USDB>`,
288
+ `${packageAddress}::account::AccountRequest`,
289
+ 'u64'
290
+ ];
291
+ const parameterNames = ["vault", "treasury", "savingPool", "usdbCoin", "accountReq", "bufferTime"];
292
+ return (tx) => tx.moveCall({
293
+ package: packageAddress,
294
+ module: 'yield_usdb',
295
+ function: 'collect',
296
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
297
+ typeArguments: options.typeArguments
298
+ });
299
+ }
300
+ /** Getter Funs */
301
+ export function id(options) {
302
+ var _a;
303
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
304
+ const argumentsTypes = [
305
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`
306
+ ];
307
+ const parameterNames = ["vault"];
308
+ return (tx) => tx.moveCall({
309
+ package: packageAddress,
310
+ module: 'yield_usdb',
311
+ function: 'id',
312
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
313
+ typeArguments: options.typeArguments
314
+ });
315
+ }
316
+ export function maxLpSupply(options) {
317
+ var _a;
318
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
319
+ const argumentsTypes = [
320
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`
321
+ ];
322
+ const parameterNames = ["vault"];
323
+ return (tx) => tx.moveCall({
324
+ package: packageAddress,
325
+ module: 'yield_usdb',
326
+ function: 'max_lp_supply',
327
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
328
+ typeArguments: options.typeArguments
329
+ });
330
+ }
331
+ export function usdbReserve(options) {
332
+ var _a;
333
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
334
+ const argumentsTypes = [
335
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
336
+ `${packageAddress}::saving::SavingPool<${options.typeArguments[1]}>`,
337
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
338
+ ];
339
+ const parameterNames = ["vault", "savingPool"];
340
+ return (tx) => tx.moveCall({
341
+ package: packageAddress,
342
+ module: 'yield_usdb',
343
+ function: 'usdb_reserve',
344
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
345
+ typeArguments: options.typeArguments
346
+ });
347
+ }
348
+ export function lpSupply(options) {
349
+ var _a;
350
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
351
+ const argumentsTypes = [
352
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`
353
+ ];
354
+ const parameterNames = ["vault"];
355
+ return (tx) => tx.moveCall({
356
+ package: packageAddress,
357
+ module: 'yield_usdb',
358
+ function: 'lp_supply',
359
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
360
+ typeArguments: options.typeArguments
361
+ });
362
+ }
363
+ export function mintRatio(options) {
364
+ var _a;
365
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
366
+ const argumentsTypes = [
367
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
368
+ `${packageAddress}::saving::SavingPool<${options.typeArguments[1]}>`,
369
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
370
+ ];
371
+ const parameterNames = ["vault", "savingPool"];
372
+ return (tx) => tx.moveCall({
373
+ package: packageAddress,
374
+ module: 'yield_usdb',
375
+ function: 'mint_ratio',
376
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
377
+ typeArguments: options.typeArguments
378
+ });
379
+ }
380
+ export function burnRatio(options) {
381
+ var _a;
382
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
383
+ const argumentsTypes = [
384
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
385
+ `${packageAddress}::saving::SavingPool<${options.typeArguments[1]}>`,
386
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
387
+ ];
388
+ const parameterNames = ["vault", "savingPool"];
389
+ return (tx) => tx.moveCall({
390
+ package: packageAddress,
391
+ module: 'yield_usdb',
392
+ function: 'burn_ratio',
393
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
394
+ typeArguments: options.typeArguments
395
+ });
396
+ }
397
+ export function claimableRewardAmount(options) {
398
+ var _a;
399
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
400
+ const argumentsTypes = [
401
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
402
+ `${packageAddress}::saving_incentive::RewardManager<${options.typeArguments[1]}>`,
403
+ `${packageAddress}::saving::SavingPool<${options.typeArguments[1]}>`,
404
+ '0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock'
405
+ ];
406
+ const parameterNames = ["vault", "rewardManager", "savingPool"];
407
+ return (tx) => tx.moveCall({
408
+ package: packageAddress,
409
+ module: 'yield_usdb',
410
+ function: 'claimable_reward_amount',
411
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
412
+ typeArguments: options.typeArguments
413
+ });
414
+ }
415
+ export function abstractAddress(options) {
416
+ var _a;
417
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
418
+ const argumentsTypes = [
419
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`
420
+ ];
421
+ const parameterNames = ["vault"];
422
+ return (tx) => tx.moveCall({
423
+ package: packageAddress,
424
+ module: 'yield_usdb',
425
+ function: 'abstract_address',
426
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
427
+ typeArguments: options.typeArguments
428
+ });
429
+ }
430
+ export function buffer(options) {
431
+ var _a;
432
+ const packageAddress = (_a = options.package) !== null && _a !== void 0 ? _a : '@local-pkg/yield_usdb.move';
433
+ const argumentsTypes = [
434
+ `${packageAddress}::yield_usdb::YieldVault<${options.typeArguments[0]}, ${options.typeArguments[1]}>`
435
+ ];
436
+ const parameterNames = ["vault"];
437
+ return (tx) => tx.moveCall({
438
+ package: packageAddress,
439
+ module: 'yield_usdb',
440
+ function: 'buffer',
441
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
442
+ typeArguments: options.typeArguments
443
+ });
444
+ }
package/dist/index.d.ts CHANGED
@@ -1,20 +1,17 @@
1
- /**
2
- * Stable Layer SDK
3
- * A simple hello world SDK for testing
4
- */
5
- /**
6
- * Returns a hello world message
7
- */
8
- export declare function hello(name?: string): string;
9
- /**
10
- * A simple greeting class
11
- */
12
- export declare class Greeter {
13
- private name;
14
- constructor(name: string);
15
- greet(): string;
1
+ import { Transaction } from "@mysten/sui/transactions";
2
+ import { StableLayerConfig, MintTransactionParams, BurnTransactionParams, ClaimTransactionParams, StableCoinType } from "./interface";
3
+ export declare class StableLayerSDK {
4
+ private bucketClient;
5
+ private suiClient;
6
+ private sender;
7
+ constructor(config: StableLayerConfig);
8
+ buildMintTx({ tx, coinName, amount, sender, }: MintTransactionParams): Promise<Transaction>;
9
+ buildBurnTx({ tx, coinName, amount, all, sender, }: BurnTransactionParams): Promise<Transaction>;
10
+ buildClaimTx({ tx, coinName, sender, }: ClaimTransactionParams): Promise<Transaction>;
11
+ getTotalSupply(): Promise<bigint>;
12
+ getTotalSupplyByCoinName(coinName: StableCoinType): Promise<bigint>;
13
+ private getBucketSavingPool;
14
+ private getBucketPSMPool;
15
+ private checkResponse;
16
+ private releaseRewards;
16
17
  }
17
- /**
18
- * Get the SDK version
19
- */
20
- export declare function getVersion(): string;