Updated on 2026-08-14

This commit is contained in:
Tangem 2025-08-25 16:14:45 +05:00
parent 2cc5292f88
commit 07e98782d5
3 changed files with 30 additions and 20 deletions

View file

@ -240,15 +240,19 @@ internal class DefaultTransactionRepository(
val validator = walletManager as? TransactionValidator
if (validator != null) {
val transactionData = walletManager.createTransaction(
amount = amount,
fee = fee ?: Fee.Common(amount = amount),
destination = destination,
).copy(
extras = getMemoExtras(networkId = network.rawId, memo = memo),
)
try {
val transactionData = walletManager.createTransaction(
amount = amount,
fee = fee ?: Fee.Common(amount = amount),
destination = destination,
).copy(
extras = getMemoExtras(networkId = network.rawId, memo = memo),
)
validator.validate(transactionData = transactionData)
validator.validate(transactionData = transactionData)
} catch (ex: Exception) {
Result.failure(ex)
}
} else {
Timber.e("${walletManager?.wallet?.blockchain} does not support transaction validation")
Result.success(Unit)

View file

@ -21,14 +21,12 @@ class ValidateTransactionUseCase(
destination: String,
userWalletId: UserWalletId,
network: Network,
): Either<Throwable, Unit> = Either.catch {
transactionRepository.validateTransaction(
amount = amount,
fee = fee,
memo = memo,
destination = destination,
userWalletId = userWalletId,
network = network,
).fold(onSuccess = { Unit.right() }, onFailure = { it.left() })
}
): Either<Throwable, Unit> = transactionRepository.validateTransaction(
amount = amount,
fee = fee,
memo = memo,
destination = destination,
userWalletId = userWalletId,
network = network,
).fold(onSuccess = { Unit.right() }, onFailure = { it.left() })
}

View file

@ -139,8 +139,16 @@ internal class SendConfirmModel @Inject constructor(
reduceAmountBy = amountState?.reduceAmountBy.orZero(),
isIgnoreReduce = amountState?.isIgnoreReduce == true,
enteredDestination = destinationUM?.addressTextField?.actualAddress,
fee = feeSelectorUM?.selectedFee,
feeError = (feeUM?.feeSelectorUM as? FeeSelectorUM.Error)?.error,
fee = if (uiState.value.isRedesignEnabled) {
feeUMV2?.selectedFeeItem?.fee
} else {
feeSelectorUM?.selectedFee
},
feeError = if (uiState.value.isRedesignEnabled) {
(uiState.value.feeSelectorUM as? FeeSelectorUMRedesigned.Error)?.error
} else {
(feeUM?.feeSelectorUM as? FeeSelectorUM.Error)?.error
},
)
private var sendIdleTimer: Long = 0L