Updated on 2026-08-14

This commit is contained in:
Tangem 2025-05-23 11:16:28 +03:00
commit ca49abf2b1
892 changed files with 17979 additions and 6555 deletions

View file

@ -17,4 +17,7 @@ dependencies {
/* Project - Domain */
implementation(projects.domain.wallets.models)
/* Compose */
implementation(deps.compose.runtime)
}

View file

@ -0,0 +1,8 @@
package com.tangem.feature.referral.api.deeplink
interface ReferralDeepLinkHandler {
interface Factory {
fun create(): ReferralDeepLinkHandler
}
}

View file

@ -9,7 +9,7 @@ import com.tangem.datasource.api.common.response.getOrThrow
import com.tangem.datasource.api.tangemTech.TangemTechApi
import com.tangem.datasource.api.tangemTech.models.StartReferralBody
import com.tangem.datasource.local.userwallet.UserWalletsStore
import com.tangem.domain.tokens.model.CryptoCurrency
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.feature.referral.converters.ReferralConverter
import com.tangem.feature.referral.domain.ReferralRepository

View file

@ -20,6 +20,7 @@ dependencies {
/** Domain modules */
implementation(projects.domain.card)
implementation(projects.domain.models)
implementation(projects.domain.tokens)
implementation(projects.domain.tokens.models)
implementation(projects.domain.wallets)

View file

@ -1,6 +1,6 @@
package com.tangem.feature.referral.domain
import com.tangem.domain.tokens.model.CryptoCurrency
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.feature.referral.domain.models.ReferralData
import com.tangem.feature.referral.domain.models.TokenData

View file

@ -39,12 +39,14 @@ dependencies {
/** Domain */
implementation(projects.domain.demo)
implementation(projects.domain.wallets)
implementation(projects.domain.legacy)
implementation(projects.domain.wallets.models)
implementation(projects.features.referral.domain)
/** Other libraries */
implementation(deps.compose.shimmer)
implementation(deps.compose.accompanist.systemUiController)
implementation(deps.timber)
/** DI */
implementation(deps.hilt.android)

View file

@ -0,0 +1,37 @@
package com.tangem.feature.referral.deeplink
import com.tangem.common.routing.AppRoute
import com.tangem.common.routing.AppRouter
import com.tangem.domain.common.util.cardTypesResolver
import com.tangem.domain.wallets.usecase.GetSelectedWalletSyncUseCase
import com.tangem.feature.referral.api.deeplink.ReferralDeepLinkHandler
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import timber.log.Timber
internal class DefaultReferralDeepLinkHandler @AssistedInject constructor(
appRouter: AppRouter,
getSelectedWalletSyncUseCase: GetSelectedWalletSyncUseCase,
) : ReferralDeepLinkHandler {
init {
// It is okay here, we are navigating from outside, and there is no other way to getting UserWallet
getSelectedWalletSyncUseCase().fold(
ifLeft = {
Timber.e("Error on getting user wallet: $it")
},
ifRight = { userWallet ->
if (userWallet.cardTypesResolver.isTangemWallet()) {
appRouter.push(
AppRoute.ReferralProgram(userWalletId = userWallet.walletId),
)
}
},
)
}
@AssistedFactory
interface Factory : ReferralDeepLinkHandler.Factory {
override fun create(): DefaultReferralDeepLinkHandler
}
}

View file

@ -0,0 +1,18 @@
package com.tangem.feature.referral.deeplink.di
import com.tangem.feature.referral.api.deeplink.ReferralDeepLinkHandler
import com.tangem.feature.referral.deeplink.DefaultReferralDeepLinkHandler
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
internal interface ReferralDeepLinkModule {
@Binds
@Singleton
fun bindFactory(impl: DefaultReferralDeepLinkHandler.Factory): ReferralDeepLinkHandler.Factory
}