Updated on 2026-08-14

This commit is contained in:
Tangem 2024-05-15 18:07:42 +08:00
parent 7e79305db7
commit 55942f2208
13 changed files with 281 additions and 71 deletions

View file

@ -435,8 +435,6 @@ internal class SendNotificationFactory(
addCardanoTransactionValidationError(
error = it as? BlockchainSdkError.Cardano ?: return@fold,
sendingCurrency = sendingCurrency,
sendingAmount = sendingAmount,
fee = fee,
)
},
ifRight = {
@ -455,8 +453,6 @@ internal class SendNotificationFactory(
private suspend fun MutableList<SendNotification>.addCardanoTransactionValidationError(
error: BlockchainSdkError.Cardano,
sendingCurrency: CryptoCurrency,
sendingAmount: BigDecimal,
fee: Fee,
) {
when (error) {
BlockchainSdkError.Cardano.InsufficientMinAdaBalanceToSendToken -> {
@ -473,9 +469,15 @@ internal class SendNotificationFactory(
BlockchainSdkError.Cardano.InsufficientRemainingBalance,
BlockchainSdkError.Cardano.InsufficientSendingAdaAmount,
-> {
addDustWarningNotification(
feeValue = fee.amount.value ?: BigDecimal.ZERO,
sendingAmount = sendingAmount,
val dustValue = currencyChecksRepository.getDustValue(
userWalletId = userWalletProvider().walletId,
network = sendingCurrency.network,
) ?: return
add(
SendNotification.Error.MinimumAmountError(
amount = dustValue.parseBigDecimal(sendingCurrency.decimals),
),
)
}
}