Updated on 2026-08-14

This commit is contained in:
Tangem 2024-02-20 14:04:49 +00:00
parent 67ce48a171
commit 2adf93a0bd
9 changed files with 76 additions and 93 deletions

View file

@ -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

View file

@ -0,0 +1,26 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="22dp"
android:height="22dp"
android:viewportWidth="22"
android:viewportHeight="22">
<group>
<clip-path
android:pathData="M11,0L11,0A11,11 0,0 1,22 11L22,11A11,11 0,0 1,11 22L11,22A11,11 0,0 1,0 11L0,11A11,11 0,0 1,11 0z"/>
<path
android:pathData="M2.313,7.842C1.653,8.61 1.191,14.987 1.422,15.421C1.653,15.855 8.959,17.024 9.281,11.515C9.579,6.439 3.337,7.007 2.313,7.842ZM3.865,9.01C3.777,9.689 3.595,11.167 3.568,11.648C3.542,12.129 3.447,13.451 3.403,14.052C4.207,14.097 5.939,14.052 6.441,13.518C7.069,12.85 7.316,10.341 6.673,9.745C5.667,8.813 4.614,8.932 4.094,8.991C3.999,9.002 3.922,9.01 3.865,9.01Z"
android:fillColor="#000000"
android:fillType="evenOdd"/>
<path
android:pathData="M9.942,9.177C10.312,8.723 11.373,8.632 11.857,8.643C11.934,10.68 12.042,14.78 11.857,14.887C11.626,15.021 10.107,15.388 9.942,15.054C9.777,14.72 9.479,9.745 9.942,9.177Z"
android:fillColor="#000000"/>
<path
android:pathData="M9.843,7.207C9.81,7.641 10.338,8.309 11.197,8.009C11.428,7.928 11.633,7.581 11.659,7.207C11.692,6.74 11.395,6.206 10.8,6.239C10.206,6.272 9.876,6.773 9.843,7.207Z"
android:fillColor="#000000"/>
<path
android:pathData="M14.631,6.974C16.282,6.036 18.898,6.406 19.023,6.84C19.232,7.563 18.693,8.376 18.693,8.376C17.735,7.741 15.094,7.842 14.928,8.71C14.763,9.578 17.27,10.128 18.825,10.747C21.863,11.956 19.288,15.254 17.009,15.521C14.482,15.818 13.079,15.321 12.518,14.486L13.079,13.318C13.596,13.529 14.895,13.959 15.952,13.986C17.372,14.021 17.868,13.184 17.868,12.683C17.868,12.375 17.339,12.216 15.391,11.648C12.914,10.927 12.197,8.355 14.631,6.974Z"
android:fillColor="#000000"/>
<path
android:pathData="M4.46,3L4.726,3.511C4.931,3.905 5.249,4.226 5.639,4.434L6.144,4.703L5.639,4.972C5.249,5.18 4.931,5.501 4.726,5.895L4.46,6.406L4.194,5.895C3.988,5.501 3.67,5.18 3.281,4.972L2.776,4.703L3.281,4.434C3.67,4.226 3.988,3.905 4.194,3.511L4.46,3Z"
android:fillColor="#000000"/>
</group>
</vector>

View file

@ -1,37 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="22dp"
android:height="22dp"
android:autoMirrored="true"
android:viewportWidth="22"
android:viewportHeight="22">
<group>
<clip-path android:pathData="M0,0h22v22h-22z" />
<path
android:fillColor="#000000"
android:pathData="M10.75,3.737L10.75,5.243L7.014,10.538L6.243,10.081L10.75,3.737Z" />
<path
android:fillColor="#000000"
android:pathData="M7.445,10.793L10.75,6.111L10.749,12.751L7.445,10.793Z" />
<path
android:fillColor="#000000"
android:pathData="M11.25,5.243L11.25,3.739L15.757,10.081L15.057,10.495L11.25,5.243Z" />
<path
android:fillColor="#000000"
android:pathData="M11.25,6.095L11.249,12.752L14.625,10.752L11.25,6.095Z" />
<path
android:fillColor="#000000"
android:pathData="M10.749,15.656L10.749,17.039L9.272,14.739L10.749,15.656Z" />
<path
android:fillColor="#000000"
android:pathData="M11.249,17.035L11.249,15.657L12.701,14.756L11.249,17.035Z" />
<path
android:fillColor="#000000"
android:pathData="M13.681,14.148L14.915,13.382L11.25,18.88L11.25,17.966L13.681,14.148Z" />
<path
android:fillColor="#000000"
android:pathData="M10.75,18.879L10.75,17.965L8.29,14.135L8.284,14.126L7.085,13.382L10.75,18.879Z" />
<path
android:fillColor="#000000"
android:pathData="M15.559,12.393L13.718,11.78L11,13.479L8.282,11.78L6.44,12.394L10.072,14.647L11,15.177L11.927,14.648L15.559,12.393Z" />
</group>
</vector>

View file

@ -9,19 +9,19 @@
<group>
<clip-path android:pathData="M11,3.85L11,3.85A4.4,4.4 0,0 1,15.4 8.25L15.4,13.75A4.4,4.4 0,0 1,11 18.15L11,18.15A4.4,4.4 0,0 1,6.6 13.75L6.6,8.25A4.4,4.4 0,0 1,11 3.85z" />
<path
android:fillColor="#A1A1A4"
android:fillColor="#000000"
android:pathData="M7.609,9.46L6.6,11.131L8.414,12.201C8.448,12.033 8.538,11.885 8.664,11.778L8.008,9.483C7.957,9.494 7.904,9.5 7.85,9.5C7.765,9.5 7.684,9.486 7.609,9.46Z" />
<path
android:fillColor="#A1A1A4"
android:fillColor="#000000"
android:pathData="M8.366,8.206C8.51,8.343 8.6,8.536 8.6,8.75C8.6,9.021 8.456,9.258 8.241,9.39L8.886,11.647C8.968,11.617 9.057,11.6 9.149,11.6C9.22,11.6 9.289,11.61 9.354,11.628L10.487,9.647C10.341,9.51 10.25,9.316 10.25,9.1C10.25,8.686 10.586,8.35 11,8.35C11.414,8.35 11.75,8.686 11.75,9.1C11.75,9.316 11.659,9.51 11.514,9.647L12.646,11.628C12.71,11.61 12.779,11.6 12.85,11.6C12.943,11.6 13.031,11.617 13.113,11.648L13.759,9.39C13.543,9.258 13.399,9.021 13.399,8.75C13.399,8.537 13.488,8.344 13.631,8.208L10.998,3.85L8.366,8.206Z" />
<path
android:fillColor="#A1A1A4"
android:fillColor="#000000"
android:pathData="M14.388,9.461C14.313,9.486 14.233,9.5 14.149,9.5C14.095,9.5 14.043,9.494 13.992,9.483L13.336,11.779C13.461,11.886 13.551,12.033 13.585,12.2L15.397,11.131L14.388,9.461Z" />
<path
android:fillColor="#A1A1A4"
android:fillColor="#000000"
android:pathData="M12.363,12.92C12.202,12.783 12.1,12.578 12.1,12.35C12.1,12.096 12.226,11.871 12.419,11.736L11.305,9.785C11.212,9.827 11.109,9.85 11,9.85C10.892,9.85 10.788,9.827 10.695,9.785L9.58,11.736C9.773,11.872 9.899,12.096 9.899,12.35C9.899,12.579 9.797,12.784 9.635,12.921L10.998,13.725L12.363,12.92Z" />
<path
android:fillColor="#A1A1A4"
android:fillColor="#000000"
android:pathData="M10.998,18.146L15.4,11.963L10.998,14.556L6.6,11.963L10.998,18.146Z" />
</group>
</group>

View file

@ -0,0 +1,28 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="22dp"
android:height="22dp"
android:viewportWidth="22"
android:viewportHeight="22">
<group>
<clip-path android:pathData="M11,0L11,0A11,11 0,0 1,22 11L22,11A11,11 0,0 1,11 22L11,22A11,11 0,0 1,0 11L0,11A11,11 0,0 1,11 0z" />
<path
android:fillColor="#000000"
android:pathData="M11,0L11,0A11,11 0,0 1,22 11L22,11A11,11 0,0 1,11 22L11,22A11,11 0,0 1,0 11L0,11A11,11 0,0 1,11 0z" />
<path
android:fillColor="#F8EE00"
android:fillType="evenOdd"
android:pathData="M2.313,7.842C1.653,8.61 1.191,14.987 1.422,15.421C1.653,15.855 8.959,17.024 9.281,11.515C9.579,6.439 3.337,7.007 2.313,7.842ZM3.865,9.01C3.777,9.689 3.595,11.167 3.568,11.648C3.542,12.129 3.447,13.451 3.403,14.052C4.207,14.097 5.939,14.052 6.441,13.518C7.069,12.85 7.316,10.341 6.673,9.745C5.667,8.813 4.614,8.932 4.094,8.991C3.999,9.002 3.922,9.01 3.865,9.01Z" />
<path
android:fillColor="#F8EE00"
android:pathData="M9.942,9.177C10.312,8.723 11.373,8.632 11.857,8.643C11.934,10.68 12.042,14.78 11.857,14.887C11.626,15.021 10.107,15.388 9.942,15.054C9.777,14.72 9.479,9.745 9.942,9.177Z" />
<path
android:fillColor="#F8EE00"
android:pathData="M9.843,7.207C9.81,7.641 10.338,8.309 11.197,8.009C11.428,7.928 11.633,7.581 11.659,7.207C11.692,6.74 11.395,6.206 10.8,6.239C10.206,6.272 9.876,6.773 9.843,7.207Z" />
<path
android:fillColor="#F8EE00"
android:pathData="M14.631,6.974C16.282,6.036 18.898,6.406 19.023,6.84C19.232,7.563 18.693,8.376 18.693,8.376C17.735,7.741 15.094,7.842 14.928,8.71C14.763,9.578 17.27,10.128 18.825,10.747C21.863,11.956 19.288,15.254 17.009,15.521C14.482,15.818 13.079,15.321 12.518,14.486L13.079,13.318C13.596,13.529 14.895,13.959 15.952,13.986C17.372,14.021 17.868,13.184 17.868,12.683C17.868,12.375 17.339,12.216 15.391,11.648C12.914,10.927 12.197,8.355 14.631,6.974Z" />
<path
android:fillColor="#F8EE00"
android:pathData="M4.46,3L4.726,3.511C4.931,3.905 5.249,4.226 5.639,4.434L6.144,4.703L5.639,4.972C5.249,5.18 4.931,5.501 4.726,5.895L4.46,6.406L4.194,5.895C3.988,5.501 3.67,5.18 3.281,4.972L2.776,4.703L3.281,4.434C3.67,4.226 3.988,3.905 4.194,3.511L4.46,3Z" />
</group>
</vector>

View file

@ -1,40 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="22dp"
android:height="22dp"
android:autoMirrored="true"
android:viewportWidth="22"
android:viewportHeight="22">
<group>
<clip-path android:pathData="M0,0h22v22h-22z" />
<path
android:fillColor="#7F90F8"
android:pathData="M11,22C17.075,22 22,17.075 22,11C22,4.925 17.075,0 11,0C4.925,0 0,4.925 0,11C0,17.075 4.925,22 11,22Z" />
<path
android:fillColor="#ffffff"
android:pathData="M10.75,3.737L10.75,5.243L7.014,10.538L6.243,10.081L10.75,3.737Z" />
<path
android:fillColor="#ffffff"
android:pathData="M7.445,10.793L10.75,6.111L10.749,12.751L7.445,10.793Z" />
<path
android:fillColor="#ffffff"
android:pathData="M11.25,5.243L11.25,3.739L15.757,10.081L15.057,10.495L11.25,5.243Z" />
<path
android:fillColor="#ffffff"
android:pathData="M11.25,6.095L11.249,12.752L14.625,10.752L11.25,6.095Z" />
<path
android:fillColor="#ffffff"
android:pathData="M10.749,15.656L10.749,17.039L9.272,14.739L10.749,15.656Z" />
<path
android:fillColor="#ffffff"
android:pathData="M11.249,17.035L11.249,15.657L12.701,14.756L11.249,17.035Z" />
<path
android:fillColor="#ffffff"
android:pathData="M13.681,14.148L14.915,13.382L11.25,18.88L11.25,17.966L13.681,14.148Z" />
<path
android:fillColor="#ffffff"
android:pathData="M10.75,18.879L10.75,17.965L8.29,14.135L8.284,14.126L7.085,13.382L10.75,18.879Z" />
<path
android:fillColor="#ffffff"
android:pathData="M15.559,12.393L13.718,11.78L11,13.479L8.282,11.78L6.44,12.394L10.072,14.647L11,15.177L11.927,14.648L15.559,12.393Z" />
</group>
</vector>

View file

@ -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),

View file

@ -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"

View file

@ -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 ^