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.navigation)
|
||||
implementation(projects.core.analytics)
|
||||
implementation(projects.core.analytics.models)
|
||||
implementation(projects.core.utils)
|
||||
|
||||
/** Compose */
|
||||
implementation(tangemDeps.vico.core)
|
||||
|
|
@ -69,7 +70,6 @@ dependencies {
|
|||
/** Other */
|
||||
implementation(deps.decompose)
|
||||
implementation(deps.decompose.ext.compose)
|
||||
implementation(deps.timber)
|
||||
implementation(deps.kotlin.immutable.collections)
|
||||
|
||||
/** DI */
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import com.tangem.utils.transformer.update
|
|||
import kotlinx.collections.immutable.persistentListOf
|
||||
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")
|
||||
|
|
@ -202,7 +202,7 @@ internal class YieldSupplyActiveModel @Inject constructor(
|
|||
}
|
||||
},
|
||||
ifEmpty = {
|
||||
Timber.w("No currency status found: ${cryptoCurrency.id}")
|
||||
TangemLogger.w("No currency status found: ${cryptoCurrency.id}")
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
@ -210,7 +210,7 @@ internal class YieldSupplyActiveModel @Inject constructor(
|
|||
.launchIn(modelScope)
|
||||
},
|
||||
ifLeft = { error ->
|
||||
Timber.w(error.toString())
|
||||
TangemLogger.w(error.toString())
|
||||
return@launch
|
||||
},
|
||||
)
|
||||
|
|
@ -232,7 +232,7 @@ internal class YieldSupplyActiveModel @Inject constructor(
|
|||
apy = TextReference.Str(DASH_SIGN),
|
||||
)
|
||||
}
|
||||
Timber.e("Error loading token status")
|
||||
TangemLogger.e("Error loading token status")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import com.tangem.features.yield.supply.api.entry.YieldSupplyEntryRoute
|
|||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
@ModelScoped
|
||||
|
|
@ -43,7 +43,7 @@ internal class YieldSupplyEntryModel @Inject constructor(
|
|||
singleAccountStatusListSupplier.getSyncOrNull(userWalletId)
|
||||
.getCryptoCurrencyStatus(currency = cryptoCurrency)
|
||||
.onNone {
|
||||
Timber.e("Failed to get CryptoCurrencyStatus: ${cryptoCurrency.id}")
|
||||
TangemLogger.e("Failed to get CryptoCurrencyStatus: ${cryptoCurrency.id}")
|
||||
withContext(dispatchers.mainImmediate) {
|
||||
router.pop()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.features.yield.supply.impl.main.model
|
||||
|
||||
import arrow.core.getOrElse
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import com.tangem.common.routing.AppRoute
|
||||
import com.tangem.common.routing.AppRouter
|
||||
import com.tangem.core.analytics.api.AnalyticsEventHandler
|
||||
|
|
@ -35,7 +36,6 @@ import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
|||
import com.tangem.utils.transformer.update
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import javax.inject.Inject
|
||||
import kotlin.properties.Delegates
|
||||
|
|
@ -100,8 +100,8 @@ internal class YieldSupplyModel @Inject constructor(
|
|||
userWallet = wallet
|
||||
subscribeOnCurrencyStatusUpdates()
|
||||
},
|
||||
ifLeft = {
|
||||
Timber.w(it.toString())
|
||||
ifLeft = { error ->
|
||||
TangemLogger.w(error.toString())
|
||||
return@launch
|
||||
},
|
||||
)
|
||||
|
|
@ -132,7 +132,7 @@ internal class YieldSupplyModel @Inject constructor(
|
|||
onCryptoCurrencyStatusUpdated(cryptoCurrencyStatus)
|
||||
},
|
||||
ifEmpty = {
|
||||
Timber.w("Unable to get crypto currency status: ${cryptoCurrency.id}")
|
||||
TangemLogger.w("Unable to get crypto currency status: ${cryptoCurrency.id}")
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
@ -149,8 +149,8 @@ internal class YieldSupplyModel @Inject constructor(
|
|||
onStartEarningClick = ::onStartEarningClick,
|
||||
),
|
||||
)
|
||||
}.onLeft {
|
||||
Timber.e(it)
|
||||
}.onLeft { error ->
|
||||
TangemLogger.e("Error", error)
|
||||
uiState.update { YieldSupplyUM.Initial }
|
||||
}
|
||||
}
|
||||
|
|
@ -261,7 +261,7 @@ internal class YieldSupplyModel @Inject constructor(
|
|||
}
|
||||
computeAndApplyShowInfoIcon(cryptoCurrencyStatus)
|
||||
}.onLeft { t ->
|
||||
Timber.e(t)
|
||||
TangemLogger.e("Error", t)
|
||||
uiState.update {
|
||||
YieldSupplyUM.Content(
|
||||
title = resourceReference(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.features.yield.supply.impl.subcomponents.approve.model
|
||||
|
||||
import arrow.core.getOrElse
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import com.tangem.blockchain.common.TransactionData
|
||||
import com.tangem.blockchain.common.transaction.TransactionFee
|
||||
import com.tangem.core.analytics.api.AnalyticsEventHandler
|
||||
|
|
@ -12,15 +13,18 @@ import com.tangem.core.decompose.model.ParamsContainer
|
|||
import com.tangem.core.navigation.url.UrlOpener
|
||||
import com.tangem.core.ui.HoldToConfirmButtonFeatureToggles
|
||||
import com.tangem.core.ui.components.currency.icon.converter.CryptoCurrencyToIconStateConverter
|
||||
import com.tangem.core.ui.extensions.*
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.extensions.wrappedList
|
||||
import com.tangem.core.ui.format.bigdecimal.fiat
|
||||
import com.tangem.core.ui.format.bigdecimal.format
|
||||
import com.tangem.domain.account.status.usecase.GetFeePaidCryptoCurrencyStatusSyncUseCase
|
||||
import com.tangem.domain.appcurrency.GetSelectedAppCurrencyUseCase
|
||||
import com.tangem.domain.appcurrency.model.AppCurrency
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.models.currency.CryptoCurrencyStatus
|
||||
import com.tangem.domain.models.wallet.isHotWallet
|
||||
import com.tangem.domain.account.status.usecase.GetFeePaidCryptoCurrencyStatusSyncUseCase
|
||||
import com.tangem.domain.transaction.usecase.CreateApprovalTransactionUseCase
|
||||
import com.tangem.domain.transaction.usecase.GetFeeUseCase
|
||||
import com.tangem.domain.transaction.usecase.SendTransactionUseCase
|
||||
|
|
@ -37,14 +41,12 @@ import com.tangem.features.yield.supply.impl.subcomponents.approve.YieldSupplyAp
|
|||
import com.tangem.features.yield.supply.impl.subcomponents.notifications.YieldSupplyNotificationsComponent
|
||||
import com.tangem.features.yield.supply.impl.subcomponents.notifications.YieldSupplyNotificationsUpdateTrigger
|
||||
import com.tangem.features.yield.supply.impl.subcomponents.notifications.entity.YieldSupplyNotificationData
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.utils.TangemBlogUrlBuilder
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import com.tangem.utils.transformer.update
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
|
|
@ -141,7 +143,7 @@ internal class YieldSupplyApproveModel @Inject constructor(
|
|||
network = cryptoCurrency.network,
|
||||
).fold(
|
||||
ifLeft = { error ->
|
||||
Timber.e(error.toString())
|
||||
TangemLogger.e(error.toString())
|
||||
uiState.update(YieldSupplyTransactionReadyTransformer)
|
||||
analyticsEventHandler.send(
|
||||
YieldSupplyAnalytics.EarnErrors(
|
||||
|
|
@ -219,8 +221,8 @@ internal class YieldSupplyApproveModel @Inject constructor(
|
|||
contractAddress = cryptoCurrency.contractAddress,
|
||||
spenderAddress = contractAddress,
|
||||
amount = null,
|
||||
).getOrElse {
|
||||
Timber.e(it)
|
||||
).getOrElse { error ->
|
||||
TangemLogger.e("Error", error)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.features.yield.supply.impl.subcomponents.startearning.model
|
||||
|
||||
import arrow.core.getOrElse
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import com.tangem.blockchain.common.TransactionSender
|
||||
import com.tangem.core.analytics.api.AnalyticsEventHandler
|
||||
import com.tangem.core.analytics.models.AnalyticsParam
|
||||
|
|
@ -14,13 +15,13 @@ import com.tangem.core.ui.extensions.resourceReference
|
|||
import com.tangem.core.ui.extensions.wrappedList
|
||||
import com.tangem.datasource.local.appsflyer.AppsFlyerStore
|
||||
import com.tangem.domain.account.status.supplier.SingleAccountStatusListSupplier
|
||||
import com.tangem.domain.account.status.usecase.GetFeePaidCryptoCurrencyStatusSyncUseCase
|
||||
import com.tangem.domain.account.status.utils.CryptoCurrencyStatusOperations.getCryptoCurrencyStatus
|
||||
import com.tangem.domain.appcurrency.GetSelectedAppCurrencyUseCase
|
||||
import com.tangem.domain.appcurrency.model.AppCurrency
|
||||
import com.tangem.domain.models.currency.CryptoCurrencyStatus
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.models.wallet.isHotWallet
|
||||
import com.tangem.domain.account.status.usecase.GetFeePaidCryptoCurrencyStatusSyncUseCase
|
||||
import com.tangem.domain.transaction.error.GetFeeError
|
||||
import com.tangem.domain.transaction.usecase.SendTransactionUseCase
|
||||
import com.tangem.domain.wallets.usecase.GetUserWalletUseCase
|
||||
|
|
@ -44,7 +45,6 @@ import com.tangem.utils.extensions.orZero
|
|||
import com.tangem.utils.transformer.update
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import java.math.BigDecimal
|
||||
import javax.inject.Inject
|
||||
import kotlin.properties.Delegates
|
||||
|
|
@ -231,7 +231,7 @@ internal class YieldSupplyStartEarningModel @Inject constructor(
|
|||
sendMode = TransactionSender.MultipleTransactionSendMode.DEFAULT,
|
||||
).fold(
|
||||
ifLeft = { error ->
|
||||
Timber.e(error.toString())
|
||||
TangemLogger.e(error.toString())
|
||||
uiState.update(YieldSupplyTransactionReadyTransformer)
|
||||
analytics.send(
|
||||
YieldSupplyAnalytics.EarnErrors(
|
||||
|
|
@ -323,8 +323,8 @@ internal class YieldSupplyStartEarningModel @Inject constructor(
|
|||
}
|
||||
getCurrenciesStatusUpdates()
|
||||
},
|
||||
ifLeft = {
|
||||
Timber.w(it.toString())
|
||||
ifLeft = { error ->
|
||||
TangemLogger.w(error.toString())
|
||||
showAlertError()
|
||||
},
|
||||
)
|
||||
|
|
@ -362,7 +362,7 @@ internal class YieldSupplyStartEarningModel @Inject constructor(
|
|||
)
|
||||
},
|
||||
ifEmpty = {
|
||||
Timber.w("Unable to get crypto currency status: ${cryptoCurrency.id}")
|
||||
TangemLogger.w("Unable to get crypto currency status: ${cryptoCurrency.id}")
|
||||
showAlertError()
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ import com.tangem.utils.extensions.orZero
|
|||
import com.tangem.utils.transformer.update
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import javax.inject.Inject
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
|
|
@ -153,7 +153,7 @@ internal class YieldSupplyStopEarningModel @Inject constructor(
|
|||
network = cryptoCurrency.network,
|
||||
).fold(
|
||||
ifLeft = { error ->
|
||||
Timber.e(error.toString())
|
||||
TangemLogger.e(error.toString())
|
||||
uiState.update(YieldSupplyTransactionReadyTransformer)
|
||||
analytics.send(
|
||||
YieldSupplyAnalytics.EarnErrors(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue