From ad0f9678d7d5378ad243e3b5f95ad7d1a0e1b5ea Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 9 Apr 2025 11:08:28 +0500 Subject: [PATCH 1/4] Updated on 2026-08-14 --- .../usecase/ValidateWalletAddressUseCase.kt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/ValidateWalletAddressUseCase.kt b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/ValidateWalletAddressUseCase.kt index c5a93fdc80..026dca2e67 100644 --- a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/ValidateWalletAddressUseCase.kt +++ b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/ValidateWalletAddressUseCase.kt @@ -26,15 +26,14 @@ class ValidateWalletAddressUseCase( address: String, currencyAddress: Set?, ): AddressValidationResult { + val decodedXAddress = BlockchainUtils.decodeRippleXAddress(address, network.id.value) val isUtxoConsolidationAvailable = walletManagersFacade.checkUtxoConsolidationAvailability(userWalletId, network) - val isCurrentAddress = currencyAddress?.any { it.value == address } ?: true + + val addressToValidate = decodedXAddress?.address ?: address + val isCurrentAddress = currencyAddress?.any { it.value == addressToValidate } ?: true val isForbidSelfSend = isCurrentAddress && !isUtxoConsolidationAvailable - - val decodedXAddress = BlockchainUtils.decodeRippleXAddress(address, network.id.value) - val addressToValidate = decodedXAddress?.address ?: address - val isValidAddress = walletAddressServiceRepository.validateAddress(userWalletId, network, addressToValidate) return when { @@ -51,15 +50,14 @@ class ValidateWalletAddressUseCase( address: String, senderAddresses: List, ): AddressValidationResult { + val decodedXAddress = BlockchainUtils.decodeRippleXAddress(address, network.id.value) val isUtxoConsolidationAvailable = walletManagersFacade.checkUtxoConsolidationAvailability(userWalletId, network) - val isCurrentAddress = senderAddresses.any { it.address == address } + + val addressToValidate = decodedXAddress?.address ?: address + val isCurrentAddress = senderAddresses.any { it.address == addressToValidate } val isForbidSelfSend = isCurrentAddress && !isUtxoConsolidationAvailable - - val decodedXAddress = BlockchainUtils.decodeRippleXAddress(address, network.id.value) - val addressToValidate = decodedXAddress?.address ?: address - val isValidAddress = walletAddressServiceRepository.validateAddress(userWalletId, network, addressToValidate) return when { From 8fef5574249de3b49f2cdf08c8c2d60f9b05a8c4 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 9 Apr 2025 11:08:51 +0500 Subject: [PATCH 2/4] Updated on 2026-08-14 --- .../v2/subcomponents/amount/SendAmountComponentParams.kt | 5 +++-- .../send/v2/subcomponents/amount/model/SendAmountModel.kt | 5 +---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt index 7185402604..0df4012c9d 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt @@ -16,6 +16,7 @@ internal sealed class SendAmountComponentParams { abstract val userWallet: UserWallet abstract val appCurrency: AppCurrency abstract val cryptoCurrencyStatus: CryptoCurrencyStatus + abstract val predefinedAmountValue: String? data class AmountParams( override val state: AmountState, @@ -23,10 +24,10 @@ internal sealed class SendAmountComponentParams { override val userWallet: UserWallet, override val appCurrency: AppCurrency, override val cryptoCurrencyStatus: CryptoCurrencyStatus, + override val predefinedAmountValue: String?, val isEditMode: Boolean, val callback: ModelCallback, val currentRoute: Flow, - val predefinedAmountValue: String?, val isBalanceHidingFlow: StateFlow, ) : SendAmountComponentParams() @@ -36,8 +37,8 @@ internal sealed class SendAmountComponentParams { override val userWallet: UserWallet, override val appCurrency: AppCurrency, override val cryptoCurrencyStatus: CryptoCurrencyStatus, + override val predefinedAmountValue: String?, val blockClickEnableFlow: StateFlow, - val predefinedAmountValue: String?, val isPredefinedValues: Boolean, ) : SendAmountComponentParams() } \ No newline at end of file diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt index 5f37e5f84f..40b5688362 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt @@ -98,10 +98,7 @@ internal class SendAmountModel @Inject constructor( ), ) } - val params = params as? SendAmountComponentParams.AmountBlockParams - if (params?.predefinedAmountValue != null) { - onAmountValueChange(params.predefinedAmountValue) - } + params.predefinedAmountValue?.let(::onAmountValueChange) } } From 98ba7092e3627ba2f77f9b2edb1d7abea404f2e1 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 9 Apr 2025 11:09:23 +0500 Subject: [PATCH 3/4] Updated on 2026-08-14 --- .../ui/notifications/NotificationsFactory.kt | 9 ++++----- .../send/v2/send/confirm/SendConfirmComponent.kt | 1 + .../v2/send/confirm/model/SendConfirmModel.kt | 3 +++ .../notifications/NotificationsComponent.kt | 1 + .../notifications/model/NotificationData.kt | 1 + .../notifications/model/NotificationsModel.kt | 16 ++++++++++++---- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt b/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt index 55ee3a6906..008a2665bd 100644 --- a/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt +++ b/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt @@ -4,7 +4,6 @@ import com.tangem.blockchain.common.BlockchainSdkError import com.tangem.common.ui.R import com.tangem.common.ui.amountScreen.models.AmountFieldModel import com.tangem.common.ui.amountScreen.utils.getFiatString -import com.tangem.common.ui.notifications.NotificationsFactory.addRequireDestinationFlagErrorNotification import com.tangem.core.ui.extensions.networkIconResId import com.tangem.core.ui.format.bigdecimal.crypto import com.tangem.core.ui.format.bigdecimal.format @@ -115,10 +114,6 @@ object NotificationsFactory { } } - fun MutableList.addRequireDestinationFlagErrorNotification() { - add(NotificationUM.Error.DestinationMemoRequired) - } - fun MutableList.addMinimumAmountErrorNotification( minimumSendAmount: BigDecimal?, sendingAmount: BigDecimal, @@ -516,4 +511,8 @@ object NotificationsFactory { is CryptoCurrency.Token -> isChangeLowerThanDust } } + + private fun MutableList.addRequireDestinationFlagErrorNotification() { + add(NotificationUM.Error.DestinationMemoRequired) + } } \ No newline at end of file diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/SendConfirmComponent.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/SendConfirmComponent.kt index 3ed30ca608..ff6ba04840 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/SendConfirmComponent.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/SendConfirmComponent.kt @@ -94,6 +94,7 @@ internal class SendConfirmComponent( feeCryptoCurrencyStatus = params.feeCryptoCurrencyStatus, appCurrency = params.appCurrency, destinationAddress = model.enteredDestination.orEmpty(), + memo = model.enteredMemo, amountValue = model.enteredAmount.orZero(), reduceAmountBy = model.reduceAmountBy.orZero(), isIgnoreReduce = model.isIgnoreReduce, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/model/SendConfirmModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/model/SendConfirmModel.kt index 7e089f9d66..e09a1175f2 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/model/SendConfirmModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/model/SendConfirmModel.kt @@ -131,6 +131,8 @@ internal class SendConfirmModel @Inject constructor( get() = amountState?.isIgnoreReduce == true val enteredDestination: String? get() = destinationUM?.addressTextField?.value + val enteredMemo: String? + get() = destinationUM?.memoTextField?.value val fee: Fee? get() = feeSelectorUM?.selectedFee val feeError: GetFeeError? @@ -459,6 +461,7 @@ internal class SendConfirmModel @Inject constructor( notificationsUpdateTrigger.triggerUpdate( data = NotificationData( destinationAddress = enteredDestination.orEmpty(), + memo = enteredMemo, amountValue = enteredAmount.orZero(), reduceAmountBy = reduceAmountBy.orZero(), isIgnoreReduce = isIgnoreReduce, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/NotificationsComponent.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/NotificationsComponent.kt index a7a941c816..14760575ab 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/NotificationsComponent.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/NotificationsComponent.kt @@ -46,6 +46,7 @@ internal class NotificationsComponent( val feeCryptoCurrencyStatus: CryptoCurrencyStatus, val appCurrency: AppCurrency, val destinationAddress: String, + val memo: String?, val amountValue: BigDecimal, val reduceAmountBy: BigDecimal, val isIgnoreReduce: Boolean, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationData.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationData.kt index adf6dc6e5f..bf7e440869 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationData.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationData.kt @@ -6,6 +6,7 @@ import java.math.BigDecimal data class NotificationData( val destinationAddress: String, + val memo: String?, val amountValue: BigDecimal, val reduceAmountBy: BigDecimal, val isIgnoreReduce: Boolean, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt index 9ff6f21955..b27fefd5e3 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt @@ -79,6 +79,7 @@ internal class NotificationsModel @Inject constructor( private val appCurrency = params.appCurrency private var destinationAddress = params.destinationAddress + private var memo = params.memo private var amountValue = params.amountValue private var reduceAmountBy = params.reduceAmountBy private var isIgnoreReduce = params.isIgnoreReduce @@ -110,6 +111,7 @@ internal class NotificationsModel @Inject constructor( private suspend fun updateState(data: NotificationData) { destinationAddress = data.destinationAddress + memo = data.memo amountValue = data.amountValue reduceAmountBy = data.reduceAmountBy isIgnoreReduce = data.isIgnoreReduce @@ -134,6 +136,7 @@ internal class NotificationsModel @Inject constructor( ) addDomainNotifications( destinationAddress = destinationAddress, + memo = memo, amountValue = amountValue, reduceAmountBy = reduceAmountBy, fee = fee, @@ -160,6 +163,7 @@ internal class NotificationsModel @Inject constructor( private suspend fun MutableList.addDomainNotifications( destinationAddress: String, + memo: String?, amountValue: BigDecimal, reduceAmountBy: BigDecimal, fee: Fee?, @@ -199,6 +203,8 @@ internal class NotificationsModel @Inject constructor( currencyCheck = currencyCheck, ) addWarningNotifications( + destinationAddress = destinationAddress, + memo = memo, enteredAmount = amountValue, fee = fee, feeValue = feeValue, @@ -288,6 +294,8 @@ internal class NotificationsModel @Inject constructor( } private suspend fun MutableList.addWarningNotifications( + destinationAddress: String, + memo: String?, enteredAmount: BigDecimal, sendingAmount: BigDecimal, fee: Fee?, @@ -297,11 +305,11 @@ internal class NotificationsModel @Inject constructor( ) { val validationError = validateTransactionUseCase( userWalletId = userWalletId, - amount = enteredAmount.convertToSdkAmount(currency), + amount = amountValue.convertToSdkAmount(cryptoCurrencyStatus.currency), fee = fee, - memo = null, - destination = "", - network = currency.network, + memo = memo, + destination = destinationAddress, + network = cryptoCurrencyStatus.currency.network, ).leftOrNull() addRentExemptionNotification( From 1337033fbe5d935f4069f1df24197fc821f6253a Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 9 Apr 2025 07:32:51 +0000 Subject: [PATCH 4/4] Updated on 2026-08-14 --- gradle/tangem_dependencies.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/tangem_dependencies.toml b/gradle/tangem_dependencies.toml index f33bae32b2..e6912e07bc 100644 --- a/gradle/tangem_dependencies.toml +++ b/gradle/tangem_dependencies.toml @@ -1,7 +1,7 @@ [versions] -tangemBlockchainSdk = "releases-5.23-1007" +tangemBlockchainSdk = "develop-1009" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds -tangemCardSdk = "releases-5.23-452" +tangemCardSdk = "develop-451" #tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^ tangemVico = "2.0.0-alpha.25-tangem-developments8" #tangemVico = "0.0.1" # Keep it! - used for local builds ^