@sonarwatch/portfolio-plugins 0.14.161 → 0.14.163

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 CHANGED
@@ -2,14 +2,26 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
- ## [0.14.161](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.160...plugins-0.14.161) (2025-03-27)
6
-
7
-
8
-
9
- ## [0.14.160](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.159...plugins-0.14.160) (2025-03-26)
5
+ ## [0.14.163](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.162...plugins-0.14.163) (2025-03-28)
10
6
 
11
7
 
12
8
 
9
+ ## [0.14.162](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.161...plugins-0.14.162) (2025-03-27)
10
+
11
+
12
+
13
+ ## [0.14.161](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.160...plugins-0.14.161) (2025-03-27)
14
+
15
+
16
+
17
+ ## [0.14.161](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.160...plugins-0.14.161) (2025-03-27)
18
+
19
+
20
+
21
+ ## [0.14.160](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.159...plugins-0.14.160) (2025-03-26)
22
+
23
+
24
+
13
25
  ## [0.14.159](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.158...plugins-0.14.159) (2025-03-26)
14
26
 
15
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.14.161",
3
+ "version": "0.14.163",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -21,6 +21,7 @@ const filters_1 = require("./filters");
21
21
  const getCachedDecimalsForToken_1 = require("../../../utils/misc/getCachedDecimalsForToken");
22
22
  const tokenPriceToAssetToken_1 = __importDefault(require("../../../utils/misc/tokenPriceToAssetToken"));
23
23
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
24
+ var _a;
24
25
  const client = (0, clients_1.getClientSolana)({ commitment: 'processed' });
25
26
  const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.dcaStruct, constants_1.dcaProgramId, (0, filters_1.DCAFilters)(owner));
26
27
  if (accounts.length === 0)
@@ -31,10 +32,15 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
31
32
  account.outputMint.toString(),
32
33
  ])
33
34
  .flat();
34
- const pricesMap = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
35
+ const [pricesMap, tokenAccounts] = yield Promise.all([
36
+ cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana),
37
+ (0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, accounts.map((account) => account.inAccount)),
38
+ ]);
35
39
  const elements = [];
36
40
  for (let i = 0; i < accounts.length; i++) {
37
41
  const account = accounts[i];
42
+ if ((_a = tokenAccounts[i]) === null || _a === void 0 ? void 0 : _a.amount.isZero())
43
+ continue;
38
44
  const inputMint = account.inputMint.toString();
39
45
  const inputTokenPrice = pricesMap.get(inputMint);
40
46
  const outputMint = account.outputMint.toString();
@@ -1 +1 @@
1
- {"version":3,"file":"dcaFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/dcaFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,oDAAyD;AACzD,kDAAiE;AACjE,2CAAuD;AACvD,uCAAsC;AACtC,uCAAuC;AACvC,6FAA0F;AAC1F,wGAAgF;AAEhF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,EAAC,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,CAAC;IAE5D,MAAM,QAA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,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,CAAC,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,KAAI,CAAC,CAAC,CAAC;SACzE,CAAC;QACF,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,MAAM;IACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -24,11 +24,18 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
24
24
  const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.valueAverageStruct, constants_1.valueAverageProgramId, (0, filters_1.valueAverageFilters)(owner));
25
25
  if (accounts.length === 0)
26
26
  return [];
27
- const tokenPrices = yield cache.getTokenPricesAsMap(accounts
28
- .map((a) => [a.inputMint.toString(), a.outputMint.toString()])
29
- .flat(), portfolio_core_1.NetworkId.solana);
27
+ const [tokenPrices, inputTokenAccounts, outputTokenAccounts] = yield Promise.all([
28
+ cache.getTokenPricesAsMap(accounts
29
+ .map((a) => [a.inputMint.toString(), a.outputMint.toString()])
30
+ .flat(), portfolio_core_1.NetworkId.solana),
31
+ (0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, accounts.map((a) => a.inputVault)),
32
+ (0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, accounts.map((a) => a.outputVault)),
33
+ ]);
30
34
  const elements = [];
31
- for (const account of accounts) {
35
+ for (let i = 0; i < accounts.length; i++) {
36
+ const account = accounts[i];
37
+ if (!inputTokenAccounts[i] || !outputTokenAccounts[i])
38
+ continue;
32
39
  const inputAddress = account.inputMint.toString();
33
40
  const outputAddress = account.outputMint.toString();
34
41
  const inputTokenPrice = tokenPrices.get(inputAddress);
@@ -1 +1 @@
1
- {"version":3,"file":"valueAverageFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/valueAverageFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AAGpC,2CAAgE;AAChE,oDAAyD;AACzD,kDAAiE;AACjE,wGAAgF;AAChF,uCAA+C;AAC/C,uCAAgD;AAEhD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,MAAM,EACN,4BAAkB,EAClB,iCAAqB,EACrB,IAAA,6BAAmB,EAAC,KAAK,CAAC,CAC3B,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACjD,QAAQ;SACL,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC7D,IAAI,EAAE,EACT,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,QAAQ,GAA4B,EAAE,CAAC;IAC7C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;QAClD,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QACpD,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACtD,MAAM,gBAAgB,GAAG,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACxD,IAAI,CAAC,eAAe,IAAI,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AAE,eAAe,CAAC,KAAK;gBACjC,WAAW,EAAE,gBAAgB,CAAC,KAAK;gBACnC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;gBACnD,qBAAqB,EAAE,OAAO,CAAC,YAAY;qBACxC,GAAG,CAAC,SAAA,EAAE,EAAI,gBAAgB,CAAC,QAAQ,CAAA,CAAC;qBACpC,QAAQ,EAAE;gBACb,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;gBAC9B,QAAQ,EAAE,iCAAqB,CAAC,QAAQ,EAAE;gBAC1C,IAAI,EAAE,2BAA2B;aAClC;YACD,KAAK,EAAE,IAAA,+BAAc,EAAC,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,KAAI,CAAC,CAAC,CAAC;SACnE,CAAC;QACF,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,gBAAgB;IACjC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"valueAverageFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/valueAverageFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AAGpC,2CAAgE;AAChE,oDAAyD;AACzD,kDAI+B;AAC/B,wGAAgF;AAChF,uCAA+C;AAC/C,uCAAgD;AAEhD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C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AAe,CAAC,QAAQ,CAAA,CAAC;qBACnC,GAAG,CAAC,kBAAkB,CAAC;qBACvB,QAAQ,EAAE;gBACb,kBAAkB;gBAClB,YAAY;gBACZ,aAAa;gBACb,UAAU,EAAE,eAAe,CAAC,KAAK;gBACjC,WAAW,EAAE,gBAAgB,CAAC,KAAK;gBACnC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;gBACnD,qBAAqB,EAAE,OAAO,CAAC,YAAY;qBACxC,GAAG,CAAC,SAAA,EAAE,EAAI,gBAAgB,CAAC,QAAQ,CAAA,CAAC;qBACpC,QAAQ,EAAE;gBACb,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;gBAC9B,QAAQ,EAAE,iCAAqB,CAAC,QAAQ,EAAE;gBAC1C,IAAI,EAAE,2BAA2B;aAClC;YACD,KAAK,EAAE,IAAA,+BAAc,EAAC,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,KAAI,CAAC,CAAC,CAAC;SACnE,CAAC;QACF,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,gBAAgB;IACjC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -148,9 +148,6 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
148
148
  const elevationGroup = elevationGroups.get(obligation.elevationGroup);
149
149
  if (elevationGroup)
150
150
  element.addSuppliedLtv(elevationGroup.liquidationThresholdPct / 100);
151
- else {
152
- element.addSuppliedLtv(0);
153
- }
154
151
  }
155
152
  else {
156
153
  element.addSuppliedLtv(reserve.config.liquidationThresholdPct / 100);
@@ -1 +1 @@
1
- {"version":3,"file":"lendsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/lendsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AACrC,2CAMqB;AAGrB,iDAAsD;AACtD,2CAAmE;AAEnE,+CAAmE;AACnE,yCAIwB;AACxB,6CAAsE;AACtE,gFAA6E;AAC7E,kEAA+D;AAC/D,4DAAyD;AAEzD,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAE3D,MAAM,WAAW,GAAG,IAAI,6BAAa,CAAW,sBAAU,EAAE;IAC1D,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,CAAC,CAAC;AAEH,MAAM,2BAA2B,GAAG,IAAI,6BAAa,CAInD,8BAAkB,EAClB;IACE,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAyB,GAAG,IAAI,EAAE,EAAE,IAAI,CAAC,CAC7D,CAAC;AAEF,MAAM,YAAY,GAAG,IAAI,6BAAa,CACpC,uBAAW,EACX;IACE,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,CACF,CAAC;AAEF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAEpD,MAAM,CAAC,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC,GAAG;QAChD,IAAA,oBAAa,EAAC,KAAK,EAAE,OAAO,CAAC;QAC7B,IAAA,sB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GAAG,EAAE,CAAC,IAAA,yBAAQ,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE;aAC/D,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5C,MAAM,eAAe,GAAG,gBAAgB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAChE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;YAE7D,OAAO,CAAC,OAAO,CACb,GAAG,OAAO,CAAC,IAAI,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAC3D,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -22,26 +22,20 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
22
22
  if (accounts.length !== 1)
23
23
  return [];
24
24
  const escrowAccount = accounts[0];
25
- const { amount, escrowEndsAt, duration } = escrowAccount;
25
+ const { amount, escrowEndsAt } = escrowAccount;
26
26
  if (amount.isZero())
27
27
  return [];
28
- const yearsLocked = duration.dividedBy(60 * 60 * 24 * 365).decimalPlaces(0);
29
- let name = 'Locked';
30
- if (escrowEndsAt.isZero()) {
31
- name += ` (${yearsLocked.toString()} year${yearsLocked.isGreaterThan(1) ? 's' : ''})`;
32
- }
33
28
  const registry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
34
29
  const element = registry.addElementMultiple({
35
30
  label: 'Vesting',
36
31
  link: 'https://lifinity.io/reward',
37
32
  ref: escrowAccount.pubkey,
38
- name,
39
33
  });
40
34
  element.addAsset({
41
35
  address: constants_1.lfntyMint,
42
36
  amount,
43
37
  attributes: {
44
- lockedUntil: escrowEndsAt.times(1000).toNumber() || undefined,
38
+ lockedUntil: escrowEndsAt.times(1000).toNumber() || -1,
45
39
  },
46
40
  });
47
41
  return registry.getElements(cache);
@@ -1 +1 @@
1
- {"version":3,"file":"lockerFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lifinity/lockerFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAA6E;AAC7E,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAyC;AACzC,uCAAyC;AACzC,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,MAAM,EACN,sBAAY,EACZ,mCAAuB,EACvB,IAAA,sBAAY,EAAC,KAAK,CAAC,CACpB,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAElC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC;IAEzD,IAAI,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC;IAE/B,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5E,IAAI,IAAI,GAAG,QAAQ,CAAC;IACpB,IAAI,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1B,IAAI,IAAI,KAAK,WAAW,CAAC,QAAQ,EAAE,QACjC,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AAK,CAAC,CACpB,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAElC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,aAAa,CAAC;IAE/C,IAAI,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC;IAE/B,MAAM,QAAQ,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IACnE,MAAM,OAAO,GAAG,QAAQ,CAAC,kBAAkB,CAAC;QAC1C,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,4BAA4B;QAClC,GAAG,EAAE,aAAa,CAAC,MAAM;KAC1B,CAAC,CAAC;IAEH,OAAO,CAAC,QAAQ,CAAC;QACf,OAAO,EAAE,qBAAS;QAClB,MAAM;QACN,UAAU,EAAE;YACV,WAAW,EAAE,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SACvD;KACF,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -25,14 +25,14 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
25
25
  const { balances } = marginfiAccount;
26
26
  if (!balances || balances.length === 0)
27
27
  return;
28
+ const element = elementRegistry.addElementBorrowlend({
29
+ label: 'Lending',
30
+ ref: marginfiAccount.pubkey.toString(),
31
+ link: 'https://app.marginfi.com/portfolio',
32
+ });
28
33
  balances.forEach((balance) => {
29
34
  if (!balance)
30
35
  return;
31
- const element = elementRegistry.addElementBorrowlend({
32
- label: 'Lending',
33
- ref: marginfiAccount.pubkey.toString(),
34
- link: 'https://app.marginfi.com/portfolio',
35
- });
36
36
  if (!balance.assetShares.value.isZero()) {
37
37
  const suppliedAmount = (0, helpers_1.wrappedI80F48toBigNumber)(balance.assetShares)
38
38
  .times(balance.bank.dividedAssetShareValue)
@@ -1 +1 @@
1
- {"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,2CAAyC;AACzC,uCAAqD;AAGrD,gFAA6E;AAC7E,+DAA4D;AAE5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,gBAAgB,GAAG,MAAM,IAAA,yCAAmB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAEjE,IAAI,CAAC,gBAAgB;QAAE,OAAO,EAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IAE1E,gBAAgB,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,EAAE;QAC3C,IAAI,CAAC,eAAe;YAAE,OAAO;QAC7B,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAe,CAAC;QACrC,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAE/C,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC3B,IAAI,CAAC,OAAO;gBAAE,OAAO;YACrB,MAAM,OAAO,GAAG,eAAe,CAAC,oBAAoB,CAAC;gBACnD,KAAK,EAAE,SAAS;gBAChB,GAAG,EAAE,eAAe,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACtC,IAAI,EAAE,oCAAoC;aAC3C,CAAC,CAAC;YAEH,IAAI,CAAC,OAAO,CAAC,WAA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