diff --git a/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectSdkHelper.kt b/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectSdkHelper.kt index a4b9510d38..2db93bfead 100644 --- a/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectSdkHelper.kt +++ b/app/src/main/java/com/tangem/tap/domain/walletconnect/WalletConnectSdkHelper.kt @@ -4,7 +4,7 @@ import com.tangem.Message import com.tangem.blockchain.blockchains.ethereum.EthereumGasLoader import com.tangem.blockchain.blockchains.ethereum.EthereumTransactionExtras import com.tangem.blockchain.blockchains.ethereum.EthereumUtils -import com.tangem.blockchain.blockchains.ethereum.EthereumUtils.Companion.toKeccak +import com.tangem.blockchain.blockchains.ethereum.EthereumUtils.toKeccak import com.tangem.blockchain.common.* import com.tangem.blockchain.common.transaction.Fee import com.tangem.blockchain.extensions.Result diff --git a/app/src/main/java/com/tangem/tap/proxy/TransactionManagerImpl.kt b/app/src/main/java/com/tangem/tap/proxy/TransactionManagerImpl.kt index 90b2da621e..a7899eace5 100644 --- a/app/src/main/java/com/tangem/tap/proxy/TransactionManagerImpl.kt +++ b/app/src/main/java/com/tangem/tap/proxy/TransactionManagerImpl.kt @@ -1,5 +1,6 @@ package com.tangem.tap.proxy +import androidx.core.text.isDigitsOnly import com.google.firebase.crashlytics.FirebaseCrashlytics import com.tangem.Message import com.tangem.blockchain.blockchains.binance.BinanceTransactionExtras @@ -23,8 +24,6 @@ import com.tangem.core.analytics.api.AnalyticsEventHandler import com.tangem.domain.card.repository.CardSdkConfigRepository import com.tangem.domain.common.extensions.fromNetworkId import com.tangem.domain.walletmanager.WalletManagersFacade -import com.tangem.features.send.impl.presentation.viewmodel.XlmMemoType -import com.tangem.features.send.impl.presentation.viewmodel.determineXlmMemoType import com.tangem.lib.crypto.TransactionManager import com.tangem.lib.crypto.models.* import com.tangem.lib.crypto.models.transactions.SendTxResult @@ -153,11 +152,12 @@ class TransactionManagerImpl( if (memo == null) return null return when (blockchain) { Blockchain.Stellar -> { - val xmlMemo = when (determineXlmMemoType(memo)) { - XlmMemoType.TEXT -> StellarMemo.Text(memo) - XlmMemoType.ID -> StellarMemo.Id(memo.toBigInteger()) + val xlmMemo = if (memo.isNotEmpty() && memo.isDigitsOnly()) { + StellarMemo.Id(memo.toBigInteger()) + } else { + StellarMemo.Text(memo) } - StellarTransactionExtras(xmlMemo) + StellarTransactionExtras(xlmMemo) } Blockchain.Binance -> BinanceTransactionExtras(memo) Blockchain.XRP -> memo.toLongOrNull()?.let { XrpTransactionBuilder.XrpTransactionExtras(it) } diff --git a/domain/transaction/src/main/java/com/tangem/domain/transaction/error/GetFeeError.kt b/domain/transaction/src/main/java/com/tangem/domain/transaction/error/GetFeeError.kt index e6669368f9..f2e3f7f60f 100644 --- a/domain/transaction/src/main/java/com/tangem/domain/transaction/error/GetFeeError.kt +++ b/domain/transaction/src/main/java/com/tangem/domain/transaction/error/GetFeeError.kt @@ -2,6 +2,5 @@ package com.tangem.domain.transaction.error sealed class GetFeeError { data class DataError(val cause: Throwable?) : GetFeeError() - object UnknownError : GetFeeError() } \ No newline at end of file diff --git a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/EstimateFeeUseCase.kt b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/EstimateFeeUseCase.kt index 28f48358a0..a33088d612 100644 --- a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/EstimateFeeUseCase.kt +++ b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/EstimateFeeUseCase.kt @@ -29,7 +29,7 @@ class EstimateFeeUseCase( amount: BigDecimal, userWalletId: UserWalletId, cryptoCurrency: CryptoCurrency, - ): Flow> { + ): Flow> { return flow { val result = walletManagersFacade.estimateFee( amount = convertCryptoCurrencyToAmount(cryptoCurrency, amount), @@ -39,7 +39,8 @@ class EstimateFeeUseCase( val maybeFee = when (result) { is Result.Success -> result.data.right() - else -> GetFeeError.DataError.left() + is Result.Failure -> GetFeeError.DataError(result.error).left() + null -> GetFeeError.UnknownError.left() } emit(maybeFee) }.flowOn(dispatcher.io) diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/WebViewBottomSheet.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/WebViewBottomSheet.kt index 4a068cddbd..eb2df9fe19 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/WebViewBottomSheet.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/WebViewBottomSheet.kt @@ -20,7 +20,7 @@ import com.tangem.feature.swap.models.states.WebViewBottomSheetConfig fun WebViewBottomSheet(config: TangemBottomSheetConfig) { TangemBottomSheet( config = config, - contentColor = TangemTheme.colors.background.tertiary, + containerColor = TangemTheme.colors.background.tertiary, ) { content: WebViewBottomSheetConfig -> WebViewBottomSheetContent( WebViewBottomSheetConfig(url = content.url), diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/viewmodels/SwapViewModel.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/viewmodels/SwapViewModel.kt index cde4df0693..c081db8e65 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/viewmodels/SwapViewModel.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/viewmodels/SwapViewModel.kt @@ -5,7 +5,6 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue import androidx.lifecycle.* import arrow.core.getOrElse -import com.tangem.common.Provider import com.tangem.core.analytics.api.AnalyticsEventHandler import com.tangem.core.ui.utils.InputNumberFormatter import com.tangem.domain.appcurrency.GetSelectedAppCurrencyUseCase @@ -32,6 +31,7 @@ import com.tangem.feature.swap.presentation.SwapFragment import com.tangem.feature.swap.router.SwapNavScreen import com.tangem.feature.swap.router.SwapRouter import com.tangem.feature.swap.ui.StateBuilder +import com.tangem.utils.Provider import com.tangem.utils.coroutines.* import com.tangem.utils.isNullOrZero import dagger.hilt.android.lifecycle.HiltViewModel @@ -606,7 +606,7 @@ internal class SwapViewModel @Inject constructor( afterSearch = true, ), - ) + ) } else { tokenDataState.copy( toGroup = tokenDataState.toGroup.copy( diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt index 4cece938af..bb4427955e 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt @@ -28,6 +28,7 @@ internal class WalletWarningsAnalyticsSender @Inject constructor( is WalletNotification.Warning.LowSignatures, is WalletNotification.Warning.NetworksUnreachable, is WalletNotification.Warning.SomeNetworksUnreachable, + is WalletNotification.SwapPromo, -> null } }