Updated on 2026-08-14
This commit is contained in:
parent
7d38ec51cc
commit
e12ec65fec
3 changed files with 12 additions and 5 deletions
|
|
@ -6,8 +6,8 @@ import arrow.core.right
|
|||
import com.tangem.blockchain.common.Amount
|
||||
import com.tangem.blockchain.common.transaction.Fee
|
||||
import com.tangem.domain.models.network.Network
|
||||
import com.tangem.domain.transaction.TransactionRepository
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.domain.transaction.TransactionRepository
|
||||
|
||||
class ValidateTransactionUseCase(
|
||||
private val transactionRepository: TransactionRepository,
|
||||
|
|
@ -21,8 +21,8 @@ class ValidateTransactionUseCase(
|
|||
destination: String,
|
||||
userWalletId: UserWalletId,
|
||||
network: Network,
|
||||
): Either<Throwable, Unit> {
|
||||
return transactionRepository.validateTransaction(
|
||||
): Either<Throwable, Unit> = Either.catch {
|
||||
transactionRepository.validateTransaction(
|
||||
amount = amount,
|
||||
fee = fee,
|
||||
memo = memo,
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.tangem.core.decompose.model.getOrCreateModel
|
|||
import com.tangem.core.navigation.url.UrlOpener
|
||||
import com.tangem.core.ui.decompose.ComposableContentComponent
|
||||
import com.tangem.domain.appcurrency.model.AppCurrency
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.models.currency.CryptoCurrencyStatus
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.swap.models.SwapDirection
|
||||
|
|
@ -104,7 +105,10 @@ internal class SendWithSwapConfirmComponent @AssistedInject constructor(
|
|||
appCurrency = params.appCurrency,
|
||||
callback = model,
|
||||
notificationData = SendNotificationsComponent.Params.NotificationData(
|
||||
destinationAddress = model.confirmData.enteredDestination.orEmpty(),
|
||||
destinationAddress = when (val currency = model.primaryCurrencyStatus.currency) {
|
||||
is CryptoCurrency.Token -> currency.contractAddress
|
||||
is CryptoCurrency.Coin -> "0"
|
||||
},
|
||||
memo = null,
|
||||
amountValue = model.confirmData.enteredAmount.orZero(),
|
||||
reduceAmountBy = model.confirmData.reduceAmountBy.orZero(),
|
||||
|
|
|
|||
|
|
@ -329,7 +329,10 @@ internal class SendWithSwapConfirmModel @Inject constructor(
|
|||
modelScope.launch {
|
||||
sendNotificationsUpdateTrigger.triggerUpdate(
|
||||
data = NotificationData(
|
||||
destinationAddress = confirmData.enteredDestination.orEmpty(),
|
||||
destinationAddress = when (val currency = primaryCurrencyStatus.currency) {
|
||||
is CryptoCurrency.Token -> currency.contractAddress
|
||||
is CryptoCurrency.Coin -> "0"
|
||||
},
|
||||
memo = null,
|
||||
amountValue = confirmData.enteredAmount.orZero(),
|
||||
reduceAmountBy = confirmData.reduceAmountBy,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue