@typus/typus-sdk 1.2.19 → 1.2.20
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.
|
@@ -41,6 +41,7 @@ export declare function getDiscountPool(provider: SuiClient, pool: string): Prom
|
|
|
41
41
|
export interface DiscountPoolData {
|
|
42
42
|
id: string;
|
|
43
43
|
num: string;
|
|
44
|
+
total: string;
|
|
44
45
|
price: string;
|
|
45
46
|
start_ms: string;
|
|
46
47
|
end_ms: string;
|
|
@@ -49,7 +50,7 @@ export interface DiscountPoolData {
|
|
|
49
50
|
discount_pcts: string[];
|
|
50
51
|
is_live: boolean;
|
|
51
52
|
balance: string;
|
|
52
|
-
|
|
53
|
+
inventory: number;
|
|
53
54
|
}
|
|
54
55
|
export declare function getMintHistory(provider: SuiClient, NFT_PACKAGE_UPGRADE: string, vrf_input: any): Promise<import("@mysten/sui.js/client").PaginatedEvents | undefined>;
|
|
55
56
|
export {};
|
|
@@ -334,17 +334,25 @@ function getTableTails(provider, parentId) {
|
|
|
334
334
|
}
|
|
335
335
|
exports.getTableTails = getTableTails;
|
|
336
336
|
function getDiscountPool(provider, pool) {
|
|
337
|
-
var _a;
|
|
337
|
+
var _a, _b;
|
|
338
338
|
return __awaiter(this, void 0, void 0, function () {
|
|
339
|
-
var res, poolData,
|
|
340
|
-
return __generator(this, function (
|
|
341
|
-
switch (
|
|
339
|
+
var res, poolData, inventory, dynamicField, total;
|
|
340
|
+
return __generator(this, function (_c) {
|
|
341
|
+
switch (_c.label) {
|
|
342
342
|
case 0: return [4 /*yield*/, provider.getObject({ id: pool, options: { showContent: true } })];
|
|
343
343
|
case 1:
|
|
344
|
-
res =
|
|
344
|
+
res = _c.sent();
|
|
345
345
|
poolData = (_a = res.data) === null || _a === void 0 ? void 0 : _a.content.fields;
|
|
346
|
-
|
|
347
|
-
poolData.
|
|
346
|
+
inventory = poolData.tails.fields.contents.fields.size - poolData.requests.length;
|
|
347
|
+
poolData.inventory = inventory;
|
|
348
|
+
return [4 /*yield*/, provider.getDynamicFieldObject({
|
|
349
|
+
parentId: pool,
|
|
350
|
+
name: { type: "0x1::string::String", value: "total" },
|
|
351
|
+
})];
|
|
352
|
+
case 2:
|
|
353
|
+
dynamicField = _c.sent();
|
|
354
|
+
total = (_b = dynamicField.data) === null || _b === void 0 ? void 0 : _b.content.fields.value;
|
|
355
|
+
poolData.total = total;
|
|
348
356
|
return [2 /*return*/, poolData];
|
|
349
357
|
}
|
|
350
358
|
});
|