Updated on 2026-08-14

This commit is contained in:
Tangem 2023-10-20 10:44:03 +03:00
parent 69c3e4c409
commit c9f84c9227
7 changed files with 35 additions and 6 deletions

View file

@ -525,7 +525,7 @@
"networks":
[
{
"networkId": "near/test"
"networkId": "near-protocol/test"
}
]
}

View file

@ -47,6 +47,7 @@ fun Blockchain.getGreyedOutIconRes(): Int {
Blockchain.AlephZero, Blockchain.AlephZeroTestnet -> R.drawable.ic_azero_no_color
Blockchain.OctaSpace, Blockchain.OctaSpaceTestnet -> R.drawable.ic_octaspace_no_color
Blockchain.Chia, Blockchain.ChiaTestnet -> R.drawable.ic_chia_no_color
Blockchain.Near, Blockchain.NearTestnet -> R.drawable.ic_near_no_color
else -> R.drawable.ic_tangem_logo
}
}

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="22dp"
android:height="22dp"
android:viewportWidth="22"
android:viewportHeight="22">
<path
android:pathData="M15.721,5C15.277,5 14.864,5.23 14.632,5.609L12.123,9.333C12.042,9.456 12.075,9.622 12.197,9.703C12.297,9.77 12.429,9.761 12.519,9.683L14.988,7.542C15.029,7.505 15.092,7.509 15.129,7.55C15.146,7.569 15.155,7.593 15.155,7.618V14.323C15.155,14.378 15.11,14.423 15.055,14.423C15.025,14.423 14.997,14.41 14.978,14.387L7.515,5.453C7.272,5.166 6.915,5 6.539,5H6.278C5.572,5 5,5.572 5,6.278V15.722C5,16.428 5.572,17 6.278,17C6.723,17 7.135,16.77 7.368,16.391L9.876,12.667C9.958,12.544 9.925,12.378 9.802,12.297C9.703,12.23 9.571,12.239 9.481,12.317L7.012,14.458C6.971,14.495 6.907,14.491 6.87,14.45C6.854,14.432 6.845,14.407 6.845,14.382V7.676C6.845,7.62 6.89,7.576 6.945,7.576C6.975,7.576 7.003,7.589 7.022,7.612L14.484,16.547C14.727,16.834 15.084,17 15.46,17H15.721C16.427,17 16.999,16.428 17,15.722V6.278C17,5.572 16.428,5 15.722,5H15.721Z"
android:fillColor="#909090"/>
</vector>

View file

@ -28,6 +28,7 @@ fun getActiveIconRes(blockchainId: String): Int {
"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
"NEAR", "NEAR/test" -> R.drawable.img_near_22
"Polkadot", "Polkadot/test" -> R.drawable.img_polkadot_22
"Kusama" -> R.drawable.img_kusama_22
"OPTIMISM", "OPTIMISM/test" -> R.drawable.img_optimism_22
@ -91,6 +92,7 @@ fun getActiveIconResByCoinId(coinId: String, networkId: String): Int {
"telos" -> R.drawable.img_telos_22
"octaspace" -> R.drawable.img_octaspace_22
"chia" -> R.drawable.img_chia_22
"near" -> R.drawable.img_near_22
else -> R.drawable.ic_alert_24
}
}

View file

@ -0,0 +1,16 @@
<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="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"
android:fillColor="#00EC97"/>
<path
android:pathData="M15.721,5C15.277,5 14.864,5.23 14.632,5.609L12.123,9.333C12.042,9.456 12.075,9.622 12.197,9.703C12.297,9.77 12.429,9.761 12.519,9.683L14.988,7.542C15.029,7.505 15.092,7.509 15.129,7.55C15.146,7.569 15.155,7.593 15.155,7.618V14.323C15.155,14.378 15.11,14.423 15.055,14.423C15.025,14.423 14.997,14.41 14.978,14.387L7.515,5.453C7.272,5.166 6.915,5 6.539,5H6.278C5.572,5 5,5.572 5,6.278V15.722C5,16.428 5.572,17 6.278,17C6.723,17 7.135,16.77 7.368,16.391L9.876,12.667C9.958,12.544 9.925,12.378 9.802,12.297C9.703,12.23 9.571,12.239 9.481,12.317L7.012,14.458C6.971,14.495 6.907,14.491 6.87,14.45C6.854,14.432 6.845,14.407 6.845,14.382V7.676C6.845,7.62 6.89,7.576 6.945,7.576C6.975,7.576 7.003,7.589 7.022,7.612L14.484,16.547C14.727,16.834 15.084,17 15.46,17H15.721C16.427,17 16.999,16.428 17,15.722V6.278C17,5.572 16.428,5 15.722,5H15.721Z"
android:fillColor="#000000"/>
</group>
</vector>

View file

@ -55,7 +55,7 @@ internal fun getTokenIconUrl(blockchain: Blockchain, token: SdkToken): String? {
internal fun getCoinIconUrl(blockchain: Blockchain): String? {
val coinId = when (blockchain) {
Blockchain.Unknown -> null
Blockchain.TerraV1, Blockchain.TerraV2 -> blockchain.toCoinId()
Blockchain.TerraV1, Blockchain.TerraV2, Blockchain.Near -> blockchain.toCoinId()
else -> blockchain.toNetworkId()
}

View file

@ -70,8 +70,8 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
"octaspace/test" -> Blockchain.OctaSpaceTestnet
"chia" -> Blockchain.Chia
"chia/test" -> Blockchain.ChiaTestnet
"near" -> Blockchain.Near
"near/test" -> Blockchain.NearTestnet
"near-protocol" -> Blockchain.Near
"near-protocol/test" -> Blockchain.NearTestnet
else -> null
}
}
@ -143,8 +143,8 @@ fun Blockchain.toNetworkId(): String {
Blockchain.OctaSpaceTestnet -> "octaspace/test"
Blockchain.Chia -> "chia"
Blockchain.ChiaTestnet -> "chia/test"
Blockchain.Near -> "near"
Blockchain.NearTestnet -> "near/test"
Blockchain.Near -> "near-protocol"
Blockchain.NearTestnet -> "near-protocol/test"
}
}
@ -203,6 +203,7 @@ fun Blockchain.amountToCreateAccount(token: Token? = null): BigDecimal? {
return when (this) {
Blockchain.Stellar -> if (token?.symbol == NODL) BigDecimal(NODL_AMOUNT_TO_CREATE_ACCOUNT) else BigDecimal.ONE
Blockchain.XRP -> BigDecimal.TEN
Blockchain.Near, Blockchain.NearTestnet -> 0.00182.toBigDecimal()
else -> null
}
}