Updated on 2026-08-14

This commit is contained in:
Tangem 2023-11-28 12:08:19 +02:00
parent 1712785ec6
commit c026d65fba

View file

@ -459,11 +459,6 @@ internal class SwapInteractorImpl @Inject constructor(
)
return when (result) {
is SendTxResult.Success -> {
if (walletFeatureToggles.isRedesignedScreenEnabled) {
onSuccessNewFlow(currencyToGet)
} else {
onSuccessLegacyFlow(currencyToGet)
}
TxState.TxSent(
fromAmount = amountFormatter.formatSwapAmountToUI(
amount,
@ -529,11 +524,6 @@ internal class SwapInteractorImpl @Inject constructor(
}
}, ifRight = {
if (walletFeatureToggles.isRedesignedScreenEnabled) {
onSuccessNewFlow(currencyToGet.currency)
} else {
onSuccessLegacyFlow(currencyToGet.currency)
}
TxState.TxSent(
fromAmount = amountFormatter.formatSwapAmountToUI(
amount,
@ -568,24 +558,6 @@ internal class SwapInteractorImpl @Inject constructor(
return ONE_INCH_SUPPORTED_NETWORKS.contains(networkId)
}
@Deprecated("used in old swap mechanism")
private suspend fun onSuccessLegacyFlow(currency: CryptoCurrency) {
userWalletManager.addToken(swapCurrencyConverter.convert(currency), derivationPath)
userWalletManager.refreshWallet()
}
@Deprecated("used in old swap mechanism")
private suspend fun onSuccessNewFlow(currency: CryptoCurrency) {
getSelectedWalletSyncUseCase().fold(
ifRight = { userWallet ->
addCryptoCurrenciesUseCase(userWallet.walletId, currency)
},
ifLeft = {
Timber.e("Swap Error on getSelectedWalletUseCase")
},
)
}
@Deprecated("used in old swap mechanism")
private fun getTangemFee(): Double {
return repository.getTangemFee()