Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update token rates controller for multi evm fetching #4866

Merged
merged 14 commits into from
Nov 1, 2024
Prev Previous commit
Next Next commit
fix dedupe logic
  • Loading branch information
bergeron committed Oct 29, 2024
commit 252be41dd438e251e93eb68a74ec63df7c4254d5
4 changes: 2 additions & 2 deletions packages/assets-controllers/src/CurrencyRateController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class CurrencyRateController extends StaticIntervalPollingController<Curr
// For preloaded testnets (Goerli, Sepolia) we want to fetch exchange rate for real ETH.
// Map each native currency to the symbol we want to fetch for it.
const testnetSymbols = Object.values(TESTNET_TICKER_SYMBOLS);
const nativeCurrenciesToFetch = [...new Set(nativeCurrencies)].reduce(
const nativeCurrenciesToFetch = nativeCurrencies.reduce(
(acc, nativeCurrency) => {
acc[nativeCurrency] = testnetSymbols.includes(nativeCurrency)
? FALL_BACK_VS_CURRENCY
Expand All @@ -177,7 +177,7 @@ export class CurrencyRateController extends StaticIntervalPollingController<Curr

const fetchExchangeRateResponse = await this.fetchMultiExchangeRate(
currentCurrency,
Object.values(nativeCurrenciesToFetch),
[...new Set(Object.values(nativeCurrenciesToFetch))],
this.includeUsdRate,
);

Expand Down
Loading