@typus/typus-sdk 1.4.31 → 1.4.32

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.
@@ -18,9 +18,9 @@
18
18
  "TOKEN": "0xd8f04cd2a16c19c17428c3b4c22b01dd06740423b93fb7ee88fbe2676a82849d",
19
19
  "NFT": "0x153ead7b2ccad1483458d41f0daffa35965d89960d1024a4883ba52fb18332b3",
20
20
  "ORACLE": "0x978f65df8570a075298598a9965c18de9087f9e888eb3430fe20334f5c554cfd",
21
- "TYPUS": "0xea14501c603e8fcd907087d3aa7cb7adb4d7b3a7ea5e078cc9e8f05c67bc8034",
21
+ "TYPUS": "0xe7e34f69536bacd5cfbefb01e1050a1ffa1af28b5fa1e09df9a1852aa66a1e1f",
22
22
  "PERP": "",
23
- "SAFU": "0xee11b5672d83f474e1337d10b472dadc45ae827fb53843986a9d8a8b28c9dc77"
23
+ "SAFU": "0x99e220c2ef63f92c789eca1073a0655fe209205d02ae525ca69b5efd85b914af"
24
24
  },
25
25
  "VERSION": {
26
26
  "TYPUS": "0xd2882b992e986250b3304b59530700bc3850939f9a77e9e9dfa9cf1656f84b3d",
@@ -18,7 +18,7 @@ export declare function getStakeTailsTx(config: TypusConfig, tx: TransactionBloc
18
18
  tails: string;
19
19
  fee: string;
20
20
  personalKioskPackageId: string | undefined;
21
- }): Promise<TransactionBlock>;
21
+ }): TransactionBlock;
22
22
  /**
23
23
  public fun unstake_tails(
24
24
  version: &mut Version,
@@ -34,7 +34,7 @@ export declare function getUnstakeTailsTx(config: TypusConfig, tx: TransactionBl
34
34
  kioskCap: string;
35
35
  tails: string;
36
36
  personalKioskPackageId: string | undefined;
37
- }): Promise<TransactionBlock>;
37
+ }): TransactionBlock;
38
38
  /**
39
39
  public fun transfer_tails(
40
40
  version: &mut Version,
@@ -54,7 +54,7 @@ export declare function getTransferTailsTx(config: TypusConfig, tx: TransactionB
54
54
  recipient: string;
55
55
  fee: string;
56
56
  personalKioskPackageId: string | undefined;
57
- }): Promise<TransactionBlock>;
57
+ }): TransactionBlock;
58
58
  /**
59
59
  entry fun daily_sign_up(
60
60
  version: &Version,
@@ -63,7 +63,9 @@ export declare function getTransferTailsTx(config: TypusConfig, tx: TransactionB
63
63
  ctx: &TxContext,
64
64
  ) {
65
65
  */
66
- export declare function getDailySignUpTx(config: TypusConfig, tx: TransactionBlock): Promise<TransactionBlock>;
66
+ export declare function getDailySignUpTx(config: TypusConfig, tx: TransactionBlock, input: {
67
+ fee: string;
68
+ }): TransactionBlock;
67
69
  /**
68
70
  public fun claim_profit_sharing<TOKEN>(
69
71
  version: &mut Version,
@@ -74,7 +76,7 @@ export declare function getDailySignUpTx(config: TypusConfig, tx: TransactionBlo
74
76
  export declare function getClaimProfitSharingTx(config: TypusConfig, tx: TransactionBlock, input: {
75
77
  typeArguments: string[];
76
78
  user: string;
77
- }): Promise<TransactionBlock>;
79
+ }): TransactionBlock;
78
80
  /**
79
81
  entry fun level_up(
80
82
  version: &Version,
@@ -86,7 +88,7 @@ export declare function getClaimProfitSharingTx(config: TypusConfig, tx: Transac
86
88
  export declare function getLevelUpTx(config: TypusConfig, tx: TransactionBlock, input: {
87
89
  tails: string;
88
90
  raw: boolean;
89
- }): Promise<TransactionBlock>;
91
+ }): TransactionBlock;
90
92
  /**
91
93
  entry fun exp_up(
92
94
  version: &Version,
@@ -100,7 +102,7 @@ export declare function getLevelUpTx(config: TypusConfig, tx: TransactionBlock,
100
102
  export declare function getExpUpTx(config: TypusConfig, tx: TransactionBlock, input: {
101
103
  tails: string;
102
104
  amount: string;
103
- }): Promise<TransactionBlock>;
105
+ }): TransactionBlock;
104
106
  /**
105
107
  entry fun exp_up_without_staking(
106
108
  version: &Version,
@@ -119,9 +121,9 @@ export declare function getExpUpWithoutStakingTx(config: TypusConfig, tx: Transa
119
121
  tails: string;
120
122
  amount: string;
121
123
  personalKioskPackageId: string | undefined;
122
- }): Promise<TransactionBlock>;
124
+ }): TransactionBlock;
123
125
  export declare function getCreateKioskAndLockNftTx(config: TypusConfig, tx: TransactionBlock, kioskClient: KioskClient, input: {
124
126
  nft_policy: string;
125
127
  nft_id: string;
126
128
  user: string;
127
- }): Promise<TransactionBlock>;
129
+ }): TransactionBlock;
@@ -1,40 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
2
  var __read = (this && this.__read) || function (o, n) {
39
3
  var m = typeof Symbol === "function" && o[Symbol.iterator];
40
4
  if (!m) return o;
@@ -75,49 +39,44 @@ var kiosk_1 = require("@mysten/kiosk");
75
39
  ) {
76
40
  */
77
41
  function getStakeTailsTx(config, tx, input) {
78
- return __awaiter(this, void 0, void 0, function () {
79
- var _a, coin, _b, personalKioskCap, borrow;
80
- return __generator(this, function (_c) {
81
- _a = __read(tx.splitCoins(tx.gas, [tx.pure(input.fee)]), 1), coin = _a[0];
82
- if (input.personalKioskPackageId) {
83
- _b = __read(tx.moveCall({
84
- target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
85
- arguments: [tx.object(input.kioskCap)],
86
- }), 2), personalKioskCap = _b[0], borrow = _b[1];
87
- tx.moveCall({
88
- target: "".concat(config.package.typus, "::tails_staking::stake_tails"),
89
- typeArguments: [],
90
- arguments: [
91
- tx.object(config.version.typus),
92
- tx.object(config.registry.typus.tailsStaking),
93
- tx.object(input.kiosk),
94
- personalKioskCap,
95
- tx.pure(input.tails),
96
- coin,
97
- ],
98
- });
99
- tx.moveCall({
100
- target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
101
- arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
102
- });
103
- }
104
- else {
105
- tx.moveCall({
106
- target: "".concat(config.package.typus, "::tails_staking::stake_tails"),
107
- typeArguments: [],
108
- arguments: [
109
- tx.object(config.version.typus),
110
- tx.object(config.registry.typus.tailsStaking),
111
- tx.object(input.kiosk),
112
- tx.object(input.kioskCap),
113
- tx.pure(input.tails),
114
- coin,
115
- ],
116
- });
117
- }
118
- return [2 /*return*/, tx];
42
+ var _a = __read(tx.splitCoins(tx.gas, [tx.pure(input.fee)]), 1), coin = _a[0];
43
+ if (input.personalKioskPackageId) {
44
+ var _b = __read(tx.moveCall({
45
+ target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
46
+ arguments: [tx.object(input.kioskCap)],
47
+ }), 2), personalKioskCap = _b[0], borrow = _b[1];
48
+ tx.moveCall({
49
+ target: "".concat(config.package.typus, "::tails_staking::stake_tails"),
50
+ typeArguments: [],
51
+ arguments: [
52
+ tx.object(config.version.typus),
53
+ tx.object(config.registry.typus.tailsStaking),
54
+ tx.object(input.kiosk),
55
+ personalKioskCap,
56
+ tx.pure(input.tails),
57
+ coin,
58
+ ],
119
59
  });
120
- });
60
+ tx.moveCall({
61
+ target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
62
+ arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
63
+ });
64
+ }
65
+ else {
66
+ tx.moveCall({
67
+ target: "".concat(config.package.typus, "::tails_staking::stake_tails"),
68
+ typeArguments: [],
69
+ arguments: [
70
+ tx.object(config.version.typus),
71
+ tx.object(config.registry.typus.tailsStaking),
72
+ tx.object(input.kiosk),
73
+ tx.object(input.kioskCap),
74
+ tx.pure(input.tails),
75
+ coin,
76
+ ],
77
+ });
78
+ }
79
+ return tx;
121
80
  }
122
81
  /**
123
82
  public fun unstake_tails(
@@ -130,46 +89,41 @@ function getStakeTailsTx(config, tx, input) {
130
89
  ) {
131
90
  */
132
91
  function getUnstakeTailsTx(config, tx, input) {
133
- return __awaiter(this, void 0, void 0, function () {
134
- var _a, personalKioskCap, borrow;
135
- return __generator(this, function (_b) {
136
- if (input.personalKioskPackageId) {
137
- _a = __read(tx.moveCall({
138
- target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
139
- arguments: [tx.object(input.kioskCap)],
140
- }), 2), personalKioskCap = _a[0], borrow = _a[1];
141
- tx.moveCall({
142
- target: "".concat(config.package.typus, "::tails_staking::unstake_tails"),
143
- typeArguments: [],
144
- arguments: [
145
- tx.object(config.version.typus),
146
- tx.object(config.registry.typus.tailsStaking),
147
- tx.object(input.kiosk),
148
- personalKioskCap,
149
- tx.pure(input.tails),
150
- ],
151
- });
152
- tx.moveCall({
153
- target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
154
- arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
155
- });
156
- }
157
- else {
158
- tx.moveCall({
159
- target: "".concat(config.package.typus, "::tails_staking::unstake_tails"),
160
- typeArguments: [],
161
- arguments: [
162
- tx.object(config.version.typus),
163
- tx.object(config.registry.typus.tailsStaking),
164
- tx.object(input.kiosk),
165
- tx.object(input.kioskCap),
166
- tx.pure(input.tails),
167
- ],
168
- });
169
- }
170
- return [2 /*return*/, tx];
92
+ if (input.personalKioskPackageId) {
93
+ var _a = __read(tx.moveCall({
94
+ target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
95
+ arguments: [tx.object(input.kioskCap)],
96
+ }), 2), personalKioskCap = _a[0], borrow = _a[1];
97
+ tx.moveCall({
98
+ target: "".concat(config.package.typus, "::tails_staking::unstake_tails"),
99
+ typeArguments: [],
100
+ arguments: [
101
+ tx.object(config.version.typus),
102
+ tx.object(config.registry.typus.tailsStaking),
103
+ tx.object(input.kiosk),
104
+ personalKioskCap,
105
+ tx.pure(input.tails),
106
+ ],
171
107
  });
172
- });
108
+ tx.moveCall({
109
+ target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
110
+ arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
111
+ });
112
+ }
113
+ else {
114
+ tx.moveCall({
115
+ target: "".concat(config.package.typus, "::tails_staking::unstake_tails"),
116
+ typeArguments: [],
117
+ arguments: [
118
+ tx.object(config.version.typus),
119
+ tx.object(config.registry.typus.tailsStaking),
120
+ tx.object(input.kiosk),
121
+ tx.object(input.kioskCap),
122
+ tx.pure(input.tails),
123
+ ],
124
+ });
125
+ }
126
+ return tx;
173
127
  }
174
128
  /**
175
129
  public fun transfer_tails(
@@ -184,51 +138,46 @@ function getUnstakeTailsTx(config, tx, input) {
184
138
  ) {
185
139
  */
186
140
  function getTransferTailsTx(config, tx, input) {
187
- return __awaiter(this, void 0, void 0, function () {
188
- var _a, coin, _b, personalKioskCap, borrow;
189
- return __generator(this, function (_c) {
190
- _a = __read(tx.splitCoins(tx.gas, [tx.pure(input.fee)]), 1), coin = _a[0];
191
- if (input.personalKioskPackageId) {
192
- _b = __read(tx.moveCall({
193
- target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
194
- arguments: [tx.object(input.kioskCap)],
195
- }), 2), personalKioskCap = _b[0], borrow = _b[1];
196
- tx.moveCall({
197
- target: "".concat(config.package.typus, "::tails_staking::transfer_tails"),
198
- typeArguments: [],
199
- arguments: [
200
- tx.object(config.version.typus),
201
- tx.object(config.registry.typus.tailsStaking),
202
- tx.object(input.kiosk),
203
- personalKioskCap,
204
- tx.pure(input.tails),
205
- coin,
206
- tx.pure(input.recipient),
207
- ],
208
- });
209
- tx.moveCall({
210
- target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
211
- arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
212
- });
213
- }
214
- else {
215
- tx.moveCall({
216
- target: "".concat(config.package.typus, "::tails_staking::transfer_tails"),
217
- typeArguments: [],
218
- arguments: [
219
- tx.object(config.version.typus),
220
- tx.object(config.registry.typus.tailsStaking),
221
- tx.object(input.kiosk),
222
- tx.object(input.kioskCap),
223
- tx.pure(input.tails),
224
- coin,
225
- tx.pure(input.recipient),
226
- ],
227
- });
228
- }
229
- return [2 /*return*/, tx];
141
+ var _a = __read(tx.splitCoins(tx.gas, [tx.pure(input.fee)]), 1), coin = _a[0];
142
+ if (input.personalKioskPackageId) {
143
+ var _b = __read(tx.moveCall({
144
+ target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
145
+ arguments: [tx.object(input.kioskCap)],
146
+ }), 2), personalKioskCap = _b[0], borrow = _b[1];
147
+ tx.moveCall({
148
+ target: "".concat(config.package.typus, "::tails_staking::transfer_tails"),
149
+ typeArguments: [],
150
+ arguments: [
151
+ tx.object(config.version.typus),
152
+ tx.object(config.registry.typus.tailsStaking),
153
+ tx.object(input.kiosk),
154
+ personalKioskCap,
155
+ tx.pure(input.tails),
156
+ coin,
157
+ tx.pure(input.recipient),
158
+ ],
230
159
  });
231
- });
160
+ tx.moveCall({
161
+ target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
162
+ arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
163
+ });
164
+ }
165
+ else {
166
+ tx.moveCall({
167
+ target: "".concat(config.package.typus, "::tails_staking::transfer_tails"),
168
+ typeArguments: [],
169
+ arguments: [
170
+ tx.object(config.version.typus),
171
+ tx.object(config.registry.typus.tailsStaking),
172
+ tx.object(input.kiosk),
173
+ tx.object(input.kioskCap),
174
+ tx.pure(input.tails),
175
+ coin,
176
+ tx.pure(input.recipient),
177
+ ],
178
+ });
179
+ }
180
+ return tx;
232
181
  }
233
182
  /**
234
183
  entry fun daily_sign_up(
@@ -238,17 +187,14 @@ function getTransferTailsTx(config, tx, input) {
238
187
  ctx: &TxContext,
239
188
  ) {
240
189
  */
241
- function getDailySignUpTx(config, tx) {
242
- return __awaiter(this, void 0, void 0, function () {
243
- return __generator(this, function (_a) {
244
- tx.moveCall({
245
- target: "".concat(config.package.typus, "::tails_staking::daily_sign_up"),
246
- typeArguments: [],
247
- arguments: [tx.object(config.version.typus), tx.object(config.registry.typus.tailsStaking), tx.pure(constants_1.CLOCK)],
248
- });
249
- return [2 /*return*/, tx];
250
- });
190
+ function getDailySignUpTx(config, tx, input) {
191
+ var _a = __read(tx.splitCoins(tx.gas, [tx.pure(input.fee)]), 1), coin = _a[0];
192
+ tx.moveCall({
193
+ target: "".concat(config.package.typus, "::tails_staking::daily_sign_up"),
194
+ typeArguments: [],
195
+ arguments: [tx.object(config.version.typus), tx.object(config.registry.typus.tailsStaking), tx.object(coin), tx.object(constants_1.CLOCK)],
251
196
  });
197
+ return tx;
252
198
  }
253
199
  /**
254
200
  public fun claim_profit_sharing<TOKEN>(
@@ -258,22 +204,17 @@ function getDailySignUpTx(config, tx) {
258
204
  ): Balance<TOKEN>
259
205
  */
260
206
  function getClaimProfitSharingTx(config, tx, input) {
261
- return __awaiter(this, void 0, void 0, function () {
262
- var result;
263
- return __generator(this, function (_a) {
264
- result = tx.moveCall({
265
- target: "".concat(config.package.typus, "::tails_staking::claim_profit_sharing"),
266
- typeArguments: input.typeArguments,
267
- arguments: [tx.object(config.version.typus), tx.object(config.registry.typus.tailsStaking)],
268
- });
269
- tx.moveCall({
270
- target: "".concat(config.package.typus, "::utility::transfer_balance"),
271
- typeArguments: input.typeArguments,
272
- arguments: [tx.object(result[0]), tx.pure(input.user)],
273
- });
274
- return [2 /*return*/, tx];
275
- });
207
+ var result = tx.moveCall({
208
+ target: "".concat(config.package.typus, "::tails_staking::claim_profit_sharing"),
209
+ typeArguments: input.typeArguments,
210
+ arguments: [tx.object(config.version.typus), tx.object(config.registry.typus.tailsStaking)],
276
211
  });
212
+ tx.moveCall({
213
+ target: "".concat(config.package.typus, "::utility::transfer_balance"),
214
+ typeArguments: input.typeArguments,
215
+ arguments: [tx.object(result[0]), tx.pure(input.user)],
216
+ });
217
+ return tx;
277
218
  }
278
219
  /**
279
220
  entry fun level_up(
@@ -284,21 +225,17 @@ function getClaimProfitSharingTx(config, tx, input) {
284
225
  ) {
285
226
  */
286
227
  function getLevelUpTx(config, tx, input) {
287
- return __awaiter(this, void 0, void 0, function () {
288
- return __generator(this, function (_a) {
289
- tx.moveCall({
290
- target: "".concat(config.package.typus, "::tails_staking::level_up"),
291
- typeArguments: [],
292
- arguments: [
293
- tx.object(config.version.typus),
294
- tx.object(config.registry.typus.tailsStaking),
295
- tx.pure(input.tails),
296
- tx.pure(input.raw),
297
- ],
298
- });
299
- return [2 /*return*/, tx];
300
- });
228
+ tx.moveCall({
229
+ target: "".concat(config.package.typus, "::tails_staking::level_up"),
230
+ typeArguments: [],
231
+ arguments: [
232
+ tx.object(config.version.typus),
233
+ tx.object(config.registry.typus.tailsStaking),
234
+ tx.pure(input.tails),
235
+ tx.pure(input.raw),
236
+ ],
301
237
  });
238
+ return tx;
302
239
  }
303
240
  /**
304
241
  entry fun exp_up(
@@ -311,22 +248,18 @@ function getLevelUpTx(config, tx, input) {
311
248
  ) {
312
249
  */
313
250
  function getExpUpTx(config, tx, input) {
314
- return __awaiter(this, void 0, void 0, function () {
315
- return __generator(this, function (_a) {
316
- tx.moveCall({
317
- target: "".concat(config.package.typus, "::tails_staking::exp_up"),
318
- typeArguments: [],
319
- arguments: [
320
- tx.object(config.version.typus),
321
- tx.object(config.registry.typus.tailsStaking),
322
- tx.object(config.registry.typus.user),
323
- tx.pure(input.tails),
324
- tx.pure(input.amount),
325
- ],
326
- });
327
- return [2 /*return*/, tx];
328
- });
251
+ tx.moveCall({
252
+ target: "".concat(config.package.typus, "::tails_staking::exp_up"),
253
+ typeArguments: [],
254
+ arguments: [
255
+ tx.object(config.version.typus),
256
+ tx.object(config.registry.typus.tailsStaking),
257
+ tx.object(config.registry.typus.user),
258
+ tx.pure(input.tails),
259
+ tx.pure(input.amount),
260
+ ],
329
261
  });
262
+ return tx;
330
263
  }
331
264
  /**
332
265
  entry fun exp_up_without_staking(
@@ -341,76 +274,66 @@ function getExpUpTx(config, tx, input) {
341
274
  ) {
342
275
  */
343
276
  function getExpUpWithoutStakingTx(config, tx, input) {
344
- return __awaiter(this, void 0, void 0, function () {
345
- var _a, personalKioskCap, borrow;
346
- return __generator(this, function (_b) {
347
- if (input.personalKioskPackageId) {
348
- _a = __read(tx.moveCall({
349
- target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
350
- arguments: [tx.object(input.kioskCap)],
351
- }), 2), personalKioskCap = _a[0], borrow = _a[1];
352
- tx.moveCall({
353
- target: "".concat(config.package.typus, "::tails_staking::exp_up_without_staking"),
354
- typeArguments: [],
355
- arguments: [
356
- tx.object(config.version.typus),
357
- tx.object(config.registry.typus.tailsStaking),
358
- tx.object(config.registry.typus.user),
359
- tx.object(input.kiosk),
360
- personalKioskCap,
361
- tx.pure(input.tails),
362
- tx.pure(input.amount),
363
- ],
364
- });
365
- tx.moveCall({
366
- target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
367
- arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
368
- });
369
- }
370
- else {
371
- tx.moveCall({
372
- target: "".concat(config.package.typus, "::tails_staking::exp_up_without_staking"),
373
- typeArguments: [],
374
- arguments: [
375
- tx.object(config.version.typus),
376
- tx.object(config.registry.typus.tailsStaking),
377
- tx.object(config.registry.typus.user),
378
- tx.object(input.kiosk),
379
- tx.object(input.kioskCap),
380
- tx.pure(input.tails),
381
- tx.pure(input.amount),
382
- ],
383
- });
384
- }
385
- return [2 /*return*/, tx];
277
+ if (input.personalKioskPackageId) {
278
+ var _a = __read(tx.moveCall({
279
+ target: "".concat(input.personalKioskPackageId, "::personal_kiosk::borrow_val"),
280
+ arguments: [tx.object(input.kioskCap)],
281
+ }), 2), personalKioskCap = _a[0], borrow = _a[1];
282
+ tx.moveCall({
283
+ target: "".concat(config.package.typus, "::tails_staking::exp_up_without_staking"),
284
+ typeArguments: [],
285
+ arguments: [
286
+ tx.object(config.version.typus),
287
+ tx.object(config.registry.typus.tailsStaking),
288
+ tx.object(config.registry.typus.user),
289
+ tx.object(input.kiosk),
290
+ personalKioskCap,
291
+ tx.pure(input.tails),
292
+ tx.pure(input.amount),
293
+ ],
386
294
  });
387
- });
295
+ tx.moveCall({
296
+ target: "".concat(input.personalKioskPackageId, "::personal_kiosk::return_val"),
297
+ arguments: [tx.object(input.kioskCap), personalKioskCap, borrow],
298
+ });
299
+ }
300
+ else {
301
+ tx.moveCall({
302
+ target: "".concat(config.package.typus, "::tails_staking::exp_up_without_staking"),
303
+ typeArguments: [],
304
+ arguments: [
305
+ tx.object(config.version.typus),
306
+ tx.object(config.registry.typus.tailsStaking),
307
+ tx.object(config.registry.typus.user),
308
+ tx.object(input.kiosk),
309
+ tx.object(input.kioskCap),
310
+ tx.pure(input.tails),
311
+ tx.pure(input.amount),
312
+ ],
313
+ });
314
+ }
315
+ return tx;
388
316
  }
389
317
  function getCreateKioskAndLockNftTx(config, tx, kioskClient, input) {
390
- return __awaiter(this, void 0, void 0, function () {
391
- var kioskTx, kiosk, kioskCap;
392
- return __generator(this, function (_a) {
393
- kioskTx = new kiosk_1.KioskTransaction({ transactionBlock: tx, kioskClient: kioskClient });
394
- kioskTx.create();
395
- kioskTx.lock({
396
- itemType: "".concat(config.package.nft, "::typus_nft::Tails"),
397
- itemId: input.nft_id,
398
- policy: input.nft_policy,
399
- item: input.nft_id,
400
- });
401
- kiosk = kioskTx.kiosk, kioskCap = kioskTx.kioskCap;
402
- if (kiosk && kioskCap) {
403
- tx.moveCall({
404
- target: "0x2::transfer::public_share_object",
405
- typeArguments: [kiosk_1.KIOSK_TYPE],
406
- arguments: [kiosk],
407
- });
408
- tx.transferObjects([kioskCap], tx.pure(input.user));
409
- }
410
- else {
411
- console.error("Fail to Create Kiosk Tx!!");
412
- }
413
- return [2 /*return*/, tx];
414
- });
318
+ var kioskTx = new kiosk_1.KioskTransaction({ transactionBlock: tx, kioskClient: kioskClient });
319
+ kioskTx.create();
320
+ kioskTx.lock({
321
+ itemType: "".concat(config.package.nft, "::typus_nft::Tails"),
322
+ itemId: input.nft_id,
323
+ policy: input.nft_policy,
324
+ item: input.nft_id,
415
325
  });
326
+ var kiosk = kioskTx.kiosk, kioskCap = kioskTx.kioskCap;
327
+ if (kiosk && kioskCap) {
328
+ tx.moveCall({
329
+ target: "0x2::transfer::public_share_object",
330
+ typeArguments: [kiosk_1.KIOSK_TYPE],
331
+ arguments: [kiosk],
332
+ });
333
+ tx.transferObjects([kioskCap], tx.pure(input.user));
334
+ }
335
+ else {
336
+ console.error("Fail to Create Kiosk Tx!!");
337
+ }
338
+ return tx;
416
339
  }
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.4.31",
5
+ "version": "1.4.32",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.11.1",
8
8
  "@mysten/kiosk": "0.8.10",