Updated on 2026-08-14

This commit is contained in:
Tangem 2024-11-29 15:52:04 +04:00
parent 292b6e93e5
commit e40ba1ab1e
3 changed files with 88 additions and 91 deletions

View file

@ -79,12 +79,11 @@ internal class ManagedCryptoCurrencyFactory {
scanResponse: ScanResponse,
): List<ManagedCryptoCurrency> = tokensResponse.tokens
.mapNotNull { token ->
maybeCreateCustomToken(token, null, scanResponse)
maybeCreateCustomToken(token, scanResponse)
}
private fun maybeCreateCustomToken(
token: UserTokensResponse.Token,
imageHost: String?,
scanResponse: ScanResponse,
): ManagedCryptoCurrency? {
val blockchain = Blockchain.fromNetworkId(token.networkId)
@ -107,7 +106,7 @@ internal class ManagedCryptoCurrencyFactory {
currencyId = getCoinId(network, blockchain.toCoinId()),
name = token.name,
symbol = token.symbol,
iconUrl = getIconUrl(blockchain.id, imageHost),
iconUrl = getIconUrl(blockchain.id),
network = network,
)
} else {
@ -115,7 +114,7 @@ internal class ManagedCryptoCurrencyFactory {
currencyId = getTokenId(network, token.id, contractAddress),
name = token.name,
symbol = token.symbol,
iconUrl = token.id?.let { getIconUrl(it, imageHost) },
iconUrl = token.id?.let { getIconUrl(it) },
contractAddress = contractAddress,
network = network,
decimals = token.decimals,