@suilend/springsui-cli 1.0.14 → 2.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/cli/src/bytecode.js +23 -25
- package/cli/src/index.js +80 -134
- package/package.json +1 -1
- package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.d.ts +7 -7
- package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.js +4 -4
- package/sdk/src/_generated/_dependencies/source/0x1/option/structs.d.ts +8 -3
- package/sdk/src/_generated/_dependencies/source/0x1/option/structs.js +3 -3
- package/sdk/src/_generated/_dependencies/source/0x1/string/structs.d.ts +4 -4
- package/sdk/src/_generated/_dependencies/source/0x1/string/structs.js +3 -3
- package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.d.ts +5 -5
- package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.js +3 -3
- package/sdk/src/_generated/_dependencies/source/0x2/bag/structs.d.ts +7 -7
- package/sdk/src/_generated/_dependencies/source/0x2/bag/structs.js +3 -3
- package/sdk/src/_generated/_dependencies/source/0x2/balance/structs.d.ts +7 -7
- package/sdk/src/_generated/_dependencies/source/0x2/balance/structs.js +4 -4
- package/sdk/src/_generated/_dependencies/source/0x2/coin/structs.d.ts +65 -51
- package/sdk/src/_generated/_dependencies/source/0x2/coin/structs.js +9 -9
- package/sdk/src/_generated/_dependencies/source/0x2/object/structs.d.ts +8 -8
- package/sdk/src/_generated/_dependencies/source/0x2/object/structs.js +6 -6
- package/sdk/src/_generated/_dependencies/source/0x2/sui/structs.d.ts +4 -4
- package/sdk/src/_generated/_dependencies/source/0x2/sui/structs.js +3 -3
- package/sdk/src/_generated/_dependencies/source/0x2/table/structs.d.ts +7 -7
- package/sdk/src/_generated/_dependencies/source/0x2/table/structs.js +3 -3
- package/sdk/src/_generated/_dependencies/source/0x2/url/structs.d.ts +5 -5
- package/sdk/src/_generated/_dependencies/source/0x2/url/structs.js +3 -3
- package/sdk/src/_generated/_dependencies/source/0x2/vec-map/structs.d.ts +6 -6
- package/sdk/src/_generated/_dependencies/source/0x2/vec-map/structs.js +4 -4
- package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.d.ts +66 -58
- package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.js +8 -8
- package/sdk/src/_generated/_framework/reified.d.ts +3 -3
- package/sdk/src/_generated/_framework/reified.js +4 -4
- package/sdk/src/_generated/_framework/util.d.ts +4 -4
- package/sdk/src/_generated/_framework/util.js +1 -1
- package/sdk/src/_generated/_framework/vector.d.ts +12 -1
- package/sdk/src/_generated/_framework/vector.js +1 -1
- package/sdk/src/_generated/liquid_staking/cell/structs.d.ts +10 -3
- package/sdk/src/_generated/liquid_staking/cell/structs.js +3 -3
- package/sdk/src/_generated/liquid_staking/fees/functions.d.ts +19 -19
- package/sdk/src/_generated/liquid_staking/fees/structs.d.ts +21 -21
- package/sdk/src/_generated/liquid_staking/fees/structs.js +4 -4
- package/sdk/src/_generated/liquid_staking/liquid-staking/functions.d.ts +20 -20
- package/sdk/src/_generated/liquid_staking/liquid-staking/structs.d.ts +194 -100
- package/sdk/src/_generated/liquid_staking/liquid-staking/structs.js +12 -12
- package/sdk/src/_generated/liquid_staking/storage/structs.d.ts +145 -33
- package/sdk/src/_generated/liquid_staking/storage/structs.js +6 -6
- package/sdk/src/_generated/liquid_staking/version/structs.d.ts +4 -4
- package/sdk/src/_generated/liquid_staking/version/structs.js +3 -3
- package/sdk/src/_generated/liquid_staking/weight/functions.d.ts +11 -11
- package/sdk/src/_generated/liquid_staking/weight/structs.d.ts +41 -41
- package/sdk/src/_generated/liquid_staking/weight/structs.js +9 -9
- package/sdk/src/client.d.ts +35 -25
- package/sdk/src/client.js +52 -59
- package/sdk/src/index.d.ts +0 -1
- package/sdk/src/index.js +0 -1
- package/sdk/src/lib/transactions.d.ts +4 -1
- package/sdk/src/grpcAdapter.d.ts +0 -50
- package/sdk/src/grpcAdapter.js +0 -75
|
@@ -9,7 +9,7 @@ import { PhantomReified, Reified, StructClass, ToField, ToTypeStr, ToTypeStr as
|
|
|
9
9
|
import { FieldsWithTypes } from "../../_framework/util";
|
|
10
10
|
import { Vector } from "../../_framework/vector";
|
|
11
11
|
import { PKG_V1 } from "../index";
|
|
12
|
-
import {
|
|
12
|
+
import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
|
|
13
13
|
export declare function isStorage(type: string): boolean;
|
|
14
14
|
export interface StorageFields {
|
|
15
15
|
suiPool: ToField<Balance<ToPhantom<SUI>>>;
|
|
@@ -38,17 +38,44 @@ export declare class Storage implements StructClass {
|
|
|
38
38
|
static get r(): reified.StructClassReified<Storage, StorageFields>;
|
|
39
39
|
static phantom(): PhantomReified<ToTypeStr<Storage>>;
|
|
40
40
|
static get p(): reified.PhantomReified<"0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::storage::Storage">;
|
|
41
|
-
static get bcs(): import("@mysten/
|
|
42
|
-
sui_pool: import("@mysten/
|
|
43
|
-
value: import("@mysten/
|
|
41
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
42
|
+
sui_pool: import("@mysten/bcs").BcsStruct<{
|
|
43
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
44
44
|
}, string>;
|
|
45
|
-
validator_infos: import("@mysten/
|
|
45
|
+
validator_infos: import("@mysten/bcs").BcsType<{
|
|
46
46
|
staking_pool_id: {
|
|
47
47
|
bytes: string;
|
|
48
48
|
};
|
|
49
49
|
validator_address: string;
|
|
50
|
-
active_stake:
|
|
51
|
-
|
|
50
|
+
active_stake: {
|
|
51
|
+
vec: {
|
|
52
|
+
id: {
|
|
53
|
+
id: {
|
|
54
|
+
bytes: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
pool_id: {
|
|
58
|
+
bytes: string;
|
|
59
|
+
};
|
|
60
|
+
value: string;
|
|
61
|
+
}[];
|
|
62
|
+
};
|
|
63
|
+
inactive_stake: {
|
|
64
|
+
vec: {
|
|
65
|
+
id: {
|
|
66
|
+
id: {
|
|
67
|
+
bytes: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
pool_id: {
|
|
71
|
+
bytes: string;
|
|
72
|
+
};
|
|
73
|
+
stake_activation_epoch: string;
|
|
74
|
+
principal: {
|
|
75
|
+
value: string;
|
|
76
|
+
};
|
|
77
|
+
}[];
|
|
78
|
+
};
|
|
52
79
|
exchange_rate: {
|
|
53
80
|
sui_amount: string;
|
|
54
81
|
pool_token_amount: string;
|
|
@@ -67,8 +94,39 @@ export declare class Storage implements StructClass {
|
|
|
67
94
|
bytes: string;
|
|
68
95
|
};
|
|
69
96
|
validator_address: string;
|
|
70
|
-
active_stake:
|
|
71
|
-
|
|
97
|
+
active_stake: {
|
|
98
|
+
vec: Iterable<{
|
|
99
|
+
id: {
|
|
100
|
+
id: {
|
|
101
|
+
bytes: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
pool_id: {
|
|
105
|
+
bytes: string;
|
|
106
|
+
};
|
|
107
|
+
value: string | number | bigint;
|
|
108
|
+
}> & {
|
|
109
|
+
length: number;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
inactive_stake: {
|
|
113
|
+
vec: Iterable<{
|
|
114
|
+
id: {
|
|
115
|
+
id: {
|
|
116
|
+
bytes: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
pool_id: {
|
|
120
|
+
bytes: string;
|
|
121
|
+
};
|
|
122
|
+
stake_activation_epoch: string | number | bigint;
|
|
123
|
+
principal: {
|
|
124
|
+
value: string | number | bigint;
|
|
125
|
+
};
|
|
126
|
+
}> & {
|
|
127
|
+
length: number;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
72
130
|
exchange_rate: {
|
|
73
131
|
sui_amount: string | number | bigint;
|
|
74
132
|
pool_token_amount: string | number | bigint;
|
|
@@ -85,15 +143,15 @@ export declare class Storage implements StructClass {
|
|
|
85
143
|
}> & {
|
|
86
144
|
length: number;
|
|
87
145
|
}, string>;
|
|
88
|
-
total_sui_supply: import("@mysten/
|
|
89
|
-
last_refresh_epoch: import("@mysten/
|
|
90
|
-
extra_fields: import("@mysten/
|
|
91
|
-
id: import("@mysten/
|
|
92
|
-
id: import("@mysten/
|
|
93
|
-
bytes: import("@mysten/
|
|
146
|
+
total_sui_supply: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
147
|
+
last_refresh_epoch: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
148
|
+
extra_fields: import("@mysten/bcs").BcsStruct<{
|
|
149
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
150
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
151
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
94
152
|
}, string>;
|
|
95
153
|
}, string>;
|
|
96
|
-
size: import("@mysten/
|
|
154
|
+
size: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
97
155
|
}, string>;
|
|
98
156
|
}, string>;
|
|
99
157
|
static fromFields(fields: Record<string, any>): Storage;
|
|
@@ -179,7 +237,7 @@ export declare class Storage implements StructClass {
|
|
|
179
237
|
static fromJSON(json: Record<string, any>): Storage;
|
|
180
238
|
static fromSuiParsedData(content: SuiParsedData): Storage;
|
|
181
239
|
static fromSuiObjectData(data: SuiObjectData): Storage;
|
|
182
|
-
static fetch(client:
|
|
240
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<Storage>;
|
|
183
241
|
}
|
|
184
242
|
export declare function isValidatorInfo(type: string): boolean;
|
|
185
243
|
export interface ValidatorInfoFields {
|
|
@@ -213,25 +271,79 @@ export declare class ValidatorInfo implements StructClass {
|
|
|
213
271
|
static get r(): reified.StructClassReified<ValidatorInfo, ValidatorInfoFields>;
|
|
214
272
|
static phantom(): PhantomReified<ToTypeStr<ValidatorInfo>>;
|
|
215
273
|
static get p(): reified.PhantomReified<"0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::storage::ValidatorInfo">;
|
|
216
|
-
static get bcs(): import("@mysten/
|
|
217
|
-
staking_pool_id: import("@mysten/
|
|
218
|
-
bytes: import("@mysten/
|
|
274
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
275
|
+
staking_pool_id: import("@mysten/bcs").BcsStruct<{
|
|
276
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
277
|
+
}, string>;
|
|
278
|
+
validator_address: import("@mysten/bcs").BcsType<string, string, string>;
|
|
279
|
+
active_stake: import("@mysten/bcs").BcsStruct<{
|
|
280
|
+
vec: import("@mysten/bcs").BcsType<{
|
|
281
|
+
id: {
|
|
282
|
+
id: {
|
|
283
|
+
bytes: string;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
pool_id: {
|
|
287
|
+
bytes: string;
|
|
288
|
+
};
|
|
289
|
+
value: string;
|
|
290
|
+
}[], Iterable<{
|
|
291
|
+
id: {
|
|
292
|
+
id: {
|
|
293
|
+
bytes: string;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
pool_id: {
|
|
297
|
+
bytes: string;
|
|
298
|
+
};
|
|
299
|
+
value: string | number | bigint;
|
|
300
|
+
}> & {
|
|
301
|
+
length: number;
|
|
302
|
+
}, string>;
|
|
303
|
+
}, string>;
|
|
304
|
+
inactive_stake: import("@mysten/bcs").BcsStruct<{
|
|
305
|
+
vec: import("@mysten/bcs").BcsType<{
|
|
306
|
+
id: {
|
|
307
|
+
id: {
|
|
308
|
+
bytes: string;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
pool_id: {
|
|
312
|
+
bytes: string;
|
|
313
|
+
};
|
|
314
|
+
stake_activation_epoch: string;
|
|
315
|
+
principal: {
|
|
316
|
+
value: string;
|
|
317
|
+
};
|
|
318
|
+
}[], Iterable<{
|
|
319
|
+
id: {
|
|
320
|
+
id: {
|
|
321
|
+
bytes: string;
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
pool_id: {
|
|
325
|
+
bytes: string;
|
|
326
|
+
};
|
|
327
|
+
stake_activation_epoch: string | number | bigint;
|
|
328
|
+
principal: {
|
|
329
|
+
value: string | number | bigint;
|
|
330
|
+
};
|
|
331
|
+
}> & {
|
|
332
|
+
length: number;
|
|
333
|
+
}, string>;
|
|
219
334
|
}, string>;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
exchange_rate: import("@mysten/sui-v1/bcs").BcsStruct<{
|
|
224
|
-
sui_amount: import("@mysten/sui-v1/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
225
|
-
pool_token_amount: import("@mysten/sui-v1/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
335
|
+
exchange_rate: import("@mysten/bcs").BcsStruct<{
|
|
336
|
+
sui_amount: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
337
|
+
pool_token_amount: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
226
338
|
}, string>;
|
|
227
|
-
total_sui_amount: import("@mysten/
|
|
228
|
-
extra_fields: import("@mysten/
|
|
229
|
-
id: import("@mysten/
|
|
230
|
-
id: import("@mysten/
|
|
231
|
-
bytes: import("@mysten/
|
|
339
|
+
total_sui_amount: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
340
|
+
extra_fields: import("@mysten/bcs").BcsStruct<{
|
|
341
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
342
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
343
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
232
344
|
}, string>;
|
|
233
345
|
}, string>;
|
|
234
|
-
size: import("@mysten/
|
|
346
|
+
size: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
235
347
|
}, string>;
|
|
236
348
|
}, string>;
|
|
237
349
|
static fromFields(fields: Record<string, any>): ValidatorInfo;
|
|
@@ -295,5 +407,5 @@ export declare class ValidatorInfo implements StructClass {
|
|
|
295
407
|
static fromJSON(json: Record<string, any>): ValidatorInfo;
|
|
296
408
|
static fromSuiParsedData(content: SuiParsedData): ValidatorInfo;
|
|
297
409
|
static fromSuiObjectData(data: SuiObjectData): ValidatorInfo;
|
|
298
|
-
static fetch(client:
|
|
410
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<ValidatorInfo>;
|
|
299
411
|
}
|
|
@@ -17,8 +17,8 @@ import { FungibleStakedSui, PoolTokenExchangeRate, StakedSui, } from "../../_dep
|
|
|
17
17
|
import { decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, fieldToJSON, phantom, } from "../../_framework/reified";
|
|
18
18
|
import { composeSuiType, compressSuiType, } from "../../_framework/util";
|
|
19
19
|
import { PKG_V1 } from "../index";
|
|
20
|
-
import { bcs } from "@mysten/sui
|
|
21
|
-
import {
|
|
20
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
21
|
+
import { fromBase64, fromHex, toHex } from "@mysten/sui/utils";
|
|
22
22
|
/* ============================== Storage =============================== */
|
|
23
23
|
export function isStorage(type) {
|
|
24
24
|
type = compressSuiType(type);
|
|
@@ -142,7 +142,7 @@ export class Storage {
|
|
|
142
142
|
if (data.bcs.dataType !== "moveObject" || !isStorage(data.bcs.type)) {
|
|
143
143
|
throw new Error(`object at is not a Storage object`);
|
|
144
144
|
}
|
|
145
|
-
return Storage.fromBcs(
|
|
145
|
+
return Storage.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
146
146
|
}
|
|
147
147
|
if (data.content) {
|
|
148
148
|
return Storage.fromSuiParsedData(data.content);
|
|
@@ -224,8 +224,8 @@ export class ValidatorInfo {
|
|
|
224
224
|
validator_address: bcs
|
|
225
225
|
.bytes(32)
|
|
226
226
|
.transform({
|
|
227
|
-
input: (val) =>
|
|
228
|
-
output: (val) =>
|
|
227
|
+
input: (val) => fromHex(val),
|
|
228
|
+
output: (val) => toHex(val),
|
|
229
229
|
}),
|
|
230
230
|
active_stake: Option.bcs(FungibleStakedSui.bcs),
|
|
231
231
|
inactive_stake: Option.bcs(StakedSui.bcs),
|
|
@@ -308,7 +308,7 @@ export class ValidatorInfo {
|
|
|
308
308
|
!isValidatorInfo(data.bcs.type)) {
|
|
309
309
|
throw new Error(`object at is not a ValidatorInfo object`);
|
|
310
310
|
}
|
|
311
|
-
return ValidatorInfo.fromBcs(
|
|
311
|
+
return ValidatorInfo.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
312
312
|
}
|
|
313
313
|
if (data.content) {
|
|
314
314
|
return ValidatorInfo.fromSuiParsedData(data.content);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../_framework/reified";
|
|
2
2
|
import { FieldsWithTypes } from "../../_framework/util";
|
|
3
3
|
import { PKG_V1 } from "../index";
|
|
4
|
-
import {
|
|
4
|
+
import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
|
|
5
5
|
export declare function isVersion(type: string): boolean;
|
|
6
6
|
export interface VersionFields {
|
|
7
7
|
pos0: ToField<"u16">;
|
|
@@ -22,8 +22,8 @@ export declare class Version implements StructClass {
|
|
|
22
22
|
static get r(): import("../../_framework/reified").StructClassReified<Version, VersionFields>;
|
|
23
23
|
static phantom(): PhantomReified<ToTypeStr<Version>>;
|
|
24
24
|
static get p(): PhantomReified<"0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::version::Version">;
|
|
25
|
-
static get bcs(): import("@mysten/
|
|
26
|
-
pos0: import("@mysten/
|
|
25
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
26
|
+
pos0: import("@mysten/bcs").BcsType<number, number, "u16">;
|
|
27
27
|
}, string>;
|
|
28
28
|
static fromFields(fields: Record<string, any>): Version;
|
|
29
29
|
static fromFieldsWithTypes(item: FieldsWithTypes): Version;
|
|
@@ -40,5 +40,5 @@ export declare class Version implements StructClass {
|
|
|
40
40
|
static fromJSON(json: Record<string, any>): Version;
|
|
41
41
|
static fromSuiParsedData(content: SuiParsedData): Version;
|
|
42
42
|
static fromSuiObjectData(data: SuiObjectData): Version;
|
|
43
|
-
static fetch(client:
|
|
43
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<Version>;
|
|
44
44
|
}
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, phantom, } from "../../_framework/reified";
|
|
11
11
|
import { composeSuiType, compressSuiType, } from "../../_framework/util";
|
|
12
12
|
import { PKG_V1 } from "../index";
|
|
13
|
-
import { bcs } from "@mysten/sui
|
|
14
|
-
import {
|
|
13
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
14
|
+
import { fromBase64 } from "@mysten/sui/utils";
|
|
15
15
|
/* ============================== Version =============================== */
|
|
16
16
|
export function isVersion(type) {
|
|
17
17
|
type = compressSuiType(type);
|
|
@@ -111,7 +111,7 @@ export class Version {
|
|
|
111
111
|
if (data.bcs.dataType !== "moveObject" || !isVersion(data.bcs.type)) {
|
|
112
112
|
throw new Error(`object at is not a Version object`);
|
|
113
113
|
}
|
|
114
|
-
return Version.fromBcs(
|
|
114
|
+
return Version.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
115
115
|
}
|
|
116
116
|
if (data.content) {
|
|
117
117
|
return Version.fromSuiParsedData(data.content);
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { Transaction, TransactionObjectInput } from "@mysten/sui
|
|
2
|
-
export declare function new_(tx: Transaction, typeArg: string, adminCap: TransactionObjectInput): import("@mysten/sui
|
|
1
|
+
import { Transaction, TransactionObjectInput } from "@mysten/sui/transactions";
|
|
2
|
+
export declare function new_(tx: Transaction, typeArg: string, adminCap: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
3
3
|
export interface CollectFeesArgs {
|
|
4
4
|
self: TransactionObjectInput;
|
|
5
5
|
weightHookAdminCap: TransactionObjectInput;
|
|
6
6
|
liquidStakingInfo: TransactionObjectInput;
|
|
7
7
|
systemState: TransactionObjectInput;
|
|
8
8
|
}
|
|
9
|
-
export declare function collectFees(tx: Transaction, typeArg: string, args: CollectFeesArgs): import("@mysten/sui
|
|
10
|
-
export declare function init(tx: Transaction, otw: TransactionObjectInput): import("@mysten/sui
|
|
9
|
+
export declare function collectFees(tx: Transaction, typeArg: string, args: CollectFeesArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
10
|
+
export declare function init(tx: Transaction, otw: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
11
11
|
export interface UpdateFeesArgs {
|
|
12
12
|
self: TransactionObjectInput;
|
|
13
13
|
weightHookAdminCap: TransactionObjectInput;
|
|
14
14
|
liquidStakingInfo: TransactionObjectInput;
|
|
15
15
|
feeConfig: TransactionObjectInput;
|
|
16
16
|
}
|
|
17
|
-
export declare function updateFees(tx: Transaction, typeArg: string, args: UpdateFeesArgs): import("@mysten/sui
|
|
17
|
+
export declare function updateFees(tx: Transaction, typeArg: string, args: UpdateFeesArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
18
18
|
export interface AddToRegistryArgs {
|
|
19
19
|
self: TransactionObjectInput;
|
|
20
20
|
registry: TransactionObjectInput;
|
|
21
21
|
liquidStakingInfo: TransactionObjectInput;
|
|
22
22
|
}
|
|
23
|
-
export declare function addToRegistry(tx: Transaction, typeArg: string, args: AddToRegistryArgs): import("@mysten/sui
|
|
23
|
+
export declare function addToRegistry(tx: Transaction, typeArg: string, args: AddToRegistryArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
24
24
|
export interface AdminCapArgs {
|
|
25
25
|
self: TransactionObjectInput;
|
|
26
26
|
weightHookAdminCap: TransactionObjectInput;
|
|
27
27
|
}
|
|
28
|
-
export declare function adminCap(tx: Transaction, typeArg: string, args: AdminCapArgs): import("@mysten/sui
|
|
28
|
+
export declare function adminCap(tx: Transaction, typeArg: string, args: AdminCapArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
29
29
|
export interface EjectArgs {
|
|
30
30
|
self: TransactionObjectInput;
|
|
31
31
|
adminCap: TransactionObjectInput;
|
|
32
32
|
}
|
|
33
|
-
export declare function eject(tx: Transaction, typeArg: string, args: EjectArgs): import("@mysten/sui
|
|
33
|
+
export declare function eject(tx: Transaction, typeArg: string, args: EjectArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
34
34
|
export interface RebalanceArgs {
|
|
35
35
|
self: TransactionObjectInput;
|
|
36
36
|
systemState: TransactionObjectInput;
|
|
37
37
|
liquidStakingInfo: TransactionObjectInput;
|
|
38
38
|
}
|
|
39
|
-
export declare function rebalance(tx: Transaction, typeArg: string, args: RebalanceArgs): import("@mysten/sui
|
|
39
|
+
export declare function rebalance(tx: Transaction, typeArg: string, args: RebalanceArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
40
40
|
export interface SetValidatorAddressesAndWeightsArgs {
|
|
41
41
|
self: TransactionObjectInput;
|
|
42
42
|
weightHookAdminCap: TransactionObjectInput;
|
|
43
43
|
validatorAddressesAndWeights: TransactionObjectInput;
|
|
44
44
|
}
|
|
45
|
-
export declare function setValidatorAddressesAndWeights(tx: Transaction, typeArg: string, args: SetValidatorAddressesAndWeightsArgs): import("@mysten/sui
|
|
46
|
-
export declare function weightHookId(tx: Transaction, self: TransactionObjectInput): import("@mysten/sui
|
|
45
|
+
export declare function setValidatorAddressesAndWeights(tx: Transaction, typeArg: string, args: SetValidatorAddressesAndWeightsArgs): import("@mysten/sui/transactions").TransactionResult;
|
|
46
|
+
export declare function weightHookId(tx: Transaction, self: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -7,7 +7,7 @@ import { FieldsWithTypes } from "../../_framework/util";
|
|
|
7
7
|
import { PKG_V1, PKG_V5 } from "../index";
|
|
8
8
|
import { AdminCap } from "../liquid-staking/structs";
|
|
9
9
|
import { Version } from "../version/structs";
|
|
10
|
-
import {
|
|
10
|
+
import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
|
|
11
11
|
export declare function isCreateEvent(type: string): boolean;
|
|
12
12
|
export interface CreateEventFields {
|
|
13
13
|
typename: ToField<TypeName>;
|
|
@@ -32,19 +32,19 @@ export declare class CreateEvent implements StructClass {
|
|
|
32
32
|
static get r(): import("../../_framework/reified").StructClassReified<CreateEvent, CreateEventFields>;
|
|
33
33
|
static phantom(): PhantomReified<ToTypeStr<CreateEvent>>;
|
|
34
34
|
static get p(): PhantomReified<"0x8d196820b321bb3c56863b3eb0dd90a49f9eb52e3473373efcebf4388bf04416::weight::CreateEvent">;
|
|
35
|
-
static get bcs(): import("@mysten/
|
|
36
|
-
typename: import("@mysten/
|
|
37
|
-
name: import("@mysten/
|
|
38
|
-
bytes: import("@mysten/
|
|
35
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
36
|
+
typename: import("@mysten/bcs").BcsStruct<{
|
|
37
|
+
name: import("@mysten/bcs").BcsStruct<{
|
|
38
|
+
bytes: import("@mysten/bcs").BcsType<number[], Iterable<number> & {
|
|
39
39
|
length: number;
|
|
40
40
|
}, string>;
|
|
41
41
|
}, string>;
|
|
42
42
|
}, string>;
|
|
43
|
-
weight_hook_id: import("@mysten/
|
|
44
|
-
bytes: import("@mysten/
|
|
43
|
+
weight_hook_id: import("@mysten/bcs").BcsStruct<{
|
|
44
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
45
45
|
}, string>;
|
|
46
|
-
weight_hook_admin_cap_id: import("@mysten/
|
|
47
|
-
bytes: import("@mysten/
|
|
46
|
+
weight_hook_admin_cap_id: import("@mysten/bcs").BcsStruct<{
|
|
47
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
48
48
|
}, string>;
|
|
49
49
|
}, string>;
|
|
50
50
|
static fromFields(fields: Record<string, any>): CreateEvent;
|
|
@@ -70,7 +70,7 @@ export declare class CreateEvent implements StructClass {
|
|
|
70
70
|
static fromJSON(json: Record<string, any>): CreateEvent;
|
|
71
71
|
static fromSuiParsedData(content: SuiParsedData): CreateEvent;
|
|
72
72
|
static fromSuiObjectData(data: SuiObjectData): CreateEvent;
|
|
73
|
-
static fetch(client:
|
|
73
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<CreateEvent>;
|
|
74
74
|
}
|
|
75
75
|
export declare function isRegistryInfo(type: string): boolean;
|
|
76
76
|
export interface RegistryInfoFields {
|
|
@@ -92,9 +92,9 @@ export declare class RegistryInfo implements StructClass {
|
|
|
92
92
|
static get r(): import("../../_framework/reified").StructClassReified<RegistryInfo, RegistryInfoFields>;
|
|
93
93
|
static phantom(): PhantomReified<ToTypeStr<RegistryInfo>>;
|
|
94
94
|
static get p(): PhantomReified<"0x8d196820b321bb3c56863b3eb0dd90a49f9eb52e3473373efcebf4388bf04416::weight::RegistryInfo">;
|
|
95
|
-
static get bcs(): import("@mysten/
|
|
96
|
-
weight_hook_id: import("@mysten/
|
|
97
|
-
bytes: import("@mysten/
|
|
95
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
96
|
+
weight_hook_id: import("@mysten/bcs").BcsStruct<{
|
|
97
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
98
98
|
}, string>;
|
|
99
99
|
}, string>;
|
|
100
100
|
static fromFields(fields: Record<string, any>): RegistryInfo;
|
|
@@ -112,7 +112,7 @@ export declare class RegistryInfo implements StructClass {
|
|
|
112
112
|
static fromJSON(json: Record<string, any>): RegistryInfo;
|
|
113
113
|
static fromSuiParsedData(content: SuiParsedData): RegistryInfo;
|
|
114
114
|
static fromSuiObjectData(data: SuiObjectData): RegistryInfo;
|
|
115
|
-
static fetch(client:
|
|
115
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<RegistryInfo>;
|
|
116
116
|
}
|
|
117
117
|
export declare function isWEIGHT(type: string): boolean;
|
|
118
118
|
export interface WEIGHTFields {
|
|
@@ -134,8 +134,8 @@ export declare class WEIGHT implements StructClass {
|
|
|
134
134
|
static get r(): import("../../_framework/reified").StructClassReified<WEIGHT, WEIGHTFields>;
|
|
135
135
|
static phantom(): PhantomReified<ToTypeStr<WEIGHT>>;
|
|
136
136
|
static get p(): PhantomReified<"0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::weight::WEIGHT">;
|
|
137
|
-
static get bcs(): import("@mysten/
|
|
138
|
-
dummy_field: import("@mysten/
|
|
137
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
138
|
+
dummy_field: import("@mysten/bcs").BcsType<boolean, boolean, "bool">;
|
|
139
139
|
}, string>;
|
|
140
140
|
static fromFields(fields: Record<string, any>): WEIGHT;
|
|
141
141
|
static fromFieldsWithTypes(item: FieldsWithTypes): WEIGHT;
|
|
@@ -152,7 +152,7 @@ export declare class WEIGHT implements StructClass {
|
|
|
152
152
|
static fromJSON(json: Record<string, any>): WEIGHT;
|
|
153
153
|
static fromSuiParsedData(content: SuiParsedData): WEIGHT;
|
|
154
154
|
static fromSuiObjectData(data: SuiObjectData): WEIGHT;
|
|
155
|
-
static fetch(client:
|
|
155
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<WEIGHT>;
|
|
156
156
|
}
|
|
157
157
|
export declare function isWeightHook(type: string): boolean;
|
|
158
158
|
export interface WeightHookFields<P extends PhantomTypeArgument> {
|
|
@@ -184,14 +184,14 @@ export declare class WeightHook<P extends PhantomTypeArgument> implements Struct
|
|
|
184
184
|
static get r(): typeof WeightHook.reified;
|
|
185
185
|
static phantom<P extends PhantomReified<PhantomTypeArgument>>(P: P): PhantomReified<ToTypeStr<WeightHook<ToPhantomTypeArgument<P>>>>;
|
|
186
186
|
static get p(): typeof WeightHook.phantom;
|
|
187
|
-
static get bcs(): import("@mysten/
|
|
188
|
-
id: import("@mysten/
|
|
189
|
-
id: import("@mysten/
|
|
190
|
-
bytes: import("@mysten/
|
|
187
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
188
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
189
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
190
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
191
191
|
}, string>;
|
|
192
192
|
}, string>;
|
|
193
|
-
validator_addresses_and_weights: import("@mysten/
|
|
194
|
-
contents: import("@mysten/
|
|
193
|
+
validator_addresses_and_weights: import("@mysten/bcs").BcsStruct<{
|
|
194
|
+
contents: import("@mysten/bcs").BcsType<{
|
|
195
195
|
key: string;
|
|
196
196
|
value: string;
|
|
197
197
|
}[], Iterable<{
|
|
@@ -201,24 +201,24 @@ export declare class WeightHook<P extends PhantomTypeArgument> implements Struct
|
|
|
201
201
|
length: number;
|
|
202
202
|
}, string>;
|
|
203
203
|
}, string>;
|
|
204
|
-
total_weight: import("@mysten/
|
|
205
|
-
admin_cap: import("@mysten/
|
|
206
|
-
id: import("@mysten/
|
|
207
|
-
id: import("@mysten/
|
|
208
|
-
bytes: import("@mysten/
|
|
204
|
+
total_weight: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
205
|
+
admin_cap: import("@mysten/bcs").BcsStruct<{
|
|
206
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
207
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
208
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
209
209
|
}, string>;
|
|
210
210
|
}, string>;
|
|
211
211
|
}, string>;
|
|
212
|
-
version: import("@mysten/
|
|
213
|
-
pos0: import("@mysten/
|
|
212
|
+
version: import("@mysten/bcs").BcsStruct<{
|
|
213
|
+
pos0: import("@mysten/bcs").BcsType<number, number, "u16">;
|
|
214
214
|
}, string>;
|
|
215
|
-
extra_fields: import("@mysten/
|
|
216
|
-
id: import("@mysten/
|
|
217
|
-
id: import("@mysten/
|
|
218
|
-
bytes: import("@mysten/
|
|
215
|
+
extra_fields: import("@mysten/bcs").BcsStruct<{
|
|
216
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
217
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
218
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
219
219
|
}, string>;
|
|
220
220
|
}, string>;
|
|
221
|
-
size: import("@mysten/
|
|
221
|
+
size: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
222
222
|
}, string>;
|
|
223
223
|
}, string>;
|
|
224
224
|
static fromFields<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, fields: Record<string, any>): WeightHook<ToPhantomTypeArgument<P>>;
|
|
@@ -270,7 +270,7 @@ export declare class WeightHook<P extends PhantomTypeArgument> implements Struct
|
|
|
270
270
|
static fromJSON<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, json: Record<string, any>): WeightHook<ToPhantomTypeArgument<P>>;
|
|
271
271
|
static fromSuiParsedData<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, content: SuiParsedData): WeightHook<ToPhantomTypeArgument<P>>;
|
|
272
272
|
static fromSuiObjectData<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, data: SuiObjectData): WeightHook<ToPhantomTypeArgument<P>>;
|
|
273
|
-
static fetch<P extends PhantomReified<PhantomTypeArgument>>(client:
|
|
273
|
+
static fetch<P extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArg: P, id: string): Promise<WeightHook<ToPhantomTypeArgument<P>>>;
|
|
274
274
|
}
|
|
275
275
|
export declare function isWeightHookAdminCap(type: string): boolean;
|
|
276
276
|
export interface WeightHookAdminCapFields<P extends PhantomTypeArgument> {
|
|
@@ -292,10 +292,10 @@ export declare class WeightHookAdminCap<P extends PhantomTypeArgument> implement
|
|
|
292
292
|
static get r(): typeof WeightHookAdminCap.reified;
|
|
293
293
|
static phantom<P extends PhantomReified<PhantomTypeArgument>>(P: P): PhantomReified<ToTypeStr<WeightHookAdminCap<ToPhantomTypeArgument<P>>>>;
|
|
294
294
|
static get p(): typeof WeightHookAdminCap.phantom;
|
|
295
|
-
static get bcs(): import("@mysten/
|
|
296
|
-
id: import("@mysten/
|
|
297
|
-
id: import("@mysten/
|
|
298
|
-
bytes: import("@mysten/
|
|
295
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
296
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
297
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
298
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
299
299
|
}, string>;
|
|
300
300
|
}, string>;
|
|
301
301
|
}, string>;
|
|
@@ -314,5 +314,5 @@ export declare class WeightHookAdminCap<P extends PhantomTypeArgument> implement
|
|
|
314
314
|
static fromJSON<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, json: Record<string, any>): WeightHookAdminCap<ToPhantomTypeArgument<P>>;
|
|
315
315
|
static fromSuiParsedData<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, content: SuiParsedData): WeightHookAdminCap<ToPhantomTypeArgument<P>>;
|
|
316
316
|
static fromSuiObjectData<P extends PhantomReified<PhantomTypeArgument>>(typeArg: P, data: SuiObjectData): WeightHookAdminCap<ToPhantomTypeArgument<P>>;
|
|
317
|
-
static fetch<P extends PhantomReified<PhantomTypeArgument>>(client:
|
|
317
|
+
static fetch<P extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArg: P, id: string): Promise<WeightHookAdminCap<ToPhantomTypeArgument<P>>>;
|
|
318
318
|
}
|
|
@@ -16,8 +16,8 @@ import { composeSuiType, compressSuiType, parseTypeName, } from "../../_framewor
|
|
|
16
16
|
import { PKG_V1, PKG_V5 } from "../index";
|
|
17
17
|
import { AdminCap } from "../liquid-staking/structs";
|
|
18
18
|
import { Version } from "../version/structs";
|
|
19
|
-
import { bcs } from "@mysten/sui
|
|
20
|
-
import {
|
|
19
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
20
|
+
import { fromBase64, fromHex, toHex } from "@mysten/sui/utils";
|
|
21
21
|
/* ============================== CreateEvent =============================== */
|
|
22
22
|
export function isCreateEvent(type) {
|
|
23
23
|
type = compressSuiType(type);
|
|
@@ -129,7 +129,7 @@ export class CreateEvent {
|
|
|
129
129
|
if (data.bcs.dataType !== "moveObject" || !isCreateEvent(data.bcs.type)) {
|
|
130
130
|
throw new Error(`object at is not a CreateEvent object`);
|
|
131
131
|
}
|
|
132
|
-
return CreateEvent.fromBcs(
|
|
132
|
+
return CreateEvent.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
133
133
|
}
|
|
134
134
|
if (data.content) {
|
|
135
135
|
return CreateEvent.fromSuiParsedData(data.content);
|
|
@@ -254,7 +254,7 @@ export class RegistryInfo {
|
|
|
254
254
|
!isRegistryInfo(data.bcs.type)) {
|
|
255
255
|
throw new Error(`object at is not a RegistryInfo object`);
|
|
256
256
|
}
|
|
257
|
-
return RegistryInfo.fromBcs(
|
|
257
|
+
return RegistryInfo.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
258
258
|
}
|
|
259
259
|
if (data.content) {
|
|
260
260
|
return RegistryInfo.fromSuiParsedData(data.content);
|
|
@@ -378,7 +378,7 @@ export class WEIGHT {
|
|
|
378
378
|
if (data.bcs.dataType !== "moveObject" || !isWEIGHT(data.bcs.type)) {
|
|
379
379
|
throw new Error(`object at is not a WEIGHT object`);
|
|
380
380
|
}
|
|
381
|
-
return WEIGHT.fromBcs(
|
|
381
|
+
return WEIGHT.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
382
382
|
}
|
|
383
383
|
if (data.content) {
|
|
384
384
|
return WEIGHT.fromSuiParsedData(data.content);
|
|
@@ -459,8 +459,8 @@ export class WeightHook {
|
|
|
459
459
|
validator_addresses_and_weights: VecMap.bcs(bcs
|
|
460
460
|
.bytes(32)
|
|
461
461
|
.transform({
|
|
462
|
-
input: (val) =>
|
|
463
|
-
output: (val) =>
|
|
462
|
+
input: (val) => fromHex(val),
|
|
463
|
+
output: (val) => toHex(val),
|
|
464
464
|
}), bcs.u64()),
|
|
465
465
|
total_weight: bcs.u64(),
|
|
466
466
|
admin_cap: AdminCap.bcs,
|
|
@@ -548,7 +548,7 @@ export class WeightHook {
|
|
|
548
548
|
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
549
549
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
550
550
|
}
|
|
551
|
-
return WeightHook.fromBcs(typeArg,
|
|
551
|
+
return WeightHook.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
552
552
|
}
|
|
553
553
|
if (data.content) {
|
|
554
554
|
return WeightHook.fromSuiParsedData(typeArg, data.content);
|
|
@@ -684,7 +684,7 @@ export class WeightHookAdminCap {
|
|
|
684
684
|
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
685
685
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
686
686
|
}
|
|
687
|
-
return WeightHookAdminCap.fromBcs(typeArg,
|
|
687
|
+
return WeightHookAdminCap.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
688
688
|
}
|
|
689
689
|
if (data.content) {
|
|
690
690
|
return WeightHookAdminCap.fromSuiParsedData(typeArg, data.content);
|