Updated on 2026-08-14

This commit is contained in:
Tangem 2023-11-21 15:05:17 +04:00
parent 9a8ff1830d
commit a0798cfef2
252 changed files with 247 additions and 5857 deletions

View file

@ -1,28 +0,0 @@
package com.tangem.feature.swap.domain.models.ui
import com.tangem.feature.swap.domain.models.domain.Currency
data class TokensDataState(
val preselectTokens: PreselectTokens,
val foundTokensState: FoundTokensState,
)
data class FoundTokensState(
val tokensInWallet: List<TokenWithBalance>,
val loadedTokens: List<TokenWithBalance>,
)
data class PreselectTokens(
val fromToken: Currency,
val toToken: Currency,
)
data class TokenWithBalance(
val token: Currency,
val tokenBalanceData: TokenBalanceData? = null,
)
data class TokenBalanceData(
val amount: String?,
val amountEquivalent: String?,
)

View file

@ -4,10 +4,7 @@ import androidx.annotation.DrawableRes
import androidx.compose.ui.text.input.TextFieldValue
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
import com.tangem.core.ui.components.notifications.NotificationConfig
import com.tangem.core.ui.components.states.Item
import com.tangem.core.ui.components.states.SelectableItemsState
import com.tangem.domain.tokens.model.CryptoCurrencyStatus
import com.tangem.feature.swap.domain.models.ui.TxFee
import com.tangem.feature.swap.models.states.FeeItemState
import com.tangem.feature.swap.models.states.ProviderState
@ -70,29 +67,6 @@ data class SwapButton(
val onClick: () -> Unit,
)
sealed class FeeState(open val tangemFee: Double) {
object Empty : FeeState(0.0)
data class Loaded(
override val tangemFee: Double,
override val state: SelectableItemsState<TxFee>?,
val onSelectItem: (Item<TxFee>) -> Unit,
) : FeeState(tangemFee), FeeSelectState
object Loading : FeeState(0.0)
data class NotEnoughFundsWarning(
override val tangemFee: Double,
override val state: SelectableItemsState<TxFee>?,
val onSelectItem: (Item<TxFee>) -> Unit,
) : FeeState(tangemFee), FeeSelectState
}
sealed interface FeeSelectState {
val state: SelectableItemsState<TxFee>?
}
sealed interface TransactionCardType {
data class SendCard(

View file

@ -2,8 +2,7 @@ package com.tangem.feature.swap.ui
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.layout.padding
import androidx.compose.material.*
import androidx.compose.material3.*
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.tangem.core.ui.res.TangemTheme

View file

@ -2,7 +2,6 @@ package com.tangem.feature.wallet.presentation.wallet.state.factory.txhistory
import androidx.paging.PagingData
import arrow.core.Either
import com.tangem.common.Converter
import com.tangem.common.Provider
import com.tangem.core.ui.components.transactions.state.TransactionState
import com.tangem.core.ui.components.transactions.state.TxHistoryState.*
@ -12,6 +11,7 @@ import com.tangem.domain.txhistory.models.TxHistoryStateError
import com.tangem.feature.wallet.presentation.wallet.state.WalletSingleCurrencyState
import com.tangem.feature.wallet.presentation.wallet.state.WalletState
import com.tangem.feature.wallet.presentation.wallet.viewmodels.WalletClickIntents
import com.tangem.utils.converter.Converter
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.update

View file

@ -1,10 +1,10 @@
package com.tangem.feature.wallet.presentation.wallet.utils
import com.tangem.common.Converter
import com.tangem.common.Provider
import com.tangem.domain.tokens.error.CurrencyStatusError
import com.tangem.feature.wallet.presentation.wallet.state.WalletSingleCurrencyState
import com.tangem.feature.wallet.presentation.wallet.state.WalletState
import com.tangem.utils.converter.Converter
// TODO: Implement this
internal class CurrencyStatusErrorConverter(

View file

@ -1,10 +1,10 @@
package com.tangem.feature.wallet.presentation.wallet.utils
import com.tangem.common.Converter
import com.tangem.common.Provider
import com.tangem.feature.wallet.presentation.wallet.state.WalletMultiCurrencyState
import com.tangem.feature.wallet.presentation.wallet.state.WalletSingleCurrencyState
import com.tangem.feature.wallet.presentation.wallet.state.WalletState
import com.tangem.utils.converter.Converter
internal class HiddenStateConverter(
private val currentStateProvider: Provider<WalletState>,