Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-20 11:27:43 -07:00
parent 5b516f2c9b
commit a82d8cdbba
43 changed files with 829 additions and 89 deletions

View file

@ -0,0 +1,13 @@
plugins {
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
id("configuration")
}
android {
namespace = "com.tangem.domain.appsflyer"
}
dependencies {
implementation(deps.kotlin.coroutines)
}

View file

@ -0,0 +1,5 @@
package com.tangem.domain.appsflyer
enum class AppsFlyerDeeplinkSource {
TangemPayHotWalletOnboarding,
}

View file

@ -0,0 +1,8 @@
package com.tangem.domain.appsflyer.repository
import com.tangem.domain.appsflyer.AppsFlyerDeeplinkSource
interface AppsFlyerRepository {
suspend fun clearDeeplink(source: AppsFlyerDeeplinkSource)
}

View file

@ -0,0 +1,12 @@
package com.tangem.domain.appsflyer.usecase
import com.tangem.domain.appsflyer.AppsFlyerDeeplinkSource
import com.tangem.domain.appsflyer.repository.AppsFlyerRepository
class ClearAppsFlyerDeeplinkUseCase(
private val appsFlyerRepository: AppsFlyerRepository,
) {
suspend operator fun invoke(source: AppsFlyerDeeplinkSource) {
appsFlyerRepository.clearDeeplink(source)
}
}

View file

@ -24,6 +24,7 @@ dependencies {
implementation(projects.domain.core)
implementation(projects.domain.tokens.models)
implementation(projects.domain.wallets.models)
implementation(projects.core.datasource)
/** Security */
implementation(deps.spongecastle.core)

View file

@ -0,0 +1,34 @@
package com.tangem.domain.wallets.usecase
import arrow.core.Either
import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.wallets.builder.HotUserWalletBuilder
import com.tangem.hot.sdk.TangemHotSdk
import com.tangem.hot.sdk.model.HotAuth
import com.tangem.hot.sdk.model.MnemonicType
import com.tangem.utils.coroutines.AppCoroutineScope
import kotlinx.coroutines.launch
import javax.inject.Inject
class CreateHotWalletUseCase @Inject constructor(
private val tangemHotSdk: TangemHotSdk,
private val hotUserWalletBuilderFactory: HotUserWalletBuilder.Factory,
private val saveWalletUseCase: SaveWalletUseCase,
private val syncWalletWithRemoteUseCase: SyncWalletWithRemoteUseCase,
private val appCoroutineScope: AppCoroutineScope,
) {
suspend operator fun invoke(auth: HotAuth, mnemonicType: MnemonicType): Either<Throwable, UserWallet.Hot> {
return Either.catch {
val hotWalletId = tangemHotSdk.generateWallet(auth, mnemonicType)
val userWallet = hotUserWalletBuilderFactory.create(hotWalletId).build()
saveWalletUseCase(userWallet)
appCoroutineScope.launch {
syncWalletWithRemoteUseCase(userWalletId = userWallet.walletId)
}
userWallet
}
}
}