Updated on 2026-08-14

This commit is contained in:
Tangem 2024-04-26 15:09:59 +05:00
commit f0696f8b99
2 changed files with 1 additions and 22 deletions

View file

@ -20,7 +20,6 @@ import com.tangem.features.send.impl.presentation.analytics.SendAnalyticEvents
import com.tangem.features.send.impl.presentation.state.*
import com.tangem.features.send.impl.presentation.state.fee.*
import com.tangem.features.send.impl.presentation.viewmodel.SendClickIntents
import com.tangem.lib.crypto.BlockchainUtils.isDogecoin
import com.tangem.lib.crypto.BlockchainUtils.isTezos
import com.tangem.utils.Provider
import kotlinx.collections.immutable.ImmutableList
@ -74,7 +73,6 @@ internal class SendNotificationFactory(
addFeeUnreachableNotification(feeState.feeSelectorState)
addExceedBalanceNotification(feeValue, sendingAmount)
addExceedsBalanceNotification(feeState.fee)
addMinimumAmountErrorNotification(feeValue, sendingAmount)
addDustWarningNotification(feeValue, sendingAmount)
addTransactionLimitErrorNotification(feeValue, sendingAmount)
// warnings
@ -238,21 +236,6 @@ internal class SendNotificationFactory(
}
}
// todo remove in [REDACTED_TASK_KEY]
private fun MutableList<SendNotification>.addMinimumAmountErrorNotification(
feeAmount: BigDecimal,
receivedAmount: BigDecimal,
) {
val coinCryptoCurrencyStatus = coinCryptoCurrencyStatusProvider()
val minimum = BigDecimal(DOGECOIN_MINIMUM)
val isDogecoin = isDogecoin(coinCryptoCurrencyStatus.currency.network.id.value)
val isExceedDustLimit = checkDustLimits(feeAmount, receivedAmount, minimum)
if (isDogecoin && isExceedDustLimit) {
add(SendNotification.Error.MinimumAmountError(DOGECOIN_MINIMUM))
}
}
private suspend fun MutableList<SendNotification>.addDustWarningNotification(
feeAmount: BigDecimal,
receivedAmount: BigDecimal,
@ -380,8 +363,4 @@ internal class SendNotificationFactory(
val isChangeLowerThanDust = change < dustValue && change > BigDecimal.ZERO
return receivedAmount < dustValue || isChangeLowerThanDust
}
companion object {
private const val DOGECOIN_MINIMUM = "0.01"
}
}

View file

@ -85,7 +85,7 @@ leakcanary = "2.13"
# endregion Other libraries
# region Tangem
tangemBlockchainSdk = "release-app_5.9-608"
tangemBlockchainSdk = "release-app_5.9.1-610"
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "release-app_5.9-343"
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^