Updated on 2026-08-14

This commit is contained in:
Tangem 2023-08-29 14:23:29 +03:00
parent 6004b030a7
commit 22e49995df
5 changed files with 32 additions and 11 deletions

View file

@ -1,5 +1,6 @@
package com.tangem.tap.proxy
import com.tangem.blockchain.blockchains.cardano.CardanoUtils
import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchain.common.Token
import com.tangem.common.CompletionResult
@ -171,7 +172,7 @@ class DerivationManagerImpl(
it.blockchain.getSupportedCurves().contains(curve)
}.mapNotNull { it.derivationPath }.map { DerivationPath(it) }
val bothCandidates = (manageTokensCandidates + customTokensCandidates).distinct()
val bothCandidates = (manageTokensCandidates + customTokensCandidates).distinct().toMutableList()
if (bothCandidates.isEmpty()) return null
val mapKeyOfWalletPublicKey = wallet.publicKey.toMapKey()
@ -182,6 +183,12 @@ class DerivationManagerImpl(
val toDerive = bothCandidates.filterNot { alreadyDerivedPaths.contains(it) }
if (toDerive.isEmpty()) return null
currencyList.find { it is com.tangem.tap.features.wallet.models.Currency.Blockchain && it.blockchain == Blockchain.Cardano } ?.let { currency ->
currency.derivationPath?.let {
bothCandidates.add(CardanoUtils.extendedDerivationPath(DerivationPath(it)))
}
}
return DerivationData(
derivations = mapKeyOfWalletPublicKey to toDerive,
)