@typus/typus-perp-sdk 1.1.32-codegen-exp20 → 1.1.32-codegen-exp21
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.
- package/dist/src/api/sentio.d.ts +2 -2
- package/dist/src/api/sentio.js +3 -13
- package/package.json +3 -3
package/dist/src/api/sentio.d.ts
CHANGED
|
@@ -27,10 +27,10 @@ export declare function getAccumulatedUser(): Promise<number>;
|
|
|
27
27
|
* Returns
|
|
28
28
|
* { timestamp: string, value: number }[]
|
|
29
29
|
*/
|
|
30
|
-
export declare function getTlpPriceFromSentio(fromTimestamp?: number, toTimestamp?: number): Promise<
|
|
30
|
+
export declare function getTlpPriceFromSentio(fromTimestamp?: number, toTimestamp?: number): Promise<{
|
|
31
31
|
timestamp: string;
|
|
32
32
|
value: number;
|
|
33
|
-
}[]
|
|
33
|
+
}[]>;
|
|
34
34
|
export declare function getTlpComparisonFromSentio(startTimestamp: number, endTimestamp: number): Promise<tlpComparison[]>;
|
|
35
35
|
interface tlpComparison {
|
|
36
36
|
hour: string;
|
package/dist/src/api/sentio.js
CHANGED
|
@@ -392,9 +392,8 @@ async function getAccumulatedUser() {
|
|
|
392
392
|
* { timestamp: string, value: number }[]
|
|
393
393
|
*/
|
|
394
394
|
async function getTlpPriceFromSentio(fromTimestamp, toTimestamp) {
|
|
395
|
-
let apiUrl = "https://
|
|
395
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
|
|
396
396
|
let requestData = {
|
|
397
|
-
version: 3,
|
|
398
397
|
timeRange: {
|
|
399
398
|
start: `${fromTimestamp ?? 0}`,
|
|
400
399
|
end: `${toTimestamp ?? now()}`,
|
|
@@ -418,11 +417,6 @@ async function getTlpPriceFromSentio(fromTimestamp, toTimestamp) {
|
|
|
418
417
|
},
|
|
419
418
|
],
|
|
420
419
|
formulas: [],
|
|
421
|
-
cachePolicy: {
|
|
422
|
-
noCache: false,
|
|
423
|
-
cacheTtlSecs: 43200,
|
|
424
|
-
cacheRefreshTtlSecs: 1800,
|
|
425
|
-
},
|
|
426
420
|
};
|
|
427
421
|
let jsonData = JSON.stringify(requestData);
|
|
428
422
|
let response = await fetch(apiUrl, {
|
|
@@ -431,14 +425,10 @@ async function getTlpPriceFromSentio(fromTimestamp, toTimestamp) {
|
|
|
431
425
|
body: jsonData,
|
|
432
426
|
});
|
|
433
427
|
let data = await response.json();
|
|
434
|
-
// console.
|
|
428
|
+
// console.log(data);
|
|
435
429
|
let samples = data.results[0].matrix.samples;
|
|
436
430
|
// console.log(samples[0].values);
|
|
437
|
-
|
|
438
|
-
samples.forEach((sample) => {
|
|
439
|
-
map.set(sample.metric.labels.index, sample.values);
|
|
440
|
-
});
|
|
441
|
-
return map;
|
|
431
|
+
return samples[0].values;
|
|
442
432
|
}
|
|
443
433
|
async function getTlpComparisonFromSentio(startTimestamp, endTimestamp) {
|
|
444
434
|
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_perp/sql/execute";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typus/typus-perp-sdk",
|
|
3
|
-
"version": "1.1.32-codegen-
|
|
3
|
+
"version": "1.1.32-codegen-exp21",
|
|
4
4
|
"repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
|
|
5
5
|
"author": "Typus",
|
|
6
6
|
"description": "typus perp sdk",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@mysten/bcs": "1.9.2",
|
|
10
10
|
"@mysten/sui": "1.44.0",
|
|
11
|
-
"@typus/typus-sdk": "1.8.
|
|
11
|
+
"@typus/typus-sdk": "1.8.32"
|
|
12
12
|
},
|
|
13
13
|
"resolutions": {
|
|
14
14
|
"@mysten/bcs": "1.9.2",
|
|
@@ -44,4 +44,4 @@
|
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://github.com/Typus-Lab/typus-perp-sdk#readme",
|
|
46
46
|
"packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
|
|
47
|
-
}
|
|
47
|
+
}
|