From 00c8254540320c88410a94edecec4a379d0084fa Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 12 Apr 2024 17:17:39 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../presentation/state/confirm/SendNotificationFactory.kt | 7 ++++--- .../com/tangem/feature/swap/domain/SwapInteractorImpl.kt | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt index 6a4e8a383e..fb65e2a8b5 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt @@ -8,6 +8,7 @@ import com.tangem.core.ui.extensions.networkIconResId import com.tangem.core.ui.utils.BigDecimalFormatter import com.tangem.core.ui.utils.parseToBigDecimal import com.tangem.domain.common.extensions.fromNetworkId +import com.tangem.domain.common.extensions.minimalAmount import com.tangem.domain.tokens.GetBalanceNotEnoughForFeeWarningUseCase import com.tangem.domain.tokens.model.CryptoCurrency import com.tangem.domain.tokens.model.CryptoCurrencyStatus @@ -225,13 +226,14 @@ internal class SendNotificationFactory( val cryptoCurrencyStatus = cryptoCurrencyStatusProvider() val balance = cryptoCurrencyStatus.value.amount ?: BigDecimal.ZERO val isTezos = cryptoCurrencyStatus.currency.network.id.value == Blockchain.Tezos.id + val threshold = Blockchain.Tezos.minimalAmount() val isTotalBalance = feeAmount.plus(sendAmount) >= balance if (!ignoreAmountReduce && isTotalBalance && isTezos) { add( SendNotification.Warning.HighFeeError( - amount = TEZOS_FEE_THRESHOLD.toPlainString(), + amount = threshold.toPlainString(), onConfirmClick = { - val reduceTo = sendAmount.minus(TEZOS_FEE_THRESHOLD).toPlainString() + val reduceTo = sendAmount.minus(threshold).toPlainString() clickIntents.onAmountReduceClick(reduceTo, SendNotification.Warning.HighFeeError::class.java) }, onCloseClick = { @@ -372,7 +374,6 @@ internal class SendNotificationFactory( companion object { private const val DOGECOIN_MINIMUM = "0.01" - private val TEZOS_FEE_THRESHOLD = BigDecimal("0.01") internal val FEE_MAX_DIFF = BigInteger("5") } } \ No newline at end of file diff --git a/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt b/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt index 966b619bf8..0b77da443d 100644 --- a/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt +++ b/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt @@ -10,6 +10,7 @@ import com.tangem.blockchain.common.transaction.TransactionFee import com.tangem.domain.appcurrency.GetSelectedAppCurrencyUseCase import com.tangem.domain.appcurrency.extenstions.unwrap import com.tangem.domain.appcurrency.repository.AppCurrencyRepository +import com.tangem.domain.common.extensions.minimalAmount import com.tangem.domain.tokens.GetCryptoCurrencyStatusesSyncUseCase import com.tangem.domain.tokens.model.CryptoCurrency import com.tangem.domain.tokens.model.CryptoCurrencyStatus @@ -433,7 +434,7 @@ internal class SwapInteractorImpl @Inject constructor( ) { val isTezos = fromTokenStatus.currency.network.id.value == Blockchain.Tezos.id if (isTezos && amount.value == fromTokenStatus.value.amount) { - warnings.add(Warning.ReduceAmountWarning(TEZOS_FEE_THRESHOLD)) + warnings.add(Warning.ReduceAmountWarning(Blockchain.Tezos.minimalAmount())) } } @@ -1595,6 +1596,5 @@ internal class SwapInteractorImpl @Inject constructor( private const val INCREASE_GAS_LIMIT_BY = 112 // 12% private const val INCREASE_GAS_LIMIT_FOR_SEND = 105 // 5% private const val INFINITY_SYMBOL = "∞" - private val TEZOS_FEE_THRESHOLD = BigDecimal("0.01") } } \ No newline at end of file