@sonarwatch/portfolio-plugins 0.11.185 → 0.11.187
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/src/plugins/llama-protocols/getLlamaProtocolsJob.js +13 -2
- package/src/plugins/llama-protocols/getLlamaProtocolsJob.js.map +1 -1
- package/src/plugins/llama-protocols/helpers.js +1 -0
- package/src/plugins/llama-protocols/helpers.js.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.11.187](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.186...plugins-0.11.187) (2024-04-24)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.11.186](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.185...plugins-0.11.186) (2024-04-23)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.11.185](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.184...plugins-0.11.185) (2024-04-23)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.187",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"web3-v1": "npm:web3@^1.5.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
|
-
"@sonarwatch/portfolio-core": "0.11.
|
44
|
+
"@sonarwatch/portfolio-core": "0.11.187"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -19,6 +19,7 @@ const constants_1 = require("./constants");
|
|
19
19
|
const llamaUrl = 'https://api.llama.fi/protocols';
|
20
20
|
function getLlamaProtocolsJob(platforms) {
|
21
21
|
const executor = (cache) => __awaiter(this, void 0, void 0, function* () {
|
22
|
+
var _a, _b;
|
22
23
|
const llamaProtocolsResponse = yield axios_1.default.get(llamaUrl);
|
23
24
|
const platformIdByLlamaId = new Map();
|
24
25
|
platforms.forEach((platform) => {
|
@@ -32,7 +33,9 @@ function getLlamaProtocolsJob(platforms) {
|
|
32
33
|
const llamaProtocol = llamaProtocols[i];
|
33
34
|
const platformId = platformIdByLlamaId.get(llamaProtocol.slug);
|
34
35
|
if (platformId) {
|
35
|
-
protocols[platformId] = (0, helpers_1.shrinkLlamaProtocol)(llamaProtocol);
|
36
|
+
protocols[platformId] = Object.assign(Object.assign({}, (0, helpers_1.shrinkLlamaProtocol)(llamaProtocol)), { tvl: 0 });
|
37
|
+
protocols[platformId].tvl += llamaProtocol.tvl;
|
38
|
+
protocols[platformId].tvl += ((_a = llamaProtocol.chainTvls) === null || _a === void 0 ? void 0 : _a['staking']) || 0;
|
36
39
|
continue;
|
37
40
|
}
|
38
41
|
if (!llamaProtocol.parentProtocol)
|
@@ -40,13 +43,21 @@ function getLlamaProtocolsJob(platforms) {
|
|
40
43
|
const platformId2 = platformIdByLlamaId.get(llamaProtocol.parentProtocol);
|
41
44
|
if (platformId2) {
|
42
45
|
if (!protocols[platformId2]) {
|
43
|
-
protocols[platformId2] = Object.assign(Object.assign({}, (0, helpers_1.shrinkLlamaProtocol)(llamaProtocol)), {
|
46
|
+
protocols[platformId2] = Object.assign(Object.assign({}, (0, helpers_1.shrinkLlamaProtocol)(llamaProtocol)), { tvl: 0, networkIds: [] });
|
44
47
|
}
|
48
|
+
// tvl
|
45
49
|
protocols[platformId2].tvl += llamaProtocol.tvl;
|
50
|
+
protocols[platformId2].tvl += ((_b = llamaProtocol.chainTvls) === null || _b === void 0 ? void 0 : _b['staking']) || 0;
|
51
|
+
// networkIds
|
46
52
|
protocols[platformId2].networkIds.push(...(0, helpers_1.llamaChainsToNetworkIds)(llamaProtocol.chains));
|
47
53
|
protocols[platformId2].networkIds = [
|
48
54
|
...new Set(protocols[platformId2].networkIds),
|
49
55
|
];
|
56
|
+
// categories
|
57
|
+
protocols[platformId2].categories.push(llamaProtocol.category);
|
58
|
+
protocols[platformId2].categories = [
|
59
|
+
...new Set(protocols[platformId2].categories),
|
60
|
+
];
|
50
61
|
}
|
51
62
|
}
|
52
63
|
yield cache.setItem(constants_1.llamaProtocolsCacheKey, JSON.stringify(protocols), {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getLlamaProtocolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/llama-protocols/getLlamaProtocolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAKA,kDAA0B;AAG1B,uCAAyE;AACzE,2CAAgF;AAEhF,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AAElD,SAAgB,oBAAoB,CAAC,SAAqB;IACxD,MAAM,QAAQ,GAAG,CAAO,KAAY,EAAE,EAAE
|
1
|
+
{"version":3,"file":"getLlamaProtocolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/llama-protocols/getLlamaProtocolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAKA,kDAA0B;AAG1B,uCAAyE;AACzE,2CAAgF;AAEhF,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AAElD,SAAgB,oBAAoB,CAAC,SAAqB;IACxD,MAAM,QAAQ,GAAG,CAAO,KAAY,EAAE,EAAE;;QACtC,MAAM,sBAAsB,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACzD,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAkB,CAAC;QACtD,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAC7B,IAAI,CAAC,QAAQ,CAAC,WAAW;gBAAE,OAAO;YAClC,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC7D,CAAC,CAAC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I,CAAC,CAAC;gBAExE,aAAa;gBACb,SAAS,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,IAAI,CACpC,GAAG,IAAA,iCAAuB,EAAC,aAAa,CAAC,MAAM,CAAC,CACjD,CAAC;gBACF,SAAS,CAAC,WAAW,CAAC,CAAC,UAAU,GAAG;oBAClC,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC;iBAC9C,CAAC;gBAEF,aAAa;gBACb,SAAS,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;gBAC/D,SAAS,CAAC,WAAW,CAAC,CAAC,UAAU,GAAG;oBAClC,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC;iBAC9C,CAAC;YACJ,CAAC;QACH,CAAC;QACD,MAAM,KAAK,CAAC,OAAO,CAAC,kCAAsB,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE;YACrE,MAAM,EAAE,qCAAyB;SAClC,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;IACF,OAAO;QACL,EAAE,EAAE,iBAAiB;QACrB,QAAQ;QACR,KAAK,EAAE,WAAW;KACnB,CAAC;AACJ,CAAC;AAhED,oDAgEC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/llama-protocols/helpers.ts"],"names":[],"mappings":";;;AAAA,+DAKoC;AAEpC,SAAgB,mBAAmB,CACjC,QAA2B;IAE3B,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,EAAE;QACf,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,GAAG,EAAE,QAAQ,CAAC,GAAG;QAC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