From e5e7af5ab269fbc2f56e30863614d138d029fe25 Mon Sep 17 00:00:00 2001 From: Inokentii Mazhara Date: Fri, 2 Feb 2024 12:28:13 +0200 Subject: [PATCH] TW-1282 Fix ts errors --- src/utils/tokens.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/tokens.ts b/src/utils/tokens.ts index 898fb83..c468e6d 100644 --- a/src/utils/tokens.ts +++ b/src/utils/tokens.ts @@ -40,14 +40,14 @@ const getTokensExchangeRates = async (): Promise => { } const exchangeRatesWithHoles = await Promise.all( - tokens + tokens! .filter( (token): token is ThreeRouteFa12Token | ThreeRouteFa2Token => token.standard !== ThreeRouteStandardEnum.xtz ) .map(async (token): Promise => { const { contract, tokenId: rawTokenId, symbol } = token; const tokenId = isDefined(rawTokenId) ? Number(rawTokenId) : undefined; - const { ask, bid } = exchangeRatesInputs[symbol] ?? { ask: 0, bid: 0 }; + const { ask, bid } = exchangeRatesInputs![symbol] ?? { ask: 0, bid: 0 }; if (ask === 0 && bid === 0) { logger.error(`Failed to get exchange rate for token ${token.symbol}`); @@ -57,7 +57,7 @@ const getTokensExchangeRates = async (): Promise => { const { data: metadata } = await tokensMetadataProvider.get(contract, tokenId); const tokensPerTez = ask === 0 ? bid : ask; - const exchangeRate = new BigNumber(1).div(tokensPerTez).times(tezExchangeRate); + const exchangeRate = new BigNumber(1).div(tokensPerTez).times(tezExchangeRate!); return { tokenAddress: contract,