From 8c3071ed1b08b05ec3c336faa7381d22651dc7ab Mon Sep 17 00:00:00 2001 From: Tangem Date: Sat, 27 Apr 2024 21:32:59 +0500 Subject: [PATCH 1/6] Updated on 2026-08-14 --- .../operations/CurrenciesStatusesOperations.kt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/operations/CurrenciesStatusesOperations.kt b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/operations/CurrenciesStatusesOperations.kt index fac9f7fc95..d12ca4c9ad 100644 --- a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/operations/CurrenciesStatusesOperations.kt +++ b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/operations/CurrenciesStatusesOperations.kt @@ -264,10 +264,18 @@ internal class CurrenciesStatusesOperations( var quotesRetrievingFailed = false val networksStatuses = maybeNetworkStatuses?.bind()?.toNonEmptySetOrNull() - val quotes = recover({ maybeQuotes?.bind()?.toNonEmptySetOrNull() }) { - quotesRetrievingFailed = true - null - } + val quotes: Set? = maybeQuotes?.fold( + ifLeft = { + quotesRetrievingFailed = true + null + }, + ifRight = { + it.ifEmpty { + quotesRetrievingFailed = true + null + } + }, + ) currencies.map { currency -> val quote = quotes?.firstOrNull { it.rawCurrencyId == currency.id.rawCurrencyId } From 390513dc53efc13b8936702347a4fe48b46dfd89 Mon Sep 17 00:00:00 2001 From: Tangem Date: Sat, 27 Apr 2024 21:33:50 +0500 Subject: [PATCH 2/6] Updated on 2026-08-14 --- .../tangem/data/transaction/DefaultTransactionRepository.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt b/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt index 76b16b1409..3fe078eaad 100644 --- a/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt +++ b/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt @@ -71,7 +71,10 @@ internal class DefaultTransactionRepository( } Blockchain.Binance -> BinanceTransactionExtras(memo) Blockchain.XRP -> memo.toLongOrNull()?.let { XrpTransactionBuilder.XrpTransactionExtras(it) } - Blockchain.Cosmos -> CosmosTransactionExtras(memo) + Blockchain.Cosmos, + Blockchain.TerraV1, + Blockchain.TerraV2, + -> CosmosTransactionExtras(memo) Blockchain.TON -> TonTransactionExtras(memo) Blockchain.Hedera -> HederaTransactionBuilder.HederaTransactionExtras(memo) Blockchain.Algorand -> AlgorandTransactionExtras(memo) From 54cc9e6245787948f1847e1ddd8405ee0c267536 Mon Sep 17 00:00:00 2001 From: Tangem Date: Sat, 27 Apr 2024 21:34:59 +0500 Subject: [PATCH 3/6] Updated on 2026-08-14 --- .../presentation/state/confirm/SendNotificationFactory.kt | 5 +++-- .../send/impl/presentation/state/fee/FeeCalculation.kt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt index 1de2ea58fb..74abacad98 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt @@ -71,7 +71,7 @@ internal class SendNotificationFactory( buildList { // errors addFeeUnreachableNotification(feeState.feeSelectorState) - addExceedBalanceNotification(feeValue, sendingAmount) + addExceedBalanceNotification(feeValue, sendingAmount, isFeeCoverage) addExceedsBalanceNotification(feeState.fee) addDustWarningNotification(feeValue, sendingAmount) addTransactionLimitErrorNotification(feeValue, sendingAmount) @@ -107,11 +107,12 @@ internal class SendNotificationFactory( private fun MutableList.addExceedBalanceNotification( feeAmount: BigDecimal, receivedAmount: BigDecimal, + isFeeCoverage: Boolean, ) { val cryptoCurrencyStatus = cryptoCurrencyStatusProvider() val balance = cryptoCurrencyStatus.value.amount ?: BigDecimal.ZERO - if (!isSubtractAvailableProvider()) return + if (isFeeCoverage) return val showNotification = receivedAmount + feeAmount > balance if (showNotification) { diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/fee/FeeCalculation.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/fee/FeeCalculation.kt index 5376e57084..c7f5a024df 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/fee/FeeCalculation.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/fee/FeeCalculation.kt @@ -45,7 +45,7 @@ internal fun checkFeeCoverage( feeValue: BigDecimal, ): Boolean { if (!isSubtractAvailable) return false - return balance < amountValue + feeValue && balance > feeValue + return balance < amountValue + feeValue && balance > feeValue && balance >= amountValue } /** From 31145bbbe77028041537d232324ad969d00a663b Mon Sep 17 00:00:00 2001 From: Tangem Date: Sat, 27 Apr 2024 21:35:25 +0500 Subject: [PATCH 4/6] Updated on 2026-08-14 --- .../tangem/features/send/impl/presentation/state/StateRouter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/StateRouter.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/StateRouter.kt index 5f2201052b..e09467fa9c 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/StateRouter.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/StateRouter.kt @@ -34,7 +34,7 @@ internal class StateRouter( when { isSuccess -> popBackStack() isEditingDisabled -> when (type) { - SendUiStateType.Send -> showFee() + SendUiStateType.EditFee -> showSend() else -> popBackStack() } else -> when (type) { From ab246b2ec618c89af40e3904705a31fb5d861fac Mon Sep 17 00:00:00 2001 From: Tangem Date: Sat, 27 Apr 2024 21:36:47 +0500 Subject: [PATCH 5/6] Updated on 2026-08-14 --- .../features/send/impl/presentation/viewmodel/SendViewModel.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/viewmodel/SendViewModel.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/viewmodel/SendViewModel.kt index 50f368670f..f47a2a6fab 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/viewmodel/SendViewModel.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/viewmodel/SendViewModel.kt @@ -702,6 +702,7 @@ internal class SendViewModel @Inject constructor( val isShowStatus = uiState.feeState?.fee == null if (isShowStatus) { uiState = feeStateFactory.onFeeOnLoadingState() + updateNotifications() } val result = callFeeUseCase()?.fold( ifRight = { From 34cf43fc578f12893ed1a122db52bc993321c486 Mon Sep 17 00:00:00 2001 From: Tangem Date: Sat, 27 Apr 2024 21:37:18 +0500 Subject: [PATCH 6/6] Updated on 2026-08-14 --- .../features/send/impl/presentation/viewmodel/SendViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/viewmodel/SendViewModel.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/viewmodel/SendViewModel.kt index f47a2a6fab..eca7088154 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/viewmodel/SendViewModel.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/viewmodel/SendViewModel.kt @@ -667,7 +667,7 @@ internal class SendViewModel @Inject constructor( private fun autoNextFromRecipient(type: EnterAddressSource?, isValidAddress: Boolean) { val isRecent = type == EnterAddressSource.RecentAddress - if (isRecent && isValidAddress) onNextClick() + if (isRecent && isValidAddress) onNextClick(stateRouter.isEditState) } // endregion