Updated on 2026-08-14
This commit is contained in:
parent
e1aa83f8b7
commit
fa1a34efa9
2 changed files with 14 additions and 3 deletions
|
|
@ -399,7 +399,6 @@ internal class DefaultCurrenciesRepository(
|
|||
|
||||
assetsStore.store(userWalletId, response.getOrThrow())
|
||||
}
|
||||
|
||||
} catch (e: Throwable) {
|
||||
Timber.e(e, "Unable to fetch assets for: ${userWalletId.stringValue}")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.domain.tokens
|
||||
|
||||
import com.tangem.domain.common.CardTypesResolver
|
||||
import com.tangem.domain.common.util.cardTypesResolver
|
||||
import com.tangem.domain.exchange.RampStateManager
|
||||
import com.tangem.domain.tokens.model.CryptoCurrency
|
||||
|
|
@ -55,6 +56,7 @@ class GetCryptoCurrencyActionsUseCase(
|
|||
userWalletId = userWallet.walletId,
|
||||
coinStatus = maybeCoinStatus.getOrNull(),
|
||||
cryptoCurrencyStatus = cryptoCurrencyStatus,
|
||||
cardTypesResolver = userWallet.scanResponse.cardTypesResolver,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -66,11 +68,17 @@ class GetCryptoCurrencyActionsUseCase(
|
|||
userWalletId: UserWalletId,
|
||||
coinStatus: CryptoCurrencyStatus?,
|
||||
cryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
cardTypesResolver: CardTypesResolver,
|
||||
): TokenActionsState {
|
||||
return TokenActionsState(
|
||||
walletId = userWalletId,
|
||||
cryptoCurrencyStatus = cryptoCurrencyStatus,
|
||||
states = createListOfActions(userWalletId, coinStatus, cryptoCurrencyStatus),
|
||||
states = createListOfActions(
|
||||
userWalletId,
|
||||
coinStatus,
|
||||
cryptoCurrencyStatus,
|
||||
cardTypesResolver,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -82,6 +90,7 @@ class GetCryptoCurrencyActionsUseCase(
|
|||
userWalletId: UserWalletId,
|
||||
coinStatus: CryptoCurrencyStatus?,
|
||||
cryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
cardTypesResolver: CardTypesResolver,
|
||||
): List<TokenActionsState.ActionState> {
|
||||
val cryptoCurrency = cryptoCurrencyStatus.currency
|
||||
if (cryptoCurrencyStatus.value is CryptoCurrencyStatus.MissedDerivation) {
|
||||
|
|
@ -107,8 +116,11 @@ class GetCryptoCurrencyActionsUseCase(
|
|||
activeList.add(TokenActionsState.ActionState.Send(true))
|
||||
}
|
||||
|
||||
val isMulticurrencyWallet = cardTypesResolver.isTangemWallet() || cardTypesResolver.isWallet2()
|
||||
// swap
|
||||
if (marketCryptoCurrencyRepository.isExchangeable(userWalletId, cryptoCurrency)) {
|
||||
if (isMulticurrencyWallet &&
|
||||
marketCryptoCurrencyRepository.isExchangeable(userWalletId, cryptoCurrency)
|
||||
) {
|
||||
activeList.add(TokenActionsState.ActionState.Swap(true))
|
||||
} else {
|
||||
disabledList.add(TokenActionsState.ActionState.Swap(false))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue