Updated on 2026-08-14
This commit is contained in:
parent
799a38655e
commit
4570bc334c
54 changed files with 178 additions and 183 deletions
|
|
@ -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 ->
|
||||
|
|
|
|||
|
|
@ -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 ->
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue