@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
|
@@ -3,7 +3,7 @@ import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../
|
|
|
3
3
|
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
4
4
|
import { Vector } from "../../../../_framework/vector";
|
|
5
5
|
import { PKG_V14 } from "../index";
|
|
6
|
-
import {
|
|
6
|
+
import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
|
|
7
7
|
export declare function isString(type: string): boolean;
|
|
8
8
|
export interface StringFields {
|
|
9
9
|
bytes: ToField<Vector<"u8">>;
|
|
@@ -24,8 +24,8 @@ export declare class String implements StructClass {
|
|
|
24
24
|
static get r(): reified.StructClassReified<String, StringFields>;
|
|
25
25
|
static phantom(): PhantomReified<ToTypeStr<String>>;
|
|
26
26
|
static get p(): reified.PhantomReified<"0x1::string::String">;
|
|
27
|
-
static get bcs(): import("@mysten/
|
|
28
|
-
bytes: import("@mysten/
|
|
27
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
28
|
+
bytes: import("@mysten/bcs").BcsType<number[], Iterable<number> & {
|
|
29
29
|
length: number;
|
|
30
30
|
}, string>;
|
|
31
31
|
}, string>;
|
|
@@ -44,5 +44,5 @@ export declare class String implements StructClass {
|
|
|
44
44
|
static fromJSON(json: Record<string, any>): String;
|
|
45
45
|
static fromSuiParsedData(content: SuiParsedData): String;
|
|
46
46
|
static fromSuiObjectData(data: SuiObjectData): String;
|
|
47
|
-
static fetch(client:
|
|
47
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<String>;
|
|
48
48
|
}
|
|
@@ -11,8 +11,8 @@ import * as reified from "../../../../_framework/reified";
|
|
|
11
11
|
import { decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, fieldToJSON, phantom, } from "../../../../_framework/reified";
|
|
12
12
|
import { composeSuiType, compressSuiType, } from "../../../../_framework/util";
|
|
13
13
|
import { PKG_V14 } 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
|
/* ============================== String =============================== */
|
|
17
17
|
export function isString(type) {
|
|
18
18
|
type = compressSuiType(type);
|
|
@@ -112,7 +112,7 @@ export class String {
|
|
|
112
112
|
if (data.bcs.dataType !== "moveObject" || !isString(data.bcs.type)) {
|
|
113
113
|
throw new Error(`object at is not a String object`);
|
|
114
114
|
}
|
|
115
|
-
return String.fromBcs(
|
|
115
|
+
return String.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
116
116
|
}
|
|
117
117
|
if (data.content) {
|
|
118
118
|
return String.fromSuiParsedData(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 "../ascii/structs";
|
|
4
4
|
import { PKG_V14 } from "../index";
|
|
5
|
-
import {
|
|
5
|
+
import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
|
|
6
6
|
export declare function isTypeName(type: string): boolean;
|
|
7
7
|
export interface TypeNameFields {
|
|
8
8
|
name: ToField<String>;
|
|
@@ -23,9 +23,9 @@ export declare class TypeName implements StructClass {
|
|
|
23
23
|
static get r(): import("../../../../_framework/reified").StructClassReified<TypeName, TypeNameFields>;
|
|
24
24
|
static phantom(): PhantomReified<ToTypeStr<TypeName>>;
|
|
25
25
|
static get p(): PhantomReified<"0x1::type_name::TypeName">;
|
|
26
|
-
static get bcs(): import("@mysten/
|
|
27
|
-
name: import("@mysten/
|
|
28
|
-
bytes: import("@mysten/
|
|
26
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
27
|
+
name: 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 TypeName implements StructClass {
|
|
|
45
45
|
static fromJSON(json: Record<string, any>): TypeName;
|
|
46
46
|
static fromSuiParsedData(content: SuiParsedData): TypeName;
|
|
47
47
|
static fromSuiObjectData(data: SuiObjectData): TypeName;
|
|
48
|
-
static fetch(client:
|
|
48
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<TypeName>;
|
|
49
49
|
}
|
|
@@ -11,8 +11,8 @@ import { decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, phant
|
|
|
11
11
|
import { composeSuiType, compressSuiType, } from "../../../../_framework/util";
|
|
12
12
|
import { String } from "../ascii/structs";
|
|
13
13
|
import { PKG_V14 } 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
|
/* ============================== TypeName =============================== */
|
|
17
17
|
export function isTypeName(type) {
|
|
18
18
|
type = compressSuiType(type);
|
|
@@ -112,7 +112,7 @@ export class TypeName {
|
|
|
112
112
|
if (data.bcs.dataType !== "moveObject" || !isTypeName(data.bcs.type)) {
|
|
113
113
|
throw new Error(`object at is not a TypeName object`);
|
|
114
114
|
}
|
|
115
|
-
return TypeName.fromBcs(
|
|
115
|
+
return TypeName.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
116
116
|
}
|
|
117
117
|
if (data.content) {
|
|
118
118
|
return TypeName.fromSuiParsedData(data.content);
|
|
@@ -2,7 +2,7 @@ import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../
|
|
|
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 isBag(type: string): boolean;
|
|
7
7
|
export interface BagFields {
|
|
8
8
|
id: ToField<UID>;
|
|
@@ -25,13 +25,13 @@ export declare class Bag implements StructClass {
|
|
|
25
25
|
static get r(): import("../../../../_framework/reified").StructClassReified<Bag, BagFields>;
|
|
26
26
|
static phantom(): PhantomReified<ToTypeStr<Bag>>;
|
|
27
27
|
static get p(): PhantomReified<"0x2::bag::Bag">;
|
|
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(fields: Record<string, any>): Bag;
|
|
37
37
|
static fromFieldsWithTypes(item: FieldsWithTypes): Bag;
|
|
@@ -50,5 +50,5 @@ export declare class Bag implements StructClass {
|
|
|
50
50
|
static fromJSON(json: Record<string, any>): Bag;
|
|
51
51
|
static fromSuiParsedData(content: SuiParsedData): Bag;
|
|
52
52
|
static fromSuiObjectData(data: SuiObjectData): Bag;
|
|
53
|
-
static fetch(client:
|
|
53
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<Bag>;
|
|
54
54
|
}
|
|
@@ -11,8 +11,8 @@ import { decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, phant
|
|
|
11
11
|
import { composeSuiType, compressSuiType, } 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
|
/* ============================== Bag =============================== */
|
|
17
17
|
export function isBag(type) {
|
|
18
18
|
type = compressSuiType(type);
|
|
@@ -118,7 +118,7 @@ export class Bag {
|
|
|
118
118
|
if (data.bcs.dataType !== "moveObject" || !isBag(data.bcs.type)) {
|
|
119
119
|
throw new Error(`object at is not a Bag object`);
|
|
120
120
|
}
|
|
121
|
-
return Bag.fromBcs(
|
|
121
|
+
return Bag.fromBcs(fromBase64(data.bcs.bcsBytes));
|
|
122
122
|
}
|
|
123
123
|
if (data.content) {
|
|
124
124
|
return Bag.fromSuiParsedData(data.content);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToPhantomTypeArgument, 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 isBalance(type: string): boolean;
|
|
6
6
|
export interface BalanceFields<T extends PhantomTypeArgument> {
|
|
7
7
|
value: ToField<"u64">;
|
|
@@ -22,8 +22,8 @@ export declare class Balance<T extends PhantomTypeArgument> implements StructCla
|
|
|
22
22
|
static get r(): typeof Balance.reified;
|
|
23
23
|
static phantom<T extends PhantomReified<PhantomTypeArgument>>(T: T): PhantomReified<ToTypeStr<Balance<ToPhantomTypeArgument<T>>>>;
|
|
24
24
|
static get p(): typeof Balance.phantom;
|
|
25
|
-
static get bcs(): import("@mysten/
|
|
26
|
-
value: import("@mysten/
|
|
25
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
26
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
27
27
|
}, string>;
|
|
28
28
|
static fromFields<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, fields: Record<string, any>): Balance<ToPhantomTypeArgument<T>>;
|
|
29
29
|
static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, item: FieldsWithTypes): Balance<ToPhantomTypeArgument<T>>;
|
|
@@ -40,7 +40,7 @@ export declare class Balance<T extends PhantomTypeArgument> implements StructCla
|
|
|
40
40
|
static fromJSON<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, json: Record<string, any>): Balance<ToPhantomTypeArgument<T>>;
|
|
41
41
|
static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, content: SuiParsedData): Balance<ToPhantomTypeArgument<T>>;
|
|
42
42
|
static fromSuiObjectData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: SuiObjectData): Balance<ToPhantomTypeArgument<T>>;
|
|
43
|
-
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client:
|
|
43
|
+
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArg: T, id: string): Promise<Balance<ToPhantomTypeArgument<T>>>;
|
|
44
44
|
}
|
|
45
45
|
export declare function isSupply(type: string): boolean;
|
|
46
46
|
export interface SupplyFields<T extends PhantomTypeArgument> {
|
|
@@ -62,8 +62,8 @@ export declare class Supply<T extends PhantomTypeArgument> implements StructClas
|
|
|
62
62
|
static get r(): typeof Supply.reified;
|
|
63
63
|
static phantom<T extends PhantomReified<PhantomTypeArgument>>(T: T): PhantomReified<ToTypeStr<Supply<ToPhantomTypeArgument<T>>>>;
|
|
64
64
|
static get p(): typeof Supply.phantom;
|
|
65
|
-
static get bcs(): import("@mysten/
|
|
66
|
-
value: import("@mysten/
|
|
65
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
66
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
67
67
|
}, string>;
|
|
68
68
|
static fromFields<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, fields: Record<string, any>): Supply<ToPhantomTypeArgument<T>>;
|
|
69
69
|
static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, item: FieldsWithTypes): Supply<ToPhantomTypeArgument<T>>;
|
|
@@ -80,5 +80,5 @@ export declare class Supply<T extends PhantomTypeArgument> implements StructClas
|
|
|
80
80
|
static fromJSON<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, json: Record<string, any>): Supply<ToPhantomTypeArgument<T>>;
|
|
81
81
|
static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, content: SuiParsedData): Supply<ToPhantomTypeArgument<T>>;
|
|
82
82
|
static fromSuiObjectData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: SuiObjectData): Supply<ToPhantomTypeArgument<T>>;
|
|
83
|
-
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client:
|
|
83
|
+
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArg: T, id: string): Promise<Supply<ToPhantomTypeArgument<T>>>;
|
|
84
84
|
}
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, extractType, phantom, } from "../../../../_framework/reified";
|
|
11
11
|
import { composeSuiType, compressSuiType, parseTypeName, } 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
|
/* ============================== Balance =============================== */
|
|
16
16
|
export function isBalance(type) {
|
|
17
17
|
type = compressSuiType(type);
|
|
@@ -122,7 +122,7 @@ export class Balance {
|
|
|
122
122
|
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
123
123
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
124
124
|
}
|
|
125
|
-
return Balance.fromBcs(typeArg,
|
|
125
|
+
return Balance.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
126
126
|
}
|
|
127
127
|
if (data.content) {
|
|
128
128
|
return Balance.fromSuiParsedData(typeArg, data.content);
|
|
@@ -257,7 +257,7 @@ export class Supply {
|
|
|
257
257
|
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
258
258
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
259
259
|
}
|
|
260
|
-
return Supply.fromBcs(typeArg,
|
|
260
|
+
return Supply.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
261
261
|
}
|
|
262
262
|
if (data.content) {
|
|
263
263
|
return Supply.fromSuiParsedData(typeArg, data.content);
|
|
@@ -7,7 +7,7 @@ import { Balance, Supply } from "../balance/structs";
|
|
|
7
7
|
import { PKG_V31 } from "../index";
|
|
8
8
|
import { ID, UID } from "../object/structs";
|
|
9
9
|
import { Url } from "../url/structs";
|
|
10
|
-
import {
|
|
10
|
+
import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
|
|
11
11
|
export declare function isCoin(type: string): boolean;
|
|
12
12
|
export interface CoinFields<T extends PhantomTypeArgument> {
|
|
13
13
|
id: ToField<UID>;
|
|
@@ -30,14 +30,14 @@ export declare class Coin<T extends PhantomTypeArgument> implements StructClass
|
|
|
30
30
|
static get r(): typeof Coin.reified;
|
|
31
31
|
static phantom<T extends PhantomReified<PhantomTypeArgument>>(T: T): PhantomReified<ToTypeStr<Coin<ToPhantomTypeArgument<T>>>>;
|
|
32
32
|
static get p(): typeof Coin.phantom;
|
|
33
|
-
static get bcs(): import("@mysten/
|
|
34
|
-
id: import("@mysten/
|
|
35
|
-
id: import("@mysten/
|
|
36
|
-
bytes: import("@mysten/
|
|
33
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
34
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
35
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
36
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
37
37
|
}, string>;
|
|
38
38
|
}, string>;
|
|
39
|
-
balance: import("@mysten/
|
|
40
|
-
value: import("@mysten/
|
|
39
|
+
balance: import("@mysten/bcs").BcsStruct<{
|
|
40
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
41
41
|
}, string>;
|
|
42
42
|
}, string>;
|
|
43
43
|
static fromFields<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, fields: Record<string, any>): Coin<ToPhantomTypeArgument<T>>;
|
|
@@ -61,7 +61,7 @@ export declare class Coin<T extends PhantomTypeArgument> implements StructClass
|
|
|
61
61
|
static fromJSON<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, json: Record<string, any>): Coin<ToPhantomTypeArgument<T>>;
|
|
62
62
|
static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, content: SuiParsedData): Coin<ToPhantomTypeArgument<T>>;
|
|
63
63
|
static fromSuiObjectData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: SuiObjectData): Coin<ToPhantomTypeArgument<T>>;
|
|
64
|
-
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client:
|
|
64
|
+
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArg: T, id: string): Promise<Coin<ToPhantomTypeArgument<T>>>;
|
|
65
65
|
}
|
|
66
66
|
export declare function isCoinMetadata(type: string): boolean;
|
|
67
67
|
export interface CoinMetadataFields<T extends PhantomTypeArgument> {
|
|
@@ -93,29 +93,43 @@ export declare class CoinMetadata<T extends PhantomTypeArgument> implements Stru
|
|
|
93
93
|
static get r(): typeof CoinMetadata.reified;
|
|
94
94
|
static phantom<T extends PhantomReified<PhantomTypeArgument>>(T: T): PhantomReified<ToTypeStr<CoinMetadata<ToPhantomTypeArgument<T>>>>;
|
|
95
95
|
static get p(): typeof CoinMetadata.phantom;
|
|
96
|
-
static get bcs(): import("@mysten/
|
|
97
|
-
id: import("@mysten/
|
|
98
|
-
id: import("@mysten/
|
|
99
|
-
bytes: import("@mysten/
|
|
96
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
97
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
98
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
99
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
100
100
|
}, string>;
|
|
101
101
|
}, string>;
|
|
102
|
-
decimals: import("@mysten/
|
|
103
|
-
name: import("@mysten/
|
|
104
|
-
bytes: import("@mysten/
|
|
102
|
+
decimals: import("@mysten/bcs").BcsType<number, number, "u8">;
|
|
103
|
+
name: import("@mysten/bcs").BcsStruct<{
|
|
104
|
+
bytes: import("@mysten/bcs").BcsType<number[], Iterable<number> & {
|
|
105
105
|
length: number;
|
|
106
106
|
}, string>;
|
|
107
107
|
}, string>;
|
|
108
|
-
symbol: import("@mysten/
|
|
109
|
-
bytes: import("@mysten/
|
|
108
|
+
symbol: import("@mysten/bcs").BcsStruct<{
|
|
109
|
+
bytes: import("@mysten/bcs").BcsType<number[], Iterable<number> & {
|
|
110
110
|
length: number;
|
|
111
111
|
}, string>;
|
|
112
112
|
}, string>;
|
|
113
|
-
description: import("@mysten/
|
|
114
|
-
bytes: import("@mysten/
|
|
113
|
+
description: import("@mysten/bcs").BcsStruct<{
|
|
114
|
+
bytes: import("@mysten/bcs").BcsType<number[], Iterable<number> & {
|
|
115
|
+
length: number;
|
|
116
|
+
}, string>;
|
|
117
|
+
}, string>;
|
|
118
|
+
icon_url: import("@mysten/bcs").BcsStruct<{
|
|
119
|
+
vec: import("@mysten/bcs").BcsType<{
|
|
120
|
+
url: {
|
|
121
|
+
bytes: number[];
|
|
122
|
+
};
|
|
123
|
+
}[], Iterable<{
|
|
124
|
+
url: {
|
|
125
|
+
bytes: Iterable<number> & {
|
|
126
|
+
length: number;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
}> & {
|
|
115
130
|
length: number;
|
|
116
131
|
}, string>;
|
|
117
132
|
}, string>;
|
|
118
|
-
icon_url: any;
|
|
119
133
|
}, string>;
|
|
120
134
|
static fromFields<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, fields: Record<string, any>): CoinMetadata<ToPhantomTypeArgument<T>>;
|
|
121
135
|
static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, item: FieldsWithTypes): CoinMetadata<ToPhantomTypeArgument<T>>;
|
|
@@ -142,7 +156,7 @@ export declare class CoinMetadata<T extends PhantomTypeArgument> implements Stru
|
|
|
142
156
|
static fromJSON<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, json: Record<string, any>): CoinMetadata<ToPhantomTypeArgument<T>>;
|
|
143
157
|
static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, content: SuiParsedData): CoinMetadata<ToPhantomTypeArgument<T>>;
|
|
144
158
|
static fromSuiObjectData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: SuiObjectData): CoinMetadata<ToPhantomTypeArgument<T>>;
|
|
145
|
-
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client:
|
|
159
|
+
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArg: T, id: string): Promise<CoinMetadata<ToPhantomTypeArgument<T>>>;
|
|
146
160
|
}
|
|
147
161
|
export declare function isCurrencyCreated(type: string): boolean;
|
|
148
162
|
export interface CurrencyCreatedFields<T extends PhantomTypeArgument> {
|
|
@@ -164,8 +178,8 @@ export declare class CurrencyCreated<T extends PhantomTypeArgument> implements S
|
|
|
164
178
|
static get r(): typeof CurrencyCreated.reified;
|
|
165
179
|
static phantom<T extends PhantomReified<PhantomTypeArgument>>(T: T): PhantomReified<ToTypeStr<CurrencyCreated<ToPhantomTypeArgument<T>>>>;
|
|
166
180
|
static get p(): typeof CurrencyCreated.phantom;
|
|
167
|
-
static get bcs(): import("@mysten/
|
|
168
|
-
decimals: import("@mysten/
|
|
181
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
182
|
+
decimals: import("@mysten/bcs").BcsType<number, number, "u8">;
|
|
169
183
|
}, string>;
|
|
170
184
|
static fromFields<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, fields: Record<string, any>): CurrencyCreated<ToPhantomTypeArgument<T>>;
|
|
171
185
|
static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, item: FieldsWithTypes): CurrencyCreated<ToPhantomTypeArgument<T>>;
|
|
@@ -182,7 +196,7 @@ export declare class CurrencyCreated<T extends PhantomTypeArgument> implements S
|
|
|
182
196
|
static fromJSON<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, json: Record<string, any>): CurrencyCreated<ToPhantomTypeArgument<T>>;
|
|
183
197
|
static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, content: SuiParsedData): CurrencyCreated<ToPhantomTypeArgument<T>>;
|
|
184
198
|
static fromSuiObjectData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: SuiObjectData): CurrencyCreated<ToPhantomTypeArgument<T>>;
|
|
185
|
-
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client:
|
|
199
|
+
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArg: T, id: string): Promise<CurrencyCreated<ToPhantomTypeArgument<T>>>;
|
|
186
200
|
}
|
|
187
201
|
export declare function isDenyCap(type: string): boolean;
|
|
188
202
|
export interface DenyCapFields<T extends PhantomTypeArgument> {
|
|
@@ -204,10 +218,10 @@ export declare class DenyCap<T extends PhantomTypeArgument> implements StructCla
|
|
|
204
218
|
static get r(): typeof DenyCap.reified;
|
|
205
219
|
static phantom<T extends PhantomReified<PhantomTypeArgument>>(T: T): PhantomReified<ToTypeStr<DenyCap<ToPhantomTypeArgument<T>>>>;
|
|
206
220
|
static get p(): typeof DenyCap.phantom;
|
|
207
|
-
static get bcs(): import("@mysten/
|
|
208
|
-
id: import("@mysten/
|
|
209
|
-
id: import("@mysten/
|
|
210
|
-
bytes: import("@mysten/
|
|
221
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
222
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
223
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
224
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
211
225
|
}, string>;
|
|
212
226
|
}, string>;
|
|
213
227
|
}, string>;
|
|
@@ -226,7 +240,7 @@ export declare class DenyCap<T extends PhantomTypeArgument> implements StructCla
|
|
|
226
240
|
static fromJSON<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, json: Record<string, any>): DenyCap<ToPhantomTypeArgument<T>>;
|
|
227
241
|
static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, content: SuiParsedData): DenyCap<ToPhantomTypeArgument<T>>;
|
|
228
242
|
static fromSuiObjectData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: SuiObjectData): DenyCap<ToPhantomTypeArgument<T>>;
|
|
229
|
-
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client:
|
|
243
|
+
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArg: T, id: string): Promise<DenyCap<ToPhantomTypeArgument<T>>>;
|
|
230
244
|
}
|
|
231
245
|
export declare function isDenyCapV2(type: string): boolean;
|
|
232
246
|
export interface DenyCapV2Fields<T extends PhantomTypeArgument> {
|
|
@@ -250,13 +264,13 @@ export declare class DenyCapV2<T extends PhantomTypeArgument> implements StructC
|
|
|
250
264
|
static get r(): typeof DenyCapV2.reified;
|
|
251
265
|
static phantom<T extends PhantomReified<PhantomTypeArgument>>(T: T): PhantomReified<ToTypeStr<DenyCapV2<ToPhantomTypeArgument<T>>>>;
|
|
252
266
|
static get p(): typeof DenyCapV2.phantom;
|
|
253
|
-
static get bcs(): import("@mysten/
|
|
254
|
-
id: import("@mysten/
|
|
255
|
-
id: import("@mysten/
|
|
256
|
-
bytes: import("@mysten/
|
|
267
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
268
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
269
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
270
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
257
271
|
}, string>;
|
|
258
272
|
}, string>;
|
|
259
|
-
allow_global_pause: import("@mysten/
|
|
273
|
+
allow_global_pause: import("@mysten/bcs").BcsType<boolean, boolean, "bool">;
|
|
260
274
|
}, string>;
|
|
261
275
|
static fromFields<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, fields: Record<string, any>): DenyCapV2<ToPhantomTypeArgument<T>>;
|
|
262
276
|
static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, item: FieldsWithTypes): DenyCapV2<ToPhantomTypeArgument<T>>;
|
|
@@ -275,7 +289,7 @@ export declare class DenyCapV2<T extends PhantomTypeArgument> implements StructC
|
|
|
275
289
|
static fromJSON<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, json: Record<string, any>): DenyCapV2<ToPhantomTypeArgument<T>>;
|
|
276
290
|
static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, content: SuiParsedData): DenyCapV2<ToPhantomTypeArgument<T>>;
|
|
277
291
|
static fromSuiObjectData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: SuiObjectData): DenyCapV2<ToPhantomTypeArgument<T>>;
|
|
278
|
-
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client:
|
|
292
|
+
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArg: T, id: string): Promise<DenyCapV2<ToPhantomTypeArgument<T>>>;
|
|
279
293
|
}
|
|
280
294
|
export declare function isRegulatedCoinMetadata(type: string): boolean;
|
|
281
295
|
export interface RegulatedCoinMetadataFields<T extends PhantomTypeArgument> {
|
|
@@ -301,17 +315,17 @@ export declare class RegulatedCoinMetadata<T extends PhantomTypeArgument> implem
|
|
|
301
315
|
static get r(): typeof RegulatedCoinMetadata.reified;
|
|
302
316
|
static phantom<T extends PhantomReified<PhantomTypeArgument>>(T: T): PhantomReified<ToTypeStr<RegulatedCoinMetadata<ToPhantomTypeArgument<T>>>>;
|
|
303
317
|
static get p(): typeof RegulatedCoinMetadata.phantom;
|
|
304
|
-
static get bcs(): import("@mysten/
|
|
305
|
-
id: import("@mysten/
|
|
306
|
-
id: import("@mysten/
|
|
307
|
-
bytes: import("@mysten/
|
|
318
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
319
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
320
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
321
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
308
322
|
}, string>;
|
|
309
323
|
}, string>;
|
|
310
|
-
coin_metadata_object: import("@mysten/
|
|
311
|
-
bytes: import("@mysten/
|
|
324
|
+
coin_metadata_object: import("@mysten/bcs").BcsStruct<{
|
|
325
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
312
326
|
}, string>;
|
|
313
|
-
deny_cap_object: import("@mysten/
|
|
314
|
-
bytes: import("@mysten/
|
|
327
|
+
deny_cap_object: import("@mysten/bcs").BcsStruct<{
|
|
328
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
315
329
|
}, string>;
|
|
316
330
|
}, string>;
|
|
317
331
|
static fromFields<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, fields: Record<string, any>): RegulatedCoinMetadata<ToPhantomTypeArgument<T>>;
|
|
@@ -333,7 +347,7 @@ export declare class RegulatedCoinMetadata<T extends PhantomTypeArgument> implem
|
|
|
333
347
|
static fromJSON<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, json: Record<string, any>): RegulatedCoinMetadata<ToPhantomTypeArgument<T>>;
|
|
334
348
|
static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, content: SuiParsedData): RegulatedCoinMetadata<ToPhantomTypeArgument<T>>;
|
|
335
349
|
static fromSuiObjectData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: SuiObjectData): RegulatedCoinMetadata<ToPhantomTypeArgument<T>>;
|
|
336
|
-
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client:
|
|
350
|
+
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArg: T, id: string): Promise<RegulatedCoinMetadata<ToPhantomTypeArgument<T>>>;
|
|
337
351
|
}
|
|
338
352
|
export declare function isTreasuryCap(type: string): boolean;
|
|
339
353
|
export interface TreasuryCapFields<T extends PhantomTypeArgument> {
|
|
@@ -357,14 +371,14 @@ export declare class TreasuryCap<T extends PhantomTypeArgument> implements Struc
|
|
|
357
371
|
static get r(): typeof TreasuryCap.reified;
|
|
358
372
|
static phantom<T extends PhantomReified<PhantomTypeArgument>>(T: T): PhantomReified<ToTypeStr<TreasuryCap<ToPhantomTypeArgument<T>>>>;
|
|
359
373
|
static get p(): typeof TreasuryCap.phantom;
|
|
360
|
-
static get bcs(): import("@mysten/
|
|
361
|
-
id: import("@mysten/
|
|
362
|
-
id: import("@mysten/
|
|
363
|
-
bytes: import("@mysten/
|
|
374
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
375
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
376
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
377
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
364
378
|
}, string>;
|
|
365
379
|
}, string>;
|
|
366
|
-
total_supply: import("@mysten/
|
|
367
|
-
value: import("@mysten/
|
|
380
|
+
total_supply: import("@mysten/bcs").BcsStruct<{
|
|
381
|
+
value: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
368
382
|
}, string>;
|
|
369
383
|
}, string>;
|
|
370
384
|
static fromFields<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, fields: Record<string, any>): TreasuryCap<ToPhantomTypeArgument<T>>;
|
|
@@ -388,5 +402,5 @@ export declare class TreasuryCap<T extends PhantomTypeArgument> implements Struc
|
|
|
388
402
|
static fromJSON<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, json: Record<string, any>): TreasuryCap<ToPhantomTypeArgument<T>>;
|
|
389
403
|
static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, content: SuiParsedData): TreasuryCap<ToPhantomTypeArgument<T>>;
|
|
390
404
|
static fromSuiObjectData<T extends PhantomReified<PhantomTypeArgument>>(typeArg: T, data: SuiObjectData): TreasuryCap<ToPhantomTypeArgument<T>>;
|
|
391
|
-
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client:
|
|
405
|
+
static fetch<T extends PhantomReified<PhantomTypeArgument>>(client: SuiJsonRpcClient, typeArg: T, id: string): Promise<TreasuryCap<ToPhantomTypeArgument<T>>>;
|
|
392
406
|
}
|
|
@@ -16,8 +16,8 @@ import { Balance, Supply } from "../balance/structs";
|
|
|
16
16
|
import { PKG_V31 } from "../index";
|
|
17
17
|
import { ID, UID } from "../object/structs";
|
|
18
18
|
import { Url } from "../url/structs";
|
|
19
|
-
import { bcs } from "@mysten/sui
|
|
20
|
-
import {
|
|
19
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
20
|
+
import { fromBase64 } from "@mysten/sui/utils";
|
|
21
21
|
/* ============================== Coin =============================== */
|
|
22
22
|
export function isCoin(type) {
|
|
23
23
|
type = compressSuiType(type);
|
|
@@ -134,7 +134,7 @@ export class Coin {
|
|
|
134
134
|
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
135
135
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
136
136
|
}
|
|
137
|
-
return Coin.fromBcs(typeArg,
|
|
137
|
+
return Coin.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
138
138
|
}
|
|
139
139
|
if (data.content) {
|
|
140
140
|
return Coin.fromSuiParsedData(typeArg, data.content);
|
|
@@ -300,7 +300,7 @@ export class CoinMetadata {
|
|
|
300
300
|
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
301
301
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
302
302
|
}
|
|
303
|
-
return CoinMetadata.fromBcs(typeArg,
|
|
303
|
+
return CoinMetadata.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
304
304
|
}
|
|
305
305
|
if (data.content) {
|
|
306
306
|
return CoinMetadata.fromSuiParsedData(typeArg, data.content);
|
|
@@ -436,7 +436,7 @@ export class CurrencyCreated {
|
|
|
436
436
|
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
437
437
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
438
438
|
}
|
|
439
|
-
return CurrencyCreated.fromBcs(typeArg,
|
|
439
|
+
return CurrencyCreated.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
440
440
|
}
|
|
441
441
|
if (data.content) {
|
|
442
442
|
return CurrencyCreated.fromSuiParsedData(typeArg, data.content);
|
|
@@ -571,7 +571,7 @@ export class DenyCap {
|
|
|
571
571
|
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
572
572
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
573
573
|
}
|
|
574
|
-
return DenyCap.fromBcs(typeArg,
|
|
574
|
+
return DenyCap.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
575
575
|
}
|
|
576
576
|
if (data.content) {
|
|
577
577
|
return DenyCap.fromSuiParsedData(typeArg, data.content);
|
|
@@ -712,7 +712,7 @@ export class DenyCapV2 {
|
|
|
712
712
|
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
713
713
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
714
714
|
}
|
|
715
|
-
return DenyCapV2.fromBcs(typeArg,
|
|
715
|
+
return DenyCapV2.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
716
716
|
}
|
|
717
717
|
if (data.content) {
|
|
718
718
|
return DenyCapV2.fromSuiParsedData(typeArg, data.content);
|
|
@@ -860,7 +860,7 @@ export class RegulatedCoinMetadata {
|
|
|
860
860
|
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
861
861
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
862
862
|
}
|
|
863
|
-
return RegulatedCoinMetadata.fromBcs(typeArg,
|
|
863
|
+
return RegulatedCoinMetadata.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
864
864
|
}
|
|
865
865
|
if (data.content) {
|
|
866
866
|
return RegulatedCoinMetadata.fromSuiParsedData(typeArg, data.content);
|
|
@@ -1001,7 +1001,7 @@ export class TreasuryCap {
|
|
|
1001
1001
|
if (gotTypeArg !== compressSuiType(extractType(typeArg))) {
|
|
1002
1002
|
throw new Error(`type argument mismatch: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
|
|
1003
1003
|
}
|
|
1004
|
-
return TreasuryCap.fromBcs(typeArg,
|
|
1004
|
+
return TreasuryCap.fromBcs(typeArg, fromBase64(data.bcs.bcsBytes));
|
|
1005
1005
|
}
|
|
1006
1006
|
if (data.content) {
|
|
1007
1007
|
return TreasuryCap.fromSuiParsedData(typeArg, 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 isID(type: string): boolean;
|
|
6
6
|
export interface IDFields {
|
|
7
7
|
bytes: ToField<"address">;
|
|
@@ -22,8 +22,8 @@ export declare class ID implements StructClass {
|
|
|
22
22
|
static get r(): import("../../../../_framework/reified").StructClassReified<ID, IDFields>;
|
|
23
23
|
static phantom(): PhantomReified<ToTypeStr<ID>>;
|
|
24
24
|
static get p(): PhantomReified<"0x2::object::ID">;
|
|
25
|
-
static get bcs(): import("@mysten/
|
|
26
|
-
bytes: import("@mysten/
|
|
25
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
26
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
27
27
|
}, string>;
|
|
28
28
|
static fromFields(fields: Record<string, any>): ID;
|
|
29
29
|
static fromFieldsWithTypes(item: FieldsWithTypes): ID;
|
|
@@ -40,7 +40,7 @@ export declare class ID implements StructClass {
|
|
|
40
40
|
static fromJSON(json: Record<string, any>): ID;
|
|
41
41
|
static fromSuiParsedData(content: SuiParsedData): ID;
|
|
42
42
|
static fromSuiObjectData(data: SuiObjectData): ID;
|
|
43
|
-
static fetch(client:
|
|
43
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<ID>;
|
|
44
44
|
}
|
|
45
45
|
export declare function isUID(type: string): boolean;
|
|
46
46
|
export interface UIDFields {
|
|
@@ -62,9 +62,9 @@ export declare class UID implements StructClass {
|
|
|
62
62
|
static get r(): import("../../../../_framework/reified").StructClassReified<UID, UIDFields>;
|
|
63
63
|
static phantom(): PhantomReified<ToTypeStr<UID>>;
|
|
64
64
|
static get p(): PhantomReified<"0x2::object::UID">;
|
|
65
|
-
static get bcs(): import("@mysten/
|
|
66
|
-
id: import("@mysten/
|
|
67
|
-
bytes: import("@mysten/
|
|
65
|
+
static get bcs(): import("@mysten/bcs").BcsStruct<{
|
|
66
|
+
id: import("@mysten/bcs").BcsStruct<{
|
|
67
|
+
bytes: import("@mysten/bcs").BcsType<string, string, string>;
|
|
68
68
|
}, string>;
|
|
69
69
|
}, string>;
|
|
70
70
|
static fromFields(fields: Record<string, any>): UID;
|
|
@@ -82,5 +82,5 @@ export declare class UID implements StructClass {
|
|
|
82
82
|
static fromJSON(json: Record<string, any>): UID;
|
|
83
83
|
static fromSuiParsedData(content: SuiParsedData): UID;
|
|
84
84
|
static fromSuiObjectData(data: SuiObjectData): UID;
|
|
85
|
-
static fetch(client:
|
|
85
|
+
static fetch(client: SuiJsonRpcClient, id: string): Promise<UID>;
|
|
86
86
|
}
|