@typus/typus-sdk 1.2.64 → 1.2.66-tgld
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/mainnet.json +4 -4
- package/lib/utils/airdrop/authority-entry.d.ts +22 -0
- package/lib/utils/airdrop/authority-entry.js +138 -0
- package/lib/utils/airdrop/user-entry.d.ts +10 -0
- package/lib/utils/airdrop/user-entry.js +21 -0
- package/lib/utils/airdrop/view-functions.d.ts +10 -0
- package/lib/utils/airdrop/view-functions.js +72 -0
- package/lib/utils/leaderboard/authority-entry.d.ts +22 -0
- package/lib/utils/leaderboard/authority-entry.js +91 -0
- package/lib/utils/leaderboard/view-function.d.ts +21 -0
- package/lib/utils/leaderboard/view-function.js +92 -0
- package/lib/utils/nft-staking/user-entry.d.ts +6 -5
- package/lib/utils/nft-staking/user-entry.js +161 -41
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.d.ts +4 -0
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.js +5 -1
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +4 -0
- package/lib/utils/typus-dov-single-v2/user-entry.js +10 -2
- package/lib/utils/typus-dov-single-v2/user-history.js +24 -7
- package/lib/utils/typus-nft/fetch.d.ts +7 -5
- package/lib/utils/typus-nft/fetch.js +57 -26
- package/lib/utils/user/view-functions.d.ts +9 -0
- package/lib/utils/user/view-functions.js +71 -0
- package/package.json +1 -1
- package/lib/utils/typus-dov-double/authorized-entry.d.ts +0 -102
- package/lib/utils/typus-dov-double/authorized-entry.js +0 -295
- package/lib/utils/typus-dov-double/manager-entry.d.ts +0 -219
- package/lib/utils/typus-dov-double/manager-entry.js +0 -584
- package/lib/utils/typus-dov-double/portfolio-vault.d.ts +0 -68
- package/lib/utils/typus-dov-double/portfolio-vault.js +0 -303
- package/lib/utils/typus-dov-double/user-entry.d.ts +0 -93
- package/lib/utils/typus-dov-double/user-entry.js +0 -280
- package/lib/utils/typus-dov-double/view-function.d.ts +0 -11
- package/lib/utils/typus-dov-double/view-function.js +0 -213
- package/lib/utils/typus-dov-single/db-data.d.ts +0 -19
- package/lib/utils/typus-dov-single/db-data.js +0 -226
- package/lib/utils/typus-dov-single/portfolio-vault.d.ts +0 -63
- package/lib/utils/typus-dov-single/portfolio-vault.js +0 -284
- package/lib/utils/typus-dov-single/registry.d.ts +0 -14
- package/lib/utils/typus-dov-single/registry.js +0 -126
- package/lib/utils/typus-dov-single/user-entry.d.ts +0 -103
- package/lib/utils/typus-dov-single/user-entry.js +0 -388
- package/lib/utils/typus-dov-single/user-history.d.ts +0 -17
- package/lib/utils/typus-dov-single/user-history.js +0 -146
- package/lib/utils/typus-dov-single/view-function.d.ts +0 -50
- package/lib/utils/typus-dov-single/view-function.js +0 -444
|
@@ -66,36 +66,91 @@ var kiosk_1 = require("@mysten/kiosk");
|
|
|
66
66
|
ctx: &mut TxContext
|
|
67
67
|
)
|
|
68
68
|
*/
|
|
69
|
-
function getTransferNftTx(gasBudget, nftPackageId, registry,
|
|
69
|
+
function getTransferNftTx(gasBudget, nftPackageId, registry, personalKioskPackageId, tails_id, receiver) {
|
|
70
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
-
var tx, _a, coin;
|
|
72
|
-
return __generator(this, function (
|
|
71
|
+
var tx, _a, coin, _b, personalKioskCap, borrow;
|
|
72
|
+
return __generator(this, function (_c) {
|
|
73
73
|
tx = new transactions_1.TransactionBlock();
|
|
74
74
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(10000000)]), 1), coin = _a[0];
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
if (tails_id.isPersonal) {
|
|
76
|
+
_b = __read(tx.moveCall({
|
|
77
|
+
target: "".concat(personalKioskPackageId, "::personal_kiosk::borrow_val"),
|
|
78
|
+
arguments: [tx.object(tails_id.kioskCap)],
|
|
79
|
+
}), 2), personalKioskCap = _b[0], borrow = _b[1];
|
|
80
|
+
tx.moveCall({
|
|
81
|
+
target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
|
|
82
|
+
typeArguments: [],
|
|
83
|
+
arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), tx.pure(receiver), coin],
|
|
84
|
+
});
|
|
85
|
+
tx.moveCall({
|
|
86
|
+
target: "".concat(personalKioskPackageId, "::personal_kiosk::return_val"),
|
|
87
|
+
arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
tx.moveCall({
|
|
92
|
+
target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
|
|
93
|
+
typeArguments: [],
|
|
94
|
+
arguments: [
|
|
95
|
+
tx.object(registry),
|
|
96
|
+
tx.object(tails_id.kiosk),
|
|
97
|
+
tx.object(tails_id.kioskCap),
|
|
98
|
+
tx.pure(tails_id.nftId),
|
|
99
|
+
tx.pure(receiver),
|
|
100
|
+
coin,
|
|
101
|
+
],
|
|
102
|
+
});
|
|
103
|
+
}
|
|
80
104
|
tx.setGasBudget(gasBudget);
|
|
81
105
|
return [2 /*return*/, tx];
|
|
82
106
|
});
|
|
83
107
|
});
|
|
84
108
|
}
|
|
85
109
|
exports.getTransferNftTx = getTransferNftTx;
|
|
86
|
-
function getTransferNftsTx(gasBudget, nftPackageId,
|
|
110
|
+
function getTransferNftsTx(gasBudget, nftPackageId, personalKioskPackageId, registry, tailsIds, receiver) {
|
|
87
111
|
return __awaiter(this, void 0, void 0, function () {
|
|
88
|
-
var tx, i, _a, coin;
|
|
89
|
-
return __generator(this, function (
|
|
112
|
+
var tx, i, _a, coin, _b, personalKioskCap, borrow;
|
|
113
|
+
return __generator(this, function (_c) {
|
|
90
114
|
tx = new transactions_1.TransactionBlock();
|
|
91
115
|
i = 0;
|
|
92
|
-
while (i <
|
|
116
|
+
while (i < tailsIds.length) {
|
|
93
117
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(10000000)]), 1), coin = _a[0];
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
118
|
+
if (tailsIds[i].isPersonal) {
|
|
119
|
+
_b = __read(tx.moveCall({
|
|
120
|
+
target: "".concat(personalKioskPackageId, "::personal_kiosk::borrow_val"),
|
|
121
|
+
arguments: [tx.object(tailsIds[i].kioskCap)],
|
|
122
|
+
}), 2), personalKioskCap = _b[0], borrow = _b[1];
|
|
123
|
+
tx.moveCall({
|
|
124
|
+
target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
|
|
125
|
+
typeArguments: [],
|
|
126
|
+
arguments: [
|
|
127
|
+
tx.object(registry),
|
|
128
|
+
tx.object(tailsIds[i].kiosk),
|
|
129
|
+
personalKioskCap,
|
|
130
|
+
tx.pure(tailsIds[i].nftId),
|
|
131
|
+
tx.pure(receiver),
|
|
132
|
+
coin,
|
|
133
|
+
],
|
|
134
|
+
});
|
|
135
|
+
tx.moveCall({
|
|
136
|
+
target: "".concat(personalKioskPackageId, "::personal_kiosk::return_val"),
|
|
137
|
+
arguments: [tx.object(tailsIds[i].kioskCap), personalKioskCap, borrow],
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
tx.moveCall({
|
|
142
|
+
target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
|
|
143
|
+
typeArguments: [],
|
|
144
|
+
arguments: [
|
|
145
|
+
tx.object(registry),
|
|
146
|
+
tx.object(tailsIds[i].kiosk),
|
|
147
|
+
tx.object(tailsIds[i].kioskCap),
|
|
148
|
+
tx.pure(tailsIds[i].nftId),
|
|
149
|
+
tx.pure(receiver),
|
|
150
|
+
coin,
|
|
151
|
+
],
|
|
152
|
+
});
|
|
153
|
+
}
|
|
99
154
|
i += 1;
|
|
100
155
|
}
|
|
101
156
|
tx.setGasBudget(gasBudget);
|
|
@@ -114,27 +169,51 @@ exports.getTransferNftsTx = getTransferNftsTx;
|
|
|
114
169
|
ctx: &mut TxContext
|
|
115
170
|
)
|
|
116
171
|
*/
|
|
117
|
-
function getStakeNftTx(gasBudget, nftPackageId, registry,
|
|
172
|
+
function getStakeNftTx(gasBudget, nftPackageId, registry, personalKioskPackageId, tails_id) {
|
|
118
173
|
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
-
var tx, _a, coin;
|
|
120
|
-
return __generator(this, function (
|
|
174
|
+
var tx, _a, coin, _b, personalKioskCap, borrow;
|
|
175
|
+
return __generator(this, function (_c) {
|
|
121
176
|
tx = new transactions_1.TransactionBlock();
|
|
122
177
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(50000000)]), 1), coin = _a[0];
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
178
|
+
if (tails_id.isPersonal) {
|
|
179
|
+
_b = __read(tx.moveCall({
|
|
180
|
+
target: "".concat(personalKioskPackageId, "::personal_kiosk::borrow_val"),
|
|
181
|
+
arguments: [tx.object(tails_id.kioskCap)],
|
|
182
|
+
}), 2), personalKioskCap = _b[0], borrow = _b[1];
|
|
183
|
+
tx.moveCall({
|
|
184
|
+
target: "".concat(nftPackageId, "::tails_staking::stake_nft"),
|
|
185
|
+
typeArguments: [],
|
|
186
|
+
arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), tx.object(constants_1.CLOCK), coin],
|
|
187
|
+
});
|
|
188
|
+
tx.moveCall({
|
|
189
|
+
target: "".concat(personalKioskPackageId, "::personal_kiosk::return_val"),
|
|
190
|
+
arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
tx.moveCall({
|
|
195
|
+
target: "".concat(nftPackageId, "::tails_staking::stake_nft"),
|
|
196
|
+
typeArguments: [],
|
|
197
|
+
arguments: [
|
|
198
|
+
tx.object(registry),
|
|
199
|
+
tx.object(tails_id.kiosk),
|
|
200
|
+
tx.object(tails_id.kioskCap),
|
|
201
|
+
tx.pure(tails_id.nftId),
|
|
202
|
+
tx.object(constants_1.CLOCK),
|
|
203
|
+
coin,
|
|
204
|
+
],
|
|
205
|
+
});
|
|
206
|
+
}
|
|
128
207
|
tx.setGasBudget(gasBudget);
|
|
129
208
|
return [2 /*return*/, tx];
|
|
130
209
|
});
|
|
131
210
|
});
|
|
132
211
|
}
|
|
133
212
|
exports.getStakeNftTx = getStakeNftTx;
|
|
134
|
-
function getSwitchNftTx(gasBudget, nftPackageId, registry,
|
|
213
|
+
function getSwitchNftTx(gasBudget, nftPackageId, registry, personalKioskPackageId, tails_id, typeArguments) {
|
|
135
214
|
return __awaiter(this, void 0, void 0, function () {
|
|
136
|
-
var tx, _a, coin;
|
|
137
|
-
return __generator(this, function (
|
|
215
|
+
var tx, _a, coin, _b, personalKioskCap, borrow;
|
|
216
|
+
return __generator(this, function (_c) {
|
|
138
217
|
tx = new transactions_1.TransactionBlock();
|
|
139
218
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(50000000)]), 1), coin = _a[0];
|
|
140
219
|
tx.moveCall({
|
|
@@ -152,11 +231,35 @@ function getSwitchNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, nft
|
|
|
152
231
|
typeArguments: typeArguments,
|
|
153
232
|
arguments: [tx.object(registry), tx.pure("exp_profit")],
|
|
154
233
|
});
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
234
|
+
if (tails_id.isPersonal) {
|
|
235
|
+
_b = __read(tx.moveCall({
|
|
236
|
+
target: "".concat(personalKioskPackageId, "::personal_kiosk::borrow_val"),
|
|
237
|
+
arguments: [tx.object(tails_id.kioskCap)],
|
|
238
|
+
}), 2), personalKioskCap = _b[0], borrow = _b[1];
|
|
239
|
+
tx.moveCall({
|
|
240
|
+
target: "".concat(nftPackageId, "::tails_staking::switch_nft"),
|
|
241
|
+
typeArguments: [],
|
|
242
|
+
arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), tx.object(constants_1.CLOCK), coin],
|
|
243
|
+
});
|
|
244
|
+
tx.moveCall({
|
|
245
|
+
target: "".concat(personalKioskPackageId, "::personal_kiosk::return_val"),
|
|
246
|
+
arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
tx.moveCall({
|
|
251
|
+
target: "".concat(nftPackageId, "::tails_staking::switch_nft"),
|
|
252
|
+
typeArguments: [],
|
|
253
|
+
arguments: [
|
|
254
|
+
tx.object(registry),
|
|
255
|
+
tx.object(tails_id.kiosk),
|
|
256
|
+
tx.object(tails_id.kioskCap),
|
|
257
|
+
tx.pure(tails_id.nftId),
|
|
258
|
+
tx.object(constants_1.CLOCK),
|
|
259
|
+
coin,
|
|
260
|
+
],
|
|
261
|
+
});
|
|
262
|
+
}
|
|
160
263
|
tx.setGasBudget(gasBudget);
|
|
161
264
|
return [2 /*return*/, tx];
|
|
162
265
|
});
|
|
@@ -457,21 +560,38 @@ exports.getLevelUpTx = getLevelUpTx;
|
|
|
457
560
|
ctx: &mut TxContext
|
|
458
561
|
)
|
|
459
562
|
*/
|
|
460
|
-
function consumeExpCoinUnstakedTx(gasBudget, nftPackageId, typeArguments, registry,
|
|
563
|
+
function consumeExpCoinUnstakedTx(gasBudget, nftPackageId, typeArguments, registry, personalKioskPackageId, tails_id, exp_coins, amount) {
|
|
461
564
|
return __awaiter(this, void 0, void 0, function () {
|
|
462
|
-
var tx, coin, _a, input_coin;
|
|
463
|
-
return __generator(this, function (
|
|
565
|
+
var tx, coin, _a, input_coin, _b, personalKioskCap, borrow;
|
|
566
|
+
return __generator(this, function (_c) {
|
|
464
567
|
tx = new transactions_1.TransactionBlock();
|
|
465
568
|
coin = exp_coins.pop();
|
|
466
569
|
if (exp_coins.length > 0) {
|
|
467
570
|
tx.mergeCoins(tx.object(coin), exp_coins.map(function (id) { return tx.object(id); }));
|
|
468
571
|
}
|
|
469
572
|
_a = __read(tx.splitCoins(tx.object(coin), [tx.pure(amount)]), 1), input_coin = _a[0];
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
573
|
+
if (tails_id.isPersonal) {
|
|
574
|
+
_b = __read(tx.moveCall({
|
|
575
|
+
target: "".concat(personalKioskPackageId, "::personal_kiosk::borrow_val"),
|
|
576
|
+
arguments: [tx.object(tails_id.kioskCap)],
|
|
577
|
+
}), 2), personalKioskCap = _b[0], borrow = _b[1];
|
|
578
|
+
tx.moveCall({
|
|
579
|
+
target: "".concat(nftPackageId, "::tails_staking::consume_exp_coin_unstaked"),
|
|
580
|
+
typeArguments: typeArguments,
|
|
581
|
+
arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), input_coin],
|
|
582
|
+
});
|
|
583
|
+
tx.moveCall({
|
|
584
|
+
target: "".concat(personalKioskPackageId, "::personal_kiosk::return_val"),
|
|
585
|
+
arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
else {
|
|
589
|
+
tx.moveCall({
|
|
590
|
+
target: "".concat(nftPackageId, "::tails_staking::consume_exp_coin_unstaked"),
|
|
591
|
+
typeArguments: typeArguments,
|
|
592
|
+
arguments: [tx.object(registry), tx.object(tails_id.kiosk), tx.object(tails_id.kioskCap), tx.pure(tails_id.nftId), input_coin],
|
|
593
|
+
});
|
|
594
|
+
}
|
|
475
595
|
tx.setGasBudget(gasBudget);
|
|
476
596
|
return [2 /*return*/, tx];
|
|
477
597
|
});
|
|
@@ -94,6 +94,10 @@ export declare function getRedeemTx(input: {
|
|
|
94
94
|
}): TransactionBlock;
|
|
95
95
|
export declare function getNewBidTx(input: {
|
|
96
96
|
tx: TransactionBlock;
|
|
97
|
+
typusEcosystemVersion: string;
|
|
98
|
+
typusUserRegistry: string;
|
|
99
|
+
tgldRegistry: string;
|
|
100
|
+
typusLeaderboardRegistry: string;
|
|
97
101
|
typusFrameworkPackageId: string;
|
|
98
102
|
typusDovSinglePackageId: string;
|
|
99
103
|
typusDovSingleRegistry: string;
|
|
@@ -308,9 +308,13 @@ function getNewBidTx(input) {
|
|
|
308
308
|
],
|
|
309
309
|
});
|
|
310
310
|
var result = input.tx.moveCall({
|
|
311
|
-
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::
|
|
311
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::bid"),
|
|
312
312
|
typeArguments: input.typeArguments,
|
|
313
313
|
arguments: [
|
|
314
|
+
input.tx.object(input.typusEcosystemVersion),
|
|
315
|
+
input.tx.object(input.typusUserRegistry),
|
|
316
|
+
input.tx.object(input.tgldRegistry),
|
|
317
|
+
input.tx.object(input.typusLeaderboardRegistry),
|
|
314
318
|
input.tx.object(input.typusDovSingleRegistry),
|
|
315
319
|
input.tx.pure(input.index),
|
|
316
320
|
input.tx.makeMoveVec({ objects: [mfud] }),
|
|
@@ -173,6 +173,10 @@ export declare function getWithdrawHarvestClaimTx(input: {
|
|
|
173
173
|
*/
|
|
174
174
|
export declare function getNewBidTx(input: {
|
|
175
175
|
tx: TransactionBlock;
|
|
176
|
+
typusEcosystemVersion: string;
|
|
177
|
+
typusUserRegistry: string;
|
|
178
|
+
tgldRegistry: string;
|
|
179
|
+
typusLeaderboardRegistry: string;
|
|
176
180
|
typusFrameworkPackageId: string;
|
|
177
181
|
typusDovSinglePackageId: string;
|
|
178
182
|
typusDovSingleRegistry: string;
|
|
@@ -442,9 +442,13 @@ function getNewBidTx(input) {
|
|
|
442
442
|
input.typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
443
443
|
var _a = __read(input.tx.splitCoins(input.tx.gas, [input.tx.pure(input.premium_required)]), 1), coin = _a[0];
|
|
444
444
|
var result = input.tx.moveCall({
|
|
445
|
-
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::
|
|
445
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::bid"),
|
|
446
446
|
typeArguments: input.typeArguments,
|
|
447
447
|
arguments: [
|
|
448
|
+
input.tx.object(input.typusEcosystemVersion),
|
|
449
|
+
input.tx.object(input.typusUserRegistry),
|
|
450
|
+
input.tx.object(input.tgldRegistry),
|
|
451
|
+
input.tx.object(input.typusLeaderboardRegistry),
|
|
448
452
|
input.tx.object(input.typusDovSingleRegistry),
|
|
449
453
|
input.tx.pure(input.index),
|
|
450
454
|
input.tx.makeMoveVec({ objects: [coin] }),
|
|
@@ -474,9 +478,13 @@ function getNewBidTx(input) {
|
|
|
474
478
|
arguments: [input.tx.object(balance)],
|
|
475
479
|
});
|
|
476
480
|
var result = input.tx.moveCall({
|
|
477
|
-
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::
|
|
481
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::bid"),
|
|
478
482
|
typeArguments: input.typeArguments,
|
|
479
483
|
arguments: [
|
|
484
|
+
input.tx.object(input.typusEcosystemVersion),
|
|
485
|
+
input.tx.object(input.typusUserRegistry),
|
|
486
|
+
input.tx.object(input.tgldRegistry),
|
|
487
|
+
input.tx.object(input.typusLeaderboardRegistry),
|
|
480
488
|
input.tx.object(input.typusDovSingleRegistry),
|
|
481
489
|
input.tx.pure(input.index),
|
|
482
490
|
input.tx.makeMoveVec({ objects: [coin] }),
|
|
@@ -149,7 +149,7 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
149
149
|
}
|
|
150
150
|
})
|
|
151
151
|
.reduce(function (promise, event) { return __awaiter(_this, void 0, void 0, function () {
|
|
152
|
-
var txHistory, functionType, action, Action, Amount, Index, Period, Vault, RiskLevel, Tails, Exp, d_token, b_token, o_token, i, i, token, amount, deposit_amount, deposit_amount, balance, balance, profit, profit, token, amount, amount, token, amount, size, token, amount, token, amount, size, bidder_balance;
|
|
152
|
+
var txHistory, functionType, action, Action, Amount, Index, Period, Vault, RiskLevel, Tails, Exp, d_token, b_token, o_token, i, i, i, token, amount, deposit_amount, deposit_amount, balance, balance, profit, profit, token, amount, amount, token, amount, size, token, amount, token, amount, size, bidder_balance;
|
|
153
153
|
var _a;
|
|
154
154
|
var _b;
|
|
155
155
|
return __generator(this, function (_c) {
|
|
@@ -196,9 +196,11 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
196
196
|
Tails = "#".concat(event.parsedJson.number);
|
|
197
197
|
break;
|
|
198
198
|
case "DailyAttendEvent":
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
i = txHistory.findIndex(function (x) { return x.txDigest == event.id.txDigest && x.Action == "Collect EXP"; });
|
|
200
|
+
if (i != -1) {
|
|
201
|
+
txHistory[i].Action = "Check In";
|
|
202
|
+
return [2 /*return*/, txHistory];
|
|
203
|
+
}
|
|
202
204
|
break;
|
|
203
205
|
case "FirstDepositEvent":
|
|
204
206
|
Action = "First Deposit";
|
|
@@ -274,7 +276,7 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
274
276
|
case "RedeemEvent":
|
|
275
277
|
token = (0, token_1.typeArgToAsset)("0x" + event.parsedJson.token.name);
|
|
276
278
|
amount = Number(event.parsedJson.amount) / Math.pow(10, (0, token_1.assetToDecimal)(token));
|
|
277
|
-
Action = "Harvest";
|
|
279
|
+
Action = "Harvest Reward";
|
|
278
280
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
279
281
|
Index = Index;
|
|
280
282
|
break;
|
|
@@ -302,10 +304,25 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
302
304
|
Action = "Rebate";
|
|
303
305
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
304
306
|
break;
|
|
305
|
-
case "ClaimProfitSharingEvent":
|
|
307
|
+
// case "ClaimProfitSharingEvent":
|
|
308
|
+
// var token = typeArgToAsset("0x" + event.parsedJson!.token.name);
|
|
309
|
+
// var amount = Number(event.parsedJson!.value) / 10 ** assetToDecimal(token)!;
|
|
310
|
+
// Action = "Claim Profit Sharing";
|
|
311
|
+
// Amount = `${BigNumber(amount).toFixed()} ${token}`;
|
|
312
|
+
// Tails = `#${event.parsedJson!.number}`;
|
|
313
|
+
// break;
|
|
314
|
+
case "ClaimProfitSharingEventV2":
|
|
306
315
|
token = (0, token_1.typeArgToAsset)("0x" + event.parsedJson.token.name);
|
|
307
316
|
amount = Number(event.parsedJson.value) / Math.pow(10, (0, token_1.assetToDecimal)(token));
|
|
308
|
-
|
|
317
|
+
// dice_profit, exp_profit
|
|
318
|
+
switch (event.parsedJson.name) {
|
|
319
|
+
case "dice_profit":
|
|
320
|
+
Action = "Harvest Dice Profit";
|
|
321
|
+
break;
|
|
322
|
+
case "exp_profit":
|
|
323
|
+
Action = "Harvest Leaderboard Prize";
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
309
326
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
310
327
|
Tails = "#".concat(event.parsedJson.number);
|
|
311
328
|
break;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SuiClient } from "@mysten/sui.js/client";
|
|
1
|
+
import { SuiClient, SuiObjectResponse } from "@mysten/sui.js/client";
|
|
2
2
|
import { KioskClient } from "@mysten/kiosk";
|
|
3
3
|
export declare function getPool(provider: SuiClient, pool: string): Promise<PoolData>;
|
|
4
4
|
export interface PoolData {
|
|
@@ -12,16 +12,19 @@ export interface PoolData {
|
|
|
12
12
|
export declare const necklaces: string[];
|
|
13
13
|
export declare function getPoolMap(provider: SuiClient, nftConfig: any): Promise<Map<string, PoolData>>;
|
|
14
14
|
export declare function getWhitelistMap(nftConfig: any, wlTokens: any): Promise<Map<string, string[]>>;
|
|
15
|
-
interface TailsId {
|
|
15
|
+
export interface TailsId {
|
|
16
16
|
nftId: string;
|
|
17
17
|
kiosk: string;
|
|
18
18
|
kioskCap: string;
|
|
19
19
|
tails: Tails;
|
|
20
|
+
isPersonal: boolean;
|
|
20
21
|
}
|
|
21
22
|
export interface kioskOwnerCap {
|
|
22
|
-
objectId: string;
|
|
23
23
|
kioskId: string;
|
|
24
|
+
objectId: string;
|
|
25
|
+
isPersonal: boolean;
|
|
24
26
|
}
|
|
27
|
+
export declare function getkioskOwnerCaps(datas: SuiObjectResponse[]): kioskOwnerCap[];
|
|
25
28
|
export declare function getTailsIds(kioskClient: KioskClient, nftConfig: any, kioskOwnerCaps: kioskOwnerCap[]): Promise<TailsId[]>;
|
|
26
29
|
export interface TailsWithType extends Tails {
|
|
27
30
|
type: string | null | undefined;
|
|
@@ -62,5 +65,4 @@ export interface DiscountPoolData {
|
|
|
62
65
|
balance: string;
|
|
63
66
|
inventory: number;
|
|
64
67
|
}
|
|
65
|
-
export declare function getMintHistory(provider: SuiClient,
|
|
66
|
-
export {};
|
|
68
|
+
export declare function getMintHistory(provider: SuiClient, NFT_PACKAGE: string, vrf_input: any): Promise<import("@mysten/sui.js/client").PaginatedEvents | undefined>;
|