Updated on 2026-08-14

This commit is contained in:
Tangem 2022-09-30 14:17:59 +04:00
commit 25906d8ee6
19 changed files with 396 additions and 34 deletions

View file

@ -412,12 +412,22 @@
]
},
{
"id" : "stellar",
"symbol" : "XLM",
"name" : "Stellar",
"networks" : [
"id": "stellar",
"symbol": "XLM",
"name": "Stellar",
"networks": [
{
"networkId" : "stellar/test"
"networkId": "stellar/test"
}
]
},
{
"id": "ethereum-pow-iou",
"symbol": "ETHW",
"name": "Ethereum PoW",
"networks": [
{
"networkId": "ethereum-pow-iou/test"
}
]
},

View file

@ -28,6 +28,8 @@ fun Blockchain.getRoundIconRes(): Int {
Blockchain.Dogecoin -> R.drawable.ic_dogecoin_round
Blockchain.Tron, Blockchain.TronTestnet -> R.drawable.ic_tron_round
Blockchain.Gnosis -> R.drawable.ic_gnosis_round
Blockchain.EthereumPow, Blockchain.EthereumPowTestnet -> R.drawable.ic_ethereumpow_round
Blockchain.EthereumFair -> R.drawable.ic_ethereumfair_round
Blockchain.Polkadot, Blockchain.PolkadotTestnet -> R.drawable.ic_polkadot_round
Blockchain.Kusama -> R.drawable.ic_kusama_round
Blockchain.Optimism, Blockchain.OptimismTestnet -> R.drawable.ic_optimism
@ -59,6 +61,8 @@ fun Blockchain.getGreyedOutIconRes(): Int {
Blockchain.Dogecoin -> R.drawable.ic_dogecoin_no_color
Blockchain.Tron, Blockchain.TronTestnet -> R.drawable.ic_tron_no_color
Blockchain.Gnosis -> R.drawable.ic_gnosis_no_color
Blockchain.EthereumPow, Blockchain.EthereumPowTestnet -> R.drawable.ic_ethereumpow_no_color
Blockchain.EthereumFair -> R.drawable.ic_ethereumfair_no_color
Blockchain.Polkadot, Blockchain.PolkadotTestnet -> R.drawable.ic_polkadot_no_color
Blockchain.Kusama -> R.drawable.ic_kusama_no_color
Blockchain.Optimism, Blockchain.OptimismTestnet -> R.drawable.ic_optimism_no_color

View file

@ -42,7 +42,7 @@ sealed class TapError(
data class UnsupportedState(
val stateError: String,
val customMessage: String = "Unsupported state:"
val customMessage: String = "Unsupported state:",
) : TapError(R.string.common_custom_string, listOf("$customMessage $stateError"))
sealed class WalletManager {
@ -53,9 +53,14 @@ sealed class TapError(
object BlockchainIsUnreachableTryLater : TapError(R.string.wallet_balance_blockchain_unreachable_try_later)
}
sealed class WalletConnect {
object UnsupportedDapp : TapError(R.string.wallet_connect_error_unsupported_dapp)
object UnsupportedLink : TapError(R.string.wallet_connect_error_failed_to_connect)
}
data class ValidateTransactionErrors(
override val errorList: List<TapError>,
override val builder: (List<String>) -> String
override val builder: (List<String>) -> String,
) : TapError(-1), MultiMessageError
}

View file

@ -7,6 +7,8 @@ import com.tangem.domain.common.ScanResponse
import com.tangem.tap.common.analytics.Analytics
import com.tangem.tap.common.extensions.dispatchOnMain
import com.tangem.tap.common.redux.global.GlobalAction
import com.tangem.tap.domain.TapError
import com.tangem.tap.domain.walletconnect.extensions.isDappSupported
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectAction
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectDialog
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectSession
@ -58,7 +60,12 @@ class WalletConnectManager {
fun connect(wcUri: String) {
val session = WCSession.from(wcUri).guard {
store.dispatchOnMain(WalletConnectAction.FailureEstablishingSession(null, true))
store.dispatchOnMain(
WalletConnectAction.FailureEstablishingSession(
session = null,
error = TapError.WalletConnect.UnsupportedLink,
),
)
return
}
if (sessions[session] != null) {
@ -72,7 +79,12 @@ class WalletConnectManager {
try {
client.connect(session, tangemPeerMeta, peerId)
} catch (exception: IllegalArgumentException) {
store.dispatchOnMain(WalletConnectAction.FailureEstablishingSession(null, true))
store.dispatchOnMain(
WalletConnectAction.FailureEstablishingSession(
session = null,
error = TapError.WalletConnect.UnsupportedLink,
),
)
return
}
@ -341,21 +353,30 @@ class WalletConnectManager {
val session = client.session
val data = sessions[session]?.copy(peerMeta = peer, remotePeerId = client.remotePeerId)
if (data != null && session != null) {
sessions[session] = data
val sessionData = data.toWalletConnectSession()
sessionData?.let {
if (!peer.isDappSupported()) {
store.dispatchOnMain(
WalletConnectAction.ScanCard(
session = sessionData,
chainId = client.chainId?.toIntOrNull()
WalletConnectAction.FailureEstablishingSession(
session = session,
error = TapError.WalletConnect.UnsupportedDapp,
),
)
} else {
sessions[session] = data
val sessionData = data.toWalletConnectSession()
sessionData?.let {
store.dispatchOnMain(
WalletConnectAction.ScanCard(
session = sessionData,
chainId = client.chainId?.toIntOrNull(),
),
)
}
store.state.globalState.analyticsHandlers?.logWcEvent(
Analytics.WcAnalyticsEvent.Session(
Analytics.WcSessionEvent.Connect, peer.url,
),
)
}
store.state.globalState.analyticsHandlers?.logWcEvent(
Analytics.WcAnalyticsEvent.Session(
Analytics.WcSessionEvent.Connect, peer.url
)
)
}
}
client.onSessionUpdate = { id: Long, update: WCSessionUpdate ->

View file

@ -0,0 +1,9 @@
package com.tangem.tap.domain.walletconnect.extensions
import com.trustwallet.walletconnect.models.WCPeerMeta
fun WCPeerMeta.isDappSupported(): Boolean {
return !unsupportedDappsList.any { this.url.contains(it) }
}
private val unsupportedDappsList: List<String> = listOf("dydx.exchange")

View file

@ -448,6 +448,33 @@ class DemoConfig {
"AB02000000049533",
"AB02000000049541",
"AB02000000049830",
// === more cids ===
"AC03000000091418",
"AC03000000091400",
"AC03000000099007",
"AC03000000098991",
"AC03000000098942",
"AC03000000091715",
"AC03000000091301",
"AC03000000091343",
"AB01000000055705",
"AB01000000052918",
"AB01000000047710",
"AB01000000052306",
"AB01000000047645",
"AB01000000048957",
"AB01000000052900",
"AB01000000050391",
"AB01000000047363",
"AB02000000053998",
"AB02000000019809",
"AB02000000020872",
"AB02000000022027",
"AB02000000058955",
"AB02000000053253",
"AB02000000048063",
"AB02000000023736",
"AB02000000058187",
)
private val testDemoCardIds = listOf(

View file

@ -3,6 +3,7 @@ package com.tangem.tap.features.details.redux.walletconnect
import com.tangem.blockchain.common.Blockchain
import com.tangem.domain.common.ScanResponse
import com.tangem.tap.common.redux.NotificationAction
import com.tangem.tap.domain.TapError
import com.tangem.wallet.R
import com.trustwallet.walletconnect.models.binance.WCBinanceTradeOrder
import com.trustwallet.walletconnect.models.binance.WCBinanceTransferOrder
@ -52,11 +53,7 @@ sealed class WalletConnectAction : Action {
val updatedSession: WalletConnectSession,
) : WalletConnectAction()
data class FailureEstablishingSession(
val session: WCSession?,
val showWarning: Boolean = false,
) : WalletConnectAction()
data class FailureEstablishingSession(val session: WCSession?, val error: TapError? = null) : WalletConnectAction()
data class SetSessionsRestored(val sessions: List<WalletConnectSession>) :
WalletConnectAction()

View file

@ -98,19 +98,19 @@ class WalletConnectMiddleware {
store.dispatchOnMain(GlobalAction.ShowDialog(WalletConnectDialog.SessionTimeout))
}
is WalletConnectAction.FailureEstablishingSession -> {
if (action.session != null) {
walletConnectManager.disconnect(action.session)
}
if (action.showWarning) {
store.dispatchOnMain(
if (action.error != null) {
store.dispatch(
GlobalAction.ShowDialog(
AppDialog.SimpleOkDialogRes(
headerId = R.string.common_warning,
messageId = R.string.wallet_connect_error_failed_to_connect,
messageId = action.error.messageResource,
),
),
)
}
if (action.session != null) {
walletConnectManager.disconnect(action.session)
}
}
is WalletConnectAction.UnsupportedCard -> {
store.dispatchOnMain(GlobalAction.ShowDialog(WalletConnectDialog.UnsupportedCard))

View file

@ -0,0 +1,40 @@
<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="#F1F1F1"
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="#A1A1A4"
android:pathData="M10.75,3.737L10.75,5.243L7.014,10.538L6.243,10.081L10.75,3.737Z" />
<path
android:fillColor="#A1A1A4"
android:pathData="M7.445,10.793L10.75,6.111L10.749,12.751L7.445,10.793Z" />
<path
android:fillColor="#A1A1A4"
android:pathData="M11.25,5.243L11.25,3.739L15.757,10.081L15.057,10.495L11.25,5.243Z" />
<path
android:fillColor="#A1A1A4"
android:pathData="M11.25,6.095L11.249,12.752L14.625,10.752L11.25,6.095Z" />
<path
android:fillColor="#A1A1A4"
android:pathData="M10.749,15.656L10.749,17.039L9.272,14.739L10.749,15.656Z" />
<path
android:fillColor="#A1A1A4"
android:pathData="M11.249,17.035L11.249,15.657L12.701,14.756L11.249,17.035Z" />
<path
android:fillColor="#A1A1A4"
android:pathData="M13.681,14.148L14.915,13.382L11.25,18.88L11.25,17.966L13.681,14.148Z" />
<path
android:fillColor="#A1A1A4"
android:pathData="M10.75,18.879L10.75,17.965L8.29,14.135L8.284,14.126L7.085,13.382L10.75,18.879Z" />
<path
android:fillColor="#A1A1A4"
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

@ -0,0 +1,40 @@
<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

@ -0,0 +1,31 @@
<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="#F1F1F1"
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" />
<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: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: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: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: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:pathData="M10.998,18.146L15.4,11.963L10.998,14.556L6.6,11.963L10.998,18.146Z" />
</group>
</group>
</vector>

View file

@ -0,0 +1,166 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
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="#F6F5FF"
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" />
<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:pathData="M10.998,3.85L10.902,4.176V13.629L10.998,13.725L15.397,11.131L10.998,3.85Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="13.5"
android:endY="12.5"
android:startX="11.5"
android:startY="6.5"
android:type="linear">
<item
android:color="#FFE1F0F3"
android:offset="0" />
<item
android:color="#FFB3DBF5"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M10.998,3.85L6.6,11.131L10.998,13.725V9.136V3.85Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="6.5"
android:endY="11"
android:startX="10.75"
android:startY="4"
android:type="linear">
<item
android:color="#FFE1F0F3"
android:offset="0.161" />
<item
android:color="#FFA795F2"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#C6C7FA"
android:pathData="M10.998,14.556L10.944,14.622V17.989L10.998,18.147L15.4,11.963L10.998,14.556Z" />
<path
android:fillColor="#6E89D5"
android:pathData="M10.998,18.147V14.556L6.6,11.963L10.998,18.147Z" />
<path
android:fillColor="#F2F6F4"
android:pathData="M10.998,13.725L15.397,11.131L10.998,9.137V13.725Z" />
<path android:pathData="M6.6,11.131L10.998,13.725V9.137L6.6,11.131Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="9"
android:endY="12.5"
android:startX="11"
android:startY="9"
android:type="linear">
<item
android:color="#FFDDE1F9"
android:offset="0" />
<item
android:color="#FFD7D1FA"
android:offset="0.993" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#B2B6E9"
android:fillType="evenOdd"
android:pathData="M7.966,8.88C8.032,8.861 8.101,8.899 8.12,8.966L9.039,12.18L10.805,9.09C10.891,8.939 11.109,8.939 11.195,9.09L12.961,12.18L13.88,8.966C13.899,8.899 13.968,8.861 14.034,8.88C14.101,8.899 14.139,8.968 14.12,9.034L13.185,12.306C13.131,12.498 12.873,12.529 12.774,12.356L11,9.252L9.226,12.356C9.128,12.529 8.869,12.498 8.815,12.306L7.88,9.034C7.861,8.968 7.899,8.899 7.966,8.88Z" />
<path android:pathData="M11.75,9.1C11.75,9.514 11.414,9.85 11,9.85C10.586,9.85 10.25,9.514 10.25,9.1C10.25,8.686 10.586,8.35 11,8.35C11.414,8.35 11.75,8.686 11.75,9.1Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="11"
android:endY="9.85"
android:startX="11"
android:startY="8.35"
android:type="linear">
<item
android:color="#FFC4C9F4"
android:offset="0" />
<item
android:color="#FF859ADC"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M8.6,8.75C8.6,9.164 8.264,9.5 7.85,9.5C7.435,9.5 7.1,9.164 7.1,8.75C7.1,8.336 7.435,8 7.85,8C8.264,8 8.6,8.336 8.6,8.75Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="7.85"
android:endY="9.5"
android:startX="7.85"
android:startY="8"
android:type="linear">
<item
android:color="#FFC4C9F4"
android:offset="0" />
<item
android:color="#FF859ADC"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M14.899,8.75C14.899,9.164 14.564,9.5 14.149,9.5C13.735,9.5 13.399,9.164 13.399,8.75C13.399,8.336 13.735,8 14.149,8C14.564,8 14.899,8.336 14.899,8.75Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="14.149"
android:endY="9.5"
android:startX="14.149"
android:startY="8"
android:type="linear">
<item
android:color="#FFC4C9F4"
android:offset="0" />
<item
android:color="#FF859ADC"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M13.6,12.35C13.6,12.764 13.264,13.1 12.85,13.1C12.435,13.1 12.1,12.764 12.1,12.35C12.1,11.936 12.435,11.6 12.85,11.6C13.264,11.6 13.6,11.936 13.6,12.35Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="12.85"
android:endY="13.1"
android:startX="12.85"
android:startY="11.6"
android:type="linear">
<item
android:color="#FFC4C9F4"
android:offset="0" />
<item
android:color="#FF859ADC"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path android:pathData="M9.899,12.35C9.899,12.764 9.564,13.1 9.149,13.1C8.735,13.1 8.399,12.764 8.399,12.35C8.399,11.936 8.735,11.6 9.149,11.6C9.564,11.6 9.899,11.936 9.899,12.35Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="9.149"
android:endY="13.1"
android:startX="9.149"
android:startY="11.6"
android:type="linear">
<item
android:color="#FFC4C9F4"
android:offset="0" />
<item
android:color="#FF859ADC"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
</group>
</group>
</vector>

View file

@ -93,4 +93,5 @@
<string name="send_extras_hint_destination_tag">Tag</string>
<string name="send_extras_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction.</string>
<string name="send_extras_error_invalid_destination_tag">Invalid Tag. It won\'t be added to the transaction.</string>
<string name="wallet_connect_error_unsupported_dapp">Connection with this Dapp cannot be established due to its technical implementation.</string>
</resources>

View file

@ -93,4 +93,5 @@
<string name="send_extras_hint_destination_tag">Tag</string>
<string name="send_extras_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction.</string>
<string name="send_extras_error_invalid_destination_tag">Invalid Tag. It won\'t be added to the transaction.</string>
<string name="wallet_connect_error_unsupported_dapp">Connection with this Dapp cannot be established due to its technical implementation.</string>
</resources>

View file

@ -93,4 +93,5 @@
<string name="send_extras_hint_destination_tag">Tag</string>
<string name="send_extras_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction.</string>
<string name="send_extras_error_invalid_destination_tag">Invalid Tag. It won\'t be added to the transaction.</string>
<string name="wallet_connect_error_unsupported_dapp">Connection with this Dapp cannot be established due to its technical implementation.</string>
</resources>

View file

@ -103,6 +103,6 @@
<string name="send_extras_hint_destination_tag">Tag</string>
<string name="send_extras_error_invalid_memo">Недопустимый Memo. Он не будет добавлен в транзакцию.</string>
<string name="send_extras_error_invalid_destination_tag">Недопустимый Tag. Он не будет добавлен в транзакцию.</string>
<string name="warning_existential_deposit_message">Сеть %s использует концепцию экзистенциального депозита. Если баланс вашего счета опустится ниже %s %s, он будет деактивирован, а все оставшиеся средства будут уничтожены.</string>
<string name="wallet_connect_error_failed_to_connect">Не удалось установить сессию WalletConnect</string>
<string name="wallet_connect_error_unsupported_dapp">Cоединение с этим Dapp сервисом не может быть установлено из-за его технической реализации.</string>
</resources>

View file

@ -106,4 +106,5 @@
<string name="send_extras_hint_destination_tag">Tag</string>
<string name="send_extras_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction.</string>
<string name="send_extras_error_invalid_destination_tag">Invalid Tag. It won\'t be added to the transaction.</string>
<string name="wallet_connect_error_unsupported_dapp">Connection with this Dapp cannot be established due to its technical implementation.</string>
</resources>

View file

@ -2,7 +2,7 @@ ext.versions = [
kotlin : '1.6.10',
build_gradle : '7.1.3',
tangem_card_sdk : 'develop-159',
tangem_blockchain_sdk: 'develop-115',
tangem_blockchain_sdk: 'develop-121',
// tangem_blockchain_sdk: '0.0.1',
]

View file

@ -5,7 +5,7 @@ import com.tangem.blockchain.common.Blockchain
fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
return when (networkId) {
"arbitrum-one" -> Blockchain.Arbitrum
"arbitrum/test" -> Blockchain.ArbitrumTestnet
"arbitrum-one/test" -> Blockchain.ArbitrumTestnet
"avalanche", "avalanche-2" -> Blockchain.Avalanche
"avalanche/test", "avalanche-2/test" -> Blockchain.AvalancheTestnet
"binancecoin" -> Blockchain.Binance
@ -38,6 +38,9 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
"tron/test" -> Blockchain.TronTestnet
"xrp", "ripple" -> Blockchain.XRP
"xdai" -> Blockchain.Gnosis
"ethereum-pow-iou" -> Blockchain.EthereumPow
"ethereum-pow-iou/test" -> Blockchain.EthereumPowTestnet
"ethereumfair" -> Blockchain.EthereumFair
"polkadot" -> Blockchain.Polkadot
"polkadot/test" -> Blockchain.PolkadotTestnet
"kusama" -> Blockchain.Kusama
@ -86,6 +89,9 @@ fun Blockchain.toNetworkId(): String {
Blockchain.Tron -> "tron"
Blockchain.TronTestnet -> "tron/test"
Blockchain.Gnosis -> "xdai"
Blockchain.EthereumPow -> "ethereum-pow-iou"
Blockchain.EthereumPowTestnet -> "ethereum-pow-iou/test"
Blockchain.EthereumFair -> "ethereumfair"
Blockchain.Polkadot -> "polkadot"
Blockchain.PolkadotTestnet -> "polkadot/test"
Blockchain.Kusama -> "kusama"
@ -118,6 +124,8 @@ fun Blockchain.toCoinId(): String {
Blockchain.XRP -> "ripple"
Blockchain.Dogecoin -> "dogecoin"
Blockchain.Gnosis -> "xdai"
Blockchain.EthereumPow, Blockchain.EthereumPowTestnet -> "ethereum-pow-iou"
Blockchain.EthereumFair -> "ethereumfair"
Blockchain.Kusama -> "kusama"
Blockchain.Optimism, Blockchain.OptimismTestnet -> "ethereum"
Blockchain.Dash -> "dash"