Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-11 14:56:20 +02:00
parent 407cfd491f
commit 646349ff69
7 changed files with 359 additions and 11 deletions

View file

@ -11,6 +11,7 @@ import com.tangem.features.commonfeatures.api.choosetoken.model.ChooseTokenPortf
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.StateFlow
interface ChooseTokenBridge : ChooseTokenBridgeInternal {
@ -30,6 +31,11 @@ interface ChooseTokenBridge : ChooseTokenBridgeInternal {
val isShowMarketBlock: Boolean,
val isShowPaymentAccount: Boolean,
val isAppBarShown: Boolean = true,
/**
* When `true`, single-currency wallets (and single-currency-with-token wallets like NODL)
* are shown as selectable tabs. Swap flows keep this `false` only multi-currency wallets apply there.
*/
val isShowSingleCurrencyWallets: Boolean = false,
) {
companion object {
val SwapFrom = Settings(
@ -47,6 +53,7 @@ interface ChooseTokenBridge : ChooseTokenBridgeInternal {
isShowMarketBlock = true,
isShowPaymentAccount = false,
isAppBarShown = false,
isShowSingleCurrencyWallets = true,
)
}
}
@ -69,6 +76,9 @@ interface ChooseTokenBridgeInternal {
val searchQueryState: StateFlow<SearchQuery>
val fullPortfolioBlock: StateFlow<ChooseTokenPortfolioFullBlockUM?>
/** Currently selected wallet tab. Used to constrain feature blocks (e.g. market block) to the wallet's type. */
val selectedWalletFlow: SharedFlow<UserWallet>
fun onSearchQuery(query: SearchQuery)
fun onSearchQuery(query: String) = onSearchQuery(SearchQuery(query))