Updated on 2026-08-14
This commit is contained in:
parent
9ffebc7634
commit
6587833fad
8 changed files with 7 additions and 17 deletions
|
|
@ -143,7 +143,7 @@ fun WalletManagerFactory.makeSaltPayWalletManager(
|
|||
scanResponse: ScanResponse,
|
||||
): EthereumWalletManager {
|
||||
val blockchain = scanResponse.getBlockchain()
|
||||
if (blockchain != Blockchain.SaltPay && blockchain != Blockchain.SaltPayTestnet)
|
||||
if (blockchain != Blockchain.SaltPay)
|
||||
throw IllegalArgumentException()
|
||||
|
||||
val token = SaltPayWorkaround.tokenFrom(blockchain)
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ class UserWalletBuilder(
|
|||
ProductType.Note -> "Note"
|
||||
ProductType.Twins -> "Twin"
|
||||
ProductType.SaltPay -> "SaltPay"
|
||||
ProductType.Start2Coin -> "Start2Coin"
|
||||
ProductType.Wallet -> when {
|
||||
card.isBackupNotAllowed -> "Tangem card"
|
||||
card.isStart2Coin -> "Start2Coin"
|
||||
else -> "Wallet"
|
||||
}
|
||||
}
|
||||
|
|
@ -41,6 +41,7 @@ class UserWalletBuilder(
|
|||
ProductType.Note -> false
|
||||
ProductType.Twins -> false
|
||||
ProductType.SaltPay -> false
|
||||
ProductType.Start2Coin -> false
|
||||
ProductType.Wallet -> when {
|
||||
card.isStart2Coin -> false
|
||||
card.firmwareVersion >= FirmwareVersion.MultiWalletAvailable -> true
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ class UserWalletIdBuilder private constructor(
|
|||
ProductType.Note,
|
||||
ProductType.Wallet,
|
||||
ProductType.SaltPay,
|
||||
ProductType.Start2Coin,
|
||||
-> null
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ class GnosisRegistrator(
|
|||
|
||||
private val otpProcessorContractAddress: String = when (walletManager.wallet.blockchain) {
|
||||
Blockchain.SaltPay -> "0x3B4397C817A26521Df8bD01a949AFDE2251d91C2"
|
||||
Blockchain.SaltPayTestnet -> "0x710BF23486b549836509a08c184cE0188830f197"
|
||||
else -> throw IllegalArgumentException("GnosisRegistrator supports only the SaltPay blockchain")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ object Versions {
|
|||
// endregion Other libraries
|
||||
|
||||
// region Tangem
|
||||
const val tangemBlockchainSdk = "develop-141"
|
||||
const val tangemBlockchainSdk = "develop-151"
|
||||
|
||||
const val tangemCardSgk = "develop-179"
|
||||
// endregion Tangem
|
||||
|
|
|
|||
|
|
@ -15,13 +15,6 @@ object SaltPayWorkaround {
|
|||
decimals = 18,
|
||||
id = "wrapped-xdai",
|
||||
)
|
||||
Blockchain.SaltPayTestnet -> Token(
|
||||
name = "WXDAI Test",
|
||||
symbol = "MyERC20",
|
||||
contractAddress = "0x69cca8D8295de046C7c14019D9029Ccc77987A48",
|
||||
decimals = 0,
|
||||
id = "wrapped-xdai",
|
||||
)
|
||||
else -> throw IllegalArgumentException()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ import com.tangem.domain.common.TapWorkarounds.getTangemNoteBlockchain
|
|||
import com.tangem.domain.common.TapWorkarounds.isSaltPay
|
||||
import com.tangem.domain.common.TapWorkarounds.isSaltPayVisa
|
||||
import com.tangem.domain.common.TapWorkarounds.isSaltPayWallet
|
||||
import com.tangem.domain.common.TapWorkarounds.isStart2Coin
|
||||
import com.tangem.domain.common.TapWorkarounds.isTangemNote
|
||||
import com.tangem.domain.common.TapWorkarounds.isTangemTwins
|
||||
import com.tangem.domain.common.TapWorkarounds.isTestCard
|
||||
import com.tangem.operations.CommandResponse
|
||||
|
|
@ -33,7 +31,7 @@ data class ScanResponse(
|
|||
fun getBlockchain(): Blockchain {
|
||||
return when (productType) {
|
||||
ProductType.Start2Coin -> if (card.isTestCard) Blockchain.BitcoinTestnet else Blockchain.Bitcoin
|
||||
ProductType.SaltPay -> if (card.isTestCard) Blockchain.SaltPayTestnet else Blockchain.SaltPay
|
||||
ProductType.SaltPay -> Blockchain.SaltPay
|
||||
ProductType.Note -> card.getTangemNoteBlockchain() ?: Blockchain.Unknown
|
||||
else -> {
|
||||
val blockchainName: String = walletData?.blockchain ?: return Blockchain.Unknown
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
|
|||
"optimistic-ethereum/test" -> Blockchain.OptimismTestnet
|
||||
"dash" -> Blockchain.Dash
|
||||
"sxdai" -> Blockchain.SaltPay
|
||||
"sxdai/test" -> Blockchain.SaltPayTestnet
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
|
@ -101,7 +100,6 @@ fun Blockchain.toNetworkId(): String {
|
|||
Blockchain.OptimismTestnet -> "optimistic-ethereum/test"
|
||||
Blockchain.Dash -> "dash"
|
||||
Blockchain.SaltPay -> "sxdai"
|
||||
Blockchain.SaltPayTestnet -> "sxdai/test"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +131,7 @@ fun Blockchain.toCoinId(): String {
|
|||
Blockchain.Kusama -> "kusama"
|
||||
Blockchain.Optimism, Blockchain.OptimismTestnet -> "ethereum"
|
||||
Blockchain.Dash -> "dash"
|
||||
Blockchain.SaltPay, Blockchain.SaltPayTestnet -> "xdai"
|
||||
Blockchain.SaltPay -> "xdai"
|
||||
Blockchain.Unknown -> "unknown"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue