Updated on 2026-08-14
This commit is contained in:
parent
33b7a53905
commit
c5560c3c6a
101 changed files with 274 additions and 272 deletions
|
|
@ -84,7 +84,7 @@ class CryptoCurrencyFactory(
|
|||
}
|
||||
|
||||
fun createCoin(network: Network): CryptoCurrency.Coin {
|
||||
val blockchain = Blockchain.fromId(network.id.value)
|
||||
val blockchain = Blockchain.fromId(network.rawId)
|
||||
|
||||
return CryptoCurrency.Coin(
|
||||
id = getCoinId(network, blockchain.toCoinId()),
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import com.tangem.domain.models.scan.ScanResponse
|
|||
import timber.log.Timber
|
||||
|
||||
fun getBlockchain(networkId: Network.ID): Blockchain {
|
||||
return Blockchain.fromId(networkId.value)
|
||||
return Blockchain.fromId(networkId.rawId.value)
|
||||
}
|
||||
|
||||
fun getNetwork(
|
||||
|
|
@ -27,16 +27,18 @@ fun getNetwork(
|
|||
return null
|
||||
}
|
||||
|
||||
val derivationPath = getNetworkDerivationPath(
|
||||
blockchain = blockchain,
|
||||
extraDerivationPath = extraDerivationPath,
|
||||
cardDerivationStyleProvider = derivationStyleProvider,
|
||||
)
|
||||
|
||||
return Network(
|
||||
id = Network.ID(blockchain.id),
|
||||
id = Network.ID(value = blockchain.id, derivationPath = derivationPath),
|
||||
backendId = blockchain.toNetworkId(),
|
||||
name = blockchain.fullName,
|
||||
isTestnet = blockchain.isTestnet(),
|
||||
derivationPath = getNetworkDerivationPath(
|
||||
blockchain = blockchain,
|
||||
extraDerivationPath = extraDerivationPath,
|
||||
cardDerivationStyleProvider = derivationStyleProvider,
|
||||
),
|
||||
derivationPath = derivationPath,
|
||||
currencySymbol = blockchain.currency,
|
||||
standardType = getNetworkStandardType(blockchain),
|
||||
hasFiatFeeRate = blockchain.feePaidCurrency() !is FeePaidCurrency.FeeResource,
|
||||
|
|
|
|||
|
|
@ -78,12 +78,12 @@ fun List<UserTokensResponse.Token>.hasCoinForToken(network: Network): Boolean {
|
|||
private fun getCurrencyIdBody(network: Network): CurrencyIdBody {
|
||||
return when (val path = network.derivationPath) {
|
||||
is Network.DerivationPath.Custom -> CurrencyIdBody.NetworkIdWithDerivationPath(
|
||||
rawId = network.id.value,
|
||||
rawId = network.rawId,
|
||||
derivationPath = path.value,
|
||||
)
|
||||
is Network.DerivationPath.Card,
|
||||
is Network.DerivationPath.None,
|
||||
-> CurrencyIdBody.NetworkId(network.id.value)
|
||||
-> CurrencyIdBody.NetworkId(network.rawId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue