@sonarwatch/portfolio-plugins 0.14.33 → 0.14.35
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 +1 -1
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/alphafi/positionsFetcher.js +1 -1
- package/src/plugins/alphafi/positionsFetcher.js.map +1 -1
- package/src/plugins/cetus/vaultsJob.js +1 -0
- package/src/plugins/cetus/vaultsJob.js.map +1 -1
- package/src/plugins/ensofi/constants.d.ts +10 -0
- package/src/plugins/ensofi/constants.js +24 -0
- package/src/plugins/ensofi/constants.js.map +1 -0
- package/src/plugins/ensofi/idl.d.ts +103 -0
- package/src/plugins/ensofi/idl.js +900 -0
- package/src/plugins/ensofi/idl.js.map +1 -0
- package/src/plugins/ensofi/index.d.ts +6 -0
- package/src/plugins/ensofi/index.js +14 -0
- package/src/plugins/ensofi/index.js.map +1 -0
- package/src/plugins/ensofi/solanaLoansFetcher.d.ts +3 -0
- package/src/plugins/ensofi/solanaLoansFetcher.js +116 -0
- package/src/plugins/ensofi/solanaLoansFetcher.js.map +1 -0
- package/src/plugins/ensofi/suiLoansFetcher.d.ts +3 -0
- package/src/plugins/ensofi/suiLoansFetcher.js +111 -0
- package/src/plugins/ensofi/suiLoansFetcher.js.map +1 -0
- package/src/plugins/ensofi/suiLoansJob.d.ts +3 -0
- package/src/plugins/ensofi/suiLoansJob.js +47 -0
- package/src/plugins/ensofi/suiLoansJob.js.map +1 -0
- package/src/plugins/ensofi/types.d.ts +71 -0
- package/src/plugins/ensofi/types.js +3 -0
- package/src/plugins/ensofi/types.js.map +1 -0
- package/src/plugins/flash/helpers.d.ts +1 -1
- package/src/plugins/flash/helpers.js +2 -2
- package/src/plugins/flash/helpers.js.map +1 -1
- package/src/plugins/flash/poolJob.js +25 -5
- package/src/plugins/flash/poolJob.js.map +1 -1
- package/src/plugins/flash/structs.d.ts +4 -0
- package/src/plugins/flash/structs.js +4 -0
- package/src/plugins/flash/structs.js.map +1 -1
- package/src/plugins/flash/types.d.ts +1 -0
- package/src/plugins/haedal/vaultFetcher.js +1 -2
- package/src/plugins/haedal/vaultFetcher.js.map +1 -1
- package/src/plugins/kai/vaultsJob.js +1 -2
- package/src/plugins/kai/vaultsJob.js.map +1 -1
- package/src/plugins/kriya/vaultsFetcher.js +1 -2
- package/src/plugins/kriya/vaultsFetcher.js.map +1 -1
- package/src/plugins/mole/depositsFetcher.js +1 -1
- package/src/plugins/mole/depositsFetcher.js.map +1 -1
- package/src/plugins/thala/farmingPoolsFetcher.js +14 -50
- package/src/plugins/thala/farmingPoolsFetcher.js.map +1 -1
- package/src/plugins/tokens/fetchers/sui.js +3 -3
- package/src/plugins/tokens/fetchers/sui.js.map +1 -1
- package/src/plugins/tokens/helpers.d.ts +3 -2
- package/src/plugins/tokens/helpers.js +5 -4
- package/src/plugins/tokens/helpers.js.map +1 -1
- package/src/plugins/turbos/clmmVaultFetcher.js +1 -2
- package/src/plugins/turbos/clmmVaultFetcher.js.map +1 -1
- package/src/plugins/typus/safuFetcher.js +2 -2
- package/src/plugins/typus/safuFetcher.js.map +1 -1
- package/src/plugins/typus/vaultsFetcher.js +1 -1
- package/src/plugins/typus/vaultsFetcher.js.map +1 -1
- package/src/plugins/whalesmarket/depositFetcher.js +0 -1
- package/src/plugins/whalesmarket/depositFetcher.js.map +1 -1
- package/src/utils/elementbuilder/AssetBuilder.d.ts +2 -1
- package/src/utils/elementbuilder/AssetBuilder.js +14 -2
- package/src/utils/elementbuilder/AssetBuilder.js.map +1 -1
- package/src/utils/elementbuilder/LiquidityBuilder.js +2 -1
- package/src/utils/elementbuilder/LiquidityBuilder.js.map +1 -1
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AssetBuilder = void 0;
|
7
7
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
8
8
|
const tokenPriceToAssetToken_1 = __importDefault(require("../misc/tokenPriceToAssetToken"));
|
9
|
+
const tokenPriceToAssetTokens_1 = __importDefault(require("../misc/tokenPriceToAssetTokens"));
|
9
10
|
class AssetBuilder {
|
10
11
|
constructor(params) {
|
11
12
|
this.address = params.address.toString();
|
@@ -13,9 +14,20 @@ class AssetBuilder {
|
|
13
14
|
this.attributes = params.attributes || {};
|
14
15
|
this.alreadyShifted = params.alreadyShifted || false;
|
15
16
|
}
|
16
|
-
|
17
|
+
getUnderlyings(networkId, tokenPrices) {
|
17
18
|
let amount = new bignumber_js_1.default(this.amount);
|
18
|
-
if (
|
19
|
+
if (amount.isZero())
|
20
|
+
return [];
|
21
|
+
const tokenPrice = tokenPrices.get(this.address);
|
22
|
+
if (!tokenPrice)
|
23
|
+
return [];
|
24
|
+
if (!this.alreadyShifted)
|
25
|
+
amount = amount.dividedBy(Math.pow(10, tokenPrice.decimals));
|
26
|
+
return (0, tokenPriceToAssetTokens_1.default)(tokenPrice.address, amount.toNumber(), networkId, tokenPrice, undefined, this.attributes);
|
27
|
+
}
|
28
|
+
get(networkId, tokenPrices) {
|
29
|
+
let amount = new bignumber_js_1.default(this.amount);
|
30
|
+
if (amount.isZero())
|
19
31
|
return null;
|
20
32
|
const tokenPrice = tokenPrices.get(this.address);
|
21
33
|
if (!tokenPrice)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AssetBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/AssetBuilder.ts"],"names":[],"mappings":";;;;;;AAKA,gEAAqC;AAErC,4FAAoE;
|
1
|
+
{"version":3,"file":"AssetBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/AssetBuilder.ts"],"names":[],"mappings":";;;;;;AAKA,gEAAqC;AAErC,4FAAoE;AAEpE,8FAAsE;AAEtE,MAAa,YAAY;IAMvB,YAAY,MAA4B;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC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EAClB,MAAM,CAAC,QAAQ,EAAE,EACjB,SAAS,EACT,UAAU,EACV,SAAS,EACT,IAAI,CAAC,UAAU,CAChB,CAAC;IACJ,CAAC;CACF;AAxDD,oCAwDC"}
|
@@ -27,7 +27,8 @@ class LiquidityBuilder {
|
|
27
27
|
}
|
28
28
|
get(networkId, tokenPrices) {
|
29
29
|
const assets = this.assets
|
30
|
-
.map((a) => a.
|
30
|
+
.map((a) => a.getUnderlyings(networkId, tokenPrices))
|
31
|
+
.flat()
|
31
32
|
.filter((a) => a !== null);
|
32
33
|
const rewardAssets = this.rewardAssets
|
33
34
|
.map((a) => a.get(networkId, tokenPrices))
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LiquidityBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/LiquidityBuilder.ts"],"names":[],"mappings":";;;AAAA,+DAMoC;AAEpC,iDAA8C;AAI9C,MAAa,gBAAgB;IAM3B,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,QAAQ,CAAC,MAA4B;QACnC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,cAAc,CAAC,MAA4B;QACzC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,QAAQ,CAAC,MAAa;QACpB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK;QACH,OAAO;YACL,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YACpC,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;SAC3C,CAAC;IACJ,CAAC;IAED,GAAG,CACD,SAAwB,EACxB,WAA0B;QAE1B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM;aACvB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,
|
1
|
+
{"version":3,"file":"LiquidityBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/LiquidityBuilder.ts"],"names":[],"mappings":";;;AAAA,+DAMoC;AAEpC,iDAA8C;AAI9C,MAAa,gBAAgB;IAM3B,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,QAAQ,CAAC,MAA4B;QACnC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,cAAc,CAAC,MAA4B;QACzC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,QAAQ,CAAC,MAAa;QACpB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK;QACH,OAAO;YACL,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YACpC,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;SAC3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