Updated on 2026-08-14

This commit is contained in:
Tangem 2025-05-20 15:13:47 +04:00
parent 33b7a53905
commit c5560c3c6a
101 changed files with 274 additions and 272 deletions

View file

@ -41,7 +41,7 @@ internal class DefaultDerivationsRepository(
derivePublicKeysByNetworks(userWalletId = userWalletId, networks = currencies.map(CryptoCurrency::network))
}
override suspend fun derivePublicKeysByNetworkIds(userWalletId: UserWalletId, networkIds: List<Network.ID>) {
override suspend fun derivePublicKeysByNetworkIds(userWalletId: UserWalletId, networkIds: List<Network.RawID>) {
val userWallet = userWalletsStore.getSyncOrNull(userWalletId) ?: error("User wallet not found")
derivePublicKeysByNetworks(

View file

@ -49,7 +49,7 @@ internal class MissedDerivationsFinder(private val scanResponse: ScanResponse) {
private fun List<Network>.mapToNewDerivations(): List<DerivationData> {
val config = CardConfig.createConfig(scanResponse.card)
return mapNotNull { network ->
val blockchain = Blockchain.fromId(id = network.id.value)
val blockchain = Blockchain.fromId(id = network.rawId)
val curve = config.primaryCurve(blockchain) ?: return@mapNotNull null
findNewDerivations(curve = curve, scanResponse = scanResponse, network = network)
@ -74,7 +74,7 @@ internal class MissedDerivationsFinder(private val scanResponse: ScanResponse) {
}
private fun Network.getDerivationCandidates(curve: EllipticCurve): List<DerivationPath> {
val blockchain = Blockchain.fromId(id = this.id.value)
val blockchain = Blockchain.fromId(id = rawId)
return buildList {
add(blockchain.getDerivationPath(curve = curve))

View file

@ -419,7 +419,7 @@ class WalletConnectInteractor(
private suspend fun getAccountsForWc(userWallet: UserWallet, networks: List<Network>): List<Account> {
val walletManagers = networks.mapNotNull {
val blockchain = Blockchain.fromId(it.id.value)
val blockchain = Blockchain.fromId(it.rawId)
walletManagersFacade.getOrCreateWalletManager(
userWalletId = userWallet.walletId,
blockchain = blockchain,

View file

@ -79,7 +79,7 @@ object TradeCryptoMiddleware {
val status = action.cryptoCurrencyStatus
val currency = status.currency
val blockchain = Blockchain.fromId(currency.network.id.value)
val blockchain = Blockchain.fromId(currency.network.rawId)
val exchangeManager = store.state.globalState.exchangeManager
val topUrl = exchangeManager.getUrl(
action = CurrencyExchangeManager.Action.Buy,

View file

@ -44,7 +44,7 @@ internal class CryptoCurrencyConverter(
}
override fun convertBack(value: CryptoCurrency): Currency {
val blockchain = Blockchain.fromId(value.network.id.value)
val blockchain = Blockchain.fromId(value.network.rawId)
if (blockchain == Blockchain.Unknown) error("CryptoCurrencyConverter convertBack Unknown blockchain")
return when (value) {
is CryptoCurrency.Coin -> Currency.Blockchain(

View file

@ -68,7 +68,7 @@ class CurrencyExchangeManager(
walletAddress: String,
isDarkTheme: Boolean,
): String? {
val blockchain = Blockchain.fromId(cryptoCurrency.network.id.value)
val blockchain = Blockchain.fromId(cryptoCurrency.network.rawId)
if (blockchain.isTestnet()) return blockchain.getTestnetTopUpUrl()
val urlBuilder = getExchangeUrlBuilder(action)

View file

@ -77,7 +77,7 @@ internal class MercuryoService(private val environment: MercuryoEnvironment) : E
): String {
if (action == CurrencyExchangeManager.Action.Sell) throw UnsupportedOperationException()
val blockchain = Blockchain.fromId(cryptoCurrency.network.id.value)
val blockchain = Blockchain.fromId(cryptoCurrency.network.rawId)
val builder = Uri.Builder()
.scheme(ExchangeUrlBuilder.SCHEME)

View file

@ -133,7 +133,7 @@ class MoonPayService(
): String? {
if (action == CurrencyExchangeManager.Action.Buy) throw UnsupportedOperationException()
val blockchain = Blockchain.fromId(cryptoCurrency.network.id.value)
val blockchain = Blockchain.fromId(cryptoCurrency.network.rawId)
val supportedCurrency = blockchain.moonPaySupportedCurrency ?: return null
val moonpayCurrency = status?.availableForSell?.firstOrNull {
when (cryptoCurrency) {