Updated on 2026-08-14

This commit is contained in:
Tangem 2022-09-22 11:23:23 +04:00
parent 392efc7883
commit a642b39aa7
9 changed files with 17 additions and 11 deletions

View file

@ -65,7 +65,7 @@ object TangemSdk {
is TangemSdkError.Busy -> TangemSdkError.Busy()
is TangemSdkError.MissingPreflightRead -> TangemSdkError.MissingPreflightRead()
is TangemSdkError.WrongCardNumber -> TangemSdkError.WrongCardNumber()
is TangemSdkError.WrongCardType -> TangemSdkError.WrongCardType()
is TangemSdkError.WrongCardType -> TangemSdkError.WrongCardType(null)
is TangemSdkError.CardError -> TangemSdkError.CardError()
is TangemSdkError.NotSupportedFirmwareVersion -> TangemSdkError.NotSupportedFirmwareVersion()
is TangemSdkError.WalletError -> TangemSdkError.WalletError()

View file

@ -17,8 +17,7 @@ class OnboardingHelper {
val cardInfoStorage = preferencesStorage.usedCardsPrefStorage
return when {
response.card.isSaltPay -> {
// response.card.backupStatus?.isActive != true //TODO: restore after presentation
false
response.card.backupStatus?.isActive != true
}
response.productType == ProductType.Twins -> {
if (!response.twinsIsTwinned()) {

View file

@ -1,9 +1,11 @@
package com.tangem.tap.features.onboarding.products.wallet.redux
import com.tangem.blockchain.common.Blockchain
import com.tangem.common.CardFilter
import com.tangem.common.CompletionResult
import com.tangem.common.card.Card
import com.tangem.domain.common.ScanResponse
import com.tangem.domain.common.TapWorkarounds
import com.tangem.domain.common.TapWorkarounds.isSaltPay
import com.tangem.domain.common.extensions.withMainContext
import com.tangem.operations.backup.BackupService
@ -213,13 +215,18 @@ private fun handleBackupAction(appState: () -> AppState?, action: BackupAction)
}
}
is BackupAction.AddBackupCard -> {
backupService.skipCompatibilityChecks = true
tangemSdk.config.filter.cardIdFilter =
CardFilter.Companion.ItemFilter.Allow(TapWorkarounds.saltPayCardIds.toSet())
backupService.addBackupCard { result ->
backupService.skipCompatibilityChecks = false
tangemSdk.config.filter.cardIdFilter = null
when (result) {
is CompletionResult.Success -> {
store.dispatchOnMain(BackupAction.AddBackupCard.Success)
}
is CompletionResult.Failure -> {
}
}
}

View file

@ -46,7 +46,7 @@ class SaltPaySingleWalletView : WalletView() {
state = state.state,
currencySymbol = tokenData.tokenSymbol,
currency = tokenData.amountFormatted,
fiatAmount = tokenData.amount, // TODO: show fiatAmount
fiatAmount = tokenData.fiatAmount, // TODO: show fiatAmount
fiatCurrency = store.state.globalState.appCurrency,
),
).setup()

View file

@ -86,6 +86,5 @@
<string name="card_settings_reset_card_to_factory">Reset to Factory Settings</string>
<string name="card_settings_reset_card_to_factory_footer">Factory Reset will completely delete the wallet from the selected card. You will not be able to restore the current wallet or use the card to recover the access code.</string>
<string name="wallet_connect_select_network">Select network</string>
<string name="warning_existential_deposit_message">%s network has a concept of Existential Deposit. If your account drops below %s %s it will be deactivated and any remaining funds will be destroyed.</string>
<string name="saltpay_backup_warning" translatable="false">To start working with the card scan the first card and make a backup</string>
</resources>

View file

@ -101,7 +101,5 @@
<string name="send_extras_hint_destination_tag">Tag</string>
<string name="send_extras_error_invalid_memo">Недопустимый Memo. Он не будет добавлен в транзакцию.</string>
<string name="send_extras_error_invalid_destination_tag">Недопустимый Tag. Он не будет добавлен в транзакцию.</string>
<string name="warning_existential_deposit_message">Сеть %s использует концепцию экзистенциального депозита. Если баланс вашего счета опустится ниже %s %s, он будет деактивирован, а все оставшиеся средства будут уничтожены.</string>
<string name="saltpay_backup_warning" translatable="false">Для начала работы с картой сначала отсканируйте первую карту и сделайте бэкап</string>
</resources>

View file

@ -2,6 +2,7 @@ ext.versions = [
kotlin : '1.6.10',
build_gradle : '7.1.3',
tangem_card_sdk : 'develop-159',
// tangem_card_sdk: '0.0.1',
tangem_blockchain_sdk: 'develop-115',
// tangem_blockchain_sdk: '0.0.1',
]

View file

@ -84,7 +84,7 @@ object TapWorkarounds {
"AC01", "AC02", "CB95",
)
private val saltPayCardIds = listOf(
val saltPayCardIds = listOf(
"AE02000000000194",
"AC03000000076195",
"AC79000000000012", // TODO: remove my testing CIDs
@ -108,9 +108,9 @@ object TapWorkarounds {
// TODO: add cids
)
private val saltPayBatches = listOf("AE02")
val saltPayBatches = listOf("AE02")
val saltPayToken: Token // TODO: Add real token
val saltPayToken: Token
get() = Token(
name = "Wrapped xDAI",
"WxDAI",

View file

@ -93,6 +93,7 @@ fun Blockchain.toNetworkId(): String {
Blockchain.OptimismTestnet -> "optimistic-ethereum/test"
Blockchain.Dash -> "dash"
Blockchain.SaltPay -> "xdai"//TODO
else -> "unknown" // TODO
}
}
@ -124,5 +125,6 @@ fun Blockchain.toCoinId(): String {
Blockchain.Dash -> "dash"
Blockchain.SaltPay -> "xdai" //TODO
Blockchain.Unknown -> "unknown"
else -> "unknown" // TODO
}
}