Updated on 2026-08-14
This commit is contained in:
parent
3ce7ca5a26
commit
40058e8330
2 changed files with 14 additions and 6 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue