@typus/typus-sdk 1.2.69 → 1.2.70
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
2
2
|
import { KioskClient } from "@mysten/kiosk";
|
|
3
|
-
import { TailsId } from "../typus-nft/fetch";
|
|
3
|
+
import { TailsId, kioskOwnerCap } from "../typus-nft/fetch";
|
|
4
4
|
/**
|
|
5
5
|
entry fun transfer_nft(
|
|
6
6
|
registry: &mut Registry,
|
|
@@ -35,7 +35,7 @@ export declare function getCreateKioskAndLockNftTx(kioskClient: KioskClient, gas
|
|
|
35
35
|
ctx: &mut TxContext
|
|
36
36
|
)
|
|
37
37
|
*/
|
|
38
|
-
export declare function getUnstakeNftTx(gasBudget: number, nftPackageId: string, registry: string,
|
|
38
|
+
export declare function getUnstakeNftTx(gasBudget: number, nftPackageId: string, registry: string, typeArguments: string[], kioskOwnerCap: kioskOwnerCap, personalKioskPackageId: string): Promise<TransactionBlock>;
|
|
39
39
|
/**
|
|
40
40
|
public fun daily_attend(
|
|
41
41
|
registry: &mut Registry,
|
|
@@ -302,10 +302,10 @@ exports.getCreateKioskAndLockNftTx = getCreateKioskAndLockNftTx;
|
|
|
302
302
|
ctx: &mut TxContext
|
|
303
303
|
)
|
|
304
304
|
*/
|
|
305
|
-
function getUnstakeNftTx(gasBudget, nftPackageId, registry,
|
|
305
|
+
function getUnstakeNftTx(gasBudget, nftPackageId, registry, typeArguments, kioskOwnerCap, personalKioskPackageId) {
|
|
306
306
|
return __awaiter(this, void 0, void 0, function () {
|
|
307
|
-
var tx;
|
|
308
|
-
return __generator(this, function (
|
|
307
|
+
var tx, _a, personalKioskCap, borrow;
|
|
308
|
+
return __generator(this, function (_b) {
|
|
309
309
|
tx = new transactions_1.TransactionBlock();
|
|
310
310
|
tx.moveCall({
|
|
311
311
|
target: "".concat(nftPackageId, "::tails_staking::snapshot"),
|
|
@@ -322,11 +322,28 @@ function getUnstakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, ty
|
|
|
322
322
|
typeArguments: typeArguments,
|
|
323
323
|
arguments: [tx.object(registry), tx.pure("exp_profit")],
|
|
324
324
|
});
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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
|
+
}
|
|
330
347
|
tx.setGasBudget(gasBudget);
|
|
331
348
|
return [2 /*return*/, tx];
|
|
332
349
|
});
|