Updated on 2026-08-14

This commit is contained in:
Tangem 2025-09-16 17:51:07 +03:00
parent 5c56f04c38
commit 9bd372d0af
6 changed files with 47 additions and 13 deletions

View file

@ -15,6 +15,7 @@ import com.tangem.datasource.api.tangemTech.TangemTechApi
import com.tangem.datasource.local.token.UserTokensResponseStore
import com.tangem.datasource.local.userwallet.UserWalletsStore
import com.tangem.domain.card.common.extensions.canHandleBlockchain
import com.tangem.domain.card.common.extensions.hotWalletExcludedBlockchains
import com.tangem.domain.card.common.extensions.supportedBlockchains
import com.tangem.domain.card.common.util.cardTypesResolver
import com.tangem.domain.managetokens.model.AddCustomTokenForm
@ -252,7 +253,9 @@ internal class DefaultCustomTokensRepository(
is UserWallet.Hot -> {
Blockchain.entries.mapNotNull {
// TODO: refactor [REDACTED_JIRA]\
if (it.isTestnet() || it in excludedBlockchains) return@mapNotNull null
if (it.isTestnet() || it in excludedBlockchains || it in hotWalletExcludedBlockchains) {
return@mapNotNull null
}
networkFactory.create(
blockchain = it,

View file

@ -23,6 +23,7 @@ import com.tangem.datasource.local.userwallet.UserWalletsStore
import com.tangem.domain.card.common.TapWorkarounds.isTestCard
import com.tangem.domain.card.common.extensions.canHandleBlockchain
import com.tangem.domain.card.common.extensions.canHandleToken
import com.tangem.domain.card.common.extensions.hotWalletExcludedBlockchains
import com.tangem.domain.card.common.extensions.supportedBlockchains
import com.tangem.domain.card.common.extensions.supportedTokens
import com.tangem.domain.card.common.util.cardTypesResolver
@ -291,13 +292,8 @@ internal class DefaultManageTokensRepository(
userWallet: UserWallet,
blockchain: Blockchain,
): CurrencyUnsupportedState? {
if (userWallet !is UserWallet.Cold) {
return null
}
val canHandleBlockchain = userWallet.scanResponse.card.canHandleBlockchain(
val canHandleBlockchain = userWallet.canHandleBlockchain(
blockchain = blockchain,
cardTypesResolver = userWallet.cardTypesResolver,
excludedBlockchains = excludedBlockchains,
)
@ -312,6 +308,14 @@ internal class DefaultManageTokensRepository(
userWallet: UserWallet,
blockchain: Blockchain,
): CurrencyUnsupportedState.Token? {
if (userWallet is UserWallet.Hot) {
return if (blockchain in hotWalletExcludedBlockchains) {
CurrencyUnsupportedState.Token.NetworkTokensUnsupported(networkName = blockchain.fullName)
} else {
null
}
}
if (userWallet !is UserWallet.Cold) {
return null
}