@typus/typus-sdk 1.0.107 → 1.0.109

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.
@@ -22,7 +22,7 @@ export declare function getTransferNftsTx(gasBudget: number, nftPackageId: strin
22
22
  )
23
23
  */
24
24
  export declare function getStakeNftTx(gasBudget: number, nftPackageId: string, registry: string, kiosk: string, kiosk_cap: string, nft_id: string): Promise<TransactionBlock>;
25
- export declare function getStakeNftFromNoKioskTx(gasBudget: number, PackageId: string, nftPackageId: string, policy: string, registry: string, nft_id: string, singer: string): Promise<TransactionBlock>;
25
+ export declare function getCreateKioskAndLockNftTx(gasBudget: number, nftPackageId: string, policy: string, nft_id: string, singer: string): Promise<TransactionBlock>;
26
26
  /**
27
27
  public fun unstake_nft(
28
28
  registry: &mut Registry,
@@ -52,7 +52,7 @@ var __read = (this && this.__read) || function (o, n) {
52
52
  return ar;
53
53
  };
54
54
  Object.defineProperty(exports, "__esModule", { value: true });
55
- exports.getLevelUpTx = exports.getDepositWithNftTx = exports.getNewBidWithNftTx = exports.getDailyAttendTx = exports.getUnstakeNftTx = exports.getStakeNftFromNoKioskTx = exports.getStakeNftTx = exports.getTransferNftsTx = exports.getTransferNftTx = void 0;
55
+ exports.getLevelUpTx = exports.getDepositWithNftTx = exports.getNewBidWithNftTx = exports.getDailyAttendTx = exports.getUnstakeNftTx = exports.getCreateKioskAndLockNftTx = exports.getStakeNftTx = exports.getTransferNftsTx = exports.getTransferNftTx = void 0;
56
56
  var sui_js_1 = require("@mysten/sui.js");
57
57
  var constants_1 = require("../../constants");
58
58
  var kiosk_1 = require("@mysten/kiosk");
@@ -128,17 +128,17 @@ function getStakeNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, nft_
128
128
  });
129
129
  }
130
130
  exports.getStakeNftTx = getStakeNftTx;
131
- function getStakeNftFromNoKioskTx(gasBudget, PackageId, nftPackageId, policy, registry, nft_id, singer) {
131
+ function getCreateKioskAndLockNftTx(gasBudget, nftPackageId, policy, nft_id, singer) {
132
132
  return __awaiter(this, void 0, void 0, function () {
133
133
  var tx, _a, kiosk, kiosk_cap;
134
134
  return __generator(this, function (_b) {
135
135
  tx = new sui_js_1.TransactionBlock();
136
136
  _a = __read((0, kiosk_1.createKiosk)(tx), 2), kiosk = _a[0], kiosk_cap = _a[1];
137
- (0, kiosk_1.lock)(tx, "".concat(nftPackageId, "::typus_nft::Tails"), kiosk, kiosk_cap, policy, tx.object(nft_id));
137
+ (0, kiosk_1.lock)(tx, "".concat(nftPackageId, "::typus_nft::Tails"), kiosk, kiosk_cap, tx.object(policy), tx.object(nft_id));
138
138
  tx.moveCall({
139
- target: "".concat(PackageId, "::tails_staking::stake_nft"),
140
- typeArguments: [],
141
- arguments: [tx.object(registry), kiosk, kiosk_cap, tx.object(nft_id), tx.object(constants_1.CLOCK)],
139
+ target: "0x2::transfer::public_share_object",
140
+ typeArguments: [kiosk_1.KIOSK_TYPE],
141
+ arguments: [kiosk],
142
142
  });
143
143
  tx.transferObjects([kiosk_cap], tx.pure(singer));
144
144
  tx.setGasBudget(gasBudget);
@@ -146,7 +146,7 @@ function getStakeNftFromNoKioskTx(gasBudget, PackageId, nftPackageId, policy, re
146
146
  });
147
147
  });
148
148
  }
149
- exports.getStakeNftFromNoKioskTx = getStakeNftFromNoKioskTx;
149
+ exports.getCreateKioskAndLockNftTx = getCreateKioskAndLockNftTx;
150
150
  /**
151
151
  public fun unstake_nft(
152
152
  registry: &mut Registry,
@@ -4,7 +4,7 @@ export interface Vault {
4
4
  id: string;
5
5
  info: Info;
6
6
  config: Config;
7
- deposit_vault: DepositVault;
7
+ depositVault: DepositVault;
8
8
  }
9
9
  export interface Info {
10
10
  index: string;
@@ -125,7 +125,9 @@ export interface DepositVault {
125
125
  u64_padding: string[];
126
126
  bcs_padding: string[];
127
127
  }
128
- export declare function getVaults(provider: JsonRpcProvider, typusFrameworkPackageId: string, packageId: string, registry: string, indexes: string[]): Promise<Map<string, DepositShare>>;
128
+ export declare function getVaults(provider: JsonRpcProvider, typusFrameworkPackageId: string, packageId: string, registry: string, indexes: string[]): Promise<{
129
+ [key: string]: Vault;
130
+ }>;
129
131
  export interface DepositShare {
130
132
  index: string;
131
133
  activeSubVaultUserShare: string;
@@ -75,13 +75,8 @@ function getVaults(provider, typusFrameworkPackageId, packageId, registry, index
75
75
  case 1:
76
76
  results = (_a.sent()).results;
77
77
  bytes = results[results.length - 1].returnValues[0][0];
78
- console.log(JSON.stringify(bytes));
79
78
  reader = new bcs_1.BcsReader(new Uint8Array(bytes));
80
- result = Array.from(new Map()).reduce(function (map, _a) {
81
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
82
- map[key] = value;
83
- return map;
84
- }, {});
79
+ result = {};
85
80
  reader.readVec(function (reader) {
86
81
  reader.read16();
87
82
  var id = (0, tools_1.AddressFromBytes)(reader.readBytes(32));
@@ -264,10 +259,9 @@ function getVaults(provider, typusFrameworkPackageId, packageId, registry, index
264
259
  id: id,
265
260
  info: info,
266
261
  config: config,
267
- deposit_vault: deposit_vault,
262
+ depositVault: deposit_vault,
268
263
  };
269
264
  });
270
- // @ts-ignore
271
265
  return [2 /*return*/, result];
272
266
  }
273
267
  });
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.0.107",
5
+ "version": "1.0.109",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
8
  "@mysten/kiosk": "^0.3.3",