@typus/typus-sdk 1.2.85-tails-exp → 1.2.85
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/config.json +3 -1
- package/lib/utils/api/sentio/reward-generated.js +4 -24
- package/lib/utils/nft-staking/user-entry.d.ts +2 -2
- package/lib/utils/nft-staking/user-entry.js +13 -13
- package/lib/utils/token.js +2 -0
- package/lib/utils/tools.d.ts +4 -0
- package/lib/utils/tools.js +26 -1
- package/lib/utils/typus-dov-single-v2/function/bidding.d.ts +143 -0
- package/lib/utils/typus-dov-single-v2/function/bidding.js +822 -0
- package/lib/utils/typus-dov-single-v2/function/token.d.ts +21 -0
- package/lib/utils/typus-dov-single-v2/function/token.js +36 -0
- package/lib/utils/typus-dov-single-v2/function/vault.d.ts +8 -0
- package/lib/utils/typus-dov-single-v2/function/vault.js +23 -0
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.d.ts +62 -29
- package/lib/utils/typus-dov-single-v2/mfud-user-entry.js +226 -106
- package/lib/utils/typus-dov-single-v2/user-entry.d.ts +130 -37
- package/lib/utils/typus-dov-single-v2/user-entry.js +352 -57
- package/lib/utils/user/view-functions.d.ts +1 -1
- package/lib/utils/user/view-functions.js +3 -3
- package/package.json +5 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const WrappedToken: {
|
|
2
|
+
[key: string]: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const UnwrappedToken: {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const MillionToken: {
|
|
8
|
+
[key: string]: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const RemoveMillionToken: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const LST: {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const StableCoin: string[];
|
|
17
|
+
export declare const getTokenName: ({ token, wrapped, million }: {
|
|
18
|
+
token: string;
|
|
19
|
+
wrapped?: boolean | undefined;
|
|
20
|
+
million?: boolean | undefined;
|
|
21
|
+
}) => string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTokenName = exports.StableCoin = exports.LST = exports.RemoveMillionToken = exports.MillionToken = exports.UnwrappedToken = exports.WrappedToken = void 0;
|
|
4
|
+
exports.WrappedToken = {
|
|
5
|
+
ETH: "WETH",
|
|
6
|
+
BTC: "WBTC",
|
|
7
|
+
SOL: "WSOL",
|
|
8
|
+
};
|
|
9
|
+
exports.UnwrappedToken = {
|
|
10
|
+
WETH: "ETH",
|
|
11
|
+
WBTC: "BTC",
|
|
12
|
+
WSOL: "SOL",
|
|
13
|
+
};
|
|
14
|
+
exports.MillionToken = {
|
|
15
|
+
FUD: "MFUD",
|
|
16
|
+
};
|
|
17
|
+
exports.RemoveMillionToken = {
|
|
18
|
+
MFUD: "FUD",
|
|
19
|
+
};
|
|
20
|
+
exports.LST = {
|
|
21
|
+
AFSUI: "SUI",
|
|
22
|
+
};
|
|
23
|
+
exports.StableCoin = ["USDC", "USDT", "BUCK", "USDY"];
|
|
24
|
+
var getTokenName = function (_a) {
|
|
25
|
+
var _b, _c, _d, _e;
|
|
26
|
+
var token = _a.token, wrapped = _a.wrapped, million = _a.million;
|
|
27
|
+
var tokenName = token;
|
|
28
|
+
if (wrapped) {
|
|
29
|
+
tokenName = (_b = exports.WrappedToken[token]) !== null && _b !== void 0 ? _b : token;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
tokenName = (_c = exports.UnwrappedToken[token]) !== null && _c !== void 0 ? _c : token;
|
|
33
|
+
}
|
|
34
|
+
return million ? (_d = exports.MillionToken[tokenName]) !== null && _d !== void 0 ? _d : tokenName : (_e = exports.RemoveMillionToken[tokenName]) !== null && _e !== void 0 ? _e : tokenName;
|
|
35
|
+
};
|
|
36
|
+
exports.getTokenName = getTokenName;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseAssets = exports.AbbrStrategyName = exports.Period = void 0;
|
|
4
|
+
var token_1 = require("../../token");
|
|
5
|
+
exports.Period = {
|
|
6
|
+
0: "daily",
|
|
7
|
+
1: "weekly",
|
|
8
|
+
2: "monthly",
|
|
9
|
+
3: "hourly",
|
|
10
|
+
};
|
|
11
|
+
exports.AbbrStrategyName = {
|
|
12
|
+
0: "Call",
|
|
13
|
+
1: "Put",
|
|
14
|
+
2: "Call Spread",
|
|
15
|
+
4: "Capped Call",
|
|
16
|
+
5: "Capped Put",
|
|
17
|
+
6: "Capped Call",
|
|
18
|
+
};
|
|
19
|
+
var parseAssets = function (info) {
|
|
20
|
+
var dToken = info.depositToken, bToken = info.bidToken, oToken = info.settlementBase;
|
|
21
|
+
return (0, token_1.typeArgsToAssets)([dToken, bToken, oToken]);
|
|
22
|
+
};
|
|
23
|
+
exports.parseAssets = parseAssets;
|
|
@@ -1,63 +1,96 @@
|
|
|
1
1
|
import { TransactionBlock, TransactionObjectArgument } from "@mysten/sui.js/transactions";
|
|
2
|
-
export declare function
|
|
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: {
|
|
3
17
|
tx: TransactionBlock;
|
|
4
|
-
typusEcosystemVersion: string;
|
|
5
|
-
typusUserRegistry: string;
|
|
6
|
-
typusLeaderboardRegistry: string;
|
|
7
18
|
typusFrameworkOriginPackageId: string;
|
|
8
19
|
typusFrameworkPackageId: string;
|
|
9
20
|
typusDovSinglePackageId: string;
|
|
10
21
|
typusDovSingleRegistry: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
typusTokenType: string;
|
|
22
|
+
mfudPackageId: string;
|
|
23
|
+
mfudRegistry: string;
|
|
14
24
|
typeArguments: string[];
|
|
15
25
|
index: string;
|
|
16
26
|
receipts: string[] | TransactionObjectArgument[];
|
|
17
|
-
raiseCoins: string[];
|
|
18
|
-
raiseAmount: string;
|
|
19
|
-
raiseFromPremium: boolean;
|
|
20
|
-
raiseFromInactive: boolean;
|
|
21
27
|
user: string;
|
|
28
|
+
amount?: string;
|
|
22
29
|
}): TransactionBlock;
|
|
23
|
-
export declare function
|
|
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
|
+
typusFrameworkPackageId: string;
|
|
45
|
+
typusDovSinglePackageId: string;
|
|
46
|
+
typusDovSingleRegistry: string;
|
|
47
|
+
mfudPackageId: string;
|
|
48
|
+
mfudRegistry: string;
|
|
49
|
+
typeArguments: string[];
|
|
50
|
+
index: string;
|
|
51
|
+
receipts: string[] | TransactionObjectArgument[];
|
|
52
|
+
user: string;
|
|
53
|
+
incentiveToken?: string;
|
|
54
|
+
}): TransactionBlock;
|
|
55
|
+
export declare function getClaimTx(input: {
|
|
24
56
|
tx: TransactionBlock;
|
|
25
|
-
typusEcosystemVersion: string;
|
|
26
|
-
typusUserRegistry: string;
|
|
27
|
-
typusLeaderboardRegistry: string;
|
|
28
57
|
typusFrameworkOriginPackageId: string;
|
|
29
58
|
typusFrameworkPackageId: string;
|
|
30
59
|
typusDovSinglePackageId: string;
|
|
31
60
|
typusDovSingleRegistry: string;
|
|
61
|
+
mfudPackageId: string;
|
|
62
|
+
mfudRegistry: string;
|
|
32
63
|
typeArguments: string[];
|
|
33
|
-
typusTokenPackageId: string;
|
|
34
|
-
typusTokenRegistry: string;
|
|
35
|
-
typusTokenType: string;
|
|
36
64
|
index: string;
|
|
37
65
|
receipts: string[] | TransactionObjectArgument[];
|
|
38
|
-
reduceFromWarmup: string;
|
|
39
|
-
reduceFromActive: string;
|
|
40
|
-
reduceFromPremium: boolean;
|
|
41
|
-
reduceFromInactive: boolean;
|
|
42
|
-
reduceFromIncentive: boolean;
|
|
43
66
|
user: string;
|
|
44
67
|
}): TransactionBlock;
|
|
45
|
-
export declare function
|
|
68
|
+
export declare function getHarvestTx(input: {
|
|
46
69
|
tx: TransactionBlock;
|
|
47
|
-
typusEcosystemVersion: string;
|
|
48
|
-
typusUserRegistry: string;
|
|
49
|
-
typusLeaderboardRegistry: string;
|
|
50
70
|
typusFrameworkOriginPackageId: string;
|
|
71
|
+
typusFrameworkPackageId: string;
|
|
72
|
+
typusDovSinglePackageId: string;
|
|
73
|
+
typusDovSingleRegistry: string;
|
|
74
|
+
mfudPackageId: string;
|
|
75
|
+
mfudRegistry: string;
|
|
76
|
+
typeArguments: string[];
|
|
77
|
+
index: string;
|
|
78
|
+
receipts: string[] | TransactionObjectArgument[];
|
|
79
|
+
user: string;
|
|
80
|
+
incentiveToken?: string;
|
|
81
|
+
}): TransactionBlock;
|
|
82
|
+
export declare function getRedeemTx(input: {
|
|
83
|
+
tx: TransactionBlock;
|
|
84
|
+
typusFrameworkOriginPackageId: string;
|
|
85
|
+
typusFrameworkPackageId: string;
|
|
51
86
|
typusDovSinglePackageId: string;
|
|
52
87
|
typusDovSingleRegistry: string;
|
|
53
88
|
mfudPackageId: string;
|
|
54
89
|
mfudRegistry: string;
|
|
55
|
-
mfudAmount: string;
|
|
56
90
|
typeArguments: string[];
|
|
57
91
|
index: string;
|
|
58
92
|
receipts: string[] | TransactionObjectArgument[];
|
|
59
93
|
user: string;
|
|
60
|
-
coins: string[];
|
|
61
94
|
}): TransactionBlock;
|
|
62
95
|
export declare function getNewBidTx(input: {
|
|
63
96
|
tx: TransactionBlock;
|
|
@@ -16,168 +16,288 @@ 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.
|
|
19
|
+
exports.getWithdrawProfitStrategyTx = exports.getCloseStrategyTx = exports.getUpdateStrategyTx = exports.getNewStrategyTx = exports.getRebateTx = exports.getExerciseTx = exports.getNewBidTx = exports.getRedeemTx = exports.getHarvestTx = exports.getClaimTx = exports.getCompoundTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
|
|
20
20
|
var transactions_1 = require("@mysten/sui.js/transactions");
|
|
21
21
|
var constants_1 = require("../../constants");
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
var user_entry_1 = require("./user-entry");
|
|
23
|
+
function getDepositTx(input) {
|
|
24
|
+
var mfud = input.tx.moveCall({
|
|
25
|
+
target: "".concat(input.mfudPackageId, "::mfud::mint"),
|
|
25
26
|
arguments: [
|
|
26
|
-
input.tx.object(input.
|
|
27
|
-
input.tx.makeMoveVec({ objects: input.
|
|
28
|
-
input.tx.pure(input.
|
|
27
|
+
input.tx.object(input.mfudRegistry),
|
|
28
|
+
input.tx.makeMoveVec({ objects: input.coins.map(function (id) { return input.tx.object(id); }) }),
|
|
29
|
+
input.tx.pure(input.mfudAmount),
|
|
29
30
|
],
|
|
30
31
|
});
|
|
31
|
-
var typusTokenBalance = input.tx.moveCall({
|
|
32
|
-
target: "0x2::coin::into_balance",
|
|
33
|
-
typeArguments: [input.typusTokenType],
|
|
34
|
-
arguments: [input.tx.object(typusToken)],
|
|
35
|
-
});
|
|
36
32
|
var result = input.tx.moveCall({
|
|
37
|
-
target: "".concat(input.typusDovSinglePackageId, "::
|
|
33
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::deposit"),
|
|
38
34
|
typeArguments: input.typeArguments,
|
|
39
35
|
arguments: [
|
|
40
|
-
input.tx.object(input.typusEcosystemVersion),
|
|
41
|
-
input.tx.object(input.typusUserRegistry),
|
|
42
|
-
input.tx.object(input.typusLeaderboardRegistry),
|
|
43
36
|
input.tx.object(input.typusDovSingleRegistry),
|
|
44
37
|
input.tx.pure(input.index),
|
|
38
|
+
input.tx.makeMoveVec({ objects: [mfud] }),
|
|
39
|
+
input.tx.pure(input.mfudAmount),
|
|
45
40
|
input.tx.makeMoveVec({
|
|
46
41
|
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
47
|
-
objects: input.receipts.map(function (
|
|
42
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
48
43
|
}),
|
|
49
|
-
input.tx.object(typusTokenBalance),
|
|
50
|
-
input.tx.pure(input.raiseFromPremium),
|
|
51
|
-
input.tx.pure(input.raiseFromInactive),
|
|
52
44
|
input.tx.pure(constants_1.CLOCK),
|
|
53
45
|
],
|
|
54
46
|
});
|
|
55
|
-
input.tx.
|
|
47
|
+
input.tx.moveCall({
|
|
48
|
+
target: "0x1::vector::destroy_empty",
|
|
49
|
+
typeArguments: ["0x2::coin::Coin<" + input.typeArguments[0] + ">"],
|
|
50
|
+
arguments: [input.tx.object(result[0])],
|
|
51
|
+
});
|
|
52
|
+
input.tx.transferObjects([input.tx.object(result[1])], input.user);
|
|
56
53
|
return input.tx;
|
|
57
54
|
}
|
|
58
|
-
exports.
|
|
59
|
-
function
|
|
55
|
+
exports.getDepositTx = getDepositTx;
|
|
56
|
+
function getWithdrawTx(input) {
|
|
60
57
|
var result = input.tx.moveCall({
|
|
61
|
-
target: "".concat(input.typusDovSinglePackageId, "::
|
|
58
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::withdraw"),
|
|
62
59
|
typeArguments: input.typeArguments,
|
|
63
60
|
arguments: [
|
|
64
|
-
input.tx.object(input.typusEcosystemVersion),
|
|
65
|
-
input.tx.object(input.typusUserRegistry),
|
|
66
|
-
input.tx.object(input.typusLeaderboardRegistry),
|
|
67
61
|
input.tx.object(input.typusDovSingleRegistry),
|
|
68
62
|
input.tx.pure(input.index),
|
|
69
63
|
input.tx.makeMoveVec({
|
|
70
64
|
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
71
|
-
objects: input.receipts.map(function (
|
|
65
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
72
66
|
}),
|
|
73
|
-
input.tx.pure(input.
|
|
74
|
-
input.tx.pure(input.reduceFromActive),
|
|
75
|
-
input.tx.pure(input.reduceFromPremium),
|
|
76
|
-
input.tx.pure(input.reduceFromInactive),
|
|
77
|
-
input.tx.pure(input.reduceFromIncentive),
|
|
67
|
+
input.tx.pure(input.amount ? [input.amount] : []),
|
|
78
68
|
input.tx.pure(constants_1.CLOCK),
|
|
79
69
|
],
|
|
80
70
|
});
|
|
71
|
+
var mfud_coin = input.tx.moveCall({
|
|
72
|
+
target: "0x2::coin::from_balance",
|
|
73
|
+
typeArguments: [input.typeArguments[0]],
|
|
74
|
+
arguments: [input.tx.object(result[0])],
|
|
75
|
+
});
|
|
76
|
+
var fud_coin = input.tx.moveCall({
|
|
77
|
+
target: "".concat(input.mfudPackageId, "::mfud::burn"),
|
|
78
|
+
arguments: [input.tx.object(input.mfudRegistry), input.tx.object(mfud_coin)],
|
|
79
|
+
});
|
|
80
|
+
input.tx.transferObjects([input.tx.object(fud_coin)], input.user);
|
|
81
81
|
input.tx.moveCall({
|
|
82
82
|
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
83
|
-
arguments: [input.tx.object(result[
|
|
83
|
+
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
84
84
|
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
85
|
+
return input.tx;
|
|
86
|
+
}
|
|
87
|
+
exports.getWithdrawTx = getWithdrawTx;
|
|
88
|
+
function getUnsubscribeTx(input) {
|
|
89
|
+
var result = input.tx.moveCall({
|
|
90
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::unsubscribe"),
|
|
91
|
+
typeArguments: input.typeArguments,
|
|
92
|
+
arguments: [
|
|
93
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
94
|
+
input.tx.pure(input.index),
|
|
95
|
+
input.tx.makeMoveVec({
|
|
96
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
97
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
98
|
+
}),
|
|
99
|
+
input.tx.pure(input.amount ? [input.amount] : []),
|
|
100
|
+
input.tx.pure(constants_1.CLOCK),
|
|
101
|
+
],
|
|
102
|
+
});
|
|
103
|
+
input.tx.transferObjects([input.tx.object(result[0])], input.user);
|
|
104
|
+
return input.tx;
|
|
105
|
+
}
|
|
106
|
+
exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
107
|
+
function getCompoundTx(input) {
|
|
108
|
+
var result = input.tx.moveCall({
|
|
109
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::compound"),
|
|
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
|
+
input.tx.object(constants_1.CLOCK),
|
|
119
|
+
],
|
|
120
|
+
});
|
|
121
|
+
if (input.incentiveToken) {
|
|
122
|
+
input.typeArguments.push(input.incentiveToken);
|
|
123
|
+
if (input.incentiveToken == "".concat(input.mfudPackageId, "::mfud::MFUD")) {
|
|
124
|
+
var receipt = input.tx.moveCall({
|
|
125
|
+
target: "0x1::option::destroy_some",
|
|
126
|
+
typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
|
|
127
|
+
arguments: [input.tx.object(result[1])],
|
|
128
|
+
});
|
|
129
|
+
input.tx = getRedeemTx({
|
|
130
|
+
tx: input.tx,
|
|
131
|
+
typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
|
|
132
|
+
typusFrameworkPackageId: input.typusFrameworkPackageId,
|
|
133
|
+
typusDovSinglePackageId: input.typusDovSinglePackageId,
|
|
134
|
+
typusDovSingleRegistry: input.typusDovSingleRegistry,
|
|
135
|
+
mfudPackageId: input.mfudPackageId,
|
|
136
|
+
mfudRegistry: input.mfudRegistry,
|
|
137
|
+
typeArguments: input.typeArguments,
|
|
138
|
+
index: input.index,
|
|
139
|
+
receipts: [input.tx.object(receipt)],
|
|
140
|
+
user: input.user,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
var receipt = input.tx.moveCall({
|
|
145
|
+
target: "0x1::option::destroy_some",
|
|
146
|
+
typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
|
|
147
|
+
arguments: [input.tx.object(result[1])],
|
|
148
|
+
});
|
|
149
|
+
input.tx = (0, user_entry_1.getRedeemTx)({
|
|
150
|
+
tx: input.tx,
|
|
151
|
+
typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
|
|
152
|
+
typusFrameworkPackageId: input.typusFrameworkPackageId,
|
|
153
|
+
typusDovSinglePackageId: input.typusDovSinglePackageId,
|
|
154
|
+
typusDovSingleRegistry: input.typusDovSingleRegistry,
|
|
155
|
+
typeArguments: input.typeArguments,
|
|
156
|
+
index: input.index,
|
|
157
|
+
receipts: [input.tx.object(receipt)],
|
|
158
|
+
user: input.user,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
115
161
|
}
|
|
116
162
|
else {
|
|
117
|
-
input.tx.
|
|
118
|
-
target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
|
|
119
|
-
typeArguments: [input.typeArguments[1]],
|
|
120
|
-
arguments: [input.tx.object(result[2]), input.tx.pure(input.user)],
|
|
121
|
-
});
|
|
163
|
+
input.tx.transferObjects([input.tx.object(result[0])], input.user);
|
|
122
164
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
165
|
+
return input.tx;
|
|
166
|
+
}
|
|
167
|
+
exports.getCompoundTx = getCompoundTx;
|
|
168
|
+
function getClaimTx(input) {
|
|
169
|
+
var result = input.tx.moveCall({
|
|
170
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::claim"),
|
|
171
|
+
typeArguments: input.typeArguments,
|
|
172
|
+
arguments: [
|
|
173
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
174
|
+
input.tx.pure(input.index),
|
|
175
|
+
input.tx.makeMoveVec({
|
|
176
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
177
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
178
|
+
}),
|
|
179
|
+
],
|
|
180
|
+
});
|
|
181
|
+
var mfud_coin = input.tx.moveCall({
|
|
182
|
+
target: "0x2::coin::from_balance",
|
|
183
|
+
typeArguments: [input.typeArguments[0]],
|
|
184
|
+
arguments: [input.tx.object(result[0])],
|
|
185
|
+
});
|
|
186
|
+
var fud_coin = input.tx.moveCall({
|
|
187
|
+
target: "".concat(input.mfudPackageId, "::mfud::burn"),
|
|
188
|
+
arguments: [input.tx.object(input.mfudRegistry), input.tx.object(mfud_coin)],
|
|
189
|
+
});
|
|
190
|
+
input.tx.transferObjects([input.tx.object(fud_coin)], input.user);
|
|
191
|
+
input.tx.moveCall({
|
|
192
|
+
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
193
|
+
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
194
|
+
});
|
|
195
|
+
return input.tx;
|
|
196
|
+
}
|
|
197
|
+
exports.getClaimTx = getClaimTx;
|
|
198
|
+
function getHarvestTx(input) {
|
|
199
|
+
var result = input.tx.moveCall({
|
|
200
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::harvest"),
|
|
201
|
+
typeArguments: input.typeArguments,
|
|
202
|
+
arguments: [
|
|
203
|
+
input.tx.object(input.typusDovSingleRegistry),
|
|
204
|
+
input.tx.pure(input.index),
|
|
205
|
+
input.tx.makeMoveVec({
|
|
206
|
+
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
207
|
+
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
208
|
+
}),
|
|
209
|
+
],
|
|
210
|
+
});
|
|
211
|
+
var mfud_coin = input.tx.moveCall({
|
|
212
|
+
target: "0x2::coin::from_balance",
|
|
213
|
+
typeArguments: [input.typeArguments[1]],
|
|
214
|
+
arguments: [input.tx.object(result[0])],
|
|
215
|
+
});
|
|
216
|
+
var fud_coin = input.tx.moveCall({
|
|
217
|
+
target: "".concat(input.mfudPackageId, "::mfud::burn"),
|
|
218
|
+
arguments: [input.tx.object(input.mfudRegistry), input.tx.object(mfud_coin)],
|
|
219
|
+
});
|
|
220
|
+
input.tx.transferObjects([input.tx.object(fud_coin)], input.user);
|
|
221
|
+
if (input.incentiveToken) {
|
|
222
|
+
input.typeArguments.push(input.incentiveToken);
|
|
223
|
+
if (input.incentiveToken == "".concat(input.mfudPackageId, "::mfud::MFUD")) {
|
|
224
|
+
var receipt = input.tx.moveCall({
|
|
225
|
+
target: "0x1::option::destroy_some",
|
|
226
|
+
typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
|
|
227
|
+
arguments: [input.tx.object(result[1])],
|
|
228
|
+
});
|
|
229
|
+
input.tx = getRedeemTx({
|
|
230
|
+
tx: input.tx,
|
|
231
|
+
typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
|
|
232
|
+
typusFrameworkPackageId: input.typusFrameworkPackageId,
|
|
233
|
+
typusDovSinglePackageId: input.typusDovSinglePackageId,
|
|
234
|
+
typusDovSingleRegistry: input.typusDovSingleRegistry,
|
|
235
|
+
mfudPackageId: input.mfudPackageId,
|
|
236
|
+
mfudRegistry: input.mfudRegistry,
|
|
237
|
+
typeArguments: input.typeArguments,
|
|
238
|
+
index: input.index,
|
|
239
|
+
receipts: [input.tx.object(receipt)],
|
|
240
|
+
user: input.user,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
var receipt = input.tx.moveCall({
|
|
245
|
+
target: "0x1::option::destroy_some",
|
|
246
|
+
typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
|
|
247
|
+
arguments: [input.tx.object(result[1])],
|
|
248
|
+
});
|
|
249
|
+
input.tx = (0, user_entry_1.getRedeemTx)({
|
|
250
|
+
tx: input.tx,
|
|
251
|
+
typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
|
|
252
|
+
typusFrameworkPackageId: input.typusFrameworkPackageId,
|
|
253
|
+
typusDovSinglePackageId: input.typusDovSinglePackageId,
|
|
254
|
+
typusDovSingleRegistry: input.typusDovSingleRegistry,
|
|
255
|
+
typeArguments: input.typeArguments,
|
|
256
|
+
index: input.index,
|
|
257
|
+
receipts: [input.tx.object(receipt)],
|
|
258
|
+
user: input.user,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
134
261
|
}
|
|
135
262
|
else {
|
|
136
263
|
input.tx.moveCall({
|
|
137
|
-
target: "".concat(input.typusFrameworkPackageId, "::
|
|
138
|
-
|
|
139
|
-
arguments: [input.tx.object(result[3]), input.tx.pure(input.user)],
|
|
264
|
+
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
265
|
+
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
140
266
|
});
|
|
141
267
|
}
|
|
142
268
|
return input.tx;
|
|
143
269
|
}
|
|
144
|
-
exports.
|
|
145
|
-
function
|
|
146
|
-
var mfud = input.tx.moveCall({
|
|
147
|
-
target: "".concat(input.mfudPackageId, "::mfud::mint"),
|
|
148
|
-
arguments: [
|
|
149
|
-
input.tx.object(input.mfudRegistry),
|
|
150
|
-
input.tx.makeMoveVec({ objects: input.coins.map(function (id) { return input.tx.object(id); }) }),
|
|
151
|
-
input.tx.pure(input.mfudAmount),
|
|
152
|
-
],
|
|
153
|
-
});
|
|
270
|
+
exports.getHarvestTx = getHarvestTx;
|
|
271
|
+
function getRedeemTx(input) {
|
|
154
272
|
var result = input.tx.moveCall({
|
|
155
|
-
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::
|
|
273
|
+
target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::redeem"),
|
|
156
274
|
typeArguments: input.typeArguments,
|
|
157
275
|
arguments: [
|
|
158
|
-
input.tx.object(input.typusEcosystemVersion),
|
|
159
|
-
input.tx.object(input.typusUserRegistry),
|
|
160
|
-
input.tx.object(input.typusLeaderboardRegistry),
|
|
161
276
|
input.tx.object(input.typusDovSingleRegistry),
|
|
162
277
|
input.tx.pure(input.index),
|
|
163
|
-
input.tx.makeMoveVec({ objects: [mfud] }),
|
|
164
|
-
input.tx.pure(input.mfudAmount),
|
|
165
278
|
input.tx.makeMoveVec({
|
|
166
279
|
type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
|
|
167
280
|
objects: input.receipts.map(function (id) { return input.tx.object(id); }),
|
|
168
281
|
}),
|
|
169
|
-
input.tx.pure(constants_1.CLOCK),
|
|
170
282
|
],
|
|
171
283
|
});
|
|
172
|
-
input.tx.moveCall({
|
|
173
|
-
target: "
|
|
174
|
-
typeArguments: [
|
|
284
|
+
var mfud_coin = input.tx.moveCall({
|
|
285
|
+
target: "0x2::coin::from_balance",
|
|
286
|
+
typeArguments: [input.typeArguments[2]],
|
|
175
287
|
arguments: [input.tx.object(result[0])],
|
|
176
288
|
});
|
|
177
|
-
input.tx.
|
|
289
|
+
var fud_coin = input.tx.moveCall({
|
|
290
|
+
target: "".concat(input.mfudPackageId, "::mfud::burn"),
|
|
291
|
+
arguments: [input.tx.object(input.mfudRegistry), input.tx.object(mfud_coin)],
|
|
292
|
+
});
|
|
293
|
+
input.tx.transferObjects([input.tx.object(fud_coin)], input.user);
|
|
294
|
+
input.tx.moveCall({
|
|
295
|
+
target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
|
|
296
|
+
arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
|
|
297
|
+
});
|
|
178
298
|
return input.tx;
|
|
179
299
|
}
|
|
180
|
-
exports.
|
|
300
|
+
exports.getRedeemTx = getRedeemTx;
|
|
181
301
|
function getNewBidTx(input) {
|
|
182
302
|
var mfud = input.tx.moveCall({
|
|
183
303
|
target: "".concat(input.mfudPackageId, "::mfud::mint"),
|
|
@@ -188,7 +308,7 @@ function getNewBidTx(input) {
|
|
|
188
308
|
],
|
|
189
309
|
});
|
|
190
310
|
var result = input.tx.moveCall({
|
|
191
|
-
target: "".concat(input.typusDovSinglePackageId, "::
|
|
311
|
+
target: "".concat(input.typusDovSinglePackageId, "::tails_staking::bid"),
|
|
192
312
|
typeArguments: input.typeArguments,
|
|
193
313
|
arguments: [
|
|
194
314
|
input.tx.object(input.typusEcosystemVersion),
|