Updated on 2026-08-14

This commit is contained in:
Tangem 2026-04-10 13:26:27 +04:00
parent 799a38655e
commit 4570bc334c
54 changed files with 178 additions and 183 deletions

View file

@ -183,7 +183,7 @@ internal class CustomTokenFormModel @Inject constructor(
) = modelScope.launch {
val isNeedColdWalletInteraction = coldWalletAndHasMissedDerivationsUseCase.invoke(
userWalletId = params.mode.userWalletId,
networksWithDerivationPath = mapOf(currency.network.backendId to getDerivationPath().value),
networksWithDerivationPath = mapOf(currency.network.rawId to getDerivationPath().value),
)
state.update { state ->

View file

@ -293,7 +293,7 @@ internal class ManageTokensModel @Inject constructor(
val networks = currenciesToAdd.values
.flatten()
.toSet()
.associate { network -> network.backendId to network.derivationPath.value }
.associate { network -> network.rawId to network.derivationPath.value }
val isNeedToInteractWithColdWallet = useCasesFacade.needColdWalletInteraction(networks)
state.update { state ->

View file

@ -212,7 +212,7 @@ internal class OnboardingManageTokensModel @Inject constructor(
val network = currenciesToAdd.values
.flatten()
.toSet()
.associate { network -> network.backendId to network.derivationPath.value }
.associate { network -> network.rawId to network.derivationPath.value }
val shouldShowTangemIcon = useCasesFacade.needColdWalletInteraction(network = network)
state.update { state ->
state.copy(

View file

@ -81,7 +81,7 @@ internal class CustomTokenFormUseCasesFacade @AssistedInject constructor(
private fun CryptoCurrency.getAccountIndex(): Either<Throwable, Int> = either {
val currency = this@getAccountIndex
val blockchain = Blockchain.fromNetworkId(networkId = currency.network.backendId)
val blockchain = Blockchain.fromNetworkId(networkId = currency.network.rawId)
if (blockchain == null) {
val exception = IllegalStateException("Token has unknown networkId: ${currency.id}")
TangemLogger.e("Error", exception)

View file

@ -79,7 +79,7 @@ internal class ManageTokensUseCasesFacade @AssistedInject constructor(
?: return IllegalStateException("Account not found").left()
(account.cryptoCurrencies + added - removed).any { currency ->
currency is CryptoCurrency.Token && currency.network.backendId == network.backendId &&
currency is CryptoCurrency.Token && currency.network.rawId == network.rawId &&
currency.network.derivationPath == network.derivationPath
}
.right()