Updated on 2026-08-14

This commit is contained in:
Tangem 2026-02-27 15:59:01 +03:00
commit a70c0ae57f
731 changed files with 17726 additions and 23716 deletions

View file

@ -1,7 +0,0 @@
package com.tangem.features.yield.supply.api
interface YieldSupplyFeatureToggles {
val isYieldSupplyFeatureEnabled: Boolean
val isYieldSupplyPendingTransactionsEnabled: Boolean
}

View file

@ -1,14 +0,0 @@
package com.tangem.features.yield.supply.impl
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
internal class DefaultYieldSupplyFeatureToggles(
private val featureToggles: FeatureTogglesManager,
) : YieldSupplyFeatureToggles {
override val isYieldSupplyFeatureEnabled: Boolean
get() = featureToggles.isFeatureEnabled("YIELD_SUPPLY_FEATURE_ENABLED")
override val isYieldSupplyPendingTransactionsEnabled: Boolean
get() = featureToggles.isFeatureEnabled("YIELD_SUPPLY_PENDING_TRANSACTIONS_ENABLED")
}

View file

@ -1,7 +1,6 @@
package com.tangem.features.yield.supply.impl.common
import com.tangem.common.ui.alerts.TransactionErrorAlertConverter
import com.tangem.common.ui.alerts.models.AlertDemoModeUM
import com.tangem.common.ui.alerts.TransactionErrorDialogFactory
import com.tangem.core.decompose.di.ModelScoped
import com.tangem.core.decompose.ui.UiMessageSender
import com.tangem.core.ui.extensions.resourceReference
@ -24,6 +23,7 @@ class YieldSupplyAlertFactory @Inject constructor(
private val saveBlockchainErrorUseCase: SaveBlockchainErrorUseCase,
private val getWalletMetaInfoUseCase: GetWalletMetaInfoUseCase,
private val sendFeedbackEmailUseCase: SendFeedbackEmailUseCase,
private val transactionErrorDialogFactory: TransactionErrorDialogFactory,
) {
fun getGenericErrorState(onFailedTxEmailClick: () -> Unit, popBack: () -> Unit = {}) {
@ -44,35 +44,17 @@ class YieldSupplyAlertFactory @Inject constructor(
}
fun getSendTransactionErrorState(
error: SendTransactionError?,
error: SendTransactionError,
popBack: () -> Unit,
onFailedTxEmailClick: (String) -> Unit,
) {
val transactionErrorAlertConverter = TransactionErrorAlertConverter(
val errorDialog = transactionErrorDialogFactory.create(
error = error,
popBackStack = popBack,
onFailedTxEmailClick = onFailedTxEmailClick,
)
) ?: return
val errorAlert = error?.let { transactionErrorAlertConverter.convert(error) } ?: return
val onConfirmClick = errorAlert.onConfirmClick ?: return
uiMessageSender.send(
DialogMessage.Companion(
title = errorAlert.title,
message = errorAlert.message,
firstActionBuilder = {
EventMessageAction(
title = errorAlert.confirmButtonText,
onClick = onConfirmClick,
)
},
secondActionBuilder = if (errorAlert !is AlertDemoModeUM) {
{ cancelAction() }
} else {
null
},
),
)
uiMessageSender.send(errorDialog)
}
suspend fun onFailedTxEmailClick(userWallet: UserWallet, cryptoCurrency: CryptoCurrency?, errorMessage: String?) {

View file

@ -1,21 +0,0 @@
package com.tangem.features.yield.supply.impl.di
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
import com.tangem.features.yield.supply.impl.DefaultYieldSupplyFeatureToggles
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@InstallIn(SingletonComponent::class)
@Module
internal object YieldSupplyFeatureModule {
@Singleton
@Provides
fun provideYieldFeatureToggles(featureTogglesManager: FeatureTogglesManager): YieldSupplyFeatureToggles {
return DefaultYieldSupplyFeatureToggles(featureTogglesManager)
}
}