Updated on 2026-08-14

This commit is contained in:
Tangem 2025-06-26 12:56:37 +05:00
parent a66b1bfb14
commit 04c90d11db
5 changed files with 35 additions and 4 deletions

View file

@ -10,6 +10,7 @@ import com.tangem.feature.usedesk.api.UsedeskComponent
import com.tangem.feature.walletsettings.component.WalletSettingsComponent
import com.tangem.features.details.component.DetailsComponent
import com.tangem.features.disclaimer.api.components.DisclaimerComponent
import com.tangem.features.managetokens.component.ChooseManagedTokensComponent
import com.tangem.features.managetokens.component.ManageTokensComponent
import com.tangem.features.managetokens.component.ManageTokensSource
import com.tangem.features.markets.details.MarketsTokenDetailsComponent
@ -78,6 +79,7 @@ internal class ChildFactory @Inject constructor(
private val nftComponentFactory: NFTComponent.Factory,
private val nftSendComponentFactory: NFTSendComponent.Factory,
private val usedeskComponentFactory: UsedeskComponent.Factory,
private val chooseManagedTokensComponentFactory: ChooseManagedTokensComponent.Factory,
private val testerRouter: TesterRouter,
private val walletConnectFeatureToggles: WalletConnectFeatureToggles,
) {
@ -407,6 +409,17 @@ internal class ChildFactory @Inject constructor(
componentFactory = usedeskComponentFactory,
)
}
is AppRoute.ChooseManagedTokens -> {
createComponentChild(
context = context,
params = ChooseManagedTokensComponent.Params(
userWalletId = route.userWalletId,
initialCurrency = route.initialCurrency,
source = ChooseManagedTokensComponent.Source.valueOf(route.source.name),
),
componentFactory = chooseManagedTokensComponentFactory,
)
}
}
}
}

View file

@ -127,6 +127,16 @@ sealed class AppRoute(val path: String) : Route {
}
}
data class ChooseManagedTokens(
val userWalletId: UserWalletId,
val initialCurrency: CryptoCurrency,
val source: Source,
) : AppRoute(path = "/$source/choose_managed_tokens/$userWalletId/${initialCurrency.id.value}") {
enum class Source {
SendViaSwap,
}
}
@Serializable
data class WalletConnectSessions(val userWalletId: UserWalletId) : AppRoute(path = "/wallet_connect_sessions")

View file

@ -12,7 +12,14 @@ import com.tangem.domain.tokens.model.CryptoCurrencyStatus
data class SwapCurrencies(
val fromGroup: SwapCurrenciesGroup,
val toGroup: SwapCurrenciesGroup,
)
) {
companion object {
val EMPTY = SwapCurrencies(
fromGroup = SwapCurrenciesGroup(emptyList(), emptyList(), false),
toGroup = SwapCurrenciesGroup(emptyList(), emptyList(), false),
)
}
}
/**
* Return swap group depending on [swapDirection]

View file

@ -53,6 +53,7 @@ dependencies {
implementation(projects.domain.manageTokens)
implementation(projects.domain.transaction.models)
implementation(projects.domain.transaction)
implementation(projects.domain.legacy)
/** Compose */
implementation(deps.compose.foundation)

View file

@ -21,9 +21,6 @@ internal class SwapChooseProviderModel @Inject constructor(
private val params: SwapChooseProviderComponent.Params = paramsContainer.require()
val uiState: StateFlow<SwapChooseProviderBottomSheetContent>
field: MutableStateFlow<SwapChooseProviderBottomSheetContent> = MutableStateFlow(getInitialState())
private val swapProviderListItemConverter by lazy(LazyThreadSafetyMode.NONE) {
SwapProviderListItemConverter(
cryptoCurrency = params.cryptoCurrency,
@ -31,6 +28,9 @@ internal class SwapChooseProviderModel @Inject constructor(
)
}
val uiState: StateFlow<SwapChooseProviderBottomSheetContent>
field: MutableStateFlow<SwapChooseProviderBottomSheetContent> = MutableStateFlow(getInitialState())
fun onProviderClick(quoteUM: SwapQuoteUM) {
params.callback.onProviderResult(quoteUM)
}