@typus/typus-sdk 1.2.65 → 1.2.66

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.
@@ -12,7 +12,7 @@ import { TailsId } from "../typus-nft/fetch";
12
12
  )
13
13
  */
14
14
  export declare function getTransferNftTx(gasBudget: number, nftPackageId: string, registry: string, personalKioskPackageId: string, tails_id: TailsId, receiver: string): Promise<TransactionBlock>;
15
- export declare function getTransferNftsTx(gasBudget: number, nftPackageId: string, registry: string, kiosks: string[], kiosk_caps: string[], nft_ids: string[], receiver: string): Promise<TransactionBlock>;
15
+ export declare function getTransferNftsTx(gasBudget: number, nftPackageId: string, personalKioskPackageId: string, registry: string, tailsIds: TailsId[], receiver: string): Promise<TransactionBlock>;
16
16
  /**
17
17
  public fun stake_nft(
18
18
  registry: &mut Registry,
@@ -107,19 +107,50 @@ function getTransferNftTx(gasBudget, nftPackageId, registry, personalKioskPackag
107
107
  });
108
108
  }
109
109
  exports.getTransferNftTx = getTransferNftTx;
110
- function getTransferNftsTx(gasBudget, nftPackageId, registry, kiosks, kiosk_caps, nft_ids, receiver) {
110
+ function getTransferNftsTx(gasBudget, nftPackageId, personalKioskPackageId, registry, tailsIds, receiver) {
111
111
  return __awaiter(this, void 0, void 0, function () {
112
- var tx, i, _a, coin;
113
- return __generator(this, function (_b) {
112
+ var tx, i, _a, coin, _b, personalKioskCap, borrow;
113
+ return __generator(this, function (_c) {
114
114
  tx = new transactions_1.TransactionBlock();
115
115
  i = 0;
116
- while (i < kiosks.length) {
116
+ while (i < tailsIds.length) {
117
117
  _a = __read(tx.splitCoins(tx.gas, [tx.pure(10000000)]), 1), coin = _a[0];
118
- tx.moveCall({
119
- target: "".concat(nftPackageId, "::tails_staking::transfer_nft"),
120
- typeArguments: [],
121
- arguments: [tx.object(registry), tx.object(kiosks[i]), tx.object(kiosk_caps[i]), tx.pure(nft_ids[i]), tx.pure(receiver), coin],
122
- });
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
+ }
123
154
  i += 1;
124
155
  }
125
156
  tx.setGasBudget(gasBudget);
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.2.65",
5
+ "version": "1.2.66",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
8
  "@mysten/kiosk": "0.7.12",