Updated on 2026-08-14
This commit is contained in:
parent
8b75e37e30
commit
a9bca131c3
386 changed files with 1369 additions and 1347 deletions
|
|
@ -31,7 +31,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
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
internal class DefaultTokenDetailsDeepLinkHandler @AssistedInject constructor(
|
||||
|
|
@ -66,18 +66,18 @@ internal class DefaultTokenDetailsDeepLinkHandler @AssistedInject constructor(
|
|||
val userWallet = userWalletId?.let { getUserWalletUseCase(userWalletId) }?.getOrNull()
|
||||
// If wallet to select is null or locked, ignore deeplink
|
||||
if (userWallet == null || userWallet.isLocked) {
|
||||
Timber.e("Error on getting user wallet")
|
||||
TangemLogger.e("Error on getting user wallet")
|
||||
return@launch
|
||||
}
|
||||
if (selectWalletUseCase(userWalletId).getOrNull() == null) {
|
||||
Timber.e("Error on selecting user wallet")
|
||||
TangemLogger.e("Error on selecting user wallet")
|
||||
return@launch
|
||||
}
|
||||
|
||||
val cryptoCurrency = findCryptoCurrency(userWallet = userWallet, networkId = networkId, tokenId = tokenId)
|
||||
|
||||
if (cryptoCurrency == null) {
|
||||
Timber.e(
|
||||
TangemLogger.e(
|
||||
"""
|
||||
Could not get crypto currency for
|
||||
|- $NETWORK_ID_KEY: $networkId
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import androidx.compose.runtime.Stable
|
|||
import arrow.core.getOrElse
|
||||
import arrow.core.merge
|
||||
import arrow.core.right
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import com.arkivanov.decompose.router.slot.SlotNavigation
|
||||
import com.arkivanov.decompose.router.slot.activate
|
||||
import com.arkivanov.decompose.router.slot.dismiss
|
||||
|
|
@ -103,7 +104,6 @@ import kotlinx.coroutines.async
|
|||
import kotlinx.coroutines.awaitAll
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
@Suppress("LongParameterList", "LargeClass", "TooManyFunctions", "PropertyUsedBeforeDeclaration")
|
||||
|
|
@ -499,11 +499,9 @@ internal class TokenDetailsModel @Inject constructor(
|
|||
),
|
||||
)
|
||||
|
||||
Timber.e(
|
||||
/* t = */ throwable,
|
||||
/* message = */ "Unable to get wallet manager for user wallet %s and network %s",
|
||||
/* ...args = */ userWalletId,
|
||||
cryptoCurrency.network,
|
||||
TangemLogger.e(
|
||||
"Unable to get wallet manager for user wallet $userWalletId and network ${cryptoCurrency.network}",
|
||||
throwable,
|
||||
)
|
||||
|
||||
false
|
||||
|
|
@ -655,7 +653,7 @@ internal class TokenDetailsModel @Inject constructor(
|
|||
cryptoCurrency.network,
|
||||
).fold(
|
||||
ifLeft = { throwable ->
|
||||
Timber.e(throwable.cause?.localizedMessage.orEmpty())
|
||||
TangemLogger.e(throwable.cause?.localizedMessage.orEmpty())
|
||||
""
|
||||
},
|
||||
ifRight = { it },
|
||||
|
|
@ -756,12 +754,12 @@ internal class TokenDetailsModel @Inject constructor(
|
|||
val accountId = account?.accountId
|
||||
|
||||
if (accountId == null) {
|
||||
Timber.e("Account ID is null, cannot hide currency ${cryptoCurrency.id}")
|
||||
TangemLogger.e("Account ID is null, cannot hide currency ${cryptoCurrency.id}")
|
||||
return@launch
|
||||
}
|
||||
|
||||
manageCryptoCurrenciesUseCase(accountId = accountId, remove = cryptoCurrency)
|
||||
.onLeft { Timber.e(it) }
|
||||
.onLeft { TangemLogger.e("Error", it) }
|
||||
.onRight { router.popBackStack() }
|
||||
}
|
||||
}
|
||||
|
|
@ -830,7 +828,7 @@ internal class TokenDetailsModel @Inject constructor(
|
|||
txHash = txHash,
|
||||
currency = cryptoCurrency,
|
||||
).fold(
|
||||
ifLeft = { Timber.e(it.toString()) },
|
||||
ifLeft = { TangemLogger.e(it.toString()) },
|
||||
ifRight = { router.openUrl(url = it) },
|
||||
)
|
||||
}
|
||||
|
|
@ -960,7 +958,7 @@ internal class TokenDetailsModel @Inject constructor(
|
|||
}
|
||||
if (message != null) {
|
||||
internalUiState.value = stateFactory.getStateWithErrorDialog(stringReference(message))
|
||||
Timber.e(message)
|
||||
TangemLogger.e(message)
|
||||
}
|
||||
},
|
||||
ifRight = {
|
||||
|
|
@ -1033,7 +1031,7 @@ internal class TokenDetailsModel @Inject constructor(
|
|||
internalUiState.value = stateFactory.getStateWithErrorDialog(
|
||||
stringReference(e.message.orEmpty()),
|
||||
)
|
||||
Timber.e(e.message)
|
||||
TangemLogger.e("Error: $e")
|
||||
},
|
||||
ifRight = {
|
||||
internalUiState.value = stateFactory.getStateWithRemovedKaspaIncompleteTransactionNotification()
|
||||
|
|
@ -1068,7 +1066,7 @@ internal class TokenDetailsModel @Inject constructor(
|
|||
internalUiState.value = stateFactory.getStateWithErrorDialog(
|
||||
stringReference(e.message.orEmpty()),
|
||||
)
|
||||
Timber.e(e.message)
|
||||
TangemLogger.e("Error: $e")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -1141,7 +1139,7 @@ internal class TokenDetailsModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun showStakingUnavailable() {
|
||||
Timber.e("Staking is unavailable for ${cryptoCurrency.name}")
|
||||
TangemLogger.e("Staking is unavailable for ${cryptoCurrency.name}")
|
||||
uiMessageSender.send(SnackbarMessage(resourceReference(R.string.staking_error_no_validators_title)))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import com.tangem.utils.converter.Converter
|
|||
import com.tangem.utils.extensions.removeBy
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import java.math.BigDecimal
|
||||
import kotlin.String
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ internal class TokenDetailsNotificationConverter(
|
|||
maxManaBalanceAmount = warning.maxAmount?.let {
|
||||
formatMana(it)
|
||||
} ?: run {
|
||||
Timber.e("FeeResource maxAmount cannot be null in Koinos. Check KoinosWalletManager")
|
||||
TangemLogger.e("FeeResource maxAmount cannot be null in Koinos. Check KoinosWalletManager")
|
||||
""
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import com.tangem.lib.crypto.BlockchainUtils.isStakingRewardUnavailable
|
|||
import com.tangem.utils.Provider
|
||||
import com.tangem.utils.converter.Converter
|
||||
import com.tangem.utils.isNullOrZero
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import java.math.BigDecimal
|
||||
|
||||
internal class TokenDetailsStakingInfoConverter(
|
||||
|
|
@ -46,7 +46,9 @@ internal class TokenDetailsStakingInfoConverter(
|
|||
state: TokenDetailsState,
|
||||
stakingAvailability: StakingAvailability,
|
||||
): StakingBlockUM? {
|
||||
Timber.i("Define staking block for [${status.currency.id.value}] with availability:\n$stakingAvailability")
|
||||
TangemLogger.i(
|
||||
"Define staking block for [${status.currency.id.value}] with availability:\n$stakingAvailability",
|
||||
)
|
||||
return when (stakingAvailability) {
|
||||
StakingAvailability.TemporaryUnavailable -> StakingBlockUM.TemporaryUnavailable
|
||||
StakingAvailability.Unavailable -> null
|
||||
|
|
@ -73,7 +75,7 @@ internal class TokenDetailsStakingInfoConverter(
|
|||
|
||||
val iconState = state.tokenInfoBlockState.iconState
|
||||
|
||||
Timber.i(
|
||||
TangemLogger.i(
|
||||
"""
|
||||
getStakingInfoBlock:
|
||||
– stakingBalance: ${stakingBalance ?: "null"}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import kotlinx.collections.immutable.ImmutableList
|
|||
import kotlinx.collections.immutable.PersistentList
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.collections.immutable.toPersistentList
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import java.math.BigDecimal
|
||||
import java.util.Locale
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ internal class TokenDetailsSwapTransactionsStateConverter(
|
|||
|
||||
fun updateTxStatus(tx: ExchangeUM, statusModel: ExchangeStatusModel): ExchangeUM {
|
||||
if (tx.activeStatus == statusModel.status && tx.hasLongTime == statusModel.hasLongTime) {
|
||||
Timber.e("UpdateTxStatus isn't required. Current status isn't changed")
|
||||
TangemLogger.e("UpdateTxStatus isn't required. Current status isn't changed")
|
||||
return tx
|
||||
}
|
||||
val hasFailed = statusModel.status.isFailed()
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import kotlinx.collections.immutable.persistentListOf
|
|||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.conflate
|
||||
import kotlinx.coroutines.flow.map
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
internal class ExchangeStatusFactory @AssistedInject constructor(
|
||||
|
|
@ -127,7 +127,7 @@ internal class ExchangeStatusFactory @AssistedInject constructor(
|
|||
type = provider.type,
|
||||
)
|
||||
} else {
|
||||
Timber.e("Account ID is null, cannot add refund currency ${cryptoCurrency.id}")
|
||||
TangemLogger.e("Account ID is null, cannot add refund currency ${cryptoCurrency.id}")
|
||||
null
|
||||
}
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ internal class ExchangeStatusFactory @AssistedInject constructor(
|
|||
contractAddress = refundContractAddress,
|
||||
networkId = refundNetwork,
|
||||
)
|
||||
.onLeft(Timber::e)
|
||||
.onLeft { TangemLogger.e("Error", it) }
|
||||
.getOrNull()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.feature.tokendetails.presentation.tokendetails.state.factory.express
|
||||
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import com.tangem.common.ui.expressStatus.ExpressStatusBottomSheetConfig
|
||||
import com.tangem.common.ui.expressStatus.state.ExpressTransactionStateUM
|
||||
import com.tangem.common.ui.expressStatus.state.ExpressTransactionsBlockState
|
||||
|
|
@ -25,7 +26,6 @@ import dagger.assisted.AssistedInject
|
|||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.map
|
||||
import timber.log.Timber
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
internal class OnrampStatusFactory @AssistedInject constructor(
|
||||
|
|
@ -83,8 +83,8 @@ internal class OnrampStatusFactory @AssistedInject constructor(
|
|||
onrampTx
|
||||
} else {
|
||||
getOnrampStatusUseCase(userWallet = userWallet, onrampTx.info.txId).fold(
|
||||
ifLeft = {
|
||||
Timber.e("Couldn't update onramp status. $it")
|
||||
ifLeft = { error ->
|
||||
TangemLogger.e("Couldn't update onramp status. $error")
|
||||
onrampTx
|
||||
},
|
||||
ifRight = { statusModel ->
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import kotlinx.collections.immutable.persistentListOf
|
|||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.conflate
|
||||
import kotlinx.coroutines.flow.map
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import kotlin.coroutines.cancellation.CancellationException
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
|
|
@ -128,7 +128,7 @@ internal class TokenDetailsExchangeStatusFactory @AssistedInject constructor(
|
|||
type = provider.type,
|
||||
)
|
||||
} else {
|
||||
Timber.e("Account ID is null, cannot add refund currency ${cryptoCurrency.id}")
|
||||
TangemLogger.e("Account ID is null, cannot add refund currency ${cryptoCurrency.id}")
|
||||
null
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ internal class TokenDetailsExchangeStatusFactory @AssistedInject constructor(
|
|||
contractAddress = refundContractAddress,
|
||||
networkId = refundNetwork,
|
||||
)
|
||||
.onLeft(Timber::e)
|
||||
.onLeft { TangemLogger.e("Error", it) }
|
||||
.getOrNull()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import dagger.assisted.AssistedInject
|
|||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.map
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
internal class TokenDetailsOnrampStatusFactory @AssistedInject constructor(
|
||||
|
|
@ -84,7 +84,7 @@ internal class TokenDetailsOnrampStatusFactory @AssistedInject constructor(
|
|||
} else {
|
||||
getOnrampStatusUseCase(userWallet = userWallet, onrampTx.info.txId).fold(
|
||||
ifLeft = { error ->
|
||||
Timber.e("Couldn't update onramp status. $error")
|
||||
TangemLogger.e("Couldn't update onramp status. $error")
|
||||
onrampTx
|
||||
},
|
||||
ifRight = { statusModel ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue