diff --git a/app/src/main/java/com/tangem/tap/MainActivity.kt b/app/src/main/java/com/tangem/tap/MainActivity.kt index 0ef437226d..8db7434ef7 100644 --- a/app/src/main/java/com/tangem/tap/MainActivity.kt +++ b/app/src/main/java/com/tangem/tap/MainActivity.kt @@ -302,7 +302,9 @@ class MainActivity : AppCompatActivity(), ActivityResultCallbackHolder { } private fun createAppThemeModeFlow(): SharedFlow { - val tangemApplication = application as TangemApplication + val tangemApplication = requireNotNull(application as? TangemApplication) { + "Application is null" + } return tangemApplication.getAppThemeModeUseCase() .filterNotNull() diff --git a/app/src/main/java/com/tangem/tap/common/pushes/PushNotificationDelegate.kt b/app/src/main/java/com/tangem/tap/common/pushes/PushNotificationDelegate.kt index a04f41db40..cde6e78a86 100644 --- a/app/src/main/java/com/tangem/tap/common/pushes/PushNotificationDelegate.kt +++ b/app/src/main/java/com/tangem/tap/common/pushes/PushNotificationDelegate.kt @@ -54,8 +54,8 @@ class PushNotificationDelegate(private val context: Context) { .setContentIntent(pendingIntent) .setVibrate(vibratePattern) .apply { - imageUrl?.let { uri -> - val bitmap = getBitmapImageFromUrl(uri) + if (imageUrl != null) { + val bitmap = getBitmapImageFromUrl(imageUrl) setStyle( NotificationCompat .BigPictureStyle() @@ -64,7 +64,10 @@ class PushNotificationDelegate(private val context: Context) { } } - val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager + val service = context.getSystemService(Context.NOTIFICATION_SERVICE) + val notificationManager = requireNotNull(service as? NotificationManager) { + "NotificationManager not available" + } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val notificationChannel = NotificationChannel( diff --git a/app/src/main/java/com/tangem/tap/common/redux/AppReducer.kt b/app/src/main/java/com/tangem/tap/common/redux/AppReducer.kt index 6099bad60a..71fcd29497 100644 --- a/app/src/main/java/com/tangem/tap/common/redux/AppReducer.kt +++ b/app/src/main/java/com/tangem/tap/common/redux/AppReducer.kt @@ -6,6 +6,7 @@ import com.tangem.tap.features.welcome.redux.WelcomeReducer import com.tangem.tap.proxy.redux.DaggerGraphReducer import org.rekotlin.Action +@Suppress("CanBeNonNullable") fun appReducer(action: Action, state: AppState?): AppState { requireNotNull(state) if (action is AppAction.RestoreState) return action.state diff --git a/app/src/main/java/com/tangem/tap/common/redux/legacy/LegacyMiddleware.kt b/app/src/main/java/com/tangem/tap/common/redux/legacy/LegacyMiddleware.kt index 637030995e..c847cb4a50 100644 --- a/app/src/main/java/com/tangem/tap/common/redux/legacy/LegacyMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/common/redux/legacy/LegacyMiddleware.kt @@ -18,6 +18,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.* import org.rekotlin.Middleware +@Suppress("MemberNameEqualsClassName") internal object LegacyMiddleware { private val prepareDetailsScreenJobHolder = JobHolder() diff --git a/app/src/main/java/com/tangem/tap/di/HapticModule.kt b/app/src/main/java/com/tangem/tap/di/HapticModule.kt index dc04a3ce72..3db66d0e6e 100644 --- a/app/src/main/java/com/tangem/tap/di/HapticModule.kt +++ b/app/src/main/java/com/tangem/tap/di/HapticModule.kt @@ -4,9 +4,9 @@ import android.content.Context import android.os.Build import android.os.Vibrator import android.os.VibratorManager -import com.tangem.tap.common.haptic.DefaultVibratorHapticManager import com.tangem.core.ui.haptic.TangemHapticEffect import com.tangem.core.ui.haptic.VibratorHapticManager +import com.tangem.tap.common.haptic.DefaultVibratorHapticManager import dagger.Module import dagger.Provides import dagger.hilt.InstallIn @@ -22,10 +22,14 @@ class HapticModule { @Singleton fun provideHapticManager(@ApplicationContext context: Context): VibratorHapticManager { val vibrator = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { - val vibratorManager = context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager + val service = context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) + val vibratorManager = requireNotNull(service as? VibratorManager) { + "VibratorManager not available" + } vibratorManager.defaultVibrator } else { - context.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator + val service = context.getSystemService(Context.VIBRATOR_SERVICE) + requireNotNull(service as? Vibrator) { "Vibrator service not available" } } return if (vibrator.hasVibrator()) { diff --git a/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt b/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt index 76f033a638..72762cb7a0 100644 --- a/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/TapWalletManager.kt @@ -30,7 +30,7 @@ class TapWalletManager( // ensuring that only one job is active at any given time. loadUserWalletDataJob = CoroutineScope(dispatchers.io) .launch { loadUserWalletData(userWallet) } - .also { it.join() } + .apply { join() } } private suspend fun loadUserWalletData(userWallet: UserWallet) { diff --git a/app/src/main/java/com/tangem/tap/domain/scanCard/LegacyScanProcessor.kt b/app/src/main/java/com/tangem/tap/domain/scanCard/LegacyScanProcessor.kt index 06178511a5..ac18c8b943 100644 --- a/app/src/main/java/com/tangem/tap/domain/scanCard/LegacyScanProcessor.kt +++ b/app/src/main/java/com/tangem/tap/domain/scanCard/LegacyScanProcessor.kt @@ -120,16 +120,14 @@ internal class LegacyScanProcessor @Inject constructor( } } - private fun sendAnalytics(analyticsEvent: AnalyticsEvent?, scanResponse: ScanResponse) { - analyticsEvent?.let { event -> - // this workaround needed to send CardWasScannedEvent without adding a context - val interceptor = CardContextInterceptor(scanResponse) - val params = event.params.toMutableMap() - interceptor.intercept(params) - event.params = params.toMap() + private fun sendAnalytics(analyticsEvent: AnalyticsEvent, scanResponse: ScanResponse) { + // this workaround needed to send CardWasScannedEvent without adding a context + val interceptor = CardContextInterceptor(scanResponse) + val params = analyticsEvent.params.toMutableMap() + interceptor.intercept(params) + analyticsEvent.params = params.toMap() - Analytics.send(event) - } + Analytics.send(analyticsEvent) } // TODO: [REDACTED_JIRA] diff --git a/app/src/main/java/com/tangem/tap/domain/sdk/impl/DefaultTangemSdkManager.kt b/app/src/main/java/com/tangem/tap/domain/sdk/impl/DefaultTangemSdkManager.kt index 32f0e5b105..89c571cd1e 100644 --- a/app/src/main/java/com/tangem/tap/domain/sdk/impl/DefaultTangemSdkManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/sdk/impl/DefaultTangemSdkManager.kt @@ -23,11 +23,7 @@ import com.tangem.domain.card.repository.CardSdkConfigRepository import com.tangem.domain.models.scan.CardDTO import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.models.wallet.UserWalletId -import com.tangem.domain.visa.model.TangemPayInitialCredentials -import com.tangem.domain.visa.model.VisaActivationInput -import com.tangem.domain.visa.model.VisaDataForApprove -import com.tangem.domain.visa.model.VisaSignedDataByCustomerWallet -import com.tangem.domain.visa.model.sign +import com.tangem.domain.visa.model.* import com.tangem.domain.wallets.derivations.derivationStyleProvider import com.tangem.features.onboarding.v2.OnboardingV2FeatureToggles import com.tangem.operations.ScanTask @@ -82,13 +78,12 @@ internal class DefaultTangemSdkManager( secureStorage = tangemSdk.secureStorage, ) } + override val needEnrollBiometrics: Boolean + get() = tangemSdk.authenticationManager.needEnrollBiometrics override val canUseBiometry: Boolean get() = tangemSdk.authenticationManager.canAuthenticate || needEnrollBiometrics - override val needEnrollBiometrics: Boolean - get() = tangemSdk.authenticationManager.needEnrollBiometrics - override val keystoreManager: KeystoreManager get() = tangemSdk.keystoreManager diff --git a/app/src/main/java/com/tangem/tap/domain/tasks/visa/VisaCardActivationTask.kt b/app/src/main/java/com/tangem/tap/domain/tasks/visa/VisaCardActivationTask.kt index 547876b22f..27f82f9b3b 100644 --- a/app/src/main/java/com/tangem/tap/domain/tasks/visa/VisaCardActivationTask.kt +++ b/app/src/main/java/com/tangem/tap/domain/tasks/visa/VisaCardActivationTask.kt @@ -177,7 +177,7 @@ class VisaCardActivationTask @AssistedInject constructor( .getOrElse { raise(it.tangemError) } if (remoteState !is VisaActivationRemoteState.CardWalletSignatureRequired) { - return raise(VisaActivationError.WrongRemoteState.tangemError) + raise(VisaActivationError.WrongRemoteState.tangemError) } visaActivationRepository.getCardWalletAcceptanceData( diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/BiometricUserWalletsListManager.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/BiometricUserWalletsListManager.kt index ae13a2ec94..85b958f1d1 100644 --- a/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/BiometricUserWalletsListManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/BiometricUserWalletsListManager.kt @@ -36,11 +36,6 @@ internal class BiometricUserWalletsListManager( .mapLatest { it.userWallets } .distinctUntilChanged() - override val savedWalletsCount: Flow - get() = state - .mapLatest { walletsCount } - .distinctUntilChanged() - override val userWalletsSync: List get() = state.value.userWallets @@ -71,6 +66,11 @@ internal class BiometricUserWalletsListManager( override val walletsCount: Int get() = state.value.userWallets.size + override val savedWalletsCount: Flow + get() = state + .mapLatest { walletsCount } + .distinctUntilChanged() + override suspend fun unlock(type: UnlockType): CompletionResult { return unlockAndSetSelectedUserWallet(type) .mapFailure { error -> diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/RuntimeUserWalletsListManager.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/RuntimeUserWalletsListManager.kt index 31ad6301f0..8ee8847ffa 100644 --- a/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/RuntimeUserWalletsListManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/implementation/RuntimeUserWalletsListManager.kt @@ -20,11 +20,6 @@ internal class RuntimeUserWalletsListManager : UserWalletsListManager { .mapLatest { listOfNotNull(it.userWallet) } .distinctUntilChanged() - override val savedWalletsCount: Flow - get() = state - .mapLatest { walletsCount } - .distinctUntilChanged() - override val selectedUserWallet: Flow get() = state .mapLatest { it.userWallet } @@ -46,6 +41,11 @@ internal class RuntimeUserWalletsListManager : UserWalletsListManager { override val walletsCount: Int get() = if (hasUserWallets) 1 else 0 + override val savedWalletsCount: Flow + get() = state + .mapLatest { walletsCount } + .distinctUntilChanged() + override suspend fun select(userWalletId: UserWalletId): CompletionResult = catching { state.value.userWallet ?.takeIf { it.walletId == userWalletId } diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt index bc49d31e9d..3a4901f8e3 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsMiddleware.kt @@ -34,6 +34,7 @@ import org.rekotlin.Action import org.rekotlin.Middleware import timber.log.Timber +@Suppress("MemberNameEqualsClassName") class DetailsMiddleware { private val appSettingsMiddleware = AppSettingsMiddleware() val detailsMiddleware: Middleware = { _, stateProvider -> diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/BackupMiddleware.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/BackupMiddleware.kt index 2433af1e95..e0e8bd6b12 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/BackupMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/redux/BackupMiddleware.kt @@ -14,6 +14,7 @@ import com.tangem.tap.store import kotlinx.coroutines.launch import org.rekotlin.Middleware +@Suppress("MemberNameEqualsClassName") class BackupMiddleware { val backupMiddleware: Middleware = { dispatch, state -> { next -> diff --git a/app/src/main/java/com/tangem/tap/network/exchangeServices/moonpay/MoonPayService.kt b/app/src/main/java/com/tangem/tap/network/exchangeServices/moonpay/MoonPayService.kt index 0e5af5e7c0..60491ab4c7 100644 --- a/app/src/main/java/com/tangem/tap/network/exchangeServices/moonpay/MoonPayService.kt +++ b/app/src/main/java/com/tangem/tap/network/exchangeServices/moonpay/MoonPayService.kt @@ -33,12 +33,12 @@ class MoonPayService( private val userWalletProvider: () -> UserWallet?, ) : SellService { - override val initializationStatus: StateFlow - get() = _initializationStatus - private val _initializationStatus: MutableStateFlow = MutableStateFlow(value = lceLoading()) + override val initializationStatus: StateFlow + get() = _initializationStatus + private var status: MoonPayStatus? = null override suspend fun update() { diff --git a/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphMiddleware.kt b/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphMiddleware.kt index ee884e4e2a..0e822a4edc 100644 --- a/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/proxy/redux/DaggerGraphMiddleware.kt @@ -3,6 +3,7 @@ package com.tangem.tap.proxy.redux import com.tangem.tap.common.redux.AppState import org.rekotlin.Middleware +@Suppress("MemberNameEqualsClassName") object DaggerGraphMiddleware { val daggerGraphMiddleware: Middleware = { _, _ -> { next -> diff --git a/core/res/src/main/res/values-de/strings.xml b/core/res/src/main/res/values-de/strings.xml index ddf5455028..7ada2a897d 100644 --- a/core/res/src/main/res/values-de/strings.xml +++ b/core/res/src/main/res/values-de/strings.xml @@ -1191,9 +1191,9 @@ Gebühr für das Staking-Konto Ein Staking-Konto ist ein spezielles Konto, auf dem eingesetzte SOL-Token gespeichert werden. Es wird erstellt, indem Sie Ihre Token an einen Validator delegieren, um an der Transaktionsvalidierung teilzunehmen und Belohnungen zu erhalten. Für die Einrichtung des Staking-Kontos wird eine geringe Gebühr erhoben, die nach Abschluss des Stakings zurückerstattet wird. Jährliche prozentuale Rendite - Die jährliche prozentuale Rendite, die du durch die Teilnahme am Staking erzielen kannst. + APR: Zeigt den Zinssatz, den Sie in einem Jahr ohne Zinseszins verdienen könnten. Die verdienten Zinsen werden nicht zu Ihrem Kontostand hinzugefügt, sodass Sie auf diese Zinsen keine zusätzlichen Zinsen erhalten. Jährlicher prozentualer Ertrag - APY zeigt den jährlichen prozentualen Ertrag des Validators basierend auf seiner Leistung + APY: Zeigt die gesamten Zinsen, die Sie in einem Jahr mit Zinseszins verdienen könnten. Zinseszins bedeutet, dass die verdienten Zinsen Ihrem Kontostand hinzugefügt werden, sodass Sie auch auf diese Zinsen Zinsen erhalten. Effektiver Jahreszins APY Belohnungen sammeln sich täglich automatisch in deinem Staking-Konto an. @@ -1884,6 +1884,7 @@ Deine%s ist in Aave hinterlegt Chart konnte nicht geladen werden... Das Bereitstellen von %1$s %2$s bei Aave steht aus. + Deaktiviere den Yield-Modus APY %1$s%% Verfügbar Aktueller effektiver Jahreszins @@ -1912,11 +1913,12 @@ Prüfe Deine Netzwerkverbindung Informationen zu den Netzwerkgebühren nicht erreichbar Jede Einzahlung, die Du tätigst, wird automatisch an Aave weitergeleitet. + Alle %1$s auf Ihrem Konto werden automatisch an Aave bereitgestellt. Automatische Übertragung zu Aave Senden, tauschen oder verkaufen Deine Gelder sofort, wann immer Du willst. - Jederzeit Zugriff auf Dein Geld + Sofort verfügbar Wie funktioniert das? - Aave ist ein dezentrales Protokoll, das ein Gesamtvermögen von über 61 Milliarden Dollar verwaltet. + Aave ist ein On-Chain-Protokoll zur Erstellung von nicht-kustodialen Liquiditätsmärkten, um Zinsen mit variablem Satz zu verdienen. Dezentral und selbstverwahrend Durch die Nutzung dieses Dienstes erklärst Du Dich mit provider\n%1$s und %2$s einverstanden Mit Aave verbinden @@ -1932,11 +1934,12 @@ Dein %s wird an Aave übermittelt, bleibt aber verwaltbar. Siehe Gebührenrichtlinie Deine nächste Aufladung wird automatisch an Aave weitergeleitet. + Alle Ihre zukünftigen eingehenden %1$s-Einlagen werden automatisch an Aave bereitgestellt. Aktiv Pausiert Deaktiviere den Yield-Modus Wenn Du diese Option deaktivierst, werden Deine Vermögenswerte von Aave abgezogen, in Deiner Wallet wieder in %s umgewandelt und die Zinsgutschrift gestoppt. - Die Netzwerkgebühr wird von dem Betrag, den Du abhebst, abgezogen. + Eine Netzwerkgebühr wird von der Blockchain erhoben, wenn Sie den Yield-Modus verlassen. Deaktiviere den Yield-Modus Angebot Effektiver Jahreszins für Versorgung diff --git a/core/res/src/main/res/values-es/strings.xml b/core/res/src/main/res/values-es/strings.xml index 1a1ad0aad3..d036fbae09 100644 --- a/core/res/src/main/res/values-es/strings.xml +++ b/core/res/src/main/res/values-es/strings.xml @@ -985,8 +985,8 @@ Tarifa de staking de la cuenta Una cuenta de staking es una cuenta especial donde se almacenan los tokens SOL de staking. Se crea cuando delegas sus tokens a un validador para participar en la validación de transacciones y ganar recompensas. Se cobra una pequeña tarifa por crear la cuenta de staking, que se devuelve una vez que se completa el staking. Porcentaje de rendimiento anual - El porcentaje de rendimiento anual que podrá ganar como participante en el staking. - APY muestra el porcentaje de rendimiento anual del validador en función de su rendimiento + APR: Muestra el interés que podrías ganar en un año sin capitalización. Los intereses ganados no se añaden a tu saldo, por lo que no ganas intereses adicionales sobre ellos. + APY: Muestra el total de intereses que podrías ganar en un año con capitalización. La capitalización significa que los intereses ganados se añaden a tu saldo, por lo que también ganas intereses sobre esos intereses. APR APY Las recompensas se acumulan automáticamente en su saldo de staking diariamente. @@ -1076,6 +1076,7 @@ Mensual Semanal Recompensas + Las recompensas en Solana se agregan automáticamente a tu saldo de staking y no pueden mostrarse por separado. El stake está bloqueado Hacer más staking Al hacer staking de %1$s, se realiza sobre todo su saldo de %2$s. Cualquier %2$s adicional que deposite en su billetera Tangem también se pondrá en staking automáticamente. @@ -1499,6 +1500,7 @@ Su %s está depositado en Aave No se puede cargar el gráfico... El suministro de %1$s %2$s a Aave está pendiente. + Desactivar el modo de rendimiento APY %1$s%% Disponible APY actual @@ -1527,11 +1529,12 @@ Compruebe su conexión de red Información de tarifas de red inaccesible Cada depósito que realice se suministrará a Aave automáticamente. + Todos los %1$s en tu cuenta se suministrarán automáticamente a Aave. Transferencia automática a Aave Envíe, intercambie o venda sus fondos al instante, cuando quiera. - Acceda a sus fondos en cualquier momento + Acceso inmediato ¿Cómo funciona? - Aave es un protocolo descentralizado que administra más de 61 billones de dólares en valor total. + Aave es un protocolo on-chain para crear mercados de liquidez no custodiales y ganar intereses a tasa variable. Descentralizado y autocustodiado Al utilizar este servicio, usted acepta que el proveedor\n%1$s y %2$s Conectar Aave @@ -1547,11 +1550,12 @@ Su %s se suministrará a Aave, pero seguirá siendo gestionable. Ver política de tarifas Sus próximas recargas se suministrarán automáticamente a Aave. + Todos tus futuros depósitos %1$s se suministrarán automáticamente a Aave. Activo En pausa Desactivación del modo de rendimiento Al desactivar esto, retirará sus fondos de Aave a %s en su billetera y dejará de ganar recompensas. - La comisión de red se deducirá del importe que retire. + Se cobra una comisión de red por la blockchain al salir del modo Yield. Desactivar el modo de rendimiento Suministrar Suministro APY diff --git a/core/res/src/main/res/values-fr/strings.xml b/core/res/src/main/res/values-fr/strings.xml index 2a30362217..bdf1ca0a6b 100644 --- a/core/res/src/main/res/values-fr/strings.xml +++ b/core/res/src/main/res/values-fr/strings.xml @@ -959,7 +959,8 @@ Frais de staking du compte Un compte de staking est un compte spécial où sont stockés les jetons SOL stakés. Il est créé lorsque vous déléguez vos jetons à un validateur pour participer à la validation des transactions et gagner des récompenses. Des frais minimes sont facturés pour la création du compte de staking, qui sont restitués une fois le staking terminé. Pourcentage de rendement annuel - Le pourcentage de rendement annuel que vous pouvez gagner en participant au staking. + APR : Montre le taux d’intérêt que vous pourriez gagner en un an sans capitalisation. Les intérêts gagnés ne sont pas ajoutés à votre solde, donc vous ne gagnez pas d’intérêts supplémentaires dessus. + APY : Montre le total des intérêts que vous pourriez gagner en un an avec capitalisation. La capitalisation signifie que les intérêts gagnés sont ajoutés à votre solde, et vous gagnez également des intérêts sur ces intérêts. APR APY Les récompenses s\'accumulent automatiquement sur votre solde de staking quotidiennement. @@ -1049,6 +1050,7 @@ Mois Semaine Récompenses + Les récompenses sur Solana sont automatiquement ajoutées à votre solde de staking et ne peuvent pas être affichées séparément. Stake verrouillé Staker plus Lorsque vous stakez %1$s, la totalité de votre solde %2$s est stakeée. Tout dépôt supplémentaire de %2$s sur votre portefeuille Tangem sera également staké automatiquement. @@ -1477,6 +1479,7 @@ Vos %s sont déposés dans Aave. Impossible de charger le graphique... L’approvisionnement de %1$s %2$s sur Aave est en attente. + Désactiver le mode rendement APY %1$s%% Disponible APY actuel @@ -1505,11 +1508,12 @@ Vérifiez votre connexion réseau. Informations sur les frais de réseau inaccessibles Chaque dépôt que vous effectuez sera automatiquement transféré à Aave. + Tous les %1$s de votre compte seront automatiquement fournis à Aave. Transfert automatique vers Aave Envoyez, échangez ou vendez vos fonds instantanément, quand vous le souhaitez. - Accédez à vos fonds à tout moment + Accès immédiat Comment ça marche ? - Aave est un protocole décentralisé qui gère plus de 61 milliards de dollars en valeur totale. + Aave est un protocole on-chain permettant de créer des marchés de liquidité non dépositaire pour gagner des intérêts à taux variable. Décentralisé et auto-détenu En utilisant ce service, vous acceptez les conditions générales du fournisseur %1$s et %2$s. Connecter Aave @@ -1525,11 +1529,12 @@ Vos %s seront fournis à Aave, mais resteront gérables. Voir la politique tarifaire Vos prochains dépôts seront automatiquement transférés vers Aave. + Tous vos futurs dépôts %1$s seront automatiquement fournis à Aave. Actif En pause Désactivation du mode de rendement En désactivant cela, vos fonds seront retirés d\'Aave vers %s dans votre portefeuille et vous ne gagnerez plus de récompenses. - Les frais de réseau seront déduits du montant que vous retirez. + Des frais de réseau sont prélevés par la blockchain lorsque vous quittez le mode Yield. Désactiver le mode rendement Rendement annuel brut (APY) APY diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml index 211f153257..a437982f8e 100644 --- a/core/res/src/main/res/values-ja/strings.xml +++ b/core/res/src/main/res/values-ja/strings.xml @@ -54,6 +54,8 @@ 新しいアカウントを破棄してもよろしいですか? 編集内容を破棄してもよろしいですか? 保存されていない変更 + 一部のカスタムトークンは、その派生がそのアカウントに属しているため、「 %1$s 」から「 %2$s 」に移動されました。 + 一部のカスタムトークンが移動されました トークンが見つかりませんか?メインページのマーケットセクションに移動し、ポートフォリオに追加して買付できるようにします。 トークンが見つかりませんか?メインページのマーケットセクションに移動し、ポートフォリオに追加して売却できるようにします。 売却 @@ -1172,8 +1174,8 @@ ステーキングアカウント手数料 ステーキングアカウントとは、ステーキングされたSOLが保管される特別なアカウントです。トークンをバリデーターに委任し、取引の検証に参加して報酬を受け取る際に作成されます。ステーキングアカウントの作成には少額の手数料がかかりますが、ステーキング完了後に返金されます。 年率 - ステーキングに参加することで得られる年間収益率。 - APYは、バリデータのパフォーマンスに基づいた年間利回りを示します。 + APR:1年間で得られる利息を単利で表示します。得た利息は残高に加算されず、その利息にはさらに利息がつきません。 + APY:1年間で得られる合計利息を複利込みで表示します。複利とは、得た利息が残高に加算され、その利息にもさらに利息がつくことを意味します。 APR APY 報酬は毎日自動的にステーキング残高に蓄積されます。 @@ -1834,6 +1836,7 @@ あなたの%sはAaveに預けられています チャートを読み込めません・・ Aaveへの%1$s %2$sの供給は保留中です。 + 利回りモードを無効にする 年利%1$s%% 利用可能 現在のAPY @@ -1862,9 +1865,10 @@ ネットワーク接続を確認してください ネットワーク手数料についての情報にアクセスできません あなたが行うすべての入金は、自動的にAaveへ供給されます。 + アカウントのすべての %1$s は自動的に Aave に供給されます。 Aaveへの自動送金 いつでも、即座に資金を送信、交換、売却できます。 - いつでも資金にアクセス可能 + すぐに利用可能 使い方 Aaveは、総額610億ドル以上の資産を管理する分散型プロトコルです。 分散型・自己管理型 @@ -1882,11 +1886,12 @@ %sはAaveに供給されますが、管理可能な状態のままになります。 入金手数料ポリシーを見る 次回の入金は自動的にAaveに供給されます。 + 今後のすべての %1$s 入金は自動的に Aave に供給されます。 アクティブ 停止中 利回りモードを解除中 これをオフにすると、Aaveから資産が引き出され、ウォレット内の%sに変換され、利回りの発生が停止します。 - 出金金額からネットワーク手数料が差し引かれます。 + ネットワーク手数料とは、ブロックチェーン上で取引を処理して承認するためにユーザーが支払う料金のことです。 利回りモードを無効にする 供給 供給APY diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index 1df2916b57..eb34b26afd 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -179,6 +179,7 @@ дней Удалить + Отключить Отключено Отключить Готово @@ -1068,7 +1069,8 @@ Комиссия за стейкинг аккаунт Стейкинг аккаунт — это специальный счет, на котором хранятся застейканные токены SOL. Он создается при делегировании ваших токенов валидатору для участия в подтверждении транзакций и получении наград. За создание стейкинг аккаунта взимается небольшая комиссия, которая возвращается после завершения стейкинга. Процентная ставка - Годовой процентный доход, который вы можете получить от участия в стейкинге. + APR: Показывает процент, который вы можете заработать за год без учёта сложного процента. Начисленные проценты не добавляются к балансу, поэтому на них не начисляются дополнительные проценты. + APY: Показывает общий процент, который вы можете заработать за год с учётом сложного процента. Сложный процент означает, что начисленные проценты добавляются к вашему балансу, и на них тоже начисляются проценты. APR APY Награда автоматически аккумулируется на вашем стейкинг балансе. @@ -1596,14 +1598,15 @@ Ваши средства в данный момент размещены в протоколе Aave, но вы можете воспользоваться ими в любое время. Ваш %s внесён в Aave Невозможно загрузить график - Отправка %1$s %2$s на Aave ожидает выполнения. + Отправка %1$s %2$s в Aave. + Завершить режим доходности APY %1$s%% Доступно Текущий APY При пополнении в режиме доходности с баланса будет удержана комиссия сети, не превышающая %1$s. Сейчас комиссия сети слишком высока для выполнения операции. Средства будут отправлены, как только она снизится до %1$s или ниже. Мои средства - Ваши %1$s теперь внесён в Aave и приносит проценты. У вас есть токен %2$s, который отражает ваш баланс и со временем увеличивается. При пополнении средства автоматически направляются в Aave для получения процентов за вычетом комиссии за транзакцию. + Ваши %1$s теперь внесены в Aave и приносят проценты. У вас есть токен %2$s, который отражает ваш баланс и со временем увеличивается. При пополнении средства автоматически направляются в Aave для получения процентов за вычетом комиссии за транзакцию. Режим доходности Итоговый доход Переводы в Aave @@ -1620,18 +1623,19 @@ Tangem взимает комиссию за обслуживание в размере 15% от полученного дохода. Ваши средства будут автоматически переведены в Aave, как только комиссия сети снизится или баланс достигнет минимально необходимой суммы. Историческая доходность - Разрешение для вашего токена в Yield сервисе было отозвано. Откройте токен, чтобы выдать разрешение снова. + Разрешение для вашего токена в режиме доходности было отозвано. Откройте токен, чтобы выдать разрешение снова. Необходимо разрешение для токена Проверьте ваше интернет соединение Информация о комиссии недоступна Каждое пополнение вашего адреса автоматически будет отправляться в Aave. + Все %1$s на вашем аккаунте будут автоматически переданы в Aave. Автоперевод в AAVE Отправляйте, обменивайте или продавайте свои средства мгновенно, когда захотите. - Мгновенный вывод средств + Свободный доступ Как это работает? - Aave — децентрализованный протокол, управляющий активами на сумму более $61 млрд. - Децентрализованный и некастодиальный - Используя сервис, вы соглашаетесь с условиями провайдера %1$s и %2$s + Aave — ончейн-протокол для некостодиальных рынков ликвидности, позволяющий получать доход с переменной ставкой. + Децентрализованный и некостодиальный + Используя сервис, вы соглашаетесь с %1$s и %2$s Подключить Aave Aave %1$s%% • Плавающая ставка Aave @@ -1642,14 +1646,15 @@ Ставка может меняться При пополнении ваши средства автоматически отправляются в Aave для начала начисления процентов. Для покрытия комиссии с вас будет удержана небольшая плата в размере %s. Начать зарабатывать - Ваш %s будет передан в Aave и останется всегда доступным. + Ваши %s будет переданы в Aave и останутся всегда доступными. Политика комиссий Следующие пополнения вашего счёта автоматически поступят в Aave. + Все ваши будущие поступления %1$s будут автоматически направляться в Aave. Активен На паузе Завершение режима доходности Выключив эту функцию, вы выведёте средства из Aave, получите их обратно в %s в своем кошельке и перестанете зарабатывать награды. - Комиссия сети будет вычтена из суммы вашего вывода. + Комиссия сети взимается блокчейном при выходе из режима доходности. Завершить режим доходности Внесение Годовая доходность (APY) @@ -1657,12 +1662,12 @@ Проценты начисляются автоматически. Проценты начисляются автоматически. Режим доходности - Отправка ваших средств + Включение режима доходности Режим доходности Автоматически Внесите немного %1$s %2$s, чтобы покрыть комиссию сети за транзакции. Невозможно покрыть комиссию в %s - Сервис доходности в данный момент недоступен. Пожалуйста, попробуйте позже. + Режим доходности в данный момент недоступен. Пожалуйста, попробуйте позже. Режим доходности недоступен Невозможно загрузить график diff --git a/core/res/src/main/res/values-uk-rUA/strings.xml b/core/res/src/main/res/values-uk-rUA/strings.xml index 35f9ffc00b..e86e8f9877 100644 --- a/core/res/src/main/res/values-uk-rUA/strings.xml +++ b/core/res/src/main/res/values-uk-rUA/strings.xml @@ -964,7 +964,8 @@ Комісія за стейкінг-акаунт Стейкінг-акаунт — це спеціальний рахунок, на якому зберігаються застейкані SOL токени. Він створюється, коли ви делегуєте свої токени валідатору для участі у перевірці транзакцій та отримання винагород. За створення стейкінг-акаунту стягується невелика комісія, яка повертається після завершення стейкінгу. Процентна ставка - Річний відсоток, який ви можете отримати, беручи участь у стейкінгу. + APR: Показує відсоток, який ви можете заробити за рік без урахування складного відсотка. Нараховані відсотки не додаються до вашого балансу, тому на них не нараховуються додаткові відсотки. + APY: Показує загальний відсоток, який ви можете заробити за рік з урахуванням складного відсотка. Складний відсоток означає, що нараховані відсотки додаються до вашого балансу, і на них також нараховуються відсотки. APR APY Винагороди автоматично накопичуються на вашому балансі щодня. @@ -1054,6 +1055,7 @@ Місяць Потижнево Винагороди + Нагороди на Solana автоматично додаються до вашого стейкінг-балансу і не можуть відображатися окремо. Стейкінг закрито Застейкати більше При стейкінгу %1$s, весь ваш %2$s Баланс застейкний. Будь-які додаткові %2$s поповнены на Ваш гаманець Tangem буде також автоматично застейкано. @@ -1453,13 +1455,14 @@ Ваш %s внесений у Aave Неможливо завантажити графік Поповнення %1$s %2$s на Aave очікує виконання. + Завершити заробіток APY %1$s%% Доступно Поточний APY При поповненні для кредитування з балансу буде вирахувано комісію мережі, що не перевищує %1$s. Наразі мережева комісія є занадто високою, щоб здійснювати кредитування. Кошти будуть надані, як тільки вона знизиться до %1$s або нижче. Мої кошти - Ваші %1$s тепер розміщено в Aave і приносить дохід. У вас є токен %2$s, який представляє ваш баланс і з часом збільшується. При поповненні кошти автоматично направляються в Aave для отримання процентів з вирахуванням комісії за транзакцію. + Ваші %1$s тепер розміщені в Aave і приносять дохід. У вас є токен %2$s, який представляє ваш баланс і з часом збільшується. При поповненні кошти автоматично направляються в Aave для отримання процентів з вирахуванням комісії за транзакцію. Режим дохідності Підсумковий дохід Перекази в Aave @@ -1481,11 +1484,12 @@ Перевірте підключення до мережі Інформація про комісію недоступна Кожен ваш депозит буде автоматично надходити до Aave. + Всі %1$s на вашому рахунку будуть автоматично передані в Aave. Автопереказ до AAVE Відправляйте, обмінюйте або продавайте свої кошти миттєво, в будь-який час. - Миттєвий вивід коштів + Вільний доступ Як це працює? - Aave — децентралізований протокол, що керує активами на понад $61 млрд. + Aave — це ончейн-протокол для створення некостодіальних ринків ліквідності, що дозволяє отримувати дохід з змінною ставкою. Децентралізований та некастодіальний Використовуючи сервіс, ви погоджуєтесь з умовами провайдера %1$s та %2$s Підключити Aave @@ -1501,11 +1505,12 @@ Ваш %s буде передано до Aave, і залишиться завжди доступним. Політика комісій Ваші наступні поповнення рахунку автоматично надходитимуть до Aave. + Всі ваші майбутні надходження %1$s будуть автоматично спрямовані в Aave. Активний На паузі Вимкнення режиму прибутковості Вимкнення цієї опції виведе ваші активи з Aave, отримаєте їх назад у %s у вашому гаманці і зупинить накопичення нагород. - Комісія мережі буде вирахувана з суми, яку ви знімаєте. + Комісію мережі стягує блокчейн при виході з режиму доходності. Завершити заробіток Річна прибутковість (APY) APY diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 433f57b894..21f5246f51 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -1196,9 +1196,9 @@ Stake account fee A staking account is a special account where staked SOL tokens are stored. It is created when you delegate your tokens to a validator to participate in transaction validation and receive rewards. A small fee is charged for creating the staking account, which is returned after the staking is completed. Annual percentage rate - The annual percentage return you can earn from participating in staking. + APR: Shows the interest rate you could earn in a year without compounding. Your earned interest is not added to your balance, so your earnings don’t grow on themselves. Annual percentage yield - APY shows the validator’s annual percentage yield based on its performance + APY: Shows the total interest you could earn in a year with compounding. Compounding means your earned interest is added to your balance, so you also earn interest on that interest. APR APY Rewards automatically accumulate in your staking balance daily. @@ -1897,85 +1897,88 @@ No, send all Reduce by %s XTZ To avoid paying an increased commission the next time you top up your wallet, reduce the amount by %s XTZ - With Yield mode active, all future deposits to this address will go to Aave. You can still manage your funds freely. + When Yield Mode is active, all future top-ups to this address will be supplied to Aave. You can still manage your funds freely. Your %s is supplied to Aave Supplying %1$s %2$s to Aave is pending Approve - Your token’s approval has been revoked. Grant it again to resume service functionality. + Your token\'s approval has been revoked. Grant it again to resume the service\'s functionality. Approve needed - The fee will be taken out, and your assets will be lent again. - To continue earning, approval is required. + The fee will be deducted, and your assets will be resupplied. + To continue generating yield, approval is required. Confirm approval Your funds are currently supplied to the Aave protocol, but you can manage them at any time. - Your %s is deposited in Aave + Your %s is supplied to Aave Unable to load chart... - Supplying %1$s %2$s to Aave is pending. + Supplying %1$s %2$s to Aave. + Disable Yield Mode APY %1$s%% Available Current APY When topping up for lending, a network fee not exceeding %1$s will be deducted from the balance. The network fee is currently too high to execute lending. Funds will be supplied once it drops to %1$s or below. My funds - Your %1$s is now deployed to Aave and earning yield. You hold %2$s tokens, which represent your balance and accrue yield automatically. When you top up, funds are added to Aave to earn more yield, minus fees. - Yield mode - Total earnings + Your %1$s is now deployed to Aave and generating yield. You hold %2$s tokens, representing your balance and accruing yield automatically. When you top up, the funds are supplied to Aave to generate more yield, after fees are deducted. + Yield Mode + Total yield Transfers to Aave Explore Aave This is the current supply fee on %s. The actual cost will be shown on the activation tab. Current fee - All future %s deposits will be supplied to Aave automatically, with the transaction fee deducted. - An approximate network fee of %1$s (%2$s) will be deducted from each future top-up, and it won’t exceed your %3$s (%4$s) limit. - If network fees rise above maximum fee, the transaction won’t go through until they decrease. You can change this limit later. + All future %s top-ups will be supplied to Aave automatically, after the transaction fee is deducted. + An approximate network fee of %1$s (%2$s) will be deducted from each future top-up, and it won\'t exceed your %3$s (%4$s) limit. + If network fees rise above the maximum fee, the transaction won\'t go through until they decrease. You can change this limit later. Maximum fee - The minimum amount is calculated based on the current network fee so that it does not exceed 4%% of the top-up amount, which makes the minimum %1$s (%2$s). + The minimum amount is calculated based on the current network fee, ensuring it doesn\'t exceed 4%% of the top-up amount, which equals the minimum %1$s (%2$s). Minimum top-up Top-up fee policy - Tangem also takes a 15% service fee on yield earned. + Tangem also takes a 15% service fee on yield generated. Your funds will be automatically supplied to Aave once network fees are lower or your balance meets the minimum required amount. Historical returns - Approval for your token in the Yield mode has been revoked. Open the token to grant permission again. + Approval for your token in Yield Mode has been revoked. Open the token to grant permission again. Token approval needed Check your network connection Network fee info unreachable - Every deposit you make will be supplied to Aave automatically. - Auto-Transfer to Aave + Every top-up will be supplied to Aave automatically. + All %1$s on your account will be supplied to Aave automatically. + Auto-supply to Aave Send, swap, or sell your funds instantly, anytime you want. - Access your funds anytime + No lock-ups How it works? - Aave is a decentralized protocol managing over $61 billion in total value. + Aave is an on-chain protocol that offers non-custodial liquidity markets, enabling users to accrue yield at variable rates. Decentralized and self-custodial By using this service, you agree with provider\n%1$s and %2$s - Connect Aave + Connect to Aave Aave %1$s%% • Variable Interest Rate Aave Avg %s Last year\'s returns - Current interest rate is always variable and automatically computed by the Aave on-chain smart-contract, based on real-time supply and demand. + The current interest rate is always variable and automatically computed by Aave\'s on-chain smart contract, based on real-time supply and demand. Powered by Interest rate is variable - When you top up, your funds will be automatically sent to Aave to start earning interest. %s will be deducted to cover the transaction fee. + When you top up, your funds will be automatically supplied to Aave to start generating yield. %s will be deducted to cover the transaction fee. Supply assets - Your %s will be supplied to Aave, but will remain manageable. + Your %s will be supplied to Aave with no lock-ups and will remain fully accessible. See top-up fee policy Your next top-ups will be automatically supplied to Aave. + All your future incoming %1$s deposits will be automatically supplied to Aave. Active Paused Disabling Yield Mode Turning this off will withdraw your assets from Aave, convert them back to %s in your wallet, and stop yield accrual. - The network fee will be deducted from the amount you withdraw. - Disable yield mode + A network fee is charged by the blockchain when you exit Yield Mode. + Disable Yield Mode Supply Supply APY APY - Interest accrues automatically. + Interest accrues automatically Interest accrues automatically - Yield mode - Processing your top-up + Yield Mode + Enabling Yield Mode Yield Mode Automatic - Deposit some %1$s %2$s to cover the network fee for transactions + Add some %1$s %2$s to cover the network fee for transactions. Unable to cover %s fee - The Yield mode service isn’t available at the moment. Please try again later. - Yield mode unavailable + Yield Mode isn\'t available at the moment. Please try again later. + Yield Mode unavailable Unable to load chart... diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/TangemBottomSheetConfig.kt b/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/TangemBottomSheetConfig.kt index 002cecf115..d99aefacb5 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/TangemBottomSheetConfig.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/TangemBottomSheetConfig.kt @@ -10,10 +10,15 @@ package com.tangem.core.ui.components.bottomsheets data class TangemBottomSheetConfig( val isShown: Boolean, val onDismissRequest: () -> Unit, + val dismissOnClickOutside: () -> Boolean = { true }, val content: TangemBottomSheetConfigContent, ) { companion object { - val Empty = TangemBottomSheetConfig(false, {}, TangemBottomSheetConfigContent.Empty) + val Empty = TangemBottomSheetConfig( + isShown = false, + onDismissRequest = {}, + content = TangemBottomSheetConfigContent.Empty, + ) } } \ No newline at end of file diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/modal/TangemModalBottomSheetWithFooter.kt b/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/modal/TangemModalBottomSheetWithFooter.kt index 6506a16d14..8b2c012fc1 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/modal/TangemModalBottomSheetWithFooter.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/modal/TangemModalBottomSheetWithFooter.kt @@ -88,7 +88,17 @@ inline fun DefaultModalBottomSheetW noinline footer: @Composable (BoxScope.(T) -> Unit)?, ) { var isVisible by remember { mutableStateOf(value = config.isShown) } - val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = skipPartiallyExpanded) + val sheetState = rememberModalBottomSheetState( + skipPartiallyExpanded = skipPartiallyExpanded, + confirmValueChange = { sheetValue -> + if (config.dismissOnClickOutside().not()) { + // Ignore transitions to hidden (prevents dismiss on outside click/back press) + sheetValue != SheetValue.Hidden + } else { + true + } + }, + ) if (isVisible && config.content is T) { BasicModalBottomSheetWithFooter( diff --git a/core/ui/src/main/java/com/tangem/core/ui/res/TangemTheme.kt b/core/ui/src/main/java/com/tangem/core/ui/res/TangemTheme.kt index 9c862a5c77..85535f739b 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/res/TangemTheme.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/res/TangemTheme.kt @@ -66,7 +66,7 @@ fun TangemTheme( ) { val themeColors = if (isDark) darkThemeColors() else lightThemeColors() val rememberedColors = remember { themeColors } - .also { it.update(themeColors) } + .apply { update(themeColors) } val systemUiController = rememberSystemUiController() val systemBarsIconsController = remember(systemUiController) { SystemBarsIconsController(systemUiController) } diff --git a/core/ui/src/main/java/com/tangem/core/ui/res/TangemThemeRedesign.kt b/core/ui/src/main/java/com/tangem/core/ui/res/TangemThemeRedesign.kt index 7a93d0463c..476a412a20 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/res/TangemThemeRedesign.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/res/TangemThemeRedesign.kt @@ -13,7 +13,7 @@ import androidx.compose.runtime.* fun TangemThemeRedesign(content: @Composable () -> Unit) { val themeColors = if (LocalIsInDarkTheme.current) darkThemeColors() else lightThemeColors(redesign = true) val rememberedColors = remember { themeColors } - .also { it.update(themeColors) } + .apply { update(themeColors) } val rootBackgroundColor = rememberedColors.background.secondary MaterialTheme( diff --git a/domain/yield-supply/src/main/java/com/tangem/domain/yield/supply/FeeExtensions.kt b/domain/yield-supply/src/main/java/com/tangem/domain/yield/supply/FeeExtensions.kt index 799506d8f2..6df54ae127 100644 --- a/domain/yield-supply/src/main/java/com/tangem/domain/yield/supply/FeeExtensions.kt +++ b/domain/yield-supply/src/main/java/com/tangem/domain/yield/supply/FeeExtensions.kt @@ -6,7 +6,7 @@ import java.math.BigInteger import java.math.RoundingMode private val HUNDRED_PERCENT = 100.toBigInteger() // base 100% -val INCREASE_GAS_LIMIT_FOR_SUPPLY = 112.toBigInteger() // 12% increase +val INCREASE_GAS_LIMIT_FOR_SUPPLY = 120.toBigInteger() // 20% increase fun Fee.fixFee(cryptoCurrency: CryptoCurrency, gasLimit: BigInteger): Fee = when (this) { is Fee.Ethereum.Legacy -> copy( diff --git a/domain/yield-supply/src/test/java/com/tangem/domain/yield/supply/YieldSupplyEstimateEnterFeeUseCaseTest.kt b/domain/yield-supply/src/test/java/com/tangem/domain/yield/supply/YieldSupplyEstimateEnterFeeUseCaseTest.kt index 20c7619b9e..38e789a341 100644 --- a/domain/yield-supply/src/test/java/com/tangem/domain/yield/supply/YieldSupplyEstimateEnterFeeUseCaseTest.kt +++ b/domain/yield-supply/src/test/java/com/tangem/domain/yield/supply/YieldSupplyEstimateEnterFeeUseCaseTest.kt @@ -314,9 +314,9 @@ class YieldSupplyEstimateEnterFeeUseCaseTest { val deployFee = txs.first().fee as Fee.Ethereum.EIP1559 val approveFee = txs[1].fee as Fee.Ethereum.EIP1559 val enterFee = txs.last().fee as Fee.Ethereum.EIP1559 - Truth.assertThat(deployFee.gasLimit).isEqualTo(BigInteger.valueOf(1_120)) - Truth.assertThat(approveFee.gasLimit).isEqualTo(BigInteger.valueOf(2_240)) - Truth.assertThat(enterFee.gasLimit).isEqualTo(BigInteger.valueOf(3_360)) + Truth.assertThat(deployFee.gasLimit).isEqualTo(BigInteger.valueOf(1_200)) + Truth.assertThat(approveFee.gasLimit).isEqualTo(BigInteger.valueOf(2_400)) + Truth.assertThat(enterFee.gasLimit).isEqualTo(BigInteger.valueOf(3_600)) } @Test @@ -353,9 +353,9 @@ class YieldSupplyEstimateEnterFeeUseCaseTest { val deployFee = txs.first().fee as Fee.Ethereum.Legacy val approveFee = txs[1].fee as Fee.Ethereum.Legacy val enterFee = txs.last().fee as Fee.Ethereum.Legacy - Truth.assertThat(deployFee.gasLimit).isEqualTo(BigInteger.valueOf(1_120)) - Truth.assertThat(approveFee.gasLimit).isEqualTo(BigInteger.valueOf(2_240)) - Truth.assertThat(enterFee.gasLimit).isEqualTo(BigInteger.valueOf(3_360)) + Truth.assertThat(deployFee.gasLimit).isEqualTo(BigInteger.valueOf(1_200)) + Truth.assertThat(approveFee.gasLimit).isEqualTo(BigInteger.valueOf(2_400)) + Truth.assertThat(enterFee.gasLimit).isEqualTo(BigInteger.valueOf(3_600)) } private fun getDeployTx() = uncompiled( diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/common/ui/YieldSupplyActionContent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/common/ui/YieldSupplyActionContent.kt index 177149a2f3..d2b8c520de 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/common/ui/YieldSupplyActionContent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/common/ui/YieldSupplyActionContent.kt @@ -94,7 +94,8 @@ internal fun YieldSupplyActionContent( YieldSupplyFeeRow( title = resourceReference(R.string.common_network_fee_title), value = fee, - modifier = Modifier.fillMaxWidth() + modifier = Modifier + .fillMaxWidth() .clip(RoundedCornerShape(14.dp)) .background(TangemTheme.colors.background.action) .padding(horizontal = 16.dp, vertical = 12.dp), @@ -139,7 +140,10 @@ private class YieldSupplyActionContentPreviewProvider : PreviewParameterProvider R.string.yield_module_start_earning_sheet_description, wrappedList("USDT"), ), - footer = resourceReference(R.string.yield_module_start_earning_sheet_next_deposits), + footer = resourceReference( + R.string.yield_module_start_earning_sheet_next_deposits_v2, + wrappedList("USDT"), + ), footerLink = resourceReference(R.string.yield_module_start_earning_sheet_fee_policy), currencyIconState = CurrencyIconState.Loading, yieldSupplyFeeUM = YieldSupplyFeeUM.Content( diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/ui/YieldSupplyBlockContent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/ui/YieldSupplyBlockContent.kt index df2c84d279..08381eab85 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/ui/YieldSupplyBlockContent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/ui/YieldSupplyBlockContent.kt @@ -55,8 +55,9 @@ internal fun YieldSupplyBlockContent(yieldSupplyUM: YieldSupplyUM, modifier: Mod resourceReference(R.string.yield_module_stop_earning), modifier, ) - YieldSupplyUM.Unavailable -> SupplyUnavailable(modifier) - YieldSupplyUM.Initial -> Unit + YieldSupplyUM.Unavailable, + YieldSupplyUM.Initial, + -> Unit } } } @@ -80,18 +81,6 @@ private fun SupplyAvailable(supplyUM: YieldSupplyUM.Available, modifier: Modifie ) } -@Composable -private fun SupplyUnavailable(modifier: Modifier = Modifier) { - SupplyInfo( - title = resourceReference(R.string.yield_module_unavailable_title), - subtitle = resourceReference(R.string.yield_module_unavailable_subtitle), - rewardsApy = null, - iconTint = TangemTheme.colors.icon.inactive, - button = null, - modifier = modifier, - ) -} - @Suppress("LongMethod") @Composable private fun SupplyContent(supplyUM: YieldSupplyUM.Content, modifier: Modifier = Modifier) { diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/entity/YieldSupplyPromoUM.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/entity/YieldSupplyPromoUM.kt index fca29d33ea..e10b365bf0 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/entity/YieldSupplyPromoUM.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/entity/YieldSupplyPromoUM.kt @@ -7,4 +7,5 @@ data class YieldSupplyPromoUM( val policyLink: String, val title: TextReference, val subtitle: TextReference, + val tokenSymbol: String, ) \ No newline at end of file diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/model/YieldSupplyPromoModel.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/model/YieldSupplyPromoModel.kt index 09c57f0305..2c01ceb12d 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/model/YieldSupplyPromoModel.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/model/YieldSupplyPromoModel.kt @@ -34,6 +34,7 @@ internal class YieldSupplyPromoModel @Inject constructor( val uiState: YieldSupplyPromoUM = YieldSupplyPromoUM( tosLink = TangemBlogUrlBuilder.YIELD_SUPPLY_TOS_URL, policyLink = TangemBlogUrlBuilder.YIELD_SUPPLY_PRIVACY_URL, + tokenSymbol = params.currency.symbol, title = resourceReference(R.string.yield_module_promo_screen_title), subtitle = resourceReference( R.string.yield_module_promo_screen_variable_rate_info, diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt index dc7127e226..24eac0bb13 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt @@ -113,7 +113,7 @@ private fun ColumnScope.Content(yieldSupplyPromoUM: YieldSupplyPromoUM, clickInt ), ) SpacerH32() - PromoItems() + PromoItems(yieldSupplyPromoUM.tokenSymbol) } SpacerH32() } @@ -151,7 +151,7 @@ private fun YieldStatusAppBar(onBackClick: () -> Unit, onHowItWorksClick: () -> } @Composable -private fun PromoItems() { +private fun PromoItems(tokenSymbol: String) { PromoItem( icon = R.drawable.ic_flash_new_24, title = resourceReference(R.string.yield_module_promo_screen_cash_out_title), @@ -161,7 +161,10 @@ private fun PromoItems() { PromoItem( icon = R.drawable.ic_repeat_24, title = resourceReference(R.string.yield_module_promo_screen_auto_balance_title), - subtitle = resourceReference(R.string.yield_module_promo_screen_auto_balance_subtitle), + subtitle = resourceReference( + R.string.yield_module_promo_screen_auto_balance_subtitle_v2, + wrappedList(tokenSymbol), + ), ) SpacerH24() PromoItem( @@ -258,6 +261,7 @@ private fun YieldSupplyPromoContent_Preview() { tosLink = "https://tangem.com/terms-of-service/", policyLink = "https://tangem.com/privacy-policy/", title = resourceReference(R.string.yield_module_promo_screen_title), + tokenSymbol = "USDT", subtitle = resourceReference(R.string.yield_module_promo_screen_variable_rate_info, wrappedList("5.3")), ), clickIntents = object : YieldSupplyPromoClickIntents { diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveComponent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveComponent.kt index 0dccc9df82..18d339bb5c 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveComponent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveComponent.kt @@ -58,7 +58,7 @@ internal class YieldSupplyActiveComponent( @Composable override fun Footer() { SecondaryButton( - text = stringResourceSafe(R.string.yield_module_stop_earning), + text = stringResourceSafe(R.string.yield_module_disable_button), onClick = params.callback::onStopEarning, modifier = Modifier .fillMaxWidth() diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveEntryComponent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveEntryComponent.kt index 59616762c7..89dcded7bf 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveEntryComponent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveEntryComponent.kt @@ -2,6 +2,7 @@ package com.tangem.features.yield.supply.impl.subcomponents.active import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.arkivanov.decompose.extensions.compose.subscribeAsState import com.arkivanov.decompose.router.stack.StackNavigation import com.arkivanov.decompose.router.stack.childStack @@ -59,9 +60,10 @@ internal class YieldSupplyActiveEntryComponent( @Composable override fun BottomSheet() { val stackState by innerStack.subscribeAsState() - + val isTransactionInProgress by model.isTransactionInProgressFlow.collectAsStateWithLifecycle() YieldSupplyActiveEntryBottomSheet( stackState = stackState, + dismissOnClickOutside = { !isTransactionInProgress }, onDismiss = ::dismiss, ) } diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveEntryModel.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveEntryModel.kt index 02fc956678..9f7ca52491 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveEntryModel.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveEntryModel.kt @@ -11,6 +11,9 @@ import com.tangem.features.yield.supply.impl.subcomponents.approve.YieldSupplyAp import com.tangem.features.yield.supply.impl.subcomponents.stopearning.YieldSupplyStopEarningComponent import com.tangem.utils.TangemBlogUrlBuilder import com.tangem.utils.coroutines.CoroutineDispatcherProvider +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.update import javax.inject.Inject @ModelScoped @@ -25,15 +28,25 @@ internal class YieldSupplyActiveEntryModel @Inject constructor( private val params = paramsContainer.require() + val isTransactionInProgressFlow: StateFlow + field = MutableStateFlow(false) + override fun onStopEarning() { router.push(YieldSupplyActiveRoute.Exit) } override fun onBackClick() { - router.pop() + if (!isTransactionInProgressFlow.value) { + router.pop() + } + } + + override fun onTransactionProgress(inProgress: Boolean) { + isTransactionInProgressFlow.update { inProgress } } override fun onTransactionSent() { + isTransactionInProgressFlow.update { false } params.onDismiss() } diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt index f303d4ae1e..70282dca3f 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt @@ -226,7 +226,7 @@ private fun YieldSupplyActiveMyFunds( color = TangemTheme.colors.stroke.primary, ) HighComissionInfoRow( - title = resourceReference(R.string.common_network_fee_title), + title = resourceReference(R.string.common_estimated_fee), info = state.currentFee, isHighComission = state.isHighFee, ) diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveEntryBottomSheet.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveEntryBottomSheet.kt index 124b736fa4..e4f47efa5e 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveEntryBottomSheet.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveEntryBottomSheet.kt @@ -14,12 +14,14 @@ import com.tangem.features.yield.supply.impl.subcomponents.active.model.YieldSup @Composable internal fun YieldSupplyActiveEntryBottomSheet( stackState: ChildStack, + dismissOnClickOutside: () -> Boolean, onDismiss: () -> Unit, ) { TangemModalBottomSheetWithFooter( config = TangemBottomSheetConfig( isShown = true, onDismissRequest = onDismiss, + dismissOnClickOutside = dismissOnClickOutside, content = TangemBottomSheetConfigContent.Empty, ), containerColor = TangemTheme.colors.background.tertiary, diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/approve/YieldSupplyApproveComponent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/approve/YieldSupplyApproveComponent.kt index 3c1de839bb..c712301a01 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/approve/YieldSupplyApproveComponent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/approve/YieldSupplyApproveComponent.kt @@ -106,6 +106,7 @@ internal class YieldSupplyApproveComponent( interface ModelCallback { fun onBackClick() + fun onTransactionProgress(inProgress: Boolean) fun onTransactionSent() } } \ No newline at end of file diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/approve/model/YieldSupplyApproveModel.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/approve/model/YieldSupplyApproveModel.kt index bb92b7315b..e2c89da4c0 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/approve/model/YieldSupplyApproveModel.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/approve/model/YieldSupplyApproveModel.kt @@ -117,6 +117,8 @@ internal class YieldSupplyApproveModel @Inject constructor( } fun onClick() { + params.callback.onTransactionProgress(true) + val yieldSupplyFeeUM = uiState.value.yieldSupplyFeeUM as? YieldSupplyFeeUM.Content ?: return uiState.update(YieldSupplyTransactionInProgressTransformer) @@ -153,6 +155,7 @@ internal class YieldSupplyApproveModel @Inject constructor( } }, ) + params.callback.onTransactionProgress(false) }, ifRight = { val event = AnalyticsParam.TxSentFrom.Earning( diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/YieldSupplyStartEarningEntryComponent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/YieldSupplyStartEarningEntryComponent.kt index 77763ea8fc..850ee680cd 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/YieldSupplyStartEarningEntryComponent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/YieldSupplyStartEarningEntryComponent.kt @@ -2,6 +2,7 @@ package com.tangem.features.yield.supply.impl.subcomponents.startearning import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.arkivanov.decompose.extensions.compose.subscribeAsState import com.arkivanov.decompose.router.stack.StackNavigation import com.arkivanov.decompose.router.stack.childStack @@ -56,9 +57,11 @@ internal class YieldSupplyStartEarningEntryComponent( @Composable override fun BottomSheet() { val stackState by innerStack.subscribeAsState() + val uiState by model.uiState.collectAsStateWithLifecycle() YieldSupplyStartEarningBottomSheet( stackState = stackState, + dismissOnClickOutside = { !uiState.isTransactionSending }, onDismiss = ::dismiss, ) } diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/model/YieldSupplyStartEarningEntryModel.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/model/YieldSupplyStartEarningEntryModel.kt index 2037750020..88108f3a9d 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/model/YieldSupplyStartEarningEntryModel.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/model/YieldSupplyStartEarningEntryModel.kt @@ -8,8 +8,8 @@ import com.tangem.core.decompose.navigation.Router import com.tangem.core.ui.components.currency.icon.converter.CryptoCurrencyToIconStateConverter import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.extensions.wrappedList -import com.tangem.features.yield.supply.impl.R import com.tangem.features.yield.supply.api.analytics.YieldSupplyAnalytics +import com.tangem.features.yield.supply.impl.R import com.tangem.features.yield.supply.impl.common.entity.YieldSupplyActionUM import com.tangem.features.yield.supply.impl.common.entity.YieldSupplyFeeUM import com.tangem.features.yield.supply.impl.subcomponents.feepolicy.YieldSupplyFeePolicyComponent @@ -40,7 +40,10 @@ internal class YieldSupplyStartEarningEntryModel @Inject constructor( R.string.yield_module_start_earning_sheet_description, wrappedList(params.cryptoCurrency.symbol), ), - footer = resourceReference(R.string.yield_module_start_earning_sheet_next_deposits), + footer = resourceReference( + R.string.yield_module_start_earning_sheet_next_deposits_v2, + wrappedList(params.cryptoCurrency.symbol), + ), footerLink = resourceReference(R.string.yield_module_start_earning_sheet_fee_policy), currencyIconState = CryptoCurrencyToIconStateConverter().convert(params.cryptoCurrency), yieldSupplyFeeUM = YieldSupplyFeeUM.Loading, @@ -54,7 +57,9 @@ internal class YieldSupplyStartEarningEntryModel @Inject constructor( } override fun onBackClick() { - router.pop() + if (!uiState.value.isTransactionSending) { + router.pop() + } } override fun onFeePolicyClick() { diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/model/YieldSupplyStartEarningModel.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/model/YieldSupplyStartEarningModel.kt index 95e7c4d6d1..3446144179 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/model/YieldSupplyStartEarningModel.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/model/YieldSupplyStartEarningModel.kt @@ -45,7 +45,7 @@ import java.math.BigDecimal import javax.inject.Inject import kotlin.properties.Delegates -@Suppress("LongParameterList") +@Suppress("LongParameterList", "LargeClass") @ModelScoped internal class YieldSupplyStartEarningModel @Inject constructor( override val dispatchers: CoroutineDispatcherProvider, @@ -96,7 +96,10 @@ internal class YieldSupplyStartEarningModel @Inject constructor( R.string.yield_module_start_earning_sheet_description, wrappedList(cryptoCurrency.symbol), ), - footer = resourceReference(R.string.yield_module_start_earning_sheet_next_deposits), + footer = resourceReference( + R.string.yield_module_start_earning_sheet_next_deposits_v2, + wrappedList(cryptoCurrency.symbol), + ), footerLink = resourceReference(R.string.yield_module_start_earning_sheet_fee_policy), currencyIconState = CryptoCurrencyToIconStateConverter().convert(params.cryptoCurrency), yieldSupplyFeeUM = YieldSupplyFeeUM.Loading, diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/ui/YieldSupplyStartEarningBottomSheet.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/ui/YieldSupplyStartEarningBottomSheet.kt index aba821a580..6a7550515c 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/ui/YieldSupplyStartEarningBottomSheet.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/startearning/ui/YieldSupplyStartEarningBottomSheet.kt @@ -14,12 +14,14 @@ import com.tangem.features.yield.supply.impl.subcomponents.startearning.YieldSup @Composable internal fun YieldSupplyStartEarningBottomSheet( stackState: ChildStack, + dismissOnClickOutside: () -> Boolean, onDismiss: () -> Unit, ) { TangemModalBottomSheetWithFooter( config = TangemBottomSheetConfig( isShown = true, onDismissRequest = onDismiss, + dismissOnClickOutside = dismissOnClickOutside, content = TangemBottomSheetConfigContent.Empty, ), containerColor = TangemTheme.colors.background.tertiary, diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/stopearning/YieldSupplyStopEarningComponent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/stopearning/YieldSupplyStopEarningComponent.kt index 2379649d45..e74a248197 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/stopearning/YieldSupplyStopEarningComponent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/stopearning/YieldSupplyStopEarningComponent.kt @@ -107,6 +107,7 @@ internal class YieldSupplyStopEarningComponent( interface ModelCallback { fun onBackClick() + fun onTransactionProgress(inProgress: Boolean) fun onTransactionSent() } } \ No newline at end of file diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/stopearning/model/YieldSupplyStopEarningModel.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/stopearning/model/YieldSupplyStopEarningModel.kt index c9dc0ec5fd..13daef75cc 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/stopearning/model/YieldSupplyStopEarningModel.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/stopearning/model/YieldSupplyStopEarningModel.kt @@ -126,6 +126,8 @@ internal class YieldSupplyStopEarningModel @Inject constructor( } fun onClick() { + params.callback.onTransactionProgress(true) + val yieldSupplyFeeUM = uiState.value.yieldSupplyFeeUM as? YieldSupplyFeeUM.Content ?: return analytics.send( YieldSupplyAnalytics.ButtonStopEarning( @@ -163,6 +165,7 @@ internal class YieldSupplyStopEarningModel @Inject constructor( } }, ) + params.callback.onTransactionProgress(false) }, ifRight = { onStopEarningTransactionSuccess() diff --git a/libs/blockchain-sdk/src/main/java/com/tangem/blockchainsdk/utils/ExcludedBlockchains.kt b/libs/blockchain-sdk/src/main/java/com/tangem/blockchainsdk/utils/ExcludedBlockchains.kt index e2d3d72ea2..18125a1152 100644 --- a/libs/blockchain-sdk/src/main/java/com/tangem/blockchainsdk/utils/ExcludedBlockchains.kt +++ b/libs/blockchain-sdk/src/main/java/com/tangem/blockchainsdk/utils/ExcludedBlockchains.kt @@ -5,6 +5,7 @@ import com.tangem.core.configtoggle.blockchain.ExcludedBlockchainsManager import org.jetbrains.annotations.TestOnly import javax.inject.Inject +@Suppress("MemberNameEqualsClassName") class ExcludedBlockchains @Inject internal constructor( private val excludedBlockchainsManager: ExcludedBlockchainsManager, ) : Set { diff --git a/libs/tangem-sdk-api/src/main/kotlin/com/tangem/sdk/api/di/CardSdkModule.kt b/libs/tangem-sdk-api/src/main/kotlin/com/tangem/sdk/api/di/CardSdkModule.kt index 936f54845e..f27fd2b825 100644 --- a/libs/tangem-sdk-api/src/main/kotlin/com/tangem/sdk/api/di/CardSdkModule.kt +++ b/libs/tangem-sdk-api/src/main/kotlin/com/tangem/sdk/api/di/CardSdkModule.kt @@ -26,7 +26,7 @@ internal object CardSdkModule { artworksDirectory = File( context.getExternalFilesDir(null) ?: context.filesDir, "card_artworks", - ).also { it.mkdirs() }, + ).apply { mkdirs() }, ) } } \ No newline at end of file diff --git a/tangem-android-tools b/tangem-android-tools index 005d624edb..193db8a024 160000 --- a/tangem-android-tools +++ b/tangem-android-tools @@ -1 +1 @@ -Subproject commit 005d624edbb899bb8fae1c9444ea34b6eac86603 +Subproject commit 193db8a0247a1f33574dcdd5f9ec4dab2c28ea73