From a92d3bc692f73c6c0920c568013982308b604aea Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 17 Jun 2025 19:53:54 +0500 Subject: [PATCH] Updated on 2026-08-14 --- features/hot-wallet/api/.gitignore | 1 + features/hot-wallet/api/build.gradle.kts | 22 ++++++ .../hotwallet/HotWalletFeatureToggles.kt | 5 ++ features/hot-wallet/impl/.gitignore | 1 + features/hot-wallet/impl/build.gradle.kts | 67 +++++++++++++++++++ .../DefaultHotWalletFeatureToggles.kt | 10 +++ .../hotwallet/di/HotWalletFeatureModule.kt | 25 +++++++ settings.gradle.kts | 3 + 8 files changed, 134 insertions(+) create mode 100644 features/hot-wallet/api/.gitignore create mode 100644 features/hot-wallet/api/build.gradle.kts create mode 100644 features/hot-wallet/api/src/main/kotlin/com/tangem/features/hotwallet/HotWalletFeatureToggles.kt create mode 100644 features/hot-wallet/impl/.gitignore create mode 100644 features/hot-wallet/impl/build.gradle.kts create mode 100644 features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/DefaultHotWalletFeatureToggles.kt create mode 100644 features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/di/HotWalletFeatureModule.kt diff --git a/features/hot-wallet/api/.gitignore b/features/hot-wallet/api/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/features/hot-wallet/api/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/features/hot-wallet/api/build.gradle.kts b/features/hot-wallet/api/build.gradle.kts new file mode 100644 index 0000000000..6260c97d71 --- /dev/null +++ b/features/hot-wallet/api/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + alias(deps.plugins.android.library) + alias(deps.plugins.kotlin.android) + id("configuration") +} + +android { + namespace = "com.tangem.features.hotwallet.api" +} + +dependencies { + + /* Project - Domain */ + implementation(projects.domain.models) + + /* Project - Core */ + implementation(projects.core.decompose) + implementation(projects.core.ui) + + /* Compose */ + implementation(deps.compose.runtime) +} \ No newline at end of file diff --git a/features/hot-wallet/api/src/main/kotlin/com/tangem/features/hotwallet/HotWalletFeatureToggles.kt b/features/hot-wallet/api/src/main/kotlin/com/tangem/features/hotwallet/HotWalletFeatureToggles.kt new file mode 100644 index 0000000000..f8ecf58ffe --- /dev/null +++ b/features/hot-wallet/api/src/main/kotlin/com/tangem/features/hotwallet/HotWalletFeatureToggles.kt @@ -0,0 +1,5 @@ +package com.tangem.features.hotwallet + +interface HotWalletFeatureToggles { + val isHotWalletEnabled: Boolean +} \ No newline at end of file diff --git a/features/hot-wallet/impl/.gitignore b/features/hot-wallet/impl/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/features/hot-wallet/impl/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/features/hot-wallet/impl/build.gradle.kts b/features/hot-wallet/impl/build.gradle.kts new file mode 100644 index 0000000000..7b63af71b6 --- /dev/null +++ b/features/hot-wallet/impl/build.gradle.kts @@ -0,0 +1,67 @@ +plugins { + alias(deps.plugins.android.library) + alias(deps.plugins.kotlin.android) + alias(deps.plugins.kotlin.kapt) + alias(deps.plugins.kotlin.serialization) + alias(deps.plugins.hilt.android) + id("configuration") +} + +android { + namespace = "com.tangem.features.hotwallet.impl" +} + +dependencies { + /** Api */ + implementation(projects.features.hotWallet.api) + + /** Core modules */ + implementation(projects.core.configToggles) + implementation(projects.core.analytics) + implementation(projects.core.analytics.models) + implementation(projects.core.utils) + implementation(projects.core.ui) + implementation(projects.core.res) + implementation(projects.core.decompose) + implementation(projects.core.navigation) + implementation(projects.core.datasource) + + /** Common */ + implementation(projects.common.ui) + implementation(projects.common.routing) + + /** Tangem libraries */ + implementation(projects.libs.tangemSdkApi) + implementation(tangemDeps.card.core) + implementation(tangemDeps.card.android) { + exclude(module = "joda-time") + } + + /** AndroidX libraries */ + implementation(deps.androidx.core.ktx) + implementation(deps.lifecycle.runtime.ktx) + + /** Compose libraries */ + implementation(deps.compose.material) // to use buttons and text field in MultiWalletSeedPhraseImport.kt + implementation(deps.compose.material3) + implementation(deps.compose.animation) + implementation(deps.compose.foundation) + implementation(deps.compose.ui) + implementation(deps.compose.ui.tooling) + implementation(deps.compose.coil) + implementation(deps.lottie.compose) + implementation(deps.decompose.ext.compose) + implementation(deps.androidx.activity.compose) + implementation(deps.androidx.datastore) + + /** Other libraries */ + implementation(deps.arrow.core) + implementation(deps.kotlin.immutable.collections) + implementation(deps.kotlin.serialization) + implementation(deps.timber) + implementation(deps.firebase.crashlytics) + + /** DI */ + implementation(deps.hilt.android) + kapt(deps.hilt.kapt) +} \ No newline at end of file diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/DefaultHotWalletFeatureToggles.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/DefaultHotWalletFeatureToggles.kt new file mode 100644 index 0000000000..cadb09331f --- /dev/null +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/DefaultHotWalletFeatureToggles.kt @@ -0,0 +1,10 @@ +package com.tangem.features.hotwallet + +import com.tangem.core.configtoggle.feature.FeatureTogglesManager + +internal class DefaultHotWalletFeatureToggles( + private val featureTogglesManager: FeatureTogglesManager, +) : HotWalletFeatureToggles { + override val isHotWalletEnabled: Boolean + get() = featureTogglesManager.isFeatureEnabled(name = "HOT_WALLET_ENABLED") +} \ No newline at end of file diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/di/HotWalletFeatureModule.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/di/HotWalletFeatureModule.kt new file mode 100644 index 0000000000..3b8b7412a8 --- /dev/null +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/di/HotWalletFeatureModule.kt @@ -0,0 +1,25 @@ +package com.tangem.features.hotwallet.di + +import com.tangem.core.configtoggle.feature.FeatureTogglesManager +import com.tangem.features.hotwallet.DefaultHotWalletFeatureToggles +import com.tangem.features.hotwallet.HotWalletFeatureToggles +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 HotWalletFeatureModule { + + @Provides + @Singleton + fun provideFeatureToggles(featureTogglesManager: FeatureTogglesManager): HotWalletFeatureToggles { + return DefaultHotWalletFeatureToggles(featureTogglesManager) + } +} + +@Module +@InstallIn(SingletonComponent::class) +internal interface HotWalletFeatureModuleBinds \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 10052d3ba6..09f3a2c803 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -242,6 +242,9 @@ include(":features:nft:impl") include(":features:walletconnect:api") include(":features:walletconnect:impl") + +include(":features:hot-wallet:api") +include(":features:hot-wallet:impl") // endregion Feature modules // region Domain modules