Updated on 2026-08-14
This commit is contained in:
parent
d17f046b06
commit
bd0797b3d2
8 changed files with 24 additions and 22 deletions
|
|
@ -66,12 +66,12 @@ class ConfigManager {
|
|||
config = config.copy(
|
||||
isTopUpEnabled = model.isTopUpEnabled,
|
||||
isSendingToPayIdEnabled = model.isSendingToPayIdEnabled,
|
||||
isCreatingTwinCardsAllowed = model.isCreatingTwinCardsAllowed
|
||||
isCreatingTwinCardsAllowed = model.isCreatingTwinCardsAllowed,
|
||||
)
|
||||
defaultConfig = defaultConfig.copy(
|
||||
isTopUpEnabled = model.isTopUpEnabled,
|
||||
isSendingToPayIdEnabled = model.isSendingToPayIdEnabled,
|
||||
isCreatingTwinCardsAllowed = model.isCreatingTwinCardsAllowed
|
||||
isCreatingTwinCardsAllowed = model.isCreatingTwinCardsAllowed,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,8 @@ class ConfigManager {
|
|||
blockchairAuthorizationToken = values.blockchairAuthorizationToken,
|
||||
blockcypherTokens = values.blockcypherTokens,
|
||||
infuraProjectId = values.infuraProjectId,
|
||||
tronGridApiKey = values.tronGridApiKey
|
||||
tronGridApiKey = values.tronGridApiKey,
|
||||
saltPayAuthToken = values.saltPay.credentials.token,
|
||||
),
|
||||
appsFlyerDevKey = values.appsFlyerDevKey,
|
||||
amplitudeApiKey = values.amplitudeApiKey,
|
||||
|
|
@ -107,6 +108,7 @@ class ConfigManager {
|
|||
blockchairAuthorizationToken = values.blockchairAuthorizationToken,
|
||||
blockcypherTokens = values.blockcypherTokens,
|
||||
infuraProjectId = values.infuraProjectId,
|
||||
saltPayAuthToken = values.saltPay.credentials.token,
|
||||
),
|
||||
appsFlyerDevKey = values.appsFlyerDevKey,
|
||||
amplitudeApiKey = values.amplitudeApiKey,
|
||||
|
|
|
|||
|
|
@ -143,8 +143,7 @@ fun WalletManagerFactory.makeSaltPayWalletManager(
|
|||
scanResponse: ScanResponse,
|
||||
): EthereumWalletManager {
|
||||
val blockchain = scanResponse.getBlockchain()
|
||||
if (blockchain != Blockchain.SaltPay && blockchain != Blockchain.SaltPayTestnet)
|
||||
throw IllegalArgumentException()
|
||||
if (blockchain != Blockchain.SaltPay) throw IllegalArgumentException()
|
||||
|
||||
val token = SaltPayWorkaround.tokenFrom(blockchain)
|
||||
val cardWallet = scanResponse.card.wallets.firstOrNull().guard {
|
||||
|
|
|
|||
|
|
@ -38,12 +38,11 @@ class GnosisRegistrator(
|
|||
}
|
||||
|
||||
private val otpProcessorContractAddress: String = when (walletManager.wallet.blockchain) {
|
||||
Blockchain.SaltPay -> "0x3B4397C817A26521Df8bD01a949AFDE2251d91C2"
|
||||
Blockchain.SaltPayTestnet -> "0x710BF23486b549836509a08c184cE0188830f197"
|
||||
Blockchain.SaltPay -> "0xc659f4FEd7A84a188F54cBA4A7a49D77c1a20522"
|
||||
else -> throw IllegalArgumentException("GnosisRegistrator supports only the SaltPay blockchain")
|
||||
}
|
||||
|
||||
private val addressTreasureSafe = "0x8e9260a049d3Aa9ac60D0d4F27017320E0e2396B"
|
||||
private val addressTreasureSafe = "0x24A3c2382497075b6D93258f5938f7B661c06318"
|
||||
|
||||
private val atomicNonce = AtomicLong()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.tap.features.onboarding.products.wallet.saltPay
|
||||
|
||||
import com.tangem.tap.common.zendesk.ZendeskConfig
|
||||
import org.spongycastle.util.encoders.Base64.toBase64String
|
||||
|
||||
/**
|
||||
[REDACTED_AUTHOR]
|
||||
|
|
@ -8,12 +9,14 @@ import com.tangem.tap.common.zendesk.ZendeskConfig
|
|||
data class SaltPayConfig(
|
||||
val zendesk: ZendeskConfig,
|
||||
val kycProvider: KYCProvider,
|
||||
val credentials: Credentials,
|
||||
) {
|
||||
companion object {
|
||||
fun stub(): SaltPayConfig {
|
||||
return SaltPayConfig(
|
||||
zendesk = ZendeskConfig("", "", "", "", ""),
|
||||
kycProvider = KYCProvider("", "", "", ""),
|
||||
credentials = Credentials("", ""),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -24,4 +27,11 @@ data class KYCProvider(
|
|||
val externalIdParameterKey: String,
|
||||
val sidParameterKey: String,
|
||||
val sidValue: String,
|
||||
)
|
||||
)
|
||||
|
||||
data class Credentials(
|
||||
val user: String,
|
||||
val password: String,
|
||||
) {
|
||||
val token: String by lazy { "Basic ${toBase64String("$user:$password".toByteArray())}" }
|
||||
}
|
||||
|
|
@ -58,7 +58,8 @@ object Versions {
|
|||
// endregion Other libraries
|
||||
|
||||
// region Tangem
|
||||
const val tangemBlockchainSdk = "develop-141"
|
||||
const val tangemBlockchainSdk = "develop-142"
|
||||
// const val tangemBlockchainSdk = "0.0.1"
|
||||
|
||||
const val tangemCardSgk = "develop-173"
|
||||
// endregion Tangem
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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