@typus/typus-sdk 1.2.26 → 1.2.27

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.
@@ -4,4 +4,9 @@ interface LeaderBoard {
4
4
  user: string;
5
5
  score: number;
6
6
  }
7
+ interface ExpEarn {
8
+ address: string;
9
+ total_exp_earn: number;
10
+ }
11
+ export declare function getExpLeaderBoard(startTimestamp: string): Promise<ExpEarn[]>;
7
12
  export {};
@@ -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.getBidderLeaderBoard = exports.getDepositorLeaderBoard = void 0;
55
+ exports.getExpLeaderBoard = exports.getBidderLeaderBoard = exports.getDepositorLeaderBoard = void 0;
56
56
  var apiUrl = "https://app.sentio.xyz/api/v1/insights/wayne/typus/query";
57
57
  var headers = {
58
58
  "api-key": "oBOW8DsO1izVrINCy6Tmxga9YcWeOL87O",
@@ -267,6 +267,40 @@ function getBidderLeaderBoard(startTimestamp, end) {
267
267
  });
268
268
  }
269
269
  exports.getBidderLeaderBoard = getBidderLeaderBoard;
270
+ function getExpLeaderBoard(startTimestamp) {
271
+ return __awaiter(this, void 0, void 0, function () {
272
+ var apiUrl, headers, requestData, jsonData, response, data;
273
+ return __generator(this, function (_a) {
274
+ switch (_a.label) {
275
+ case 0:
276
+ apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_v2/sql/execute";
277
+ headers = {
278
+ "api-key": "tz3JJ6stG7Fux6ueRSRA5mdpC9U0lozI3",
279
+ "Content-Type": "application/json",
280
+ };
281
+ requestData = {
282
+ sqlQuery: {
283
+ sql: "SELECT S.distinct_id as address, SUM(E.exp_earn) as total_exp_earn\nFROM ExpUp E\nJOIN StakeNft S ON E.number = S.number\nWHERE timestamp >= ".concat(startTimestamp, "\nGROUP BY address\nORDER BY total_exp_earn DESC;"),
284
+ size: 1000,
285
+ },
286
+ };
287
+ jsonData = JSON.stringify(requestData);
288
+ return [4 /*yield*/, fetch(apiUrl, {
289
+ method: "POST",
290
+ headers: headers,
291
+ body: jsonData,
292
+ })];
293
+ case 1:
294
+ response = _a.sent();
295
+ return [4 /*yield*/, response.json()];
296
+ case 2:
297
+ data = _a.sent();
298
+ return [2 /*return*/, data.result.rows];
299
+ }
300
+ });
301
+ });
302
+ }
303
+ exports.getExpLeaderBoard = getExpLeaderBoard;
270
304
  (function () { return __awaiter(void 0, void 0, void 0, function () {
271
305
  return __generator(this, function (_a) {
272
306
  return [2 /*return*/];
@@ -165,7 +165,7 @@ function getCreateKioskAndLockNftTx(kioskClient, gasBudget, nftPackageId, policy
165
165
  tx = new transactions_1.TransactionBlock();
166
166
  kioskTx = new kiosk_1.KioskTransaction({ transactionBlock: tx, kioskClient: kioskClient });
167
167
  kioskTx.create();
168
- kioskTx.lock({ itemType: "".concat(nftPackageId, "::typus_nft::Tails"), itemId: nft_id, policy: policy });
168
+ kioskTx.lock({ itemType: "".concat(nftPackageId, "::typus_nft::Tails"), itemId: nft_id, policy: policy, item: nft_id });
169
169
  kiosk = kioskTx.kiosk, kioskCap = kioskTx.kioskCap;
170
170
  if (kiosk && kioskCap) {
171
171
  tx.moveCall({
package/package.json CHANGED
@@ -2,11 +2,11 @@
2
2
  "name": "@typus/typus-sdk",
3
3
  "author": "Typus",
4
4
  "description": "typus sdk",
5
- "version": "1.2.26",
5
+ "version": "1.2.27",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.7.3",
8
- "@mysten/kiosk": "0.7.12",
9
- "@mysten/sui.js": "0.48.0",
8
+ "@mysten/kiosk": "0.8.3",
9
+ "@mysten/sui.js": "0.50.1",
10
10
  "@types/node": "^20.5.7",
11
11
  "aftermath-ts-sdk": "^1.1.14",
12
12
  "bignumber.js": "^9.1.1",