Updated on 2026-08-14
This commit is contained in:
parent
b08892762c
commit
f095f3a508
24 changed files with 184 additions and 26 deletions
|
|
@ -3,6 +3,7 @@ package com.tangem.features.swap.v2.impl.sendviaswap.confirm.model
|
|||
import arrow.core.Either
|
||||
import arrow.core.getOrElse
|
||||
import arrow.core.left
|
||||
import com.tangem.blockchain.common.transaction.Fee
|
||||
import com.tangem.blockchain.common.transaction.TransactionFee
|
||||
import com.tangem.common.routing.AppRouter
|
||||
import com.tangem.common.ui.amountScreen.converters.AmountReduceByTransformer
|
||||
|
|
@ -457,12 +458,24 @@ internal class SendWithSwapConfirmModel @Inject constructor(
|
|||
blockchain = fromCurrency.network.name,
|
||||
token = fromCurrency.symbol,
|
||||
feeType = feeType,
|
||||
feeToken = getSelectedFeeToken().symbol,
|
||||
),
|
||||
memoType = Basic.TransactionSent.MemoType.Null,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
private fun getSelectedFeeToken(): CryptoCurrency {
|
||||
val feeUMV2 = uiState.value.feeSelectorUM as? FeeSelectorUMRedesigned.Content
|
||||
val feeExtended = feeUMV2?.feeExtraInfo?.transactionFeeExtended
|
||||
val isFeeInTokenCurrency = feeExtended?.transactionFee?.normal is Fee.Ethereum.TokenCurrency
|
||||
return if (isFeeInTokenCurrency) {
|
||||
feeUMV2.feeExtraInfo.feeCryptoCurrencyStatus.currency
|
||||
} else {
|
||||
primaryCurrencyStatus.currency
|
||||
}
|
||||
}
|
||||
|
||||
private fun configConfirmNavigation() {
|
||||
combine(
|
||||
flow = uiState,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.tangem.features.swap.v2.impl.sendviaswap.model
|
|||
|
||||
import arrow.core.Either
|
||||
import arrow.core.getOrElse
|
||||
import com.tangem.blockchain.common.transaction.Fee
|
||||
import com.tangem.common.ui.navigationButtons.NavigationUM
|
||||
import com.tangem.core.decompose.di.ModelScoped
|
||||
import com.tangem.core.decompose.model.Model
|
||||
|
|
@ -43,6 +44,7 @@ import kotlinx.coroutines.launch
|
|||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
import kotlin.properties.Delegates
|
||||
import com.tangem.features.send.v2.api.entity.FeeSelectorUM as FeeSelectorUMRedesigned
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
@ModelScoped
|
||||
|
|
@ -160,6 +162,17 @@ internal class SendWithSwapModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
fun getSelectedFeeToken(): CryptoCurrency {
|
||||
val feeUMV2 = uiState.value.feeSelectorUM as? FeeSelectorUMRedesigned.Content
|
||||
val feeExtended = feeUMV2?.feeExtraInfo?.transactionFeeExtended
|
||||
val isFeeInTokenCurrency = feeExtended?.transactionFee?.normal is Fee.Ethereum.TokenCurrency
|
||||
return if (isFeeInTokenCurrency) {
|
||||
feeUMV2.feeExtraInfo.feeCryptoCurrencyStatus.currency
|
||||
} else {
|
||||
primaryFeePaidCurrencyStatusFlow.value.currency
|
||||
}
|
||||
}
|
||||
|
||||
private fun initUserWallet() {
|
||||
getUserWalletUseCase(params.userWalletId).fold(
|
||||
ifRight = { wallet ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue