Updated on 2026-08-14
This commit is contained in:
parent
4be3782a0a
commit
2ea3f2ca9d
11 changed files with 98 additions and 8 deletions
|
|
@ -6,9 +6,9 @@ import androidx.compose.ui.text.input.KeyboardType
|
|||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.models.network.Network
|
||||
import com.tangem.features.send.v2.impl.R
|
||||
import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationTextFieldUM
|
||||
import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationUM
|
||||
import com.tangem.features.send.v2.impl.R
|
||||
import com.tangem.utils.transformer.Transformer
|
||||
|
||||
internal class SendDestinationInitialStateTransformer(
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.tangem.features.swap.v2.impl.common
|
|||
|
||||
import com.tangem.blockchain.common.transaction.Fee
|
||||
import com.tangem.domain.express.models.ExpressRateType
|
||||
import com.tangem.domain.models.account.Account
|
||||
import com.tangem.domain.models.currency.CryptoCurrencyStatus
|
||||
import com.tangem.domain.transaction.error.GetFeeError
|
||||
import com.tangem.features.swap.v2.impl.common.entity.SwapQuoteUM
|
||||
|
|
@ -16,6 +17,7 @@ internal data class ConfirmData(
|
|||
val feeError: GetFeeError?,
|
||||
val fromCryptoCurrencyStatus: CryptoCurrencyStatus?,
|
||||
val toCryptoCurrencyStatus: CryptoCurrencyStatus?,
|
||||
val fromAccount: Account.CryptoPortfolio?,
|
||||
val quote: SwapQuoteUM?,
|
||||
val rateType: ExpressRateType?,
|
||||
)
|
||||
|
|
@ -135,6 +135,7 @@ internal class SendWithSwapConfirmModel @Inject constructor(
|
|||
onDirect = { secondaryCurrencyStatus },
|
||||
onReverse = { primaryCurrencyStatus },
|
||||
),
|
||||
fromAccount = params.accountFlow.value,
|
||||
quote = amountUM?.selectedQuote,
|
||||
rateType = amountUM?.swapRateType,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.tangem.domain.express.models.ExpressError
|
|||
import com.tangem.domain.express.models.ExpressOperationType
|
||||
import com.tangem.domain.express.models.ExpressProvider
|
||||
import com.tangem.domain.express.models.ExpressProviderType
|
||||
import com.tangem.domain.models.account.Account
|
||||
import com.tangem.domain.models.currency.CryptoCurrencyStatus
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.swap.models.SwapDataModel
|
||||
|
|
@ -64,7 +65,7 @@ internal class SwapTransactionSender @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
suspend fun onCexTransaction(
|
||||
private suspend fun onCexTransaction(
|
||||
confirmData: ConfirmData,
|
||||
isAmountSubtractAvailable: Boolean,
|
||||
onSendSuccess: (String, Long, SwapDataModel) -> Unit,
|
||||
|
|
@ -74,6 +75,7 @@ internal class SwapTransactionSender @AssistedInject constructor(
|
|||
) {
|
||||
val fromStatus = confirmData.fromCryptoCurrencyStatus ?: return
|
||||
val toStatus = confirmData.toCryptoCurrencyStatus ?: return
|
||||
val fromAccount = confirmData.fromAccount
|
||||
val provider = confirmData.quote?.provider ?: return
|
||||
val rateType = confirmData.rateType ?: return
|
||||
val amountValue = confirmData.enteredAmount ?: return
|
||||
|
|
@ -102,6 +104,7 @@ internal class SwapTransactionSender @AssistedInject constructor(
|
|||
createAndSendCexTransaction(
|
||||
fromAmount = fromAmount,
|
||||
fromStatus = fromStatus,
|
||||
fromAccount = fromAccount,
|
||||
toStatus = toStatus,
|
||||
fee = confirmData.fee,
|
||||
provider = provider,
|
||||
|
|
@ -116,6 +119,7 @@ internal class SwapTransactionSender @AssistedInject constructor(
|
|||
fromAmount: BigDecimal,
|
||||
fromStatus: CryptoCurrencyStatus,
|
||||
toStatus: CryptoCurrencyStatus,
|
||||
fromAccount: Account.CryptoPortfolio?,
|
||||
fee: Fee,
|
||||
provider: ExpressProvider,
|
||||
swapData: SwapDataModel,
|
||||
|
|
@ -160,6 +164,8 @@ internal class SwapTransactionSender @AssistedInject constructor(
|
|||
userWallet = userWallet,
|
||||
fromCryptoCurrencyStatus = fromStatus,
|
||||
toCryptoCurrencyStatus = toStatus,
|
||||
fromAccount = fromAccount,
|
||||
toAccount = null,
|
||||
swapDataTransactionModel = swapTransaction,
|
||||
provider = provider,
|
||||
txHash = txHash,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue