Updated on 2026-08-14

This commit is contained in:
Tangem 2024-05-17 14:14:44 +02:00
parent 20452728f8
commit 9868dd2bc2
14 changed files with 184 additions and 0 deletions

View file

@ -121,6 +121,8 @@ dependencies {
implementation(projects.features.send.impl)
implementation(projects.features.qrScanning.api)
implementation(projects.features.qrScanning.impl)
implementation(projects.features.staking.api)
implementation(projects.features.staking.impl)
/** AndroidX libraries */
implementation(deps.androidx.core.ktx)

View file

@ -30,5 +30,9 @@
{
"name": "CARDANO_TOKENS_SUPPORT_ENABLED",
"version": "5.11.0"
},
{
"name": "STAKING_ENABLED",
"version": "undefined"
}
]

1
features/staking/api/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build

View file

@ -0,0 +1,16 @@
plugins {
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
id("kotlin-parcelize")
id("configuration")
}
android {
namespace = "com.tangem.features.staking.api"
}
dependencies {
/** AndroidX */
implementation(deps.androidx.fragment.ktx)
}

View file

@ -0,0 +1,10 @@
package com.tangem.features.staking.api.featuretoggles
/**
* Staking feature toggles
*/
interface StakingFeatureToggles {
/** Availability of staking */
val isStakingEnabled: Boolean
}

View file

@ -0,0 +1,8 @@
package com.tangem.features.staking.api.navigation
import androidx.fragment.app.Fragment
interface StakingRouter {
fun getEntryFragment(): Fragment
}

1
features/staking/impl/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build

View file

@ -0,0 +1,62 @@
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.staking.impl"
}
dependencies {
/** AndroidX */
implementation(deps.androidx.fragment.ktx)
implementation(deps.androidx.appCompat)
implementation(deps.androidx.paging.runtime)
/** Other dependencies */
implementation(deps.kotlin.immutable.collections)
implementation(deps.material)
implementation(deps.arrow.core)
implementation(deps.lifecycle.compose)
implementation(deps.jodatime)
implementation(deps.timber)
/** Compose */
implementation(deps.compose.accompanist.systemUiController)
implementation(deps.compose.material3)
implementation(deps.compose.material)
implementation(deps.compose.foundation)
implementation(deps.compose.ui)
implementation(deps.compose.ui.tooling)
implementation(deps.compose.navigation)
implementation(deps.compose.navigation.hilt)
implementation(deps.compose.constraintLayout)
/** Tangem SDKs */
implementation(deps.tangem.card.core)
implementation(deps.tangem.blockchain)
/** Core modules */
implementation(projects.core.featuretoggles)
implementation(projects.core.ui)
implementation(projects.core.utils)
implementation(projects.core.navigation)
implementation(projects.core.analytics)
implementation(projects.core.analytics.models)
/** Common */
implementation(projects.common)
/** Libs */
implementation(projects.libs.crypto)
/** Feature modules */
implementation(projects.features.staking.api)
/** DI */
implementation(deps.hilt.android)
kapt(deps.hilt.kapt)
}

View file

@ -0,0 +1,24 @@
package com.tangem.features.staking.impl.di
import com.tangem.core.featuretoggle.manager.FeatureTogglesManager
import com.tangem.features.staking.api.featuretoggles.StakingFeatureToggles
import com.tangem.features.staking.impl.featuretoggles.DefaultStakingFeatureToggles
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
/**
* DI module provides implementation of [StakingFeatureToggles]
*/
@Module
@InstallIn(SingletonComponent::class)
internal object StakingFeatureTogglesModule {
@Provides
@Singleton
fun provideStakingFeatureToggles(featureTogglesManager: FeatureTogglesManager): StakingFeatureToggles {
return DefaultStakingFeatureToggles(featureTogglesManager = featureTogglesManager)
}
}

View file

@ -0,0 +1,23 @@
package com.tangem.features.staking.impl.di
import com.tangem.features.staking.impl.navigation.DefaultStakingRouter
import com.tangem.features.staking.api.navigation.StakingRouter
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import dagger.hilt.android.scopes.ActivityScoped
/**
* DI module provides implementation of [StakingRouter]
*/
@Module
@InstallIn(ActivityComponent::class)
internal object StakingRouterModule {
@Provides
@ActivityScoped
fun provideStakingRouter(): StakingRouter {
return DefaultStakingRouter()
}
}

View file

@ -0,0 +1,17 @@
package com.tangem.features.staking.impl.featuretoggles
import com.tangem.core.featuretoggle.manager.FeatureTogglesManager
import com.tangem.features.staking.api.featuretoggles.StakingFeatureToggles
/**
* Default implementation of staking feature toggles
*
* @property featureTogglesManager manager for getting information about the availability of feature toggles
*/
internal class DefaultStakingFeatureToggles(
private val featureTogglesManager: FeatureTogglesManager,
) : StakingFeatureToggles {
override val isStakingEnabled: Boolean
get() = featureTogglesManager.isFeatureEnabled(name = "STAKING_ENABLED")
}

View file

@ -0,0 +1,8 @@
package com.tangem.features.staking.impl.navigation
import androidx.fragment.app.Fragment
internal class DefaultStakingRouter : InnerStakingRouter {
override fun getEntryFragment(): Fragment = TODO()
}

View file

@ -0,0 +1,5 @@
package com.tangem.features.staking.impl.navigation
import com.tangem.features.staking.api.navigation.StakingRouter
interface InnerStakingRouter : StakingRouter

View file

@ -153,6 +153,9 @@ include(":features:manage-tokens:impl")
include(":features:qr-scanning:api")
include(":features:qr-scanning:impl")
include(":features:staking:api")
include(":features:staking:impl")
// endregion Feature modules
// region Domain modules