Updated on 2026-08-14
This commit is contained in:
parent
0b81b905c3
commit
50332186fa
47 changed files with 38 additions and 408 deletions
|
|
@ -11,7 +11,6 @@ import com.tangem.crypto.hdWallet.DerivationPath
|
|||
import com.tangem.data.common.network.NetworkFactory
|
||||
import com.tangem.data.wallets.derivations.Derivations
|
||||
import com.tangem.data.wallets.derivations.MissedDerivationsFinder
|
||||
import com.tangem.domain.dynamicaddresses.DynamicAddressesFeatureToggles
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.models.network.Network
|
||||
import com.tangem.domain.models.scan.ScanResponse
|
||||
|
|
@ -31,7 +30,6 @@ internal class DefaultColdMapDerivationsRepository @Inject constructor(
|
|||
private val tangemSdkManager: TangemSdkManager,
|
||||
private val networkFactory: NetworkFactory,
|
||||
private val dispatchers: CoroutineDispatcherProvider,
|
||||
private val dynamicAddressesFeatureToggles: DynamicAddressesFeatureToggles,
|
||||
) : ColdMapDerivationsRepository {
|
||||
|
||||
override suspend fun derivePublicKeys(
|
||||
|
|
@ -66,7 +64,7 @@ internal class DefaultColdMapDerivationsRepository @Inject constructor(
|
|||
return@withContext userWallet
|
||||
}
|
||||
|
||||
val derivations = MissedDerivationsFinder(userWallet, dynamicAddressesFeatureToggles.isDynamicAddressesEnabled)
|
||||
val derivations = MissedDerivationsFinder(userWallet, isDynamicAddressesEnabled = true)
|
||||
.findByNetworks(networks)
|
||||
.ifEmpty {
|
||||
TangemLogger.d("Nothing to derive")
|
||||
|
|
@ -110,7 +108,7 @@ internal class DefaultColdMapDerivationsRepository @Inject constructor(
|
|||
networksWithDerivationPath: Map<BackendId, String?>,
|
||||
): Boolean = withContext(dispatchers.io) {
|
||||
val derivations =
|
||||
MissedDerivationsFinder(userWallet, dynamicAddressesFeatureToggles.isDynamicAddressesEnabled)
|
||||
MissedDerivationsFinder(userWallet, isDynamicAddressesEnabled = true)
|
||||
.findByNetworks(
|
||||
networksWithDerivationPath.mapNotNull { (backendId, extraDerivationPath) ->
|
||||
networkFactory.create(
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import com.tangem.crypto.hdWallet.DerivationPath
|
|||
import com.tangem.data.common.network.NetworkFactory
|
||||
import com.tangem.data.wallets.derivations.MissedDerivationsFinder
|
||||
import com.tangem.domain.common.wallets.UserWalletsListRepository
|
||||
import com.tangem.domain.dynamicaddresses.DynamicAddressesFeatureToggles
|
||||
import com.tangem.domain.common.wallets.getSyncStrict
|
||||
import com.tangem.domain.models.account.DerivationIndex
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
|
|
@ -29,7 +28,6 @@ internal class DefaultHotMapDerivationsRepository @Inject constructor(
|
|||
private val networkFactory: NetworkFactory,
|
||||
private val hotWalletAccessor: HotWalletAccessor,
|
||||
private val dispatchers: CoroutineDispatcherProvider,
|
||||
private val dynamicAddressesFeatureToggles: DynamicAddressesFeatureToggles,
|
||||
) : HotMapDerivationsRepository {
|
||||
|
||||
override suspend fun derivePublicKeys(
|
||||
|
|
@ -61,7 +59,7 @@ internal class DefaultHotMapDerivationsRepository @Inject constructor(
|
|||
userWallet: UserWallet.Hot,
|
||||
networks: List<Network>,
|
||||
): UserWallet.Hot = withContext(dispatchers.default) {
|
||||
val derivations = MissedDerivationsFinder(userWallet, dynamicAddressesFeatureToggles.isDynamicAddressesEnabled)
|
||||
val derivations = MissedDerivationsFinder(userWallet, isDynamicAddressesEnabled = true)
|
||||
.findByNetworks(networks)
|
||||
.ifEmpty {
|
||||
TangemLogger.d("Nothing to derive")
|
||||
|
|
@ -110,7 +108,7 @@ internal class DefaultHotMapDerivationsRepository @Inject constructor(
|
|||
userWallet: UserWallet.Hot,
|
||||
networksWithDerivationPath: Map<BackendId, String?>,
|
||||
): Boolean = withContext(dispatchers.default) {
|
||||
val derivations = MissedDerivationsFinder(userWallet, dynamicAddressesFeatureToggles.isDynamicAddressesEnabled)
|
||||
val derivations = MissedDerivationsFinder(userWallet, isDynamicAddressesEnabled = true)
|
||||
.findByNetworks(
|
||||
networksWithDerivationPath.mapNotNull { (backendId, extraDerivationPath) ->
|
||||
networkFactory.create(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue