From 402db4e94ee05acfb08075e3f52cb107f587fdad Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Thu, 28 Apr 2022 22:32:12 +0000 Subject: [PATCH 001/308] Version v10.15.0 --- CHANGELOG.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d271b47a3b86..47decfa34082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,51 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [10.15.0] +### Uncategorized +- Unit test proptype ([#14509](https://github.com/MetaMask/metamask-extension/pull/14509)) +- Sync `master` with `develop` ([#14562](https://github.com/MetaMask/metamask-extension/pull/14562)) +- Revert "Revert "Dark Mode: What's New Announcement ([#14346](https://github.com/MetaMask/metamask-extension/pull/14346)) +- Merge remote-tracking branch 'origin/develop' into master-sync +- Lavamoat - protect all UI contexts ([#14537](https://github.com/MetaMask/metamask-extension/pull/14537)) +- snaps-skunkworks@0.11.1 ([#14531](https://github.com/MetaMask/metamask-extension/pull/14531)) +- Updating text/muted to text/alternative for select text on home screen ([#14553](https://github.com/MetaMask/metamask-extension/pull/14553)) +- Dark Mode : Add OS option in theme selection dropdown ([#14379](https://github.com/MetaMask/metamask-extension/pull/14379)) +- Update Dark Mode What's New message ([#14535](https://github.com/MetaMask/metamask-extension/pull/14535)) +- Adding 'Swaps' to metametrics event categories ([#14538](https://github.com/MetaMask/metamask-extension/pull/14538)) +- Create new e2e test for bip-44 snap in test-snaps ([#14440](https://github.com/MetaMask/metamask-extension/pull/14440)) +- Warn about multiple MetaMask instances running ([#13836](https://github.com/MetaMask/metamask-extension/pull/13836)) +- Fixed API for watchAsset ([#14545](https://github.com/MetaMask/metamask-extension/pull/14545)) +- Rename NotificationController to AnnouncementController ([#14389](https://github.com/MetaMask/metamask-extension/pull/14389)) +- Adjust package version to 10.13.0 ([#14540](https://github.com/MetaMask/metamask-extension/pull/14540)) +- Add token standard to custom token details ([#14506](https://github.com/MetaMask/metamask-extension/pull/14506)) +- lavamoat@6 - update to secure package naming ([#14488](https://github.com/MetaMask/metamask-extension/pull/14488)) +- Fixing 'Learn more' casing on import token screen ([#14529](https://github.com/MetaMask/metamask-extension/pull/14529)) +- call controller methods directly in send duck ([#14465](https://github.com/MetaMask/metamask-extension/pull/14465)) +- show token approval details on confirm approve screen by default ([#14523](https://github.com/MetaMask/metamask-extension/pull/14523)) +- i18n - remove unused locale strings ([#14527](https://github.com/MetaMask/metamask-extension/pull/14527)) +- Do not show failed off-chain transactions details when grouped with another valid transaction of same nonce ([#14497](https://github.com/MetaMask/metamask-extension/pull/14497)) +- Update for a new Add network page ([#13866](https://github.com/MetaMask/metamask-extension/pull/13866)) +- Update display of switching current network ([#13450](https://github.com/MetaMask/metamask-extension/pull/13450)) +- Ensure network name in confirm page container is defined ([#14520](https://github.com/MetaMask/metamask-extension/pull/14520)) +- New Crowdin translations by Github Action ([#13556](https://github.com/MetaMask/metamask-extension/pull/13556)) +- MetaMetrics: Add EVENT.CATEGORIES const ([#14474](https://github.com/MetaMask/metamask-extension/pull/14474)) +- Update tx data for simpleSends and add isBestQuote to swaps data ([#14496](https://github.com/MetaMask/metamask-extension/pull/14496)) +- Feature/remove bitmask ([#14489](https://github.com/MetaMask/metamask-extension/pull/14489)) +- MetaMetrics: add 'number_of_nfts' user trait ([#14495](https://github.com/MetaMask/metamask-extension/pull/14495)) +- Add testnet name as prefix for native currency of preloaded testnets ([#14454](https://github.com/MetaMask/metamask-extension/pull/14454)) +- Fix ESLint config around files w/ CommonJS imports ([#14380](https://github.com/MetaMask/metamask-extension/pull/14380)) +- Add new token added event (duplicating the existing event structure) when collectible is manually added ([#14279](https://github.com/MetaMask/metamask-extension/pull/14279)) +- increase test coverage of nonce sorted transaction selector ([#14486](https://github.com/MetaMask/metamask-extension/pull/14486)) +- Fix the alerts toggles in settings ([#14498](https://github.com/MetaMask/metamask-extension/pull/14498)) +- Disable swaps whenever the environment is not development or testing, so that behaviour follows production for QA purposes ([#14499](https://github.com/MetaMask/metamask-extension/pull/14499)) +- E2e test timeout ([#14483](https://github.com/MetaMask/metamask-extension/pull/14483)) +- Stop storing request and response objects in the permission activity log ([#14485](https://github.com/MetaMask/metamask-extension/pull/14485)) +- increase test coverage of nonce sorted transaction selector ([#14479](https://github.com/MetaMask/metamask-extension/pull/14479)) +- bump crowdin/github-action ([#14475](https://github.com/MetaMask/metamask-extension/pull/14475)) +- E2e readme docs ([#14434](https://github.com/MetaMask/metamask-extension/pull/14434)) +- E2e connected state ([#14444](https://github.com/MetaMask/metamask-extension/pull/14444)) + ## [10.14.0] ### Added - **[FLASK]** Add snap version to details page ([#14110](https://github.com/MetaMask/metamask-extension/pull/14110)) @@ -2908,7 +2953,8 @@ 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.14.0...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.15.0...HEAD +[10.15.0]: https://github.com/MetaMask/metamask-extension/compare/v10.14.0...v10.15.0 [10.14.0]: https://github.com/MetaMask/metamask-extension/compare/v10.13.0...v10.14.0 [10.13.0]: https://github.com/MetaMask/metamask-extension/compare/v10.12.4...v10.13.0 [10.12.4]: https://github.com/MetaMask/metamask-extension/compare/v10.12.3...v10.12.4 diff --git a/package.json b/package.json index 0c6be99121d2..36f9abbb847c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.14.0", + "version": "10.15.0", "private": true, "repository": { "type": "git", From 2a3b77c95fe048760af0835b6688048bdc11191b Mon Sep 17 00:00:00 2001 From: ryanml Date: Mon, 2 May 2022 23:07:23 -0700 Subject: [PATCH 002/308] [skip e2e] Update changelog for v10.15.0 (#14593) --- CHANGELOG.md | 55 +++++++++++++--------------------------------------- 1 file changed, 13 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47decfa34082..69b03943e5e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,49 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## [10.15.0] -### Uncategorized -- Unit test proptype ([#14509](https://github.com/MetaMask/metamask-extension/pull/14509)) -- Sync `master` with `develop` ([#14562](https://github.com/MetaMask/metamask-extension/pull/14562)) -- Revert "Revert "Dark Mode: What's New Announcement ([#14346](https://github.com/MetaMask/metamask-extension/pull/14346)) -- Merge remote-tracking branch 'origin/develop' into master-sync -- Lavamoat - protect all UI contexts ([#14537](https://github.com/MetaMask/metamask-extension/pull/14537)) -- snaps-skunkworks@0.11.1 ([#14531](https://github.com/MetaMask/metamask-extension/pull/14531)) -- Updating text/muted to text/alternative for select text on home screen ([#14553](https://github.com/MetaMask/metamask-extension/pull/14553)) -- Dark Mode : Add OS option in theme selection dropdown ([#14379](https://github.com/MetaMask/metamask-extension/pull/14379)) -- Update Dark Mode What's New message ([#14535](https://github.com/MetaMask/metamask-extension/pull/14535)) -- Adding 'Swaps' to metametrics event categories ([#14538](https://github.com/MetaMask/metamask-extension/pull/14538)) -- Create new e2e test for bip-44 snap in test-snaps ([#14440](https://github.com/MetaMask/metamask-extension/pull/14440)) -- Warn about multiple MetaMask instances running ([#13836](https://github.com/MetaMask/metamask-extension/pull/13836)) -- Fixed API for watchAsset ([#14545](https://github.com/MetaMask/metamask-extension/pull/14545)) -- Rename NotificationController to AnnouncementController ([#14389](https://github.com/MetaMask/metamask-extension/pull/14389)) -- Adjust package version to 10.13.0 ([#14540](https://github.com/MetaMask/metamask-extension/pull/14540)) -- Add token standard to custom token details ([#14506](https://github.com/MetaMask/metamask-extension/pull/14506)) -- lavamoat@6 - update to secure package naming ([#14488](https://github.com/MetaMask/metamask-extension/pull/14488)) -- Fixing 'Learn more' casing on import token screen ([#14529](https://github.com/MetaMask/metamask-extension/pull/14529)) -- call controller methods directly in send duck ([#14465](https://github.com/MetaMask/metamask-extension/pull/14465)) -- show token approval details on confirm approve screen by default ([#14523](https://github.com/MetaMask/metamask-extension/pull/14523)) -- i18n - remove unused locale strings ([#14527](https://github.com/MetaMask/metamask-extension/pull/14527)) +### Added +- **[FLASK]** - Add warning when multiple instances of MetaMask are running ([#13836](https://github.com/MetaMask/metamask-extension/pull/13836)) +- Theme: Add OS option in theme selection dropdown ([#14379](https://github.com/MetaMask/metamask-extension/pull/14379)) + +### Changed +- Use testname as the base currency prefix for preloaded test networks ([#14454](https://github.com/MetaMask/metamask-extension/pull/14454)) +- Update UI of "Add Network" page ([#13866](https://github.com/MetaMask/metamask-extension/pull/13866)) +- Update UI of network switch permissions prompt ([#13450](https://github.com/MetaMask/metamask-extension/pull/13450)) +- Show token approval details on approval screens by default ([#14523](https://github.com/MetaMask/metamask-extension/pull/14523)) +- Update "What's New" announcement text for Dark Mode ([#14535](https://github.com/MetaMask/metamask-extension/pull/14535)) + +### Fixed +- Fix `wallet_watchAsset method` ([#14545](https://github.com/MetaMask/metamask-extension/pull/14545)) - Do not show failed off-chain transactions details when grouped with another valid transaction of same nonce ([#14497](https://github.com/MetaMask/metamask-extension/pull/14497)) -- Update for a new Add network page ([#13866](https://github.com/MetaMask/metamask-extension/pull/13866)) -- Update display of switching current network ([#13450](https://github.com/MetaMask/metamask-extension/pull/13450)) -- Ensure network name in confirm page container is defined ([#14520](https://github.com/MetaMask/metamask-extension/pull/14520)) -- New Crowdin translations by Github Action ([#13556](https://github.com/MetaMask/metamask-extension/pull/13556)) -- MetaMetrics: Add EVENT.CATEGORIES const ([#14474](https://github.com/MetaMask/metamask-extension/pull/14474)) -- Update tx data for simpleSends and add isBestQuote to swaps data ([#14496](https://github.com/MetaMask/metamask-extension/pull/14496)) -- Feature/remove bitmask ([#14489](https://github.com/MetaMask/metamask-extension/pull/14489)) -- MetaMetrics: add 'number_of_nfts' user trait ([#14495](https://github.com/MetaMask/metamask-extension/pull/14495)) -- Add testnet name as prefix for native currency of preloaded testnets ([#14454](https://github.com/MetaMask/metamask-extension/pull/14454)) -- Fix ESLint config around files w/ CommonJS imports ([#14380](https://github.com/MetaMask/metamask-extension/pull/14380)) -- Add new token added event (duplicating the existing event structure) when collectible is manually added ([#14279](https://github.com/MetaMask/metamask-extension/pull/14279)) -- increase test coverage of nonce sorted transaction selector ([#14486](https://github.com/MetaMask/metamask-extension/pull/14486)) -- Fix the alerts toggles in settings ([#14498](https://github.com/MetaMask/metamask-extension/pull/14498)) -- Disable swaps whenever the environment is not development or testing, so that behaviour follows production for QA purposes ([#14499](https://github.com/MetaMask/metamask-extension/pull/14499)) -- E2e test timeout ([#14483](https://github.com/MetaMask/metamask-extension/pull/14483)) -- Stop storing request and response objects in the permission activity log ([#14485](https://github.com/MetaMask/metamask-extension/pull/14485)) -- increase test coverage of nonce sorted transaction selector ([#14479](https://github.com/MetaMask/metamask-extension/pull/14479)) -- bump crowdin/github-action ([#14475](https://github.com/MetaMask/metamask-extension/pull/14475)) -- E2e readme docs ([#14434](https://github.com/MetaMask/metamask-extension/pull/14434)) -- E2e connected state ([#14444](https://github.com/MetaMask/metamask-extension/pull/14444)) ## [10.14.0] ### Added From 8a141fe28c85c3eeb14d03a855e86dcd39ff8e7e Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Fri, 29 Apr 2022 12:41:35 -0500 Subject: [PATCH 003/308] fix cross-fetch moderate vulnerability alert (#14570) --- package.json | 1 + yarn.lock | 28 +--------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 36f9abbb847c..53ae1a4c8e9a 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "resolutions": { "**/regenerator-runtime": "^0.13.7", "**/caniuse-lite": "1.0.30001265", + "**/cross-fetch": "^3.1.5", "**/configstore/dot-prop": "^5.1.1", "**/ethers/elliptic": "^6.5.4", "**/knex/minimist": "^1.2.5", diff --git a/yarn.lock b/yarn.lock index b80a6a246226..a232ee637373 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8913,23 +8913,7 @@ create-react-context@0.3.0: gud "^1.0.0" warning "^4.0.3" -cross-fetch@2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.2.tgz#a47ff4f7fc712daba8f6a695a11c948440d45723" - integrity sha1-pH/09/xxLauo9qaVoRyUhEDUVyM= - dependencies: - node-fetch "2.1.2" - whatwg-fetch "2.0.4" - -cross-fetch@^2.1.0: - version "2.2.3" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.3.tgz#e8a0b3c54598136e037f8650f8e823ccdfac198e" - integrity sha512-PrWWNH3yL2NYIb/7WF/5vFG3DCQiXDOVf8k3ijatbrtnwNuhMWLC7YF7uqf53tbTFDzHIUD8oITw4Bxt8ST3Nw== - dependencies: - node-fetch "2.1.2" - whatwg-fetch "2.0.4" - -cross-fetch@^3.1.4: +cross-fetch@2.2.2, cross-fetch@^2.1.0, cross-fetch@^3.1.4, cross-fetch@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== @@ -19820,11 +19804,6 @@ node-environment-flags@1.0.6: object.getownpropertydescriptors "^2.0.3" semver "^5.7.0" -node-fetch@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" - integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= - node-fetch@2.6.7, node-fetch@^2.3.0, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@~2.6.1: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" @@ -27945,11 +27924,6 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5: dependencies: iconv-lite "0.4.24" -whatwg-fetch@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" - integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== - whatwg-fetch@^3.4.1: version "3.6.2" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" From c1ca70d7325577835a23c1fae2b0b9b10df54490 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 2 May 2022 11:23:20 -1000 Subject: [PATCH 004/308] phishing-detect - validate redirect url protocol --- app/scripts/phishing-detect.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index 68c30d50111e..c076a74d41ab 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -35,6 +35,16 @@ function start() { params: [suspect.hostname], id: createRandomId(), }); - window.location.href = suspect.href; + const redirectTarget = new URL(suspect.href, window.location.href); + // validate redirect url + const invalidProtocol = !(['https:', 'http:'].includes(redirectTarget.protocol)); + // if in valid, show warning and abort + if (invalidProtocol) { + // we intentionally dont display to the user any potential attacker-written content here + console.error(`Invalid redirect url.`); + return; + }; + // use the validated url instance + window.location.href = redirectTarget.href; }); } From 0110bd957133ecf5dec9eb560a6dfe160c851c65 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 3 May 2022 14:05:40 -0230 Subject: [PATCH 005/308] Fix lint errors --- app/scripts/phishing-detect.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index c076a74d41ab..f926b234d889 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -37,13 +37,15 @@ function start() { }); const redirectTarget = new URL(suspect.href, window.location.href); // validate redirect url - const invalidProtocol = !(['https:', 'http:'].includes(redirectTarget.protocol)); + const invalidProtocol = !['https:', 'http:'].includes( + redirectTarget.protocol, + ); // if in valid, show warning and abort if (invalidProtocol) { // we intentionally dont display to the user any potential attacker-written content here console.error(`Invalid redirect url.`); return; - }; + } // use the validated url instance window.location.href = redirectTarget.href; }); From 900ac4596b02c755e2231e32d43bcd7b8ae84a20 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 3 May 2022 13:56:25 -0230 Subject: [PATCH 006/308] Version v10.14.1 This is a rollback release to v10.13.0 --- CHANGELOG.md | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0dbe5484e2e..1e9550f1c589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [10.14.1] +### Changed +- This version was used to rollback from v10.14.0 to v10.13.0. + ## [10.13.0] ### Added - Add a new fiat onboarding option via MoonPay ([#13934](https://github.com/MetaMask/metamask-extension/pull/13934)) @@ -2885,7 +2889,8 @@ 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.13.0...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.14.1...HEAD +[10.14.1]: https://github.com/MetaMask/metamask-extension/compare/v10.13.0...v10.14.1 [10.13.0]: https://github.com/MetaMask/metamask-extension/compare/v10.12.4...v10.13.0 [10.12.4]: https://github.com/MetaMask/metamask-extension/compare/v10.12.3...v10.12.4 [10.12.3]: https://github.com/MetaMask/metamask-extension/compare/v10.12.2...v10.12.3 diff --git a/package.json b/package.json index e8e4a965548d..a6a062f6109a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.13.0", + "version": "10.14.1", "private": true, "repository": { "type": "git", From fefe9401a19dd7c3c6c0c71ed0fdb04830c05fdc Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 4 May 2022 05:06:33 -1000 Subject: [PATCH 007/308] build - update bify-module-groups for build determinism (#14610) --- package.json | 2 +- yarn.lock | 30 ++++-------------------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index a6a062f6109a..b59f069a119f 100644 --- a/package.json +++ b/package.json @@ -277,7 +277,7 @@ "@typescript-eslint/parser": "^4.20.0", "addons-linter": "1.14.0", "babelify": "^10.0.0", - "bify-module-groups": "^1.0.0", + "bify-module-groups": "^2.0.0", "brfs": "^2.0.2", "browser-util-inspect": "^0.2.0", "browserify": "^16.5.1", diff --git a/yarn.lock b/yarn.lock index f3fcb1459808..a25b002bfd49 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6654,24 +6654,14 @@ better-opn@^2.1.1: dependencies: open "^7.0.3" -bify-module-groups@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/bify-module-groups/-/bify-module-groups-1.0.0.tgz#6fba8f96a8b0f9e8f0b04035650fd56249b6119d" - integrity sha512-JAAkE9L5vZoALCEqawXipQNlDn3D0nUyjt0cHgRXj0Kce2RNLQsBxA6wTmnYpQDna6g6VVyC8IUi3n02ppmbhA== +bify-module-groups@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bify-module-groups/-/bify-module-groups-2.0.0.tgz#b629b0028db855b7a587d932ea3af7ed4a69dca9" + integrity sha512-9hkVBhhjO5ycUGlUT6KW109gOgsmnrDH+vMjPFFkY9oCiP397p5o4wruXZqyI9ZA1p8hA5egoKBoh3GwbKiM4g== dependencies: - bify-packagedata-stream "1.0.0" pump "^3.0.0" through2 "^3.0.1" -bify-packagedata-stream@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/bify-packagedata-stream/-/bify-packagedata-stream-1.0.0.tgz#a6dbdcba64f9bf1c87bdc02ba9586fff7b94ccb3" - integrity sha512-ckOCceDpAOySFrt89saOShpVbP/iQbmZeWlYSxZV2e3HPTPhcd3JSudMJZhpsihQTyZut39efDo4+8aOb4vo2w== - dependencies: - module-name-from-path "git+https://git@github.com/kumavis/module-name-from-path.git" - resolve-package-path "^1.2.7" - through2 "^3.0.0" - big-integer@1.6.36: version "1.6.36" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.36.tgz#78631076265d4ae3555c04f85e7d9d2f3a071a36" @@ -19277,10 +19267,6 @@ module-lookup-amd@^7.0.0: requirejs "^2.3.5" requirejs-config-file "^4.0.0" -"module-name-from-path@git+https://git@github.com/kumavis/module-name-from-path.git": - version "1.0.4" - resolved "git+https://git@github.com/kumavis/module-name-from-path.git#fd9c592663a1af6cc48b1be7b8045ea547fca79a" - module-not-found-error@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/module-not-found-error/-/module-not-found-error-1.0.1.tgz#cf8b4ff4f29640674d6cdd02b0e3bc523c2bbdc0" @@ -23961,14 +23947,6 @@ resolve-options@^1.1.0: dependencies: value-or-function "^3.0.0" -resolve-package-path@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/resolve-package-path/-/resolve-package-path-1.2.7.tgz#2a7bc37ad96865e239330e3102c31322847e652e" - integrity sha512-fVEKHGeK85bGbVFuwO9o1aU0n3vqQGrezPc51JGu9UTXpFQfWq5qCeKxyaRUSvephs+06c5j5rPq/dzHGEo8+Q== - dependencies: - path-root "^0.1.1" - resolve "^1.10.0" - resolve-pathname@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd" From a58faa13a35e4bf6c014389dce112745ef83248d Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 4 May 2022 12:57:38 -0230 Subject: [PATCH 008/308] Version v10.14.2 This version includes a build system fix that ensures our builds are deterministic. --- CHANGELOG.md | 8 +++++++- package.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e9550f1c589..4980628ee45f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [10.14.2] +### Fixed +- Make build deterministic (#14610) + - The ordering of modules within each bundle was non-deterministic before this change. We fixed this to comply with Firefox store policies. + ## [10.14.1] ### Changed - This version was used to rollback from v10.14.0 to v10.13.0. @@ -2889,7 +2894,8 @@ 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.14.1...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.14.2...HEAD +[10.14.2]: https://github.com/MetaMask/metamask-extension/compare/v10.14.1...v10.14.2 [10.14.1]: https://github.com/MetaMask/metamask-extension/compare/v10.13.0...v10.14.1 [10.13.0]: https://github.com/MetaMask/metamask-extension/compare/v10.12.4...v10.13.0 [10.12.4]: https://github.com/MetaMask/metamask-extension/compare/v10.12.3...v10.12.4 diff --git a/package.json b/package.json index b59f069a119f..549f139bf42c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.14.1", + "version": "10.14.2", "private": true, "repository": { "type": "git", From a96d40957b45c7dd2f36ddde547a4940e07291a6 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Mon, 2 May 2022 23:49:01 +0200 Subject: [PATCH 009/308] Stop using 4bytes for contract deployment (#14598) --- test/data/transaction-data.json | 58 ++++++++++++++++++++++ ui/hooks/useTransactionDisplayData.js | 11 ++-- ui/hooks/useTransactionDisplayData.test.js | 13 +++++ 3 files changed, 78 insertions(+), 4 deletions(-) diff --git a/test/data/transaction-data.json b/test/data/transaction-data.json index dbc1ec138397..a5219dbdba81 100644 --- a/test/data/transaction-data.json +++ b/test/data/transaction-data.json @@ -798,5 +798,63 @@ }, "hasRetried": false, "hasCancelled": false + }, + { + "initialTransaction": { + "blockNumber": "6195527", + "id": 4243712234858468, + "metamaskNetworkId": "4", + "status": "confirmed", + "time": 1585088013000, + "txParams": { + "from": "0xee014609ef9e09776ac5fe00bdbfef57bcdefebb", + "gas": "0x5208", + "gasPrice": "0x77359400", + "nonce": "0x3", + "value": "0x00", + "data": "0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029" + }, + "hash": "0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a", + "type": "contractDeployment", + "origin": "https://metamask.github.io" + }, + "transactions": [ + { + "blockNumber": "6195527", + "id": 4243712234858468, + "metamaskNetworkId": "4", + "status": "confirmed", + "time": 1585088013000, + "txParams": { + "from": "0xee014609ef9e09776ac5fe00bdbfef57bcdefebb", + "gas": "0x5208", + "gasPrice": "0x77359400", + "nonce": "0x3", + "value": "0x00", + "data": "0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029" + }, + "hash": "0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a", + "type": "contractDeployment" + } + ], + "primaryTransaction": { + "blockNumber": "6195527", + "id": 4243712234858468, + "metamaskNetworkId": "4", + "status": "confirmed", + "time": 1585088013000, + "txParams": { + "from": "0xee014609ef9e09776ac5fe00bdbfef57bcdefebb", + "gas": "0x5208", + "gasPrice": "0x77359400", + "nonce": "0x3", + "value": "0x00", + "data": "0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029" + }, + "hash": "0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a", + "type": "contractDeployment" + }, + "hasRetried": false, + "hasCancelled": false } ] diff --git a/ui/hooks/useTransactionDisplayData.js b/ui/hooks/useTransactionDisplayData.js index a56181e0382e..02a64bdbfac7 100644 --- a/ui/hooks/useTransactionDisplayData.js +++ b/ui/hooks/useTransactionDisplayData.js @@ -217,10 +217,7 @@ export function useTransactionDisplayData(transactionGroup) { title = t('approveSpendLimit', [token?.symbol || t('token')]); subtitle = origin; subtitleContainsOrigin = true; - } else if ( - type === TRANSACTION_TYPES.DEPLOY_CONTRACT || - type === TRANSACTION_TYPES.CONTRACT_INTERACTION - ) { + } else if (type === TRANSACTION_TYPES.CONTRACT_INTERACTION) { category = TRANSACTION_GROUP_CATEGORIES.INTERACTION; const transactionTypeTitle = getTransactionTypeTitle(t, type); title = @@ -228,6 +225,12 @@ export function useTransactionDisplayData(transactionGroup) { transactionTypeTitle; subtitle = origin; subtitleContainsOrigin = true; + } else if (type === TRANSACTION_TYPES.DEPLOY_CONTRACT) { + // @todo Should perhaps be a separate group? + category = TRANSACTION_GROUP_CATEGORIES.INTERACTION; + title = getTransactionTypeTitle(t, type); + subtitle = origin; + subtitleContainsOrigin = true; } else if (type === TRANSACTION_TYPES.INCOMING) { category = TRANSACTION_GROUP_CATEGORIES.RECEIVE; title = t('receive'); diff --git a/ui/hooks/useTransactionDisplayData.test.js b/ui/hooks/useTransactionDisplayData.test.js index 4c35bee3b359..c9673daffbf8 100644 --- a/ui/hooks/useTransactionDisplayData.test.js +++ b/ui/hooks/useTransactionDisplayData.test.js @@ -117,6 +117,19 @@ const expectedResults = [ isPending: false, displayedStatusKey: TRANSACTION_STATUSES.CONFIRMED, }, + { + title: 'Contract Deployment', + category: TRANSACTION_GROUP_CATEGORIES.INTERACTION, + subtitle: 'metamask.github.io', + subtitleContainsOrigin: true, + date: 'May 12, 2020', + primaryCurrency: '-0 ETH', + senderAddress: '0xee014609ef9e09776ac5fe00bdbfef57bcdefebb', + recipientAddress: undefined, + secondaryCurrency: '-0 ETH', + isPending: false, + displayedStatusKey: TRANSACTION_STATUSES.CONFIRMED, + }, ]; let useSelector, useI18nContext, useTokenFiatAmount; From c0957866a9a5213d98881adb9c6432a27535001d Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Tue, 3 May 2022 18:17:08 -0500 Subject: [PATCH 010/308] metametrics: deprecate flatMap (#14608) --- app/scripts/controllers/metametrics.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scripts/controllers/metametrics.js b/app/scripts/controllers/metametrics.js index 9018b533d58f..856461a57de5 100644 --- a/app/scripts/controllers/metametrics.js +++ b/app/scripts/controllers/metametrics.js @@ -621,7 +621,9 @@ export default class MetaMetricsController { */ _getAllNFTsFlattened = memoize((allCollectibles = {}) => { return Object.values(allCollectibles) - .flatMap((chainNFTs) => Object.values(chainNFTs)) + .reduce((result, chainNFTs) => { + return result.concat(Object.values(chainNFTs)); + }, []) .flat(); }); From a3917763d4aa076912736aeda7596be4b2815cd7 Mon Sep 17 00:00:00 2001 From: Hassan Malik <41640681+hmalik88@users.noreply.github.com> Date: Thu, 12 May 2022 17:58:37 -0400 Subject: [PATCH 011/308] Removed onExecutionEnvironmentError (#14698) * used correct method to stop snap * removed dead code, snap controller already subscribes to execution environment errors * fixed linting error --- app/scripts/metamask-controller.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 5f9139c13031..827de4f54ea1 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -637,7 +637,6 @@ export default class MetamaskController extends EventEmitter { ///: BEGIN:ONLY_INCLUDE_IN(flask) this.workerController = new IframeExecutionService({ - onError: this.onExecutionEnvironmentError.bind(this), iframeUrl: new URL( 'https://metamask.github.io/iframe-execution-environment/0.4.5', ), @@ -3377,17 +3376,6 @@ export default class MetamaskController extends EventEmitter { } ///: BEGIN:ONLY_INCLUDE_IN(flask) - /** - * For snaps running in workers. - * - * @param snapId - * @param error - */ - onExecutionEnvironmentError(snapId, error) { - this.snapController.stopPlugin(snapId); - this.snapController.addSnapError(error); - } - /** * For snaps running in workers. * From 23565cac2cef5081b38ddf06ebbfe29c44fdca1a Mon Sep 17 00:00:00 2001 From: Alex Donesky Date: Thu, 12 May 2022 18:01:24 -0500 Subject: [PATCH 012/308] Bump @metamask/controllers version, remove patches (#14618) --- lavamoat/browserify/beta/policy.json | 422 +++++- lavamoat/browserify/flask/policy.json | 422 +++++- lavamoat/browserify/main/policy.json | 422 +++++- lavamoat/build-system/policy.json | 1433 +++++++++++++++----- package.json | 4 +- patches/bip39+2.5.0.patch | 99 -- patches/eth-hd-keyring+3.6.0.patch | 43 - patches/eth-keyring-controller+6.2.1.patch | 37 - yarn.lock | 76 +- 9 files changed, 2321 insertions(+), 637 deletions(-) delete mode 100644 patches/bip39+2.5.0.patch delete mode 100644 patches/eth-hd-keyring+3.6.0.patch delete mode 100644 patches/eth-keyring-controller+6.2.1.patch diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 6d45be3e37bb..05c3c93dd029 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -3217,12 +3217,201 @@ }, "@metamask/rpc-methods": { "packages": { - "@metamask/controllers": true, + "@metamask/rpc-methods>@metamask/controllers": true, "@metamask/rpc-methods>@metamask/key-tree": true, "@metamask/snap-controllers": true, "eth-rpc-errors": true } }, + "@metamask/rpc-methods>@metamask/controllers": { + "globals": { + "Headers": true, + "URL": true, + "clearInterval": true, + "clearTimeout": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/common": true, + "@ethereumjs/tx": true, + "@metamask/contract-metadata": true, + "@metamask/controllers>abort-controller": true, + "@metamask/controllers>async-mutex": true, + "@metamask/controllers>eth-phishing-detect": true, + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/controllers>multiformats": true, + "@metamask/controllers>web3-provider-engine": true, + "@metamask/metamask-eth-abis": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": true, + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/rpc-methods>@metamask/controllers>nanoid": true, + "@storybook/api>fast-deep-equal": true, + "browserify>buffer": true, + "browserify>events": true, + "deep-freeze-strict": true, + "eth-ens-namehash": true, + "eth-json-rpc-infura": true, + "eth-query": true, + "eth-rpc-errors": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "ethers": true, + "ethjs>ethjs-unit": true, + "immer": true, + "json-rpc-engine": true, + "jsonschema": true, + "punycode": true, + "single-call-balance-checker-abi": true, + "uuid": true, + "web3": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": true, + "browserify>events": true, + "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-keyring-controller>obs-store": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39>unorm": true, + "browserify>crypto-browserify>pbkdf2": true, + "ethereumjs-util>create-hash": true, + "ethereumjs-wallet>randombytes": true, + "ethereumjs-wallet>safe-buffer": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39>unorm": { + "globals": { + "define": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-sig-util": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": { + "globals": { + "clearInterval": true, + "setInterval": true + }, + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-provider-http": true, + "ethjs>ethjs-unit": true, + "ethjs>ethjs-util": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "ethjs-query>babel-runtime": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-util": true, + "promise-to-callback": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "globals": { + "console": true + }, + "packages": { + "ethjs-query>babel-runtime": true, + "ethjs-query>ethjs-format": true, + "ethjs-query>ethjs-rpc": true, + "promise-to-callback": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, "@metamask/rpc-methods>@metamask/key-tree": { "packages": { "@metamask/rpc-methods>@metamask/key-tree>bip39": true, @@ -3288,6 +3477,7 @@ "@metamask/controllers>multiformats": true, "@metamask/controllers>web3-provider-engine": true, "@metamask/metamask-eth-abis": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": true, "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, @@ -3297,7 +3487,6 @@ "deep-freeze-strict": true, "eth-ens-namehash": true, "eth-json-rpc-infura": true, - "eth-keyring-controller": true, "eth-query": true, "eth-rpc-errors": true, "eth-sig-util": true, @@ -3313,6 +3502,19 @@ "web3": true } }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": true, + "browserify>events": true, + "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-keyring-controller>obs-store": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true + } + }, "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { "packages": { "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true @@ -3434,9 +3636,9 @@ "setTimeout": true }, "packages": { - "@metamask/controllers": true, "@metamask/post-message-stream": true, "@metamask/providers>@metamask/object-multiplex": true, + "@metamask/snap-controllers>@metamask/controllers": true, "@metamask/snap-controllers>@metamask/execution-environments": true, "@metamask/snap-controllers>@metamask/obs-store": true, "@metamask/snap-controllers>ajv": true, @@ -3456,6 +3658,153 @@ "semver": true } }, + "@metamask/snap-controllers>@metamask/controllers": { + "globals": { + "Headers": true, + "URL": true, + "clearInterval": true, + "clearTimeout": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/common": true, + "@ethereumjs/tx": true, + "@metamask/contract-metadata": true, + "@metamask/controllers>abort-controller": true, + "@metamask/controllers>async-mutex": true, + "@metamask/controllers>eth-phishing-detect": true, + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/controllers>multiformats": true, + "@metamask/controllers>web3-provider-engine": true, + "@metamask/metamask-eth-abis": true, + "@metamask/snap-controllers>@metamask/controllers>eth-keyring-controller": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": true, + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/snap-controllers>nanoid": true, + "@storybook/api>fast-deep-equal": true, + "browserify>buffer": true, + "browserify>events": true, + "deep-freeze-strict": true, + "eth-ens-namehash": true, + "eth-json-rpc-infura": true, + "eth-query": true, + "eth-rpc-errors": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "ethers": true, + "ethjs>ethjs-unit": true, + "immer": true, + "json-rpc-engine": true, + "jsonschema": true, + "punycode": true, + "single-call-balance-checker-abi": true, + "uuid": true, + "web3": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-keyring-controller": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": true, + "browserify>events": true, + "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-keyring-controller>obs-store": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": { + "globals": { + "clearInterval": true, + "setInterval": true + }, + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-provider-http": true, + "ethjs>ethjs-unit": true, + "ethjs>ethjs-util": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "ethjs-query>babel-runtime": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-util": true, + "promise-to-callback": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "globals": { + "console": true + }, + "packages": { + "ethjs-query>babel-runtime": true, + "ethjs-query>ethjs-format": true, + "ethjs-query>ethjs-rpc": true, + "promise-to-callback": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, "@metamask/snap-controllers>@metamask/obs-store": { "packages": { "@metamask/snap-controllers>@metamask/obs-store>through2": true, @@ -4777,63 +5126,37 @@ "packages": { "browserify>buffer": true, "browserify>events": true, - "eth-keyring-controller>bip39": true, + "eth-keyring-controller>@metamask/bip39": true, + "eth-keyring-controller>@metamask/eth-hd-keyring": true, "eth-keyring-controller>browser-passworder": true, - "eth-keyring-controller>eth-hd-keyring": true, "eth-keyring-controller>eth-simple-keyring": true, "eth-keyring-controller>obs-store": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "loglevel": true + "eth-sig-util": true } }, - "eth-keyring-controller>bip39": { - "globals": { - "console.log": true - }, + "eth-keyring-controller>@metamask/bip39": { "packages": { + "browserify>buffer": true, "browserify>crypto-browserify>pbkdf2": true, - "eth-keyring-controller>bip39>unorm": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true - } - }, - "eth-keyring-controller>bip39>unorm": { - "globals": { - "define": true - } - }, - "eth-keyring-controller>browser-passworder": { - "globals": { - "btoa": true, - "crypto": true - }, - "packages": { - "eth-keyring-controller>browser-passworder>browserify-unibabel": true - } - }, - "eth-keyring-controller>browser-passworder>browserify-unibabel": { - "globals": { - "atob": true, - "btoa": true + "ethereumjs-wallet>randombytes": true } }, - "eth-keyring-controller>eth-hd-keyring": { + "eth-keyring-controller>@metamask/eth-hd-keyring": { "packages": { "browserify>buffer": true, - "eth-keyring-controller>bip39": true, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>@metamask/bip39": true, + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": true, "eth-keyring-controller>eth-simple-keyring": true, - "eth-sig-util": true + "eth-trezor-keyring>@metamask/eth-sig-util": true } }, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": { "packages": { "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": true, + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": true, "ethereumjs-util": true, "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-wallet>aes-js": true, @@ -4842,12 +5165,27 @@ "ethers>@ethersproject/json-wallets>scrypt-js": true } }, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": { "globals": { "crypto": true, "msCrypto": true } }, + "eth-keyring-controller>browser-passworder": { + "globals": { + "btoa": true, + "crypto": true + }, + "packages": { + "eth-keyring-controller>browser-passworder>browserify-unibabel": true + } + }, + "eth-keyring-controller>browser-passworder>browserify-unibabel": { + "globals": { + "atob": true, + "btoa": true + } + }, "eth-keyring-controller>eth-simple-keyring": { "packages": { "browserify>buffer": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 6d45be3e37bb..05c3c93dd029 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -3217,12 +3217,201 @@ }, "@metamask/rpc-methods": { "packages": { - "@metamask/controllers": true, + "@metamask/rpc-methods>@metamask/controllers": true, "@metamask/rpc-methods>@metamask/key-tree": true, "@metamask/snap-controllers": true, "eth-rpc-errors": true } }, + "@metamask/rpc-methods>@metamask/controllers": { + "globals": { + "Headers": true, + "URL": true, + "clearInterval": true, + "clearTimeout": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/common": true, + "@ethereumjs/tx": true, + "@metamask/contract-metadata": true, + "@metamask/controllers>abort-controller": true, + "@metamask/controllers>async-mutex": true, + "@metamask/controllers>eth-phishing-detect": true, + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/controllers>multiformats": true, + "@metamask/controllers>web3-provider-engine": true, + "@metamask/metamask-eth-abis": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": true, + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/rpc-methods>@metamask/controllers>nanoid": true, + "@storybook/api>fast-deep-equal": true, + "browserify>buffer": true, + "browserify>events": true, + "deep-freeze-strict": true, + "eth-ens-namehash": true, + "eth-json-rpc-infura": true, + "eth-query": true, + "eth-rpc-errors": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "ethers": true, + "ethjs>ethjs-unit": true, + "immer": true, + "json-rpc-engine": true, + "jsonschema": true, + "punycode": true, + "single-call-balance-checker-abi": true, + "uuid": true, + "web3": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": true, + "browserify>events": true, + "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-keyring-controller>obs-store": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39>unorm": true, + "browserify>crypto-browserify>pbkdf2": true, + "ethereumjs-util>create-hash": true, + "ethereumjs-wallet>randombytes": true, + "ethereumjs-wallet>safe-buffer": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39>unorm": { + "globals": { + "define": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-sig-util": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": { + "globals": { + "clearInterval": true, + "setInterval": true + }, + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-provider-http": true, + "ethjs>ethjs-unit": true, + "ethjs>ethjs-util": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "ethjs-query>babel-runtime": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-util": true, + "promise-to-callback": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "globals": { + "console": true + }, + "packages": { + "ethjs-query>babel-runtime": true, + "ethjs-query>ethjs-format": true, + "ethjs-query>ethjs-rpc": true, + "promise-to-callback": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, "@metamask/rpc-methods>@metamask/key-tree": { "packages": { "@metamask/rpc-methods>@metamask/key-tree>bip39": true, @@ -3288,6 +3477,7 @@ "@metamask/controllers>multiformats": true, "@metamask/controllers>web3-provider-engine": true, "@metamask/metamask-eth-abis": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": true, "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, @@ -3297,7 +3487,6 @@ "deep-freeze-strict": true, "eth-ens-namehash": true, "eth-json-rpc-infura": true, - "eth-keyring-controller": true, "eth-query": true, "eth-rpc-errors": true, "eth-sig-util": true, @@ -3313,6 +3502,19 @@ "web3": true } }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": true, + "browserify>events": true, + "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-keyring-controller>obs-store": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true + } + }, "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { "packages": { "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true @@ -3434,9 +3636,9 @@ "setTimeout": true }, "packages": { - "@metamask/controllers": true, "@metamask/post-message-stream": true, "@metamask/providers>@metamask/object-multiplex": true, + "@metamask/snap-controllers>@metamask/controllers": true, "@metamask/snap-controllers>@metamask/execution-environments": true, "@metamask/snap-controllers>@metamask/obs-store": true, "@metamask/snap-controllers>ajv": true, @@ -3456,6 +3658,153 @@ "semver": true } }, + "@metamask/snap-controllers>@metamask/controllers": { + "globals": { + "Headers": true, + "URL": true, + "clearInterval": true, + "clearTimeout": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/common": true, + "@ethereumjs/tx": true, + "@metamask/contract-metadata": true, + "@metamask/controllers>abort-controller": true, + "@metamask/controllers>async-mutex": true, + "@metamask/controllers>eth-phishing-detect": true, + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/controllers>multiformats": true, + "@metamask/controllers>web3-provider-engine": true, + "@metamask/metamask-eth-abis": true, + "@metamask/snap-controllers>@metamask/controllers>eth-keyring-controller": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": true, + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/snap-controllers>nanoid": true, + "@storybook/api>fast-deep-equal": true, + "browserify>buffer": true, + "browserify>events": true, + "deep-freeze-strict": true, + "eth-ens-namehash": true, + "eth-json-rpc-infura": true, + "eth-query": true, + "eth-rpc-errors": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "ethers": true, + "ethjs>ethjs-unit": true, + "immer": true, + "json-rpc-engine": true, + "jsonschema": true, + "punycode": true, + "single-call-balance-checker-abi": true, + "uuid": true, + "web3": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-keyring-controller": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": true, + "browserify>events": true, + "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-keyring-controller>obs-store": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": { + "globals": { + "clearInterval": true, + "setInterval": true + }, + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-provider-http": true, + "ethjs>ethjs-unit": true, + "ethjs>ethjs-util": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "ethjs-query>babel-runtime": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-util": true, + "promise-to-callback": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "globals": { + "console": true + }, + "packages": { + "ethjs-query>babel-runtime": true, + "ethjs-query>ethjs-format": true, + "ethjs-query>ethjs-rpc": true, + "promise-to-callback": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, "@metamask/snap-controllers>@metamask/obs-store": { "packages": { "@metamask/snap-controllers>@metamask/obs-store>through2": true, @@ -4777,63 +5126,37 @@ "packages": { "browserify>buffer": true, "browserify>events": true, - "eth-keyring-controller>bip39": true, + "eth-keyring-controller>@metamask/bip39": true, + "eth-keyring-controller>@metamask/eth-hd-keyring": true, "eth-keyring-controller>browser-passworder": true, - "eth-keyring-controller>eth-hd-keyring": true, "eth-keyring-controller>eth-simple-keyring": true, "eth-keyring-controller>obs-store": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "loglevel": true + "eth-sig-util": true } }, - "eth-keyring-controller>bip39": { - "globals": { - "console.log": true - }, + "eth-keyring-controller>@metamask/bip39": { "packages": { + "browserify>buffer": true, "browserify>crypto-browserify>pbkdf2": true, - "eth-keyring-controller>bip39>unorm": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true - } - }, - "eth-keyring-controller>bip39>unorm": { - "globals": { - "define": true - } - }, - "eth-keyring-controller>browser-passworder": { - "globals": { - "btoa": true, - "crypto": true - }, - "packages": { - "eth-keyring-controller>browser-passworder>browserify-unibabel": true - } - }, - "eth-keyring-controller>browser-passworder>browserify-unibabel": { - "globals": { - "atob": true, - "btoa": true + "ethereumjs-wallet>randombytes": true } }, - "eth-keyring-controller>eth-hd-keyring": { + "eth-keyring-controller>@metamask/eth-hd-keyring": { "packages": { "browserify>buffer": true, - "eth-keyring-controller>bip39": true, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>@metamask/bip39": true, + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": true, "eth-keyring-controller>eth-simple-keyring": true, - "eth-sig-util": true + "eth-trezor-keyring>@metamask/eth-sig-util": true } }, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": { "packages": { "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": true, + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": true, "ethereumjs-util": true, "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-wallet>aes-js": true, @@ -4842,12 +5165,27 @@ "ethers>@ethersproject/json-wallets>scrypt-js": true } }, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": { "globals": { "crypto": true, "msCrypto": true } }, + "eth-keyring-controller>browser-passworder": { + "globals": { + "btoa": true, + "crypto": true + }, + "packages": { + "eth-keyring-controller>browser-passworder>browserify-unibabel": true + } + }, + "eth-keyring-controller>browser-passworder>browserify-unibabel": { + "globals": { + "atob": true, + "btoa": true + } + }, "eth-keyring-controller>eth-simple-keyring": { "packages": { "browserify>buffer": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 6d45be3e37bb..05c3c93dd029 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -3217,12 +3217,201 @@ }, "@metamask/rpc-methods": { "packages": { - "@metamask/controllers": true, + "@metamask/rpc-methods>@metamask/controllers": true, "@metamask/rpc-methods>@metamask/key-tree": true, "@metamask/snap-controllers": true, "eth-rpc-errors": true } }, + "@metamask/rpc-methods>@metamask/controllers": { + "globals": { + "Headers": true, + "URL": true, + "clearInterval": true, + "clearTimeout": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/common": true, + "@ethereumjs/tx": true, + "@metamask/contract-metadata": true, + "@metamask/controllers>abort-controller": true, + "@metamask/controllers>async-mutex": true, + "@metamask/controllers>eth-phishing-detect": true, + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/controllers>multiformats": true, + "@metamask/controllers>web3-provider-engine": true, + "@metamask/metamask-eth-abis": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": true, + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/rpc-methods>@metamask/controllers>nanoid": true, + "@storybook/api>fast-deep-equal": true, + "browserify>buffer": true, + "browserify>events": true, + "deep-freeze-strict": true, + "eth-ens-namehash": true, + "eth-json-rpc-infura": true, + "eth-query": true, + "eth-rpc-errors": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "ethers": true, + "ethjs>ethjs-unit": true, + "immer": true, + "json-rpc-engine": true, + "jsonschema": true, + "punycode": true, + "single-call-balance-checker-abi": true, + "uuid": true, + "web3": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": true, + "browserify>events": true, + "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-keyring-controller>obs-store": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39>unorm": true, + "browserify>crypto-browserify>pbkdf2": true, + "ethereumjs-util>create-hash": true, + "ethereumjs-wallet>randombytes": true, + "ethereumjs-wallet>safe-buffer": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39>unorm": { + "globals": { + "define": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-sig-util": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": { + "globals": { + "clearInterval": true, + "setInterval": true + }, + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-provider-http": true, + "ethjs>ethjs-unit": true, + "ethjs>ethjs-util": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "ethjs-query>babel-runtime": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-util": true, + "promise-to-callback": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "globals": { + "console": true + }, + "packages": { + "ethjs-query>babel-runtime": true, + "ethjs-query>ethjs-format": true, + "ethjs-query>ethjs-rpc": true, + "promise-to-callback": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, "@metamask/rpc-methods>@metamask/key-tree": { "packages": { "@metamask/rpc-methods>@metamask/key-tree>bip39": true, @@ -3288,6 +3477,7 @@ "@metamask/controllers>multiformats": true, "@metamask/controllers>web3-provider-engine": true, "@metamask/metamask-eth-abis": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": true, "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, @@ -3297,7 +3487,6 @@ "deep-freeze-strict": true, "eth-ens-namehash": true, "eth-json-rpc-infura": true, - "eth-keyring-controller": true, "eth-query": true, "eth-rpc-errors": true, "eth-sig-util": true, @@ -3313,6 +3502,19 @@ "web3": true } }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": true, + "browserify>events": true, + "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-keyring-controller>obs-store": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true + } + }, "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { "packages": { "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true @@ -3434,9 +3636,9 @@ "setTimeout": true }, "packages": { - "@metamask/controllers": true, "@metamask/post-message-stream": true, "@metamask/providers>@metamask/object-multiplex": true, + "@metamask/snap-controllers>@metamask/controllers": true, "@metamask/snap-controllers>@metamask/execution-environments": true, "@metamask/snap-controllers>@metamask/obs-store": true, "@metamask/snap-controllers>ajv": true, @@ -3456,6 +3658,153 @@ "semver": true } }, + "@metamask/snap-controllers>@metamask/controllers": { + "globals": { + "Headers": true, + "URL": true, + "clearInterval": true, + "clearTimeout": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/common": true, + "@ethereumjs/tx": true, + "@metamask/contract-metadata": true, + "@metamask/controllers>abort-controller": true, + "@metamask/controllers>async-mutex": true, + "@metamask/controllers>eth-phishing-detect": true, + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/controllers>multiformats": true, + "@metamask/controllers>web3-provider-engine": true, + "@metamask/metamask-eth-abis": true, + "@metamask/snap-controllers>@metamask/controllers>eth-keyring-controller": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": true, + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/snap-controllers>nanoid": true, + "@storybook/api>fast-deep-equal": true, + "browserify>buffer": true, + "browserify>events": true, + "deep-freeze-strict": true, + "eth-ens-namehash": true, + "eth-json-rpc-infura": true, + "eth-query": true, + "eth-rpc-errors": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "ethers": true, + "ethjs>ethjs-unit": true, + "immer": true, + "json-rpc-engine": true, + "jsonschema": true, + "punycode": true, + "single-call-balance-checker-abi": true, + "uuid": true, + "web3": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-keyring-controller": { + "packages": { + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": true, + "browserify>events": true, + "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-keyring-controller>obs-store": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs": { + "globals": { + "clearInterval": true, + "setInterval": true + }, + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-provider-http": true, + "ethjs>ethjs-unit": true, + "ethjs>ethjs-util": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "ethjs-query>babel-runtime": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-util": true, + "promise-to-callback": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "globals": { + "console": true + }, + "packages": { + "ethjs-query>babel-runtime": true, + "ethjs-query>ethjs-format": true, + "ethjs-query>ethjs-rpc": true, + "promise-to-callback": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet": { + "packages": { + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/snap-controllers>@metamask/controllers>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, "@metamask/snap-controllers>@metamask/obs-store": { "packages": { "@metamask/snap-controllers>@metamask/obs-store>through2": true, @@ -4777,63 +5126,37 @@ "packages": { "browserify>buffer": true, "browserify>events": true, - "eth-keyring-controller>bip39": true, + "eth-keyring-controller>@metamask/bip39": true, + "eth-keyring-controller>@metamask/eth-hd-keyring": true, "eth-keyring-controller>browser-passworder": true, - "eth-keyring-controller>eth-hd-keyring": true, "eth-keyring-controller>eth-simple-keyring": true, "eth-keyring-controller>obs-store": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "loglevel": true + "eth-sig-util": true } }, - "eth-keyring-controller>bip39": { - "globals": { - "console.log": true - }, + "eth-keyring-controller>@metamask/bip39": { "packages": { + "browserify>buffer": true, "browserify>crypto-browserify>pbkdf2": true, - "eth-keyring-controller>bip39>unorm": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true - } - }, - "eth-keyring-controller>bip39>unorm": { - "globals": { - "define": true - } - }, - "eth-keyring-controller>browser-passworder": { - "globals": { - "btoa": true, - "crypto": true - }, - "packages": { - "eth-keyring-controller>browser-passworder>browserify-unibabel": true - } - }, - "eth-keyring-controller>browser-passworder>browserify-unibabel": { - "globals": { - "atob": true, - "btoa": true + "ethereumjs-wallet>randombytes": true } }, - "eth-keyring-controller>eth-hd-keyring": { + "eth-keyring-controller>@metamask/eth-hd-keyring": { "packages": { "browserify>buffer": true, - "eth-keyring-controller>bip39": true, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>@metamask/bip39": true, + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": true, "eth-keyring-controller>eth-simple-keyring": true, - "eth-sig-util": true + "eth-trezor-keyring>@metamask/eth-sig-util": true } }, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": { "packages": { "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": true, + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": true, "ethereumjs-util": true, "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-wallet>aes-js": true, @@ -4842,12 +5165,27 @@ "ethers>@ethersproject/json-wallets>scrypt-js": true } }, - "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": { "globals": { "crypto": true, "msCrypto": true } }, + "eth-keyring-controller>browser-passworder": { + "globals": { + "btoa": true, + "crypto": true + }, + "packages": { + "eth-keyring-controller>browser-passworder>browserify-unibabel": true + } + }, + "eth-keyring-controller>browser-passworder>browserify-unibabel": { + "globals": { + "atob": true, + "btoa": true + } + }, "eth-keyring-controller>eth-simple-keyring": { "packages": { "browserify>buffer": true, diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index f35cc95e6a81..e97b9a34b9fa 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -4150,6 +4150,7 @@ "gulp-watch>chokidar>anymatch": true, "gulp-watch>chokidar>async-each": true, "gulp-watch>chokidar>braces": true, + "gulp-watch>chokidar>fsevents": true, "gulp-watch>chokidar>is-binary-path": true, "gulp-watch>chokidar>is-glob": true, "gulp-watch>chokidar>normalize-path": true, @@ -4298,547 +4299,1314 @@ "webpack>micromatch>braces>fill-range>repeat-string": true } }, - "gulp-watch>chokidar>is-binary-path": { - "builtin": { - "path.extname": true - }, - "packages": { - "gulp-watch>chokidar>is-binary-path>binary-extensions": true - } - }, - "gulp-watch>chokidar>is-glob": { - "packages": { - "gulp-watch>chokidar>is-glob>is-extglob": true - } - }, - "gulp-watch>chokidar>readdirp": { + "gulp-watch>chokidar>fsevents": { "builtin": { + "events.EventEmitter": true, + "fs.stat": true, "path.join": true, - "path.relative": true, "util.inherits": true }, "globals": { + "__dirname": true, + "process.nextTick": true, + "process.platform": true, "setImmediate": true }, "packages": { - "fs-extra>graceful-fs": true, - "gulp-watch>chokidar>readdirp>micromatch": true, - "readable-stream": true + "gulp-watch>chokidar>fsevents>node-pre-gyp": true } }, - "gulp-watch>chokidar>readdirp>micromatch": { + "gulp-watch>chokidar>fsevents>node-pre-gyp": { "builtin": { - "path.basename": true, - "path.sep": true, - "util.inspect": true + "events.EventEmitter": true, + "fs.existsSync": true, + "fs.readFileSync": true, + "fs.renameSync": true, + "path.dirname": true, + "path.existsSync": true, + "path.join": true, + "path.resolve": true, + "url.parse": true, + "url.resolve": true, + "util.inherits": true }, "globals": { - "process.platform": true + "__dirname": true, + "console.log": true, + "process.arch": true, + "process.cwd": true, + "process.env": true, + "process.platform": true, + "process.version.substr": true, + "process.versions": true }, "packages": { - "gulp-watch>chokidar>braces": true, - "gulp-watch>chokidar>readdirp>micromatch>arr-diff": true, - "gulp-watch>chokidar>readdirp>micromatch>array-unique": true, - "gulp-watch>chokidar>readdirp>micromatch>define-property": true, - "gulp-watch>chokidar>readdirp>micromatch>extend-shallow": true, - "gulp-watch>chokidar>readdirp>micromatch>extglob": true, - "gulp-watch>chokidar>readdirp>micromatch>kind-of": true, - "webpack>micromatch>fragment-cache": true, - "webpack>micromatch>nanomatch": true, - "webpack>micromatch>object.pick": true, - "webpack>micromatch>regex-not": true, - "webpack>micromatch>snapdragon": true, - "webpack>micromatch>to-regex": true - } - }, - "gulp-watch>chokidar>readdirp>micromatch>define-property": { - "packages": { - "gulp>gulp-cli>isobject": true, - "webpack>micromatch>define-property>is-descriptor": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>detect-libc": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>semver": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extend-shallow": { - "packages": { - "gulp-watch>chokidar>readdirp>micromatch>extend-shallow>is-extendable": true, - "webpack>micromatch>extend-shallow>assign-symbols": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>detect-libc": { + "builtin": { + "child_process.spawnSync": true, + "fs.readdirSync": true, + "os.platform": true + }, + "globals": { + "process.env": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extend-shallow>is-extendable": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt": { + "builtin": { + "path": true, + "stream.Stream": true, + "url": true + }, + "globals": { + "console": true, + "process.argv": true, + "process.env.DEBUG_NOPT": true, + "process.env.NOPT_DEBUG": true, + "process.platform": true + }, "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>abbrev": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extglob": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv": { + "builtin": { + "child_process.exec": true, + "path": true + }, + "globals": { + "process.env.COMPUTERNAME": true, + "process.env.ComSpec": true, + "process.env.EDITOR": true, + "process.env.HOSTNAME": true, + "process.env.PATH": true, + "process.env.PROMPT": true, + "process.env.PS1": true, + "process.env.Path": true, + "process.env.SHELL": true, + "process.env.USER": true, + "process.env.USERDOMAIN": true, + "process.env.USERNAME": true, + "process.env.VISUAL": true, + "process.env.path": true, + "process.nextTick": true, + "process.platform": true + }, "packages": { - "gulp-watch>chokidar>readdirp>micromatch>array-unique": true, - "gulp-watch>chokidar>readdirp>micromatch>extglob>define-property": true, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets": true, - "gulp-watch>chokidar>readdirp>micromatch>extglob>extend-shallow": true, - "webpack>micromatch>fragment-cache": true, - "webpack>micromatch>regex-not": true, - "webpack>micromatch>snapdragon": true, - "webpack>micromatch>to-regex": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-homedir": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-tmpdir": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extglob>define-property": { - "packages": { - "webpack>micromatch>define-property>is-descriptor": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-homedir": { + "builtin": { + "os.homedir": true + }, + "globals": { + "process.env": true, + "process.getuid": true, + "process.platform": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-tmpdir": { "globals": { - "__filename": true - }, - "packages": { - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>debug": true, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property": true, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>extend-shallow": true, - "webpack>micromatch>extglob>expand-brackets>posix-character-classes": true, - "webpack>micromatch>regex-not": true, - "webpack>micromatch>snapdragon": true, - "webpack>micromatch>to-regex": true + "process.env.SystemRoot": true, + "process.env.TEMP": true, + "process.env.TMP": true, + "process.env.TMPDIR": true, + "process.env.windir": true, + "process.platform": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>debug": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog": { "builtin": { - "fs.SyncWriteStream": true, - "net.Socket": true, - "tty.WriteStream": true, - "tty.isatty": true, + "events.EventEmitter": true, "util": true }, "globals": { - "chrome": true, - "console": true, - "document": true, - "localStorage": true, - "navigator": true, - "process": true + "process.nextTick": true, + "process.stderr": true }, "packages": { - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>debug>ms": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>console-control-strings": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>set-blocking": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet": { + "builtin": { + "events.EventEmitter": true, + "util.inherits": true + }, "packages": { - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>delegates": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream": { + "builtin": { + "events.EventEmitter": true, + "stream": true, + "util": true + }, + "globals": { + "process.browser": true, + "process.env.READABLE_STREAM": true, + "process.stderr": true, + "process.stdout": true, + "process.version.slice": true, + "setImmediate": true + }, "packages": { - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor>is-accessor-descriptor": true, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor>is-data-descriptor": true, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor>kind-of": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>core-util-is": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>isarray": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>process-nextick-args": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>string_decoder": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>util-deprecate": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>inherits": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>tar>safe-buffer": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor>is-accessor-descriptor": { - "packages": { - "gulp-watch>anymatch>micromatch>kind-of": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>core-util-is": { + "globals": { + "Buffer.isBuffer": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor>is-data-descriptor": { - "packages": { - "gulp-watch>anymatch>micromatch>kind-of": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>process-nextick-args": { + "globals": { + "process": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>extend-shallow": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>string_decoder": { "packages": { - "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>extend-shallow>is-extendable": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>tar>safe-buffer": true } }, - "gulp-watch>chokidar>readdirp>micromatch>extglob>extend-shallow": { - "packages": { - "gulp-watch>chokidar>readdirp>micromatch>extglob>extend-shallow>is-extendable": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>util-deprecate": { + "builtin": { + "util.deprecate": true } }, - "gulp-watch>fancy-log": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge": { + "builtin": { + "util.format": true + }, "globals": { - "console": true, - "process.argv.indexOf": true, - "process.stderr.write": true, - "process.stdout.write": true + "clearInterval": true, + "process": true, + "setImmediate": true, + "setInterval": true }, "packages": { - "fancy-log>ansi-gray": true, - "fancy-log>color-support": true, - "fancy-log>time-stamp": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>console-control-strings": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>aproba": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>has-unicode": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>object-assign": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>signal-exit": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>strip-ansi": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>wide-align": true } }, - "gulp-watch>glob-parent": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>has-unicode": { "builtin": { - "os.platform": true, - "path": true + "os.type": true }, - "packages": { - "gulp-watch>glob-parent>is-glob": true, - "gulp-watch>glob-parent>path-dirname": true - } - }, - "gulp-watch>glob-parent>is-glob": { - "packages": { - "gulp-watch>glob-parent>is-glob>is-extglob": true + "globals": { + "process.env.LANG": true, + "process.env.LC_ALL": true, + "process.env.LC_CTYPE": true } }, - "gulp-watch>glob-parent>path-dirname": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>signal-exit": { "builtin": { - "path": true, - "util.inspect": true + "assert.equal": true, + "events": true }, "globals": { - "process.platform": true + "process": true } }, - "gulp-watch>path-is-absolute": { - "globals": { - "process.platform": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width": { + "packages": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width>code-point-at": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width>is-fullwidth-code-point": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>strip-ansi": true } }, - "gulp-watch>vinyl-file": { - "builtin": { - "path.resolve": true - }, - "globals": { - "process.cwd": true - }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width>is-fullwidth-code-point": { "packages": { - "del>globby>pinkie-promise": true, - "fs-extra>graceful-fs": true, - "gulp-watch>vinyl-file>pify": true, - "gulp-watch>vinyl-file>strip-bom": true, - "gulp-watch>vinyl-file>strip-bom-stream": true, - "gulp-watch>vinyl-file>vinyl": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width>is-fullwidth-code-point>number-is-nan": true } }, - "gulp-watch>vinyl-file>strip-bom": { - "globals": { - "Buffer.isBuffer": true - }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>strip-ansi": { "packages": { - "gulp>vinyl-fs>remove-bom-buffer>is-utf8": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>strip-ansi>ansi-regex": true } }, - "gulp-watch>vinyl-file>strip-bom-stream": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>wide-align": { "packages": { - "gulp-watch>vinyl-file>strip-bom": true, - "gulp-watch>vinyl-file>strip-bom-stream>first-chunk-stream": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width": true } }, - "gulp-watch>vinyl-file>strip-bom-stream>first-chunk-stream": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>set-blocking": { + "globals": { + "process.stderr": true, + "process.stdout": true + } + }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf": { "builtin": { - "util.inherits": true + "assert": true, + "fs": true, + "path.join": true }, "globals": { - "Buffer.concat": true, - "setImmediate": true + "process.platform": true, + "setTimeout": true }, "packages": { - "readable-stream": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob": true } }, - "gulp-watch>vinyl-file>vinyl": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob": { + "builtin": { + "assert": true, + "events.EventEmitter": true, + "fs.lstat": true, + "fs.lstatSync": true, + "fs.readdir": true, + "fs.readdirSync": true, + "fs.stat": true, + "fs.statSync": true, + "path.join": true, + "path.resolve": true, + "util": true + }, + "globals": { + "console.error": true, + "process.cwd": true, + "process.nextTick": true, + "process.platform": true + }, + "packages": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>fs.realpath": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>inflight": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>inherits": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>once": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>path-is-absolute": true + } + }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>fs.realpath": { + "builtin": { + "fs.lstat": true, + "fs.lstatSync": true, + "fs.readlink": true, + "fs.readlinkSync": true, + "fs.realpath": true, + "fs.realpathSync": true, + "fs.stat": true, + "fs.statSync": true, + "path.normalize": true, + "path.resolve": true + }, + "globals": { + "console.error": true, + "console.trace": true, + "process.env.NODE_DEBUG": true, + "process.nextTick": true, + "process.noDeprecation": true, + "process.platform": true, + "process.throwDeprecation": true, + "process.traceDeprecation": true, + "process.version": true + } + }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>inflight": { + "globals": { + "process.nextTick": true + }, + "packages": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>once": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>once>wrappy": true + } + }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>inherits": { + "builtin": { + "util.inherits": true + } + }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch": { + "builtin": { + "path": true + }, + "globals": { + "console.error": true + }, + "packages": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch>brace-expansion": true + } + }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch>brace-expansion": { + "packages": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch>brace-expansion>balanced-match": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch>brace-expansion>concat-map": true + } + }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>once": { + "packages": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>once>wrappy": true + } + }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob>path-is-absolute": { + "globals": { + "process.platform": true + } + }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>semver": { + "globals": { + "console": true, + "process": true + } + }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>tar>safe-buffer": { + "builtin": { + "buffer": true + } + }, + "gulp-watch>chokidar>is-binary-path": { + "builtin": { + "path.extname": true + }, + "packages": { + "gulp-watch>chokidar>is-binary-path>binary-extensions": true + } + }, + "gulp-watch>chokidar>is-glob": { + "packages": { + "gulp-watch>chokidar>is-glob>is-extglob": true + } + }, + "gulp-watch>chokidar>readdirp": { "builtin": { - "buffer.Buffer": true, - "path.basename": true, - "path.dirname": true, - "path.extname": true, "path.join": true, "path.relative": true, + "util.inherits": true + }, + "globals": { + "setImmediate": true + }, + "packages": { + "fs-extra>graceful-fs": true, + "gulp-watch>chokidar>readdirp>micromatch": true, + "readable-stream": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch": { + "builtin": { + "path.basename": true, + "path.sep": true, + "util.inspect": true + }, + "globals": { + "process.platform": true + }, + "packages": { + "gulp-watch>chokidar>braces": true, + "gulp-watch>chokidar>readdirp>micromatch>arr-diff": true, + "gulp-watch>chokidar>readdirp>micromatch>array-unique": true, + "gulp-watch>chokidar>readdirp>micromatch>define-property": true, + "gulp-watch>chokidar>readdirp>micromatch>extend-shallow": true, + "gulp-watch>chokidar>readdirp>micromatch>extglob": true, + "gulp-watch>chokidar>readdirp>micromatch>kind-of": true, + "webpack>micromatch>fragment-cache": true, + "webpack>micromatch>nanomatch": true, + "webpack>micromatch>object.pick": true, + "webpack>micromatch>regex-not": true, + "webpack>micromatch>snapdragon": true, + "webpack>micromatch>to-regex": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>define-property": { + "packages": { + "gulp>gulp-cli>isobject": true, + "webpack>micromatch>define-property>is-descriptor": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extend-shallow": { + "packages": { + "gulp-watch>chokidar>readdirp>micromatch>extend-shallow>is-extendable": true, + "webpack>micromatch>extend-shallow>assign-symbols": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extend-shallow>is-extendable": { + "packages": { + "gulp>gulp-cli>liftoff>is-plain-object": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extglob": { + "packages": { + "gulp-watch>chokidar>readdirp>micromatch>array-unique": true, + "gulp-watch>chokidar>readdirp>micromatch>extglob>define-property": true, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets": true, + "gulp-watch>chokidar>readdirp>micromatch>extglob>extend-shallow": true, + "webpack>micromatch>fragment-cache": true, + "webpack>micromatch>regex-not": true, + "webpack>micromatch>snapdragon": true, + "webpack>micromatch>to-regex": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extglob>define-property": { + "packages": { + "webpack>micromatch>define-property>is-descriptor": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets": { + "globals": { + "__filename": true + }, + "packages": { + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>debug": true, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property": true, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>extend-shallow": true, + "webpack>micromatch>extglob>expand-brackets>posix-character-classes": true, + "webpack>micromatch>regex-not": true, + "webpack>micromatch>snapdragon": true, + "webpack>micromatch>to-regex": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>debug": { + "builtin": { + "fs.SyncWriteStream": true, + "net.Socket": true, + "tty.WriteStream": true, + "tty.isatty": true, + "util": true + }, + "globals": { + "chrome": true, + "console": true, + "document": true, + "localStorage": true, + "navigator": true, + "process": true + }, + "packages": { + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>debug>ms": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property": { + "packages": { + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor": { + "packages": { + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor>is-accessor-descriptor": true, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor>is-data-descriptor": true, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor>kind-of": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor>is-accessor-descriptor": { + "packages": { + "gulp-watch>anymatch>micromatch>kind-of": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>define-property>is-descriptor>is-data-descriptor": { + "packages": { + "gulp-watch>anymatch>micromatch>kind-of": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>extend-shallow": { + "packages": { + "gulp-watch>chokidar>readdirp>micromatch>extglob>expand-brackets>extend-shallow>is-extendable": true + } + }, + "gulp-watch>chokidar>readdirp>micromatch>extglob>extend-shallow": { + "packages": { + "gulp-watch>chokidar>readdirp>micromatch>extglob>extend-shallow>is-extendable": true + } + }, + "gulp-watch>fancy-log": { + "globals": { + "console": true, + "process.argv.indexOf": true, + "process.stderr.write": true, + "process.stdout.write": true + }, + "packages": { + "fancy-log>ansi-gray": true, + "fancy-log>color-support": true, + "fancy-log>time-stamp": true + } + }, + "gulp-watch>glob-parent": { + "builtin": { + "os.platform": true, + "path": true + }, + "packages": { + "gulp-watch>glob-parent>is-glob": true, + "gulp-watch>glob-parent>path-dirname": true + } + }, + "gulp-watch>glob-parent>is-glob": { + "packages": { + "gulp-watch>glob-parent>is-glob>is-extglob": true + } + }, + "gulp-watch>glob-parent>path-dirname": { + "builtin": { + "path": true, + "util.inspect": true + }, + "globals": { + "process.platform": true + } + }, + "gulp-watch>path-is-absolute": { + "globals": { + "process.platform": true + } + }, + "gulp-watch>vinyl-file": { + "builtin": { + "path.resolve": true + }, + "globals": { + "process.cwd": true + }, + "packages": { + "del>globby>pinkie-promise": true, + "fs-extra>graceful-fs": true, + "gulp-watch>vinyl-file>pify": true, + "gulp-watch>vinyl-file>strip-bom": true, + "gulp-watch>vinyl-file>strip-bom-stream": true, + "gulp-watch>vinyl-file>vinyl": true + } + }, + "gulp-watch>vinyl-file>strip-bom": { + "globals": { + "Buffer.isBuffer": true + }, + "packages": { + "gulp>vinyl-fs>remove-bom-buffer>is-utf8": true + } + }, + "gulp-watch>vinyl-file>strip-bom-stream": { + "packages": { + "gulp-watch>vinyl-file>strip-bom": true, + "gulp-watch>vinyl-file>strip-bom-stream>first-chunk-stream": true + } + }, + "gulp-watch>vinyl-file>strip-bom-stream>first-chunk-stream": { + "builtin": { + "util.inherits": true + }, + "globals": { + "Buffer.concat": true, + "setImmediate": true + }, + "packages": { + "readable-stream": true + } + }, + "gulp-watch>vinyl-file>vinyl": { + "builtin": { + "buffer.Buffer": true, + "path.basename": true, + "path.dirname": true, + "path.extname": true, + "path.join": true, + "path.relative": true, + "stream.PassThrough": true, + "stream.Stream": true + }, + "globals": { + "process.cwd": true + }, + "packages": { + "gulp-watch>vinyl-file>vinyl>clone": true, + "gulp-watch>vinyl-file>vinyl>clone-stats": true, + "gulp-watch>vinyl-file>vinyl>replace-ext": true + } + }, + "gulp-watch>vinyl-file>vinyl>clone": { + "globals": { + "Buffer": true + } + }, + "gulp-watch>vinyl-file>vinyl>clone-stats": { + "builtin": { + "fs.Stats": true + } + }, + "gulp-watch>vinyl-file>vinyl>replace-ext": { + "builtin": { + "path.basename": true, + "path.dirname": true, + "path.extname": true, + "path.join": true + } + }, + "gulp-zip": { + "builtin": { + "buffer.constants.MAX_LENGTH": true, + "path.join": true + }, + "packages": { + "gulp-zip>get-stream": true, + "gulp-zip>plugin-error": true, + "gulp-zip>through2": true, + "gulp-zip>yazl": true, + "vinyl": true + } + }, + "gulp-zip>get-stream": { + "builtin": { + "buffer.constants.MAX_LENGTH": true, + "stream.PassThrough": true + }, + "globals": { + "Buffer.concat": true + }, + "packages": { + "pump": true + } + }, + "gulp-zip>plugin-error": { + "builtin": { + "util.inherits": true + }, + "packages": { + "gulp-watch>ansi-colors": true, + "gulp-zip>plugin-error>arr-union": true, + "gulp-zip>plugin-error>extend-shallow": true, + "webpack>micromatch>arr-diff": true + } + }, + "gulp-zip>plugin-error>extend-shallow": { + "packages": { + "gulp-zip>plugin-error>extend-shallow>is-extendable": true, + "webpack>micromatch>extend-shallow>assign-symbols": true + } + }, + "gulp-zip>plugin-error>extend-shallow>is-extendable": { + "packages": { + "gulp>gulp-cli>liftoff>is-plain-object": true + } + }, + "gulp-zip>through2": { + "builtin": { + "util.inherits": true + }, + "globals": { + "process.nextTick": true + }, + "packages": { + "gulp-zip>through2>readable-stream": true + } + }, + "gulp-zip>through2>readable-stream": { + "builtin": { + "buffer.Buffer": true, + "events.EventEmitter": true, + "stream": true, + "util": true + }, + "globals": { + "process.env.READABLE_STREAM": true, + "process.nextTick": true, + "process.stderr": true, + "process.stdout": true + }, + "packages": { + "@storybook/api>util-deprecate": true, + "browserify>string_decoder": true, + "pumpify>inherits": true + } + }, + "gulp-zip>yazl": { + "builtin": { + "events.EventEmitter": true, + "fs.createReadStream": true, + "fs.stat": true, "stream.PassThrough": true, - "stream.Stream": true + "stream.Transform": true, + "util.inherits": true, + "zlib.DeflateRaw": true, + "zlib.deflateRaw": true }, "globals": { - "process.cwd": true + "Buffer": true, + "setImmediate": true, + "utf8FileName.length": true }, "packages": { - "gulp-watch>vinyl-file>vinyl>clone": true, - "gulp-watch>vinyl-file>vinyl>clone-stats": true, - "gulp-watch>vinyl-file>vinyl>replace-ext": true + "gulp-zip>yazl>buffer-crc32": true } }, - "gulp-watch>vinyl-file>vinyl>clone": { + "gulp-zip>yazl>buffer-crc32": { + "builtin": { + "buffer.Buffer": true + } + }, + "gulp>glob-watcher": { + "packages": { + "gulp>glob-watcher>anymatch": true, + "gulp>glob-watcher>async-done": true, + "gulp>glob-watcher>chokidar": true, + "gulp>glob-watcher>is-negated-glob": true, + "gulp>glob-watcher>just-debounce": true, + "gulp>undertaker>object.defaults": true + } + }, + "gulp>glob-watcher>anymatch": { + "builtin": { + "path.sep": true + }, + "packages": { + "gulp>glob-watcher>anymatch>micromatch": true, + "gulp>glob-watcher>anymatch>normalize-path": true + } + }, + "gulp>glob-watcher>anymatch>micromatch": { + "builtin": { + "path.basename": true, + "path.sep": true, + "util.inspect": true + }, "globals": { - "Buffer": true + "process.platform": true + }, + "packages": { + "3box>ipfs>kind-of": true, + "gulp>glob-watcher>anymatch>micromatch>define-property": true, + "gulp>glob-watcher>anymatch>micromatch>extend-shallow": true, + "gulp>glob-watcher>chokidar>braces": true, + "webpack>micromatch>arr-diff": true, + "webpack>micromatch>array-unique": true, + "webpack>micromatch>extglob": true, + "webpack>micromatch>fragment-cache": true, + "webpack>micromatch>nanomatch": true, + "webpack>micromatch>object.pick": true, + "webpack>micromatch>regex-not": true, + "webpack>micromatch>snapdragon": true, + "webpack>micromatch>to-regex": true } }, - "gulp-watch>vinyl-file>vinyl>clone-stats": { + "gulp>glob-watcher>anymatch>micromatch>define-property": { + "packages": { + "gulp>gulp-cli>isobject": true, + "webpack>micromatch>define-property>is-descriptor": true + } + }, + "gulp>glob-watcher>anymatch>micromatch>extend-shallow": { + "packages": { + "gulp>glob-watcher>anymatch>micromatch>extend-shallow>is-extendable": true, + "webpack>micromatch>extend-shallow>assign-symbols": true + } + }, + "gulp>glob-watcher>anymatch>micromatch>extend-shallow>is-extendable": { + "packages": { + "gulp>gulp-cli>liftoff>is-plain-object": true + } + }, + "gulp>glob-watcher>anymatch>normalize-path": { + "packages": { + "vinyl>remove-trailing-separator": true + } + }, + "gulp>glob-watcher>async-done": { "builtin": { - "fs.Stats": true + "domain.create": true + }, + "globals": { + "process.nextTick": true + }, + "packages": { + "end-of-stream": true, + "gulp>glob-watcher>async-done>stream-exhaust": true, + "pump>once": true, + "vinyl>cloneable-readable>process-nextick-args": true } }, - "gulp-watch>vinyl-file>vinyl>replace-ext": { + "gulp>glob-watcher>async-done>stream-exhaust": { + "builtin": { + "stream.Writable": true, + "util.inherits": true + }, + "globals": { + "setImmediate": true + } + }, + "gulp>glob-watcher>chokidar": { "builtin": { + "events.EventEmitter": true, + "fs": true, "path.basename": true, "path.dirname": true, "path.extname": true, - "path.join": true + "path.join": true, + "path.relative": true, + "path.resolve": true, + "path.sep": true + }, + "globals": { + "clearTimeout": true, + "console.error": true, + "process.env.CHOKIDAR_INTERVAL": true, + "process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR": true, + "process.env.CHOKIDAR_USEPOLLING": true, + "process.nextTick": true, + "process.platform": true, + "setTimeout": true + }, + "packages": { + "addons-linter>upath": true, + "eslint>is-glob": true, + "gulp-watch>chokidar>async-each": true, + "gulp-watch>path-is-absolute": true, + "gulp>glob-watcher>anymatch": true, + "gulp>glob-watcher>chokidar>braces": true, + "gulp>glob-watcher>chokidar>fsevents": true, + "gulp>glob-watcher>chokidar>glob-parent": true, + "gulp>glob-watcher>chokidar>is-binary-path": true, + "gulp>glob-watcher>chokidar>normalize-path": true, + "gulp>glob-watcher>chokidar>readdirp": true, + "pumpify>inherits": true } }, - "gulp-zip": { + "gulp>glob-watcher>chokidar>braces": { + "packages": { + "gulp>glob-watcher>chokidar>braces>fill-range": true, + "gulp>gulp-cli>isobject": true, + "gulp>undertaker>arr-flatten": true, + "webpack>micromatch>array-unique": true, + "webpack>micromatch>braces>repeat-element": true, + "webpack>micromatch>braces>snapdragon-node": true, + "webpack>micromatch>braces>split-string": true, + "webpack>micromatch>extglob>extend-shallow": true, + "webpack>micromatch>snapdragon": true, + "webpack>micromatch>to-regex": true + } + }, + "gulp>glob-watcher>chokidar>braces>fill-range": { "builtin": { - "buffer.constants.MAX_LENGTH": true, - "path.join": true + "util.inspect": true }, "packages": { - "gulp-zip>get-stream": true, - "gulp-zip>plugin-error": true, - "gulp-zip>through2": true, - "gulp-zip>yazl": true, - "vinyl": true + "gulp>glob-watcher>chokidar>braces>fill-range>is-number": true, + "gulp>glob-watcher>chokidar>braces>fill-range>to-regex-range": true, + "webpack>micromatch>braces>fill-range>repeat-string": true, + "webpack>micromatch>extglob>extend-shallow": true } }, - "gulp-zip>get-stream": { + "gulp>glob-watcher>chokidar>braces>fill-range>is-number": { + "packages": { + "gulp>glob-watcher>chokidar>braces>fill-range>is-number>kind-of": true + } + }, + "gulp>glob-watcher>chokidar>braces>fill-range>is-number>kind-of": { + "packages": { + "browserify>insert-module-globals>is-buffer": true + } + }, + "gulp>glob-watcher>chokidar>braces>fill-range>to-regex-range": { + "packages": { + "gulp>glob-watcher>chokidar>braces>fill-range>is-number": true, + "webpack>micromatch>braces>fill-range>repeat-string": true + } + }, + "gulp>glob-watcher>chokidar>fsevents": { "builtin": { - "buffer.constants.MAX_LENGTH": true, - "stream.PassThrough": true + "events.EventEmitter": true, + "fs.stat": true, + "path.join": true, + "util.inherits": true }, "globals": { - "Buffer.concat": true + "__dirname": true, + "process.nextTick": true, + "process.platform": true, + "setImmediate": true }, "packages": { - "pump": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp": true + } + }, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp": { + "builtin": { + "events.EventEmitter": true, + "fs.existsSync": true, + "fs.readFileSync": true, + "fs.renameSync": true, + "path.dirname": true, + "path.existsSync": true, + "path.join": true, + "path.resolve": true, + "url.parse": true, + "url.resolve": true, + "util.inherits": true + }, + "globals": { + "__dirname": true, + "console.log": true, + "process.arch": true, + "process.cwd": true, + "process.env": true, + "process.platform": true, + "process.version.substr": true, + "process.versions": true + }, + "packages": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>detect-libc": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>semver": true + } + }, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>detect-libc": { + "builtin": { + "child_process.spawnSync": true, + "fs.readdirSync": true, + "os.platform": true + }, + "globals": { + "process.env": true + } + }, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt": { + "builtin": { + "path": true, + "stream.Stream": true, + "url": true + }, + "globals": { + "console": true, + "process.argv": true, + "process.env.DEBUG_NOPT": true, + "process.env.NOPT_DEBUG": true, + "process.platform": true + }, + "packages": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt>abbrev": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt>osenv": true + } + }, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt>osenv": { + "builtin": { + "child_process.exec": true, + "path": true + }, + "globals": { + "process.env.COMPUTERNAME": true, + "process.env.ComSpec": true, + "process.env.EDITOR": true, + "process.env.HOSTNAME": true, + "process.env.PATH": true, + "process.env.PROMPT": true, + "process.env.PS1": true, + "process.env.Path": true, + "process.env.SHELL": true, + "process.env.USER": true, + "process.env.USERDOMAIN": true, + "process.env.USERNAME": true, + "process.env.VISUAL": true, + "process.env.path": true, + "process.nextTick": true, + "process.platform": true + }, + "packages": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-homedir": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-tmpdir": true } }, - "gulp-zip>plugin-error": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-homedir": { "builtin": { - "util.inherits": true + "os.homedir": true }, - "packages": { - "gulp-watch>ansi-colors": true, - "gulp-zip>plugin-error>arr-union": true, - "gulp-zip>plugin-error>extend-shallow": true, - "webpack>micromatch>arr-diff": true + "globals": { + "process.env": true, + "process.getuid": true, + "process.platform": true } }, - "gulp-zip>plugin-error>extend-shallow": { - "packages": { - "gulp-zip>plugin-error>extend-shallow>is-extendable": true, - "webpack>micromatch>extend-shallow>assign-symbols": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-tmpdir": { + "globals": { + "process.env.SystemRoot": true, + "process.env.TEMP": true, + "process.env.TMP": true, + "process.env.TMPDIR": true, + "process.env.windir": true, + "process.platform": true } }, - "gulp-zip>plugin-error>extend-shallow>is-extendable": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog": { + "builtin": { + "events.EventEmitter": true, + "util": true + }, + "globals": { + "process.nextTick": true, + "process.stderr": true + }, "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>console-control-strings": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>set-blocking": true } }, - "gulp-zip>through2": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet": { "builtin": { + "events.EventEmitter": true, "util.inherits": true }, - "globals": { - "process.nextTick": true - }, "packages": { - "gulp-zip>through2>readable-stream": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>delegates": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream": true } }, - "gulp-zip>through2>readable-stream": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream": { "builtin": { - "buffer.Buffer": true, "events.EventEmitter": true, "stream": true, "util": true }, "globals": { + "process.browser": true, "process.env.READABLE_STREAM": true, - "process.nextTick": true, "process.stderr": true, - "process.stdout": true + "process.stdout": true, + "process.version.slice": true, + "setImmediate": true }, "packages": { - "@storybook/api>util-deprecate": true, - "browserify>string_decoder": true, - "pumpify>inherits": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>core-util-is": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>isarray": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>process-nextick-args": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>string_decoder": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>util-deprecate": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>inherits": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>tar>safe-buffer": true } }, - "gulp-zip>yazl": { - "builtin": { - "events.EventEmitter": true, - "fs.createReadStream": true, - "fs.stat": true, - "stream.PassThrough": true, - "stream.Transform": true, - "util.inherits": true, - "zlib.DeflateRaw": true, - "zlib.deflateRaw": true - }, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>core-util-is": { "globals": { - "Buffer": true, - "setImmediate": true, - "utf8FileName.length": true - }, - "packages": { - "gulp-zip>yazl>buffer-crc32": true + "Buffer.isBuffer": true } }, - "gulp-zip>yazl>buffer-crc32": { - "builtin": { - "buffer.Buffer": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>process-nextick-args": { + "globals": { + "process": true } }, - "gulp>glob-watcher": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>string_decoder": { "packages": { - "gulp>glob-watcher>anymatch": true, - "gulp>glob-watcher>async-done": true, - "gulp>glob-watcher>chokidar": true, - "gulp>glob-watcher>is-negated-glob": true, - "gulp>glob-watcher>just-debounce": true, - "gulp>undertaker>object.defaults": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>tar>safe-buffer": true } }, - "gulp>glob-watcher>anymatch": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>util-deprecate": { "builtin": { - "path.sep": true + "util.deprecate": true + } + }, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge": { + "builtin": { + "util.format": true + }, + "globals": { + "clearInterval": true, + "process": true, + "setImmediate": true, + "setInterval": true }, "packages": { - "gulp>glob-watcher>anymatch>micromatch": true, - "gulp>glob-watcher>anymatch>normalize-path": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>console-control-strings": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>aproba": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>has-unicode": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>object-assign": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>signal-exit": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>strip-ansi": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>wide-align": true } }, - "gulp>glob-watcher>anymatch>micromatch": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>has-unicode": { "builtin": { - "path.basename": true, - "path.sep": true, - "util.inspect": true + "os.type": true }, "globals": { - "process.platform": true + "process.env.LANG": true, + "process.env.LC_ALL": true, + "process.env.LC_CTYPE": true + } + }, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>signal-exit": { + "builtin": { + "assert.equal": true, + "events": true }, - "packages": { - "3box>ipfs>kind-of": true, - "gulp>glob-watcher>anymatch>micromatch>define-property": true, - "gulp>glob-watcher>anymatch>micromatch>extend-shallow": true, - "gulp>glob-watcher>chokidar>braces": true, - "webpack>micromatch>arr-diff": true, - "webpack>micromatch>array-unique": true, - "webpack>micromatch>extglob": true, - "webpack>micromatch>fragment-cache": true, - "webpack>micromatch>nanomatch": true, - "webpack>micromatch>object.pick": true, - "webpack>micromatch>regex-not": true, - "webpack>micromatch>snapdragon": true, - "webpack>micromatch>to-regex": true + "globals": { + "process": true } }, - "gulp>glob-watcher>anymatch>micromatch>define-property": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width": { "packages": { - "gulp>gulp-cli>isobject": true, - "webpack>micromatch>define-property>is-descriptor": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width>code-point-at": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width>is-fullwidth-code-point": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>strip-ansi": true } }, - "gulp>glob-watcher>anymatch>micromatch>extend-shallow": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width>is-fullwidth-code-point": { "packages": { - "gulp>glob-watcher>anymatch>micromatch>extend-shallow>is-extendable": true, - "webpack>micromatch>extend-shallow>assign-symbols": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width>is-fullwidth-code-point>number-is-nan": true } }, - "gulp>glob-watcher>anymatch>micromatch>extend-shallow>is-extendable": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>strip-ansi": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>strip-ansi>ansi-regex": true } }, - "gulp>glob-watcher>anymatch>normalize-path": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>wide-align": { "packages": { - "vinyl>remove-trailing-separator": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width": true } }, - "gulp>glob-watcher>async-done": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>set-blocking": { + "globals": { + "process.stderr": true, + "process.stdout": true + } + }, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf": { "builtin": { - "domain.create": true + "assert": true, + "fs": true, + "path.join": true }, "globals": { - "process.nextTick": true + "process.platform": true, + "setTimeout": true }, "packages": { - "end-of-stream": true, - "gulp>glob-watcher>async-done>stream-exhaust": true, - "pump>once": true, - "vinyl>cloneable-readable>process-nextick-args": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob": true } }, - "gulp>glob-watcher>async-done>stream-exhaust": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob": { "builtin": { - "stream.Writable": true, - "util.inherits": true + "assert": true, + "events.EventEmitter": true, + "fs.lstat": true, + "fs.lstatSync": true, + "fs.readdir": true, + "fs.readdirSync": true, + "fs.stat": true, + "fs.statSync": true, + "path.join": true, + "path.resolve": true, + "util": true }, "globals": { - "setImmediate": true + "console.error": true, + "process.cwd": true, + "process.nextTick": true, + "process.platform": true + }, + "packages": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>fs.realpath": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>inflight": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>inherits": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>once": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>path-is-absolute": true } }, - "gulp>glob-watcher>chokidar": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>fs.realpath": { "builtin": { - "events.EventEmitter": true, - "fs": true, - "path.basename": true, - "path.dirname": true, - "path.extname": true, - "path.join": true, - "path.relative": true, - "path.resolve": true, - "path.sep": true + "fs.lstat": true, + "fs.lstatSync": true, + "fs.readlink": true, + "fs.readlinkSync": true, + "fs.realpath": true, + "fs.realpathSync": true, + "fs.stat": true, + "fs.statSync": true, + "path.normalize": true, + "path.resolve": true }, "globals": { - "clearTimeout": true, "console.error": true, - "process.env.CHOKIDAR_INTERVAL": true, - "process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR": true, - "process.env.CHOKIDAR_USEPOLLING": true, + "console.trace": true, + "process.env.NODE_DEBUG": true, "process.nextTick": true, + "process.noDeprecation": true, "process.platform": true, - "setTimeout": true + "process.throwDeprecation": true, + "process.traceDeprecation": true, + "process.version": true + } + }, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>inflight": { + "globals": { + "process.nextTick": true }, "packages": { - "addons-linter>upath": true, - "eslint>is-glob": true, - "gulp-watch>chokidar>async-each": true, - "gulp-watch>path-is-absolute": true, - "gulp>glob-watcher>anymatch": true, - "gulp>glob-watcher>chokidar>braces": true, - "gulp>glob-watcher>chokidar>glob-parent": true, - "gulp>glob-watcher>chokidar>is-binary-path": true, - "gulp>glob-watcher>chokidar>normalize-path": true, - "gulp>glob-watcher>chokidar>readdirp": true, - "pumpify>inherits": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>once": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>once>wrappy": true } }, - "gulp>glob-watcher>chokidar>braces": { - "packages": { - "gulp>glob-watcher>chokidar>braces>fill-range": true, - "gulp>gulp-cli>isobject": true, - "gulp>undertaker>arr-flatten": true, - "webpack>micromatch>array-unique": true, - "webpack>micromatch>braces>repeat-element": true, - "webpack>micromatch>braces>snapdragon-node": true, - "webpack>micromatch>braces>split-string": true, - "webpack>micromatch>extglob>extend-shallow": true, - "webpack>micromatch>snapdragon": true, - "webpack>micromatch>to-regex": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>inherits": { + "builtin": { + "util.inherits": true } }, - "gulp>glob-watcher>chokidar>braces>fill-range": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch": { "builtin": { - "util.inspect": true + "path": true + }, + "globals": { + "console.error": true }, "packages": { - "gulp>glob-watcher>chokidar>braces>fill-range>is-number": true, - "gulp>glob-watcher>chokidar>braces>fill-range>to-regex-range": true, - "webpack>micromatch>braces>fill-range>repeat-string": true, - "webpack>micromatch>extglob>extend-shallow": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch>brace-expansion": true } }, - "gulp>glob-watcher>chokidar>braces>fill-range>is-number": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch>brace-expansion": { "packages": { - "gulp>glob-watcher>chokidar>braces>fill-range>is-number>kind-of": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch>brace-expansion>balanced-match": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>minimatch>brace-expansion>concat-map": true } }, - "gulp>glob-watcher>chokidar>braces>fill-range>is-number>kind-of": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>once": { "packages": { - "browserify>insert-module-globals>is-buffer": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>once>wrappy": true } }, - "gulp>glob-watcher>chokidar>braces>fill-range>to-regex-range": { - "packages": { - "gulp>glob-watcher>chokidar>braces>fill-range>is-number": true, - "webpack>micromatch>braces>fill-range>repeat-string": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>rimraf>glob>path-is-absolute": { + "globals": { + "process.platform": true + } + }, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>semver": { + "globals": { + "console": true, + "process": true + } + }, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>tar>safe-buffer": { + "builtin": { + "buffer": true } }, "gulp>glob-watcher>chokidar>glob-parent": { @@ -6065,6 +6833,7 @@ "eslint>glob-parent": true, "eslint>is-glob": true, "sass>chokidar>braces": true, + "sass>chokidar>fsevents": true, "sass>chokidar>is-binary-path": true, "watchify>anymatch": true } @@ -6087,6 +6856,12 @@ "sass>chokidar>braces>fill-range>to-regex-range>is-number": true } }, + "sass>chokidar>fsevents": { + "globals": { + "process.platform": true + }, + "native": true + }, "sass>chokidar>is-binary-path": { "builtin": { "path.extname": true diff --git a/package.json b/package.json index 123d50c377d2..ff5b650fd0d9 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "@keystonehq/metamask-airgapped-keyring": "0.2.1", "@material-ui/core": "^4.11.0", "@metamask/contract-metadata": "^1.31.0", - "@metamask/controllers": "^28.0.0", + "@metamask/controllers": "^29.0.1", "@metamask/design-tokens": "^1.5.1", "@metamask/eth-ledger-bridge-keyring": "^0.12.0", "@metamask/eth-token-tracker": "^4.0.0", @@ -156,7 +156,7 @@ "eth-json-rpc-filters": "^4.2.1", "eth-json-rpc-infura": "^5.1.0", "eth-json-rpc-middleware": "^8.0.0", - "eth-keyring-controller": "^6.2.0", + "eth-keyring-controller": "^7.0.2", "eth-lattice-keyring": "^0.7.3", "eth-method-registry": "^2.0.0", "eth-query": "^2.1.2", diff --git a/patches/bip39+2.5.0.patch b/patches/bip39+2.5.0.patch deleted file mode 100644 index 2976f3bb2711..000000000000 --- a/patches/bip39+2.5.0.patch +++ /dev/null @@ -1,99 +0,0 @@ -diff --git a/node_modules/bip39/index.js b/node_modules/bip39/index.js -index aa0f29f..bee8008 100644 ---- a/node_modules/bip39/index.js -+++ b/node_modules/bip39/index.js -@@ -48,7 +48,9 @@ function salt (password) { - } - - function mnemonicToSeed (mnemonic, password) { -- var mnemonicBuffer = Buffer.from(unorm.nfkd(mnemonic), 'utf8') -+ var mnemonicBuffer = typeof mnemonic === 'string' -+ ? Buffer.from(unorm.nfkd(mnemonic), 'utf8') -+ : mnemonic - var saltBuffer = Buffer.from(salt(unorm.nfkd(password)), 'utf8') - - return pbkdf2(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512') -@@ -61,12 +63,28 @@ function mnemonicToSeedHex (mnemonic, password) { - function mnemonicToEntropy (mnemonic, wordlist) { - wordlist = wordlist || DEFAULT_WORDLIST - -- var words = unorm.nfkd(mnemonic).split(' ') -+ var mnemonicAsBuffer = typeof mnemonic === 'string' -+ ? Buffer.from(unorm.nfkd(mnemonic), 'utf8') -+ : mnemonic -+ -+ var words = []; -+ var currentWord = []; -+ for (const byte of mnemonicAsBuffer.values()) { -+ // split at space or \u3000 (ideographic space, for Japanese wordlists) -+ if (byte === 0x20 || byte === 0x3000) { -+ words.push(Buffer.from(currentWord)); -+ currentWord = []; -+ } else { -+ currentWord.push(byte); -+ } -+ } -+ words.push(Buffer.from(currentWord)); -+ - if (words.length % 3 !== 0) throw new Error(INVALID_MNEMONIC) - - // convert word indices to 11 bit binary strings - var bits = words.map(function (word) { -- var index = wordlist.indexOf(word) -+ var index = wordlist.indexOf(word.toString('utf8')) - if (index === -1) throw new Error(INVALID_MNEMONIC) - - return lpad(index.toString(2), '0', 11) -@@ -104,12 +122,41 @@ function entropyToMnemonic (entropy, wordlist) { - - var bits = entropyBits + checksumBits - var chunks = bits.match(/(.{1,11})/g) -- var words = chunks.map(function (binary) { -+ var wordsAsBuffers = chunks.map(function (binary) { - var index = binaryToByte(binary) -- return wordlist[index] -+ return Buffer.from(wordlist[index], 'utf8') - }) - -- return wordlist === JAPANESE_WORDLIST ? words.join('\u3000') : words.join(' ') -+ var bufferSize = wordsAsBuffers.reduce(function (bufferSize, wordAsBuffer, i) { -+ var shouldAddSeparator = i < wordsAsBuffers.length - 1 -+ return ( -+ bufferSize + -+ wordAsBuffer.length + -+ (shouldAddSeparator ? 1 : 0) -+ ) -+ }, 0) -+ var separator = wordlist === JAPANESE_WORDLIST ? '\u3000' : ' ' -+ var result = wordsAsBuffers.reduce(function (result, wordAsBuffer, i) { -+ var shouldAddSeparator = i < wordsAsBuffers.length - 1 -+ result.workingBuffer.set(wordAsBuffer, result.offset) -+ if (shouldAddSeparator) { -+ result.workingBuffer.write( -+ separator, -+ result.offset + wordAsBuffer.length, -+ separator.length, -+ 'utf8' -+ ) -+ } -+ return { -+ workingBuffer: result.workingBuffer, -+ offset: ( -+ result.offset + -+ wordAsBuffer.length + -+ (shouldAddSeparator ? 1 : 0) -+ ) -+ } -+ }, { workingBuffer: Buffer.alloc(bufferSize), offset: 0 }) -+ return result.workingBuffer; - } - - function generateMnemonic (strength, rng, wordlist) { -@@ -124,6 +171,7 @@ function validateMnemonic (mnemonic, wordlist) { - try { - mnemonicToEntropy(mnemonic, wordlist) - } catch (e) { -+ console.log('could not validate mnemonic', e) - return false - } - diff --git a/patches/eth-hd-keyring+3.6.0.patch b/patches/eth-hd-keyring+3.6.0.patch deleted file mode 100644 index 211cb89dd200..000000000000 --- a/patches/eth-hd-keyring+3.6.0.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/node_modules/eth-hd-keyring/index.js b/node_modules/eth-hd-keyring/index.js -index 19d1d7f..350d6b8 100644 ---- a/node_modules/eth-hd-keyring/index.js -+++ b/node_modules/eth-hd-keyring/index.js -@@ -17,8 +17,11 @@ class HdKeyring extends SimpleKeyring { - } - - serialize () { -+ const mnemonicAsBuffer = typeof this.mnemonic === 'string' -+ ? Buffer.from(this.mnemonic, 'utf8') -+ : this.mnemonic - return Promise.resolve({ -- mnemonic: this.mnemonic, -+ mnemonic: Array.from(mnemonicAsBuffer.values()), - numberOfAccounts: this.wallets.length, - hdPath: this.hdPath, - }) -@@ -69,9 +72,22 @@ class HdKeyring extends SimpleKeyring { - - /* PRIVATE METHODS */ - -- _initFromMnemonic (mnemonic) { -- this.mnemonic = mnemonic -- const seed = bip39.mnemonicToSeed(mnemonic) -+ /** -+ * Sets appropriate properties for the keyring based on the given -+ * BIP39-compliant mnemonic. -+ * -+ * @param {string|Array|Buffer} mnemonic - A seed phrase represented -+ * as a string, an array of UTF-8 bytes, or a Buffer. -+ */ -+ _initFromMnemonic(mnemonic) { -+ if (typeof mnemonic === 'string') { -+ this.mnemonic = Buffer.from(mnemonic, 'utf8') -+ } else if (Array.isArray(mnemonic)) { -+ this.mnemonic = Buffer.from(mnemonic) -+ } else { -+ this.mnemonic = mnemonic -+ } -+ const seed = bip39.mnemonicToSeed(this.mnemonic) - this.hdWallet = hdkey.fromMasterSeed(seed) - this.root = this.hdWallet.derivePath(this.hdPath) - } diff --git a/patches/eth-keyring-controller+6.2.1.patch b/patches/eth-keyring-controller+6.2.1.patch deleted file mode 100644 index aec0c716821d..000000000000 --- a/patches/eth-keyring-controller+6.2.1.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/node_modules/eth-keyring-controller/index.js b/node_modules/eth-keyring-controller/index.js -index 250ab98..38615aa 100644 ---- a/node_modules/eth-keyring-controller/index.js -+++ b/node_modules/eth-keyring-controller/index.js -@@ -84,15 +84,20 @@ class KeyringController extends EventEmitter { - * - * @emits KeyringController#unlock - * @param {string} password - The password to encrypt the vault with -- * @param {string} seed - The BIP44-compliant seed phrase. -+ * @param {string|Array} seedPhrase - The BIP39-compliant seed phrase, -+ * either as a string or an array of UTF-8 bytes that represent the string. - * @returns {Promise} A Promise that resolves to the state. - */ -- createNewVaultAndRestore (password, seed) { -+ createNewVaultAndRestore(password, seedPhrase) { -+ const seedPhraseAsBuffer = typeof seedPhrase === 'string' -+ ? Buffer.from(seedPhrase, 'utf8') -+ : Buffer.from(seedPhrase) -+ - if (typeof password !== 'string') { - return Promise.reject(new Error('Password must be text.')) - } - -- if (!bip39.validateMnemonic(seed)) { -+ if (!bip39.validateMnemonic(seedPhraseAsBuffer)) { - return Promise.reject(new Error('Seed phrase is invalid.')) - } - -@@ -101,7 +106,7 @@ class KeyringController extends EventEmitter { - return this.persistAllKeyrings(password) - .then(() => { - return this.addNewKeyring('HD Key Tree', { -- mnemonic: seed, -+ mnemonic: seedPhraseAsBuffer, - numberOfAccounts: 1, - }) - }) diff --git a/yarn.lock b/yarn.lock index e293734226e8..b4743608dd15 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2758,6 +2758,16 @@ semver "^7.3.5" yargs "^17.0.1" +"@metamask/bip39@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@metamask/bip39/-/bip39-4.0.0.tgz#1cb867a8454e3d45d065107b4e070d58bdb64aac" + integrity sha512-xH2g8mFe9p2WePnKeQJH4U8MB6pWPyvwpsz4stb0YdnMOR7cKA6Jm/KOSFiPKr1i9+AzNDImt/XxhwF5ej4jXQ== + dependencies: + "@types/node" "11.11.6" + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + "@metamask/contract-metadata@^1.31.0", "@metamask/contract-metadata@^1.33.0": version "1.33.0" resolved "https://registry.yarnpkg.com/@metamask/contract-metadata/-/contract-metadata-1.33.0.tgz#3f0501d5c6d9119ce09c1edb075fc0a8fed7d09c" @@ -2845,6 +2855,47 @@ web3 "^0.20.7" web3-provider-engine "^16.0.3" +"@metamask/controllers@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-29.0.1.tgz#8b6d066a23877c82de005ce566b7fd6bbaa7cc13" + integrity sha512-jOZiaOg9E0Th2Pq75kRNMtKmku7dba6KVvKA5olEd7YB+2tzCkBh+TU16RAS1RUQzGXahWvt+kXDV/FLFa2ixg== + dependencies: + "@ethereumjs/common" "^2.3.1" + "@ethereumjs/tx" "^3.2.1" + "@keystonehq/metamask-airgapped-keyring" "^0.3.0" + "@metamask/contract-metadata" "^1.33.0" + "@metamask/metamask-eth-abis" "3.0.0" + "@metamask/types" "^1.1.0" + "@types/uuid" "^8.3.0" + abort-controller "^3.0.0" + async-mutex "^0.2.6" + babel-runtime "^6.26.0" + deep-freeze-strict "^1.1.1" + eth-ens-namehash "^2.0.8" + eth-json-rpc-infura "^5.1.0" + eth-keyring-controller "^7.0.2" + eth-method-registry "1.1.0" + eth-phishing-detect "^1.1.16" + eth-query "^2.1.2" + eth-rpc-errors "^4.0.0" + eth-sig-util "^3.0.0" + ethereumjs-util "^7.0.10" + ethereumjs-wallet "^1.0.1" + ethers "^5.4.1" + ethjs-unit "^0.1.6" + fast-deep-equal "^3.1.3" + immer "^9.0.6" + isomorphic-fetch "^3.0.0" + json-rpc-engine "^6.1.0" + jsonschema "^1.2.4" + multiformats "^9.5.2" + nanoid "^3.1.31" + punycode "^2.1.1" + single-call-balance-checker-abi "^1.0.0" + uuid "^8.3.2" + web3 "^0.20.7" + web3-provider-engine "^16.0.3" + "@metamask/design-tokens@^1.5.1": version "1.5.1" resolved "https://registry.yarnpkg.com/@metamask/design-tokens/-/design-tokens-1.5.1.tgz#723f10bc5fe03ce14d47b1ad6190a835df62745a" @@ -2875,6 +2926,17 @@ resolved "https://registry.yarnpkg.com/@metamask/eslint-config/-/eslint-config-9.0.0.tgz#22d4911b705f7e4e566efbdda0e37912da33e30f" integrity sha512-mWlLGQKjXXFOj9EtDClKSoTLeQuPW2kM1w3EpUMf4goYAQ+kLXCCa8pEff6h8ApWAnjhYmXydA1znQ2J4XvD+A== +"@metamask/eth-hd-keyring@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@metamask/eth-hd-keyring/-/eth-hd-keyring-4.0.2.tgz#0a81556a556b361755c8d6fb5aced1ce5be0331c" + integrity sha512-v47VOTCCmZUZ6uxM5tQNoasQjLdrZADmgph2fhk4m7zKVUxDvYFU7FJT3Rm55fk8mg+dKSbEObDriqbdWeBbcA== + dependencies: + "@metamask/bip39" "^4.0.0" + "@metamask/eth-sig-util" "^4.0.0" + eth-simple-keyring "^4.2.0" + ethereumjs-util "^7.0.9" + ethereumjs-wallet "^1.0.1" + "@metamask/eth-ledger-bridge-keyring@^0.12.0": version "0.12.0" resolved "https://registry.yarnpkg.com/@metamask/eth-ledger-bridge-keyring/-/eth-ledger-bridge-keyring-0.12.0.tgz#d3986e0dbbfeab713f4e0338bf4e5c74a2265bdd" @@ -11204,7 +11266,7 @@ eth-json-rpc-middleware@^8.0.0: node-fetch "^2.6.7" pify "^3.0.0" -eth-keyring-controller@^6.2.0, eth-keyring-controller@^6.2.1: +eth-keyring-controller@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-6.2.1.tgz#61901071fc74059ed37cb5ae93870fdcae6e3781" integrity sha512-x2gTM1iHp2Kbvdtd9Eslysw0qzVZiqOzpVB3AU/ni2Xiit+rlcv2H80zYKjrEwlfWFDj4YILD3bOqlnEMmRJOA== @@ -11219,6 +11281,18 @@ eth-keyring-controller@^6.2.0, eth-keyring-controller@^6.2.1: loglevel "^1.5.0" obs-store "^4.0.3" +eth-keyring-controller@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-7.0.2.tgz#c4d7f9be179f08b3bb18410066bc4c8e91f50552" + integrity sha512-U4bqbXkTn7js/47rnFtVyBYQcvOKtmraD/YReBwuy4R56bFSJN8kinP0JJRl3WTtVfVS1l5A/jjsF3qk5TaTeg== + dependencies: + "@metamask/bip39" "^4.0.0" + "@metamask/eth-hd-keyring" "^4.0.2" + browser-passworder "^2.0.3" + eth-sig-util "^3.0.1" + eth-simple-keyring "^4.2.0" + obs-store "^4.0.3" + eth-lattice-keyring@^0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/eth-lattice-keyring/-/eth-lattice-keyring-0.7.3.tgz#fe27b1ff3f81535506be5804801da1bfdc379cbe" From eee4cc3100f02282e7e008b92d4a503284aa48ce Mon Sep 17 00:00:00 2001 From: Lachlan Tweedie <30222060+lachiet@users.noreply.github.com> Date: Thu, 12 May 2022 16:27:49 -0700 Subject: [PATCH 013/308] Add Coinbase Pay as fiat onramp option (#14648) --- app/_locales/en/messages.json | 11 ++++ app/scripts/constants/on-ramp.js | 1 + app/scripts/lib/buy-url.js | 30 +++++++++- shared/constants/network.js | 2 + .../deposit-ether-modal.component.js | 23 ++++++++ .../deposit-ether-modal.container.js | 5 ++ ui/components/ui/logo/logo-coinbasepay.js | 58 +++++++++++++++++++ ui/components/ui/logo/logo-coinbasepay.scss | 3 + ui/components/ui/logo/logo.stories.js | 2 + ui/components/ui/ui-components.scss | 1 + ui/selectors/selectors.js | 5 ++ 11 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 ui/components/ui/logo/logo-coinbasepay.js create mode 100644 ui/components/ui/logo/logo-coinbasepay.scss diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index b63775632c56..5908ec58ee03 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -411,6 +411,14 @@ "message": "Buy $1", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, + "buyCryptoWithCoinbasePay": { + "message": "Buy $1 with Coinbase Pay", + "description": "$1 represents the crypto symbol to be purchased" + }, + "buyCryptoWithCoinbasePayDescription": { + "message": "You can easily buy or transfer crypto with your Coinbase account.", + "description": "$1 represents the crypto symbol to be purchased" + }, "buyCryptoWithMoonPay": { "message": "Buy $1 with MoonPay", "description": "$1 represents the cypto symbol to be purchased" @@ -617,6 +625,9 @@ "continue": { "message": "Continue" }, + "continueToCoinbasePay": { + "message": "Continue to Coinbase Pay" + }, "continueToMoonPay": { "message": "Continue to MoonPay" }, diff --git a/app/scripts/constants/on-ramp.js b/app/scripts/constants/on-ramp.js index bfce16f700b6..0d621f46e8be 100644 --- a/app/scripts/constants/on-ramp.js +++ b/app/scripts/constants/on-ramp.js @@ -1,2 +1,3 @@ export const TRANSAK_API_KEY = '25ac1309-a49b-4411-b20e-5e56c61a5b1c'; // It's a public key, which will be included in a URL for Transak. export const MOONPAY_API_KEY = 'pk_live_WbCpe6PxSIcGPCSd6lKCbJNRht7uy'; // Publishable key. +export const COINBASEPAY_API_KEY = 'ab4b8829-a59d-44d3-accc-de77e4f18df2'; // Publishable key. diff --git a/app/scripts/lib/buy-url.js b/app/scripts/lib/buy-url.js index ba4a0d86f468..c26536b784b8 100644 --- a/app/scripts/lib/buy-url.js +++ b/app/scripts/lib/buy-url.js @@ -12,7 +12,11 @@ import { } from '../../../shared/constants/network'; import { SECOND } from '../../../shared/constants/time'; import getFetchWithTimeout from '../../../shared/modules/fetch-with-timeout'; -import { TRANSAK_API_KEY, MOONPAY_API_KEY } from '../constants/on-ramp'; +import { + TRANSAK_API_KEY, + MOONPAY_API_KEY, + COINBASEPAY_API_KEY, +} from '../constants/on-ramp'; const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); @@ -108,6 +112,28 @@ const createMoonPayUrl = async (walletAddress, chainId) => { return ''; }; +/** + * Create a Coinbase Pay Checkout URL. + * + * @param {string} walletAddress - Ethereum destination address + * @param {string} chainId - Current chain ID + * @returns String + */ +const createCoinbasePayUrl = (walletAddress, chainId) => { + const { coinbasePayCurrencies } = BUYABLE_CHAINS_MAP[chainId]; + const queryParams = new URLSearchParams({ + appId: COINBASEPAY_API_KEY, + attribution: 'extension', + destinationWallets: JSON.stringify([ + { + address: walletAddress, + assets: coinbasePayCurrencies, + }, + ]), + }); + return `https://pay.coinbase.com/buy?${queryParams}`; +}; + /** * Gives the caller a url at which the user can acquire eth, depending on the network they are in * @@ -132,6 +158,8 @@ export default async function getBuyUrl({ chainId, address, service }) { return createTransakUrl(address, chainId); case 'moonpay': return createMoonPayUrl(address, chainId); + case 'coinbase': + return createCoinbasePayUrl(address, chainId); case 'metamask-faucet': return 'https://faucet.metamask.io/'; case 'rinkeby-faucet': diff --git a/shared/constants/network.js b/shared/constants/network.js index 8036f36d4dcf..eed2bbaf2155 100644 --- a/shared/constants/network.js +++ b/shared/constants/network.js @@ -236,6 +236,7 @@ export const BUYABLE_CHAINS_MAP = { defaultCurrencyCode: 'eth', showOnlyCurrencies: 'eth,usdt,usdc,dai', }, + coinbasePayCurrencies: [ETH_SYMBOL, 'USDC', 'DAI'], }, [ROPSTEN_CHAIN_ID]: { nativeCurrency: TEST_NETWORK_TICKER_MAP[ROPSTEN], @@ -279,6 +280,7 @@ export const BUYABLE_CHAINS_MAP = { defaultCurrencyCode: 'avax_cchain', showOnlyCurrencies: 'avax_cchain', }, + coinbasePayCurrencies: [AVALANCHE_SYMBOL], }, [FANTOM_CHAIN_ID]: { nativeCurrency: FANTOM_SYMBOL, diff --git a/ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js b/ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js index 42730a460792..ca5b2e8af1b3 100644 --- a/ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js +++ b/ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.component.js @@ -9,6 +9,7 @@ import Button from '../../../ui/button'; import LogoMoonPay from '../../../ui/logo/logo-moonpay'; import LogoWyre from '../../../ui/logo/logo-wyre'; import LogoTransak from '../../../ui/logo/logo-transak'; +import LogoCoinbasePay from '../../../ui/logo/logo-coinbasepay'; import LogoDepositEth from '../../../ui/logo/logo-deposit-eth'; export default class DepositEtherModal extends Component { @@ -23,9 +24,11 @@ export default class DepositEtherModal extends Component { isMainnet: PropTypes.bool.isRequired, isBuyableTransakChain: PropTypes.bool.isRequired, isBuyableMoonPayChain: PropTypes.bool.isRequired, + isBuyableCoinbasePayChain: PropTypes.bool.isRequired, toWyre: PropTypes.func.isRequired, toTransak: PropTypes.func.isRequired, toMoonPay: PropTypes.func.isRequired, + toCoinbasePay: PropTypes.func.isRequired, address: PropTypes.string.isRequired, toFaucet: PropTypes.func.isRequired, hideWarning: PropTypes.func.isRequired, @@ -101,12 +104,14 @@ export default class DepositEtherModal extends Component { toWyre, toTransak, toMoonPay, + toCoinbasePay, address, toFaucet, isTestnet, isMainnet, isBuyableTransakChain, isBuyableMoonPayChain, + isBuyableCoinbasePayChain, } = this.props; const { t } = this.context; const networkName = NETWORK_TO_NAME_MAP[chainId]; @@ -131,6 +136,24 @@ export default class DepositEtherModal extends Component {
+ {this.renderRow({ + logo: , + title: t('buyCryptoWithCoinbasePay', [symbol]), + text: t('buyCryptoWithCoinbasePayDescription', [symbol]), + buttonLabel: t('continueToCoinbasePay'), + onButtonClick: () => { + this.context.trackEvent({ + category: EVENT.CATEGORIES.ACCOUNTS, + event: 'Click buy Ether via Coinbase Pay', + properties: { + action: 'Deposit Ether', + legacy_event: true, + }, + }); + toCoinbasePay(address, chainId); + }, + hide: !isBuyableCoinbasePayChain, + })} {this.renderRow({ logo: , title: t('buyCryptoWithTransak', [symbol]), diff --git a/ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.container.js b/ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.container.js index 227e630473cc..77e88cc2bab8 100644 --- a/ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.container.js +++ b/ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.container.js @@ -12,6 +12,7 @@ import { getSelectedAddress, getIsBuyableTransakChain, getIsBuyableMoonPayChain, + getIsBuyableCoinbasePayChain, } from '../../../../selectors/selectors'; import DepositEtherModal from './deposit-ether-modal.component'; @@ -23,6 +24,7 @@ function mapStateToProps(state) { address: getSelectedAddress(state), isBuyableTransakChain: getIsBuyableTransakChain(state), isBuyableMoonPayChain: getIsBuyableMoonPayChain(state), + isBuyableCoinbasePayChain: getIsBuyableCoinbasePayChain(state), }; } @@ -37,6 +39,9 @@ function mapDispatchToProps(dispatch) { toMoonPay: (address, chainId) => { dispatch(buyEth({ service: 'moonpay', address, chainId })); }, + toCoinbasePay: (address, chainId) => { + dispatch(buyEth({ service: 'coinbase', address, chainId })); + }, hideModal: () => { dispatch(hideModal()); }, diff --git a/ui/components/ui/logo/logo-coinbasepay.js b/ui/components/ui/logo/logo-coinbasepay.js new file mode 100644 index 000000000000..2b23e7391a7c --- /dev/null +++ b/ui/components/ui/logo/logo-coinbasepay.js @@ -0,0 +1,58 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +const LogoCoinbasePay = ({ + width = '100%', + className, + ariaLabel, + color = 'var(--color-text-default)', +}) => { + return ( + + + + + + + ); +}; + +LogoCoinbasePay.propTypes = { + /** + * The width of the logo. Defaults to 100% + */ + width: PropTypes.string, + /** + * The color of the logo defaults to var(--color-text-default) + */ + color: PropTypes.string, + /** + * Additional className to add to the root svg + */ + className: PropTypes.string, + /** + * Aria label to add to the logo component + */ + ariaLabel: PropTypes.string, +}; + +export default LogoCoinbasePay; diff --git a/ui/components/ui/logo/logo-coinbasepay.scss b/ui/components/ui/logo/logo-coinbasepay.scss new file mode 100644 index 000000000000..23f372dc8cec --- /dev/null +++ b/ui/components/ui/logo/logo-coinbasepay.scss @@ -0,0 +1,3 @@ +[data-theme=dark] .logo-coinbasepay path { + fill: var(--color-text-default); +} diff --git a/ui/components/ui/logo/logo.stories.js b/ui/components/ui/logo/logo.stories.js index 1867676ae002..9ee9001a3dbf 100644 --- a/ui/components/ui/logo/logo.stories.js +++ b/ui/components/ui/logo/logo.stories.js @@ -7,6 +7,7 @@ import Card from '../card'; import Box from '../box'; import Typography from '../typography'; +import LogoCoinbasePay from './logo-coinbasepay'; import LogoMoonPay from './logo-moonpay'; import LogoWyre from './logo-wyre'; import LogoTransak from './logo-transak'; @@ -68,6 +69,7 @@ export const DefaultStory = (args) => ( gridTemplateColumns: 'repeat(auto-fill, 176px)', }} > + } /> } /> } /> } /> diff --git a/ui/components/ui/ui-components.scss b/ui/components/ui/ui-components.scss index 52c0a8e95b1f..24cb6ddec9f6 100644 --- a/ui/components/ui/ui-components.scss +++ b/ui/components/ui/ui-components.scss @@ -30,6 +30,7 @@ @import 'list-item/index'; @import 'loading-heartbeat/index'; @import 'loading-indicator/loading-indicator'; +@import 'logo/logo-coinbasepay.scss'; @import 'loading-screen/index'; @import 'menu/menu'; @import 'numeric-input/numeric-input'; diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index a397c125da4c..50ee18dbdf56 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -693,6 +693,11 @@ export function getIsBuyableMoonPayChain(state) { return Boolean(BUYABLE_CHAINS_MAP?.[chainId]?.moonPay); } +export function getIsBuyableCoinbasePayChain(state) { + const chainId = getCurrentChainId(state); + return Boolean(BUYABLE_CHAINS_MAP?.[chainId]?.coinbasePayCurrencies); +} + export function getNativeCurrencyImage(state) { const nativeCurrency = getNativeCurrency(state).toUpperCase(); return NATIVE_CURRENCY_TOKEN_IMAGE_MAP[nativeCurrency]; From ae4efef43e8e1c760d7a67516ccf2629e0719836 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Fri, 13 May 2022 12:01:29 -0500 Subject: [PATCH 014/308] add networks without ticker trait (#14607) * add networks without ticker trait --- app/scripts/controllers/metametrics.js | 9 +++++++++ app/scripts/controllers/metametrics.test.js | 10 +++++++--- shared/constants/metametrics.js | 7 +++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/scripts/controllers/metametrics.js b/app/scripts/controllers/metametrics.js index 8c1ecbca1bc8..8348513c111a 100644 --- a/app/scripts/controllers/metametrics.js +++ b/app/scripts/controllers/metametrics.js @@ -558,6 +558,15 @@ export default class MetaMetricsController { [TRAITS.NETWORKS_ADDED]: metamaskState.frequentRpcListDetail.map( (rpc) => rpc.chainId, ), + [TRAITS.NETWORKS_WITHOUT_TICKER]: metamaskState.frequentRpcListDetail.reduce( + (networkList, currentNetwork) => { + if (!currentNetwork.ticker) { + networkList.push(currentNetwork.chainId); + } + return networkList; + }, + [], + ), [TRAITS.NFT_AUTODETECTION_ENABLED]: metamaskState.useCollectibleDetection, [TRAITS.NUMBER_OF_ACCOUNTS]: Object.values(metamaskState.identities) .length, diff --git a/app/scripts/controllers/metametrics.test.js b/app/scripts/controllers/metametrics.test.js index 76982e445356..804132295ab1 100644 --- a/app/scripts/controllers/metametrics.test.js +++ b/app/scripts/controllers/metametrics.test.js @@ -9,8 +9,10 @@ import { } from '../../../shared/constants/metametrics'; import waitUntilCalled from '../../../test/lib/wait-until-called'; import { + ETH_SYMBOL, MAINNET_CHAIN_ID, ROPSTEN_CHAIN_ID, + TEST_ETH_SYMBOL, } from '../../../shared/constants/network'; import MetaMetricsController from './metametrics'; import { NETWORK_EVENTS } from './network'; @@ -673,8 +675,9 @@ describe('MetaMetricsController', function () { }, allTokens: MOCK_ALL_TOKENS, frequentRpcListDetail: [ - { chainId: MAINNET_CHAIN_ID }, - { chainId: ROPSTEN_CHAIN_ID }, + { chainId: MAINNET_CHAIN_ID, ticker: ETH_SYMBOL }, + { chainId: ROPSTEN_CHAIN_ID, ticker: TEST_ETH_SYMBOL }, + { chainId: '0xaf' }, ], identities: [{}, {}], ledgerTransportType: 'web-hid', @@ -688,7 +691,8 @@ describe('MetaMetricsController', function () { assert.deepEqual(traits, { [TRAITS.ADDRESS_BOOK_ENTRIES]: 3, [TRAITS.LEDGER_CONNECTION_TYPE]: 'web-hid', - [TRAITS.NETWORKS_ADDED]: [MAINNET_CHAIN_ID, ROPSTEN_CHAIN_ID], + [TRAITS.NETWORKS_ADDED]: [MAINNET_CHAIN_ID, ROPSTEN_CHAIN_ID, '0xaf'], + [TRAITS.NETWORKS_WITHOUT_TICKER]: ['0xaf'], [TRAITS.NFT_AUTODETECTION_ENABLED]: false, [TRAITS.NUMBER_OF_ACCOUNTS]: 2, [TRAITS.NUMBER_OF_NFT_COLLECTIONS]: 3, diff --git a/shared/constants/metametrics.js b/shared/constants/metametrics.js index d2c9e6663318..1751c2a5549e 100644 --- a/shared/constants/metametrics.js +++ b/shared/constants/metametrics.js @@ -164,6 +164,9 @@ * trait * @property {'networks_added'} NETWORKS_ADDED - when user modifies networks * we identify the networks_added trait + * @property {'networks_without_ticker'} NETWORKS_WITHOUT_TICKER - when user + * modifies networks we identify the networks_without_ticker trait for + * networks without a ticker. * @property {'nft_autodetection_enabled'} NFT_AUTODETECTION_ENABLED - when Autodetect NFTs * feature is toggled we identify the nft_autodetection_enabled trait * @property {'number_of_accounts'} NUMBER_OF_ACCOUNTS - when identities @@ -191,6 +194,7 @@ export const TRAITS = { ADDRESS_BOOK_ENTRIES: 'address_book_entries', LEDGER_CONNECTION_TYPE: 'ledger_connection_type', NETWORKS_ADDED: 'networks_added', + NETWORKS_WITHOUT_TICKER: 'networks_without_ticker', NFT_AUTODETECTION_ENABLED: 'nft_autodetection_enabled', NUMBER_OF_ACCOUNTS: 'number_of_accounts', NUMBER_OF_NFT_COLLECTIONS: 'number_of_nft_collections', @@ -210,6 +214,9 @@ export const TRAITS = { * type of ledger connection set by user preference. * @property {Array} [networks_added] - An array consisting of chainIds * that indicate the networks a user has added to their MetaMask. + * @property {Array} [networks_without_ticker] - An array consisting of + * chainIds that indicate the networks added by the user that do not have a + * ticker. * @property {number} [nft_autodetection_enabled] - does the user have the * use collection/nft detection enabled? * @property {number} [number_of_accounts] - A number representing the number From 8a14504b6381bc62af9423a1be6d6e53aa5d5cf3 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Sat, 14 May 2022 21:03:06 -0230 Subject: [PATCH 015/308] Version v10.14.5 This version is equivalent to v10.14.2. This release is just intended to fix build configuration issues. --- CHANGELOG.md | 17 ++++++++++++++++- package.json | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4980628ee45f..0da81e0ac812 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [10.14.5] +### Fixed +- This release was deployed to fix a configuration issue. + +## [10.14.4] +### Fixed +- This release was deployed to fix a configuration issue. + +## [10.14.3] +### Fixed +- This release was deployed to fix a configuration issue. + ## [10.14.2] ### Fixed - Make build deterministic (#14610) @@ -2894,7 +2906,10 @@ 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.14.2...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.14.5...HEAD +[10.14.5]: https://github.com/MetaMask/metamask-extension/compare/v10.14.4...v10.14.5 +[10.14.4]: https://github.com/MetaMask/metamask-extension/compare/v10.14.3...v10.14.4 +[10.14.3]: https://github.com/MetaMask/metamask-extension/compare/v10.14.2...v10.14.3 [10.14.2]: https://github.com/MetaMask/metamask-extension/compare/v10.14.1...v10.14.2 [10.14.1]: https://github.com/MetaMask/metamask-extension/compare/v10.13.0...v10.14.1 [10.13.0]: https://github.com/MetaMask/metamask-extension/compare/v10.12.4...v10.13.0 diff --git a/package.json b/package.json index 549f139bf42c..ccc788828256 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.14.2", + "version": "10.14.5", "private": true, "repository": { "type": "git", From f4094925f0f8e8a12e5b2f272a8402f0d5318af5 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Thu, 12 May 2022 13:36:14 -0230 Subject: [PATCH 016/308] Ensure ledger keyring message event listener are removed on metamask lock (#14691) * Ensure ledger keyring message event listener are removed on metamask lock * Clean up --- app/scripts/metamask-controller.js | 6 ++++++ lavamoat/browserify/beta/policy.json | 3 ++- lavamoat/browserify/flask/policy.json | 3 ++- lavamoat/browserify/main/policy.json | 3 ++- package.json | 2 +- yarn.lock | 8 ++++---- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 6baeb0601e54..d7a7482c761f 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -4104,6 +4104,12 @@ export default class MetamaskController extends EventEmitter { if (trezorKeyring) { trezorKeyring.dispose(); } + + const [ledgerKeyring] = this.keyringController.getKeyringsByType( + KEYRING_TYPES.LEDGER, + ); + ledgerKeyring?.destroy?.(); + return this.keyringController.setLocked(); } diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 2d82ff97ed98..f9e3d233a229 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2750,7 +2750,8 @@ "globals": { "clearInterval": true, "setInterval": true, - "setTimeout": true + "setTimeout": true, + "removeEventListener": true }, "packages": { "events": true diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 6783285f92c9..078a311777db 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2768,7 +2768,8 @@ "globals": { "clearInterval": true, "setInterval": true, - "setTimeout": true + "setTimeout": true, + "removeEventListener": true }, "packages": { "events": true diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 2d82ff97ed98..f9e3d233a229 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2750,7 +2750,8 @@ "globals": { "clearInterval": true, "setInterval": true, - "setTimeout": true + "setTimeout": true, + "removeEventListener": true }, "packages": { "events": true diff --git a/package.json b/package.json index 53ae1a4c8e9a..64ef423f1108 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "@metamask/contract-metadata": "^1.31.0", "@metamask/controllers": "^28.0.0", "@metamask/design-tokens": "^1.5.1", - "@metamask/eth-ledger-bridge-keyring": "^0.11.0", + "@metamask/eth-ledger-bridge-keyring": "^0.12.0", "@metamask/eth-token-tracker": "^4.0.0", "@metamask/etherscan-link": "^2.1.0", "@metamask/iframe-execution-environment-service": "^0.11.1", diff --git a/yarn.lock b/yarn.lock index a232ee637373..0e6908768fc5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2842,10 +2842,10 @@ resolved "https://registry.yarnpkg.com/@metamask/eslint-config/-/eslint-config-9.0.0.tgz#22d4911b705f7e4e566efbdda0e37912da33e30f" integrity sha512-mWlLGQKjXXFOj9EtDClKSoTLeQuPW2kM1w3EpUMf4goYAQ+kLXCCa8pEff6h8ApWAnjhYmXydA1znQ2J4XvD+A== -"@metamask/eth-ledger-bridge-keyring@^0.11.0": - version "0.11.0" - resolved "https://registry.yarnpkg.com/@metamask/eth-ledger-bridge-keyring/-/eth-ledger-bridge-keyring-0.11.0.tgz#8502e2fd36c89aff7de6724354217274917cecd3" - integrity sha512-fCwM8LYC6SXLfsKc4oNiAatz2X8p/pjbM5zMfm4nb4sZPshBAWU32M4vnB3BSVeQEsisGuLfOWCOWhxmq25n+Q== +"@metamask/eth-ledger-bridge-keyring@^0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@metamask/eth-ledger-bridge-keyring/-/eth-ledger-bridge-keyring-0.12.0.tgz#d3986e0dbbfeab713f4e0338bf4e5c74a2265bdd" + integrity sha512-kceBQc/wKCAdChZeI1P0Fs0FS15WtiD2Q87MqmfuJYpOriWRx/RmjKZoa6EJe2vy20KurlZRcKIiU8nFQ0e/ag== dependencies: "@ethereumjs/tx" "^3.2.0" eth-sig-util "^2.0.0" From 214211f847941221e8d328352d8b4260e56ab86c Mon Sep 17 00:00:00 2001 From: ryanml Date: Mon, 16 May 2022 07:07:19 -0700 Subject: [PATCH 017/308] Update Lavamoat policies --- lavamoat/browserify/beta/policy.json | 3 ++- lavamoat/browserify/flask/policy.json | 3 ++- lavamoat/browserify/main/policy.json | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index f9e3d233a229..126796a99e5c 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -585,7 +585,8 @@ "console.log": true, "document.createElement": true, "document.head.appendChild": true, - "fetch": true + "fetch": true, + "removeEventListener": true }, "packages": { "@ethereumjs/tx": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 078a311777db..8f7562e632b2 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -585,7 +585,8 @@ "console.log": true, "document.createElement": true, "document.head.appendChild": true, - "fetch": true + "fetch": true, + "removeEventListener": true }, "packages": { "@ethereumjs/tx": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index f9e3d233a229..126796a99e5c 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -585,7 +585,8 @@ "console.log": true, "document.createElement": true, "document.head.appendChild": true, - "fetch": true + "fetch": true, + "removeEventListener": true }, "packages": { "@ethereumjs/tx": true, From f251ca4ff236864983f6ebe933c28ee77711fee0 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Wed, 4 May 2022 11:54:46 -0500 Subject: [PATCH 018/308] Track send flow history on txMeta (#14510) --- app/scripts/controllers/transactions/index.js | 38 ++- .../transactions/tx-state-manager.js | 1 + app/scripts/metamask-controller.js | 3 + ui/ducks/send/send.js | 100 +++++- ui/ducks/send/send.test.js | 293 +++++++++++++----- .../add-recipient/add-recipient.component.js | 20 +- .../add-recipient/add-recipient.container.js | 2 + ui/pages/send/send.js | 19 +- ui/store/actions.js | 30 ++ 9 files changed, 415 insertions(+), 91 deletions(-) diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index e982b962f89a..e5d50375f59e 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -647,6 +647,35 @@ export default class TransactionController extends EventEmitter { return this._getTransaction(txId); } + /** + * append new sendFlowHistory to the transaction with id if the transaction + * state is unapproved. Returns the updated transaction. + * + * @param {string} txId - transaction id + * @param {Array<{ entry: string, timestamp: number }>} sendFlowHistory - + * history to add to the sendFlowHistory property of txMeta. + * @returns {TransactionMeta} the txMeta of the updated transaction + */ + updateTransactionSendFlowHistory(txId, sendFlowHistory) { + this._throwErrorIfNotUnapprovedTx(txId, 'updateTransactionSendFlowHistory'); + const txMeta = this._getTransaction(txId); + + // only update what is defined + const note = `Update sendFlowHistory for ${txId}`; + + this.txStateManager.updateTransaction( + { + ...txMeta, + sendFlowHistory: [ + ...(txMeta?.sendFlowHistory ?? []), + ...sendFlowHistory, + ], + }, + note, + ); + return this._getTransaction(txId); + } + // ==================================================================================================================================================== /** @@ -656,9 +685,15 @@ export default class TransactionController extends EventEmitter { * @param txParams * @param origin * @param transactionType + * @param sendFlowHistory * @returns {txMeta} */ - async addUnapprovedTransaction(txParams, origin, transactionType) { + async addUnapprovedTransaction( + txParams, + origin, + transactionType, + sendFlowHistory = [], + ) { if ( transactionType !== undefined && !VALID_UNAPPROVED_TRANSACTION_TYPES.includes(transactionType) @@ -683,6 +718,7 @@ export default class TransactionController extends EventEmitter { let txMeta = this.txStateManager.generateTxMeta({ txParams: normalizedTxParams, origin, + sendFlowHistory, }); if (origin === ORIGIN_METAMASK) { diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index 111392fad72e..33e23bbf847a 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -127,6 +127,7 @@ export default class TransactionStateManager extends EventEmitter { chainId, loadingDefaults: true, dappSuggestedGasFees, + sendFlowHistory: [], ...opts, }; } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index d7a7482c761f..fea64e68d991 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1632,6 +1632,9 @@ export default class MetamaskController extends EventEmitter { updateTransactionGasFees: txController.updateTransactionGasFees.bind( txController, ), + updateTransactionSendFlowHistory: txController.updateTransactionSendFlowHistory.bind( + txController, + ), updateSwapApprovalTransaction: txController.updateSwapApprovalTransaction.bind( txController, diff --git a/ui/ducks/send/send.js b/ui/ducks/send/send.js index 76546ac046cb..a812e34a1b18 100644 --- a/ui/ducks/send/send.js +++ b/ui/ducks/send/send.js @@ -60,6 +60,7 @@ import { getTokenStandardAndDetails, showModal, addUnapprovedTransactionAndRouteToConfirmationPage, + updateTransactionSendFlowHistory, } from '../../store/actions'; import { setCustomGasLimit } from '../gas/gas.duck'; import { @@ -110,6 +111,7 @@ import { import { readAddressAsContract } from '../../../shared/modules/contract-utils'; import { INVALID_ASSET_TYPE } from '../../helpers/constants/error-keys'; import { isEqualCaseInsensitive } from '../../../shared/modules/string-utils'; +import { getValueFromWeiHex } from '../../helpers/utils/confirm-tx.util'; // typedefs /** * @typedef {import('@reduxjs/toolkit').PayloadAction} PayloadAction @@ -684,12 +686,19 @@ export const initialState = { // Layer 1 gas fee total on multi-layer fee networks layer1GasTotal: '0x0', }, + history: [], }; const slice = createSlice({ name, initialState, reducers: { + addHistoryEntry: (state, action) => { + state.history.push({ + entry: action.payload, + timestamp: Date.now(), + }); + }, /** * update current amount.value in state and run post update validation of * the amount field and the send state. Recomputes the draftTransaction @@ -1402,9 +1411,10 @@ const { updateGasLimit, validateRecipientUserInput, updateRecipientSearchMode, + addHistoryEntry, } = actions; -export { useDefaultGas, useCustomGas, updateGasLimit }; +export { useDefaultGas, useCustomGas, updateGasLimit, addHistoryEntry }; // Action Creators @@ -1421,6 +1431,9 @@ export { useDefaultGas, useCustomGas, updateGasLimit }; */ export function updateGasPrice(gasPrice) { return (dispatch) => { + dispatch( + addHistoryEntry(`sendFlow - user set legacy gasPrice to ${gasPrice}`), + ); dispatch( actions.updateGasFees({ gasPrice, @@ -1452,8 +1465,36 @@ export function resetSendState() { */ export function updateSendAmount(amount) { return async (dispatch, getState) => { - await dispatch(actions.updateSendAmount(amount)); const state = getState(); + let logAmount = amount; + if (state[name].asset.type === ASSET_TYPES.TOKEN) { + const multiplier = Math.pow( + 10, + Number(state[name].asset.details?.decimals || 0), + ); + const decimalValueString = conversionUtil(addHexPrefix(amount), { + fromNumericBase: 'hex', + toNumericBase: 'dec', + toCurrency: state[name].asset.details?.symbol, + conversionRate: multiplier, + invertConversionRate: true, + }); + + logAmount = `${Number(decimalValueString) ? decimalValueString : ''} ${ + state[name].asset.details?.symbol + }`; + } else { + const ethValue = getValueFromWeiHex({ + value: amount, + toCurrency: ETH, + numberOfDecimals: 8, + }); + logAmount = `${ethValue} ${ETH}`; + } + await dispatch( + addHistoryEntry(`sendFlow - user set amount to ${logAmount}`), + ); + await dispatch(actions.updateSendAmount(amount)); if (state.send.amount.mode === AMOUNT_MODES.MAX) { await dispatch(actions.updateAmountMode(AMOUNT_MODES.INPUT)); } @@ -1482,6 +1523,19 @@ export function updateSendAmount(amount) { */ export function updateSendAsset({ type, details }) { return async (dispatch, getState) => { + dispatch(addHistoryEntry(`sendFlow - user set asset type to ${type}`)); + dispatch( + addHistoryEntry( + `sendFlow - user set asset symbol to ${details?.symbol ?? 'undefined'}`, + ), + ); + dispatch( + addHistoryEntry( + `sendFlow - user set asset address to ${ + details?.address ?? 'undefined' + }`, + ), + ); const state = getState(); let { balance, error } = state.send.asset; const userAddress = state.send.account.address ?? getSelectedAddress(state); @@ -1580,6 +1634,11 @@ export function updateSendAsset({ type, details }) { * it only applicable for use within action creators. */ const debouncedValidateRecipientUserInput = debounce((dispatch, payload) => { + dispatch( + addHistoryEntry( + `sendFlow - user typed ${payload.userInput} into recipient input field`, + ), + ); dispatch(validateRecipientUserInput(payload)); }, 300); @@ -1600,6 +1659,7 @@ export function updateRecipientUserInput(userInput) { const useTokenDetection = getUseTokenDetection(state); const tokenAddressList = Object.keys(getTokenList(state)); debouncedValidateRecipientUserInput(dispatch, { + userInput, chainId, tokens, useTokenDetection, @@ -1610,12 +1670,22 @@ export function updateRecipientUserInput(userInput) { export function useContactListForRecipientSearch() { return (dispatch) => { + dispatch( + addHistoryEntry( + `sendFlow - user selected back to all on recipient screen`, + ), + ); dispatch(updateRecipientSearchMode(RECIPIENT_SEARCH_MODES.CONTACT_LIST)); }; } export function useMyAccountsForRecipientSearch() { return (dispatch) => { + dispatch( + addHistoryEntry( + `sendFlow - user selected transfer to my accounts on recipient screen`, + ), + ); dispatch(updateRecipientSearchMode(RECIPIENT_SEARCH_MODES.MY_ACCOUNTS)); }; } @@ -1638,6 +1708,8 @@ export function useMyAccountsForRecipientSearch() { */ export function updateRecipient({ address, nickname }) { return async (dispatch, getState) => { + // Do not addHistoryEntry here as this is called from a number of places + // each with significance to the user and transaction history. const state = getState(); const nicknameFromAddressBookEntryOrAccountName = getAddressBookEntryOrAccountName(state, address) ?? ''; @@ -1656,6 +1728,7 @@ export function updateRecipient({ address, nickname }) { */ export function resetRecipientInput() { return async (dispatch) => { + await dispatch(addHistoryEntry(`sendFlow - user cleared recipient input`)); await dispatch(updateRecipientUserInput('')); await dispatch(updateRecipient({ address: '', nickname: '' })); await dispatch(resetEnsResolution()); @@ -1675,6 +1748,9 @@ export function resetRecipientInput() { */ export function updateSendHexData(hexData) { return async (dispatch, getState) => { + await dispatch( + addHistoryEntry(`sendFlow - user added custom hexData ${hexData}`), + ); await dispatch(actions.updateUserInputHexData(hexData)); const state = getState(); if (state.send.asset.type === ASSET_TYPES.NATIVE) { @@ -1695,9 +1771,11 @@ export function toggleSendMaxMode() { if (state.send.amount.mode === AMOUNT_MODES.MAX) { await dispatch(actions.updateAmountMode(AMOUNT_MODES.INPUT)); await dispatch(actions.updateSendAmount('0x0')); + await dispatch(addHistoryEntry(`sendFlow - user toggled max mode off`)); } else { await dispatch(actions.updateAmountMode(AMOUNT_MODES.MAX)); await dispatch(actions.updateAmountToMax()); + await dispatch(addHistoryEntry(`sendFlow - user toggled max mode on`)); } await dispatch(computeEstimatedGasLimit()); }; @@ -1746,6 +1824,12 @@ export function signTransaction() { eip1559support ? eip1559OnlyTxParamsToUpdate : txParams, ), }; + await dispatch( + addHistoryEntry( + `sendFlow - user clicked next and transaction should be updated in controller`, + ), + ); + await dispatch(updateTransactionSendFlowHistory(id, state[name].history)); dispatch(updateEditableParams(id, editingTx.txParams)); dispatch(updateTransactionGasFees(id, editingTx.txParams)); } else { @@ -1757,10 +1841,17 @@ export function signTransaction() { ? TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM : TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER; } + await dispatch( + addHistoryEntry( + `sendFlow - user clicked next and transaction should be added to controller`, + ), + ); + dispatch( addUnapprovedTransactionAndRouteToConfirmationPage( txParams, transactionType, + state[name].history, ), ); } @@ -1775,6 +1866,11 @@ export function editTransaction( ) { return async (dispatch, getState) => { const state = getState(); + await dispatch( + addHistoryEntry( + `sendFlow - user clicked edit on transaction with id ${transactionId}`, + ), + ); const unapprovedTransactions = getUnapprovedTxs(state); const transaction = unapprovedTransactions[transactionId]; const { txParams } = transaction; diff --git a/ui/ducks/send/send.test.js b/ui/ducks/send/send.test.js index 8e16486db88d..a8466753bbda 100644 --- a/ui/ducks/send/send.test.js +++ b/ui/ducks/send/send.test.js @@ -80,9 +80,10 @@ jest.mock('./send', () => { setBackgroundConnection({ addPollingTokenToAppState: jest.fn(), - addUnapprovedTransaction: jest.fn((_x, _y, _z, cb) => { - return cb(null, {}); + addUnapprovedTransaction: jest.fn((_w, _x, _y, _z, cb) => { + cb(null); }), + updateTransactionSendFlowHistory: jest.fn((_x, _y, cb) => cb(null)), }); describe('Send Slice', () => { @@ -1247,6 +1248,10 @@ describe('Send Slice', () => { const actionResult = store.getActions(); const expectedActionResult = [ + { + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set legacy gasPrice to 0x0', + }, { type: 'send/updateGasFees', payload: { @@ -1302,22 +1307,28 @@ describe('Send Slice', () => { }; const store = mockStore(sendState); - const newSendAmount = 'aNewSendAmount'; + const newSendAmount = 'DE0B6B3A7640000'; await store.dispatch(updateSendAmount(newSendAmount)); const actionResult = store.getActions(); const expectedFirstActionResult = { + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set amount to 1 ETH', + }; + + const expectedSecondActionResult = { type: 'send/updateSendAmount', - payload: 'aNewSendAmount', + payload: 'DE0B6B3A7640000', }; expect(actionResult[0]).toStrictEqual(expectedFirstActionResult); - expect(actionResult[1].type).toStrictEqual( + expect(actionResult[1]).toStrictEqual(expectedSecondActionResult); + expect(actionResult[2].type).toStrictEqual( 'send/computeEstimatedGasLimit/pending', ); - expect(actionResult[2].type).toStrictEqual( + expect(actionResult[3].type).toStrictEqual( 'send/computeEstimatedGasLimit/rejected', ); }); @@ -1358,15 +1369,21 @@ describe('Send Slice', () => { const actionResult = store.getActions(); const expectedFirstActionResult = { + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set amount to 0 ETH', + }; + + const expectedSecondActionResult = { type: 'send/updateSendAmount', payload: undefined, }; expect(actionResult[0]).toStrictEqual(expectedFirstActionResult); - expect(actionResult[1].type).toStrictEqual( + expect(actionResult[1]).toStrictEqual(expectedSecondActionResult); + expect(actionResult[2].type).toStrictEqual( 'send/computeEstimatedGasLimit/pending', ); - expect(actionResult[2].type).toStrictEqual( + expect(actionResult[3].type).toStrictEqual( 'send/computeEstimatedGasLimit/rejected', ); }); @@ -1407,12 +1424,13 @@ describe('Send Slice', () => { const actionResult = store.getActions(); - expect(actionResult).toHaveLength(3); - expect(actionResult[0].type).toStrictEqual('send/updateSendAmount'); - expect(actionResult[1].type).toStrictEqual( + expect(actionResult).toHaveLength(4); + expect(actionResult[0].type).toStrictEqual('send/addHistoryEntry'); + expect(actionResult[1].type).toStrictEqual('send/updateSendAmount'); + expect(actionResult[2].type).toStrictEqual( 'send/computeEstimatedGasLimit/pending', ); - expect(actionResult[2].type).toStrictEqual( + expect(actionResult[3].type).toStrictEqual( 'send/computeEstimatedGasLimit/rejected', ); }); @@ -1466,19 +1484,31 @@ describe('Send Slice', () => { const actionResult = store.getActions(); - expect(actionResult).toHaveLength(3); + expect(actionResult).toHaveLength(6); + expect(actionResult[0]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set asset type to ', + }); + expect(actionResult[1]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set asset symbol to ', + }); + expect(actionResult[2]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set asset address to ', + }); - expect(actionResult[0].type).toStrictEqual('send/updateAsset'); - expect(actionResult[0].payload).toStrictEqual({ + expect(actionResult[3].type).toStrictEqual('send/updateAsset'); + expect(actionResult[3].payload).toStrictEqual({ ...newSendAsset, balance: '', error: null, }); - expect(actionResult[1].type).toStrictEqual( + expect(actionResult[4].type).toStrictEqual( 'send/computeEstimatedGasLimit/pending', ); - expect(actionResult[2].type).toStrictEqual( + expect(actionResult[5].type).toStrictEqual( 'send/computeEstimatedGasLimit/rejected', ); }); @@ -1506,19 +1536,31 @@ describe('Send Slice', () => { const actionResult = store.getActions(); - expect(actionResult).toHaveLength(5); - expect(actionResult[0].type).toStrictEqual('SHOW_LOADING_INDICATION'); - expect(actionResult[1].type).toStrictEqual('HIDE_LOADING_INDICATION'); - expect(actionResult[2].payload).toStrictEqual({ + expect(actionResult).toHaveLength(8); + expect(actionResult[0]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: `sendFlow - user set asset type to ${ASSET_TYPES.TOKEN}`, + }); + expect(actionResult[1]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set asset symbol to tokenSymbol', + }); + expect(actionResult[2]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set asset address to tokenAddress', + }); + expect(actionResult[3].type).toStrictEqual('SHOW_LOADING_INDICATION'); + expect(actionResult[4].type).toStrictEqual('HIDE_LOADING_INDICATION'); + expect(actionResult[5].payload).toStrictEqual({ ...newSendAsset, balance: '0x0', error: null, }); - expect(actionResult[3].type).toStrictEqual( + expect(actionResult[6].type).toStrictEqual( 'send/computeEstimatedGasLimit/pending', ); - expect(actionResult[4].type).toStrictEqual( + expect(actionResult[7].type).toStrictEqual( 'send/computeEstimatedGasLimit/rejected', ); }); @@ -1543,10 +1585,22 @@ describe('Send Slice', () => { store.dispatch(updateSendAsset(newSendAsset)), ).rejects.toThrow('invalidAssetType'); const actionResult = store.getActions(); - expect(actionResult).toHaveLength(3); - expect(actionResult[0].type).toStrictEqual('SHOW_LOADING_INDICATION'); - expect(actionResult[1].type).toStrictEqual('HIDE_LOADING_INDICATION'); - expect(actionResult[2]).toStrictEqual({ + expect(actionResult).toHaveLength(6); + expect(actionResult[0]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: `sendFlow - user set asset type to ${ASSET_TYPES.TOKEN}`, + }); + expect(actionResult[1]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set asset symbol to tokenSymbol', + }); + expect(actionResult[2]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set asset address to tokenAddress', + }); + expect(actionResult[3].type).toStrictEqual('SHOW_LOADING_INDICATION'); + expect(actionResult[4].type).toStrictEqual('HIDE_LOADING_INDICATION'); + expect(actionResult[5]).toStrictEqual({ payload: { name: 'CONVERT_TOKEN_TO_NFT', tokenAddress: 'tokenAddress', @@ -1600,24 +1654,32 @@ describe('Send Slice', () => { await store.dispatch(updateRecipientUserInput(newUserRecipientInput)); - expect(store.getActions()).toHaveLength(1); - expect(store.getActions()[0].type).toStrictEqual( + const actionResult = store.getActions(); + + expect(actionResult).toHaveLength(1); + expect(actionResult[0].type).toStrictEqual( 'send/updateRecipientUserInput', ); - expect(store.getActions()[0].payload).toStrictEqual( - newUserRecipientInput, - ); + expect(actionResult[0].payload).toStrictEqual(newUserRecipientInput); clock.tick(300); // debounce - expect(store.getActions()).toHaveLength(2); - expect(store.getActions()[1].type).toStrictEqual( + const actionResultAfterDebounce = store.getActions(); + expect(actionResultAfterDebounce).toHaveLength(3); + + expect(actionResultAfterDebounce[1]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: `sendFlow - user typed ${newUserRecipientInput} into recipient input field`, + }); + + expect(actionResultAfterDebounce[2].type).toStrictEqual( 'send/validateRecipientUserInput', ); - expect(store.getActions()[1].payload).toStrictEqual({ + expect(actionResultAfterDebounce[2].payload).toStrictEqual({ chainId: '', tokens: [], useTokenDetection: true, + userInput: newUserRecipientInput, tokenAddressList: ['0x514910771af9ca656af840dff83e8264ecf986ca'], }); }); @@ -1630,8 +1692,13 @@ describe('Send Slice', () => { await store.dispatch(useContactListForRecipientSearch()); const actionResult = store.getActions(); + expect(actionResult).toHaveLength(2); expect(actionResult).toStrictEqual([ + { + type: 'send/addHistoryEntry', + payload: 'sendFlow - user selected back to all on recipient screen', + }, { type: 'send/updateRecipientSearchMode', payload: RECIPIENT_SEARCH_MODES.CONTACT_LIST, @@ -1648,7 +1715,14 @@ describe('Send Slice', () => { const actionResult = store.getActions(); + expect(actionResult).toHaveLength(2); + expect(actionResult).toStrictEqual([ + { + type: 'send/addHistoryEntry', + payload: + 'sendFlow - user selected transfer to my accounts on recipient screen', + }, { type: 'send/updateRecipientSearchMode', payload: RECIPIENT_SEARCH_MODES.MY_ACCOUNTS, @@ -1890,20 +1964,24 @@ describe('Send Slice', () => { await store.dispatch(resetRecipientInput()); const actionResult = store.getActions(); - expect(actionResult).toHaveLength(6); - expect(actionResult[0].type).toStrictEqual( + expect(actionResult).toHaveLength(7); + expect(actionResult[0]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user cleared recipient input', + }); + expect(actionResult[1].type).toStrictEqual( 'send/updateRecipientUserInput', ); - expect(actionResult[0].payload).toStrictEqual(''); - expect(actionResult[1].type).toStrictEqual('send/updateRecipient'); - expect(actionResult[2].type).toStrictEqual( + expect(actionResult[1].payload).toStrictEqual(''); + expect(actionResult[2].type).toStrictEqual('send/updateRecipient'); + expect(actionResult[3].type).toStrictEqual( 'send/computeEstimatedGasLimit/pending', ); - expect(actionResult[3].type).toStrictEqual( + expect(actionResult[4].type).toStrictEqual( 'send/computeEstimatedGasLimit/rejected', ); - expect(actionResult[4].type).toStrictEqual('ENS/resetEnsResolution'); - expect(actionResult[5].type).toStrictEqual( + expect(actionResult[5].type).toStrictEqual('ENS/resetEnsResolution'); + expect(actionResult[6].type).toStrictEqual( 'send/validateRecipientUserInput', ); }); @@ -1927,10 +2005,14 @@ describe('Send Slice', () => { const actionResult = store.getActions(); const expectActionResult = [ + { + type: 'send/addHistoryEntry', + payload: 'sendFlow - user added custom hexData 0x1', + }, { type: 'send/updateUserInputHexData', payload: hexData }, ]; - expect(actionResult).toHaveLength(1); + expect(actionResult).toHaveLength(2); expect(actionResult).toStrictEqual(expectActionResult); }); }); @@ -1970,13 +2052,17 @@ describe('Send Slice', () => { const actionResult = store.getActions(); - expect(actionResult).toHaveLength(4); + expect(actionResult).toHaveLength(5); expect(actionResult[0].type).toStrictEqual('send/updateAmountMode'); expect(actionResult[1].type).toStrictEqual('send/updateAmountToMax'); - expect(actionResult[2].type).toStrictEqual( + expect(actionResult[2]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user toggled max mode on', + }); + expect(actionResult[3].type).toStrictEqual( 'send/computeEstimatedGasLimit/pending', ); - expect(actionResult[3].type).toStrictEqual( + expect(actionResult[4].type).toStrictEqual( 'send/computeEstimatedGasLimit/rejected', ); }); @@ -2014,13 +2100,17 @@ describe('Send Slice', () => { const actionResult = store.getActions(); - expect(actionResult).toHaveLength(4); + expect(actionResult).toHaveLength(5); expect(actionResult[0].type).toStrictEqual('send/updateAmountMode'); expect(actionResult[1].type).toStrictEqual('send/updateSendAmount'); - expect(actionResult[2].type).toStrictEqual( + expect(actionResult[2]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user toggled max mode off', + }); + expect(actionResult[3].type).toStrictEqual( 'send/computeEstimatedGasLimit/pending', ); - expect(actionResult[3].type).toStrictEqual( + expect(actionResult[4].type).toStrictEqual( 'send/computeEstimatedGasLimit/rejected', ); }); @@ -2045,8 +2135,13 @@ describe('Send Slice', () => { const actionResult = store.getActions(); - expect(actionResult).toHaveLength(1); - expect(actionResult[0].type).toStrictEqual('SHOW_CONF_TX_PAGE'); + expect(actionResult).toHaveLength(2); + expect(actionResult[0]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: + 'sendFlow - user clicked next and transaction should be added to controller', + }); + expect(actionResult[1].type).toStrictEqual('SHOW_CONF_TX_PAGE'); }); it('should create actions for updateTransaction rejecting', async () => { @@ -2081,11 +2176,16 @@ describe('Send Slice', () => { const actionResult = store.getActions(); - expect(actionResult).toHaveLength(2); - expect(actionResult[0].type).toStrictEqual( + expect(actionResult).toHaveLength(3); + expect(actionResult[0]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: + 'sendFlow - user clicked next and transaction should be updated in controller', + }); + expect(actionResult[1].type).toStrictEqual( 'UPDATE_TRANSACTION_EDITABLE_PARAMS', ); - expect(actionResult[1].type).toStrictEqual( + expect(actionResult[2].type).toStrictEqual( 'UPDATE_TRANSACTION_GAS_FEES', ); }); @@ -2133,9 +2233,13 @@ describe('Send Slice', () => { await store.dispatch(editTransaction(ASSET_TYPES.NATIVE, 1)); const actionResult = store.getActions(); - expect(actionResult).toHaveLength(1); - expect(actionResult[0].type).toStrictEqual('send/editTransaction'); - expect(actionResult[0].payload).toStrictEqual({ + expect(actionResult).toHaveLength(2); + expect(actionResult[0]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user clicked edit on transaction with id 1', + }); + expect(actionResult[1].type).toStrictEqual('send/editTransaction'); + expect(actionResult[1].payload).toStrictEqual({ address: '0xRecipientAddress', amount: '0xde0b6b3a7640000', data: '', @@ -2146,7 +2250,7 @@ describe('Send Slice', () => { nickname: '', }); - const action = actionResult[0]; + const action = actionResult[1]; const result = sendReducer(initialState, action); @@ -2254,9 +2358,25 @@ describe('Send Slice', () => { ), ); const actionResult = store.getActions(); - expect(actionResult).toHaveLength(5); - expect(actionResult[0].type).toStrictEqual('send/updateAsset'); - expect(actionResult[0].payload).toStrictEqual({ + expect(actionResult).toHaveLength(9); + expect(actionResult[0]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user clicked edit on transaction with id 1', + }); + expect(actionResult[1]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: `sendFlow - user set asset type to ${ASSET_TYPES.COLLECTIBLE}`, + }); + expect(actionResult[2]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set asset symbol to undefined', + }); + expect(actionResult[3]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set asset address to 0xTokenAddress', + }); + expect(actionResult[4].type).toStrictEqual('send/updateAsset'); + expect(actionResult[4].payload).toStrictEqual({ balance: '0x1', type: ASSET_TYPES.COLLECTIBLE, error: null, @@ -2270,18 +2390,17 @@ describe('Send Slice', () => { tokenId: '26847', }, }); - expect(actionResult[1].type).toStrictEqual( + expect(actionResult[5].type).toStrictEqual( 'send/computeEstimatedGasLimit/pending', ); - expect(actionResult[2].type).toStrictEqual( + expect(actionResult[6].type).toStrictEqual( 'metamask/gas/SET_CUSTOM_GAS_LIMIT', ); - expect(actionResult[3].type).toStrictEqual( + expect(actionResult[7].type).toStrictEqual( 'send/computeEstimatedGasLimit/fulfilled', ); - expect(actionResult[4].type).toStrictEqual('send/editTransaction'); - - const action = actionResult[4]; + expect(actionResult[8].type).toStrictEqual('send/editTransaction'); + const action = actionResult[8]; const result = sendReducer(initialState, action); @@ -2383,11 +2502,27 @@ describe('Send Slice', () => { ); const actionResult = store.getActions(); - expect(actionResult).toHaveLength(7); - expect(actionResult[0].type).toStrictEqual('SHOW_LOADING_INDICATION'); - expect(actionResult[1].type).toStrictEqual('HIDE_LOADING_INDICATION'); - expect(actionResult[2].type).toStrictEqual('send/updateAsset'); - expect(actionResult[2].payload).toStrictEqual({ + expect(actionResult).toHaveLength(11); + expect(actionResult[0]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user clicked edit on transaction with id 1', + }); + expect(actionResult[1]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: `sendFlow - user set asset type to ${ASSET_TYPES.TOKEN}`, + }); + expect(actionResult[2]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set asset symbol to SYMB', + }); + expect(actionResult[3]).toMatchObject({ + type: 'send/addHistoryEntry', + payload: 'sendFlow - user set asset address to 0xTokenAddress', + }); + expect(actionResult[4].type).toStrictEqual('SHOW_LOADING_INDICATION'); + expect(actionResult[5].type).toStrictEqual('HIDE_LOADING_INDICATION'); + expect(actionResult[6].type).toStrictEqual('send/updateAsset'); + expect(actionResult[6].payload).toStrictEqual({ balance: '0x0', type: ASSET_TYPES.TOKEN, error: null, @@ -2398,17 +2533,17 @@ describe('Send Slice', () => { standard: 'ERC20', }, }); - expect(actionResult[3].type).toStrictEqual( + expect(actionResult[7].type).toStrictEqual( 'send/computeEstimatedGasLimit/pending', ); - expect(actionResult[4].type).toStrictEqual( + expect(actionResult[8].type).toStrictEqual( 'metamask/gas/SET_CUSTOM_GAS_LIMIT', ); - expect(actionResult[5].type).toStrictEqual( + expect(actionResult[9].type).toStrictEqual( 'send/computeEstimatedGasLimit/fulfilled', ); - expect(actionResult[6].type).toStrictEqual('send/editTransaction'); - expect(actionResult[6].payload).toStrictEqual({ + expect(actionResult[10].type).toStrictEqual('send/editTransaction'); + expect(actionResult[10].payload).toStrictEqual({ address: '0xrecipientaddress', // getting address from tokenData does .toLowerCase amount: '0x3a98', data: '', @@ -2419,7 +2554,7 @@ describe('Send Slice', () => { nickname: '', }); - const action = actionResult[6]; + const action = actionResult[10]; const result = sendReducer(initialState, action); diff --git a/ui/pages/send/send-content/add-recipient/add-recipient.component.js b/ui/pages/send/send-content/add-recipient/add-recipient.component.js index 100d2877f7ae..a46fa7a8b82c 100644 --- a/ui/pages/send/send-content/add-recipient/add-recipient.component.js +++ b/ui/pages/send/send-content/add-recipient/add-recipient.component.js @@ -22,6 +22,7 @@ export default class AddRecipient extends Component { addressBookEntryName: PropTypes.string, contacts: PropTypes.array, nonContacts: PropTypes.array, + addHistoryEntry: PropTypes.func, useMyAccountsForRecipientSearch: PropTypes.func, useContactListForRecipientSearch: PropTypes.func, isUsingMyAccountsForRecipientSearch: PropTypes.bool, @@ -64,7 +65,10 @@ export default class AddRecipient extends Component { metricsEvent: PropTypes.func, }; - selectRecipient = (address, nickname = '') => { + selectRecipient = (address, nickname = '', type = 'user input') => { + this.props.addHistoryEntry( + `sendFlow - User clicked recipient from ${type}. address: ${address}, nickname ${nickname}`, + ); this.props.updateRecipient({ address, nickname }); }; @@ -109,11 +113,13 @@ export default class AddRecipient extends Component { content = this.renderExplicitAddress( recipient.address, recipient.nickname, + 'validated user input', ); } else if (ensResolution) { content = this.renderExplicitAddress( ensResolution, addressBookEntryName || userInput, + 'ENS resolution', ); } else if (isUsingMyAccountsForRecipientSearch) { content = this.renderTransfer(); @@ -127,12 +133,12 @@ export default class AddRecipient extends Component { ); } - renderExplicitAddress(address, name) { + renderExplicitAddress(address, name, type) { return (
this.selectRecipient(address, name)} + onClick={() => this.selectRecipient(address, name, type)} >
@@ -179,7 +185,9 @@ export default class AddRecipient extends Component { + this.selectRecipient(address, name, 'my accounts') + } />
); @@ -200,7 +208,9 @@ export default class AddRecipient extends Component { addressBook={addressBook} searchForContacts={this.searchForContacts.bind(this)} searchForRecents={this.searchForRecents.bind(this)} - selectRecipient={this.selectRecipient.bind(this)} + selectRecipient={(address, name) => + this.selectRecipient(address, name, 'contact list') + } > {ownedAccounts && ownedAccounts.length > 1 && !userInput && (