Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-28 11:36:41 +01:00
parent 40f7df2c5d
commit 1ce3399a02
15 changed files with 890 additions and 65 deletions

View file

@ -11,7 +11,7 @@ import java.math.BigDecimal
interface TangemPayWithdrawRepository {
suspend fun withdraw(
suspend fun withdrawWithSwap(
userWallet: UserWallet,
receiverAddress: String,
cryptoAmount: BigDecimal,
@ -19,6 +19,13 @@ interface TangemPayWithdrawRepository {
exchangeData: TangemPayWithdrawExchangeState,
): Either<UniversalError, WithdrawalResult>
suspend fun withdraw(
userWallet: UserWallet,
receiverAddress: String,
cryptoAmount: BigDecimal,
cryptoCurrencyId: CryptoCurrency.RawID,
): Either<UniversalError, WithdrawalResult>
suspend fun hasWithdrawOrder(userWalletId: UserWalletId): Boolean
suspend fun pollWithdrawOrdersIfNeeds(userWallet: UserWallet)

View file

@ -4,7 +4,6 @@ import arrow.core.Either
import com.tangem.core.error.UniversalError
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.pay.TangemPayWithdrawExchangeState
import com.tangem.domain.pay.WithdrawalResult
import java.math.BigDecimal
@ -15,6 +14,5 @@ interface TangemPayWithdrawUseCase {
cryptoAmount: BigDecimal,
cryptoCurrencyId: CryptoCurrency.RawID,
receiverCexAddress: String,
exchangeData: TangemPayWithdrawExchangeState,
): Either<UniversalError, WithdrawalResult>
}

View file

@ -0,0 +1,20 @@
package com.tangem.domain.tangempay
import arrow.core.Either
import com.tangem.core.error.UniversalError
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.pay.TangemPayWithdrawExchangeState
import com.tangem.domain.pay.WithdrawalResult
import java.math.BigDecimal
interface TangemPayWithdrawWithSwapUseCase {
suspend operator fun invoke(
userWallet: UserWallet,
cryptoAmount: BigDecimal,
cryptoCurrencyId: CryptoCurrency.RawID,
receiverCexAddress: String,
exchangeData: TangemPayWithdrawExchangeState,
): Either<UniversalError, WithdrawalResult>
}