Updated on 2026-08-14
This commit is contained in:
parent
1e6ee16b22
commit
cf0a180b3a
3 changed files with 17 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.tap.domain
|
||||
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.commands.common.card.Card
|
||||
import com.tangem.commands.common.card.EllipticCurve
|
||||
import com.tangem.commands.common.card.masks.Product
|
||||
|
|
@ -36,6 +37,19 @@ object TapWorkarounds {
|
|||
return multiCurrencyWalletsBatches.contains(cardData?.batchId)
|
||||
}
|
||||
|
||||
val Card.noteCurrency: Blockchain?
|
||||
get() {
|
||||
return when (cardData?.batchId) {
|
||||
"AB01" -> Blockchain.Bitcoin
|
||||
"AB02" -> Blockchain.Ethereum
|
||||
"AB03" -> Blockchain.Cardano
|
||||
"AB04" -> Blockchain.Dogecoin
|
||||
"AB05" -> Blockchain.Binance
|
||||
"AB06" -> Blockchain.XRP
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
private const val START_2_COIN_ISSUER = "start2coin"
|
||||
|
||||
private val excludedBatches = listOf(
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.tangem.commands.common.card.CardStatus
|
|||
import com.tangem.commands.wallet.CardWallet
|
||||
import com.tangem.commands.wallet.WalletStatus
|
||||
import com.tangem.common.TangemSdkConstants
|
||||
import com.tangem.tap.domain.TapWorkarounds.noteCurrency
|
||||
|
||||
fun Card.getToken(): Token? {
|
||||
val symbol = cardData?.tokenSymbol ?: return null
|
||||
|
|
@ -18,6 +19,7 @@ fun Card.getToken(): Token? {
|
|||
}
|
||||
|
||||
fun Card.getBlockchain(): Blockchain? {
|
||||
if (noteCurrency != null) return noteCurrency
|
||||
val blockchainName: String = cardData?.blockchainName ?: return null
|
||||
return Blockchain.fromId(blockchainName)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,9 +165,7 @@ class ScanNoteTask(val card: Card? = null) : CardSessionRunnable<ScanNoteRespons
|
|||
class UpdateAppToUseThisCard : TangemError {
|
||||
override val code: Int = 50005
|
||||
override var customMessage: String = code.toString()
|
||||
override val messageResId: Int
|
||||
get() = R.string.error_update_app
|
||||
|
||||
override val messageResId: Int = R.string.error_update_app
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue