Updated on 2026-08-14
This commit is contained in:
parent
9fe1b22210
commit
e376a88b44
4 changed files with 14 additions and 2 deletions
|
|
@ -112,13 +112,22 @@ object NotificationsFactory {
|
|||
reserveAmount: BigDecimal?,
|
||||
sendingAmount: BigDecimal,
|
||||
cryptoCurrency: CryptoCurrency,
|
||||
feeCryptoCurrency: CryptoCurrency?,
|
||||
isAccountFunded: Boolean,
|
||||
) {
|
||||
if (!isAccountFunded && reserveAmount != null && reserveAmount > sendingAmount) {
|
||||
val sendingCoinAmount = when (cryptoCurrency) {
|
||||
is CryptoCurrency.Coin -> sendingAmount
|
||||
is CryptoCurrency.Token -> BigDecimal.ZERO
|
||||
}
|
||||
|
||||
if (feeCryptoCurrency == null && cryptoCurrency is CryptoCurrency.Token) {
|
||||
// No need to show reserve amount warning if fee currency is unknown for token transfer
|
||||
return
|
||||
} else if (!isAccountFunded && reserveAmount != null && reserveAmount > sendingCoinAmount) {
|
||||
add(
|
||||
NotificationUM.Error.ReserveAmount(
|
||||
reserveAmount.format {
|
||||
crypto(cryptoCurrency)
|
||||
crypto(feeCryptoCurrency ?: cryptoCurrency)
|
||||
},
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -272,6 +272,7 @@ internal class NotificationsModel @Inject constructor(
|
|||
reserveAmount = currencyCheck.reserveAmount,
|
||||
sendingAmount = sendingAmount,
|
||||
cryptoCurrency = currency,
|
||||
feeCryptoCurrency = feeCryptoCurrencyStatus.currency,
|
||||
isAccountFunded = currencyCheck.isAccountFunded,
|
||||
)
|
||||
addMinimumAmountErrorNotification(
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@ internal class AddStakingNotificationsTransformer(
|
|||
reserveAmount = currencyCheck.reserveAmount,
|
||||
sendingAmount = sendingAmount,
|
||||
cryptoCurrency = cryptoCurrency,
|
||||
feeCryptoCurrency = feeCryptoCurrencyStatus?.currency,
|
||||
isAccountFunded = false,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,6 +192,7 @@ internal class SwapNotificationsFactory(
|
|||
reserveAmount = quoteModel.currencyCheck?.reserveAmount,
|
||||
sendingAmount = amountToRequest.value,
|
||||
cryptoCurrency = fromCurrencyStatus.currency,
|
||||
feeCryptoCurrency = feeCryptoCurrencyStatus?.currency,
|
||||
isAccountFunded = false,
|
||||
)
|
||||
addReduceAmountNotification(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue