diff --git a/core/res/src/main/res/values-de/strings.xml b/core/res/src/main/res/values-de/strings.xml
index 13d5401bc0..d8e5d77faf 100644
--- a/core/res/src/main/res/values-de/strings.xml
+++ b/core/res/src/main/res/values-de/strings.xml
@@ -258,7 +258,7 @@
Aktivieren
Aktiviert
Fehler
- Netzwerkdienstgebühr
+ Geschätzte Gebühr
Umtausch
Erkunden
Transaktionsverlauf einsehen
@@ -574,11 +574,14 @@
Gehe zum Backup
Bitte sicher Deine Wallet, bevor Du einen Zugangscode erstellst.
Zuerst die Sicherung abschließen
+ Unvollständig
Andere Methoden
Physische Geräte, die Deine privaten Schlüssel sicher offline speichern.
Wiederherstellungs-Phrase
Um Deine Wallet auf Hardware umzustellen, erstelle vorher ein Backup.
+ Deine privaten Schlüssel sind sicher verschlüsselt und auf Deinem Telefon gespeichert.
Schlüssel werden in der App gespeichert
+ Erstelle oder stelle Deine Wallet mithilfe einer Wiederherstellungsphrase wieder her – Deinem integrierten Backup.
Sicherung der Seed-Phrase
Mobile Wallet erstellen
Vorhandene Wallet importieren
@@ -966,6 +969,7 @@
%s min
Erhältlich ab
+ Verfügbar bis zu
Du erhältst
Der Service wird von einem externen Anbieter bereitgestellt. \n Tangem übernimmt keine Verantwortung.
Du kannst diesen Bildschirm schließen und den Transaktionsstatus auf dem Bildschirm mit den Token-Details überprüfen.
@@ -1188,8 +1192,10 @@
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.
+ Jährlicher prozentualer Ertrag
APY zeigt den jährlichen prozentualen Ertrag des Validators basierend auf seiner Leistung
Effektiver Jahreszins
+ APY
Belohnungen sammeln sich täglich automatisch in deinem Staking-Konto an.
Verfügbar
Durchschnittliche Belohnungsquote
@@ -1365,6 +1371,8 @@
Ausstehend
Die Bank hat diese Transaktionsanfrage abgelehnt.
Diese Gebühr dient zur Deckung der Kosten für die Abwicklung Deiner Überweisung.
+ Nutze Dein Geld weiterhin. Du kannst es jederzeit einfrieren.
+ Karte entsperren?
Abhebung
Guthaben hinzufügen
Aufladeoptionen
@@ -1389,6 +1397,7 @@
Aufdecken
Tausche beliebige Vermögenswerte in Deinem Portfolio gegen eine Karte.
Kartendetails
+ Karte entsperren
Konto erstellen und Karte ausstellen
Tangem Pay
Status anzeigen
@@ -1491,20 +1500,37 @@
Wallet umbenennen
Alle freischalten
Alle mit %s freischalten
+ AML-geprüft
+ Verfügbar
+ Gesperrt
+ Schulden
Grenzen
+ Andere (kein OTP)
+ Einzeltransaktion
+ Gesamt
- Verfügbar für %d Tag
- Verfügbar für %d Tage
+ Das verfügbare Guthaben ist das tatsächlich verfügbare Guthaben unter Berücksichtigung ausstehender Transaktionen, gesperrter Beträge und Sollsaldo, um Überziehungskredite zu vermeiden.
+ Verfügbar bis %1$s
Guthaben und Limits
+ Fehlende Zahlungskontoinformationen. Bitte kontaktiere den Support.
+ Informationen zum Token konnten nicht geladen werden.
+ Die Informationen werden noch geladen, bitte warten.
+ Limits sind erforderlich, um Kosten zu kontrollieren, die Sicherheit zu verbessern und Risiken zu managen. Du kannst %1$s ausgeben, während des Zeitraums für Kartenzahlungen in Geschäften und %2$s für andere Transaktionen, z.B. Abos oder Schulden.
+ Der Zugangscode dient zur Verwaltung Deines Zahlungskontos und zum Schutz vor unbefugtem Zugriff.
Zugangscode
Aktivierung des Kontos
Bitte wähle die Wallet aus, mit der Du den Registrierungsprozess gestartet hast, um die Transaktion zur Erstellung Deines Kontos auf der Blockchain zu signieren
+ Aktivierung abbrechen
Möchtest Du den Vorgang wirklich beenden? Du kannst später dort fortfahren, wo Du aufgehört hast.
Das wird nicht lange dauern. Wir richten gerade Dein Konto ein.
Das wird nicht lange dauern. Wir schließen die Aktivierung ab.
Alles wird vorbereitet!
Andere Wallet
+ Richte einen 4-stelligen Code ein. \n Dieser wird für Zahlungen verwendet.
+ PIN-Code
PIN-Code erstellen
PIN wurde nicht akzeptiert. Versuche es erneut oder verwende einen anderen Code.
Ungültige PIN: Sequenzen oder Wiederholungen vermeiden
@@ -1513,11 +1539,31 @@
Tangem Wallet vorbereiten
Du kannst Deine Verbindung \n auf der Website des Drittanbieters \n herstellen und zurück zur Tangem-App gelangen
Zur Website gehen
+ Wallet-Verbindung
Wallet wählen
+ Aktivierung fortsetzen
Fahren wir mit der Einrichtung Deines Kontos fort.
Willkommen zurück!
+ Aktivierung starten
Folge den Schritten, um Dein Konto einzurichten.
Willkommen!
+ Blockchain Betrag
+ Währungscode
+ Datum
+ Fehlercode
+ Transaktionsdetails
+ Händlerkategoriecode
+ Handelsstadt
+ Händler-Ländercode
+ Händlername
+ ID anfordern
+ Status
+ Transaktion
+ Transaktionsbetrag
+ Transaktions-Hash
+ Transaktionsanfrage
+ Transaktionsstatus
+ Typ
Diese Transaktion anfechten
Freischalten
Scanne Deine Karte, um den Zugriff freizuschalten
diff --git a/core/res/src/main/res/values-es/strings.xml b/core/res/src/main/res/values-es/strings.xml
index a84c13660c..1a1ad0aad3 100644
--- a/core/res/src/main/res/values-es/strings.xml
+++ b/core/res/src/main/res/values-es/strings.xml
@@ -182,6 +182,7 @@
Activar
Activado
Error
+ Comisión de red por recarga
Intercambiar
Explore
Explore historial de transacciones
diff --git a/core/res/src/main/res/values-fr/strings.xml b/core/res/src/main/res/values-fr/strings.xml
index cb8fba86f1..1da9dfb319 100644
--- a/core/res/src/main/res/values-fr/strings.xml
+++ b/core/res/src/main/res/values-fr/strings.xml
@@ -160,6 +160,7 @@
Activer
Activé
Erreur
+ Frais estimés
Echanger
Explorez
Explorez l\'historique des transactions
@@ -1134,6 +1135,7 @@
L\'envoi de fonds sera disponible une fois la ou les transactions en attente dans le réseau %s terminées.
L\'achat de %s n\'est pas pris en charge par les fournisseurs actuels mais nous travaillons à ajouter plus d\'options.
Le staking de %s n\'est pas pris en charge par les fournisseurs actuels, mais nous travaillons à ajouter plus d\'options.
+ L’autorisation a été révoquée. Vos fonds restent en mode rendement. Pour effectuer des actions, accédez au mode rendement et accordez à nouveau l’autorisation.
Générer XPUB
Masquer
Vous êtes sur le point de masquer ce jeton de l\'écran principal. Vous pouvez le rajouter à tout moment via la page de gestion des jetons.
diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml
index 74b96d49b9..53812d7882 100644
--- a/core/res/src/main/res/values-ja/strings.xml
+++ b/core/res/src/main/res/values-ja/strings.xml
@@ -253,7 +253,7 @@
有効にする
有効
エラー
- ネットワークサービス手数料
+ ネットワーク手数料
スワップ
移動する
取引履歴を調べる
@@ -269,7 +269,7 @@
無料
送信元
アドレスを同期する
- はじめる
+ もっと詳しく
トークンを取得
プロバイダーへ移動
トークンへ移動
@@ -565,10 +565,12 @@
現在のウォレットをアップグレードする
バックアップへ移動
アクセスコードを作成する前にウォレットをバックアップしてください。
+ まずバックアップを完了する
まずバックアップを完了する
その他の方法
秘密鍵をオフラインで安全に保存する物理デバイス。
リカバリーフレーズ
+ アクセスコードを使用してウォレットを保護するには、まずバックアップを完了してください。
ウォレットをハードウェアにアップグレードするには、まずバックアップしてください。
鍵はアプリに保存されます
シードフレーズのバックアップ
@@ -949,6 +951,7 @@
%s分
利用可能:
+ 利用可能金額
以下が手に入ります。
サービスは外部プロバイダーによって提供されます。 \nTangemは責任を負いません。
この画面を閉じて、トークンの詳細画面で取引状況を確認できます。
@@ -1158,11 +1161,12 @@
名前
トークンを活用しよう
ネットワーク手数料とは、ブロックチェーン上で取引を処理し、承認するために支払う少額の料金です。
- ステーキングを始めるには、1 TONの自己取引によってTONアカウントを有効化する必要があります。資金はウォレット内にそのまま残ります。これは、ステーキング有効化のためのステップにすぎません。
+ ステーキングを始めるには、1 TONを取引してTONアカウントを有効化する必要があります。資金はウォレット内にそのまま残ります。これは、ステーキング有効化のためのステップにすぎません。
アカウントの有効化
ステーキング金額は %s 以上である必要があります
ネットワークルールにより、ステーキング金額は%1$s TRX に切り上げられます。
ネットワークルールにより、ステーキング解除の量は%1$s TRX に切り上げられます。
+ APR %1$s%
ステーキング解除分を請求する
ステーキングアカウント手数料
ステーキングアカウントとは、ステーキングされたSOLが保管される特別なアカウントです。トークンをバリデーターに委任し、取引の検証に参加して報酬を受け取る際に作成されます。ステーキングアカウントの作成には少額の手数料がかかりますが、ステーキング完了後に返金されます。
@@ -1332,6 +1336,7 @@
受け取る
トークンを選択
利用不可
+ カードが凍結されています
入金
異議申し立て
取引を表示
@@ -1339,13 +1344,19 @@
手数料
カードを紛失したり盗まれたりしても、資金を安全に保てます。一時停止はいつでも解除できます。
カードを一時停止しますか?
+ カードを凍結できませんでした。しばらくしてからもう一度お試しください。
一時停止
+ カードが凍結されています
サポートを受ける
完了
拒否
保留中
銀行がこの取引リクエストを拒否しました。
この手数料は、送金処理にかかるコストをカバーするためのものです。
+ 資金は引き続き使用できます。いつでも一時停止できます。
+ カードの一時停止を解除しますか?
+ カードの凍結解除に失敗しました。しばらくしてからもう一度お試しください。
+ カードの凍結が解除されました
出金
資金を追加
入金オプション
@@ -1370,6 +1381,7 @@
表示
ポートフォリオ内のあらゆる資産をカードと交換
カードの詳細
+ カードの一時停止を解除
アカウントを作成してカードを発行
Tangem Pay
ステータスを表示
@@ -1825,7 +1837,7 @@
最大手数料
最小金額は、ネットワーク手数料がチャージ額の4%を超えないように現在の手数料に基づいて計算されます。その結果、最小金額は%1$s(%2$s)となります。
最低入金額
- 手数料ポリシー
+ 入金手数料ポリシー
Tangemはまた、得られた利回りに対して15%のサービス手数料を差し引きます。
ネットワーク手数料が下がるか、残高が最低必要額に達すると、資金は自動的にAaveに供給されます。
過去のリターン
@@ -1852,11 +1864,11 @@
入金すると、資金は自動的にAaveに送金され、利息が付き始めます。%sが取引手数料として差し引かれます。
資産を供給する
%sはAaveに供給されますが、管理可能な状態のままになります。
- 手数料ポリシーを見る
+ 入金手数料ポリシーを見る
次回の入金は自動的にAaveに供給されます。
アクティブ
停止中
- 利回りモードを無効にする
+ 利回りモードを解除中
これをオフにすると、Aaveから資産が引き出され、ウォレット内の%sに変換され、利回りの発生が停止します。
出金金額からネットワーク手数料が差し引かれます。
利回りモードを無効にする
diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml
index bcbee9cd62..1df2916b57 100644
--- a/core/res/src/main/res/values-ru/strings.xml
+++ b/core/res/src/main/res/values-ru/strings.xml
@@ -1616,7 +1616,7 @@
Максимальная комиссия
Минимальная сумма рассчитывается исходя из текущей комиссии сети, чтобы она не превышала 4%% от суммы пополнения, что составляет минимум %1$s (%2$s).
Минимальный депозит
- Политика комиссий
+ Политика комиссий за пополнение
Tangem взимает комиссию за обслуживание в размере 15% от полученного дохода.
Ваши средства будут автоматически переведены в Aave, как только комиссия сети снизится или баланс достигнет минимально необходимой суммы.
Историческая доходность
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 25532a4207..35f9ffc00b 100644
--- a/core/res/src/main/res/values-uk-rUA/strings.xml
+++ b/core/res/src/main/res/values-uk-rUA/strings.xml
@@ -160,6 +160,7 @@
Увімкнути
Увімкнено
Помилка
+ Комісія мережі за поповнення
Обміняти
Оглядач
Переглянути історію транзакцій
@@ -1139,6 +1140,7 @@
Надсилання коштів стане доступним після завершення транзакції(-ій) в мережі %s
Наразі продаж %s недоступний. Слідкуйте за нашими оновленнями.
Стейкінг %s зараз недоступний. Будь ласка, слідкуйте за нашими оновленнями.
+ Дозвіл скасовано. Ваші кошти залишаються в режимі прибутковості. Щоб виконати дії, перейдіть у режим прибутковості та надайте дозвіл знову.
Згенерувати XPUB
Приховати
Ви збираєтеся приховати цей токен з головного екрану. Ви можете додати його назад будь-коли на сторінці керування токенами.
diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml
index 6b1a0e2d9b..e73d6310e3 100644
--- a/core/res/src/main/res/values/strings.xml
+++ b/core/res/src/main/res/values/strings.xml
@@ -378,6 +378,7 @@
Available networks
Derivation of your token matches the derivation of %1$s. Your token will be added to this account.
Derivation belongs to another account.
+ Token added to %1$s account
Contract address
Contract address is invalid
Please select the network
diff --git a/features/manage-tokens/api/src/main/kotlin/com/tangem/features/managetokens/component/AddCustomTokenComponent.kt b/features/manage-tokens/api/src/main/kotlin/com/tangem/features/managetokens/component/AddCustomTokenComponent.kt
index c45a8667f6..e58aa8d6b4 100644
--- a/features/manage-tokens/api/src/main/kotlin/com/tangem/features/managetokens/component/AddCustomTokenComponent.kt
+++ b/features/manage-tokens/api/src/main/kotlin/com/tangem/features/managetokens/component/AddCustomTokenComponent.kt
@@ -2,6 +2,7 @@ package com.tangem.features.managetokens.component
import com.tangem.core.decompose.factory.ComponentFactory
import com.tangem.core.ui.decompose.ComposableBottomSheetComponent
+import com.tangem.domain.models.account.Account
interface AddCustomTokenComponent : ComposableBottomSheetComponent {
@@ -9,7 +10,7 @@ interface AddCustomTokenComponent : ComposableBottomSheetComponent {
val mode: AddCustomTokenMode,
val source: ManageTokensSource,
val onDismiss: () -> Unit,
- val onCurrencyAdded: () -> Unit,
+ val onCurrencyAdded: (account: Account?) -> Unit,
)
interface Factory : ComponentFactory
diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/CustomTokenDerivationInputComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/CustomTokenDerivationInputComponent.kt
index 56f2b08ca9..d4bac9bb7a 100644
--- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/CustomTokenDerivationInputComponent.kt
+++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/CustomTokenDerivationInputComponent.kt
@@ -3,11 +3,13 @@ package com.tangem.features.managetokens.component
import com.tangem.core.decompose.factory.ComponentFactory
import com.tangem.core.ui.decompose.ComposableDialogComponent
import com.tangem.features.managetokens.entity.customtoken.SelectedDerivationPath
+import com.tangem.features.managetokens.entity.customtoken.SelectedNetwork
internal interface CustomTokenDerivationInputComponent : ComposableDialogComponent {
data class Params(
val mode: AddCustomTokenMode,
+ val selectedNetwork: SelectedNetwork,
val onConfirm: (SelectedDerivationPath) -> Unit,
val onDismiss: () -> Unit,
)
diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/CustomTokenSelectorComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/CustomTokenSelectorComponent.kt
index a4ec53c9d9..f23d966cf2 100644
--- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/CustomTokenSelectorComponent.kt
+++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/CustomTokenSelectorComponent.kt
@@ -2,6 +2,7 @@ package com.tangem.features.managetokens.component
import com.tangem.core.decompose.factory.ComponentFactory
import com.tangem.core.ui.decompose.ComposableContentComponent
+import com.tangem.domain.models.account.Account
import com.tangem.features.managetokens.entity.customtoken.SelectedDerivationPath
import com.tangem.features.managetokens.entity.customtoken.SelectedNetwork
@@ -19,7 +20,7 @@ internal interface CustomTokenSelectorComponent : ComposableContentComponent {
val mode: AddCustomTokenMode,
val selectedNetwork: SelectedNetwork,
val selectedDerivationPath: SelectedDerivationPath?,
- val onDerivationPathSelected: (SelectedDerivationPath) -> Unit,
+ val onDerivationPathSelected: (SelectedDerivationPath, Account?) -> Unit,
) : Params()
}
diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultAddCustomTokenComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultAddCustomTokenComponent.kt
index 1951b3cd44..8e270519a8 100644
--- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultAddCustomTokenComponent.kt
+++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultAddCustomTokenComponent.kt
@@ -14,6 +14,7 @@ import com.tangem.core.decompose.context.AppComponentContext
import com.tangem.core.decompose.context.childByContext
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
import com.tangem.core.ui.decompose.ComposableContentComponent
+import com.tangem.domain.models.account.Account
import com.tangem.domain.models.network.Network
import com.tangem.features.managetokens.analytics.CustomTokenAnalyticsEvent
import com.tangem.features.managetokens.component.AddCustomTokenComponent
@@ -42,6 +43,8 @@ internal class DefaultAddCustomTokenComponent @AssistedInject constructor(
step = AddCustomTokenConfig.Step.INITIAL_NETWORK_SELECTOR,
)
+ private var addedToAccount: Account? = null
+
private val navigation = StackNavigation()
private val contentStack = childStack(
key = "add_custom_token_content_stack",
@@ -57,6 +60,7 @@ internal class DefaultAddCustomTokenComponent @AssistedInject constructor(
}
override fun dismiss() {
+ addedToAccount = null
params.onDismiss()
}
@@ -163,12 +167,13 @@ internal class DefaultAddCustomTokenComponent @AssistedInject constructor(
showForm(network = network)
}
- private fun changeDerivationPath(derivationPath: SelectedDerivationPath) {
+ private fun changeDerivationPath(derivationPath: SelectedDerivationPath, account: Account?) {
val event = CustomTokenAnalyticsEvent.DerivationSelected(
derivationName = derivationPath.name,
source = params.source,
)
analyticsEventHandler.send(event)
+ addedToAccount = account
showForm(derivationPath = derivationPath)
}
@@ -228,8 +233,8 @@ internal class DefaultAddCustomTokenComponent @AssistedInject constructor(
}
private fun dismissAndNotify() {
+ params.onCurrencyAdded(addedToAccount)
dismiss()
- params.onCurrencyAdded()
}
@AssistedFactory
diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultCustomTokenDerivationInputComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultCustomTokenDerivationInputComponent.kt
index 8c093ac7d6..7a8ab034ac 100644
--- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultCustomTokenDerivationInputComponent.kt
+++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultCustomTokenDerivationInputComponent.kt
@@ -108,7 +108,7 @@ internal class DefaultCustomTokenDerivationInputComponent @AssistedInject constr
val value = state.value.value.text
val model = SelectedDerivationPath(
- id = null,
+ id = params.selectedNetwork.id,
value = Network.DerivationPath.Custom(value),
name = value,
isDefault = false,
diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultCustomTokenSelectorComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultCustomTokenSelectorComponent.kt
index 44c781e3cc..423bfb6d36 100644
--- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultCustomTokenSelectorComponent.kt
+++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultCustomTokenSelectorComponent.kt
@@ -42,6 +42,7 @@ internal class DefaultCustomTokenSelectorComponent @AssistedInject constructor(
context = childByContext(context),
params = CustomTokenDerivationInputComponent.Params(
mode = config.mode,
+ selectedNetwork = config.network,
onConfirm = model::selectCustomDerivationPath,
onDismiss = model.dialogNavigation::dismiss,
),
diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultManageTokensComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultManageTokensComponent.kt
index 9dc5539ae4..bddf89e1cf 100644
--- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultManageTokensComponent.kt
+++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/impl/DefaultManageTokensComponent.kt
@@ -12,10 +12,16 @@ import com.tangem.core.decompose.context.AppComponentContext
import com.tangem.core.decompose.context.childByContext
import com.tangem.core.decompose.model.getOrCreateModel
import com.tangem.core.ui.decompose.ComposableBottomSheetComponent
+import com.tangem.core.ui.extensions.resourceReference
+import com.tangem.core.ui.extensions.wrappedList
+import com.tangem.core.ui.message.SnackbarMessage
+import com.tangem.domain.models.account.Account
+import com.tangem.domain.models.account.AccountName
import com.tangem.features.managetokens.component.AddCustomTokenComponent
import com.tangem.features.managetokens.component.AddCustomTokenMode
import com.tangem.features.managetokens.component.ManageTokensComponent
import com.tangem.features.managetokens.entity.managetokens.ManageTokensBottomSheetConfig
+import com.tangem.features.managetokens.impl.R
import com.tangem.features.managetokens.model.ManageTokensModel
import com.tangem.features.managetokens.ui.ManageTokensScreen
import dagger.assisted.Assisted
@@ -64,7 +70,20 @@ internal class DefaultManageTokensComponent @AssistedInject constructor(
mode = mode,
source = params.source,
onDismiss = model.bottomSheetNavigation::dismiss,
- onCurrencyAdded = model::reloadList,
+ onCurrencyAdded = { account ->
+ val accountName = account?.accountName as? AccountName.Custom
+ if (accountName != null && (account as? Account.CryptoPortfolio)?.isMainAccount == false) {
+ messageSender.send(
+ SnackbarMessage(
+ message = resourceReference(
+ R.string.custom_token_another_account_snackbar_text,
+ wrappedList(accountName.value),
+ ),
+ ),
+ )
+ }
+ model.reloadList()
+ },
),
)
}
diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewAddCustomTokenComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewAddCustomTokenComponent.kt
index 239866349d..7427de4342 100644
--- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewAddCustomTokenComponent.kt
+++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewAddCustomTokenComponent.kt
@@ -63,7 +63,7 @@ internal class PreviewAddCustomTokenComponent(
mode = config.mode,
selectedNetwork = config.selectedNetwork!!,
selectedDerivationPath = config.selectedDerivationPath!!,
- onDerivationPathSelected = {},
+ onDerivationPathSelected = { _, _ -> },
),
).Content(modifier)
}
diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewCustomTokenSelectorComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewCustomTokenSelectorComponent.kt
index 9d4485dee8..71f9caee9a 100644
--- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewCustomTokenSelectorComponent.kt
+++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewCustomTokenSelectorComponent.kt
@@ -43,7 +43,7 @@ internal class PreviewCustomTokenSelectorComponent(
value = d.value.value.orEmpty(),
networkName = stringReference(d.name),
isSelected = d.value == params.selectedDerivationPath?.value,
- onSelectedStateChange = { params.onDerivationPathSelected(d) },
+ onSelectedStateChange = { params.onDerivationPathSelected(d, null) },
)
}
is Params.NetworkSelector -> {
diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/customtoken/CustomTokenSelectorDialogConfig.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/customtoken/CustomTokenSelectorDialogConfig.kt
index fc34e8cdda..9d7685fb1d 100644
--- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/customtoken/CustomTokenSelectorDialogConfig.kt
+++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/entity/customtoken/CustomTokenSelectorDialogConfig.kt
@@ -9,5 +9,6 @@ internal sealed class CustomTokenSelectorDialogConfig {
@Serializable
data class CustomDerivationInput(
val mode: AddCustomTokenMode,
+ val network: SelectedNetwork,
) : CustomTokenSelectorDialogConfig()
}
\ No newline at end of file
diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/model/CustomTokenSelectorModel.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/model/CustomTokenSelectorModel.kt
index cadcf9f356..c57d03a4e8 100644
--- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/model/CustomTokenSelectorModel.kt
+++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/model/CustomTokenSelectorModel.kt
@@ -18,6 +18,7 @@ import com.tangem.core.ui.message.SnackbarMessage
import com.tangem.domain.account.featuretoggle.AccountsFeatureToggles
import com.tangem.domain.account.status.supplier.SingleAccountStatusListSupplier
import com.tangem.domain.managetokens.GetSupportedNetworksUseCase
+import com.tangem.domain.models.account.Account
import com.tangem.domain.models.account.AccountStatus
import com.tangem.domain.models.network.Network
import com.tangem.features.managetokens.component.AddCustomTokenMode
@@ -126,7 +127,7 @@ internal class CustomTokenSelectorModel @Inject constructor(
isDefault = true,
)
- selector.onDerivationPathSelected(model)
+ selector.onDerivationPathSelected(model, null)
},
)
}
@@ -151,7 +152,7 @@ internal class CustomTokenSelectorModel @Inject constructor(
isDefault = false,
)
- selector.onDerivationPathSelected(model)
+ selector.onDerivationPathSelected(model, null)
},
)
}
@@ -171,7 +172,10 @@ internal class CustomTokenSelectorModel @Inject constructor(
private fun showCustomDerivationInput() {
val config = when (params) {
is NetworkSelector -> return
- is DerivationPathSelector -> CustomTokenSelectorDialogConfig.CustomDerivationInput(params.mode)
+ is DerivationPathSelector -> CustomTokenSelectorDialogConfig.CustomDerivationInput(
+ params.mode,
+ params.selectedNetwork,
+ )
}
dialogNavigation.activate(config)
@@ -183,14 +187,14 @@ internal class CustomTokenSelectorModel @Inject constructor(
is DerivationPathSelector -> if (accountsFeatureToggles.isFeatureEnabled) {
params.checkAccountDerivation(value)
} else {
- params.onDerivationPathSelected(value)
+ params.onDerivationPathSelected(value, null)
}
}
}
private fun DerivationPathSelector.checkAccountDerivation(derivationPath: SelectedDerivationPath) =
modelScope.launch {
- val accountName = derivationPath.id
+ val account = derivationPath.id
?.let { Blockchain.fromId(it.rawId.value) }?.let(::AccountNodeRecognizer)
?.let { recognizer -> derivationPath.value.value?.let { recognizer.recognize(it) } }
?.let { accountNode ->
@@ -199,24 +203,27 @@ internal class CustomTokenSelectorModel @Inject constructor(
val accounts = singleAccountStatusListSupplier(mode.userWalletId)
.first().accountStatuses
- val account = accounts.find {
+
+ val accountStatus = accounts.find {
when (it) {
is AccountStatus.CryptoPortfolio -> it.sameNodeAndNotMain()
}
}
- val accountName = when (account) {
- is AccountStatus.CryptoPortfolio -> account.account.accountName.toUM()
- null -> null
- }
- accountName
+
+ accountStatus?.account
}
+ val accountName = when (account) {
+ is Account.CryptoPortfolio -> account.accountName
+ null -> null
+ }
+
if (accountName == null) {
- onDerivationPathSelected(derivationPath)
+ onDerivationPathSelected(derivationPath, null)
} else {
showAccountNameExist(
- accountName = accountName.value,
- onClick = { onDerivationPathSelected(derivationPath) },
+ accountName = accountName.toUM().value,
+ onClick = { onDerivationPathSelected(derivationPath, account) },
)
}
}
diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/ui/CustomTokenSelectorContent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/ui/CustomTokenSelectorContent.kt
index 37097a8f34..b023409947 100644
--- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/ui/CustomTokenSelectorContent.kt
+++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/ui/CustomTokenSelectorContent.kt
@@ -288,7 +288,7 @@ private class CustomTokenNetworkSelectorComponentPreviewProvider :
name = "",
isDefault = false,
),
- onDerivationPathSelected = {},
+ onDerivationPathSelected = { _, _ -> },
),
),
PreviewCustomTokenSelectorComponent(