Updated on 2026-08-14

This commit is contained in:
Tangem 2025-04-28 16:08:31 +05:00
parent a0f6e4a008
commit 6c8b59c569
12 changed files with 288 additions and 66 deletions

View file

@ -37,4 +37,10 @@ interface WalletsRepository {
suspend fun enableNFT(userWalletId: UserWalletId)
suspend fun disableNFT(userWalletId: UserWalletId)
@Throws
suspend fun isNotificationsEnabled(userWalletId: UserWalletId, force: Boolean): Boolean
@Throws
suspend fun setNotificationsEnabled(userWalletId: UserWalletId, isEnabled: Boolean)
}

View file

@ -0,0 +1,17 @@
package com.tangem.domain.wallets.usecase
import arrow.core.Either
import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.domain.wallets.repository.WalletsRepository
class GetIsNotificationsEnabledUseCase(
private val walletsRepository: WalletsRepository,
) {
suspend operator fun invoke(userWalletId: UserWalletId, force: Boolean): Either<Throwable, Boolean> = Either.catch {
walletsRepository.isNotificationsEnabled(
userWalletId = userWalletId,
force = force,
)
}
}

View file

@ -0,0 +1,18 @@
package com.tangem.domain.wallets.usecase
import arrow.core.Either
import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.domain.wallets.repository.WalletsRepository
class SetNotificationsEnabledUseCase(
private val walletsRepository: WalletsRepository,
) {
suspend operator fun invoke(userWalletId: UserWalletId, isEnabled: Boolean): Either<Throwable, Unit> =
Either.catch {
walletsRepository.setNotificationsEnabled(
userWalletId = userWalletId,
isEnabled = isEnabled,
)
}
}