@sonarwatch/portfolio-plugins 0.14.121 → 0.14.123
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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/plugins/coingecko/fiatJob.js +35 -3
- package/src/plugins/coingecko/fiatJob.js.map +1 -1
- package/src/plugins/stargate/farmsJob.d.ts +2 -2
- package/src/plugins/stargate/farmsJob.js +13 -11
- package/src/plugins/stargate/farmsJob.js.map +1 -1
- package/src/plugins/stargate/index.js +2 -5
- package/src/plugins/stargate/index.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.14.123](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.122...plugins-0.14.123) (2025-02-21)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.14.122](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.121...plugins-0.14.122) (2025-02-21)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.14.121](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.120...plugins-0.14.121) (2025-02-21)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
@@ -1,4 +1,27 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -12,14 +35,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
36
|
};
|
14
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
const axios_1 =
|
38
|
+
const axios_1 = __importStar(require("axios"));
|
16
39
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
40
|
const constants_1 = require("../../utils/coingecko/constants");
|
18
41
|
const constants_2 = require("./constants");
|
19
42
|
const sleep_1 = __importDefault(require("../../utils/misc/sleep"));
|
20
43
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
21
|
-
yield (0, sleep_1.default)(
|
22
|
-
const res = yield axios_1.default
|
44
|
+
yield (0, sleep_1.default)(180000);
|
45
|
+
const res = yield axios_1.default
|
46
|
+
.get(constants_1.coingeckoExchangeRatesUrl)
|
47
|
+
.catch((error) => __awaiter(void 0, void 0, void 0, function* () {
|
48
|
+
if ((0, axios_1.isAxiosError)(error)) {
|
49
|
+
const axiosError = error;
|
50
|
+
if (axiosError.status === 429)
|
51
|
+
yield (0, sleep_1.default)(360000);
|
52
|
+
}
|
53
|
+
throw error;
|
54
|
+
}));
|
23
55
|
const { rates } = res.data;
|
24
56
|
const btcPriceUsd = rates['usd'].value;
|
25
57
|
if (!btcPriceUsd || btcPriceUsd <= 0)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fiatJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/coingecko/fiatJob.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"fiatJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/coingecko/fiatJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwD;AACxD,+DAA4E;AAG5E,+DAA4E;AAE5E,2CAA0E;AAC1E,mEAA2C;AAE3C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,IAAA,eAAK,EAAC,MAAM,CAAC,CAAC;IACpB,MAAM,GAAG,GAAG,MAAM,eAAK;SACpB,GAAG,CAAiC,qCAAyB,CAAC;SAC9D,KAAK,CAAC,CAAO,KAAK,EAAE,EAAE;QACrB,IAAI,IAAA,oBAAY,EAAC,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,UAAU,GAAG,KAAmB,CAAC;YACvC,IAAI,UAAU,CAAC,MAAM,KAAK,GAAG;gBAAE,MAAM,IAAA,eAAK,EAAC,MAAM,CAAC,CAAC;QACrD,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC,CAAA,CAAC,CAAC;IAEL,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,GAAG,CAAC,WAAW,GAAG,OAAO,CAAC,EACtC,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,WAAW,GAAG,OAAO,EAC/B,QAAQ,EAAE,CAAC,GAAG,OAAO,IACrB;IACJ,CAAC,CACF,CAAC;IAEF,MAAM,KAAK,CAAC,OAAO,CAAC,+BAAmB,EAAE,gBAAgB,EAAE;QACzD,MAAM,EAAE,kCAAsB;KAC/B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,gBAAgB;IACpB,QAAQ;IACR,MAAM,EAAE,CAAC,WAAW,CAAC;CACtB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { Job } from '../../Job';
|
2
|
-
|
3
|
-
export
|
2
|
+
import { StgConfig } from './types';
|
3
|
+
export declare function getFarmsJob(config: StgConfig): Job;
|
@@ -9,13 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
9
9
|
});
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.getFarmsJob = void 0;
|
12
13
|
const viem_1 = require("viem");
|
13
14
|
const clients_1 = require("../../utils/clients");
|
14
15
|
const abis_1 = require("./abis");
|
15
16
|
const constants_1 = require("./constants");
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
function getFarmsJob(config) {
|
18
|
+
const { farmsContract: address, networkId } = config;
|
19
|
+
const executor = (cache) => __awaiter(this, void 0, void 0, function* () {
|
19
20
|
const client = (0, clients_1.getEvmClient)(networkId);
|
20
21
|
const contract = {
|
21
22
|
address,
|
@@ -38,12 +39,13 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
39
|
prefix: constants_1.platformId,
|
39
40
|
networkId,
|
40
41
|
});
|
41
|
-
}
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
42
|
+
});
|
43
|
+
const job = {
|
44
|
+
id: `${constants_1.platformId}-${networkId}-farms`,
|
45
|
+
executor,
|
46
|
+
labels: ['normal', 'evm', networkId],
|
47
|
+
};
|
48
|
+
return job;
|
49
|
+
}
|
50
|
+
exports.getFarmsJob = getFarmsJob;
|
49
51
|
//# sourceMappingURL=farmsJob.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"farmsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stargate/farmsJob.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"farmsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stargate/farmsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAAmC;AAGnC,iDAAmD;AACnD,iCAAoD;AACpD,2CAAmD;AAGnD,SAAgB,WAAW,CAAC,MAAiB;IAC3C,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAErD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;QACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,EAAC,SAAS,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG;YACf,OAAO;YACP,GAAG,EAAE,oBAAa;YAClB,YAAY,EAAE,YAAY;SAClB,CAAC;QACX,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACxD,MAAM,SAAS,GAAG,EAAE,CAAC;QACrB,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACrD,SAAS,CAAC,IAAI,CAAC;gBACb,OAAO;gBACP,GAAG,EAAE,kBAAW;gBAChB,YAAY,EAAE,UAAU;gBACxB,IAAI,EAAE,CAAC,CAAC,CAAC;aACD,CAAC,CAAC;QACd,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QACtD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAChC,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAW,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CACvD,CAAC;QAEF,MAAM,KAAK,CAAC,OAAO,CAAC,oBAAQ,EAAE,KAAK,EAAE;YACnC,MAAM,EAAE,sBAAU;YAClB,SAAS;SACV,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;IAEF,MAAM,GAAG,GAAQ;QACf,EAAE,EAAE,GAAG,sBAAU,IAAI,SAAS,QAAQ;QACtC,QAAQ;QACR,MAAM,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC;KACrC,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC;AArCD,kCAqCC"}
|
@@ -1,18 +1,15 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
3
|
exports.platforms = exports.fetchers = exports.jobs = void 0;
|
7
4
|
const gePoolPositionsFetcher_1 = require("./gePoolPositionsFetcher");
|
8
5
|
const getPoolsJob_1 = require("./getPoolsJob");
|
9
|
-
const farmsJob_1 =
|
6
|
+
const farmsJob_1 = require("./farmsJob");
|
10
7
|
const constants_1 = require("./constants");
|
11
8
|
const getFarmPositionsFetcher_1 = require("./getFarmPositionsFetcher");
|
12
9
|
const getVoteTokensFetcher_1 = require("./getVoteTokensFetcher");
|
13
10
|
exports.jobs = [
|
14
11
|
...constants_1.stargateNetworksConfigs.map((config) => (0, getPoolsJob_1.getPoolsJob)(config)),
|
15
|
-
farmsJob_1.
|
12
|
+
...constants_1.stargateNetworksConfigs.map((config) => (0, farmsJob_1.getFarmsJob)(config)),
|
16
13
|
];
|
17
14
|
exports.fetchers = [
|
18
15
|
...constants_1.stargateNetworksConfigs
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stargate/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stargate/index.ts"],"names":[],"mappings":";;;AAGA,qEAAoE;AACpE,+CAA4C;AAC5C,yCAAyC;AACzC,2CAAgE;AAChE,uEAAqE;AACrE,iEAA8D;AAEjD,QAAA,IAAI,GAAU;IACzB,GAAG,mCAAuB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAA,yBAAW,EAAC,MAAM,CAAC,CAAC;IAC/D,GAAG,mCAAuB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAA,sBAAW,EAAC,MAAM,CAAC,CAAC;CAChE,CAAC;AACW,QAAA,QAAQ,GAAc;IACjC,GAAG,mCAAuB;SACvB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QACf,IAAA,iDAAwB,EAAC,MAAM,CAAC;QAChC,IAAA,kDAAwB,EAAC,MAAM,CAAC;QAChC,IAAA,2CAAoB,EAAC,MAAM,CAAC;KAC7B,CAAC;SACD,IAAI,EAAE;CACV,CAAC;AACW,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC"}
|