@sonarwatch/portfolio-plugins 0.11.186 → 0.11.188
Sign up to get free protection for your applications and to get access to all the features.
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.188](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.187...plugins-0.11.188) (2024-04-24)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.11.187](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.186...plugins-0.11.187) (2024-04-24)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.11.186](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.185...plugins-0.11.186) (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.188",
|
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.188"
|
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,17 @@ 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
|
50
57
|
protocols[platformId2].categories.push(llamaProtocol.category);
|
51
58
|
protocols[platformId2].categories = [
|
52
59
|
...new Set(protocols[platformId2].categories),
|
@@ -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,CAAC;QAEH,MAAM,SAAS,GAAkC,EAAE,CAAC;QACpD,MAAM,cAAc,GAAG,sBAAsB,CAAC,IAA2B,CAAC;QAE1E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC/C,MAAM,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;YACxC,MAAM,UAAU,GAAG,mBAAmB,C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