@typus/typus-sdk 1.2.97 → 1.2.99
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.
|
@@ -107,3 +107,20 @@ export declare function getCloseStrategyTx(gasBudget: number, packageId: string,
|
|
|
107
107
|
registry: string, strategy_pool: string, vault_index: string, signal_index: string, strategy_index: string, mfudPackageId: string, mfudRegistry: string, sender: string): TransactionBlock;
|
|
108
108
|
export declare function getWithdrawProfitStrategyTx(gasBudget: number, packageId: string, typeArguments: string[], // D_TOKEN, B_TOKEN
|
|
109
109
|
registry: string, strategy_pool: string, vault_index: string, signal_index: string, strategy_index: string, mfudPackageId: string, mfudRegistry: string, sender: string, txBlock?: TransactionBlock): TransactionBlock;
|
|
110
|
+
export declare function getCompoundWithRedeemTx(input: {
|
|
111
|
+
tx: TransactionBlock;
|
|
112
|
+
typusEcosystemVersion: string;
|
|
113
|
+
typusUserRegistry: string;
|
|
114
|
+
typusLeaderboardRegistry: string;
|
|
115
|
+
typusFrameworkOriginPackageId: string;
|
|
116
|
+
typusFrameworkPackageId: string;
|
|
117
|
+
typusDovSinglePackageId: string;
|
|
118
|
+
typusDovSingleRegistry: string;
|
|
119
|
+
typeArguments: string[];
|
|
120
|
+
typusTokenPackageId: string;
|
|
121
|
+
typusTokenRegistry: string;
|
|
122
|
+
typusTokenType: string;
|
|
123
|
+
index: string;
|
|
124
|
+
receipts: string[] | TransactionObjectArgument[];
|
|
125
|
+
user: string;
|
|
126
|
+
}): TransactionBlock;
|
|
@@ -16,7 +16,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
16
16
|
return ar;
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.getWithdrawProfitStrategyTx = exports.getCloseStrategyTx = exports.getUpdateStrategyTx = exports.getNewStrategyTx = exports.getRebateTx = exports.getExerciseTx = exports.getNewBidTx = exports.getDepositTx = exports.getReduceFundTx = exports.getRaiseFundTx = void 0;
|
|
19
|
+
exports.getCompoundWithRedeemTx = exports.getWithdrawProfitStrategyTx = exports.getCloseStrategyTx = exports.getUpdateStrategyTx = exports.getNewStrategyTx = exports.getRebateTx = exports.getExerciseTx = exports.getNewBidTx = exports.getDepositTx = exports.getReduceFundTx = exports.getRaiseFundTx = void 0;
|
|
20
20
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
21
21
|
var constants_1 = require("../../constants");
|
|
22
22
|
function getRaiseFundTx(input) {
|
|
@@ -375,3 +375,52 @@ registry, strategy_pool, vault_index, signal_index, strategy_index, mfudPackageI
|
|
|
375
375
|
return tx;
|
|
376
376
|
}
|
|
377
377
|
exports.getWithdrawProfitStrategyTx = getWithdrawProfitStrategyTx;
|
|
378
|
+
function getCompoundWithRedeemTx(input) {
|
|
379
|
+
var raiseBalance = input.tx.moveCall({
|
|
380
|
+
target: "0x2::balance::zero",
|
|
381
|
+
typeArguments: [input.typeArguments[0]],
|
|
382
|
+
arguments: [],
|
|
383
|
+
});
|
|
384
|
+
var result = input.tx.moveCall({
|
|
385
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_raise_fund"),
|
|
386
|
+
typeArguments: [input.typeArguments[0], input.typeArguments[1]],
|
|
387
|
+
arguments: [
|
|
388
|
+
input.tx.object(input.typusEcosystemVersion),
|
|
389
|
+
input.tx.object(input.typusUserRegistry),
|
|
390
|
+
input.tx.object(input.typusLeaderboardRegistry),
|
|
391
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
392
|
+
input.tx.pure(input.index),
|
|
393
|
+
input.tx.makeMoveVec({
|
|
394
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
395
|
+
objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
396
|
+
}),
|
|
397
|
+
input.tx.object(raiseBalance),
|
|
398
|
+
input.tx.pure(true),
|
|
399
|
+
input.tx.pure(false),
|
|
400
|
+
input.tx.object(constants_1.CLOCK),
|
|
401
|
+
],
|
|
402
|
+
});
|
|
403
|
+
return getReduceFundTx({
|
|
404
|
+
tx: input.tx,
|
|
405
|
+
typusEcosystemVersion: input.typusEcosystemVersion,
|
|
406
|
+
typusUserRegistry: input.typusUserRegistry,
|
|
407
|
+
typusLeaderboardRegistry: input.typusLeaderboardRegistry,
|
|
408
|
+
typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
|
|
409
|
+
typusFrameworkPackageId: input.typusFrameworkPackageId,
|
|
410
|
+
typusDovSinglePackageId: input.typusDovSinglePackageId,
|
|
411
|
+
typusDovSingleRegistry: input.typusDovSingleRegistry,
|
|
412
|
+
typeArguments: input.typeArguments,
|
|
413
|
+
typusTokenPackageId: input.typusTokenPackageId,
|
|
414
|
+
typusTokenRegistry: input.typusTokenRegistry,
|
|
415
|
+
typusTokenType: input.typusTokenType,
|
|
416
|
+
index: input.index,
|
|
417
|
+
receipts: [result[0]],
|
|
418
|
+
reduceFromWarmup: "0",
|
|
419
|
+
reduceFromActive: "0",
|
|
420
|
+
reduceFromPremium: false,
|
|
421
|
+
reduceFromInactive: false,
|
|
422
|
+
reduceFromIncentive: true,
|
|
423
|
+
user: input.user,
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
exports.getCompoundWithRedeemTx = getCompoundWithRedeemTx;
|
|
@@ -381,7 +381,7 @@ function getCompoundWithRedeemTx(input) {
|
|
|
381
381
|
});
|
|
382
382
|
var result = input.tx.moveCall({
|
|
383
383
|
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_raise_fund"),
|
|
384
|
-
typeArguments: input.typeArguments,
|
|
384
|
+
typeArguments: [input.typeArguments[0], input.typeArguments[1]],
|
|
385
385
|
arguments: [
|
|
386
386
|
input.tx.object(input.typusEcosystemVersion),
|
|
387
387
|
input.tx.object(input.typusUserRegistry),
|
|
@@ -398,7 +398,6 @@ function getCompoundWithRedeemTx(input) {
|
|
|
398
398
|
input.tx.object(constants_1.CLOCK),
|
|
399
399
|
],
|
|
400
400
|
});
|
|
401
|
-
input.tx.transferObjects([input.tx.object(result[0])], input.user);
|
|
402
401
|
return getReduceFundTx({
|
|
403
402
|
tx: input.tx,
|
|
404
403
|
typusEcosystemVersion: input.typusEcosystemVersion,
|