Updated on 2026-08-14
This commit is contained in:
parent
6d37d90a86
commit
5cef4d684f
34 changed files with 2 additions and 775 deletions
|
|
@ -394,7 +394,6 @@ dependencies {
|
||||||
implementation(deps.viewBindingDelegate)
|
implementation(deps.viewBindingDelegate)
|
||||||
implementation(deps.armadillo)
|
implementation(deps.armadillo)
|
||||||
implementation(deps.kotlin.serialization)
|
implementation(deps.kotlin.serialization)
|
||||||
implementation(deps.reKotlin)
|
|
||||||
implementation(deps.reownCore)
|
implementation(deps.reownCore)
|
||||||
implementation(deps.reownWeb3)
|
implementation(deps.reownWeb3)
|
||||||
implementation(deps.prettyLogger)
|
implementation(deps.prettyLogger)
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -2,156 +2,57 @@ package com.tangem.tap
|
||||||
|
|
||||||
import androidx.hilt.work.HiltWorkerFactory
|
import androidx.hilt.work.HiltWorkerFactory
|
||||||
import com.tangem.TangemSdkLogger
|
import com.tangem.TangemSdkLogger
|
||||||
import com.tangem.blockchainsdk.BlockchainSDKFactory
|
|
||||||
import com.tangem.blockchainsdk.utils.ExcludedBlockchains
|
|
||||||
import com.tangem.common.routing.AppRouter
|
|
||||||
import com.tangem.core.abtests.manager.ABTestsManager
|
import com.tangem.core.abtests.manager.ABTestsManager
|
||||||
import com.tangem.core.analytics.filter.OneTimeEventFilter
|
import com.tangem.core.analytics.filter.OneTimeEventFilter
|
||||||
import com.tangem.core.analytics.paramsinterceptor.SendTransactionSignerInfoInterceptor
|
import com.tangem.core.analytics.paramsinterceptor.SendTransactionSignerInfoInterceptor
|
||||||
import com.tangem.core.analytics.utils.TrackingContextProxy
|
|
||||||
import com.tangem.core.configtoggle.blockchain.ExcludedBlockchainsManager
|
import com.tangem.core.configtoggle.blockchain.ExcludedBlockchainsManager
|
||||||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
||||||
import com.tangem.core.decompose.di.GlobalUiMessageSender
|
|
||||||
import com.tangem.core.decompose.ui.UiMessageSender
|
|
||||||
import com.tangem.core.navigation.settings.SettingsManager
|
|
||||||
import com.tangem.core.navigation.share.ShareManager
|
|
||||||
import com.tangem.core.navigation.url.UrlOpener
|
|
||||||
import com.tangem.core.ui.clipboard.ClipboardManager
|
|
||||||
import com.tangem.data.card.TransactionSignerFactory
|
|
||||||
import com.tangem.datasource.api.common.config.managers.ApiConfigsManager
|
import com.tangem.datasource.api.common.config.managers.ApiConfigsManager
|
||||||
import com.tangem.datasource.connection.NetworkConnectionManager
|
|
||||||
import com.tangem.datasource.local.config.environment.EnvironmentConfig
|
import com.tangem.datasource.local.config.environment.EnvironmentConfig
|
||||||
import com.tangem.datasource.local.config.issuers.IssuersConfigStorage
|
|
||||||
import com.tangem.datasource.local.logs.AppLogsStore
|
import com.tangem.datasource.local.logs.AppLogsStore
|
||||||
import com.tangem.datasource.local.preferences.AppPreferencesStore
|
|
||||||
import com.tangem.domain.appcurrency.repository.AppCurrencyRepository
|
|
||||||
import com.tangem.domain.apptheme.GetAppThemeModeUseCase
|
import com.tangem.domain.apptheme.GetAppThemeModeUseCase
|
||||||
import com.tangem.domain.apptheme.repository.AppThemeModeRepository
|
|
||||||
import com.tangem.domain.balancehiding.repositories.BalanceHidingRepository
|
|
||||||
import com.tangem.domain.card.ScanCardProcessor
|
|
||||||
import com.tangem.domain.card.ScanFailsRequester
|
|
||||||
import com.tangem.domain.card.repository.CardRepository
|
|
||||||
import com.tangem.domain.common.wallets.UserWalletsListRepository
|
|
||||||
import com.tangem.domain.feedback.GetWalletMetaInfoUseCase
|
|
||||||
import com.tangem.domain.feedback.SendFeedbackEmailUseCase
|
|
||||||
import com.tangem.domain.onboarding.SaveTwinsOnboardingShownUseCase
|
|
||||||
import com.tangem.domain.onboarding.WasTwinsOnboardingShownUseCase
|
|
||||||
import com.tangem.domain.onboarding.repository.OnboardingRepository
|
|
||||||
import com.tangem.domain.settings.repositories.SettingsRepository
|
|
||||||
import com.tangem.domain.walletconnect.usecase.initialize.WcInitializeUseCase
|
import com.tangem.domain.walletconnect.usecase.initialize.WcInitializeUseCase
|
||||||
import com.tangem.domain.walletmanager.WalletManagersFacade
|
|
||||||
import com.tangem.domain.wallets.builder.ColdUserWalletBuilder
|
|
||||||
import com.tangem.domain.wallets.repository.WalletsRepository
|
import com.tangem.domain.wallets.repository.WalletsRepository
|
||||||
import com.tangem.features.onboarding.v2.OnboardingV2FeatureToggles
|
|
||||||
import com.tangem.hot.sdk.TangemHotSdk
|
|
||||||
import com.tangem.tap.common.analytics.handlers.BlockchainExceptionHandler
|
import com.tangem.tap.common.analytics.handlers.BlockchainExceptionHandler
|
||||||
import com.tangem.tap.common.analytics.handlers.appsflyer.AppsFlyerClient
|
import com.tangem.tap.common.analytics.handlers.appsflyer.AppsFlyerClient
|
||||||
import com.tangem.tap.common.log.TangemAppLoggerInitializer
|
import com.tangem.tap.common.log.TangemAppLoggerInitializer
|
||||||
import com.tangem.tap.domain.scanCard.CardScanningFeatureToggles
|
|
||||||
import com.tangem.tap.proxy.AppStateHolder
|
|
||||||
import dagger.hilt.EntryPoint
|
import dagger.hilt.EntryPoint
|
||||||
import dagger.hilt.InstallIn
|
import dagger.hilt.InstallIn
|
||||||
import dagger.hilt.components.SingletonComponent
|
import dagger.hilt.components.SingletonComponent
|
||||||
|
|
||||||
@EntryPoint
|
@EntryPoint
|
||||||
@InstallIn(SingletonComponent::class)
|
@InstallIn(SingletonComponent::class)
|
||||||
@Suppress("TooManyFunctions")
|
|
||||||
interface ApplicationEntryPoint {
|
interface ApplicationEntryPoint {
|
||||||
|
|
||||||
fun getAppStateHolder(): AppStateHolder
|
|
||||||
|
|
||||||
fun getIssuersConfigStorage(): IssuersConfigStorage
|
|
||||||
|
|
||||||
fun getEnvironmentConfig(): EnvironmentConfig
|
fun getEnvironmentConfig(): EnvironmentConfig
|
||||||
|
|
||||||
fun getFeatureTogglesManager(): FeatureTogglesManager
|
fun getFeatureTogglesManager(): FeatureTogglesManager
|
||||||
|
|
||||||
fun getExcludedBlockchainsManager(): ExcludedBlockchainsManager
|
fun getExcludedBlockchainsManager(): ExcludedBlockchainsManager
|
||||||
|
|
||||||
fun getNetworkConnectionManager(): NetworkConnectionManager
|
|
||||||
|
|
||||||
fun getCardScanningFeatureToggles(): CardScanningFeatureToggles
|
|
||||||
|
|
||||||
fun getScanCardProcessor(): ScanCardProcessor
|
|
||||||
|
|
||||||
fun getAppCurrencyRepository(): AppCurrencyRepository
|
|
||||||
|
|
||||||
fun getWalletManagersFacade(): WalletManagersFacade
|
|
||||||
|
|
||||||
fun getAppThemeModeRepository(): AppThemeModeRepository
|
|
||||||
|
|
||||||
fun getBalanceHidingRepository(): BalanceHidingRepository
|
|
||||||
|
|
||||||
fun getAppPreferencesStore(): AppPreferencesStore
|
|
||||||
|
|
||||||
fun getGetAppThemeModeUseCase(): GetAppThemeModeUseCase
|
fun getGetAppThemeModeUseCase(): GetAppThemeModeUseCase
|
||||||
|
|
||||||
fun getWalletsRepository(): WalletsRepository
|
fun getWalletsRepository(): WalletsRepository
|
||||||
|
|
||||||
fun getOneTimeEventFilter(): OneTimeEventFilter
|
fun getOneTimeEventFilter(): OneTimeEventFilter
|
||||||
|
|
||||||
fun getWasTwinsOnboardingShownUseCase(): WasTwinsOnboardingShownUseCase
|
|
||||||
|
|
||||||
fun getSaveTwinsOnboardingShownUseCase(): SaveTwinsOnboardingShownUseCase
|
|
||||||
|
|
||||||
fun getCardRepository(): CardRepository
|
|
||||||
|
|
||||||
fun getTangemSdkLogger(): TangemSdkLogger
|
fun getTangemSdkLogger(): TangemSdkLogger
|
||||||
|
|
||||||
fun getSettingsRepository(): SettingsRepository
|
|
||||||
|
|
||||||
fun getBlockchainSDKFactory(): BlockchainSDKFactory
|
|
||||||
|
|
||||||
fun getSendFeedbackEmailUseCase(): SendFeedbackEmailUseCase
|
|
||||||
|
|
||||||
fun getWalletMetaInfoUseCase(): GetWalletMetaInfoUseCase
|
|
||||||
|
|
||||||
fun getUrlOpener(): UrlOpener
|
|
||||||
|
|
||||||
fun getShareManager(): ShareManager
|
|
||||||
|
|
||||||
fun getAppRouter(): AppRouter
|
|
||||||
|
|
||||||
fun getTangemAppLogger(): TangemAppLoggerInitializer
|
fun getTangemAppLogger(): TangemAppLoggerInitializer
|
||||||
|
|
||||||
fun getTransactionSignerFactory(): TransactionSignerFactory
|
|
||||||
|
|
||||||
fun getOnboardingV2FeatureToggles(): OnboardingV2FeatureToggles
|
|
||||||
|
|
||||||
fun getOnboardingRepository(): OnboardingRepository
|
|
||||||
|
|
||||||
fun getExcludedBlockchains(): ExcludedBlockchains
|
|
||||||
|
|
||||||
fun getAppLogsStore(): AppLogsStore
|
fun getAppLogsStore(): AppLogsStore
|
||||||
|
|
||||||
fun getClipboardManager(): ClipboardManager
|
|
||||||
|
|
||||||
fun getSettingsManager(): SettingsManager
|
|
||||||
|
|
||||||
fun getBlockchainExceptionHandler(): BlockchainExceptionHandler
|
fun getBlockchainExceptionHandler(): BlockchainExceptionHandler
|
||||||
|
|
||||||
@GlobalUiMessageSender
|
|
||||||
fun getUiMessageSender(): UiMessageSender
|
|
||||||
|
|
||||||
fun getWorkerFactory(): HiltWorkerFactory
|
fun getWorkerFactory(): HiltWorkerFactory
|
||||||
|
|
||||||
fun getColdUserWalletBuilderFactory(): ColdUserWalletBuilder.Factory
|
|
||||||
|
|
||||||
fun getApiConfigsManager(): ApiConfigsManager
|
fun getApiConfigsManager(): ApiConfigsManager
|
||||||
|
|
||||||
fun getUserWalletsListRepository(): UserWalletsListRepository
|
|
||||||
|
|
||||||
fun getTangemHotSdk(): TangemHotSdk
|
|
||||||
|
|
||||||
fun getWcInitializeUseCase(): WcInitializeUseCase
|
fun getWcInitializeUseCase(): WcInitializeUseCase
|
||||||
|
|
||||||
fun getTrackingContextProxy(): TrackingContextProxy
|
|
||||||
|
|
||||||
fun getABTestsManager(): ABTestsManager
|
fun getABTestsManager(): ABTestsManager
|
||||||
|
|
||||||
fun getAppsFlyerClientFactory(): AppsFlyerClient.Factory
|
fun getAppsFlyerClientFactory(): AppsFlyerClient.Factory
|
||||||
|
|
||||||
fun getScanFailsRequester(): ScanFailsRequester
|
|
||||||
|
|
||||||
fun getSendTransactionSignerInfoInterceptor(): SendTransactionSignerInfoInterceptor
|
fun getSendTransactionSignerInfoInterceptor(): SendTransactionSignerInfoInterceptor
|
||||||
}
|
}
|
||||||
|
|
@ -13,46 +13,22 @@ import com.tangem.Log
|
||||||
import com.tangem.TangemSdkLogger
|
import com.tangem.TangemSdkLogger
|
||||||
import com.tangem.blockchain.common.ExceptionHandler
|
import com.tangem.blockchain.common.ExceptionHandler
|
||||||
import com.tangem.blockchain.network.BlockchainSdkRetrofitBuilder
|
import com.tangem.blockchain.network.BlockchainSdkRetrofitBuilder
|
||||||
import com.tangem.blockchainsdk.BlockchainSDKFactory
|
|
||||||
import com.tangem.blockchainsdk.utils.ExcludedBlockchains
|
|
||||||
import com.tangem.common.routing.AppRouter
|
|
||||||
import com.tangem.core.abtests.manager.ABTestsManager
|
import com.tangem.core.abtests.manager.ABTestsManager
|
||||||
import com.tangem.core.analytics.Analytics
|
import com.tangem.core.analytics.Analytics
|
||||||
import com.tangem.core.analytics.filter.AppsFlyerEventFilter
|
import com.tangem.core.analytics.filter.AppsFlyerEventFilter
|
||||||
import com.tangem.core.analytics.filter.OneTimeEventFilter
|
import com.tangem.core.analytics.filter.OneTimeEventFilter
|
||||||
import com.tangem.core.configtoggle.blockchain.ExcludedBlockchainsManager
|
import com.tangem.core.configtoggle.blockchain.ExcludedBlockchainsManager
|
||||||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
||||||
import com.tangem.core.decompose.ui.UiMessageSender
|
|
||||||
import com.tangem.core.navigation.settings.SettingsManager
|
|
||||||
import com.tangem.core.ui.clipboard.ClipboardManager
|
|
||||||
import com.tangem.data.card.TransactionSignerFactory
|
|
||||||
import com.tangem.datasource.api.common.MoshiConverter
|
import com.tangem.datasource.api.common.MoshiConverter
|
||||||
import com.tangem.datasource.api.common.config.managers.ApiConfigsManager
|
import com.tangem.datasource.api.common.config.managers.ApiConfigsManager
|
||||||
import com.tangem.datasource.api.common.createNetworkLoggingInterceptor
|
import com.tangem.datasource.api.common.createNetworkLoggingInterceptor
|
||||||
import com.tangem.datasource.connection.NetworkConnectionManager
|
|
||||||
import com.tangem.datasource.local.config.environment.EnvironmentConfig
|
import com.tangem.datasource.local.config.environment.EnvironmentConfig
|
||||||
import com.tangem.datasource.local.config.issuers.IssuersConfigStorage
|
|
||||||
import com.tangem.datasource.local.logs.AppLogsStore
|
import com.tangem.datasource.local.logs.AppLogsStore
|
||||||
import com.tangem.datasource.local.preferences.AppPreferencesStore
|
|
||||||
import com.tangem.datasource.utils.NetworkLogsSaveInterceptor
|
import com.tangem.datasource.utils.NetworkLogsSaveInterceptor
|
||||||
import com.tangem.datasource.utils.WireMockRedirectInterceptor
|
import com.tangem.datasource.utils.WireMockRedirectInterceptor
|
||||||
import com.tangem.domain.appcurrency.repository.AppCurrencyRepository
|
|
||||||
import com.tangem.domain.apptheme.GetAppThemeModeUseCase
|
import com.tangem.domain.apptheme.GetAppThemeModeUseCase
|
||||||
import com.tangem.domain.apptheme.repository.AppThemeModeRepository
|
|
||||||
import com.tangem.domain.balancehiding.repositories.BalanceHidingRepository
|
|
||||||
import com.tangem.domain.card.ScanCardProcessor
|
|
||||||
import com.tangem.domain.card.repository.CardRepository
|
|
||||||
import com.tangem.domain.common.LogConfig
|
import com.tangem.domain.common.LogConfig
|
||||||
import com.tangem.domain.feedback.GetWalletMetaInfoUseCase
|
|
||||||
import com.tangem.domain.feedback.SendFeedbackEmailUseCase
|
|
||||||
import com.tangem.domain.onboarding.SaveTwinsOnboardingShownUseCase
|
|
||||||
import com.tangem.domain.onboarding.WasTwinsOnboardingShownUseCase
|
|
||||||
import com.tangem.domain.onboarding.repository.OnboardingRepository
|
|
||||||
import com.tangem.domain.settings.repositories.SettingsRepository
|
|
||||||
import com.tangem.domain.walletmanager.WalletManagersFacade
|
|
||||||
import com.tangem.domain.wallets.builder.ColdUserWalletBuilder
|
|
||||||
import com.tangem.domain.wallets.repository.WalletsRepository
|
import com.tangem.domain.wallets.repository.WalletsRepository
|
||||||
import com.tangem.features.onboarding.v2.OnboardingV2FeatureToggles
|
|
||||||
import com.tangem.operations.attestation.api.TangemApiServiceSettings
|
import com.tangem.operations.attestation.api.TangemApiServiceSettings
|
||||||
import com.tangem.tap.common.analytics.AnalyticsFactory
|
import com.tangem.tap.common.analytics.AnalyticsFactory
|
||||||
import com.tangem.tap.common.analytics.api.AnalyticsHandlerBuilder
|
import com.tangem.tap.common.analytics.api.AnalyticsHandlerBuilder
|
||||||
|
|
@ -64,20 +40,12 @@ import com.tangem.tap.common.analytics.handlers.customerio.CustomerIoAnalyticsHa
|
||||||
import com.tangem.tap.common.analytics.handlers.firebase.FirebaseAnalyticsHandler
|
import com.tangem.tap.common.analytics.handlers.firebase.FirebaseAnalyticsHandler
|
||||||
import com.tangem.tap.common.images.createCoilImageLoader
|
import com.tangem.tap.common.images.createCoilImageLoader
|
||||||
import com.tangem.tap.common.log.TangemAppLoggerInitializer
|
import com.tangem.tap.common.log.TangemAppLoggerInitializer
|
||||||
import com.tangem.tap.common.redux.AppState
|
|
||||||
import com.tangem.tap.common.redux.appReducer
|
|
||||||
import com.tangem.tap.domain.scanCard.CardScanningFeatureToggles
|
|
||||||
import com.tangem.tap.proxy.AppStateHolder
|
|
||||||
import com.tangem.tap.proxy.redux.DaggerGraphState
|
|
||||||
import com.tangem.utils.logging.TangemLogger
|
import com.tangem.utils.logging.TangemLogger
|
||||||
import com.tangem.wallet.BuildConfig
|
import com.tangem.wallet.BuildConfig
|
||||||
import dagger.hilt.EntryPoints
|
import dagger.hilt.EntryPoints
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.MainScope
|
import kotlinx.coroutines.MainScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import org.rekotlin.Store
|
|
||||||
|
|
||||||
lateinit var store: Store<AppState>
|
|
||||||
|
|
||||||
lateinit var walletsRepository: WalletsRepository
|
lateinit var walletsRepository: WalletsRepository
|
||||||
|
|
||||||
|
|
@ -89,12 +57,6 @@ open class TangemApplication : Application(), ImageLoaderFactory, Configuration.
|
||||||
private val entryPoint: ApplicationEntryPoint
|
private val entryPoint: ApplicationEntryPoint
|
||||||
get() = EntryPoints.get(this, ApplicationEntryPoint::class.java)
|
get() = EntryPoints.get(this, ApplicationEntryPoint::class.java)
|
||||||
|
|
||||||
private val appStateHolder: AppStateHolder
|
|
||||||
get() = entryPoint.getAppStateHolder()
|
|
||||||
|
|
||||||
private val issuersConfigStorage: IssuersConfigStorage
|
|
||||||
get() = entryPoint.getIssuersConfigStorage()
|
|
||||||
|
|
||||||
private val environmentConfig: EnvironmentConfig
|
private val environmentConfig: EnvironmentConfig
|
||||||
get() = entryPoint.getEnvironmentConfig()
|
get() = entryPoint.getEnvironmentConfig()
|
||||||
|
|
||||||
|
|
@ -104,96 +66,21 @@ open class TangemApplication : Application(), ImageLoaderFactory, Configuration.
|
||||||
private val excludedBlockchainsManager: ExcludedBlockchainsManager
|
private val excludedBlockchainsManager: ExcludedBlockchainsManager
|
||||||
get() = entryPoint.getExcludedBlockchainsManager()
|
get() = entryPoint.getExcludedBlockchainsManager()
|
||||||
|
|
||||||
private val networkConnectionManager: NetworkConnectionManager
|
|
||||||
get() = entryPoint.getNetworkConnectionManager()
|
|
||||||
|
|
||||||
private val cardScanningFeatureToggles: CardScanningFeatureToggles
|
|
||||||
get() = entryPoint.getCardScanningFeatureToggles()
|
|
||||||
|
|
||||||
private val scanCardProcessor: ScanCardProcessor
|
|
||||||
get() = entryPoint.getScanCardProcessor()
|
|
||||||
|
|
||||||
private val appCurrencyRepository: AppCurrencyRepository
|
|
||||||
get() = entryPoint.getAppCurrencyRepository()
|
|
||||||
|
|
||||||
private val walletManagersFacade: WalletManagersFacade
|
|
||||||
get() = entryPoint.getWalletManagersFacade()
|
|
||||||
|
|
||||||
private val appThemeModeRepository: AppThemeModeRepository
|
|
||||||
get() = entryPoint.getAppThemeModeRepository()
|
|
||||||
|
|
||||||
private val balanceHidingRepository: BalanceHidingRepository
|
|
||||||
get() = entryPoint.getBalanceHidingRepository()
|
|
||||||
|
|
||||||
private val appPreferencesStore: AppPreferencesStore
|
|
||||||
get() = entryPoint.getAppPreferencesStore()
|
|
||||||
|
|
||||||
val getAppThemeModeUseCase: GetAppThemeModeUseCase
|
val getAppThemeModeUseCase: GetAppThemeModeUseCase
|
||||||
get() = entryPoint.getGetAppThemeModeUseCase()
|
get() = entryPoint.getGetAppThemeModeUseCase()
|
||||||
|
|
||||||
private val oneTimeEventFilter: OneTimeEventFilter
|
private val oneTimeEventFilter: OneTimeEventFilter
|
||||||
get() = entryPoint.getOneTimeEventFilter()
|
get() = entryPoint.getOneTimeEventFilter()
|
||||||
|
|
||||||
private val wasTwinsOnboardingShownUseCase: WasTwinsOnboardingShownUseCase
|
|
||||||
get() = entryPoint.getWasTwinsOnboardingShownUseCase()
|
|
||||||
|
|
||||||
private val saveTwinsOnboardingShownUseCase: SaveTwinsOnboardingShownUseCase
|
|
||||||
get() = entryPoint.getSaveTwinsOnboardingShownUseCase()
|
|
||||||
|
|
||||||
private val cardRepository: CardRepository
|
|
||||||
get() = entryPoint.getCardRepository()
|
|
||||||
|
|
||||||
private val tangemSdkLogger: TangemSdkLogger
|
private val tangemSdkLogger: TangemSdkLogger
|
||||||
get() = entryPoint.getTangemSdkLogger()
|
get() = entryPoint.getTangemSdkLogger()
|
||||||
|
|
||||||
private val settingsRepository: SettingsRepository
|
|
||||||
get() = entryPoint.getSettingsRepository()
|
|
||||||
|
|
||||||
private val blockchainSDKFactory: BlockchainSDKFactory
|
|
||||||
get() = entryPoint.getBlockchainSDKFactory()
|
|
||||||
|
|
||||||
private val sendFeedbackEmailUseCase: SendFeedbackEmailUseCase
|
|
||||||
get() = entryPoint.getSendFeedbackEmailUseCase()
|
|
||||||
|
|
||||||
private val getWalletMetaInfoUseCase: GetWalletMetaInfoUseCase
|
|
||||||
get() = entryPoint.getWalletMetaInfoUseCase()
|
|
||||||
|
|
||||||
private val urlOpener
|
|
||||||
get() = entryPoint.getUrlOpener()
|
|
||||||
|
|
||||||
private val shareManager
|
|
||||||
get() = entryPoint.getShareManager()
|
|
||||||
|
|
||||||
private val appRouter: AppRouter
|
|
||||||
get() = entryPoint.getAppRouter()
|
|
||||||
|
|
||||||
private val tangemAppLoggerInitializer: TangemAppLoggerInitializer
|
private val tangemAppLoggerInitializer: TangemAppLoggerInitializer
|
||||||
get() = entryPoint.getTangemAppLogger()
|
get() = entryPoint.getTangemAppLogger()
|
||||||
|
|
||||||
private val transactionSignerFactory: TransactionSignerFactory
|
|
||||||
get() = entryPoint.getTransactionSignerFactory()
|
|
||||||
|
|
||||||
private val onboardingV2FeatureToggles: OnboardingV2FeatureToggles
|
|
||||||
get() = entryPoint.getOnboardingV2FeatureToggles()
|
|
||||||
|
|
||||||
private val onboardingRepository: OnboardingRepository
|
|
||||||
get() = entryPoint.getOnboardingRepository()
|
|
||||||
|
|
||||||
private val excludedBlockchains: ExcludedBlockchains
|
|
||||||
get() = entryPoint.getExcludedBlockchains()
|
|
||||||
|
|
||||||
private val appLogsStore: AppLogsStore
|
private val appLogsStore: AppLogsStore
|
||||||
get() = entryPoint.getAppLogsStore()
|
get() = entryPoint.getAppLogsStore()
|
||||||
|
|
||||||
private val clipboardManager: ClipboardManager
|
|
||||||
get() = entryPoint.getClipboardManager()
|
|
||||||
|
|
||||||
private val settingsManager: SettingsManager
|
|
||||||
get() = entryPoint.getSettingsManager()
|
|
||||||
|
|
||||||
private val uiMessageSender: UiMessageSender
|
|
||||||
get() = entryPoint.getUiMessageSender()
|
|
||||||
|
|
||||||
private val blockchainExceptionHandler: BlockchainExceptionHandler
|
private val blockchainExceptionHandler: BlockchainExceptionHandler
|
||||||
get() = entryPoint.getBlockchainExceptionHandler()
|
get() = entryPoint.getBlockchainExceptionHandler()
|
||||||
|
|
||||||
|
|
@ -205,33 +92,18 @@ open class TangemApplication : Application(), ImageLoaderFactory, Configuration.
|
||||||
.setWorkerFactory(workerFactory)
|
.setWorkerFactory(workerFactory)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
private val coldUserWalletBuilderFactory: ColdUserWalletBuilder.Factory
|
|
||||||
get() = entryPoint.getColdUserWalletBuilderFactory()
|
|
||||||
|
|
||||||
private val apiConfigsManager: ApiConfigsManager
|
private val apiConfigsManager: ApiConfigsManager
|
||||||
get() = entryPoint.getApiConfigsManager()
|
get() = entryPoint.getApiConfigsManager()
|
||||||
|
|
||||||
private val userWalletsListRepository
|
|
||||||
get() = entryPoint.getUserWalletsListRepository()
|
|
||||||
|
|
||||||
private val tangemHotSdk
|
|
||||||
get() = entryPoint.getTangemHotSdk()
|
|
||||||
|
|
||||||
private val wcInitializeUseCase
|
private val wcInitializeUseCase
|
||||||
get() = entryPoint.getWcInitializeUseCase()
|
get() = entryPoint.getWcInitializeUseCase()
|
||||||
|
|
||||||
private val trackingContextProxy
|
|
||||||
get() = entryPoint.getTrackingContextProxy()
|
|
||||||
|
|
||||||
private val abTestsManager: ABTestsManager
|
private val abTestsManager: ABTestsManager
|
||||||
get() = entryPoint.getABTestsManager()
|
get() = entryPoint.getABTestsManager()
|
||||||
|
|
||||||
private val appsFlyerClientFactory: AppsFlyerClient.Factory
|
private val appsFlyerClientFactory: AppsFlyerClient.Factory
|
||||||
get() = entryPoint.getAppsFlyerClientFactory()
|
get() = entryPoint.getAppsFlyerClientFactory()
|
||||||
|
|
||||||
private val scanFailsRequester
|
|
||||||
get() = entryPoint.getScanFailsRequester()
|
|
||||||
|
|
||||||
private val sendTransactionSignerInfoInterceptor
|
private val sendTransactionSignerInfoInterceptor
|
||||||
get() = entryPoint.getSendTransactionSignerInfoInterceptor()
|
get() = entryPoint.getSendTransactionSignerInfoInterceptor()
|
||||||
|
|
||||||
|
|
@ -279,8 +151,6 @@ open class TangemApplication : Application(), ImageLoaderFactory, Configuration.
|
||||||
|
|
||||||
apiConfigsManager.initialize()
|
apiConfigsManager.initialize()
|
||||||
|
|
||||||
store = createReduxStore()
|
|
||||||
|
|
||||||
TangemLogger.i("APP STARTED")
|
TangemLogger.i("APP STARTED")
|
||||||
if (BuildConfig.TESTER_MENU_ENABLED) {
|
if (BuildConfig.TESTER_MENU_ENABLED) {
|
||||||
TangemLogger.i(featureTogglesManager.toString())
|
TangemLogger.i(featureTogglesManager.toString())
|
||||||
|
|
@ -321,57 +191,11 @@ open class TangemApplication : Application(), ImageLoaderFactory, Configuration.
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
appStateHolder.mainStore = store
|
|
||||||
|
|
||||||
wcInitializeUseCase.init(
|
wcInitializeUseCase.init(
|
||||||
projectId = environmentConfig.walletConnectProjectId,
|
projectId = environmentConfig.walletConnectProjectId,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createReduxStore(): Store<AppState> {
|
|
||||||
return Store(
|
|
||||||
reducer = { action, state -> appReducer(action, requireNotNull(state)) },
|
|
||||||
middleware = AppState.getMiddleware(),
|
|
||||||
state = AppState(
|
|
||||||
daggerGraphState = DaggerGraphState(
|
|
||||||
networkConnectionManager = networkConnectionManager,
|
|
||||||
cardScanningFeatureToggles = cardScanningFeatureToggles,
|
|
||||||
scanCardProcessor = scanCardProcessor,
|
|
||||||
appCurrencyRepository = appCurrencyRepository,
|
|
||||||
walletManagersFacade = walletManagersFacade,
|
|
||||||
appStateHolder = appStateHolder,
|
|
||||||
appThemeModeRepository = appThemeModeRepository,
|
|
||||||
balanceHidingRepository = balanceHidingRepository,
|
|
||||||
walletsRepository = walletsRepository,
|
|
||||||
wasTwinsOnboardingShownUseCase = wasTwinsOnboardingShownUseCase,
|
|
||||||
saveTwinsOnboardingShownUseCase = saveTwinsOnboardingShownUseCase,
|
|
||||||
cardRepository = cardRepository,
|
|
||||||
settingsRepository = settingsRepository,
|
|
||||||
blockchainSDKFactory = blockchainSDKFactory,
|
|
||||||
sendFeedbackEmailUseCase = sendFeedbackEmailUseCase,
|
|
||||||
getWalletMetaInfoUseCase = getWalletMetaInfoUseCase,
|
|
||||||
issuersConfigStorage = issuersConfigStorage,
|
|
||||||
urlOpener = urlOpener,
|
|
||||||
shareManager = shareManager,
|
|
||||||
appRouter = appRouter,
|
|
||||||
transactionSignerFactory = transactionSignerFactory,
|
|
||||||
onboardingV2FeatureToggles = onboardingV2FeatureToggles,
|
|
||||||
onboardingRepository = onboardingRepository,
|
|
||||||
excludedBlockchains = excludedBlockchains,
|
|
||||||
appPreferencesStore = appPreferencesStore,
|
|
||||||
clipboardManager = clipboardManager,
|
|
||||||
settingsManager = settingsManager,
|
|
||||||
uiMessageSender = uiMessageSender,
|
|
||||||
coldUserWalletBuilderFactory = coldUserWalletBuilderFactory,
|
|
||||||
userWalletsListRepository = userWalletsListRepository,
|
|
||||||
tangemHotSdk = tangemHotSdk,
|
|
||||||
trackingContextProxy = trackingContextProxy,
|
|
||||||
scanFailsRequester = scanFailsRequester,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun updateLogFiles() {
|
private fun updateLogFiles() {
|
||||||
appLogsStore.deleteOldLogsFile()
|
appLogsStore.deleteOldLogsFile()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
package com.tangem.tap.common.extensions
|
|
||||||
|
|
||||||
import com.tangem.common.routing.AppRouter
|
|
||||||
import com.tangem.domain.common.extensions.withMainContext
|
|
||||||
import com.tangem.domain.models.wallet.UserWallet
|
|
||||||
import com.tangem.tap.common.redux.AppState
|
|
||||||
import com.tangem.tap.proxy.redux.DaggerGraphState
|
|
||||||
import com.tangem.tap.scope
|
|
||||||
import com.tangem.tap.store
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import org.rekotlin.Action
|
|
||||||
import org.rekotlin.Store
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Dispatch action with creating the new coroutine with the Main dispatcher
|
|
||||||
*
|
|
||||||
* @see dispatchWithMain
|
|
||||||
*/
|
|
||||||
fun Store<*>.dispatchOnMain(action: Action) {
|
|
||||||
scope.launch(Dispatchers.Main) {
|
|
||||||
dispatch(action)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Dispatch action on the Main coroutine context
|
|
||||||
*
|
|
||||||
* @param action [Action] to be dispatched
|
|
||||||
*
|
|
||||||
* @see dispatchOnMain
|
|
||||||
* */
|
|
||||||
suspend fun Store<*>.dispatchWithMain(action: Action) {
|
|
||||||
withMainContext {
|
|
||||||
dispatch(action)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun Store<AppState>.onUserWalletSelected(userWallet: UserWallet) {
|
|
||||||
state.globalState.tapWalletManager.onWalletSelected(userWallet)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Dispatch action inside a coroutine with the Main dispatcher
|
|
||||||
*/
|
|
||||||
@Deprecated(
|
|
||||||
message = "Use dispatchWithMain instead",
|
|
||||||
replaceWith = ReplaceWith(expression = "dispatchWithMain"),
|
|
||||||
)
|
|
||||||
suspend fun dispatchOnMain(vararg actions: Action) {
|
|
||||||
withMainContext { actions.forEach { store.dispatch(it) } }
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Store<AppState>.dispatchNavigationAction(action: AppRouter.() -> Unit) {
|
|
||||||
inject(DaggerGraphState::appRouter).action()
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fun <reified T> Store<AppState>.inject(getDependency: DaggerGraphState.() -> T?): T {
|
|
||||||
return requireNotNull(state.daggerGraphState.getDependency()) {
|
|
||||||
"${T::class.simpleName.orEmpty()} isn't initialized "
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
package com.tangem.tap.common.redux
|
|
||||||
|
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
|
||||||
import com.tangem.tap.common.extensions.inject
|
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
|
||||||
import com.tangem.tap.mainScope
|
|
||||||
import com.tangem.tap.proxy.redux.DaggerGraphState
|
|
||||||
import com.tangem.tap.store
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import org.rekotlin.Middleware
|
|
||||||
|
|
||||||
class AccessCodeRequestPolicyMiddleware {
|
|
||||||
val middleware: Middleware<AppState> = { _, _ ->
|
|
||||||
{ next ->
|
|
||||||
{ action ->
|
|
||||||
if (action is GlobalAction.SaveScanResponse) {
|
|
||||||
updateAccessCodeRequestPolicy(action.scanResponse)
|
|
||||||
}
|
|
||||||
next(action)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun updateAccessCodeRequestPolicy(scanResponse: ScanResponse) {
|
|
||||||
mainScope.launch {
|
|
||||||
val shouldSaveAccessCodes = store.inject(DaggerGraphState::settingsRepository).shouldSaveAccessCodes()
|
|
||||||
|
|
||||||
store.inject(DaggerGraphState::cardSdkConfigRepository).setAccessCodeRequestPolicy(
|
|
||||||
isBiometricsRequestPolicy = shouldSaveAccessCodes && scanResponse.card.isAccessCodeSet,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
package com.tangem.tap.common.redux
|
|
||||||
|
|
||||||
import com.tangem.tap.common.redux.global.globalReducer
|
|
||||||
import com.tangem.tap.proxy.redux.DaggerGraphReducer
|
|
||||||
import org.rekotlin.Action
|
|
||||||
|
|
||||||
fun appReducer(action: Action, state: AppState): AppState {
|
|
||||||
if (action is AppAction.RestoreState) return action.state
|
|
||||||
|
|
||||||
return AppState(
|
|
||||||
globalState = globalReducer(action, state),
|
|
||||||
daggerGraphState = DaggerGraphReducer.reduce(action, state),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
sealed class AppAction : Action {
|
|
||||||
data class RestoreState(val state: AppState) : AppAction()
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
package com.tangem.tap.common.redux
|
|
||||||
|
|
||||||
import com.tangem.tap.common.redux.global.GlobalState
|
|
||||||
import com.tangem.tap.proxy.redux.DaggerGraphMiddleware
|
|
||||||
import com.tangem.tap.proxy.redux.DaggerGraphState
|
|
||||||
import org.rekotlin.Middleware
|
|
||||||
import org.rekotlin.StateType
|
|
||||||
|
|
||||||
data class AppState(
|
|
||||||
val globalState: GlobalState = GlobalState(),
|
|
||||||
val daggerGraphState: DaggerGraphState = DaggerGraphState(),
|
|
||||||
) : StateType {
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
fun getMiddleware(): List<Middleware<AppState>> {
|
|
||||||
return listOf(
|
|
||||||
logMiddleware,
|
|
||||||
LockUserWalletsTimerMiddleware().middleware,
|
|
||||||
AccessCodeRequestPolicyMiddleware().middleware,
|
|
||||||
DaggerGraphMiddleware.daggerGraphMiddleware,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
package com.tangem.tap.common.redux
|
|
||||||
|
|
||||||
import com.tangem.tap.lockUserWalletsTimer
|
|
||||||
import org.rekotlin.Middleware
|
|
||||||
|
|
||||||
class LockUserWalletsTimerMiddleware {
|
|
||||||
val middleware: Middleware<AppState> = { _, _ ->
|
|
||||||
{ nextDispatch ->
|
|
||||||
{ action ->
|
|
||||||
lockUserWalletsTimer?.restart()
|
|
||||||
nextDispatch(action)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
package com.tangem.tap.common.redux
|
|
||||||
|
|
||||||
import com.tangem.utils.logging.TangemLogger
|
|
||||||
import org.rekotlin.Middleware
|
|
||||||
|
|
||||||
/**
|
|
||||||
[REDACTED_AUTHOR]
|
|
||||||
*/
|
|
||||||
val logMiddleware: Middleware<AppState> = { _, _ ->
|
|
||||||
{ nextDispatch ->
|
|
||||||
{ action ->
|
|
||||||
TangemLogger.i("Dispatch action: ${action::class.java.simpleName}")
|
|
||||||
nextDispatch(action)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
package com.tangem.tap.common.redux.global
|
|
||||||
|
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
|
||||||
import org.rekotlin.Action
|
|
||||||
|
|
||||||
sealed class GlobalAction : Action {
|
|
||||||
|
|
||||||
data class SaveScanResponse(val scanResponse: ScanResponse) : GlobalAction()
|
|
||||||
|
|
||||||
data class IsSignWithRing(val isSignWithRing: Boolean) : GlobalAction()
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
package com.tangem.tap.common.redux.global
|
|
||||||
|
|
||||||
import com.tangem.tap.common.redux.AppState
|
|
||||||
import org.rekotlin.Action
|
|
||||||
|
|
||||||
@Suppress("LongMethod", "ComplexMethod")
|
|
||||||
fun globalReducer(action: Action, state: AppState): GlobalState {
|
|
||||||
if (action !is GlobalAction) return state.globalState
|
|
||||||
|
|
||||||
val globalState = state.globalState
|
|
||||||
|
|
||||||
return when (action) {
|
|
||||||
is GlobalAction.SaveScanResponse -> {
|
|
||||||
globalState.copy(scanResponse = action.scanResponse)
|
|
||||||
}
|
|
||||||
is GlobalAction.IsSignWithRing -> globalState.copy(isLastSignWithRing = action.isSignWithRing)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
package com.tangem.tap.common.redux.global
|
|
||||||
|
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
|
||||||
import com.tangem.tap.domain.TapWalletManager
|
|
||||||
import org.rekotlin.StateType
|
|
||||||
|
|
||||||
data class GlobalState(
|
|
||||||
@Deprecated("Use scan response from selected user wallet")
|
|
||||||
val scanResponse: ScanResponse? = null,
|
|
||||||
val tapWalletManager: TapWalletManager = TapWalletManager(),
|
|
||||||
val isLastSignWithRing: Boolean = false,
|
|
||||||
) : StateType
|
|
||||||
|
|
||||||
typealias CryptoCurrencyName = String
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
package com.tangem.tap.di
|
|
||||||
|
|
||||||
import com.tangem.domain.redux.ReduxStateHolder
|
|
||||||
import com.tangem.tap.proxy.AppStateHolder
|
|
||||||
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 AppStateHolderModule {
|
|
||||||
|
|
||||||
@Binds
|
|
||||||
@Singleton
|
|
||||||
fun bindsReduxStateHolder(appStateHolder: AppStateHolder): ReduxStateHolder
|
|
||||||
}
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
package com.tangem.tap.domain
|
|
||||||
|
|
||||||
import com.tangem.blockchain.common.Token
|
|
||||||
import com.tangem.blockchain.common.Wallet
|
|
||||||
import com.tangem.domain.common.extensions.withMainContext
|
|
||||||
import com.tangem.domain.models.wallet.UserWallet
|
|
||||||
import com.tangem.tap.common.extensions.inject
|
|
||||||
import com.tangem.tap.common.redux.global.GlobalAction
|
|
||||||
import com.tangem.tap.proxy.redux.DaggerGraphState
|
|
||||||
import com.tangem.tap.store
|
|
||||||
import com.tangem.tap.tangemSdkManager
|
|
||||||
import com.tangem.utils.coroutines.AppCoroutineDispatcherProvider
|
|
||||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.Job
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
|
|
||||||
class TapWalletManager(
|
|
||||||
private val dispatchers: CoroutineDispatcherProvider = AppCoroutineDispatcherProvider(),
|
|
||||||
) {
|
|
||||||
|
|
||||||
private var loadUserWalletDataJob: Job? = null
|
|
||||||
set(value) {
|
|
||||||
field?.cancel()
|
|
||||||
field = value
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun onWalletSelected(userWallet: UserWallet) {
|
|
||||||
// If a previous job was running, it gets cancelled before the new one starts,
|
|
||||||
// ensuring that only one job is active at any given time.
|
|
||||||
loadUserWalletDataJob = CoroutineScope(dispatchers.io)
|
|
||||||
.launch { loadUserWalletData(userWallet) }
|
|
||||||
.apply { join() }
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [REDACTED_TODO_COMMENT]
|
|
||||||
*/
|
|
||||||
private suspend fun loadUserWalletData(userWallet: UserWallet) {
|
|
||||||
val trackingContextProxy = store.inject(DaggerGraphState::trackingContextProxy)
|
|
||||||
trackingContextProxy.setContext(userWallet)
|
|
||||||
|
|
||||||
if (userWallet is UserWallet.Cold) {
|
|
||||||
val scanResponse = userWallet.scanResponse
|
|
||||||
tangemSdkManager.changeDisplayedCardIdNumbersCount(scanResponse)
|
|
||||||
withMainContext {
|
|
||||||
// Order is important
|
|
||||||
store.dispatch(GlobalAction.SaveScanResponse(scanResponse))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Wallet.getFirstToken(): Token? = getTokens().toList().getOrNull(index = 0)
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
package com.tangem.tap.domain.model
|
package com.tangem.tap.domain.model
|
||||||
|
|
||||||
import com.tangem.tap.common.redux.global.CryptoCurrencyName
|
|
||||||
import com.tangem.blockchain.common.Blockchain as SdkBlockchain
|
import com.tangem.blockchain.common.Blockchain as SdkBlockchain
|
||||||
import com.tangem.blockchain.common.Token as SdkToken
|
import com.tangem.blockchain.common.Token as SdkToken
|
||||||
|
|
||||||
sealed interface Currency {
|
sealed interface Currency {
|
||||||
val blockchain: SdkBlockchain
|
val blockchain: SdkBlockchain
|
||||||
val currencySymbol: CryptoCurrencyName
|
val currencySymbol: String
|
||||||
val derivationPath: String?
|
val derivationPath: String?
|
||||||
val decimals
|
val decimals
|
||||||
get() = when (this) {
|
get() = when (this) {
|
||||||
|
|
@ -26,6 +25,6 @@ sealed interface Currency {
|
||||||
override val blockchain: SdkBlockchain,
|
override val blockchain: SdkBlockchain,
|
||||||
override val derivationPath: String?,
|
override val derivationPath: String?,
|
||||||
) : Currency {
|
) : Currency {
|
||||||
override val currencySymbol: CryptoCurrencyName = blockchain.currency
|
override val currencySymbol: String = blockchain.currency
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
package com.tangem.tap.features.demo
|
|
||||||
|
|
||||||
import com.tangem.domain.demo.models.DemoConfig
|
|
||||||
import com.tangem.domain.models.scan.ScanResponse
|
|
||||||
import org.rekotlin.Action
|
|
||||||
|
|
||||||
/**
|
|
||||||
[REDACTED_AUTHOR]
|
|
||||||
*/
|
|
||||||
interface DemoMiddleware {
|
|
||||||
fun tryHandle(config: DemoConfig, scanResponse: ScanResponse, action: Action): Boolean
|
|
||||||
}
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
package com.tangem.tap.proxy
|
|
||||||
|
|
||||||
import com.tangem.domain.models.wallet.UserWallet
|
|
||||||
import com.tangem.domain.redux.ReduxStateHolder
|
|
||||||
import com.tangem.tap.common.extensions.dispatchWithMain
|
|
||||||
import com.tangem.tap.common.extensions.onUserWalletSelected
|
|
||||||
import com.tangem.tap.common.redux.AppState
|
|
||||||
import com.tangem.tap.network.exchangeServices.SellService
|
|
||||||
import org.rekotlin.Action
|
|
||||||
import org.rekotlin.Store
|
|
||||||
import javax.inject.Inject
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds objects from old modules, that missing in DI graph.
|
|
||||||
* Object sets manually to use in new modules and [AppStateHolder] proxies its to DI.
|
|
||||||
*/
|
|
||||||
class AppStateHolder @Inject constructor() : ReduxStateHolder {
|
|
||||||
|
|
||||||
var mainStore: Store<AppState>? = null
|
|
||||||
var sellService: SellService? = null
|
|
||||||
|
|
||||||
override fun dispatch(action: Action) {
|
|
||||||
mainStore?.dispatch(action)
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun dispatchWithMain(action: Action) {
|
|
||||||
mainStore?.dispatchWithMain(action)
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun onUserWalletSelected(userWallet: UserWallet) {
|
|
||||||
mainStore?.onUserWalletSelected(userWallet)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
package com.tangem.tap.proxy.di
|
|
||||||
|
|
||||||
import com.tangem.tap.proxy.AppStateHolder
|
|
||||||
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 ProxyModule {
|
|
||||||
|
|
||||||
@Provides
|
|
||||||
@Singleton
|
|
||||||
fun provideAppStateHolder(): AppStateHolder {
|
|
||||||
return AppStateHolder()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
package com.tangem.tap.proxy.redux
|
|
||||||
|
|
||||||
import com.tangem.domain.card.ScanCardUseCase
|
|
||||||
import com.tangem.domain.card.repository.CardSdkConfigRepository
|
|
||||||
import org.rekotlin.Action
|
|
||||||
|
|
||||||
sealed interface DaggerGraphAction : Action {
|
|
||||||
|
|
||||||
data class SetActivityDependencies(
|
|
||||||
val scanCardUseCase: ScanCardUseCase,
|
|
||||||
val cardSdkConfigRepository: CardSdkConfigRepository,
|
|
||||||
) : DaggerGraphAction
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
package com.tangem.tap.proxy.redux
|
|
||||||
|
|
||||||
import com.tangem.tap.common.redux.AppState
|
|
||||||
import org.rekotlin.Middleware
|
|
||||||
|
|
||||||
@Suppress("MemberNameEqualsClassName")
|
|
||||||
object DaggerGraphMiddleware {
|
|
||||||
val daggerGraphMiddleware: Middleware<AppState> = { _, _ ->
|
|
||||||
{ next ->
|
|
||||||
{ action -> next(action) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
package com.tangem.tap.proxy.redux
|
|
||||||
|
|
||||||
import com.tangem.tap.common.redux.AppState
|
|
||||||
import org.rekotlin.Action
|
|
||||||
|
|
||||||
object DaggerGraphReducer {
|
|
||||||
fun reduce(action: Action, state: AppState): DaggerGraphState {
|
|
||||||
if (action !is DaggerGraphAction) return state.daggerGraphState
|
|
||||||
|
|
||||||
return internalReduce(action, state)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun internalReduce(action: DaggerGraphAction, state: AppState): DaggerGraphState {
|
|
||||||
return when (action) {
|
|
||||||
is DaggerGraphAction.SetActivityDependencies -> state.daggerGraphState.copy(
|
|
||||||
scanCardUseCase = action.scanCardUseCase,
|
|
||||||
cardSdkConfigRepository = action.cardSdkConfigRepository,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
package com.tangem.tap.proxy.redux
|
|
||||||
|
|
||||||
import com.tangem.blockchainsdk.BlockchainSDKFactory
|
|
||||||
import com.tangem.blockchainsdk.utils.ExcludedBlockchains
|
|
||||||
import com.tangem.common.routing.AppRouter
|
|
||||||
import com.tangem.core.analytics.utils.TrackingContextProxy
|
|
||||||
import com.tangem.core.decompose.ui.UiMessageSender
|
|
||||||
import com.tangem.core.navigation.settings.SettingsManager
|
|
||||||
import com.tangem.core.navigation.share.ShareManager
|
|
||||||
import com.tangem.core.navigation.url.UrlOpener
|
|
||||||
import com.tangem.core.ui.clipboard.ClipboardManager
|
|
||||||
import com.tangem.data.card.TransactionSignerFactory
|
|
||||||
import com.tangem.datasource.connection.NetworkConnectionManager
|
|
||||||
import com.tangem.datasource.local.config.issuers.IssuersConfigStorage
|
|
||||||
import com.tangem.datasource.local.preferences.AppPreferencesStore
|
|
||||||
import com.tangem.domain.appcurrency.repository.AppCurrencyRepository
|
|
||||||
import com.tangem.domain.apptheme.repository.AppThemeModeRepository
|
|
||||||
import com.tangem.domain.balancehiding.repositories.BalanceHidingRepository
|
|
||||||
import com.tangem.domain.card.ScanCardProcessor
|
|
||||||
import com.tangem.domain.card.ScanCardUseCase
|
|
||||||
import com.tangem.domain.card.ScanFailsRequester
|
|
||||||
import com.tangem.domain.card.repository.CardRepository
|
|
||||||
import com.tangem.domain.card.repository.CardSdkConfigRepository
|
|
||||||
import com.tangem.domain.common.wallets.UserWalletsListRepository
|
|
||||||
import com.tangem.domain.feedback.GetWalletMetaInfoUseCase
|
|
||||||
import com.tangem.domain.feedback.SendFeedbackEmailUseCase
|
|
||||||
import com.tangem.domain.onboarding.SaveTwinsOnboardingShownUseCase
|
|
||||||
import com.tangem.domain.onboarding.WasTwinsOnboardingShownUseCase
|
|
||||||
import com.tangem.domain.onboarding.repository.OnboardingRepository
|
|
||||||
import com.tangem.domain.settings.repositories.SettingsRepository
|
|
||||||
import com.tangem.domain.walletmanager.WalletManagersFacade
|
|
||||||
import com.tangem.domain.wallets.builder.ColdUserWalletBuilder
|
|
||||||
import com.tangem.domain.wallets.repository.WalletsRepository
|
|
||||||
import com.tangem.features.onboarding.v2.OnboardingV2FeatureToggles
|
|
||||||
import com.tangem.hot.sdk.TangemHotSdk
|
|
||||||
import com.tangem.operations.attestation.CardArtworksProvider
|
|
||||||
import com.tangem.tap.domain.scanCard.CardScanningFeatureToggles
|
|
||||||
import com.tangem.tap.proxy.AppStateHolder
|
|
||||||
import org.rekotlin.StateType
|
|
||||||
|
|
||||||
data class DaggerGraphState(
|
|
||||||
val networkConnectionManager: NetworkConnectionManager? = null,
|
|
||||||
val cardScanningFeatureToggles: CardScanningFeatureToggles? = null,
|
|
||||||
val scanCardUseCase: ScanCardUseCase? = null,
|
|
||||||
val scanCardProcessor: ScanCardProcessor? = null,
|
|
||||||
val cardSdkConfigRepository: CardSdkConfigRepository? = null,
|
|
||||||
val appCurrencyRepository: AppCurrencyRepository? = null,
|
|
||||||
val walletManagersFacade: WalletManagersFacade? = null,
|
|
||||||
val appStateHolder: AppStateHolder? = null,
|
|
||||||
val appThemeModeRepository: AppThemeModeRepository? = null,
|
|
||||||
val balanceHidingRepository: BalanceHidingRepository? = null,
|
|
||||||
val walletsRepository: WalletsRepository? = null,
|
|
||||||
val wasTwinsOnboardingShownUseCase: WasTwinsOnboardingShownUseCase? = null,
|
|
||||||
val saveTwinsOnboardingShownUseCase: SaveTwinsOnboardingShownUseCase? = null,
|
|
||||||
val cardRepository: CardRepository? = null,
|
|
||||||
val settingsRepository: SettingsRepository? = null,
|
|
||||||
val blockchainSDKFactory: BlockchainSDKFactory? = null,
|
|
||||||
val sendFeedbackEmailUseCase: SendFeedbackEmailUseCase? = null,
|
|
||||||
val getWalletMetaInfoUseCase: GetWalletMetaInfoUseCase? = null,
|
|
||||||
val issuersConfigStorage: IssuersConfigStorage? = null,
|
|
||||||
val urlOpener: UrlOpener? = null,
|
|
||||||
val shareManager: ShareManager? = null,
|
|
||||||
val appRouter: AppRouter? = null,
|
|
||||||
val transactionSignerFactory: TransactionSignerFactory? = null,
|
|
||||||
val onboardingV2FeatureToggles: OnboardingV2FeatureToggles? = null,
|
|
||||||
val onboardingRepository: OnboardingRepository? = null,
|
|
||||||
val excludedBlockchains: ExcludedBlockchains? = null,
|
|
||||||
val appPreferencesStore: AppPreferencesStore? = null,
|
|
||||||
val clipboardManager: ClipboardManager? = null,
|
|
||||||
val settingsManager: SettingsManager? = null,
|
|
||||||
val uiMessageSender: UiMessageSender? = null,
|
|
||||||
val cardArworksProvider: CardArtworksProvider? = null,
|
|
||||||
val coldUserWalletBuilderFactory: ColdUserWalletBuilder.Factory? = null,
|
|
||||||
val userWalletsListRepository: UserWalletsListRepository? = null,
|
|
||||||
val tangemHotSdk: TangemHotSdk? = null,
|
|
||||||
val trackingContextProxy: TrackingContextProxy? = null,
|
|
||||||
val scanFailsRequester: ScanFailsRequester? = null,
|
|
||||||
) : StateType
|
|
||||||
|
|
@ -17,5 +17,4 @@ dependencies {
|
||||||
kapt(deps.hilt.kapt)
|
kapt(deps.hilt.kapt)
|
||||||
|
|
||||||
implementation(deps.material)
|
implementation(deps.material)
|
||||||
implementation(deps.reKotlin)
|
|
||||||
}
|
}
|
||||||
|
|
@ -42,7 +42,6 @@ dependencies {
|
||||||
implementation(deps.kotlin.coroutines)
|
implementation(deps.kotlin.coroutines)
|
||||||
implementation(deps.moshi)
|
implementation(deps.moshi)
|
||||||
implementation(deps.moshi.kotlin)
|
implementation(deps.moshi.kotlin)
|
||||||
implementation(deps.reKotlin)
|
|
||||||
ksp(deps.moshi.kotlin.codegen)
|
ksp(deps.moshi.kotlin.codegen)
|
||||||
|
|
||||||
/** Testing libraries */
|
/** Testing libraries */
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
package com.tangem.domain.redux
|
|
||||||
|
|
||||||
import com.tangem.domain.models.wallet.UserWallet
|
|
||||||
import org.rekotlin.Action
|
|
||||||
|
|
||||||
interface ReduxStateHolder {
|
|
||||||
|
|
||||||
fun dispatch(action: Action)
|
|
||||||
|
|
||||||
suspend fun dispatchWithMain(action: Action)
|
|
||||||
|
|
||||||
suspend fun onUserWalletSelected(userWallet: UserWallet)
|
|
||||||
}
|
|
||||||
|
|
@ -56,7 +56,6 @@ dependencies {
|
||||||
|
|
||||||
/** Utils */
|
/** Utils */
|
||||||
implementation(deps.jodatime)
|
implementation(deps.jodatime)
|
||||||
implementation(deps.reKotlin)
|
|
||||||
|
|
||||||
implementation(tangemDeps.blockchain) {
|
implementation(tangemDeps.blockchain) {
|
||||||
exclude(module = "joda-time")
|
exclude(module = "joda-time")
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,6 @@ dependencies {
|
||||||
|
|
||||||
/* Other */
|
/* Other */
|
||||||
implementation(deps.kotlin.immutable.collections)
|
implementation(deps.kotlin.immutable.collections)
|
||||||
implementation(deps.reKotlin)
|
|
||||||
implementation(deps.arrow.core)
|
implementation(deps.arrow.core)
|
||||||
implementation(deps.arrow.fx)
|
implementation(deps.arrow.fx)
|
||||||
}
|
}
|
||||||
|
|
@ -69,5 +69,4 @@ dependencies {
|
||||||
/* Other */
|
/* Other */
|
||||||
implementation(deps.kotlin.immutable.collections)
|
implementation(deps.kotlin.immutable.collections)
|
||||||
implementation(deps.decompose.ext.compose)
|
implementation(deps.decompose.ext.compose)
|
||||||
implementation(deps.reKotlin) // need for legacy onboarding
|
|
||||||
}
|
}
|
||||||
|
|
@ -82,5 +82,4 @@ dependencies {
|
||||||
/** Other */
|
/** Other */
|
||||||
implementation(deps.decompose.ext.compose)
|
implementation(deps.decompose.ext.compose)
|
||||||
implementation(deps.kotlin.immutable.collections)
|
implementation(deps.kotlin.immutable.collections)
|
||||||
implementation(deps.reKotlin)
|
|
||||||
}
|
}
|
||||||
|
|
@ -37,7 +37,6 @@ dependencies {
|
||||||
implementation(deps.arrow.core)
|
implementation(deps.arrow.core)
|
||||||
implementation(deps.jodatime)
|
implementation(deps.jodatime)
|
||||||
implementation(deps.kotlin.immutable.collections)
|
implementation(deps.kotlin.immutable.collections)
|
||||||
implementation(deps.reKotlin)
|
|
||||||
implementation(tangemDeps.blockchain)
|
implementation(tangemDeps.blockchain)
|
||||||
implementation(tangemDeps.card.core)
|
implementation(tangemDeps.card.core)
|
||||||
implementation(deps.lifecycle.compose)
|
implementation(deps.lifecycle.compose)
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@ dependencies {
|
||||||
|
|
||||||
/* Other */
|
/* Other */
|
||||||
implementation(deps.kotlin.immutable.collections)
|
implementation(deps.kotlin.immutable.collections)
|
||||||
implementation(deps.reKotlin)
|
|
||||||
|
|
||||||
/** Tangem libraries */
|
/** Tangem libraries */
|
||||||
implementation(tangemDeps.hot.core)
|
implementation(tangemDeps.hot.core)
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ dependencies {
|
||||||
implementation(deps.googlePlay.review)
|
implementation(deps.googlePlay.review)
|
||||||
implementation(deps.jodatime)
|
implementation(deps.jodatime)
|
||||||
implementation(deps.kotlin.immutable.collections)
|
implementation(deps.kotlin.immutable.collections)
|
||||||
implementation(deps.reKotlin)
|
|
||||||
implementation(tangemDeps.hot.core)
|
implementation(tangemDeps.hot.core)
|
||||||
implementation(tangemDeps.card.core)
|
implementation(tangemDeps.card.core)
|
||||||
implementation(tangemDeps.blockchain)
|
implementation(tangemDeps.blockchain)
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@ lottie-compose = "6.6.0"
|
||||||
moshi = "1.15.1"
|
moshi = "1.15.1"
|
||||||
moshiAdaptersExt = "0.1.5"
|
moshiAdaptersExt = "0.1.5"
|
||||||
okhttp = "4.9.3"
|
okhttp = "4.9.3"
|
||||||
rekotlin = "1.0.4"
|
|
||||||
retrofit = "2.11.0"
|
retrofit = "2.11.0"
|
||||||
retrofitMoshiConverter = "2.9.0"
|
retrofitMoshiConverter = "2.9.0"
|
||||||
spongycastleCryptoCore = "1.58.0.0"
|
spongycastleCryptoCore = "1.58.0.0"
|
||||||
|
|
@ -279,7 +278,6 @@ moshi-kotlin-codegen = { module = "com.squareup.moshi:moshi-kotlin-codegen", ver
|
||||||
okHttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
|
okHttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
|
||||||
okHttp-prettyLogging = { module = "com.github.ihsanbal:LoggingInterceptor", version.ref = "okHttp-prettyLogging" }
|
okHttp-prettyLogging = { module = "com.github.ihsanbal:LoggingInterceptor", version.ref = "okHttp-prettyLogging" }
|
||||||
spongecastle-core = { module = "com.madgag.spongycastle:core", version.ref = "spongycastleCryptoCore" }
|
spongecastle-core = { module = "com.madgag.spongycastle:core", version.ref = "spongycastleCryptoCore" }
|
||||||
reKotlin = { module = "org.rekotlin:rekotlin", version.ref = "rekotlin" }
|
|
||||||
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
|
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
|
||||||
retrofit-response-type-keeper = { module = "com.squareup.retrofit2:response-type-keeper", version.ref = "retrofit" }
|
retrofit-response-type-keeper = { module = "com.squareup.retrofit2:response-type-keeper", version.ref = "retrofit" }
|
||||||
retrofit-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofitMoshiConverter" }
|
retrofit-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofitMoshiConverter" }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue