diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 507d70e3b1..cbb78ea65a 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -26,6 +26,8 @@ dependencies {
implementation(project(":domain:models"))
implementation(project(":domain:core"))
implementation(project(":domain:card"))
+ implementation(project(":domain:wallets"))
+ implementation(project(":domain:wallets:models"))
implementation(project(":common"))
implementation(project(":core:analytics"))
implementation(project(":core:featuretoggles"))
@@ -52,6 +54,8 @@ dependencies {
implementation(project(":features:tester:impl"))
implementation(project(":features:wallet:api"))
implementation(project(":features:wallet:impl"))
+ implementation(projects.features.tokendetails.api)
+ implementation(projects.features.tokendetails.impl)
/** AndroidX libraries */
implementation(deps.androidx.core.ktx)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index b115140383..53d4be3c7f 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -141,7 +141,7 @@
+ android:theme="@style/AppTheme" />
R.drawable.ic_terra2_no_color
Blockchain.Cronos -> R.drawable.ic_cronos_no_color
Blockchain.Telos, Blockchain.TelosTestnet -> R.drawable.ic_telos_no_color
+ Blockchain.AlephZero, Blockchain.AlephZeroTestnet -> R.drawable.ic_azero_no_color
else -> R.drawable.ic_tangem_logo
}
}
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 f45d14c864..7f1e93ecf1 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
@@ -167,7 +167,18 @@ private fun fragmentFactory(screen: AppScreen): Fragment {
}
}
- AppScreen.WalletDetails -> WalletDetailsFragment()
+ AppScreen.WalletDetails -> {
+ val featureToggles = store.state.daggerGraphState.get(
+ getDependency = DaggerGraphState::tokenDetailsFeatureToggles,
+ )
+ if (featureToggles.isRedesignedScreenEnabled) {
+ store.state.daggerGraphState
+ .get(getDependency = DaggerGraphState::tokenDetailsRouter)
+ .getEntryFragment()
+ } else {
+ WalletDetailsFragment()
+ }
+ }
AppScreen.WalletConnectSessions -> WalletConnectFragment()
AppScreen.QrScan -> QrScanFragment()
AppScreen.ReferralProgram -> ReferralFragment()
diff --git a/app/src/main/java/com/tangem/tap/common/extensions/Store.kt b/app/src/main/java/com/tangem/tap/common/extensions/Store.kt
index 8b5eafb76f..08bfdbd3f3 100644
--- a/app/src/main/java/com/tangem/tap/common/extensions/Store.kt
+++ b/app/src/main/java/com/tangem/tap/common/extensions/Store.kt
@@ -1,12 +1,12 @@
package com.tangem.tap.common.extensions
import com.tangem.domain.common.extensions.withMainContext
+import com.tangem.domain.wallets.models.UserWallet
import com.tangem.tap.common.redux.AppState
import com.tangem.tap.common.redux.StateDialog
import com.tangem.tap.common.redux.global.GlobalAction
import com.tangem.tap.common.redux.navigation.NavigationAction
import com.tangem.tap.domain.TapError
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.scope
import com.tangem.tap.store
import kotlinx.coroutines.Dispatchers
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 d599f9c378..2d75cf1723 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
@@ -7,19 +7,15 @@ import com.tangem.common.core.TangemError
import com.tangem.datasource.config.ConfigManager
import com.tangem.datasource.config.models.ChatConfig
import com.tangem.domain.models.scan.ScanResponse
+import com.tangem.domain.wallets.legacy.UserWalletsListManager
import com.tangem.tap.common.analytics.topup.TopUpController
import com.tangem.tap.common.entities.FiatCurrency
import com.tangem.tap.common.feedback.FeedbackData
import com.tangem.tap.common.feedback.FeedbackManager
-import com.tangem.tap.common.redux.DebugErrorAction
-import com.tangem.tap.common.redux.ErrorAction
-import com.tangem.tap.common.redux.NotificationAction
-import com.tangem.tap.common.redux.StateDialog
-import com.tangem.tap.common.redux.ToastNotificationAction
+import com.tangem.tap.common.redux.*
import com.tangem.tap.domain.TapError
import com.tangem.tap.domain.configurable.warningMessage.WarningMessage
import com.tangem.tap.domain.configurable.warningMessage.WarningMessagesManager
-import com.tangem.tap.domain.userWalletList.UserWalletsListManager
import com.tangem.tap.features.details.redux.SecurityOption
import org.rekotlin.Action
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 91c1ae14b7..1e5a3cfce0 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
@@ -2,13 +2,13 @@ package com.tangem.tap.common.redux.global
import com.tangem.datasource.config.ConfigManager
import com.tangem.domain.models.scan.ScanResponse
+import com.tangem.domain.wallets.legacy.UserWalletsListManager
import com.tangem.tap.common.analytics.topup.TopUpController
import com.tangem.tap.common.entities.FiatCurrency
import com.tangem.tap.common.feedback.FeedbackManager
import com.tangem.tap.common.redux.StateDialog
import com.tangem.tap.domain.TapWalletManager
import com.tangem.tap.domain.configurable.warningMessage.WarningMessagesManager
-import com.tangem.tap.domain.userWalletList.UserWalletsListManager
import com.tangem.tap.features.onboarding.OnboardingManager
import com.tangem.tap.network.exchangeServices.CurrencyExchangeManager
import org.rekotlin.StateType
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 4e39b73bbe..23ee5bb963 100644
--- a/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt
+++ b/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt
@@ -11,6 +11,7 @@ import com.tangem.datasource.config.ConfigManager
import com.tangem.domain.common.extensions.withMainContext
import com.tangem.domain.common.util.cardTypesResolver
import com.tangem.domain.models.scan.ScanResponse
+import com.tangem.domain.wallets.models.UserWallet
import com.tangem.operations.attestation.Attestation
import com.tangem.tap.*
import com.tangem.tap.common.analytics.events.Basic
@@ -18,7 +19,6 @@ import com.tangem.tap.common.extensions.dispatchOnMain
import com.tangem.tap.common.extensions.dispatchWithMain
import com.tangem.tap.common.extensions.setContext
import com.tangem.tap.common.redux.global.GlobalAction
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.walletStores.WalletStoresError
import com.tangem.tap.features.details.redux.walletconnect.WalletConnectAction
import com.tangem.tap.features.disclaimer.createDisclaimer
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 a9de7cb47a..c622163be0 100644
--- a/app/src/main/java/com/tangem/tap/domain/extensions/WalletManagerFactory.kt
+++ b/app/src/main/java/com/tangem/tap/domain/extensions/WalletManagerFactory.kt
@@ -1,20 +1,16 @@
package com.tangem.tap.domain.extensions
-import com.tangem.blockchain.common.Blockchain
-import com.tangem.blockchain.common.DerivationParams
-import com.tangem.blockchain.common.DerivationStyle
-import com.tangem.blockchain.common.WalletManager
-import com.tangem.blockchain.common.WalletManagerFactory
+import com.tangem.blockchain.common.*
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.BlockchainNetwork
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
fun WalletManagerFactory.makeWalletManagerForApp(
diff --git a/app/src/main/java/com/tangem/tap/domain/model/WalletStoreModel.kt b/app/src/main/java/com/tangem/tap/domain/model/WalletStoreModel.kt
index 2dad9e1303..99282954dc 100644
--- a/app/src/main/java/com/tangem/tap/domain/model/WalletStoreModel.kt
+++ b/app/src/main/java/com/tangem/tap/domain/model/WalletStoreModel.kt
@@ -3,9 +3,9 @@ package com.tangem.tap.domain.model
import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchain.common.WalletManager
import com.tangem.crypto.hdWallet.DerivationPath
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.common.BlockchainNetwork
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.model.WalletStoreModel.WalletRent
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.wallet.models.Currency
import java.math.BigDecimal
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 d4e6cbd1fc..7fa72a04fa 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,11 +1,11 @@
package com.tangem.tap.domain.model.builders
+import com.tangem.domain.common.TapWorkarounds.isStart2Coin
+import com.tangem.domain.common.util.cardTypesResolver
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.domain.wallets.models.UserWallet
import com.tangem.tap.domain.userWalletList.GetCardImageUseCase
class UserWalletBuilder(
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 64f5f8156d..30b4ef4407 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,12 +3,12 @@ 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.TapWorkarounds.isTangemTwins
+import com.tangem.domain.common.extensions.calculateHmacSha256
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
+import com.tangem.domain.wallets.models.UserWalletId
class UserWalletIdBuilder private constructor(
private val publicKey: ByteArray?,
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 e7d01ecdb6..81532e5bb9 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
@@ -1,18 +1,14 @@
package com.tangem.tap.domain.model.builders
import com.tangem.blockchain.blockchains.polkadot.ExistentialDepositProvider
-import com.tangem.blockchain.common.Blockchain
-import com.tangem.blockchain.common.DerivationStyle
-import com.tangem.blockchain.common.Token
-import com.tangem.blockchain.common.Wallet
-import com.tangem.blockchain.common.WalletManager
+import com.tangem.blockchain.common.*
import com.tangem.crypto.hdWallet.DerivationPath
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.common.TapWorkarounds.derivationStyle
import com.tangem.domain.common.util.cardTypesResolver
-import com.tangem.tap.domain.model.UserWallet
+import com.tangem.domain.wallets.models.UserWallet
import com.tangem.tap.domain.model.WalletDataModel
import com.tangem.tap.domain.model.WalletStoreModel
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.wallet.models.Currency
import com.tangem.tap.features.wallet.redux.reducers.createAddressesData
import java.math.BigDecimal
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 69a78dfb46..663e931472 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
@@ -8,16 +8,12 @@ import com.tangem.common.core.CardSessionRunnable
import com.tangem.common.core.TangemError
import com.tangem.common.core.TangemSdkError
import com.tangem.common.deserialization.WalletDataDeserializer
-import com.tangem.common.extensions.ByteArrayKey
-import com.tangem.common.extensions.guard
-import com.tangem.common.extensions.hexToBytes
-import com.tangem.common.extensions.toByteArray
-import com.tangem.common.extensions.toHexString
-import com.tangem.common.extensions.toMapKey
+import com.tangem.common.extensions.*
import com.tangem.common.tlv.Tlv
import com.tangem.common.tlv.TlvDecoder
import com.tangem.crypto.CryptoUtils
import com.tangem.crypto.hdWallet.DerivationPath
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.common.TapWorkarounds.isExcluded
import com.tangem.domain.common.TapWorkarounds.isNotSupportedInThatRelease
import com.tangem.domain.common.TapWorkarounds.isStart2Coin
@@ -36,10 +32,10 @@ import com.tangem.operations.issuerAndUserData.ReadIssuerDataCommand
import com.tangem.tap.domain.TapSdkError
import com.tangem.tap.domain.extensions.getPrimaryCurve
import com.tangem.tap.domain.tokens.UserTokensRepository
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.preferencesStorage
import com.tangem.tap.scope
import kotlinx.coroutines.launch
+import kotlin.collections.set
class ScanProductTask(
val card: Card? = null,
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 ff7517ff1a..c4c01684bf 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
@@ -8,10 +8,10 @@ import com.tangem.datasource.api.tangemTech.TangemTechService
import com.tangem.datasource.api.tangemTech.models.UserTokensResponse
import com.tangem.datasource.connection.NetworkConnectionManager
import com.tangem.datasource.files.AndroidFileReader
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.models.scan.CardDTO
import com.tangem.tap.domain.model.builders.UserWalletIdBuilder
import com.tangem.tap.domain.tokens.converters.CurrencyConverter
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.demo.DemoHelper
import com.tangem.tap.features.wallet.models.Currency
import com.tangem.tap.features.wallet.models.toBlockchainNetworks
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/UserWalletsListManagerExtensions.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/UserWalletsListManagerExtensions.kt
index b795c7df78..8086bded7c 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/UserWalletsListManagerExtensions.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/UserWalletsListManagerExtensions.kt
@@ -1,7 +1,8 @@
package com.tangem.tap.domain.userWalletList
import com.tangem.common.CompletionResult
-import com.tangem.tap.domain.model.UserWallet
+import com.tangem.domain.wallets.legacy.UserWalletsListManager
+import com.tangem.domain.wallets.models.UserWallet
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flowOf
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/di/UserWalletsListManagerProvider.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/di/UserWalletsListManagerProvider.kt
index 71255de6a0..5f02cd1258 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/di/UserWalletsListManagerProvider.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/di/UserWalletsListManagerProvider.kt
@@ -5,22 +5,17 @@ import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import com.tangem.common.json.TangemSdkAdapter
import com.tangem.common.services.secure.SecureStorage
+import com.tangem.domain.wallets.legacy.UserWalletsListManager
import com.tangem.sdk.storage.AndroidSecureStorage
import com.tangem.sdk.storage.createEncryptedSharedPreferences
import com.tangem.tap.domain.TangemSdkManager
-import com.tangem.tap.domain.userWalletList.UserWalletsListManager
import com.tangem.tap.domain.userWalletList.implementation.BiometricUserWalletsListManager
import com.tangem.tap.domain.userWalletList.implementation.RuntimeUserWalletsListManager
import com.tangem.tap.domain.userWalletList.repository.implementation.BiometricUserWalletsKeysRepository
import com.tangem.tap.domain.userWalletList.repository.implementation.DefaultSelectedUserWalletRepository
import com.tangem.tap.domain.userWalletList.repository.implementation.DefaultUserWalletsPublicInformationRepository
import com.tangem.tap.domain.userWalletList.repository.implementation.DefaultUserWalletsSensitiveInformationRepository
-import com.tangem.tap.domain.userWalletList.utils.json.ByteArrayKeyAdapter
-import com.tangem.tap.domain.userWalletList.utils.json.CardBackupStatusAdapter
-import com.tangem.tap.domain.userWalletList.utils.json.DerivationPathAdapterWithMigration
-import com.tangem.tap.domain.userWalletList.utils.json.ExtendedPublicKeysMapAdapter
-import com.tangem.tap.domain.userWalletList.utils.json.ScanResponseDerivedKeysMapAdapter
-import com.tangem.tap.domain.userWalletList.utils.json.WalletDerivedKeysMapAdapter
+import com.tangem.tap.domain.userWalletList.utils.json.*
private const val USER_WALLETS_STORAGE_NAME = "user_wallets_storage"
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/BiometricUserWalletsListManager.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/BiometricUserWalletsListManager.kt
index 568d16fc28..18ec89cb9c 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/BiometricUserWalletsListManager.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/BiometricUserWalletsListManager.kt
@@ -2,10 +2,10 @@ package com.tangem.tap.domain.userWalletList.implementation
import com.tangem.common.*
import com.tangem.common.extensions.guard
-import com.tangem.domain.common.util.UserWalletId
-import com.tangem.tap.domain.model.UserWallet
+import com.tangem.domain.wallets.legacy.UserWalletsListManager
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.userWalletList.UserWalletsListError
-import com.tangem.tap.domain.userWalletList.UserWalletsListManager
import com.tangem.tap.domain.userWalletList.model.UserWalletEncryptionKey
import com.tangem.tap.domain.userWalletList.repository.SelectedUserWalletRepository
import com.tangem.tap.domain.userWalletList.repository.UserWalletsKeysRepository
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/RuntimeUserWalletsListManager.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/RuntimeUserWalletsListManager.kt
index cfcd68bc57..d1cd26b6ff 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/RuntimeUserWalletsListManager.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/RuntimeUserWalletsListManager.kt
@@ -2,10 +2,10 @@ package com.tangem.tap.domain.userWalletList.implementation
import com.tangem.common.CompletionResult
import com.tangem.common.catching
-import com.tangem.domain.common.util.UserWalletId
-import com.tangem.tap.domain.model.UserWallet
+import com.tangem.domain.wallets.legacy.UserWalletsListManager
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.userWalletList.UserWalletsListError
-import com.tangem.tap.domain.userWalletList.UserWalletsListManager
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.*
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/model/UserWalletEncryptionKey.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/model/UserWalletEncryptionKey.kt
index df0f473bae..d17ee7c4a3 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/model/UserWalletEncryptionKey.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/model/UserWalletEncryptionKey.kt
@@ -1,7 +1,7 @@
package com.tangem.tap.domain.userWalletList.model
import com.squareup.moshi.JsonClass
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
@JsonClass(generateAdapter = true)
internal data class UserWalletEncryptionKey(
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 d81f8ebafc..fe064832d6 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
@@ -3,7 +3,7 @@ package com.tangem.tap.domain.userWalletList.model
import com.squareup.moshi.JsonClass
import com.tangem.domain.models.scan.CardDTO
import com.tangem.domain.models.scan.ScanResponse
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
@JsonClass(generateAdapter = true)
internal data class UserWalletSensitiveInformation(
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/SelectedUserWalletRepository.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/SelectedUserWalletRepository.kt
index aee7766d49..61c2a2eec4 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/SelectedUserWalletRepository.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/SelectedUserWalletRepository.kt
@@ -1,6 +1,6 @@
package com.tangem.tap.domain.userWalletList.repository
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
internal interface SelectedUserWalletRepository {
fun get(): UserWalletId?
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsKeysRepository.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsKeysRepository.kt
index 99b62dc99d..08c509a16c 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsKeysRepository.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsKeysRepository.kt
@@ -1,7 +1,7 @@
package com.tangem.tap.domain.userWalletList.repository
import com.tangem.common.CompletionResult
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.userWalletList.model.UserWalletEncryptionKey
internal interface UserWalletsKeysRepository {
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsPublicInformationRepository.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsPublicInformationRepository.kt
index 8765a6b804..6b40cf721e 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsPublicInformationRepository.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsPublicInformationRepository.kt
@@ -1,8 +1,8 @@
package com.tangem.tap.domain.userWalletList.repository
import com.tangem.common.CompletionResult
-import com.tangem.domain.common.util.UserWalletId
-import com.tangem.tap.domain.model.UserWallet
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.userWalletList.model.UserWalletPublicInformation
internal interface UserWalletsPublicInformationRepository {
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsSensitiveInformationRepository.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsSensitiveInformationRepository.kt
index fdae3e64a0..15d9abbee4 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsSensitiveInformationRepository.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/UserWalletsSensitiveInformationRepository.kt
@@ -1,8 +1,8 @@
package com.tangem.tap.domain.userWalletList.repository
import com.tangem.common.CompletionResult
-import com.tangem.domain.common.util.UserWalletId
-import com.tangem.tap.domain.model.UserWallet
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.userWalletList.model.UserWalletEncryptionKey
import com.tangem.tap.domain.userWalletList.model.UserWalletSensitiveInformation
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/BiometricUserWalletsKeysRepository.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/BiometricUserWalletsKeysRepository.kt
index affeeeef57..b8c9ce2bc5 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/BiometricUserWalletsKeysRepository.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/BiometricUserWalletsKeysRepository.kt
@@ -3,17 +3,12 @@ package com.tangem.tap.domain.userWalletList.repository.implementation
import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.Moshi
import com.squareup.moshi.Types
-import com.tangem.common.CompletionResult
+import com.tangem.common.*
import com.tangem.common.biometric.BiometricManager
import com.tangem.common.biometric.BiometricStorage
import com.tangem.common.core.TangemSdkError
-import com.tangem.common.doOnFailure
-import com.tangem.common.flatMapOnFailure
-import com.tangem.common.fold
-import com.tangem.common.map
-import com.tangem.common.mapFailure
import com.tangem.common.services.secure.SecureStorage
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.userWalletList.UserWalletsListError
import com.tangem.tap.domain.userWalletList.model.UserWalletEncryptionKey
import com.tangem.tap.domain.userWalletList.repository.UserWalletsKeysRepository
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultSelectedUserWalletRepository.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultSelectedUserWalletRepository.kt
index 6efa84fc70..e30816c98c 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultSelectedUserWalletRepository.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultSelectedUserWalletRepository.kt
@@ -1,7 +1,7 @@
package com.tangem.tap.domain.userWalletList.repository.implementation
import com.tangem.common.services.secure.SecureStorage
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.userWalletList.repository.SelectedUserWalletRepository
internal class DefaultSelectedUserWalletRepository(
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultUserWalletsPublicInformationRepository.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultUserWalletsPublicInformationRepository.kt
index ab64d4a5fb..cadd73b606 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultUserWalletsPublicInformationRepository.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultUserWalletsPublicInformationRepository.kt
@@ -7,9 +7,9 @@ import com.tangem.common.CompletionResult
import com.tangem.common.catching
import com.tangem.common.flatMap
import com.tangem.common.services.secure.SecureStorage
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.common.extensions.replaceByOrAdd
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.userWalletList.model.UserWalletPublicInformation
import com.tangem.tap.domain.userWalletList.repository.UserWalletsPublicInformationRepository
import com.tangem.tap.domain.userWalletList.utils.publicInformation
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultUserWalletsSensitiveInformationRepository.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultUserWalletsSensitiveInformationRepository.kt
index 631d8d13c6..8c67c90889 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultUserWalletsSensitiveInformationRepository.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/implementation/DefaultUserWalletsSensitiveInformationRepository.kt
@@ -7,9 +7,9 @@ import com.squareup.moshi.Types
import com.tangem.common.CompletionResult
import com.tangem.common.catching
import com.tangem.common.services.secure.SecureStorage
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.common.extensions.filterNotNull
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.userWalletList.model.UserWalletEncryptionKey
import com.tangem.tap.domain.userWalletList.model.UserWalletSensitiveInformation
import com.tangem.tap.domain.userWalletList.repository.UserWalletsSensitiveInformationRepository
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/Mapper.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/Mapper.kt
index 4c7784a50a..4116cde096 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/Mapper.kt
+++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/utils/Mapper.kt
@@ -1,7 +1,7 @@
package com.tangem.tap.domain.userWalletList.utils
-import com.tangem.domain.common.util.UserWalletId
-import com.tangem.tap.domain.model.UserWallet
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.userWalletList.model.UserWalletPublicInformation
import com.tangem.tap.domain.userWalletList.model.UserWalletSensitiveInformation
diff --git a/app/src/main/java/com/tangem/tap/domain/walletCurrencies/WalletCurrenciesManager.kt b/app/src/main/java/com/tangem/tap/domain/walletCurrencies/WalletCurrenciesManager.kt
index f56949a1be..413550b22e 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletCurrencies/WalletCurrenciesManager.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletCurrencies/WalletCurrenciesManager.kt
@@ -1,7 +1,7 @@
package com.tangem.tap.domain.walletCurrencies
import com.tangem.common.CompletionResult
-import com.tangem.tap.domain.model.UserWallet
+import com.tangem.domain.wallets.models.UserWallet
import com.tangem.tap.features.wallet.models.Currency
interface WalletCurrenciesManager {
diff --git a/app/src/main/java/com/tangem/tap/domain/walletCurrencies/di/WalletCurrenciesManagerProvider.kt b/app/src/main/java/com/tangem/tap/domain/walletCurrencies/di/WalletCurrenciesManagerProvider.kt
index 0c6bfccf02..bf2d47611e 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletCurrencies/di/WalletCurrenciesManagerProvider.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletCurrencies/di/WalletCurrenciesManagerProvider.kt
@@ -1,11 +1,11 @@
package com.tangem.tap.domain.walletCurrencies.di
+import com.tangem.domain.wallets.legacy.WalletManagersRepository
import com.tangem.tap.common.entities.FiatCurrency
import com.tangem.tap.domain.tokens.UserTokensRepository
import com.tangem.tap.domain.walletCurrencies.WalletCurrenciesManager
import com.tangem.tap.domain.walletCurrencies.implementation.DefaultWalletCurrenciesManager
import com.tangem.tap.domain.walletStores.repository.WalletAmountsRepository
-import com.tangem.tap.domain.walletStores.repository.WalletManagersRepository
import com.tangem.tap.domain.walletStores.repository.WalletStoresRepository
fun WalletCurrenciesManager.Companion.provideDefaultImplementation(
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 0bbd76b7bc..07e8b8ccf6 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
@@ -2,17 +2,17 @@ package com.tangem.tap.domain.walletCurrencies.implementation
import com.tangem.blockchain.common.DerivationStyle
import com.tangem.common.*
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.common.TapWorkarounds.derivationStyle
-import com.tangem.domain.common.util.UserWalletId
import com.tangem.domain.models.scan.CardDTO
+import com.tangem.domain.wallets.legacy.WalletManagersRepository
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.common.entities.FiatCurrency
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.model.builders.WalletStoreBuilder
import com.tangem.tap.domain.tokens.UserTokensRepository
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.domain.walletCurrencies.WalletCurrenciesManager
import com.tangem.tap.domain.walletStores.repository.WalletAmountsRepository
-import com.tangem.tap.domain.walletStores.repository.WalletManagersRepository
import com.tangem.tap.domain.walletStores.repository.WalletStoresRepository
import com.tangem.tap.features.wallet.models.Currency
import com.tangem.tap.features.wallet.models.toBlockchainNetworks
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/WalletStoresManager.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/WalletStoresManager.kt
index 867e75e174..10d89c17eb 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/WalletStoresManager.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletStores/WalletStoresManager.kt
@@ -2,8 +2,8 @@ package com.tangem.tap.domain.walletStores
import com.tangem.blockchain.common.address.AddressType
import com.tangem.common.CompletionResult
-import com.tangem.domain.common.util.UserWalletId
-import com.tangem.tap.domain.model.UserWallet
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.model.WalletStoreModel
import com.tangem.tap.features.wallet.models.Currency
import kotlinx.coroutines.flow.Flow
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/di/WalletsStoresManagerProvider.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/di/WalletsStoresManagerProvider.kt
index d2a4789fb0..d913969cac 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/di/WalletsStoresManagerProvider.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletStores/di/WalletsStoresManagerProvider.kt
@@ -1,12 +1,12 @@
package com.tangem.tap.domain.walletStores.di
-import com.tangem.tap.domain.walletStores.WalletStoresManager
-import com.tangem.tap.domain.walletStores.implementation.DummyWalletStoresManager
+import com.tangem.domain.wallets.legacy.WalletManagersRepository
import com.tangem.tap.common.entities.FiatCurrency
import com.tangem.tap.domain.tokens.UserTokensRepository
+import com.tangem.tap.domain.walletStores.WalletStoresManager
import com.tangem.tap.domain.walletStores.implementation.DefaultWalletStoresManager
+import com.tangem.tap.domain.walletStores.implementation.DummyWalletStoresManager
import com.tangem.tap.domain.walletStores.repository.WalletAmountsRepository
-import com.tangem.tap.domain.walletStores.repository.WalletManagersRepository
import com.tangem.tap.domain.walletStores.repository.WalletStoresRepository
fun WalletStoresManager.Companion.provideDummyImplementation(): WalletStoresManager {
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/implementation/DefaultWalletStoresManager.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/implementation/DefaultWalletStoresManager.kt
index 6081a25788..f2af46b082 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/implementation/DefaultWalletStoresManager.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletStores/implementation/DefaultWalletStoresManager.kt
@@ -2,22 +2,17 @@ package com.tangem.tap.domain.walletStores.implementation
import com.tangem.blockchain.common.WalletManager
import com.tangem.blockchain.common.address.AddressType
-import com.tangem.common.CompletionResult
-import com.tangem.common.doOnSuccess
-import com.tangem.common.flatMap
-import com.tangem.common.flatMapOnFailure
-import com.tangem.common.fold
-import com.tangem.common.map
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.common.*
+import com.tangem.domain.wallets.legacy.WalletManagersRepository
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.common.entities.FiatCurrency
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.model.WalletStoreModel
import com.tangem.tap.domain.model.builders.WalletStoreBuilder
import com.tangem.tap.domain.tokens.UserTokensRepository
import com.tangem.tap.domain.walletStores.WalletStoresError
import com.tangem.tap.domain.walletStores.WalletStoresManager
import com.tangem.tap.domain.walletStores.repository.WalletAmountsRepository
-import com.tangem.tap.domain.walletStores.repository.WalletManagersRepository
import com.tangem.tap.domain.walletStores.repository.WalletStoresRepository
import com.tangem.tap.domain.walletStores.repository.implementation.utils.updateSelectedAddress
import com.tangem.tap.features.wallet.models.Currency
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/implementation/DummyWalletStoresManager.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/implementation/DummyWalletStoresManager.kt
index 98fa34d296..9b6ab8abbb 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/implementation/DummyWalletStoresManager.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletStores/implementation/DummyWalletStoresManager.kt
@@ -2,8 +2,8 @@ package com.tangem.tap.domain.walletStores.implementation
import com.tangem.blockchain.common.address.AddressType
import com.tangem.common.CompletionResult
-import com.tangem.domain.common.util.UserWalletId
-import com.tangem.tap.domain.model.UserWallet
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.model.WalletStoreModel
import com.tangem.tap.domain.walletStores.WalletStoresManager
import com.tangem.tap.features.wallet.models.Currency
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/WalletAmountsRepository.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/WalletAmountsRepository.kt
index 924bbb5191..c25635dd50 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/WalletAmountsRepository.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/WalletAmountsRepository.kt
@@ -1,8 +1,8 @@
package com.tangem.tap.domain.walletStores.repository
import com.tangem.common.CompletionResult
+import com.tangem.domain.wallets.models.UserWallet
import com.tangem.tap.common.entities.FiatCurrency
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.model.WalletStoreModel
interface WalletAmountsRepository {
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/WalletStoresRepository.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/WalletStoresRepository.kt
index ad80694e1e..6007fcb2c3 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/WalletStoresRepository.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/WalletStoresRepository.kt
@@ -1,7 +1,7 @@
package com.tangem.tap.domain.walletStores.repository
import com.tangem.common.CompletionResult
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.model.WalletStoreModel
import com.tangem.tap.features.wallet.models.Currency
import kotlinx.coroutines.flow.Flow
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/di/RepositoryProvider.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/di/RepositoryProvider.kt
index d89d4ea6aa..769a1e0219 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/di/RepositoryProvider.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/di/RepositoryProvider.kt
@@ -2,8 +2,8 @@ package com.tangem.tap.domain.walletStores.repository.di
import com.tangem.blockchain.common.WalletManagerFactory
import com.tangem.datasource.api.tangemTech.TangemTechService
+import com.tangem.domain.wallets.legacy.WalletManagersRepository
import com.tangem.tap.domain.walletStores.repository.WalletAmountsRepository
-import com.tangem.tap.domain.walletStores.repository.WalletManagersRepository
import com.tangem.tap.domain.walletStores.repository.WalletStoresRepository
import com.tangem.tap.domain.walletStores.repository.implementation.DefaultWalletAmountsRepository
import com.tangem.tap.domain.walletStores.repository.implementation.DefaultWalletManagersRepository
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 22dd64bff1..b89be4b97f 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
@@ -10,13 +10,13 @@ import com.tangem.blockchain.extensions.Result.Success
import com.tangem.common.*
import com.tangem.common.core.TangemError
import com.tangem.datasource.api.tangemTech.TangemTechApi
-import com.tangem.domain.common.util.UserWalletId
import com.tangem.domain.common.util.hasDerivation
import com.tangem.domain.models.scan.ScanResponse
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.common.TestActions
import com.tangem.tap.common.entities.FiatCurrency
import com.tangem.tap.common.extensions.replaceByOrAdd
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.model.WalletStoreModel
import com.tangem.tap.domain.walletStores.WalletStoresError
import com.tangem.tap.domain.walletStores.repository.WalletAmountsRepository
@@ -169,7 +169,7 @@ internal class DefaultWalletAmountsRepository(
walletStores.map { walletStore ->
async {
- // TODO: Find wallet manager via [com.tangem.tap.domain.walletStores.repository.WalletManagersRepository]
+ // TODO: Find wallet manager via [com.tangem.domain.wallets.legacy.WalletManagersRepository]
val walletManager = walletStore.walletManager
fetchAmountsForWalletStore(userWalletId, scanResponse, walletStore, walletManager)
}
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 b2d8167a7e..7a51a18e10 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
@@ -1,27 +1,22 @@
package com.tangem.tap.domain.walletStores.repository.implementation
-import com.tangem.blockchain.common.Amount
-import com.tangem.blockchain.common.Blockchain
-import com.tangem.blockchain.common.DerivationParams
-import com.tangem.blockchain.common.DerivationStyle
-import com.tangem.blockchain.common.WalletManager
-import com.tangem.blockchain.common.WalletManagerFactory
+import com.tangem.blockchain.common.*
import com.tangem.common.CompletionResult
import com.tangem.common.catching
import com.tangem.common.doOnSuccess
import com.tangem.common.mapFailure
import com.tangem.crypto.hdWallet.DerivationPath
+import com.tangem.domain.common.BlockchainNetwork
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.domain.wallets.legacy.WalletManagersRepository
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.extensions.makeWalletManagerForApp
-import com.tangem.tap.domain.model.UserWallet
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.domain.walletStores.WalletStoresError
-import com.tangem.tap.domain.walletStores.repository.WalletManagersRepository
import com.tangem.tap.domain.walletStores.storage.WalletManagerStorage
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.firstOrNull
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletStoresRepository.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletStoresRepository.kt
index 89997208ba..fb78960bb1 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletStoresRepository.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/DefaultWalletStoresRepository.kt
@@ -2,7 +2,7 @@ package com.tangem.tap.domain.walletStores.repository.implementation
import com.tangem.common.CompletionResult
import com.tangem.common.catching
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.model.WalletStoreModel
import com.tangem.tap.domain.walletStores.repository.WalletStoresRepository
import com.tangem.tap.domain.walletStores.repository.implementation.utils.isSameWalletStore
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/utils/WalletStoreOperations.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/utils/WalletStoreOperations.kt
index 069f77fe4b..bc6c07563d 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/utils/WalletStoreOperations.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletStores/repository/implementation/utils/WalletStoreOperations.kt
@@ -3,7 +3,7 @@ package com.tangem.tap.domain.walletStores.repository.implementation.utils
import com.tangem.blockchain.common.Wallet
import com.tangem.blockchain.common.address.AddressType
import com.tangem.common.core.TangemError
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.model.WalletStoreModel
import com.tangem.tap.features.wallet.models.Currency
import timber.log.Timber
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/storage/WalletManagerStorage.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/storage/WalletManagerStorage.kt
index 866711e543..3d492d01da 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/storage/WalletManagerStorage.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletStores/storage/WalletManagerStorage.kt
@@ -1,7 +1,7 @@
package com.tangem.tap.domain.walletStores.storage
import com.tangem.blockchain.common.WalletManager
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/storage/WalletStoresStorage.kt b/app/src/main/java/com/tangem/tap/domain/walletStores/storage/WalletStoresStorage.kt
index 932abce88b..883783db86 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/storage/WalletStoresStorage.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletStores/storage/WalletStoresStorage.kt
@@ -1,6 +1,6 @@
package com.tangem.tap.domain.walletStores.storage
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.model.WalletStoreModel
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow
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 dc3169c18c..134a915fbd 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
@@ -16,6 +16,7 @@ import com.tangem.common.extensions.hexToBytes
import com.tangem.common.extensions.toDecompressedPublicKey
import com.tangem.common.extensions.toHexString
import com.tangem.core.analytics.Analytics
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.common.extensions.fromNetworkId
import com.tangem.operations.sign.SignHashCommand
import com.tangem.tap.common.analytics.events.AnalyticsParam
@@ -24,7 +25,6 @@ import com.tangem.tap.common.analytics.events.Basic.TransactionSent.MemoType
import com.tangem.tap.common.analytics.events.WalletConnect
import com.tangem.tap.common.extensions.safeUpdate
import com.tangem.tap.common.extensions.toFormattedString
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.domain.walletconnect.BnbHelper.toWCBinanceTradeOrder
import com.tangem.tap.domain.walletconnect.BnbHelper.toWCBinanceTransferOrder
import com.tangem.tap.domain.walletconnect2.domain.WcEthereumSignMessage
diff --git a/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/WalletConnectRepositoryImpl.kt b/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/WalletConnectRepositoryImpl.kt
index 01e3803798..12c5510122 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/WalletConnectRepositoryImpl.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletconnect2/data/WalletConnectRepositoryImpl.kt
@@ -1,6 +1,7 @@
package com.tangem.tap.domain.walletconnect2.data
import android.app.Application
+import arrow.core.flatten
import com.tangem.tap.domain.walletconnect2.domain.WalletConnectRepository
import com.tangem.tap.domain.walletconnect2.domain.WcJrpcRequestsDeserializer
import com.tangem.tap.domain.walletconnect2.domain.models.*
@@ -97,6 +98,7 @@ class WalletConnectRepositoryImpl @Inject constructor(
sessionProposal.url,
sessionProposal.icons,
sessionProposal.requiredNamespaces.values.flatMap { it.chains ?: emptyList() },
+ sessionProposal.optionalNamespaces.values.flatMap { it.chains ?: emptyList() },
),
)
}
@@ -187,6 +189,7 @@ class WalletConnectRepositoryImpl @Inject constructor(
namespaces = sessionProposal.requiredNamespaces,
userNamespaces = userNamespaces,
)
+
if (missingNetworks.isNotEmpty()) {
Timber.e("Not added blockchains: $missingNetworks")
scope.launch {
@@ -204,17 +207,29 @@ class WalletConnectRepositoryImpl @Inject constructor(
}.groupBy { pair -> pair.first }
.mapValues { entry -> entry.value.map { pair -> pair.second }.toSet() }
- val preparedNamespaces = sessionProposal.requiredNamespaces.map { requiredNamespace ->
- val accounts = requiredNamespace.value.chains?.mapNotNull { userChains[it] }?.flatten() ?: emptyList()
+ val preparedNamespaces = sessionProposal.requiredNamespaces
+ .map { requiredNamespace ->
+ val accountsRequired = requiredNamespace.value.chains
+ ?.mapNotNull { chain -> userChains[chain] }
+ ?.flatten() ?: emptyList()
+ val optionalNamespace = sessionProposal.optionalNamespaces[requiredNamespace.key]
+ val accountsOptional = optionalNamespace?.chains
+ ?.mapNotNull { chain -> userChains[chain] }
+ ?.flatten() ?: emptyList()
- requiredNamespace.key to Wallet.Model.Namespace.Session(
- accounts = accounts,
- methods = requiredNamespace.value.methods,
- events = requiredNamespace.value.events,
- )
- }.toMap()
+ val methods = (requiredNamespace.value.methods + (optionalNamespace?.methods ?: emptyList()))
+ .distinct()
+ requiredNamespace.key to Wallet.Model.Namespace.Session(
+ accounts = (accountsRequired + accountsOptional).distinct(),
+ methods = methods,
+ events = requiredNamespace.value.events,
+ )
+ }.toMap()
- val sessionApproval = Wallet.Params.SessionApprove(sessionProposal.proposerPublicKey, preparedNamespaces)
+ val sessionApproval = Wallet.Params.SessionApprove(
+ proposerPublicKey = sessionProposal.proposerPublicKey,
+ namespaces = preparedNamespaces,
+ )
Timber.d("Session approval is prepared for sending: $sessionApproval")
diff --git a/app/src/main/java/com/tangem/tap/domain/walletconnect2/domain/WalletConnectInteractor.kt b/app/src/main/java/com/tangem/tap/domain/walletconnect2/domain/WalletConnectInteractor.kt
index ef202cd085..7d929df9fc 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletconnect2/domain/WalletConnectInteractor.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletconnect2/domain/WalletConnectInteractor.kt
@@ -50,15 +50,15 @@ class WalletConnectInteractor(
when (wcEvent) {
is WalletConnectEvents.SessionProposal -> {
Timber.d("WC session proposal event received")
- val unsupportedNetworks = wcEvent.chainIds
+ val unsupportedNetworks = wcEvent.requiredChainIds
.filter { blockchainHelper.chainIdToNetworkIdOrNull(it) == null }
if (unsupportedNetworks.isNotEmpty()) {
val error = WalletConnectError.ApprovalErrorUnsupportedNetwork(unsupportedNetworks)
handler.onSessionRejected(error)
return@onEach
}
-
- val networksFormatted = wcEvent.chainIds
+ val networksFormatted = (wcEvent.requiredChainIds + wcEvent.optionalChainIds)
+ .distinct()
.mapNotNull { blockchainHelper.chainIdToFullNameOrNull(it) }
.toString()
handler.onProposalReceived(proposal = wcEvent, networksFormatted = networksFormatted)
diff --git a/app/src/main/java/com/tangem/tap/domain/walletconnect2/domain/models/WalletConnectEvents.kt b/app/src/main/java/com/tangem/tap/domain/walletconnect2/domain/models/WalletConnectEvents.kt
index bec06dd554..e481daa22d 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletconnect2/domain/models/WalletConnectEvents.kt
+++ b/app/src/main/java/com/tangem/tap/domain/walletconnect2/domain/models/WalletConnectEvents.kt
@@ -9,7 +9,8 @@ sealed interface WalletConnectEvents {
val description: String,
val url: String,
val icons: List,
- val chainIds: List,
+ val requiredChainIds: List,
+ val optionalChainIds: List,
) : WalletConnectEvents
data class SessionApprovalError(val error: WalletConnectError) : WalletConnectEvents
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 acc0130ea9..2aad9e3c8a 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
@@ -10,6 +10,7 @@ import com.tangem.core.analytics.Analytics
import com.tangem.domain.common.TapWorkarounds.isTangemTwins
import com.tangem.domain.common.util.cardTypesResolver
import com.tangem.domain.models.scan.ScanResponse
+import com.tangem.domain.wallets.legacy.UserWalletsListManager
import com.tangem.tap.*
import com.tangem.tap.common.analytics.events.AnalyticsParam
import com.tangem.tap.common.analytics.events.Settings
@@ -25,7 +26,6 @@ import com.tangem.tap.common.redux.navigation.NavigationAction
import com.tangem.tap.domain.model.builders.UserWalletBuilder
import com.tangem.tap.domain.model.builders.UserWalletIdBuilder
import com.tangem.tap.domain.scanCard.ScanCardProcessor
-import com.tangem.tap.domain.userWalletList.UserWalletsListManager
import com.tangem.tap.domain.userWalletList.di.provideBiometricImplementation
import com.tangem.tap.domain.userWalletList.di.provideRuntimeImplementation
import com.tangem.tap.domain.userWalletList.isLockedSync
@@ -33,13 +33,7 @@ import com.tangem.tap.features.demo.DemoHelper
import com.tangem.tap.features.onboarding.products.twins.redux.CreateTwinWalletMode
import com.tangem.tap.features.onboarding.products.twins.redux.TwinCardsAction
import com.tangem.tap.features.wallet.redux.WalletAction
-import com.tangem.tap.foregroundActivityObserver
-import com.tangem.tap.preferencesStorage
-import com.tangem.tap.scope
-import com.tangem.tap.store
import com.tangem.tap.tangemSdkManager
-import com.tangem.tap.userWalletsListManager
-import com.tangem.tap.walletStoresManager
import com.tangem.wallet.R
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
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 b69de63a66..400735bc8f 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,6 +4,7 @@ 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.BlockchainNetwork
import com.tangem.domain.common.TapWorkarounds.derivationStyle
import com.tangem.domain.common.extensions.fromNetworkId
import com.tangem.domain.common.extensions.toNetworkId
@@ -16,7 +17,6 @@ import com.tangem.tap.common.redux.AppState
import com.tangem.tap.common.redux.global.GlobalAction
import com.tangem.tap.common.redux.navigation.AppScreen
import com.tangem.tap.common.redux.navigation.NavigationAction
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.domain.walletconnect.BnbHelper
import com.tangem.tap.domain.walletconnect.WalletConnectManager
import com.tangem.tap.domain.walletconnect.WalletConnectNetworkUtils
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 ba7983eaa5..00a9d94af5 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,20 +3,16 @@ 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.BlockchainNetwork
import com.tangem.domain.common.extensions.withMainContext
-import com.tangem.tap.DELAY_SDK_DIALOG_CLOSE
+import com.tangem.domain.common.util.cardTypesResolver
+import com.tangem.tap.*
import com.tangem.tap.common.analytics.events.Onboarding
import com.tangem.tap.common.postUi
import com.tangem.tap.common.redux.AppState
import com.tangem.tap.common.redux.global.GlobalAction
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.onboarding.OnboardingHelper
import com.tangem.tap.features.wallet.models.toCurrencies
-import com.tangem.tap.scope
-import com.tangem.tap.store
-import com.tangem.tap.tangemSdkManager
-import com.tangem.tap.userTokensRepository
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.rekotlin.Action
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 2f4be5416d..d80e71ab99 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
@@ -6,6 +6,7 @@ import com.tangem.common.CompletionResult
import com.tangem.common.core.TangemSdkError
import com.tangem.common.extensions.ifNotNull
import com.tangem.core.analytics.Analytics
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.common.extensions.withMainContext
import com.tangem.domain.common.util.cardTypesResolver
import com.tangem.domain.models.scan.CardDTO
@@ -23,7 +24,6 @@ import com.tangem.tap.common.redux.global.GlobalAction
import com.tangem.tap.common.redux.navigation.AppScreen
import com.tangem.tap.common.redux.navigation.NavigationAction
import com.tangem.tap.domain.tasks.product.CreateProductWalletTaskResponse
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.demo.DemoHelper
import com.tangem.tap.features.home.redux.HomeAction
import com.tangem.tap.features.onboarding.OnboardingDialog
diff --git a/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletMiddleware.kt b/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletMiddleware.kt
index ec2223b2bd..953dbfaa6c 100644
--- a/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletMiddleware.kt
+++ b/app/src/main/java/com/tangem/tap/features/saveWallet/redux/SaveWalletMiddleware.kt
@@ -7,6 +7,8 @@ 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.wallets.legacy.UserWalletsListManager
+import com.tangem.tap.*
import com.tangem.tap.common.analytics.events.AnalyticsParam
import com.tangem.tap.common.analytics.events.MainScreen
import com.tangem.tap.common.analytics.events.Onboarding
@@ -17,16 +19,9 @@ import com.tangem.tap.common.redux.global.GlobalAction
import com.tangem.tap.common.redux.navigation.AppScreen
import com.tangem.tap.common.redux.navigation.NavigationAction
import com.tangem.tap.domain.model.builders.UserWalletBuilder
-import com.tangem.tap.domain.userWalletList.UserWalletsListManager
import com.tangem.tap.domain.userWalletList.di.provideBiometricImplementation
import com.tangem.tap.domain.userWalletList.isLockable
import com.tangem.tap.features.wallet.redux.WalletAction
-import com.tangem.tap.foregroundActivityObserver
-import com.tangem.tap.preferencesStorage
-import com.tangem.tap.scope
-import com.tangem.tap.store
-import com.tangem.tap.tangemSdkManager
-import com.tangem.tap.userWalletsListManager
import kotlinx.coroutines.launch
import org.rekotlin.Middleware
import timber.log.Timber
diff --git a/app/src/main/java/com/tangem/tap/features/tokens/impl/presentation/ui/TokensListScreen.kt b/app/src/main/java/com/tangem/tap/features/tokens/impl/presentation/ui/TokensListScreen.kt
index 44e620b8ac..6896480058 100644
--- a/app/src/main/java/com/tangem/tap/features/tokens/impl/presentation/ui/TokensListScreen.kt
+++ b/app/src/main/java/com/tangem/tap/features/tokens/impl/presentation/ui/TokensListScreen.kt
@@ -25,9 +25,6 @@ import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.text.AnnotatedString
-import androidx.compose.ui.text.SpanStyle
-import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
@@ -155,18 +152,8 @@ private fun DifferentAddressesWarning() {
contentAlignment = Alignment.Center,
) {
val text = stringResource(id = R.string.alert_manage_tokens_addresses_message)
- val firstSpaceIndex = text.indexOf(" ")
Text(
- text = AnnotatedString(
- text = text,
- spanStyles = listOf(
- AnnotatedString.Range(
- SpanStyle(fontWeight = FontWeight.Bold),
- start = 0,
- end = firstSpaceIndex,
- ),
- ),
- ),
+ text = text,
modifier = Modifier.padding(
horizontal = TangemTheme.dimens.spacing16,
vertical = TangemTheme.dimens.spacing8,
diff --git a/app/src/main/java/com/tangem/tap/features/wallet/models/Currency.kt b/app/src/main/java/com/tangem/tap/features/wallet/models/Currency.kt
index 71cef96432..4b82889e22 100644
--- a/app/src/main/java/com/tangem/tap/features/wallet/models/Currency.kt
+++ b/app/src/main/java/com/tangem/tap/features/wallet/models/Currency.kt
@@ -2,11 +2,11 @@ package com.tangem.tap.features.wallet.models
import com.tangem.blockchain.common.DerivationStyle
import com.tangem.datasource.api.tangemTech.models.UserTokensResponse
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.common.extensions.fromNetworkId
import com.tangem.domain.common.extensions.toCoinId
import com.tangem.domain.features.addCustomToken.CustomCurrency
import com.tangem.tap.common.redux.global.CryptoCurrencyName
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.blockchain.common.Blockchain as SdkBlockchain
import com.tangem.blockchain.common.Token as SdkToken
diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletAction.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletAction.kt
index 8db98a4ee0..3f73a94c11 100644
--- a/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletAction.kt
+++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletAction.kt
@@ -4,17 +4,17 @@ import android.content.Context
import com.tangem.blockchain.common.Amount
import com.tangem.blockchain.common.address.AddressType
import com.tangem.core.analytics.AnalyticsEvent
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.models.scan.CardDTO
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.common.entities.FiatCurrency
import com.tangem.tap.common.redux.NotificationAction
import com.tangem.tap.domain.TapError
import com.tangem.tap.domain.configurable.warningMessage.WarningMessage
import com.tangem.tap.domain.model.TotalFiatBalance
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.model.WalletDataModel
import com.tangem.tap.domain.model.WalletStoreModel
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.wallet.models.Currency
import com.tangem.tap.features.wallet.redux.models.WalletDialog
import com.tangem.wallet.R
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 9c1feed6b4..2135a4ab7d 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
@@ -4,6 +4,7 @@ import android.graphics.Bitmap
import com.tangem.blockchain.common.AmountType
import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchain.common.WalletManager
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.common.util.cardTypesResolver
import com.tangem.tap.common.entities.Button
import com.tangem.tap.common.redux.global.CryptoCurrencyName
@@ -12,7 +13,6 @@ import com.tangem.tap.domain.configurable.warningMessage.WarningMessage
import com.tangem.tap.domain.model.TotalFiatBalance
import com.tangem.tap.domain.model.WalletDataModel
import com.tangem.tap.domain.model.WalletStoreModel
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.onboarding.products.twins.redux.TwinCardsState
import com.tangem.tap.features.wallet.models.Currency
import com.tangem.tap.store
diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/MultiWalletMiddleware.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/MultiWalletMiddleware.kt
index d86a41c389..b0e0356891 100644
--- a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/MultiWalletMiddleware.kt
+++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/MultiWalletMiddleware.kt
@@ -4,6 +4,7 @@ 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.wallets.models.UserWallet
import com.tangem.tap.common.analytics.events.AnalyticsParam
import com.tangem.tap.common.analytics.events.Token.ButtonRemoveToken
import com.tangem.tap.common.extensions.addContext
@@ -14,7 +15,6 @@ import com.tangem.tap.common.redux.global.GlobalAction
import com.tangem.tap.common.redux.navigation.AppScreen
import com.tangem.tap.common.redux.navigation.NavigationAction
import com.tangem.tap.domain.TapError
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.scanCard.ScanCardProcessor
import com.tangem.tap.features.wallet.redux.WalletAction
import com.tangem.tap.features.wallet.redux.WalletState
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 95f80ebca8..b94cc9de26 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
@@ -6,12 +6,12 @@ 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.domain.wallets.legacy.UserWalletsListManager
import com.tangem.tap.common.analytics.converters.ParamCardCurrencyConverter
import com.tangem.tap.common.analytics.events.Basic
import com.tangem.tap.common.analytics.events.MainScreen
import com.tangem.tap.common.extensions.dispatchOnMain
import com.tangem.tap.domain.model.TotalFiatBalance
-import com.tangem.tap.domain.userWalletList.UserWalletsListManager
import com.tangem.tap.features.wallet.redux.WalletAction
import com.tangem.tap.features.wallet.ui.analytics.WalletAnalyticsEventsMapper
import com.tangem.tap.store
diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/test/TestWallet.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/test/TestWallet.kt
index 5b3dab3e8b..188cf35d91 100644
--- a/app/src/main/java/com/tangem/tap/features/wallet/ui/test/TestWallet.kt
+++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/test/TestWallet.kt
@@ -5,10 +5,10 @@ import com.tangem.blockchain.common.AmountType
import com.tangem.blockchain.common.Token
import com.tangem.blockchain.common.WalletManager
import com.tangem.common.extensions.guard
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.tap.common.TestAction
import com.tangem.tap.common.TestActions
import com.tangem.tap.common.extensions.dispatchDebugErrorNotification
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.wallet.redux.WalletAction
import com.tangem.tap.store
import java.math.BigDecimal
diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/utils/WalletDataOperations.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/utils/WalletDataOperations.kt
index 3f72a34acb..4f9f9d5453 100644
--- a/app/src/main/java/com/tangem/tap/features/wallet/ui/utils/WalletDataOperations.kt
+++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/utils/WalletDataOperations.kt
@@ -12,7 +12,6 @@ import com.tangem.tap.common.extensions.toFormattedCurrencyString
import com.tangem.tap.common.extensions.toFormattedFiatValue
import com.tangem.tap.domain.model.WalletDataModel
import com.tangem.tap.domain.model.WalletStoreModel
-import com.tangem.tap.features.wallet.models.PendingTransactionType
import com.tangem.tap.features.wallet.models.WalletWarning
import com.tangem.tap.features.wallet.redux.WalletMainButton
import com.tangem.tap.features.wallet.redux.utils.UNKNOWN_AMOUNT_SIGN
@@ -27,14 +26,15 @@ internal fun WalletDataModel.mainButton(blockchainAmount: BigDecimal): WalletMai
internal fun WalletDataModel.hasPendingTransactions(): Boolean {
// for now check pending ongoing only just for BTC, later test and add other utxo networks
- val isBitcoinBlockchain =
- currency.blockchain == Blockchain.Bitcoin || currency.blockchain == Blockchain.BitcoinTestnet
- if (currency.isBlockchain() && isBitcoinBlockchain) {
- val outgoingTransactions = status.pendingTransactions.filter {
- it.type == PendingTransactionType.Outgoing
- }
- return outgoingTransactions.isEmpty()
- }
+ // disabled for release 4.8, test and enable in 4.9
+ // val isBitcoinBlockchain =
+ // currency.blockchain == Blockchain.Bitcoin || currency.blockchain == Blockchain.BitcoinTestnet
+ // if (currency.isBlockchain() && isBitcoinBlockchain) {
+ // val outgoingTransactions = status.pendingTransactions.filter {
+ // it.type == PendingTransactionType.Outgoing
+ // }
+ // return outgoingTransactions.isEmpty()
+ // }
return status.pendingTransactions.isEmpty()
}
diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/view/TotalBalanceCard.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/view/TotalBalanceCard.kt
index d89d245766..fdfadc43e1 100644
--- a/app/src/main/java/com/tangem/tap/features/wallet/ui/view/TotalBalanceCard.kt
+++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/view/TotalBalanceCard.kt
@@ -27,6 +27,7 @@ import com.tangem.tap.domain.model.TotalFiatBalance
import com.tangem.tap.features.wallet.redux.utils.UNKNOWN_AMOUNT_SIGN
import com.tangem.wallet.R
import com.valentinilk.shimmer.shimmer
+import timber.log.Timber
import java.math.BigDecimal
import java.math.RoundingMode
import java.text.DecimalFormat
@@ -227,14 +228,21 @@ private fun buildAmountString(amount: BigDecimal?, fiatCurrency: FiatCurrency):
?: return AnnotatedString("${amount.toPlainString()} ${fiatCurrency.symbol}")
val currencyToShow = "${fiatCurrency.symbol} "
- val scaledAmount = Currency.getInstance(fiatCurrency.code)?.let { currency ->
- formatter.currency = currency
- formatter.maximumFractionDigits = fractionDigits
- formatter.minimumFractionDigits = fractionDigits
- formatter.isGroupingUsed = true
- formatter.roundingMode = RoundingMode.HALF_UP
- formatter.format(amount).replace(currency.symbol, currencyToShow)
- } ?: formatter.format(amount)
+ val scaledAmount = try {
+ Currency.getInstance(fiatCurrency.code)?.let { currency ->
+ formatter.currency = currency
+ formatter.maximumFractionDigits = fractionDigits
+ formatter.minimumFractionDigits = fractionDigits
+ formatter.isGroupingUsed = true
+ formatter.roundingMode = RoundingMode.HALF_UP
+ formatter.format(amount).replace(currency.symbol, currencyToShow)
+ } ?: formatter.format(amount)
+ } catch (e: IllegalArgumentException) {
+ Timber.e("TotalBalanceCard buildAmountString currencyCode is not a supported ISO 4217 code: $e")
+ formatter.currency?.let {
+ formatter.format(amount).replace(it.symbol, currencyToShow)
+ } ?: formatter.format(amount)
+ }
val integer = scaledAmount.substringBefore(formatter.decimalFormatSymbols.decimalSeparator)
var reminder = scaledAmount.substringAfter(formatter.decimalFormatSymbols.decimalSeparator)
diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/redux/UserWalletModel.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/redux/UserWalletModel.kt
index b381b423c3..d1300ffa43 100644
--- a/app/src/main/java/com/tangem/tap/features/walletSelector/redux/UserWalletModel.kt
+++ b/app/src/main/java/com/tangem/tap/features/walletSelector/redux/UserWalletModel.kt
@@ -1,6 +1,6 @@
package com.tangem.tap.features.walletSelector.redux
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.domain.model.TotalFiatBalance
data class UserWalletModel(
diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorAction.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorAction.kt
index e997860d4e..9acb28b1d6 100644
--- a/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorAction.kt
+++ b/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorAction.kt
@@ -1,9 +1,9 @@
package com.tangem.tap.features.walletSelector.redux
import com.tangem.common.core.TangemError
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.common.entities.FiatCurrency
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.model.WalletStoreModel
import org.rekotlin.Action
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 3528a61c7a..61b8a2566c 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
@@ -3,8 +3,9 @@ package com.tangem.tap.features.walletSelector.redux
import com.tangem.common.*
import com.tangem.common.core.TangemSdkError
import com.tangem.core.analytics.Analytics
-import com.tangem.domain.common.util.UserWalletId
import com.tangem.domain.models.scan.ScanResponse
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.*
import com.tangem.tap.common.analytics.events.AnalyticsParam
import com.tangem.tap.common.analytics.events.Basic
@@ -16,7 +17,6 @@ import com.tangem.tap.common.redux.AppState
import com.tangem.tap.common.redux.navigation.AppScreen
import com.tangem.tap.common.redux.navigation.NavigationAction
import com.tangem.tap.domain.model.TotalFiatBalance
-import com.tangem.tap.domain.model.UserWallet
import com.tangem.tap.domain.model.WalletStoreModel
import com.tangem.tap.domain.model.builders.UserWalletBuilder
import com.tangem.tap.domain.model.builders.UserWalletIdBuilder
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 2a8ace7ad3..13daba6567 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
@@ -2,9 +2,9 @@ package com.tangem.tap.features.walletSelector.redux
import com.tangem.domain.common.util.cardTypesResolver
import com.tangem.domain.models.scan.CardDTO
+import com.tangem.domain.wallets.models.UserWallet
import com.tangem.tap.common.redux.AppState
import com.tangem.tap.domain.model.TotalFiatBalance
-import com.tangem.tap.domain.model.UserWallet
import org.rekotlin.Action
internal object WalletSelectorReducer {
diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorState.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorState.kt
index 797cc04593..49e1f753a3 100644
--- a/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorState.kt
+++ b/app/src/main/java/com/tangem/tap/features/walletSelector/redux/WalletSelectorState.kt
@@ -1,7 +1,7 @@
package com.tangem.tap.features.walletSelector.redux
import com.tangem.common.core.TangemError
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.common.entities.FiatCurrency
import org.rekotlin.StateType
diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/WalletSelectorScreenState.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/WalletSelectorScreenState.kt
index b2da2e5b5f..796c2eac3f 100644
--- a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/WalletSelectorScreenState.kt
+++ b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/WalletSelectorScreenState.kt
@@ -1,7 +1,7 @@
package com.tangem.tap.features.walletSelector.ui
import androidx.compose.runtime.Immutable
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.features.details.ui.cardsettings.TextReference
import com.tangem.tap.features.walletSelector.ui.model.DialogModel
import com.tangem.tap.features.walletSelector.ui.model.MultiCurrencyUserWalletItem
diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/WalletSelectorViewModel.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/WalletSelectorViewModel.kt
index c6339f9cd8..6fb9347118 100644
--- a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/WalletSelectorViewModel.kt
+++ b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/WalletSelectorViewModel.kt
@@ -4,7 +4,7 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.tangem.common.core.TangemError
import com.tangem.core.analytics.Analytics
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.common.analytics.events.MyWallets
import com.tangem.tap.common.extensions.dispatchOnMain
import com.tangem.tap.domain.userWalletList.UserWalletsListError
diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/MockData.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/MockData.kt
index c404c8890a..0099f47c84 100644
--- a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/MockData.kt
+++ b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/MockData.kt
@@ -1,6 +1,6 @@
package com.tangem.tap.features.walletSelector.ui.components
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.features.walletSelector.ui.WalletSelectorScreenState
import com.tangem.tap.features.walletSelector.ui.model.MultiCurrencyUserWalletItem
import com.tangem.tap.features.walletSelector.ui.model.SingleCurrencyUserWalletItem
diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WallectSelectorScreenContent.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WallectSelectorScreenContent.kt
index f0dd6b139b..472a4322ec 100644
--- a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WallectSelectorScreenContent.kt
+++ b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WallectSelectorScreenContent.kt
@@ -25,7 +25,7 @@ import com.tangem.core.ui.components.SecondaryButtonIconEnd
import com.tangem.core.ui.components.SpacerWMax
import com.tangem.core.ui.components.atoms.Hand
import com.tangem.core.ui.res.TangemTheme
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.features.walletSelector.ui.WalletSelectorScreenState
import com.tangem.wallet.R
diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WalletItem.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WalletItem.kt
index 03d505e048..305cfa6545 100644
--- a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WalletItem.kt
+++ b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WalletItem.kt
@@ -4,16 +4,7 @@ import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.combinedClickable
-import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.Row
-import androidx.compose.foundation.layout.RowScope
-import androidx.compose.foundation.layout.height
-import androidx.compose.foundation.layout.heightIn
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.size
-import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.Divider
import androidx.compose.material.Icon
@@ -39,7 +30,7 @@ import com.tangem.core.ui.components.SpacerH2
import com.tangem.core.ui.components.SpacerW6
import com.tangem.core.ui.components.SpacerW8
import com.tangem.core.ui.res.TangemTheme
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.common.extensions.cardImageData
import com.tangem.tap.features.walletSelector.ui.model.MultiCurrencyUserWalletItem
import com.tangem.tap.features.walletSelector.ui.model.SingleCurrencyUserWalletItem
diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/model/UserWalletItem.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/model/UserWalletItem.kt
index 7013362085..e5e3033115 100644
--- a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/model/UserWalletItem.kt
+++ b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/model/UserWalletItem.kt
@@ -1,6 +1,6 @@
package com.tangem.tap.features.walletSelector.ui.model
-import com.tangem.domain.common.util.UserWalletId
+import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.features.wallet.redux.utils.UNKNOWN_AMOUNT_SIGN
internal sealed interface UserWalletItem {
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 35c2d83718..0235d9d10e 100644
--- a/app/src/main/java/com/tangem/tap/proxy/AppStateHolder.kt
+++ b/app/src/main/java/com/tangem/tap/proxy/AppStateHolder.kt
@@ -3,11 +3,11 @@ package com.tangem.tap.proxy
import com.tangem.TangemSdk
import com.tangem.domain.models.scan.CardDTO
import com.tangem.domain.models.scan.ScanResponse
+import com.tangem.domain.wallets.legacy.UserWalletsListManager
import com.tangem.tap.common.entities.FiatCurrency
import com.tangem.tap.common.redux.AppState
import com.tangem.tap.domain.TangemSdkManager
import com.tangem.tap.domain.tokens.UserTokensRepository
-import com.tangem.tap.domain.userWalletList.UserWalletsListManager
import com.tangem.tap.domain.walletStores.WalletStoresManager
import com.tangem.tap.features.wallet.redux.WalletState
import org.rekotlin.Store
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 c673ac8577..e24eae21c2 100644
--- a/app/src/main/java/com/tangem/tap/proxy/DerivationManagerImpl.kt
+++ b/app/src/main/java/com/tangem/tap/proxy/DerivationManagerImpl.kt
@@ -9,6 +9,7 @@ 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.BlockchainNetwork
import com.tangem.domain.common.TapWorkarounds.derivationStyle
import com.tangem.domain.common.extensions.fromNetworkId
import com.tangem.domain.common.util.hasDerivation
@@ -23,7 +24,6 @@ import com.tangem.tap.common.extensions.dispatchDebugErrorNotification
import com.tangem.tap.common.extensions.dispatchOnMain
import com.tangem.tap.common.redux.global.GlobalAction
import com.tangem.tap.domain.TapError
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.scope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
diff --git a/app/src/main/java/com/tangem/tap/proxy/TransactionManagerImpl.kt b/app/src/main/java/com/tangem/tap/proxy/TransactionManagerImpl.kt
index 7bdd3744b4..e6090dd5f0 100644
--- a/app/src/main/java/com/tangem/tap/proxy/TransactionManagerImpl.kt
+++ b/app/src/main/java/com/tangem/tap/proxy/TransactionManagerImpl.kt
@@ -12,6 +12,7 @@ import com.tangem.blockchain.extensions.isNetworkError
import com.tangem.common.core.TangemSdkError
import com.tangem.common.extensions.hexToBytes
import com.tangem.core.analytics.api.AnalyticsEventHandler
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.common.extensions.fromNetworkId
import com.tangem.lib.crypto.TransactionManager
import com.tangem.lib.crypto.models.*
@@ -21,7 +22,6 @@ import com.tangem.tap.common.analytics.events.Basic
import com.tangem.tap.common.analytics.events.Basic.TransactionSent.MemoType
import com.tangem.tap.common.redux.global.GlobalAction
import com.tangem.tap.domain.TangemSigner
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.tangemSdk
import java.math.BigDecimal
import java.math.BigInteger
diff --git a/app/src/main/java/com/tangem/tap/proxy/UserWalletManagerImpl.kt b/app/src/main/java/com/tangem/tap/proxy/UserWalletManagerImpl.kt
index fba11b855a..1938886ede 100644
--- a/app/src/main/java/com/tangem/tap/proxy/UserWalletManagerImpl.kt
+++ b/app/src/main/java/com/tangem/tap/proxy/UserWalletManagerImpl.kt
@@ -6,6 +6,7 @@ import com.tangem.blockchain.common.Token
import com.tangem.blockchain.common.WalletManager
import com.tangem.common.doOnFailure
import com.tangem.common.extensions.guard
+import com.tangem.domain.common.BlockchainNetwork
import com.tangem.domain.common.extensions.fromNetworkId
import com.tangem.domain.common.extensions.toCoinId
import com.tangem.domain.common.extensions.toNetworkId
@@ -17,7 +18,6 @@ import com.tangem.lib.crypto.models.ProxyAmount
import com.tangem.lib.crypto.models.ProxyFiatCurrency
import com.tangem.tap.common.extensions.dispatchOnMain
import com.tangem.tap.domain.model.builders.UserWalletIdBuilder
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.wallet.redux.WalletAction
import com.tangem.tap.userWalletsListManager
import com.tangem.tap.walletCurrenciesManager
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 5fab5032f5..e83ed33f3a 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
@@ -2,6 +2,7 @@ package com.tangem.tap.proxy.redux
import com.tangem.domain.card.ScanCardUseCase
import com.tangem.features.tester.api.TesterRouter
+import com.tangem.features.tokendetails.navigation.TokenDetailsRouter
import com.tangem.features.wallet.navigation.WalletRouter
import com.tangem.tap.domain.walletconnect2.domain.WalletConnectInteractor
import org.rekotlin.Action
@@ -13,5 +14,6 @@ sealed interface DaggerGraphAction : Action {
val scanCardUseCase: ScanCardUseCase,
val walletRouter: WalletRouter,
val walletConnectInteractor: WalletConnectInteractor,
+ val tokenDetailsRouter: TokenDetailsRouter,
) : DaggerGraphAction
}
\ No newline at end of file
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 bdc38a631c..bdd590be4d 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
@@ -17,6 +17,7 @@ object DaggerGraphReducer {
scanCardUseCase = action.scanCardUseCase,
walletRouter = action.walletRouter,
walletConnectInteractor = action.walletConnectInteractor,
+ tokenDetailsRouter = action.tokenDetailsRouter,
)
}
}
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 a741e4dfd4..84409d4e36 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
@@ -4,6 +4,8 @@ import com.tangem.datasource.asset.AssetReader
import com.tangem.datasource.connection.NetworkConnectionManager
import com.tangem.domain.card.ScanCardUseCase
import com.tangem.features.tester.api.TesterRouter
+import com.tangem.features.tokendetails.featuretoggles.TokenDetailsFeatureToggles
+import com.tangem.features.tokendetails.navigation.TokenDetailsRouter
import com.tangem.features.wallet.featuretoggles.WalletFeatureToggles
import com.tangem.features.wallet.navigation.WalletRouter
import com.tangem.tap.domain.walletconnect2.domain.WalletConnectInteractor
@@ -23,6 +25,8 @@ data class DaggerGraphState(
val walletConnectRepository: WalletConnectRepository? = null,
val walletConnectSessionsRepository: WalletConnectSessionsRepository? = null,
val walletConnectInteractor: WalletConnectInteractor? = null,
+ val tokenDetailsFeatureToggles: TokenDetailsFeatureToggles? = null,
+ val tokenDetailsRouter: TokenDetailsRouter? = null,
) : StateType {
inline fun get(getDependency: DaggerGraphState.() -> T?): T {
diff --git a/app/src/main/res/drawable/ic_azero_no_color.xml b/app/src/main/res/drawable/ic_azero_no_color.xml
new file mode 100644
index 0000000000..da712895b3
--- /dev/null
+++ b/app/src/main/res/drawable/ic_azero_no_color.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/app/src/main/res/values-v24/bool.xml b/app/src/main/res/values-v24/bool.xml
index 093ecf3bc6..d5677354f0 100644
--- a/app/src/main/res/values-v24/bool.xml
+++ b/app/src/main/res/values-v24/bool.xml
@@ -1,5 +1,5 @@
- false
+ true
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 9a45d3070f..5dc4db710d 100644
--- a/core/featuretoggles/src/main/assets/configs/feature_toggles_config.json
+++ b/core/featuretoggles/src/main/assets/configs/feature_toggles_config.json
@@ -18,5 +18,9 @@
{
"name": "1INCH_LEARN_2_EARN_ENABLED",
"version": "undefined"
+ },
+ {
+ "name": "REDESIGNED_TOKEN_DETAIL_SCREEN_ENABLED",
+ "version": "undefined"
}
-]
\ No newline at end of file
+]
diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml
index 7ec3cf5896..797b9dea53 100644
--- a/core/res/src/main/res/values-ru/strings.xml
+++ b/core/res/src/main/res/values-ru/strings.xml
@@ -68,6 +68,7 @@
Обменять
Посмотреть историю транзакций
Обозреватель
+ Учись и получай бонусы!
Нравится
Основная сеть
Нет
@@ -160,21 +161,19 @@
Приложите карту
Внутренняя ошибка: не удается найти менеджер кошельков
Вы обновили данные биометрии, отсканируйте свою карту для входа
- Вы завершили обучение и можете получить свои токены 1inch
- Получите бонус
+ Вы успешно прошли все уроки и теперь можете получить 1INCH токены
- - Пройдите обучение и получите %d токен 1inch на свой кошелек
- - Пройдите обучение и получите %d токена 1inch на свой кошелек
- - Пройдите обучение и получите %d токена 1inch на свой кошелек
- - Пройдите обучение и получите %d токенов 1inch на свой кошелек
+ - Пройдите 3 урока и получите %d 1INCH токен на свой кошелек
+ - Пройдите 3 урока и получите %d 1INCH токена на свой кошелек
+ - Пройдите 3 урока и получите %d 1INCH токена на свой кошелек
+ - Пройдите 3 урока и получите %d 1INCH токенов на свой кошелек
- Бонус за обучение
Управление токенами
Чтобы защитить свои активы, мы советуем вам выполнить эту процедуру
Бэкап кошелька не был произведен
Баланс
В сумме учтены не все монеты
- Токены 1inch будут зачислены на адрес вашего кошелька %s в течение 24 часов
+ 1INCH токены будут зачислены на адрес вашего кошелька в сети %s в течение 24 часов
По вашему промокоду не было покупки кошелька, а значит вы не можете получить бонус. Купите кошелек Tangem, отсканируйте его в приложении и получите бонус.
Чтобы получить доступ ко всем сетям, вам необходимо отсканировать карту
Отсканируйте карту
@@ -355,9 +354,8 @@
Тысячи криптовалют
Используйте его на ходу, в любом месте, в любое время. Без проводов и батареек. Как только понадобится крипта, просто приложите карту к телефону.
Кошелек для каждого
- Пройдите обучение и получите возможность купить кошелек Tangem со скидкой и токены 1inch в качестве бонуса
+ Пройдите 3 урока, получите скидку на покупку Tangem Wallet и 1INCH токены
Пройти обучение
- Получите свой бонус
Занимайте
Покупайте
Обменивайте
diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml
index d2dac748b6..cd659ff14e 100644
--- a/core/res/src/main/res/values/strings.xml
+++ b/core/res/src/main/res/values/strings.xml
@@ -66,6 +66,7 @@
Exchange
Explore transaction history
Explorer
+ Learn & Earn
Like
Main network
No
@@ -158,19 +159,17 @@
Tap the card
Internal error: wallet manager not found
You have updated biometrics, scan your card to enter
- You have completed the training and can get your 1inch tokens
- Get a bonus
+ You have completed all of the lessons, and are now eligible to receive your 1INCH tokens
- - Complete the training and get %d 1inch token on your wallet
- - Complete the training and get %d 1inch tokens on your wallet
+ - Complete three lessons and receive %d 1INCH token to your wallet
+ - Complete three lessons and receive %d 1INCH tokens to your wallet
- Learn & Earn
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
- 1inch tokens will be credited to your %s wallet address within 24 hours
+ 1INCH tokens will be credited to your %s wallet address within 24 hours
There was no purchase of a wallet using your promo code, which means you cannot receive a bonus. Buy Tangem wallet, scan it in the app, and get the bonus.
To access all the networks you need to scan the card
Scan your card
@@ -351,9 +350,8 @@
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
- Complete the training, get the opportunity to buy Tangem wallet with a discount and receive 1inch tokens on your wallet
+ Take three lessons, get a discount on your Tangem Wallet, and receive 1INCH tokens to your wallet
Learn
- Learn and get a bonus
Borrow
Buy
Exchange
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 e0dcf1e7c8..c4eeba732a 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
@@ -41,6 +41,7 @@ fun getActiveIconRes(blockchainId: String): Int {
"terra-2", "terra-luna-2" -> R.drawable.img_terra2_22
"cronos" -> R.drawable.img_cronos_22
"TELOS", "TELOS/test" -> R.drawable.img_telos_22
+ "aleph-zero", "aleph-zero/test" -> R.drawable.img_azero_22
else -> R.drawable.ic_alert_24
}
}
diff --git a/core/ui/src/main/res/drawable/img_azero_22.xml b/core/ui/src/main/res/drawable/img_azero_22.xml
new file mode 100644
index 0000000000..9a9fd4a2f1
--- /dev/null
+++ b/core/ui/src/main/res/drawable/img_azero_22.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/app/src/main/java/com/tangem/tap/domain/tokens/models/BlockchainNetwork.kt b/domain/legacy/src/main/java/com/tangem/domain/common/BlockchainNetwork.kt
similarity index 97%
rename from app/src/main/java/com/tangem/tap/domain/tokens/models/BlockchainNetwork.kt
rename to domain/legacy/src/main/java/com/tangem/domain/common/BlockchainNetwork.kt
index 32cfbc4bec..212bd764be 100644
--- a/app/src/main/java/com/tangem/tap/domain/tokens/models/BlockchainNetwork.kt
+++ b/domain/legacy/src/main/java/com/tangem/domain/common/BlockchainNetwork.kt
@@ -1,12 +1,12 @@
-package com.tangem.tap.domain.tokens.models
+package com.tangem.domain.common
import com.squareup.moshi.JsonClass
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.models.scan.CardDTO
import com.tangem.domain.common.TapWorkarounds.derivationStyle
+import com.tangem.domain.models.scan.CardDTO
@JsonClass(generateAdapter = true)
data class BlockchainNetwork(
diff --git a/domain/legacy/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt b/domain/legacy/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt
index 1b5e32c734..15fb408bde 100644
--- a/domain/legacy/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt
+++ b/domain/legacy/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt
@@ -29,6 +29,7 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
"bitcoin-cash/test" -> Blockchain.BitcoinCashTestnet
"cardano" -> Blockchain.CardanoShelley
"dogecoin" -> Blockchain.Dogecoin
+ "ducatus" -> Blockchain.Ducatus
"litecoin" -> Blockchain.Litecoin
"rootstock" -> Blockchain.RSK
"stellar" -> Blockchain.Stellar
@@ -61,8 +62,8 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
"cronos" -> Blockchain.Cronos
"telos" -> Blockchain.Telos
"telos/test" -> Blockchain.TelosTestnet
- "azero" -> Blockchain.AlephZero
- "azero/test" -> Blockchain.AlephZeroTestnet
+ "aleph-zero" -> Blockchain.AlephZero
+ "aleph-zero/test" -> Blockchain.AlephZeroTestnet
else -> null
}
}
@@ -86,6 +87,7 @@ fun Blockchain.toNetworkId(): String {
Blockchain.Cardano -> "cardano"
Blockchain.CardanoShelley -> "cardano"
Blockchain.Dogecoin -> "dogecoin"
+ Blockchain.Ducatus -> "ducatus"
Blockchain.Ethereum -> "ethereum"
Blockchain.EthereumTestnet -> "ethereum/test"
Blockchain.EthereumClassic -> "ethereum-classic"
@@ -128,8 +130,8 @@ fun Blockchain.toNetworkId(): String {
Blockchain.Cronos -> "cronos"
Blockchain.Telos -> "telos"
Blockchain.TelosTestnet -> "telos/test"
- Blockchain.AlephZero -> "azero"
- Blockchain.AlephZeroTestnet -> "azero/test"
+ Blockchain.AlephZero -> "aleph-zero"
+ Blockchain.AlephZeroTestnet -> "aleph-zero/test"
}
}
@@ -150,6 +152,7 @@ fun Blockchain.toCoinId(): String {
Blockchain.Fantom, Blockchain.FantomTestnet -> "fantom"
Blockchain.Tron, Blockchain.TronTestnet -> "tron"
Blockchain.Polkadot, Blockchain.PolkadotTestnet -> "polkadot"
+ Blockchain.Ducatus -> "ducatus"
Blockchain.Litecoin -> "litecoin"
Blockchain.RSK -> "rootstock"
Blockchain.Tezos -> "tezos"
@@ -171,7 +174,7 @@ fun Blockchain.toCoinId(): String {
Blockchain.TerraV2 -> "terra-luna-2"
Blockchain.Cronos -> "crypto-com-chain"
Blockchain.Telos, Blockchain.TelosTestnet -> "telos"
- Blockchain.AlephZero, Blockchain.AlephZeroTestnet -> "azero"
+ Blockchain.AlephZero, Blockchain.AlephZeroTestnet -> "aleph-zero"
}
}
@@ -179,4 +182,7 @@ fun Blockchain.isSupportedInApp(): Boolean {
return !excludedBlockchains.contains(this)
}
-private val excludedBlockchains = listOf(Blockchain.Unknown)
\ No newline at end of file
+private val excludedBlockchains = listOf(
+ Blockchain.Unknown,
+ Blockchain.Ducatus,
+)
\ No newline at end of file
diff --git a/domain/legacy/src/main/java/com/tangem/domain/common/util/UserWalletId.kt b/domain/legacy/src/main/java/com/tangem/domain/common/util/UserWalletId.kt
deleted file mode 100644
index 17c22839fd..0000000000
--- a/domain/legacy/src/main/java/com/tangem/domain/common/util/UserWalletId.kt
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.tangem.domain.common.util
-
-import com.tangem.common.extensions.hexToBytes
-import com.tangem.common.extensions.toHexString
-
-class UserWalletId(
- val stringValue: String,
-) {
- val value = stringValue.hexToBytes()
-
- constructor(value: ByteArray?) : this(
- stringValue = value?.toHexString() ?: "",
- )
-
- override fun equals(other: Any?): Boolean {
- if (this === other) return true
- if (other !is UserWalletId) return false
-
- if (stringValue != other.stringValue) return false
-
- return true
- }
-
- override fun hashCode(): Int {
- return stringValue.hashCode()
- }
-
- @Suppress("MagicNumber")
- override fun toString(): String {
- return with(stringValue) {
- "UserWalletId(${take(3)}...${takeLast(3)})"
- }
- }
-}
\ No newline at end of file
diff --git a/domain/wallets/.gitignore b/domain/wallets/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/domain/wallets/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/domain/wallets/build.gradle.kts b/domain/wallets/build.gradle.kts
new file mode 100644
index 0000000000..bbcf863dc9
--- /dev/null
+++ b/domain/wallets/build.gradle.kts
@@ -0,0 +1,26 @@
+plugins {
+ alias(deps.plugins.android.library)
+ alias(deps.plugins.kotlin.android)
+ id("configuration")
+}
+
+android {
+ namespace = "com.tangem.domain.wallets"
+}
+
+dependencies {
+
+ // region Domain modules
+ implementation(project(":domain:legacy"))
+ implementation(project(":domain:wallets:models"))
+ // endregion
+
+ // region Tangem libraries
+ implementation(deps.tangem.blockchain) // android-library
+ implementation(deps.tangem.card.core)
+ // endregion
+
+ // region Other libraries
+ implementation(deps.kotlin.coroutines)
+ // endregion
+}
\ No newline at end of file
diff --git a/domain/wallets/models/.gitignore b/domain/wallets/models/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/domain/wallets/models/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/domain/wallets/models/build.gradle.kts b/domain/wallets/models/build.gradle.kts
new file mode 100644
index 0000000000..537d724d84
--- /dev/null
+++ b/domain/wallets/models/build.gradle.kts
@@ -0,0 +1,14 @@
+plugins {
+ alias(deps.plugins.kotlin.jvm)
+ id("configuration")
+}
+
+dependencies {
+ // region Tangem libraries
+ implementation(deps.tangem.card.core)
+ // endregion
+
+ // region Domain modules
+ implementation(project(":domain:models"))
+ // endregion
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/domain/model/UserWallet.kt b/domain/wallets/models/src/main/java/com/tangem/domain/wallets/models/UserWallet.kt
similarity index 93%
rename from app/src/main/java/com/tangem/tap/domain/model/UserWallet.kt
rename to domain/wallets/models/src/main/java/com/tangem/domain/wallets/models/UserWallet.kt
index d58a3e7122..af407822fb 100644
--- a/app/src/main/java/com/tangem/tap/domain/model/UserWallet.kt
+++ b/domain/wallets/models/src/main/java/com/tangem/domain/wallets/models/UserWallet.kt
@@ -1,7 +1,6 @@
-package com.tangem.tap.domain.model
+package com.tangem.domain.wallets.models
import com.tangem.domain.models.scan.ScanResponse
-import com.tangem.domain.common.util.UserWalletId
/**
* Represents user's wallet which stored in app persistence
diff --git a/domain/wallets/models/src/main/java/com/tangem/domain/wallets/models/UserWalletId.kt b/domain/wallets/models/src/main/java/com/tangem/domain/wallets/models/UserWalletId.kt
new file mode 100644
index 0000000000..791c3a1059
--- /dev/null
+++ b/domain/wallets/models/src/main/java/com/tangem/domain/wallets/models/UserWalletId.kt
@@ -0,0 +1,13 @@
+package com.tangem.domain.wallets.models
+
+import com.tangem.common.extensions.hexToBytes
+import com.tangem.common.extensions.toHexString
+
+data class UserWalletId(val stringValue: String) {
+
+ val value = stringValue.hexToBytes()
+
+ constructor(value: ByteArray?) : this(stringValue = value?.toHexString() ?: "")
+
+ override fun toString() = "UserWalletId(${stringValue.take(n = 3)}...${stringValue.takeLast(n = 3)})"
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/UserWalletsListManager.kt b/domain/wallets/src/main/java/com/tangem/domain/wallets/legacy/UserWalletsListManager.kt
similarity index 67%
rename from app/src/main/java/com/tangem/tap/domain/userWalletList/UserWalletsListManager.kt
rename to domain/wallets/src/main/java/com/tangem/domain/wallets/legacy/UserWalletsListManager.kt
index 249ac0d0f4..ff4e805ad1 100644
--- a/app/src/main/java/com/tangem/tap/domain/userWalletList/UserWalletsListManager.kt
+++ b/domain/wallets/src/main/java/com/tangem/domain/wallets/legacy/UserWalletsListManager.kt
@@ -1,34 +1,25 @@
-package com.tangem.tap.domain.userWalletList
+package com.tangem.domain.wallets.legacy
import com.tangem.common.CompletionResult
-import com.tangem.domain.common.util.UserWalletId
-import com.tangem.tap.domain.model.UserWallet
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
import kotlinx.coroutines.flow.Flow
interface UserWalletsListManager {
- /**
- * [Flow] with all saved [UserWallet]s updates
- * */
+
+ /** [Flow] with all saved [UserWallet]s updates */
val userWallets: Flow>
- /**
- * [Flow] with selected [UserWallet] updates
- * */
+ /** [Flow] with selected [UserWallet] updates */
val selectedUserWallet: Flow
- /**
- * Selected [UserWallet]
- * */
+ /** Selected [UserWallet] */
val selectedUserWalletSync: UserWallet?
- /**
- * Indicates that the [UserWalletsListManager] contains at least one saved [UserWallet]
- * */
+ /** Indicates that the [UserWalletsListManager] contains at least one saved [UserWallet] */
val hasUserWallets: Boolean
- /**
- * Count of saved user wallets
- */
+ /** Count of saved user wallets */
val walletsCount: Int
/**
@@ -36,78 +27,79 @@ interface UserWalletsListManager {
*
* @param userWalletId [UserWalletId] of [UserWallet] which must be selected
*
- * @return [CompletionResult.Success] with selected [UserWallet]
- * or [CompletionResult.Failure] with [NoSuchElementException] if [UserWallet] with [userWalletId] not found
- * */
+ * @return [CompletionResult.Success] with selected [UserWallet] or [CompletionResult.Failure] with
+ * [NoSuchElementException] if [UserWallet] with [userWalletId] not found
+ */
suspend fun select(userWalletId: UserWalletId): CompletionResult
/**
* Save provided user wallet and set it as selected
+ *
* @param userWallet [UserWallet] to save
* @param canOverride If false, then terminate with [UserWalletsListError.WalletAlreadySaved] when user tries
* to save an already saved card
+ *
* @return [CompletionResult] of operation
*/
suspend fun save(userWallet: UserWallet, canOverride: Boolean = false): CompletionResult
/**
- * Same as [save] but not change selected user wallet ID
- * and not terminate with [UserWalletsListError.WalletAlreadySaved] if [UserWallet] already saved
+ * Same as [save] but not change selected user wallet ID and not terminate with
+ * [UserWalletsListError.WalletAlreadySaved] if [UserWallet] already saved.
+ * Can terminate with [NoSuchElementException] if unable to find [UserWallet] with provided [UserWalletId].
*
- * Can terminate with [NoSuchElementException] if unable to find [UserWallet] with provided [UserWalletId]
* @param userWalletId update [UserWallet] with that [UserWalletId]
* @param update lambda that receives stored [UserWallet] and returns updated [UserWallet]
- * @return [CompletionResult.Success] with updated [UserWallet]
- * or [CompletionResult.Failure] with [NoSuchElementException] if [UserWallet] with [userWalletId] not found
- * */
+ *
+ * @return [CompletionResult.Success] with updated [UserWallet] or [CompletionResult.Failure] with
+ * [NoSuchElementException] if [UserWallet] with [userWalletId] not found
+ */
suspend fun update(
userWalletId: UserWalletId,
update: suspend (UserWallet) -> UserWallet,
): CompletionResult
/**
- * Delete saved [UserWallet]s with provided [UserWalletId]s
- *
- * Sets [isLocked] as true if [userWallets] is empty or if all [userWallets] are locked
+ * Delete saved [UserWallet]s with provided [UserWalletId]s.
+ * Sets [isLocked] as true if [userWallets] is empty or if all [userWallets] are locked.
*
* @param userWalletIds [UserWalletId]s of [UserWallet]s which must be deleted
*
* @return [CompletionResult] of operation
- * */
+ */
suspend fun delete(userWalletIds: List): CompletionResult
/**
* Clear all saved [UserWallet]s and set [isLocked] as true
*
* @return [CompletionResult] of operation
- * */
+ */
suspend fun clear(): CompletionResult
/**
* Get [UserWallet] with provided [UserWalletId]
*
- * @return [CompletionResult.Success] with found [UserWallet]
- * or [CompletionResult.Failure] with [NoSuchElementException] if [UserWallet] with [userWalletId] not found
- * */
+ * @return [CompletionResult.Success] with found [UserWallet] or [CompletionResult.Failure] with
+ * [NoSuchElementException] if [UserWallet] with [userWalletId] not found
+ */
suspend fun get(userWalletId: UserWalletId): CompletionResult
interface Lockable : UserWalletsListManager {
+
/**
* Indicates that all [UserWallet]s is locked
*
* @see [isLockedSync]
* @see [UserWallet.isLocked]
- * */
+ */
val isLocked: Flow
/**
- * Indicates that all [UserWallet]s is locked
- *
- * Sync version
+ * Indicates that all [UserWallet]s is locked. Sync version.
*
* @see [isLocked]
* @see [UserWallet.isLocked]
- * */
+ */
val isLockedSync: Boolean
/**
@@ -115,12 +107,10 @@ interface UserWalletsListManager {
*
* @return [CompletionResult] of operation, with selected [UserWallet]
* or null if there is no selected [UserWallet]
- * */
+ */
suspend fun unlock(): CompletionResult
- /**
- * Remove [UserWallet]s from [userWallets] and set [isLocked] as true
- * */
+ /** Remove [UserWallet]s from [userWallets] and set [isLocked] as true */
fun lock()
}
diff --git a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/WalletManagersRepository.kt b/domain/wallets/src/main/java/com/tangem/domain/wallets/legacy/WalletManagersRepository.kt
similarity index 75%
rename from app/src/main/java/com/tangem/tap/domain/walletStores/repository/WalletManagersRepository.kt
rename to domain/wallets/src/main/java/com/tangem/domain/wallets/legacy/WalletManagersRepository.kt
index c49f863277..10eb7a6669 100644
--- a/app/src/main/java/com/tangem/tap/domain/walletStores/repository/WalletManagersRepository.kt
+++ b/domain/wallets/src/main/java/com/tangem/domain/wallets/legacy/WalletManagersRepository.kt
@@ -1,13 +1,14 @@
-package com.tangem.tap.domain.walletStores.repository
+package com.tangem.domain.wallets.legacy
import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchain.common.WalletManager
import com.tangem.common.CompletionResult
-import com.tangem.domain.common.util.UserWalletId
-import com.tangem.tap.domain.model.UserWallet
-import com.tangem.tap.domain.tokens.models.BlockchainNetwork
+import com.tangem.domain.common.BlockchainNetwork
+import com.tangem.domain.wallets.models.UserWallet
+import com.tangem.domain.wallets.models.UserWalletId
interface WalletManagersRepository {
+
suspend fun findOrMakeMultiCurrencyWalletManager(
userWallet: UserWallet,
blockchainNetwork: BlockchainNetwork,
diff --git a/features/learn2earn/impl/build.gradle.kts b/features/learn2earn/impl/build.gradle.kts
index b1c4ef9a5a..26d0179187 100644
--- a/features/learn2earn/impl/build.gradle.kts
+++ b/features/learn2earn/impl/build.gradle.kts
@@ -10,6 +10,7 @@ plugins {
dependencies {
/** Core modules */
implementation(project(":common"))
+ implementation(project(":core:analytics"))
implementation(project(":core:featuretoggles"))
implementation(project(":core:datasource"))
implementation(project(":core:utils"))
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/analytics/Learn2earnEvents.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/analytics/Learn2earnEvents.kt
new file mode 100644
index 0000000000..164fa4e793
--- /dev/null
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/analytics/Learn2earnEvents.kt
@@ -0,0 +1,70 @@
+package com.tangem.feature.learn2earn.analytics
+
+import com.tangem.core.analytics.AnalyticsEvent
+
+internal sealed class Learn2earnEvents(
+ category: String,
+ event: String,
+ params: Map = mapOf(),
+) : AnalyticsEvent(
+ category = category,
+ event = event,
+ params = params + mapOf(
+ "Program Name" to "1inch",
+ ),
+) {
+
+ sealed class IntroductionProcess(
+ event: String,
+ params: Map = mapOf(),
+ ) : Learn2earnEvents(
+ category = "Introduction Process",
+ event = event,
+ params = params,
+ ) {
+ class ButtonLearn : IntroductionProcess("Button - Learn")
+ }
+
+ sealed class MainScreen(
+ event: String,
+ params: Map = mapOf(),
+ ) : Learn2earnEvents(
+ category = "Main Screen",
+ event = event,
+ params = params,
+ ) {
+ class NoticeLear2earn(clientType: AnalyticsParam.ClientType) : MainScreen(
+ event = "Notice - Learn&Earn",
+ params = mapOf(AnalyticsParam.CLIENT_TYPE to clientType.value),
+ )
+
+ class NoticeClaimSuccess : MainScreen("Notice - Claim Successed")
+ }
+
+ sealed class PromoScreen(
+ event: String,
+ params: Map = mapOf(),
+ ) : Learn2earnEvents(
+ category = "Promo Screen",
+ event = event,
+ params = params,
+ ) {
+ class ButtonBuy : PromoScreen("Button - Buy")
+
+ class SuccessScreenOpened(clientType: AnalyticsParam.ClientType) : PromoScreen(
+ event = "Success Screen Opened",
+ params = mapOf(AnalyticsParam.CLIENT_TYPE to clientType.value),
+ )
+ }
+}
+
+internal sealed class AnalyticsParam {
+ sealed class ClientType(val value: String) {
+ class New : ClientType("New")
+ class Old : ClientType("Old")
+ }
+
+ companion object Key {
+ const val CLIENT_TYPE = "Client type"
+ }
+}
\ No newline at end of file
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/DefaultLearn2earnInteractor.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/DefaultLearn2earnInteractor.kt
index 90d279f90f..402f88ee82 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/DefaultLearn2earnInteractor.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/DefaultLearn2earnInteractor.kt
@@ -1,6 +1,7 @@
package com.tangem.feature.learn2earn.domain
import android.net.Uri
+import com.tangem.core.analytics.api.AnalyticsEventHandler
import com.tangem.datasource.api.promotion.models.AbstractPromotionResponse
import com.tangem.datasource.api.promotion.models.PromotionInfoResponse
import com.tangem.feature.learn2earn.data.api.Learn2earnRepository
@@ -17,11 +18,12 @@ import com.tangem.lib.crypto.models.Currency
/**
[REDACTED_AUTHOR]
*/
-class DefaultLearn2earnInteractor(
+internal class DefaultLearn2earnInteractor(
private val featureToggleManager: Learn2earnFeatureToggleManager,
private val repository: Learn2earnRepository,
private val userWalletManager: UserWalletManager,
private val derivationManager: DerivationManager,
+ private val analyticsEventHandler: AnalyticsEventHandler,
dependencyProvider: Learn2earnDependencyProvider,
) : Learn2earnInteractor {
@@ -29,11 +31,17 @@ class DefaultLearn2earnInteractor(
private lateinit var promotion: Promotion
- private val webViewUriBuilder: WebViewUriBuilder = WebViewUriBuilder(
- authCredentialsProvider = dependencyProvider.getWebViewAuthCredentialsProvider(),
- userCountryCodeProvider = dependencyProvider.getUserCountryCodeProvider(),
- promoCodeProvider = { repository.getUserData().promoCode },
- )
+ private val webViewUriBuilder: WebViewUriBuilder by lazy {
+ WebViewUriBuilder(
+ authCredentialsProvider = dependencyProvider.getWebViewAuthCredentialsProvider(),
+ userCountryCodeProvider = dependencyProvider.getUserCountryCodeProvider(),
+ promoCodeProvider = { repository.getUserData().promoCode },
+ )
+ }
+
+ private val webViewUriParser: WebViewUriParser by lazy {
+ WebViewUriParser { repository.getProgramName() }
+ }
override suspend fun init() {
initPromotionInfo()
@@ -183,27 +191,28 @@ class DefaultLearn2earnInteractor(
return HeadersConverter().convert(webViewUriBuilder.getBasicAuthHeaders())
}
- override fun handleRedirect(uri: Uri): RedirectConsequences {
- if (webViewUriBuilder.isReadyForExistedCardAwardRedirect(uri)) {
- updateUserData { it.copy(isRegisteredInPromotion = true) }
- webViewResultHandler?.handleResult(WebViewResult.ReadyForAward)
- return RedirectConsequences.FINISH_SESSION
- }
-
- return if (webViewUriBuilder.isPromoCodeRedirect(uri)) {
- webViewUriBuilder.extractPromoCode(uri)?.let { code ->
+ override fun handleRedirect(uri: Uri): WebViewAction {
+ val result = webViewUriParser.parse(uri)
+ when (result) {
+ is WebViewResult.PromoCode -> {
updateUserData {
it.copy(
- promoCode = code,
+ promoCode = result.promoCode,
isRegisteredInPromotion = true,
)
}
- webViewResultHandler?.handleResult(WebViewResult.PromoCodeReceived)
}
- RedirectConsequences.NOTHING
- } else {
- RedirectConsequences.PROCEED
+ WebViewResult.ReadyForAward -> {
+ updateUserData { it.copy(isRegisteredInPromotion = true) }
+ }
+ is WebViewResult.Learn2earnAnalyticsEvent -> {
+ analyticsEventHandler.send(result.event)
+ }
+ WebViewResult.Empty -> Unit
}
+ webViewResultHandler?.handleResult(result)
+
+ return result.toWebViewAction()
}
private fun promotionIsActive(): Boolean {
@@ -277,12 +286,21 @@ class DefaultLearn2earnInteractor(
repository.updateUserData(this)
}
}
-}
-private fun Promotion.PromotionInfo.getData(promoCode: String?): PromotionInfoResponse.Data {
- return if (promoCode == null) {
- newCard
- } else {
- oldCard
+ private fun Promotion.PromotionInfo.getData(promoCode: String?): PromotionInfoResponse.Data {
+ return if (promoCode == null) {
+ newCard
+ } else {
+ oldCard
+ }
+ }
+
+ private fun WebViewResult.toWebViewAction(): WebViewAction {
+ return when (this) {
+ WebViewResult.Empty -> WebViewAction.PROCEED
+ WebViewResult.ReadyForAward -> WebViewAction.FINISH_SESSION
+ is WebViewResult.Learn2earnAnalyticsEvent -> WebViewAction.NOTHING
+ is WebViewResult.PromoCode -> WebViewAction.NOTHING
+ }
}
}
\ No newline at end of file
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/WebViewUriBuilder.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/WebViewUriBuilder.kt
index 5af98601aa..0b2f6f6450 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/WebViewUriBuilder.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/WebViewUriBuilder.kt
@@ -39,41 +39,15 @@ internal class WebViewUriBuilder(
}
}
- fun isPromoCodeRedirect(uri: Uri): Boolean {
- return uri.toString().contains(SUFFIX_CODE_CREATED)
- }
-
- fun isReadyForExistedCardAwardRedirect(uri: Uri): Boolean {
- return uri.toString().endsWith(SUFFIX_READY_FOR_AWARD)
- }
-
- fun extractPromoCode(uri: Uri): String? {
- val url = uri.toString()
-
- return if (isPromoCodeRedirect(uri)) {
- val replaceString = makeWebViewUriBuilder().build().toString() + SUFFIX_CODE_CREATED
- val code = url.replace(replaceString, "")
- code
- } else {
- null
- }
- }
-
- private fun makeWebViewUriBuilder(): Uri.Builder {
- val builder = Uri.Builder()
- builder.scheme(SCHEME)
-
+ private fun makeWebViewUriBuilder(): Uri.Builder = Uri.Builder().apply {
+ scheme(SCHEME)
if (BuildConfig.DEBUG) {
- builder.authority(DEV_BASE_URL)
- builder.appendPath(userCountryCodeProvider.invoke())
- builder.appendPath(DEV_PATH_PROMOTION)
+ authority(DEV_BASE_URL)
} else {
- builder.authority(BASE_URL)
- builder.appendPath(userCountryCodeProvider.invoke())
- builder.appendPath(PATH_PROMOTION)
+ authority(BASE_URL)
}
-
- return builder
+ appendPath(userCountryCodeProvider.invoke())
+ appendPath(PATH_PROMOTION)
}
private companion object {
@@ -86,9 +60,5 @@ internal class WebViewUriBuilder(
const val QUERY_EXISTED_CARD = "existed-card"
const val DEV_BASE_URL = "devweb.tangem.com"
- const val DEV_PATH_PROMOTION = "promotion-test"
-
- const val SUFFIX_CODE_CREATED = "/code-created?code="
- const val SUFFIX_READY_FOR_AWARD = "/ready-for-existed-card-award"
}
}
\ No newline at end of file
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/WebViewUriParser.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/WebViewUriParser.kt
new file mode 100644
index 0000000000..f8d1d18e22
--- /dev/null
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/WebViewUriParser.kt
@@ -0,0 +1,91 @@
+package com.tangem.feature.learn2earn.domain
+
+import android.net.Uri
+import com.tangem.feature.learn2earn.analytics.AnalyticsParam
+import com.tangem.feature.learn2earn.analytics.Learn2earnEvents
+import com.tangem.feature.learn2earn.analytics.Learn2earnEvents.PromoScreen
+import com.tangem.feature.learn2earn.domain.api.WebViewResult
+
+/**
+[REDACTED_AUTHOR]
+ */
+internal class WebViewUriParser(
+ private val programNameProvider: () -> String,
+) {
+
+ fun parse(uri: Uri): WebViewResult = when {
+ isAnalyticsRedirect(uri) -> {
+ val event = extractAnalyticsEvent(uri)
+ if (event == null) {
+ WebViewResult.Empty
+ } else {
+ WebViewResult.Learn2earnAnalyticsEvent(event)
+ }
+ }
+ isPromoCodeRedirect(uri) -> {
+ val promoCode = extractPromoCode(uri)
+ if (promoCode == null) {
+ WebViewResult.Empty
+ } else {
+ WebViewResult.PromoCode(promoCode)
+ }
+ }
+ isReadyForAwardRedirect(uri) -> {
+ WebViewResult.ReadyForAward
+ }
+ else -> WebViewResult.Empty
+ }
+
+ private fun isReadyForAwardRedirect(uri: Uri): Boolean {
+ return uri.lastPathSegment == PATH_READY_FOR_AWARD
+ }
+
+ private fun isPromoCodeRedirect(uri: Uri): Boolean {
+ return uri.lastPathSegment == PATH_PROMO_CODE_CREATED &&
+ uri.queryParameterNames.contains(QUERY_PROMO_CODE)
+ }
+
+ private fun extractPromoCode(uri: Uri): String? {
+ return if (isPromoCodeRedirect(uri)) {
+ uri.getQueryParameter(QUERY_PROMO_CODE)
+ } else {
+ null
+ }
+ }
+
+ private fun isAnalyticsRedirect(uri: Uri): Boolean {
+ return uri.lastPathSegment == PATH_ANALYTICS &&
+ uri.queryParameterNames.contains(QUERY_ANALYTICS_EVENT)
+ }
+
+ private fun extractAnalyticsEvent(uri: Uri): Learn2earnEvents? {
+ if (!isAnalyticsRedirect(uri)) return null
+
+ val programName = uri.getQueryParameter(QUERY_PROGRAM_NAME) ?: return null
+ if (programName != programNameProvider.invoke()) return null
+
+ val event = uri.getQueryParameter(QUERY_ANALYTICS_EVENT) ?: return null
+
+ val analyticsEvent = when (event) {
+ EVENT_PROMO_BUY -> PromoScreen.ButtonBuy()
+ EVENT_PROMO_SUCCESS_NEW_USER -> PromoScreen.SuccessScreenOpened(AnalyticsParam.ClientType.New())
+ EVENT_PROMO_SUCCESS_OLD_USER -> PromoScreen.SuccessScreenOpened(AnalyticsParam.ClientType.Old())
+ else -> null
+ }
+ return analyticsEvent
+ }
+
+ private companion object {
+ const val PATH_PROMO_CODE_CREATED = "code-created"
+ const val PATH_READY_FOR_AWARD = "ready-for-existed-card-award"
+ const val PATH_ANALYTICS = "analytics"
+
+ const val QUERY_PROMO_CODE = "code"
+ const val QUERY_ANALYTICS_EVENT = "event"
+ const val QUERY_PROGRAM_NAME = "programName"
+
+ const val EVENT_PROMO_BUY = "promotion-buy"
+ const val EVENT_PROMO_SUCCESS_NEW_USER = "promotion-success-new-user"
+ const val EVENT_PROMO_SUCCESS_OLD_USER = "promotion-success-old-user"
+ }
+}
\ No newline at end of file
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/api/WebViewRedirectHandler.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/api/WebViewRedirectHandler.kt
index efca9c182a..6f2fe55945 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/api/WebViewRedirectHandler.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/api/WebViewRedirectHandler.kt
@@ -9,10 +9,10 @@ import android.net.Uri
[REDACTED_AUTHOR]
*/
interface WebViewRedirectHandler {
- fun handleRedirect(uri: Uri): RedirectConsequences
+ fun handleRedirect(uri: Uri): WebViewAction
}
-enum class RedirectConsequences {
+enum class WebViewAction {
NOTHING,
PROCEED,
FINISH_SESSION,
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/api/WebViewResultHandler.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/api/WebViewResultHandler.kt
index 08a749f327..6b7c851a69 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/api/WebViewResultHandler.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/api/WebViewResultHandler.kt
@@ -1,5 +1,7 @@
package com.tangem.feature.learn2earn.domain.api
+import com.tangem.core.analytics.AnalyticsEvent
+
/**
* Handler that helps determine a result of the Learn2earnWebViewActivity webView actions.
*
@@ -10,6 +12,8 @@ interface WebViewResultHandler {
}
sealed class WebViewResult {
- object PromoCodeReceived : WebViewResult()
+ object Empty : WebViewResult()
+ data class PromoCode(val promoCode: String) : WebViewResult()
object ReadyForAward : WebViewResult()
+ data class Learn2earnAnalyticsEvent(val event: AnalyticsEvent) : WebViewResult()
}
\ No newline at end of file
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/di/Learn2earnDomainModule.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/di/Learn2earnDomainModule.kt
index 7f48ea304a..72c05a6953 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/di/Learn2earnDomainModule.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/di/Learn2earnDomainModule.kt
@@ -1,6 +1,7 @@
package com.tangem.feature.learn2earn.domain.di
import android.content.Context
+import com.tangem.core.analytics.api.AnalyticsEventHandler
import com.tangem.core.featuretoggle.manager.FeatureTogglesManager
import com.tangem.feature.learn2earn.data.api.Learn2earnRepository
import com.tangem.feature.learn2earn.data.toggles.DefaultLearn2earnFeatureToggleManager
@@ -21,7 +22,7 @@ import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
-class Learn2earnDomainModule {
+internal class Learn2earnDomainModule {
@Provides
@Singleton
@@ -42,6 +43,7 @@ class Learn2earnDomainModule {
repository: Learn2earnRepository,
dependencyProvider: Learn2earnDependencyProvider,
userWalletManager: UserWalletManager,
+ analyticsEventHandler: AnalyticsEventHandler,
derivationManager: DerivationManager,
): Learn2earnInteractor {
return DefaultLearn2earnInteractor(
@@ -49,6 +51,7 @@ class Learn2earnDomainModule {
repository = repository,
userWalletManager = userWalletManager,
derivationManager = derivationManager,
+ analyticsEventHandler = analyticsEventHandler,
dependencyProvider = dependencyProvider,
)
}
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/models/Promotion.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/models/Promotion.kt
index 5fc46b4e11..463001cb21 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/models/Promotion.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/domain/models/Promotion.kt
@@ -5,7 +5,7 @@ import com.tangem.datasource.api.promotion.models.PromotionInfoResponse
/**
[REDACTED_AUTHOR]
*/
-data class Promotion(
+internal data class Promotion(
val info: PromotionInfo?,
val error: PromotionError?,
) {
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/Learn2earnViewModel.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/Learn2earnViewModel.kt
index e6d45c0b51..8c3cbfb221 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/Learn2earnViewModel.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/Learn2earnViewModel.kt
@@ -5,6 +5,9 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
+import com.tangem.core.analytics.api.AnalyticsEventHandler
+import com.tangem.feature.learn2earn.analytics.AnalyticsParam
+import com.tangem.feature.learn2earn.analytics.Learn2earnEvents
import com.tangem.feature.learn2earn.domain.api.Learn2earnInteractor
import com.tangem.feature.learn2earn.domain.api.WebViewResult
import com.tangem.feature.learn2earn.domain.api.WebViewResultHandler
@@ -25,6 +28,7 @@ class Learn2earnViewModel @Inject constructor(
private val interactor: Learn2earnInteractor,
private val router: Learn2earnRouter,
private val dispatchers: AppCoroutineDispatcherProvider,
+ private val analytics: AnalyticsEventHandler,
) : ViewModel() {
var uiState: Learn2earnState by mutableStateOf(
@@ -63,16 +67,19 @@ class Learn2earnViewModel @Inject constructor(
}
private fun onButtonStoryClick() {
+ analytics.send(Learn2earnEvents.IntroductionProcess.ButtonLearn())
router.openWebView(interactor.buildUriForNewUser(), interactor.getBasicAuthHeaders())
}
private fun onButtonMainClick() {
if (!interactor.isUserHadPromoCode() && !interactor.isUserRegisteredInPromotion()) {
+ analytics.send(Learn2earnEvents.MainScreen.NoticeLear2earn(AnalyticsParam.ClientType.New()))
subscribeToWebViewResultEvents()
router.openWebView(interactor.buildUriForOldUser(), interactor.getBasicAuthHeaders())
return
}
+ analytics.send(Learn2earnEvents.MainScreen.NoticeLear2earn(AnalyticsParam.ClientType.Old()))
viewModelScope.launch(dispatchers.io) {
updateUi { uiState.updateProgress(showProgress = true) }
@@ -80,6 +87,7 @@ class Learn2earnViewModel @Inject constructor(
.onSuccess { requestAwardResult ->
requestAwardResult.fold(
onSuccess = {
+ analytics.send(Learn2earnEvents.MainScreen.NoticeClaimSuccess())
val onHideDialog = {
uiState = uiState.updateGetBonusVisibility(isVisible = false)
.hideDialog()
@@ -164,9 +172,8 @@ class Learn2earnViewModel @Inject constructor(
interactor.webViewResultHandler = object : WebViewResultHandler {
override fun handleResult(result: WebViewResult) {
interactor.webViewResultHandler = null
- when (result) {
- WebViewResult.ReadyForAward -> updateMainScreenViews()
- WebViewResult.PromoCodeReceived -> Unit
+ if (result is WebViewResult.ReadyForAward) {
+ updateMainScreenViews()
}
}
}
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/Learn2earnStoriesScreen.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/Learn2earnStoriesScreen.kt
index 4793bcfbc4..b91ffaf2f5 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/Learn2earnStoriesScreen.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/Learn2earnStoriesScreen.kt
@@ -32,26 +32,34 @@ fun Learn2earnStoriesScreen(onLearnClick: () -> Unit, modifier: Modifier = Modif
.fillMaxSize()
.align(Alignment.Center),
)
- StoryDescription(
- modifier = Modifier
- .padding(horizontal = TangemTheme.dimens.size40)
- .fillMaxSize(),
- headerText = stringResource(id = R.string.story_learn_title),
- bodyText = stringResource(id = R.string.story_learn_description),
- )
- Image(
- modifier = Modifier
- .padding(bottom = TangemTheme.dimens.size68)
- .align(Alignment.BottomCenter),
- painter = painterResource(id = R.drawable.img_1inch_logo_401_378),
- contentDescription = null,
- )
+ Column(
+ modifier = Modifier.fillMaxSize(),
+ ) {
+ StoryDescription(
+ modifier = Modifier
+ .padding(horizontal = TangemTheme.dimens.size40)
+ .weight(weight = 1f),
+ headerText = stringResource(id = R.string.common_learn_and_earn),
+ bodyText = stringResource(id = R.string.story_learn_description),
+ )
+ Image(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(bottom = TangemTheme.dimens.size16)
+ .navigationBarsPadding()
+ .weight(weight = 1.2f),
+ painter = painterResource(id = R.drawable.img_1inch_logo_401_378),
+ contentDescription = null,
+ )
+ }
+
SecondaryButton(
modifier = Modifier
.padding(horizontal = TangemTheme.dimens.size16)
- .padding(bottom = TangemTheme.dimens.size84)
+ .padding(bottom = TangemTheme.dimens.size36)
.fillMaxWidth()
- .align(Alignment.BottomCenter),
+ .align(Alignment.BottomCenter)
+ .navigationBarsPadding(),
text = stringResource(id = R.string.story_learn_learn),
onClick = onLearnClick,
)
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/state/Learn2earnState.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/state/Learn2earnState.kt
index c6eb8a4d4d..4ba08f14bb 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/state/Learn2earnState.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/state/Learn2earnState.kt
@@ -37,12 +37,12 @@ data class MainScreenState(
sealed class Description(val title: TextReference, val subtitle: TextReference) {
class Learn(award: Int) : Description(
- TextReference.Res(R.string.main_learn_title),
+ TextReference.Res(R.string.common_learn_and_earn),
TextReference.PluralRes(R.plurals.main_learn_subtitle, award, WrappedList(listOf(award))),
)
object GetBonus : Description(
- TextReference.Res(R.string.main_get_bonus_title),
+ TextReference.Res(R.string.common_learn_and_earn),
TextReference.Res(R.string.main_get_bonus_subtitle),
)
}
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/Learn2earnWebViewActivity.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/Learn2earnWebViewActivity.kt
index cea693607e..7300fcdb06 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/Learn2earnWebViewActivity.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/Learn2earnWebViewActivity.kt
@@ -38,7 +38,7 @@ class Learn2earnWebViewActivity : AppCompatActivity() {
webView.settings.loadsImagesAutomatically = true
webView.webViewClient = Learn2earnWebViewClient(
- helper = viewModel,
+ redirectHandler = viewModel,
headers = webViewData.headers,
finishSessionHandler = { finish() },
)
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/Learn2earnWebViewClient.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/Learn2earnWebViewClient.kt
index 5957d80a32..7a96dbc90b 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/Learn2earnWebViewClient.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/Learn2earnWebViewClient.kt
@@ -3,28 +3,28 @@ package com.tangem.feature.learn2earn.presentation.webView
import android.webkit.WebResourceRequest
import android.webkit.WebView
import android.webkit.WebViewClient
-import com.tangem.feature.learn2earn.domain.api.RedirectConsequences
+import com.tangem.feature.learn2earn.domain.api.WebViewAction
import com.tangem.feature.learn2earn.domain.api.WebViewRedirectHandler
import timber.log.Timber
internal class Learn2earnWebViewClient(
- private val helper: WebViewRedirectHandler,
+ private val redirectHandler: WebViewRedirectHandler,
private val headers: Map,
private val finishSessionHandler: () -> Unit,
) : WebViewClient() {
override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean {
Timber.d("url: ${request.url}")
- when (helper.handleRedirect(request.url)) {
- RedirectConsequences.PROCEED -> {
+ when (redirectHandler.handleRedirect(request.url)) {
+ WebViewAction.NOTHING -> Unit
+ WebViewAction.PROCEED -> {
val mergedHeaders = headers.toMutableMap()
request.requestHeaders?.let { mergedHeaders.putAll(it) }
view.loadUrl(request.url.toString(), mergedHeaders)
}
- RedirectConsequences.FINISH_SESSION -> {
+ WebViewAction.FINISH_SESSION -> {
finishSessionHandler.invoke()
}
- else -> Unit
}
return true
}
diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/WebViewViewModel.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/WebViewViewModel.kt
index 3b25e78a58..f6daa6c3ef 100644
--- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/WebViewViewModel.kt
+++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/webView/WebViewViewModel.kt
@@ -4,7 +4,6 @@ import android.content.Intent
import android.net.Uri
import androidx.lifecycle.ViewModel
import com.tangem.feature.learn2earn.domain.HeadersConverter
-import com.tangem.feature.learn2earn.domain.api.RedirectConsequences
import com.tangem.feature.learn2earn.domain.api.WebViewRedirectHandler
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
@@ -14,12 +13,8 @@ import javax.inject.Inject
*/
@HiltViewModel
internal class WebViewViewModel @Inject constructor(
- private val handler: WebViewRedirectHandler,
-) : ViewModel(), WebViewRedirectHandler {
-
- override fun handleRedirect(uri: Uri): RedirectConsequences {
- return handler.handleRedirect(uri)
- }
+ handler: WebViewRedirectHandler,
+) : ViewModel(), WebViewRedirectHandler by handler {
fun extractData(intent: Intent): WebViewData {
val uriString = requireNotNull(intent.getStringExtra(Learn2earnWebViewActivity.EXTRA_WEB_URI)) {
diff --git a/features/learn2earn/impl/src/main/res/layout/activity_web_view.xml b/features/learn2earn/impl/src/main/res/layout/activity_web_view.xml
index d4020201c8..8737917c56 100644
--- a/features/learn2earn/impl/src/main/res/layout/activity_web_view.xml
+++ b/features/learn2earn/impl/src/main/res/layout/activity_web_view.xml
@@ -1,7 +1,7 @@
@@ -10,21 +10,29 @@
android:id="@+id/app_bar"
style="@style/Widget.MaterialComponents.Toolbar.Surface"
android:layout_width="match_parent"
- app:liftOnScroll="true"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ app:elevation="0dp">
-
+ app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
+
+
+
+
\ No newline at end of file
diff --git a/features/tokendetails/api/.gitignore b/features/tokendetails/api/.gitignore
new file mode 100644
index 0000000000..796b96d1c4
--- /dev/null
+++ b/features/tokendetails/api/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/features/tokendetails/api/build.gradle.kts b/features/tokendetails/api/build.gradle.kts
new file mode 100644
index 0000000000..b7c1f22eeb
--- /dev/null
+++ b/features/tokendetails/api/build.gradle.kts
@@ -0,0 +1,14 @@
+plugins {
+ alias(deps.plugins.android.library)
+ alias(deps.plugins.kotlin.android)
+ id("configuration")
+}
+
+android {
+ namespace = "com.tangem.features.tokendetails.api"
+}
+
+dependencies {
+ /** AndroidX */
+ implementation(deps.androidx.fragment.ktx)
+}
\ No newline at end of file
diff --git a/features/tokendetails/api/src/main/kotlin/com/tangem/features/tokendetails/featuretoggles/TokenDetailsFeatureToggles.kt b/features/tokendetails/api/src/main/kotlin/com/tangem/features/tokendetails/featuretoggles/TokenDetailsFeatureToggles.kt
new file mode 100644
index 0000000000..751dabea32
--- /dev/null
+++ b/features/tokendetails/api/src/main/kotlin/com/tangem/features/tokendetails/featuretoggles/TokenDetailsFeatureToggles.kt
@@ -0,0 +1,5 @@
+package com.tangem.features.tokendetails.featuretoggles
+
+interface TokenDetailsFeatureToggles {
+ val isRedesignedScreenEnabled: Boolean
+}
\ No newline at end of file
diff --git a/features/tokendetails/api/src/main/kotlin/com/tangem/features/tokendetails/navigation/TokenDetailsRouter.kt b/features/tokendetails/api/src/main/kotlin/com/tangem/features/tokendetails/navigation/TokenDetailsRouter.kt
new file mode 100644
index 0000000000..a361d75438
--- /dev/null
+++ b/features/tokendetails/api/src/main/kotlin/com/tangem/features/tokendetails/navigation/TokenDetailsRouter.kt
@@ -0,0 +1,8 @@
+package com.tangem.features.tokendetails.navigation
+
+import androidx.fragment.app.Fragment
+
+interface TokenDetailsRouter {
+
+ fun getEntryFragment(): Fragment
+}
\ No newline at end of file
diff --git a/features/tokendetails/impl/.gitignore b/features/tokendetails/impl/.gitignore
new file mode 100644
index 0000000000..796b96d1c4
--- /dev/null
+++ b/features/tokendetails/impl/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/features/tokendetails/impl/build.gradle.kts b/features/tokendetails/impl/build.gradle.kts
new file mode 100644
index 0000000000..aa624c46ac
--- /dev/null
+++ b/features/tokendetails/impl/build.gradle.kts
@@ -0,0 +1,38 @@
+plugins {
+ alias(deps.plugins.android.library)
+ alias(deps.plugins.kotlin.android)
+ alias(deps.plugins.kotlin.kapt)
+ alias(deps.plugins.hilt.android)
+ id("configuration")
+}
+
+android {
+ namespace = "com.tangem.features.tokendetails.impl"
+}
+
+
+dependencies {
+ /** AndroidX */
+ implementation(deps.androidx.activity.compose)
+
+ /** Compose */
+ implementation(deps.compose.material)
+ implementation(deps.compose.foundation)
+ implementation(deps.compose.material3)
+ implementation(deps.compose.navigation)
+ implementation(deps.compose.navigation.hilt)
+ implementation(deps.compose.ui)
+ implementation(deps.compose.ui.tooling)
+ implementation(deps.compose.accompanist.systemUiController)
+
+ /** DI */
+ implementation(deps.hilt.android)
+ kapt(deps.hilt.kapt)
+
+ /** Core modules */
+ implementation(projects.core.featuretoggles)
+ implementation(projects.core.ui)
+
+ /** Feature Apis */
+ implementation(projects.features.tokendetails.api)
+}
\ No newline at end of file
diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/di/TokenDetailsFeatureTogglesModule.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/di/TokenDetailsFeatureTogglesModule.kt
new file mode 100644
index 0000000000..767b02d8a6
--- /dev/null
+++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/di/TokenDetailsFeatureTogglesModule.kt
@@ -0,0 +1,21 @@
+package com.tangem.feature.tokendetails.di
+
+import com.tangem.core.featuretoggle.manager.FeatureTogglesManager
+import com.tangem.feature.tokendetails.featuretoggles.DefaultTokenDetailsFeatureToggles
+import com.tangem.features.tokendetails.featuretoggles.TokenDetailsFeatureToggles
+import dagger.Module
+import dagger.Provides
+import dagger.hilt.InstallIn
+import dagger.hilt.components.SingletonComponent
+import javax.inject.Singleton
+
+@Module
+@InstallIn(SingletonComponent::class)
+internal object TokenDetailsFeatureTogglesModule {
+
+ @Provides
+ @Singleton
+ fun provideTokenDetailsFeatureToggles(featureTogglesManager: FeatureTogglesManager): TokenDetailsFeatureToggles {
+ return DefaultTokenDetailsFeatureToggles(featureTogglesManager = featureTogglesManager)
+ }
+}
\ No newline at end of file
diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/di/TokenDetailsRouterModule.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/di/TokenDetailsRouterModule.kt
new file mode 100644
index 0000000000..47a8b90f2e
--- /dev/null
+++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/di/TokenDetailsRouterModule.kt
@@ -0,0 +1,18 @@
+package com.tangem.feature.tokendetails.di
+
+import com.tangem.feature.tokendetails.presentation.router.DefaultTokenDetailsRouter
+import com.tangem.features.tokendetails.navigation.TokenDetailsRouter
+import dagger.Module
+import dagger.Provides
+import dagger.hilt.InstallIn
+import dagger.hilt.android.components.ActivityComponent
+import dagger.hilt.android.scopes.ActivityScoped
+
+@Module
+@InstallIn(ActivityComponent::class)
+internal object TokenDetailsRouterModule {
+
+ @Provides
+ @ActivityScoped
+ fun provideTokenDetailsRouter(): TokenDetailsRouter = DefaultTokenDetailsRouter()
+}
\ No newline at end of file
diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/featuretoggles/DefaultTokenDetailsFeatureToggles.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/featuretoggles/DefaultTokenDetailsFeatureToggles.kt
new file mode 100644
index 0000000000..2ac8bd5fde
--- /dev/null
+++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/featuretoggles/DefaultTokenDetailsFeatureToggles.kt
@@ -0,0 +1,14 @@
+package com.tangem.feature.tokendetails.featuretoggles
+
+import com.tangem.core.featuretoggle.manager.FeatureTogglesManager
+import com.tangem.features.tokendetails.featuretoggles.TokenDetailsFeatureToggles
+
+private const val REDESIGNED_TOKEN_DETAIL_SCREEN_ENABLED_KEY = "REDESIGNED_TOKEN_DETAIL_SCREEN_ENABLED"
+
+internal class DefaultTokenDetailsFeatureToggles(
+ private val featureTogglesManager: FeatureTogglesManager,
+) : TokenDetailsFeatureToggles {
+
+ override val isRedesignedScreenEnabled: Boolean
+ get() = featureTogglesManager.isFeatureEnabled(name = REDESIGNED_TOKEN_DETAIL_SCREEN_ENABLED_KEY)
+}
\ No newline at end of file
diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/router/DefaultTokenDetailsRouter.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/router/DefaultTokenDetailsRouter.kt
new file mode 100644
index 0000000000..6bfaf4dcaa
--- /dev/null
+++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/router/DefaultTokenDetailsRouter.kt
@@ -0,0 +1,10 @@
+package com.tangem.feature.tokendetails.presentation.router
+
+import androidx.fragment.app.Fragment
+import com.tangem.features.tokendetails.navigation.TokenDetailsRouter
+
+internal class DefaultTokenDetailsRouter : TokenDetailsRouter {
+
+ // TODO: Doston fix it in next PRs
+ override fun getEntryFragment(): Fragment = Fragment()
+}
\ No newline at end of file
diff --git a/gradle/dependencies.toml b/gradle/dependencies.toml
index 210582bd45..bc4184e943 100644
--- a/gradle/dependencies.toml
+++ b/gradle/dependencies.toml
@@ -73,14 +73,14 @@ mviCore = "1.3.1"
kotlinSerialization = "1.4.1"
arrow = "1.2.0-RC"
reactiveNetwork = "3.0.8"
-walletConnectCore = "1.15.0"
-walletConnectWeb3 = "1.8.0"
+walletConnectCore = "1.17.0"
+walletConnectWeb3 = "1.10.0"
prettyLogger = "2.2.0"
okHttp-prettyLogging = "3.1.0"
# endregion Other libraries
# region Tangem
-tangemBlockchainSdk = "develop-259"
+tangemBlockchainSdk = "develop-268"
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "develop-266"
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 15b3f6a078..1f7397e4f8 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -28,6 +28,8 @@ dependencyResolutionManagement {
}
}
+enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
+
include(":app")
include(":common")
@@ -61,6 +63,9 @@ include(":features:tester:impl")
include(":features:wallet:api")
include(":features:wallet:impl")
+include(":features:tokendetails:api")
+include(":features:tokendetails:impl")
+
include(":features:learn2earn:api")
include(":features:learn2earn:impl")
// endregion Feature modules
@@ -72,6 +77,8 @@ include(":domain:legacy")
include(":domain:core")
include(":domain:card")
+include(":domain:wallets")
+include(":domain:wallets:models")
// endregion Domain modules
// region Data modules