From 524e45bb9b7afaf56fe2b780e6169f1c87ec44cb Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 8 Apr 2026 13:02:54 +0300 Subject: [PATCH 1/7] Updated on 2026-08-14 --- .../src/main/assets/configs/feature_toggles_config.json | 4 ++-- gradle/tangem_dependencies.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/config-toggles/src/main/assets/configs/feature_toggles_config.json b/core/config-toggles/src/main/assets/configs/feature_toggles_config.json index d662c63280..be409af3d5 100644 --- a/core/config-toggles/src/main/assets/configs/feature_toggles_config.json +++ b/core/config-toggles/src/main/assets/configs/feature_toggles_config.json @@ -46,7 +46,7 @@ }, { "name": "GASLESS_APPROVAL_ENABLED", - "version": "undefined" + "version": "5.37" }, { "name": "TANGEM_PAY_ACCOUNTS_REFACTOR_ENABLED", @@ -66,7 +66,7 @@ }, { "name": "NEW_PROMO_BANNERS_ENABLED", - "version": "undefined" + "version": "5.37" }, { "name": "VIRTUAL_ACCOUNTS_ENABLED", diff --git a/gradle/tangem_dependencies.toml b/gradle/tangem_dependencies.toml index 165d042410..278d64c66f 100644 --- a/gradle/tangem_dependencies.toml +++ b/gradle/tangem_dependencies.toml @@ -5,9 +5,9 @@ # https://github.com/tangem/tangem-sdk-android/ # https://github.com/tangem/vico -tangemBlockchainSdk = "develop-1482" +tangemBlockchainSdk = "releases-5.37-1485" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds -tangemCardSdk = "develop-602" +tangemCardSdk = "releases-5.37-603" #tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^ tangemVico = "tangem-master-21" #tangemVico = "0.0.1" # Keep it! - used for local builds ^ From 51587a35c6430524979ff0a50c2adfa91c3c8fa2 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 8 Apr 2026 13:40:13 +0300 Subject: [PATCH 2/7] Updated on 2026-08-14 --- .../src/main/assets/configs/feature_toggles_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/config-toggles/src/main/assets/configs/feature_toggles_config.json b/core/config-toggles/src/main/assets/configs/feature_toggles_config.json index be409af3d5..1a45030b37 100644 --- a/core/config-toggles/src/main/assets/configs/feature_toggles_config.json +++ b/core/config-toggles/src/main/assets/configs/feature_toggles_config.json @@ -50,7 +50,7 @@ }, { "name": "TANGEM_PAY_ACCOUNTS_REFACTOR_ENABLED", - "version": "undefined" + "version": "5.37" }, { "name": "DYNAMIC_ADDRESSES_ENABLED", From 47668c308f97412d411b96dddc50a16669b83ae8 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 8 Apr 2026 17:49:40 +0200 Subject: [PATCH 3/7] Updated on 2026-08-14 --- .../add/impl/model/AddToPortfolioPreselectedDataModel.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/components/market/details/portfolio/add/impl/model/AddToPortfolioPreselectedDataModel.kt b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/components/market/details/portfolio/add/impl/model/AddToPortfolioPreselectedDataModel.kt index 60acc73b60..a28a4fd173 100644 --- a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/components/market/details/portfolio/add/impl/model/AddToPortfolioPreselectedDataModel.kt +++ b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/components/market/details/portfolio/add/impl/model/AddToPortfolioPreselectedDataModel.kt @@ -15,6 +15,7 @@ import com.tangem.domain.markets.GetTokenMarketCryptoCurrency import com.tangem.domain.markets.TokenMarketInfo import com.tangem.domain.markets.TokenMarketParams import com.tangem.domain.models.account.AccountStatus +import com.tangem.domain.models.account.filterCryptoPortfolio import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.models.currency.CryptoCurrencyStatus import com.tangem.domain.models.wallet.UserWallet @@ -27,9 +28,9 @@ import com.tangem.features.feed.components.market.details.portfolio.impl.analyti import com.tangem.features.feed.impl.R import com.tangem.features.feed.model.earn.analytics.EarnAnalyticsEvent import com.tangem.utils.coroutines.CoroutineDispatcherProvider +import com.tangem.utils.logging.TangemLogger import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.* -import com.tangem.utils.logging.TangemLogger import java.math.BigDecimal import javax.inject.Inject @@ -172,12 +173,11 @@ internal class AddToPortfolioPreselectedDataModel @Inject constructor( val availableToAddInWallets = portfolioData.balances.mapNotNull { (walletId, balance) -> val wallet = balance.userWallet - val accounts = balance.accountsBalance.accountStatuses + val accounts = balance.accountsBalance.accountStatuses.filterCryptoPortfolio() val availableToAddAccounts = accounts.mapNotNull { accountStatus -> val accountIndex = when (accountStatus) { is AccountStatus.CryptoPortfolio -> accountStatus.account.derivationIndex - is AccountStatus.Payment -> TODO("[REDACTED_JIRA]") } val cryptoCurrency = getTokenMarketCryptoCurrency( @@ -224,7 +224,7 @@ internal class AddToPortfolioPreselectedDataModel @Inject constructor( ): CryptoCurrency? { val accountIndex = when (val accountStatus = account.account) { is AccountStatus.CryptoPortfolio -> accountStatus.account.derivationIndex - is AccountStatus.Payment -> TODO("[REDACTED_JIRA]") + is AccountStatus.Payment -> return null } return getTokenMarketCryptoCurrency( userWalletId = userWallet.walletId, From 36b9e004bae8b33bb24edf6b7beafe3b37519ba0 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 9 Apr 2026 00:27:06 +0800 Subject: [PATCH 4/7] Updated on 2026-08-14 --- .../feature/swap/domain/SwapInteractorImpl.kt | 120 +++++++++++------- 1 file changed, 72 insertions(+), 48 deletions(-) diff --git a/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt b/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt index e44392c352..952916beb1 100644 --- a/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt +++ b/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt @@ -72,7 +72,11 @@ import com.tangem.utils.logging.TangemLogger import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.async +import kotlinx.coroutines.awaitAll import kotlinx.coroutines.coroutineScope +import kotlinx.coroutines.supervisorScope import java.math.BigDecimal import java.math.BigInteger import java.math.RoundingMode @@ -314,6 +318,7 @@ internal class SwapInteractorImpl @AssistedInject constructor( ) } + @Suppress("LongMethod") override suspend fun findBestQuote( fromToken: CryptoCurrencyStatus, fromAccount: Account.CryptoPortfolio?, @@ -337,60 +342,79 @@ internal class SwapInteractorImpl @AssistedInject constructor( """.trimIndent(), ) - return providers.map { provider -> - val amountDecimal = toBigDecimalOrNull(amountToSwap) - if (amountDecimal == null || amountDecimal.signum() == 0) { - return providers.associateWith { createEmptyAmountState() } - } - val amount = SwapAmount(amountDecimal, fromToken.currency.decimals) - val isBalanceWithoutFeeEnough = isBalanceEnough(fromToken, amount, null) - val networkId = fromToken.currency.network.backendId - when (provider.type) { - ExchangeProviderType.DEX, ExchangeProviderType.DEX_BRIDGE -> { - if (isSolana(networkId)) { - manageDexSolana( - networkId = networkId, + val amountDecimal = toBigDecimalOrNull(amountToSwap) + if (amountDecimal == null || amountDecimal.signum() == 0) { + return providers.associateWith { createEmptyAmountState() } + } + val amount = SwapAmount(amountDecimal, fromToken.currency.decimals) + val isBalanceWithoutFeeEnough = isBalanceEnough(fromToken, amount, null) + val networkId = fromToken.currency.network.backendId + + return supervisorScope { + providers.map { provider -> + async { + try { + when (provider.type) { + ExchangeProviderType.DEX, ExchangeProviderType.DEX_BRIDGE -> { + if (isSolana(networkId)) { + manageDexSolana( + networkId = networkId, + fromToken = fromToken, + fromAccount = fromAccount, + toToken = toToken, + toAccount = toAccount, + provider = provider, + txFeeSealedState = txFeeSealedState, + amount = amount, + isBalanceWithoutFeeEnough = isBalanceWithoutFeeEnough, + expressOperationType = ExpressOperationType.SWAP, + ) + } else { + manageDex( + networkId = networkId, + fromToken = fromToken, + fromAccount = fromAccount, + toToken = toToken, + toAccount = toAccount, + provider = provider, + txFeeSealedState = txFeeSealedState, + amount = amount, + isBalanceWithoutFeeEnough = isBalanceWithoutFeeEnough, + expressOperationType = ExpressOperationType.SWAP, + ) + } + } + ExchangeProviderType.CEX -> { + manageCex( + networkId = networkId, + fromToken = fromToken, + fromAccount = fromAccount, + toToken = toToken, + toAccount = toAccount, + provider = provider, + amount = amount, + reduceBalanceBy = reduceBalanceBy, + isBalanceWithoutFeeEnough = isBalanceWithoutFeeEnough, + txFeeSealedState = txFeeSealedState, + ) + } + } + } catch (e: Throwable) { + if (e is CancellationException) { + throw e + } + TangemLogger.e("Failed to find quote for provider: ${provider.providerId}", e) + provider to createSwapErrorWith( fromToken = fromToken, fromAccount = fromAccount, - toToken = toToken, - toAccount = toAccount, - provider = provider, - txFeeSealedState = txFeeSealedState, amount = amount, - isBalanceWithoutFeeEnough = isBalanceWithoutFeeEnough, - expressOperationType = ExpressOperationType.SWAP, - ) - } else { - manageDex( - networkId = networkId, - fromToken = fromToken, - fromAccount = fromAccount, - toToken = toToken, - toAccount = toAccount, - provider = provider, - txFeeSealedState = txFeeSealedState, - amount = amount, - isBalanceWithoutFeeEnough = isBalanceWithoutFeeEnough, - expressOperationType = ExpressOperationType.SWAP, + includeFeeInAmount = IncludeFeeInAmount.Excluded, + expressDataError = ExpressDataError.UnknownError, ) } } - ExchangeProviderType.CEX -> { - manageCex( - networkId = networkId, - fromToken = fromToken, - fromAccount = fromAccount, - toToken = toToken, - toAccount = toAccount, - provider = provider, - amount = amount, - reduceBalanceBy = reduceBalanceBy, - isBalanceWithoutFeeEnough = isBalanceWithoutFeeEnough, - txFeeSealedState = txFeeSealedState, - ) - } - } - }.toMap() + }.awaitAll().toMap() + } } @Suppress("LongMethod") From 422b7be24b48d5e90eba5238b3f937628756a0f5 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 9 Apr 2026 14:25:14 +0400 Subject: [PATCH 5/7] Updated on 2026-08-14 --- .../tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt index 752787e5bb..23ec462f60 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt @@ -200,6 +200,7 @@ internal class SwapAmountModel @Inject constructor( if (content.swapRateMode != SwapRateMode.FLOAT_ONLY) { ExpressRateType.Fixed } else { + onSelectTokenClick() return } } From 342b608f810daab721d728e8bfdb8f1119caf362 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 9 Apr 2026 14:25:27 +0400 Subject: [PATCH 6/7] Updated on 2026-08-14 --- .../converter/SwapAmountFieldConverter.kt | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/converter/SwapAmountFieldConverter.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/converter/SwapAmountFieldConverter.kt index 810a528c2d..0684369b44 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/converter/SwapAmountFieldConverter.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/converter/SwapAmountFieldConverter.kt @@ -1,5 +1,6 @@ package com.tangem.features.swap.v2.impl.amount.model.converter +import com.tangem.common.ui.account.AccountTitleUM import com.tangem.common.ui.amountScreen.AmountScreenClickIntents import com.tangem.common.ui.amountScreen.converters.AmountAccountConverter import com.tangem.common.ui.amountScreen.converters.AmountStateConverter @@ -66,15 +67,20 @@ internal class SwapAmountFieldConverter( maxEnterAmount = maxEnterAmountConverter.convert(cryptoCurrencyStatus), iconStateConverter = iconStateConverter, isBalanceHidden = isBalanceHidden, - accountTitleUM = AmountAccountConverter( - isAccountsMode = isAccountsMode, - walletTitle = walletTitle, - prefixText = when { - swapAmountType.isEnteringField() -> resourceReference(R.string.common_from) - swapAmountType.isViewingField() -> resourceReference(R.string.common_to) - else -> TextReference.Companion.EMPTY - }, - ).convert(account), + accountTitleUM = if (swapAmountType.isViewingField()) { + AccountTitleUM.Text( + resourceReference(R.string.send_with_swap_recipient_get_amount, wrappedList("")), + ) + } else { + AmountAccountConverter( + isAccountsMode = isAccountsMode, + walletTitle = walletTitle, + prefixText = when { + swapAmountType.isEnteringField() -> resourceReference(R.string.common_from) + else -> TextReference.Companion.EMPTY + }, + ).convert(account) + }, ).convert( AmountParameters( title = walletTitle, From a47b0447f65f0a733a26347566f88583235ebd17 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 9 Apr 2026 10:25:49 +0000 Subject: [PATCH 7/7] 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 278d64c66f..165d042410 100644 --- a/gradle/tangem_dependencies.toml +++ b/gradle/tangem_dependencies.toml @@ -5,9 +5,9 @@ # https://github.com/tangem/tangem-sdk-android/ # https://github.com/tangem/vico -tangemBlockchainSdk = "releases-5.37-1485" +tangemBlockchainSdk = "develop-1482" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds -tangemCardSdk = "releases-5.37-603" +tangemCardSdk = "develop-602" #tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^ tangemVico = "tangem-master-21" #tangemVico = "0.0.1" # Keep it! - used for local builds ^