@typus/typus-sdk 1.1.56 → 1.1.58
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/nft-staking/authorized-entry.d.ts +2 -2
- package/lib/utils/nft-staking/authorized-entry.js +29 -9
- package/lib/utils/nft-staking/user-entry.d.ts +3 -3
- package/lib/utils/nft-staking/user-entry.js +6 -6
- package/lib/utils/tails-exp-dice/fetch.d.ts +1 -0
- package/lib/utils/tails-exp-dice/fetch.js +9 -6
- package/lib/utils/token.js +4 -0
- package/lib/utils/typus-dov-single-v2/authorized-entry.d.ts +1 -0
- package/lib/utils/typus-dov-single-v2/authorized-entry.js +1 -0
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.d.ts +125 -0
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.js +269 -0
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +118 -15
- package/lib/utils/typus-dov-single-v2/user-entry.js +235 -199
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
|
-
export declare function getSetProfitSharingTx(gasBudget: number, packageId: string, registry: string, level_profits: number[], amount: number): Promise<TransactionBlock>;
|
|
3
|
-
export declare function getAllocateProfitSharingTx(gasBudget: number, packageId: string, registry: string, users: string[]): Promise<TransactionBlock>;
|
|
2
|
+
export declare function getSetProfitSharingTx(gasBudget: number, packageId: string, registry: string, level_profits: number[], amount: number, coins: string[], typeArguments: string[], typeArgumentsRemove: string[]): Promise<TransactionBlock>;
|
|
3
|
+
export declare function getAllocateProfitSharingTx(gasBudget: number, packageId: string, registry: string, users: string[], typeArguments: string[]): Promise<TransactionBlock>;
|
|
@@ -54,31 +54,51 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
55
|
exports.getAllocateProfitSharingTx = exports.getSetProfitSharingTx = void 0;
|
|
56
56
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
57
|
-
function getSetProfitSharingTx(gasBudget, packageId, registry, level_profits, amount) {
|
|
57
|
+
function getSetProfitSharingTx(gasBudget, packageId, registry, level_profits, amount, coins, typeArguments, typeArgumentsRemove) {
|
|
58
58
|
return __awaiter(this, void 0, void 0, function () {
|
|
59
|
-
var tx, _a, coin;
|
|
60
|
-
return __generator(this, function (
|
|
59
|
+
var tx, _a, input_coin, coin, _b, input_coin;
|
|
60
|
+
return __generator(this, function (_c) {
|
|
61
61
|
tx = new transactions_1.TransactionBlock();
|
|
62
|
-
_a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
|
|
63
62
|
tx.moveCall({
|
|
64
|
-
target: "".concat(packageId, "::tails_staking::
|
|
65
|
-
typeArguments:
|
|
66
|
-
arguments: [tx.object(registry)
|
|
63
|
+
target: "".concat(packageId, "::tails_staking::remove_profit_sharing"),
|
|
64
|
+
typeArguments: typeArgumentsRemove,
|
|
65
|
+
arguments: [tx.object(registry)],
|
|
67
66
|
});
|
|
67
|
+
if (typeArguments[0] == "0x2::sui::SUI" ||
|
|
68
|
+
typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI") {
|
|
69
|
+
_a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), input_coin = _a[0];
|
|
70
|
+
tx.moveCall({
|
|
71
|
+
target: "".concat(packageId, "::tails_staking::set_profit_sharing"),
|
|
72
|
+
typeArguments: typeArguments,
|
|
73
|
+
arguments: [tx.object(registry), tx.pure(level_profits), input_coin],
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
coin = coins.pop();
|
|
78
|
+
if (coins.length > 0) {
|
|
79
|
+
tx.mergeCoins(tx.object(coin), coins.map(function (id) { return tx.object(id); }));
|
|
80
|
+
}
|
|
81
|
+
_b = __read(tx.splitCoins(tx.object(coin), [tx.pure(amount)]), 1), input_coin = _b[0];
|
|
82
|
+
tx.moveCall({
|
|
83
|
+
target: "".concat(packageId, "::tails_staking::set_profit_sharing"),
|
|
84
|
+
typeArguments: typeArguments,
|
|
85
|
+
arguments: [tx.object(registry), tx.pure(level_profits), input_coin],
|
|
86
|
+
});
|
|
87
|
+
}
|
|
68
88
|
tx.setGasBudget(gasBudget);
|
|
69
89
|
return [2 /*return*/, tx];
|
|
70
90
|
});
|
|
71
91
|
});
|
|
72
92
|
}
|
|
73
93
|
exports.getSetProfitSharingTx = getSetProfitSharingTx;
|
|
74
|
-
function getAllocateProfitSharingTx(gasBudget, packageId, registry, users) {
|
|
94
|
+
function getAllocateProfitSharingTx(gasBudget, packageId, registry, users, typeArguments) {
|
|
75
95
|
return __awaiter(this, void 0, void 0, function () {
|
|
76
96
|
var tx;
|
|
77
97
|
return __generator(this, function (_a) {
|
|
78
98
|
tx = new transactions_1.TransactionBlock();
|
|
79
99
|
tx.moveCall({
|
|
80
100
|
target: "".concat(packageId, "::tails_staking::allocate_profit_sharing"),
|
|
81
|
-
typeArguments:
|
|
101
|
+
typeArguments: typeArguments,
|
|
82
102
|
arguments: [tx.object(registry), tx.pure(users)],
|
|
83
103
|
});
|
|
84
104
|
tx.setGasBudget(gasBudget);
|
|
@@ -23,7 +23,7 @@ export declare function getTransferNftsTx(gasBudget: number, nftPackageId: strin
|
|
|
23
23
|
)
|
|
24
24
|
*/
|
|
25
25
|
export declare function getStakeNftTx(gasBudget: number, nftPackageId: string, registry: string, kiosk: string, kiosk_cap: string, nft_id: string): Promise<TransactionBlock>;
|
|
26
|
-
export declare function getSwitchNftTx(gasBudget: number, nftPackageId: string, registry: string, kiosk: string, kiosk_cap: string, nft_id: string): Promise<TransactionBlock>;
|
|
26
|
+
export declare function getSwitchNftTx(gasBudget: number, nftPackageId: string, registry: string, kiosk: string, kiosk_cap: string, nft_id: string, typeArguments: string[]): Promise<TransactionBlock>;
|
|
27
27
|
export declare function getCreateKioskAndLockNftTx(kioskClient: KioskClient, gasBudget: number, nftPackageId: string, policy: string, nft_id: string, singer: string): Promise<TransactionBlock>;
|
|
28
28
|
/**
|
|
29
29
|
public fun unstake_nft(
|
|
@@ -34,7 +34,7 @@ export declare function getCreateKioskAndLockNftTx(kioskClient: KioskClient, gas
|
|
|
34
34
|
ctx: &mut TxContext
|
|
35
35
|
)
|
|
36
36
|
*/
|
|
37
|
-
export declare function getUnstakeNftTx(gasBudget: number, nftPackageId: string, registry: string, kiosk: string, kiosk_cap: string): Promise<TransactionBlock>;
|
|
37
|
+
export declare function getUnstakeNftTx(gasBudget: number, nftPackageId: string, registry: string, kiosk: string, kiosk_cap: string, typeArguments: string[]): Promise<TransactionBlock>;
|
|
38
38
|
/**
|
|
39
39
|
public fun daily_attend(
|
|
40
40
|
registry: &mut Registry,
|
|
@@ -83,4 +83,4 @@ export declare function consumeExpCoinUnstakedTx(gasBudget: number, nftPackageId
|
|
|
83
83
|
)
|
|
84
84
|
*/
|
|
85
85
|
export declare function consumeExpCoinStakedTx(gasBudget: number, nftPackageId: string, typeArguments: string[], registry: string, exp_coins: string[], amount: string): Promise<TransactionBlock>;
|
|
86
|
-
export declare function getClaimProfitSharingTx(gasBudget: number, packageId: string, registry: string): Promise<TransactionBlock>;
|
|
86
|
+
export declare function getClaimProfitSharingTx(gasBudget: number, packageId: string, registry: string, typeArguments: string[]): Promise<TransactionBlock>;
|
|
@@ -131,7 +131,7 @@ function getStakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, nft_
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
exports.getStakeNftTx = getStakeNftTx;
|
|
134
|
-
function getSwitchNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, nft_id) {
|
|
134
|
+
function getSwitchNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, nft_id, typeArguments) {
|
|
135
135
|
return __awaiter(this, void 0, void 0, function () {
|
|
136
136
|
var tx, _a, coin;
|
|
137
137
|
return __generator(this, function (_b) {
|
|
@@ -144,7 +144,7 @@ function getSwitchNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, nft
|
|
|
144
144
|
});
|
|
145
145
|
tx.moveCall({
|
|
146
146
|
target: "".concat(nftPackageId, "::tails_staking::claim_profit_sharing"),
|
|
147
|
-
typeArguments:
|
|
147
|
+
typeArguments: typeArguments,
|
|
148
148
|
arguments: [tx.object(registry)],
|
|
149
149
|
});
|
|
150
150
|
tx.moveCall({
|
|
@@ -193,7 +193,7 @@ exports.getCreateKioskAndLockNftTx = getCreateKioskAndLockNftTx;
|
|
|
193
193
|
ctx: &mut TxContext
|
|
194
194
|
)
|
|
195
195
|
*/
|
|
196
|
-
function getUnstakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap) {
|
|
196
|
+
function getUnstakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, typeArguments) {
|
|
197
197
|
return __awaiter(this, void 0, void 0, function () {
|
|
198
198
|
var tx;
|
|
199
199
|
return __generator(this, function (_a) {
|
|
@@ -205,7 +205,7 @@ function getUnstakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap) {
|
|
|
205
205
|
});
|
|
206
206
|
tx.moveCall({
|
|
207
207
|
target: "".concat(nftPackageId, "::tails_staking::claim_profit_sharing"),
|
|
208
|
-
typeArguments:
|
|
208
|
+
typeArguments: typeArguments,
|
|
209
209
|
arguments: [tx.object(registry)],
|
|
210
210
|
});
|
|
211
211
|
tx.moveCall({
|
|
@@ -495,14 +495,14 @@ function consumeExpCoinStakedTx(gasBudget, nftPackageId, typeArguments, registry
|
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
497
|
exports.consumeExpCoinStakedTx = consumeExpCoinStakedTx;
|
|
498
|
-
function getClaimProfitSharingTx(gasBudget, packageId, registry) {
|
|
498
|
+
function getClaimProfitSharingTx(gasBudget, packageId, registry, typeArguments) {
|
|
499
499
|
return __awaiter(this, void 0, void 0, function () {
|
|
500
500
|
var tx;
|
|
501
501
|
return __generator(this, function (_a) {
|
|
502
502
|
tx = new transactions_1.TransactionBlock();
|
|
503
503
|
tx.moveCall({
|
|
504
504
|
target: "".concat(packageId, "::tails_staking::claim_profit_sharing"),
|
|
505
|
-
typeArguments:
|
|
505
|
+
typeArguments: typeArguments,
|
|
506
506
|
arguments: [tx.object(registry)],
|
|
507
507
|
});
|
|
508
508
|
tx.setGasBudget(gasBudget);
|
|
@@ -54,6 +54,7 @@ export interface ProfitSharing {
|
|
|
54
54
|
pool: string;
|
|
55
55
|
remaining: string;
|
|
56
56
|
total: string;
|
|
57
|
+
tokenType: string;
|
|
57
58
|
}
|
|
58
59
|
export declare function getProfitSharing(provider: SuiClient, diceProfitSharing: string): Promise<ProfitSharing>;
|
|
59
60
|
export declare function calculateLevelReward(totalRewards: number, levelShares: number[], numOfHolders: number[]): number[];
|
|
@@ -246,18 +246,21 @@ function getLeaderBoard(drawDisplays) {
|
|
|
246
246
|
}
|
|
247
247
|
exports.getLeaderBoard = getLeaderBoard;
|
|
248
248
|
function getProfitSharing(provider, diceProfitSharing) {
|
|
249
|
-
var _a, _b;
|
|
249
|
+
var _a, _b, _c, _d;
|
|
250
250
|
return __awaiter(this, void 0, void 0, function () {
|
|
251
|
-
var object, result;
|
|
252
|
-
return __generator(this, function (
|
|
253
|
-
switch (
|
|
251
|
+
var object, type, tokenType, result;
|
|
252
|
+
return __generator(this, function (_e) {
|
|
253
|
+
switch (_e.label) {
|
|
254
254
|
case 0: return [4 /*yield*/, provider.getObject({
|
|
255
255
|
id: diceProfitSharing,
|
|
256
256
|
options: { showContent: true },
|
|
257
257
|
})];
|
|
258
258
|
case 1:
|
|
259
|
-
object =
|
|
260
|
-
|
|
259
|
+
object = _e.sent();
|
|
260
|
+
type = (_a = object.data) === null || _a === void 0 ? void 0 : _a.content.type;
|
|
261
|
+
tokenType = (_b = type.split("<").at(-1)) === null || _b === void 0 ? void 0 : _b.replace(">>", "");
|
|
262
|
+
result = (_d = (_c = object.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields.value.fields;
|
|
263
|
+
result.tokenType = tokenType;
|
|
261
264
|
return [2 /*return*/, result];
|
|
262
265
|
}
|
|
263
266
|
});
|
package/lib/utils/token.js
CHANGED
|
@@ -24,6 +24,10 @@ function typeArgToAsset(typeArg) {
|
|
|
24
24
|
return "TURBOS";
|
|
25
25
|
case "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37":
|
|
26
26
|
return "APT";
|
|
27
|
+
case "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1":
|
|
28
|
+
return "FUD";
|
|
29
|
+
case "0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc":
|
|
30
|
+
return "AFSUI";
|
|
27
31
|
default:
|
|
28
32
|
if (typeArgs[2] == "BTC") {
|
|
29
33
|
return "WBTC";
|
|
@@ -64,6 +64,7 @@ export interface UpdateConfigRequests {
|
|
|
64
64
|
capacity?: string;
|
|
65
65
|
leverage?: string;
|
|
66
66
|
riskLevel?: string;
|
|
67
|
+
depositIncentiveBpDivisorDecimal?: string;
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
export declare function getUpdateConfigTx(gasBudget: number, packageId: string, registry: string, requests: UpdateConfigRequests[]): Promise<TransactionBlock>;
|
|
@@ -156,6 +156,7 @@ function getUpdateConfigTx(gasBudget, packageId, registry, requests) {
|
|
|
156
156
|
tx.pure(request.config.capacity ? [request.config.capacity] : []),
|
|
157
157
|
tx.pure(request.config.leverage ? [request.config.leverage] : []),
|
|
158
158
|
tx.pure(request.config.riskLevel ? [request.config.riskLevel] : []),
|
|
159
|
+
tx.pure(request.config.depositIncentiveBpDivisorDecimal ? [request.config.depositIncentiveBpDivisorDecimal] : []),
|
|
159
160
|
],
|
|
160
161
|
});
|
|
161
162
|
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { TransactionBlock, TransactionObjectArgument } from "@mysten/sui.js/transactions";
|
|
2
|
+
export declare function getDepositTx(input: {
|
|
3
|
+
tx: TransactionBlock;
|
|
4
|
+
typusFrameworkOriginPackageId: string;
|
|
5
|
+
typusDovSinglePackageId: string;
|
|
6
|
+
typusDovSingleRegistry: string;
|
|
7
|
+
mfudPackageId: string;
|
|
8
|
+
mfudRegistry: string;
|
|
9
|
+
mfudAmount: string;
|
|
10
|
+
typeArguments: string[];
|
|
11
|
+
index: string;
|
|
12
|
+
receipts: string[] | TransactionObjectArgument[];
|
|
13
|
+
user: string;
|
|
14
|
+
coins: string[];
|
|
15
|
+
}): TransactionBlock;
|
|
16
|
+
export declare function getWithdrawTx(input: {
|
|
17
|
+
tx: TransactionBlock;
|
|
18
|
+
typusFrameworkOriginPackageId: string;
|
|
19
|
+
typusFrameworkPackageId: string;
|
|
20
|
+
typusDovSinglePackageId: string;
|
|
21
|
+
typusDovSingleRegistry: string;
|
|
22
|
+
mfudPackageId: string;
|
|
23
|
+
mfudRegistry: string;
|
|
24
|
+
typeArguments: string[];
|
|
25
|
+
index: string;
|
|
26
|
+
receipts: string[] | TransactionObjectArgument[];
|
|
27
|
+
user: string;
|
|
28
|
+
amount?: string;
|
|
29
|
+
}): TransactionBlock;
|
|
30
|
+
export declare function getUnsubscribeTx(input: {
|
|
31
|
+
tx: TransactionBlock;
|
|
32
|
+
typusFrameworkOriginPackageId: string;
|
|
33
|
+
typusDovSinglePackageId: string;
|
|
34
|
+
typusDovSingleRegistry: string;
|
|
35
|
+
typeArguments: string[];
|
|
36
|
+
index: string;
|
|
37
|
+
receipts: string[] | TransactionObjectArgument[];
|
|
38
|
+
user: string;
|
|
39
|
+
amount?: string;
|
|
40
|
+
}): TransactionBlock;
|
|
41
|
+
export declare function getCompoundTx(input: {
|
|
42
|
+
tx: TransactionBlock;
|
|
43
|
+
typusFrameworkOriginPackageId: string;
|
|
44
|
+
typusDovSinglePackageId: string;
|
|
45
|
+
typusDovSingleRegistry: string;
|
|
46
|
+
typeArguments: string[];
|
|
47
|
+
index: string;
|
|
48
|
+
receipts: string[] | TransactionObjectArgument[];
|
|
49
|
+
user: string;
|
|
50
|
+
}): TransactionBlock;
|
|
51
|
+
export declare function getClaimTx(input: {
|
|
52
|
+
tx: TransactionBlock;
|
|
53
|
+
typusFrameworkOriginPackageId: string;
|
|
54
|
+
typusFrameworkPackageId: string;
|
|
55
|
+
typusDovSinglePackageId: string;
|
|
56
|
+
typusDovSingleRegistry: string;
|
|
57
|
+
mfudPackageId: string;
|
|
58
|
+
mfudRegistry: string;
|
|
59
|
+
typeArguments: string[];
|
|
60
|
+
index: string;
|
|
61
|
+
receipts: string[] | TransactionObjectArgument[];
|
|
62
|
+
user: string;
|
|
63
|
+
}): TransactionBlock;
|
|
64
|
+
export declare function getHarvestTx(input: {
|
|
65
|
+
tx: TransactionBlock;
|
|
66
|
+
typusFrameworkOriginPackageId: string;
|
|
67
|
+
typusFrameworkPackageId: string;
|
|
68
|
+
typusDovSinglePackageId: string;
|
|
69
|
+
typusDovSingleRegistry: string;
|
|
70
|
+
mfudPackageId: string;
|
|
71
|
+
mfudRegistry: string;
|
|
72
|
+
typeArguments: string[];
|
|
73
|
+
index: string;
|
|
74
|
+
receipts: string[] | TransactionObjectArgument[];
|
|
75
|
+
user: string;
|
|
76
|
+
}): TransactionBlock;
|
|
77
|
+
export declare function getRedeemTx(input: {
|
|
78
|
+
tx: TransactionBlock;
|
|
79
|
+
typusFrameworkOriginPackageId: string;
|
|
80
|
+
typusFrameworkPackageId: string;
|
|
81
|
+
typusDovSinglePackageId: string;
|
|
82
|
+
typusDovSingleRegistry: string;
|
|
83
|
+
mfudPackageId: string;
|
|
84
|
+
mfudRegistry: string;
|
|
85
|
+
typeArguments: string[];
|
|
86
|
+
index: string;
|
|
87
|
+
receipts: string[] | TransactionObjectArgument[];
|
|
88
|
+
user: string;
|
|
89
|
+
}): TransactionBlock;
|
|
90
|
+
export declare function getNewBidTx(input: {
|
|
91
|
+
tx: TransactionBlock;
|
|
92
|
+
typusDovSinglePackageId: string;
|
|
93
|
+
typusDovSingleRegistry: string;
|
|
94
|
+
mfudPackageId: string;
|
|
95
|
+
mfudRegistry: string;
|
|
96
|
+
typeArguments: string[];
|
|
97
|
+
index: string;
|
|
98
|
+
coins: string[];
|
|
99
|
+
size: string;
|
|
100
|
+
premium_required: string;
|
|
101
|
+
user: string;
|
|
102
|
+
}): TransactionBlock;
|
|
103
|
+
export declare function getExerciseTx(input: {
|
|
104
|
+
tx: TransactionBlock;
|
|
105
|
+
typusFrameworkOriginPackageId: string;
|
|
106
|
+
typusFrameworkPackageId: string;
|
|
107
|
+
typusDovSinglePackageId: string;
|
|
108
|
+
typusDovSingleRegistry: string;
|
|
109
|
+
mfudPackageId: string;
|
|
110
|
+
mfudRegistry: string;
|
|
111
|
+
typeArguments: string[];
|
|
112
|
+
index: string;
|
|
113
|
+
receipts: string[] | TransactionObjectArgument[];
|
|
114
|
+
user: string;
|
|
115
|
+
}): TransactionBlock;
|
|
116
|
+
export declare function getRebateTx(input: {
|
|
117
|
+
tx: TransactionBlock;
|
|
118
|
+
typusFrameworkPackageId: string;
|
|
119
|
+
typusDovSinglePackageId: string;
|
|
120
|
+
typusDovSingleRegistry: string;
|
|
121
|
+
mfudPackageId: string;
|
|
122
|
+
mfudRegistry: string;
|
|
123
|
+
typeArgument: string;
|
|
124
|
+
user: string;
|
|
125
|
+
}): TransactionBlock;
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRebateTx = exports.getExerciseTx = exports.getNewBidTx = exports.getRedeemTx = exports.getHarvestTx = exports.getClaimTx = exports.getCompoundTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
4
|
+
var constants_1 = require("../../constants");
|
|
5
|
+
function getDepositTx(input) {
|
|
6
|
+
var mfud = input.tx.moveCall({
|
|
7
|
+
target: "".concat(input.mfudPackageId, "::mfud::mint"),
|
|
8
|
+
arguments: [
|
|
9
|
+
input.tx.object(input.mfudRegistry),
|
|
10
|
+
input.tx.makeMoveVec({ objects: input.coins.map(function (id) { return input.tx.object(id); }) }),
|
|
11
|
+
input.tx.pure(input.mfudAmount),
|
|
12
|
+
],
|
|
13
|
+
});
|
|
14
|
+
var result = input.tx.moveCall({
|
|
15
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::deposit"),
|
|
16
|
+
typeArguments: input.typeArguments,
|
|
17
|
+
arguments: [
|
|
18
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
19
|
+
input.tx.pure(input.index),
|
|
20
|
+
input.tx.makeMoveVec({ objects: [mfud] }),
|
|
21
|
+
input.tx.pure(input.mfudAmount),
|
|
22
|
+
input.tx.makeMoveVec({
|
|
23
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
24
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
25
|
+
}),
|
|
26
|
+
input.tx.pure(constants_1.CLOCK),
|
|
27
|
+
],
|
|
28
|
+
});
|
|
29
|
+
input.tx.moveCall({
|
|
30
|
+
target: "0x1::vector::destroy_empty",
|
|
31
|
+
typeArguments: ["0x2::coin::Coin<" + input.typeArguments[0] + ">"],
|
|
32
|
+
arguments: [input.tx.object(result[0])],
|
|
33
|
+
});
|
|
34
|
+
input.tx.transferObjects([input.tx.object(result[1])], input.user);
|
|
35
|
+
return input.tx;
|
|
36
|
+
}
|
|
37
|
+
exports.getDepositTx = getDepositTx;
|
|
38
|
+
function getWithdrawTx(input) {
|
|
39
|
+
var result = input.tx.moveCall({
|
|
40
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::withdraw"),
|
|
41
|
+
typeArguments: input.typeArguments,
|
|
42
|
+
arguments: [
|
|
43
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
44
|
+
input.tx.pure(input.index),
|
|
45
|
+
input.tx.makeMoveVec({
|
|
46
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
47
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
48
|
+
}),
|
|
49
|
+
input.tx.pure(input.amount ? [input.amount] : []),
|
|
50
|
+
input.tx.pure(constants_1.CLOCK),
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
var mfud_coin = input.tx.moveCall({
|
|
54
|
+
target: "0x2::coin::from_balance",
|
|
55
|
+
typeArguments: [input.typeArguments[0]],
|
|
56
|
+
arguments: [input.tx.object(result[0])],
|
|
57
|
+
});
|
|
58
|
+
var fud_coin = input.tx.moveCall({
|
|
59
|
+
target: "".concat(input.mfudPackageId, "::mfud::burn"),
|
|
60
|
+
arguments: [input.tx.object(input.mfudRegistry), input.tx.object(mfud_coin)],
|
|
61
|
+
});
|
|
62
|
+
input.tx.transferObjects([input.tx.object(fud_coin)], input.user);
|
|
63
|
+
input.tx.moveCall({
|
|
64
|
+
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
65
|
+
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
66
|
+
});
|
|
67
|
+
return input.tx;
|
|
68
|
+
}
|
|
69
|
+
exports.getWithdrawTx = getWithdrawTx;
|
|
70
|
+
function getUnsubscribeTx(input) {
|
|
71
|
+
var result = input.tx.moveCall({
|
|
72
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::unsubscribe"),
|
|
73
|
+
typeArguments: input.typeArguments,
|
|
74
|
+
arguments: [
|
|
75
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
76
|
+
input.tx.pure(input.index),
|
|
77
|
+
input.tx.makeMoveVec({
|
|
78
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
79
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
80
|
+
}),
|
|
81
|
+
input.tx.pure(input.amount ? [input.amount] : []),
|
|
82
|
+
input.tx.pure(constants_1.CLOCK),
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
input.tx.transferObjects([input.tx.object(result[0])], input.user);
|
|
86
|
+
return input.tx;
|
|
87
|
+
}
|
|
88
|
+
exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
89
|
+
function getCompoundTx(input) {
|
|
90
|
+
var result = input.tx.moveCall({
|
|
91
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::compound"),
|
|
92
|
+
typeArguments: input.typeArguments,
|
|
93
|
+
arguments: [
|
|
94
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
95
|
+
input.tx.pure(input.index),
|
|
96
|
+
input.tx.makeMoveVec({
|
|
97
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
98
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
99
|
+
}),
|
|
100
|
+
input.tx.object(constants_1.CLOCK),
|
|
101
|
+
],
|
|
102
|
+
});
|
|
103
|
+
input.tx.transferObjects([input.tx.object(result[0])], input.user);
|
|
104
|
+
return input.tx;
|
|
105
|
+
}
|
|
106
|
+
exports.getCompoundTx = getCompoundTx;
|
|
107
|
+
function getClaimTx(input) {
|
|
108
|
+
var result = input.tx.moveCall({
|
|
109
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::claim"),
|
|
110
|
+
typeArguments: input.typeArguments,
|
|
111
|
+
arguments: [
|
|
112
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
113
|
+
input.tx.pure(input.index),
|
|
114
|
+
input.tx.makeMoveVec({
|
|
115
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
116
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
117
|
+
}),
|
|
118
|
+
],
|
|
119
|
+
});
|
|
120
|
+
var mfud_coin = input.tx.moveCall({
|
|
121
|
+
target: "0x2::coin::from_balance",
|
|
122
|
+
typeArguments: [input.typeArguments[0]],
|
|
123
|
+
arguments: [input.tx.object(result[0])],
|
|
124
|
+
});
|
|
125
|
+
var fud_coin = input.tx.moveCall({
|
|
126
|
+
target: "".concat(input.mfudPackageId, "::mfud::burn"),
|
|
127
|
+
arguments: [input.tx.object(input.mfudRegistry), input.tx.object(mfud_coin)],
|
|
128
|
+
});
|
|
129
|
+
input.tx.transferObjects([input.tx.object(fud_coin)], input.user);
|
|
130
|
+
input.tx.moveCall({
|
|
131
|
+
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
132
|
+
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
133
|
+
});
|
|
134
|
+
return input.tx;
|
|
135
|
+
}
|
|
136
|
+
exports.getClaimTx = getClaimTx;
|
|
137
|
+
function getHarvestTx(input) {
|
|
138
|
+
var result = input.tx.moveCall({
|
|
139
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::harvest"),
|
|
140
|
+
typeArguments: input.typeArguments,
|
|
141
|
+
arguments: [
|
|
142
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
143
|
+
input.tx.pure(input.index),
|
|
144
|
+
input.tx.makeMoveVec({
|
|
145
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
146
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
147
|
+
}),
|
|
148
|
+
],
|
|
149
|
+
});
|
|
150
|
+
var mfud_coin = input.tx.moveCall({
|
|
151
|
+
target: "0x2::coin::from_balance",
|
|
152
|
+
typeArguments: [input.typeArguments[1]],
|
|
153
|
+
arguments: [input.tx.object(result[0])],
|
|
154
|
+
});
|
|
155
|
+
var fud_coin = input.tx.moveCall({
|
|
156
|
+
target: "".concat(input.mfudPackageId, "::mfud::burn"),
|
|
157
|
+
arguments: [input.tx.object(input.mfudRegistry), input.tx.object(mfud_coin)],
|
|
158
|
+
});
|
|
159
|
+
input.tx.transferObjects([input.tx.object(fud_coin)], input.user);
|
|
160
|
+
input.tx.moveCall({
|
|
161
|
+
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
162
|
+
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
163
|
+
});
|
|
164
|
+
return input.tx;
|
|
165
|
+
}
|
|
166
|
+
exports.getHarvestTx = getHarvestTx;
|
|
167
|
+
function getRedeemTx(input) {
|
|
168
|
+
var result = input.tx.moveCall({
|
|
169
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::redeem"),
|
|
170
|
+
typeArguments: input.typeArguments,
|
|
171
|
+
arguments: [
|
|
172
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
173
|
+
input.tx.pure(input.index),
|
|
174
|
+
input.tx.makeMoveVec({
|
|
175
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
176
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
177
|
+
}),
|
|
178
|
+
],
|
|
179
|
+
});
|
|
180
|
+
var mfud_coin = input.tx.moveCall({
|
|
181
|
+
target: "0x2::coin::from_balance",
|
|
182
|
+
typeArguments: [input.typeArguments[2]],
|
|
183
|
+
arguments: [input.tx.object(result[0])],
|
|
184
|
+
});
|
|
185
|
+
var fud_coin = input.tx.moveCall({
|
|
186
|
+
target: "".concat(input.mfudPackageId, "::mfud::burn"),
|
|
187
|
+
arguments: [input.tx.object(input.mfudRegistry), input.tx.object(mfud_coin)],
|
|
188
|
+
});
|
|
189
|
+
input.tx.transferObjects([input.tx.object(fud_coin)], input.user);
|
|
190
|
+
input.tx.moveCall({
|
|
191
|
+
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
192
|
+
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
193
|
+
});
|
|
194
|
+
return input.tx;
|
|
195
|
+
}
|
|
196
|
+
exports.getRedeemTx = getRedeemTx;
|
|
197
|
+
function getNewBidTx(input) {
|
|
198
|
+
var mfud = input.tx.moveCall({
|
|
199
|
+
target: "".concat(input.mfudPackageId, "::mfud::mint"),
|
|
200
|
+
arguments: [
|
|
201
|
+
input.tx.object(input.mfudRegistry),
|
|
202
|
+
input.tx.makeMoveVec({ objects: input.coins.map(function (id) { return input.tx.object(id); }) }),
|
|
203
|
+
input.tx.pure(input.premium_required),
|
|
204
|
+
],
|
|
205
|
+
});
|
|
206
|
+
var result = input.tx.moveCall({
|
|
207
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::new_bid"),
|
|
208
|
+
typeArguments: input.typeArguments,
|
|
209
|
+
arguments: [
|
|
210
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
211
|
+
input.tx.pure(input.index),
|
|
212
|
+
input.tx.makeMoveVec({ objects: [mfud] }),
|
|
213
|
+
input.tx.pure(input.size),
|
|
214
|
+
input.tx.pure("0x6"),
|
|
215
|
+
],
|
|
216
|
+
});
|
|
217
|
+
input.tx.transferObjects([input.tx.object(result[0])], input.user);
|
|
218
|
+
return input.tx;
|
|
219
|
+
}
|
|
220
|
+
exports.getNewBidTx = getNewBidTx;
|
|
221
|
+
function getExerciseTx(input) {
|
|
222
|
+
var result = input.tx.moveCall({
|
|
223
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::exercise"),
|
|
224
|
+
typeArguments: input.typeArguments,
|
|
225
|
+
arguments: [
|
|
226
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
227
|
+
input.tx.pure(input.index),
|
|
228
|
+
input.tx.makeMoveVec({
|
|
229
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusBidReceipt"),
|
|
230
|
+
objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
|
|
231
|
+
}),
|
|
232
|
+
],
|
|
233
|
+
});
|
|
234
|
+
var mfud_coin = input.tx.moveCall({
|
|
235
|
+
target: "0x2::coin::from_balance",
|
|
236
|
+
typeArguments: [input.typeArguments[0]],
|
|
237
|
+
arguments: [input.tx.object(result[0])],
|
|
238
|
+
});
|
|
239
|
+
var fud_coin = input.tx.moveCall({
|
|
240
|
+
target: "".concat(input.mfudPackageId, "::mfud::burn"),
|
|
241
|
+
arguments: [input.tx.object(input.mfudRegistry), input.tx.object(mfud_coin)],
|
|
242
|
+
});
|
|
243
|
+
input.tx.transferObjects([input.tx.object(fud_coin)], input.user);
|
|
244
|
+
return input.tx;
|
|
245
|
+
}
|
|
246
|
+
exports.getExerciseTx = getExerciseTx;
|
|
247
|
+
function getRebateTx(input) {
|
|
248
|
+
var result = input.tx.moveCall({
|
|
249
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::rebate"),
|
|
250
|
+
typeArguments: [input.typeArgument],
|
|
251
|
+
arguments: [input.tx.object(input.typusDovSingleRegistry)],
|
|
252
|
+
});
|
|
253
|
+
var balance = input.tx.moveCall({
|
|
254
|
+
target: "0x1::option::destroy_some",
|
|
255
|
+
arguments: [input.tx.object(result[0])],
|
|
256
|
+
});
|
|
257
|
+
var mfud_coin = input.tx.moveCall({
|
|
258
|
+
target: "0x2::coin::from_balance",
|
|
259
|
+
typeArguments: [input.typeArgument],
|
|
260
|
+
arguments: [input.tx.object(balance)],
|
|
261
|
+
});
|
|
262
|
+
var fud_coin = input.tx.moveCall({
|
|
263
|
+
target: "".concat(input.mfudPackageId, "::mfud::burn"),
|
|
264
|
+
arguments: [input.tx.object(input.mfudRegistry), input.tx.object(mfud_coin)],
|
|
265
|
+
});
|
|
266
|
+
input.tx.transferObjects([input.tx.object(fud_coin)], input.user);
|
|
267
|
+
return input.tx;
|
|
268
|
+
}
|
|
269
|
+
exports.getRebateTx = getRebateTx;
|