@typus/typus-perp-sdk 1.0.59-leaderboard-a → 1.0.59-leaderboard-b

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.
@@ -8,12 +8,12 @@ export declare function getFromSentio(event: string, userAddress: string, startT
8
8
  * key: base_token {'APT','BTC','CETUS','DEEP','ETH','NAVX','NS','SOL','SUI','WAL'}
9
9
  * value: Volume[]
10
10
  */
11
- export declare function getTradingVolumeFromSentio(fromTimestamp: number, interval: number): Promise<Map<string, Volume[]>>;
11
+ export declare function getTradingVolumeFromSentio(fromTimestamp: number, interval: number, toTimestamp?: number): Promise<Map<string, Volume[]>>;
12
12
  export interface Volume {
13
13
  timestamp: string;
14
14
  value: number;
15
15
  }
16
16
  export declare function getTlpFeeFromSentio(): Promise<number>;
17
- export declare function getTotalVolumeFromSentio(): Promise<number>;
17
+ export declare function getTotalVolumeFromSentio(fromTimestamp: number, toTimestamp: number): Promise<number>;
18
18
  /** Returns Accumulated Users */
19
19
  export declare function getAccumulatedUser(): Promise<number>;
@@ -93,7 +93,7 @@ function getFromSentio(event, userAddress, startTimestamp) {
93
93
  * key: base_token {'APT','BTC','CETUS','DEEP','ETH','NAVX','NS','SOL','SUI','WAL'}
94
94
  * value: Volume[]
95
95
  */
96
- function getTradingVolumeFromSentio(fromTimestamp, interval) {
96
+ function getTradingVolumeFromSentio(fromTimestamp, interval, toTimestamp) {
97
97
  return __awaiter(this, void 0, void 0, function () {
98
98
  var apiUrl, requestData, jsonData, response, data, samples, map;
99
99
  return __generator(this, function (_a) {
@@ -105,7 +105,7 @@ function getTradingVolumeFromSentio(fromTimestamp, interval) {
105
105
  requestData = {
106
106
  timeRange: {
107
107
  start: "".concat(fromTimestamp),
108
- end: "now",
108
+ end: "".concat(toTimestamp !== null && toTimestamp !== void 0 ? toTimestamp : "now"),
109
109
  step: 3600 * interval,
110
110
  },
111
111
  limit: 30 * 24,
@@ -227,7 +227,7 @@ function getTlpFeeFromSentio() {
227
227
  });
228
228
  });
229
229
  }
230
- function getTotalVolumeFromSentio() {
230
+ function getTotalVolumeFromSentio(fromTimestamp, toTimestamp) {
231
231
  return __awaiter(this, void 0, void 0, function () {
232
232
  var apiUrl, requestData, jsonData, response, data, result;
233
233
  return __generator(this, function (_a) {
@@ -238,8 +238,8 @@ function getTotalVolumeFromSentio() {
238
238
  : "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
239
239
  requestData = {
240
240
  timeRange: {
241
- start: "now-1h",
242
- end: "now",
241
+ start: "".concat(fromTimestamp),
242
+ end: "".concat(toTimestamp),
243
243
  step: 3600,
244
244
  },
245
245
  limit: 1,
@@ -275,7 +275,7 @@ function getTotalVolumeFromSentio() {
275
275
  return [4 /*yield*/, response.json()];
276
276
  case 2:
277
277
  data = _a.sent();
278
- result = data.results[0].matrix.samples[0].values.at(-1).value;
278
+ result = data.results[0].matrix.samples[0].values.at(-1).value - data.results[0].matrix.samples[0].values.at(0).value;
279
279
  // console.log(result);
280
280
  return [2 /*return*/, result];
281
281
  }
@@ -349,5 +349,5 @@ function getAccumulatedUser() {
349
349
  // getVolumeFromSentio();
350
350
  // getTlpFeeFromSentio();
351
351
  // getAccumulatedUser();
352
- // getTotalVolumeFromSentio();
353
- // getTradingVolumeFromSentio(1745712000, 1);
352
+ // getTradingVolumeFromSentio(1747008000, 1, 1747011600);
353
+ // getTotalVolumeFromSentio(1747008000, 1747011600);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typus/typus-perp-sdk",
3
- "version": "1.0.59-leaderboard-a",
3
+ "version": "1.0.59-leaderboard-b",
4
4
  "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
5
  "author": "Typus",
6
6
  "description": "typus perp sdk",