@sonarwatch/portfolio-plugins 0.14.103 → 0.14.105
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.14.105](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.104...plugins-0.14.105) (2025-02-06)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.14.104](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.103...plugins-0.14.104) (2025-02-06)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.14.103](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.102...plugins-0.14.103) (2025-02-06)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
@@ -16,18 +16,20 @@ const axios_1 = __importDefault(require("axios"));
|
|
16
16
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
17
|
const constants_1 = require("../../utils/coingecko/constants");
|
18
18
|
const constants_2 = require("./constants");
|
19
|
+
const sleep_1 = __importDefault(require("../../utils/misc/sleep"));
|
19
20
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
21
|
+
yield (0, sleep_1.default)(90000);
|
20
22
|
const res = yield axios_1.default.get(constants_1.coingeckoExchangeRatesUrl);
|
21
23
|
const { rates } = res.data;
|
22
|
-
const
|
23
|
-
if (!
|
24
|
+
const btcPriceUsd = rates['usd'].value;
|
25
|
+
if (!btcPriceUsd || btcPriceUsd <= 0)
|
24
26
|
return;
|
25
27
|
const pricedCurrencies = portfolio_core_1.fiatCurrencies.map((fiat) => {
|
26
28
|
const btcRate = rates[fiat.name.toLowerCase()].value;
|
27
29
|
if (!btcRate || btcRate <= 0) {
|
28
30
|
return fiat;
|
29
31
|
}
|
30
|
-
return Object.assign(Object.assign({}, fiat), {
|
32
|
+
return Object.assign(Object.assign({}, fiat), { rateToUsd: 1 / (btcPriceUsd / btcRate), rateToBtc: btcRate, priceUsd: btcPriceUsd / btcRate, priceBtc: 1 / btcRate });
|
31
33
|
});
|
32
34
|
yield cache.setItem(constants_2.pricedCurrenciesKey, pricedCurrencies, {
|
33
35
|
prefix: constants_2.pricedCurrenciesPrefix,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fiatJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/coingecko/fiatJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+DAA4E;AAG5E,+DAA4E;AAE5E,2CAA0E;
|
1
|
+
{"version":3,"file":"fiatJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/coingecko/fiatJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+DAA4E;AAG5E,+DAA4E;AAE5E,2CAA0E;AAC1E,mEAA2C;AAE3C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,IAAA,eAAK,EAAC,KAAK,CAAC,CAAC;IACnB,MAAM,GAAG,GAAG,MAAM,eAAK,CAAC,GAAG,CACzB,qCAAyB,CAC1B,CAAC;IAEF,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;IAC3B,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;IACvC,IAAI,CAAC,WAAW,IAAI,WAAW,IAAI,CAAC;QAAE,OAAO;IAE7C,MAAM,gBAAgB,GAAqB,+BAAc,CAAC,GAAG,CAC3D,CAAC,IAAI,EAAkB,EAAE;QACvB,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC;QACrD,IAAI,CAAC,OAAO,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,uCACK,IAAI,KACP,SAAS,EAAE,CAAC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