From e12ec65fec96f21c0dc878486a1f46d891a6296e Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 12 Aug 2025 19:58:22 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../transaction/usecase/ValidateTransactionUseCase.kt | 6 +++--- .../sendviaswap/confirm/SendWithSwapConfirmComponent.kt | 6 +++++- .../sendviaswap/confirm/model/SendWithSwapConfirmModel.kt | 5 ++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/ValidateTransactionUseCase.kt b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/ValidateTransactionUseCase.kt index 7ade9be75d..499e222199 100644 --- a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/ValidateTransactionUseCase.kt +++ b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/ValidateTransactionUseCase.kt @@ -6,8 +6,8 @@ import arrow.core.right import com.tangem.blockchain.common.Amount import com.tangem.blockchain.common.transaction.Fee import com.tangem.domain.models.network.Network -import com.tangem.domain.transaction.TransactionRepository import com.tangem.domain.models.wallet.UserWalletId +import com.tangem.domain.transaction.TransactionRepository class ValidateTransactionUseCase( private val transactionRepository: TransactionRepository, @@ -21,8 +21,8 @@ class ValidateTransactionUseCase( destination: String, userWalletId: UserWalletId, network: Network, - ): Either { - return transactionRepository.validateTransaction( + ): Either = Either.catch { + transactionRepository.validateTransaction( amount = amount, fee = fee, memo = memo, diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt index 94f6d53022..b0cfea80d2 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt @@ -11,6 +11,7 @@ import com.tangem.core.decompose.model.getOrCreateModel import com.tangem.core.navigation.url.UrlOpener import com.tangem.core.ui.decompose.ComposableContentComponent import com.tangem.domain.appcurrency.model.AppCurrency +import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.models.currency.CryptoCurrencyStatus import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.swap.models.SwapDirection @@ -104,7 +105,10 @@ internal class SendWithSwapConfirmComponent @AssistedInject constructor( appCurrency = params.appCurrency, callback = model, notificationData = SendNotificationsComponent.Params.NotificationData( - destinationAddress = model.confirmData.enteredDestination.orEmpty(), + destinationAddress = when (val currency = model.primaryCurrencyStatus.currency) { + is CryptoCurrency.Token -> currency.contractAddress + is CryptoCurrency.Coin -> "0" + }, memo = null, amountValue = model.confirmData.enteredAmount.orZero(), reduceAmountBy = model.confirmData.reduceAmountBy.orZero(), diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt index 5ebe7db905..a5aa42ce31 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt @@ -329,7 +329,10 @@ internal class SendWithSwapConfirmModel @Inject constructor( modelScope.launch { sendNotificationsUpdateTrigger.triggerUpdate( data = NotificationData( - destinationAddress = confirmData.enteredDestination.orEmpty(), + destinationAddress = when (val currency = primaryCurrencyStatus.currency) { + is CryptoCurrency.Token -> currency.contractAddress + is CryptoCurrency.Coin -> "0" + }, memo = null, amountValue = confirmData.enteredAmount.orZero(), reduceAmountBy = confirmData.reduceAmountBy,