@typus/typus-sdk 1.1.47 → 1.1.48
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.
|
@@ -139,3 +139,18 @@ export declare function getExerciseTx(gasBudget: number, typusFrameworkPackageId
|
|
|
139
139
|
)
|
|
140
140
|
*/
|
|
141
141
|
export declare function getRebateTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string): Promise<TransactionBlock>;
|
|
142
|
+
/**
|
|
143
|
+
entry fun new_strategy<B_TOKEN>(
|
|
144
|
+
strategy_pool: &mut StrategyPool,
|
|
145
|
+
vault_index: u64,
|
|
146
|
+
signal_index: u64,
|
|
147
|
+
size: u64,
|
|
148
|
+
price_percentage: u64,
|
|
149
|
+
max_times: u64,
|
|
150
|
+
target_rounds: vector<u64>,
|
|
151
|
+
coin: Coin<B_TOKEN>,
|
|
152
|
+
ctx: &mut TxContext
|
|
153
|
+
)
|
|
154
|
+
*/
|
|
155
|
+
export declare function getNewStrategyTx(gasBudget: number, packageId: string, typeArguments: string[], // B_TOKEN
|
|
156
|
+
strategy_pool: string, vault_index: string, signal_index: string, coins: string[], amount: string, size: string, price_percentage: string, max_times: string, target_rounds: string[]): Promise<TransactionBlock>;
|
|
@@ -52,7 +52,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
52
52
|
return ar;
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
-
exports.getRebateTx = exports.getExerciseTx = exports.getTransferBidReceiptTx = exports.getNewBidTx = exports.getCompoundTx = exports.getBatchClaimHarvestWithdrawRedeemTx = exports.getHarvestTx = exports.getClaimTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
55
|
+
exports.getNewStrategyTx = exports.getRebateTx = exports.getExerciseTx = exports.getTransferBidReceiptTx = exports.getNewBidTx = exports.getCompoundTx = exports.getBatchClaimHarvestWithdrawRedeemTx = exports.getHarvestTx = exports.getClaimTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
56
56
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
57
57
|
var constants_1 = require("../../constants");
|
|
58
58
|
/**
|
|
@@ -490,3 +490,67 @@ function getRebateTx(gasBudget, packageId, typeArguments, registry) {
|
|
|
490
490
|
});
|
|
491
491
|
}
|
|
492
492
|
exports.getRebateTx = getRebateTx;
|
|
493
|
+
/**
|
|
494
|
+
entry fun new_strategy<B_TOKEN>(
|
|
495
|
+
strategy_pool: &mut StrategyPool,
|
|
496
|
+
vault_index: u64,
|
|
497
|
+
signal_index: u64,
|
|
498
|
+
size: u64,
|
|
499
|
+
price_percentage: u64,
|
|
500
|
+
max_times: u64,
|
|
501
|
+
target_rounds: vector<u64>,
|
|
502
|
+
coin: Coin<B_TOKEN>,
|
|
503
|
+
ctx: &mut TxContext
|
|
504
|
+
)
|
|
505
|
+
*/
|
|
506
|
+
function getNewStrategyTx(gasBudget, packageId, typeArguments, // B_TOKEN
|
|
507
|
+
strategy_pool, vault_index, signal_index, coins, amount, size, price_percentage, max_times, target_rounds) {
|
|
508
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
509
|
+
var tx, _a, input_coin, coin, _b, input_coin;
|
|
510
|
+
return __generator(this, function (_c) {
|
|
511
|
+
tx = new transactions_1.TransactionBlock();
|
|
512
|
+
if (typeArguments[0] == "0x2::sui::SUI" ||
|
|
513
|
+
typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI") {
|
|
514
|
+
_a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), input_coin = _a[0];
|
|
515
|
+
tx.moveCall({
|
|
516
|
+
target: "".concat(packageId, "::auto_bid::new_strategy"),
|
|
517
|
+
typeArguments: typeArguments,
|
|
518
|
+
arguments: [
|
|
519
|
+
tx.object(strategy_pool),
|
|
520
|
+
tx.pure(vault_index),
|
|
521
|
+
tx.pure(signal_index),
|
|
522
|
+
tx.pure(size),
|
|
523
|
+
tx.pure(price_percentage),
|
|
524
|
+
tx.pure(max_times),
|
|
525
|
+
tx.pure(target_rounds),
|
|
526
|
+
input_coin,
|
|
527
|
+
],
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
else {
|
|
531
|
+
coin = coins.pop();
|
|
532
|
+
if (coins.length > 0) {
|
|
533
|
+
tx.mergeCoins(tx.object(coin), coins.map(function (id) { return tx.object(id); }));
|
|
534
|
+
}
|
|
535
|
+
_b = __read(tx.splitCoins(tx.object(coin), [tx.pure(amount)]), 1), input_coin = _b[0];
|
|
536
|
+
tx.moveCall({
|
|
537
|
+
target: "".concat(packageId, "::auto_bid::new_strategy"),
|
|
538
|
+
typeArguments: typeArguments,
|
|
539
|
+
arguments: [
|
|
540
|
+
tx.object(strategy_pool),
|
|
541
|
+
tx.pure(vault_index),
|
|
542
|
+
tx.pure(signal_index),
|
|
543
|
+
tx.pure(size),
|
|
544
|
+
tx.pure(price_percentage),
|
|
545
|
+
tx.pure(max_times),
|
|
546
|
+
tx.pure(target_rounds),
|
|
547
|
+
input_coin,
|
|
548
|
+
],
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
tx.setGasBudget(gasBudget);
|
|
552
|
+
return [2 /*return*/, tx];
|
|
553
|
+
});
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
exports.getNewStrategyTx = getNewStrategyTx;
|
|
@@ -204,7 +204,7 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
204
204
|
Tails = "#".concat(event.parsedJson.number);
|
|
205
205
|
break;
|
|
206
206
|
case "ExpUpEvent":
|
|
207
|
-
i = txHistory.findIndex(function (x) { return x.txDigest == event.id.txDigest && x.Action != "First Deposit"; });
|
|
207
|
+
i = txHistory.findIndex(function (x) { return x.txDigest == event.id.txDigest && x.Action != "First Deposit" && x.Action != "Stake"; });
|
|
208
208
|
if (i != -1) {
|
|
209
209
|
txHistory[i].Tails = "#".concat(event.parsedJson.number);
|
|
210
210
|
txHistory[i].Exp = event.parsedJson.exp_earn;
|