Updated on 2026-08-14
This commit is contained in:
parent
22a32ec8f1
commit
99cdc003c8
16 changed files with 156 additions and 121 deletions
|
|
@ -628,14 +628,14 @@ internal class SendConfirmModel @Inject constructor(
|
|||
|
||||
private fun updateAmountSubtractAvailability() {
|
||||
modelScope.launch {
|
||||
val isGaslessEthTx =
|
||||
feeUMV2?.feeExtraInfo?.transactionFeeExtended?.transactionFee?.normal is Fee.Ethereum.TokenCurrency
|
||||
isAmountSubtractAvailable =
|
||||
isAmountSubtractAvailableUseCase(
|
||||
userWalletId = userWallet.walletId,
|
||||
currency = cryptoCurrency,
|
||||
isGaslessEthTx = isGaslessEthTx,
|
||||
).getOrElse { false }
|
||||
val fee = feeUMV2?.feeExtraInfo?.transactionFeeExtended?.transactionFee?.normal
|
||||
// we assume if feeExtraInfo is empty then pay fee in the main currency
|
||||
val feeTokenId = feeUMV2?.feeExtraInfo?.transactionFeeExtended?.feeTokenId ?: cryptoCurrency.id
|
||||
isAmountSubtractAvailable = isAmountSubtractAvailableUseCase(
|
||||
userWalletId = userWallet.walletId,
|
||||
currency = cryptoCurrency,
|
||||
maybeGaslessFee = fee?.let { feeTokenId to fee },
|
||||
).getOrElse { false }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,10 +106,12 @@ internal class NotificationsModel @Inject constructor(
|
|||
}
|
||||
|
||||
private suspend fun checkIfSubtractAvailable() {
|
||||
val feeCurrencyId = notificationData.feeCryptoCurrencyStatus.currency.id
|
||||
val fee = notificationData.fee
|
||||
isAmountSubtractAvailable = isAmountSubtractAvailableUseCase(
|
||||
userWalletId = userWalletId,
|
||||
currency = currency,
|
||||
isGaslessEthTx = notificationData.fee is Fee.Ethereum.TokenCurrency,
|
||||
maybeGaslessFee = fee?.let { feeCurrencyId to fee },
|
||||
).getOrElse { false }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue