diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/core/managers/EvmKitManager.kt b/app/src/main/java/io/horizontalsystems/bankwallet/core/managers/EvmKitManager.kt index 1558b449d8..1d0ad47838 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/core/managers/EvmKitManager.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/core/managers/EvmKitManager.kt @@ -2,9 +2,9 @@ package io.horizontalsystems.bankwallet.core.managers import android.os.Handler import android.os.Looper +import android.util.Log import io.horizontalsystems.bankwallet.core.App import io.horizontalsystems.bankwallet.core.UnsupportedAccountException -import io.horizontalsystems.bankwallet.core.supportedNftTypes import io.horizontalsystems.bankwallet.entities.Account import io.horizontalsystems.bankwallet.entities.AccountType import io.horizontalsystems.core.BackgroundManager @@ -20,7 +20,6 @@ import io.horizontalsystems.ethereumkit.models.RpcSource import io.horizontalsystems.ethereumkit.models.TransactionData import io.horizontalsystems.marketkit.models.BlockchainType import io.horizontalsystems.nftkit.core.NftKit -import io.horizontalsystems.nftkit.models.NftType import io.horizontalsystems.oneinchkit.OneInchKit import io.horizontalsystems.uniswapkit.TokenFactory.UnsupportedChainError import io.horizontalsystems.uniswapkit.UniswapKit @@ -145,24 +144,25 @@ class EvmKitManager( } OneInchKit.addDecorators(evmKit) - var nftKit: NftKit? = null - val supportedNftTypes = blockchainType.supportedNftTypes - if (supportedNftTypes.isNotEmpty()) { - val nftKitInstance = NftKit.getInstance(App.instance, evmKit) - supportedNftTypes.forEach { - when (it) { - NftType.Eip721 -> { - nftKitInstance.addEip721TransactionSyncer() - nftKitInstance.addEip721Decorators() - } - NftType.Eip1155 -> { - nftKitInstance.addEip1155TransactionSyncer() - nftKitInstance.addEip1155Decorators() - } - } - } - nftKit = nftKitInstance - } + val nftKit: NftKit? = null +// var nftKit: NftKit? = null +// val supportedNftTypes = blockchainType.supportedNftTypes +// if (supportedNftTypes.isNotEmpty()) { +// val nftKitInstance = NftKit.getInstance(App.instance, evmKit) +// supportedNftTypes.forEach { +// when (it) { +// NftType.Eip721 -> { +// nftKitInstance.addEip721TransactionSyncer() +// nftKitInstance.addEip721Decorators() +// } +// NftType.Eip1155 -> { +// nftKitInstance.addEip1155TransactionSyncer() +// nftKitInstance.addEip1155Decorators() +// } +// } +// } +// nftKit = nftKitInstance +// } evmKit.start() @@ -175,6 +175,7 @@ class EvmKitManager( useCount -= 1 if (useCount < 1) { + Log.d("AAA", "stopEvmKit()") stopEvmKit() } } diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/core/managers/NftAdapterManager.kt b/app/src/main/java/io/horizontalsystems/bankwallet/core/managers/NftAdapterManager.kt index 6de99d731e..38283e314c 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/core/managers/NftAdapterManager.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/core/managers/NftAdapterManager.kt @@ -59,11 +59,14 @@ class NftAdapterManager( if (adapter != null) { adaptersMap[nftKey] = adapter } else if (evmBlockchainManager.getBlockchain(nftKey.blockchainType) != null) { - val evmKitWrapper = - evmBlockchainManager.getEvmKitManager(nftKey.blockchainType).getEvmKitWrapper(nftKey.account, nftKey.blockchainType) + val evmKitManager = evmBlockchainManager.getEvmKitManager(nftKey.blockchainType) + val evmKitWrapper = evmKitManager.getEvmKitWrapper(nftKey.account, nftKey.blockchainType) - evmKitWrapper.nftKit?.let { nftKit -> + val nftKit = evmKitWrapper.nftKit + if (nftKit != null) { adaptersMap[nftKey] = EvmNftAdapter(nftKey.blockchainType, nftKit, evmKitWrapper.evmKit.receiveAddress) + } else { + evmKitManager.unlink(nftKey.account) } } else { // Init other blockchain adapter here (e.g. Solana)