From d76b458235229916d071d9e4371bd29d9c9af13d Mon Sep 17 00:00:00 2001 From: Howard Braham Date: Thu, 24 Aug 2023 14:35:26 -0700 Subject: [PATCH] fix(privateKey): Restore hold-to-reveal button for private key export (#20109) * fix(privateKey): Restore hold-to-reveal button for private key export * lint and unit test fixes * adding e2e tests to reveal private key * fixing lint issues * fixed: Private key is able to be presented without tapping and holding the "Hold to reveal" CTA * Incorrect password test and support hold to reveal * improving unit tests --------- Co-authored-by: Plasma Corral <32695229+plasmacorral@users.noreply.github.com> Co-authored-by: Gustavo Antunes <17601467+gantunesr@users.noreply.github.com> --- app/_locales/am/messages.json | 15 -- app/_locales/ar/messages.json | 15 -- app/_locales/bg/messages.json | 15 -- app/_locales/bn/messages.json | 15 -- app/_locales/ca/messages.json | 15 -- app/_locales/cs/messages.json | 15 -- app/_locales/da/messages.json | 15 -- app/_locales/de/messages.json | 15 -- app/_locales/el/messages.json | 15 -- app/_locales/en/messages.json | 15 -- app/_locales/es/messages.json | 15 -- app/_locales/es_419/messages.json | 15 -- app/_locales/et/messages.json | 15 -- app/_locales/fa/messages.json | 15 -- app/_locales/fi/messages.json | 15 -- app/_locales/fil/messages.json | 15 -- app/_locales/fr/messages.json | 15 -- app/_locales/he/messages.json | 15 -- app/_locales/hi/messages.json | 15 -- app/_locales/hn/messages.json | 15 -- app/_locales/hr/messages.json | 15 -- app/_locales/ht/messages.json | 15 -- app/_locales/hu/messages.json | 15 -- app/_locales/id/messages.json | 15 -- app/_locales/it/messages.json | 15 -- app/_locales/ja/messages.json | 15 -- app/_locales/kn/messages.json | 15 -- app/_locales/ko/messages.json | 15 -- app/_locales/lt/messages.json | 15 -- app/_locales/lv/messages.json | 15 -- app/_locales/ms/messages.json | 15 -- app/_locales/nl/messages.json | 15 -- app/_locales/no/messages.json | 15 -- app/_locales/ph/messages.json | 15 -- app/_locales/pl/messages.json | 15 -- app/_locales/pt/messages.json | 15 -- app/_locales/pt_BR/messages.json | 15 -- app/_locales/ro/messages.json | 15 -- app/_locales/ru/messages.json | 15 -- app/_locales/sk/messages.json | 15 -- app/_locales/sl/messages.json | 15 -- app/_locales/sr/messages.json | 15 -- app/_locales/sv/messages.json | 15 -- app/_locales/sw/messages.json | 15 -- app/_locales/ta/messages.json | 15 -- app/_locales/th/messages.json | 15 -- app/_locales/tl/messages.json | 15 -- app/_locales/tr/messages.json | 15 -- app/_locales/uk/messages.json | 15 -- app/_locales/vi/messages.json | 15 -- app/_locales/zh_CN/messages.json | 15 -- app/_locales/zh_TW/messages.json | 15 -- .../files-to-convert.json | 11 - test/e2e/tests/account-details.spec.js | 70 +++-- .../account-details-modal.component.js | 161 ------------ .../account-details-modal.container.js | 54 ---- .../account-details-modal.test.js | 241 ----------------- .../app/modals/account-details-modal/index.js | 1 - .../modals/account-details-modal/index.scss | 30 --- .../account-modal-container.component.js | 57 ---- .../account-modal-container.container.js | 23 -- .../modals/account-modal-container/index.js | 1 - .../modals/account-modal-container/index.scss | 53 ---- .../export-private-key-modal.test.js.snap | 139 ---------- .../export-private-key-modal.component.js | 247 ------------------ ...export-private-key-modal.component.test.js | 130 --------- .../export-private-key-modal.container.js | 48 ---- .../export-private-key-modal.stories.js | 32 --- .../export-private-key-modal.test.js | 82 ------ .../modals/export-private-key-modal/index.js | 1 - .../export-private-key-modal/index.scss | 27 -- .../password-input.js | 50 ---- .../export-private-key-modal/private-key.js | 81 ------ .../hold-to-reveal-modal.js | 204 --------------- .../hold-to-reveal-modal.stories.js | 13 - .../hold-to-reveal-modal.stories.tsx | 35 +++ .../hold-to-reveal-modal.test.js | 111 ++------ .../hold-to-reveal-modal.tsx | 120 +++++++++ .../modals/hold-to-reveal-modal/index.scss | 8 - .../{index.js => index.ts} | 0 ui/components/app/modals/index.scss | 4 - ui/components/app/modals/modal.js | 26 -- .../account-details-authenticate.js | 19 +- .../account-details/account-details.js | 174 +++++++----- .../account-details/account-details.test.js | 58 ++-- ui/pages/keychains/reveal-seed.js | 97 +++---- ui/store/actions.test.js | 12 +- ui/store/actions.ts | 5 +- 88 files changed, 452 insertions(+), 2753 deletions(-) delete mode 100644 ui/components/app/modals/account-details-modal/account-details-modal.component.js delete mode 100644 ui/components/app/modals/account-details-modal/account-details-modal.container.js delete mode 100644 ui/components/app/modals/account-details-modal/account-details-modal.test.js delete mode 100644 ui/components/app/modals/account-details-modal/index.js delete mode 100644 ui/components/app/modals/account-details-modal/index.scss delete mode 100644 ui/components/app/modals/account-modal-container/account-modal-container.component.js delete mode 100644 ui/components/app/modals/account-modal-container/account-modal-container.container.js delete mode 100644 ui/components/app/modals/account-modal-container/index.js delete mode 100644 ui/components/app/modals/account-modal-container/index.scss delete mode 100644 ui/components/app/modals/export-private-key-modal/__snapshots__/export-private-key-modal.test.js.snap delete mode 100644 ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.js delete mode 100644 ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.test.js delete mode 100644 ui/components/app/modals/export-private-key-modal/export-private-key-modal.container.js delete mode 100644 ui/components/app/modals/export-private-key-modal/export-private-key-modal.stories.js delete mode 100644 ui/components/app/modals/export-private-key-modal/export-private-key-modal.test.js delete mode 100644 ui/components/app/modals/export-private-key-modal/index.js delete mode 100644 ui/components/app/modals/export-private-key-modal/index.scss delete mode 100644 ui/components/app/modals/export-private-key-modal/password-input.js delete mode 100644 ui/components/app/modals/export-private-key-modal/private-key.js delete mode 100644 ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.js delete mode 100644 ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.stories.js create mode 100644 ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.stories.tsx create mode 100644 ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.tsx delete mode 100644 ui/components/app/modals/hold-to-reveal-modal/index.scss rename ui/components/app/modals/hold-to-reveal-modal/{index.js => index.ts} (100%) diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index a815821b9..5b7396264 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -169,9 +169,6 @@ "copyAddress": { "message": "አድራሻን ወደ ቅንጥብ ሰሌዳ ቅዳ" }, - "copyPrivateKey": { - "message": "የግል ቁልፍዎ ይህ ነው (ለመቅዳት ጠቅ ያድርጉ)" - }, "copyToClipboard": { "message": "ወደ ቅንጥብ ሰሌዳ ገልብጥ" }, @@ -232,9 +229,6 @@ "ensRegistrationError": { "message": "በ ENS የስም ምዝገባ ላይ የተፈጠረ ስህተት" }, - "enterPassword": { - "message": "የይለፍ ቃል ያስገቡ" - }, "enterPasswordContinue": { "message": "ለመቀጠል የይለፍ ቃል ያስገቡ" }, @@ -247,9 +241,6 @@ "expandView": { "message": "እይታን ዘርጋ" }, - "exportPrivateKey": { - "message": "የግል ቁልፍን ላክ" - }, "failed": { "message": "አልተሳካም" }, @@ -648,9 +639,6 @@ "showHexDataDescription": { "message": "በመላኪያ ማያ ላይ የ hex ውሂብ መስክን ለማሳየት ይህን ይምረጡ" }, - "showPrivateKeys": { - "message": "የግል ቁልፎችን አሳይ" - }, "sigRequest": { "message": "የፊርማ ጥያቄ" }, @@ -771,9 +759,6 @@ "tryAgain": { "message": "እንደገና ሞክር" }, - "typePassword": { - "message": "የ MetaMask የይለፍ ቃልዎን ይጻፉ" - }, "unapproved": { "message": "ያልተፈቀደ" }, diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index db4a5a6fe..9e41397cd 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -179,9 +179,6 @@ "copyAddress": { "message": "نسخ العنوان إلى الحافظة" }, - "copyPrivateKey": { - "message": "هذا هو مفتاحك الخاص (انقر للنسخ)" - }, "copyToClipboard": { "message": "نسخ إلى الحافظة" }, @@ -245,9 +242,6 @@ "ensRegistrationError": { "message": "خطأ في تسجيل اسم ENS" }, - "enterPassword": { - "message": "أدخل كلمة مرور" - }, "enterPasswordContinue": { "message": "أدخل كلمة المرور للمتابعة" }, @@ -260,9 +254,6 @@ "expandView": { "message": "توسيع العرض" }, - "exportPrivateKey": { - "message": "تصدير المفتاح الخاص" - }, "failed": { "message": "فشل" }, @@ -660,9 +651,6 @@ "showHexDataDescription": { "message": "حدد هذا لإظهار حقل بيانات سداسي عشرية على شاشة الإرسال" }, - "showPrivateKeys": { - "message": "عرض المفاتيح الخاصة" - }, "sigRequest": { "message": "طلب التوقيع" }, @@ -783,9 +771,6 @@ "tryAgain": { "message": "إعادة المحاولة" }, - "typePassword": { - "message": "أدخل كلمة مرور MetaMask الخاصة بك" - }, "unapproved": { "message": "تم الرفض" }, diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index 5e41be222..ce013f993 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Копирайте адреса в клипборда" }, - "copyPrivateKey": { - "message": "Това е Вашият личен ключ (кликнете, за да го копирате)" - }, "copyToClipboard": { "message": "Копиране в буферната памет" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "Грешка при регистрацията на име на ENS" }, - "enterPassword": { - "message": "Въведете парола" - }, "enterPasswordContinue": { "message": "Въведете парола, за да продължите" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Разгъване на изглед" }, - "exportPrivateKey": { - "message": "Експортиране на частен ключ" - }, "failed": { "message": "Неуспешно" }, @@ -659,9 +650,6 @@ "showHexDataDescription": { "message": "Изберете това, за да се покаже полето с шестнадесетични данни на екрана за изпращане" }, - "showPrivateKeys": { - "message": "Показване на частни ключове" - }, "sigRequest": { "message": "Заявка за подпис" }, @@ -782,9 +770,6 @@ "tryAgain": { "message": "Нов опит" }, - "typePassword": { - "message": "Въведете паролата си за MetaMask" - }, "unapproved": { "message": "Неодобрено" }, diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index dfa33cf7c..9c7727523 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -172,9 +172,6 @@ "copyAddress": { "message": "ক্লিপবোর্ডে ঠিকানা কপি করুন" }, - "copyPrivateKey": { - "message": "এটি হল আপনার গোপন কী (কপি করতে ক্লিক করুন)" - }, "copyToClipboard": { "message": "ক্লিপবোর্ডে কপি করুন" }, @@ -238,9 +235,6 @@ "ensRegistrationError": { "message": "ENS নাম নিবন্ধীকরণে ত্রুটি হয়েছে" }, - "enterPassword": { - "message": "পাসওয়ার্ড লিখুন" - }, "enterPasswordContinue": { "message": "অবিরত রাখতে পাসওয়ার্ড লিখুন" }, @@ -253,9 +247,6 @@ "expandView": { "message": "ভিউ সম্প্রসারিত করুন" }, - "exportPrivateKey": { - "message": "ব্যক্তিগত কী রপ্তানি করুন" - }, "failed": { "message": "ব্যর্থ হয়েছে" }, @@ -657,9 +648,6 @@ "showHexDataDescription": { "message": "পাঠাবার স্ক্রিনে হেক্স ডেটা ফিল্ডটি দেখাবার জন্য এটি নির্বাচন করুন" }, - "showPrivateKeys": { - "message": "গোপনীয় কীগুলি দেখান" - }, "sigRequest": { "message": "স্বাক্ষরের অনুরোধ" }, @@ -780,9 +768,6 @@ "tryAgain": { "message": "আবার করুন" }, - "typePassword": { - "message": "আপনার MetaMask পাসওয়ার্ড টাইপ করুন" - }, "unapproved": { "message": "অননুমোদিত" }, diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index fd33ec6f3..5040fcf0b 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -172,9 +172,6 @@ "copyAddress": { "message": "Copiar adreça al porta-retalls" }, - "copyPrivateKey": { - "message": "Aquesta és la teva clau privada (fes clic per a copiar)" - }, "copyToClipboard": { "message": "Copia al porta-retalls" }, @@ -238,9 +235,6 @@ "ensRegistrationError": { "message": "Error al registre de nom ENS" }, - "enterPassword": { - "message": "Introdueix contrasenya" - }, "enterPasswordContinue": { "message": "Introdueix la contrasenya per continuar" }, @@ -253,9 +247,6 @@ "expandView": { "message": "Eixamplar Vista" }, - "exportPrivateKey": { - "message": "Exportar Clau Privada." - }, "failed": { "message": "Fallit" }, @@ -644,9 +635,6 @@ "showHexDataDescription": { "message": "Selecciona això per a mostrar el camp de dades Hex a la pantalla d'enviament" }, - "showPrivateKeys": { - "message": "Mostrar Claus Privades" - }, "sigRequest": { "message": "Sol·licitud de Signatura" }, @@ -761,9 +749,6 @@ "tryAgain": { "message": "Torna-ho a provar" }, - "typePassword": { - "message": "Tecleja la teva contrasenya de MetaMask" - }, "unapproved": { "message": "Pendent d'aprovació" }, diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json index b0702badb..32573b29b 100644 --- a/app/_locales/cs/messages.json +++ b/app/_locales/cs/messages.json @@ -72,9 +72,6 @@ "copiedExclamation": { "message": "Zkopírováno!" }, - "copyPrivateKey": { - "message": "Toto je váš privátní klíč (kliknutím zkopírujte)" - }, "copyToClipboard": { "message": "Kopírovat do schránky" }, @@ -105,15 +102,9 @@ "edit": { "message": "Upravit" }, - "enterPassword": { - "message": "Zadejte heslo" - }, "etherscanView": { "message": "Prohlédněte si účet na Etherscan" }, - "exportPrivateKey": { - "message": "Exportovat privátní klíč" - }, "failed": { "message": "Neúspěšné" }, @@ -304,9 +295,6 @@ "settings": { "message": "Nastavení" }, - "showPrivateKeys": { - "message": "Zobrazit privátní klíče" - }, "sigRequest": { "message": "Požadavek podpisu" }, @@ -355,9 +343,6 @@ "transactionError": { "message": "Chyba transakce. Vyhozena výjimka v kódu kontraktu." }, - "typePassword": { - "message": "Zadejte své heslo" - }, "unapproved": { "message": "Neschváleno" }, diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index fb5b26f48..950c26982 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Kopier adresse til udklipsholder" }, - "copyPrivateKey": { - "message": "Dette er din private nøgle (klik for at kopiere)" - }, "copyToClipboard": { "message": "Kopiér til udklipsholderen" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "Fejl i ENS-navneregistrering" }, - "enterPassword": { - "message": "Indtast kodeord" - }, "enterPasswordContinue": { "message": "Indtast adgangskode for at fortsætte" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Udvis Visning" }, - "exportPrivateKey": { - "message": "Eksporter privat nøgle" - }, "failed": { "message": "Mislykkedes" }, @@ -641,9 +632,6 @@ "showHexDataDescription": { "message": "Vælg dette for at vise hex-datafeltet på send-skærmen" }, - "showPrivateKeys": { - "message": "Vis private nøgler" - }, "sigRequest": { "message": "Signaturforespørgsel" }, @@ -755,9 +743,6 @@ "tryAgain": { "message": "Prøv igen" }, - "typePassword": { - "message": "Skriv din MetaMask-adgangskode" - }, "unapproved": { "message": "Ikke godkendt" }, diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index e27188df6..b19d18272 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "Adresse in die Zwischenablage kopieren" }, - "copyPrivateKey": { - "message": "Das ist Ihr Private Key (klicken um zu kopieren)" - }, "copyRawTransactionData": { "message": "Roh-Transaktionsdaten kopieren" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "Optionales Passwort eingeben" }, - "enterPassword": { - "message": "Passwort eingeben" - }, "enterPasswordContinue": { "message": "Zum Fortfahren Passwort eingeben" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "MetaMask Snaps erforschen" }, - "exportPrivateKey": { - "message": "Private Key exportieren" - }, "extendWalletWithSnaps": { "message": "Erweitern Sie das Wallet-Erlebnis." }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "Privaten Key anzeigen" }, - "showPrivateKeys": { - "message": "Private Keys anzeigen" - }, "showTestnetNetworks": { "message": "Test-Netzwerke anzeigen" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "Transaktionseinsichten für diesen Vertrag zu diesem Zeitpunkt nicht unterstützt." }, - "typePassword": { - "message": "Passwort eingeben" - }, "typeYourSRP": { "message": "Geben Sie Ihre geheime Wiederherstellungsphrase ein" }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 5b26bf1ef..9484a50d7 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "Αντιγράψτε τη διεύθυνση στο πρόχειρο" }, - "copyPrivateKey": { - "message": "Αυτό είναι το ιδιωτικό σας κλειδί (κάντε κλικ για αντιγραφή)" - }, "copyRawTransactionData": { "message": "Αντιγραφή ακατέργαστων δεδομένων συναλλαγών" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "Πληκτρολογήστε προαιρετικό κωδικό πρόσβασης" }, - "enterPassword": { - "message": "Εισάγετε τον κωδικό πρόσβασης" - }, "enterPasswordContinue": { "message": "Πληκτρολογήστε τον κωδικό πρόσβασης για να συνεχίσετε" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "Εξερευνήστε το MetaMask Snaps" }, - "exportPrivateKey": { - "message": "Εξαγωγή Ιδιωτικού Κλειδιού" - }, "extendWalletWithSnaps": { "message": "Επεκτείνετε την εμπειρία του πορτοφολιού." }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "Εμφάνιση ιδιωτικού κλειδιού" }, - "showPrivateKeys": { - "message": "Εμφάνιση Ιδιωτικών Κλειδιών" - }, "showTestnetNetworks": { "message": "Εμφάνιση δοκιμαστικών δικτύων" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "Οι αναλύσεις συναλλαγών εις βάθος δεν υποστηρίζονται για αυτό το συμβόλαιο αυτή τη στιγμή." }, - "typePassword": { - "message": "Πληκτρολογήστε τον κωδικό πρόσβασής σας MetaMask" - }, "typeYourSRP": { "message": "Πληκτρολογήστε τη Μυστική σας Φράση Ανάκτησης" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index b17f89e73..de7b26dbd 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -901,9 +901,6 @@ "copyAddress": { "message": "Copy address to clipboard" }, - "copyPrivateKey": { - "message": "This is your private key (click to copy)" - }, "copyRawTransactionData": { "message": "Copy raw transaction data" }, @@ -1485,9 +1482,6 @@ "enterOptionalPassword": { "message": "Enter optional password" }, - "enterPassword": { - "message": "Enter password" - }, "enterPasswordContinue": { "message": "Enter password to continue" }, @@ -1564,9 +1558,6 @@ "exploreMetaMaskSnaps": { "message": "Explore MetaMask Snaps" }, - "exportPrivateKey": { - "message": "Export private key" - }, "extendWalletWithSnaps": { "message": "Extend the wallet experience." }, @@ -3871,9 +3862,6 @@ "showPrivateKey": { "message": "Show private key" }, - "showPrivateKeys": { - "message": "Show Private Keys" - }, "showTestnetNetworks": { "message": "Show test networks" }, @@ -5133,9 +5121,6 @@ "txInsightsNotSupported": { "message": "Transaction insights not supported for this contract at this time." }, - "typePassword": { - "message": "Type your MetaMask password" - }, "typeYourSRP": { "message": "Type your Secret Recovery Phrase" }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index ccee9a497..497668323 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "Copiar dirección al Portapapeles" }, - "copyPrivateKey": { - "message": "Esta es su clave privada (haga clic para copiarla)" - }, "copyRawTransactionData": { "message": "Copiar los datos de las transacciones en bruto" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "Ingrese la contraseña opcional" }, - "enterPassword": { - "message": "Escribir contraseña" - }, "enterPasswordContinue": { "message": "Escribir contraseña para continuar" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "Explore complementos de MetaMask" }, - "exportPrivateKey": { - "message": "Exportar clave privada" - }, "extendWalletWithSnaps": { "message": "Amplíe la experiencia de uso de la cartera." }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "Mostrar clave privada" }, - "showPrivateKeys": { - "message": "Mostrar claves privadas" - }, "showTestnetNetworks": { "message": "Mostrar redes de prueba" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "En este momento no se admiten informaciones sobre las transacciones para este contrato." }, - "typePassword": { - "message": "Escriba su contraseña de MetaMask" - }, "typeYourSRP": { "message": "Escriba la frase secreta de respaldo" }, diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index 0b000821a..fae4521d5 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -475,9 +475,6 @@ "copyAddress": { "message": "Copiar dirección al Portapapeles" }, - "copyPrivateKey": { - "message": "Esta es su clave privada (haga clic para copiarla)" - }, "copyRawTransactionData": { "message": "Copiar los datos de las transacciones en bruto" }, @@ -767,9 +764,6 @@ "enterMaxSpendLimit": { "message": "Escribir límite máximo de gastos" }, - "enterPassword": { - "message": "Escribir contraseña" - }, "enterPasswordContinue": { "message": "Escribir contraseña para continuar" }, @@ -826,9 +820,6 @@ "experimental": { "message": "Experimental" }, - "exportPrivateKey": { - "message": "Exportar clave privada" - }, "externalExtension": { "message": "Extensión externa" }, @@ -2012,9 +2003,6 @@ "showPermissions": { "message": "Mostrar permisos" }, - "showPrivateKeys": { - "message": "Mostrar claves privadas" - }, "showTestnetNetworks": { "message": "Mostrar redes de prueba" }, @@ -2629,9 +2617,6 @@ "txInsightsNotSupported": { "message": "En este momento no se admiten informaciones sobre las transacciones para este contrato." }, - "typePassword": { - "message": "Escriba su contraseña de MetaMask" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index e0b6889e9..54729cc82 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Kopeeri aadress lõikelauale" }, - "copyPrivateKey": { - "message": "See on teie privaatne võti (klõpsake kopeerimiseks)" - }, "copyToClipboard": { "message": "Kopeeri lõikelauale" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "Tõrge ENS-i nime registreerimisel" }, - "enterPassword": { - "message": "Sisestage parool" - }, "enterPasswordContinue": { "message": "Jätkamiseks sisestage parool" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Laienda vaadet" }, - "exportPrivateKey": { - "message": "Ekspordi privaatvõti" - }, "failed": { "message": "Nurjus" }, @@ -653,9 +644,6 @@ "showHexDataDescription": { "message": "Valige see, et kuvada saatmisekraanil hex-andmete väli" }, - "showPrivateKeys": { - "message": "Kuva privaatvõtmed" - }, "sigRequest": { "message": "Allkirja taotlus" }, @@ -776,9 +764,6 @@ "tryAgain": { "message": "Proovi uuesti" }, - "typePassword": { - "message": "Sisestage oma MetaMaski parool" - }, "unapproved": { "message": "Kinnitamata" }, diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index 54db00df5..964d56e21 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "کاپی آدرس به کلیپ بورد" }, - "copyPrivateKey": { - "message": "این کلید خصوصی شما است (برای کاپی نمودن کلیک کنید)" - }, "copyToClipboard": { "message": "کپی در بریده‌دان" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "خطا در ثبت نام ENS" }, - "enterPassword": { - "message": "رمز عبور را وارد کنید" - }, "enterPasswordContinue": { "message": "برای ادامه رمز عبور را وارد کنید" }, @@ -256,9 +250,6 @@ "expandView": { "message": "توسعه ساحه دید" }, - "exportPrivateKey": { - "message": "صدور کلید شخصی" - }, "failed": { "message": "ناموفق شد" }, @@ -663,9 +654,6 @@ "showHexDataDescription": { "message": "برای نمایش بخش اطلاعات hex در صفحه ارسال این را انتخاب نمایید" }, - "showPrivateKeys": { - "message": "نمایش کلید های شخصی" - }, "sigRequest": { "message": "درخواست امضاء" }, @@ -786,9 +774,6 @@ "tryAgain": { "message": "امتحان مجدد" }, - "typePassword": { - "message": "رمز عبور MetaMask تان را تایپ نمایید" - }, "unapproved": { "message": "تصدیق ناشده" }, diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index 9bf17fcef..0edcecdf6 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Kopioi osoite leikepöydälle" }, - "copyPrivateKey": { - "message": "Tämä on yksityinen avaimesi (kopioi napsauttamalla)" - }, "copyToClipboard": { "message": "Kopioi leikepöydälle" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "Virhe ENS-nimen rekisteröinnissä" }, - "enterPassword": { - "message": "Kirjoita salasana" - }, "enterPasswordContinue": { "message": "Syötä salasana voidaksesi jatkaa" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Laajenna näkymää" }, - "exportPrivateKey": { - "message": "Vie yksityinen avain" - }, "failed": { "message": "Epäonnistui" }, @@ -660,9 +651,6 @@ "showHexDataDescription": { "message": "Näytä hex-tietokenttä lähetysnäytössä valitsemalla tämän" }, - "showPrivateKeys": { - "message": "Näytä yksityiset avaimet" - }, "sigRequest": { "message": "Allekirjoitus pyydetään" }, @@ -783,9 +771,6 @@ "tryAgain": { "message": "Yritä uudelleen" }, - "typePassword": { - "message": "Kirjoita MetaMask-salasanasi" - }, "unapproved": { "message": "Ei hyväksytty" }, diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index bb8270894..67b183451 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -154,9 +154,6 @@ "copyAddress": { "message": "Kopyahin ang address sa clipboard" }, - "copyPrivateKey": { - "message": "Ito ang iyong pribadong private key (i-click para kopyahin)" - }, "copyToClipboard": { "message": "Kopyahin sa clipboard" }, @@ -217,9 +214,6 @@ "ensRegistrationError": { "message": "May error sa pagrerehistro ng ENS name" }, - "enterPassword": { - "message": "Ilagay ang password" - }, "enterPasswordContinue": { "message": "Ilagay ang password para magpatuloy" }, @@ -229,9 +223,6 @@ "expandView": { "message": "I-expand ang View" }, - "exportPrivateKey": { - "message": "I-export ang Private Key" - }, "failed": { "message": "Nabigo" }, @@ -587,9 +578,6 @@ "showHexDataDescription": { "message": "Piliin ito para ipakita ang hex data field sa screen ng pagpapadala" }, - "showPrivateKeys": { - "message": "Ipakita ang mga Private Key" - }, "sign": { "message": "I-sign" }, @@ -698,9 +686,6 @@ "tryAgain": { "message": "Subukang muli" }, - "typePassword": { - "message": "I-type ang iyong password sa MetaMask" - }, "unapproved": { "message": "Hindi inaprubahan" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 6dc0df5db..0f77d9850 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "Copier l’addresse dans le presse-papier" }, - "copyPrivateKey": { - "message": "Ceci est votre clé privée (cliquez pour copier)" - }, "copyRawTransactionData": { "message": "Copier les données brutes de la transaction" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "Entrez le mot de passe facultatif" }, - "enterPassword": { - "message": "Entrez votre mot de passe" - }, "enterPasswordContinue": { "message": "Entrez votre mot de passe pour continuer" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "Explorer les Snaps MetaMask" }, - "exportPrivateKey": { - "message": "Exporter la clé privée" - }, "extendWalletWithSnaps": { "message": "Prolongez l’expérience avec ce portefeuille." }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "Afficher la clé privée" }, - "showPrivateKeys": { - "message": "Afficher les clés privées" - }, "showTestnetNetworks": { "message": "Afficher les réseaux de test" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "Les aperçus de transaction ne sont pas pris en charge pour ce contrat à l’heure actuelle." }, - "typePassword": { - "message": "Entrez votre mot de passe" - }, "typeYourSRP": { "message": "Saisissez votre phrase secrète de récupération" }, diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index ab70fe6ee..81769c5c6 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "העתק כתובת ללוח" }, - "copyPrivateKey": { - "message": "זה המפתח הפרטי שלך (נא להקיש כדי להעתיק)" - }, "copyToClipboard": { "message": "העתק ללוח" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "שגיאה ברישום שם ENS" }, - "enterPassword": { - "message": "יש להזין ססמה" - }, "enterPasswordContinue": { "message": "יש להזין ססמה כדי להמשיך" }, @@ -256,9 +250,6 @@ "expandView": { "message": "הרחב תצוגה" }, - "exportPrivateKey": { - "message": "יצא/י מפתח פרטי" - }, "failed": { "message": "נכשל" }, @@ -660,9 +651,6 @@ "showHexDataDescription": { "message": "בחר/י בזה כדי להציג את שדה הנתונים ההקסדצימאלים על מסך השליחה" }, - "showPrivateKeys": { - "message": "הצג מפתחות פרטיים" - }, "sigRequest": { "message": "בקשת חתימה" }, @@ -783,9 +771,6 @@ "tryAgain": { "message": "ניסיון חוזר" }, - "typePassword": { - "message": "נא להקליד את סיסמת MetaMask שלך" - }, "unapproved": { "message": "לא אושר" }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 463bb8772..5ea16ed0d 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "क्लिपबोर्ड पर पता कॉपी करें" }, - "copyPrivateKey": { - "message": "यह आपकी निजी कुंजी है (कॉपी करने के लिए क्लिक करें)" - }, "copyRawTransactionData": { "message": "लेन-देन का अपरिष्कृत डेटा कॉपी करें" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "वैकल्पिक पासवर्ड डालें" }, - "enterPassword": { - "message": "पासवर्ड दर्ज करें" - }, "enterPasswordContinue": { "message": "जारी रखने के लिए पासवर्ड दर्ज करें" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "MetaMask स्नैप्स का अन्वेषण करें" }, - "exportPrivateKey": { - "message": "निजी कुंजी निर्यात करें" - }, "extendWalletWithSnaps": { "message": "वॉलेट अनुभव का विस्तार करें।" }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "निजी कुंजी दिखाएं" }, - "showPrivateKeys": { - "message": "निजी कुंजियां दिखाएं" - }, "showTestnetNetworks": { "message": "परीक्षण नेटवर्क दिखाएं" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "इस समय इस अनुबंध के लिए लेन-देन की जानकारी समर्थित नहीं है।" }, - "typePassword": { - "message": "अपना MetaMask पासवर्ड टाइप करें" - }, "typeYourSRP": { "message": "अपना गुप्त रिकवरी वाक्यांश लिखें" }, diff --git a/app/_locales/hn/messages.json b/app/_locales/hn/messages.json index e59a8ca57..cb0a6795b 100644 --- a/app/_locales/hn/messages.json +++ b/app/_locales/hn/messages.json @@ -60,9 +60,6 @@ "copiedExclamation": { "message": "कॉपी कर दिया गया!" }, - "copyPrivateKey": { - "message": "यह आपकी निजी कुंजी है (कॉपी करने के लिए क्लिक करें)।" - }, "copyToClipboard": { "message": "क्लिपबोर्ड पर कॉपी करें" }, @@ -87,15 +84,9 @@ "edit": { "message": "संपादित करें" }, - "enterPassword": { - "message": "पासवर्ड दर्ज करें" - }, "etherscanView": { "message": "ईथरस्कैन पर खाता देखें" }, - "exportPrivateKey": { - "message": "निजी कुंजी निर्यात करें" - }, "failed": { "message": "विफल" }, @@ -281,9 +272,6 @@ "settings": { "message": "सेटिंग्स" }, - "showPrivateKeys": { - "message": "निजी कुंजी दिखाएँ" - }, "sigRequest": { "message": "हस्ताक्षर अनुरोध" }, @@ -317,9 +305,6 @@ "total": { "message": "कुल" }, - "typePassword": { - "message": "अपना पासवर्ड टाइप करें" - }, "unknown": { "message": "अज्ञात नेटवर्क" }, diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index aa20baa31..d3234737f 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Kopiraj adresu u međuspremnik" }, - "copyPrivateKey": { - "message": "Ovo je vaš privatni ključ (kliknite za kopiranje)" - }, "copyToClipboard": { "message": "Kopiraj u međuspremnik" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "Greška u registraciji naziva ENS" }, - "enterPassword": { - "message": "Upiši lozinku" - }, "enterPasswordContinue": { "message": "Upišite lozinku za nastavak" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Proširi prikaz" }, - "exportPrivateKey": { - "message": "Izvezi privatni ključ" - }, "failed": { "message": "Neuspješno" }, @@ -656,9 +647,6 @@ "showHexDataDescription": { "message": "Odaberite ovu stavku za prikaz polja namijenjenog za podatke hex na zaslonu za slanje" }, - "showPrivateKeys": { - "message": "Prikaži privatne ključe" - }, "sigRequest": { "message": "Zahtjev za potpisom" }, @@ -776,9 +764,6 @@ "tryAgain": { "message": "Pokušaj ponovo" }, - "typePassword": { - "message": "Upišite svoju lozinku MetaMask." - }, "unapproved": { "message": "Neodobreno" }, diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json index d14e5f7a7..21cdca31d 100644 --- a/app/_locales/ht/messages.json +++ b/app/_locales/ht/messages.json @@ -108,9 +108,6 @@ "copyAddress": { "message": "Kopi adrès clipboard" }, - "copyPrivateKey": { - "message": "Sa a se kle prive ou (klike pou ou kopye)" - }, "copyToClipboard": { "message": "Kopi clipboard" }, @@ -147,9 +144,6 @@ "edit": { "message": "Korije" }, - "enterPassword": { - "message": "Mete modpas" - }, "enterPasswordContinue": { "message": "Mete modpas pou kontinye" }, @@ -159,9 +153,6 @@ "expandView": { "message": "Elaji Wè" }, - "exportPrivateKey": { - "message": "Voye Kòd Prive" - }, "failed": { "message": "Tonbe" }, @@ -482,9 +473,6 @@ "showHexDataDescription": { "message": "Pran sa pouw ka montre chan entèfas hex data a" }, - "showPrivateKeys": { - "message": "Montre Kle Prive" - }, "sigRequest": { "message": "Demann Siyati" }, @@ -554,9 +542,6 @@ "tryAgain": { "message": "Eseye anko" }, - "typePassword": { - "message": "Tape modpas ou" - }, "unapproved": { "message": "Pa apwouve" }, diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index ca77ac427..ad45f5586 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Másolja a címet a vágólapra" }, - "copyPrivateKey": { - "message": "Ez a saját titkos kulcsod (kattints rá a másoláshoz)" - }, "copyToClipboard": { "message": "Másolás a vágólapra" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "Hiba történt az ENS név regisztrációjakor" }, - "enterPassword": { - "message": "Adja meg a jelszót" - }, "enterPasswordContinue": { "message": "A folytatáshoz adja meg a jelszót" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Nézet nagyítása" }, - "exportPrivateKey": { - "message": "Privát kulcs exportálása" - }, "failed": { "message": "Sikertelen" }, @@ -656,9 +647,6 @@ "showHexDataDescription": { "message": "Válassza ezt, ha a hex adatmezőt a küldő képernyőn szeretné megnézni" }, - "showPrivateKeys": { - "message": "Mutassa a privát kulcsokat" - }, "sigRequest": { "message": "Aláírás kérése" }, @@ -776,9 +764,6 @@ "tryAgain": { "message": "Újra" }, - "typePassword": { - "message": "Írd be MetaMask jelszavadat" - }, "unapproved": { "message": "Jóvá nem hagyott" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 0e946c073..dbfa787df 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "Salin alamat ke papan klip" }, - "copyPrivateKey": { - "message": "Ini adalah kunci privat Anda (klik untuk menyalin)" - }, "copyRawTransactionData": { "message": "Salin data transaksi mentah" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "Masukkan kata sandi opsional" }, - "enterPassword": { - "message": "Masukkan kata sandi" - }, "enterPasswordContinue": { "message": "Masukkan kata sandi untuk melanjutkan" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "Jelajahi MetaMask Snaps" }, - "exportPrivateKey": { - "message": "Ekspor kunci privat" - }, "extendWalletWithSnaps": { "message": "Perluas pengalaman dompet." }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "Tampilkan kunci pribadi" }, - "showPrivateKeys": { - "message": "Tampilkan Kunci Privat" - }, "showTestnetNetworks": { "message": "Tampilkan jaringan pengujian" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "Pemahaman transaksi tidak didukung untuk kontrak ini saat ini." }, - "typePassword": { - "message": "Ketikkan kata sandi MetaMask Anda" - }, "typeYourSRP": { "message": "Ketik Frasa Pemulihan Rahasia" }, diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index 4545daa82..3a6787b60 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -579,9 +579,6 @@ "copyAddress": { "message": "Copia l'indirizzo" }, - "copyPrivateKey": { - "message": "Questa è la tua chiave privata (clicca per copiare)" - }, "copyRawTransactionData": { "message": "Copia i dati grezzi della transazione" }, @@ -840,9 +837,6 @@ "enterMaxSpendLimit": { "message": "Inserisici Limite Spesa" }, - "enterPassword": { - "message": "Inserisci password" - }, "enterPasswordContinue": { "message": "Inserisci la tua password per continuare" }, @@ -875,9 +869,6 @@ "expandView": { "message": "Espandi Vista" }, - "exportPrivateKey": { - "message": "Esporta Chiave Privata" - }, "externalExtension": { "message": "Estensione Esterna" }, @@ -1439,9 +1430,6 @@ "showPermissions": { "message": "Mostra permessi" }, - "showPrivateKeys": { - "message": "Mostra Chiave Privata" - }, "sigRequest": { "message": "Firma Richiesta" }, @@ -1794,9 +1782,6 @@ "tryAgain": { "message": "Prova di nuovo" }, - "typePassword": { - "message": "Inserisci Password" - }, "unapproved": { "message": "Non approvata" }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index fb5481650..463cbd64b 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "アドレスをクリップボードにコピー" }, - "copyPrivateKey": { - "message": "これは秘密鍵です (クリックしてコピー)" - }, "copyRawTransactionData": { "message": "未処理のトランザクションデータをコピー" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "オプションのパスワードを入力してください" }, - "enterPassword": { - "message": "パスワードを入力してください" - }, "enterPasswordContinue": { "message": "続行するには、パスワードを入力してください" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "MetaMask スナップを閲覧" }, - "exportPrivateKey": { - "message": "秘密鍵のエクスポート" - }, "extendWalletWithSnaps": { "message": "ウォレットのエクスペリエンスを拡張します。" }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "秘密鍵を表示" }, - "showPrivateKeys": { - "message": "秘密鍵を表示" - }, "showTestnetNetworks": { "message": "テストネットワークを表示" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "現時点ではこのコントラクトでトランザクションインサイトはサポートされていません。" }, - "typePassword": { - "message": "MetaMaskパスワードを入力してください" - }, "typeYourSRP": { "message": "秘密のリカバリーフレーズを入力してください" }, diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index 62a51a898..ef8703f47 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "ವಿಳಾಸವನ್ನು ಕ್ಲಿಪ್‌ಬೋರ್ಡ್‌ಗೆ ನಕಲಿಸಿ" }, - "copyPrivateKey": { - "message": "ಇದು ನಿಮ್ಮ ಖಾಸಗಿ ಕೀ ಆಗಿದೆ (ನಕಲಿಸಲು ಕ್ಲಿಕ್ ಮಾಡಿ)" - }, "copyToClipboard": { "message": "ಕ್ಲಿಪ್‌ಬೋರ್ಡ್‌ಗೆ ನಕಲಿಸಿ" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "ENS ಹೆಸರಿನ ನೋಂದಣಿಯಲ್ಲಿ ದೋಷ" }, - "enterPassword": { - "message": "ಪಾಸ್‌ವರ್ಡ್‌ ಅನ್ನು ನಮೂದಿಸಿ" - }, "enterPasswordContinue": { "message": "ಮುಂದುವರೆಯಲು ಪಾಸ್‌ವರ್ಡ್ ನಮೂದಿಸಿ" }, @@ -256,9 +250,6 @@ "expandView": { "message": "ವಿಸ್ತರಿಸಿದ ವೀಕ್ಷಣೆ" }, - "exportPrivateKey": { - "message": "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ರಫ್ತು ಮಾಡಿ" - }, "failed": { "message": "ವಿಫಲವಾಗಿದೆ" }, @@ -663,9 +654,6 @@ "showHexDataDescription": { "message": "ಕಳುಹಿಸುವ ಪರದೆಯಲ್ಲಿ ಹೆಕ್ಸ್ ಡೇಟಾ ಕ್ಷೇತ್ರವನ್ನು ತೋರಿಸಲು ಇದನ್ನು ಆಯ್ಕೆಮಾಡಿ" }, - "showPrivateKeys": { - "message": "ಖಾಸಗಿ ಕೀಗಳನ್ನು ತೋರಿಸಿ" - }, "sigRequest": { "message": "ಸಹಿಯ ವಿನಂತಿ" }, @@ -786,9 +774,6 @@ "tryAgain": { "message": "ಪುನಃ ಪ್ರಯತ್ನಿಸಿ" }, - "typePassword": { - "message": "ನಿಮ್ಮ MetaMask ಪಾಸ್‌ವರ್ಡ್ ಅನ್ನು ಟೈಪ್ ಮಾಡಿ" - }, "unapproved": { "message": "ಅನುಮೋದಿಸದಿರುವುದು" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 1b054a270..2ba43e26e 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "주소를 클립보드에 복사" }, - "copyPrivateKey": { - "message": "이는 귀하의 비공개 키입니다(클릭하여 복사)" - }, "copyRawTransactionData": { "message": "원시 거래 데이터 복사" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "선택적 비밀번호를 입력하세요" }, - "enterPassword": { - "message": "비밀번호 입력" - }, "enterPasswordContinue": { "message": "계속하려면 비밀번호를 입력하세요" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "MetaMask 스냅 탐색" }, - "exportPrivateKey": { - "message": "비공개 키 내보내기" - }, "extendWalletWithSnaps": { "message": "지갑 경험 확장" }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "개인 키 표시" }, - "showPrivateKeys": { - "message": "비공개 키 표시" - }, "showTestnetNetworks": { "message": "테스트 네트워크 보기" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "현재 이 계약에 대해 거래 인사이트가 지원되지 않습니다." }, - "typePassword": { - "message": "MetaMask 비밀번호를 입력하세요" - }, "typeYourSRP": { "message": "비밀 복구 구문을 입력하세요" }, diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index f1294dbde..152de607b 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Kopijuoti adresą į iškarpinę" }, - "copyPrivateKey": { - "message": "Tai yra jūsų asmeninis raktas (spustelėkite, kad nukopijuotumėte)" - }, "copyToClipboard": { "message": "Kopijuoti į iškarpinę" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "ENS pavadinimo registracijos klaida" }, - "enterPassword": { - "message": "Įveskite slaptažodį" - }, "enterPasswordContinue": { "message": "Norėdami tęsti, įveskite slaptažodį" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Išskleisti rodinį" }, - "exportPrivateKey": { - "message": "Eksportuoti asmeninį raktą" - }, "failed": { "message": "Nepavyko" }, @@ -663,9 +654,6 @@ "showHexDataDescription": { "message": "Pasirinkite tai, kad siuntimo ekrane būtų rodomas šešioliktainių duomenų laukas" }, - "showPrivateKeys": { - "message": "Rodyti asmeninius raktus" - }, "sigRequest": { "message": "Parašo užklausa" }, @@ -786,9 +774,6 @@ "tryAgain": { "message": "Bandyti dar kartą" }, - "typePassword": { - "message": "Įveskite savo „MetaMask“ slaptažodį" - }, "unapproved": { "message": "Nepatvirtinta" }, diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index a2c9cc425..3e2521c4d 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Iekopēt adresi starpliktuvē" }, - "copyPrivateKey": { - "message": "Šī ir jūsu privātā atslēga (noklikšķiniet, lai nokopētu)" - }, "copyToClipboard": { "message": "Kopēt starpliktuvē" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "Kļūda ENS vārda reģistrācijā" }, - "enterPassword": { - "message": "Ievadiet paroli" - }, "enterPasswordContinue": { "message": "Ievadiet paroli, lai turpinātu" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Izvērst skatījumu" }, - "exportPrivateKey": { - "message": "Eksportēt privāto atslēgu" - }, "failed": { "message": "Neizdevās" }, @@ -659,9 +650,6 @@ "showHexDataDescription": { "message": "Atlasiet šo, lai atvērtu hex datus sūtīšanas ekrānā" }, - "showPrivateKeys": { - "message": "Rādīt privātās atslēgas" - }, "sigRequest": { "message": "Paraksta pieprasījums" }, @@ -782,9 +770,6 @@ "tryAgain": { "message": "Mēģināt vēlreiz" }, - "typePassword": { - "message": "Ievadiet savu MetaMask paroli" - }, "unapproved": { "message": "Nav apstiprināts" }, diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index e94e1ccae..a2ae42331 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Salin alamat kepada papan klip" }, - "copyPrivateKey": { - "message": "Ini kunci persendirian anda (klik untuk menyalin)" - }, "copyToClipboard": { "message": "Salin ke papan keratan" }, @@ -238,9 +235,6 @@ "ensRegistrationError": { "message": "Ralat dalam pendaftaran nama ENS" }, - "enterPassword": { - "message": "Masukkan kata laluan" - }, "enterPasswordContinue": { "message": "Masukkan kata laluan untuk teruskan" }, @@ -253,9 +247,6 @@ "expandView": { "message": "Kembangkan Paparan" }, - "exportPrivateKey": { - "message": "Eksport Kekunci Persendirian" - }, "failed": { "message": "Gagal" }, @@ -643,9 +634,6 @@ "showHexDataDescription": { "message": "Pilih ini untuk menunjukkan medan data hex pada skrin hantar" }, - "showPrivateKeys": { - "message": "Tunjukkan Kunci Persendirian" - }, "sigRequest": { "message": "Permintaan Tandatangan" }, @@ -763,9 +751,6 @@ "tryAgain": { "message": "Cuba lagi" }, - "typePassword": { - "message": "Taip kata laluan MetaMask anda" - }, "unapproved": { "message": "Belum Diluluskan" }, diff --git a/app/_locales/nl/messages.json b/app/_locales/nl/messages.json index 2817275ca..3cc25f6cf 100644 --- a/app/_locales/nl/messages.json +++ b/app/_locales/nl/messages.json @@ -60,9 +60,6 @@ "copiedExclamation": { "message": "Gekopieerd!" }, - "copyPrivateKey": { - "message": "Dit is uw privésleutel (klik om te kopiëren)" - }, "copyToClipboard": { "message": "Kopieer naar klembord" }, @@ -84,15 +81,9 @@ "edit": { "message": "Bewerk" }, - "enterPassword": { - "message": "Voer wachtwoord in" - }, "etherscanView": { "message": "Bekijk account op Etherscan" }, - "exportPrivateKey": { - "message": "Exporteer privésleutel" - }, "failed": { "message": "mislukt" }, @@ -271,9 +262,6 @@ "settings": { "message": "instellingen" }, - "showPrivateKeys": { - "message": "Privésleutels weergeven" - }, "sigRequest": { "message": "Ondertekeningsverzoek" }, @@ -307,9 +295,6 @@ "total": { "message": "Totaal" }, - "typePassword": { - "message": "Typ uw wachtwoord" - }, "unknown": { "message": "Onbekend" }, diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 820dbcf35..4d156cd37 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -172,9 +172,6 @@ "copyAddress": { "message": "Kopier adresse til utklippstavlen " }, - "copyPrivateKey": { - "message": "Dette er din private nøkkel (klikk for å kopiere)" - }, "copyToClipboard": { "message": "Kopiér til utklippstavlen" }, @@ -238,9 +235,6 @@ "ensRegistrationError": { "message": "Feil i ENS-navneregistrering" }, - "enterPassword": { - "message": "Skriv inn passord " - }, "enterPasswordContinue": { "message": "Skriv inn passord for å fortsette" }, @@ -253,9 +247,6 @@ "expandView": { "message": "Utvid visning" }, - "exportPrivateKey": { - "message": "Eksporter privat nøkkel" - }, "failed": { "message": "Mislyktes" }, @@ -644,9 +635,6 @@ "showHexDataDescription": { "message": "Velg dette for å vise hex-datafeltet på sendskjermen" }, - "showPrivateKeys": { - "message": "Vis private nøkler" - }, "sigRequest": { "message": "Signaturforespørsel " }, @@ -761,9 +749,6 @@ "tryAgain": { "message": "Prøv igjen" }, - "typePassword": { - "message": "Skriv inn MetaMask-passordet" - }, "unapproved": { "message": "Ikke godkjent " }, diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index 755965d2a..c51311aab 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -338,9 +338,6 @@ "copyAddress": { "message": "Kopyahin ang address sa clipboard" }, - "copyPrivateKey": { - "message": "Ito ang iyong pribadong key (i-click para kopyahin)" - }, "copyToClipboard": { "message": "Kopyahin sa clipboard" }, @@ -489,9 +486,6 @@ "enterMaxSpendLimit": { "message": "Ilagay ang Max na Limitasyon sa Paggastos" }, - "enterPassword": { - "message": "Ilagay ang password" - }, "enterPasswordContinue": { "message": "Ilagay ang password para magpatuloy" }, @@ -542,9 +536,6 @@ "expandView": { "message": "I-expand ang view" }, - "exportPrivateKey": { - "message": "I-export ang Pribadong Key" - }, "externalExtension": { "message": "External Extension" }, @@ -1309,9 +1300,6 @@ "showPermissions": { "message": "Ipakita ang mga pahintulot" }, - "showPrivateKeys": { - "message": "Ipakita ang Mga Private Key" - }, "sigRequest": { "message": "Request ng Signature" }, @@ -1764,9 +1752,6 @@ "tryAgain": { "message": "Subukan ulit" }, - "typePassword": { - "message": "Uri ng password ng iyong MetaMask" - }, "unapproved": { "message": "Hindi inaprubahan" }, diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index 9ec3a0677..63b3f4fde 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Skopiuj adres do schowka" }, - "copyPrivateKey": { - "message": "To jest Twój prywatny klucz (kliknij żeby skopiować)" - }, "copyToClipboard": { "message": "Skopiuj do schowka" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "Błąd w rejestracji nazwy ENS" }, - "enterPassword": { - "message": "Wpisz hasło" - }, "enterPasswordContinue": { "message": "Podaj hasło żeby kontynuować" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Rozwiń widok" }, - "exportPrivateKey": { - "message": "Eksportuj klucz prywatny" - }, "failed": { "message": "Nie udało się" }, @@ -657,9 +648,6 @@ "showHexDataDescription": { "message": "Wybierz to żeby pokazać pole danych hex na ekranie wysyłania" }, - "showPrivateKeys": { - "message": "Pokaż prywatne klucze" - }, "sigRequest": { "message": "Prośba o podpis" }, @@ -774,9 +762,6 @@ "tryAgain": { "message": "Spróbuj ponownie" }, - "typePassword": { - "message": "Wpisz hasło" - }, "unapproved": { "message": "Niezatwierdzone" }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index be64f6d10..f05feefe2 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "Copiar endereço para a área de transferência" }, - "copyPrivateKey": { - "message": "Esta é a sua chave privada (carregue para copiar)" - }, "copyRawTransactionData": { "message": "Copiar dados brutos da transação" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "Insira a senha opcional" }, - "enterPassword": { - "message": "Introduza palavra-passe" - }, "enterPasswordContinue": { "message": "Insira a senha para continuar" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "Explorar os snaps da MetaMask" }, - "exportPrivateKey": { - "message": "Exportar chave privada" - }, "extendWalletWithSnaps": { "message": "Amplie a experiência da carteira." }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "Exibir chave privada" }, - "showPrivateKeys": { - "message": "Mostrar Chaves Privadas" - }, "showTestnetNetworks": { "message": "Mostrar redes de teste" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "As informações sobre transações não são suportadas para esse contrato, por ora." }, - "typePassword": { - "message": "Digite a sua Palavra-passe" - }, "typeYourSRP": { "message": "Digite sua Frase de Recuperação Secreta" }, diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index 84ff0a098..3a9d50934 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -475,9 +475,6 @@ "copyAddress": { "message": "Copiar endereço para a área de transferência" }, - "copyPrivateKey": { - "message": "Essa é a sua chave privada (clique para copiar)" - }, "copyRawTransactionData": { "message": "Copiar dados brutos da transação" }, @@ -767,9 +764,6 @@ "enterMaxSpendLimit": { "message": "Digite um limite máximo de gastos" }, - "enterPassword": { - "message": "Digite a senha" - }, "enterPasswordContinue": { "message": "Digite a senha para continuar" }, @@ -826,9 +820,6 @@ "experimental": { "message": "Experimental" }, - "exportPrivateKey": { - "message": "Exportar chave privada" - }, "externalExtension": { "message": "Extensão externa" }, @@ -2016,9 +2007,6 @@ "showPermissions": { "message": "Mostrar permissões" }, - "showPrivateKeys": { - "message": "Mostrar chaves privadas" - }, "showTestnetNetworks": { "message": "Mostrar redes de teste" }, @@ -2633,9 +2621,6 @@ "txInsightsNotSupported": { "message": "As informações sobre transações não são suportadas para esse contrato, por ora." }, - "typePassword": { - "message": "Digite sua senha da MetaMask" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index 7b0ae2062..b3677f72c 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Copiere adresă în clipboard" }, - "copyPrivateKey": { - "message": "Aceasta este cheia dumneavoastră privată (clic pentru a copia)" - }, "copyToClipboard": { "message": "Copiați în clipboard" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "Eroare la înregistrarea numelui ENS" }, - "enterPassword": { - "message": "Introduceți parola" - }, "enterPasswordContinue": { "message": "Introduceți parola pentru a continua" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Extindeți vizualizarea" }, - "exportPrivateKey": { - "message": "Exportați cheia privată" - }, "failed": { "message": "Eșuat" }, @@ -650,9 +641,6 @@ "showHexDataDescription": { "message": "Selectați această opțiune pentru a arăta câmpul de date hexazecimale în ecranul de trimitere." }, - "showPrivateKeys": { - "message": "Afișați cheile private" - }, "sigRequest": { "message": "Solicitare de semnătură" }, @@ -767,9 +755,6 @@ "tryAgain": { "message": "Încearcă din nou" }, - "typePassword": { - "message": "Scrieți parola dvs. pentru MetaMask" - }, "unapproved": { "message": "Neaprobat" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 301ccefdb..36bdaae0c 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "Скопировать адрес в буфер обмена" }, - "copyPrivateKey": { - "message": "Это ваш закрытый ключ (нажмите, чтобы скопировать)" - }, "copyRawTransactionData": { "message": "Копировать необработанные данные транзакции" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "Введите необязательный пароль" }, - "enterPassword": { - "message": "Введите пароль" - }, "enterPasswordContinue": { "message": "Введите пароль, чтобы продолжить" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "Обзор привязок MetaMask" }, - "exportPrivateKey": { - "message": "Экспорт закрытого ключа" - }, "extendWalletWithSnaps": { "message": "Расширьте возможности кошелька." }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "Показать закрытый ключ" }, - "showPrivateKeys": { - "message": "Показать закрытые ключи" - }, "showTestnetNetworks": { "message": "Показать тестовые сети" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "Для этого контракта сейчас не поддерживается аналитика транзакций." }, - "typePassword": { - "message": "Введите свой пароль MetaMask" - }, "typeYourSRP": { "message": "Введите секретную фразу для восстановления" }, diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index 277713b1c..b9cda984f 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -169,9 +169,6 @@ "copyAddress": { "message": "Kopírovať adresu do schránky" }, - "copyPrivateKey": { - "message": "Toto je váš privátní klíč (kliknutím zkopírujte)" - }, "copyToClipboard": { "message": "Kopírovat do schránky" }, @@ -235,9 +232,6 @@ "ensRegistrationError": { "message": "Chyba pri registrácii názvu ENS" }, - "enterPassword": { - "message": "Zadejte heslo" - }, "enterPasswordContinue": { "message": "Pokračujte zadaním hesla" }, @@ -250,9 +244,6 @@ "expandView": { "message": "Rozbaliť zobrazenie" }, - "exportPrivateKey": { - "message": "Exportovat privátní klíč" - }, "failed": { "message": "Neúspěšné" }, @@ -635,9 +626,6 @@ "showHexDataDescription": { "message": "Vyberte toto, ak chcete, aby sa na obrazovke odosielania zobrazilo hex dátové pole" }, - "showPrivateKeys": { - "message": "Zobrazit privátní klíče" - }, "sigRequest": { "message": "Požadavek podpisu" }, @@ -752,9 +740,6 @@ "tryAgain": { "message": "Skúsiť znova" }, - "typePassword": { - "message": "Zadejte své heslo" - }, "unapproved": { "message": "Neschváleno" }, diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index b81cc3630..ed8fd238a 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Kopiraj naslov v odložišče" }, - "copyPrivateKey": { - "message": "To je vaš zesebni ključ (kliknite za kopiranje)" - }, "copyToClipboard": { "message": "Kopiraj v odložišče" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "Napaka pri registraciji imena ENS" }, - "enterPassword": { - "message": "Vnesite geslo" - }, "enterPasswordContinue": { "message": "Za nadaljevanje vnesite geslo" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Razširi pogled" }, - "exportPrivateKey": { - "message": "Izvozi zasebni ključ" - }, "failed": { "message": "Ni uspelo" }, @@ -651,9 +642,6 @@ "showHexDataDescription": { "message": "Izberite za prikaz hex podatkov na zaslonu za pošiljanje" }, - "showPrivateKeys": { - "message": "Pokaži zasebni ključ" - }, "sigRequest": { "message": "Zahteva za podpis" }, @@ -774,9 +762,6 @@ "tryAgain": { "message": "Poskusi znova" }, - "typePassword": { - "message": "Vnesite vaše MetaMask geslo" - }, "unapproved": { "message": "Neodobreno" }, diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index 54a833755..811c46bca 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -172,9 +172,6 @@ "copyAddress": { "message": "Kopirajte adresu u ostavu" }, - "copyPrivateKey": { - "message": "Ovo je vaš privatni ključ (kliknite kako biste ga kopirali)" - }, "copyToClipboard": { "message": "Копирај у меморију" }, @@ -238,9 +235,6 @@ "ensRegistrationError": { "message": "Greška u registraciji ENS imena." }, - "enterPassword": { - "message": "Unesite lozinku" - }, "enterPasswordContinue": { "message": "Unesite lozinku kako biste nastavili" }, @@ -253,9 +247,6 @@ "expandView": { "message": "Proširite prikaz" }, - "exportPrivateKey": { - "message": "Izvezite privatni ključ" - }, "failed": { "message": "Neuspešno" }, @@ -654,9 +645,6 @@ "showHexDataDescription": { "message": "Izaberite ovo da bi se pokazalo polje sa hex podacima na „Pošalji” ekranu " }, - "showPrivateKeys": { - "message": "Prikažite privatne ključeve" - }, "sigRequest": { "message": "Zahtev za potpisom" }, @@ -774,9 +762,6 @@ "tryAgain": { "message": "Пробај поново" }, - "typePassword": { - "message": "Ukucajte svoju MetaMask šifru" - }, "unapproved": { "message": "Neodobren" }, diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index 637c22227..15475fd0d 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -169,9 +169,6 @@ "copyAddress": { "message": "Kopiera adress till urklipp" }, - "copyPrivateKey": { - "message": "Det här är din privata nyckel (klicka för att kopiera)" - }, "copyToClipboard": { "message": "Kopiera till Urklipp" }, @@ -235,9 +232,6 @@ "ensRegistrationError": { "message": "Fel i ENS-namnregistrering" }, - "enterPassword": { - "message": "Ange lösenord" - }, "enterPasswordContinue": { "message": "Ange lösenord för att fortsätta" }, @@ -250,9 +244,6 @@ "expandView": { "message": "Expandera vy" }, - "exportPrivateKey": { - "message": "Exportera privat nyckel" - }, "failed": { "message": "Misslyckades" }, @@ -647,9 +638,6 @@ "showHexDataDescription": { "message": "Välj detta för att visa hex-datafältet på sändarskärmen" }, - "showPrivateKeys": { - "message": "Visa privata nycklar" - }, "sigRequest": { "message": "Signaturförfrågan" }, @@ -761,9 +749,6 @@ "tryAgain": { "message": "Försök igen" }, - "typePassword": { - "message": "Ange ditt MetaMask-lösenord" - }, "unapproved": { "message": "Inte godkänd" }, diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index 1b8fc27d0..b8f505229 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -169,9 +169,6 @@ "copyAddress": { "message": "Nakili anwani kwenye ubao wa kunakilia" }, - "copyPrivateKey": { - "message": "Huu ni ufunguo wako wa kibinafsi (bofya ili unakili)" - }, "copyToClipboard": { "message": "Nakili kwenye ubao wa kunakili" }, @@ -235,9 +232,6 @@ "ensRegistrationError": { "message": "Hitilafu imetokea kwenye usajili wa jina la ENS" }, - "enterPassword": { - "message": "Ingiza nenosiri" - }, "enterPasswordContinue": { "message": "Ingiza nenosiri ili uendelee" }, @@ -250,9 +244,6 @@ "expandView": { "message": "Panua Mwonekano" }, - "exportPrivateKey": { - "message": "Panua Mwonekano" - }, "failed": { "message": "Imeshindwa" }, @@ -641,9 +632,6 @@ "showHexDataDescription": { "message": "Chagua hii ili uonyeshe sehemu ya data ya hex kwenye skrini ya tuma" }, - "showPrivateKeys": { - "message": "Onyesha Fungo Binafsi" - }, "sigRequest": { "message": "Ombi la Saini" }, @@ -764,9 +752,6 @@ "tryAgain": { "message": "Jaribu tena" }, - "typePassword": { - "message": "Andika nenosiri lako la MetaMask" - }, "unapproved": { "message": "Haijaidhinishwa" }, diff --git a/app/_locales/ta/messages.json b/app/_locales/ta/messages.json index 909ff25ec..1e47cf563 100644 --- a/app/_locales/ta/messages.json +++ b/app/_locales/ta/messages.json @@ -87,9 +87,6 @@ "copiedExclamation": { "message": "நகலெடுக்கப்பட்டன!" }, - "copyPrivateKey": { - "message": "இது உங்கள் தனிப்பட்ட விசை (நகலெடுக்க கிளிக் செய்யவும்)" - }, "copyToClipboard": { "message": "கிளிப்போர்டுக்கு நகலெடு" }, @@ -126,15 +123,9 @@ "edit": { "message": "திருத்து" }, - "enterPassword": { - "message": "கடவுச்சொல்லை உள்ளிடவும்" - }, "etherscanView": { "message": "Etherscan கணக்கைப் பார்க்கவும்" }, - "exportPrivateKey": { - "message": "தனியார் விசை ஐ ஏற்றுமதி செய்க" - }, "failed": { "message": "தோல்வி" }, @@ -374,9 +365,6 @@ "settings": { "message": "அமைப்புகள்" }, - "showPrivateKeys": { - "message": "தனிப்பட்ட விசைகளைக் காண்பி" - }, "sigRequest": { "message": "கையொப்பம் கோரிக்கை" }, @@ -425,9 +413,6 @@ "tryAgain": { "message": "மீண்டும் முயல்க" }, - "typePassword": { - "message": "உங்கள் கடவுச்சொல்லை தட்டச்சு செய்யவும்" - }, "unapproved": { "message": "அங்கீகரிக்கப்படாத" }, diff --git a/app/_locales/th/messages.json b/app/_locales/th/messages.json index a1c235a18..186ce473d 100644 --- a/app/_locales/th/messages.json +++ b/app/_locales/th/messages.json @@ -78,9 +78,6 @@ "copiedExclamation": { "message": "คัดลอกแล้ว!" }, - "copyPrivateKey": { - "message": "นี่คือคีย์ส่วนตัวของคุณ(กดเพื่อคัดลอก)" - }, "copyToClipboard": { "message": "คัดลอกไปคลิปบอร์ด" }, @@ -117,18 +114,12 @@ "editContact": { "message": "แก้ไขผู้ติดต่อ" }, - "enterPassword": { - "message": "ใส่รหัสผ่าน" - }, "etherscanView": { "message": "ดูบัญชีบน Etherscan" }, "expandView": { "message": "ขยายมุมมอง" }, - "exportPrivateKey": { - "message": "ส่งออกคีย์ส่วนตัว" - }, "failed": { "message": "ล้มเหลว" }, @@ -338,9 +329,6 @@ "settings": { "message": "การตั้งค่า" }, - "showPrivateKeys": { - "message": "แสดงคีย์ส่วนตัว" - }, "sigRequest": { "message": "ขอลายเซ็น" }, @@ -392,9 +380,6 @@ "transactionDropped": { "message": "ธุรกรรมถูกยกเลิกเมื่อ $2" }, - "typePassword": { - "message": "พิมพ์รหัสผ่านของคุณ" - }, "unknown": { "message": "ไม่รู้จัก" }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index 6be369b11..477c5cd8c 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "Kopyahin ang address sa clipboard" }, - "copyPrivateKey": { - "message": "Ito ang iyong pribadong key (i-click para kopyahin)" - }, "copyRawTransactionData": { "message": "Kopyahin ang raw na data ng transaksyon" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "Ilagay ang opsyonal na password" }, - "enterPassword": { - "message": "Ilagay ang password" - }, "enterPasswordContinue": { "message": "Ilagay ang password para magpatuloy" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "Galugarin ang MetaMask Snaps" }, - "exportPrivateKey": { - "message": "I-export ang Pribadong Key" - }, "extendWalletWithSnaps": { "message": "Palawakin ang karanasan sa wallet." }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "Ipakita ang private key" }, - "showPrivateKeys": { - "message": "Ipakita ang Mga Pribadong Key" - }, "showTestnetNetworks": { "message": "Ipakita ang mga test networks" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "Hindi magagamit ang mga pag-alam sa transaksyon para sa contract na ito sa oras na ito." }, - "typePassword": { - "message": "Uri ng password ng iyong MetaMask" - }, "typeYourSRP": { "message": "I-type ang iyong Secret Recovery Phrase" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 13c116603..05885305c 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "Adresi panoya kopyala" }, - "copyPrivateKey": { - "message": "Bu sizin özel anahtarınız (kopyalamak için tıklayın)" - }, "copyRawTransactionData": { "message": "Ham işlem verisini kopyala" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "İsteğe bağlı parolayı girin" }, - "enterPassword": { - "message": "Parolanızı girin" - }, "enterPasswordContinue": { "message": "Devam etmek için parola girin" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "MetaMask Snap'lerini keşfedin" }, - "exportPrivateKey": { - "message": "Özel anahtarı dışa aktar" - }, "extendWalletWithSnaps": { "message": "Cüzdan deneyimini genişletin." }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "Özel anahtarı göster" }, - "showPrivateKeys": { - "message": "Özel Anahtarları Göster" - }, "showTestnetNetworks": { "message": "Test ağlarını göster" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "Şu anda işlem içgörüleri bu sözleşme için desteklenmiyor." }, - "typePassword": { - "message": "MetaMask parolanızı girin" - }, "typeYourSRP": { "message": "Gizli Kurtarma İfadenizi girin" }, diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index bba5b27f1..11629f535 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -175,9 +175,6 @@ "copyAddress": { "message": "Копіювати адресу в буфер обміну" }, - "copyPrivateKey": { - "message": "Це ваш закритий ключ (натисніть, щоб скопіювати)" - }, "copyToClipboard": { "message": "Копіювати в буфер" }, @@ -241,9 +238,6 @@ "ensRegistrationError": { "message": "Помилка у реєстрації ENS ім'я" }, - "enterPassword": { - "message": "Введіть пароль" - }, "enterPasswordContinue": { "message": "Введіть пароль, щоб продовжити" }, @@ -256,9 +250,6 @@ "expandView": { "message": "Розгорнути подання" }, - "exportPrivateKey": { - "message": "Експортувати приватний ключ" - }, "failed": { "message": "Помилка" }, @@ -663,9 +654,6 @@ "showHexDataDescription": { "message": "Оберіть це, щоб показати поле для шістнадцятирикових даних на екрані надсилання" }, - "showPrivateKeys": { - "message": "Показати приватні ключі" - }, "sigRequest": { "message": "Запит підпису" }, @@ -786,9 +774,6 @@ "tryAgain": { "message": "Повторити" }, - "typePassword": { - "message": "Введіть ваш пароль MetaMask" - }, "unapproved": { "message": "Не затверджено" }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index dc55f0684..934ec512b 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "Sao chép địa chỉ vào bộ nhớ đệm" }, - "copyPrivateKey": { - "message": "Đây là khóa riêng tư của bạn (hãy nhấn vào để sao chép)" - }, "copyRawTransactionData": { "message": "Sao chép dữ liệu giao dịch thô" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "Nhập mật khẩu tùy chọn" }, - "enterPassword": { - "message": "Nhập mật khẩu" - }, "enterPasswordContinue": { "message": "Nhập mật khẩu để tiếp tục" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "Khám phá MetaMask Snap" }, - "exportPrivateKey": { - "message": "Xuất khóa riêng tư" - }, "extendWalletWithSnaps": { "message": "Mở rộng trải nghiệm sử dụng ví." }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "Hiển thị khóa riêng tư" }, - "showPrivateKeys": { - "message": "Hiện khóa riêng tư" - }, "showTestnetNetworks": { "message": "Hiển thị các mạng thử nghiệm" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "Thông tin chi tiết về giao dịch không được hỗ trợ cho hợp đồng này tại thời điểm này." }, - "typePassword": { - "message": "Nhập mật khẩu MetaMask của bạn" - }, "typeYourSRP": { "message": "Nhập Cụm từ khôi phục bí mật của bạn" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 283e93d96..5a747938d 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -898,9 +898,6 @@ "copyAddress": { "message": "复制地址到剪贴板" }, - "copyPrivateKey": { - "message": "这是您的私钥(点击以复制)" - }, "copyRawTransactionData": { "message": "复制原始交易数据" }, @@ -1482,9 +1479,6 @@ "enterOptionalPassword": { "message": "输入可选密码" }, - "enterPassword": { - "message": "输入密码" - }, "enterPasswordContinue": { "message": "输入密码继续" }, @@ -1561,9 +1555,6 @@ "exploreMetaMaskSnaps": { "message": "探索MetaMask Snap" }, - "exportPrivateKey": { - "message": "导出私钥" - }, "extendWalletWithSnaps": { "message": "扩展钱包体验。" }, @@ -3868,9 +3859,6 @@ "showPrivateKey": { "message": "显示私钥" }, - "showPrivateKeys": { - "message": "显示私钥" - }, "showTestnetNetworks": { "message": "显示测试网络" }, @@ -5130,9 +5118,6 @@ "txInsightsNotSupported": { "message": "此合约目前不支持交易见解。" }, - "typePassword": { - "message": "输入您的 MetaMask 密码" - }, "typeYourSRP": { "message": "输入助记词" }, diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 8a95e870f..5f2625616 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -334,9 +334,6 @@ "copyAddress": { "message": "複製到剪貼簿" }, - "copyPrivateKey": { - "message": "這是您的私鑰(點擊複製)" - }, "copyToClipboard": { "message": "複製到剪貼簿" }, @@ -497,9 +494,6 @@ "enterMaxSpendLimit": { "message": "輸入最大花費限制" }, - "enterPassword": { - "message": "請輸入密碼" - }, "enterPasswordContinue": { "message": "請輸入密碼" }, @@ -547,9 +541,6 @@ "expandView": { "message": "展開畫面" }, - "exportPrivateKey": { - "message": "匯出私鑰" - }, "externalExtension": { "message": "外部擴充功能" }, @@ -1231,9 +1222,6 @@ "showPermissions": { "message": "顯示權限" }, - "showPrivateKeys": { - "message": "顯示私鑰" - }, "sigRequest": { "message": "請求簽署" }, @@ -1440,9 +1428,6 @@ "tryAgain": { "message": "再試一次" }, - "typePassword": { - "message": "請輸入密碼" - }, "unapproved": { "message": "未批准" }, diff --git a/development/ts-migration-dashboard/files-to-convert.json b/development/ts-migration-dashboard/files-to-convert.json index 0ba074760..003db164c 100644 --- a/development/ts-migration-dashboard/files-to-convert.json +++ b/development/ts-migration-dashboard/files-to-convert.json @@ -562,13 +562,6 @@ "ui/components/app/modal/modal-content/modal-content.component.test.js", "ui/components/app/modal/modal.component.js", "ui/components/app/modal/modal.component.test.js", - "ui/components/app/modals/account-details-modal/account-details-modal.component.js", - "ui/components/app/modals/account-details-modal/account-details-modal.container.js", - "ui/components/app/modals/account-details-modal/account-details-modal.test.js", - "ui/components/app/modals/account-details-modal/index.js", - "ui/components/app/modals/account-modal-container/account-modal-container.component.js", - "ui/components/app/modals/account-modal-container/account-modal-container.container.js", - "ui/components/app/modals/account-modal-container/index.js", "ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.js", "ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.test.js", "ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/index.js", @@ -595,10 +588,6 @@ "ui/components/app/modals/edit-approval-permission/edit-approval-permission.component.js", "ui/components/app/modals/edit-approval-permission/edit-approval-permission.container.js", "ui/components/app/modals/edit-approval-permission/index.js", - "ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.js", - "ui/components/app/modals/export-private-key-modal/export-private-key-modal.container.js", - "ui/components/app/modals/export-private-key-modal/export-private-key-modal.stories.js", - "ui/components/app/modals/export-private-key-modal/index.js", "ui/components/app/modals/fade-modal.js", "ui/components/app/modals/hide-token-confirmation-modal/hide-token-confirmation-modal.js", "ui/components/app/modals/hide-token-confirmation-modal/hide-token-confirmation.stories.js", diff --git a/test/e2e/tests/account-details.spec.js b/test/e2e/tests/account-details.spec.js index 728271365..eeee82694 100644 --- a/test/e2e/tests/account-details.spec.js +++ b/test/e2e/tests/account-details.spec.js @@ -1,6 +1,7 @@ const { strict: assert } = require('assert'); -const { convertToHexValue, withFixtures } = require('../helpers'); +const { convertToHexValue, withFixtures, unlockWallet } = require('../helpers'); const FixtureBuilder = require('../fixture-builder'); +const { tEn } = require('../../lib/i18n-helpers'); describe('Show account details', function () { const ganacheOptions = { @@ -14,6 +15,7 @@ describe('Show account details', function () { }; const PASSWORD = 'correct horse battery staple'; + const wrongPassword = 'test test test test'; async function revealPrivateKey(driver, useAccountMenu = true) { if (useAccountMenu) { @@ -27,12 +29,19 @@ describe('Show account details', function () { await driver.clickElement('[data-testid="account-options-menu-button"]'); await driver.clickElement('[data-testid="account-list-menu-details"]'); } - - await driver.clickElement({ css: 'button', text: 'Show private key' }); + await driver.clickElement({ css: 'button', text: tEn('showPrivateKey') }); await driver.fill('#account-details-authenticate', PASSWORD); await driver.press('#account-details-authenticate', driver.Key.ENTER); + await driver.holdMouseDownOnElement( + { + text: tEn('holdToRevealPrivateKey'), + tag: 'span', + }, + 2000, + ); + const keyContainer = await driver.findElement( '[data-testid="account-details-key"]', ); @@ -49,8 +58,7 @@ describe('Show account details', function () { }, async ({ driver }) => { await driver.navigate(); - await driver.fill('#password', PASSWORD); - await driver.press('#password', driver.Key.ENTER); + await unlockWallet(driver); await driver.clickElement('[data-testid="account-menu-icon"]'); await driver.clickElement( @@ -73,8 +81,7 @@ describe('Show account details', function () { }, async ({ driver }) => { await driver.navigate(); - await driver.fill('#password', PASSWORD); - await driver.press('#password', driver.Key.ENTER); + await unlockWallet(driver); const key = await revealPrivateKey(driver); assert.equal( @@ -94,8 +101,7 @@ describe('Show account details', function () { }, async ({ driver }) => { await driver.navigate(); - await driver.fill('#password', PASSWORD); - await driver.press('#password', driver.Key.ENTER); + await unlockWallet(driver); // Create and focus on different account await driver.clickElement('[data-testid="account-menu-icon"]'); @@ -103,7 +109,7 @@ describe('Show account details', function () { '[data-testid="multichain-account-menu-popover-add-account"]', ); await driver.fill('[placeholder="Account 2"]', '2nd account'); - await driver.clickElement({ text: 'Create', tag: 'button' }); + await driver.clickElement({ text: tEn('create'), tag: 'button' }); const key = await revealPrivateKey(driver); assert.equal( @@ -123,8 +129,7 @@ describe('Show account details', function () { }, async ({ driver }) => { await driver.navigate(); - await driver.fill('#password', PASSWORD); - await driver.press('#password', driver.Key.ENTER); + await unlockWallet(driver); const key = await revealPrivateKey(driver, false); assert.equal( @@ -144,8 +149,7 @@ describe('Show account details', function () { }, async ({ driver }) => { await driver.navigate(); - await driver.fill('#password', PASSWORD); - await driver.press('#password', driver.Key.ENTER); + await unlockWallet(driver); // Create and focus on different account await driver.clickElement('[data-testid="account-menu-icon"]'); @@ -153,7 +157,7 @@ describe('Show account details', function () { '[data-testid="multichain-account-menu-popover-add-account"]', ); await driver.fill('[placeholder="Account 2"]', '2nd account'); - await driver.clickElement({ text: 'Create', tag: 'button' }); + await driver.clickElement({ text: tEn('create'), tag: 'button' }); const key = await revealPrivateKey(driver, false); assert.equal( @@ -163,4 +167,40 @@ describe('Show account details', function () { }, ); }); + + it('should not reveal private key when password is incorrect', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder().build(), + title: this.test.title, + failOnConsoleError: false, + }, + async ({ driver }) => { + await driver.navigate(); + await unlockWallet(driver); + + // Attempt to reveal private key from account menu + await driver.clickElement('[data-testid="account-menu-icon"]'); + await driver.clickElement( + '[data-testid="account-list-item-menu-button"]', + ); + await driver.clickElement('[data-testid="account-list-menu-details"]'); + await driver.clickElement({ + css: 'button', + text: tEn('showPrivateKey'), + }); + + // Enter incorrect password + await driver.fill('#account-details-authenticate', wrongPassword); + await driver.press('#account-details-authenticate', driver.Key.ENTER); + + // Display error when password is incorrect + const passwordErrorIsDisplayed = await driver.isElementPresent({ + css: '.mm-help-text', + text: 'Incorrect Password.', + }); + assert.equal(passwordErrorIsDisplayed, true); + }, + ); + }); }); diff --git a/ui/components/app/modals/account-details-modal/account-details-modal.component.js b/ui/components/app/modals/account-details-modal/account-details-modal.component.js deleted file mode 100644 index 1a759713b..000000000 --- a/ui/components/app/modals/account-details-modal/account-details-modal.component.js +++ /dev/null @@ -1,161 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { getAccountLink } from '@metamask/etherscan-link'; - -import AccountModalContainer from '../account-modal-container'; -import QrView from '../../../ui/qr-code'; -import EditableLabel from '../../../ui/editable-label'; -import Button from '../../../ui/button'; -import { - getURLHostName, - isAbleToExportAccount, -} from '../../../../helpers/utils/util'; -///: BEGIN:ONLY_INCLUDE_IN(build-mmi) -import CustodyLabels from '../../../institutional/custody-labels/custody-labels'; -import { toChecksumHexAddress } from '../../../../../shared/modules/hexstring-utils'; -///: END:ONLY_INCLUDE_IN -import { - MetaMetricsEventCategory, - MetaMetricsEventLinkType, - MetaMetricsEventKeyType, - MetaMetricsEventName, -} from '../../../../../shared/constants/metametrics'; -import { NETWORKS_ROUTE } from '../../../../helpers/constants/routes'; - -export default class AccountDetailsModal extends Component { - static propTypes = { - selectedIdentity: PropTypes.object, - chainId: PropTypes.string, - showExportPrivateKeyModal: PropTypes.func, - setAccountLabel: PropTypes.func, - keyrings: PropTypes.array, - rpcPrefs: PropTypes.object, - accounts: PropTypes.array, - history: PropTypes.object, - hideModal: PropTypes.func, - blockExplorerLinkText: PropTypes.object, - ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) - accountType: PropTypes.string, - custodyAccountDetails: PropTypes.object, - ///: END:ONLY_INCLUDE_IN - }; - - static contextTypes = { - t: PropTypes.func, - trackEvent: PropTypes.func, - }; - - render() { - const { - selectedIdentity, - chainId, - showExportPrivateKeyModal, - setAccountLabel, - keyrings, - rpcPrefs, - history, - hideModal, - blockExplorerLinkText, - ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) - accountType, - custodyAccountDetails, - ///: END:ONLY_INCLUDE_IN - } = this.props; - const { name, address } = selectedIdentity; - - const keyring = keyrings.find((kr) => { - return kr.accounts.includes(address); - }); - - let exportPrivateKeyFeatureEnabled = isAbleToExportAccount(keyring?.type); - - ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) - if (keyring?.type?.search('Custody') !== -1) { - exportPrivateKeyFeatureEnabled = false; - } - const showCustodyLabels = accountType === 'custody'; - const custodyLabels = custodyAccountDetails - ? custodyAccountDetails[toChecksumHexAddress(selectedIdentity.address)] - ?.labels - : {}; - ///: END:ONLY_INCLUDE_IN - - const routeToAddBlockExplorerUrl = () => { - hideModal(); - history.push(`${NETWORKS_ROUTE}#blockExplorerUrl`); - }; - - const openBlockExplorer = () => { - const accountLink = getAccountLink(address, chainId, rpcPrefs); - this.context.trackEvent({ - category: MetaMetricsEventCategory.Navigation, - event: MetaMetricsEventName.ExternalLinkClicked, - properties: { - link_type: MetaMetricsEventLinkType.AccountTracker, - location: 'Account Details Modal', - url_domain: getURLHostName(accountLink), - }, - }); - global.platform.openTab({ - url: accountLink, - }); - }; - - return ( - - setAccountLabel(address, label)} - accounts={this.props.accounts} - /> - { - ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) - showCustodyLabels && - ///: END:ONLY_INCLUDE_IN - } - - -
- - - - {exportPrivateKeyFeatureEnabled && ( - - )} - - ); - } -} diff --git a/ui/components/app/modals/account-details-modal/account-details-modal.container.js b/ui/components/app/modals/account-details-modal/account-details-modal.container.js deleted file mode 100644 index 0e10c0860..000000000 --- a/ui/components/app/modals/account-details-modal/account-details-modal.container.js +++ /dev/null @@ -1,54 +0,0 @@ -import { connect } from 'react-redux'; -import { compose } from 'redux'; -import { withRouter } from 'react-router-dom'; -import { - showModal, - setAccountLabel, - hideModal, -} from '../../../../store/actions'; -import { - getSelectedIdentity, - getRpcPrefsForCurrentProvider, - getCurrentChainId, - getMetaMaskAccountsOrdered, - getBlockExplorerLinkText, - ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) - getAccountType, - ///: END:ONLY_INCLUDE_IN -} from '../../../../selectors'; -///: BEGIN:ONLY_INCLUDE_IN(build-mmi) -import { getCustodyAccountDetails } from '../../../../selectors/institutional/selectors'; -///: END:ONLY_INCLUDE_IN -import AccountDetailsModal from './account-details-modal.component'; - -const mapStateToProps = (state) => { - return { - chainId: getCurrentChainId(state), - selectedIdentity: getSelectedIdentity(state), - keyrings: state.metamask.keyrings, - rpcPrefs: getRpcPrefsForCurrentProvider(state), - accounts: getMetaMaskAccountsOrdered(state), - blockExplorerLinkText: getBlockExplorerLinkText(state, true), - ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) - accountType: getAccountType(state), - custodyAccountDetails: getCustodyAccountDetails(state), - ///: END:ONLY_INCLUDE_IN - }; -}; - -const mapDispatchToProps = (dispatch) => { - return { - showExportPrivateKeyModal: () => - dispatch(showModal({ name: 'EXPORT_PRIVATE_KEY' })), - setAccountLabel: (address, label) => - dispatch(setAccountLabel(address, label)), - hideModal: () => { - dispatch(hideModal()); - }, - }; -}; - -export default compose( - withRouter, - connect(mapStateToProps, mapDispatchToProps), -)(AccountDetailsModal); diff --git a/ui/components/app/modals/account-details-modal/account-details-modal.test.js b/ui/components/app/modals/account-details-modal/account-details-modal.test.js deleted file mode 100644 index e238d8637..000000000 --- a/ui/components/app/modals/account-details-modal/account-details-modal.test.js +++ /dev/null @@ -1,241 +0,0 @@ -import React from 'react'; -import configureMockState from 'redux-mock-store'; -import { fireEvent } from '@testing-library/react'; -import thunk from 'redux-thunk'; -import { NetworkType } from '@metamask/controller-utils'; -import { NetworkStatus } from '@metamask/network-controller'; -import { renderWithProvider } from '../../../../../test/lib/render-helpers'; -import mockState from '../../../../../test/data/mock-state.json'; -import { - etherscanViewOn, - exportPrivateKey, -} from '../../../../../app/_locales/en/messages.json'; -import AccountDetailsModal from '.'; - -const mockShowModal = jest.fn(); - -jest.mock('../../../../store/actions.ts', () => { - return { - showModal: () => mockShowModal, - }; -}); - -describe('Account Details Modal', () => { - const mockStore = configureMockState([thunk])(mockState); - - global.platform = { openTab: jest.fn() }; - - it('should set account label when changing default account label', () => { - const { queryByTestId, getByPlaceholderText } = renderWithProvider( - , - mockStore, - ); - - const editButton = queryByTestId('editable-label-button'); - - expect(queryByTestId('editable-input')).not.toBeInTheDocument(); - fireEvent.click(editButton); - expect(queryByTestId('editable-input')).toBeInTheDocument(); - - const editableInput = getByPlaceholderText('Account name'); - const newAccountLabel = 'New Label'; - - fireEvent.change(editableInput, { - target: { value: newAccountLabel }, - }); - - expect(editableInput).toHaveAttribute('value', newAccountLabel); - }); - - it('opens new tab when view block explorer is clicked', () => { - const { queryByText } = renderWithProvider( - , - mockStore, - ); - - const viewOnEtherscan = queryByText(etherscanViewOn.message); - - fireEvent.click(viewOnEtherscan); - - expect(global.platform.openTab).toHaveBeenCalled(); - }); - - it('shows export private key modal when clicked', () => { - const { queryByText } = renderWithProvider( - , - mockStore, - ); - - const exportPrivButton = queryByText(exportPrivateKey.message); - - fireEvent.click(exportPrivButton); - - expect(mockShowModal).toHaveBeenCalled(); - }); - - it('sets blockexplorerview text when block explorer url in rpcPrefs exists', () => { - const blockExplorerUrl = 'https://block.explorer'; - - const customProviderMockState = { - ...mockState, - metamask: { - ...mockState.metamask, - networkConfigurations: { - networkConfigurationId: { - chainId: '0x99', - rpcPrefs: { - blockExplorerUrl, - }, - }, - }, - providerConfig: { - chainId: '0x99', - ticker: 'ETH', - }, - }, - }; - - const customProviderMockStore = configureMockState([thunk])( - customProviderMockState, - ); - - const { queryByText } = renderWithProvider( - , - customProviderMockStore, - ); - - expect(queryByText(/block.explorer/u)).toBeInTheDocument(); - }); - - it('does not display export private key if the keyring is snaps', () => { - const mockStateWithSnapKeyring = { - appState: { - networkDropdownOpen: false, - gasIsLoading: false, - isLoading: false, - modal: { - open: false, - modalState: { - name: null, - props: {}, - }, - previousModalState: { - name: null, - }, - }, - warning: null, - customTokenAmount: '10', - }, - history: { - mostRecentOverviewPage: '/mostRecentOverviewPage', - }, - metamask: { - providerConfig: { - type: 'rpc', - chainId: '0x5', - ticker: 'ETH', - id: 'testNetworkConfigurationId', - }, - keyrings: [ - { - type: 'Snap Keyring', - accounts: [ - '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc', - '0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b', - ], - }, - { - type: 'Ledger Hardware', - accounts: ['0xc42edfcc21ed14dda456aa0756c153f7985d8813'], - }, - { - type: 'Simple Key Pair', - accounts: ['0xeb9e64b93097bc15f01f13eae97015c57ab64823'], - }, - ], - identities: { - '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc': { - address: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc', - name: 'Test Account', - }, - '0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b': { - address: '0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b', - name: 'Test Account 2', - }, - '0xc42edfcc21ed14dda456aa0756c153f7985d8813': { - address: '0xc42edfcc21ed14dda456aa0756c153f7985d8813', - name: 'Test Ledger 1', - }, - '0xeb9e64b93097bc15f01f13eae97015c57ab64823': { - name: 'Test Account 3', - address: '0xeb9e64b93097bc15f01f13eae97015c57ab64823', - }, - }, - networksMetadata: { - selectedNetworkClientId: NetworkType.mainnet, - [NetworkType.mainnet]: { - EIPS: { - 1559: false, - }, - status: NetworkStatus.Available, - }, - }, - frequentRpcListDetail: [], - subjectMetadata: { - 'npm:@metamask/test-snap-bip44': { - name: '@metamask/test-snap-bip44', - version: '1.2.3', - subjectType: 'snap', - }, - }, - notifications: { - test: { - id: 'test', - origin: 'local:http://localhost:8086/', - createdDate: 1652967897732, - readDate: null, - message: 'Hello, http://localhost:8086!', - }, - test2: { - id: 'test2', - origin: 'local:http://localhost:8086/', - createdDate: 1652967897732, - readDate: 1652967897732, - message: 'Hello, http://localhost:8086!', - }, - }, - cachedBalances: {}, - selectedAddress: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc', - accounts: { - '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc': { - balance: '0x346ba7725f412cbfdb', - address: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc', - }, - '0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b': { - address: '0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b', - balance: '0x0', - }, - '0xc42edfcc21ed14dda456aa0756c153f7985d8813': { - address: '0xc42edfcc21ed14dda456aa0756c153f7985d8813', - balance: '0x0', - }, - '0xeb9e64b93097bc15f01f13eae97015c57ab64823': { - address: '0xeb9e64b93097bc15f01f13eae97015c57ab64823', - balance: '0x0', - }, - }, - }, - }; - const mockStoreWithSnapKeyring = configureMockState([thunk])( - mockStateWithSnapKeyring, - ); - const { queryByText } = renderWithProvider( - , - mockStoreWithSnapKeyring, - ); - - const exportPrivateKeyButton = queryByText(exportPrivateKey.message); - - expect(exportPrivateKeyButton).not.toBeInTheDocument(); - }); -}); diff --git a/ui/components/app/modals/account-details-modal/index.js b/ui/components/app/modals/account-details-modal/index.js deleted file mode 100644 index ccbfa1d1d..000000000 --- a/ui/components/app/modals/account-details-modal/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './account-details-modal.container'; diff --git a/ui/components/app/modals/account-details-modal/index.scss b/ui/components/app/modals/account-details-modal/index.scss deleted file mode 100644 index 03e577354..000000000 --- a/ui/components/app/modals/account-details-modal/index.scss +++ /dev/null @@ -1,30 +0,0 @@ -.account-details-modal { - &__name { - @include H4; - - margin-top: 9px; - } - - & &__button { - margin-top: 17px; - padding: 10px 22px; - width: 284px; - } - - &__divider { - width: 100%; - height: 1px; - margin: 16px 0 8px 0; - background-color: var(--color-border-muted); - } - - & .qr-header { - @include H4; - - margin-top: 9px; - } - - & .qr-wrapper { - margin-top: 5px; - } -} diff --git a/ui/components/app/modals/account-modal-container/account-modal-container.component.js b/ui/components/app/modals/account-modal-container/account-modal-container.component.js deleted file mode 100644 index db93a2dc5..000000000 --- a/ui/components/app/modals/account-modal-container/account-modal-container.component.js +++ /dev/null @@ -1,57 +0,0 @@ -import PropTypes from 'prop-types'; -import React from 'react'; -import classnames from 'classnames'; -import Identicon from '../../../ui/identicon'; - -export default function AccountModalContainer(props, context) { - const { - className, - selectedIdentity, - showBackButton, - backButtonAction, - hideModal, - children, - } = props; - - return ( -
-
-
- -
- {showBackButton && ( -
- - - {context.t('back')} - -
- )} -
-
- ); -} - -AccountModalContainer.contextTypes = { - t: PropTypes.func, -}; - -AccountModalContainer.defaultProps = { - showBackButton: false, - children: null, - backButtonAction: undefined, -}; - -AccountModalContainer.propTypes = { - className: PropTypes.string, - selectedIdentity: PropTypes.object.isRequired, - showBackButton: PropTypes.bool, - backButtonAction: PropTypes.func, - hideModal: PropTypes.func.isRequired, - children: PropTypes.node, -}; diff --git a/ui/components/app/modals/account-modal-container/account-modal-container.container.js b/ui/components/app/modals/account-modal-container/account-modal-container.container.js deleted file mode 100644 index 0fb64bf1f..000000000 --- a/ui/components/app/modals/account-modal-container/account-modal-container.container.js +++ /dev/null @@ -1,23 +0,0 @@ -import { connect } from 'react-redux'; -import { hideModal } from '../../../../store/actions'; -import { getSelectedIdentity } from '../../../../selectors'; -import AccountModalContainer from './account-modal-container.component'; - -function mapStateToProps(state, ownProps) { - return { - selectedIdentity: ownProps.selectedIdentity || getSelectedIdentity(state), - }; -} - -function mapDispatchToProps(dispatch) { - return { - hideModal: () => { - dispatch(hideModal()); - }, - }; -} - -export default connect( - mapStateToProps, - mapDispatchToProps, -)(AccountModalContainer); diff --git a/ui/components/app/modals/account-modal-container/index.js b/ui/components/app/modals/account-modal-container/index.js deleted file mode 100644 index b79fcc79f..000000000 --- a/ui/components/app/modals/account-modal-container/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './account-modal-container.container'; diff --git a/ui/components/app/modals/account-modal-container/index.scss b/ui/components/app/modals/account-modal-container/index.scss deleted file mode 100644 index 9e621e7d2..000000000 --- a/ui/components/app/modals/account-modal-container/index.scss +++ /dev/null @@ -1,53 +0,0 @@ -// Account Modal Container -.account-modal { - &__container { - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: center; - position: relative; - padding: 5px 0 31px 0; - border: 1px solid var(--color-border-default); - border-radius: 4px; - } - - &__back { - color: var(--color-icon-default); - position: absolute; - top: 13px; - left: 17px; - cursor: pointer; - display: flex; - align-items: center; - } - - &__back-text { - @include H6; - - padding-left: 3px; - } - - &__close { - @include H1; - - background-color: transparent; - color: var(--color-text-default); - position: absolute; - cursor: pointer; - top: -10px; - right: 12px; - - &::after { - content: '\00D7'; - } - } - - & .identicon { - position: relative; - left: 0; - right: 0; - margin: 0 auto; - top: -32px; - margin-bottom: -32px; - } -} diff --git a/ui/components/app/modals/export-private-key-modal/__snapshots__/export-private-key-modal.test.js.snap b/ui/components/app/modals/export-private-key-modal/__snapshots__/export-private-key-modal.test.js.snap deleted file mode 100644 index 81a320534..000000000 --- a/ui/components/app/modals/export-private-key-modal/__snapshots__/export-private-key-modal.test.js.snap +++ /dev/null @@ -1,139 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Export PrivateKey Modal should match snapshot 1`] = ` -
- -
-
-`; diff --git a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.js b/ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.js deleted file mode 100644 index 3fd86ef99..000000000 --- a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.js +++ /dev/null @@ -1,247 +0,0 @@ -import log from 'loglevel'; -import React, { useContext, useEffect, useState } from 'react'; -import PropTypes from 'prop-types'; -import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'; -import Box from '../../../ui/box'; -import { - BUTTON_SIZES, - BUTTON_VARIANT, - BannerAlert, - Button, - Text, -} from '../../../component-library'; - -import AccountModalContainer from '../account-modal-container'; -import { toChecksumHexAddress } from '../../../../../shared/modules/hexstring-utils'; -import { - MetaMetricsEventCategory, - MetaMetricsEventKeyType, - MetaMetricsEventName, -} from '../../../../../shared/constants/metametrics'; -import HoldToRevealModal from '../hold-to-reveal-modal/hold-to-reveal-modal'; -import { MetaMetricsContext } from '../../../../contexts/metametrics'; -import { useI18nContext } from '../../../../hooks/useI18nContext'; -import { - BLOCK_SIZES, - BorderColor, - BorderStyle, - Color, - DISPLAY, - FLEX_DIRECTION, - FONT_WEIGHT, - JustifyContent, - TextVariant, -} from '../../../../helpers/constants/design-system'; -import PrivateKeyDisplay from './private-key'; -import PasswordInput from './password-input'; - -const ExportPrivateKeyModal = ({ - clearAccountDetails, - hideWarning, - exportAccount, - selectedIdentity, - showAccountDetailModal, - hideModal, - warning = null, - previousModalState, -}) => { - const [password, setPassword] = useState(''); - const [privateKey, setPrivateKey] = useState(null); - const [showWarning, setShowWarning] = useState(true); - const [showHoldToReveal, setShowHoldToReveal] = useState(false); - const trackEvent = useContext(MetaMetricsContext); - const t = useI18nContext(); - - useEffect(() => { - return () => { - clearAccountDetails(); - hideWarning(); - }; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - const exportAccountAndGetPrivateKey = async (passwordInput, address) => { - try { - const privateKeyRetrieved = await exportAccount(passwordInput, address); - trackEvent( - { - category: MetaMetricsEventCategory.Keys, - event: MetaMetricsEventName.KeyExportRevealed, - properties: { - key_type: MetaMetricsEventKeyType.Pkey, - }, - }, - {}, - ); - setPrivateKey(privateKeyRetrieved); - setShowWarning(false); - setShowHoldToReveal(true); - } catch (e) { - trackEvent( - { - category: MetaMetricsEventCategory.Keys, - event: MetaMetricsEventName.KeyExportFailed, - properties: { - key_type: MetaMetricsEventKeyType.Pkey, - reason: 'incorrect_password', - }, - }, - {}, - ); - - log.error(e); - } - }; - - const { name, address } = selectedIdentity; - - if (showHoldToReveal) { - return ( - showAccountDetailModal()} - > - setShowHoldToReveal(false)} - willHide={false} - holdToRevealType="PrivateKey" - /> - - ); - } - - return ( - showAccountDetailModal()} - > - - {name} - - - {toChecksumHexAddress(address)} - - - - {t('showPrivateKeys')} - - {privateKey ? ( - - ) : ( - - )} - {showWarning && ( - - {warning} - - )} - - {t('privateKeyWarning')} - - - {!privateKey && ( - - )} - {privateKey ? ( - - ) : ( - - )} - - - ); -}; - -ExportPrivateKeyModal.propTypes = { - exportAccount: PropTypes.func.isRequired, - selectedIdentity: PropTypes.object.isRequired, - warning: PropTypes.node, - showAccountDetailModal: PropTypes.func.isRequired, - hideModal: PropTypes.func.isRequired, - hideWarning: PropTypes.func.isRequired, - clearAccountDetails: PropTypes.func.isRequired, - previousModalState: PropTypes.string, -}; - -export default withModalProps(ExportPrivateKeyModal); diff --git a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.test.js b/ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.test.js deleted file mode 100644 index c435d85ce..000000000 --- a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.test.js +++ /dev/null @@ -1,130 +0,0 @@ -import { fireEvent, waitFor } from '@testing-library/react'; -import configureMockStore from 'redux-mock-store'; -import React from 'react'; -import thunk from 'redux-thunk'; -import { renderWithProvider } from '../../../../../test/lib/render-helpers'; -import ExportPrivateKeyModal from '.'; - -const mockAddress = '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc'; -const mockPrivateKey = 'mock private key'; -const mockExportAccount = jest.fn().mockResolvedValue(mockPrivateKey); -const mockClearAccountDetail = jest.fn(); -const mockHideWarning = jest.fn(); - -jest.mock('../../../../store/actions', () => ({ - exportAccount: () => mockExportAccount, - clearAccountDetails: () => mockClearAccountDetail, - hideWarning: () => mockHideWarning, -})); - -describe('Export Private Key Modal', () => { - const state = { - metamask: { - selectedAddress: mockAddress, - identities: { - '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc': { - address: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc', - name: 'Test Account', - }, - }, - providerConfig: { - type: 'rpc', - chainId: '0x5', - ticker: 'ETH', - id: 'testNetworkConfigurationId', - }, - }, - appState: { - warning: null, - previousModalState: { - name: null, - }, - isLoading: false, - accountDetail: { - privateKey: null, - }, - modal: { - modalState: {}, - previousModalState: { - name: null, - }, - }, - }, - }; - const mockStore = configureMockStore([thunk])(state); - - it('renders export private key modal', () => { - const { queryByText } = renderWithProvider( - , - mockStore, - ); - - const title = queryByText('Show Private Keys'); - expect(title).toBeInTheDocument(); - - const warning = queryByText( - 'Warning: Never disclose this key. Anyone with your private keys can steal any assets held in your account.', - ); - expect(warning).toBeInTheDocument(); - expect(queryByText(mockPrivateKey)).not.toBeInTheDocument(); - }); - - it('renders hold to reveal after entering password', async () => { - const { queryByText, getByPlaceholderText } = renderWithProvider( - , - mockStore, - ); - - const nextButton = queryByText('Confirm'); - expect(nextButton).toBeInTheDocument(); - - const input = getByPlaceholderText('Enter password'); - - fireEvent.change(input, { - target: { value: 'password' }, - }); - - fireEvent.click(nextButton); - - await waitFor(() => { - expect(mockExportAccount).toHaveBeenCalled(); - expect(queryByText('Keep your private key safe')).toBeInTheDocument(); - }); - }); - - it('provides password after passing hold to reveal', async () => { - const { queryByText, getByLabelText, getByText, getByPlaceholderText } = - renderWithProvider(, mockStore); - - const nextButton = queryByText('Confirm'); - expect(nextButton).toBeInTheDocument(); - - const input = getByPlaceholderText('Enter password'); - fireEvent.change(input, { - target: { value: 'password' }, - }); - - fireEvent.click(nextButton); - - await waitFor(() => { - expect(mockExportAccount).toHaveBeenCalled(); - expect(queryByText('Keep your private key safe')).toBeInTheDocument(); - }); - - const holdButton = getByText('Hold to reveal Private Key'); - expect(holdButton).toBeInTheDocument(); - - fireEvent.pointerDown(holdButton); - - const circle = getByLabelText('hold to reveal circle locked'); - fireEvent.transitionEnd(circle); - const circleUnlocked = getByLabelText('hold to reveal circle unlocked'); - fireEvent.animationEnd(circleUnlocked); - - await waitFor(() => { - expect(queryByText('Show Private Keys')).toBeInTheDocument(); - expect(queryByText('Done')).toBeInTheDocument(); - expect(queryByText(mockPrivateKey)).toBeInTheDocument(); - }); - }); -}); diff --git a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.container.js b/ui/components/app/modals/export-private-key-modal/export-private-key-modal.container.js deleted file mode 100644 index 6dd8acd92..000000000 --- a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.container.js +++ /dev/null @@ -1,48 +0,0 @@ -import { connect } from 'react-redux'; -import { - exportAccount, - hideWarning, - showModal, - hideModal, - clearAccountDetails, -} from '../../../../store/actions'; -import { getSelectedIdentity } from '../../../../selectors'; -import ExportPrivateKeyModal from './export-private-key-modal.component'; - -function mapStateToPropsFactory() { - let selectedIdentity = null; - return function mapStateToProps(state) { - // We should **not** change the identity displayed here even if it changes from underneath us. - // If we do, we will be showing the user one private key and a **different** address and name. - // Note that the selected identity **will** change from underneath us when we unlock the keyring - // which is the expected behavior that we are side-stepping. - selectedIdentity = selectedIdentity || getSelectedIdentity(state); - return { - warning: state.appState.warning, - privateKey: state.appState.accountDetail.privateKey, - selectedIdentity, - previousModalState: state.appState.modal.previousModalState.name, - }; - }; -} - -function mapDispatchToProps(dispatch) { - return { - exportAccount: (password, address) => { - return dispatch(exportAccount(password, address)).then((res) => { - dispatch(hideWarning()); - return res; - }); - }, - showAccountDetailModal: () => - dispatch(showModal({ name: 'ACCOUNT_DETAILS' })), - hideModal: () => dispatch(hideModal()), - hideWarning: () => dispatch(hideWarning()), - clearAccountDetails: () => dispatch(clearAccountDetails()), - }; -} - -export default connect( - mapStateToPropsFactory, - mapDispatchToProps, -)(ExportPrivateKeyModal); diff --git a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.stories.js b/ui/components/app/modals/export-private-key-modal/export-private-key-modal.stories.js deleted file mode 100644 index 36ba01b89..000000000 --- a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.stories.js +++ /dev/null @@ -1,32 +0,0 @@ -import React from 'react'; -import { Provider } from 'react-redux'; -import testData from '../../../../../.storybook/test-data'; -import configureStore from '../../../../store/store'; -import ExportPrivateKeyModal from './export-private-key-modal.component'; - -// Using Test Data For Redux -const store = configureStore(testData); - -export default { - title: 'Components/App/Modals/ExportPrivateKeyModal', - decorators: [(story) => {story()}], - argsTypes: { - exportAccount: { action: 'exportAccount' }, - }, -}; - -export const DefaultStory = () => { - return ( - { - return 'mockPrivateKey'; - }} - selectedIdentity={ - testData.metamask.identities[testData.metamask.selectedAddress] - } - /> - ); -}; - -DefaultStory.storyName = 'Default'; diff --git a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.test.js b/ui/components/app/modals/export-private-key-modal/export-private-key-modal.test.js deleted file mode 100644 index 873be62b6..000000000 --- a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.test.js +++ /dev/null @@ -1,82 +0,0 @@ -import React from 'react'; -import { fireEvent } from '@testing-library/react'; -import configureMockStore from 'redux-mock-store'; -import thunk from 'redux-thunk'; -import { renderWithProvider } from '../../../../../test/lib/render-helpers'; -import mockState from '../../../../../test/data/mock-state.json'; -import * as actions from '../../../../store/actions'; -import ExportPrivateKeyModal from '.'; - -jest.mock('../../../../store/actions.ts', () => ({ - ...jest.requireActual('../../../../store/actions.ts'), - exportAccount: jest.fn().mockReturnValue(jest.fn().mockResolvedValueOnce()), - hideWarning: () => jest.fn(), - showModal: () => jest.fn(), - hideModal: () => jest.fn(), - clearAccountDetails: () => jest.fn(), -})); - -describe('Export PrivateKey Modal', () => { - const password = 'a-password'; - - const privKeyModalState = { - ...mockState, - appState: { - ...mockState.appState, - accountDetail: { - privateKey: '0xPrivKey', - }, - }, - }; - const mockStore = configureMockStore([thunk])(privKeyModalState); - - afterEach(() => { - jest.clearAllMocks(); - }); - - it('should match snapshot', () => { - const { container } = renderWithProvider( - , - mockStore, - ); - expect(container).toMatchSnapshot(); - }); - - it('should disable confirm button by default', () => { - const { queryByText } = renderWithProvider( - , - mockStore, - ); - - const confirmButton = queryByText('Confirm'); - - expect(confirmButton).toBeDisabled(); - }); - - it('should call export account with password and selected address', () => { - const { queryByTestId, queryByText } = renderWithProvider( - , - mockStore, - ); - - const passwordInput = - queryByTestId('password-input').querySelector('input'); - - const passwordInputEvent = { - target: { - value: password, - }, - }; - - fireEvent.change(passwordInput, passwordInputEvent); - - const confirmButton = queryByText('Confirm'); - - fireEvent.click(confirmButton); - - expect(actions.exportAccount).toHaveBeenCalledWith( - password, - mockState.metamask.selectedAddress, - ); - }); -}); diff --git a/ui/components/app/modals/export-private-key-modal/index.js b/ui/components/app/modals/export-private-key-modal/index.js deleted file mode 100644 index ffba2f7e8..000000000 --- a/ui/components/app/modals/export-private-key-modal/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './export-private-key-modal.container'; diff --git a/ui/components/app/modals/export-private-key-modal/index.scss b/ui/components/app/modals/export-private-key-modal/index.scss deleted file mode 100644 index 8edde5e39..000000000 --- a/ui/components/app/modals/export-private-key-modal/index.scss +++ /dev/null @@ -1,27 +0,0 @@ -.export-private-key-modal { - &__divider { - width: 100%; - height: 1px; - margin: 19px 0 8px 0; - background-color: var(--color-border-default); - } - - &__password::-webkit-input-placeholder { - color: var(--color-text-muted); - } - - &__private-key-display { - height: 80px; - width: 291px; - overflow: hidden; - overflow-wrap: break-word; - } - - .ellip-address-wrapper { - max-width: 286px; - direction: ltr; - overflow: hidden; - text-overflow: ellipsis; - } -} - diff --git a/ui/components/app/modals/export-private-key-modal/password-input.js b/ui/components/app/modals/export-private-key-modal/password-input.js deleted file mode 100644 index 4892055bd..000000000 --- a/ui/components/app/modals/export-private-key-modal/password-input.js +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { - BLOCK_SIZES, - FLEX_DIRECTION, - DISPLAY, - AlignItems, - Color, - TextVariant, -} from '../../../../helpers/constants/design-system'; -import Box from '../../../ui/box'; -import { useI18nContext } from '../../../../hooks/useI18nContext'; -import { Label, TEXT_FIELD_TYPES, TextField } from '../../../component-library'; - -const PasswordInput = ({ setPassword }) => { - const t = useI18nContext(); - - return ( - - - setPassword(event.target.value)} - data-testid="password-input" - /> - - ); -}; - -PasswordInput.propTypes = { - setPassword: PropTypes.func.isRequired, -}; - -export default PasswordInput; diff --git a/ui/components/app/modals/export-private-key-modal/private-key.js b/ui/components/app/modals/export-private-key-modal/private-key.js deleted file mode 100644 index c2200ed47..000000000 --- a/ui/components/app/modals/export-private-key-modal/private-key.js +++ /dev/null @@ -1,81 +0,0 @@ -import copyToClipboard from 'copy-to-clipboard'; -import { stripHexPrefix } from 'ethereumjs-util'; -import React, { useContext } from 'react'; -import PropTypes from 'prop-types'; -import Box from '../../../ui/box'; -import { useI18nContext } from '../../../../hooks/useI18nContext'; -import { - MetaMetricsEventCategory, - MetaMetricsEventName, - MetaMetricsEventKeyType, -} from '../../../../../shared/constants/metametrics'; -import { MetaMetricsContext } from '../../../../contexts/metametrics'; -import { - BLOCK_SIZES, - BorderStyle, - BorderColor, - BorderRadius, - AlignItems, - DISPLAY, - Color, - FLEX_DIRECTION, - TextVariant, -} from '../../../../helpers/constants/design-system'; -import { Label } from '../../../component-library'; - -const PrivateKeyDisplay = ({ privateKey }) => { - const trackEvent = useContext(MetaMetricsContext); - const t = useI18nContext(); - const plainKey = stripHexPrefix(privateKey); - - return ( - - - { - copyToClipboard(plainKey); - trackEvent( - { - category: MetaMetricsEventCategory.Keys, - event: MetaMetricsEventName.KeyExportCopied, - properties: { - key_type: MetaMetricsEventKeyType.Pkey, - copy_method: 'clipboard', - }, - }, - {}, - ); - }} - > - {plainKey} - - - ); -}; - -PrivateKeyDisplay.propTypes = { - privateKey: PropTypes.string.isRequired, -}; - -export default PrivateKeyDisplay; diff --git a/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.js b/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.js deleted file mode 100644 index 83e479ec4..000000000 --- a/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.js +++ /dev/null @@ -1,204 +0,0 @@ -import PropTypes from 'prop-types'; -import React, { useContext } from 'react'; -import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'; -import Box from '../../../ui/box'; -import { - Button, - BUTTON_SIZES, - BUTTON_VARIANT, - ButtonIcon, - IconName, - Text, -} from '../../../component-library'; -import { - AlignItems, - Display, - FlexDirection, - JustifyContent, - Size, - TextVariant, -} from '../../../../helpers/constants/design-system'; -import HoldToRevealButton from '../../hold-to-reveal-button'; -import { useI18nContext } from '../../../../hooks/useI18nContext'; -import ZENDESK_URLS from '../../../../helpers/constants/zendesk-url'; -import { MetaMetricsContext } from '../../../../contexts/metametrics'; -import { - MetaMetricsEventCategory, - MetaMetricsEventKeyType, - MetaMetricsEventName, -} from '../../../../../shared/constants/metametrics'; - -const HoldToRevealModal = ({ - onLongPressed, - hideModal, - willHide = true, - holdToRevealType = 'SRP', -}) => { - const t = useI18nContext(); - const holdToRevealTitle = - holdToRevealType === 'SRP' - ? 'holdToRevealSRPTitle' - : 'holdToRevealPrivateKeyTitle'; - - const holdToRevealButton = - holdToRevealType === 'SRP' ? 'holdToRevealSRP' : 'holdToRevealPrivateKey'; - const trackEvent = useContext(MetaMetricsContext); - - const unlock = () => { - onLongPressed(); - if (willHide) { - hideModal(); - } - }; - - const handleCancel = () => { - hideModal(); - }; - - const renderHoldToRevealPrivateKeyContent = () => { - return ( - - - {t('holdToRevealContentPrivateKey1', [ - - {t('holdToRevealContentPrivateKey2')} - , - ])} - - - {t('holdToRevealContent3', [ - - {t('holdToRevealContent4')} - , - , - ])} - - - ); - }; - - const renderHoldToRevealSRPContent = () => { - return ( - - - {t('holdToRevealContent1', [ - - {t('holdToRevealContent2')} - , - ])} - - - {t('holdToRevealContent3', [ - - {t('holdToRevealContent4')} - , - , - ])} - - - ); - }; - - return ( - - - {t(holdToRevealTitle)} - {willHide && ( - { - trackEvent({ - category: MetaMetricsEventCategory.Keys, - event: MetaMetricsEventName.SrpHoldToRevealCloseClicked, - properties: { - key_type: MetaMetricsEventKeyType.Srp, - }, - }); - handleCancel(); - }} - ariaLabel={t('close')} - /> - )} - - {holdToRevealType === 'SRP' - ? renderHoldToRevealSRPContent() - : renderHoldToRevealPrivateKeyContent()} - - - ); -}; - -HoldToRevealModal.propTypes = { - // The function to be executed after the hold to reveal long press has been completed - onLongPressed: PropTypes.func.isRequired, - hideModal: PropTypes.func, - willHide: PropTypes.bool, - holdToRevealType: PropTypes.oneOf(['SRP', 'PrivateKey']).isRequired, -}; - -export default withModalProps(HoldToRevealModal); diff --git a/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.stories.js b/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.stories.js deleted file mode 100644 index eba93c3f3..000000000 --- a/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.stories.js +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import HoldToRevealModal from './hold-to-reveal-modal'; - -export default { - title: 'Components/App/Modals/HoldToRevealModal', - component: HoldToRevealModal, -}; - -const Template = (args) => ; - -export const DefaultStory = Template.bind({}); - -DefaultStory.storyName = 'Default'; diff --git a/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.stories.tsx b/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.stories.tsx new file mode 100644 index 000000000..805ae3ed6 --- /dev/null +++ b/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.stories.tsx @@ -0,0 +1,35 @@ +import { useArgs } from '@storybook/client-api'; +import { Meta, StoryFn } from '@storybook/react'; +import React from 'react'; +import { Button } from '../../../component-library'; +import HoldToRevealModal from './hold-to-reveal-modal'; + +export default { + title: 'Components/App/HoldToRevealModal', + component: HoldToRevealModal, + argTypes: { + isShowingModal: { + control: 'boolean', + }, + }, +} as Meta; + +export const DefaultStory: StoryFn = () => { + const [{ isShowingModal }, updateArgs] = useArgs(); + + return ( + <> + + {isShowingModal && ( + updateArgs({ isShowingModal: false })} + /> + )} + + ); +}; + +DefaultStory.storyName = 'Default'; diff --git a/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.test.js b/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.test.js index 8a8ecc71a..612b972ef 100644 --- a/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.test.js +++ b/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.test.js @@ -1,9 +1,7 @@ +import { fireEvent, waitFor } from '@testing-library/react'; import React from 'react'; import configureMockState from 'redux-mock-store'; -import { fireEvent, waitFor } from '@testing-library/react'; import thunk from 'redux-thunk'; -import { renderWithProvider } from '../../../../../test/lib/render-helpers'; -import mockState from '../../../../../test/data/mock-state.json'; import { holdToRevealContent1, holdToRevealContent2, @@ -12,32 +10,37 @@ import { holdToRevealContent5, holdToRevealSRPTitle, } from '../../../../../app/_locales/en/messages.json'; -import { - MetaMetricsEventCategory, - MetaMetricsEventKeyType, - MetaMetricsEventName, -} from '../../../../../shared/constants/metametrics'; +import mockState from '../../../../../test/data/mock-state.json'; +import { renderWithProvider } from '../../../../../test/lib/render-helpers'; import { MetaMetricsContext } from '../../../../contexts/metametrics'; import HoldToRevealModal from '.'; describe('Hold to Reveal Modal', () => { const mockStore = configureMockState([thunk])(mockState); + const onCloseStub = jest.fn(); const onLongPressStub = jest.fn(); - const hideModalStub = jest.fn(); + const mockTrackEvent = jest.fn(); afterEach(() => { jest.resetAllMocks(); }); - it('should render the srp warning text and button', () => { - const { getByText } = renderWithProvider( - , + function render(holdToRevealType = 'SRP') { + return renderWithProvider( + + + , mockStore, ); + } + + it('should render the srp warning text and button', () => { + const { getByText } = render(); const holdButton = getByText('Hold to reveal SRP'); expect(holdButton).toBeInTheDocument(); @@ -73,13 +76,7 @@ describe('Hold to Reveal Modal', () => { }); it('should should execute onLongPressed after long press', async () => { - const { getByText, queryByLabelText } = renderWithProvider( - , - mockStore, - ); + const { getByText, queryByLabelText } = render(); const holdButton = getByText('Hold to reveal SRP'); const circleLocked = queryByLabelText('hold to reveal circle locked'); @@ -99,13 +96,7 @@ describe('Hold to Reveal Modal', () => { }); it('should remain open if long pressed was not complete', async () => { - const { getByText, queryByLabelText } = renderWithProvider( - , - mockStore, - ); + const { getByText, queryByLabelText } = render(); const holdButton = getByText('Hold to reveal SRP'); @@ -118,64 +109,14 @@ describe('Hold to Reveal Modal', () => { expect(circleLocked).toBeInTheDocument(); expect(circleUnlocked).not.toBeInTheDocument(); expect(onLongPressStub).not.toHaveBeenCalled(); - expect(hideModalStub).not.toHaveBeenCalled(); + expect(onCloseStub).not.toHaveBeenCalled(); }); }); - it('should fire event when closing', async () => { - const mockTrackEvent = jest.fn(); + it('should render in Private Key mode', async () => { + const { getByText } = render('PrivateKey'); - const { queryByLabelText } = renderWithProvider( - - - , - , - mockStore, - ); - - const closeButton = queryByLabelText('Close'); - - fireEvent.click(closeButton); - - await waitFor(() => { - expect(mockTrackEvent).toHaveBeenCalledWith({ - category: MetaMetricsEventCategory.Keys, - event: MetaMetricsEventName.SrpHoldToRevealCloseClicked, - properties: { - key_type: MetaMetricsEventKeyType.Srp, - }, - }); - }); - }); - - it('should not hide modal after completing long press if set to false', async () => { - const { getByText, queryByLabelText } = renderWithProvider( - , - mockStore, - ); - - const holdButton = getByText('Hold to reveal SRP'); - const circleLocked = queryByLabelText('hold to reveal circle locked'); - - fireEvent.pointerDown(holdButton); - fireEvent.transitionEnd(circleLocked); - - const circleUnlocked = queryByLabelText('hold to reveal circle unlocked'); - fireEvent.animationEnd(circleUnlocked); - - await waitFor(() => { - expect(holdButton.firstChild).toHaveClass( - 'hold-to-reveal-button__icon-container', - ); - expect(onLongPressStub).toHaveBeenCalled(); - expect(hideModalStub).not.toHaveBeenCalled(); - }); + const holdButton = getByText('Hold to reveal Private Key'); + expect(holdButton).toBeInTheDocument(); }); }); diff --git a/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.tsx b/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.tsx new file mode 100644 index 000000000..3feb34f4c --- /dev/null +++ b/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.tsx @@ -0,0 +1,120 @@ +import React from 'react'; +import { + Display, + FlexDirection, + TextVariant, +} from '../../../../helpers/constants/design-system'; +import ZENDESK_URLS from '../../../../helpers/constants/zendesk-url'; +import { useI18nContext } from '../../../../hooks/useI18nContext'; +import { + BUTTON_SIZES, + BUTTON_VARIANT, + Box, + Button, + Modal, + ModalContent, + ModalHeader, + ModalOverlay, + Text, +} from '../../../component-library'; +import HoldToRevealButton from '../../hold-to-reveal-button'; + +type HoldToRevealModalProps = { + isOpen: boolean; + onClose: () => void; + onLongPressed: () => void; + holdToRevealType: 'SRP' | 'PrivateKey'; +}; + +export default function HoldToRevealModal({ + isOpen, + onClose, + onLongPressed, + holdToRevealType, +}: HoldToRevealModalProps) { + const t = useI18nContext(); + const holdToRevealTitle = + holdToRevealType === 'SRP' + ? 'holdToRevealSRPTitle' + : 'holdToRevealPrivateKeyTitle'; + + const holdToRevealButton = + holdToRevealType === 'SRP' ? 'holdToRevealSRP' : 'holdToRevealPrivateKey'; + + const holdToRevealContent = + holdToRevealType === 'SRP' + ? 'holdToRevealContent' + : 'holdToRevealContentPrivateKey'; + + // If this is done inline, verify-locales will output `Forbidden use of template strings in 't' function` + const holdToRevealContent1 = `${holdToRevealContent}1`; + const holdToRevealContent2 = `${holdToRevealContent}2`; + + // This is here to stop yarn verify-locales from removing these strings + t('holdToRevealContentPrivateKey1'); + t('holdToRevealContentPrivateKey2'); + t('holdToRevealContent1'); + t('holdToRevealContent2'); + + const MainContent = () => { + return ( + + + {t(holdToRevealContent1, [ + + {t(holdToRevealContent2)} + , + ])} + + + {t('holdToRevealContent3', [ + + {t('holdToRevealContent4')} + , + , + ])} + + + ); + }; + + return ( + + + + {t(holdToRevealTitle)} + + + + + + + ); +} diff --git a/ui/components/app/modals/hold-to-reveal-modal/index.scss b/ui/components/app/modals/hold-to-reveal-modal/index.scss deleted file mode 100644 index 207c84efd..000000000 --- a/ui/components/app/modals/hold-to-reveal-modal/index.scss +++ /dev/null @@ -1,8 +0,0 @@ -.hold-to-reveal-modal { - position: relative; - - &__close { - position: absolute; - right: 16px; - } -} diff --git a/ui/components/app/modals/hold-to-reveal-modal/index.js b/ui/components/app/modals/hold-to-reveal-modal/index.ts similarity index 100% rename from ui/components/app/modals/hold-to-reveal-modal/index.js rename to ui/components/app/modals/hold-to-reveal-modal/index.ts diff --git a/ui/components/app/modals/index.scss b/ui/components/app/modals/index.scss index c457f3c2a..56080a4fe 100644 --- a/ui/components/app/modals/index.scss +++ b/ui/components/app/modals/index.scss @@ -1,9 +1,6 @@ -@import 'account-details-modal/index'; -@import 'account-modal-container/index'; @import 'cancel-transaction/index'; @import 'confirm-remove-account/index'; @import 'edit-approval-permission/index'; -@import 'export-private-key-modal/index'; @import 'hide-token-confirmation-modal/index'; @import 'new-account-modal/index'; @import 'qr-scanner/index'; @@ -11,7 +8,6 @@ @import 'customize-nonce/index'; @import 'convert-token-to-nft-modal/index'; @import 'contract-details-modal/index'; -@import 'hold-to-reveal-modal/index'; ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) @import '../../institutional/confirm-remove-jwt-modal/index'; @import '../../institutional/custody-confirm-link-modal/index'; diff --git a/ui/components/app/modals/modal.js b/ui/components/app/modals/modal.js index f16447804..d35cff55f 100644 --- a/ui/components/app/modals/modal.js +++ b/ui/components/app/modals/modal.js @@ -18,14 +18,11 @@ import CustodyConfirmLink from '../../institutional/custody-confirm-link-modal'; import InteractiveReplacementTokenModal from '../../institutional/interactive-replacement-token-modal'; import TransactionFailed from '../../institutional/transaction-failed-modal'; ///: END:ONLY_INCLUDE_IN -import AccountDetailsModal from './account-details-modal'; -import ExportPrivateKeyModal from './export-private-key-modal'; import HideTokenConfirmationModal from './hide-token-confirmation-modal'; import QRScanner from './qr-scanner'; import ConfirmRemoveAccount from './confirm-remove-account'; import ConfirmResetAccount from './confirm-reset-account'; -import HoldToRevealModal from './hold-to-reveal-modal'; import TransactionConfirmed from './transaction-confirmed'; import ConfirmDeleteNetwork from './confirm-delete-network'; @@ -145,29 +142,6 @@ const MODALS = { }, }, - ACCOUNT_DETAILS: { - contents: , - ...accountModalStyle, - }, - - EXPORT_PRIVATE_KEY: { - contents: , - ...accountModalStyle, - }, - - HOLD_TO_REVEAL_SRP: { - contents: , - mobileModalStyle: { - ...modalContainerMobileStyle, - }, - laptopModalStyle: { - ...modalContainerLaptopStyle, - }, - contentStyle: { - borderRadius: '8px', - }, - }, - HIDE_TOKEN_CONFIRMATION: { contents: , mobileModalStyle: { diff --git a/ui/components/multichain/account-details/account-details-authenticate.js b/ui/components/multichain/account-details/account-details-authenticate.js index 01e945308..6ebec5609 100644 --- a/ui/components/multichain/account-details/account-details-authenticate.js +++ b/ui/components/multichain/account-details/account-details-authenticate.js @@ -1,6 +1,6 @@ +import PropTypes from 'prop-types'; import React, { useCallback, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import PropTypes from 'prop-types'; import { Display, FontWeight, @@ -9,16 +9,21 @@ import { } from '../../../helpers/constants/design-system'; import { BannerAlert, + Box, ButtonPrimary, ButtonSecondary, FormTextField, - Box, } from '../../component-library'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { exportAccount, hideWarning } from '../../../store/actions'; -export const AccountDetailsAuthenticate = ({ address, onCancel }) => { +export const AccountDetailsAuthenticate = ({ + address, + onCancel, + setPrivateKey, + setShowHoldToReveal, +}) => { const t = useI18nContext(); const dispatch = useDispatch(); @@ -28,11 +33,13 @@ export const AccountDetailsAuthenticate = ({ address, onCancel }) => { const warning = useSelector((state) => state.appState.warning); const onSubmit = useCallback(() => { - dispatch(exportAccount(password, address)).then((res) => { + dispatch( + exportAccount(password, address, setPrivateKey, setShowHoldToReveal), + ).then((res) => { dispatch(hideWarning()); return res; }); - }, [dispatch, password, address]); + }, [dispatch, password, address, setPrivateKey, setShowHoldToReveal]); const handleKeyPress = useCallback( (e) => { @@ -80,4 +87,6 @@ export const AccountDetailsAuthenticate = ({ address, onCancel }) => { AccountDetailsAuthenticate.propTypes = { address: PropTypes.string.isRequired, onCancel: PropTypes.func.isRequired, + setPrivateKey: PropTypes.func.isRequired, + setShowHoldToReveal: PropTypes.func.isRequired, }; diff --git a/ui/components/multichain/account-details/account-details.js b/ui/components/multichain/account-details/account-details.js index 249e272ed..2b0167889 100644 --- a/ui/components/multichain/account-details/account-details.js +++ b/ui/components/multichain/account-details/account-details.js @@ -1,48 +1,54 @@ -import React, { useCallback, useState } from 'react'; import PropTypes from 'prop-types'; +import React, { useCallback, useContext, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { - setAccountDetailsAddress, + MetaMetricsEventCategory, + MetaMetricsEventKeyType, + MetaMetricsEventName, +} from '../../../../shared/constants/metametrics'; +import { MetaMetricsContext } from '../../../contexts/metametrics'; +import { + AlignItems, + Display, + FlexDirection, + TextVariant, +} from '../../../helpers/constants/design-system'; +import { useI18nContext } from '../../../hooks/useI18nContext'; +import { getMetaMaskAccountsOrdered } from '../../../selectors'; +import { clearAccountDetails, hideWarning, + setAccountDetailsAddress, } from '../../../store/actions'; +import HoldToRevealModal from '../../app/modals/hold-to-reveal-modal/hold-to-reveal-modal'; import { AvatarAccount, AvatarAccountSize, AvatarAccountVariant, + Box, Modal, ModalContent, ModalHeader, ModalOverlay, - Box, Text, } from '../../component-library'; -import { getMetaMaskAccountsOrdered } from '../../../selectors'; -import { useI18nContext } from '../../../hooks/useI18nContext'; -import { - AlignItems, - TextVariant, - Display, - FlexDirection, -} from '../../../helpers/constants/design-system'; import { AddressCopyButton } from '../address-copy-button'; -import { AccountDetailsDisplay } from './account-details-display'; import { AccountDetailsAuthenticate } from './account-details-authenticate'; +import { AccountDetailsDisplay } from './account-details-display'; import { AccountDetailsKey } from './account-details-key'; export const AccountDetails = ({ address }) => { const dispatch = useDispatch(); const t = useI18nContext(); + const trackEvent = useContext(MetaMetricsContext); const useBlockie = useSelector((state) => state.metamask.useBlockie); const accounts = useSelector(getMetaMaskAccountsOrdered); const { name } = accounts.find((account) => account.address === address); - + const [showHoldToReveal, setShowHoldToReveal] = useState(false); const [attemptingExport, setAttemptingExport] = useState(false); // This is only populated when the user properly authenticates - const privateKey = useSelector( - (state) => state.appState.accountDetail.privateKey, - ); + const [privateKey, setPrivateKey] = useState(''); const onClose = useCallback(() => { dispatch(setAccountDetailsAddress('')); @@ -64,63 +70,87 @@ export const AccountDetails = ({ address }) => { ); return ( - - - - { - dispatch(hideWarning()); - setAttemptingExport(false); - } - : null - } - > - {attemptingExport ? t('showPrivateKey') : avatar} - - {attemptingExport ? ( - <> - - {avatar} - + {/* This is the Modal that says "Show private key" on top and has a few states */} + + + + { + dispatch(hideWarning()); + setAttemptingExport(false); + }) + } + > + {attemptingExport ? t('showPrivateKey') : avatar} + + {attemptingExport ? ( + <> + - {name} - - - - {privateKey ? ( - - ) : ( - - )} - - ) : ( - setAttemptingExport(true)} - /> - )} - - + {avatar} + + {name} + + + + {privateKey ? ( + + ) : ( + + )} + + ) : ( + setAttemptingExport(true)} + /> + )} + + + + {/* This is the Modal that says "Hold to reveal private key" */} + { + trackEvent({ + category: MetaMetricsEventCategory.Keys, + event: MetaMetricsEventName.KeyExportCanceled, + properties: { + key_type: MetaMetricsEventKeyType.Pkey, + }, + }); + setPrivateKey(''); + setShowHoldToReveal(false); + }} + onLongPressed={() => { + setShowHoldToReveal(false); + }} + holdToRevealType="PrivateKey" + /> + ); }; diff --git a/ui/components/multichain/account-details/account-details.test.js b/ui/components/multichain/account-details/account-details.test.js index 78ae27454..547be20f8 100644 --- a/ui/components/multichain/account-details/account-details.test.js +++ b/ui/components/multichain/account-details/account-details.test.js @@ -1,31 +1,35 @@ -import React from 'react'; -import { screen, fireEvent } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; import { toChecksumHexAddress } from '@metamask/controller-utils'; -import { renderWithProvider } from '../../../../test/jest'; -import configureStore from '../../../store/store'; -import mockState from '../../../../test/data/mock-state.json'; +import { fireEvent, screen } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import React from 'react'; import { showPrivateKey } from '../../../../app/_locales/en/messages.json'; +import mockState from '../../../../test/data/mock-state.json'; +import { renderWithProvider } from '../../../../test/jest'; +import { shortenAddress } from '../../../helpers/utils/util'; import { - setAccountDetailsAddress, + clearAccountDetails, exportAccount, hideWarning, + setAccountDetailsAddress, } from '../../../store/actions'; -import { shortenAddress } from '../../../helpers/utils/util'; +import configureStore from '../../../store/store'; +import { AccountDetailsKey } from './account-details-key'; import { AccountDetails } from '.'; jest.mock('../../../store/actions.ts'); describe('AccountDetails', () => { const address = '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc'; - const mockSetAccountDetailsAddress = jest.fn(); + const mockClearAccountDetails = jest.fn(); const mockExportAccount = jest.fn().mockResolvedValue(true); const mockHideWarning = jest.fn(); + const mockSetAccountDetailsAddress = jest.fn(); beforeEach(() => { - setAccountDetailsAddress.mockReturnValue(mockSetAccountDetailsAddress); + clearAccountDetails.mockReturnValue(mockClearAccountDetails); exportAccount.mockReturnValue(mockExportAccount); hideWarning.mockReturnValue(mockHideWarning); + setAccountDetailsAddress.mockReturnValue(mockSetAccountDetailsAddress); }); afterEach(() => jest.clearAllMocks()); @@ -79,23 +83,33 @@ describe('AccountDetails', () => { await userEvent.keyboard(password); fireEvent.click(queryByText('Confirm')); - expect(exportAccount).toHaveBeenCalledWith(password, address); + expect(exportAccount).toHaveBeenCalledWith( + password, + address, + expect.any(Function), + expect.any(Function), + ); }); - it('displays the private key when exposed in state', () => { + it('displays the private key when sent in props', () => { const samplePrivateKey = '8675309'; - const { queryByText } = render( - {}, - { appState: { accountDetail: { privateKey: samplePrivateKey } } }, + + const { queryByText } = renderWithProvider( + , ); - const exportPrivateKeyButton = queryByText(showPrivateKey.message); - fireEvent.click(exportPrivateKeyButton); - - expect( - queryByText(shortenAddress(toChecksumHexAddress(address))), - ).toBeInTheDocument(); - expect(queryByText(samplePrivateKey)).toBeInTheDocument(); }); + + it('should call AccountDetails.onClose()', () => { + render(); + + fireEvent.click(screen.getByLabelText('Close')); + + expect(screen.queryByText('Account 1')).toBeNull(); + }); }); diff --git a/ui/pages/keychains/reveal-seed.js b/ui/pages/keychains/reveal-seed.js index c2f0125fb..2f8e719aa 100644 --- a/ui/pages/keychains/reveal-seed.js +++ b/ui/pages/keychains/reveal-seed.js @@ -1,48 +1,48 @@ -import React, { useContext, useEffect, useState } from 'react'; -import { useSelector, useDispatch } from 'react-redux'; -import { useHistory } from 'react-router-dom'; import qrCode from 'qrcode-generator'; -import { requestRevealSeedWords, showModal } from '../../store/actions'; -import ExportTextContainer from '../../components/ui/export-text-container'; -import { getMostRecentOverviewPage } from '../../ducks/history/history'; +import React, { useContext, useEffect, useState } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { useHistory } from 'react-router-dom'; import { MetaMetricsEventCategory, MetaMetricsEventKeyType, MetaMetricsEventName, } from '../../../shared/constants/metametrics'; +import HoldToRevealModal from '../../components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal'; import { - TextVariant, - SEVERITIES, - Size, - BLOCK_SIZES, - JustifyContent, - AlignItems, - DISPLAY, -} from '../../helpers/constants/design-system'; - -import Box from '../../components/ui/box'; -import { - Label, + BUTTON_SIZES, + BUTTON_VARIANT, BannerAlert, Button, - TextField, HelpText, HelpTextSeverity, - BUTTON_VARIANT, + Label, TEXT_FIELD_SIZES, TEXT_FIELD_TYPES, - BUTTON_SIZES, Text, + TextField, } from '../../components/component-library'; -import { useI18nContext } from '../../hooks/useI18nContext'; +import Box from '../../components/ui/box'; +import ExportTextContainer from '../../components/ui/export-text-container'; +import { Tab, Tabs } from '../../components/ui/tabs'; import { MetaMetricsContext } from '../../contexts/metametrics'; +import { getMostRecentOverviewPage } from '../../ducks/history/history'; +import { + AlignItems, + BlockSize, + Display, + JustifyContent, + Severity, + Size, + TextVariant, +} from '../../helpers/constants/design-system'; import ZENDESK_URLS from '../../helpers/constants/zendesk-url'; -import { Tabs, Tab } from '../../components/ui/tabs'; +import { useI18nContext } from '../../hooks/useI18nContext'; +import { requestRevealSeedWords } from '../../store/actions'; const PASSWORD_PROMPT_SCREEN = 'PASSWORD_PROMPT_SCREEN'; const REVEAL_SEED_SCREEN = 'REVEAL_SEED_SCREEN'; -const RevealSeedPage = () => { +export default function RevealSeedPage() { const history = useHistory(); const dispatch = useDispatch(); const t = useI18nContext(); @@ -54,6 +54,7 @@ const RevealSeedPage = () => { const [completedLongPress, setCompletedLongPress] = useState(false); const [error, setError] = useState(null); const mostRecentOverviewPage = useSelector(getMostRecentOverviewPage); + const [isShowingHoldModal, setIsShowingHoldModal] = useState(false); useEffect(() => { const passwordBox = document.getElementById('password-box'); @@ -85,16 +86,7 @@ const RevealSeedPage = () => { }); setSeedWords(revealedSeedWords); - dispatch( - showModal({ - name: 'HOLD_TO_REVEAL_SRP', - onLongPressed: () => { - setCompletedLongPress(true); - setScreen(REVEAL_SEED_SCREEN); - }, - holdToRevealType: 'SRP', - }), - ); + setIsShowingHoldModal(true); }) .catch((e) => { trackEvent({ @@ -111,7 +103,7 @@ const RevealSeedPage = () => { const renderWarning = () => { return ( - + {t('revealSeedWordsWarning', [ { value={password} onChange={(event) => setPassword(event.target.value)} error={error} - width={BLOCK_SIZES.FULL} + width={BlockSize.Full} /> {error && ( {error} @@ -221,7 +213,7 @@ const RevealSeedPage = () => { tabKey="qr-srp" > { const renderPasswordPromptFooter = () => { return ( - +