@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.
@@ -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,26 +130,23 @@ exports.getWithdrawTx = getWithdrawTx;
131
130
  ctx: &mut TxContext,
132
131
  )
133
132
  */
134
- function getUnsubscribeTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, 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.moveCall({
150
- target: "".concat(typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
151
- arguments: [tx.object(result[0]), tx.pure(user)],
152
- });
153
- return tx;
148
+ input.tx.transferObjects([input.tx.object(result[0])], input.user);
149
+ return input.tx;
154
150
  }
155
151
  exports.getUnsubscribeTx = getUnsubscribeTx;
156
152
  /**
@@ -162,25 +158,38 @@ exports.getUnsubscribeTx = getUnsubscribeTx;
162
158
  ctx: &mut TxContext,
163
159
  )
164
160
  */
165
- function getCompoundTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, user) {
166
- var result = tx.moveCall({
167
- target: "".concat(packageId, "::tails_staking::compound"),
168
- typeArguments: typeArguments,
161
+ function getCompoundTx(input) {
162
+ var result = input.tx.moveCall({
163
+ target: "".concat(input.typusDovSinglePackageId, "::tails_staking::compound"),
164
+ typeArguments: input.typeArguments,
169
165
  arguments: [
170
- tx.object(registry),
171
- tx.pure(index),
172
- tx.makeMoveVec({
173
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
174
- 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); }),
175
171
  }),
176
- tx.object(constants_1.CLOCK),
172
+ input.tx.object(constants_1.CLOCK),
177
173
  ],
178
174
  });
179
- tx.moveCall({
180
- target: "".concat(typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
181
- arguments: [tx.object(result[0]), tx.pure(user)],
182
- });
183
- 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;
184
193
  }
185
194
  exports.getCompoundTx = getCompoundTx;
186
195
  /**
@@ -191,29 +200,29 @@ exports.getCompoundTx = getCompoundTx;
191
200
  ctx: &mut TxContext,
192
201
  )
193
202
  */
194
- function getClaimTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, user) {
195
- var result = tx.moveCall({
196
- target: "".concat(packageId, "::tds_user_entry::claim"),
197
- 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,
198
207
  arguments: [
199
- tx.object(registry),
200
- tx.pure(index),
201
- tx.makeMoveVec({
202
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
203
- 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); }),
204
213
  }),
205
214
  ],
206
215
  });
207
- tx.moveCall({
208
- target: "".concat(typusFrameworkPackageId, "::utils::transfer_balance"),
209
- typeArguments: [typeArguments[0]],
210
- 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)],
211
220
  });
212
- tx.moveCall({
213
- target: "".concat(typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
214
- 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)],
215
224
  });
216
- return tx;
225
+ return input.tx;
217
226
  }
218
227
  exports.getClaimTx = getClaimTx;
219
228
  /**
@@ -224,29 +233,49 @@ exports.getClaimTx = getClaimTx;
224
233
  ctx: &mut TxContext,
225
234
  )
226
235
  */
227
- function getHarvestTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, user) {
228
- var result = tx.moveCall({
229
- target: "".concat(packageId, "::tds_user_entry::harvest"),
230
- 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,
231
240
  arguments: [
232
- tx.object(registry),
233
- tx.pure(index),
234
- tx.makeMoveVec({
235
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
236
- 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); }),
237
246
  }),
238
247
  ],
239
248
  });
240
- tx.moveCall({
241
- target: "".concat(typusFrameworkPackageId, "::utils::transfer_balance"),
242
- typeArguments: [typeArguments[1]],
243
- arguments: [tx.object(result[0]), tx.pure(user)],
244
- });
245
- tx.moveCall({
246
- target: "".concat(typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
247
- arguments: [tx.object(result[1]), 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)],
248
253
  });
249
- 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;
250
279
  }
251
280
  exports.getHarvestTx = getHarvestTx;
252
281
  /**
@@ -257,29 +286,29 @@ exports.getHarvestTx = getHarvestTx;
257
286
  ctx: &mut TxContext,
258
287
  )
259
288
  */
260
- function getRedeemTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, user) {
261
- var result = tx.moveCall({
262
- target: "".concat(packageId, "::tds_user_entry::redeem"),
263
- 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,
264
293
  arguments: [
265
- tx.object(registry),
266
- tx.pure(index),
267
- tx.makeMoveVec({
268
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusDepositReceipt"),
269
- 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); }),
270
299
  }),
271
300
  ],
272
301
  });
273
- tx.moveCall({
274
- target: "".concat(typusFrameworkPackageId, "::utils::transfer_balance"),
275
- typeArguments: [typeArguments[2]],
276
- 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)],
277
306
  });
278
- tx.moveCall({
279
- target: "".concat(typusFrameworkPackageId, "::vault::transfer_deposit_receipt"),
280
- 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)],
281
310
  });
282
- return tx;
311
+ return input.tx;
283
312
  }
284
313
  exports.getRedeemTx = getRedeemTx;
285
314
  /**
@@ -292,35 +321,39 @@ exports.getRedeemTx = getRedeemTx;
292
321
  ctx: &mut TxContext,
293
322
  )
294
323
  */
295
- function getNewBidTx(tx, packageId, typeArguments, registry, index, coins, size, premium_required, // fe float * b_token_decimal
296
- user, usingSponsoredGasCoin) {
297
- if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
298
- if (!usingSponsoredGasCoin &&
299
- (typeArguments[1] == "0x2::sui::SUI" ||
300
- typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
301
- var _a = __read(tx.splitCoins(tx.gas, [tx.pure(premium_required)]), 1), coin = _a[0];
302
- var result = tx.moveCall({
303
- target: "".concat(packageId, "::tails_staking::new_bid"),
304
- typeArguments: typeArguments,
305
- 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
+ ],
306
339
  });
307
- tx.transferObjects([tx.object(result[0])], user);
340
+ input.tx.transferObjects([input.tx.object(result[0])], input.user);
308
341
  }
309
342
  else {
310
- var result = tx.moveCall({
311
- target: "".concat(packageId, "::tails_staking::new_bid"),
312
- typeArguments: typeArguments,
343
+ var result = input.tx.moveCall({
344
+ target: "".concat(input.typusDovSinglePackageId, "::tails_staking::new_bid"),
345
+ typeArguments: input.typeArguments,
313
346
  arguments: [
314
- tx.object(registry),
315
- tx.pure(index),
316
- tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
317
- tx.pure(size),
318
- 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"),
319
352
  ],
320
353
  });
321
- tx.transferObjects([tx.object(result[0])], user);
354
+ input.tx.transferObjects([input.tx.object(result[0])], input.user);
322
355
  }
323
- return tx;
356
+ return input.tx;
324
357
  }
325
358
  exports.getNewBidTx = getNewBidTx;
326
359
  /**
@@ -331,25 +364,25 @@ exports.getNewBidTx = getNewBidTx;
331
364
  ctx: &mut TxContext,
332
365
  )
333
366
  */
334
- function getExerciseTx(tx, typusFrameworkOriginPackageId, typusFrameworkPackageId, packageId, typeArguments, registry, index, receipts, user) {
335
- var result = tx.moveCall({
336
- target: "".concat(packageId, "::tds_user_entry::exercise"),
337
- 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,
338
371
  arguments: [
339
- tx.object(registry),
340
- tx.pure(index),
341
- tx.makeMoveVec({
342
- type: "".concat(typusFrameworkOriginPackageId, "::vault::TypusBidReceipt"),
343
- 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); }),
344
377
  }),
345
378
  ],
346
379
  });
347
- tx.moveCall({
348
- target: "".concat(typusFrameworkPackageId, "::utils::transfer_balance"),
349
- typeArguments: [typeArguments[0]],
350
- 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)],
351
384
  });
352
- return tx;
385
+ return input.tx;
353
386
  }
354
387
  exports.getExerciseTx = getExerciseTx;
355
388
  /**
@@ -363,23 +396,21 @@ exports.getExerciseTx = getExerciseTx;
363
396
  ) {
364
397
  */
365
398
  function getTransferBidReceiptTx(input) {
366
- var tx = new transactions_1.TransactionBlock();
367
- tx.moveCall({
368
- 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"),
369
401
  typeArguments: input.typeArguments,
370
402
  arguments: [
371
- tx.object(input.registry),
372
- tx.pure(input.index),
373
- tx.makeMoveVec({
403
+ input.tx.object(input.typusDovSingleRegistry),
404
+ input.tx.pure(input.index),
405
+ input.tx.makeMoveVec({
374
406
  type: "".concat(input.typusFrameworkOriginPackageId, "::vault::TypusBidReceipt"),
375
- objects: input.receipts.map(function (id) { return tx.object(id); }),
407
+ objects: input.receipts.map(function (receipt) { return input.tx.object(receipt); }),
376
408
  }),
377
- tx.pure(input.share ? [input.share] : []),
378
- tx.pure(input.recipient),
409
+ input.tx.pure(input.share ? [input.share] : []),
410
+ input.tx.pure(input.recipient),
379
411
  ],
380
412
  });
381
- tx.setGasBudget(input.gasBudget);
382
- return tx;
413
+ return input.tx;
383
414
  }
384
415
  exports.getTransferBidReceiptTx = getTransferBidReceiptTx;
385
416
  /**
@@ -388,17 +419,22 @@ exports.getTransferBidReceiptTx = getTransferBidReceiptTx;
388
419
  ctx: &mut TxContext,
389
420
  )
390
421
  */
391
- function getRebateTx(gasBudget, packageId, typeArguments, registry) {
392
- var tx = new transactions_1.TransactionBlock();
393
- typeArguments.forEach(function (typeArgument) {
394
- tx.moveCall({
395
- target: "".concat(packageId, "::tds_user_entry::rebate"),
396
- typeArguments: [typeArgument],
397
- arguments: [tx.object(registry)],
398
- });
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)],
399
427
  });
400
- tx.setGasBudget(gasBudget);
401
- 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;
402
438
  }
403
439
  exports.getRebateTx = getRebateTx;
404
440
  /**
@@ -438,7 +474,7 @@ strategy_pool, vault_index, signal_index, coins, amount, size, price_percentage,
438
474
  else {
439
475
  var coin = coins.pop();
440
476
  if (coins.length > 0) {
441
- 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); }));
442
478
  }
443
479
  var _b = __read(tx.splitCoins(tx.object(coin), [tx.pure(amount)]), 1), input_coin = _b[0];
444
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.56",
5
+ "version": "1.1.58",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
8
  "@mysten/kiosk": "0.7.12",