Updated on 2026-08-14

This commit is contained in:
Tangem 2026-02-05 16:27:54 +07:00
parent a40e6e7e28
commit fa86588528
7 changed files with 52 additions and 22 deletions

View file

@ -75,5 +75,9 @@ interface WalletsRepository {
@Throws
suspend fun associateWallets(applicationId: String, wallets: List<UserWallet>)
suspend fun activatePromoCode(promoCode: String, bitcoinAddress: String): Either<ActivatePromoCodeError, String>
suspend fun activatePromoCode(
userWalletId: UserWalletId,
promoCode: String,
bitcoinAddress: String,
): Either<ActivatePromoCodeError, String>
}

View file

@ -1,6 +1,7 @@
package com.tangem.domain.wallets.usecase
import arrow.core.Either
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.wallets.models.errors.ActivatePromoCodeError
import com.tangem.domain.wallets.repository.WalletsRepository
import javax.inject.Inject
@ -9,6 +10,13 @@ class ActivateBitcoinPromocodeUseCase @Inject constructor(
private val walletsRepository: WalletsRepository,
) {
suspend operator fun invoke(address: String, promoCode: String): Either<ActivatePromoCodeError, String> =
walletsRepository.activatePromoCode(promoCode = promoCode, bitcoinAddress = address)
suspend operator fun invoke(
userWalletId: UserWalletId,
address: String,
promoCode: String,
): Either<ActivatePromoCodeError, String> = walletsRepository.activatePromoCode(
userWalletId = userWalletId,
promoCode = promoCode,
bitcoinAddress = address,
)
}