Do not make empty queries to coingecko (#1285)

pull/1294/head
Asa Oines 2 years ago committed by GitHub
parent 4e76095876
commit bc32eb92ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      typescript/sdk/src/gas/token-prices.ts

@ -104,11 +104,13 @@ export class CoinGeckoTokenPriceGetter implements TokenPriceGetter {
}
const toQuery = chains.filter((c) => !this.cache.isFresh(c));
if (toQuery.length > 0) {
try {
await this.queryTokenPrices(toQuery);
} catch (e) {
warn('Failed to query token prices', e);
}
}
return chains.map((chain) => this.cache.fetch(chain));
}

Loading…
Cancel
Save