@typus/typus-sdk 1.2.52 → 1.2.54
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/lib/utils/auto-bid/view-function.js +12 -12
- package/lib/utils/nft-staking/fetch.js +2 -2
- package/lib/utils/nft-staking/user-entry.js +7 -7
- package/lib/utils/recap2023.js +11 -11
- package/lib/utils/tails-exp-dice/fetch.js +1 -1
- package/lib/utils/tails-exp-dice/view-function.js +3 -3
- package/lib/utils/typus-dice/fetch.js +1 -1
- package/lib/utils/typus-dice/view-function.js +3 -3
- package/lib/utils/typus-dov-single/db-data.js +9 -9
- package/lib/utils/typus-dov-single/user-entry.js +7 -7
- package/lib/utils/typus-dov-single-v2/authorized-entry.js +3 -3
- package/lib/utils/typus-dov-single-v2/depositorPnl.js +12 -12
- package/lib/utils/typus-dov-single-v2/leaderboard.js +12 -12
- package/lib/utils/typus-dov-single-v2/vault-history.js +1 -1
- package/lib/utils/typus-dov-single-v2/view-function.js +23 -23
- package/lib/utils/typus-nft/fetch.js +19 -19
- package/package.json +3 -3
|
@@ -229,15 +229,15 @@ function getUserStrategies(provider, packageId, registry, strategyPool, user
|
|
|
229
229
|
}
|
|
230
230
|
exports.getUserStrategies = getUserStrategies;
|
|
231
231
|
function getVaults(provider, strategyPool) {
|
|
232
|
-
var _a;
|
|
233
232
|
return __awaiter(this, void 0, void 0, function () {
|
|
234
|
-
var pool, vaults, strategies, vaults_1, vaults_1_1, vault, signals,
|
|
235
|
-
var e_1,
|
|
233
|
+
var pool, vaults, strategies, vaults_1, vaults_1_1, vault, signals, _a, _b, signal, strategyTable, strategy_pool;
|
|
234
|
+
var e_1, _c, e_2, _d;
|
|
235
|
+
var _e;
|
|
236
236
|
return __generator(this, function (_f) {
|
|
237
237
|
switch (_f.label) {
|
|
238
238
|
case 0: return [4 /*yield*/, provider.getObject({ id: strategyPool, options: { showContent: true } })];
|
|
239
239
|
case 1:
|
|
240
|
-
pool = (
|
|
240
|
+
pool = (_e = (_f.sent()).data) === null || _e === void 0 ? void 0 : _e.content.fields;
|
|
241
241
|
vaults = pool.strategies.fields.contents;
|
|
242
242
|
strategies = new Map();
|
|
243
243
|
try {
|
|
@@ -245,8 +245,8 @@ function getVaults(provider, strategyPool) {
|
|
|
245
245
|
vault = vaults_1_1.value;
|
|
246
246
|
signals = new Map();
|
|
247
247
|
try {
|
|
248
|
-
for (
|
|
249
|
-
signal =
|
|
248
|
+
for (_a = (e_2 = void 0, __values(vault.fields.value.fields.contents)), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
249
|
+
signal = _b.value;
|
|
250
250
|
strategyTable = signal.fields.value.fields.contents;
|
|
251
251
|
// console.log(strategyTable);
|
|
252
252
|
signals.set(signal.fields.key, strategyTable.fields.id.id);
|
|
@@ -255,7 +255,7 @@ function getVaults(provider, strategyPool) {
|
|
|
255
255
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
256
256
|
finally {
|
|
257
257
|
try {
|
|
258
|
-
if (
|
|
258
|
+
if (_b && !_b.done && (_d = _a.return)) _d.call(_a);
|
|
259
259
|
}
|
|
260
260
|
finally { if (e_2) throw e_2.error; }
|
|
261
261
|
}
|
|
@@ -265,7 +265,7 @@ function getVaults(provider, strategyPool) {
|
|
|
265
265
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
266
266
|
finally {
|
|
267
267
|
try {
|
|
268
|
-
if (vaults_1_1 && !vaults_1_1.done && (
|
|
268
|
+
if (vaults_1_1 && !vaults_1_1.done && (_c = vaults_1.return)) _c.call(vaults_1);
|
|
269
269
|
}
|
|
270
270
|
finally { if (e_1) throw e_1.error; }
|
|
271
271
|
}
|
|
@@ -281,10 +281,10 @@ function getVaults(provider, strategyPool) {
|
|
|
281
281
|
}
|
|
282
282
|
exports.getVaults = getVaults;
|
|
283
283
|
function getStrategies(provider, strategyIds) {
|
|
284
|
-
var _a;
|
|
285
284
|
return __awaiter(this, void 0, void 0, function () {
|
|
286
285
|
var strategies, len, results, results_1, results_1_1, result, fields;
|
|
287
|
-
var e_3,
|
|
286
|
+
var e_3, _a;
|
|
287
|
+
var _b;
|
|
288
288
|
return __generator(this, function (_c) {
|
|
289
289
|
switch (_c.label) {
|
|
290
290
|
case 0:
|
|
@@ -299,7 +299,7 @@ function getStrategies(provider, strategyIds) {
|
|
|
299
299
|
try {
|
|
300
300
|
for (results_1 = (e_3 = void 0, __values(results)), results_1_1 = results_1.next(); !results_1_1.done; results_1_1 = results_1.next()) {
|
|
301
301
|
result = results_1_1.value;
|
|
302
|
-
fields = (
|
|
302
|
+
fields = (_b = result.data) === null || _b === void 0 ? void 0 : _b.content.fields;
|
|
303
303
|
// console.log(fields);
|
|
304
304
|
strategies.set(fields.name, fields.value.fields);
|
|
305
305
|
}
|
|
@@ -307,7 +307,7 @@ function getStrategies(provider, strategyIds) {
|
|
|
307
307
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
308
308
|
finally {
|
|
309
309
|
try {
|
|
310
|
-
if (results_1_1 && !results_1_1.done && (
|
|
310
|
+
if (results_1_1 && !results_1_1.done && (_a = results_1.return)) _a.call(results_1);
|
|
311
311
|
}
|
|
312
312
|
finally { if (e_3) throw e_3.error; }
|
|
313
313
|
}
|
|
@@ -39,9 +39,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.getDailyAttendExp = exports.getNftTable = exports.getUserStake = void 0;
|
|
40
40
|
var fetch_1 = require("../typus-nft/fetch");
|
|
41
41
|
function getUserStake(provider, nft_table, user) {
|
|
42
|
-
var _a;
|
|
43
42
|
return __awaiter(this, void 0, void 0, function () {
|
|
44
43
|
var res, fields, tails;
|
|
44
|
+
var _a;
|
|
45
45
|
return __generator(this, function (_b) {
|
|
46
46
|
switch (_b.label) {
|
|
47
47
|
case 0: return [4 /*yield*/, provider.getDynamicFieldObject({
|
|
@@ -95,9 +95,9 @@ function getNftTable(provider, nft_table) {
|
|
|
95
95
|
}
|
|
96
96
|
exports.getNftTable = getNftTable;
|
|
97
97
|
function getDailyAttendExp(provider, dailyAttendExp) {
|
|
98
|
-
var _a, _b;
|
|
99
98
|
return __awaiter(this, void 0, void 0, function () {
|
|
100
99
|
var object, result;
|
|
100
|
+
var _a, _b;
|
|
101
101
|
return __generator(this, function (_c) {
|
|
102
102
|
switch (_c.label) {
|
|
103
103
|
case 0: return [4 /*yield*/, provider.getObject({
|
|
@@ -276,11 +276,11 @@ function getSnapshotTx(gasBudget, nftPackageId, registry) {
|
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
278
|
exports.getSnapshotTx = getSnapshotTx;
|
|
279
|
-
function getNewBidTx(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
279
|
+
function getNewBidTx(gasBudget_1, packageId_1, typeArguments_1, registry_1, additional_config_registry_1, index_1, priceOracle_1, coins_1, size_1, premium_required_1) {
|
|
280
|
+
return __awaiter(this, arguments, void 0, function (gasBudget, packageId, typeArguments, registry, additional_config_registry, index, priceOracle, coins, size, premium_required, // fe float * b_token_decimal
|
|
281
|
+
usingSponsoredGasCoin) {
|
|
283
282
|
var tx, _a, coin;
|
|
283
|
+
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
284
284
|
return __generator(this, function (_b) {
|
|
285
285
|
tx = new transactions_1.TransactionBlock();
|
|
286
286
|
if (!usingSponsoredGasCoin &&
|
|
@@ -322,10 +322,10 @@ usingSponsoredGasCoin) {
|
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
exports.getNewBidTx = getNewBidTx;
|
|
325
|
-
function getDepositTx(
|
|
326
|
-
|
|
327
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
325
|
+
function getDepositTx(gasBudget_1, packageId_1, typeArguments_1, registry_1, additional_config_registry_1, index_1, coins_1, amount_1) {
|
|
326
|
+
return __awaiter(this, arguments, void 0, function (gasBudget, packageId, typeArguments, registry, additional_config_registry, index, coins, amount, usingSponsoredGasCoin) {
|
|
328
327
|
var tx, _a, coin;
|
|
328
|
+
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
329
329
|
return __generator(this, function (_b) {
|
|
330
330
|
tx = new transactions_1.TransactionBlock();
|
|
331
331
|
if (!usingSponsoredGasCoin &&
|
package/lib/utils/recap2023.js
CHANGED
|
@@ -79,10 +79,10 @@ var fetch_1 = require("../utils/nft-staking/fetch");
|
|
|
79
79
|
// console.log(res);
|
|
80
80
|
// })();
|
|
81
81
|
function recap2023(user) {
|
|
82
|
-
var _a, _b, _c, _d;
|
|
83
82
|
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
-
var provider, vaults, userHistory, earn, userHistory_1, userHistory_1_1, history_1, token, amount, sum_1, prices, sum,
|
|
85
|
-
var e_1,
|
|
83
|
+
var provider, vaults, userHistory, earn, userHistory_1, userHistory_1_1, history_1, token, amount, sum_1, prices, sum, _a, _b, _c, token, amount, price, res_1;
|
|
84
|
+
var e_1, _d, _e, _f, _g, _h, e_2, _j;
|
|
85
|
+
var _k, _l, _m, _o;
|
|
86
86
|
return __generator(this, function (_p) {
|
|
87
87
|
switch (_p.label) {
|
|
88
88
|
case 0:
|
|
@@ -103,19 +103,19 @@ function recap2023(user) {
|
|
|
103
103
|
token = "";
|
|
104
104
|
amount = "";
|
|
105
105
|
if (history_1.Action.startsWith("Harvest")) {
|
|
106
|
-
|
|
106
|
+
_e = __read((_k = history_1.Amount) === null || _k === void 0 ? void 0 : _k.split(" "), 2), amount = _e[0], token = _e[1];
|
|
107
107
|
// console.log(`Harvest ${amount} ${token}`);
|
|
108
108
|
}
|
|
109
109
|
else if (history_1.Action.startsWith("Compound")) {
|
|
110
|
-
|
|
110
|
+
_f = __read((_l = history_1.Amount) === null || _l === void 0 ? void 0 : _l.split(" "), 2), amount = _f[0], token = _f[1];
|
|
111
111
|
// console.log(`Compound ${amount} ${token}`);
|
|
112
112
|
}
|
|
113
113
|
else if (history_1.Action.startsWith("Exercise")) {
|
|
114
|
-
|
|
114
|
+
_g = __read((_m = history_1.Amount) === null || _m === void 0 ? void 0 : _m.split(" "), 2), amount = _g[0], token = _g[1];
|
|
115
115
|
// console.log(`Exercise ${amount} ${token}`);
|
|
116
116
|
}
|
|
117
117
|
else if (history_1.Action.startsWith("Claim Profit Sharing")) {
|
|
118
|
-
|
|
118
|
+
_h = __read((_o = history_1.Amount) === null || _o === void 0 ? void 0 : _o.split(" "), 2), amount = _h[0], token = _h[1];
|
|
119
119
|
// console.log(`Claim Profit Sharing ${amount} ${token}`);
|
|
120
120
|
}
|
|
121
121
|
if (earn.has(token)) {
|
|
@@ -130,7 +130,7 @@ function recap2023(user) {
|
|
|
130
130
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
131
131
|
finally {
|
|
132
132
|
try {
|
|
133
|
-
if (userHistory_1_1 && !userHistory_1_1.done && (
|
|
133
|
+
if (userHistory_1_1 && !userHistory_1_1.done && (_d = userHistory_1.return)) _d.call(userHistory_1);
|
|
134
134
|
}
|
|
135
135
|
finally { if (e_1) throw e_1.error; }
|
|
136
136
|
}
|
|
@@ -141,8 +141,8 @@ function recap2023(user) {
|
|
|
141
141
|
prices = _p.sent();
|
|
142
142
|
sum = 0;
|
|
143
143
|
try {
|
|
144
|
-
for (
|
|
145
|
-
|
|
144
|
+
for (_a = __values(earn.entries()), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
145
|
+
_c = __read(_b.value, 2), token = _c[0], amount = _c[1];
|
|
146
146
|
price = prices.get(token.replace("W", ""));
|
|
147
147
|
// console.log(`${token} ${price * amount}`);
|
|
148
148
|
sum += price * amount;
|
|
@@ -151,7 +151,7 @@ function recap2023(user) {
|
|
|
151
151
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
152
152
|
finally {
|
|
153
153
|
try {
|
|
154
|
-
if (
|
|
154
|
+
if (_b && !_b.done && (_j = _a.return)) _j.call(_a);
|
|
155
155
|
}
|
|
156
156
|
finally { if (e_2) throw e_2.error; }
|
|
157
157
|
}
|
|
@@ -248,9 +248,9 @@ function getLeaderBoard(drawDisplays) {
|
|
|
248
248
|
}
|
|
249
249
|
exports.getLeaderBoard = getLeaderBoard;
|
|
250
250
|
function getProfitSharing(provider, diceProfitSharing) {
|
|
251
|
-
var _a, _b, _c, _d;
|
|
252
251
|
return __awaiter(this, void 0, void 0, function () {
|
|
253
252
|
var object, type, tokenType, result;
|
|
253
|
+
var _a, _b, _c, _d;
|
|
254
254
|
return __generator(this, function (_e) {
|
|
255
255
|
switch (_e.label) {
|
|
256
256
|
case 0: return [4 /*yield*/, provider.getObject({
|
|
@@ -44,10 +44,10 @@ var transactions_1 = require("@mysten/sui.js/transactions");
|
|
|
44
44
|
var client_1 = require("@mysten/sui.js/client");
|
|
45
45
|
var bcs_1 = require("@mysten/bcs");
|
|
46
46
|
var bls_signatures_1 = __importDefault(require("bls-signatures"));
|
|
47
|
-
function simulateGame(
|
|
48
|
-
|
|
49
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
+
function simulateGame(network_1, packageId_1, registry_1, index_1, amount_1, guess_1_1, larger_than_1_1, guess_2_1, larger_than_2_1, vrf_input_1_1, vrf_input_2_1, drawKeys_1) {
|
|
48
|
+
return __awaiter(this, arguments, void 0, function (network, packageId, registry, index, amount, guess_1, larger_than_1, guess_2, larger_than_2, vrf_input_1, vrf_input_2, drawKeys, sender) {
|
|
50
49
|
var provider, transactionBlock, target, BLS, PRIVATE_KEY, draw_private_key, bls_signature_1, bls_signature_2, transactionBlockArguments, results, bytes, reader, answer_1, result_1, answer_2, result_2, exp, result;
|
|
50
|
+
if (sender === void 0) { sender = "0xb6c7e3b1c61ee81516a8317f221daa035f1503e0ac3ae7a50b61834bc7a3ead9"; }
|
|
51
51
|
return __generator(this, function (_a) {
|
|
52
52
|
switch (_a.label) {
|
|
53
53
|
case 0:
|
|
@@ -251,9 +251,9 @@ function getLeaderBoard(drawDisplays) {
|
|
|
251
251
|
}
|
|
252
252
|
exports.getLeaderBoard = getLeaderBoard;
|
|
253
253
|
function getProfitSharing(provider, diceProfitSharing) {
|
|
254
|
-
var _a, _b, _c, _d;
|
|
255
254
|
return __awaiter(this, void 0, void 0, function () {
|
|
256
255
|
var object, type, tokenType, result;
|
|
256
|
+
var _a, _b, _c, _d;
|
|
257
257
|
return __generator(this, function (_e) {
|
|
258
258
|
switch (_e.label) {
|
|
259
259
|
case 0: return [4 /*yield*/, provider.getObject({
|
|
@@ -44,10 +44,10 @@ var transactions_1 = require("@mysten/sui.js/transactions");
|
|
|
44
44
|
var client_1 = require("@mysten/sui.js/client");
|
|
45
45
|
var bcs_1 = require("@mysten/bcs");
|
|
46
46
|
var bls_signatures_1 = __importDefault(require("bls-signatures"));
|
|
47
|
-
function simulateGame(
|
|
48
|
-
|
|
49
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
+
function simulateGame(network_1, packageId_1, registry_1, index_1, amount_1, guess_1_1, larger_than_1_1, guess_2_1, larger_than_2_1, vrf_input_1_1, vrf_input_2_1, drawKeys_1) {
|
|
48
|
+
return __awaiter(this, arguments, void 0, function (network, packageId, registry, index, amount, guess_1, larger_than_1, guess_2, larger_than_2, vrf_input_1, vrf_input_2, drawKeys, sender) {
|
|
50
49
|
var provider, transactionBlock, target, BLS, PRIVATE_KEY, draw_private_key, bls_signature_1, bls_signature_2, transactionBlockArguments, results, bytes, reader, answer_1, result_1, answer_2, result_2, reward, exp, result;
|
|
50
|
+
if (sender === void 0) { sender = "0xb6c7e3b1c61ee81516a8317f221daa035f1503e0ac3ae7a50b61834bc7a3ead9"; }
|
|
51
51
|
return __generator(this, function (_a) {
|
|
52
52
|
switch (_a.label) {
|
|
53
53
|
case 0:
|
|
@@ -38,10 +38,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getShowMap = exports.getDb = void 0;
|
|
40
40
|
var apiUrl = "https://us-central1-aqueous-freedom-378103.cloudfunctions.net/mongodb";
|
|
41
|
-
function getDb(
|
|
42
|
-
|
|
43
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
41
|
+
function getDb(database_1, functionNames_1, vaultIndex_1, startTsMs_1, limit_1) {
|
|
42
|
+
return __awaiter(this, arguments, void 0, function (database, functionNames, vaultIndex, startTsMs, limit, endTsMs) {
|
|
44
43
|
var jsonData, response, data;
|
|
44
|
+
if (endTsMs === void 0) { endTsMs = undefined; }
|
|
45
45
|
return __generator(this, function (_a) {
|
|
46
46
|
switch (_a.label) {
|
|
47
47
|
case 0:
|
|
@@ -71,13 +71,13 @@ function getDb(database, functionNames, vaultIndex, startTsMs, limit, endTsMs) {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
exports.getDb = getDb;
|
|
74
|
-
function getShowMap(
|
|
75
|
-
|
|
76
|
-
if (startTsMs === void 0) { startTsMs = "0"; }
|
|
77
|
-
if (limit === void 0) { limit = 1000; }
|
|
78
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
+
function getShowMap(database_1, portfolioVaults_1) {
|
|
75
|
+
return __awaiter(this, arguments, void 0, function (database, portfolioVaults, vaultIndex, startTsMs, limit) {
|
|
79
76
|
var events, groupEventMap, showMap;
|
|
80
77
|
var _this = this;
|
|
78
|
+
if (vaultIndex === void 0) { vaultIndex = undefined; }
|
|
79
|
+
if (startTsMs === void 0) { startTsMs = "0"; }
|
|
80
|
+
if (limit === void 0) { limit = 1000; }
|
|
81
81
|
return __generator(this, function (_a) {
|
|
82
82
|
switch (_a.label) {
|
|
83
83
|
case 0: return [4 /*yield*/, getDb(database, ["NewAuction", "Delivery", "Settle"], vaultIndex, startTsMs, limit)];
|
|
@@ -180,9 +180,9 @@ function getShowMap(database, portfolioVaults, vaultIndex, startTsMs, limit) {
|
|
|
180
180
|
}
|
|
181
181
|
exports.getShowMap = getShowMap;
|
|
182
182
|
function groupEventToShow(groupEvent, portfolioVault) {
|
|
183
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
184
183
|
return __awaiter(this, void 0, void 0, function () {
|
|
185
184
|
var PaidToDepositors, portfolio_payoff, PaidToBidders, exp, ActivationTsMs, SettlementTsMs, result;
|
|
185
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
186
186
|
return __generator(this, function (_r) {
|
|
187
187
|
PaidToDepositors = Number((_a = groupEvent.deliveryEvent) === null || _a === void 0 ? void 0 : _a.premium_value) / Math.pow(10, Number(portfolioVault.config.bTokenDecimal));
|
|
188
188
|
portfolio_payoff = ((_b = groupEvent.settleEvent) === null || _b === void 0 ? void 0 : _b.portfolio_payoff_is_neg)
|
|
@@ -65,10 +65,10 @@ var constants_1 = require("../../constants");
|
|
|
65
65
|
)
|
|
66
66
|
@param typeArguments [Deposit Vault Token, Bid Vault Token, Oracle Token]
|
|
67
67
|
*/
|
|
68
|
-
function getDepositTx(
|
|
69
|
-
|
|
70
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
+
function getDepositTx(gasBudget_1, packageId_1, typeArguments_1, registry_1, additional_config_registry_1, index_1, coins_1, amount_1) {
|
|
69
|
+
return __awaiter(this, arguments, void 0, function (gasBudget, packageId, typeArguments, registry, additional_config_registry, index, coins, amount, usingSponsoredGasCoin) {
|
|
71
70
|
var tx, _a, coin;
|
|
71
|
+
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
72
72
|
return __generator(this, function (_b) {
|
|
73
73
|
tx = new transactions_1.TransactionBlock();
|
|
74
74
|
if (!usingSponsoredGasCoin &&
|
|
@@ -340,11 +340,11 @@ exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
|
340
340
|
)
|
|
341
341
|
@param typeArguments [Deposit Vault Token, Bid Vault Token, Oracle Token]
|
|
342
342
|
*/
|
|
343
|
-
function getNewBidTx(
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
343
|
+
function getNewBidTx(gasBudget_1, packageId_1, typeArguments_1, registry_1, additional_config_registry_1, index_1, priceOracle_1, coins_1, size_1, premium_required_1) {
|
|
344
|
+
return __awaiter(this, arguments, void 0, function (gasBudget, packageId, typeArguments, registry, additional_config_registry, index, priceOracle, coins, size, premium_required, // fe float * b_token_decimal
|
|
345
|
+
usingSponsoredGasCoin) {
|
|
347
346
|
var tx, _a, coin;
|
|
347
|
+
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
348
348
|
return __generator(this, function (_b) {
|
|
349
349
|
tx = new transactions_1.TransactionBlock();
|
|
350
350
|
if (!usingSponsoredGasCoin &&
|
|
@@ -71,10 +71,10 @@ var constants_1 = require("../../constants");
|
|
|
71
71
|
ctx: &mut TxContext,
|
|
72
72
|
)
|
|
73
73
|
*/
|
|
74
|
-
function getOtcTx(
|
|
75
|
-
|
|
76
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
+
function getOtcTx(gasBudget_1, packageId_1, typeArguments_1, registry_1, index_1, coins_1, deliveryPrice_1, deliverySize_1, bidderBidValue_1, bidderFeeBalanceValue_1, incentiveBidValue_1, incentiveFeeBalanceValue_1, depositorIncentiveValue_1) {
|
|
75
|
+
return __awaiter(this, arguments, void 0, function (gasBudget, packageId, typeArguments, registry, index, coins, deliveryPrice, deliverySize, bidderBidValue, bidderFeeBalanceValue, incentiveBidValue, incentiveFeeBalanceValue, depositorIncentiveValue, usingSponsoredGasCoin) {
|
|
77
76
|
var tx, amount, _a, coin;
|
|
77
|
+
if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
|
|
78
78
|
return __generator(this, function (_b) {
|
|
79
79
|
tx = new transactions_1.TransactionBlock();
|
|
80
80
|
if (!usingSponsoredGasCoin &&
|
|
@@ -65,10 +65,10 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
65
65
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
66
|
exports.getDepositorCashFlows = void 0;
|
|
67
67
|
function getDepositorCashFlows(userHistory) {
|
|
68
|
-
var _a, _b, _c, _d, _e;
|
|
69
68
|
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
-
var depositorCashFlows, userHistory_1, userHistory_1_1, history_1, index,
|
|
71
|
-
var e_1,
|
|
69
|
+
var depositorCashFlows, userHistory_1, userHistory_1_1, history_1, index, _a, amount, token, depositorCashFlow, totalHarvest, sum, totalHarvest, depositorCashFlow, _b, amount, token, depositorCashFlow, depositorCashFlow, _c, amount, token, depositorCashFlow, depositorCashFlow, _d, amount, token, depositorCashFlow, depositorCashFlow, _e, amount, token, depositorCashFlow, depositorCashFlow, _f, _g, _h, index, share;
|
|
70
|
+
var e_1, _j, e_2, _k;
|
|
71
|
+
var _l, _m, _o, _p, _q;
|
|
72
72
|
return __generator(this, function (_r) {
|
|
73
73
|
depositorCashFlows = new Map();
|
|
74
74
|
try {
|
|
@@ -76,7 +76,7 @@ function getDepositorCashFlows(userHistory) {
|
|
|
76
76
|
history_1 = userHistory_1_1.value;
|
|
77
77
|
index = history_1.Index;
|
|
78
78
|
if (history_1.Action.startsWith("Harvest")) {
|
|
79
|
-
|
|
79
|
+
_a = __read((_l = history_1.Amount) === null || _l === void 0 ? void 0 : _l.split(" "), 2), amount = _a[0], token = _a[1];
|
|
80
80
|
if (depositorCashFlows.has(index)) {
|
|
81
81
|
depositorCashFlow = depositorCashFlows.get(index);
|
|
82
82
|
totalHarvest = depositorCashFlow.totalHarvest;
|
|
@@ -106,7 +106,7 @@ function getDepositorCashFlows(userHistory) {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
else if (history_1.Action.startsWith("Deposit")) {
|
|
109
|
-
|
|
109
|
+
_b = __read((_m = history_1.Amount) === null || _m === void 0 ? void 0 : _m.split(" "), 2), amount = _b[0], token = _b[1];
|
|
110
110
|
if (depositorCashFlows.has(index)) {
|
|
111
111
|
depositorCashFlow = depositorCashFlows.get(index);
|
|
112
112
|
depositorCashFlow.D_TOKEN = token;
|
|
@@ -127,7 +127,7 @@ function getDepositorCashFlows(userHistory) {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
else if (history_1.Action.startsWith("Withdraw")) {
|
|
130
|
-
|
|
130
|
+
_c = __read((_o = history_1.Amount) === null || _o === void 0 ? void 0 : _o.split(" "), 2), amount = _c[0], token = _c[1];
|
|
131
131
|
if (depositorCashFlows.has(index)) {
|
|
132
132
|
depositorCashFlow = depositorCashFlows.get(index);
|
|
133
133
|
depositorCashFlow.D_TOKEN = token;
|
|
@@ -148,7 +148,7 @@ function getDepositorCashFlows(userHistory) {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
else if (history_1.Action == "Claim") {
|
|
151
|
-
|
|
151
|
+
_d = __read((_p = history_1.Amount) === null || _p === void 0 ? void 0 : _p.split(" "), 2), amount = _d[0], token = _d[1];
|
|
152
152
|
if (depositorCashFlows.has(index)) {
|
|
153
153
|
depositorCashFlow = depositorCashFlows.get(index);
|
|
154
154
|
depositorCashFlow.D_TOKEN = token;
|
|
@@ -169,7 +169,7 @@ function getDepositorCashFlows(userHistory) {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
else if (history_1.Action == "Compound") {
|
|
172
|
-
|
|
172
|
+
_e = __read((_q = history_1.Amount) === null || _q === void 0 ? void 0 : _q.split(" "), 2), amount = _e[0], token = _e[1];
|
|
173
173
|
if (depositorCashFlows.has(index)) {
|
|
174
174
|
depositorCashFlow = depositorCashFlows.get(index);
|
|
175
175
|
depositorCashFlow.D_TOKEN = token;
|
|
@@ -194,14 +194,14 @@ function getDepositorCashFlows(userHistory) {
|
|
|
194
194
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
195
195
|
finally {
|
|
196
196
|
try {
|
|
197
|
-
if (userHistory_1_1 && !userHistory_1_1.done && (
|
|
197
|
+
if (userHistory_1_1 && !userHistory_1_1.done && (_j = userHistory_1.return)) _j.call(userHistory_1);
|
|
198
198
|
}
|
|
199
199
|
finally { if (e_1) throw e_1.error; }
|
|
200
200
|
}
|
|
201
201
|
try {
|
|
202
202
|
// console.log(depositorCashFlows);
|
|
203
|
-
for (
|
|
204
|
-
|
|
203
|
+
for (_f = __values(depositorCashFlows.entries()), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
204
|
+
_h = __read(_g.value, 2), index = _h[0], share = _h[1];
|
|
205
205
|
share.netDeposit = share.totalDeposit + share.totalCompound - share.totalWithdraw - share.totalClaim;
|
|
206
206
|
depositorCashFlows.set(index, share);
|
|
207
207
|
}
|
|
@@ -209,7 +209,7 @@ function getDepositorCashFlows(userHistory) {
|
|
|
209
209
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
210
210
|
finally {
|
|
211
211
|
try {
|
|
212
|
-
if (
|
|
212
|
+
if (_g && !_g.done && (_k = _f.return)) _k.call(_f);
|
|
213
213
|
}
|
|
214
214
|
finally { if (e_2) throw e_2.error; }
|
|
215
215
|
}
|
|
@@ -99,10 +99,10 @@ function getUsersTvl(startTs, endTs) {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
exports.getUsersTvl = getUsersTvl;
|
|
102
|
-
function getUsersBidEvents(
|
|
103
|
-
|
|
104
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
+
function getUsersBidEvents(provider_1, originPackage_1) {
|
|
103
|
+
return __awaiter(this, arguments, void 0, function (provider, originPackage, startTs) {
|
|
105
104
|
var senderFilter, result, datas, hasNextPage, cursor, result;
|
|
105
|
+
if (startTs === void 0) { startTs = 0; }
|
|
106
106
|
return __generator(this, function (_a) {
|
|
107
107
|
switch (_a.label) {
|
|
108
108
|
case 0:
|
|
@@ -135,12 +135,12 @@ function getUsersBidEvents(provider, originPackage, startTs) {
|
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
exports.getUsersBidEvents = getUsersBidEvents;
|
|
138
|
-
function sumUsersBidPremium(
|
|
139
|
-
|
|
140
|
-
if (startTs === void 0) { startTs = 0; }
|
|
141
|
-
if (endTs === void 0) { endTs = Math.floor(new Date().getTime() / 1000); }
|
|
142
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
138
|
+
function sumUsersBidPremium(datas_1) {
|
|
139
|
+
return __awaiter(this, arguments, void 0, function (datas, vaultIndexes, startTs, endTs) {
|
|
143
140
|
var usersPremium, mapEntries;
|
|
141
|
+
if (vaultIndexes === void 0) { vaultIndexes = []; }
|
|
142
|
+
if (startTs === void 0) { startTs = 0; }
|
|
143
|
+
if (endTs === void 0) { endTs = Math.floor(new Date().getTime() / 1000); }
|
|
144
144
|
return __generator(this, function (_a) {
|
|
145
145
|
usersPremium = new Map();
|
|
146
146
|
datas.forEach(function (data) {
|
|
@@ -198,11 +198,11 @@ function getSuiNS(provider, address) {
|
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
exports.getSuiNS = getSuiNS;
|
|
201
|
-
function getUsersHarvestCompound(
|
|
202
|
-
|
|
203
|
-
if (endTs === void 0) { endTs = Math.floor(new Date().getTime() / 1000); }
|
|
204
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
+
function getUsersHarvestCompound(provider_1, originPackage_1) {
|
|
202
|
+
return __awaiter(this, arguments, void 0, function (provider, originPackage, startTs, endTs) {
|
|
205
203
|
var usersHarvestCompound, hasNextPage, cursor, result, hasNextPage, cursor, result, mapEntries;
|
|
204
|
+
if (startTs === void 0) { startTs = 0; }
|
|
205
|
+
if (endTs === void 0) { endTs = Math.floor(new Date().getTime() / 1000); }
|
|
206
206
|
return __generator(this, function (_a) {
|
|
207
207
|
switch (_a.label) {
|
|
208
208
|
case 0:
|
|
@@ -299,9 +299,9 @@ function getVaultHistoryFromDB(index, startTs, endTs, rounds) {
|
|
|
299
299
|
}
|
|
300
300
|
exports.getVaultHistoryFromDB = getVaultHistoryFromDB;
|
|
301
301
|
function convertGroupEventToVaultHistory(groupEvent) {
|
|
302
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
303
302
|
return __awaiter(this, void 0, void 0, function () {
|
|
304
303
|
var ActivationMs, SettlementTsMs, b_token, o_token, bidder_bid_value, bidder_fee, delivery_price, delivery_size, incentive_bid_value, incentive_fee, PaidToDepositors, PaidToBidders, result;
|
|
304
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
305
305
|
return __generator(this, function (_t) {
|
|
306
306
|
ActivationMs = Number((_a = groupEvent.activateEvent) === null || _a === void 0 ? void 0 : _a.timestampMs);
|
|
307
307
|
SettlementTsMs = Number((_b = groupEvent.settleEvent) === null || _b === void 0 ? void 0 : _b.timestampMs);
|
|
@@ -57,10 +57,10 @@ var transactions_1 = require("@mysten/sui.js/transactions");
|
|
|
57
57
|
var bcs_1 = require("@mysten/bcs");
|
|
58
58
|
var tools_1 = require("../tools");
|
|
59
59
|
exports.SENDER = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
|
60
|
-
function getVaults(
|
|
61
|
-
|
|
62
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
60
|
+
function getVaults(provider_1, packageId_1, registry_1, indexes_1) {
|
|
61
|
+
return __awaiter(this, arguments, void 0, function (provider, packageId, registry, indexes, sender) {
|
|
63
62
|
var transactionBlock, target, transactionBlockArguments, results, bytes, reader, result;
|
|
63
|
+
if (sender === void 0) { sender = exports.SENDER; }
|
|
64
64
|
return __generator(this, function (_a) {
|
|
65
65
|
switch (_a.label) {
|
|
66
66
|
case 0:
|
|
@@ -262,11 +262,11 @@ function getVaults(provider, packageId, registry, indexes, sender) {
|
|
|
262
262
|
})
|
|
263
263
|
.at(0),
|
|
264
264
|
activeShareSupply: reader.read64(),
|
|
265
|
-
deactivatingShareSupply: reader.read64(),
|
|
266
|
-
inactiveShareSupply: reader.read64(),
|
|
267
|
-
warmupShareSupply: reader.read64(),
|
|
268
|
-
premiumShareSupply: reader.read64(),
|
|
269
|
-
incentiveShareSupply: reader.read64(),
|
|
265
|
+
deactivatingShareSupply: reader.read64(), // unsubscribe
|
|
266
|
+
inactiveShareSupply: reader.read64(), // claim
|
|
267
|
+
warmupShareSupply: reader.read64(), // deposit / withdraw
|
|
268
|
+
premiumShareSupply: reader.read64(), // harvest
|
|
269
|
+
incentiveShareSupply: reader.read64(), // redeem
|
|
270
270
|
hasNext: reader.read8() > 0,
|
|
271
271
|
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
272
272
|
u64Padding: reader.readVec(function (reader) {
|
|
@@ -289,10 +289,10 @@ function getVaults(provider, packageId, registry, indexes, sender) {
|
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
291
|
exports.getVaults = getVaults;
|
|
292
|
-
function getAuctions(
|
|
293
|
-
|
|
294
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
292
|
+
function getAuctions(provider_1, packageId_1, registry_1, indexes_1) {
|
|
293
|
+
return __awaiter(this, arguments, void 0, function (provider, packageId, registry, indexes, sender) {
|
|
295
294
|
var transactionBlock, target, transactionBlockArguments, results, bytes, reader, result;
|
|
295
|
+
if (sender === void 0) { sender = exports.SENDER; }
|
|
296
296
|
return __generator(this, function (_a) {
|
|
297
297
|
switch (_a.label) {
|
|
298
298
|
case 0:
|
|
@@ -358,10 +358,10 @@ function getAuctions(provider, packageId, registry, indexes, sender) {
|
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
360
|
exports.getAuctions = getAuctions;
|
|
361
|
-
function getAuctionBids(
|
|
362
|
-
|
|
363
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
361
|
+
function getAuctionBids(provider_1, packageId_1, registry_1, index_1) {
|
|
362
|
+
return __awaiter(this, arguments, void 0, function (provider, packageId, registry, index, sender) {
|
|
364
363
|
var transactionBlock, target, transactionBlockArguments, results, bytes, reader, result;
|
|
364
|
+
if (sender === void 0) { sender = exports.SENDER; }
|
|
365
365
|
return __generator(this, function (_a) {
|
|
366
366
|
switch (_a.label) {
|
|
367
367
|
case 0:
|
|
@@ -398,10 +398,10 @@ function getAuctionBids(provider, packageId, registry, index, sender) {
|
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
400
|
exports.getAuctionBids = getAuctionBids;
|
|
401
|
-
function getDepositShares(
|
|
402
|
-
|
|
403
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
401
|
+
function getDepositShares(provider_1, typusFrameworkPackageId_1, packageId_1, registry_1, receipts_1) {
|
|
402
|
+
return __awaiter(this, arguments, void 0, function (provider, typusFrameworkPackageId, packageId, registry, receipts, sender) {
|
|
404
403
|
var transactionBlock, target, transactionBlockArguments, results, bytes, reader, result;
|
|
404
|
+
if (sender === void 0) { sender = exports.SENDER; }
|
|
405
405
|
return __generator(this, function (_a) {
|
|
406
406
|
switch (_a.label) {
|
|
407
407
|
case 0:
|
|
@@ -455,10 +455,10 @@ function getDepositShares(provider, typusFrameworkPackageId, packageId, registry
|
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
exports.getDepositShares = getDepositShares;
|
|
458
|
-
function getMyBids(
|
|
459
|
-
|
|
460
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
458
|
+
function getMyBids(provider_1, typusFrameworkPackageId_1, packageId_1, registry_1, receipts_1) {
|
|
459
|
+
return __awaiter(this, arguments, void 0, function (provider, typusFrameworkPackageId, packageId, registry, receipts, sender) {
|
|
461
460
|
var transactionBlock, target, transactionBlockArguments, results, bytes, reader, result;
|
|
461
|
+
if (sender === void 0) { sender = exports.SENDER; }
|
|
462
462
|
return __generator(this, function (_a) {
|
|
463
463
|
switch (_a.label) {
|
|
464
464
|
case 0:
|
|
@@ -519,10 +519,10 @@ function getMyBids(provider, typusFrameworkPackageId, packageId, registry, recei
|
|
|
519
519
|
});
|
|
520
520
|
}
|
|
521
521
|
exports.getMyBids = getMyBids;
|
|
522
|
-
function getRefundShares(
|
|
523
|
-
|
|
524
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
522
|
+
function getRefundShares(provider_1, packageId_1, registry_1, typeArguments_1) {
|
|
523
|
+
return __awaiter(this, arguments, void 0, function (provider, packageId, registry, typeArguments, sender) {
|
|
525
524
|
var transactionBlock, target, transactionBlockArguments, results, refundShares;
|
|
525
|
+
if (sender === void 0) { sender = exports.SENDER; }
|
|
526
526
|
return __generator(this, function (_a) {
|
|
527
527
|
switch (_a.label) {
|
|
528
528
|
case 0:
|
|
@@ -49,9 +49,9 @@ var __values = (this && this.__values) || function(o) {
|
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
50
|
exports.getMintHistory = exports.getDiscountPool = exports.getTableTails = exports.LevelExpVec = exports.getLevelExp = exports.fieldsToTails = exports.getKioskOwner = exports.getTailsKiosk = exports.getTailsDynamicField = exports.getTails = exports.getTailsIds = exports.getWhitelistMap = exports.getPoolMap = exports.necklaces = exports.getPool = void 0;
|
|
51
51
|
function getPool(provider, pool) {
|
|
52
|
-
var _a;
|
|
53
52
|
return __awaiter(this, void 0, void 0, function () {
|
|
54
53
|
var res, fields, poolData;
|
|
54
|
+
var _a;
|
|
55
55
|
return __generator(this, function (_b) {
|
|
56
56
|
switch (_b.label) {
|
|
57
57
|
case 0: return [4 /*yield*/, provider.getObject({ id: pool, options: { showContent: true } })];
|
|
@@ -214,10 +214,10 @@ function getTailsIds(kioskClient, nftConfig, address, kioskOwnerCaps) {
|
|
|
214
214
|
}
|
|
215
215
|
exports.getTailsIds = getTailsIds;
|
|
216
216
|
function getTails(provider, tailsIds) {
|
|
217
|
-
var _a;
|
|
218
217
|
return __awaiter(this, void 0, void 0, function () {
|
|
219
218
|
var Tails, len, results, results_1, results_1_1, result, fields, tails;
|
|
220
|
-
var e_2,
|
|
219
|
+
var e_2, _a;
|
|
220
|
+
var _b;
|
|
221
221
|
return __generator(this, function (_c) {
|
|
222
222
|
switch (_c.label) {
|
|
223
223
|
case 0:
|
|
@@ -232,7 +232,7 @@ function getTails(provider, tailsIds) {
|
|
|
232
232
|
try {
|
|
233
233
|
for (results_1 = (e_2 = void 0, __values(results)), results_1_1 = results_1.next(); !results_1_1.done; results_1_1 = results_1.next()) {
|
|
234
234
|
result = results_1_1.value;
|
|
235
|
-
fields = (
|
|
235
|
+
fields = (_b = result.data) === null || _b === void 0 ? void 0 : _b.content.fields;
|
|
236
236
|
tails = fieldsToTails(fields);
|
|
237
237
|
Tails.push(tails);
|
|
238
238
|
}
|
|
@@ -240,7 +240,7 @@ function getTails(provider, tailsIds) {
|
|
|
240
240
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
241
241
|
finally {
|
|
242
242
|
try {
|
|
243
|
-
if (results_1_1 && !results_1_1.done && (
|
|
243
|
+
if (results_1_1 && !results_1_1.done && (_a = results_1.return)) _a.call(results_1);
|
|
244
244
|
}
|
|
245
245
|
finally { if (e_2) throw e_2.error; }
|
|
246
246
|
}
|
|
@@ -252,10 +252,10 @@ function getTails(provider, tailsIds) {
|
|
|
252
252
|
}
|
|
253
253
|
exports.getTails = getTails;
|
|
254
254
|
function getTailsDynamicField(provider, tailsIds) {
|
|
255
|
-
var _a, _b;
|
|
256
255
|
return __awaiter(this, void 0, void 0, function () {
|
|
257
256
|
var Tails, tailsToDynamicField, len, results, results_2, results_2_1, result, owner, fields, tails;
|
|
258
|
-
var e_3,
|
|
257
|
+
var e_3, _a;
|
|
258
|
+
var _b, _c;
|
|
259
259
|
return __generator(this, function (_d) {
|
|
260
260
|
switch (_d.label) {
|
|
261
261
|
case 0:
|
|
@@ -271,8 +271,8 @@ function getTailsDynamicField(provider, tailsIds) {
|
|
|
271
271
|
try {
|
|
272
272
|
for (results_2 = (e_3 = void 0, __values(results)), results_2_1 = results_2.next(); !results_2_1.done; results_2_1 = results_2.next()) {
|
|
273
273
|
result = results_2_1.value;
|
|
274
|
-
owner = (
|
|
275
|
-
fields = (
|
|
274
|
+
owner = (_b = result.data) === null || _b === void 0 ? void 0 : _b.owner.ObjectOwner;
|
|
275
|
+
fields = (_c = result.data) === null || _c === void 0 ? void 0 : _c.content.fields;
|
|
276
276
|
tails = fieldsToTails(fields);
|
|
277
277
|
Tails.push(tails);
|
|
278
278
|
if (owner) {
|
|
@@ -286,7 +286,7 @@ function getTailsDynamicField(provider, tailsIds) {
|
|
|
286
286
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
287
287
|
finally {
|
|
288
288
|
try {
|
|
289
|
-
if (results_2_1 && !results_2_1.done && (
|
|
289
|
+
if (results_2_1 && !results_2_1.done && (_a = results_2.return)) _a.call(results_2);
|
|
290
290
|
}
|
|
291
291
|
finally { if (e_3) throw e_3.error; }
|
|
292
292
|
}
|
|
@@ -298,10 +298,10 @@ function getTailsDynamicField(provider, tailsIds) {
|
|
|
298
298
|
}
|
|
299
299
|
exports.getTailsDynamicField = getTailsDynamicField;
|
|
300
300
|
function getTailsKiosk(provider, tailsToDynamicField) {
|
|
301
|
-
var _a;
|
|
302
301
|
return __awaiter(this, void 0, void 0, function () {
|
|
303
302
|
var DynamicFieldToKiosk, dynamicFields, i, len, results, results_3, results_3_1, result, owner;
|
|
304
|
-
var e_4,
|
|
303
|
+
var e_4, _a;
|
|
304
|
+
var _b;
|
|
305
305
|
return __generator(this, function (_c) {
|
|
306
306
|
switch (_c.label) {
|
|
307
307
|
case 0:
|
|
@@ -321,7 +321,7 @@ function getTailsKiosk(provider, tailsToDynamicField) {
|
|
|
321
321
|
try {
|
|
322
322
|
for (results_3 = (e_4 = void 0, __values(results)), results_3_1 = results_3.next(); !results_3_1.done; results_3_1 = results_3.next()) {
|
|
323
323
|
result = results_3_1.value;
|
|
324
|
-
owner = (
|
|
324
|
+
owner = (_b = result.data) === null || _b === void 0 ? void 0 : _b.owner.ObjectOwner;
|
|
325
325
|
DynamicFieldToKiosk.set(dynamicFields.at(i), owner);
|
|
326
326
|
i += 1;
|
|
327
327
|
}
|
|
@@ -329,7 +329,7 @@ function getTailsKiosk(provider, tailsToDynamicField) {
|
|
|
329
329
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
330
330
|
finally {
|
|
331
331
|
try {
|
|
332
|
-
if (results_3_1 && !results_3_1.done && (
|
|
332
|
+
if (results_3_1 && !results_3_1.done && (_a = results_3.return)) _a.call(results_3);
|
|
333
333
|
}
|
|
334
334
|
finally { if (e_4) throw e_4.error; }
|
|
335
335
|
}
|
|
@@ -341,10 +341,10 @@ function getTailsKiosk(provider, tailsToDynamicField) {
|
|
|
341
341
|
}
|
|
342
342
|
exports.getTailsKiosk = getTailsKiosk;
|
|
343
343
|
function getKioskOwner(provider, DynamicFieldToKiosk) {
|
|
344
|
-
var _a;
|
|
345
344
|
return __awaiter(this, void 0, void 0, function () {
|
|
346
345
|
var KioskToOwner, kiosks, uniqueKiosks, i, len, results, results_4, results_4_1, result, owner;
|
|
347
|
-
var e_5,
|
|
346
|
+
var e_5, _a;
|
|
347
|
+
var _b;
|
|
348
348
|
return __generator(this, function (_c) {
|
|
349
349
|
switch (_c.label) {
|
|
350
350
|
case 0:
|
|
@@ -367,7 +367,7 @@ function getKioskOwner(provider, DynamicFieldToKiosk) {
|
|
|
367
367
|
try {
|
|
368
368
|
for (results_4 = (e_5 = void 0, __values(results)), results_4_1 = results_4.next(); !results_4_1.done; results_4_1 = results_4.next()) {
|
|
369
369
|
result = results_4_1.value;
|
|
370
|
-
owner = (
|
|
370
|
+
owner = (_b = result.data) === null || _b === void 0 ? void 0 : _b.content.fields.owner;
|
|
371
371
|
KioskToOwner.set(uniqueKiosks.at(i), owner);
|
|
372
372
|
i += 1;
|
|
373
373
|
}
|
|
@@ -375,7 +375,7 @@ function getKioskOwner(provider, DynamicFieldToKiosk) {
|
|
|
375
375
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
376
376
|
finally {
|
|
377
377
|
try {
|
|
378
|
-
if (results_4_1 && !results_4_1.done && (
|
|
378
|
+
if (results_4_1 && !results_4_1.done && (_a = results_4.return)) _a.call(results_4);
|
|
379
379
|
}
|
|
380
380
|
finally { if (e_5) throw e_5.error; }
|
|
381
381
|
}
|
|
@@ -467,9 +467,9 @@ function getTableTails(provider, parentId) {
|
|
|
467
467
|
}
|
|
468
468
|
exports.getTableTails = getTableTails;
|
|
469
469
|
function getDiscountPool(provider, pool) {
|
|
470
|
-
var _a, _b;
|
|
471
470
|
return __awaiter(this, void 0, void 0, function () {
|
|
472
471
|
var res, poolData, inventory, dynamicField, total;
|
|
472
|
+
var _a, _b;
|
|
473
473
|
return __generator(this, function (_c) {
|
|
474
474
|
switch (_c.label) {
|
|
475
475
|
case 0: return [4 /*yield*/, provider.getObject({ id: pool, options: { showContent: true } })];
|
package/package.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"name": "@typus/typus-sdk",
|
|
3
3
|
"author": "Typus",
|
|
4
4
|
"description": "typus sdk",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.54",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@mysten/bcs": "^0.7.3",
|
|
8
|
-
"@mysten/kiosk": "0.
|
|
9
|
-
"@mysten/sui.js": "0.
|
|
8
|
+
"@mysten/kiosk": "0.7.12",
|
|
9
|
+
"@mysten/sui.js": "0.48.0",
|
|
10
10
|
"@types/node": "^20.5.7",
|
|
11
11
|
"aftermath-ts-sdk": "^1.1.14",
|
|
12
12
|
"bignumber.js": "^9.1.1",
|