Updated on 2026-08-14
This commit is contained in:
parent
951226f28f
commit
c7792de43b
10 changed files with 30 additions and 81 deletions
|
|
@ -29,7 +29,6 @@ import com.tangem.domain.nft.repository.NFTRepository
|
|||
import com.tangem.domain.walletmanager.WalletManagersFacade
|
||||
import com.tangem.domain.wallets.models.UserWalletId
|
||||
import com.tangem.domain.wallets.models.requireColdWallet
|
||||
import com.tangem.features.nft.NFTFeatureToggles
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import com.tangem.utils.coroutines.JobHolder
|
||||
import com.tangem.utils.coroutines.saveIn
|
||||
|
|
@ -50,7 +49,6 @@ internal class DefaultNFTRepository @Inject constructor(
|
|||
private val walletManagersFacade: WalletManagersFacade,
|
||||
private val dispatchers: CoroutineDispatcherProvider,
|
||||
private val userWalletsStore: UserWalletsStore,
|
||||
private val nftFeatureToggles: NFTFeatureToggles,
|
||||
private val networkFactory: NetworkFactory,
|
||||
private val excludedBlockchains: ExcludedBlockchains,
|
||||
resources: Resources,
|
||||
|
|
@ -545,13 +543,9 @@ internal class DefaultNFTRepository @Inject constructor(
|
|||
|
||||
private fun Network.canHandleNFTs(userWalletId: UserWalletId): Boolean {
|
||||
val scanResponse = userWalletsStore.getSyncStrict(userWalletId).requireColdWallet().scanResponse
|
||||
val blockchain = Blockchain.fromNetworkId(backendId)
|
||||
return when {
|
||||
blockchain == null -> false
|
||||
blockchain.isEvm() && !nftFeatureToggles.isNFTEVMEnabled -> false
|
||||
blockchain == Blockchain.Solana && !nftFeatureToggles.isNFTSolanaEnabled -> false
|
||||
else -> blockchain.canHandleNFTs() &&
|
||||
scanResponse.card.canHandleToken(blockchain, scanResponse.cardTypesResolver, excludedBlockchains)
|
||||
}
|
||||
val blockchain = Blockchain.fromNetworkId(backendId) ?: return false
|
||||
|
||||
return blockchain.canHandleNFTs() &&
|
||||
scanResponse.card.canHandleToken(blockchain, scanResponse.cardTypesResolver, excludedBlockchains)
|
||||
}
|
||||
}
|
||||
|
|
@ -9,7 +9,6 @@ import com.tangem.datasource.local.nft.NFTRuntimeStoreFactory
|
|||
import com.tangem.datasource.local.userwallet.UserWalletsStore
|
||||
import com.tangem.domain.nft.repository.NFTRepository
|
||||
import com.tangem.domain.walletmanager.WalletManagersFacade
|
||||
import com.tangem.features.nft.NFTFeatureToggles
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
|
@ -32,7 +31,6 @@ internal object NFTDataModule {
|
|||
dispatchers: CoroutineDispatcherProvider,
|
||||
excludedBlockchains: ExcludedBlockchains,
|
||||
userWalletsStore: UserWalletsStore,
|
||||
nftFeatureToggles: NFTFeatureToggles,
|
||||
networkFactory: NetworkFactory,
|
||||
): NFTRepository = DefaultNFTRepository(
|
||||
nftPersistenceStoreFactory = nftPersistenceStoreFactory,
|
||||
|
|
@ -41,7 +39,6 @@ internal object NFTDataModule {
|
|||
dispatchers = dispatchers,
|
||||
excludedBlockchains = excludedBlockchains,
|
||||
userWalletsStore = userWalletsStore,
|
||||
nftFeatureToggles = nftFeatureToggles,
|
||||
networkFactory = networkFactory,
|
||||
resources = context.resources,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue