Updated on 2026-08-14
This commit is contained in:
commit
1a1d9c804f
25 changed files with 478 additions and 89 deletions
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
else -> R.drawable.ic_tangem_logo
|
||||
}
|
||||
}
|
||||
|
|
@ -55,6 +57,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
|
||||
else -> R.drawable.ic_tangem_logo
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,19 +5,23 @@ import androidx.annotation.ColorInt
|
|||
import androidx.core.graphics.luminance
|
||||
import androidx.core.graphics.toColorInt
|
||||
import com.tangem.blockchain.common.Token
|
||||
import com.tangem.wallet.R
|
||||
|
||||
@ColorInt
|
||||
fun Token.getColor(): Int {
|
||||
return try {
|
||||
("#" + this.contractAddress.subSequence(2..7).toString())
|
||||
.toColorInt()
|
||||
fun Token.getColor(isTestnet: Boolean = false): Int {
|
||||
val defaultColor = "#C7C7CC".toColorInt() // equivalent to R.color.lightGray4
|
||||
|
||||
return if (isTestnet)
|
||||
defaultColor
|
||||
else try {
|
||||
("#" + this.contractAddress.subSequence(2..7).toString()).toColorInt()
|
||||
} catch (exception: Exception) {
|
||||
R.color.lightGray4
|
||||
defaultColor
|
||||
}
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
fun Token.getTextColor(): Int {
|
||||
return if (this.getColor().luminance > 0.5) Color.BLACK else Color.WHITE
|
||||
fun Token.getTextColor(isTestnet: Boolean = false): Int = when {
|
||||
isTestnet -> Color.WHITE
|
||||
this.getColor().luminance > 0.5 -> Color.BLACK
|
||||
else -> Color.WHITE
|
||||
}
|
||||
|
|
@ -41,7 +41,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 {
|
||||
|
|
@ -52,9 +52,13 @@ 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)
|
||||
}
|
||||
|
||||
data class ValidateTransactionErrors(
|
||||
override val errorList: List<TapError>,
|
||||
override val builder: (List<String>) -> String
|
||||
override val builder: (List<String>) -> String,
|
||||
) : TapError(-1), MultiMessageError
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import com.tangem.common.extensions.guard
|
|||
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
|
||||
|
|
@ -325,21 +327,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 ->
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.tangem.tap.features.details.redux.walletconnect
|
|||
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
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
|
||||
|
|
@ -53,7 +54,7 @@ sealed class WalletConnectAction : Action {
|
|||
val updatedSession: WalletConnectSession,
|
||||
) : WalletConnectAction()
|
||||
|
||||
data class FailureEstablishingSession(val session: WCSession?) : WalletConnectAction()
|
||||
data class FailureEstablishingSession(val session: WCSession?, val error: TapError? = null) : WalletConnectAction()
|
||||
data class SetSessionsRestored(val sessions: List<WalletConnectSession>) :
|
||||
WalletConnectAction()
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.tangem.domain.common.ScanResponse
|
|||
import com.tangem.domain.common.TapWorkarounds.derivationStyle
|
||||
import com.tangem.domain.common.extensions.withMainContext
|
||||
import com.tangem.tap.common.extensions.dispatchOnMain
|
||||
import com.tangem.tap.common.redux.AppDialog
|
||||
import com.tangem.tap.common.redux.AppState
|
||||
import com.tangem.tap.common.redux.global.GlobalAction
|
||||
import com.tangem.tap.common.redux.navigation.AppScreen
|
||||
|
|
@ -90,6 +91,16 @@ class WalletConnectMiddleware {
|
|||
store.dispatchOnMain(GlobalAction.ShowDialog(WalletConnectDialog.SessionTimeout))
|
||||
}
|
||||
is WalletConnectAction.FailureEstablishingSession -> {
|
||||
if (action.error != null) {
|
||||
store.dispatch(
|
||||
GlobalAction.ShowDialog(
|
||||
AppDialog.SimpleOkDialogRes(
|
||||
headerId = R.string.common_warning,
|
||||
messageId = action.error.messageResource,
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
if (action.session != null) {
|
||||
walletConnectManager.disconnect(action.session)
|
||||
}
|
||||
|
|
@ -273,21 +284,21 @@ class WalletConnectMiddleware {
|
|||
)
|
||||
return
|
||||
}
|
||||
val wallet = walletManager.wallet
|
||||
val derivedKey =
|
||||
if (wallet.publicKey.blockchainKey.contentEquals(wallet.publicKey.seedKey)) {
|
||||
null
|
||||
} else {
|
||||
walletManager.wallet.publicKey.blockchainKey
|
||||
}
|
||||
val walletForSession = WalletForSession(
|
||||
cardId = scanResponse.card.cardId,
|
||||
walletPublicKey = wallet.publicKey.seedKey,
|
||||
derivedPublicKey = derivedKey,
|
||||
derivationPath = wallet.publicKey.derivationPath,
|
||||
derivationStyle = scanResponse.card.derivationStyle,
|
||||
blockchain = wallet.blockchain,
|
||||
)
|
||||
val wallet = walletManager.wallet
|
||||
val derivedKey =
|
||||
if (wallet.publicKey.blockchainKey.contentEquals(wallet.publicKey.seedKey)) {
|
||||
null
|
||||
} else {
|
||||
walletManager.wallet.publicKey.blockchainKey
|
||||
}
|
||||
val walletForSession = WalletForSession(
|
||||
cardId = scanResponse.card.cardId,
|
||||
walletPublicKey = wallet.publicKey.seedKey,
|
||||
derivedPublicKey = derivedKey,
|
||||
derivationPath = wallet.publicKey.derivationPath,
|
||||
derivationStyle = scanResponse.card.derivationStyle,
|
||||
blockchain = wallet.blockchain,
|
||||
)
|
||||
|
||||
withMainContext {
|
||||
val updatedSession = session.copy(wallet = walletForSession)
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import com.tangem.tap.features.wallet.redux.WalletState
|
|||
import com.tangem.tap.features.wallet.redux.WalletState.Companion.UNKNOWN_AMOUNT_SIGN
|
||||
import com.tangem.tap.features.wallet.ui.adapters.PendingTransactionsAdapter
|
||||
import com.tangem.tap.features.wallet.ui.adapters.WalletDetailWarningMessagesAdapter
|
||||
import com.tangem.tap.features.wallet.ui.images.load
|
||||
import com.tangem.tap.features.wallet.ui.test.TestWalletDetails
|
||||
import com.tangem.tap.store
|
||||
import com.tangem.wallet.R
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import com.tangem.tap.common.extensions.show
|
|||
import com.tangem.tap.features.wallet.redux.WalletAction
|
||||
import com.tangem.tap.features.wallet.redux.WalletData
|
||||
import com.tangem.tap.features.wallet.ui.BalanceStatus
|
||||
import com.tangem.tap.features.wallet.ui.images.load
|
||||
import com.tangem.tap.store
|
||||
import com.tangem.wallet.R
|
||||
import com.tangem.wallet.databinding.ItemCurrencyWalletBinding
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ private const val VOYR = "VOYRME"
|
|||
|
||||
class CurrencyIconRequest(
|
||||
private val currencyImageView: ImageFilterView,
|
||||
private val currencyTextView: TextView,
|
||||
private val currencyTextView: TextView?,
|
||||
private val token: Token?,
|
||||
private val blockchain: Blockchain,
|
||||
) {
|
||||
|
|
@ -38,7 +38,7 @@ class CurrencyIconRequest(
|
|||
loadBlockchainIconBase(
|
||||
onStart = {
|
||||
currencyImageView.colorFilter = null
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ class CurrencyIconRequest(
|
|||
loadBlockchainIconBase(
|
||||
onStart = {
|
||||
currencyImageView.saturation = 0f
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -57,7 +57,11 @@ class CurrencyIconRequest(
|
|||
},
|
||||
onSuccess = {
|
||||
currencyImageView.colorFilter = null
|
||||
}
|
||||
},
|
||||
onError = {
|
||||
currencyImageView.setColorFilter(it.getColor())
|
||||
currencyTextView?.setTextColor(it.getTextColor())
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +69,12 @@ class CurrencyIconRequest(
|
|||
loadTokenIconBase(
|
||||
onStart = {
|
||||
currencyImageView.saturation = 0f
|
||||
}
|
||||
},
|
||||
onError = {
|
||||
currencyImageView.saturation = 0f
|
||||
currencyImageView.setColorFilter(it.getColor(true))
|
||||
currencyTextView?.setTextColor(it.getTextColor(true))
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -94,15 +103,19 @@ class CurrencyIconRequest(
|
|||
data = getTokenIcon(token, blockchain),
|
||||
placeholderRes = R.drawable.shape_circle,
|
||||
onStart = {
|
||||
currencyTextView.text = token.symbol.take(1)
|
||||
currencyTextView.setTextColor(token.getTextColor())
|
||||
currencyTextView?.text = token.name.take(1)
|
||||
currencyTextView?.setTextColor(token.getTextColor())
|
||||
onStart(token)
|
||||
},
|
||||
onSuccess = {
|
||||
currencyTextView.text = null
|
||||
currencyTextView?.text = null
|
||||
onSuccess(token)
|
||||
},
|
||||
onError = { onError(token) },
|
||||
onError = {
|
||||
// for some reason the onStart doesn't call if an error occurs
|
||||
currencyTextView?.text = token.name.take(1)
|
||||
onError(token)
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -122,7 +135,7 @@ private inline fun ImageView.loadIcon(
|
|||
.listener(
|
||||
onStart = { onStart() },
|
||||
onSuccess = { _, _ -> onSuccess() },
|
||||
onError = { _, _ -> onError() }
|
||||
onError = { _, _ -> onError() },
|
||||
)
|
||||
.target(imageView = this)
|
||||
.build()
|
||||
|
|
|
|||
|
|
@ -4,13 +4,11 @@ import android.content.Context
|
|||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.isVisible
|
||||
import com.tangem.blockchain.common.DerivationStyle
|
||||
import com.tangem.tangem_sdk_new.extensions.dpToPx
|
||||
import com.tangem.tap.common.extensions.getRoundIconRes
|
||||
import com.tangem.tap.features.wallet.models.Currency
|
||||
import com.tangem.wallet.databinding.ViewCurrencyIconBinding
|
||||
import kotlin.math.roundToInt
|
||||
|
|
@ -24,47 +22,46 @@ class CurrencyIconView @JvmOverloads constructor(
|
|||
LayoutInflater.from(context),
|
||||
this,
|
||||
)
|
||||
|
||||
private val currencyImageView: ImageFilterView
|
||||
val currencyImageView: ImageFilterView
|
||||
get() = binding.ivCurrency
|
||||
|
||||
private val currencyTextView: TextView
|
||||
val currencyTextView: TextView
|
||||
get() = binding.tvTokenLetter
|
||||
|
||||
private var isBlockchainIconVisible: Boolean
|
||||
get() = binding.ivBlockchain.isVisible
|
||||
set(value) = binding.ivBlockchain::isVisible.set(value)
|
||||
|
||||
private var isBadgeVisible: Boolean
|
||||
get() = binding.badge.isVisible
|
||||
set(value) = binding.badge::isVisible.set(value)
|
||||
|
||||
@DrawableRes
|
||||
private var blockchainIconRes: Int? = null
|
||||
set(value) {
|
||||
if (value != null && value != field && isBlockchainIconVisible) {
|
||||
binding.ivBlockchain.setImageResource(value)
|
||||
field = value
|
||||
}
|
||||
}
|
||||
val blockchainBadge: ImageFilterView
|
||||
get() = binding.ivBlockchainBadge
|
||||
var isBlockchainBadgeVisible: Boolean
|
||||
get() = binding.ivBlockchainBadge.isVisible
|
||||
set(value) = binding.ivBlockchainBadge::isVisible.set(value)
|
||||
var isCustomCurrencyBadgeVisible: Boolean
|
||||
get() = binding.customBadge.isVisible
|
||||
set(value) = binding.customBadge::isVisible.set(value)
|
||||
|
||||
init {
|
||||
minWidth = dpToPx(48f).roundToInt()
|
||||
minHeight = dpToPx(48f).roundToInt()
|
||||
}
|
||||
}
|
||||
|
||||
fun load(
|
||||
currency: Currency,
|
||||
derivationStyle: DerivationStyle?,
|
||||
) {
|
||||
isBlockchainIconVisible = currency.isToken()
|
||||
isBadgeVisible = currency.isCustomCurrency(derivationStyle)
|
||||
blockchainIconRes = currency.blockchain.getRoundIconRes()
|
||||
fun CurrencyIconView.load(
|
||||
currency: Currency,
|
||||
derivationStyle: DerivationStyle?,
|
||||
) {
|
||||
isCustomCurrencyBadgeVisible = currency.isCustomCurrency(derivationStyle)
|
||||
|
||||
CurrencyIconRequest(
|
||||
currencyImageView = currencyImageView,
|
||||
currencyTextView = currencyTextView,
|
||||
token = (currency as? Currency.Token)?.token,
|
||||
blockchain = currency.blockchain,
|
||||
).load()
|
||||
|
||||
if (currency.isToken()) {
|
||||
// load a blockchain icon into the blockchain badge
|
||||
isBlockchainBadgeVisible = true
|
||||
|
||||
CurrencyIconRequest(
|
||||
currencyImageView = currencyImageView,
|
||||
currencyTextView = currencyTextView,
|
||||
token = (currency as? Currency.Token)?.token,
|
||||
currencyImageView = blockchainBadge,
|
||||
currencyTextView = null,
|
||||
token = null,
|
||||
blockchain = currency.blockchain,
|
||||
).load()
|
||||
}
|
||||
|
|
|
|||
40
app/src/main/res/drawable/ic_ethereumfair_no_color.xml
Normal file
40
app/src/main/res/drawable/ic_ethereumfair_no_color.xml
Normal 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>
|
||||
40
app/src/main/res/drawable/ic_ethereumfair_round.xml
Normal file
40
app/src/main/res/drawable/ic_ethereumfair_round.xml
Normal 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>
|
||||
31
app/src/main/res/drawable/ic_ethereumpow_no_color.xml
Normal file
31
app/src/main/res/drawable/ic_ethereumpow_no_color.xml
Normal 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>
|
||||
166
app/src/main/res/drawable/ic_ethereumpow_round.xml
Normal file
166
app/src/main/res/drawable/ic_ethereumpow_round.xml
Normal 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>
|
||||
|
|
@ -35,12 +35,13 @@
|
|||
android:textColor="@android:color/white"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold"
|
||||
android:translationY="-1dp"
|
||||
tools:text="J" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_blockchain"
|
||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
android:id="@+id/iv_blockchain_badge"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:background="@drawable/shape_circle"
|
||||
|
|
@ -54,7 +55,7 @@
|
|||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:id="@+id/badge"
|
||||
android:id="@+id/custom_badge"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:background="@drawable/shape_badge_custom_currency"
|
||||
|
|
|
|||
|
|
@ -99,4 +99,6 @@
|
|||
<string name="send_extras_hint_destination_tag">Tag</string>
|
||||
<string name="send_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction</string>
|
||||
<string name="send_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>
|
||||
|
|
@ -99,4 +99,6 @@
|
|||
<string name="send_extras_hint_destination_tag">Tag</string>
|
||||
<string name="send_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction</string>
|
||||
<string name="send_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>
|
||||
|
|
@ -100,4 +100,6 @@
|
|||
<string name="send_extras_hint_destination_tag">Tag</string>
|
||||
<string name="send_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction</string>
|
||||
<string name="send_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>
|
||||
|
|
@ -116,4 +116,6 @@
|
|||
<string name="send_extras_hint_destination_tag">Tag</string>
|
||||
<string name="send_error_invalid_memo">Недопустимый Memo. Он не будет добавлен в транзакцию.</string>
|
||||
<string name="send_error_invalid_destination_tag">Недопустимый Tag. Он не будет добавлен в транзакцию.</string>
|
||||
|
||||
<string name="wallet_connect_error_unsupported_dapp">Cоединение с этим Dapp сервисом не может быть установлено из-за его технической реализации.</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -118,4 +118,6 @@
|
|||
<string name="send_extras_hint_destination_tag">Tag</string>
|
||||
<string name="send_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction</string>
|
||||
<string name="send_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>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ ext.versions = [
|
|||
kotlin : '1.6.10',
|
||||
build_gradle : '7.1.3',
|
||||
tangem_card_sdk : 'develop-159',
|
||||
tangem_blockchain_sdk: 'AND-2102-develop-105-hotfix_xlm-109',
|
||||
tangem_blockchain_sdk: 'AND-2145_develop_105_hotfix_eth_classic-118',
|
||||
// tangem_blockchain_sdk: '0.0.1',
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
|
@ -80,6 +83,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"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -105,6 +111,8 @@ fun Blockchain.toCoinId(): String {
|
|||
Blockchain.Dogecoin -> "dogecoin"
|
||||
Blockchain.Tron, Blockchain.TronTestnet -> "tron"
|
||||
Blockchain.Gnosis -> "xdai"
|
||||
Blockchain.EthereumPow, Blockchain.EthereumPowTestnet -> "ethereum-pow-iou"
|
||||
Blockchain.EthereumFair -> "ethereumfair"
|
||||
Blockchain.Unknown -> "unknown"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue