@defisaver/positions-sdk 2.1.163 → 2.1.165

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.
@@ -754,8 +754,8 @@ function getShifterPortfolioData(provider_1, network_1, defaultProvider_1, addre
754
754
  ...aaveV3Markets.map((market) => addresses.map((address) => __awaiter(this, void 0, void 0, function* () {
755
755
  try {
756
756
  const accData = yield (0, aaveV3_1._getAaveV3AccountData)(client, network, address, Object.assign({ selectedMarket: market }, markets.aaveV3MarketsData[market.value]));
757
- if (new decimal_js_1.default(accData.suppliedUsd).gt(0))
758
- positions[address.toLowerCase()].aaveV3[market.value] = { error: '', data: accData };
757
+ // Always store the position (even with no supply) so the eMode category is available to the shifter
758
+ positions[address.toLowerCase()].aaveV3[market.value] = { error: '', data: accData };
759
759
  }
760
760
  catch (error) {
761
761
  console.error(`Error fetching AaveV3 account data for address ${address} on market ${market.value}:`, error);
@@ -798,8 +798,8 @@ function getShifterPortfolioData(provider_1, network_1, defaultProvider_1, addre
798
798
  ...sparkMarkets.map((market) => addresses.map((address) => __awaiter(this, void 0, void 0, function* () {
799
799
  try {
800
800
  const accData = yield (0, spark_1._getSparkAccountData)(client, network, address, { selectedMarket: market, assetsData: markets.sparkMarketsData[market.value].assetsData, eModeCategoriesData: markets.sparkMarketsData[market.value].eModeCategoriesData });
801
- if (new decimal_js_1.default(accData.suppliedUsd).gt(0))
802
- positions[address.toLowerCase()].spark[market.value] = { error: '', data: accData };
801
+ // Always store the position (even with no supply) so the eMode category is available to the shifter
802
+ positions[address.toLowerCase()].spark[market.value] = { error: '', data: accData };
803
803
  }
804
804
  catch (error) {
805
805
  console.error(`Error fetching Spark account data for address ${address} on market ${market.value}:`, error);
@@ -733,8 +733,8 @@ export function getShifterPortfolioData(provider_1, network_1, defaultProvider_1
733
733
  ...aaveV3Markets.map((market) => addresses.map((address) => __awaiter(this, void 0, void 0, function* () {
734
734
  try {
735
735
  const accData = yield _getAaveV3AccountData(client, network, address, Object.assign({ selectedMarket: market }, markets.aaveV3MarketsData[market.value]));
736
- if (new Dec(accData.suppliedUsd).gt(0))
737
- positions[address.toLowerCase()].aaveV3[market.value] = { error: '', data: accData };
736
+ // Always store the position (even with no supply) so the eMode category is available to the shifter
737
+ positions[address.toLowerCase()].aaveV3[market.value] = { error: '', data: accData };
738
738
  }
739
739
  catch (error) {
740
740
  console.error(`Error fetching AaveV3 account data for address ${address} on market ${market.value}:`, error);
@@ -777,8 +777,8 @@ export function getShifterPortfolioData(provider_1, network_1, defaultProvider_1
777
777
  ...sparkMarkets.map((market) => addresses.map((address) => __awaiter(this, void 0, void 0, function* () {
778
778
  try {
779
779
  const accData = yield _getSparkAccountData(client, network, address, { selectedMarket: market, assetsData: markets.sparkMarketsData[market.value].assetsData, eModeCategoriesData: markets.sparkMarketsData[market.value].eModeCategoriesData });
780
- if (new Dec(accData.suppliedUsd).gt(0))
781
- positions[address.toLowerCase()].spark[market.value] = { error: '', data: accData };
780
+ // Always store the position (even with no supply) so the eMode category is available to the shifter
781
+ positions[address.toLowerCase()].spark[market.value] = { error: '', data: accData };
782
782
  }
783
783
  catch (error) {
784
784
  console.error(`Error fetching Spark 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.163",
3
+ "version": "2.1.165",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -18,7 +18,8 @@
18
18
  "version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\""
19
19
  },
20
20
  "keywords": [],
21
- "author": "",
21
+ "author": "DeFi Saver",
22
+ "repository": "https://github.com/defisaver/defisaver-positions-sdk",
22
23
  "license": "ISC",
23
24
  "dependencies": {
24
25
  "@defisaver/tokens": "^1.7.45",
@@ -734,7 +734,8 @@ export async function getShifterPortfolioData(provider: EthereumProvider, networ
734
734
  ...aaveV3Markets.map((market) => addresses.map(async (address) => {
735
735
  try {
736
736
  const accData = await _getAaveV3AccountData(client, network, address, { selectedMarket: market, ...markets.aaveV3MarketsData[market.value] });
737
- if (new Dec(accData.suppliedUsd).gt(0)) positions[address.toLowerCase() as EthAddress].aaveV3[market.value] = { error: '', data: accData };
737
+ // Always store the position (even with no supply) so the eMode category is available to the shifter
738
+ positions[address.toLowerCase() as EthAddress].aaveV3[market.value] = { error: '', data: accData };
738
739
  } catch (error) {
739
740
  console.error(`Error fetching AaveV3 account data for address ${address} on market ${market.value}:`, error);
740
741
  positions[address.toLowerCase() as EthAddress].aaveV3[market.value] = { error: `Error fetching AaveV3 account data for address ${address} on market ${market.value}`, data: null };
@@ -770,7 +771,8 @@ export async function getShifterPortfolioData(provider: EthereumProvider, networ
770
771
  ...sparkMarkets.map((market) => addresses.map(async (address) => {
771
772
  try {
772
773
  const accData = await _getSparkAccountData(client, network, address, { selectedMarket: market, assetsData: markets.sparkMarketsData[market.value].assetsData, eModeCategoriesData: markets.sparkMarketsData[market.value].eModeCategoriesData });
773
- if (new Dec(accData.suppliedUsd).gt(0)) positions[address.toLowerCase() as EthAddress].spark[market.value] = { error: '', data: accData };
774
+ // Always store the position (even with no supply) so the eMode category is available to the shifter
775
+ positions[address.toLowerCase() as EthAddress].spark[market.value] = { error: '', data: accData };
774
776
  } catch (error) {
775
777
  console.error(`Error fetching Spark account data for address ${address} on market ${market.value}:`, error);
776
778
  positions[address.toLowerCase() as EthAddress].spark[market.value] = { error: `Error fetching Spark account data for address ${address} on market ${market.value}`, data: null };