From d38b62a559683d9c43b2087db1b9f7cc08244ebf Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 6 Aug 2025 12:37:22 +0500 Subject: [PATCH 1/2] Updated on 2026-08-14 --- core/res/src/main/res/values-de/strings.xml | 8 +- core/res/src/main/res/values-es/strings.xml | 8 +- core/res/src/main/res/values-fr/strings.xml | 8 +- core/res/src/main/res/values-it/strings.xml | 1 + core/res/src/main/res/values-ja/strings.xml | 33 ++- core/res/src/main/res/values-ru/strings.xml | 10 +- .../src/main/res/values-uk-rUA/strings.xml | 10 +- .../src/main/res/values-zh-rTW/strings.xml | 1 + core/res/src/main/res/values/strings.xml | 40 +++- .../impl/ui/WalletSelectorBottomSheet.kt | 2 +- .../receive/ui/NFTReceiveNetworksContent.kt | 2 +- .../connections/components/AlertsComponent.kt | 28 --- .../components/WcSelectNetworksComponent.kt | 12 +- .../components/WcSelectWalletComponent.kt | 128 ++++++------ .../model/WcConnectedAppInfoModel.kt | 6 +- .../connections/model/WcConnectionsModel.kt | 5 +- .../connections/model/WcPairModel.kt | 11 +- .../WcConnectButtonAvailabilityConverter.kt | 1 - .../transformers/WcNetworksInfoConverter.kt | 1 - .../connections/ui/AlertsModalBottomSheet.kt | 189 +----------------- .../connections/ui/WcAppInfoBS.kt | 10 +- .../connections/ui/WcConnectedAppInfoBS.kt | 3 +- .../blockaid/TransactionCheckResultsUM.kt | 6 - .../entity/common/WcCommonTransactionModel.kt | 6 +- .../utils/WcNotificationsFactory.kt | 10 +- 25 files changed, 199 insertions(+), 340 deletions(-) delete mode 100644 features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/blockaid/TransactionCheckResultsUM.kt diff --git a/core/res/src/main/res/values-de/strings.xml b/core/res/src/main/res/values-de/strings.xml index ead5525ab6..aa10a37bfa 100644 --- a/core/res/src/main/res/values-de/strings.xml +++ b/core/res/src/main/res/values-de/strings.xml @@ -120,11 +120,13 @@ Token hinzufügen Alle Erlauben + Betrag Analysen Anwenden Genehmigung Genehmigen Achtung + Verfügbare Netzwerke Sicherungskopie Bilanz: %s Saldo @@ -139,6 +141,7 @@ Aktion wählen Netzwerk auswählen Token auswählen + Wallet auswählen Beanspruchen Stakingbelohnungen beanspruchen Schließen @@ -165,6 +168,7 @@ Deaktiviert Trennen Erledigt + Bearbeiten Aktivieren Aktiviert Fehler @@ -199,6 +203,7 @@ NFT Nein Keine Adresse + Nicht hinzugefügt Jetzt OK Im Browser öffnen @@ -474,14 +479,12 @@ Dein Portfolio wurde aktualisiert Der ausgewählte Token ist derzeit nicht für Aktionen innerhalb der Krypto-Wallet verfügbar. Aber keine Sorge, du kannst dein Interesse bekunden, indem du den Token hochstufen. Hochstimmen - Wallet auswählen Das Wallet unterstützt nicht mehr als ein Netzwerk Um dieses Asset zu kaufen, zu tauschen oder zu erhalten, füge diesen Deinem Portfolio hinzu Dieses Asset wird derzeit in der Wallet nicht unterstützt. Dieses Asset ist für dieses Wallet nicht verfügbar Hinzufügen APY %s - Verfügbare Netzwerke Mein Portfolio Markt Um Adressen für ausgewählte Netzwerke zu generieren, musst du eine Tangem-Karte oder Ring scannen @@ -615,7 +618,6 @@ NFT erhalten Du hast dieses Netzwerk noch nicht hinzugefügt. Um NFTs zu erhalten, füge es Deinem Portfolio hinzu. Netzwerk nicht hinzugefügt - Nicht hinzugefügt Nicht unterstützte NFT-Arten cNFTs und pNFTs werden derzeit nicht unterstützt. Bitte sende diese nicht an Deine Wallet. NFT senden diff --git a/core/res/src/main/res/values-es/strings.xml b/core/res/src/main/res/values-es/strings.xml index 1ce6e28079..6f67b2c033 100644 --- a/core/res/src/main/res/values-es/strings.xml +++ b/core/res/src/main/res/values-es/strings.xml @@ -109,11 +109,13 @@ Agregar token Todos Autorizar + Montante Analítica Aplicar Aprobación Aprobar Atención + Redes disponibles Saldo: %s Saldo autenticación biométrica @@ -127,6 +129,7 @@ Elige una acción Elegir red Elige token + Elegir wallet Reclamar Reclame recompensas Cerrar @@ -153,6 +156,7 @@ Desactivado Desconectar Listo + Editar Activar Activado Error @@ -186,6 +190,7 @@ NFT No Ninguna dirección + No aregada Ahora OK Abrir en el navegador @@ -446,14 +451,12 @@ Su portafolio ha sido actualizada El token seleccionado no está disponible actualmente para acciones dentro de la billetera cripto. Pero no se preocupa, puede expresar su interés votando a favor. Votar a favor - Elegir wallet La billetera no admite más de una red Para comprar, intercambiar o recibir este activo, agréguelo a su portafolio Este activo no está disponible en la billetera Este activo no está disponible para esta billetera Añadir APY %s - Redes disponibles Mi portafolio Mercado Para generar direcciones para las redes seleccionadas, debe escanear su tarjeta Tangem @@ -587,7 +590,6 @@ Recibir NFT Todavía no ha agregado esta red. Para recibir NFTs, añádala a su portafolio. Red no agregada - No aregada Tipos de NFT no compatibles cNFT y pNFT aún no son compatibles. Por favor, no los envíes a tu billetera. Enviar NFT diff --git a/core/res/src/main/res/values-fr/strings.xml b/core/res/src/main/res/values-fr/strings.xml index b28e3174c2..a4140af715 100644 --- a/core/res/src/main/res/values-fr/strings.xml +++ b/core/res/src/main/res/values-fr/strings.xml @@ -99,11 +99,13 @@ Ajouter un jeton Tous Permettre + Montant Analytique Appliquer Approbation Approuver Attention + Réseaux disponibles Solde : %s Solde authentification biométrique @@ -117,6 +119,7 @@ Choisissez une action Choisissez le réseau Choisir le jeton + Choisissez un portefeuille Réclamer Réclamez des récompenses Fermer @@ -140,6 +143,7 @@ Désactivé Se déconnecter Exécuté + Modifier Activer Activé Erreur @@ -173,6 +177,7 @@ NFT Non Aucune adresse + Non ajouté Maintenant OK Ouvrir dans le navigateur @@ -432,14 +437,12 @@ Votre portfolio a été mis à jour Le jeton sélectionné n\'est actuellement pas disponible pour des actions dans le portefeuille crypto. Mais ne vous inquiétez pas, vous pouvez exprimer votre intérêt en votant positivement. Vote positif - Choisissez un portefeuille Le portefeuille ne prend pas en charge plus d\'un réseau Pour acheter, échanger ou recevoir cet actif, ajoutez-le à votre portefeuille Cet actif n\'est pas pris en charge dans le portefeuille Cet actif n\'est pas disponible pour ce portefeuille Ajoutez un jeton APY %s - Réseaux disponibles Mon portfolio Marché Pour générer des adresses pour les réseaux sélectionnés, vous devez scanner votre carte Tangem @@ -573,7 +576,6 @@ Recevoir des NFT Vous n\'avez pas encore ajouté ce réseau. Pour recevoir des NFT, ajoutez-le à votre portefeuille. Réseau non ajouté - Non ajouté Types de NFT non pris en charge Les cNFT et les pNFT ne sont pas encore pris en charge Envoyer un NFT diff --git a/core/res/src/main/res/values-it/strings.xml b/core/res/src/main/res/values-it/strings.xml index 7132029cfe..5caec91961 100644 --- a/core/res/src/main/res/values-it/strings.xml +++ b/core/res/src/main/res/values-it/strings.xml @@ -5,6 +5,7 @@ Questa carta non è progettata per funzionare con Tangem L\'importo inviato e il cambio non può essere inferiore a 1 ADA Accetta + Importo Saldo: %s Impossibile creare la transazione Non hai fornito l\'accesso alla tua videocamera, modifica le tue impostazioni sulla privacy diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml index af6731c66e..a785951f19 100644 --- a/core/res/src/main/res/values-ja/strings.xml +++ b/core/res/src/main/res/values-ja/strings.xml @@ -12,6 +12,18 @@ ウォレットのロックを解除するには、 %s桁のアクセスコードを設定します。 アクセスコードの作成 アクセスコード + アカウントを追加 + 保存 + アカウント名 + アカウント + 新しいアカウント + アカウントを追加 + アカウントを編集 + 編集を続ける + 破棄 + 新しいアカウントを破棄してもよろしいですか? + 編集内容を破棄してもよろしいですか? + 保存されていない変更 トークンが見つかりませんか?メインページのマーケットセクションに移動し、ポートフォリオに追加して買付できるようにします。 トークンが見つかりませんか?メインページのマーケットセクションに移動し、ポートフォリオに追加して売却できるようにします。 売却 @@ -127,11 +139,13 @@ トークンを追加 すべて 許可する + 金額 アナリティクス 適用する 承認 承認 注意 + 利用可能なネットワーク バックアップ 残高: %s 残高 @@ -146,6 +160,7 @@ アクションを選択 ネットワークを選択 トークンを選択 + ウォレットを選択 請求 報酬を受け取る 閉じる @@ -170,6 +185,7 @@ 無効 切断 完了 + 編集 有効にする 有効 エラー @@ -204,6 +220,7 @@ NFT いいえ アドレスがありません + 未追加 わかりました ブラウザで開く @@ -315,6 +332,9 @@ 詳細 インターネット接続を確認するか、別のネットワークに切り替えてください。 利用規約 + 他のネットワークで資産を送金すると、永久に失われます。 + %sネットワーク + 下記のみを使用して資金を送金する 別のウォレットのカードまたはリングを使用しました。このウォレットにリンクしているカードまたはリングをタップしてください。 取引に必要な資金が不足しています。アカウントに入金してください。 マイトークン @@ -480,14 +500,12 @@ ポートフォリオが更新されました 選択したトークンは現在、暗号資産ウォレット内でのアクションには利用できません。しかし、心配しないでください。賛成票を投じることで関心を表明できます。 賛成票を投じる - ウォレットを選択 ウォレットは複数のネットワークをサポートしていません。 このアセットを購入・交換・受け取るには、ポートフォリオに追加してください。 このアセットは現在ウォレットで利用できません このアセットはこのウォレットでは使用できません。 追加 APY %s - 利用可能なネットワーク 私のポートフォリオ マーケット 選択したネットワークのアドレスを生成するには、Tangemウォレットカードまたはリングをスキャンする必要があります。 @@ -618,7 +636,6 @@ NFTを受け取る このネットワークはまだ追加されていません。NFTを受け取るには、ポートフォリオに追加してください。 ネットワークが追加されていません - 未追加 サポートされていないNFTタイプ cNFTとpNFTはまだサポートされていません。ウォレットに送信しないでください。 NFTを送信する @@ -1110,6 +1127,7 @@ 手数料見積りエラーです。サポートにフィードバックをお送りください。 スワップする 選択したトークンをこの量を交換すると、価格に大きな影響が生じ、結果が減少します。 + 価格への影響が甚大です 残高不足 許可を与える スワップ @@ -1285,6 +1303,7 @@ このウォレットを保護するためのシークレットコードです。ログインと署名に使用されます。 アクセスコードの設定 / 変更 ウォレットの受信取引とTangemの更新について通知を受け取る。 + 現在、Huaweiデバイスではプッシュ通知が機能しない可能性があります。現在、解決策の検討に取り組んでおり、今後のアップデートで修正をリリースする予定です。ご理解のほどよろしくお願いいたします。 取引通知 ウォレット設定 Tangem @@ -1410,6 +1429,7 @@ ネットワーク 無制限 ウォレット + 接続されたアプリ 接続されたネットワーク ウォレットの残高とアクティビティを表示する 通知なしに取引に署名する @@ -1426,16 +1446,22 @@ すべてのdAppを接続解除する ウォレットの変更の予測 取引をシミュレーションできませんでした。注意して続行してください。 + %sでは見積もりはサポートされていません + %sによる提案 悪意のある取引 このウォレットのポートフォリオに%sネットワークを追加します ウォレットに必要なネットワークはありません 新しい接続 ウォレットを別のdAppに接続する セッションなし + ウォレットの変更は検出されませんでした このドメインは複数のセキュリティプロバイダーから安全でないとの警告を受けています。あなたの資産を守るため、直ちにアクセスを中止してください。 既知のセキュリティリスク リクエスト元 + とにかく送金 署名タイプ + dApp接続には、少なくとも1つのネットワークが必要です + 選択したネットワークを指定する 宛先 取引リクエスト 取引リクエスト @@ -1443,6 +1469,7 @@ 各ペアリング試行で、新しくユニークなURIが使用されていることを確認します URIはすでに使用されています ウォレットコネクト + 不審な取引 破棄 バックアップが中断されました。再開しますか? はい、再開します diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index 5a430645a7..68950a67cc 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -96,11 +96,13 @@ Добавить токен Все Разрешить + Сумма Аналитика Применить Одобрение Подтвердить Внимание + Доступные сети Баланс: %s Баланс биометрическую аутентификацию @@ -114,6 +116,7 @@ Выберите действие Выберите сеть Выберите токен + Выберите кошелек Получить Вывести награду Закрыть @@ -140,6 +143,7 @@ Отключено Отключить Готово + Изменить Включить Включено Ошибка @@ -172,6 +176,7 @@ NFT Нет Нет адреса + Не добавлено Сейчас OK Открыть в браузере @@ -425,13 +430,11 @@ Ваш портфель был обновлен Выбранный токен не доступен в кошельке на данный момент. Но не переживайте, вы можете выразить свой интерес проголосовав за его добавление. Голосовать - Выберите кошелек Кошелёк не поддерживает более одной сети Чтобы купить, обменять или получить данный токен, вам нужно добавить его к себе в портфель Этот актив в настоящее время не поддерживается в кошельке Этот токен не доступен для данного кошелька Добавить - Доступные сети Мой портфель Рынок Чтобы создать адреса для выбранных сетей, отсканируйте вашу карту или кольцо Tangem кошелька @@ -571,7 +574,6 @@ Получить NFT Вы ещё не добавили эту сеть. Чтобы получать NFT, добавьте её в ваш портфель. Сеть не добавлена - Не добавлено Неподдерживаемый тип NFT cNFT и pNFT не поддерживаются. Пожалуйста, не отправляйте их на свой кошелёк. Отправить NFT @@ -1279,7 +1281,7 @@ Возможно, баланс устарел. Обновите страницу. Недостаточно %1$s. Пополните свой счет %2$s для выполнения ассоциации токена Открыть Trustline - Согласно правилам сети, чтобы пополнить этот токен, необходимо сначала открыть Trustline — это позволит вашему кошельку принимать и хранить этот актив. + Чтобы получить этот токен, необходимо включить Trustline. Сеть требует резерв %1$s %2$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 9b3e3dfe52..bc736e28ba 100644 --- a/core/res/src/main/res/values-uk-rUA/strings.xml +++ b/core/res/src/main/res/values-uk-rUA/strings.xml @@ -96,11 +96,13 @@ Додати токен Усе Дозволити + Сума Аналітика Застосовувати Затвердження Підтвердити Увага + Доступні мережі Баланс: %s Баланс біометричну автентифікацію @@ -113,6 +115,7 @@ Змінити Виберіть дію Оберіть токен + Оберіть гаманець Отримати Отримати винагороди Закрити @@ -139,6 +142,7 @@ Вимкнуто Від\'єднати Готово + Редагувати Увімкнути Увімкнено Помилка @@ -171,6 +175,7 @@ NFT Ні Немає адреси + Не додано Зараз ОК Відкрити в браузері @@ -424,13 +429,11 @@ Ваше портфоліо оновлено Обраний токен наразі недоступний для дій у криптогаманці. Але не хвилюйтеся, ви можете висловити свою зацікавленість, проголосувавши за його інтеграцію. Проголосувати - Оберіть гаманець Гаманець не підтримує більше однієї мережі Щоб купити, обміняти або отримати цей актив, додайте його до свого портфоліо Цей актив наразі не підтримується в гаманці Цей токен недоступний для цього гаманця Додати - Доступні мережі Моє портфоліо Маркет Щоб згенерувати адреси для обраних мереж, відскануйте вашу картку або кільце Tangem гаманця @@ -570,7 +573,6 @@ Отримати NFT Ви ще не додали цю мережу. Щоб отримувати NFT, додайте її до свого портфоліо. Мережу не додано - Не додано Непідтримувані типи NFT cNFT і pNFT наразі не підтримуються. Будь ласка, не надсилайте їх на свій гаманець. Надіслати NFT @@ -1278,7 +1280,7 @@ Баланс може бути застарілим. Оновіть сторінку. Недостатньо %1$s. Поповніть свій рахунок %2$s, щоб прив’язати цей токен. Відкрити Trustline - Відповідно до правил мережі, щоб поповнити цей токен, спочатку потрібно відкрити Trustline — це дозволить вашому гаманцю приймати та зберігати цей актив. + Щоб отримати цей токен, потрібно увімкнути Trustline. Мережа вимагає резерв %1$s %2$s. Відкрийте Trustline Будь ласка, поверніться до браузеру і повторно підключіться через WalletConnect. Обрана не вірна картка або кільце diff --git a/core/res/src/main/res/values-zh-rTW/strings.xml b/core/res/src/main/res/values-zh-rTW/strings.xml index d5ccd296e0..b33588b325 100644 --- a/core/res/src/main/res/values-zh-rTW/strings.xml +++ b/core/res/src/main/res/values-zh-rTW/strings.xml @@ -40,6 +40,7 @@ 卡片設置 發送金額和找零不能少於1個ADA 接受 + 數量 允許 注意 餘額: %s diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 704c48f319..039b9d2cdb 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -12,7 +12,18 @@ Set a %s-digit Access Code to unlock your wallet. Create Access Code Access code + Add account + Save Account name + Account + New account + Add account + Edit account + Keep Editing + Discard + Are you sure you want to discard new account? + Are you sure you want to discard edits? + Unsaved Changes Can’t find your token? Go to the Market section on the main page and add it to your portfolio for purchase Can’t find your token? Go to the Market section on the main page and add it to your portfolio for selling. Sell @@ -132,11 +143,13 @@ Add token All Allow + Amount Analytics Apply Approval Approve Attention + Available networks Backup Balance: %s Balance @@ -151,6 +164,7 @@ Choose action Choose network Choose token + Choose wallet Claim Claim rewards Close @@ -177,6 +191,7 @@ Disabled Disconnect Done + Edit Enable Enabled Error @@ -211,6 +226,7 @@ NFT No No address + Not Added Now OK Open in Browser @@ -226,6 +242,7 @@ Reject Reload Rename + Required Save Save changes Search @@ -323,6 +340,9 @@ Details Check your internet connection or switch to a different network Terms of service + Sending assets in other networks will result in permanent loss. + %s network + Send funds using only You have used a card or ring from another wallet. Tap the card or ring associated with this wallet Not enough funds for the transaction. Please top up your account. My tokens @@ -432,6 +452,8 @@ Finish Now Finish Wallet Activation To complete setup, secure app access with Access Code. + If you do, you\'ll need to start over. + Are you sure you want to exit the activation process? Recover an existing wallet stored in your Google Drive backup Google Drive Backup Go to backup @@ -491,14 +513,12 @@ Your portfolio has been updated The selected token is currently unavailable for actions within the crypto wallet. But worry not, you can express your interest by upvoting it. Upvote - Choose wallet The wallet doesn\'t support more than one network To buy, exchange, or receive this asset, add it to your portfolio This asset is currently not supported in the wallet This asset is not available for this wallet Add APY %s - Available networks My portfolio Market To generate addresses for selected networks, you must scan your Tangem Wallet card or ring @@ -632,7 +652,6 @@ Receive NFT You haven\'t added this network yet. To receive NFTs, add it to your portfolio. Network not added - Not Added Unsupported NFT types cNFTs and pNFTs are not supported yet. Please don\'t send them to your wallet. Send NFT @@ -1129,6 +1148,7 @@ Fee estimation error. Please send feedback to support. You swap Swapping this amount of selected tokens will cause a significant price impact and reduce your outcome. + High price impact Insufficient funds Give Permission Swap @@ -1351,9 +1371,11 @@ Discover Tangem Wallet Secret code to protect this wallet. Used for login and signatures. Set/Change Access Code + Change Access Code Stay notified on wallet incoming transactions and Tangem updates. Push notifications may currently not work on Huawei devices. We\'re actively working on a solution and will release a fix in an upcoming update. Thank you for your understanding! Transaction Notifications + Set Access Code Wallet settings Tangem Use %s or scan a card/ring to unlock access to your wallet @@ -1471,6 +1493,7 @@ Verified domain Wrong card or ring selected in the App We\'ve got some kind of problem + All dApps disconnected Allow to spend Address Connect @@ -1479,7 +1502,9 @@ Networks Unlimited Wallet + Connected App Connected networks + Connected to %1$s View your wallet balance and activity Sign transactions without your notice Request approval for transactions @@ -1490,11 +1515,16 @@ Contents Copy data Custom allowance + dApp disconnected Disconnect all Text about discnected all dApps Disconect All dApps Estimated wallet changes The transaction couldn\'t be simulated. Please proceed with caution. + Estimation is not supported for %s + Suggested by %s + Top up your balance to cover the network fee + Insufficient %1$s Malicious transaction Add the %s network to your portfolio for this wallet The wallet has no required networks @@ -1505,7 +1535,11 @@ This domain is flagged as unsafe by multiple security providers. Leave immediately to protect your assets Known security risk Request from + Send anyway Signature Type + At least one network is required for dApp connection + Specify selected networks + Successfully signed To Transaction request Transaction request diff --git a/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/WalletSelectorBottomSheet.kt b/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/WalletSelectorBottomSheet.kt index 615c95ba9f..23e63c41f4 100644 --- a/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/WalletSelectorBottomSheet.kt +++ b/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/ui/WalletSelectorBottomSheet.kt @@ -36,7 +36,7 @@ internal fun WalletSelectorBottomSheet(config: TangemBottomSheetConfig) { addBottomInsets = false, title = { content -> TangemTopAppBar( - title = resourceReference(R.string.manage_tokens_wallet_selector_title), + title = resourceReference(R.string.common_choose_wallet), titleAlignment = Alignment.CenterHorizontally, startButton = TopAppBarButtonUM.Back(content.onBack), height = TangemTopAppBarHeight.BOTTOM_SHEET, diff --git a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceiveNetworksContent.kt b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceiveNetworksContent.kt index 26d245c7f2..06c8648a94 100644 --- a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceiveNetworksContent.kt +++ b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceiveNetworksContent.kt @@ -58,7 +58,7 @@ internal fun NFTReceiveNetworksContent(state: NFTReceiveUM.Networks.Content, mod item( key = "not_available_title", ) { - Title(resourceReference(R.string.nft_receive_unavailable_section_title)) + Title(resourceReference(R.string.common_not_added)) } networks(state.unavailableItems) } diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/AlertsComponent.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/AlertsComponent.kt index c4c0032fa8..6fd6fde73b 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/AlertsComponent.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/AlertsComponent.kt @@ -33,38 +33,10 @@ internal class AlertsComponent( internal sealed class AlertType : TangemBottomSheetConfigContent { abstract val onDismiss: () -> Unit - @Serializable - data class VerifiedDomain(val appName: String, override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class UnknownDomain(val onConnect: () -> Unit, override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class UnsafeDomain(val onConnect: () -> Unit, override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class UnsupportedNetworks(val appName: String, override val onDismiss: () -> Unit) : AlertType() - @Serializable data class UnsupportedMethod(override val onDismiss: () -> Unit) : AlertType() @Serializable data class WcDisconnected(override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class UnknownError(val errorCode: Int, override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class WrongCardSelected(override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class ConnectionTimeout(val onTryAgain: () -> Unit, override val onDismiss: () -> Unit) : AlertType() - - @Serializable - data class MaliciousTransaction( - val descriptionMessage: String, - val onConnect: () -> Unit, - override val onDismiss: () -> Unit, - ) : AlertType() } } \ No newline at end of file diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectNetworksComponent.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectNetworksComponent.kt index b5e00c8355..5e6fa54da8 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectNetworksComponent.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectNetworksComponent.kt @@ -37,7 +37,7 @@ import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetWi import com.tangem.core.ui.components.notifications.Notification import com.tangem.core.ui.decompose.ComposableBottomSheetComponent import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.stringReference +import com.tangem.core.ui.extensions.stringResourceSafe import com.tangem.core.ui.extensions.wrappedList import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreview @@ -98,7 +98,7 @@ private fun WcSelectNetworksBS( containerColor = TangemTheme.colors.background.tertiary, title = { TangemModalBottomSheetTitle( - title = stringReference("Choose networks"), + title = resourceReference(R.string.common_choose_network), startIconRes = R.drawable.ic_back_24, onStartClick = onBack, ) @@ -114,7 +114,7 @@ private fun WcSelectNetworksBS( modifier = Modifier .padding(16.dp) .fillMaxWidth(), - text = "Done", + text = stringResourceSafe(R.string.common_done), onClick = state.onDone, enabled = state.doneButtonEnabled, ) @@ -181,7 +181,7 @@ private fun AvailableNetworksBlock( Column(modifier = modifier) { Text( modifier = Modifier.padding(top = 12.dp, bottom = 4.dp, start = 12.dp, end = 12.dp), - text = "Available networks", + text = stringResourceSafe(R.string.common_available_networks), style = TangemTheme.typography.subtitle2, color = TangemTheme.colors.text.tertiary, ) @@ -203,7 +203,7 @@ private fun NotAddedBlock(notAdded: ImmutableList, modifier: Column(modifier = modifier) { Text( modifier = Modifier.padding(top = 12.dp, bottom = 4.dp, start = 12.dp, end = 12.dp), - text = "Not Added", + text = stringResourceSafe(R.string.common_not_added), style = TangemTheme.typography.subtitle2, color = TangemTheme.colors.text.tertiary, ) @@ -255,7 +255,7 @@ private fun NetworkItems(networkItem: WcNetworkInfoItem, modifier: Modifier = Mo } } is WcNetworkInfoItem.Required -> Text( - text = "Required", + text = stringResourceSafe(R.string.common_required), style = TangemTheme.typography.body2, color = TangemTheme.colors.text.tertiary, ) diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectWalletComponent.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectWalletComponent.kt index 0c463ff816..92ff58d06f 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectWalletComponent.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/components/WcSelectWalletComponent.kt @@ -28,6 +28,7 @@ import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheet import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetTitle import com.tangem.core.ui.decompose.ComposableBottomSheetComponent import com.tangem.core.ui.extensions.TextReference +import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.extensions.wrappedList import com.tangem.core.ui.res.TangemTheme @@ -91,7 +92,7 @@ private fun WcSelectWalletModalBS( containerColor = TangemTheme.colors.background.primary, title = { TangemModalBottomSheetTitle( - title = stringReference("Choose wallet"), + title = resourceReference(R.string.common_choose_wallet), startIconRes = R.drawable.ic_back_24, onStartClick = onBack, ) @@ -145,77 +146,62 @@ private fun WcSelectWalletContent( @Preview(showBackground = true, device = Devices.PIXEL_7_PRO) @Preview(showBackground = true, device = Devices.PIXEL_7_PRO, uiMode = Configuration.UI_MODE_NIGHT_YES) private fun WcSelectWalletContent_Preview() { + val wallets = persistentListOf( + UserWalletItemUM( + id = UserWalletId("user_wallet_1".encodeToByteArray()), + name = stringReference("Tangem 2.0"), + information = getInformation(42), + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + UserWalletItemUM( + id = UserWalletId("user_wallet_2".encodeToByteArray()), + name = stringReference("Tangem White"), + information = getInformation(24), + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + UserWalletItemUM( + id = UserWalletId("user_wallet_3".encodeToByteArray()), + name = stringReference("Bitcoin"), + information = getInformation(1), + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + UserWalletItemUM( + id = UserWalletId("user_wallet_4".encodeToByteArray()), + name = stringReference("Tangem 1.0"), + information = getInformation(21), + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + UserWalletItemUM( + id = UserWalletId("user_wallet_4".encodeToByteArray()), + name = stringReference("Tangem 1.0"), + information = UserWalletItemUM.Information.Loading, + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + UserWalletItemUM( + id = UserWalletId("user_wallet_4".encodeToByteArray()), + name = stringReference("Tangem 1.0"), + information = UserWalletItemUM.Information.Failed, + balance = UserWalletItemUM.Balance.Loaded("1 496,34 $", isFlickering = false), + isEnabled = true, + onClick = {}, + ), + ) TangemThemePreview { - TangemModalBottomSheet( - containerColor = TangemTheme.colors.background.primary, - config = TangemBottomSheetConfig( - isShown = true, - onDismissRequest = {}, - content = TangemBottomSheetConfigContent.Empty, - ), - title = { - TangemModalBottomSheetTitle( - title = stringReference("Choose wallet"), - onEndClick = {}, - endIconRes = R.drawable.ic_close_24, - ) - }, - content = { - WcSelectWalletContent( - modifier = Modifier.padding(start = 16.dp, end = 16.dp, bottom = 16.dp), - selectedWalletId = UserWalletId("user_wallet_1".encodeToByteArray()), - wallets = persistentListOf( - UserWalletItemUM( - id = UserWalletId("user_wallet_1".encodeToByteArray()), - name = stringReference("Tangem 2.0"), - information = getInformation(42), - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - UserWalletItemUM( - id = UserWalletId("user_wallet_2".encodeToByteArray()), - name = stringReference("Tangem White"), - information = getInformation(24), - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - UserWalletItemUM( - id = UserWalletId("user_wallet_3".encodeToByteArray()), - name = stringReference("Bitcoin"), - information = getInformation(1), - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - UserWalletItemUM( - id = UserWalletId("user_wallet_4".encodeToByteArray()), - name = stringReference("Tangem 1.0"), - information = getInformation(21), - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - UserWalletItemUM( - id = UserWalletId("user_wallet_4".encodeToByteArray()), - name = stringReference("Tangem 1.0"), - information = UserWalletItemUM.Information.Loading, - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - UserWalletItemUM( - id = UserWalletId("user_wallet_4".encodeToByteArray()), - name = stringReference("Tangem 1.0"), - information = UserWalletItemUM.Information.Failed, - balance = UserWalletItemUM.Balance.Loaded("1 496,34 \$", isFlickering = false), - isEnabled = true, - onClick = {}, - ), - ), - ) - }, + WcSelectWalletModalBS( + wallets = wallets, + selectedWalletId = wallets.first().id, + onBack = {}, + onDismiss = {}, ) } } diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt index b35c69510f..6b0bb827d2 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt @@ -7,9 +7,9 @@ import com.domain.blockaid.models.dapp.CheckDAppResult import com.tangem.core.decompose.di.ModelScoped import com.tangem.core.decompose.model.Model import com.tangem.core.decompose.model.ParamsContainer -import com.tangem.core.decompose.navigation.Router import com.tangem.core.decompose.ui.UiMessageSender import com.tangem.core.ui.extensions.iconResId +import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.message.SnackbarMessage import com.tangem.domain.walletconnect.model.WcSession @@ -23,6 +23,7 @@ import com.tangem.features.walletconnect.connections.entity.WcPrimaryButtonConfi import com.tangem.features.walletconnect.connections.entity.WcAppInfoSecurityNotification import com.tangem.features.walletconnect.connections.model.transformers.WcAppSubtitleConverter import com.tangem.features.walletconnect.connections.routes.ConnectedAppInfoRoutes +import com.tangem.features.walletconnect.impl.R import com.tangem.utils.coroutines.CoroutineDispatcherProvider import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.flow.MutableStateFlow @@ -35,7 +36,6 @@ import javax.inject.Inject @Stable @ModelScoped internal class WcConnectedAppInfoModel @Inject constructor( - private val router: Router, private val wcSessionsUseCase: WcSessionsUseCase, private val messageSender: UiMessageSender, private val disconnectUseCase: WcDisconnectUseCase, @@ -121,7 +121,7 @@ internal class WcConnectedAppInfoModel @Inject constructor( } modelScope.launch { disconnectUseCase.disconnect(session) - messageSender.send(SnackbarMessage(message = stringReference("dApp disconnected"))) + messageSender.send(SnackbarMessage(message = resourceReference(R.string.wc_dapp_disconnected))) dismiss() } } diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectionsModel.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectionsModel.kt index f39cba49ce..38f270b631 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectionsModel.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectionsModel.kt @@ -13,7 +13,6 @@ import com.tangem.core.decompose.ui.UiMessageSender import com.tangem.core.ui.components.appbar.models.TopAppBarButtonUM import com.tangem.core.ui.components.dropdownmenu.TangemDropdownMenuItem import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.message.DialogMessage import com.tangem.core.ui.message.EventMessageAction import com.tangem.core.ui.message.SnackbarMessage @@ -50,7 +49,7 @@ internal class WcConnectionsModel @Inject constructor( private val wcDisconnectUseCase: WcDisconnectUseCase, private val wcPairService: WcPairService, override val dispatchers: CoroutineDispatcherProvider, - private val analytics: AnalyticsEventHandler, + analytics: AnalyticsEventHandler, paramsContainer: ParamsContainer, ) : Model() { @@ -127,7 +126,7 @@ internal class WcConnectionsModel @Inject constructor( private fun disconnectAllSessions() { modelScope.launch { wcDisconnectUseCase.disconnectAll() - uiMessageSender.send(SnackbarMessage(message = stringReference("All dApps disconnected"))) + uiMessageSender.send(SnackbarMessage(message = resourceReference(R.string.wc_all_dapps_disconnected))) } } diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcPairModel.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcPairModel.kt index bbac86dbfd..9a63c9baad 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcPairModel.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcPairModel.kt @@ -11,7 +11,9 @@ import com.tangem.core.decompose.model.Model import com.tangem.core.decompose.model.ParamsContainer import com.tangem.core.decompose.navigation.Router import com.tangem.core.decompose.ui.UiMessageSender +import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.extensions.stringReference +import com.tangem.core.ui.extensions.wrappedList import com.tangem.core.ui.message.SnackbarMessage import com.tangem.core.ui.message.ToastMessage import com.tangem.domain.models.network.Network @@ -30,6 +32,7 @@ import com.tangem.features.walletconnect.connections.entity.WcAppInfoUM import com.tangem.features.walletconnect.connections.entity.WcPrimaryButtonConfig import com.tangem.features.walletconnect.connections.model.transformers.* import com.tangem.features.walletconnect.connections.routes.WcAppInfoRoutes +import com.tangem.features.walletconnect.impl.R import com.tangem.utils.coroutines.CoroutineDispatcherProvider import kotlinx.coroutines.flow.* import javax.inject.Inject @@ -199,9 +202,13 @@ internal class WcPairModel @Inject constructor( } private fun processSuccessfullyConnected(session: WcSession) { - // TODO: [REDACTED_JIRA] localization messageSender.send( - SnackbarMessage(message = stringReference("Connected to ${session.sdkModel.appMetaData.name}")), + SnackbarMessage( + message = resourceReference( + id = R.string.wc_connected_to, + formatArgs = wrappedList(session.sdkModel.appMetaData.name), + ), + ), ) } diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt index 72042b2e79..63de5cb522 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt @@ -3,7 +3,6 @@ package com.tangem.features.walletconnect.connections.model.transformers import com.tangem.domain.models.network.Network import com.tangem.utils.converter.Converter -@Suppress("DestructuringDeclarationWithTooManyEntries") internal object WcConnectButtonAvailabilityConverter : Converter { override fun convert(value: Input): Boolean { diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt index 4d690bc279..ee51c67235 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt @@ -7,7 +7,6 @@ import com.tangem.features.walletconnect.connections.entity.WcNetworksInfo import com.tangem.utils.converter.Converter import kotlinx.collections.immutable.toImmutableList -@Suppress("DestructuringDeclarationWithTooManyEntries") internal object WcNetworksInfoConverter : Converter { override fun convert(value: Input): WcNetworksInfo { val missing = value.missingNetworks diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/AlertsModalBottomSheet.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/AlertsModalBottomSheet.kt index ef033fa61e..7c93a184f5 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/AlertsModalBottomSheet.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/AlertsModalBottomSheet.kt @@ -6,7 +6,6 @@ import androidx.annotation.StringRes import androidx.compose.foundation.background import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.CircleShape -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -23,7 +22,6 @@ import androidx.compose.ui.unit.dp import com.tangem.core.ui.R import com.tangem.core.ui.components.PrimaryButton import com.tangem.core.ui.components.SecondaryButton -import com.tangem.core.ui.components.SecondaryButtonIconEnd import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheet import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetTitle @@ -77,7 +75,6 @@ private fun ContentContainer(alert: AlertsComponent.AlertType, modifier: Modifie .padding(top = TangemTheme.dimens.spacing8), alert = alert, ) - AlertAudit(alert, modifier = Modifier.padding(top = TangemTheme.dimens.spacing16)) } } @@ -90,71 +87,12 @@ private fun ButtonsContainer(alert: AlertsComponent.AlertType, modifier: Modifie ) { val buttonsModifier = Modifier.fillMaxWidth() when (alert) { - is AlertsComponent.AlertType.UnsafeDomain -> { - PrimaryButton( - modifier = buttonsModifier, - text = stringResourceSafe(R.string.common_cancel), - onClick = alert.onDismiss, - ) - SecondaryButton( - modifier = buttonsModifier, - onClick = alert.onConnect, - text = stringResourceSafe(R.string.wc_alert_connect_anyway), - ) - } - is AlertsComponent.AlertType.MaliciousTransaction -> { - PrimaryButton( - modifier = buttonsModifier, - text = stringResourceSafe(R.string.common_cancel), - onClick = alert.onDismiss, - ) - SecondaryButtonIconEnd( - modifier = buttonsModifier, - onClick = alert.onConnect, - iconResId = R.drawable.ic_tangem_24, - text = stringResourceSafe(R.string.wc_alert_connect_anyway), - ) - } - is AlertsComponent.AlertType.UnknownDomain -> { - PrimaryButton( - modifier = buttonsModifier, - text = stringResourceSafe(R.string.common_cancel), - onClick = alert.onDismiss, - ) - SecondaryButton( - modifier = buttonsModifier, - onClick = alert.onConnect, - text = stringResourceSafe(R.string.wc_alert_connect_anyway), - ) - } - is AlertsComponent.AlertType.VerifiedDomain -> SecondaryButton( - modifier = buttonsModifier, - text = stringResourceSafe(R.string.common_done), - onClick = alert.onDismiss, - ) - is AlertsComponent.AlertType.ConnectionTimeout -> { - PrimaryButton( - modifier = buttonsModifier, - onClick = alert.onTryAgain, - text = stringResourceSafe(R.string.alert_button_try_again), - ) - SecondaryButton( - modifier = buttonsModifier, - onClick = alert.onDismiss, - text = stringResourceSafe(R.string.balance_hidden_got_it_button), - ) - } - is AlertsComponent.AlertType.WrongCardSelected, - is AlertsComponent.AlertType.UnknownError, - is AlertsComponent.AlertType.UnsupportedMethod, - -> SecondaryButton( + is AlertsComponent.AlertType.UnsupportedMethod -> SecondaryButton( modifier = buttonsModifier, onClick = alert.onDismiss, text = stringResourceSafe(R.string.balance_hidden_got_it_button), ) - is AlertsComponent.AlertType.WcDisconnected, - is AlertsComponent.AlertType.UnsupportedNetworks, - -> PrimaryButton( + is AlertsComponent.AlertType.WcDisconnected -> PrimaryButton( modifier = buttonsModifier, onClick = alert.onDismiss, text = stringResourceSafe(R.string.balance_hidden_got_it_button), @@ -166,49 +104,17 @@ private fun ButtonsContainer(alert: AlertsComponent.AlertType, modifier: Modifie @Composable private fun AlertIcon(alert: AlertsComponent.AlertType, modifier: Modifier = Modifier) { val color = when (alert) { - is AlertsComponent.AlertType.VerifiedDomain -> TangemTheme.colors.icon.accent - is AlertsComponent.AlertType.WcDisconnected, - is AlertsComponent.AlertType.ConnectionTimeout, - is AlertsComponent.AlertType.UnsupportedNetworks, - -> TangemTheme.colors.icon.informative - is AlertsComponent.AlertType.WrongCardSelected, - is AlertsComponent.AlertType.UnknownDomain, - is AlertsComponent.AlertType.UnknownError, - is AlertsComponent.AlertType.UnsupportedMethod, - -> TangemTheme.colors.icon.attention - is AlertsComponent.AlertType.MaliciousTransaction, - is AlertsComponent.AlertType.UnsafeDomain, - -> TangemTheme.colors.icon.warning + is AlertsComponent.AlertType.WcDisconnected -> TangemTheme.colors.icon.informative + is AlertsComponent.AlertType.UnsupportedMethod -> TangemTheme.colors.icon.attention } @DrawableRes val drawableId = when (alert) { - is AlertsComponent.AlertType.WcDisconnected, - is AlertsComponent.AlertType.ConnectionTimeout, - -> R.drawable.ic_wallet_connect_24 - is AlertsComponent.AlertType.MaliciousTransaction -> R.drawable.img_knight_shield_32 - is AlertsComponent.AlertType.UnknownDomain, - is AlertsComponent.AlertType.UnsafeDomain, - -> R.drawable.img_knight_shield_32 - is AlertsComponent.AlertType.UnsupportedNetworks -> R.drawable.ic_network_new_24 - is AlertsComponent.AlertType.WrongCardSelected, - is AlertsComponent.AlertType.UnknownError, - is AlertsComponent.AlertType.UnsupportedMethod, - -> R.drawable.img_attention_20 - is AlertsComponent.AlertType.VerifiedDomain -> R.drawable.img_approvale2_20 + is AlertsComponent.AlertType.WcDisconnected -> R.drawable.ic_wallet_connect_24 + is AlertsComponent.AlertType.UnsupportedMethod -> R.drawable.img_attention_20 } val iconTint = when (alert) { - is AlertsComponent.AlertType.UnknownDomain, - is AlertsComponent.AlertType.UnsafeDomain, - is AlertsComponent.AlertType.MaliciousTransaction, - is AlertsComponent.AlertType.UnsupportedNetworks, - is AlertsComponent.AlertType.ConnectionTimeout, - is AlertsComponent.AlertType.WcDisconnected, - -> color - is AlertsComponent.AlertType.VerifiedDomain, - is AlertsComponent.AlertType.UnknownError, - is AlertsComponent.AlertType.WrongCardSelected, - is AlertsComponent.AlertType.UnsupportedMethod, - -> Color.Unspecified + is AlertsComponent.AlertType.WcDisconnected -> color + is AlertsComponent.AlertType.UnsupportedMethod -> Color.Unspecified } Box( modifier = modifier @@ -230,16 +136,7 @@ private fun AlertIcon(alert: AlertsComponent.AlertType, modifier: Modifier = Mod @Composable private fun AlertContentTitle(alert: AlertsComponent.AlertType, modifier: Modifier = Modifier) { @StringRes val titleRes: Int = when (alert) { - is AlertsComponent.AlertType.UnknownDomain, - is AlertsComponent.AlertType.UnsafeDomain, - is AlertsComponent.AlertType.MaliciousTransaction, - -> R.string.security_alert_title - is AlertsComponent.AlertType.ConnectionTimeout -> R.string.wc_alert_connection_timeout_title - is AlertsComponent.AlertType.UnknownError -> R.string.wc_alert_unknown_error_title - is AlertsComponent.AlertType.UnsupportedNetworks -> R.string.wc_alert_unsupported_networks_title - is AlertsComponent.AlertType.VerifiedDomain -> R.string.wc_alert_verified_domain_title is AlertsComponent.AlertType.WcDisconnected -> R.string.wc_alert_session_disconnected_title - is AlertsComponent.AlertType.WrongCardSelected -> R.string.wc_alert_wrong_card_title is AlertsComponent.AlertType.UnsupportedMethod -> R.string.wc_alert_unsupported_method_title } Text( @@ -254,29 +151,9 @@ private fun AlertContentTitle(alert: AlertsComponent.AlertType, modifier: Modifi @Composable private fun AlertContentDescription(alert: AlertsComponent.AlertType, modifier: Modifier = Modifier) { val message = when (alert) { - is AlertsComponent.AlertType.ConnectionTimeout -> stringResourceSafe( - R.string.wc_alert_connection_timeout_description, - ) - is AlertsComponent.AlertType.MaliciousTransaction -> alert.descriptionMessage - is AlertsComponent.AlertType.UnknownDomain, - is AlertsComponent.AlertType.UnsafeDomain, - -> stringResourceSafe(R.string.wc_alert_domain_issues_description) - is AlertsComponent.AlertType.UnknownError -> stringResourceSafe( - R.string.wc_alert_unknown_error_description, - alert.errorCode, - ) - is AlertsComponent.AlertType.UnsupportedNetworks -> stringResourceSafe( - R.string.wc_alert_unsupported_networks_description, - alert.appName, - ) - is AlertsComponent.AlertType.VerifiedDomain -> stringResourceSafe( - R.string.wc_alert_verified_domain_description, - alert.appName, - ) is AlertsComponent.AlertType.WcDisconnected -> stringResourceSafe( R.string.wc_alert_session_disconnected_description, ) - is AlertsComponent.AlertType.WrongCardSelected -> stringResourceSafe(R.string.wc_alert_wrong_card_description) is AlertsComponent.AlertType.UnsupportedMethod -> stringResourceSafe( R.string.wc_alert_unsupported_method_description, ) @@ -290,44 +167,6 @@ private fun AlertContentDescription(alert: AlertsComponent.AlertType, modifier: ) } -@Composable -private fun AlertAudit(alert: AlertsComponent.AlertType, modifier: Modifier = Modifier) { - when (alert) { - is AlertsComponent.AlertType.UnknownDomain -> Text( - modifier = modifier - .background( - shape = RoundedCornerShape(TangemTheme.dimens.radius16), - color = TangemTheme.colors.text.primary1.copy(alpha = 0.1F), - ) - .padding(vertical = TangemTheme.dimens.spacing4, horizontal = TangemTheme.dimens.spacing12), - text = stringResourceSafe(R.string.wc_alert_audit_unknown_domain), - style = TangemTheme.typography.caption1, - color = TangemTheme.colors.text.primary1, - ) - is AlertsComponent.AlertType.UnsafeDomain -> Text( - modifier = Modifier - .padding(top = TangemTheme.dimens.spacing16) - .background( - shape = RoundedCornerShape(TangemTheme.dimens.radius16), - color = TangemTheme.colors.text.warning.copy(alpha = 0.1F), - ) - .padding(vertical = TangemTheme.dimens.spacing4, horizontal = TangemTheme.dimens.spacing12), - text = stringResourceSafe(R.string.wc_alert_audit_unknown_domain), - style = TangemTheme.typography.caption1, - color = TangemTheme.colors.text.warning, - ) - is AlertsComponent.AlertType.ConnectionTimeout, - is AlertsComponent.AlertType.MaliciousTransaction, - is AlertsComponent.AlertType.UnknownError, - is AlertsComponent.AlertType.UnsupportedNetworks, - is AlertsComponent.AlertType.VerifiedDomain, - is AlertsComponent.AlertType.WcDisconnected, - is AlertsComponent.AlertType.WrongCardSelected, - is AlertsComponent.AlertType.UnsupportedMethod, - -> Unit - } -} - @Preview(showBackground = true) @Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES) @Composable @@ -347,19 +186,7 @@ private fun AlertsModalBottomSheet_Preview( private class AlertTypesProvider : CollectionPreviewParameterProvider( collection = listOf( - AlertsComponent.AlertType.VerifiedDomain(appName = "React App", onDismiss = {}), - AlertsComponent.AlertType.UnknownDomain(onConnect = {}, onDismiss = {}), - AlertsComponent.AlertType.UnsafeDomain(onConnect = {}, onDismiss = {}), - AlertsComponent.AlertType.MaliciousTransaction( - descriptionMessage = "The transaction approves erc20 tokens to a known malicious address", - onConnect = {}, - onDismiss = {}, - ), - AlertsComponent.AlertType.UnsupportedNetworks(appName = "React App", onDismiss = {}), AlertsComponent.AlertType.WcDisconnected(onDismiss = {}), - AlertsComponent.AlertType.UnknownError(errorCode = 8005, onDismiss = {}), - AlertsComponent.AlertType.WrongCardSelected(onDismiss = {}), - AlertsComponent.AlertType.ConnectionTimeout(onTryAgain = {}, onDismiss = {}), AlertsComponent.AlertType.UnsupportedMethod(onDismiss = {}), ), ) \ No newline at end of file diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcAppInfoBS.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcAppInfoBS.kt index 27957362b7..ebd0adbd3a 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcAppInfoBS.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcAppInfoBS.kt @@ -35,7 +35,10 @@ import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetTi import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetWithFooter import com.tangem.core.ui.components.notifications.Notification import com.tangem.core.ui.components.notifications.NotificationConfig -import com.tangem.core.ui.extensions.* +import com.tangem.core.ui.extensions.clickableSingle +import com.tangem.core.ui.extensions.resourceReference +import com.tangem.core.ui.extensions.stringResourceSafe +import com.tangem.core.ui.extensions.wrappedList import com.tangem.core.ui.res.TangemColorPalette import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreview @@ -286,9 +289,8 @@ private fun WcAppInfoSecondBlock(state: WcAppInfoUM.Content, modifier: Modifier Notification( config = NotificationConfig( iconResId = R.drawable.ic_alert_circle_24, - // TODO: [REDACTED_JIRA] localization - title = stringReference("Specify selected networks"), - subtitle = stringReference("At least one network is required for dApp connection"), + title = resourceReference(R.string.wc_specify_networks_title), + subtitle = resourceReference(R.string.wc_specify_networks_subtitle), ), iconTint = TangemTheme.colors.icon.attention, containerColor = TangemTheme.colors.background.action, diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcConnectedAppInfoBS.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcConnectedAppInfoBS.kt index 17f1d3de85..4a97cf03a1 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcConnectedAppInfoBS.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/ui/WcConnectedAppInfoBS.kt @@ -23,7 +23,6 @@ import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheet import com.tangem.core.ui.components.bottomsheets.modal.TangemModalBottomSheetTitle import com.tangem.core.ui.components.notifications.Notification import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.extensions.stringResourceSafe import com.tangem.core.ui.extensions.wrappedList import com.tangem.core.ui.res.TangemColorPalette @@ -48,7 +47,7 @@ internal fun WcConnectedAppInfoBS(state: WcConnectedAppInfoUM) { containerColor = TangemTheme.colors.background.tertiary, title = { TangemModalBottomSheetTitle( - title = stringReference("Connected App"), // TODO: [REDACTED_JIRA] + title = resourceReference(R.string.wc_connected_app_title), subtitle = state.connectingTime?.let { timestamp -> resourceReference( R.string.send_date_format, diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/blockaid/TransactionCheckResultsUM.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/blockaid/TransactionCheckResultsUM.kt deleted file mode 100644 index 6bb884bc3c..0000000000 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/blockaid/TransactionCheckResultsUM.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.tangem.features.walletconnect.transaction.entity.blockaid - -internal data class TransactionCheckResultsUM( - val estimatedWalletChanges: WcEstimatedWalletChangesUM, - val notificationText: String? = null, -) \ No newline at end of file diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcCommonTransactionModel.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcCommonTransactionModel.kt index aa103cf52a..5acb41c803 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcCommonTransactionModel.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/entity/common/WcCommonTransactionModel.kt @@ -2,8 +2,9 @@ package com.tangem.features.walletconnect.transaction.entity.common import com.tangem.core.decompose.ui.UiMessageSender import com.tangem.core.ui.extensions.TextReference -import com.tangem.core.ui.extensions.stringReference +import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.message.ToastMessage +import com.tangem.features.walletconnect.impl.R import kotlinx.coroutines.flow.StateFlow internal interface WcCommonTransactionModel { @@ -16,8 +17,7 @@ internal interface WcCommonTransactionModel { fun popBack() - // TODO: [REDACTED_JIRA] - fun showSuccessSignMessage(message: TextReference = stringReference("Successfully signed")) { + fun showSuccessSignMessage(message: TextReference = resourceReference(R.string.wc_successfully_signed)) { messageSender.send(ToastMessage(message = message)) } } \ No newline at end of file diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/utils/WcNotificationsFactory.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/utils/WcNotificationsFactory.kt index 0b1796ebec..bb97456631 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/utils/WcNotificationsFactory.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/utils/WcNotificationsFactory.kt @@ -4,7 +4,7 @@ import com.tangem.blockchain.common.transaction.TransactionFee import com.tangem.common.ui.notifications.NotificationUM import com.tangem.core.ui.components.notifications.NotificationConfig import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.stringReference +import com.tangem.core.ui.extensions.wrappedList import com.tangem.domain.tokens.model.CryptoCurrencyStatus import com.tangem.features.send.v2.api.entity.FeeSelectorUM import com.tangem.features.send.v2.api.subcomponents.feeSelector.utils.FeeCalculationUtils @@ -29,10 +29,12 @@ internal class WcNotificationsFactory @Inject constructor() { cryptoCurrencyStatus: CryptoCurrencyStatus, feeSelectorUM: FeeSelectorUM?, ): NotificationUM.Info? { - // TODO: [REDACTED_TASK_KEY] localization return NotificationUM.Info( - title = stringReference("Insufficient ${cryptoCurrencyStatus.currency.name}"), - subtitle = stringReference("Top up your balance to cover the network fee"), + title = resourceReference( + id = R.string.wc_insufficient_warning_title, + formatArgs = wrappedList(cryptoCurrencyStatus.currency.name), + ), + subtitle = resourceReference(R.string.wc_insufficient_warning_subtitle), ).takeIf { isFeeExceedsBalance(cryptoCurrencyStatus = cryptoCurrencyStatus, feeSelectorUM = feeSelectorUM) } } From f690d13c82b0cea631a4afd065a6deb2b2ebf95c Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 6 Aug 2025 11:28:55 +0000 Subject: [PATCH 2/2] Updated on 2026-08-14 --- gradle/tangem_dependencies.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/tangem_dependencies.toml b/gradle/tangem_dependencies.toml index 7ab02a4628..78d485789e 100644 --- a/gradle/tangem_dependencies.toml +++ b/gradle/tangem_dependencies.toml @@ -5,9 +5,9 @@ # https://github.com/tangem/tangem-sdk-android/ # https://github.com/tangem/vico -tangemBlockchainSdk = "releases-5.27.0-1126" +tangemBlockchainSdk = "develop-1129" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds -tangemCardSdk = "releases-5.27.0-510" +tangemCardSdk = "develop-509" #tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^ tangemVico = "2.0.0-alpha.25-tangem12" #tangemVico = "0.0.1" # Keep it! - used for local builds ^