Updated on 2026-08-14

This commit is contained in:
Tangem 2024-09-25 15:51:14 +04:00
parent 06876aeb1a
commit 4d6626d6c4
18 changed files with 154 additions and 117 deletions

View file

@ -13,7 +13,6 @@ import com.tangem.crypto.hdWallet.DerivationPath
import com.tangem.data.common.currency.getNetwork
import com.tangem.datasource.local.userwallet.UserWalletsStore
import com.tangem.domain.card.repository.DerivationsRepository
import com.tangem.domain.common.util.derivationStyleProvider
import com.tangem.domain.models.scan.ScanResponse
import com.tangem.domain.tokens.model.CryptoCurrency
import com.tangem.domain.tokens.model.Network
@ -48,7 +47,7 @@ internal class DefaultDerivationsRepository(
getNetwork(
blockchain = Blockchain.fromNetworkId(it.value) ?: return@mapNotNull null,
extraDerivationPath = null,
derivationStyleProvider = userWallet.scanResponse.derivationStyleProvider,
scanResponse = userWallet.scanResponse,
)
},
)
@ -84,7 +83,7 @@ internal class DefaultDerivationsRepository(
getNetwork(
blockchain = Blockchain.fromNetworkId(networkId.value) ?: return@mapNotNull null,
extraDerivationPath = extraDerivationPath,
derivationStyleProvider = userWallet.scanResponse.derivationStyleProvider,
scanResponse = userWallet.scanResponse,
)
},
)

View file

@ -3,7 +3,6 @@ package com.tangem.tap.network.exchangeServices
import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchain.common.Token
import com.tangem.data.common.currency.CryptoCurrencyFactory
import com.tangem.domain.common.util.derivationStyleProvider
import com.tangem.domain.tokens.model.CryptoCurrency
import com.tangem.tap.common.extensions.inject
import com.tangem.tap.domain.model.Currency
@ -21,10 +20,9 @@ internal class CryptoCurrencyConverter : TwoWayConverter<Currency, CryptoCurrenc
cryptoCurrencyFactory.createCoin(
blockchain = value.blockchain,
extraDerivationPath = value.derivationPath,
derivationStyleProvider = requireNotNull(
scanResponse = requireNotNull(
store.inject(DaggerGraphState::generalUserWalletsListManager).selectedUserWalletSync
?.scanResponse
?.derivationStyleProvider,
?.scanResponse,
),
),
)
@ -33,10 +31,9 @@ internal class CryptoCurrencyConverter : TwoWayConverter<Currency, CryptoCurrenc
sdkToken = value.token,
blockchain = value.blockchain,
extraDerivationPath = value.derivationPath,
derivationStyleProvider = requireNotNull(
scanResponse = requireNotNull(
store.inject(DaggerGraphState::generalUserWalletsListManager).selectedUserWalletSync
?.scanResponse
?.derivationStyleProvider,
?.scanResponse,
),
),
)