@typus/typus-sdk 1.2.16 → 1.2.17

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.
@@ -41,12 +41,16 @@ export declare function getUnsubscribeTx(input: {
41
41
  export declare function getCompoundTx(input: {
42
42
  tx: TransactionBlock;
43
43
  typusFrameworkOriginPackageId: string;
44
+ typusFrameworkPackageId: string;
44
45
  typusDovSinglePackageId: string;
45
46
  typusDovSingleRegistry: string;
47
+ mfudPackageId: string;
48
+ mfudRegistry: string;
46
49
  typeArguments: string[];
47
50
  index: string;
48
51
  receipts: string[] | TransactionObjectArgument[];
49
52
  user: string;
53
+ incentiveToken?: string;
50
54
  }): TransactionBlock;
51
55
  export declare function getClaimTx(input: {
52
56
  tx: TransactionBlock;
@@ -73,6 +77,7 @@ export declare function getHarvestTx(input: {
73
77
  index: string;
74
78
  receipts: string[] | TransactionObjectArgument[];
75
79
  user: string;
80
+ incentiveToken?: string;
76
81
  }): TransactionBlock;
77
82
  export declare function getRedeemTx(input: {
78
83
  tx: TransactionBlock;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRebateTx = exports.getExerciseTx = exports.getNewBidTx = exports.getRedeemTx = exports.getHarvestTx = exports.getClaimTx = exports.getCompoundTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getDepositTx = void 0;
4
4
  var constants_1 = require("../../constants");
5
+ var user_entry_1 = require("./user-entry");
5
6
  function getDepositTx(input) {
6
7
  var mfud = input.tx.moveCall({
7
8
  target: "".concat(input.mfudPackageId, "::mfud::mint"),
@@ -100,7 +101,50 @@ function getCompoundTx(input) {
100
101
  input.tx.object(constants_1.CLOCK),
101
102
  ],
102
103
  });
103
- input.tx.transferObjects([input.tx.object(result[0])], input.user);
104
+ if (input.incentiveToken) {
105
+ input.typeArguments.push(input.incentiveToken);
106
+ if (input.incentiveToken == "".concat(input.mfudPackageId, "::mfud::MFUD")) {
107
+ var receipt = input.tx.moveCall({
108
+ target: "0x1::option::destroy_some",
109
+ typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
110
+ arguments: [input.tx.object(result[1])],
111
+ });
112
+ input.tx = getRedeemTx({
113
+ tx: input.tx,
114
+ typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
115
+ typusFrameworkPackageId: input.typusFrameworkPackageId,
116
+ typusDovSinglePackageId: input.typusDovSinglePackageId,
117
+ typusDovSingleRegistry: input.typusDovSingleRegistry,
118
+ mfudPackageId: input.mfudPackageId,
119
+ mfudRegistry: input.mfudRegistry,
120
+ typeArguments: input.typeArguments,
121
+ index: input.index,
122
+ receipts: [input.tx.object(receipt)],
123
+ user: input.user,
124
+ });
125
+ }
126
+ else {
127
+ var receipt = input.tx.moveCall({
128
+ target: "0x1::option::destroy_some",
129
+ typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
130
+ arguments: [input.tx.object(result[1])],
131
+ });
132
+ input.tx = (0, user_entry_1.getRedeemTx)({
133
+ tx: input.tx,
134
+ typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
135
+ typusFrameworkPackageId: input.typusFrameworkPackageId,
136
+ typusDovSinglePackageId: input.typusDovSinglePackageId,
137
+ typusDovSingleRegistry: input.typusDovSingleRegistry,
138
+ typeArguments: input.typeArguments,
139
+ index: input.index,
140
+ receipts: [input.tx.object(receipt)],
141
+ user: input.user,
142
+ });
143
+ }
144
+ }
145
+ else {
146
+ input.tx.transferObjects([input.tx.object(result[0])], input.user);
147
+ }
104
148
  return input.tx;
105
149
  }
106
150
  exports.getCompoundTx = getCompoundTx;
@@ -157,10 +201,53 @@ function getHarvestTx(input) {
157
201
  arguments: [input.tx.object(input.mfudRegistry), input.tx.object(mfud_coin)],
158
202
  });
159
203
  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
- });
204
+ if (input.incentiveToken) {
205
+ input.typeArguments.push(input.incentiveToken);
206
+ if (input.incentiveToken == "".concat(input.mfudPackageId, "::mfud::MFUD")) {
207
+ var receipt = input.tx.moveCall({
208
+ target: "0x1::option::destroy_some",
209
+ typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
210
+ arguments: [input.tx.object(result[1])],
211
+ });
212
+ input.tx = getRedeemTx({
213
+ tx: input.tx,
214
+ typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
215
+ typusFrameworkPackageId: input.typusFrameworkPackageId,
216
+ typusDovSinglePackageId: input.typusDovSinglePackageId,
217
+ typusDovSingleRegistry: input.typusDovSingleRegistry,
218
+ mfudPackageId: input.mfudPackageId,
219
+ mfudRegistry: input.mfudRegistry,
220
+ typeArguments: input.typeArguments,
221
+ index: input.index,
222
+ receipts: [input.tx.object(receipt)],
223
+ user: input.user,
224
+ });
225
+ }
226
+ else {
227
+ var receipt = input.tx.moveCall({
228
+ target: "0x1::option::destroy_some",
229
+ typeArguments: ["".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt")],
230
+ arguments: [input.tx.object(result[1])],
231
+ });
232
+ input.tx = (0, user_entry_1.getRedeemTx)({
233
+ tx: input.tx,
234
+ typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
235
+ typusFrameworkPackageId: input.typusFrameworkPackageId,
236
+ typusDovSinglePackageId: input.typusDovSinglePackageId,
237
+ typusDovSingleRegistry: input.typusDovSingleRegistry,
238
+ typeArguments: input.typeArguments,
239
+ index: input.index,
240
+ receipts: [input.tx.object(receipt)],
241
+ user: input.user,
242
+ });
243
+ }
244
+ }
245
+ else {
246
+ input.tx.moveCall({
247
+ target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
248
+ arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
249
+ });
250
+ }
164
251
  return input.tx;
165
252
  }
166
253
  exports.getHarvestTx = getHarvestTx;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typus/typus-sdk",
3
3
  "author": "Typus",
4
4
  "description": "typus sdk",
5
- "version": "1.2.16",
5
+ "version": "1.2.17",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
8
  "@mysten/kiosk": "0.7.12",