diff --git a/data/tokens/src/main/kotlin/com/tangem/data/tokens/utils/NetworkOperations.kt b/data/tokens/src/main/kotlin/com/tangem/data/tokens/utils/NetworkOperations.kt index e70b7a4060..9850a01853 100644 --- a/data/tokens/src/main/kotlin/com/tangem/data/tokens/utils/NetworkOperations.kt +++ b/data/tokens/src/main/kotlin/com/tangem/data/tokens/utils/NetworkOperations.kt @@ -23,21 +23,21 @@ internal fun getNetwork( id = Network.ID(blockchain.id), name = blockchain.fullName, isTestnet = blockchain.isTestnet(), - derivationPath = getDerivationPath(blockchain, extraDerivationPath, derivationStyleProvider), + derivationPath = getNetworkDerivationPath(blockchain, extraDerivationPath, derivationStyleProvider), standardType = getNetworkStandardType(blockchain), ) } -private fun getDerivationPath( +private fun getNetworkDerivationPath( blockchain: Blockchain, extraDerivationPath: String?, - derivationStyleProvider: DerivationStyleProvider, + cardDerivationStyleProvider: DerivationStyleProvider, ): Network.DerivationPath { - val cardDerivationPath = getCardDerivationPath(blockchain, derivationStyleProvider) + val defaultDerivationPath = getDefaultDerivationPath(blockchain, cardDerivationStyleProvider) return when { - cardDerivationPath.isNullOrBlank() -> Network.DerivationPath.None - extraDerivationPath == cardDerivationPath -> Network.DerivationPath.Card(extraDerivationPath) + defaultDerivationPath.isNullOrBlank() -> Network.DerivationPath.None + extraDerivationPath == defaultDerivationPath -> Network.DerivationPath.Card(extraDerivationPath) !extraDerivationPath.isNullOrBlank() -> Network.DerivationPath.Custom(extraDerivationPath) else -> Network.DerivationPath.None } @@ -53,6 +53,9 @@ private fun getNetworkStandardType(blockchain: Blockchain): Network.StandardType } } -private fun getCardDerivationPath(blockchain: Blockchain, derivationStyleProvider: DerivationStyleProvider): String? { +private fun getDefaultDerivationPath( + blockchain: Blockchain, + derivationStyleProvider: DerivationStyleProvider, +): String? { return blockchain.derivationPath(derivationStyleProvider.getDerivationStyle())?.rawPath } \ No newline at end of file