Skip to content

Commit

Permalink
perf: return early when chainId is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Jan 11, 2025
1 parent 806da7b commit e7e072d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/resolvers/coingecko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export default async function resolve(address: string, chainId: string) {

try {
const assetPlatformId = COINGECKO_ASSET_PLATFORMS[chainId];

if (!assetPlatformId) return false;

const checksum = getAddress(address);
const url = `https://pro-api.coingecko.com/api/v3/coins/${assetPlatformId}/contract/${checksum}`;

Expand Down

0 comments on commit e7e072d

Please sign in to comment.