From d5bd27dfd14da80ec38388326b361fe6e1c48251 Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Mon, 21 Feb 2022 20:08:56 +0000 Subject: [PATCH 01/19] Version v10.11.0 --- CHANGELOG.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31faba3db..92833538a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,67 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [10.11.0] +### Uncategorized +- Run yarn lavamoat:auto ([#13697](https://github.com/MetaMask/metamask-extension/pull/13697)) +- Using correct metricsEvent arg ([#13684](https://github.com/MetaMask/metamask-extension/pull/13684)) +- Added Controls and Action ArgType, took out @storybook/addon-knobs ([#13660](https://github.com/MetaMask/metamask-extension/pull/13660)) +- Add support for Smart Transactions ([#12676](https://github.com/MetaMask/metamask-extension/pull/12676)) +- Add argTypes for color-indicator ([#13659](https://github.com/MetaMask/metamask-extension/pull/13659)) +- Enable Avalanche for Swaps ([#13653](https://github.com/MetaMask/metamask-extension/pull/13653)) +- Prevent Browserify error from being swallowed ([#13647](https://github.com/MetaMask/metamask-extension/pull/13647)) +- Mįgrate truncated definition list stories from addon knobs to use controls. ([#13628](https://github.com/MetaMask/metamask-extension/pull/13628)) +- Fixed Add Recipient Stories and migrated to use control args. ([#13633](https://github.com/MetaMask/metamask-extension/pull/13633)) +- Minimal fix to the TokenSearch story to ensure it compiles and works. ([#13623](https://github.com/MetaMask/metamask-extension/pull/13623)) +- Updated the Callout story to convert knobs and actions to controls / args. ([#13624](https://github.com/MetaMask/metamask-extension/pull/13624)) +- Change "Quote X of Y" to "Fetching quote X of Y" ([#13663](https://github.com/MetaMask/metamask-extension/pull/13663)) +- Sync `master` with `develop` ([#13656](https://github.com/MetaMask/metamask-extension/pull/13656)) +- convert SendGasRow stories with argtypes ([#13554](https://github.com/MetaMask/metamask-extension/pull/13554)) +- Merge remote-tracking branch 'origin/develop' into master-sync +- Use hardware wallet constants when possible ([#13634](https://github.com/MetaMask/metamask-extension/pull/13634)) +- ConfirmImportToken: Convert to Functional Component; Add storybook controls ([#13594](https://github.com/MetaMask/metamask-extension/pull/13594)) +- Ensure pre-selected account on connect screen is visible in list ([#13621](https://github.com/MetaMask/metamask-extension/pull/13621)) +- Sync `master` with `develop` ([#13648](https://github.com/MetaMask/metamask-extension/pull/13648)) +- Make default icons the same on mobile and extension #13264 ([#13408](https://github.com/MetaMask/metamask-extension/pull/13408)) +- Created "Token details" page ([#13216](https://github.com/MetaMask/metamask-extension/pull/13216)) +- Update outdated Trezor Emulator link ([#13611](https://github.com/MetaMask/metamask-extension/pull/13611)) +- E2e mocking ([#13640](https://github.com/MetaMask/metamask-extension/pull/13640)) +- Merge remote-tracking branch 'origin/develop' into master-sync +- Ensure sign message button is only enabled on scroll ([#13645](https://github.com/MetaMask/metamask-extension/pull/13645)) +- Bump vm2 from 3.9.5 to 3.9.7 ([#13625](https://github.com/MetaMask/metamask-extension/pull/13625)) +- Bump follow-redirects from 1.14.7 to 1.14.8 ([#13612](https://github.com/MetaMask/metamask-extension/pull/13612)) +- Add Snaps via Flask ([#13462](https://github.com/MetaMask/metamask-extension/pull/13462)) +- Fix: advance defaults should never be used for swaps ([#13617](https://github.com/MetaMask/metamask-extension/pull/13617)) +- Include transactions from all networks in state logs ([#13599](https://github.com/MetaMask/metamask-extension/pull/13599)) +- Update to latest ChromeDriver ([#13616](https://github.com/MetaMask/metamask-extension/pull/13616)) +- Untranslated string fix ([#13615](https://github.com/MetaMask/metamask-extension/pull/13615)) +- Correct connection language ([#13605](https://github.com/MetaMask/metamask-extension/pull/13605)) +- Fixes in EIP-1559 V2 implementation ([#13574](https://github.com/MetaMask/metamask-extension/pull/13574)) +- Allow sending up to 15 decimals on the send screen ([#12707](https://github.com/MetaMask/metamask-extension/pull/12707)) +- Suppress diffs for translation files by default ([#13537](https://github.com/MetaMask/metamask-extension/pull/13537)) +- fix opensea/autodetect setting dependency relation ([#13575](https://github.com/MetaMask/metamask-extension/pull/13575)) +- remove infura project_id from networks form field ([#13539](https://github.com/MetaMask/metamask-extension/pull/13539)) +- Updating the direct deposit messages to native currency ([#13576](https://github.com/MetaMask/metamask-extension/pull/13576)) +- Add resolution for engine.io, a nested dependency of 3box ([#13589](https://github.com/MetaMask/metamask-extension/pull/13589)) +- Adding check for transaction.id in useTransactionEventFragment hook ([#13587](https://github.com/MetaMask/metamask-extension/pull/13587)) +- [GridPlus] Updates corresponding to Lattice firmware v0.13.2 ([#13455](https://github.com/MetaMask/metamask-extension/pull/13455)) +- Sync `master` with `develop` ([#13573](https://github.com/MetaMask/metamask-extension/pull/13573)) +- Merge branch 'develop' into master-sync +- [BUILD FIX #12920] Updated style for full screen mode in settings page ([#13569](https://github.com/MetaMask/metamask-extension/pull/13569)) +- Merge remote-tracking branch 'origin/develop' into master-sync +- Fix network edition error ([#13527](https://github.com/MetaMask/metamask-extension/pull/13527)) +- update test-dapp to 5.0.0 ([#13503](https://github.com/MetaMask/metamask-extension/pull/13503)) +- Resolve a BigNumber issue ([#13555](https://github.com/MetaMask/metamask-extension/pull/13555)) +- Setting search feature - Setting component UI updates #12761 ([#12920](https://github.com/MetaMask/metamask-extension/pull/12920)) +- captureKeyringTypesWithMissingIdentities() when 'Missing identity for address' in permissions/specifications ([#13521](https://github.com/MetaMask/metamask-extension/pull/13521)) +- New Crowdin translations by Github Action ([#13514](https://github.com/MetaMask/metamask-extension/pull/13514)) +- Update crowdin workflow config ([#13494](https://github.com/MetaMask/metamask-extension/pull/13494)) +- Add currency symbol validation in the add network form ([#12431](https://github.com/MetaMask/metamask-extension/pull/12431)) +- fix test ([#13513](https://github.com/MetaMask/metamask-extension/pull/13513)) +- E2e signing ([#13507](https://github.com/MetaMask/metamask-extension/pull/13507)) +- update chromedriver to v97 ([#13502](https://github.com/MetaMask/metamask-extension/pull/13502)) +- Extract "create vault" form to separate component ([#13461](https://github.com/MetaMask/metamask-extension/pull/13461)) + ## [10.10.0] ### Added - Enable toggle to turn on the new gas fee customization UI ([#13481](https://github.com/MetaMask/metamask-extension/pull/13481)) @@ -2731,7 +2792,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.10.0...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.11.0...HEAD +[10.11.0]: https://github.com/MetaMask/metamask-extension/compare/v10.10.0...v10.11.0 [10.10.0]: https://github.com/MetaMask/metamask-extension/compare/v10.9.3...v10.10.0 [10.9.3]: https://github.com/MetaMask/metamask-extension/compare/v10.9.2...v10.9.3 [10.9.2]: https://github.com/MetaMask/metamask-extension/compare/v10.9.1...v10.9.2 diff --git a/package.json b/package.json index ee4d7e2cf..aa05d7b02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.10.0", + "version": "10.11.0", "private": true, "repository": { "type": "git", From f47015df8efddaf6fc049452609a44ce0f765314 Mon Sep 17 00:00:00 2001 From: ryanml Date: Tue, 22 Feb 2022 18:42:08 -0700 Subject: [PATCH 02/19] [skip e2e] Updating changelog for v10.11.0 (#13718) --- CHANGELOG.md | 74 ++++++++++++---------------------------------------- 1 file changed, 17 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92833538a..e1f6082b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,65 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## [10.11.0] -### Uncategorized -- Run yarn lavamoat:auto ([#13697](https://github.com/MetaMask/metamask-extension/pull/13697)) -- Using correct metricsEvent arg ([#13684](https://github.com/MetaMask/metamask-extension/pull/13684)) -- Added Controls and Action ArgType, took out @storybook/addon-knobs ([#13660](https://github.com/MetaMask/metamask-extension/pull/13660)) -- Add support for Smart Transactions ([#12676](https://github.com/MetaMask/metamask-extension/pull/12676)) -- Add argTypes for color-indicator ([#13659](https://github.com/MetaMask/metamask-extension/pull/13659)) -- Enable Avalanche for Swaps ([#13653](https://github.com/MetaMask/metamask-extension/pull/13653)) -- Prevent Browserify error from being swallowed ([#13647](https://github.com/MetaMask/metamask-extension/pull/13647)) -- Mįgrate truncated definition list stories from addon knobs to use controls. ([#13628](https://github.com/MetaMask/metamask-extension/pull/13628)) -- Fixed Add Recipient Stories and migrated to use control args. ([#13633](https://github.com/MetaMask/metamask-extension/pull/13633)) -- Minimal fix to the TokenSearch story to ensure it compiles and works. ([#13623](https://github.com/MetaMask/metamask-extension/pull/13623)) -- Updated the Callout story to convert knobs and actions to controls / args. ([#13624](https://github.com/MetaMask/metamask-extension/pull/13624)) -- Change "Quote X of Y" to "Fetching quote X of Y" ([#13663](https://github.com/MetaMask/metamask-extension/pull/13663)) -- Sync `master` with `develop` ([#13656](https://github.com/MetaMask/metamask-extension/pull/13656)) -- convert SendGasRow stories with argtypes ([#13554](https://github.com/MetaMask/metamask-extension/pull/13554)) -- Merge remote-tracking branch 'origin/develop' into master-sync -- Use hardware wallet constants when possible ([#13634](https://github.com/MetaMask/metamask-extension/pull/13634)) -- ConfirmImportToken: Convert to Functional Component; Add storybook controls ([#13594](https://github.com/MetaMask/metamask-extension/pull/13594)) -- Ensure pre-selected account on connect screen is visible in list ([#13621](https://github.com/MetaMask/metamask-extension/pull/13621)) -- Sync `master` with `develop` ([#13648](https://github.com/MetaMask/metamask-extension/pull/13648)) -- Make default icons the same on mobile and extension #13264 ([#13408](https://github.com/MetaMask/metamask-extension/pull/13408)) -- Created "Token details" page ([#13216](https://github.com/MetaMask/metamask-extension/pull/13216)) -- Update outdated Trezor Emulator link ([#13611](https://github.com/MetaMask/metamask-extension/pull/13611)) -- E2e mocking ([#13640](https://github.com/MetaMask/metamask-extension/pull/13640)) -- Merge remote-tracking branch 'origin/develop' into master-sync -- Ensure sign message button is only enabled on scroll ([#13645](https://github.com/MetaMask/metamask-extension/pull/13645)) -- Bump vm2 from 3.9.5 to 3.9.7 ([#13625](https://github.com/MetaMask/metamask-extension/pull/13625)) -- Bump follow-redirects from 1.14.7 to 1.14.8 ([#13612](https://github.com/MetaMask/metamask-extension/pull/13612)) -- Add Snaps via Flask ([#13462](https://github.com/MetaMask/metamask-extension/pull/13462)) -- Fix: advance defaults should never be used for swaps ([#13617](https://github.com/MetaMask/metamask-extension/pull/13617)) +### Added +- Swaps: Add support for Smart Transactions on Mainnet and Rinkeby ([#12676](https://github.com/MetaMask/metamask-extension/pull/12676)) +- Swaps: Enable Avalanche ([#13653](https://github.com/MetaMask/metamask-extension/pull/13653)) +- Add "Token details" page ([#13216](https://github.com/MetaMask/metamask-extension/pull/13216)) +- Add icons to sections in settings ([#12920](https://github.com/MetaMask/metamask-extension/pull/12920)) + +### Changed +- Swaps: Change language "Quote X of Y" to "Fetching quote X of Y" ([#13663](https://github.com/MetaMask/metamask-extension/pull/13663)) +- Update preferred account identicon selection UI ([#13408](https://github.com/MetaMask/metamask-extension/pull/13408)) - Include transactions from all networks in state logs ([#13599](https://github.com/MetaMask/metamask-extension/pull/13599)) -- Update to latest ChromeDriver ([#13616](https://github.com/MetaMask/metamask-extension/pull/13616)) -- Untranslated string fix ([#13615](https://github.com/MetaMask/metamask-extension/pull/13615)) -- Correct connection language ([#13605](https://github.com/MetaMask/metamask-extension/pull/13605)) -- Fixes in EIP-1559 V2 implementation ([#13574](https://github.com/MetaMask/metamask-extension/pull/13574)) -- Allow sending up to 15 decimals on the send screen ([#12707](https://github.com/MetaMask/metamask-extension/pull/12707)) -- Suppress diffs for translation files by default ([#13537](https://github.com/MetaMask/metamask-extension/pull/13537)) -- fix opensea/autodetect setting dependency relation ([#13575](https://github.com/MetaMask/metamask-extension/pull/13575)) -- remove infura project_id from networks form field ([#13539](https://github.com/MetaMask/metamask-extension/pull/13539)) -- Updating the direct deposit messages to native currency ([#13576](https://github.com/MetaMask/metamask-extension/pull/13576)) -- Add resolution for engine.io, a nested dependency of 3box ([#13589](https://github.com/MetaMask/metamask-extension/pull/13589)) -- Adding check for transaction.id in useTransactionEventFragment hook ([#13587](https://github.com/MetaMask/metamask-extension/pull/13587)) -- [GridPlus] Updates corresponding to Lattice firmware v0.13.2 ([#13455](https://github.com/MetaMask/metamask-extension/pull/13455)) -- Sync `master` with `develop` ([#13573](https://github.com/MetaMask/metamask-extension/pull/13573)) -- Merge branch 'develop' into master-sync -- [BUILD FIX #12920] Updated style for full screen mode in settings page ([#13569](https://github.com/MetaMask/metamask-extension/pull/13569)) -- Merge remote-tracking branch 'origin/develop' into master-sync -- Fix network edition error ([#13527](https://github.com/MetaMask/metamask-extension/pull/13527)) -- update test-dapp to 5.0.0 ([#13503](https://github.com/MetaMask/metamask-extension/pull/13503)) -- Resolve a BigNumber issue ([#13555](https://github.com/MetaMask/metamask-extension/pull/13555)) -- Setting search feature - Setting component UI updates #12761 ([#12920](https://github.com/MetaMask/metamask-extension/pull/12920)) -- captureKeyringTypesWithMissingIdentities() when 'Missing identity for address' in permissions/specifications ([#13521](https://github.com/MetaMask/metamask-extension/pull/13521)) -- New Crowdin translations by Github Action ([#13514](https://github.com/MetaMask/metamask-extension/pull/13514)) -- Update crowdin workflow config ([#13494](https://github.com/MetaMask/metamask-extension/pull/13494)) +- Update accounts connection language ([#13605](https://github.com/MetaMask/metamask-extension/pull/13605)) +- Style updates for setting page in full screen mode ([#13569](https://github.com/MetaMask/metamask-extension/pull/13569)) - Add currency symbol validation in the add network form ([#12431](https://github.com/MetaMask/metamask-extension/pull/12431)) -- fix test ([#13513](https://github.com/MetaMask/metamask-extension/pull/13513)) -- E2e signing ([#13507](https://github.com/MetaMask/metamask-extension/pull/13507)) -- update chromedriver to v97 ([#13502](https://github.com/MetaMask/metamask-extension/pull/13502)) -- Extract "create vault" form to separate component ([#13461](https://github.com/MetaMask/metamask-extension/pull/13461)) + +### Fixed +- Ensure pre-selected account on connect screen is visible in list ([#13621](https://github.com/MetaMask/metamask-extension/pull/13621)) +- Do not allow transaction creation with gas limit below minimum ([#13574](https://github.com/MetaMask/metamask-extension/pull/13574)) +- Fix network editing error when no block explorer is provided ([#13527](https://github.com/MetaMask/metamask-extension/pull/13527)) +- Swaps: Fix BigNumber error when submitting quote ([#13555](https://github.com/MetaMask/metamask-extension/pull/13555)) ## [10.10.0] ### Added From 05138da8a73b74a143dfde22fc7c69b1033689f8 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Tue, 22 Feb 2022 16:22:58 -0330 Subject: [PATCH 03/19] Add EIP-712 support for Trezor (#13693) * Add EIP-712 support for Trezor Co-authored-by: alisinabh Co-authored-by: matejcik Co-authored-by: Brandon Noad * Update eth-trezor-keyring version Co-authored-by: Alois Klink Co-authored-by: alisinabh Co-authored-by: matejcik Co-authored-by: Brandon Noad --- lavamoat/browserify/beta/policy.json | 16 +- lavamoat/browserify/flask/policy.json | 16 +- lavamoat/browserify/main/policy.json | 16 +- lavamoat/build-system/policy.json | 201 -------------------------- package.json | 5 +- yarn.lock | 179 +++++++++++++---------- 6 files changed, 142 insertions(+), 291 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index a3af16261..41925f129 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -597,6 +597,16 @@ "hdkey": true } }, + "@metamask/eth-sig-util": { + "packages": { + "buffer": true, + "ethereumjs-abi": true, + "ethereumjs-util": true, + "ethjs-util": true, + "tweetnacl": true, + "tweetnacl-util": true + } + }, "@metamask/eth-token-tracker": { "globals": { "console.warn": true @@ -4970,7 +4980,6 @@ "document.createTextNode": true, "document.getElementById": true, "document.querySelectorAll": true, - "fetch": true, "location": true, "navigator": true, "open": true, @@ -4980,8 +4989,9 @@ }, "packages": { "@babel/runtime": true, - "events": true, - "whatwg-fetch": true + "@metamask/eth-sig-util": true, + "cross-fetch": true, + "events": true } }, "truncate-utf8-bytes": { diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index c8c9633ff..f540236ba 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -597,6 +597,16 @@ "hdkey": true } }, + "@metamask/eth-sig-util": { + "packages": { + "buffer": true, + "ethereumjs-abi": true, + "ethereumjs-util": true, + "ethjs-util": true, + "tweetnacl": true, + "tweetnacl-util": true + } + }, "@metamask/eth-token-tracker": { "globals": { "console.warn": true @@ -4989,7 +4999,6 @@ "document.createTextNode": true, "document.getElementById": true, "document.querySelectorAll": true, - "fetch": true, "location": true, "navigator": true, "open": true, @@ -4999,8 +5008,9 @@ }, "packages": { "@babel/runtime": true, - "events": true, - "whatwg-fetch": true + "@metamask/eth-sig-util": true, + "cross-fetch": true, + "events": true } }, "truncate-utf8-bytes": { diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index a3af16261..41925f129 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -597,6 +597,16 @@ "hdkey": true } }, + "@metamask/eth-sig-util": { + "packages": { + "buffer": true, + "ethereumjs-abi": true, + "ethereumjs-util": true, + "ethjs-util": true, + "tweetnacl": true, + "tweetnacl-util": true + } + }, "@metamask/eth-token-tracker": { "globals": { "console.warn": true @@ -4970,7 +4980,6 @@ "document.createTextNode": true, "document.getElementById": true, "document.querySelectorAll": true, - "fetch": true, "location": true, "navigator": true, "open": true, @@ -4980,8 +4989,9 @@ }, "packages": { "@babel/runtime": true, - "events": true, - "whatwg-fetch": true + "@metamask/eth-sig-util": true, + "cross-fetch": true, + "events": true } }, "truncate-utf8-bytes": { diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index 7d6167325..e95acc4d6 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -1052,16 +1052,6 @@ "buffer-equal": true } }, - "are-we-there-yet": { - "builtin": { - "events.EventEmitter": true, - "util.inherits": true - }, - "packages": { - "delegates": true, - "readable-stream": true - } - }, "arr-diff": { "packages": { "arr-flatten": true, @@ -1470,7 +1460,6 @@ "anymatch": true, "async-each": true, "braces": true, - "fsevents": true, "glob-parent": true, "inherits": true, "is-binary-path": true, @@ -1737,16 +1726,6 @@ "through2": true } }, - "detect-libc": { - "builtin": { - "child_process.spawnSync": true, - "fs.readdirSync": true, - "os.platform": true - }, - "globals": { - "process.env": true - } - }, "detective": { "packages": { "acorn-node": true, @@ -2450,45 +2429,6 @@ "process.version": true } }, - "fsevents": { - "builtin": { - "events.EventEmitter": true, - "fs.stat": true, - "path.join": true, - "util.inherits": true - }, - "globals": { - "__dirname": true, - "process.nextTick": true, - "process.platform": true, - "setImmediate": true - }, - "native": true, - "packages": { - "node-pre-gyp": true - } - }, - "gauge": { - "builtin": { - "util.format": true - }, - "globals": { - "clearInterval": true, - "process": true, - "setImmediate": true, - "setInterval": true - }, - "packages": { - "aproba": true, - "console-control-strings": true, - "has-unicode": true, - "object-assign": true, - "signal-exit": true, - "string-width": true, - "strip-ansi": true, - "wide-align": true - } - }, "get-assigned-identifiers": { "builtin": { "assert.equal": true @@ -2867,16 +2807,6 @@ "process.argv": true } }, - "has-unicode": { - "builtin": { - "os.type": true - }, - "globals": { - "process.env.LANG": true, - "process.env.LC_ALL": true, - "process.env.LC_CTYPE": true - } - }, "has-value": { "packages": { "get-value": true, @@ -3048,11 +2978,6 @@ "is-plain-object": true } }, - "is-fullwidth-code-point": { - "packages": { - "number-is-nan": true - } - }, "is-glob": { "packages": { "is-extglob": true @@ -3583,56 +3508,6 @@ "setTimeout": true } }, - "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": { - "detect-libc": true, - "nopt": true, - "npmlog": true, - "rimraf": true, - "semver": true - } - }, - "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": { - "abbrev": true, - "osenv": true - } - }, "normalize-package-data": { "builtin": { "url.parse": true, @@ -3660,22 +3535,6 @@ "once": true } }, - "npmlog": { - "builtin": { - "events.EventEmitter": true, - "util": true - }, - "globals": { - "process.nextTick": true, - "process.stderr": true - }, - "packages": { - "are-we-there-yet": true, - "console-control-strings": true, - "gauge": true, - "set-blocking": true - } - }, "object-copy": { "packages": { "copy-descriptor": true, @@ -3757,54 +3616,6 @@ "readable-stream": true } }, - "os-homedir": { - "builtin": { - "os.homedir": true - }, - "globals": { - "process.env": true, - "process.getuid": true, - "process.platform": true - } - }, - "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 - } - }, - "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": { - "os-homedir": true, - "os-tmpdir": true - } - }, "p-limit": { "packages": { "p-try": true @@ -4514,12 +4325,6 @@ "lru-cache": true } }, - "set-blocking": { - "globals": { - "process.stderr": true, - "process.stdout": true - } - }, "set-value": { "packages": { "extend-shallow": true, @@ -4783,7 +4588,6 @@ }, "string-width": { "packages": { - "code-point-at": true, "emoji-regex": true, "is-fullwidth-code-point": true, "strip-ansi": true @@ -5436,11 +5240,6 @@ "isexe": true } }, - "wide-align": { - "packages": { - "string-width": true - } - }, "write": { "builtin": { "fs.createWriteStream": true, diff --git a/package.json b/package.json index aa05d7b02..a5edf84d8 100644 --- a/package.json +++ b/package.json @@ -155,7 +155,7 @@ "eth-query": "^2.1.2", "eth-rpc-errors": "^4.0.2", "eth-sig-util": "^3.0.0", - "eth-trezor-keyring": "^0.9.1", + "eth-trezor-keyring": "^0.10.0", "ethereum-ens-network-map": "^1.0.2", "ethereumjs-abi": "^0.6.4", "ethereumjs-util": "^7.0.10", @@ -415,7 +415,8 @@ "ganache>keccak": false, "ganache>leveldown": false, "geckodriver": true, - "react-devtools>electron": true + "react-devtools>electron": true, + "eth-trezor-keyring>trezor-connect>@trezor/transport>protobufjs": false } } } diff --git a/yarn.lock b/yarn.lock index e2c668b34..552f9564b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2737,6 +2737,17 @@ ethereumjs-util "^7.0.9" hdkey "0.8.0" +"@metamask/eth-sig-util@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.0.tgz#11553ba06de0d1352332c1bde28c8edd00e0dcf6" + integrity sha512-LczOjjxY4A7XYloxzyxJIHONELmUxVZncpOLoClpEcTiebiVdM46KRPYXGuULro9oNNR2xdVx3yoKiQjdfWmoA== + dependencies: + ethereumjs-abi "^0.6.8" + ethereumjs-util "^6.2.1" + ethjs-util "^0.1.6" + tweetnacl "^1.0.3" + tweetnacl-util "^0.15.1" + "@metamask/eth-token-tracker@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@metamask/eth-token-tracker/-/eth-token-tracker-4.0.0.tgz#f3129855873a857ef675d4c28f532be684241b61" @@ -4080,31 +4091,41 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== -"@trezor/blockchain-link@^1.0.17": - version "1.0.17" - resolved "https://registry.yarnpkg.com/@trezor/blockchain-link/-/blockchain-link-1.0.17.tgz#3155b44ee9beb71326986d404385ede673519b3c" - integrity sha512-o1ZmZVdhXM8K4OY61A6l/pvmasC6OTGDeDliVlVnNdy3eVDVlnEivQVnMD7CvQr0Crxl1Flox0mp90Ljp/DIkA== +"@trezor/blockchain-link@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@trezor/blockchain-link/-/blockchain-link-1.1.0.tgz#065d18d7c948c4de45437fc2178d9e26a7c2304b" + integrity sha512-tH3hLG54VZ52Y6Fxdw51kqORbuzUSt1VReISj/oZROMexmDDCRgFR14/wxasjHp94XRYrx8777Boa1qrpAos4w== dependencies: bignumber.js "^9.0.1" es6-promise "^4.2.8" events "^3.2.0" - ripple-lib "1.8.2" + ripple-lib "1.10.0" tiny-worker "^2.3.0" ws "^7.4.0" -"@trezor/connect-common@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@trezor/connect-common/-/connect-common-0.0.3.tgz#d136453d259d24f9200daf72d0184594d56e92e2" - integrity sha512-oc4K/Ve2e1o3R1M0QAexLYN7aOepeSlcO5NVP/cfxBA+36cApZrRSy6kbs3OB2uc15tua5qkmYEDpJ3QSnZarg== +"@trezor/connect-common@0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@trezor/connect-common/-/connect-common-0.0.4.tgz#0df221685272544770399aca1c624b037870e310" + integrity sha512-uE8t4JCwHVn224yj3cV4jLu8i5JAGDxzkBu8Als1UFs/Zt8Sfl5xwIqeTSvhXx5x+VXe+uxt2CXX3AcrKTxN3g== -"@trezor/rollout@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@trezor/rollout/-/rollout-1.2.0.tgz#827316debc5cf2e8af2210900eb49540ea2753d1" - integrity sha512-R8/M8PsGQUndHlyETZ5+mPOveaJSTlEgmAovY7Ifm3quvk8nV5ByWL1LUJ8IYUgir209EWDWSKWfa5RWoon8IA== +"@trezor/rollout@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@trezor/rollout/-/rollout-1.2.1.tgz#47c81186768bbb0514d27b386d92a719c290ab5e" + integrity sha512-BDYtPE+rl4QKilGzb3lGxv17+lA5rou04zr1DdWaDqazyvfPW0fj46us4A4WLWptGVL+gfXtn0ZGqgsxHLBm7A== dependencies: - cross-fetch "^3.0.6" + cross-fetch "^3.1.4" runtypes "^5.0.1" +"@trezor/transport@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@trezor/transport/-/transport-1.0.1.tgz#bf0d11a44d1220fe1486e7679370920f9f60afa4" + integrity sha512-JWjA3QlVhcn6zPJFDt80Ayqj5+zrY9m9jzWVd9sceFKYTUuCrsuhze1ho0CBlXLm8GF2/CzFijGbo6O93aL23Q== + dependencies: + bytebuffer "^5.0.1" + json-stable-stringify "^1.0.1" + long "^4.0.0" + protobufjs "^6.11.2" + "@trezor/utxo-lib@1.0.0-beta.10": version "1.0.0-beta.10" resolved "https://registry.yarnpkg.com/@trezor/utxo-lib/-/utxo-lib-1.0.0-beta.10.tgz#93f16ce607d94e50f8338a75ca8a3710f106c20e" @@ -6384,10 +6405,10 @@ base-x@3.0.4: dependencies: safe-buffer "^5.0.1" -base-x@3.0.8, base-x@^3.0.2, base-x@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d" - integrity sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA== +base-x@3.0.9, base-x@^3.0.2, base-x@^3.0.8: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== dependencies: safe-buffer "^5.0.1" @@ -6515,6 +6536,11 @@ big-integer@1.6.36: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.36.tgz#78631076265d4ae3555c04f85e7d9d2f3a071a36" integrity sha512-t70bfa7HYEA1D9idDbmuv7YbsbVkQ+Hp+8KFSul4aE5e/i1bjCNIRYJZlA8Q8p0r9T8cF/RVvwUgRA//FydEyg== +big-integer@^1.6.48: + version "1.6.51" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" + integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== + big.js@^5.1.2, big.js@^5.2.2: version "5.2.2" resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" @@ -7272,6 +7298,14 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= +buffer@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786" + integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + buffer@^4.3.0: version "4.9.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" @@ -8751,10 +8785,10 @@ cross-fetch@^2.1.0: node-fetch "2.1.2" whatwg-fetch "2.0.4" -cross-fetch@^3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" - integrity sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ== +cross-fetch@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" + integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== dependencies: node-fetch "2.6.1" @@ -11151,15 +11185,16 @@ eth-simple-keyring@^4.2.0: ethereumjs-wallet "^1.0.1" events "^1.1.1" -eth-trezor-keyring@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/eth-trezor-keyring/-/eth-trezor-keyring-0.9.1.tgz#10d78308c71966eadf94acc8acf7f7136311f31f" - integrity sha512-27k4pjHFG6z5F1dhpTfORONgtAPrF0BR+Qr+ygjYrjchmERJKkrgyqnJqkSGtHF6+XrgI8pKYiDTjo6CBPHVKw== +eth-trezor-keyring@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/eth-trezor-keyring/-/eth-trezor-keyring-0.10.0.tgz#a7dcf3343730897359e9ec7517cfd90f130cfbb9" + integrity sha512-QGwSMM+Bv0MLtsJLrVfo7oqWzzvW1L6TS34EhrP56R0Io88rAJoEyE71Qpim1akKlF/VmJ6v04yXWgUPrTX2vg== dependencies: "@ethereumjs/tx" "^3.2.1" + "@metamask/eth-sig-util" "^4.0.0" ethereumjs-util "^7.0.9" hdkey "0.8.0" - trezor-connect "8.2.3-extended" + trezor-connect "8.2.6-extended" ethereum-bloom-filters@^1.0.6: version "1.0.7" @@ -11284,7 +11319,7 @@ ethereumjs-util@^5.0.0, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereum safe-buffer "^5.1.1" secp256k1 "^3.0.1" -ethereumjs-util@^6.0.0: +ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== @@ -11571,7 +11606,7 @@ ethjs-util@0.1.3: is-hex-prefixed "1.0.0" strip-hex-prefix "1.0.0" -ethjs-util@0.1.6, ethjs-util@^0.1.3: +ethjs-util@0.1.6, ethjs-util@^0.1.3, ethjs-util@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== @@ -23911,37 +23946,36 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -ripple-address-codec@^4.0.0, ripple-address-codec@^4.1.0, ripple-address-codec@^4.1.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/ripple-address-codec/-/ripple-address-codec-4.1.2.tgz#c573309dbd0fdd4ef8c803bf36959b8a716c2aa1" - integrity sha512-bIhmaxOg6rwVYkPQha9cuHdIdwmD8XTnaklBmyRjFvNZwYJ6Cf0cdCt+SpJd+RRJhRU65+U1Eup6YkoCBrqebg== +ripple-address-codec@^4.1.1, ripple-address-codec@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/ripple-address-codec/-/ripple-address-codec-4.2.3.tgz#516675715cd43b71d2fd76c59bd92d0f623c152d" + integrity sha512-9Nd0hQmKoJEhSTzYR9kYjKmSWlH6HaVosNVAM7mIIVlzcNlQCPfKXj7CfvXcRiHl3C6XUZj7RFLqzVaPjq2ufA== dependencies: - base-x "3.0.8" + base-x "3.0.9" create-hash "^1.1.2" -ripple-binary-codec@^0.2.7: - version "0.2.7" - resolved "https://registry.yarnpkg.com/ripple-binary-codec/-/ripple-binary-codec-0.2.7.tgz#c5390e97e4072747a3ff386ee99558b496c6e5ab" - integrity sha512-VD+sHgZK76q3kmO765klFHPDCEveS5SUeg/bUNVpNrj7w2alyDNkbF17XNbAjFv+kSYhfsUudQanoaSs2Y6uzw== +ripple-binary-codec@^1.1.3: + version "1.3.0" + resolved "https://registry.yarnpkg.com/ripple-binary-codec/-/ripple-binary-codec-1.3.0.tgz#0c6cf503fb0e12948d538abd198a740bd9d2143a" + integrity sha512-hz4nhiekqHbUwIdBOg1PQKsbi+/GwOccHmTTfkIJTTp/p5mlifS+U3Zfz4dVzKhftrXCPympYvLb5QgoIP1AKw== dependencies: - babel-runtime "^6.26.0" - bn.js "^5.1.1" + assert "^2.0.0" + big-integer "^1.6.48" + buffer "5.6.0" create-hash "^1.2.0" decimal.js "^10.2.0" - inherits "^2.0.4" - lodash "^4.17.15" - ripple-address-codec "^4.1.0" + ripple-address-codec "^4.2.3" -ripple-keypairs@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/ripple-keypairs/-/ripple-keypairs-1.0.2.tgz#91c724210734e704e35053925a80bf1cd8104c92" - integrity sha512-3l2cUhUO4VEK42NfHtn7WA1NEO+vGU7p7/36QhCIvYFf8+lNdNrY0PrriJ3Mef/TG8hQvO8coCVEO5fpOKSAag== +ripple-keypairs@^1.0.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/ripple-keypairs/-/ripple-keypairs-1.1.3.tgz#3af825ffe85c1777b0aa78d832e9fc5750d4529d" + integrity sha512-y74Y3c0g652BgpDhWsf0x98GnUyY2D9eO2ay2exienUfbIe00TeIiFhYXQhCGVnliGsxeV9WTpU+YuEWuIxuhw== dependencies: bn.js "^5.1.1" brorand "^1.0.5" - elliptic "^6.5.2" + elliptic "^6.5.4" hash.js "^1.0.3" - ripple-address-codec "^4.0.0" + ripple-address-codec "^4.2.3" ripple-lib-transactionparser@0.8.2: version "0.8.2" @@ -23951,10 +23985,10 @@ ripple-lib-transactionparser@0.8.2: bignumber.js "^9.0.0" lodash "^4.17.15" -ripple-lib@1.8.2: - version "1.8.2" - resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.8.2.tgz#d36dafcb64a913a5dab8a2f66a3b0727baaa9347" - integrity sha512-7fLQtiXb8LfyedkXQtDSNQPy7omNu7rGUO8M8bK2qiE+DuX4FPl8B8tVJbxBwOusAuYzdoVQfZtfdXt4WmBpmw== +ripple-lib@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.10.0.tgz#e41aaf17d5c6e6f8bcc8116736ac108ff3d6b810" + integrity sha512-Cg2u73UybfM1PnzcuLt5flvLKZn35ovdIp+1eLrReVB4swuRuUF/SskJG9hf5wMosbvh+E+jZu8A6IbYJoyFIA== dependencies: "@types/lodash" "^4.14.136" "@types/ws" "^7.2.0" @@ -23962,10 +23996,9 @@ ripple-lib@1.8.2: https-proxy-agent "^5.0.0" jsonschema "1.2.2" lodash "^4.17.4" - lodash.isequal "^4.5.0" ripple-address-codec "^4.1.1" - ripple-binary-codec "^0.2.7" - ripple-keypairs "^1.0.0" + ripple-binary-codec "^1.1.3" + ripple-keypairs "^1.0.3" ripple-lib-transactionparser "0.8.2" ws "^7.2.0" @@ -26397,36 +26430,24 @@ tree-kill@^1.2.2: resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== -trezor-connect@8.2.3-extended: - version "8.2.3-extended" - resolved "https://registry.yarnpkg.com/trezor-connect/-/trezor-connect-8.2.3-extended.tgz#597e985bacd9ebc0ab61b031fffc21c96515546e" - integrity sha512-nGgkvE25rKW7SQaz5hOo5hgsx8US0L1piTWu5WFzC5PIz6R+yCyN+SeSeKlYRJ7t9VdzTC77cYu3fklxJHJzCA== +trezor-connect@8.2.6-extended: + version "8.2.6-extended" + resolved "https://registry.yarnpkg.com/trezor-connect/-/trezor-connect-8.2.6-extended.tgz#1f6af2b7d9a8677adcac7b5961ab48f59648f3cc" + integrity sha512-j6I975BhHM2JBDDeW7uAjkVJjkUVxv/YhXdVIRN0O70ZyfWeXlY1ZcsYmgUAp08bo8nabFA4UpFADslDHtL3lQ== dependencies: "@babel/runtime" "^7.15.4" - "@trezor/blockchain-link" "^1.0.17" - "@trezor/connect-common" "^0.0.3" - "@trezor/rollout" "^1.2.0" + "@trezor/blockchain-link" "1.1.0" + "@trezor/connect-common" "0.0.4" + "@trezor/rollout" "^1.2.1" + "@trezor/transport" "1.0.1" "@trezor/utxo-lib" "1.0.0-beta.10" bignumber.js "^9.0.1" bowser "^2.11.0" cbor-web "^7.0.6" + cross-fetch "^3.1.4" events "^3.3.0" - keccak "^3.0.2" - node-fetch "^2.6.1" parse-uri "^1.0.3" tiny-worker "^2.3.0" - trezor-link "2.0.0-beta.6" - whatwg-fetch "^3.6.2" - -trezor-link@2.0.0-beta.6: - version "2.0.0-beta.6" - resolved "https://registry.yarnpkg.com/trezor-link/-/trezor-link-2.0.0-beta.6.tgz#e727890a539ee1b6ff109a0227c38328d42d95c7" - integrity sha512-DwmbKV434Vx7RmuPxcZzABTLFK5n5mZ+5+UjQ8tA0lLx41NstRJ+/OKO0b8qMJOv1ZnoQ87dfu5LtI7o9EXKuw== - dependencies: - bytebuffer "^5.0.1" - json-stable-stringify "^1.0.1" - long "^4.0.0" - protobufjs "^6.11.2" trim-newlines@^3.0.0: version "3.0.1" @@ -26554,7 +26575,7 @@ tunnel@^0.0.6: resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== -tweetnacl-util@^0.15.0: +tweetnacl-util@^0.15.0, tweetnacl-util@^0.15.1: version "0.15.1" resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== @@ -27737,7 +27758,7 @@ whatwg-fetch@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, whatwg-fetch@^3.6.2: +whatwg-fetch@^3.4.1: version "3.6.2" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== From f996f32969455edc0a05aa6d9a591aeeb3767116 Mon Sep 17 00:00:00 2001 From: ryanml Date: Tue, 22 Feb 2022 19:49:46 -0700 Subject: [PATCH 04/19] Updating changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1f6082b2..29b23f8f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Swaps: Enable Avalanche ([#13653](https://github.com/MetaMask/metamask-extension/pull/13653)) - Add "Token details" page ([#13216](https://github.com/MetaMask/metamask-extension/pull/13216)) - Add icons to sections in settings ([#12920](https://github.com/MetaMask/metamask-extension/pull/12920)) +- Add EIP-712 support for Trezor ([#13693](https://github.com/MetaMask/metamask-extension/pull/13693)) ### Changed - Swaps: Change language "Quote X of Y" to "Fetching quote X of Y" ([#13663](https://github.com/MetaMask/metamask-extension/pull/13663)) From 1abac424f41981d7f7d975b21b1d850b6a6df549 Mon Sep 17 00:00:00 2001 From: Alex Donesky Date: Wed, 23 Feb 2022 10:20:42 -0600 Subject: [PATCH 05/19] fix issue where token details page unnecessarily relies on send asset state (#13717) --- ui/pages/asset/components/token-asset.js | 12 +--- ui/pages/token-details/token-details-page.js | 10 +--- .../token-details/token-details-page.test.js | 56 +++++++++---------- 3 files changed, 31 insertions(+), 47 deletions(-) diff --git a/ui/pages/asset/components/token-asset.js b/ui/pages/asset/components/token-asset.js index 5fef2a741..893d2606c 100644 --- a/ui/pages/asset/components/token-asset.js +++ b/ui/pages/asset/components/token-asset.js @@ -17,8 +17,6 @@ import { import { getURLHostName } from '../../../helpers/utils/util'; import { showModal } from '../../../store/actions'; import { useNewMetricEvent } from '../../../hooks/useMetricEvent'; -import { ASSET_TYPES, updateSendAsset } from '../../../ducks/send'; - import AssetNavigation from './asset-navigation'; import AssetOptions from './asset-options'; @@ -70,13 +68,9 @@ export default function TokenAsset({ token }) { dispatch(showModal({ name: 'ACCOUNT_DETAILS' })); }} onViewTokenDetails={() => { - dispatch( - updateSendAsset({ - type: ASSET_TYPES.TOKEN, - details: { ...token }, - }), - ).then(() => { - history.push(TOKEN_DETAILS); + history.push({ + pathname: TOKEN_DETAILS, + state: { tokenAddress: token.address }, }); }} tokenSymbol={token.symbol} diff --git a/ui/pages/token-details/token-details-page.js b/ui/pages/token-details/token-details-page.js index 4289f4712..8fb34799a 100644 --- a/ui/pages/token-details/token-details-page.js +++ b/ui/pages/token-details/token-details-page.js @@ -2,7 +2,6 @@ import React, { useContext } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { Redirect, useHistory } from 'react-router-dom'; import { getTokens } from '../../ducks/metamask/metamask'; -import { getSendAssetAddress } from '../../ducks/send'; import { getUseTokenDetection, getTokenList } from '../../selectors'; import { useCopyToClipboard } from '../../hooks/useCopyToClipboard'; import { isEqualCaseInsensitive } from '../../helpers/utils/util'; @@ -31,18 +30,13 @@ export default function TokenDetailsPage() { const dispatch = useDispatch(); const history = useHistory(); const t = useContext(I18nContext); - const tokens = useSelector(getTokens); const tokenList = useSelector(getTokenList); const useTokenDetection = useSelector(getUseTokenDetection); - const assetAddress = useSelector((state) => ({ - asset: getSendAssetAddress(state), - })); - - const { asset: tokenAddress } = assetAddress; + const tokenAddress = history?.location?.state?.tokenAddress; - const tokenMetadata = tokenList[tokenAddress]; + const tokenMetadata = tokenList?.[tokenAddress]; const fileName = tokenMetadata?.iconUrl; const imagePath = useTokenDetection ? fileName diff --git a/ui/pages/token-details/token-details-page.test.js b/ui/pages/token-details/token-details-page.test.js index ae5a6a47e..623430725 100644 --- a/ui/pages/token-details/token-details-page.test.js +++ b/ui/pages/token-details/token-details-page.test.js @@ -3,8 +3,10 @@ import configureMockStore from 'redux-mock-store'; import { fireEvent } from '@testing-library/react'; import { renderWithProvider } from '../../../test/lib/render-helpers'; import Identicon from '../../components/ui/identicon/identicon.component'; +import { isEqualCaseInsensitive } from '../../helpers/utils/util'; import TokenDetailsPage from './token-details-page'; +const testTokenAddress = '0xaD6D458402F60fD3Bd25163575031ACDce07538A'; const state = { metamask: { selectedAddress: '0xAddress', @@ -86,10 +88,10 @@ const state = { }, tokens: [ { - address: '0xaD6D458402F60fD3Bd25163575031ACDce07538A', + address: testTokenAddress, symbol: 'DAA', decimals: 18, - image: null, + image: 'testImage', isERC721: false, }, { @@ -101,28 +103,23 @@ const state = { }, ], }, - send: { - asset: { - balance: '0x0', - type: 'TOKEN', - details: { - address: '0xaD6D458402F60fD3Bd25163575031ACDce07538A', - decimals: 18, - image: null, - isERC721: false, - symbol: 'DAI', - }, - }, - }, - token: { - address: '0x6b175474e89094c44da98b954eedeac495271d0f', - decimals: 18, - image: './images/eth_logo.svg', - isERC721: false, - symbol: 'ETH', - }, }; +jest.mock('react-router-dom', () => { + const original = jest.requireActual('react-router-dom'); + return { + ...original, + useHistory: () => ({ + push: jest.fn(), + location: { + state: { + tokenAddress: testTokenAddress, + }, + }, + }), + }; +}); + describe('TokenDetailsPage', () => { it('should render title "Token details" in token details page', () => { const store = configureMockStore()(state); @@ -139,14 +136,13 @@ describe('TokenDetailsPage', () => { }); it('should render an icon image', () => { - const image = ( - + const token = state.metamask.tokens.find(({ address }) => + isEqualCaseInsensitive(address, testTokenAddress), + ); + const iconImage = ( + ); - expect(image).toBeDefined(); + expect(iconImage).toBeDefined(); }); it('should render token contract address title in token details page', () => { @@ -158,7 +154,7 @@ describe('TokenDetailsPage', () => { it('should render token contract address in token details page', () => { const store = configureMockStore()(state); const { getByText } = renderWithProvider(, store); - expect(getByText(state.send.asset.details.address)).toBeInTheDocument(); + expect(getByText(testTokenAddress)).toBeInTheDocument(); }); it('should call copy button when click is simulated', () => { From b3b5d3c8d94d9003b3f2c27dd7ad0658c6e3f1bb Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 23 Feb 2022 11:57:16 -0700 Subject: [PATCH 06/19] Fixing blockies on token detail page (#13728) --- ui/pages/token-details/token-details-page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/pages/token-details/token-details-page.js b/ui/pages/token-details/token-details-page.js index 8fb34799a..01fdd17f8 100644 --- a/ui/pages/token-details/token-details-page.js +++ b/ui/pages/token-details/token-details-page.js @@ -5,7 +5,7 @@ import { getTokens } from '../../ducks/metamask/metamask'; import { getUseTokenDetection, getTokenList } from '../../selectors'; import { useCopyToClipboard } from '../../hooks/useCopyToClipboard'; import { isEqualCaseInsensitive } from '../../helpers/utils/util'; -import Identicon from '../../components/ui/identicon/identicon.component'; +import Identicon from '../../components/ui/identicon'; import { I18nContext } from '../../contexts/i18n'; import { useTokenTracker } from '../../hooks/useTokenTracker'; import { useTokenFiatAmount } from '../../hooks/useTokenFiatAmount'; From 1883af8ab4937cc5bb10c20640c1ff329a860a52 Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 23 Feb 2022 13:43:41 -0700 Subject: [PATCH 07/19] Fix token details icon when 'Use Token Detection' is enabled (#13726) --- ui/pages/token-details/token-details-page.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/pages/token-details/token-details-page.js b/ui/pages/token-details/token-details-page.js index 01fdd17f8..522a7a5d4 100644 --- a/ui/pages/token-details/token-details-page.js +++ b/ui/pages/token-details/token-details-page.js @@ -35,8 +35,9 @@ export default function TokenDetailsPage() { const useTokenDetection = useSelector(getUseTokenDetection); const tokenAddress = history?.location?.state?.tokenAddress; - - const tokenMetadata = tokenList?.[tokenAddress]; + const tokenMetadata = Object.values(tokenList).find((token) => + isEqualCaseInsensitive(token.address, tokenAddress), + ); const fileName = tokenMetadata?.iconUrl; const imagePath = useTokenDetection ? fileName From 730f977939390bed44f1289efe327889c88d85ac Mon Sep 17 00:00:00 2001 From: Daniel <80175477+dan437@users.noreply.github.com> Date: Wed, 23 Feb 2022 22:10:28 +0100 Subject: [PATCH 08/19] Small fixes for Swaps (#13732) * Fix: Insufficient number of substitutions for key "stxSuccessDescription" * Only calculate "approvalGas" if the "approvalNeeded" param is truthy in a quote * "Swap from" has to be set to enable "Review Swap", set a default token for "Swap from" * Fix: Unable to find value of key "undefined" for locale * Use array destructuring --- app/scripts/controllers/swaps.js | 6 ++++-- .../transaction-status/transaction-status.component.js | 2 +- ui/pages/swaps/awaiting-swap/awaiting-swap.js | 8 ++++++-- ui/pages/swaps/build-quote/build-quote.js | 1 + .../smart-transaction-status/smart-transaction-status.js | 4 +++- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/scripts/controllers/swaps.js b/app/scripts/controllers/swaps.js index 5684c8ba4..8b16a86dc 100644 --- a/app/scripts/controllers/swaps.js +++ b/app/scripts/controllers/swaps.js @@ -289,14 +289,16 @@ export default class SwapsController { fetchParams.fromAddress, chainId, ); + const [firstQuote] = Object.values(newQuotes); // For a user to be able to swap a token, they need to have approved the MetaSwap contract to withdraw that token. // _getERC20Allowance() returns the amount of the token they have approved for withdrawal. If that amount is greater // than 0, it means that approval has already occurred and is not needed. Otherwise, for tokens to be swapped, a new // call of the ERC-20 approve method is required. approvalRequired = + firstQuote.approvalNeeded && allowance.eq(0) && - Object.values(newQuotes)[0].aggregator !== 'wrappedNative'; + firstQuote.aggregator !== 'wrappedNative'; if (!approvalRequired) { newQuotes = mapValues(newQuotes, (quote) => ({ ...quote, @@ -304,7 +306,7 @@ export default class SwapsController { })); } else if (!isPolledRequest) { const { gasLimit: approvalGas } = await this.timedoutGasReturn( - Object.values(newQuotes)[0].approvalNeeded, + firstQuote.approvalNeeded, ); newQuotes = mapValues(newQuotes, (quote) => ({ diff --git a/ui/components/app/transaction-status/transaction-status.component.js b/ui/components/app/transaction-status/transaction-status.component.js index 584989adb..000c84a28 100644 --- a/ui/components/app/transaction-status/transaction-status.component.js +++ b/ui/components/app/transaction-status/transaction-status.component.js @@ -57,7 +57,7 @@ export default function TransactionStatus({ const statusText = statusKey === TRANSACTION_STATUSES.CONFIRMED && !statusOnly ? date - : t(statusKey); + : statusKey && t(statusKey); return ( { + onClick={async () => { makeAnotherSwapEvent(); - dispatch(navigateBackToBuildQuote(history)); + await dispatch(navigateBackToBuildQuote(history)); + dispatch(setSwapsFromToken(defaultSwapsToken)); }} > {t('makeAnotherSwap')} diff --git a/ui/pages/swaps/build-quote/build-quote.js b/ui/pages/swaps/build-quote/build-quote.js index 363edd5e7..d4eccac17 100644 --- a/ui/pages/swaps/build-quote/build-quote.js +++ b/ui/pages/swaps/build-quote/build-quote.js @@ -510,6 +510,7 @@ export default function BuildQuote({ !isFeatureFlagLoaded || !Number(fromTokenInputValue) || !selectedToToken?.address || + !fromTokenAddress || Number(maxSlippage) < 0 || Number(maxSlippage) > MAX_ALLOWED_SLIPPAGE || (toTokenIsNotDefault && occurrences < 2 && !verificationClicked); diff --git a/ui/pages/swaps/smart-transaction-status/smart-transaction-status.js b/ui/pages/swaps/smart-transaction-status/smart-transaction-status.js index b605495d3..8087020b2 100644 --- a/ui/pages/swaps/smart-transaction-status/smart-transaction-status.js +++ b/ui/pages/swaps/smart-transaction-status/smart-transaction-status.js @@ -188,7 +188,9 @@ export default function SmartTransactionStatus() { } if (smartTransactionStatus === SMART_TRANSACTION_STATUSES.SUCCESS) { headerText = t('stxSuccess'); - description = t('stxSuccessDescription', [destinationTokenInfo?.symbol]); + if (destinationTokenInfo?.symbol) { + description = t('stxSuccessDescription', [destinationTokenInfo.symbol]); + } icon = ; } else if (smartTransactionStatus === 'cancelled_user_cancelled') { headerText = t('stxUserCancelled'); From 30589d6219a157c2401d14403c07e0d4acb738a6 Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 23 Feb 2022 14:31:03 -0700 Subject: [PATCH 09/19] Updating changelog --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29b23f8f1..befb91964 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [10.11.0] ### Added - Swaps: Add support for Smart Transactions on Mainnet and Rinkeby ([#12676](https://github.com/MetaMask/metamask-extension/pull/12676)) -- Swaps: Enable Avalanche ([#13653](https://github.com/MetaMask/metamask-extension/pull/13653)) - Add "Token details" page ([#13216](https://github.com/MetaMask/metamask-extension/pull/13216)) - Add icons to sections in settings ([#12920](https://github.com/MetaMask/metamask-extension/pull/12920)) - Add EIP-712 support for Trezor ([#13693](https://github.com/MetaMask/metamask-extension/pull/13693)) From 2177ba8951b2f467f47bd7f1c840ca1776b63c71 Mon Sep 17 00:00:00 2001 From: ryanml Date: Thu, 24 Feb 2022 22:13:30 -0700 Subject: [PATCH 10/19] Fixing changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b4e02109..52dff784f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Do not allow transaction creation with gas limit below minimum ([#13574](https://github.com/MetaMask/metamask-extension/pull/13574)) - Fix network editing error when no block explorer is provided ([#13527](https://github.com/MetaMask/metamask-extension/pull/13527)) - Swaps: Fix BigNumber error when submitting quote ([#13555](https://github.com/MetaMask/metamask-extension/pull/13555)) + ## [10.10.1] ### Added - Swaps: Enable Avalanche ([#13653](https://github.com/MetaMask/metamask-extension/pull/13653)) @@ -2760,8 +2761,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added the ability to restore accounts from seed words. [Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.11.0...HEAD -[10.11.0]: https://github.com/MetaMask/metamask-extension/compare/v10.10.0...v10.11.0 -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.10.1...HEAD +[10.11.0]: https://github.com/MetaMask/metamask-extension/compare/v10.10.1...v10.11.0 [10.10.1]: https://github.com/MetaMask/metamask-extension/compare/v10.10.0...v10.10.1 [10.10.0]: https://github.com/MetaMask/metamask-extension/compare/v10.9.3...v10.10.0 [10.9.3]: https://github.com/MetaMask/metamask-extension/compare/v10.9.2...v10.9.3 From 7af8570a4e3cfb68c58ad2d18006ae6917824c55 Mon Sep 17 00:00:00 2001 From: ryanml Date: Fri, 25 Feb 2022 21:23:53 -0700 Subject: [PATCH 11/19] Running yarn lavamoat:auto --- lavamoat/browserify/beta/policy.json | 3 --- lavamoat/browserify/flask/policy.json | 3 --- lavamoat/browserify/main/policy.json | 3 --- 3 files changed, 9 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 41925f129..fd9c5466a 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -563,10 +563,7 @@ "ethereumjs-wallet": true, "ethers": true, "ethjs-unit": true, - "ethjs-util": true, "events": true, - "human-standard-collectible-abi": true, - "human-standard-token-abi": true, "immer": true, "isomorphic-fetch": true, "jsonschema": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index f540236ba..fc9b78a8e 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -563,10 +563,7 @@ "ethereumjs-wallet": true, "ethers": true, "ethjs-unit": true, - "ethjs-util": true, "events": true, - "human-standard-collectible-abi": true, - "human-standard-token-abi": true, "immer": true, "isomorphic-fetch": true, "jsonschema": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 41925f129..fd9c5466a 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -563,10 +563,7 @@ "ethereumjs-wallet": true, "ethers": true, "ethjs-unit": true, - "ethjs-util": true, "events": true, - "human-standard-collectible-abi": true, - "human-standard-token-abi": true, "immer": true, "isomorphic-fetch": true, "jsonschema": true, From 61a7c0d476e2cc94eb293043adaebcc4f47e13bb Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 2 Mar 2022 09:05:10 -0700 Subject: [PATCH 12/19] fixing changelog --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 391137b5d..9ffb0292c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2765,8 +2765,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added the ability to restore accounts from seed words. [Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.11.0...HEAD -[10.11.0]: https://github.com/MetaMask/metamask-extension/compare/v10.10.1...v10.11.0 -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.10.2...HEAD +[10.11.0]: https://github.com/MetaMask/metamask-extension/compare/v10.10.2...v10.11.0 [10.10.2]: https://github.com/MetaMask/metamask-extension/compare/v10.10.1...v10.10.2 [10.10.1]: https://github.com/MetaMask/metamask-extension/compare/v10.10.0...v10.10.1 [10.10.0]: https://github.com/MetaMask/metamask-extension/compare/v10.9.3...v10.10.0 From eb5dc7d8b08c17cd27c0e6a685431b1d1e7f3e80 Mon Sep 17 00:00:00 2001 From: Olusegun Akintayo Date: Wed, 2 Mar 2022 19:59:31 +0400 Subject: [PATCH 13/19] Fixed these issues in v10.11.0 (#13806) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After landing on Swap, a disclaimer of Smart Transactions appear, and an error on devTools shows the following: “invalid prop ‘type’ of value ‘ul’” supplied to ‘Typography’ After enabling Smart Transactions, an error on devTools shows the following: “invalid prop ‘smartTransactionsOptInSatus’ of type ‘boolean supplied to ‘SlippageButtons’ Signed-off-by: Akintayo A. Olusegun --- ui/components/ui/typography/typography.js | 1 + ui/pages/swaps/slippage-buttons/slippage-buttons.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/components/ui/typography/typography.js b/ui/components/ui/typography/typography.js index 33af8d664..8c9e4e272 100644 --- a/ui/components/ui/typography/typography.js +++ b/ui/components/ui/typography/typography.js @@ -86,5 +86,6 @@ Typography.propTypes = { 'div', 'dt', 'dd', + 'ul', ]), }; diff --git a/ui/pages/swaps/slippage-buttons/slippage-buttons.js b/ui/pages/swaps/slippage-buttons/slippage-buttons.js index c2b3986f1..d542f2299 100644 --- a/ui/pages/swaps/slippage-buttons/slippage-buttons.js +++ b/ui/pages/swaps/slippage-buttons/slippage-buttons.js @@ -238,7 +238,7 @@ SlippageButtons.propTypes = { maxAllowedSlippage: PropTypes.number.isRequired, currentSlippage: PropTypes.number, smartTransactionsEnabled: PropTypes.bool.isRequired, - smartTransactionsOptInStatus: PropTypes.object, + smartTransactionsOptInStatus: PropTypes.bool, setSmartTransactionsOptInStatus: PropTypes.func, currentSmartTransactionsError: PropTypes.string, }; From 47661fc58d5635d35a899385f3124c385b6e4eb5 Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 2 Mar 2022 09:01:53 -0700 Subject: [PATCH 14/19] Persisting token address via URL (Token Details page) (#13807) --- ui/helpers/constants/routes.js | 2 +- ui/pages/asset/components/token-asset.js | 5 +---- ui/pages/routes/routes.component.js | 2 +- ui/pages/token-details/token-details-page.js | 4 ++-- ui/pages/token-details/token-details-page.test.js | 8 +++----- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ui/helpers/constants/routes.js b/ui/helpers/constants/routes.js index 7fe043e3f..83d659dbf 100644 --- a/ui/helpers/constants/routes.js +++ b/ui/helpers/constants/routes.js @@ -125,7 +125,7 @@ const PATH_NAME_MAP = { [IMPORT_ACCOUNT_ROUTE]: 'Import Account Page', [CONNECT_HARDWARE_ROUTE]: 'Connect Hardware Wallet Page', [SEND_ROUTE]: 'Send Page', - [TOKEN_DETAILS]: 'Token Details Page', + [`${TOKEN_DETAILS}/:address`]: 'Token Details Page', [`${CONNECT_ROUTE}/:id`]: 'Connect To Site Confirmation Page', [`${CONNECT_ROUTE}/:id${CONNECT_CONFIRM_PERMISSIONS_ROUTE}`]: 'Grant Connected Site Permissions Confirmation Page', [CONNECTED_ROUTE]: 'Sites Connected To This Account Page', diff --git a/ui/pages/asset/components/token-asset.js b/ui/pages/asset/components/token-asset.js index 893d2606c..a719fb8b6 100644 --- a/ui/pages/asset/components/token-asset.js +++ b/ui/pages/asset/components/token-asset.js @@ -68,10 +68,7 @@ export default function TokenAsset({ token }) { dispatch(showModal({ name: 'ACCOUNT_DETAILS' })); }} onViewTokenDetails={() => { - history.push({ - pathname: TOKEN_DETAILS, - state: { tokenAddress: token.address }, - }); + history.push(`${TOKEN_DETAILS}/${token.address}`); }} tokenSymbol={token.symbol} /> diff --git a/ui/pages/routes/routes.component.js b/ui/pages/routes/routes.component.js index 94c9b93f9..2ac1b40fa 100644 --- a/ui/pages/routes/routes.component.js +++ b/ui/pages/routes/routes.component.js @@ -155,7 +155,7 @@ export default class Routes extends Component { exact /> diff --git a/ui/pages/token-details/token-details-page.js b/ui/pages/token-details/token-details-page.js index 522a7a5d4..a26ada620 100644 --- a/ui/pages/token-details/token-details-page.js +++ b/ui/pages/token-details/token-details-page.js @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { Redirect, useHistory } from 'react-router-dom'; +import { Redirect, useHistory, useParams } from 'react-router-dom'; import { getTokens } from '../../ducks/metamask/metamask'; import { getUseTokenDetection, getTokenList } from '../../selectors'; import { useCopyToClipboard } from '../../hooks/useCopyToClipboard'; @@ -34,7 +34,7 @@ export default function TokenDetailsPage() { const tokenList = useSelector(getTokenList); const useTokenDetection = useSelector(getUseTokenDetection); - const tokenAddress = history?.location?.state?.tokenAddress; + const { address: tokenAddress } = useParams(); const tokenMetadata = Object.values(tokenList).find((token) => isEqualCaseInsensitive(token.address, tokenAddress), ); diff --git a/ui/pages/token-details/token-details-page.test.js b/ui/pages/token-details/token-details-page.test.js index 623430725..e5385098f 100644 --- a/ui/pages/token-details/token-details-page.test.js +++ b/ui/pages/token-details/token-details-page.test.js @@ -111,11 +111,9 @@ jest.mock('react-router-dom', () => { ...original, useHistory: () => ({ push: jest.fn(), - location: { - state: { - tokenAddress: testTokenAddress, - }, - }, + }), + useParams: () => ({ + address: testTokenAddress, }), }; }); From 532cf54307d8dbf4f9e2d409b496dc6a58d96b9a Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 2 Mar 2022 17:28:56 -0700 Subject: [PATCH 15/19] Revert "Allow sending up to 15 decimals on the send screen (#12707)" (#13823) This reverts commit 8597cd140149704a71a682fdab61668372ec18d3. --- shared/constants/decimal.js | 5 ----- .../app/currency-input/currency-input.js | 15 +++------------ .../app/currency-input/currency-input.test.js | 17 ++++------------- .../ui/token-input/token-input.component.js | 8 +------- .../ui/unit-input/unit-input.component.js | 8 -------- .../send-amount-row.component.js | 3 --- 6 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 shared/constants/decimal.js diff --git a/shared/constants/decimal.js b/shared/constants/decimal.js deleted file mode 100644 index cc6090a84..000000000 --- a/shared/constants/decimal.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * MAX_DECIMAL represensts the maximum number of decimal values allow for the input, - * the limitation in javascript retstricts us to keep it as 15 and below. - */ -export const MAX_DECIMAL = 15; diff --git a/ui/components/app/currency-input/currency-input.js b/ui/components/app/currency-input/currency-input.js index 640467c30..79efec149 100644 --- a/ui/components/app/currency-input/currency-input.js +++ b/ui/components/app/currency-input/currency-input.js @@ -14,7 +14,6 @@ import { getNativeCurrency, } from '../../../ducks/metamask/metamask'; import { getCurrentCurrency, getShouldShowFiat } from '../../../selectors'; -import { MAX_DECIMAL } from '../../../../shared/constants/decimal'; /** * Component that allows user to enter currency values as a number, and props receive a converted @@ -26,14 +25,12 @@ import { MAX_DECIMAL } from '../../../../shared/constants/decimal'; * @param options0.featureSecondary * @param options0.onChange * @param options0.onPreferenceToggle - * @param options0.primaryNumberOfDecimals */ export default function CurrencyInput({ hexValue, featureSecondary, onChange, onPreferenceToggle, - primaryNumberOfDecimals = 8, }) { const t = useContext(I18nContext); @@ -67,10 +64,7 @@ export default function CurrencyInput({ : getValueFromWeiHex({ value: hexValue, toCurrency: ETH, - numberOfDecimals: - primaryNumberOfDecimals <= MAX_DECIMAL - ? primaryNumberOfDecimals - : MAX_DECIMAL, + numberOfDecimals: 8, }); return Number(decimalValueString) || 0; @@ -133,10 +127,7 @@ export default function CurrencyInput({ if (shouldUseFiat()) { // Display ETH currency = preferredCurrency || ETH; - numberOfDecimals = - primaryNumberOfDecimals <= MAX_DECIMAL - ? primaryNumberOfDecimals - : MAX_DECIMAL; + numberOfDecimals = 8; } else { // Display Fiat currency = secondaryCurrency; @@ -152,6 +143,7 @@ export default function CurrencyInput({ /> ); }; + return ( { @@ -146,11 +145,7 @@ describe('CurrencyInput Component', () => { const wrapper = mount( - + , { context: { t: (str) => `${str}_t` }, @@ -162,7 +157,7 @@ describe('CurrencyInput Component', () => { expect(wrapper.find('.unit-input__suffix')).toHaveLength(1); expect(wrapper.find('.unit-input__suffix').text()).toStrictEqual('ETH'); expect(wrapper.find('.unit-input__input').props().value).toStrictEqual( - 0.004327880204276, + 0.00432788, ); expect( wrapper.find('.currency-input__conversion-component').text(), @@ -198,11 +193,7 @@ describe('CurrencyInput Component', () => { const store = configureMockStore()(mockStore); const wrapper = mount( - + , ); @@ -211,7 +202,7 @@ describe('CurrencyInput Component', () => { expect(handleBlurSpy.callCount).toStrictEqual(0); const input = wrapper.find('input'); - expect(input.props().value).toStrictEqual(0.004327880204276); + expect(input.props().value).toStrictEqual(0.00432788); input.simulate('change', { target: { value: 1 } }); expect(handleChangeSpy.callCount).toStrictEqual(2); diff --git a/ui/components/ui/token-input/token-input.component.js b/ui/components/ui/token-input/token-input.component.js index 401d4385b..3b8d2eefb 100644 --- a/ui/components/ui/token-input/token-input.component.js +++ b/ui/components/ui/token-input/token-input.component.js @@ -11,7 +11,6 @@ import { import { ETH } from '../../../helpers/constants/common'; import { addHexPrefix } from '../../../../app/scripts/lib/util'; -import { MAX_DECIMAL } from '../../../../shared/constants/decimal'; /** * Component that allows user to enter token values as a number, and props receive a converted @@ -35,7 +34,6 @@ export default class TokenInput extends PureComponent { symbol: PropTypes.string, }).isRequired, tokenExchangeRates: PropTypes.object, - primaryNumberOfDecimals: PropTypes.number, }; constructor(props) { @@ -110,7 +108,6 @@ export default class TokenInput extends PureComponent { currentCurrency, hideConversion, token, - primaryNumberOfDecimals = 8, } = this.props; const { decimalValue } = this.state; @@ -132,10 +129,7 @@ export default class TokenInput extends PureComponent { } else { // Display ETH currency = ETH; - numberOfDecimals = - primaryNumberOfDecimals <= MAX_DECIMAL - ? primaryNumberOfDecimals - : MAX_DECIMAL; + numberOfDecimals = 6; } const decimalEthValue = decimalValue * tokenExchangeRate || 0; diff --git a/ui/components/ui/unit-input/unit-input.component.js b/ui/components/ui/unit-input/unit-input.component.js index b496a914f..10e14b12f 100644 --- a/ui/components/ui/unit-input/unit-input.component.js +++ b/ui/components/ui/unit-input/unit-input.component.js @@ -1,9 +1,6 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; -import { MAX_DECIMAL } from '../../../../shared/constants/decimal'; - -const DECIMAL_REGEX = /\.(\d*)/u; function removeLeadingZeroes(str) { return str.replace(/^0*(?=\d)/u, ''); @@ -65,11 +62,6 @@ export default class UnitInput extends PureComponent { handleChange = (event) => { const { value: userInput } = event.target; - const match = DECIMAL_REGEX.exec(userInput); - if (match?.[1]?.length > MAX_DECIMAL) { - return; - } - let value = userInput; if (userInput.length && userInput.length > 1) { diff --git a/ui/pages/send/send-content/send-amount-row/send-amount-row.component.js b/ui/pages/send/send-content/send-amount-row/send-amount-row.component.js index 9cd3eed09..711437e46 100644 --- a/ui/pages/send/send-content/send-amount-row/send-amount-row.component.js +++ b/ui/pages/send/send-content/send-amount-row/send-amount-row.component.js @@ -4,7 +4,6 @@ import SendRowWrapper from '../send-row-wrapper'; import UserPreferencedCurrencyInput from '../../../../components/app/user-preferenced-currency-input'; import UserPreferencedTokenInput from '../../../../components/app/user-preferenced-token-input'; import { ASSET_TYPES } from '../../../../ducks/send'; -import { MAX_DECIMAL } from '../../../../../shared/constants/decimal'; import AmountMaxButton from './amount-max-button'; export default class SendAmountRow extends Component { @@ -32,14 +31,12 @@ export default class SendAmountRow extends Component { onChange={this.handleChange} token={asset.details} value={amount} - primaryNumberOfDecimals={asset.decimals} /> ) : ( ); } From 98b3da31c7c91fa766c75551ae8ac380a477d35d Mon Sep 17 00:00:00 2001 From: ryanml Date: Thu, 3 Mar 2022 10:20:58 -0700 Subject: [PATCH 16/19] Restoring create password form layout (#13824) --- ui/pages/first-time-flow/index.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/pages/first-time-flow/index.scss b/ui/pages/first-time-flow/index.scss index c6279d1b9..93c52fbde 100644 --- a/ui/pages/first-time-flow/index.scss +++ b/ui/pages/first-time-flow/index.scss @@ -29,7 +29,8 @@ } } - &__import { + &__import, + &__form { display: flex; flex-direction: column; } From 34bf555e505b04cf4c61dd4322c4010cf669cd0c Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:56:31 -0300 Subject: [PATCH 17/19] Fix v10.11: Unable to find value of key "eth_accounts" for locale "en" in Permissions Modal (#13833) * ConnectedAccountsPermissions: convert to FC * permissions: add usePermissionsDescriptions - fix ConnectedAccountsPermissions eth_accounts i18n * ConnectedAccountsPermissions: rm .component from path * ConnectedAccountsPermissions: fix toggleExpanded ensure we change previous state value Co-authored-by: Mark Stacey Co-authored-by: Mark Stacey --- ...onnected-accounts-permissions.component.js | 86 -------------- .../connected-accounts-permissions.js | 83 +++++++++++++ .../connected-accounts-permissions/index.js | 2 +- .../permissions-connect-permission-list.js | 112 +----------------- ui/hooks/usePermissionDescriptions.js | 98 +++++++++++++++ 5 files changed, 188 insertions(+), 193 deletions(-) delete mode 100644 ui/components/app/connected-accounts-permissions/connected-accounts-permissions.component.js create mode 100644 ui/components/app/connected-accounts-permissions/connected-accounts-permissions.js create mode 100644 ui/hooks/usePermissionDescriptions.js diff --git a/ui/components/app/connected-accounts-permissions/connected-accounts-permissions.component.js b/ui/components/app/connected-accounts-permissions/connected-accounts-permissions.component.js deleted file mode 100644 index 11e521c55..000000000 --- a/ui/components/app/connected-accounts-permissions/connected-accounts-permissions.component.js +++ /dev/null @@ -1,86 +0,0 @@ -import classnames from 'classnames'; -import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; -import CheckBox from '../../ui/check-box'; - -export default class ConnectedAccountsPermissions extends PureComponent { - static contextTypes = { - t: PropTypes.func.isRequired, - }; - - static defaultProps = { - permissions: [], - }; - - static propTypes = { - permissions: PropTypes.arrayOf( - PropTypes.shape({ - key: PropTypes.string.isRequired, - }), - ), - }; - - state = { - expanded: false, - }; - - toggleExpanded = () => { - this.setState((prevState) => ({ - expanded: !prevState.expanded, - })); - }; - - render() { - const { permissions } = this.props; - const { t } = this.context; - const { expanded } = this.state; - - if (permissions.length === 0) { - return null; - } - - return ( -
-

- {t('permissions')} -

- ); - } -} diff --git a/ui/components/app/connected-accounts-permissions/connected-accounts-permissions.js b/ui/components/app/connected-accounts-permissions/connected-accounts-permissions.js new file mode 100644 index 000000000..feb781ab7 --- /dev/null +++ b/ui/components/app/connected-accounts-permissions/connected-accounts-permissions.js @@ -0,0 +1,83 @@ +import classnames from 'classnames'; +import PropTypes from 'prop-types'; +import React, { useState } from 'react'; +import CheckBox from '../../ui/check-box'; +import { useI18nContext } from '../../../hooks/useI18nContext'; +import { usePermissionDescriptions } from '../../../hooks/usePermissionDescriptions'; + +const ConnectedAccountsPermissions = ({ permissions }) => { + const t = useI18nContext(); + const [expanded, setExpanded] = useState(false); + + const getPermissionDescription = usePermissionDescriptions(); + + const toggleExpanded = () => { + setExpanded((_expanded) => !_expanded); + }; + + if (!permissions.length) { + return null; + } + + return ( +
+

+ {t('permissions')} +

+ ); +}; + +ConnectedAccountsPermissions.propTypes = { + permissions: PropTypes.arrayOf( + PropTypes.shape({ + key: PropTypes.string.isRequired, + }), + ), +}; + +ConnectedAccountsPermissions.defaultProps = { + permissions: [], +}; + +ConnectedAccountsPermissions.displayName = 'ConnectedAccountsPermissions'; + +export default React.memo(ConnectedAccountsPermissions); diff --git a/ui/components/app/connected-accounts-permissions/index.js b/ui/components/app/connected-accounts-permissions/index.js index 46bbd1ee9..4cb6a5feb 100644 --- a/ui/components/app/connected-accounts-permissions/index.js +++ b/ui/components/app/connected-accounts-permissions/index.js @@ -1 +1 @@ -export { default } from './connected-accounts-permissions.component'; +export { default } from './connected-accounts-permissions'; diff --git a/ui/components/app/permissions-connect-permission-list/permissions-connect-permission-list.js b/ui/components/app/permissions-connect-permission-list/permissions-connect-permission-list.js index a0d412368..49ab4c003 100644 --- a/ui/components/app/permissions-connect-permission-list/permissions-connect-permission-list.js +++ b/ui/components/app/permissions-connect-permission-list/permissions-connect-permission-list.js @@ -1,116 +1,16 @@ -import React, { useMemo } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; -import { - RestrictedMethods, - ///: BEGIN:ONLY_INCLUDE_IN(flask) - EndowmentPermissions, - PermissionNamespaces, - ///: END:ONLY_INCLUDE_IN -} from '../../../../shared/constants/permissions'; -import { useI18nContext } from '../../../hooks/useI18nContext'; -///: BEGIN:ONLY_INCLUDE_IN(flask) -import { coinTypeToProtocolName } from '../../../helpers/utils/util'; -///: END:ONLY_INCLUDE_IN - -const UNKNOWN_PERMISSION = Symbol('unknown'); - -/** - * @typedef {Object} PermissionLabelObject - * @property {string} label - The text label. - * @property {string} leftIcon - The left icon. - * @property {string} rightIcon - The right icon. - */ - -/** - * Gets the permission list label dictionary key for the specified permission - * name. - * - * @param {string} permissionName - The name of the permission whose key to - * retrieve. - * @param {Record} permissionDictionary - The - * dictionary object mapping permission keys to label objects. - */ -function getPermissionKey(permissionName, permissionDictionary) { - if (Object.hasOwnProperty.call(permissionDictionary, permissionName)) { - return permissionName; - } - ///: BEGIN:ONLY_INCLUDE_IN(flask) - for (const namespace of Object.keys(PermissionNamespaces)) { - if (permissionName.startsWith(namespace)) { - return PermissionNamespaces[namespace]; - } - } - ///: END:ONLY_INCLUDE_IN - - return UNKNOWN_PERMISSION; -} +import { usePermissionDescriptions } from '../../../hooks/usePermissionDescriptions'; export default function PermissionsConnectPermissionList({ permissions }) { - const t = useI18nContext(); - - const PERMISSION_LIST_VALUES = useMemo(() => { - return { - [RestrictedMethods.eth_accounts]: { - leftIcon: 'fas fa-eye', - label: t('permission_ethereumAccounts'), - rightIcon: null, - }, - ///: BEGIN:ONLY_INCLUDE_IN(flask) - [RestrictedMethods.snap_confirm]: { - leftIcon: 'fas fa-user-check', - label: t('permission_customConfirmation'), - rightIcon: null, - }, - [RestrictedMethods['snap_getBip44Entropy_*']]: (permissionName) => { - const coinType = permissionName.split('_').slice(-1); - return { - leftIcon: 'fas fa-door-open', - label: t('permission_manageBip44Keys', [ - coinTypeToProtocolName(coinType) || - `${coinType} (Unrecognized protocol)`, - ]), - rightIcon: null, - }; - }, - [RestrictedMethods.snap_manageState]: { - leftIcon: 'fas fa-download', - label: t('permission_manageState'), - rightIcon: null, - }, - [RestrictedMethods['wallet_snap_*']]: (permissionName) => { - const snapId = permissionName.split('_').slice(-1); - return { - leftIcon: 'fas fa-bolt', - label: t('permission_accessSnap', [snapId]), - rightIcon: null, - }; - }, - [EndowmentPermissions['endowment:network-access']]: { - leftIcon: 'fas fa-wifi', - label: t('permission_accessNetwork'), - rightIcon: null, - }, - ///: END:ONLY_INCLUDE_IN - [UNKNOWN_PERMISSION]: (permissionName) => { - return { - leftIcon: 'fas fa-times-circle', - label: t('permission_unknown', [permissionName ?? 'undefined']), - rightIcon: null, - }; - }, - }; - }, [t]); + const getPermissionDescription = usePermissionDescriptions(); return (
{Object.keys(permissions).map((permission) => { - const listValue = - PERMISSION_LIST_VALUES[ - getPermissionKey(permission, PERMISSION_LIST_VALUES) - ]; - - const { label, leftIcon, rightIcon } = - typeof listValue === 'function' ? listValue(permission) : listValue; + const { label, leftIcon, rightIcon } = getPermissionDescription( + permission, + ); return (
diff --git a/ui/hooks/usePermissionDescriptions.js b/ui/hooks/usePermissionDescriptions.js new file mode 100644 index 000000000..054f47bfe --- /dev/null +++ b/ui/hooks/usePermissionDescriptions.js @@ -0,0 +1,98 @@ +import { useMemo } from 'react'; +import { + RestrictedMethods, + ///: BEGIN:ONLY_INCLUDE_IN(flask) + EndowmentPermissions, + PermissionNamespaces, + ///: END:ONLY_INCLUDE_IN +} from '../../shared/constants/permissions'; +///: BEGIN:ONLY_INCLUDE_IN(flask) +import { coinTypeToProtocolName } from '../helpers/utils/util'; +///: END:ONLY_INCLUDE_IN +import { useI18nContext } from './useI18nContext'; + +const UNKNOWN_PERMISSION = Symbol('unknown'); + +/** + * @typedef {Object} PermissionLabelObject + * @property {string} label - The text label. + * @property {string} leftIcon - The left icon. + * @property {string} rightIcon - The right icon. + */ + +/** + * @returns {(permissionName:string) => PermissionLabelObject} + */ +export const usePermissionDescriptions = () => { + const t = useI18nContext(); + + return useMemo(() => { + const permissionDescriptions = { + [RestrictedMethods.eth_accounts]: { + leftIcon: 'fas fa-eye', + label: t('permission_ethereumAccounts'), + rightIcon: null, + }, + ///: BEGIN:ONLY_INCLUDE_IN(flask) + [RestrictedMethods.snap_confirm]: { + leftIcon: 'fas fa-user-check', + label: t('permission_customConfirmation'), + rightIcon: null, + }, + [RestrictedMethods['snap_getBip44Entropy_*']]: (permissionName) => { + const coinType = permissionName.split('_').slice(-1); + return { + leftIcon: 'fas fa-door-open', + label: t('permission_manageBip44Keys', [ + coinTypeToProtocolName(coinType) || + `${coinType} (Unrecognized protocol)`, + ]), + rightIcon: null, + }; + }, + [RestrictedMethods.snap_manageState]: { + leftIcon: 'fas fa-download', + label: t('permission_manageState'), + rightIcon: null, + }, + [RestrictedMethods['wallet_snap_*']]: (permissionName) => { + const snapId = permissionName.split('_').slice(-1); + return { + leftIcon: 'fas fa-bolt', + label: t('permission_accessSnap', [snapId]), + rightIcon: null, + }; + }, + [EndowmentPermissions['endowment:network-access']]: { + leftIcon: 'fas fa-wifi', + label: t('permission_accessNetwork'), + rightIcon: null, + }, + ///: END:ONLY_INCLUDE_IN + [UNKNOWN_PERMISSION]: (permissionName) => { + return { + leftIcon: 'fas fa-times-circle', + label: t('permission_unknown', [permissionName ?? 'undefined']), + rightIcon: null, + }; + }, + }; + + return (permissionName) => { + let value = permissionDescriptions[UNKNOWN_PERMISSION]; + + if (Object.hasOwnProperty.call(permissionDescriptions, permissionName)) { + value = permissionDescriptions[permissionName]; + } + ///: BEGIN:ONLY_INCLUDE_IN(flask) + for (const namespace of Object.keys(PermissionNamespaces)) { + if (permissionName.startsWith(namespace)) { + value = permissionDescriptions[PermissionNamespaces[namespace]]; + } + } + ///: END:ONLY_INCLUDE_IN + + return typeof value === 'function' ? value(permissionName) : value; + }; + }, [t]); +}; From d17d7f2d1839d19df350f24f5cf95f9444fd5eb7 Mon Sep 17 00:00:00 2001 From: Daniel <80175477+dan437@users.noreply.github.com> Date: Fri, 4 Mar 2022 21:20:18 +0100 Subject: [PATCH 18/19] Set up STX controller state (#13843) * persist stx controller state * Pass STX controller state as the 3rd param * Trigger Build Co-authored-by: Dan Miller --- app/scripts/metamask-controller.js | 40 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 7c9b935ee..c378114a1 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -835,24 +835,28 @@ export default class MetamaskController extends EventEmitter { this.gasFeeController, ), }); - this.smartTransactionsController = new SmartTransactionsController({ - onNetworkStateChange: this.networkController.store.subscribe.bind( - this.networkController.store, - ), - getNetwork: this.networkController.getNetworkState.bind( - this.networkController, - ), - getNonceLock: this.txController.nonceTracker.getNonceLock.bind( - this.txController.nonceTracker, - ), - confirmExternalTransaction: this.txController.confirmExternalTransaction.bind( - this.txController, - ), - provider: this.provider, - trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind( - this.metaMetricsController, - ), - }); + this.smartTransactionsController = new SmartTransactionsController( + { + onNetworkStateChange: this.networkController.store.subscribe.bind( + this.networkController.store, + ), + getNetwork: this.networkController.getNetworkState.bind( + this.networkController, + ), + getNonceLock: this.txController.nonceTracker.getNonceLock.bind( + this.txController.nonceTracker, + ), + confirmExternalTransaction: this.txController.confirmExternalTransaction.bind( + this.txController, + ), + provider: this.provider, + trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind( + this.metaMetricsController, + ), + }, + undefined, + initState.SmartTransactionsController, + ); // ensure accountTracker updates balances after network change this.networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, () => { From 58bdaf3c2a98daed60d4fe1b9b6e861fc3f5367c Mon Sep 17 00:00:00 2001 From: ryanml Date: Fri, 4 Mar 2022 18:50:14 -0700 Subject: [PATCH 19/19] Revert "Running yarn lavamoat:auto" This reverts commit 7af8570a4e3cfb68c58ad2d18006ae6917824c55. --- lavamoat/browserify/beta/policy.json | 3 +++ lavamoat/browserify/flask/policy.json | 3 +++ lavamoat/browserify/main/policy.json | 3 +++ 3 files changed, 9 insertions(+) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index fd9c5466a..41925f129 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -563,7 +563,10 @@ "ethereumjs-wallet": true, "ethers": true, "ethjs-unit": true, + "ethjs-util": true, "events": true, + "human-standard-collectible-abi": true, + "human-standard-token-abi": true, "immer": true, "isomorphic-fetch": true, "jsonschema": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index fc9b78a8e..f540236ba 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -563,7 +563,10 @@ "ethereumjs-wallet": true, "ethers": true, "ethjs-unit": true, + "ethjs-util": true, "events": true, + "human-standard-collectible-abi": true, + "human-standard-token-abi": true, "immer": true, "isomorphic-fetch": true, "jsonschema": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index fd9c5466a..41925f129 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -563,7 +563,10 @@ "ethereumjs-wallet": true, "ethers": true, "ethjs-unit": true, + "ethjs-util": true, "events": true, + "human-standard-collectible-abi": true, + "human-standard-token-abi": true, "immer": true, "isomorphic-fetch": true, "jsonschema": true,