@typus/typus-sdk 1.2.86 → 1.2.87

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.
@@ -51,7 +51,7 @@ export declare function getDailyAttendTx(gasBudget: number, nftPackageId: string
51
51
  ctx: &mut TxContext
52
52
  )
53
53
  */
54
- export declare function getSnapshotTx(gasBudget: number, nftPackageId: string, registry: string): Promise<TransactionBlock>;
54
+ export declare function getSnapshotTx(gasBudget: number, typusEcosystemVersion: string, typusUserRegistry: string, typusDovSinglePackageId: string, registry: string, amount: string): Promise<TransactionBlock>;
55
55
  export declare function getNewBidTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, priceOracle: string, coins: string[], size: string, premium_required: string, // fe float * b_token_decimal
56
56
  usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
57
57
  export declare function getDepositTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, additional_config_registry: string, index: string, coins: string[], amount: string, usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
@@ -216,11 +216,11 @@ function getSwitchNftTx(gasBudget, nftPackageId, registry, personalKioskPackageI
216
216
  return __generator(this, function (_c) {
217
217
  tx = new transactions_1.TransactionBlock();
218
218
  _a = __read(tx.splitCoins(tx.gas, [tx.pure(50000000)]), 1), coin = _a[0];
219
- tx.moveCall({
220
- target: "".concat(nftPackageId, "::tails_staking::snapshot"),
221
- typeArguments: [],
222
- arguments: [tx.object(registry), tx.object(constants_1.CLOCK)],
223
- });
219
+ // tx.moveCall({
220
+ // target: `${nftPackageId}::tails_staking::snapshot`,
221
+ // typeArguments: [],
222
+ // arguments: [tx.object(registry), tx.object(CLOCK)],
223
+ // });
224
224
  tx.moveCall({
225
225
  target: "".concat(nftPackageId, "::tails_staking::claim_profit_sharing"),
226
226
  typeArguments: typeArguments,
@@ -307,11 +307,11 @@ function getUnstakeNftTx(gasBudget, nftPackageId, registry, typeArguments, kiosk
307
307
  var tx, _a, personalKioskCap, borrow;
308
308
  return __generator(this, function (_b) {
309
309
  tx = new transactions_1.TransactionBlock();
310
- tx.moveCall({
311
- target: "".concat(nftPackageId, "::tails_staking::snapshot"),
312
- typeArguments: [],
313
- arguments: [tx.object(registry), tx.object(constants_1.CLOCK)],
314
- });
310
+ // tx.moveCall({
311
+ // target: `${nftPackageId}::tails_staking::snapshot`,
312
+ // typeArguments: [],
313
+ // arguments: [tx.object(registry), tx.object(CLOCK)],
314
+ // });
315
315
  tx.moveCall({
316
316
  target: "".concat(nftPackageId, "::tails_staking::claim_profit_sharing"),
317
317
  typeArguments: typeArguments,
@@ -380,15 +380,15 @@ exports.getDailyAttendTx = getDailyAttendTx;
380
380
  ctx: &mut TxContext
381
381
  )
382
382
  */
383
- function getSnapshotTx(gasBudget, nftPackageId, registry) {
383
+ function getSnapshotTx(gasBudget, typusEcosystemVersion, typusUserRegistry, typusDovSinglePackageId, registry, amount) {
384
384
  return __awaiter(this, void 0, void 0, function () {
385
385
  var tx;
386
386
  return __generator(this, function (_a) {
387
387
  tx = new transactions_1.TransactionBlock();
388
388
  tx.moveCall({
389
- target: "".concat(nftPackageId, "::tails_staking::snapshot"),
389
+ target: "".concat(typusDovSinglePackageId, "::tails_staking::snapshot"),
390
390
  typeArguments: [],
391
- arguments: [tx.object(registry), tx.object(constants_1.CLOCK)],
391
+ arguments: [tx.object(typusEcosystemVersion), tx.object(typusUserRegistry), tx.object(registry), tx.pure(amount)],
392
392
  });
393
393
  tx.setGasBudget(gasBudget);
394
394
  return [2 /*return*/, tx];
@@ -171,20 +171,20 @@ exports.tokenOrder = {
171
171
  CETUS: 5,
172
172
  WETH: 6,
173
173
  ETH: 6,
174
- FUD: 7,
175
- INJ: 8,
176
- JUP: 9,
177
- NAVX: 10,
178
- SCA: 11,
179
- SEI: 12,
180
- WSOL: 13,
181
- SOL: 14,
182
- TURBOS: 15,
183
- USDC: 16,
184
- USDT: 17,
185
- USDY: 18,
186
- HASUI: 19,
187
- VSUI: 19,
174
+ HASUI: 7,
175
+ FUD: 8,
176
+ INJ: 9,
177
+ JUP: 10,
178
+ NAVX: 11,
179
+ SCA: 12,
180
+ SEI: 13,
181
+ WSOL: 14,
182
+ SOL: 15,
183
+ TURBOS: 16,
184
+ USDC: 17,
185
+ USDT: 18,
186
+ USDY: 19,
187
+ VSUI: 20,
188
188
  };
189
189
  exports.optionTypeOrder = {
190
190
  0: 0,
@@ -1,96 +1,62 @@
1
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
- 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: {
2
+ export declare function getRaiseFundTx(input: {
56
3
  tx: TransactionBlock;
4
+ typusEcosystemVersion: string;
5
+ typusUserRegistry: string;
6
+ typusLeaderboardRegistry: string;
57
7
  typusFrameworkOriginPackageId: string;
58
- typusFrameworkPackageId: string;
59
8
  typusDovSinglePackageId: string;
60
9
  typusDovSingleRegistry: string;
61
- mfudPackageId: string;
62
- mfudRegistry: string;
10
+ typusTokenPackageId: string;
11
+ typusTokenRegistry: string;
12
+ typusTokenType: string;
63
13
  typeArguments: string[];
64
14
  index: string;
65
15
  receipts: string[] | TransactionObjectArgument[];
16
+ raiseCoins: string[];
17
+ raiseAmount: string;
18
+ raiseFromPremium: boolean;
19
+ raiseFromInactive: boolean;
66
20
  user: string;
67
21
  }): TransactionBlock;
68
- export declare function getHarvestTx(input: {
22
+ export declare function getReduceFundTx(input: {
69
23
  tx: TransactionBlock;
24
+ typusEcosystemVersion: string;
25
+ typusUserRegistry: string;
26
+ typusLeaderboardRegistry: string;
70
27
  typusFrameworkOriginPackageId: string;
71
28
  typusFrameworkPackageId: string;
72
29
  typusDovSinglePackageId: string;
73
30
  typusDovSingleRegistry: string;
74
- mfudPackageId: string;
75
- mfudRegistry: string;
76
31
  typeArguments: string[];
32
+ typusTokenPackageId: string;
33
+ typusTokenRegistry: string;
34
+ typusTokenType: string;
77
35
  index: string;
78
36
  receipts: string[] | TransactionObjectArgument[];
37
+ reduceFromWarmup: string;
38
+ reduceFromActive: string;
39
+ reduceFromPremium: boolean;
40
+ reduceFromInactive: boolean;
41
+ reduceFromIncentive: boolean;
79
42
  user: string;
80
- incentiveToken?: string;
81
43
  }): TransactionBlock;
82
- export declare function getRedeemTx(input: {
44
+ export declare function getDepositTx(input: {
83
45
  tx: TransactionBlock;
46
+ typusEcosystemVersion: string;
47
+ typusUserRegistry: string;
48
+ typusLeaderboardRegistry: string;
84
49
  typusFrameworkOriginPackageId: string;
85
- typusFrameworkPackageId: string;
86
50
  typusDovSinglePackageId: string;
87
51
  typusDovSingleRegistry: string;
88
52
  mfudPackageId: string;
89
53
  mfudRegistry: string;
54
+ mfudAmount: string;
90
55
  typeArguments: string[];
91
56
  index: string;
92
57
  receipts: string[] | TransactionObjectArgument[];
93
58
  user: string;
59
+ coins: string[];
94
60
  }): TransactionBlock;
95
61
  export declare function getNewBidTx(input: {
96
62
  tx: TransactionBlock;
@@ -16,288 +16,168 @@ 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.getRedeemTx = exports.getHarvestTx = exports.getClaimTx = exports.getCompoundTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
19
+ 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
- var user_entry_1 = require("./user-entry");
23
- function getDepositTx(input) {
24
- var mfud = input.tx.moveCall({
25
- target: "".concat(input.mfudPackageId, "::mfud::mint"),
22
+ function getRaiseFundTx(input) {
23
+ var typusToken = input.tx.moveCall({
24
+ target: "".concat(input.typusTokenPackageId, "::").concat(input.typusTokenType.split("::")[1], "::mint"),
26
25
  arguments: [
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),
26
+ input.tx.object(input.typusTokenRegistry),
27
+ input.tx.makeMoveVec({ objects: input.raiseCoins }),
28
+ input.tx.pure(input.raiseAmount),
30
29
  ],
31
30
  });
31
+ var typusTokenBalance = input.tx.moveCall({
32
+ target: "0x2::coin::into_balance",
33
+ typeArguments: [input.typusTokenType],
34
+ arguments: [input.tx.object(typusToken)],
35
+ });
32
36
  var result = input.tx.moveCall({
33
- target: "".concat(input.typusDovSinglePackageId, "::tails_staking::deposit"),
37
+ target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_raise_fund"),
34
38
  typeArguments: input.typeArguments,
35
39
  arguments: [
40
+ input.tx.object(input.typusEcosystemVersion),
41
+ input.tx.object(input.typusUserRegistry),
42
+ input.tx.object(input.typusLeaderboardRegistry),
36
43
  input.tx.object(input.typusDovSingleRegistry),
37
44
  input.tx.pure(input.index),
38
- input.tx.makeMoveVec({ objects: [mfud] }),
39
- input.tx.pure(input.mfudAmount),
40
45
  input.tx.makeMoveVec({
41
46
  type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
42
- objects: input.receipts.map(function (id) { return input.tx.object(id); }),
47
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
43
48
  }),
49
+ input.tx.object(typusTokenBalance),
50
+ input.tx.pure(input.raiseFromPremium),
51
+ input.tx.pure(input.raiseFromInactive),
44
52
  input.tx.pure(constants_1.CLOCK),
45
53
  ],
46
54
  });
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);
55
+ input.tx.transferObjects([input.tx.object(result[0])], input.user);
53
56
  return input.tx;
54
57
  }
55
- exports.getDepositTx = getDepositTx;
56
- function getWithdrawTx(input) {
58
+ exports.getRaiseFundTx = getRaiseFundTx;
59
+ function getReduceFundTx(input) {
57
60
  var result = input.tx.moveCall({
58
- target: "".concat(input.typusDovSinglePackageId, "::tails_staking::withdraw"),
61
+ target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_reduce_fund"),
59
62
  typeArguments: input.typeArguments,
60
63
  arguments: [
64
+ input.tx.object(input.typusEcosystemVersion),
65
+ input.tx.object(input.typusUserRegistry),
66
+ input.tx.object(input.typusLeaderboardRegistry),
61
67
  input.tx.object(input.typusDovSingleRegistry),
62
68
  input.tx.pure(input.index),
63
69
  input.tx.makeMoveVec({
64
70
  type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
65
- objects: input.receipts.map(function (id) { return input.tx.object(id); }),
71
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
66
72
  }),
67
- input.tx.pure(input.amount ? [input.amount] : []),
73
+ input.tx.pure(input.reduceFromWarmup),
74
+ input.tx.pure(input.reduceFromActive),
75
+ input.tx.pure(input.reduceFromPremium),
76
+ input.tx.pure(input.reduceFromInactive),
77
+ input.tx.pure(input.reduceFromIncentive),
68
78
  input.tx.pure(constants_1.CLOCK),
69
79
  ],
70
80
  });
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[1]), input.tx.pure(input.user)],
83
+ arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
84
84
  });
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
- }
85
+ if (input.typeArguments[0] == input.typusTokenType) {
86
+ var typusToken = input.tx.moveCall({
87
+ target: "0x2::coin::from_balance",
88
+ typeArguments: [input.typeArguments[0]],
89
+ arguments: [input.tx.object(result[1])],
90
+ });
91
+ var token = input.tx.moveCall({
92
+ target: "".concat(input.typusTokenPackageId, "::").concat(input.typusTokenType.split("::")[1], "::burn"),
93
+ arguments: [input.tx.object(input.typusTokenRegistry), input.tx.object(typusToken)],
94
+ });
95
+ input.tx.transferObjects([input.tx.object(token)], input.user);
161
96
  }
162
97
  else {
163
- input.tx.transferObjects([input.tx.object(result[0])], input.user);
98
+ input.tx.moveCall({
99
+ target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
100
+ typeArguments: [input.typeArguments[0]],
101
+ arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
102
+ });
164
103
  }
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
- }
104
+ if (input.typeArguments[1] == input.typusTokenType) {
105
+ var typusToken = input.tx.moveCall({
106
+ target: "0x2::coin::from_balance",
107
+ typeArguments: [input.typeArguments[1]],
108
+ arguments: [input.tx.object(result[2])],
109
+ });
110
+ var token = input.tx.moveCall({
111
+ target: "".concat(input.typusTokenPackageId, "::").concat(input.typusTokenType.split("::")[1], "::burn"),
112
+ arguments: [input.tx.object(input.typusTokenRegistry), input.tx.object(typusToken)],
113
+ });
114
+ input.tx.transferObjects([input.tx.object(token)], input.user);
261
115
  }
262
116
  else {
263
117
  input.tx.moveCall({
264
- target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
265
- arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
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
+ });
122
+ }
123
+ if (input.typeArguments[2] == input.typusTokenType) {
124
+ var typusToken = input.tx.moveCall({
125
+ target: "0x2::coin::from_balance",
126
+ typeArguments: [input.typeArguments[2]],
127
+ arguments: [input.tx.object(result[3])],
128
+ });
129
+ var token = input.tx.moveCall({
130
+ target: "".concat(input.typusTokenPackageId, "::").concat(input.typusTokenType.split("::")[1], "::burn"),
131
+ arguments: [input.tx.object(input.typusTokenRegistry), input.tx.object(typusToken)],
132
+ });
133
+ input.tx.transferObjects([input.tx.object(token)], input.user);
134
+ }
135
+ else {
136
+ input.tx.moveCall({
137
+ target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
138
+ typeArguments: [input.typeArguments[2]],
139
+ arguments: [input.tx.object(result[3]), input.tx.pure(input.user)],
266
140
  });
267
141
  }
268
142
  return input.tx;
269
143
  }
270
- exports.getHarvestTx = getHarvestTx;
271
- function getRedeemTx(input) {
144
+ exports.getReduceFundTx = getReduceFundTx;
145
+ function getDepositTx(input) {
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
+ });
272
154
  var result = input.tx.moveCall({
273
- target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::redeem"),
155
+ target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_deposit"),
274
156
  typeArguments: input.typeArguments,
275
157
  arguments: [
158
+ input.tx.object(input.typusEcosystemVersion),
159
+ input.tx.object(input.typusUserRegistry),
160
+ input.tx.object(input.typusLeaderboardRegistry),
276
161
  input.tx.object(input.typusDovSingleRegistry),
277
162
  input.tx.pure(input.index),
163
+ input.tx.makeMoveVec({ objects: [mfud] }),
164
+ input.tx.pure(input.mfudAmount),
278
165
  input.tx.makeMoveVec({
279
166
  type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
280
167
  objects: input.receipts.map(function (id) { return input.tx.object(id); }),
281
168
  }),
169
+ input.tx.pure(constants_1.CLOCK),
282
170
  ],
283
171
  });
284
- var mfud_coin = input.tx.moveCall({
285
- target: "0x2::coin::from_balance",
286
- typeArguments: [input.typeArguments[2]],
287
- arguments: [input.tx.object(result[0])],
288
- });
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
172
  input.tx.moveCall({
295
- target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
296
- arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
173
+ target: "0x1::vector::destroy_empty",
174
+ typeArguments: ["0x2::coin::Coin<" + input.typeArguments[0] + ">"],
175
+ arguments: [input.tx.object(result[0])],
297
176
  });
177
+ input.tx.transferObjects([input.tx.object(result[1])], input.user);
298
178
  return input.tx;
299
179
  }
300
- exports.getRedeemTx = getRedeemTx;
180
+ exports.getDepositTx = getDepositTx;
301
181
  function getNewBidTx(input) {
302
182
  var mfud = input.tx.moveCall({
303
183
  target: "".concat(input.mfudPackageId, "::mfud::mint"),
@@ -308,7 +188,7 @@ function getNewBidTx(input) {
308
188
  ],
309
189
  });
310
190
  var result = input.tx.moveCall({
311
- target: "".concat(input.typusDovSinglePackageId, "::tails_staking::bid"),
191
+ target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::public_bid"),
312
192
  typeArguments: input.typeArguments,
313
193
  arguments: [
314
194
  input.tx.object(input.typusEcosystemVersion),