@typus/typus-perp-sdk 1.1.32-codegen-exp15-profit-vault → 1.1.32-codegen-exp17
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.js +12 -12
- package/dist/src/index.js +11 -11
- package/package.json +1 -1
package/dist/src/api/sentio.js
CHANGED
|
@@ -13,11 +13,11 @@ exports.getUserPnlFromSentio = getUserPnlFromSentio;
|
|
|
13
13
|
exports.getLeaderboardFromSentio = getLeaderboardFromSentio;
|
|
14
14
|
const src_1 = require("../../src");
|
|
15
15
|
const headers = {
|
|
16
|
-
"api-key": "
|
|
16
|
+
"api-key": "hCsD8shJaUbbiNLMKBG3oKhr9PL3H5EJ5",
|
|
17
17
|
"Content-Type": "application/json",
|
|
18
18
|
};
|
|
19
19
|
async function getFromSentio(event, userAddress, startTimestamp, cranker) {
|
|
20
|
-
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/
|
|
20
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_perp/sql/execute";
|
|
21
21
|
// add cranker fileter
|
|
22
22
|
let crankerFilter = "";
|
|
23
23
|
if (cranker) {
|
|
@@ -50,7 +50,7 @@ async function getFromSentio(event, userAddress, startTimestamp, cranker) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
async function getRecentTradesFromSentio(base_token) {
|
|
53
|
-
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/
|
|
53
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_perp/sql/execute";
|
|
54
54
|
let tokenFilter = "";
|
|
55
55
|
if (base_token) {
|
|
56
56
|
tokenFilter = `WHERE base_token = '${(0, src_1.toSentioToken)(base_token)}'`;
|
|
@@ -142,7 +142,7 @@ async function getRecentTradesFromSentio(base_token) {
|
|
|
142
142
|
* value: Volume[]
|
|
143
143
|
*/
|
|
144
144
|
async function getTradingVolumeFromSentio(fromTimestamp, interval, toTimestamp) {
|
|
145
|
-
let apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/
|
|
145
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
|
|
146
146
|
let requestData = {
|
|
147
147
|
timeRange: {
|
|
148
148
|
start: `${fromTimestamp}`,
|
|
@@ -206,7 +206,7 @@ async function getTradingVolumeFromSentio(fromTimestamp, interval, toTimestamp)
|
|
|
206
206
|
return map;
|
|
207
207
|
}
|
|
208
208
|
async function getMinuteTradingVolumeFromSentio(base_token, minute, size) {
|
|
209
|
-
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/
|
|
209
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_perp/sql/execute";
|
|
210
210
|
let requestData = {
|
|
211
211
|
sqlQuery: {
|
|
212
212
|
sql: `
|
|
@@ -243,7 +243,7 @@ function parseTimestamp(s) {
|
|
|
243
243
|
return Math.round(Date.parse(s) / 1000);
|
|
244
244
|
}
|
|
245
245
|
async function getTlpFeeFromSentio(fromTimestamp, toTimestamp) {
|
|
246
|
-
let apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/
|
|
246
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
|
|
247
247
|
let requestData = {
|
|
248
248
|
timeRange: {
|
|
249
249
|
start: `${fromTimestamp ?? 0}`,
|
|
@@ -290,7 +290,7 @@ async function getTlpFeeFromSentio(fromTimestamp, toTimestamp) {
|
|
|
290
290
|
return fee;
|
|
291
291
|
}
|
|
292
292
|
async function getTotalVolumeFromSentio(fromTimestamp, toTimestamp) {
|
|
293
|
-
let apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/
|
|
293
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
|
|
294
294
|
let requestData = {
|
|
295
295
|
timeRange: {
|
|
296
296
|
start: `${fromTimestamp ?? 0}`,
|
|
@@ -335,7 +335,7 @@ async function getTotalVolumeFromSentio(fromTimestamp, toTimestamp) {
|
|
|
335
335
|
}
|
|
336
336
|
/** Returns Accumulated Users */
|
|
337
337
|
async function getAccumulatedUser() {
|
|
338
|
-
let apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/
|
|
338
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
|
|
339
339
|
let requestData = {
|
|
340
340
|
timeRange: {
|
|
341
341
|
start: "now-1h",
|
|
@@ -392,7 +392,7 @@ async function getAccumulatedUser() {
|
|
|
392
392
|
* { timestamp: string, value: number }[]
|
|
393
393
|
*/
|
|
394
394
|
async function getTlpPriceFromSentio(fromTimestamp, toTimestamp) {
|
|
395
|
-
let apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/
|
|
395
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/insights/typus/typus_perp/query";
|
|
396
396
|
let requestData = {
|
|
397
397
|
timeRange: {
|
|
398
398
|
start: `${fromTimestamp ?? 0}`,
|
|
@@ -431,7 +431,7 @@ async function getTlpPriceFromSentio(fromTimestamp, toTimestamp) {
|
|
|
431
431
|
return samples[0].values;
|
|
432
432
|
}
|
|
433
433
|
async function getTlpComparisonFromSentio(startTimestamp, endTimestamp) {
|
|
434
|
-
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/
|
|
434
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_perp/sql/execute";
|
|
435
435
|
let requestData = {
|
|
436
436
|
sqlQuery: {
|
|
437
437
|
sql: `
|
|
@@ -507,7 +507,7 @@ async function getTlpComparisonFromSentio(startTimestamp, endTimestamp) {
|
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
509
|
async function getUserPnlFromSentio(startTimestamp, endTimestamp, userAddress) {
|
|
510
|
-
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/
|
|
510
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_perp/sql/execute";
|
|
511
511
|
let userFilter = "";
|
|
512
512
|
if (userAddress) {
|
|
513
513
|
userFilter = `AND address == '${userAddress}'`;
|
|
@@ -592,7 +592,7 @@ async function getUserPnlFromSentio(startTimestamp, endTimestamp, userAddress) {
|
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
async function getLeaderboardFromSentio(startTs, endTs) {
|
|
595
|
-
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/
|
|
595
|
+
let apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_perp/sql/execute";
|
|
596
596
|
let size = (10 * (endTs - startTs)) / 60 / 60 / 24; // day * 10
|
|
597
597
|
let requestData = {
|
|
598
598
|
sqlQuery: {
|
package/dist/src/index.js
CHANGED
|
@@ -26,38 +26,38 @@ dotenv_1.default.config();
|
|
|
26
26
|
// default MAINNET
|
|
27
27
|
exports.NETWORK = process.env.NEXT_PUBLIC_CLUSTER == "testnet" ? "TESTNET" : "MAINNET";
|
|
28
28
|
exports.PERP_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
29
|
-
? "
|
|
30
|
-
: "
|
|
29
|
+
? "0xcb1c8159eb40b02877c0ceed599cf019cc8e61e8ec19c4d64db15e20ff630f05"
|
|
30
|
+
: "0x94cd358f552e9dd5df837de85939a9d1d682e97480740a203121e6f4c0078853";
|
|
31
31
|
exports.STAKE_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
32
|
-
? "
|
|
32
|
+
? "0x6cf6c6cc05316e238a338ba82c018d38a1af7e6da26b85fffa433df98e8f1bdb"
|
|
33
33
|
: "0x02b94b340a8810f6c451bc244dc2dd8d9d50cf86d727798969ca2c287c3186aa";
|
|
34
34
|
// lp_pool::Registry
|
|
35
35
|
exports.LP_POOL = exports.NETWORK == "MAINNET"
|
|
36
|
-
? "
|
|
36
|
+
? "0xb4b5e5fff9c6036f5ba22434467df1d23c2a77709807c43c7c9200816edb7006"
|
|
37
37
|
: "0x85fa3cc6dc0fa8b47dda95ba0335fe1cec61dde4a2a8486ccd040f94d399b4c3";
|
|
38
38
|
// liquidity_pool_registry
|
|
39
39
|
exports.LIQUIDITY_POOL = exports.NETWORK == "MAINNET"
|
|
40
|
-
? "
|
|
40
|
+
? "0x422d57052da4465c5cbed8270e815dd9bc943cba827865db44fa067c525de9d9"
|
|
41
41
|
: "0xe034d157764f273df5a1e264a3c0f78d8f922c37f942c340dabb1d66244c72ba";
|
|
42
42
|
// MarketRegistry
|
|
43
43
|
exports.MARKET = exports.NETWORK == "MAINNET"
|
|
44
|
-
? "
|
|
44
|
+
? "0x09a1fb68e7b07ac48d8f370cec4b5dabc80eb9a3a548ba4d06fa8e5ce1cf03ad"
|
|
45
45
|
: "0xd0685e3eca9530f0618625d4a617a80db09f000609285b32a85f863da6baf811";
|
|
46
46
|
exports.PERP_VERSION = exports.NETWORK == "MAINNET"
|
|
47
|
-
? "
|
|
47
|
+
? "0x6ed8676315014e829c89f56d95a88e35167ade69911f853aed8b92c25746ecbc"
|
|
48
48
|
: "0xbb0615832168e64e301db2ebd6ad71b3fe170d7e217ccd0c08714de56b41676b";
|
|
49
49
|
exports.TLP_TREASURY_CAP = exports.NETWORK == "MAINNET"
|
|
50
|
-
? "
|
|
50
|
+
? "0xf836ae7b9d53bddb9be877b4fbc3ebd93b01327ca76b437d8618940d5081d222"
|
|
51
51
|
: "0x1b39c2a5bc109ac520787c62f924da9244343e869bad755157e6e3e22bd7b7ae";
|
|
52
52
|
// StakePoolRegistry
|
|
53
53
|
exports.STAKE_POOL = exports.NETWORK == "MAINNET"
|
|
54
|
-
? "
|
|
54
|
+
? "0x60c771d32a7b7f0f5f58d7dc2e6d83f76a6512f58d79bded2ee458a1d79b786c"
|
|
55
55
|
: "0x8e5e5435c3fcd77f07cf097c5fbd381af7c2b394420ea035685662215471e578";
|
|
56
56
|
exports.STAKE_POOL_VERSION = exports.NETWORK == "MAINNET"
|
|
57
|
-
? "
|
|
57
|
+
? "0x57ddf480a4649da5f92b4e607cf1fac75bc11d8b582816509989d66f8bc7e329"
|
|
58
58
|
: "0x02b94b340a8810f6c451bc244dc2dd8d9d50cf86d727798969ca2c287c3186aa";
|
|
59
59
|
exports.COMPETITION_CONFIG = exports.NETWORK == "MAINNET"
|
|
60
|
-
? "
|
|
60
|
+
? "0xf7fcb3dbabe52c0a7e3fe01e28bb0f7045e2e45463f62bfa739e8c14a911f4be"
|
|
61
61
|
: "0x2b811b120177839555aabdc2c28b28078170e663e855d29aa9072013d4fc918d";
|
|
62
62
|
exports.PROFIT_VAULT = exports.NETWORK == "MAINNET"
|
|
63
63
|
? "" // TODO: Add mainnet PROFIT_VAULT address
|
package/package.json
CHANGED