Skip to content

Commit

Permalink
fixup! feat(fiat): coingecko uses policy id for most of the tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklim committed Jul 4, 2024
1 parent 006302a commit 9373772
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion suite-common/fiat-services/src/coingecko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@ const buildCoinUrls = (ticker: TickerId) => {

const baseUrl = `${COINGECKO_API_BASE_URL}/coins/${coingeckoId}`;

if (!ticker.tokenAddress) {
return [baseUrl];
}

if (ticker.symbol === 'ada') {
const { policyId } = parseAsset(ticker.tokenAddress || '');

return [`${baseUrl}/contract/${policyId}`, `${baseUrl}/contract/${ticker.tokenAddress}`];
}

return [ticker.tokenAddress ? `${baseUrl}/contract/${ticker.tokenAddress}` : baseUrl];
return [`${baseUrl}/contract/${ticker.tokenAddress}`];
};

/**
Expand Down

0 comments on commit 9373772

Please sign in to comment.