Updated on 2026-08-14
This commit is contained in:
parent
0e515c142e
commit
24c6425299
7 changed files with 170 additions and 54 deletions
|
|
@ -1,8 +1,10 @@
|
|||
package com.tangem.data.tokens.repository
|
||||
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.common.card.EllipticCurve
|
||||
import com.tangem.data.tokens.utils.getNetwork
|
||||
import com.tangem.datasource.local.userwallet.UserWalletsStore
|
||||
import com.tangem.domain.common.configs.CardConfig
|
||||
import com.tangem.domain.common.extensions.*
|
||||
import com.tangem.domain.common.util.cardTypesResolver
|
||||
import com.tangem.domain.common.util.derivationStyleProvider
|
||||
|
|
@ -71,6 +73,15 @@ internal class DefaultNetworksCompatibilityRepository(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun requiresHardenedDerivationOnly(networkId: String, userWalletId: UserWalletId): Boolean {
|
||||
val scanResponse = getWalletOrThrow(userWalletId).scanResponse
|
||||
val config = CardConfig.createConfig(scanResponse.card)
|
||||
val blockchain = Blockchain.fromNetworkId(networkId) ?: return false
|
||||
|
||||
return config.primaryCurve(blockchain) == EllipticCurve.Ed25519Slip0010 &&
|
||||
scanResponse.cardTypesResolver.isWallet2()
|
||||
}
|
||||
|
||||
override fun areTokensSupportedByNetwork(networkId: String): Boolean {
|
||||
return Blockchain.fromNetworkId(networkId)?.canHandleTokens() ?: false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue