diff --git a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/GetCryptoCurrencyActionsUseCase.kt b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/GetCryptoCurrencyActionsUseCase.kt new file mode 100644 index 0000000000..ec8f8f39f8 --- /dev/null +++ b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/GetCryptoCurrencyActionsUseCase.kt @@ -0,0 +1,32 @@ +package com.tangem.domain.tokens + +import com.tangem.domain.tokens.model.TokenActionsState +import com.tangem.domain.wallets.models.UserWalletId +import com.tangem.utils.coroutines.CoroutineDispatcherProvider +import kotlinx.coroutines.flow.* + +class GetCryptoCurrencyActionsUseCase( + private val dispatchers: CoroutineDispatcherProvider, +) { + + operator fun invoke(userWalletId: UserWalletId, tokenId: String): Flow { + return flow { + emit(getMockState(userWalletId, tokenId)) + }.flowOn(dispatchers.io) + } + + // TODO replace by real data + private fun getMockState(userWalletId: UserWalletId, tokenId: String): TokenActionsState { + return TokenActionsState( + walletId = userWalletId, + tokenId = tokenId, + states = listOf( + TokenActionsState.ActionState.Buy(true), + TokenActionsState.ActionState.Sell(true), + TokenActionsState.ActionState.Receive(true), + TokenActionsState.ActionState.Swap(true), + TokenActionsState.ActionState.Sell(true), + ), + ) + } +} \ No newline at end of file diff --git a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/model/TokenActionsState.kt b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/model/TokenActionsState.kt new file mode 100644 index 0000000000..b2d6e6e71b --- /dev/null +++ b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/model/TokenActionsState.kt @@ -0,0 +1,25 @@ +package com.tangem.domain.tokens.model + +import com.tangem.domain.wallets.models.UserWalletId + +data class TokenActionsState( + val walletId: UserWalletId, + val tokenId: String, + val states: List, +) { + + sealed class ActionState { + + abstract val enabled: Boolean + + data class Buy(override val enabled: Boolean) : ActionState() + + data class Sell(override val enabled: Boolean) : ActionState() + + data class Receive(override val enabled: Boolean) : ActionState() + + data class Swap(override val enabled: Boolean) : ActionState() + + data class Send(override val enabled: Boolean) : ActionState() + } +} \ No newline at end of file