@typus/typus-sdk 1.1.57 → 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.
@@ -30,58 +30,57 @@ var constants_1 = require("../../constants");
30
30
  ctx: &mut TxContext,
31
31
  )
32
32
  */
33
- function getDepositTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, packageId, typeArguments, registry, index, coins, amount, receipts, user, usingSponsoredGasCoin) {
34
- if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
35
- if (!usingSponsoredGasCoin &&
36
- (typeArguments[0] == "0x2::sui::SUI" ||
37
- typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
38
- var _a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
39
- var result = tx.moveCall({
40
- target: "".concat(packageId, "::tails_staking::deposit"),
41
- typeArguments: typeArguments,
33
+ function getDepositTx(input) {
34
+ if (!input.usingSponsoredGasCoin &&
35
+ (input.typeArguments[0] == "0x2::sui::SUI" ||
36
+ input.typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
37
+ var _a = __read(input.tx.splitCoins(input.tx.gas, [input.tx.pure(input.amount)]), 1), coin = _a[0];
38
+ var result = input.tx.moveCall({
39
+ target: "".concat(input.typusDovSinglePackageId, "::tails_staking::deposit"),
40
+ typeArguments: input.typeArguments,
42
41
  arguments: [
43
- tx.object(registry),
44
- tx.pure(index),
45
- tx.makeMoveVec({ objects: [coin] }),
46
- tx.pure(amount),
47
- tx.makeMoveVec({
48
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
49
- objects: receipts.map(function (id) { return tx.object(id); }),
42
+ input.tx.object(input.typusDovSingleRegistry),
43
+ input.tx.pure(input.index),
44
+ input.tx.makeMoveVec({ objects: [coin] }),
45
+ input.tx.pure(input.amount),
46
+ input.tx.makeMoveVec({
47
+ type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
48
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
50
49
  }),
51
- tx.pure(constants_1.CLOCK),
50
+ input.tx.pure(constants_1.CLOCK),
52
51
  ],
53
52
  });
54
- tx.moveCall({
55
- target: "".concat(typusFrameworkPackageId, "::utils::transfer_coins"),
56
- typeArguments: [typeArguments[0]],
57
- arguments: [tx.object(result[0]), tx.pure(user)],
53
+ input.tx.moveCall({
54
+ target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_coins"),
55
+ typeArguments: [input.typeArguments[0]],
56
+ arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
58
57
  });
59
- tx.transferObjects([tx.object(result[1])], user);
58
+ input.tx.transferObjects([input.tx.object(result[1])], input.user);
60
59
  }
61
60
  else {
62
- var result = tx.moveCall({
63
- target: "".concat(packageId, "::tails_staking::deposit"),
64
- typeArguments: typeArguments,
61
+ var result = input.tx.moveCall({
62
+ target: "".concat(input.typusDovSinglePackageId, "::tails_staking::deposit"),
63
+ typeArguments: input.typeArguments,
65
64
  arguments: [
66
- tx.object(registry),
67
- tx.pure(index),
68
- tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
69
- tx.pure(amount),
70
- tx.makeMoveVec({
71
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
72
- objects: receipts.map(function (id) { return tx.object(id); }),
65
+ input.tx.object(input.typusDovSingleRegistry),
66
+ input.tx.pure(input.index),
67
+ input.tx.makeMoveVec({ objects: input.coins.map(function (coin) { return input.tx.object(coin); }) }),
68
+ input.tx.pure(input.amount),
69
+ input.tx.makeMoveVec({
70
+ type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
71
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
73
72
  }),
74
- tx.pure(constants_1.CLOCK),
73
+ input.tx.pure(constants_1.CLOCK),
75
74
  ],
76
75
  });
77
- tx.moveCall({
78
- target: "".concat(typusFrameworkPackageId, "::utils::transfer_coins"),
79
- typeArguments: [typeArguments[0]],
80
- arguments: [tx.object(result[0]), tx.pure(user)],
76
+ input.tx.moveCall({
77
+ target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_coins"),
78
+ typeArguments: [input.typeArguments[0]],
79
+ arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
81
80
  });
82
- tx.transferObjects([tx.object(result[1])], user);
81
+ input.tx.transferObjects([input.tx.object(result[1])], input.user);
83
82
  }
84
- return tx;
83
+ return input.tx;
85
84
  }
86
85
  exports.getDepositTx = getDepositTx;
87
86
  /**
@@ -94,31 +93,31 @@ exports.getDepositTx = getDepositTx;
94
93
  ctx: &mut TxContext,
95
94
  )
96
95
  */
97
- function getWithdrawTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, user, share) {
98
- var result = tx.moveCall({
99
- target: "".concat(packageId, "::tails_staking::withdraw"),
100
- typeArguments: typeArguments,
96
+ function getWithdrawTx(input) {
97
+ var result = input.tx.moveCall({
98
+ target: "".concat(input.typusDovSinglePackageId, "::tails_staking::withdraw"),
99
+ typeArguments: input.typeArguments,
101
100
  arguments: [
102
- tx.object(registry),
103
- tx.pure(index),
104
- tx.makeMoveVec({
105
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
106
- objects: receipts.map(function (id) { return tx.object(id); }),
101
+ input.tx.object(input.typusDovSingleRegistry),
102
+ input.tx.pure(input.index),
103
+ input.tx.makeMoveVec({
104
+ type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
105
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
107
106
  }),
108
- tx.pure(share ? [share] : []),
109
- tx.pure(constants_1.CLOCK),
107
+ input.tx.pure(input.share ? [input.share] : []),
108
+ input.tx.pure(constants_1.CLOCK),
110
109
  ],
111
110
  });
112
- tx.moveCall({
113
- target: "".concat(typusFrameworkPackageId, "::utils::transfer_balance"),
114
- typeArguments: [typeArguments[0]],
115
- arguments: [tx.object(result[0]), tx.pure(user)],
111
+ input.tx.moveCall({
112
+ target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
113
+ typeArguments: [input.typeArguments[0]],
114
+ arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
116
115
  });
117
- tx.moveCall({
118
- target: "".concat(typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
119
- arguments: [tx.object(result[1]), tx.pure(user)],
116
+ input.tx.moveCall({
117
+ target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
118
+ arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
120
119
  });
121
- return tx;
120
+ return input.tx;
122
121
  }
123
122
  exports.getWithdrawTx = getWithdrawTx;
124
123
  /**
@@ -131,23 +130,23 @@ exports.getWithdrawTx = getWithdrawTx;
131
130
  ctx: &mut TxContext,
132
131
  )
133
132
  */
134
- function getUnsubscribeTx(tx, typusFrameworkOriginPackageId, packageId, typeArguments, registry, index, receipts, user, share) {
135
- var result = tx.moveCall({
136
- target: "".concat(packageId, "::tails_staking::unsubscribe"),
137
- typeArguments: typeArguments,
133
+ function getUnsubscribeTx(input) {
134
+ var result = input.tx.moveCall({
135
+ target: "".concat(input.typusDovSinglePackageId, "::tails_staking::unsubscribe"),
136
+ typeArguments: input.typeArguments,
138
137
  arguments: [
139
- tx.object(registry),
140
- tx.pure(index),
141
- tx.makeMoveVec({
142
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
143
- objects: receipts.map(function (id) { return tx.object(id); }),
138
+ input.tx.object(input.typusDovSingleRegistry),
139
+ input.tx.pure(input.index),
140
+ input.tx.makeMoveVec({
141
+ type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
142
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
144
143
  }),
145
- tx.pure(share ? [share] : []),
146
- tx.pure(constants_1.CLOCK),
144
+ input.tx.pure(input.share ? [input.share] : []),
145
+ input.tx.pure(constants_1.CLOCK),
147
146
  ],
148
147
  });
149
- tx.transferObjects([tx.object(result[0])], user);
150
- return tx;
148
+ input.tx.transferObjects([input.tx.object(result[0])], input.user);
149
+ return input.tx;
151
150
  }
152
151
  exports.getUnsubscribeTx = getUnsubscribeTx;
153
152
  /**
@@ -159,22 +158,38 @@ exports.getUnsubscribeTx = getUnsubscribeTx;
159
158
  ctx: &mut TxContext,
160
159
  )
161
160
  */
162
- function getCompoundTx(tx, typusFrameworkOriginPackageId, packageId, typeArguments, registry, index, receipts, user) {
163
- var result = tx.moveCall({
164
- target: "".concat(packageId, "::tails_staking::compound"),
165
- typeArguments: typeArguments,
161
+ function getCompoundTx(input) {
162
+ var result = input.tx.moveCall({
163
+ target: "".concat(input.typusDovSinglePackageId, "::tails_staking::compound"),
164
+ typeArguments: input.typeArguments,
166
165
  arguments: [
167
- tx.object(registry),
168
- tx.pure(index),
169
- tx.makeMoveVec({
170
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
171
- objects: receipts.map(function (id) { return tx.object(id); }),
166
+ input.tx.object(input.typusDovSingleRegistry),
167
+ input.tx.pure(input.index),
168
+ input.tx.makeMoveVec({
169
+ type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
170
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
172
171
  }),
173
- tx.object(constants_1.CLOCK),
172
+ input.tx.object(constants_1.CLOCK),
174
173
  ],
175
174
  });
176
- tx.transferObjects([tx.object(result[0])], user);
177
- return tx;
175
+ if (input.incentiveToken) {
176
+ input.typeArguments.push(input.incentiveToken);
177
+ input.tx = getRedeemTx({
178
+ tx: input.tx,
179
+ typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
180
+ typusFrameworkPackageId: input.typusFrameworkPackageId,
181
+ typusDovSinglePackageId: input.typusDovSinglePackageId,
182
+ typusDovSingleRegistry: input.typusDovSingleRegistry,
183
+ typeArguments: input.typeArguments,
184
+ index: input.index,
185
+ receipts: [input.tx.object(result[0])],
186
+ user: input.user,
187
+ });
188
+ }
189
+ else {
190
+ input.tx.transferObjects([input.tx.object(result[0])], input.user);
191
+ }
192
+ return input.tx;
178
193
  }
179
194
  exports.getCompoundTx = getCompoundTx;
180
195
  /**
@@ -185,29 +200,29 @@ exports.getCompoundTx = getCompoundTx;
185
200
  ctx: &mut TxContext,
186
201
  )
187
202
  */
188
- function getClaimTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, user) {
189
- var result = tx.moveCall({
190
- target: "".concat(packageId, "::tds_user_entry::claim"),
191
- typeArguments: typeArguments,
203
+ function getClaimTx(input) {
204
+ var result = input.tx.moveCall({
205
+ target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::claim"),
206
+ typeArguments: input.typeArguments,
192
207
  arguments: [
193
- tx.object(registry),
194
- tx.pure(index),
195
- tx.makeMoveVec({
196
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
197
- objects: receipts.map(function (id) { return tx.object(id); }),
208
+ input.tx.object(input.typusDovSingleRegistry),
209
+ input.tx.pure(input.index),
210
+ input.tx.makeMoveVec({
211
+ type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
212
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
198
213
  }),
199
214
  ],
200
215
  });
201
- tx.moveCall({
202
- target: "".concat(typusFrameworkPackageId, "::utils::transfer_balance"),
203
- typeArguments: [typeArguments[0]],
204
- arguments: [tx.object(result[0]), tx.pure(user)],
216
+ input.tx.moveCall({
217
+ target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
218
+ typeArguments: [input.typeArguments[0]],
219
+ arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
205
220
  });
206
- tx.moveCall({
207
- target: "".concat(typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
208
- arguments: [tx.object(result[1]), tx.pure(user)],
221
+ input.tx.moveCall({
222
+ target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
223
+ arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
209
224
  });
210
- return tx;
225
+ return input.tx;
211
226
  }
212
227
  exports.getClaimTx = getClaimTx;
213
228
  /**
@@ -218,29 +233,49 @@ exports.getClaimTx = getClaimTx;
218
233
  ctx: &mut TxContext,
219
234
  )
220
235
  */
221
- function getHarvestTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, user) {
222
- var result = tx.moveCall({
223
- target: "".concat(packageId, "::tds_user_entry::harvest"),
224
- typeArguments: typeArguments,
236
+ function getHarvestTx(input) {
237
+ var result = input.tx.moveCall({
238
+ target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::harvest"),
239
+ typeArguments: input.typeArguments,
225
240
  arguments: [
226
- tx.object(registry),
227
- tx.pure(index),
228
- tx.makeMoveVec({
229
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
230
- objects: receipts.map(function (id) { return tx.object(id); }),
241
+ input.tx.object(input.typusDovSingleRegistry),
242
+ input.tx.pure(input.index),
243
+ input.tx.makeMoveVec({
244
+ type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
245
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
231
246
  }),
232
247
  ],
233
248
  });
234
- tx.moveCall({
235
- target: "".concat(typusFrameworkPackageId, "::utils::transfer_balance"),
236
- typeArguments: [typeArguments[1]],
237
- arguments: [tx.object(result[0]), tx.pure(user)],
249
+ input.tx.moveCall({
250
+ target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
251
+ typeArguments: [input.typeArguments[1]],
252
+ arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
238
253
  });
239
- tx.moveCall({
240
- target: "".concat(typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
241
- arguments: [tx.object(result[1]), tx.pure(user)],
242
- });
243
- return tx;
254
+ if (input.incentiveToken) {
255
+ input.typeArguments.push(input.incentiveToken);
256
+ var receipt = input.tx.moveCall({
257
+ target: "0x1::option::destroy_some",
258
+ arguments: [input.tx.object(result[1])],
259
+ });
260
+ input.tx = getRedeemTx({
261
+ tx: input.tx,
262
+ typusFrameworkOriginPackageId: input.typusFrameworkOriginPackageId,
263
+ typusFrameworkPackageId: input.typusFrameworkPackageId,
264
+ typusDovSinglePackageId: input.typusDovSinglePackageId,
265
+ typusDovSingleRegistry: input.typusDovSingleRegistry,
266
+ typeArguments: input.typeArguments,
267
+ index: input.index,
268
+ receipts: [input.tx.object(receipt)],
269
+ user: input.user,
270
+ });
271
+ }
272
+ else {
273
+ input.tx.moveCall({
274
+ target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
275
+ arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
276
+ });
277
+ }
278
+ return input.tx;
244
279
  }
245
280
  exports.getHarvestTx = getHarvestTx;
246
281
  /**
@@ -251,29 +286,29 @@ exports.getHarvestTx = getHarvestTx;
251
286
  ctx: &mut TxContext,
252
287
  )
253
288
  */
254
- function getRedeemTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, user) {
255
- var result = tx.moveCall({
256
- target: "".concat(packageId, "::tds_user_entry::redeem"),
257
- typeArguments: typeArguments,
289
+ function getRedeemTx(input) {
290
+ var result = input.tx.moveCall({
291
+ target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::redeem"),
292
+ typeArguments: input.typeArguments,
258
293
  arguments: [
259
- tx.object(registry),
260
- tx.pure(index),
261
- tx.makeMoveVec({
262
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
263
- objects: receipts.map(function (id) { return tx.object(id); }),
294
+ input.tx.object(input.typusDovSingleRegistry),
295
+ input.tx.pure(input.index),
296
+ input.tx.makeMoveVec({
297
+ type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
298
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
264
299
  }),
265
300
  ],
266
301
  });
267
- tx.moveCall({
268
- target: "".concat(typusFrameworkPackageId, "::utils::transfer_balance"),
269
- typeArguments: [typeArguments[2]],
270
- arguments: [tx.object(result[0]), tx.pure(user)],
302
+ input.tx.moveCall({
303
+ target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
304
+ typeArguments: [input.typeArguments[2]],
305
+ arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
271
306
  });
272
- tx.moveCall({
273
- target: "".concat(typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
274
- arguments: [tx.object(result[1]), tx.pure(user)],
307
+ input.tx.moveCall({
308
+ target: "".concat(input.typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
309
+ arguments: [input.tx.object(result[1]), input.tx.pure(input.user)],
275
310
  });
276
- return tx;
311
+ return input.tx;
277
312
  }
278
313
  exports.getRedeemTx = getRedeemTx;
279
314
  /**
@@ -286,35 +321,39 @@ exports.getRedeemTx = getRedeemTx;
286
321
  ctx: &mut TxContext,
287
322
  )
288
323
  */
289
- function getNewBidTx(tx, packageId, typeArguments, registry, index, coins, size, premium_required, // fe float * b_token_decimal
290
- user, usingSponsoredGasCoin) {
291
- if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
292
- if (!usingSponsoredGasCoin &&
293
- (typeArguments[1] == "0x2::sui::SUI" ||
294
- typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
295
- var _a = __read(tx.splitCoins(tx.gas, [tx.pure(premium_required)]), 1), coin = _a[0];
296
- var result = tx.moveCall({
297
- target: "".concat(packageId, "::tails_staking::new_bid"),
298
- typeArguments: typeArguments,
299
- arguments: [tx.object(registry), tx.pure(index), tx.makeMoveVec({ objects: [coin] }), tx.pure(size), tx.pure("0x6")],
324
+ function getNewBidTx(input) {
325
+ if (!input.usingSponsoredGasCoin &&
326
+ (input.typeArguments[1] == "0x2::sui::SUI" ||
327
+ input.typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
328
+ var _a = __read(input.tx.splitCoins(input.tx.gas, [input.tx.pure(input.premium_required)]), 1), coin = _a[0];
329
+ var result = input.tx.moveCall({
330
+ target: "".concat(input.typusDovSinglePackageId, "::tails_staking::new_bid"),
331
+ typeArguments: input.typeArguments,
332
+ arguments: [
333
+ input.tx.object(input.typusDovSingleRegistry),
334
+ input.tx.pure(input.index),
335
+ input.tx.makeMoveVec({ objects: [coin] }),
336
+ input.tx.pure(input.size),
337
+ input.tx.pure("0x6"),
338
+ ],
300
339
  });
301
- tx.transferObjects([tx.object(result[0])], user);
340
+ input.tx.transferObjects([input.tx.object(result[0])], input.user);
302
341
  }
303
342
  else {
304
- var result = tx.moveCall({
305
- target: "".concat(packageId, "::tails_staking::new_bid"),
306
- typeArguments: typeArguments,
343
+ var result = input.tx.moveCall({
344
+ target: "".concat(input.typusDovSinglePackageId, "::tails_staking::new_bid"),
345
+ typeArguments: input.typeArguments,
307
346
  arguments: [
308
- tx.object(registry),
309
- tx.pure(index),
310
- tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
311
- tx.pure(size),
312
- tx.pure("0x6"),
347
+ input.tx.object(input.typusDovSingleRegistry),
348
+ input.tx.pure(input.index),
349
+ input.tx.makeMoveVec({ objects: input.coins.map(function (coin) { return input.tx.object(coin); }) }),
350
+ input.tx.pure(input.size),
351
+ input.tx.pure("0x6"),
313
352
  ],
314
353
  });
315
- tx.transferObjects([tx.object(result[0])], user);
354
+ input.tx.transferObjects([input.tx.object(result[0])], input.user);
316
355
  }
317
- return tx;
356
+ return input.tx;
318
357
  }
319
358
  exports.getNewBidTx = getNewBidTx;
320
359
  /**
@@ -325,25 +364,25 @@ exports.getNewBidTx = getNewBidTx;
325
364
  ctx: &mut TxContext,
326
365
  )
327
366
  */
328
- function getExerciseTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, user) {
329
- var result = tx.moveCall({
330
- target: "".concat(packageId, "::tds_user_entry::exercise"),
331
- typeArguments: typeArguments,
367
+ function getExerciseTx(input) {
368
+ var result = input.tx.moveCall({
369
+ target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::exercise"),
370
+ typeArguments: input.typeArguments,
332
371
  arguments: [
333
- tx.object(registry),
334
- tx.pure(index),
335
- tx.makeMoveVec({
336
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusBidReceipt"),
337
- objects: receipts.map(function (id) { return tx.object(id); }),
372
+ input.tx.object(input.typusDovSingleRegistry),
373
+ input.tx.pure(input.index),
374
+ input.tx.makeMoveVec({
375
+ type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusBidReceipt"),
376
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
338
377
  }),
339
378
  ],
340
379
  });
341
- tx.moveCall({
342
- target: "".concat(typusFrameworkPackageId, "::utils::transfer_balance"),
343
- typeArguments: [typeArguments[0]],
344
- arguments: [tx.object(result[0]), tx.pure(user)],
380
+ input.tx.moveCall({
381
+ target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
382
+ typeArguments: [input.typeArguments[0]],
383
+ arguments: [input.tx.object(result[0]), input.tx.pure(input.user)],
345
384
  });
346
- return tx;
385
+ return input.tx;
347
386
  }
348
387
  exports.getExerciseTx = getExerciseTx;
349
388
  /**
@@ -357,23 +396,21 @@ exports.getExerciseTx = getExerciseTx;
357
396
  ) {
358
397
  */
359
398
  function getTransferBidReceiptTx(input) {
360
- var tx = new transactions_1.TransactionBlock();
361
- tx.moveCall({
362
- target: "".concat(input.packageId, "::tds_user_entry::transfer_bid_receipt"),
399
+ input.tx.moveCall({
400
+ target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::transfer_bid_receipt"),
363
401
  typeArguments: input.typeArguments,
364
402
  arguments: [
365
- tx.object(input.registry),
366
- tx.pure(input.index),
367
- tx.makeMoveVec({
403
+ input.tx.object(input.typusDovSingleRegistry),
404
+ input.tx.pure(input.index),
405
+ input.tx.makeMoveVec({
368
406
  type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusBidReceipt"),
369
- objects: input.receipts.map(function (id) { return tx.object(id); }),
407
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
370
408
  }),
371
- tx.pure(input.share ? [input.share] : []),
372
- tx.pure(input.recipient),
409
+ input.tx.pure(input.share ? [input.share] : []),
410
+ input.tx.pure(input.recipient),
373
411
  ],
374
412
  });
375
- tx.setGasBudget(input.gasBudget);
376
- return tx;
413
+ return input.tx;
377
414
  }
378
415
  exports.getTransferBidReceiptTx = getTransferBidReceiptTx;
379
416
  /**
@@ -382,17 +419,22 @@ exports.getTransferBidReceiptTx = getTransferBidReceiptTx;
382
419
  ctx: &mut TxContext,
383
420
  )
384
421
  */
385
- function getRebateTx(gasBudget, packageId, typeArguments, registry) {
386
- var tx = new transactions_1.TransactionBlock();
387
- typeArguments.forEach(function (typeArgument) {
388
- tx.moveCall({
389
- target: "".concat(packageId, "::tds_user_entry::rebate"),
390
- typeArguments: [typeArgument],
391
- arguments: [tx.object(registry)],
392
- });
422
+ function getRebateTx(input) {
423
+ var result = input.tx.moveCall({
424
+ target: "".concat(input.typusDovSinglePackageId, "::tds_user_entry::rebate"),
425
+ typeArguments: [input.typeArgument],
426
+ arguments: [input.tx.object(input.typusDovSingleRegistry)],
393
427
  });
394
- tx.setGasBudget(gasBudget);
395
- return tx;
428
+ var balance = input.tx.moveCall({
429
+ target: "0x1::option::destroy_some",
430
+ arguments: [input.tx.object(result[0])],
431
+ });
432
+ input.tx.moveCall({
433
+ target: "".concat(input.typusFrameworkPackageId, "::utils::transfer_balance"),
434
+ typeArguments: [input.typeArgument],
435
+ arguments: [input.tx.object(balance), input.tx.pure(input.user)],
436
+ });
437
+ return input.tx;
396
438
  }
397
439
  exports.getRebateTx = getRebateTx;
398
440
  /**
@@ -432,7 +474,7 @@ strategy_pool, vault_index, signal_index, coins, amount, size, price_percentage,
432
474
  else {
433
475
  var coin = coins.pop();
434
476
  if (coins.length > 0) {
435
- tx.mergeCoins(tx.object(coin), coins.map(function (id) { return tx.object(id); }));
477
+ tx.mergeCoins(tx.object(coin), coins.map(function (coin) { return tx.object(coin); }));
436
478
  }
437
479
  var _b = __read(tx.splitCoins(tx.object(coin), [tx.pure(amount)]), 1), input_coin = _b[0];
438
480
  tx.moveCall({
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.1.57",
5
+ "version": "1.1.58",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
8
  "@mysten/kiosk": "0.7.12",