From 21997b5e9bd24ac196e4b2d1c607e39853527576 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 15 Sep 2022 22:26:38 +0400 Subject: [PATCH 01/30] Updated on 2026-08-14 --- .../java/com/tangem/tap/TapApplication.kt | 2 +- .../java/com/tangem/tap/domain/TapErrors.kt | 1 + .../com/tangem/tap/domain/TapWalletManager.kt | 7 +- .../com/tangem/tap/domain/extensions/Card.kt | 6 +- .../domain/extensions/WalletManagerFactory.kt | 12 ++- .../domain/tasks/product/ScanProductTask.kt | 47 ++++------- .../features/details/redux/DetailsReducer.kt | 2 +- .../features/onboarding/OnboardingHelper.kt | 6 ++ .../wallet/redux/OnboardingWalletAction.kt | 4 +- .../redux/OnboardingWalletMiddleware.kt | 13 +-- .../wallet/redux/OnboardingWalletReducer.kt | 1 + .../wallet/redux/OnboardingWalletState.kt | 1 + .../wallet/ui/OnboardingWalletFragment.kt | 21 ++--- .../redux/middlewares/WalletMiddleware.kt | 14 +++- .../redux/reducers/OnWalletLoadedReducer.kt | 9 +- .../wallet/redux/reducers/WalletReducer.kt | 84 +++++++++++++++---- .../tap/features/wallet/ui/BalanceWidget.kt | 10 ++- .../tap/features/wallet/ui/WalletFragment.kt | 2 +- .../ui/wallet/SaltPaySingleWalletView.kt | 17 ++-- app/src/main/res/layout/fragment_wallet.xml | 1 - .../layout/layout_single_wallet_balance.xml | 24 +++--- app/src/main/res/values-de/strings_final.xml | 2 + app/src/main/res/values-fr/strings_final.xml | 2 + app/src/main/res/values-it/strings_final.xml | 2 + app/src/main/res/values-ru/strings_final.xml | 2 + app/src/main/res/values/strings_final.xml | 2 + .../com/tangem/domain/common/ScanResponse.kt | 38 ++++++--- .../tangem/domain/common/TapWorkarounds.kt | 47 ++++++++++- .../domain/common/extensions/Blockchain.kt | 2 + 29 files changed, 262 insertions(+), 119 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/TapApplication.kt b/app/src/main/java/com/tangem/tap/TapApplication.kt index 0c69e5de88..08da1e8b3b 100644 --- a/app/src/main/java/com/tangem/tap/TapApplication.kt +++ b/app/src/main/java/com/tangem/tap/TapApplication.kt @@ -147,7 +147,7 @@ class TapApplication : Application(), ImageLoaderFactory { } data class LogConfig( - val coil: Boolean = BuildConfig.DEBUG, + val coil: Boolean = false, val storeAction: Boolean = BuildConfig.DEBUG, val zendesk: Boolean = BuildConfig.DEBUG, ) \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/domain/TapErrors.kt b/app/src/main/java/com/tangem/tap/domain/TapErrors.kt index 9d3cc79eee..45a963ddaa 100644 --- a/app/src/main/java/com/tangem/tap/domain/TapErrors.kt +++ b/app/src/main/java/com/tangem/tap/domain/TapErrors.kt @@ -64,6 +64,7 @@ sealed class TapSdkError(override val messageResId: Int?) : Throwable(), TangemE object CardForDifferentApp : TapSdkError(R.string.alert_unsupported_card) object CardNotSupportedByRelease : TapSdkError(R.string.error_update_app) + object ScanPrimaryCard : TapSdkError(R.string.saltpay_backup_warning) } diff --git a/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt b/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt index 8bd8cf8ef7..16ab2b0629 100644 --- a/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt @@ -160,6 +160,7 @@ class TapWalletManager { val primaryWalletManager = walletManagerFactory.makePrimaryWalletManager(data) if (blockchain != Blockchain.Unknown && primaryWalletManager != null) { + val blockchainNetwork = BlockchainNetwork.fromWalletManager(primaryWalletManager) val primaryToken = data.getPrimaryToken() dispatchOnMain(WalletAction.MultiWallet.SetPrimaryBlockchain(blockchain)) @@ -169,9 +170,9 @@ class TapWalletManager { } dispatchOnMain( WalletAction.MultiWallet.AddBlockchains( - listOf(BlockchainNetwork.fromWalletManager(primaryWalletManager)), - listOf(primaryWalletManager) - ) + listOf(blockchainNetwork), + listOf(primaryWalletManager), + ), ) } } diff --git a/app/src/main/java/com/tangem/tap/domain/extensions/Card.kt b/app/src/main/java/com/tangem/tap/domain/extensions/Card.kt index c627a7de91..438b257916 100644 --- a/app/src/main/java/com/tangem/tap/domain/extensions/Card.kt +++ b/app/src/main/java/com/tangem/tap/domain/extensions/Card.kt @@ -6,6 +6,7 @@ import com.tangem.common.card.EllipticCurve import com.tangem.common.card.FirmwareVersion import com.tangem.common.extensions.toHexString import com.tangem.common.services.Result +import com.tangem.domain.common.TapWorkarounds.isSaltPay import com.tangem.domain.common.TapWorkarounds.isStart2Coin import com.tangem.domain.common.TapWorkarounds.isTangemNote import com.tangem.domain.common.TwinCardNumber @@ -23,11 +24,14 @@ val Card.isWalletDataSupported: Boolean val Card.isMultiwalletAllowed: Boolean get() { - return !isTangemTwin() && !isStart2Coin && !isTangemNote() + return !isTangemTwin() && !isStart2Coin && !isTangemNote() && !isSaltPay && (firmwareVersion >= FirmwareVersion.MultiWalletAvailable || getSingleWallet()?.curve == EllipticCurve.Secp256k1) } +val Card.isHdWalletAllowedByApp: Boolean + get() = settings.isHDWalletAllowed && !isSaltPay + fun Card.getSingleWallet(): CardWallet? { return wallets.firstOrNull() } diff --git a/app/src/main/java/com/tangem/tap/domain/extensions/WalletManagerFactory.kt b/app/src/main/java/com/tangem/tap/domain/extensions/WalletManagerFactory.kt index 34b8289884..654eb2185c 100644 --- a/app/src/main/java/com/tangem/tap/domain/extensions/WalletManagerFactory.kt +++ b/app/src/main/java/com/tangem/tap/domain/extensions/WalletManagerFactory.kt @@ -1,6 +1,10 @@ package com.tangem.tap.domain.extensions -import com.tangem.blockchain.common.* +import com.tangem.blockchain.common.Blockchain +import com.tangem.blockchain.common.DerivationParams +import com.tangem.blockchain.common.DerivationStyle +import com.tangem.blockchain.common.WalletManager +import com.tangem.blockchain.common.WalletManagerFactory import com.tangem.common.card.Card import com.tangem.common.card.CardWallet import com.tangem.common.card.EllipticCurve @@ -35,10 +39,10 @@ fun WalletManagerFactory.makeWalletManagerForApp( walletPublicKey = wallet.publicKey, pairPublicKey = scanResponse.secondTwinPublicKey!!.hexToBytes(), blockchain = environmentBlockchain, - curve = wallet.curve + curve = wallet.curve, ) } - seedKey != null && derivationParams != null -> { + scanResponse.card.isHdWalletAllowedByApp && (seedKey != null && derivationParams != null) -> { val derivedKeys = scanResponse.derivedKeys[wallet.publicKey.toMapKey()] val derivationPath = when (derivationParams) { is DerivationParams.Default -> blockchain.derivationPath(derivationParams.style) @@ -51,7 +55,7 @@ fun WalletManagerFactory.makeWalletManagerForApp( blockchain = environmentBlockchain, seedKey = wallet.publicKey, derivedKey = derivedKey, - derivation = derivationParams + derivation = derivationParams, ) } else -> { diff --git a/app/src/main/java/com/tangem/tap/domain/tasks/product/ScanProductTask.kt b/app/src/main/java/com/tangem/tap/domain/tasks/product/ScanProductTask.kt index e54c3744cb..1963d69143 100644 --- a/app/src/main/java/com/tangem/tap/domain/tasks/product/ScanProductTask.kt +++ b/app/src/main/java/com/tangem/tap/domain/tasks/product/ScanProductTask.kt @@ -4,7 +4,6 @@ import com.tangem.blockchain.common.Blockchain import com.tangem.common.CompletionResult import com.tangem.common.card.Card import com.tangem.common.card.EllipticCurve -import com.tangem.common.card.FirmwareVersion import com.tangem.common.core.CardSession import com.tangem.common.core.CardSessionRunnable import com.tangem.common.core.TangemError @@ -18,10 +17,11 @@ import com.tangem.domain.common.ProductType import com.tangem.domain.common.ScanResponse import com.tangem.domain.common.TapWorkarounds.isExcluded import com.tangem.domain.common.TapWorkarounds.isNotSupportedInThatRelease -import com.tangem.domain.common.TapWorkarounds.isTangemNote +import com.tangem.domain.common.TapWorkarounds.isSaltPay import com.tangem.domain.common.TapWorkarounds.useOldStyleDerivation import com.tangem.domain.common.TwinsHelper import com.tangem.domain.common.isTangemTwins +import com.tangem.domain.common.productType import com.tangem.operations.PreflightReadMode import com.tangem.operations.PreflightReadTask import com.tangem.operations.ScanTask @@ -32,6 +32,9 @@ import com.tangem.operations.issuerAndUserData.ReadIssuerDataCommand import com.tangem.tap.domain.TapSdkError import com.tangem.tap.domain.extensions.getPrimaryCurve import com.tangem.tap.domain.extensions.getSingleWallet +import com.tangem.tap.domain.extensions.hasNoWallets +import com.tangem.tap.domain.extensions.isHdWalletAllowedByApp +import com.tangem.tap.domain.extensions.isMultiwalletAllowed import com.tangem.tap.domain.tokens.CurrenciesRepository import com.tangem.tap.domain.tokens.models.BlockchainNetwork import com.tangem.tap.preferencesStorage @@ -60,7 +63,6 @@ class ScanProductTask( } val commandProcessor = when { - card.isTangemNote() -> ScanNoteProcessor() card.isTangemTwins() -> ScanTwinProcessor() else -> ScanWalletProcessor(currenciesRepository, additionalBlockchainsToDerive) } @@ -87,29 +89,11 @@ class ScanProductTask( private fun getErrorIfExcludedCard(card: Card): TangemError? { if (card.isExcluded()) return TapSdkError.CardForDifferentApp if (card.isNotSupportedInThatRelease()) return TapSdkError.CardNotSupportedByRelease - + if (card.isSaltPay && card.hasNoWallets()) return TapSdkError.ScanPrimaryCard return null } } -private class ScanNoteProcessor : ProductCommandProcessor { - override fun proceed( - card: Card, - session: CardSession, - callback: (result: CompletionResult) -> Unit - ) { - callback( - CompletionResult.Success( - ScanResponse( - card = card, - productType = ProductType.Note, - walletData = session.environment.walletData, - ), - ), - ) - } -} - private class ScanWalletProcessor( private val currenciesRepository: CurrenciesRepository?, private val additionalBlockchainsToDerive: Collection? = null @@ -123,12 +107,13 @@ private class ScanWalletProcessor( ) { createMissingWalletsIfNeeded(card, session, callback) } + private fun createMissingWalletsIfNeeded( card: Card, session: CardSession, callback: (result: CompletionResult) -> Unit, ) { - if (card.wallets.isEmpty() || card.firmwareVersion < FirmwareVersion.MultiWalletAvailable) { + if (card.wallets.isEmpty() || !card.isMultiwalletAllowed) { startLinkingForBackupIfNeeded(card, session, callback) return } @@ -186,16 +171,16 @@ private class ScanWalletProcessor( ) { scope.launch { val derivations = collectDerivations(card) - if (derivations.isEmpty() || !card.settings.isHDWalletAllowed) { + if (derivations.isEmpty() || !card.isHdWalletAllowedByApp) { callback( CompletionResult.Success( ScanResponse( card = card, - productType = ProductType.Wallet, + productType = card.productType, walletData = session.environment.walletData, - primaryCard = primaryCard - ) - ) + primaryCard = primaryCard, + ), + ), ) return@launch } @@ -205,10 +190,10 @@ private class ScanWalletProcessor( is CompletionResult.Success -> { val response = ScanResponse( card = card, - productType = ProductType.Wallet, + productType = card.productType, walletData = session.environment.walletData, derivedKeys = result.data.entries, - primaryCard = primaryCard + primaryCard = primaryCard, ) callback(CompletionResult.Success(response)) } @@ -222,7 +207,7 @@ private class ScanWalletProcessor( val currenciesRepository = currenciesRepository ?: return emptyList() val cardCurrencies = currenciesRepository - .loadSavedCurrencies(card.cardId, card.settings.isHDWalletAllowed).toMutableList() + .loadSavedCurrencies(card.cardId, card.isHdWalletAllowedByApp).toMutableList() val blockchainsToDerive = cardCurrencies.ifEmpty { mutableListOf( diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsReducer.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsReducer.kt index b327e24452..d2013dba98 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsReducer.kt @@ -79,7 +79,7 @@ private fun prepareSecurityOptions(card: Card): ManageSecurityState { } } val allowedSecurityOptions = when { - card.isStart2Coin || card.isTangemNote() -> { + card.isStart2Coin || card.isTangemNote() || card.isSaltPay -> { EnumSet.of(SecurityOption.LongTap) } card.settings.isBackupAllowed -> { diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingHelper.kt b/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingHelper.kt index 7efb84deb6..0b58d4aa0b 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingHelper.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingHelper.kt @@ -2,6 +2,7 @@ package com.tangem.tap.features.onboarding import com.tangem.domain.common.ProductType import com.tangem.domain.common.ScanResponse +import com.tangem.domain.common.TapWorkarounds.isSaltPay import com.tangem.tap.common.redux.navigation.AppScreen import com.tangem.tap.domain.extensions.hasWallets import com.tangem.tap.preferencesStorage @@ -15,6 +16,10 @@ class OnboardingHelper { fun isOnboardingCase(response: ScanResponse): Boolean { val cardInfoStorage = preferencesStorage.usedCardsPrefStorage return when { + response.card.isSaltPay -> { + // response.card.backupStatus?.isActive != true //TODO: restore after presentation + false + } response.productType == ProductType.Twins -> { if (!response.twinsIsTwinned()) { true @@ -38,6 +43,7 @@ class OnboardingHelper { AppScreen.OnboardingOther } ProductType.Twins -> AppScreen.OnboardingTwins + ProductType.SaltPay -> AppScreen.OnboardingWallet } } } diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletAction.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletAction.kt index 78631a152f..8431644dbf 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletAction.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletAction.kt @@ -10,7 +10,7 @@ sealed class OnboardingWalletAction : Action { object Done : OnboardingWalletAction() object FinishOnboarding : OnboardingWalletAction() - object ProceedBackup : OnboardingWalletAction() + data class ProceedBackup(val isSaltPay: Boolean = false) : OnboardingWalletAction() object LoadArtwork : OnboardingWalletAction() class SetArtworkUrl(val artworkUrl: String?) : OnboardingWalletAction() @@ -21,7 +21,7 @@ sealed class OnboardingWalletAction : Action { sealed class BackupAction : Action { object DetermineBackupStep : BackupAction() - object IntroduceBackup : BackupAction() + data class IntroduceBackup(val isSaltPay: Boolean = false) : BackupAction() object StartBackup : BackupAction() object DismissBackup : BackupAction() diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt index 391d65cb96..de8e3a77c4 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt @@ -4,6 +4,7 @@ import com.tangem.blockchain.common.Blockchain import com.tangem.common.CompletionResult import com.tangem.common.card.Card import com.tangem.domain.common.ScanResponse +import com.tangem.domain.common.TapWorkarounds.isSaltPay import com.tangem.domain.common.extensions.withMainContext import com.tangem.operations.backup.BackupService import com.tangem.tap.* @@ -51,10 +52,10 @@ private fun handleWalletAction(action: Action) { OnboardingWalletAction.Init -> { val action = when { card == null -> { - OnboardingWalletAction.ProceedBackup + OnboardingWalletAction.ProceedBackup() } card.hasWallets() && card.backupStatus == Card.BackupStatus.NoBackup -> - OnboardingWalletAction.ProceedBackup + OnboardingWalletAction.ProceedBackup(card.isSaltPay) card.hasWallets() && card.backupStatus?.isActive == true -> BackupAction.FinishBackup else -> OnboardingWalletAction.GetToCreateWalletStep @@ -98,7 +99,7 @@ private fun handleWalletAction(action: Action) { ) ) onboardingManager.activationStarted(updatedResponse.card.cardId) - store.dispatch(OnboardingWalletAction.ProceedBackup) + store.dispatch(OnboardingWalletAction.ProceedBackup()) } is CompletionResult.Failure -> { // do nothing @@ -120,7 +121,7 @@ private fun handleWalletAction(action: Action) { store.dispatchOnMain(NavigationAction.NavigateTo(AppScreen.Wallet)) } } - OnboardingWalletAction.ProceedBackup -> { + is OnboardingWalletAction.ProceedBackup -> { val newAction = when (val backupState = backupService.currentState) { BackupService.State.FinalizingPrimaryCard -> BackupAction.PrepareToWritePrimaryCard is BackupService.State.FinalizingBackupCard -> BackupAction.PrepareToWriteBackupCard(backupState.index) @@ -128,7 +129,7 @@ private fun handleWalletAction(action: Action) { if (walletState.backupState.backupStep == BackupStep.InitBackup || walletState.backupState.backupStep == BackupStep.Finished ) { - BackupAction.IntroduceBackup + BackupAction.IntroduceBackup(action.isSaltPay) } else { null } @@ -319,7 +320,7 @@ private fun handleBackupAction(appState: () -> AppState?, action: BackupAction) } is BackupAction.ResumeBackup -> { store.dispatch(GlobalAction.Onboarding.Start(null, true)) - store.dispatch(OnboardingWalletAction.ProceedBackup) + store.dispatch(OnboardingWalletAction.ProceedBackup()) store.dispatch(NavigationAction.NavigateTo(AppScreen.OnboardingWallet)) } is BackupAction.DismissBackup -> { diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletReducer.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletReducer.kt index ab36973e17..13b86b3e08 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletReducer.kt @@ -42,6 +42,7 @@ class BackupReducer { is BackupAction.IntroduceBackup -> BackupState( backupStep = BackupStep.InitBackup, canSkipBackup = state.canSkipBackup, + isSaltPay = action.isSaltPay, ) BackupAction.StartAddingPrimaryCard -> state.copy(backupStep = BackupStep.ScanOriginCard) BackupAction.StartAddingBackupCards -> { diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletState.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletState.kt index 591573b35b..05a307b5b9 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletState.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletState.kt @@ -52,6 +52,7 @@ data class BackupState( val backupStep: BackupStep = BackupStep.InitBackup, val maxBackupCards: Int = 2, val canSkipBackup: Boolean = true, + val isSaltPay: Boolean = false, ) enum class AccessCodeError { diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/ui/OnboardingWalletFragment.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/ui/OnboardingWalletFragment.kt index 056d5a28bb..748c7f088b 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/ui/OnboardingWalletFragment.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/ui/OnboardingWalletFragment.kt @@ -181,6 +181,8 @@ class OnboardingWalletFragment : Fragment(R.layout.fragment_onboarding_wallet), btnAlternativeAction.show(state.canSkipBackup) btnMainAction.setOnClickListener { store.dispatch(BackupAction.StartBackup) } btnAlternativeAction.setOnClickListener { store.dispatch(BackupAction.DismissBackup) } + + btnAlternativeAction.show(!state.isSaltPay) } startPostponedEnterTransition() @@ -232,9 +234,9 @@ class OnboardingWalletFragment : Fragment(R.layout.fragment_onboarding_wallet), when (state.backupCardsNumber) { 0 -> { - cardsWidget.toFan() { - cardsWidget.getFirstBackupCardView().animate().alpha(0.6f).setDuration(200) - cardsWidget.getSecondBackupCardView().animate().alpha(0.2f).setDuration(200) + cardsWidget.toFan { + cardsWidget.getFirstBackupCardView().animate().alpha(0.6f).duration = 200 + cardsWidget.getSecondBackupCardView().animate().alpha(0.2f).duration = 200 } tvHeader.text = getText(R.string.onboarding_title_no_backup_cards) tvBody.text = getText(R.string.onboarding_subtitle_no_backup_cards) @@ -244,7 +246,7 @@ class OnboardingWalletFragment : Fragment(R.layout.fragment_onboarding_wallet), tvBody.text = getText(R.string.onboarding_subtitle_one_backup_card) cardsWidget.toFan(false) - cardsWidget.getFirstBackupCardView().animate().alpha(1f).setDuration(400) + cardsWidget.getFirstBackupCardView().animate().alpha(1f).duration = 400 cardsWidget.getSecondBackupCardView().alpha = 0.2f } 2 -> { @@ -253,7 +255,7 @@ class OnboardingWalletFragment : Fragment(R.layout.fragment_onboarding_wallet), cardsWidget.toFan(false) cardsWidget.getFirstBackupCardView().alpha = 1f - cardsWidget.getSecondBackupCardView().animate().alpha(1f).setDuration(400) + cardsWidget.getSecondBackupCardView().animate().alpha(1f).duration = 400 } } @@ -296,7 +298,7 @@ class OnboardingWalletFragment : Fragment(R.layout.fragment_onboarding_wallet), prepareViewForFinalizeStep() cardsWidget.getSecondBackupCardView().show(state.backupCardsNumber == 2) - cardsWidget.toLeapfrog() { + cardsWidget.toLeapfrog { cardsWidget.getFirstBackupCardView().alpha = 0.6f cardsWidget.getSecondBackupCardView().alpha = 0.2f } @@ -335,12 +337,12 @@ class OnboardingWalletFragment : Fragment(R.layout.fragment_onboarding_wallet), val cardNumber = (state.backupStep as? BackupStep.WriteBackupCard)?.cardNumber ?: 1 when (cardNumber) { - 1 -> cardsWidget.leapfrogWidget.leap() { + 1 -> cardsWidget.leapfrogWidget.leap { cardsWidget.getOriginCardView().alpha = 0.4f cardsWidget.getFirstBackupCardView().alpha = 0.2f cardsWidget.getSecondBackupCardView().alpha = 1f } - 2 -> cardsWidget.leapfrogWidget.leap() { + 2 -> cardsWidget.leapfrogWidget.leap { cardsWidget.getOriginCardView().alpha = 0.4f cardsWidget.getFirstBackupCardView().alpha = 0.2f cardsWidget.getSecondBackupCardView().alpha = 1f @@ -389,8 +391,7 @@ class OnboardingWalletFragment : Fragment(R.layout.fragment_onboarding_wallet), imvSuccess.show() imvSuccess.animate() - ?.alpha(1f) - ?.setDuration(400) + ?.alpha(1f)?.duration = 400 } } diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WalletMiddleware.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WalletMiddleware.kt index ecf9579bb9..b54a5168a9 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WalletMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WalletMiddleware.kt @@ -132,7 +132,19 @@ class WalletMiddleware { .plus(Currency.Blockchain(wallet.blockchain, wallet.publicKey.derivationPath?.rawPath)) } action.coinsList != null -> action.coinsList - else -> walletState.walletsData.map { it.currency } + else -> { + if (walletState.isMultiwalletAllowed) { + walletState.walletsData.map { it.currency } + } else { + val derivationPath = walletState.primaryWallet?.currency?.derivationPath + val primaryBlockchain = walletState.primaryBlockchain + val primaryToken = walletState.primaryToken + listOfNotNull( + primaryBlockchain?.let { Currency.Blockchain(it, derivationPath) }, + primaryToken?.let { Currency.Token(it, primaryBlockchain!!, derivationPath) }, + ) + } + } } val ratesResult = globalState.tapWalletManager.rates.loadFiatRate( currencyId = appCurrencyId, diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt index 63d378718f..7d124f2a41 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt @@ -21,6 +21,7 @@ import com.tangem.tap.features.wallet.ui.BalanceStatus import com.tangem.tap.features.wallet.ui.BalanceWidgetData import com.tangem.tap.features.wallet.ui.TokenData import com.tangem.tap.store +import java.math.BigDecimal class OnWalletLoadedReducer { @@ -124,10 +125,12 @@ class OnWalletLoadedReducer { val tokenFiatAmount = tokenFiatRate?.let { tokenAmount.value?.toFiatString(it, fiatCurrencyName) } TokenData( - tokenAmount.value?.toFormattedCurrencyString( - token.decimals, token.symbol + amount = tokenAmount.value ?: BigDecimal.ZERO, + tokenSymbol = tokenAmount.currencySymbol, fiatAmountFormatted = tokenFiatAmount, + fiatAmount = tokenFiatRate?.let { tokenAmount.value?.toFiatValue(tokenFiatRate) }, + amountFormatted = tokenAmount.value?.toFormattedCurrencyString( + token.decimals, token.symbol, ) ?: "", - tokenAmount.currencySymbol, tokenFiatAmount ) } else { null diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt index a4b679512e..413e9e6f77 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt @@ -31,6 +31,7 @@ import com.tangem.tap.features.wallet.redux.WalletStore import com.tangem.tap.features.wallet.ui.BalanceStatus import com.tangem.tap.features.wallet.ui.BalanceWidgetData import org.rekotlin.Action +import timber.log.Timber import java.math.BigDecimal class WalletReducer { @@ -386,16 +387,11 @@ private fun setNewFiatRate( state = state ) } else { - val fiatRate = fiatRates.entries.firstOrNull() - val currency = fiatRate?.key ?: return state - val rate = fiatRate.value ?: return state - - setSingleWalletFiatRate( - rate = rate, - rateFormatted = rateFormatter(rate), - currency = currency, + setSingleWalletFiatRates( + fiatRates = fiatRates.mapNotNullValues { it.value }, + rateFormatter = rateFormatter, appCurrency = appCurrency, - state = state + state = state, ) } } @@ -426,10 +422,10 @@ private fun setMultiWalletFiatRate( walletData.copy( currencyData = currencyData.copy( fiatAmountFormatted = fiatAmountFormatted, - fiatAmount = fiatAmount + fiatAmount = fiatAmount, ), fiatRate = rate, - fiatRateString = rateFormatter(rate) + fiatRateString = rateFormatter(rate), ) } @@ -437,15 +433,52 @@ private fun setMultiWalletFiatRate( .updateWalletsData(newWalletsData) } +private fun setSingleWalletFiatRates( + fiatRates: Map, + appCurrency: FiatCurrency, + rateFormatter: (BigDecimal) -> String, + state: WalletState, +): + WalletState { + val blockchainFiatRate = fiatRates.entries.firstOrNull { it.key.isBlockchain() } + val tokenFiatRate = fiatRates.entries.firstOrNull { it.key.isToken() } + Timber.e("Token Fiat Rate is ${tokenFiatRate ?: "NULL"}") + val updatedState = updateStateWithFiatRate(blockchainFiatRate?.toPair(), appCurrency, rateFormatter, state) + return updateStateWithFiatRate(tokenFiatRate?.toPair(), appCurrency, rateFormatter, updatedState) +} + +private fun updateStateWithFiatRate( + fiatRate: Pair?, + appCurrency: FiatCurrency, + rateFormatter: (BigDecimal) -> String, + state: WalletState, +): WalletState { + return if (fiatRate != null) { + val currency = fiatRate.first + val rate = fiatRate.second + + setSingleWalletFiatRate( + rate = rate, + rateFormatted = rateFormatter(rate), + currency = currency, + appCurrency = appCurrency, + state = state, + ) + } else { + state + } +} + private fun setSingleWalletFiatRate( rate: BigDecimal, rateFormatted: String, currency: Currency, appCurrency: FiatCurrency, - state: WalletState + state: WalletState, ): WalletState { val wallet = state.primaryWalletManager?.wallet ?: return state val token = wallet.getFirstToken() + Timber.e("Working with currency: ${currency.currencyName}") if (currency == state.primaryWallet?.currency) { val fiatAmount = wallet.amounts[AmountType.Coin]?.value @@ -456,23 +489,38 @@ private fun setSingleWalletFiatRate( fiatRateString = rateFormatted ) return state.updateWalletData(walletData) + } else if (currency is Currency.Token && currency.token == token) { + Timber.e("Working with token fiat rate") + val tokenFiatAmount = wallet.getTokenAmount(token) ?.value - ?.toFiatString(rate, appCurrency.code) + val tokenAmountFormatted = tokenFiatAmount?.toFiatString(rate, appCurrency.code) + val tokenData = state.primaryWallet?.currencyData?.token?.copy( + fiatAmountFormatted = tokenAmountFormatted, fiatAmount = tokenFiatAmount, fiatRate = rate, - fiatRateString = rateFormatted + fiatRateString = rateFormatted, ) + // ?: TokenData( + // fiatAmountFormatted = tokenAmountFormatted, + // fiatAmount = tokenFiatAmount, + // fiatRate = rate, + // fiatRateString = rateFormatted, + // amount = "", + // tokenSymbol = currency.currencySymbol + // ) + + Timber.e("Token Data is ${tokenData ?: "NULL"}") val walletData = state.primaryWallet?.copy( currencyData = state.primaryWallet.currencyData.copy( - token = tokenData - ) + token = tokenData, + ), ) - val wallets = walletData?.let { listOf(walletData) } ?: emptyList() - return state.updateWalletsData(wallets) + Timber.e("Wallet Data is ${walletData ?: "NULL"}") + return state.updateWalletData(walletData) } return state } \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/BalanceWidget.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/BalanceWidget.kt index c627aa2e32..34ca1f10c1 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/BalanceWidget.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/BalanceWidget.kt @@ -34,9 +34,11 @@ data class BalanceWidgetData( ) data class TokenData( - val amount: String, + val amountFormatted: String, + val amount: BigDecimal? = null, val tokenSymbol: String, - val fiatAmount: String? = null, + val fiatAmountFormatted: String? = null, + val fiatAmount: BigDecimal? = null, val fiatRateString: String? = null, val fiatRate: BigDecimal? = null, ) @@ -151,11 +153,11 @@ class BalanceWidget( groupBaseCurrency.show() tvCurrency.text = data.token?.tokenSymbol tvBaseCurrency.text = data.currency - tvAmount.text = if (showAmount) data.token?.amount else "" + tvAmount.text = if (showAmount) data.token?.amountFormatted else "" tvBaseAmount.text = if (showAmount) data.amountFormatted else "" if (showAmount) { tvFiatAmount.show() - tvFiatAmount.text = data.token?.fiatAmount + tvFiatAmount.text = data.token?.fiatAmountFormatted } } diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletFragment.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletFragment.kt index 1389600f94..27d49105a4 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletFragment.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletFragment.kt @@ -127,7 +127,7 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), StoreSubscriber { + !state.isMultiwalletAllowed && !isSaltPay && walletView !is SingleWalletView -> { walletView = SingleWalletView() walletView.changeWalletView(this, binding) } diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPaySingleWalletView.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPaySingleWalletView.kt index 09d00b294e..8b0d0e639e 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPaySingleWalletView.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPaySingleWalletView.kt @@ -2,11 +2,12 @@ package com.tangem.tap.features.wallet.ui.wallet import com.tangem.tap.common.extensions.hide import com.tangem.tap.common.extensions.show -import com.tangem.tap.features.wallet.redux.WalletData import com.tangem.tap.features.wallet.redux.WalletState +import com.tangem.tap.features.wallet.ui.TokenData import com.tangem.tap.features.wallet.ui.WalletFragment import com.tangem.tap.store import com.tangem.wallet.databinding.FragmentWalletBinding +import timber.log.Timber class SaltPaySingleWalletView : WalletView() { override fun changeWalletView(fragment: WalletFragment, binding: FragmentWalletBinding) { @@ -18,6 +19,7 @@ class SaltPaySingleWalletView : WalletView() { private fun showSingleWalletView(binding: FragmentWalletBinding) = with(binding) { rvMultiwallet.hide() btnAddToken.hide() + rowButtons.hide() rvPendingTransaction.hide() tvTwinCardNumber.hide() lCardBalance.root.hide() @@ -30,20 +32,21 @@ class SaltPaySingleWalletView : WalletView() { override fun onNewState(state: WalletState) { val binding = binding ?: return - state.primaryWallet ?: return + val tokenData = state.primaryWallet?.currencyData?.token ?: return - setupBalance(state, state.primaryWallet, binding) + setupBalance(state, tokenData, binding) } - private fun setupBalance(state: WalletState, primaryWallet: WalletData, binding: FragmentWalletBinding) { + private fun setupBalance(state: WalletState, tokenData: TokenData, binding: FragmentWalletBinding) { binding.lSingleWalletBalance.root.show() + Timber.e("Current address is ${state.primaryWalletManager?.wallet?.address}") SaltPayBalanceWidget( binding = binding.lSingleWalletBalance, data = SaltPayBalanceWidgetData( state = state.state, - currencySymbol = primaryWallet.currencyData.currencySymbol, - currency = primaryWallet.currencyData.amountFormatted, - fiatAmount = primaryWallet.currencyData.fiatAmount, + currencySymbol = tokenData.tokenSymbol, + currency = tokenData.amountFormatted, + fiatAmount = tokenData.amount, // TODO: show fiatAmount fiatCurrency = store.state.globalState.appCurrency, ), ).setup() diff --git a/app/src/main/res/layout/fragment_wallet.xml b/app/src/main/res/layout/fragment_wallet.xml index d5daad21ea..8bab86feb8 100644 --- a/app/src/main/res/layout/fragment_wallet.xml +++ b/app/src/main/res/layout/fragment_wallet.xml @@ -60,7 +60,6 @@ android:adjustViewBounds="true" android:contentDescription="@null" android:elevation="3dp" - android:maxHeight="215dp" android:scaleType="fitCenter" app:layout_constraintTop_toTopOf="parent" tools:src="@drawable/card_placeholder_black" /> diff --git a/app/src/main/res/layout/layout_single_wallet_balance.xml b/app/src/main/res/layout/layout_single_wallet_balance.xml index 119baed8cf..984d73bf24 100644 --- a/app/src/main/res/layout/layout_single_wallet_balance.xml +++ b/app/src/main/res/layout/layout_single_wallet_balance.xml @@ -4,15 +4,16 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/card_balance" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + app:cardCornerRadius="12dp"> @@ -50,8 +52,8 @@ android:layout_height="wrap_content" android:maxLines="1" android:minWidth="152dp" - android:textColor="@color/darkGray6" - android:textSize="26sp" + android:textColor="@color/text_primary_1" + android:textSize="24sp" android:textStyle="bold" tools:text="22 325.40 $" /> @@ -104,10 +106,12 @@ android:id="@+id/tv_currency_name" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/darkGray1" - android:textSize="16sp" + android:gravity="center_vertical" + android:textColor="@color/text_tertiary" + android:textSize="14sp" + android:textStyle="bold" app:drawableEndCompat="@drawable/ic_arrow_angle_down" - app:drawableTint="@color/darkGray1" + app:drawableTint="@color/text_tertiary" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" tools:text="USD" /> diff --git a/app/src/main/res/values-de/strings_final.xml b/app/src/main/res/values-de/strings_final.xml index 4243136291..501e8200d9 100644 --- a/app/src/main/res/values-de/strings_final.xml +++ b/app/src/main/res/values-de/strings_final.xml @@ -87,4 +87,6 @@ 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. Select network %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. + + To start working with the card scan the first card and make a backup \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings_final.xml b/app/src/main/res/values-fr/strings_final.xml index 6e840c3e83..7c59ccee98 100644 --- a/app/src/main/res/values-fr/strings_final.xml +++ b/app/src/main/res/values-fr/strings_final.xml @@ -87,4 +87,6 @@ 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. Select network %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. + + To start working with the card scan the first card and make a backup \ No newline at end of file diff --git a/app/src/main/res/values-it/strings_final.xml b/app/src/main/res/values-it/strings_final.xml index 6e840c3e83..7c59ccee98 100644 --- a/app/src/main/res/values-it/strings_final.xml +++ b/app/src/main/res/values-it/strings_final.xml @@ -87,4 +87,6 @@ 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. Select network %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. + + To start working with the card scan the first card and make a backup \ No newline at end of file diff --git a/app/src/main/res/values-ru/strings_final.xml b/app/src/main/res/values-ru/strings_final.xml index 0f2737c2bb..27f6ed4b8a 100644 --- a/app/src/main/res/values-ru/strings_final.xml +++ b/app/src/main/res/values-ru/strings_final.xml @@ -98,4 +98,6 @@ Сброс к заводским настройкам приведет к полному удалению кошелька с выбранной карты. Вы не сможете восстановить текущий кошелек или использовать эту карту для восстановления кода доступа. Выберите сеть Сеть %s использует концепцию экзистенциального депозита. Если баланс вашего счета опустится ниже %s %s, он будет деактивирован, а все оставшиеся средства будут уничтожены. + + Для начала работы с картой сначала отсканируйте первую карту и сделайте бэкап diff --git a/app/src/main/res/values/strings_final.xml b/app/src/main/res/values/strings_final.xml index c3c6f58fe1..dd49ea9071 100644 --- a/app/src/main/res/values/strings_final.xml +++ b/app/src/main/res/values/strings_final.xml @@ -100,4 +100,6 @@ 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. Select network %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. + + To start working with the card scan the first card and make a backup diff --git a/domain/src/main/java/com/tangem/domain/common/ScanResponse.kt b/domain/src/main/java/com/tangem/domain/common/ScanResponse.kt index 35ec0dbe8b..35c6b31736 100644 --- a/domain/src/main/java/com/tangem/domain/common/ScanResponse.kt +++ b/domain/src/main/java/com/tangem/domain/common/ScanResponse.kt @@ -8,7 +8,10 @@ import com.tangem.common.card.WalletData import com.tangem.common.extensions.ByteArrayKey import com.tangem.common.extensions.toMapKey import com.tangem.common.hdWallet.DerivationPath +import com.tangem.domain.common.TapWorkarounds.getSaltPayBlockchain import com.tangem.domain.common.TapWorkarounds.getTangemNoteBlockchain +import com.tangem.domain.common.TapWorkarounds.isSaltPay +import com.tangem.domain.common.TapWorkarounds.isTangemNote import com.tangem.domain.common.TapWorkarounds.isTestCard import com.tangem.operations.CommandResponse import com.tangem.operations.backup.PrimaryCard @@ -23,17 +26,26 @@ data class ScanResponse( val walletData: WalletData?, val secondTwinPublicKey: String? = null, val derivedKeys: Map = mapOf(), - val primaryCard: PrimaryCard? = null + val primaryCard: PrimaryCard? = null, ) : CommandResponse { - fun getBlockchain(): Blockchain { - if (productType == ProductType.Note) return card.getTangemNoteBlockchain() - ?: return Blockchain.Unknown - val blockchainName: String = walletData?.blockchain ?: return Blockchain.Unknown - return Blockchain.fromId(blockchainName) + return when (productType) { + ProductType.SaltPay -> { + card.getSaltPayBlockchain() + } + ProductType.Note -> { + card.getTangemNoteBlockchain() ?: Blockchain.Unknown + } + else -> { + val blockchainName: String = walletData?.blockchain ?: return Blockchain.Unknown + Blockchain.fromId(blockchainName) + } + } } fun getPrimaryToken(): Token? { + if (card.isSaltPay) return TapWorkarounds.saltPayToken + val cardToken = walletData?.token ?: return null return Token( cardToken.name, @@ -46,10 +58,8 @@ data class ScanResponse( fun isTangemNote(): Boolean = productType == ProductType.Note fun isTangemWallet(): Boolean = productType == ProductType.Wallet fun isTangemTwins(): Boolean = productType == ProductType.Twins - fun supportsHdWallet(): Boolean = card.settings.isHDWalletAllowed fun supportsBackup(): Boolean = card.settings.isBackupAllowed - fun twinsIsTwinned(): Boolean = card.isTangemTwins() && walletData != null && secondTwinPublicKey != null @@ -73,18 +83,24 @@ data class ScanResponse( fun hasDerivation(curve: EllipticCurve, derivationPath: DerivationPath): Boolean { val foundWallet = card.wallets.firstOrNull { it.curve == curve } ?: return false - val extendedPublicKeysMap = derivedKeys[foundWallet.publicKey.toMapKey()] ?: return false - val extendedPublicKey = extendedPublicKeysMap[derivationPath] return extendedPublicKey != null } } enum class ProductType { - Note, Twins, Wallet + Note, Twins, Wallet, SaltPay } +val Card.productType: ProductType + get() = when { + isTangemTwins() -> ProductType.Twins + isTangemNote() -> ProductType.Note + isSaltPay -> ProductType.SaltPay + else -> ProductType.Wallet + } + typealias KeyWalletPublicKey = ByteArrayKey fun Card.isTangemTwins(): Boolean = TwinsHelper.getTwinCardNumber(cardId) != null \ No newline at end of file diff --git a/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt b/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt index a11441c51c..9b72f5d06d 100644 --- a/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt +++ b/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt @@ -2,6 +2,7 @@ package com.tangem.domain.common import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.DerivationStyle +import com.tangem.blockchain.common.Token import com.tangem.common.card.Card import java.util.* @@ -16,7 +17,8 @@ object TapWorkarounds { val Card.isStart2Coin: Boolean get() = isStart2CoinIssuer(issuer.name) val Card.isSaltPay: Boolean - get() = false //TODO fix when we know which cards are SaltPay cards + get() = saltPayCardIds.contains(cardId) || saltPayBatches.contains(batchId) + val Card.isTestCard: Boolean get() = batchId == TEST_CARD_BATCH && cardId.startsWith(TEST_CARD_ID_STARTS_WITH) val Card.useOldStyleDerivation: Boolean @@ -40,10 +42,12 @@ object TapWorkarounds { return false } - fun Card.isTangemNote(): Boolean = tangemNoteBatches.contains(batchId) || isSaltPay + fun Card.isTangemNote(): Boolean = tangemNoteBatches.contains(batchId) fun isTangemWalletBatch(card: Card): Boolean = tangemWalletBatches.contains(card.batchId) fun Card.getTangemNoteBlockchain(): Blockchain? = - tangemNoteBatches[batchId] ?: if (isSaltPay) Blockchain.Gnosis else null + tangemNoteBatches[batchId] ?: null + + fun Card.getSaltPayBlockchain(): Blockchain = Blockchain.SaltPay private const val START_2_COIN_ISSUER = "start2coin" private const val TEST_CARD_BATCH = "99FF" @@ -77,6 +81,41 @@ object TapWorkarounds { ) private val tangemWalletBatchesWithStandardDerivationType = listOf( - "AC01", "AC02", "CB95" + "AC01", "AC02", "CB95", ) + + private val saltPayCardIds = listOf( + "AE02000000000194", + "AC03000000076195", + "AC79000000000012", // TODO: remove my testing CIDs + "AC79000000000004",// TODO: remove my testing CIDs + "AC03000000076070", + "AC03000000076088", + "AC03000000076096", + "AC03000000076104", + "AC03000000076112", + "AC03000000076120", + "AC03000000076138", + "AC03000000076146", + "AC03000000076153", + "AC03000000076161", + "AC03000000076179", + "AC03000000076187", + "AC03000000076195", + "AC03000000076203", + "AC03000000076211", + "AC03000000076229", + // TODO: add cids + ) + + private val saltPayBatches = listOf("AE02") + + val saltPayToken: Token // TODO: Add real token + get() = Token( + name = "Wrapped xDAI", + "WxDAI", + "0x4346186e7461cB4DF06bCFCB4cD591423022e417", + 18, + id = "xdai", + ) } \ No newline at end of file diff --git a/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt b/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt index a162d197b2..6a4eb3b3e1 100644 --- a/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt +++ b/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt @@ -86,6 +86,7 @@ fun Blockchain.toNetworkId(): String { Blockchain.Polkadot -> "polkadot" Blockchain.PolkadotTestnet -> "polkadot/test" Blockchain.Kusama -> "kusama" + Blockchain.SaltPay -> "xdai"//TODO } } @@ -113,6 +114,7 @@ fun Blockchain.toCoinId(): String { Blockchain.Dogecoin -> "dogecoin" Blockchain.Gnosis -> "xdai" Blockchain.Kusama -> "kusama" + Blockchain.SaltPay -> "xdai" //TODO Blockchain.Unknown -> "unknown" } } \ No newline at end of file From a642b39aa7bd751846097cebc356079767b90eb8 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 22 Sep 2022 11:23:23 +0400 Subject: [PATCH 02/30] Updated on 2026-08-14 --- .../com/tangem/tap/common/analytics/TangemSdkError.kt | 2 +- .../tangem/tap/features/onboarding/OnboardingHelper.kt | 3 +-- .../products/wallet/redux/OnboardingWalletMiddleware.kt | 9 ++++++++- .../features/wallet/ui/wallet/SaltPaySingleWalletView.kt | 2 +- app/src/main/res/values-it/strings_final.xml | 1 - app/src/main/res/values-ru/strings_final.xml | 2 -- dependencies.gradle | 1 + .../main/java/com/tangem/domain/common/TapWorkarounds.kt | 6 +++--- .../com/tangem/domain/common/extensions/Blockchain.kt | 2 ++ 9 files changed, 17 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/common/analytics/TangemSdkError.kt b/app/src/main/java/com/tangem/tap/common/analytics/TangemSdkError.kt index 58b026e655..17e31d88c4 100644 --- a/app/src/main/java/com/tangem/tap/common/analytics/TangemSdkError.kt +++ b/app/src/main/java/com/tangem/tap/common/analytics/TangemSdkError.kt @@ -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() diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingHelper.kt b/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingHelper.kt index 0b58d4aa0b..cd6f7c5197 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingHelper.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingHelper.kt @@ -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()) { diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt index de8e3a77c4..6f332cfd34 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt @@ -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 -> { - } } } diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPaySingleWalletView.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPaySingleWalletView.kt index 8b0d0e639e..1e348987fc 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPaySingleWalletView.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPaySingleWalletView.kt @@ -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() diff --git a/app/src/main/res/values-it/strings_final.xml b/app/src/main/res/values-it/strings_final.xml index 1c6908d47b..42c604b593 100644 --- a/app/src/main/res/values-it/strings_final.xml +++ b/app/src/main/res/values-it/strings_final.xml @@ -86,6 +86,5 @@ Reset to Factory Settings 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. Select network - %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. To start working with the card scan the first card and make a backup \ No newline at end of file diff --git a/app/src/main/res/values-ru/strings_final.xml b/app/src/main/res/values-ru/strings_final.xml index 23f2c7f576..9dae8e2e27 100644 --- a/app/src/main/res/values-ru/strings_final.xml +++ b/app/src/main/res/values-ru/strings_final.xml @@ -101,7 +101,5 @@ Tag Недопустимый Memo. Он не будет добавлен в транзакцию. Недопустимый Tag. Он не будет добавлен в транзакцию. - Сеть %s использует концепцию экзистенциального депозита. Если баланс вашего счета опустится ниже %s %s, он будет деактивирован, а все оставшиеся средства будут уничтожены. - Для начала работы с картой сначала отсканируйте первую карту и сделайте бэкап diff --git a/dependencies.gradle b/dependencies.gradle index 5d1d0d6fa5..b0dc5d199b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -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', ] diff --git a/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt b/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt index 9b72f5d06d..ab57eb34d8 100644 --- a/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt +++ b/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt @@ -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", diff --git a/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt b/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt index 8dabde8702..a335a847a4 100644 --- a/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt +++ b/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt @@ -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 } } \ No newline at end of file From 76a4df457222e4b3659690794822de15d15646ff Mon Sep 17 00:00:00 2001 From: Tangem Date: Sat, 1 Oct 2022 00:01:45 +0500 Subject: [PATCH 03/30] Updated on 2026-08-14 --- .../tap/common/compose/PinCodeWidget.kt | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 app/src/main/java/com/tangem/tap/common/compose/PinCodeWidget.kt diff --git a/app/src/main/java/com/tangem/tap/common/compose/PinCodeWidget.kt b/app/src/main/java/com/tangem/tap/common/compose/PinCodeWidget.kt new file mode 100644 index 0000000000..31c826f6be --- /dev/null +++ b/app/src/main/java/com/tangem/tap/common/compose/PinCodeWidget.kt @@ -0,0 +1,172 @@ +package com.tangem.tap.common.compose + +import androidx.compose.foundation.background +import androidx.compose.foundation.gestures.detectTapGestures +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.wrapContentSize +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.text.KeyboardActions +import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.material.LocalTextStyle +import androidx.compose.material.MaterialTheme +import androidx.compose.material.Surface +import androidx.compose.material.Text +import androidx.compose.material.TextField +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.ExperimentalComposeUiApi +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.alpha +import androidx.compose.ui.draw.clip +import androidx.compose.ui.focus.FocusRequester +import androidx.compose.ui.focus.focusRequester +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.input.pointer.pointerInput +import androidx.compose.ui.platform.LocalSoftwareKeyboardController +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.input.ImeAction +import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.text.input.TextFieldValue +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.core.text.isDigitsOnly + +/** +[REDACTED_AUTHOR] + */ +@OptIn(ExperimentalComposeUiApi::class) +@Composable +fun PinCodeWidget( + config: PinViewConfig = tangemPinConfig, + onPinChanged: (String, Boolean) -> Unit = { pin, isLastSymbolEntered -> }, +) { + val focusRequester = remember { FocusRequester() } + val keyboardController = LocalSoftwareKeyboardController.current + + val rTextFieldValue = remember { mutableStateOf(TextFieldValue("")) } + val indexedSymbols: List = createPinSymbolsList(config.pinsCount, rTextFieldValue.value.text) + + fun isLastSymbolEntered(): Boolean = rTextFieldValue.value.text.length == config.pinsCount + + fun handleOnTextFieldValueChanged(value: TextFieldValue) { + if (!value.text.isDigitsOnly()) return + + if (value.text.length <= config.pinsCount) { + rTextFieldValue.value = value + onPinChanged(value.text, isLastSymbolEntered()) + } + } + + Box( + modifier = config.modifier + .pointerInput(Unit) { + detectTapGestures { + focusRequester.requestFocus() + keyboardController?.show() + } + }, + ) { + Row { + for (index in 0 until config.pinsCount) { + PinElement( + config = config, + pinSymbol = indexedSymbols[index] ?: "", + ) + } + } + TextField( + modifier = Modifier + .alpha(0f) + .size(1.dp) + .align(Alignment.Center) + .focusRequester(focusRequester), + keyboardOptions = KeyboardOptions( + keyboardType = KeyboardType.Decimal, + imeAction = if (isLastSymbolEntered()) ImeAction.Done else ImeAction.Next, + ), + keyboardActions = KeyboardActions( + onDone = { keyboardController?.hide() }, + ), + value = rTextFieldValue.value, + onValueChange = ::handleOnTextFieldValueChanged, + ) + } + + LaunchedEffect(Unit) { + focusRequester.requestFocus() + } +} + +@Composable +private fun PinElement( + config: PinViewConfig, + pinSymbol: String, +) { + Box(Modifier.padding(config.pinBoxPadding)) { + Box(config.pinBoxModifier) { + Text( + text = pinSymbol, + modifier = config.pinTextModifier.align(Alignment.Center), + style = config.pinsTextStyle ?: LocalTextStyle.current, + ) + } + } +} + +@Composable +private fun HiddenInputField() { +} + +private fun createPinSymbolsList(size: Int, text: String): List = List(size) { + try { + text[it].toString() + } catch (ex: IndexOutOfBoundsException) { + null + } +} + +data class PinViewConfig( + val modifier: Modifier = Modifier, + val pinBoxModifier: Modifier = Modifier, + val pinBoxPadding: Dp = 0.dp, + val pinTextModifier: Modifier = Modifier, + val pinsCount: Int = 4, + val pinsTextStyle: TextStyle? = null, +) + +private val tangemPinConfig = PinViewConfig( + modifier = Modifier + .wrapContentSize(), + pinBoxModifier = Modifier + .width(42.dp) + .height(56.dp) + .clip(RoundedCornerShape(8.dp)) + .background(Color(0xFFF5F5F5)), + pinBoxPadding = 6.dp, + pinTextModifier = Modifier, + pinsCount = 4, + pinsTextStyle = TextStyle( + fontWeight = FontWeight(500), + fontSize = 24.sp, + ), +) + +@Preview +@Composable +fun PinCodeWidgetPreview() { + Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colors.background) { + PinCodeWidget(tangemPinConfig) + } +} \ No newline at end of file From d9516b53161c9cd057a3053b2eeefeead19fa5d0 Mon Sep 17 00:00:00 2001 From: Tangem Date: Sat, 1 Oct 2022 20:16:49 +0500 Subject: [PATCH 04/30] Updated on 2026-08-14 --- .../details/ui/details/DetailsViewModel.kt | 5 ++- .../tap/features/home/redux/HomeMiddleware.kt | 14 +++++- .../redux/OnboardingWalletMiddleware.kt | 9 +++- .../wallet/redux/reducers/WalletReducer.kt | 3 +- .../wallet/ui/wallet/SaltPayBalanceWidget.kt | 21 +++++++-- dependencies.gradle | 6 +-- .../tangem/domain/common/TapWorkarounds.kt | 44 ++++++++++++++----- .../domain/common/extensions/Blockchain.kt | 6 +-- .../domain/common/extensions/Coroutine.kt | 22 +++++++++- 9 files changed, 101 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/details/DetailsViewModel.kt b/app/src/main/java/com/tangem/tap/features/details/ui/details/DetailsViewModel.kt index 97ce019a84..502437104c 100644 --- a/app/src/main/java/com/tangem/tap/features/details/ui/details/DetailsViewModel.kt +++ b/app/src/main/java/com/tangem/tap/features/details/ui/details/DetailsViewModel.kt @@ -1,5 +1,6 @@ package com.tangem.tap.features.details.ui.details +import com.tangem.domain.common.TapWorkarounds.isSaltPay import com.tangem.domain.common.TapWorkarounds.isStart2Coin import com.tangem.tap.common.feedback.FeedbackEmail import com.tangem.tap.common.feedback.SupportInfo @@ -25,7 +26,9 @@ class DetailsViewModel(private val store: Store) { if (state.scanResponse?.card?.isMultiwalletAllowed == true) it else null } SettingsElement.LinkMoreCards -> { - if (state.createBackupAllowed) it else null + // if (state.createBackupAllowed) it else null + // TODO: SaltPay: temporary excluding backup process for Visa cards + if (state.createBackupAllowed && state.scanResponse?.card?.isSaltPay != true) it else null } SettingsElement.PrivacyPolicy -> { if (state.privacyPolicyUrl != null) it else null diff --git a/app/src/main/java/com/tangem/tap/features/home/redux/HomeMiddleware.kt b/app/src/main/java/com/tangem/tap/features/home/redux/HomeMiddleware.kt index 374b8d4406..644f172e29 100644 --- a/app/src/main/java/com/tangem/tap/features/home/redux/HomeMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/home/redux/HomeMiddleware.kt @@ -1,5 +1,6 @@ package com.tangem.tap.features.home.redux +import com.tangem.domain.common.TapWorkarounds.isSaltPayVisa import com.tangem.domain.common.extensions.withMainContext import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE import com.tangem.tap.common.analytics.AnalyticsEvent @@ -64,7 +65,7 @@ private val homeMiddleware: Middleware = { _, _ -> } store.state.globalState.analyticsHandlers?.triggerEvent( event = AnalyticsEvent.GET_CARD, - params = mapOf(AnalyticsParam.SOURCE.param to GetCardSourceParams.WELCOME.param) + params = mapOf(AnalyticsParam.SOURCE.param to GetCardSourceParams.WELCOME.param), ) } } @@ -82,6 +83,17 @@ private fun handleReadCard() { store.state.globalState.tapWalletManager.updateConfigManager(scanResponse) store.dispatch(TwinCardsAction.IfTwinsPrepareState(scanResponse)) + // TODO: SaltPay: temporary excluding backup process for Visa cards + if (scanResponse.card.isSaltPayVisa) { + scope.launch { + store.onCardScanned(scanResponse) + withMainContext { + navigateTo(AppScreen.Wallet, null) + } + } + return@ScanCard + } + if (OnboardingHelper.isOnboardingCase(scanResponse)) { val navigateTo = OnboardingHelper.whereToNavigate(scanResponse) store.dispatch(GlobalAction.Onboarding.Start(scanResponse)) diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt index 6f332cfd34..016fee1817 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/OnboardingWalletMiddleware.kt @@ -9,7 +9,7 @@ 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 -import com.tangem.tap.* +import com.tangem.tap.backupService import com.tangem.tap.common.extensions.dispatchOnMain import com.tangem.tap.common.redux.AppState import com.tangem.tap.common.redux.global.GlobalAction @@ -21,6 +21,11 @@ import com.tangem.tap.features.demo.DemoHelper import com.tangem.tap.features.home.redux.HomeAction import com.tangem.tap.features.wallet.redux.Artwork import com.tangem.tap.features.wallet.redux.WalletAction +import com.tangem.tap.preferencesStorage +import com.tangem.tap.scope +import com.tangem.tap.store +import com.tangem.tap.tangemSdk +import com.tangem.tap.tangemSdkManager import kotlinx.coroutines.launch import org.rekotlin.Action import org.rekotlin.Middleware @@ -217,7 +222,7 @@ private fun handleBackupAction(appState: () -> AppState?, action: BackupAction) is BackupAction.AddBackupCard -> { backupService.skipCompatibilityChecks = true tangemSdk.config.filter.cardIdFilter = - CardFilter.Companion.ItemFilter.Allow(TapWorkarounds.saltPayCardIds.toSet()) + CardFilter.Companion.ItemFilter.Allow(TapWorkarounds.saltPayTangemCardIds.toSet()) backupService.addBackupCard { result -> backupService.skipCompatibilityChecks = false diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt index 413e9e6f77..9579f7311e 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt @@ -438,8 +438,7 @@ private fun setSingleWalletFiatRates( appCurrency: FiatCurrency, rateFormatter: (BigDecimal) -> String, state: WalletState, -): - WalletState { +): WalletState { val blockchainFiatRate = fiatRates.entries.firstOrNull { it.key.isBlockchain() } val tokenFiatRate = fiatRates.entries.firstOrNull { it.key.isToken() } Timber.e("Token Fiat Rate is ${tokenFiatRate ?: "NULL"}") diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPayBalanceWidget.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPayBalanceWidget.kt index 95509f5b37..49fcb89c16 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPayBalanceWidget.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SaltPayBalanceWidget.kt @@ -1,12 +1,15 @@ package com.tangem.tap.features.wallet.ui.wallet +import com.tangem.domain.common.extensions.debounce import com.tangem.tap.common.entities.FiatCurrency import com.tangem.tap.common.extensions.animateVisibility import com.tangem.tap.common.extensions.formatAmountAsSpannedString import com.tangem.tap.features.wallet.redux.ProgressState import com.tangem.tap.features.wallet.redux.WalletAction +import com.tangem.tap.mainScope import com.tangem.tap.store import com.tangem.wallet.databinding.LayoutSingleWalletBalanceBinding +import org.rekotlin.Action import java.math.BigDecimal data class SaltPayBalanceWidgetData( @@ -26,7 +29,7 @@ class SaltPayBalanceWidget( veilBalance.veil() veilBalanceCrypto.veil() } else { - veilBalance.unVeil() + // veilBalance.unVeil() veilBalanceCrypto.unVeil() } tvProcessing.animateVisibility( @@ -35,9 +38,18 @@ class SaltPayBalanceWidget( veilBalanceCrypto.animateVisibility( show = data.state != ProgressState.Error, ) - tvBalance.text = data.fiatAmount?.formatAmountAsSpannedString( - currencySymbol = data.fiatCurrency?.symbol ?: "", - ) + if (data.fiatAmount == null) { + //TODO: SaltPay: A tricky solution to the problem with displaying rates + // If the rates are loaded after the walletManager.update() is completely updated, + // then this problem can be avoided + actionDebouncer(WalletAction.LoadFiatRate()) + } else { + veilBalance.unVeil() + tvBalance.text = data.fiatAmount?.formatAmountAsSpannedString( + currencySymbol = data.fiatCurrency?.symbol ?: "", + ) + } + tvBalanceCrypto.text = data.currency tvCurrencyName.text = data.fiatCurrency?.code @@ -48,4 +60,5 @@ class SaltPayBalanceWidget( } } +private val actionDebouncer = debounce(500, mainScope) { store.dispatch(it) } diff --git a/dependencies.gradle b/dependencies.gradle index b0dc5d199b..465ca3866a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,9 +1,9 @@ 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_card_sdk : 'develop-159', + tangem_card_sdk: '0.0.1', + tangem_blockchain_sdk: 'develop-122', // tangem_blockchain_sdk: '0.0.1', ] diff --git a/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt b/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt index ab57eb34d8..6c85f64266 100644 --- a/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt +++ b/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt @@ -16,8 +16,15 @@ object TapWorkarounds { val Card.isStart2Coin: Boolean get() = isStart2CoinIssuer(issuer.name) + val Card.isSaltPay: Boolean - get() = saltPayCardIds.contains(cardId) || saltPayBatches.contains(batchId) + get() = isSaltPayVisa || isSaltPayTangem + + val Card.isSaltPayVisa: Boolean + get() = saltPayVisaBatches.contains(batchId) + + val Card.isSaltPayTangem: Boolean + get() = saltPayTangemCardIds.contains(cardId) val Card.isTestCard: Boolean get() = batchId == TEST_CARD_BATCH && cardId.startsWith(TEST_CARD_ID_STARTS_WITH) @@ -60,7 +67,7 @@ object TapWorkarounds { ) private val excludedIssuers = listOf( - "TTM BANK" + "TTM BANK", ) private val tangemWalletBatches = listOf("AC01") @@ -84,11 +91,9 @@ object TapWorkarounds { "AC01", "AC02", "CB95", ) - val saltPayCardIds = listOf( - "AE02000000000194", - "AC03000000076195", - "AC79000000000012", // TODO: remove my testing CIDs - "AC79000000000004",// TODO: remove my testing CIDs + val saltPayTangemCardIds = listOf( + "AC01000000000015", // TODO: remove testing CIDs + "AC03000000000088", // TODO: remove testing CIDs "AC03000000076070", "AC03000000076088", "AC03000000076096", @@ -105,17 +110,32 @@ object TapWorkarounds { "AC03000000076203", "AC03000000076211", "AC03000000076229", - // TODO: add cids + // added 01.10.2022 + "AC01000000033503", + "AC01000000033594", + "AC01000000033586", + "AC01000000034477", + "AC01000000032760", + "AC01000000033867", + "AC01000000032653", + "AC01000000032752", + "AC01000000034485", + "AC01000000033644", + "AC01000000037454", + "AC01000000037462", ) - val saltPayBatches = listOf("AE02") + private val saltPayVisaBatches = listOf( + "AE02", + "AE03", + ) val saltPayToken: Token get() = Token( name = "Wrapped xDAI", - "WxDAI", - "0x4346186e7461cB4DF06bCFCB4cD591423022e417", - 18, + symbol = "WxDAI", + contractAddress = "0x4346186e7461cB4DF06bCFCB4cD591423022e417", + decimals = 18, id = "xdai", ) } \ No newline at end of file diff --git a/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt b/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt index a335a847a4..f8ed090152 100644 --- a/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt +++ b/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt @@ -44,6 +44,7 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? { "optimistic-ethereum" -> Blockchain.Optimism "optimistic-ethereum/test" -> Blockchain.OptimismTestnet "dash" -> Blockchain.Dash + "wxdai" -> Blockchain.SaltPay else -> null } } @@ -92,7 +93,7 @@ fun Blockchain.toNetworkId(): String { Blockchain.Optimism -> "optimistic-ethereum" Blockchain.OptimismTestnet -> "optimistic-ethereum/test" Blockchain.Dash -> "dash" - Blockchain.SaltPay -> "xdai"//TODO + Blockchain.SaltPay -> "wxdai" else -> "unknown" // TODO } } @@ -119,11 +120,10 @@ fun Blockchain.toCoinId(): String { Blockchain.Tezos -> "tezos" Blockchain.XRP -> "ripple" Blockchain.Dogecoin -> "dogecoin" - Blockchain.Gnosis -> "xdai" + Blockchain.Gnosis, Blockchain.SaltPay -> "xdai" Blockchain.Kusama -> "kusama" Blockchain.Optimism, Blockchain.OptimismTestnet -> "ethereum" Blockchain.Dash -> "dash" - Blockchain.SaltPay -> "xdai" //TODO Blockchain.Unknown -> "unknown" else -> "unknown" // TODO } diff --git a/domain/src/main/java/com/tangem/domain/common/extensions/Coroutine.kt b/domain/src/main/java/com/tangem/domain/common/extensions/Coroutine.kt index 0f7f23dd82..0cb52aa4a1 100644 --- a/domain/src/main/java/com/tangem/domain/common/extensions/Coroutine.kt +++ b/domain/src/main/java/com/tangem/domain/common/extensions/Coroutine.kt @@ -1,7 +1,11 @@ package com.tangem.domain.common.extensions +import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch import kotlinx.coroutines.withContext /** @@ -9,4 +13,20 @@ import kotlinx.coroutines.withContext */ suspend fun withMainContext(block: suspend CoroutineScope.() -> T): T = withContext(Dispatchers.Main, block) -suspend fun withIOContext(block: suspend CoroutineScope.() -> T): T = withContext(Dispatchers.IO, block) \ No newline at end of file +suspend fun withIOContext(block: suspend CoroutineScope.() -> T): T = withContext(Dispatchers.IO, block) + +fun debounce( + waitMs: Long = 300L, + coroutineScope: CoroutineScope, + runDestinationOn: CoroutineDispatcher = Dispatchers.Unconfined, + destinationFunction: (T) -> Unit, +): (T) -> Unit { + var debounceJob: Job? = null + return { param: T -> + debounceJob?.cancel() + debounceJob = coroutineScope.launch { + delay(waitMs) + withContext(runDestinationOn) { destinationFunction(param) } + } + } +} \ No newline at end of file From 8e552d9ed39b0130db2d2d202005983c4a162e62 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 6 Oct 2022 15:12:52 +0500 Subject: [PATCH 05/30] Updated on 2026-08-14 --- .../com/tangem/domain/common/LogConfig.kt | 1 + .../api/paymentology/PaymentologyApi.kt | 29 ++++++++ .../paymentology/PaymentologyApiService.kt | 44 ++++++++++++ .../network/api/paymentology/Requests.kt | 59 +++++++++++++++ .../network/api/paymentology/Responses.kt | 72 +++++++++++++++++++ 5 files changed, 205 insertions(+) create mode 100644 network/src/main/java/com/tangem/network/api/paymentology/PaymentologyApi.kt create mode 100644 network/src/main/java/com/tangem/network/api/paymentology/PaymentologyApiService.kt create mode 100644 network/src/main/java/com/tangem/network/api/paymentology/Requests.kt create mode 100644 network/src/main/java/com/tangem/network/api/paymentology/Responses.kt diff --git a/domain/src/main/java/com/tangem/domain/common/LogConfig.kt b/domain/src/main/java/com/tangem/domain/common/LogConfig.kt index 56c2950141..ff11351635 100644 --- a/domain/src/main/java/com/tangem/domain/common/LogConfig.kt +++ b/domain/src/main/java/com/tangem/domain/common/LogConfig.kt @@ -13,5 +13,6 @@ object NetworkLogConfig { val mercuryoService: Boolean = false val moonPayService: Boolean = false val tangemTechService: Boolean = BuildConfig.DEBUG + val paymentologyApiService: Boolean = BuildConfig.DEBUG val blockchainSdkNetwork: Boolean = BuildConfig.DEBUG } \ No newline at end of file diff --git a/network/src/main/java/com/tangem/network/api/paymentology/PaymentologyApi.kt b/network/src/main/java/com/tangem/network/api/paymentology/PaymentologyApi.kt new file mode 100644 index 0000000000..cbefd39af8 --- /dev/null +++ b/network/src/main/java/com/tangem/network/api/paymentology/PaymentologyApi.kt @@ -0,0 +1,29 @@ +package com.tangem.network.api.paymentology + +import retrofit2.http.Body +import retrofit2.http.POST + +/** +[REDACTED_AUTHOR] + */ +interface PaymentologyApi { + + @POST("card/verify") + fun checkRegistration( + @Body request: CheckRegistrationRequests, + ): RegistrationResponse.Item + + @POST("card/get_challenge") + fun requestAttestationChallenge( + @Body request: CheckRegistrationRequests.Item, + ): AttestationResponse + + @POST("card/set_pin") + fun registerWallet( + @Body request: RegisterWalletRequest, + ): RegisterWalletResponse + + companion object { + val baseUrl: String = "https://paymentologygate.oa.r.appspot.com/" + } +} \ No newline at end of file diff --git a/network/src/main/java/com/tangem/network/api/paymentology/PaymentologyApiService.kt b/network/src/main/java/com/tangem/network/api/paymentology/PaymentologyApiService.kt new file mode 100644 index 0000000000..0fce5b41ba --- /dev/null +++ b/network/src/main/java/com/tangem/network/api/paymentology/PaymentologyApiService.kt @@ -0,0 +1,44 @@ +package com.tangem.network.api.paymentology + +import com.tangem.common.extensions.toHexString +import com.tangem.common.services.Result +import com.tangem.common.services.performRequest +import com.tangem.network.common.createRetrofitInstance +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext + +/** +[REDACTED_AUTHOR] + */ +class PaymentologyApiService( + private val logEnabled: Boolean, +) { + private val api = createRetrofitInstance( + baseUrl = PaymentologyApi.baseUrl, + logEnabled = logEnabled, + ).create(PaymentologyApi::class.java) + + suspend fun checkRegistration( + cardId: String, + publicKey: ByteArray, + ): Result = withContext(Dispatchers.IO) { + // later convert response to SaltPayRegistrator.State + val requestItem = CheckRegistrationRequests.Item(cardId, publicKey.toHexString()) + val requests = listOf(requestItem) + performRequest { api.checkRegistration(CheckRegistrationRequests(requests)) } + } + + suspend fun requestAttestationChallenge( + cardId: String, + publicKey: ByteArray, + ): Result = withContext(Dispatchers.IO) { + val requestItem = CheckRegistrationRequests.Item(cardId, publicKey.toHexString()) + performRequest { api.requestAttestationChallenge(requestItem) } + } + + suspend fun registerWallet( + request: RegisterWalletRequest, + ): Result = withContext(Dispatchers.IO) { + performRequest { api.registerWallet(request) } + } +} \ No newline at end of file diff --git a/network/src/main/java/com/tangem/network/api/paymentology/Requests.kt b/network/src/main/java/com/tangem/network/api/paymentology/Requests.kt new file mode 100644 index 0000000000..1cea8aada4 --- /dev/null +++ b/network/src/main/java/com/tangem/network/api/paymentology/Requests.kt @@ -0,0 +1,59 @@ +package com.tangem.network.api.paymentology + +import com.squareup.moshi.Json +import com.tangem.common.extensions.calculateHashCode + +/** +[REDACTED_AUTHOR] + */ +data class CheckRegistrationRequests( + val requests: List, +) { + data class Item( + @Json(name = "CID") + var cardId: String = "", + var publicKey: String = "", + ) +} + +data class RegisterWalletRequest( + @Json(name = "CID") + val cardId: String, + val publicKey: ByteArray, + val walletPublicKey: ByteArray, + val walletSalt: ByteArray, + val walletSignature: ByteArray, + val cardSalt: ByteArray, + val cardSignature: ByteArray, + @Json(name = "PIN") + val pin: String, +) { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as RegisterWalletRequest + + if (cardId != other.cardId) return false + if (publicKey.contentEquals(other.publicKey)) return false + if (walletPublicKey.contentEquals(other.walletPublicKey)) return false + if (walletSalt.contentEquals(other.walletSalt)) return false + if (walletSignature.contentEquals(other.walletSignature)) return false + if (cardSalt.contentEquals(other.cardSalt)) return false + if (cardSignature.contentEquals(other.cardSignature)) return false + if (pin != other.pin) return false + + return true + } + + override fun hashCode(): Int = calculateHashCode( + cardId.hashCode(), + publicKey.contentHashCode(), + walletPublicKey.contentHashCode(), + walletSalt.contentHashCode(), + walletSignature.contentHashCode(), + cardSalt.contentHashCode(), + cardSignature.contentHashCode(), + pin.hashCode(), + ) +} \ No newline at end of file diff --git a/network/src/main/java/com/tangem/network/api/paymentology/Responses.kt b/network/src/main/java/com/tangem/network/api/paymentology/Responses.kt new file mode 100644 index 0000000000..7edd003b23 --- /dev/null +++ b/network/src/main/java/com/tangem/network/api/paymentology/Responses.kt @@ -0,0 +1,72 @@ +package com.tangem.network.api.paymentology + +import com.squareup.moshi.Json +import com.tangem.common.extensions.calculateHashCode + +/** +[REDACTED_AUTHOR] + */ +interface ErrorContainer { + val error: String? +} + +data class RegistrationResponse( + val results: List, + val success: Boolean, + override val error: String?, + val errorCode: String?, +) : ErrorContainer { + + data class Item( + @Json(name = "CID") + val cardId: String, + val passed: Boolean?, + val active: Boolean?, + @Json(name = "pin_set") + val pinSet: Boolean?, + @Json(name = "blockchain_init") + val blockchainInit: Boolean?, + @Json(name = "kyc_passed") + val kycPassed: Boolean?, + @Json(name = "kyc_waiting") + val kycWaiting: Boolean?, + @Json(name = "disabled_by_admin") + val disabledByAdmin: Boolean?, + override val error: String?, + ) : ErrorContainer +} + +data class AttestationResponse( + val challenge: ByteArray, + val success: Boolean, + override val error: String?, + val errorCode: String?, +) : ErrorContainer { + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as AttestationResponse + + if (challenge.contentEquals(other.challenge)) return false + if (success != other.success) return false + if (error != other.error) return false + if (errorCode != other.errorCode) return false + + return true + } + + override fun hashCode(): Int = calculateHashCode( + challenge.contentHashCode(), + success.hashCode(), + error.hashCode(), + errorCode.hashCode(), + ) +} + +data class RegisterWalletResponse( + val success: Boolean, + override val error: String?, + val errorCode: String?, +) : ErrorContainer \ No newline at end of file From 77d6364cbe2cc35cd57c71ccecd37babfa76b200 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 6 Oct 2022 16:20:24 +0500 Subject: [PATCH 06/30] Updated on 2026-08-14 --- .../tangem/domain/common/card/CardIdRange.kt | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 domain/src/main/java/com/tangem/domain/common/card/CardIdRange.kt diff --git a/domain/src/main/java/com/tangem/domain/common/card/CardIdRange.kt b/domain/src/main/java/com/tangem/domain/common/card/CardIdRange.kt new file mode 100644 index 0000000000..696050068f --- /dev/null +++ b/domain/src/main/java/com/tangem/domain/common/card/CardIdRange.kt @@ -0,0 +1,36 @@ +package com.tangem.domain.common.card + +import timber.log.Timber + +/** +[REDACTED_AUTHOR] + */ +class CardIdRange( + val cardIdStart: String, + val cardIdEnd: String, +) { + val range: LongRange + + init { + checkCardId(cardIdStart) + checkCardId(cardIdEnd) + range = toLong(cardIdStart)..toLong(cardIdEnd) + } + + fun contains(cardId: String): Boolean = try { + checkCardId(cardId) + range.contains(toLong(cardId)) + } catch (ex: Exception) { + Timber.e(ex, "CardIdRange: check for the cardId: [$cardId] in range failed.") + false + } + + private fun stripBatchPrefix(cardId: String): String = cardId.drop(4) + + @Throws(NumberFormatException::class) + private fun toLong(cardId: String): Long = stripBatchPrefix(cardId).toLong() + + private fun checkCardId(cardId: String) { + if (cardId.length != 16) throw IllegalArgumentException("CardId must be 16 characters long.") + } +} \ No newline at end of file From 84e54966897a9541e328631c356d7e02b266c82f Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 17 Oct 2022 15:40:11 +0500 Subject: [PATCH 07/30] Updated on 2026-08-14 --- app/src/main/res/values-de/strings_final.xml | 46 ++++++++++++++++++ app/src/main/res/values-fr/strings_final.xml | 48 ++++++++++++++++++- app/src/main/res/values-it/strings_final.xml | 48 ++++++++++++++++++- app/src/main/res/values-ru/strings.xml | 2 +- app/src/main/res/values-ru/strings_final.xml | 33 +++++++++++++ app/src/main/res/values/strings_final.xml | 33 +++++++++++++ .../main/res/values/strings_untranslated.xml | 2 +- app/src/main/res/values/styles.xml | 15 ++++++ 8 files changed, 223 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-de/strings_final.xml b/app/src/main/res/values-de/strings_final.xml index 7a4a70126b..6c801e756c 100644 --- a/app/src/main/res/values-de/strings_final.xml +++ b/app/src/main/res/values-de/strings_final.xml @@ -48,6 +48,10 @@ Notice Attention The server is not available, please try again later + Total balance + The amount does not include some of your funds + Manage tokens + No rate Hide token Hide %s Hide @@ -57,6 +61,15 @@ %s network not found. Please, add it first and try again. This network is not supported. Please select another network. %s network + Your wallet has not been backed up + To protect your assets, we advise you to carry out this procedure + Remove token + Russian bank cards are not accepted at the moment + Do you have a bank card of another country or a UnionPay card? + Yes + No + Chat + Tangem Bot Card Settings Security Mode Selected application protection method @@ -95,4 +108,37 @@ Invalid Tag. It won\'t be added to the transaction. Connection with this Dapp cannot be established due to its technical implementation. To start working with the card scan the first card and make a backup + Attention + Tap the card with the visa logo + No funds for activation + Please contact support + Four identical digits isn\'t safe + Such a PIN can be brute-forced easily + Pin code + Connect + KYC + Verify your identity + In progress + Set PIN code + Register + Verify + Refresh + Connect your card + Verify your identity + KYC is in progress + Connect your card to the decentralized payment system + To start using your card you have to pass the KYC process + Please wait until the verification is completed. Usually it takes up to 1 hour. You can close the app and come back later. + PIN Code + Set PIN code for your SaltPay card + Chat with support + This card is not designed to SaltPay backup + Please hold the card until the operation complete + To start the backup process you have to add Tangem card as your backup + No backup card + Backup card ready + Finalize the backup process by creating an access code + Prepare the SaltPay card + Tap the SaltPay card + Tap the Tangem card \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings_final.xml b/app/src/main/res/values-fr/strings_final.xml index 5e1c532e79..6c801e756c 100644 --- a/app/src/main/res/values-fr/strings_final.xml +++ b/app/src/main/res/values-fr/strings_final.xml @@ -45,9 +45,13 @@ Contract address copied! If you chose the wrong network during your crypto transfer from the exchange, this guide will help you recover your funds Custom - The server is not available, please try again later Notice Attention + The server is not available, please try again later + Total balance + The amount does not include some of your funds + Manage tokens + No rate Hide token Hide %s Hide @@ -57,6 +61,15 @@ %s network not found. Please, add it first and try again. This network is not supported. Please select another network. %s network + Your wallet has not been backed up + To protect your assets, we advise you to carry out this procedure + Remove token + Russian bank cards are not accepted at the moment + Do you have a bank card of another country or a UnionPay card? + Yes + No + Chat + Tangem Bot Card Settings Security Mode Selected application protection method @@ -95,4 +108,37 @@ Invalid Tag. It won\'t be added to the transaction. Connection with this Dapp cannot be established due to its technical implementation. To start working with the card scan the first card and make a backup + Attention + Tap the card with the visa logo + No funds for activation + Please contact support + Four identical digits isn\'t safe + Such a PIN can be brute-forced easily + Pin code + Connect + KYC + Verify your identity + In progress + Set PIN code + Register + Verify + Refresh + Connect your card + Verify your identity + KYC is in progress + Connect your card to the decentralized payment system + To start using your card you have to pass the KYC process + Please wait until the verification is completed. Usually it takes up to 1 hour. You can close the app and come back later. + PIN Code + Set PIN code for your SaltPay card + Chat with support + This card is not designed to SaltPay backup + Please hold the card until the operation complete + To start the backup process you have to add Tangem card as your backup + No backup card + Backup card ready + Finalize the backup process by creating an access code + Prepare the SaltPay card + Tap the SaltPay card + Tap the Tangem card \ No newline at end of file diff --git a/app/src/main/res/values-it/strings_final.xml b/app/src/main/res/values-it/strings_final.xml index 5e1c532e79..6c801e756c 100644 --- a/app/src/main/res/values-it/strings_final.xml +++ b/app/src/main/res/values-it/strings_final.xml @@ -45,9 +45,13 @@ Contract address copied! If you chose the wrong network during your crypto transfer from the exchange, this guide will help you recover your funds Custom - The server is not available, please try again later Notice Attention + The server is not available, please try again later + Total balance + The amount does not include some of your funds + Manage tokens + No rate Hide token Hide %s Hide @@ -57,6 +61,15 @@ %s network not found. Please, add it first and try again. This network is not supported. Please select another network. %s network + Your wallet has not been backed up + To protect your assets, we advise you to carry out this procedure + Remove token + Russian bank cards are not accepted at the moment + Do you have a bank card of another country or a UnionPay card? + Yes + No + Chat + Tangem Bot Card Settings Security Mode Selected application protection method @@ -95,4 +108,37 @@ Invalid Tag. It won\'t be added to the transaction. Connection with this Dapp cannot be established due to its technical implementation. To start working with the card scan the first card and make a backup + Attention + Tap the card with the visa logo + No funds for activation + Please contact support + Four identical digits isn\'t safe + Such a PIN can be brute-forced easily + Pin code + Connect + KYC + Verify your identity + In progress + Set PIN code + Register + Verify + Refresh + Connect your card + Verify your identity + KYC is in progress + Connect your card to the decentralized payment system + To start using your card you have to pass the KYC process + Please wait until the verification is completed. Usually it takes up to 1 hour. You can close the app and come back later. + PIN Code + Set PIN code for your SaltPay card + Chat with support + This card is not designed to SaltPay backup + Please hold the card until the operation complete + To start the backup process you have to add Tangem card as your backup + No backup card + Backup card ready + Finalize the backup process by creating an access code + Prepare the SaltPay card + Tap the SaltPay card + Tap the Tangem card \ No newline at end of file diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 38ee22a3ca..4b2986eae1 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -295,7 +295,7 @@ Все резервные карты могут использоваться как полнофункциональные с одинаковыми ключами Вы сможете установить код доступа для защиты своих кошельков Код доступа можно восстановить с помощью одной из резервных карт - Ваша карта Tangem Wallet настроена и готова к использованию + Ваша карта настроена и готова к использованию. Вы создали 1 резервную карту, и теперь эта карта готова к использованию Основная карта Я понимаю diff --git a/app/src/main/res/values-ru/strings_final.xml b/app/src/main/res/values-ru/strings_final.xml index 0f8e928ad5..951c4bc737 100644 --- a/app/src/main/res/values-ru/strings_final.xml +++ b/app/src/main/res/values-ru/strings_final.xml @@ -106,4 +106,37 @@ Не удалось установить сессию WalletConnect Cоединение с этим Dapp сервисом не может быть установлено из-за его технической реализации. Для начала работы с картой сначала отсканируйте первую карту и сделайте бэкап + Внимание + Приложите карту с логотипом Visa + Недостаточно средств для активации + Пожалуйста обратитесь в службу поддержки + Ввод одинаковых цифр является не безопасным + Данный Код доступа может быть легко взломан + Код доступа + Подключиться + Верификация клиента + Подтвердите свою личность + В обработке + Установить Код доступа + Зарегистрироваться + Подтвердить + Обновить + Подключите свою карту + Подтвердите свою личность + Подтверждение личности в процессе + Подключите вашу карту к децентрализованной платежной системе + Для начала работы с картой вам необходимо завершить процесс подтверждения личности + Пожалуйста дождитесь завершения процесса подтверждения вашей личности. Как правило, это занимает меньше часа. Вы можете закрыть приложение и вернуться позже. + Код доступа + Установите Код доступа для вашей SaltPay карты + Чат поддержки + Данная карта не подходит для бэкапа SaltPay + Пожалуйста, удерживайте карту до завершения операции + Для начала процесса бэкапа вам необходимо добавить Tangem карту + Бэкап карт не добавлена + Бэкап карта создана + Завершите процесс бэкапа создав код доступа + Приготовьте SaltPay карту + Приложите SaltPay карту + Приложите Tangem карту diff --git a/app/src/main/res/values/strings_final.xml b/app/src/main/res/values/strings_final.xml index 306301c3fa..5a47c7ed20 100644 --- a/app/src/main/res/values/strings_final.xml +++ b/app/src/main/res/values/strings_final.xml @@ -108,4 +108,37 @@ Invalid Tag. It won\'t be added to the transaction. Connection with this Dapp cannot be established due to its technical implementation. To start working with the card scan the first card and make a backup + Attention + Tap the card with the visa logo + No funds for activation + Please contact support + Four identical digits isn\'t safe + Such a PIN can be brute-forced easily + Pin code + Connect + KYC + Verify your identity + In progress + Set PIN code + Register + Verify + Refresh + Connect your card + Verify your identity + KYC is in progress + Connect your card to the decentralized payment system + To start using your card you have to pass the KYC process + Please wait until the verification is completed. Usually it takes up to 1 hour. You can close the app and come back later. + PIN Code + Set PIN code for your SaltPay card + Chat with support + This card is not designed to SaltPay backup + Please hold the card until the operation complete + To start the backup process you have to add Tangem card as your backup + No backup card + Backup card ready + Finalize the backup process by creating an access code + Prepare the SaltPay card + Tap the SaltPay card + Tap the Tangem card diff --git a/app/src/main/res/values/strings_untranslated.xml b/app/src/main/res/values/strings_untranslated.xml index 8d6c5017af..2c802a44c4 100644 --- a/app/src/main/res/values/strings_untranslated.xml +++ b/app/src/main/res/values/strings_untranslated.xml @@ -265,7 +265,7 @@ You will be able to set an access code to protect your wallets. Access code can be restored with one of backup cards. - Your Tangem Wallet card is configured and ready for use. + Your wallet card is configured and ready for use. You have created 1 backup card, and now this card are ready for use. Primary Card I understand diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 09cdff0b35..dad17e5962 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -70,6 +70,20 @@ 2dp + + + + + + + +

+ SaltPay Oly Card Terms of Service +

+


+

We are delighted + that you (“you”, + “your”, or the “Cardholder”) have chosen to use the SaltPay Oly Card (the “Card”). + The terms + and conditions set out here (“Terms”) govern your use of your Card as operated by + SaltPay.

+

+ When you use the + Card, you also agree to + the SaltPay + General Terms + which are incorporated + into these Terms by + reference, including any amendments made to those from time to time. If you do not + understand any provisions of + these Terms, please contact us before using the Card. For information about how we treat + your personal data, + please see our Privacy + Policy.

+


+
    +
  1. + Definitions

    +

    + Affiliate: means any entity controlling, controlled by or under common control with that party, where “control” means the ownership of more than 50% of (i) the voting securities or (ii) an interest in the assets, profits, or earnings of an entity. +

    +

    + Blockchain Asset: means a digital data stored in and protected by the blockchain network, including but not limited to ownership right and value of cryptocurrency, tokenized assets, non-fungible asset. +

    +

    + Cardholder: a person who holds a SaltPay Oly Card. +

    +

    Private + Key: a secret cryptographic key which provides full control over a Blockchain Asset. +

    +

    + Public + Key: means a cryptographic key, which provides access to information about a Blockchain Asset, including but not limited to Blockchain Address. +

    +

    + SaltPay: Salt Pay IIB hf. +

    +

    SaltPay + Oly Card / Card: physical card which stores Private Key and Public Key.

    +

    + Services: enabling the use of the SaltPay Oly Card at physical point of sale terminals that are enabled for the acceptance of Visa Debit cards. +

    +

    + Tangem: means Tangem AG, a company incorporated in Switzerland with company number 1315048, whose address is at Baarerstrasse 10, 6300 Zug. +

    +

    + Tangem + Mobile Application: Third party mobile application, providing interoperability between SaltPay Oly Card and blockchain, and working on NFC-capable smartphones and tablets using Google Android and Apple iOS operating systems. +

    +

    + Tangem + Service: means the service provided by Tangem, which provides and administers the Tangem Mobile Application, which enables Cardholders to generate and store Public Keys and Private Keys in a hardware crypto wallet. +

    +

    Utorg + Service: means providing services of exchanging a virtual currency against a fiat currency. +

    +


  2. +
  3. + Important Legal + Stuff

    +

    + We think + it’s important that we highlight and clearly explain how SaltPay safeguards its + interests, while offering + its services to its Cardholders (you!) which includes limitation of liability and + disclaimers. The sections + set out below reflect those safeguards and how they might impact you. It’s therefore + important that you read + them carefully. If you’re unsure about any of them, please get in touch.

    +
      +
    1. + These + Terms of Service (the “Terms”) govern the use of SaltPay Oly Cards to + authorised employees of + SaltPay and its Affiliates.

    2. +
    3. + The Cards may be used for storage of Private Key and Public Key to the Cardholder’s + Blockchain Assets + and authentication of Card Transactions with the purpose of transfer of Blockchain + Assets for goods and + services purchasing through the Visa payments infrastructure.

      +


    4. +
    5. The Cardholder + agrees that these Terms are binding.

    6. +
    7. The + Cardholder shall be + the only person having physical access to the Card.

    8. +
    9. + The Cardholder acknowledges and agrees that SaltPay does not provide backup or + recovery of Private Key + and Public Key stored by the Card. The Cardholder creates the backup of the SaltPay + Card at the point at + which they activate the Card through the Tangem Mobile Application by linking their + Card with Tangem + Wallet.

      +


    10. +
    11. + The conditions of + use of the Tangem Wallet and Mobile Application are defined in the terms of service + for the Tangem + Wallet and Mobile Application, which will also be available upon downloading the + application.

      +


    12. +
    +
  4. +
  5. + SaltPay’s + obligations

    +
      +
    1. + SaltPay agrees to + provide the Cardholder with the Service in accordance with these Terms and within + the agreed scope.

      +
    2. +
    3. + Under the condition + that the Cardholder exercises their obligations set out under Clause 4 of these + Terms, SaltPay shall use + its best endeavours to ensure that the Card will function properly and without + restriction until the + date on which the Card expires.

    4. +
    5. + SaltPay shall ensure + that the Card prevents duplication of the Private Key, and that the Cardholder has + exclusive control + over the Blockchain Asset unless the contrary is imposed by specific blockchain + network rules e.g., two + or more private keys can be used to control the same Blockchain Asset.

      +


    6. +
    7. SaltPay + agrees that it will not keep any records of Cardholder information, save for the + Cardholder’s full name, + including but not limited to the amount of Blockchain Asset stored on the Card, the + Private Key or + personalised history of Card usage.

      +


    8. +
    9. For the + avoidance of doubt, SaltPay does not guarantee that the operation of Card and/or + Tangem Mobile + Application will be secure, accurate, complete, uninterrupted, without error or free + of viruses, worms, + other harmful components or other program limitations. SaltPay may, at its sole + discretion and without + obligation to do so, correct, modify, amend, enhance, improve and make any other + changes to Card.

      +


    10. +
    +
  6. +
  7. The + Cardholder’s + obligations

    +
      +
    1. + By + accepting these Terms, you represent and warrant that (a) you have the authority to + execute and perform + the obligations contained here; (b) you (and your employees, directors, contractors + and agents) will + comply with all law applicable to your business and the use of the Card; and (c) you + will not use the + Card, directly or indirectly, for any fraudulent or illegal undertaking.

    2. +
    3. + Upon receiving the Card, the Cardholder, if they choose to use the Tangem Service, + should download the + Tangem Mobile Application in order to determine the amount of Blockchain Asset + stored on the Card.

      +


    4. +
    5. + When the Cardholder + pays for goods or services using their SaltPay Oly Card through contactless + confirmation using NFC, they + confirm that there is a sufficient balance in the Tangem Wallet and thereby agree + that amount is + deducted from the account.

    6. +
    7. + The Cardholder shall at all times keep the Card and the means of access (backup card + and pin codes) to + the Card separate from each other.

    8. +
    9. + The Cardholder shall at all times be aware of where the Card is and regularly ensure + that it is still in + their possession. The Cardholder shall avoid even temporary possession of the Card + by any other

      +

      + person. If the Card is lost, stolen or destroyed, control over the corresponding + Blockchain Asset + may be permanently lost.

    10. +
    11. + The Cardholder shall treat the Card with care and protect the Card from mechanical + damage, high + temperatures, strong electromagnetic fields, and other harmful factors.

    12. +
    13. + In the event that the + Card is stolen or + lost, and/or if a Cardholder becomes aware of an unauthorised or incorrectly + initiated transaction, + the Cardholder shall contact Tangem as soon as possible by sending an email + to support@tangem.com + or by using the chat function on the Official Mobile Application. +

      +


    14. +
    15. + In the event that the + Cardholder wishes + to deactivate their account, they shall contact Tangem by sending an email + to support@tangem.com + or by using the chat function on the Official Mobile Application. +

      +
    16. +
    17. + The Card can be used only with the official Tangem Mobile Application downloaded + from Google Play and + App Store.

    18. +
    19. + The Tangem Mobile Application shall be the exclusive source of information + concerning the Blockchain + Address of the Blockchain Asset and corresponding Public Key stored on the Card.

      +
    20. +
    21. + The Cardholder shall only use Near-Field Devices (“NFC Devices”) that are + capable of running the + Tangem Mobile Application.

    22. +
    23. + The Card shall be used only for physically tapping and holding near the Cardholder’s + NFC Device when the + Tangem Mobile Application requests it. For the avoidance of doubt, the Card cannot + be used to pay using + any method which involves gateways.

      +


    24. +
    +
  8. +
  9. The + Cardholder’s liabilities

    +
      +
    1. + The Cardholder is liable for all liabilities arising from the use and misuse of the + Card. In any case, + the Cardholder is liable for all transactions authorised using a means of + access.

    2. +
    3. + Any loss or damage resulting from the forwarding of the Card and/or means of access + shall be borne by + the Cardholder.

    4. +
    5. + Loss or damage incurred by the Cardholder in connection with the possession or use + of the Card shall be + borne solely by the Cardholder. SaltPay assumes no liability if the Card cannot be + used due to a + technical defect or because it has been cancelled or blocked.

      +


    6. +
    7. + Cardholder is only + permitted to use the Products for his personal, non-commercial use. Cardholder is + not permitted to + resell the Card.

      +


    8. +
    +
  10. +
  11. + Limitation of + liability

    +
      +
    1. + The Card is provided as-is, and except as expressly stated in these Terms, SaltPay + provides no express + or implied warranties or conditions, and SaltPay disclaims and excludes any implied + terms, + representations, warranties, and conditions with respect to the Card, including + warranties of + merchantability, fitness for a particular purpose, title, satisfactory quality and + non-infringement, as + well as any other implied warranties, such as warranties regarding data loss, + availability, accuracy, + functionality and lack of viruses. These disclaimers will apply except to the extent + applicable law does + not permit them. Any warranties, guarantees, or conditions that cannot be disclaimed + as a matter of law, + but which may be limited in duration, last for one year from the date on which you + receive the Card.

      +
    2. +
    3. + SaltPay shall not be liable and does not warrant or make any representations + regarding the services + provided by third parties in relation to the Tangem Service, including but not + limited to the Tangem + Mobile Application and the Utorg Service. The relationship between the Cardholder + and any third party in + relation to the Tangem Service shall be governed by separate agreements provided + below.

    4. +
    5. + In + no event shall SaltPay and/or any of its Affiliates be liable for any damages + whatsoever, including + direct, indirect, extraordinary, incidental or consequential damages of any kind + resulting from or + arising out of the use of Card and/or the Tangem Mobile Application or inability to + use Card and/or the + Tangem Mobile Application, failure of Card and/or the Tangem Mobile Application to + perform as + represented or expected, loss of goodwill or profits.

    6. +
    7. + SaltPay shall not be held liable for any failure to be able to use the Card and/or + the Tangem Mobile + Application for any reason whatsoever, nor will SaltPay be held liable for the loss + of the Blockchain + Asset resulting from a malfunction or inoperability of the blockchain network + hosting Blockchain Asset, + as well as the inaccessibility of its public servers and services.

    8. +
    9. + SaltPay shall not be held liable for the loss of profits, income, value or any + indirect, extraordinary, + consequential, exemplary or punitive damages.

    10. +
    11. + SaltPay shall not be + held liable for loss or breakdown of the Card and/or the Tangem Mobile + Application.

    12. +
    13. + SaltPay shall not be held liable for any loss of Blockchain Asset in the event of + loss or total + breakdown of the Card and/or the Tangem Mobile Application.

    14. +
    15. + The Cardholder hereby acknowledges and agrees that these limitations of liability + are agreed allocations + of risk constituting in part the consideration for using the Card and/or the Tangem + Mobile Application + and such limitations will apply notwithstanding the failure of essential purpose of + any limited remedy, + and even if SaltPay and/or any SaltPay Affiliates have been advised of the + possibility of such + liabilities and/or damages.

      +


    16. +
    +
  12. +
  13. Term + and + Termination

    +
      +
    1. + These Terms become effective upon the date (i) you accept these Terms online (or in + another manner + expressly approved by us) or (ii) you first access or use Tangem and shall terminate + on the date on + which the Card expires.

      +


    2. +
    3. + We may terminate + our arrangement with you under these Terms for any reason or no reason, at any time, + by giving 2 months’ + prior notice to this effect. We may also suspend your access to Tangem if you: (i) + have breached these + Terms or any other agreement you have with SaltPay, including SaltPay’s policies or + instructions; or + (ii) provided any false, incomplete, inaccurate, or misleading information or + otherwise engaged in + fraudulent or illegal conduct c) have misused the Service.

      +


    4. +
    5. + Where your + arrangement with us under these Terms terminates for any reason, you will, where + applicable, remain + liable for any fees, charges and other payment obligations you owe us.

      +


    6. +
    +
  14. +
  15. + General

    +
      +
    1. + Except as expressly provided herein, these Terms are a complete statement of the + agreement between you + and us regarding your use of Tangem. In the event of a conflict between these Terms + and the SaltPay + General Terms or any other SaltPay agreement or policy, these Terms shall + prevail.

      +


    2. +
    3. + These Terms do not + limit any rights that SaltPay may have under trade secret, copyright, patent, or + other laws. No waiver + of any term of these Terms shall be deemed a further or continuing waiver of such + term or any other + term.

    4. +
    5. + In + the event any court shall declare any section or sections of this Agreement invalid + or void, such + declaration shall not invalidate the entire Agreement and all other paragraphs of + the Agreement shall + remain in full force and effect.

    6. +
    7. + For + the avoidance of doubt, + provisions around general terms not covered in these Terms of Service, including + but not limited to + restrictions and unauthorised or illegal use, intellectual property, data, + taxes, indemnification, + warranties, severability, force majeure, and disputes, shall be governed by + the SaltPay General + Terms.

    8. +
    +
  16. +
+

TANGEM + WALLET AND TANGEM MOBILE APPLICATION

+

Terms of Service

+


+

PLEASE READ + THESE TERMS OF SERVICE + CAREFULLY. BY CLICKING TO ACCEPT, OR BY ACCESSING OR USING OUR SERVICES, YOU AGREE THAT YOU HAVE + READ, UNDERSTOOD, + AND ACCEPT ALL OF THE TERMS AND CONDITIONS CONTAINED HEREIN. BY PURCHASE OF THE SALTPAY OLY CARD + WITH THE TANGEM + WALLET OR BY USING THE SALTPAY OLY CARD OR BY USING TANGEM WALLET OR BY USING TANGEM MOBILE + APPLICATION, YOU + DEMONSTRATE YOUR AGREEMENT TO THESE TERMS AND CONDITIONS CONTAINED HEREIN.

+


+
    +
  1. + DEFINITIONS

    +


    +


    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + “Cardholder

    + means a person who owns Tangem Wallet and SaltPay Oly Card.

    + “Blockchain Asset

    + means a digital data stored in and protected by the blockchain network, + including but not limited to + ownership right and value of cryptocurrency, tokenized assets, non-fungible + asset.

    + “Blockchain Address

    + means a unique identifier that serves as a virtual location of the Blockchain + Asset in the + blockchain.

    + “Card Transaction

    + means transfer of Blockchain Asset from the Blockchain Address associated with + the Public Key stored + on the SaltPay Oly Card for goods and services purchased through traditional + payments rail.

    + “Official Mobile Application

    + means an application developed and distributed by Tangem, providing + interoperability between SaltPay + Oly Card or Tangem Wallet and blockchain, and working on NFC-capable smartphones + and tablets using + Google Android and Apple iOS operation systems.

    + “Private Key

    + a secret cryptographic key which provides full control over a Blockchain + Asset.

    + “Tangem

    + means Tangem AG, Baarerstrasse 10, 6300 Zug.

    + “Public Key

    + means a cryptographic key, which provides access to information about a + Blockchain Asset, including + but not limited to Blockchain Address

    + “Services

    + means the purchase and/or use of the Tangem Wallet and the services or any other + features, + technologies or functionalities linked to the Card provided or operated by + Tangem AG via the website + or Official Mobile Applications.

    + “Tangem Wallet/Tangem Card / Card

    + means physical card which stores Private Key and Public Key and is used as a + backup card for SaltPay + Oly Card.

    +


  2. +
  3. GENERAL + PROVISIONS

    +


    +
      +
    1. + These Terms of Service (the “Terms”) govern the use of Tangem Wallet and/or + Official Mobile + Application provided by Tangem AG (referred to as "Tangem", + "we" or + "us" in this document) and the related services or any other + features, technologies or + functionalities linked to the Tangem Wallet. Tangem is a company

      +

      + incorporated under the laws of Switzerland, with a registered address at + Baarerstrasse 10, 6300 Zug, + Switzerland.

      +


    2. +
    3. + Tangem Wallet + represents a backup to the SaltPay Oly Card, which may be used only for storage of + Private Key and + Public Key to Cardholder’s Blockchain Assets. Tangem Wallet, unlike SaltPay Oly + Card, can’t be used for + goods and services purchasing through traditional payments rail. The use of SaltPay + Oly Card is governed + by a separate Terms of Service, provided above.

      +


    4. +
    5. + Official Mobile + Application is intended for usage only with SaltPay Oly and Tangem Wallet, providing + interoperability + between the cards and blockchain via NFC interface. Official Mobile Application DOES + NOT:

      +
        +
      1. + Generate, store, transmit, or have access to private (secret) cryptographic + keys to blockchain + wallets holding Blockchain assets.

      2. +
      3. + Generate, + store, transmit, or have access to secret keys, passwords, passphrases, + recovery phrases that + can be used to restore or to copy private (secret) keys to blockchain + wallets holding Blockchain + assets.

      4. +
      5. Provide + exchange, trading, investment services on behalf of Tangem.

        +


      6. +
      +
    6. +
    +
  4. +
  5. + RIGHTS AND + OBLIGATIONS

    +


    +
      +
    1. + Cardholder agrees that + these Terms are binding.

      +


    2. +
    3. + Cardholder shall be the + only person having physical access to the Tangem Wallet.

      +


    4. +
    5. + Cardholder acknowledges and agrees that Tangem does not provide backup or recovery + of Private Key and + Public Key stored by the Tangem Wallet.

      +


    6. +
    7. + Tangem does not + keep records of Cardholder’s personal data, the amount of Blockchain Asset stored on + the Card, the + Private Key, or personalized history of Card usage.

      +


    8. +
    +
  6. +
  7. + COSTS

    +


    +
      +
    1. + Costs, fees and commission (the “Costs”) may be charged in connection with the use + of SaltPay Oly Card. + These Costs are disclosed in the Official Mobile Application to the Cardholder.

      +


    2. +
    3. + Amendments to Costs + due to changing expenses or market conditions may be made at any time via + adjustments to the fee + schedules. Such amendments shall be communicated to the Cardholder in an appropriate + manner. Upon + notification and in the event of the objection, the Cardholder may cancel the + SaltPay Oly Card with + immediate effect.

    4. +
    +
  8. +
  9. + CARDHOLDER’S DUTIES OF CARE

    +


    +

    In particular, the + Cardholder shall exercise the + following duties of care:

    +


    +
      +
    1. + Upon receiving the SaltPay Oly Card and the Tangem Wallet, the Cardholder should + download the Official + Mobile Application from Google Play or Apple app store and create the backup of the + SaltPay Oly Card by + linking SaltPay Oly card with Tangem backup wallet following the instructions in the + Official Mobile + Application.

      +


    2. +
    3. Cardholder + shall keep the SaltPay Oly Card and Tangem Wallet with care and separate from each + other.

      +


    4. +
    5. + Cardholder must always know where the Tangem Wallet is and regularly ensure that it + is still in his/her + possession. He/she shall avoid even temporary possession of the Tangem Wallet by any + other person.

      +


    6. +
    7. + Cardholder shall + treat the Tangem Wallet in the same manner as physical money (cash) and keep it + safe. If the SaltPay Oly + Card and Tangem Wallet are lost, stolen or destroyed at the same time, control over + the corresponding + Blockchain Asset may be permanently lost.

      +


    8. +
    9. + Official Mobile + Application shall be the only source of information about the Blockchain Address of + the Blockchain Asset + and corresponding Public Key stored on the SaltPay Oly Card/Tangem Wallet.

      +


    10. +
    11. + Cardholder shall + only use Near-Field Devices (the “NFC”) devices that are capable of running Official + Mobile + Applications. He/she shall avoid leaving the Tangem Wallet in the proximity of the + NFC devices of other + persons.

      +


    12. +
    13. + Tangem Wallet shall + be used only for physically tapping and holding near Cardholder’s NFC device when + Official Mobile + Application requests it.

      +


    14. +
    15. + Cardholder shall + keep the Tangem Wallet with care and protect the Tangem Wallet from mechanical + damage, high + temperatures, strong electromagnetic fields, and other harmful factors.

      +


    16. +
    +
  10. +
  11. + RIGHTS AND + RESPONSIBILITIES OF CARDHOLDER

    +


    +
      +
    1. + The Cardholder is liable for all liabilities arising from the use of the Tangem + Wallet and/or Tangem + Official Mobile Application. As a matter of principle, the Cardholder is liable for + any risks resulting + from the misuse of the Tangem Wallet and/or Official Mobile Application. In any + case, the Cardholder is + liable for all transactions authorized using a means of access.

      +


    2. +
    3. + Any loss or damage + resulting from the forwarding of the Tangem Wallet and/or means of access shall be + borne by the + Cardholder.

      +


    4. +
    5. + Loss or damage + incurred by the Cardholder in connection with the possession or use of the Tangem + Wallet and/or Official + Mobile Application shall be borne solely by the Cardholder. Tangem assumes no + liability if the Tangem + Wallet and/or Official Mobile Application cannot be used due to a technical defect + or because it has + been canceled, blocked or the spending limit has been adjusted.

      +


    6. +
    7. + Cardholder is only + permitted to use the Tangem Wallet and Official Mobile Application for his personal, + non-commercial use. + Cardholder is not allowed to resell the Tangem Wallet.

    8. +
    9. + Cardholder is solely responsible to determinate what, if any, taxes apply to Card + Transactions. Tangem + or contributors to the Official Mobile Application are NOT responsible for + determining the taxes that + apply to Card Transactions.

      +


    10. +
    11. + Before Cardholder + engages in transactions + using an electronic system, Cardholder should carefully review the rules and + regulations of the + third-party provider Utorg OÜ (https://utorg.pro/terms/), + who provides exchange services for SaltPay Oly Card. Online trading has inherent + risk due to system + response and access times that may vary due to market conditions, system + performance, and other factors. + Cardholder should understand, fully accept and take on these and additional risks + before executing any + Card Transactions.

      +


    12. +
    13. + There is + considerable exposure to risk in the Blockchain Asset exchange transaction. Any + transaction involving + the Blockchain Asset involves risks including, but not limited to, the potential for + changing economic + conditions that may substantially affect the price or liquidity of the Blockchain + Asset. Investments in + the Blockchain Asset exchange speculation may also be susceptible to sharp rises and + falls as the + relevant market values fluctuate. It is for this reason that when speculating in + such markets it is + advisable to use only risk capital.

      +


    14. +
    +
  12. +
  13. + RESPONSIBILITIES AND + LIABILITIES OF TANGEM

    +


    +
      +
    1. + Tangem does not warrant or make any representations regarding the use, the inability + to use or operate, + or the results of the use or operation of the Tangem Wallet and/or Tangem Official + Mobile + Application.

      +


    2. +
    3. Tangem does not + provide any backup or recovery of Private Key and Public Key stored on the Tangem + Wallet.

      +


    4. +
    5. + Tangem does not keep any records of Cardholder information, the amount of Blockchain + Asset stored on the + Tangem Wallet or SaltPay Oly Card, the Private Key, or personalized history of cards + usage.

      +


    6. +
    7. + Tangem shall not be + held liable for any failure to be able to use the Tangem Wallet and/or Official + Mobile Application, for + any reason whatsoever, nor will Tangem be held liable for the loss of the Blockchain + Asset resulting + from a malfunction or inoperability of the blockchain network hosting Blockchain + Asset, as well as the + inaccessibility of its public servers and services.

      +


    8. +
    9. + The Tangem does not + guarantee that the operation of Tangem Wallet and/or Official Mobile Application + will be secure, + accurate, complete, uninterrupted, without error or free of viruses, worms, other + harmful components or + other program limitations. Tangem may, at its sole discretion and without obligation + to do so, correct, + modify, amend, enhance, improve and make any other changes to Tangem Wallet and/or + Official Mobile + Application.

      +


    10. +
    11. + Tangem shall not be + held liable for the loss of profits, income, value or any indirect, extraordinary, + consequential, + exemplary or punitive damages.

      +


    12. +
    13. Tangem shall + not be held liable for loss or breakdown of the Tangem Wallet.

      +


    14. +
    15. + Tangem shall not be held liable for any loss of Blockchain Asset in the event of + loss or total breakdown + of the Tangem Wallet or SaltPay Oly Card.

    16. +
    +
  14. +
  15. + GUARANTEES

    +


    +
      +
    1. + Under the condition that the Cardholder exercises the duties of care as stated in + Clause 5, Tangem + guarantees that the Tangem Wallet will function properly and without restriction for + a period of 2 (two) + years.

      +


    2. +
    3. + Tangem guarantees + that the Tangem Wallet prevents duplication of the Private Key and that the + Cardholder has exclusive + control over the Blockchain Asset unless the contrary is imposed by specific + blockchain network + rules,

      +

      + e.g. two or more + private keys can be used to control the same Blockchain Asset.

      +


    4. +
    +
  16. +
  17. + LIMITATION OF LIABILITY

    +


    +
      +
    1. + The Tangem Wallet, including without limitation any content, data and information + related thereto, is + provided on an “as is” basis and “as available” basis, without any warranties of any + kind, express or + implied warranties of use, merchantability or suitability for a certain purpose or + use, including + without limitation, the quality of products and services provided by users, + third-party services, and/or + exchanges (except for the guarantees set forth in Clause 8).

      +


      +

      + Official Mobile + Application is provided on an “as is” basis and “as available” basis without any + warranties of any + kind regarding Official Mobile Application and/or any content, data, materials + and/or services + provided on Official Mobile Application.

      +


    2. +
    3. + Tangem and its + affiliates, including any of their officers, directors, shareholders, employees, + sub-contractors, + agents, parent companies, subsidiaries and other affiliates (collectively, the + “Tangem Affiliates”), + jointly and severally, disclaim and make no representations or warranties as to the + usability, accuracy, + quality, availability, reliability, suitability, completeness, truthfulness, + usefulness or effectiveness + of any content, data, results or other information obtained or generated by Tangem + and/or any user + related to you or any other user of the Tangem Wallet, and Official Mobile + Applications.

      +


    4. +
    5. + In no event shall + Tangem and/or any of the Tangem Affiliates be liable for any damages whatsoever, + including direct, + indirect, extraordinary, incidental or consequential damages of any kind, but not + limited to, resulting + from or arising out of the use of Tangem Wallet and/or Official Mobile Applications + or inability to use + Tangem Wallet and/or Official Mobile Applications, failure of Tangem Wallet and/or + Official Mobile + Applications to perform as represented or expected, loss of goodwill or profits, or + loss of data arising + out of or in any way connected with the use of Tangem Wallet and/or Official Mobile + Applications. In no + event shall Tangem and/or any of the Tangem Affiliates be liable for the performance + or failure of the + Tangem Wallet and/ or Official Mobile Applications to perform under these Terms of + Use and any other act + or omission by Tangem by any cause whatsoever including without limitation damages + arising from the + conduct of any users, third party services and/or exchanges. In no way Tangem or + contributors to + Official Mobile Application are responsible for the actions, decisions, or other + behavior taken or not + taken by Cardholder in reliance upon Tangem Official Mobile Application.

      +


    6. +
    7. + You hereby + acknowledge and agree that these limitations of liability are agreed allocations of + risk constituting in + part the consideration for using the Tangem Wallet and Official Mobile Applications + and such limitations + will apply notwithstanding the failure of essential purpose of any limited remedy, + and even if Tangem + and/or any Tangem Affiliates has been advised of the possibility of such liabilities + and/or damages.

      +


    8. +
    9. + Tangem will not be + responsible for any losses, damages or claims arising from events falling within the + scope of the + following five categories:

      +
        +
      1. + Mistakes made by Cardholder, e.g., forgotten passwords, payments sent to + wrong addresses, and + accidental deletion of blockchain wallets on Tangem Wallet or SaltPay Oly + cards.

      2. +
      3. + Problems of + Official Mobile Application and/or any blockchain- or cryptocurrency- + related software or + service, e.g., corrupted files, incorrectly constructed transactions, unsafe + cryptographic + libraries, malware.

      4. +
      5. + Technical + failures in the hardware of Cardholder, including cards, of any blockchain- + or + cryptocurrency-related software or service, e.g., data loss due to a faulty + or damaged storage + device.

      6. +
      7. + Security + problems experienced by Cardholder, + e.g., unauthorized + access to Cardholders' wallets and/or accounts.

      8. +
      9. + Actions or + inactions of third parties and/or events experienced by third parties, e.g., + bankruptcy of + service providers, information security attacks on service providers, and + fraud conducted by + third parties.

        +


      10. +
      +
    10. +
    +
  18. +
  19. + SEVERABILITY

    +


    +
      +
    1. + In + the event any court shall declare any section or sections of this Agreement invalid + or void, such + declaration shall not invalidate the entire Agreement and all other paragraphs of + the Agreement shall + remain in full force and effect.

      +


    2. +
    +
  20. +
  21. + ARBITRATION AND + GOVERNING LAW

    +


    +
      +
    1. + These Terms of Service are governed exclusively by the laws of Switzerland, without + regard to its + conflict of law rules. You consent to the exclusive jurisdiction of the court of + Zug, Switzerland for + any dispute arising under this Agreement.

    2. +
    +
  22. +
+

+ Utorg OÜ Terms of Use

+


+

These Terms of + Use constitute an + electronic agreement between you (hereinafter the "User") and Utorg OÜ (hereinafter + the “Utorg.pro”, + “we”, “us”, “our”), a company incorporated in Estonia with Company No. + 14786273, located at + Roosikrantsi tn 2-1068, Kesklinna linnaosa,Tallinn, Harju maakond, 10119, that applies to the + User's use of this + website, any and all services, products and content provided by Utorg.pro.

+


+

As used herein, + "Utorg.pro" refers to the company Utorg OÜ, including but not limited to, its + owners, directors, + investors, officers, employees, agents or other related parties, unless otherwise provided + herein.

+


+

These Terms of + Use contain + important provisions, which the User must consider carefully when choosing whether to use the + services, products and + content of Utorg.pro. Please read these Terms of Use carefully before agreeing to them.

+


+

The User is + solely responsible for + understanding and complying with any and all laws, rules and regulations of his/her specific + jurisdiction that may + be applicable to the User in connection with the use of any and all services, products and + content of Utorg.pro.

+


+

These Terms of Use + incorporate our Privacy Policy + as well as any other policies published on the Site by reference, so by accepting these Terms of Use, the User agrees with and accepts all the policies published on the Site. +

+


+

IF THE USER + DOES NOT ACCEPT THESE + TERMS OF USE, THE USER SHALL NOT USE ANY OF UTORG.PRO’S SERVICES, PRODUCTS AND CONTENT.

+


+
    +
  1. + Terms and + Definitions

    +


    +

    + “Account” + shall mean a record created and maintained by the Software that accumulates and stores + all information about + the Cardholder, including without limitation Transactional history, Cryptocurrency + balance, and the + Cardholder personal information.

    +

    + “SaltPay + Oly Card” shall mean a plastic card linked to the Account. “Cardholder” shall + mean an individual + or entity holding a SaltPay Oly Card.

    +

    + "Confidential + Information" shall mean any data or information, oral or written, treated as + confidential that + relates to either party’s (or, if either party is bound to protect the confidentiality + of any third party’s + information, such third party’s) past, present, or future research, development or + business activities, + including any unannounced products and services, any information relating to Services, + developments, + relevant documentation (in whatever form or media provided), inventions, processes, + plans, financial + information, end-user data, revenue, transaction volume, forecasts, projections, and the + financial terms of + this Agreement. Notwithstanding the foregoing, Confidential Information shall not be + deemed to include + information if: (i) it was already known to the receiving party prior to the Effective + Date of this + Agreement, as established by documentary evidence; (ii) it is in or has entered the + public domain through no + breach of this Agreement or other wrongful act of the receiving party; (iii) it has been + rightfully received + by the receiving party from a third party and without breach of any obligation of + confidentiality of such + third party to the owner of the Confidential Information; (iv) it has been approved for + release by written + authorization of the owner of the Confidential Information; or, (v) it has been + independently developed by a + party without access to or use of the Confidential Information of the other party.”

    +

    + “Cryptocurrency” + shall mean any medium of exchange using cryptography to secure transactions and to + control the creation of + new units, as bitcoins (http://bitcoin.org), or any other that meet those requirements. +

    +

    + “Force-Majeure + Event” shall mean any act or event beyond a Party’s reasonable control, including + without limitation + non-delivery or defective delivery of third party services necessary to provide the + Services (including but + not limited to those of our partners, vendors and suppliers), strikes, lock-outs or + other industrial action + by third parties, civil commotion, riot, invasion, terrorist attack or threat of + terrorist attack, war + (whether declared or not) or threat or

    +

    + preparation for war, fire, explosion, storm, flood, earthquake, subsidence, epidemic or + other natural + disaster, failure of public or private telecommunications networks, worldwide Web + unavailability or + malfunction, governmental prohibition or other limitation of Cryptocurrencies, or + seizing of infrastructure + and operations of Cryptocurrencies.

    +

    + “Over-the-counter + (OTC) deal” shall mean a direct, off-exchange, Transaction between Utorg and + Cardholder. “Price” + shall mean a "price per coin" for which users are willing to purchase or sell + Cryptocurrency using + the Services. “Relevant Exchange Rate” shall mean the weighted spot price average + at the time of the + transaction.

    +

    Services” + shall mean + providing services of exchanging a virtual currency against a fiat currency. + “Site” means Utorg.pro’s website + at https://Utorg.pro.

    +

    Specified + Bank Account” + means the bank account belonging to Salt Pay IIB hf., the details of which shall be + provided to Utorg.pro. +

    +

    Software” + shall mean a + software owned by Utorg and enabling Transactions’ processing.

    +

    + “Transaction” + shall mean any of the following: (i) a purchase of the Cryptocurrency by the Cardholder; + (ii) a sale of the + Cryptocurrency by the Cardholder; (iii) a transfer of Cryptocurrency to a Cardholder. +

    +


  2. +
  3. + Scope of the + Services

    +


    +
      +
    1. + Utorg undertakes to + provide the Cardholder with Services, including but not limited to OTC deal. For the + avoidance of doubt, + Utorg shall use the Relevant Exchange Rate when executing the OTC deal.

      +


    2. +
    3. + The Services will + be provided in such a manner that Utorg will be acting on its own behalf strictly + under the Cardholder’s + instructions regarding any Transaction as well as other matters which the Cardholder + consider to be + necessary hereunder and are accepted by Utorg.

      +


    4. +
    5. + Utorg will treat + the each individual Cardholder as its sole client to which it owes obligations and + will bear no + responsibility to third parties for whom the Cardholder may be acting as an agent, + intermediary or + fiduciary, whether or not the existence or identity of such person(s) has been + disclosed to, or is known + by Utorg.

      +


    6. +
    7. + Utorg does not + provide banking, or payment Services and does not hold or store the Cardholder’s + fiat or crypto + currencies.

      +


    8. +
    +
  4. +
  5. + Warranties

    +


    +

    The + Cardholder hereby warrants + and represents to Utorg as follows:

    +
      +
    1. + It + represents and warrants that all than all outgoing Transactions, cryptocurrency + and/or fiat currency, + are made only to the Specified Bank Account, and Utorg shall not be liable for the + consequences of any + other incoming Transactions.

      +


    2. +
    3. + It also represents + and warrants than all incoming Transactions, cryptocurrency and/or fiat currency, + are made only from its + own wallet and/or bank account, and Utorg shall not be liable for the consequences + of any other incoming + Transactions.

      +


    4. +
    5. + It shall use the + Services in strict conformity with the Terms of Use and for no other purpose and in + no other manner. All + other warranties and representations regarding the use of the Services set forth + below shall be in + addition to and not in limitation of this general overriding warranty and + representation.

      +


    6. +
    7. + The Cardholder represents + and warrants to accept + and comply with all policies posted on Utorg.pro website: https://utorg.pro, Terms of Use (https://utorg.pro/terms/), Privacy Policy + (https://utorg.pro/privacy-policy), KYC/AML Policy + (https://utorg.pro/kyc-aml-policy). +

    8. +
    +
  6. +
  7. Rights + and Obligations

    +


    +
      +
    1. The Cardholder + has right to:

      +


      +
        +
      1. ask + Utorg for any type of assistance and support;

        +


      2. +
      3. + request a confirmation letter stating all information on Cardholder’s + Transactions; and

        +


      4. +
      5. + be promptly notified of any relevant changes, including but not limited to Commissions, bank details, cryptocurrency wallets, etc. +

        +


      6. +
      +
    2. +
    3. + Utorg has the right + to stop providing the Services and terminate the Agreement immediately in case of + any breach of the + Agreement or/and the Terms of Use;

      +


    4. +
    5. Utorg + undertakes to provide the Cardholder with full assistant and support regarding the + Service + provision.

      +


    6. +
    +
  8. +
  9. KYC + Verification

    +


    +
      +
    1. + Identification and + verification procedures (also known as “Know Your Customer” or “KYC”) + are required for all + Transactions, which shall be undertaken by Utorg. If the User refuses to provide + required documents and + information under KYC, including additional information that can be requested after + the business + relationships were established, Utorg.pro reserves the right to immediately + terminate the Services + provision to the User.

      +


    2. +
    3. + The User hereby + authorises Utorg.pro to, directly or indirectly (through third parties), make any + inquiries as + considered necessary to check the relevance and accuracy of the information provided + for verification + purposes. Personal Data transferred will be limited to strictly the necessary and + with security measures + in use to protect the data.

      +


    4. +
    +
  10. +
  11. + Regulatory + Compliance

    +


    +
      +
    1. + For the purposes of + anti-money laundering prevention and combatting terrorist activities, Utorg performs + a thorough due + diligence on each of its customers. Cardholder will have to provide all documents + and information + requested by Utorg for KYC purposesin order to be able to use the Services. Utorg + will keep records of + the Cardholder’s information and documents safe and confidential in accordance with + its Privacy Policy + and the applicable legal and regulatory requirements.

      +


    2. +
    3. + Utorg reserves the + right to request any additional information about the Cardholder and/or the + Cardholder’s Transaction, + and the Cardholder agrees to provide such documents and information in due time. + Utorg has a right to + decline to deliver the Services anytime in case the documents or information + provided by the Cardholder + are unsatisfactory or insufficient, or in case such actions are necessary to comply + with the applicable + laws and regulations, as Utorg may decide in its sole discretion.

      +


    4. +
    5. + The Cardholder will + be able to perform Transactions within certain amounts according to the limits + established by Utorg and + the applicable law. Cardholder will be able to provide some additional information + as instructed by + Utorg to increase or eliminate these limits.

      +


    6. +
    +
  12. +
  13. + Intellectual + Property

    +


    +
      +
    1. + All content at + Utorg's website is the property of Utorg and is protected by copyright, patent, + trademark and any + other applicable laws, unless otherwise specified hereby.

      +


    2. +
    3. + The trademarks, + brands, trade names, service marks and logos of Utorg and others used on the Site + (hereinafter, the + "Trademarks") are the property of Utorg and its respective owners. + The software, + applications, text, images, graphics, data, prices, trades, charts, graphs, video + and audio materials + used on this Site belong to Utorg. The Trademarks and other content on the Platform + and at Utorg's + website should not be copied, reproduced, modified, republished, uploaded, posted, + transmitted, scraped, + collected or distributed in any form or by any means, whether manual or automated. + The use of any + content from the Platform and at Utorg's website on any other site or a + networked computer + environment for any other purpose

      +

      + is + strictly prohibited; any such unauthorized use may violate copyright, patent, + trademark and any + other applicable laws and could result in criminal or civil + penalties/liabilities.

      +


    4. +
    +
  14. +
  15. + Confidentiality

    +


    +
      +
    1. + Any information of + a Party (hereinafter, the “Disclosing Party”) which is not public and which + was obtained by the + other Party (hereinafter, the “Receiving Party”) in the course of performance + of this Agreement, + whether proprietary to such other Party or any third party, whether expressly marked + as confidential or + not and regardless of the form and manner, in which it was obtained, shall be deemed + “Confidential + Information”.

      +


    2. +
    3. With respect to + any and all Confidential Information of the Disclosing Party the Receiving Party + agrees to:

      +


      +
        +
      1. + hold it in + confidence and treat it with the same degree of care and diligence, as it + employs with respect + to its own confidential information, but in no case less than a reasonable + degree of care and + diligence;

        +


      2. +
      3. use + it solely for the purpose of performance of this Agreement;

        +


      4. +
      5. + communicate + it only to the employers and agents of the Receiving Party who have a need + to know such + Confidential Information for the purpose of performance by the Receiving + Party of this Agreement + and who are subject to confidentiality obligations with respect to such + information; and

        +


      6. +
      7. + upon + request of the Disclosing Party or following termination of this Agreement + promptly return to + the Disclosing Party any and all material embodiments of its Confidential + Information and + destroy those material embodiments of Confidential Information return of + which is not + practicable and certify such destruction to the Disclosing Party in + writing.

        +


      8. +
      +
    4. +
    5. + The Parties hereby + agree and acknowledge that restrictions on use of Confidential Information set forth + in Clauses 9.1 and + 9.2 above shall not apply to information, which (subject to the burden of proof + being on the Receiving + Party):

      +


      +
        +
      1. + was known + to the Receiving Party prior to it being obtained from the Disclosing Party + in connection with + this Agreement;

        +


      2. +
      3. + has been + developed or otherwise obtained by the Receiving Party without the use of + the Confidential + Information;

        +


      4. +
      5. has + become public through no fault of the Receiving Party.

        +


      6. +
      +
    6. +
    7. + The Parties hereby + agree that limitations on use and disclosure of Confidential Information as per the + Agreement shall not + apply to any disclosure made in accordance with a valid law, court order, or other + statutory act or + decision of a judicial or governmental authority that has relevant jurisdiction over + the Receiving Party + (the ”Act”), provided that:

      +


      +
        +
      1. The + Receiving Party has provided the Disclosing Party with notice of the Act as + soon as + practicable;

        +


      2. +
      3. + the + Receiving Party has provided all reasonable assistance to the Disclosing + Party (at the + Disclosing Party’s expense) in contesting the Act as the Disclosing Party + had requested;

        +


      4. +
      5. + the + Receiving Party has disclosed only the portion of Confidential Information + which it was obliged + to disclose as per the Act (subject to any alterations due to the Disclosing + Party contesting + the Act).

        +


      6. +
      +
    8. +
    +
  16. +
  17. + Taxation

    +

    + Utorg + makes no representations concerning the tax implications of the Transactions or the + possession or use the + Cryptocurrency. The Cardholder bears the sole responsibility to determine if the + Cryptocurrency or the + potential appreciation or depreciation in the value of the Cryptocurrency over time has + tax implications for + the Cardholder in the

    +

    + Cardholder's + home jurisdiction. By using the Services, and to the extent permitted by law, the + Cardholder agrees not to + hold Utorg liable for any tax liability associated with or arising from the Cardholder's + use of the + Services.

    +


  18. +
  19. + Governing Law

    +

    + This + Agreement shall be governed by the laws of Republic of Estonia. All disputes and + controversies arising out + of or in connection with this Agreement shall be submitted to the relevant Estonian + Court in Tallinn, as the + Court of first instance.

    +


  20. +
  21. + Dispute Resolution

    +


    +
      +
    1. + The Parties + undertake to make every possible effort to resolve disputes that may arise in the + performance of this + Agreement by means of negotiations.

      +


    2. +
    3. + Any dispute, + controversy or claim arising out of or relating to this contract, or the breach + termination or + invalidity thereof, that cannot be solved in the process of negotiations shall be + settled in the + appropriate court according to the Governing Law.

    4. +
    +
  22. +
+
+
+
+
+
+
+ + diff --git a/app/src/main/java/com/tangem/tap/features/disclaimer/ui/DisclaimerFragment.kt b/app/src/main/java/com/tangem/tap/features/disclaimer/ui/DisclaimerFragment.kt index 4538be7224..abbd7bf8de 100644 --- a/app/src/main/java/com/tangem/tap/features/disclaimer/ui/DisclaimerFragment.kt +++ b/app/src/main/java/com/tangem/tap/features/disclaimer/ui/DisclaimerFragment.kt @@ -6,6 +6,7 @@ import androidx.activity.OnBackPressedCallback import androidx.fragment.app.Fragment import androidx.transition.TransitionInflater import by.kirich1409.viewbindingdelegate.viewBinding +import com.tangem.tap.common.extensions.configureSettings import com.tangem.tap.common.extensions.hide import com.tangem.tap.common.redux.navigation.NavigationAction import com.tangem.tap.features.disclaimer.redux.DisclaimerAction @@ -16,17 +17,20 @@ import com.tangem.wallet.databinding.FragmentDisclaimerBinding import org.rekotlin.StoreSubscriber class DisclaimerFragment : Fragment(R.layout.fragment_disclaimer), - StoreSubscriber { + StoreSubscriber { private val binding: FragmentDisclaimerBinding by viewBinding(FragmentDisclaimerBinding::bind) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - activity?.onBackPressedDispatcher?.addCallback(this, object : OnBackPressedCallback(true) { - override fun handleOnBackPressed() { - store.dispatch(NavigationAction.PopBackTo()) - } - }) + activity?.onBackPressedDispatcher?.addCallback( + this, + object : OnBackPressedCallback(true) { + override fun handleOnBackPressed() { + store.dispatch(NavigationAction.PopBackTo()) + } + }, + ) val inflater = TransitionInflater.from(requireContext()) enterTransition = inflater.inflateTransition(android.R.transition.slide_bottom) exitTransition = inflater.inflateTransition(android.R.transition.slide_top) @@ -51,9 +55,15 @@ class DisclaimerFragment : Fragment(R.layout.fragment_disclaimer), binding.toolbar.setNavigationOnClickListener { store.dispatch(NavigationAction.PopBackTo()) } + initAndLoadTOS() setOnClickListeners() } + private fun initAndLoadTOS() { + binding.webView.configureSettings() + binding.webView.loadUrl("file:///android_asset/tos.html") + } + private fun setOnClickListeners() { binding.btnAccept.setOnClickListener { store.dispatch(DisclaimerAction.AcceptDisclaimer) } } diff --git a/app/src/main/res/layout/fragment_disclaimer.xml b/app/src/main/res/layout/fragment_disclaimer.xml index bec0ceace0..556960be96 100644 --- a/app/src/main/res/layout/fragment_disclaimer.xml +++ b/app/src/main/res/layout/fragment_disclaimer.xml @@ -27,30 +27,21 @@ - - - - - + + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + app:layout_constraintStart_toEndOf="@+id/guideline" /> From 6e2e5ba086f4552900f4f0df1bc9c9f7cc4d0690 Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 18 Oct 2022 17:08:52 +0500 Subject: [PATCH 29/30] Updated on 2026-08-14 --- .../wallet/ui/OnboardingWalletFragment.kt | 21 +++++-- .../tap/features/wallet/ui/WalletFragment.kt | 57 ++++++++++++------- 2 files changed, 51 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/ui/OnboardingWalletFragment.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/ui/OnboardingWalletFragment.kt index 5a8376070a..8a444373b5 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/ui/OnboardingWalletFragment.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/ui/OnboardingWalletFragment.kt @@ -1,6 +1,5 @@ package com.tangem.tap.features.onboarding.products.wallet.ui -import android.graphics.BitmapFactory import android.os.Bundle import android.util.TypedValue import android.view.View @@ -15,6 +14,7 @@ import androidx.transition.TransitionInflater import androidx.transition.TransitionManager import by.kirich1409.viewbindingdelegate.viewBinding import coil.load +import coil.size.Scale import com.google.android.material.appbar.MaterialToolbar import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.button.MaterialButton @@ -466,14 +466,25 @@ class OnboardingWalletFragment : Fragment(R.layout.fragment_onboarding_wallet), } private fun handleCardArtworks(state: OnboardingWalletState) = with(walletFragment.binding) { + //TODO: SaltPay: remove hardCode if (state.onboardingSaltPayState?.saltPayCardArtworkUrl == null) { - // if saltPay url not loaded -> load from resource - val bitmap = BitmapFactory.decodeResource(walletFragment.resources, R.drawable.img_salt_pay_visa) - imvFrontCard.setImageBitmap(bitmap) + imvFrontCard.load(R.drawable.img_salt_pay_visa) { + scale(Scale.FILL) + crossfade(enable = true) + } } else { walletFragment.loadImageIntoImageView(state.onboardingSaltPayState.saltPayCardArtworkUrl, imvFrontCard) } - walletFragment.loadImageIntoImageView(state.cardArtworkUrl, imvFirstBackupCard) + imvFirstBackupCard.load(R.drawable.card_placeholder_wallet) + + // if (state.onboardingSaltPayState?.saltPayCardArtworkUrl == null) { + // //if saltPay url not loaded -> load from resource + // val bitmap = BitmapFactory.decodeResource(walletFragment.resources, R.drawable.img_salt_pay_visa) + // imvFrontCard.setImageBitmap(bitmap) + // } else { + // walletFragment.loadImageIntoImageView(state.onboardingSaltPayState.saltPayCardArtworkUrl, imvFrontCard) + // } + // walletFragment.loadImageIntoImageView(state.cardArtworkUrl, imvFirstBackupCard) //TODO: at now we can hide the image only by changing alpha channel to 0, because // the OnboardingWalletFragment and WalletCardsWidget manipulate it visibility through changing diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletFragment.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletFragment.kt index b7748269e4..1f7d881721 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletFragment.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletFragment.kt @@ -26,7 +26,6 @@ import com.tangem.tap.domain.statePrinter.printScanResponseState import com.tangem.tap.domain.statePrinter.printWalletState import com.tangem.tap.domain.termsOfUse.CardTou import com.tangem.tap.features.details.redux.DetailsAction -import com.tangem.tap.features.wallet.redux.Artwork import com.tangem.tap.features.wallet.redux.ErrorType import com.tangem.tap.features.wallet.redux.ProgressState import com.tangem.tap.features.wallet.redux.WalletAction @@ -53,11 +52,14 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), StoreSubscriber { store.dispatch(GlobalAction.UpdateFeedbackInfo(store.state.walletState.walletManagers)) store.state.globalState.scanResponse?.let { scanNoteResponse -> - store.dispatch(DetailsAction.PrepareScreen( - scanNoteResponse, - store.state.walletState.walletManagers.map { it.wallet }, - CardTou(), - )) + store.dispatch( + DetailsAction.PrepareScreen( + scanNoteResponse, + store.state.walletState.walletManagers.map { it.wallet }, + CardTou(), + ), + ) store.dispatch(NavigationAction.NavigateTo(AppScreen.Details)) true } @@ -207,5 +221,4 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), StoreSubscriber Date: Tue, 18 Oct 2022 17:46:53 +0500 Subject: [PATCH 30/30] Updated on 2026-08-14 --- .../products/wallet/saltPay/SaltPayRegistrationManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/SaltPayRegistrationManager.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/SaltPayRegistrationManager.kt index b7d5364a16..db09316125 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/SaltPayRegistrationManager.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/SaltPayRegistrationManager.kt @@ -30,7 +30,7 @@ class SaltPayRegistrationManager( ) { val kycUrlProvider = KYCUrlProvider(walletPublicKey, kycProvider) - private val approvalValue: BigDecimal = BigDecimal.ONE + private val approvalValue: BigDecimal = BigDecimal.valueOf(Math.pow(2.toDouble(), 255.toDouble())) private val spendLimitValue: BigDecimal = BigDecimal("100") fun transactionIsSent(): Boolean {