diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 43ea7eb451..d53a38d574 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -114,6 +114,8 @@ dependencies { implementation(projects.domain.notifications) implementation(projects.domain.notifications.models) implementation(projects.domain.notifications.toggles) + implementation(projects.domain.swap.models) + implementation(projects.domain.swap) implementation(projects.common) implementation(projects.common.routing) @@ -160,6 +162,7 @@ dependencies { implementation(projects.data.quotes) implementation(projects.data.blockaid) implementation(projects.data.notifications) + implementation(projects.data.swap) /** Features */ implementation(projects.features.referral.impl) @@ -170,6 +173,8 @@ dependencies { implementation(projects.features.swap.domain) implementation(projects.features.swap.domain.api) implementation(projects.features.swap.data) + implementation(projects.features.swapV2.api) + implementation(projects.features.swapV2.impl) implementation(projects.features.tester.api) implementation(projects.features.tester.impl) implementation(projects.features.wallet.api) diff --git a/core/config-toggles/src/main/assets/configs/feature_toggles_config.json b/core/config-toggles/src/main/assets/configs/feature_toggles_config.json index 41a2ec1111..602bd04e20 100644 --- a/core/config-toggles/src/main/assets/configs/feature_toggles_config.json +++ b/core/config-toggles/src/main/assets/configs/feature_toggles_config.json @@ -62,5 +62,13 @@ { "name": "USEDESK_ENABLED", "version": "undefined" + }, + { + "name": "SEND_VIA_SWAP_ENABLED", + "version": "undefined" + }, + { + "name": "SWAP_REDESIGN_ENABLED", + "version": "undefined" } ] diff --git a/data/express/.gitignore b/data/express/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/data/express/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/data/express/build.gradle.kts b/data/express/build.gradle.kts new file mode 100644 index 0000000000..f9a4304009 --- /dev/null +++ b/data/express/build.gradle.kts @@ -0,0 +1,36 @@ +plugins { + alias(deps.plugins.android.library) + alias(deps.plugins.kotlin.android) + alias(deps.plugins.kotlin.kapt) + alias(deps.plugins.hilt.android) + alias(deps.plugins.ksp) + id("configuration") +} + +android { + namespace = "com.tangem.data.express" +} + +dependencies { + + /** Core */ + implementation(projects.core.datasource) + implementation(projects.core.utils) + + /** Data */ + implementation(projects.data.common) + + /** Domain */ + implementation(projects.domain.express.models) + implementation(projects.domain.express) + implementation(projects.domain.wallets.models) + + /** Other */ + implementation(deps.moshi) + implementation(deps.moshi.kotlin) + implementation(deps.timber) + + /** DI */ + implementation(deps.hilt.android) + kapt(deps.hilt.kapt) +} \ No newline at end of file diff --git a/data/swap/.gitignore b/data/swap/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/data/swap/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/data/swap/build.gradle.kts b/data/swap/build.gradle.kts new file mode 100644 index 0000000000..26eb11f40e --- /dev/null +++ b/data/swap/build.gradle.kts @@ -0,0 +1,54 @@ +plugins { + alias(deps.plugins.android.library) + alias(deps.plugins.kotlin.android) + alias(deps.plugins.kotlin.kapt) + alias(deps.plugins.hilt.android) + alias(deps.plugins.ksp) + id("configuration") +} + +android { + namespace = "com.tangem.data.swap" +} + +dependencies { + /** Core */ + implementation(projects.core.datasource) + implementation(projects.core.utils) + + /** Data */ + implementation(projects.data.common) + implementation(projects.data.express) + + /** Domain */ + implementation(projects.domain.express.models) + implementation(projects.domain.express) + implementation(projects.domain.swap.models) + implementation(projects.domain.swap) + implementation(projects.domain.wallets.models) + implementation(projects.domain.wallets) + implementation(projects.domain.tokens.models) + implementation(projects.domain.tokens) + implementation(projects.domain.legacy) + implementation(projects.domain.models) + + /** Tangem SDK */ + implementation(tangemDeps.blockchain) { + exclude(module = "joda-time") + } + + /** Libs */ + implementation(projects.libs.blockchainSdk) + + /** Other */ + implementation(deps.androidx.datastore) + implementation(deps.jodatime) + implementation(deps.kotlin.coroutines) + implementation(deps.moshi) + implementation(deps.moshi.kotlin) + implementation(deps.timber) + + /** DI */ + implementation(deps.hilt.android) + kapt(deps.hilt.kapt) +} \ No newline at end of file diff --git a/domain/express/.gitignore b/domain/express/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/domain/express/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/domain/express/build.gradle.kts b/domain/express/build.gradle.kts new file mode 100644 index 0000000000..b5a4095dac --- /dev/null +++ b/domain/express/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + alias(deps.plugins.android.library) + alias(deps.plugins.kotlin.android) + alias(deps.plugins.kotlin.serialization) + id("configuration") +} + +android { + namespace = "com.tangem.domain.express.models" +} + +dependencies { + /** Core */ + implementation(projects.core.utils) + implementation(projects.core.datasource) + + /** Domain */ + implementation(projects.domain.express.models) + implementation(projects.domain.wallets.models) + implementation(projects.domain.tokens.models) + + /** Other */ + implementation(deps.moshi.adapters) +} \ No newline at end of file diff --git a/domain/express/models/.gitignore b/domain/express/models/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/domain/express/models/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/domain/express/models/build.gradle.kts b/domain/express/models/build.gradle.kts new file mode 100644 index 0000000000..a7e2520b52 --- /dev/null +++ b/domain/express/models/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + alias(deps.plugins.kotlin.jvm) + id("configuration") +} + +dependencies { + /** Domain */ + implementation(projects.domain.tokens.models) + + /* Other */ + implementation(deps.moshi.adapters) +} \ No newline at end of file diff --git a/domain/swap/.gitignore b/domain/swap/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/domain/swap/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/domain/swap/build.gradle.kts b/domain/swap/build.gradle.kts new file mode 100644 index 0000000000..c0231df3f5 --- /dev/null +++ b/domain/swap/build.gradle.kts @@ -0,0 +1,31 @@ +import org.gradle.kotlin.dsl.projects + +plugins { + alias(deps.plugins.android.library) + alias(deps.plugins.kotlin.android) + alias(deps.plugins.kotlin.serialization) + id("configuration") +} + +android { + namespace = "com.tangem.domain.swap" +} + + +dependencies { + + /** Domain */ + implementation(projects.domain.models) + implementation(projects.domain.express.models) + implementation(projects.domain.swap.models) + implementation(projects.domain.wallets.models) + implementation(projects.domain.tokens.models) + + /** Util */ + implementation(projects.core.utils) + + /** Other */ + implementation(deps.arrow.core) + implementation(deps.kotlin.coroutines) + +} \ No newline at end of file diff --git a/domain/swap/models/.gitignore b/domain/swap/models/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/domain/swap/models/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/domain/swap/models/build.gradle.kts b/domain/swap/models/build.gradle.kts new file mode 100644 index 0000000000..0b8ed0f521 --- /dev/null +++ b/domain/swap/models/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + alias(deps.plugins.android.library) + alias(deps.plugins.kotlin.android) + alias(deps.plugins.kotlin.serialization) + id("configuration") +} + +android { + namespace = "com.tangem.domain.swap.models" +} + +dependencies { + /** Domain */ + implementation(projects.domain.models) + implementation(projects.domain.express.models) + implementation(projects.domain.tokens.models) + + /** Core */ + implementation(projects.core.datasource) + + /** Other */ + implementation(deps.jodatime) + implementation(deps.moshi) +} \ No newline at end of file diff --git a/features/swap-v2/api/.gitignore b/features/swap-v2/api/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/features/swap-v2/api/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/features/swap-v2/api/build.gradle.kts b/features/swap-v2/api/build.gradle.kts new file mode 100644 index 0000000000..7530654088 --- /dev/null +++ b/features/swap-v2/api/build.gradle.kts @@ -0,0 +1,25 @@ +plugins { + alias(deps.plugins.android.library) + alias(deps.plugins.kotlin.android) + id("configuration") +} + +android { + namespace = "com.tangem.features.swap.v2.api" +} + +dependencies { + /** Core */ + implementation(projects.core.decompose) + implementation(projects.core.ui) + + /** Domain */ + implementation(projects.domain.wallets.models) + implementation(projects.domain.express.models) + implementation(projects.domain.swap.models) + implementation(projects.domain.manageTokens.models) + implementation(projects.domain.models) + + /** Compose */ + implementation(deps.compose.runtime) +} \ No newline at end of file diff --git a/features/swap-v2/api/src/main/java/com/tangem/features/swap/v2/api/SwapFeatureToggles.kt b/features/swap-v2/api/src/main/java/com/tangem/features/swap/v2/api/SwapFeatureToggles.kt new file mode 100644 index 0000000000..2bc15c06e7 --- /dev/null +++ b/features/swap-v2/api/src/main/java/com/tangem/features/swap/v2/api/SwapFeatureToggles.kt @@ -0,0 +1,5 @@ +package com.tangem.features.swap.v2.api + +interface SwapFeatureToggles { + val isSwapRedesignEnabled: Boolean +} \ No newline at end of file diff --git a/features/swap-v2/impl/.gitignore b/features/swap-v2/impl/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/features/swap-v2/impl/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/features/swap-v2/impl/build.gradle.kts b/features/swap-v2/impl/build.gradle.kts new file mode 100644 index 0000000000..cb247c509f --- /dev/null +++ b/features/swap-v2/impl/build.gradle.kts @@ -0,0 +1,79 @@ +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.swap.v2.impl" + packaging { + resources { + // To build and run composable preview + merges += "paymentrequest.proto" + } + } +} + + +dependencies { + /** Feature */ + implementation(projects.features.swapV2.api) + implementation(projects.features.manageTokens.api) + implementation(projects.features.sendV2.api) + implementation(projects.features.feeSelector.api) + + /** Core */ + implementation(projects.core.decompose) + implementation(projects.core.ui) + implementation(projects.core.navigation) + implementation(projects.core.configToggles) + + /** Common */ + implementation(projects.common.ui) + implementation(projects.common.routing) + + implementation(tangemDeps.blockchain) { + exclude(module = "joda-time") + } + + /** Domain */ + implementation(projects.domain.models) + implementation(projects.domain.wallets.models) + implementation(projects.domain.wallets) + implementation(projects.domain.tokens.models) + implementation(projects.domain.tokens) + implementation(projects.domain.appCurrency.models) + implementation(projects.domain.appCurrency) + implementation(projects.domain.express.models) + implementation(projects.domain.swap.models) + implementation(projects.domain.swap) + implementation(projects.domain.manageTokens.models) + implementation(projects.domain.manageTokens) + implementation(projects.domain.transaction.models) + implementation(projects.domain.transaction) + + /** Compose */ + implementation(deps.compose.foundation) + implementation(deps.compose.runtime) + implementation(deps.compose.material3) + implementation(deps.compose.ui) + implementation(deps.compose.ui.tooling) + implementation(deps.androidx.activity.compose) + implementation(deps.compose.constraintLayout) + implementation(deps.compose.coil) + + /** Other */ + implementation(deps.arrow.core) + implementation(deps.decompose) + implementation(deps.decompose.ext.compose) + implementation(deps.timber) + implementation(deps.kotlin.immutable.collections) + implementation(deps.coil) + + /** DI */ + implementation(deps.hilt.android) + kapt(deps.hilt.kapt) +} \ No newline at end of file diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/DefaultSwapFeatureToggles.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/DefaultSwapFeatureToggles.kt new file mode 100644 index 0000000000..61d092f28a --- /dev/null +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/DefaultSwapFeatureToggles.kt @@ -0,0 +1,11 @@ +package com.tangem.features.swap.v2.impl + +import com.tangem.core.configtoggle.feature.FeatureTogglesManager +import com.tangem.features.swap.v2.api.SwapFeatureToggles + +internal class DefaultSwapFeatureToggles( + private val featureToggles: FeatureTogglesManager, +) : SwapFeatureToggles { + override val isSwapRedesignEnabled: Boolean + get() = featureToggles.isFeatureEnabled("SWAP_REDESIGN_ENABLED") +} \ No newline at end of file diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/di/SwapFeatureModules.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/di/SwapFeatureModules.kt new file mode 100644 index 0000000000..3318c6d6c3 --- /dev/null +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/di/SwapFeatureModules.kt @@ -0,0 +1,21 @@ +package com.tangem.features.swap.v2.impl.di + +import com.tangem.core.configtoggle.feature.FeatureTogglesManager +import com.tangem.features.swap.v2.api.SwapFeatureToggles +import com.tangem.features.swap.v2.impl.DefaultSwapFeatureToggles +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 SwapFeatureModules { + + @Provides + @Singleton + fun provideSwapFeatureToggles(featureTogglesManager: FeatureTogglesManager): SwapFeatureToggles { + return DefaultSwapFeatureToggles(featureTogglesManager) + } +} \ No newline at end of file diff --git a/features/swap/domain/build.gradle.kts b/features/swap/domain/build.gradle.kts index 7d52289e23..256c69cbac 100644 --- a/features/swap/domain/build.gradle.kts +++ b/features/swap/domain/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } android { - namespace = "com.tangem.domain.swap" + namespace = "com.tangem.features.domain.swap" } dependencies { diff --git a/settings.gradle.kts b/settings.gradle.kts index 09f3a2c803..c827ecc8a0 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -185,6 +185,8 @@ include(":features:swap:domain") include(":features:swap:domain:models") include(":features:swap:domain:api") include(":features:swap:impl") +include(":features:swap-v2:api") +include(":features:swap-v2:impl") include(":features:tester:api") include(":features:tester:impl") @@ -299,6 +301,10 @@ include(":domain:blockaid:models") include(":domain:notifications") include(":domain:notifications:models") include(":domain:notifications:toggles") +include(":domain:express") +include(":domain:express:models") +include(":domain:swap") +include(":domain:swap:models") // endregion Domain modules // region Data modules @@ -328,4 +334,6 @@ include(":data:onramp") include(":data:quotes") include(":data:notifications") include(":data:blockaid") -// endregion Data modules \ No newline at end of file +// endregion Data modules +include(":data:swap") +include(":data:express") \ No newline at end of file