@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
|
@@ -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_V31 } from "../index";
|
|
13
|
-
import { bcs } from "@mysten/sui
|
|
14
|
-
import {
|
|
13
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
14
|
+
import { fromBase64, fromHex, toHex } from "@mysten/sui/utils";
|
|
15
15
|
/* ============================== ID =============================== */
|
|
16
16
|
export function isID(type) {
|
|
17
17
|
type = compressSuiType(type);
|
|
@@ -62,8 +62,8 @@ export class ID {
|
|
|
62
62
|
bytes: bcs
|
|
63
63
|
.bytes(32)
|
|
64
64
|
.transform({
|
|
65
|
-
input: (val) =>
|
|
66
|
-
output: (val) =>
|
|
65
|
+
input: (val) => fromHex(val),
|
|
66
|
+
output: (val) => toHex(val),
|
|
67
67
|
}),
|
|
68
68
|
});
|
|
69
69
|
}
|
|
@@ -116,7 +116,7 @@ export class ID {
|
|
|
116
116
|
if (data.bcs.dataType !== "moveObject" || !isID(data.bcs.type)) {
|
|
117
117
|
throw new Error(`object at is not a ID object`);
|
|
118
118
|
}
|
|
119
|
-
return ID.fromBcs(
|
|
119
|
+
return ID.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
120
120
|
}
|
|
121
121
|
if (data.content) {
|
|
122
122
|
return ID.fromSuiParsedData(data.content);
|
|
@@ -237,7 +237,7 @@ export class UID {
|
|
|
237
237
|
if (data.bcs.dataType !== "moveObject" || !isUID(data.bcs.type)) {
|
|
238
238
|
throw new Error(`object at is not a UID object`);
|
|
239
239
|
}
|
|
240
|
-
return UID.fromBcs(
|
|
240
|
+
return UID.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
241
241
|
}
|
|
242
242
|
if (data.content) {
|
|
243
243
|
return UID.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_V31 } from "../index";
|
|
4
|
-
import {
|
|
4
|
+
import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
|
|
5
5
|
export declare function isSUI(type: string): boolean;
|
|
6
6
|
export interface SUIFields {
|
|
7
7
|
dummyField: ToField<"bool">;
|
|
@@ -22,8 +22,8 @@ export declare class SUI implements StructClass {
|
|
|
22
22
|
static get r(): import("../../../../_framework/reified").StructClassReified<SUI, SUIFields>;
|
|
23
23
|
static phantom(): PhantomReified<ToTypeStr<SUI>>;
|
|
24
24
|
static get p(): PhantomReified<"0x2::sui::SUI">;
|
|
25
|
-
static get bcs(): import("@mysten/
|
|
26
|
-
dummy_field: import("@mysten/
|
|
25
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
26
|
+
dummy_field: import("@mysten/bcs").BcsType<boolean, boolean, "bool">;
|
|
27
27
|
}, string>;
|
|
28
28
|
static fromFields(fields: Record<string, any>): SUI;
|
|
29
29
|
static fromFieldsWithTypes(item: FieldsWithTypes): SUI;
|
|
@@ -40,5 +40,5 @@ export declare class SUI implements StructClass {
|
|
|
40
40
|
static fromJSON(json: Record<string, any>): SUI;
|
|
41
41
|
static fromSuiParsedData(content: SuiParsedData): SUI;
|
|
42
42
|
static fromSuiObjectData(data: SuiObjectData): SUI;
|
|
43
|
-
static fetch(client:
|
|
43
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<SUI>;
|
|
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_V31 } 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
|
/* ============================== SUI =============================== */
|
|
16
16
|
export function isSUI(type) {
|
|
17
17
|
type = compressSuiType(type);
|
|
@@ -111,7 +111,7 @@ export class SUI {
|
|
|
111
111
|
if (data.bcs.dataType !== "moveObject" || !isSUI(data.bcs.type)) {
|
|
112
112
|
throw new Error(`object at is not a SUI object`);
|
|
113
113
|
}
|
|
114
|
-
return SUI.fromBcs(
|
|
114
|
+
return SUI.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
115
115
|
}
|
|
116
116
|
if (data.content) {
|
|
117
117
|
return SUI.fromSuiParsedData(data.content);
|
|
@@ -2,7 +2,7 @@ import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructC
|
|
|
2
2
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
3
|
import { PKG_V31 } from "../index";
|
|
4
4
|
import { UID } from "../object/structs";
|
|
5
|
-
import {
|
|
5
|
+
import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
|
|
6
6
|
export declare function isTable(type: string): boolean;
|
|
7
7
|
export interface TableFields<K extends PhantomTypeArgument, V extends PhantomTypeArgument> {
|
|
8
8
|
id: ToField<UID>;
|
|
@@ -25,13 +25,13 @@ export declare class Table<K extends PhantomTypeArgument, V extends PhantomTypeA
|
|
|
25
25
|
static get r(): typeof Table.reified;
|
|
26
26
|
static phantom<K extends PhantomReified<PhantomTypeArgument>, V extends PhantomReified<PhantomTypeArgument>>(K: K, V: V): PhantomReified<ToTypeStr<Table<ToPhantomTypeArgument<K>, ToPhantomTypeArgument<V>>>>;
|
|
27
27
|
static get p(): typeof Table.phantom;
|
|
28
|
-
static get bcs(): import("@mysten/
|
|
29
|
-
id: import("@mysten/
|
|
30
|
-
id: import("@mysten/
|
|
31
|
-
bytes: import("@mysten/
|
|
28
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
29
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
30
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
31
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
32
32
|
}, string>;
|
|
33
33
|
}, string>;
|
|
34
|
-
size: import("@mysten/
|
|
34
|
+
size: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
35
35
|
}, string>;
|
|
36
36
|
static fromFields<K extends PhantomReified<PhantomTypeArgument>, V extends PhantomReified<PhantomTypeArgument>>(typeArgs: [K, V], fields: Record<string, any>): Table<ToPhantomTypeArgument<K>, ToPhantomTypeArgument<V>>;
|
|
37
37
|
static fromFieldsWithTypes<K extends PhantomReified<PhantomTypeArgument>, V extends PhantomReified<PhantomTypeArgument>>(typeArgs: [K, V], item: FieldsWithTypes): Table<ToPhantomTypeArgument<K>, ToPhantomTypeArgument<V>>;
|
|
@@ -50,5 +50,5 @@ export declare class Table<K extends PhantomTypeArgument, V extends PhantomTypeA
|
|
|
50
50
|
static fromJSON<K extends PhantomReified<PhantomTypeArgument>, V extends PhantomReified<PhantomTypeArgument>>(typeArgs: [K, V], json: Record<string, any>): Table<ToPhantomTypeArgument<K>, ToPhantomTypeArgument<V>>;
|
|
51
51
|
static fromSuiParsedData<K extends PhantomReified<PhantomTypeArgument>, V extends PhantomReified<PhantomTypeArgument>>(typeArgs: [K, V], content: SuiParsedData): Table<ToPhantomTypeArgument<K>, ToPhantomTypeArgument<V>>;
|
|
52
52
|
static fromSuiObjectData<K extends PhantomReified<PhantomTypeArgument>, V extends PhantomReified<PhantomTypeArgument>>(typeArgs: [K, V], data: SuiObjectData): Table<ToPhantomTypeArgument<K>, ToPhantomTypeArgument<V>>;
|
|
53
|
-
static fetch<K extends PhantomReified<PhantomTypeArgument>, V extends PhantomReified<PhantomTypeArgument>>(client:
|
|
53
|
+
static fetch<K extends PhantomReified<PhantomTypeArgument>, V extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArgs: [K, V], id: string): Promise<Table<ToPhantomTypeArgument<K>, ToPhantomTypeArgument<V>>>;
|
|
54
54
|
}
|
|
@@ -11,8 +11,8 @@ import { assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromF
|
|
|
11
11
|
import { composeSuiType, compressSuiType, parseTypeName, } from "../../../../_framework/util";
|
|
12
12
|
import { PKG_V31 } from "../index";
|
|
13
13
|
import { UID } from "../object/structs";
|
|
14
|
-
import { bcs } from "@mysten/sui
|
|
15
|
-
import {
|
|
14
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
15
|
+
import { fromBase64 } from "@mysten/sui/utils";
|
|
16
16
|
/* ============================== Table =============================== */
|
|
17
17
|
export function isTable(type) {
|
|
18
18
|
type = compressSuiType(type);
|
|
@@ -131,7 +131,7 @@ export class Table {
|
|
|
131
131
|
throw new Error(`type argument mismatch at position ${i}: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
return Table.fromBcs(typeArgs,
|
|
134
|
+
return Table.fromBcs(typeArgs, fromBase64(data.bcs.bcsBytes));
|
|
135
135
|
}
|
|
136
136
|
if (data.content) {
|
|
137
137
|
return Table.fromSuiParsedData(typeArgs, data.content);
|
|
@@ -2,7 +2,7 @@ import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../
|
|
|
2
2
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
3
|
import { String } from "../../0x1/ascii/structs";
|
|
4
4
|
import { PKG_V31 } from "../index";
|
|
5
|
-
import {
|
|
5
|
+
import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
|
|
6
6
|
export declare function isUrl(type: string): boolean;
|
|
7
7
|
export interface UrlFields {
|
|
8
8
|
url: ToField<String>;
|
|
@@ -23,9 +23,9 @@ export declare class Url implements StructClass {
|
|
|
23
23
|
static get r(): import("../../../../_framework/reified").StructClassReified<Url, UrlFields>;
|
|
24
24
|
static phantom(): PhantomReified<ToTypeStr<Url>>;
|
|
25
25
|
static get p(): PhantomReified<"0x2::url::Url">;
|
|
26
|
-
static get bcs(): import("@mysten/
|
|
27
|
-
url: import("@mysten/
|
|
28
|
-
bytes: import("@mysten/
|
|
26
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
27
|
+
url: import("@mysten/bcs").BcsStruct<{
|
|
28
|
+
bytes: import("@mysten/bcs").BcsType<number[], Iterable<number> & {
|
|
29
29
|
length: number;
|
|
30
30
|
}, string>;
|
|
31
31
|
}, string>;
|
|
@@ -45,5 +45,5 @@ export declare class Url implements StructClass {
|
|
|
45
45
|
static fromJSON(json: Record<string, any>): Url;
|
|
46
46
|
static fromSuiParsedData(content: SuiParsedData): Url;
|
|
47
47
|
static fromSuiObjectData(data: SuiObjectData): Url;
|
|
48
|
-
static fetch(client:
|
|
48
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<Url>;
|
|
49
49
|
}
|
|
@@ -11,8 +11,8 @@ import { decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, phant
|
|
|
11
11
|
import { composeSuiType, compressSuiType, } from "../../../../_framework/util";
|
|
12
12
|
import { String } from "../../0x1/ascii/structs";
|
|
13
13
|
import { PKG_V31 } from "../index";
|
|
14
|
-
import { bcs } from "@mysten/sui
|
|
15
|
-
import {
|
|
14
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
15
|
+
import { fromBase64 } from "@mysten/sui/utils";
|
|
16
16
|
/* ============================== Url =============================== */
|
|
17
17
|
export function isUrl(type) {
|
|
18
18
|
type = compressSuiType(type);
|
|
@@ -112,7 +112,7 @@ export class Url {
|
|
|
112
112
|
if (data.bcs.dataType !== "moveObject" || !isUrl(data.bcs.type)) {
|
|
113
113
|
throw new Error(`object at is not a Url object`);
|
|
114
114
|
}
|
|
115
|
-
return Url.fromBcs(
|
|
115
|
+
return Url.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
116
116
|
}
|
|
117
117
|
if (data.content) {
|
|
118
118
|
return Url.fromSuiParsedData(data.content);
|
|
@@ -3,8 +3,8 @@ import { PhantomReified, Reified, StructClass, ToField, ToTypeArgument, ToTypeSt
|
|
|
3
3
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
4
4
|
import { Vector } from "../../../../_framework/vector";
|
|
5
5
|
import { PKG_V31 } from "../index";
|
|
6
|
-
import { BcsType } from "@mysten/sui
|
|
7
|
-
import {
|
|
6
|
+
import { BcsType } from "@mysten/sui/bcs";
|
|
7
|
+
import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
|
|
8
8
|
export declare function isEntry(type: string): boolean;
|
|
9
9
|
export interface EntryFields<K extends TypeArgument, V extends TypeArgument> {
|
|
10
10
|
key: ToField<K>;
|
|
@@ -27,7 +27,7 @@ export declare class Entry<K extends TypeArgument, V extends TypeArgument> imple
|
|
|
27
27
|
static get r(): typeof Entry.reified;
|
|
28
28
|
static phantom<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(K: K, V: V): PhantomReified<ToTypeStr<Entry<ToTypeArgument<K>, ToTypeArgument<V>>>>;
|
|
29
29
|
static get p(): typeof Entry.phantom;
|
|
30
|
-
static get bcs(): <K extends BcsType<any>, V extends BcsType<any>>(K: K, V: V) => import("@mysten/
|
|
30
|
+
static get bcs(): <K extends BcsType<any>, V extends BcsType<any>>(K: K, V: V) => import("@mysten/bcs").BcsStruct<{
|
|
31
31
|
key: K;
|
|
32
32
|
value: V;
|
|
33
33
|
}, string>;
|
|
@@ -48,7 +48,7 @@ export declare class Entry<K extends TypeArgument, V extends TypeArgument> imple
|
|
|
48
48
|
static fromJSON<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], json: Record<string, any>): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
|
|
49
49
|
static fromSuiParsedData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], content: SuiParsedData): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
|
|
50
50
|
static fromSuiObjectData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], data: SuiObjectData): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
|
|
51
|
-
static fetch<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(client:
|
|
51
|
+
static fetch<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(client: SuiJsonRpcClient, typeArgs: [K, V], id: string): Promise<Entry<ToTypeArgument<K>, ToTypeArgument<V>>>;
|
|
52
52
|
}
|
|
53
53
|
export declare function isVecMap(type: string): boolean;
|
|
54
54
|
export interface VecMapFields<K extends TypeArgument, V extends TypeArgument> {
|
|
@@ -70,7 +70,7 @@ export declare class VecMap<K extends TypeArgument, V extends TypeArgument> impl
|
|
|
70
70
|
static get r(): typeof VecMap.reified;
|
|
71
71
|
static phantom<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(K: K, V: V): PhantomReified<ToTypeStr<VecMap<ToTypeArgument<K>, ToTypeArgument<V>>>>;
|
|
72
72
|
static get p(): typeof VecMap.phantom;
|
|
73
|
-
static get bcs(): <K extends BcsType<any>, V extends BcsType<any>>(K: K, V: V) => import("@mysten/
|
|
73
|
+
static get bcs(): <K extends BcsType<any>, V extends BcsType<any>>(K: K, V: V) => import("@mysten/bcs").BcsStruct<{
|
|
74
74
|
contents: BcsType<{
|
|
75
75
|
key: K extends BcsType<infer U, any, string> ? U : never;
|
|
76
76
|
value: V extends BcsType<infer U, any, string> ? U : never;
|
|
@@ -102,5 +102,5 @@ export declare class VecMap<K extends TypeArgument, V extends TypeArgument> impl
|
|
|
102
102
|
static fromJSON<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], json: Record<string, any>): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
|
|
103
103
|
static fromSuiParsedData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], content: SuiParsedData): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
|
|
104
104
|
static fromSuiObjectData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], data: SuiObjectData): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
|
|
105
|
-
static fetch<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(client:
|
|
105
|
+
static fetch<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(client: SuiJsonRpcClient, typeArgs: [K, V], id: string): Promise<VecMap<ToTypeArgument<K>, ToTypeArgument<V>>>;
|
|
106
106
|
}
|
|
@@ -11,8 +11,8 @@ import * as reified from "../../../../_framework/reified";
|
|
|
11
11
|
import { assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, extractType, fieldToJSON, phantom, toBcs, } from "../../../../_framework/reified";
|
|
12
12
|
import { composeSuiType, compressSuiType, parseTypeName, } from "../../../../_framework/util";
|
|
13
13
|
import { PKG_V31 } from "../index";
|
|
14
|
-
import { bcs } from "@mysten/sui
|
|
15
|
-
import {
|
|
14
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
15
|
+
import { fromBase64 } from "@mysten/sui/utils";
|
|
16
16
|
/* ============================== Entry =============================== */
|
|
17
17
|
export function isEntry(type) {
|
|
18
18
|
type = compressSuiType(type);
|
|
@@ -131,7 +131,7 @@ export class Entry {
|
|
|
131
131
|
throw new Error(`type argument mismatch at position ${i}: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
return Entry.fromBcs(typeArgs,
|
|
134
|
+
return Entry.fromBcs(typeArgs, fromBase64(data.bcs.bcsBytes));
|
|
135
135
|
}
|
|
136
136
|
if (data.content) {
|
|
137
137
|
return Entry.fromSuiParsedData(typeArgs, data.content);
|
|
@@ -268,7 +268,7 @@ export class VecMap {
|
|
|
268
268
|
throw new Error(`type argument mismatch at position ${i}: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
return VecMap.fromBcs(typeArgs,
|
|
271
|
+
return VecMap.fromBcs(typeArgs, fromBase64(data.bcs.bcsBytes));
|
|
272
272
|
}
|
|
273
273
|
if (data.content) {
|
|
274
274
|
return VecMap.fromSuiParsedData(typeArgs, data.content);
|
|
@@ -8,7 +8,7 @@ import { ID, UID } from "../../0x2/object/structs";
|
|
|
8
8
|
import { SUI } from "../../0x2/sui/structs";
|
|
9
9
|
import { Table } from "../../0x2/table/structs";
|
|
10
10
|
import { PKG_V19 } from "../index";
|
|
11
|
-
import {
|
|
11
|
+
import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
|
|
12
12
|
export declare function isFungibleStakedSui(type: string): boolean;
|
|
13
13
|
export interface FungibleStakedSuiFields {
|
|
14
14
|
id: ToField<UID>;
|
|
@@ -33,16 +33,16 @@ export declare class FungibleStakedSui implements StructClass {
|
|
|
33
33
|
static get r(): reified.StructClassReified<FungibleStakedSui, FungibleStakedSuiFields>;
|
|
34
34
|
static phantom(): PhantomReified<ToTypeStr<FungibleStakedSui>>;
|
|
35
35
|
static get p(): reified.PhantomReified<"0x3::staking_pool::FungibleStakedSui">;
|
|
36
|
-
static get bcs(): import("@mysten/
|
|
37
|
-
id: import("@mysten/
|
|
38
|
-
id: import("@mysten/
|
|
39
|
-
bytes: import("@mysten/
|
|
36
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
37
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
38
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
39
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
40
40
|
}, string>;
|
|
41
41
|
}, string>;
|
|
42
|
-
pool_id: import("@mysten/
|
|
43
|
-
bytes: import("@mysten/
|
|
42
|
+
pool_id: import("@mysten/bcs").BcsStruct<{
|
|
43
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
44
44
|
}, string>;
|
|
45
|
-
value: import("@mysten/
|
|
45
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
46
46
|
}, string>;
|
|
47
47
|
static fromFields(fields: Record<string, any>): FungibleStakedSui;
|
|
48
48
|
static fromFieldsWithTypes(item: FieldsWithTypes): FungibleStakedSui;
|
|
@@ -63,7 +63,7 @@ export declare class FungibleStakedSui implements StructClass {
|
|
|
63
63
|
static fromJSON(json: Record<string, any>): FungibleStakedSui;
|
|
64
64
|
static fromSuiParsedData(content: SuiParsedData): FungibleStakedSui;
|
|
65
65
|
static fromSuiObjectData(data: SuiObjectData): FungibleStakedSui;
|
|
66
|
-
static fetch(client:
|
|
66
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<FungibleStakedSui>;
|
|
67
67
|
}
|
|
68
68
|
export declare function isFungibleStakedSuiData(type: string): boolean;
|
|
69
69
|
export interface FungibleStakedSuiDataFields {
|
|
@@ -89,15 +89,15 @@ export declare class FungibleStakedSuiData implements StructClass {
|
|
|
89
89
|
static get r(): reified.StructClassReified<FungibleStakedSuiData, FungibleStakedSuiDataFields>;
|
|
90
90
|
static phantom(): PhantomReified<ToTypeStr<FungibleStakedSuiData>>;
|
|
91
91
|
static get p(): reified.PhantomReified<"0x3::staking_pool::FungibleStakedSuiData">;
|
|
92
|
-
static get bcs(): import("@mysten/
|
|
93
|
-
id: import("@mysten/
|
|
94
|
-
id: import("@mysten/
|
|
95
|
-
bytes: import("@mysten/
|
|
92
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
93
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
94
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
95
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
96
96
|
}, string>;
|
|
97
97
|
}, string>;
|
|
98
|
-
total_supply: import("@mysten/
|
|
99
|
-
principal: import("@mysten/
|
|
100
|
-
value: import("@mysten/
|
|
98
|
+
total_supply: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
99
|
+
principal: import("@mysten/bcs").BcsStruct<{
|
|
100
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
101
101
|
}, string>;
|
|
102
102
|
}, string>;
|
|
103
103
|
static fromFields(fields: Record<string, any>): FungibleStakedSuiData;
|
|
@@ -123,7 +123,7 @@ export declare class FungibleStakedSuiData implements StructClass {
|
|
|
123
123
|
static fromJSON(json: Record<string, any>): FungibleStakedSuiData;
|
|
124
124
|
static fromSuiParsedData(content: SuiParsedData): FungibleStakedSuiData;
|
|
125
125
|
static fromSuiObjectData(data: SuiObjectData): FungibleStakedSuiData;
|
|
126
|
-
static fetch(client:
|
|
126
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<FungibleStakedSuiData>;
|
|
127
127
|
}
|
|
128
128
|
export declare function isFungibleStakedSuiDataKey(type: string): boolean;
|
|
129
129
|
export interface FungibleStakedSuiDataKeyFields {
|
|
@@ -145,8 +145,8 @@ export declare class FungibleStakedSuiDataKey implements StructClass {
|
|
|
145
145
|
static get r(): reified.StructClassReified<FungibleStakedSuiDataKey, FungibleStakedSuiDataKeyFields>;
|
|
146
146
|
static phantom(): PhantomReified<ToTypeStr<FungibleStakedSuiDataKey>>;
|
|
147
147
|
static get p(): reified.PhantomReified<"0x3::staking_pool::FungibleStakedSuiDataKey">;
|
|
148
|
-
static get bcs(): import("@mysten/
|
|
149
|
-
dummy_field: import("@mysten/
|
|
148
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
149
|
+
dummy_field: import("@mysten/bcs").BcsType<boolean, boolean, "bool">;
|
|
150
150
|
}, string>;
|
|
151
151
|
static fromFields(fields: Record<string, any>): FungibleStakedSuiDataKey;
|
|
152
152
|
static fromFieldsWithTypes(item: FieldsWithTypes): FungibleStakedSuiDataKey;
|
|
@@ -163,7 +163,7 @@ export declare class FungibleStakedSuiDataKey implements StructClass {
|
|
|
163
163
|
static fromJSON(json: Record<string, any>): FungibleStakedSuiDataKey;
|
|
164
164
|
static fromSuiParsedData(content: SuiParsedData): FungibleStakedSuiDataKey;
|
|
165
165
|
static fromSuiObjectData(data: SuiObjectData): FungibleStakedSuiDataKey;
|
|
166
|
-
static fetch(client:
|
|
166
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<FungibleStakedSuiDataKey>;
|
|
167
167
|
}
|
|
168
168
|
export declare function isPoolTokenExchangeRate(type: string): boolean;
|
|
169
169
|
export interface PoolTokenExchangeRateFields {
|
|
@@ -187,9 +187,9 @@ export declare class PoolTokenExchangeRate implements StructClass {
|
|
|
187
187
|
static get r(): reified.StructClassReified<PoolTokenExchangeRate, PoolTokenExchangeRateFields>;
|
|
188
188
|
static phantom(): PhantomReified<ToTypeStr<PoolTokenExchangeRate>>;
|
|
189
189
|
static get p(): reified.PhantomReified<"0x3::staking_pool::PoolTokenExchangeRate">;
|
|
190
|
-
static get bcs(): import("@mysten/
|
|
191
|
-
sui_amount: import("@mysten/
|
|
192
|
-
pool_token_amount: import("@mysten/
|
|
190
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
191
|
+
sui_amount: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
192
|
+
pool_token_amount: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
193
193
|
}, string>;
|
|
194
194
|
static fromFields(fields: Record<string, any>): PoolTokenExchangeRate;
|
|
195
195
|
static fromFieldsWithTypes(item: FieldsWithTypes): PoolTokenExchangeRate;
|
|
@@ -208,7 +208,7 @@ export declare class PoolTokenExchangeRate implements StructClass {
|
|
|
208
208
|
static fromJSON(json: Record<string, any>): PoolTokenExchangeRate;
|
|
209
209
|
static fromSuiParsedData(content: SuiParsedData): PoolTokenExchangeRate;
|
|
210
210
|
static fromSuiObjectData(data: SuiObjectData): PoolTokenExchangeRate;
|
|
211
|
-
static fetch(client:
|
|
211
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<PoolTokenExchangeRate>;
|
|
212
212
|
}
|
|
213
213
|
export declare function isStakedSui(type: string): boolean;
|
|
214
214
|
export interface StakedSuiFields {
|
|
@@ -236,18 +236,18 @@ export declare class StakedSui implements StructClass {
|
|
|
236
236
|
static get r(): reified.StructClassReified<StakedSui, StakedSuiFields>;
|
|
237
237
|
static phantom(): PhantomReified<ToTypeStr<StakedSui>>;
|
|
238
238
|
static get p(): reified.PhantomReified<"0x3::staking_pool::StakedSui">;
|
|
239
|
-
static get bcs(): import("@mysten/
|
|
240
|
-
id: import("@mysten/
|
|
241
|
-
id: import("@mysten/
|
|
242
|
-
bytes: import("@mysten/
|
|
239
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
240
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
241
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
242
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
243
243
|
}, string>;
|
|
244
244
|
}, string>;
|
|
245
|
-
pool_id: import("@mysten/
|
|
246
|
-
bytes: import("@mysten/
|
|
245
|
+
pool_id: import("@mysten/bcs").BcsStruct<{
|
|
246
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
247
247
|
}, string>;
|
|
248
|
-
stake_activation_epoch: import("@mysten/
|
|
249
|
-
principal: import("@mysten/
|
|
250
|
-
value: import("@mysten/
|
|
248
|
+
stake_activation_epoch: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
249
|
+
principal: import("@mysten/bcs").BcsStruct<{
|
|
250
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
251
251
|
}, string>;
|
|
252
252
|
}, string>;
|
|
253
253
|
static fromFields(fields: Record<string, any>): StakedSui;
|
|
@@ -275,7 +275,7 @@ export declare class StakedSui implements StructClass {
|
|
|
275
275
|
static fromJSON(json: Record<string, any>): StakedSui;
|
|
276
276
|
static fromSuiParsedData(content: SuiParsedData): StakedSui;
|
|
277
277
|
static fromSuiObjectData(data: SuiObjectData): StakedSui;
|
|
278
|
-
static fetch(client:
|
|
278
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<StakedSui>;
|
|
279
279
|
}
|
|
280
280
|
export declare function isStakingPool(type: string): boolean;
|
|
281
281
|
export interface StakingPoolFields {
|
|
@@ -317,37 +317,45 @@ export declare class StakingPool implements StructClass {
|
|
|
317
317
|
static get r(): reified.StructClassReified<StakingPool, StakingPoolFields>;
|
|
318
318
|
static phantom(): PhantomReified<ToTypeStr<StakingPool>>;
|
|
319
319
|
static get p(): reified.PhantomReified<"0x3::staking_pool::StakingPool">;
|
|
320
|
-
static get bcs(): import("@mysten/
|
|
321
|
-
id: import("@mysten/
|
|
322
|
-
id: import("@mysten/
|
|
323
|
-
bytes: import("@mysten/
|
|
320
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
321
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
322
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
323
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
324
324
|
}, string>;
|
|
325
325
|
}, string>;
|
|
326
|
-
activation_epoch:
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
326
|
+
activation_epoch: import("@mysten/bcs").BcsStruct<{
|
|
327
|
+
vec: import("@mysten/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
328
|
+
length: number;
|
|
329
|
+
}, string>;
|
|
330
|
+
}, string>;
|
|
331
|
+
deactivation_epoch: import("@mysten/bcs").BcsStruct<{
|
|
332
|
+
vec: import("@mysten/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
333
|
+
length: number;
|
|
334
|
+
}, string>;
|
|
335
|
+
}, string>;
|
|
336
|
+
sui_balance: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
337
|
+
rewards_pool: import("@mysten/bcs").BcsStruct<{
|
|
338
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
331
339
|
}, string>;
|
|
332
|
-
pool_token_balance: import("@mysten/
|
|
333
|
-
exchange_rates: import("@mysten/
|
|
334
|
-
id: import("@mysten/
|
|
335
|
-
id: import("@mysten/
|
|
336
|
-
bytes: import("@mysten/
|
|
340
|
+
pool_token_balance: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
341
|
+
exchange_rates: import("@mysten/bcs").BcsStruct<{
|
|
342
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
343
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
344
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
337
345
|
}, string>;
|
|
338
346
|
}, string>;
|
|
339
|
-
size: import("@mysten/
|
|
347
|
+
size: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
340
348
|
}, string>;
|
|
341
|
-
pending_stake: import("@mysten/
|
|
342
|
-
pending_total_sui_withdraw: import("@mysten/
|
|
343
|
-
pending_pool_token_withdraw: import("@mysten/
|
|
344
|
-
extra_fields: import("@mysten/
|
|
345
|
-
id: import("@mysten/
|
|
346
|
-
id: import("@mysten/
|
|
347
|
-
bytes: import("@mysten/
|
|
349
|
+
pending_stake: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
350
|
+
pending_total_sui_withdraw: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
351
|
+
pending_pool_token_withdraw: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
352
|
+
extra_fields: import("@mysten/bcs").BcsStruct<{
|
|
353
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
354
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
355
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
348
356
|
}, string>;
|
|
349
357
|
}, string>;
|
|
350
|
-
size: import("@mysten/
|
|
358
|
+
size: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
351
359
|
}, string>;
|
|
352
360
|
}, string>;
|
|
353
361
|
static fromFields(fields: Record<string, any>): StakingPool;
|
|
@@ -401,5 +409,5 @@ export declare class StakingPool implements StructClass {
|
|
|
401
409
|
static fromJSON(json: Record<string, any>): StakingPool;
|
|
402
410
|
static fromSuiParsedData(content: SuiParsedData): StakingPool;
|
|
403
411
|
static fromSuiObjectData(data: SuiObjectData): StakingPool;
|
|
404
|
-
static fetch(client:
|
|
412
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<StakingPool>;
|
|
405
413
|
}
|
|
@@ -17,8 +17,8 @@ import { ID, UID } from "../../0x2/object/structs";
|
|
|
17
17
|
import { SUI } from "../../0x2/sui/structs";
|
|
18
18
|
import { Table } from "../../0x2/table/structs";
|
|
19
19
|
import { PKG_V19 } from "../index";
|
|
20
|
-
import { bcs } from "@mysten/sui
|
|
21
|
-
import {
|
|
20
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
21
|
+
import { fromBase64 } from "@mysten/sui/utils";
|
|
22
22
|
/* ============================== FungibleStakedSui =============================== */
|
|
23
23
|
export function isFungibleStakedSui(type) {
|
|
24
24
|
type = compressSuiType(type);
|
|
@@ -131,7 +131,7 @@ export class FungibleStakedSui {
|
|
|
131
131
|
!isFungibleStakedSui(data.bcs.type)) {
|
|
132
132
|
throw new Error(`object at is not a FungibleStakedSui object`);
|
|
133
133
|
}
|
|
134
|
-
return FungibleStakedSui.fromBcs(
|
|
134
|
+
return FungibleStakedSui.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
135
135
|
}
|
|
136
136
|
if (data.content) {
|
|
137
137
|
return FungibleStakedSui.fromSuiParsedData(data.content);
|
|
@@ -268,7 +268,7 @@ export class FungibleStakedSuiData {
|
|
|
268
268
|
!isFungibleStakedSuiData(data.bcs.type)) {
|
|
269
269
|
throw new Error(`object at is not a FungibleStakedSuiData object`);
|
|
270
270
|
}
|
|
271
|
-
return FungibleStakedSuiData.fromBcs(
|
|
271
|
+
return FungibleStakedSuiData.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
272
272
|
}
|
|
273
273
|
if (data.content) {
|
|
274
274
|
return FungibleStakedSuiData.fromSuiParsedData(data.content);
|
|
@@ -393,7 +393,7 @@ export class FungibleStakedSuiDataKey {
|
|
|
393
393
|
!isFungibleStakedSuiDataKey(data.bcs.type)) {
|
|
394
394
|
throw new Error(`object at is not a FungibleStakedSuiDataKey object`);
|
|
395
395
|
}
|
|
396
|
-
return FungibleStakedSuiDataKey.fromBcs(
|
|
396
|
+
return FungibleStakedSuiDataKey.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
397
397
|
}
|
|
398
398
|
if (data.content) {
|
|
399
399
|
return FungibleStakedSuiDataKey.fromSuiParsedData(data.content);
|
|
@@ -524,7 +524,7 @@ export class PoolTokenExchangeRate {
|
|
|
524
524
|
!isPoolTokenExchangeRate(data.bcs.type)) {
|
|
525
525
|
throw new Error(`object at is not a PoolTokenExchangeRate object`);
|
|
526
526
|
}
|
|
527
|
-
return PoolTokenExchangeRate.fromBcs(
|
|
527
|
+
return PoolTokenExchangeRate.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
528
528
|
}
|
|
529
529
|
if (data.content) {
|
|
530
530
|
return PoolTokenExchangeRate.fromSuiParsedData(data.content);
|
|
@@ -666,7 +666,7 @@ export class StakedSui {
|
|
|
666
666
|
if (data.bcs.dataType !== "moveObject" || !isStakedSui(data.bcs.type)) {
|
|
667
667
|
throw new Error(`object at is not a StakedSui object`);
|
|
668
668
|
}
|
|
669
|
-
return StakedSui.fromBcs(
|
|
669
|
+
return StakedSui.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
670
670
|
}
|
|
671
671
|
if (data.content) {
|
|
672
672
|
return StakedSui.fromSuiParsedData(data.content);
|
|
@@ -850,7 +850,7 @@ export class StakingPool {
|
|
|
850
850
|
if (data.bcs.dataType !== "moveObject" || !isStakingPool(data.bcs.type)) {
|
|
851
851
|
throw new Error(`object at is not a StakingPool object`);
|
|
852
852
|
}
|
|
853
|
-
return StakingPool.fromBcs(
|
|
853
|
+
return StakingPool.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
854
854
|
}
|
|
855
855
|
if (data.content) {
|
|
856
856
|
return StakingPool.fromSuiParsedData(data.content);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BcsType } from "@mysten/sui
|
|
1
|
+
import { BcsType } from "@mysten/sui/bcs";
|
|
2
2
|
import { FieldsWithTypes } from "./util";
|
|
3
|
-
import {
|
|
3
|
+
import { SuiJsonRpcClient, SuiParsedData, SuiObjectData } from "@mysten/sui/jsonRpc";
|
|
4
4
|
export { vector } from "./vector";
|
|
5
5
|
export interface StructClass {
|
|
6
6
|
readonly $typeName: string;
|
|
@@ -37,7 +37,7 @@ export interface StructClassReified<T extends StructClass, Fields> {
|
|
|
37
37
|
fromJSON: (json: Record<string, any>) => T;
|
|
38
38
|
fromSuiParsedData: (content: SuiParsedData) => T;
|
|
39
39
|
fromSuiObjectData: (data: SuiObjectData) => T;
|
|
40
|
-
fetch: (client:
|
|
40
|
+
fetch: (client: SuiJsonRpcClient, id: string) => Promise<T>;
|
|
41
41
|
new: (fields: Fields) => T;
|
|
42
42
|
kind: "StructClassReified";
|
|
43
43
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bcs } from "@mysten/sui
|
|
2
|
-
import {
|
|
1
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
2
|
+
import { fromHex, toHex } from "@mysten/sui/utils";
|
|
3
3
|
import { compressSuiType, parseTypeName } from "./util";
|
|
4
4
|
// for backwards compatibility
|
|
5
5
|
export { vector } from "./vector";
|
|
@@ -18,8 +18,8 @@ export function phantom(type) {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
const Address = bcs.bytes(32).transform({
|
|
21
|
-
input: (val) =>
|
|
22
|
-
output: (val) =>
|
|
21
|
+
input: (val) => fromHex(val),
|
|
22
|
+
output: (val) => toHex(val),
|
|
23
23
|
});
|
|
24
24
|
export function toBcs(arg) {
|
|
25
25
|
switch (arg) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transaction, TransactionArgument, TransactionObjectInput } from "@mysten/sui
|
|
1
|
+
import { Transaction, TransactionArgument, TransactionObjectArgument, TransactionObjectInput } from "@mysten/sui/transactions";
|
|
2
2
|
export interface FieldsWithTypes {
|
|
3
3
|
fields: Record<string, any>;
|
|
4
4
|
type: string;
|
|
@@ -12,10 +12,10 @@ export declare function parseTypeName(name: string): {
|
|
|
12
12
|
typeArgs: string[];
|
|
13
13
|
};
|
|
14
14
|
export declare function isTransactionArgument(arg: GenericArg): arg is TransactionArgument;
|
|
15
|
-
export declare function obj(tx: Transaction, arg: TransactionObjectInput):
|
|
15
|
+
export declare function obj(tx: Transaction, arg: TransactionObjectInput): TransactionObjectArgument;
|
|
16
16
|
export declare function pure(tx: Transaction, arg: PureArg, type: string): TransactionArgument;
|
|
17
|
-
export declare function option(tx: Transaction, type: string, arg: GenericArg | null):
|
|
18
|
-
export declare function generic(tx: Transaction, type: string, arg: GenericArg):
|
|
17
|
+
export declare function option(tx: Transaction, type: string, arg: GenericArg | null): TransactionArgument;
|
|
18
|
+
export declare function generic(tx: Transaction, type: string, arg: GenericArg): TransactionArgument;
|
|
19
19
|
export declare function vector(tx: Transaction, itemType: string, items: Array<GenericArg> | TransactionArgument): TransactionArgument;
|
|
20
20
|
export declare function typeArgIsPure(type: string): boolean;
|
|
21
21
|
export declare function compressSuiAddress(addr: string): string;
|