From 7da6c66ea29896f1ced15bbd374f25ee8a10d339 Mon Sep 17 00:00:00 2001 From: Shane Date: Fri, 29 Apr 2022 06:05:14 -0700 Subject: [PATCH 001/127] Added getAccounts suppressUnauthorized param (#14126) * Added getAccounts suppressUnauthorized param * Changed getAccounts supresss unauth param name * Changed getAccounts param to object * Fixed default empty obj for getAccounts getPermittedAccounts param * Bump eth-json-rpc-middleware version to 8.0.2 * Fixed lavamoat policy * Fixed lavamoat policies * Fixed dedupe issues * Fixed lavamoat allowscripts * yarn deduplicate * Fixed lavamoat policies Co-authored-by: Elliot Winkler --- app/scripts/metamask-controller.js | 20 +- lavamoat/browserify/beta/policy.json | 22 +- lavamoat/browserify/flask/policy.json | 22 +- lavamoat/browserify/main/policy.json | 22 +- lavamoat/build-system/policy.json | 1444 +++++++++++++++++++------ package.json | 7 +- yarn.lock | 113 +- 7 files changed, 1215 insertions(+), 435 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 6baeb0601..8017579a6 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1239,12 +1239,17 @@ export default class MetamaskController extends EventEmitter { }, version, // account mgmt - getAccounts: async ({ origin }) => { + getAccounts: async ( + { origin }, + { suppressUnauthorizedError = true } = {}, + ) => { if (origin === ORIGIN_METAMASK) { const selectedAddress = this.preferencesController.getSelectedAddress(); return selectedAddress ? [selectedAddress] : []; } else if (this.isUnlocked()) { - return await this.getPermittedAccounts(origin); + return await this.getPermittedAccounts(origin, { + suppressUnauthorizedError, + }); } return []; // changing this is a breaking change }, @@ -2532,17 +2537,24 @@ export default class MetamaskController extends EventEmitter { * array if no accounts are permitted. * * @param {string} origin - The origin whose exposed accounts to retrieve. + * @param {boolean} [suppressUnauthorizedError] - Suppresses the unauthorized error. * @returns {Promise} The origin's permitted accounts, or an empty * array. */ - async getPermittedAccounts(origin) { + async getPermittedAccounts( + origin, + { suppressUnauthorizedError = true } = {}, + ) { try { return await this.permissionController.executeRestrictedMethod( origin, RestrictedMethods.eth_accounts, ); } catch (error) { - if (error.code === rpcErrorCodes.provider.unauthorized) { + if ( + suppressUnauthorizedError && + error.code === rpcErrorCodes.provider.unauthorized + ) { return []; } throw error; diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 2d82ff97e..4ee733a70 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -1210,10 +1210,8 @@ }, "blakejs": { "globals": { + "TextEncoder": true, "console.log": true - }, - "packages": { - "buffer": true } }, "blob": { @@ -2072,10 +2070,8 @@ "ethereum-cryptography": true, "ethjs-util": true, "is-buffer": true, - "keccak": true, "rlp": true, - "safe-buffer": true, - "secp256k1": true + "safe-buffer": true } }, "ethereumjs-wallet": { @@ -2404,8 +2400,8 @@ "hash-base": { "packages": { "inherits": true, - "safe-buffer": true, - "stream-browserify": true + "readable-stream": true, + "safe-buffer": true } }, "hash.js": { @@ -3082,10 +3078,7 @@ "keccak": { "packages": { "buffer": true, - "inherits": true, - "readable-stream": true, - "safe-buffer": true, - "stream-browserify": true + "readable-stream": true } }, "latency-monitor": { @@ -4015,7 +4008,10 @@ "pbkdf2": { "globals": { "crypto": true, - "process": true + "process": true, + "queueMicrotask": true, + "setImmediate": true, + "setTimeout": true }, "packages": { "create-hash": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 6783285f9..1339e34ac 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -1228,10 +1228,8 @@ }, "blakejs": { "globals": { + "TextEncoder": true, "console.log": true - }, - "packages": { - "buffer": true } }, "blob": { @@ -2090,10 +2088,8 @@ "ethereum-cryptography": true, "ethjs-util": true, "is-buffer": true, - "keccak": true, "rlp": true, - "safe-buffer": true, - "secp256k1": true + "safe-buffer": true } }, "ethereumjs-wallet": { @@ -2422,8 +2418,8 @@ "hash-base": { "packages": { "inherits": true, - "safe-buffer": true, - "stream-browserify": true + "readable-stream": true, + "safe-buffer": true } }, "hash.js": { @@ -3100,10 +3096,7 @@ "keccak": { "packages": { "buffer": true, - "inherits": true, - "readable-stream": true, - "safe-buffer": true, - "stream-browserify": true + "readable-stream": true } }, "latency-monitor": { @@ -4033,7 +4026,10 @@ "pbkdf2": { "globals": { "crypto": true, - "process": true + "process": true, + "queueMicrotask": true, + "setImmediate": true, + "setTimeout": true }, "packages": { "create-hash": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 2d82ff97e..4ee733a70 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -1210,10 +1210,8 @@ }, "blakejs": { "globals": { + "TextEncoder": true, "console.log": true - }, - "packages": { - "buffer": true } }, "blob": { @@ -2072,10 +2070,8 @@ "ethereum-cryptography": true, "ethjs-util": true, "is-buffer": true, - "keccak": true, "rlp": true, - "safe-buffer": true, - "secp256k1": true + "safe-buffer": true } }, "ethereumjs-wallet": { @@ -2404,8 +2400,8 @@ "hash-base": { "packages": { "inherits": true, - "safe-buffer": true, - "stream-browserify": true + "readable-stream": true, + "safe-buffer": true } }, "hash.js": { @@ -3082,10 +3078,7 @@ "keccak": { "packages": { "buffer": true, - "inherits": true, - "readable-stream": true, - "safe-buffer": true, - "stream-browserify": true + "readable-stream": true } }, "latency-monitor": { @@ -4015,7 +4008,10 @@ "pbkdf2": { "globals": { "crypto": true, - "process": true + "process": true, + "queueMicrotask": true, + "setImmediate": true, + "setTimeout": true }, "packages": { "create-hash": true, diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index 9f67e9700..2be46568a 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -1676,12 +1676,7 @@ }, "browserify>string_decoder": { "packages": { - "browserify>string_decoder>safe-buffer": true - } - }, - "browserify>string_decoder>safe-buffer": { - "builtin": { - "buffer": true + "ethereumjs-wallet>safe-buffer": true } }, "browserify>syntax-error": { @@ -4137,6 +4132,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, @@ -4285,562 +4281,1329 @@ "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>plugin-error": { - "builtin": { - "util.inherits": true - }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width>is-fullwidth-code-point": { "packages": { - "gulp-watch>ansi-colors": true, - "gulp-watch>plugin-error>arr-union": true, - "gulp-watch>plugin-error>extend-shallow": true, - "webpack>micromatch>arr-diff": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width>is-fullwidth-code-point>number-is-nan": true } }, - "gulp-watch>plugin-error>extend-shallow": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>strip-ansi": { "packages": { - "gulp-watch>plugin-error>extend-shallow>is-extendable": true, - "webpack>micromatch>extend-shallow>assign-symbols": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>strip-ansi>ansi-regex": true } }, - "gulp-watch>plugin-error>extend-shallow>is-extendable": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>wide-align": { "packages": { - "gulp>gulp-cli>liftoff>is-plain-object": true + "gulp-watch>chokidar>fsevents>node-pre-gyp>npmlog>gauge>string-width": true } }, - "gulp-watch>vinyl-file": { + "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": { - "path.resolve": true + "assert": true, + "fs": true, + "path.join": true }, "globals": { - "process.cwd": true + "process.platform": true, + "setTimeout": 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>chokidar>fsevents>node-pre-gyp>rimraf>glob": true } }, - "gulp-watch>vinyl-file>strip-bom": { - "globals": { - "Buffer.isBuffer": true - }, - "packages": { + "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": { + "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>plugin-error": { + "builtin": { + "util.inherits": true + }, + "packages": { + "gulp-watch>ansi-colors": true, + "gulp-watch>plugin-error>arr-union": true, + "gulp-watch>plugin-error>extend-shallow": true, + "webpack>micromatch>arr-diff": true + } + }, + "gulp-watch>plugin-error>extend-shallow": { + "packages": { + "gulp-watch>plugin-error>extend-shallow>is-extendable": true, + "webpack>micromatch>extend-shallow>assign-symbols": true + } + }, + "gulp-watch>plugin-error>extend-shallow>is-extendable": { + "packages": { + "gulp>gulp-cli>liftoff>is-plain-object": 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": 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": { + "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": { + "stream.PassThrough": true + }, + "globals": { + "Buffer.concat": true + } + }, + "gulp-zip>plugin-error": { + "builtin": { + "util.inherits": true + }, + "packages": { + "gulp-zip>plugin-error>ansi-cyan": true, + "gulp-zip>plugin-error>ansi-red": true, + "gulp-zip>plugin-error>arr-diff": true, + "gulp-zip>plugin-error>arr-union": true, + "gulp-zip>plugin-error>extend-shallow": true + } + }, + "gulp-zip>plugin-error>ansi-cyan": { + "packages": { + "fancy-log>ansi-gray>ansi-wrap": true + } + }, + "gulp-zip>plugin-error>ansi-red": { + "packages": { + "fancy-log>ansi-gray>ansi-wrap": true + } + }, + "gulp-zip>plugin-error>arr-diff": { + "packages": { + "gulp-zip>plugin-error>arr-diff>array-slice": true, + "gulp>undertaker>arr-flatten": true + } + }, + "gulp-zip>plugin-error>extend-shallow": { + "packages": { + "gulp-zip>plugin-error>extend-shallow>kind-of": true + } + }, + "gulp-zip>plugin-error>extend-shallow>kind-of": { + "globals": { + "Buffer": true + } + }, + "gulp-zip>through2": { + "builtin": { + "util.inherits": true + }, + "globals": { + "process.nextTick": true + }, + "packages": { + "readable-stream": true, + "watchify>xtend": true } }, - "gulp-watch>vinyl-file>strip-bom-stream>first-chunk-stream": { + "gulp-zip>yazl": { "builtin": { - "util.inherits": true + "events.EventEmitter": true, + "fs.createReadStream": true, + "fs.stat": true, + "stream.PassThrough": true, + "stream.Transform": true, + "util.inherits": true, + "zlib.DeflateRaw": true, + "zlib.deflateRaw": true }, "globals": { - "Buffer.concat": true, - "setImmediate": true + "Buffer": true, + "setImmediate": true, + "utf8FileName.length": true }, "packages": { - "readable-stream": true + "gulp-zip>yazl>buffer-crc32": true } }, - "gulp-watch>vinyl-file>vinyl": { + "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": { - "buffer.Buffer": true, "path.basename": true, - "path.dirname": true, - "path.extname": true, - "path.join": true, - "path.relative": true, - "stream.PassThrough": true, - "stream.Stream": true + "path.sep": true, + "util.inspect": true }, "globals": { - "process.cwd": true + "process.platform": 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 + "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": { + "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": { + "domain.create": true + }, "globals": { - "Buffer": true + "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>clone-stats": { + "gulp>glob-watcher>async-done>stream-exhaust": { "builtin": { - "fs.Stats": true + "stream.Writable": true, + "util.inherits": true + }, + "globals": { + "setImmediate": true } }, - "gulp-watch>vinyl-file>vinyl>replace-ext": { + "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": { - "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": { - "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": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp": true } }, - "gulp-zip>plugin-error": { + "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-zip>plugin-error>ansi-cyan": true, - "gulp-zip>plugin-error>ansi-red": true, - "gulp-zip>plugin-error>arr-diff": true, - "gulp-zip>plugin-error>arr-union": true, - "gulp-zip>plugin-error>extend-shallow": true + "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-zip>plugin-error>ansi-cyan": { + "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": { - "fancy-log>ansi-gray>ansi-wrap": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt>abbrev": true, + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt>osenv": true } }, - "gulp-zip>plugin-error>ansi-red": { + "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": { - "fancy-log>ansi-gray>ansi-wrap": true + "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>arr-diff": { - "packages": { - "gulp-zip>plugin-error>arr-diff>array-slice": true, - "gulp>undertaker>arr-flatten": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-homedir": { + "builtin": { + "os.homedir": true + }, + "globals": { + "process.env": true, + "process.getuid": true, + "process.platform": true } }, - "gulp-zip>plugin-error>extend-shallow": { - "packages": { - "gulp-zip>plugin-error>extend-shallow>kind-of": 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>kind-of": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog": { + "builtin": { + "events.EventEmitter": true, + "util": true + }, "globals": { - "Buffer": true + "process.nextTick": true, + "process.stderr": true + }, + "packages": { + "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": { - "readable-stream": true, - "watchify>xtend": 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>yazl": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream": { "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 + "stream": true, + "util": true }, "globals": { - "Buffer": true, - "setImmediate": true, - "utf8FileName.length": true + "process.browser": true, + "process.env.READABLE_STREAM": true, + "process.stderr": true, + "process.stdout": true, + "process.version.slice": true, + "setImmediate": true }, "packages": { - "gulp-zip>yazl>buffer-crc32": 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>buffer-crc32": { - "builtin": { - "buffer.Buffer": true + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>core-util-is": { + "globals": { + "Buffer.isBuffer": true } }, - "gulp>glob-watcher": { + "gulp>glob-watcher>chokidar>fsevents>node-pre-gyp>npmlog>are-we-there-yet>readable-stream>process-nextick-args": { + "globals": { + "process": true + } + }, + "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": { @@ -6021,6 +6784,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 } @@ -6043,6 +6807,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 0c6be9912..fb6b965e0 100644 --- a/package.json +++ b/package.json @@ -436,9 +436,14 @@ "ganache>leveldown": false, "ganache>secp256k1": false, "ganache>utf-8-validate": false, + "ethereumjs-util>ethereum-cryptography>secp256k1": false, "gulp-watch>chokidar>fsevents": false, "gulp>glob-watcher>chokidar>fsevents": false, - "webpack>watchpack>watchpack-chokidar2>chokidar>fsevents": false + "webpack>watchpack>watchpack-chokidar2>chokidar>fsevents": false, + "@keystonehq/bc-ur-registry-eth>hdkey>secp256k1": false, + "@metamask/rpc-methods>@metamask/key-tree>secp256k1": false, + "eth-lattice-keyring>gridplus-sdk>secp256k1": false, + "eth-lattice-keyring>secp256k1": false } } } diff --git a/yarn.lock b/yarn.lock index b80a6a246..8f6dd5dd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4616,10 +4616,10 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@>=13.7.0", "@types/node@^16.7.10": - version "16.11.19" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.19.tgz#1afa165146997b8286b6eabcb1c2d50729055169" - integrity sha512-BPAcfDPoHlRQNKktbsbnpACGdypPFBuX4xQlsWDE7B8XXcfII+SpOLay3/qZmCLb39kV5S1RTYwXdkx2lwLYng== +"@types/node@*", "@types/node@>=13.7.0": + version "17.0.29" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.29.tgz#7f2e1159231d4a077bb660edab0fde373e375a3d" + integrity sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA== "@types/node@10.12.18": version "10.12.18" @@ -4641,6 +4641,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.27.tgz#5054610d37bb5f6e21342d0e6d24c494231f3b85" integrity sha512-94+Ahf9IcaDuJTle/2b+wzvjmutxXAEXU6O81JHblYXUg2BDG+dnBy7VxIPHKAyEEDHzCMQydTJuWvrE+Aanzw== +"@types/node@^16.7.10": + version "16.11.19" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.19.tgz#1afa165146997b8286b6eabcb1c2d50729055169" + integrity sha512-BPAcfDPoHlRQNKktbsbnpACGdypPFBuX4xQlsWDE7B8XXcfII+SpOLay3/qZmCLb39kV5S1RTYwXdkx2lwLYng== + "@types/node@^8.10.11": version "8.10.48" resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.48.tgz#e385073561643a9ba6199a1985ffc03530f90781" @@ -4742,9 +4747,9 @@ redux "*" "@types/secp256k1@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.1.tgz#fb3aa61a1848ad97d7425ff9dcba784549fca5a4" - integrity sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog== + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" + integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== dependencies: "@types/node" "*" @@ -6731,7 +6736,7 @@ binaryen@77.0.0-nightly.20190407: resolved "https://registry.yarnpkg.com/binaryen/-/binaryen-77.0.0-nightly.20190407.tgz#fbe4f8ba0d6bd0809a84eb519d2d5b5ddff3a7d1" integrity sha512-1mxYNvQ0xywMe582K7V6Vo2zzhZZxMTeGHH8aE/+/AND8f64D8Q1GThVY3RVRwGY/4p+p95ccw9Xbw2ovFXRIg== -bindings@^1.2.1, bindings@^1.3.0, bindings@^1.5.0: +bindings@^1.3.0, bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== @@ -6855,9 +6860,9 @@ blake-hash@^2.0.0: readable-stream "^3.6.0" blakejs@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" - integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= + version "1.2.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== blob@0.0.5: version "0.0.5" @@ -11217,9 +11222,9 @@ eth-json-rpc-middleware@^6.0.0: safe-event-emitter "^1.0.1" eth-json-rpc-middleware@^8.0.0: - version "8.0.1" - resolved "https://registry.yarnpkg.com/eth-json-rpc-middleware/-/eth-json-rpc-middleware-8.0.1.tgz#b3761620d3e5dda3f5bed3fd953dc326c7dcee44" - integrity sha512-Ar/Sp1J9H0RT3TmzVBr//UW3Lf4TowUJMyu9bqffKV0iLdFwbE6k07NxchPEzO8D918uS2LdyIyZh4v6avGHwA== + version "8.0.2" + resolved "https://registry.yarnpkg.com/eth-json-rpc-middleware/-/eth-json-rpc-middleware-8.0.2.tgz#7ce0b44443b8733c271ad64843a39d1782350fcb" + integrity sha512-aUx+Nf43pFAHnSQq1MqDETc6Bq0fIKpIen9oC3y4DLle4rsrSInx1Gxdde2/VZ1tlNcmN4M82ucbSMxR8bMqsg== dependencies: "@metamask/safe-event-emitter" "^2.0.0" btoa "^1.2.1" @@ -11228,7 +11233,7 @@ eth-json-rpc-middleware@^8.0.0: eth-sig-util "^1.4.2" json-rpc-engine "^6.1.0" json-stable-stringify "^1.0.1" - node-fetch "^2.6.1" + node-fetch "^2.6.7" pify "^3.0.0" eth-keyring-controller@^6.2.0, eth-keyring-controller@^6.2.1: @@ -11412,8 +11417,8 @@ ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.4, ethereumjs-abi@^0.6.8: ethereumjs-util "^6.0.0" "ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": - version "0.6.7" - resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#8431eab7b3384e65e8126a4602520b78031666fb" + version "0.6.8" + resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#ee3994657fa7a427238e6ba92a84d0b529bbcde0" dependencies: bn.js "^4.11.8" ethereumjs-util "^6.0.0" @@ -11471,17 +11476,17 @@ ethereumjs-tx@^2.1.1: ethereumjs-util "^6.0.0" ethereumjs-util@^5.0.0, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereumjs-util@^5.1.5, ethereumjs-util@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz#3e0c0d1741471acf1036052d048623dee54ad642" - integrity sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA== + version "5.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz#a833f0e5fca7e5b361384dc76301a721f537bf65" + integrity sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ== dependencies: bn.js "^4.11.0" create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" ethjs-util "^0.1.3" - keccak "^1.0.2" rlp "^2.0.0" safe-buffer "^5.1.1" - secp256k1 "^3.0.1" ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: version "6.2.1" @@ -12259,9 +12264,9 @@ fast-redact@^1.4.4: integrity sha512-Afo61CgUjkzdvOKDHn08qnZ0kwck38AOGcMlvSGzvJbIab6soAP5rdoQayecGCDsD69AiF9vJBXyq31eoEO2tQ== fast-safe-stringify@^2.0.6, fast-safe-stringify@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" - integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== + version "2.1.1" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" + integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== fast-url-parser@1.1.3: version "1.1.3" @@ -13979,12 +13984,13 @@ has@^1.0.0, has@^1.0.1, has@^1.0.3: function-bind "^1.1.1" hash-base@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" hash-sum@^2.0.0: version "2.0.0" @@ -17055,16 +17061,6 @@ keccak@3.0.1: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" -keccak@^1.0.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-1.4.0.tgz#572f8a6dbee8e7b3aa421550f9e6408ca2186f80" - integrity sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw== - dependencies: - bindings "^1.2.1" - inherits "^2.0.3" - nan "^2.2.1" - safe-buffer "^5.1.0" - keccak@^3.0.0, keccak@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" @@ -19607,10 +19603,10 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= -nan@^2.11.1, nan@^2.12.1, nan@^2.13.2, nan@^2.14.0, nan@^2.2.1: - version "2.14.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" - integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== +nan@^2.11.1, nan@^2.12.1, nan@^2.13.2, nan@^2.14.0: + version "2.15.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" + integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== nanoid@^2.0.0, nanoid@^2.1.6: version "2.1.11" @@ -19825,7 +19821,7 @@ node-fetch@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: +node-fetch@2.6.7, node-fetch@^2.3.0, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7, node-fetch@~2.6.1: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -21328,9 +21324,9 @@ pause-stream@0.0.11: through "~2.3" pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.0.9: - version "3.1.1" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.1.tgz#cb8724b0fada984596856d1a6ebafd3584654b94" - integrity sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg== + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== dependencies: create-hash "^1.1.2" create-hmac "^1.1.4" @@ -24299,7 +24295,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1, safe-buffer@~5.1.2: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.1: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -24493,7 +24489,7 @@ scss-parser@^1.0.4: dependencies: invariant "2.2.4" -secp256k1@4.0.2, secp256k1@^4.0.0, secp256k1@^4.0.1, secp256k1@^4.0.2: +secp256k1@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== @@ -24516,6 +24512,15 @@ secp256k1@^3.0.1, secp256k1@^3.6.1, secp256k1@^3.6.2: nan "^2.14.0" safe-buffer "^5.1.2" +secp256k1@^4.0.0, secp256k1@^4.0.1, secp256k1@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" + integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== + dependencies: + elliptic "^6.5.4" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + select@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/select/-/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d" @@ -25662,11 +25667,11 @@ string_decoder@0.10, string_decoder@~0.10.x: integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= string_decoder@^1.0.0, string_decoder@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" - integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== dependencies: - safe-buffer "~5.1.0" + safe-buffer "~5.2.0" string_decoder@~1.0.3: version "1.0.3" From 12a088e638759b709b475a723157622f946de063 Mon Sep 17 00:00:00 2001 From: Alex Donesky Date: Fri, 29 Apr 2022 09:21:06 -0500 Subject: [PATCH 002/127] Fix browser.tab.get call (#14550) * update to expect promise from browser api polyfill rather than pass callback --- .../end-of-flow/end-of-flow.component.js | 4 +- .../onboarding-initiator-util.js | 50 ++++--------------- .../reveal-seed-phrase.component.js | 4 +- 3 files changed, 14 insertions(+), 44 deletions(-) diff --git a/ui/pages/first-time-flow/end-of-flow/end-of-flow.component.js b/ui/pages/first-time-flow/end-of-flow/end-of-flow.component.js index ef3a32edf..11a95ccdf 100644 --- a/ui/pages/first-time-flow/end-of-flow/end-of-flow.component.js +++ b/ui/pages/first-time-flow/end-of-flow/end-of-flow.component.js @@ -5,7 +5,7 @@ import Snackbar from '../../../components/ui/snackbar'; import MetaFoxLogo from '../../../components/ui/metafox-logo'; import { SUPPORT_REQUEST_LINK } from '../../../helpers/constants/common'; import { DEFAULT_ROUTE } from '../../../helpers/constants/routes'; -import { returnToOnboardingInitiator } from '../onboarding-initiator-util'; +import { returnToOnboardingInitiatorTab } from '../onboarding-initiator-util'; import { EVENT } from '../../../../shared/constants/metametrics'; export default class EndOfFlowScreen extends PureComponent { @@ -51,7 +51,7 @@ export default class EndOfFlowScreen extends PureComponent { this._removeBeforeUnload(); await this._onOnboardingComplete(); if (onboardingInitiator) { - await returnToOnboardingInitiator(onboardingInitiator); + await returnToOnboardingInitiatorTab(onboardingInitiator); } history.push(DEFAULT_ROUTE); }; diff --git a/ui/pages/first-time-flow/onboarding-initiator-util.js b/ui/pages/first-time-flow/onboarding-initiator-util.js index 98dc98f89..33893a90d 100644 --- a/ui/pages/first-time-flow/onboarding-initiator-util.js +++ b/ui/pages/first-time-flow/onboarding-initiator-util.js @@ -1,25 +1,17 @@ import browser from 'webextension-polyfill'; import log from 'loglevel'; -const returnToOnboardingInitiatorTab = async (onboardingInitiator) => { - const tab = await new Promise((resolve) => { - browser.tabs.update( - onboardingInitiator.tabId, - { active: true }, - // eslint-disable-next-line no-shadow - (tab) => { - if (tab) { - resolve(tab); - } else { - // silence console message about unchecked error - if (browser.runtime.lastError) { - log.debug(browser.runtime.lastError); - } - resolve(); - } - }, +export const returnToOnboardingInitiatorTab = async (onboardingInitiator) => { + let tab; + try { + tab = await browser.tabs.update(onboardingInitiator.id, { + active: true, + }); + } catch (error) { + log.debug( + `An error occurred while updating tabs in returnToOnboardingInitiatorTab: ${error.message}`, ); - }); + } if (tab) { window.close(); @@ -28,29 +20,7 @@ const returnToOnboardingInitiatorTab = async (onboardingInitiator) => { log.warn( `Setting current tab to onboarding initiator has failed; falling back to redirect`, ); - window.location.assign(onboardingInitiator.location); - } -}; -export const returnToOnboardingInitiator = async (onboardingInitiator) => { - const tab = await new Promise((resolve) => { - // eslint-disable-next-line no-shadow - browser.tabs.get(onboardingInitiator.tabId, (tab) => { - if (tab) { - resolve(tab); - } else { - // silence console message about unchecked error - if (browser.runtime.lastError) { - log.debug(browser.runtime.lastError); - } - resolve(); - } - }); - }); - - if (tab) { - await returnToOnboardingInitiatorTab(onboardingInitiator); - } else { window.location.assign(onboardingInitiator.location); } }; diff --git a/ui/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js b/ui/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js index 24d0682ec..af02b4761 100644 --- a/ui/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js +++ b/ui/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.component.js @@ -12,7 +12,7 @@ import { } from '../../../../helpers/constants/routes'; import { exportAsFile } from '../../../../helpers/utils/util'; import { EVENT } from '../../../../../shared/constants/metametrics'; -import { returnToOnboardingInitiator } from '../../onboarding-initiator-util'; +import { returnToOnboardingInitiatorTab } from '../../onboarding-initiator-util'; export default class RevealSeedPhrase extends PureComponent { static contextTypes = { @@ -79,7 +79,7 @@ export default class RevealSeedPhrase extends PureComponent { await Promise.all([setCompletedOnboarding(), setSeedPhraseBackedUp(false)]); if (onboardingInitiator) { - await returnToOnboardingInitiator(onboardingInitiator); + await returnToOnboardingInitiatorTab(onboardingInitiator); } history.replace(DEFAULT_ROUTE); }; From 54a89f029e1286ee36ba04225ba75ea9f496af6a Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Fri, 29 Apr 2022 12:41:35 -0500 Subject: [PATCH 003/127] 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 fb6b965e0..b715b0cf1 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 8f6dd5dd2..eed444ae4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8918,23 +8918,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== @@ -19816,11 +19800,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.7, node-fetch@~2.6.1: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" @@ -27950,11 +27929,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 73a7ce9e39b9b681935bb72614b03255dd501dcc Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Fri, 29 Apr 2022 15:56:30 -0700 Subject: [PATCH 004/127] Add applyLavaMoat build flag (#14583) Adds a new flag, `--apply-lavamoat`, to the main build script. The flag controls whether LavaMoat is actually applied to the output of the build process. The flag defaults to `true`, but we explicitly set it to `false` in the `start` package script. Meanwhile, the `start:lavamoat` script is modified such that it applies LavaMoat to the build output in development mode, but it no longer runs the build process itself under LavaMoat as there aren't very compelling reasons to do so. This change is motivated by the fact that development builds do not have their own dedicated LavaMoat policies, which causes development builds to fail since #14537. The downside of this change is that LavaMoat-related failures will not be detected when running `yarn start`. @kumavis has plans for fixing this problem in a future major version of the `@lavamoat` suite. --- app/background.html | 2 +- app/home.html | 2 +- app/notification.html | 2 +- app/popup.html | 2 +- development/build/index.js | 8 ++++++++ development/build/scripts.js | 21 ++++++++++++--------- package.json | 6 +++--- 7 files changed, 27 insertions(+), 16 deletions(-) diff --git a/app/background.html b/app/background.html index 447efa60e..6a0150579 100644 --- a/app/background.html +++ b/app/background.html @@ -6,7 +6,7 @@ - {{@if(it.useLavamoat)}} + {{@if(it.applyLavaMoat)}} diff --git a/app/home.html b/app/home.html index d44eb6663..97334c73c 100644 --- a/app/home.html +++ b/app/home.html @@ -12,7 +12,7 @@
- {{@if(it.useLavamoat)}} + {{@if(it.applyLavaMoat)}} diff --git a/app/notification.html b/app/notification.html index 1002a37ef..1f348f680 100644 --- a/app/notification.html +++ b/app/notification.html @@ -35,7 +35,7 @@
- {{@if(it.useLavamoat)}} + {{@if(it.applyLavaMoat)}} diff --git a/app/popup.html b/app/popup.html index e24978ad7..90117fc79 100644 --- a/app/popup.html +++ b/app/popup.html @@ -12,7 +12,7 @@
- {{@if(it.useLavamoat)}} + {{@if(it.applyLavaMoat)}} diff --git a/development/build/index.js b/development/build/index.js index 7e88bcfb2..fd6dd1b76 100755 --- a/development/build/index.js +++ b/development/build/index.js @@ -57,6 +57,7 @@ defineAndRunBuildTasks(); function defineAndRunBuildTasks() { const { + applyLavaMoat, buildType, entryTask, isLavaMoat, @@ -89,6 +90,7 @@ function defineAndRunBuildTasks() { const styleTasks = createStyleTasks({ livereload }); const scriptTasks = createScriptTasks({ + applyLavaMoat, browserPlatforms, buildType, ignoredFiles, @@ -170,6 +172,7 @@ function defineAndRunBuildTasks() { function parseArgv() { const NamedArgs = { + ApplyLavaMoat: 'apply-lavamoat', BuildType: 'build-type', BuildVersion: 'build-version', LintFenceFiles: 'lint-fence-files', @@ -180,6 +183,7 @@ function parseArgv() { const argv = minimist(process.argv.slice(2), { boolean: [ + NamedArgs.ApplyLavaMoat, NamedArgs.LintFenceFiles, NamedArgs.Lockdown, NamedArgs.PolicyOnly, @@ -187,6 +191,7 @@ function parseArgv() { ], string: [NamedArgs.BuildType, NamedArgs.BuildVersion], default: { + [NamedArgs.ApplyLavaMoat]: true, [NamedArgs.BuildType]: BuildType.main, [NamedArgs.BuildVersion]: '0', [NamedArgs.LintFenceFiles]: true, @@ -232,8 +237,11 @@ function parseArgv() { const version = getVersion(buildType, buildVersion); return { + // Should we apply LavaMoat to the build output? + applyLavaMoat: argv[NamedArgs.ApplyLavaMoat], buildType, entryTask, + // Is this process running in lavamoat-node? isLavaMoat: process.argv[0].includes('lavamoat'), policyOnly, shouldIncludeLockdown: argv[NamedArgs.Lockdown], diff --git a/development/build/scripts.js b/development/build/scripts.js index f6dc542c4..e1a3a0551 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -140,6 +140,7 @@ const noopWriteStream = through.obj((_file, _fileEncoding, callback) => module.exports = createScriptTasks; function createScriptTasks({ + applyLavaMoat, browserPlatforms, buildType, ignoredFiles, @@ -180,6 +181,7 @@ function createScriptTasks({ const standardSubtask = createTask( `${taskPrefix}:standardEntryPoints`, createFactoredBuild({ + applyLavaMoat, browserPlatforms, buildType, devMode, @@ -343,6 +345,7 @@ function createScriptTasks({ } function createFactoredBuild({ + applyLavaMoat, browserPlatforms, buildType, devMode, @@ -473,21 +476,21 @@ function createFactoredBuild({ groupSet, commonSet, browserPlatforms, - useLavamoat: true, + applyLavaMoat, }); renderHtmlFile({ htmlName: 'notification', groupSet, commonSet, browserPlatforms, - useLavamoat: true, + applyLavaMoat, }); renderHtmlFile({ htmlName: 'home', groupSet, commonSet, browserPlatforms, - useLavamoat: true, + applyLavaMoat, }); break; } @@ -497,7 +500,7 @@ function createFactoredBuild({ groupSet, commonSet, browserPlatforms, - useLavamoat: true, + applyLavaMoat, }); break; } @@ -507,7 +510,7 @@ function createFactoredBuild({ groupSet, commonSet, browserPlatforms, - useLavamoat: false, + applyLavaMoat: false, }); break; } @@ -858,11 +861,11 @@ function renderHtmlFile({ groupSet, commonSet, browserPlatforms, - useLavamoat, + applyLavaMoat, }) { - if (useLavamoat === undefined) { + if (applyLavaMoat === undefined) { throw new Error( - 'build/scripts/renderHtmlFile - must specify "useLavamoat" option', + 'build/scripts/renderHtmlFile - must specify "applyLavaMoat" option', ); } const htmlFilePath = `./app/${htmlName}.html`; @@ -870,7 +873,7 @@ function renderHtmlFile({ const jsBundles = [...commonSet.values(), ...groupSet.values()].map( (label) => `./${label}.js`, ); - const htmlOutput = Sqrl.render(htmlTemplate, { jsBundles, useLavamoat }); + const htmlOutput = Sqrl.render(htmlTemplate, { jsBundles, applyLavaMoat }); browserPlatforms.forEach((platform) => { const dest = `./dist/${platform}/${htmlName}.html`; // we dont have a way of creating async events atm diff --git a/package.json b/package.json index b715b0cf1..761761f13 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,11 @@ "scripts": { "setup": "yarn install && yarn setup:postinstall", "setup:postinstall": "yarn patch-package && yarn allow-scripts", - "start": "yarn build:dev dev", - "start:lavamoat": "yarn build dev", + "start": "yarn build:dev --apply-lavamoat=false", + "start:lavamoat": "yarn build:dev --apply-lavamoat=true", "dist": "yarn build prod", "build": "yarn lavamoat:build", - "build:dev": "node development/build/index.js", + "build:dev": "node development/build/index.js dev", "start:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' yarn build testDev", "benchmark:chrome": "SELENIUM_BROWSER=chrome node test/e2e/benchmark.js", "benchmark:firefox": "SELENIUM_BROWSER=firefox node test/e2e/benchmark.js", From a7469979b4e041f634ca727405be970bacefbc56 Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 29 Apr 2022 12:56:58 -1000 Subject: [PATCH 005/127] Patch gridplus-sdk for perf fix (#14582) short-term fix for https://github.com/GridPlus/gridplus-sdk/pull/367 --- patches/gridplus-sdk+1.1.6.patch | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 patches/gridplus-sdk+1.1.6.patch diff --git a/patches/gridplus-sdk+1.1.6.patch b/patches/gridplus-sdk+1.1.6.patch new file mode 100644 index 000000000..4e0a2f325 --- /dev/null +++ b/patches/gridplus-sdk+1.1.6.patch @@ -0,0 +1,27 @@ +patch from https://github.com/GridPlus/gridplus-sdk/pull/367 +diff --git a/node_modules/gridplus-sdk/dist/util.js b/node_modules/gridplus-sdk/dist/util.js +index 08cc920..1f58806 100644 +--- a/node_modules/gridplus-sdk/dist/util.js ++++ b/node_modules/gridplus-sdk/dist/util.js +@@ -22,7 +22,7 @@ var elliptic_1 = __importDefault(require("elliptic")); + var constants_1 = require("./constants"); + var COINS = constants_1.BIP_CONSTANTS.COINS, PURPOSES = constants_1.BIP_CONSTANTS.PURPOSES; + var EC = elliptic_1.default.ec; +-var ec = new EC('p256'); ++var ec; + //-------------------------------------------------- + // LATTICE UTILS + //-------------------------------------------------- +@@ -219,10 +219,12 @@ var parseDER = function (sigBuf) { + }; + exports.parseDER = parseDER; + var getP256KeyPair = function (priv) { ++ if (ec === undefined) ec = new EC('p256'); + return ec.keyFromPrivate(priv, 'hex'); + }; + exports.getP256KeyPair = getP256KeyPair; + var getP256KeyPairFromPub = function (pub) { ++ if (ec === undefined) ec = new EC('p256'); + return ec.keyFromPublic(pub, 'hex'); + }; + exports.getP256KeyPairFromPub = getP256KeyPairFromPub; From 8223aecabfdd8903b9bfed257b59e5f45f0589a3 Mon Sep 17 00:00:00 2001 From: hilvmason <95925065+hilvmason@users.noreply.github.com> Date: Mon, 2 May 2022 13:36:29 -0400 Subject: [PATCH 006/127] Update PULL_REQUEST_TEMPLATE.md (#14547) --- .github/PULL_REQUEST_TEMPLATE.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index da7708be2..f15418ea6 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -15,7 +15,7 @@ This is a problem because ... In order to solve this problem, this pull request ... --> -## More information +## More Information -## Manual testing steps +## Manual Testing Steps + +## Pre-Merge Checklist + +- [ ] PR template is filled out +- [ ] Manual testing complete & passed +- [ ] **IF** this PR fixes a bug, a test that _would have_ caught the bug has been added +- [ ] PR is linked to the appropriate GitHub issue +- [ ] **IF** QA attention is required, "QA Board" label has been applied +- [ ] PR has been added to the appropriate release Milestone From 3b3a6806823b24a973fb4cfdf30483ae91a53663 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Mon, 2 May 2022 23:49:01 +0200 Subject: [PATCH 007/127] 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 dbc1ec138..a5219dbdb 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 a56181e03..02a64bdbf 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 4c35bee3b..c9673daff 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 6915dd1a571ecc478b8ef95ac921deb9cb07b381 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Mon, 2 May 2022 15:35:52 -0700 Subject: [PATCH 008/127] Fix development build scripts (#14594) #14583 broke the development build scripts (e.g. `yarn start`) by adding a positional argument to a package script (`build:dev`) that is used and passed positional arguments in the build script itself. This PR removes the positional argument from the `build:dev` script and `yarn start` now works again. In addition, the `--apply-lavamoat` flag is properly forwarded to child processes, which was not the case in the original implementation. To test, `yarn start` should work and LavaMoat should _not_ be applied, in distinction to `yarn build:dev dev --apply-lavamoat=true`. Whether LavaMoat is applied can be determined by checking whether `Object.isFrozen(Object.prototype)` is `true` (with LavaMoat) or `false` (without LavaMoat). --- development/build/scripts.js | 1 + development/build/task.js | 57 ++++++++++++------------------------ package.json | 6 ++-- 3 files changed, 22 insertions(+), 42 deletions(-) diff --git a/development/build/scripts.js b/development/build/scripts.js index e1a3a0551..fd73a62af 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -248,6 +248,7 @@ function createScriptTasks({ phishingDetectSubtask, ].map((subtask) => runInChildProcess(subtask, { + applyLavaMoat, buildType, isLavaMoat, policyOnly, diff --git a/development/build/task.js b/development/build/task.js index 316020259..26df8bf85 100644 --- a/development/build/task.js +++ b/development/build/task.js @@ -50,7 +50,7 @@ function createTask(taskName, taskFn) { function runInChildProcess( task, - { buildType, isLavaMoat, policyOnly, shouldLintFenceFiles }, + { applyLavaMoat, buildType, isLavaMoat, policyOnly, shouldLintFenceFiles }, ) { const taskName = typeof task === 'string' ? task : task.taskName; if (!taskName) { @@ -60,44 +60,23 @@ function runInChildProcess( } return instrumentForTaskStats(taskName, async () => { - let childProcess; - // Use the same build type for subprocesses, and only run them in LavaMoat - // if the parent process also ran in LavaMoat. - if (isLavaMoat) { - childProcess = spawn( - 'yarn', - [ - 'build', - taskName, - '--build-type', - buildType, - '--lint-fence-files', - shouldLintFenceFiles, - '--skip-stats', - ...(policyOnly ? ['--policy-only'] : []), - ], - { - env: process.env, - }, - ); - } else { - childProcess = spawn( - 'yarn', - [ - 'build:dev', - taskName, - '--build-type', - buildType, - '--lint-fence-files', - shouldLintFenceFiles, - '--skip-stats', - ...(policyOnly ? ['--policy-only'] : []), - ], - { - env: process.env, - }, - ); - } + const childProcess = spawn( + 'yarn', + [ + // Use the same build type for subprocesses, and only run them in + // LavaMoat if the parent process also ran in LavaMoat. + isLavaMoat ? 'build' : 'build:dev', + taskName, + `--apply-lavamoat=${applyLavaMoat ? 'true' : 'false'}`, + `--build-type=${buildType}`, + `--lint-fence-files=${shouldLintFenceFiles ? 'true' : 'false'}`, + `--policyOnly=${policyOnly ? 'true' : 'false'}`, + '--skip-stats=true', + ], + { + env: process.env, + }, + ); // forward logs to main process // skip the first stdout event (announcing the process command) diff --git a/package.json b/package.json index 761761f13..566830760 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,11 @@ "scripts": { "setup": "yarn install && yarn setup:postinstall", "setup:postinstall": "yarn patch-package && yarn allow-scripts", - "start": "yarn build:dev --apply-lavamoat=false", - "start:lavamoat": "yarn build:dev --apply-lavamoat=true", + "start": "yarn build:dev dev --apply-lavamoat=false", + "start:lavamoat": "yarn build:dev dev --apply-lavamoat=true", "dist": "yarn build prod", "build": "yarn lavamoat:build", - "build:dev": "node development/build/index.js dev", + "build:dev": "node development/build/index.js", "start:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' yarn build testDev", "benchmark:chrome": "SELENIUM_BROWSER=chrome node test/e2e/benchmark.js", "benchmark:firefox": "SELENIUM_BROWSER=firefox node test/e2e/benchmark.js", From 9daab6aa596a15bdd01a8af627e2d9352eb0ef88 Mon Sep 17 00:00:00 2001 From: Daniel <80175477+dan437@users.noreply.github.com> Date: Tue, 3 May 2022 17:55:41 +0200 Subject: [PATCH 009/127] Disable STX if a regular tx is in progress (#14554) * Disable STX if a regular tx is in progress * disableStxIfRegularTxInProgress : early return * Fix UTs * Trigger Build --- shared/constants/transaction.js | 12 ++++++++++++ ui/ducks/swaps/swaps.js | 25 +++++++++++++++++-------- ui/ducks/swaps/swaps.test.js | 9 +++++++-- ui/pages/swaps/index.js | 6 +++--- ui/pages/swaps/swaps.util.js | 4 ++-- 5 files changed, 41 insertions(+), 15 deletions(-) diff --git a/shared/constants/transaction.js b/shared/constants/transaction.js index 1e461f491..c3a959caf 100644 --- a/shared/constants/transaction.js +++ b/shared/constants/transaction.js @@ -133,6 +133,17 @@ export const TRANSACTION_STATUSES = { PENDING: 'pending', }; +/** + * With this list we can detect if a transaction is still in progress. + */ +export const IN_PROGRESS_TRANSACTION_STATUSES = [ + TRANSACTION_STATUSES.UNAPPROVED, + TRANSACTION_STATUSES.APPROVED, + TRANSACTION_STATUSES.SIGNED, + TRANSACTION_STATUSES.SUBMITTED, + TRANSACTION_STATUSES.PENDING, +]; + /** * Transaction Group Status is a MetaMask construct to track the status of groups * of transactions. @@ -159,6 +170,7 @@ export const TRANSACTION_GROUP_STATUSES = { * @typedef {Object} SmartTransactionStatuses * @property {'cancelled'} CANCELLED - It can be cancelled for various reasons. * @property {'pending'} PENDING - Smart transaction is being processed. + * @property {'success'} SUCCESS - Smart transaction was successfully mined. */ /** diff --git a/ui/ducks/swaps/swaps.js b/ui/ducks/swaps/swaps.js index 75be0e3ef..a7d5e8ad9 100644 --- a/ui/ducks/swaps/swaps.js +++ b/ui/ducks/swaps/swaps.js @@ -84,7 +84,7 @@ import { } from '../../../shared/constants/swaps'; import { TRANSACTION_TYPES, - TRANSACTION_STATUSES, + IN_PROGRESS_TRANSACTION_STATUSES, SMART_TRANSACTION_STATUSES, } from '../../../shared/constants/transaction'; import { getGasFeeEstimates } from '../metamask/metamask'; @@ -554,6 +554,20 @@ export const fetchAndSetSwapsGasPriceInfo = () => { }; }; +const disableStxIfRegularTxInProgress = (dispatch, transactions) => { + if (transactions?.length <= 0) { + return; + } + for (const transaction of transactions) { + if (IN_PROGRESS_TRANSACTION_STATUSES.includes(transaction.status)) { + dispatch( + setCurrentSmartTransactionsError(stxErrorTypes.REGULAR_TX_IN_PROGRESS), + ); + break; + } + } +}; + export const fetchSwapsLivenessAndFeatureFlags = () => { return async (dispatch, getState) => { let swapsLivenessForNetwork = { @@ -566,17 +580,12 @@ export const fetchSwapsLivenessAndFeatureFlags = () => { await dispatch(setSwapsFeatureFlags(swapsFeatureFlags)); if (ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS.includes(chainId)) { await dispatch(fetchSmartTransactionsLiveness()); - const pendingTransactions = await getTransactions({ + const transactions = await getTransactions({ searchCriteria: { - status: TRANSACTION_STATUSES.PENDING, from: state.metamask?.selectedAddress, }, }); - if (pendingTransactions?.length > 0) { - dispatch( - setCurrentSmartTransactionsError(stxErrorTypes.REGULAR_TX_PENDING), - ); - } + disableStxIfRegularTxInProgress(dispatch, transactions); } swapsLivenessForNetwork = getSwapsLivenessForNetwork( swapsFeatureFlags, diff --git a/ui/ducks/swaps/swaps.test.js b/ui/ducks/swaps/swaps.test.js index 9808b0392..39e4ea25b 100644 --- a/ui/ducks/swaps/swaps.test.js +++ b/ui/ducks/swaps/swaps.test.js @@ -15,7 +15,9 @@ jest.mock('../../store/actions.js', () => ({ setSwapsLiveness: jest.fn(), setSwapsFeatureFlags: jest.fn(), fetchSmartTransactionsLiveness: jest.fn(), - getTransactions: jest.fn(), + getTransactions: jest.fn(() => { + return []; + }), })); const providerState = { @@ -62,7 +64,10 @@ describe('Ducks - Swaps', () => { const createGetState = () => { return () => ({ - metamask: { provider: { ...providerState } }, + metamask: { + provider: { ...providerState }, + from: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4', + }, }); }; diff --git a/ui/pages/swaps/index.js b/ui/pages/swaps/index.js index c60b0bd2c..bae9e6cbd 100644 --- a/ui/pages/swaps/index.js +++ b/ui/pages/swaps/index.js @@ -358,8 +358,8 @@ export default function Swap() { const isStxNotEnoughFundsError = currentSmartTransactionsError === stxErrorTypes.NOT_ENOUGH_FUNDS; - const isStxRegularTxPendingError = - currentSmartTransactionsError === stxErrorTypes.REGULAR_TX_PENDING; + const isRegularTxInProgressError = + currentSmartTransactionsError === stxErrorTypes.REGULAR_TX_IN_PROGRESS; return (
@@ -423,7 +423,7 @@ export default function Swap() { {t('stxUnavailable')}
- {isStxRegularTxPendingError + {isRegularTxInProgressError ? t('stxFallbackPendingTx') : t('stxFallbackUnavailable')}
diff --git a/ui/pages/swaps/swaps.util.js b/ui/pages/swaps/swaps.util.js index 9c4f6b52d..a34da5a0a 100644 --- a/ui/pages/swaps/swaps.util.js +++ b/ui/pages/swaps/swaps.util.js @@ -933,13 +933,13 @@ export const showRemainingTimeInMinAndSec = (remainingTimeInSec) => { export const stxErrorTypes = { UNAVAILABLE: 'unavailable', NOT_ENOUGH_FUNDS: 'not_enough_funds', - REGULAR_TX_PENDING: 'regular_tx_pending', + REGULAR_TX_IN_PROGRESS: 'regular_tx_pending', }; export const getTranslatedStxErrorMessage = (errorType, t) => { switch (errorType) { case stxErrorTypes.UNAVAILABLE: - case stxErrorTypes.REGULAR_TX_PENDING: + case stxErrorTypes.REGULAR_TX_IN_PROGRESS: return t('stxErrorUnavailable'); case stxErrorTypes.NOT_ENOUGH_FUNDS: return t('stxErrorNotEnoughFunds'); From 6bf87b83a6adea0c35689fe4d8701e1a41b959f9 Mon Sep 17 00:00:00 2001 From: Kevin Ghim Date: Tue, 3 May 2022 12:07:15 -0400 Subject: [PATCH 010/127] Update bug-report.yml (#14466) Co-authored-by: David Walsh --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 889bd9d1b..90450a395 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,7 +1,7 @@ name: Bug Report description: Using MetaMask, but it's not working as you expect? title: "[Bug]: " -labels: ["bug"] +labels: ["type-bug"] body: - type: markdown attributes: From 23e3f52a04e5fa03590238d481a47a9294b7953a Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 3 May 2022 14:18:36 -0230 Subject: [PATCH 011/127] Update version parsing to allow rollback release (#14288) * Update version parsing to allow rollback release When we want to rollback a release on Chrome, sometimes we use the fourth part of the version for the rollback release. This is because the Chrome web stores does not directly allow rolling back, but instead requires us to re-submit the release we want to roll back to with a higher version number. The manifest version parsing now allows for a fourth version part. The comments have also been updated to be more descriptive, and to fix a minor inaccuracy. * Fix typo in comment Co-authored-by: David Walsh Co-authored-by: David Walsh --- app/scripts/platforms/extension.js | 14 ++++++++----- app/scripts/platforms/extension.test.js | 27 +++++++++---------------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index dc06d17a9..8f1d49600 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -90,13 +90,17 @@ export default class ExtensionPlatform { if (versionParts.length < 4) { throw new Error(`Version missing build number: '${version}'`); } - // On Chrome, a more descriptive representation of the version is stored - // in the `version_name` field for display purposes. + // On Chrome, a more descriptive representation of the version is stored in the + // `version_name` field for display purposes. We use this field instead of the `version` + // field on Chrome for non-main builds (i.e. Flask, Beta) because we want to show the + // version in the SemVer-compliant format "v[major].[minor].[patch]-[build-type].[build-number]", + // yet Chrome does not allow letters in the `version` field. return versionName; - } else if (versionParts.length !== 3) { + // A fourth version part is sometimes present for "rollback" Chrome builds + } else if (![3, 4].includes(versionParts.length)) { throw new Error(`Invalid version: ${version}`); } else if (versionParts[2].match(/[^\d]/u)) { - // On Firefox, the build type and build version are in the fourth part of the version. + // On Firefox, the build type and build version are in the third part of the version. const [major, minor, patchAndPrerelease] = versionParts; const matches = patchAndPrerelease.match(/^(\d+)([A-Za-z]+)(\d)+$/u); if (matches === null) { @@ -106,7 +110,7 @@ export default class ExtensionPlatform { return `${major}.${minor}.${patch}-${buildType}.${buildVersion}`; } - // If there is no `version_name` and there are only 3 version parts, then this is not a + // If there is no `version_name` and there are only 3 or 4 version parts, then this is not a // prerelease and the version requires no modification. return version; } diff --git a/app/scripts/platforms/extension.test.js b/app/scripts/platforms/extension.test.js index de8b05cdd..1b2067d78 100644 --- a/app/scripts/platforms/extension.test.js +++ b/app/scripts/platforms/extension.test.js @@ -25,6 +25,15 @@ describe('extension platform', () => { expect(version).toBe('1.2.3'); }); + it('should return rollback version', () => { + browser.runtime.getManifest.mockReturnValue({ version: '1.2.3.1' }); + const extensionPlatform = new ExtensionPlatform(); + + const version = extensionPlatform.getVersion(); + + expect(version).toBe('1.2.3.1'); + }); + it('should return SemVer-formatted version for Chrome style manifest of prerelease', () => { browser.runtime.getManifest.mockReturnValue({ version: '1.2.3.0', @@ -60,24 +69,6 @@ describe('extension platform', () => { ); }); - it('should throw error if version name is missing from Chrome style prerelease manifest', () => { - browser.runtime.getManifest.mockReturnValue({ - version: '1.2.3.0', - }); - const extensionPlatform = new ExtensionPlatform(); - - expect(() => extensionPlatform.getVersion()).toThrow('Invalid version:'); - }); - - it('should throw error if version includes four parts in a Firefox style manifest', () => { - browser.runtime.getManifest.mockReturnValue({ - version: '1.2.3.4', - }); - const extensionPlatform = new ExtensionPlatform(); - - expect(() => extensionPlatform.getVersion()).toThrow('Invalid version:'); - }); - it('should throw error if build version is missing from Firefox style prerelease manifest', () => { browser.runtime.getManifest.mockReturnValue({ version: '1.2.3beta', From f926925b3f3a3c296c4f30333bafdfe0e23f897c 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 012/127] 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 9018b533d..856461a57 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 8a71f0f00887a9e8c9bec3ac20029e3c31fb974b Mon Sep 17 00:00:00 2001 From: David Walsh Date: Wed, 4 May 2022 09:57:01 -0500 Subject: [PATCH 013/127] Add search information for Theme dropdown (#14476) --- ui/helpers/constants/settings.js | 7 +++++++ ui/helpers/utils/settings-search.test.js | 2 +- .../experimental-tab/experimental-tab.component.js | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/helpers/constants/settings.js b/ui/helpers/constants/settings.js index 4010d8cbd..3f05221e4 100644 --- a/ui/helpers/constants/settings.js +++ b/ui/helpers/constants/settings.js @@ -306,6 +306,13 @@ export const SETTINGS_CONSTANTS = [ route: `${EXPERIMENTAL_ROUTE}#enable-advanced-gas`, icon: 'fa fa-flask', }, + { + tabMessage: (t) => t('experimental'), + sectionMessage: (t) => t('theme'), + descriptionMessage: (t) => t('themeDescription'), + route: `${EXPERIMENTAL_ROUTE}#theme`, + icon: 'fa fa-flask', + }, { // TODO: Remove during TOKEN_DETECTION_V2 feature flag clean up tabMessage: (t) => t('advanced'), diff --git a/ui/helpers/utils/settings-search.test.js b/ui/helpers/utils/settings-search.test.js index fb4daa594..3ef7825d9 100644 --- a/ui/helpers/utils/settings-search.test.js +++ b/ui/helpers/utils/settings-search.test.js @@ -195,7 +195,7 @@ describe('Settings Search Utils', () => { it('should get good experimental section number', () => { expect(getNumberOfSettingsInSection(t, t('experimental'))).toStrictEqual( - 2, + 3, ); }); diff --git a/ui/pages/settings/experimental-tab/experimental-tab.component.js b/ui/pages/settings/experimental-tab/experimental-tab.component.js index e107bb0ff..f702c466f 100644 --- a/ui/pages/settings/experimental-tab/experimental-tab.component.js +++ b/ui/pages/settings/experimental-tab/experimental-tab.component.js @@ -263,7 +263,7 @@ export default class ExperimentalTab extends PureComponent { }; return ( -
+
{this.context.t('theme')}
From 5524f224b21a0166f4724a866b9f9f52b2049b44 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 4 May 2022 05:06:33 -1000 Subject: [PATCH 014/127] 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 566830760..3481d5310 100644 --- a/package.json +++ b/package.json @@ -276,7 +276,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 eed444ae4..72003be25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6664,24 +6664,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" @@ -19266,10 +19256,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" @@ -23945,14 +23931,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 41275832248bbedfe6b62dabf47bb32f48afa635 Mon Sep 17 00:00:00 2001 From: PeterYinusa <53189696+PeterYinusa@users.noreply.github.com> Date: Wed, 4 May 2022 17:02:42 +0100 Subject: [PATCH 015/127] Jest tests - incremental coverage (#14612) * add jest-it-up dependancy * add reporter * post test run jest-it-up * Add CI check * update coverage * deduplicate dependancies --- .circleci/config.yml | 7 ++++ development/jest.config.js | 2 +- jest.config.js | 10 ++--- package.json | 3 +- yarn.lock | 81 ++++++++++++++++++++++++++++++++------ 5 files changed, 85 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bf6513533..749402c7f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -670,6 +670,13 @@ jobs: - run: name: test:coverage:jest command: yarn test:coverage:jest + - run: + name: Validate coverage thresholds + command: | + if ! git diff --exit-code jest.config.js development/jest.config.js; then + echo "Detected changes in coverage thresholds" + exit 1 + fi - persist_to_workspace: root: . paths: diff --git a/development/jest.config.js b/development/jest.config.js index e4218c21f..fe594713e 100644 --- a/development/jest.config.js +++ b/development/jest.config.js @@ -2,7 +2,7 @@ module.exports = { displayName: '/development', collectCoverageFrom: ['/**/*.js'], coverageDirectory: '../jest-coverage/development/', - coverageReporters: ['html', 'text-summary'], + coverageReporters: ['html', 'text-summary', 'json-summary'], coverageThreshold: { './development/build/transforms/**/*.js': { branches: 100, diff --git a/jest.config.js b/jest.config.js index e366a29fd..d64ca0864 100644 --- a/jest.config.js +++ b/jest.config.js @@ -6,13 +6,13 @@ module.exports = { ], coverageDirectory: './jest-coverage/main', coveragePathIgnorePatterns: ['.stories.js', '.snap'], - coverageReporters: ['html', 'text-summary'], + coverageReporters: ['html', 'text-summary', 'json-summary'], coverageThreshold: { global: { - branches: 35, - functions: 37, - lines: 43, - statements: 43, + branches: 44, + functions: 42, + lines: 48, + statements: 48, }, './app/scripts/controllers/permissions/**/*.js': { branches: 100, diff --git a/package.json b/package.json index 3481d5310..bdce0f3cb 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "test:e2e:firefox:snaps": "SELENIUM_BROWSER=firefox node test/e2e/run-all.js --snaps", "test:e2e:single": "node test/e2e/run-e2e-test.js", "test:coverage:mocha": "nyc --reporter=text --reporter=html yarn test:unit:mocha", - "test:coverage:jest": "yarn test:unit:jest --coverage --maxWorkers=2", + "test:coverage:jest": "yarn test:unit:jest --coverage --maxWorkers=2 && yarn jest-it-up -m 5", "ganache:start": "./development/run-ganache.sh", "sentry:publish": "node ./development/sentry-publish.js", "lint": "yarn lint:prettier && yarn lint:eslint && yarn lint:tsc && yarn lint:styles", @@ -325,6 +325,7 @@ "improved-yarn-audit": "^3.0.0", "jest": "^26.6.3", "jest-canvas-mock": "^2.3.1", + "jest-it-up": "^2.0.2", "jsdom": "^11.2.0", "koa": "^2.7.0", "lavamoat": "^6.1.2", diff --git a/yarn.lock b/yarn.lock index 72003be25..15080a0bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2197,6 +2197,38 @@ ws "*" xtend "^4.0.0" +"@inquirer/confirm@^0.0.14-alpha.0": + version "0.0.14-alpha.0" + resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-0.0.14-alpha.0.tgz#4a759c6def5ecd73bc239e090ee6197f74f52dbd" + integrity sha512-MTMCp/jUHJUB0IVkV5utQ1NUE3tqH2W0OtYXByW+ykoRXLiaYrv8vYtx6j0/rOiDHhNjNqTEIWomQx16w1x0uQ== + dependencies: + "@inquirer/core" "^0.0.15-alpha.0" + "@inquirer/input" "^0.0.15-alpha.0" + chalk "^4.1.1" + +"@inquirer/core@^0.0.15-alpha.0": + version "0.0.15-alpha.0" + resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-0.0.15-alpha.0.tgz#08b6439f3998669d1ba0165c0c5f91736b0c7848" + integrity sha512-aytWU6/yM9HkZ09BrgfTJlVsZjmxoiO1cBL5tlkO/jYe4ZuU84rHWnFFxorRzkmT6gkTs1L9TUKaeK3tbyJmJw== + dependencies: + ansi-escapes "^4.2.1" + chalk "^4.1.1" + cli-spinners "^2.6.0" + cli-width "^3.0.0" + lodash "^4.17.21" + mute-stream "^0.0.8" + run-async "^2.3.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +"@inquirer/input@^0.0.15-alpha.0": + version "0.0.15-alpha.0" + resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-0.0.15-alpha.0.tgz#60556547845775ac332d7b3406717f361b3ef721" + integrity sha512-h3mxEK9xTtdAX6a+S/pYRVRTxpnjOPQgQADpgFar/yQqklyBRM5+uX1YRRQG+uwU0IzpI18viPnEdibxrY7Kyw== + dependencies: + "@inquirer/core" "^0.0.15-alpha.0" + chalk "^4.1.1" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz#10602de5570baea82f8afbfa2630b24e7a8cfe5b" @@ -5609,7 +5641,7 @@ ansi-colors@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== -ansi-colors@^4.1.1: +ansi-colors@^4.1.0, ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== @@ -7840,10 +7872,10 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0, chalk@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -8144,6 +8176,11 @@ cli-cursor@^2.1.0: dependencies: restore-cursor "^2.0.0" +cli-spinners@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" + integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== + cli-table3@0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.0.tgz#b7b1bc65ca8e7b5cef9124e13dc2b21e2ce4faee" @@ -8159,6 +8196,11 @@ cli-width@^2.0.0: resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= +cli-width@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" + integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== + clipboard@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.4.tgz#836dafd66cf0fea5d71ce5d5b0bf6e958009112d" @@ -8433,6 +8475,11 @@ commander@^6.1.0, commander@^6.2.1: resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== +commander@^9.0.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-9.2.0.tgz#6e21014b2ed90d8b7c9647230d8b7a94a4a419a9" + integrity sha512-e2i4wANQiSXgnrBlIatyHtP1odfUp0BbV5Y5nEGbxtIrStkEOAAzCUirvLBNXHLr7kwLvJl6V+4V3XV9x7Wd9w== + comment-parser@1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-1.2.4.tgz#489f3ee55dfd184a6e4bffb31baba284453cb760" @@ -16287,6 +16334,15 @@ jest-haste-map@^26.6.2: optionalDependencies: fsevents "^2.1.2" +jest-it-up@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/jest-it-up/-/jest-it-up-2.0.2.tgz#c8c38d14fd4a9131c12f6947baa2063554c0738d" + integrity sha512-xup3Lv1uc+ihGwyFLjZOqY2L7m91TyBp/TRJxS7PYAVQc/vd3NbkPyypUlT59sQDfW9uULF9jLCedr7jABDNnA== + dependencies: + "@inquirer/confirm" "^0.0.14-alpha.0" + ansi-colors "^4.1.0" + commander "^9.0.0" + jest-jasmine2@^26.6.3: version "26.6.3" resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz#adc3cf915deacb5212c93b9f3547cd12958f2edd" @@ -19573,6 +19629,11 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= +mute-stream@^0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + nan@^2.11.1, nan@^2.12.1, nan@^2.13.2, nan@^2.14.0: version "2.15.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" @@ -24201,12 +24262,10 @@ run-async@^0.1.0: dependencies: once "^1.3.0" -run-async@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= - dependencies: - is-promise "^2.1.0" +run-async@^2.2.0, run-async@^2.3.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== run-parallel@^1.1.9: version "1.1.9" From 564ad2f81be31f98ac71c61a849904e71db8f1a4 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Wed, 4 May 2022 11:54:46 -0500 Subject: [PATCH 016/127] 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 e982b962f..e5d50375f 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 111392fad..33e23bbf8 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 8017579a6..d8a67d3b6 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1637,6 +1637,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 76546ac04..a812e34a1 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 8e16486db..a8466753b 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 100d2877f..a46fa7a8b 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 && ( @@ -29,7 +29,7 @@ const DetectedTokensLink = ({ className = '', onClick }) => { }; DetectedTokensLink.propTypes = { - onClick: PropTypes.func.isRequired, + setShowDetectedTokens: PropTypes.func.isRequired, className: PropTypes.string, }; diff --git a/ui/components/app/detected-token/detected-token-address/detected-token-address.js b/ui/components/app/detected-token/detected-token-address/detected-token-address.js index 1e385b4fa..3c4f012de 100644 --- a/ui/components/app/detected-token/detected-token-address/detected-token-address.js +++ b/ui/components/app/detected-token/detected-token-address/detected-token-address.js @@ -1,6 +1,7 @@ -import React, { useContext } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; -import { I18nContext } from '../../../../contexts/i18n'; + +import { useI18nContext } from '../../../../hooks/useI18nContext'; import { useCopyToClipboard } from '../../../../hooks/useCopyToClipboard'; import Box from '../../../ui/box'; @@ -16,8 +17,8 @@ import { import { shortenAddress } from '../../../../helpers/utils/util'; -const DetectedTokenAddress = ({ address }) => { - const t = useContext(I18nContext); +const DetectedTokenAddress = ({ tokenAddress }) => { + const t = useI18nContext(); const [copied, handleCopy] = useCopyToClipboard(); return ( @@ -30,7 +31,7 @@ const DetectedTokenAddress = ({ address }) => { color={COLORS.PRIMARY_DEFAULT} margin={[1, 2]} > - {shortenAddress(address)} + {shortenAddress(tokenAddress)} { type="link" className="detected-token-address__copy-link" onClick={() => { - handleCopy(address); + handleCopy(tokenAddress); }} > @@ -51,7 +52,7 @@ const DetectedTokenAddress = ({ address }) => { }; DetectedTokenAddress.propTypes = { - address: PropTypes.string, + tokenAddress: PropTypes.string, }; export default DetectedTokenAddress; diff --git a/ui/components/app/detected-token/detected-token-address/detected-token-address.stories.js b/ui/components/app/detected-token/detected-token-address/detected-token-address.stories.js index 4c328ebff..c1ce8d531 100644 --- a/ui/components/app/detected-token/detected-token-address/detected-token-address.stories.js +++ b/ui/components/app/detected-token/detected-token-address/detected-token-address.stories.js @@ -6,15 +6,15 @@ export default { title: 'Components/App/DetectedToken/DetectedTokenAddress', id: __filename, argTypes: { - address: { control: 'text' }, + tokenAddress: { control: 'text' }, }, args: { - address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + tokenAddress: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', }, }; const Template = (args) => { - return ; + return ; }; export const DefaultStory = Template.bind({}); diff --git a/ui/components/app/detected-token/detected-token-address/detected-token-address.test.js b/ui/components/app/detected-token/detected-token-address/detected-token-address.test.js index b0daa552d..de3fc18d6 100644 --- a/ui/components/app/detected-token/detected-token-address/detected-token-address.test.js +++ b/ui/components/app/detected-token/detected-token-address/detected-token-address.test.js @@ -6,7 +6,7 @@ import DetectedTokenAddress from './detected-token-address'; describe('DetectedTokenAddress', () => { const args = { - address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + tokenAddress: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', }; it('should render the detected token address', async () => { diff --git a/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.js b/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.js index 7cb66701a..45c9ce690 100644 --- a/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.js +++ b/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.js @@ -1,6 +1,7 @@ -import React, { useContext, useState } from 'react'; +import React, { useState } from 'react'; import PropTypes from 'prop-types'; -import { I18nContext } from '../../../../contexts/i18n'; + +import { useI18nContext } from '../../../../hooks/useI18nContext'; import Box from '../../../ui/box'; import Button from '../../../ui/button'; @@ -11,9 +12,12 @@ import { TYPOGRAPHY, } from '../../../../helpers/constants/design-system'; -const DetectedTokenAggregators = ({ aggregatorsList }) => { - const t = useContext(I18nContext); - const numOfHiddenAggregators = parseInt(aggregatorsList.length, 10) - 2; +const NUMBER_OF_AGGREGATORS_TO_DISPLAY = 2; + +const DetectedTokenAggregators = ({ aggregators }) => { + const t = useI18nContext(); + const numOfHiddenAggregators = + parseInt(aggregators.length, 10) - NUMBER_OF_AGGREGATORS_TO_DISPLAY; const [displayMore, setDisplayMore] = useState(false); return ( @@ -21,8 +25,14 @@ const DetectedTokenAggregators = ({ aggregatorsList }) => { {t('fromTokenLists', [ numOfHiddenAggregators > 0 && !displayMore ? ( - - {`${aggregatorsList.slice(0, 2).join(', ')}`} + + {`${aggregators + .slice(0, NUMBER_OF_AGGREGATORS_TO_DISPLAY) + .join(', ')}`} ) : ( - - {`${aggregatorsList.join(', ')}.`} + + {`${aggregators.join(', ')}.`} ), ])} @@ -44,7 +58,7 @@ const DetectedTokenAggregators = ({ aggregatorsList }) => { }; DetectedTokenAggregators.propTypes = { - aggregatorsList: PropTypes.array.isRequired, + aggregators: PropTypes.array.isRequired, }; export default DetectedTokenAggregators; diff --git a/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.stories.js b/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.stories.js index c4c96b684..42d97b208 100644 --- a/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.stories.js +++ b/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.stories.js @@ -8,10 +8,10 @@ export default { title: 'Components/App/DetectedToken/DetectedTokenAggregators', id: __filename, argTypes: { - aggregatorsList: { control: 'array' }, + aggregators: { control: 'array' }, }, args: { - aggregatorsList1: [ + aggregators1: [ 'Aave', 'Bancor', 'CMC', @@ -25,15 +25,15 @@ export default { 'Zerion', '0x', ], - aggregatorsList2: ['Aave', 'Bancor'], + aggregators2: ['Aave', 'Bancor'], }, }; const Template = (args) => { return ( - - + + ); }; diff --git a/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.test.js b/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.test.js index 27757fb32..15f596b45 100644 --- a/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.test.js +++ b/ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.test.js @@ -10,7 +10,7 @@ import DetectedTokenAggregators from './detected-token-aggregators'; describe('DetectedTokenAggregators', () => { const args = { - aggregatorsList: [ + aggregators: [ 'Aave', 'Bancor', 'CMC', diff --git a/ui/components/app/detected-token/detected-token-details/detected-token-details.js b/ui/components/app/detected-token/detected-token-details/detected-token-details.js index 0b6d4d59a..0238b5a53 100644 --- a/ui/components/app/detected-token/detected-token-details/detected-token-details.js +++ b/ui/components/app/detected-token/detected-token-details/detected-token-details.js @@ -1,5 +1,4 @@ import React from 'react'; -import { useSelector } from 'react-redux'; import PropTypes from 'prop-types'; import Box from '../../../ui/box'; @@ -8,17 +7,21 @@ import DetectedTokenValues from '../detected-token-values/detected-token-values' import DetectedTokenAddress from '../detected-token-address/detected-token-address'; import DetectedTokenAggregators from '../detected-token-aggregators/detected-token-aggregators'; import { DISPLAY } from '../../../../helpers/constants/design-system'; -import { getTokenList } from '../../../../selectors'; - -const DetectedTokenDetails = ({ tokenAddress }) => { - const tokenList = useSelector(getTokenList); - const token = tokenList[tokenAddress]; +const DetectedTokenDetails = ({ + token, + handleTokenSelection, + tokensListDetected, +}) => { return ( - + { marginLeft={2} className="detected-token-details__data" > - - - + + + ); }; DetectedTokenDetails.propTypes = { - tokenAddress: PropTypes.string, + token: PropTypes.shape({ + address: PropTypes.string.isRequired, + decimals: PropTypes.number, + symbol: PropTypes.string, + iconUrl: PropTypes.string, + aggregators: PropTypes.array, + }), + handleTokenSelection: PropTypes.func.isRequired, + tokensListDetected: PropTypes.object, }; export default DetectedTokenDetails; diff --git a/ui/components/app/detected-token/detected-token-details/detected-token-details.stories.js b/ui/components/app/detected-token/detected-token-details/detected-token-details.stories.js index fe95977f6..91a423708 100644 --- a/ui/components/app/detected-token/detected-token-details/detected-token-details.stories.js +++ b/ui/components/app/detected-token/detected-token-details/detected-token-details.stories.js @@ -6,17 +6,77 @@ export default { title: 'Components/App/DetectedToken/DetectedTokenDetails', id: __filename, argTypes: { - address: { control: 'text' }, + token: { control: 'object' }, + handleTokenSelection: { control: 'func' }, + tokensListDetected: { control: 'array' }, }, args: { - address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + token: { + address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + symbol: 'SNX', + decimals: 18, + iconUrl: 'https://assets.coingecko.com/coins/images/3406/large/SNX.png', + aggregators: [ + 'aave', + 'bancor', + 'cmc', + 'cryptocom', + 'coinGecko', + 'oneInch', + 'paraswap', + 'pmm', + 'synthetix', + 'zapper', + 'zerion', + 'zeroEx', + ], + }, + tokensListDetected: { + '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f': { + token: { + name: 'Synthetix Network', + address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + symbol: 'SNX', + decimals: 18, + iconUrl: + 'https://assets.coingecko.com/coins/images/3406/large/SNX.png', + aggregators: [ + 'aave', + 'bancor', + 'cmc', + 'cryptocom', + 'coinGecko', + 'oneInch', + 'paraswap', + 'pmm', + 'synthetix', + 'zapper', + 'zerion', + 'zeroEx', + ], + }, + selected: true, + }, + '0x514910771af9ca656af840dff83e8264ecf986ca': { + token: { + name: 'ChainLink Token', + address: '0x514910771af9ca656af840dff83e8264ecf986ca', + symbol: 'LINK', + decimals: 18, + iconUrl: + 'https://crypto.com/price/coin-data/icon/LINK/color_icon.png', + aggregators: ['coinGecko', 'oneInch', 'paraswap', 'zapper', 'zerion'], + }, + selected: true, + }, + }, }, }; const Template = (args) => { return (
- +
); }; diff --git a/ui/components/app/detected-token/detected-token-details/detected-token-details.test.js b/ui/components/app/detected-token/detected-token-details/detected-token-details.test.js index 4bebcb8eb..559c568bc 100644 --- a/ui/components/app/detected-token/detected-token-details/detected-token-details.test.js +++ b/ui/components/app/detected-token/detected-token-details/detected-token-details.test.js @@ -11,7 +11,66 @@ import DetectedTokenDetails from './detected-token-details'; describe('DetectedTokenDetails', () => { const args = { - tokenAddress: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + token: { + address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + symbol: 'SNX', + decimals: 18, + iconUrl: 'https://assets.coingecko.com/coins/images/3406/large/SNX.png', + aggregators: [ + 'Aave', + 'Bancor', + 'CMC', + 'Crypto.com', + 'CoinGecko', + '1Inch', + 'Paraswap', + 'PMM', + 'Synthetix', + 'Zapper', + 'Zerion', + '0x', + ], + }, + handleTokenSelection: jest.fn(), + tokensListDetected: { + 0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f: { + token: { + name: 'Synthetix Network', + address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + symbol: 'SNX', + decimals: 18, + iconUrl: + 'https://assets.coingecko.com/coins/images/3406/large/SNX.png', + aggregators: [ + 'aave', + 'bancor', + 'cmc', + 'cryptocom', + 'coinGecko', + 'oneInch', + 'paraswap', + 'pmm', + 'synthetix', + 'zapper', + 'zerion', + 'zeroEx', + ], + }, + selected: true, + }, + 0x514910771af9ca656af840dff83e8264ecf986ca: { + token: { + name: 'ChainLink Token', + address: '0x514910771af9ca656af840dff83e8264ecf986ca', + symbol: 'LINK', + decimals: 18, + iconUrl: + 'https://crypto.com/price/coin-data/icon/LINK/color_icon.png', + aggregators: ['coinGecko', 'oneInch', 'paraswap', 'zapper', 'zerion'], + }, + selected: true, + }, + }, }; it('should render the detected token details', async () => { @@ -28,7 +87,7 @@ describe('DetectedTokenDetails', () => { fireEvent.click(screen.getByText('+ 10 more')); expect( screen.getByText( - 'Aave, Bancor, CMC, Crypto.com, CoinGecko, 1inch, Paraswap, PMM, Synthetix, Zapper, Zerion, 0x.', + 'Aave, Bancor, CMC, Crypto.com, CoinGecko, 1Inch, Paraswap, PMM, Synthetix, Zapper, Zerion, 0x.', ), ).toBeInTheDocument(); }); diff --git a/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js b/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js new file mode 100644 index 000000000..25777ed49 --- /dev/null +++ b/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js @@ -0,0 +1,57 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { useI18nContext } from '../../../../hooks/useI18nContext'; + +import Popover from '../../../ui/popover'; +import Button from '../../../ui/button'; +import Typography from '../../../ui/typography/typography'; +import { TYPOGRAPHY } from '../../../../helpers/constants/design-system'; + +const DetectedTokenIgnoredPopover = ({ + onCancelIgnore, + handleClearTokensSelection, +}) => { + const t = useI18nContext(); + + const footer = ( + <> + + + + ); + + return ( + + + {t('ignoreTokenWarning')} + + + ); +}; + +DetectedTokenIgnoredPopover.propTypes = { + onCancelIgnore: PropTypes.func.isRequired, + handleClearTokensSelection: PropTypes.func.isRequired, +}; + +export default DetectedTokenIgnoredPopover; diff --git a/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.stories.js b/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.stories.js new file mode 100644 index 000000000..74b15d581 --- /dev/null +++ b/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.stories.js @@ -0,0 +1,24 @@ +import React from 'react'; + +import DetectedTokenIgnoredPopover from './detected-token-ignored-popover'; + +export default { + title: 'Components/App/DetectedToken/DetectedTokenIgnoredPopover', + id: __filename, + argTypes: { + onCancelIgnore: { + control: 'func', + }, + handleClearTokensSelection: { + control: 'func', + }, + }, +}; + +const Template = (args) => { + return ; +}; + +export const DefaultStory = Template.bind({}); + +DefaultStory.storyName = 'Default'; diff --git a/ui/components/app/detected-token/detected-token-ignored-popover/index.scss b/ui/components/app/detected-token/detected-token-ignored-popover/index.scss new file mode 100644 index 000000000..64e0d90bd --- /dev/null +++ b/ui/components/app/detected-token/detected-token-ignored-popover/index.scss @@ -0,0 +1,13 @@ +.detected-token-ignored-popover { + &__ignore-button { + margin-inline-end: 8px; + } + + &__import-button { + margin-inline-start: 8px; + } + + .popover-header { + margin-inline-start: 85px; + } +} diff --git a/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js b/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js new file mode 100644 index 000000000..a37aeaae5 --- /dev/null +++ b/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js @@ -0,0 +1,87 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { useSelector } from 'react-redux'; + +import { useI18nContext } from '../../../../hooks/useI18nContext'; +import { getDetectedTokensInCurrentNetwork } from '../../../../selectors'; + +import Popover from '../../../ui/popover'; +import Box from '../../../ui/box'; +import Button from '../../../ui/button'; +import DetectedTokenDetails from '../detected-token-details/detected-token-details'; + +const DetectedTokenSelectionPopover = ({ + tokensListDetected, + handleTokenSelection, + onImport, + onIgnoreAll, + setShowDetectedTokens, + sortingBasedOnTokenSelection, +}) => { + const t = useI18nContext(); + + const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork); + const { selected: selectedTokens = [] } = sortingBasedOnTokenSelection( + tokensListDetected, + ); + const numOfTokensImporting = + selectedTokens.length === detectedTokens.length + ? `All` + : `(${selectedTokens.length})`; + + const onClose = () => { + setShowDetectedTokens(false); + }; + + const footer = ( + <> + + + + ); + + return ( + + + {detectedTokens.map((token, index) => { + return ( + + ); + })} + + + ); +}; + +DetectedTokenSelectionPopover.propTypes = { + tokensListDetected: PropTypes.object, + handleTokenSelection: PropTypes.func.isRequired, + onIgnoreAll: PropTypes.func.isRequired, + onImport: PropTypes.func.isRequired, + setShowDetectedTokens: PropTypes.func.isRequired, + sortingBasedOnTokenSelection: PropTypes.func.isRequired, +}; + +export default DetectedTokenSelectionPopover; diff --git a/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.stories.js b/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.stories.js new file mode 100644 index 000000000..3d013615f --- /dev/null +++ b/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.stories.js @@ -0,0 +1,69 @@ +import React from 'react'; +import { Provider } from 'react-redux'; + +import testData from '../../../../../.storybook/test-data'; +import configureStore from '../../../../store/store'; +import DetectedTokenSelectionPopover from './detected-token-selection-popover'; + +const store = configureStore(testData); + +export default { + title: 'Components/App/DetectedToken/DetectedTokenSelectionPopover', + decorators: [(story) => {story()}], + id: __filename, + argTypes: { + selectedTokens: { control: 'array' }, + handleTokenSelection: { control: 'func' }, + onImport: { control: 'func' }, + onIgnoreAll: { control: 'func' }, + }, + args: { + tokensListDetected: { + '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f': { + token: { + name: 'Synthetix Network', + address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + symbol: 'SNX', + decimals: 18, + iconUrl: + 'https://assets.coingecko.com/coins/images/3406/large/SNX.png', + aggregators: [ + 'aave', + 'bancor', + 'cmc', + 'cryptocom', + 'coinGecko', + 'oneInch', + 'paraswap', + 'pmm', + 'synthetix', + 'zapper', + 'zerion', + 'zeroEx', + ], + }, + selected: true, + }, + '0x514910771af9ca656af840dff83e8264ecf986ca': { + token: { + name: 'ChainLink Token', + address: '0x514910771af9ca656af840dff83e8264ecf986ca', + symbol: 'LINK', + decimals: 18, + iconUrl: + 'https://crypto.com/price/coin-data/icon/LINK/color_icon.png', + aggregators: ['coinGecko', 'oneInch', 'paraswap', 'zapper', 'zerion'], + }, + selected: true, + }, + }, + }, +}; + +const Template = (args) => { + return ; +}; + +export const DefaultStory = Template.bind({}); + +DefaultStory.storyName = 'Default'; diff --git a/ui/components/app/detected-token/detected-token-selection-popover/index.scss b/ui/components/app/detected-token/detected-token-selection-popover/index.scss new file mode 100644 index 000000000..89cca42ce --- /dev/null +++ b/ui/components/app/detected-token/detected-token-selection-popover/index.scss @@ -0,0 +1,9 @@ +.detected-token-selection-popover { + &__ignore-button { + margin-right: 8px; + } + + &__import-button { + margin-left: 8px; + } +} diff --git a/ui/components/app/detected-token/detected-token-values/detected-token-values.js b/ui/components/app/detected-token/detected-token-values/detected-token-values.js index d234b67c2..b6c4f4648 100644 --- a/ui/components/app/detected-token/detected-token-values/detected-token-values.js +++ b/ui/components/app/detected-token/detected-token-values/detected-token-values.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; import Box from '../../../ui/box'; @@ -13,32 +13,44 @@ import { import { useTokenTracker } from '../../../../hooks/useTokenTracker'; import { useTokenFiatAmount } from '../../../../hooks/useTokenFiatAmount'; -const DetectedTokenValues = ({ token }) => { - const [selectedTokens, setSelectedTokens] = useState(false); +const DetectedTokenValues = ({ + token, + handleTokenSelection, + tokensListDetected, +}) => { + const [tokenSelection, setTokenSelection] = useState(() => { + return tokensListDetected[token.address]?.selected; + }); + const { tokensWithBalances } = useTokenTracker([token]); - const balanceToRender = tokensWithBalances[0]?.string; - const balance = tokensWithBalances[0]?.balance; + const balanceString = tokensWithBalances[0]?.string; const formattedFiatBalance = useTokenFiatAmount( token.address, - balanceToRender, + balanceString, token.symbol, ); + useEffect(() => { + setTokenSelection(tokensListDetected[token.address]?.selected); + }, [tokensListDetected, token.address, tokenSelection, setTokenSelection]); + + const handleCheckBoxSelection = () => { + setTokenSelection(!tokenSelection); + handleTokenSelection(token); + }; + return ( - {`${balance || '0'} ${token.symbol}`} + {`${balanceString || '0'} ${token.symbol}`} {formattedFiatBalance || '$0'} - setSelectedTokens((checked) => !checked)} - /> + ); @@ -52,6 +64,8 @@ DetectedTokenValues.propTypes = { iconUrl: PropTypes.string, aggregators: PropTypes.array, }), + handleTokenSelection: PropTypes.func.isRequired, + tokensListDetected: PropTypes.object, }; export default DetectedTokenValues; diff --git a/ui/components/app/detected-token/detected-token-values/detected-token-values.stories.js b/ui/components/app/detected-token/detected-token-values/detected-token-values.stories.js index 6a3d12c39..98c1a8e1a 100644 --- a/ui/components/app/detected-token/detected-token-values/detected-token-values.stories.js +++ b/ui/components/app/detected-token/detected-token-values/detected-token-values.stories.js @@ -6,36 +6,75 @@ export default { title: 'Components/App/DetectedToken/DetectedTokenValues', id: __filename, argTypes: { - address: { control: 'text' }, - symbol: { control: 'text' }, - decimals: { control: 'text' }, - iconUrl: { control: 'text' }, - aggregators: { control: 'array' }, + token: { control: 'object' }, + handleTokenSelection: { control: 'func' }, + tokensListDetected: { control: 'array' }, }, args: { - address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', - symbol: 'SNX', - decimals: 18, - iconUrl: 'https://assets.coingecko.com/coins/images/3406/large/SNX.png', - aggregators: [ - 'aave', - 'bancor', - 'cmc', - 'cryptocom', - 'coinGecko', - 'oneInch', - 'paraswap', - 'pmm', - 'synthetix', - 'zapper', - 'zerion', - 'zeroEx', - ], + token: { + address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + symbol: 'SNX', + decimals: 18, + iconUrl: 'https://assets.coingecko.com/coins/images/3406/large/SNX.png', + aggregators: [ + 'aave', + 'bancor', + 'cmc', + 'cryptocom', + 'coinGecko', + 'oneInch', + 'paraswap', + 'pmm', + 'synthetix', + 'zapper', + 'zerion', + 'zeroEx', + ], + }, + tokensListDetected: { + '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f': { + token: { + name: 'Synthetix Network', + address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + symbol: 'SNX', + decimals: 18, + iconUrl: + 'https://assets.coingecko.com/coins/images/3406/large/SNX.png', + aggregators: [ + 'aave', + 'bancor', + 'cmc', + 'cryptocom', + 'coinGecko', + 'oneInch', + 'paraswap', + 'pmm', + 'synthetix', + 'zapper', + 'zerion', + 'zeroEx', + ], + }, + selected: true, + }, + '0x514910771af9ca656af840dff83e8264ecf986ca': { + token: { + name: 'ChainLink Token', + address: '0x514910771af9ca656af840dff83e8264ecf986ca', + symbol: 'LINK', + decimals: 18, + iconUrl: + 'https://crypto.com/price/coin-data/icon/LINK/color_icon.png', + aggregators: ['coinGecko', 'oneInch', 'paraswap', 'zapper', 'zerion'], + }, + selected: true, + }, + }, }, }; const Template = (args) => { - return ; + return ; }; export const DefaultStory = Template.bind({}); diff --git a/ui/components/app/detected-token/detected-token-values/detected-token-values.test.js b/ui/components/app/detected-token/detected-token-values/detected-token-values.test.js index 18a5aae86..e94557eac 100644 --- a/ui/components/app/detected-token/detected-token-values/detected-token-values.test.js +++ b/ui/components/app/detected-token/detected-token-values/detected-token-values.test.js @@ -7,29 +7,71 @@ import DetectedTokenValues from './detected-token-values'; describe('DetectedTokenValues', () => { const args = { - address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', - symbol: 'SNX', - decimals: 18, - iconUrl: 'https://assets.coingecko.com/coins/images/3406/large/SNX.png', - aggregators: [ - 'aave', - 'bancor', - 'cmc', - 'cryptocom', - 'coinGecko', - 'oneInch', - 'paraswap', - 'pmm', - 'synthetix', - 'zapper', - 'zerion', - 'zeroEx', - ], + token: { + address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + symbol: 'SNX', + decimals: 18, + iconUrl: 'https://assets.coingecko.com/coins/images/3406/large/SNX.png', + aggregators: [ + 'Aave', + 'Bancor', + 'CMC', + 'Crypto.com', + 'CoinGecko', + '1Inch', + 'Paraswap', + 'PMM', + 'Synthetix', + 'Zapper', + 'Zerion', + '0x', + ], + }, + handleTokenSelection: jest.fn(), + tokensListDetected: { + '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f': { + token: { + name: 'Synthetix Network', + address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + symbol: 'SNX', + decimals: 18, + iconUrl: + 'https://assets.coingecko.com/coins/images/3406/large/SNX.png', + aggregators: [ + 'aave', + 'bancor', + 'cmc', + 'cryptocom', + 'coinGecko', + 'oneInch', + 'paraswap', + 'pmm', + 'synthetix', + 'zapper', + 'zerion', + 'zeroEx', + ], + }, + selected: true, + }, + '0x514910771af9ca656af840dff83e8264ecf986ca': { + token: { + name: 'ChainLink Token', + address: '0x514910771af9ca656af840dff83e8264ecf986ca', + symbol: 'LINK', + decimals: 18, + iconUrl: + 'https://crypto.com/price/coin-data/icon/LINK/color_icon.png', + aggregators: ['coinGecko', 'oneInch', 'paraswap', 'zapper', 'zerion'], + }, + selected: true, + }, + }, }; it('should render the detected token address', async () => { const store = configureStore(testData); - renderWithProvider(, store); + renderWithProvider(, store); expect(screen.getByText('0 SNX')).toBeInTheDocument(); expect(screen.getByText('$0')).toBeInTheDocument(); diff --git a/ui/components/app/detected-token/detected-token.js b/ui/components/app/detected-token/detected-token.js new file mode 100644 index 000000000..21d390b7f --- /dev/null +++ b/ui/components/app/detected-token/detected-token.js @@ -0,0 +1,128 @@ +import React, { useState } from 'react'; +import PropTypes from 'prop-types'; +import { useSelector, useDispatch } from 'react-redux'; +import { chain } from 'lodash'; + +import { + importTokens, + ignoreTokens, + setNewTokensImported, +} from '../../../store/actions'; +import { getDetectedTokensInCurrentNetwork } from '../../../selectors'; + +import DetectedTokenSelectionPopover from './detected-token-selection-popover/detected-token-selection-popover'; +import DetectedTokenIgnoredPopover from './detected-token-ignored-popover/detected-token-ignored-popover'; + +const sortingBasedOnTokenSelection = (tokensDetected) => { + return ( + chain(tokensDetected) + // get the values + .values() + // create a new object with keys 'selected', 'deselected' and group the tokens + .groupBy((token) => (token.selected ? 'selected' : 'deselected')) + // ditch the 'selected' property and get just the tokens' + .mapValues((group) => group.map(({ token }) => token)) + // Exit the chain and get the underlying value, an object. + .value() + ); +}; +const DetectedToken = ({ setShowDetectedTokens }) => { + const dispatch = useDispatch(); + + const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork); + + const [tokensListDetected, setTokensListDetected] = useState(() => + detectedTokens.reduce((tokenObj, token) => { + tokenObj[token.address] = { token, selected: true }; + return tokenObj; + }, {}), + ); + const [ + showDetectedTokenIgnoredPopover, + setShowDetectedTokenIgnoredPopover, + ] = useState(false); + + const handleClearTokensSelection = async () => { + // create a lodash chain on this object + const { + selected: selectedTokens, + deselected: deSelectedTokens, + } = sortingBasedOnTokenSelection(tokensListDetected); + + if (deSelectedTokens.length < detectedTokens.length) { + await dispatch(ignoreTokens(deSelectedTokens)); + await dispatch(importTokens(selectedTokens)); + const tokenSymbols = selectedTokens.map(({ symbol }) => symbol); + dispatch(setNewTokensImported(tokenSymbols.join(', '))); + } else { + await dispatch(ignoreTokens(deSelectedTokens)); + } + setShowDetectedTokens(false); + }; + + const handleTokenSelection = (token) => { + setTokensListDetected((prevState) => ({ + ...prevState, + [token.address]: { + ...prevState[token.address], + selected: !prevState[token.address].selected, + }, + })); + }; + + const onImport = async () => { + // create a lodash chain on this object + const { selected: selectedTokens } = sortingBasedOnTokenSelection( + tokensListDetected, + ); + + if (selectedTokens.length < detectedTokens.length) { + setShowDetectedTokenIgnoredPopover(true); + } else { + const tokenSymbols = selectedTokens.map(({ symbol }) => symbol); + await dispatch(importTokens(selectedTokens)); + dispatch(setNewTokensImported(tokenSymbols.join(', '))); + setShowDetectedTokens(false); + } + }; + + const onIgnoreAll = () => { + const newTokensListDetected = { ...tokensListDetected }; + for (const tokenAddress of Object.keys(tokensListDetected)) { + newTokensListDetected[tokenAddress].selected = false; + } + + setTokensListDetected(newTokensListDetected); + setShowDetectedTokenIgnoredPopover(true); + }; + + const onCancelIgnore = () => { + setShowDetectedTokenIgnoredPopover(false); + }; + + return ( + <> + {showDetectedTokenIgnoredPopover && ( + + )} + + + ); +}; + +DetectedToken.propTypes = { + setShowDetectedTokens: PropTypes.func.isRequired, +}; + +export default DetectedToken; diff --git a/ui/components/app/detected-token/detected-token.test.js b/ui/components/app/detected-token/detected-token.test.js new file mode 100644 index 000000000..7c7f9ee79 --- /dev/null +++ b/ui/components/app/detected-token/detected-token.test.js @@ -0,0 +1,45 @@ +import * as React from 'react'; +import { renderWithProvider, screen, fireEvent } from '../../../../test/jest'; +import configureStore from '../../../store/store'; +import testData from '../../../../.storybook/test-data'; + +import DetectedToken from './detected-token'; + +describe('DetectedToken', () => { + it('should render the detected token found page', async () => { + const store = configureStore(testData); + renderWithProvider(, store); + + expect(screen.getByText('0 LINK')).toBeInTheDocument(); + expect(screen.getByText('0 COMP')).toBeInTheDocument(); + expect(screen.getByText('0 FSW')).toBeInTheDocument(); + expect(screen.getAllByText('$0')).toHaveLength(3); + expect(screen.getAllByText('Token address:')).toHaveLength(3); + expect(screen.getByText('0x514...86CA')).toBeInTheDocument(); + expect(screen.getByText('0xc00...6888')).toBeInTheDocument(); + expect(screen.getByText('0xfff...26DB')).toBeInTheDocument(); + expect(screen.getAllByText('From token lists:')).toHaveLength(3); + expect(screen.getByText('coinGecko, oneInch')).toBeInTheDocument(); + expect(screen.getByText('+ 3 more')).toBeInTheDocument(); + fireEvent.click(screen.getByText('+ 3 more')); + expect( + screen.getByText('coinGecko, oneInch, paraswap, zapper, zerion.'), + ).toBeInTheDocument(); + expect(screen.getByText('bancor, cmc')).toBeInTheDocument(); + expect(screen.getByText('+ 8 more')).toBeInTheDocument(); + fireEvent.click(screen.getByText('+ 8 more')); + expect( + screen.getByText( + 'bancor, cmc, cryptocom, coinGecko, oneInch, paraswap, pmm, zapper, zerion, zeroEx.', + ), + ).toBeInTheDocument(); + expect(screen.getByText('aave, cmc')).toBeInTheDocument(); + expect(screen.getByText('+ 5 more')).toBeInTheDocument(); + fireEvent.click(screen.getByText('+ 5 more')); + expect( + screen.getByText( + 'aave, cmc, coinGecko, oneInch, paraswap, zapper, zerion.', + ), + ).toBeInTheDocument(); + }); +}); diff --git a/ui/components/app/detected-token/index.js b/ui/components/app/detected-token/index.js new file mode 100644 index 000000000..61c896efe --- /dev/null +++ b/ui/components/app/detected-token/index.js @@ -0,0 +1 @@ +export { default } from './detected-token'; diff --git a/ui/components/app/import-token-link/import-token-link.component.js b/ui/components/app/import-token-link/import-token-link.component.js index ce0fdcf75..a9b6a1a16 100644 --- a/ui/components/app/import-token-link/import-token-link.component.js +++ b/ui/components/app/import-token-link/import-token-link.component.js @@ -1,5 +1,5 @@ import React, { useContext } from 'react'; -import PropTypes from 'prop-types'; +import { useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { IMPORT_TOKEN_ROUTE } from '../../../helpers/constants/routes'; @@ -9,15 +9,24 @@ import { TEXT_ALIGN } from '../../../helpers/constants/design-system'; import { detectNewTokens } from '../../../store/actions'; import { MetaMetricsContext } from '../../../contexts/metametrics'; import { EVENT } from '../../../../shared/constants/metametrics'; +import { getIsMainnet, getIsTokenDetectionSupported } from '../../../selectors'; -export default function ImportTokenLink({ isMainnet }) { +export default function ImportTokenLink() { const trackEvent = useContext(MetaMetricsContext); const t = useI18nContext(); const history = useHistory(); + const isMainnet = useSelector(getIsMainnet); + const isTokenDetectionSupported = useSelector(getIsTokenDetectionSupported); + + const isTokenDetectionsupported = + isMainnet || + (process.env.TOKEN_DETECTION_V2 && isTokenDetectionSupported) || + Boolean(process.env.IN_TEST); + return ( - {isMainnet && ( + {isTokenDetectionsupported && ( <>
- -
  • - -
  • - -
    -`; - -exports[`GasCustomizationModalComponent renders the component with initial props 2`] = ` - -`; - -exports[`GasCustomizationModalComponent renders the component with initial props 3`] = ` - -`; - -exports[`GasCustomizationModalComponent renders the component with initial props 4`] = ` - -`; - -exports[`GasCustomizationModalComponent renders the component with initial props 5`] = ` - -`; diff --git a/ui/pages/swaps/swaps-gas-customization-modal/__snapshots__/swaps-gas-customization-modal.container.test.js.snap b/ui/pages/swaps/swaps-gas-customization-modal/__snapshots__/swaps-gas-customization-modal.container.test.js.snap deleted file mode 100644 index 91d0d69ba..000000000 --- a/ui/pages/swaps/swaps-gas-customization-modal/__snapshots__/swaps-gas-customization-modal.container.test.js.snap +++ /dev/null @@ -1,98 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`GasCustomizationModalContainer renders the component with initial props 1`] = ` -
    -
    - Customize Gas -
    -
    - Increasing fee may decrease processing times, but it is not guaranteed. -
    - - Close - -
      -
    • - -
    • -
    • - -
    • -
    -
    -`; - -exports[`GasCustomizationModalContainer renders the component with initial props 2`] = ` - -`; - -exports[`GasCustomizationModalContainer renders the component with initial props 3`] = ` - -`; - -exports[`GasCustomizationModalContainer renders the component with initial props 4`] = ` - -`; diff --git a/ui/pages/swaps/swaps-gas-customization-modal/index.js b/ui/pages/swaps/swaps-gas-customization-modal/index.js deleted file mode 100644 index a54988ab9..000000000 --- a/ui/pages/swaps/swaps-gas-customization-modal/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './swaps-gas-customization-modal.container'; diff --git a/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.js b/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.js deleted file mode 100644 index 848f34feb..000000000 --- a/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.js +++ /dev/null @@ -1,281 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import PageContainer from '../../../components/ui/page-container'; -import { Tabs, Tab } from '../../../components/ui/tabs'; -import { calcGasTotal } from '../../send/send.utils'; -import { sumHexWEIsToUnformattedFiat } from '../../../helpers/utils/conversions.util'; -import AdvancedGasInputs from '../../../components/app/gas-customization/advanced-gas-inputs'; -import BasicTabContent from '../../../components/app/gas-customization/gas-modal-page-container/basic-tab-content'; -import { GAS_ESTIMATE_TYPES } from '../../../helpers/constants/common'; -import { CUSTOM_GAS_ESTIMATE } from '../../../../shared/constants/gas'; -import { EVENT } from '../../../../shared/constants/metametrics'; - -export default class GasModalPageContainer extends Component { - static contextTypes = { - t: PropTypes.func, - trackEvent: PropTypes.func, - }; - - static propTypes = { - insufficientBalance: PropTypes.bool, - gasPriceButtonGroupProps: PropTypes.object, - infoRowProps: PropTypes.shape({ - originalTotalFiat: PropTypes.string, - originalTotalEth: PropTypes.string, - newTotalFiat: PropTypes.string, - newTotalEth: PropTypes.string, - sendAmount: PropTypes.string, - transactionFee: PropTypes.string, - extraInfoRow: PropTypes.shape({ - label: PropTypes.string, - value: PropTypes.string, - }), - }), - onSubmit: PropTypes.func, - cancelAndClose: PropTypes.func, - showCustomPriceTooLowWarning: PropTypes.bool, - disableSave: PropTypes.bool, - customGasLimitMessage: PropTypes.string, - customTotalSupplement: PropTypes.string, - usdConversionRate: PropTypes.number, - customGasPrice: PropTypes.string, - customGasLimit: PropTypes.string, - setSwapsCustomizationModalPrice: PropTypes.func, - setSwapsCustomizationModalLimit: PropTypes.func, - gasEstimateLoadingHasFailed: PropTypes.bool, - minimumGasLimit: PropTypes.number.isRequired, - }; - - state = { - gasSpeedType: '', - }; - - setGasSpeedType(gasEstimateType) { - if (gasEstimateType === GAS_ESTIMATE_TYPES.AVERAGE) { - this.setState({ gasSpeedType: 'average' }); - } else { - this.setState({ gasSpeedType: 'fast' }); - } - } - - renderBasicTabContent(gasPriceButtonGroupProps) { - return ( - { - this.setGasSpeedType(gasEstimateType); - this.props.setSwapsCustomizationModalPrice(gasPrice); - }, - }} - /> - ); - } - - renderAdvancedTabContent() { - const { - insufficientBalance, - showCustomPriceTooLowWarning, - infoRowProps: { transactionFee }, - customGasLimitMessage, - setSwapsCustomizationModalPrice, - setSwapsCustomizationModalLimit, - customGasPrice, - customGasLimit, - minimumGasLimit, - } = this.props; - - return ( -
    -
    -
    - {this.context.t('newTransactionFee')} -
    -
    -
    - {transactionFee} -
    -
    -
    -
    -
    - { - this.setState({ gasSpeedType: CUSTOM_GAS_ESTIMATE }); - setSwapsCustomizationModalPrice(updatedPrice); - }} - updateCustomGasLimit={(updatedLimit) => { - this.setState({ gasSpeedType: CUSTOM_GAS_ESTIMATE }); - setSwapsCustomizationModalLimit(updatedLimit); - }} - customGasPrice={customGasPrice} - customGasLimit={customGasLimit} - insufficientBalance={insufficientBalance} - customPriceIsSafe={!showCustomPriceTooLowWarning} - customGasLimitMessage={customGasLimitMessage} - minimumGasLimit={minimumGasLimit} - /> -
    -
    -
    - ); - } - - renderInfoRows( - newTotalFiat, - newTotalEth, - sendAmount, - transactionFee, - extraInfoRow, - ) { - return ( -
    -
    -
    - - {this.context.t('sendAmount')} - - - {sendAmount} - -
    -
    - - {this.context.t('transactionFee')} - - - {transactionFee} - -
    - {extraInfoRow && ( -
    - - {extraInfoRow.label} - - - {extraInfoRow.value} - -
    - )} -
    - - {this.context.t('newTotal')} - - - {newTotalEth} - -
    -
    - - {newTotalFiat} - -
    -
    -
    - ); - } - - renderTabs() { - const { - gasPriceButtonGroupProps, - infoRowProps: { - newTotalFiat, - newTotalEth, - sendAmount, - transactionFee, - extraInfoRow, - }, - gasEstimateLoadingHasFailed, - } = this.props; - - const basicTabInfo = { - name: this.context.t('basic'), - content: this.renderBasicTabContent({ - ...gasPriceButtonGroupProps, - handleGasPriceSelection: this.props.setSwapsCustomizationModalPrice, - }), - }; - const advancedTabInfo = { - name: this.context.t('advanced'), - content: this.renderAdvancedTabContent(), - }; - - const tabsToRender = gasEstimateLoadingHasFailed - ? [advancedTabInfo] - : [basicTabInfo, advancedTabInfo]; - - return ( - - {tabsToRender.map(({ name, content }, i) => ( - -
    - {content} - {this.renderInfoRows( - newTotalFiat, - newTotalEth, - sendAmount, - transactionFee, - extraInfoRow, - )} -
    -
    - ))} -
    - ); - } - - render() { - const { - cancelAndClose, - onSubmit, - disableSave, - customGasPrice, - customGasLimit, - } = this.props; - - return ( -
    - cancelAndClose()} - onClose={() => cancelAndClose()} - onSubmit={() => { - const newSwapGasTotal = calcGasTotal( - customGasLimit, - customGasPrice, - ); - - this.context.trackEvent({ - event: 'Gas Fees Changed', - category: EVENT.CATEGORIES.SWAPS, - properties: { - speed_set: this.state.gasSpeedType, - gas_fees: sumHexWEIsToUnformattedFiat( - [newSwapGasTotal, this.props.customTotalSupplement], - 'usd', - this.props.usdConversionRate, - )?.slice(1), - }, - }); - onSubmit(customGasLimit, customGasPrice); - }} - submitText={this.context.t('save')} - headerCloseText={this.context.t('close')} - hideCancel - /> -
    - ); - } -} diff --git a/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.test.js b/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.test.js deleted file mode 100644 index 5e8660608..000000000 --- a/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.test.js +++ /dev/null @@ -1,81 +0,0 @@ -import React from 'react'; - -import { renderWithProvider } from '../../../../test/jest'; -import GasCustomizationModalComponent from './swaps-gas-customization-modal.component'; - -const createProps = (customProps = {}) => { - return { - insufficientBalance: false, - onSubmit: jest.fn(), - cancelAndClose: jest.fn(), - minimumGasLimit: 100, - gasPriceButtonGroupProps: { - buttonDataLoading: false, - className: 'gas-price-button-group', - gasButtonInfo: [ - { - feeInPrimaryCurrency: '$0.52', - feeInSecondaryCurrency: '0.0048 ETH', - timeEstimate: '~ 1 min 0 sec', - priceInHexWei: '0xa1b2c3f', - gasEstimateType: 'FAST', - }, - { - feeInPrimaryCurrency: '$0.39', - feeInSecondaryCurrency: '0.004 ETH', - timeEstimate: '~ 1 min 30 sec', - priceInHexWei: '0xa1b2c39', - gasEstimateType: 'FAST', - }, - { - feeInPrimaryCurrency: '$0.30', - feeInSecondaryCurrency: '0.00354 ETH', - timeEstimate: '~ 2 min 1 sec', - priceInHexWei: '0xa1b2c30', - gasEstimateType: 'FAST', - }, - ], - handleGasPriceSelection: 'mockSelectionFunction', - noButtonActiveByDefault: true, - showCheck: true, - newTotalFiat: 'mockNewTotalFiat', - newTotalEth: 'mockNewTotalEth', - }, - infoRowProps: { - originalTotalFiat: 'mockOriginalTotalFiat', - originalTotalEth: 'mockOriginalTotalEth', - newTotalFiat: 'mockNewTotalFiat', - newTotalEth: 'mockNewTotalEth', - sendAmount: 'mockSendAmount', - transactionFee: 'mockTransactionFee', - extraInfoRow: { label: 'mockLabel', value: 'mockValue' }, - }, - ...customProps, - }; -}; - -describe('GasCustomizationModalComponent', () => { - it('renders the component with initial props', () => { - const props = createProps(); - const { getByText, getByTestId } = renderWithProvider( - , - ); - expect(getByTestId('page-container__header')).toMatchSnapshot(); - expect(getByText('$0.52')).toBeInTheDocument(); - expect(getByText('0.0048 ETH')).toBeInTheDocument(); - expect(getByTestId('button-group__button0')).toMatchSnapshot(); - expect(getByText('~ 1 min 30 sec')).toBeInTheDocument(); - expect(getByText('$0.39')).toBeInTheDocument(); - expect(getByText('0.004 ETH')).toBeInTheDocument(); - expect( - getByTestId('gas-modal-content__info-row__send-info'), - ).toMatchSnapshot(); - expect( - getByTestId('gas-modal-content__info-row__transaction-info'), - ).toMatchSnapshot(); - expect( - getByTestId('gas-modal-content__info-row__total-info'), - ).toMatchSnapshot(); - expect(getByText('Save')).toBeInTheDocument(); - }); -}); diff --git a/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.container.js b/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.container.js deleted file mode 100644 index e4e78009b..000000000 --- a/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.container.js +++ /dev/null @@ -1,186 +0,0 @@ -import { connect } from 'react-redux'; -import BigNumber from 'bignumber.js'; -import { hideModal, customSwapsGasParamsUpdated } from '../../../store/actions'; -import { - conversionRateSelector as getConversionRate, - getCurrentCurrency, - getCurrentEthBalance, - getDefaultActiveButtonIndex, - getRenderableGasButtonData, - getUSDConversionRate, - getSwapsDefaultToken, -} from '../../../selectors'; -import { getNativeCurrency } from '../../../ducks/metamask/metamask'; - -import { - getSwapsCustomizationModalPrice, - getSwapsCustomizationModalLimit, - swapGasEstimateLoadingHasFailed, - swapGasPriceEstimateIsLoading, - getSwapGasPriceEstimateData, - swapCustomGasModalPriceEdited, - swapCustomGasModalLimitEdited, - shouldShowCustomPriceTooLowWarning, - swapCustomGasModalClosed, -} from '../../../ducks/swaps/swaps'; -import { - addHexes, - getValueFromWeiHex, - sumHexWEIsToRenderableFiat, -} from '../../../helpers/utils/conversions.util'; -import { formatETHFee } from '../../../helpers/utils/formatters'; -import { calcGasTotal, isBalanceSufficient } from '../../send/send.utils'; -import SwapsGasCustomizationModalComponent from './swaps-gas-customization-modal.component'; - -const mapStateToProps = (state) => { - const currentCurrency = getCurrentCurrency(state); - const conversionRate = getConversionRate(state); - const nativeCurrencySymbol = getNativeCurrency(state); - const { symbol: swapsDefaultCurrencySymbol } = getSwapsDefaultToken(state); - const usedCurrencySymbol = nativeCurrencySymbol || swapsDefaultCurrencySymbol; - - const { modalState: { props: modalProps } = {} } = state.appState.modal || {}; - const { - value, - customGasLimitMessage = '', - customTotalSupplement = '', - extraInfoRow = null, - initialGasPrice, - initialGasLimit, - minimumGasLimit, - } = modalProps; - const buttonDataLoading = swapGasPriceEstimateIsLoading(state); - - const swapsCustomizationModalPrice = getSwapsCustomizationModalPrice(state); - const swapsCustomizationModalLimit = getSwapsCustomizationModalLimit(state); - - const customGasPrice = swapsCustomizationModalPrice || initialGasPrice; - const customGasLimit = swapsCustomizationModalLimit || initialGasLimit; - - const customGasTotal = calcGasTotal(customGasLimit, customGasPrice); - - const gasEstimates = getSwapGasPriceEstimateData(state); - const gasEstimatesInNewFormat = { - low: gasEstimates.safeLow, - medium: gasEstimates.average, - high: gasEstimates.fast, - }; - - const { averageEstimateData, fastEstimateData } = getRenderableGasButtonData( - gasEstimatesInNewFormat, - customGasLimit, - true, - conversionRate, - currentCurrency, - usedCurrencySymbol, - ); - const gasButtonInfo = [averageEstimateData, fastEstimateData]; - - const newTotalFiat = sumHexWEIsToRenderableFiat( - [value, customGasTotal, customTotalSupplement], - currentCurrency, - conversionRate, - ); - - const balance = getCurrentEthBalance(state); - - const newTotalEth = sumHexWEIsToRenderableEth( - [value, customGasTotal, customTotalSupplement], - usedCurrencySymbol, - ); - - const sendAmount = sumHexWEIsToRenderableEth( - [value, '0x0'], - usedCurrencySymbol, - ); - - const insufficientBalance = !isBalanceSufficient({ - amount: value, - gasTotal: customGasTotal, - balance, - conversionRate, - }); - - const customGasLimitTooLow = new BigNumber(customGasLimit, 16).lt( - minimumGasLimit, - 10, - ); - - return { - customGasPrice, - customGasLimit, - showCustomPriceTooLowWarning: shouldShowCustomPriceTooLowWarning(state), - gasPriceButtonGroupProps: { - buttonDataLoading, - defaultActiveButtonIndex: getDefaultActiveButtonIndex( - gasButtonInfo, - customGasPrice, - ), - gasButtonInfo, - }, - infoRowProps: { - originalTotalFiat: sumHexWEIsToRenderableFiat( - [value, customGasTotal, customTotalSupplement], - currentCurrency, - conversionRate, - ), - originalTotalEth: sumHexWEIsToRenderableEth( - [value, customGasTotal, customTotalSupplement], - usedCurrencySymbol, - ), - newTotalFiat, - newTotalEth, - transactionFee: sumHexWEIsToRenderableEth( - ['0x0', customGasTotal], - usedCurrencySymbol, - ), - sendAmount, - extraInfoRow, - }, - gasEstimateLoadingHasFailed: swapGasEstimateLoadingHasFailed(state), - insufficientBalance, - customGasLimitMessage, - customTotalSupplement, - usdConversionRate: getUSDConversionRate(state), - disableSave: insufficientBalance || customGasLimitTooLow, - minimumGasLimit, - }; -}; - -const mapDispatchToProps = (dispatch) => { - return { - cancelAndClose: () => { - dispatch(swapCustomGasModalClosed()); - dispatch(hideModal()); - }, - onSubmit: async (gasLimit, gasPrice) => { - await dispatch(customSwapsGasParamsUpdated(gasLimit, gasPrice)); - dispatch(swapCustomGasModalClosed()); - dispatch(hideModal()); - }, - setSwapsCustomizationModalPrice: (newPrice) => { - dispatch(swapCustomGasModalPriceEdited(newPrice)); - }, - setSwapsCustomizationModalLimit: (newLimit) => { - dispatch(swapCustomGasModalLimitEdited(newLimit)); - }, - }; -}; - -export default connect( - mapStateToProps, - mapDispatchToProps, -)(SwapsGasCustomizationModalComponent); - -function sumHexWEIsToRenderableEth(hexWEIs, currencySymbol = 'ETH') { - const hexWEIsSum = hexWEIs.filter(Boolean).reduce(addHexes); - return formatETHFee( - getValueFromWeiHex({ - value: hexWEIsSum, - fromCurrency: currencySymbol, - toCurrency: currencySymbol, - numberOfDecimals: 6, - }), - currencySymbol, - ); -} diff --git a/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.container.test.js b/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.container.test.js deleted file mode 100644 index 957458b39..000000000 --- a/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.container.test.js +++ /dev/null @@ -1,34 +0,0 @@ -import React from 'react'; -import configureMockStore from 'redux-mock-store'; - -import { - renderWithProvider, - createSwapsMockStore, -} from '../../../../test/jest'; -import GasCustomizationModalContainer from '.'; - -describe('GasCustomizationModalContainer', () => { - it('renders the component with initial props', () => { - const store = configureMockStore()(createSwapsMockStore()); - const { getByText, getByTestId } = renderWithProvider( - , - store, - ); - expect(getByTestId('page-container__header')).toMatchSnapshot(); - expect(getByText('Basic')).toBeInTheDocument(); - expect(getByText('Advanced')).toBeInTheDocument(); - expect(getByText('Estimated Processing Times')).toBeInTheDocument(); - expect(getByText('Send Amount')).toBeInTheDocument(); - expect(getByText('Transaction fee')).toBeInTheDocument(); - expect( - getByTestId('gas-modal-content__info-row__send-info'), - ).toMatchSnapshot(); - expect( - getByTestId('gas-modal-content__info-row__transaction-info'), - ).toMatchSnapshot(); - expect( - getByTestId('gas-modal-content__info-row__total-info'), - ).toMatchSnapshot(); - expect(getByText('Save')).toBeInTheDocument(); - }); -}); diff --git a/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.stories.js b/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.stories.js deleted file mode 100644 index 4be1e5fcb..000000000 --- a/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.stories.js +++ /dev/null @@ -1,253 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { Provider } from 'react-redux'; -import configureStore from '../../../store/store'; -import testData from '../../../../.storybook/test-data'; -import { formatETHFee } from '../../../helpers/utils/formatters'; -import { - addHexes, - getValueFromWeiHex, - getWeiHexFromDecimalValue, - sumHexWEIsToRenderableFiat, -} from '../../../helpers/utils/conversions.util'; -import { ETH } from '../../../helpers/constants/common'; -import { calcGasTotal, isBalanceSufficient } from '../../send/send.utils'; -import { conversionLessThan } from '../../../../shared/modules/conversion.utils'; -import GasModalPageContainer from './swaps-gas-customization-modal.component'; -// Using Test Data For Redux -const store = configureStore(testData); - -export default { - title: 'Pages/Swaps/GasModalPageContainer', - id: __filename, - component: GasModalPageContainer, - argTypes: { - sendAmountArg: { - name: 'Send Amount (this should be static)', - control: { type: 'number', min: 0, step: 0.01 }, - }, - walletBalance: { - name: 'Wallet Balance (this should be static)', - control: { type: 'number', min: 0, step: 0.01 }, - }, - averageGasPrice: { - name: 'Average Gas Price', - control: { type: 'number', min: 0, step: 0.01 }, - }, - insufficientBalance: { - table: { - disable: true, - }, - }, - gasPriceButtonGroupProps: { - table: { - disable: true, - }, - }, - infoRowProps: { - table: { - disable: true, - }, - }, - onSubmit: { - table: { - disable: true, - }, - }, - cancelAndClose: { - table: { - disable: true, - }, - }, - showCustomPriceTooLowWarning: { - table: { - disable: true, - }, - }, - disableSave: { - table: { - disable: true, - }, - }, - customGasLimitMessage: { - table: { - disable: true, - }, - }, - usdConversionRate: { - table: { - disable: true, - }, - }, - customGasPrice: { - table: { - disable: true, - }, - }, - customGasLimit: { - table: { - disable: true, - }, - }, - setSwapsCustomizationModalLimit: { - table: { - disable: true, - }, - }, - setSwapsCustomizationModalPrice: { - table: { - disable: true, - }, - }, - customTotalSupplement: { - table: { - disable: true, - }, - }, - gasEstimateLoadingHasFailed: { - table: { - disable: true, - }, - }, - minimumGasLimit: { - table: { - disable: true, - }, - }, - }, - args: { - sendAmountArg: 0.01, - walletBalance: 10, - averageGasPrice: 2, - }, - decorators: [(story) => {story()}], -}; - -// Convert Hex Wei to Decimal ETH -const sumHexWEIsToRenderableEth = (hexWEIs, currencySymbol = 'ETH') => { - const hexWEIsSum = hexWEIs.filter(Boolean).reduce(addHexes); - return formatETHFee( - getValueFromWeiHex({ - value: hexWEIsSum, - fromCurrency: currencySymbol, - toCurrency: currencySymbol, - numberOfDecimals: 6, - }), - currencySymbol, - ); -}; - -export const DefaultStory = (args) => { - const { sendAmountArg, walletBalance, averageGasPrice } = args; - - const hexWei = getWeiHexFromDecimalValue({ - value: sendAmountArg, - fromCurrency: ETH, - fromDenomination: ETH, - }); - - // ETH Balance - const balanceHexWei = getWeiHexFromDecimalValue({ - value: walletBalance, - fromCurrency: ETH, - fromDenomination: ETH, - }); - - const sendAmount = sumHexWEIsToRenderableEth([hexWei, '0x0']); - const [gasLimit, setGasLimit] = useState('5208'); - const [gasPrice, setGasPrice] = useState('ee6b2800'); - const [transactionFee, setTransactionFee] = useState(''); - const [totalETH, setTotalETH] = useState(''); - const [totalFiat, setTotalFiat] = useState(''); - const [isInsufficientBalance, setIsInsufficientBalance] = useState(false); - - const { metamask } = store.getState(); - const { currentCurrency, conversionRate } = metamask; - - useEffect(() => { - // Transfer Fee - const customGasTotal = calcGasTotal(gasLimit, gasPrice); - setTransactionFee(sumHexWEIsToRenderableEth(['0x0', customGasTotal])); - - // New Total ETH - setTotalETH(sumHexWEIsToRenderableEth([hexWei, customGasTotal, ''])); - - // New Total Fiat - setTotalFiat( - sumHexWEIsToRenderableFiat( - [hexWei, customGasTotal, ''], - currentCurrency, - conversionRate, - ), - ); - - // Check If Balance is Sufficient - setIsInsufficientBalance( - !isBalanceSufficient({ - amount: hexWei, - gasTotal: customGasTotal, - balance: balanceHexWei, - conversionRate, - }), - ); - }, [ - gasPrice, - gasLimit, - hexWei, - totalETH, - conversionRate, - currentCurrency, - totalFiat, - balanceHexWei, - ]); - - // Check If Gas Price Is Too Low - const shouldShowCustomPriceTooLowWarning = () => { - const customGasPrice = gasPrice; - - if (!customGasPrice || averageGasPrice === undefined) { - return false; - } - - const customPriceRisksSwapFailure = conversionLessThan( - { - value: customGasPrice, - fromNumericBase: 'hex', - fromDenomination: 'WEI', - toDenomination: 'GWEI', - }, - { value: averageGasPrice, fromNumericBase: 'dec' }, - ); - - return customPriceRisksSwapFailure; - }; - - return ( - { - setGasPrice(newPrice); - }} - setSwapsCustomizationModalLimit={(newLimit) => { - setGasLimit(newLimit); - }} - customGasPrice={gasPrice} - customGasLimit={gasLimit} - disableSave={ - isInsufficientBalance || shouldShowCustomPriceTooLowWarning() - } - /> - ); -}; - -DefaultStory.storyName = 'Default'; diff --git a/ui/pages/swaps/view-quote/view-quote.js b/ui/pages/swaps/view-quote/view-quote.js index a067e5dea..e1a098b2b 100644 --- a/ui/pages/swaps/view-quote/view-quote.js +++ b/ui/pages/swaps/view-quote/view-quote.js @@ -19,7 +19,6 @@ import { usePrevious } from '../../../hooks/usePrevious'; import { useGasFeeInputs } from '../../../hooks/gasFeeInput/useGasFeeInputs'; import { MetaMetricsContext } from '../../../contexts/metametrics'; import FeeCard from '../fee-card'; -import EditGasPopover from '../../../components/app/edit-gas-popover/edit-gas-popover.component'; import { FALLBACK_GAS_MULTIPLIER, getQuotes, @@ -89,16 +88,12 @@ import { } from '../../../helpers/utils/token-util'; import { decimalToHex, - hexToDecimal, - getValueFromWeiHex, decGWEIToHexWEI, hexWEIToDecGWEI, addHexes, } from '../../../helpers/utils/conversions.util'; import { GasFeeContextProvider } from '../../../contexts/gasFee'; import { TransactionModalContextProvider } from '../../../contexts/transaction-modal'; -import AdvancedGasFeePopover from '../../../components/app/advanced-gas-fee-popover'; -import EditGasFeePopover from '../../../components/app/edit-gas-fee-popover'; import MainQuoteSummary from '../main-quote-summary'; import { calcGasTotal } from '../../send/send.utils'; import { getCustomTxParamsData } from '../../confirm-approve/confirm-approve.util'; @@ -137,7 +132,6 @@ export default function ViewQuote() { const [selectQuotePopoverShown, setSelectQuotePopoverShown] = useState(false); const [warningHidden, setWarningHidden] = useState(false); const [originalApproveAmount, setOriginalApproveAmount] = useState(null); - const [showEditGasPopover, setShowEditGasPopover] = useState(false); // We need to have currentTimestamp in state, otherwise it would change with each rerender. const [currentTimestamp] = useState(Date.now()); @@ -391,7 +385,6 @@ export default function ViewQuote() { rawEthFee: maxRawEthFee, feeInUsd: maxFeeInUsd, } = renderableMaxFees; - const { nonGasFee } = renderableMaxFees; additionalTrackingParams.reg_tx_max_fee_in_usd = Number(maxFeeInUsd); additionalTrackingParams.reg_tx_max_fee_in_eth = Number(maxRawEthFee); @@ -678,53 +671,6 @@ export default function ViewQuote() { ); }; - const nonGasFeeIsPositive = new BigNumber(nonGasFee, 16).gt(0); - const approveGasTotal = calcGasTotal( - approveGas || '0x0', - networkAndAccountSupports1559 ? baseAndPriorityFeePerGas : gasPrice, - ); - const extraNetworkFeeTotalInHexWEI = new BigNumber(nonGasFee, 16) - .plus(approveGasTotal, 16) - .toString(16); - const extraNetworkFeeTotalInEth = getValueFromWeiHex({ - value: extraNetworkFeeTotalInHexWEI, - toDenomination: 'ETH', - numberOfDecimals: 4, - }); - - let extraInfoRowLabel = ''; - if (approveGas && nonGasFeeIsPositive) { - extraInfoRowLabel = t('approvalAndAggregatorTxFeeCost'); - } else if (approveGas) { - extraInfoRowLabel = t('approvalTxGasCost'); - } else if (nonGasFeeIsPositive) { - extraInfoRowLabel = t('aggregatorFeeCost'); - } - - const onFeeCardMaxRowClick = () => { - networkAndAccountSupports1559 - ? setShowEditGasPopover(true) - : dispatch( - showModal({ - name: 'CUSTOMIZE_METASWAP_GAS', - value: tradeValue, - customGasLimitMessage: approveGas - ? t('extraApprovalGas', [hexToDecimal(approveGas)]) - : '', - customTotalSupplement: approveGasTotal, - extraInfoRow: extraInfoRowLabel - ? { - label: extraInfoRowLabel, - value: `${extraNetworkFeeTotalInEth} ${nativeCurrencySymbol}`, - } - : null, - initialGasPrice: gasPrice, - initialGasLimit: maxGasLimit, - minimumGasLimit: new BigNumber(nonCustomMaxGasLimit, 16).toNumber(), - }), - ); - }; - const actionableBalanceErrorMessage = tokenBalanceUnavailable ? t('swapTokenBalanceUnavailable', [sourceTokenSymbol]) : t('swapApproveNeedMoreTokens', [ @@ -863,10 +809,6 @@ export default function ViewQuote() { isSwapButtonDisabled, ]); - const onCloseEditGasPopover = () => { - setShowEditGasPopover(false); - }; - useEffect(() => { // Thanks to the next line we will only do quotes polling 3 times before showing a Quote Timeout modal. dispatch(setSwapsQuotesPollingLimitEnabled(true)); @@ -928,25 +870,6 @@ export default function ViewQuote() { /> )} - {!supportsEIP1559V2 && - showEditGasPopover && - networkAndAccountSupports1559 && ( - - )} - {supportsEIP1559V2 && ( - <> - - - - )} -
    Date: Wed, 11 May 2022 13:14:53 -0700 Subject: [PATCH 040/127] Fix Snaps view search (#14693) Closes #14687 Snap IDs were not properly encoded (and decoded) as URI components in the Snaps view search implementation. This ensures that they are. --- ui/pages/settings/flask/snaps-list-tab/snap-list-tab.js | 5 +---- ui/pages/settings/flask/view-snap/view-snap.js | 8 +++----- ui/selectors/selectors.js | 4 +--- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/ui/pages/settings/flask/snaps-list-tab/snap-list-tab.js b/ui/pages/settings/flask/snaps-list-tab/snap-list-tab.js index d0c4f3306..842c10bc5 100644 --- a/ui/pages/settings/flask/snaps-list-tab/snap-list-tab.js +++ b/ui/pages/settings/flask/snaps-list-tab/snap-list-tab.js @@ -24,10 +24,7 @@ const SnapListTab = () => { const snaps = useSelector(getSnaps); const settingsRef = useRef(); const onClick = (snap) => { - const route = `${SNAPS_VIEW_ROUTE}/${window.btoa( - unescape(encodeURIComponent(snap.id)), - )}`; - history.push(route); + history.push(`${SNAPS_VIEW_ROUTE}/${encodeURIComponent(snap.id)}`); }; const onToggle = (snap) => { if (snap.enabled) { diff --git a/ui/pages/settings/flask/view-snap/view-snap.js b/ui/pages/settings/flask/view-snap/view-snap.js index f946ca0a9..eab873053 100644 --- a/ui/pages/settings/flask/view-snap/view-snap.js +++ b/ui/pages/settings/flask/view-snap/view-snap.js @@ -32,14 +32,12 @@ function ViewSnap() { const history = useHistory(); const location = useLocation(); const { pathname } = location; - const pathNameTail = pathname.match(/[^/]+$/u)[0]; + // The snap ID is in URI-encoded form in the last path segment of the URL. + const decodedSnapId = decodeURIComponent(pathname.match(/[^/]+$/u)[0]); const snaps = useSelector(getSnaps); const snap = Object.entries(snaps) .map(([_, snapState]) => snapState) - .find((snapState) => { - const decoded = decodeURIComponent(escape(window.atob(pathNameTail))); - return snapState.id === decoded; - }); + .find((snapState) => snapState.id === decodedSnapId); const [isShowingRemoveWarning, setIsShowingRemoveWarning] = useState(false); diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index 016fe796e..a397c125d 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -717,9 +717,7 @@ export const getSnapsRouteObjects = createSelector(getSnaps, (snaps) => { tabMessage: () => snap.manifest.proposedName, descriptionMessage: () => snap.manifest.description, sectionMessage: () => snap.manifest.description, - route: `${SNAPS_VIEW_ROUTE}/${window.btoa( - unescape(encodeURIComponent(snap.id)), - )}`, + route: `${SNAPS_VIEW_ROUTE}/${encodeURIComponent(snap.id)}`, icon: 'fa fa-flask', }; }); From 6c757ab5e043fcef905bc5e469e81f75b2044a90 Mon Sep 17 00:00:00 2001 From: Niranjana Binoy <43930900+NiranjanaBinoy@users.noreply.github.com> Date: Wed, 11 May 2022 16:27:58 -0400 Subject: [PATCH 041/127] Event tracking for Token Detection V2 (#14441) --- app/scripts/controllers/detect-tokens.js | 20 ++++++ app/scripts/controllers/metametrics.js | 1 + app/scripts/controllers/metametrics.test.js | 6 ++ .../controllers/transactions/index.test.js | 14 ++--- .../handlers/add-ethereum-chain.js | 2 +- app/scripts/metamask-controller.js | 3 + shared/constants/metametrics.js | 32 +++++++++- .../detected-tokens-link.js | 25 +++++++- .../detected-tokens-link.stories.js | 28 +++++++++ .../detected-tokens-link.test.js | 32 ++++++++++ .../detected-token-selection-popover.js | 19 +++++- .../app/detected-token/detected-token.js | 61 ++++++++++++++----- .../app/wallet-overview/eth-overview.js | 2 +- .../app/wallet-overview/token-overview.js | 2 +- ui/pages/add-collectible/add-collectible.js | 5 +- .../confirm-add-suggested-token.js | 6 +- .../confirm-import-token.js | 11 ++-- 17 files changed, 231 insertions(+), 38 deletions(-) create mode 100644 ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.stories.js create mode 100644 ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.test.js diff --git a/app/scripts/controllers/detect-tokens.js b/app/scripts/controllers/detect-tokens.js index 40ccfb5f0..d9cfe9b14 100644 --- a/app/scripts/controllers/detect-tokens.js +++ b/app/scripts/controllers/detect-tokens.js @@ -6,6 +6,9 @@ import { MINUTE } from '../../../shared/constants/time'; import { MAINNET_CHAIN_ID } from '../../../shared/constants/network'; import { isTokenDetectionEnabledForNetwork } from '../../../shared/modules/network.utils'; import { isEqualCaseInsensitive } from '../../../shared/modules/string-utils'; +import { TOKEN_STANDARDS } from '../../../ui/helpers/constants/common'; +import { ASSET_TYPES } from '../../../shared/constants/transaction'; +import { EVENT, EVENT_NAMES } from '../../../shared/constants/metametrics'; // By default, poll every 3 minutes const DEFAULT_INTERVAL = MINUTE * 3; @@ -26,6 +29,7 @@ export default class DetectTokensController { * @param config.tokenList * @param config.tokensController * @param config.assetsContractController + * @param config.trackMetaMetricsEvent */ constructor({ interval = DEFAULT_INTERVAL, @@ -35,6 +39,7 @@ export default class DetectTokensController { tokenList, tokensController, assetsContractController = null, + trackMetaMetricsEvent, } = {}) { this.assetsContractController = assetsContractController; this.tokensController = tokensController; @@ -51,6 +56,7 @@ export default class DetectTokensController { this.detectedTokens = process.env.TOKEN_DETECTION_V2 ? this.tokensController?.state.detectedTokens : []; + this._trackMetaMetricsEvent = trackMetaMetricsEvent; preferences?.store.subscribe(({ selectedAddress, useTokenDetection }) => { if ( @@ -162,6 +168,7 @@ export default class DetectTokensController { let tokensWithBalance = []; if (process.env.TOKEN_DETECTION_V2) { + const eventTokensDetails = []; if (result) { const nonZeroTokenAddresses = Object.keys(result); for (const nonZeroTokenAddress of nonZeroTokenAddresses) { @@ -172,6 +179,9 @@ export default class DetectTokensController { iconUrl, aggregators, } = tokenList[nonZeroTokenAddress]; + + eventTokensDetails.push(`${symbol} - ${address}`); + tokensWithBalance.push({ address, symbol, @@ -180,7 +190,17 @@ export default class DetectTokensController { aggregators, }); } + if (tokensWithBalance.length > 0) { + this._trackMetaMetricsEvent({ + event: EVENT_NAMES.TOKEN_DETECTED, + category: EVENT.CATEGORIES.WALLET, + properties: { + tokens: eventTokensDetails, + token_standard: TOKEN_STANDARDS.ERC20, + asset_type: ASSET_TYPES.TOKEN, + }, + }); await this.tokensController.addDetectedTokens(tokensWithBalance); } } diff --git a/app/scripts/controllers/metametrics.js b/app/scripts/controllers/metametrics.js index 856461a57..8c1ecbca1 100644 --- a/app/scripts/controllers/metametrics.js +++ b/app/scripts/controllers/metametrics.js @@ -571,6 +571,7 @@ export default class MetaMetricsController { [TRAITS.OPENSEA_API_ENABLED]: metamaskState.openSeaEnabled, [TRAITS.THREE_BOX_ENABLED]: metamaskState.threeBoxSyncingAllowed, [TRAITS.THEME]: metamaskState.theme || 'default', + [TRAITS.TOKEN_DETECTION_ENABLED]: metamaskState.useTokenDetection, }; if (!this.previousTraits) { diff --git a/app/scripts/controllers/metametrics.test.js b/app/scripts/controllers/metametrics.test.js index 868117e71..76982e445 100644 --- a/app/scripts/controllers/metametrics.test.js +++ b/app/scripts/controllers/metametrics.test.js @@ -682,6 +682,7 @@ describe('MetaMetricsController', function () { threeBoxSyncingAllowed: false, useCollectibleDetection: false, theme: 'default', + useTokenDetection: true, }); assert.deepEqual(traits, { @@ -696,6 +697,7 @@ describe('MetaMetricsController', function () { [TRAITS.OPENSEA_API_ENABLED]: true, [TRAITS.THREE_BOX_ENABLED]: false, [TRAITS.THEME]: 'default', + [TRAITS.TOKEN_DETECTION_ENABLED]: true, }); }); @@ -717,6 +719,7 @@ describe('MetaMetricsController', function () { threeBoxSyncingAllowed: false, useCollectibleDetection: false, theme: 'default', + useTokenDetection: true, }); const updatedTraits = metaMetricsController._buildUserTraitsObject({ @@ -737,6 +740,7 @@ describe('MetaMetricsController', function () { threeBoxSyncingAllowed: false, useCollectibleDetection: false, theme: 'default', + useTokenDetection: true, }); assert.deepEqual(updatedTraits, { @@ -765,6 +769,7 @@ describe('MetaMetricsController', function () { threeBoxSyncingAllowed: false, useCollectibleDetection: true, theme: 'default', + useTokenDetection: true, }); const updatedTraits = metaMetricsController._buildUserTraitsObject({ @@ -783,6 +788,7 @@ describe('MetaMetricsController', function () { threeBoxSyncingAllowed: false, useCollectibleDetection: true, theme: 'default', + useTokenDetection: true, }); assert.equal(updatedTraits, null); diff --git a/app/scripts/controllers/transactions/index.test.js b/app/scripts/controllers/transactions/index.test.js index 5493728a3..a324c56fe 100644 --- a/app/scripts/controllers/transactions/index.test.js +++ b/app/scripts/controllers/transactions/index.test.js @@ -1470,7 +1470,7 @@ describe('Transaction Controller', function () { gas_edit_type: 'none', network: '42', referrer: ORIGIN_METAMASK, - source: 'user', + source: EVENT.SOURCE.TRANSACTION.USER, type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, @@ -1549,7 +1549,7 @@ describe('Transaction Controller', function () { gas_edit_type: 'none', network: '42', referrer: ORIGIN_METAMASK, - source: 'user', + source: EVENT.SOURCE.TRANSACTION.USER, type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, @@ -1638,7 +1638,7 @@ describe('Transaction Controller', function () { gas_edit_type: 'none', network: '42', referrer: 'other', - source: 'dapp', + source: EVENT.SOURCE.TRANSACTION.DAPP, type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, @@ -1719,7 +1719,7 @@ describe('Transaction Controller', function () { gas_edit_type: 'none', network: '42', referrer: 'other', - source: 'dapp', + source: EVENT.SOURCE.TRANSACTION.DAPP, type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, @@ -1800,7 +1800,7 @@ describe('Transaction Controller', function () { gas_edit_type: 'none', network: '42', referrer: 'other', - source: 'dapp', + source: EVENT.SOURCE.TRANSACTION.DAPP, type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, @@ -1859,7 +1859,7 @@ describe('Transaction Controller', function () { properties: { network: '42', referrer: 'other', - source: 'dapp', + source: EVENT.SOURCE.TRANSACTION.DAPP, type: TRANSACTION_TYPES.SIMPLE_SEND, chain_id: '0x2a', eip_1559_version: '0', @@ -1936,7 +1936,7 @@ describe('Transaction Controller', function () { gas_edit_type: 'none', network: '42', referrer: 'other', - source: 'dapp', + source: EVENT.SOURCE.TRANSACTION.DAPP, type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, diff --git a/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js b/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js index 519b130bb..82ac2cf84 100644 --- a/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js +++ b/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js @@ -265,7 +265,7 @@ async function addEthereumChainHandler( network: firstValidRPCUrl, symbol: ticker, block_explorer_url: firstValidBlockExplorerUrl, - source: 'dapp', + source: EVENT.SOURCE.TRANSACTION.DAPP, }, }); diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 5e70d5787..e1442320b 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -713,6 +713,9 @@ export default class MetamaskController extends EventEmitter { network: this.networkController, keyringMemStore: this.keyringController.memStore, tokenList: this.tokenListController, + trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind( + this.metaMetricsController, + ), })) : (this.detectTokensController = new DetectTokensController({ preferences: this.preferencesController, diff --git a/shared/constants/metametrics.js b/shared/constants/metametrics.js index f2dc0f6f0..d2c9e6663 100644 --- a/shared/constants/metametrics.js +++ b/shared/constants/metametrics.js @@ -178,6 +178,8 @@ * @property {'three_box_enabled'} THREE_BOX_ENABLED - when 3box feature is * toggled we identify the 3box_enabled trait * @property {'theme'} THEME - when the user's theme changes we identify the theme trait + * @property {'token_detection_enabled'} TOKEN_DETECTION_ENABLED - when token detection feature is toggled we + * identify the token_detection_enabled trait */ /** @@ -197,6 +199,7 @@ export const TRAITS = { OPENSEA_API_ENABLED: 'opensea_api_enabled', THREE_BOX_ENABLED: 'three_box_enabled', THEME: 'theme', + TOKEN_DETECTION_ENABLED: 'token_detection_enabled', }; /** @@ -222,6 +225,7 @@ export const TRAITS = { * @property {boolean} [three_box_enabled] - does the user have 3box sync * enabled? * @property {string} [theme] - which theme the user has selected + * @property {boolean} [token_detection_enabled] - does the user have token detection is enabled? */ // Mixpanel converts the zero address value to a truly anonymous event, which @@ -265,10 +269,15 @@ export const REJECT_NOTFICIATION_CLOSE_SIG = */ export const EVENT_NAMES = { - SIGNATURE_REQUESTED: 'Signature Requested', ENCRYPTION_PUBLIC_KEY_REQUESTED: 'Encryption Public Key Requested', DECRYPTION_REQUESTED: 'Decryption Requested', PERMISSIONS_REQUESTED: 'Permissions Requested', + SIGNATURE_REQUESTED: 'Signature Requested', + TOKEN_ADDED: 'Token Added', + TOKEN_DETECTED: 'Token Detected', + TOKEN_HIDDEN: 'Token Hidden', + TOKEN_IMPORT_CANCELED: 'Token Import Canceled', + TOKEN_IMPORT_CLICKED: 'Token Import Clicked', }; export const EVENT = { @@ -288,4 +297,25 @@ export const EVENT = { TRANSACTIONS: 'Transactions', WALLET: 'Wallet', }, + SOURCE: { + SWAPS: { + MAIN_VIEW: 'Main View', + TOKEN_VIEW: 'Token View', + }, + TRANSACTION: { + USER: 'user', + DAPP: 'dapp', + }, + TOKEN: { + CUSTOM: 'custom', + DETECTED: 'detected', + DAPP: 'dapp', + LIST: 'list', + }, + }, + LOCATION: { + TOKEN_DETECTION: 'token_detection', + TOKEN_MENU: 'token_menu', + TOKEN_DETAILS: 'token_details', + }, }; diff --git a/ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.js b/ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.js index d7a05559e..f250067bb 100644 --- a/ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.js +++ b/ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useContext } from 'react'; import { useSelector } from 'react-redux'; import PropTypes from 'prop-types'; import classNames from 'classnames'; @@ -7,11 +7,32 @@ import Box from '../../../ui/box/box'; import Button from '../../../ui/button'; import { useI18nContext } from '../../../../hooks/useI18nContext'; import { getDetectedTokensInCurrentNetwork } from '../../../../selectors'; +import { MetaMetricsContext } from '../../../../contexts/metametrics'; +import { + EVENT, + EVENT_NAMES, +} from '../../../../../shared/constants/metametrics'; const DetectedTokensLink = ({ className = '', setShowDetectedTokens }) => { const t = useI18nContext(); + const trackEvent = useContext(MetaMetricsContext); + const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork); + const detectedTokensDetails = detectedTokens.map( + ({ address, symbol }) => `${symbol} - ${address}`, + ); + const onClick = () => { + setShowDetectedTokens(true); + trackEvent({ + event: EVENT_NAMES.TOKEN_IMPORT_CLICKED, + category: EVENT.CATEGORIES.WALLET, + properties: { + source: EVENT.SOURCE.TOKEN.DETECTED, + tokens: detectedTokensDetails, + }, + }); + }; return ( { diff --git a/ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.stories.js b/ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.stories.js new file mode 100644 index 000000000..f7cbf629d --- /dev/null +++ b/ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.stories.js @@ -0,0 +1,28 @@ +import React from 'react'; +import { Provider } from 'react-redux'; + +import testData from '../../../../../.storybook/test-data'; +import configureStore from '../../../../store/store'; +import DetectedTokensLink from './detected-tokens-link'; + +const store = configureStore(testData); + +export default { + title: 'Components/App/AssetList/DetectedTokensLink', + decorators: [(story) => {story()}], + id: __filename, + argTypes: { + setShowDetectedTokens: { control: 'func' }, + }, + args: { + setShowDetectedTokens: 'setShowDetectedTokensSpy', + }, +}; + +const Template = (args) => { + return ; +}; + +export const DefaultStory = Template.bind({}); + +DefaultStory.storyName = 'Default'; diff --git a/ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.test.js b/ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.test.js new file mode 100644 index 000000000..07248c2e5 --- /dev/null +++ b/ui/components/app/asset-list/detetcted-tokens-link/detected-tokens-link.test.js @@ -0,0 +1,32 @@ +import * as React from 'react'; +import { + renderWithProvider, + screen, + fireEvent, +} from '../../../../../test/jest'; +import configureStore from '../../../../store/store'; +import testData from '../../../../../.storybook/test-data'; + +import DetectedTokensLink from './detected-tokens-link'; + +describe('DetectedTokensLink', () => { + let setShowDetectedTokensSpy; + const args = {}; + + beforeEach(() => { + setShowDetectedTokensSpy = jest.fn(); + args.setShowDetectedTokens = setShowDetectedTokensSpy; + }); + + it('should render number of tokens detected link', () => { + const store = configureStore(testData); + renderWithProvider(, store); + + expect( + screen.getByText('3 new tokens found in this account'), + ).toBeInTheDocument(); + + fireEvent.click(screen.getByText('3 new tokens found in this account')); + expect(setShowDetectedTokensSpy).toHaveBeenCalled(); + }); +}); diff --git a/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js b/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js index a37aeaae5..afabb4ead 100644 --- a/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js +++ b/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js @@ -1,8 +1,13 @@ -import React from 'react'; +import React, { useContext } from 'react'; import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { useI18nContext } from '../../../../hooks/useI18nContext'; +import { MetaMetricsContext } from '../../../../contexts/metametrics'; +import { + EVENT, + EVENT_NAMES, +} from '../../../../../shared/constants/metametrics'; import { getDetectedTokensInCurrentNetwork } from '../../../../selectors'; import Popover from '../../../ui/popover'; @@ -19,6 +24,7 @@ const DetectedTokenSelectionPopover = ({ sortingBasedOnTokenSelection, }) => { const t = useI18nContext(); + const trackEvent = useContext(MetaMetricsContext); const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork); const { selected: selectedTokens = [] } = sortingBasedOnTokenSelection( @@ -31,6 +37,17 @@ const DetectedTokenSelectionPopover = ({ const onClose = () => { setShowDetectedTokens(false); + const eventTokensDetails = detectedTokens.map( + ({ address, symbol }) => `${symbol} - ${address}`, + ); + trackEvent({ + event: EVENT_NAMES.TOKEN_IMPORT_CANCELED, + category: EVENT.CATEGORIES.WALLET, + properties: { + source: EVENT.SOURCE.TOKEN.DETECTED, + tokens: eventTokensDetails, + }, + }); }; const footer = ( diff --git a/ui/components/app/detected-token/detected-token.js b/ui/components/app/detected-token/detected-token.js index 21d390b7f..0bfede9d1 100644 --- a/ui/components/app/detected-token/detected-token.js +++ b/ui/components/app/detected-token/detected-token.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState, useContext } from 'react'; import PropTypes from 'prop-types'; import { useSelector, useDispatch } from 'react-redux'; import { chain } from 'lodash'; @@ -9,7 +9,11 @@ import { setNewTokensImported, } from '../../../store/actions'; import { getDetectedTokensInCurrentNetwork } from '../../../selectors'; +import { MetaMetricsContext } from '../../../contexts/metametrics'; +import { TOKEN_STANDARDS } from '../../../helpers/constants/common'; +import { ASSET_TYPES } from '../../../../shared/constants/transaction'; +import { EVENT, EVENT_NAMES } from '../../../../shared/constants/metametrics'; import DetectedTokenSelectionPopover from './detected-token-selection-popover/detected-token-selection-popover'; import DetectedTokenIgnoredPopover from './detected-token-ignored-popover/detected-token-ignored-popover'; @@ -26,8 +30,10 @@ const sortingBasedOnTokenSelection = (tokensDetected) => { .value() ); }; + const DetectedToken = ({ setShowDetectedTokens }) => { const dispatch = useDispatch(); + const trackEvent = useContext(MetaMetricsContext); const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork); @@ -42,21 +48,49 @@ const DetectedToken = ({ setShowDetectedTokens }) => { setShowDetectedTokenIgnoredPopover, ] = useState(false); + const importSelectedTokens = async (selectedTokens) => { + selectedTokens.forEach((importedToken) => { + trackEvent({ + event: EVENT_NAMES.TOKEN_ADDED, + category: EVENT.CATEGORIES.WALLET, + sensitiveProperties: { + token_symbol: importedToken.symbol, + token_contract_address: importedToken.address, + token_decimal_precision: importedToken.decimals, + source: EVENT.SOURCE.TOKEN.DETECTED, + token_standard: TOKEN_STANDARDS.ERC20, + asset_type: ASSET_TYPES.TOKEN, + }, + }); + }); + await dispatch(importTokens(selectedTokens)); + const tokenSymbols = selectedTokens.map(({ symbol }) => symbol); + dispatch(setNewTokensImported(tokenSymbols.join(', '))); + }; + const handleClearTokensSelection = async () => { - // create a lodash chain on this object const { - selected: selectedTokens, - deselected: deSelectedTokens, + selected: selectedTokens = [], + deselected: deSelectedTokens = [], } = sortingBasedOnTokenSelection(tokensListDetected); if (deSelectedTokens.length < detectedTokens.length) { - await dispatch(ignoreTokens(deSelectedTokens)); - await dispatch(importTokens(selectedTokens)); - const tokenSymbols = selectedTokens.map(({ symbol }) => symbol); - dispatch(setNewTokensImported(tokenSymbols.join(', '))); - } else { - await dispatch(ignoreTokens(deSelectedTokens)); + await importSelectedTokens(selectedTokens); } + const tokensDetailsList = deSelectedTokens.map( + ({ symbol, address }) => `${symbol} - ${address}`, + ); + trackEvent({ + event: EVENT_NAMES.TOKEN_HIDDEN, + category: EVENT.CATEGORIES.WALLET, + sensitiveProperties: { + tokens: tokensDetailsList, + location: EVENT.LOCATION.TOKEN_DETECTION, + token_standard: TOKEN_STANDARDS.ERC20, + asset_type: ASSET_TYPES.TOKEN, + }, + }); + await dispatch(ignoreTokens(deSelectedTokens)); setShowDetectedTokens(false); }; @@ -71,17 +105,14 @@ const DetectedToken = ({ setShowDetectedTokens }) => { }; const onImport = async () => { - // create a lodash chain on this object - const { selected: selectedTokens } = sortingBasedOnTokenSelection( + const { selected: selectedTokens = [] } = sortingBasedOnTokenSelection( tokensListDetected, ); if (selectedTokens.length < detectedTokens.length) { setShowDetectedTokenIgnoredPopover(true); } else { - const tokenSymbols = selectedTokens.map(({ symbol }) => symbol); - await dispatch(importTokens(selectedTokens)); - dispatch(setNewTokensImported(tokenSymbols.join(', '))); + await importSelectedTokens(selectedTokens); setShowDetectedTokens(false); } }; diff --git a/ui/components/app/wallet-overview/eth-overview.js b/ui/components/app/wallet-overview/eth-overview.js index cf51d7031..de3339b3e 100644 --- a/ui/components/app/wallet-overview/eth-overview.js +++ b/ui/components/app/wallet-overview/eth-overview.js @@ -136,7 +136,7 @@ const EthOverview = ({ className }) => { event: 'Swaps Opened', category: EVENT.CATEGORIES.SWAPS, properties: { - source: 'Main View', + source: EVENT.SOURCE.SWAPS.MAIN_VIEW, active_currency: 'ETH', }, }); diff --git a/ui/components/app/wallet-overview/token-overview.js b/ui/components/app/wallet-overview/token-overview.js index 68299d1ca..23d8997d8 100644 --- a/ui/components/app/wallet-overview/token-overview.js +++ b/ui/components/app/wallet-overview/token-overview.js @@ -120,7 +120,7 @@ const TokenOverview = ({ className, token }) => { event: 'Swaps Opened', category: EVENT.CATEGORIES.SWAPS, properties: { - source: 'Token View', + source: EVENT.SOURCE.SWAPS.TOKEN_VIEW, active_currency: token.symbol, }, }); diff --git a/ui/pages/add-collectible/add-collectible.js b/ui/pages/add-collectible/add-collectible.js index ed8dde133..7d9112a92 100644 --- a/ui/pages/add-collectible/add-collectible.js +++ b/ui/pages/add-collectible/add-collectible.js @@ -27,6 +27,7 @@ import { getCollectiblesDetectionNoticeDismissed } from '../../ducks/metamask/me import CollectiblesDetectionNotice from '../../components/app/collectibles-detection-notice'; import { MetaMetricsContext } from '../../contexts/metametrics'; import { ASSET_TYPES } from '../../../shared/constants/transaction'; +import { EVENT, EVENT_NAMES } from '../../../shared/constants/metametrics'; export default function AddCollectible() { const t = useI18nContext(); @@ -77,7 +78,7 @@ export default function AddCollectible() { ); trackEvent({ - event: 'Token Added', + event: EVENT_NAMES.TOKEN_ADDED, category: 'Wallet', sensitiveProperties: { token_contract_address: address, @@ -85,7 +86,7 @@ export default function AddCollectible() { tokenId: tokenId.toString(), asset_type: ASSET_TYPES.COLLECTIBLE, token_standard: tokenDetails?.standard, - source: 'custom', + source: EVENT.SOURCE.TOKEN.CUSTOM, }, }); diff --git a/ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.js b/ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.js index a9e6a5ab4..919f68fd1 100644 --- a/ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.js +++ b/ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.js @@ -14,7 +14,7 @@ import { isEqualCaseInsensitive } from '../../../shared/modules/string-utils'; import { getSuggestedAssets } from '../../selectors'; import { rejectWatchAsset, acceptWatchAsset } from '../../store/actions'; import { TOKEN_STANDARDS } from '../../helpers/constants/common'; -import { EVENT } from '../../../shared/constants/metametrics'; +import { EVENT, EVENT_NAMES } from '../../../shared/constants/metametrics'; import { ASSET_TYPES } from '../../../shared/constants/transaction'; function getTokenName(name, symbol) { @@ -115,14 +115,14 @@ const ConfirmAddSuggestedToken = () => { await dispatch(acceptWatchAsset(id)); trackEvent({ - event: 'Token Added', + event: EVENT_NAMES.TOKEN_ADDED, category: EVENT.CATEGORIES.WALLET, sensitiveProperties: { token_symbol: asset.symbol, token_contract_address: asset.address, token_decimal_precision: asset.decimals, unlisted: asset.unlisted, - source: 'dapp', + source: EVENT.SOURCE.TOKEN.DAPP, token_standard: TOKEN_STANDARDS.ERC20, asset_type: ASSET_TYPES.TOKEN, }, diff --git a/ui/pages/confirm-import-token/confirm-import-token.js b/ui/pages/confirm-import-token/confirm-import-token.js index 354077072..e1a2e4e56 100644 --- a/ui/pages/confirm-import-token/confirm-import-token.js +++ b/ui/pages/confirm-import-token/confirm-import-token.js @@ -13,7 +13,8 @@ import { MetaMetricsContext } from '../../contexts/metametrics'; import { getMostRecentOverviewPage } from '../../ducks/history/history'; import { getPendingTokens } from '../../ducks/metamask/metamask'; import { addTokens, clearPendingTokens } from '../../store/actions'; -import { EVENT } from '../../../shared/constants/metametrics'; +import { TOKEN_STANDARDS } from '../../helpers/constants/common'; +import { EVENT, EVENT_NAMES } from '../../../shared/constants/metametrics'; import { ASSET_TYPES } from '../../../shared/constants/transaction'; const getTokenName = (name, symbol) => { @@ -37,15 +38,17 @@ const ConfirmImportToken = () => { addedTokenValues.forEach((pendingToken) => { trackEvent({ - event: 'Token Added', + event: EVENT_NAMES.TOKEN_ADDED, category: EVENT.CATEGORIES.WALLET, sensitiveProperties: { token_symbol: pendingToken.symbol, token_contract_address: pendingToken.address, token_decimal_precision: pendingToken.decimals, unlisted: pendingToken.unlisted, - source: pendingToken.isCustom ? 'custom' : 'list', - token_standard: pendingToken.standard, + source: pendingToken.isCustom + ? EVENT.SOURCE.TOKEN.CUSTOM + : EVENT.SOURCE.TOKEN.LIST, + token_standard: TOKEN_STANDARDS.ERC20, asset_type: ASSET_TYPES.TOKEN, }, }); From 02d374fde09982e95ddd81ebc621d5664dc41477 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 11 May 2022 13:21:23 -1000 Subject: [PATCH 042/127] deps - patch secp256k1 for fast module init via lazy loading (#14677) --- patches/secp256k1+3.8.0.patch | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 patches/secp256k1+3.8.0.patch diff --git a/patches/secp256k1+3.8.0.patch b/patches/secp256k1+3.8.0.patch new file mode 100644 index 000000000..e44de3f04 --- /dev/null +++ b/patches/secp256k1+3.8.0.patch @@ -0,0 +1,37 @@ +lazy precompute for faster module initialization + +diff --git a/node_modules/secp256k1/lib/js/ecpointg.js b/node_modules/secp256k1/lib/js/ecpointg.js +index 0144364..09a87c5 100644 +--- a/node_modules/secp256k1/lib/js/ecpointg.js ++++ b/node_modules/secp256k1/lib/js/ecpointg.js +@@ -8,11 +8,12 @@ function ECPointG () { + this.x = BN.fromBuffer(Buffer.from('79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798', 'hex')) + this.y = BN.fromBuffer(Buffer.from('483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8', 'hex')) + this.inf = false +- +- this._precompute() ++ this.precomputed = undefined + } + + ECPointG.prototype._precompute = function () { ++ if (this.precomputed !== undefined) return ++ + var ecpoint = new ECPoint(this.x, this.y) + + var dstep = 4 +@@ -34,6 +35,7 @@ ECPointG.prototype._precompute = function () { + } + + ECPointG.prototype.mul = function (num) { ++ this._precompute() + // Algorithm 3.42 Fixed-base NAF windowing method for point multiplication + var step = this.precomputed.doubles.step + var points = this.precomputed.doubles.points +@@ -68,6 +70,7 @@ ECPointG.prototype.mul = function (num) { + } + + ECPointG.prototype.mulAdd = function (k1, p2, k2) { ++ this._precompute() + var nafPointsP1 = this.precomputed.naf + var nafPointsP2 = p2._getNAFPoints1() + var wnd = [nafPointsP1.points, nafPointsP2.points] From 5e55cf2cf2c3d414510c795597c9deba8b01c8ff Mon Sep 17 00:00:00 2001 From: Alex Donesky Date: Thu, 12 May 2022 10:02:08 -0500 Subject: [PATCH 043/127] add case in useTransactionDisplayData to handle transaction type safeTransferFrom (#14678) * add case in useTransactionDisplayData to handle transaction type safeTransferFrom * add test --- shared/constants/transaction.js | 4 + test/data/transaction-data.json | 352 +++++++++++++++++++++ ui/hooks/useTransactionDisplayData.js | 3 +- ui/hooks/useTransactionDisplayData.test.js | 12 + 4 files changed, 370 insertions(+), 1 deletion(-) diff --git a/shared/constants/transaction.js b/shared/constants/transaction.js index c3a959caf..411e14248 100644 --- a/shared/constants/transaction.js +++ b/shared/constants/transaction.js @@ -9,6 +9,10 @@ import { MESSAGE_TYPE } from './app'; * @property {'transferfrom'} TOKEN_METHOD_TRANSFER_FROM - A token transaction * transferring tokens from an account that the sender has an allowance of. * For more information on allowances, see the approve type. + * @property {'safetransferfrom'} TOKEN_METHOD_SAFE_TRANSFER_FROM - A token transaction + * transferring tokens from an account that the sender has an allowance of. + * The method is prefixed with safe because when calling this method the contract checks + * to ensure that the receiver is an address capable of handling with the token being sent. * @property {'approve'} TOKEN_METHOD_APPROVE - A token transaction requesting an * allowance of the token to spend on behalf of the user * @property {'incoming'} INCOMING - An incoming (deposit) transaction diff --git a/test/data/transaction-data.json b/test/data/transaction-data.json index a5219dbdb..b3f2b05c5 100644 --- a/test/data/transaction-data.json +++ b/test/data/transaction-data.json @@ -856,5 +856,357 @@ }, "hasRetried": false, "hasCancelled": false + }, + { + "nonce": "0x57", + "transactions": [ + { + "id": 1441203963845330, + "time": 1652206763566, + "status": "confirmed", + "metamaskNetworkId": "4", + "originalGasEstimate": "0x118e0", + "userEditedGasLimit": false, + "chainId": "0x4", + "loadingDefaults": false, + "dappSuggestedGasFees": { + "maxPriorityFeePerGas": "0x3B9ACA00", + "maxFeePerGas": "0x7be830aec" + }, + "sendFlowHistory": [], + "txParams": { + "from": "0x806627172af48bd5b0765d3449a7def80d6576ff", + "to": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "nonce": "0x57", + "value": "0x0", + "data": "0x42842e0e000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98000000000000000000000000000000000000000000000000000000000009a7cc", + "gas": "0x118e0", + "maxFeePerGas": "0x7be830aec", + "maxPriorityFeePerGas": "0x3B9ACA00" + }, + "origin": "https://rinkeby.etherscan.io", + "type": "safetransferfrom", + "userFeeLevel": "dappSuggested", + "defaultGasEstimates": { + "estimateType": "dappSuggested", + "gas": "0x118e0", + "maxFeePerGas": "0x7be830aec", + "maxPriorityFeePerGas": "0x3B9ACA00" + }, + "estimatedBaseFee": "3ba182755", + "nonceDetails": { + "params": { + "highestLocallyConfirmed": 87, + "highestSuggested": 87, + "nextNetworkNonce": 87 + }, + "local": { + "name": "local", + "nonce": 87, + "details": { + "startPoint": 87, + "highest": 87 + } + }, + "network": { + "name": "network", + "nonce": 87, + "details": { + "blockNumber": "0xa28e38", + "baseCount": 87 + } + } + }, + "r": "0xd13310569a8d5876e37788183034bfe4bc3b49c0663c5fd9b2bf13adf9b4791c", + "s": "0x7a83d8840e7edcdf4fdedfd2bc1ce19775e54fd17f29ede5165591a1cf3febea", + "v": "0x00", + "rawTx": "0x02f8d10457843b9aca008507be830aec830118e094f5de760f2e916647fd766b4ad9e85ff943ce3a2b80b86442842e0e000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98000000000000000000000000000000000000000000000000000000000009a7ccc080a0d13310569a8d5876e37788183034bfe4bc3b49c0663c5fd9b2bf13adf9b4791ca07a83d8840e7edcdf4fdedfd2bc1ce19775e54fd17f29ede5165591a1cf3febea", + "hash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "submittedTime": 1652206777046, + "txReceipt": { + "blockHash": "0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1", + "blockNumber": "a28e39", + "contractAddress": null, + "cumulativeGasUsed": "fd5dee", + "effectiveGasPrice": "0x4028dcaf1", + "from": "0x806627172af48bd5b0765d3449a7def80d6576ff", + "gasUsed": "bb40", + "logs": [ + { + "address": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "blockHash": "0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1", + "blockNumber": "a28e39", + "data": "0x", + "logIndex": "45", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000000000000000000000000000000000000009a7cc" + ], + "transactionHash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "transactionIndex": "23" + }, + { + "address": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "blockHash": "0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1", + "blockNumber": "a28e39", + "data": "0x", + "logIndex": "46", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff", + "0x000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98", + "0x000000000000000000000000000000000000000000000000000000000009a7cc" + ], + "transactionHash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "transactionIndex": "23" + } + ], + "logsBloom": "0x00000000000000001000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000008000200000000000000000000000000008000000000000000000008000000000000000000000000000020800000000000000000800000000000000000000000010000000000000000000000000000080000010000000000000000000000000000000000000020000000000000000000001000000000000000000000000000000000000000000000202000000000000000000000800000000000000000000000000000020000010000000000002008000000000000000000000000000000000000000000000", + "status": "0x1", + "to": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "transactionHash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "transactionIndex": "23", + "type": "0x2" + }, + "baseFeePerGas": "0x3c6f300f1", + "blockTimestamp": "627aacc2" + } + ], + "initialTransaction": { + "id": 1441203963845330, + "time": 1652206763566, + "status": "confirmed", + "metamaskNetworkId": "4", + "originalGasEstimate": "0x118e0", + "userEditedGasLimit": false, + "chainId": "0x4", + "loadingDefaults": false, + "dappSuggestedGasFees": { + "maxPriorityFeePerGas": "0x3B9ACA00", + "maxFeePerGas": "0x7be830aec" + }, + "sendFlowHistory": [], + "txParams": { + "from": "0x806627172af48bd5b0765d3449a7def80d6576ff", + "to": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "nonce": "0x57", + "value": "0x0", + "data": "0x42842e0e000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98000000000000000000000000000000000000000000000000000000000009a7cc", + "gas": "0x118e0", + "maxFeePerGas": "0x7be830aec", + "maxPriorityFeePerGas": "0x3B9ACA00" + }, + "origin": "https://rinkeby.etherscan.io", + "type": "safetransferfrom", + "userFeeLevel": "dappSuggested", + "defaultGasEstimates": { + "estimateType": "dappSuggested", + "gas": "0x118e0", + "maxFeePerGas": "0x7be830aec", + "maxPriorityFeePerGas": "0x3B9ACA00" + }, + "estimatedBaseFee": "3ba182755", + "nonceDetails": { + "params": { + "highestLocallyConfirmed": 87, + "highestSuggested": 87, + "nextNetworkNonce": 87 + }, + "local": { + "name": "local", + "nonce": 87, + "details": { + "startPoint": 87, + "highest": 87 + } + }, + "network": { + "name": "network", + "nonce": 87, + "details": { + "blockNumber": "0xa28e38", + "baseCount": 87 + } + } + }, + "r": "0xd13310569a8d5876e37788183034bfe4bc3b49c0663c5fd9b2bf13adf9b4791c", + "s": "0x7a83d8840e7edcdf4fdedfd2bc1ce19775e54fd17f29ede5165591a1cf3febea", + "v": "0x00", + "rawTx": "0x02f8d10457843b9aca008507be830aec830118e094f5de760f2e916647fd766b4ad9e85ff943ce3a2b80b86442842e0e000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98000000000000000000000000000000000000000000000000000000000009a7ccc080a0d13310569a8d5876e37788183034bfe4bc3b49c0663c5fd9b2bf13adf9b4791ca07a83d8840e7edcdf4fdedfd2bc1ce19775e54fd17f29ede5165591a1cf3febea", + "hash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "submittedTime": 1652206777046, + "txReceipt": { + "blockHash": "0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1", + "blockNumber": "a28e39", + "contractAddress": null, + "cumulativeGasUsed": "fd5dee", + "effectiveGasPrice": "0x4028dcaf1", + "from": "0x806627172af48bd5b0765d3449a7def80d6576ff", + "gasUsed": "bb40", + "logs": [ + { + "address": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "blockHash": "0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1", + "blockNumber": "a28e39", + "data": "0x", + "logIndex": "45", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000000000000000000000000000000000000009a7cc" + ], + "transactionHash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "transactionIndex": "23" + }, + { + "address": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "blockHash": "0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1", + "blockNumber": "a28e39", + "data": "0x", + "logIndex": "46", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff", + "0x000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98", + "0x000000000000000000000000000000000000000000000000000000000009a7cc" + ], + "transactionHash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "transactionIndex": "23" + } + ], + "logsBloom": "0x00000000000000001000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000008000200000000000000000000000000008000000000000000000008000000000000000000000000000020800000000000000000800000000000000000000000010000000000000000000000000000080000010000000000000000000000000000000000000020000000000000000000001000000000000000000000000000000000000000000000202000000000000000000000800000000000000000000000000000020000010000000000002008000000000000000000000000000000000000000000000", + "status": "0x1", + "to": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "transactionHash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "transactionIndex": "23", + "type": "0x2" + }, + "baseFeePerGas": "0x3c6f300f1", + "blockTimestamp": "627aacc2" + }, + "primaryTransaction": { + "id": 1441203963845330, + "time": 1652206763566, + "status": "confirmed", + "metamaskNetworkId": "4", + "originalGasEstimate": "0x118e0", + "userEditedGasLimit": false, + "chainId": "0x4", + "loadingDefaults": false, + "dappSuggestedGasFees": { + "maxPriorityFeePerGas": "0x3B9ACA00", + "maxFeePerGas": "0x7be830aec" + }, + "sendFlowHistory": [], + "txParams": { + "from": "0x806627172af48bd5b0765d3449a7def80d6576ff", + "to": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "nonce": "0x57", + "value": "0x0", + "data": "0x42842e0e000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98000000000000000000000000000000000000000000000000000000000009a7cc", + "gas": "0x118e0", + "maxFeePerGas": "0x7be830aec", + "maxPriorityFeePerGas": "0x3B9ACA00" + }, + "origin": "https://rinkeby.etherscan.io", + "type": "safetransferfrom", + "userFeeLevel": "dappSuggested", + "defaultGasEstimates": { + "estimateType": "dappSuggested", + "gas": "0x118e0", + "maxFeePerGas": "0x7be830aec", + "maxPriorityFeePerGas": "0x3B9ACA00" + }, + "estimatedBaseFee": "3ba182755", + "nonceDetails": { + "params": { + "highestLocallyConfirmed": 87, + "highestSuggested": 87, + "nextNetworkNonce": 87 + }, + "local": { + "name": "local", + "nonce": 87, + "details": { + "startPoint": 87, + "highest": 87 + } + }, + "network": { + "name": "network", + "nonce": 87, + "details": { + "blockNumber": "0xa28e38", + "baseCount": 87 + } + } + }, + "r": "0xd13310569a8d5876e37788183034bfe4bc3b49c0663c5fd9b2bf13adf9b4791c", + "s": "0x7a83d8840e7edcdf4fdedfd2bc1ce19775e54fd17f29ede5165591a1cf3febea", + "v": "0x00", + "rawTx": "0x02f8d10457843b9aca008507be830aec830118e094f5de760f2e916647fd766b4ad9e85ff943ce3a2b80b86442842e0e000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98000000000000000000000000000000000000000000000000000000000009a7ccc080a0d13310569a8d5876e37788183034bfe4bc3b49c0663c5fd9b2bf13adf9b4791ca07a83d8840e7edcdf4fdedfd2bc1ce19775e54fd17f29ede5165591a1cf3febea", + "hash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "submittedTime": 1652206777046, + "txReceipt": { + "blockHash": "0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1", + "blockNumber": "a28e39", + "contractAddress": null, + "cumulativeGasUsed": "fd5dee", + "effectiveGasPrice": "0x4028dcaf1", + "from": "0x806627172af48bd5b0765d3449a7def80d6576ff", + "gasUsed": "bb40", + "logs": [ + { + "address": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "blockHash": "0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1", + "blockNumber": "a28e39", + "data": "0x", + "logIndex": "45", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000000000000000000000000000000000000009a7cc" + ], + "transactionHash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "transactionIndex": "23" + }, + { + "address": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "blockHash": "0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1", + "blockNumber": "a28e39", + "data": "0x", + "logIndex": "46", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff", + "0x000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98", + "0x000000000000000000000000000000000000000000000000000000000009a7cc" + ], + "transactionHash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "transactionIndex": "23" + } + ], + "logsBloom": "0x00000000000000001000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000008000200000000000000000000000000008000000000000000000008000000000000000000000000000020800000000000000000800000000000000000000000010000000000000000000000000000080000010000000000000000000000000000000000000020000000000000000000001000000000000000000000000000000000000000000000202000000000000000000000800000000000000000000000000000020000010000000000002008000000000000000000000000000000000000000000000", + "status": "0x1", + "to": "0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b", + "transactionHash": "0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3", + "transactionIndex": "23", + "type": "0x2" + }, + "baseFeePerGas": "0x3c6f300f1", + "blockTimestamp": "627aacc2" + }, + "hasRetried": false, + "hasCancelled": false } ] diff --git a/ui/hooks/useTransactionDisplayData.js b/ui/hooks/useTransactionDisplayData.js index 02a64bdbf..ee47225c8 100644 --- a/ui/hooks/useTransactionDisplayData.js +++ b/ui/hooks/useTransactionDisplayData.js @@ -238,7 +238,8 @@ export function useTransactionDisplayData(transactionGroup) { subtitle = t('fromAddress', [shortenAddress(senderAddress)]); } else if ( type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM || - type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER + type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER || + type === TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM ) { category = TRANSACTION_GROUP_CATEGORIES.SEND; title = t('sendSpecifiedTokens', [ diff --git a/ui/hooks/useTransactionDisplayData.test.js b/ui/hooks/useTransactionDisplayData.test.js index c9673daff..29e4d43d2 100644 --- a/ui/hooks/useTransactionDisplayData.test.js +++ b/ui/hooks/useTransactionDisplayData.test.js @@ -130,6 +130,18 @@ const expectedResults = [ isPending: false, displayedStatusKey: TRANSACTION_STATUSES.CONFIRMED, }, + { + title: 'Send Token', + category: TRANSACTION_GROUP_CATEGORIES.SEND, + subtitle: 'To: 0xe7d...dd98', + subtitleContainsOrigin: true, + primaryCurrency: '-0 ETH', + senderAddress: '0x806627172af48bd5b0765d3449a7def80d6576ff', + recipientAddress: '0xe7d522230eff653bb0a9b4385f0be0815420dd98', + secondaryCurrency: '-0 ETH', + isPending: false, + displayedStatusKey: TRANSACTION_STATUSES.CONFIRMED, + }, ]; let useSelector, useI18nContext, useTokenFiatAmount; From 8948018e5a4361680bd4cf339472fb64fff835b7 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Thu, 12 May 2022 13:36:14 -0230 Subject: [PATCH 044/127] 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 e1442320b..5f9139c13 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -4144,6 +4144,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 1e1cf316a..6d45be3e3 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2961,7 +2961,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 1e1cf316a..6d45be3e3 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2961,7 +2961,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 1e1cf316a..6d45be3e3 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2961,7 +2961,8 @@ "console.log": true, "document.createElement": true, "document.head.appendChild": true, - "fetch": true + "fetch": true, + "removeEventListener": true }, "packages": { "@ethereumjs/tx": true, diff --git a/package.json b/package.json index 510c03979..123d50c37 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/jazzicon": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index fbac0fa57..e29373422 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2875,10 +2875,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 77c1100858b4e7509bbbb851aaab9dd0bea3883c Mon Sep 17 00:00:00 2001 From: Bowen Sanders Date: Thu, 12 May 2022 10:56:55 -0700 Subject: [PATCH 045/127] create e2e test for manageState snap (#14699) --- test/e2e/snaps/test-snap-managestate.spec.js | 141 +++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 test/e2e/snaps/test-snap-managestate.spec.js diff --git a/test/e2e/snaps/test-snap-managestate.spec.js b/test/e2e/snaps/test-snap-managestate.spec.js new file mode 100644 index 000000000..631724e17 --- /dev/null +++ b/test/e2e/snaps/test-snap-managestate.spec.js @@ -0,0 +1,141 @@ +const { strict: assert } = require('assert'); +const { withFixtures } = require('../helpers'); + +describe('Test Snap manageState', function () { + it('can pop up manageState snap and do update get and clear', async function () { + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: 25000000000000000000, + }, + ], + }; + await withFixtures( + { + fixtures: 'imported-account', + ganacheOptions, + title: this.test.title, + driverOptions: { + type: 'flask', + }, + }, + async ({ driver }) => { + await driver.navigate(); + + // enter pw into extension + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // navigate to test snaps page and connect + await driver.driver.get('https://metamask.github.io/test-snaps/0.2.0/'); + await driver.fill('.snapId3', 'npm:@metamask/test-snap-managestate'); + await driver.clickElement({ + text: 'Connect manageState Snap', + tag: 'button', + }); + + // switch to metamask extension and click connect + await driver.waitUntilXWindowHandles(2, 5000, 10000); + let windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + await driver.clickElement( + { + text: 'Connect', + tag: 'button', + }, + 10000, + ); + + await driver.delay(2000); + + // approve install of snap + await driver.waitUntilXWindowHandles(2, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + await driver.clickElement({ + text: 'Approve & Install', + tag: 'button', + }); + + // fill and click send inputs on test snap page + await driver.waitUntilXWindowHandles(1, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + await driver.fill('.dataManageState', '23'); + await driver.clickElement({ + text: 'Send data to manageState Snap', + tag: 'button', + }); + + // check the results of the public key test + await driver.delay(2000); + const manageStateResult = await driver.findElement( + '.sendManageStateResult', + ); + assert.equal(await manageStateResult.getText(), 'true'); + + // click get results + await driver.waitUntilXWindowHandles(1, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + await driver.clickElement({ + text: 'Get data from manageState Snap', + tag: 'button', + }); + + // check the results + await driver.delay(2000); + const retrieveManageStateResult = await driver.findElement( + '.retrieveManageStateResult', + ); + assert.equal( + await retrieveManageStateResult.getText(), + '{"testState":["23"]}', + ); + + // click clear results + await driver.waitUntilXWindowHandles(1, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + await driver.clickElement({ + text: 'Clear data of manageState Snap', + tag: 'button', + }); + + // check if true + await driver.delay(2000); + const clearManageStateResult = await driver.findElement( + '.clearManageStateResult', + ); + assert.equal(await clearManageStateResult.getText(), 'true'); + + // click get results again + await driver.waitUntilXWindowHandles(1, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + await driver.clickElement({ + text: 'Get data from manageState Snap', + tag: 'button', + }); + + // check result array is empty + await driver.delay(2000); + const retrieveManageStateResult2 = await driver.findElement( + '.retrieveManageStateResult', + ); + assert.equal( + await retrieveManageStateResult2.getText(), + '{"testState":[]}', + ); + }, + ); + }); +}); From d305dcba9d1b8ddd5219c9362e78616b6072a4c1 Mon Sep 17 00:00:00 2001 From: Daniel <80175477+dan437@users.noreply.github.com> Date: Thu, 12 May 2022 19:57:05 +0200 Subject: [PATCH 046/127] Change styles for the high price impact notification in Swaps (#14697) --- ui/pages/swaps/view-quote/index.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/pages/swaps/view-quote/index.scss b/ui/pages/swaps/view-quote/index.scss index 33b3c16c8..7f671e901 100644 --- a/ui/pages/swaps/view-quote/index.scss +++ b/ui/pages/swaps/view-quote/index.scss @@ -96,12 +96,12 @@ &.high { .actionable-message { - border-color: var(--color-warning-default); - background: var(--color-warning-muted); + border-color: var(--color-error-default); + background: var(--color-error-muted); button { - background: var(--color-warning-default); - color: var(--color-warning-inverse); + background: var(--color-error-default); + color: var(--color-error-inverse); } } } 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 047/127] 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 5f9139c13..827de4f54 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 048/127] 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 6d45be3e3..05c3c93dd 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 6d45be3e3..05c3c93dd 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 6d45be3e3..05c3c93dd 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 f35cc95e6..e97b9a34b 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 123d50c37..ff5b650fd 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 2976f3bb2..000000000 --- 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 211cb89dd..000000000 --- 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 aec0c7168..000000000 --- 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 e29373422..b4743608d 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 049/127] 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 b63775632..5908ec58e 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 bfce16f70..0d621f46e 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 ba4a0d86f..c26536b78 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 8036f36d4..eed2bbaf2 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 42730a460..ca5b2e8af 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 227e63047..77e88cc2b 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 000000000..2b23e7391 --- /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 000000000..23f372dc8 --- /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 1867676ae..9ee9001a3 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 52c0a8e95..24cb6ddec 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 a397c125d..50ee18dbd 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 050/127] 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 8c1ecbca1..8348513c1 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 76982e445..804132295 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 d2c9e6663..1751c2a55 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 c2cd6f8097cc382b51c0ae90162e2fb7177a28d2 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Mon, 16 May 2022 18:04:25 +0200 Subject: [PATCH 051/127] Bump `addons-linter` (#14717) * Bump addons-linter * Deduplicate yarn.lock * Rerun yarn install and LavaMoat policy gen --- lavamoat/browserify/beta/policy.json | 30 +- lavamoat/browserify/flask/policy.json | 30 +- lavamoat/browserify/main/policy.json | 30 +- lavamoat/build-system/policy.json | 231 ++-- package.json | 2 +- yarn.lock | 1505 ++++++++++--------------- 6 files changed, 732 insertions(+), 1096 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 05c3c93dd..816e7aae0 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2202,7 +2202,7 @@ }, "@babel/runtime": { "packages": { - "addons-linter>regenerator-runtime": true + "@storybook/api>regenerator-runtime": true } }, "@download/blockies": { @@ -3993,7 +3993,7 @@ "@ngraveio/bc-ur>bignumber.js": true, "@ngraveio/bc-ur>crc": true, "@ngraveio/bc-ur>jsbi": true, - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "browserify>assert": true, "browserify>buffer": true, "pubnub>cbor-sync": true @@ -4015,12 +4015,6 @@ "define": true } }, - "@ngraveio/bc-ur>sha.js": { - "packages": { - "ethereumjs-wallet>safe-buffer": true, - "pumpify>inherits": true - } - }, "@popperjs/core": { "globals": { "Element": true, @@ -4131,6 +4125,11 @@ "localforage": true } }, + "@storybook/api>regenerator-runtime": { + "globals": { + "regeneratorRuntime": "write" + } + }, "@storybook/api>util-deprecate": { "globals": { "console.trace": true, @@ -4450,9 +4449,10 @@ "setTimeout": true } }, - "addons-linter>regenerator-runtime": { - "globals": { - "regeneratorRuntime": "write" + "addons-linter>sha.js": { + "packages": { + "ethereumjs-wallet>safe-buffer": true, + "pumpify>inherits": true } }, "analytics-node": { @@ -4643,7 +4643,7 @@ }, "browserify>crypto-browserify>create-hmac": { "packages": { - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -4674,7 +4674,7 @@ "setTimeout": true }, "packages": { - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "browserify>process": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -5556,7 +5556,7 @@ }, "ethereumjs-util>create-hash": { "packages": { - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>md5.js": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -6233,7 +6233,7 @@ "ethjs-query>babel-runtime": { "packages": { "@babel/runtime": true, - "addons-linter>regenerator-runtime": true, + "@storybook/api>regenerator-runtime": true, "ethjs-query>babel-runtime>core-js": true } }, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 05c3c93dd..816e7aae0 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2202,7 +2202,7 @@ }, "@babel/runtime": { "packages": { - "addons-linter>regenerator-runtime": true + "@storybook/api>regenerator-runtime": true } }, "@download/blockies": { @@ -3993,7 +3993,7 @@ "@ngraveio/bc-ur>bignumber.js": true, "@ngraveio/bc-ur>crc": true, "@ngraveio/bc-ur>jsbi": true, - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "browserify>assert": true, "browserify>buffer": true, "pubnub>cbor-sync": true @@ -4015,12 +4015,6 @@ "define": true } }, - "@ngraveio/bc-ur>sha.js": { - "packages": { - "ethereumjs-wallet>safe-buffer": true, - "pumpify>inherits": true - } - }, "@popperjs/core": { "globals": { "Element": true, @@ -4131,6 +4125,11 @@ "localforage": true } }, + "@storybook/api>regenerator-runtime": { + "globals": { + "regeneratorRuntime": "write" + } + }, "@storybook/api>util-deprecate": { "globals": { "console.trace": true, @@ -4450,9 +4449,10 @@ "setTimeout": true } }, - "addons-linter>regenerator-runtime": { - "globals": { - "regeneratorRuntime": "write" + "addons-linter>sha.js": { + "packages": { + "ethereumjs-wallet>safe-buffer": true, + "pumpify>inherits": true } }, "analytics-node": { @@ -4643,7 +4643,7 @@ }, "browserify>crypto-browserify>create-hmac": { "packages": { - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -4674,7 +4674,7 @@ "setTimeout": true }, "packages": { - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "browserify>process": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -5556,7 +5556,7 @@ }, "ethereumjs-util>create-hash": { "packages": { - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>md5.js": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -6233,7 +6233,7 @@ "ethjs-query>babel-runtime": { "packages": { "@babel/runtime": true, - "addons-linter>regenerator-runtime": true, + "@storybook/api>regenerator-runtime": true, "ethjs-query>babel-runtime>core-js": true } }, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 05c3c93dd..816e7aae0 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2202,7 +2202,7 @@ }, "@babel/runtime": { "packages": { - "addons-linter>regenerator-runtime": true + "@storybook/api>regenerator-runtime": true } }, "@download/blockies": { @@ -3993,7 +3993,7 @@ "@ngraveio/bc-ur>bignumber.js": true, "@ngraveio/bc-ur>crc": true, "@ngraveio/bc-ur>jsbi": true, - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "browserify>assert": true, "browserify>buffer": true, "pubnub>cbor-sync": true @@ -4015,12 +4015,6 @@ "define": true } }, - "@ngraveio/bc-ur>sha.js": { - "packages": { - "ethereumjs-wallet>safe-buffer": true, - "pumpify>inherits": true - } - }, "@popperjs/core": { "globals": { "Element": true, @@ -4131,6 +4125,11 @@ "localforage": true } }, + "@storybook/api>regenerator-runtime": { + "globals": { + "regeneratorRuntime": "write" + } + }, "@storybook/api>util-deprecate": { "globals": { "console.trace": true, @@ -4450,9 +4449,10 @@ "setTimeout": true } }, - "addons-linter>regenerator-runtime": { - "globals": { - "regeneratorRuntime": "write" + "addons-linter>sha.js": { + "packages": { + "ethereumjs-wallet>safe-buffer": true, + "pumpify>inherits": true } }, "analytics-node": { @@ -4643,7 +4643,7 @@ }, "browserify>crypto-browserify>create-hmac": { "packages": { - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -4674,7 +4674,7 @@ "setTimeout": true }, "packages": { - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "browserify>process": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -5556,7 +5556,7 @@ }, "ethereumjs-util>create-hash": { "packages": { - "@ngraveio/bc-ur>sha.js": true, + "addons-linter>sha.js": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>md5.js": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -6233,7 +6233,7 @@ "ethjs-query>babel-runtime": { "packages": { "@babel/runtime": true, - "addons-linter>regenerator-runtime": true, + "@storybook/api>regenerator-runtime": true, "ethjs-query>babel-runtime>core-js": true } }, diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index e97b9a34b..b0da8c0bb 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -534,9 +534,9 @@ "@babel/preset-env>@babel/helper-plugin-utils": true, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-optimise-call-expression": true, + "@babel/preset-env>@babel/plugin-transform-classes>globals": true, "depcheck>@babel/traverse>@babel/helper-function-name": true, - "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true, - "depcheck>@babel/traverse>globals": true + "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true } }, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": { @@ -1134,21 +1134,6 @@ "typescript": true } }, - "addons-linter>probe-image-size>next-tick": { - "globals": { - "MutationObserver": true, - "WebKitMutationObserver": true, - "document": true, - "process": true, - "setImmediate": true, - "setTimeout": true - } - }, - "addons-linter>upath": { - "builtin": { - "path": true - } - }, "babelify": { "builtin": { "path.extname": true, @@ -1993,57 +1978,6 @@ "string.prototype.matchall>es-abstract": true } }, - "enzyme>cheerio>dom-serializer": { - "packages": { - "enzyme>cheerio>entities": true, - "enzyme>cheerio>htmlparser2>domelementtype": true - } - }, - "enzyme>cheerio>htmlparser2": { - "builtin": { - "buffer.Buffer": true, - "events.EventEmitter": true, - "string_decoder.StringDecoder": true - }, - "packages": { - "enzyme>cheerio>entities": true, - "enzyme>cheerio>htmlparser2>domelementtype": true, - "enzyme>cheerio>htmlparser2>domhandler": true, - "enzyme>cheerio>htmlparser2>domutils": true, - "enzyme>cheerio>htmlparser2>readable-stream": true, - "pumpify>inherits": true - } - }, - "enzyme>cheerio>htmlparser2>domhandler": { - "packages": { - "enzyme>cheerio>htmlparser2>domelementtype": true - } - }, - "enzyme>cheerio>htmlparser2>domutils": { - "packages": { - "enzyme>cheerio>dom-serializer": true, - "enzyme>cheerio>htmlparser2>domelementtype": true - } - }, - "enzyme>cheerio>htmlparser2>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 - } - }, "enzyme>has": { "packages": { "mocha>object.assign>function-bind": true @@ -2133,10 +2067,10 @@ "eslint>is-glob": true, "eslint>json-stable-stringify-without-jsonify": true, "eslint>levn": true, + "eslint>minimatch": true, "eslint>natural-compare": true, "eslint>regexpp": true, - "lodash": true, - "mocha>minimatch": true + "lodash": true } }, "eslint-config-prettier": { @@ -2213,7 +2147,7 @@ "eslint-plugin-import>read-pkg-up": true, "eslint-plugin-import>tsconfig-paths": true, "eslint-plugin-react>array-includes": true, - "mocha>minimatch": true, + "eslint>minimatch": true, "typescript": true } }, @@ -2527,8 +2461,8 @@ "eslint-plugin-node>eslint-plugin-es": true, "eslint-plugin-node>semver": true, "eslint>eslint-utils": true, - "globby>ignore": true, - "mocha>minimatch": true + "eslint>minimatch": true, + "globby>ignore": true } }, "eslint-plugin-node>eslint-plugin-es": { @@ -2575,8 +2509,8 @@ "eslint-plugin-react>doctrine": true, "eslint-plugin-react>jsx-ast-utils": true, "eslint-plugin-react>resolve": true, + "eslint>minimatch": true, "lavamoat>object.fromentries": true, - "mocha>minimatch": true, "prop-types": true, "string.prototype.matchall": true } @@ -2695,11 +2629,11 @@ "eslint-plugin-react-hooks": true, "eslint>@eslint/eslintrc>globals": true, "eslint>@eslint/eslintrc>ignore": true, - "eslint>@eslint/eslintrc>strip-json-comments": true, "eslint>ajv": true, "eslint>debug": true, "eslint>espree": true, - "mocha>minimatch": true, + "eslint>minimatch": true, + "eslint>strip-json-comments": true, "nyc>js-yaml": true } }, @@ -2757,24 +2691,24 @@ }, "packages": { "eslint>eslint-scope>esrecurse": true, - "jsdom>escodegen>estraverse": true + "eslint>eslint-scope>estraverse": true } }, "eslint>eslint-scope>esrecurse": { "packages": { - "eslint>eslint-scope>esrecurse>estraverse": true + "eslint>esquery>estraverse": true } }, "eslint>eslint-utils": { "packages": { - "@babel/eslint-parser>eslint-visitor-keys": true + "eslint>eslint-utils>eslint-visitor-keys": true } }, "eslint>espree": { "packages": { - "@babel/eslint-parser>eslint-visitor-keys": true, "eslint>espree>acorn": true, - "eslint>espree>acorn-jsx": true + "eslint>espree>acorn-jsx": true, + "eslint>espree>eslint-visitor-keys": true } }, "eslint>espree>acorn": { @@ -2819,21 +2753,7 @@ }, "packages": { "eslint>file-entry-cache>flat-cache>flatted": true, - "eslint>file-entry-cache>flat-cache>rimraf": true - } - }, - "eslint>file-entry-cache>flat-cache>rimraf": { - "builtin": { - "assert": true, - "fs": true, - "path.join": true - }, - "globals": { - "process.platform": true, - "setTimeout": true - }, - "packages": { - "nyc>glob": true + "nyc>rimraf": true } }, "eslint>glob-parent": { @@ -2892,6 +2812,17 @@ "eslint>levn>prelude-ls": true } }, + "eslint>minimatch": { + "builtin": { + "path": true + }, + "globals": { + "console": true + }, + "packages": { + "mocha>minimatch>brace-expansion": true + } + }, "eslint>strip-ansi": { "packages": { "eslint>strip-ansi>ansi-regex": true @@ -3604,7 +3535,7 @@ "packages": { "gulp-rtlcss>rtlcss>@choojs/findup": true, "gulp-rtlcss>rtlcss>postcss": true, - "rc>strip-json-comments": true + "gulp-rtlcss>rtlcss>strip-json-comments": true } }, "gulp-rtlcss>rtlcss>@choojs/findup": { @@ -3858,10 +3789,10 @@ "setTimeout": true }, "packages": { - "addons-linter>probe-image-size>next-tick": true, "gulp-sourcemaps>debug-fabulous>memoizee>event-emitter": true, "gulp-sourcemaps>debug-fabulous>memoizee>is-promise": true, "gulp-sourcemaps>debug-fabulous>memoizee>lru-queue": true, + "gulp-sourcemaps>debug-fabulous>memoizee>next-tick": true, "gulp-sourcemaps>debug-fabulous>memoizee>timers-ext": true, "resolve-url-loader>es6-iterator>d": true, "resolve-url-loader>es6-iterator>es5-ext": true @@ -3878,6 +3809,16 @@ "resolve-url-loader>es6-iterator>es5-ext": true } }, + "gulp-sourcemaps>debug-fabulous>memoizee>next-tick": { + "globals": { + "MutationObserver": true, + "WebKitMutationObserver": true, + "document": true, + "process": true, + "setImmediate": true, + "setTimeout": true + } + }, "gulp-sourcemaps>debug-fabulous>memoizee>timers-ext": { "packages": { "resolve-url-loader>es6-iterator>es5-ext": true @@ -4146,7 +4087,6 @@ "setTimeout": true }, "packages": { - "addons-linter>upath": true, "gulp-watch>chokidar>anymatch": true, "gulp-watch>chokidar>async-each": true, "gulp-watch>chokidar>braces": true, @@ -4155,6 +4095,7 @@ "gulp-watch>chokidar>is-glob": true, "gulp-watch>chokidar>normalize-path": true, "gulp-watch>chokidar>readdirp": true, + "gulp-watch>chokidar>upath": true, "gulp-watch>glob-parent": true, "gulp-watch>path-is-absolute": true, "pumpify>inherits": true @@ -4835,6 +4776,11 @@ "gulp-watch>chokidar>readdirp>micromatch>extglob>extend-shallow>is-extendable": true } }, + "gulp-watch>chokidar>upath": { + "builtin": { + "path": true + } + }, "gulp-watch>fancy-log": { "globals": { "console": true, @@ -5171,7 +5117,6 @@ "setTimeout": true }, "packages": { - "addons-linter>upath": true, "eslint>is-glob": true, "gulp-watch>chokidar>async-each": true, "gulp-watch>path-is-absolute": true, @@ -5182,6 +5127,7 @@ "gulp>glob-watcher>chokidar>is-binary-path": true, "gulp>glob-watcher>chokidar>normalize-path": true, "gulp>glob-watcher>chokidar>readdirp": true, + "gulp>glob-watcher>chokidar>upath": true, "pumpify>inherits": true } }, @@ -5647,6 +5593,11 @@ "readable-stream": true } }, + "gulp>glob-watcher>chokidar>upath": { + "builtin": { + "path": true + } + }, "gulp>glob-watcher>just-debounce": { "globals": { "clearTimeout": true, @@ -6404,17 +6355,6 @@ "fs.accessSync": true } }, - "mocha>minimatch": { - "builtin": { - "path": true - }, - "globals": { - "console.error": true - }, - "packages": { - "mocha>minimatch>brace-expansion": true - } - }, "mocha>minimatch>brace-expansion": { "packages": { "mocha>minimatch>brace-expansion>concat-map": true, @@ -6498,8 +6438,8 @@ "process.platform": true }, "packages": { + "eslint>minimatch": true, "gulp-watch>path-is-absolute": true, - "mocha>minimatch": true, "nyc>glob>fs.realpath": true, "nyc>glob>inflight": true, "pump>once": true, @@ -6554,6 +6494,20 @@ "path.resolve": true } }, + "nyc>rimraf": { + "builtin": { + "assert": true, + "fs": true, + "path.join": true + }, + "globals": { + "process.platform": true, + "setTimeout": true + }, + "packages": { + "nyc>glob": true + } + }, "nyc>signal-exit": { "builtin": { "assert.equal": true, @@ -7459,10 +7413,61 @@ "__dirname": true }, "packages": { - "enzyme>cheerio>htmlparser2": true, + "stylelint>postcss-html>htmlparser2": true, "stylelint>postcss-syntax": true } }, + "stylelint>postcss-html>htmlparser2": { + "builtin": { + "buffer.Buffer": true, + "events.EventEmitter": true, + "string_decoder.StringDecoder": true + }, + "packages": { + "pumpify>inherits": true, + "stylelint>postcss-html>htmlparser2>domelementtype": true, + "stylelint>postcss-html>htmlparser2>domhandler": true, + "stylelint>postcss-html>htmlparser2>domutils": true, + "stylelint>postcss-html>htmlparser2>entities": true, + "stylelint>postcss-html>htmlparser2>readable-stream": true + } + }, + "stylelint>postcss-html>htmlparser2>domhandler": { + "packages": { + "stylelint>postcss-html>htmlparser2>domelementtype": true + } + }, + "stylelint>postcss-html>htmlparser2>domutils": { + "packages": { + "stylelint>postcss-html>htmlparser2>domelementtype": true, + "stylelint>postcss-html>htmlparser2>domutils>dom-serializer": true + } + }, + "stylelint>postcss-html>htmlparser2>domutils>dom-serializer": { + "packages": { + "stylelint>postcss-html>htmlparser2>domelementtype": true, + "stylelint>postcss-html>htmlparser2>entities": true + } + }, + "stylelint>postcss-html>htmlparser2>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 + } + }, "stylelint>postcss-less": { "packages": { "stylelint>postcss": true diff --git a/package.json b/package.json index ff5b650fd..c5b9face4 100644 --- a/package.json +++ b/package.json @@ -273,7 +273,7 @@ "@types/react": "^16.9.53", "@typescript-eslint/eslint-plugin": "^4.20.0", "@typescript-eslint/parser": "^4.20.0", - "addons-linter": "1.14.0", + "addons-linter": "^5.2.0", "babelify": "^10.0.0", "bify-module-groups": "^2.0.0", "brfs": "^2.0.2", diff --git a/yarn.lock b/yarn.lock index b4743608d..ffae65f4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1411,6 +1411,21 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@eslint/eslintrc@^1.2.2": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.3.tgz#fcaa2bcef39e13d6e9e7f6271f4cc7cae1174886" + integrity sha512-uGo44hIwoLGNyduRpjdEpovcbMdd+Nv7amtmJxnKmI8xj6yd5LncmSwDa5NgX/41lIFJtkjD6YdVfgEzPfJ5UA== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.3.2" + globals "^13.9.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + "@eth-optimism/contracts@0.0.0-2021919175625": version "0.0.0-2021919175625" resolved "https://registry.yarnpkg.com/@eth-optimism/contracts/-/contracts-0.0.0-2021919175625.tgz#551ed5d98ac4405596e97f723c28ee6376e65546" @@ -2197,6 +2212,20 @@ ws "*" xtend "^4.0.0" +"@humanwhocodes/config-array@^0.9.2": + version "0.9.5" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" + integrity sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.4" + +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + "@inquirer/confirm@^0.0.14-alpha.0": version "0.0.14-alpha.0" resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-0.0.14-alpha.0.tgz#4a759c6def5ecd73bc239e090ee6197f74f52dbd" @@ -2704,6 +2733,11 @@ prop-types "^15.7.2" react-is "^16.8.0" +"@mdn/browser-compat-data@4.1.19": + version "4.1.19" + resolved "https://registry.yarnpkg.com/@mdn/browser-compat-data/-/browser-compat-data-4.1.19.tgz#33f8c6c63a14a3acc50062df93eaa92f33a10a0a" + integrity sha512-zDrdjvX2dwunW4HOGwpibLHvfnDRQOJ89bGnkQ7TXZ7H7JSehbg2Gf0zNbML+R/03QItZ7EI6QHloOJ2znFSdA== + "@mdx-js/loader@^1.6.22": version "1.6.22" resolved "https://registry.yarnpkg.com/@mdx-js/loader/-/loader-1.6.22.tgz#d9e8fe7f8185ff13c9c8639c048b123e30d322c4" @@ -4935,7 +4969,7 @@ dependencies: "@types/yargs-parser" "*" -"@types/yauzl@^2.9.1": +"@types/yauzl@2.9.2", "@types/yauzl@^2.9.1": version "2.9.2" resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.2.tgz#c48e5d56aff1444409e39fa164b0b4d4552a7b7a" integrity sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA== @@ -5378,17 +5412,10 @@ acorn-globals@^6.0.0: acorn "^7.1.1" acorn-walk "^7.1.1" -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s= - dependencies: - acorn "^3.0.4" - -acorn-jsx@^5.0.0, acorn-jsx@^5.0.2, acorn-jsx@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" - integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== +acorn-jsx@^5.3.1, acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn-node@^1.2.0, acorn-node@^1.3.0, acorn-node@^1.5.2, acorn-node@^1.6.1: version "1.8.2" @@ -5414,17 +5441,12 @@ acorn-walk@^8.2.0: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= - -acorn@^5.1.2, acorn@^5.2.1: +acorn@^5.1.2: version "5.7.4" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e" integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== -acorn@^6.0.1, acorn@^6.0.7, acorn@^6.4.1: +acorn@^6.0.1, acorn@^6.4.1: version "6.4.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== @@ -5434,53 +5456,64 @@ acorn@^7.0.0, acorn@^7.1.1, acorn@^7.4.0, acorn@^7.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.7.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" - integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== +acorn@^8.2.4, acorn@^8.7.0, acorn@^8.7.1: + version "8.7.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" + integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== -addons-linter@1.14.0: - version "1.14.0" - resolved "https://registry.yarnpkg.com/addons-linter/-/addons-linter-1.14.0.tgz#611f8d9e8c4cc84646ebd0b61c016f758225bf13" - integrity sha512-Of7A53J2ltaIZzD8RPH1hVxOR+DmLDuHBtwfhXJw8JTXwzpDIvOKn/i6XDtPgfFlj5wIWxpUGV+tFb/kE/K9gg== - dependencies: - ajv "6.10.2" - ajv-merge-patch "4.1.0" - chalk "2.4.2" - cheerio "1.0.0-rc.3" - columnify "1.5.4" - common-tags "1.8.0" - deepmerge "4.0.0" - dispensary "0.40.0" - es6-promisify "6.0.2" - eslint "5.16.0" - eslint-plugin-no-unsafe-innerhtml "1.0.16" - eslint-visitor-keys "1.1.0" - espree "6.1.1" +addons-linter@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/addons-linter/-/addons-linter-5.2.0.tgz#a1a36cdb72f5df359e246c25e1261d2183b4f6a7" + integrity sha512-wMKD9aJYYIVXK/grrHErqbGFX0uvEehEiMlAkUA/4M3a9zJDvNrpW0OwZxLEAlNpFISOtKPaQTlt0MHKwQTGFQ== + dependencies: + "@mdn/browser-compat-data" "4.1.19" + addons-moz-compare "1.2.0" + addons-scanner-utils "7.0.0" + ajv "8.11.0" + ajv-merge-patch "5.0.1" + chalk "4.1.2" + cheerio "1.0.0-rc.10" + columnify "1.6.0" + common-tags "1.8.2" + deepmerge "4.2.2" + eslint "8.14.0" + eslint-plugin-no-unsanitized "4.0.1" + eslint-visitor-keys "3.3.0" + espree "9.3.1" esprima "4.0.1" - first-chunk-stream "3.0.0" fluent-syntax "0.13.0" - glob "7.1.4" + glob "8.0.1" + image-size "1.0.1" is-mergeable-object "1.1.1" jed "1.1.1" - mdn-browser-compat-data "0.0.94" - os-locale "4.0.0" - pino "5.13.3" - po2json "0.4.5" - postcss "7.0.18" - probe-image-size "5.0.0" - regenerator-runtime "0.13.3" + os-locale "5.0.0" + pino "7.11.0" + postcss "8.4.13" relaxed-json "1.0.3" - semver "6.3.0" - source-map-support "0.5.13" - strip-bom-stream "4.0.0" + semver "7.3.7" + sha.js "2.4.11" + source-map-support "0.5.21" tosource "1.0.0" - upath "1.2.0" - whatwg-url "7.0.0" - yargs "14.0.0" + upath "2.0.1" + yargs "17.4.1" + yauzl "2.10.0" + +addons-moz-compare@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/addons-moz-compare/-/addons-moz-compare-1.2.0.tgz#d6246cbae224ab629cb7da397b2b9602938ea085" + integrity sha512-COG8qk2/dubPqabfcoJW4E7pm2EQDI43iMrHnhlobvq/uRMEzx/PYJ1KaUZ97Vgg44R3QdRG5CvDsTRbMUHcDw== + +addons-scanner-utils@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/addons-scanner-utils/-/addons-scanner-utils-7.0.0.tgz#8528b184f51e6552f43676221ce2a7e0aa6de15d" + integrity sha512-5j/qMzL13uGSiaFKvUNiMwyWMYD2YtEeY477q7Ahan3c90wLCwXIGCdpCfstgT3hpl44r+d6lqTIo2j2FW6uJQ== + dependencies: + "@types/yauzl" "2.9.2" + common-tags "1.8.2" + first-chunk-stream "3.0.0" + strip-bom-stream "4.0.0" + upath "2.0.1" yauzl "2.10.0" - optionalDependencies: - fsevents "2.0.7" address@1.1.2, address@^1.0.1: version "1.1.2" @@ -5581,43 +5614,30 @@ ajv-errors@^1.0.0: resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== -ajv-keywords@^1.0.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" - integrity sha1-MU3QpLM2j609/NxU7eYXG4htrzw= - ajv-keywords@^3.1.0, ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv-merge-patch@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ajv-merge-patch/-/ajv-merge-patch-4.1.0.tgz#cd580e5860ac53431d6aa901fa3d5e2eb2b74a6c" - integrity sha512-0mAYXMSauA8RZ7r+B4+EAOYcZEcO9OK5EiQCR7W7Cv4E44pJj56ZnkKLJ9/PAcOc0dT+LlV9fdDcq2TxVJfOYw== +ajv-merge-patch@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ajv-merge-patch/-/ajv-merge-patch-5.0.1.tgz#0aba921a2ea8632813478aa3d039d8134b58f876" + integrity sha512-0UP3aJCzfzBOkmLR+EinJDCfg6DNtprj3bVPo7JJNgUpZMKt097t9xxQOWFGRoB4JvKKIHE2qe0HkVaS/HyrjQ== dependencies: fast-json-patch "^2.0.6" - json-merge-patch "^0.2.3" + json-merge-patch "^1.0.2" -ajv@6.10.2: - version "6.10.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" - integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== +ajv@8.11.0, ajv@^8.0.1, ajv@^8.8.2: + version "8.11.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" + integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" uri-js "^4.2.2" -ajv@^4.7.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" - integrity sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY= - dependencies: - co "^4.6.0" - json-stable-stringify "^1.0.1" - -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.9.1: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -5627,16 +5647,6 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.2, ajv@^6.12.3, ajv@^6.12.4, ajv json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.1, ajv@^8.8.2: - version "8.8.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb" - integrity sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" @@ -5692,16 +5702,6 @@ ansi-colors@^4.1.0, ansi-colors@^4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-escapes@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" - integrity sha1-06ioOzGapneTZisT52HHkRQiMG4= - -ansi-escapes@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - ansi-escapes@^4.2.1: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.0.tgz#a4ce2b33d6b214b7950d8595c212f12ac9cc569d" @@ -5736,16 +5736,11 @@ ansi-regex@^4.1.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== -ansi-regex@^5.0.0: +ansi-regex@^5.0.0, ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -5761,11 +5756,6 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: "@types/color-name" "^1.1.1" color-convert "^2.0.1" -ansi-styles@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178" - integrity sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg= - ansi-to-html@^0.6.11: version "0.6.13" resolved "https://registry.yarnpkg.com/ansi-to-html/-/ansi-to-html-0.6.13.tgz#c72eae8b63e5ca0643aab11bfc6e6f2217425833" @@ -5856,6 +5846,11 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + args@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/args/-/args-5.0.1.tgz#4bf298df90a4799a09521362c579278cc2fdd761" @@ -6048,7 +6043,7 @@ arraybuffer.slice@~0.0.7: resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== -arrify@^1.0.0, arrify@^1.0.1: +arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= @@ -6262,11 +6257,6 @@ async@^2.0.1, async@^2.1.2, async@^2.1.4, async@^2.4.0, async@^2.5.0, async@^2.6 dependencies: lodash "^4.17.14" -async@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/async/-/async-3.1.0.tgz#42b3b12ae1b74927b5217d8c0016baaf62463772" - integrity sha512-4vx/aaY6j/j3Lw3fbCHNWP0pPaTCew3F6F3hYyl/tHs/ndmV1q7NW9T5yuJ2XAGwdQrP+6Wu20x06U4APo/iQQ== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -6282,6 +6272,11 @@ atob@^2.0.0, atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== +atomic-sleep@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" + integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== + autoprefixer@^8.0.0: version "8.1.0" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-8.1.0.tgz#374cf35be1c0e8fce97408d876f95f66f5cb4641" @@ -6353,15 +6348,6 @@ axios@^0.24.0: dependencies: follow-redirects "^1.14.4" -babel-code-frame@^6.16.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - babel-jest@^26.6.3: version "26.6.3" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.6.3.tgz#d87d25cb0037577a0c89f82e5755c5d293c01056" @@ -6982,7 +6968,7 @@ body@^5.1.0: raw-body "~1.1.0" safe-json-parse "~1.0.1" -boolbase@~1.0.0: +boolbase@^1.0.0, boolbase@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= @@ -7066,6 +7052,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^1.8.2: version "1.8.5" resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" @@ -7688,18 +7681,6 @@ callbackify@^1.1.0: resolved "https://registry.yarnpkg.com/callbackify/-/callbackify-1.1.0.tgz#d2a36986d28aa69714526c111209beeb9979d31e" integrity sha1-0qNphtKKppcUUmwREgm+65l50x4= -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= - dependencies: - callsites "^0.2.0" - -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -7858,7 +7839,7 @@ chain-function@^1.0.0: resolved "https://registry.yarnpkg.com/chain-function/-/chain-function-1.0.1.tgz#c63045e5b4b663fb86f1c6e186adaf1de402a1cc" integrity sha512-SxltgMwL9uCko5/ZCLiyG2B7R9fY4pDZUw7hJ4MhirdjBLosoDqkWABi3XMucddHdLiFJMb7PD2MZifZriuMTg== -chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2: +chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -7867,16 +7848,13 @@ chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3. escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= +chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" + ansi-styles "^4.1.0" + supports-color "^7.1.0" chalk@^3.0.0: version "3.0.0" @@ -7886,23 +7864,6 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chalk@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f" - integrity sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8= - dependencies: - ansi-styles "~1.0.0" - has-color "~0.1.0" - strip-ansi "~0.1.0" - change-case@3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/change-case/-/change-case-3.0.2.tgz#fd48746cce02f03f0a672577d1d3a8dc2eceb037" @@ -7952,11 +7913,6 @@ character-reference-invalid@^1.0.0: resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.1.tgz#942835f750e4ec61a308e60c2ef8cc1011202efc" integrity sha1-lCg191Dk7GGjCOYMLvjMEBEgLvw= -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - charenc@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" @@ -7974,17 +7930,29 @@ checkpoint-store@^1.1.0: dependencies: functional-red-black-tree "^1.0.1" -cheerio@1.0.0-rc.3, cheerio@^1.0.0-rc.2: - version "1.0.0-rc.3" - resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6" - integrity sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA== - dependencies: - css-select "~1.2.0" - dom-serializer "~0.1.1" - entities "~1.1.1" - htmlparser2 "^3.9.1" - lodash "^4.15.0" - parse5 "^3.0.1" +cheerio-select@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/cheerio-select/-/cheerio-select-1.6.0.tgz#489f36604112c722afa147dedd0d4609c09e1696" + integrity sha512-eq0GdBvxVFbqWgmCm7M3XGs1I8oLy/nExUnh6oLqmBditPO9AqQJrkslDpMun/hZ0yyTs8L0m85OHp4ho6Qm9g== + dependencies: + css-select "^4.3.0" + css-what "^6.0.1" + domelementtype "^2.2.0" + domhandler "^4.3.1" + domutils "^2.8.0" + +cheerio@1.0.0-rc.10, cheerio@^1.0.0-rc.2: + version "1.0.0-rc.10" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.10.tgz#2ba3dcdfcc26e7956fc1f440e61d51c643379f3e" + integrity sha512-g0J0q/O6mW8z5zxQ3A8E8J1hUgp4SMOvEoW/x84OwyHKe/Zccz83PVT4y5Crcr530FV6NgmKI1qvGTKVl9XXVw== + dependencies: + cheerio-select "^1.5.0" + dom-serializer "^1.3.2" + domhandler "^4.2.0" + htmlparser2 "^6.1.0" + parse5 "^6.0.1" + parse5-htmlparser2-tree-adapter "^6.0.1" + tslib "^2.2.0" chokidar@3.3.0: version "3.3.0" @@ -8124,11 +8092,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== - cjs-module-lexer@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" @@ -8176,20 +8139,6 @@ cli-boxes@^2.2.0: resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.0.tgz#538ecae8f9c6ca508e3c3c95b453fe93cb4c168d" integrity sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w== -cli-cursor@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" - integrity sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc= - dependencies: - restore-cursor "^1.0.1" - -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - cli-spinners@^2.6.0: version "2.6.1" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" @@ -8205,11 +8154,6 @@ cli-table3@0.6.0: optionalDependencies: colors "^1.1.2" -cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= - cli-width@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" @@ -8429,11 +8373,6 @@ color@^0.11.3: color-convert "^1.3.0" color-string "^0.3.0" -colorette@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" - integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== - colors@0.5.x: version "0.5.1" resolved "https://registry.yarnpkg.com/colors/-/colors-0.5.1.tgz#7d0023eaeb154e8ee9fce75dcb923d0ed1667774" @@ -8444,12 +8383,12 @@ colors@^1.1.2, colors@^1.4.0: resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== -columnify@1.5.4: - version "1.5.4" - resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" - integrity sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs= +columnify@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.6.0.tgz#6989531713c9008bb29735e61e37acf5bd553cf3" + integrity sha512-lomjuFZKfM6MSAnV9aCZC9sc0qGbmZdfygNv+nCpqVkSKdCxCklLtd16O0EILGkImHw9ZpHkAnHaB+8Zxq5W6Q== dependencies: - strip-ansi "^3.0.0" + strip-ansi "^6.0.1" wcwidth "^1.0.0" combine-source-map@^0.8.0, combine-source-map@~0.8.0: @@ -8499,12 +8438,7 @@ comment-parser@1.2.4: resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-1.2.4.tgz#489f3ee55dfd184a6e4bffb31baba284453cb760" integrity sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw== -common-tags@1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937" - integrity sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw== - -common-tags@^1.8.0: +common-tags@1.8.2, common-tags@^1.8.0: version "1.8.2" resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6" integrity sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA== @@ -8576,7 +8510,7 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -concat-stream@^1.5.0, concat-stream@^1.5.2, concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@^1.6.2, concat-stream@~1.6.0: +concat-stream@^1.5.0, concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@^1.6.2, concat-stream@~1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== @@ -9073,7 +9007,7 @@ css-loader@^3.6.0: schema-utils "^2.7.0" semver "^6.3.0" -css-select@^1.1.0, css-select@~1.2.0: +css-select@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= @@ -9083,6 +9017,17 @@ css-select@^1.1.0, css-select@~1.2.0: domutils "1.5.1" nth-check "~1.0.1" +css-select@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.3.0.tgz#db7129b2846662fd8628cfc496abb2b59e41529b" + integrity sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ== + dependencies: + boolbase "^1.0.0" + css-what "^6.0.1" + domhandler "^4.3.1" + domutils "^2.8.0" + nth-check "^2.0.1" + css-to-xpath@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/css-to-xpath/-/css-to-xpath-0.1.0.tgz#ac0d1c26cef023f7bd8cf2e1fc1f77134bc70c47" @@ -9104,6 +9049,11 @@ css-what@2.1: resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== +css-what@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" + integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== + css.escape@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb" @@ -9315,7 +9265,7 @@ debug-fabulous@^1.0.0: memoizee "0.4.X" object-assign "4.X" -debug@2, debug@2.6.9, debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9: +debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -9469,12 +9419,7 @@ deep-object-diff@^1.1.0: resolved "https://registry.yarnpkg.com/deep-object-diff/-/deep-object-diff-1.1.0.tgz#d6fabf476c2ed1751fc94d5ca693d2ed8c18bc5a" integrity sha512-b+QLs5vHgS+IoSNcUE4n9HP2NwcHj7aqnJWsjPtuG75Rh5TOaGt0OjAYInh77d5T16V5cRDC+Pw/6ZZZiETBGw== -deepmerge@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.0.0.tgz#3e3110ca29205f120d7cb064960a39c3d2087c09" - integrity sha512-YZ1rOP5+kHor4hMAH+HRQnBQHg+wvS1un1hAOuIcxcBy0hzcUf6Jg2a1w65kpoOUnurOfZbERwjI1TfZxNjcww== - -deepmerge@^4.0.0, deepmerge@^4.2.2: +deepmerge@4.2.2, deepmerge@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== @@ -9577,19 +9522,6 @@ degenerator@^3.0.1: esprima "^4.0.0" vm2 "^3.9.3" -del@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - integrity sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag= - dependencies: - globby "^5.0.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - rimraf "^2.2.8" - del@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" @@ -9951,19 +9883,6 @@ discontinuous-range@1.0.0: resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" integrity sha1-44Mx8IRLukm5qctxx3FYWqsbxlo= -dispensary@0.40.0: - version "0.40.0" - resolved "https://registry.yarnpkg.com/dispensary/-/dispensary-0.40.0.tgz#dedc4a4e4aebae7afcb6ae91f03e292ba107fe67" - integrity sha512-ttKDQvGBf+ygQ4rXuLBLErp3kMJIS+Gfmy+nJ6N/EfV8/RQdjd9SORpc729YK5SYAI+IuBo88S2xGUjKjU2jYw== - dependencies: - async "~3.1.0" - natural-compare-lite "~1.4.0" - pino "~5.13.0" - request "~2.88.0" - sha.js "~2.4.4" - source-map-support "~0.5.4" - yargs "~14.0.0" - disposables@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/disposables/-/disposables-1.0.2.tgz#36c6a674475f55a2d6913567a601444e487b4b6e" @@ -10019,7 +9938,7 @@ doctrine@1.5.0: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^2.0.0, doctrine@^2.1.0: +doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== @@ -10060,7 +9979,7 @@ dom-helpers@^5.0.1: "@babel/runtime" "^7.8.7" csstype "^2.6.7" -dom-serializer@0, dom-serializer@~0.1.1: +dom-serializer@0: version "0.1.1" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== @@ -10068,6 +9987,15 @@ dom-serializer@0, dom-serializer@~0.1.1: domelementtype "^1.3.0" entities "^1.1.1" +dom-serializer@^1.0.1, dom-serializer@^1.3.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30" + integrity sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag== + dependencies: + domelementtype "^2.0.1" + domhandler "^4.2.0" + entities "^2.0.0" + dom-walk@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" @@ -10083,6 +10011,11 @@ domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== +domelementtype@^2.0.1, domelementtype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" + integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== + domexception@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.0.tgz#81fe5df81b3f057052cde3a9fa9bf536a85b9ab0" @@ -10102,6 +10035,13 @@ domhandler@^2.3.0: dependencies: domelementtype "1" +domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" + integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== + dependencies: + domelementtype "^2.2.0" + domutils@1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" @@ -10118,6 +10058,15 @@ domutils@^1.5.1: dom-serializer "0" domelementtype "1" +domutils@^2.5.2, domutils@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" + integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== + dependencies: + dom-serializer "^1.0.1" + domelementtype "^2.2.0" + domhandler "^4.2.0" + dot-case@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-2.1.1.tgz#34dcf37f50a8e93c2b3bca8bb7fb9155c7da3bee" @@ -10216,10 +10165,10 @@ duplexify@^3.1.2, duplexify@^3.4.2, duplexify@^3.5.0, duplexify@^3.5.1: readable-stream "^2.0.0" stream-shift "^1.0.0" -duplexify@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.1.tgz#7027dc374f157b122a8ae08c2d3ea4d2d953aa61" - integrity sha512-DY3xVEmVHTv1wSzKNbwoU6nVjzI369Y6sPoqfYr0/xlx3IdX2n94xIszTcjPO8W8ZIv0Wb0PXNcjuZyT4wiICA== +duplexify@^4.1.1, duplexify@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.2.tgz#18b4f8d28289132fa0b9573c898d9f903f81c7b0" + integrity sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw== dependencies: end-of-stream "^1.4.1" inherits "^2.0.3" @@ -10353,13 +10302,6 @@ encoding-down@~5.0.0: level-errors "^2.0.0" xtend "^4.0.1" -encoding@^0.1.11: - version "0.1.12" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" - integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= - dependencies: - iconv-lite "~0.4.13" - end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.0, end-of-stream@^1.4.1, end-of-stream@^1.4.4: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" @@ -10448,11 +10390,16 @@ enquirer@^2.3.5: dependencies: ansi-colors "^4.1.1" -entities@^1.1.1, entities@^1.1.2, entities@~1.1.1: +entities@^1.1.1, entities@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== +entities@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" + integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== + env-paths@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43" @@ -10625,7 +10572,7 @@ es6-iterator@2.0.3, es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0. es5-ext "^0.10.35" es6-symbol "^3.1.1" -es6-map@^0.1.3, es6-map@^0.1.5: +es6-map@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" integrity sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA= @@ -10647,11 +10594,6 @@ es6-promise@^4.2.8: resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== -es6-promisify@6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-6.0.2.tgz#525c23725b8510f5f1f2feb5a1fbad93a93e29b4" - integrity sha512-eO6vFm0JvqGzjWIQA6QVKjxpmELfhWbDUWHm1rPfIbn55mhKPiAa5xpLmQWJrNa629ZIeQ8ZvMAi13kvrjK6Mg== - es6-set@^0.1.5, es6-set@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" @@ -10735,16 +10677,6 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -escope@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - integrity sha1-4Bl16BJ4GhY6ba392AOY3GTIicM= - dependencies: - es6-map "^0.1.3" - es6-weak-map "^2.0.1" - esrecurse "^4.1.0" - estraverse "^4.1.1" - eslint-config-prettier@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.1.0.tgz#4ef1eaf97afe5176e6a75ddfb57c335121abc5a6" @@ -10834,12 +10766,10 @@ eslint-plugin-mocha@^8.1.0: eslint-utils "^2.1.0" ramda "^0.27.1" -eslint-plugin-no-unsafe-innerhtml@1.0.16: - version "1.0.16" - resolved "https://registry.yarnpkg.com/eslint-plugin-no-unsafe-innerhtml/-/eslint-plugin-no-unsafe-innerhtml-1.0.16.tgz#7d02878c8e9bf7916b88836d5ac122b42f151932" - integrity sha1-fQKHjI6b95FriINtWsEitC8VGTI= - dependencies: - eslint "^3.7.1" +eslint-plugin-no-unsanitized@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-4.0.1.tgz#e2343265467ba2270ade478cbe07bbafeaea412d" + integrity sha512-y/lAMWnPPC7RYuUdxlEL/XiCL8FehN9h9s3Kjqbp/Kv0i9NZs+IXSC2kS546Fa4Bumwy31HlVS/OdWX0Kxb5Xg== eslint-plugin-node@^11.1.0: version "11.1.0" @@ -10904,12 +10834,13 @@ eslint-scope@^5.1.0, eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-utils@^1.3.1: - version "1.4.3" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" - integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== dependencies: - eslint-visitor-keys "^1.1.0" + esrecurse "^4.3.0" + estraverse "^5.2.0" eslint-utils@^2.0.0, eslint-utils@^2.1.0: version "2.1.0" @@ -10925,12 +10856,12 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" - integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== +eslint-visitor-keys@3.3.0, eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== @@ -10940,88 +10871,46 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@5.16.0: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== +eslint@8.14.0: + version "8.14.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.14.0.tgz#62741f159d9eb4a79695b28ec4989fcdec623239" + integrity sha512-3/CE4aJX7LNEiE3i6FeodHmI/38GZtWCsAtsymScmzYapx8q1nVVb+eLcLSzATmCPXw5pT4TqVs1E0OmxAd9tw== dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.9.1" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" + "@eslint/eslintrc" "^1.2.2" + "@humanwhocodes/config-array" "^0.9.2" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" doctrine "^3.0.0" - eslint-scope "^4.0.3" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^5.0.1" - esquery "^1.0.1" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.3.1" + esquery "^1.4.0" esutils "^2.0.2" - file-entry-cache "^5.0.1" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.7.0" - ignore "^4.0.6" + glob-parent "^6.0.1" + globals "^13.6.0" + ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.2.2" - js-yaml "^3.13.0" + is-glob "^4.0.0" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.11" + levn "^0.4.1" + lodash.merge "^4.6.2" minimatch "^3.0.4" - mkdirp "^0.5.1" natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" - table "^5.2.3" + optionator "^0.9.1" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" text-table "^0.2.0" - -eslint@^3.7.1: - version "3.19.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" - integrity sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw= - dependencies: - babel-code-frame "^6.16.0" - chalk "^1.1.3" - concat-stream "^1.5.2" - debug "^2.1.1" - doctrine "^2.0.0" - escope "^3.6.0" - espree "^3.4.0" - esquery "^1.0.0" - estraverse "^4.2.0" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - glob "^7.0.3" - globals "^9.14.0" - ignore "^3.2.0" - imurmurhash "^0.1.4" - inquirer "^0.12.0" - is-my-json-valid "^2.10.0" - is-resolvable "^1.0.0" - js-yaml "^3.5.1" - json-stable-stringify "^1.0.0" - levn "^0.3.0" - lodash "^4.0.0" - mkdirp "^0.5.0" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.1" - pluralize "^1.2.1" - progress "^1.1.8" - require-uncached "^1.0.2" - shelljs "^0.7.5" - strip-bom "^3.0.0" - strip-json-comments "~2.0.1" - table "^3.7.8" - text-table "~0.2.0" - user-home "^2.0.0" + v8-compile-cache "^2.0.3" eslint@^7.23.0: version "7.23.0" @@ -11071,31 +10960,14 @@ esm@^3.2.25: resolved "https://registry.yarnpkg.com/esm/-/esm-3.2.25.tgz#342c18c29d56157688ba5ce31f8431fbb795cc10" integrity sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA== -espree@6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.1.tgz#7f80e5f7257fc47db450022d723e356daeb1e5de" - integrity sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ== - dependencies: - acorn "^7.0.0" - acorn-jsx "^5.0.2" - eslint-visitor-keys "^1.1.0" - -espree@^3.4.0: - version "3.5.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca" - integrity sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ== - dependencies: - acorn "^5.2.1" - acorn-jsx "^3.0.0" - -espree@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" - integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== +espree@9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.1.tgz#8793b4bc27ea4c778c19908e0719e7b8f4115bcd" + integrity sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ== dependencies: - acorn "^6.0.7" - acorn-jsx "^5.0.0" - eslint-visitor-keys "^1.0.0" + acorn "^8.7.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^3.3.0" espree@^7.3.0, espree@^7.3.1: version "7.3.1" @@ -11106,12 +10978,21 @@ espree@^7.3.0, espree@^7.3.1: acorn-jsx "^5.3.1" eslint-visitor-keys "^1.3.0" +espree@^9.3.1, espree@^9.3.2: + version "9.3.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.2.tgz#f58f77bd334731182801ced3380a8cc859091596" + integrity sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA== + dependencies: + acorn "^8.7.1" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.3.0" + esprima@4.0.1, esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.0.0, esquery@^1.0.1, esquery@^1.4.0: +esquery@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== @@ -11979,11 +11860,6 @@ execall@^2.0.0: dependencies: clone-regexp "^2.1.0" -exit-hook@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" - integrity sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g= - exit-on-epipe@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" @@ -12111,7 +11987,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@3.0.2, extend@^3.0.0, extend@~3.0.2: +extend@^3.0.0, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -12123,15 +11999,6 @@ extension-port-stream@^2.0.0, extension-port-stream@^2.0.1: dependencies: webextension-polyfill-ts "^0.22.0" -external-editor@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" - integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -12298,6 +12165,11 @@ fast-redact@^1.4.4: resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-1.5.0.tgz#302892f566750c4f5eec7b830bfc9bc473484034" integrity sha512-Afo61CgUjkzdvOKDHn08qnZ0kwck38AOGcMlvSGzvJbIab6soAP5rdoQayecGCDsD69AiF9vJBXyq31eoEO2tQ== +fast-redact@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.1.1.tgz#790fcff8f808c2e12fabbfb2be5cb2deda448fa0" + integrity sha512-odVmjC8x8jNeMZ3C+rPMESzXVSEU8tSWSHv9HFxP2mm89G/1WwqhrerJDQm9Zus8X6aoRgQDThKqptdNA6bt+A== + fast-safe-stringify@^2.0.6, fast-safe-stringify@^2.0.7: version "2.1.1" resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" @@ -12362,29 +12234,6 @@ figgy-pudding@^3.5.1: resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== -figures@^1.3.5: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" - integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= - dependencies: - escape-string-regexp "^1.0.5" - object-assign "^4.1.0" - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= - dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" - file-entry-cache@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" @@ -12656,16 +12505,6 @@ flagged-respawn@^1.0.0: resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.0.tgz#4e79ae9b2eb38bf86b3bb56bf3e0a56aa5fcabd7" integrity sha1-Tnmumy6zi/hrO7Vr8+ClaqX8q9c= -flat-cache@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" - integrity sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE= - dependencies: - circular-json "^0.3.1" - del "^2.0.2" - graceful-fs "^4.1.2" - write "^0.2.1" - flat-cache@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" @@ -12968,11 +12807,6 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.0.7.tgz#382c9b443c6cbac4c57187cdda23aa3bf1ccfc2a" - integrity sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ== - fsevents@^1.2.7: version "1.2.9" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" @@ -13095,20 +12929,6 @@ geckodriver@^1.21.0: https-proxy-agent "5.0.0" tar "6.0.2" -generate-function@^2.0.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f" - integrity sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ== - dependencies: - is-property "^1.0.2" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - integrity sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA= - dependencies: - is-property "^1.0.0" - generic-names@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/generic-names/-/generic-names-2.0.1.tgz#f8a378ead2ccaa7a34f0317b05554832ae41b872" @@ -13239,13 +13059,6 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -gettext-parser@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/gettext-parser/-/gettext-parser-1.1.0.tgz#2c5a6638d893934b9b55037d0ad82cb7004b2679" - integrity sha1-LFpmONiTk0ubVQN9CtgstwBLJnk= - dependencies: - encoding "^0.1.11" - git-up@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/git-up/-/git-up-4.0.1.tgz#cb2ef086653640e721d2042fe3104857d89007c0" @@ -13311,6 +13124,13 @@ glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@^5.1.1, glob-parent@~5.1.0, dependencies: is-glob "^4.0.1" +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + glob-promise@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/glob-promise/-/glob-promise-3.4.0.tgz#b6b8f084504216f702dc2ce8c9bc9ac8866fdb20" @@ -13363,15 +13183,15 @@ glob@7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@7.1.4: - version "7.1.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" - integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== +glob@8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.1.tgz#00308f5c035aa0b2a447cd37ead267ddff1577d3" + integrity sha512-cF7FYZZ47YzmCu7dDy50xSRRfO3ErRfrXuLZcNIuyiJEco0XSrGtuilG19L5xp3NcwTx7Gn+X6Tv3fmsUPTbow== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.0.4" + minimatch "^5.0.1" once "^1.3.0" path-is-absolute "^1.0.0" @@ -13469,7 +13289,7 @@ global@~4.3.0: min-document "^2.19.0" process "~0.5.1" -globals@^11.1.0, globals@^11.7.0: +globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== @@ -13481,18 +13301,13 @@ globals@^12.1.0: dependencies: type-fest "^0.8.1" -globals@^13.6.0: - version "13.7.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.7.0.tgz#aed3bcefd80ad3ec0f0be2cf0c895110c0591795" - integrity sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA== +globals@^13.6.0, globals@^13.9.0: + version "13.15.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.15.0.tgz#38113218c907d2f7e98658af246cef8b77e90bac" + integrity sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog== dependencies: type-fest "^0.20.2" -globals@^9.14.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== - globalthis@^1.0.0, globalthis@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.1.tgz#40116f5d9c071f9e8fb0037654df1ab3a83b7ef9" @@ -13518,23 +13333,11 @@ globby@^11.0.1, globby@^11.0.2, globby@^11.0.3, globby@^11.0.4: integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== dependencies: array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" - slash "^3.0.0" - -globby@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" - integrity sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0= - dependencies: - array-union "^1.0.1" - arrify "^1.0.0" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" globby@^6.1.0: version "6.1.0" @@ -13920,13 +13723,6 @@ hard-rejection@^2.1.0: resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - has-bigints@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" @@ -13939,11 +13735,6 @@ has-binary2@~1.0.2: dependencies: isarray "2.0.1" -has-color@~0.1.0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f" - integrity sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8= - has-cors@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" @@ -14312,7 +14103,7 @@ htmlescape@^1.1.0, htmlescape@^1.1.1: resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" integrity sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E= -htmlparser2@^3.10.0, htmlparser2@^3.3.0, htmlparser2@^3.9.1: +htmlparser2@^3.10.0, htmlparser2@^3.3.0: version "3.10.1" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== @@ -14324,6 +14115,16 @@ htmlparser2@^3.10.0, htmlparser2@^3.3.0, htmlparser2@^3.9.1: inherits "^2.0.1" readable-stream "^3.1.1" +htmlparser2@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" + integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A== + dependencies: + domelementtype "^2.0.1" + domhandler "^4.0.0" + domutils "^2.5.2" + entities "^2.0.0" + http-assert@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/http-assert/-/http-assert-1.4.1.tgz#c5f725d677aa7e873ef736199b89686cceb37878" @@ -14488,7 +14289,7 @@ hyphenate-style-name@^1.0.3: resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.3.tgz#097bb7fa0b8f1a9cf0bd5c734cf95899981a9b48" integrity sha512-EcuixamT82oplpoJ2XU4pDtKGWQ7b00CD9f1ug9IaQ3p1bkHMiKCZ9ut9QDI6qsa6cpUuB+A/I+zLtdNK4n2DQ== -iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.4: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -14550,20 +14351,22 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^3.2.0: - version "3.3.7" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" - integrity sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA== - ignore@^4.0.3, ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.1, ignore@^5.1.4, ignore@^5.1.8: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +ignore@^5.1.1, ignore@^5.1.4, ignore@^5.1.8, ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + +image-size@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/image-size/-/image-size-1.0.1.tgz#86d6cfc2b1d19eab5d2b368d4b9194d9e48541c5" + integrity sha512-VAwkvNSNGClRw9mDHhc5Efax8PLlsOGcUTh0T/LIriC8vPA3U5PdqXWqkz406MoYHMKW8Uf9gWr05T/rYB44kQ== + dependencies: + queue "6.0.2" immediate@^3.2.3, immediate@~3.2.3: version "3.2.3" @@ -14681,44 +14484,6 @@ inline-style-parser@0.1.1: resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== -inquirer@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" - integrity sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34= - dependencies: - ansi-escapes "^1.1.0" - ansi-regex "^2.0.0" - chalk "^1.0.0" - cli-cursor "^1.0.1" - cli-width "^2.0.0" - figures "^1.3.5" - lodash "^4.3.0" - readline2 "^1.0.1" - run-async "^0.1.0" - rx-lite "^3.1.2" - string-width "^1.0.1" - strip-ansi "^3.0.0" - through "^2.3.6" - -inquirer@^6.2.2: - version "6.3.1" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.3.1.tgz#7a413b5e7950811013a3db491c61d1f3b776e8e7" - integrity sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA== - dependencies: - ansi-escapes "^3.2.0" - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^2.0.0" - lodash "^4.17.11" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.4.0" - string-width "^2.1.0" - strip-ansi "^5.1.0" - through "^2.3.6" - insert-module-globals@^7.0.0, insert-module-globals@^7.2.1: version "7.2.1" resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.2.1.tgz#d5e33185181a4e1f33b15f7bf100ee91890d5cb3" @@ -15623,10 +15388,10 @@ is-glob@^3.0.0, is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" @@ -15699,22 +15464,6 @@ is-mergeable-object@1.1.1: resolved "https://registry.yarnpkg.com/is-mergeable-object/-/is-mergeable-object-1.1.1.tgz#faaa3ed1cfce87d6f7d2f5885e92cc30af3e2ebf" integrity sha512-CPduJfuGg8h8vW74WOxHtHmtQutyQBzR+3MjQ6iDHIYdbOnm1YC7jv43SqCoU8OPGTJD4nibmiryA4kmogbGrA== -is-my-ip-valid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" - integrity sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ== - -is-my-json-valid@^2.10.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.20.0.tgz#1345a6fca3e8daefc10d0fa77067f54cedafd59a" - integrity sha512-XTHBZSIIxNsIsZXg7XB5l8z/OBFosl1Wao4tXLpeC7eKU4Vm/kdop2azkPqULwnfGQjmeDIyey9g7afMMtdWAA== - dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - is-my-ip-valid "^1.0.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" - is-nan@^1.2.1: version "1.3.2" resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" @@ -15875,11 +15624,6 @@ is-promise@~1, is-promise@~1.0.0: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-1.0.1.tgz#31573761c057e33c2e91aab9e96da08cefbe76e5" integrity sha1-MVc3YcBX4zwukaq56W2gjO++duU= -is-property@^1.0.0, is-property@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - integrity sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ= - is-pull-stream@0.0.0, is-pull-stream@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/is-pull-stream/-/is-pull-stream-0.0.0.tgz#a3bc3d1c6d3055151c46bde6f399efed21440ca9" @@ -15920,11 +15664,6 @@ is-relative@^1.0.0: dependencies: is-unc-path "^1.0.0" -is-resolvable@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.1.tgz#acca1cd36dbe44b974b924321555a70ba03b1cf4" - integrity sha512-y5CXYbzvB3jTnWAZH1Nl7ykUWb6T3BcTs56HUruwBf8MhF56n1HWqhDWnVFo8GHrUPDgvUUNVhrc2U8W7iqz5g== - is-retry-allowed@^1.0.0, is-retry-allowed@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" @@ -16660,11 +16399,6 @@ js-string-escape@^1.0.1: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - js-yaml@3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" @@ -16673,7 +16407,7 @@ js-yaml@3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.14.0, js-yaml@^3.5.1: +js-yaml@^3.13.1, js-yaml@^3.14.0: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -16681,6 +16415,13 @@ js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.14.0, js-yaml@^3.5.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsan@^3.1.13: version "3.1.13" resolved "https://registry.yarnpkg.com/jsan/-/jsan-3.1.13.tgz#4de8c7bf8d1cfcd020c313d438f930cec4b91d86" @@ -16784,12 +16525,12 @@ json-buffer@3.0.0: resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= -json-merge-patch@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-merge-patch/-/json-merge-patch-0.2.3.tgz#fa2c6b5af87da77bae2966a589d52e23ed81fe40" - integrity sha1-+ixrWvh9p3uuKWalidUuI+2B/kA= +json-merge-patch@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-merge-patch/-/json-merge-patch-1.0.2.tgz#c4626811943b2f362f8607ae8f03d528875465b0" + integrity sha512-M6Vp2GN9L7cfuMXiWOmHj9bEFbeC250iVtcKQbqVgEsDVYnIsrNsbU+h/Y/PkbBQCtEa4Bez+Ebv0zfbC8ObLg== dependencies: - deep-equal "^1.0.0" + fast-deep-equal "^3.1.3" json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" @@ -16943,11 +16684,6 @@ jsonparse@^1.2.0: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - integrity sha1-T9kss04OnbPInIYi7PUfm5eMbLk= - jsonschema@1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.2.2.tgz#83ab9c63d65bf4d596f91d81195e78772f6452bc" @@ -17652,14 +17388,6 @@ leven@^3.1.0: resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -17668,6 +17396,14 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + libp2p-bootstrap@~0.9.3: version "0.9.7" resolved "https://registry.yarnpkg.com/libp2p-bootstrap/-/libp2p-bootstrap-0.9.7.tgz#eabedab24775a6175f07ce035b716e8114d84a76" @@ -18342,6 +18078,11 @@ lodash.memoize@~3.0.3: resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" integrity sha1-LcvSwofLwKVcxCMovQxzYVDVPj8= +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + lodash.partition@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.partition/-/lodash.partition-4.6.0.tgz#a38e46b73469e0420b0da1212e66d414be364ba4" @@ -18377,7 +18118,7 @@ lodash.uniqby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" integrity sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI= -lodash@=3.10.1, lodash@^4.0.0, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.16.4, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.7.0, lodash@~4.17.2: +lodash@=3.10.1, lodash@^4.13.1, lodash@^4.16.4, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.7.0, lodash@~4.17.2: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -18734,13 +18475,6 @@ mdast-util-to-string@^1.0.0: resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz#27055500103f51637bd07d01da01eb1967a43527" integrity sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A== -mdn-browser-compat-data@0.0.94: - version "0.0.94" - resolved "https://registry.yarnpkg.com/mdn-browser-compat-data/-/mdn-browser-compat-data-0.0.94.tgz#eaa1653761ce95881ea1858a8c0ce6066d85f94b" - integrity sha512-O3zJqbmehz0Hn3wpk62taA0+jNF7yn6BDWqQ9Wh2bEoO9Rx1BYiTmNX565eNVbW0ixfQkY6Sp9FvY/rr79Qmyg== - dependencies: - extend "3.0.2" - mdurl@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" @@ -19037,11 +18771,6 @@ mime@^2.4.4: resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== -mimic-fn@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" - integrity sha1-5md4PZLonb00KBi1IwudYqZyrRg= - mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -19088,13 +18817,27 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4: +minimatch@3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" +minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== + dependencies: + brace-expansion "^2.0.1" + minimist-options@^4.0.2: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -19621,16 +19364,6 @@ mute-stdout@^1.0.0: resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== -mute-stream@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" - integrity sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA= - -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= - mute-stream@^0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" @@ -19646,10 +19379,10 @@ nanoid@^2.0.0, nanoid@^2.1.6: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280" integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA== -nanoid@^3.1.23, nanoid@^3.1.31: - version "3.2.0" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c" - integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA== +nanoid@^3.1.31, nanoid@^3.3.3: + version "3.3.4" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" + integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== nanomatch@^1.2.9: version "1.2.9" @@ -19696,11 +19429,6 @@ native-url@^0.2.6: dependencies: querystring "^0.2.0" -natural-compare-lite@~1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" - integrity sha1-F7CVgZiJef3a/gIB6TG6kzyWy7Q= - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -20048,14 +19776,6 @@ nofilter@^1.0.4: resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-1.0.4.tgz#78d6f4b6a613e7ced8b015cec534625f7667006e" integrity sha512-N8lidFp+fCz+TD51+haYdbDGrcBWwuHX40F5+z0qkUjMJ5Tp+rdSuAkMJ9N9eoolDlEVTf6u5icM+cNKkKW2mA== -nomnom@1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.8.1.tgz#2151f722472ba79e50a76fc125bb8c8f2e4dc2a7" - integrity sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc= - dependencies: - chalk "~0.4.0" - underscore "~1.6.0" - nomnom@~1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.6.2.tgz#84a66a260174408fc5b77a18f888eccc44fb6971" @@ -20192,6 +19912,13 @@ npmlog@^4.0.1, npmlog@^4.0.2, npmlog@^4.1.2: gauge "~2.7.3" set-blocking "~2.0.0" +nth-check@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.0.1.tgz#2efe162f5c3da06a28959fbd3db75dbeea9f0fc2" + integrity sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w== + dependencies: + boolbase "^1.0.0" + nth-check@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" @@ -20445,6 +20172,11 @@ observable-webworkers@^1.0.0: resolved "https://registry.yarnpkg.com/observable-webworkers/-/observable-webworkers-1.0.0.tgz#dcbd484a9644d512accc351962c6e710313fbb68" integrity sha512-+cECwCR8IEh8UY5nefQVLO9Cydqpk1izO+o7BABmKjXfJZyEOzBWY3ss5jbOPM6KmEa9aQExvAtTW6tVTOsNAQ== +on-exit-leak-free@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/on-exit-leak-free/-/on-exit-leak-free-0.2.0.tgz#b39c9e3bf7690d890f4861558b0d7b90a442d209" + integrity sha512-dqaz3u44QbRXQooZLTUKU41ZrzYrcvLISVgbrzbyCMxpmSLJvZ3ZamIJIZ29P6OhZIkNIQKosdeM6t1LYbA9hg== + on-finished@^2.3.0, on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -20464,18 +20196,6 @@ once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.3.3, once@^1.4.0: dependencies: wrappy "1" -onetime@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" - integrity sha1-ofeDj4MUxRbwXs78vEzP4EtO14k= - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - onetime@^5.1.0, onetime@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" @@ -20513,7 +20233,7 @@ optional@^0.1.3: resolved "https://registry.yarnpkg.com/optional/-/optional-0.1.4.tgz#cdb1a9bedc737d2025f690ceeb50e049444fd5b3" integrity sha512-gtvrrCfkE08wKcgXaVwQVgwEQ8vel2dc5DDBn9RLQZ3YtmtkBss6A2HY6BnJH4N/4Ku97Ri/SF8sNWE2225WJw== -optionator@^0.8.1, optionator@^0.8.2: +optionator@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= @@ -20691,12 +20411,12 @@ os-homedir@^1.0.0: resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= -os-locale@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-4.0.0.tgz#06e4fb102f38f33e9e904f41af3c34a5aa3b2b7b" - integrity sha512-HsSR1+2l6as4Wp2SGZxqLnuFHxVvh1Ir9pvZxyujsC13egZVe7P0YeBLN0ijQzM/twrO5To3ia3jzBXAvpMTEA== +os-locale@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-5.0.0.tgz#6d26c1d95b6597c5d5317bf5fba37eccec3672e0" + integrity sha512-tqZcNEDAIZKBEPnHPlVDvKrp7NzgLi7jRmhKiUoa2NUmhl13FtkAGLUVR+ZsYvApBQdBfYm43A4tXXQ4IrYLBA== dependencies: - execa "^1.0.0" + execa "^4.0.0" lcid "^3.0.0" mem "^5.0.0" @@ -21139,12 +20859,19 @@ parse-url@^5.0.0: parse-path "^4.0.0" protocols "^1.4.0" -parse5@6.0.1, parse5@^6.0.0: +parse5-htmlparser2-tree-adapter@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6" + integrity sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA== + dependencies: + parse5 "^6.0.1" + +parse5@6.0.1, parse5@^6.0.0, parse5@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== -parse5@^3.0.1, parse5@^3.0.2: +parse5@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" integrity sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA== @@ -21250,7 +20977,7 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@1.0.2, path-is-inside@^1.0.1, path-is-inside@^1.0.2: +path-is-inside@1.0.2, path-is-inside@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= @@ -21499,6 +21226,14 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= +pino-abstract-transport@v0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/pino-abstract-transport/-/pino-abstract-transport-0.5.0.tgz#4b54348d8f73713bfd14e3dc44228739aa13d9c0" + integrity sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ== + dependencies: + duplexify "^4.1.2" + split2 "^4.0.0" + pino-pretty@^2.5.0: version "2.6.1" resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-2.6.1.tgz#b5a8e28137deb1629428931d98c708b51f0e9555" @@ -21519,7 +21254,29 @@ pino-std-serializers@^2.3.0: resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-2.4.2.tgz#cb5e3e58c358b26f88969d7e619ae54bdfcc1ae1" integrity sha512-WaL504dO8eGs+vrK+j4BuQQq6GLKeCCcHaMB2ItygzVURcL1CycwNEUHTD/lHFHs/NL5qAz2UKrjYWXKSf4aMQ== -pino@5.13.3, pino@^5.12.3, pino@~5.13.0: +pino-std-serializers@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-4.0.0.tgz#1791ccd2539c091ae49ce9993205e2cd5dbba1e2" + integrity sha512-cK0pekc1Kjy5w9V2/n+8MkZwusa6EyyxfeQCB799CQRhRt/CqYKiWs5adeu8Shve2ZNffvfC/7J64A2PJo1W/Q== + +pino@7.11.0: + version "7.11.0" + resolved "https://registry.yarnpkg.com/pino/-/pino-7.11.0.tgz#0f0ea5c4683dc91388081d44bff10c83125066f6" + integrity sha512-dMACeu63HtRLmCG8VKdy4cShCPKaYDR4youZqoSWLxl5Gu99HUw8bw75thbPv9Nip+H+QYX8o3ZJbTdVZZ2TVg== + dependencies: + atomic-sleep "^1.0.0" + fast-redact "^3.0.0" + on-exit-leak-free "^0.2.0" + pino-abstract-transport v0.5.0 + pino-std-serializers "^4.0.0" + process-warning "^1.0.0" + quick-format-unescaped "^4.0.3" + real-require "^0.1.0" + safe-stable-stringify "^2.1.0" + sonic-boom "^2.2.1" + thread-stream "^0.15.1" + +pino@^5.12.3: version "5.13.3" resolved "https://registry.yarnpkg.com/pino/-/pino-5.13.3.tgz#26cd6f69b4bd03d6408af28eddcd9313687f143d" integrity sha512-FL12DKlPwBlbhztlUz6kseR03PRR8nD+wvLdN/Sji9UiBYYfSjX+k8ocU7/NwW55JdFRONTn3iACoelXnMFVVQ== @@ -21590,11 +21347,6 @@ plugin-error@1.0.1, plugin-error@^1.0.1: arr-union "^3.1.0" extend-shallow "^3.0.2" -pluralize@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" - integrity sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU= - pn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" @@ -21607,14 +21359,6 @@ pnp-webpack-plugin@1.6.4: dependencies: ts-pnp "^1.1.6" -po2json@0.4.5: - version "0.4.5" - resolved "https://registry.yarnpkg.com/po2json/-/po2json-0.4.5.tgz#47bb2952da32d58a1be2f256a598eebc0b745118" - integrity sha1-R7spUtoy1Yob4vJWpZjuvAt0URg= - dependencies: - gettext-parser "1.1.0" - nomnom "1.8.1" - polished@^4.0.5: version "4.1.3" resolved "https://registry.yarnpkg.com/polished/-/polished-4.1.3.tgz#7a3abf2972364e7d97770b827eec9a9e64002cfc" @@ -21851,15 +21595,6 @@ postcss-values-parser@^2.0.1: indexes-of "^1.0.1" uniq "^1.0.1" -postcss@7.0.18: - version "7.0.18" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.18.tgz#4b9cda95ae6c069c67a4d933029eddd4838ac233" - integrity sha512-/7g1QXXgegpF+9GJj4iN7ChGF40sYuGYJ8WZu8DZWnmhQ/G36hfdk3q9LBJmoK+lZ+yzZ5KYpOoxq7LF1BxE8g== - dependencies: - chalk "^2.4.2" - source-map "^0.6.1" - supports-color "^6.1.0" - postcss@7.0.21: version "7.0.21" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.21.tgz#06bb07824c19c2021c5d056d5b10c35b989f7e17" @@ -21869,6 +21604,15 @@ postcss@7.0.21: source-map "^0.6.1" supports-color "^6.1.0" +postcss@8.4.13, postcss@^8.1.10, postcss@^8.1.7: + version "8.4.13" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.13.tgz#7c87bc268e79f7f86524235821dfdf9f73e5d575" + integrity sha512-jtL6eTBrza5MPzy8oJLFuUscHDXTV5KcLlqAWHl5q5WYRfnNRGSmOZmOZ1T6Gy7A99mOZfqungmZMpMmCVJ8ZA== + dependencies: + nanoid "^3.3.3" + picocolors "^1.0.0" + source-map-js "^1.0.2" + postcss@^6.0.1, postcss@^6.0.19, postcss@^6.0.23: version "6.0.23" resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324" @@ -21886,15 +21630,6 @@ postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.2, postcss@^7.0.21, postcss@^7.0. picocolors "^0.2.1" source-map "^0.6.1" -postcss@^8.1.10, postcss@^8.1.7: - version "8.3.6" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.6.tgz#2730dd76a97969f37f53b9a6096197be311cc4ea" - integrity sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A== - dependencies: - colorette "^1.2.2" - nanoid "^3.1.23" - source-map-js "^0.6.2" - postmsg-rpc@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/postmsg-rpc/-/postmsg-rpc-2.4.0.tgz#4e2daf6851852364696debd5d6bf6936d1424cdf" @@ -22067,17 +21802,6 @@ prismjs@^1.21.0, prismjs@~1.22.0: optionalDependencies: clipboard "^2.0.0" -probe-image-size@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/probe-image-size/-/probe-image-size-5.0.0.tgz#1b87d20340ab8fcdb4324ec77fbc8a5f53419878" - integrity sha512-V6uBYw5eBc5UVIE7MUZD6Nxg0RYuGDWLDenEn0B1WC6PcTvn1xdQ6HLDDuznefsiExC6rNrCz7mFRBo0f3Xekg== - dependencies: - deepmerge "^4.0.0" - inherits "^2.0.3" - next-tick "^1.0.0" - request "^2.83.0" - stream-parser "~0.3.1" - process-nextick-args@^1.0.6, process-nextick-args@^1.0.7, process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" @@ -22095,6 +21819,11 @@ process-on-spawn@^1.0.0: dependencies: fromentries "^1.2.0" +process-warning@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-1.0.0.tgz#980a0b25dc38cd6034181be4b7726d89066b4616" + integrity sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q== + process@^0.11.10, process@~0.11.0: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" @@ -22105,11 +21834,6 @@ process@~0.5.1: resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8= -progress@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" - integrity sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74= - progress@^2.0.0, progress@^2.0.1, progress@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" @@ -22677,11 +22401,23 @@ queue-microtask@^1.2.3: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +queue@6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/queue/-/queue-6.0.2.tgz#b91525283e2315c7553d2efa18d83e76432fed65" + integrity sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA== + dependencies: + inherits "~2.0.3" + quick-format-unescaped@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-3.0.2.tgz#0137e94d8fb37ffeb70040535111c378e75396fb" integrity sha512-FXTaCkwvpIlkdKeGDNgcq07SXWS383noQUuZjvdE1QcTt+eLuqof6/BDiEPqB59FWLie/l91+HtlJSw7iCViSA== +quick-format-unescaped@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz#93ef6dd8d3453cbc7970dd614fad4c5954d6b5a7" + integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg== + quick-lru@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" @@ -23412,14 +23148,10 @@ readdirp@~3.2.0: dependencies: picomatch "^2.0.4" -readline2@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" - integrity sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - mute-stream "0.0.5" +real-require@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/real-require/-/real-require-0.1.0.tgz#736ac214caa20632847b7ca8c1056a0767df9381" + integrity sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg== receptacle@^1.3.2: version "1.3.2" @@ -23514,7 +23246,7 @@ regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== -regenerator-runtime@0.13.3, regenerator-runtime@^0.11.0, regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: +regenerator-runtime@^0.11.0, regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: version "0.13.7" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== @@ -23554,15 +23286,10 @@ regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.3.1: call-bind "^1.0.2" define-properties "^1.1.3" -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== - -regexpp@^3.0.0, regexpp@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" - integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== +regexpp@^3.0.0, regexpp@^3.1.0, regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== regexpu-core@^4.7.1: version "4.7.1" @@ -23847,7 +23574,7 @@ request-promise-native@^1.0.3: stealthy-require "^1.1.0" tough-cookie ">=2.3.3" -request@^2.83.0, request@^2.85.0, request@^2.88.2, request@~2.88.0: +request@^2.83.0, request@^2.85.0, request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== @@ -23898,14 +23625,6 @@ require-package-name@^2.0.1: resolved "https://registry.yarnpkg.com/require-package-name/-/require-package-name-2.0.1.tgz#c11e97276b65b8e2923f75dabf5fb2ef0c3841b9" integrity sha1-wR6XJ2tluOKSP3Xav1+y7ww4Qbk= -require-uncached@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - requirejs-config-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/requirejs-config-file/-/requirejs-config-file-4.0.0.tgz#4244da5dd1f59874038cc1091d078d620abb6ebc" @@ -23954,11 +23673,6 @@ resolve-dir@^1.0.0, resolve-dir@^1.0.1: expand-tilde "^2.0.0" global-modules "^1.0.0" -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -24030,22 +23744,6 @@ responselike@^1.0.2: dependencies: lowercase-keys "^1.0.0" -restore-cursor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" - integrity sha1-NGYfRohjJ/7SmRR5FSJS35LapUE= - dependencies: - exit-hook "^1.0.0" - onetime "^1.0.0" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -24232,14 +23930,7 @@ rtlcss@^2.4.0: postcss "^6.0.23" strip-json-comments "^2.0.0" -run-async@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" - integrity sha1-yK1KXhEGYeQCp9IbUw4AnyX444k= - dependencies: - once "^1.3.0" - -run-async@^2.2.0, run-async@^2.3.0: +run-async@^2.3.0: version "2.4.1" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== @@ -24266,12 +23957,7 @@ rustbn.js@~0.2.0: resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== -rx-lite@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" - integrity sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI= - -rxjs@6, rxjs@^6.4.0, rxjs@^6.5.2: +rxjs@6, rxjs@^6.5.2: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== @@ -24312,6 +23998,11 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" +safe-stable-stringify@^2.1.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz#ab67cbe1fe7d40603ca641c5e765cb942d04fc73" + integrity sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg== + "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -24557,23 +24248,23 @@ semver-greatest-satisfied-range@^1.1.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@6.3.0, semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - semver@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== +semver@7.3.7, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: + version "7.3.7" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" + integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== dependencies: lru-cache "^6.0.0" +semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + semver@~5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" @@ -24716,7 +24407,7 @@ setprototypeof@1.2.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== -sha.js@^2.4.0, sha.js@^2.4.11, sha.js@^2.4.8, sha.js@~2.4.4: +sha.js@2.4.11, sha.js@^2.4.0, sha.js@^2.4.11, sha.js@^2.4.8, sha.js@~2.4.4: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== @@ -24797,15 +24488,6 @@ shell-quote@1.7.2, shell-quote@^1.4.2, shell-quote@^1.6.1: resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== -shelljs@^0.7.5: - version "0.7.8" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" - integrity sha1-3svPh0sNHl+3LhSxZKloMEjprLM= - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - shelljs@^0.8.1: version "0.8.4" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2" @@ -24911,11 +24593,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" - integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= - slice-ansi@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" @@ -25083,6 +24760,13 @@ sonic-boom@^0.7.5: dependencies: flatstr "^1.0.12" +sonic-boom@^2.2.1: + version "2.8.0" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-2.8.0.tgz#c1def62a77425090e6ad7516aad8eb402e047611" + integrity sha512-kuonw1YOYYNOve5iHdSahXPOK49GqwA+LZhI6Wz/l0rP57iKyXXIHaRagOBHAPmGwJC6od2Z9zgvZ5loSgMlVg== + dependencies: + atomic-sleep "^1.0.0" + sort-keys@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" @@ -25113,10 +24797,10 @@ source-map-explorer@^2.4.2: temp "^0.9.1" yargs "^15.3.1" -source-map-js@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e" - integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug== +source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== source-map-resolve@^0.5.0, source-map-resolve@^0.5.1: version "0.5.1" @@ -25137,18 +24821,10 @@ source-map-resolve@^0.6.0: atob "^2.1.2" decode-uri-component "^0.2.0" -source-map-support@0.5.13: - version "0.5.13" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" - integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-support@^0.5.11, source-map-support@^0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.12, source-map-support@~0.5.20, source-map-support@~0.5.4: - version "0.5.20" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== +source-map-support@0.5.21, source-map-support@^0.5.11, source-map-support@^0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.12, source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -25271,6 +24947,11 @@ split2@^3.0.0, split2@^3.1.0: dependencies: readable-stream "^3.0.0" +split2@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.1.0.tgz#101907a24370f85bb782f08adaabe4e281ecf809" + integrity sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ== + split@0.3, split@~0.3.0: version "0.3.3" resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" @@ -25488,13 +25169,6 @@ stream-http@^3.0.0: readable-stream "^3.6.0" xtend "^4.0.2" -stream-parser@~0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/stream-parser/-/stream-parser-0.3.1.tgz#1618548694420021a1182ff0af1911c129761773" - integrity sha1-FhhUhpRCACGhGC/wrxkRwSl2F3M= - dependencies: - debug "2" - stream-shift@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" @@ -25565,7 +25239,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -25582,14 +25256,14 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" "string.prototype.matchall@^4.0.0 || ^3.0.1", string.prototype.matchall@^4.0.2, string.prototype.matchall@^4.0.4: version "4.0.4" @@ -25693,7 +25367,7 @@ stringify-object@^3.2.1: is-obj "^1.0.1" is-regexp "^1.0.0" -strip-ansi@6.0.0, strip-ansi@^6.0.0: +strip-ansi@6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== @@ -25721,10 +25395,12 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991" - integrity sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE= +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" strip-bom-buf@^2.0.0: version "2.0.0" @@ -25795,7 +25471,7 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" -strip-json-comments@2.0.1, strip-json-comments@^2.0.0, strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: +strip-json-comments@2.0.1, strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= @@ -25967,11 +25643,6 @@ supports-color@6.0.0: dependencies: has-flag "^3.0.0" -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - supports-color@^5.3.0, supports-color@^5.4.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -26056,19 +25727,7 @@ syntax-error@^1.1.1: dependencies: acorn-node "^1.2.0" -table@^3.7.8: - version "3.8.3" - resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" - integrity sha1-K7xULw/amGGnVdOUf+/Ys/UThV8= - dependencies: - ajv "^4.7.0" - ajv-keywords "^1.0.0" - chalk "^1.1.1" - lodash "^4.0.0" - slice-ansi "0.0.4" - string-width "^2.0.0" - -table@^5.2.3, table@^5.4.6: +table@^5.4.6: version "5.4.6" resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== @@ -26279,7 +25938,7 @@ text-encoding@^0.6.4: resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" integrity sha1-45mpgiV6J22uQou5KEXLcb3CbRk= -text-table@0.2.0, text-table@^0.2.0, text-table@~0.2.0: +text-table@0.2.0, text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= @@ -26289,6 +25948,13 @@ textarea-caret@^3.0.1: resolved "https://registry.yarnpkg.com/textarea-caret/-/textarea-caret-3.0.2.tgz#f360c48699aa1abf718680a43a31a850665c2caf" integrity sha1-82DEhpmqGr9xhoCkOjGoUGZcLK8= +thread-stream@^0.15.1: + version "0.15.2" + resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-0.15.2.tgz#fb95ad87d2f1e28f07116eb23d85aba3bc0425f4" + integrity sha512-UkEhKIg2pD+fjkHQKyJO3yoIvAP3N6RlNFt2dUhcS1FGvCD1cQa1M/PGknCLFIyZdtJOWQjejp7bdNqmN7zwdA== + dependencies: + real-require "^0.1.0" + throat@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" @@ -26579,7 +26245,7 @@ tough-cookie@^2.3.3, tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" -tr46@^1.0.0, tr46@^1.0.1: +tr46@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= @@ -26691,10 +26357,10 @@ tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" - integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== +tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.2.0, tslib@^2.3.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== tslib@~2.0.1: version "2.0.3" @@ -26917,11 +26583,6 @@ underscore@~1.4.4: resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.4.4.tgz#61a6a32010622afa07963bf325203cf12239d604" integrity sha1-YaajIBBiKvoHljvzJSA88SI51gQ= -underscore@~1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" - integrity sha1-izixDKze9jM3uLJOT/htRa6lKag= - undertaker-registry@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" @@ -27152,7 +26813,12 @@ unzip-response@^2.0.1: resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" integrity sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c= -upath@1.2.0, upath@^1.1.1: +upath@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b" + integrity sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w== + +upath@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== @@ -27308,13 +26974,6 @@ use@^3.1.0: dependencies: kind-of "^6.0.2" -user-home@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" - integrity sha1-nHC/2Babwdy/SGBODwS4tJzenp8= - dependencies: - os-homedir "^1.0.0" - utf-8-validate@5.0.7: version "5.0.7" resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.7.tgz#c15a19a6af1f7ad9ec7ddc425747ca28c3644922" @@ -27946,15 +27605,6 @@ whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== -whatwg-url@7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" - integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -28157,13 +27807,6 @@ write@1.0.3: dependencies: mkdirp "^0.5.1" -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= - dependencies: - mkdirp "^0.5.1" - ws@*, ws@7.1.0, ws@7.4.6, ws@>=7.4.6, ws@^1.1.0, ws@^5.1.1, ws@^7, ws@^7.2.0, ws@^7.3.1, ws@^7.4.0, ws@^7.4.6, ws@~7.4.2: version "7.4.6" resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" @@ -28308,7 +27951,7 @@ yaml@^1.10.0, yaml@^1.7.2: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yargs-parser@13.1.2, yargs-parser@^13.1.1, yargs-parser@^13.1.2: +yargs-parser@13.1.2, yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== @@ -28337,6 +27980,11 @@ yargs-parser@^20.2.2: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== +yargs-parser@^21.0.0: + version "21.0.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" + integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== + yargs-promise@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/yargs-promise/-/yargs-promise-1.1.0.tgz#97ebb5198df734bb3b11745133ae5b501b16ab1f" @@ -28367,22 +28015,18 @@ yargs@13.3.2, yargs@^13.2.2, yargs@^13.2.4, yargs@^13.3.0: y18n "^4.0.0" yargs-parser "^13.1.2" -yargs@14.0.0, yargs@~14.0.0: - version "14.0.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.0.0.tgz#ba4cacc802b3c0b3e36a9e791723763d57a85066" - integrity sha512-ssa5JuRjMeZEUjg7bEL99AwpitxU/zWGAGpdj0di41pOEmJti8NR6kyUIJBkR78DTYNPZOU08luUo0GTHuB+ow== +yargs@17.4.1, yargs@^17.0.1: + version "17.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.4.1.tgz#ebe23284207bb75cee7c408c33e722bfb27b5284" + integrity sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g== dependencies: - cliui "^5.0.0" - decamelize "^1.2.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.0.0" yargs@^15.0.0, yargs@^15.0.2, yargs@^15.3.1, yargs@^15.4.1: version "15.4.1" @@ -28414,19 +28058,6 @@ yargs@^16.0.0, yargs@^16.1.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.0.1: - version "17.0.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.0.1.tgz#6a1ced4ed5ee0b388010ba9fd67af83b9362e0bb" - integrity sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - yargs@^7.1.0: version "7.1.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.1.tgz#67f0ef52e228d4ee0d6311acede8850f53464df6" From a0c4febfcef2368df6a2afb963e57b2b64a15116 Mon Sep 17 00:00:00 2001 From: dragana8 <92531782+dragana8@users.noreply.github.com> Date: Mon, 16 May 2022 20:36:19 +0200 Subject: [PATCH 052/127] "Cancel/reject all" for signature requests #13201 (#13786) --- .../app/signature-request-original/index.scss | 4 + .../signature-request-original.component.js | 36 ++++++++ .../signature-request-original.container.js | 28 +++++- ui/selectors/confirm-transaction.js | 23 +++++ ui/selectors/selectors.js | 18 ++++ ui/store/actions.js | 91 +++++++++++++++++++ ui/store/actions.test.js | 54 +++++++++++ 7 files changed, 251 insertions(+), 3 deletions(-) diff --git a/ui/components/app/signature-request-original/index.scss b/ui/components/app/signature-request-original/index.scss index 2e2aca65f..dd1e5e05c 100644 --- a/ui/components/app/signature-request-original/index.scss +++ b/ui/components/app/signature-request-original/index.scss @@ -20,6 +20,10 @@ @media screen and (min-width: $break-large) { height: 620px; } + + &__reject { + padding-bottom: 20px; + } } &__typed-container { diff --git a/ui/components/app/signature-request-original/signature-request-original.component.js b/ui/components/app/signature-request-original/signature-request-original.component.js index 80954ce93..a3eef4ec0 100644 --- a/ui/components/app/signature-request-original/signature-request-original.component.js +++ b/ui/components/app/signature-request-original/signature-request-original.component.js @@ -38,6 +38,9 @@ export default class SignatureRequestOriginal extends Component { hardwareWalletRequiresConnection: PropTypes.bool, isLedgerWallet: PropTypes.bool, nativeCurrency: PropTypes.string.isRequired, + messagesCount: PropTypes.number, + showRejectTransactionsConfirmationModal: PropTypes.func.isRequired, + cancelAll: PropTypes.func.isRequired, }; state = { @@ -315,7 +318,31 @@ export default class SignatureRequestOriginal extends Component { ); }; + handleCancelAll = () => { + const { + cancelAll, + clearConfirmTransaction, + history, + mostRecentOverviewPage, + showRejectTransactionsConfirmationModal, + messagesCount, + } = this.props; + const unapprovedTxCount = messagesCount; + + showRejectTransactionsConfirmationModal({ + unapprovedTxCount, + onSubmit: async () => { + await cancelAll(); + clearConfirmTransaction(); + history.push(mostRecentOverviewPage); + }, + }); + }; + render = () => { + const { messagesCount } = this.props; + const { t } = this.context; + const rejectNText = t('rejectTxsN', [messagesCount]); return (
    {this.renderHeader()} @@ -326,6 +353,15 @@ export default class SignatureRequestOriginal extends Component {
    ) : null} {this.renderFooter()} + {messagesCount > 1 ? ( + + ) : null}
    ); }; diff --git a/ui/components/app/signature-request-original/signature-request-original.container.js b/ui/components/app/signature-request-original/signature-request-original.container.js index 8031d92ed..f30310358 100644 --- a/ui/components/app/signature-request-original/signature-request-original.container.js +++ b/ui/components/app/signature-request-original/signature-request-original.container.js @@ -3,14 +3,16 @@ import { compose } from 'redux'; import { withRouter } from 'react-router-dom'; import { MESSAGE_TYPE } from '../../../../shared/constants/app'; -import { goHome } from '../../../store/actions'; +import { goHome, cancelMsgs, showModal } from '../../../store/actions'; import { accountsWithSendEtherInfoSelector, conversionRateSelector, getSubjectMetadata, doesAddressRequireLedgerHidConnection, + unconfirmedMessagesHashSelector, + getTotalUnapprovedMessagesCount, } from '../../../selectors'; -import { getAccountByAddress } from '../../../helpers/utils/util'; +import { getAccountByAddress, valuesFor } from '../../../helpers/utils/util'; import { clearConfirmTransaction } from '../../../ducks/confirm-transaction/confirm-transaction.duck'; import { getMostRecentOverviewPage } from '../../../ducks/history/history'; import { @@ -29,6 +31,8 @@ function mapStateToProps(state, ownProps) { from, ); const isLedgerWallet = isAddressLedger(state, from); + const messagesList = unconfirmedMessagesHashSelector(state); + const messagesCount = getTotalUnapprovedMessagesCount(state); return { requester: null, @@ -41,6 +45,8 @@ function mapStateToProps(state, ownProps) { // not passed to component allAccounts: accountsWithSendEtherInfoSelector(state), subjectMetadata: getSubjectMetadata(state), + messagesList, + messagesCount, }; } @@ -48,6 +54,19 @@ function mapDispatchToProps(dispatch) { return { goHome: () => dispatch(goHome()), clearConfirmTransaction: () => dispatch(clearConfirmTransaction()), + showRejectTransactionsConfirmationModal: ({ + onSubmit, + unapprovedTxCount: messagesCount, + }) => { + return dispatch( + showModal({ + name: 'REJECT_TRANSACTIONS', + onSubmit, + unapprovedTxCount: messagesCount, + }), + ); + }, + cancelAll: (messagesList) => dispatch(cancelMsgs(messagesList)), }; } @@ -62,7 +81,7 @@ function mergeProps(stateProps, dispatchProps, ownProps) { txData, } = ownProps; - const { allAccounts, ...otherStateProps } = stateProps; + const { allAccounts, messagesList, ...otherStateProps } = stateProps; const { type, @@ -71,6 +90,8 @@ function mergeProps(stateProps, dispatchProps, ownProps) { const fromAccount = getAccountByAddress(allAccounts, from); + const { cancelAll: dispatchCancelAll } = dispatchProps; + let cancel; let sign; if (type === MESSAGE_TYPE.PERSONAL_SIGN) { @@ -92,6 +113,7 @@ function mergeProps(stateProps, dispatchProps, ownProps) { txData, cancel, sign, + cancelAll: () => dispatchCancelAll(valuesFor(messagesList)), }; } diff --git a/ui/selectors/confirm-transaction.js b/ui/selectors/confirm-transaction.js index e3e8f6efb..e502d473c 100644 --- a/ui/selectors/confirm-transaction.js +++ b/ui/selectors/confirm-transaction.js @@ -117,6 +117,29 @@ export const unconfirmedTransactionsHashSelector = createSelector( }, ); +export const unconfirmedMessagesHashSelector = createSelector( + unapprovedMsgsSelector, + unapprovedPersonalMsgsSelector, + unapprovedDecryptMsgsSelector, + unapprovedEncryptionPublicKeyMsgsSelector, + unapprovedTypedMessagesSelector, + ( + unapprovedMsgs = {}, + unapprovedPersonalMsgs = {}, + unapprovedDecryptMsgs = {}, + unapprovedEncryptionPublicKeyMsgs = {}, + unapprovedTypedMessages = {}, + ) => { + return { + ...unapprovedMsgs, + ...unapprovedPersonalMsgs, + ...unapprovedDecryptMsgs, + ...unapprovedEncryptionPublicKeyMsgs, + ...unapprovedTypedMessages, + }; + }, +); + const unapprovedMsgCountSelector = (state) => state.metamask.unapprovedMsgCount; const unapprovedPersonalMsgCountSelector = (state) => state.metamask.unapprovedPersonalMsgCount; diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index 50ee18dbd..e1db5e2cf 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -470,6 +470,24 @@ export function getTotalUnapprovedCount(state) { ); } +export function getTotalUnapprovedMessagesCount(state) { + const { + unapprovedMsgCount = 0, + unapprovedPersonalMsgCount = 0, + unapprovedDecryptMsgCount = 0, + unapprovedEncryptionPublicKeyMsgCount = 0, + unapprovedTypedMessagesCount = 0, + } = state.metamask; + + return ( + unapprovedMsgCount + + unapprovedPersonalMsgCount + + unapprovedDecryptMsgCount + + unapprovedEncryptionPublicKeyMsgCount + + unapprovedTypedMessagesCount + ); +} + function getUnapprovedTxCount(state) { const { unapprovedTxs = {} } = state.metamask; return Object.keys(unapprovedTxs).length; diff --git a/ui/store/actions.js b/ui/store/actions.js index db0e1cddb..262b715d6 100644 --- a/ui/store/actions.js +++ b/ui/store/actions.js @@ -13,6 +13,7 @@ import { ENVIRONMENT_TYPE_NOTIFICATION, ORIGIN_METAMASK, POLLING_TOKEN_ENVIRONMENT_TYPES, + MESSAGE_TYPE, } from '../../shared/constants/app'; import { hasUnconfirmedTransactions } from '../helpers/utils/confirm-tx.util'; import txHelper from '../helpers/utils/tx-helper'; @@ -1021,6 +1022,96 @@ export function cancelMsg(msgData) { }; } +/** + * Cancels all of the given messages + * + * @param {Array} msgDataList - a list of msg data objects + * @returns {function(*): Promise} + */ +export function cancelMsgs(msgDataList) { + return async (dispatch) => { + dispatch(showLoadingIndication()); + + try { + const msgIds = msgDataList.map((id) => id); + const cancellations = msgDataList.map( + ({ id, type }) => + new Promise((resolve, reject) => { + switch (type) { + case MESSAGE_TYPE.ETH_SIGN_TYPED_DATA: + background.cancelTypedMessage(id, (err) => { + if (err) { + reject(err); + return; + } + resolve(); + }); + return; + case MESSAGE_TYPE.PERSONAL_SIGN: + background.cancelPersonalMessage(id, (err) => { + if (err) { + reject(err); + return; + } + resolve(); + }); + return; + case MESSAGE_TYPE.ETH_DECRYPT: + background.cancelDecryptMessage(id, (err) => { + if (err) { + reject(err); + return; + } + resolve(); + }); + return; + case MESSAGE_TYPE.ETH_GET_ENCRYPTION_PUBLIC_KEY: + background.cancelEncryptionPublicKeyMsg(id, (err) => { + if (err) { + reject(err); + return; + } + resolve(); + }); + return; + case MESSAGE_TYPE.ETH_SIGN: + background.cancelMessage(id, (err) => { + if (err) { + reject(err); + return; + } + resolve(); + }); + return; + default: + reject( + new Error( + `MetaMask Message Signature: Unknown message type: ${id}`, + ), + ); + } + }), + ); + + await Promise.all(cancellations); + const newState = await updateMetamaskStateFromBackground(); + dispatch(updateMetamaskState(newState)); + + msgIds.forEach((id) => { + dispatch(completedTx(id)); + }); + } catch (err) { + log.error(err); + } finally { + if (getEnvironmentType() === ENVIRONMENT_TYPE_NOTIFICATION) { + closeNotificationPopup(); + } else { + dispatch(hideLoadingIndication()); + } + } + }; +} + export function cancelPersonalMsg(msgData) { return async (dispatch) => { dispatch(showLoadingIndication()); diff --git a/ui/store/actions.test.js b/ui/store/actions.test.js index 727835ecf..f956cc841 100644 --- a/ui/store/actions.test.js +++ b/ui/store/actions.test.js @@ -1696,4 +1696,58 @@ describe('Actions', () => { expect(expectedAction.value.id).toStrictEqual(txId); }); }); + + describe('#cancelMsgs', () => { + it('creates COMPLETED_TX with the cancelled messages IDs', async () => { + const store = mockStore(); + + const cancelTypedMessageStub = sinon.stub().callsFake((_, cb) => cb()); + + const cancelPersonalMessageStub = sinon.stub().callsFake((_, cb) => cb()); + + background.getApi.returns({ + cancelTypedMessage: cancelTypedMessageStub, + cancelPersonalMessage: cancelPersonalMessageStub, + getState: sinon.stub().callsFake((cb) => + cb(null, { + currentLocale: 'test', + selectedAddress: '0xFirstAddress', + provider: { + chainId: '0x1', + }, + accounts: { + '0xFirstAddress': { + balance: '0x0', + }, + }, + cachedBalances: { + '0x1': { + '0xFirstAddress': '0x0', + }, + }, + }), + ), + }); + + const msgsList = [ + { id: 7648683973086304, status: 'unapproved', type: 'personal_sign' }, + { + id: 7648683973086303, + status: 'unapproved', + type: 'eth_signTypedData', + }, + ]; + + actions._setBackgroundConnection(background.getApi()); + + await store.dispatch(actions.cancelMsgs(msgsList)); + const resultantActions = store.getActions(); + const expectedActions = resultantActions.filter( + (action) => action.type === 'COMPLETED_TX', + ); + + expect(expectedActions[0].value.id).toStrictEqual(msgsList[0]); + expect(expectedActions[1].value.id).toStrictEqual(msgsList[1]); + }); + }); }); From d01a2ad7e5c9c5a760eb44715b0d03027d042af6 Mon Sep 17 00:00:00 2001 From: dragana8 <92531782+dragana8@users.noreply.github.com> Date: Mon, 16 May 2022 20:38:04 +0200 Subject: [PATCH 053/127] Overall CSS #13441 (#13902) * styling updates Co-authored-by: Alex Donesky Co-authored-by: George Marshall Co-authored-by: David Walsh --- test/e2e/tests/custom-rpc-history.spec.js | 12 ++- test/e2e/tests/from-import-ui.spec.js | 3 +- .../status-slider/index.scss | 2 +- .../hold-to-reveal-button.js | 2 +- ui/components/app/srp-input/srp-input.js | 7 +- ui/components/app/srp-input/srp-input.scss | 25 ++++--- .../app/step-progress-bar/index.scss | 32 ++++---- .../step-progress-bar/step-progress-bar.js | 10 ++- ui/components/ui/dropdown/dropdown.scss | 1 + ui/components/ui/loading-screen/index.scss | 4 +- .../create-password/create-password.js | 23 +++--- .../create-password/index.scss | 11 +-- .../creation-successful.js | 11 ++- .../creation-successful/index.scss | 8 +- .../onboarding-flow/import-srp/import-srp.js | 7 +- .../onboarding-flow/import-srp/index.scss | 31 +------- ui/pages/onboarding-flow/index.scss | 18 +++-- .../onboarding-flow/metametrics/index.scss | 23 ++++-- .../metametrics/metametrics.js | 5 +- .../onboarding-app-header/index.scss | 2 +- .../onboarding-flow/pin-extension/index.scss | 4 +- .../privacy-settings/index.scss | 13 ++++ .../confirm-recovery-phrase.js | 12 ++- .../recovery-phrase/index.scss | 73 ++++++++++++++++++- .../recovery-phrase/review-recovery-phrase.js | 7 +- .../secure-your-wallet/index.scss | 30 ++++++-- .../secure-your-wallet/secure-your-wallet.js | 11 +-- ui/pages/onboarding-flow/welcome/index.scss | 8 +- ui/pages/onboarding-flow/welcome/welcome.js | 2 +- ui/pages/unlock-page/index.scss | 4 +- 30 files changed, 267 insertions(+), 134 deletions(-) diff --git a/test/e2e/tests/custom-rpc-history.spec.js b/test/e2e/tests/custom-rpc-history.spec.js index 49dd59059..dad19482c 100644 --- a/test/e2e/tests/custom-rpc-history.spec.js +++ b/test/e2e/tests/custom-rpc-history.spec.js @@ -1,5 +1,5 @@ const { strict: assert } = require('assert'); -const { convertToHexValue, withFixtures } = require('../helpers'); +const { convertToHexValue, withFixtures, largeDelayMs } = require('../helpers'); describe('Stores custom RPC history', function () { const ganacheOptions = { @@ -29,6 +29,8 @@ describe('Stores custom RPC history', function () { const rpcUrl = `http://127.0.0.1:${port}`; const networkName = 'Secondary Ganache Testnet'; + await driver.delay(largeDelayMs); + await driver.clickElement('.network-display'); await driver.clickElement({ text: 'Add Network', tag: 'button' }); @@ -77,6 +79,8 @@ describe('Stores custom RPC history', function () { // duplicate network const duplicateRpcUrl = 'https://mainnet.infura.io/v3/'; + await driver.delay(largeDelayMs); + await driver.clickElement('.network-display'); await driver.clickElement({ text: 'Add Network', tag: 'button' }); @@ -113,6 +117,8 @@ describe('Stores custom RPC history', function () { const newRpcUrl = 'http://localhost:8544'; const duplicateChainId = '0x539'; + await driver.delay(largeDelayMs); + await driver.clickElement('.network-display'); await driver.clickElement({ text: 'Add Network', tag: 'button' }); @@ -154,6 +160,8 @@ describe('Stores custom RPC history', function () { await driver.fill('#password', 'correct horse battery staple'); await driver.press('#password', driver.Key.ENTER); + await driver.delay(largeDelayMs); + await driver.clickElement('.network-display'); await driver.clickElement({ text: 'Ethereum Mainnet', tag: 'span' }); @@ -173,6 +181,7 @@ describe('Stores custom RPC history', function () { await driver.fill('#password', 'correct horse battery staple'); await driver.press('#password', driver.Key.ENTER); + await driver.delay(largeDelayMs); await driver.clickElement('.network-display'); // only recent 3 are found and in correct order (most recent at the top) @@ -202,6 +211,7 @@ describe('Stores custom RPC history', function () { await driver.fill('#password', 'correct horse battery staple'); await driver.press('#password', driver.Key.ENTER); + await driver.delay(largeDelayMs); await driver.clickElement('.network-display'); await driver.clickElement({ text: 'Add Network', tag: 'button' }); diff --git a/test/e2e/tests/from-import-ui.spec.js b/test/e2e/tests/from-import-ui.spec.js index 6bc41b1fa..2b812e66d 100644 --- a/test/e2e/tests/from-import-ui.spec.js +++ b/test/e2e/tests/from-import-ui.spec.js @@ -72,7 +72,8 @@ describe('Metamask Import UI', function () { await driver.press('#password', driver.Key.ENTER); // Create a new account - // switches to locakhost + // switches to localhost + await driver.delay(largeDelayMs); await driver.clickElement('.network-display'); await driver.clickElement({ text: 'Localhost', tag: 'span' }); diff --git a/ui/components/app/edit-gas-fee-popover/network-statistics/status-slider/index.scss b/ui/components/app/edit-gas-fee-popover/network-statistics/status-slider/index.scss index 1c295cbb9..d8a89e0fc 100644 --- a/ui/components/app/edit-gas-fee-popover/network-statistics/status-slider/index.scss +++ b/ui/components/app/edit-gas-fee-popover/network-statistics/status-slider/index.scss @@ -29,7 +29,7 @@ height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; - border-top: 10px solid white; + border-top: 10px solid var(--color-background-default); position: relative; margin-bottom: -2px; } diff --git a/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.js b/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.js index 076b02f30..ad8db9347 100644 --- a/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.js +++ b/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.js @@ -160,7 +160,7 @@ export default function HoldToRevealButton({ buttonText, onLongPressed }) { ) : null; - }, [isUnlocking, hasTriggeredUnlock, t]); + }, [isUnlocking, hasTriggeredUnlock, triggerOnLongPressed, t]); return ( - + {t('welcomeToMetaMask')} - + {t('welcomeToMetaMaskIntro')}
    diff --git a/ui/pages/unlock-page/index.scss b/ui/pages/unlock-page/index.scss index 8e3932715..745b68350 100644 --- a/ui/pages/unlock-page/index.scss +++ b/ui/pages/unlock-page/index.scss @@ -1,4 +1,5 @@ .unlock-page { + color: var(--color-text-default); display: flex; flex-direction: column; justify-content: flex-start; @@ -6,14 +7,13 @@ width: 357px; padding: 30px; font-weight: 400; - color: var(--color-text-default); &__container { - background: var(--color-background-default); display: flex; align-self: stretch; justify-content: center; flex: 1 0 auto; + background: var(--color-background-default); } &__mascot-container { From dbe89049bdb1ed7d618b743ceb023c4fa72df862 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Mon, 16 May 2022 13:53:47 -0700 Subject: [PATCH 054/127] Unit test proptype (#14564) * Change import file to root index * Properly set showFiat proptype to bool --- .../user-preferenced-currency-display.component.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.test.js b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.test.js index ed2a56fab..6c73d7576 100644 --- a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.test.js +++ b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.test.js @@ -4,7 +4,7 @@ import sinon from 'sinon'; import CurrencyDisplay from '../../ui/currency-display'; import * as currencyHook from '../../../hooks/useCurrencyDisplay'; import * as currencyPrefHook from '../../../hooks/useUserPreferencedCurrency'; -import UserPreferencedCurrencyDisplay from './user-preferenced-currency-display.component'; +import UserPreferencedCurrencyDisplay from '.'; describe('UserPreferencedCurrencyDisplay Component', () => { describe('rendering', () => { From 1464ab724fba596326dae39efd551bc9da376a4b Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Mon, 16 May 2022 17:24:08 -0500 Subject: [PATCH 055/127] Storybook: Fix SignatureRequest component (#14706) * SB:SignatureRequest: fix control type * SB:SignatureRequest: fix args expected by sanitizeMessage * SignatureRequests: cleanup --- .../signature-request.stories.js | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/ui/components/app/signature-request/signature-request.stories.js b/ui/components/app/signature-request/signature-request.stories.js index a1c53a69b..f3ebe0e1b 100644 --- a/ui/components/app/signature-request/signature-request.stories.js +++ b/ui/components/app/signature-request/signature-request.stories.js @@ -3,7 +3,7 @@ import testData from '../../../../.storybook/test-data'; import README from './README.mdx'; import SignatureRequest from './signature-request.component'; -const primaryIdentity = Object.values(testData.metamask.identities)[0]; +const [MOCK_PRIMARY_IDENTITY] = Object.values(testData.metamask.identities); export default { title: 'Components/App/SignatureRequest', @@ -23,13 +23,11 @@ export default { name: { control: 'text' }, }, }, + hardwareWalletRequiresConnection: { control: 'boolean' }, isLedgerWallet: { control: 'boolean' }, clearConfirmTransaction: { action: 'Clean Confirm' }, cancel: { action: 'Cancel' }, sign: { action: 'Sign' }, - hardwareWalletRequiresConnection: { - action: 'hardwareWalletRequiresConnection', - }, }, }; @@ -50,11 +48,31 @@ DefaultStory.args = { string: 'haay wuurl', number: 42, }, + primaryType: 'Mail', + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Group: [ + { name: 'name', type: 'string' }, + { name: 'members', type: 'Person[]' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person[]' }, + { name: 'contents', type: 'string' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallets', type: 'address[]' }, + ], + }, }), origin: 'https://happydapp.website/governance?futarchy=true', }, }, - fromAccount: primaryIdentity, + fromAccount: MOCK_PRIMARY_IDENTITY, }; - -DefaultStory.storyName = 'Default'; From 7cfa4545704eaaf1d32600136859e15eaea70490 Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Mon, 16 May 2022 17:28:20 -0500 Subject: [PATCH 056/127] Storybook: add SignatureRequestOriginal (#14707) * SB: add SignatureRequestOriginal * SB:SignatureRequestOriginal: add reusable Template * SB:SignatureRequestOriginal: add args missing isRequired args * SB:SignatureRequestOriginal: add eth_signTypedData * SB:SignatureRequestOriginal: update README.mdx * SB:README: update description * SignatureRequestOriginal: destruct mock value --- .../app/signature-request-original/README.mdx | 15 ++ .../signature-request-original.stories.js | 132 ++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 ui/components/app/signature-request-original/README.mdx create mode 100644 ui/components/app/signature-request-original/signature-request-original.stories.js diff --git a/ui/components/app/signature-request-original/README.mdx b/ui/components/app/signature-request-original/README.mdx new file mode 100644 index 000000000..6c07ccd38 --- /dev/null +++ b/ui/components/app/signature-request-original/README.mdx @@ -0,0 +1,15 @@ +import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; + +import SignatureRequestOriginal from '.'; + +# Signature Request + +dApp requesting a signature from the user. This component appears for eth_signTypedData signatures are not v3 or v4. For other signatures, please see SignatureRequest. + + + + + +## Component API + + diff --git a/ui/components/app/signature-request-original/signature-request-original.stories.js b/ui/components/app/signature-request-original/signature-request-original.stories.js new file mode 100644 index 000000000..bc2c73900 --- /dev/null +++ b/ui/components/app/signature-request-original/signature-request-original.stories.js @@ -0,0 +1,132 @@ +import React from 'react'; +import { action } from '@storybook/addon-actions'; +import { MESSAGE_TYPE } from '../../../../shared/constants/app'; +import testData from '../../../../.storybook/test-data'; +import README from './README.mdx'; +import SignatureRequestOriginal from './signature-request-original.component'; + +const [MOCK_PRIMARY_IDENTITY] = Object.values(testData.metamask.identities); + +const MOCK_SIGN_DATA = JSON.stringify({ + domain: { + name: 'happydapp.website', + }, + message: { + string: 'haay wuurl', + number: 42, + }, + primaryType: 'Mail', + types: { + EIP712Domain: [ + { name: 'name', type: 'string' }, + { name: 'version', type: 'string' }, + { name: 'chainId', type: 'uint256' }, + { name: 'verifyingContract', type: 'address' }, + ], + Group: [ + { name: 'name', type: 'string' }, + { name: 'members', type: 'Person[]' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person[]' }, + { name: 'contents', type: 'string' }, + ], + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallets', type: 'address[]' }, + ], + }, +}); + +export default { + title: 'Components/App/SignatureRequestOriginal', + id: __filename, + component: SignatureRequestOriginal, + parameters: { + docs: { + page: README, + }, + }, + argTypes: { + fromAccount: { + table: { + address: { control: 'text' }, + balance: { control: 'text' }, + name: { control: 'text' }, + }, + }, + hardwareWalletRequiresConnection: { control: 'boolean' }, + isLedgerWallet: { control: 'boolean' }, + nativeCurrency: { control: 'text' }, + txData: { control: 'object' }, + clearConfirmTransaction: { action: 'Clean Confirm' }, + cancel: { action: 'Cancel' }, + sign: { action: 'Sign' }, + }, + args: { + fromAccount: MOCK_PRIMARY_IDENTITY, + history: { + push: action('history.push()'), + }, + mostRecentOverviewPage: '/', + nativeCurrency: 'ETH', + }, +}; + +const Template = (args) => { + return ; +}; + +export const DefaultStory = Template.bind({}); + +DefaultStory.storyName = 'personal_sign Type'; + +DefaultStory.args = { + txData: { + msgParams: { + data: MOCK_SIGN_DATA, + origin: 'https://happydapp.website/governance?futarchy=true', + }, + type: MESSAGE_TYPE.PERSONAL_SIGN, + }, +}; + +export const ETHSignStory = Template.bind({}); + +ETHSignStory.storyName = 'eth_sign Type'; + +ETHSignStory.args = { + txData: { + msgParams: { + data: MOCK_SIGN_DATA, + origin: 'https://happydapp.website/governance?futarchy=true', + }, + type: MESSAGE_TYPE.ETH_SIGN, + }, +}; + +export const ETHSignTypedStory = Template.bind({}); + +ETHSignTypedStory.storyName = 'eth_signTypedData Type'; + +ETHSignTypedStory.args = { + txData: { + msgParams: { + data: [ + { + type: 'string', + name: 'Message', + value: 'Hi, Alice!', + }, + { + type: 'uint32', + name: 'A number', + value: '1337', + }, + ], + origin: 'https://happydapp.website/governance?futarchy=true', + }, + type: MESSAGE_TYPE.ETH_SIGN_TYPED_DATA, + }, +}; From ca6835a86d1157da77d523e7c43cbef97da64c09 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Tue, 17 May 2022 01:39:55 -0700 Subject: [PATCH 057/127] Use enum for test snaps website URL (#14727) * Use enum for test snaps website * Fix confirm snap test --- test/e2e/snaps/enums.js | 3 +++ test/e2e/snaps/test-snap-bip-44.spec.js | 3 ++- test/e2e/snaps/test-snap-confirm.spec.js | 12 +++++------- test/e2e/snaps/test-snap-error.spec.js | 3 ++- test/e2e/snaps/test-snap-managestate.spec.js | 3 ++- 5 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 test/e2e/snaps/enums.js diff --git a/test/e2e/snaps/enums.js b/test/e2e/snaps/enums.js new file mode 100644 index 000000000..b563f917f --- /dev/null +++ b/test/e2e/snaps/enums.js @@ -0,0 +1,3 @@ +module.exports = { + TEST_SNAPS_WEBSITE_URL: 'https://metamask.github.io/test-snaps/0.2.0', +}; diff --git a/test/e2e/snaps/test-snap-bip-44.spec.js b/test/e2e/snaps/test-snap-bip-44.spec.js index 689e62b03..e1529fd28 100644 --- a/test/e2e/snaps/test-snap-bip-44.spec.js +++ b/test/e2e/snaps/test-snap-bip-44.spec.js @@ -1,5 +1,6 @@ const { strict: assert } = require('assert'); const { withFixtures } = require('../helpers'); +const { TEST_SNAPS_WEBSITE_URL } = require('./enums'); describe('Test Snap bip-44', function () { it('can pop up bip-44 snap and get private key result', async function () { @@ -29,7 +30,7 @@ describe('Test Snap bip-44', function () { await driver.press('#password', driver.Key.ENTER); // navigate to test snaps page and connect - await driver.driver.get('https://metamask.github.io/test-snaps/0.1.3/'); + await driver.driver.get(TEST_SNAPS_WEBSITE_URL); await driver.fill('.snapId3', 'npm:@metamask/test-snap-bip44'); await driver.clickElement({ text: 'Connect BIP-44 Snap', diff --git a/test/e2e/snaps/test-snap-confirm.spec.js b/test/e2e/snaps/test-snap-confirm.spec.js index 2100c2ff5..ba5212e85 100644 --- a/test/e2e/snaps/test-snap-confirm.spec.js +++ b/test/e2e/snaps/test-snap-confirm.spec.js @@ -1,5 +1,6 @@ const { strict: assert } = require('assert'); const { withFixtures } = require('../helpers'); +const { TEST_SNAPS_WEBSITE_URL } = require('./enums'); describe('Test Snap Confirm', function () { it('can pop up a snap confirm and get its result', async function () { @@ -29,8 +30,8 @@ describe('Test Snap Confirm', function () { await driver.press('#password', driver.Key.ENTER); // navigate to test snaps page and connect - await driver.driver.get('https://metamask.github.io/test-snaps/'); - await driver.fill('.snapId', 'npm:@metamask/test-snap-confirm'); + await driver.driver.get(TEST_SNAPS_WEBSITE_URL); + await driver.fill('.snapId1', 'npm:@metamask/test-snap-confirm'); await driver.clickElement({ text: 'Connect To Confirm Snap', tag: 'button', @@ -69,10 +70,7 @@ describe('Test Snap Confirm', function () { await driver.waitUntilXWindowHandles(1, 5000, 10000); windowHandles = await driver.getAllWindowHandles(); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); - await driver.clickElement({ - text: 'Send Inputs to Hello Snap', - tag: 'button', - }); + await driver.clickElement('.sendConfirmButton'); // hit 'approve' on the custom confirm await driver.waitUntilXWindowHandles(2, 5000, 10000); @@ -90,7 +88,7 @@ describe('Test Snap Confirm', function () { await driver.waitUntilXWindowHandles(1, 5000, 10000); windowHandles = await driver.getAllWindowHandles(); await driver.switchToWindowWithTitle('Test Snaps', windowHandles); - const confirmResult = await driver.findElement('.sendResults'); + const confirmResult = await driver.findElement('.confirmResult'); assert.equal(await confirmResult.getText(), 'true'); }, ); diff --git a/test/e2e/snaps/test-snap-error.spec.js b/test/e2e/snaps/test-snap-error.spec.js index 91ebd2ce1..e8fcb49c1 100644 --- a/test/e2e/snaps/test-snap-error.spec.js +++ b/test/e2e/snaps/test-snap-error.spec.js @@ -1,6 +1,7 @@ const { strict: assert } = require('assert'); const { withFixtures } = require('../helpers'); const { PAGES } = require('../webdriver/driver'); +const { TEST_SNAPS_WEBSITE_URL } = require('./enums'); describe('Test Snap Error', function () { it('can pop up a snap error and see the error', async function () { @@ -28,7 +29,7 @@ describe('Test Snap Error', function () { await driver.press('#password', driver.Key.ENTER); // navigate to test snaps page and connect - await driver.driver.get('https://metamask.github.io/test-snaps/'); + await driver.driver.get(TEST_SNAPS_WEBSITE_URL); await driver.fill('.snapId2', 'npm:@metamask/test-snap-error'); await driver.clickElement({ text: 'Connect Error Snap', diff --git a/test/e2e/snaps/test-snap-managestate.spec.js b/test/e2e/snaps/test-snap-managestate.spec.js index 631724e17..fbf2ec76c 100644 --- a/test/e2e/snaps/test-snap-managestate.spec.js +++ b/test/e2e/snaps/test-snap-managestate.spec.js @@ -1,5 +1,6 @@ const { strict: assert } = require('assert'); const { withFixtures } = require('../helpers'); +const { TEST_SNAPS_WEBSITE_URL } = require('./enums'); describe('Test Snap manageState', function () { it('can pop up manageState snap and do update get and clear', async function () { @@ -29,7 +30,7 @@ describe('Test Snap manageState', function () { await driver.press('#password', driver.Key.ENTER); // navigate to test snaps page and connect - await driver.driver.get('https://metamask.github.io/test-snaps/0.2.0/'); + await driver.driver.get(TEST_SNAPS_WEBSITE_URL); await driver.fill('.snapId3', 'npm:@metamask/test-snap-managestate'); await driver.clickElement({ text: 'Connect manageState Snap', From 944c22262ff7b1ae8a5041d6b068e8a21fc8bd34 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Tue, 17 May 2022 14:27:23 -0230 Subject: [PATCH 058/127] Ensure send logs use current chain currency symbol (#14726) --- ui/ducks/send/send.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/ducks/send/send.js b/ui/ducks/send/send.js index a812e34a1..54835178e 100644 --- a/ui/ducks/send/send.js +++ b/ui/ducks/send/send.js @@ -1466,6 +1466,7 @@ export function resetSendState() { export function updateSendAmount(amount) { return async (dispatch, getState) => { const state = getState(); + const { metamask } = state; let logAmount = amount; if (state[name].asset.type === ASSET_TYPES.TOKEN) { const multiplier = Math.pow( @@ -1489,7 +1490,7 @@ export function updateSendAmount(amount) { toCurrency: ETH, numberOfDecimals: 8, }); - logAmount = `${ethValue} ${ETH}`; + logAmount = `${ethValue} ${metamask?.provider?.ticker || ETH}`; } await dispatch( addHistoryEntry(`sendFlow - user set amount to ${logAmount}`), From 9d058007ccfd025be22e5b07fa0c2e84f96fd8c6 Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Tue, 17 May 2022 19:44:32 -0500 Subject: [PATCH 059/127] NetworksTab: make footer buttons nowrap (#14733) --- ui/pages/settings/networks-tab/index.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/pages/settings/networks-tab/index.scss b/ui/pages/settings/networks-tab/index.scss index 6c57a4b5d..698dd47c8 100644 --- a/ui/pages/settings/networks-tab/index.scss +++ b/ui/pages/settings/networks-tab/index.scss @@ -297,6 +297,10 @@ width: 93%; } + .btn--rounded { + white-space: nowrap; + } + .btn-secondary { margin-right: 0.375rem; } From 66c049bb357155750b772e94faedd8c57ed0e88f Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Wed, 18 May 2022 13:49:26 +0200 Subject: [PATCH 060/127] snaps-skunkworks@0.14.0 (#14700) * snaps-skunkworks@0.13.0 * snaps-skunkworks@0.14.0 * Fix test * Add long-running permission copy and icon * Run linting * Fix typo * Bump E2E version --- app/_locales/en/messages.json | 4 + .../permissions/flask/snap-permissions.js | 2 +- app/scripts/metamask-controller.js | 2 +- lavamoat/browserify/beta/policy.json | 410 +++--------------- lavamoat/browserify/flask/policy.json | 410 +++--------------- lavamoat/browserify/main/policy.json | 410 +++--------------- package.json | 4 +- shared/constants/permissions.js | 1 + shared/constants/permissions.test.js | 2 +- test/e2e/snaps/enums.js | 2 +- ui/helpers/utils/permission.js | 5 + yarn.lock | 145 +++---- 12 files changed, 285 insertions(+), 1112 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 5908ec58e..d8309be59 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -2426,6 +2426,10 @@ "message": "See address, account balance, activity and suggest transactions to approve", "description": "The description for the `eth_accounts` permission" }, + "permission_longRunning": { + "message": "Run indefinitely.", + "description": "The description for the `endowment:long-running` permission" + }, "permission_manageBip44Keys": { "message": "Control your \"$1\" accounts and assets.", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." diff --git a/app/scripts/controllers/permissions/flask/snap-permissions.js b/app/scripts/controllers/permissions/flask/snap-permissions.js index bde8c4c91..07024c9ae 100644 --- a/app/scripts/controllers/permissions/flask/snap-permissions.js +++ b/app/scripts/controllers/permissions/flask/snap-permissions.js @@ -1,4 +1,4 @@ -import { endowmentPermissionBuilders } from '@metamask/controllers'; +import { endowmentPermissionBuilders } from '@metamask/snap-controllers'; import { restrictedMethodPermissionBuilders, selectHooks, diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 827de4f54..8c9956f26 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -664,7 +664,7 @@ export default class MetamaskController extends EventEmitter { }); this.snapController = new SnapController({ - endowmentPermissionNames: Object.values(EndowmentPermissions), + environmentEndowmentPermissions: Object.values(EndowmentPermissions), terminateAllSnaps: this.workerController.terminateAllSnaps.bind( this.workerController, ), diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 816e7aae0..88685c3a7 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -3217,222 +3217,55 @@ }, "@metamask/rpc-methods": { "packages": { - "@metamask/rpc-methods>@metamask/controllers": true, + "@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": { + "@metamask/rpc-methods>@metamask/key-tree": { "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/key-tree>@noble/ed25519": true, + "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, + "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": true, + "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true, + "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": true, + "browserify>buffer": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39>unorm": { + "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": { "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": { + "crypto": true + }, "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 + "browserify>browser-resolve": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": { "globals": { + "TextEncoder": true, "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 + "setTimeout": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": { "globals": { - "console": true + "crypto": 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 + "browserify>browser-resolve": true } }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { + "@metamask/rpc-methods>@metamask/key-tree>@scure/base": { "globals": { - "crypto": true, - "msCrypto": true - } - }, - "@metamask/rpc-methods>@metamask/key-tree": { - "packages": { - "@metamask/rpc-methods>@metamask/key-tree>bip39": true, - "@metamask/rpc-methods>@metamask/key-tree>secp256k1": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "browserify>insert-module-globals>is-buffer": true, - "ethereumjs-util>ethereum-cryptography>keccak": true - } - }, - "@metamask/rpc-methods>@metamask/key-tree>bip39": { - "packages": { - "browserify>buffer": true, - "browserify>crypto-browserify>pbkdf2": true, - "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "TextDecoder": true, + "TextEncoder": true } }, - "@metamask/rpc-methods>@metamask/key-tree>secp256k1": { + "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": { "packages": { - "3box>ethers>elliptic": true + "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, + "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true } }, "@metamask/smart-transactions-controller": { @@ -3504,8 +3337,8 @@ }, "@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, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/smart-transactions-controller>@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, @@ -3515,6 +3348,48 @@ "loglevel": true } }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39": { + "packages": { + "@metamask/smart-transactions-controller>@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/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39>unorm": { + "globals": { + "define": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-sig-util": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { + "packages": { + "@metamask/smart-transactions-controller>@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/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { "packages": { "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true @@ -3636,9 +3511,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, @@ -3658,153 +3533,6 @@ "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, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 816e7aae0..88685c3a7 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -3217,222 +3217,55 @@ }, "@metamask/rpc-methods": { "packages": { - "@metamask/rpc-methods>@metamask/controllers": true, + "@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": { + "@metamask/rpc-methods>@metamask/key-tree": { "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/key-tree>@noble/ed25519": true, + "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, + "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": true, + "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true, + "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": true, + "browserify>buffer": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39>unorm": { + "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": { "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": { + "crypto": true + }, "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 + "browserify>browser-resolve": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": { "globals": { + "TextEncoder": true, "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 + "setTimeout": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": { "globals": { - "console": true + "crypto": 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 + "browserify>browser-resolve": true } }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { + "@metamask/rpc-methods>@metamask/key-tree>@scure/base": { "globals": { - "crypto": true, - "msCrypto": true - } - }, - "@metamask/rpc-methods>@metamask/key-tree": { - "packages": { - "@metamask/rpc-methods>@metamask/key-tree>bip39": true, - "@metamask/rpc-methods>@metamask/key-tree>secp256k1": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "browserify>insert-module-globals>is-buffer": true, - "ethereumjs-util>ethereum-cryptography>keccak": true - } - }, - "@metamask/rpc-methods>@metamask/key-tree>bip39": { - "packages": { - "browserify>buffer": true, - "browserify>crypto-browserify>pbkdf2": true, - "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "TextDecoder": true, + "TextEncoder": true } }, - "@metamask/rpc-methods>@metamask/key-tree>secp256k1": { + "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": { "packages": { - "3box>ethers>elliptic": true + "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, + "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true } }, "@metamask/smart-transactions-controller": { @@ -3504,8 +3337,8 @@ }, "@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, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/smart-transactions-controller>@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, @@ -3515,6 +3348,48 @@ "loglevel": true } }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39": { + "packages": { + "@metamask/smart-transactions-controller>@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/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39>unorm": { + "globals": { + "define": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-sig-util": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { + "packages": { + "@metamask/smart-transactions-controller>@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/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { "packages": { "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true @@ -3636,9 +3511,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, @@ -3658,153 +3533,6 @@ "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, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 816e7aae0..88685c3a7 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -3217,222 +3217,55 @@ }, "@metamask/rpc-methods": { "packages": { - "@metamask/rpc-methods>@metamask/controllers": true, + "@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": { + "@metamask/rpc-methods>@metamask/key-tree": { "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/key-tree>@noble/ed25519": true, + "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, + "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": true, + "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true, + "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": true, + "browserify>buffer": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>bip39>unorm": { + "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": { "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": { + "crypto": true + }, "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 + "browserify>browser-resolve": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": { "globals": { + "TextEncoder": true, "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 + "setTimeout": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": { "globals": { - "console": true + "crypto": 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 + "browserify>browser-resolve": true } }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { + "@metamask/rpc-methods>@metamask/key-tree>@scure/base": { "globals": { - "crypto": true, - "msCrypto": true - } - }, - "@metamask/rpc-methods>@metamask/key-tree": { - "packages": { - "@metamask/rpc-methods>@metamask/key-tree>bip39": true, - "@metamask/rpc-methods>@metamask/key-tree>secp256k1": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "browserify>insert-module-globals>is-buffer": true, - "ethereumjs-util>ethereum-cryptography>keccak": true - } - }, - "@metamask/rpc-methods>@metamask/key-tree>bip39": { - "packages": { - "browserify>buffer": true, - "browserify>crypto-browserify>pbkdf2": true, - "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "TextDecoder": true, + "TextEncoder": true } }, - "@metamask/rpc-methods>@metamask/key-tree>secp256k1": { + "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": { "packages": { - "3box>ethers>elliptic": true + "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, + "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true } }, "@metamask/smart-transactions-controller": { @@ -3504,8 +3337,8 @@ }, "@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, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/smart-transactions-controller>@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, @@ -3515,6 +3348,48 @@ "loglevel": true } }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39": { + "packages": { + "@metamask/smart-transactions-controller>@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/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39>unorm": { + "globals": { + "define": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>bip39": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-sig-util": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { + "packages": { + "@metamask/smart-transactions-controller>@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/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { "packages": { "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true @@ -3636,9 +3511,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, @@ -3658,153 +3533,6 @@ "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, diff --git a/package.json b/package.json index c5b9face4..e81be4b54 100644 --- a/package.json +++ b/package.json @@ -126,10 +126,10 @@ "@metamask/obs-store": "^5.0.0", "@metamask/post-message-stream": "^4.0.0", "@metamask/providers": "^8.1.1", - "@metamask/rpc-methods": "^0.12.0", + "@metamask/rpc-methods": "^0.14.0", "@metamask/slip44": "^2.1.0", "@metamask/smart-transactions-controller": "^1.10.0", - "@metamask/snap-controllers": "^0.12.0", + "@metamask/snap-controllers": "^0.14.0", "@ngraveio/bc-ur": "^1.1.6", "@popperjs/core": "^2.4.0", "@reduxjs/toolkit": "^1.6.2", diff --git a/shared/constants/permissions.js b/shared/constants/permissions.js index c1e4e69e7..77df6431f 100644 --- a/shared/constants/permissions.js +++ b/shared/constants/permissions.js @@ -21,6 +21,7 @@ export const PermissionNamespaces = Object.freeze({ export const EndowmentPermissions = Object.freeze({ 'endowment:network-access': 'endowment:network-access', + 'endowment:long-running': 'endowment:long-running', }); // Methods / permissions in external packages that we are temporarily excluding. diff --git a/shared/constants/permissions.test.js b/shared/constants/permissions.test.js index c6ace6243..3637fed58 100644 --- a/shared/constants/permissions.test.js +++ b/shared/constants/permissions.test.js @@ -1,4 +1,4 @@ -import { endowmentPermissionBuilders } from '@metamask/controllers'; +import { endowmentPermissionBuilders } from '@metamask/snap-controllers'; import { restrictedMethodPermissionBuilders } from '@metamask/rpc-methods'; import { EndowmentPermissions, diff --git a/test/e2e/snaps/enums.js b/test/e2e/snaps/enums.js index b563f917f..8906b38d8 100644 --- a/test/e2e/snaps/enums.js +++ b/test/e2e/snaps/enums.js @@ -1,3 +1,3 @@ module.exports = { - TEST_SNAPS_WEBSITE_URL: 'https://metamask.github.io/test-snaps/0.2.0', + TEST_SNAPS_WEBSITE_URL: 'https://metamask.github.io/test-snaps/0.3.0', }; diff --git a/ui/helpers/utils/permission.js b/ui/helpers/utils/permission.js index 7625880ea..c2f9023df 100644 --- a/ui/helpers/utils/permission.js +++ b/ui/helpers/utils/permission.js @@ -58,6 +58,11 @@ const PERMISSION_DESCRIPTIONS = deepFreeze({ leftIcon: 'fas fa-wifi', rightIcon: null, }, + [EndowmentPermissions['endowment:long-running']]: { + label: (t) => t('permission_longRunning'), + leftIcon: 'fas fa-infinity', + rightIcon: null, + }, ///: END:ONLY_INCLUDE_IN [UNKNOWN_PERMISSION]: { label: (t, permissionName) => diff --git a/yarn.lock b/yarn.lock index ffae65f4f..5fefc8b40 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2848,47 +2848,6 @@ web3 "^0.20.7" web3-provider-engine "^16.0.3" -"@metamask/controllers@^28.0.0": - version "28.0.0" - resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-28.0.0.tgz#dbde11df635daeb9d73ff989cb274f94f913ff39" - integrity sha512-ABIZ5OO6g9DzyKrDB0yr1KzyleqVZ4V2d9S8jaToz5AaDZ0tnVkcKptCtRfhzV8xC23xynKjoO7cU9ZkDXBbjw== - 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 "^6.2.1" - 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/controllers@^29.0.1": version "29.0.1" resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-29.0.1.tgz#8b6d066a23877c82de005ce566b7fd6bbaa7cc13" @@ -3010,15 +2969,15 @@ resolved "https://registry.yarnpkg.com/@metamask/etherscan-link/-/etherscan-link-2.1.0.tgz#c0be8e68445b7b83cf85bcc03a56cdf8e256c973" integrity sha512-ADuWlTUkFfN2vXlz81Bg/0BA+XRor+CdK1055p6k7H6BLIPoDKn9SBOFld9haQFuR9cKh/JYHcnlSIv5R4fUEw== -"@metamask/execution-environments@^0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@metamask/execution-environments/-/execution-environments-0.12.0.tgz#b621eb1a5bb854e9b7b43a0888dc5ab9f12f1e5a" - integrity sha512-UJXft9jt6OCFFFfEFT/0i3HZ8aGrtp4APDtOVVbf/CHUqVj9FFUruzwydN9KdFbZlBnU7/Von0UmaudlSgVrow== +"@metamask/execution-environments@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@metamask/execution-environments/-/execution-environments-0.14.0.tgz#594e2d3671c4e7d07725d4547561cba1fa441354" + integrity sha512-M7z/vLMZrtJ1sksUmyh161WDndNVw4PXilAz42WYuuVLz2j4jeUnYNwLml9DamoT9XSPtwiodhyEyikJsGg8JA== dependencies: "@metamask/object-multiplex" "^1.2.0" "@metamask/post-message-stream" "^4.0.0" "@metamask/providers" "^8.1.1" - "@metamask/snap-types" "^0.12.0" + "@metamask/snap-types" "^0.14.0" eth-rpc-errors "^4.0.3" pump "^3.0.0" ses "^0.15.15" @@ -3037,14 +2996,16 @@ color "^0.11.3" mersenne-twister "^1.1.0" -"@metamask/key-tree@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@metamask/key-tree/-/key-tree-3.0.1.tgz#e59b6c9c124c74382477f51a389815e849a16de7" - integrity sha512-CcpbQua96/CF+KKItrfw9Y6azrlkzFhoVAkyfUl7iq5qldA8xi4CilNjzIqnK8YJcLU44d7nRs5i5/9atY4Beg== +"@metamask/key-tree@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@metamask/key-tree/-/key-tree-4.0.0.tgz#2de20618793e85ee300b4b3d4ca4de9d7f40e276" + integrity sha512-Pj5nN6Ko15rei6dSgQnTH64JEN1I8JuTM6Q06/1V7Xp3Fw3g3Nf1scr/u7cQnL17YxXALMCDYaEPdQveo70kSA== dependencies: - bip39 "^3.0.4" - keccak "^3.0.2" - secp256k1 "^4.0.2" + "@noble/ed25519" "^1.6.0" + "@noble/hashes" "^1.0.0" + "@noble/secp256k1" "^1.5.5" + "@scure/base" "^1.0.0" + "@scure/bip39" "^1.0.0" "@metamask/logo@^3.1.1": version "3.1.1" @@ -3110,14 +3071,14 @@ pump "^3.0.0" webextension-polyfill-ts "^0.25.0" -"@metamask/rpc-methods@^0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.12.0.tgz#f86208ddb1e864058815f7eff2f1d6bca9ebf618" - integrity sha512-lqsmQRaeqye6KyBmAmA4t1T5unUw/guw3DNAvY3u4HxYKR0uQktTxPus9TuxPj3xK3G+IVnplWLQCojOlPE6vA== +"@metamask/rpc-methods@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.14.0.tgz#33554341f2da930c41b681521bf94e385735ae65" + integrity sha512-tDqbgSJoyNPkBZ5o5KH5pBRlq1+1zPNNk3cpM478vgm5xmT7HdMwfV2wd2h3XmJRO2/mTu1/5lLgV+3sTYqN3A== dependencies: - "@metamask/controllers" "^28.0.0" - "@metamask/key-tree" "^3.0.1" - "@metamask/snap-controllers" "^0.12.0" + "@metamask/controllers" "^29.0.1" + "@metamask/key-tree" "^4.0.0" + "@metamask/snap-controllers" "^0.14.0" "@metamask/types" "^1.1.0" eth-rpc-errors "^4.0.2" @@ -3144,13 +3105,13 @@ isomorphic-fetch "^3.0.0" lodash "^4.17.21" -"@metamask/snap-controllers@^0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@metamask/snap-controllers/-/snap-controllers-0.12.0.tgz#789793f860471bcc856abfdd46b8693afe3041a7" - integrity sha512-EG8/VytoYy2RBHdv+CHXbd91j4ibbV1SKKDTRc3b3iUBrp4FMVvQiuaL+pvXtPHCpEKL7doh6KVoAEgib5tHyw== +"@metamask/snap-controllers@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@metamask/snap-controllers/-/snap-controllers-0.14.0.tgz#deb579c4c9ea69507209abe6901c1da1d1e8c5d1" + integrity sha512-DkD+opstaDow4+FRbECthlVKtR+9Np9ASY/OPeRfYt7foMPDAQOaFetFMNblNU5eCfEjgRSbON3VUPCF8pUaLw== dependencies: - "@metamask/controllers" "^28.0.0" - "@metamask/execution-environments" "^0.12.0" + "@metamask/controllers" "^29.0.1" + "@metamask/execution-environments" "^0.14.0" "@metamask/object-multiplex" "^1.1.0" "@metamask/obs-store" "^7.0.0" "@metamask/post-message-stream" "4.0.0" @@ -3172,12 +3133,12 @@ semver "^7.3.5" tar-stream "^2.2.0" -"@metamask/snap-types@^0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@metamask/snap-types/-/snap-types-0.12.0.tgz#240c92029d3cf6d826c023d4460148f278ad593c" - integrity sha512-ZK9gOAc8uNWFN+cdHcGk6OSpQjqKY8i4PdQLFRPQxZfFJfAT4qV2fXXOPOZpnFwYZoAVuFuzHWGV4YnrQbfFvA== +"@metamask/snap-types@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@metamask/snap-types/-/snap-types-0.14.0.tgz#efd85f430061a61cbb4c4185256de50518a367fa" + integrity sha512-sM661jKNpkM3MeNAoG9oqejh86vqv/0uI9TDuDbu/s9AZciuHPknYwmuYjaXXWxGOkUogfkWSZHHrb0Ge2s8wg== dependencies: - "@metamask/controllers" "^28.0.0" + "@metamask/controllers" "^29.0.1" "@metamask/test-dapp@^5.0.0": version "5.0.0" @@ -3215,6 +3176,21 @@ jsbi "^3.1.5" sha.js "^2.4.11" +"@noble/ed25519@^1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.6.0.tgz#b55f7c9e532b478bf1d7c4f609e1f3a37850b583" + integrity sha512-UKju89WV37IUALIMfKhKW3psO8AqmrE/GvH6QbPKjzolQ98zM7WmGUeY+xdIgSf5tqPFf75ZCYMgym6E9Jsw3Q== + +"@noble/hashes@^1.0.0", "@noble/hashes@~1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.0.0.tgz#d5e38bfbdaba174805a4e649f13be9a9ed3351ae" + integrity sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg== + +"@noble/secp256k1@^1.5.5": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.5.5.tgz#315ab5745509d1a8c8e90d0bdf59823ccf9bcfc3" + integrity sha512-sZ1W6gQzYnu45wPrWx8D3kwI2/U29VYTx9OjbDAd7jwRItJ0cSTMPRL/C8AWZFn9kWFLQGqEXVEE86w4Z8LpIQ== + "@nodelib/fs.scandir@2.1.3": version "2.1.3" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" @@ -3362,6 +3338,19 @@ redux-thunk "^2.3.0" reselect "^4.0.0" +"@scure/base@^1.0.0", "@scure/base@~1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.0.0.tgz#109fb595021de285f05a7db6806f2f48296fcee7" + integrity sha512-gIVaYhUsy+9s58m/ETjSJVKHhKTBMmcRb9cEV5/5dwvfDlfORjKrFsDeDHWRrm6RjcPvCLZFwGJjAjLj1gg4HA== + +"@scure/bip39@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.0.0.tgz#47504e58de9a56a4bbed95159d2d6829fa491bb0" + integrity sha512-HrtcikLbd58PWOkl02k9V6nXWQyoa7A0+Ek9VF7z17DDk9XZAFUcIdqfh0jJXLypmizc5/8P6OxoUeKliiWv4w== + dependencies: + "@noble/hashes" "~1.0.0" + "@scure/base" "~1.0.0" + "@segment/loosely-validate-event@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@segment/loosely-validate-event/-/loosely-validate-event-2.0.0.tgz#87dfc979e5b4e7b82c5f1d8b722dfd5d77644681" @@ -6799,16 +6788,6 @@ bip39@^2.2.0, bip39@^2.4.0: safe-buffer "^5.0.1" unorm "^1.3.3" -bip39@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" - integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== - dependencies: - "@types/node" "11.11.6" - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - randombytes "^2.0.1" - bip66@^1.1.0, bip66@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" @@ -16847,7 +16826,7 @@ keccak@3.0.1: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" -keccak@^3.0.0, keccak@^3.0.2: +keccak@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== @@ -24196,7 +24175,7 @@ secp256k1@^3.0.1, secp256k1@^3.6.1, secp256k1@^3.6.2: nan "^2.14.0" safe-buffer "^5.1.2" -secp256k1@^4.0.0, secp256k1@^4.0.1, secp256k1@^4.0.2: +secp256k1@^4.0.0, secp256k1@^4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== From 5444474d8297c86dfb9c92d0e9e80d6dc84aa87c Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Wed, 18 May 2022 16:54:38 -0500 Subject: [PATCH 061/127] add gas_used to gasParams for conversion (#14627) --- app/scripts/controllers/transactions/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 4e06c2951..f9b9f4d27 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -2040,6 +2040,10 @@ export default class TransactionController extends EventEmitter { gasParams.estimate_used = estimateUsed; } + if (extraParams?.gas_used) { + gasParams.gas_used = extraParams.gas_used; + } + const gasParamsInGwei = this._getGasValuesInGWEI(gasParams); let eip1559Version = '0'; @@ -2070,8 +2074,8 @@ export default class TransactionController extends EventEmitter { : TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, first_seen: time, gas_limit: gasLimit, - ...gasParamsInGwei, ...extraParams, + ...gasParamsInGwei, }; return { properties, sensitiveProperties }; From a5e07b0f1880eb741f618e1ed5cd347c158125f5 Mon Sep 17 00:00:00 2001 From: VSaric <92527393+VSaric@users.noreply.github.com> Date: Thu, 19 May 2022 17:52:17 +0200 Subject: [PATCH 062/127] Chain ID field use the same color pattern as the currency symbol field warning message below (#14644) --- ui/pages/settings/networks-tab/networks-form/networks-form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/pages/settings/networks-tab/networks-form/networks-form.js b/ui/pages/settings/networks-tab/networks-form/networks-form.js index 533910d65..08afc4415 100644 --- a/ui/pages/settings/networks-tab/networks-form/networks-form.js +++ b/ui/pages/settings/networks-tab/networks-form/networks-form.js @@ -436,12 +436,12 @@ const NetworksForm = ({ const rpcUrlError = validateRPCUrl(rpcUrl); setErrors({ ...errors, - chainId: chainIdError, blockExplorerUrl: blockExplorerError, rpcUrl: rpcUrlError, }); setWarnings({ ...warnings, + chainId: chainIdError, ticker: tickerWarning, }); } @@ -577,7 +577,7 @@ const NetworksForm = ({ disabled={viewOnly} /> Date: Thu, 19 May 2022 10:43:31 -0700 Subject: [PATCH 063/127] Add hideEstimatedGasFee prop to sort-list and select-quote-popover tests (#14725) --- ui/pages/swaps/select-quote-popover/select-quote-popover.test.js | 1 + ui/pages/swaps/select-quote-popover/sort-list/sort-list.test.js | 1 + 2 files changed, 2 insertions(+) diff --git a/ui/pages/swaps/select-quote-popover/select-quote-popover.test.js b/ui/pages/swaps/select-quote-popover/select-quote-popover.test.js index 1eaa99738..705cec192 100644 --- a/ui/pages/swaps/select-quote-popover/select-quote-popover.test.js +++ b/ui/pages/swaps/select-quote-popover/select-quote-popover.test.js @@ -10,6 +10,7 @@ const createProps = (customProps = {}) => { swapToSymbol: 'ETH', initialAggId: 'initialAggId', onQuoteDetailsIsOpened: jest.fn(), + hideEstimatedGasFee: false, ...customProps, }; }; diff --git a/ui/pages/swaps/select-quote-popover/sort-list/sort-list.test.js b/ui/pages/swaps/select-quote-popover/sort-list/sort-list.test.js index 1b594ba3c..51a53b3bf 100644 --- a/ui/pages/swaps/select-quote-popover/sort-list/sort-list.test.js +++ b/ui/pages/swaps/select-quote-popover/sort-list/sort-list.test.js @@ -10,6 +10,7 @@ jest.mock( const createProps = (customProps = {}) => { return { + hideEstimatedGasFee: false, selectedAggId: 'Agg2', onSelect: jest.fn(), onCaretClick: jest.fn(), From 3964940156d4a5d9861387bed85f60b5d9c5d904 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 May 2022 23:47:56 -0700 Subject: [PATCH 064/127] Bump @metamask/auto-changelog from 2.5.0 to 2.6.0 (#14741) Bumps [@metamask/auto-changelog](https://github.com/MetaMask/auto-changelog) from 2.5.0 to 2.6.0. - [Release notes](https://github.com/MetaMask/auto-changelog/releases) - [Changelog](https://github.com/MetaMask/auto-changelog/blob/main/CHANGELOG.md) - [Commits](https://github.com/MetaMask/auto-changelog/compare/v2.5.0...v2.6.0) --- updated-dependencies: - dependency-name: "@metamask/auto-changelog" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Walsh --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5fefc8b40..434b8b424 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2783,9 +2783,9 @@ integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== "@metamask/auto-changelog@^2.1.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@metamask/auto-changelog/-/auto-changelog-2.5.0.tgz#078f38142a3086fdb5556c758969a015c71dfdc9" - integrity sha512-39FeU98Poll3eTqv/bggqo3Yisza0WQJ8l9IiYloMVa2LV8XqTNqVkS4cNEU/5yq62n47JSAv6lZBtWCqeAjZQ== + version "2.6.0" + resolved "https://registry.yarnpkg.com/@metamask/auto-changelog/-/auto-changelog-2.6.0.tgz#3cef14905635b144b0fc86aed8957e0942a91cc4" + integrity sha512-YzZ/Uc/3nfvDxZxZT9YMa0CJn8/kpxif/2y8TXi5blzxBiaYop9zUh9a+7PV3C4EQVUNZuTvkE816Ua3AZ0jHA== dependencies: diff "^5.0.0" execa "^5.1.1" From 634cf70a71f63ec98ff7efbc081620480efa8a58 Mon Sep 17 00:00:00 2001 From: Alex Donesky Date: Fri, 20 May 2022 09:35:18 -0500 Subject: [PATCH 065/127] Enhance reusable SiteOrigin component (#14720) * extend and reuse SiteOrigin component --- ...onfirm-page-container-summary.component.js | 6 ++- .../connected-sites-list.component.js | 8 +-- .../app/connected-sites-list/index.scss | 4 -- .../app/signature-request-original/index.scss | 2 - .../signature-request-original.component.js | 8 +-- .../app/signature-request/index.scss | 2 + .../signature-request.component.js | 6 ++- .../app/transaction-list-item/index.scss | 6 --- .../smart-transaction-list-item.component.js | 9 ++-- .../transaction-list-item.component.js | 18 +++---- ui/components/ui/site-origin/index.scss | 8 +-- ui/components/ui/site-origin/site-origin.js | 52 ++++++++++++++++--- .../ui/site-origin/site-origin.stories.js | 8 +++ ...confirm-encryption-public-key.component.js | 5 +- .../confirm-encryption-public-key.scss | 1 + ui/pages/confirmation/confirmation.js | 9 ++-- 16 files changed, 103 insertions(+), 49 deletions(-) diff --git a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js index a83cc1e4e..2d5fb8193 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js +++ b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js @@ -14,6 +14,7 @@ import NicknamePopovers from '../../../modals/nickname-popovers'; import Typography from '../../../../ui/typography'; import { TYPOGRAPHY } from '../../../../../helpers/constants/design-system'; import { ORIGIN_METAMASK } from '../../../../../../shared/constants/app'; +import SiteOrigin from '../../../../ui/site-origin'; const ConfirmPageContainerSummary = (props) => { const { @@ -85,7 +86,10 @@ const ConfirmPageContainerSummary = (props) => { return (
    {origin === ORIGIN_METAMASK ? null : ( -
    {origin}
    + )}
    diff --git a/ui/components/app/connected-sites-list/connected-sites-list.component.js b/ui/components/app/connected-sites-list/connected-sites-list.component.js index 52245e7cb..7b23820c0 100644 --- a/ui/components/app/connected-sites-list/connected-sites-list.component.js +++ b/ui/components/app/connected-sites-list/connected-sites-list.component.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import Button from '../../ui/button'; import SiteIcon from '../../ui/site-icon'; import { stripHttpsSchemeWithoutPort } from '../../../helpers/utils/util'; +import SiteOrigin from '../../ui/site-origin'; export default class ConnectedSitesList extends Component { static contextTypes = { @@ -33,12 +34,11 @@ export default class ConnectedSitesList extends Component { >
    - - {this.getSubjectDisplayName(subject)} - + siteOrigin={this.getSubjectDisplayName(subject)} + />
    ); }; diff --git a/ui/components/app/signature-request/index.scss b/ui/components/app/signature-request/index.scss index 1483054d5..ad97e5781 100644 --- a/ui/components/app/signature-request/index.scss +++ b/ui/components/app/signature-request/index.scss @@ -68,6 +68,8 @@ &__info { @include H7; + + padding: 0 12px 4px; } &__info--bolded { diff --git a/ui/components/app/signature-request/signature-request.component.js b/ui/components/app/signature-request/signature-request.component.js index 4edaab599..a76dfa8b0 100644 --- a/ui/components/app/signature-request/signature-request.component.js +++ b/ui/components/app/signature-request/signature-request.component.js @@ -4,6 +4,7 @@ import Identicon from '../../ui/identicon'; import LedgerInstructionField from '../ledger-instruction-field'; import { sanitizeMessage } from '../../../helpers/utils/util'; import { EVENT } from '../../../../shared/constants/metametrics'; +import SiteOrigin from '../../ui/site-origin'; import Header from './signature-request-header'; import Footer from './signature-request-footer'; import Message from './signature-request-message'; @@ -124,7 +125,10 @@ export default class SignatureRequest extends PureComponent {
    {domain.name}
    -
    {origin}
    +
    {this.formatWallet(fromAddress)}
    diff --git a/ui/components/app/transaction-list-item/index.scss b/ui/components/app/transaction-list-item/index.scss index 69413b1e1..f523714bd 100644 --- a/ui/components/app/transaction-list-item/index.scss +++ b/ui/components/app/transaction-list-item/index.scss @@ -53,15 +53,9 @@ margin: 0 4px; } - &__origin, &__address { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } - - &__origin { - /*rtl:ignore*/ - direction: rtl; - } } diff --git a/ui/components/app/transaction-list-item/smart-transaction-list-item.component.js b/ui/components/app/transaction-list-item/smart-transaction-list-item.component.js index 26133341e..156b9d8ef 100644 --- a/ui/components/app/transaction-list-item/smart-transaction-list-item.component.js +++ b/ui/components/app/transaction-list-item/smart-transaction-list-item.component.js @@ -14,6 +14,7 @@ import { import CancelButton from '../cancel-button'; import { cancelSwapsSmartTransaction } from '../../../ducks/swaps/swaps'; +import SiteOrigin from '../../ui/site-origin'; export default function SmartTransactionListItem({ smartTransaction, @@ -60,9 +61,11 @@ export default function SmartTransactionListItem({ date={date} status={displayedStatusKey} /> - - {subtitle} - + } > diff --git a/ui/components/app/transaction-list-item/transaction-list-item.component.js b/ui/components/app/transaction-list-item/transaction-list-item.component.js index 5cc73bc03..867d236f9 100644 --- a/ui/components/app/transaction-list-item/transaction-list-item.component.js +++ b/ui/components/app/transaction-list-item/transaction-list-item.component.js @@ -39,6 +39,7 @@ import CancelSpeedupPopover from '../cancel-speedup-popover'; import EditGasFeePopover from '../edit-gas-fee-popover'; import EditGasPopover from '../edit-gas-popover'; import { MetaMetricsContext } from '../../../contexts/metametrics'; +import SiteOrigin from '../../ui/site-origin'; function TransactionListItemInner({ transactionGroup, @@ -191,16 +192,13 @@ function TransactionListItemInner({ date={date} status={displayedStatusKey} /> - - {subtitle} - + {subtitleContainsOrigin ? ( + + ) : ( + + {subtitle} + + )} } rightContent={ diff --git a/ui/components/ui/site-origin/index.scss b/ui/components/ui/site-origin/index.scss index 2f0016e76..895e0f2ef 100644 --- a/ui/components/ui/site-origin/index.scss +++ b/ui/components/ui/site-origin/index.scss @@ -1,12 +1,13 @@ .site-origin { + overflow: hidden; max-width: 100%; .chip { max-width: 100%; - } - .chip__left-icon { - padding: 4px 0 4px 8px; + &__left-icon { + padding: 4px 0 4px 8px; + } } span { @@ -17,5 +18,6 @@ /*rtl:ignore*/ direction: rtl; + max-width: 100%; } } diff --git a/ui/components/ui/site-origin/site-origin.js b/ui/components/ui/site-origin/site-origin.js index 2dc545a68..78fee0e6b 100644 --- a/ui/components/ui/site-origin/site-origin.js +++ b/ui/components/ui/site-origin/site-origin.js @@ -1,22 +1,60 @@ import React from 'react'; import PropTypes from 'prop-types'; +import classnames from 'classnames'; import Chip from '../chip'; import IconWithFallback from '../icon-with-fallback'; -export default function SiteOrigin({ siteOrigin, iconSrc, iconName }) { +export default function SiteOrigin({ + siteOrigin, + iconSrc, + iconName, + chip, + className, + title, +}) { return ( -
    - } - /> +
    + {chip ? ( + + } + /> + ) : ( + {siteOrigin} + )}
    ); } SiteOrigin.propTypes = { + /** + * The origin of the site generally the URL + */ siteOrigin: PropTypes.string.isRequired, + /** + * Icon name is used for the fallback icon and will display the first letter of the string + * when iconSrc errors or is not provided. + */ iconName: PropTypes.string, + /** + * The image src of the icon + */ iconSrc: PropTypes.string, + /** + * Additional className added to the root html element + */ + className: PropTypes.string, + /** + * title specifies extra information and is added to a title attribute added to the root html element + * It is most often shown as a tooltip text when the mouse moves over the element. + */ + title: PropTypes.string, + /** + * Whether the SiteOrigin is displayed as a chip or plain text. + * if false iconSrc and iconName props will not be used. + */ + chip: PropTypes.bool, }; diff --git a/ui/components/ui/site-origin/site-origin.stories.js b/ui/components/ui/site-origin/site-origin.stories.js index 53a11c190..2604b5704 100644 --- a/ui/components/ui/site-origin/site-origin.stories.js +++ b/ui/components/ui/site-origin/site-origin.stories.js @@ -16,6 +16,12 @@ export default { iconName: { control: 'text', }, + title: { + control: 'text', + }, + chip: { + control: 'boolean', + }, }, }; @@ -25,6 +31,8 @@ DefaultStory.storyName = 'Default'; DefaultStory.args = { siteOrigin: 'https://metamask.io', + title: 'https://metamask.io', iconName: 'MetaMask', iconSrc: './metamark.svg', + chip: true, }; diff --git a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js index 026cea6d8..92cbf9dae 100644 --- a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js +++ b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js @@ -7,6 +7,7 @@ import Identicon from '../../components/ui/identicon'; import { EVENT } from '../../../shared/constants/metametrics'; import { conversionUtil } from '../../../shared/modules/conversion.utils'; +import SiteOrigin from '../../components/ui/site-origin'; export default class ConfirmEncryptionPublicKey extends Component { static contextTypes = { @@ -118,7 +119,9 @@ export default class ConfirmEncryptionPublicKey extends Component { const { t } = this.context; const targetSubjectMetadata = subjectMetadata[txData.origin]; - const notice = t('encryptionPublicKeyNotice', [txData.origin]); + const notice = t('encryptionPublicKeyNotice', [ + , + ]); const name = targetSubjectMetadata?.hostname || txData.origin; return ( diff --git a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.scss b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.scss index caed0982a..0df5f72d5 100644 --- a/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.scss +++ b/ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.scss @@ -198,6 +198,7 @@ flex-direction: column; align-items: center; flex: 1; + width: 100%; } &-identicon { diff --git a/ui/pages/confirmation/confirmation.js b/ui/pages/confirmation/confirmation.js index 1d09457c5..b824155bc 100644 --- a/ui/pages/confirmation/confirmation.js +++ b/ui/pages/confirmation/confirmation.js @@ -10,7 +10,6 @@ import { useHistory } from 'react-router-dom'; import { isEqual } from 'lodash'; import { produce } from 'immer'; import Box from '../../components/ui/box'; -import Chip from '../../components/ui/chip'; import MetaMaskTemplateRenderer from '../../components/app/metamask-template-renderer'; import SiteIcon from '../../components/ui/site-icon'; import { DEFAULT_ROUTE } from '../../helpers/constants/routes'; @@ -25,6 +24,7 @@ import { useOriginMetadata } from '../../hooks/useOriginMetadata'; import { getUnapprovedTemplatedConfirmations } from '../../selectors'; import NetworkDisplay from '../../components/app/network-display/network-display'; import Callout from '../../components/ui/callout'; +import SiteOrigin from '../../components/ui/site-origin'; import ConfirmationFooter from './components/confirmation-footer'; import { getTemplateValues, getTemplateAlerts } from './templates'; @@ -208,9 +208,10 @@ export default function ConfirmationPage() { name={originMetadata.hostname} size={36} /> - From e06e5599bb2646174aa71e1dbd45afd8ed7293ab Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Mon, 23 May 2022 15:04:54 -0500 Subject: [PATCH 066/127] EditGasFeeBtn: Insufficient number of substitutions for key "dappSuggestedTooltip" (#14734) * EditGasFeeBtn: support missing origin dappSuggest * EditGasFeeButton: add tooltip min-width * EditGasFeeButton: tooltip min-width needs extra px * EditGasFeeBtb: tooltip min-width add a bit more px --- .../edit-gas-fee-button.js | 23 +++++++++---------- .../app/edit-gas-fee-button/index.scss | 7 ++++++ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js b/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js index 7f73181c9..d872a2895 100644 --- a/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js +++ b/ui/components/app/edit-gas-fee-button/edit-gas-fee-button.js @@ -80,23 +80,22 @@ export default function EditGasFeeButton({ userAcknowledgedGasMissing }) { - - {t('dappSuggestedTooltip', [transaction.origin])} - + {transaction?.origin && ( + + {t('dappSuggestedTooltip', [transaction.origin])} + + )} - {t('maxBaseFee')} - {maxFeePerGas} + {t('maxBaseFee')} {maxFeePerGas} - {t('maxPriorityFee')} - {maxPriorityFeePerGas} + {t('maxPriorityFee')} {maxPriorityFeePerGas} - {t('gasLimit')} - {gasLimit} + {t('gasLimit')} {gasLimit}
    } diff --git a/ui/components/app/edit-gas-fee-button/index.scss b/ui/components/app/edit-gas-fee-button/index.scss index 52c7cbaf4..448eab674 100644 --- a/ui/components/app/edit-gas-fee-button/index.scss +++ b/ui/components/app/edit-gas-fee-button/index.scss @@ -47,3 +47,10 @@ } } } + + +// Overrides react-tippy + +.tippy-tooltip .tippy-tooltip-content .edit-gas-fee-button__tooltip { + min-width: 170px; +} From e7d1476522f66a0e5e12f30ca5ef4d4d2bd9cf20 Mon Sep 17 00:00:00 2001 From: VSaric <92527393+VSaric@users.noreply.github.com> Date: Tue, 24 May 2022 17:28:40 +0200 Subject: [PATCH 067/127] Sign button is enabled after scrolling all the way to the bottom (#14745) --- ui/components/app/signature-request/index.scss | 3 --- .../signature-request-footer.component.js | 4 ++-- .../signature-request/signature-request-message/index.scss | 2 +- .../signature-request-message.component.js | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ui/components/app/signature-request/index.scss b/ui/components/app/signature-request/index.scss index ad97e5781..a9896ed18 100644 --- a/ui/components/app/signature-request/index.scss +++ b/ui/components/app/signature-request/index.scss @@ -87,6 +87,3 @@ .identicon {} } -.signature-request-footer { - flex: 1 1 auto; -} diff --git a/ui/components/app/signature-request/signature-request-footer/signature-request-footer.component.js b/ui/components/app/signature-request/signature-request-footer/signature-request-footer.component.js index a42e4f2ae..f4a84b734 100644 --- a/ui/components/app/signature-request/signature-request-footer/signature-request-footer.component.js +++ b/ui/components/app/signature-request/signature-request-footer/signature-request-footer.component.js @@ -17,10 +17,10 @@ export default class SignatureRequestFooter extends PureComponent { const { cancelAction, signAction, disabled = false } = this.props; return (
    - -
    diff --git a/ui/components/app/signature-request/signature-request-message/index.scss b/ui/components/app/signature-request/signature-request-message/index.scss index 343bd0563..ef2baa76d 100644 --- a/ui/components/app/signature-request/signature-request-message/index.scss +++ b/ui/components/app/signature-request/signature-request-message/index.scss @@ -1,7 +1,7 @@ .signature-request-message { flex: 1 60%; display: flex; - max-height: 230px; + max-height: 231px; flex-direction: column; position: relative; diff --git a/ui/components/app/signature-request/signature-request-message/signature-request-message.component.js b/ui/components/app/signature-request/signature-request-message/signature-request-message.component.js index 2a02cdcdd..641931919 100644 --- a/ui/components/app/signature-request/signature-request-message/signature-request-message.component.js +++ b/ui/components/app/signature-request/signature-request-message/signature-request-message.component.js @@ -26,7 +26,7 @@ export default class SignatureRequestMessage extends PureComponent { } const { scrollTop, offsetHeight, scrollHeight } = this.props.messageRootRef; - const isAtBottom = scrollTop + offsetHeight >= scrollHeight; + const isAtBottom = Math.round(scrollTop) + offsetHeight >= scrollHeight; if (isAtBottom) { this.setState({ messageIsScrolled: true }); From 8465a3c4aa517988ca0769ae296c167dad3c747d Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 24 May 2022 12:59:21 -0230 Subject: [PATCH 068/127] Remove module paths from bundle (#14763) A patch has been added to ensure lavapack no longer includes the path for each module as part of each serialized module. This path was originally added for debugging purposes, and is not used for anything at runtime. The module path was an absolute path, not a relative one, so it was an obstacle to having reproducible builds between environments. --- patches/@lavamoat+lavapack+3.1.0.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 patches/@lavamoat+lavapack+3.1.0.patch diff --git a/patches/@lavamoat+lavapack+3.1.0.patch b/patches/@lavamoat+lavapack+3.1.0.patch new file mode 100644 index 000000000..bdce11c01 --- /dev/null +++ b/patches/@lavamoat+lavapack+3.1.0.patch @@ -0,0 +1,15 @@ +diff --git a/node_modules/@lavamoat/lavapack/src/pack.js b/node_modules/@lavamoat/lavapack/src/pack.js +index eb41a0a..3f891ea 100644 +--- a/node_modules/@lavamoat/lavapack/src/pack.js ++++ b/node_modules/@lavamoat/lavapack/src/pack.js +@@ -203,7 +203,9 @@ function createPacker({ + const jsonSerializeableData = { + // id, + package: packageName, +- file, ++ // Omit this absolute filename from bundle so that builds are reproducible between environments ++ // TODO: update lavapack with an option to omit this, and/or make this filepath relative to the current working directory ++ // file, + // deps, + // source: sourceMeta.code + } From c833e41eee515a356cfeaae8035baa884e674199 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 24 May 2022 18:04:07 +0200 Subject: [PATCH 069/127] Restore SiteOrigin chip on permission screen (#14768) * Restore SiteOrigin chip on permission screen * Fix linting --- .../permissions-connect-header.component.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/components/app/permissions-connect-header/permissions-connect-header.component.js b/ui/components/app/permissions-connect-header/permissions-connect-header.component.js index c5ddf0110..00400d44b 100644 --- a/ui/components/app/permissions-connect-header/permissions-connect-header.component.js +++ b/ui/components/app/permissions-connect-header/permissions-connect-header.component.js @@ -48,7 +48,12 @@ export default class PermissionsConnectHeader extends Component { return (
    - +
    ); } From f6576801d47d896311d7c2fa96a9ec23c30ffbab Mon Sep 17 00:00:00 2001 From: Daniel <80175477+dan437@users.noreply.github.com> Date: Tue, 24 May 2022 18:30:46 +0200 Subject: [PATCH 070/127] Fix an edge case with missing top assets in Swaps (#14688) * If there is no array of top assets in a response, use an empty array * Set a default empty array for 2 functions, remove an unnecessary condition * Redirect a user from Swaps to the homepage if they switch to a chain that is not supported in Swaps * Fix errors in the UI Console when it's not a swaps chain --- .../templates/add-ethereum-chain.js | 5 ++-- .../networks-form/networks-form.js | 7 ++--- ui/pages/swaps/index.js | 29 ++++++++++++++----- ui/pages/swaps/swaps.util.js | 11 +++---- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/ui/pages/confirmation/templates/add-ethereum-chain.js b/ui/pages/confirmation/templates/add-ethereum-chain.js index db7dac420..c417a1111 100644 --- a/ui/pages/confirmation/templates/add-ethereum-chain.js +++ b/ui/pages/confirmation/templates/add-ethereum-chain.js @@ -71,9 +71,8 @@ const INVALID_CHAIN = { async function getAlerts(pendingApproval) { const alerts = []; - const safeChainsList = await fetchWithCache( - 'https://chainid.network/chains.json', - ); + const safeChainsList = + (await fetchWithCache('https://chainid.network/chains.json')) || []; const matchedChain = safeChainsList.find( (chain) => chain.chainId === parseInt(pendingApproval.requestData.chainId, 16), diff --git a/ui/pages/settings/networks-tab/networks-form/networks-form.js b/ui/pages/settings/networks-tab/networks-form/networks-form.js index 08afc4415..402437c86 100644 --- a/ui/pages/settings/networks-tab/networks-form/networks-form.js +++ b/ui/pages/settings/networks-tab/networks-form/networks-form.js @@ -328,15 +328,14 @@ const NetworksForm = ({ } try { - safeChainsList = await fetchWithCache( - 'https://chainid.network/chains.json', - ); + safeChainsList = + (await fetchWithCache('https://chainid.network/chains.json')) || []; } catch (err) { log.warn('Failed to fetch the chainList from chainid.network', err); providerError = err; } - if (providerError || !Array.isArray(safeChainsList)) { + if (providerError) { warningKey = 'failedToFetchTickerSymbolData'; warningMessage = t('failedToFetchTickerSymbolData'); } else { diff --git a/ui/pages/swaps/index.js b/ui/pages/swaps/index.js index bae9e6cbd..1ade6f4bb 100644 --- a/ui/pages/swaps/index.js +++ b/ui/pages/swaps/index.js @@ -157,11 +157,21 @@ export default function Swap() { const showSmartTransactionsErrorMessage = currentSmartTransactionsError && !smartTransactionsErrorMessageDismissed; - if (networkAndAccountSupports1559) { - // This will pre-load gas fees before going to the View Quote page. - // eslint-disable-next-line react-hooks/rules-of-hooks - useGasFeeEstimates(); - } + useEffect(() => { + const leaveSwaps = async () => { + await dispatch(prepareToLeaveSwaps()); + // We need to wait until "prepareToLeaveSwaps" is done, because otherwise + // a user would be redirected from DEFAULT_ROUTE back to Swaps. + history.push(DEFAULT_ROUTE); + }; + + if (!isSwapsChain) { + leaveSwaps(); + } + }, [isSwapsChain, dispatch, history]); + + // This will pre-load gas fees before going to the View Quote page. + useGasFeeEstimates(); const { balance: ethBalance, @@ -223,6 +233,9 @@ export default function Swap() { // eslint-disable-next-line useEffect(() => { + if (!isSwapsChain) { + return undefined; + } fetchTokens(chainId) .then((tokens) => { dispatch(setSwapsTokens(tokens)); @@ -240,7 +253,7 @@ export default function Swap() { return () => { dispatch(prepareToLeaveSwaps()); }; - }, [dispatch, chainId, networkAndAccountSupports1559]); + }, [dispatch, chainId, networkAndAccountSupports1559, isSwapsChain]); const hardwareWalletUsed = useSelector(isHardwareWallet); const hardwareWalletType = useSelector(getHardwareWalletType); @@ -353,7 +366,9 @@ export default function Swap() { ]); if (!isSwapsChain) { - return ; + // A user is being redirected outside of Swaps via the async "leaveSwaps" function above. In the meantime + // we have to prevent the code below this condition, which wouldn't work on an unsupported chain. + return <>; } const isStxNotEnoughFundsError = diff --git a/ui/pages/swaps/swaps.util.js b/ui/pages/swaps/swaps.util.js index c0993b63f..446e6eff5 100644 --- a/ui/pages/swaps/swaps.util.js +++ b/ui/pages/swaps/swaps.util.js @@ -420,11 +420,12 @@ export async function fetchAggregatorMetadata(chainId) { export async function fetchTopAssets(chainId) { const topAssetsUrl = getBaseApi('topAssets', chainId); - const response = await fetchWithCache( - topAssetsUrl, - { method: 'GET', headers: clientIdHeader }, - { cacheRefreshTime: CACHE_REFRESH_FIVE_MINUTES }, - ); + const response = + (await fetchWithCache( + topAssetsUrl, + { method: 'GET', headers: clientIdHeader }, + { cacheRefreshTime: CACHE_REFRESH_FIVE_MINUTES }, + )) || []; const topAssetsMap = response.reduce((_topAssetsMap, asset, index) => { if (validateData(TOP_ASSET_VALIDATORS, asset, topAssetsUrl)) { return { ..._topAssetsMap, [asset.address]: { index: String(index) } }; From 623fd91d65604baa12a14964c756b3240d5cd60d Mon Sep 17 00:00:00 2001 From: VSaric <92527393+VSaric@users.noreply.github.com> Date: Tue, 24 May 2022 22:16:11 +0200 Subject: [PATCH 071/127] Fix currency conversion rate (#14713) --- .../ui/token-input/token-input.component.js | 9 +- .../token-input/token-input.component.test.js | 90 +++++++++++++++++++ .../ui/token-input/token-input.container.js | 3 +- 3 files changed, 100 insertions(+), 2 deletions(-) diff --git a/ui/components/ui/token-input/token-input.component.js b/ui/components/ui/token-input/token-input.component.js index 3b8d2eefb..6de1191dc 100644 --- a/ui/components/ui/token-input/token-input.component.js +++ b/ui/components/ui/token-input/token-input.component.js @@ -11,6 +11,7 @@ import { import { ETH } from '../../../helpers/constants/common'; import { addHexPrefix } from '../../../../app/scripts/lib/util'; +import { isEqualCaseInsensitive } from '../../../../shared/modules/string-utils'; /** * Component that allows user to enter token values as a number, and props receive a converted @@ -34,6 +35,7 @@ export default class TokenInput extends PureComponent { symbol: PropTypes.string, }).isRequired, tokenExchangeRates: PropTypes.object, + tokens: PropTypes.array.isRequired, }; constructor(props) { @@ -108,10 +110,15 @@ export default class TokenInput extends PureComponent { currentCurrency, hideConversion, token, + tokens, } = this.props; const { decimalValue } = this.state; - const tokenExchangeRate = tokenExchangeRates?.[token.address] || 0; + const existingToken = tokens.find(({ address }) => + isEqualCaseInsensitive(address, token.address), + ); + + const tokenExchangeRate = tokenExchangeRates?.[existingToken.address] || 0; let currency, numberOfDecimals; if (hideConversion) { diff --git a/ui/components/ui/token-input/token-input.component.test.js b/ui/components/ui/token-input/token-input.component.test.js index ac8d55fe8..a7245c54e 100644 --- a/ui/components/ui/token-input/token-input.component.test.js +++ b/ui/components/ui/token-input/token-input.component.test.js @@ -28,6 +28,15 @@ describe('TokenInput Component', () => { decimals: 4, symbol: 'ABC', }} + tokens={[ + { + address: '0x1', + decimals: 4, + symbol: 'ABC', + image: null, + isERC721: false, + }, + ]} /> , { @@ -66,6 +75,15 @@ describe('TokenInput Component', () => { decimals: 4, symbol: 'ABC', }} + tokens={[ + { + address: '0x1', + decimals: 4, + symbol: 'ABC', + image: null, + isERC721: false, + }, + ]} tokenExchangeRates={{ '0x1': 2 }} /> , @@ -101,6 +119,15 @@ describe('TokenInput Component', () => { decimals: 4, symbol: 'ABC', }} + tokens={[ + { + address: '0x1', + decimals: 4, + symbol: 'ABC', + image: null, + isERC721: false, + }, + ]} tokenExchangeRates={{ '0x1': 2 }} /> , @@ -138,6 +165,15 @@ describe('TokenInput Component', () => { decimals: 4, symbol: 'ABC', }} + tokens={[ + { + address: '0x1', + decimals: 4, + symbol: 'ABC', + image: null, + isERC721: false, + }, + ]} tokenExchangeRates={{ '0x1': 2 }} showFiat currentCurrency="usd" @@ -177,6 +213,15 @@ describe('TokenInput Component', () => { decimals: 4, symbol: 'ABC', }} + tokens={[ + { + address: '0x1', + decimals: 4, + symbol: 'ABC', + image: null, + isERC721: false, + }, + ]} tokenExchangeRates={{ '0x1': 2 }} showFiat hideConversion @@ -229,6 +274,15 @@ describe('TokenInput Component', () => { decimals: 4, symbol: 'ABC', }} + tokens={[ + { + address: '0x1', + decimals: 4, + symbol: 'ABC', + image: null, + isERC721: false, + }, + ]} tokenExchangeRates={{ '0x1': 2 }} /> , @@ -273,6 +327,15 @@ describe('TokenInput Component', () => { decimals: 4, symbol: 'ABC', }} + tokens={[ + { + address: '0x1', + decimals: 4, + symbol: 'ABC', + image: null, + isERC721: false, + }, + ]} tokenExchangeRates={{ '0x1': 2 }} showFiat currentCurrency="usd" @@ -319,6 +382,15 @@ describe('TokenInput Component', () => { decimals: 4, symbol: 'ABC', }} + tokens={[ + { + address: '0x1', + decimals: 4, + symbol: 'ABC', + image: null, + isERC721: false, + }, + ]} tokenExchangeRates={{ '0x1': 2 }} showFiat /> @@ -365,6 +437,15 @@ describe('TokenInput Component', () => { decimals: 4, symbol: 'ABC', }} + tokens={[ + { + address: '0x1', + decimals: 4, + symbol: 'ABC', + image: null, + isERC721: false, + }, + ]} tokenExchangeRates={{ '0x1': 2 }} showFiat currentCurrency="usd" @@ -404,6 +485,15 @@ describe('TokenInput Component', () => { decimals: 4, symbol: 'ABC', }} + tokens={[ + { + address: '0x1', + decimals: 4, + symbol: 'ABC', + image: null, + isERC721: false, + }, + ]} tokenExchangeRates={{ '0x1': 2 }} showFiat currentCurrency="usd" diff --git a/ui/components/ui/token-input/token-input.container.js b/ui/components/ui/token-input/token-input.container.js index 9f964feec..98082a3db 100644 --- a/ui/components/ui/token-input/token-input.container.js +++ b/ui/components/ui/token-input/token-input.container.js @@ -5,13 +5,14 @@ import TokenInput from './token-input.component'; const mapStateToProps = (state) => { const { - metamask: { currentCurrency }, + metamask: { currentCurrency, tokens }, } = state; return { currentCurrency, tokenExchangeRates: getTokenExchangeRates(state), hideConversion: !getShouldShowFiat(state), + tokens, }; }; From 3177c6abbb46a1528d22fd178a5653c637703492 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Tue, 24 May 2022 16:05:27 -0500 Subject: [PATCH 072/127] remove draft transaction (#14701) --- ui/ducks/send/send.js | 250 ++++++++++++------------------ ui/ducks/send/send.test.js | 310 +++---------------------------------- 2 files changed, 121 insertions(+), 439 deletions(-) diff --git a/ui/ducks/send/send.js b/ui/ducks/send/send.js index 54835178e..8cb00f331 100644 --- a/ui/ducks/send/send.js +++ b/ui/ducks/send/send.js @@ -372,7 +372,7 @@ export const computeEstimatedGasLimit = createAsyncThunk( const { send, metamask } = state; const unapprovedTxs = getUnapprovedTxs(state); const isMultiLayerFeeNetwork = getIsMultiLayerFeeNetwork(state); - const transaction = unapprovedTxs[send.draftTransaction.id]; + const transaction = unapprovedTxs[send.id]; const isNonStandardEthChain = getIsNonStandardEthChain(state); const chainId = getCurrentChainId(state); @@ -388,7 +388,7 @@ export const computeEstimatedGasLimit = createAsyncThunk( ? send.account.balance : send.amount.value, from: send.account.address, - data: send.draftTransaction.userInputHexData, + data: send.userInputHexData, type: '0x0', }, }); @@ -406,7 +406,7 @@ export const computeEstimatedGasLimit = createAsyncThunk( sendToken: send.asset.details, to: send.recipient.address?.toLowerCase(), value: send.amount.value, - data: send.draftTransaction.userInputHexData, + data: send.userInputHexData, isNonStandardEthChain, chainId, gasLimit: send.gas.gasLimit, @@ -463,7 +463,7 @@ export const initializeSendState = createAsyncThunk( const chainId = getCurrentChainId(state); const eip1559support = checkNetworkAndAccountSupports1559(state); const { - send: { asset, stage, recipient, amount, draftTransaction }, + send: { asset, stage, recipient, amount, userInputHexData }, metamask, } = state; @@ -473,7 +473,7 @@ export const initializeSendState = createAsyncThunk( // send page), the fromAddress is always the address from the txParams. const fromAddress = stage === SEND_STAGES.EDIT - ? draftTransaction.txParams.from + ? state.send.account.address : metamask.selectedAddress; // We need the account's balance which is calculated from cachedBalances in // the getMetaMaskAccounts selector. getTargetAccount consumes this @@ -532,7 +532,7 @@ export const initializeSendState = createAsyncThunk( sendToken: asset.details, to: recipient.address.toLowerCase(), value: amount.value, - data: draftTransaction.userInputHexData, + data: userInputHexData, isNonStandardEthChain, chainId, }); @@ -586,6 +586,7 @@ export const initializeSendState = createAsyncThunk( ); export const initialState = { + id: null, // which stage of the send flow is the user on stage: SEND_STAGES.INACTIVE, // status of the send slice, either VALID or INVALID @@ -601,6 +602,7 @@ export const initialState = { // balance of the from account balance: '0x0', }, + userInputHexData: null, gas: { // indicate whether the gas estimate is loading isGasEstimateLoading: true, @@ -647,26 +649,6 @@ export const initialState = { // error to display when there is an issue with the asset error: null, }, - draftTransaction: { - // The metamask internal id of the transaction. Only populated in the EDIT - // stage. - id: null, - // The hex encoded data provided by the user who has enabled hex data field - // in advanced settings - userInputHexData: null, - // The txParams that should be submitted to the network once this - // transaction is confirmed. This object is computed on every write to the - // slice of fields that would result in the txParams changing - txParams: { - to: '', - from: '', - data: undefined, - value: '0x0', - gas: '0x0', - gasPrice: '0x0', - type: TRANSACTION_ENVELOPE_TYPES.LEGACY, - }, - }, recipient: { // Defines which mode to use for searching for matches in the input field mode: RECIPIENT_SEARCH_MODES.CONTACT_LIST, @@ -689,6 +671,86 @@ export const initialState = { history: [], }; +/** + * Generates a txParams from the send state + * + * @param {Object} state - the Send slice state + * @returns {import( + * '../../../shared/constants/transaction' + * ).TxParams} A txParams object that can be used to create a transaction or + * update an existing transaction. + */ +function generateTransactionParams(state) { + const txParams = { + from: state.account.address, + // gasLimit always needs to be set regardless of the asset being sent + // or the type of transaction. + gas: state.gas.gasLimit, + }; + switch (state.asset.type) { + case ASSET_TYPES.TOKEN: + // When sending a token the to address is the contract address of + // the token being sent. The value is set to '0x0' and the data + // is generated from the recipient address, token being sent and + // amount. + txParams.to = state.asset.details.address; + txParams.value = '0x0'; + txParams.data = generateERC20TransferData({ + toAddress: state.recipient.address, + amount: state.amount.value, + sendToken: state.asset.details, + }); + break; + case ASSET_TYPES.COLLECTIBLE: + // When sending a token the to address is the contract address of + // the token being sent. The value is set to '0x0' and the data + // is generated from the recipient address, token being sent and + // amount. + txParams.to = state.asset.details.address; + txParams.value = '0x0'; + txParams.data = generateERC721TransferData({ + toAddress: state.recipient.address, + fromAddress: state.account.address, + tokenId: state.asset.details.tokenId, + }); + break; + case ASSET_TYPES.NATIVE: + default: + // When sending native currency the to and value fields use the + // recipient and amount values and the data key is either null or + // populated with the user input provided in hex field. + txParams.to = state.recipient.address; + txParams.value = state.amount.value; + txParams.data = state.userInputHexData ?? undefined; + } + + // We need to make sure that we only include the right gas fee fields + // based on the type of transaction the network supports. We will also set + // the type param here. + if (state.eip1559support) { + txParams.type = TRANSACTION_ENVELOPE_TYPES.FEE_MARKET; + + txParams.maxFeePerGas = state.gas.maxFeePerGas; + txParams.maxPriorityFeePerGas = state.gas.maxPriorityFeePerGas; + + if (!txParams.maxFeePerGas || txParams.maxFeePerGas === '0x0') { + txParams.maxFeePerGas = state.gas.gasPrice; + } + + if ( + !txParams.maxPriorityFeePerGas || + txParams.maxPriorityFeePerGas === '0x0' + ) { + txParams.maxPriorityFeePerGas = txParams.maxFeePerGas; + } + } else { + txParams.gasPrice = state.gas.gasPrice; + txParams.type = TRANSACTION_ENVELOPE_TYPES.LEGACY; + } + + return txParams; +} + const slice = createSlice({ name, initialState, @@ -701,7 +763,7 @@ const slice = createSlice({ }, /** * update current amount.value in state and run post update validation of - * the amount field and the send state. Recomputes the draftTransaction + * the amount field and the send state. * * @param state * @param action @@ -723,7 +785,7 @@ const slice = createSlice({ /** * computes the maximum amount of asset that can be sent and then calls * the updateSendAmount action above with the computed value, which will - * revalidate the field and form and recomputes the draftTransaction + * revalidate the field and form. * * @param state */ @@ -756,29 +818,20 @@ const slice = createSlice({ slice.caseReducers.updateSendAmount(state, { payload: amount, }); - // draftTransaction update happens in updateSendAmount }, /** - * updates the draftTransaction.userInputHexData state key and then - * recomputes the draftTransaction if the user is currently sending the - * native asset. When sending ERC20 assets, this is unnecessary because the - * hex data used in the transaction will be that for interacting with the - * ERC20 contract + * updates the userInputHexData state key * * @param state * @param action */ updateUserInputHexData: (state, action) => { - state.draftTransaction.userInputHexData = action.payload; - if (state.asset.type === ASSET_TYPES.NATIVE) { - slice.caseReducers.updateDraftTransaction(state); - } + state.userInputHexData = action.payload; }, /** * Initiates the edit transaction flow by setting the stage to 'EDIT' and * then pulling the details of the previously submitted transaction from - * the action payload. It also computes a new draftTransaction that will be - * used when updating the transaction in the provider + * the action payload. * * @param state * @param action @@ -793,10 +846,9 @@ const slice = createSlice({ state.asset.error = null; state.recipient.address = action.payload.address; state.recipient.nickname = action.payload.nickname; - state.draftTransaction.id = action.payload.id; - state.draftTransaction.txParams.from = action.payload.from; - state.draftTransaction.userInputHexData = action.payload.data; - slice.caseReducers.updateDraftTransaction(state); + state.id = action.payload.id; + state.account.address = action.payload.from; + state.userInputHexData = action.payload.data; }, /** * gasTotal is computed based on gasPrice and gasLimit and set in state @@ -999,108 +1051,16 @@ const slice = createSlice({ // to the ADD_RECIPIENT stage. state.stage = SEND_STAGES.ADD_RECIPIENT; } else { - // if and address is provided and an id exists on the draft transaction, + // if an address is provided and an id exists on the draft transaction, // we progress to the EDIT stage, otherwise we progress to the DRAFT // stage. We also reset the search mode for recipient search. - state.stage = - state.draftTransaction.id === null - ? SEND_STAGES.DRAFT - : SEND_STAGES.EDIT; + state.stage = state.id === null ? SEND_STAGES.DRAFT : SEND_STAGES.EDIT; state.recipient.mode = RECIPIENT_SEARCH_MODES.CONTACT_LIST; } // validate send state slice.caseReducers.validateSendState(state); }, - updateDraftTransaction: (state) => { - // We keep a copy of txParams in state that could be submitted to the - // network if the form state is valid. - if (state.status === SEND_STATUSES.VALID) { - // We don't/shouldn't modify the from address when editing an - // existing transaction. - if (state.stage !== SEND_STAGES.EDIT) { - state.draftTransaction.txParams.from = state.account.address; - } - - // gasLimit always needs to be set regardless of the asset being sent - // or the type of transaction. - state.draftTransaction.txParams.gas = state.gas.gasLimit; - switch (state.asset.type) { - case ASSET_TYPES.TOKEN: - // When sending a token the to address is the contract address of - // the token being sent. The value is set to '0x0' and the data - // is generated from the recipient address, token being sent and - // amount. - state.draftTransaction.txParams.to = state.asset.details.address; - state.draftTransaction.txParams.value = '0x0'; - state.draftTransaction.txParams.data = generateERC20TransferData({ - toAddress: state.recipient.address, - amount: state.amount.value, - sendToken: state.asset.details, - }); - break; - case ASSET_TYPES.COLLECTIBLE: - // When sending a token the to address is the contract address of - // the token being sent. The value is set to '0x0' and the data - // is generated from the recipient address, token being sent and - // amount. - state.draftTransaction.txParams.to = state.asset.details.address; - state.draftTransaction.txParams.value = '0x0'; - state.draftTransaction.txParams.data = generateERC721TransferData({ - toAddress: state.recipient.address, - fromAddress: state.account.address, - tokenId: state.asset.details.tokenId, - }); - break; - case ASSET_TYPES.NATIVE: - default: - // When sending native currency the to and value fields use the - // recipient and amount values and the data key is either null or - // populated with the user input provided in hex field. - state.draftTransaction.txParams.to = state.recipient.address; - state.draftTransaction.txParams.value = state.amount.value; - state.draftTransaction.txParams.data = - state.draftTransaction.userInputHexData ?? undefined; - } - - // We need to make sure that we only include the right gas fee fields - // based on the type of transaction the network supports. We will also set - // the type param here. We must delete the opposite fields to avoid - // stale data in txParams. - if (state.eip1559support) { - state.draftTransaction.txParams.type = - TRANSACTION_ENVELOPE_TYPES.FEE_MARKET; - - state.draftTransaction.txParams.maxFeePerGas = state.gas.maxFeePerGas; - state.draftTransaction.txParams.maxPriorityFeePerGas = - state.gas.maxPriorityFeePerGas; - - if ( - !state.draftTransaction.txParams.maxFeePerGas || - state.draftTransaction.txParams.maxFeePerGas === '0x0' - ) { - state.draftTransaction.txParams.maxFeePerGas = state.gas.gasPrice; - } - - if ( - !state.draftTransaction.txParams.maxPriorityFeePerGas || - state.draftTransaction.txParams.maxPriorityFeePerGas === '0x0' - ) { - state.draftTransaction.txParams.maxPriorityFeePerGas = - state.draftTransaction.txParams.maxFeePerGas; - } - - delete state.draftTransaction.txParams.gasPrice; - } else { - delete state.draftTransaction.txParams.maxFeePerGas; - delete state.draftTransaction.txParams.maxPriorityFeePerGas; - - state.draftTransaction.txParams.gasPrice = state.gas.gasPrice; - state.draftTransaction.txParams.type = - TRANSACTION_ENVELOPE_TYPES.LEGACY; - } - } - }, useDefaultGas: (state) => { // Show the default gas price/limit fields in the send page state.gas.isCustomGasSet = false; @@ -1240,8 +1200,6 @@ const slice = createSlice({ break; default: state.status = SEND_STATUSES.VALID; - // Recompute the draftTransaction object - slice.caseReducers.updateDraftTransaction(state); } }, }, @@ -1793,12 +1751,8 @@ export function toggleSendMaxMode() { export function signTransaction() { return async (dispatch, getState) => { const state = getState(); - const { - asset, - stage, - draftTransaction: { id, txParams }, - eip1559support, - } = state[name]; + const { id, asset, stage, eip1559support } = state[name]; + const txParams = generateTransactionParams(state[name]); if (stage === SEND_STAGES.EDIT) { // When dealing with the edit flow there is already a transaction in // state that we must update, this branch is responsible for that logic. @@ -2052,11 +2006,11 @@ export function getSendMaxModeState(state) { } export function getSendHexData(state) { - return state[name].draftTransaction.userInputHexData; + return state[name].userInputHexData; } export function getDraftTransactionID(state) { - return state[name].draftTransaction.id; + return state[name].id; } export function sendAmountIsInError(state) { diff --git a/ui/ducks/send/send.test.js b/ui/ducks/send/send.test.js index a8466753b..75be1cd03 100644 --- a/ui/ducks/send/send.test.js +++ b/ui/ducks/send/send.test.js @@ -194,9 +194,7 @@ describe('Send Slice', () => { }; const result = sendReducer(initialState, action); - expect(result.draftTransaction.userInputHexData).toStrictEqual( - action.payload, - ); + expect(result.userInputHexData).toStrictEqual(action.payload); }); }); @@ -217,9 +215,6 @@ describe('Send Slice', () => { ); expect(result.gas.gasLimit).toStrictEqual(action.payload); - expect(result.draftTransaction.txParams.gas).toStrictEqual( - action.payload, - ); }); it('should recalculate gasTotal', () => { @@ -388,203 +383,6 @@ describe('Send Slice', () => { }); }); - describe('updateDraftTransaction', () => { - describe('with LEGACY transactions', () => { - it('should properly set fields', () => { - const detailsForDraftTransactionState = { - ...initialState, - status: SEND_STATUSES.VALID, - transactionType: TRANSACTION_ENVELOPE_TYPES.LEGACY, - account: { - address: '0xCurrentAddress', - }, - asset: { - type: '', - }, - recipient: { - address: '0xRecipientAddress', - }, - amount: { - value: '0x1', - }, - gas: { - gasPrice: '0x3b9aca00', // 1000000000 - gasLimit: '0x5208', // 21000 - }, - }; - - const action = { - type: 'send/updateDraftTransaction', - }; - - const result = sendReducer(detailsForDraftTransactionState, action); - - expect(result.draftTransaction.txParams.to).toStrictEqual( - detailsForDraftTransactionState.recipient.address, - ); - expect(result.draftTransaction.txParams.value).toStrictEqual( - detailsForDraftTransactionState.amount.value, - ); - expect(result.draftTransaction.txParams.gas).toStrictEqual( - detailsForDraftTransactionState.gas.gasLimit, - ); - expect(result.draftTransaction.txParams.gasPrice).toStrictEqual( - detailsForDraftTransactionState.gas.gasPrice, - ); - }); - - it('should update the draftTransaction txParams recipient to token address when asset is type TOKEN', () => { - const detailsForDraftTransactionState = { - ...initialState, - status: SEND_STATUSES.VALID, - transactionType: TRANSACTION_ENVELOPE_TYPES.LEGACY, - account: { - address: '0xCurrentAddress', - }, - asset: { - type: ASSET_TYPES.TOKEN, - details: { - address: '0xTokenAddress', - }, - }, - amount: { - value: '0x1', - }, - gas: { - gasPrice: '0x3b9aca00', // 1000000000 - gasLimit: '0x5208', // 21000 - }, - }; - - const action = { - type: 'send/updateDraftTransaction', - }; - - const result = sendReducer(detailsForDraftTransactionState, action); - - expect(result.draftTransaction.txParams.to).toStrictEqual( - detailsForDraftTransactionState.asset.details.address, - ); - expect(result.draftTransaction.txParams.value).toStrictEqual('0x0'); - expect(result.draftTransaction.txParams.gas).toStrictEqual( - detailsForDraftTransactionState.gas.gasLimit, - ); - expect(result.draftTransaction.txParams.gasPrice).toStrictEqual( - detailsForDraftTransactionState.gas.gasPrice, - ); - expect(result.draftTransaction.txParams.data).toStrictEqual( - '0xa9059cbb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', - ); - }); - }); - - describe('with FEE_MARKET transactions', () => { - it('should properly set fields', () => { - const detailsForDraftTransactionState = { - ...initialState, - status: SEND_STATUSES.VALID, - transactionType: TRANSACTION_ENVELOPE_TYPES.FEE_MARKET, - account: { - address: '0xCurrentAddress', - }, - asset: { - type: '', - }, - recipient: { - address: '0xRecipientAddress', - }, - amount: { - value: '0x1', - }, - gas: { - maxFeePerGas: '0x2540be400', // 10 GWEI - maxPriorityFeePerGas: '0x3b9aca00', // 1 GWEI - gasLimit: '0x5208', // 21000 - }, - eip1559support: true, - }; - - const action = { - type: 'send/updateDraftTransaction', - }; - - const result = sendReducer(detailsForDraftTransactionState, action); - - expect(result.draftTransaction.txParams.to).toStrictEqual( - detailsForDraftTransactionState.recipient.address, - ); - expect(result.draftTransaction.txParams.value).toStrictEqual( - detailsForDraftTransactionState.amount.value, - ); - expect(result.draftTransaction.txParams.gas).toStrictEqual( - detailsForDraftTransactionState.gas.gasLimit, - ); - expect(result.draftTransaction.txParams.gasPrice).toBeUndefined(); - expect(result.draftTransaction.txParams.maxFeePerGas).toStrictEqual( - detailsForDraftTransactionState.gas.maxFeePerGas, - ); - expect( - result.draftTransaction.txParams.maxPriorityFeePerGas, - ).toStrictEqual( - detailsForDraftTransactionState.gas.maxPriorityFeePerGas, - ); - }); - - it('should update the draftTransaction txParams recipient to token address when asset is type TOKEN', () => { - const detailsForDraftTransactionState = { - ...initialState, - status: SEND_STATUSES.VALID, - transactionType: TRANSACTION_ENVELOPE_TYPES.FEE_MARKET, - account: { - address: '0xCurrentAddress', - }, - asset: { - type: ASSET_TYPES.TOKEN, - details: { - address: '0xTokenAddress', - }, - }, - amount: { - value: '0x1', - }, - gas: { - maxFeePerGas: '0x2540be400', // 10 GWEI - maxPriorityFeePerGas: '0x3b9aca00', // 1 GWEI - gasLimit: '0x5208', // 21000 - }, - eip1559support: true, - }; - - const action = { - type: 'send/updateDraftTransaction', - }; - - const result = sendReducer(detailsForDraftTransactionState, action); - - expect(result.draftTransaction.txParams.to).toStrictEqual( - detailsForDraftTransactionState.asset.details.address, - ); - expect(result.draftTransaction.txParams.value).toStrictEqual('0x0'); - expect(result.draftTransaction.txParams.gas).toStrictEqual( - detailsForDraftTransactionState.gas.gasLimit, - ); - - expect(result.draftTransaction.txParams.maxFeePerGas).toStrictEqual( - detailsForDraftTransactionState.gas.maxFeePerGas, - ); - expect( - result.draftTransaction.txParams.maxPriorityFeePerGas, - ).toStrictEqual( - detailsForDraftTransactionState.gas.maxPriorityFeePerGas, - ); - expect(result.draftTransaction.txParams.gasPrice).toBeUndefined(); - expect(result.draftTransaction.txParams.data).toStrictEqual( - '0xa9059cbb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', - ); - }); - }); - }); - describe('useDefaultGas', () => { it('should', () => { const action = { @@ -1300,9 +1098,7 @@ describe('Send Slice', () => { amount: { value: '', }, - draftTransaction: { - userInputHexData: '', - }, + userInputHexData: '', }, }; const store = mockStore(sendState); @@ -1356,9 +1152,7 @@ describe('Send Slice', () => { amount: { value: '', }, - draftTransaction: { - userInputHexData: '', - }, + userInputHexData: '', }, }; @@ -1412,9 +1206,7 @@ describe('Send Slice', () => { amount: { value: '', }, - draftTransaction: { - userInputHexData: '', - }, + userInputHexData: '', }, }; @@ -1462,9 +1254,7 @@ describe('Send Slice', () => { amount: { value: '', }, - draftTransaction: { - userInputHexData: '', - }, + userInputHexData: '', }, }; @@ -1766,9 +1556,7 @@ describe('Send Slice', () => { amount: { value: '', }, - draftTransaction: { - userInputHexData: '', - }, + userInputHexData: '', }, }; @@ -1827,9 +1615,7 @@ describe('Send Slice', () => { amount: { value: '', }, - draftTransaction: { - userInputHexData: '', - }, + userInputHexData: '', }, }; @@ -1881,9 +1667,7 @@ describe('Send Slice', () => { amount: { value: '', }, - draftTransaction: { - userInputHexData: '', - }, + userInputHexData: '', }, }; @@ -1955,7 +1739,6 @@ describe('Send Slice', () => { amount: { value: '0x1', }, - draftTransaction: {}, }, }; @@ -2035,9 +1818,7 @@ describe('Send Slice', () => { mode: '', value: '', }, - draftTransaction: { - userInputHexData: '', - }, + userInputHexData: '', }, metamask: { provider: { @@ -2084,9 +1865,7 @@ describe('Send Slice', () => { mode: AMOUNT_MODES.MAX, value: '', }, - draftTransaction: { - userInputHexData: '', - }, + userInputHexData: '', }, metamask: { provider: { @@ -2121,10 +1900,12 @@ describe('Send Slice', () => { send: { asset: {}, stage: '', - draftTransaction: {}, recipient: {}, amount: {}, account: {}, + gas: { + gasLimit: GAS_LIMITS.SIMPLE, + }, }, }; @@ -2159,12 +1940,7 @@ describe('Send Slice', () => { send: { ...signTransactionState.send, stage: SEND_STAGES.EDIT, - draftTransaction: { - id: 1, - txParams: { - value: 'newTxValue', - }, - }, + id: 1, }, }; @@ -2258,19 +2034,6 @@ describe('Send Slice', () => { expect(result.gas.gasPrice).toStrictEqual(action.payload.gasPrice); expect(result.amount.value).toStrictEqual(action.payload.amount); - - expect(result.draftTransaction.txParams.to).toStrictEqual( - action.payload.address, - ); - expect(result.draftTransaction.txParams.value).toStrictEqual( - action.payload.amount, - ); - expect(result.draftTransaction.txParams.gasPrice).toStrictEqual( - action.payload.gasPrice, - ); - expect(result.draftTransaction.txParams.gas).toStrictEqual( - action.payload.gasLimit, - ); }); it('should set up the appropriate state for editing a collectible asset transaction', async () => { @@ -2314,9 +2077,8 @@ describe('Send Slice', () => { amount: { value: '', }, - draftTransaction: { - userInputHexData: '', - }, + userInputHexData: '', + recipient: { address: 'Address', nickname: 'NickName', @@ -2408,19 +2170,6 @@ describe('Send Slice', () => { expect(result.gas.gasPrice).toStrictEqual(action.payload.gasPrice); expect(result.amount.value).toStrictEqual(action.payload.amount); - - expect(result.draftTransaction.txParams.to).toStrictEqual( - action.payload.address, - ); - expect(result.draftTransaction.txParams.value).toStrictEqual( - action.payload.amount, - ); - expect(result.draftTransaction.txParams.gasPrice).toStrictEqual( - action.payload.gasPrice, - ); - expect(result.draftTransaction.txParams.gas).toStrictEqual( - action.payload.gasLimit, - ); }); }); @@ -2465,9 +2214,7 @@ describe('Send Slice', () => { amount: { value: '', }, - draftTransaction: { - userInputHexData: '', - }, + userInputHexData: '', recipient: { address: 'Address', nickname: 'NickName', @@ -2562,19 +2309,6 @@ describe('Send Slice', () => { expect(result.gas.gasPrice).toStrictEqual(action.payload.gasPrice); expect(result.amount.value).toStrictEqual(action.payload.amount); - - expect(result.draftTransaction.txParams.to).toStrictEqual( - action.payload.address, - ); - expect(result.draftTransaction.txParams.value).toStrictEqual( - action.payload.amount, - ); - expect(result.draftTransaction.txParams.gasPrice).toStrictEqual( - action.payload.gasPrice, - ); - expect(result.draftTransaction.txParams.gas).toStrictEqual( - action.payload.gasLimit, - ); }); }); @@ -2774,10 +2508,7 @@ describe('Send Slice', () => { getDraftTransactionID({ send: { ...initialState, - draftTransaction: { - ...initialState.draftTransaction, - id: 'ID', - }, + id: 'ID', }, }), ).toBe('ID'); @@ -2789,10 +2520,7 @@ describe('Send Slice', () => { getSendHexData({ send: { ...initialState, - draftTransaction: { - ...initialState.draftTransaction, - userInputHexData: '0x0', - }, + userInputHexData: '0x0', }, }), ).toBe('0x0'); From 70bdd9729fe7345b4dd36e3bd4ce00dc720054c4 Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Wed, 25 May 2022 10:13:15 -0500 Subject: [PATCH 073/127] Enables the "Safe Transaction From" copy for safeTransferFrom transactions (#14769) * useTransactionDisplayData:support safetransferfrom * useTransactionDisplayData: update test --- ui/hooks/useTransactionDisplayData.js | 8 ++++++-- ui/hooks/useTransactionDisplayData.test.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/hooks/useTransactionDisplayData.js b/ui/hooks/useTransactionDisplayData.js index ee47225c8..d623d7e75 100644 --- a/ui/hooks/useTransactionDisplayData.js +++ b/ui/hooks/useTransactionDisplayData.js @@ -238,8 +238,7 @@ export function useTransactionDisplayData(transactionGroup) { subtitle = t('fromAddress', [shortenAddress(senderAddress)]); } else if ( type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM || - type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER || - type === TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM + type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER ) { category = TRANSACTION_GROUP_CATEGORIES.SEND; title = t('sendSpecifiedTokens', [ @@ -247,6 +246,11 @@ export function useTransactionDisplayData(transactionGroup) { ]); recipientAddress = getTokenAddressParam(tokenData); subtitle = t('toAddress', [shortenAddress(recipientAddress)]); + } else if (type === TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM) { + category = TRANSACTION_GROUP_CATEGORIES.SEND; + title = t('safeTransferFrom'); + recipientAddress = getTokenAddressParam(tokenData); + subtitle = t('toAddress', [shortenAddress(recipientAddress)]); } else if (type === TRANSACTION_TYPES.SIMPLE_SEND) { category = TRANSACTION_GROUP_CATEGORIES.SEND; title = t('send'); diff --git a/ui/hooks/useTransactionDisplayData.test.js b/ui/hooks/useTransactionDisplayData.test.js index 29e4d43d2..b30ea254d 100644 --- a/ui/hooks/useTransactionDisplayData.test.js +++ b/ui/hooks/useTransactionDisplayData.test.js @@ -131,7 +131,7 @@ const expectedResults = [ displayedStatusKey: TRANSACTION_STATUSES.CONFIRMED, }, { - title: 'Send Token', + title: 'Safe Transfer From', category: TRANSACTION_GROUP_CATEGORIES.SEND, subtitle: 'To: 0xe7d...dd98', subtitleContainsOrigin: true, From 8fcbebc546de1111282893bab2f1a6c5479b940f Mon Sep 17 00:00:00 2001 From: George Marshall Date: Wed, 25 May 2022 08:35:36 -0700 Subject: [PATCH 074/127] Update design tokens library from 1.5 to 1.6 WIP (#14732) * Updating account menu icon color * Updating design-tokens and making appropriate updates to extension styles * Adding more deprecated tags to colors * Adding spinner and removing todo comment * Remove comment * Updates * Updating snapshots * More color and ui updates * reverting transition change --- .storybook/3.COLORS.stories.mdx | 29 ++++++------ package.json | 2 +- .../account-menu/account-menu.component.js | 10 ++-- ui/components/app/account-menu/index.scss | 1 + .../app/advanced-gas-controls/index.scss | 2 +- .../advanced-gas-fee-input-subtext.js | 2 +- .../collectible-details.js | 2 +- .../confirm-detail-row.stories.js | 47 +++++++++++++++++++ .../confirm-detail-row/index.scss | 4 +- .../connected-accounts-list.stories.js | 38 +++++++++++++++ ui/components/app/edit-gas-display/index.scss | 4 +- .../edit-gas-item/index.scss | 2 +- .../edit-gas-tooltip/index.scss | 2 +- .../advanced-gas-inputs/index.scss | 4 +- ui/components/app/gas-details-item/index.scss | 2 +- ui/components/app/gas-timing/index.scss | 2 +- .../modals/qr-scanner/qr-scanner.component.js | 2 +- .../index.scss | 2 +- .../qr-hardware-popover/enhanced-reader.js | 2 +- .../selected-account.component.js | 2 +- ui/components/app/tab-bar/index.scss | 1 + ui/components/app/token-cell/token-cell.js | 2 +- .../transaction-activity-log-icon.stories.js | 3 ++ .../transaction-decoding.component.js | 2 +- .../app/transaction-detail-item/index.scss | 2 +- .../app/transaction-status/index.scss | 2 +- ui/components/app/wallet-overview/index.scss | 2 +- .../ui/form-field/form-field.stories.js | 2 +- ui/components/ui/form-field/index.scss | 4 +- .../icon-with-fallback.scss | 2 +- ui/components/ui/icon/icon.stories.js | 3 +- ui/components/ui/info-tooltip/info-tooltip.js | 2 +- .../loading-screen.component.js | 2 +- ui/components/ui/menu/menu.scss | 2 +- .../ui/metafox-logo/horizontal-logo.js | 2 +- .../ui/sender-to-recipient/index.scss | 2 +- ui/components/ui/spinner/spinner.stories.js | 26 ++++++++++ ui/css/itcss/components/send.scss | 14 +----- ui/css/utilities/colors.scss | 2 +- .../connect-hardware/index.scss | 2 +- .../metametrics-opt-in/index.scss | 4 -- ui/pages/permissions-connect/index.scss | 4 +- ui/pages/send/send.scss | 2 +- ui/pages/settings/alerts-tab/alerts-tab.js | 2 +- ui/pages/settings/alerts-tab/alerts-tab.scss | 4 ++ ui/pages/settings/contact-list-tab/index.scss | 1 + ui/pages/settings/index.scss | 4 +- .../custom-content-search.js | 2 +- ui/pages/settings/networks-tab/index.scss | 7 +-- .../networks-list/networks-list.js | 2 +- .../settings/networks-tab/networks-tab.js | 2 +- .../exchange-rate-display.test.js.snap | 2 +- .../exchange-rate-display.js | 2 +- .../swaps/select-quote-popover/index.scss | 2 +- yarn.lock | 8 ++-- 55 files changed, 199 insertions(+), 89 deletions(-) create mode 100644 ui/components/app/confirm-page-container/confirm-detail-row/confirm-detail-row.stories.js create mode 100644 ui/components/app/connected-accounts-list/connected-accounts-list.stories.js create mode 100644 ui/components/ui/spinner/spinner.stories.js diff --git a/.storybook/3.COLORS.stories.mdx b/.storybook/3.COLORS.stories.mdx index b694a721a..507fade1c 100644 --- a/.storybook/3.COLORS.stories.mdx +++ b/.storybook/3.COLORS.stories.mdx @@ -67,6 +67,7 @@ var(--color-text-muted) /** Icons */ var(--color-icon-default) +var(--color-icon-alternative) var(--color-icon-muted) /** Borders */ @@ -75,20 +76,20 @@ var(--color-border-muted) /** Overlays */ var(--color-overlay-default) -var(--color-overlay-inverse) +var(--color-overlay-inverse) [DEPRECATED] /** User Actions */ var(--color-primary-default) var(--color-primary-alternative) var(--color-primary-muted) var(--color-primary-inverse) -var(--color-primary-disabled) +var(--color-primary-disabled) [DEPRECATED] -var(--color-secondary-default) -var(--color-secondary-alternative) -var(--color-secondary-muted) -var(--color-secondary-inverse) -var(--color-secondary-disabled) +var(--color-secondary-default) [DEPRECATED] +var(--color-secondary-alternative) [DEPRECATED] +var(--color-secondary-muted) [DEPRECATED] +var(--color-secondary-inverse) [DEPRECATED] +var(--color-secondary-disabled) [DEPRECATED] /** States */ /** Error */ @@ -96,28 +97,28 @@ var(--color-error-default) var(--color-error-alternative) var(--color-error-muted) var(--color-error-inverse) -var(--color-error-disabled) +var(--color-error-disabled) [DEPRECATED] /** Warning */ var(--color-warning-default) -var(--color-warning-alternative) +var(--color-warning-alternative) [DEPRECATED] var(--color-warning-muted) var(--color-warning-inverse) -var(--color-warning-disabled) +var(--color-warning-disabled) [DEPRECATED] /** Success */ var(--color-success-default) -var(--color-success-alternative) +var(--color-success-alternative) [DEPRECATED] var(--color-success-muted) var(--color-success-inverse) -var(--color-success-disabled) +var(--color-success-disabled) [DEPRECATED] /** Info */ var(--color-info-default) -var(--color-info-alternative) +var(--color-info-alternative) [DEPRECATED] var(--color-info-muted) var(--color-info-inverse) -var(--color-info-disabled) +var(--color-info-disabled) [DEPRECATED] ``` ### **Component colors** (tier 3) diff --git a/package.json b/package.json index e81be4b54..3f0e83e48 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "@material-ui/core": "^4.11.0", "@metamask/contract-metadata": "^1.31.0", "@metamask/controllers": "^29.0.1", - "@metamask/design-tokens": "^1.5.1", + "@metamask/design-tokens": "^1.6.5", "@metamask/eth-ledger-bridge-keyring": "^0.12.0", "@metamask/eth-token-tracker": "^4.0.0", "@metamask/etherscan-link": "^2.1.0", diff --git a/ui/components/app/account-menu/account-menu.component.js b/ui/components/app/account-menu/account-menu.component.js index eaa8e32e7..85cf0bf6c 100644 --- a/ui/components/app/account-menu/account-menu.component.js +++ b/ui/components/app/account-menu/account-menu.component.js @@ -350,7 +350,7 @@ export default class AccountMenu extends Component { }); history.push(NEW_ACCOUNT_ROUTE); }} - icon={} + icon={} text={t('createAccount')} /> } @@ -393,7 +393,7 @@ export default class AccountMenu extends Component { }} icon={ } @@ -406,7 +406,7 @@ export default class AccountMenu extends Component { }} icon={ } @@ -428,7 +428,7 @@ export default class AccountMenu extends Component { }} icon={ } diff --git a/ui/components/app/account-menu/index.scss b/ui/components/app/account-menu/index.scss index b5bb8846d..bbc5a6fec 100644 --- a/ui/components/app/account-menu/index.scss +++ b/ui/components/app/account-menu/index.scss @@ -136,6 +136,7 @@ margin-top: 5px; margin-right: 10px; background-color: var(--color-background-alternative); + border: 1px solid var(--color-border-default); color: var(--color-text-default); font-weight: normal; letter-spacing: 0.5px; diff --git a/ui/components/app/advanced-gas-controls/index.scss b/ui/components/app/advanced-gas-controls/index.scss index e7b41ba31..48e0d8707 100644 --- a/ui/components/app/advanced-gas-controls/index.scss +++ b/ui/components/app/advanced-gas-controls/index.scss @@ -21,6 +21,6 @@ } path { - fill: var(--color-icon-muted); + fill: var(--color-icon-alternative); } } diff --git a/ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-input-subtext/advanced-gas-fee-input-subtext.js b/ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-input-subtext/advanced-gas-fee-input-subtext.js index ddc0fd1ad..9aba43ec0 100644 --- a/ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-input-subtext/advanced-gas-fee-input-subtext.js +++ b/ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-input-subtext/advanced-gas-fee-input-subtext.js @@ -25,7 +25,7 @@ function determineTrendInfo(trend, t) { case 'level': return { className: 'fa-arrow-right advanced-gas-fee-input-subtext__level', - color: 'var(--color-icon-default)', + color: 'var(--color-icon-alternative)', title: t('levelArrow'), }; default: diff --git a/ui/components/app/collectible-details/collectible-details.js b/ui/components/app/collectible-details/collectible-details.js index 4e7c433d4..5c8bf8e3a 100644 --- a/ui/components/app/collectible-details/collectible-details.js +++ b/ui/components/app/collectible-details/collectible-details.js @@ -311,7 +311,7 @@ export default function CollectibleDetails({ collectible }) { {copied ? ( t('copiedExclamation') ) : ( - + )} diff --git a/ui/components/app/confirm-page-container/confirm-detail-row/confirm-detail-row.stories.js b/ui/components/app/confirm-page-container/confirm-detail-row/confirm-detail-row.stories.js new file mode 100644 index 000000000..929082c4d --- /dev/null +++ b/ui/components/app/confirm-page-container/confirm-detail-row/confirm-detail-row.stories.js @@ -0,0 +1,47 @@ +import React from 'react'; +import ConfirmDetailRow from '.'; + +export default { + title: 'Components/App/ConfirmPageContainer/ConfirmDetailRow', + id: __filename, + argTypes: { + headerText: { + control: 'text', + }, + headerTextClassName: { + control: 'text', + }, + label: { + control: 'text', + }, + onHeaderClick: { + control: 'text', + }, + primaryValueTextColor: { + control: 'text', + }, + primaryText: { + control: 'text', + }, + secondaryText: { + control: 'text', + }, + value: { + control: 'text', + }, + }, + args: { + headerText: 'headerText', + headerTextClassName: 'headerTextClassName', + label: 'label', + onHeaderClick: 'onHeaderClick', + primaryValueTextColor: 'primaryValueTextColor', + primaryText: 'primaryText', + secondaryText: 'secondaryText', + value: 'value', + }, +}; + +export const DefaultStory = (args) => ; + +DefaultStory.storyName = 'Default'; diff --git a/ui/components/app/confirm-page-container/confirm-detail-row/index.scss b/ui/components/app/confirm-page-container/confirm-detail-row/index.scss index 25a7d8fe1..cfb382f83 100644 --- a/ui/components/app/confirm-page-container/confirm-detail-row/index.scss +++ b/ui/components/app/confirm-page-container/confirm-detail-row/index.scss @@ -26,7 +26,7 @@ } &__secondary { - color: var(--color-icon-default); + color: var(--color-text-alternative); justify-content: flex-end; } @@ -35,7 +35,7 @@ text-transform: uppercase; margin-bottom: 6px; - color: var(--color-icon-default); + color: var(--color-text-default); &--edit { color: var(--color-primary-default); diff --git a/ui/components/app/connected-accounts-list/connected-accounts-list.stories.js b/ui/components/app/connected-accounts-list/connected-accounts-list.stories.js new file mode 100644 index 000000000..48f79b19e --- /dev/null +++ b/ui/components/app/connected-accounts-list/connected-accounts-list.stories.js @@ -0,0 +1,38 @@ +import React from 'react'; +import ConnectedAccountsList from '.'; + +export default { + title: 'Components/App/ConnectedAccountsList', + id: __filename, + argTypes: { + connectedAccounts: { + control: 'array', + }, + selectedAddress: { + control: 'text', + }, + shouldRenderListOptions: { + control: 'boolean', + }, + }, + args: { + connectedAccounts: [ + { + name: 'This is a Really Long Account Name', + address: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4', + index: 0, + balance: '0x176e5b6f173ebe66', + }, + { + name: 'Account 2', + address: '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e', + index: 1, + balance: '0x2d3142f5000', + }, + ], + }, +}; + +export const DefaultStory = (args) => ; + +DefaultStory.storyName = 'Default'; diff --git a/ui/components/app/edit-gas-display/index.scss b/ui/components/app/edit-gas-display/index.scss index 3af1e402c..ee0e13145 100644 --- a/ui/components/app/edit-gas-display/index.scss +++ b/ui/components/app/edit-gas-display/index.scss @@ -28,8 +28,8 @@ button.edit-gas-display__dapp-acknowledgement-button { margin: 40px auto 0 auto; display: block; - color: var(--color-secondary-default); - border: 1px solid var(--color-secondary-default); + color: var(--color-warning-default); + border: 1px solid var(--color-warning-default); text-transform: unset; width: auto; background: transparent; diff --git a/ui/components/app/edit-gas-fee-popover/edit-gas-item/index.scss b/ui/components/app/edit-gas-fee-popover/edit-gas-item/index.scss index ed6fd0035..8e8e2607a 100644 --- a/ui/components/app/edit-gas-fee-popover/edit-gas-item/index.scss +++ b/ui/components/app/edit-gas-fee-popover/edit-gas-item/index.scss @@ -78,7 +78,7 @@ &__time-estimate-low, &__fee-estimate-high { - color: var(--color-secondary-default); + color: var(--color-warning-default); } &__time-estimate-medium, diff --git a/ui/components/app/edit-gas-fee-popover/edit-gas-tooltip/index.scss b/ui/components/app/edit-gas-fee-popover/edit-gas-tooltip/index.scss index 92d067dec..0e354d33e 100644 --- a/ui/components/app/edit-gas-fee-popover/edit-gas-tooltip/index.scss +++ b/ui/components/app/edit-gas-fee-popover/edit-gas-tooltip/index.scss @@ -17,7 +17,7 @@ } &__dialog { - background-color: var(--color-secondary-default); + background-color: var(--color-warning-default); border-radius: 30px; margin: 4px 0; text-align: center; diff --git a/ui/components/app/gas-customization/advanced-gas-inputs/index.scss b/ui/components/app/gas-customization/advanced-gas-inputs/index.scss index a389efc65..177078d9a 100644 --- a/ui/components/app/gas-customization/advanced-gas-inputs/index.scss +++ b/ui/components/app/gas-customization/advanced-gas-inputs/index.scss @@ -23,7 +23,7 @@ } .fa-info-circle { - color: var(--color-icon-default); + color: var(--color-icon-alternative); cursor: pointer; } @@ -41,7 +41,7 @@ &__warning-text { @include H7; - color: var(--color-secondary-default); + color: var(--color-warning-default); } &__input-wrapper { diff --git a/ui/components/app/gas-details-item/index.scss b/ui/components/app/gas-details-item/index.scss index 43b2da44b..c73c6f421 100644 --- a/ui/components/app/gas-details-item/index.scss +++ b/ui/components/app/gas-details-item/index.scss @@ -1,6 +1,6 @@ .gas-details-item { &__gas-fee-warning { - color: var(--color-secondary-default); //@TODO: revisit when warning color tokens are revisited + color: var(--color-warning-default); } &__currency-container, diff --git a/ui/components/app/gas-timing/index.scss b/ui/components/app/gas-timing/index.scss index ca8d1e989..00d6c024d 100644 --- a/ui/components/app/gas-timing/index.scss +++ b/ui/components/app/gas-timing/index.scss @@ -20,7 +20,7 @@ } &--negative-V2 { - color: var(--color-secondary-default); + color: var(--color-warning-default); font-weight: bold; } diff --git a/ui/components/app/modals/qr-scanner/qr-scanner.component.js b/ui/components/app/modals/qr-scanner/qr-scanner.component.js index 68cd8444f..a3fd43501 100644 --- a/ui/components/app/modals/qr-scanner/qr-scanner.component.js +++ b/ui/components/app/modals/qr-scanner/qr-scanner.component.js @@ -251,7 +251,7 @@ export default class QrScanner extends Component { }} /> {ready === READY_STATE.READY ? null : ( - + )}
    diff --git a/ui/components/app/permissions-connect-permission-list/index.scss b/ui/components/app/permissions-connect-permission-list/index.scss index cb2b462db..8dfc4cb6b 100644 --- a/ui/components/app/permissions-connect-permission-list/index.scss +++ b/ui/components/app/permissions-connect-permission-list/index.scss @@ -17,7 +17,7 @@ padding: 16px; min-width: 16px; min-height: 16px; - color: var(--color-icon-default); + color: var(--color-icon-alternative); font-size: 1rem; } } diff --git a/ui/components/app/qr-hardware-popover/enhanced-reader.js b/ui/components/app/qr-hardware-popover/enhanced-reader.js index ae753145e..18ae2f931 100644 --- a/ui/components/app/qr-hardware-popover/enhanced-reader.js +++ b/ui/components/app/qr-hardware-popover/enhanced-reader.js @@ -55,7 +55,7 @@ const EnhancedReader = ({ handleScan }) => { filter: 'blur(4px)', }} /> - {canplay ? null : } + {canplay ? null : }
    ); }; diff --git a/ui/components/app/selected-account/selected-account.component.js b/ui/components/app/selected-account/selected-account.component.js index 1dc3c135f..06609b54f 100644 --- a/ui/components/app/selected-account/selected-account.component.js +++ b/ui/components/app/selected-account/selected-account.component.js @@ -63,7 +63,7 @@ class SelectedAccount extends Component {
    {shortenAddress(checksummedAddress)}
    - +
    diff --git a/ui/components/app/tab-bar/index.scss b/ui/components/app/tab-bar/index.scss index 4329b5b5c..793230b62 100644 --- a/ui/components/app/tab-bar/index.scss +++ b/ui/components/app/tab-bar/index.scss @@ -68,6 +68,7 @@ justify-content: center; margin-inline-end: 16px; flex: 0 0 18px; + color: var(--color-icon-alternative); @media screen and (min-width: $break-large) { flex: 0 0 14px; diff --git a/ui/components/app/token-cell/token-cell.js b/ui/components/app/token-cell/token-cell.js index 932976977..5a771b0b5 100644 --- a/ui/components/app/token-cell/token-cell.js +++ b/ui/components/app/token-cell/token-cell.js @@ -29,7 +29,7 @@ export default function TokenCell({ rel="noopener noreferrer" target="_blank" onClick={(event) => event.stopPropagation()} - style={{ color: 'var(--color-secondary-default)' }} + style={{ color: 'var(--color-warning-default)' }} > {t('here')} diff --git a/ui/components/app/transaction-activity-log/transaction-activity-log-icon/transaction-activity-log-icon.stories.js b/ui/components/app/transaction-activity-log/transaction-activity-log-icon/transaction-activity-log-icon.stories.js index 94bda3be5..0436f28d1 100644 --- a/ui/components/app/transaction-activity-log/transaction-activity-log-icon/transaction-activity-log-icon.stories.js +++ b/ui/components/app/transaction-activity-log/transaction-activity-log-icon/transaction-activity-log-icon.stories.js @@ -14,6 +14,9 @@ export default { options: Object.keys(imageHash), }, }, + args: { + eventKey: Object.keys(imageHash)[0], + }, }; export const DefaultStory = (args) => ; diff --git a/ui/components/app/transaction-decoding/transaction-decoding.component.js b/ui/components/app/transaction-decoding/transaction-decoding.component.js index 00b858d4f..b04726910 100644 --- a/ui/components/app/transaction-decoding/transaction-decoding.component.js +++ b/ui/components/app/transaction-decoding/transaction-decoding.component.js @@ -202,7 +202,7 @@ export default function TransactionDecoding({ to = '', inputData: data = '' }) { if (loading) { return (
    - +
    ); } diff --git a/ui/components/app/transaction-detail-item/index.scss b/ui/components/app/transaction-detail-item/index.scss index c7a39c250..a51cae46d 100644 --- a/ui/components/app/transaction-detail-item/index.scss +++ b/ui/components/app/transaction-detail-item/index.scss @@ -34,7 +34,7 @@ margin-inline-start: 4px; path { - fill: var(--color-icon-default); + fill: var(--color-icon-alternative); } } diff --git a/ui/components/app/transaction-status/index.scss b/ui/components/app/transaction-status/index.scss index 55c22472c..6212c0849 100644 --- a/ui/components/app/transaction-status/index.scss +++ b/ui/components/app/transaction-status/index.scss @@ -14,7 +14,7 @@ &--unapproved, &--pending { - color: var(--color-secondary-default); + color: var(--color-warning-default); } &--queued { diff --git a/ui/components/app/wallet-overview/index.scss b/ui/components/app/wallet-overview/index.scss index e408604d9..16526b518 100644 --- a/ui/components/app/wallet-overview/index.scss +++ b/ui/components/app/wallet-overview/index.scss @@ -67,7 +67,7 @@ &__cached-balance, &__cached-star { - color: var(--color-secondary-default); + color: var(--color-warning-default); } &__cached-secondary-balance { diff --git a/ui/components/ui/form-field/form-field.stories.js b/ui/components/ui/form-field/form-field.stories.js index 0c7d0c36f..230ea0036 100644 --- a/ui/components/ui/form-field/form-field.stories.js +++ b/ui/components/ui/form-field/form-field.stories.js @@ -57,7 +57,7 @@ export const FormFieldWithTitleDetail = (args) => { , + ])} +

    + + + ); +} + +export default function Notifications() { + const history = useHistory(); + const dispatch = useDispatch(); + const t = useI18nContext(); + const notifications = useSelector(getNotifications); + const snapsRouteObject = useSelector(getSnapsRouteObjects); + const unreadNotifications = useSelector(getUnreadNotifications); + + const markAllAsRead = () => { + const unreadNotificationIds = unreadNotifications.map(({ id }) => id); + + dispatch(markNotificationsAsRead(unreadNotificationIds)); + }; + + const markAsRead = (notificationToMark) => { + if (!notificationToMark.readDate) { + dispatch(markNotificationsAsRead([notificationToMark.id])); + } + }; + + useEffect(() => { + return () => dispatch(deleteExpiredNotifications()); + }, [dispatch]); + + return ( +
    +
    +
    + history.push(DEFAULT_ROUTE)} + /> +
    + {t('notificationsHeader')} +
    +
    + +
    +
    + {notifications.length > 0 ? ( + notifications.map((notification, id) => ( + + )) + ) : ( +
    + {t('notificationsEmptyText')} +
    + )} +
    +
    + ); +} + +NotificationItem.propTypes = { + notification: { + id: PropTypes.string.isRequired, + message: PropTypes.string.isRequired, + origin: PropTypes.string.isRequired, + createdDate: PropTypes.number.isRequired, + readDate: PropTypes.number.isRequired, + }, + snaps: PropTypes.array.isRequired, + onItemClick: PropTypes.func.isRequired, +}; diff --git a/ui/pages/pages.scss b/ui/pages/pages.scss index a2a6c56c2..d6160c24f 100644 --- a/ui/pages/pages.scss +++ b/ui/pages/pages.scss @@ -24,3 +24,4 @@ @import 'token-details/index'; @import 'unlock-page/index'; @import 'onboarding-flow/index'; +@import 'notifications/index'; diff --git a/ui/pages/routes/routes.component.js b/ui/pages/routes/routes.component.js index 851111fa7..a4d3d8c5a 100644 --- a/ui/pages/routes/routes.component.js +++ b/ui/pages/routes/routes.component.js @@ -34,6 +34,9 @@ import Alerts from '../../components/app/alerts'; import Asset from '../asset'; import OnboardingAppHeader from '../onboarding-flow/onboarding-app-header/onboarding-app-header'; import TokenDetailsPage from '../token-details'; +///: BEGIN:ONLY_INCLUDE_IN(flask) +import Notifications from '../notifications'; +///: END:ONLY_INCLUDE_IN import { IMPORT_TOKEN_ROUTE, @@ -59,6 +62,9 @@ import { ONBOARDING_ROUTE, ADD_COLLECTIBLE_ROUTE, TOKEN_DETAILS, + ///: BEGIN:ONLY_INCLUDE_IN(flask) + NOTIFICATIONS_ROUTE, + ///: END:ONLY_INCLUDE_IN } from '../../helpers/constants/routes'; import { @@ -175,6 +181,11 @@ export default class Routes extends Component { exact /> + { + ///: BEGIN:ONLY_INCLUDE_IN(flask) + + ///: END:ONLY_INCLUDE_IN + } { return Object.values(snaps).map((snap) => { return { + id: snap.id, tabMessage: () => snap.manifest.proposedName, descriptionMessage: () => snap.manifest.description, sectionMessage: () => snap.manifest.description, @@ -749,6 +750,50 @@ export const getSnapsRouteObjects = createSelector(getSnaps, (snaps) => { }; }); }); + +/** + * @typedef {Object} Notification + * @property {string} id - A unique identifier for the notification + * @property {string} origin - A string identifing the snap origin + * @property {EpochTimeStamp} createdDate - A date in epochTimeStramps, identifying when the notification was first committed + * @property {EpochTimeStamp} readDate - A date in epochTimeStramps, identifying when the notification was read by the user + * @property {string} message - A string containing the notification message + */ + +/** + * Notifications are managed by the notification controller and referenced by + * `state.metamask.notifications`. This function returns a list of notifications + * the can be shown to the user. + * + * The returned notifications are sorted by date. + * + * @param {Object} state - the redux state object + * @returns {Notification[]} An array of notifications that can be shown to the user + */ + +export function getNotifications(state) { + const notifications = Object.values(state.metamask.notifications); + + const notificationsSortedByDate = notifications.sort( + (a, b) => new Date(b.createdDate) - new Date(a.createdDate), + ); + return notificationsSortedByDate; +} + +export function getUnreadNotifications(state) { + const notifications = getNotifications(state); + + const unreadNotificationCount = notifications.filter( + (notification) => notification.readDate === null, + ); + + return unreadNotificationCount; +} + +export const getUnreadNotificationsCount = createSelector( + getUnreadNotifications, + (notifications) => notifications.length, +); ///: END:ONLY_INCLUDE_IN /** @@ -781,8 +826,8 @@ function getAllowedAnnouncementIds(state) { } /** - * @typedef {Object} Notification - * @property {number} id - A unique identifier for the notification + * @typedef {Object} Announcement + * @property {number} id - A unique identifier for the announcement * @property {string} date - A date in YYYY-MM-DD format, identifying when the notification was first committed */ diff --git a/ui/selectors/selectors.test.js b/ui/selectors/selectors.test.js index ca3f9c92f..385bd2a56 100644 --- a/ui/selectors/selectors.test.js +++ b/ui/selectors/selectors.test.js @@ -244,4 +244,27 @@ describe('Selectors', () => { const appIsLoading = selectors.getAppIsLoading(mockState); expect(appIsLoading).toStrictEqual(false); }); + it('#getNotifications', () => { + const notifications = selectors.getNotifications(mockState); + + expect(notifications).toStrictEqual([ + mockState.metamask.notifications.test, + mockState.metamask.notifications.test2, + ]); + }); + it('#getUnreadNotificationsCount', () => { + const unreadNotificationCount = selectors.getUnreadNotificationsCount( + mockState, + ); + + expect(unreadNotificationCount).toStrictEqual(1); + }); + + it('#getUnreadNotifications', () => { + const unreadNotifications = selectors.getUnreadNotifications(mockState); + + expect(unreadNotifications).toStrictEqual([ + mockState.metamask.notifications.test, + ]); + }); }); diff --git a/ui/store/actions.js b/ui/store/actions.js index 95243f081..b8f738882 100644 --- a/ui/store/actions.js +++ b/ui/store/actions.js @@ -23,6 +23,9 @@ import { getMetaMaskAccounts, getPermittedAccountsForCurrentTab, getSelectedAddress, + ///: BEGIN:ONLY_INCLUDE_IN(flask) + getNotifications, + ///: END:ONLY_INCLUDE_IN } from '../selectors'; import { computeEstimatedGasLimit, resetSendState } from '../ducks/send'; import { switchedToUnconnectedAccount } from '../ducks/alerts/unconnected-account'; @@ -36,6 +39,9 @@ import { import { EVENT } from '../../shared/constants/metametrics'; import { parseSmartTransactionsError } from '../pages/swaps/swaps.util'; import { isEqualCaseInsensitive } from '../../shared/modules/string-utils'; +///: BEGIN:ONLY_INCLUDE_IN(flask) +import { NOTIFICATIONS_EXPIRATION_DELAY } from '../helpers/constants/notifications'; +///: END:ONLY_INCLUDE_IN import * as actionConstants from './actionConstants'; let background = null; @@ -1002,6 +1008,44 @@ export function removeSnap(snapId) { export async function removeSnapError(msgData) { return promisifiedBackground.removeSnapError(msgData); } + +export function dismissNotifications(ids) { + return async (dispatch) => { + await promisifiedBackground.dismissNotifications(ids); + await forceUpdateMetamaskState(dispatch); + }; +} + +export function deleteExpiredNotifications() { + return async (dispatch, getState) => { + const state = getState(); + const notifications = getNotifications(state); + + const notificationIdsToDelete = notifications + .filter((notification) => { + const expirationTime = new Date( + Date.now() - NOTIFICATIONS_EXPIRATION_DELAY, + ); + + return Boolean( + notification.readDate && + new Date(notification.readDate) < expirationTime, + ); + }) + .map(({ id }) => id); + if (notificationIdsToDelete.length) { + await promisifiedBackground.dismissNotifications(notificationIdsToDelete); + await forceUpdateMetamaskState(dispatch); + } + }; +} + +export function markNotificationsAsRead(ids) { + return async (dispatch) => { + await promisifiedBackground.markNotificationsAsRead(ids); + await forceUpdateMetamaskState(dispatch); + }; +} ///: END:ONLY_INCLUDE_IN export function cancelMsg(msgData) { From efdc3149aa9c66438a3521e93a6e2def58824055 Mon Sep 17 00:00:00 2001 From: Soralit Date: Thu, 2 Jun 2022 01:32:24 +0800 Subject: [PATCH 088/127] fix: keystone transaction qrcode has no white spacing (#14798) --- ui/css/utilities/colors.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/css/utilities/colors.scss b/ui/css/utilities/colors.scss index d55e06f08..21f7c4431 100644 --- a/ui/css/utilities/colors.scss +++ b/ui/css/utilities/colors.scss @@ -11,5 +11,5 @@ // DO NOT CHANGE // Required for the QR reader to work properly - --qr-code-white-background: '#fff'; + --qr-code-white-background: #fff; } From 1b23ea13526a218a27f703a363659e8d38e9d6f1 Mon Sep 17 00:00:00 2001 From: hilvmason <95925065+hilvmason@users.noreply.github.com> Date: Wed, 1 Jun 2022 15:10:40 -0400 Subject: [PATCH 089/127] Update PULL_REQUEST_TEMPLATE.md (#14790) --- .github/PULL_REQUEST_TEMPLATE.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f15418ea6..6df4c6e65 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -49,8 +49,11 @@ How should reviewers and QA manually test your changes? For instance: ## Pre-Merge Checklist - [ ] PR template is filled out -- [ ] Manual testing complete & passed - [ ] **IF** this PR fixes a bug, a test that _would have_ caught the bug has been added - [ ] PR is linked to the appropriate GitHub issue -- [ ] **IF** QA attention is required, "QA Board" label has been applied - [ ] PR has been added to the appropriate release Milestone + +### + If there are functional changes: + +- [ ] Manual testing complete & passed +- [ ] "Extension QA Board" label has been applied From 239f5f7fa60a05f3b98eb00a9bbb7d27ee48eed1 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Thu, 2 Jun 2022 11:38:39 +0200 Subject: [PATCH 090/127] Include snap version in pill (#14803) * Include snap version in pill * snaps authorship styling * styling * Fix linting * Fix linting Co-authored-by: eriknson --- .../flask/snaps-authorship-pill/index.scss | 15 +++++++++- .../snaps-authorship-pill.js | 29 ++++++++++++++++++- .../permissions-connect-header.component.js | 29 ++----------------- .../flask/snap-install/index.scss | 4 --- 4 files changed, 44 insertions(+), 33 deletions(-) diff --git a/ui/components/app/flask/snaps-authorship-pill/index.scss b/ui/components/app/flask/snaps-authorship-pill/index.scss index a67d876d7..90f4fa21b 100644 --- a/ui/components/app/flask/snaps-authorship-pill/index.scss +++ b/ui/components/app/flask/snaps-authorship-pill/index.scss @@ -3,6 +3,10 @@ .snaps-authorship-pill { display: inline-block; + .chip { + padding-right: 8px; + } + &:hover, &:focus { .chip { @@ -12,5 +16,14 @@ } .snaps-authorship-icon { - color: var(--color-icon-default); + color: var(--color-icon-alternative); +} + +.snaps-authorship-version { + border-radius: 100px; + line-height: 100%; +} + +.snaps-authorship-version > span { + vertical-align: middle; } diff --git a/ui/components/app/flask/snaps-authorship-pill/snaps-authorship-pill.js b/ui/components/app/flask/snaps-authorship-pill/snaps-authorship-pill.js index 86f040025..81eb07e1b 100644 --- a/ui/components/app/flask/snaps-authorship-pill/snaps-authorship-pill.js +++ b/ui/components/app/flask/snaps-authorship-pill/snaps-authorship-pill.js @@ -7,11 +7,13 @@ import Typography from '../../../ui/typography'; import { COLORS, TYPOGRAPHY, + TEXT_ALIGN, } from '../../../../helpers/constants/design-system'; +import { useI18nContext } from '../../../../hooks/useI18nContext'; const snapIdPrefixes = ['npm:', 'local:']; -const SnapsAuthorshipPill = ({ snapId, className }) => { +const SnapsAuthorshipPill = ({ snapId, version, className }) => { // @todo Use getSnapPrefix from snaps-skunkworks when possible const snapPrefix = snapIdPrefixes.find((prefix) => snapId.startsWith(prefix)); const packageName = snapId.replace(snapPrefix, ''); @@ -20,6 +22,7 @@ const SnapsAuthorshipPill = ({ snapId, className }) => { ? `https://www.npmjs.com/package/${packageName}` : packageName; const icon = isNPM ? 'fab fa-npm fa-lg' : 'fas fa-code'; + const t = useI18nContext(); return (
    {
    } + rightIcon={ + version && ( + + + {t('shorthandVersion', [version])} + + + ) + } backgroundColor={COLORS.BACKGROUND_DEFAULT} > {headerTitle} { ///: BEGIN:ONLY_INCLUDE_IN(flask) - isSnapInstall && - ///: END:ONLY_INCLUDE_IN - } - { - ///: BEGIN:ONLY_INCLUDE_IN(flask) - snapVersion && ( - - {t('shorthandVersion', [snapVersion])} - + isSnapInstall && ( + ) ///: END:ONLY_INCLUDE_IN } diff --git a/ui/pages/permissions-connect/flask/snap-install/index.scss b/ui/pages/permissions-connect/flask/snap-install/index.scss index 53e525acb..87047ec05 100644 --- a/ui/pages/permissions-connect/flask/snap-install/index.scss +++ b/ui/pages/permissions-connect/flask/snap-install/index.scss @@ -22,10 +22,6 @@ } } - .version { - font-family: monospace; - } - .page-container__footer { width: 100%; margin-top: 12px; From e34a5ee0eb7a2e6b5837c6ecf3945c3df8afb2ac Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 3 Jun 2022 08:26:21 -0230 Subject: [PATCH 091/127] Update `protobufjs` and remove obsolete advisory exclusion (#14841) The package `protobufjs` has been updated from v6.11.2 to v6.11.3. This addresses a security advisory. The advisory `GHSA-fwr7-v2mv-hh25` has also been removed from our list of ignored advisories. These two changes should fix the `test-deps-audit` failures. --- .iyarc | 1 - yarn.lock | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.iyarc b/.iyarc index fdd24868e..66e5dd446 100644 --- a/.iyarc +++ b/.iyarc @@ -1,5 +1,4 @@ # improved-yarn-audit advisory exclusions GHSA-93q8-gq69-wqmw GHSA-257v-vj4p-3w2h -GHSA-fwr7-v2mv-hh25 GHSA-wm7h-9275-46v2 diff --git a/yarn.lock b/yarn.lock index ae6577f2b..9016669d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21882,9 +21882,9 @@ proto-list@~1.2.1: integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= protobufjs@^6.11.2: - version "6.11.2" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.2.tgz#de39fabd4ed32beaa08e9bb1e30d08544c1edf8b" - integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== + version "6.11.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" + integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" From 13a1e6318422dfde4fbdb750cb26367878820bb9 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 3 Jun 2022 11:10:43 -0230 Subject: [PATCH 092/127] Update e2e test to reflect change in Chrome Previously Chrome would ignore an attempt to navigate to a restricted URL like an extension page that is not web accessible. In a recent Chrome update, this has changed. Now it does perform the navigation, but to an error page that explains that the request was invalid. The last assertion, responsible for checking that the warning page is still shown, has been removed. The test still ensures the main wallet UI is not loaded, that assertion was not needed. --- test/e2e/tests/phishing-detection.spec.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/e2e/tests/phishing-detection.spec.js b/test/e2e/tests/phishing-detection.spec.js index 643a19835..d6ed9375a 100644 --- a/test/e2e/tests/phishing-detection.spec.js +++ b/test/e2e/tests/phishing-detection.spec.js @@ -124,10 +124,6 @@ describe('Phishing Detection', function () { // Ensure we're not on the wallet home page await driver.assertElementNotPresent('[data-testid="wallet-balance"]'); - // Ensure we're still on the warning page, meaning that the navigation failed - await driver.findElement({ - text: 'continuing at your own risk', - }); }, ); }); From e79a900f5450646dd40399c7f00f181b759c031a Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 3 Jun 2022 12:56:27 -0230 Subject: [PATCH 093/127] Update LavaMoat policy For some reason the last auto-generated policy included invalid entries. Re-running the policy auto-generation command has fixed the problem. --- lavamoat/browserify/beta/policy.json | 50 +-------------------------- lavamoat/browserify/flask/policy.json | 50 +-------------------------- lavamoat/browserify/main/policy.json | 50 +-------------------------- 3 files changed, 3 insertions(+), 147 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 5c5475cb5..1a9534d04 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -3327,10 +3327,10 @@ "setTimeout": true }, "packages": { + "@metamask/controllers": true, "@metamask/post-message-stream": true, "@metamask/providers>@metamask/object-multiplex": true, "@metamask/rpc-methods>@metamask/utils": 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, @@ -3350,54 +3350,6 @@ "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>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-keyring-controller": true, - "eth-method-registry": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "ethereumjs-wallet": 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/obs-store": { "packages": { "@metamask/snap-controllers>@metamask/obs-store>through2": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 5c5475cb5..1a9534d04 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -3327,10 +3327,10 @@ "setTimeout": true }, "packages": { + "@metamask/controllers": true, "@metamask/post-message-stream": true, "@metamask/providers>@metamask/object-multiplex": true, "@metamask/rpc-methods>@metamask/utils": 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, @@ -3350,54 +3350,6 @@ "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>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-keyring-controller": true, - "eth-method-registry": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "ethereumjs-wallet": 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/obs-store": { "packages": { "@metamask/snap-controllers>@metamask/obs-store>through2": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 5c5475cb5..1a9534d04 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -3327,10 +3327,10 @@ "setTimeout": true }, "packages": { + "@metamask/controllers": true, "@metamask/post-message-stream": true, "@metamask/providers>@metamask/object-multiplex": true, "@metamask/rpc-methods>@metamask/utils": 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, @@ -3350,54 +3350,6 @@ "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>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-keyring-controller": true, - "eth-method-registry": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "ethereumjs-wallet": 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/obs-store": { "packages": { "@metamask/snap-controllers>@metamask/obs-store>through2": true, From 87bba78d1f1a48ea0502125310c8ea8a54a6bbdd Mon Sep 17 00:00:00 2001 From: George Marshall Date: Fri, 3 Jun 2022 09:32:50 -0700 Subject: [PATCH 094/127] Updating all instances of Metamask to MetaMask in content, comments and tests (#14848) --- .storybook/1.INTRODUCTION.stories.mdx | 2 +- app/_locales/de/messages.json | 2 +- app/_locales/el/messages.json | 2 +- app/_locales/en/messages.json | 2 +- app/_locales/es/messages.json | 2 +- app/_locales/fr/messages.json | 2 +- app/_locales/id/messages.json | 2 +- app/_locales/pt/messages.json | 2 +- app/_locales/ru/messages.json | 2 +- app/_locales/tl/messages.json | 6 +++--- app/_locales/tr/messages.json | 2 +- app/_locales/vi/messages.json | 2 +- app/_locales/zh/messages.json | 4 ++-- app/scripts/metamask-controller.js | 4 ++-- docs/trezor-emulator.md | 2 +- test/e2e/tests/dapp-interactions.spec.js | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.storybook/1.INTRODUCTION.stories.mdx b/.storybook/1.INTRODUCTION.stories.mdx index 23ba7e8f7..2633d11ae 100644 --- a/.storybook/1.INTRODUCTION.stories.mdx +++ b/.storybook/1.INTRODUCTION.stories.mdx @@ -8,7 +8,7 @@ Welcome to the MetaMask Browser Extension Storybook. ## Building locally and Contributing -This document is currently only specific to storybook best practices and component documentation guidelines. This may change in future but for now if you are looking to get a local build of Metamask up and running or contribute to the extension codebase please read the Metamask [README.md](https://github.com/MetaMask/metamask-extension) +This document is currently only specific to storybook best practices and component documentation guidelines. This may change in future but for now if you are looking to get a local build of MetaMask up and running or contribute to the extension codebase please read the MetaMask [README.md](https://github.com/MetaMask/metamask-extension) ## Documentation Guidelines diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 94f6d1846..fe9107a61 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -631,7 +631,7 @@ "message": "Vertragsinteraktion" }, "convertTokenToNFTDescription": { - "message": "Wir haben festgestellt, dass dieses Asset eine NFT ist. Metamask hat jetzt volle native Unterstützung für NFTs. Möchten Sie es aus Ihrer Tokenliste entfernen und als NFT hinzufügen?" + "message": "Wir haben festgestellt, dass dieses Asset eine NFT ist. MetaMask hat jetzt volle native Unterstützung für NFTs. Möchten Sie es aus Ihrer Tokenliste entfernen und als NFT hinzufügen?" }, "convertTokenToNFTExistDescription": { "message": "Wir haben festgestellt, dass dieses Asset als NFT hinzugefügt wurde. Möchten Sie es aus Ihrer Token-Liste entfernen?" diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 2e5e1fe0b..e241a1d32 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -631,7 +631,7 @@ "message": "Αλληλεπίδραση Σύμβασης" }, "convertTokenToNFTDescription": { - "message": "Εντοπίσαμε ότι αυτό το περιουσιακό στοιχείο είναι NFT. Το Metamask υποστηρίζει πλέον εξ'ορισμού πλήρως τα NFT. Θέλετε να το αφαιρέσετε από τη λίστα των token σας και να το προσθέσετε ως NFT;" + "message": "Εντοπίσαμε ότι αυτό το περιουσιακό στοιχείο είναι NFT. Το MetaMask υποστηρίζει πλέον εξ'ορισμού πλήρως τα NFT. Θέλετε να το αφαιρέσετε από τη λίστα των token σας και να το προσθέσετε ως NFT;" }, "convertTokenToNFTExistDescription": { "message": "Εντοπίσαμε ότι αυτό το περιουσιακό στοιχείο προστέθηκε ως NFT. Θέλετε να το αφαιρέσετε από τη λίστα των token σας;" diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 2542f85d9..d0b149e4c 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -653,7 +653,7 @@ "message": "Contract Interaction" }, "convertTokenToNFTDescription": { - "message": "We've detected that this asset is an NFT. Metamask now has full native support for NFTs. Would you like to remove it from your token list and add it as an NFT?" + "message": "We've detected that this asset is an NFT. MetaMask now has full native support for NFTs. Would you like to remove it from your token list and add it as an NFT?" }, "convertTokenToNFTExistDescription": { "message": "We’ve detected that this asset has been added as an NFT. Would you like to remove it from your token list?" diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index e1f39c1d7..ebe103e7c 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -631,7 +631,7 @@ "message": "Interacción con el contrato" }, "convertTokenToNFTDescription": { - "message": "Hemos detectado que este activo es un NFT. Metamask ahora tiene soporte nativo completo para NFTs. ¿Quieres eliminarlo de tu lista de tokens y añadirlo como un NFT?" + "message": "Hemos detectado que este activo es un NFT. MetaMask ahora tiene soporte nativo completo para NFTs. ¿Quieres eliminarlo de tu lista de tokens y añadirlo como un NFT?" }, "convertTokenToNFTExistDescription": { "message": "Hemos detectado que este recurso se ha agregado como NFT. ¿Quiere eliminarlo de su lista de tokens?" diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index f78a1f24d..087150f64 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -631,7 +631,7 @@ "message": "Interaction avec un contrat" }, "convertTokenToNFTDescription": { - "message": "Nous avons détecté que cet actif est un NFT. Metamask prend désormais nativement en charge les NFT. Voulez-vous le retirer de votre liste de tokens et l’ajouter comme un NFT ?" + "message": "Nous avons détecté que cet actif est un NFT. MetaMask prend désormais nativement en charge les NFT. Voulez-vous le retirer de votre liste de tokens et l’ajouter comme un NFT ?" }, "convertTokenToNFTExistDescription": { "message": "Nous avons détecté que cet actif a été ajouté en tant que NFT. Souhaitez-vous le retirer de votre liste de tokens ?" diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 9143acbd5..151486408 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -631,7 +631,7 @@ "message": "Interaksi Kontrak" }, "convertTokenToNFTDescription": { - "message": "Kami mendeteksi bahwa aset ini merupakan NFT. Kini Metamask memiliki dukungan asli penuh untuk NFT. Anda ingin menghapusnya dari daftar token dan menambahkannya sebagai NFT?" + "message": "Kami mendeteksi bahwa aset ini merupakan NFT. Kini MetaMask memiliki dukungan asli penuh untuk NFT. Anda ingin menghapusnya dari daftar token dan menambahkannya sebagai NFT?" }, "convertTokenToNFTExistDescription": { "message": "Kami mendeteksi bahwa aset ini telah ditambahkan sebagai NFT. Anda ingin menghapusnya dari daftar token?" diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 9e956bd81..805814898 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -631,7 +631,7 @@ "message": "Interação com contrato" }, "convertTokenToNFTDescription": { - "message": "Detectamos que esse ativo é um NFT. A Metamask agora oferece suporte nativo a NFTs. Gostaria de removê-lo da sua lista de tokens e adicioná-lo como NFT?" + "message": "Detectamos que esse ativo é um NFT. A MetaMask agora oferece suporte nativo a NFTs. Gostaria de removê-lo da sua lista de tokens e adicioná-lo como NFT?" }, "convertTokenToNFTExistDescription": { "message": "Detectamos que esse ativo foi adicionado como NFT. Deseja removê-lo da sua lista de tokens?" diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 2d569b99f..3543eec56 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -631,7 +631,7 @@ "message": "Взаимодействие по контракту" }, "convertTokenToNFTDescription": { - "message": "Мы обнаружили, что этот актив является NFT. Metamask теперь имеет полную встроенную поддержку NFT. Хотите удалить его из списка токенов и добавить в качестве NFT?" + "message": "Мы обнаружили, что этот актив является NFT. MetaMask теперь имеет полную встроенную поддержку NFT. Хотите удалить его из списка токенов и добавить в качестве NFT?" }, "convertTokenToNFTExistDescription": { "message": "Мы обнаружили, что этот актив был добавлен как NFT. Хотите удалить его из списка токенов?" diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index 143496acc..ee63c5d45 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -338,7 +338,7 @@ "message": "Panimula" }, "betaMetamaskDescription": { - "message": "Ang Metamask na pinagkakatiwalaan ng milyun-milyon ay isang ligtas na wallet na ginagawang accessible ang mundo ng web3 para sa lahat." + "message": "Ang MetaMask na pinagkakatiwalaan ng milyun-milyon ay isang ligtas na wallet na ginagawang accessible ang mundo ng web3 para sa lahat." }, "betaMetamaskDescriptionExplanation": { "message": "Gamitin ang bersyong ito para subukan ang mga paparating na feature bago ilabas ang mga ito. Ang iyong paggamit at feedback ay nakakatulong sa amin na bumuo ng posibleng pinakamahusay na bersyon ng MetaMask. Ang paggamit mo ng MetaMask Beta ay napapailalim sa aming karaniwang $1 gayundin sa aming $2. Bilang Beta, maaaring tumaas ang panganib ng mga bug. Sa pagpapatuloy, tinatanggap at kinikilala mo ang mga panganib na ito, gayundin ang mga panganib na makikita sa aming Mga Tuntunin at Mga Tuntunin ng Beta.", @@ -631,7 +631,7 @@ "message": "Interaksyon ng Kontrata" }, "convertTokenToNFTDescription": { - "message": "Natukoy namin na ang asset na ito ay isang NFT. Ang Metamask ay mayroon na ngayong ganap na native support para sa mga NFT. Gusto mo bang alisin ito sa iyong listahan ng token at idagdag ito bilang isang NFT?" + "message": "Natukoy namin na ang asset na ito ay isang NFT. Ang MetaMask ay mayroon na ngayong ganap na native support para sa mga NFT. Gusto mo bang alisin ito sa iyong listahan ng token at idagdag ito bilang isang NFT?" }, "convertTokenToNFTExistDescription": { "message": "Napansin namin na naidagdag ang asset na ito bilang NFT. Gusto mo ba itong alisin mula sa listahan ng iyong token?" @@ -3933,7 +3933,7 @@ "message": "Magsimula na tayo" }, "welcomeToMetaMaskIntro": { - "message": "Ang Metamask na pinagkakatiwalaan ng milyun-milyon ay isang ligtas na wallet na ginagawang accessible ang mundo ng web3 para sa lahat." + "message": "Ang MetaMask na pinagkakatiwalaan ng milyun-milyon ay isang ligtas na wallet na ginagawang accessible ang mundo ng web3 para sa lahat." }, "whatsNew": { "message": "Ano'ng bago", diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 47e0bf461..53085daa9 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -631,7 +631,7 @@ "message": "Sözleşme Etkileşimi" }, "convertTokenToNFTDescription": { - "message": "Bu varlığın bir NFT olduğunu tespit ettik. Metamask artık NFT'ler için tam yerel desteğe sahiptir. Bunu token listenden çıkarmak ve bir NFT olarak eklemek ister misin?" + "message": "Bu varlığın bir NFT olduğunu tespit ettik. MetaMask artık NFT'ler için tam yerel desteğe sahiptir. Bunu token listenden çıkarmak ve bir NFT olarak eklemek ister misin?" }, "convertTokenToNFTExistDescription": { "message": "Bu varlığın bir NFT olarak eklendiğini tespit ettik. Token listenden çıkarmak ister misin?" diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 19059db78..2029d36b3 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -631,7 +631,7 @@ "message": "Tương tác với hợp đồng" }, "convertTokenToNFTDescription": { - "message": "Chúng tôi phát hiện tài sản này là một NFT. Metamask hiện đã hỗ trợ gốc đầy đủ cho NFT. Bạn có muốn xóa tài sản khỏi danh sách token và thêm tài sản dưới dạng NFT không?" + "message": "Chúng tôi phát hiện tài sản này là một NFT. MetaMask hiện đã hỗ trợ gốc đầy đủ cho NFT. Bạn có muốn xóa tài sản khỏi danh sách token và thêm tài sản dưới dạng NFT không?" }, "convertTokenToNFTExistDescription": { "message": "Chúng tôi phát hiện tài sản này đã được thêm dưới dạng NFT. Bạn có muốn xóa tài sản khỏi danh sách token không?" diff --git a/app/_locales/zh/messages.json b/app/_locales/zh/messages.json index 4f58588f1..4fdab2de1 100644 --- a/app/_locales/zh/messages.json +++ b/app/_locales/zh/messages.json @@ -1659,7 +1659,7 @@ "message": "打开和解锁 Ledger Live 应用程序" }, "ledgerConnectionPreferenceDescription": { - "message": "自定义连接您的 Ledger 到 Metamask 的方式。建议使用 $1,但也可使用其他选项。请在这里阅读更多信息:$2", + "message": "自定义连接您的 Ledger 到 MetaMask 的方式。建议使用 $1,但也可使用其他选项。请在这里阅读更多信息:$2", "description": "A description that appears above a dropdown where users can select between up to three options - Ledger Live, U2F or WebHID - depending on what is supported in their browser. $1 is the recommended browser option, it will be either WebHID or U2f. $2 is a link to an article where users can learn more, but will be the translation of the learnMore message." }, "ledgerDeviceOpenFailureMessage": { @@ -2158,7 +2158,7 @@ "description": "Description of a notification in the 'See What's New' popup. Describes the Ledger support update." }, "notifications6DescriptionThree": { - "message": "在 Metamask 中与您的 Ledger 账户交互时,将打开一个新选项卡,并且将要求您打开 Ledger Live 应用程序。应用程序打开后,您将被要求允许 WebSocket 连接到您的 MetaMask 账户。就是这样!", + "message": "在 MetaMask 中与您的 Ledger 账户交互时,将打开一个新选项卡,并且将要求您打开 Ledger Live 应用程序。应用程序打开后,您将被要求允许 WebSocket 连接到您的 MetaMask 账户。就是这样!", "description": "Description of a notification in the 'See What's New' popup. Describes the Ledger support update." }, "notifications6DescriptionTwo": { diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 10b32b19d..f1af3eb3d 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -2088,7 +2088,7 @@ export default class MetamaskController extends EventEmitter { // This must be set as soon as possible to communicate to the // keyring's iframe and have the setting initialized properly - // Optimistically called to not block Metamask login due to + // Optimistically called to not block MetaMask login due to // Ledger Keyring GitHub downtime const transportPreference = this.preferencesController.getLedgerTransportPreference(); this.setLedgerTransportPreference(transportPreference); @@ -2260,7 +2260,7 @@ export default class MetamaskController extends EventEmitter { // This must be set as soon as possible to communicate to the // keyring's iframe and have the setting initialized properly - // Optimistically called to not block Metamask login due to + // Optimistically called to not block MetaMask login due to // Ledger Keyring GitHub downtime const transportPreference = this.preferencesController.getLedgerTransportPreference(); diff --git a/docs/trezor-emulator.md b/docs/trezor-emulator.md index bd77bb808..fd459b92b 100644 --- a/docs/trezor-emulator.md +++ b/docs/trezor-emulator.md @@ -1,6 +1,6 @@ # Using the TREZOR simulator -You can install the TREZOR emulator and use it with Metamask. +You can install the TREZOR emulator and use it with MetaMask. Here is how: ## 1 - Install the TREZOR Bridge diff --git a/test/e2e/tests/dapp-interactions.spec.js b/test/e2e/tests/dapp-interactions.spec.js index af9f0af89..4baf16a70 100644 --- a/test/e2e/tests/dapp-interactions.spec.js +++ b/test/e2e/tests/dapp-interactions.spec.js @@ -60,7 +60,7 @@ describe('Dapp interactions', function () { ); }); - it('should connect a second Dapp despite Metamask being locked', async function () { + it('should connect a second Dapp despite MetaMask being locked', async function () { await withFixtures( { dapp: true, From ba7a177f5cd3966ac022ecf2c47b44603791da89 Mon Sep 17 00:00:00 2001 From: $tocker Date: Sat, 4 Jun 2022 02:33:59 +0900 Subject: [PATCH 095/127] fix design breaks on the Settings Navbar when Internationalization (#14012) Co-authored-by: David Walsh Co-authored-by: George Marshall --- ui/components/app/tab-bar/index.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/components/app/tab-bar/index.scss b/ui/components/app/tab-bar/index.scss index 793230b62..be543a9cb 100644 --- a/ui/components/app/tab-bar/index.scss +++ b/ui/components/app/tab-bar/index.scss @@ -38,7 +38,6 @@ &__content { padding: 12px 18px; display: flex; - flex: 1 1 auto; align-items: center; position: relative; From e60af93f2a32432ef6842531cc410b2f207ae27e Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Fri, 3 Jun 2022 12:50:23 -0500 Subject: [PATCH 096/127] Storybook: add TransactionListItem component page (#14786) * TransactionListItem: add storybook page * SB:TransactionListItem: update retry status * SB:TranslationListItem: exclude CANCEL & RETRY * TransactionListItem: exclude SIGNED status * TransactionListItem: fix mock transactions * SB:TransactionListItem: add isEarliestNonce param * SB:TransactionListItem: fix args * SB:TransactionListItem: add "Speed Up" params * SB: add nonce to mock transactions --- .storybook/initial-states/transactions.js | 1921 +++++++++++++++++ .../transaction-list-item.stories.js | 210 ++ 2 files changed, 2131 insertions(+) create mode 100644 .storybook/initial-states/transactions.js create mode 100644 ui/components/app/transaction-list-item/transaction-list-item.stories.js diff --git a/.storybook/initial-states/transactions.js b/.storybook/initial-states/transactions.js new file mode 100644 index 000000000..34b848712 --- /dev/null +++ b/.storybook/initial-states/transactions.js @@ -0,0 +1,1921 @@ +const MOCK_TX_TYPE = { + CANCEL: 'cancel', + CONTRACT_INTERACTION: 'contractInteraction', + DEPLOY_CONTRACT: 'contractDeployment', + ETH_DECRYPT: 'eth_decrypt', + ETH_GET_ENCRYPTION_PUBLIC_KEY: 'eth_getEncryptionPublicKey', + INCOMING: 'incoming', + PERSONAL_SIGN: 'personal_sign', + RETRY: 'retry', + SIGN: 'eth_sign', + SIGN_TYPED_DATA: 'eth_signTypedData', + SIMPLE_SEND: 'simpleSend', + SMART: 'smart', + SWAP: 'swap', + SWAP_APPROVAL: 'swapApproval', + TOKEN_METHOD_APPROVE: 'approve', + TOKEN_METHOD_SAFE_TRANSFER_FROM: 'safetransferfrom', + TOKEN_METHOD_TRANSFER: 'transfer', + TOKEN_METHOD_TRANSFER_FROM: 'transferfrom', +}; + +export const MOCK_TRANSACTION_BY_TYPE = { + [MOCK_TX_TYPE.CANCEL]: { + id: 643368596521636, + time: 1653527035634, + status: 'submitted', + metamaskNetworkId: '4', + originalGasEstimate: '5208', + userEditedGasLimit: false, + chainId: '0x4', + loadingDefaults: false, + dappSuggestedGasFees: null, + sendFlowHistory: [], + txParams: { + from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', + to: '0xefge7847fd3661a9b7c86aaf1daea08d9da5750e', + nonce: '0x51', + value: '0x0', + gas: '0x5208', + gasPrice: '0x59682f0e', + estimateSuggested: 'medium', + estimateUsed: 'custom', + }, + previousGasParams: { + gasPrice: '0x3b9aca00', + }, + type: 'cancel', + history: [ + { + id: 643368596521636, + time: 1653527035634, + status: 'approved', + metamaskNetworkId: '4', + originalGasEstimate: '5208', + userEditedGasLimit: false, + chainId: '0x4', + loadingDefaults: false, + dappSuggestedGasFees: null, + sendFlowHistory: [], + txParams: { + from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', + to: '0xefge7847fd3661a9b7c86aaf1daea08d9da5750e', + nonce: '0x51', + value: '0x0', + gas: '0x5208', + gasPrice: '0x59682f0e', + estimateSuggested: 'medium', + estimateUsed: 'custom', + }, + previousGasParams: { + gasPrice: '0x3b9aca00', + }, + type: 'cancel', + }, + [ + { + op: 'add', + path: '/nonceDetails', + value: { + params: { + highestLocallyConfirmed: 81, + highestSuggested: 81, + nextNetworkNonce: 81, + }, + local: { + name: 'local', + nonce: 83, + details: { + startPoint: 81, + highest: 83, + }, + }, + network: { + name: 'network', + nonce: 81, + details: { + blockNumber: '0xa3e3ac', + baseCount: 81, + }, + }, + }, + note: 'transactions#approveTransaction', + timestamp: 1653527035723, + }, + ], + [ + { + op: 'add', + path: '/r', + value: + '0xb66eff07d9061c42e47ccf5f6a52b6626ef4d5b10e50d8aa6b8f20ae645fe347', + note: 'transactions#signTransaction: add r, s, v values', + timestamp: 1653527035817, + }, + { + op: 'add', + path: '/s', + value: + '0x3a2da8d56beff82a2d59e807f7d578f0c3b4b99cd6d3735c72c133d06fe02a9d', + }, + { + op: 'add', + path: '/v', + value: '0x2b', + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'signed', + note: 'txStateManager: setting status to signed', + timestamp: 1653527035818, + }, + ], + [ + { + op: 'add', + path: '/rawTx', + value: + '0xf863518459682f0e82520894e56e7847fd3661a9b7c86aaf1daea08d9da5750e80802ba0b66eff07d9061c42e47ccf5f6a52b6626ef4d5b10e50d8aa6b8f20ae645fe347a03a2da8d56beff82a2d59e807f7d578f0c3b4b99cd6d3735c72c133d06fe02a9d', + note: 'transactions#publishTransaction', + timestamp: 1653527035819, + }, + ], + [ + { + op: 'add', + path: '/hash', + value: + '0xb7628b82716108edcfe84dfd6ed49b219bc019e3fc6e96cf95548c32a67c1cbc', + note: 'transactions#setTxHash', + timestamp: 1653527035923, + }, + ], + [ + { + op: 'add', + path: '/submittedTime', + value: 1653527035924, + note: 'txStateManager - add submitted time stamp', + timestamp: 1653527035924, + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'submitted', + note: 'txStateManager: setting status to submitted', + timestamp: 1653527035925, + }, + ], + ], + nonceDetails: { + params: { + highestLocallyConfirmed: 81, + highestSuggested: 81, + nextNetworkNonce: 81, + }, + local: { + name: 'local', + nonce: 83, + details: { + startPoint: 81, + highest: 83, + }, + }, + network: { + name: 'network', + nonce: 81, + details: { + blockNumber: '0xa3e3ac', + baseCount: 81, + }, + }, + }, + r: '0xb66eff07d9061c42e47ccf5f6a52b6626ef4d5b10e50d8aa6b8f20ae645fe347', + s: '0x3a2da8d56beff82a2d59e807f7d578f0c3b4b99cd6d3735c72c133d06fe02a9d', + v: '0x2b', + rawTx: + '0xf863518459682f0e82520894e56e7847fd3661a9b7c86aaf1daea08d9da5750e80802ba0b66eff07d9061c42e47ccf5f6a52b6626ef4d5b10e50d8aa6b8f20ae645fe347a03a2da8d56beff82a2d59e807f7d578f0c3b4b99cd6d3735c72c133d06fe02a9d', + hash: '0xb7628b82716108edcfe84dfd6ed49b219bc019e3fc6e96cf95548c32a67c1cbc', + submittedTime: 1653527035924, + }, + [MOCK_TX_TYPE.CONTRACT_INTERACTION]: { + chainId: '0x4', + dappSuggestedGasFees: { + gas: '0x118f4', + maxFeePerGas: '0x9502f91a', + maxPriorityFeePerGas: '0x9502F900', + }, + id: 7694052085150913, + loadingDefaults: true, + metamaskNetworkId: '4', + origin: 'https://remix.ethereum.org', + originalGasEstimate: '0x118f4', + sendFlowHistory: [], + status: 'unapproved', + time: 1653417884003, + txParams: { + data: + '0xa1448194000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e0000000000000000000000000000000000000000000000000000000000000004', + from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', + gas: '0x118f4', + maxFeePerGas: '0x9502f91a', + maxPriorityFeePerGas: '0x9502F900', + to: '0xefg6c980a3fcd3100503d8f80537eefcee516d67', + type: '0x2', + value: '0x0', + }, + type: 'contractInteraction', + userEditedGasLimit: false, + }, + [MOCK_TX_TYPE.DEPLOY_CONTRACT]: { + blockNumber: '6195527', + id: 4243712234858468, + metamaskNetworkId: '4', + status: 'confirmed', + time: 1585088013000, + txParams: { + from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', + gas: '0x5208', + gasPrice: '0x77359400', + nonce: '0x3', + value: '0x00', + data: + '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', + }, + hash: '0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a', + type: 'contractDeployment', + origin: 'https://metamask.github.io', + }, + [MOCK_TX_TYPE.ETH_DECRYPT]: { + id: 5177046356058652, + msgParams: { + from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', + data: + '0x7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a22415a7a535971376139725531396e3835753174494f5765367a486e32775a6166222c22657068656d5075626c69634b6579223a2251336d346650474a6b6a32396d44766f7133536a77616733686b3651366571744236397671795258517a673d222c2263697068657274657874223a223943556d614c327a69635a5838584c4d5a75646b58392f6531544770384d61513135776276774c6d442b4235772b4f706655694c586c586d55355536645339675638584c61445557446e656735546b3d227d', + origin: 'https://metamask.github.io', + }, + time: 1653450860396, + txParams: { + from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', + gas: '0x5208', + gasPrice: '0x77359400', + nonce: '0x3', + value: '0x00', + data: + '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', + }, + status: 'unapproved', + type: 'eth_decrypt', + }, + [MOCK_TX_TYPE.ETH_GET_ENCRYPTION_PUBLIC_KEY]: { + id: 5177046356058645, + msgParams: '0xe56e7847fd3661a9b7c86aaf1daea08d9da5750e', + time: 1653450802102, + status: 'unapproved', + txParams: { + from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', + gas: '0x5208', + gasPrice: '0x77359400', + nonce: '0x3', + value: '0x00', + data: + '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', + }, + type: 'eth_getEncryptionPublicKey', + origin: 'https://metamask.github.io', + }, + [MOCK_TX_TYPE.INCOMING]: { + blockNumber: '6477257', + id: 4243712234858505, + metamaskNetworkId: '4', + status: 'confirmed', + time: 1589314295000, + txParams: { + from: '0xabc98d14007bdee637298086988a0bbd31184523', + gas: '0x5208', + gasPrice: '0x3b9aca00', + nonce: '0x56540', + to: '0xefga64466f257793eaa52fcfff5066894b76a149', + value: '0x1043561a882930000', + }, + hash: '0x5ca26d1cdcabef1ac2ad5b2b38604c9ced65d143efc7525f848c46f28e0e4116', + type: 'incoming', + }, + [MOCK_TX_TYPE.PERSONAL_SIGN]: { + id: 5177046356058671, + msgParams: { + 0: 'E', + 1: 'x', + 2: 'a', + 3: 'm', + 4: 'p', + 5: 'l', + 6: 'e', + 7: ' ', + 8: 'p', + 9: 'a', + 10: 's', + 11: 's', + 12: 'w', + 13: 'o', + 14: 'r', + 15: 'd', + from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', + data: '0x4578616d706c652060706572736f6e616c5f7369676e60206d657373616765', + origin: 'https://metamask.github.io', + }, + txParams: { + from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', + gas: '0x5208', + gasPrice: '0x77359400', + nonce: '0x3', + value: '0x00', + data: + '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', + }, + time: 1653451036121, + status: 'unapproved', + type: 'personal_sign', + }, + [MOCK_TX_TYPE.RETRY]: { + id: 3938342322880462, + time: 1653459456297, + status: 'failed', + metamaskNetworkId: '4', + originalGasEstimate: '14609', + userEditedGasLimit: false, + chainId: '0x4', + loadingDefaults: false, + dappSuggestedGasFees: null, + sendFlowHistory: [], + txParams: { + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + nonce: '0x7', + value: '0x0', + data: + '0x6080604052348015600f57600080fd5b50608b8061001e6000396000f3fe6080604052610fff3411600e57fe5b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156053573d6000803e3d6000fd5b5000fea265627a7a72315820631b0dbb6b871cdbfdec2773af15ebfb8e52c794cf836fe27ec21f1aed17180f64736f6c634300050c0032', + gas: '0x14609', + maxFeePerGas: '0x3b9aca0d', + maxPriorityFeePerGas: '0x3b9aca00', + estimateSuggested: 'medium', + estimateUsed: 'low', + }, + previousGasParams: { + maxFeePerGas: '0x3b9aca0b', + maxPriorityFeePerGas: '0xbebc200', + }, + type: 'retry', + estimatedBaseFee: 'd', + history: [ + { + id: 3938342322880462, + time: 1653459456297, + status: 'approved', + metamaskNetworkId: '4', + originalGasEstimate: '14609', + userEditedGasLimit: false, + chainId: '0x4', + loadingDefaults: false, + dappSuggestedGasFees: null, + sendFlowHistory: [], + txParams: { + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + nonce: '0x7', + value: '0x0', + data: + '0x6080604052348015600f57600080fd5b50608b8061001e6000396000f3fe6080604052610fff3411600e57fe5b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156053573d6000803e3d6000fd5b5000fea265627a7a72315820631b0dbb6b871cdbfdec2773af15ebfb8e52c794cf836fe27ec21f1aed17180f64736f6c634300050c0032', + gas: '0x14609', + maxFeePerGas: '0x3b9aca0d', + maxPriorityFeePerGas: '0x3b9aca00', + estimateSuggested: 'medium', + estimateUsed: 'low', + }, + previousGasParams: { + maxFeePerGas: '0x3b9aca0b', + maxPriorityFeePerGas: '0xbebc200', + }, + type: 'retry', + estimatedBaseFee: 'd', + }, + [ + { + op: 'add', + path: '/nonceDetails', + value: { + params: { + highestLocallyConfirmed: 7, + highestSuggested: 7, + nextNetworkNonce: 7, + }, + local: { + name: 'local', + nonce: 10, + details: { + startPoint: 7, + highest: 10, + }, + }, + network: { + name: 'network', + nonce: 7, + details: { + blockNumber: '0xa3d235', + baseCount: 7, + }, + }, + }, + note: 'transactions#approveTransaction', + timestamp: 1653459456415, + }, + ], + [ + { + op: 'add', + path: '/r', + value: + '0xde2e3131fb55b1edd182de128453521c86eed588f92058b61b3ce56cdfb33a26', + note: 'transactions#signTransaction: add r, s, v values', + timestamp: 1653459456512, + }, + { + op: 'add', + path: '/s', + value: + '0x64ee1eef8d0fa1b35e122658554d16645366e8977253fc1c47d030f28736409b', + }, + { + op: 'add', + path: '/v', + value: '0x00', + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'signed', + note: 'txStateManager: setting status to signed', + timestamp: 1653459456512, + }, + ], + [ + { + op: 'add', + path: '/rawTx', + value: + '0x02f901010407843b9aca00843b9aca0d830146098080b8a96080604052348015600f57600080fd5b50608b8061001e6000396000f3fe6080604052610fff3411600e57fe5b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156053573d6000803e3d6000fd5b5000fea265627a7a72315820631b0dbb6b871cdbfdec2773af15ebfb8e52c794cf836fe27ec21f1aed17180f64736f6c634300050c0032c080a0de2e3131fb55b1edd182de128453521c86eed588f92058b61b3ce56cdfb33a26a064ee1eef8d0fa1b35e122658554d16645366e8977253fc1c47d030f28736409b', + note: 'transactions#publishTransaction', + timestamp: 1653459456514, + }, + ], + [ + { + op: 'add', + path: '/err', + value: { + message: + '[ethjs-query] while formatting outputs from RPC \'{"value":{"code":-32000,"message":"replacement transaction underpriced"}}\'', + stack: + 'Error: [ethjs-query] while formatting outputs from RPC \'{"value":{"code":-32000,"message":"replacement transaction underpriced"}}\'\n at chrome-extension://hbljfohiafgaaaabejngpgolnboohpaf/common-5.js:14346:29', + }, + note: 'transactions:tx-state-manager#fail - add error', + timestamp: 1653459456632, + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'failed', + note: 'txStateManager: setting status to failed', + timestamp: 1653459456633, + }, + ], + ], + nonceDetails: { + params: { + highestLocallyConfirmed: 7, + highestSuggested: 7, + nextNetworkNonce: 7, + }, + local: { + name: 'local', + nonce: 10, + details: { + startPoint: 7, + highest: 10, + }, + }, + network: { + name: 'network', + nonce: 7, + details: { + blockNumber: '0xa3d235', + baseCount: 7, + }, + }, + }, + r: '0xde2e3131fb55b1edd182de128453521c86eed588f92058b61b3ce56cdfb33a26', + s: '0x64ee1eef8d0fa1b35e122658554d16645366e8977253fc1c47d030f28736409b', + v: '0x00', + rawTx: + '0x02f901010407843b9aca00843b9aca0d830146098080b8a96080604052348015600f57600080fd5b50608b8061001e6000396000f3fe6080604052610fff3411600e57fe5b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156053573d6000803e3d6000fd5b5000fea265627a7a72315820631b0dbb6b871cdbfdec2773af15ebfb8e52c794cf836fe27ec21f1aed17180f64736f6c634300050c0032c080a0de2e3131fb55b1edd182de128453521c86eed588f92058b61b3ce56cdfb33a26a064ee1eef8d0fa1b35e122658554d16645366e8977253fc1c47d030f28736409b', + err: { + message: + '[ethjs-query] while formatting outputs from RPC \'{"value":{"code":-32000,"message":"replacement transaction underpriced"}}\'', + stack: + 'Error: [ethjs-query] while formatting outputs from RPC \'{"value":{"code":-32000,"message":"replacement transaction underpriced"}}\'\n at chrome-extension://hbljfohiafgaaaabejngpgolnboohpaf/common-5.js:14346:29', + }, + }, + [MOCK_TX_TYPE.SIGN]: { + id: 5177046356058675, + msgParams: { + from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', + data: + '0x879a053d4800c6354e76c7985a865d2922c82fb5b3f4577b2fe08b998954f2e0', + origin: 'https://metamask.github.io', + }, + txParams: { + from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', + gas: '0x5208', + gasPrice: '0x77359400', + nonce: '0x3', + value: '0x00', + data: + '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', + }, + time: 1653451051909, + status: 'unapproved', + type: 'eth_sign', + }, + [MOCK_TX_TYPE.SIGN_TYPED_DATA]: { + id: 5177046356058598, + msgParams: { + from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', + data: [ + { + type: 'string', + name: 'Message', + value: 'Hi, Alice!', + }, + { + type: 'uint32', + name: 'A number', + value: '1337', + }, + ], + version: 'V1', + origin: 'https://metamask.github.io', + }, + txParams: { + from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', + gas: '0x5208', + gasPrice: '0x77359400', + nonce: '0x3', + value: '0x00', + data: + '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', + }, + time: 1653450005954, + status: 'unapproved', + type: 'eth_signTypedData', + }, + [MOCK_TX_TYPE.SIMPLE_SEND]: { + id: 4243712234858512, + time: 1589314601567, + status: 'confirmed', + metamaskNetworkId: '4', + loadingDefaults: false, + txParams: { + from: '0xabca64466f257793eaa52fcfff5066894b76a149', + to: '0xefg5bc4e8f1f969934d773fa67da095d2e491a97', + nonce: '0xc', + value: '0xde0b6b3a7640000', + gas: '0x5208', + gasPrice: '0x2540be400', + }, + origin: 'metamask', + type: 'simpleSend', + }, + [MOCK_TX_TYPE.SMART]: { + blockNumber: '6195527', + id: 4243712234858468, + metamaskNetworkId: '4', + status: 'confirmed', + time: 1585088013000, + txParams: { + from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', + gas: '0x5208', + gasPrice: '0x77359400', + nonce: '0x3', + value: '0x00', + data: + '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', + }, + hash: '0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a', + transactionType: 'smart', + type: 'contractDeployment', + origin: 'https://metamask.github.io', + }, + [MOCK_TX_TYPE.SWAP]: { + blockNumber: '6195527', + id: 4243712234858467, + metamaskNetworkId: '4', + status: 'confirmed', + time: 1585088013000, + txParams: { + from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', + gas: '0x5208', + gasPrice: '0x77359400', + nonce: '0x3', + to: '0xefga64466f257793eaa52fcfff5066894b76a149', + value: '0xde0b6b3a7640000', + }, + hash: '0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a', + destinationTokenSymbol: 'ABC', + sourceTokenSymbol: 'ETH', + type: 'swap', + }, + [MOCK_TX_TYPE.SWAP_APPROVAL]: { + blockNumber: '6195527', + id: 4243712234858467, + metamaskNetworkId: '4', + status: 'confirmed', + time: 1585088013000, + txParams: { + from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', + gas: '0x5208', + gasPrice: '0x77359400', + nonce: '0x3', + to: '0xefga64466f257793eaa52fcfff5066894b76a149', + value: '0xde0b6b3a7640000', + }, + hash: '0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a', + destinationTokenSymbol: 'ABC', + type: 'swapApproval', + sourceTokenSymbol: 'XBN', + }, + [MOCK_TX_TYPE.TOKEN_METHOD_APPROVE]: { + id: 5177046356058729, + time: 1653457101080, + status: 'submitted', + metamaskNetworkId: '4', + originalGasEstimate: '0xb427', + userEditedGasLimit: false, + chainId: '0x4', + loadingDefaults: false, + dappSuggestedGasFees: { + gasPrice: '0x4a817c800', + gas: '0xb427', + }, + sendFlowHistory: [], + txParams: { + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', + nonce: '0x5', + value: '0x0', + data: + '0x095ea7b30000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000011170', + gas: '0xb427', + maxFeePerGas: '0x4a817c800', + maxPriorityFeePerGas: '0x4a817c800', + }, + origin: 'https://metamask.github.io', + type: 'approve', + history: [ + { + id: 5177046356058729, + time: 1653457101080, + status: 'unapproved', + metamaskNetworkId: '4', + originalGasEstimate: '0xb427', + userEditedGasLimit: false, + chainId: '0x4', + loadingDefaults: true, + dappSuggestedGasFees: { + gasPrice: '0x4a817c800', + gas: '0xb427', + }, + sendFlowHistory: [], + txParams: { + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', + value: '0x0', + data: + '0x095ea7b30000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000011170', + gas: '0xb427', + gasPrice: '0x4a817c800', + }, + origin: 'https://metamask.github.io', + type: 'approve', + }, + [ + { + op: 'remove', + path: '/txParams/gasPrice', + note: 'Added new unapproved transaction.', + timestamp: 1653457101715, + }, + { + op: 'add', + path: '/txParams/maxFeePerGas', + value: '0x4a817c800', + }, + { + op: 'add', + path: '/txParams/maxPriorityFeePerGas', + value: '0x4a817c800', + }, + { + op: 'replace', + path: '/loadingDefaults', + value: false, + }, + { + op: 'add', + path: '/userFeeLevel', + value: 'custom', + }, + { + op: 'add', + path: '/defaultGasEstimates', + value: { + estimateType: 'custom', + gas: '0xb427', + maxFeePerGas: '0x4a817c800', + maxPriorityFeePerGas: '0x4a817c800', + }, + }, + ], + [ + { + op: 'add', + path: '/estimatedBaseFee', + value: '14', + note: 'confTx: user approved transaction', + timestamp: 1653457117006, + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'approved', + note: 'txStateManager: setting status to approved', + timestamp: 1653457117008, + }, + ], + [ + { + op: 'add', + path: '/txParams/nonce', + value: '0x5', + note: 'transactions#approveTransaction', + timestamp: 1653457117294, + }, + { + op: 'add', + path: '/nonceDetails', + value: { + params: { + highestLocallyConfirmed: 5, + highestSuggested: 5, + nextNetworkNonce: 5, + }, + local: { + name: 'local', + nonce: 5, + details: { + startPoint: 5, + highest: 5, + }, + }, + network: { + name: 'network', + nonce: 5, + details: { + blockNumber: '0xa3d19b', + baseCount: 5, + }, + }, + }, + }, + ], + [ + { + op: 'add', + path: '/r', + value: + '0xfdd2cb46203b5e7bba99cc56a37da3e5e3f36163a5bd9c51cddfd8d7028f5dd0', + note: 'transactions#signTransaction: add r, s, v values', + timestamp: 1653457117407, + }, + { + op: 'add', + path: '/s', + value: + '0x54c35cfa10b3350a3fd3a0e7b4aeb0b603d528c07a8cfdf4a78505d9864edef4', + }, + { + op: 'add', + path: '/v', + value: '0x00', + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'signed', + note: 'txStateManager: setting status to signed', + timestamp: 1653457117408, + }, + ], + [ + { + op: 'add', + path: '/rawTx', + value: + '0x02f8b104058504a817c8008504a817c80082b427949ba60bbf4ba1de43f3b4983a539feebfbd5fd97680b844095ea7b30000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000011170c080a0fdd2cb46203b5e7bba99cc56a37da3e5e3f36163a5bd9c51cddfd8d7028f5dd0a054c35cfa10b3350a3fd3a0e7b4aeb0b603d528c07a8cfdf4a78505d9864edef4', + note: 'transactions#publishTransaction', + timestamp: 1653457117410, + }, + ], + [ + { + op: 'add', + path: '/hash', + value: + '0x75b35f5b9a95c8e4b1a242be5b163c7a1b18822191b0b1de6985a8b9d3abfe26', + note: 'transactions#setTxHash', + timestamp: 1653457118158, + }, + ], + [ + { + op: 'add', + path: '/submittedTime', + value: 1653457118159, + note: 'txStateManager - add submitted time stamp', + timestamp: 1653457118160, + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'submitted', + note: 'txStateManager: setting status to submitted', + timestamp: 1653457118161, + }, + ], + ], + userFeeLevel: 'custom', + defaultGasEstimates: { + estimateType: 'custom', + gas: '0xb427', + maxFeePerGas: '0x4a817c800', + maxPriorityFeePerGas: '0x4a817c800', + }, + estimatedBaseFee: '14', + nonceDetails: { + params: { + highestLocallyConfirmed: 5, + highestSuggested: 5, + nextNetworkNonce: 5, + }, + local: { + name: 'local', + nonce: 5, + details: { + startPoint: 5, + highest: 5, + }, + }, + network: { + name: 'network', + nonce: 5, + details: { + blockNumber: '0xa3d19b', + baseCount: 5, + }, + }, + }, + r: '0xfdd2cb46203b5e7bba99cc56a37da3e5e3f36163a5bd9c51cddfd8d7028f5dd0', + s: '0x54c35cfa10b3350a3fd3a0e7b4aeb0b603d528c07a8cfdf4a78505d9864edef4', + v: '0x00', + rawTx: + '0x02f8b104058504a817c8008504a817c80082b427949ba60bbf4ba1de43f3b4983a539feebfbd5fd97680b844095ea7b30000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000011170c080a0fdd2cb46203b5e7bba99cc56a37da3e5e3f36163a5bd9c51cddfd8d7028f5dd0a054c35cfa10b3350a3fd3a0e7b4aeb0b603d528c07a8cfdf4a78505d9864edef4', + hash: '0x75b35f5b9a95c8e4b1a242be5b163c7a1b18822191b0b1de6985a8b9d3abfe26', + submittedTime: 1653457118159, + }, + [MOCK_TX_TYPE.TOKEN_METHOD_SAFE_TRANSFER_FROM]: { + id: 1441203963845330, + time: 1652206763566, + status: 'confirmed', + metamaskNetworkId: '4', + originalGasEstimate: '0x118e0', + userEditedGasLimit: false, + chainId: '0x4', + loadingDefaults: false, + dappSuggestedGasFees: { + maxPriorityFeePerGas: '0x3B9ACA00', + maxFeePerGas: '0x7be830aec', + }, + sendFlowHistory: [], + txParams: { + from: '0xabc627172af48bd5b0765d3449a7def80d6576ff', + to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', + nonce: '0x57', + value: '0x0', + data: + '0x42842e0e000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98000000000000000000000000000000000000000000000000000000000009a7cc', + gas: '0x118e0', + maxFeePerGas: '0x7be830aec', + maxPriorityFeePerGas: '0x3B9ACA00', + }, + origin: 'https://rinkeby.etherscan.io', + type: 'safetransferfrom', + userFeeLevel: 'dappSuggested', + defaultGasEstimates: { + estimateType: 'dappSuggested', + gas: '0x118e0', + maxFeePerGas: '0x7be830aec', + maxPriorityFeePerGas: '0x3B9ACA00', + }, + estimatedBaseFee: '3ba182755', + nonceDetails: { + params: { + highestLocallyConfirmed: 87, + highestSuggested: 87, + nextNetworkNonce: 87, + }, + local: { + name: 'local', + nonce: 87, + details: { + startPoint: 87, + highest: 87, + }, + }, + network: { + name: 'network', + nonce: 87, + details: { + blockNumber: '0xa28e38', + baseCount: 87, + }, + }, + }, + r: '0xd13310569a8d5876e37788183034bfe4bc3b49c0663c5fd9b2bf13adf9b4791c', + s: '0x7a83d8840e7edcdf4fdedfd2bc1ce19775e54fd17f29ede5165591a1cf3febea', + v: '0x00', + rawTx: + '0x02f8d10457843b9aca008507be830aec830118e094f5de760f2e916647fd766b4ad9e85ff943ce3a2b80b86442842e0e000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98000000000000000000000000000000000000000000000000000000000009a7ccc080a0d13310569a8d5876e37788183034bfe4bc3b49c0663c5fd9b2bf13adf9b4791ca07a83d8840e7edcdf4fdedfd2bc1ce19775e54fd17f29ede5165591a1cf3febea', + hash: '0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3', + submittedTime: 1652206777046, + txReceipt: { + blockHash: + '0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1', + blockNumber: 'a28e39', + contractAddress: null, + cumulativeGasUsed: 'fd5dee', + effectiveGasPrice: '0x4028dcaf1', + from: '0xabc627172af48bd5b0765d3449a7def80d6576ff', + gasUsed: 'bb40', + logs: [ + { + address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', + blockHash: + '0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1', + blockNumber: 'a28e39', + data: '0x', + logIndex: '45', + removed: false, + topics: [ + '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925', + '0x000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff', + '0x0000000000000000000000000000000000000000000000000000000000000000', + '0x000000000000000000000000000000000000000000000000000000000009a7cc', + ], + transactionHash: + '0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3', + transactionIndex: '23', + }, + { + address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', + blockHash: + '0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1', + blockNumber: 'a28e39', + data: '0x', + logIndex: '46', + removed: false, + topics: [ + '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', + '0x000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff', + '0x000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98', + '0x000000000000000000000000000000000000000000000000000000000009a7cc', + ], + transactionHash: + '0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3', + transactionIndex: '23', + }, + ], + logsBloom: + '0x00000000000000001000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000008000200000000000000000000000000008000000000000000000008000000000000000000000000000020800000000000000000800000000000000000000000010000000000000000000000000000080000010000000000000000000000000000000000000020000000000000000000001000000000000000000000000000000000000000000000202000000000000000000000800000000000000000000000000000020000010000000000002008000000000000000000000000000000000000000000000', + status: '0x1', + to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', + transactionHash: + '0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3', + transactionIndex: '23', + type: '0x2', + }, + baseFeePerGas: '0x3c6f300f1', + blockTimestamp: '627aacc2', + }, + [MOCK_TX_TYPE.TOKEN_METHOD_TRANSFER]: { + id: 5177046356058725, + time: 1653457077370, + status: 'confirmed', + metamaskNetworkId: '4', + originalGasEstimate: '0xea60', + userEditedGasLimit: false, + chainId: '0x4', + loadingDefaults: false, + dappSuggestedGasFees: { + gasPrice: '0x4a817c800', + gas: '0xea60', + }, + sendFlowHistory: [], + txParams: { + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', + nonce: '0x4', + value: '0x0', + data: + '0xa9059cbb0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000003a98', + gas: '0xea60', + maxFeePerGas: '0x4a817c800', + maxPriorityFeePerGas: '0x4a817c800', + }, + origin: 'https://metamask.github.io', + type: 'transfer', + history: [ + { + id: 5177046356058725, + time: 1653457077370, + status: 'unapproved', + metamaskNetworkId: '4', + originalGasEstimate: '0xea60', + userEditedGasLimit: false, + chainId: '0x4', + loadingDefaults: true, + dappSuggestedGasFees: { + gasPrice: '0x4a817c800', + gas: '0xea60', + }, + sendFlowHistory: [], + txParams: { + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', + value: '0x0', + data: + '0xa9059cbb0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000003a98', + gas: '0xea60', + gasPrice: '0x4a817c800', + }, + origin: 'https://metamask.github.io', + type: 'transfer', + }, + [ + { + op: 'remove', + path: '/txParams/gasPrice', + note: 'Added new unapproved transaction.', + timestamp: 1653457077808, + }, + { + op: 'add', + path: '/txParams/maxFeePerGas', + value: '0x4a817c800', + }, + { + op: 'add', + path: '/txParams/maxPriorityFeePerGas', + value: '0x4a817c800', + }, + { + op: 'replace', + path: '/loadingDefaults', + value: false, + }, + { + op: 'add', + path: '/userFeeLevel', + value: 'custom', + }, + { + op: 'add', + path: '/defaultGasEstimates', + value: { + estimateType: 'custom', + gas: '0xea60', + maxFeePerGas: '0x4a817c800', + maxPriorityFeePerGas: '0x4a817c800', + }, + }, + ], + [ + { + op: 'add', + path: '/estimatedBaseFee', + value: '16', + note: 'confTx: user approved transaction', + timestamp: 1653457091914, + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'approved', + note: 'txStateManager: setting status to approved', + timestamp: 1653457091915, + }, + ], + [ + { + op: 'add', + path: '/txParams/nonce', + value: '0x4', + note: 'transactions#approveTransaction', + timestamp: 1653457091939, + }, + { + op: 'add', + path: '/nonceDetails', + value: { + params: { + highestLocallyConfirmed: 4, + highestSuggested: 4, + nextNetworkNonce: 4, + }, + local: { + name: 'local', + nonce: 4, + details: { + startPoint: 4, + highest: 4, + }, + }, + network: { + name: 'network', + nonce: 4, + details: { + blockNumber: '0xa3d198', + baseCount: 4, + }, + }, + }, + }, + ], + [ + { + op: 'add', + path: '/r', + value: + '0xb0f36e4392f9d302351789aef355a2e95b979bcdd99d19026c533152563d3bce', + note: 'transactions#signTransaction: add r, s, v values', + timestamp: 1653457092053, + }, + { + op: 'add', + path: '/s', + value: + '0x08e59de373e65c9c54e6a8052585461e81409d33178464f9b72f4cc36ac75d40', + }, + { + op: 'add', + path: '/v', + value: '0x01', + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'signed', + note: 'txStateManager: setting status to signed', + timestamp: 1653457092054, + }, + ], + [ + { + op: 'add', + path: '/rawTx', + value: + '0x02f8b104048504a817c8008504a817c80082ea60949ba60bbf4ba1de43f3b4983a539feebfbd5fd97680b844a9059cbb0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000003a98c001a0b0f36e4392f9d302351789aef355a2e95b979bcdd99d19026c533152563d3bcea008e59de373e65c9c54e6a8052585461e81409d33178464f9b72f4cc36ac75d40', + note: 'transactions#publishTransaction', + timestamp: 1653457092056, + }, + ], + [ + { + op: 'add', + path: '/hash', + value: + '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', + note: 'transactions#setTxHash', + timestamp: 1653457092526, + }, + ], + [ + { + op: 'add', + path: '/submittedTime', + value: 1653457092527, + note: 'txStateManager - add submitted time stamp', + timestamp: 1653457092527, + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'submitted', + note: 'txStateManager: setting status to submitted', + timestamp: 1653457092529, + }, + ], + [ + { + op: 'add', + path: '/firstRetryBlockNumber', + value: '0xa3d199', + note: 'transactions/pending-tx-tracker#event: tx:block-update', + timestamp: 1653457094748, + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'confirmed', + note: 'txStateManager: setting status to confirmed', + timestamp: 1653457115712, + }, + { + op: 'add', + path: '/txReceipt', + value: { + blockHash: + '0x243a362e5fda0d6ec8fce3d7f727679148c1df8ec6d7470ff65b38c8a96823b4', + blockNumber: 'a3d19a', + contractAddress: null, + cumulativeGasUsed: 'ca21', + effectiveGasPrice: '0x4a817c800', + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + gasUsed: 'ca21', + logs: [ + { + address: '0x9ba60bbf4ba1de43f3b4983a539feebfbd5fd976', + blockHash: + '0x243a362e5fda0d6ec8fce3d7f727679148c1df8ec6d7470ff65b38c8a96823b4', + blockNumber: 'a3d19a', + data: + '0x0000000000000000000000000000000000000000000000000000000000003a98', + logIndex: '0', + removed: false, + topics: [ + '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', + '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', + '0x0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c970', + ], + transactionHash: + '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', + transactionIndex: '0', + }, + ], + logsBloom: + '0x00000000000000000000000000000000000000000000001000000100000100000000000000000000000000000000000000000000000000000000000000000000000000000020000000000008000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000100000000000000000000000000000000000000000000000000000000000000000000000800000004000000000000001000000000000000', + status: '0x1', + to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', + transactionHash: + '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', + transactionIndex: '0', + type: '0x2', + }, + }, + { + op: 'add', + path: '/baseFeePerGas', + value: '0x14', + }, + { + op: 'add', + path: '/blockTimestamp', + value: '628dc0c8', + }, + ], + [ + { + op: 'replace', + path: '/blockTimestamp', + value: '628dc0c8', + note: 'transactions#confirmTransaction - add txReceipt', + timestamp: 1653457115870, + }, + { + op: 'replace', + path: '/txReceipt/transactionIndex', + value: '0', + }, + { + op: 'replace', + path: '/txReceipt/logs/0/transactionIndex', + value: '0', + }, + { + op: 'replace', + path: '/txReceipt/logs/0/logIndex', + value: '0', + }, + { + op: 'replace', + path: '/txReceipt/logs/0/blockNumber', + value: 'a3d19a', + }, + { + op: 'replace', + path: '/txReceipt/cumulativeGasUsed', + value: 'ca21', + }, + { + op: 'replace', + path: '/txReceipt/blockNumber', + value: 'a3d19a', + }, + ], + ], + userFeeLevel: 'custom', + defaultGasEstimates: { + estimateType: 'custom', + gas: '0xea60', + maxFeePerGas: '0x4a817c800', + maxPriorityFeePerGas: '0x4a817c800', + }, + estimatedBaseFee: '16', + nonceDetails: { + params: { + highestLocallyConfirmed: 4, + highestSuggested: 4, + nextNetworkNonce: 4, + }, + local: { + name: 'local', + nonce: 4, + details: { + startPoint: 4, + highest: 4, + }, + }, + network: { + name: 'network', + nonce: 4, + details: { + blockNumber: '0xa3d198', + baseCount: 4, + }, + }, + }, + r: '0xb0f36e4392f9d302351789aef355a2e95b979bcdd99d19026c533152563d3bce', + s: '0x08e59de373e65c9c54e6a8052585461e81409d33178464f9b72f4cc36ac75d40', + v: '0x01', + rawTx: + '0x02f8b104048504a817c8008504a817c80082ea60949ba60bbf4ba1de43f3b4983a539feebfbd5fd97680b844a9059cbb0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000003a98c001a0b0f36e4392f9d302351789aef355a2e95b979bcdd99d19026c533152563d3bcea008e59de373e65c9c54e6a8052585461e81409d33178464f9b72f4cc36ac75d40', + hash: '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', + submittedTime: 1653457092527, + firstRetryBlockNumber: '0xa3d199', + txReceipt: { + blockHash: + '0x243a362e5fda0d6ec8fce3d7f727679148c1df8ec6d7470ff65b38c8a96823b4', + blockNumber: 'a3d19a', + contractAddress: null, + cumulativeGasUsed: 'ca21', + effectiveGasPrice: '0x4a817c800', + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + gasUsed: 'ca21', + logs: [ + { + address: '0x9ba60bbf4ba1de43f3b4983a539feebfbd5fd976', + blockHash: + '0x243a362e5fda0d6ec8fce3d7f727679148c1df8ec6d7470ff65b38c8a96823b4', + blockNumber: 'a3d19a', + data: + '0x0000000000000000000000000000000000000000000000000000000000003a98', + logIndex: '0', + removed: false, + topics: [ + '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', + '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', + '0x0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c970', + ], + transactionHash: + '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', + transactionIndex: '0', + }, + ], + logsBloom: + '0x00000000000000000000000000000000000000000000001000000100000100000000000000000000000000000000000000000000000000000000000000000000000000000020000000000008000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000100000000000000000000000000000000000000000000000000000000000000000000000800000004000000000000001000000000000000', + status: '0x1', + to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', + transactionHash: + '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', + transactionIndex: '0', + type: '0x2', + }, + baseFeePerGas: '0x14', + blockTimestamp: '628dc0c8', + }, + [MOCK_TX_TYPE.TOKEN_METHOD_TRANSFER_FROM]: { + id: 5177046356058754, + time: 1653457323504, + status: 'confirmed', + metamaskNetworkId: '4', + originalGasEstimate: '0x10896', + userEditedGasLimit: false, + chainId: '0x4', + loadingDefaults: false, + dappSuggestedGasFees: null, + sendFlowHistory: [ + { + entry: 'sendFlow - user set asset type to COLLECTIBLE', + timestamp: 1653457317999, + }, + { + entry: 'sendFlow - user set asset symbol to undefined', + timestamp: 1653457318000, + }, + { + entry: + 'sendFlow - user set asset address to 0xf5de760f2e916647fd766B4AD9E85ff943cE3A2b', + timestamp: 1653457318000, + }, + { + entry: + 'sendFlow - user selected transfer to my accounts on recipient screen', + timestamp: 1653457319474, + }, + { + entry: + 'sendFlow - User clicked recipient from my accounts. address: 0xe56e7847fd3661a9b7c86aaf1daea08d9da5750e, nickname Account 1', + timestamp: 1653457320321, + }, + ], + txParams: { + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', + nonce: '0x6', + value: '0x0', + data: + '0x23b872dd000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e000000000000000000000000000000000000000000000000000000000009a7b8', + gas: '0x10896', + maxFeePerGas: '0x59682f12', + maxPriorityFeePerGas: '0x59682f00', + type: '0x2', + }, + origin: 'metamask', + type: 'transferfrom', + history: [ + { + id: 5177046356058754, + time: 1653457323504, + status: 'unapproved', + metamaskNetworkId: '4', + originalGasEstimate: '0x10896', + userEditedGasLimit: false, + chainId: '0x4', + loadingDefaults: true, + dappSuggestedGasFees: null, + sendFlowHistory: [ + { + entry: 'sendFlow - user set asset type to COLLECTIBLE', + timestamp: 1653457317999, + }, + { + entry: 'sendFlow - user set asset symbol to undefined', + timestamp: 1653457318000, + }, + { + entry: + 'sendFlow - user set asset address to 0xf5de760f2e916647fd766B4AD9E85ff943cE3A2b', + timestamp: 1653457318000, + }, + { + entry: + 'sendFlow - user selected transfer to my accounts on recipient screen', + timestamp: 1653457319474, + }, + { + entry: + 'sendFlow - User clicked recipient from my accounts. address: 0xe56e7847fd3661a9b7c86aaf1daea08d9da5750e, nickname Account 1', + timestamp: 1653457320321, + }, + ], + txParams: { + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', + value: '0x0', + data: + '0x23b872dd000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e000000000000000000000000000000000000000000000000000000000009a7b8', + gas: '0x10896', + maxFeePerGas: '0x59682f12', + maxPriorityFeePerGas: '0x59682f00', + type: '0x2', + }, + origin: 'metamask', + type: 'transferfrom', + }, + [ + { + op: 'replace', + path: '/loadingDefaults', + value: false, + note: 'Added new unapproved transaction.', + timestamp: 1653457323593, + }, + { + op: 'add', + path: '/userFeeLevel', + value: 'medium', + }, + { + op: 'add', + path: '/defaultGasEstimates', + value: { + estimateType: 'medium', + gas: '0x10896', + maxFeePerGas: '0x59682f12', + maxPriorityFeePerGas: '0x59682f00', + }, + }, + ], + [ + { + op: 'add', + path: '/estimatedBaseFee', + value: 'd', + note: 'confTx: user approved transaction', + timestamp: 1653457330346, + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'approved', + note: 'txStateManager: setting status to approved', + timestamp: 1653457330347, + }, + ], + [ + { + op: 'add', + path: '/txParams/nonce', + value: '0x6', + note: 'transactions#approveTransaction', + timestamp: 1653457330354, + }, + { + op: 'add', + path: '/nonceDetails', + value: { + params: { + highestLocallyConfirmed: 6, + highestSuggested: 6, + nextNetworkNonce: 6, + }, + local: { + name: 'local', + nonce: 6, + details: { + startPoint: 6, + highest: 6, + }, + }, + network: { + name: 'network', + nonce: 6, + details: { + blockNumber: '0xa3d1a8', + baseCount: 6, + }, + }, + }, + }, + ], + [ + { + op: 'add', + path: '/r', + value: + '0x58294750acbe46cb0dd15ef615a244be49af61f0d799cce68bbbd3d4e7c75cdc', + note: 'transactions#signTransaction: add r, s, v values', + timestamp: 1653457330496, + }, + { + op: 'add', + path: '/s', + value: + '0x3993c38f6e168065d9b20a0b4254697d47db114f57243f56c22f228c7a173f9c', + }, + { + op: 'add', + path: '/v', + value: '0x01', + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'signed', + note: 'txStateManager: setting status to signed', + timestamp: 1653457330497, + }, + ], + [ + { + op: 'add', + path: '/rawTx', + value: + '0x02f8d004068459682f008459682f128301089694f5de760f2e916647fd766b4ad9e85ff943ce3a2b80b86423b872dd000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e000000000000000000000000000000000000000000000000000000000009a7b8c001a058294750acbe46cb0dd15ef615a244be49af61f0d799cce68bbbd3d4e7c75cdca03993c38f6e168065d9b20a0b4254697d47db114f57243f56c22f228c7a173f9c', + note: 'transactions#publishTransaction', + timestamp: 1653457330498, + }, + ], + [ + { + op: 'add', + path: '/hash', + value: + '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', + note: 'transactions#setTxHash', + timestamp: 1653457330596, + }, + ], + [ + { + op: 'add', + path: '/submittedTime', + value: 1653457330597, + note: 'txStateManager - add submitted time stamp', + timestamp: 1653457330597, + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'submitted', + note: 'txStateManager: setting status to submitted', + timestamp: 1653457330598, + }, + ], + [ + { + op: 'replace', + path: '/status', + value: 'confirmed', + note: 'txStateManager: setting status to confirmed', + timestamp: 1653457338358, + }, + { + op: 'add', + path: '/txReceipt', + value: { + blockHash: + '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', + blockNumber: 'a3d1aa', + contractAddress: null, + cumulativeGasUsed: '3c0267', + effectiveGasPrice: '0x59682f0d', + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + gasUsed: '9da4', + logs: [ + { + address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', + blockHash: + '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', + blockNumber: 'a3d1aa', + data: '0x', + logIndex: '21', + removed: false, + topics: [ + '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925', + '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', + '0x0000000000000000000000000000000000000000000000000000000000000000', + '0x000000000000000000000000000000000000000000000000000000000009a7b8', + ], + transactionHash: + '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', + transactionIndex: '11', + }, + { + address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', + blockHash: + '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', + blockNumber: 'a3d1aa', + data: '0x', + logIndex: '22', + removed: false, + topics: [ + '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', + '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', + '0x000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e', + '0x000000000000000000000000000000000000000000000000000000000009a7b8', + ], + transactionHash: + '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', + transactionIndex: '11', + }, + ], + logsBloom: + '0x00000000000000000000000000000000000000008000000000000000000100000000000000000000000000000000000000000000000000000000008000200000000000000000000000000008000000000000000000008000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000010000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000002504000000100000000000020000000000000000000000000000020000010000000000000000000000400000000000000000000001000000000000000', + status: '0x1', + to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', + transactionHash: + '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', + transactionIndex: '11', + type: '0x2', + }, + }, + { + op: 'add', + path: '/baseFeePerGas', + value: '0xd', + }, + { + op: 'add', + path: '/blockTimestamp', + value: '628dc1b8', + }, + ], + [ + { + op: 'replace', + path: '/blockTimestamp', + value: '628dc1b8', + note: 'transactions#confirmTransaction - add txReceipt', + timestamp: 1653457338377, + }, + { + op: 'replace', + path: '/txReceipt/transactionIndex', + value: '11', + }, + { + op: 'replace', + path: '/txReceipt/logs/1/transactionIndex', + value: '11', + }, + { + op: 'replace', + path: '/txReceipt/logs/1/logIndex', + value: '22', + }, + { + op: 'replace', + path: '/txReceipt/logs/1/blockNumber', + value: 'a3d1aa', + }, + { + op: 'replace', + path: '/txReceipt/logs/0/transactionIndex', + value: '11', + }, + { + op: 'replace', + path: '/txReceipt/logs/0/logIndex', + value: '21', + }, + { + op: 'replace', + path: '/txReceipt/logs/0/blockNumber', + value: 'a3d1aa', + }, + { + op: 'replace', + path: '/txReceipt/cumulativeGasUsed', + value: '3c0267', + }, + { + op: 'replace', + path: '/txReceipt/blockNumber', + value: 'a3d1aa', + }, + ], + ], + userFeeLevel: 'medium', + defaultGasEstimates: { + estimateType: 'medium', + gas: '0x10896', + maxFeePerGas: '0x59682f12', + maxPriorityFeePerGas: '0x59682f00', + }, + estimatedBaseFee: 'd', + nonceDetails: { + params: { + highestLocallyConfirmed: 6, + highestSuggested: 6, + nextNetworkNonce: 6, + }, + local: { + name: 'local', + nonce: 6, + details: { + startPoint: 6, + highest: 6, + }, + }, + network: { + name: 'network', + nonce: 6, + details: { + blockNumber: '0xa3d1a8', + baseCount: 6, + }, + }, + }, + r: '0x58294750acbe46cb0dd15ef615a244be49af61f0d799cce68bbbd3d4e7c75cdc', + s: '0x3993c38f6e168065d9b20a0b4254697d47db114f57243f56c22f228c7a173f9c', + v: '0x01', + rawTx: + '0x02f8d004068459682f008459682f128301089694f5de760f2e916647fd766b4ad9e85ff943ce3a2b80b86423b872dd000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e000000000000000000000000000000000000000000000000000000000009a7b8c001a058294750acbe46cb0dd15ef615a244be49af61f0d799cce68bbbd3d4e7c75cdca03993c38f6e168065d9b20a0b4254697d47db114f57243f56c22f228c7a173f9c', + hash: '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', + submittedTime: 1653457330597, + txReceipt: { + blockHash: + '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', + blockNumber: 'a3d1aa', + contractAddress: null, + cumulativeGasUsed: '3c0267', + effectiveGasPrice: '0x59682f0d', + from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', + gasUsed: '9da4', + logs: [ + { + address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', + blockHash: + '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', + blockNumber: 'a3d1aa', + data: '0x', + logIndex: '21', + removed: false, + topics: [ + '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925', + '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', + '0x0000000000000000000000000000000000000000000000000000000000000000', + '0x000000000000000000000000000000000000000000000000000000000009a7b8', + ], + transactionHash: + '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', + transactionIndex: '11', + }, + { + address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', + blockHash: + '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', + blockNumber: 'a3d1aa', + data: '0x', + logIndex: '22', + removed: false, + topics: [ + '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', + '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', + '0x000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e', + '0x000000000000000000000000000000000000000000000000000000000009a7b8', + ], + transactionHash: + '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', + transactionIndex: '11', + }, + ], + logsBloom: + '0x00000000000000000000000000000000000000008000000000000000000100000000000000000000000000000000000000000000000000000000008000200000000000000000000000000008000000000000000000008000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000010000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000002504000000100000000000020000000000000000000000000000020000010000000000000000000000400000000000000000000001000000000000000', + status: '0x1', + to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', + transactionHash: + '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', + transactionIndex: '11', + type: '0x2', + }, + baseFeePerGas: '0xd', + blockTimestamp: '628dc1b8', + }, +}; diff --git a/ui/components/app/transaction-list-item/transaction-list-item.stories.js b/ui/components/app/transaction-list-item/transaction-list-item.stories.js new file mode 100644 index 000000000..0d030310a --- /dev/null +++ b/ui/components/app/transaction-list-item/transaction-list-item.stories.js @@ -0,0 +1,210 @@ +import React from 'react'; +import { + TRANSACTION_STATUSES, + TRANSACTION_TYPES, +} from '../../../../shared/constants/transaction'; +import { MOCK_TRANSACTION_BY_TYPE } from '../../../../.storybook/initial-states/transactions'; +import TransactionListItem from '.'; + +/** + * @typedef {(import('../../selectors/transactions').TransactionGroup} TransactionGroup + */ + +/** + * @param {Object} args + * @returns {TransactionGroup} + */ +const getMockTransactionGroup = (args) => { + const status = args['transactionGroup.primaryTransaction.status']; + const tx = { + ...args['transactionGroup.primaryTransaction'], + status, + submittedTime: args['transactionGroup.primaryTransaction.submittedTime'], + }; + + return { + hasCancelled: args['transactionGroup.hasCancelled'], + hasRetried: args['transactionGroup.hasRetried'], + nonce: '0x1', + initialTransaction: tx, + primaryTransaction: tx, + transactions: [tx], + }; +}; + +/** + * Transaction List Item Storybook Page + * + * Each page displays a different Transaction Type (TRANSACTION_TYPES) + * except TRANSACTION_TYPES.CANCEL and TRANSACTION_TYPES.RETRY as these two types + * are never initialTransactions + */ +export default { + title: 'Components/App/TransactionListItem', + id: __filename, + argTypes: { + isEarliestNonce: { control: 'boolean' }, + 'transactionGroup.hasCancelled': { control: 'boolean' }, + 'transactionGroup.hasRetried': { control: 'boolean' }, + 'transactionGroup.primaryTransaction.status': { + options: Object.values(TRANSACTION_STATUSES) + .filter((status) => { + return status !== TRANSACTION_STATUSES.SIGNED; + }) + .sort(), + control: { type: 'select' }, + }, + 'transactionGroup.primaryTransaction.submittedTime': { control: 'number' }, + 'transactionGroup.primaryTransaction': { control: 'object' }, + }, + args: { + isEarliestNonce: true, + 'transactionGroup.hasCancelled': false, + 'transactionGroup.hasRetried': false, + 'transactionGroup.primaryTransaction.status': TRANSACTION_STATUSES.PENDING, + 'transactionGroup.primaryTransaction.submittedTime': 19999999999999, + }, +}; + +const Template = (args) => { + const transactionGroup = getMockTransactionGroup(args); + return ( + + ); +}; + +export const ContractInteraction = Template.bind({}); +export const DeployContract = Template.bind({}); +export const EthDecrypt = Template.bind({}); +export const EthGetEncryptionPublicKey = Template.bind({}); +export const Incoming = Template.bind({}); +export const PersonalSign = Template.bind({}); +export const Sign = Template.bind({}); +export const SignTypeData = Template.bind({}); +export const SimpleSend = Template.bind({}); +export const Smart = Template.bind({}); +export const Swap = Template.bind({}); +export const SwapApproval = Template.bind({}); +export const TokenMethodApprove = Template.bind({}); +export const TokenMethodSafeTransferFrom = Template.bind({}); +export const TokenMethodTransfer = Template.bind({}); +export const TokenMethodTransferFrom = Template.bind({}); + +ContractInteraction.storyName = 'contractInteraction'; +ContractInteraction.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.CONTRACT_INTERACTION], + }, +}; + +DeployContract.storyName = 'contractDeployment'; +DeployContract.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.DEPLOY_CONTRACT], + }, +}; + +EthDecrypt.storyName = 'eth_decrypt'; +EthDecrypt.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.ETH_DECRYPT], + }, +}; + +EthGetEncryptionPublicKey.storyName = 'eth_getEncryptionPublicKey'; +EthGetEncryptionPublicKey.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[ + TRANSACTION_TYPES.ETH_GET_ENCRYPTION_PUBLIC_KEY + ], + }, +}; + +Incoming.storyName = 'incoming'; +Incoming.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.INCOMING], + }, +}; + +PersonalSign.storyName = 'personal_sign'; +PersonalSign.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.PERSONAL_SIGN], + }, +}; + +Sign.storyName = 'eth_sign'; +Sign.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.SIGN], + }, +}; + +SignTypeData.storyName = 'eth_signTypedData'; +SignTypeData.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.SIGN_TYPED_DATA], + }, +}; + +SimpleSend.storyName = 'simpleSend'; +SimpleSend.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.SIMPLE_SEND], + }, +}; + +Smart.storyName = 'smart'; +Smart.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.SMART], + }, +}; + +Swap.storyName = 'swap'; +Swap.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.SWAP], + }, +}; + +SwapApproval.storyName = 'swapApproval'; +SwapApproval.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.SWAP_APPROVAL], + }, +}; + +TokenMethodApprove.storyName = 'approve'; +TokenMethodApprove.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.TOKEN_METHOD_APPROVE], + }, +}; + +TokenMethodSafeTransferFrom.storyName = 'safetransferfrom'; +TokenMethodSafeTransferFrom.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[ + TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM + ], + }, +}; + +TokenMethodTransfer.storyName = 'transfer'; +TokenMethodTransfer.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER], + }, +}; + +TokenMethodTransferFrom.storyName = 'transferfrom'; +TokenMethodTransferFrom.args = { + 'transactionGroup.primaryTransaction': { + ...MOCK_TRANSACTION_BY_TYPE[TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM], + }, +}; From d6dc1b0c578b699db80d1176226dd71cd3a5c8be Mon Sep 17 00:00:00 2001 From: George Marshall Date: Fri, 3 Jun 2022 11:42:48 -0700 Subject: [PATCH 097/127] Updating some more instances (#14851) --- app/_locales/tr/messages.json | 2 +- test/e2e/tests/from-import-ui.spec.js | 2 +- test/e2e/tests/metamask-responsive-ui.spec.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 53085daa9..89cc48b77 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -3498,7 +3498,7 @@ "message": "Hesaplarınızı ve bilgilerinizi mobil cihazınızla senkronize edebilirsiniz. MetaMask mobil uygulamasını açın, \"Ayarlar\" kısmına gidin ve \"Tarayıcı Uzantısından Senkronize Et\" seçeneğine dokunun" }, "syncWithMobileDescNewUsers": { - "message": "Metamask Mobil uygulamasını ilk defa açıyorsanız telefonunuzdaki adımları izleyin." + "message": "MetaMask Mobil uygulamasını ilk defa açıyorsanız telefonunuzdaki adımları izleyin." }, "syncWithMobileScanThisCode": { "message": "MetaMask mobil uygulamanızla bu kodu tarayın" diff --git a/test/e2e/tests/from-import-ui.spec.js b/test/e2e/tests/from-import-ui.spec.js index 2b812e66d..41c63ccb1 100644 --- a/test/e2e/tests/from-import-ui.spec.js +++ b/test/e2e/tests/from-import-ui.spec.js @@ -9,7 +9,7 @@ const { completeImportSRPOnboardingFlowWordByWord, } = require('../helpers'); -describe('Metamask Import UI', function () { +describe('MetaMask Import UI', function () { it('Importing wallet using Secret Recovery Phrase', async function () { const ganacheOptions = { accounts: [ diff --git a/test/e2e/tests/metamask-responsive-ui.spec.js b/test/e2e/tests/metamask-responsive-ui.spec.js index 8daa2024f..e51c449de 100644 --- a/test/e2e/tests/metamask-responsive-ui.spec.js +++ b/test/e2e/tests/metamask-responsive-ui.spec.js @@ -2,7 +2,7 @@ const { strict: assert } = require('assert'); const { convertToHexValue, withFixtures, tinyDelayMs } = require('../helpers'); const enLocaleMessages = require('../../../app/_locales/en/messages.json'); -describe('Metamask Responsive UI', function () { +describe('MetaMask Responsive UI', function () { it('Creating a new wallet', async function () { const driverOptions = { responsive: true }; From db519a8cff07ff5d9f43774d82cbf0b9feb671d9 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 3 Jun 2022 16:21:21 -0230 Subject: [PATCH 098/127] Update minimist from v1.2.5 to v1.2.6 (#14850) This addresses a security advisory. --- package.json | 8 ++++---- yarn.lock | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 6b0f134d0..b4333cdd0 100644 --- a/package.json +++ b/package.json @@ -79,9 +79,9 @@ "**/cross-fetch": "^3.1.5", "**/configstore/dot-prop": "^5.1.1", "**/ethers/elliptic": "^6.5.4", - "**/knex/minimist": "^1.2.5", - "**/optimist/minimist": "^1.2.5", - "**/socketcluster/minimist": "^1.2.5", + "**/knex/minimist": "^1.2.6", + "**/optimist/minimist": "^1.2.6", + "**/socketcluster/minimist": "^1.2.6", "**/redux/symbol-observable": "^2.0.3", "**/redux-devtools-instrument/symbol-observable": "^2.0.3", "**/rxjs/symbol-observable": "^2.0.3", @@ -335,7 +335,7 @@ "lavamoat-viz": "^6.0.9", "lockfile-lint": "^4.0.0", "loose-envify": "^1.4.0", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "mocha": "^7.2.0", "mockttp": "^2.6.0", "nock": "^9.0.14", diff --git a/yarn.lock b/yarn.lock index cd2a06003..8cf1a3f9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18770,10 +18770,10 @@ minimist-options@^4.0.2: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== minipass-collect@^1.0.2: version "1.0.2" From 01665754057ac92617ad20ced05b851dd1b457bf Mon Sep 17 00:00:00 2001 From: Victor Korzunin <5180700+floydspace@users.noreply.github.com> Date: Fri, 3 Jun 2022 21:16:44 +0200 Subject: [PATCH 099/127] fix: keep lock button text inside button boundaries (#14335) Co-authored-by: David Walsh --- ui/components/app/account-menu/index.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/components/app/account-menu/index.scss b/ui/components/app/account-menu/index.scss index c8b512ddf..11326f822 100644 --- a/ui/components/app/account-menu/index.scss +++ b/ui/components/app/account-menu/index.scss @@ -106,8 +106,9 @@ & &__lock-button { @include H7; - padding: 3.5px 5px; - width: 59px; + padding: 0.25rem 0.5rem; + min-width: 59px; + width: auto; } &__accounts-container { From c18c3b078e45a162a00214cca4bf3836d8270d7d Mon Sep 17 00:00:00 2001 From: George Marshall Date: Fri, 3 Jun 2022 12:45:03 -0700 Subject: [PATCH 100/127] Updating icon color (#14835) --- ui/components/app/collectibles-items/collectibles-items.js | 6 +++++- ui/components/app/collectibles-items/index.scss | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/components/app/collectibles-items/collectibles-items.js b/ui/components/app/collectibles-items/collectibles-items.js index 1027cda9f..15e45b434 100644 --- a/ui/components/app/collectibles-items/collectibles-items.js +++ b/ui/components/app/collectibles-items/collectibles-items.js @@ -168,7 +168,11 @@ export default function CollectiblesItems({
    - +
    diff --git a/ui/components/app/collectibles-items/index.scss b/ui/components/app/collectibles-items/index.scss index a2dc0dd58..7087ac481 100644 --- a/ui/components/app/collectibles-items/index.scss +++ b/ui/components/app/collectibles-items/index.scss @@ -47,5 +47,9 @@ height: 100%; cursor: pointer; } + + &__icon-chevron { + color: var(--color-icon-default); + } } } From 250b3d549994e702ad8bf60156f3b3355d6db808 Mon Sep 17 00:00:00 2001 From: ryanml Date: Fri, 3 Jun 2022 15:41:05 -0700 Subject: [PATCH 101/127] Fixing add recipient flow issue with contact list/recent recipients (#14771) --- .../add-recipient/add-recipient.component.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 a46fa7a8b..fa2dbbfef 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 @@ -208,9 +208,13 @@ export default class AddRecipient extends Component { addressBook={addressBook} searchForContacts={this.searchForContacts.bind(this)} searchForRecents={this.searchForRecents.bind(this)} - selectRecipient={(address, name) => - this.selectRecipient(address, name, 'contact list') - } + selectRecipient={(address, name) => { + this.selectRecipient( + address, + name, + `${name ? 'contact' : 'recent'} list`, + ); + }} > {ownedAccounts && ownedAccounts.length > 1 && !userInput && ( + +

    + ${t('stillGettingMessage')} + + ${t('sendBugReport')} + +

    + + `; +} diff --git a/ui/helpers/utils/error-utils.test.js b/ui/helpers/utils/error-utils.test.js new file mode 100644 index 000000000..84aa05508 --- /dev/null +++ b/ui/helpers/utils/error-utils.test.js @@ -0,0 +1,49 @@ +import { SUPPORT_LINK } from '../constants/common'; +import { getErrorHtml } from './error-utils'; +import { fetchLocale } from './i18n-helper'; + +jest.mock('./i18n-helper', () => ({ + fetchLocale: jest.fn(), + loadRelativeTimeFormatLocaleData: jest.fn(), +})); + +describe('Error utils Tests', () => { + it('should get error html', async () => { + const mockStore = { + localeMessages: { + current: { + troubleStarting: { + message: + 'MetaMask had trouble starting. This error could be intermittent, so try restarting the extension.', + }, + restartMetamask: { + message: 'Restart MetaMask', + }, + stillGettingMessage: { + message: 'Still getting this message?', + }, + sendBugReport: { + message: 'Send us a bug report.', + }, + }, + }, + metamask: { + currentLocale: 'en', + }, + }; + + fetchLocale.mockReturnValue(mockStore.localeMessages.current); + const errorHtml = await getErrorHtml(SUPPORT_LINK, mockStore.metamask); + const currentLocale = mockStore.localeMessages.current; + const troubleStartingMessage = currentLocale.troubleStarting.message; + const restartMetamaskMessage = currentLocale.restartMetamask.message; + const stillGettingMessageMessage = + currentLocale.stillGettingMessage.message; + const sendBugReportMessage = currentLocale.sendBugReport.message; + + expect(errorHtml).toContain(troubleStartingMessage); + expect(errorHtml).toContain(restartMetamaskMessage); + expect(errorHtml).toContain(stillGettingMessageMessage); + expect(errorHtml).toContain(sendBugReportMessage); + }); +}); diff --git a/ui/index.js b/ui/index.js index 5c90d00a1..be61e7c9c 100644 --- a/ui/index.js +++ b/ui/index.js @@ -1,6 +1,6 @@ import copyToClipboard from 'copy-to-clipboard'; import log from 'loglevel'; -import { clone } from 'lodash'; +import { clone, memoize } from 'lodash'; import React from 'react'; import { render } from 'react-dom'; import browser from 'webextension-polyfill'; @@ -36,7 +36,7 @@ export default function launchMetamaskUi(opts, cb) { // check if we are unlocked first backgroundConnection.getState(function (err, metamaskState) { if (err) { - cb(err); + cb(err, metamaskState); return; } startApp(metamaskState, backgroundConnection, opts).then((store) => { @@ -46,21 +46,31 @@ export default function launchMetamaskUi(opts, cb) { }); } +const _setupLocale = async (currentLocale) => { + const currentLocaleMessages = currentLocale + ? await fetchLocale(currentLocale) + : {}; + const enLocaleMessages = await fetchLocale('en'); + + await loadRelativeTimeFormatLocaleData('en'); + if (currentLocale) { + await loadRelativeTimeFormatLocaleData(currentLocale); + } + + return { currentLocaleMessages, enLocaleMessages }; +}; + +export const setupLocale = memoize(_setupLocale); + async function startApp(metamaskState, backgroundConnection, opts) { // parse opts if (!metamaskState.featureFlags) { metamaskState.featureFlags = {}; } - const currentLocaleMessages = metamaskState.currentLocale - ? await fetchLocale(metamaskState.currentLocale) - : {}; - const enLocaleMessages = await fetchLocale('en'); - - await loadRelativeTimeFormatLocaleData('en'); - if (metamaskState.currentLocale) { - await loadRelativeTimeFormatLocaleData(metamaskState.currentLocale); - } + const { currentLocaleMessages, enLocaleMessages } = await setupLocale( + metamaskState.currentLocale, + ); if (metamaskState.textDirection === 'rtl') { await switchDirection('rtl'); diff --git a/ui/index.test.js b/ui/index.test.js new file mode 100644 index 000000000..9cb44c025 --- /dev/null +++ b/ui/index.test.js @@ -0,0 +1,70 @@ +import { setupLocale } from '.'; + +const enMessages = { + troubleStarting: { + message: + 'MetaMask had trouble starting. This error could be intermittent, so try restarting the extension.', + }, + restartMetamask: { + message: 'Restart MetaMask', + }, + stillGettingMessage: { + message: 'Still getting this message?', + }, + sendBugReport: { + message: 'Send us a bug report.', + }, +}; + +const esMessages = { + troubleStarting: { + message: + 'MetaMask tuvo problemas para iniciarse. Este error podría ser intermitente, así que intente reiniciar la extensión.', + }, + restartMetamask: { + message: 'Reiniciar metamáscara', + }, + sendBugReport: { + message: 'Envíenos un informe de errores.', + }, +}; + +jest.mock('./helpers/utils/i18n-helper', () => ({ + fetchLocale: jest.fn((locale) => (locale === 'en' ? enMessages : esMessages)), + loadRelativeTimeFormatLocaleData: jest.fn(), +})); + +describe('Index Tests', () => { + it('should get locale messages by calling setupLocale', async () => { + let result = await setupLocale('en'); + const { currentLocaleMessages: clm, enLocaleMessages: elm } = result; + expect(clm).toBeDefined(); + expect(elm).toBeDefined(); + expect(clm.troubleStarting).toStrictEqual(enMessages.troubleStarting); + + expect(clm.restartMetamask).toStrictEqual(enMessages.restartMetamask); + + expect(clm.stillGettingMessage).toStrictEqual( + enMessages.stillGettingMessage, + ); + + expect(clm.sendBugReport).toStrictEqual(enMessages.sendBugReport); + + result = await setupLocale('es'); + + const { currentLocaleMessages: clm2, enLocaleMessages: elm2 } = result; + expect(clm2).toBeDefined(); + expect(elm2).toBeDefined(); + + expect(clm2.troubleStarting).toStrictEqual(esMessages.troubleStarting); + + expect(clm2.restartMetamask).toStrictEqual(esMessages.restartMetamask); + + expect(clm2.stillGettingMessage).toBeUndefined(); + expect(elm2.stillGettingMessage).toStrictEqual( + enMessages.stillGettingMessage, + ); + + expect(clm2.sendBugReport).toStrictEqual(esMessages.sendBugReport); + }); +}); From b0557daa055dc0086fe06815e8c334db6fdef32f Mon Sep 17 00:00:00 2001 From: Daniel <80175477+dan437@users.noreply.github.com> Date: Wed, 8 Jun 2022 16:32:04 +0200 Subject: [PATCH 110/127] Handle an RPC provider delay in Swaps (#14821) * Return an estimated amount for a completed swap if an RPC provider has a delay * Create a recursive function for updating post tx balance * Add a few tests for the "getSwapsTokensReceivedFromTxMeta" fn * Trigger Build --- app/scripts/controllers/transactions/index.js | 73 +++++++----- ui/pages/swaps/swaps.util.js | 6 + ui/pages/swaps/swaps.util.test.js | 104 ++++++++++++++++++ 3 files changed, 153 insertions(+), 30 deletions(-) diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 0a0d720d5..0818fc894 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -41,6 +41,7 @@ import { PRIORITY_LEVELS, } from '../../../../shared/constants/gas'; import { decGWEIToHexWEI } from '../../../../shared/modules/conversion.utils'; +import { isSwapsDefaultTokenAddress } from '../../../../shared/modules/swaps.utils'; import { EVENT } from '../../../../shared/constants/metametrics'; import { HARDFORKS, @@ -60,6 +61,7 @@ import PendingTransactionTracker from './pending-tx-tracker'; import * as txUtils from './lib/util'; const MAX_MEMSTORE_TX_LIST_SIZE = 100; // Number of transactions (by unique nonces) to keep in memory +const UPDATE_POST_TX_BALANCE_TIMEOUT = 5000; const SWAP_TRANSACTION_TYPES = [ TRANSACTION_TYPES.SWAP, @@ -1465,6 +1467,39 @@ export default class TransactionController extends EventEmitter { this._trackTransactionMetricsEvent(txMeta, TRANSACTION_EVENTS.SUBMITTED); } + async updatePostTxBalance({ txMeta, txId, numberOfAttempts = 6 }) { + const postTxBalance = await this.query.getBalance(txMeta.txParams.from); + const latestTxMeta = this.txStateManager.getTransaction(txId); + const approvalTxMeta = latestTxMeta.approvalTxId + ? this.txStateManager.getTransaction(latestTxMeta.approvalTxId) + : null; + latestTxMeta.postTxBalance = postTxBalance.toString(16); + const isDefaultTokenAddress = isSwapsDefaultTokenAddress( + txMeta.destinationTokenAddress, + txMeta.chainId, + ); + if ( + isDefaultTokenAddress && + txMeta.preTxBalance === latestTxMeta.postTxBalance && + numberOfAttempts > 0 + ) { + setTimeout(() => { + // If postTxBalance is the same as preTxBalance, try it again. + this.updatePostTxBalance({ + txMeta, + txId, + numberOfAttempts: numberOfAttempts - 1, + }); + }, UPDATE_POST_TX_BALANCE_TIMEOUT); + } else { + this.txStateManager.updateTransaction( + latestTxMeta, + 'transactions#confirmTransaction - add postTxBalance', + ); + this._trackSwapsMetrics(latestTxMeta, approvalTxMeta); + } + } + /** * Sets the status of the transaction to confirmed and sets the status of nonce duplicates as * dropped if the txParams have data it will fetch the txReceipt @@ -1528,21 +1563,10 @@ export default class TransactionController extends EventEmitter { ); if (txMeta.type === TRANSACTION_TYPES.SWAP) { - const postTxBalance = await this.query.getBalance(txMeta.txParams.from); - const latestTxMeta = this.txStateManager.getTransaction(txId); - - const approvalTxMeta = latestTxMeta.approvalTxId - ? this.txStateManager.getTransaction(latestTxMeta.approvalTxId) - : null; - - latestTxMeta.postTxBalance = postTxBalance.toString(16); - - this.txStateManager.updateTransaction( - latestTxMeta, - 'transactions#confirmTransaction - add postTxBalance', - ); - - this._trackSwapsMetrics(latestTxMeta, approvalTxMeta); + await this.updatePostTxBalance({ + txMeta, + txId, + }); } } catch (err) { log.error(err); @@ -1600,21 +1624,10 @@ export default class TransactionController extends EventEmitter { ); if (txMeta.type === TRANSACTION_TYPES.SWAP) { - const postTxBalance = await this.query.getBalance(txMeta.txParams.from); - const latestTxMeta = this.txStateManager.getTransaction(txId); - - const approvalTxMeta = latestTxMeta.approvalTxId - ? this.txStateManager.getTransaction(latestTxMeta.approvalTxId) - : null; - - latestTxMeta.postTxBalance = postTxBalance.toString(16); - - this.txStateManager.updateTransaction( - latestTxMeta, - 'transactions#confirmTransaction - add postTxBalance', - ); - - this._trackSwapsMetrics(latestTxMeta, approvalTxMeta); + await this.updatePostTxBalance({ + txMeta, + txId, + }); } } catch (err) { log.error(err); diff --git a/ui/pages/swaps/swaps.util.js b/ui/pages/swaps/swaps.util.js index 446e6eff5..ec12cc6f9 100644 --- a/ui/pages/swaps/swaps.util.js +++ b/ui/pages/swaps/swaps.util.js @@ -758,6 +758,12 @@ export function getSwapsTokensReceivedFromTxMeta( return null; } + if (txMeta.swapMetaData && txMeta.preTxBalance === txMeta.postTxBalance) { + // If preTxBalance and postTxBalance are equal, postTxBalance hasn't been updated on time + // because of the RPC provider delay, so we return an estimated receiving amount instead. + return txMeta.swapMetaData.token_to_amount; + } + let approvalTxGasCost = '0x0'; if (approvalTxMeta && approvalTxMeta.txReceipt) { approvalTxGasCost = calcGasTotal( diff --git a/ui/pages/swaps/swaps.util.test.js b/ui/pages/swaps/swaps.util.test.js index 0aaa2345f..8abff8171 100644 --- a/ui/pages/swaps/swaps.util.test.js +++ b/ui/pages/swaps/swaps.util.test.js @@ -8,6 +8,7 @@ import { RINKEBY_CHAIN_ID, KOVAN_CHAIN_ID, AVALANCHE_CHAIN_ID, + ETH_SYMBOL, } from '../../../shared/constants/network'; import { SWAPS_CHAINID_CONTRACT_ADDRESS_MAP, @@ -39,6 +40,7 @@ import { countDecimals, shouldEnableDirectWrapping, showRemainingTimeInMinAndSec, + getSwapsTokensReceivedFromTxMeta, } from './swaps.util'; jest.mock('../../helpers/utils/storage-helpers.js', () => ({ @@ -567,4 +569,106 @@ describe('Swaps Util', () => { expect(true).toBe(true); }); }); + + describe('getSwapsTokensReceivedFromTxMeta', () => { + const createProps = () => { + return { + tokenSymbol: ETH_SYMBOL, + txMeta: { + swapMetaData: { + token_to_amount: 5, + }, + txReceipt: { + status: '0x0', + }, + preTxBalance: '8b11', + postTxBalance: '8b11', + }, + tokenAddress: '0x881d40237659c251811cec9c364ef91234567890', + accountAddress: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', + tokenDecimals: 6, + approvalTxMeta: null, + chainId: MAINNET_CHAIN_ID, + }; + }; + + it('returns an estimated amount if preTxBalance and postTxBalance are the same for ETH', () => { + const props = createProps(); + expect( + getSwapsTokensReceivedFromTxMeta( + props.tokenSymbol, + props.txMeta, + props.tokenAddress, + props.accountAddress, + props.tokenDecimals, + props.approvalTxMeta, + props.chainId, + ), + ).toBe(props.txMeta.swapMetaData.token_to_amount); + }); + + it('returns null if there is no txMeta', () => { + const props = createProps(); + props.txMeta = undefined; + expect( + getSwapsTokensReceivedFromTxMeta( + props.tokenSymbol, + props.txMeta, + props.tokenAddress, + props.accountAddress, + props.tokenDecimals, + props.approvalTxMeta, + props.chainId, + ), + ).toBeNull(); + }); + + it('returns null if there is no txMeta.txReceipt', () => { + const props = createProps(); + props.txMeta.txReceipt = undefined; + expect( + getSwapsTokensReceivedFromTxMeta( + props.tokenSymbol, + props.txMeta, + props.tokenAddress, + props.accountAddress, + props.tokenDecimals, + props.approvalTxMeta, + props.chainId, + ), + ).toBeNull(); + }); + + it('returns null if there is no txMeta.postTxBalance', () => { + const props = createProps(); + props.txMeta.postTxBalance = undefined; + expect( + getSwapsTokensReceivedFromTxMeta( + props.tokenSymbol, + props.txMeta, + props.tokenAddress, + props.accountAddress, + props.tokenDecimals, + props.approvalTxMeta, + props.chainId, + ), + ).toBeNull(); + }); + + it('returns null if there is no txMeta.preTxBalance', () => { + const props = createProps(); + props.txMeta.preTxBalance = undefined; + expect( + getSwapsTokensReceivedFromTxMeta( + props.tokenSymbol, + props.txMeta, + props.tokenAddress, + props.accountAddress, + props.tokenDecimals, + props.approvalTxMeta, + props.chainId, + ), + ).toBeNull(); + }); + }); }); From e546e137dec65fe53d8a96796ad123155a32932d Mon Sep 17 00:00:00 2001 From: Bowen Sanders Date: Wed, 8 Jun 2022 19:07:41 +0000 Subject: [PATCH 111/127] Create e2e test for snap in-app notification (#14894) * Create e2e test for snaps in-app notification * replaced xpath selectors * fixed description --- test/e2e/snaps/enums.js | 2 +- test/e2e/snaps/test-snap-notification.spec.js | 110 ++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 test/e2e/snaps/test-snap-notification.spec.js diff --git a/test/e2e/snaps/enums.js b/test/e2e/snaps/enums.js index 8906b38d8..66d100051 100644 --- a/test/e2e/snaps/enums.js +++ b/test/e2e/snaps/enums.js @@ -1,3 +1,3 @@ module.exports = { - TEST_SNAPS_WEBSITE_URL: 'https://metamask.github.io/test-snaps/0.3.0', + TEST_SNAPS_WEBSITE_URL: 'https://metamask.github.io/test-snaps/0.4.0', }; diff --git a/test/e2e/snaps/test-snap-notification.spec.js b/test/e2e/snaps/test-snap-notification.spec.js new file mode 100644 index 000000000..01359cf84 --- /dev/null +++ b/test/e2e/snaps/test-snap-notification.spec.js @@ -0,0 +1,110 @@ +const { strict: assert } = require('assert'); +const { withFixtures } = require('../helpers'); +const { PAGES } = require('../webdriver/driver'); +const { TEST_SNAPS_WEBSITE_URL } = require('./enums'); + +describe('Test Snap Notification', function () { + it('can send 1 correctly read inapp notification', async function () { + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: 25000000000000000000, + }, + ], + }; + await withFixtures( + { + fixtures: 'imported-account', + ganacheOptions, + title: this.test.title, + driverOptions: { + type: 'flask', + }, + }, + async ({ driver }) => { + await driver.navigate(); + + // enter pw into extension + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // navigate to test snaps page and connect + await driver.driver.get(TEST_SNAPS_WEBSITE_URL); + await driver.fill('.snapId5', 'npm:@metamask/test-snap-notification'); + await driver.clickElement({ + text: 'Connect Notification Snap', + tag: 'button', + }); + + // switch to metamask extension and click connect + await driver.waitUntilXWindowHandles(2, 5000, 10000); + let windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + await driver.clickElement( + { + text: 'Connect', + tag: 'button', + }, + 10000, + ); + await driver.delay(2000); + + // approve install of snap + await driver.waitUntilXWindowHandles(2, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle( + 'MetaMask Notification', + windowHandles, + ); + await driver.clickElement({ + text: 'Approve & Install', + tag: 'button', + }); + + // click send inputs on test snap page + await driver.waitUntilXWindowHandles(1, 5000, 10000); + windowHandles = await driver.getAllWindowHandles(); + await driver.switchToWindowWithTitle('Test Snaps', windowHandles); + await driver.clickElement({ + text: 'Send InApp Notification', + tag: 'button', + }); + + // try to go to the MM pages + await driver.navigate(PAGES.HOME); + await driver.delay(1500); + + // check to see that there is one notification + const notificationResult = await driver.findElement( + '.account-menu__icon__notification-count', + ); + assert.equal(await notificationResult.getText(), '1'); + + // try to click on the account menu icon (via xpath) + await driver.clickElement('.account-menu__icon'); + await driver.delay(500); + + // try to click on the notification item (via xpath) + await driver.clickElement({ + text: 'Notifications', + tag: 'div', + }); + await driver.delay(500); + + // look for the correct text in notifications (via xpath) + const notificationResultMessage = await driver.findElement( + '.notifications__item__details__message', + ); + assert.equal( + await notificationResultMessage.getText(), + 'TEST INAPP NOTIFICATION', + ); + }, + ); + }); +}); From 54e83d659d6278afab94bc8ce1afe39957894018 Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 8 Jun 2022 15:56:14 -0700 Subject: [PATCH 112/127] Fix padding issue in Edit Nickname screen (#14842) Co-authored-by: David Walsh --- ui/components/ui/update-nickname-popover/index.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/ui/update-nickname-popover/index.scss b/ui/components/ui/update-nickname-popover/index.scss index a3684a68f..21a7736f4 100644 --- a/ui/components/ui/update-nickname-popover/index.scss +++ b/ui/components/ui/update-nickname-popover/index.scss @@ -24,7 +24,7 @@ } &__content { - padding: 0 20px 20px 20px; + padding: 0 18px 20px 18px; position: relative; &__indenticon { From 78682ea9d29e673b4a5ab4a3705d0e27536d42a6 Mon Sep 17 00:00:00 2001 From: Alex Donesky Date: Wed, 8 Jun 2022 20:07:43 -0500 Subject: [PATCH 113/127] fix lavamoat policy files for drag and drop package (#14901) --- lavamoat/browserify/beta/policy.json | 5 ++++- lavamoat/browserify/flask/policy.json | 3 +++ lavamoat/browserify/main/policy.json | 3 +++ lavamoat/browserify/policy-override.json | 7 +++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 1a9534d04..5249bd797 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -6176,10 +6176,13 @@ "react-dnd-html5-backend": { "globals": { "Image": true, + "addEventListener": true, + "clearTimeout": true, "console.warn": true, "devicePixelRatio": true, "document": true, "navigator.userAgent": true, + "removeEventListener": true, "safari": true, "setTimeout": true } @@ -6726,4 +6729,4 @@ } } } -} \ No newline at end of file +} diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 1a9534d04..1d70e3142 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -6176,10 +6176,13 @@ "react-dnd-html5-backend": { "globals": { "Image": true, + "addEventListener": true, + "clearTimeout": true, "console.warn": true, "devicePixelRatio": true, "document": true, "navigator.userAgent": true, + "removeEventListener": true, "safari": true, "setTimeout": true } diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 1a9534d04..1d70e3142 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -6176,10 +6176,13 @@ "react-dnd-html5-backend": { "globals": { "Image": true, + "addEventListener": true, + "clearTimeout": true, "console.warn": true, "devicePixelRatio": true, "document": true, "navigator.userAgent": true, + "removeEventListener": true, "safari": true, "setTimeout": true } diff --git a/lavamoat/browserify/policy-override.json b/lavamoat/browserify/policy-override.json index 212074b38..96504e814 100644 --- a/lavamoat/browserify/policy-override.json +++ b/lavamoat/browserify/policy-override.json @@ -31,6 +31,13 @@ "clearTimeout": true } }, + "react-dnd-html5-backend": { + "globals": { + "clearTimeout": true, + "addEventListener": true, + "removeEventListener": true + } + }, "ethers>@ethersproject/random": { "globals": { "crypto.getRandomValues": true From 979cfe9aabbe29e4fb638d30168e36f311f596ee Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Thu, 9 Jun 2022 08:30:52 -0700 Subject: [PATCH 114/127] Update CHANGELOG.md Co-authored-by: Ariella Vu <20778143+digiwand@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0be99f03b..ebc4400a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Ensure theme selection dropdown is discoverable via settings search([#14379](https://github.com/MetaMask/metamask-extension/pull/14379)) - Stop using the 4bytes registry to name contract deployment transactions in the activity list, preventing false method names from being shown for deployments ([#14598](https://github.com/MetaMask/metamask-extension/pull/14598)) - Save send flow user action history in transaction state logs ([#14510](https://github.com/MetaMask/metamask-extension/pull/14510)) -- Update Gridplus to use https://github.com/GridPlus/gridplus-sdk/compare/v1.1.6...v1.2.4 ([#14467](https://github.com/MetaMask/metamask-extension/pull/14467)) +- Update GridPlus to use https://github.com/GridPlus/gridplus-sdk/compare/v1.1.6...v1.2.4 ([#14467](https://github.com/MetaMask/metamask-extension/pull/14467)) ### Fixed From 7df0af8f4fd61f6fb87b05af7ad444d5ade3dc76 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Thu, 9 Jun 2022 09:03:07 -0700 Subject: [PATCH 115/127] @metamask/providers@9.0.0 (#14904) Bump `@metamask/providers` to `9.0.0`. Should be completely non-breaking for our purposes. --- package.json | 2 +- yarn.lock | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f595055c2..ac0b0761e 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "@metamask/metamask-eth-abis": "^3.0.0", "@metamask/obs-store": "^5.0.0", "@metamask/post-message-stream": "^4.0.0", - "@metamask/providers": "^8.1.1", + "@metamask/providers": "^9.0.0", "@metamask/rpc-methods": "^0.15.0", "@metamask/slip44": "^2.1.0", "@metamask/smart-transactions-controller": "^2.0.1", diff --git a/yarn.lock b/yarn.lock index 7ef930eba..a834bd0fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3043,6 +3043,24 @@ pump "^3.0.0" webextension-polyfill-ts "^0.25.0" +"@metamask/providers@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@metamask/providers/-/providers-9.0.0.tgz#644684f9eceb952138e80afb9103c7e39d8350fe" + integrity sha512-9qUkaFafZUROK0CAUBqjsut+7mqKOXFhBCpAhAPVRBqj5TfUTdPI4t8S7GYzPVaDbC7M6kH/YLNCgcfaFWAS+w== + dependencies: + "@metamask/object-multiplex" "^1.1.0" + "@metamask/safe-event-emitter" "^2.0.0" + "@types/chrome" "^0.0.136" + detect-browser "^5.2.0" + eth-rpc-errors "^4.0.2" + extension-port-stream "^2.0.1" + fast-deep-equal "^2.0.1" + is-stream "^2.0.0" + json-rpc-engine "^6.1.0" + json-rpc-middleware-stream "^3.0.0" + pump "^3.0.0" + webextension-polyfill-ts "^0.25.0" + "@metamask/rpc-methods@^0.15.0": version "0.15.0" resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.15.0.tgz#3bdfbf620d1ab328ff4d26f6a9c293136a50e51e" From 2c6236ed4ffcb488f508c84cebd26a92a822228b Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Thu, 9 Jun 2022 19:09:50 +0000 Subject: [PATCH 116/127] Version v10.16.0 --- CHANGELOG.md | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 121 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebc4400a5..5ff8e2acb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,124 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [10.16.0] +### Uncategorized +- Sync master to develop (v10.15.0) ([#14905](https://github.com/MetaMask/metamask-extension/pull/14905)) +- @metamask/providers@9.0.0 ([#14904](https://github.com/MetaMask/metamask-extension/pull/14904)) +- Update CHANGELOG.md +- Merge branch 'develop' into master-sync +- fix lavamoat policy files for drag and drop package ([#14901](https://github.com/MetaMask/metamask-extension/pull/14901)) +- Fix padding issue in Edit Nickname screen ([#14842](https://github.com/MetaMask/metamask-extension/pull/14842)) +- Create e2e test for snap in-app notification ([#14894](https://github.com/MetaMask/metamask-extension/pull/14894)) +- Handle an RPC provider delay in Swaps ([#14821](https://github.com/MetaMask/metamask-extension/pull/14821)) +- Add friendly error handling when background throws an error before listening for connection ([#14461](https://github.com/MetaMask/metamask-extension/pull/14461)) +- Fix 'website' casing ([#14860](https://github.com/MetaMask/metamask-extension/pull/14860)) +- Reduce the default slippage from 3% to 2% ([#14863](https://github.com/MetaMask/metamask-extension/pull/14863)) +- Update chromedriver and chrome binary ([#14877](https://github.com/MetaMask/metamask-extension/pull/14877)) +- Make content changes for the STX status page, remove old content ([#14805](https://github.com/MetaMask/metamask-extension/pull/14805)) +- Unit test proptype ([#14868](https://github.com/MetaMask/metamask-extension/pull/14868)) +- manifest: add https://chainid.network/chains.json ([#14810](https://github.com/MetaMask/metamask-extension/pull/14810)) +- Fix switching between ETH and USD ([#13827](https://github.com/MetaMask/metamask-extension/pull/13827)) +- Fixing add recipient flow issue with contact list/recent recipients ([#14771](https://github.com/MetaMask/metamask-extension/pull/14771)) +- Updating icon color ([#14835](https://github.com/MetaMask/metamask-extension/pull/14835)) +- fix: keep lock button text inside button boundaries ([#14335](https://github.com/MetaMask/metamask-extension/pull/14335)) +- Update minimist from v1.2.5 to v1.2.6 ([#14850](https://github.com/MetaMask/metamask-extension/pull/14850)) +- Updating some more instances ([#14851](https://github.com/MetaMask/metamask-extension/pull/14851)) +- Storybook: add TransactionListItem component page ([#14786](https://github.com/MetaMask/metamask-extension/pull/14786)) +- fix design breaks on the Settings Navbar when Internationalization ([#14012](https://github.com/MetaMask/metamask-extension/pull/14012)) +- Sync `master` with `develop` ([#14840](https://github.com/MetaMask/metamask-extension/pull/14840)) +- Updating all instances of Metamask to MetaMask in content, comments and tests ([#14848](https://github.com/MetaMask/metamask-extension/pull/14848)) +- Update LavaMoat policy +- Update e2e test to reflect change in Chrome +- Merge remote-tracking branch 'origin/develop' into master-sync +- Update `protobufjs` and remove obsolete advisory exclusion ([#14841](https://github.com/MetaMask/metamask-extension/pull/14841)) +- Include snap version in pill ([#14803](https://github.com/MetaMask/metamask-extension/pull/14803)) +- Update PULL_REQUEST_TEMPLATE.md ([#14790](https://github.com/MetaMask/metamask-extension/pull/14790)) +- fix: keystone transaction qrcode has no white spacing ([#14798](https://github.com/MetaMask/metamask-extension/pull/14798)) +- Snap notifications integration ([#14605](https://github.com/MetaMask/metamask-extension/pull/14605)) +- Upgrade @metamask/eth-ledger-bridge-keyring ([#14799](https://github.com/MetaMask/metamask-extension/pull/14799)) +- snaps-skunkworks@0.15.0 ([#14772](https://github.com/MetaMask/metamask-extension/pull/14772)) +- Fix proptype errors in network dropdown, tx list item details, and account details modal tests ([#14747](https://github.com/MetaMask/metamask-extension/pull/14747)) +- Ensure transaction type is correctly updated on edit ([#14721](https://github.com/MetaMask/metamask-extension/pull/14721)) +- Add fiat onboarding for AVAX and MATIC through Wyre ([#14683](https://github.com/MetaMask/metamask-extension/pull/14683)) +- Bump @metamask/contract-metadata from 1.33.0 to 1.35.0 ([#14791](https://github.com/MetaMask/metamask-extension/pull/14791)) +- Slight cleanup of constants/transactions, useTransactionDisplayData, and TransactionIcon ([#14784](https://github.com/MetaMask/metamask-extension/pull/14784)) +- Migrate the "estimateGas" API call to "getFees" for STX ([#14767](https://github.com/MetaMask/metamask-extension/pull/14767)) +- Ignore advisory GHSA-wm7h-9275-46v2 ([#14789](https://github.com/MetaMask/metamask-extension/pull/14789)) +- Adding flag for MV3 ([#14762](https://github.com/MetaMask/metamask-extension/pull/14762)) +- Add types to send state ([#14740](https://github.com/MetaMask/metamask-extension/pull/14740)) +- Remove site origin on snap install ([#14752](https://github.com/MetaMask/metamask-extension/pull/14752)) +- Update design tokens library from 1.5 to 1.6 WIP ([#14732](https://github.com/MetaMask/metamask-extension/pull/14732)) +- Enables the "Safe Transaction From" copy for safeTransferFrom transactions ([#14769](https://github.com/MetaMask/metamask-extension/pull/14769)) +- remove draft transaction ([#14701](https://github.com/MetaMask/metamask-extension/pull/14701)) +- Fix currency conversion rate ([#14713](https://github.com/MetaMask/metamask-extension/pull/14713)) +- Fix an edge case with missing top assets in Swaps ([#14688](https://github.com/MetaMask/metamask-extension/pull/14688)) +- Restore SiteOrigin chip on permission screen ([#14768](https://github.com/MetaMask/metamask-extension/pull/14768)) +- Remove module paths from bundle ([#14763](https://github.com/MetaMask/metamask-extension/pull/14763)) +- Sign button is enabled after scrolling all the way to the bottom ([#14745](https://github.com/MetaMask/metamask-extension/pull/14745)) +- EditGasFeeBtn: Insufficient number of substitutions for key "dappSuggestedTooltip" ([#14734](https://github.com/MetaMask/metamask-extension/pull/14734)) +- Enhance reusable SiteOrigin component ([#14720](https://github.com/MetaMask/metamask-extension/pull/14720)) +- Bump @metamask/auto-changelog from 2.5.0 to 2.6.0 ([#14741](https://github.com/MetaMask/metamask-extension/pull/14741)) +- Add hideEstimatedGasFee prop to sort-list and select-quote-popover tests ([#14725](https://github.com/MetaMask/metamask-extension/pull/14725)) +- Chain ID field use the same color pattern as the currency symbol field warning message below ([#14644](https://github.com/MetaMask/metamask-extension/pull/14644)) +- add gas_used to gasParams for conversion ([#14627](https://github.com/MetaMask/metamask-extension/pull/14627)) +- snaps-skunkworks@0.14.0 ([#14700](https://github.com/MetaMask/metamask-extension/pull/14700)) +- NetworksTab: make footer buttons nowrap ([#14733](https://github.com/MetaMask/metamask-extension/pull/14733)) +- Ensure send logs use current chain currency symbol ([#14726](https://github.com/MetaMask/metamask-extension/pull/14726)) +- Use enum for test snaps website URL ([#14727](https://github.com/MetaMask/metamask-extension/pull/14727)) +- Storybook: add SignatureRequestOriginal ([#14707](https://github.com/MetaMask/metamask-extension/pull/14707)) +- Storybook: Fix SignatureRequest component ([#14706](https://github.com/MetaMask/metamask-extension/pull/14706)) +- Unit test proptype ([#14564](https://github.com/MetaMask/metamask-extension/pull/14564)) +- Overall CSS #13441 ([#13902](https://github.com/MetaMask/metamask-extension/pull/13902)) +- "Cancel/reject all" for signature requests #13201 ([#13786](https://github.com/MetaMask/metamask-extension/pull/13786)) +- Bump `addons-linter` ([#14717](https://github.com/MetaMask/metamask-extension/pull/14717)) +- add networks without ticker trait ([#14607](https://github.com/MetaMask/metamask-extension/pull/14607)) +- Add Coinbase Pay as fiat onramp option ([#14648](https://github.com/MetaMask/metamask-extension/pull/14648)) +- Bump @metamask/controllers version, remove patches ([#14618](https://github.com/MetaMask/metamask-extension/pull/14618)) +- Removed onExecutionEnvironmentError ([#14698](https://github.com/MetaMask/metamask-extension/pull/14698)) +- Change styles for the high price impact notification in Swaps ([#14697](https://github.com/MetaMask/metamask-extension/pull/14697)) +- create e2e test for manageState snap ([#14699](https://github.com/MetaMask/metamask-extension/pull/14699)) +- Ensure ledger keyring message event listener are removed on metamask lock ([#14691](https://github.com/MetaMask/metamask-extension/pull/14691)) +- add case in useTransactionDisplayData to handle transaction type safeTransferFrom ([#14678](https://github.com/MetaMask/metamask-extension/pull/14678)) +- deps - patch secp256k1 for fast module init via lazy loading ([#14677](https://github.com/MetaMask/metamask-extension/pull/14677)) +- Event tracking for Token Detection V2 ([#14441](https://github.com/MetaMask/metamask-extension/pull/14441)) +- Fix Snaps view search ([#14693](https://github.com/MetaMask/metamask-extension/pull/14693)) +- Remove gas editing in Swaps ([#14673](https://github.com/MetaMask/metamask-extension/pull/14673)) +- Remove confirmation for terminated snaps ([#14566](https://github.com/MetaMask/metamask-extension/pull/14566)) +- Chromedriver v101 ([#14617](https://github.com/MetaMask/metamask-extension/pull/14617)) +- snaps-skunkworks@0.12.0 ([#14670](https://github.com/MetaMask/metamask-extension/pull/14670)) +- Fix auto-lock e2e test ([#14685](https://github.com/MetaMask/metamask-extension/pull/14685)) +- Fix eth_sign 'Learn more' dialog link ([#14667](https://github.com/MetaMask/metamask-extension/pull/14667)) +- Updating alert text color ([#14674](https://github.com/MetaMask/metamask-extension/pull/14674)) +- Auto lock e2e ([#14624](https://github.com/MetaMask/metamask-extension/pull/14624)) +- lavamoat - bump for stats support ([#14641](https://github.com/MetaMask/metamask-extension/pull/14641)) +- Fix Ropsten Test Network icon ([#14626](https://github.com/MetaMask/metamask-extension/pull/14626)) +- TransactionListItem: fix save/cancel rounded btn ([#14659](https://github.com/MetaMask/metamask-extension/pull/14659)) +- Add New Tokens Found page ([#14366](https://github.com/MetaMask/metamask-extension/pull/14366)) +- Swaps / STX improvements ([#14622](https://github.com/MetaMask/metamask-extension/pull/14622)) +- Simplify removeSnap functionality after snaps-skunkworks update ([#14646](https://github.com/MetaMask/metamask-extension/pull/14646)) +- Fixing Speed up/Cancel information text ([#14551](https://github.com/MetaMask/metamask-extension/pull/14551)) +- Fix SRP paste duplication ([#14625](https://github.com/MetaMask/metamask-extension/pull/14625)) +- LavaMoat - UI upgrade - secure package naming ([#14565](https://github.com/MetaMask/metamask-extension/pull/14565)) +- E2e send tests ([#14568](https://github.com/MetaMask/metamask-extension/pull/14568)) +- slip44@2.1.0 ([#14619](https://github.com/MetaMask/metamask-extension/pull/14619)) +- Reproducible `.zip` files ([#14623](https://github.com/MetaMask/metamask-extension/pull/14623)) +- fix incorrect casing of includeUsdRate option passed to CurrencyRateController ([#14615](https://github.com/MetaMask/metamask-extension/pull/14615)) +- Fix redundant entry in lockfile ([#14616](https://github.com/MetaMask/metamask-extension/pull/14616)) +- Jest tests - incremental coverage ([#14612](https://github.com/MetaMask/metamask-extension/pull/14612)) +- build - update bify-module-groups for build determinism ([#14610](https://github.com/MetaMask/metamask-extension/pull/14610)) +- Add search information for Theme dropdown ([#14476](https://github.com/MetaMask/metamask-extension/pull/14476)) +- Update version parsing to allow rollback release ([#14288](https://github.com/MetaMask/metamask-extension/pull/14288)) +- Update bug-report.yml ([#14466](https://github.com/MetaMask/metamask-extension/pull/14466)) +- Disable STX if a regular tx is in progress ([#14554](https://github.com/MetaMask/metamask-extension/pull/14554)) +- Fix development build scripts ([#14594](https://github.com/MetaMask/metamask-extension/pull/14594)) +- Update PULL_REQUEST_TEMPLATE.md ([#14547](https://github.com/MetaMask/metamask-extension/pull/14547)) +- Patch gridplus-sdk for perf fix ([#14582](https://github.com/MetaMask/metamask-extension/pull/14582)) +- Add applyLavaMoat build flag ([#14583](https://github.com/MetaMask/metamask-extension/pull/14583)) +- fix cross-fetch moderate vulnerability alert ([#14570](https://github.com/MetaMask/metamask-extension/pull/14570)) +- Fix browser.tab.get call ([#14550](https://github.com/MetaMask/metamask-extension/pull/14550)) +- Added getAccounts suppressUnauthorized param ([#14126](https://github.com/MetaMask/metamask-extension/pull/14126)) + ## [10.15.0] ### Added - Add warning when multiple instances of MetaMask are running ([#13836](https://github.com/MetaMask/metamask-extension/pull/13836)) @@ -2964,7 +3082,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.15.0...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.16.0...HEAD +[10.16.0]: https://github.com/MetaMask/metamask-extension/compare/v10.15.0...v10.16.0 [10.15.0]: https://github.com/MetaMask/metamask-extension/compare/v10.14.7...v10.15.0 [10.14.7]: https://github.com/MetaMask/metamask-extension/compare/v10.14.6...v10.14.7 [10.14.6]: https://github.com/MetaMask/metamask-extension/compare/v10.14.5...v10.14.6 diff --git a/package.json b/package.json index 269572aaa..8eaf52d2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.15.0", + "version": "10.16.0", "private": true, "repository": { "type": "git", From f561aeeef60446197d3ee4a64086ec161a7227b5 Mon Sep 17 00:00:00 2001 From: Alex Donesky Date: Sat, 11 Jun 2022 12:55:35 -0500 Subject: [PATCH 117/127] Fix to infinite loading on approve screen (#14756) --- app/_locales/en/messages.json | 3 + ui/hooks/useAssetDetails.js | 14 +- ui/hooks/useAssetDetails.test.js | 197 ++++++++++++++++++ .../confirm-approve-content.component.js | 97 ++++++++- .../confirm-approve-content/index.scss | 4 + ui/pages/confirm-approve/confirm-approve.js | 3 + 6 files changed, 299 insertions(+), 19 deletions(-) create mode 100644 ui/hooks/useAssetDetails.test.js diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 23b12c646..378eec13c 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -2066,6 +2066,9 @@ "message": "Nonce is higher than suggested nonce of $1", "description": "The next nonce according to MetaMask's internal logic" }, + "nft": { + "message": "NFT" + }, "nftTokenIdPlaceholder": { "message": "Enter the Token ID" }, diff --git a/ui/hooks/useAssetDetails.js b/ui/hooks/useAssetDetails.js index ce9ef30ba..ce8d00253 100644 --- a/ui/hooks/useAssetDetails.js +++ b/ui/hooks/useAssetDetails.js @@ -1,7 +1,7 @@ import { useState, useEffect } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { parseStandardTokenTransactionData } from '../../shared/modules/transaction.utils'; -import { getCollectibles, getTokens } from '../ducks/metamask/metamask'; +import { getCollectibles } from '../ducks/metamask/metamask'; import { ERC1155, ERC721, ERC20 } from '../helpers/constants/common'; import { calcTokenAmount, @@ -9,16 +9,13 @@ import { getTokenAddressParam, getTokenValueParam, } from '../helpers/utils/token-util'; -import { getTokenList } from '../selectors'; import { hideLoadingIndication, showLoadingIndication } from '../store/actions'; import { usePrevious } from './usePrevious'; export function useAssetDetails(tokenAddress, userAddress, transactionData) { const dispatch = useDispatch(); // state selectors - const tokens = useSelector(getTokens); const collectibles = useSelector(getCollectibles); - const tokenList = useSelector(getTokenList); // in-hook state const [currentAsset, setCurrentAsset] = useState(null); @@ -36,8 +33,6 @@ export function useAssetDetails(tokenAddress, userAddress, transactionData) { userAddress, transactionData, collectibles, - tokens, - tokenList, ); setCurrentAsset(assetDetails); dispatch(hideLoadingIndication()); @@ -58,8 +53,6 @@ export function useAssetDetails(tokenAddress, userAddress, transactionData) { userAddress, transactionData, collectibles, - tokens, - tokenList, ]); let assetStandard, @@ -83,11 +76,13 @@ export function useAssetDetails(tokenAddress, userAddress, transactionData) { balance, decimals: currentAssetDecimals, } = currentAsset; + const tokenData = parseStandardTokenTransactionData(transactionData); assetStandard = standard; assetAddress = tokenAddress; - tokenSymbol = symbol; + tokenSymbol = symbol ?? ''; tokenImage = image; + toAddress = getTokenAddressParam(tokenData); if (assetStandard === ERC721 || assetStandard === ERC1155) { assetName = name; @@ -101,6 +96,7 @@ export function useAssetDetails(tokenAddress, userAddress, transactionData) { calcTokenAmount(getTokenValueParam(tokenData), decimals).toString(10); } } + return { assetStandard, assetName, diff --git a/ui/hooks/useAssetDetails.test.js b/ui/hooks/useAssetDetails.test.js new file mode 100644 index 000000000..f580a550d --- /dev/null +++ b/ui/hooks/useAssetDetails.test.js @@ -0,0 +1,197 @@ +import React from 'react'; +import { Provider } from 'react-redux'; +import { renderHook } from '@testing-library/react-hooks'; + +import configureStore from '../store/store'; +import * as tokenUtils from '../helpers/utils/token-util'; +import { ERC1155, ERC20, ERC721 } from '../helpers/constants/common'; +import { useAssetDetails } from './useAssetDetails'; + +const renderUseAssetDetails = ({ + tokenAddress, + userAddress, + transactionData, +}) => { + const mockState = { + metamask: { + provider: { + type: 'test', + chainId: '0x3', + }, + tokenList: {}, + }, + }; + + const wrapper = ({ children }) => ( + {children} + ); + + return renderHook( + () => useAssetDetails(tokenAddress, userAddress, transactionData), + { wrapper }, + ); +}; + +describe('useAssetDetails', () => { + let getAssetDetailsStub; + beforeEach(() => { + getAssetDetailsStub = jest + .spyOn(tokenUtils, 'getAssetDetails') + .mockImplementation(() => Promise.resolve({})); + }); + it('should return object with tokenSymbol set to and empty string, when getAssetDetails returns and empty object', async () => { + const toAddress = '000000000000000000000000000000000000dead'; + const tokenAddress = '0x1'; + + const transactionData = `0xa9059cbb000000000000000000000000${toAddress}000000000000000000000000000000000000000000000000016345785d8a0000`; + + const { result, waitForNextUpdate } = renderUseAssetDetails({ + tokenAddress, + userAddress: '0x111', + transactionData, + }); + + await waitForNextUpdate(); + + expect(result.current).toStrictEqual({ + assetAddress: tokenAddress, + assetName: undefined, + assetStandard: undefined, + decimals: undefined, + toAddress: `0x${toAddress}`, + tokenAmount: undefined, + tokenId: undefined, + tokenImage: undefined, + tokenSymbol: '', + tokenValue: undefined, + userBalance: undefined, + }); + }); + + it('should return object with correct tokenValues for an ERC20 token', async () => { + const userAddress = '0xf04a5cc80b1e94c69b48f5ee68a08cd2f09a7c3e'; + const tokenAddress = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'; + const toAddress = '000000000000000000000000000000000000dead'; + const transactionData = `0xa9059cbb000000000000000000000000${toAddress}00000000000000000000000000000000000000000000000000000000000001f4`; + + const standard = ERC20; + const symbol = 'WETH'; + const balance = '1'; + const decimals = 18; + + getAssetDetailsStub.mockImplementation(() => + Promise.resolve({ + standard, + symbol, + balance, + decimals, + }), + ); + + const { result, waitForNextUpdate } = renderUseAssetDetails({ + tokenAddress, + userAddress, + transactionData, + }); + + await waitForNextUpdate(); + + expect(result.current).toStrictEqual({ + assetAddress: tokenAddress, + assetName: undefined, + assetStandard: standard, + decimals, + toAddress: `0x${toAddress}`, + tokenAmount: '0.0000000000000005', + tokenId: undefined, + tokenImage: undefined, + tokenSymbol: symbol, + tokenValue: undefined, + userBalance: balance, + }); + }); + + it('should return object with correct tokenValues for an ERC721 token', async () => { + const tokenAddress = '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D'; + const toAddress = '000000000000000000000000000000000000dead'; + const transactionData = `0x23b872dd000000000000000000000000a544eebe103733f22ef62af556023bc918b73d36000000000000000000000000${toAddress}000000000000000000000000000000000000000000000000000000000000000c`; + + const symbol = 'BAYC'; + const tokenId = '12'; + const name = 'BoredApeYachtClub'; + const image = + 'https://bafybeihw3gvmthmvrenfmcvagtais5tv7r4nmiezgsv7nyknjubxw4lite.ipfs.dweb.link'; + const standard = ERC721; + + getAssetDetailsStub.mockImplementation(() => + Promise.resolve({ + standard, + symbol, + name, + tokenId, + image, + }), + ); + + const { result, waitForNextUpdate } = renderUseAssetDetails({ + tokenAddress, + transactionData, + }); + + await waitForNextUpdate(); + + expect(result.current).toStrictEqual({ + assetAddress: tokenAddress, + assetName: name, + assetStandard: standard, + decimals: undefined, + toAddress: `0x${toAddress}`, + tokenId, + tokenImage: image, + tokenSymbol: symbol, + tokenValue: undefined, + userBalance: undefined, + tokenAmount: undefined, + }); + }); + + it('should return object with correct tokenValues for an ERC1155 token', async () => { + const tokenAddress = '0x76BE3b62873462d2142405439777e971754E8E77'; + const toAddress = '000000000000000000000000000000000000dead'; + const transactionData = `0xf242432a000000000000000000000000a544eebe103733f22ef62af556023bc918b73d36000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000322000000000000000000000000000000000000000000000000000000000000009c00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000`; + + const tokenId = '121'; + const image = + 'https://bafybeihw3gvmthmvrenfmcvagtais5tv7r4nmiezgsv7nyknjubxw4lite.ipfs.dweb.link'; + const standard = ERC1155; + + getAssetDetailsStub.mockImplementation(() => + Promise.resolve({ + standard, + tokenId, + image, + }), + ); + + const { result, waitForNextUpdate } = renderUseAssetDetails({ + tokenAddress, + transactionData, + }); + + await waitForNextUpdate(); + + expect(result.current).toStrictEqual({ + assetAddress: tokenAddress, + assetName: undefined, + assetStandard: standard, + decimals: undefined, + toAddress: `0x${toAddress}`, + tokenId: undefined, + tokenImage: image, + tokenSymbol: '', + tokenValue: undefined, + userBalance: undefined, + tokenAmount: undefined, + }); + }); +}); diff --git a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js index 7487e594b..7a6d32cce 100644 --- a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js +++ b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js @@ -62,6 +62,7 @@ export default class ConfirmApproveContent extends Component { txData: PropTypes.object, fromAddressIsLedger: PropTypes.bool, chainId: PropTypes.string, + tokenAddress: PropTypes.string, rpcPrefs: PropTypes.object, isContract: PropTypes.bool, hexTransactionTotal: PropTypes.string, @@ -183,7 +184,9 @@ export default class ConfirmApproveContent extends Component { renderERC721OrERC1155PermissionContent() { const { t } = this.context; - const { origin, toAddress, isContract, assetName, tokenId } = this.props; + const { origin, toAddress, isContract } = this.props; + + const titleTokenDescription = this.getTitleTokenDescription(); const displayedAddress = isContract ? `${t('contract')} (${addressSummary(toAddress)})` @@ -198,7 +201,7 @@ export default class ConfirmApproveContent extends Component { {t('approvedAsset')}:
    - {`${assetName} #${tokenId}`} + {titleTokenDescription}
    @@ -430,6 +433,82 @@ export default class ConfirmApproveContent extends Component { ); } + getTitleTokenDescription() { + const { + tokenId, + assetName, + tokenAddress, + rpcPrefs, + chainId, + assetStandard, + tokenSymbol, + } = this.props; + const { t } = this.context; + let titleTokenDescription = t('token'); + if (rpcPrefs?.blockExplorerUrl || chainId) { + const unknownTokenBlockExplorerLink = getTokenTrackerLink( + tokenAddress, + chainId, + null, + { + blockExplorerUrl: rpcPrefs?.blockExplorerUrl ?? null, + }, + ); + + const unknownTokenLink = ( + + {t('token')} + + ); + titleTokenDescription = unknownTokenLink; + } + + if (assetStandard === ERC20 || (tokenSymbol && !tokenId)) { + titleTokenDescription = tokenSymbol; + } else if ( + assetStandard === ERC721 || + assetStandard === ERC1155 || + // if we don't have an asset standard but we do have either both an assetname and a tokenID or both a tokenSymbol and tokenId we assume its an NFT + (assetName && tokenId) || + (tokenSymbol && tokenId) + ) { + const tokenIdWrapped = tokenId ? ` (#${tokenId})` : null; + if (assetName || tokenSymbol) { + titleTokenDescription = `${assetName ?? tokenSymbol} ${tokenIdWrapped}`; + } else { + const unknownNFTBlockExplorerLink = getTokenTrackerLink( + tokenAddress, + chainId, + null, + { + blockExplorerUrl: rpcPrefs?.blockExplorerUrl ?? null, + }, + ); + const unknownNFTLink = ( + <> + + {t('nft')} + + {tokenIdWrapped && {tokenIdWrapped}} + + ); + titleTokenDescription = unknownNFTLink; + } + } + + return titleTokenDescription; + } + render() { const { t } = this.context; const { @@ -452,11 +531,11 @@ export default class ConfirmApproveContent extends Component { rpcPrefs, isContract, assetStandard, - tokenId, - assetName, } = this.props; const { showFullTxDetails } = this.state; + const titleTokenDescription = this.getTitleTokenDescription(); + return (
    - {t('allowSpendToken', [ - assetStandard === ERC20 - ? tokenSymbol - : `${assetName} (#${tokenId})`, - ])} + {t('allowSpendToken', [titleTokenDescription])}
    {t('trustSiteApprovePermission', [ @@ -554,7 +629,9 @@ export default class ConfirmApproveContent extends Component { : getAccountLink( toAddress, chainId, - { blockExplorerUrl: rpcPrefs?.blockExplorerUrl ?? null }, + { + blockExplorerUrl: rpcPrefs?.blockExplorerUrl ?? null, + }, null, ); global.platform.openTab({ diff --git a/ui/pages/confirm-approve/confirm-approve-content/index.scss b/ui/pages/confirm-approve/confirm-approve-content/index.scss index 0f2593ee4..473be2f7b 100644 --- a/ui/pages/confirm-approve/confirm-approve-content/index.scss +++ b/ui/pages/confirm-approve/confirm-approve-content/index.scss @@ -9,6 +9,10 @@ padding: 0 24px 16px 24px; } + &__unknown-asset { + color: var(--color-primary-default); + } + &__icon-display-content { display: flex; height: 51px; diff --git a/ui/pages/confirm-approve/confirm-approve.js b/ui/pages/confirm-approve/confirm-approve.js index 246baca77..6dca97d1b 100644 --- a/ui/pages/confirm-approve/confirm-approve.js +++ b/ui/pages/confirm-approve/confirm-approve.js @@ -52,6 +52,7 @@ export default function ConfirmApprove({ tokenId, userAddress, toAddress, + tokenAddress, transaction, ethTransactionTotal, fiatTransactionTotal, @@ -173,6 +174,7 @@ export default function ConfirmApprove({ tokenId={tokenId} assetName={assetName} assetStandard={assetStandard} + tokenAddress={tokenAddress} showCustomizeGasModal={approveTransaction} showEditApprovalPermissionModal={({ /* eslint-disable no-shadow */ @@ -268,6 +270,7 @@ export default function ConfirmApprove({ ConfirmApprove.propTypes = { assetStandard: PropTypes.string, assetName: PropTypes.string, + tokenAddress: PropTypes.string, userBalance: PropTypes.string, tokenSymbol: PropTypes.string, decimals: PropTypes.string, From 80e7d82eed5f3dcd5ef057d2474cd015c3fba064 Mon Sep 17 00:00:00 2001 From: Daniel <80175477+dan437@users.noreply.github.com> Date: Wed, 15 Jun 2022 21:08:13 +0200 Subject: [PATCH 118/127] Remove experimental gas editing for Swaps (#14942) --- .../__snapshots__/fee-card.test.js.snap | 2 - ui/pages/swaps/fee-card/fee-card.js | 94 +++--- ui/pages/swaps/fee-card/fee-card.test.js | 62 +--- ui/pages/swaps/view-quote/view-quote.js | 305 ++++++++---------- 4 files changed, 177 insertions(+), 286 deletions(-) diff --git a/ui/pages/swaps/fee-card/__snapshots__/fee-card.test.js.snap b/ui/pages/swaps/fee-card/__snapshots__/fee-card.test.js.snap index 85bc1b6b4..dea196ec9 100644 --- a/ui/pages/swaps/fee-card/__snapshots__/fee-card.test.js.snap +++ b/ui/pages/swaps/fee-card/__snapshots__/fee-card.test.js.snap @@ -1,7 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`FeeCard renders the component with EIP-1559 V2 enabled 1`] = `null`; - exports[`FeeCard renders the component with EIP-1559 enabled 1`] = `null`; exports[`FeeCard renders the component with initial props 1`] = `null`; diff --git a/ui/pages/swaps/fee-card/fee-card.js b/ui/pages/swaps/fee-card/fee-card.js index f2451f624..28d7a0131 100644 --- a/ui/pages/swaps/fee-card/fee-card.js +++ b/ui/pages/swaps/fee-card/fee-card.js @@ -18,7 +18,6 @@ import { TYPOGRAPHY, FONT_WEIGHT, } from '../../../helpers/constants/design-system'; -import GasDetailsItemTitle from '../../../components/app/gas-details-item/gas-details-item-title'; import { MetaMetricsContext } from '../../../contexts/metametrics'; import { EVENT } from '../../../../shared/constants/metametrics'; @@ -35,10 +34,7 @@ export default function FeeCard({ numberOfQuotes, onQuotesClick, chainId, - smartTransactionsOptInStatus, - smartTransactionsEnabled, isBestQuote, - supportsEIP1559V2 = false, }) { const t = useContext(I18nContext); @@ -72,57 +68,50 @@ export default function FeeCard({
    - ) : ( - <> - {t('transactionDetailGasHeading')} - -

    - {t('swapGasFeesSummary', [ - getTranslatedNetworkName(), - ])} -

    -

    - {t('swapGasFeesDetails')} -

    -

    - { - trackEvent({ - event: 'Clicked "Gas Fees: Learn More" Link', - category: EVENT.CATEGORIES.SWAPS, - }); - global.platform.openTab({ - url: GAS_FEES_LEARN_MORE_URL, - }); - }} - target="_blank" - rel="noopener noreferrer" - > - {t('swapGasFeesLearnMore')} - -

    - - } - containerClassName="fee-card__info-tooltip-content-container" - wrapperClassName="fee-card__row-label fee-card__info-tooltip-container" - wide - /> - - ) + <> + {t('transactionDetailGasHeading')} + +

    + {t('swapGasFeesSummary', [ + getTranslatedNetworkName(), + ])} +

    +

    + {t('swapGasFeesDetails')} +

    +

    + { + trackEvent({ + event: 'Clicked "Gas Fees: Learn More" Link', + category: EVENT.CATEGORIES.SWAPS, + }); + global.platform.openTab({ + url: GAS_FEES_LEARN_MORE_URL, + }); + }} + target="_blank" + rel="noopener noreferrer" + > + {t('swapGasFeesLearnMore')} + +

    + + } + containerClassName="fee-card__info-tooltip-content-container" + wrapperClassName="fee-card__row-label fee-card__info-tooltip-container" + wide + /> + } detailText={primaryFee.fee} detailTotal={secondaryFee.fee} @@ -209,8 +198,5 @@ FeeCard.propTypes = { onQuotesClick: PropTypes.func.isRequired, numberOfQuotes: PropTypes.number.isRequired, chainId: PropTypes.string.isRequired, - smartTransactionsOptInStatus: PropTypes.bool, - smartTransactionsEnabled: PropTypes.bool, isBestQuote: PropTypes.bool.isRequired, - supportsEIP1559V2: PropTypes.bool, }; diff --git a/ui/pages/swaps/fee-card/fee-card.test.js b/ui/pages/swaps/fee-card/fee-card.test.js index 218fba458..5caea9a71 100644 --- a/ui/pages/swaps/fee-card/fee-card.test.js +++ b/ui/pages/swaps/fee-card/fee-card.test.js @@ -9,23 +9,15 @@ import { setBackgroundConnection, MOCKS, } from '../../../../test/jest'; -import { EDIT_GAS_MODES } from '../../../../shared/constants/gas'; import { MAINNET_CHAIN_ID } from '../../../../shared/constants/network'; -import { - checkNetworkAndAccountSupports1559, - getEIP1559V2Enabled, - getPreferences, - getSelectedAccount, -} from '../../../selectors'; +import { checkNetworkAndAccountSupports1559 } from '../../../selectors'; import { getGasEstimateType, getGasFeeEstimates, getIsGasEstimatesLoading, } from '../../../ducks/metamask/metamask'; -import { GasFeeContextProvider } from '../../../contexts/gasFee'; import { TRANSACTION_ENVELOPE_TYPE_NAMES } from '../../../helpers/constants/transactions'; -import { useGasFeeEstimates } from '../../../hooks/useGasFeeEstimates'; import FeeCard from '.'; @@ -153,56 +145,4 @@ describe('FeeCard', () => { expect(getByText(`: ${props.secondaryFee.maxFee}`)).toBeInTheDocument(); expect(queryByTestId('fee-card__edit-link')).not.toBeInTheDocument(); }); - - it('renders the component with EIP-1559 V2 enabled', () => { - useGasFeeEstimates.mockImplementation(() => ({ gasFeeEstimates: {} })); - useSelector.mockImplementation((selector) => { - if (selector === getPreferences) { - return { - useNativeCurrencyAsPrimaryCurrency: true, - }; - } - if (selector === getEIP1559V2Enabled) { - return true; - } - if (selector === getSelectedAccount) { - return { - balance: '0x440aa47cc2556', - }; - } - if (selector === checkNetworkAndAccountSupports1559) { - return true; - } - return undefined; - }); - - const store = configureMockStore(middleware)(createSwapsMockStore()); - const props = createProps({ - networkAndAccountSupports1559: true, - maxPriorityFeePerGasDecGWEI: '3', - maxFeePerGasDecGWEI: '4', - supportsEIP1559V2: true, - }); - const { getByText } = renderWithProvider( - - - , - store, - ); - expect(getByText('Best of 6 quotes.')).toBeInTheDocument(); - expect(getByText('Gas')).toBeInTheDocument(); - expect(getByText('(estimated)')).toBeInTheDocument(); - expect(getByText('Swap suggested')).toBeInTheDocument(); - expect(getByText('Max fee')).toBeInTheDocument(); - expect(getByText(props.primaryFee.fee)).toBeInTheDocument(); - expect(getByText(props.secondaryFee.fee)).toBeInTheDocument(); - expect(getByText(`: ${props.secondaryFee.maxFee}`)).toBeInTheDocument(); - expect(getByText('Includes a 0.875% MetaMask fee.')).toBeInTheDocument(); - expect( - document.querySelector('.fee-card__top-bordered-row'), - ).toMatchSnapshot(); - }); }); diff --git a/ui/pages/swaps/view-quote/view-quote.js b/ui/pages/swaps/view-quote/view-quote.js index 3e42fb9e8..7a576d1be 100644 --- a/ui/pages/swaps/view-quote/view-quote.js +++ b/ui/pages/swaps/view-quote/view-quote.js @@ -60,7 +60,6 @@ import { isHardwareWallet, getHardwareWalletType, checkNetworkAndAccountSupports1559, - getEIP1559V2Enabled, getUSDConversionRate, } from '../../../selectors'; import { getNativeCurrency, getTokens } from '../../../ducks/metamask/metamask'; @@ -92,8 +91,6 @@ import { hexWEIToDecGWEI, addHexes, } from '../../../helpers/utils/conversions.util'; -import { GasFeeContextProvider } from '../../../contexts/gasFee'; -import { TransactionModalContextProvider } from '../../../contexts/transaction-modal'; import MainQuoteSummary from '../main-quote-summary'; import { calcGasTotal } from '../../send/send.utils'; import { getCustomTxParamsData } from '../../confirm-approve/confirm-approve.util'; @@ -105,10 +102,7 @@ import { } from '../swaps.util'; import { useTokenTracker } from '../../../hooks/useTokenTracker'; import { QUOTES_EXPIRED_ERROR } from '../../../../shared/constants/swaps'; -import { - EDIT_GAS_MODES, - GAS_RECOMMENDATIONS, -} from '../../../../shared/constants/gas'; +import { GAS_RECOMMENDATIONS } from '../../../../shared/constants/gas'; import CountdownTimer from '../countdown-timer'; import SwapsFooter from '../swaps-footer'; import PulseLoader from '../../../components/ui/pulse-loader'; // TODO: Replace this with a different loading component. @@ -125,7 +119,6 @@ export default function ViewQuote() { const dispatch = useDispatch(); const t = useContext(I18nContext); const trackEvent = useContext(MetaMetricsContext); - const eip1559V2Enabled = useSelector(getEIP1559V2Enabled); const [dispatchedSafeRefetch, setDispatchedSafeRefetch] = useState(false); const [submitClicked, setSubmitClicked] = useState(false); @@ -830,176 +823,150 @@ export default function ViewQuote() { submitClicked, ]); - const transaction = { - userFeeLevel: swapsUserFeeLevel || GAS_RECOMMENDATIONS.HIGH, - txParams: { - maxFeePerGas, - maxPriorityFeePerGas, - gas: maxGasLimit, - }, - }; - - const supportsEIP1559V2 = eip1559V2Enabled && networkAndAccountSupports1559; - return ( - - -
    +
    +
    + {selectQuotePopoverShown && ( + setSelectQuotePopoverShown(false)} + onSubmit={(aggId) => dispatch(swapsQuoteSelected(aggId))} + swapToSymbol={destinationTokenSymbol} + initialAggId={usedQuote.aggregator} + onQuoteDetailsIsOpened={trackQuoteDetailsOpened} + hideEstimatedGasFee={ + smartTransactionsEnabled && smartTransactionsOptInStatus + } + /> + )} + +
    + {viewQuotePriceDifferenceComponent} + {(showInsufficientWarning || tokenBalanceUnavailable) && ( + setWarningHidden(true)} + /> + )} +
    +
    + +
    + + {currentSmartTransactionsEnabled && + smartTransactionsOptInStatus && + !smartTransactionFees?.tradeTxFees && ( + + + + )} + {(!currentSmartTransactionsEnabled || + !smartTransactionsOptInStatus || + smartTransactionFees?.tradeTxFees) && (
    - {selectQuotePopoverShown && ( - setSelectQuotePopoverShown(false)} - onSubmit={(aggId) => dispatch(swapsQuoteSelected(aggId))} - swapToSymbol={destinationTokenSymbol} - initialAggId={usedQuote.aggregator} - onQuoteDetailsIsOpened={trackQuoteDetailsOpened} - hideEstimatedGasFee={ - smartTransactionsEnabled && smartTransactionsOptInStatus - } - /> - )} - -
    - {viewQuotePriceDifferenceComponent} - {(showInsufficientWarning || tokenBalanceUnavailable) && ( - setWarningHidden(true)} - /> - )} -
    -
    - -
    - { + trackAllAvailableQuotesOpened(); + setSelectQuotePopoverShown(true); + }} + chainId={chainId} + isBestQuote={isBestQuote} + maxPriorityFeePerGasDecGWEI={hexWEIToDecGWEI( + maxPriorityFeePerGas, )} - destinationDecimals={destinationTokenDecimals} - destinationSymbol={destinationTokenSymbol} - sourceIconUrl={sourceTokenIconUrl} - destinationIconUrl={destinationIconUrl} + maxFeePerGasDecGWEI={hexWEIToDecGWEI(maxFeePerGas)} /> - {currentSmartTransactionsEnabled && - smartTransactionsOptInStatus && - !smartTransactionFees?.tradeTxFees && ( - - - - )} - {(!currentSmartTransactionsEnabled || - !smartTransactionsOptInStatus || - smartTransactionFees?.tradeTxFees) && ( -
    - { - trackAllAvailableQuotesOpened(); - setSelectQuotePopoverShown(true); - }} - chainId={chainId} - isBestQuote={isBestQuote} - supportsEIP1559V2={supportsEIP1559V2} - networkAndAccountSupports1559={networkAndAccountSupports1559} - maxPriorityFeePerGasDecGWEI={hexWEIToDecGWEI( - maxPriorityFeePerGas, - )} - maxFeePerGasDecGWEI={hexWEIToDecGWEI(maxFeePerGas)} - smartTransactionsEnabled={currentSmartTransactionsEnabled} - smartTransactionsOptInStatus={smartTransactionsOptInStatus} - /> -
    - )}
    - { - setSubmitClicked(true); - if (!balanceError) { - if ( - currentSmartTransactionsEnabled && - smartTransactionsOptInStatus && - smartTransactionFees?.tradeTxFees - ) { - dispatch( - signAndSendSwapsSmartTransaction({ - unsignedTransaction, - trackEvent, - history, - additionalTrackingParams, - }), - ); - } else { - dispatch( - signAndSendTransactions( - history, - trackEvent, - additionalTrackingParams, - ), - ); - } - } else if (destinationToken.symbol === defaultSwapsToken.symbol) { - history.push(DEFAULT_ROUTE); - } else { - history.push(`${ASSET_ROUTE}/${destinationToken.address}`); - } - }} - submitText={ + )} +
    + { + setSubmitClicked(true); + if (!balanceError) { + if ( currentSmartTransactionsEnabled && smartTransactionsOptInStatus && - swapsSTXLoading - ? t('preparingSwap') - : t('swap') + smartTransactionFees?.tradeTxFees + ) { + dispatch( + signAndSendSwapsSmartTransaction({ + unsignedTransaction, + trackEvent, + history, + additionalTrackingParams, + }), + ); + } else { + dispatch( + signAndSendTransactions( + history, + trackEvent, + additionalTrackingParams, + ), + ); } - hideCancel - disabled={isSwapButtonDisabled} - className={isShowingWarning && 'view-quote__thin-swaps-footer'} - showTopBorder - /> -
    - - + } else if (destinationToken.symbol === defaultSwapsToken.symbol) { + history.push(DEFAULT_ROUTE); + } else { + history.push(`${ASSET_ROUTE}/${destinationToken.address}`); + } + }} + submitText={ + currentSmartTransactionsEnabled && + smartTransactionsOptInStatus && + swapsSTXLoading + ? t('preparingSwap') + : t('swap') + } + hideCancel + disabled={isSwapButtonDisabled} + className={isShowingWarning && 'view-quote__thin-swaps-footer'} + showTopBorder + /> +
    ); } From 5a4b71b08b1df2c1a50d7d84813856885b4889c5 Mon Sep 17 00:00:00 2001 From: seaona Date: Mon, 20 Jun 2022 19:07:52 +0200 Subject: [PATCH 119/127] Run lavamoat auto --- lavamoat/browserify/beta/policy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 5249bd797..1d70e3142 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -6729,4 +6729,4 @@ } } } -} +} \ No newline at end of file From 5168538afe3995aa380b6d73d183913ab4398e16 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Wed, 15 Jun 2022 15:50:37 +0200 Subject: [PATCH 120/127] Update E2E tests for new test-dapp version (#14939) * Update xDAI E2E information * Use local Ganache instance instead of Gnosis Chain * Bump test-dapp * Bump test-dapp * Enable secondary Ganache server for other test * Fix linting * Improve E2E stability * Update network selector --- package.json | 2 +- test/e2e/tests/chain-interactions.spec.js | 56 +++++++++++------------ test/e2e/tests/dapp-interactions.spec.js | 6 ++- test/e2e/tests/provider-api.spec.js | 4 +- yarn.lock | 8 ++-- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/package.json b/package.json index 8eaf52d2a..d12890c10 100644 --- a/package.json +++ b/package.json @@ -252,7 +252,7 @@ "@metamask/eslint-config-typescript": "^9.0.1", "@metamask/forwarder": "^1.1.0", "@metamask/phishing-warning": "^1.1.0", - "@metamask/test-dapp": "^5.0.0", + "@metamask/test-dapp": "^5.1.1", "@sentry/cli": "^1.58.0", "@storybook/addon-a11y": "^6.3.12", "@storybook/addon-actions": "^6.3.12", diff --git a/test/e2e/tests/chain-interactions.spec.js b/test/e2e/tests/chain-interactions.spec.js index c1879ccef..3b7d57408 100644 --- a/test/e2e/tests/chain-interactions.spec.js +++ b/test/e2e/tests/chain-interactions.spec.js @@ -2,16 +2,19 @@ const { strict: assert } = require('assert'); const { convertToHexValue, withFixtures } = require('../helpers'); describe('Chain Interactions', function () { - it('should add the XDAI chain and not switch the network', async function () { - const ganacheOptions = { - accounts: [ - { - secretKey: - '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', - balance: convertToHexValue(25000000000000000000), - }, - ], - }; + const port = 8546; + const chainId = 1338; + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], + concurrent: { port, chainId }, + }; + it('should add the Ganache test chain and not switch the network', async function () { await withFixtures( { dapp: true, @@ -36,12 +39,14 @@ describe('Chain Interactions', function () { ); // verify chain details - const [networkName, networkUrl, chainId] = await driver.findElements( - '.definition-list dd', - ); - assert.equal(await networkName.getText(), 'xDAI Chain'); - assert.equal(await networkUrl.getText(), 'https://dai.poa.network'); - assert.equal(await chainId.getText(), '100'); + const [ + networkName, + networkUrl, + chainIdElement, + ] = await driver.findElements('.definition-list dd'); + assert.equal(await networkName.getText(), `Localhost ${port}`); + assert.equal(await networkUrl.getText(), `http://127.0.0.1:${port}`); + assert.equal(await chainIdElement.getText(), chainId.toString()); // approve add chain, cancel switch chain await driver.clickElement({ text: 'Approve', tag: 'button' }); @@ -55,25 +60,16 @@ describe('Chain Interactions', function () { const networkDisplay = await driver.findElement('.network-display'); await networkDisplay.click(); assert.equal(await networkDisplay.getText(), 'Localhost 8545'); - const xDaiChain = await driver.findElements({ - text: 'xDAI Chain', + const ganacheChain = await driver.findElements({ + text: `Localhost ${port}`, tag: 'span', }); - assert.ok(xDaiChain.length, 1); + assert.ok(ganacheChain.length, 1); }, ); }); - it('should add the XDAI chain and switch the network', async function () { - const ganacheOptions = { - accounts: [ - { - secretKey: - '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', - balance: convertToHexValue(25000000000000000000), - }, - ], - }; + it('should add the Ganache chain and switch the network', async function () { await withFixtures( { dapp: true, @@ -107,7 +103,7 @@ describe('Chain Interactions', function () { // verify current network const networkDisplay = await driver.findElement('.network-display'); - assert.equal(await networkDisplay.getText(), 'xDAI Chain'); + assert.equal(await networkDisplay.getText(), `Localhost ${port}`); }, ); }); diff --git a/test/e2e/tests/dapp-interactions.spec.js b/test/e2e/tests/dapp-interactions.spec.js index 4baf16a70..40cef1b18 100644 --- a/test/e2e/tests/dapp-interactions.spec.js +++ b/test/e2e/tests/dapp-interactions.spec.js @@ -23,7 +23,10 @@ describe('Dapp interactions', function () { { dapp: true, fixtures: 'imported-account', - ganacheOptions, + ganacheOptions: { + ...ganacheOptions, + concurrent: { port: 8546, chainId: 1338 }, + }, title: this.test.title, }, async ({ driver }) => { @@ -44,6 +47,7 @@ describe('Dapp interactions', function () { // Trigger Notification await driver.switchToWindowWithTitle('E2E Test Dapp', windowHandles); await driver.clickElement('#addEthereumChain'); + await driver.waitUntilXWindowHandles(3); await driver.switchToWindowWithTitle( 'MetaMask Notification', windowHandles, diff --git a/test/e2e/tests/provider-api.spec.js b/test/e2e/tests/provider-api.spec.js index 14a4ff0eb..b85b4fb32 100644 --- a/test/e2e/tests/provider-api.spec.js +++ b/test/e2e/tests/provider-api.spec.js @@ -47,7 +47,7 @@ describe('MetaMask', function () { await driver.switchToWindowWithTitle('E2E Test Dapp', windowHandles); const switchedNetworkDiv = await driver.waitForSelector({ css: '#network', - text: '1', + text: '0x1', }); const switchedChainIdDiv = await driver.waitForSelector({ css: '#chainId', @@ -55,7 +55,7 @@ describe('MetaMask', function () { }); const accountsDiv = await driver.findElement('#accounts'); - assert.equal(await switchedNetworkDiv.getText(), '1'); + assert.equal(await switchedNetworkDiv.getText(), '0x1'); assert.equal(await switchedChainIdDiv.getText(), '0x1'); assert.equal( await accountsDiv.getText(), diff --git a/yarn.lock b/yarn.lock index a834bd0fb..9bbf6b74d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3132,10 +3132,10 @@ dependencies: "@metamask/controllers" "^29.0.1" -"@metamask/test-dapp@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@metamask/test-dapp/-/test-dapp-5.0.0.tgz#ecea832b57ff97782bfdd57a4af3408c7c64c02d" - integrity sha512-eR9JQ0jPOeP/hdQj9hUkqbvinfjVLYTtdHV+mDCN1tsNxiTdninZbltg9bx6Gqp91v9/9YPhlhXCmMQPq/AMxQ== +"@metamask/test-dapp@^5.1.1": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@metamask/test-dapp/-/test-dapp-5.1.1.tgz#aadebf28542809650c57aa8f5a3489c748e1414f" + integrity sha512-Vast76cYR9vOvSH9Ut8y8LXZbDledUE2BkiLX+PGP5AOTp8Pn8V6jiYg1D/slBh7M8/Q/1AmdW9D0B+fw7esBQ== "@metamask/types@^1.1.0": version "1.1.0" From 3267d6ecc42f6799e2994c138f963013e801d2fe Mon Sep 17 00:00:00 2001 From: Olusegun Akintayo Date: Fri, 17 Jun 2022 15:04:44 +0400 Subject: [PATCH 121/127] Only have timeout for when payload is getState (#14972) * Only have timeout for when payload is getState Signed-off-by: Akintayo A. Olusegun * Fix test Signed-off-by: Akintayo A. Olusegun --- app/scripts/lib/metaRPCClientFactory.js | 20 +++++++++++--------- app/scripts/lib/metaRPCClientFactory.test.js | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/scripts/lib/metaRPCClientFactory.js b/app/scripts/lib/metaRPCClientFactory.js index 2bd1f4855..1dfe572d2 100644 --- a/app/scripts/lib/metaRPCClientFactory.js +++ b/app/scripts/lib/metaRPCClientFactory.js @@ -18,16 +18,18 @@ class MetaRPCClient { this.requests.set(id, cb); this.connectionStream.write(payload); this.responseHandled[id] = false; - setTimeout(() => { - if (!this.responseHandled[id] && cb) { - delete this.responseHandled[id]; - return cb(new Error('No response from RPC'), null); - } + if (payload.method === 'getState') { + setTimeout(() => { + if (!this.responseHandled[id] && cb) { + delete this.responseHandled[id]; + return cb(new Error('No response from RPC'), null); + } - delete this.responseHandled[id]; - // needed for linter to pass - return true; - }, TEN_SECONDS_IN_MILLISECONDS); + delete this.responseHandled[id]; + // needed for linter to pass + return true; + }, TEN_SECONDS_IN_MILLISECONDS); + } } onNotification(handler) { diff --git a/app/scripts/lib/metaRPCClientFactory.test.js b/app/scripts/lib/metaRPCClientFactory.test.js index 3a5dc7094..d8fbf6fe3 100644 --- a/app/scripts/lib/metaRPCClientFactory.test.js +++ b/app/scripts/lib/metaRPCClientFactory.test.js @@ -138,7 +138,7 @@ describe('metaRPCClientFactory', () => { const metaRPCClient = metaRPCClientFactory(streamTest); const errorPromise = new Promise((_resolve, reject) => - metaRPCClient.foo('bad', (error, _) => { + metaRPCClient.getState('bad', (error, _) => { reject(error); }), ); From f85806ce979d9d756a9f4b911225d2db90dfc0bd Mon Sep 17 00:00:00 2001 From: seaona <54408225+seaona@users.noreply.github.com> Date: Thu, 23 Jun 2022 08:42:45 +0200 Subject: [PATCH 122/127] Update v10.16.0 changelog (#14947) * Changelog for 10.16.0 cleaned up * Updates for fixing PR review comments * Remove bug fix for a bug that never made it to prod * Re-phrased fix permissions to fix currency symbol * Update with review comment fixes and add Snaps uncategorized PRs * Reorg * Apply suggestions from code review - Snaps Co-authored-by: Frederik Bolding * Categorized snaps PRs under correct type Co-authored-by: Frederik Bolding --- CHANGELOG.md | 171 +++++++++++++++++---------------------------------- 1 file changed, 57 insertions(+), 114 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ff8e2acb..5a365590f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,122 +7,65 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## [10.16.0] -### Uncategorized -- Sync master to develop (v10.15.0) ([#14905](https://github.com/MetaMask/metamask-extension/pull/14905)) -- @metamask/providers@9.0.0 ([#14904](https://github.com/MetaMask/metamask-extension/pull/14904)) -- Update CHANGELOG.md -- Merge branch 'develop' into master-sync -- fix lavamoat policy files for drag and drop package ([#14901](https://github.com/MetaMask/metamask-extension/pull/14901)) -- Fix padding issue in Edit Nickname screen ([#14842](https://github.com/MetaMask/metamask-extension/pull/14842)) -- Create e2e test for snap in-app notification ([#14894](https://github.com/MetaMask/metamask-extension/pull/14894)) -- Handle an RPC provider delay in Swaps ([#14821](https://github.com/MetaMask/metamask-extension/pull/14821)) -- Add friendly error handling when background throws an error before listening for connection ([#14461](https://github.com/MetaMask/metamask-extension/pull/14461)) -- Fix 'website' casing ([#14860](https://github.com/MetaMask/metamask-extension/pull/14860)) -- Reduce the default slippage from 3% to 2% ([#14863](https://github.com/MetaMask/metamask-extension/pull/14863)) -- Update chromedriver and chrome binary ([#14877](https://github.com/MetaMask/metamask-extension/pull/14877)) -- Make content changes for the STX status page, remove old content ([#14805](https://github.com/MetaMask/metamask-extension/pull/14805)) -- Unit test proptype ([#14868](https://github.com/MetaMask/metamask-extension/pull/14868)) -- manifest: add https://chainid.network/chains.json ([#14810](https://github.com/MetaMask/metamask-extension/pull/14810)) -- Fix switching between ETH and USD ([#13827](https://github.com/MetaMask/metamask-extension/pull/13827)) -- Fixing add recipient flow issue with contact list/recent recipients ([#14771](https://github.com/MetaMask/metamask-extension/pull/14771)) -- Updating icon color ([#14835](https://github.com/MetaMask/metamask-extension/pull/14835)) -- fix: keep lock button text inside button boundaries ([#14335](https://github.com/MetaMask/metamask-extension/pull/14335)) -- Update minimist from v1.2.5 to v1.2.6 ([#14850](https://github.com/MetaMask/metamask-extension/pull/14850)) -- Updating some more instances ([#14851](https://github.com/MetaMask/metamask-extension/pull/14851)) -- Storybook: add TransactionListItem component page ([#14786](https://github.com/MetaMask/metamask-extension/pull/14786)) -- fix design breaks on the Settings Navbar when Internationalization ([#14012](https://github.com/MetaMask/metamask-extension/pull/14012)) -- Sync `master` with `develop` ([#14840](https://github.com/MetaMask/metamask-extension/pull/14840)) -- Updating all instances of Metamask to MetaMask in content, comments and tests ([#14848](https://github.com/MetaMask/metamask-extension/pull/14848)) -- Update LavaMoat policy -- Update e2e test to reflect change in Chrome -- Merge remote-tracking branch 'origin/develop' into master-sync -- Update `protobufjs` and remove obsolete advisory exclusion ([#14841](https://github.com/MetaMask/metamask-extension/pull/14841)) -- Include snap version in pill ([#14803](https://github.com/MetaMask/metamask-extension/pull/14803)) -- Update PULL_REQUEST_TEMPLATE.md ([#14790](https://github.com/MetaMask/metamask-extension/pull/14790)) -- fix: keystone transaction qrcode has no white spacing ([#14798](https://github.com/MetaMask/metamask-extension/pull/14798)) -- Snap notifications integration ([#14605](https://github.com/MetaMask/metamask-extension/pull/14605)) -- Upgrade @metamask/eth-ledger-bridge-keyring ([#14799](https://github.com/MetaMask/metamask-extension/pull/14799)) -- snaps-skunkworks@0.15.0 ([#14772](https://github.com/MetaMask/metamask-extension/pull/14772)) -- Fix proptype errors in network dropdown, tx list item details, and account details modal tests ([#14747](https://github.com/MetaMask/metamask-extension/pull/14747)) -- Ensure transaction type is correctly updated on edit ([#14721](https://github.com/MetaMask/metamask-extension/pull/14721)) +### Added +- Add friendly error handling screen, when UI fails to connect to background ([#14461](https://github.com/MetaMask/metamask-extension/pull/14461)) - Add fiat onboarding for AVAX and MATIC through Wyre ([#14683](https://github.com/MetaMask/metamask-extension/pull/14683)) -- Bump @metamask/contract-metadata from 1.33.0 to 1.35.0 ([#14791](https://github.com/MetaMask/metamask-extension/pull/14791)) -- Slight cleanup of constants/transactions, useTransactionDisplayData, and TransactionIcon ([#14784](https://github.com/MetaMask/metamask-extension/pull/14784)) -- Migrate the "estimateGas" API call to "getFees" for STX ([#14767](https://github.com/MetaMask/metamask-extension/pull/14767)) -- Ignore advisory GHSA-wm7h-9275-46v2 ([#14789](https://github.com/MetaMask/metamask-extension/pull/14789)) -- Adding flag for MV3 ([#14762](https://github.com/MetaMask/metamask-extension/pull/14762)) -- Add types to send state ([#14740](https://github.com/MetaMask/metamask-extension/pull/14740)) -- Remove site origin on snap install ([#14752](https://github.com/MetaMask/metamask-extension/pull/14752)) -- Update design tokens library from 1.5 to 1.6 WIP ([#14732](https://github.com/MetaMask/metamask-extension/pull/14732)) -- Enables the "Safe Transaction From" copy for safeTransferFrom transactions ([#14769](https://github.com/MetaMask/metamask-extension/pull/14769)) -- remove draft transaction ([#14701](https://github.com/MetaMask/metamask-extension/pull/14701)) -- Fix currency conversion rate ([#14713](https://github.com/MetaMask/metamask-extension/pull/14713)) -- Fix an edge case with missing top assets in Swaps ([#14688](https://github.com/MetaMask/metamask-extension/pull/14688)) -- Restore SiteOrigin chip on permission screen ([#14768](https://github.com/MetaMask/metamask-extension/pull/14768)) -- Remove module paths from bundle ([#14763](https://github.com/MetaMask/metamask-extension/pull/14763)) -- Sign button is enabled after scrolling all the way to the bottom ([#14745](https://github.com/MetaMask/metamask-extension/pull/14745)) -- EditGasFeeBtn: Insufficient number of substitutions for key "dappSuggestedTooltip" ([#14734](https://github.com/MetaMask/metamask-extension/pull/14734)) -- Enhance reusable SiteOrigin component ([#14720](https://github.com/MetaMask/metamask-extension/pull/14720)) -- Bump @metamask/auto-changelog from 2.5.0 to 2.6.0 ([#14741](https://github.com/MetaMask/metamask-extension/pull/14741)) -- Add hideEstimatedGasFee prop to sort-list and select-quote-popover tests ([#14725](https://github.com/MetaMask/metamask-extension/pull/14725)) -- Chain ID field use the same color pattern as the currency symbol field warning message below ([#14644](https://github.com/MetaMask/metamask-extension/pull/14644)) -- add gas_used to gasParams for conversion ([#14627](https://github.com/MetaMask/metamask-extension/pull/14627)) -- snaps-skunkworks@0.14.0 ([#14700](https://github.com/MetaMask/metamask-extension/pull/14700)) -- NetworksTab: make footer buttons nowrap ([#14733](https://github.com/MetaMask/metamask-extension/pull/14733)) -- Ensure send logs use current chain currency symbol ([#14726](https://github.com/MetaMask/metamask-extension/pull/14726)) -- Use enum for test snaps website URL ([#14727](https://github.com/MetaMask/metamask-extension/pull/14727)) -- Storybook: add SignatureRequestOriginal ([#14707](https://github.com/MetaMask/metamask-extension/pull/14707)) -- Storybook: Fix SignatureRequest component ([#14706](https://github.com/MetaMask/metamask-extension/pull/14706)) -- Unit test proptype ([#14564](https://github.com/MetaMask/metamask-extension/pull/14564)) -- Overall CSS #13441 ([#13902](https://github.com/MetaMask/metamask-extension/pull/13902)) -- "Cancel/reject all" for signature requests #13201 ([#13786](https://github.com/MetaMask/metamask-extension/pull/13786)) -- Bump `addons-linter` ([#14717](https://github.com/MetaMask/metamask-extension/pull/14717)) -- add networks without ticker trait ([#14607](https://github.com/MetaMask/metamask-extension/pull/14607)) -- Add Coinbase Pay as fiat onramp option ([#14648](https://github.com/MetaMask/metamask-extension/pull/14648)) -- Bump @metamask/controllers version, remove patches ([#14618](https://github.com/MetaMask/metamask-extension/pull/14618)) -- Removed onExecutionEnvironmentError ([#14698](https://github.com/MetaMask/metamask-extension/pull/14698)) -- Change styles for the high price impact notification in Swaps ([#14697](https://github.com/MetaMask/metamask-extension/pull/14697)) -- create e2e test for manageState snap ([#14699](https://github.com/MetaMask/metamask-extension/pull/14699)) -- Ensure ledger keyring message event listener are removed on metamask lock ([#14691](https://github.com/MetaMask/metamask-extension/pull/14691)) -- add case in useTransactionDisplayData to handle transaction type safeTransferFrom ([#14678](https://github.com/MetaMask/metamask-extension/pull/14678)) -- deps - patch secp256k1 for fast module init via lazy loading ([#14677](https://github.com/MetaMask/metamask-extension/pull/14677)) -- Event tracking for Token Detection V2 ([#14441](https://github.com/MetaMask/metamask-extension/pull/14441)) -- Fix Snaps view search ([#14693](https://github.com/MetaMask/metamask-extension/pull/14693)) -- Remove gas editing in Swaps ([#14673](https://github.com/MetaMask/metamask-extension/pull/14673)) -- Remove confirmation for terminated snaps ([#14566](https://github.com/MetaMask/metamask-extension/pull/14566)) -- Chromedriver v101 ([#14617](https://github.com/MetaMask/metamask-extension/pull/14617)) -- snaps-skunkworks@0.12.0 ([#14670](https://github.com/MetaMask/metamask-extension/pull/14670)) -- Fix auto-lock e2e test ([#14685](https://github.com/MetaMask/metamask-extension/pull/14685)) -- Fix eth_sign 'Learn more' dialog link ([#14667](https://github.com/MetaMask/metamask-extension/pull/14667)) -- Updating alert text color ([#14674](https://github.com/MetaMask/metamask-extension/pull/14674)) -- Auto lock e2e ([#14624](https://github.com/MetaMask/metamask-extension/pull/14624)) -- lavamoat - bump for stats support ([#14641](https://github.com/MetaMask/metamask-extension/pull/14641)) -- Fix Ropsten Test Network icon ([#14626](https://github.com/MetaMask/metamask-extension/pull/14626)) -- TransactionListItem: fix save/cancel rounded btn ([#14659](https://github.com/MetaMask/metamask-extension/pull/14659)) -- Add New Tokens Found page ([#14366](https://github.com/MetaMask/metamask-extension/pull/14366)) -- Swaps / STX improvements ([#14622](https://github.com/MetaMask/metamask-extension/pull/14622)) -- Simplify removeSnap functionality after snaps-skunkworks update ([#14646](https://github.com/MetaMask/metamask-extension/pull/14646)) -- Fixing Speed up/Cancel information text ([#14551](https://github.com/MetaMask/metamask-extension/pull/14551)) -- Fix SRP paste duplication ([#14625](https://github.com/MetaMask/metamask-extension/pull/14625)) -- LavaMoat - UI upgrade - secure package naming ([#14565](https://github.com/MetaMask/metamask-extension/pull/14565)) -- E2e send tests ([#14568](https://github.com/MetaMask/metamask-extension/pull/14568)) -- slip44@2.1.0 ([#14619](https://github.com/MetaMask/metamask-extension/pull/14619)) -- Reproducible `.zip` files ([#14623](https://github.com/MetaMask/metamask-extension/pull/14623)) -- fix incorrect casing of includeUsdRate option passed to CurrencyRateController ([#14615](https://github.com/MetaMask/metamask-extension/pull/14615)) -- Fix redundant entry in lockfile ([#14616](https://github.com/MetaMask/metamask-extension/pull/14616)) -- Jest tests - incremental coverage ([#14612](https://github.com/MetaMask/metamask-extension/pull/14612)) -- build - update bify-module-groups for build determinism ([#14610](https://github.com/MetaMask/metamask-extension/pull/14610)) +- Add Coinbase Pay as fiat onramp option ([#14648](https://github.com/MetaMask/metamask-extension/pull/14648)) - Add search information for Theme dropdown ([#14476](https://github.com/MetaMask/metamask-extension/pull/14476)) -- Update version parsing to allow rollback release ([#14288](https://github.com/MetaMask/metamask-extension/pull/14288)) -- Update bug-report.yml ([#14466](https://github.com/MetaMask/metamask-extension/pull/14466)) -- Disable STX if a regular tx is in progress ([#14554](https://github.com/MetaMask/metamask-extension/pull/14554)) -- Fix development build scripts ([#14594](https://github.com/MetaMask/metamask-extension/pull/14594)) -- Update PULL_REQUEST_TEMPLATE.md ([#14547](https://github.com/MetaMask/metamask-extension/pull/14547)) -- Patch gridplus-sdk for perf fix ([#14582](https://github.com/MetaMask/metamask-extension/pull/14582)) -- Add applyLavaMoat build flag ([#14583](https://github.com/MetaMask/metamask-extension/pull/14583)) -- fix cross-fetch moderate vulnerability alert ([#14570](https://github.com/MetaMask/metamask-extension/pull/14570)) -- Fix browser.tab.get call ([#14550](https://github.com/MetaMask/metamask-extension/pull/14550)) -- Added getAccounts suppressUnauthorized param ([#14126](https://github.com/MetaMask/metamask-extension/pull/14126)) +- **[FLASK]** Add in-app notifications for snaps ([#14605](https://github.com/MetaMask/metamask-extension/pull/14605)) +- **[FLASK]** Add `long-running` snap permission ([#14700](https://github.com/MetaMask/metamask-extension/pull/14700)) + +### Changed +- Update caret icon color on Home Page for darkmode, from black to white ([#14835](https://github.com/MetaMask/metamask-extension/pull/14835)) +- Update the color of the ledger alert text to adhere to design system guidelines ([#14674](https://github.com/MetaMask/metamask-extension/pull/14674)) +- Standardize display of connected site's origin data on all confirmation screens ([#14720](https://github.com/MetaMask/metamask-extension/pull/14720)) +- Improved app loading performance + - Improve loading performance by patching the "secp256k1" package ([#14677](https://github.com/MetaMask/metamask-extension/pull/14677)) + - Patch gridplus-sdk module for improving performance ([#14582](https://github.com/MetaMask/metamask-extension/pull/14582)) +- Swaps: ensure that native currency swap amounts are properly displayed on all networks, avoiding a bug where swap received amounts could equal gas costs ([#14821](https://github.com/MetaMask/metamask-extension/pull/14821)) +- Swaps: reduce the default slippage from 3% to 2% ([#14863](https://github.com/MetaMask/metamask-extension/pull/14863)) +- Swaps: update STX status content page ([#14805](https://github.com/MetaMask/metamask-extension/pull/14805)) + - Make STX status timer behaviour dependent on API values + - Change "Swap complete in < X:XX" to "Swap will complete in < X:XX" + - Change "Privately submitting the Swap..." to "Privately submitting your Swap..." +- Swaps: disable STX if a regular tx is in progress ([#14554](https://github.com/MetaMask/metamask-extension/pull/14554)) +- Swaps: remove gas editing ([#14673](https://github.com/MetaMask/metamask-extension/pull/14673)) +- **[FLASK]** Improve snap install screen ([#14803](https://github.com/MetaMask/metamask-extension/pull/14803), ([#14752](https://github.com/MetaMask/metamask-extension/pull/14752))) +- **[FLASK] BREAKING** Bump `@metamask/key-tree` used by snaps to `4.0.0` ([#14700](https://github.com/MetaMask/metamask-extension/pull/14700)) +- **[FLASK]** Stopped showing confirmations for terminated snaps ([#14566](https://github.com/MetaMask/metamask-extension/pull/14566)) + +### Fixed +- Fix line-wrapping in Edit Nickname screen by decreasing the padding ([#14842](https://github.com/MetaMask/metamask-extension/pull/14842)) +- Fix 'Currency Symbol' detection in network settings when using Firefox ([#14810](https://github.com/MetaMask/metamask-extension/pull/14810)) +- Fix switching between ETH and USD in the amount field on the send screen ([#13827](https://github.com/MetaMask/metamask-extension/pull/13827)) +- Fix addition of 'add recipient' events to the send flow change logs so that 'contact' and 'recent' recipient are correctly distinguished ([#14771](https://github.com/MetaMask/metamask-extension/pull/14771)) +- Fix lock button sizing for text exceeding button boundaries ([#14335](https://github.com/MetaMask/metamask-extension/pull/14335)) +- Fix all "MetaMask" instances wrongly written as "Metamask" + - ([#14851](https://github.com/MetaMask/metamask-extension/pull/14851)) + - ([#14848](https://github.com/MetaMask/metamask-extension/pull/14848)) +- Fix design break on the Settings navbar for certain locales ([#14012](https://github.com/MetaMask/metamask-extension/pull/14012)) +- Fix missing white spacing for keystone transaction qrcode in darkmode ([#14798](https://github.com/MetaMask/metamask-extension/pull/14798)) +- Fix rare bug that could cause unexpected accounts to be generated from Ledger and connected to MetaMask ([#14799](https://github.com/MetaMask/metamask-extension/pull/14799)) +- Fix bug that could cause the incorrect token to be selected after editing the token via the send edit flow ([#14721](https://github.com/MetaMask/metamask-extension/pull/14721)) +- Fix chain ID field to use the same color pattern as the currency symbol field warning message ([#14627](https://github.com/MetaMask/metamask-extension/pull/14627)) +- Fix currency conversion rate on the Edit tx screen ([#14713](https://github.com/MetaMask/metamask-extension/pull/14713)) +- Fix sign button so it is enabled after scrolling all the way to the bottom on the sign type data confirmation screen ([#14745](https://github.com/MetaMask/metamask-extension/pull/14745)) +- Fix wrong tx type text for `Safe Transaction From` ([#14769](https://github.com/MetaMask/metamask-extension/pull/14769)) +- Fix "Site Suggested" tooltip in `EditGasFeeBtn` to only display the origin of dapp suggested gas fee if the origin is provided ([#14734](https://github.com/MetaMask/metamask-extension/pull/14734)) +- Fix incorrect line breaks on footer buttons from NetworksTab ([#14733](https://github.com/MetaMask/metamask-extension/pull/14733)) +- Fix incorrect currency symbol in the send flow history state logs ([#14726](https://github.com/MetaMask/metamask-extension/pull/14726)) +- Fix batch cancel/reject for signature requests ([#13786](https://github.com/MetaMask/metamask-extension/pull/13786)) +- Fix "Learn more" dialog broken link from Eth Sign ([#14667](https://github.com/MetaMask/metamask-extension/pull/14667)) +- Fix mixed text for Speed up/Cancel information ([#14551](https://github.com/MetaMask/metamask-extension/pull/14551)) +- Fix SRP paste duplication ([#14625](https://github.com/MetaMask/metamask-extension/pull/14625)) +- Fix onboarding functionality so that users of dapps using our onboarding library are redirected to the dapp after completing onboarding ([#14550](https://github.com/MetaMask/metamask-extension/pull/14550)) +- Fix error handling for signature methods so that proper errors are returned to dapps when there is a permissions error ([#14126](https://github.com/MetaMask/metamask-extension/pull/14126)) +- Fix `Speed Up` and `Cancel` button styles from `TransactionListItem` consolidating them with `TransactionListItemDetails` buttons ([#14659](https://github.com/MetaMask/metamask-extension/pull/14659)) +- Swaps: fix wrong colour for the high price impact notification ([#14697](https://github.com/MetaMask/metamask-extension/pull/14697)) +- Swaps: fix edge case when missing top assets ([#14688](https://github.com/MetaMask/metamask-extension/pull/14688)) +- **[FLASK]** Fix issues with the snap startup process and usage of `WebAssembly` ([#14772](https://github.com/MetaMask/metamask-extension/pull/14772)) +- **[FLASK]** Fix issues with snap id encoding ([#14693](https://github.com/MetaMask/metamask-extension/pull/14693)) +- **[FLASK]** Fix multiple smaller bugs with snaps ([#14670](https://github.com/MetaMask/metamask-extension/pull/14670)) ## [10.15.0] ### Added From 167af09a11a3d5bc0e7d6c92f1c94bf96cbaf539 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Fri, 17 Jun 2022 23:11:09 +0200 Subject: [PATCH 123/127] Increase likelyhood of valid method signatures being returned by `getMethodData` (#14937) * Increase likelyhood of valid method signatures being returned by getMethodData * Update coverage * Update coverage * Update coverage * add a migration to clear knownMethodData * Small typo changes Co-authored-by: Alex --- app/scripts/migrations/072.js | 30 ++ app/scripts/migrations/072.test.js | 427 +++++++++++++++++++++ app/scripts/migrations/index.js | 2 + jest.config.js | 4 +- ui/helpers/utils/transactions.util.js | 28 +- ui/helpers/utils/transactions.util.test.js | 46 +++ 6 files changed, 527 insertions(+), 10 deletions(-) create mode 100644 app/scripts/migrations/072.js create mode 100644 app/scripts/migrations/072.test.js diff --git a/app/scripts/migrations/072.js b/app/scripts/migrations/072.js new file mode 100644 index 000000000..4e5e8aebf --- /dev/null +++ b/app/scripts/migrations/072.js @@ -0,0 +1,30 @@ +import { cloneDeep } from 'lodash'; + +const version = 72; + +/** + * Should empty the `knownMethodData` object in PreferencesController + */ +export default { + version, + async migrate(originalVersionedData) { + const versionedData = cloneDeep(originalVersionedData); + versionedData.meta.version = version; + const state = versionedData.data; + const newState = transformState(state); + versionedData.data = newState; + return versionedData; + }, +}; + +function transformState(state) { + const PreferencesController = state?.PreferencesController || {}; + + return { + ...state, + PreferencesController: { + ...PreferencesController, + knownMethodData: {}, + }, + }; +} diff --git a/app/scripts/migrations/072.test.js b/app/scripts/migrations/072.test.js new file mode 100644 index 000000000..70fedab84 --- /dev/null +++ b/app/scripts/migrations/072.test.js @@ -0,0 +1,427 @@ +import migration72 from './072'; + +describe('migration #72', () => { + it('should update the version metadata', async () => { + const oldStorage = { + meta: { + version: 71, + }, + data: {}, + }; + + const newStorage = await migration72.migrate(oldStorage); + expect(newStorage.meta).toStrictEqual({ + version: 72, + }); + }); + + it('should empty knownMethodData object in PreferencesController', async () => { + const oldStorage = { + meta: { + version: 71, + }, + data: { + PreferencesController: { + knownMethodData: { + '0x095ea7b3': { + name: 'Approve', + params: [ + { + type: 'address', + }, + { + type: 'uint256', + }, + ], + }, + '0x1249c58b': { + name: 'Mint', + params: [], + }, + '0x1688f0b9': { + name: 'Create Proxy With Nonce', + params: [ + { + type: 'address', + }, + { + type: 'bytes', + }, + { + type: 'uint256', + }, + ], + }, + '0x18cbafe5': { + name: 'Swap Exact Tokens For E T H', + params: [ + { + type: 'uint256', + }, + { + type: 'uint256', + }, + { + type: 'address[]', + }, + { + type: 'address', + }, + { + type: 'uint256', + }, + ], + }, + '0x23b872dd': { + name: 'Transfer From', + params: [ + { + type: 'address', + }, + { + type: 'address', + }, + { + type: 'uint256', + }, + ], + }, + '0x2e1a7d4d': { + name: 'Withdraw', + params: [ + { + type: 'uint256', + }, + ], + }, + '0x2e7ba6ef': { + name: 'Claim', + params: [ + { + type: 'uint256', + }, + { + type: 'address', + }, + { + type: 'uint256', + }, + { + type: 'bytes32[]', + }, + ], + }, + '0x2eb2c2d6': { + name: 'Safe Batch Transfer From', + params: [ + { + type: 'address', + }, + { + type: 'address', + }, + { + type: 'uint256[]', + }, + { + type: 'uint256[]', + }, + { + type: 'bytes', + }, + ], + }, + '0x3671f8cf': {}, + '0x41441d3b': { + name: 'Enter Staking', + params: [ + { + type: 'uint256', + }, + ], + }, + '0x441a3e70': { + name: 'Withdraw', + params: [ + { + type: 'uint256', + }, + { + type: 'uint256', + }, + ], + }, + '0x6f652e1a': { + name: 'Create Order', + params: [ + { + type: 'address', + }, + { + type: 'uint256', + }, + { + type: 'uint256', + }, + { + type: 'uint256', + }, + ], + }, + '0x8dbdbe6d': { + name: 'Deposit', + params: [ + { + type: 'uint256', + }, + { + type: 'uint256', + }, + { + type: 'address', + }, + ], + }, + '0x8ed955b9': { + name: 'Harvest All', + params: [], + }, + '0xa22cb465': { + name: 'Set Approval For All', + params: [ + { + type: 'address', + }, + { + type: 'bool', + }, + ], + }, + '0xa9059cbb': { + name: 'Transfer', + params: [ + { + type: 'address', + }, + { + type: 'uint256', + }, + ], + }, + '0xab834bab': { + name: 'Atomic Match_', + params: [ + { + type: 'address[14]', + }, + { + type: 'uint256[18]', + }, + { + type: 'uint8[8]', + }, + { + type: 'bytes', + }, + { + type: 'bytes', + }, + { + type: 'bytes', + }, + { + type: 'bytes', + }, + { + type: 'bytes', + }, + { + type: 'bytes', + }, + { + type: 'uint8[2]', + }, + { + type: 'bytes32[5]', + }, + ], + }, + '0xd0e30db0': { + name: 'Deposit', + params: [], + }, + '0xddd81f82': { + name: 'Register Proxy', + params: [], + }, + '0xded9382a': { + name: 'Remove Liquidity E T H With Permit', + params: [ + { + type: 'address', + }, + { + type: 'uint256', + }, + { + type: 'uint256', + }, + { + type: 'uint256', + }, + { + type: 'address', + }, + { + type: 'uint256', + }, + { + type: 'bool', + }, + { + type: 'uint8', + }, + { + type: 'bytes32', + }, + { + type: 'bytes32', + }, + ], + }, + '0xe2bbb158': { + name: 'Deposit', + params: [ + { + type: 'uint256', + }, + { + type: 'uint256', + }, + ], + }, + '0xf305d719': { + name: 'Add Liquidity E T H', + params: [ + { + type: 'address', + }, + { + type: 'uint256', + }, + { + type: 'uint256', + }, + { + type: 'uint256', + }, + { + type: 'address', + }, + { + type: 'uint256', + }, + ], + }, + }, + }, + }, + }; + + const newStorage = await migration72.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 72, + }, + data: { + PreferencesController: { + knownMethodData: {}, + }, + }, + }); + }); + + it('should preserve other PreferencesController state', async () => { + const oldStorage = { + meta: { + version: 71, + }, + data: { + PreferencesController: { + currentLocale: 'en', + dismissSeedBackUpReminder: false, + ipfsGateway: 'dweb.link', + knownMethodData: { + '0xd0e30db0': { + name: 'Deposit', + params: [], + }, + '0xddd81f82': { + name: 'Register Proxy', + params: [], + }, + }, + openSeaEnabled: false, + useTokenDetection: false, + }, + }, + }; + + const newStorage = await migration72.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 72, + }, + data: { + PreferencesController: { + currentLocale: 'en', + dismissSeedBackUpReminder: false, + ipfsGateway: 'dweb.link', + knownMethodData: {}, + openSeaEnabled: false, + useTokenDetection: false, + }, + }, + }); + }); + + it('should not change state in controllers other than PreferencesController', async () => { + const oldStorage = { + meta: { + version: 71, + }, + data: { + PreferencesController: { + knownMethodData: { + '0xd0e30db0': { + name: 'Deposit', + params: [], + }, + '0xddd81f82': { + name: 'Register Proxy', + params: [], + }, + }, + }, + data: { + FooController: { a: 'b' }, + }, + }, + }; + + const newStorage = await migration72.migrate(oldStorage); + expect(newStorage).toStrictEqual({ + meta: { + version: 72, + }, + data: { + PreferencesController: { + knownMethodData: {}, + }, + data: { + FooController: { a: 'b' }, + }, + }, + }); + }); +}); diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index 321b91319..b2a52040d 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -75,6 +75,7 @@ import m068 from './068'; import m069 from './069'; import m070 from './070'; import m071 from './071'; +import m072 from './072'; const migrations = [ m002, @@ -147,6 +148,7 @@ const migrations = [ m069, m070, m071, + m072, ]; export default migrations; diff --git a/jest.config.js b/jest.config.js index d64ca0864..38a48471f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -11,8 +11,8 @@ module.exports = { global: { branches: 44, functions: 42, - lines: 48, - statements: 48, + lines: 52, + statements: 52, }, './app/scripts/controllers/permissions/**/*.js': { branches: 100, diff --git a/ui/helpers/utils/transactions.util.js b/ui/helpers/utils/transactions.util.js index 25a38593f..d1380d8c0 100644 --- a/ui/helpers/utils/transactions.util.js +++ b/ui/helpers/utils/transactions.util.js @@ -35,12 +35,23 @@ async function getMethodFrom4Byte(fourBytePrefix) { mode: 'cors', }, ); + fourByteResponse.results.sort((a, b) => { + return new Date(a.created_at).getTime() < new Date(b.created_at).getTime() + ? -1 + : 1; + }); + return fourByteResponse.results[0].text_signature; +} - if (fourByteResponse.count === 1) { - return fourByteResponse.results[0].text_signature; +function pickShortest(registrySig, fourByteSig) { + if (!registrySig) { + return fourByteSig; + } else if (!fourByteSig) { + return registrySig; } - return null; + return fourByteSig.length < registrySig.length ? fourByteSig : registrySig; } + let registry; /** @@ -51,7 +62,7 @@ let registry; */ export async function getMethodDataAsync(fourBytePrefix) { try { - const fourByteSig = getMethodFrom4Byte(fourBytePrefix).catch((e) => { + const fourByteSig = await getMethodFrom4Byte(fourBytePrefix).catch((e) => { log.error(e); return null; }); @@ -60,11 +71,12 @@ export async function getMethodDataAsync(fourBytePrefix) { registry = new MethodRegistry({ provider: global.ethereumProvider }); } - let sig = await registry.lookup(fourBytePrefix); + const registrySig = await registry.lookup(fourBytePrefix).catch((e) => { + log.error(e); + return null; + }); - if (!sig) { - sig = await fourByteSig; - } + const sig = pickShortest(registrySig, fourByteSig); if (!sig) { return {}; diff --git a/ui/helpers/utils/transactions.util.test.js b/ui/helpers/utils/transactions.util.test.js index 591e46d07..eaf0a963a 100644 --- a/ui/helpers/utils/transactions.util.test.js +++ b/ui/helpers/utils/transactions.util.test.js @@ -1,3 +1,5 @@ +import { HttpProvider } from 'ethjs'; +import nock from 'nock'; import { TRANSACTION_GROUP_STATUSES, TRANSACTION_STATUSES, @@ -55,4 +57,48 @@ describe('Transactions utils', () => { ).toStrictEqual(false); }); }); + + describe('getMethodDataAsync', () => { + global.ethereumProvider = new HttpProvider( + 'https://mainnet.infura.io/v3/341eacb578dd44a1a049cbc5f6fd4035', + ); + it('returns a valid signature for setApprovalForAll', async () => { + nock('https://www.4byte.directory:443', { encodedQueryParams: true }) + .get('/api/v1/signatures/') + .query({ hex_signature: '0xa22cb465' }) + .reply(200, { + count: 2, + next: null, + previous: null, + results: [ + { + id: 841519, + created_at: '2022-06-12T00:50:19.305588Z', + text_signature: 'niceFunctionHerePlzClick943230089(address,bool)', + hex_signature: '0xa22cb465', + bytes_signature: '¢,´e', + }, + { + id: 29659, + created_at: '2018-04-11T21:47:39.980645Z', + text_signature: 'setApprovalForAll(address,bool)', + hex_signature: '0xa22cb465', + bytes_signature: '¢,´e', + }, + ], + }); + nock('https://mainnet.infura.io:443', { encodedQueryParams: true }) + .post('/v3/341eacb578dd44a1a049cbc5f6fd4035') + .reply(200, (_, requestBody) => ({ + id: requestBody.id, + jsonrpc: '2.0', + result: + '0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002f6e69636546756e6374696f6e48657265506c7a436c69636b39343332333030383928616464726573732c626f6f6c290000000000000000000000000000000000', + })); + expect(await utils.getMethodDataAsync('0xa22cb465')).toStrictEqual({ + name: 'Set Approval For All', + params: [{ type: 'address' }, { type: 'bool' }], + }); + }); + }); }); From c62730a7cb76a44d9a78d85d7b02cb34ac7ffd6f Mon Sep 17 00:00:00 2001 From: seaona Date: Thu, 23 Jun 2022 11:44:20 +0200 Subject: [PATCH 124/127] Signature method resolution added to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a365590f..f88d3ca39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix onboarding functionality so that users of dapps using our onboarding library are redirected to the dapp after completing onboarding ([#14550](https://github.com/MetaMask/metamask-extension/pull/14550)) - Fix error handling for signature methods so that proper errors are returned to dapps when there is a permissions error ([#14126](https://github.com/MetaMask/metamask-extension/pull/14126)) - Fix `Speed Up` and `Cancel` button styles from `TransactionListItem` consolidating them with `TransactionListItemDetails` buttons ([#14659](https://github.com/MetaMask/metamask-extension/pull/14659)) +- Fix likelihood of successfully resolving method signatures, by updating logic for picking methods from the 4byte directory and the decentralized method registry ([#14937](https://github.com/MetaMask/metamask-extension/pull/14937)) - Swaps: fix wrong colour for the high price impact notification ([#14697](https://github.com/MetaMask/metamask-extension/pull/14697)) - Swaps: fix edge case when missing top assets ([#14688](https://github.com/MetaMask/metamask-extension/pull/14688)) - **[FLASK]** Fix issues with the snap startup process and usage of `WebAssembly` ([#14772](https://github.com/MetaMask/metamask-extension/pull/14772)) From ece2ed37cb309476290f94e857a6328ac1b98b5b Mon Sep 17 00:00:00 2001 From: seaona Date: Thu, 23 Jun 2022 12:46:29 +0200 Subject: [PATCH 125/127] Re-wording changelog for method resolution fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f88d3ca39..7d7715943 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,7 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix onboarding functionality so that users of dapps using our onboarding library are redirected to the dapp after completing onboarding ([#14550](https://github.com/MetaMask/metamask-extension/pull/14550)) - Fix error handling for signature methods so that proper errors are returned to dapps when there is a permissions error ([#14126](https://github.com/MetaMask/metamask-extension/pull/14126)) - Fix `Speed Up` and `Cancel` button styles from `TransactionListItem` consolidating them with `TransactionListItemDetails` buttons ([#14659](https://github.com/MetaMask/metamask-extension/pull/14659)) -- Fix likelihood of successfully resolving method signatures, by updating logic for picking methods from the 4byte directory and the decentralized method registry ([#14937](https://github.com/MetaMask/metamask-extension/pull/14937)) +- Fix to prevent display of misleading or malicious contract method names ([#14937](https://github.com/MetaMask/metamask-extension/pull/14937)) - Swaps: fix wrong colour for the high price impact notification ([#14697](https://github.com/MetaMask/metamask-extension/pull/14697)) - Swaps: fix edge case when missing top assets ([#14688](https://github.com/MetaMask/metamask-extension/pull/14688)) - **[FLASK]** Fix issues with the snap startup process and usage of `WebAssembly` ([#14772](https://github.com/MetaMask/metamask-extension/pull/14772)) From 2d41e5dcfa8e079a8b18339f93c080d77c6ab63a Mon Sep 17 00:00:00 2001 From: seaona Date: Thu, 23 Jun 2022 14:28:05 +0200 Subject: [PATCH 126/127] Fix changelog release bottom list --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d470199b0..cb7394f03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3031,8 +3031,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.16.0...HEAD -[10.16.0]: https://github.com/MetaMask/metamask-extension/compare/v10.15.0...v10.16.0 -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.15.1...HEAD +[10.16.0]: https://github.com/MetaMask/metamask-extension/compare/v10.15.1...v10.16.0 [10.15.1]: https://github.com/MetaMask/metamask-extension/compare/v10.15.0...v10.15.1 [10.15.0]: https://github.com/MetaMask/metamask-extension/compare/v10.14.7...v10.15.0 [10.14.7]: https://github.com/MetaMask/metamask-extension/compare/v10.14.6...v10.14.7 From de228da78378c2611efd5f991c5b8c03b47a8ce4 Mon Sep 17 00:00:00 2001 From: seaona Date: Thu, 23 Jun 2022 14:33:43 +0200 Subject: [PATCH 127/127] Add space under Flask PR item --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb7394f03..246668cf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **[FLASK]** Fix issues with the snap startup process and usage of `WebAssembly` ([#14772](https://github.com/MetaMask/metamask-extension/pull/14772)) - **[FLASK]** Fix issues with snap id encoding ([#14693](https://github.com/MetaMask/metamask-extension/pull/14693)) - **[FLASK]** Fix multiple smaller bugs with snaps ([#14670](https://github.com/MetaMask/metamask-extension/pull/14670)) + ## [10.15.1] ### Fixed - Fix Ledger connection failures that can occur after remove all hardware wallet accounts and reconnecting ([#14993](https://github.com/MetaMask/metamask-extension/pull/14993))