Updated on 2026-08-14

This commit is contained in:
Tangem 2026-04-13 15:39:33 +04:00
parent 28ed702a51
commit 27e9400b2a
18 changed files with 67 additions and 88 deletions

View file

@ -1,7 +1,7 @@
package com.tangem.data.feedback
import android.os.Build
import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchainsdk.utils.toBlockchain
import com.tangem.core.navigation.email.EmailSender
import com.tangem.data.feedback.converters.BlockchainInfoConverter
import com.tangem.data.feedback.converters.WalletMetaInfoConverter
@ -10,10 +10,10 @@ import com.tangem.datasource.local.walletmanager.WalletManagersStore
import com.tangem.domain.common.wallets.UserWalletsListRepository
import com.tangem.domain.feedback.models.*
import com.tangem.domain.feedback.repository.FeedbackRepository
import com.tangem.domain.models.network.Network
import com.tangem.domain.models.scan.ScanResponse
import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.wallets.usecase.GetSelectedWalletUseCase
import com.tangem.utils.logging.TangemLogger
import com.tangem.utils.version.AppVersionProvider
import kotlinx.coroutines.flow.MutableStateFlow
@ -23,23 +23,20 @@ import java.io.File
/**
* Implementation of [FeedbackRepository]
*
* @property appLogsStore app logs store
* @property userWalletsListManager user wallets list manager
* @property userWalletsListRepository user wallets repository
* @property walletManagersStore wallet managers store
* @property emailSender email sender
* @property appVersionProvider app version provider
* @property appLogsStore app logs store
* @property userWalletsListRepository repository for getting user wallets
* @property walletManagersStore wallet managers store
* @property emailSender email sender
* @property appVersionProvider app version provider
*
[REDACTED_AUTHOR]
*/
@Suppress("LongParameterList")
internal class DefaultFeedbackRepository(
private val appLogsStore: AppLogsStore,
private val userWalletsListRepository: UserWalletsListRepository,
private val walletManagersStore: WalletManagersStore,
private val emailSender: EmailSender,
private val appVersionProvider: AppVersionProvider,
private val getSelectedWalletUseCase: GetSelectedWalletUseCase,
) : FeedbackRepository {
private val blockchainsErrors = MutableStateFlow<Map<UserWalletId, BlockchainErrorInfo>>(emptyMap())
@ -68,16 +65,12 @@ internal class DefaultFeedbackRepository(
.map(BlockchainInfoConverter::convert)
}
override suspend fun getBlockchainInfo(
userWalletId: UserWalletId,
blockchainId: String,
derivationPath: String?,
): BlockchainInfo? {
override suspend fun getBlockchainInfo(userWalletId: UserWalletId, networkId: Network.ID): BlockchainInfo? {
return walletManagersStore
.getSyncOrNull(
userWalletId = userWalletId,
blockchain = Blockchain.fromId(blockchainId),
derivationPath = derivationPath,
blockchain = networkId.toBlockchain(),
derivationPath = networkId.derivationPath.value,
)
?.let(BlockchainInfoConverter::convert)
}
@ -91,7 +84,7 @@ internal class DefaultFeedbackRepository(
}
override fun saveBlockchainErrorInfo(error: BlockchainErrorInfo) {
val userWallet = getSelectedWalletUseCase.sync().getOrNull() ?: error("UserWallet is not selected")
val userWallet = userWalletsListRepository.selectedUserWallet.value ?: error("UserWallet is not selected")
blockchainsErrors.update { map ->
map.toMutableMap().apply {

View file

@ -9,7 +9,6 @@ import com.tangem.datasource.local.walletmanager.WalletManagersStore
import com.tangem.domain.common.wallets.UserWalletsListRepository
import com.tangem.domain.feedback.repository.FeedbackFeatureToggles
import com.tangem.domain.feedback.repository.FeedbackRepository
import com.tangem.domain.wallets.usecase.GetSelectedWalletUseCase
import com.tangem.utils.version.AppVersionProvider
import dagger.Module
import dagger.Provides
@ -29,7 +28,6 @@ internal object FeedbackModule {
walletManagersStore: WalletManagersStore,
emailSender: EmailSender,
appVersionProvider: AppVersionProvider,
getSelectedWalletUseCase: GetSelectedWalletUseCase,
): FeedbackRepository {
return DefaultFeedbackRepository(
appLogsStore = appLogsStore,
@ -37,7 +35,6 @@ internal object FeedbackModule {
emailSender = emailSender,
appVersionProvider = appVersionProvider,
userWalletsListRepository = userWalletsListRepository,
getSelectedWalletUseCase = getSelectedWalletUseCase,
)
}

View file

@ -8,6 +8,7 @@ import com.tangem.blockchain.common.TransactionData
import com.tangem.blockchain.common.TransactionStatus
import com.tangem.blockchain.common.transaction.Fee
import com.tangem.blockchainsdk.utils.fromNetworkId
import com.tangem.blockchainsdk.utils.toBlockchain
import com.tangem.common.extensions.hexToBytes
import com.tangem.common.extensions.toCompressedPublicKey
import com.tangem.data.staking.converters.YieldConverter
@ -244,7 +245,7 @@ internal class DefaultStakeKitRepository(
}
override suspend fun constructTransaction(
networkId: String,
networkId: Network.RawID,
fee: Fee,
amount: Amount,
transactionId: String,
@ -320,8 +321,11 @@ internal class DefaultStakeKitRepository(
}
}
private fun getTransactionDataType(networkId: String, unsignedTransaction: String): TransactionData.Compiled.Data {
return when (Blockchain.fromId(networkId)) {
private fun getTransactionDataType(
networkId: Network.RawID,
unsignedTransaction: String,
): TransactionData.Compiled.Data {
return when (val blockchain = networkId.toBlockchain()) {
Blockchain.Solana,
Blockchain.Cosmos,
-> TransactionData.Compiled.Data.Bytes(unsignedTransaction.hexToBytes())
@ -335,7 +339,7 @@ internal class DefaultStakeKitRepository(
?: error("Failed to parse Tron StakeKit transaction")
TransactionData.Compiled.Data.RawString(tronStakeKitTransaction.rawDataHex)
}
else -> error("Unsupported blockchain")
else -> error("Unsupported blockchain: $blockchain")
}
}

View file

@ -61,7 +61,7 @@ internal class DefaultTransactionRepository(
derivationPath = network.derivationPath.value,
) ?: error("Wallet manager not found")
val extras = txExtras ?: getMemoExtras(networkId = network.rawId, memo)
val extras = txExtras ?: getMemoExtras(networkId = network.id.rawId, memo)
val patchedDestination = if (amount.type is AmountType.TokenYieldSupply) {
walletManager.getYieldModuleAddress()
@ -128,7 +128,7 @@ internal class DefaultTransactionRepository(
destination = destination,
userWalletId = userWalletId,
network = network,
txExtras = getMemoExtras(networkId = network.rawId, memo = memo) ?: extras,
txExtras = getMemoExtras(networkId = network.id.rawId, memo = memo) ?: extras,
)
}
@ -262,7 +262,7 @@ internal class DefaultTransactionRepository(
fee = fee ?: Fee.Common(amount = amount),
destination = destination,
).copy(
extras = getMemoExtras(networkId = network.rawId, memo = memo),
extras = getMemoExtras(networkId = network.id.rawId, memo = memo),
)
validator.validate(transactionData = transactionData)
@ -332,8 +332,8 @@ internal class DefaultTransactionRepository(
}
@Suppress("CyclomaticComplexMethod")
private fun getMemoExtras(networkId: String, memo: String?): TransactionExtras? {
val blockchain = Blockchain.fromId(networkId)
private fun getMemoExtras(networkId: Network.RawID, memo: String?): TransactionExtras? {
val blockchain = networkId.toBlockchain()
if (memo == null) return null
return when (blockchain) {
Blockchain.Stellar -> {

View file

@ -1,11 +1,12 @@
package com.tangem.domain.feedback.models
import com.tangem.domain.models.network.Network
/**
* Information about blockchain's operation error
*
* @property errorMessage message about error
* @property blockchainId blockchain id
* @property derivationPath derivation path
* @property networkId network ID
* @property destinationAddress destination address
* @property tokenSymbol token symbol or null, if it isn't operation with token
* @property amount amount
@ -13,8 +14,7 @@ package com.tangem.domain.feedback.models
*/
data class BlockchainErrorInfo(
val errorMessage: String,
val blockchainId: String,
val derivationPath: String?,
val networkId: Network.ID?,
val destinationAddress: String,
val tokenSymbol: String?,
val amount: String,

View file

@ -1,6 +1,7 @@
package com.tangem.domain.feedback.repository
import com.tangem.domain.feedback.models.*
import com.tangem.domain.models.network.Network
import com.tangem.domain.models.scan.ScanResponse
import com.tangem.domain.models.wallet.UserWalletId
import java.io.File
@ -17,11 +18,7 @@ interface FeedbackRepository {
fun getPhoneInfo(): PhoneInfo
suspend fun getBlockchainInfo(
userWalletId: UserWalletId,
blockchainId: String,
derivationPath: String?,
): BlockchainInfo?
suspend fun getBlockchainInfo(userWalletId: UserWalletId, networkId: Network.ID): BlockchainInfo?
fun saveBlockchainErrorInfo(error: BlockchainErrorInfo)

View file

@ -94,11 +94,10 @@ class EmailMessageBodyResolver(
val userWalletId = requireNotNull(type.walletMetaInfo.userWalletId) { "UserWalletId must be not null" }
val blockchainError = feedbackRepository.getBlockchainErrorInfo(userWalletId = userWalletId)
val blockchainInfo = blockchainError?.let {
val blockchainInfo = blockchainError?.networkId?.let { networkId ->
feedbackRepository.getBlockchainInfo(
userWalletId = userWalletId,
blockchainId = blockchainError.blockchainId,
derivationPath = blockchainError.derivationPath,
networkId = networkId,
)
}
@ -159,11 +158,10 @@ class EmailMessageBodyResolver(
val userWalletId = requireNotNull(walletMetaInfo.userWalletId) { "UserWalletId must be not null" }
val blockchainError = feedbackRepository.getBlockchainErrorInfo(userWalletId = userWalletId)
val blockchainInfo = blockchainError?.let {
val blockchainInfo = blockchainError?.networkId?.let { networkId ->
feedbackRepository.getBlockchainInfo(
userWalletId = userWalletId,
blockchainId = blockchainError.blockchainId,
derivationPath = blockchainError.derivationPath,
networkId = networkId,
)
}
@ -181,11 +179,10 @@ class EmailMessageBodyResolver(
val userWalletId = requireNotNull(type.walletMetaInfo.userWalletId) { "UserWalletId must be not null" }
val blockchainError = feedbackRepository.getBlockchainErrorInfo(userWalletId = userWalletId)
val blockchainInfo = blockchainError?.let {
val blockchainInfo = blockchainError?.networkId?.let { networkId ->
feedbackRepository.getBlockchainInfo(
userWalletId = userWalletId,
blockchainId = blockchainError.blockchainId,
derivationPath = blockchainError.derivationPath,
networkId = networkId,
)
}
@ -210,11 +207,10 @@ class EmailMessageBodyResolver(
val userWalletId = requireNotNull(type.walletMetaInfo.userWalletId) { "UserWalletId must be not null" }
val blockchainError = feedbackRepository.getBlockchainErrorInfo(userWalletId = userWalletId)
val blockchainInfo = blockchainError?.let {
val blockchainInfo = blockchainError?.networkId?.let { networkId ->
feedbackRepository.getBlockchainInfo(
userWalletId = userWalletId,
blockchainId = blockchainError.blockchainId,
derivationPath = blockchainError.derivationPath,
networkId = networkId,
)
}

View file

@ -4,10 +4,11 @@ import arrow.core.Either
import com.tangem.blockchain.common.Amount
import com.tangem.blockchain.common.TransactionData
import com.tangem.blockchain.common.transaction.Fee
import com.tangem.domain.models.network.Network
import com.tangem.domain.staking.model.stakekit.StakingError
import com.tangem.domain.staking.model.stakekit.transaction.StakingTransaction
import com.tangem.domain.staking.repositories.StakingErrorResolver
import com.tangem.domain.staking.repositories.StakeKitRepository
import com.tangem.domain.staking.repositories.StakingErrorResolver
class GetConstructedStakingTransactionUseCase(
private val stakeKitRepository: StakeKitRepository,
@ -15,7 +16,7 @@ class GetConstructedStakingTransactionUseCase(
) {
suspend operator fun invoke(
networkId: String,
networkId: Network.RawID,
fee: Fee,
amount: Amount,
transactionId: String,

View file

@ -5,11 +5,11 @@ import com.tangem.blockchain.common.TransactionData
import com.tangem.blockchain.common.transaction.Fee
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.network.Network
import com.tangem.domain.models.staking.NetworkType
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.staking.model.StakingAvailability
import com.tangem.domain.staking.model.StakingEntryInfo
import com.tangem.domain.staking.model.StakingIntegrationID
import com.tangem.domain.models.staking.NetworkType
import com.tangem.domain.staking.model.stakekit.Yield
import com.tangem.domain.staking.model.stakekit.action.StakingAction
import com.tangem.domain.staking.model.stakekit.action.StakingActionStatus
@ -55,7 +55,7 @@ interface StakeKitRepository {
suspend fun estimateGas(userWalletId: UserWalletId, network: Network, params: ActionParams): StakingGasEstimate
suspend fun constructTransaction(
networkId: String,
networkId: Network.RawID,
fee: Fee,
amount: Amount,
transactionId: String,

View file

@ -74,10 +74,10 @@ import com.tangem.features.send.v2.subcomponents.amount.SendAmountReduceTrigger
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import com.tangem.utils.extensions.orZero
import com.tangem.utils.extensions.stripZeroPlainString
import com.tangem.utils.logging.TangemLogger
import com.tangem.utils.transformer.update
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.launch
import com.tangem.utils.logging.TangemLogger
import java.math.BigDecimal
import javax.inject.Inject
import com.tangem.features.send.v2.api.entity.FeeSelectorUM as FeeSelectorUMRedesigned
@ -281,8 +281,7 @@ internal class SendConfirmModel @Inject constructor(
saveBlockchainErrorUseCase(
error = BlockchainErrorInfo(
errorMessage = errorMessage,
blockchainId = cryptoCurrency.network.rawId,
derivationPath = cryptoCurrency.network.derivationPath.value,
networkId = cryptoCurrency.network.id,
destinationAddress = confirmData.enteredDestination.orEmpty(),
tokenSymbol = if (amount?.type is AmountType.Token) {
amount.currencySymbol

View file

@ -18,6 +18,7 @@ import com.tangem.core.decompose.navigation.Router
import com.tangem.core.ui.utils.parseBigDecimal
import com.tangem.core.ui.utils.parseBigDecimalOrNull
import com.tangem.domain.account.status.usecase.GetAccountCurrencyStatusUseCase
import com.tangem.domain.account.status.usecase.GetFeePaidCryptoCurrencyStatusSyncUseCase
import com.tangem.domain.account.usecase.IsAccountsModeEnabledUseCase
import com.tangem.domain.appcurrency.GetSelectedAppCurrencyUseCase
import com.tangem.domain.appcurrency.model.AppCurrency
@ -33,7 +34,6 @@ import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.qrscanning.models.SourceType
import com.tangem.domain.qrscanning.usecases.ListenToQrScanningUseCase
import com.tangem.domain.qrscanning.usecases.ParseQrCodeUseCase
import com.tangem.domain.account.status.usecase.GetFeePaidCryptoCurrencyStatusSyncUseCase
import com.tangem.domain.transaction.error.GetFeeError
import com.tangem.domain.transaction.models.TransactionFeeExtended
import com.tangem.domain.transaction.usecase.CreateTransferTransactionUseCase
@ -65,9 +65,9 @@ import com.tangem.features.send.v2.subcomponents.destination.model.transformers.
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import com.tangem.utils.coroutines.JobHolder
import com.tangem.utils.coroutines.saveIn
import com.tangem.utils.logging.TangemLogger
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.launch
import com.tangem.utils.logging.TangemLogger
import javax.inject.Inject
import kotlin.properties.Delegates
@ -528,8 +528,7 @@ internal class SendModel @Inject constructor(
saveBlockchainErrorUseCase(
error = BlockchainErrorInfo(
errorMessage = errorMessage.orEmpty(),
blockchainId = cryptoCurrency.network.rawId,
derivationPath = cryptoCurrency.network.derivationPath.value,
networkId = cryptoCurrency.network.id,
destinationAddress = "",
tokenSymbol = "",
amount = "",

View file

@ -20,13 +20,13 @@ import com.tangem.core.ui.HoldToConfirmButtonFeatureToggles
import com.tangem.core.ui.extensions.TextReference
import com.tangem.core.ui.extensions.resourceReference
import com.tangem.core.ui.extensions.stringReference
import com.tangem.domain.models.wallet.isHotWallet
import com.tangem.datasource.local.nft.converter.NFTSdkAssetConverter
import com.tangem.domain.feedback.GetWalletMetaInfoUseCase
import com.tangem.domain.feedback.SaveBlockchainErrorUseCase
import com.tangem.domain.feedback.SendFeedbackEmailUseCase
import com.tangem.domain.feedback.models.BlockchainErrorInfo
import com.tangem.domain.feedback.models.FeedbackEmailType
import com.tangem.domain.models.wallet.isHotWallet
import com.tangem.domain.settings.IsSendTapHelpEnabledUseCase
import com.tangem.domain.settings.NeverShowTapHelpUseCase
import com.tangem.domain.transaction.usecase.CreateNFTTransferTransactionUseCase
@ -57,10 +57,10 @@ import com.tangem.features.send.v2.sendnft.confirm.model.transformers.NFTSendCon
import com.tangem.features.send.v2.sendnft.ui.state.NFTSendUM
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import com.tangem.utils.extensions.stripZeroPlainString
import com.tangem.utils.logging.TangemLogger
import com.tangem.utils.transformer.update
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.launch
import com.tangem.utils.logging.TangemLogger
import java.math.BigDecimal
import javax.inject.Inject
import com.tangem.features.send.v2.api.entity.FeeSelectorUM as FeeSelectorUMRedesigned
@ -197,8 +197,7 @@ internal class NFTSendConfirmModel @Inject constructor(
saveBlockchainErrorUseCase(
error = BlockchainErrorInfo(
errorMessage = errorMessage,
blockchainId = cryptoCurrency.network.rawId,
derivationPath = cryptoCurrency.network.derivationPath.value,
networkId = cryptoCurrency.network.id,
destinationAddress = confirmData.enteredDestination.orEmpty(),
tokenSymbol = null,
amount = params.nftAsset.amount?.toString().orEmpty(),
@ -379,7 +378,7 @@ internal class NFTSendConfirmModel @Inject constructor(
flow = uiState,
flow2 = params.currentRoute,
transform = { state, route -> state to route },
).onEach { (state, route) ->
).onEach { (state, _) ->
val confirmUM = state.confirmUM
params.callback.onResult(
state.copy(

View file

@ -15,6 +15,7 @@ import com.tangem.core.decompose.model.ParamsContainer
import com.tangem.core.decompose.navigation.Router
import com.tangem.datasource.local.nft.converter.NFTSdkAssetConverter
import com.tangem.domain.account.status.usecase.GetAccountCurrencyStatusUseCase
import com.tangem.domain.account.status.usecase.GetFeePaidCryptoCurrencyStatusSyncUseCase
import com.tangem.domain.account.usecase.IsAccountsModeEnabledUseCase
import com.tangem.domain.appcurrency.GetSelectedAppCurrencyUseCase
import com.tangem.domain.appcurrency.model.AppCurrency
@ -27,7 +28,6 @@ import com.tangem.domain.models.account.Account
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.currency.CryptoCurrencyStatus
import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.account.status.usecase.GetFeePaidCryptoCurrencyStatusSyncUseCase
import com.tangem.domain.tokens.MultiWalletCryptoCurrenciesProducer
import com.tangem.domain.tokens.MultiWalletCryptoCurrenciesSupplier
import com.tangem.domain.transaction.error.GetFeeError
@ -223,8 +223,7 @@ internal class NFTSendModel @Inject constructor(
saveBlockchainErrorUseCase(
error = BlockchainErrorInfo(
errorMessage = errorMessage.orEmpty(),
blockchainId = cryptoCurrency.network.rawId,
derivationPath = cryptoCurrency.network.derivationPath.value,
networkId = cryptoCurrency.network.id,
destinationAddress = "",
tokenSymbol = null,
amount = "",

View file

@ -2,6 +2,9 @@ package com.tangem.features.staking.impl.presentation.model
import androidx.compose.runtime.Stable
import arrow.core.getOrElse
import com.arkivanov.decompose.router.slot.SlotNavigation
import com.arkivanov.decompose.router.slot.activate
import com.arkivanov.decompose.router.slot.dismiss
import com.tangem.blockchain.common.TransactionData
import com.tangem.blockchain.common.transaction.Fee
import com.tangem.blockchain.common.transaction.TransactionFee
@ -10,13 +13,8 @@ import com.tangem.common.routing.AppRouter
import com.tangem.common.ui.amountScreen.converters.AmountReduceByTransformer.ReduceByData
import com.tangem.common.ui.amountScreen.models.AmountState
import com.tangem.common.ui.amountScreen.models.EnterAmountBoundary
import com.arkivanov.decompose.router.slot.SlotNavigation
import com.arkivanov.decompose.router.slot.activate
import com.arkivanov.decompose.router.slot.dismiss
import com.tangem.common.ui.bottomsheet.permission.state.ApproveType
import com.tangem.common.ui.bottomsheet.permission.state.GiveTxPermissionBottomSheetConfig
import com.tangem.features.approval.api.GiveApprovalComponent
import com.tangem.features.approval.api.GiveApprovalFeatureToggles
import com.tangem.common.ui.notifications.NotificationUM
import com.tangem.core.analytics.api.AnalyticsEventHandler
import com.tangem.core.analytics.api.ParamsInterceptorHolder
@ -36,11 +34,11 @@ import com.tangem.core.ui.haptic.TangemHapticEffect
import com.tangem.core.ui.haptic.VibratorHapticManager
import com.tangem.core.ui.message.DialogMessage
import com.tangem.domain.account.status.usecase.GetAccountCurrencyStatusUseCase
import com.tangem.domain.account.status.usecase.GetFeePaidCryptoCurrencyStatusSyncUseCase
import com.tangem.domain.account.usecase.IsAccountsModeEnabledUseCase
import com.tangem.domain.appcurrency.GetSelectedAppCurrencyUseCase
import com.tangem.domain.appcurrency.model.AppCurrency
import com.tangem.domain.balancehiding.GetBalanceHidingSettingsUseCase
import com.tangem.utils.coroutines.AppCoroutineScope
import com.tangem.domain.feedback.GetWalletMetaInfoUseCase
import com.tangem.domain.feedback.SaveBlockchainErrorUseCase
import com.tangem.domain.feedback.SendFeedbackEmailUseCase
@ -61,12 +59,13 @@ import com.tangem.domain.staking.model.stakekit.action.StakingAction
import com.tangem.domain.staking.model.stakekit.action.StakingActionCommonType
import com.tangem.domain.staking.model.stakekit.transaction.StakingTransaction
import com.tangem.domain.staking.repositories.P2PEthPoolRepository
import com.tangem.domain.account.status.usecase.GetFeePaidCryptoCurrencyStatusSyncUseCase
import com.tangem.domain.tokens.*
import com.tangem.domain.transaction.error.GetFeeError
import com.tangem.domain.transaction.usecase.*
import com.tangem.domain.utils.convertToSdkAmount
import com.tangem.domain.wallets.usecase.GetUserWalletUseCase
import com.tangem.features.approval.api.GiveApprovalComponent
import com.tangem.features.approval.api.GiveApprovalFeatureToggles
import com.tangem.features.staking.api.StakingComponent
import com.tangem.features.staking.impl.R
import com.tangem.features.staking.impl.analytics.StakingParamsInterceptor
@ -100,13 +99,13 @@ import com.tangem.utils.TangemBlogUrlBuilder.RESOURCE_TO_LEARN_ABOUT_APPROVING_I
import com.tangem.utils.coroutines.*
import com.tangem.utils.extensions.isSingleItem
import com.tangem.utils.extensions.orZero
import com.tangem.utils.logging.TangemLogger
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import com.tangem.utils.logging.TangemLogger
import java.math.BigDecimal
import java.util.concurrent.CopyOnWriteArrayList
import javax.inject.Inject
@ -1067,8 +1066,7 @@ internal class StakingModel @Inject constructor(
saveBlockchainErrorUseCase(
error = BlockchainErrorInfo(
errorMessage = errorMessage,
blockchainId = network.rawId,
derivationPath = network.derivationPath.value,
networkId = network.id,
destinationAddress = target?.address.orEmpty(),
tokenSymbol = (cryptoCurrencyStatus.currency as? CryptoCurrency.Token)?.symbol,
amount = amount?.run { value?.toPlainString() + currencySymbol }.orEmpty(),

View file

@ -33,13 +33,13 @@ import com.tangem.features.staking.impl.presentation.state.StakingUiState
import com.tangem.features.staking.impl.presentation.state.utils.checkAndCalculateSubtractedAmount
import com.tangem.features.staking.impl.presentation.state.utils.isCompositePendingActions
import com.tangem.utils.extensions.orZero
import com.tangem.utils.logging.TangemLogger
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.coroutineScope
import com.tangem.utils.logging.TangemLogger
import java.math.BigDecimal
@Suppress("LongParameterList")
@ -165,7 +165,7 @@ internal class StakeKitTransactionSender @AssistedInject constructor(
?.map { transaction ->
async {
getConstructedStakingTransactionUseCase(
networkId = cryptoCurrencyStatus.currency.network.rawId,
networkId = cryptoCurrencyStatus.currency.network.id.rawId,
fee = fee,
amount = amount.convertToSdkAmount(cryptoCurrencyStatus),
transactionId = transaction.id,

View file

@ -75,8 +75,7 @@ internal class SwapAlertFactory @Inject constructor(
saveBlockchainErrorUseCase(
error = BlockchainErrorInfo(
errorMessage = errorMessage.orEmpty(),
blockchainId = cryptoCurrency?.network?.rawId.orEmpty(),
derivationPath = cryptoCurrency?.network?.derivationPath?.value.orEmpty(),
networkId = cryptoCurrency?.network?.id,
destinationAddress = confirmData?.enteredDestination.orEmpty(),
tokenSymbol = confirmData?.toCryptoCurrencyStatus?.currency?.symbol.orEmpty(),
amount = confirmData?.enteredFromAmount?.toString().orEmpty(),

View file

@ -2112,8 +2112,7 @@ internal class SwapModel @Inject constructor(
saveBlockchainErrorUseCase(
error = BlockchainErrorInfo(
errorMessage = errorMessage,
blockchainId = network.rawId,
derivationPath = network.derivationPath.value,
networkId = network.id,
destinationAddress = transaction?.txTo.orEmpty(),
tokenSymbol = fromCurrencyStatus.currency.symbol,
amount = dataState.amount.orEmpty(),

View file

@ -61,8 +61,7 @@ class YieldSupplyAlertFactory @Inject constructor(
saveBlockchainErrorUseCase(
error = BlockchainErrorInfo(
errorMessage = errorMessage.orEmpty(),
blockchainId = cryptoCurrency?.network?.rawId.orEmpty(),
derivationPath = cryptoCurrency?.network?.derivationPath?.value.orEmpty(),
networkId = cryptoCurrency?.network?.id,
tokenSymbol = cryptoCurrency?.symbol.orEmpty(),
destinationAddress = "",
amount = "",