Updated on 2026-08-14
This commit is contained in:
parent
8b75e37e30
commit
a9bca131c3
386 changed files with 1369 additions and 1347 deletions
|
|
@ -82,5 +82,4 @@ dependencies {
|
|||
implementation(deps.decompose.ext.compose)
|
||||
implementation(deps.kotlin.immutable.collections)
|
||||
implementation(deps.reKotlin)
|
||||
implementation(deps.timber)
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ import kotlinx.coroutines.flow.StateFlow
|
|||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
internal class AllOffersModel @Inject constructor(
|
||||
|
|
@ -127,7 +127,7 @@ internal class AllOffersModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun handleOnrampError(onrampError: OnrampError) {
|
||||
Timber.e(onrampError.toString())
|
||||
TangemLogger.e(onrampError.toString())
|
||||
state.update { stateFactory.getOnrampErrorState(onrampError) }
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import com.tangem.common.routing.AppRouter
|
|||
import com.tangem.domain.wallets.usecase.GetSelectedWalletSyncUseCase
|
||||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
|
||||
internal class DefaultBuyDeepLinkHandler @AssistedInject constructor(
|
||||
router: AppRouter,
|
||||
|
|
@ -16,7 +16,7 @@ internal class DefaultBuyDeepLinkHandler @AssistedInject constructor(
|
|||
// It is okay here, we are navigating from outside, and there is no other way to getting UserWallet
|
||||
getSelectedWalletSyncUseCase().fold(
|
||||
ifLeft = {
|
||||
Timber.e("Error on getting user wallet: $it")
|
||||
TangemLogger.e("Error on getting user wallet: $it")
|
||||
},
|
||||
ifRight = { userWallet ->
|
||||
router.push(AppRoute.BuyCrypto(userWallet.walletId))
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import dagger.assisted.AssistedFactory
|
|||
import dagger.assisted.AssistedInject
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
|
||||
internal class DefaultOnrampDeepLinkHandler @AssistedInject constructor(
|
||||
@Assisted scope: CoroutineScope,
|
||||
|
|
@ -36,7 +36,7 @@ internal class DefaultOnrampDeepLinkHandler @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
else -> {
|
||||
Timber.e(
|
||||
TangemLogger.e(
|
||||
"""
|
||||
Invalid parameters for ONRAMP deeplink
|
||||
|- Params: $queryParams
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import com.tangem.common.routing.AppRouter
|
|||
import com.tangem.domain.wallets.usecase.GetSelectedWalletSyncUseCase
|
||||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
|
||||
internal class DefaultSellDeepLinkHandler @AssistedInject constructor(
|
||||
router: AppRouter,
|
||||
|
|
@ -16,7 +16,7 @@ internal class DefaultSellDeepLinkHandler @AssistedInject constructor(
|
|||
// It is okay here, we are navigating from outside, and there is no other way to getting UserWallet
|
||||
getSelectedWalletSyncUseCase().fold(
|
||||
ifLeft = {
|
||||
Timber.e("Error on getting user wallet: $it")
|
||||
TangemLogger.e("Error on getting user wallet: $it")
|
||||
},
|
||||
ifRight = { userWallet ->
|
||||
router.push(AppRoute.SellCrypto(userWallet.walletId))
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import com.tangem.common.routing.AppRouter
|
|||
import com.tangem.domain.wallets.usecase.GetSelectedWalletSyncUseCase
|
||||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
|
||||
internal class DefaultSwapDeepLinkHandler @AssistedInject constructor(
|
||||
router: AppRouter,
|
||||
|
|
@ -16,7 +16,7 @@ internal class DefaultSwapDeepLinkHandler @AssistedInject constructor(
|
|||
// It is okay here, we are navigating from outside, and there is no other way to getting UserWallet
|
||||
getSelectedWalletSyncUseCase().fold(
|
||||
ifLeft = {
|
||||
Timber.e("Error on getting user wallet: $it")
|
||||
TangemLogger.e("Error on getting user wallet: $it")
|
||||
},
|
||||
ifRight = { userWallet ->
|
||||
router.push(AppRoute.SwapCrypto(userWallet.walletId))
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import kotlinx.collections.immutable.toImmutableList
|
|||
import kotlinx.coroutines.channels.BufferOverflow
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.flow.*
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
|
|
@ -187,7 +187,7 @@ internal class HotCryptoModel @Inject constructor(
|
|||
channel.close()
|
||||
}
|
||||
.catch { throwable ->
|
||||
Timber.e(throwable)
|
||||
TangemLogger.e("Error", throwable)
|
||||
closeNavigationFlow()
|
||||
}
|
||||
.launchIn(modelScope)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
|||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
|
|
@ -56,13 +56,13 @@ internal class OnrampAddToPortfolioModel @Inject constructor(
|
|||
|
||||
private fun isTangemIconVisible(): Boolean {
|
||||
return getUserWalletUseCase(params.userWalletId)
|
||||
.onLeft { Timber.e("Unable to get wallet by id [${params.userWalletId}]: $it") }
|
||||
.onLeft { TangemLogger.e("Unable to get wallet by id [${params.userWalletId}]: $it") }
|
||||
.fold(ifLeft = { false }, ifRight = { it is UserWallet.Cold })
|
||||
}
|
||||
|
||||
private fun getUserWalletName(): String {
|
||||
return getUserWalletUseCase(params.userWalletId)
|
||||
.onLeft { Timber.e("Unable to get wallet name by id [${params.userWalletId}]: $it") }
|
||||
.onLeft { TangemLogger.e("Unable to get wallet name by id [${params.userWalletId}]: $it") }
|
||||
.fold(ifLeft = { "" }, ifRight = UserWallet::name)
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ internal class OnrampAddToPortfolioModel @Inject constructor(
|
|||
manageCryptoCurrenciesUseCase(accountId = accountId, add = params.cryptoCurrency)
|
||||
.onRight { params.onSuccessAdding(params.cryptoCurrency.id) }
|
||||
.onLeft { throwable ->
|
||||
Timber.e("Failed to add crypto currency: $throwable")
|
||||
TangemLogger.e("Failed to add crypto currency: $throwable")
|
||||
changeAddButtonProgressStatus(isProgress = false)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.tangem.utils.coroutines.runSuspendCatching
|
|||
import com.tangem.utils.isNullOrZero
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
@Suppress("LongParameterList", "LargeClass")
|
||||
|
|
@ -351,7 +351,7 @@ internal class OnrampMainComponentModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun handleOnrampError(onrampError: OnrampError) {
|
||||
Timber.e(onrampError.toString())
|
||||
TangemLogger.e(onrampError.toString())
|
||||
state.update { stateFactory.getOnrampErrorState(onrampError) }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
|||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import java.math.BigDecimal
|
||||
import java.util.Locale
|
||||
import javax.inject.Inject
|
||||
|
|
@ -116,7 +116,7 @@ internal class SelectProviderModel @Inject constructor(
|
|||
}
|
||||
.onLeft { error ->
|
||||
sendOnrampErrorEvent(error)
|
||||
Timber.e(error.toString())
|
||||
TangemLogger.e(error.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import kotlinx.coroutines.flow.launchIn
|
|||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
|
|
@ -133,7 +133,7 @@ internal class OnrampRedirectModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun handleError(error: OnrampError) {
|
||||
Timber.e(error.toString())
|
||||
TangemLogger.e(error.toString())
|
||||
analyticsEventHandler.sendOnrampErrorEvent(
|
||||
error = error,
|
||||
tokenSymbol = params.cryptoCurrency.symbol,
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import kotlinx.coroutines.flow.StateFlow
|
|||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
|
|
@ -89,12 +89,12 @@ internal class OnrampSuccessComponentModel @Inject constructor(
|
|||
getOnrampTransactionUseCase(txId = params.txId)
|
||||
.fold(
|
||||
ifLeft = { error ->
|
||||
Timber.e(error.toString())
|
||||
TangemLogger.e(error.toString())
|
||||
showErrorAlert(error)
|
||||
},
|
||||
ifRight = { transaction ->
|
||||
userWallet = getUserWalletUseCase(transaction.userWalletId).getOrElse {
|
||||
Timber.e("UserWallet found")
|
||||
TangemLogger.e("UserWallet not found")
|
||||
// this case should never happened
|
||||
showErrorAlert(OnrampError.DomainError("UserWallet not found"))
|
||||
return@launch
|
||||
|
|
@ -104,7 +104,7 @@ internal class OnrampSuccessComponentModel @Inject constructor(
|
|||
?.getCryptoCurrency(currencyIdValue = transaction.toCurrencyId)?.getOrNull()
|
||||
.toOption()
|
||||
.getOrElse {
|
||||
Timber.e("Crypto currency not found")
|
||||
TangemLogger.e("Crypto currency not found")
|
||||
showErrorAlert(OnrampError.DomainError(null))
|
||||
return@launch
|
||||
}
|
||||
|
|
@ -145,7 +145,7 @@ internal class OnrampSuccessComponentModel @Inject constructor(
|
|||
providerName = transaction.providerName,
|
||||
paymentMethod = transaction.paymentMethod,
|
||||
)
|
||||
Timber.e(error.toString())
|
||||
TangemLogger.e(error.toString())
|
||||
showErrorAlert(error)
|
||||
},
|
||||
ifRight = { status ->
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import com.tangem.features.onramp.swap.entity.utils.createEmptyExchangeTo
|
|||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
|
|
@ -26,12 +26,12 @@ internal class SwapSelectTokensController @Inject constructor() {
|
|||
)
|
||||
|
||||
fun update(transform: (SwapSelectTokensUM) -> SwapSelectTokensUM) {
|
||||
Timber.d("Applying non-name transformation")
|
||||
TangemLogger.d("Applying non-name transformation")
|
||||
state.update(transform)
|
||||
}
|
||||
|
||||
fun update(transformer: SwapSelectTokensUMTransformer) {
|
||||
Timber.d("Applying ${transformer::class.simpleName ?: "null"}")
|
||||
TangemLogger.d("Applying ${transformer::class.simpleName ?: "null"}")
|
||||
state.update(transformer::transform)
|
||||
}
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ import kotlinx.collections.immutable.persistentListOf
|
|||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
|
|
@ -36,17 +36,17 @@ internal class TokenListUMController @Inject constructor() {
|
|||
)
|
||||
|
||||
fun update(transform: (TokenListUM) -> TokenListUM) {
|
||||
Timber.d("Applying non-name transformation")
|
||||
TangemLogger.d("Applying non-name transformation")
|
||||
state.update(transform)
|
||||
}
|
||||
|
||||
fun update(transformer: TokenListUMTransformer) {
|
||||
Timber.d("Applying ${transformer::class.simpleName ?: "unknown"}")
|
||||
TangemLogger.d("Applying ${transformer::class.simpleName ?: "unknown"}")
|
||||
state.update(transformer::transform)
|
||||
}
|
||||
|
||||
fun update(transformer: SearchBarUMTransformer) {
|
||||
Timber.d("Applying ${transformer::class.simpleName ?: "unknown"}")
|
||||
TangemLogger.d("Applying ${transformer::class.simpleName ?: "unknown"}")
|
||||
state.update { prevState ->
|
||||
prevState.copy(
|
||||
searchBarUM = transformer.transform(prevState.searchBarUM),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue