Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-17 14:27:13 +05:00
parent 56b509927c
commit 6afae8e619
4 changed files with 16 additions and 10 deletions

View file

@ -538,6 +538,7 @@
<string name="hw_activation_need_warning_description">Complete setup by securing the app with an access code.</string>
<string name="hw_backup_alert_description">If you do, you\'ll need to start over.</string>
<string name="hw_backup_alert_title">Are you sure you want to quit the activation process?</string>
<string name="hw_backup_banner_description">Keeps your crypto safe and offline. Slim as a credit card, safer than a bank vault.</string>
<string name="hw_backup_close_description">If you do, you\'ll need to start over.</string>
<string name="hw_backup_google_drive_description">Recover existing wallet via Google Drive backup</string>
<string name="hw_backup_google_drive_title">Google Drive backup</string>
@ -547,6 +548,7 @@
<string name="hw_backup_need_description">Please back up your wallet before creating an access code.</string>
<string name="hw_backup_need_title">Finalize backup first</string>
<string name="hw_backup_no_backup">Incomplete</string>
<string name="hw_backup_section_other_title">Other methods</string>
<string name="hw_backup_seed_description">Physical devices that securely store your private key offline.</string>
<string name="hw_backup_seed_title">Recovery phrase</string>
<string name="hw_create_keys_description">Your private keys are securely encrypted and stored on your phone</string>

View file

@ -64,4 +64,9 @@ sealed class ExpressDataError {
override val code: Int = -2
override val message: String = "tooLargeSolanaTransaction"
}
data object DexActiveSupplyError : ExpressDataError() {
override val code: Int = -3
override val message: String = "dexActiveSupplyError"
}
}

View file

@ -334,6 +334,14 @@ internal class SwapInteractorImpl @AssistedInject constructor(
isBalanceWithoutFeeEnough: Boolean,
expressOperationType: ExpressOperationType,
): Pair<SwapProvider, SwapState> {
if (fromToken.value.yieldSupplyStatus?.isActive == true) {
return provider to produceDexSwapDataError(
error = ExpressDataError.DexActiveSupplyError,
fromToken = fromToken,
amount = amount,
)
}
val maybeQuotes = repository.findBestQuote(
userWallet = userWallet,
fromContractAddress = fromToken.currency.getContractAddress(),

View file

@ -1267,16 +1267,7 @@ internal class SwapModel @Inject constructor(
toToken.currency.id.value
}
return groupToFind.available.find { idToFind == it.currencyStatus.currency.id.value }?.providers
?.filter { provider ->
// !!!WARNING!!! Filter out dex provider if yield supply is active
val yieldSupplyStatus = fromToken.value.yieldSupplyStatus
if (yieldSupplyStatus != null && yieldSupplyStatus.isActive) {
provider.type == ExchangeProviderType.CEX
} else {
true
}
}.orEmpty()
return groupToFind.available.find { idToFind == it.currencyStatus.currency.id.value }?.providers.orEmpty()
}
private fun Map<SwapProvider, SwapState>.getLastLoadedSuccessStates(): SuccessLoadedSwapData {