Updated on 2026-08-14

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

View file

@ -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,

View file

@ -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 {

View file

@ -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()

View file

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