Updated on 2026-08-14

This commit is contained in:
Tangem 2024-01-12 21:42:24 +03:00
parent 4f81761d27
commit 92e038b04f
17 changed files with 262 additions and 155 deletions

View file

@ -20,6 +20,13 @@ class CryptoCurrencyToIconStateConverter : Converter<CryptoCurrencyStatus, Token
}
}
fun convert(currency: CryptoCurrency): TokenIconState {
return when (currency) {
is CryptoCurrency.Coin -> getIconStateForCoin(currency, isUnreachable = false)
is CryptoCurrency.Token -> getIconStateForToken(currency, isErrorStatus = false)
}
}
private fun getIconStateForCoin(coin: CryptoCurrency.Coin, isUnreachable: Boolean): TokenIconState.CoinIcon {
return TokenIconState.CoinIcon(
url = coin.iconUrl,