@typus/typus-sdk 1.2.74-dappkit → 1.2.75

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.
@@ -18,33 +18,33 @@ export declare function parseTypeName(name: string): {
18
18
  export declare function isTransactionArgument(arg: GenericArg): arg is TransactionArgument;
19
19
  export declare function isTransactionObjectArgument(arg: GenericArg): arg is TransactionObjectArgument;
20
20
  export declare function obj(txb: TransactionBlock, arg: ObjectArg): {
21
+ type: "pure";
21
22
  index: number;
22
23
  kind: "Input";
23
- type: "pure";
24
24
  value?: any;
25
25
  } | TransactionObjectArgument;
26
26
  export declare function pure(txb: TransactionBlock, arg: PureArg, type: string): {
27
+ type: "pure";
27
28
  index: number;
28
29
  kind: "Input";
29
- type: "pure";
30
30
  value?: any;
31
31
  } | TransactionObjectArgument;
32
32
  export declare function option(txb: TransactionBlock, type: string, arg: GenericArg | null): {
33
+ type: "pure";
33
34
  index: number;
34
35
  kind: "Input";
35
- type: "pure";
36
36
  value?: any;
37
37
  } | TransactionObjectArgument;
38
38
  export declare function generic(txb: TransactionBlock, type: string, arg: GenericArg): {
39
+ type: "pure";
39
40
  index: number;
40
41
  kind: "Input";
41
- type: "pure";
42
42
  value?: any;
43
43
  } | TransactionObjectArgument;
44
44
  export declare function vector(txb: TransactionBlock, itemType: string, items: Array<GenericArg> | TransactionArgument): {
45
+ type: "pure";
45
46
  index: number;
46
47
  kind: "Input";
47
- type: "pure";
48
48
  value?: any;
49
49
  } | TransactionObjectArgument;
50
50
  export declare function typeArgIsPure(type: string): boolean;
@@ -11,4 +11,6 @@ interface TokenAmount {
11
11
  }
12
12
  /** Returns Accumulated Users [v1, v2] */
13
13
  export declare function getAccumulatedUser(): Promise<number[]>;
14
+ /** Returns Accumulated Notional Volume in USD [v1, v2] */
15
+ export declare function getAccumulatedNotionalVolumeUSD(): Promise<number[]>;
14
16
  export {};
@@ -47,7 +47,7 @@ var __values = (this && this.__values) || function(o) {
47
47
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.getAccumulatedUser = exports.getTotalProfitSharing = exports.getTotalProfitSharingClaimed = exports.getAccumulatedRewardGeneratedUSD = exports.getTotalPremium = exports.getTotalDepositorIncentive = void 0;
50
+ exports.getAccumulatedNotionalVolumeUSD = exports.getAccumulatedUser = exports.getTotalProfitSharing = exports.getTotalProfitSharingClaimed = exports.getAccumulatedRewardGeneratedUSD = exports.getTotalPremium = exports.getTotalDepositorIncentive = void 0;
51
51
  var headers = {
52
52
  "api-key": "tz3JJ6stG7Fux6ueRSRA5mdpC9U0lozI3",
53
53
  "Content-Type": "application/json",
@@ -453,6 +453,89 @@ function getAccumulatedUser() {
453
453
  });
454
454
  }
455
455
  exports.getAccumulatedUser = getAccumulatedUser;
456
+ /** Returns Accumulated Notional Volume in USD [v1, v2] */
457
+ function getAccumulatedNotionalVolumeUSD() {
458
+ return __awaiter(this, void 0, void 0, function () {
459
+ var apiUrls, result, apiUrls_2, apiUrls_2_1, apiUrl, requestData, jsonData, response, data, e_4_1;
460
+ var e_4, _a;
461
+ return __generator(this, function (_b) {
462
+ switch (_b.label) {
463
+ case 0:
464
+ apiUrls = [
465
+ "https://app.sentio.xyz/api/v1/insights/typus/typus_v1/query",
466
+ "https://app.sentio.xyz/api/v1/insights/typus/typus_v2/query",
467
+ ];
468
+ result = [];
469
+ _b.label = 1;
470
+ case 1:
471
+ _b.trys.push([1, 7, 8, 9]);
472
+ apiUrls_2 = __values(apiUrls), apiUrls_2_1 = apiUrls_2.next();
473
+ _b.label = 2;
474
+ case 2:
475
+ if (!!apiUrls_2_1.done) return [3 /*break*/, 6];
476
+ apiUrl = apiUrls_2_1.value;
477
+ requestData = {
478
+ timeRange: {
479
+ start: "now",
480
+ end: "now",
481
+ step: 3600,
482
+ timezone: "Asia/Taipei",
483
+ },
484
+ limit: 1,
485
+ queries: [
486
+ {
487
+ metricsQuery: {
488
+ query: "AccumulatedNotionalVolumeUSD",
489
+ alias: "",
490
+ id: "a",
491
+ labelSelector: {},
492
+ aggregate: {
493
+ op: "SUM",
494
+ grouping: [],
495
+ },
496
+ functions: [],
497
+ disabled: false,
498
+ },
499
+ dataSource: "METRICS",
500
+ sourceName: "",
501
+ },
502
+ ],
503
+ formulas: [],
504
+ };
505
+ jsonData = JSON.stringify(requestData);
506
+ return [4 /*yield*/, fetch(apiUrl, {
507
+ method: "POST",
508
+ headers: headers,
509
+ body: jsonData,
510
+ })];
511
+ case 3:
512
+ response = _b.sent();
513
+ return [4 /*yield*/, response.json()];
514
+ case 4:
515
+ data = _b.sent();
516
+ console.log(data.results[0]);
517
+ result.push(data.results[0].matrix.samples[0].values[0].value);
518
+ _b.label = 5;
519
+ case 5:
520
+ apiUrls_2_1 = apiUrls_2.next();
521
+ return [3 /*break*/, 2];
522
+ case 6: return [3 /*break*/, 9];
523
+ case 7:
524
+ e_4_1 = _b.sent();
525
+ e_4 = { error: e_4_1 };
526
+ return [3 /*break*/, 9];
527
+ case 8:
528
+ try {
529
+ if (apiUrls_2_1 && !apiUrls_2_1.done && (_a = apiUrls_2.return)) _a.call(apiUrls_2);
530
+ }
531
+ finally { if (e_4) throw e_4.error; }
532
+ return [7 /*endfinally*/];
533
+ case 9: return [2 /*return*/, result];
534
+ }
535
+ });
536
+ });
537
+ }
538
+ exports.getAccumulatedNotionalVolumeUSD = getAccumulatedNotionalVolumeUSD;
456
539
  var token_1 = require("../../token");
457
540
  (function () { return __awaiter(void 0, void 0, void 0, function () {
458
541
  return __generator(this, function (_a) {
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.74-dappkit",
5
+ "version": "1.2.75",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.11.1",
8
- "@mysten/kiosk": "0.8.10",
9
- "@mysten/sui.js": "0.54.1",
8
+ "@mysten/kiosk": "0.7.12",
9
+ "@mysten/sui.js": "0.48.0",
10
10
  "@types/node": "^20.5.7",
11
11
  "aftermath-ts-sdk": "^1.1.14",
12
12
  "bignumber.js": "^9.1.1",