@defisaver/positions-sdk 2.1.150-cirbtc-dev → 2.1.150

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.
@@ -11,7 +11,7 @@ import Dec from 'decimal.js';
11
11
  import { NetworkNumber } from '../types/common';
12
12
  import { AaveMarkets, AaveV4Spokes, CompoundMarkets, CrvUsdMarkets, LiquityV2Markets, LlamaLendMarkets, MorphoBlueMarkets, MorphoMidnightMarkets, SparkMarkets, } from '../markets';
13
13
  import { _getMorphoBlueAccountData, _getMorphoBluePortfolioMarketData, getMorphoEarn } from '../morphoBlue';
14
- import { _getMorphoMidnightAccountData, _getMorphoMidnightMarketData, getMorphoMidnightEarn } from '../morphoMidnight';
14
+ import { _getMorphoMidnightAccountData, _getMorphoMidnightMarketData } from '../morphoMidnight';
15
15
  import { AaveVersions, CompoundVersions, } from '../types';
16
16
  import { _getCompoundV3AccountData, _getCompoundV3MarketsData } from '../compoundV3';
17
17
  import { _getSparkAccountData, _getSparkMarketsData } from '../spark';
@@ -107,7 +107,6 @@ export function getPortfolioData(provider_1, network_1, defaultProvider_1, addre
107
107
  stakingPositions[address.toLowerCase()] = {
108
108
  aaveV3: {},
109
109
  morphoBlue: {},
110
- morphoMidnight: {},
111
110
  compoundV3: {},
112
111
  spark: {},
113
112
  aaveV2: {},
@@ -475,32 +474,9 @@ export function getPortfolioData(provider_1, network_1, defaultProvider_1, addre
475
474
  }))).flat(),
476
475
  ...morphoMidnightMarkets.map((market) => addresses.map((address) => __awaiter(this, void 0, void 0, function* () {
477
476
  try {
478
- const [accDataPromise, earnDataPromise] = yield Promise.allSettled([
479
- _getMorphoMidnightAccountData(client, network, address, market, morphoMidnightMarketsData[market.value]),
480
- getMorphoMidnightEarn(client, network, address, market, morphoMidnightMarketsData[market.value]),
481
- ]);
482
- if (accDataPromise.status === 'rejected') {
483
- console.error(`Error fetching MorphoMidnight account data for address ${address} on market ${market.value}:`, accDataPromise.reason);
484
- positions[address.toLowerCase()].morphoMidnight[market.value] = { error: `Error fetching MorphoMidnight account data for address ${address} on market ${market.value}`, data: null };
485
- }
486
- if (earnDataPromise.status === 'rejected') {
487
- console.error(`Error fetching MorphoMidnight account data for address ${address} on market ${market.value}:`, earnDataPromise.reason);
488
- positions[address.toLowerCase()].morphoMidnight[market.value] = { error: `Error fetching MorphoMidnight account data for address ${address} on market ${market.value}`, data: null };
489
- }
490
- if (accDataPromise.status !== 'rejected') {
491
- const accData = accDataPromise.value;
492
- if (new Dec(accData.suppliedUsd).gt(0))
493
- positions[address.toLowerCase()].morphoMidnight[market.value] = { error: '', data: accData };
494
- }
495
- if (earnDataPromise.status !== 'rejected') {
496
- const earnData = earnDataPromise.value;
497
- if (earnData && new Dec(earnData.amount).gt(0)) {
498
- stakingPositions[address.toLowerCase()].morphoMidnight[market.value] = {
499
- error: '',
500
- data: earnData,
501
- };
502
- }
503
- }
477
+ const accData = yield _getMorphoMidnightAccountData(client, network, address, market, morphoMidnightMarketsData[market.value]);
478
+ if (new Dec(accData.suppliedUsd).gt(0))
479
+ positions[address.toLowerCase()].morphoMidnight[market.value] = { error: '', data: accData };
504
480
  }
505
481
  catch (error) {
506
482
  console.error(`Error fetching MorphoMidnight account data for address ${address} on market ${market.value}:`, error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "2.1.150-cirbtc-dev",
3
+ "version": "2.1.150",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",