Updated on 2026-08-14
This commit is contained in:
parent
0e370ae05f
commit
092ad9d6c4
7 changed files with 57 additions and 0 deletions
|
|
@ -68,6 +68,7 @@ dependencies {
|
|||
implementation(projects.domain.qrScanning)
|
||||
implementation(projects.domain.qrScanning.models)
|
||||
implementation(projects.domain.staking)
|
||||
implementation(projects.domain.walletConnect)
|
||||
|
||||
implementation(projects.common)
|
||||
implementation(projects.core.analytics)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.tangem.tap.di.domain
|
||||
|
||||
import com.tangem.domain.walletconnect.CheckIsWalletConnectAvailableUseCase
|
||||
import com.tangem.domain.walletconnect.repository.WalletConnectRepository
|
||||
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 WalletConnectDomainModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun providesCheckIsWalletConnectAvailableUseCase(
|
||||
walletConnectRepository: WalletConnectRepository,
|
||||
): CheckIsWalletConnectAvailableUseCase {
|
||||
return CheckIsWalletConnectAvailableUseCase(walletConnectRepository = walletConnectRepository)
|
||||
}
|
||||
}
|
||||
1
domain/wallet-connect/.gitignore
vendored
Normal file
1
domain/wallet-connect/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/build
|
||||
10
domain/wallet-connect/build.gradle.kts
Normal file
10
domain/wallet-connect/build.gradle.kts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
plugins {
|
||||
alias(deps.plugins.kotlin.jvm)
|
||||
id("configuration")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
/* Project - Domain */
|
||||
implementation(projects.domain.core)
|
||||
implementation(projects.domain.wallets.models)
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.tangem.domain.walletconnect
|
||||
|
||||
import arrow.core.Either
|
||||
import com.tangem.domain.walletconnect.repository.WalletConnectRepository
|
||||
import com.tangem.domain.wallets.models.UserWalletId
|
||||
|
||||
class CheckIsWalletConnectAvailableUseCase(
|
||||
private val walletConnectRepository: WalletConnectRepository,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke(userWalletId: UserWalletId): Either<Throwable, Boolean> {
|
||||
return Either.catch { walletConnectRepository.checkIsAvailable(userWalletId) }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.tangem.domain.walletconnect.repository
|
||||
|
||||
import com.tangem.domain.wallets.models.UserWalletId
|
||||
|
||||
interface WalletConnectRepository {
|
||||
|
||||
suspend fun checkIsAvailable(userWalletId: UserWalletId): Boolean
|
||||
}
|
||||
|
|
@ -191,6 +191,7 @@ include(":domain:feedback")
|
|||
include(":domain:qr-scanning")
|
||||
include(":domain:qr-scanning:models")
|
||||
include(":domain:staking")
|
||||
include(":domain:wallet-connect")
|
||||
// endregion Domain modules
|
||||
|
||||
// region Data modules
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue