Updated on 2026-08-14

This commit is contained in:
Tangem 2025-07-22 11:44:55 +05:00
commit 5e1e708deb
9 changed files with 40 additions and 4 deletions

View file

@ -1,6 +1,7 @@
package com.tangem.features.swap.v2.impl.amount
import com.tangem.core.ui.extensions.TextReference
import com.tangem.domain.express.models.ExpressProviderType
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.swap.models.SwapDirection
import com.tangem.domain.tokens.model.CryptoCurrencyStatus
@ -18,6 +19,7 @@ internal sealed class SwapAmountComponentParams {
abstract val isBalanceHidingFlow: StateFlow<Boolean>
abstract val primaryCryptoCurrencyStatusFlow: StateFlow<CryptoCurrencyStatus>
abstract val secondaryCryptoCurrency: CryptoCurrency?
abstract val filterProviderTypes: List<ExpressProviderType>
data class AmountParams(
override val amountUM: SwapAmountUM,
@ -27,6 +29,7 @@ internal sealed class SwapAmountComponentParams {
override val swapDirection: SwapDirection,
override val primaryCryptoCurrencyStatusFlow: StateFlow<CryptoCurrencyStatus>,
override val secondaryCryptoCurrency: CryptoCurrency?,
override val filterProviderTypes: List<ExpressProviderType> = emptyList(),
val title: TextReference,
val callback: SwapAmountComponent.ModelCallback,
val currentRoute: Flow<SwapAmountRoute>,
@ -40,6 +43,7 @@ internal sealed class SwapAmountComponentParams {
override val swapDirection: SwapDirection,
override val primaryCryptoCurrencyStatusFlow: StateFlow<CryptoCurrencyStatus>,
override val secondaryCryptoCurrency: CryptoCurrency?,
override val filterProviderTypes: List<ExpressProviderType> = emptyList(),
val blockClickEnableFlow: StateFlow<Boolean>,
) : SwapAmountComponentParams()
}

View file

@ -281,6 +281,7 @@ internal class SwapAmountModel @Inject constructor(
userWallet = userWallet,
initialCurrency = primaryCryptoCurrency,
cryptoCurrencyStatusList = cryptoCurrencyStatusListExceptPrimary,
filterProviderTypes = params.filterProviderTypes,
).fold(
ifRight = { swapCurrencies ->
val secondaryStatus = selectInitialPairUseCase(

View file

@ -18,6 +18,7 @@ import com.tangem.core.decompose.navigation.inner.InnerRouter
import com.tangem.core.ui.decompose.ComposableContentComponent
import com.tangem.core.ui.decompose.getEmptyComposableContentComponent
import com.tangem.core.ui.extensions.resourceReference
import com.tangem.domain.express.models.ExpressProviderType
import com.tangem.domain.swap.models.R
import com.tangem.domain.swap.models.SwapDirection
import com.tangem.features.send.v2.api.subcomponents.destination.DestinationRoute
@ -125,6 +126,7 @@ internal class DefaultSendWithSwapComponent @AssistedInject constructor(
swapDirection = SwapDirection.Direct,
callback = model,
userWallet = model.userWallet,
filterProviderTypes = SEND_WITH_SWAP_PROVIDER_TYPES,
),
)
}
@ -199,4 +201,9 @@ internal class DefaultSendWithSwapComponent @AssistedInject constructor(
params: SendWithSwapComponent.Params,
): DefaultSendWithSwapComponent
}
companion object {
/** List of supported provider types in Send with Swap */
internal val SEND_WITH_SWAP_PROVIDER_TYPES = listOf(ExpressProviderType.CEX)
}
}

View file

@ -24,6 +24,7 @@ import com.tangem.features.swap.v2.impl.amount.SwapAmountComponentParams
import com.tangem.features.swap.v2.impl.common.entity.ConfirmUM
import com.tangem.features.swap.v2.impl.common.entity.SwapQuoteUM
import com.tangem.features.swap.v2.impl.notifications.SwapNotificationsComponent
import com.tangem.features.swap.v2.impl.sendviaswap.DefaultSendWithSwapComponent.Companion.SEND_WITH_SWAP_PROVIDER_TYPES
import com.tangem.features.swap.v2.impl.sendviaswap.SendWithSwapRoute
import com.tangem.features.swap.v2.impl.sendviaswap.confirm.model.SendWithSwapConfirmModel
import com.tangem.features.swap.v2.impl.sendviaswap.confirm.ui.SendWithSwapConfirmContent
@ -57,6 +58,7 @@ internal class SendWithSwapConfirmComponent @AssistedInject constructor(
secondaryCryptoCurrency = model.secondaryCurrency,
isBalanceHidingFlow = params.isBalanceHidingFlow,
swapDirection = params.swapDirection,
filterProviderTypes = SEND_WITH_SWAP_PROVIDER_TYPES,
),
onResult = model::onAmountResult,
onClick = model::showEditAmount,