@typus/typus-sdk 1.2.13 → 1.2.15
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.
|
@@ -173,6 +173,7 @@ export declare function getWithdrawHarvestClaimTx(input: {
|
|
|
173
173
|
*/
|
|
174
174
|
export declare function getNewBidTx(input: {
|
|
175
175
|
tx: TransactionBlock;
|
|
176
|
+
typusFrameworkPackageId: string;
|
|
176
177
|
typusDovSinglePackageId: string;
|
|
177
178
|
typusDovSingleRegistry: string;
|
|
178
179
|
typeArguments: string[];
|
|
@@ -455,13 +455,26 @@ function getNewBidTx(input) {
|
|
|
455
455
|
input.tx.transferObjects([input.tx.object(result[0])], input.user);
|
|
456
456
|
}
|
|
457
457
|
else {
|
|
458
|
+
var balance = input.tx.moveCall({
|
|
459
|
+
target: "".concat(input.typusFrameworkPackageId, "::utils::extract_balance"),
|
|
460
|
+
typeArguments: [input.typeArguments[1]],
|
|
461
|
+
arguments: [
|
|
462
|
+
input.tx.makeMoveVec({ objects: input.coins.map(function (coin) { return input.tx.object(coin); }) }),
|
|
463
|
+
input.tx.pure(input.premium_required),
|
|
464
|
+
],
|
|
465
|
+
});
|
|
466
|
+
var coin = input.tx.moveCall({
|
|
467
|
+
target: "0x2::coin::from_balance",
|
|
468
|
+
typeArguments: [input.typeArguments[1]],
|
|
469
|
+
arguments: [input.tx.object(balance)],
|
|
470
|
+
});
|
|
458
471
|
var result = input.tx.moveCall({
|
|
459
472
|
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::new_bid"),
|
|
460
473
|
typeArguments: input.typeArguments,
|
|
461
474
|
arguments: [
|
|
462
475
|
input.tx.object(input.typusDovSingleRegistry),
|
|
463
476
|
input.tx.pure(input.index),
|
|
464
|
-
input.tx.makeMoveVec({ objects:
|
|
477
|
+
input.tx.makeMoveVec({ objects: [coin] }),
|
|
465
478
|
input.tx.pure(input.size),
|
|
466
479
|
input.tx.pure("0x6"),
|
|
467
480
|
],
|
|
@@ -86,10 +86,10 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
86
86
|
case 0: return [4 /*yield*/, datas
|
|
87
87
|
.filter(function (event) {
|
|
88
88
|
var type = event.type;
|
|
89
|
-
return
|
|
89
|
+
return event.packageId == originPackage || type.includes("typus_nft::First") || type.includes("typus_nft::ExpUpEvent");
|
|
90
90
|
})
|
|
91
91
|
.reduce(function (promise, event) { return __awaiter(_this, void 0, void 0, function () {
|
|
92
|
-
var txHistory, functionType, action, Action, Amount, Index, Period, Vault, RiskLevel, Tails, Exp, o_token, v, period, optionType, i, i, token, amount, amount, token, amount, size, token, amount, token, amount, i, b_token, size, bidder_balance;
|
|
92
|
+
var txHistory, functionType, action, Action, Amount, Index, Period, Vault, RiskLevel, Tails, Exp, o_token, v, period, optionType, i, i, token, amount, token, amount, amount, token, amount, size, token, amount, token, amount, i, b_token, size, bidder_balance;
|
|
93
93
|
var _a;
|
|
94
94
|
return __generator(this, function (_b) {
|
|
95
95
|
switch (_b.label) {
|
|
@@ -134,6 +134,7 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
134
134
|
case "ClaimEvent":
|
|
135
135
|
case "CompoundEvent":
|
|
136
136
|
case "HarvestEvent":
|
|
137
|
+
case "RedeemEvent":
|
|
137
138
|
optionType = "Covered Call";
|
|
138
139
|
break;
|
|
139
140
|
default:
|
|
@@ -149,6 +150,7 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
149
150
|
case "ClaimEvent":
|
|
150
151
|
case "CompoundEvent":
|
|
151
152
|
case "HarvestEvent":
|
|
153
|
+
case "RedeemEvent":
|
|
152
154
|
optionType = "Put Selling";
|
|
153
155
|
break;
|
|
154
156
|
default:
|
|
@@ -261,6 +263,13 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
261
263
|
return [2 /*return*/, txHistory];
|
|
262
264
|
}
|
|
263
265
|
break;
|
|
266
|
+
case "RedeemEvent":
|
|
267
|
+
token = (0, token_1.typeArgToAsset)("0x" + event.parsedJson.token.name);
|
|
268
|
+
amount = Number(event.parsedJson.amount) / Math.pow(10, (0, token_1.assetToDecimal)(token));
|
|
269
|
+
Action = "Harvest";
|
|
270
|
+
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
271
|
+
Index = event.parsedJson.index;
|
|
272
|
+
break;
|
|
264
273
|
case "TransferBidReceiptEvent":
|
|
265
274
|
amount = Number(event.parsedJson.amount) / Math.pow(10, Number(event.parsedJson.decimal));
|
|
266
275
|
Action = "Transfer Receipt";
|