@suilend/sdk 1.1.21 → 1.1.22
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/_generated/_dependencies/source/0x1/ascii/structs.js +3 -3
- package/_generated/_dependencies/source/0x1/option/structs.d.ts +1 -1
- package/_generated/_dependencies/source/0x1/option/structs.js +2 -2
- package/_generated/_dependencies/source/0x1/type-name/structs.js +2 -2
- package/_generated/_dependencies/source/0x2/bag/structs.js +2 -2
- package/_generated/_dependencies/source/0x2/balance/structs.js +3 -3
- package/_generated/_dependencies/source/0x2/object/structs.js +3 -3
- package/_generated/_dependencies/source/0x2/object-table/structs.js +2 -2
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.js +2 -2
- package/_generated/_framework/reified.js +10 -10
- package/_generated/_framework/util.d.ts +5 -11
- package/_generated/_framework/util.js +12 -13
- package/_generated/_framework/vector.d.ts +1 -1
- package/_generated/_framework/vector.js +2 -2
- package/_generated/suilend/cell/structs.d.ts +1 -1
- package/_generated/suilend/cell/structs.js +2 -2
- package/_generated/suilend/decimal/structs.js +2 -2
- package/_generated/suilend/index.js +2 -2
- package/_generated/suilend/lending-market/functions.js +40 -41
- package/_generated/suilend/lending-market/structs.js +15 -15
- package/_generated/suilend/lending-market-registry/functions.js +2 -3
- package/_generated/suilend/liquidity-mining/structs.js +6 -6
- package/_generated/suilend/obligation/structs.js +7 -7
- package/_generated/suilend/rate-limiter/functions.js +6 -7
- package/_generated/suilend/rate-limiter/structs.js +3 -3
- package/_generated/suilend/reserve/structs.js +10 -10
- package/_generated/suilend/reserve-config/functions.js +39 -40
- package/_generated/suilend/reserve-config/structs.js +3 -3
- package/package.json +1 -1
- package/parsers/lendingMarket.d.ts +2 -2
- package/parsers/obligation.d.ts +4 -4
- package/parsers/reserve.d.ts +2 -2
- package/utils/events.js +3 -3
- package/utils/index.js +10 -2
- package/utils/obligation.js +5 -6
|
@@ -32,7 +32,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.String = exports.
|
|
35
|
+
exports.String = exports.Char = void 0;
|
|
36
|
+
exports.isChar = isChar;
|
|
37
|
+
exports.isString = isString;
|
|
36
38
|
const reified = __importStar(require("../../../../_framework/reified"));
|
|
37
39
|
const reified_1 = require("../../../../_framework/reified");
|
|
38
40
|
const util_1 = require("../../../../_framework/util");
|
|
@@ -44,7 +46,6 @@ function isChar(type) {
|
|
|
44
46
|
type = (0, util_1.compressSuiType)(type);
|
|
45
47
|
return type === `${index_1.PKG_V11}::ascii::Char`;
|
|
46
48
|
}
|
|
47
|
-
exports.isChar = isChar;
|
|
48
49
|
class Char {
|
|
49
50
|
constructor(typeArgs, fields) {
|
|
50
51
|
this.__StructClass = true;
|
|
@@ -166,7 +167,6 @@ function isString(type) {
|
|
|
166
167
|
type = (0, util_1.compressSuiType)(type);
|
|
167
168
|
return type === `${index_1.PKG_V11}::ascii::String`;
|
|
168
169
|
}
|
|
169
|
-
exports.isString = isString;
|
|
170
170
|
class String {
|
|
171
171
|
constructor(typeArgs, fields) {
|
|
172
172
|
this.__StructClass = true;
|
|
@@ -26,7 +26,7 @@ export declare class Option<Element extends TypeArgument> implements StructClass
|
|
|
26
26
|
static get r(): typeof Option.reified;
|
|
27
27
|
static phantom<Element extends Reified<TypeArgument, any>>(Element: Element): PhantomReified<ToTypeStr<Option<ToTypeArgument<Element>>>>;
|
|
28
28
|
static get p(): typeof Option.phantom;
|
|
29
|
-
static get bcs(): <Element extends BcsType<any
|
|
29
|
+
static get bcs(): <Element extends BcsType<any>>(Element: Element) => BcsType<{
|
|
30
30
|
vec: any[];
|
|
31
31
|
}, {
|
|
32
32
|
vec: Iterable<any> & {
|
|
@@ -32,7 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.Option =
|
|
35
|
+
exports.Option = void 0;
|
|
36
|
+
exports.isOption = isOption;
|
|
36
37
|
const reified = __importStar(require("../../../../_framework/reified"));
|
|
37
38
|
const reified_1 = require("../../../../_framework/reified");
|
|
38
39
|
const util_1 = require("../../../../_framework/util");
|
|
@@ -44,7 +45,6 @@ function isOption(type) {
|
|
|
44
45
|
type = (0, util_1.compressSuiType)(type);
|
|
45
46
|
return type.startsWith(`${index_1.PKG_V11}::option::Option` + "<");
|
|
46
47
|
}
|
|
47
|
-
exports.isOption = isOption;
|
|
48
48
|
class Option {
|
|
49
49
|
constructor(typeArgs, fields) {
|
|
50
50
|
this.__StructClass = true;
|
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.TypeName =
|
|
12
|
+
exports.TypeName = void 0;
|
|
13
|
+
exports.isTypeName = isTypeName;
|
|
13
14
|
const reified_1 = require("../../../../_framework/reified");
|
|
14
15
|
const util_1 = require("../../../../_framework/util");
|
|
15
16
|
const structs_1 = require("../ascii/structs");
|
|
@@ -21,7 +22,6 @@ function isTypeName(type) {
|
|
|
21
22
|
type = (0, util_1.compressSuiType)(type);
|
|
22
23
|
return type === `${index_1.PKG_V11}::type_name::TypeName`;
|
|
23
24
|
}
|
|
24
|
-
exports.isTypeName = isTypeName;
|
|
25
25
|
class TypeName {
|
|
26
26
|
constructor(typeArgs, fields) {
|
|
27
27
|
this.__StructClass = true;
|
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Bag =
|
|
12
|
+
exports.Bag = void 0;
|
|
13
|
+
exports.isBag = isBag;
|
|
13
14
|
const reified_1 = require("../../../../_framework/reified");
|
|
14
15
|
const util_1 = require("../../../../_framework/util");
|
|
15
16
|
const index_1 = require("../index");
|
|
@@ -21,7 +22,6 @@ function isBag(type) {
|
|
|
21
22
|
type = (0, util_1.compressSuiType)(type);
|
|
22
23
|
return type === `${index_1.PKG_V28}::bag::Bag`;
|
|
23
24
|
}
|
|
24
|
-
exports.isBag = isBag;
|
|
25
25
|
class Bag {
|
|
26
26
|
constructor(typeArgs, fields) {
|
|
27
27
|
this.__StructClass = true;
|
|
@@ -9,7 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Supply = exports.
|
|
12
|
+
exports.Supply = exports.Balance = void 0;
|
|
13
|
+
exports.isBalance = isBalance;
|
|
14
|
+
exports.isSupply = isSupply;
|
|
13
15
|
const reified_1 = require("../../../../_framework/reified");
|
|
14
16
|
const util_1 = require("../../../../_framework/util");
|
|
15
17
|
const index_1 = require("../index");
|
|
@@ -20,7 +22,6 @@ function isBalance(type) {
|
|
|
20
22
|
type = (0, util_1.compressSuiType)(type);
|
|
21
23
|
return type.startsWith(`${index_1.PKG_V28}::balance::Balance` + "<");
|
|
22
24
|
}
|
|
23
|
-
exports.isBalance = isBalance;
|
|
24
25
|
class Balance {
|
|
25
26
|
constructor(typeArgs, fields) {
|
|
26
27
|
this.__StructClass = true;
|
|
@@ -157,7 +158,6 @@ function isSupply(type) {
|
|
|
157
158
|
type = (0, util_1.compressSuiType)(type);
|
|
158
159
|
return type.startsWith(`${index_1.PKG_V28}::balance::Supply` + "<");
|
|
159
160
|
}
|
|
160
|
-
exports.isSupply = isSupply;
|
|
161
161
|
class Supply {
|
|
162
162
|
constructor(typeArgs, fields) {
|
|
163
163
|
this.__StructClass = true;
|
|
@@ -9,7 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UID = exports.
|
|
12
|
+
exports.UID = exports.ID = void 0;
|
|
13
|
+
exports.isID = isID;
|
|
14
|
+
exports.isUID = isUID;
|
|
13
15
|
const reified_1 = require("../../../../_framework/reified");
|
|
14
16
|
const util_1 = require("../../../../_framework/util");
|
|
15
17
|
const index_1 = require("../index");
|
|
@@ -20,7 +22,6 @@ function isID(type) {
|
|
|
20
22
|
type = (0, util_1.compressSuiType)(type);
|
|
21
23
|
return type === `${index_1.PKG_V28}::object::ID`;
|
|
22
24
|
}
|
|
23
|
-
exports.isID = isID;
|
|
24
25
|
class ID {
|
|
25
26
|
constructor(typeArgs, fields) {
|
|
26
27
|
this.__StructClass = true;
|
|
@@ -150,7 +151,6 @@ function isUID(type) {
|
|
|
150
151
|
type = (0, util_1.compressSuiType)(type);
|
|
151
152
|
return type === `${index_1.PKG_V28}::object::UID`;
|
|
152
153
|
}
|
|
153
|
-
exports.isUID = isUID;
|
|
154
154
|
class UID {
|
|
155
155
|
constructor(typeArgs, fields) {
|
|
156
156
|
this.__StructClass = true;
|
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ObjectTable =
|
|
12
|
+
exports.ObjectTable = void 0;
|
|
13
|
+
exports.isObjectTable = isObjectTable;
|
|
13
14
|
const reified_1 = require("../../../../_framework/reified");
|
|
14
15
|
const util_1 = require("../../../../_framework/util");
|
|
15
16
|
const index_1 = require("../index");
|
|
@@ -21,7 +22,6 @@ function isObjectTable(type) {
|
|
|
21
22
|
type = (0, util_1.compressSuiType)(type);
|
|
22
23
|
return type.startsWith(`${index_1.PKG_V28}::object_table::ObjectTable` + "<");
|
|
23
24
|
}
|
|
24
|
-
exports.isObjectTable = isObjectTable;
|
|
25
25
|
class ObjectTable {
|
|
26
26
|
constructor(typeArgs, fields) {
|
|
27
27
|
this.__StructClass = true;
|
|
@@ -32,7 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.PriceIdentifier =
|
|
35
|
+
exports.PriceIdentifier = void 0;
|
|
36
|
+
exports.isPriceIdentifier = isPriceIdentifier;
|
|
36
37
|
const reified = __importStar(require("../../../../_framework/reified"));
|
|
37
38
|
const reified_1 = require("../../../../_framework/reified");
|
|
38
39
|
const util_1 = require("../../../../_framework/util");
|
|
@@ -44,7 +45,6 @@ function isPriceIdentifier(type) {
|
|
|
44
45
|
type = (0, util_1.compressSuiType)(type);
|
|
45
46
|
return type === `${index_1.PKG_V1}::price_identifier::PriceIdentifier`;
|
|
46
47
|
}
|
|
47
|
-
exports.isPriceIdentifier = isPriceIdentifier;
|
|
48
48
|
class PriceIdentifier {
|
|
49
49
|
constructor(typeArgs, fields) {
|
|
50
50
|
this.__StructClass = true;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.vector = void 0;
|
|
4
|
+
exports.phantom = phantom;
|
|
5
|
+
exports.toBcs = toBcs;
|
|
6
|
+
exports.extractType = extractType;
|
|
7
|
+
exports.decodeFromFields = decodeFromFields;
|
|
8
|
+
exports.decodeFromFieldsWithTypes = decodeFromFieldsWithTypes;
|
|
9
|
+
exports.assertReifiedTypeArgsMatch = assertReifiedTypeArgsMatch;
|
|
10
|
+
exports.assertFieldsWithTypesArgsMatch = assertFieldsWithTypesArgsMatch;
|
|
11
|
+
exports.fieldToJSON = fieldToJSON;
|
|
12
|
+
exports.decodeFromJSONField = decodeFromJSONField;
|
|
4
13
|
const bcs_1 = require("@mysten/sui/bcs");
|
|
5
14
|
const utils_1 = require("@mysten/sui/utils");
|
|
6
15
|
const util_1 = require("./util");
|
|
@@ -21,7 +30,6 @@ function phantom(type) {
|
|
|
21
30
|
};
|
|
22
31
|
}
|
|
23
32
|
}
|
|
24
|
-
exports.phantom = phantom;
|
|
25
33
|
const Address = bcs_1.bcs.bytes(32).transform({
|
|
26
34
|
input: (val) => (0, utils_1.fromHEX)(val),
|
|
27
35
|
output: (val) => (0, utils_1.toHEX)(val),
|
|
@@ -48,7 +56,6 @@ function toBcs(arg) {
|
|
|
48
56
|
return arg.bcs;
|
|
49
57
|
}
|
|
50
58
|
}
|
|
51
|
-
exports.toBcs = toBcs;
|
|
52
59
|
function extractType(reified) {
|
|
53
60
|
switch (reified) {
|
|
54
61
|
case "u8":
|
|
@@ -71,7 +78,6 @@ function extractType(reified) {
|
|
|
71
78
|
}
|
|
72
79
|
throw new Error("unreachable");
|
|
73
80
|
}
|
|
74
|
-
exports.extractType = extractType;
|
|
75
81
|
function decodeFromFields(reified, field) {
|
|
76
82
|
switch (reified) {
|
|
77
83
|
case "bool":
|
|
@@ -111,7 +117,6 @@ function decodeFromFields(reified, field) {
|
|
|
111
117
|
return reified.fromFields(field);
|
|
112
118
|
}
|
|
113
119
|
}
|
|
114
|
-
exports.decodeFromFields = decodeFromFields;
|
|
115
120
|
function decodeFromFieldsWithTypes(reified, item) {
|
|
116
121
|
switch (reified) {
|
|
117
122
|
case "bool":
|
|
@@ -149,7 +154,6 @@ function decodeFromFieldsWithTypes(reified, item) {
|
|
|
149
154
|
return reified.fromFieldsWithTypes(item);
|
|
150
155
|
}
|
|
151
156
|
}
|
|
152
|
-
exports.decodeFromFieldsWithTypes = decodeFromFieldsWithTypes;
|
|
153
157
|
function assertReifiedTypeArgsMatch(fullType, typeArgs, reifiedTypeArgs) {
|
|
154
158
|
if (reifiedTypeArgs.length !== typeArgs.length) {
|
|
155
159
|
throw new Error(`provided item has mismatching number of type argments ${fullType} (expected ${reifiedTypeArgs.length}, got ${typeArgs.length}))`);
|
|
@@ -161,12 +165,10 @@ function assertReifiedTypeArgsMatch(fullType, typeArgs, reifiedTypeArgs) {
|
|
|
161
165
|
}
|
|
162
166
|
}
|
|
163
167
|
}
|
|
164
|
-
exports.assertReifiedTypeArgsMatch = assertReifiedTypeArgsMatch;
|
|
165
168
|
function assertFieldsWithTypesArgsMatch(item, reifiedTypeArgs) {
|
|
166
169
|
const { typeArgs: itemTypeArgs } = (0, util_1.parseTypeName)(item.type);
|
|
167
170
|
assertReifiedTypeArgsMatch(item.type, itemTypeArgs, reifiedTypeArgs);
|
|
168
171
|
}
|
|
169
|
-
exports.assertFieldsWithTypesArgsMatch = assertFieldsWithTypesArgsMatch;
|
|
170
172
|
function fieldToJSON(type, field) {
|
|
171
173
|
const { typeName, typeArgs } = (0, util_1.parseTypeName)(type);
|
|
172
174
|
switch (typeName) {
|
|
@@ -202,7 +204,6 @@ function fieldToJSON(type, field) {
|
|
|
202
204
|
return field.toJSONField();
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
|
-
exports.fieldToJSON = fieldToJSON;
|
|
206
207
|
function decodeFromJSONField(typeArg, field) {
|
|
207
208
|
switch (typeArg) {
|
|
208
209
|
case "bool":
|
|
@@ -237,4 +238,3 @@ function decodeFromJSONField(typeArg, field) {
|
|
|
237
238
|
return typeArg.fromJSONField(field);
|
|
238
239
|
}
|
|
239
240
|
}
|
|
240
|
-
exports.decodeFromJSONField = decodeFromJSONField;
|
|
@@ -16,21 +16,15 @@ export declare function obj(tx: Transaction, arg: TransactionObjectInput): {
|
|
|
16
16
|
GasCoin: true;
|
|
17
17
|
} | {
|
|
18
18
|
Input: number;
|
|
19
|
-
type?: "
|
|
19
|
+
type?: "pure" | "object";
|
|
20
20
|
} | {
|
|
21
21
|
Result: number;
|
|
22
22
|
} | {
|
|
23
23
|
NestedResult: [number, number];
|
|
24
|
-
} | ((tx: Transaction) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
type?: "object" | "pure" | undefined;
|
|
29
|
-
} | {
|
|
30
|
-
Result: number;
|
|
31
|
-
} | {
|
|
32
|
-
NestedResult: [number, number];
|
|
33
|
-
});
|
|
24
|
+
} | ((tx: Transaction) => Exclude<import("valibot").InferInput<typeof import("@mysten/sui/transactions").Argument>, {
|
|
25
|
+
Input: unknown;
|
|
26
|
+
type?: "pure";
|
|
27
|
+
}>);
|
|
34
28
|
export declare function pure(tx: Transaction, arg: PureArg, type: string): TransactionArgument;
|
|
35
29
|
export declare function option(tx: Transaction, type: string, arg: GenericArg | null): TransactionArgument;
|
|
36
30
|
export declare function generic(tx: Transaction, type: string, arg: GenericArg): TransactionArgument;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.splitGenericParameters = splitGenericParameters;
|
|
4
|
+
exports.parseTypeName = parseTypeName;
|
|
5
|
+
exports.isTransactionArgument = isTransactionArgument;
|
|
6
|
+
exports.obj = obj;
|
|
7
|
+
exports.pure = pure;
|
|
8
|
+
exports.option = option;
|
|
9
|
+
exports.generic = generic;
|
|
10
|
+
exports.vector = vector;
|
|
11
|
+
exports.typeArgIsPure = typeArgIsPure;
|
|
12
|
+
exports.compressSuiAddress = compressSuiAddress;
|
|
13
|
+
exports.compressSuiType = compressSuiType;
|
|
14
|
+
exports.composeSuiType = composeSuiType;
|
|
4
15
|
const bcs_1 = require("@mysten/sui/bcs");
|
|
5
16
|
function splitGenericParameters(str, genericSeparators = ["<", ">"]) {
|
|
6
17
|
const [left, right] = genericSeparators;
|
|
@@ -25,7 +36,6 @@ function splitGenericParameters(str, genericSeparators = ["<", ">"]) {
|
|
|
25
36
|
tok.push(word.trim());
|
|
26
37
|
return tok;
|
|
27
38
|
}
|
|
28
|
-
exports.splitGenericParameters = splitGenericParameters;
|
|
29
39
|
function parseTypeName(name) {
|
|
30
40
|
if (typeof name !== "string") {
|
|
31
41
|
throw new Error(`Illegal type passed as a name of the type: ${name}`);
|
|
@@ -45,7 +55,6 @@ function parseTypeName(name) {
|
|
|
45
55
|
const typeArgs = splitGenericParameters(name.slice(l_bound + 1, name.length - r_bound - 1), [left, right]);
|
|
46
56
|
return { typeName, typeArgs };
|
|
47
57
|
}
|
|
48
|
-
exports.parseTypeName = parseTypeName;
|
|
49
58
|
function isTransactionArgument(arg) {
|
|
50
59
|
if (!arg || typeof arg !== "object" || Array.isArray(arg)) {
|
|
51
60
|
return false;
|
|
@@ -55,11 +64,9 @@ function isTransactionArgument(arg) {
|
|
|
55
64
|
"Result" in arg ||
|
|
56
65
|
"NestedResult" in arg);
|
|
57
66
|
}
|
|
58
|
-
exports.isTransactionArgument = isTransactionArgument;
|
|
59
67
|
function obj(tx, arg) {
|
|
60
68
|
return isTransactionArgument(arg) ? arg : tx.object(arg);
|
|
61
69
|
}
|
|
62
|
-
exports.obj = obj;
|
|
63
70
|
function pure(tx, arg, type) {
|
|
64
71
|
if (isTransactionArgument(arg)) {
|
|
65
72
|
return obj(tx, arg);
|
|
@@ -187,7 +194,6 @@ function pure(tx, arg, type) {
|
|
|
187
194
|
return tx.pure(getBcsForType(type).serialize(arg));
|
|
188
195
|
}
|
|
189
196
|
}
|
|
190
|
-
exports.pure = pure;
|
|
191
197
|
function option(tx, type, arg) {
|
|
192
198
|
if (isTransactionArgument(arg)) {
|
|
193
199
|
return arg;
|
|
@@ -210,7 +216,6 @@ function option(tx, type, arg) {
|
|
|
210
216
|
arguments: [val],
|
|
211
217
|
});
|
|
212
218
|
}
|
|
213
|
-
exports.option = option;
|
|
214
219
|
function generic(tx, type, arg) {
|
|
215
220
|
if (typeArgIsPure(type)) {
|
|
216
221
|
return pure(tx, arg, type);
|
|
@@ -229,7 +234,6 @@ function generic(tx, type, arg) {
|
|
|
229
234
|
}
|
|
230
235
|
}
|
|
231
236
|
}
|
|
232
|
-
exports.generic = generic;
|
|
233
237
|
function vector(tx, itemType, items) {
|
|
234
238
|
if (typeof items === "function") {
|
|
235
239
|
throw new Error("Transaction plugins are not supported");
|
|
@@ -255,7 +259,6 @@ function vector(tx, itemType, items) {
|
|
|
255
259
|
});
|
|
256
260
|
}
|
|
257
261
|
}
|
|
258
|
-
exports.vector = vector;
|
|
259
262
|
function typeArgIsPure(type) {
|
|
260
263
|
const { typeName, typeArgs } = parseTypeName(type);
|
|
261
264
|
switch (typeName) {
|
|
@@ -281,7 +284,6 @@ function typeArgIsPure(type) {
|
|
|
281
284
|
return false;
|
|
282
285
|
}
|
|
283
286
|
}
|
|
284
|
-
exports.typeArgIsPure = typeArgIsPure;
|
|
285
287
|
function compressSuiAddress(addr) {
|
|
286
288
|
// remove leading zeros
|
|
287
289
|
const stripped = addr.split("0x").join("");
|
|
@@ -292,7 +294,6 @@ function compressSuiAddress(addr) {
|
|
|
292
294
|
}
|
|
293
295
|
return "0x0";
|
|
294
296
|
}
|
|
295
|
-
exports.compressSuiAddress = compressSuiAddress;
|
|
296
297
|
// Recursively removes leading zeros from a type.
|
|
297
298
|
// e.g. `0x00000002::module::Name<0x00001::a::C>` -> `0x2::module::Name<0x1::a::C>`
|
|
298
299
|
function compressSuiType(type) {
|
|
@@ -323,7 +324,6 @@ function compressSuiType(type) {
|
|
|
323
324
|
}
|
|
324
325
|
}
|
|
325
326
|
}
|
|
326
|
-
exports.compressSuiType = compressSuiType;
|
|
327
327
|
function composeSuiType(typeName, ...typeArgs) {
|
|
328
328
|
if (typeArgs.length > 0) {
|
|
329
329
|
return `${typeName}<${typeArgs.join(", ")}>`;
|
|
@@ -332,4 +332,3 @@ function composeSuiType(typeName, ...typeArgs) {
|
|
|
332
332
|
return typeName;
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
exports.composeSuiType = composeSuiType;
|
|
@@ -17,7 +17,7 @@ export declare class Vector<T extends TypeArgument> implements VectorClass {
|
|
|
17
17
|
static get r(): typeof Vector.reified;
|
|
18
18
|
static get bcs(): <T, Input>(type: import("@mysten/sui/bcs").BcsType<T, Input>, options?: import("@mysten/sui/bcs").BcsTypeOptions<T[], Iterable<Input> & {
|
|
19
19
|
length: number;
|
|
20
|
-
}>
|
|
20
|
+
}>) => import("@mysten/sui/bcs").BcsType<T[], Iterable<Input> & {
|
|
21
21
|
length: number;
|
|
22
22
|
}>;
|
|
23
23
|
static fromFields<T extends Reified<TypeArgument, any>>(typeArg: T, elements: any[]): Vector<ToTypeArgument<T>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Vector = void 0;
|
|
4
|
+
exports.vector = vector;
|
|
4
5
|
const bcs_1 = require("@mysten/sui/bcs");
|
|
5
6
|
const reified_1 = require("./reified");
|
|
6
7
|
const util_1 = require("./util");
|
|
@@ -74,4 +75,3 @@ Vector.$isPhantom = [false];
|
|
|
74
75
|
function vector(T) {
|
|
75
76
|
return Vector.r(T);
|
|
76
77
|
}
|
|
77
|
-
exports.vector = vector;
|
|
@@ -24,7 +24,7 @@ export declare class Cell<Element extends TypeArgument> implements StructClass {
|
|
|
24
24
|
static get r(): typeof Cell.reified;
|
|
25
25
|
static phantom<Element extends Reified<TypeArgument, any>>(Element: Element): PhantomReified<ToTypeStr<Cell<ToTypeArgument<Element>>>>;
|
|
26
26
|
static get p(): typeof Cell.phantom;
|
|
27
|
-
static get bcs(): <Element extends BcsType<any
|
|
27
|
+
static get bcs(): <Element extends BcsType<any>>(Element: Element) => BcsType<{
|
|
28
28
|
element: {
|
|
29
29
|
vec: any[];
|
|
30
30
|
};
|
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Cell =
|
|
12
|
+
exports.Cell = void 0;
|
|
13
|
+
exports.isCell = isCell;
|
|
13
14
|
const structs_1 = require("../../_dependencies/source/0x1/option/structs");
|
|
14
15
|
const reified_1 = require("../../_framework/reified");
|
|
15
16
|
const util_1 = require("../../_framework/util");
|
|
@@ -21,7 +22,6 @@ function isCell(type) {
|
|
|
21
22
|
type = (0, util_1.compressSuiType)(type);
|
|
22
23
|
return type.startsWith(`${index_1.PKG_V1}::cell::Cell` + "<");
|
|
23
24
|
}
|
|
24
|
-
exports.isCell = isCell;
|
|
25
25
|
class Cell {
|
|
26
26
|
constructor(typeArgs, fields) {
|
|
27
27
|
this.__StructClass = true;
|
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Decimal =
|
|
12
|
+
exports.Decimal = void 0;
|
|
13
|
+
exports.isDecimal = isDecimal;
|
|
13
14
|
const reified_1 = require("../../_framework/reified");
|
|
14
15
|
const util_1 = require("../../_framework/util");
|
|
15
16
|
const index_1 = require("../index");
|
|
@@ -20,7 +21,6 @@ function isDecimal(type) {
|
|
|
20
21
|
type = (0, util_1.compressSuiType)(type);
|
|
21
22
|
return type === `${index_1.PKG_V1}::decimal::Decimal`;
|
|
22
23
|
}
|
|
23
|
-
exports.isDecimal = isDecimal;
|
|
24
24
|
class Decimal {
|
|
25
25
|
constructor(typeArgs, fields) {
|
|
26
26
|
this.__StructClass = true;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PKG_V1 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
|
|
4
|
+
exports.setPublishedAt = setPublishedAt;
|
|
4
5
|
exports.PACKAGE_ID = process.env.NEXT_PUBLIC_USE_BETA_MARKET
|
|
5
6
|
? "0x1f54a9a2d71799553197e9ea24557797c6398d6a65f2d4d3818c9304b75d5e21"
|
|
6
7
|
: "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
|
|
@@ -13,4 +14,3 @@ exports.PKG_V1 = process.env.NEXT_PUBLIC_USE_BETA_MARKET
|
|
|
13
14
|
function setPublishedAt(publishedAt) {
|
|
14
15
|
exports.PUBLISHED_AT = publishedAt;
|
|
15
16
|
}
|
|
16
|
-
exports.setPublishedAt = setPublishedAt;
|