1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Merge branch 'develop' of github.com:MetaMask/metamask-extension into minimal

This commit is contained in:
Matthias Kretschmann 2023-08-15 12:53:09 +01:00
commit 1be7c9784b
Signed by: m
GPG Key ID: 606EEEF3C479A91F
153 changed files with 2112 additions and 2615 deletions

View File

@ -19,6 +19,15 @@ const state = {
url: 'https://metamask.github.io/test-dapp/',
},
metamask: {
announcements: {
22: {
id: 22,
date: null,
image: {
src: 'images/global-menu-block-explorer.svg',
},
}
},
tokenList: {
'0x514910771af9ca656af840dff83e8264ecf986ca': {
address: '0x514910771af9ca656af840dff83e8264ecf986ca',

View File

@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [10.34.4]
### Changed
- Updated snaps execution environment ([#20420](https://github.com/MetaMask/metamask-extension/pull/20420))
## [10.34.3]
### Fixed
- Ensure users phishing warning list is properly updated ([#20381](https://github.com/MetaMask/metamask-extension/pull/20381))
- Fix inaccurate info in swaps flow for zero-balance tokens ([#20388](https://github.com/MetaMask/metamask-extension/pull/20388))
- Fix 'Global Menu Explorer / Account Details' What's New notification display ([#20371](https://github.com/MetaMask/metamask-extension/pull/20371))
## [10.34.2]
### Added
- Add Address Details and View on Explorer to Global Menu ([#20013](https://github.com/MetaMask/metamask-extension/pull/20013))
@ -26,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [10.34.1]
### Fixed
- Fix bug that could cause a failure in the persistence of network related data ([#20080](https://github.com/MetaMask/metamask-extension/pull/20080))
- Fix ([#20080](https://github.com/MetaMask/metamask-extension/pull/20080))
- Fix possible crash when opening the network menu ([#20181](https://github.com/MetaMask/metamask-extension/pull/20181))
## [10.34.0]
### Added
@ -3875,7 +3885,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Uncategorized
- Added the ability to restore accounts from seed words.
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.34.2...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.34.4...HEAD
[10.34.4]: https://github.com/MetaMask/metamask-extension/compare/v10.34.3...v10.34.4
[10.34.3]: https://github.com/MetaMask/metamask-extension/compare/v10.34.2...v10.34.3
[10.34.2]: https://github.com/MetaMask/metamask-extension/compare/v10.34.1...v10.34.2
[10.34.1]: https://github.com/MetaMask/metamask-extension/compare/v10.34.0...v10.34.1
[10.34.0]: https://github.com/MetaMask/metamask-extension/compare/v10.33.1...v10.34.0

View File

@ -609,9 +609,6 @@
"searchResults": {
"message": "ውጤቶችን ፈልግ"
},
"searchTokens": {
"message": "ተለዋጭ ስሞችን ፈልግ"
},
"securityAndPrivacy": {
"message": "ደህንነት እና ግላዊነት"
},

View File

@ -621,9 +621,6 @@
"searchResults": {
"message": "نتائج البحث"
},
"searchTokens": {
"message": "البحث عن العملات الرمزية"
},
"securityAndPrivacy": {
"message": "الأمن والخصوصية"
},

View File

@ -620,9 +620,6 @@
"searchResults": {
"message": "Резултати от търсенето"
},
"searchTokens": {
"message": "Търсене на маркери"
},
"securityAndPrivacy": {
"message": "Сигурност и поверителност"
},

View File

@ -618,9 +618,6 @@
"searchResults": {
"message": "অনুসন্ধানের ফলাফলগুলি"
},
"searchTokens": {
"message": "টোকেনগুলি অনুসন্ধান করুন"
},
"securityAndPrivacy": {
"message": "নিরাপত্তা এবং গোপনীয়তা"
},

View File

@ -605,9 +605,6 @@
"searchResults": {
"message": "Resultats de Cerca"
},
"searchTokens": {
"message": "Tokens per cercar"
},
"securityAndPrivacy": {
"message": "Seguretat i privacitat"
},

View File

@ -289,9 +289,6 @@
"search": {
"message": "Hledat"
},
"searchTokens": {
"message": "Hledat tokeny"
},
"seedPhraseReq": {
"message": "klíčové fráze mají 12 slov"
},

View File

@ -605,9 +605,6 @@
"searchResults": {
"message": "Søg Resultater"
},
"searchTokens": {
"message": "Søg efter tokens"
},
"securityAndPrivacy": {
"message": "Sikkerhed & Privatliv"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "Benutzerdefiniertes Netzwerk hinzufügen"
},
"addCustomToken": {
"message": "Kunden-Token hinzufügen"
},
"addEthereumChainConfirmationDescription": {
"message": "Dadurch kann dieses Netzwerk innerhalb MetaMask verwendet werden."
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "Suchergebnisse"
},
"searchTokens": {
"message": "Token suchen"
},
"secretRecoveryPhrase": {
"message": "Geheime Wiederherstellungsphrase"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "Προσθήκη προσαρμοσμένου δικτύου"
},
"addCustomToken": {
"message": "Προσθήκη Προσαρμοσμένου Token"
},
"addEthereumChainConfirmationDescription": {
"message": "Αυτό θα επιτρέψει σε αυτό το δίκτυο να χρησιμοποιηθεί στο MetaMask."
},
@ -2977,9 +2974,6 @@
"searchAccounts": {
"message": "Αναζήτηση Λογαριασμών"
},
"searchTokens": {
"message": "Αναζήτηση Tokens"
},
"secretRecoveryPhrase": {
"message": "Μυστική Φράση Ανάκτησης"
},

View File

@ -192,9 +192,6 @@
"addCustomNetwork": {
"message": "Add custom network"
},
"addCustomToken": {
"message": "Add custom token"
},
"addEthereumChainConfirmationDescription": {
"message": "This will allow this network to be used within MetaMask."
},
@ -568,6 +565,9 @@
"blockaidDescriptionBlurFarming": {
"message": "If you approve this request, someone can steal your assets listed on Blur."
},
"blockaidDescriptionFailed": {
"message": "Because of an error, this request was not verified by the security provider. Proceed with caution."
},
"blockaidDescriptionMaliciousDomain": {
"message": "You're interacting with a malicious domain. If you approve this request, you might lose your assets."
},
@ -583,6 +583,9 @@
"blockaidTitleDeceptive": {
"message": "This is a deceptive request"
},
"blockaidTitleMayNotBeSafe": {
"message": "Request may not be safe"
},
"blockaidTitleSuspicious": {
"message": "This is a suspicious request"
},
@ -3653,9 +3656,6 @@
"searchResults": {
"message": "Search results"
},
"searchTokens": {
"message": "Search tokens"
},
"secretRecoveryPhrase": {
"message": "Secret Recovery Phrase"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "Agregar red personalizada"
},
"addCustomToken": {
"message": "Añadir token personalizado"
},
"addEthereumChainConfirmationDescription": {
"message": "Esto permitirá que la red se utilice en MetaMask."
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "Resultados de la búsqueda"
},
"searchTokens": {
"message": "Buscar tokens"
},
"secretRecoveryPhrase": {
"message": "Frase secreta de recuperación"
},

View File

@ -100,9 +100,6 @@
"addContact": {
"message": "Agregar contacto"
},
"addCustomToken": {
"message": "Añadir token personalizado"
},
"addEthereumChainConfirmationDescription": {
"message": "Esto permitirá que la red se utilice en MetaMask."
},
@ -1882,9 +1879,6 @@
"searchResults": {
"message": "Resultados de la búsqueda"
},
"searchTokens": {
"message": "Buscar tokens"
},
"secretRecoveryPhrase": {
"message": "Frase secreta de recuperación"
},

View File

@ -614,9 +614,6 @@
"searchResults": {
"message": "Otsingutulemused"
},
"searchTokens": {
"message": "Lubade otsimine"
},
"securityAndPrivacy": {
"message": "Turvalisus ja privaatsus"
},

View File

@ -624,9 +624,6 @@
"searchResults": {
"message": "نتایج جستجو"
},
"searchTokens": {
"message": "رمزیاب های جستجو"
},
"securityAndPrivacy": {
"message": "امنیت و حریم خصوصی"
},

View File

@ -621,9 +621,6 @@
"searchResults": {
"message": "Hakutulokset"
},
"searchTokens": {
"message": "Hae tietueita"
},
"securityAndPrivacy": {
"message": "Turva & yksityisyys"
},

View File

@ -548,9 +548,6 @@
"searchResults": {
"message": "Mga Resulta ng Paghahanap"
},
"searchTokens": {
"message": "Maghanap ng Mga Token"
},
"securityAndPrivacy": {
"message": "Seguridad at Privacy"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "Ajouter un réseau personnalisé"
},
"addCustomToken": {
"message": "Ajouter un jeton personnalisé"
},
"addEthereumChainConfirmationDescription": {
"message": "Cela permettra dutiliser ce réseau dans MetaMask."
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "Résultats de la recherche"
},
"searchTokens": {
"message": "Rechercher des jetons"
},
"secretRecoveryPhrase": {
"message": "Phrase secrète de récupération"
},

View File

@ -621,9 +621,6 @@
"searchResults": {
"message": "תוצאות חיפוש"
},
"searchTokens": {
"message": "חיפוש טוקנים"
},
"securityAndPrivacy": {
"message": "אבטחה ופרטיות"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "कस्टम नेटवर्क जोड़ें"
},
"addCustomToken": {
"message": "कस्टम टोकन जोड़ें"
},
"addEthereumChainConfirmationDescription": {
"message": "इससे इस नेटवर्क को MetaMask के अंदर उपयोग करने की अनुमति मिलेगी।"
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "खोज परिणाम"
},
"searchTokens": {
"message": "टोकन खोजें"
},
"secretRecoveryPhrase": {
"message": "सीक्रेट रिकवरी फ्रेज"
},

View File

@ -617,9 +617,6 @@
"searchResults": {
"message": "Rezultati pretraživanja"
},
"searchTokens": {
"message": "Pretraži tokene"
},
"securityAndPrivacy": {
"message": "Sigurnost i privatnost"
},

View File

@ -452,9 +452,6 @@
"searchResults": {
"message": "Rezilta rechèch"
},
"searchTokens": {
"message": "Rechèch Tokens"
},
"seedPhraseReq": {
"message": "Seed fraz yo se 12 long mo"
},

View File

@ -617,9 +617,6 @@
"searchResults": {
"message": "Keresési eredmények"
},
"searchTokens": {
"message": "Keresés a tokenek között"
},
"securityAndPrivacy": {
"message": "Biztonság és adatvédelem"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "Tambahkan jaringan khusus"
},
"addCustomToken": {
"message": "Tambahkan token kustom"
},
"addEthereumChainConfirmationDescription": {
"message": "Tindakan ini akan membantu jaringan ini agar dapat digunakan dengan MetaMask."
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "Cari hasil"
},
"searchTokens": {
"message": "Cari token"
},
"secretRecoveryPhrase": {
"message": "Frasa Pemulihan Rahasia"
},

View File

@ -155,9 +155,6 @@
"addContact": {
"message": "Aggiungi contatto"
},
"addCustomToken": {
"message": "Aggiungi token personalizzato"
},
"addEthereumChainConfirmationDescription": {
"message": "Ciò consentirà a questa rete di essere utilizzata all'interno di MetaMask."
},
@ -1380,9 +1377,6 @@
"searchResults": {
"message": "Risultati Ricerca"
},
"searchTokens": {
"message": "Cerca Tokens"
},
"securityAndPrivacy": {
"message": "Sicurezza & Privacy"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "カスタムネットワークを追加"
},
"addCustomToken": {
"message": "カスタムトークンを追加"
},
"addEthereumChainConfirmationDescription": {
"message": "これにより、このネットワークはMetaMask内で使用できるようになります。"
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "検索結果"
},
"searchTokens": {
"message": "トークンを検索"
},
"secretRecoveryPhrase": {
"message": "シークレットリカバリーフレーズ"
},

View File

@ -624,9 +624,6 @@
"searchResults": {
"message": "ಹುಡುಕಾಟ ಫಲಿತಾಂಶಗಳು"
},
"searchTokens": {
"message": "ಟೋಕನ್‌ಗಳನ್ನು ಹುಡುಕಿ"
},
"securityAndPrivacy": {
"message": "ಭದ್ರತೆ ಮತ್ತು ಗೌಪ್ಯತೆ"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "커스텀 네트워크 추가"
},
"addCustomToken": {
"message": "커스텀 토큰 추가"
},
"addEthereumChainConfirmationDescription": {
"message": "이렇게 하면 MetaMask 내에서 이 네트워크를 사용할 수 있습니다."
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "검색 결과"
},
"searchTokens": {
"message": "토큰 검색"
},
"secretRecoveryPhrase": {
"message": "비밀 복구 구문"
},

View File

@ -624,9 +624,6 @@
"searchResults": {
"message": "Paieškos rezultatai"
},
"searchTokens": {
"message": "Ieškoti žetonų"
},
"securityAndPrivacy": {
"message": "Sauga ir privatumas"
},

View File

@ -620,9 +620,6 @@
"searchResults": {
"message": "Meklēšanas rezultāti"
},
"searchTokens": {
"message": "Meklēt marķierus"
},
"securityAndPrivacy": {
"message": "Drošība un konfidencialitāte"
},

View File

@ -604,9 +604,6 @@
"searchResults": {
"message": "Hasil Carian"
},
"searchTokens": {
"message": "Cari Token"
},
"securityAndPrivacy": {
"message": "Keselamatan & Privasi"
},

View File

@ -608,9 +608,6 @@
"searchResults": {
"message": "Søkeresultater"
},
"searchTokens": {
"message": "Søk i sjetonger"
},
"securityAndPrivacy": {
"message": "Sikkerhet og personvern"
},

View File

@ -1211,9 +1211,6 @@
"searchResults": {
"message": "Mga Resulta ng Paghahanap"
},
"searchTokens": {
"message": "Maghanap ng Mga Token"
},
"securityAndPrivacy": {
"message": "Seguridad at Privacy"
},

View File

@ -618,9 +618,6 @@
"searchResults": {
"message": "Wyniki wyszukiwania"
},
"searchTokens": {
"message": "Szukaj tokenów"
},
"securityAndPrivacy": {
"message": "Bezpieczeństwo i prywatność"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "Adicionar rede personalizada"
},
"addCustomToken": {
"message": "Adicionar token personalizado"
},
"addEthereumChainConfirmationDescription": {
"message": "Isso permitirá que essa rede seja usada dentro da MetaMask."
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "Resultados da busca"
},
"searchTokens": {
"message": "Buscar tokens"
},
"secretRecoveryPhrase": {
"message": "Frase Secreta de Recuperação"
},

View File

@ -100,9 +100,6 @@
"addContact": {
"message": "Adicionar contato"
},
"addCustomToken": {
"message": "Adicionar token personalizado"
},
"addEthereumChainConfirmationDescription": {
"message": "Isso permitirá que essa rede seja usada dentro da MetaMask."
},
@ -1882,9 +1879,6 @@
"searchResults": {
"message": "Resultados da busca"
},
"searchTokens": {
"message": "Buscar tokens"
},
"secretRecoveryPhrase": {
"message": "Frase de Recuperação Secreta"
},

View File

@ -611,9 +611,6 @@
"searchResults": {
"message": "Rezultate căutare"
},
"searchTokens": {
"message": "Căutați token-uri"
},
"securityAndPrivacy": {
"message": "Securitate și confidențialitate"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "Добавить пользовательскую сеть"
},
"addCustomToken": {
"message": "Добавить пользовательский токен"
},
"addEthereumChainConfirmationDescription": {
"message": "Это позволит использовать эту сеть в MetaMask."
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "Результаты поиска"
},
"searchTokens": {
"message": "Поиск токенов"
},
"secretRecoveryPhrase": {
"message": "Секретная фраза для восстановления"
},

View File

@ -596,9 +596,6 @@
"searchResults": {
"message": "Výsledky vyhľadávania"
},
"searchTokens": {
"message": "Hledat tokeny"
},
"securityAndPrivacy": {
"message": "Bezpečnosť a súkromie"
},

View File

@ -612,9 +612,6 @@
"searchResults": {
"message": "Rezultati iskanja"
},
"searchTokens": {
"message": "Iskanje žetonov"
},
"securityAndPrivacy": {
"message": "Varnost in zasebnost"
},

View File

@ -615,9 +615,6 @@
"searchResults": {
"message": "Rezultati pretrage"
},
"searchTokens": {
"message": "Pretražite tokene"
},
"securityAndPrivacy": {
"message": "Bezbednost i privatnost"
},

View File

@ -608,9 +608,6 @@
"searchResults": {
"message": "Sökresultat"
},
"searchTokens": {
"message": "Sök tokens"
},
"securityAndPrivacy": {
"message": "Säkerhet och integritet"
},

View File

@ -602,9 +602,6 @@
"searchResults": {
"message": "Matokeo ya Utafutaji"
},
"searchTokens": {
"message": "Tafuta Vianzio"
},
"securityAndPrivacy": {
"message": "Ulinzi na Faragha"
},

View File

@ -359,9 +359,6 @@
"search": {
"message": "தேடல்"
},
"searchTokens": {
"message": "தேடல் டோக்கன்ஸ்"
},
"seedPhraseReq": {
"message": "விதை வாக்கியங்கள் 12 வார்த்தைகள் நீண்டவை"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "Magdagdag ng custom na network"
},
"addCustomToken": {
"message": "Magdagdag ng Custom na Token"
},
"addEthereumChainConfirmationDescription": {
"message": "Magpapahintulot ito sa network na ito na gamitin sa loob ng MetaMask."
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "Mga Resulta ng Paghahanap"
},
"searchTokens": {
"message": "Maghanap ng Mga Token"
},
"secretRecoveryPhrase": {
"message": "Lihim na recovery phrase"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "Özel ağ ekle"
},
"addCustomToken": {
"message": "Özel token ekle"
},
"addEthereumChainConfirmationDescription": {
"message": "Bu, bu ağın MetaMas dahilinde kullanılmasına olanak tanıyacaktır."
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "Arama sonuçları"
},
"searchTokens": {
"message": "Token ara"
},
"secretRecoveryPhrase": {
"message": "Gizli Kurtarma İfadesi"
},

View File

@ -624,9 +624,6 @@
"searchResults": {
"message": "Результати пошуку"
},
"searchTokens": {
"message": "Шукати токени"
},
"securityAndPrivacy": {
"message": "Безпека й конфіденційність"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "Thêm mạng tùy chỉnh"
},
"addCustomToken": {
"message": "Thêm token tùy chỉnh"
},
"addEthereumChainConfirmationDescription": {
"message": "Thao tác này sẽ cho phép sử dụng mạng này trong MetaMask."
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "Kết quả tìm kiếm"
},
"searchTokens": {
"message": "Tìm kiếm token"
},
"secretRecoveryPhrase": {
"message": "Cụm Mật Khẩu Khôi Phục Bí Mật"
},

View File

@ -186,9 +186,6 @@
"addCustomNetwork": {
"message": "添加自定义网络"
},
"addCustomToken": {
"message": "添加自定义代币"
},
"addEthereumChainConfirmationDescription": {
"message": "这将允许在 MetaMask 中使用此网络。"
},
@ -2980,9 +2977,6 @@
"searchResults": {
"message": "搜索结果"
},
"searchTokens": {
"message": "搜索代币"
},
"secretRecoveryPhrase": {
"message": "助记词"
},

View File

@ -42,9 +42,6 @@
"addContact": {
"message": "新增合約"
},
"addCustomToken": {
"message": "Add Custom Token"
},
"addEthereumChainConfirmationDescription": {
"message": "這會允許在 MetaMask 內使用這個網路。"
},
@ -1133,9 +1130,6 @@
"searchResults": {
"message": "搜尋結果"
},
"searchTokens": {
"message": "搜尋代幣"
},
"secureWallet": {
"message": "Secure Wallet"
},

View File

@ -45,7 +45,10 @@ export type CoreMessage = AbstractMessage & {
};
export type StateMessage = Required<
Omit<AbstractMessage, 'securityProviderResponse' | 'metadata' | 'error'>
Omit<
AbstractMessage,
'securityAlertResponse' | 'securityProviderResponse' | 'metadata' | 'error'
>
>;
export type DecryptMessageControllerState = {

View File

@ -44,7 +44,10 @@ export type CoreMessage = AbstractMessage & {
};
export type StateMessage = Required<
Omit<AbstractMessage, 'securityProviderResponse' | 'metadata' | 'error'>
Omit<
AbstractMessage,
'securityAlertResponse' | 'securityProviderResponse' | 'metadata' | 'error'
>
> & {
msgParams: string;
};

View File

@ -28,7 +28,7 @@ try {
const namedIntrinsics = Reflect.ownKeys(new Compartment().globalThis);
// These named intrinsics are not automatically hardened by `lockdown`
const shouldHardenManually = new Set(['eval', 'Function']);
const shouldHardenManually = new Set(['eval', 'Function', 'Symbol']);
const globalProperties = new Set([
// universalPropertyNames is a constant added by lockdown to global scope

View File

@ -89,6 +89,7 @@ import {
ERC20,
ERC721,
} from '@metamask/controller-utils';
import { wordlist } from '@metamask/scure-bip39/dist/wordlists/english';
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
import { toChecksumHexAddress } from '../../shared/modules/hexstring-utils';
@ -2905,8 +2906,6 @@ export default class MetamaskController extends EventEmitter {
const seedPhraseAsBuffer = Buffer.from(encodedSeedPhrase);
const { keyringController } = this;
// clear known identities
this.preferencesController.setAddresses([]);
@ -2930,29 +2929,22 @@ export default class MetamaskController extends EventEmitter {
this.txController.txStateManager.clearUnapprovedTxs();
// create new vault
const vault = await keyringController.createNewVaultAndRestore(
const vault = await this.coreKeyringController.createNewVaultAndRestore(
password,
seedPhraseAsBuffer,
this._convertMnemonicToWordlistIndices(seedPhraseAsBuffer),
);
const ethQuery = new EthQuery(this.provider);
accounts = await keyringController.getAccounts();
accounts = await this.coreKeyringController.getAccounts();
lastBalance = await this.getBalance(
accounts[accounts.length - 1],
ethQuery,
);
const [primaryKeyring] = this.coreKeyringController.getKeyringsByType(
KeyringType.hdKeyTree,
);
if (!primaryKeyring) {
throw new Error('MetamaskController - No HD Key Tree found');
}
// seek out the first zero balance
while (lastBalance !== '0x0') {
await keyringController.addNewAccount(primaryKeyring);
accounts = await keyringController.getAccounts();
await this.coreKeyringController.addNewAccount(accounts.length);
accounts = await this.coreKeyringController.getAccounts();
lastBalance = await this.getBalance(
accounts[accounts.length - 1],
ethQuery,
@ -2962,7 +2954,7 @@ export default class MetamaskController extends EventEmitter {
// remove extra zero balance account potentially created from seeking ahead
if (accounts.length > 1 && lastBalance === '0x0') {
await this.removeAccount(accounts[accounts.length - 1]);
accounts = await keyringController.getAccounts();
accounts = await this.coreKeyringController.getAccounts();
}
// This must be set as soon as possible to communicate to the
@ -2973,8 +2965,6 @@ export default class MetamaskController extends EventEmitter {
this.preferencesController.getLedgerTransportPreference();
this.setLedgerTransportPreference(transportPreference);
// set new identities
this.preferencesController.setAddresses(accounts);
this.selectFirstIdentity();
return vault;
@ -2983,6 +2973,20 @@ export default class MetamaskController extends EventEmitter {
}
}
/**
* Encodes a BIP-39 mnemonic as the indices of words in the English BIP-39 wordlist.
*
* @param {Buffer} mnemonic - The BIP-39 mnemonic.
* @returns {Buffer} The Unicode code points for the seed phrase formed from the words in the wordlist.
*/
_convertMnemonicToWordlistIndices(mnemonic) {
const indices = mnemonic
.toString()
.split(' ')
.map((word) => wordlist.indexOf(word));
return new Uint8Array(new Uint16Array(indices).buffer);
}
/**
* Get an account balance from the AccountTracker or request it directly from the network.
*

View File

@ -307,7 +307,7 @@ describe('MetaMaskController', function () {
'createNewVaultAndKeychain',
);
sandbox.spy(
metamaskController.keyringController,
metamaskController.coreKeyringController,
'createNewVaultAndRestore',
);
});
@ -423,7 +423,7 @@ describe('MetaMaskController', function () {
await metamaskController.createNewVaultAndRestore(password, TEST_SEED);
assert(
metamaskController.keyringController.createNewVaultAndRestore
metamaskController.coreKeyringController.createNewVaultAndRestore
.calledTwice,
);
});

View File

@ -47,7 +47,7 @@ buildTypes:
- desktop
- build-flask
- keyring-snaps
# - blockaid
- blockaid
env:
- INFURA_FLASK_PROJECT_ID
- SEGMENT_FLASK_WRITE_KEY

View File

@ -380,7 +380,7 @@
"@ethersproject/abi>@ethersproject/bytes": true,
"@ethersproject/abi>@ethersproject/logger": true,
"@ethersproject/abi>@ethersproject/properties": true,
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"@ethersproject/hdnode>@ethersproject/transactions": {
@ -1088,6 +1088,7 @@
},
"@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
@ -1095,8 +1096,7 @@
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-ledger-bridge-keyring>hdkey": {
@ -1111,11 +1111,11 @@
"@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": {
"packages": {
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>insert-module-globals>is-buffer": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": {
@ -1422,11 +1422,11 @@
"@metamask/eth-trezor-keyring>hdkey>secp256k1": {
"packages": {
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>insert-module-globals>is-buffer": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": {
@ -1802,6 +1802,33 @@
"eslint>optionator>fast-levenshtein": true
}
},
"@metamask/ppom-validator>elliptic": {
"packages": {
"@metamask/ppom-validator>elliptic>brorand": true,
"@metamask/ppom-validator>elliptic>hmac-drbg": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"bn.js": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"pumpify>inherits": true
}
},
"@metamask/ppom-validator>elliptic>brorand": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>browser-resolve": true
}
},
"@metamask/ppom-validator>elliptic>hmac-drbg": {
"packages": {
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true
}
},
"@metamask/rpc-methods": {
"packages": {
"@metamask/browser-passworder": true,
@ -2853,7 +2880,7 @@
},
"browserify>crypto-browserify>browserify-cipher>browserify-des>des.js": {
"packages": {
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -2865,6 +2892,7 @@
},
"browserify>crypto-browserify>browserify-sign": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"browserify>crypto-browserify>create-hmac": true,
@ -2872,15 +2900,14 @@
"browserify>crypto-browserify>public-encrypt>parse-asn1": true,
"browserify>stream-browserify": true,
"ethereumjs-util>create-hash": true,
"ganache>secp256k1>elliptic": true,
"pumpify>inherits": true
}
},
"browserify>crypto-browserify>create-ecdh": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"ganache>secp256k1>elliptic": true
"browserify>buffer": true
}
},
"browserify>crypto-browserify>create-hmac": {
@ -2903,8 +2930,8 @@
},
"browserify>crypto-browserify>diffie-hellman>miller-rabin": {
"packages": {
"bn.js": true,
"ganache>secp256k1>elliptic>brorand": true
"@metamask/ppom-validator>elliptic>brorand": true,
"bn.js": true
}
},
"browserify>crypto-browserify>pbkdf2": {
@ -2951,10 +2978,10 @@
},
"browserify>crypto-browserify>public-encrypt>parse-asn1>asn1.js": {
"packages": {
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"bn.js": true,
"browserify>buffer": true,
"browserify>vm-browserify": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -3315,6 +3342,7 @@
"packages": {
"@ethereumjs/common>crc-32": true,
"@ethersproject/abi": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"eth-lattice-keyring>gridplus-sdk>@ethereumjs/common": true,
@ -3331,7 +3359,6 @@
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ethereumjs-wallet>aes-js": true,
"ethereumjs-wallet>bs58check": true,
"ganache>secp256k1>elliptic": true,
"lodash": true
}
},
@ -3455,7 +3482,7 @@
},
"eth-lattice-keyring>gridplus-sdk>secp256k1": {
"packages": {
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"eth-lattice-keyring>gridplus-sdk>uuid": {
@ -3496,6 +3523,7 @@
},
"eth-sig-util>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
@ -3503,8 +3531,7 @@
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"eth-sig-util>ethereumjs-util>ethjs-util": {
@ -3542,14 +3569,14 @@
},
"ethereumjs-abi>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-util>rlp": true
}
},
"ethereumjs-util": {
@ -3642,7 +3669,7 @@
},
"ethereumjs-util>ethereum-cryptography>hash.js": {
"packages": {
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -3674,7 +3701,7 @@
},
"ethereumjs-util>ethereum-cryptography>secp256k1": {
"packages": {
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"ethereumjs-util>rlp": {
@ -3720,14 +3747,14 @@
},
"ethereumjs-wallet>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-util>rlp": true
}
},
"ethereumjs-wallet>randombytes": {
@ -3926,33 +3953,6 @@
"define": true
}
},
"ganache>secp256k1>elliptic": {
"packages": {
"bn.js": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ganache>secp256k1>elliptic>brorand": true,
"ganache>secp256k1>elliptic>hmac-drbg": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"ganache>secp256k1>elliptic>minimalistic-crypto-utils": true,
"pumpify>inherits": true
}
},
"ganache>secp256k1>elliptic>brorand": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>browser-resolve": true
}
},
"ganache>secp256k1>elliptic>hmac-drbg": {
"packages": {
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"ganache>secp256k1>elliptic>minimalistic-crypto-utils": true
}
},
"globalthis>define-properties": {
"packages": {
"globalthis>define-properties>has-property-descriptors": true,

View File

@ -380,7 +380,7 @@
"@ethersproject/abi>@ethersproject/bytes": true,
"@ethersproject/abi>@ethersproject/logger": true,
"@ethersproject/abi>@ethersproject/properties": true,
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"@ethersproject/hdnode>@ethersproject/transactions": {
@ -1159,6 +1159,7 @@
},
"@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
@ -1166,8 +1167,7 @@
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-ledger-bridge-keyring>hdkey": {
@ -1182,11 +1182,11 @@
"@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": {
"packages": {
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>insert-module-globals>is-buffer": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-snap-keyring": {
@ -1550,11 +1550,11 @@
"@metamask/eth-trezor-keyring>hdkey>secp256k1": {
"packages": {
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>insert-module-globals>is-buffer": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": {
@ -2006,6 +2006,33 @@
"@metamask/post-message-stream>readable-stream>safe-buffer": true
}
},
"@metamask/ppom-validator>elliptic": {
"packages": {
"@metamask/ppom-validator>elliptic>brorand": true,
"@metamask/ppom-validator>elliptic>hmac-drbg": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"bn.js": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"pumpify>inherits": true
}
},
"@metamask/ppom-validator>elliptic>brorand": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>browser-resolve": true
}
},
"@metamask/ppom-validator>elliptic>hmac-drbg": {
"packages": {
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true
}
},
"@metamask/providers>@metamask/object-multiplex": {
"globals": {
"console.warn": true
@ -3388,7 +3415,7 @@
},
"browserify>crypto-browserify>browserify-cipher>browserify-des>des.js": {
"packages": {
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -3400,6 +3427,7 @@
},
"browserify>crypto-browserify>browserify-sign": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"browserify>crypto-browserify>create-hmac": true,
@ -3407,15 +3435,14 @@
"browserify>crypto-browserify>public-encrypt>parse-asn1": true,
"browserify>stream-browserify": true,
"ethereumjs-util>create-hash": true,
"ganache>secp256k1>elliptic": true,
"pumpify>inherits": true
}
},
"browserify>crypto-browserify>create-ecdh": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"ganache>secp256k1>elliptic": true
"browserify>buffer": true
}
},
"browserify>crypto-browserify>create-hmac": {
@ -3438,8 +3465,8 @@
},
"browserify>crypto-browserify>diffie-hellman>miller-rabin": {
"packages": {
"bn.js": true,
"ganache>secp256k1>elliptic>brorand": true
"@metamask/ppom-validator>elliptic>brorand": true,
"bn.js": true
}
},
"browserify>crypto-browserify>pbkdf2": {
@ -3486,10 +3513,10 @@
},
"browserify>crypto-browserify>public-encrypt>parse-asn1>asn1.js": {
"packages": {
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"bn.js": true,
"browserify>buffer": true,
"browserify>vm-browserify": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -3866,6 +3893,7 @@
"packages": {
"@ethereumjs/common>crc-32": true,
"@ethersproject/abi": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"eth-lattice-keyring>gridplus-sdk>@ethereumjs/common": true,
@ -3882,7 +3910,6 @@
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ethereumjs-wallet>aes-js": true,
"ethereumjs-wallet>bs58check": true,
"ganache>secp256k1>elliptic": true,
"lodash": true
}
},
@ -4006,7 +4033,7 @@
},
"eth-lattice-keyring>gridplus-sdk>secp256k1": {
"packages": {
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"eth-lattice-keyring>gridplus-sdk>uuid": {
@ -4047,6 +4074,7 @@
},
"eth-sig-util>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
@ -4054,8 +4082,7 @@
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"eth-sig-util>ethereumjs-util>ethjs-util": {
@ -4093,14 +4120,14 @@
},
"ethereumjs-abi>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-util>rlp": true
}
},
"ethereumjs-util": {
@ -4193,7 +4220,7 @@
},
"ethereumjs-util>ethereum-cryptography>hash.js": {
"packages": {
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -4225,7 +4252,7 @@
},
"ethereumjs-util>ethereum-cryptography>secp256k1": {
"packages": {
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"ethereumjs-util>rlp": {
@ -4271,14 +4298,14 @@
},
"ethereumjs-wallet>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-util>rlp": true
}
},
"ethereumjs-wallet>randombytes": {
@ -4477,33 +4504,6 @@
"define": true
}
},
"ganache>secp256k1>elliptic": {
"packages": {
"bn.js": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ganache>secp256k1>elliptic>brorand": true,
"ganache>secp256k1>elliptic>hmac-drbg": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"ganache>secp256k1>elliptic>minimalistic-crypto-utils": true,
"pumpify>inherits": true
}
},
"ganache>secp256k1>elliptic>brorand": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>browser-resolve": true
}
},
"ganache>secp256k1>elliptic>hmac-drbg": {
"packages": {
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"ganache>secp256k1>elliptic>minimalistic-crypto-utils": true
}
},
"globalthis>define-properties": {
"packages": {
"globalthis>define-properties>has-property-descriptors": true,

View File

@ -380,7 +380,7 @@
"@ethersproject/abi>@ethersproject/bytes": true,
"@ethersproject/abi>@ethersproject/logger": true,
"@ethersproject/abi>@ethersproject/properties": true,
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"@ethersproject/hdnode>@ethersproject/transactions": {
@ -1159,6 +1159,7 @@
},
"@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
@ -1166,8 +1167,7 @@
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-ledger-bridge-keyring>hdkey": {
@ -1182,11 +1182,11 @@
"@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": {
"packages": {
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>insert-module-globals>is-buffer": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-snap-keyring": {
@ -1550,11 +1550,11 @@
"@metamask/eth-trezor-keyring>hdkey>secp256k1": {
"packages": {
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>insert-module-globals>is-buffer": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": {
@ -2006,6 +2006,48 @@
"@metamask/post-message-stream>readable-stream>safe-buffer": true
}
},
"@metamask/ppom-validator": {
"globals": {
"clearInterval": true,
"console.error": true,
"setInterval": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/ppom-validator>elliptic": true,
"await-semaphore": true,
"browserify>buffer": true,
"eth-query>json-rpc-random-id": true
}
},
"@metamask/ppom-validator>elliptic": {
"packages": {
"@metamask/ppom-validator>elliptic>brorand": true,
"@metamask/ppom-validator>elliptic>hmac-drbg": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"bn.js": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"pumpify>inherits": true
}
},
"@metamask/ppom-validator>elliptic>brorand": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>browser-resolve": true
}
},
"@metamask/ppom-validator>elliptic>hmac-drbg": {
"packages": {
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true
}
},
"@metamask/providers>@metamask/object-multiplex": {
"globals": {
"console.warn": true
@ -3388,7 +3430,7 @@
},
"browserify>crypto-browserify>browserify-cipher>browserify-des>des.js": {
"packages": {
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -3400,6 +3442,7 @@
},
"browserify>crypto-browserify>browserify-sign": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"browserify>crypto-browserify>create-hmac": true,
@ -3407,15 +3450,14 @@
"browserify>crypto-browserify>public-encrypt>parse-asn1": true,
"browserify>stream-browserify": true,
"ethereumjs-util>create-hash": true,
"ganache>secp256k1>elliptic": true,
"pumpify>inherits": true
}
},
"browserify>crypto-browserify>create-ecdh": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"ganache>secp256k1>elliptic": true
"browserify>buffer": true
}
},
"browserify>crypto-browserify>create-hmac": {
@ -3438,8 +3480,8 @@
},
"browserify>crypto-browserify>diffie-hellman>miller-rabin": {
"packages": {
"bn.js": true,
"ganache>secp256k1>elliptic>brorand": true
"@metamask/ppom-validator>elliptic>brorand": true,
"bn.js": true
}
},
"browserify>crypto-browserify>pbkdf2": {
@ -3486,10 +3528,10 @@
},
"browserify>crypto-browserify>public-encrypt>parse-asn1>asn1.js": {
"packages": {
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"bn.js": true,
"browserify>buffer": true,
"browserify>vm-browserify": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -3866,6 +3908,7 @@
"packages": {
"@ethereumjs/common>crc-32": true,
"@ethersproject/abi": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"eth-lattice-keyring>gridplus-sdk>@ethereumjs/common": true,
@ -3882,7 +3925,6 @@
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ethereumjs-wallet>aes-js": true,
"ethereumjs-wallet>bs58check": true,
"ganache>secp256k1>elliptic": true,
"lodash": true
}
},
@ -4006,7 +4048,7 @@
},
"eth-lattice-keyring>gridplus-sdk>secp256k1": {
"packages": {
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"eth-lattice-keyring>gridplus-sdk>uuid": {
@ -4047,6 +4089,7 @@
},
"eth-sig-util>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
@ -4054,8 +4097,7 @@
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"eth-sig-util>ethereumjs-util>ethjs-util": {
@ -4093,14 +4135,14 @@
},
"ethereumjs-abi>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-util>rlp": true
}
},
"ethereumjs-util": {
@ -4193,7 +4235,7 @@
},
"ethereumjs-util>ethereum-cryptography>hash.js": {
"packages": {
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -4225,7 +4267,7 @@
},
"ethereumjs-util>ethereum-cryptography>secp256k1": {
"packages": {
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"ethereumjs-util>rlp": {
@ -4271,14 +4313,14 @@
},
"ethereumjs-wallet>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-util>rlp": true
}
},
"ethereumjs-wallet>randombytes": {
@ -4477,33 +4519,6 @@
"define": true
}
},
"ganache>secp256k1>elliptic": {
"packages": {
"bn.js": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ganache>secp256k1>elliptic>brorand": true,
"ganache>secp256k1>elliptic>hmac-drbg": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"ganache>secp256k1>elliptic>minimalistic-crypto-utils": true,
"pumpify>inherits": true
}
},
"ganache>secp256k1>elliptic>brorand": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>browser-resolve": true
}
},
"ganache>secp256k1>elliptic>hmac-drbg": {
"packages": {
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"ganache>secp256k1>elliptic>minimalistic-crypto-utils": true
}
},
"globalthis>define-properties": {
"packages": {
"globalthis>define-properties>has-property-descriptors": true,

View File

@ -380,7 +380,7 @@
"@ethersproject/abi>@ethersproject/bytes": true,
"@ethersproject/abi>@ethersproject/logger": true,
"@ethersproject/abi>@ethersproject/properties": true,
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"@ethersproject/hdnode>@ethersproject/transactions": {
@ -1088,6 +1088,7 @@
},
"@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
@ -1095,8 +1096,7 @@
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-ledger-bridge-keyring>hdkey": {
@ -1111,11 +1111,11 @@
"@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": {
"packages": {
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>insert-module-globals>is-buffer": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": {
@ -1422,11 +1422,11 @@
"@metamask/eth-trezor-keyring>hdkey>secp256k1": {
"packages": {
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>insert-module-globals>is-buffer": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": {
@ -1802,6 +1802,33 @@
"eslint>optionator>fast-levenshtein": true
}
},
"@metamask/ppom-validator>elliptic": {
"packages": {
"@metamask/ppom-validator>elliptic>brorand": true,
"@metamask/ppom-validator>elliptic>hmac-drbg": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"bn.js": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"pumpify>inherits": true
}
},
"@metamask/ppom-validator>elliptic>brorand": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>browser-resolve": true
}
},
"@metamask/ppom-validator>elliptic>hmac-drbg": {
"packages": {
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true
}
},
"@metamask/rpc-methods": {
"packages": {
"@metamask/browser-passworder": true,
@ -2853,7 +2880,7 @@
},
"browserify>crypto-browserify>browserify-cipher>browserify-des>des.js": {
"packages": {
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -2865,6 +2892,7 @@
},
"browserify>crypto-browserify>browserify-sign": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"browserify>crypto-browserify>create-hmac": true,
@ -2872,15 +2900,14 @@
"browserify>crypto-browserify>public-encrypt>parse-asn1": true,
"browserify>stream-browserify": true,
"ethereumjs-util>create-hash": true,
"ganache>secp256k1>elliptic": true,
"pumpify>inherits": true
}
},
"browserify>crypto-browserify>create-ecdh": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"ganache>secp256k1>elliptic": true
"browserify>buffer": true
}
},
"browserify>crypto-browserify>create-hmac": {
@ -2903,8 +2930,8 @@
},
"browserify>crypto-browserify>diffie-hellman>miller-rabin": {
"packages": {
"bn.js": true,
"ganache>secp256k1>elliptic>brorand": true
"@metamask/ppom-validator>elliptic>brorand": true,
"bn.js": true
}
},
"browserify>crypto-browserify>pbkdf2": {
@ -2951,10 +2978,10 @@
},
"browserify>crypto-browserify>public-encrypt>parse-asn1>asn1.js": {
"packages": {
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"bn.js": true,
"browserify>buffer": true,
"browserify>vm-browserify": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -3315,6 +3342,7 @@
"packages": {
"@ethereumjs/common>crc-32": true,
"@ethersproject/abi": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"eth-lattice-keyring>gridplus-sdk>@ethereumjs/common": true,
@ -3331,7 +3359,6 @@
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ethereumjs-wallet>aes-js": true,
"ethereumjs-wallet>bs58check": true,
"ganache>secp256k1>elliptic": true,
"lodash": true
}
},
@ -3455,7 +3482,7 @@
},
"eth-lattice-keyring>gridplus-sdk>secp256k1": {
"packages": {
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"eth-lattice-keyring>gridplus-sdk>uuid": {
@ -3496,6 +3523,7 @@
},
"eth-sig-util>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
@ -3503,8 +3531,7 @@
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"eth-sig-util>ethereumjs-util>ethjs-util": {
@ -3542,14 +3569,14 @@
},
"ethereumjs-abi>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-util>rlp": true
}
},
"ethereumjs-util": {
@ -3642,7 +3669,7 @@
},
"ethereumjs-util>ethereum-cryptography>hash.js": {
"packages": {
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -3674,7 +3701,7 @@
},
"ethereumjs-util>ethereum-cryptography>secp256k1": {
"packages": {
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"ethereumjs-util>rlp": {
@ -3720,14 +3747,14 @@
},
"ethereumjs-wallet>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-util>rlp": true
}
},
"ethereumjs-wallet>randombytes": {
@ -3926,33 +3953,6 @@
"define": true
}
},
"ganache>secp256k1>elliptic": {
"packages": {
"bn.js": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ganache>secp256k1>elliptic>brorand": true,
"ganache>secp256k1>elliptic>hmac-drbg": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"ganache>secp256k1>elliptic>minimalistic-crypto-utils": true,
"pumpify>inherits": true
}
},
"ganache>secp256k1>elliptic>brorand": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>browser-resolve": true
}
},
"ganache>secp256k1>elliptic>hmac-drbg": {
"packages": {
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"ganache>secp256k1>elliptic>minimalistic-crypto-utils": true
}
},
"globalthis>define-properties": {
"packages": {
"globalthis>define-properties>has-property-descriptors": true,

View File

@ -380,7 +380,7 @@
"@ethersproject/abi>@ethersproject/bytes": true,
"@ethersproject/abi>@ethersproject/logger": true,
"@ethersproject/abi>@ethersproject/properties": true,
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"@ethersproject/hdnode>@ethersproject/transactions": {
@ -1316,6 +1316,7 @@
},
"@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
@ -1323,8 +1324,7 @@
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-ledger-bridge-keyring>hdkey": {
@ -1339,11 +1339,11 @@
"@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": {
"packages": {
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>insert-module-globals>is-buffer": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": {
@ -1650,11 +1650,11 @@
"@metamask/eth-trezor-keyring>hdkey>secp256k1": {
"packages": {
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>insert-module-globals>is-buffer": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": {
@ -2030,6 +2030,33 @@
"eslint>optionator>fast-levenshtein": true
}
},
"@metamask/ppom-validator>elliptic": {
"packages": {
"@metamask/ppom-validator>elliptic>brorand": true,
"@metamask/ppom-validator>elliptic>hmac-drbg": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"bn.js": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"pumpify>inherits": true
}
},
"@metamask/ppom-validator>elliptic>brorand": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>browser-resolve": true
}
},
"@metamask/ppom-validator>elliptic>hmac-drbg": {
"packages": {
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-crypto-utils": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true
}
},
"@metamask/rpc-methods": {
"packages": {
"@metamask/browser-passworder": true,
@ -3081,7 +3108,7 @@
},
"browserify>crypto-browserify>browserify-cipher>browserify-des>des.js": {
"packages": {
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -3093,6 +3120,7 @@
},
"browserify>crypto-browserify>browserify-sign": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"browserify>crypto-browserify>create-hmac": true,
@ -3100,15 +3128,14 @@
"browserify>crypto-browserify>public-encrypt>parse-asn1": true,
"browserify>stream-browserify": true,
"ethereumjs-util>create-hash": true,
"ganache>secp256k1>elliptic": true,
"pumpify>inherits": true
}
},
"browserify>crypto-browserify>create-ecdh": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"ganache>secp256k1>elliptic": true
"browserify>buffer": true
}
},
"browserify>crypto-browserify>create-hmac": {
@ -3131,8 +3158,8 @@
},
"browserify>crypto-browserify>diffie-hellman>miller-rabin": {
"packages": {
"bn.js": true,
"ganache>secp256k1>elliptic>brorand": true
"@metamask/ppom-validator>elliptic>brorand": true,
"bn.js": true
}
},
"browserify>crypto-browserify>pbkdf2": {
@ -3179,10 +3206,10 @@
},
"browserify>crypto-browserify>public-encrypt>parse-asn1>asn1.js": {
"packages": {
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"bn.js": true,
"browserify>buffer": true,
"browserify>vm-browserify": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -3543,6 +3570,7 @@
"packages": {
"@ethereumjs/common>crc-32": true,
"@ethersproject/abi": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>buffer": true,
"eth-lattice-keyring>gridplus-sdk>@ethereumjs/common": true,
@ -3559,7 +3587,6 @@
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ethereumjs-wallet>aes-js": true,
"ethereumjs-wallet>bs58check": true,
"ganache>secp256k1>elliptic": true,
"lodash": true
}
},
@ -3683,7 +3710,7 @@
},
"eth-lattice-keyring>gridplus-sdk>secp256k1": {
"packages": {
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"eth-lattice-keyring>gridplus-sdk>uuid": {
@ -3724,6 +3751,7 @@
},
"eth-sig-util>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
@ -3731,8 +3759,7 @@
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ethereumjs-wallet>safe-buffer": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-wallet>safe-buffer": true
}
},
"eth-sig-util>ethereumjs-util>ethjs-util": {
@ -3770,14 +3797,14 @@
},
"ethereumjs-abi>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-util>rlp": true
}
},
"ethereumjs-util": {
@ -3870,7 +3897,7 @@
},
"ethereumjs-util>ethereum-cryptography>hash.js": {
"packages": {
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"@metamask/ppom-validator>elliptic>minimalistic-assert": true,
"pumpify>inherits": true
}
},
@ -3902,7 +3929,7 @@
},
"ethereumjs-util>ethereum-cryptography>secp256k1": {
"packages": {
"ganache>secp256k1>elliptic": true
"@metamask/ppom-validator>elliptic": true
}
},
"ethereumjs-util>rlp": {
@ -3948,14 +3975,14 @@
},
"ethereumjs-wallet>ethereumjs-util": {
"packages": {
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"ganache>secp256k1>elliptic": true
"ethereumjs-util>rlp": true
}
},
"ethereumjs-wallet>randombytes": {
@ -4154,33 +4181,6 @@
"define": true
}
},
"ganache>secp256k1>elliptic": {
"packages": {
"bn.js": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ganache>secp256k1>elliptic>brorand": true,
"ganache>secp256k1>elliptic>hmac-drbg": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"ganache>secp256k1>elliptic>minimalistic-crypto-utils": true,
"pumpify>inherits": true
}
},
"ganache>secp256k1>elliptic>brorand": {
"globals": {
"crypto": true,
"msCrypto": true
},
"packages": {
"browserify>browser-resolve": true
}
},
"ganache>secp256k1>elliptic>hmac-drbg": {
"packages": {
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ganache>secp256k1>elliptic>minimalistic-assert": true,
"ganache>secp256k1>elliptic>minimalistic-crypto-utils": true
}
},
"globalthis>define-properties": {
"packages": {
"globalthis>define-properties>has-property-descriptors": true,

View File

@ -1,6 +1,6 @@
{
"name": "metamask-crx",
"version": "10.34.2",
"version": "10.34.4",
"private": true,
"repository": {
"type": "git",
@ -205,7 +205,7 @@
},
"dependencies": {
"@babel/runtime": "^7.18.9",
"@blockaid/ppom": "^0.1.2",
"@blockaid/ppom": "^1.0.2",
"@download/blockies": "^1.0.3",
"@ensdomains/content-hash": "^2.5.6",
"@ethereumjs/common": "^3.1.1",
@ -250,7 +250,7 @@
"@metamask/key-tree": "^9.0.0",
"@metamask/keyring-controller": "^7.0.0",
"@metamask/logo": "^3.1.1",
"@metamask/message-manager": "^7.0.2",
"@metamask/message-manager": "^7.3.0",
"@metamask/metamask-eth-abis": "^3.0.0",
"@metamask/network-controller": "^12.0.0",
"@metamask/notification-controller": "^3.0.0",
@ -258,21 +258,21 @@
"@metamask/permission-controller": "^4.0.0",
"@metamask/phishing-controller": "^6.0.0",
"@metamask/post-message-stream": "^6.0.0",
"@metamask/ppom-validator": "^0.1.2",
"@metamask/ppom-validator": "^0.2.0",
"@metamask/providers": "^11.1.0",
"@metamask/rate-limit-controller": "^3.0.0",
"@metamask/rpc-methods": "^1.0.0-prerelease.1",
"@metamask/rpc-methods": "^1.0.0",
"@metamask/rpc-methods-flask": "npm:@metamask/rpc-methods@0.37.2-flask.1",
"@metamask/safe-event-emitter": "^2.0.0",
"@metamask/scure-bip39": "^2.0.3",
"@metamask/signature-controller": "^5.3.0",
"@metamask/slip44": "^3.0.0",
"@metamask/smart-transactions-controller": "^4.0.0",
"@metamask/snaps-controllers": "^1.0.0-prerelease.1",
"@metamask/snaps-controllers": "^1.0.0",
"@metamask/snaps-controllers-flask": "npm:@metamask/snaps-controllers@0.38.0-flask.1",
"@metamask/snaps-ui": "^1.0.0-prerelease.1",
"@metamask/snaps-ui": "^1.0.0",
"@metamask/snaps-ui-flask": "npm:@metamask/snaps-ui@0.37.3-flask.1",
"@metamask/snaps-utils": "^1.0.0-prerelease.1",
"@metamask/snaps-utils": "^1.0.0",
"@metamask/snaps-utils-flask": "npm:@metamask/snaps-utils@0.38.0-flask.1",
"@metamask/subject-metadata-controller": "^2.0.0",
"@metamask/utils": "^5.0.0",
@ -358,7 +358,7 @@
"redux-thunk": "^2.3.0",
"remove-trailing-slash": "^0.1.1",
"reselect": "^3.0.1",
"ses": "^0.18.4",
"ses": "^0.18.7",
"single-call-balance-checker-abi": "^1.0.0",
"unicode-confusables": "^0.1.1",
"uuid": "^8.3.2",

View File

@ -138,6 +138,8 @@ export const CHAIN_IDS = {
BSC_TESTNET: '0x61',
OPTIMISM: '0xa',
OPTIMISM_TESTNET: '0x1a4',
BASE: '0x2105',
BASE_TESTNET: '0x14a33',
POLYGON: '0x89',
POLYGON_TESTNET: '0x13881',
AVALANCHE: '0xa86a',
@ -553,6 +555,8 @@ export const BUYABLE_CHAINS_MAP: {
ChainId,
| typeof CHAIN_IDS.LOCALHOST
| typeof CHAIN_IDS.OPTIMISM_TESTNET
| typeof CHAIN_IDS.BASE_TESTNET
| typeof CHAIN_IDS.BASE
| typeof CHAIN_IDS.BSC_TESTNET
| typeof CHAIN_IDS.POLYGON_TESTNET
| typeof CHAIN_IDS.AVALANCHE_TESTNET

View File

@ -49,8 +49,8 @@ export enum BlockaidReason {
other = 'other',
// Locally defined
notApplicable = 'NotApplicable',
failed = 'Failed',
notApplicable = 'NotApplicable',
}
export enum BlockaidResultType {

View File

@ -257,13 +257,18 @@ describe('MetaMask', function () {
});
await driver.delay(regularDelayMs);
await driver.fill('#custom-address', tokenAddress);
await driver.fill(
'[data-testid="import-tokens-modal-custom-address"]',
tokenAddress,
);
await driver.delay(regularDelayMs);
await driver.clickElement({ text: 'Add custom token', tag: 'button' });
await driver.clickElement({ text: 'Next', tag: 'button' });
await driver.delay(regularDelayMs);
await driver.clickElement({ text: 'Import tokens', tag: 'button' });
await driver.clickElement(
'[data-testid="import-tokens-modal-import-button"]',
);
await driver.delay(regularDelayMs);
});

View File

@ -108,13 +108,15 @@ describe('Add existing token using search', function () {
await driver.press('#password', driver.Key.ENTER);
await driver.clickElement({ text: 'Import tokens', tag: 'button' });
await driver.fill('#search-tokens', 'BAT');
await driver.fill('input[placeholder="Search"]', 'BAT');
await driver.clickElement({
text: 'BAT',
tag: 'span',
});
await driver.clickElement({ text: 'Next', tag: 'button' });
await driver.clickElement({ text: 'Import tokens', tag: 'button' });
await driver.clickElement(
'[data-testid="import-tokens-modal-import-button"]',
);
await driver.waitForSelector({
css: '.token-overview__primary-balance',

View File

@ -51,20 +51,24 @@ describe('Create token, approve token and approve token without gas', function (
text: 'Custom token',
tag: 'button',
});
await driver.fill('#custom-address', contractAddress);
await driver.waitForSelector('#custom-decimals');
await driver.fill(
'[data-testid="import-tokens-modal-custom-address"]',
contractAddress,
);
await driver.waitForSelector(
'[data-testid="import-tokens-modal-custom-decimals"]',
);
await driver.delay(2000);
await driver.clickElement({
text: 'Add custom token',
text: 'Next',
tag: 'button',
});
await driver.delay(2000);
await driver.clickElement({
text: 'Import tokens',
tag: 'button',
});
await driver.clickElement(
'[data-testid="import-tokens-modal-import-button"]',
);
// renders balance for newly created token
await driver.clickElement('.app-header__logo-container');

View File

@ -37,14 +37,20 @@ describe('Import flow', function () {
await driver.delay(regularDelayMs);
await driver.clickElement('[data-testid="import-token-button"]');
await driver.fill('input[placeholder="Search tokens"]', 'cha');
await driver.fill('input[placeholder="Search"]', 'cha');
await driver.clickElement('.token-list__token');
await driver.clickElement('.token-list__token:nth-of-type(2)');
await driver.clickElement('.token-list__token:nth-of-type(3)');
await driver.clickElement({ css: 'button', text: 'Next' });
await driver.clickElement({ css: 'button', text: 'Import' });
await driver.clickElement({
css: '.import-tokens-modal button',
text: 'Next',
});
await driver.clickElement({
css: '.import-tokens-modal button',
text: 'Import',
});
await driver.clickElement('.asset-breadcrumb');

View File

@ -30,11 +30,19 @@ describe('Token Details', function () {
const tokenAddress = '0x2EFA2Cb29C2341d8E5Ba7D3262C9e9d6f1Bf3711';
const tokenSymbol = 'AAVE';
await driver.fill('#custom-address', tokenAddress);
await driver.waitForSelector('#custom-symbol-helper-text');
await driver.fill('#custom-symbol', tokenSymbol);
await driver.clickElement({ text: 'Add custom token', tag: 'button' });
await driver.clickElement({ text: 'Import tokens', tag: 'button' });
await driver.fill(
'[data-testid="import-tokens-modal-custom-address"]',
tokenAddress,
);
await driver.waitForSelector('p.mm-box--color-error-default');
await driver.fill(
'[data-testid="import-tokens-modal-custom-symbol"]',
tokenSymbol,
);
await driver.clickElement({ text: 'Next', tag: 'button' });
await driver.clickElement(
'[data-testid="import-tokens-modal-import-button"]',
);
await driver.clickElement('[aria-label="Asset options"]');
await driver.clickElement({ text: 'Token details', tag: 'div' });

View File

@ -11,6 +11,7 @@
@import 'confirm-data/index';
@import 'confirmation-warning-modal/index';
@import 'custom-nonce/index';
@import 'import-token/index';
@import 'nfts-items/index';
@import 'nfts-tab/index';
@import 'nft-details/index';

View File

@ -0,0 +1 @@
@import 'token-list/index';

View File

@ -1,5 +1,3 @@
@import 'token-list-placeholder/index';
.token-list {
&__title {
@include H7;

View File

@ -0,0 +1,35 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import ZENDESK_URLS from '../../../../../helpers/constants/zendesk-url';
import { ButtonLink, Text, Box } from '../../../../component-library';
import {
Display,
FlexDirection,
TextAlign,
TextColor,
AlignItems,
} from '../../../../../helpers/constants/design-system';
export default class TokenListPlaceholder extends Component {
static contextTypes = {
t: PropTypes.func,
};
render() {
return (
<Box
display={Display.Flex}
alignItems={AlignItems.center}
flexDirection={FlexDirection.Column}
textAlign={TextAlign.Center}
>
<Text color={TextColor.textAlternative}>
{this.context.t('addAcquiredTokens')}
</Text>
<ButtonLink href={ZENDESK_URLS.ADD_CUSTOM_TOKENS} externalLink>
{this.context.t('learnMoreUpperCase')}
</ButtonLink>
</Box>
);
}
}

View File

@ -2,7 +2,7 @@ import React from 'react';
import TokenListPlaceholder from './token-list-placeholder.component';
export default {
title: 'Pages/ImportToken/TokenList/TokenListPlaceholder',
title: 'Components/App/TokenList/TokenListPlaceholder',
};
export const DefaultStory = () => {

View File

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { checkExistingAddresses } from '../../../helpers/utils/util';
import { checkExistingAddresses } from '../../../../helpers/utils/util';
import TokenListPlaceholder from './token-list-placeholder';
export default class TokenList extends Component {

View File

@ -1,10 +1,9 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Fuse from 'fuse.js';
import InputAdornment from '@material-ui/core/InputAdornment';
import TextField from '../../../components/ui/text-field';
import { isEqualCaseInsensitive } from '../../../../shared/modules/string-utils';
import SearchIcon from '../../../components/ui/icon/search-icon';
import { isEqualCaseInsensitive } from '../../../../../shared/modules/string-utils';
import { TextFieldSearch } from '../../../component-library';
import { BlockSize } from '../../../../helpers/constants/design-system';
export default class TokenSearch extends Component {
static contextTypes = {
@ -57,30 +56,19 @@ export default class TokenSearch extends Component {
this.props.onSearch({ searchQuery, results });
}
renderAdornment() {
return (
<InputAdornment position="start" style={{ marginRight: '12px' }}>
<SearchIcon color="var(--color-icon-muted)" />
</InputAdornment>
);
}
render() {
const { error } = this.props;
const { searchQuery } = this.state;
return (
<TextField
id="search-tokens"
placeholder={this.context.t('searchTokens')}
type="text"
<TextFieldSearch
placeholder={this.context.t('search')}
value={searchQuery}
onChange={(e) => this.handleSearch(e.target.value)}
error={error}
fullWidth
autoFocus
autoComplete="off"
startAdornment={this.renderAdornment()}
autoComplete={false}
width={BlockSize.Full}
/>
);
}

View File

@ -1,9 +1,9 @@
import React from 'react';
import testData from '../../../../.storybook/test-data';
import testData from '../../../../../.storybook/test-data';
import TokenSearch from './token-search.component';
export default {
title: 'Pages/ImportToken/TokenSearch',
title: 'Components/App/ImportToken/TokenSearch',
argTypes: {
error: {

View File

@ -9,6 +9,7 @@ import {
ButtonLink,
ButtonPrimary,
ButtonSecondary,
ButtonSecondarySize,
FormTextField,
Icon,
IconName,
@ -152,7 +153,11 @@ const EthSignModal = ({ hideModal }) => {
gap={4}
marginTop={6}
>
<ButtonSecondary onClick={() => hideModal()} size={Size.LG} block>
<ButtonSecondary
onClick={() => hideModal()}
size={ButtonSecondarySize.Lg}
block
>
{t('cancel')}
</ButtonSecondary>
{showTextField ? (

View File

@ -2,6 +2,10 @@
&__collection {
margin-bottom: 24px;
&:last-child {
margin-bottom: 0;
}
&-accordion-title {
cursor: pointer;
}

View File

@ -59,7 +59,7 @@ exports[`Security Provider Banner Alert should match snapshot 1`] = `
</details>
</div>
<p
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-2 mm-box--align-items-center mm-box--color-text-alternative"
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-3 mm-box--display-flex mm-box--align-items-center mm-box--color-text-alternative"
>
<span
class="mm-box disclosure__summary--icon mm-icon mm-icon--size-sm mm-box--margin-inline-end-1 mm-box--display-inline-block mm-box--color-primary-default"

View File

@ -21,7 +21,7 @@ exports[`Blockaid Banner Alert should render 'danger' UI when securityAlertRespo
If you approve this request, a third party known for scams might take all your assets.
</p>
<p
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-2 mm-box--align-items-center mm-box--color-text-alternative"
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-3 mm-box--display-flex mm-box--align-items-center mm-box--color-text-alternative"
>
<span
class="mm-box disclosure__summary--icon mm-icon mm-icon--size-sm mm-box--margin-inline-end-1 mm-box--display-inline-block mm-box--color-primary-default"
@ -46,6 +46,30 @@ exports[`Blockaid Banner Alert should render 'danger' UI when securityAlertRespo
</div>
`;
exports[`Blockaid Banner Alert should render 'warning' UI when securityAlertResponse.result_type is 'Failed 1`] = `
<div
class="box mm-banner-base mm-banner-alert mm-banner-alert--severity-warning box--margin-4 box--padding-3 box--padding-left-2 box--display-flex box--gap-2 box--flex-direction-row box--background-color-warning-muted box--rounded-sm"
>
<span
class="mm-box mm-icon mm-icon--size-lg mm-box--display-inline-block mm-box--color-warning-default"
style="mask-image: url('./images/icons/warning.svg');"
/>
<div>
<h5
class="mm-box mm-text mm-banner-base__title mm-text--body-lg-medium mm-box--color-text-default"
data-testid="mm-banner-base-title"
>
This is a deceptive request
</h5>
<p
class="mm-box mm-text mm-text--body-md mm-box--margin-top-2 mm-box--color-text-default"
>
If you approve this request, a third party known for scams might take all your assets.
</p>
</div>
</div>
`;
exports[`Blockaid Banner Alert should render 'warning' UI when securityAlertResponse.result_type is 'Warning 1`] = `
<div
class="box mm-banner-base mm-banner-alert mm-banner-alert--severity-warning box--margin-4 box--padding-3 box--padding-left-2 box--display-flex box--gap-2 box--flex-direction-row box--background-color-warning-muted box--rounded-sm"
@ -67,7 +91,7 @@ exports[`Blockaid Banner Alert should render 'warning' UI when securityAlertResp
If you approve this request, a third party known for scams might take all your assets.
</p>
<p
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-2 mm-box--align-items-center mm-box--color-text-alternative"
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-3 mm-box--display-flex mm-box--align-items-center mm-box--color-text-alternative"
>
<span
class="mm-box disclosure__summary--icon mm-icon mm-icon--size-sm mm-box--margin-inline-end-1 mm-box--display-inline-block mm-box--color-primary-default"
@ -152,7 +176,7 @@ exports[`Blockaid Banner Alert should render details when provided 1`] = `
</details>
</div>
<p
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-2 mm-box--align-items-center mm-box--color-text-alternative"
class="mm-box mm-text mm-text--body-sm mm-box--margin-top-3 mm-box--display-flex mm-box--align-items-center mm-box--color-text-alternative"
>
<span
class="mm-box disclosure__summary--icon mm-icon mm-icon--size-sm mm-box--margin-inline-end-1 mm-box--display-inline-block mm-box--color-primary-default"

View File

@ -21,6 +21,8 @@ const REASON_TO_DESCRIPTION_TKEY = Object.freeze({
[BlockaidReason.blurFarming]: 'blockaidDescriptionBlurFarming',
[BlockaidReason.failed]: 'blockaidDescriptionFailed',
[BlockaidReason.seaportFarming]: 'blockaidDescriptionSeaportFarming',
[BlockaidReason.maliciousDomain]: 'blockaidDescriptionMaliciousDomain',
@ -36,8 +38,11 @@ const REASON_TO_DESCRIPTION_TKEY = Object.freeze({
[BlockaidReason.other]: 'blockaidDescriptionMightLoseAssets',
});
/** List of suspicious reason(s). Other reasons will be deemed as deceptive. */
const SUSPCIOUS_REASON = [BlockaidReason.rawSignatureFarming];
/** Reason to title translation key mapping. */
const REASON_TO_TITLE_TKEY = Object.freeze({
[BlockaidReason.failed]: 'blockaidTitleMayNotBeSafe',
[BlockaidReason.rawSignatureFarming]: 'blockaidTitleSuspicious',
});
function BlockaidBannerAlert({ securityAlertResponse }) {
const t = useContext(I18nContext);
@ -48,10 +53,7 @@ function BlockaidBannerAlert({ securityAlertResponse }) {
const { reason, result_type: resultType, features } = securityAlertResponse;
if (
resultType === BlockaidResultType.Benign ||
resultType === BlockaidResultType.Failed
) {
if (resultType === BlockaidResultType.Benign) {
return null;
}
@ -69,21 +71,20 @@ function BlockaidBannerAlert({ securityAlertResponse }) {
</Text>
);
const isFailedResultType = resultType === BlockaidResultType.Failed;
const severity =
resultType === BlockaidResultType.Malicious
? Severity.Danger
: Severity.Warning;
const title =
SUSPCIOUS_REASON.indexOf(reason) > -1
? t('blockaidTitleSuspicious')
: t('blockaidTitleDeceptive');
const title = t(REASON_TO_TITLE_TKEY[reason] || 'blockaidTitleDeceptive');
return (
<SecurityProviderBannerAlert
description={description}
details={details}
provider={SecurityProvider.Blockaid}
provider={isFailedResultType ? null : SecurityProvider.Blockaid}
severity={severity}
title={title}
/>

View File

@ -40,7 +40,7 @@ describe('Blockaid Banner Alert', () => {
expect(container.querySelector('.mm-banner-alert')).toBeNull();
});
it(`should not render when securityAlertResponse.result_type is '${BlockaidResultType.Failed}'`, () => {
it(`should render '${Severity.Warning}' UI when securityAlertResponse.result_type is '${BlockaidResultType.Failed}`, () => {
const { container } = renderWithLocalization(
<BlockaidBannerAlert
securityAlertResponse={{
@ -49,8 +49,24 @@ describe('Blockaid Banner Alert', () => {
}}
/>,
);
const warningBannerAlert = container.querySelector(
'.mm-banner-alert--severity-warning',
);
expect(container.querySelector('.mm-banner-alert')).toBeNull();
expect(warningBannerAlert).toBeInTheDocument();
expect(warningBannerAlert).toMatchSnapshot();
});
it(`should render '${Severity.Warning}' UI when securityAlertResponse.result_type is '${BlockaidResultType.Warning}`, () => {
const { container } = renderWithLocalization(
<BlockaidBannerAlert securityAlertResponse={mockSecurityAlertResponse} />,
);
const warningBannerAlert = container.querySelector(
'.mm-banner-alert--severity-warning',
);
expect(warningBannerAlert).toBeInTheDocument();
expect(warningBannerAlert).toMatchSnapshot();
});
it(`should render '${Severity.Danger}' UI when securityAlertResponse.result_type is '${BlockaidResultType.Malicious}`, () => {
@ -70,18 +86,6 @@ describe('Blockaid Banner Alert', () => {
expect(dangerBannerAlert).toMatchSnapshot();
});
it(`should render '${Severity.Warning}' UI when securityAlertResponse.result_type is '${BlockaidResultType.Warning}`, () => {
const { container } = renderWithLocalization(
<BlockaidBannerAlert securityAlertResponse={mockSecurityAlertResponse} />,
);
const warningBannerAlert = container.querySelector(
'.mm-banner-alert--severity-warning',
);
expect(warningBannerAlert).toBeInTheDocument();
expect(warningBannerAlert).toMatchSnapshot();
});
it('should render title, "This is a deceptive request"', () => {
const { getByText } = renderWithLocalization(
<BlockaidBannerAlert securityAlertResponse={mockSecurityAlertResponse} />,
@ -90,7 +94,20 @@ describe('Blockaid Banner Alert', () => {
expect(getByText('This is a deceptive request')).toBeInTheDocument();
});
it('should render title, "This is a suspicious request", when the reason is "raw_signature_farming"', () => {
it(`should render title, "This is a suspicious request", when the reason is "${BlockaidReason.failed}"`, () => {
const { getByText } = renderWithLocalization(
<BlockaidBannerAlert
securityAlertResponse={{
...mockSecurityAlertResponse,
reason: BlockaidReason.failed,
}}
/>,
);
expect(getByText('Request may not be safe')).toBeInTheDocument();
});
it(`should render title, "This is a suspicious request", when the reason is "${BlockaidReason.rawSignatureFarming}"`, () => {
const { getByText } = renderWithLocalization(
<BlockaidBannerAlert
securityAlertResponse={{
@ -131,6 +148,8 @@ describe('Blockaid Banner Alert', () => {
'If you approve this request, a third party known for scams might take all your assets.',
[BlockaidReason.blurFarming]:
'If you approve this request, someone can steal your assets listed on Blur.',
[BlockaidReason.failed]:
'Because of an error, this request was not verified by the security provider. Proceed with caution.',
[BlockaidReason.maliciousDomain]:
"You're interacting with a malicious domain. If you approve this request, you might lose your assets.",
[BlockaidReason.other]:

View File

@ -15,6 +15,7 @@ import { I18nContext } from '../../../contexts/i18n';
import {
AlignItems,
Color,
Display,
IconColor,
Severity,
Size,
@ -45,8 +46,10 @@ function SecurityProviderBannerAlert({
</Disclosure>
)}
{provider && (
<Text
marginTop={2}
marginTop={3}
display={Display.Flex}
alignItems={AlignItems.center}
color={Color.textAlternative}
variant={TextVariant.bodySm}
@ -69,6 +72,7 @@ function SecurityProviderBannerAlert({
</ButtonLink>,
])}
</Text>
)}
</BannerAlert>
);
}
@ -78,9 +82,6 @@ SecurityProviderBannerAlert.propTypes = {
description: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
.isRequired,
/** Name of the security provider */
provider: PropTypes.oneOfType(Object.values(SecurityProvider)).isRequired,
/** Severity level */
severity: PropTypes.oneOfType([Severity.Danger, Severity.Warning]).isRequired,
@ -93,6 +94,9 @@ SecurityProviderBannerAlert.propTypes = {
/** Additional details to be displayed under the description */
details: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
/** Name of the security provider */
provider: PropTypes.oneOfType(Object.values(SecurityProvider)),
};
export default SecurityProviderBannerAlert;

View File

@ -53,7 +53,10 @@ export default {
control: {
type: 'select',
},
options: [Object.values(SecurityProvider)],
options: ['none', ...Object.values(SecurityProvider)],
mapping: {
none: null,
},
},
severity: {
control: {

View File

@ -1,41 +0,0 @@
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
import SnapSettingsCard from '.';
# SnapSettingsCard
A card component that displays information and the status of a snap. The `SnapSettingsCard` component is made up of the `Card`, `IconBorder`, `IconWithFallback`, `ToggleButton`, `Chip`, `ColorIndicator` and `Button` components
<Canvas>
<Story id="components-app-flask-snapsettingscard--default-story" />
</Canvas>
## Props
<ArgsTable of={SnapSettingsCard} />
## Usage
The following describes the props and example usage for this component.
### Status
There are 4 statuses the `SnapSettingsCard` can have: `'installing'`,`'running'`,`'stopped'` and `'crashed'`.
<Canvas>
<Story id="components-app-flask-snapsettingscard--status" />
</Canvas>
### isEnabled / onToggle
Use the `isEnabled` and `onToggle` to control the `ToggleButton` component inside of the `SnapSettingsCard`
```jsx
const [isEnabled, setIsEnabled] = React.useState(false);
const handleOnToggle = () => {
setIsEnabled(!isEnabled);
};
return <SnapSettingsCard isEnabled={isEnabled} onToggle={handleOnToggle} />;
```

View File

@ -1,42 +1,46 @@
import React from 'react';
import PropTypes from 'prop-types';
import Box from '../../../ui/box';
import {
Color,
AlignItems,
JustifyContent,
DISPLAY,
BLOCK_SIZES,
Display,
BlockSize,
IconColor,
TextVariant,
} from '../../../../helpers/constants/design-system';
import { Icon, IconName, IconSize, Text } from '../../../component-library';
import {
Icon,
IconName,
IconSize,
Text,
Box,
} from '../../../component-library';
import SnapAvatar from '../snap-avatar';
const SnapSettingsCard = ({ name, packageName, onClick, snapId }) => {
return (
<Box
className="snap-settings-card"
display={DISPLAY.FLEX}
display={Display.Flex}
alignItems={AlignItems.center}
justifyContent={JustifyContent.spaceBetween}
width={BLOCK_SIZES.FULL}
padding={[4, 4, 4, 4]}
width={BlockSize.Full}
padding={4}
>
<Box
className="snap-settings-card__inner-wrapper"
display={DISPLAY.FLEX}
display={Display.Flex}
alignItems={AlignItems.center}
justifyContent={JustifyContent.flexStart}
width={BLOCK_SIZES.FULL}
width={BlockSize.Full}
onClick={onClick}
>
<Box>
<SnapAvatar snapId={snapId} />
</Box>
<Box paddingLeft={4} paddingRight={4} width={BLOCK_SIZES.FULL}>
<Box paddingLeft={4} paddingRight={4} width={BlockSize.Full}>
<Text
className="snap-settings-card__title"
color={Color.textDefault}
@ -66,7 +70,7 @@ const SnapSettingsCard = ({ name, packageName, onClick, snapId }) => {
SnapSettingsCard.propTypes = {
/**
* Name of the snap used for the title of the card and fallback letter for the snap icon
* Name of the snap
*/
name: PropTypes.string,
/**
@ -74,7 +78,7 @@ SnapSettingsCard.propTypes = {
*/
packageName: PropTypes.string,
/**
* onClick function of the "See Details" Button
* onClick event handler
*/
onClick: PropTypes.func,
/**
@ -82,5 +86,4 @@ SnapSettingsCard.propTypes = {
*/
snapId: PropTypes.string.isRequired,
};
export default SnapSettingsCard;

View File

@ -1,152 +1,30 @@
import React from 'react';
import { useArgs } from '@storybook/client-api';
import README from './README.mdx';
import SnapSettingsCard from '.';
export default {
title: 'Components/App/Snaps/SnapSettingsCard',
component: SnapSettingsCard,
parameters: {
docs: {
page: README,
},
},
argTypes: {
name: {
control: 'text',
},
description: {
packageName: {
control: 'text',
},
icon: {
control: 'text',
},
dateAdded: {
control: 'text',
},
version: {
control: 'text',
},
url: {
control: 'text',
},
onToggle: {
action: 'onToggle',
},
isEnabled: {
control: 'boolean',
},
onClick: {
action: 'onClick',
},
status: {
control: {
type: 'select',
snapId: {
control: 'text',
},
options: ['installing', 'stopped', 'running', 'crashed'],
},
className: {
control: 'string',
},
cardProps: {
control: 'object',
},
toggleButtonProps: {
control: 'object',
},
buttonProps: {
control: 'object',
},
chipProps: {
control: 'object',
},
args: {
name: 'Snap Name',
packageName: 'Snap Package Name',
snapId: 'npm:@metamask/test-snap-bip44',
},
};
export const DefaultStory = (args) => {
const [{ isEnabled }, updateArgs] = useArgs();
const handleOnToggle = () => {
updateArgs({
isEnabled: !isEnabled,
status: isEnabled ? 'stopped' : 'running',
});
};
return (
<SnapSettingsCard
{...args}
isEnabled={isEnabled}
onToggle={handleOnToggle}
/>
);
};
export const DefaultStory = (args) => <SnapSettingsCard {...args} />;
DefaultStory.storyName = 'Default';
let d = new Date();
d = d.toDateString();
DefaultStory.args = {
name: 'Snap name',
description:
'This snap provides developers everywhere access to an entirely new data storage paradigm, even letting your programs store data autonomously.',
icon: 'AST.png',
dateAdded: d,
version: '10.5.1234',
url: 'https://metamask.io/',
status: 'stopped',
};
export const Status = () => (
<>
<SnapSettingsCard
name="Installing snap"
description="This snap is Installing"
icon="AST.png"
dateAdded={d}
version="10.5.1234"
url="https://metamask.io/"
status="installing"
cardProps={{
marginBottom: 3,
}}
/>
<SnapSettingsCard
isEnabled
name="Running snap"
description="This snap is Running"
icon="AST.png"
dateAdded={d}
version="10.5.1234"
url="https://metamask.io/"
status="running"
cardProps={{
marginBottom: 3,
}}
/>
<SnapSettingsCard
name="Stopped snap"
description="This snap is stopped"
icon="AST.png"
dateAdded={d}
version="10.5.1234"
url="https://metamask.io/"
status="stopped"
cardProps={{
marginBottom: 3,
}}
/>
<SnapSettingsCard
isEnabled
name="Crashed snap"
description="This snap is Crashed"
icon="AST.png"
dateAdded={d}
version="10.5.1234"
url="https://metamask.io/"
status="crashed"
/>
</>
);

View File

@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { getWeightedPermissions } from '../../../../helpers/utils/permission';
import { useI18nContext } from '../../../../hooks/useI18nContext';
import PermissionCell from '../../permission-cell';
import Box from '../../../ui/box';
import { Box } from '../../../component-library';
export default function UpdateSnapPermissionList({
approvedPermissions,

View File

@ -2,21 +2,23 @@ import React from 'react';
import UpdateSnapPermissionList from './update-snap-permission-list';
export default {
title: 'Components/App/UpdateSnapPermissionList',
title: 'Components/App/Snaps/UpdateSnapPermissionList',
component: UpdateSnapPermissionList,
argTypes: {
permissions: {
approvedPermissions: {
control: 'object',
},
revokedPermissions: {
control: 'object',
},
newPermissions: {
control: 'object',
},
targetSubjectMetadata: {
control: 'object',
},
},
};
export const DefaultStory = (args) => <UpdateSnapPermissionList {...args} />;
DefaultStory.storyName = 'Default';
DefaultStory.args = {
args: {
approvedPermissions: {
'endowment:network-access': {
date: 1620710693178,
@ -48,4 +50,17 @@ DefaultStory.args = {
date: 1620710693178,
},
},
targetSubjectMetadata: {
extensionId: null,
iconUrl: null,
name: 'TypeScript Example Snap',
origin: 'local:http://localhost:8080',
subjectType: 'snap',
version: '0.2.2',
},
},
};
export const DefaultStory = (args) => <UpdateSnapPermissionList {...args} />;
DefaultStory.storyName = 'Default';

View File

@ -10,7 +10,7 @@ import { useEqualityCheck } from '../../../hooks/useEqualityCheck';
import Popover from '../../ui/popover';
import {
Text,
Button,
ButtonPrimary,
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
IconName,
///: END:ONLY_INCLUDE_IN
@ -202,8 +202,7 @@ const renderFirstNotification = ({
</div>
{placeImageBelowDescription && imageComponent}
{actionText && (
<Button
type="primary"
<ButtonPrimary
className="whats-new-popup__button"
onClick={() => {
actionFunction();
@ -212,14 +211,15 @@ const renderFirstNotification = ({
event: MetaMetricsEventName.WhatsNewClicked,
});
}}
block
>
{actionText}
</Button>
</ButtonPrimary>
)}
{
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
customButton && customButton.name === 'mmi-portfolio' && (
<Button
<ButtonPrimary
className="whats-new-popup__button"
data-testid="view-mmi-portfolio"
size={Size.SM}
@ -229,9 +229,10 @@ const renderFirstNotification = ({
onClose();
window.open(mmiPortfolioUrl, '_blank');
}}
block
>
{customButton.text}
</Button>
</ButtonPrimary>
)
///: END:ONLY_INCLUDE_IN
}

View File

@ -0,0 +1,16 @@
import React from 'react';
import WhatsNewPopup from '.';
export default {
title: 'Components/Multichain/WhatsNewPopup',
component: WhatsNewPopup,
argTypes: {
onClose: {
action: 'onClose',
},
},
};
export const DefaultStory = (args) => <WhatsNewPopup {...args} />;
DefaultStory.storyName = 'Default';

View File

@ -12,33 +12,28 @@ The `ButtonSecondary` is an extension of `ButtonBase` to support secondary style
## Props
The `ButtonSecondary` accepts all props below as well as all [Box](/docs/components-ui-box--default-story#props) and [ButtonBase](/docs/components-componentlibrary-buttonbase--default-story#props) component props
<ArgsTable of={ButtonSecondary} />
### Size
Use the `size` prop and the `Size` object from `./ui/helpers/constants/design-system.js` to change the size of `ButtonSecondary`. Defaults to `Size.MD`
Optional: `BUTTON_SIZES` from `./button-base` object can be used instead of `Size`.
Use the `size` prop and the `ButtonSecondarySize` enum from `./ui/components/component-library` to change the size of `ButtonSecondary`. Defaults to `ButtonSecondarySize.Md`
Possible sizes include:
- `Size.SM` 32px
- `Size.MD` 40px
- `Size.LG` 48px
- `ButtonSecondarySize.Sm` 32px
- `ButtonSecondarySize.Md` 40px
- `ButtonSecondarySize.Lg` 48px
<Canvas>
<Story id="components-componentlibrary-buttonsecondary--size-story" />
</Canvas>
```jsx
import { Size } from '../../../helpers/constants/design-system';
import { ButtonSecondary } from '../../component-library';
import { ButtonSecondary, ButtonSecondarySize } from '../../component-library';
<ButtonSecondary size={Size.SM} />
<ButtonSecondary size={Size.MD} />
<ButtonSecondary size={Size.LG} />
<ButtonSecondary size={ButtonSecondarySize.Sm} />
<ButtonSecondary size={ButtonSecondarySize.Md} />
<ButtonSecondary size={ButtonSecondarySize.Lg} />
```
### Danger

View File

@ -1,7 +0,0 @@
import { Size } from '../../../helpers/constants/design-system';
export const BUTTON_SECONDARY_SIZES = {
SM: Size.SM,
MD: Size.MD,
LG: Size.LG,
};

Some files were not shown because too many files have changed in this diff Show More