From ff9a81e8597eff6e1181120afa18e27a7122899e Mon Sep 17 00:00:00 2001 From: Tangem Date: Sun, 16 Apr 2023 22:51:51 +0400 Subject: [PATCH 01/68] Updated on 2026-08-14 --- .../com/tangem/tap/domain/TangemSdkManager.kt | 9 +++++ .../features/details/redux/DetailsAction.kt | 9 +++++ .../details/redux/DetailsMiddleware.kt | 26 +++++++++++++ .../features/details/redux/DetailsReducer.kt | 38 +++++++++++++++++++ .../features/details/redux/DetailsState.kt | 10 +++++ .../java/com/tangem/domain/common/CardDTO.kt | 13 +++++++ .../tangem/domain/common/CardTypesResolver.kt | 1 + .../domain/common/TangemCardTypesResolver.kt | 1 + 8 files changed, 107 insertions(+) diff --git a/app/src/main/java/com/tangem/tap/domain/TangemSdkManager.kt b/app/src/main/java/com/tangem/tap/domain/TangemSdkManager.kt index c9d4a5e39c..3dcacf1eef 100644 --- a/app/src/main/java/com/tangem/tap/domain/TangemSdkManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/TangemSdkManager.kt @@ -31,6 +31,7 @@ import com.tangem.operations.derivation.DeriveMultipleWalletPublicKeysTask import com.tangem.operations.pins.CheckUserCodesCommand import com.tangem.operations.pins.CheckUserCodesResponse import com.tangem.operations.pins.SetUserCodeCommand +import com.tangem.operations.usersetttings.SetUserCodeRecoveryAllowedTask import com.tangem.tap.common.analytics.events.Basic import com.tangem.tap.domain.tasks.CreateWalletAndRescanTask import com.tangem.tap.domain.tasks.product.CreateProductWalletTask @@ -173,6 +174,14 @@ class TangemSdkManager(private val tangemSdk: TangemSdk, private val context: Co ) } + suspend fun setAccessCodeRecoveryEnabled(cardId: String?, enabled: Boolean): CompletionResult { + return runTaskAsyncReturnOnMain( + SetUserCodeRecoveryAllowedTask(enabled), + cardId, + initialMessage = Message(context.getString(R.string.initial_message_tap_header)), + ) + } + suspend fun scanCard( cardId: String? = null, allowRequestAccessCodeFromRepository: Boolean = false, diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt index 6fe638daca..d7bcd69528 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt @@ -29,6 +29,15 @@ sealed class DetailsAction : Action { data class PrepareCardSettingsData(val card: CardDTO, val cardTypesResolver: CardTypesResolver) : DetailsAction() object ResetCardSettingsData : DetailsAction() + sealed class AccessCodeRecovery : DetailsAction() { + object Open : AccessCodeRecovery() + data class SaveChanges(val enabled: Boolean) : AccessCodeRecovery() { + data class Success(val enabled: Boolean) : AccessCodeRecovery() + } + + data class SelectOption(val enabled: Boolean) : AccessCodeRecovery() + } + sealed class ManageSecurity : DetailsAction() { object OpenSecurity : ManageSecurity() data class SelectOption(val option: SecurityOption) : ManageSecurity() diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt index e7eab8cc49..de6be315af 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt @@ -51,6 +51,7 @@ class DetailsMiddleware { private val eraseWalletMiddleware = EraseWalletMiddleware() private val manageSecurityMiddleware = ManageSecurityMiddleware() private val managePrivacyMiddleware = ManagePrivacyMiddleware() + private val accessCodeRecoveryMiddleware = AccessCodeRecoveryMiddleware() val detailsMiddleware: Middleware = { _, stateProvider -> { next -> { action -> @@ -74,6 +75,7 @@ class DetailsMiddleware { store.dispatch(TwinCardsAction.SetMode(CreateTwinWalletMode.RecreateWallet)) store.dispatch(NavigationAction.NavigateTo(AppScreen.OnboardingTwins)) } + is DetailsAction.AccessCodeRecovery -> accessCodeRecoveryMiddleware.handle(state, action) DetailsAction.ScanCard -> { scope.launch { tangemSdkManager.scanProduct( @@ -418,4 +420,28 @@ class DetailsMiddleware { ) } } + + class AccessCodeRecoveryMiddleware { + fun handle(state: DetailsState, action: DetailsAction.AccessCodeRecovery) { + when (action) { + is DetailsAction.AccessCodeRecovery.Open -> { + // store.dispatch(NavigationAction.NavigateTo(AppScreen.AccessCodeRecovery)) Todo: next PR + } + is DetailsAction.AccessCodeRecovery.SaveChanges -> { + scope.launch { + tangemSdkManager + .setAccessCodeRecoveryEnabled(state.cardSettingsState?.card?.cardId, action.enabled) + .doOnSuccess { + store.dispatchOnMain(NavigationAction.PopBackTo()) + store.dispatchOnMain( + DetailsAction.AccessCodeRecovery.SaveChanges.Success(action.enabled), + ) + } + } + } + is DetailsAction.AccessCodeRecovery.SelectOption -> Unit + is DetailsAction.AccessCodeRecovery.SaveChanges.Success -> Unit + } + } + } } \ No newline at end of file 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 380d7be88b..b72be6d5d8 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 @@ -40,6 +40,7 @@ private fun internalReduce(action: Action, state: AppState): DetailsState { } is DetailsAction.ChangeAppCurrency -> detailsState.copy(appCurrency = action.fiatCurrency) + is DetailsAction.AccessCodeRecovery -> handleAccessCodeRecoveryAction(action, detailsState) else -> detailsState } } @@ -68,6 +69,15 @@ private fun handlePrepareCardSettingsScreen( manageSecurityState = prepareSecurityOptions(card, cardTypesResolver), card = card, resetCardAllowed = isResetToFactoryAllowedByCard(card, cardTypesResolver), + accessCodeRecovery = if (cardTypesResolver.isWallet2()) { + val enabled = card.userSettings?.isUserCodeRecoveryAllowed ?: false + AccessCodeRecoveryState( + enabledOnCard = enabled, + enabledSelection = enabled, + ) + } else { + null + }, ) return state.copy(cardSettingsState = cardSettingsState) } @@ -189,6 +199,34 @@ private fun handlePrivacyAction(action: DetailsAction.AppSettings, state: Detail } } +private fun handleAccessCodeRecoveryAction( + action: DetailsAction.AccessCodeRecovery, + state: DetailsState, +): DetailsState { + return when (action) { + DetailsAction.AccessCodeRecovery.Open -> { + val accessCodeRecovery = state.cardSettingsState?.accessCodeRecovery?.copy( + enabledSelection = state.cardSettingsState.accessCodeRecovery.enabledOnCard, + ) + state.copy(cardSettingsState = state.cardSettingsState?.copy(accessCodeRecovery = accessCodeRecovery)) + } + is DetailsAction.AccessCodeRecovery.SaveChanges -> state + is DetailsAction.AccessCodeRecovery.SelectOption -> { + val accessCodeRecovery = state.cardSettingsState?.accessCodeRecovery?.copy( + enabledSelection = action.enabled, + ) + state.copy(cardSettingsState = state.cardSettingsState?.copy(accessCodeRecovery = accessCodeRecovery)) + } + is DetailsAction.AccessCodeRecovery.SaveChanges.Success -> { + val accessCodeRecovery = state.cardSettingsState?.accessCodeRecovery?.copy( + enabledOnCard = action.enabled, + enabledSelection = action.enabled, + ) + state.copy(cardSettingsState = state.cardSettingsState?.copy(accessCodeRecovery = accessCodeRecovery)) + } + } +} + private fun prepareAllowedSecurityOptions( cardTypesResolver: CardTypesResolver, currentSecurityOption: SecurityOption?, diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt index 62179b433d..0fc60cafcc 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt @@ -26,12 +26,22 @@ data class CardInfo( val hasBackup: Boolean, ) +/** + * @property enabledOnCard whether access code recovery is enabled on card + * @property enabledSelection current selected option in app (not saved on card yet) + */ +data class AccessCodeRecoveryState( + val enabledOnCard: Boolean, + val enabledSelection: Boolean, +) + data class CardSettingsState( val cardInfo: CardInfo, val card: CardDTO, val manageSecurityState: ManageSecurityState?, val resetCardAllowed: Boolean, val resetConfirmed: Boolean = false, + val accessCodeRecovery: AccessCodeRecoveryState? = null, ) data class ManageSecurityState( diff --git a/domain/src/main/java/com/tangem/domain/common/CardDTO.kt b/domain/src/main/java/com/tangem/domain/common/CardDTO.kt index ffe33e01e2..38494e9294 100644 --- a/domain/src/main/java/com/tangem/domain/common/CardDTO.kt +++ b/domain/src/main/java/com/tangem/domain/common/CardDTO.kt @@ -23,6 +23,7 @@ data class CardDTO( val manufacturer: Manufacturer, val issuer: Issuer, val settings: Settings, + val userSettings: UserSettings?, val linkedTerminalStatus: LinkedTerminalStatus, val isAccessCodeSet: Boolean, val isPasscodeSet: Boolean?, @@ -39,6 +40,7 @@ data class CardDTO( manufacturer = Manufacturer(card.manufacturer), issuer = Issuer(card.issuer), settings = Settings(card.settings), + userSettings = UserSettings(card.userSettings), linkedTerminalStatus = LinkedTerminalStatus.fromSdkStatus(card.linkedTerminalStatus), isAccessCodeSet = card.isAccessCodeSet, isPasscodeSet = card.isPasscodeSet, @@ -60,6 +62,7 @@ data class CardDTO( if (manufacturer != other.manufacturer) return false if (issuer != other.issuer) return false if (settings != other.settings) return false + if (userSettings != other.userSettings) return false if (linkedTerminalStatus != other.linkedTerminalStatus) return false if (isAccessCodeSet != other.isAccessCodeSet) return false if (isPasscodeSet != other.isPasscodeSet) return false @@ -78,6 +81,7 @@ data class CardDTO( result = 31 * result + manufacturer.hashCode() result = 31 * result + issuer.hashCode() result = 31 * result + settings.hashCode() + result = 31 * result + userSettings.hashCode() result = 31 * result + linkedTerminalStatus.hashCode() result = 31 * result + isAccessCodeSet.hashCode() result = 31 * result + (isPasscodeSet?.hashCode() ?: 0) @@ -114,6 +118,15 @@ data class CardDTO( ) } + @JsonClass(generateAdapter = true) + data class UserSettings( + val isUserCodeRecoveryAllowed: Boolean, + ) { + constructor(userSettings: com.tangem.common.card.UserSettings) : this( + userSettings.isUserCodeRecoveryAllowed, + ) + } + @JsonClass(generateAdapter = true) data class FirmwareVersion( val major: Int, diff --git a/domain/src/main/java/com/tangem/domain/common/CardTypesResolver.kt b/domain/src/main/java/com/tangem/domain/common/CardTypesResolver.kt index a938ae53b0..0d91e233df 100644 --- a/domain/src/main/java/com/tangem/domain/common/CardTypesResolver.kt +++ b/domain/src/main/java/com/tangem/domain/common/CardTypesResolver.kt @@ -6,6 +6,7 @@ import com.tangem.blockchain.common.Token interface CardTypesResolver { fun isTangemNote(): Boolean fun isTangemWallet(): Boolean + fun isWallet2(): Boolean fun isSaltPay(): Boolean fun isSaltPayVisa(): Boolean fun isSaltPayWallet(): Boolean diff --git a/domain/src/main/java/com/tangem/domain/common/TangemCardTypesResolver.kt b/domain/src/main/java/com/tangem/domain/common/TangemCardTypesResolver.kt index 5d9f6fafa7..50850def2c 100644 --- a/domain/src/main/java/com/tangem/domain/common/TangemCardTypesResolver.kt +++ b/domain/src/main/java/com/tangem/domain/common/TangemCardTypesResolver.kt @@ -24,6 +24,7 @@ class TangemCardTypesResolver( card.firmwareVersion >= FirmwareVersion.MultiWalletAvailable && !card.isSaltPay + override fun isWallet2(): Boolean = card.firmwareVersion >= FirmwareVersion.KeysImportAvailable override fun isSaltPay(): Boolean = productType == ProductType.SaltPay override fun isSaltPayVisa(): Boolean = card.isSaltPayVisa override fun isSaltPayWallet(): Boolean = card.isSaltPayWallet From 1d053de91a3ce854305e0ae53144e74ee797b963 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 17 Apr 2023 00:21:38 +0400 Subject: [PATCH 02/68] Updated on 2026-08-14 --- .../tap/common/extensions/Navigation.kt | 2 + .../redux/navigation/NavigationState.kt | 2 +- .../details/redux/DetailsMiddleware.kt | 2 +- .../ui/cardsettings/CardSettingsScreen.kt | 2 + .../cardsettings/CardSettingsScreenState.kt | 12 + .../ui/cardsettings/CardSettingsViewModel.kt | 9 +- .../AccessCodeRecoveryFragment.kt | 67 ++ .../coderecovery/AccessCodeRecoveryScreen.kt | 64 ++ .../AccessCodeRecoveryScreenState.kt | 16 + .../AccessCodeRecoveryViewModel.kt | 30 + .../ui/common/DetailsComposeElements.kt | 65 +- .../ui/securitymode/SecurityModeScreen.kt | 49 +- core/res/src/main/res/values-de/strings.xml | 823 +++++++++--------- core/res/src/main/res/values-fr/strings.xml | 823 +++++++++--------- core/res/src/main/res/values-it/strings.xml | 823 +++++++++--------- core/res/src/main/res/values-ru/strings.xml | 35 + .../src/main/res/values-zh-rTW/strings.xml | 60 +- core/res/src/main/res/values/strings.xml | 35 +- .../com/tangem/core/ui/res/TangemDimens.kt | 1 + 19 files changed, 1659 insertions(+), 1261 deletions(-) create mode 100644 app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryFragment.kt create mode 100644 app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryScreen.kt create mode 100644 app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryScreenState.kt create mode 100644 app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryViewModel.kt diff --git a/app/src/main/java/com/tangem/tap/common/extensions/Navigation.kt b/app/src/main/java/com/tangem/tap/common/extensions/Navigation.kt index 7ad24431c6..42d6017a42 100644 --- a/app/src/main/java/com/tangem/tap/common/extensions/Navigation.kt +++ b/app/src/main/java/com/tangem/tap/common/extensions/Navigation.kt @@ -12,6 +12,7 @@ import com.tangem.tap.common.redux.navigation.FragmentShareTransition import com.tangem.tap.features.addCustomToken.AddCustomTokenFragment import com.tangem.tap.features.details.ui.appsettings.AppSettingsFragment import com.tangem.tap.features.details.ui.cardsettings.CardSettingsFragment +import com.tangem.tap.features.details.ui.cardsettings.coderecovery.AccessCodeRecoveryFragment import com.tangem.tap.features.details.ui.details.DetailsFragment import com.tangem.tap.features.details.ui.resetcard.ResetCardFragment import com.tangem.tap.features.details.ui.securitymode.SecurityModeFragment @@ -109,6 +110,7 @@ private fun fragmentFactory(screen: AppScreen): Fragment { AppScreen.CardSettings -> CardSettingsFragment() AppScreen.AppSettings -> AppSettingsFragment() AppScreen.ResetToFactory -> ResetCardFragment() + AppScreen.AccessCodeRecovery -> AccessCodeRecoveryFragment() AppScreen.Disclaimer -> DisclaimerFragment() AppScreen.AddTokens -> { val featureToggles = store.state.daggerGraphState.get( diff --git a/app/src/main/java/com/tangem/tap/common/redux/navigation/NavigationState.kt b/app/src/main/java/com/tangem/tap/common/redux/navigation/NavigationState.kt index 0b40b7bd8e..861a0a0fb9 100644 --- a/app/src/main/java/com/tangem/tap/common/redux/navigation/NavigationState.kt +++ b/app/src/main/java/com/tangem/tap/common/redux/navigation/NavigationState.kt @@ -18,7 +18,7 @@ enum class AppScreen( OnboardingNote, OnboardingWallet, OnboardingTwins, OnboardingOther, Wallet, WalletDetails, Send, - Details, DetailsSecurity, CardSettings, AppSettings, ResetToFactory, + Details, DetailsSecurity, CardSettings, AppSettings, ResetToFactory, AccessCodeRecovery, AddTokens, AddCustomToken, WalletConnectSessions, QrScan, diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt index de6be315af..fb04d4aa57 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt @@ -425,7 +425,7 @@ class DetailsMiddleware { fun handle(state: DetailsState, action: DetailsAction.AccessCodeRecovery) { when (action) { is DetailsAction.AccessCodeRecovery.Open -> { - // store.dispatch(NavigationAction.NavigateTo(AppScreen.AccessCodeRecovery)) Todo: next PR + store.dispatch(NavigationAction.NavigateTo(AppScreen.AccessCodeRecovery)) } is DetailsAction.AccessCodeRecovery.SaveChanges -> { scope.launch { diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsScreen.kt b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsScreen.kt index be54f4a52f..44b2a45efe 100644 --- a/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsScreen.kt +++ b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsScreen.kt @@ -120,6 +120,7 @@ fun CardSettings(state: CardSettingsScreenState) { is CardInfo.SignedHashes -> 14.dp is CardInfo.SecurityMode -> 16.dp is CardInfo.ChangeAccessCode -> 16.dp + is CardInfo.AccessCodeRecovery -> 16.dp is CardInfo.ResetToFactorySettings -> 28.dp } val paddingTop = when (it) { @@ -128,6 +129,7 @@ fun CardSettings(state: CardSettingsScreenState) { is CardInfo.SignedHashes -> 12.dp is CardInfo.SecurityMode -> 14.dp is CardInfo.ChangeAccessCode -> 16.dp + is CardInfo.AccessCodeRecovery -> 16.dp is CardInfo.ResetToFactorySettings -> 16.dp } Column( diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsScreenState.kt b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsScreenState.kt index 5ae42a55a9..9bb98f9e01 100644 --- a/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsScreenState.kt +++ b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsScreenState.kt @@ -4,6 +4,7 @@ import androidx.annotation.StringRes import androidx.compose.runtime.Composable import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.ui.res.stringResource +import com.tangem.tap.features.details.redux.AccessCodeRecoveryState import com.tangem.tap.features.details.redux.SecurityOption import com.tangem.tap.features.details.ui.securitymode.toTitleRes import com.tangem.tap.features.details.ui.utils.toResetCardDescriptionText @@ -12,6 +13,7 @@ import com.tangem.tap.features.details.redux.CardInfo as ReduxCardInfo data class CardSettingsScreenState( val cardDetails: List? = null, + val accessCodeRecoveryState: AccessCodeRecoveryState? = null, val onScanCardClick: () -> Unit, val onElementClick: (CardInfo) -> Unit, ) @@ -48,6 +50,16 @@ sealed class CardInfo( clickable = true, ) + class AccessCodeRecovery(val enabled: Boolean) : CardInfo( + titleRes = TextReference.Res(R.string.card_settings_access_code_recovery_title), + subtitle = if (enabled) { + TextReference.Res(R.string.common_enabled) + } else { + TextReference.Res(R.string.common_disabled) + }, + clickable = true, + ) + class ResetToFactorySettings(cardInfo: ReduxCardInfo) : CardInfo( titleRes = TextReference.Res(R.string.card_settings_reset_card_to_factory), subtitle = cardInfo.toResetCardDescriptionText(), diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsViewModel.kt b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsViewModel.kt index 16b9836764..805f373605 100644 --- a/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsViewModel.kt +++ b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/CardSettingsViewModel.kt @@ -16,6 +16,7 @@ class CardSettingsViewModel(private val store: Store) { return if (state?.manageSecurityState == null) { CardSettingsScreenState( cardDetails = null, + accessCodeRecoveryState = null, onElementClick = {}, onScanCardClick = { store.dispatch(DetailsAction.ScanCard) @@ -44,12 +45,15 @@ class CardSettingsViewModel(private val store: Store) { if (state.card.backupStatus?.isActive == true && state.card.isAccessCodeSet) { cardDetails.add(CardInfo.ChangeAccessCode) } + if (state.accessCodeRecovery != null) { + cardDetails.add(CardInfo.AccessCodeRecovery(state.accessCodeRecovery.enabledOnCard)) + } if (state.resetCardAllowed) { cardDetails.add(CardInfo.ResetToFactorySettings(state.cardInfo)) } - CardSettingsScreenState( cardDetails = cardDetails, + accessCodeRecoveryState = state.accessCodeRecovery, onScanCardClick = { }, onElementClick = { handleClickingItem(it) @@ -72,6 +76,9 @@ class CardSettingsViewModel(private val store: Store) { Analytics.send(Settings.CardSettings.ButtonChangeSecurityMode()) store.dispatch(DetailsAction.ManageSecurity.OpenSecurity) } + is CardInfo.AccessCodeRecovery -> { + store.dispatch(DetailsAction.AccessCodeRecovery.Open) + } else -> {} } } diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryFragment.kt b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryFragment.kt new file mode 100644 index 0000000000..370d333d31 --- /dev/null +++ b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryFragment.kt @@ -0,0 +1,67 @@ +package com.tangem.tap.features.details.ui.cardsettings.coderecovery + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.mutableStateOf +import androidx.compose.ui.platform.ComposeView +import androidx.fragment.app.Fragment +import androidx.transition.TransitionInflater +import com.tangem.core.ui.res.TangemTheme +import com.tangem.tap.common.redux.navigation.NavigationAction +import com.tangem.tap.features.details.redux.DetailsState +import com.tangem.tap.store +import com.tangem.wallet.R +import org.rekotlin.StoreSubscriber + +class AccessCodeRecoveryFragment : Fragment(), StoreSubscriber { + + private val viewModel = AccessCodeRecoveryViewModel(store) + + private var screenState: MutableState = + mutableStateOf(viewModel.updateState(store.state.detailsState.cardSettingsState?.accessCodeRecovery)) + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val inflater = TransitionInflater.from(requireContext()) + enterTransition = inflater.inflateTransition(R.transition.fade) + exitTransition = inflater.inflateTransition(R.transition.fade) + } + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { + return ComposeView(requireContext()).apply { + setContent { + isTransitionGroup = true + TangemTheme { + AccessCodeRecoveryScreen( + state = screenState.value, + onBackClick = { store.dispatch(NavigationAction.PopBackTo()) }, + ) + } + } + } + } + + override fun onStart() { + super.onStart() + store.subscribe(this) { state -> + state.skipRepeats { oldState, newState -> + oldState.detailsState == newState.detailsState + }.select { it.detailsState } + } + } + + override fun onStop() { + super.onStop() + store.unsubscribe(this) + } + + override fun newState(state: DetailsState) { + if (activity == null || view == null) return + screenState.value = + viewModel.updateState(store.state.detailsState.cardSettingsState?.accessCodeRecovery) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryScreen.kt b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryScreen.kt new file mode 100644 index 0000000000..12edf5a47e --- /dev/null +++ b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryScreen.kt @@ -0,0 +1,64 @@ +package com.tangem.tap.features.details.ui.cardsettings.coderecovery + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import com.tangem.core.ui.res.TangemTheme +import com.tangem.tap.features.details.ui.common.DetailsMainButton +import com.tangem.tap.features.details.ui.common.DetailsRadioButtonElement +import com.tangem.tap.features.details.ui.common.ScreenTitle +import com.tangem.tap.features.details.ui.common.SettingsScreensScaffold +import com.tangem.wallet.R + +@Composable +fun AccessCodeRecoveryScreen(state: AccessCodeRecoveryScreenState, onBackClick: () -> Unit) { + SettingsScreensScaffold( + content = { AccessCodeRecoveryOptions(state = state) }, + onBackClick = onBackClick, + ) +} + +@Composable +fun AccessCodeRecoveryOptions(state: AccessCodeRecoveryScreenState) { + Column( + modifier = Modifier + .fillMaxSize() + .verticalScroll(rememberScrollState()) + .padding(bottom = TangemTheme.dimens.spacing28), + verticalArrangement = Arrangement.SpaceBetween, + ) { + ScreenTitle( + titleRes = R.string.card_settings_access_code_recovery_title, + Modifier.padding(bottom = TangemTheme.dimens.spacing36), + ) + + DetailsRadioButtonElement( + title = stringResource(id = R.string.common_enabled), + subtitle = stringResource(id = R.string.card_settings_access_code_recovery_enabled_description), + selected = state.enabledSelection, + onClick = { state.onOptionClick(true) }, + ) + DetailsRadioButtonElement( + title = stringResource(id = R.string.common_disabled), + subtitle = stringResource(id = R.string.card_settings_access_code_recovery_disabled_description), + selected = !state.enabledSelection, + onClick = { state.onOptionClick(false) }, + ) + + Spacer(modifier = Modifier.weight(1f)) + + DetailsMainButton( + title = stringResource(id = R.string.common_save_changes), + enabled = state.isSaveChangesEnabled, + onClick = { state.onSaveChangesClick(state.enabledSelection) }, + modifier = Modifier.padding(horizontal = TangemTheme.dimens.spacing20), + ) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryScreenState.kt b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryScreenState.kt new file mode 100644 index 0000000000..f1a825067a --- /dev/null +++ b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryScreenState.kt @@ -0,0 +1,16 @@ +package com.tangem.tap.features.details.ui.cardsettings.coderecovery + +/** + * @property enabledOnCard Indicates whether access code recovery is enabled on the card + * @property enabledSelection Represents the currently selected option in the app (not yet saved on the card) + * @property isSaveChangesEnabled Determines if the user is allowed to save their selection to the card + * @property onSaveChangesClick Callback function called when the user wants to apply the selected option + * @property onOptionClick Callback function called when the user selects an option + * */ +data class AccessCodeRecoveryScreenState( + val enabledOnCard: Boolean, + val enabledSelection: Boolean, + val isSaveChangesEnabled: Boolean, + val onSaveChangesClick: (Boolean) -> Unit, + val onOptionClick: (Boolean) -> Unit, +) \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryViewModel.kt b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryViewModel.kt new file mode 100644 index 0000000000..a2948075f8 --- /dev/null +++ b/app/src/main/java/com/tangem/tap/features/details/ui/cardsettings/coderecovery/AccessCodeRecoveryViewModel.kt @@ -0,0 +1,30 @@ +package com.tangem.tap.features.details.ui.cardsettings.coderecovery + +import com.tangem.tap.common.redux.AppState +import com.tangem.tap.features.details.redux.AccessCodeRecoveryState +import com.tangem.tap.features.details.redux.DetailsAction +import org.rekotlin.Store + +class AccessCodeRecoveryViewModel(val store: Store) { + + fun updateState(state: AccessCodeRecoveryState?): AccessCodeRecoveryScreenState { + // We shouldn't get to this screen here when this state is null + return if (state == null) { + AccessCodeRecoveryScreenState( + enabledOnCard = false, + enabledSelection = false, + isSaveChangesEnabled = false, + onSaveChangesClick = {}, + onOptionClick = {}, + ) + } else { + AccessCodeRecoveryScreenState( + enabledOnCard = state.enabledOnCard, + enabledSelection = state.enabledSelection, + isSaveChangesEnabled = state.enabledOnCard != state.enabledSelection, + onSaveChangesClick = { store.dispatch(DetailsAction.AccessCodeRecovery.SaveChanges(it)) }, + onOptionClick = { store.dispatch(DetailsAction.AccessCodeRecovery.SelectOption(it)) }, + ) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/common/DetailsComposeElements.kt b/app/src/main/java/com/tangem/tap/features/details/ui/common/DetailsComposeElements.kt index 616fbaafc9..c65fe7128b 100644 --- a/app/src/main/java/com/tangem/tap/features/details/ui/common/DetailsComposeElements.kt +++ b/app/src/main/java/com/tangem/tap/features/details/ui/common/DetailsComposeElements.kt @@ -3,18 +3,18 @@ package com.tangem.tap.features.details.ui.common import androidx.activity.compose.BackHandler import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.systemBarsPadding -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Button -import androidx.compose.material.ButtonDefaults +import androidx.compose.foundation.selection.selectable import androidx.compose.material.Icon import androidx.compose.material.IconButton +import androidx.compose.material.RadioButton +import androidx.compose.material.RadioButtonDefaults import androidx.compose.material.Scaffold import androidx.compose.material.Text import androidx.compose.material.TopAppBar @@ -25,7 +25,9 @@ import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import com.tangem.core.ui.components.PrimaryButtonIconRight import com.tangem.core.ui.res.TangemTheme +import com.tangem.tap.common.compose.TangemTypography import com.tangem.wallet.R @Composable @@ -109,26 +111,49 @@ fun EmptyTopBarWithNavigation( @Composable fun DetailsMainButton(title: String, onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true) { - Button( + PrimaryButtonIconRight( + text = title, + enabled = enabled, onClick = onClick, modifier = modifier + .fillMaxWidth(), + icon = painterResource(id = R.drawable.ic_tangem_24), + ) +} + +@Composable +fun DetailsRadioButtonElement(title: String, subtitle: String, selected: Boolean, onClick: () -> Unit) { + Row( + modifier = Modifier .fillMaxWidth() - .heightIn(48.dp), - shape = RoundedCornerShape(12.dp), - enabled = enabled, - colors = ButtonDefaults.buttonColors( - backgroundColor = colorResource(R.color.button_primary), - contentColor = colorResource(R.color.text_primary_2), - disabledBackgroundColor = colorResource(R.color.button_disabled), - disabledContentColor = colorResource(R.color.text_disabled), - ), + .selectable( + selected = selected, + onClick = { onClick() }, + ) + .padding(start = 20.dp, end = 20.dp, top = 16.dp, bottom = 16.dp), ) { - Text(text = title) - Spacer( - modifier = Modifier - .padding(start = 20.dp, end = 20.dp) - .size(8.dp), + RadioButton( + selected = selected, + onClick = null, + modifier = Modifier.padding(end = 20.dp), + colors = RadioButtonDefaults.colors( + unselectedColor = colorResource(id = R.color.icon_secondary), + selectedColor = colorResource(id = R.color.icon_accent), + ), ) - Icon(painter = painterResource(id = R.drawable.ic_tangem_24), contentDescription = "") + + Column { + Text( + text = title, + style = TangemTypography.subtitle1, + color = colorResource(id = R.color.text_primary_1), + ) + Spacer(modifier = Modifier.size(4.dp)) + Text( + text = subtitle, + style = TangemTypography.body2, + color = colorResource(id = R.color.text_secondary), + ) + } } } \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/securitymode/SecurityModeScreen.kt b/app/src/main/java/com/tangem/tap/features/details/ui/securitymode/SecurityModeScreen.kt index 383fa7b498..ba9c01e84d 100644 --- a/app/src/main/java/com/tangem/tap/features/details/ui/securitymode/SecurityModeScreen.kt +++ b/app/src/main/java/com/tangem/tap/features/details/ui/securitymode/SecurityModeScreen.kt @@ -2,27 +2,19 @@ package com.tangem.tap.features.details.ui.securitymode import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size import androidx.compose.foundation.rememberScrollState -import androidx.compose.foundation.selection.selectable import androidx.compose.foundation.verticalScroll -import androidx.compose.material.RadioButton -import androidx.compose.material.RadioButtonDefaults -import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import com.tangem.tap.common.compose.TangemTypography import com.tangem.tap.features.details.redux.SecurityOption import com.tangem.tap.features.details.ui.common.DetailsMainButton +import com.tangem.tap.features.details.ui.common.DetailsRadioButtonElement import com.tangem.tap.features.details.ui.common.ScreenTitle import com.tangem.tap.features.details.ui.common.SettingsScreensScaffold import com.tangem.wallet.R @@ -74,39 +66,12 @@ fun SecurityOption(option: SecurityOption, state: SecurityModeScreenState) { SecurityOption.AccessCode -> R.string.details_manage_security_access_code_description } - Row( - modifier = Modifier - .fillMaxWidth() - .selectable( - selected = selected, - onClick = { state.onNewModeSelected(option) }, - ) - .padding(start = 20.dp, end = 20.dp, top = 16.dp, bottom = 16.dp), - ) { - RadioButton( - selected = selected, - onClick = null, - modifier = Modifier.padding(end = 20.dp), - colors = RadioButtonDefaults.colors( - unselectedColor = colorResource(id = R.color.icon_secondary), - selectedColor = colorResource(id = R.color.icon_accent), - ), - ) - - Column { - Text( - text = stringResource(id = title), - style = TangemTypography.subtitle1, - color = colorResource(id = R.color.text_primary_1), - ) - Spacer(modifier = Modifier.size(4.dp)) - Text( - text = stringResource(id = subtitle), - style = TangemTypography.body2, - color = colorResource(id = R.color.text_secondary), - ) - } - } + DetailsRadioButtonElement( + title = stringResource(id = title), + subtitle = stringResource(id = subtitle), + selected = selected, + onClick = { state.onNewModeSelected(option) }, + ) } @Preview diff --git a/core/res/src/main/res/values-de/strings.xml b/core/res/src/main/res/values-de/strings.xml index f4ba8d958a..71e94a8a0c 100644 --- a/core/res/src/main/res/values-de/strings.xml +++ b/core/res/src/main/res/values-de/strings.xml @@ -1,283 +1,313 @@ - Add custom token - Send only %1$s (%2$s) from %3$s network to this address. Using other tokens and networks may result in loss of funds. - Request support - Send feedback + + + + Diese Karte wurde früher bereits aufgeladen und Transaktionen wurden damit signiert. Ziehen Sie eine sofortige Auszahlung aller Beträge in Betracht, wenn Sie diese Karte von einer nicht vertrauenswürdigen Quelle erhalten haben. - This feature is disabled in Demo mode - You are currently running in Demo mode. All funds are not real. + + Die von Ihnen gescannte Karte ist eine Entwicklungskarte. Akzeptieren Sie sie nicht als Zahlungsmittel. - Reason: %s - Can\'t send a transaction - Note that tokens on different networks have different addresses. Double check that your address matches the network when you transfer funds. - Tokens in Solana network are not supported by this card due to firmware limitation. - This card is not a bearer note. We can\'t currently match the signature count on the card with the information on the blockchain. This is normal but in rare cases can mean a previous holder is holding back an offline signature, which is a security concern.\nDo not accept this card as physical payment from someone you don\'t trust.\nIt\'s perfectly safe in all other respects.\nTangem is the only hardware wallet to offer signature count protection. - Are you having difficulty scanning your card? + + + + + + Diese Karte ist für die Zusammenarbeit mit Tangem nicht geeignet - Go to settings to enable biometric authentication in the Tangem App - Enable biometric authentication - This will delete all the saved wallet access codes. Any further operation with the wallet will require submitting the access code. - Removing the saved card deletes all the saved wallets and their access codes from the app. - Save Access Code - Biometric authentication will be requested instead of the access code for interactions with your card. - Keep the wallet in the app - Enable to link all the wallets to Tangem app. Biometric authentication will be required for unlocking the app. Transaction signing requires tapping your Tangem card. - App Settings - Please scan the card - Please try again in 30 seconds or scan the card - Too many attempts - Reset - Are you sure you want to do this? - Change Access Code - Access code will be changed on this card only - Reset to Factory Settings - Security Mode - Card Settings + + + + + + + + + + + + + + + + + + + + + + + Tangem Bot - Support + + + + + Akzeptieren - Add - Attention + + Bilanz: %s - biometric authentication - biometrics + + Sie haben keinen Zugang zur Kamera erteilt, bitte passen Sie Ihre Datenschutzeinstellungen an Abbrechen - Close - Continue - Copy - Create + + + + Entfernen - Disconnect + + Erledigt - Enable + + Fehler - No + + OK - Primary Card - Reject - Retry + + + Änderungen speichern - Search - The server is not available, please try again later - Share - Sign - Sign and send - Start - Submit + + + + + + + Erfolg - terms and conditions - I understand + + Warnung - Yes - Contract address copied! - Available networks - Contract address - Contract address is invalid - Derivation path is invalid - Please select the network - Required field - Decimal number must be a valid integer, no higher than %d - Decimals - Default - BIP44 coin type - E.g. USD Coin - Name - Not selected - Network - E.g. USDC - Token symbol - This token/network has already been added to your list - Note that tokens can be created by anyone. Be aware of adding scam tokens, they can cost nothing. - Chat + + + + + + + + + + + + + + + + + + + + + Zugangscode Sie müssen den richtigen Zugangscode eingeben, bevor Sie die Karte scannen. Langes Tippen Dieser Mechanismus schützt vor Annäherungsangriffen auf eine Karte. Es wird eine Verzögerung zwischen dem Empfang und der Ausführung eines Befehls erzwungen. Nach der ersten signierten Transaktion wird dieses Telefon mit der Karte verknüpft und die Transaktionen werden sofort signiert Passcode Bevor Sie einen Befehl ausführen, der eine Änderung des Kartenstatus zur Folge hat, müssen Sie den Passcode eingeben. - Referral program - Privacy policy + + %s Hasch - Card terms of use + KartenID - Link More Cards + App Währung Emittent - Send Feedback + Signiert Details - Check your internet connection or switch to a different network + Nutzungsbedingungen - Oops, the current version of the application is not ready to work with this card, please check for updates. - You have used a card from another wallet. Tap the card associated with this wallet - You Receive - You Send - The following information is optional. You can erase it if you don\'t want to share it. - Tell us what functions you are missing, and we will try to help you. - Please tell us what card do you have - Hi support team, - Please tell us more about your issue. Every small detail can help. - My suggestions - Can\'t scan a card - Feedback - Tangem feedback - Can\'t send a transaction - Order + + + + + + + + + + + + + + + Tippen Sie um den Zugangscode zu ändern Tippen Sie um den Passcode zu ändern - To create the wallet tap the card as shown above and do not remove until the end of the operation + Legen Sie die Karte zum Scannen an Tippen um zu signieren Legen Sie die Karte an - Internal error: wallet manager not found - Manage tokens - To protect your assets, we advise you to carry out this procedure - Your wallet has not been backed up - Total balance - The amount does not include some of your funds - To access all the networks you need to scan the card - Scan your card - Tokens - You have to set up a single access code to protect all your wallets - Protect - You can set up an individual access code on each card later - Personalize - The access code can be restored with a linked card, don\'t keep all cards in one place - Restore - Choose any word, phrase, or number you want as your access code - Create Access Code - Re-enter your Access Code - Access code must be at least 4 characters long - Entered access code didn\'t match the initial access code - You\'ve added one backup card. When backup process is finished you can\'t add more backup cards. If you have one more card, add it to backup. Do you like to continue the backup process? - The backup process is partly complete. You can\'t exit it now. - Balance - Add a backup card - Scan the card #%d - Backup now - Scan the primary card - Claim - Continue to my wallet - Finalize the backup process - Verify via Utorg - Refresh - Set PIN code - Receive crypto - Register - Scan primary card - Skip for later - How does it work? - Let\'s generate all the keys on your card and create a secure wallet - Create wallet - Create a wallet - Your card is activated and ready to be used - Success! - In this case, you will need to start from the beginning. - Do you want to exit the activation process? - Getting started - Verify your identity - KYC - Pin code - Connect - Creating a backup - Tap the SaltPay card - To start the backup process you have to add the Tangem card as your backup - Finalize the backup process by creating an access code - Tap the Tangem card - No backup card - Backup card ready - Prepare the SaltPay card - To get started, simply claim wxDAI to your wallet - It will take a few seconds - Please check your email for further instructions - To start using your card you have to pass the KYC process - Please wait until the verification is completed. You\'ll be notified via email. Usually it takes up to 1 hour. You can close the app and come back later. - To start the backup process add up to two backup cards. - You can add one more card or finalize the backup process - Set up a 4-digit code.\nIt will be used for payments. - Connect your card to the decentralized payment system - Prepare the backup card with number %s - Prepare the primary card - Prepare the primary card with number %s - Congratulations! Your first payment crypto card has been activated! - Your wallet card is configured and ready for use. - Max number of cards added. Finalize the backup process. - Activating card - Backup card #%d - Claim %s - Claiming - Something went wrong - Verify your identity - KYC is in progress - No backup cards - One backup card added - PIN Code - Connect your card - Prepare your card - Two backup cards added - To get started, simply top up the wallet with any amount - To get started, simply top up the wallet with more than %1$s %2$s - Buy crypto - Show the wallet\'s address - Top up your wallet - The twinning process is partly complete. You can\'t exit it now. - If the process of creating the wallet gets interrupted in any way, you\'ll have to start over - You can backup your keys up to two other blank Tangem Wallet cards. - Access code can be restored with one of backup cards. - All the backup cards can be used as full-functional with the identical keys. - You will be able to set an access code to protect your wallets. - Backup wallet - Access code restore - Identical cards - Access code - Participate - Failed to load the information about the referral program. Please try again later. - Failed to load the information about the referral program. Error code: %s. Please try again later. - Your participation request could not be processed. Error code: %s. Please try again later. If the problem persists — feel free to contact our support. - Your friends bought - Will get - for each wallet bought by your friend on your %1$s network address%2$s - You - Will get a - when buying a card on tangem.com - %s discount - Your friend - Personal code copied! - Your personal code - Buy Tangem Wallet with discount!\n%s - Refer your friends to Tangem - You\'ve accepted - By tapping this button you accept - of the referral program - Please hold the card until the operation complete - Reset the Card - I understand that after performing this action, I will no longer have access to the current wallet - 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. - Factory Reset will completely delete the wallet from the selected card and remove it from the app. You will not be able to restore the current wallet. - Do you have a bank card of another country or a UnionPay card? - Russian bank cards are not accepted at the moment - Tap the card with the visa logo - Attention - Please contact support - No funds for activation - Such a PIN can be brute-forced easily - Four identical digits isn\'t safe - Log into the app and check your balance without scanning the card - Access the app - Allow to use biometrics - Biometrics will be requested instead of the access code for interactions with your wallet - Access code - It looks like you have biometric authentication disabled, it is necessary to save wallets - Enable biometric authorization - Would you like to use biometrics? - Note that making a transaction with your funds will still require your card - Scan card failed. Try again - Scan Card - Scan the card to change its settings. The changes will impact only the card you\'ve scanned and will not affect other cards tied to your wallet. - Get your card ready! - Search tokens + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Betrag Adresse Adresse oder PayString @@ -285,8 +315,8 @@ PayString ist nicht registriert PayString-Anfrage ist fehlgeschlagen PayString wird von der Blockchain nicht unterstützt - Invalid Tag. It won\'t be added to the transaction. - Invalid Memo. It won\'t be added to the transaction. + + Tag Memo inkl. Gebühr @@ -297,141 +327,146 @@ Höchstbetrag Netzgebühr Absenden - Sending %s + Gesamt %1$s und %2$s werden gesendet ≈ %1$s (inkl. Gebühr: %2$s) %s wird gesendet Die Transaktion wurde erfolgreich signiert und an den Blockchain-Knoten gesendet. Die Walletbilanz wird aktualisiert Ungültige Adresse - Buy now - Free - I have a promo code… + + + Tangem Wallet - Other payment methods - Shipping - Total - Solana network charges a rent of %1$s every 2 days. Accounts that can\'t afford the rent are purged from the network. Deposit your account with more than %2$s to use it for free. - Store your crypto assets secure while keeping private keys contained in your card - Revolutionary Hardware Wallet - Up to - 3 physical cards - to one wallet - Ultra Secure Backup - A hardware wallet for your Bitcoin, Ethereum and many more currencies simultaneously – all in one card - Thousands of Currencies - Use it on the go, anywhere, anytime. No wires or batteries. Just tap the card to your phone when you need your crypto. - The Wallet for Everyone - Borrow - Buy - Exchange - Lend - Pay - Send - Store - Meet\nTangem - Exchange, buy NFT\'s, make loans and deposits in more than 100 different decentralized services - DeFi Compatible - Error: %s - There was an error. Please try again. - Give Permission - High price impact! - Swapping this amount of selected tokens will cause a significant price impact and reduce your outcome. - Insufficient funds - Not enough funds for fee in your %1$s wallet to create a transaction. Top up your %2$s wallet first. - Transaction in progress… - Waiting - Approve - Give Permission - Amount %s - Spender - Your Wallet - To continue you need to allow 1inch smart contracts to use your %s - Permit and Swap - View in Explorer - In progress - Swap - Swap - Swap of %s to - Quotes include an additional Tangem commission of %s. This helps us deliver a top-of-the-line product. - Other tokens - Choose token - Your tokens - not available - Hide - You are about to hide this token from the main screen. You can add it back anytime through the manage tokens page. - Hide %s - Hide token - %1$s is a token in the %2$s network. To make a %3$s transaction you need to deposit some %4$s (%5$s) to cover the network fee. - Please wait for %s transaction to complete to be able to send funds - The %1$s token is the main currency on the %2$s network and cannot be hidden as long as you have other tokens on this network in the list. - Unable to hide %s - No rate - You don\'t have any transactions yet - Failed to load transactions - Transactions - In progress… - You\'ve scanned the same card. To create a twin wallet you need to scan the card with number %d - This one that you are holding in your hands and the other one with number %s.\n\nBoth cards can be used to extract funds from this wallet. - One wallet. Two cards. - Scan the card #%s - Creating wallet - Scan the #%s twin card - Preparing card + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tangem Twin - This action is irreversible. You will not have access to the old wallet. - Add new wallet - Are you sure you want to delete this wallet? - %d selected - An error has occurred, please scan your card to log in - This wallet has already been saved, you can add another one - Multi-currency - Wallet name - Rename Wallet - Single-currency - My Wallets - Unlock all with %s + + + + + + + + + + + + PayString erstellen - Adresse erkunden - Network is unreachable - Blockchain is unreachable. Try later + + + Die Bilanz wird aufgeladen… - Scan the card + Die Transaktion läuft… Verifizierte Bilanz - Actions - Buy + + ein Wallet erstellen - Sell + Absenden - Exchange - Do you want to buy or sell crypto? - Requesting to sign a message.\n\n%s - Dapp %1$s, requesting to\nsign BNB transaction.\n\n%2$s - Trade order for %1$s\nPrice: %2$s\nAmount to receive: %3$s\nAmount to pay: %4$s - Transaction details:\nFrom: %1$s\nTo: %2$s\nAmount: %3$s - Clipboard contain WalletConnect code. Use copied value or scan QR-code - Request to create transaction for %1$s\n%2$s\n\nAmount: %3$s\nFee: %4$s\nTotal: %5$s\nBalance: %6$s - Can\'t send transaction. Not enough funds. - Failed to establish WalletConnect session. Please, try again later. - Not all tokens were added to your list. Please add them first and try again. Missing tokens:\n - Failed to establish WalletConnect session: timeout error. Please, try again later. - Session request contains unsupported blockchains for WalletConnect connection. Unsupported blockchains:\n - Connection with this Dapp cannot be established due to its technical implementation. - We\'ve encountered unknown error. Error code: %d. If the problem persists — feel free to contact our support - %s network not found. Please, add it first and try again. - No opened WalletConnect sessions - Ooops. No Sessions. - Open session - Paste from clipboard - Request to start a session for\n%1$s\n\nNETWORK: %2$s\n\nURL: %3$s - The operation couldn\'t be completed.\n\nYou have already established a WalletConnect session with this parameters. - Scan new code - This card can\'t be used to establish WalletConnect session - This network is not supported. Please select another network. - Select network - WalletConnect Sessions - Connect to Dapps + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WalletConnect PayString erstellen $payid.tangem.com @@ -440,11 +475,11 @@ Fehlerantwort beim Erstellen der PayString PayString Name PayString sind Ihre einzigartigen Identifikationsdaten wie Telefonnummer, E-Mail-Adresse oder ABN. - %s network + Leere Karte Erstellen Sie ein Wallet um die Tangem-Karte verwenden zu können - Create twin wallet - Generate wallet keys on both cards to start using your Twins + + Das Konto ist nicht erstellt Diese Karte wird nicht unterstützt Ihre Tangem-Karte wurde für die Arbeit mit einer anderen App ausgestellt. Bitte sehen Sie sich den Namen und die Anleitung auf Ihrer Karte an und installieren Sie eine korrekte App @@ -455,28 +490,28 @@ Senden an %s Tangem - Can be better - Learn more + + OK, ich hab\'s! - Really cool! - %1$s network has a concept of Existential Deposit. If your account drops below %2$s it will be deactivated and any remaining funds will be destroyed. - This card might be a production sample or counterfeit - Authenticity check failed - Important security information %s - There are only %s signatures available on this card. You must withdraw all of your funds. - How do you like Tangem? - One question - This card has signed transactions in the past - This is a Testnet card. Don\'t accept it as a payment. This card must only be used for testing and development purposes. - Discard - You have an interrupted backup. Do you want to resume? - Yes, resume - Discard - If you will discard the backup now, then you will have to reset the cards to factory settings to start over again - Resume backup - This is an irreversible action - Log in with %s - Scan card - Use %s or scan a card to access the app - Welcome back! + + + + + + + + + + + + + + + + + + + + + diff --git a/core/res/src/main/res/values-fr/strings.xml b/core/res/src/main/res/values-fr/strings.xml index 8c367d88a4..a82b4bb258 100644 --- a/core/res/src/main/res/values-fr/strings.xml +++ b/core/res/src/main/res/values-fr/strings.xml @@ -1,283 +1,313 @@ - Add custom token - Send only %1$s (%2$s) from %3$s network to this address. Using other tokens and networks may result in loss of funds. - Request support - Send feedback + + + + Cette carte a déjà été rechargée et a signé des transactions avant. Envisagez la possibilité de retirer tous les fonds immédiatement si vous avez reçu cette carte d\'une source non fiable. - This feature is disabled in Demo mode - You are currently running in Demo mode. All funds are not real. + + La carte que vous avez scannée est une carte de développement. Ne l\'acceptez pas comme paiement. - Reason: %s - Can\'t send a transaction - Note that tokens on different networks have different addresses. Double check that your address matches the network when you transfer funds. - Tokens in Solana network are not supported by this card due to firmware limitation. - This card is not a bearer note. We can\'t currently match the signature count on the card with the information on the blockchain. This is normal but in rare cases can mean a previous holder is holding back an offline signature, which is a security concern.\nDo not accept this card as physical payment from someone you don\'t trust.\nIt\'s perfectly safe in all other respects.\nTangem is the only hardware wallet to offer signature count protection. - Are you having difficulty scanning your card? + + + + + + Cette carte n\'est pas conçue pour fonctionner avec Tangem - Go to settings to enable biometric authentication in the Tangem App - Enable biometric authentication - This will delete all the saved wallet access codes. Any further operation with the wallet will require submitting the access code. - Removing the saved card deletes all the saved wallets and their access codes from the app. - Save Access Code - Biometric authentication will be requested instead of the access code for interactions with your card. - Keep the wallet in the app - Enable to link all the wallets to Tangem app. Biometric authentication will be required for unlocking the app. Transaction signing requires tapping your Tangem card. - App Settings - Please scan the card - Please try again in 30 seconds or scan the card - Too many attempts - Reset - Are you sure you want to do this? - Change Access Code - Access code will be changed on this card only - Reset to Factory Settings - Security Mode - Card Settings + + + + + + + + + + + + + + + + + + + + + + + Tangem Bot - Support + + + + + J\'accepte - Add - Attention + + Solde : %s - biometric authentication - biometrics + + Vous n\'avez pas octroyé l\'accès à votre caméra, veuillez modifier vos paramètres de confidentialité Annuler - Close - Continue - Copy - Create + + + + Supprimer - Disconnect + + Exécuté - Enable + + Erreur - No + + OK - Primary Card - Reject - Retry + + + Sauvegarder les modifications - Search - The server is not available, please try again later - Share - Sign - Sign and send - Start - Submit + + + + + + + Avec succès - terms and conditions - I understand + + Alerte - Yes - Contract address copied! - Available networks - Contract address - Contract address is invalid - Derivation path is invalid - Please select the network - Required field - Decimal number must be a valid integer, no higher than %d - Decimals - Default - BIP44 coin type - E.g. USD Coin - Name - Not selected - Network - E.g. USDC - Token symbol - This token/network has already been added to your list - Note that tokens can be created by anyone. Be aware of adding scam tokens, they can cost nothing. - Chat + + + + + + + + + + + + + + + + + + + + + Code d\'accès Vous devrez entrer le mot de passe correct avant de scanner la carte Tenez la carte fermement Ce mécanisme protège contre les attaques sans contact sur la carte. Il y a un délai entre la réception et l\'exécution de la commande. Après la première transaction signée, ce téléphone sera associé à la carte et les transactions seront signées immédiatement. Mot de passe Avant d\'exécuter une commande qui modifie l\'état de la carte, vous devrez entrer un mot de passe. - Referral program - Privacy policy + + %s hashes - Card terms of use + ID de la carte - Link More Cards + Monnaie de l\'application Emetteur - Send Feedback + Signé Référénces - Check your internet connection or switch to a different network + Conditions d\'utilisation - Oops, the current version of the application is not ready to work with this card, please check for updates. - You have used a card from another wallet. Tap the card associated with this wallet - You Receive - You Send - The following information is optional. You can erase it if you don\'t want to share it. - Tell us what functions you are missing, and we will try to help you. - Please tell us what card do you have - Hi support team, - Please tell us more about your issue. Every small detail can help. - My suggestions - Can\'t scan a card - Feedback - Tangem feedback - Can\'t send a transaction - Order + + + + + + + + + + + + + + + Touchez, pour modifier le code d\'accès Touchez, pour modifier le mot de passe - To create the wallet tap the card as shown above and do not remove until the end of the operation + Posez pour scanner Touchez pour signer Posez la carte - Internal error: wallet manager not found - Manage tokens - To protect your assets, we advise you to carry out this procedure - Your wallet has not been backed up - Total balance - The amount does not include some of your funds - To access all the networks you need to scan the card - Scan your card - Tokens - You have to set up a single access code to protect all your wallets - Protect - You can set up an individual access code on each card later - Personalize - The access code can be restored with a linked card, don\'t keep all cards in one place - Restore - Choose any word, phrase, or number you want as your access code - Create Access Code - Re-enter your Access Code - Access code must be at least 4 characters long - Entered access code didn\'t match the initial access code - You\'ve added one backup card. When backup process is finished you can\'t add more backup cards. If you have one more card, add it to backup. Do you like to continue the backup process? - The backup process is partly complete. You can\'t exit it now. - Balance - Add a backup card - Scan the card #%d - Backup now - Scan the primary card - Claim - Continue to my wallet - Finalize the backup process - Verify via Utorg - Refresh - Set PIN code - Receive crypto - Register - Scan primary card - Skip for later - How does it work? - Let\'s generate all the keys on your card and create a secure wallet - Create wallet - Create a wallet - Your card is activated and ready to be used - Success! - In this case, you will need to start from the beginning. - Do you want to exit the activation process? - Getting started - Verify your identity - KYC - Pin code - Connect - Creating a backup - Tap the SaltPay card - To start the backup process you have to add the Tangem card as your backup - Finalize the backup process by creating an access code - Tap the Tangem card - No backup card - Backup card ready - Prepare the SaltPay card - To get started, simply claim wxDAI to your wallet - It will take a few seconds - Please check your email for further instructions - To start using your card you have to pass the KYC process - Please wait until the verification is completed. You\'ll be notified via email. Usually it takes up to 1 hour. You can close the app and come back later. - To start the backup process add up to two backup cards. - You can add one more card or finalize the backup process - Set up a 4-digit code.\nIt will be used for payments. - Connect your card to the decentralized payment system - Prepare the backup card with number %s - Prepare the primary card - Prepare the primary card with number %s - Congratulations! Your first payment crypto card has been activated! - Your wallet card is configured and ready for use. - Max number of cards added. Finalize the backup process. - Activating card - Backup card #%d - Claim %s - Claiming - Something went wrong - Verify your identity - KYC is in progress - No backup cards - One backup card added - PIN Code - Connect your card - Prepare your card - Two backup cards added - To get started, simply top up the wallet with any amount - To get started, simply top up the wallet with more than %1$s %2$s - Buy crypto - Show the wallet\'s address - Top up your wallet - The twinning process is partly complete. You can\'t exit it now. - If the process of creating the wallet gets interrupted in any way, you\'ll have to start over - You can backup your keys up to two other blank Tangem Wallet cards. - Access code can be restored with one of backup cards. - All the backup cards can be used as full-functional with the identical keys. - You will be able to set an access code to protect your wallets. - Backup wallet - Access code restore - Identical cards - Access code - Participate - Failed to load the information about the referral program. Please try again later. - Failed to load the information about the referral program. Error code: %s. Please try again later. - Your participation request could not be processed. Error code: %s. Please try again later. If the problem persists — feel free to contact our support. - Your friends bought - Will get - for each wallet bought by your friend on your %1$s network address%2$s - You - Will get a - when buying a card on tangem.com - %s discount - Your friend - Personal code copied! - Your personal code - Buy Tangem Wallet with discount!\n%s - Refer your friends to Tangem - You\'ve accepted - By tapping this button you accept - of the referral program - Please hold the card until the operation complete - Reset the Card - I understand that after performing this action, I will no longer have access to the current wallet - 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. - Factory Reset will completely delete the wallet from the selected card and remove it from the app. You will not be able to restore the current wallet. - Do you have a bank card of another country or a UnionPay card? - Russian bank cards are not accepted at the moment - Tap the card with the visa logo - Attention - Please contact support - No funds for activation - Such a PIN can be brute-forced easily - Four identical digits isn\'t safe - Log into the app and check your balance without scanning the card - Access the app - Allow to use biometrics - Biometrics will be requested instead of the access code for interactions with your wallet - Access code - It looks like you have biometric authentication disabled, it is necessary to save wallets - Enable biometric authorization - Would you like to use biometrics? - Note that making a transaction with your funds will still require your card - Scan card failed. Try again - Scan Card - Scan the card to change its settings. The changes will impact only the card you\'ve scanned and will not affect other cards tied to your wallet. - Get your card ready! - Search tokens + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Somme Adresse Adresse ou PayString @@ -285,8 +315,8 @@ PayString non enregistré La demande de PayString a échoué PayString non pris en charge par la blockchain - Invalid Tag. It won\'t be added to the transaction. - Invalid Memo. It won\'t be added to the transaction. + + Tag Memo Inclure les commissions @@ -297,141 +327,146 @@ Somme maximale Commissions du réseau Envoyer - Sending %s + Total Sera envoyé %1$s et %2$s ≈ %1$s (incl. les commissions : %2$s) Sera envoyé %s La transaction a été signée avec succès et envoyée au nœud de blockchain. Le solde du portefeuille sera mis à jour après un certain temps Adresse incorrecte - Buy now - Free - I have a promo code… + + + Tangem Wallet - Other payment methods - Shipping - Total - Solana network charges a rent of %1$s every 2 days. Accounts that can\'t afford the rent are purged from the network. Deposit your account with more than %2$s to use it for free. - Store your crypto assets secure while keeping private keys contained in your card - Revolutionary Hardware Wallet - Up to - 3 physical cards - to one wallet - Ultra Secure Backup - A hardware wallet for your Bitcoin, Ethereum and many more currencies simultaneously – all in one card - Thousands of Currencies - Use it on the go, anywhere, anytime. No wires or batteries. Just tap the card to your phone when you need your crypto. - The Wallet for Everyone - Borrow - Buy - Exchange - Lend - Pay - Send - Store - Meet\nTangem - Exchange, buy NFT\'s, make loans and deposits in more than 100 different decentralized services - DeFi Compatible - Error: %s - There was an error. Please try again. - Give Permission - High price impact! - Swapping this amount of selected tokens will cause a significant price impact and reduce your outcome. - Insufficient funds - Not enough funds for fee in your %1$s wallet to create a transaction. Top up your %2$s wallet first. - Transaction in progress… - Waiting - Approve - Give Permission - Amount %s - Spender - Your Wallet - To continue you need to allow 1inch smart contracts to use your %s - Permit and Swap - View in Explorer - In progress - Swap - Swap - Swap of %s to - Quotes include an additional Tangem commission of %s. This helps us deliver a top-of-the-line product. - Other tokens - Choose token - Your tokens - not available - Hide - You are about to hide this token from the main screen. You can add it back anytime through the manage tokens page. - Hide %s - Hide token - %1$s is a token in the %2$s network. To make a %3$s transaction you need to deposit some %4$s (%5$s) to cover the network fee. - Please wait for %s transaction to complete to be able to send funds - The %1$s token is the main currency on the %2$s network and cannot be hidden as long as you have other tokens on this network in the list. - Unable to hide %s - No rate - You don\'t have any transactions yet - Failed to load transactions - Transactions - In progress… - You\'ve scanned the same card. To create a twin wallet you need to scan the card with number %d - This one that you are holding in your hands and the other one with number %s.\n\nBoth cards can be used to extract funds from this wallet. - One wallet. Two cards. - Scan the card #%s - Creating wallet - Scan the #%s twin card - Preparing card + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tangem Twin - This action is irreversible. You will not have access to the old wallet. - Add new wallet - Are you sure you want to delete this wallet? - %d selected - An error has occurred, please scan your card to log in - This wallet has already been saved, you can add another one - Multi-currency - Wallet name - Rename Wallet - Single-currency - My Wallets - Unlock all with %s + + + + + + + + + + + + Créer PayString - Explorer l\'adresse - Network is unreachable - Blockchain is unreachable. Try later + + + Solde est en cours de téléchargement… - Scan the card + Transaction en cours… Solde confirmé - Actions - Buy + + Créer un portefeuille - Sell + Envoyer - Exchange - Do you want to buy or sell crypto? - Requesting to sign a message.\n\n%s - Dapp %1$s, requesting to\nsign BNB transaction.\n\n%2$s - Trade order for %1$s\nPrice: %2$s\nAmount to receive: %3$s\nAmount to pay: %4$s - Transaction details:\nFrom: %1$s\nTo: %2$s\nAmount: %3$s - Clipboard contain WalletConnect code. Use copied value or scan QR-code - Request to create transaction for %1$s\n%2$s\n\nAmount: %3$s\nFee: %4$s\nTotal: %5$s\nBalance: %6$s - Can\'t send transaction. Not enough funds. - Failed to establish WalletConnect session. Please, try again later. - Not all tokens were added to your list. Please add them first and try again. Missing tokens:\n - Failed to establish WalletConnect session: timeout error. Please, try again later. - Session request contains unsupported blockchains for WalletConnect connection. Unsupported blockchains:\n - Connection with this Dapp cannot be established due to its technical implementation. - We\'ve encountered unknown error. Error code: %d. If the problem persists — feel free to contact our support - %s network not found. Please, add it first and try again. - No opened WalletConnect sessions - Ooops. No Sessions. - Open session - Paste from clipboard - Request to start a session for\n%1$s\n\nNETWORK: %2$s\n\nURL: %3$s - The operation couldn\'t be completed.\n\nYou have already established a WalletConnect session with this parameters. - Scan new code - This card can\'t be used to establish WalletConnect session - This network is not supported. Please select another network. - Select network - WalletConnect Sessions - Connect to Dapps + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WalletConnect Créer PayString $payid.tangem.com @@ -440,11 +475,11 @@ Mauvaise réponse lors de la création de PayString Dénomination PayString Votre PayString est une information qui vous est propre, comme un numéro de téléphone, une adresse du courrier électronique ou un ABN. - %s network + Carte vide Créez un portefeuille pour commencer à utiliser votre carte Tangem - Create twin wallet - Generate wallet keys on both cards to start using your Twins + + Compte n\'est pas créé Cette carte n\'est pas prise en charge Votre carte Tangem a été créée pour fonctionner avec une autre application. Regardez le nom et les instructions sur votre carte et installez l\'application pertinente @@ -455,28 +490,28 @@ Envoi jusqu\'à %s Tangem - Can be better - Learn more + + Ok, je l\'ai! - Really cool! - %1$s network has a concept of Existential Deposit. If your account drops below %2$s it will be deactivated and any remaining funds will be destroyed. - This card might be a production sample or counterfeit - Authenticity check failed - Important security information %s - There are only %s signatures available on this card. You must withdraw all of your funds. - How do you like Tangem? - One question - This card has signed transactions in the past - This is a Testnet card. Don\'t accept it as a payment. This card must only be used for testing and development purposes. - Discard - You have an interrupted backup. Do you want to resume? - Yes, resume - Discard - If you will discard the backup now, then you will have to reset the cards to factory settings to start over again - Resume backup - This is an irreversible action - Log in with %s - Scan card - Use %s or scan a card to access the app - Welcome back! + + + + + + + + + + + + + + + + + + + + + diff --git a/core/res/src/main/res/values-it/strings.xml b/core/res/src/main/res/values-it/strings.xml index 53671cbc35..9c509aec19 100644 --- a/core/res/src/main/res/values-it/strings.xml +++ b/core/res/src/main/res/values-it/strings.xml @@ -1,283 +1,313 @@ - Add custom token - Send only %1$s (%2$s) from %3$s network to this address. Using other tokens and networks may result in loss of funds. - Request support - Send feedback + + + + Questa carta è già stata ricaricata e ha firmato transazioni in passato. Valuta la possibilità di prelevare immediatamente tutti i fondi se hai ricevuto questa carta da una fonte inaffidabile. - This feature is disabled in Demo mode - You are currently running in Demo mode. All funds are not real. + + La carta che hai scansionato è una carta di sviluppo. Non utilizzarla come strumento di pagamento - Reason: %s - Can\'t send a transaction - Note that tokens on different networks have different addresses. Double check that your address matches the network when you transfer funds. - Tokens in Solana network are not supported by this card due to firmware limitation. - This card is not a bearer note. We can\'t currently match the signature count on the card with the information on the blockchain. This is normal but in rare cases can mean a previous holder is holding back an offline signature, which is a security concern.\nDo not accept this card as physical payment from someone you don\'t trust.\nIt\'s perfectly safe in all other respects.\nTangem is the only hardware wallet to offer signature count protection. - Are you having difficulty scanning your card? + + + + + + Questa carta non è progettata per funzionare con Tangem - Go to settings to enable biometric authentication in the Tangem App - Enable biometric authentication - This will delete all the saved wallet access codes. Any further operation with the wallet will require submitting the access code. - Removing the saved card deletes all the saved wallets and their access codes from the app. - Save Access Code - Biometric authentication will be requested instead of the access code for interactions with your card. - Keep the wallet in the app - Enable to link all the wallets to Tangem app. Biometric authentication will be required for unlocking the app. Transaction signing requires tapping your Tangem card. - App Settings - Please scan the card - Please try again in 30 seconds or scan the card - Too many attempts - Reset - Are you sure you want to do this? - Change Access Code - Access code will be changed on this card only - Reset to Factory Settings - Security Mode - Card Settings + + + + + + + + + + + + + + + + + + + + + + + Tangem Bot - Support + + + + + Accetta - Add - Attention + + Saldo: %s - biometric authentication - biometrics + + Non hai fornito l\'accesso alla tua videocamera, modifica le tue impostazioni sulla privacy Annulla - Close - Continue - Copy - Create + + + + Rimuovere - Disconnect + + Fatto - Enable + + Errore - No + + OK - Primary Card - Reject - Retry + + + Mantieni le modifiche - Search - The server is not available, please try again later - Share - Sign - Sign and send - Start - Submit + + + + + + + Con successo - terms and conditions - I understand + + Avviso - Yes - Contract address copied! - Available networks - Contract address - Contract address is invalid - Derivation path is invalid - Please select the network - Required field - Decimal number must be a valid integer, no higher than %d - Decimals - Default - BIP44 coin type - E.g. USD Coin - Name - Not selected - Network - E.g. USDC - Token symbol - This token/network has already been added to your list - Note that tokens can be created by anyone. Be aware of adding scam tokens, they can cost nothing. - Chat + + + + + + + + + + + + + + + + + + + + + Codice di accesso Prima di scansionare la carta sarà necessario inserire il codice di accesso corretto Mantenimento della carta Questo meccanismo protegge dagli avvicinamenti senza contatto sulla carta. Attiva un ritardo tra la ricezione e l\'esecuzione di un comando. Dopo la prima transazione firmata, questo telefono verrà associato alla carta e le transazioni verranno firmate immediatamente. Password Dovrai inserire una password prima di eseguire qualsiasi comando che modifichi lo stato della carta. - Referral program - Privacy policy + + Hash %s - Card terms of use + ID carta - Link More Cards + Valuta dell\'applicazione Emittente - Send Feedback + Firmato Requisiti - Check your internet connection or switch to a different network + Termini del servizio - Oops, the current version of the application is not ready to work with this card, please check for updates. - You have used a card from another wallet. Tap the card associated with this wallet - You Receive - You Send - The following information is optional. You can erase it if you don\'t want to share it. - Tell us what functions you are missing, and we will try to help you. - Please tell us what card do you have - Hi support team, - Please tell us more about your issue. Every small detail can help. - My suggestions - Can\'t scan a card - Feedback - Tangem feedback - Can\'t send a transaction - Order + + + + + + + + + + + + + + + Avvicina per modificare il codice di accesso Avvicina per modificare la password - To create the wallet tap the card as shown above and do not remove until the end of the operation + Avvicina per scansionare Avvicina per firmare Avvicina la carta - Internal error: wallet manager not found - Manage tokens - To protect your assets, we advise you to carry out this procedure - Your wallet has not been backed up - Total balance - The amount does not include some of your funds - To access all the networks you need to scan the card - Scan your card - Tokens - You have to set up a single access code to protect all your wallets - Protect - You can set up an individual access code on each card later - Personalize - The access code can be restored with a linked card, don\'t keep all cards in one place - Restore - Choose any word, phrase, or number you want as your access code - Create Access Code - Re-enter your Access Code - Access code must be at least 4 characters long - Entered access code didn\'t match the initial access code - You\'ve added one backup card. When backup process is finished you can\'t add more backup cards. If you have one more card, add it to backup. Do you like to continue the backup process? - The backup process is partly complete. You can\'t exit it now. - Balance - Add a backup card - Scan the card #%d - Backup now - Scan the primary card - Claim - Continue to my wallet - Finalize the backup process - Verify via Utorg - Refresh - Set PIN code - Receive crypto - Register - Scan primary card - Skip for later - How does it work? - Let\'s generate all the keys on your card and create a secure wallet - Create wallet - Create a wallet - Your card is activated and ready to be used - Success! - In this case, you will need to start from the beginning. - Do you want to exit the activation process? - Getting started - Verify your identity - KYC - Pin code - Connect - Creating a backup - Tap the SaltPay card - To start the backup process you have to add the Tangem card as your backup - Finalize the backup process by creating an access code - Tap the Tangem card - No backup card - Backup card ready - Prepare the SaltPay card - To get started, simply claim wxDAI to your wallet - It will take a few seconds - Please check your email for further instructions - To start using your card you have to pass the KYC process - Please wait until the verification is completed. You\'ll be notified via email. Usually it takes up to 1 hour. You can close the app and come back later. - To start the backup process add up to two backup cards. - You can add one more card or finalize the backup process - Set up a 4-digit code.\nIt will be used for payments. - Connect your card to the decentralized payment system - Prepare the backup card with number %s - Prepare the primary card - Prepare the primary card with number %s - Congratulations! Your first payment crypto card has been activated! - Your wallet card is configured and ready for use. - Max number of cards added. Finalize the backup process. - Activating card - Backup card #%d - Claim %s - Claiming - Something went wrong - Verify your identity - KYC is in progress - No backup cards - One backup card added - PIN Code - Connect your card - Prepare your card - Two backup cards added - To get started, simply top up the wallet with any amount - To get started, simply top up the wallet with more than %1$s %2$s - Buy crypto - Show the wallet\'s address - Top up your wallet - The twinning process is partly complete. You can\'t exit it now. - If the process of creating the wallet gets interrupted in any way, you\'ll have to start over - You can backup your keys up to two other blank Tangem Wallet cards. - Access code can be restored with one of backup cards. - All the backup cards can be used as full-functional with the identical keys. - You will be able to set an access code to protect your wallets. - Backup wallet - Access code restore - Identical cards - Access code - Participate - Failed to load the information about the referral program. Please try again later. - Failed to load the information about the referral program. Error code: %s. Please try again later. - Your participation request could not be processed. Error code: %s. Please try again later. If the problem persists — feel free to contact our support. - Your friends bought - Will get - for each wallet bought by your friend on your %1$s network address%2$s - You - Will get a - when buying a card on tangem.com - %s discount - Your friend - Personal code copied! - Your personal code - Buy Tangem Wallet with discount!\n%s - Refer your friends to Tangem - You\'ve accepted - By tapping this button you accept - of the referral program - Please hold the card until the operation complete - Reset the Card - I understand that after performing this action, I will no longer have access to the current wallet - 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. - Factory Reset will completely delete the wallet from the selected card and remove it from the app. You will not be able to restore the current wallet. - Do you have a bank card of another country or a UnionPay card? - Russian bank cards are not accepted at the moment - Tap the card with the visa logo - Attention - Please contact support - No funds for activation - Such a PIN can be brute-forced easily - Four identical digits isn\'t safe - Log into the app and check your balance without scanning the card - Access the app - Allow to use biometrics - Biometrics will be requested instead of the access code for interactions with your wallet - Access code - It looks like you have biometric authentication disabled, it is necessary to save wallets - Enable biometric authorization - Would you like to use biometrics? - Note that making a transaction with your funds will still require your card - Scan card failed. Try again - Scan Card - Scan the card to change its settings. The changes will impact only the card you\'ve scanned and will not affect other cards tied to your wallet. - Get your card ready! - Search tokens + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Importo Indirizzo Indirizzo o PayString @@ -285,8 +315,8 @@ PayString non registrato Richiesta PayString fallita PayString non supportato dalla blockchain - Invalid Tag. It won\'t be added to the transaction. - Invalid Memo. It won\'t be added to the transaction. + + Tag Memo Includi commissione @@ -297,141 +327,146 @@ Importo totale Costi della rete Invia - Sending %s + Totale Sarà inviato %1$s e %2$s ≈ %1$s (inc. commissione: %2$s) Sarà inviato %s La transazione è stata firmata con successo e inviata al nodo blockchain. Il saldo del portafoglio verrà aggiornato dopo un po\' di tempo Indirizzo non valido - Buy now - Free - I have a promo code… + + + Tangem Wallet - Other payment methods - Shipping - Total - Solana network charges a rent of %1$s every 2 days. Accounts that can\'t afford the rent are purged from the network. Deposit your account with more than %2$s to use it for free. - Store your crypto assets secure while keeping private keys contained in your card - Revolutionary Hardware Wallet - Up to - 3 physical cards - to one wallet - Ultra Secure Backup - A hardware wallet for your Bitcoin, Ethereum and many more currencies simultaneously – all in one card - Thousands of Currencies - Use it on the go, anywhere, anytime. No wires or batteries. Just tap the card to your phone when you need your crypto. - The Wallet for Everyone - Borrow - Buy - Exchange - Lend - Pay - Send - Store - Meet\nTangem - Exchange, buy NFT\'s, make loans and deposits in more than 100 different decentralized services - DeFi Compatible - Error: %s - There was an error. Please try again. - Give Permission - High price impact! - Swapping this amount of selected tokens will cause a significant price impact and reduce your outcome. - Insufficient funds - Not enough funds for fee in your %1$s wallet to create a transaction. Top up your %2$s wallet first. - Transaction in progress… - Waiting - Approve - Give Permission - Amount %s - Spender - Your Wallet - To continue you need to allow 1inch smart contracts to use your %s - Permit and Swap - View in Explorer - In progress - Swap - Swap - Swap of %s to - Quotes include an additional Tangem commission of %s. This helps us deliver a top-of-the-line product. - Other tokens - Choose token - Your tokens - not available - Hide - You are about to hide this token from the main screen. You can add it back anytime through the manage tokens page. - Hide %s - Hide token - %1$s is a token in the %2$s network. To make a %3$s transaction you need to deposit some %4$s (%5$s) to cover the network fee. - Please wait for %s transaction to complete to be able to send funds - The %1$s token is the main currency on the %2$s network and cannot be hidden as long as you have other tokens on this network in the list. - Unable to hide %s - No rate - You don\'t have any transactions yet - Failed to load transactions - Transactions - In progress… - You\'ve scanned the same card. To create a twin wallet you need to scan the card with number %d - This one that you are holding in your hands and the other one with number %s.\n\nBoth cards can be used to extract funds from this wallet. - One wallet. Two cards. - Scan the card #%s - Creating wallet - Scan the #%s twin card - Preparing card + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tangem Twin - This action is irreversible. You will not have access to the old wallet. - Add new wallet - Are you sure you want to delete this wallet? - %d selected - An error has occurred, please scan your card to log in - This wallet has already been saved, you can add another one - Multi-currency - Wallet name - Rename Wallet - Single-currency - My Wallets - Unlock all with %s + + + + + + + + + + + + Crea PayString - Cerca indirizzo - Network is unreachable - Blockchain is unreachable. Try later + + + Il saldo sta per essere caricato… - Scan the card + Transazione in corso… Saldo verificato - Actions - Buy + + Crea portafoglio - Sell + Invia - Exchange - Do you want to buy or sell crypto? - Requesting to sign a message.\n\n%s - Dapp %1$s, requesting to\nsign BNB transaction.\n\n%2$s - Trade order for %1$s\nPrice: %2$s\nAmount to receive: %3$s\nAmount to pay: %4$s - Transaction details:\nFrom: %1$s\nTo: %2$s\nAmount: %3$s - Clipboard contain WalletConnect code. Use copied value or scan QR-code - Request to create transaction for %1$s\n%2$s\n\nAmount: %3$s\nFee: %4$s\nTotal: %5$s\nBalance: %6$s - Can\'t send transaction. Not enough funds. - Failed to establish WalletConnect session. Please, try again later. - Not all tokens were added to your list. Please add them first and try again. Missing tokens:\n - Failed to establish WalletConnect session: timeout error. Please, try again later. - Session request contains unsupported blockchains for WalletConnect connection. Unsupported blockchains:\n - Connection with this Dapp cannot be established due to its technical implementation. - We\'ve encountered unknown error. Error code: %d. If the problem persists — feel free to contact our support - %s network not found. Please, add it first and try again. - No opened WalletConnect sessions - Ooops. No Sessions. - Open session - Paste from clipboard - Request to start a session for\n%1$s\n\nNETWORK: %2$s\n\nURL: %3$s - The operation couldn\'t be completed.\n\nYou have already established a WalletConnect session with this parameters. - Scan new code - This card can\'t be used to establish WalletConnect session - This network is not supported. Please select another network. - Select network - WalletConnect Sessions - Connect to Dapps + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WalletConnect Crea PayString $payid.tangem.com @@ -440,11 +475,11 @@ Errore di risposta durante la creazione del PayString Nome PayString Il tuo PayString – informazioni per te uniche, come il tuo numero di telefono, indirizzo email o ABN. - %s network + Carta vuota Crea un portafoglio per iniziare ad utilizzare la tua carta Tangem - Create twin wallet - Generate wallet keys on both cards to start using your Twins + + Conto non creato Questa carta non è supportata La tua carta Tangem è stata creata per funzionare con un\'altra applicazione. Leggere il nome e le istruzioni sulla carta e installare l\'applicazione corretta @@ -455,28 +490,28 @@ Inviau su %s Tangem - Can be better - Learn more + + Ok, ho capito! - Really cool! - %1$s network has a concept of Existential Deposit. If your account drops below %2$s it will be deactivated and any remaining funds will be destroyed. - This card might be a production sample or counterfeit - Authenticity check failed - Important security information %s - There are only %s signatures available on this card. You must withdraw all of your funds. - How do you like Tangem? - One question - This card has signed transactions in the past - This is a Testnet card. Don\'t accept it as a payment. This card must only be used for testing and development purposes. - Discard - You have an interrupted backup. Do you want to resume? - Yes, resume - Discard - If you will discard the backup now, then you will have to reset the cards to factory settings to start over again - Resume backup - This is an irreversible action - Log in with %s - Scan card - Use %s or scan a card to access the app - Welcome back! + + + + + + + + + + + + + + + + + + + + + diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index f11b1ab441..98626211ff 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -27,6 +27,10 @@ Пожалуйста, отсканируйте карту Пожалуйста, попробуйте снова через 30 секунд или отсканируйте карту Слишком много попыток + Отключите эту опцию, если не хотите, чтобы эта карта использовалась для сброса кодов доступа на другие карты этого кошелька. Обратите внимание, сброс кода также не будет доступен на этой карте. + Использовать эту карту для сброса кода доступа на других картах в этом кошельке + Отключить возможность сброса кода доступа на этой карте или других картах этого кошелька + Восстановление кода доступа Сбросить Вы уверены, что хотите это сделать? Смена кода доступа @@ -36,6 +40,10 @@ Настройки карты Tangem Bot Чат + Оценить оператора + Отправить логи + Пожалуйста, выберите действие + Пожалуйста, оцените работу оператора Принять Добавить Внимание @@ -49,10 +57,13 @@ Копировать Создать Удалить + Отключено Отключить Готово Включить + Включено Ошибка + Импортировать Нет Ок Основная карта @@ -173,11 +184,15 @@ Давайте сгенерируем все ключи на вашей карте и создадим безопасный кошелек Создать кошелек Создать кошелек + Другие опции + Ваши ключи будут надежно сгенерированы внутри карты. Никакой seed-фразы, а это значит, что никто не может экспортировать или украсть ее. + Cоздавайте ключи приватно Ваша карта активирована и готова к использованию Успешно! В этом случае вам будет необходимо начать процесс заново. Вы хотите выйти из процесса активации? Подготовка + Другой кошелек уже был создан на карте, которую вы пытаетесь добавить. Хотите сбросить его и использовать карту для бэкапа? Подтвердите свою личность Верификация клиента Код доступа @@ -190,6 +205,20 @@ Бэкап карта не добавлена Бэкап карта создана Приготовьте SaltPay карту + Читать про секретную фразу + Запишите эти 12 слов в порядке, указанном ниже, и сохраните их в надежном месте. + Ваша секретная фраза + Чтобы импортировать кошелек, введите секретную фразу в поле ниже + Cоздать секретную фразу + Импорт кошелька + Секретная фраза — это набор слов, который дает возможность восстановить кошелек. В отличие от ключей, сгенерированных картой, seed-фраза не защищена и может быть скопирована и украдена. Используйте этот вариант на свой страх и риск. + Использовать секретную фразу + Неверная секретная фраза. Пожалуйста, проверьте порядок слов. + Неверная секретная фраза. Пожалуйста, проверьте орфографию. + Устаревший + Мы не рекомендуем хранить секретную фразу в виде скриншота из-за высокого риска утери или взлома + Чтобы проверить, правильно ли вы записали секретную фразу, введите 2-е, 7-е и 11-е слова + Итак, проверим Для начала работы просто запросите начисление wxDAI на свой кошелек Это займет несколько секунд Более подробная информация отправлена на ваш адрес электронной почты. @@ -359,6 +388,12 @@ Выберите токен Ваши токены не доступен + + %d токен + %d токена + %d токенов + %d токенов + Скрыть Вы скрываете токен с главного экрана, но в любой момент сможете добавить его обратно через страницу управления токенами. Скрыть %s diff --git a/core/res/src/main/res/values-zh-rTW/strings.xml b/core/res/src/main/res/values-zh-rTW/strings.xml index 4758954e64..5a67343132 100644 --- a/core/res/src/main/res/values-zh-rTW/strings.xml +++ b/core/res/src/main/res/values-zh-rTW/strings.xml @@ -27,6 +27,10 @@ 請掃描卡片 請30秒後重試或刷卡 嘗試次數過多 + 您將無法使用此卡重置訪問密碼 + 您將能夠使用此卡重置訪問密碼 + 啟用使用此卡重置您的錢包訪問密碼 + 恢復訪問密碼 重置 您確定要這麼做嗎? 更改訪問密碼 @@ -36,6 +40,10 @@ 卡片設置 Tangem 機器人 支援 + + + + 接受 添加 注意 @@ -49,10 +57,13 @@ 複製 創造 刪除 + 禁用 斷開連接 完成 允許 + 啟用 錯誤 + 導入 OK 主卡片 @@ -107,7 +118,7 @@ 發行人 發送反饋 簽署 - 細節 + 更多 檢查您的網路連接或切換到其他網絡 服務條款 糟糕,當前版本的應用程序無法使用此卡,請檢查更新 @@ -118,7 +129,7 @@ 告訴我們您缺少哪些功能,我們會盡力幫助您 請告訴我們你有什麼卡 嗨! 幫助團隊, - 請告訴我們更多有關您的問題的信息。提供任何小細節都會帶來幫助 + 請告訴我們更多有關您的問題。提供任何細節都會帶來幫助 我的建議 無法掃卡 反饋 @@ -132,6 +143,7 @@ 點擊簽名 點按卡片 內部錯誤:找不到錢包管理器 + 您已更新生物識別登入,掃描您的卡進入 管理代幣 為了保護您的資產,我們建議您執行此程序 您的錢包尚未備份 @@ -172,11 +184,15 @@ 讓我們生成您卡上的所有密鑰並創建一個安全的錢包 創建錢包 創造錢包 + 其他選項 + 您的密鑰將在卡內安全生成。沒有種子短語,這意味著沒有人可以導出或竊取它。 + 私下生成密鑰 您的卡已激活並可以使用 成功! 這此情況,您必須要重新開始 您想要離開啟用程序嗎? 開始 + 驗證身分 KYC PIN 碼 @@ -189,6 +205,20 @@ 沒有備份卡片 備份卡片已準備完成 準備SaltPay卡 + 閱讀更多關於助記詞的訊息 + 按照下面給出的順序寫下這 12 個單詞,並將它們存放在一個隱密、安全的地方 + 您的助記詞 + 要導入您的錢包,請在下面的字段中輸入您的秘密助記詞 + 生成助記詞 + 導入錢包 + 註記詞是一系列能夠恢復錢包的單詞。與卡片生成的密鑰不同,助記詞不受保護,可以被複製和竊取。使用此選項需要您自擔風險。 + 使用助記詞 + 無效的助記詞。請檢查單詞順序。 + 無效的助記詞。請檢查您的拼寫。 + Legacy + 由於丟失或被駭客入侵的風險很高,我們不建議將密碼截圖 + 為了檢查您是否正確輸入了助記詞,請輸入第 2、7 和 11 個單詞 + 那麼,讓我們檢查一下 要開始,只需將 wxDAI 獲取到您的錢包 這會花上幾秒 請查看Email已獲得更多指示 @@ -224,9 +254,9 @@ 充值你的錢包 結對過程已部分完成。你現在不能退出 如果創建錢包的過程以任何方式中斷,您將得重新開始 - 您最多可以備份另外兩張空白的 Tangem 錢包卡。 + 您最多可以額外備份兩張空白的 Tangem冷錢包 可以使用其中一張備用卡恢復訪問密碼 - 所有備用卡都可以使用相同的密鑰作為全功能使用。 + 所有備用卡都可以使用相同的密鑰作為全功能使用 您將能夠設置訪問密碼來保護您的錢包 備援錢包 訪問密碼還原 @@ -238,7 +268,7 @@ 無法處理您的請求。原因:%s。請稍後再試。無如果問題仍然存在—請隨時聯繫服務人員 您的朋友買 會得到 - 對於你的朋友在你的 %1$s 網絡地址%2$s 上購買的每個錢包 + 對於你的朋友在你的 %1$s 網絡地址%2$s上購買的每個錢包 得到 當在 tangem.com購買卡片 @@ -335,11 +365,11 @@ 錯誤: %s 有錯誤。請再試一遍 賦予權限 - High price impact! - Swapping this amount of selected tokens will cause a significant price impact and reduce your outcome. + 價格影響高! + 在此代幣交換的數量將對價格產生重大影響,並降低您收到的數量 餘額不足 您的 %1$s 錢包中沒有足夠的資金來創建交易。首先為您的 %2$s 錢包充值 - 交易進行中… + 交易進行中... 等待中 允許 賦予權限 @@ -351,13 +381,16 @@ 在瀏覽器中查看 進行中 交換 - Swap + 交易 交易 %s 至 - Quotes include an additional Tangem commission of %s. This helps us deliver a top-of-the-line product. + 此外,報價包括%s的 Tangem 費用。這有助於我們提供一流的產品 其他代幣 選擇代幣 您的代幣 無法使用 + + %d 代幣 + 隱藏 您即將在主屏幕上隱藏此代幣。您可以隨時通過管理代幣頁面將其添加回來。 隱藏 %s @@ -383,7 +416,7 @@ 添加新錢包 您確定要刪除此錢包? 已選擇 %d - An error has occurred, please scan your card to log in + 發生錯誤,請掃卡登錄 此錢包已保存,您可以再添加一個 多幣種 錢包名稱 @@ -418,9 +451,10 @@ 無法建立 WalletConnect 連接:超時錯誤。請稍後再試 會話請求包含不支持 WalletConnect 連接的區塊鏈。不支持的區塊鏈:\n 由於技術問題,無法與此 Dapp 建立連接 + 在 Tangem App 中選擇了錯誤的卡 我們遇到了未知錯誤。錯誤代碼:%d。如果問題仍然存在-請隨時聯繫我們的支持人員 沒有 %s 網路,請先加入後再試一次 - 沒有打開中的WalletConnect連接 + 沒有已連結的WalletConnect Ooops, 沒有連接 打開連接 從剪貼板貼上 @@ -462,7 +496,7 @@ %1$s 網絡有一個 Existential Deposit 的概念。如果您的帳戶低於 %2$s,它將被停用,所有剩餘資金將被銷毀 此卡可能是生產樣本或偽造品 認證檢查失敗 - 重要安全信息%s + 重要安全信息 %s 此卡上只有 %s 個簽名可用。您必須提取所有資金 你喜歡 Tangem 嗎? 一個問題 diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index e0e0ef5d5b..875d017a66 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -27,6 +27,10 @@ Please scan the card Please try again in 30 seconds or scan the card Too many attempts + Disable this option if you don\'t want this card to be used to reset access codes on other cards of this wallet. Note that you will not be able to reset access code on this card as well. + Allows you to use this card to reset access code on other cards in this wallet + Disable the ability to reset access code on this card or other cards in this wallet + Access code recovery Reset Are you sure you want to do this? Change Access Code @@ -36,6 +40,10 @@ Card Settings Tangem Bot Support + Rate operator + Send logs + Please select an action + Please, rate the work of the operator Accept Add Attention @@ -49,10 +57,13 @@ Copy Create Delete + Disabled Disconnect Done Enable + Enabled Error + Import No OK Primary Card @@ -173,11 +184,15 @@ Let\'s generate all the keys on your card and create a secure wallet Create wallet Create a wallet + Other options + Your keys will be securely generated inside the card. There is no seed phrase, which means nobody can export or steal it. + Generate keys privately Your card is activated and ready to be used Success! In this case, you will need to start from the beginning. Do you want to exit the activation process? Getting started + Another wallet has already been created on the card you\'re trying to add. Do you want to reset it and use the card for a new wallet? Verify your identity KYC Pin code @@ -190,6 +205,20 @@ No backup card Backup card ready Prepare the SaltPay card + Read more about seed phrases + Write these 12 words down in the order given below and store them in a safe and secret place. + Your secret phrase + To import your wallet, enter your secret phrase in the field below + Generate seed phrase + Import wallet + A secret phrase is a series of words that allows you to recover your wallet. Unlike the keys generated by the card, secret phrases are unprotected and can be copied and stolen. Use this option at your own risk. + Use seed phrase + Invalid secret phrase. Please check words order. + Invalid secret phrase. Please check your spelling. + Legacy + We do not recommend storing the passphrase as a screenshot due to the high risk of loss or hacking + To check whether you’ve written down your secret phrase correctly, please enter the 2nd, 7th and 11th words + So, let’s check To get started, simply claim wxDAI to your wallet It will take a few seconds Please check your email for further instructions @@ -354,11 +383,15 @@ Swap Swap Swap of %s to - Quotes include an additional Tangem commission of %s. This helps us deliver a top-of-the-line product. + Quotes include an additional Tangem commission of %s. This helps us deliver a top-of-the-line product Other tokens Choose token Your tokens not available + + %d token + %d tokens + Hide You are about to hide this token from the main screen. You can add it back anytime through the manage tokens page. Hide %s diff --git a/core/ui/src/main/java/com/tangem/core/ui/res/TangemDimens.kt b/core/ui/src/main/java/com/tangem/core/ui/res/TangemDimens.kt index 256d81f8e8..96c0d99ffc 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/res/TangemDimens.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/res/TangemDimens.kt @@ -85,6 +85,7 @@ data class TangemDimens internal constructor( val spacing28: Dp = 28.dp, val spacing32: Dp = 32.dp, val spacing34: Dp = 34.dp, + val spacing36: Dp = 34.dp, val spacing38: Dp = 38.dp, val spacing44: Dp = 44.dp, val spacing50: Dp = 50.dp, From b4e328a3d6787bca2d21c6138fca4f9cbc77a278 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 19 Apr 2023 20:38:04 +0300 Subject: [PATCH 03/68] Updated on 2026-08-14 --- .../main/java/com/tangem/tap/common/feedback/FeedbackManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/tangem/tap/common/feedback/FeedbackManager.kt b/app/src/main/java/com/tangem/tap/common/feedback/FeedbackManager.kt index 8de0b8e686..6fddf99607 100644 --- a/app/src/main/java/com/tangem/tap/common/feedback/FeedbackManager.kt +++ b/app/src/main/java/com/tangem/tap/common/feedback/FeedbackManager.kt @@ -25,7 +25,7 @@ class FeedbackManager( fun sendEmail(feedbackData: FeedbackData, onFail: ((Exception) -> Unit)? = null) { feedbackData.prepare(infoHolder) foregroundActivityObserver.withForegroundActivity { activity -> - val fileLog = if (feedbackData is ScanFailsEmail) createLogFile(activity) else null + val fileLog = createLogFile(activity) activity.sendEmail( email = getSupportEmail(), subject = activity.getString(feedbackData.subjectResId), From ee21ead663649abf26821522d74317f133f200ca Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 20 Apr 2023 15:04:20 +0300 Subject: [PATCH 04/68] Updated on 2026-08-14 --- .../walletconnect/WalletConnectSdkHelper.kt | 47 ++++++++++++++++--- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectSdkHelper.kt b/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectSdkHelper.kt index b963a290d4..5ccf53357d 100644 --- a/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectSdkHelper.kt +++ b/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectSdkHelper.kt @@ -63,26 +63,24 @@ class WalletConnectSdkHelper { val wallet = walletManager.wallet val balance = wallet.amounts[AmountType.Coin]?.value ?: return null - val gas = transaction.gas?.hexToBigDecimal() - ?: transaction.gasLimit?.hexToBigDecimal() - ?: BigDecimal(300000) // Set high gasLimit if not provided - val decimals = wallet.blockchain.decimals() val value = (transaction.value ?: "0").hexToBigDecimal() ?.movePointLeft(decimals) ?: return null + val gasLimit = getGasLimitFromTx(value, walletManager, transaction) + val gasPrice = transaction.gasPrice?.hexToBigDecimal() ?: when (val result = (walletManager as? EthereumGasLoader)?.getGasPrice()) { is Result.Success -> result.data.toBigDecimal() is Result.Failure -> { - (result.error as? Throwable)?.let { Timber.e(it) } + (result.error as? Throwable)?.let { Timber.e(it, "getGasPrice failed") } return null } null -> return null } - val fee = (gas * gasPrice).movePointLeft(decimals) + val fee = (gasLimit * gasPrice).movePointLeft(decimals) val total = value + fee val transactionData = TransactionData( @@ -92,7 +90,7 @@ class WalletConnectSdkHelper { destinationAddress = transaction.to!!, extras = EthereumTransactionExtras( data = transaction.data.removePrefix(HEX_PREFIX).hexToBytes(), - gasLimit = gas.toBigInteger(), + gasLimit = gasLimit.toBigInteger(), nonce = transaction.nonce?.hexToBigDecimal()?.toBigInteger(), ), ) @@ -139,6 +137,40 @@ class WalletConnectSdkHelper { } } + private suspend fun getGasLimitFromTx( + value: BigDecimal, + walletManager: WalletManager, + transaction: WCEthereumTransaction, + ): BigDecimal { + return transaction.gas?.hexToBigDecimal() + ?: transaction.gasLimit?.hexToBigDecimal() + ?: getGaLimitFromBlockchain( + value = value, + walletManager = walletManager, + transaction = transaction, + ) + } + + private suspend fun getGaLimitFromBlockchain( + value: BigDecimal, + walletManager: WalletManager, + transaction: WCEthereumTransaction, + ): BigDecimal { + val gasLimitResult = (walletManager as? EthereumGasLoader)?.getGasLimit( + amount = Amount(value, walletManager.wallet.blockchain), + destination = transaction.to ?: "", + data = transaction.data, + ) + return when (gasLimitResult) { + is Result.Success -> gasLimitResult.data.toBigDecimal().multiply(BigDecimal("1.2")) + is Result.Failure -> { + (gasLimitResult.error as? Throwable)?.let { Timber.e(it, "getGasLimit failed") } + BigDecimal(DEFAULT_MAX_GASLIMIT) // Set high gasLimit if not provided + } + else -> BigDecimal(DEFAULT_MAX_GASLIMIT) // Set high gasLimit if not provided + } + } + private suspend fun sendTransaction(data: WcTransactionData, cardId: String?): String? { val result = (data.walletManager as TransactionSender).send( transactionData = data.transaction, @@ -290,6 +322,7 @@ class WalletConnectSdkHelper { companion object { private const val ETH_MESSAGE_PREFIX = "\u0019Ethereum Signed Message:\n" private const val HEX_PREFIX = "0x" + private const val DEFAULT_MAX_GASLIMIT = 350000 fun getBnbResultString(publicKey: String, signature: String): String { return "{\"signature\":\"$signature\",\"publicKey\":\"$publicKey\"}" } From 8fbc4951c1b1f52adecd2ec694ca3b009ef4a698 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 20 Apr 2023 17:32:42 +0300 Subject: [PATCH 05/68] Updated on 2026-08-14 --- .../tap/features/wallet/ui/WalletFragment.kt | 39 ++++++++++++++++++- .../tap/features/wallet/ui/WalletViewModel.kt | 16 ++++---- .../AndroidNetworkConnectionManager.kt | 6 ++- .../connection/NetworkConnectionManager.kt | 5 +++ 4 files changed, 54 insertions(+), 12 deletions(-) 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 3bf4cd8b80..e6fb203abb 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 @@ -7,8 +7,12 @@ import android.view.MenuItem import android.view.View import androidx.activity.OnBackPressedCallback import androidx.appcompat.app.AppCompatActivity +import androidx.compose.runtime.mutableStateOf import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.flowWithLifecycle +import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import androidx.transition.TransitionInflater @@ -19,6 +23,7 @@ import com.badoo.mvicore.modelWatcher import com.tangem.core.analytics.Analytics import com.tangem.core.ui.fragments.setStatusBarColor import com.tangem.core.ui.utils.OneTouchClickListener +import com.tangem.datasource.connection.NetworkConnectionManager import com.tangem.feature.swap.api.SwapFeatureToggleManager import com.tangem.feature.swap.domain.SwapInteractor import com.tangem.tap.MainActivity @@ -47,6 +52,8 @@ import com.tangem.wallet.BuildConfig import com.tangem.wallet.R import com.tangem.wallet.databinding.FragmentWalletBinding import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.launch import javax.inject.Inject @AndroidEntryPoint @@ -58,6 +65,9 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), SafeStoreSubscriber state.select { it.walletState } } @@ -194,8 +208,7 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), SafeStoreSubscriber) { warningsAdapter.submitList(warnings) binding.rvWarningMessages.show(warnings.isNotEmpty()) @@ -215,13 +233,17 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), SafeStoreSubscriber + if (isOnline && isNetworkConnectionError.value) { + refreshWalletData() + } + } + } + } + override fun onOptionsItemSelected(item: MenuItem): Boolean { return when (item.itemId) { R.id.details_menu -> { diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletViewModel.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletViewModel.kt index bba9814685..25b09a2610 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletViewModel.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletViewModel.kt @@ -80,14 +80,6 @@ internal class WalletViewModel @Inject constructor( analyticsEventHandler.send(MainScreen.ScreenOpened()) } - private fun launch() { - val manager = store.state.globalState.userWalletsListManager - if (manager != null) { - bootstrapSelectedWalletStoresChanges(manager) - } - bootstrapShowSaveWalletIfNeeded() - } - fun onBalanceLoaded(totalBalance: TotalFiatBalance?) { if (totalBalance != null) { walletAnalyticsEventsMapper.convert(totalBalance)?.let { balanceParam -> @@ -100,6 +92,14 @@ internal class WalletViewModel @Inject constructor( } } + private fun launch() { + val manager = store.state.globalState.userWalletsListManager + if (manager != null) { + bootstrapSelectedWalletStoresChanges(manager) + } + bootstrapShowSaveWalletIfNeeded() + } + @OptIn(FlowPreview::class) private fun bootstrapSelectedWalletStoresChanges(manager: UserWalletsListManager) { observeWalletStoresUpdatesJob = manager.selectedUserWallet diff --git a/core/datasource/src/main/java/com/tangem/datasource/connection/AndroidNetworkConnectionManager.kt b/core/datasource/src/main/java/com/tangem/datasource/connection/AndroidNetworkConnectionManager.kt index 695dbce8bd..6581fbb384 100644 --- a/core/datasource/src/main/java/com/tangem/datasource/connection/AndroidNetworkConnectionManager.kt +++ b/core/datasource/src/main/java/com/tangem/datasource/connection/AndroidNetworkConnectionManager.kt @@ -15,6 +15,7 @@ import dagger.hilt.android.qualifiers.ApplicationContext import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch import timber.log.Timber import javax.inject.Inject @@ -35,12 +36,13 @@ internal class AndroidNetworkConnectionManager @Inject constructor( private val dispatchers: CoroutineDispatcherProvider, ) : NetworkConnectionManager { - override val isOnline: Boolean get() = _isOnline.value - private val _isOnline = MutableStateFlow(value = false) private val callbacks = NetworkConnectionManagerCallbacks() private val receiver = NetworkConnectionBroadcastReceiver() + override val isOnline: Boolean get() = _isOnline.value + override val isOnlineFlow: StateFlow = _isOnline + init { (context as? Application)?.registerActivityLifecycleCallbacks(callbacks) } diff --git a/core/datasource/src/main/java/com/tangem/datasource/connection/NetworkConnectionManager.kt b/core/datasource/src/main/java/com/tangem/datasource/connection/NetworkConnectionManager.kt index fa6faca57d..dc1c3e9051 100644 --- a/core/datasource/src/main/java/com/tangem/datasource/connection/NetworkConnectionManager.kt +++ b/core/datasource/src/main/java/com/tangem/datasource/connection/NetworkConnectionManager.kt @@ -1,8 +1,13 @@ package com.tangem.datasource.connection +import kotlinx.coroutines.flow.StateFlow + /** Network connection manager */ interface NetworkConnectionManager { /** Connection status */ val isOnline: Boolean + + /** Connection status flow */ + val isOnlineFlow: StateFlow } \ No newline at end of file From faa4ee808b94f9ef0929675ca65990010e3dac0f Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 17 Apr 2023 00:21:38 +0400 Subject: [PATCH 06/68] Updated on 2026-08-14 --- .../tap/common/analytics/events/AnalyticsParam.kt | 14 ++++++++++++++ .../tangem/tap/common/analytics/events/Settings.kt | 7 +++++++ .../features/details/redux/DetailsMiddleware.kt | 6 ++++++ 3 files changed, 27 insertions(+) diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/AnalyticsParam.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/AnalyticsParam.kt index 8bbf95d217..05fd6ae43c 100644 --- a/app/src/main/java/com/tangem/tap/common/analytics/events/AnalyticsParam.kt +++ b/app/src/main/java/com/tangem/tap/common/analytics/events/AnalyticsParam.kt @@ -59,6 +59,20 @@ sealed class AnalyticsParam { } } + sealed class AccessCodeRecoveryStatus(val value: String) { + + val key: String = "Status" + + object Enabled : AccessCodeRecoveryStatus("Enabled") + object Disabled : AccessCodeRecoveryStatus("Disabled") + + companion object { + fun from(enabled: Boolean): AccessCodeRecoveryStatus { + return if (enabled) Enabled else Disabled + } + } + } + sealed class Error(val value: String) { object App : Error("App Error") object CardSdk : Error("Card Sdk Error") diff --git a/app/src/main/java/com/tangem/tap/common/analytics/events/Settings.kt b/app/src/main/java/com/tangem/tap/common/analytics/events/Settings.kt index 8a2fceadaf..5a9226bec4 100644 --- a/app/src/main/java/com/tangem/tap/common/analytics/events/Settings.kt +++ b/app/src/main/java/com/tangem/tap/common/analytics/events/Settings.kt @@ -53,6 +53,13 @@ sealed class Settings( params = mapOf("Mode" to mode.value), error = error, ) + + class AccessCodeRecoveryButton : CardSettings("Button - Access Code Recovery") + + class AccessCodeRecoveryChanged(status: AnalyticsParam.AccessCodeRecoveryStatus) : CardSettings( + event = "Access Code Recovery Changed", + params = mapOf(status.key to status.value), + ) } sealed class AppSettings( diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt index fb04d4aa57..9b24d5746a 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt @@ -425,6 +425,7 @@ class DetailsMiddleware { fun handle(state: DetailsState, action: DetailsAction.AccessCodeRecovery) { when (action) { is DetailsAction.AccessCodeRecovery.Open -> { + Analytics.send(Settings.CardSettings.AccessCodeRecoveryButton()) store.dispatch(NavigationAction.NavigateTo(AppScreen.AccessCodeRecovery)) } is DetailsAction.AccessCodeRecovery.SaveChanges -> { @@ -432,6 +433,11 @@ class DetailsMiddleware { tangemSdkManager .setAccessCodeRecoveryEnabled(state.cardSettingsState?.card?.cardId, action.enabled) .doOnSuccess { + Analytics.send( + Settings.CardSettings.AccessCodeRecoveryChanged( + AnalyticsParam.AccessCodeRecoveryStatus.from(action.enabled), + ), + ) store.dispatchOnMain(NavigationAction.PopBackTo()) store.dispatchOnMain( DetailsAction.AccessCodeRecovery.SaveChanges.Success(action.enabled), From 025fc498a3fdd9ffcf3e1b57937ba9e65b152bbd Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 21 Apr 2023 11:04:10 +0500 Subject: [PATCH 07/68] Updated on 2026-08-14 --- app/src/main/assets/testnet_tokens.json | 11 ++++++++++ .../tap/common/extensions/Blockchain.kt | 1 + .../res/drawable/ic_ravencoin_no_color.xml | 21 +++++++++++++++++++ .../core/ui/extensions/BlockchainIcons.kt | 2 ++ .../main/res/drawable/img_ravencoin_22.xml | 21 +++++++++++++++++++ .../domain/common/extensions/Blockchain.kt | 5 +++++ gradle/dependencies.toml | 2 +- 7 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/ic_ravencoin_no_color.xml create mode 100644 core/ui/src/main/res/drawable/img_ravencoin_22.xml diff --git a/app/src/main/assets/testnet_tokens.json b/app/src/main/assets/testnet_tokens.json index 1e44bd5dfd..d36455384c 100644 --- a/app/src/main/assets/testnet_tokens.json +++ b/app/src/main/assets/testnet_tokens.json @@ -473,6 +473,17 @@ "networkId": "kava/test" } ] + }, + { + "id": "ravencoin", + "symbol": "RVN", + "name": "Ravencoin", + "networks": + [ + { + "networkId": "ravencoin/test" + } + ] } ] } diff --git a/app/src/main/java/com/tangem/tap/common/extensions/Blockchain.kt b/app/src/main/java/com/tangem/tap/common/extensions/Blockchain.kt index c8b2e0e8d2..5aae0ce706 100644 --- a/app/src/main/java/com/tangem/tap/common/extensions/Blockchain.kt +++ b/app/src/main/java/com/tangem/tap/common/extensions/Blockchain.kt @@ -39,6 +39,7 @@ fun Blockchain.getGreyedOutIconRes(): Int { Blockchain.Kaspa -> R.drawable.ic_kaspa_no_color Blockchain.TON, Blockchain.TONTestnet -> R.drawable.ic_ton_no_color Blockchain.Kava, Blockchain.KavaTestnet -> R.drawable.ic_kava_no_color + Blockchain.Ravencoin, Blockchain.RavencoinTestnet -> R.drawable.ic_ravencoin_no_color else -> R.drawable.ic_tangem_logo } } diff --git a/app/src/main/res/drawable/ic_ravencoin_no_color.xml b/app/src/main/res/drawable/ic_ravencoin_no_color.xml new file mode 100644 index 0000000000..5bc49c57cf --- /dev/null +++ b/app/src/main/res/drawable/ic_ravencoin_no_color.xml @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/core/ui/src/main/java/com/tangem/core/ui/extensions/BlockchainIcons.kt b/core/ui/src/main/java/com/tangem/core/ui/extensions/BlockchainIcons.kt index 2c13836580..d760b3a96b 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/extensions/BlockchainIcons.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/extensions/BlockchainIcons.kt @@ -35,6 +35,7 @@ fun getActiveIconRes(blockchainId: String): Int { "KAS" -> R.drawable.img_kaspa_22 "The-Open-Network", "The-Open-Network/test" -> R.drawable.img_ton_22 "KAVA", "KAVA/test" -> R.drawable.img_kava_22 + "ravencoin", "ravencoin/test" -> R.drawable.img_ravencoin_22 else -> R.drawable.ic_alert_24 } } @@ -76,6 +77,7 @@ fun getActiveIconResByCoinId(coinId: String, networkId: String): Int { "kaspa" -> R.drawable.img_kaspa_22 "ton" -> R.drawable.img_ton_22 "kava" -> R.drawable.img_kava_22 + "ravencoin" -> R.drawable.img_ravencoin_22 else -> R.drawable.ic_alert_24 } } \ No newline at end of file diff --git a/core/ui/src/main/res/drawable/img_ravencoin_22.xml b/core/ui/src/main/res/drawable/img_ravencoin_22.xml new file mode 100644 index 0000000000..49c47eb9da --- /dev/null +++ b/core/ui/src/main/res/drawable/img_ravencoin_22.xml @@ -0,0 +1,21 @@ + + + + + + + + + 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 40bb83cc64..fe9b1dfc51 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 @@ -54,6 +54,8 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? { "the-open-network/test" -> Blockchain.TONTestnet "kava" -> Blockchain.Kava "kava/test" -> Blockchain.KavaTestnet + "ravencoin" -> Blockchain.Ravencoin + "ravencoin/test" -> Blockchain.RavencoinTestnet else -> null } } @@ -112,6 +114,8 @@ fun Blockchain.toNetworkId(): String { Blockchain.TONTestnet -> "the-open-network/test" Blockchain.Kava -> "kava" Blockchain.KavaTestnet -> "kava/test" + Blockchain.Ravencoin -> "ravencoin" + Blockchain.RavencoinTestnet -> "ravencoin/test" } } @@ -149,6 +153,7 @@ fun Blockchain.toCoinId(): String { Blockchain.TON, Blockchain.TONTestnet -> "the-open-network" Blockchain.Unknown -> "unknown" Blockchain.Kava, Blockchain.KavaTestnet -> "kava" + Blockchain.Ravencoin, Blockchain.RavencoinTestnet -> "ravencoin" } } diff --git a/gradle/dependencies.toml b/gradle/dependencies.toml index 9e76b50534..db5dc2a6f6 100644 --- a/gradle/dependencies.toml +++ b/gradle/dependencies.toml @@ -71,7 +71,7 @@ kotlinSerialization = "1.4.1" # endregion Other libraries # region Tangem -tangemBlockchainSdk = "develop-203" +tangemBlockchainSdk = "develop-204" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds tangemCardSdk = "develop-218" # tangemCardSdk = "0.0.1" # Keep it! - used for local builds From b05e10db566c6f6e84b1f616524b59d1dc5d469c Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 19 Apr 2023 17:39:44 +0300 Subject: [PATCH 08/68] Updated on 2026-08-14 --- app/build.gradle.kts | 3 +- .../CardContextInterceptor.kt | 5 +- .../LinkedCardContextInterceptor.kt | 2 +- .../common/analytics/topup/TopUpController.kt | 3 +- .../tangem/tap/common/extensions/Analytics.kt | 2 +- .../common/feedback/AdditionalFeedbackInfo.kt | 4 +- .../AccessCodeRequestPolicyMiddleware.kt | 2 +- .../tap/common/redux/global/GlobalAction.kt | 2 +- .../common/redux/global/GlobalMiddleware.kt | 7 ++- .../tap/common/redux/global/GlobalState.kt | 2 +- .../com/tangem/tap/domain/TangemSdkManager.kt | 10 +-- .../com/tangem/tap/domain/TangemSigner.kt | 2 +- .../com/tangem/tap/domain/TapWalletManager.kt | 3 +- .../com/tangem/tap/domain/extensions/Card.kt | 2 +- .../domain/extensions/WalletManagerFactory.kt | 5 +- .../com/tangem/tap/domain/model/UserWallet.kt | 2 +- .../model/builders/UserWalletBuilder.kt | 7 ++- .../model/builders/UserWalletIdBuilder.kt | 6 +- .../model/builders/WalletStoreBuilder.kt | 1 + .../tap/domain/scanCard/ScanCardProcessor.kt | 4 +- .../tasks/product/CreateProductWalletTask.kt | 4 +- .../tasks/product/ProductCommandProcessor.kt | 2 +- .../domain/tasks/product/ScanProductTask.kt | 6 +- .../tap/domain/tokens/CurrenciesRepository.kt | 2 +- .../tap/domain/tokens/UserTokensRepository.kt | 2 +- .../domain/tokens/models/BlockchainNetwork.kt | 2 +- .../tap/domain/twins/FinalizeTwinTask.kt | 2 +- .../tap/domain/twins/TwinCardsManager.kt | 4 +- .../model/UserWalletInformation.kt | 4 +- .../utils/UserWalletEncyptionKeyCalculator.kt | 2 +- .../utils/json/CardBackupStatusAdapter.kt | 2 +- .../DefaultWalletCurrenciesManager.kt | 2 +- .../DefaultWalletAmountsRepository.kt | 3 +- .../DefaultWalletManagersRepository.kt | 7 ++- .../walletconnect/WalletConnectManager.kt | 2 +- .../tangem/tap/features/demo/DemoHelper.kt | 2 +- .../demo/DemoOnboardingNoteMiddleware.kt | 2 +- .../tangem/tap/features/demo/Extentions.kt | 4 +- .../features/details/redux/DetailsAction.kt | 4 +- .../details/redux/DetailsMiddleware.kt | 3 +- .../features/details/redux/DetailsReducer.kt | 3 +- .../features/details/redux/DetailsState.kt | 4 +- .../walletconnect/WalletConnectAction.kt | 2 +- .../walletconnect/WalletConnectMiddleware.kt | 5 +- .../redux/walletconnect/WalletConnectState.kt | 2 +- .../details/ui/details/DetailsViewModel.kt | 1 + .../tap/features/disclaimer/DisclaimerType.kt | 2 +- .../tap/features/home/redux/HomeMiddleware.kt | 2 +- .../features/onboarding/OnboardingHelper.kt | 6 +- .../features/onboarding/OnboardingManager.kt | 2 +- .../onboarding/OnboardingSaltPayHelper.kt | 2 +- .../redux/OnboardingOtherCardsMiddleware.kt | 1 + .../products/twins/redux/TwinCardsAction.kt | 2 +- .../twins/redux/TwinCardsMiddleware.kt | 3 +- .../products/twins/redux/TwinCardsReducer.kt | 1 + .../products/twins/redux/TwinCardsState.kt | 2 +- .../products/twins/ui/TwinsCardsFragment.kt | 2 +- .../redux/OnboardingWalletMiddleware.kt | 5 +- .../wallet/redux/OnboardingWalletReducer.kt | 1 + .../saltPay/SaltPayActivationManager.kt | 2 +- .../saveWallet/redux/SaveWalletAction.kt | 2 +- .../saveWallet/redux/SaveWalletState.kt | 2 +- .../send/redux/middlewares/SendMiddleware.kt | 2 +- .../domain/DefaultTokensListInteractor.kt | 3 +- .../tokens/legacy/redux/TokensAction.kt | 2 +- .../tokens/legacy/redux/TokensMiddleware.kt | 4 +- .../tokens/legacy/redux/TokensState.kt | 2 +- .../tap/features/wallet/redux/WalletState.kt | 1 + .../redux/middlewares/WarningsMiddleware.kt | 5 +- .../wallet/redux/reducers/WalletReducer.kt | 2 +- .../tap/features/wallet/ui/WalletFragment.kt | 1 + .../tap/features/wallet/ui/WalletViewModel.kt | 1 + .../redux/WalletSelectorMiddleware.kt | 2 +- .../redux/WalletSelectorReducer.kt | 3 +- .../welcome/redux/WelcomeMiddleware.kt | 2 +- .../exchangeServices/BuyExchangeService.kt | 2 +- .../exchangeServices/CardExchangeRules.kt | 2 +- .../CurrencyExchangeManager.kt | 2 +- .../com/tangem/tap/proxy/AppStateHolder.kt | 4 +- .../tangem/tap/proxy/DerivationManagerImpl.kt | 3 +- domain/{ => legacy}/.gitignore | 0 domain/{ => legacy}/build.gradle.kts | 1 + domain/{ => legacy}/proguard-rules.pro | 0 .../features/ExampleInstrumentedTest.kt | 0 .../{ => legacy}/src/main/AndroidManifest.xml | 0 .../java/com/tangem/domain/DomainDialog.kt | 0 .../java/com/tangem/domain/DomainLayer.kt | 0 .../com/tangem/domain/DomainModuleMessage.kt | 0 .../java/com/tangem/domain/DomainWrapped.kt | 0 .../tangem/domain/common/CardTypesResolver.kt | 0 .../com/tangem/domain/common/LogConfig.kt | 0 .../tangem/domain/common/SaltPayWorkaround.kt | 0 .../domain/common/TangemCardTypesResolver.kt | 6 +- .../tangem/domain/common/TapWorkarounds.kt | 1 + .../com/tangem/domain/common/Throttling.kt | 0 .../com/tangem/domain/common/TwinsHelper.kt | 1 + .../tangem/domain/common/demo/DemoConfig.kt | 0 .../domain/common/extensions/Blockchain.kt | 0 .../domain/common/extensions/ByteArray.kt | 0 .../domain/common/extensions/CardSdk.kt | 2 +- .../domain/common/extensions/Coroutine.kt | 0 .../domain/common/extensions/ResultCardSdk.kt | 0 .../domain/common/form/FieldDataConverters.kt | 0 .../domain/common/form/FieldsValidators.kt | 0 .../com/tangem/domain/common/form/Form.kt | 0 .../common/util/ScanResponseExtensions.kt | 47 ++++++++++++++ .../tangem/domain/common/util/UserWalletId.kt | 0 .../domain/common/util/ValueDebouncer.kt | 0 .../addCustomToken/AddCustomTokenService.kt | 0 .../features/addCustomToken/CustomCurrency.kt | 0 .../features/addCustomToken/FormFields.kt | 0 .../redux/AddCustomTokenAction.kt | 0 .../addCustomToken/redux/AddCustomTokenHub.kt | 0 .../redux/AddCustomTokenState.kt | 2 +- .../features/addCustomToken/redux/Models.kt | 0 .../com/tangem/domain/redux/DomainState.kt | 0 .../com/tangem/domain/redux/DomainStore.kt | 0 .../com/tangem/domain/redux/ReStoreHub.kt | 0 .../domain/redux/extensions/Dispatch.kt | 0 .../domain/redux/global/DomainGlobalAction.kt | 2 +- .../domain/redux/global/DomainGlobalHub.kt | 0 .../domain/redux/global/DomainGlobalState.kt | 2 +- .../domain/redux/state/StateConverter.kt | 0 .../tangem/domain/redux/state/StateLogger.kt | 0 .../tangem/domain/features/BlockchainTests.kt | 0 domain/models/.gitignore | 1 + domain/models/build.gradle.kts | 9 +++ .../com/tangem/domain/models/scan}/CardDTO.kt | 4 +- .../tangem/domain/models/scan/ScanResponse.kt | 24 +++++++ .../java/com/tangem/domain/common/CardInfo.kt | 14 ----- .../com/tangem/domain/common/ScanResponse.kt | 63 ------------------- settings.gradle.kts | 9 ++- 132 files changed, 231 insertions(+), 189 deletions(-) rename domain/{ => legacy}/.gitignore (100%) rename domain/{ => legacy}/build.gradle.kts (96%) rename domain/{ => legacy}/proguard-rules.pro (100%) rename domain/{ => legacy}/src/androidTest/java/com/tangem/domain/features/ExampleInstrumentedTest.kt (100%) rename domain/{ => legacy}/src/main/AndroidManifest.xml (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/DomainDialog.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/DomainLayer.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/DomainModuleMessage.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/DomainWrapped.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/CardTypesResolver.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/LogConfig.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/SaltPayWorkaround.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/TangemCardTypesResolver.kt (97%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/TapWorkarounds.kt (98%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/Throttling.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/TwinsHelper.kt (97%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/demo/DemoConfig.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/extensions/ByteArray.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/extensions/CardSdk.kt (96%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/extensions/Coroutine.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/extensions/ResultCardSdk.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/form/FieldDataConverters.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/form/FieldsValidators.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/form/Form.kt (100%) create mode 100644 domain/legacy/src/main/java/com/tangem/domain/common/util/ScanResponseExtensions.kt rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/util/UserWalletId.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/common/util/ValueDebouncer.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/features/addCustomToken/AddCustomTokenService.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/features/addCustomToken/CustomCurrency.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/features/addCustomToken/FormFields.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenAction.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenHub.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenState.kt (99%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/features/addCustomToken/redux/Models.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/redux/DomainState.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/redux/DomainStore.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/redux/ReStoreHub.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/redux/extensions/Dispatch.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/redux/global/DomainGlobalAction.kt (88%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/redux/global/DomainGlobalHub.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/redux/global/DomainGlobalState.kt (93%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/redux/state/StateConverter.kt (100%) rename domain/{ => legacy}/src/main/java/com/tangem/domain/redux/state/StateLogger.kt (100%) rename domain/{ => legacy}/src/test/java/com/tangem/domain/features/BlockchainTests.kt (100%) create mode 100644 domain/models/.gitignore create mode 100644 domain/models/build.gradle.kts rename domain/{src/main/java/com/tangem/domain/common => models/src/main/kotlin/com/tangem/domain/models/scan}/CardDTO.kt (99%) create mode 100644 domain/models/src/main/kotlin/com/tangem/domain/models/scan/ScanResponse.kt delete mode 100644 domain/src/main/java/com/tangem/domain/common/CardInfo.kt delete mode 100644 domain/src/main/java/com/tangem/domain/common/ScanResponse.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f3691ec571..1655f303f0 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -11,7 +11,8 @@ plugins { dependencies { implementation(files("libs/walletconnect-1.5.6.aar")) - implementation(project(":domain")) + implementation(project(":domain:legacy")) + implementation(project(":domain:models")) implementation(project(":common")) implementation(project(":core:analytics")) implementation(project(":core:featuretoggles")) diff --git a/app/src/main/java/com/tangem/tap/common/analytics/paramsInterceptor/CardContextInterceptor.kt b/app/src/main/java/com/tangem/tap/common/analytics/paramsInterceptor/CardContextInterceptor.kt index 5c087a4f20..0f9b7c6bc1 100644 --- a/app/src/main/java/com/tangem/tap/common/analytics/paramsInterceptor/CardContextInterceptor.kt +++ b/app/src/main/java/com/tangem/tap/common/analytics/paramsInterceptor/CardContextInterceptor.kt @@ -2,8 +2,9 @@ package com.tangem.tap.common.analytics.paramsInterceptor import com.tangem.core.analytics.AnalyticsEvent import com.tangem.core.analytics.api.ParamsInterceptor -import com.tangem.domain.common.ProductType -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ProductType +import com.tangem.domain.common.util.cardTypesResolver +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.analytics.converters.ParamCardCurrencyConverter import com.tangem.tap.common.analytics.events.AnalyticsParam import com.tangem.tap.common.analytics.events.IntroductionProcess diff --git a/app/src/main/java/com/tangem/tap/common/analytics/paramsInterceptor/LinkedCardContextInterceptor.kt b/app/src/main/java/com/tangem/tap/common/analytics/paramsInterceptor/LinkedCardContextInterceptor.kt index 9dcfd80714..94c006d699 100644 --- a/app/src/main/java/com/tangem/tap/common/analytics/paramsInterceptor/LinkedCardContextInterceptor.kt +++ b/app/src/main/java/com/tangem/tap/common/analytics/paramsInterceptor/LinkedCardContextInterceptor.kt @@ -2,7 +2,7 @@ package com.tangem.tap.common.analytics.paramsInterceptor import com.tangem.core.analytics.AnalyticsEvent import com.tangem.core.analytics.api.ParamsInterceptor -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse /** [REDACTED_AUTHOR] diff --git a/app/src/main/java/com/tangem/tap/common/analytics/topup/TopUpController.kt b/app/src/main/java/com/tangem/tap/common/analytics/topup/TopUpController.kt index 2435646fed..30caf9f355 100644 --- a/app/src/main/java/com/tangem/tap/common/analytics/topup/TopUpController.kt +++ b/app/src/main/java/com/tangem/tap/common/analytics/topup/TopUpController.kt @@ -4,8 +4,9 @@ import com.tangem.common.extensions.guard import com.tangem.common.extensions.isZero import com.tangem.core.analytics.Analytics import com.tangem.domain.common.CardTypesResolver -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.domain.common.util.UserWalletId +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.analytics.converters.TopUpEventConverter import com.tangem.tap.common.analytics.events.AnalyticsParam import com.tangem.tap.common.extensions.copy diff --git a/app/src/main/java/com/tangem/tap/common/extensions/Analytics.kt b/app/src/main/java/com/tangem/tap/common/extensions/Analytics.kt index 8d3ce8e5ad..8e79d07381 100644 --- a/app/src/main/java/com/tangem/tap/common/extensions/Analytics.kt +++ b/app/src/main/java/com/tangem/tap/common/extensions/Analytics.kt @@ -1,7 +1,7 @@ package com.tangem.tap.common.extensions import com.tangem.core.analytics.Analytics -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.analytics.paramsInterceptor.LinkedCardContextInterceptor /** diff --git a/app/src/main/java/com/tangem/tap/common/feedback/AdditionalFeedbackInfo.kt b/app/src/main/java/com/tangem/tap/common/feedback/AdditionalFeedbackInfo.kt index c6f5bafd0a..7d138f1610 100644 --- a/app/src/main/java/com/tangem/tap/common/feedback/AdditionalFeedbackInfo.kt +++ b/app/src/main/java/com/tangem/tap/common/feedback/AdditionalFeedbackInfo.kt @@ -8,8 +8,8 @@ import com.tangem.blockchain.common.Token import com.tangem.blockchain.common.Wallet import com.tangem.blockchain.common.WalletManager import com.tangem.blockchain.common.address.Address -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.extensions.stripZeroPlainString import com.tangem.tap.domain.model.builders.UserWalletIdBuilder diff --git a/app/src/main/java/com/tangem/tap/common/redux/AccessCodeRequestPolicyMiddleware.kt b/app/src/main/java/com/tangem/tap/common/redux/AccessCodeRequestPolicyMiddleware.kt index e9aaabfd70..a96f1c1e06 100644 --- a/app/src/main/java/com/tangem/tap/common/redux/AccessCodeRequestPolicyMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/common/redux/AccessCodeRequestPolicyMiddleware.kt @@ -1,6 +1,6 @@ package com.tangem.tap.common.redux -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.redux.global.GlobalAction import com.tangem.tap.preferencesStorage import com.tangem.tap.tangemSdkManager diff --git a/app/src/main/java/com/tangem/tap/common/redux/global/GlobalAction.kt b/app/src/main/java/com/tangem/tap/common/redux/global/GlobalAction.kt index a140fb2d0c..f589ca6743 100644 --- a/app/src/main/java/com/tangem/tap/common/redux/global/GlobalAction.kt +++ b/app/src/main/java/com/tangem/tap/common/redux/global/GlobalAction.kt @@ -6,7 +6,7 @@ import com.tangem.common.CompletionResult import com.tangem.common.core.TangemError import com.tangem.datasource.config.ConfigManager import com.tangem.datasource.config.models.ChatConfig -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.analytics.topup.TopUpController import com.tangem.tap.common.entities.FiatCurrency import com.tangem.tap.common.feedback.FeedbackData diff --git a/app/src/main/java/com/tangem/tap/common/redux/global/GlobalMiddleware.kt b/app/src/main/java/com/tangem/tap/common/redux/global/GlobalMiddleware.kt index 5d99c5357e..39d29a451f 100644 --- a/app/src/main/java/com/tangem/tap/common/redux/global/GlobalMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/common/redux/global/GlobalMiddleware.kt @@ -4,11 +4,12 @@ import com.tangem.common.CompletionResult import com.tangem.common.core.TangemSdkError import com.tangem.common.extensions.guard import com.tangem.datasource.config.models.Config -import com.tangem.domain.common.CardDTO import com.tangem.domain.common.LogConfig -import com.tangem.domain.common.ProductType -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.domain.common.extensions.withMainContext +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ProductType +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.extensions.dispatchDebugErrorNotification import com.tangem.tap.common.extensions.dispatchDialogShow import com.tangem.tap.common.extensions.dispatchOnMain diff --git a/app/src/main/java/com/tangem/tap/common/redux/global/GlobalState.kt b/app/src/main/java/com/tangem/tap/common/redux/global/GlobalState.kt index 1d6dddf647..c9f2314efc 100644 --- a/app/src/main/java/com/tangem/tap/common/redux/global/GlobalState.kt +++ b/app/src/main/java/com/tangem/tap/common/redux/global/GlobalState.kt @@ -1,7 +1,7 @@ package com.tangem.tap.common.redux.global import com.tangem.datasource.config.ConfigManager -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.analytics.topup.TopUpController import com.tangem.tap.common.entities.FiatCurrency import com.tangem.tap.common.feedback.FeedbackManager diff --git a/app/src/main/java/com/tangem/tap/domain/TangemSdkManager.kt b/app/src/main/java/com/tangem/tap/domain/TangemSdkManager.kt index 3dcacf1eef..c0ffba9893 100644 --- a/app/src/main/java/com/tangem/tap/domain/TangemSdkManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/TangemSdkManager.kt @@ -22,9 +22,9 @@ import com.tangem.common.map import com.tangem.common.usersCode.UserCodeRepository import com.tangem.core.analytics.Analytics import com.tangem.crypto.hdWallet.DerivationPath -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse -import com.tangem.operations.CommandResponse +import com.tangem.domain.common.util.cardTypesResolver +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse import com.tangem.operations.ScanTask import com.tangem.operations.derivation.DerivationTaskResponse import com.tangem.operations.derivation.DeriveMultipleWalletPublicKeysTask @@ -194,7 +194,7 @@ class TangemSdkManager(private val tangemSdk: TangemSdk, private val context: Co .map { CardDTO(it) } } - suspend fun runTaskAsync( + suspend fun runTaskAsync( runnable: CardSessionRunnable, cardId: String? = null, initialMessage: Message? = null, @@ -207,7 +207,7 @@ class TangemSdkManager(private val tangemSdk: TangemSdk, private val context: Co } } - private suspend fun runTaskAsyncReturnOnMain( + private suspend fun runTaskAsyncReturnOnMain( runnable: CardSessionRunnable, cardId: String? = null, initialMessage: Message? = null, diff --git a/app/src/main/java/com/tangem/tap/domain/TangemSigner.kt b/app/src/main/java/com/tangem/tap/domain/TangemSigner.kt index 196ec2f0f4..f8361ffae1 100644 --- a/app/src/main/java/com/tangem/tap/domain/TangemSigner.kt +++ b/app/src/main/java/com/tangem/tap/domain/TangemSigner.kt @@ -5,7 +5,7 @@ import com.tangem.TangemSdk import com.tangem.blockchain.common.TransactionSigner import com.tangem.blockchain.common.Wallet import com.tangem.common.CompletionResult -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.tap.domain.tasks.SignHashesTask import kotlinx.coroutines.suspendCancellableCoroutine import kotlin.coroutines.resume 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 449192d23a..65d3bd507f 100644 --- a/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt @@ -9,8 +9,9 @@ import com.tangem.common.doOnFailure import com.tangem.common.doOnSuccess import com.tangem.core.analytics.Analytics import com.tangem.datasource.config.ConfigManager -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.domain.common.extensions.withMainContext +import com.tangem.domain.models.scan.ScanResponse import com.tangem.operations.attestation.Attestation import com.tangem.tap.common.analytics.events.Basic import com.tangem.tap.common.extensions.dispatchOnMain 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 005f05500c..19bbc1ae52 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 @@ -3,7 +3,7 @@ package com.tangem.tap.domain.extensions import com.tangem.common.card.FirmwareVersion import com.tangem.common.extensions.toHexString import com.tangem.common.services.Result -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.common.TapWorkarounds.isSaltPay import com.tangem.domain.common.TwinCardNumber import com.tangem.domain.common.getTwinCardNumber 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 b2dbd64995..a9de7cb47a 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 @@ -9,10 +9,11 @@ import com.tangem.common.card.EllipticCurve import com.tangem.common.extensions.hexToBytes import com.tangem.common.extensions.toMapKey import com.tangem.crypto.hdWallet.DerivationPath -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse import com.tangem.domain.common.TapWorkarounds.isTestCard import com.tangem.domain.common.TapWorkarounds.useOldStyleDerivation +import com.tangem.domain.common.util.cardTypesResolver +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.domain.tokens.models.BlockchainNetwork import com.tangem.tap.features.wallet.models.Currency diff --git a/app/src/main/java/com/tangem/tap/domain/model/UserWallet.kt b/app/src/main/java/com/tangem/tap/domain/model/UserWallet.kt index a76fbb9d1a..d58a3e7122 100644 --- a/app/src/main/java/com/tangem/tap/domain/model/UserWallet.kt +++ b/app/src/main/java/com/tangem/tap/domain/model/UserWallet.kt @@ -1,6 +1,6 @@ package com.tangem.tap.domain.model -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.util.UserWalletId /** diff --git a/app/src/main/java/com/tangem/tap/domain/model/builders/UserWalletBuilder.kt b/app/src/main/java/com/tangem/tap/domain/model/builders/UserWalletBuilder.kt index 3a82b45171..3cc1d2e5f5 100644 --- a/app/src/main/java/com/tangem/tap/domain/model/builders/UserWalletBuilder.kt +++ b/app/src/main/java/com/tangem/tap/domain/model/builders/UserWalletBuilder.kt @@ -1,9 +1,10 @@ package com.tangem.tap.domain.model.builders -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ProductType -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ProductType +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.TapWorkarounds.isStart2Coin +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.tap.domain.model.UserWallet import com.tangem.tap.domain.userWalletList.GetCardImageUseCase diff --git a/app/src/main/java/com/tangem/tap/domain/model/builders/UserWalletIdBuilder.kt b/app/src/main/java/com/tangem/tap/domain/model/builders/UserWalletIdBuilder.kt index 70b7f005b5..68626b34eb 100644 --- a/app/src/main/java/com/tangem/tap/domain/model/builders/UserWalletIdBuilder.kt +++ b/app/src/main/java/com/tangem/tap/domain/model/builders/UserWalletIdBuilder.kt @@ -3,9 +3,9 @@ package com.tangem.tap.domain.model.builders import com.tangem.common.extensions.calculateSha256 import com.tangem.common.extensions.hexToBytes import com.tangem.crypto.Secp256k1 -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ProductType -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ProductType +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.TapWorkarounds.isTangemTwins import com.tangem.domain.common.extensions.calculateHmacSha256 import com.tangem.domain.common.util.UserWalletId diff --git a/app/src/main/java/com/tangem/tap/domain/model/builders/WalletStoreBuilder.kt b/app/src/main/java/com/tangem/tap/domain/model/builders/WalletStoreBuilder.kt index d9805be40f..ecca6f2314 100644 --- a/app/src/main/java/com/tangem/tap/domain/model/builders/WalletStoreBuilder.kt +++ b/app/src/main/java/com/tangem/tap/domain/model/builders/WalletStoreBuilder.kt @@ -8,6 +8,7 @@ import com.tangem.blockchain.common.Wallet import com.tangem.blockchain.common.WalletManager import com.tangem.crypto.hdWallet.DerivationPath import com.tangem.domain.common.TapWorkarounds.derivationStyle +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.tap.common.extensions.getBlockchainTxHistory import com.tangem.tap.common.extensions.getTokenTxHistory import com.tangem.tap.domain.model.UserWallet diff --git a/app/src/main/java/com/tangem/tap/domain/scanCard/ScanCardProcessor.kt b/app/src/main/java/com/tangem/tap/domain/scanCard/ScanCardProcessor.kt index 7e0f77f2d1..86f790ee67 100644 --- a/app/src/main/java/com/tangem/tap/domain/scanCard/ScanCardProcessor.kt +++ b/app/src/main/java/com/tangem/tap/domain/scanCard/ScanCardProcessor.kt @@ -7,8 +7,10 @@ import com.tangem.common.doOnSuccess import com.tangem.common.services.Result import com.tangem.core.analytics.Analytics import com.tangem.core.analytics.AnalyticsEvent -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.domain.common.extensions.withMainContext +import com.tangem.domain.common.util.twinsIsTwinned +import com.tangem.domain.models.scan.ScanResponse import com.tangem.operations.backup.BackupService import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE import com.tangem.tap.backupService diff --git a/app/src/main/java/com/tangem/tap/domain/tasks/product/CreateProductWalletTask.kt b/app/src/main/java/com/tangem/tap/domain/tasks/product/CreateProductWalletTask.kt index e57a629edc..75ea69067b 100644 --- a/app/src/main/java/com/tangem/tap/domain/tasks/product/CreateProductWalletTask.kt +++ b/app/src/main/java/com/tangem/tap/domain/tasks/product/CreateProductWalletTask.kt @@ -12,11 +12,11 @@ import com.tangem.common.extensions.guard import com.tangem.common.extensions.toMapKey import com.tangem.crypto.hdWallet.DerivationPath import com.tangem.common.map -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.common.CardTypesResolver -import com.tangem.domain.common.KeyWalletPublicKey import com.tangem.domain.common.TapWorkarounds.derivationStyle import com.tangem.domain.common.TapWorkarounds.isTestCard +import com.tangem.domain.models.scan.KeyWalletPublicKey import com.tangem.operations.CommandResponse import com.tangem.operations.backup.PrimaryCard import com.tangem.operations.backup.StartPrimaryCardLinkingTask diff --git a/app/src/main/java/com/tangem/tap/domain/tasks/product/ProductCommandProcessor.kt b/app/src/main/java/com/tangem/tap/domain/tasks/product/ProductCommandProcessor.kt index 474bbd49dd..5251c0b0a1 100644 --- a/app/src/main/java/com/tangem/tap/domain/tasks/product/ProductCommandProcessor.kt +++ b/app/src/main/java/com/tangem/tap/domain/tasks/product/ProductCommandProcessor.kt @@ -2,7 +2,7 @@ package com.tangem.tap.domain.tasks.product import com.tangem.common.CompletionResult import com.tangem.common.core.CardSession -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO /** [REDACTED_AUTHOR] 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 78866f673b..d42d4b1bda 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 @@ -19,9 +19,9 @@ import com.tangem.crypto.hdWallet.DerivationPath import com.tangem.common.tlv.Tlv import com.tangem.common.tlv.TlvDecoder import com.tangem.crypto.CryptoUtils -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ProductType -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ProductType +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.TapWorkarounds.isExcluded import com.tangem.domain.common.TapWorkarounds.isNotSupportedInThatRelease import com.tangem.domain.common.TapWorkarounds.isSaltPay diff --git a/app/src/main/java/com/tangem/tap/domain/tokens/CurrenciesRepository.kt b/app/src/main/java/com/tangem/tap/domain/tokens/CurrenciesRepository.kt index f4c06f518a..22baf587ab 100644 --- a/app/src/main/java/com/tangem/tap/domain/tokens/CurrenciesRepository.kt +++ b/app/src/main/java/com/tangem/tap/domain/tokens/CurrenciesRepository.kt @@ -2,7 +2,7 @@ package com.tangem.tap.domain.tokens import com.tangem.blockchain.common.Blockchain import com.tangem.common.card.FirmwareVersion -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO object CurrenciesRepository { fun getBlockchains(cardFirmware: CardDTO.FirmwareVersion, isTestNet: Boolean = false): List { diff --git a/app/src/main/java/com/tangem/tap/domain/tokens/UserTokensRepository.kt b/app/src/main/java/com/tangem/tap/domain/tokens/UserTokensRepository.kt index 175f72a121..255d8611c5 100644 --- a/app/src/main/java/com/tangem/tap/domain/tokens/UserTokensRepository.kt +++ b/app/src/main/java/com/tangem/tap/domain/tokens/UserTokensRepository.kt @@ -7,7 +7,7 @@ import com.tangem.datasource.api.tangemTech.TangemTechApi import com.tangem.datasource.api.tangemTech.TangemTechService import com.tangem.datasource.api.tangemTech.models.UserTokensResponse import com.tangem.datasource.connection.NetworkConnectionManager -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.tap.common.AndroidFileReader import com.tangem.tap.domain.model.builders.UserWalletIdBuilder import com.tangem.tap.domain.tokens.converters.CurrencyConverter diff --git a/app/src/main/java/com/tangem/tap/domain/tokens/models/BlockchainNetwork.kt b/app/src/main/java/com/tangem/tap/domain/tokens/models/BlockchainNetwork.kt index 8abb99b14d..32cfbc4bec 100644 --- a/app/src/main/java/com/tangem/tap/domain/tokens/models/BlockchainNetwork.kt +++ b/app/src/main/java/com/tangem/tap/domain/tokens/models/BlockchainNetwork.kt @@ -5,7 +5,7 @@ import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.Token import com.tangem.blockchain.common.WalletManager import com.tangem.common.extensions.calculateHashCode -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.common.TapWorkarounds.derivationStyle @JsonClass(generateAdapter = true) diff --git a/app/src/main/java/com/tangem/tap/domain/twins/FinalizeTwinTask.kt b/app/src/main/java/com/tangem/tap/domain/twins/FinalizeTwinTask.kt index 127c10ec33..1ece7060b3 100644 --- a/app/src/main/java/com/tangem/tap/domain/twins/FinalizeTwinTask.kt +++ b/app/src/main/java/com/tangem/tap/domain/twins/FinalizeTwinTask.kt @@ -4,7 +4,7 @@ import com.tangem.common.CompletionResult import com.tangem.common.KeyPair import com.tangem.common.core.CardSession import com.tangem.common.core.CardSessionRunnable -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.operations.PreflightReadMode import com.tangem.operations.PreflightReadTask import com.tangem.tap.domain.tasks.product.ScanProductTask diff --git a/app/src/main/java/com/tangem/tap/domain/twins/TwinCardsManager.kt b/app/src/main/java/com/tangem/tap/domain/twins/TwinCardsManager.kt index 3795a0cf00..6ef5f2bbe9 100644 --- a/app/src/main/java/com/tangem/tap/domain/twins/TwinCardsManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/twins/TwinCardsManager.kt @@ -10,8 +10,8 @@ import com.tangem.common.extensions.hexToBytes import com.tangem.common.extensions.toHexString import com.tangem.datasource.api.common.MoshiConverter import com.tangem.datasource.asset.AssetReader -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse import com.tangem.operations.wallet.CreateWalletResponse import com.tangem.tap.tangemSdkManager diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/model/UserWalletInformation.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/model/UserWalletInformation.kt index d383e11e3f..d81f8ebafc 100644 --- a/app/src/main/java/com/tangem/tap/domain/userWalletList/model/UserWalletInformation.kt +++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/model/UserWalletInformation.kt @@ -1,8 +1,8 @@ package com.tangem.tap.domain.userWalletList.model import com.squareup.moshi.JsonClass -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.util.UserWalletId @JsonClass(generateAdapter = true) diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/UserWalletEncyptionKeyCalculator.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/UserWalletEncyptionKeyCalculator.kt index d97af026cc..f58758f35a 100644 --- a/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/UserWalletEncyptionKeyCalculator.kt +++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/UserWalletEncyptionKeyCalculator.kt @@ -1,7 +1,7 @@ package com.tangem.tap.domain.userWalletList.utils import com.tangem.common.extensions.calculateSha256 -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.common.extensions.calculateHmacSha256 internal val CardDTO.encryptionKey: ByteArray? diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/json/CardBackupStatusAdapter.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/json/CardBackupStatusAdapter.kt index 2f7e2544f5..dc40917fb8 100644 --- a/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/json/CardBackupStatusAdapter.kt +++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/json/CardBackupStatusAdapter.kt @@ -5,7 +5,7 @@ import com.squareup.moshi.JsonAdapter import com.squareup.moshi.JsonReader import com.squareup.moshi.JsonWriter import com.squareup.moshi.ToJson -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO internal class CardBackupStatusAdapter { @ToJson diff --git a/app/src/main/java/com/tangem/tap/domain/walletCurrencies/implementation/DefaultWalletCurrenciesManager.kt b/app/src/main/java/com/tangem/tap/domain/walletCurrencies/implementation/DefaultWalletCurrenciesManager.kt index 2281fbfe5f..f344f46d4a 100644 --- a/app/src/main/java/com/tangem/tap/domain/walletCurrencies/implementation/DefaultWalletCurrenciesManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/walletCurrencies/implementation/DefaultWalletCurrenciesManager.kt @@ -5,7 +5,7 @@ import com.tangem.common.CompletionResult import com.tangem.common.flatMap import com.tangem.common.fold import com.tangem.common.map -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.common.TapWorkarounds.derivationStyle import com.tangem.domain.common.util.UserWalletId import com.tangem.tap.common.entities.FiatCurrency diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletAmountsRepository.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletAmountsRepository.kt index 30de69eec5..6b2aa5ccff 100644 --- a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletAmountsRepository.kt +++ b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletAmountsRepository.kt @@ -17,8 +17,9 @@ import com.tangem.common.flatMapOnFailure import com.tangem.common.fold import com.tangem.common.map import com.tangem.datasource.api.tangemTech.TangemTechApi -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.common.util.hasDerivation import com.tangem.domain.common.util.UserWalletId +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.TestActions import com.tangem.tap.common.entities.FiatCurrency import com.tangem.tap.common.extensions.replaceByOrAdd diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletManagersRepository.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletManagersRepository.kt index 6c5eba1809..b2d8167a7e 100644 --- a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletManagersRepository.kt +++ b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletManagersRepository.kt @@ -9,13 +9,14 @@ import com.tangem.blockchain.common.WalletManagerFactory import com.tangem.common.CompletionResult import com.tangem.common.catching import com.tangem.common.doOnSuccess -import com.tangem.crypto.hdWallet.DerivationPath import com.tangem.common.mapFailure -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse +import com.tangem.crypto.hdWallet.DerivationPath import com.tangem.domain.common.TapWorkarounds.isTestCard import com.tangem.domain.common.TapWorkarounds.useOldStyleDerivation +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.domain.common.util.UserWalletId +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.domain.extensions.makeWalletManagerForApp import com.tangem.tap.domain.model.UserWallet import com.tangem.tap.domain.tokens.models.BlockchainNetwork diff --git a/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectManager.kt b/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectManager.kt index 1cae897360..64037f50e2 100644 --- a/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectManager.kt @@ -4,7 +4,7 @@ import com.tangem.blockchain.common.Blockchain import com.tangem.common.card.EllipticCurve import com.tangem.common.extensions.guard import com.tangem.core.analytics.Analytics -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.analytics.events.WalletConnect import com.tangem.tap.common.extensions.dispatchOnMain import com.tangem.tap.common.redux.global.GlobalAction diff --git a/app/src/main/java/com/tangem/tap/features/demo/DemoHelper.kt b/app/src/main/java/com/tangem/tap/features/demo/DemoHelper.kt index 43e31f423c..cccc4167ae 100644 --- a/app/src/main/java/com/tangem/tap/features/demo/DemoHelper.kt +++ b/app/src/main/java/com/tangem/tap/features/demo/DemoHelper.kt @@ -9,7 +9,7 @@ import com.tangem.blockchain.common.toBlockchainSdkError import com.tangem.blockchain.extensions.Result import com.tangem.blockchain.extensions.SimpleResult import com.tangem.common.CompletionResult -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.demo.DemoConfig import com.tangem.tap.common.extensions.dispatchNotification import com.tangem.tap.common.redux.AppState diff --git a/app/src/main/java/com/tangem/tap/features/demo/DemoOnboardingNoteMiddleware.kt b/app/src/main/java/com/tangem/tap/features/demo/DemoOnboardingNoteMiddleware.kt index 81fcc9fc13..4624db8d34 100644 --- a/app/src/main/java/com/tangem/tap/features/demo/DemoOnboardingNoteMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/demo/DemoOnboardingNoteMiddleware.kt @@ -1,7 +1,7 @@ package com.tangem.tap.features.demo import com.tangem.common.extensions.guard -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.demo.DemoConfig import com.tangem.domain.common.extensions.withMainContext import com.tangem.tap.domain.extensions.makePrimaryWalletManager diff --git a/app/src/main/java/com/tangem/tap/features/demo/Extentions.kt b/app/src/main/java/com/tangem/tap/features/demo/Extentions.kt index 1e97beb6e0..4805a4263a 100644 --- a/app/src/main/java/com/tangem/tap/features/demo/Extentions.kt +++ b/app/src/main/java/com/tangem/tap/features/demo/Extentions.kt @@ -1,7 +1,7 @@ package com.tangem.tap.features.demo -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse /** [REDACTED_AUTHOR] diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt index d7bcd69528..5782c7b0e2 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt @@ -1,9 +1,9 @@ package com.tangem.tap.features.details.redux import com.tangem.blockchain.common.Wallet -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.common.CardTypesResolver -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.entities.FiatCurrency import org.rekotlin.Action diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt index fb04d4aa57..83daf3f9dd 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt @@ -7,8 +7,9 @@ import com.tangem.common.doOnSuccess import com.tangem.common.extensions.guard import com.tangem.common.flatMap import com.tangem.core.analytics.Analytics -import com.tangem.domain.common.ScanResponse import com.tangem.domain.common.TapWorkarounds.isTangemTwins +import com.tangem.domain.common.util.cardTypesResolver +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.analytics.events.AnalyticsParam import com.tangem.tap.common.analytics.events.Settings import com.tangem.tap.common.extensions.dispatchDialogShow 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 b72be6d5d8..85e80df897 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 @@ -1,7 +1,8 @@ package com.tangem.tap.features.details.redux -import com.tangem.domain.common.CardDTO import com.tangem.domain.common.CardTypesResolver +import com.tangem.domain.common.util.cardTypesResolver +import com.tangem.domain.models.scan.CardDTO import com.tangem.tap.common.redux.AppState import com.tangem.tap.domain.extensions.signedHashesCount import com.tangem.tap.preferencesStorage diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt index 0fc60cafcc..6fd17a4119 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt @@ -1,8 +1,8 @@ package com.tangem.tap.features.details.redux import com.tangem.blockchain.common.Wallet -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.entities.Button import com.tangem.tap.common.entities.FiatCurrency import org.rekotlin.StateType diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectAction.kt b/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectAction.kt index a383235538..9afb96f10f 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectAction.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectAction.kt @@ -1,7 +1,7 @@ package com.tangem.tap.features.details.redux.walletconnect import com.tangem.blockchain.common.Blockchain -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.redux.NotificationAction import com.tangem.tap.domain.TapError import com.tangem.wallet.R diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectMiddleware.kt b/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectMiddleware.kt index 014ca34512..65dfeb1eab 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectMiddleware.kt @@ -4,10 +4,11 @@ import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.DerivationStyle import com.tangem.blockchain.common.WalletManager import com.tangem.common.extensions.guard -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse import com.tangem.domain.common.TapWorkarounds.derivationStyle +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.domain.common.extensions.withMainContext +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.extensions.dispatchOnMain import com.tangem.tap.common.redux.AppDialog import com.tangem.tap.common.redux.AppState diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectState.kt b/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectState.kt index 61fa67dd44..11bb3e6a8b 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectState.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/walletconnect/WalletConnectState.kt @@ -6,7 +6,7 @@ import com.tangem.blockchain.common.DerivationStyle import com.tangem.blockchain.common.TransactionData import com.tangem.blockchain.common.WalletManager import com.tangem.crypto.hdWallet.DerivationPath -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.redux.StateDialog import com.tangem.tap.features.details.ui.walletconnect.dialogs.PersonalSignDialogData import com.tangem.tap.features.details.ui.walletconnect.dialogs.TransactionRequestDialogData 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 7173d2ceb5..10edfda464 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 @@ -3,6 +3,7 @@ package com.tangem.tap.features.details.ui.details import androidx.compose.runtime.MutableState import androidx.compose.runtime.mutableStateOf import com.tangem.core.analytics.Analytics +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.tap.common.analytics.events.Settings import com.tangem.tap.common.feedback.FeedbackEmail import com.tangem.tap.common.feedback.SupportInfo diff --git a/app/src/main/java/com/tangem/tap/features/disclaimer/DisclaimerType.kt b/app/src/main/java/com/tangem/tap/features/disclaimer/DisclaimerType.kt index fb06687b57..30b3f43d1c 100644 --- a/app/src/main/java/com/tangem/tap/features/disclaimer/DisclaimerType.kt +++ b/app/src/main/java/com/tangem/tap/features/disclaimer/DisclaimerType.kt @@ -1,6 +1,6 @@ package com.tangem.tap.features.disclaimer -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.common.TapWorkarounds.isSaltPay import com.tangem.domain.common.TapWorkarounds.isStart2Coin import com.tangem.tap.persistence.DisclaimerPrefStorage 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 3230f8b878..f534813ecb 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 @@ -5,7 +5,7 @@ import com.tangem.common.doOnResult import com.tangem.common.doOnSuccess import com.tangem.core.analytics.Analytics import com.tangem.core.analytics.AnalyticsEvent -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.analytics.events.Basic import com.tangem.tap.common.analytics.events.IntroductionProcess import com.tangem.tap.common.analytics.events.Shop 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 fdf3a8b90b..cd92b90ea9 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 @@ -4,8 +4,10 @@ import com.tangem.common.doOnFailure import com.tangem.common.doOnSuccess import com.tangem.common.extensions.guard import com.tangem.core.analytics.Analytics -import com.tangem.domain.common.ProductType -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.common.util.cardTypesResolver +import com.tangem.domain.common.util.twinsIsTwinned +import com.tangem.domain.models.scan.ProductType +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.extensions.dispatchOnMain import com.tangem.tap.common.extensions.onUserWalletSelected import com.tangem.tap.common.extensions.removeContext diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingManager.kt b/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingManager.kt index 47caa1b85c..e35aa85d7a 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingManager.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingManager.kt @@ -5,7 +5,7 @@ import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.WalletManager import com.tangem.common.extensions.isZero import com.tangem.common.services.Result -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.operations.attestation.CardVerifyAndGetInfo import com.tangem.operations.attestation.OnlineCardVerifier import com.tangem.tap.common.extensions.isPositive diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingSaltPayHelper.kt b/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingSaltPayHelper.kt index 53c844cd40..ab267f9dda 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingSaltPayHelper.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/OnboardingSaltPayHelper.kt @@ -1,7 +1,7 @@ package com.tangem.tap.features.onboarding import com.tangem.common.services.Result -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.extensions.successOr import com.tangem.tap.features.onboarding.products.wallet.saltPay.SaltPayActivationManager import com.tangem.tap.features.onboarding.products.wallet.saltPay.message.SaltPayActivationError diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/otherCards/redux/OnboardingOtherCardsMiddleware.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/otherCards/redux/OnboardingOtherCardsMiddleware.kt index 73312bd8a9..ba7983eaa5 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/otherCards/redux/OnboardingOtherCardsMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/otherCards/redux/OnboardingOtherCardsMiddleware.kt @@ -3,6 +3,7 @@ package com.tangem.tap.features.onboarding.products.otherCards.redux import com.tangem.blockchain.common.Blockchain import com.tangem.common.CompletionResult import com.tangem.core.analytics.Analytics +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.domain.common.extensions.withMainContext import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE import com.tangem.tap.common.analytics.events.Onboarding diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsAction.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsAction.kt index c552a354a4..4aa4e8a4d4 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsAction.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsAction.kt @@ -4,7 +4,7 @@ import com.tangem.Message import com.tangem.blockchain.common.WalletManager import com.tangem.common.extensions.VoidCallback import com.tangem.datasource.asset.AssetReader -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.domain.TapError import com.tangem.tap.domain.twins.TwinCardsManager import com.tangem.tap.features.onboarding.OnboardingWalletBalance diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsMiddleware.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsMiddleware.kt index e7d4d1edf5..e3837cd4a9 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsMiddleware.kt @@ -4,8 +4,9 @@ import com.tangem.blockchain.extensions.Result import com.tangem.common.CompletionResult import com.tangem.common.extensions.guard import com.tangem.core.analytics.Analytics -import com.tangem.domain.common.ScanResponse import com.tangem.domain.common.extensions.withMainContext +import com.tangem.domain.common.util.twinsIsTwinned +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE import com.tangem.tap.common.analytics.events.AnalyticsParam import com.tangem.tap.common.analytics.events.Onboarding diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsReducer.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsReducer.kt index 9902cd2ce5..9ba9492c54 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsReducer.kt @@ -1,5 +1,6 @@ package com.tangem.tap.features.onboarding.products.twins.redux +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.domain.common.getTwinCardNumber import com.tangem.tap.common.redux.AppState import org.rekotlin.Action diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsState.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsState.kt index 88f9e5d82d..a5608d4371 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsState.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/redux/TwinCardsState.kt @@ -1,7 +1,7 @@ package com.tangem.tap.features.onboarding.products.twins.redux import com.tangem.blockchain.common.WalletManager -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.TwinCardNumber import com.tangem.tap.domain.TapError import com.tangem.tap.domain.twins.TwinCardsManager diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/ui/TwinsCardsFragment.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/ui/TwinsCardsFragment.kt index 4c8d89c813..1ef2872944 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/ui/TwinsCardsFragment.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/twins/ui/TwinsCardsFragment.kt @@ -16,7 +16,7 @@ import com.tangem.common.extensions.VoidCallback import com.tangem.core.analytics.Analytics import com.tangem.core.ui.fragments.setStatusBarColor import com.tangem.datasource.asset.AssetReader -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.TwinCardNumber import com.tangem.sdk.ui.widget.leapfrogWidget.LeapfrogWidget import com.tangem.tap.common.analytics.events.Onboarding 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 4dad678741..a6eafe02d9 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 @@ -5,10 +5,11 @@ import com.tangem.blockchain.common.Blockchain import com.tangem.common.CompletionResult import com.tangem.common.extensions.ifNotNull import com.tangem.core.analytics.Analytics -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse import com.tangem.domain.common.TapWorkarounds.isSaltPay +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.domain.common.extensions.withMainContext +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse import com.tangem.operations.backup.BackupService import com.tangem.tap.backupService import com.tangem.tap.common.analytics.events.Onboarding 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 6e457704dd..0c50b1028f 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 @@ -1,5 +1,6 @@ package com.tangem.tap.features.onboarding.products.wallet.redux +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.tap.backupService import com.tangem.tap.common.redux.AppState import com.tangem.tap.common.redux.global.GlobalAction diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/SaltPayActivationManager.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/SaltPayActivationManager.kt index 409ca000e6..2f7f824f6c 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/SaltPayActivationManager.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/SaltPayActivationManager.kt @@ -31,7 +31,7 @@ import com.tangem.datasource.api.paymentology.models.response.RegistrationRespon import com.tangem.datasource.api.paymentology.models.response.tryExtractError import com.tangem.datasource.config.models.KYCProvider import com.tangem.datasource.config.models.SaltPayConfig -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.common.SaltPayWorkaround import com.tangem.domain.common.extensions.successOr import com.tangem.operations.attestation.AttestWalletKeyResponse diff --git a/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletAction.kt b/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletAction.kt index 30ebdd258f..00a5c7413c 100644 --- a/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletAction.kt +++ b/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletAction.kt @@ -1,7 +1,7 @@ package com.tangem.tap.features.saveWallet.redux import com.tangem.common.core.TangemError -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import org.rekotlin.Action internal sealed interface SaveWalletAction : Action { diff --git a/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletState.kt b/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletState.kt index 38af8d0b6f..b57528ceaa 100644 --- a/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletState.kt +++ b/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletState.kt @@ -1,7 +1,7 @@ package com.tangem.tap.features.saveWallet.redux import com.tangem.common.core.TangemError -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import org.rekotlin.StateType data class SaveWalletState( diff --git a/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/SendMiddleware.kt b/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/SendMiddleware.kt index 0a528bd856..607ecc34fd 100644 --- a/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/SendMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/SendMiddleware.kt @@ -16,7 +16,7 @@ import com.tangem.common.core.TangemSdkError import com.tangem.common.extensions.guard import com.tangem.common.services.Result import com.tangem.core.analytics.Analytics -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.common.TapWorkarounds.isStart2Coin import com.tangem.domain.common.extensions.withMainContext import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE diff --git a/app/src/main/java/com/tangem/tap/features/tokens/impl/domain/DefaultTokensListInteractor.kt b/app/src/main/java/com/tangem/tap/features/tokens/impl/domain/DefaultTokensListInteractor.kt index 290dfa225f..c7743263f4 100644 --- a/app/src/main/java/com/tangem/tap/features/tokens/impl/domain/DefaultTokensListInteractor.kt +++ b/app/src/main/java/com/tangem/tap/features/tokens/impl/domain/DefaultTokensListInteractor.kt @@ -9,8 +9,9 @@ import com.tangem.common.extensions.guard import com.tangem.common.extensions.toMapKey import com.tangem.common.flatMap import com.tangem.crypto.hdWallet.DerivationPath -import com.tangem.domain.common.ScanResponse import com.tangem.domain.common.TapWorkarounds.derivationStyle +import com.tangem.domain.common.util.supportsHdWallet +import com.tangem.domain.models.scan.ScanResponse import com.tangem.operations.derivation.ExtendedPublicKeysMap import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE import com.tangem.tap.common.extensions.dispatchDebugErrorNotification diff --git a/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensAction.kt b/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensAction.kt index 2831a00547..bea0320bbe 100644 --- a/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensAction.kt +++ b/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensAction.kt @@ -2,7 +2,7 @@ package com.tangem.tap.features.tokens.legacy.redux import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.DerivationStyle -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.domain.model.WalletDataModel import com.tangem.tap.domain.tokens.Currency import org.rekotlin.Action diff --git a/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensMiddleware.kt b/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensMiddleware.kt index dfb76ced9e..be311deb0a 100644 --- a/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensMiddleware.kt @@ -12,12 +12,14 @@ import com.tangem.common.services.Result import com.tangem.core.analytics.Analytics import com.tangem.crypto.hdWallet.DerivationPath import com.tangem.domain.DomainWrapped -import com.tangem.domain.common.ScanResponse import com.tangem.domain.common.TapWorkarounds.derivationStyle import com.tangem.domain.common.TapWorkarounds.isTestCard import com.tangem.domain.common.extensions.supportedBlockchains +import com.tangem.domain.common.util.hasDerivation +import com.tangem.domain.common.util.supportsHdWallet import com.tangem.domain.features.addCustomToken.CustomCurrency import com.tangem.domain.features.addCustomToken.redux.AddCustomTokenAction +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.redux.domainStore import com.tangem.operations.derivation.ExtendedPublicKeysMap import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE diff --git a/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensState.kt b/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensState.kt index 432b422128..4f77d60fac 100644 --- a/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensState.kt +++ b/app/src/main/java/com/tangem/tap/features/tokens/legacy/redux/TokensState.kt @@ -3,7 +3,7 @@ package com.tangem.tap.features.tokens.legacy.redux import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.DerivationStyle import com.tangem.blockchain.common.Token -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.extensions.canHandleToken import com.tangem.domain.common.extensions.fromNetworkId import com.tangem.tap.domain.model.WalletDataModel diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt index dafb4c0324..a7e540bf43 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt @@ -3,6 +3,7 @@ package com.tangem.tap.features.wallet.redux import android.graphics.Bitmap import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.WalletManager +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.tap.common.entities.Button import com.tangem.tap.common.redux.global.CryptoCurrencyName import com.tangem.tap.common.toggleWidget.WidgetState diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WarningsMiddleware.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WarningsMiddleware.kt index 9562b735fa..3ade28d8db 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WarningsMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WarningsMiddleware.kt @@ -4,9 +4,10 @@ import com.tangem.blockchain.common.BlockchainSdkError import com.tangem.blockchain.common.SignatureCountValidator import com.tangem.blockchain.extensions.SimpleResult import com.tangem.common.card.FirmwareVersion -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse import com.tangem.domain.common.TapWorkarounds.isTestCard +import com.tangem.domain.common.util.cardTypesResolver +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.extensions.dispatchOnMain import com.tangem.tap.common.redux.global.GlobalState import com.tangem.tap.domain.configurable.warningMessage.WarningMessage 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 632ac3e7df..d58f997bc8 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 @@ -1,7 +1,7 @@ package com.tangem.tap.features.wallet.redux.reducers import com.tangem.blockchain.common.Wallet -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.common.TapWorkarounds.isTestCard import com.tangem.tap.common.redux.AppState import com.tangem.tap.domain.TapError 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 e6fb203abb..1d0cc810ed 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 @@ -24,6 +24,7 @@ import com.tangem.core.analytics.Analytics import com.tangem.core.ui.fragments.setStatusBarColor import com.tangem.core.ui.utils.OneTouchClickListener import com.tangem.datasource.connection.NetworkConnectionManager +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.feature.swap.api.SwapFeatureToggleManager import com.tangem.feature.swap.domain.SwapInteractor import com.tangem.tap.MainActivity diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletViewModel.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletViewModel.kt index 25b09a2610..ce2e4ea085 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletViewModel.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletViewModel.kt @@ -5,6 +5,7 @@ import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.tangem.core.analytics.api.AnalyticsEventHandler +import com.tangem.domain.common.util.cardTypesResolver import com.tangem.tap.common.analytics.converters.ParamCardCurrencyConverter import com.tangem.tap.common.analytics.events.Basic import com.tangem.tap.common.analytics.events.MainScreen diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorMiddleware.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorMiddleware.kt index aadd56356b..675ca89cdf 100644 --- a/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorMiddleware.kt @@ -7,7 +7,7 @@ import com.tangem.common.doOnSuccess import com.tangem.common.flatMap import com.tangem.common.map import com.tangem.core.analytics.Analytics -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.common.util.UserWalletId import com.tangem.tap.common.analytics.events.AnalyticsParam import com.tangem.tap.common.analytics.events.Basic diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorReducer.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorReducer.kt index c28a1e4ab1..2d06b37937 100644 --- a/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorReducer.kt @@ -1,6 +1,7 @@ package com.tangem.tap.features.walletSelector.redux -import com.tangem.domain.common.CardDTO +import com.tangem.domain.common.util.cardTypesResolver +import com.tangem.domain.models.scan.CardDTO import com.tangem.tap.common.redux.AppState import com.tangem.tap.domain.model.TotalFiatBalance import com.tangem.tap.domain.model.UserWallet diff --git a/app/src/main/java/com/tangem/tap/features/welcome/redux/WelcomeMiddleware.kt b/app/src/main/java/com/tangem/tap/features/welcome/redux/WelcomeMiddleware.kt index e728d10a4a..6e7da12221 100644 --- a/app/src/main/java/com/tangem/tap/features/welcome/redux/WelcomeMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/welcome/redux/WelcomeMiddleware.kt @@ -4,7 +4,7 @@ import android.content.Intent import com.tangem.common.core.TangemSdkError import com.tangem.common.doOnFailure import com.tangem.common.doOnSuccess -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.analytics.events.AnalyticsParam import com.tangem.tap.common.analytics.events.Basic import com.tangem.tap.common.extensions.dispatchOnMain diff --git a/app/src/main/java/com/tangem/tap/network/exchangeServices/BuyExchangeService.kt b/app/src/main/java/com/tangem/tap/network/exchangeServices/BuyExchangeService.kt index d77245b45c..fec559a528 100644 --- a/app/src/main/java/com/tangem/tap/network/exchangeServices/BuyExchangeService.kt +++ b/app/src/main/java/com/tangem/tap/network/exchangeServices/BuyExchangeService.kt @@ -1,7 +1,7 @@ package com.tangem.tap.network.exchangeServices import com.tangem.blockchain.common.Blockchain -import com.tangem.domain.common.ProductType +import com.tangem.domain.models.scan.ProductType import com.tangem.tap.features.wallet.models.Currency import com.tangem.tap.network.exchangeServices.mercuryo.MercuryoService import com.tangem.tap.network.exchangeServices.utorg.UtorgExchangeService diff --git a/app/src/main/java/com/tangem/tap/network/exchangeServices/CardExchangeRules.kt b/app/src/main/java/com/tangem/tap/network/exchangeServices/CardExchangeRules.kt index 939121bda7..3e0d7ab0a5 100644 --- a/app/src/main/java/com/tangem/tap/network/exchangeServices/CardExchangeRules.kt +++ b/app/src/main/java/com/tangem/tap/network/exchangeServices/CardExchangeRules.kt @@ -1,6 +1,6 @@ package com.tangem.tap.network.exchangeServices -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.common.TapWorkarounds.isStart2Coin import com.tangem.tap.features.demo.isDemoCard import com.tangem.tap.features.wallet.models.Currency diff --git a/app/src/main/java/com/tangem/tap/network/exchangeServices/CurrencyExchangeManager.kt b/app/src/main/java/com/tangem/tap/network/exchangeServices/CurrencyExchangeManager.kt index f7beab3570..a73937a8ee 100644 --- a/app/src/main/java/com/tangem/tap/network/exchangeServices/CurrencyExchangeManager.kt +++ b/app/src/main/java/com/tangem/tap/network/exchangeServices/CurrencyExchangeManager.kt @@ -7,7 +7,7 @@ import com.tangem.blockchain.common.AmountType import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.Token import com.tangem.blockchain.extensions.Result -import com.tangem.domain.common.CardDTO +import com.tangem.domain.models.scan.CardDTO import com.tangem.tap.common.extensions.safeUpdate import com.tangem.tap.common.redux.global.CryptoCurrencyName import com.tangem.tap.common.redux.global.GlobalAction diff --git a/app/src/main/java/com/tangem/tap/proxy/AppStateHolder.kt b/app/src/main/java/com/tangem/tap/proxy/AppStateHolder.kt index ed21a083df..aab3cfd808 100644 --- a/app/src/main/java/com/tangem/tap/proxy/AppStateHolder.kt +++ b/app/src/main/java/com/tangem/tap/proxy/AppStateHolder.kt @@ -1,8 +1,8 @@ package com.tangem.tap.proxy import com.tangem.TangemSdk -import com.tangem.domain.common.CardDTO -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ScanResponse import com.tangem.tap.common.entities.FiatCurrency import com.tangem.tap.common.redux.AppState import com.tangem.tap.domain.TangemSdkManager diff --git a/app/src/main/java/com/tangem/tap/proxy/DerivationManagerImpl.kt b/app/src/main/java/com/tangem/tap/proxy/DerivationManagerImpl.kt index f52ac33f8a..72645564d0 100644 --- a/app/src/main/java/com/tangem/tap/proxy/DerivationManagerImpl.kt +++ b/app/src/main/java/com/tangem/tap/proxy/DerivationManagerImpl.kt @@ -9,9 +9,10 @@ import com.tangem.common.core.TangemSdkError import com.tangem.common.extensions.ByteArrayKey import com.tangem.common.extensions.toMapKey import com.tangem.crypto.hdWallet.DerivationPath -import com.tangem.domain.common.ScanResponse import com.tangem.domain.common.TapWorkarounds.derivationStyle import com.tangem.domain.common.extensions.fromNetworkId +import com.tangem.domain.common.util.hasDerivation +import com.tangem.domain.models.scan.ScanResponse import com.tangem.lib.crypto.DerivationManager import com.tangem.lib.crypto.models.Currency import com.tangem.lib.crypto.models.Currency.NonNativeToken diff --git a/domain/.gitignore b/domain/legacy/.gitignore similarity index 100% rename from domain/.gitignore rename to domain/legacy/.gitignore diff --git a/domain/build.gradle.kts b/domain/legacy/build.gradle.kts similarity index 96% rename from domain/build.gradle.kts rename to domain/legacy/build.gradle.kts index 6ea5884226..f618e11fd9 100644 --- a/domain/build.gradle.kts +++ b/domain/legacy/build.gradle.kts @@ -9,6 +9,7 @@ dependencies { implementation(project(":core:utils")) implementation(project(":common")) implementation(project(":libs:auth")) + implementation(project(":domain:models")) /** Tangem libraries */ implementation(deps.tangem.blockchain) { diff --git a/domain/proguard-rules.pro b/domain/legacy/proguard-rules.pro similarity index 100% rename from domain/proguard-rules.pro rename to domain/legacy/proguard-rules.pro diff --git a/domain/src/androidTest/java/com/tangem/domain/features/ExampleInstrumentedTest.kt b/domain/legacy/src/androidTest/java/com/tangem/domain/features/ExampleInstrumentedTest.kt similarity index 100% rename from domain/src/androidTest/java/com/tangem/domain/features/ExampleInstrumentedTest.kt rename to domain/legacy/src/androidTest/java/com/tangem/domain/features/ExampleInstrumentedTest.kt diff --git a/domain/src/main/AndroidManifest.xml b/domain/legacy/src/main/AndroidManifest.xml similarity index 100% rename from domain/src/main/AndroidManifest.xml rename to domain/legacy/src/main/AndroidManifest.xml diff --git a/domain/src/main/java/com/tangem/domain/DomainDialog.kt b/domain/legacy/src/main/java/com/tangem/domain/DomainDialog.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/DomainDialog.kt rename to domain/legacy/src/main/java/com/tangem/domain/DomainDialog.kt diff --git a/domain/src/main/java/com/tangem/domain/DomainLayer.kt b/domain/legacy/src/main/java/com/tangem/domain/DomainLayer.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/DomainLayer.kt rename to domain/legacy/src/main/java/com/tangem/domain/DomainLayer.kt diff --git a/domain/src/main/java/com/tangem/domain/DomainModuleMessage.kt b/domain/legacy/src/main/java/com/tangem/domain/DomainModuleMessage.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/DomainModuleMessage.kt rename to domain/legacy/src/main/java/com/tangem/domain/DomainModuleMessage.kt diff --git a/domain/src/main/java/com/tangem/domain/DomainWrapped.kt b/domain/legacy/src/main/java/com/tangem/domain/DomainWrapped.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/DomainWrapped.kt rename to domain/legacy/src/main/java/com/tangem/domain/DomainWrapped.kt diff --git a/domain/src/main/java/com/tangem/domain/common/CardTypesResolver.kt b/domain/legacy/src/main/java/com/tangem/domain/common/CardTypesResolver.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/CardTypesResolver.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/CardTypesResolver.kt diff --git a/domain/src/main/java/com/tangem/domain/common/LogConfig.kt b/domain/legacy/src/main/java/com/tangem/domain/common/LogConfig.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/LogConfig.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/LogConfig.kt diff --git a/domain/src/main/java/com/tangem/domain/common/SaltPayWorkaround.kt b/domain/legacy/src/main/java/com/tangem/domain/common/SaltPayWorkaround.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/SaltPayWorkaround.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/SaltPayWorkaround.kt diff --git a/domain/src/main/java/com/tangem/domain/common/TangemCardTypesResolver.kt b/domain/legacy/src/main/java/com/tangem/domain/common/TangemCardTypesResolver.kt similarity index 97% rename from domain/src/main/java/com/tangem/domain/common/TangemCardTypesResolver.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/TangemCardTypesResolver.kt index 50850def2c..d62e391dfb 100644 --- a/domain/src/main/java/com/tangem/domain/common/TangemCardTypesResolver.kt +++ b/domain/legacy/src/main/java/com/tangem/domain/common/TangemCardTypesResolver.kt @@ -11,6 +11,8 @@ import com.tangem.domain.common.TapWorkarounds.isSaltPayVisa import com.tangem.domain.common.TapWorkarounds.isSaltPayWallet import com.tangem.domain.common.TapWorkarounds.isStart2Coin import com.tangem.domain.common.TapWorkarounds.isTestCard +import com.tangem.domain.models.scan.CardDTO +import com.tangem.domain.models.scan.ProductType class TangemCardTypesResolver( private val card: CardDTO, @@ -80,8 +82,4 @@ private fun Blockchain.Companion.fromBlockchainName(blockchainName: String): Blo Blockchain.fromId(blockchainName) } } -} - -enum class ProductType { - Note, Twins, Wallet, SaltPay, Start2Coin } \ No newline at end of file diff --git a/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt b/domain/legacy/src/main/java/com/tangem/domain/common/TapWorkarounds.kt similarity index 98% rename from domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/TapWorkarounds.kt index 9ac3308197..ab5a7458f1 100644 --- a/domain/src/main/java/com/tangem/domain/common/TapWorkarounds.kt +++ b/domain/legacy/src/main/java/com/tangem/domain/common/TapWorkarounds.kt @@ -3,6 +3,7 @@ package com.tangem.domain.common import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.DerivationStyle import com.tangem.common.card.Card +import com.tangem.domain.models.scan.CardDTO import java.util.* /** diff --git a/domain/src/main/java/com/tangem/domain/common/Throttling.kt b/domain/legacy/src/main/java/com/tangem/domain/common/Throttling.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/Throttling.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/Throttling.kt diff --git a/domain/src/main/java/com/tangem/domain/common/TwinsHelper.kt b/domain/legacy/src/main/java/com/tangem/domain/common/TwinsHelper.kt similarity index 97% rename from domain/src/main/java/com/tangem/domain/common/TwinsHelper.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/TwinsHelper.kt index 7e801695fb..f6aa02a2c5 100644 --- a/domain/src/main/java/com/tangem/domain/common/TwinsHelper.kt +++ b/domain/legacy/src/main/java/com/tangem/domain/common/TwinsHelper.kt @@ -1,6 +1,7 @@ package com.tangem.domain.common import com.tangem.crypto.CryptoUtils +import com.tangem.domain.models.scan.CardDTO object TwinsHelper { private val firstCardSeries = listOf("CB61", "CB64") diff --git a/domain/src/main/java/com/tangem/domain/common/demo/DemoConfig.kt b/domain/legacy/src/main/java/com/tangem/domain/common/demo/DemoConfig.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/demo/DemoConfig.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/demo/DemoConfig.kt diff --git a/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt b/domain/legacy/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt diff --git a/domain/src/main/java/com/tangem/domain/common/extensions/ByteArray.kt b/domain/legacy/src/main/java/com/tangem/domain/common/extensions/ByteArray.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/extensions/ByteArray.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/extensions/ByteArray.kt diff --git a/domain/src/main/java/com/tangem/domain/common/extensions/CardSdk.kt b/domain/legacy/src/main/java/com/tangem/domain/common/extensions/CardSdk.kt similarity index 96% rename from domain/src/main/java/com/tangem/domain/common/extensions/CardSdk.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/extensions/CardSdk.kt index c7d205bbe0..77e154859f 100644 --- a/domain/src/main/java/com/tangem/domain/common/extensions/CardSdk.kt +++ b/domain/legacy/src/main/java/com/tangem/domain/common/extensions/CardSdk.kt @@ -3,8 +3,8 @@ package com.tangem.domain.common.extensions import com.tangem.blockchain.common.Blockchain import com.tangem.common.card.EllipticCurve import com.tangem.common.card.FirmwareVersion -import com.tangem.domain.common.CardDTO import com.tangem.domain.common.TapWorkarounds.isTestCard +import com.tangem.domain.models.scan.CardDTO /** [REDACTED_AUTHOR] diff --git a/domain/src/main/java/com/tangem/domain/common/extensions/Coroutine.kt b/domain/legacy/src/main/java/com/tangem/domain/common/extensions/Coroutine.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/extensions/Coroutine.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/extensions/Coroutine.kt diff --git a/domain/src/main/java/com/tangem/domain/common/extensions/ResultCardSdk.kt b/domain/legacy/src/main/java/com/tangem/domain/common/extensions/ResultCardSdk.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/extensions/ResultCardSdk.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/extensions/ResultCardSdk.kt diff --git a/domain/src/main/java/com/tangem/domain/common/form/FieldDataConverters.kt b/domain/legacy/src/main/java/com/tangem/domain/common/form/FieldDataConverters.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/form/FieldDataConverters.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/form/FieldDataConverters.kt diff --git a/domain/src/main/java/com/tangem/domain/common/form/FieldsValidators.kt b/domain/legacy/src/main/java/com/tangem/domain/common/form/FieldsValidators.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/form/FieldsValidators.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/form/FieldsValidators.kt diff --git a/domain/src/main/java/com/tangem/domain/common/form/Form.kt b/domain/legacy/src/main/java/com/tangem/domain/common/form/Form.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/form/Form.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/form/Form.kt diff --git a/domain/legacy/src/main/java/com/tangem/domain/common/util/ScanResponseExtensions.kt b/domain/legacy/src/main/java/com/tangem/domain/common/util/ScanResponseExtensions.kt new file mode 100644 index 0000000000..8438a87f14 --- /dev/null +++ b/domain/legacy/src/main/java/com/tangem/domain/common/util/ScanResponseExtensions.kt @@ -0,0 +1,47 @@ +package com.tangem.domain.common.util + +import com.tangem.blockchain.common.Blockchain +import com.tangem.common.card.EllipticCurve +import com.tangem.common.extensions.toMapKey +import com.tangem.crypto.hdWallet.DerivationPath +import com.tangem.domain.common.CardTypesResolver +import com.tangem.domain.common.TangemCardTypesResolver +import com.tangem.domain.common.TapWorkarounds.isTangemTwins +import com.tangem.domain.common.TapWorkarounds.isTestCard +import com.tangem.domain.models.scan.ScanResponse + +val ScanResponse.cardTypesResolver: CardTypesResolver + get() = TangemCardTypesResolver( + card = card, + productType = productType, + walletData = walletData, + ) + +fun ScanResponse.twinsIsTwinned(): Boolean = card.isTangemTwins && walletData != null && secondTwinPublicKey != null +fun ScanResponse.supportsHdWallet(): Boolean = card.settings.isHDWalletAllowed +fun ScanResponse.supportsBackup(): Boolean = card.settings.isBackupAllowed + +fun ScanResponse.hasDerivation(blockchain: Blockchain, rawDerivationPath: String): Boolean { + return hasDerivation(blockchain, DerivationPath(rawDerivationPath)) +} + +private fun ScanResponse.hasDerivation(blockchain: Blockchain, derivationPath: DerivationPath): Boolean { + val isTestnet = card.isTestCard || blockchain.isTestnet() + return when { + Blockchain.secp256k1Blockchains(isTestnet).contains(blockchain) -> { + hasDerivation(EllipticCurve.Secp256k1, derivationPath) + } + Blockchain.ed25519OnlyBlockchains(isTestnet).contains(blockchain) -> { + hasDerivation(EllipticCurve.Ed25519, derivationPath) + } + else -> false + } +} + +private fun ScanResponse.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 +} \ No newline at end of file diff --git a/domain/src/main/java/com/tangem/domain/common/util/UserWalletId.kt b/domain/legacy/src/main/java/com/tangem/domain/common/util/UserWalletId.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/util/UserWalletId.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/util/UserWalletId.kt diff --git a/domain/src/main/java/com/tangem/domain/common/util/ValueDebouncer.kt b/domain/legacy/src/main/java/com/tangem/domain/common/util/ValueDebouncer.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/common/util/ValueDebouncer.kt rename to domain/legacy/src/main/java/com/tangem/domain/common/util/ValueDebouncer.kt diff --git a/domain/src/main/java/com/tangem/domain/features/addCustomToken/AddCustomTokenService.kt b/domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/AddCustomTokenService.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/features/addCustomToken/AddCustomTokenService.kt rename to domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/AddCustomTokenService.kt diff --git a/domain/src/main/java/com/tangem/domain/features/addCustomToken/CustomCurrency.kt b/domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/CustomCurrency.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/features/addCustomToken/CustomCurrency.kt rename to domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/CustomCurrency.kt diff --git a/domain/src/main/java/com/tangem/domain/features/addCustomToken/FormFields.kt b/domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/FormFields.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/features/addCustomToken/FormFields.kt rename to domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/FormFields.kt diff --git a/domain/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenAction.kt b/domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenAction.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenAction.kt rename to domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenAction.kt diff --git a/domain/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenHub.kt b/domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenHub.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenHub.kt rename to domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenHub.kt diff --git a/domain/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenState.kt b/domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenState.kt similarity index 99% rename from domain/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenState.kt rename to domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenState.kt index 7076b19233..8d32aa4f6b 100644 --- a/domain/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenState.kt +++ b/domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/redux/AddCustomTokenState.kt @@ -6,7 +6,6 @@ import com.tangem.common.json.MoshiJsonConverter import com.tangem.datasource.api.tangemTech.models.CoinsResponse import com.tangem.domain.AddCustomTokenError import com.tangem.domain.DomainWrapped -import com.tangem.domain.common.CardDTO import com.tangem.domain.common.TapWorkarounds.isTestCard import com.tangem.domain.common.extensions.isSupportedInApp import com.tangem.domain.common.extensions.supportedBlockchains @@ -36,6 +35,7 @@ import com.tangem.domain.features.addCustomToken.CustomTokenFieldId.Symbol import com.tangem.domain.features.addCustomToken.TokenBlockchainField import com.tangem.domain.features.addCustomToken.TokenDerivationPathField import com.tangem.domain.features.addCustomToken.TokenField +import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.redux.DomainState import com.tangem.domain.redux.state.StringActionStateConverter import org.rekotlin.Action diff --git a/domain/src/main/java/com/tangem/domain/features/addCustomToken/redux/Models.kt b/domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/redux/Models.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/features/addCustomToken/redux/Models.kt rename to domain/legacy/src/main/java/com/tangem/domain/features/addCustomToken/redux/Models.kt diff --git a/domain/src/main/java/com/tangem/domain/redux/DomainState.kt b/domain/legacy/src/main/java/com/tangem/domain/redux/DomainState.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/redux/DomainState.kt rename to domain/legacy/src/main/java/com/tangem/domain/redux/DomainState.kt diff --git a/domain/src/main/java/com/tangem/domain/redux/DomainStore.kt b/domain/legacy/src/main/java/com/tangem/domain/redux/DomainStore.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/redux/DomainStore.kt rename to domain/legacy/src/main/java/com/tangem/domain/redux/DomainStore.kt diff --git a/domain/src/main/java/com/tangem/domain/redux/ReStoreHub.kt b/domain/legacy/src/main/java/com/tangem/domain/redux/ReStoreHub.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/redux/ReStoreHub.kt rename to domain/legacy/src/main/java/com/tangem/domain/redux/ReStoreHub.kt diff --git a/domain/src/main/java/com/tangem/domain/redux/extensions/Dispatch.kt b/domain/legacy/src/main/java/com/tangem/domain/redux/extensions/Dispatch.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/redux/extensions/Dispatch.kt rename to domain/legacy/src/main/java/com/tangem/domain/redux/extensions/Dispatch.kt diff --git a/domain/src/main/java/com/tangem/domain/redux/global/DomainGlobalAction.kt b/domain/legacy/src/main/java/com/tangem/domain/redux/global/DomainGlobalAction.kt similarity index 88% rename from domain/src/main/java/com/tangem/domain/redux/global/DomainGlobalAction.kt rename to domain/legacy/src/main/java/com/tangem/domain/redux/global/DomainGlobalAction.kt index f4256b644e..2c9edb34a5 100644 --- a/domain/src/main/java/com/tangem/domain/redux/global/DomainGlobalAction.kt +++ b/domain/legacy/src/main/java/com/tangem/domain/redux/global/DomainGlobalAction.kt @@ -1,7 +1,7 @@ package com.tangem.domain.redux.global import com.tangem.domain.DomainDialog -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse import org.rekotlin.Action /** diff --git a/domain/src/main/java/com/tangem/domain/redux/global/DomainGlobalHub.kt b/domain/legacy/src/main/java/com/tangem/domain/redux/global/DomainGlobalHub.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/redux/global/DomainGlobalHub.kt rename to domain/legacy/src/main/java/com/tangem/domain/redux/global/DomainGlobalHub.kt diff --git a/domain/src/main/java/com/tangem/domain/redux/global/DomainGlobalState.kt b/domain/legacy/src/main/java/com/tangem/domain/redux/global/DomainGlobalState.kt similarity index 93% rename from domain/src/main/java/com/tangem/domain/redux/global/DomainGlobalState.kt rename to domain/legacy/src/main/java/com/tangem/domain/redux/global/DomainGlobalState.kt index 231584ecf6..36a97859c9 100644 --- a/domain/src/main/java/com/tangem/domain/redux/global/DomainGlobalState.kt +++ b/domain/legacy/src/main/java/com/tangem/domain/redux/global/DomainGlobalState.kt @@ -3,7 +3,7 @@ package com.tangem.domain.redux.global import com.tangem.datasource.api.paymentology.PaymentologyApiService import com.tangem.datasource.api.tangemTech.TangemTechService import com.tangem.domain.DomainDialog -import com.tangem.domain.common.ScanResponse +import com.tangem.domain.models.scan.ScanResponse /** [REDACTED_AUTHOR] diff --git a/domain/src/main/java/com/tangem/domain/redux/state/StateConverter.kt b/domain/legacy/src/main/java/com/tangem/domain/redux/state/StateConverter.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/redux/state/StateConverter.kt rename to domain/legacy/src/main/java/com/tangem/domain/redux/state/StateConverter.kt diff --git a/domain/src/main/java/com/tangem/domain/redux/state/StateLogger.kt b/domain/legacy/src/main/java/com/tangem/domain/redux/state/StateLogger.kt similarity index 100% rename from domain/src/main/java/com/tangem/domain/redux/state/StateLogger.kt rename to domain/legacy/src/main/java/com/tangem/domain/redux/state/StateLogger.kt diff --git a/domain/src/test/java/com/tangem/domain/features/BlockchainTests.kt b/domain/legacy/src/test/java/com/tangem/domain/features/BlockchainTests.kt similarity index 100% rename from domain/src/test/java/com/tangem/domain/features/BlockchainTests.kt rename to domain/legacy/src/test/java/com/tangem/domain/features/BlockchainTests.kt diff --git a/domain/models/.gitignore b/domain/models/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/domain/models/.gitignore @@ -0,0 +1 @@ +/build diff --git a/domain/models/build.gradle.kts b/domain/models/build.gradle.kts new file mode 100644 index 0000000000..fbccb4120d --- /dev/null +++ b/domain/models/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + alias(deps.plugins.kotlin.jvm) + id("configuration") +} + +dependencies { + implementation(deps.tangem.card.core) + implementation(deps.moshi.kotlin) +} \ No newline at end of file diff --git a/domain/src/main/java/com/tangem/domain/common/CardDTO.kt b/domain/models/src/main/kotlin/com/tangem/domain/models/scan/CardDTO.kt similarity index 99% rename from domain/src/main/java/com/tangem/domain/common/CardDTO.kt rename to domain/models/src/main/kotlin/com/tangem/domain/models/scan/CardDTO.kt index 38494e9294..fa9bb0ee84 100644 --- a/domain/src/main/java/com/tangem/domain/common/CardDTO.kt +++ b/domain/models/src/main/kotlin/com/tangem/domain/models/scan/CardDTO.kt @@ -1,4 +1,4 @@ -package com.tangem.domain.common +package com.tangem.domain.models.scan import com.squareup.moshi.JsonClass import com.tangem.common.card.Card @@ -8,7 +8,7 @@ import com.tangem.common.card.EncryptionMode import com.tangem.crypto.hdWallet.DerivationPath import com.tangem.crypto.hdWallet.bip32.ExtendedPublicKey import com.tangem.operations.attestation.Attestation -import java.util.* +import java.util.Date import com.tangem.common.card.FirmwareVersion as SdkFirmwareVersion /** diff --git a/domain/models/src/main/kotlin/com/tangem/domain/models/scan/ScanResponse.kt b/domain/models/src/main/kotlin/com/tangem/domain/models/scan/ScanResponse.kt new file mode 100644 index 0000000000..c9cae94a64 --- /dev/null +++ b/domain/models/src/main/kotlin/com/tangem/domain/models/scan/ScanResponse.kt @@ -0,0 +1,24 @@ +package com.tangem.domain.models.scan + +import com.tangem.common.card.WalletData +import com.tangem.common.extensions.ByteArrayKey +import com.tangem.operations.backup.PrimaryCard +import com.tangem.operations.derivation.ExtendedPublicKeysMap + +/** +[REDACTED_AUTHOR] + */ +data class ScanResponse( + val card: CardDTO, + val productType: ProductType, + val walletData: WalletData?, + val secondTwinPublicKey: String? = null, + val derivedKeys: Map = mapOf(), + val primaryCard: PrimaryCard? = null, +) + +typealias KeyWalletPublicKey = ByteArrayKey + +enum class ProductType { + Note, Twins, Wallet, SaltPay, Start2Coin +} \ No newline at end of file diff --git a/domain/src/main/java/com/tangem/domain/common/CardInfo.kt b/domain/src/main/java/com/tangem/domain/common/CardInfo.kt deleted file mode 100644 index 7953c475ac..0000000000 --- a/domain/src/main/java/com/tangem/domain/common/CardInfo.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.tangem.domain.common - -import com.tangem.common.card.WalletData -import com.tangem.operations.backup.PrimaryCard -import com.tangem.operations.derivation.ExtendedPublicKeysMap - -data class CardInfo( - val card: CardDTO, - val productType: ProductType, - val walletData: WalletData?, - val secondTwinPublicKey: String?, - val derivedKeys: Map, - val primaryCard: PrimaryCard?, -) \ No newline at end of file diff --git a/domain/src/main/java/com/tangem/domain/common/ScanResponse.kt b/domain/src/main/java/com/tangem/domain/common/ScanResponse.kt deleted file mode 100644 index a93b21fba7..0000000000 --- a/domain/src/main/java/com/tangem/domain/common/ScanResponse.kt +++ /dev/null @@ -1,63 +0,0 @@ -package com.tangem.domain.common - -import com.tangem.blockchain.common.Blockchain -import com.tangem.common.card.EllipticCurve -import com.tangem.common.card.WalletData -import com.tangem.common.extensions.ByteArrayKey -import com.tangem.common.extensions.toMapKey -import com.tangem.crypto.hdWallet.DerivationPath -import com.tangem.domain.common.TapWorkarounds.isTangemTwins -import com.tangem.domain.common.TapWorkarounds.isTestCard -import com.tangem.operations.CommandResponse -import com.tangem.operations.backup.PrimaryCard -import com.tangem.operations.derivation.ExtendedPublicKeysMap - -/** -[REDACTED_AUTHOR] - */ -data class ScanResponse( - val card: CardDTO, - val productType: ProductType, - val walletData: WalletData?, - val secondTwinPublicKey: String? = null, - val derivedKeys: Map = mapOf(), - val primaryCard: PrimaryCard? = null, -) : CommandResponse { - - val cardTypesResolver: CardTypesResolver = TangemCardTypesResolver( - card = card, - productType = productType, - walletData = walletData, - ) - - fun twinsIsTwinned(): Boolean = card.isTangemTwins && walletData != null && secondTwinPublicKey != null - fun supportsHdWallet(): Boolean = card.settings.isHDWalletAllowed - fun supportsBackup(): Boolean = card.settings.isBackupAllowed - - fun hasDerivation(blockchain: Blockchain, rawDerivationPath: String): Boolean { - return hasDerivation(blockchain, DerivationPath(rawDerivationPath)) - } - - private fun hasDerivation(blockchain: Blockchain, derivationPath: DerivationPath): Boolean { - val isTestnet = card.isTestCard || blockchain.isTestnet() - return when { - Blockchain.secp256k1Blockchains(isTestnet).contains(blockchain) -> { - hasDerivation(EllipticCurve.Secp256k1, derivationPath) - } - Blockchain.ed25519OnlyBlockchains(isTestnet).contains(blockchain) -> { - hasDerivation(EllipticCurve.Ed25519, derivationPath) - } - else -> false - } - } - - private 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 - } -} - -typealias KeyWalletPublicKey = ByteArrayKey \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index dbb3202511..d3f3310ef6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -29,7 +29,6 @@ dependencyResolutionManagement { } include(":app") -include(":domain") include(":common") // region Core modules @@ -57,4 +56,10 @@ include(":features:swap:presentation") include(":features:tester:api") include(":features:tester:impl") -// endregion Feature modules \ No newline at end of file +// endregion Feature modules + +// region Domain modules +// TODO: Remove, temporary modules +include(":domain:models") +include(":domain:legacy") +// endregion Domain modules \ No newline at end of file From 0ebbd12b953ad1bc99d3dde0782ce679f49fa62b Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 24 Apr 2023 10:01:52 +0300 Subject: [PATCH 09/68] Updated on 2026-08-14 --- gradle/dependencies.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/dependencies.toml b/gradle/dependencies.toml index db5dc2a6f6..5d83697c53 100644 --- a/gradle/dependencies.toml +++ b/gradle/dependencies.toml @@ -65,7 +65,7 @@ xmlShimmer = "1.1.3" zendeskChat = "3.3.5" zendeskMessaging = "5.2.4" zxingQrBarcodeScanner = "1.9.8" -zxingQrCode = "3.3.3" +zxingQrCode = "3.5.1" mviCore = "1.3.1" kotlinSerialization = "1.4.1" # endregion Other libraries From 4681ebb29d69ff7bc5d23e172b5a56efc4e0f4c2 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 24 Apr 2023 16:14:31 +0800 Subject: [PATCH 10/68] Updated on 2026-08-14 --- .../java/com/tangem/tap/TapApplication.kt | 5 ++++ .../common/compose/ComposeDialogManager.kt | 2 +- .../tap/common/extensions/Navigation.kt | 14 +++++++++-- .../CustomTokenFeatureToggles.kt | 12 ++++++++++ .../di/CustomTokenFeatureTogglesModule.kt | 24 +++++++++++++++++++ .../DefaultCustomTokenFeatureToggles.kt | 19 +++++++++++++++ .../presentation/AddCustomTokenFragment.kt | 12 ++++++++++ .../legacy}/AddCustomTokenFragment.kt | 4 ++-- .../legacy}/compose/AddCustomTokenScreen.kt | 6 ++--- .../legacy}/compose/FormFieldViews.kt | 2 +- .../compose/HangingOverKeyboardView.kt | 2 +- .../compose/SelectTokenNetworkDialog.kt | 2 +- .../compose/test/ContractAddressTests.kt | 2 +- .../legacy}/compose/test/TestCasesList.kt | 2 +- .../tap/proxy/redux/DaggerGraphAction.kt | 2 ++ .../tap/proxy/redux/DaggerGraphReducer.kt | 1 + .../tap/proxy/redux/DaggerGraphState.kt | 2 ++ .../configs/feature_toggles_config.json | 4 ++++ .../featuretoggles/ui/FeatureTogglesScreen.kt | 5 +++- 19 files changed, 108 insertions(+), 14 deletions(-) create mode 100644 app/src/main/java/com/tangem/tap/features/customtoken/api/featuretoggles/CustomTokenFeatureToggles.kt create mode 100644 app/src/main/java/com/tangem/tap/features/customtoken/impl/di/CustomTokenFeatureTogglesModule.kt create mode 100644 app/src/main/java/com/tangem/tap/features/customtoken/impl/featuretoggles/DefaultCustomTokenFeatureToggles.kt create mode 100644 app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/AddCustomTokenFragment.kt rename app/src/main/java/com/tangem/tap/features/{addCustomToken => customtoken/legacy}/AddCustomTokenFragment.kt (95%) rename app/src/main/java/com/tangem/tap/features/{addCustomToken => customtoken/legacy}/compose/AddCustomTokenScreen.kt (97%) rename app/src/main/java/com/tangem/tap/features/{addCustomToken => customtoken/legacy}/compose/FormFieldViews.kt (99%) rename app/src/main/java/com/tangem/tap/features/{addCustomToken => customtoken/legacy}/compose/HangingOverKeyboardView.kt (94%) rename app/src/main/java/com/tangem/tap/features/{addCustomToken => customtoken/legacy}/compose/SelectTokenNetworkDialog.kt (92%) rename app/src/main/java/com/tangem/tap/features/{addCustomToken => customtoken/legacy}/compose/test/ContractAddressTests.kt (98%) rename app/src/main/java/com/tangem/tap/features/{addCustomToken => customtoken/legacy}/compose/test/TestCasesList.kt (96%) diff --git a/app/src/main/java/com/tangem/tap/TapApplication.kt b/app/src/main/java/com/tangem/tap/TapApplication.kt index 87f540fc6b..f8efc046b2 100644 --- a/app/src/main/java/com/tangem/tap/TapApplication.kt +++ b/app/src/main/java/com/tangem/tap/TapApplication.kt @@ -49,6 +49,7 @@ import com.tangem.tap.domain.walletStores.repository.WalletManagersRepository import com.tangem.tap.domain.walletStores.repository.WalletStoresRepository import com.tangem.tap.domain.walletStores.repository.di.provideDefaultImplementation import com.tangem.tap.domain.walletconnect.WalletConnectRepository +import com.tangem.tap.features.customtoken.api.featuretoggles.CustomTokenFeatureToggles import com.tangem.tap.features.tokens.api.featuretoggles.TokensListFeatureToggles import com.tangem.tap.persistence.PreferencesStorage import com.tangem.tap.proxy.AppStateHolder @@ -130,6 +131,9 @@ class TapApplication : Application(), ImageLoaderFactory { @Inject lateinit var tokensListFeatureToggles: TokensListFeatureToggles + @Inject + lateinit var customTokenFeatureToggles: CustomTokenFeatureToggles + override fun onCreate() { super.onCreate() @@ -179,6 +183,7 @@ class TapApplication : Application(), ImageLoaderFactory { assetReader = assetReader, networkConnectionManager = networkConnectionManager, tokensListFeatureToggles = tokensListFeatureToggles, + customTokenFeatureToggles = customTokenFeatureToggles, ), ) diff --git a/app/src/main/java/com/tangem/tap/common/compose/ComposeDialogManager.kt b/app/src/main/java/com/tangem/tap/common/compose/ComposeDialogManager.kt index e762a3dabe..617f2f2c46 100644 --- a/app/src/main/java/com/tangem/tap/common/compose/ComposeDialogManager.kt +++ b/app/src/main/java/com/tangem/tap/common/compose/ComposeDialogManager.kt @@ -36,7 +36,7 @@ import com.tangem.domain.redux.domainStore import com.tangem.domain.redux.global.DomainGlobalAction import com.tangem.domain.redux.global.DomainGlobalState import com.tangem.tap.domain.moduleMessage.ModuleMessageConverter -import com.tangem.tap.features.addCustomToken.compose.SelectTokenNetworkDialog +import com.tangem.tap.features.customtoken.legacy.compose.SelectTokenNetworkDialog import com.tangem.wallet.R import org.rekotlin.StoreSubscriber diff --git a/app/src/main/java/com/tangem/tap/common/extensions/Navigation.kt b/app/src/main/java/com/tangem/tap/common/extensions/Navigation.kt index 42d6017a42..efd80355aa 100644 --- a/app/src/main/java/com/tangem/tap/common/extensions/Navigation.kt +++ b/app/src/main/java/com/tangem/tap/common/extensions/Navigation.kt @@ -9,7 +9,7 @@ import com.tangem.feature.referral.ReferralFragment import com.tangem.feature.swap.presentation.SwapFragment import com.tangem.tap.common.redux.navigation.AppScreen import com.tangem.tap.common.redux.navigation.FragmentShareTransition -import com.tangem.tap.features.addCustomToken.AddCustomTokenFragment +import com.tangem.tap.features.customtoken.legacy.AddCustomTokenFragment import com.tangem.tap.features.details.ui.appsettings.AppSettingsFragment import com.tangem.tap.features.details.ui.cardsettings.CardSettingsFragment import com.tangem.tap.features.details.ui.cardsettings.coderecovery.AccessCodeRecoveryFragment @@ -37,6 +37,7 @@ import com.tangem.tap.proxy.redux.DaggerGraphState import com.tangem.tap.store import com.tangem.wallet.R import timber.log.Timber +import com.tangem.tap.features.customtoken.impl.presentation.AddCustomTokenFragment as RedesignedAddCustomTokenFragment fun FragmentActivity.openFragment( screen: AppScreen, @@ -118,7 +119,16 @@ private fun fragmentFactory(screen: AppScreen): Fragment { ) if (featureToggles.isRedesignedScreenEnabled) TokensListFragment() else AddTokensFragment() } - AppScreen.AddCustomToken -> AddCustomTokenFragment() + AppScreen.AddCustomToken -> { + val featureToggles = store.state.daggerGraphState.get( + getDependency = DaggerGraphState::customTokenFeatureToggles, + ) + if (featureToggles.isRedesignedScreenEnabled) { + RedesignedAddCustomTokenFragment() + } else { + AddCustomTokenFragment() + } + } AppScreen.WalletDetails -> WalletDetailsFragment() AppScreen.WalletConnectSessions -> WalletConnectFragment() AppScreen.QrScan -> QrScanFragment() diff --git a/app/src/main/java/com/tangem/tap/features/customtoken/api/featuretoggles/CustomTokenFeatureToggles.kt b/app/src/main/java/com/tangem/tap/features/customtoken/api/featuretoggles/CustomTokenFeatureToggles.kt new file mode 100644 index 0000000000..6de26f4bd2 --- /dev/null +++ b/app/src/main/java/com/tangem/tap/features/customtoken/api/featuretoggles/CustomTokenFeatureToggles.kt @@ -0,0 +1,12 @@ +package com.tangem.tap.features.customtoken.api.featuretoggles + +/** + * Add custom token feature toggles + * +[REDACTED_AUTHOR] + */ +interface CustomTokenFeatureToggles { + + /** Availability of redesigned screen (internal feature) */ + val isRedesignedScreenEnabled: Boolean +} \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/customtoken/impl/di/CustomTokenFeatureTogglesModule.kt b/app/src/main/java/com/tangem/tap/features/customtoken/impl/di/CustomTokenFeatureTogglesModule.kt new file mode 100644 index 0000000000..5648aa592d --- /dev/null +++ b/app/src/main/java/com/tangem/tap/features/customtoken/impl/di/CustomTokenFeatureTogglesModule.kt @@ -0,0 +1,24 @@ +package com.tangem.tap.features.customtoken.impl.di + +import com.tangem.core.featuretoggle.manager.FeatureTogglesManager +import com.tangem.tap.features.customtoken.api.featuretoggles.CustomTokenFeatureToggles +import com.tangem.tap.features.customtoken.impl.featuretoggles.DefaultCustomTokenFeatureToggles +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent +import javax.inject.Singleton + +/** +[REDACTED_AUTHOR] + */ +@Module +@InstallIn(SingletonComponent::class) +internal object CustomTokenFeatureTogglesModule { + + @Provides + @Singleton + fun providesCustomTokenFeatureToggles(featureTogglesManager: FeatureTogglesManager): CustomTokenFeatureToggles { + return DefaultCustomTokenFeatureToggles(featureTogglesManager) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/customtoken/impl/featuretoggles/DefaultCustomTokenFeatureToggles.kt b/app/src/main/java/com/tangem/tap/features/customtoken/impl/featuretoggles/DefaultCustomTokenFeatureToggles.kt new file mode 100644 index 0000000000..fbdc41b2c0 --- /dev/null +++ b/app/src/main/java/com/tangem/tap/features/customtoken/impl/featuretoggles/DefaultCustomTokenFeatureToggles.kt @@ -0,0 +1,19 @@ +package com.tangem.tap.features.customtoken.impl.featuretoggles + +import com.tangem.core.featuretoggle.manager.FeatureTogglesManager +import com.tangem.tap.features.customtoken.api.featuretoggles.CustomTokenFeatureToggles + +/** + * Default implementation of CustomToken feature toggles + * + * @property featureTogglesManager manager for getting information about the availability of feature toggles + * +[REDACTED_AUTHOR] + */ +internal class DefaultCustomTokenFeatureToggles( + private val featureTogglesManager: FeatureTogglesManager, +) : CustomTokenFeatureToggles { + + override val isRedesignedScreenEnabled: Boolean + get() = featureTogglesManager.isFeatureEnabled(name = "REDESIGNED_CUSTOM_TOKEN_SCREEN_ENABLED") +} \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/AddCustomTokenFragment.kt b/app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/AddCustomTokenFragment.kt new file mode 100644 index 0000000000..e08097076b --- /dev/null +++ b/app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/AddCustomTokenFragment.kt @@ -0,0 +1,12 @@ +package com.tangem.tap.features.customtoken.impl.presentation + +import androidx.fragment.app.Fragment +import dagger.hilt.android.AndroidEntryPoint + +/** + * Add custom token screen + * +[REDACTED_AUTHOR] + */ +@AndroidEntryPoint +internal class AddCustomTokenFragment : Fragment() \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/addCustomToken/AddCustomTokenFragment.kt b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/AddCustomTokenFragment.kt similarity index 95% rename from app/src/main/java/com/tangem/tap/features/addCustomToken/AddCustomTokenFragment.kt rename to app/src/main/java/com/tangem/tap/features/customtoken/legacy/AddCustomTokenFragment.kt index 39689b35e5..21567f588c 100644 --- a/app/src/main/java/com/tangem/tap/features/addCustomToken/AddCustomTokenFragment.kt +++ b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/AddCustomTokenFragment.kt @@ -1,4 +1,4 @@ -package com.tangem.tap.features.addCustomToken +package com.tangem.tap.features.customtoken.legacy import android.os.Bundle import android.view.View @@ -19,7 +19,7 @@ import com.tangem.tap.common.compose.ClosePopupTrigger import com.tangem.tap.features.BaseStoreFragment import com.tangem.tap.features.FragmentOnBackPressedHandler import com.tangem.tap.features.addBackPressHandler -import com.tangem.tap.features.addCustomToken.compose.AddCustomTokenScreen +import com.tangem.tap.features.customtoken.legacy.compose.AddCustomTokenScreen import com.tangem.wallet.R import org.rekotlin.StoreSubscriber diff --git a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/AddCustomTokenScreen.kt b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/AddCustomTokenScreen.kt similarity index 97% rename from app/src/main/java/com/tangem/tap/features/addCustomToken/compose/AddCustomTokenScreen.kt rename to app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/AddCustomTokenScreen.kt index 9342b868d1..88ba8be37d 100644 --- a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/AddCustomTokenScreen.kt +++ b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/AddCustomTokenScreen.kt @@ -1,4 +1,4 @@ -package com.tangem.tap.features.addCustomToken.compose +package com.tangem.tap.features.customtoken.legacy.compose import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -52,8 +52,8 @@ import com.tangem.tap.common.compose.AddCustomTokenWarning import com.tangem.tap.common.compose.ClosePopupTrigger import com.tangem.tap.common.compose.ComposeDialogManager import com.tangem.tap.domain.moduleMessage.ModuleMessageConverter -import com.tangem.tap.features.addCustomToken.compose.test.TestCase -import com.tangem.tap.features.addCustomToken.compose.test.TestCasesList +import com.tangem.tap.features.customtoken.legacy.compose.test.TestCase +import com.tangem.tap.features.customtoken.legacy.compose.test.TestCasesList import com.tangem.wallet.R import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/FormFieldViews.kt b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/FormFieldViews.kt similarity index 99% rename from app/src/main/java/com/tangem/tap/features/addCustomToken/compose/FormFieldViews.kt rename to app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/FormFieldViews.kt index 069d9f6823..9b5c87e6b7 100644 --- a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/FormFieldViews.kt +++ b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/FormFieldViews.kt @@ -1,4 +1,4 @@ -package com.tangem.tap.features.addCustomToken.compose +package com.tangem.tap.features.customtoken.legacy.compose import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.runtime.Composable diff --git a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/HangingOverKeyboardView.kt b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/HangingOverKeyboardView.kt similarity index 94% rename from app/src/main/java/com/tangem/tap/features/addCustomToken/compose/HangingOverKeyboardView.kt rename to app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/HangingOverKeyboardView.kt index 54f0d74243..6aa2994210 100644 --- a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/HangingOverKeyboardView.kt +++ b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/HangingOverKeyboardView.kt @@ -1,4 +1,4 @@ -package com.tangem.tap.features.addCustomToken.compose +package com.tangem.tap.features.customtoken.legacy.compose import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.BoxScope diff --git a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/SelectTokenNetworkDialog.kt b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/SelectTokenNetworkDialog.kt similarity index 92% rename from app/src/main/java/com/tangem/tap/features/addCustomToken/compose/SelectTokenNetworkDialog.kt rename to app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/SelectTokenNetworkDialog.kt index b30ab3c9e9..fd824e960f 100644 --- a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/SelectTokenNetworkDialog.kt +++ b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/SelectTokenNetworkDialog.kt @@ -1,4 +1,4 @@ -package com.tangem.tap.features.addCustomToken.compose +package com.tangem.tap.features.customtoken.legacy.compose import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource diff --git a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/test/ContractAddressTests.kt b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/test/ContractAddressTests.kt similarity index 98% rename from app/src/main/java/com/tangem/tap/features/addCustomToken/compose/test/ContractAddressTests.kt rename to app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/test/ContractAddressTests.kt index 6ba18d8a22..3ba171f427 100644 --- a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/test/ContractAddressTests.kt +++ b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/test/ContractAddressTests.kt @@ -1,4 +1,4 @@ -package com.tangem.tap.features.addCustomToken.compose.test +package com.tangem.tap.features.customtoken.legacy.compose.test import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth diff --git a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/test/TestCasesList.kt b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/test/TestCasesList.kt similarity index 96% rename from app/src/main/java/com/tangem/tap/features/addCustomToken/compose/test/TestCasesList.kt rename to app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/test/TestCasesList.kt index 7f92a0a666..3bae26e193 100644 --- a/app/src/main/java/com/tangem/tap/features/addCustomToken/compose/test/TestCasesList.kt +++ b/app/src/main/java/com/tangem/tap/features/customtoken/legacy/compose/test/TestCasesList.kt @@ -1,4 +1,4 @@ -package com.tangem.tap.features.addCustomToken.compose.test +package com.tangem.tap.features.customtoken.legacy.compose.test import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row diff --git a/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphAction.kt b/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphAction.kt index 57cdad3cf3..65a4cdb3e9 100644 --- a/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphAction.kt +++ b/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphAction.kt @@ -3,6 +3,7 @@ package com.tangem.tap.proxy.redux import com.tangem.datasource.asset.AssetReader import com.tangem.datasource.connection.NetworkConnectionManager import com.tangem.features.tester.api.TesterRouter +import com.tangem.tap.features.customtoken.api.featuretoggles.CustomTokenFeatureToggles import com.tangem.tap.features.tokens.api.featuretoggles.TokensListFeatureToggles import org.rekotlin.Action @@ -12,6 +13,7 @@ sealed interface DaggerGraphAction : Action { val assetReader: AssetReader, val networkConnectionManager: NetworkConnectionManager, val tokensListFeatureToggles: TokensListFeatureToggles, + val customTokenFeatureToggles: CustomTokenFeatureToggles, ) : DaggerGraphAction data class SetActivityDependencies(val testerRouter: TesterRouter) : DaggerGraphAction diff --git a/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphReducer.kt b/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphReducer.kt index 65cfee1cf5..3bb0e65284 100644 --- a/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphReducer.kt +++ b/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphReducer.kt @@ -16,6 +16,7 @@ object DaggerGraphReducer { assetReader = action.assetReader, networkConnectionManager = action.networkConnectionManager, tokensListFeatureToggles = action.tokensListFeatureToggles, + customTokenFeatureToggles = action.customTokenFeatureToggles, ) is DaggerGraphAction.SetActivityDependencies -> state.daggerGraphState.copy( testerRouter = action.testerRouter, diff --git a/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphState.kt b/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphState.kt index 792009c602..dd0a501489 100644 --- a/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphState.kt +++ b/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphState.kt @@ -3,6 +3,7 @@ package com.tangem.tap.proxy.redux import com.tangem.datasource.asset.AssetReader import com.tangem.datasource.connection.NetworkConnectionManager import com.tangem.features.tester.api.TesterRouter +import com.tangem.tap.features.customtoken.api.featuretoggles.CustomTokenFeatureToggles import com.tangem.tap.features.tokens.api.featuretoggles.TokensListFeatureToggles import org.rekotlin.StateType @@ -11,6 +12,7 @@ data class DaggerGraphState( val testerRouter: TesterRouter? = null, val networkConnectionManager: NetworkConnectionManager? = null, val tokensListFeatureToggles: TokensListFeatureToggles? = null, + val customTokenFeatureToggles: CustomTokenFeatureToggles? = null, ) : StateType { inline fun get(getDependency: DaggerGraphState.() -> T?): T { diff --git a/core/featuretoggles/src/main/assets/configs/feature_toggles_config.json b/core/featuretoggles/src/main/assets/configs/feature_toggles_config.json index 26ee85d521..738e44b33c 100644 --- a/core/featuretoggles/src/main/assets/configs/feature_toggles_config.json +++ b/core/featuretoggles/src/main/assets/configs/feature_toggles_config.json @@ -6,5 +6,9 @@ { "name": "REDESIGNED_TOKEN_LIST_SCREEN_ENABLED", "version": "4.4.0" + }, + { + "name": "REDESIGNED_CUSTOM_TOKEN_SCREEN_ENABLED", + "version": "4.5.0" } ] \ No newline at end of file diff --git a/features/tester/impl/src/main/java/com/tangem/feature/tester/presentation/featuretoggles/ui/FeatureTogglesScreen.kt b/features/tester/impl/src/main/java/com/tangem/feature/tester/presentation/featuretoggles/ui/FeatureTogglesScreen.kt index c64548832a..7ce0c9ff6d 100644 --- a/features/tester/impl/src/main/java/com/tangem/feature/tester/presentation/featuretoggles/ui/FeatureTogglesScreen.kt +++ b/features/tester/impl/src/main/java/com/tangem/feature/tester/presentation/featuretoggles/ui/FeatureTogglesScreen.kt @@ -16,6 +16,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import com.tangem.core.ui.components.appbar.AppBarWithBackButton import com.tangem.core.ui.res.TangemTheme @@ -62,9 +63,11 @@ private fun FeatureToggleItem(toggle: TesterFeatureToggle, onCheckedChange: (Boo ) { Text( text = toggle.name, + modifier = Modifier.weight(1f), color = TangemTheme.colors.text.primary1, + overflow = TextOverflow.Ellipsis, maxLines = 1, - style = TangemTheme.typography.body1, + style = TangemTheme.typography.body2, ) Switch( checked = toggle.isEnabled, From 9961832e6786f885d08d0ef820c45b94e53ae0d9 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 24 Apr 2023 13:02:57 +0400 Subject: [PATCH 11/68] Updated on 2026-08-14 --- core/res/src/main/res/values-de/strings.xml | 429 ------------------ core/res/src/main/res/values-fr/strings.xml | 429 ------------------ core/res/src/main/res/values-it/strings.xml | 429 ------------------ core/res/src/main/res/values-ru/strings.xml | 8 +- .../src/main/res/values-zh-rTW/strings.xml | 8 - core/res/src/main/res/values/strings.xml | 8 +- 6 files changed, 5 insertions(+), 1306 deletions(-) diff --git a/core/res/src/main/res/values-de/strings.xml b/core/res/src/main/res/values-de/strings.xml index 71e94a8a0c..a2985232fd 100644 --- a/core/res/src/main/res/values-de/strings.xml +++ b/core/res/src/main/res/values-de/strings.xml @@ -1,313 +1,38 @@ - - - - Diese Karte wurde früher bereits aufgeladen und Transaktionen wurden damit signiert. Ziehen Sie eine sofortige Auszahlung aller Beträge in Betracht, wenn Sie diese Karte von einer nicht vertrauenswürdigen Quelle erhalten haben. - - Die von Ihnen gescannte Karte ist eine Entwicklungskarte. Akzeptieren Sie sie nicht als Zahlungsmittel. - - - - - - Diese Karte ist für die Zusammenarbeit mit Tangem nicht geeignet - - - - - - - - - - - - - - - - - - - - - - - Tangem Bot - - - - - Akzeptieren - - Bilanz: %s - - Sie haben keinen Zugang zur Kamera erteilt, bitte passen Sie Ihre Datenschutzeinstellungen an Abbrechen - - - - Entfernen - - Erledigt - - Fehler - - OK - - - Änderungen speichern - - - - - - - Erfolg - - Warnung - - - - - - - - - - - - - - - - - - - - - Zugangscode Sie müssen den richtigen Zugangscode eingeben, bevor Sie die Karte scannen. Langes Tippen Dieser Mechanismus schützt vor Annäherungsangriffen auf eine Karte. Es wird eine Verzögerung zwischen dem Empfang und der Ausführung eines Befehls erzwungen. Nach der ersten signierten Transaktion wird dieses Telefon mit der Karte verknüpft und die Transaktionen werden sofort signiert Passcode Bevor Sie einen Befehl ausführen, der eine Änderung des Kartenstatus zur Folge hat, müssen Sie den Passcode eingeben. - - %s Hasch - KartenID - App Währung Emittent - Signiert Details - Nutzungsbedingungen - - - - - - - - - - - - - - - Tippen Sie um den Zugangscode zu ändern Tippen Sie um den Passcode zu ändern - Legen Sie die Karte zum Scannen an Tippen um zu signieren Legen Sie die Karte an - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Betrag Adresse Adresse oder PayString @@ -315,8 +40,6 @@ PayString ist nicht registriert PayString-Anfrage ist fehlgeschlagen PayString wird von der Blockchain nicht unterstützt - - Tag Memo inkl. Gebühr @@ -327,146 +50,20 @@ Höchstbetrag Netzgebühr Absenden - Gesamt %1$s und %2$s werden gesendet ≈ %1$s (inkl. Gebühr: %2$s) %s wird gesendet Die Transaktion wurde erfolgreich signiert und an den Blockchain-Knoten gesendet. Die Walletbilanz wird aktualisiert Ungültige Adresse - - - Tangem Wallet - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tangem Twin - - - - - - - - - - - - PayString erstellen - - - Die Bilanz wird aufgeladen… - Die Transaktion läuft… Verifizierte Bilanz - - ein Wallet erstellen - Absenden - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WalletConnect PayString erstellen $payid.tangem.com @@ -475,11 +72,8 @@ Fehlerantwort beim Erstellen der PayString PayString Name PayString sind Ihre einzigartigen Identifikationsdaten wie Telefonnummer, E-Mail-Adresse oder ABN. - Leere Karte Erstellen Sie ein Wallet um die Tangem-Karte verwenden zu können - - Das Konto ist nicht erstellt Diese Karte wird nicht unterstützt Ihre Tangem-Karte wurde für die Arbeit mit einer anderen App ausgestellt. Bitte sehen Sie sich den Namen und die Anleitung auf Ihrer Karte an und installieren Sie eine korrekte App @@ -490,28 +84,5 @@ Senden an %s Tangem - - OK, ich hab\'s! - - - - - - - - - - - - - - - - - - - - - diff --git a/core/res/src/main/res/values-fr/strings.xml b/core/res/src/main/res/values-fr/strings.xml index a82b4bb258..fb6996f229 100644 --- a/core/res/src/main/res/values-fr/strings.xml +++ b/core/res/src/main/res/values-fr/strings.xml @@ -1,313 +1,38 @@ - - - - Cette carte a déjà été rechargée et a signé des transactions avant. Envisagez la possibilité de retirer tous les fonds immédiatement si vous avez reçu cette carte d\'une source non fiable. - - La carte que vous avez scannée est une carte de développement. Ne l\'acceptez pas comme paiement. - - - - - - Cette carte n\'est pas conçue pour fonctionner avec Tangem - - - - - - - - - - - - - - - - - - - - - - - Tangem Bot - - - - - J\'accepte - - Solde : %s - - Vous n\'avez pas octroyé l\'accès à votre caméra, veuillez modifier vos paramètres de confidentialité Annuler - - - - Supprimer - - Exécuté - - Erreur - - OK - - - Sauvegarder les modifications - - - - - - - Avec succès - - Alerte - - - - - - - - - - - - - - - - - - - - - Code d\'accès Vous devrez entrer le mot de passe correct avant de scanner la carte Tenez la carte fermement Ce mécanisme protège contre les attaques sans contact sur la carte. Il y a un délai entre la réception et l\'exécution de la commande. Après la première transaction signée, ce téléphone sera associé à la carte et les transactions seront signées immédiatement. Mot de passe Avant d\'exécuter une commande qui modifie l\'état de la carte, vous devrez entrer un mot de passe. - - %s hashes - ID de la carte - Monnaie de l\'application Emetteur - Signé Référénces - Conditions d\'utilisation - - - - - - - - - - - - - - - Touchez, pour modifier le code d\'accès Touchez, pour modifier le mot de passe - Posez pour scanner Touchez pour signer Posez la carte - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Somme Adresse Adresse ou PayString @@ -315,8 +40,6 @@ PayString non enregistré La demande de PayString a échoué PayString non pris en charge par la blockchain - - Tag Memo Inclure les commissions @@ -327,146 +50,20 @@ Somme maximale Commissions du réseau Envoyer - Total Sera envoyé %1$s et %2$s ≈ %1$s (incl. les commissions : %2$s) Sera envoyé %s La transaction a été signée avec succès et envoyée au nœud de blockchain. Le solde du portefeuille sera mis à jour après un certain temps Adresse incorrecte - - - Tangem Wallet - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tangem Twin - - - - - - - - - - - - Créer PayString - - - Solde est en cours de téléchargement… - Transaction en cours… Solde confirmé - - Créer un portefeuille - Envoyer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WalletConnect Créer PayString $payid.tangem.com @@ -475,11 +72,8 @@ Mauvaise réponse lors de la création de PayString Dénomination PayString Votre PayString est une information qui vous est propre, comme un numéro de téléphone, une adresse du courrier électronique ou un ABN. - Carte vide Créez un portefeuille pour commencer à utiliser votre carte Tangem - - Compte n\'est pas créé Cette carte n\'est pas prise en charge Votre carte Tangem a été créée pour fonctionner avec une autre application. Regardez le nom et les instructions sur votre carte et installez l\'application pertinente @@ -490,28 +84,5 @@ Envoi jusqu\'à %s Tangem - - Ok, je l\'ai! - - - - - - - - - - - - - - - - - - - - - diff --git a/core/res/src/main/res/values-it/strings.xml b/core/res/src/main/res/values-it/strings.xml index 9c509aec19..f1168f53e3 100644 --- a/core/res/src/main/res/values-it/strings.xml +++ b/core/res/src/main/res/values-it/strings.xml @@ -1,313 +1,38 @@ - - - - Questa carta è già stata ricaricata e ha firmato transazioni in passato. Valuta la possibilità di prelevare immediatamente tutti i fondi se hai ricevuto questa carta da una fonte inaffidabile. - - La carta che hai scansionato è una carta di sviluppo. Non utilizzarla come strumento di pagamento - - - - - - Questa carta non è progettata per funzionare con Tangem - - - - - - - - - - - - - - - - - - - - - - - Tangem Bot - - - - - Accetta - - Saldo: %s - - Non hai fornito l\'accesso alla tua videocamera, modifica le tue impostazioni sulla privacy Annulla - - - - Rimuovere - - Fatto - - Errore - - OK - - - Mantieni le modifiche - - - - - - - Con successo - - Avviso - - - - - - - - - - - - - - - - - - - - - Codice di accesso Prima di scansionare la carta sarà necessario inserire il codice di accesso corretto Mantenimento della carta Questo meccanismo protegge dagli avvicinamenti senza contatto sulla carta. Attiva un ritardo tra la ricezione e l\'esecuzione di un comando. Dopo la prima transazione firmata, questo telefono verrà associato alla carta e le transazioni verranno firmate immediatamente. Password Dovrai inserire una password prima di eseguire qualsiasi comando che modifichi lo stato della carta. - - Hash %s - ID carta - Valuta dell\'applicazione Emittente - Firmato Requisiti - Termini del servizio - - - - - - - - - - - - - - - Avvicina per modificare il codice di accesso Avvicina per modificare la password - Avvicina per scansionare Avvicina per firmare Avvicina la carta - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Importo Indirizzo Indirizzo o PayString @@ -315,8 +40,6 @@ PayString non registrato Richiesta PayString fallita PayString non supportato dalla blockchain - - Tag Memo Includi commissione @@ -327,146 +50,20 @@ Importo totale Costi della rete Invia - Totale Sarà inviato %1$s e %2$s ≈ %1$s (inc. commissione: %2$s) Sarà inviato %s La transazione è stata firmata con successo e inviata al nodo blockchain. Il saldo del portafoglio verrà aggiornato dopo un po\' di tempo Indirizzo non valido - - - Tangem Wallet - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tangem Twin - - - - - - - - - - - - Crea PayString - - - Il saldo sta per essere caricato… - Transazione in corso… Saldo verificato - - Crea portafoglio - Invia - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WalletConnect Crea PayString $payid.tangem.com @@ -475,11 +72,8 @@ Errore di risposta durante la creazione del PayString Nome PayString Il tuo PayString – informazioni per te uniche, come il tuo numero di telefono, indirizzo email o ABN. - Carta vuota Crea un portafoglio per iniziare ad utilizzare la tua carta Tangem - - Conto non creato Questa carta non è supportata La tua carta Tangem è stata creata per funzionare con un\'altra applicazione. Leggere il nome e le istruzioni sulla carta e installare l\'applicazione corretta @@ -490,28 +84,5 @@ Inviau su %s Tangem - - Ok, ho capito! - - - - - - - - - - - - - - - - - - - - - diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index 98626211ff..f4d33131ce 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -59,11 +59,13 @@ Удалить Отключено Отключить + Не нравится Готово Включить Включено Ошибка Импортировать + Нравится Нет Ок Основная карта @@ -388,12 +390,6 @@ Выберите токен Ваши токены не доступен - - %d токен - %d токена - %d токенов - %d токенов - Скрыть Вы скрываете токен с главного экрана, но в любой момент сможете добавить его обратно через страницу управления токенами. Скрыть %s diff --git a/core/res/src/main/res/values-zh-rTW/strings.xml b/core/res/src/main/res/values-zh-rTW/strings.xml index 5a67343132..648337e245 100644 --- a/core/res/src/main/res/values-zh-rTW/strings.xml +++ b/core/res/src/main/res/values-zh-rTW/strings.xml @@ -40,10 +40,6 @@ 卡片設置 Tangem 機器人 支援 - - - - 接受 添加 注意 @@ -192,7 +188,6 @@ 這此情況,您必須要重新開始 您想要離開啟用程序嗎? 開始 - 驗證身分 KYC PIN 碼 @@ -388,9 +383,6 @@ 選擇代幣 您的代幣 無法使用 - - %d 代幣 - 隱藏 您即將在主屏幕上隱藏此代幣。您可以隨時通過管理代幣頁面將其添加回來。 隱藏 %s diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 875d017a66..d2534d92f5 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -59,11 +59,13 @@ Delete Disabled Disconnect + Dislike Done Enable Enabled Error Import + Like No OK Primary Card @@ -383,15 +385,11 @@ Swap Swap Swap of %s to - Quotes include an additional Tangem commission of %s. This helps us deliver a top-of-the-line product + Quotes include an additional Tangem commission of %s. This helps us deliver a top-of-the-line product. Other tokens Choose token Your tokens not available - - %d token - %d tokens - Hide You are about to hide this token from the main screen. You can add it back anytime through the manage tokens page. Hide %s From 6e40671419c2c96d7612a7e4521827f8ea02752e Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 24 Apr 2023 18:49:18 +0800 Subject: [PATCH 12/68] Updated on 2026-08-14 --- .idea/codeStyles/Project.xml | 4 +- .idea/inspectionProfiles/Project_Default.xml | 5 +- .../impl/di/CustomTokenRouterModule.kt | 21 ++ .../models/AddCustomTokenViewsModels.kt | 269 ++++++++++++++++++ .../presentation/routers/CustomTokenRouter.kt | 12 + .../routers/DefaultCustomTokenRouter.kt | 12 + .../states/AddCustomTokenStateHolder.kt | 91 ++++++ gradle.properties | 2 +- gradle/dependencies.toml | 2 +- 9 files changed, 411 insertions(+), 7 deletions(-) create mode 100644 app/src/main/java/com/tangem/tap/features/customtoken/impl/di/CustomTokenRouterModule.kt create mode 100644 app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/models/AddCustomTokenViewsModels.kt create mode 100644 app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/routers/CustomTokenRouter.kt create mode 100644 app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/routers/DefaultCustomTokenRouter.kt create mode 100644 app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/states/AddCustomTokenStateHolder.kt diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 6527894333..1ef5db9fa5 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -9,8 +9,6 @@ -