diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml
index 282551cd56..7ee93616a2 100644
--- a/core/res/src/main/res/values-ja/strings.xml
+++ b/core/res/src/main/res/values-ja/strings.xml
@@ -1725,7 +1725,10 @@
今後の%sの入金はすべて、取引手数料が差し引かれて自動的にAaveに供給されます。
ネットワーク手数料が上限手数料を超えた場合、手数料が下がるまで取引は成立しません。この制限は後で変更できます。
最大手数料
+ 取引手数料は、預入額の4%未満である必要があります。Tangemは、この条件を満たす十分な残高が貯まった時点で、Aaveへの資金移動を行います。
+ 最低額
手数料ポリシー
+ Tangemはまた、得られた利回りに対して3%のサービス手数料を差し引きます。
ネットワーク手数料が現在高すぎます。設定した上限を下回るまで待機しています。
過去のリターン
ここに説明を入力してください。1〜3行が理想的です。[プレースホルダー]
@@ -1758,7 +1761,7 @@
収益を停止する
オフにすると、Aaveから資金が引き出され、ウォレットの%sに戻され、報酬の獲得が停止されます。
出金金額からネットワーク手数料が差し引かれます。
- 供給APR
+ 供給APY
APY
あなたの資産を眠らせない — 残高を運用して利息を得ましょう。
利息は自動的に発生します
diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml
index c55cacce85..e65d507051 100644
--- a/core/res/src/main/res/values-ru/strings.xml
+++ b/core/res/src/main/res/values-ru/strings.xml
@@ -202,6 +202,7 @@
Импортировать
В процессе
Позже
+ Узнать больше
Осталось %1$s
Заблокирован
Основная сеть
@@ -1547,6 +1548,7 @@
URI уже используется
WalletConnect
Подозрительная транзакция
+ Узнать больше и купить
Отказаться
Вы не закончили резервное копирование. Хотите продолжить?
Да, возобновить
@@ -1561,13 +1563,74 @@
Нет, отправить все
Уменьшить на %s XTZ
Чтобы не платить повышенную комиссию при следующем пополнении кошелька, уменьшите сумму на %s XTZ
+ Ваш %s внесён в Aave
Выдать разрешение
+ Что-то пошло не так с вашим предыдущим разрешением, поэтому требуется новое. Выберите, как хотите продолжить.
+ Необходимо разрешение
+ Комиссия будет списана, и ваши активы снова начнут приносить доход.
+ Чтобы продолжить зарабатывать, нужно выдать разрешение.
+ Подтвердить разрешение
+ Ваш %s внесён в Aave
Невозможно загрузить график
Полученная сумма, %1$s %2$s, не была зачислена на Aave.
- Сетевая комиссия сейчас слишком высокая. Ожидаем, пока она упадёт ниже вашего лимита.
+ APY %1$s%%
+ Доступно
+ Текущий APY
+ Мои средства
+ Ваш %1$s теперь внесён в Aave и приносит проценты. У вас есть токен %2$s, который отражает ваш баланс и со временем увеличивается. При пополнении средства автоматически направляются в Aave для получения процентов за вычетом комиссии за транзакцию.
+ Итоговый доход
+ Переводы в Aave
+ Изучите Aave
+ Это текущая комиссия в сети %s.
+ Текущая комиссия
+ Все следующие пополнения %s автоматически поступят в Aave с удержанием комиссии за транзакцию.
+ Если комиссия сети превысит максимальный лимит, транзакция не будет выполнена до тех пор, пока комиссия не снизится. Вы сможете изменить этот лимит позже.
+ Максимальная комиссия
+ Комиссия за транзакцию должна быть ниже 4% от суммы депозита. Tangem переведёт средства в Aave, как только это условие будет выполнено.
+ Минимальный депозит
+ Политика комиссий
+ Tangem взимает комиссию за обслуживание в размере 3% от полученного дохода.
+ Комиссия в сети сейчас слишком высокая. Ждём, пока она упадёт ниже вашего лимита.
Историческая доходность
+ Необходимо разрешение для токена
Проверьте ваше интернет соединение
- Годовая доходность
+ Информация о комиссии недоступна
+ Каждое пополнение вашего адреса автоматически будет отправляться в Aave.
+ Ваш баланс работает автоматически
+ Отправляйте, обменивайте или продавайте свои средства мгновенно, когда захотите.
+ Мгновенный вывод средств
+ Как это работает?
+ Aave — это децентрализованный протокол, управляющий активами на сумму более 81,9 миллиарда долларов США.
+ Децентрализованный и некастодиальный
+ Используя сервис, вы соглашаетесь с условиями провайдера %1$s и %2$s
+ Зарабатывайте %s%% в год
+ Aave • Ставка с плавающим процентом
+ Aave
+ Среднее %s
+ Доходность за прошлый год
+ Текущая процентная ставка всегда переменная и автоматически рассчитывается смарт-контрактом AAVE в блокчейне на основе текущего спроса и предложения.
+ При поддержке
+ Ставка может меняться
+ При пополнении ваши средства автоматически отправляются в Aave для начала начисления процентов. Для покрытия комиссии с вас будет удержана небольшая плата в размере %s.
+ Начать зарабатывать
+ Ваш %s будет передан в Aave и останется всегда доступным.
+ Политика комиссий
+ Следующие пополнения вашего счёта автоматически поступят в Aave.
+ Активен
+ На паузе
+ Закончить зарабатывать
+ Выключив эту функцию, вы выведёте средства из Aave, получите их обратно в %s в кошельке и перестанете зарабатывать награды.
+ Комиссия сети будет вычтена из суммы вашего вывода.
+ Годовая доходность (APY)
+ APY
+ Пусть ваши деньги работают — зарабатывайте проценты на свой баланс.
+ Проценты начисляются автоматически.
+ Доходность Aave
+ Отправка ваших средств
+ Зарабатывайте %1$s%% в год
+ Автоматически
+ Внесите немного %1$s %2$s, чтобы покрыть комиссию сети за транзакции.
+ Невозможно покрыть комиссию в %s
Сервис начисления процентов в данный момент недоступен. Пожалуйста, попробуйте позже.
Данные о доходе недоступны
Невозможно загрузить график
diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml
index 3e4c4ec8a8..41e2ca1246 100644
--- a/core/res/src/main/res/values/strings.xml
+++ b/core/res/src/main/res/values/strings.xml
@@ -1298,6 +1298,8 @@
not available
Failed to load data. Try again later.
Hide
+ Technical issues detected. Please try again later or contact support.
+ Receive unavailable now
Reveal
Card details
Create account and issue a card
@@ -1772,7 +1774,7 @@
Reduce by %s XTZ
To avoid paying an increased commission the next time you top up your wallet, reduce the amount by %s XTZ
Text about your money in balance [PLACEHOLDER]
- Your %s is deposited in Aave
+ Your %s is deposited in Aave
Give Approve
Something went wrong with your previous approval, so we need a new one. Choose how you’d like to proceed.
Approve needed
@@ -1783,10 +1785,10 @@
Your %s is deposited in Aave
Unable to load chart...
The amount received, %1$s %2$s was not deposited to Aave.
- Earn %1$s%%
+ APY %1$s%%
Available
Current APY
- My Funds
+ My funds
Your %1$s is now deposited in Aave and earning interest. You hold a%2$s token, which represents your balance and grows over time. When you top up, funds go to Aave to earn interest, minus a transaction fee.
Earn
Total earnings
@@ -1798,7 +1800,7 @@
If network fees rise above maximum fee, the transaction won’t go through until they decrease. You can change this limit later.
Maximum fee
The transaction fee must stay below 4% of your deposit. Tangem will transfer funds to Aave only once your balance is large enough to meet this condition.
- Minimal amount
+ Minimal top-up
Fee policy
Tangem also takes a 3% service fee on the yield earned.
Network fee is too high right now. Waiting until it falls below your limit.
@@ -1810,9 +1812,9 @@
Every top-up of your account will be lended to Aave automatically.
Your balance works automatically
Send, swap, or sell your funds instantly, anytime you want.
- Cash out instantly
+ Access to funds at any time
How it works?
- Aave is trusted by millions worldwide. Total lended value is $10.4B.
+ Aave is a decentralized protocol managing over $81.9 billion in total value.
Decentralized and self-custodial
By using service, you agree with provider\n%1$s and %2$s
Earn %s%% yearly
@@ -1824,20 +1826,20 @@
Powered by
Interest rate is variable
When you top up, your funds will be automatically sent to Aave to start earning interest. A small fee equal to %s will be deducted to cover the transaction.
- Start earning
+ Supply assets
Your %s will be supplied to Aave and will stay instantly available
See fee policy
- Your next deposits will be automatically supplied to Aave.
+ Your next top-ups will be automatically supplied to Aave.
Active
Paused
Stop earning
Turning off will withdraw your funds from Aave, return them to %s in your wallet, and stop earning rewards.
The network fee will be deducted from the amount you withdraw.
- Supply APR
+ Supply APY
APY
Make your money work — earn interest on your balance.
Interest accrues automatically
- Aave lending
+ Aave yield
Processing your deposit
Earn %1$s%% per year
Automatic
diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/DefaultTangemPayDetailsComponent.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/DefaultTangemPayDetailsComponent.kt
index 35bb54bd7c..adad4cfd19 100644
--- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/DefaultTangemPayDetailsComponent.kt
+++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/DefaultTangemPayDetailsComponent.kt
@@ -5,18 +5,18 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.arkivanov.decompose.ComponentContext
+import com.arkivanov.decompose.extensions.compose.subscribeAsState
import com.arkivanov.decompose.router.slot.childSlot
import com.arkivanov.decompose.router.slot.dismiss
-import com.arkivanov.decompose.extensions.compose.subscribeAsState
import com.tangem.core.decompose.context.AppComponentContext
import com.tangem.core.decompose.context.child
import com.tangem.core.decompose.context.childByContext
import com.tangem.core.decompose.model.getOrCreateModel
import com.tangem.core.ui.components.NavigationBar3ButtonsScrim
import com.tangem.core.ui.decompose.ComposableBottomSheetComponent
-import com.tangem.domain.models.TokenReceiveConfig
import com.tangem.features.tangempay.components.txHistory.DefaultTangemPayTxHistoryComponent
import com.tangem.features.tangempay.model.TangemPayDetailsModel
+import com.tangem.features.tangempay.model.TangemPayDetailsNavigation
import com.tangem.features.tangempay.ui.TangemPayDetailsScreen
import com.tangem.features.tokenreceive.TokenReceiveComponent
import dagger.assisted.Assisted
@@ -33,7 +33,7 @@ internal class DefaultTangemPayDetailsComponent @AssistedInject constructor(
private val bottomSheetSlot = childSlot(
source = model.bottomSheetNavigation,
- serializer = TokenReceiveConfig.serializer(),
+ serializer = TangemPayDetailsNavigation.serializer(),
handleBackButton = false,
childFactory = ::bottomSheetChild,
)
@@ -57,15 +57,22 @@ internal class DefaultTangemPayDetailsComponent @AssistedInject constructor(
}
private fun bottomSheetChild(
- config: TokenReceiveConfig,
+ navigation: TangemPayDetailsNavigation,
componentContext: ComponentContext,
- ): ComposableBottomSheetComponent = tokenReceiveComponentFactory.create(
- context = childByContext(componentContext),
- params = TokenReceiveComponent.Params(
- config = config,
+ ): ComposableBottomSheetComponent = when (navigation) {
+ is TangemPayDetailsNavigation.Error -> TangemPayErrorBottomSheetComponent(
+ appComponentContext = appComponentContext,
+ messageUM = navigation.messageUM,
onDismiss = model.bottomSheetNavigation::dismiss,
- ),
- )
+ )
+ is TangemPayDetailsNavigation.Receive -> tokenReceiveComponentFactory.create(
+ context = childByContext(componentContext),
+ params = TokenReceiveComponent.Params(
+ config = navigation.config,
+ onDismiss = model.bottomSheetNavigation::dismiss,
+ ),
+ )
+ }
@AssistedFactory
interface Factory : TangemPayDetailsComponent.Factory {
diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayErrorBottomSheetComponent.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayErrorBottomSheetComponent.kt
new file mode 100644
index 0000000000..62e7a375f5
--- /dev/null
+++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayErrorBottomSheetComponent.kt
@@ -0,0 +1,23 @@
+package com.tangem.features.tangempay.components
+
+import androidx.compose.runtime.Composable
+import com.tangem.core.decompose.context.AppComponentContext
+import com.tangem.core.ui.components.bottomsheets.message.MessageBottomSheetUMV2
+import com.tangem.core.ui.components.bottomsheets.message.MessageBottomSheetV2
+import com.tangem.core.ui.decompose.ComposableBottomSheetComponent
+
+internal class TangemPayErrorBottomSheetComponent(
+ appComponentContext: AppComponentContext,
+ private val messageUM: MessageBottomSheetUMV2,
+ private val onDismiss: () -> Unit,
+) : AppComponentContext by appComponentContext, ComposableBottomSheetComponent {
+
+ override fun dismiss() {
+ onDismiss()
+ }
+
+ @Composable
+ override fun BottomSheet() {
+ MessageBottomSheetV2(state = messageUM, onDismissRequest = ::dismiss)
+ }
+}
\ No newline at end of file
diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/entity/TangemPayDetailsErrorType.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/entity/TangemPayDetailsErrorType.kt
new file mode 100644
index 0000000000..fa1fe5d982
--- /dev/null
+++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/entity/TangemPayDetailsErrorType.kt
@@ -0,0 +1,5 @@
+package com.tangem.features.tangempay.entity
+
+internal enum class TangemPayDetailsErrorType {
+ Receive,
+}
\ No newline at end of file
diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayDetailsModel.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayDetailsModel.kt
index d1504026e6..da92a7606c 100644
--- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayDetailsModel.kt
+++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayDetailsModel.kt
@@ -4,6 +4,7 @@ import androidx.compose.runtime.Stable
import androidx.compose.ui.graphics.toArgb
import com.arkivanov.decompose.router.slot.SlotNavigation
import com.arkivanov.decompose.router.slot.activate
+import com.arkivanov.decompose.router.slot.dismiss
import com.tangem.core.decompose.di.ModelScoped
import com.tangem.core.decompose.model.Model
import com.tangem.core.decompose.model.ParamsContainer
@@ -20,9 +21,11 @@ import com.tangem.domain.pay.DataForReceiveFactory
import com.tangem.domain.pay.repository.CardDetailsRepository
import com.tangem.features.tangempay.components.TangemPayDetailsComponent
import com.tangem.features.tangempay.details.impl.R
+import com.tangem.features.tangempay.entity.TangemPayDetailsErrorType
import com.tangem.features.tangempay.entity.TangemPayDetailsStateFactory
import com.tangem.features.tangempay.entity.TangemPayDetailsUM
import com.tangem.features.tangempay.model.transformers.*
+import com.tangem.features.tangempay.utils.TangemPayErrorMessageFactory
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import com.tangem.utils.coroutines.JobHolder
import com.tangem.utils.coroutines.saveIn
@@ -70,7 +73,7 @@ internal class TangemPayDetailsModel @Inject constructor(
private val fetchBalanceJobHolder = JobHolder()
private val revealCardDetailsJobHolder = JobHolder()
- val bottomSheetNavigation: SlotNavigation = SlotNavigation()
+ val bottomSheetNavigation: SlotNavigation = SlotNavigation()
init {
fetchBalance()
@@ -96,9 +99,15 @@ internal class TangemPayDetailsModel @Inject constructor(
fallbackBackground = TangemColorPalette.Meadow.toArgb(),
),
)
- bottomSheetNavigation.activate(config)
+ bottomSheetNavigation.activate(TangemPayDetailsNavigation.Receive(config))
+ }
+ .onLeft {
+ val messageUM = TangemPayErrorMessageFactory.createError(
+ type = TangemPayDetailsErrorType.Receive,
+ onDismiss = bottomSheetNavigation::dismiss,
+ )
+ bottomSheetNavigation.activate(TangemPayDetailsNavigation.Error(messageUM))
}
- .onLeft { showError() }
}
}
diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayDetailsNavigation.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayDetailsNavigation.kt
new file mode 100644
index 0000000000..bcf24b8829
--- /dev/null
+++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayDetailsNavigation.kt
@@ -0,0 +1,17 @@
+package com.tangem.features.tangempay.model
+
+import com.tangem.core.ui.components.bottomsheets.message.MessageBottomSheetUMV2
+import com.tangem.domain.models.TokenReceiveConfig
+import kotlinx.serialization.Serializable
+
+@Serializable
+internal sealed class TangemPayDetailsNavigation {
+
+ data class Receive(
+ val config: TokenReceiveConfig,
+ ) : TangemPayDetailsNavigation()
+
+ data class Error(
+ val messageUM: MessageBottomSheetUMV2,
+ ) : TangemPayDetailsNavigation()
+}
\ No newline at end of file
diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/utils/TangemPayErrorMessageFactory.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/utils/TangemPayErrorMessageFactory.kt
new file mode 100644
index 0000000000..2f5ce481ea
--- /dev/null
+++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/utils/TangemPayErrorMessageFactory.kt
@@ -0,0 +1,28 @@
+package com.tangem.features.tangempay.utils
+
+import com.tangem.core.ui.R
+import com.tangem.core.ui.components.bottomsheets.message.*
+import com.tangem.core.ui.extensions.TextReference
+import com.tangem.core.ui.extensions.resourceReference
+import com.tangem.features.tangempay.entity.TangemPayDetailsErrorType
+
+internal object TangemPayErrorMessageFactory {
+
+ fun createError(type: TangemPayDetailsErrorType, onDismiss: () -> Unit): MessageBottomSheetUMV2 {
+ return when (type) {
+ TangemPayDetailsErrorType.Receive -> messageBottomSheetUM {
+ infoBlock {
+ icon(R.drawable.img_attention_20) {
+ backgroundType = MessageBottomSheetUMV2.Icon.BackgroundType.Attention
+ }
+ title = TextReference.Res(R.string.tangempay_card_details_receive_error_title)
+ body = TextReference.Res(R.string.tangempay_card_details_receive_error_description)
+ }
+ primaryButton {
+ text = resourceReference(R.string.common_got_it)
+ onClick { onDismiss() }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file