Updated on 2026-08-14

This commit is contained in:
Tangem 2025-01-24 11:07:53 +03:00
commit 8fc5a199b7
29 changed files with 60 additions and 260 deletions

View file

@ -6,7 +6,6 @@ import coil.ImageLoaderFactory
import com.chuckerteam.chucker.api.ChuckerInterceptor
import com.tangem.Log
import com.tangem.TangemSdkLogger
import com.tangem.blockchain.common.ExceptionHandler
import com.tangem.blockchain.network.BlockchainSdkRetrofitBuilder
import com.tangem.blockchainsdk.BlockchainSDKFactory
import com.tangem.blockchainsdk.signer.TransactionSignerFactory
@ -54,7 +53,6 @@ import com.tangem.features.onboarding.v2.OnboardingV2FeatureToggles
import com.tangem.features.onramp.OnrampFeatureToggles
import com.tangem.tap.common.analytics.AnalyticsFactory
import com.tangem.tap.common.analytics.api.AnalyticsHandlerBuilder
import com.tangem.tap.common.analytics.handlers.BlockchainExceptionHandler
import com.tangem.tap.common.analytics.handlers.amplitude.AmplitudeAnalyticsHandler
import com.tangem.tap.common.analytics.handlers.firebase.FirebaseAnalyticsHandler
import com.tangem.tap.common.images.createCoilImageLoader
@ -209,9 +207,6 @@ abstract class TangemApplication : Application(), ImageLoaderFactory {
private val settingsManager: SettingsManager
get() = entryPoint.getSettingsManager()
private val blockchainExceptionHandler: BlockchainExceptionHandler
get() = entryPoint.getBlockchainExceptionHandler()
private val uiMessageSender: UiMessageSender
get() = entryPoint.getUiMessageSender()
@ -257,7 +252,7 @@ abstract class TangemApplication : Application(), ImageLoaderFactory {
}
loadNativeLibraries()
ExceptionHandler.append(blockchainExceptionHandler)
// ExceptionHandler.append(blockchainExceptionHandler) // TODO [REDACTED_TASK_KEY] Send only to Firebase
if (LogConfig.network.blockchainSdkNetwork) {
BlockchainSdkRetrofitBuilder.interceptors = listOf(
createNetworkLoggingInterceptor(),

View file

@ -58,10 +58,6 @@ class DialogManager : StoreSubscriber<GlobalState> {
)
is AppDialog.AddressInfoDialog -> AddressInfoBottomSheetDialog(state.dialog, context)
is AppDialog.TestActionsDialog -> TestActionsBottomSheetDialog(state.dialog, context)
is AppDialog.RussianCardholdersWarningDialog -> RussianCardholdersWarningBottomSheetDialog(
context,
state.dialog.data,
)
is OnboardingDialog.TwinningProcessNotCompleted -> TwinningProcessNotCompletedDialog.create(context)
is OnboardingDialog.InterruptOnboarding -> InterruptOnboardingDialog.create(context, state.dialog)
is OnboardingDialog.WalletActivationError -> WalletActivationErrorDialog.create(context, state.dialog)

View file

@ -27,10 +27,6 @@ sealed class AppDialog : StateDialog {
val actionsList: List<TestAction>,
) : AppDialog()
data class RussianCardholdersWarningDialog(val data: Data?) : AppDialog() {
data class Data(val topUpUrl: String)
}
data class RemoveWalletDialog(
val currencyTitle: String,
val onOk: () -> Unit,

View file

@ -1,54 +0,0 @@
package com.tangem.tap.common.ui
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.tangem.core.analytics.Analytics
import com.tangem.tap.common.analytics.events.Token
import com.tangem.tap.common.extensions.dispatchDialogHide
import com.tangem.tap.common.extensions.dispatchOpenUrl
import com.tangem.tap.common.redux.AppDialog
import com.tangem.tap.store
import com.tangem.wallet.databinding.DialogRussiansCardholdersWarningBinding
class RussianCardholdersWarningBottomSheetDialog(
context: Context,
private val dialogData: AppDialog.RussianCardholdersWarningDialog.Data?,
) : BottomSheetDialog(context) {
private var binding: DialogRussiansCardholdersWarningBinding? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Analytics.send(Token.Topup.P2PScreenOpened())
binding = DialogRussiansCardholdersWarningBinding
.inflate(LayoutInflater.from(context))
.also { setContentView(it.root) }
}
override fun show() {
super.show()
setOnDismissListener {
binding = null
store.dispatchDialogHide()
}
binding?.btnYes?.setOnClickListener {
if (dialogData != null) {
store.dispatchOpenUrl(dialogData.topUpUrl)
Analytics.send(Token.Topup.ScreenOpened())
}
dismiss()
}
binding?.btnNo?.setOnClickListener {
store.dispatchOpenUrl(INSTRUCTION_URL)
dismiss()
}
}
companion object {
private const val INSTRUCTION_URL = "https://tangem.com/howtobuy.html"
}
}

View file

@ -338,7 +338,9 @@ internal class DefaultLegacyWalletConnectRepository(
optionalNamespace.key to Wallet.Model.Namespace.Session(
accounts = accountsOptional.distinct(),
methods = methods,
chains = userChains.keys.toList(),
chains = userChains.keys
.filter { it.startsWith(optionalNamespace.key) }
.toList(),
events = optionalNamespace.value.events,
)
}

View file

@ -155,8 +155,8 @@ class WalletConnectInteractor(
return@onEach
}
val networksFormatted = (wcEvent.requiredChainIds + wcEvent.optionalChainIds)
.distinct()
.mapNotNull { blockchainHelper.chainIdToFullNameOrNull(it) }
.distinct()
.toString()
handler.onProposalReceived(proposal = wcEvent, networksFormatted = networksFormatted)
}

View file

@ -13,7 +13,6 @@ import com.tangem.domain.common.util.twinsIsTwinned
import com.tangem.domain.models.scan.CardDTO
import com.tangem.domain.models.scan.ProductType
import com.tangem.domain.models.scan.ScanResponse
import com.tangem.domain.settings.usercountry.models.UserCountry
import com.tangem.domain.wallets.builder.UserWalletBuilder
import com.tangem.domain.wallets.builder.UserWalletIdBuilder
import com.tangem.domain.wallets.models.UserWallet
@ -21,7 +20,6 @@ import com.tangem.tap.common.analytics.converters.ParamCardCurrencyConverter
import com.tangem.tap.common.analytics.events.AnalyticsParam
import com.tangem.tap.common.analytics.events.Onboarding
import com.tangem.tap.common.extensions.*
import com.tangem.tap.common.redux.AppDialog
import com.tangem.tap.features.demo.DemoHelper
import com.tangem.tap.features.onboarding.products.wallet.redux.BackupStartedSource
import com.tangem.tap.features.onboarding.products.wallet.redux.OnboardingWalletAction
@ -235,18 +233,7 @@ object OnboardingHelper {
val currencyType = AnalyticsParam.CurrencyType.Blockchain(blockchain)
Analytics.send(Onboarding.Topup.ButtonBuyCrypto(currencyType))
scope.launch {
val getUserCountryCodeUseCase = store.inject(DaggerGraphState::getUserCountryUseCase)
val isRussia = getUserCountryCodeUseCase.invokeSync().isRight { it is UserCountry.Russia }
val onrampFeatureToggles = store.inject(DaggerGraphState::onrampFeatureToggles)
if (isRussia && !onrampFeatureToggles.isFeatureEnabled) {
val dialogData = AppDialog.RussianCardholdersWarningDialog.Data(topUpUrl)
store.dispatchDialogShow(AppDialog.RussianCardholdersWarningDialog(dialogData))
} else {
store.dispatchOpenUrl(topUpUrl)
}
}
store.dispatchOpenUrl(topUpUrl)
}
private suspend fun proceedWithScanResponse(

View file

@ -6,15 +6,16 @@ import com.tangem.common.routing.AppRoute
import com.tangem.common.routing.AppRouter
import com.tangem.core.analytics.Analytics
import com.tangem.domain.onramp.model.OnrampSource
import com.tangem.domain.settings.usercountry.models.UserCountry
import com.tangem.domain.tokens.legacy.TradeCryptoAction
import com.tangem.domain.tokens.model.CryptoCurrency
import com.tangem.domain.tokens.model.NetworkAddress
import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.tap.common.analytics.events.Token
import com.tangem.tap.common.apptheme.MutableAppThemeModeHolder
import com.tangem.tap.common.extensions.*
import com.tangem.tap.common.redux.AppDialog
import com.tangem.tap.common.extensions.dispatchDebugErrorNotification
import com.tangem.tap.common.extensions.dispatchNavigationAction
import com.tangem.tap.common.extensions.dispatchOpenUrl
import com.tangem.tap.common.extensions.inject
import com.tangem.tap.common.redux.AppState
import com.tangem.tap.features.demo.DemoHelper
import com.tangem.tap.network.exchangeServices.CurrencyExchangeManager
@ -89,19 +90,6 @@ object TradeCryptoMiddleware {
)
scope.launch {
val getUserCountryCodeUseCase = store.inject(DaggerGraphState::getUserCountryUseCase)
val onrampFeatureToggles = store.inject(DaggerGraphState::onrampFeatureToggles)
val isRussia = getUserCountryCodeUseCase.invokeSync().isRight { it is UserCountry.Russia }
if (action.checkUserLocation && isRussia && !onrampFeatureToggles.isFeatureEnabled) {
val dialogData = topUrl?.let {
AppDialog.RussianCardholdersWarningDialog.Data(topUpUrl = it)
}
store.dispatchDialogShow(AppDialog.RussianCardholdersWarningDialog(data = dialogData))
return@launch
}
if (currency is CryptoCurrency.Token && currency.network.isTestnet) {
val walletManager = store.inject(DaggerGraphState::walletManagersFacade)
.getOrCreateWalletManager(

View file

@ -1,114 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/background_primary"
android:minHeight="420dp"
tools:layout_gravity="bottom">
<ImageView
android:id="@+id/iv_flag"
android:layout_width="68dp"
android:layout_height="68dp"
android:contentDescription="@null"
android:src="@drawable/img_flag_ru_24"
app:layout_constraintBottom_toTopOf="@id/tv_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<View
android:id="@+id/view_cross_outline"
android:layout_width="32dp"
android:layout_height="32dp"
android:background="@drawable/shape_circle"
android:backgroundTint="@color/background_primary"
app:layout_constraintBottom_toBottomOf="@id/iv_cross"
app:layout_constraintEnd_toEndOf="@id/iv_cross"
app:layout_constraintStart_toStartOf="@id/iv_cross"
app:layout_constraintTop_toTopOf="@id/iv_cross" />
<ImageView
android:id="@+id/iv_cross"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_marginEnd="-4dp"
android:layout_marginBottom="-4dp"
android:background="@drawable/shape_circle"
android:backgroundTint="#FFEBEE"
android:contentDescription="@null"
android:scaleType="center"
android:src="@drawable/ic_cross_rounded_24"
app:layout_constraintBottom_toBottomOf="@id/iv_flag"
app:layout_constraintEnd_toEndOf="@id/iv_flag"
app:tint="#D80027" />
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="38dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="38dp"
android:text="@string/russian_bank_card_warning_title"
android:textAlignment="center"
android:textColor="@color/text_primary_1"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@id/tv_description"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_flag" />
<TextView
android:id="@+id/tv_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="38dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="38dp"
android:layout_marginBottom="38dp"
android:text="@string/russian_bank_card_warning_subtitle"
android:textAlignment="center"
android:textColor="@color/text_primary_1"
android:textSize="14sp"
app:layout_constraintBottom_toTopOf="@id/btn_yes"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintVertical_bias="0" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_yes"
style="@style/TapPrimaryButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="6dp"
android:layout_marginBottom="38dp"
android:backgroundTint="@color/button_primary"
android:text="@string/common_yes"
android:textColor="@color/text_primary_2"
app:cornerRadius="14dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/btn_no"
app:layout_constraintStart_toStartOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_no"
style="@style/TapPrimaryButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="16dp"
android:backgroundTint="@color/button_secondary"
android:text="@string/common_no"
android:textColor="@color/text_primary_1"
app:cornerRadius="14dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_yes"
app:layout_constraintTop_toTopOf="@id/btn_yes" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -11,20 +11,8 @@
"name": "NEXA/test",
"version": "undefined"
},
{
"name": "fact0rn",
"version": "undefined"
},
{
"name": "vanar-chain",
"version": "undefined"
},
{
"name": "bitrock",
"version": "undefined"
},
{
"name": "odyssey",
"version": "undefined"
}
]

View file

@ -40,6 +40,7 @@ internal object NetworkModule {
private const val PROD_V2_TANGEM_TECH_BASE_URL = "https://api.tangem-tech.com/v2/"
private const val TANGEM_TECH_MARKETS_SERVICE_TIMEOUT_SECONDS = 60L
private const val STAKE_KIT_API_TIMEOUT_SECONDS = 60L
@Provides
@Singleton
@ -89,6 +90,12 @@ internal object NetworkModule {
moshi = moshi,
context = context,
apiConfigsManager = apiConfigsManager,
timeouts = Timeouts(
callTimeoutSeconds = STAKE_KIT_API_TIMEOUT_SECONDS,
connectTimeoutSeconds = STAKE_KIT_API_TIMEOUT_SECONDS,
readTimeoutSeconds = STAKE_KIT_API_TIMEOUT_SECONDS,
writeTimeoutSeconds = STAKE_KIT_API_TIMEOUT_SECONDS,
),
clientBuilder = {
addInterceptor(
NetworkLogsSaveInterceptor(appLogsStore),
@ -262,6 +269,7 @@ internal object NetworkModule {
moshi: Moshi,
context: Context,
apiConfigsManager: ApiConfigsManager,
timeouts: Timeouts = Timeouts(),
clientBuilder: OkHttpClient.Builder.() -> OkHttpClient.Builder = { this },
): T {
val environmentConfig = apiConfigsManager.getEnvironmentConfig(id)
@ -273,6 +281,23 @@ internal object NetworkModule {
.client(
OkHttpClient.Builder()
.applyApiConfig(id, apiConfigsManager)
.applyTimeoutAnnotations()
.let { builder ->
var b = builder
if (timeouts.callTimeoutSeconds != null) {
b = b.callTimeout(timeouts.callTimeoutSeconds, TimeUnit.SECONDS)
}
if (timeouts.connectTimeoutSeconds != null) {
b = b.connectTimeout(timeouts.connectTimeoutSeconds, TimeUnit.SECONDS)
}
if (timeouts.readTimeoutSeconds != null) {
b = b.readTimeout(timeouts.readTimeoutSeconds, TimeUnit.SECONDS)
}
if (timeouts.writeTimeoutSeconds != null) {
b = b.writeTimeout(timeouts.writeTimeoutSeconds, TimeUnit.SECONDS)
}
b
}
.addLoggers(context)
.clientBuilder()
.build(),

View file

@ -655,8 +655,6 @@
<string name="reset_card_without_backup_to_factory_message">Beim Zurücksetzen auf die Werkseinstellungen wird die Wallet der ausgewählten Karte oder Ring vollständig gelöscht und aus der App entfernt. Es ist nicht möglich, die aktuelle Wallet wiederherzustellen.</string>
<string name="ring_promo_text">Ringbesitzer erhalten bis zum 15.11. 3 provisionsfreie Swaps auf Changelly!</string>
<string name="ring_promo_title">Jetzt mit 0 %% Gebühren tauschen!</string>
<string name="russian_bank_card_warning_subtitle">Besitzt du eine Bankkarte aus einem anderen Land und eine Aufenthaltserlaubnis oder Registrierung außerhalb der Russischen Föderation?</string>
<string name="russian_bank_card_warning_title">Russische Bankkarten werden derzeit nicht akzeptiert</string>
<string name="save_user_wallet_agreement_access_description">Melde dich bei der App an und überprüfe dein Guthaben, ohne die Karte oder Ring zu scannen</string>
<string name="save_user_wallet_agreement_access_title">Zugriff auf die App</string>
<string name="save_user_wallet_agreement_allow_biometrics">Nutzung biometrischer Daten zulassen</string>

View file

@ -653,8 +653,6 @@
<string name="reset_card_without_backup_to_factory_message">El restablecimiento de fábrica eliminará completamente la billetera de la tarjeta seleccionada y lo eliminará de la app. No podrá restaurar la billetera actual.</string>
<string name="ring_promo_text">Si tienes un Anillo Tangem, ¡3 swaps sin comisión en Changelly hasta el 15/11!</string>
<string name="ring_promo_title">¡Intercambia con 0%% de comisión!</string>
<string name="russian_bank_card_warning_subtitle">¿Tiene una tarjeta bancaria de otro país y un permiso de residencia o registro fuera de la Federación Rusa?</string>
<string name="russian_bank_card_warning_title">Las tarjetas bancarias rusas no se aceptan actualmente</string>
<string name="save_user_wallet_agreement_access_description">Inicie sesión en la app y comprueba su saldo sin escanear la tarjeta</string>
<string name="save_user_wallet_agreement_access_title">Acceder a la app</string>
<string name="save_user_wallet_agreement_allow_biometrics">Permitir el uso de biometría</string>

View file

@ -655,8 +655,6 @@
<string name="reset_card_without_backup_to_factory_message">La réinitialisation aux paramètres d\'usine supprimera complètement le portefeuille de la carte sélectionnée et le supprimera de l\'application. Vous ne pourrez pas restaurer le portefeuille actuel.</string>
<string name="ring_promo_text">Les propriétaires du Tangem Ring ont droit à 3 swap gratis sur Changelly jusqu\'au 15/11 !</string>
<string name="ring_promo_title">Échangez avec 0 %% de frais !</string>
<string name="russian_bank_card_warning_subtitle">Avez-vous une carte bancaire d\'un autre pays et un permis de séjour ou une inscription en dehors de la Fédération de Russie ?</string>
<string name="russian_bank_card_warning_title">Les cartes bancaires russes ne sont actuellement pas acceptées</string>
<string name="save_user_wallet_agreement_access_description">Connectez-vous à l\'application et vérifiez votre solde sans scanner la carte</string>
<string name="save_user_wallet_agreement_access_title">Accéder à l\'application</string>
<string name="save_user_wallet_agreement_allow_biometrics">Autoriser l\'utilisation de la biométrie</string>

View file

@ -645,8 +645,6 @@
<string name="reset_card_without_backup_to_factory_message">工場出荷時の状態にリセットすると、選択したカードやリングからウォレットが完全に削除され、アプリから削除されます。現在のウォレットを復元することはできません。</string>
<string name="ring_promo_text">Tangem Ringユーザーは、11/15日までChangelly経由でスワップを3回手数料ゼロで行えます</string>
<string name="ring_promo_title">今すぐ手数料0%%でスワップしましょう!</string>
<string name="russian_bank_card_warning_subtitle">他の国の銀行カードと、ロシア連邦外での居住許可証または登録をお持ちですか?</string>
<string name="russian_bank_card_warning_title">ロシアの銀行カードは現在ご利用いただけません</string>
<string name="save_user_wallet_agreement_access_description">アプリにログインして、カードまたはリングをスキャンせずに残高を確認できます</string>
<string name="save_user_wallet_agreement_access_title">アプリにアクセスする</string>
<string name="save_user_wallet_agreement_allow_biometrics">生体認証の使用を許可する</string>

View file

@ -673,8 +673,6 @@
<string name="reset_card_without_backup_to_factory_message">Сброс к заводским настройкам приведет к полному удалению кошелька с выбранной карты или кольца. Вы не сможете восстановить текущий кошелек.</string>
<string name="ring_promo_text">Владельцам колец — 3 обмена без комиссии на Changelly до 15.11!</string>
<string name="ring_promo_title">Обмен с 0%% комиссией!</string>
<string name="russian_bank_card_warning_subtitle">У вас есть карта банка другой страны, а также вид на жительство или регистрация вне РФ?</string>
<string name="russian_bank_card_warning_title">Карты банков РФ в данный момент не принимаются</string>
<string name="save_user_wallet_agreement_access_description">Войдите в приложение и следите за своим балансом без сканирования карты или кольца</string>
<string name="save_user_wallet_agreement_access_title">Доступ в приложение</string>
<string name="save_user_wallet_agreement_allow_biometrics">Использовать биометрию</string>

View file

@ -673,8 +673,6 @@
<string name="reset_card_without_backup_to_factory_message">Скидання до заводських налаштувань призведе до повного видалення гаманця з обраної картки або кільця. Ви не зможете відновити поточний гаманець.</string>
<string name="ring_promo_text">Власникам кілець - 3 обміни без комісії на Changelly до 15.11!</string>
<string name="ring_promo_title">Обмін з 0%% комісією!</string>
<string name="russian_bank_card_warning_subtitle">У вас є банківська картка іншої країни та посвідка на проживання або реєстрація за межами Російської Федерації?</string>
<string name="russian_bank_card_warning_title">Російські банківські картки наразі не приймаються</string>
<string name="save_user_wallet_agreement_access_description">Увійдіть у додаток та слідкуйте за своїм балансом без сканування картки чи кільця</string>
<string name="save_user_wallet_agreement_access_title">Доступ до додатку</string>
<string name="save_user_wallet_agreement_allow_biometrics">Використовувати біометрію</string>

View file

@ -237,7 +237,6 @@
<string name="reset_card_to_factory_condition_1">我了解執行此操作後,我將無法再訪問當前錢包</string>
<string name="reset_card_with_backup_to_factory_message">恢復原廠設置將從所選卡中完全刪除錢包。您將無法恢復當前錢包或使用卡恢復訪問密碼</string>
<string name="reset_card_without_backup_to_factory_message">恢復原廠設置將從所選卡中完全刪除錢包並將其從應用程序中刪除。您將無法恢復當前錢包</string>
<string name="russian_bank_card_warning_title">目前不接受俄羅斯銀行卡</string>
<string name="save_user_wallet_agreement_access_description">登錄應用程序並在不掃描卡片的情況下檢查您的資產</string>
<string name="save_user_wallet_agreement_access_title">訪問應用程序</string>
<string name="save_user_wallet_agreement_allow_biometrics">允許使用生物辨識</string>

View file

@ -655,8 +655,6 @@
<string name="reset_card_without_backup_to_factory_message">Factory Reset will completely delete the wallet from the selected card or ring and remove it from the app. You will not be able to restore the current wallet.</string>
<string name="ring_promo_text">Ring owners get 3 commission-free swaps on Changelly until 15.11!</string>
<string name="ring_promo_title">Swap With 0%% Fees Now!</string>
<string name="russian_bank_card_warning_subtitle">Do you have a bank card from another country and a residence permit or registration outside the Russian Federation?</string>
<string name="russian_bank_card_warning_title">Russian bank cards are not currently accepted</string>
<string name="save_user_wallet_agreement_access_description">Log into the app and check your balance without scanning the card or ring</string>
<string name="save_user_wallet_agreement_access_title">Access the app</string>
<string name="save_user_wallet_agreement_allow_biometrics">Allow to use biometrics</string>

View file

@ -417,16 +417,16 @@ internal class DefaultCurrenciesRepository(
}
}
override suspend fun getFeePaidCurrency(userWalletId: UserWalletId, currency: CryptoCurrency): FeePaidCurrency {
override suspend fun getFeePaidCurrency(userWalletId: UserWalletId, network: Network): FeePaidCurrency {
return withContext(dispatchers.io) {
val blockchain = Blockchain.fromId(currency.network.id.value)
val blockchain = Blockchain.fromId(network.id.value)
when (val feePaidCurrency = blockchain.feePaidCurrency()) {
FeePaidSdkCurrency.Coin -> FeePaidCurrency.Coin
FeePaidSdkCurrency.SameCurrency -> FeePaidCurrency.SameCurrency
is FeePaidSdkCurrency.Token -> {
val balance = walletManagersFacade.tokenBalance(
userWalletId = userWalletId,
network = currency.network,
network = network,
name = feePaidCurrency.token.name,
symbol = feePaidCurrency.token.symbol,
contractAddress = feePaidCurrency.token.contractAddress,
@ -434,7 +434,7 @@ internal class DefaultCurrenciesRepository(
id = feePaidCurrency.token.id,
)
FeePaidCurrency.Token(
tokenId = getTokenId(network = currency.network, sdkToken = feePaidCurrency.token),
tokenId = getTokenId(network = network, sdkToken = feePaidCurrency.token),
name = feePaidCurrency.token.name,
symbol = feePaidCurrency.token.symbol,
contractAddress = feePaidCurrency.token.contractAddress,

View file

@ -34,7 +34,7 @@ class GetBalanceNotEnoughForFeeWarningUseCase(
coinStatus: CryptoCurrencyStatus,
): Either<Throwable, CryptoCurrencyWarning?> = Either.catch {
withContext(dispatchers.io) {
val feePaidCurrency = currenciesRepository.getFeePaidCurrency(userWalletId, tokenStatus.currency)
val feePaidCurrency = currenciesRepository.getFeePaidCurrency(userWalletId, tokenStatus.currency.network)
val coinBalance = coinStatus.value.amount ?: BigDecimal.ZERO
val isFeePaidByCoin = tokenStatus.currency is CryptoCurrency.Token

View file

@ -115,7 +115,7 @@ class GetCurrencyWarningsUseCase(
coinStatus: CryptoCurrencyStatus,
tokenStatus: CryptoCurrencyStatus,
): CryptoCurrencyWarning? {
val feePaidCurrency = currenciesRepository.getFeePaidCurrency(userWalletId, tokenStatus.currency)
val feePaidCurrency = currenciesRepository.getFeePaidCurrency(userWalletId, tokenStatus.currency.network)
val isNetworkFeeZero = currenciesRepository.isNetworkFeeZero(userWalletId, tokenStatus.currency.network)
return when {
feePaidCurrency is FeePaidCurrency.Coin &&

View file

@ -26,7 +26,8 @@ class GetFeePaidCryptoCurrencyStatusSyncUseCase(
cryptoCurrencyStatus: CryptoCurrencyStatus,
): Either<TokenListError, CryptoCurrencyStatus?> {
val cryptoCurrency = cryptoCurrencyStatus.currency
val feePaidCurrency = currenciesRepository.getFeePaidCurrency(userWalletId, cryptoCurrency)
val network = cryptoCurrency.network
val feePaidCurrency = currenciesRepository.getFeePaidCurrency(userWalletId, network)
val operations = CurrenciesStatusesOperations(
userWalletId = userWalletId,
currenciesRepository = currenciesRepository,
@ -39,7 +40,7 @@ class GetFeePaidCryptoCurrencyStatusSyncUseCase(
when (feePaidCurrency) {
FeePaidCurrency.Coin ->
operations
.getNetworkCoinSync(cryptoCurrency.network.id, cryptoCurrency.network.derivationPath)
.getNetworkCoinSync(network.id, network.derivationPath)
.getOrNull()
FeePaidCurrency.SameCurrency,
is FeePaidCurrency.FeeResource,

View file

@ -19,7 +19,7 @@ class IsAmountSubtractAvailableUseCase(
suspend operator fun invoke(userWalletId: UserWalletId, currency: CryptoCurrency): Either<Throwable, Boolean> =
Either.catch {
withContext(dispatchers.io) {
when (val feeCurrency = currenciesRepository.getFeePaidCurrency(userWalletId, currency)) {
when (val feeCurrency = currenciesRepository.getFeePaidCurrency(userWalletId, currency.network)) {
is FeePaidCurrency.Coin -> currency is CryptoCurrency.Coin
is FeePaidCurrency.SameCurrency -> true
is FeePaidCurrency.Token -> currency.id == feeCurrency.tokenId

View file

@ -231,9 +231,9 @@ interface CurrenciesRepository {
): Boolean
/**
* Retrieves fee paid currency for specific [currency].
* Retrieves fee paid currency for specific [network].
*/
suspend fun getFeePaidCurrency(userWalletId: UserWalletId, currency: CryptoCurrency): FeePaidCurrency
suspend fun getFeePaidCurrency(userWalletId: UserWalletId, network: Network): FeePaidCurrency
/**
* Creates token [cryptoCurrency] based on current token and [network] it`s will be added

View file

@ -137,7 +137,7 @@ internal class MockCurrenciesRepository(
return false
}
override suspend fun getFeePaidCurrency(userWalletId: UserWalletId, currency: CryptoCurrency): FeePaidCurrency {
override suspend fun getFeePaidCurrency(userWalletId: UserWalletId, network: Network): FeePaidCurrency {
return FeePaidCurrency.Coin
}

View file

@ -96,7 +96,12 @@ internal class SendNotificationFactory(
val recipientAddress = state.recipientState?.addressTextField?.value
val statusValue = cryptoCurrencyStatus.value as? CryptoCurrencyStatus.Loaded
val balanceAfterTransaction = statusValue?.let { it.amount - sendingAmount - feeValue }
val feeToSubtract = if (isSubtractAvailableProvider()) {
feeValue
} else {
BigDecimal.ZERO
}
val balanceAfterTransaction = statusValue?.let { it.amount - sendingAmount - feeToSubtract }
val currencyCheck = getCurrencyCheckUseCase(
userWalletId = userWalletId,
currencyStatus = cryptoCurrencyStatus,

View file

@ -1321,13 +1321,13 @@ internal class SwapInteractorImpl @AssistedInject constructor(
amount.value > reducedBalance -> {
IncludeFeeInAmount.BalanceNotEnough
}
amountWithFee < reducedBalance -> {
amountWithFee <= reducedBalance -> {
IncludeFeeInAmount.Excluded
}
else -> {
if (feeValue < amount.value) {
IncludeFeeInAmount.Included(
SwapAmount(
amountSubtractFee = SwapAmount(
reducedBalance - feeValue,
getNativeToken(fromToken.network.backendId).decimals,
),
@ -1992,7 +1992,7 @@ internal class SwapInteractorImpl @AssistedInject constructor(
private suspend fun getFeePaidCurrency(currency: CryptoCurrency): FeePaidCurrency {
return currenciesRepository.getFeePaidCurrency(
userWalletId = userWalletId,
currency = currency,
network = currency.network,
)
}

View file

@ -70,8 +70,8 @@ zxingQrCode = "3.5.1"
mviCore = "1.3.1"
kotlinSerialization = "1.4.1"
arrow = "1.2.3"
reownCore = "1.0.2"
reownWeb3 = "1.0.2"
reownCore = "1.1.2"
reownWeb3 = "1.1.2"
prettyLogger = "2.2.0"
okHttp-prettyLogging = "3.1.0"
chucker = "4.0.0"
@ -88,7 +88,7 @@ markdownComposeView = "0.5.4"
# endregion Other libraries
# region Tangem
tangemBlockchainSdk = "release-app_5.20-909"
tangemBlockchainSdk = "release-app_5.20-915"
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "release-app_5.20-423"
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^