@defisaver/positions-sdk 2.1.163 → 2.1.164
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/cjs/portfolio/index.js
CHANGED
|
@@ -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
|
-
|
|
758
|
-
|
|
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
|
-
|
|
802
|
-
|
|
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);
|
package/esm/portfolio/index.js
CHANGED
|
@@ -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
|
-
|
|
737
|
-
|
|
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
|
-
|
|
781
|
-
|
|
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
package/src/portfolio/index.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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 };
|