Updated on 2026-08-14

This commit is contained in:
Tangem 2022-12-16 00:04:18 +03:00
parent d17f046b06
commit bd0797b3d2
8 changed files with 24 additions and 22 deletions

View file

@ -11,17 +11,10 @@ object SaltPayWorkaround {
Blockchain.SaltPay -> Token(
name = "WXDAI",
symbol = "wxDAI",
contractAddress = "0x4346186e7461cB4DF06bCFCB4cD591423022e417",
contractAddress = "0x4200000000000000000000000000000000000006",
decimals = 18,
id = "wrapped-xdai",
)
Blockchain.SaltPayTestnet -> Token(
name = "WXDAI Test",
symbol = "MyERC20",
contractAddress = "0x69cca8D8295de046C7c14019D9029Ccc77987A48",
decimals = 0,
id = "wrapped-xdai",
)
else -> throw IllegalArgumentException()
}
}

View file

@ -30,7 +30,7 @@ data class ScanResponse(
) : CommandResponse {
fun getBlockchain(): Blockchain {
return when (productType) {
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

View file

@ -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"
}
}