@typus/typus-sdk 1.3.2 → 1.3.21

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.
@@ -35,237 +35,222 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
- var __read = (this && this.__read) || function (o, n) {
39
- var m = typeof Symbol === "function" && o[Symbol.iterator];
40
- if (!m) return o;
41
- var i = m.call(o), r, ar = [], e;
42
- try {
43
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
44
- }
45
- catch (error) { e = { error: error }; }
46
- finally {
47
- try {
48
- if (r && !r.done && (m = i["return"])) m.call(i);
49
- }
50
- finally { if (e) throw e.error; }
51
- }
52
- return ar;
53
- };
54
38
  Object.defineProperty(exports, "__esModule", { value: true });
55
- exports.getClaimProfitSharingTx = exports.consumeExpCoinStakedTx = exports.consumeExpCoinUnstakedTx = exports.getLevelUpTx = exports.getUnsubscribeTx = exports.getWithdrawTx = exports.getCompoundTx = exports.getDepositTx = exports.getNewBidTx = exports.getSnapshotTx = exports.getDailyAttendTx = exports.getUnstakeNftTx = exports.getCreateKioskAndLockNftTx = exports.getSwitchNftTx = exports.getStakeNftTx = exports.getTransferNftsTx = exports.getTransferNftTx = void 0;
39
+ exports.getCreateKioskAndLockNftTx = void 0;
56
40
  var transactions_1 = require("@mysten/sui.js/transactions");
57
- var constants_1 = require("../../constants");
41
+ // import { CLOCK } from "../../constants";
58
42
  var kiosk_1 = require("@mysten/kiosk");
59
- /**
60
- entry fun transfer_nft(
61
- registry: &mut Registry,
62
- from_kiosk: &mut Kiosk,
63
- from_kiosk_cap: &KioskOwnerCap,
64
- id: ID,
65
- receiver: address,
66
- ctx: &mut TxContext
67
- )
68
- */
69
- function getTransferNftTx(gasBudget, nftPackageId, registry, personalKioskPackageId, tails_id, receiver) {
70
- return __awaiter(this, void 0, void 0, function () {
71
- var tx, _a, coin, _b, personalKioskCap, borrow;
72
- return __generator(this, function (_c) {
73
- tx = new transactions_1.TransactionBlock();
74
- _a = __read(tx.splitCoins(tx.gas, [tx.pure(10000000)]), 1), coin = _a[0];
75
- if (tails_id.isPersonal) {
76
- _b = __read(tx.moveCall({
77
- target: "".concat(personalKioskPackageId, "::personal_kiosk::borrow_val"),
78
- arguments: [tx.object(tails_id.kioskCap)],
79
- }), 2), personalKioskCap = _b[0], borrow = _b[1];
80
- tx.moveCall({
81
- target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
82
- typeArguments: [],
83
- arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), tx.pure(receiver), coin],
84
- });
85
- tx.moveCall({
86
- target: "".concat(personalKioskPackageId, "::personal_kiosk::return_val"),
87
- arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
88
- });
89
- }
90
- else {
91
- tx.moveCall({
92
- target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
93
- typeArguments: [],
94
- arguments: [
95
- tx.object(registry),
96
- tx.object(tails_id.kiosk),
97
- tx.object(tails_id.kioskCap),
98
- tx.pure(tails_id.nftId),
99
- tx.pure(receiver),
100
- coin,
101
- ],
102
- });
103
- }
104
- tx.setGasBudget(gasBudget);
105
- return [2 /*return*/, tx];
106
- });
107
- });
108
- }
109
- exports.getTransferNftTx = getTransferNftTx;
110
- function getTransferNftsTx(gasBudget, nftPackageId, personalKioskPackageId, registry, tailsIds, receiver) {
111
- return __awaiter(this, void 0, void 0, function () {
112
- var tx, i, _a, coin, _b, personalKioskCap, borrow;
113
- return __generator(this, function (_c) {
114
- tx = new transactions_1.TransactionBlock();
115
- i = 0;
116
- while (i < tailsIds.length) {
117
- _a = __read(tx.splitCoins(tx.gas, [tx.pure(10000000)]), 1), coin = _a[0];
118
- if (tailsIds[i].isPersonal) {
119
- _b = __read(tx.moveCall({
120
- target: "".concat(personalKioskPackageId, "::personal_kiosk::borrow_val"),
121
- arguments: [tx.object(tailsIds[i].kioskCap)],
122
- }), 2), personalKioskCap = _b[0], borrow = _b[1];
123
- tx.moveCall({
124
- target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
125
- typeArguments: [],
126
- arguments: [
127
- tx.object(registry),
128
- tx.object(tailsIds[i].kiosk),
129
- personalKioskCap,
130
- tx.pure(tailsIds[i].nftId),
131
- tx.pure(receiver),
132
- coin,
133
- ],
134
- });
135
- tx.moveCall({
136
- target: "".concat(personalKioskPackageId, "::personal_kiosk::return_val"),
137
- arguments: [tx.object(tailsIds[i].kioskCap), personalKioskCap, borrow],
138
- });
139
- }
140
- else {
141
- tx.moveCall({
142
- target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
143
- typeArguments: [],
144
- arguments: [
145
- tx.object(registry),
146
- tx.object(tailsIds[i].kiosk),
147
- tx.object(tailsIds[i].kioskCap),
148
- tx.pure(tailsIds[i].nftId),
149
- tx.pure(receiver),
150
- coin,
151
- ],
152
- });
153
- }
154
- i += 1;
155
- }
156
- tx.setGasBudget(gasBudget);
157
- return [2 /*return*/, tx];
158
- });
159
- });
160
- }
161
- exports.getTransferNftsTx = getTransferNftsTx;
162
- /**
163
- public fun stake_nft(
164
- registry: &mut Registry,
165
- kiosk: &mut Kiosk,
166
- kiosk_cap: &KioskOwnerCap,
167
- id: ID,
168
- clock: &Clock,
169
- ctx: &mut TxContext
170
- )
171
- */
172
- function getStakeNftTx(gasBudget, nftPackageId, registry, personalKioskPackageId, tails_id) {
173
- return __awaiter(this, void 0, void 0, function () {
174
- var tx, _a, coin, _b, personalKioskCap, borrow;
175
- return __generator(this, function (_c) {
176
- tx = new transactions_1.TransactionBlock();
177
- _a = __read(tx.splitCoins(tx.gas, [tx.pure(50000000)]), 1), coin = _a[0];
178
- if (tails_id.isPersonal) {
179
- _b = __read(tx.moveCall({
180
- target: "".concat(personalKioskPackageId, "::personal_kiosk::borrow_val"),
181
- arguments: [tx.object(tails_id.kioskCap)],
182
- }), 2), personalKioskCap = _b[0], borrow = _b[1];
183
- tx.moveCall({
184
- target: "".concat(nftPackageId, "::tails_staking::stake_nft"),
185
- typeArguments: [],
186
- arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), tx.object(constants_1.CLOCK), coin],
187
- });
188
- tx.moveCall({
189
- target: "".concat(personalKioskPackageId, "::personal_kiosk::return_val"),
190
- arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
191
- });
192
- }
193
- else {
194
- tx.moveCall({
195
- target: "".concat(nftPackageId, "::tails_staking::stake_nft"),
196
- typeArguments: [],
197
- arguments: [
198
- tx.object(registry),
199
- tx.object(tails_id.kiosk),
200
- tx.object(tails_id.kioskCap),
201
- tx.pure(tails_id.nftId),
202
- tx.object(constants_1.CLOCK),
203
- coin,
204
- ],
205
- });
206
- }
207
- tx.setGasBudget(gasBudget);
208
- return [2 /*return*/, tx];
209
- });
210
- });
211
- }
212
- exports.getStakeNftTx = getStakeNftTx;
213
- function getSwitchNftTx(gasBudget, nftPackageId, registry, personalKioskPackageId, tails_id, typeArguments) {
214
- return __awaiter(this, void 0, void 0, function () {
215
- var tx, _a, coin, _b, personalKioskCap, borrow;
216
- return __generator(this, function (_c) {
217
- tx = new transactions_1.TransactionBlock();
218
- _a = __read(tx.splitCoins(tx.gas, [tx.pure(50000000)]), 1), coin = _a[0];
219
- // tx.moveCall({
220
- // target: `${nftPackageId}::tails_staking::snapshot`,
221
- // typeArguments: [],
222
- // arguments: [tx.object(registry), tx.object(CLOCK)],
223
- // });
224
- tx.moveCall({
225
- target: "".concat(nftPackageId, "::tails_staking::claim_profit_sharing"),
226
- typeArguments: typeArguments,
227
- arguments: [tx.object(registry), tx.pure("dice_profit")],
228
- });
229
- tx.moveCall({
230
- target: "".concat(nftPackageId, "::tails_staking::claim_profit_sharing"),
231
- typeArguments: typeArguments,
232
- arguments: [tx.object(registry), tx.pure("exp_profit")],
233
- });
234
- if (tails_id.isPersonal) {
235
- _b = __read(tx.moveCall({
236
- target: "".concat(personalKioskPackageId, "::personal_kiosk::borrow_val"),
237
- arguments: [tx.object(tails_id.kioskCap)],
238
- }), 2), personalKioskCap = _b[0], borrow = _b[1];
239
- tx.moveCall({
240
- target: "".concat(nftPackageId, "::tails_staking::switch_nft"),
241
- typeArguments: [],
242
- arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), tx.object(constants_1.CLOCK), coin],
243
- });
244
- tx.moveCall({
245
- target: "".concat(personalKioskPackageId, "::personal_kiosk::return_val"),
246
- arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
247
- });
248
- }
249
- else {
250
- tx.moveCall({
251
- target: "".concat(nftPackageId, "::tails_staking::switch_nft"),
252
- typeArguments: [],
253
- arguments: [
254
- tx.object(registry),
255
- tx.object(tails_id.kiosk),
256
- tx.object(tails_id.kioskCap),
257
- tx.pure(tails_id.nftId),
258
- tx.object(constants_1.CLOCK),
259
- coin,
260
- ],
261
- });
262
- }
263
- tx.setGasBudget(gasBudget);
264
- return [2 /*return*/, tx];
265
- });
266
- });
267
- }
268
- exports.getSwitchNftTx = getSwitchNftTx;
43
+ // import { SuiClient } from "@mysten/sui.js/client";
44
+ // import { TailsId, kioskOwnerCap } from "../typus-nft/fetch";
45
+ // /**
46
+ // entry fun transfer_nft(
47
+ // registry: &mut Registry,
48
+ // from_kiosk: &mut Kiosk,
49
+ // from_kiosk_cap: &KioskOwnerCap,
50
+ // id: ID,
51
+ // receiver: address,
52
+ // ctx: &mut TxContext
53
+ // )
54
+ // */
55
+ // // export async function getTransferNftTx(
56
+ // // gasBudget: number,
57
+ // // nftPackageId: string,
58
+ // // registry: string,
59
+ // // personalKioskPackageId: string,
60
+ // // tails_id: TailsId,
61
+ // // receiver: string
62
+ // // ) {
63
+ // // let tx = new TransactionBlock();
64
+ // // let [coin] = tx.splitCoins(tx.gas, [tx.pure(10000000)]);
65
+ // // if (tails_id.isPersonal) {
66
+ // // const [personalKioskCap, borrow] = tx.moveCall({
67
+ // // target: `${personalKioskPackageId}::personal_kiosk::borrow_val`,
68
+ // // arguments: [tx.object(tails_id.kioskCap)],
69
+ // // });
70
+ // // tx.moveCall({
71
+ // // target: `${nftPackageId}::tails_staking::transfer_nft`,
72
+ // // typeArguments: [],
73
+ // // arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), tx.pure(receiver), coin],
74
+ // // });
75
+ // // tx.moveCall({
76
+ // // target: `${personalKioskPackageId}::personal_kiosk::return_val`,
77
+ // // arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
78
+ // // });
79
+ // // } else {
80
+ // // tx.moveCall({
81
+ // // target: `${nftPackageId}::tails_staking::transfer_nft`,
82
+ // // typeArguments: [],
83
+ // // arguments: [
84
+ // // tx.object(registry),
85
+ // // tx.object(tails_id.kiosk),
86
+ // // tx.object(tails_id.kioskCap),
87
+ // // tx.pure(tails_id.nftId),
88
+ // // tx.pure(receiver),
89
+ // // coin,
90
+ // // ],
91
+ // // });
92
+ // // }
93
+ // // tx.setGasBudget(gasBudget);
94
+ // // return tx;
95
+ // // }
96
+ // // export async function getTransferNftsTx(
97
+ // // gasBudget: number,
98
+ // // nftPackageId: string,
99
+ // // personalKioskPackageId: string,
100
+ // // registry: string,
101
+ // // tailsIds: TailsId[],
102
+ // // receiver: string
103
+ // // ) {
104
+ // // let tx = new TransactionBlock();
105
+ // // var i = 0;
106
+ // // while (i < tailsIds.length) {
107
+ // // let [coin] = tx.splitCoins(tx.gas, [tx.pure(10000000)]);
108
+ // // if (tailsIds[i].isPersonal) {
109
+ // // const [personalKioskCap, borrow] = tx.moveCall({
110
+ // // target: `${personalKioskPackageId}::personal_kiosk::borrow_val`,
111
+ // // arguments: [tx.object(tailsIds[i].kioskCap)],
112
+ // // });
113
+ // // tx.moveCall({
114
+ // // target: `${nftPackageId}::tails_staking::transfer_nft`,
115
+ // // typeArguments: [],
116
+ // // arguments: [
117
+ // // tx.object(registry),
118
+ // // tx.object(tailsIds[i].kiosk),
119
+ // // personalKioskCap,
120
+ // // tx.pure(tailsIds[i].nftId),
121
+ // // tx.pure(receiver),
122
+ // // coin,
123
+ // // ],
124
+ // // });
125
+ // // tx.moveCall({
126
+ // // target: `${personalKioskPackageId}::personal_kiosk::return_val`,
127
+ // // arguments: [tx.object(tailsIds[i].kioskCap), personalKioskCap, borrow],
128
+ // // });
129
+ // // } else {
130
+ // // tx.moveCall({
131
+ // // target: `${nftPackageId}::tails_staking::transfer_nft`,
132
+ // // typeArguments: [],
133
+ // // arguments: [
134
+ // // tx.object(registry),
135
+ // // tx.object(tailsIds[i].kiosk),
136
+ // // tx.object(tailsIds[i].kioskCap),
137
+ // // tx.pure(tailsIds[i].nftId),
138
+ // // tx.pure(receiver),
139
+ // // coin,
140
+ // // ],
141
+ // // });
142
+ // // }
143
+ // // i += 1;
144
+ // // }
145
+ // // tx.setGasBudget(gasBudget);
146
+ // // return tx;
147
+ // // }
148
+ // /**
149
+ // public fun stake_nft(
150
+ // registry: &mut Registry,
151
+ // kiosk: &mut Kiosk,
152
+ // kiosk_cap: &KioskOwnerCap,
153
+ // id: ID,
154
+ // clock: &Clock,
155
+ // ctx: &mut TxContext
156
+ // )
157
+ // */
158
+ // // export async function getStakeNftTx(
159
+ // // gasBudget: number,
160
+ // // nftPackageId: string,
161
+ // // registry: string,
162
+ // // personalKioskPackageId: string,
163
+ // // tails_id: TailsId
164
+ // // ) {
165
+ // // let tx = new TransactionBlock();
166
+ // // let [coin] = tx.splitCoins(tx.gas, [tx.pure(50000000)]);
167
+ // // if (tails_id.isPersonal) {
168
+ // // const [personalKioskCap, borrow] = tx.moveCall({
169
+ // // target: `${personalKioskPackageId}::personal_kiosk::borrow_val`,
170
+ // // arguments: [tx.object(tails_id.kioskCap)],
171
+ // // });
172
+ // // tx.moveCall({
173
+ // // target: `${nftPackageId}::tails_staking::stake_nft`,
174
+ // // typeArguments: [],
175
+ // // arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), tx.object(CLOCK), coin],
176
+ // // });
177
+ // // tx.moveCall({
178
+ // // target: `${personalKioskPackageId}::personal_kiosk::return_val`,
179
+ // // arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
180
+ // // });
181
+ // // } else {
182
+ // // tx.moveCall({
183
+ // // target: `${nftPackageId}::tails_staking::stake_nft`,
184
+ // // typeArguments: [],
185
+ // // arguments: [
186
+ // // tx.object(registry),
187
+ // // tx.object(tails_id.kiosk),
188
+ // // tx.object(tails_id.kioskCap),
189
+ // // tx.pure(tails_id.nftId),
190
+ // // tx.object(CLOCK),
191
+ // // coin,
192
+ // // ],
193
+ // // });
194
+ // // }
195
+ // // tx.setGasBudget(gasBudget);
196
+ // // return tx;
197
+ // // }
198
+ // // export async function getSwitchNftTx(
199
+ // // gasBudget: number,
200
+ // // nftPackageId: string,
201
+ // // registry: string,
202
+ // // personalKioskPackageId: string,
203
+ // // tails_id: TailsId,
204
+ // // typeArguments: string[]
205
+ // // ) {
206
+ // // let tx = new TransactionBlock();
207
+ // // let [coin] = tx.splitCoins(tx.gas, [tx.pure(50000000)]);
208
+ // // // tx.moveCall({
209
+ // // // target: `${nftPackageId}::tails_staking::snapshot`,
210
+ // // // typeArguments: [],
211
+ // // // arguments: [tx.object(registry), tx.object(CLOCK)],
212
+ // // // });
213
+ // // tx.moveCall({
214
+ // // target: `${nftPackageId}::tails_staking::claim_profit_sharing`,
215
+ // // typeArguments,
216
+ // // arguments: [tx.object(registry), tx.pure("dice_profit")],
217
+ // // });
218
+ // // tx.moveCall({
219
+ // // target: `${nftPackageId}::tails_staking::claim_profit_sharing`,
220
+ // // typeArguments,
221
+ // // arguments: [tx.object(registry), tx.pure("exp_profit")],
222
+ // // });
223
+ // // if (tails_id.isPersonal) {
224
+ // // const [personalKioskCap, borrow] = tx.moveCall({
225
+ // // target: `${personalKioskPackageId}::personal_kiosk::borrow_val`,
226
+ // // arguments: [tx.object(tails_id.kioskCap)],
227
+ // // });
228
+ // // tx.moveCall({
229
+ // // target: `${nftPackageId}::tails_staking::switch_nft`,
230
+ // // typeArguments: [],
231
+ // // arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), tx.object(CLOCK), coin],
232
+ // // });
233
+ // // tx.moveCall({
234
+ // // target: `${personalKioskPackageId}::personal_kiosk::return_val`,
235
+ // // arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
236
+ // // });
237
+ // // } else {
238
+ // // tx.moveCall({
239
+ // // target: `${nftPackageId}::tails_staking::switch_nft`,
240
+ // // typeArguments: [],
241
+ // // arguments: [
242
+ // // tx.object(registry),
243
+ // // tx.object(tails_id.kiosk),
244
+ // // tx.object(tails_id.kioskCap),
245
+ // // tx.pure(tails_id.nftId),
246
+ // // tx.object(CLOCK),
247
+ // // coin,
248
+ // // ],
249
+ // // });
250
+ // // }
251
+ // // tx.setGasBudget(gasBudget);
252
+ // // return tx;
253
+ // // }
269
254
  function getCreateKioskAndLockNftTx(kioskClient, gasBudget, nftPackageId, policy, nft_id, singer) {
270
255
  return __awaiter(this, void 0, void 0, function () {
271
256
  var tx, kioskTx, kiosk, kioskCap;
@@ -293,369 +278,381 @@ function getCreateKioskAndLockNftTx(kioskClient, gasBudget, nftPackageId, policy
293
278
  });
294
279
  }
295
280
  exports.getCreateKioskAndLockNftTx = getCreateKioskAndLockNftTx;
296
- /**
297
- public fun unstake_nft(
298
- registry: &mut Registry,
299
- kiosk: &mut Kiosk,
300
- kiosk_cap: &KioskOwnerCap,
301
- coin: Coin<SUI>,
302
- ctx: &mut TxContext
303
- )
304
- */
305
- function getUnstakeNftTx(gasBudget, nftPackageId, registry, typeArguments, kioskOwnerCap, personalKioskPackageId) {
306
- return __awaiter(this, void 0, void 0, function () {
307
- var tx, _a, personalKioskCap, borrow;
308
- return __generator(this, function (_b) {
309
- tx = new transactions_1.TransactionBlock();
310
- // tx.moveCall({
311
- // target: `${nftPackageId}::tails_staking::snapshot`,
312
- // typeArguments: [],
313
- // arguments: [tx.object(registry), tx.object(CLOCK)],
314
- // });
315
- tx.moveCall({
316
- target: "".concat(nftPackageId, "::tails_staking::claim_profit_sharing"),
317
- typeArguments: typeArguments,
318
- arguments: [tx.object(registry), tx.pure("dice_profit")],
319
- });
320
- tx.moveCall({
321
- target: "".concat(nftPackageId, "::tails_staking::claim_profit_sharing"),
322
- typeArguments: typeArguments,
323
- arguments: [tx.object(registry), tx.pure("exp_profit")],
324
- });
325
- if (kioskOwnerCap.isPersonal) {
326
- _a = __read(tx.moveCall({
327
- target: "".concat(personalKioskPackageId, "::personal_kiosk::borrow_val"),
328
- arguments: [tx.object(kioskOwnerCap.objectId)],
329
- }), 2), personalKioskCap = _a[0], borrow = _a[1];
330
- tx.moveCall({
331
- target: "".concat(nftPackageId, "::tails_staking::unstake_nft"),
332
- typeArguments: [],
333
- arguments: [tx.object(registry), tx.object(kioskOwnerCap.kioskId), tx.object(personalKioskCap)],
334
- });
335
- tx.moveCall({
336
- target: "".concat(personalKioskPackageId, "::personal_kiosk::return_val"),
337
- arguments: [tx.object(kioskOwnerCap.objectId), personalKioskCap, borrow],
338
- });
339
- }
340
- else {
341
- tx.moveCall({
342
- target: "".concat(nftPackageId, "::tails_staking::unstake_nft"),
343
- typeArguments: [],
344
- arguments: [tx.object(registry), tx.object(kioskOwnerCap.kioskId), tx.object(kioskOwnerCap.objectId)],
345
- });
346
- }
347
- tx.setGasBudget(gasBudget);
348
- return [2 /*return*/, tx];
349
- });
350
- });
351
- }
352
- exports.getUnstakeNftTx = getUnstakeNftTx;
353
- /**
354
- public fun daily_attend(
355
- registry: &mut Registry,
356
- clock: &Clock,
357
- ctx: &mut TxContext
358
- )
359
- */
360
- function getDailyAttendTx(gasBudget, nftPackageId, registry) {
361
- return __awaiter(this, void 0, void 0, function () {
362
- var tx;
363
- return __generator(this, function (_a) {
364
- tx = new transactions_1.TransactionBlock();
365
- tx.moveCall({
366
- target: "".concat(nftPackageId, "::tails_staking::daily_attend"),
367
- typeArguments: [],
368
- arguments: [tx.object(registry), tx.object(constants_1.CLOCK)],
369
- });
370
- tx.setGasBudget(gasBudget);
371
- return [2 /*return*/, tx];
372
- });
373
- });
374
- }
375
- exports.getDailyAttendTx = getDailyAttendTx;
376
- /**
377
- entry fun snapshot(
378
- registry: &mut Registry,
379
- clock: &Clock,
380
- ctx: &mut TxContext
381
- )
382
- */
383
- function getSnapshotTx(gasBudget, typusEcosystemVersion, typusUserRegistry, typusDovSinglePackageId, registry, amount) {
384
- return __awaiter(this, void 0, void 0, function () {
385
- var tx;
386
- return __generator(this, function (_a) {
387
- tx = new transactions_1.TransactionBlock();
388
- tx.moveCall({
389
- target: "".concat(typusDovSinglePackageId, "::tails_staking::snapshot"),
390
- typeArguments: [],
391
- arguments: [tx.object(typusEcosystemVersion), tx.object(typusUserRegistry), tx.object(registry), tx.pure(amount)],
392
- });
393
- tx.setGasBudget(gasBudget);
394
- return [2 /*return*/, tx];
395
- });
396
- });
397
- }
398
- exports.getSnapshotTx = getSnapshotTx;
399
- function getNewBidTx(gasBudget_1, packageId_1, typeArguments_1, registry_1, additional_config_registry_1, index_1, priceOracle_1, coins_1, size_1, premium_required_1) {
400
- return __awaiter(this, arguments, void 0, function (gasBudget, packageId, typeArguments, registry, additional_config_registry, index, priceOracle, coins, size, premium_required, // fe float * b_token_decimal
401
- usingSponsoredGasCoin) {
402
- var tx, _a, coin;
403
- if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
404
- return __generator(this, function (_b) {
405
- tx = new transactions_1.TransactionBlock();
406
- if (!usingSponsoredGasCoin &&
407
- (typeArguments[1] == "0x2::sui::SUI" ||
408
- typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
409
- _a = __read(tx.splitCoins(tx.gas, [tx.pure(premium_required)]), 1), coin = _a[0];
410
- tx.moveCall({
411
- target: "".concat(packageId, "::tails_staking::new_bid"),
412
- typeArguments: typeArguments,
413
- arguments: [
414
- tx.pure(registry),
415
- tx.pure(additional_config_registry),
416
- tx.pure(index),
417
- tx.pure(priceOracle),
418
- tx.pure("0x6"),
419
- tx.makeMoveVec({ objects: [coin] }),
420
- tx.pure(size),
421
- ],
422
- });
423
- }
424
- else {
425
- tx.moveCall({
426
- target: "".concat(packageId, "::tails_staking::new_bid"),
427
- typeArguments: typeArguments,
428
- arguments: [
429
- tx.pure(registry),
430
- tx.pure(additional_config_registry),
431
- tx.pure(index),
432
- tx.pure(priceOracle),
433
- tx.pure("0x6"),
434
- tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
435
- tx.pure(size),
436
- ],
437
- });
438
- }
439
- tx.setGasBudget(gasBudget);
440
- return [2 /*return*/, tx];
441
- });
442
- });
443
- }
444
- exports.getNewBidTx = getNewBidTx;
445
- function getDepositTx(gasBudget_1, packageId_1, typeArguments_1, registry_1, additional_config_registry_1, index_1, coins_1, amount_1) {
446
- return __awaiter(this, arguments, void 0, function (gasBudget, packageId, typeArguments, registry, additional_config_registry, index, coins, amount, usingSponsoredGasCoin) {
447
- var tx, _a, coin;
448
- if (usingSponsoredGasCoin === void 0) { usingSponsoredGasCoin = false; }
449
- return __generator(this, function (_b) {
450
- tx = new transactions_1.TransactionBlock();
451
- if (!usingSponsoredGasCoin &&
452
- (typeArguments[0] == "0x2::sui::SUI" ||
453
- typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
454
- _a = __read(tx.splitCoins(tx.gas, [tx.pure(amount)]), 1), coin = _a[0];
455
- tx.moveCall({
456
- target: "".concat(packageId, "::tails_staking::deposit"),
457
- typeArguments: typeArguments,
458
- arguments: [
459
- tx.pure(registry),
460
- tx.pure(additional_config_registry),
461
- tx.pure(index),
462
- tx.makeMoveVec({ objects: [coin] }),
463
- tx.pure(amount),
464
- tx.object(constants_1.CLOCK),
465
- ],
466
- });
467
- }
468
- else {
469
- tx.moveCall({
470
- target: "".concat(packageId, "::tails_staking::deposit"),
471
- typeArguments: typeArguments,
472
- arguments: [
473
- tx.pure(registry),
474
- tx.pure(additional_config_registry),
475
- tx.pure(index),
476
- tx.makeMoveVec({ objects: coins.map(function (id) { return tx.object(id); }) }),
477
- tx.pure(amount),
478
- tx.object(constants_1.CLOCK),
479
- ],
480
- });
481
- }
482
- tx.setGasBudget(gasBudget);
483
- return [2 /*return*/, tx];
484
- });
485
- });
486
- }
487
- exports.getDepositTx = getDepositTx;
488
- function getCompoundTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index) {
489
- return __awaiter(this, void 0, void 0, function () {
490
- var tx;
491
- return __generator(this, function (_a) {
492
- tx = new transactions_1.TransactionBlock();
493
- tx.moveCall({
494
- target: "".concat(packageId, "::tails_staking::compound"),
495
- typeArguments: typeArguments,
496
- arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index), tx.object(constants_1.CLOCK)],
497
- });
498
- tx.setGasBudget(gasBudget);
499
- return [2 /*return*/, tx];
500
- });
501
- });
502
- }
503
- exports.getCompoundTx = getCompoundTx;
504
- function getWithdrawTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, share) {
505
- return __awaiter(this, void 0, void 0, function () {
506
- var tx;
507
- return __generator(this, function (_a) {
508
- tx = new transactions_1.TransactionBlock();
509
- tx.moveCall({
510
- target: "".concat(packageId, "::tails_staking::withdraw"),
511
- typeArguments: typeArguments,
512
- arguments: [
513
- tx.pure(registry),
514
- tx.pure(additional_config_registry),
515
- tx.pure(index),
516
- tx.pure(share ? [share] : []),
517
- tx.object(constants_1.CLOCK),
518
- ],
519
- });
520
- tx.setGasBudget(gasBudget);
521
- return [2 /*return*/, tx];
522
- });
523
- });
524
- }
525
- exports.getWithdrawTx = getWithdrawTx;
526
- function getUnsubscribeTx(gasBudget, packageId, typeArguments, registry, additional_config_registry, index, share) {
527
- return __awaiter(this, void 0, void 0, function () {
528
- var tx;
529
- return __generator(this, function (_a) {
530
- tx = new transactions_1.TransactionBlock();
531
- tx.moveCall({
532
- target: "".concat(packageId, "::tails_staking::unsubscribe"),
533
- typeArguments: typeArguments,
534
- arguments: [
535
- tx.pure(registry),
536
- tx.pure(additional_config_registry),
537
- tx.pure(index),
538
- tx.pure(share ? [share] : []),
539
- tx.object(constants_1.CLOCK),
540
- ],
541
- });
542
- tx.setGasBudget(gasBudget);
543
- return [2 /*return*/, tx];
544
- });
545
- });
546
- }
547
- exports.getUnsubscribeTx = getUnsubscribeTx;
548
- /**
549
- public fun level_up(
550
- registry: &mut Registry,
551
- ctx: &mut TxContext
552
- )
553
- */
554
- function getLevelUpTx(gasBudget, nftPackageId, registry) {
555
- return __awaiter(this, void 0, void 0, function () {
556
- var tx;
557
- return __generator(this, function (_a) {
558
- tx = new transactions_1.TransactionBlock();
559
- tx.moveCall({
560
- target: "".concat(nftPackageId, "::tails_staking::level_up"),
561
- typeArguments: [],
562
- arguments: [tx.object(registry)],
563
- });
564
- tx.setGasBudget(gasBudget);
565
- return [2 /*return*/, tx];
566
- });
567
- });
568
- }
569
- exports.getLevelUpTx = getLevelUpTx;
570
- /**
571
- entry fun consume_exp_coin_unstaked<EXP_COIN>(
572
- registry: &mut Registry,
573
- kiosk: &mut Kiosk,
574
- kiosk_cap: &KioskOwnerCap,
575
- id: ID,
576
- exp_coin: Coin<EXP_COIN>,
577
- ctx: &mut TxContext
578
- )
579
- */
580
- function consumeExpCoinUnstakedTx(gasBudget, nftPackageId, typeArguments, registry, personalKioskPackageId, tails_id, exp_coins, amount) {
581
- return __awaiter(this, void 0, void 0, function () {
582
- var tx, coin, _a, input_coin, _b, personalKioskCap, borrow;
583
- return __generator(this, function (_c) {
584
- tx = new transactions_1.TransactionBlock();
585
- coin = exp_coins.pop();
586
- if (exp_coins.length > 0) {
587
- tx.mergeCoins(tx.object(coin), exp_coins.map(function (id) { return tx.object(id); }));
588
- }
589
- _a = __read(tx.splitCoins(tx.object(coin), [tx.pure(amount)]), 1), input_coin = _a[0];
590
- if (tails_id.isPersonal) {
591
- _b = __read(tx.moveCall({
592
- target: "".concat(personalKioskPackageId, "::personal_kiosk::borrow_val"),
593
- arguments: [tx.object(tails_id.kioskCap)],
594
- }), 2), personalKioskCap = _b[0], borrow = _b[1];
595
- tx.moveCall({
596
- target: "".concat(nftPackageId, "::tails_staking::consume_exp_coin_unstaked"),
597
- typeArguments: typeArguments,
598
- arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), input_coin],
599
- });
600
- tx.moveCall({
601
- target: "".concat(personalKioskPackageId, "::personal_kiosk::return_val"),
602
- arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
603
- });
604
- }
605
- else {
606
- tx.moveCall({
607
- target: "".concat(nftPackageId, "::tails_staking::consume_exp_coin_unstaked"),
608
- typeArguments: typeArguments,
609
- arguments: [tx.object(registry), tx.object(tails_id.kiosk), tx.object(tails_id.kioskCap), tx.pure(tails_id.nftId), input_coin],
610
- });
611
- }
612
- tx.setGasBudget(gasBudget);
613
- return [2 /*return*/, tx];
614
- });
615
- });
616
- }
617
- exports.consumeExpCoinUnstakedTx = consumeExpCoinUnstakedTx;
618
- /**
619
- entry fun consume_exp_coin_staked<EXP_COIN>(
620
- registry: &mut Registry,
621
- exp_coin: Coin<EXP_COIN>,
622
- ctx: &mut TxContext
623
- )
624
- */
625
- function consumeExpCoinStakedTx(gasBudget, nftPackageId, typeArguments, registry, exp_coins, amount) {
626
- return __awaiter(this, void 0, void 0, function () {
627
- var tx, coin, _a, input_coin;
628
- return __generator(this, function (_b) {
629
- tx = new transactions_1.TransactionBlock();
630
- coin = exp_coins.pop();
631
- if (exp_coins.length > 0) {
632
- tx.mergeCoins(tx.object(coin), exp_coins.map(function (id) { return tx.object(id); }));
633
- }
634
- _a = __read(tx.splitCoins(tx.object(coin), [tx.pure(amount)]), 1), input_coin = _a[0];
635
- tx.moveCall({
636
- target: "".concat(nftPackageId, "::tails_staking::consume_exp_coin_staked"),
637
- typeArguments: typeArguments,
638
- arguments: [tx.object(registry), input_coin],
639
- });
640
- tx.setGasBudget(gasBudget);
641
- return [2 /*return*/, tx];
642
- });
643
- });
644
- }
645
- exports.consumeExpCoinStakedTx = consumeExpCoinStakedTx;
646
- function getClaimProfitSharingTx(gasBudget, packageId, registry, name, typeArguments) {
647
- return __awaiter(this, void 0, void 0, function () {
648
- var tx;
649
- return __generator(this, function (_a) {
650
- tx = new transactions_1.TransactionBlock();
651
- tx.moveCall({
652
- target: "".concat(packageId, "::tails_staking::claim_profit_sharing"),
653
- typeArguments: typeArguments,
654
- arguments: [tx.object(registry), tx.pure(name)],
655
- });
656
- tx.setGasBudget(gasBudget);
657
- return [2 /*return*/, tx];
658
- });
659
- });
660
- }
661
- exports.getClaimProfitSharingTx = getClaimProfitSharingTx;
281
+ // /**
282
+ // public fun unstake_nft(
283
+ // registry: &mut Registry,
284
+ // kiosk: &mut Kiosk,
285
+ // kiosk_cap: &KioskOwnerCap,
286
+ // coin: Coin<SUI>,
287
+ // ctx: &mut TxContext
288
+ // )
289
+ // */
290
+ // // export async function getUnstakeNftTx(
291
+ // // gasBudget: number,
292
+ // // nftPackageId: string,
293
+ // // registry: string,
294
+ // // typeArguments: string[],
295
+ // // kioskOwnerCap: kioskOwnerCap,
296
+ // // personalKioskPackageId: string
297
+ // // ) {
298
+ // // let tx = new TransactionBlock();
299
+ // // // tx.moveCall({
300
+ // // // target: `${nftPackageId}::tails_staking::snapshot`,
301
+ // // // typeArguments: [],
302
+ // // // arguments: [tx.object(registry), tx.object(CLOCK)],
303
+ // // // });
304
+ // // tx.moveCall({
305
+ // // target: `${nftPackageId}::tails_staking::claim_profit_sharing`,
306
+ // // typeArguments,
307
+ // // arguments: [tx.object(registry), tx.pure("dice_profit")],
308
+ // // });
309
+ // // tx.moveCall({
310
+ // // target: `${nftPackageId}::tails_staking::claim_profit_sharing`,
311
+ // // typeArguments,
312
+ // // arguments: [tx.object(registry), tx.pure("exp_profit")],
313
+ // // });
314
+ // // if (kioskOwnerCap.isPersonal) {
315
+ // // const [personalKioskCap, borrow] = tx.moveCall({
316
+ // // target: `${personalKioskPackageId}::personal_kiosk::borrow_val`,
317
+ // // arguments: [tx.object(kioskOwnerCap.objectId)],
318
+ // // });
319
+ // // tx.moveCall({
320
+ // // target: `${nftPackageId}::tails_staking::unstake_nft`,
321
+ // // typeArguments: [],
322
+ // // arguments: [tx.object(registry), tx.object(kioskOwnerCap.kioskId), tx.object(personalKioskCap)],
323
+ // // });
324
+ // // tx.moveCall({
325
+ // // target: `${personalKioskPackageId}::personal_kiosk::return_val`,
326
+ // // arguments: [tx.object(kioskOwnerCap.objectId), personalKioskCap, borrow],
327
+ // // });
328
+ // // } else {
329
+ // // tx.moveCall({
330
+ // // target: `${nftPackageId}::tails_staking::unstake_nft`,
331
+ // // typeArguments: [],
332
+ // // arguments: [tx.object(registry), tx.object(kioskOwnerCap.kioskId), tx.object(kioskOwnerCap.objectId)],
333
+ // // });
334
+ // // }
335
+ // // tx.setGasBudget(gasBudget);
336
+ // // return tx;
337
+ // // }
338
+ // /**
339
+ // public fun daily_attend(
340
+ // registry: &mut Registry,
341
+ // clock: &Clock,
342
+ // ctx: &mut TxContext
343
+ // )
344
+ // */
345
+ // // export async function getDailyAttendTx(gasBudget: number, nftPackageId: string, registry: string) {
346
+ // // let tx = new TransactionBlock();
347
+ // // tx.moveCall({
348
+ // // target: `${nftPackageId}::tails_staking::daily_attend`,
349
+ // // typeArguments: [],
350
+ // // arguments: [tx.object(registry), tx.object(CLOCK)],
351
+ // // });
352
+ // // tx.setGasBudget(gasBudget);
353
+ // // return tx;
354
+ // // }
355
+ // /**
356
+ // entry fun snapshot(
357
+ // registry: &mut Registry,
358
+ // clock: &Clock,
359
+ // ctx: &mut TxContext
360
+ // )
361
+ // */
362
+ // // export async function getSnapshotTx(
363
+ // // gasBudget: number,
364
+ // // typusEcosystemVersion: string,
365
+ // // typusUserRegistry: string,
366
+ // // nftPackageId: string,
367
+ // // registry: string,
368
+ // // amount: string
369
+ // // ) {
370
+ // // let tx = new TransactionBlock();
371
+ // // tx.moveCall({
372
+ // // target: `${nftPackageId}::tails_staking::snapshot`,
373
+ // // typeArguments: [],
374
+ // // arguments: [tx.object(typusEcosystemVersion), tx.object(typusUserRegistry), tx.object(registry), tx.pure(amount)],
375
+ // // });
376
+ // // tx.setGasBudget(gasBudget);
377
+ // // return tx;
378
+ // // }
379
+ // // export async function getNewBidTx(
380
+ // // gasBudget: number,
381
+ // // packageId: string,
382
+ // // typeArguments: string[],
383
+ // // registry: string,
384
+ // // additional_config_registry: string,
385
+ // // index: string,
386
+ // // priceOracle: string,
387
+ // // coins: string[],
388
+ // // size: string,
389
+ // // premium_required: string, // fe float * b_token_decimal
390
+ // // usingSponsoredGasCoin = false
391
+ // // ) {
392
+ // // let tx = new TransactionBlock();
393
+ // // if (
394
+ // // !usingSponsoredGasCoin &&
395
+ // // (typeArguments[1] == "0x2::sui::SUI" ||
396
+ // // typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")
397
+ // // ) {
398
+ // // let [coin] = tx.splitCoins(tx.gas, [tx.pure(premium_required)]);
399
+ // // tx.moveCall({
400
+ // // target: `${packageId}::tails_staking::new_bid`,
401
+ // // typeArguments,
402
+ // // arguments: [
403
+ // // tx.pure(registry),
404
+ // // tx.pure(additional_config_registry),
405
+ // // tx.pure(index),
406
+ // // tx.pure(priceOracle),
407
+ // // tx.pure("0x6"),
408
+ // // tx.makeMoveVec({ objects: [coin] }),
409
+ // // tx.pure(size),
410
+ // // ],
411
+ // // });
412
+ // // } else {
413
+ // // tx.moveCall({
414
+ // // target: `${packageId}::tails_staking::new_bid`,
415
+ // // typeArguments,
416
+ // // arguments: [
417
+ // // tx.pure(registry),
418
+ // // tx.pure(additional_config_registry),
419
+ // // tx.pure(index),
420
+ // // tx.pure(priceOracle),
421
+ // // tx.pure("0x6"),
422
+ // // tx.makeMoveVec({ objects: coins.map((id) => tx.object(id)) }),
423
+ // // tx.pure(size),
424
+ // // ],
425
+ // // });
426
+ // // }
427
+ // // tx.setGasBudget(gasBudget);
428
+ // // return tx;
429
+ // // }
430
+ // // export async function getDepositTx(
431
+ // // gasBudget: number,
432
+ // // packageId: string,
433
+ // // typeArguments: string[],
434
+ // // registry: string,
435
+ // // additional_config_registry: string,
436
+ // // index: string,
437
+ // // coins: string[],
438
+ // // amount: string,
439
+ // // usingSponsoredGasCoin = false
440
+ // // ) {
441
+ // // let tx = new TransactionBlock();
442
+ // // if (
443
+ // // !usingSponsoredGasCoin &&
444
+ // // (typeArguments[0] == "0x2::sui::SUI" ||
445
+ // // typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")
446
+ // // ) {
447
+ // // let [coin] = tx.splitCoins(tx.gas, [tx.pure(amount)]);
448
+ // // tx.moveCall({
449
+ // // target: `${packageId}::tails_staking::deposit`,
450
+ // // typeArguments,
451
+ // // arguments: [
452
+ // // tx.pure(registry),
453
+ // // tx.pure(additional_config_registry),
454
+ // // tx.pure(index),
455
+ // // tx.makeMoveVec({ objects: [coin] }),
456
+ // // tx.pure(amount),
457
+ // // tx.object(CLOCK),
458
+ // // ],
459
+ // // });
460
+ // // } else {
461
+ // // tx.moveCall({
462
+ // // target: `${packageId}::tails_staking::deposit`,
463
+ // // typeArguments,
464
+ // // arguments: [
465
+ // // tx.pure(registry),
466
+ // // tx.pure(additional_config_registry),
467
+ // // tx.pure(index),
468
+ // // tx.makeMoveVec({ objects: coins.map((id) => tx.object(id)) }),
469
+ // // tx.pure(amount),
470
+ // // tx.object(CLOCK),
471
+ // // ],
472
+ // // });
473
+ // // }
474
+ // // tx.setGasBudget(gasBudget);
475
+ // // return tx;
476
+ // // }
477
+ // // export async function getCompoundTx(
478
+ // // gasBudget: number,
479
+ // // packageId: string,
480
+ // // typeArguments: string[],
481
+ // // registry: string,
482
+ // // additional_config_registry: string,
483
+ // // index: string
484
+ // // ) {
485
+ // // let tx = new TransactionBlock();
486
+ // // tx.moveCall({
487
+ // // target: `${packageId}::tails_staking::compound`,
488
+ // // typeArguments,
489
+ // // arguments: [tx.pure(registry), tx.pure(additional_config_registry), tx.pure(index), tx.object(CLOCK)],
490
+ // // });
491
+ // // tx.setGasBudget(gasBudget);
492
+ // // return tx;
493
+ // // }
494
+ // // export async function getWithdrawTx(
495
+ // // gasBudget: number,
496
+ // // packageId: string,
497
+ // // typeArguments: string[],
498
+ // // registry: string,
499
+ // // additional_config_registry: string,
500
+ // // index: string,
501
+ // // share?: string
502
+ // // ) {
503
+ // // let tx = new TransactionBlock();
504
+ // // tx.moveCall({
505
+ // // target: `${packageId}::tails_staking::withdraw`,
506
+ // // typeArguments,
507
+ // // arguments: [
508
+ // // tx.pure(registry),
509
+ // // tx.pure(additional_config_registry),
510
+ // // tx.pure(index),
511
+ // // tx.pure(share ? [share] : []),
512
+ // // tx.object(CLOCK),
513
+ // // ],
514
+ // // });
515
+ // // tx.setGasBudget(gasBudget);
516
+ // // return tx;
517
+ // // }
518
+ // // export async function getUnsubscribeTx(
519
+ // // gasBudget: number,
520
+ // // packageId: string,
521
+ // // typeArguments: string[],
522
+ // // registry: string,
523
+ // // additional_config_registry: string,
524
+ // // index: string,
525
+ // // share?: string
526
+ // // ) {
527
+ // // let tx = new TransactionBlock();
528
+ // // tx.moveCall({
529
+ // // target: `${packageId}::tails_staking::unsubscribe`,
530
+ // // typeArguments,
531
+ // // arguments: [
532
+ // // tx.pure(registry),
533
+ // // tx.pure(additional_config_registry),
534
+ // // tx.pure(index),
535
+ // // tx.pure(share ? [share] : []),
536
+ // // tx.object(CLOCK),
537
+ // // ],
538
+ // // });
539
+ // // tx.setGasBudget(gasBudget);
540
+ // // return tx;
541
+ // // }
542
+ // /**
543
+ // public fun level_up(
544
+ // registry: &mut Registry,
545
+ // ctx: &mut TxContext
546
+ // )
547
+ // */
548
+ // // export async function getLevelUpTx(gasBudget: number, nftPackageId: string, registry: string) {
549
+ // // let tx = new TransactionBlock();
550
+ // // tx.moveCall({
551
+ // // target: `${nftPackageId}::tails_staking::level_up`,
552
+ // // typeArguments: [],
553
+ // // arguments: [tx.object(registry)],
554
+ // // });
555
+ // // tx.setGasBudget(gasBudget);
556
+ // // return tx;
557
+ // // }
558
+ // /**
559
+ // entry fun consume_exp_coin_unstaked<EXP_COIN>(
560
+ // registry: &mut Registry,
561
+ // kiosk: &mut Kiosk,
562
+ // kiosk_cap: &KioskOwnerCap,
563
+ // id: ID,
564
+ // exp_coin: Coin<EXP_COIN>,
565
+ // ctx: &mut TxContext
566
+ // )
567
+ // */
568
+ // // export async function consumeExpCoinUnstakedTx(
569
+ // // gasBudget: number,
570
+ // // nftPackageId: string,
571
+ // // typeArguments: string[],
572
+ // // registry: string,
573
+ // // personalKioskPackageId: string,
574
+ // // tails_id: TailsId,
575
+ // // exp_coins: string[],
576
+ // // amount: string
577
+ // // ) {
578
+ // // let tx = new TransactionBlock();
579
+ // // const coin = exp_coins.pop()!;
580
+ // // if (exp_coins.length > 0) {
581
+ // // tx.mergeCoins(
582
+ // // tx.object(coin),
583
+ // // exp_coins.map((id) => tx.object(id))
584
+ // // );
585
+ // // }
586
+ // // let [input_coin] = tx.splitCoins(tx.object(coin), [tx.pure(amount)]);
587
+ // // if (tails_id.isPersonal) {
588
+ // // const [personalKioskCap, borrow] = tx.moveCall({
589
+ // // target: `${personalKioskPackageId}::personal_kiosk::borrow_val`,
590
+ // // arguments: [tx.object(tails_id.kioskCap)],
591
+ // // });
592
+ // // tx.moveCall({
593
+ // // target: `${nftPackageId}::tails_staking::consume_exp_coin_unstaked`,
594
+ // // typeArguments,
595
+ // // arguments: [tx.object(registry), tx.object(tails_id.kiosk), personalKioskCap, tx.pure(tails_id.nftId), input_coin],
596
+ // // });
597
+ // // tx.moveCall({
598
+ // // target: `${personalKioskPackageId}::personal_kiosk::return_val`,
599
+ // // arguments: [tx.object(tails_id.kioskCap), personalKioskCap, borrow],
600
+ // // });
601
+ // // } else {
602
+ // // tx.moveCall({
603
+ // // target: `${nftPackageId}::tails_staking::consume_exp_coin_unstaked`,
604
+ // // typeArguments,
605
+ // // arguments: [tx.object(registry), tx.object(tails_id.kiosk), tx.object(tails_id.kioskCap), tx.pure(tails_id.nftId), input_coin],
606
+ // // });
607
+ // // }
608
+ // // tx.setGasBudget(gasBudget);
609
+ // // return tx;
610
+ // // }
611
+ // /**
612
+ // entry fun consume_exp_coin_staked<EXP_COIN>(
613
+ // registry: &mut Registry,
614
+ // exp_coin: Coin<EXP_COIN>,
615
+ // ctx: &mut TxContext
616
+ // )
617
+ // */
618
+ // // export async function consumeExpCoinStakedTx(
619
+ // // gasBudget: number,
620
+ // // nftPackageId: string,
621
+ // // typeArguments: string[],
622
+ // // registry: string,
623
+ // // exp_coins: string[],
624
+ // // amount: string
625
+ // // ) {
626
+ // // let tx = new TransactionBlock();
627
+ // // const coin = exp_coins.pop()!;
628
+ // // if (exp_coins.length > 0) {
629
+ // // tx.mergeCoins(
630
+ // // tx.object(coin),
631
+ // // exp_coins.map((id) => tx.object(id))
632
+ // // );
633
+ // // }
634
+ // // let [input_coin] = tx.splitCoins(tx.object(coin), [tx.pure(amount)]);
635
+ // // tx.moveCall({
636
+ // // target: `${nftPackageId}::tails_staking::consume_exp_coin_staked`,
637
+ // // typeArguments,
638
+ // // arguments: [tx.object(registry), input_coin],
639
+ // // });
640
+ // // tx.setGasBudget(gasBudget);
641
+ // // return tx;
642
+ // // }
643
+ // // export async function getClaimProfitSharingTx(
644
+ // // gasBudget: number,
645
+ // // packageId: string,
646
+ // // registry: string,
647
+ // // name: "dice_profit" | "exp_profit",
648
+ // // typeArguments: string[]
649
+ // // ) {
650
+ // // let tx = new TransactionBlock();
651
+ // // tx.moveCall({
652
+ // // target: `${packageId}::tails_staking::claim_profit_sharing`,
653
+ // // typeArguments,
654
+ // // arguments: [tx.object(registry), tx.pure(name)],
655
+ // // });
656
+ // // tx.setGasBudget(gasBudget);
657
+ // // return tx;
658
+ // // }