Updated on 2026-08-14
This commit is contained in:
parent
8b75e37e30
commit
a9bca131c3
386 changed files with 1369 additions and 1347 deletions
|
|
@ -24,6 +24,7 @@ dependencies {
|
|||
implementation(projects.core.ui)
|
||||
implementation(projects.core.configToggles)
|
||||
implementation(projects.core.analytics)
|
||||
implementation(projects.core.utils)
|
||||
implementation(projects.common.routing)
|
||||
implementation(projects.common.ui)
|
||||
|
||||
|
|
@ -67,6 +68,5 @@ dependencies {
|
|||
/* Other */
|
||||
implementation(deps.kotlin.immutable.collections)
|
||||
implementation(deps.decompose.ext.compose)
|
||||
implementation(deps.timber)
|
||||
implementation(deps.reKotlin) // need for legacy onboarding
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ import kotlinx.collections.immutable.toPersistentList
|
|||
import kotlinx.coroutines.FlowPreview
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
|
|
@ -243,7 +243,7 @@ internal class ChooseManagedTokensModel @Inject constructor(
|
|||
}
|
||||
is PaginationStatus.Paginating -> {
|
||||
(status.lastResult as? BatchFetchResult.Error)?.let { fetchError ->
|
||||
Timber.e(fetchError.throwable)
|
||||
TangemLogger.e("Error", fetchError.throwable)
|
||||
}
|
||||
|
||||
state.copy(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.features.managetokens.model
|
||||
|
||||
import arrow.core.getOrElse
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import com.tangem.common.core.TangemSdkError
|
||||
import com.tangem.core.analytics.api.AnalyticsEventHandler
|
||||
import com.tangem.core.decompose.di.ModelScoped
|
||||
|
|
@ -36,7 +37,6 @@ import kotlinx.collections.immutable.mutate
|
|||
import kotlinx.coroutines.FlowPreview
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
// TODO: Divide to sub-components: [REDACTED_JIRA]
|
||||
|
|
@ -239,7 +239,7 @@ internal class CustomTokenFormModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun showErrorDialog(throwable: Throwable) {
|
||||
Timber.e(throwable)
|
||||
TangemLogger.e("Error", throwable)
|
||||
val message = when (throwable) {
|
||||
is TangemSdkError -> resourceReference(
|
||||
R.string.generic_error_code,
|
||||
|
|
@ -279,7 +279,7 @@ internal class CustomTokenFormModel @Inject constructor(
|
|||
stateAcc // No need to display error
|
||||
}
|
||||
is CustomTokenFormValidationException.DataError -> {
|
||||
Timber.e(exception.cause, "Unable to validate custom currency")
|
||||
TangemLogger.e("Unable to validate custom currency", exception.cause)
|
||||
stateAcc
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import kotlinx.collections.immutable.toPersistentList
|
|||
import kotlinx.coroutines.FlowPreview
|
||||
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")
|
||||
|
|
@ -248,7 +248,7 @@ internal class ManageTokensModel @Inject constructor(
|
|||
}
|
||||
is PaginationStatus.Paginating -> {
|
||||
(status.lastResult as? BatchFetchResult.Error)?.let { fetchError ->
|
||||
Timber.e(fetchError.throwable)
|
||||
TangemLogger.e("Error", fetchError.throwable)
|
||||
}
|
||||
|
||||
state.copySealed(
|
||||
|
|
@ -339,7 +339,7 @@ internal class ManageTokensModel @Inject constructor(
|
|||
currenciesToAdd = manageTokensListManager.currenciesToAdd.value,
|
||||
currenciesToRemove = manageTokensListManager.currenciesToRemove.value,
|
||||
).getOrElse { throwable ->
|
||||
Timber.e(throwable, "Failed to save changes")
|
||||
TangemLogger.e("Failed to save changes", throwable)
|
||||
return@resource
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import kotlinx.collections.immutable.toPersistentList
|
|||
import kotlinx.coroutines.FlowPreview
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
|
|
@ -167,7 +167,7 @@ internal class OnboardingManageTokensModel @Inject constructor(
|
|||
}
|
||||
is PaginationStatus.Paginating -> {
|
||||
(status.lastResult as? BatchFetchResult.Error)?.let { fetchError ->
|
||||
Timber.e(fetchError.throwable)
|
||||
TangemLogger.e("Error", fetchError.throwable)
|
||||
}
|
||||
|
||||
state.copy(
|
||||
|
|
@ -261,7 +261,7 @@ internal class OnboardingManageTokensModel @Inject constructor(
|
|||
currenciesToAdd = manageTokensListManager.currenciesToAdd.value,
|
||||
currenciesToRemove = manageTokensListManager.currenciesToRemove.value,
|
||||
).getOrElse { throwable ->
|
||||
Timber.e(throwable, "Failed to save changes")
|
||||
TangemLogger.e("Failed to save changes", throwable)
|
||||
return@resource
|
||||
}
|
||||
|
||||
|
|
@ -286,7 +286,7 @@ internal class OnboardingManageTokensModel @Inject constructor(
|
|||
currenciesToAdd = manageTokensListManager.currenciesToAdd.value,
|
||||
currenciesToRemove = manageTokensListManager.currenciesToRemove.value,
|
||||
).getOrElse { throwable ->
|
||||
Timber.e(throwable, "Failed to save changes")
|
||||
TangemLogger.e("Failed to save changes", throwable)
|
||||
return@resource
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import com.tangem.utils.coroutines.saveInAndJoin
|
|||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
|
||||
internal class CustomCurrencyValidator(
|
||||
private val userWalletId: UserWalletId,
|
||||
|
|
@ -103,7 +103,7 @@ internal class CustomCurrencyValidator(
|
|||
).getOrElse { e ->
|
||||
when (e) {
|
||||
is FindTokenException.DataError -> {
|
||||
Timber.e(e.cause, "Unable to find custom currency")
|
||||
TangemLogger.e("Unable to find custom currency", e.cause)
|
||||
updateStatus(Status.UnexpectedException(e.cause))
|
||||
return
|
||||
}
|
||||
|
|
@ -135,7 +135,7 @@ internal class CustomCurrencyValidator(
|
|||
).getOrElse { e ->
|
||||
val newStatus = when (e) {
|
||||
is FindTokenException.DataError -> {
|
||||
Timber.e(e.cause, "Unable to find custom currency")
|
||||
TangemLogger.e("Unable to find custom currency", e.cause)
|
||||
Status.UnexpectedException(e.cause)
|
||||
}
|
||||
is FindTokenException.NotFound -> {
|
||||
|
|
@ -161,7 +161,7 @@ internal class CustomCurrencyValidator(
|
|||
derivationPath = derivationPath,
|
||||
formValues = validatedForm,
|
||||
).getOrElse { e ->
|
||||
Timber.e(e, "Unable to create custom currency")
|
||||
TangemLogger.e("Unable to create custom currency", e)
|
||||
updateStatus(Status.UnexpectedException(e))
|
||||
return
|
||||
}
|
||||
|
|
@ -181,7 +181,7 @@ internal class CustomCurrencyValidator(
|
|||
is CryptoCurrency.Token -> currency.contractAddress
|
||||
},
|
||||
).getOrElse { e ->
|
||||
Timber.e(e, "Unable to check if currency is already added")
|
||||
TangemLogger.e("Unable to check if currency is already added", e)
|
||||
updateStatus(Status.UnexpectedException(e))
|
||||
|
||||
return
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import arrow.core.raise.Raise
|
|||
import arrow.core.raise.either
|
||||
import arrow.core.raise.ensureNotNull
|
||||
import arrow.core.right
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.blockchainsdk.utils.fromNetworkId
|
||||
import com.tangem.domain.account.producer.SingleAccountListProducer
|
||||
|
|
@ -21,7 +22,6 @@ import com.tangem.lib.crypto.derivation.AccountNodeRecognizer
|
|||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
import timber.log.Timber
|
||||
|
||||
internal class CustomTokenFormUseCasesFacade @AssistedInject constructor(
|
||||
@Assisted private val userWalletId: UserWalletId,
|
||||
|
|
@ -84,14 +84,14 @@ internal class CustomTokenFormUseCasesFacade @AssistedInject constructor(
|
|||
val blockchain = Blockchain.fromNetworkId(networkId = currency.network.backendId)
|
||||
if (blockchain == null) {
|
||||
val exception = IllegalStateException("Token has unknown networkId: ${currency.id}")
|
||||
Timber.e(exception)
|
||||
TangemLogger.e("Error", exception)
|
||||
raise(exception)
|
||||
}
|
||||
|
||||
val derivationPathValue = currency.network.derivationPath.value
|
||||
if (derivationPathValue == null) {
|
||||
val exception = IllegalStateException("Token has no derivation path: ${currency.id}")
|
||||
Timber.e(exception)
|
||||
TangemLogger.e("Error", exception)
|
||||
raise(exception)
|
||||
}
|
||||
|
||||
|
|
@ -99,10 +99,9 @@ internal class CustomTokenFormUseCasesFacade @AssistedInject constructor(
|
|||
val index = accountNodeRecognizer.recognize(derivationPathValue)?.toInt()
|
||||
|
||||
if (index == null) {
|
||||
Timber.e(
|
||||
"%s%s",
|
||||
"Unable to determine account index for derivation path: $derivationPathValue. ",
|
||||
"Use main account index instead.",
|
||||
TangemLogger.e(
|
||||
"Unable to determine account index for derivation path: $derivationPathValue. " +
|
||||
"Use main account index instead.",
|
||||
)
|
||||
DerivationIndex.Main.value
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import kotlinx.coroutines.channels.BufferOverflow
|
|||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
|
||||
@Suppress("LongParameterList", "LargeClass")
|
||||
internal class ManageTokensListManager @AssistedInject constructor(
|
||||
|
|
@ -222,7 +222,7 @@ internal class ManageTokensListManager @AssistedInject constructor(
|
|||
scope.launch {
|
||||
useCasesFacade.removeCustomCurrencyUseCase(currency)
|
||||
.onRight { reload() }
|
||||
.onLeft { Timber.e(it) }
|
||||
.onLeft { TangemLogger.e("Error", it) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -266,13 +266,13 @@ internal class ManageTokensListManager @AssistedInject constructor(
|
|||
tempAddedTokens = changedCurrenciesManager.currenciesToAdd.value,
|
||||
tempRemovedTokens = changedCurrenciesManager.currenciesToRemove.value,
|
||||
).getOrElse { throwable ->
|
||||
Timber.e(
|
||||
throwable,
|
||||
TangemLogger.e(
|
||||
"""
|
||||
Failed to check linked tokens
|
||||
|- Mode: $mode
|
||||
|- Network ID: ${network.id}
|
||||
""".trimIndent(),
|
||||
throwable,
|
||||
)
|
||||
|
||||
val message = SnackbarMessage(
|
||||
|
|
@ -292,13 +292,13 @@ internal class ManageTokensListManager @AssistedInject constructor(
|
|||
return useCasesFacade.checkCurrencyUnsupportedUseCase(
|
||||
sourceNetwork = sourceNetwork,
|
||||
).getOrElse { throwable ->
|
||||
Timber.e(
|
||||
throwable,
|
||||
TangemLogger.e(
|
||||
"""
|
||||
Failed to check currency unsupported state
|
||||
|- Mode: $mode
|
||||
|- Source Network: $sourceNetwork
|
||||
""".trimIndent(),
|
||||
throwable,
|
||||
)
|
||||
|
||||
val message = SnackbarMessage(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue