Updated on 2026-08-14

This commit is contained in:
Tangem 2025-04-17 18:53:20 +05:00
commit c2039b7cc1
2 changed files with 14 additions and 6 deletions

View file

@ -22,6 +22,7 @@ import com.tangem.domain.managetokens.model.ManagedCryptoCurrency.SourceNetwork
import com.tangem.domain.models.scan.ScanResponse
import com.tangem.domain.tokens.model.CryptoCurrency
import com.tangem.domain.tokens.model.Network
import timber.log.Timber
internal class ManagedCryptoCurrencyFactory(
private val excludedBlockchains: ExcludedBlockchains,
@ -187,11 +188,18 @@ internal class ManagedCryptoCurrencyFactory(
decimals = blockchain.decimals(),
isL2Network = l2BlockchainsList.contains(blockchain),
)
network.canHandleTokens -> SourceNetwork.Default(
network = network,
decimals = decimals ?: return null,
contractAddress = contractAddress,
)
network.canHandleTokens -> {
val formattedContractAddress = blockchain.reformatContractAddress(contractAddress)
if (formattedContractAddress == null) {
Timber.w("Couldn't reformat $contractAddress")
return null
}
SourceNetwork.Default(
network = network,
decimals = decimals ?: return null,
contractAddress = formattedContractAddress,
)
}
else -> null
}
}

View file

@ -72,7 +72,7 @@ internal class TokenMarketInfoConverter(
TokenMarketInfo.Network(
networkId = network.networkId,
exchangeable = network.exchangeable,
contractAddress = network.contractAddress,
contractAddress = blockchain.reformatContractAddress(network.contractAddress),
decimalCount = network.decimalCount,
)
}