Skip to content

Commit

Permalink
feat(graph): remove solana from graph events apart of inserted latest…
Browse files Browse the repository at this point in the history
… value
  • Loading branch information
vytick committed Feb 17, 2025
1 parent 151cd29 commit 4df0565
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions suite-common/graph/src/graphDataFetching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,29 +352,31 @@ export const getMultipleAccountBalanceHistoryWithFiat = async ({
dispatch: ReturnType<typeof useDispatch>;
}): Promise<FiatGraphPoint[] | FiatGraphPointWithCryptoBalance[]> => {
const accountsWithBalanceHistory = await Promise.all(
accounts.map(accountItem => {
const { symbol } = accountItem;

return getAccountBalanceHistory({
endOfTimeFrameDate,
startOfTimeFrameDate,
forceRefetch,
dispatch,
accountItem,
})
.then(balanceHistory => ({
accounts
.filter(a => !isIgnoredBalanceHistoryCoin(a.symbol))
.map(accountItem => {
const { symbol } = accountItem;

return getAccountBalanceHistory({
endOfTimeFrameDate,
startOfTimeFrameDate,
forceRefetch,
dispatch,
accountItem,
balanceHistory,
}))
.catch(error => {
console.error(
`Unable to fetch GRAPH balance history for ${symbol} account:`,
error,
);
error.message = `${symbol.toUpperCase()}: ${error.message}`;
throw error;
});
}),
})
.then(balanceHistory => ({
accountItem,
balanceHistory,
}))
.catch(error => {
console.error(
`Unable to fetch GRAPH balance history for ${symbol} account:`,
error,
);
error.message = `${symbol.toUpperCase()}: ${error.message}`;
throw error;
});
}),
);

const accountsWithBalanceHistoryFlattened: AccountWithBalanceHistory[] = pipe(
Expand Down

0 comments on commit 4df0565

Please sign in to comment.