Updated on 2026-08-14
This commit is contained in:
parent
73028360f4
commit
eaba6ee88d
21 changed files with 282 additions and 81 deletions
|
|
@ -17,6 +17,8 @@ import com.tangem.core.analytics.api.AnalyticsEventHandler
|
|||
import com.tangem.domain.card.repository.CardSdkConfigRepository
|
||||
import com.tangem.domain.common.BlockchainNetwork
|
||||
import com.tangem.domain.common.extensions.fromNetworkId
|
||||
import com.tangem.domain.walletmanager.WalletManagersFacade
|
||||
import com.tangem.features.wallet.featuretoggles.WalletFeatureToggles
|
||||
import com.tangem.lib.crypto.TransactionManager
|
||||
import com.tangem.lib.crypto.models.*
|
||||
import com.tangem.lib.crypto.models.transactions.SendTxResult
|
||||
|
|
@ -35,6 +37,8 @@ class TransactionManagerImpl(
|
|||
private val appStateHolder: AppStateHolder,
|
||||
private val analytics: AnalyticsEventHandler,
|
||||
private val cardSdkConfigRepository: CardSdkConfigRepository,
|
||||
private val walletManagersFacade: WalletManagersFacade,
|
||||
private val walletFeatureToggles: WalletFeatureToggles,
|
||||
) : TransactionManager {
|
||||
|
||||
override suspend fun sendApproveTransaction(
|
||||
|
|
@ -409,9 +413,20 @@ class TransactionManagerImpl(
|
|||
}
|
||||
}
|
||||
|
||||
private fun getActualWalletManager(blockchain: Blockchain, derivationPath: String?): WalletManager {
|
||||
val blockchainNetwork = BlockchainNetwork(blockchain, derivationPath, emptyList())
|
||||
val walletManager = appStateHolder.walletState?.getWalletManager(blockchainNetwork)
|
||||
private suspend fun getActualWalletManager(blockchain: Blockchain, derivationPath: String?): WalletManager {
|
||||
val walletManager = if (walletFeatureToggles.isRedesignedScreenEnabled) {
|
||||
val selectedUserWallet = requireNotNull(
|
||||
appStateHolder.userWalletsListManager?.selectedUserWalletSync,
|
||||
) { "userWallet or userWalletsListManager is null" }
|
||||
walletManagersFacade.getOrCreateWalletManager(
|
||||
selectedUserWallet,
|
||||
blockchain,
|
||||
derivationPath,
|
||||
)
|
||||
} else {
|
||||
val blockchainNetwork = BlockchainNetwork(blockchain, derivationPath, emptyList())
|
||||
appStateHolder.walletState?.getWalletManager(blockchainNetwork)
|
||||
}
|
||||
return requireNotNull(walletManager) { "no wallet manager found" }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue