Updated on 2026-08-14
This commit is contained in:
parent
0b81b905c3
commit
50332186fa
47 changed files with 38 additions and 408 deletions
|
|
@ -1,5 +0,0 @@
|
|||
package com.tangem.features.hotwallet
|
||||
|
||||
interface HotWalletFeatureToggles {
|
||||
val isAssetsDiscoveryEnabled: Boolean
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
package com.tangem.features.hotwallet
|
||||
|
||||
import com.tangem.core.configtoggle.FeatureToggles
|
||||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
||||
|
||||
internal class DefaultHotWalletFeatureToggles(
|
||||
private val featureTogglesManager: FeatureTogglesManager,
|
||||
) : HotWalletFeatureToggles {
|
||||
|
||||
override val isAssetsDiscoveryEnabled: Boolean
|
||||
get() = featureTogglesManager.isFeatureEnabled(FeatureToggles.ASSETS_DISCOVERY_ENABLED)
|
||||
}
|
||||
|
|
@ -17,7 +17,6 @@ import com.tangem.domain.wallets.hot.HotWalletAccessCodeAttemptsRepository.Attem
|
|||
import com.tangem.domain.wallets.hot.HotWalletAccessCodeAttemptsRepository.Companion.MAX_FAST_FORWARD_ATTEMPTS
|
||||
import com.tangem.domain.wallets.hot.HotWalletPasswordRequester
|
||||
import com.tangem.domain.wallets.usecase.DeleteWalletUseCase
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.features.hotwallet.accesscode.ACCESS_CODE_LENGTH
|
||||
import com.tangem.features.hotwallet.accesscoderequest.entity.HotAccessCodeRequestUM
|
||||
import com.tangem.features.hotwallet.impl.R
|
||||
|
|
@ -42,7 +41,6 @@ internal class HotAccessCodeRequestModel @Inject constructor(
|
|||
private val canUseBiometryUseCase: CanUseBiometryUseCase,
|
||||
private val analyticsEventHandler: AnalyticsEventHandler,
|
||||
private val startAssetsDiscoveryUseCase: StartAssetsDiscoveryUseCase,
|
||||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
) : Model() {
|
||||
|
||||
private val result = MutableStateFlow<HotWalletPasswordRequester.Result?>(null)
|
||||
|
|
@ -231,9 +229,7 @@ internal class HotAccessCodeRequestModel @Inject constructor(
|
|||
val userWallet = userWalletsListRepository.userWalletsSync()
|
||||
.firstOrNull { it is UserWallet.Hot && it.hotWalletId == currentRequest.hotWalletId } ?: return
|
||||
|
||||
if (hotWalletFeatureToggles.isAssetsDiscoveryEnabled) {
|
||||
startAssetsDiscoveryUseCase.cancel(userWallet.walletId)
|
||||
}
|
||||
startAssetsDiscoveryUseCase.cancel(userWallet.walletId)
|
||||
|
||||
deleteWalletUseCase(userWallet.walletId)
|
||||
dismiss()
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import com.tangem.domain.wallets.builder.HotUserWalletBuilder
|
|||
import com.tangem.domain.wallets.models.WalletSyncResult
|
||||
import com.tangem.domain.wallets.usecase.SaveWalletUseCase
|
||||
import com.tangem.domain.wallets.usecase.SyncWalletWithRemoteUseCase
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.features.hotwallet.MnemonicRepository
|
||||
import com.tangem.features.hotwallet.addexistingwallet.im.port.AddExistingWalletImportComponent
|
||||
import com.tangem.features.hotwallet.addexistingwallet.im.port.entity.AddExistingWalletImportUM
|
||||
|
|
@ -47,7 +46,6 @@ internal class AddExistingWalletImportModel @Inject constructor(
|
|||
private val saveUserWalletUseCase: SaveWalletUseCase,
|
||||
private val syncWalletWithRemoteUseCase: SyncWalletWithRemoteUseCase,
|
||||
private val startAssetsDiscoveryUseCase: StartAssetsDiscoveryUseCase,
|
||||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
@GlobalUiMessageSender private val uiMessageSender: UiMessageSender,
|
||||
private val analyticsEventHandler: AnalyticsEventHandler,
|
||||
private val appsFlyerStore: AppsFlyerStore,
|
||||
|
|
@ -120,9 +118,7 @@ internal class AddExistingWalletImportModel @Inject constructor(
|
|||
|
||||
launch(dispatchers.main + NonCancellable) {
|
||||
val syncResult = syncWalletWithRemoteUseCase(userWallet.walletId)
|
||||
if (hotWalletFeatureToggles.isAssetsDiscoveryEnabled &&
|
||||
syncResult == WalletSyncResult.Created
|
||||
) {
|
||||
if (syncResult == WalletSyncResult.Created) {
|
||||
startAssetsDiscoveryUseCase(userWallet.walletId)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
package com.tangem.features.hotwallet.di
|
||||
|
||||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
||||
import com.tangem.features.hotwallet.DefaultHotWalletFeatureToggles
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
internal object HotWalletFeatureModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideHotWalletFeatureToggles(featureTogglesManager: FeatureTogglesManager): HotWalletFeatureToggles {
|
||||
return DefaultHotWalletFeatureToggles(featureTogglesManager)
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,6 @@ import com.tangem.core.ui.message.SnackbarMessage
|
|||
import com.tangem.domain.assetsdiscovery.usecase.StartAssetsDiscoveryUseCase
|
||||
import com.tangem.domain.wallets.usecase.DeleteWalletUseCase
|
||||
import com.tangem.features.hotwallet.ForgetWalletComponent
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.features.hotwallet.forgetwallet.entity.ForgetWalletUM
|
||||
import com.tangem.features.hotwallet.impl.R
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
|
|
@ -34,7 +33,6 @@ internal class ForgetWalletModel @Inject constructor(
|
|||
private val deleteWalletUseCase: DeleteWalletUseCase,
|
||||
private val uiMessageSender: UiMessageSender,
|
||||
private val startAssetsDiscoveryUseCase: StartAssetsDiscoveryUseCase,
|
||||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
) : Model() {
|
||||
|
||||
private val params = paramsContainer.require<ForgetWalletComponent.Params>()
|
||||
|
|
@ -84,9 +82,7 @@ internal class ForgetWalletModel @Inject constructor(
|
|||
|
||||
private fun forgetWallet() {
|
||||
modelScope.launch {
|
||||
if (hotWalletFeatureToggles.isAssetsDiscoveryEnabled) {
|
||||
startAssetsDiscoveryUseCase.cancel(params.userWalletId)
|
||||
}
|
||||
startAssetsDiscoveryUseCase.cancel(params.userWalletId)
|
||||
|
||||
val hasUserWallets = deleteWalletUseCase(params.userWalletId)
|
||||
.getOrElse { error ->
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import com.tangem.domain.wallets.hot.HotWalletAccessCodeAttemptsRepository.Attem
|
|||
import com.tangem.domain.wallets.hot.HotWalletAccessCodeAttemptsRepository.Attempts
|
||||
import com.tangem.domain.wallets.hot.HotWalletPasswordRequester.AttemptRequest
|
||||
import com.tangem.domain.wallets.usecase.DeleteWalletUseCase
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.hot.sdk.model.HotWalletId
|
||||
import com.tangem.utils.coroutines.TestingCoroutineDispatcherProvider
|
||||
import io.mockk.clearMocks
|
||||
|
|
@ -38,9 +37,6 @@ internal class HotAccessCodeRequestModelTest {
|
|||
private val canUseBiometryUseCase: CanUseBiometryUseCase = mockk(relaxed = true)
|
||||
private val analyticsEventHandler: AnalyticsEventHandler = mockk(relaxUnitFun = true)
|
||||
private val startAssetsDiscoveryUseCase: StartAssetsDiscoveryUseCase = mockk(relaxed = true)
|
||||
private val hotWalletFeatureToggles: HotWalletFeatureToggles = mockk {
|
||||
every { isAssetsDiscoveryEnabled } returns false
|
||||
}
|
||||
|
||||
private val hotWalletIdA: HotWalletId = mockk()
|
||||
private val hotWalletIdB: HotWalletId = mockk()
|
||||
|
|
@ -152,7 +148,6 @@ internal class HotAccessCodeRequestModelTest {
|
|||
canUseBiometryUseCase = canUseBiometryUseCase,
|
||||
analyticsEventHandler = analyticsEventHandler,
|
||||
startAssetsDiscoveryUseCase = startAssetsDiscoveryUseCase,
|
||||
hotWalletFeatureToggles = hotWalletFeatureToggles,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
|||
import arrow.core.getOrElse
|
||||
import com.tangem.core.decompose.context.AppComponentContext
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.domain.dynamicaddresses.DynamicAddressesFeatureToggles
|
||||
import com.tangem.domain.dynamicaddresses.repository.DynamicAddressesRepository
|
||||
import com.tangem.domain.managetokens.ValidateDerivationPathUseCase
|
||||
import com.tangem.domain.managetokens.model.exceptoin.DerivationPathValidationException
|
||||
|
|
@ -31,13 +30,11 @@ internal class DefaultCustomTokenDerivationInputComponent @AssistedInject constr
|
|||
@Assisted private val params: CustomTokenDerivationInputComponent.Params,
|
||||
private val validateDerivationPathUseCase: ValidateDerivationPathUseCase,
|
||||
private val dynamicAddressesRepository: DynamicAddressesRepository,
|
||||
private val dynamicAddressesFeatureToggles: DynamicAddressesFeatureToggles,
|
||||
) : CustomTokenDerivationInputComponent, AppComponentContext by context {
|
||||
|
||||
private val cardanoDerivationPathValidator = CardanoDerivationPathValidator()
|
||||
private val dynamicAddressesDerivationValidator = DynamicAddressesDerivationValidator(
|
||||
dynamicAddressesRepository = dynamicAddressesRepository,
|
||||
dynamicAddressesFeatureToggles = dynamicAddressesFeatureToggles,
|
||||
)
|
||||
|
||||
private val state: MutableStateFlow<CustomDerivationInputUM> = MutableStateFlow(
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.tangem.features.managetokens.utils
|
|||
|
||||
import com.tangem.blockchainsdk.utils.toBlockchain
|
||||
import com.tangem.domain.dynamicaddresses.DynamicAddressesDerivationChecker
|
||||
import com.tangem.domain.dynamicaddresses.DynamicAddressesFeatureToggles
|
||||
import com.tangem.domain.dynamicaddresses.DynamicAddressesSupportedBlockchains
|
||||
import com.tangem.domain.dynamicaddresses.repository.DynamicAddressesRepository
|
||||
import com.tangem.domain.models.network.Network
|
||||
|
|
@ -18,7 +17,6 @@ import kotlinx.coroutines.flow.firstOrNull
|
|||
*/
|
||||
internal class DynamicAddressesDerivationValidator(
|
||||
private val dynamicAddressesRepository: DynamicAddressesRepository,
|
||||
private val dynamicAddressesFeatureToggles: DynamicAddressesFeatureToggles,
|
||||
) {
|
||||
|
||||
/**
|
||||
|
|
@ -29,7 +27,6 @@ internal class DynamicAddressesDerivationValidator(
|
|||
networkId: Network.ID,
|
||||
path: String?,
|
||||
): Boolean {
|
||||
if (!dynamicAddressesFeatureToggles.isDynamicAddressesEnabled) return false
|
||||
if (path == null) return false
|
||||
if (!isSupportedBlockchain(networkId)) return false
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,6 @@ internal class DefaultTxHistoryFeatureToggles @Inject constructor(
|
|||
private val featureTogglesManager: FeatureTogglesManager,
|
||||
) : TxHistoryFeatureToggles {
|
||||
|
||||
override val isSolanaTxHistoryEnabled: Boolean
|
||||
get() = featureTogglesManager.isFeatureEnabled(FeatureToggles.SOLANA_TX_HISTORY_ENABLED)
|
||||
|
||||
override val isNewTxHistoryEnabled: Boolean
|
||||
get() = featureTogglesManager.isFeatureEnabled(FeatureToggles.AND_15767_NEW_TX_HISTORY_ENABLED)
|
||||
}
|
||||
|
|
@ -49,7 +49,6 @@ import com.tangem.feature.walletsettings.utils.AccountItemsDelegate
|
|||
import com.tangem.feature.walletsettings.utils.AccountListSortingSaver
|
||||
import com.tangem.feature.walletsettings.utils.ItemsBuilder
|
||||
import com.tangem.feature.walletsettings.utils.WalletCardItemDelegate
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.features.pushnotifications.api.analytics.PushNotificationAnalyticEvents
|
||||
import com.tangem.features.pushnotificationsettings.PushNotificationSettingsFeatureToggles
|
||||
import com.tangem.hot.sdk.model.HotWalletId
|
||||
|
|
@ -92,7 +91,6 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
private val singleAccountListSupplier: SingleAccountListSupplier,
|
||||
private val accountListSortingSaver: AccountListSortingSaver,
|
||||
private val startAssetsDiscoveryUseCase: StartAssetsDiscoveryUseCase,
|
||||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
private val pushNotificationSettingsFeatureToggles: PushNotificationSettingsFeatureToggles,
|
||||
) : Model() {
|
||||
|
||||
|
|
@ -266,7 +264,7 @@ internal class WalletSettingsModel @Inject constructor(
|
|||
val userWallet = getUserWalletUseCase(params.userWalletId)
|
||||
.getOrNull()
|
||||
|
||||
if (userWallet is UserWallet.Hot && hotWalletFeatureToggles.isAssetsDiscoveryEnabled) {
|
||||
if (userWallet is UserWallet.Hot) {
|
||||
startAssetsDiscoveryUseCase.cancel(params.userWalletId)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,5 @@ package com.tangem.features.wallet.featuretoggles
|
|||
*/
|
||||
interface WalletFeatureToggles {
|
||||
|
||||
val isAddFundsStage1Enabled: Boolean
|
||||
|
||||
val isManageFundsEnabled: Boolean
|
||||
}
|
||||
|
|
@ -64,7 +64,6 @@ import com.tangem.feature.wallet.presentation.wallet.ui.components.visa.KycRejec
|
|||
import com.tangem.feature.wallet.presentation.wallet.utils.ScreenLifecycleProvider
|
||||
import com.tangem.features.addressbook.AddressBookFeatureToggles
|
||||
import com.tangem.features.biometry.AskBiometryComponent
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.features.pushnotifications.api.PushNotificationsModelCallbacks
|
||||
import com.tangem.features.pushnotificationsettings.PushNotificationSettingsFeatureToggles
|
||||
import com.tangem.features.wallet.deeplink.WalletDeepLinkActionListener
|
||||
|
|
@ -126,7 +125,6 @@ internal class WalletModel @Inject constructor(
|
|||
private val resolveQrSendTargetsUseCase: ResolveQrSendTargetsUseCase,
|
||||
private val paymentAccountStatusFetcher: PaymentAccountStatusFetcher,
|
||||
private val uiMessageSender: UiMessageSender,
|
||||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
private val walletFeatureToggles: WalletFeatureToggles,
|
||||
private val pushNotificationSettingsFeatureToggles: PushNotificationSettingsFeatureToggles,
|
||||
private val addressBookFeatureToggles: AddressBookFeatureToggles,
|
||||
|
|
@ -579,7 +577,6 @@ internal class WalletModel @Inject constructor(
|
|||
clickIntents = clickIntents,
|
||||
walletImageResolver = walletImageResolver,
|
||||
getWalletIconUseCase = getWalletIconUseCase,
|
||||
isAddFundsStage1Enabled = walletFeatureToggles.isAddFundsStage1Enabled,
|
||||
isManageFundsEnabled = walletFeatureToggles.isManageFundsEnabled,
|
||||
),
|
||||
)
|
||||
|
|
@ -627,7 +624,6 @@ internal class WalletModel @Inject constructor(
|
|||
clickIntents = clickIntents,
|
||||
walletImageResolver = walletImageResolver,
|
||||
getWalletIconUseCase = getWalletIconUseCase,
|
||||
isAddFundsStage1Enabled = walletFeatureToggles.isAddFundsStage1Enabled,
|
||||
isManageFundsEnabled = walletFeatureToggles.isManageFundsEnabled,
|
||||
),
|
||||
)
|
||||
|
|
@ -650,7 +646,6 @@ internal class WalletModel @Inject constructor(
|
|||
clickIntents = clickIntents,
|
||||
walletImageResolver = walletImageResolver,
|
||||
getWalletIconUseCase = getWalletIconUseCase,
|
||||
isAddFundsStage1Enabled = walletFeatureToggles.isAddFundsStage1Enabled,
|
||||
isManageFundsEnabled = walletFeatureToggles.isManageFundsEnabled,
|
||||
),
|
||||
)
|
||||
|
|
@ -668,7 +663,6 @@ internal class WalletModel @Inject constructor(
|
|||
clickIntents = clickIntents,
|
||||
walletImageResolver = walletImageResolver,
|
||||
getWalletIconUseCase = getWalletIconUseCase,
|
||||
isAddFundsStage1Enabled = walletFeatureToggles.isAddFundsStage1Enabled,
|
||||
isManageFundsEnabled = walletFeatureToggles.isManageFundsEnabled,
|
||||
),
|
||||
)
|
||||
|
|
@ -731,7 +725,6 @@ internal class WalletModel @Inject constructor(
|
|||
clickIntents = clickIntents,
|
||||
walletImageResolver = walletImageResolver,
|
||||
getWalletIconUseCase = getWalletIconUseCase,
|
||||
isAddFundsStage1Enabled = walletFeatureToggles.isAddFundsStage1Enabled,
|
||||
isManageFundsEnabled = walletFeatureToggles.isManageFundsEnabled,
|
||||
),
|
||||
)
|
||||
|
|
@ -888,9 +881,7 @@ internal class WalletModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun applyPendingAssetsDiscovery() {
|
||||
if (hotWalletFeatureToggles.isAssetsDiscoveryEnabled) {
|
||||
startAssetsDiscoveryUseCase.applyPendingAssetsDiscovery()
|
||||
}
|
||||
startAssetsDiscoveryUseCase.applyPendingAssetsDiscovery()
|
||||
}
|
||||
|
||||
private fun syncAddressBooksIfNeeded() {
|
||||
|
|
|
|||
|
|
@ -9,9 +9,6 @@ internal class DefaultWalletFeatureToggles @Inject constructor(
|
|||
private val featureToggles: FeatureTogglesManager,
|
||||
) : WalletFeatureToggles {
|
||||
|
||||
override val isAddFundsStage1Enabled: Boolean
|
||||
get() = featureToggles.isFeatureEnabled(FeatureToggles.AND_15310_ADD_FUNDS_STAGE1)
|
||||
|
||||
override val isManageFundsEnabled: Boolean
|
||||
get() = featureToggles.isFeatureEnabled(FeatureToggles.TWI_1377_MANAGE_FUNDS)
|
||||
}
|
||||
|
|
@ -37,8 +37,6 @@ import com.tangem.feature.wallet.child.wallet.model.intents.WalletClickIntents
|
|||
import com.tangem.feature.wallet.impl.R
|
||||
import com.tangem.feature.wallet.presentation.account.AccountDependencies
|
||||
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotification
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.features.wallet.featuretoggles.WalletFeatureToggles
|
||||
import com.tangem.hot.sdk.model.HotWalletId
|
||||
import com.tangem.lib.crypto.BlockchainUtils
|
||||
import com.tangem.utils.annotations.RemoveWithToggle
|
||||
|
|
@ -66,11 +64,9 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
|
|||
private val getUpgradeBannerClosureTimestampUseCase: GetUpgradeBannerClosureTimestampUseCase,
|
||||
private val checkHotWalletUpgradeBannerUseCase: CheckHotWalletUpgradeBannerUseCase,
|
||||
private val observeAssetsDiscoveryUseCase: ObserveAssetsDiscoveryUseCase,
|
||||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
private val shouldShowYieldBoostMainBannerUseCase: ShouldShowYieldBoostMainBannerUseCase,
|
||||
private val yieldSupplyGetShouldShowMainPromoUseCase: YieldSupplyGetShouldShowMainPromoUseCase,
|
||||
private val designFeatureToggles: DesignFeatureToggles,
|
||||
private val walletFeatureToggles: WalletFeatureToggles,
|
||||
) {
|
||||
|
||||
@Suppress("UNCHECKED_CAST", "MagicNumber", "LongMethod", "CastNullableToNonNullableType")
|
||||
|
|
@ -80,7 +76,7 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
|
|||
val accountStatusListFlow = accountDependencies.singleAccountStatusListSupplier(params)
|
||||
|
||||
val assetsDiscoveryProgressFlow =
|
||||
if (hotWalletFeatureToggles.isAssetsDiscoveryEnabled && userWallet is UserWallet.Hot) {
|
||||
if (userWallet is UserWallet.Hot) {
|
||||
observeAssetsDiscoveryUseCase(userWallet.walletId).distinctUntilChanged()
|
||||
} else {
|
||||
flowOf(AssetsDiscoveryProgress.Idle)
|
||||
|
|
@ -256,7 +252,6 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
|
|||
}
|
||||
|
||||
private fun isAddFundsBannerVisible(totalFiatBalance: TotalFiatBalance): Boolean {
|
||||
if (!walletFeatureToggles.isAddFundsStage1Enabled) return false
|
||||
val loaded = totalFiatBalance as? TotalFiatBalance.Loaded ?: return false
|
||||
return loaded.amount.orZero().signum() == 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import com.tangem.feature.wallet.child.wallet.model.intents.WalletClickIntents
|
|||
import com.tangem.feature.wallet.impl.R
|
||||
import com.tangem.feature.wallet.presentation.account.AccountDependencies
|
||||
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotificationUM
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.hot.sdk.model.HotWalletId
|
||||
import com.tangem.lib.crypto.BlockchainUtils
|
||||
import com.tangem.utils.extensions.addIf
|
||||
|
|
@ -50,7 +49,6 @@ internal class GetWalletNotificationsFactory @Inject constructor(
|
|||
private val getAccessCodeSkippedUseCase: GetAccessCodeSkippedUseCase,
|
||||
private val hasSingleWalletSignedHashesUseCase: HasSingleWalletSignedHashesUseCase,
|
||||
private val observeAssetsDiscoveryUseCase: ObserveAssetsDiscoveryUseCase,
|
||||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
) {
|
||||
fun create(userWallet: UserWallet, clickIntents: WalletClickIntents): Flow<ImmutableList<WalletNotificationUM>> {
|
||||
val cardTypesResolver = (userWallet as? UserWallet.Cold)?.scanResponse?.cardTypesResolver
|
||||
|
|
@ -59,7 +57,7 @@ internal class GetWalletNotificationsFactory @Inject constructor(
|
|||
val accountStatusListFlow = accountDependencies.singleAccountStatusListSupplier(params)
|
||||
|
||||
val assetsDiscoveryProgressFlow =
|
||||
if (hotWalletFeatureToggles.isAssetsDiscoveryEnabled && userWallet is UserWallet.Hot) {
|
||||
if (userWallet is UserWallet.Hot) {
|
||||
observeAssetsDiscoveryUseCase(userWallet.walletId).distinctUntilChanged()
|
||||
} else {
|
||||
flowOf(AssetsDiscoveryProgress.Idle)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.tangem.feature.wallet.presentation.wallet.loaders.implementors
|
|||
import com.tangem.core.ui.DesignFeatureToggles
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.feature.wallet.presentation.wallet.subscribers.*
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
|
|
@ -21,7 +20,6 @@ internal class MultiWalletContentLoader @AssistedInject constructor(
|
|||
private val assetsDiscoverySubscriberFactory: AssetsDiscoverySubscriber.Factory,
|
||||
private val tokenListAnalyticsSubscriberFactory: TokenListAnalyticsSubscriber.Factory,
|
||||
private val designFeatureToggles: DesignFeatureToggles,
|
||||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
) : WalletContentLoader(id = userWallet.walletId) {
|
||||
|
||||
override fun create(): List<WalletSubscriber> = listOfNotNull(
|
||||
|
|
@ -36,7 +34,7 @@ internal class MultiWalletContentLoader @AssistedInject constructor(
|
|||
multiWalletActionButtonsSubscriberFactory.create(userWallet),
|
||||
tangemPayMainSubscriberFactory.create(userWallet),
|
||||
tokenListAnalyticsSubscriberFactory.create(userWallet),
|
||||
if (hotWalletFeatureToggles.isAssetsDiscoveryEnabled && userWallet is UserWallet.Hot) {
|
||||
if (userWallet is UserWallet.Hot) {
|
||||
assetsDiscoverySubscriberFactory.create(userWallet)
|
||||
} else {
|
||||
null
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ internal class AddWalletTransformer(
|
|||
private val clickIntents: WalletClickIntents,
|
||||
private val walletImageResolver: WalletImageResolver,
|
||||
private val getWalletIconUseCase: GetWalletIconUseCase,
|
||||
private val isAddFundsStage1Enabled: Boolean,
|
||||
private val isManageFundsEnabled: Boolean,
|
||||
) : WalletScreenStateTransformer {
|
||||
|
||||
|
|
@ -22,7 +21,6 @@ internal class AddWalletTransformer(
|
|||
clickIntents = clickIntents,
|
||||
walletImageResolver = walletImageResolver,
|
||||
getWalletIconUseCase = getWalletIconUseCase,
|
||||
isAddFundsStage1Enabled = isAddFundsStage1Enabled,
|
||||
isManageFundsEnabled = isManageFundsEnabled,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ internal class InitializeWalletsTransformer(
|
|||
private val clickIntents: WalletClickIntents,
|
||||
private val walletImageResolver: WalletImageResolver,
|
||||
private val getWalletIconUseCase: GetWalletIconUseCase,
|
||||
private val isAddFundsStage1Enabled: Boolean,
|
||||
private val isManageFundsEnabled: Boolean,
|
||||
) : WalletScreenStateTransformer {
|
||||
|
||||
|
|
@ -37,7 +36,6 @@ internal class InitializeWalletsTransformer(
|
|||
clickIntents = clickIntents,
|
||||
walletImageResolver = walletImageResolver,
|
||||
getWalletIconUseCase = getWalletIconUseCase,
|
||||
isAddFundsStage1Enabled = isAddFundsStage1Enabled,
|
||||
isManageFundsEnabled = isManageFundsEnabled,
|
||||
)
|
||||
}
|
||||
|
|
@ -152,15 +150,11 @@ internal class InitializeWalletsTransformer(
|
|||
userWallet.scanResponse.cardTypesResolver.isSingleWalletWithToken()
|
||||
if (isSingleWalletWithToken) return persistentListOf()
|
||||
|
||||
val firstButton = if (isAddFundsStage1Enabled) {
|
||||
WalletManageButton.AddFunds(
|
||||
enabled = false,
|
||||
dimContent = false,
|
||||
onClick = {},
|
||||
)
|
||||
} else {
|
||||
WalletManageButton.Buy(enabled = false, dimContent = false, onClick = {})
|
||||
}
|
||||
val firstButton = WalletManageButton.AddFunds(
|
||||
enabled = false,
|
||||
dimContent = false,
|
||||
onClick = {},
|
||||
)
|
||||
|
||||
val lastButton = if (isManageFundsEnabled) {
|
||||
WalletManageButton.Transfer(enabled = false, dimContent = false, onClick = {})
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ internal class ReinitializeNewWalletTransformer(
|
|||
private val clickIntents: WalletClickIntents,
|
||||
private val walletImageResolver: WalletImageResolver,
|
||||
private val getWalletIconUseCase: GetWalletIconUseCase,
|
||||
private val isAddFundsStage1Enabled: Boolean,
|
||||
private val isManageFundsEnabled: Boolean,
|
||||
) : WalletScreenStateTransformer {
|
||||
|
||||
|
|
@ -34,7 +33,6 @@ internal class ReinitializeNewWalletTransformer(
|
|||
clickIntents = clickIntents,
|
||||
walletImageResolver = walletImageResolver,
|
||||
getWalletIconUseCase = getWalletIconUseCase,
|
||||
isAddFundsStage1Enabled = isAddFundsStage1Enabled,
|
||||
isManageFundsEnabled = isManageFundsEnabled,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ internal class ReinitializeWalletTransformer(
|
|||
private val clickIntents: WalletClickIntents,
|
||||
private val walletImageResolver: WalletImageResolver,
|
||||
private val getWalletIconUseCase: GetWalletIconUseCase,
|
||||
private val isAddFundsStage1Enabled: Boolean,
|
||||
private val isManageFundsEnabled: Boolean,
|
||||
) : WalletStateTransformer(userWalletId = userWallet.walletId) {
|
||||
|
||||
|
|
@ -29,7 +28,6 @@ internal class ReinitializeWalletTransformer(
|
|||
clickIntents = clickIntents,
|
||||
walletImageResolver = walletImageResolver,
|
||||
getWalletIconUseCase = getWalletIconUseCase,
|
||||
isAddFundsStage1Enabled = isAddFundsStage1Enabled,
|
||||
isManageFundsEnabled = isManageFundsEnabled,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ internal class UnlockWalletTransformer(
|
|||
private val clickIntents: WalletClickIntents,
|
||||
private val walletImageResolver: WalletImageResolver,
|
||||
private val getWalletIconUseCase: GetWalletIconUseCase,
|
||||
private val isAddFundsStage1Enabled: Boolean,
|
||||
private val isManageFundsEnabled: Boolean,
|
||||
) : WalletScreenStateTransformer {
|
||||
|
||||
|
|
@ -27,7 +26,6 @@ internal class UnlockWalletTransformer(
|
|||
clickIntents = clickIntents,
|
||||
walletImageResolver = walletImageResolver,
|
||||
getWalletIconUseCase = getWalletIconUseCase,
|
||||
isAddFundsStage1Enabled = isAddFundsStage1Enabled,
|
||||
isManageFundsEnabled = isManageFundsEnabled,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.tangem.feature.wallet.presentation.wallet.state.utils
|
||||
|
||||
import com.tangem.common.ui.userwallet.converter.WalletIconUMConverter
|
||||
import com.tangem.core.analytics.models.event.MainScreenAnalyticsEvent.Companion.WALLET_TYPE
|
||||
import com.tangem.core.ui.components.containers.pullToRefresh.PullToRefreshConfig
|
||||
import com.tangem.core.ui.components.marketprice.MarketPriceBlockState
|
||||
import com.tangem.core.ui.components.transactions.state.TxHistoryState
|
||||
|
|
@ -35,7 +34,6 @@ internal class WalletLoadingStateFactory(
|
|||
private val clickIntents: WalletClickIntents,
|
||||
private val walletImageResolver: WalletImageResolver,
|
||||
private val getWalletIconUseCase: GetWalletIconUseCase,
|
||||
private val isAddFundsStage1Enabled: Boolean,
|
||||
private val isManageFundsEnabled: Boolean,
|
||||
) {
|
||||
|
||||
|
|
@ -153,24 +151,11 @@ internal class WalletLoadingStateFactory(
|
|||
userWallet is UserWallet.Cold && userWallet.scanResponse.cardTypesResolver.isSingleWalletWithToken()
|
||||
if (isSingleWalletWithToken) return persistentListOf()
|
||||
|
||||
val firstButton = if (isAddFundsStage1Enabled) {
|
||||
WalletManageButton.AddFunds(
|
||||
enabled = true,
|
||||
dimContent = false,
|
||||
onClick = { clickIntents.onAddFundsClick(userWallet.walletId) },
|
||||
)
|
||||
} else {
|
||||
WalletManageButton.Buy(
|
||||
enabled = true,
|
||||
dimContent = false,
|
||||
onClick = {
|
||||
clickIntents.onMultiWalletBuyClick(
|
||||
userWalletId = userWallet.walletId,
|
||||
WALLET_TYPE,
|
||||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
val firstButton = WalletManageButton.AddFunds(
|
||||
enabled = true,
|
||||
dimContent = false,
|
||||
onClick = { clickIntents.onAddFundsClick(userWallet.walletId) },
|
||||
)
|
||||
|
||||
val lastButton = if (isManageFundsEnabled) {
|
||||
WalletManageButton.Transfer(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue