Skip to content

Commit

Permalink
TW-1282 Fix ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
keshan3262 committed Feb 2, 2024
1 parent 2024f9c commit e5e7af5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ const getTokensExchangeRates = async (): Promise<TokenExchangeRateEntry[]> => {
}

const exchangeRatesWithHoles = await Promise.all(
tokens
tokens!

Check warning on line 43 in src/utils/tokens.ts

View workflow job for this annotation

GitHub Actions / Checks if ts and lint works

Forbidden non-null assertion
.filter(
(token): token is ThreeRouteFa12Token | ThreeRouteFa2Token => token.standard !== ThreeRouteStandardEnum.xtz
)
.map(async (token): Promise<TokenExchangeRateEntry | undefined> => {
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 };

Check warning on line 50 in src/utils/tokens.ts

View workflow job for this annotation

GitHub Actions / Checks if ts and lint works

Forbidden non-null assertion

if (ask === 0 && bid === 0) {
logger.error(`Failed to get exchange rate for token ${token.symbol}`);
Expand All @@ -57,7 +57,7 @@ const getTokensExchangeRates = async (): Promise<TokenExchangeRateEntry[]> => {

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!);

Check warning on line 60 in src/utils/tokens.ts

View workflow job for this annotation

GitHub Actions / Checks if ts and lint works

Forbidden non-null assertion

return {
tokenAddress: contract,
Expand Down

0 comments on commit e5e7af5

Please sign in to comment.