Skip to content

Commit

Permalink
Merge pull request #251 from balancer/fix/price-fetching
Browse files Browse the repository at this point in the history
fix: price fetching
  • Loading branch information
gmbronco authored Dec 7, 2023
2 parents ae0a2c0 + 92b4d0c commit 07f111f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/modules/prices/beets-price-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ class BeetsPriceFetcher {
if (unspupportedChains.includes(chainId)) {
return {};
}
const gqlChain = configs[chainId].GqlChain || 'MAINNET';

let gqlChain = 'MAINNET';
try {
gqlChain = configs[chainId].GqlChain;
} catch (e) {
console.error(`Chain ${chainId} not supported`);
return {};
}

const payload = JSON.stringify({
query: `query { tokenGetCurrentPrices(chains: [${gqlChain}]) { address price }}`,
});
Expand Down

0 comments on commit 07f111f

Please sign in to comment.