From 3d0798f692aaa0469c240d96bffd9af75f3450b8 Mon Sep 17 00:00:00 2001 From: Anxo Rodriguez Date: Mon, 22 Jul 2024 17:26:33 +0100 Subject: [PATCH] Simplify --- .../src/UsdRepository/UsdRepositoryCoingecko.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.ts b/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.ts index 72f96f3..ec96e6e 100644 --- a/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.ts +++ b/libs/repositories/src/UsdRepository/UsdRepositoryCoingecko.ts @@ -55,12 +55,7 @@ export class UsdRepositoryCoingecko implements UsdRepository { // FIXME: This is a workaround for the fact that Coingecko Open API has a hardcoded BTC address in the response (notified the Coingecko team about this issue, so remove when the issue is fixed) const priceData = data as SimplePriceResponse; - if ( - response.status === 404 || - !priceData || - !priceData[tokenAddressLower] || - !priceData[tokenAddressLower].usd - ) { + if (response.status === 404 || !priceData?.[tokenAddressLower]?.usd) { return null; } await throwIfUnsuccessful(