diff --git a/core/ui/src/main/java/com/tangem/core/ui/extensions/BlockchainIcons.kt b/core/ui/src/main/java/com/tangem/core/ui/extensions/BlockchainIcons.kt index c5a3195582..ea2e3141bf 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/extensions/BlockchainIcons.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/extensions/BlockchainIcons.kt @@ -27,7 +27,7 @@ fun getActiveIconRes(blockchainId: String): Int { "TRON", "TRON/test" -> R.drawable.img_tron_22 "GNO" -> R.drawable.img_gnosis_22 "ETH-Pow", "ETH-Pow/test" -> R.drawable.img_eth_pow_22 - "ETH-Fair" -> R.drawable.img_eth_fair_22 + "ETH-Fair", "dischain" -> R.drawable.img_dischain_22 "Polkadot", "Polkadot/test" -> R.drawable.img_polkadot_22 "Kusama" -> R.drawable.img_kusama_22 "OPTIMISM", "OPTIMISM/test" -> R.drawable.img_optimism_22 @@ -81,7 +81,7 @@ fun getActiveIconResByNetworkId(networkId: String): Int { "tron", "tron/test" -> R.drawable.img_tron_22 "xdai" -> R.drawable.img_gnosis_22 "ethereum-pow-iou", "ethereum-pow-iou/test" -> R.drawable.img_eth_pow_22 - "ethereumfair" -> R.drawable.img_eth_fair_22 + "ethereumfair", "dischain" -> R.drawable.img_dischain_22 "polkadot", "polkadot/test" -> R.drawable.img_polkadot_22 "kusama" -> R.drawable.img_kusama_22 "optimistic-ethereum", "optimistic-ethereum/test" -> R.drawable.img_optimism_22 @@ -137,7 +137,7 @@ fun getActiveIconResByCoinId(coinId: String): Int { "dogecoin" -> R.drawable.img_dogecoin_22 "xdai" -> R.drawable.img_gnosis_22 "ethereum-pow-iou" -> R.drawable.img_eth_pow_22 - "ethereumfair" -> R.drawable.img_eth_fair_22 + "ethereumfair", "dischain" -> R.drawable.img_dischain_22 "kusama" -> R.drawable.img_kusama_22 "dash" -> R.drawable.img_dash_22 "kaspa" -> R.drawable.img_kaspa_22 @@ -186,7 +186,7 @@ fun getGreyedOutIconRes(blockchainId: String): Int { "TRON", "TRON/test" -> R.drawable.ic_tron_22 "GNO" -> R.drawable.ic_gnosis_22 "ETH-Pow", "ETH-Pow/test" -> R.drawable.ic_ethereumpow_22 - "ETH-Fair" -> R.drawable.ic_ethereumfair_22 + "ETH-Fair", "dischain" -> R.drawable.ic_dischain_22 "Polkadot", "Polkadot/test" -> R.drawable.ic_polkadot_16 "Kusama" -> R.drawable.ic_kusama_16 "OPTIMISM", "OPTIMISM/test" -> R.drawable.ic_optimism_22 @@ -240,7 +240,7 @@ fun getGreyedOutIconResByNetworkId(networkId: String): Int { "tron", "tron/test" -> R.drawable.ic_tron_22 "xdai" -> R.drawable.ic_gnosis_22 "ethereum-pow-iou", "ethereum-pow-iou/test" -> R.drawable.ic_ethereumpow_22 - "ethereumfair" -> R.drawable.ic_ethereumfair_22 + "ethereumfair", "dischain" -> R.drawable.ic_dischain_22 "polkadot", "polkadot/test" -> R.drawable.ic_polkadot_16 "kusama" -> R.drawable.ic_kusama_16 "optimistic-ethereum", "optimistic-ethereum/test" -> R.drawable.ic_optimism_22 diff --git a/core/ui/src/main/res/drawable/ic_dischain_22.xml b/core/ui/src/main/res/drawable/ic_dischain_22.xml new file mode 100644 index 0000000000..5387a21c0c --- /dev/null +++ b/core/ui/src/main/res/drawable/ic_dischain_22.xml @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/core/ui/src/main/res/drawable/ic_ethereumfair_22.xml b/core/ui/src/main/res/drawable/ic_ethereumfair_22.xml deleted file mode 100644 index d98f048426..0000000000 --- a/core/ui/src/main/res/drawable/ic_ethereumfair_22.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - diff --git a/core/ui/src/main/res/drawable/ic_ethereumpow_22.xml b/core/ui/src/main/res/drawable/ic_ethereumpow_22.xml index 40a0651a32..f4af8483ac 100644 --- a/core/ui/src/main/res/drawable/ic_ethereumpow_22.xml +++ b/core/ui/src/main/res/drawable/ic_ethereumpow_22.xml @@ -9,19 +9,19 @@ diff --git a/core/ui/src/main/res/drawable/img_dischain_22.xml b/core/ui/src/main/res/drawable/img_dischain_22.xml new file mode 100644 index 0000000000..876950bc88 --- /dev/null +++ b/core/ui/src/main/res/drawable/img_dischain_22.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/core/ui/src/main/res/drawable/img_eth_fair_22.xml b/core/ui/src/main/res/drawable/img_eth_fair_22.xml deleted file mode 100644 index b8e6604a7a..0000000000 --- a/core/ui/src/main/res/drawable/img_eth_fair_22.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/data/tokens/src/main/kotlin/com/tangem/data/tokens/utils/ResponseCryptoCurrenciesFactory.kt b/data/tokens/src/main/kotlin/com/tangem/data/tokens/utils/ResponseCryptoCurrenciesFactory.kt index fde4c4be2e..5157d1430d 100644 --- a/data/tokens/src/main/kotlin/com/tangem/data/tokens/utils/ResponseCryptoCurrenciesFactory.kt +++ b/data/tokens/src/main/kotlin/com/tangem/data/tokens/utils/ResponseCryptoCurrenciesFactory.kt @@ -74,11 +74,17 @@ class ResponseCryptoCurrenciesFactory { ): CryptoCurrency.Coin? { val network = getNetwork(blockchain, responseToken.derivationPath, derivationStyleProvider) ?: return null + // workaround: Dischain was renamed but backend still returns the old name, + // get name and symbol from enum Blockchain until backend renamed + // [REDACTED_JIRA] + val name = if (blockchain == Blockchain.Dischain) blockchain.fullName else responseToken.name + val symbol = if (blockchain == Blockchain.Dischain) blockchain.currency else responseToken.symbol + return CryptoCurrency.Coin( id = getCoinId(network, blockchain.toCoinId()), network = network, - name = responseToken.name, - symbol = responseToken.symbol, + name = name, + symbol = symbol, decimals = responseToken.decimals, iconUrl = getCoinIconUrl(blockchain), isCustom = isCustomCoin(network), diff --git a/domain/legacy/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt b/domain/legacy/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt index 86fc4fd0be..8ecb812304 100644 --- a/domain/legacy/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt +++ b/domain/legacy/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt @@ -43,7 +43,7 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? { "xdai" -> Blockchain.Gnosis "ethereum-pow-iou" -> Blockchain.EthereumPow "ethereum-pow-iou/test" -> Blockchain.EthereumPowTestnet - "ethereumfair" -> Blockchain.EthereumFair + "ethereumfair", "dischain" -> Blockchain.Dischain // for old client compatibility "polkadot" -> Blockchain.Polkadot "polkadot/test" -> Blockchain.PolkadotTestnet "kusama" -> Blockchain.Kusama @@ -131,7 +131,7 @@ fun Blockchain.toNetworkId(): String { Blockchain.Gnosis -> "xdai" Blockchain.EthereumPow -> "ethereum-pow-iou" Blockchain.EthereumPowTestnet -> "ethereum-pow-iou/test" - Blockchain.EthereumFair -> "ethereumfair" + Blockchain.Dischain -> "ethereumfair" // for backend compatibility Blockchain.Polkadot -> "polkadot" Blockchain.PolkadotTestnet -> "polkadot/test" Blockchain.Kusama -> "kusama" @@ -203,7 +203,7 @@ fun Blockchain.toCoinId(): String { Blockchain.Dogecoin -> "dogecoin" Blockchain.Gnosis -> "xdai" Blockchain.EthereumPow, Blockchain.EthereumPowTestnet -> "ethereum-pow-iou" - Blockchain.EthereumFair -> "ethereumfair" + Blockchain.Dischain -> "ethereumfair" // for backend compatibility Blockchain.Kusama -> "kusama" Blockchain.Optimism, Blockchain.OptimismTestnet -> "optimistic-ethereum" Blockchain.Dash -> "dash" diff --git a/gradle/dependencies.toml b/gradle/dependencies.toml index 9fe6fb1c4e..8204b7dd48 100644 --- a/gradle/dependencies.toml +++ b/gradle/dependencies.toml @@ -85,7 +85,7 @@ web3j = "4.10.1" # endregion Other libraries # region Tangem -tangemBlockchainSdk = "release-app_5.7-498" +tangemBlockchainSdk = "release-app_5.7-499" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds tangemCardSdk = "release-app_5.7-329" #tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^