diff --git a/.circleci/config.yml b/.circleci/config.yml
index 76992feca..bf6513533 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -56,9 +56,6 @@ workflows:
- prep-build-test-flask:
requires:
- prep-deps
- - prep-build-test-metrics:
- requires:
- - prep-deps
- test-storybook:
requires:
- prep-deps
@@ -87,12 +84,6 @@ workflows:
- test-e2e-firefox-snaps:
requires:
- prep-build-test-flask
- - test-e2e-chrome-metrics:
- requires:
- - prep-build-test-metrics
- - test-e2e-firefox-metrics:
- requires:
- - prep-build-test-metrics
- test-unit:
requires:
- prep-deps
@@ -137,8 +128,6 @@ workflows:
- test-mozilla-lint-flask
- test-e2e-chrome
- test-e2e-firefox
- - test-e2e-chrome-metrics
- - test-e2e-firefox-metrics
- test-e2e-chrome-snaps
- test-e2e-firefox-snaps
- benchmark:
@@ -338,27 +327,6 @@ jobs:
- dist-test
- builds-test
- prep-build-test-metrics:
- executor: node-browsers-medium-plus
- steps:
- - checkout
- - attach_workspace:
- at: .
- - run:
- name: Build extension for testing metrics
- command: yarn build:test:metrics
- - run:
- name: Move test build to 'dist-test-metrics' to avoid conflict with production build
- command: mv ./dist ./dist-test-metrics
- - run:
- name: Move test zips to 'builds-test' to avoid conflict with production build
- command: mv ./builds ./builds-test-metrics
- - persist_to_workspace:
- root: .
- paths:
- - dist-test-metrics
- - builds-test-metrics
-
prep-build-storybook:
executor: node-browsers
steps:
@@ -553,33 +521,6 @@ jobs:
path: test-artifacts
destination: test-artifacts
- test-e2e-chrome-metrics:
- executor: node-browsers
- steps:
- - checkout
- - run:
- name: Re-Install Chrome
- command: ./.circleci/scripts/chrome-install.sh
- - attach_workspace:
- at: .
- - run:
- name: Move test build to dist
- command: mv ./dist-test-metrics ./dist
- - run:
- name: Move test zips to builds
- command: mv ./builds-test-metrics ./builds
- - run:
- name: test:e2e:chrome:metrics
- command: |
- if .circleci/scripts/test-run-e2e.sh
- then
- yarn test:e2e:chrome:metrics --retries 2
- fi
- no_output_timeout: 20m
- - store_artifacts:
- path: test-artifacts
- destination: test-artifacts
-
test-e2e-firefox:
executor: node-browsers-medium-plus
steps:
@@ -607,33 +548,6 @@ jobs:
path: test-artifacts
destination: test-artifacts
- test-e2e-firefox-metrics:
- executor: node-browsers
- steps:
- - checkout
- - run:
- name: Install Firefox
- command: ./.circleci/scripts/firefox-install.sh
- - attach_workspace:
- at: .
- - run:
- name: Move test build to dist
- command: mv ./dist-test-metrics ./dist
- - run:
- name: Move test zips to builds
- command: mv ./builds-test-metrics ./builds
- - run:
- name: test:e2e:firefox:metrics
- command: |
- if .circleci/scripts/test-run-e2e.sh
- then
- yarn test:e2e:firefox:metrics --retries 2
- fi
- no_output_timeout: 20m
- - store_artifacts:
- path: test-artifacts
- destination: test-artifacts
-
benchmark:
executor: node-browsers-medium-plus
steps:
diff --git a/.depcheckrc.yml b/.depcheckrc.yml
index 15f3c91b9..f7c189f91 100644
--- a/.depcheckrc.yml
+++ b/.depcheckrc.yml
@@ -18,6 +18,7 @@ ignores:
- '@metamask/auto-changelog' # invoked as `auto-changelog`
- '@metamask/forwarder'
- '@metamask/test-dapp'
+ - '@metamask/design-tokens' # Only imported in index.css
- '@sentry/cli' # invoked as `sentry-cli`
- 'chromedriver'
- 'depcheck' # ooo meta
@@ -34,6 +35,7 @@ ignores:
- '@storybook/core'
- '@storybook/addon-essentials'
- '@storybook/addon-a11y'
+ - 'storybook-dark-mode'
- 'style-loader'
- 'css-loader'
- 'sass-loader'
diff --git a/.eslintrc.babel.js b/.eslintrc.babel.js
new file mode 100644
index 000000000..b067db84b
--- /dev/null
+++ b/.eslintrc.babel.js
@@ -0,0 +1,9 @@
+module.exports = {
+ parser: '@babel/eslint-parser',
+ plugins: ['@babel'],
+ rules: {
+ '@babel/no-invalid-this': 'error',
+ // Prettier handles this
+ '@babel/semi': 'off',
+ },
+};
diff --git a/.eslintrc.base.js b/.eslintrc.base.js
new file mode 100644
index 000000000..47c379969
--- /dev/null
+++ b/.eslintrc.base.js
@@ -0,0 +1,67 @@
+const path = require('path');
+
+module.exports = {
+ extends: [
+ '@metamask/eslint-config',
+ path.resolve(__dirname, '.eslintrc.jsdoc.js'),
+ ],
+
+ globals: {
+ document: 'readonly',
+ window: 'readonly',
+ },
+
+ rules: {
+ 'default-param-last': 'off',
+ 'prefer-object-spread': 'error',
+ 'require-atomic-updates': 'off',
+
+ // This is the same as our default config, but for the noted exceptions
+ 'spaced-comment': [
+ 'error',
+ 'always',
+ {
+ markers: [
+ 'global',
+ 'globals',
+ 'eslint',
+ 'eslint-disable',
+ '*package',
+ '!',
+ ',',
+ // Local additions
+ '/:', // This is for our code fences
+ ],
+ exceptions: ['=', '-'],
+ },
+ ],
+
+ 'no-invalid-this': 'off',
+
+ // TODO: remove this override
+ 'padding-line-between-statements': [
+ 'error',
+ {
+ blankLine: 'always',
+ prev: 'directive',
+ next: '*',
+ },
+ {
+ blankLine: 'any',
+ prev: 'directive',
+ next: 'directive',
+ },
+ // Disabled temporarily to reduce conflicts while PR queue is large
+ // {
+ // blankLine: 'always',
+ // prev: ['multiline-block-like', 'multiline-expression'],
+ // next: ['multiline-block-like', 'multiline-expression'],
+ // },
+ ],
+
+ // It is common to import modules without assigning them to variables in
+ // a browser context. For instance, we may import polyfills which change
+ // global variables, or we may import stylesheets.
+ 'import/no-unassigned-import': 'off',
+ },
+};
diff --git a/.eslintrc.js b/.eslintrc.js
index 9c0bc07e9..84b68eada 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,132 +1,112 @@
+const path = require('path');
const { version: reactVersion } = require('react/package.json');
module.exports = {
root: true,
- parser: '@babel/eslint-parser',
- parserOptions: {
- sourceType: 'module',
- ecmaVersion: 2017,
- ecmaFeatures: {
- experimentalObjectRestSpread: true,
- impliedStrict: true,
- modules: true,
- blockBindings: true,
- arrowFunctions: true,
- objectLiteralShorthandMethods: true,
- objectLiteralShorthandProperties: true,
- templateStrings: true,
- classes: true,
- jsx: true,
- },
- },
-
+ // Ignore files which are also in .prettierignore
ignorePatterns: [
- '!.eslintrc.js',
- '!.mocharc.js',
- 'node_modules/**',
- 'dist/**',
- 'builds/**',
- 'test-*/**',
- 'docs/**',
- 'coverage/',
- 'jest-coverage/',
- 'development/chromereload.js',
'app/vendor/**',
- 'test/e2e/send-eth-with-private-key-test/**',
- 'nyc_output/**',
- '.vscode/**',
- 'lavamoat/*/policy.json',
- 'storybook-build/**',
+ 'builds/**/*',
+ 'dist/**/*',
+ 'development/chromereload.js',
],
-
- extends: ['@metamask/eslint-config', '@metamask/eslint-config-nodejs'],
-
- plugins: ['@babel', 'import', 'jsdoc'],
-
- globals: {
- document: 'readonly',
- window: 'readonly',
- },
-
- rules: {
- 'default-param-last': 'off',
- 'prefer-object-spread': 'error',
- 'require-atomic-updates': 'off',
-
- // This is the same as our default config, but for the noted exceptions
- 'spaced-comment': [
- 'error',
- 'always',
- {
- markers: [
- 'global',
- 'globals',
- 'eslint',
- 'eslint-disable',
- '*package',
- '!',
- ',',
- // Local additions
- '/:', // This is for our code fences
- ],
- exceptions: ['=', '-'],
- },
- ],
-
- 'import/no-unassigned-import': 'off',
-
- 'no-invalid-this': 'off',
- '@babel/no-invalid-this': 'error',
-
- // Prettier handles this
- '@babel/semi': 'off',
-
- 'node/no-process-env': 'off',
-
- // Allow tag `jest-environment` to work around Jest bug
- // See: https://github.com/facebook/jest/issues/7780
- 'jsdoc/check-tag-names': ['error', { definedTags: ['jest-environment'] }],
-
- // TODO: remove this override
- 'padding-line-between-statements': [
- 'error',
- {
- blankLine: 'always',
- prev: 'directive',
- next: '*',
- },
- {
- blankLine: 'any',
- prev: 'directive',
- next: 'directive',
- },
- // Disabled temporarily to reduce conflicts while PR queue is large
- // {
- // blankLine: 'always',
- // prev: ['multiline-block-like', 'multiline-expression'],
- // next: ['multiline-block-like', 'multiline-expression'],
- // },
- ],
-
- // TODO: re-enable these rules
- 'node/no-sync': 'off',
- 'node/no-unpublished-import': 'off',
- 'node/no-unpublished-require': 'off',
- 'jsdoc/match-description': 'off',
- 'jsdoc/require-description': 'off',
- 'jsdoc/require-jsdoc': 'off',
- 'jsdoc/require-param-description': 'off',
- 'jsdoc/require-param-type': 'off',
- 'jsdoc/require-returns-description': 'off',
- 'jsdoc/require-returns-type': 'off',
- 'jsdoc/require-returns': 'off',
- 'jsdoc/valid-types': 'off',
- },
overrides: [
+ /**
+ * == Modules ==
+ *
+ * The first two sections here, which cover module syntax, are mutually
+ * exclusive: the set of files covered between them may NOT overlap. This is
+ * because we do not allow a file to use two different styles for specifying
+ * imports and exports (however theoretically possible it may be).
+ */
+
{
- files: ['ui/**/*.js', 'test/lib/render-helpers.js', 'test/jest/*.js'],
- plugins: ['react'],
+ /**
+ * Modules (CommonJS module syntax)
+ *
+ * This is code that uses `require()` and `module.exports` to import and
+ * export other modules.
+ */
+ files: [
+ '.eslintrc.js',
+ '.eslintrc.*.js',
+ '.mocharc.js',
+ '*.config.js',
+ 'development/**/*.js',
+ 'test/e2e/**/*.js',
+ 'test/helpers/*.js',
+ 'test/lib/wait-until-called.js',
+ ],
+ extends: [
+ path.resolve(__dirname, '.eslintrc.base.js'),
+ path.resolve(__dirname, '.eslintrc.node.js'),
+ path.resolve(__dirname, '.eslintrc.babel.js'),
+ ],
+ parserOptions: {
+ sourceType: 'module',
+ },
+ rules: {
+ // This rule does not work with CommonJS modules. We will just have to
+ // trust that all of the files specified above are indeed modules.
+ 'import/unambiguous': 'off',
+ },
+ },
+ /**
+ * Modules (ES module syntax)
+ *
+ * This is code that explicitly uses `import`/`export` instead of
+ * `require`/`module.exports`.
+ */
+ {
+ files: [
+ 'app/**/*.js',
+ 'shared/**/*.js',
+ 'ui/**/*.js',
+ '**/*.test.js',
+ 'test/lib/**/*.js',
+ 'test/mocks/**/*.js',
+ 'test/jest/**/*.js',
+ 'test/stub/**/*.js',
+ 'test/unit-global/**/*.js',
+ ],
+ // TODO: Convert these files to modern JS
+ excludedFiles: ['test/lib/wait-until-called.js'],
+ extends: [
+ path.resolve(__dirname, '.eslintrc.base.js'),
+ path.resolve(__dirname, '.eslintrc.node.js'),
+ path.resolve(__dirname, '.eslintrc.babel.js'),
+ ],
+ parserOptions: {
+ sourceType: 'module',
+ },
+ },
+
+ /**
+ * == Everything else ==
+ *
+ * The sections from here on out may overlap with each other in various
+ * ways depending on their function.
+ */
+
+ /**
+ * React-specific code
+ *
+ * Code in this category contains JSX and hence needs to be run through the
+ * React plugin.
+ */
+ {
+ files: [
+ 'test/lib/render-helpers.js',
+ 'test/jest/rendering.js',
+ 'ui/**/*.js',
+ ],
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
+ parserOptions: {
+ ecmaFeatures: {
+ jsx: true,
+ },
+ },
+ plugins: ['react'],
rules: {
'react/no-unused-prop-types': 'error',
'react/no-unused-state': 'error',
@@ -139,74 +119,100 @@ module.exports = {
'react/default-props-match-prop-types': 'error',
'react/jsx-no-duplicate-props': 'error',
},
- },
- {
- files: ['test/e2e/**/*.spec.js'],
- extends: ['@metamask/eslint-config-mocha'],
- rules: {
- 'mocha/no-hooks-for-single-case': 'off',
- 'mocha/no-setup-in-describe': 'off',
+ settings: {
+ react: {
+ // If this is set to 'detect', ESLint will import React in order to
+ // find its version. Because we run ESLint in the build system under
+ // LavaMoat, this means that detecting the React version requires a
+ // LavaMoat policy for all of React, in the build system. That's a
+ // no-go, so we grab it from React's package.json.
+ version: reactVersion,
+ },
},
},
+ /**
+ * Mocha tests
+ *
+ * These are files that make use of globals and syntax introduced by the
+ * Mocha library.
+ */
{
- files: ['app/scripts/migrations/*.js', '*.stories.js'],
- rules: {
- 'import/no-anonymous-default-export': ['error', { allowObject: true }],
- },
- },
- {
- files: ['app/scripts/migrations/*.js'],
- rules: {
- 'node/global-require': 'off',
- },
- },
- {
- files: ['**/*.test.js'],
+ files: [
+ '**/*.test.js',
+ 'test/lib/wait-until-called.js',
+ 'test/e2e/**/*.spec.js',
+ ],
excludedFiles: [
- 'ui/**/*.test.js',
- 'ui/__mocks__/*.js',
- 'shared/**/*.test.js',
- 'development/**/*.test.js',
+ 'app/scripts/controllers/network/**/*.test.js',
+ 'app/scripts/controllers/permissions/**/*.test.js',
'app/scripts/lib/**/*.test.js',
'app/scripts/migrations/*.test.js',
'app/scripts/platforms/*.test.js',
- 'app/scripts/controllers/network/**/*.test.js',
- 'app/scripts/controllers/permissions/**/*.test.js',
+ 'development/**/*.test.js',
+ 'shared/**/*.test.js',
+ 'ui/**/*.test.js',
+ 'ui/__mocks__/*.js',
],
extends: ['@metamask/eslint-config-mocha'],
rules: {
+ // In Mocha tests, it is common to use `this` to store values or do
+ // things like force the test to fail.
+ '@babel/no-invalid-this': 'off',
'mocha/no-setup-in-describe': 'off',
},
},
+ /**
+ * Jest tests
+ *
+ * These are files that make use of globals and syntax introduced by the
+ * Jest library.
+ */
{
- files: ['**/__snapshots__/*.snap'],
- plugins: ['jest'],
+ files: [
+ '**/__snapshots__/*.snap',
+ 'app/scripts/controllers/network/**/*.test.js',
+ 'app/scripts/controllers/permissions/**/*.test.js',
+ 'app/scripts/lib/**/*.test.js',
+ 'app/scripts/migrations/*.test.js',
+ 'app/scripts/platforms/*.test.js',
+ 'development/**/*.test.js',
+ 'shared/**/*.test.js',
+ 'test/jest/*.js',
+ 'test/helpers/*.js',
+ 'ui/**/*.test.js',
+ 'ui/__mocks__/*.js',
+ ],
+ extends: ['@metamask/eslint-config-jest'],
+ parserOptions: {
+ sourceType: 'module',
+ },
rules: {
+ 'import/unambiguous': 'off',
+ 'import/named': 'off',
'jest/no-large-snapshots': [
'error',
{ maxSize: 50, inlineMaxSize: 50 },
],
- },
- },
- {
- files: [
- 'ui/**/*.test.js',
- 'ui/__mocks__/*.js',
- 'shared/**/*.test.js',
- 'development/**/*.test.js',
- 'app/scripts/lib/**/*.test.js',
- 'app/scripts/migrations/*.test.js',
- 'app/scripts/platforms/*.test.js',
- 'app/scripts/controllers/network/**/*.test.js',
- 'app/scripts/controllers/permissions/**/*.test.js',
- ],
- extends: ['@metamask/eslint-config-jest'],
- rules: {
'jest/no-restricted-matchers': 'off',
- 'import/unambiguous': 'off',
- 'import/named': 'off',
},
},
+ /**
+ * Migrations
+ */
+ {
+ files: ['app/scripts/migrations/*.js', '**/*.stories.js'],
+ rules: {
+ 'import/no-anonymous-default-export': ['error', { allowObject: true }],
+ },
+ },
+ /**
+ * Executables and related files
+ *
+ * These are files that run in a Node context. They are either designed to
+ * run as executables (in which case they will have a shebang at the top) or
+ * are dependencies of executables (in which case they may use
+ * `process.exit` to exit).
+ */
{
files: [
'development/**/*.js',
@@ -218,27 +224,9 @@ module.exports = {
'node/shebang': 'off',
},
},
- {
- files: [
- '.eslintrc.js',
- '.mocharc.js',
- 'babel.config.js',
- 'jest.config.js',
- 'nyc.config.js',
- 'stylelint.config.js',
- 'app/scripts/lockdown-run.js',
- 'app/scripts/lockdown-more.js',
- 'development/**/*.js',
- 'test/e2e/**/*.js',
- 'test/env.js',
- 'test/setup.js',
- 'test/helpers/protect-intrinsics-helpers.js',
- 'test/lib/wait-until-called.js',
- ],
- parserOptions: {
- sourceType: 'script',
- },
- },
+ /**
+ * Lockdown files
+ */
{
files: [
'app/scripts/lockdown-run.js',
@@ -251,19 +239,11 @@ module.exports = {
Compartment: 'readonly',
},
},
+ {
+ files: ['app/scripts/lockdown-run.js', 'app/scripts/lockdown-more.js'],
+ parserOptions: {
+ sourceType: 'script',
+ },
+ },
],
-
- settings: {
- jsdoc: {
- mode: 'typescript',
- },
- react: {
- // If this is set to 'detect', ESLint will import React in order to find
- // its version. Because we run ESLint in the build system under LavaMoat,
- // this means that detecting the React version requires a LavaMoat policy
- // for all of React, in the build system. That's a no-go, so we grab it
- // from React's package.json.
- version: reactVersion,
- },
- },
};
diff --git a/.eslintrc.jsdoc.js b/.eslintrc.jsdoc.js
new file mode 100644
index 000000000..862145853
--- /dev/null
+++ b/.eslintrc.jsdoc.js
@@ -0,0 +1,23 @@
+module.exports = {
+ // Note that jsdoc is already in the `plugins` array thanks to
+ // @metamask/eslint-config — this just extends the config there
+ rules: {
+ // Allow tag `jest-environment` to work around Jest bug
+ // See: https://github.com/facebook/jest/issues/7780
+ 'jsdoc/check-tag-names': ['error', { definedTags: ['jest-environment'] }],
+ 'jsdoc/match-description': 'off',
+ 'jsdoc/require-description': 'off',
+ 'jsdoc/require-jsdoc': 'off',
+ 'jsdoc/require-param-description': 'off',
+ 'jsdoc/require-param-type': 'off',
+ 'jsdoc/require-returns-description': 'off',
+ 'jsdoc/require-returns-type': 'off',
+ 'jsdoc/require-returns': 'off',
+ 'jsdoc/valid-types': 'off',
+ },
+ settings: {
+ jsdoc: {
+ mode: 'typescript',
+ },
+ },
+};
diff --git a/.eslintrc.node.js b/.eslintrc.node.js
new file mode 100644
index 000000000..78a12a346
--- /dev/null
+++ b/.eslintrc.node.js
@@ -0,0 +1,10 @@
+module.exports = {
+ extends: ['@metamask/eslint-config-nodejs'],
+ rules: {
+ 'node/no-process-env': 'off',
+ // TODO: re-enable these rules
+ 'node/no-sync': 'off',
+ 'node/no-unpublished-import': 'off',
+ 'node/no-unpublished-require': 'off',
+ },
+};
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
index cb38aaf16..889bd9d1b 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.yml
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -89,6 +89,7 @@ body:
- Trezor
- Keystone
- GridPlus Lattice1
+ - AirGap Vault
- Other (please elaborate in the "Additional Context" section)
- type: textarea
id: additional
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 4cd184317..da7708be2 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,8 +1,47 @@
-Fixes: #
+## Explanation
-Explanation:
+
+
+## More information
+
+
+
+## Screenshots/Screencaps
+
+
+
+### Before
+
+
+
+### After
+
+
+
+## Manual testing steps
+
+
diff --git a/.prettierignore b/.prettierignore
index 2e0417ca7..a98c312ad 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -10,3 +10,4 @@ app/vendor/**
.vscode/**
test/e2e/send-eth-with-private-key-test/**
*.scss
+development/chromereload.js
diff --git a/.storybook/3.COLORS.stories.mdx b/.storybook/3.COLORS.stories.mdx
new file mode 100644
index 000000000..b694a721a
--- /dev/null
+++ b/.storybook/3.COLORS.stories.mdx
@@ -0,0 +1,201 @@
+import { Meta } from '@storybook/addon-docs';
+import ActionaleMessage from '../ui/components/ui/actionable-message';
+import designTokenDiagramImage from './images/design.token.graphic.svg';
+
+
+
+# Color
+
+Color is used to express style and communicate meaning.
+
+
+
+
+
+## Design tokens
+
+We are importing design tokens as CSS variables from [@metamask/design-tokens](https://github.com/MetaMask/design-tokens) repo to help consolidate colors and enable theming across all MetaMask products.
+
+### Token tiers
+
+We follow a 3 tiered system for color design tokens and css variables.
+
+
+
+
+
+
+
+
+### **Brand colors** (tier 1)
+
+These colors **SHOULD NOT** be used in your styles directly. They are used as a reference for the [theme colors](#theme-colors-tier-2). Brand colors should just keep track of every color used in our app.
+
+#### Example of brand color css variables
+
+```css
+/** !!!DO NOT USE BRAND COLORS DIRECTLY IN YOUR CODE!!! */
+var(--brand-colors-white-white000)
+var(--brand-colors-white-white010)
+var(--brand-colors-grey-grey030)
+```
+
+### **Theme colors** (tier 2)
+
+Theme colors are color agnostic, semantically neutral and theme compatible design tokens that you can use in your code and styles. Please refer to the description of each token for it's intended purpose in [@metamask/design-tokens](https://github.com/MetaMask/design-tokens/blob/main/src/figma/tokens.json#L329-L554).
+
+#### Example of theme color css variables
+
+```css
+/** Backgrounds */
+var(--color-background-default)
+var(--color-background-alternative)
+
+/** Text */
+var(--color-text-default)
+var(--color-text-alternative)
+var(--color-text-muted)
+
+/** Icons */
+var(--color-icon-default)
+var(--color-icon-muted)
+
+/** Borders */
+var(--color-border-default)
+var(--color-border-muted)
+
+/** Overlays */
+var(--color-overlay-default)
+var(--color-overlay-inverse)
+
+/** User Actions */
+var(--color-primary-default)
+var(--color-primary-alternative)
+var(--color-primary-muted)
+var(--color-primary-inverse)
+var(--color-primary-disabled)
+
+var(--color-secondary-default)
+var(--color-secondary-alternative)
+var(--color-secondary-muted)
+var(--color-secondary-inverse)
+var(--color-secondary-disabled)
+
+/** States */
+/** Error */
+var(--color-error-default)
+var(--color-error-alternative)
+var(--color-error-muted)
+var(--color-error-inverse)
+var(--color-error-disabled)
+
+/** Warning */
+var(--color-warning-default)
+var(--color-warning-alternative)
+var(--color-warning-muted)
+var(--color-warning-inverse)
+var(--color-warning-disabled)
+
+/** Success */
+var(--color-success-default)
+var(--color-success-alternative)
+var(--color-success-muted)
+var(--color-success-inverse)
+var(--color-success-disabled)
+
+/** Info */
+var(--color-info-default)
+var(--color-info-alternative)
+var(--color-info-muted)
+var(--color-info-inverse)
+var(--color-info-disabled)
+```
+
+### **Component colors** (tier 3)
+
+Another level of abstraction is component tier colors that you can define at the top of your styles and use at the component specific level.
+
+```scss
+.button {
+ --color-background-primary: var(--color-primary-default);
+ --color-text-primary: var(--color-primary-inverse);
+ --color-border-primary: var(--color-primary-default);
+
+ --color-background-primary-hover: var(--color-primary-alternative);
+ --color-border-primary-hover: var(--color-primary-alternative);
+
+ .btn-primary {
+ background-color: var(--color-background-primary);
+ color: var(--color-text-primary);
+ border: 1px solid var(--color-border-primary);
+
+ &:hover {
+ background-color: var(--color-background-primary-hover);
+ border: 1px solid var(--color-border-primary-hover);
+ }
+
+ /** btn-primary css continued... */
+ }
+}
+```
+
+## Takeaways
+
+- Do not use static HEX values in your code. Use the [theme colors](#theme-colors-tier-2). If one does not exist for your use case ask the designer or [create an issue](https://github.com/MetaMask/metamask-extension/issues/new) and tag it with a `design-system` label.
+- Make sure the design token you are using is for it's intended purpose. Please refer to the description of each token in [@metamask/design-tokens](https://github.com/MetaMask/design-tokens/blob/main/src/figma/tokens.json#L329-L554).
+
+### ❌ Don't do this
+
+Don't use static hex values or brand color tokens in your code.
+
+```css
+/**
+* Don't do this
+* Static hex values create inconsistency and will break UI when using dark mode
+**/
+.card {
+ background-color: #ffffff;
+ color: #24272a;
+}
+
+/**
+* Don't do this
+* Not theme compatible and will break UI when using dark theme
+**/
+.card {
+ background-color: var(--brand-colors-white-white000);
+ color: var(--brand-colors-grey-grey800);
+}
+```
+
+### ✅ Do this
+
+Do use component tiered and [theme colors](#theme-colors-tier-2) in your styles and code
+
+```css
+.card {
+ --color-background: var(--color-background-default);
+ --color-text: var(--color-text-default);
+
+ background-color: var(--color-background);
+ color: var(--color-text);
+}
+```
+
+
+
+## References
+
+- [@metamask/design-tokens](https://github.com/MetaMask/design-tokens)
+- [Figma brand colors library](https://www.figma.com/file/cBAUPFMnbv6tHR1J8KvBI2/Brand-Colors?node-id=0%3A1) (internal use only)
+- [Figma theme colors library](https://www.figma.com/file/kdFzEC7xzSNw7cXteqgzDW/Light-Theme-Colors?node-id=0%3A1) (internal use only)
+- [Figma dark theme colors library](https://www.figma.com/file/rLKsoqpjyoKauYnFDcBIbO/Dark-Theme-Colors?node-id=0%3A1) (internal use only)
diff --git a/.storybook/images/design.token.graphic.svg b/.storybook/images/design.token.graphic.svg
new file mode 100644
index 000000000..ad64afba9
--- /dev/null
+++ b/.storybook/images/design.token.graphic.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.storybook/main.js b/.storybook/main.js
index 30c216825..5ce2f32d7 100644
--- a/.storybook/main.js
+++ b/.storybook/main.js
@@ -14,6 +14,7 @@ module.exports = {
'@storybook/addon-a11y',
'@storybook/addon-knobs',
'./i18n-party-addon/register.js',
+ 'storybook-dark-mode',
],
// Uses babel.config.js settings and prevents "Missing class properties transform" error
babel: async (options) => ({ overrides: options.overrides }),
diff --git a/.storybook/metamask-storybook-theme.js b/.storybook/metamask-storybook-theme.js
index 6623f4fe0..49f8c814d 100644
--- a/.storybook/metamask-storybook-theme.js
+++ b/.storybook/metamask-storybook-theme.js
@@ -1,12 +1,10 @@
// .storybook/YourTheme.js
import { create } from '@storybook/theming';
-import logo from '../app/images/logo/metamask-logo-horizontal.svg';
export default create({
base: 'light',
brandTitle: 'MetaMask Storybook',
- brandImage: logo,
// Typography
fontBase: 'Euclid, Roboto, Helvetica, Arial, sans-serif',
diff --git a/.storybook/preview.js b/.storybook/preview.js
index 9e6fe2206..517e7820a 100644
--- a/.storybook/preview.js
+++ b/.storybook/preview.js
@@ -1,4 +1,4 @@
-import React, { useEffect } from 'react';
+import React, { useEffect, useState } from 'react';
import { addDecorator, addParameters } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { Provider } from 'react-redux';
@@ -13,13 +13,14 @@ import { Router } from 'react-router-dom';
import { createBrowserHistory } from 'history';
import { _setBackgroundConnection } from '../ui/store/actions';
import MetaMaskStorybookTheme from './metamask-storybook-theme';
+import addons from '@storybook/addons';
addParameters({
backgrounds: {
- default: 'light',
+ default: 'default',
values: [
- { name: 'light', value: '#FFFFFF' },
- { name: 'dark', value: '#333333' },
+ { name: 'default', value: 'var(--color-background-default)' },
+ { name: 'alternative', value: 'var(--color-background-alternative)' },
],
},
docs: {
@@ -27,7 +28,13 @@ addParameters({
},
options: {
storySort: {
- order: ['Getting Started', 'Components', ['UI', 'App'], 'Pages'],
+ order: [
+ 'Getting Started',
+ 'Design Tokens',
+ 'Components',
+ ['UI', 'App'],
+ 'Pages',
+ ],
},
},
});
@@ -66,8 +73,29 @@ const proxiedBackground = new Proxy(
_setBackgroundConnection(proxiedBackground);
const metamaskDecorator = (story, context) => {
+ const [isDark, setDark] = useState(false);
+ const channel = addons.getChannel();
const currentLocale = context.globals.locale;
const current = allLocales[currentLocale];
+
+ useEffect(() => {
+ channel.on('DARK_MODE', setDark);
+ return () => channel.off('DARK_MODE', setDark);
+ }, [channel, setDark]);
+
+ useEffect(() => {
+ const currentTheme = document.documentElement.getAttribute('data-theme');
+
+ if (!currentTheme)
+ document.documentElement.setAttribute('data-theme', 'light');
+
+ if (currentTheme === 'light' && isDark) {
+ document.documentElement.setAttribute('data-theme', 'dark');
+ } else if (currentTheme === 'dark' && !isDark) {
+ document.documentElement.setAttribute('data-theme', 'light');
+ }
+ }, [isDark]);
+
return (
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e0b258263..2586fdfc3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [10.12.0]
+### Added
+- Add a search feature to the settings page ([#13214](https://github.com/MetaMask/metamask-extension/pull/13214))
+- Add AirGap Vault detail links to the hardware wallet connection flow ([#13650](https://github.com/MetaMask/metamask-extension/pull/13650))
+
+### Changed
+- Prevent users from entering too long a number for slippage in swaps ([#13914](https://github.com/MetaMask/metamask-extension/pull/13914))
+- Hide non-essential information in our EIP-1559 v2 gas modal when the gas api is down ([#13865](https://github.com/MetaMask/metamask-extension/pull/13865))
+- Updating colors of the account list ([#13864](https://github.com/MetaMask/metamask-extension/pull/13864))
+- Show a more useful warning is users don't have enough of their networks base currency to pay for gas ([#13182](https://github.com/MetaMask/metamask-extension/pull/13182))
+- Update "Forgot Password?" copy ([#13493](https://github.com/MetaMask/metamask-extension/pull/13493))
+- Show the address of the contract that is being interacted with next to the method name in transaction confirmation headers ([#13683](https://github.com/MetaMask/metamask-extension/pull/13683))
+- Show the address of the contract that is being interacted next to 'Transfer' and 'Transfer From' method names in transaction confirmation headers ([#13776](https://github.com/MetaMask/metamask-extension/pull/13776))
+- Performance and UX improvements for Gridplus lattice users (([#14158]https://github.com/MetaMask/metamask-extension/pull/14158))
+
+### Fixed
+- Ensure long signature request text is visible ([#13828](https://github.com/MetaMask/metamask-extension/pull/13828))
+- Fix spelling of 'Ethereum' in German translation ([#13915](https://github.com/MetaMask/metamask-extension/pull/13915))
+- Fix cases where the action buttons in a switch network confirmation window wouldn't work ([#13847](https://github.com/MetaMask/metamask-extension/pull/13847))
+- Ensure the origin of a site requesting permissions is fully visible in the permission request UI ([#13868](https://github.com/MetaMask/metamask-extension/pull/13868))
+- Fix visual overflow problems with the account list in the connect flow
+ - ([#13859](https://github.com/MetaMask/metamask-extension/pull/13859))
+ - ([#13592](https://github.com/MetaMask/metamask-extension/pull/13592))
+- Show the users primary currency in the "Max Base Fee" and "Priority Fee" fields of the gas customization window ([#13830](https://github.com/MetaMask/metamask-extension/pull/13830))
+- Ensure latest gas estimates are shown on the transaction screen for users of the EIP-1559 v2 gas UI ([#13809](https://github.com/MetaMask/metamask-extension/pull/13809))
+- Fix to allow toggling of the currency in the send flow when the user has "fiat" selected as the primary currency ([#13813](https://github.com/MetaMask/metamask-extension/pull/13813))
+- Shows the sign and cancel button fully in signature page ([#13686](https://github.com/MetaMask/metamask-extension/pull/13686))
+- Harden keyring type check in EthOverview ([#13711](https://github.com/MetaMask/metamask-extension/pull/13711))
+- Update "Forgot Password?" copy ([#13493](https://github.com/MetaMask/metamask-extension/pull/13493))
+- Confirm transaction page: use method name only for contract transactions ([#13643](https://github.com/MetaMask/metamask-extension/pull/13643))
+- Fix issues
+- **[FLASK]** Fix Snap permission list item shrinkage with short permission names ([#13996](https://github.com/MetaMask/metamask-extension/pull/13996))
+
## [10.11.4]
### Added
- **[FLASK]** Snap removal confirmation ([#13619](https://github.com/MetaMask/metamask-extension/pull/13619))
@@ -38,6 +71,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fix bug that users who are connected to another extension would hit when viewing connected sites ([#13974](https://github.com/MetaMask/metamask-extension/pull/13974))
+
## [10.11.1]
### Changed
- Fixes GridPlus Lattice bugs by upgrading to `gridplus-sdk` v1.0.0, `eth-lattice-keyring` v0.5.0 and to compatibility with v0.14.0 ([#13834](https://github.com/MetaMask/metamask-extension/pull/13834))
@@ -2807,7 +2841,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.11.4...HEAD
+[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.12.0...HEAD
+[10.12.0]: https://github.com/MetaMask/metamask-extension/compare/v10.11.4...v10.12.0
[10.11.4]: https://github.com/MetaMask/metamask-extension/compare/v10.11.3...v10.11.4
[10.11.3]: https://github.com/MetaMask/metamask-extension/compare/v10.11.2...v10.11.3
[10.11.2]: https://github.com/MetaMask/metamask-extension/compare/v10.11.1...v10.11.2
diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json
index eede6a17e..998726fa6 100644
--- a/app/_locales/am/messages.json
+++ b/app/_locales/am/messages.json
@@ -750,9 +750,6 @@
"restore": {
"message": "እነበረበት መልስ"
},
- "restoreAccountWithSeed": {
- "message": "መለያዎን በዘር ሐረግ ወደነበረበት ይመልሱ"
- },
"revealSeedWords": {
"message": "የዘር ቃላትን ይግለጹ"
},
diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json
index 0aa9684b7..925a51c0a 100644
--- a/app/_locales/ar/messages.json
+++ b/app/_locales/ar/messages.json
@@ -766,9 +766,6 @@
"restore": {
"message": "استعادة"
},
- "restoreAccountWithSeed": {
- "message": "قم باستعادة حسابك بواسطة عبارة الأمان"
- },
"revealSeedWords": {
"message": "كشف كلمات عبارات الأمان"
},
diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json
index 69d60edd9..ce6c09dd5 100644
--- a/app/_locales/bg/messages.json
+++ b/app/_locales/bg/messages.json
@@ -761,9 +761,6 @@
"restore": {
"message": "Възстановяване"
},
- "restoreAccountWithSeed": {
- "message": "Възстановете акаунта си с фраза зародиш"
- },
"revealSeedWords": {
"message": "Разкрий думите зародиш"
},
diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json
index fe484e6de..e9a0a85fc 100644
--- a/app/_locales/bn/messages.json
+++ b/app/_locales/bn/messages.json
@@ -765,9 +765,6 @@
"restore": {
"message": "পুনরুদ্ধার করুন"
},
- "restoreAccountWithSeed": {
- "message": "সীড ফ্রেজ দিয়ে আপনার অ্যাকাউন্ট রিস্টোর করুন"
- },
"revealSeedWords": {
"message": "সীড শব্দগুলি প্রকাশ করুন"
},
diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json
index 9585515d2..2d0ab7177 100644
--- a/app/_locales/ca/messages.json
+++ b/app/_locales/ca/messages.json
@@ -743,9 +743,6 @@
"restore": {
"message": "Restaura"
},
- "restoreAccountWithSeed": {
- "message": "Restaura el teu compte amb Frase de Recuperació"
- },
"revealSeedWords": {
"message": "Revelar Paraules de Recuperació"
},
diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json
index 290993179..0067c616c 100644
--- a/app/_locales/da/messages.json
+++ b/app/_locales/da/messages.json
@@ -746,9 +746,6 @@
"restore": {
"message": "Gendan"
},
- "restoreAccountWithSeed": {
- "message": "Gendan din konto med Seed-sætning"
- },
"revealSeedWords": {
"message": "Vis Seedord"
},
diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json
index edab4e7a4..35b7c39f5 100644
--- a/app/_locales/de/messages.json
+++ b/app/_locales/de/messages.json
@@ -1279,19 +1279,12 @@
"importAccountError": {
"message": "Fehler beim Importieren des Kontos."
},
- "importAccountLinkText": {
- "message": "mit einer Geheime Wiederherstellungsphrase importieren"
- },
"importAccountMsg": {
"message": " Importierte Accounts werden nicht mit der Seed-Wörterfolge deines ursprünglichen MetaMask Accounts verknüpft. Erfahre mehr über importierte Accounts."
},
"importAccountSeedPhrase": {
"message": "Ein Konto mit einem Seed-Schlüssel importieren"
},
- "importAccountText": {
- "message": "oder $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "Geben Sie die Geheime Wiederherstellungsphrase (alias Seed Phrase) ein, die Sie beim Erstellen Ihrer Wallet erhalten haben. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1532,7 +1525,7 @@
"message": "niedrig"
},
"mainnet": {
- "message": "Athereum Hauptnetz"
+ "message": "Ethereum Hauptnetz"
},
"makeAnotherSwap": {
"message": "Eine neue Wallet erstellen"
@@ -1745,9 +1738,6 @@
"message": "Konto $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "Sammelobjekt wurde nicht hinzugefügt, weil: $1"
- },
"newCollectibleAddedMessage": {
"message": "Sammelobjekt wurde erfolgreich hinzugefügt!"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "Wiederherstellen"
},
- "restoreAccountWithSeed": {
- "message": "Ihr Konto mit mnemonischer Phrase wiederherstellen"
- },
"restoreWalletPreferences": {
"message": "$1 hat ein Backup Ihrer Daten gefunden. Möchten Sie die Präferenzen Ihrer Wallet wiederherstellen?",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "Nur das erste Konto auf dieser Wallet wird automatisch geladen. Wenn Sie nach Abschluss dieses Vorgangs weitere Konten hinzufügen möchten, klicken Sie auf das Dropdown-Menü und wählen Sie dann Konto erstellen."
},
- "secretPhraseWarning": {
- "message": "Wenn Sie eine andere geheime Wiederherstellungsphrase verwenden, werden Ihre aktuelle Wallet, Ihre Konten und Vermögenswerte dauerhaft aus dieser App entfernt. Diese Aktion kann nicht rückgängig gemacht werden."
- },
"secretRecoveryPhrase": {
"message": "Geheime Wiederherstellungsphrase"
},
diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json
index 0932794cb..0de718e3c 100644
--- a/app/_locales/el/messages.json
+++ b/app/_locales/el/messages.json
@@ -1273,19 +1273,12 @@
"importAccountError": {
"message": "Σφάλμα εισαγωγής λογαριασμού."
},
- "importAccountLinkText": {
- "message": "εισαγωγή χρησιμοποιώντας τη Μυστική Φράση Ανάκτησης"
- },
"importAccountMsg": {
"message": "Οι λογαριασμοί που εισάγονται δεν θα συσχετιστούν με τη Μυστική Φράση Ανάκτησης του λογαριασμού σας MetaTask που δημιουργήθηκε αρχικά. Μάθετε περισσότερα για τους εισηγμένους λογαριασμούς"
},
"importAccountSeedPhrase": {
"message": "Εισαγωγή λογαριασμού με Μυστική Φράση Ανάκτησης"
},
- "importAccountText": {
- "message": "ή $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "Εισάγετε τη Μυστική Φράση Ανάκτησης (δλδ Seed Phrase) που σας δόθηκε όταν δημιουργήσατε το πορτοφόλι σας. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1745,9 +1738,6 @@
"message": "Λογαριασμός $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "Το Collectible δεν προστέθηκε επειδή: $1"
- },
"newCollectibleAddedMessage": {
"message": "Το Collectible προστέθηκε με επιτυχία!"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "Επαναφορά"
},
- "restoreAccountWithSeed": {
- "message": "Επαναφέρετε τον Λογαριασμό σας με Φράση Επαναφοράς"
- },
"restoreWalletPreferences": {
"message": "Βρέθηκε ένα αντίγραφο ασφαλείας των δεδομένων σας από το $1. Θα θέλατε να επαναφέρετε τις προτιμήσεις του πορτοφολιού σας;",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "Μόνο ο πρώτος λογαριασμός σε αυτό το πορτοφόλι θα φορτώσει αυτόματα. Μετά την ολοκλήρωση αυτής της διαδικασίας, για να προσθέσετε επιπλέον λογαριασμούς, κάντε κλικ στο αναπτυσσόμενο μενού και, στη συνέχεια, επιλέξτε Δημιουργία Λογαριασμού."
},
- "secretPhraseWarning": {
- "message": "Αν κάνετε επαναφορά χρησιμοποιώντας μια άλλη Μυστική Φράση Ανάκτησης, το τρέχον πορτοφόλι, οι λογαριασμοί και τα περιουσιακά στοιχεία σας θα αφαιρεθούν από αυτή την εφαρμογή μόνιμα. Αυτή η ενέργεια δεν μπορεί να αναιρεθεί."
- },
"secretRecoveryPhrase": {
"message": "Μυστική Φράση Ανάκτησης"
},
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json
index 1b537468e..d74f6cca4 100644
--- a/app/_locales/en/messages.json
+++ b/app/_locales/en/messages.json
@@ -42,7 +42,7 @@
"message": "QR-based HW Wallet"
},
"QRHardwareWalletSteps2Description": {
- "message": "AirGap Vault & Ngrave (Coming Soon)"
+ "message": "Ngrave (Coming Soon)"
},
"about": {
"message": "About"
@@ -58,6 +58,10 @@
"message": "$1 may access and spend up to this max amount",
"description": "$1 is the url of the site requesting ability to spend"
},
+ "accessAndSpendNoticeNFT": {
+ "message": "$1 may access and spend this asset",
+ "description": "$1 is the url of the site requesting ability to spend"
+ },
"accessingYourCamera": {
"message": "Accessing your camera..."
},
@@ -98,6 +102,9 @@
"addANetwork": {
"message": "Add a network"
},
+ "addANetworkManually": {
+ "message": "Add a network manually"
+ },
"addANickname": {
"message": "Add a nickname"
},
@@ -137,6 +144,9 @@
"addFriendsAndAddresses": {
"message": "Add friends and addresses you trust"
},
+ "addFromAListOfPopularNetworks": {
+ "message": "Add from a list of popular networks or add a network manually. Only interact with the entities you trust."
+ },
"addMemo": {
"message": "Add memo"
},
@@ -191,6 +201,12 @@
"aggregatorFeeCost": {
"message": "Aggregator network fee"
},
+ "airgapVault": {
+ "message": "AirGap Vault"
+ },
+ "airgapVaultTutorial": {
+ "message": " (Tutorials)"
+ },
"alertDisableTooltip": {
"message": "This can be changed in \"Settings > Alerts\""
},
@@ -267,6 +283,9 @@
"approvedAmountWithColon": {
"message": "Approved amount:"
},
+ "approvedAsset": {
+ "message": "Approved asset"
+ },
"areYouDeveloper": {
"message": "Are you a developer?"
},
@@ -397,8 +416,15 @@
"description": "$1 represents the cypto symbol to be purchased"
},
"buyCryptoWithTransakDescription": {
- "message": "Transak supports debit card and bank transfers (depending on location) in 59+ countries. $1 deposits into your MetaMask account.",
- "description": "$1 represents the cypto symbol to be purchased"
+ "message": "Transak supports credit & debit cards, Apple Pay, MobiKwik, and bank transfers (depending on location) in 100+ countries. $1 deposits directly into your MetaMask account.",
+ "description": "$1 represents the crypto symbol to be purchased"
+ },
+ "buyEth": {
+ "message": "Buy ETH"
+ },
+ "buyOther": {
+ "message": "Buy $1 or deposit from another account.",
+ "description": "$1 is a token symbol"
},
"buyWithWyre": {
"message": "Buy ETH with Wyre"
@@ -467,6 +493,9 @@
"close": {
"message": "Close"
},
+ "collectibleAddFailedMessage": {
+ "message": "NFT can’t be added as the ownership details do not match. Make sure you have entered correct information."
+ },
"collectibleAddressError": {
"message": "This token is an NFT. Add on the $1",
"description": "$1 is a clickable link with text defined by the 'importNFTPage' key"
@@ -612,6 +641,9 @@
"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?"
},
+ "convertTokenToNFTExistDescription": {
+ "message": "We’ve detected that this asset has been added as an NFT. Would you like to remove it from your token list?"
+ },
"copiedExclamation": {
"message": "Copied!"
},
@@ -691,6 +723,9 @@
"customGasSubTitle": {
"message": "Increasing fee may decrease processing times, but it is not guaranteed."
},
+ "customNetworks": {
+ "message": "Custom networks"
+ },
"customSpendLimit": {
"message": "Custom Spend Limit"
},
@@ -714,6 +749,9 @@
"message": "$1 has recommended this price.",
"description": "$1 represents the Dapp's origin"
},
+ "darkTheme": {
+ "message": "Dark"
+ },
"data": {
"message": "Data"
},
@@ -749,6 +787,9 @@
"decryptRequest": {
"message": "Decrypt request"
},
+ "defaultTheme": {
+ "message": "Default"
+ },
"delete": {
"message": "Delete"
},
@@ -814,6 +855,9 @@
"dontShowThisAgain": {
"message": "Don't show this again"
},
+ "downArrow": {
+ "message": "down arrow"
+ },
"downloadGoogleChrome": {
"message": "Download Google Chrome"
},
@@ -989,7 +1033,7 @@
"message": "Use OpenSea's API to fetch NFT data. NFT auto-detection relies on OpenSea's API, and will not be available when this is turned off."
},
"enableSmartTransactions": {
- "message": "Enable smart transactions"
+ "message": "Enable Smart Transactions"
},
"enableToken": {
"message": "enable $1",
@@ -1206,6 +1250,9 @@
"forgetDevice": {
"message": "Forget this device"
},
+ "forgotPassword": {
+ "message": "Forgot password?"
+ },
"from": {
"message": "From"
},
@@ -1334,6 +1381,9 @@
"goerli": {
"message": "Goerli Test Network"
},
+ "gotIt": {
+ "message": "Got it!"
+ },
"grantedToWithColon": {
"message": "Granted to:"
},
@@ -1372,6 +1422,9 @@
"hide": {
"message": "Hide"
},
+ "hideSeedPhrase": {
+ "message": "Hide seed phrase"
+ },
"hideToken": {
"message": "Hide token"
},
@@ -1408,19 +1461,12 @@
"importAccountError": {
"message": "Error importing account."
},
- "importAccountLinkText": {
- "message": "import using Secret Recovery Phrase"
- },
"importAccountMsg": {
"message": "Imported accounts will not be associated with your originally created MetaMask account Secret Recovery Phrase. Learn more about imported accounts"
},
"importAccountSeedPhrase": {
"message": "Import a wallet with Secret Recovery Phrase"
},
- "importAccountText": {
- "message": "or $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "Enter your Secret Recovery Phrase (aka Seed Phrase) that you were given when you created your wallet. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1478,6 +1524,10 @@
"insufficientBalance": {
"message": "Insufficient balance."
},
+ "insufficientCurrency": {
+ "message": "You do not have enough $1 in your account to pay for transaction fees on $2 network.",
+ "description": "$1 is currency, $2 is network"
+ },
"insufficientFunds": {
"message": "Insufficient funds."
},
@@ -1647,6 +1697,9 @@
"letsGoSetUp": {
"message": "Yes, let’s get set up!"
},
+ "levelArrow": {
+ "message": "level arrow"
+ },
"likeToImportTokens": {
"message": "Would you like to import these tokens?"
},
@@ -1677,6 +1730,10 @@
"lockTimeTooGreat": {
"message": "Lock time is too great"
},
+ "logo": {
+ "message": "$1 logo",
+ "description": "$1 is the name of the ticker"
+ },
"low": {
"message": "Low"
},
@@ -1815,6 +1872,12 @@
"missingNFT": {
"message": "Don't see your NFT?"
},
+ "missingSetting": {
+ "message": "Can't find a setting?"
+ },
+ "missingSettingRequest": {
+ "message": "Request here"
+ },
"missingToken": {
"message": "Don't see your token?"
},
@@ -1926,9 +1989,6 @@
"message": "Account $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "Collectible was not added because: $1"
- },
"newCollectibleAddedMessage": {
"message": "Collectible was successfully added!"
},
@@ -1948,7 +2008,7 @@
"message": "“$1” was successfully added!"
},
"newPassword": {
- "message": "New password (min 8 chars)"
+ "message": "New password (8 characters min)"
},
"newToMetaMask": {
"message": "New to MetaMask?"
@@ -2199,6 +2259,9 @@
"onlyConnectTrust": {
"message": "Only connect with sites you trust."
},
+ "onlyInteractWith": {
+ "message": "Only interact with entities you trust."
+ },
"openFullScreenForLedgerWebHid": {
"message": "Open MetaMask in full screen to connect your ledger via WebHID.",
"description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid."
@@ -2215,6 +2278,9 @@
"or": {
"message": "or"
},
+ "orDeposit": {
+ "message": "or deposit from another account."
+ },
"origin": {
"message": "Origin"
},
@@ -2236,11 +2302,18 @@
"passwordSetupDetails": {
"message": "This password will unlock your MetaMask wallet only on this device. MetaMask can not recover this password."
},
+ "passwordStrength": {
+ "message": "Password strength: $1",
+ "description": "Return password strength to the user when user wants to create password."
+ },
+ "passwordStrengthDescription": {
+ "message": "A strong password can improve the security of your wallet should your device be stolen or compromised."
+ },
"passwordTermsWarning": {
"message": "I understand that MetaMask cannot recover this password for me. $1"
},
"passwordsDontMatch": {
- "message": "Passwords Don't Match"
+ "message": "Passwords don't match"
},
"pastePrivateKey": {
"message": "Enter your private key string here:",
@@ -2359,6 +2432,12 @@
"queued": {
"message": "Queued"
},
+ "reAddAccounts": {
+ "message": "re-add any other accounts"
+ },
+ "reAdded": {
+ "message": "re-added"
+ },
"readdToken": {
"message": "You can add this token back in the future by going to “Import token” in your accounts options menu."
},
@@ -2462,12 +2541,21 @@
"resetAccountDescription": {
"message": "Resetting your account will clear your transaction history. This will not change the balances in your accounts or require you to re-enter your Secret Recovery Phrase."
},
+ "resetWallet": {
+ "message": "Reset Wallet"
+ },
+ "resetWalletSubHeader": {
+ "message": "MetaMask does not keep a copy of your password. If you’re having trouble unlocking your account, you will need to reset your wallet. You can do this by providing the Secret Recovery Phrase you used when you set up your wallet."
+ },
+ "resetWalletUsingSRP": {
+ "message": "This action will delete your current wallet and Secret Recovery Phrase from this device, along with the list of accounts you’ve curated. After resetting with a Secret Recovery Phrase, you’ll see a list of accounts based on the Secret Recovery Phrase you use to reset. This new list will automatically include accounts that have a balance. You’ll also be able to $1 created previously. Custom accounts that you’ve imported will need to be $2, and any custom tokens you’ve added to an account will need to be $3 as well."
+ },
+ "resetWalletWarning": {
+ "message": "Make sure you’re using the correct Secret Recovery Phrase before proceeding. You will not be able to undo this."
+ },
"restore": {
"message": "Restore"
},
- "restoreAccountWithSeed": {
- "message": "Restore your Account with Secret Recovery Phrase"
- },
"restoreWalletPreferences": {
"message": "A backup of your data from $1 has been found. Would you like to restore your wallet preferences?",
"description": "$1 is the date at which the data was backed up"
@@ -2490,6 +2578,9 @@
"revealSeedWordsWarningTitle": {
"message": "DO NOT share this phrase with anyone!"
},
+ "revealTheSeedPhrase": {
+ "message": "Reveal seed phrase"
+ },
"rinkeby": {
"message": "Rinkeby Test Network"
},
@@ -2523,6 +2614,9 @@
"searchResults": {
"message": "Search Results"
},
+ "searchSettings": {
+ "message": "Search in settings"
+ },
"searchTokens": {
"message": "Search Tokens"
},
@@ -2535,9 +2629,6 @@
"secretPhrase": {
"message": "Only the first account on this wallet will auto load. After completing this process, to add additional accounts, click the drop down menu, then select Create Account."
},
- "secretPhraseWarning": {
- "message": "If you restore using another Secret Recovery Phrase, your current wallet, accounts and assets will be removed from this app permanently. This action cannot be undone."
- },
"secretRecoveryPhrase": {
"message": "Secret Recovery Phrase"
},
@@ -2560,22 +2651,22 @@
"message": "Secure my wallet (recommended)"
},
"seedPhraseIntroSidebarBulletFour": {
- "message": "Write down and store in multiple secret places."
+ "message": "Write down and store in multiple secret places"
},
"seedPhraseIntroSidebarBulletOne": {
"message": "Save in a password manager"
},
"seedPhraseIntroSidebarBulletThree": {
- "message": "Store in a safe-deposit box."
+ "message": "Store in a safe deposit box"
},
"seedPhraseIntroSidebarBulletTwo": {
- "message": "Store in a bank vault."
+ "message": "Store in a bank vault"
},
"seedPhraseIntroSidebarCopyOne": {
"message": "Your Secret Recovery Phrase is a 12-word phrase that is the “master key” to your wallet and your funds"
},
"seedPhraseIntroSidebarCopyThree": {
- "message": "If someone asks for your recovery phrase they are likely trying to scam you and steal your wallet funds"
+ "message": "If someone asks for your recovery phrase they are likely trying to scam you and steal your wallet funds."
},
"seedPhraseIntroSidebarCopyTwo": {
"message": "Never, ever share your Secret Recovery Phrase, not even with MetaMask!"
@@ -2669,6 +2760,9 @@
"settings": {
"message": "Settings"
},
+ "settingsSearchMatchingNotFound": {
+ "message": "No matching results found"
+ },
"shorthandVersion": {
"message": "v$1",
"description": "$1 is replaced by a version string (e.g. 1.2.3)"
@@ -2755,7 +2849,7 @@
"message": "Slow"
},
"smartTransaction": {
- "message": "Smart transaction"
+ "message": "Smart Transaction"
},
"snapAccess": {
"message": "$1 snap has access to:",
@@ -2915,20 +3009,23 @@
"storePhrase": {
"message": "Store this phrase in a password manager like 1Password."
},
+ "strong": {
+ "message": "Strong"
+ },
"stxAreHere": {
- "message": "Smart transactions are here!"
+ "message": "Smart Transactions are here!"
},
"stxBenefit1": {
- "message": "Decrease transaction costs"
+ "message": "Minimize transaction costs"
},
"stxBenefit2": {
- "message": "Reduce failures & minimize costs"
+ "message": "Reduce transaction failures"
},
"stxBenefit3": {
- "message": "Protect from front-running"
+ "message": "Eliminate stuck transactions"
},
"stxBenefit4": {
- "message": "Eliminate stuck transactions"
+ "message": "Prevent front-running"
},
"stxCancelled": {
"message": "Swap would have failed"
@@ -2940,7 +3037,13 @@
"message": "Try your swap again. We’ll be here to protect you against similar risks next time."
},
"stxDescription": {
- "message": "Smart transactions use MetaMask smart contracts to simulate transactions before submitting in order to..."
+ "message": "MetaMask Swaps just got a whole lot smarter! Enabling Smart Transactions will allow MetaMask to programmatically optimize your Swap to help:"
+ },
+ "stxErrorNotEnoughFunds": {
+ "message": "Not enough funds for a smart transaction."
+ },
+ "stxErrorUnavailable": {
+ "message": "Smart Transactions are temporarily unavailable."
},
"stxFailure": {
"message": "Swap failed"
@@ -2949,8 +3052,11 @@
"message": "Sudden market changes can cause failures. If the problem persists, please reach out to $1.",
"description": "This message is shown to a user if their swap fails. The $1 will be replaced by support.metamask.io"
},
- "stxFallbackToNormal": {
- "message": "You can still swap using the normal method or wait for cheaper gas fees and less failures with smart transactions."
+ "stxFallbackPendingTx": {
+ "message": "Smart Transactions are temporarily unavailable because you have a pending transaction."
+ },
+ "stxFallbackUnavailable": {
+ "message": "You can still swap your tokens even while Smart Transactions are unavailable."
},
"stxPendingFinalizing": {
"message": "Finalizing..."
@@ -2962,7 +3068,7 @@
"message": "Privately submitting the Swap..."
},
"stxSubDescription": {
- "message": "Enabling allows MetaMask to simulate transactions, proactively cancel bad transactions and sign MetaMask Swaps transactions for you."
+ "message": "* Smart Transactions will attempt to submit your transaction privately, multiple times. If all attempts fail, the transaction will be broadcast publicly to ensure your Swap successfully goes through."
},
"stxSuccess": {
"message": "Swap complete!"
@@ -2977,8 +3083,11 @@
"stxTryRegular": {
"message": "Try a regular swap."
},
+ "stxTryingToCancel": {
+ "message": "Trying to cancel your transaction..."
+ },
"stxUnavailable": {
- "message": "Smart transactions temporarily unavailable"
+ "message": "Smart Transactions are disabled"
},
"stxUnknown": {
"message": "Status unknown"
@@ -3393,6 +3502,12 @@
"testFaucet": {
"message": "Test Faucet"
},
+ "theme": {
+ "message": "Theme"
+ },
+ "themeDescription": {
+ "message": "Choose your preferred MetaMask theme."
+ },
"thisWillCreate": {
"message": "This will create a new wallet and Secret Recovery Phrase"
},
@@ -3632,6 +3747,12 @@
"message": "Sending collectible (ERC-721) tokens is not currently supported",
"description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending"
},
+ "unverifiedContractAddressMessage": {
+ "message": "We cannot verify this contract. Make sure you trust this address."
+ },
+ "upArrow": {
+ "message": "up arrow"
+ },
"updatedWithDate": {
"message": "Updated $1"
},
@@ -3659,6 +3780,9 @@
"useTokenDetectionDescription": {
"message": "We use third-party APIs to detect and display new tokens sent to your wallet. Turn off if you don’t want MetaMask to pull data from those services."
},
+ "useTokenDetectionPrivacyDesc": {
+ "message": "Automatically displaying tokens sent to your account involves communication with third party servers to fetch token’s images. Those serves will have access to your IP address."
+ },
"usedByClients": {
"message": "Used by a variety of different clients"
},
@@ -3736,6 +3860,9 @@
"walletCreationSuccessTitle": {
"message": "Wallet creation successful"
},
+ "weak": {
+ "message": "Weak"
+ },
"web3ShimUsageNotification": {
"message": "We noticed that the current website tried to use the removed window.web3 API. If the site appears to be broken, please click $1 for more information.",
"description": "$1 is a clickable link."
diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json
index 1e08c80b1..0ce491da5 100644
--- a/app/_locales/es/messages.json
+++ b/app/_locales/es/messages.json
@@ -826,19 +826,12 @@
"importAccount": {
"message": "Importar cuenta"
},
- "importAccountLinkText": {
- "message": "importar con la frase secreta de recuperación"
- },
"importAccountMsg": {
"message": " Las cuentas importadas no se asociarán con la frase secreta de recuperación de la cuenta original de MetaMask. Más información sobre las cuentas importadas "
},
"importAccountSeedPhrase": {
"message": "Importar una cuenta con la frase secreta de recuperación"
},
- "importAccountText": {
- "message": "o $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importTokenQuestion": {
"message": "¿Desea importar el token?"
},
@@ -1421,9 +1414,6 @@
"restore": {
"message": "Restaurar"
},
- "restoreAccountWithSeed": {
- "message": "Restaurar la cuenta con la frase secreta de recuperación"
- },
"restoreWalletPreferences": {
"message": "Se encontró una copia de seguridad de los datos de $1. ¿Desea restaurar las preferencias de cartera?",
"description": "$1 is the date at which the data was backed up"
diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json
index 99a8cd142..bb9858c3f 100644
--- a/app/_locales/es_419/messages.json
+++ b/app/_locales/es_419/messages.json
@@ -1322,19 +1322,12 @@
"importAccountError": {
"message": "Error al importar la cuenta."
},
- "importAccountLinkText": {
- "message": "importar con la frase secreta de recuperación"
- },
"importAccountMsg": {
"message": "Las cuentas importadas no se asociarán con la frase secreta de recuperación de la cuenta original de MetaMask. Aprenda más sobre las cuentas importadas"
},
"importAccountSeedPhrase": {
"message": "Importar una cartera con la frase secreta de recuperación"
},
- "importAccountText": {
- "message": "o $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "Ingrese su frase secreta de recuperación (también conocida como Frase Semilla) que recibió al crear su cartera. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1794,9 +1787,6 @@
"message": "Cuenta $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "No se añadió el coleccionable porque: $1"
- },
"newCollectibleAddedMessage": {
"message": "¡El coleccionable fue añadido con éxito!"
},
@@ -2278,9 +2268,6 @@
"restore": {
"message": "Restaurar"
},
- "restoreAccountWithSeed": {
- "message": "Restaurar la cuenta con la frase secreta de recuperación"
- },
"restoreWalletPreferences": {
"message": "Se encontró una copia de seguridad de los datos de $1. ¿Desea restaurar las preferencias de cartera?",
"description": "$1 is the date at which the data was backed up"
@@ -2346,10 +2333,7 @@
"message": "ADVERTENCIA: No revele su frase de respaldo. Cualquier persona que tenga esta frase puede robarle los ethers."
},
"secretPhrase": {
- "message": "Solo la primera cuenta de esta cartera se cargará automáticamente. Después de llevar a cabo este proceso, para agregar cuentas adicionales haga clic en el menú desplegable y luego seleccione Crear cuenta."
- },
- "secretPhraseWarning": {
- "message": "Si restablece utilizando otra frase secreta de recuperación, su cartera actual, sus cuentas y sus activos se eliminarán de esta aplicación de forma permanente. Esta acción es irreversible."
+ "message": "Ingrese su frase secreta aquí para restaurar su bóveda."
},
"secretRecoveryPhrase": {
"message": "Frase secreta de recuperación"
diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json
index 4fb324dc2..b6f929aab 100644
--- a/app/_locales/et/messages.json
+++ b/app/_locales/et/messages.json
@@ -755,9 +755,6 @@
"restore": {
"message": "Taasta"
},
- "restoreAccountWithSeed": {
- "message": "Taastage konto seemnefraasi abil"
- },
"revealSeedWords": {
"message": "Kuva seemnesõnu"
},
diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json
index a5a46a0cc..c4cc6a32c 100644
--- a/app/_locales/fa/messages.json
+++ b/app/_locales/fa/messages.json
@@ -765,9 +765,6 @@
"restore": {
"message": "بازیابی"
},
- "restoreAccountWithSeed": {
- "message": "حساب تان را با عبارت بازیاب، بازیابی کنید"
- },
"revealSeedWords": {
"message": "کلمات بازیاب را آشکار کنید"
},
diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json
index 54932cba4..3301f21dd 100644
--- a/app/_locales/fi/messages.json
+++ b/app/_locales/fi/messages.json
@@ -762,9 +762,6 @@
"restore": {
"message": "Palauta"
},
- "restoreAccountWithSeed": {
- "message": "Palauta tilisi käyttäen salaustekstiä (seed phrase)"
- },
"revealSeedWords": {
"message": "Paljasta salaussanat"
},
diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json
index e82df7c93..474dcc1b0 100644
--- a/app/_locales/fil/messages.json
+++ b/app/_locales/fil/messages.json
@@ -689,9 +689,6 @@
"restore": {
"message": "Ipanumbalik"
},
- "restoreAccountWithSeed": {
- "message": "I-restore ang iyong Account gamit ang Seed Phrase"
- },
"revealSeedWords": {
"message": "Ipakita ang Seed Words"
},
diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json
index 99168b468..e5cd939f9 100644
--- a/app/_locales/fr/messages.json
+++ b/app/_locales/fr/messages.json
@@ -1273,19 +1273,12 @@
"importAccountError": {
"message": "Erreur d’importation de compte."
},
- "importAccountLinkText": {
- "message": "importer en utilisant la phrase secrète de récupération"
- },
"importAccountMsg": {
"message": "Les comptes importés ne seront pas associés à la phrase secrète de récupération que vous avez créée au départ dans MetaMask. En savoir plus sur les comptes importés"
},
"importAccountSeedPhrase": {
"message": "Importez un compte avec une phrase mnémotechnique"
},
- "importAccountText": {
- "message": "ou $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "Saisissez la phrase secrète de récupération (aussi appelée « phrase mnémonique » ou « seed ») qui vous a été attribuée lors de la création de votre portefeuille. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1745,9 +1738,6 @@
"message": "Compte $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "Le collectible n’a pas été ajouté, car : $1"
- },
"newCollectibleAddedMessage": {
"message": "Le collectible a été ajouté avec succès !"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "Restaurer"
},
- "restoreAccountWithSeed": {
- "message": "Restaurer votre compte avec une phrase Seed."
- },
"restoreWalletPreferences": {
"message": "Une sauvegarde de vos données de $1 a été trouvée. Voulez-vous restaurer vos préférences de portefeuille ?",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "Seul le premier compte de ce portefeuille sera chargé automatiquement. Après avoir terminé ce processus, pour ajouter des comptes supplémentaires, cliquez sur le menu déroulant, puis sélectionnez Créer un compte."
},
- "secretPhraseWarning": {
- "message": "Si vous effectuez une restauration à l’aide d’une autre phrase secrète de récupération, votre portefeuille, vos comptes et vos actifs actuels seront définitivement supprimés de cette application. Cette action est irréversible."
- },
"secretRecoveryPhrase": {
"message": "Phrase secrète de récupération"
},
diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json
index 7e7ca2db5..36beece50 100644
--- a/app/_locales/he/messages.json
+++ b/app/_locales/he/messages.json
@@ -762,9 +762,6 @@
"restore": {
"message": "שחזר"
},
- "restoreAccountWithSeed": {
- "message": "שחזר את חשבונך באמצעות צירוף הגרעין"
- },
"revealSeedWords": {
"message": "גלה מילות Seed"
},
diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json
index db88253d9..8b8531835 100644
--- a/app/_locales/hi/messages.json
+++ b/app/_locales/hi/messages.json
@@ -1273,19 +1273,12 @@
"importAccountError": {
"message": "खाता आयात करने में त्रुटि।"
},
- "importAccountLinkText": {
- "message": "गुप्त रिकवरी फ्रेज का उपयोग करके आयात करें"
- },
"importAccountMsg": {
"message": "आयातित खाते आपके मूल रूप से बनाए गए MetaMask खाते के गुप्त रिकवरी फ्रेज से संबद्ध नहीं होंगे। आयातित खातों के बारे में अधिक जानें"
},
"importAccountSeedPhrase": {
"message": "गुप्त रिकवरी फ्रेज के साथ एक खाता आयात करें"
},
- "importAccountText": {
- "message": "या $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "अपना सीक्रेट रिकवरी फ्रेज (उर्फ सीड फ्रेज) दर्ज करें जो आपको अपना वॉलेट बनाने पर दिया गया था। $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1745,9 +1738,6 @@
"message": "खाता $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "संग्रहणीय नहीं जोड़ा गया था क्योंकि: $1"
- },
"newCollectibleAddedMessage": {
"message": "संग्रहणीय सफलतापूर्वक जोड़ा गया!"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "पुनर्स्थापित करें"
},
- "restoreAccountWithSeed": {
- "message": "गुप्त रिकवरी फ्रेज के साथ अपने खाते को पुनर्स्थापित करें"
- },
"restoreWalletPreferences": {
"message": "$1 से आपके डेटा का बैकअप मिला है। क्या आप अपनी वॉलेट वरीयताओं को पुनर्स्थापित करना चाहते हैं?",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "इस वॉलेट पर केवल पहला खाता स्वतः लोड होगा। इस प्रक्रिया को पूरा करने के बाद, अतिरिक्त खाते जोड़ने के लिए, ड्रॉप डाउन मेन्यू पर क्लिक करें, फिर खाता बनाएं चुनें।"
},
- "secretPhraseWarning": {
- "message": "यदि आप किसी दूसरे सीक्रेट रिकवरी फ्रेज का उपयोग कर पुनर्स्थापित करते हैं, तो इस ऐप से आपके वर्तमान वॉलेट, अकाउंट, और संपति स्थायी रूप से हटा दिये जाएंगे। यह क्रिया पूर्ववत नहीं की जा सकती।"
- },
"secretRecoveryPhrase": {
"message": "सीक्रेट रिकवरी फ्रेज"
},
diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json
index 1c50602b4..c466cb53c 100644
--- a/app/_locales/hr/messages.json
+++ b/app/_locales/hr/messages.json
@@ -758,9 +758,6 @@
"restore": {
"message": "Vrati"
},
- "restoreAccountWithSeed": {
- "message": "Obnovite svoj račun početnom rečenicom"
- },
"revealSeedWords": {
"message": "Otkrij početne riječi"
},
diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json
index dae10bef3..44409dd45 100644
--- a/app/_locales/ht/messages.json
+++ b/app/_locales/ht/messages.json
@@ -479,9 +479,6 @@
"restore": {
"message": "Retabli"
},
- "restoreAccountWithSeed": {
- "message": "Retabli kont ou avèk yo Seed Fraz"
- },
"revealSeedWords": {
"message": "Revele Seed Mo Yo"
},
diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json
index ce6a13139..f96e8b911 100644
--- a/app/_locales/hu/messages.json
+++ b/app/_locales/hu/messages.json
@@ -758,9 +758,6 @@
"restore": {
"message": "Visszaállítás"
},
- "restoreAccountWithSeed": {
- "message": "Fiók helyreállítása a seed mondat segítségével"
- },
"revealSeedWords": {
"message": "Seed szavak megjelenítése"
},
diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json
index 1a15f8110..a66e1d4d6 100644
--- a/app/_locales/id/messages.json
+++ b/app/_locales/id/messages.json
@@ -1273,19 +1273,12 @@
"importAccountError": {
"message": "Galat saat mengimpor akun."
},
- "importAccountLinkText": {
- "message": "impor menggunakan Frasa Pemulihan Rahasia"
- },
"importAccountMsg": {
"message": "Akun yang diimpor tidak akan dikaitkan dengan Frasa Pemulihan Rahasia akun MetaMask yang asli dibuat. Pelajari selengkapnya tentang akun yang diimpor"
},
"importAccountSeedPhrase": {
"message": "Impor dompet dengan Frasa Pemulihan Rahasia"
},
- "importAccountText": {
- "message": "atau $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "Masukkan Frasa Pemulihan Rahasia Anda (alias Frasa Benih) yang diberikan saat Anda membuat dompet. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1745,9 +1738,6 @@
"message": "Akun $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "Koleksi tidak ditambahkan karena: $1"
- },
"newCollectibleAddedMessage": {
"message": "Koleksi berhasil ditambahkan!"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "Pulihkan"
},
- "restoreAccountWithSeed": {
- "message": "Pulihkan Akun dengan Frasa Pemulihan Rahasia"
- },
"restoreWalletPreferences": {
"message": "Cadangan data Anda dari $1 telah ditemukan. Pulihkan preferensi dompet Anda?",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "Hanya akun pertama di dompet ini yang akan dimuat secara otomatis. Setelah proses ini selesai, untuk menambahkan akun tambahan, klik menu drop down, lalu pilih Buat Akun."
},
- "secretPhraseWarning": {
- "message": "Jika Anda memulihkan menggunakan Frasa Pemulihan Rahasia lainnya, dompet, akun, dan aset Anda saat ini akan dihapus dari aplikasi ini secara permanen. Tindakan ini tidak dapat dibatalkan."
- },
"secretRecoveryPhrase": {
"message": "Frasa Pemulihan Rahasia"
},
diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json
index 8a06c463e..058c26f89 100644
--- a/app/_locales/it/messages.json
+++ b/app/_locales/it/messages.json
@@ -1152,9 +1152,6 @@
"restore": {
"message": "Ripristina"
},
- "restoreAccountWithSeed": {
- "message": "Ripristina Account con la Frase Seed"
- },
"restoreWalletPreferences": {
"message": "È stato trovato un backup dei tuoi dati da $1. Vuoi ripristinare le preferenze del portafoglio?",
"description": "$1 is the date at which the data was backed up"
diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json
index 4512be6fe..b59af3082 100644
--- a/app/_locales/ja/messages.json
+++ b/app/_locales/ja/messages.json
@@ -1273,19 +1273,12 @@
"importAccountError": {
"message": "アカウントのインポート中にエラーが発生しました。"
},
- "importAccountLinkText": {
- "message": "シークレットリカバリーフレーズを使用してインポート"
- },
"importAccountMsg": {
"message": " インポートされたアカウントは、最初に作成したMetaMaskアカウントのシークレットリカバリーフレーズと関連付けられません。インポートされたアカウントの詳細を表示"
},
"importAccountSeedPhrase": {
"message": "シークレットリカバリーフレーズを使用してウォレットをインポート"
},
- "importAccountText": {
- "message": "または$1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "ウォレットの作成時に提供されたシークレットリカバリーフレーズ (シードフレーズ) を入力してください。$1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1745,9 +1738,6 @@
"message": "アカウント$1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "次の理由により、コレクティブルは追加されませんでした: $1"
- },
"newCollectibleAddedMessage": {
"message": "コレクティブルが追加されました!"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "復元"
},
- "restoreAccountWithSeed": {
- "message": "シークレットリカバリーフレーズでアカウントを復元"
- },
"restoreWalletPreferences": {
"message": "$1のデータのバックアップが見つかりました。ウォレットの基本設定を復元しますか?",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "このウォレットの最初のアカウントのみが自動的に読み込まれます。 このプロセスの完了後、他のアカウントを追加するには、ドロップダウンメニューをクリックし、[アカウントを作成] を選択します。"
},
- "secretPhraseWarning": {
- "message": "別のシークレットリカバリーフレーズを使用して復元すると、現在のウォレット、アカウント、アセットは永久にこのアプリから削除されます。この操作は元に戻せません。"
- },
"secretRecoveryPhrase": {
"message": "シークレットリカバリーフレーズ"
},
diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json
index 79bcad27a..1c575b4a9 100644
--- a/app/_locales/kn/messages.json
+++ b/app/_locales/kn/messages.json
@@ -765,9 +765,6 @@
"restore": {
"message": "ಮರುಸ್ಥಾಪನೆ"
},
- "restoreAccountWithSeed": {
- "message": "ಸೀಡ್ ಫ್ರೇಸ್ನೊಂದಿಗೆ ನಿಮ್ಮ ಖಾತೆಯನ್ನು ಮರುಸ್ಥಾಪಿಸಿ"
- },
"revealSeedWords": {
"message": "ಸೀಡ್ ವರ್ಡ್ಸ್ ಬಹಿರಂಗಪಡಿಸಿ"
},
diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json
index ccaaec61b..c000290ed 100644
--- a/app/_locales/ko/messages.json
+++ b/app/_locales/ko/messages.json
@@ -1273,19 +1273,12 @@
"importAccountError": {
"message": "계정 가져오기 오류"
},
- "importAccountLinkText": {
- "message": "비밀 복구 구문을 사용해 가져오기"
- },
"importAccountMsg": {
"message": "가져온 계정은 본래 생성한 MetaMask 계정 비밀 복구 구문과 연결하지 못합니다. 가져온 계정에 대해 자세히 알아보기"
},
"importAccountSeedPhrase": {
"message": "비밀 복구 구문으로 계정 가져오기"
},
- "importAccountText": {
- "message": "또는 $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "지갑을 만들 때 받은 비밀 복구 구문(시드 구문)을 입력하세요. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1745,9 +1738,6 @@
"message": "계정 $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "다음 이유 때문에 수집 금액이 추가되지 않았습니다: $1"
- },
"newCollectibleAddedMessage": {
"message": "수집이 성공적으로 추가되었습니다!"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "복구"
},
- "restoreAccountWithSeed": {
- "message": "비밀 복구 구문으로 계정 복구"
- },
"restoreWalletPreferences": {
"message": "$1의 데이터 백업이 발견되었습니다. 지갑 환경설정을 복원할까요?",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "금고를 복구하려면 비밀 구문을 여기에 입력하세요."
},
- "secretPhraseWarning": {
- "message": "다른 비밀 복구 구문을 사용하여 복구하면 현재 지갑, 계정 및 자산이 이 앱에서 영구적으로 제거됩니다. 이 작업은 취소할 수 없습니다."
- },
"secretRecoveryPhrase": {
"message": "비밀 복구 구문"
},
diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json
index 9d8453bc8..240a7c198 100644
--- a/app/_locales/lt/messages.json
+++ b/app/_locales/lt/messages.json
@@ -765,9 +765,6 @@
"restore": {
"message": "Atkurti"
},
- "restoreAccountWithSeed": {
- "message": "Atkurti paskyrą naudojant atkūrimo frazę"
- },
"revealSeedWords": {
"message": "Atskleisti atkūrimo žodžius"
},
diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json
index 14c0dfe4d..e41892d56 100644
--- a/app/_locales/lv/messages.json
+++ b/app/_locales/lv/messages.json
@@ -761,9 +761,6 @@
"restore": {
"message": "Atjaunot"
},
- "restoreAccountWithSeed": {
- "message": "Atjaunojiet savu kontu ar atkopšanas frāzi"
- },
"revealSeedWords": {
"message": "Parādīt atkopšanas vārdus"
},
diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json
index 7c9e3b8bc..b62072110 100644
--- a/app/_locales/ms/messages.json
+++ b/app/_locales/ms/messages.json
@@ -745,9 +745,6 @@
"restore": {
"message": "Pulihkan"
},
- "restoreAccountWithSeed": {
- "message": "Pulihkan Akaun anda dengan Ungkapan Benih"
- },
"revealSeedWords": {
"message": "Dedahkan Ungkapan Benih"
},
diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json
index 3d9489ad4..2f4f94f53 100644
--- a/app/_locales/no/messages.json
+++ b/app/_locales/no/messages.json
@@ -752,9 +752,6 @@
"restore": {
"message": "Gjenopprett"
},
- "restoreAccountWithSeed": {
- "message": "Gjenopprett konto med frøfrase"
- },
"revealSeedWords": {
"message": "Vis frøord"
},
diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json
index 41c685962..be9cafadc 100644
--- a/app/_locales/ph/messages.json
+++ b/app/_locales/ph/messages.json
@@ -842,19 +842,12 @@
"importAccount": {
"message": "Mag-import ng Account"
},
- "importAccountLinkText": {
- "message": "i-import gamit ang Secret Recovery Phrase"
- },
"importAccountMsg": {
"message": " Ang mga na-import na account ay hindi mauugnay sa orihinal mong nagawang Secret Recovery Phrase ng MetaMask account. Matuto pa tungkol sa mga na-import account "
},
"importAccountSeedPhrase": {
"message": "Mag-import ng account gamit ang Secret Recovery Phrase"
},
- "importAccountText": {
- "message": "o $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importTokenQuestion": {
"message": "Mag-import ng token?"
},
@@ -1446,9 +1439,6 @@
"restore": {
"message": "I-restore"
},
- "restoreAccountWithSeed": {
- "message": "I-restore ang iyong Account gamit ang Secret Recovery Phrase"
- },
"restoreWalletPreferences": {
"message": "Nakita ang backup ng iyong data mula sa $1. Gusto mo bang i-restore ang mga kagustuhan mo sa wallet?",
"description": "$1 is the date at which the data was backed up"
diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json
index 1c174945b..8d5e1019e 100644
--- a/app/_locales/pl/messages.json
+++ b/app/_locales/pl/messages.json
@@ -759,9 +759,6 @@
"restore": {
"message": "Przywróć"
},
- "restoreAccountWithSeed": {
- "message": "Przywróć konto frazą seed"
- },
"revealSeedWords": {
"message": "Pokaż słowa seed"
},
diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json
index afbeb96b5..8b161b3cf 100644
--- a/app/_locales/pt_BR/messages.json
+++ b/app/_locales/pt_BR/messages.json
@@ -1306,19 +1306,12 @@
"importAccountError": {
"message": "Erro de importação de conta."
},
- "importAccountLinkText": {
- "message": "importe usando a Frase de Recuperação Secreta"
- },
"importAccountMsg": {
"message": "As contas importadas não estarão associadas à Frase de Recuperação Secreta da conta da MetaMask criada originalmente. Saiba mais sobre as contas importadas"
},
"importAccountSeedPhrase": {
"message": "Importe uma carteira com a Frase de Recuperação Secreta"
},
- "importAccountText": {
- "message": "ou $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "Digite sua Frase de Recuperação Secreta (ou seja, a frase seed) que lhe foi dada quando você criou a sua carteira. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1778,9 +1771,6 @@
"message": "Conta $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "O colecionável não foi adicionado pelo seguinte motivo: $1"
- },
"newCollectibleAddedMessage": {
"message": "O colecionável foi adicionado com sucesso!"
},
@@ -2262,9 +2252,6 @@
"restore": {
"message": "Restaurar"
},
- "restoreAccountWithSeed": {
- "message": "Restaure sua conta com a Frase de Recuperação Secreta"
- },
"restoreWalletPreferences": {
"message": "Encontramos um backup dos seus dados de $1. Gostaria de restaurar as preferências da sua carteira?",
"description": "$1 is the date at which the data was backed up"
@@ -2332,9 +2319,6 @@
"secretPhrase": {
"message": "Somente a primeira conta nessa carteira será carregada automaticamente. Após concluir esse processo, para adicionar mais contas, clique no menu suspenso e selecione Criar Conta."
},
- "secretPhraseWarning": {
- "message": "Se você restaurar usando outra Frase de Recuperação Secreta, sua carteira, conta e ativos atuais serão removidos permanentemente deste aplicativo. Essa ação será irreversível."
- },
"secretRecoveryPhrase": {
"message": "Frase de Recuperação Secreta"
},
diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json
index fe5d4482c..06cf6f692 100644
--- a/app/_locales/ro/messages.json
+++ b/app/_locales/ro/messages.json
@@ -752,9 +752,6 @@
"restore": {
"message": "Restabilește"
},
- "restoreAccountWithSeed": {
- "message": "Restaurați-vă contul folosind fraza inițială"
- },
"revealSeedWords": {
"message": "Arată cuvintele din seed"
},
diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json
index 6e839d17b..49d76144d 100644
--- a/app/_locales/ru/messages.json
+++ b/app/_locales/ru/messages.json
@@ -1273,19 +1273,12 @@
"importAccountError": {
"message": "Ошибка импорта счета."
},
- "importAccountLinkText": {
- "message": "импортировать с использованием секретной фразы для восстановления"
- },
"importAccountMsg": {
"message": "Импортированные счета не будут связаны с секретной фразой для восстановления вашего изначально созданного счета MetaMask. Узнайте больше об импортированных счетах"
},
"importAccountSeedPhrase": {
"message": "Импорт кошелька с помощью секретной фразы для восстановления"
},
- "importAccountText": {
- "message": "или $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "Введите секретную фразу для восстановления (также известную как «сид-фраза»), которую вы получили при создании кошелька. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1745,9 +1738,6 @@
"message": "Счет $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "Причина, по которой не был добавлен коллекционный актив: $1"
- },
"newCollectibleAddedMessage": {
"message": "Коллекционный актив успешно добавлен!"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "Восстановить"
},
- "restoreAccountWithSeed": {
- "message": "Восстановите свой счет с помощью секретной фразы для восстановления"
- },
"restoreWalletPreferences": {
"message": "Найдена резервная копия ваших данных из $1. Хотите восстановить настройки кошелька?",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "Автоматически загружается только первый счет в этом кошельке. Для добавления дополнительных счетов, после завершения этого процесса нажмите на выпадающее меню, а затем выберите «Создать счет»."
},
- "secretPhraseWarning": {
- "message": "Если вы выполняете восстановление с использованием другой секретной фразы для восстановления, ваш текущий кошелек, счета и активы будут удалены из этого приложения без возможности восстановления. Это действие нельзя отменить."
- },
"secretRecoveryPhrase": {
"message": "Секретная фраза для восстановления"
},
diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json
index 60cd3a48e..0fd6d8bb5 100644
--- a/app/_locales/sk/messages.json
+++ b/app/_locales/sk/messages.json
@@ -734,9 +734,6 @@
"restore": {
"message": "Obnoviť"
},
- "restoreAccountWithSeed": {
- "message": "Obnoviť účet pomocou seed frázy"
- },
"revealSeedWords": {
"message": "Zobrazit slova klíčové fráze"
},
diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json
index 046dc927c..4ebce0449 100644
--- a/app/_locales/sl/messages.json
+++ b/app/_locales/sl/messages.json
@@ -753,9 +753,6 @@
"restore": {
"message": "Obnovi"
},
- "restoreAccountWithSeed": {
- "message": "Obnovi račun z seed phrase"
- },
"revealSeedWords": {
"message": "Razkrij seed words"
},
diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json
index 0a49cbb19..f37701547 100644
--- a/app/_locales/sr/messages.json
+++ b/app/_locales/sr/messages.json
@@ -756,9 +756,6 @@
"restore": {
"message": "Поново отвори"
},
- "restoreAccountWithSeed": {
- "message": "Povratite svoj nalog uz pomoć seed fraze"
- },
"revealSeedWords": {
"message": "Otkrivanje početnih reči"
},
diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json
index 3e62b14ab..447dcde42 100644
--- a/app/_locales/sv/messages.json
+++ b/app/_locales/sv/messages.json
@@ -749,9 +749,6 @@
"restore": {
"message": "Återställ"
},
- "restoreAccountWithSeed": {
- "message": "Återställ ditt konto med seedphrase"
- },
"revealSeedWords": {
"message": "Visa seed-ord"
},
diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json
index a2634a088..dc1a61406 100644
--- a/app/_locales/sw/messages.json
+++ b/app/_locales/sw/messages.json
@@ -743,9 +743,6 @@
"restore": {
"message": "Rejesha"
},
- "restoreAccountWithSeed": {
- "message": "Rejesha Akaunti yako kwa kutumia Kirai Kianzio."
- },
"revealSeedWords": {
"message": "Onyesha Maneno ya Kianzio"
},
diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json
index ace2ed1ee..b9f400d7e 100644
--- a/app/_locales/tl/messages.json
+++ b/app/_locales/tl/messages.json
@@ -1273,19 +1273,12 @@
"importAccountError": {
"message": "Error sa pag-import ng account."
},
- "importAccountLinkText": {
- "message": "i-import gamit ang Secret Recovery Phrase"
- },
"importAccountMsg": {
"message": "Ang mga na-import na account ay hindi mauugnay sa orihinal mong nagawang Secret Recovery Phrase ng MetaMask account. Matuto pa tungkol sa mga na-import account"
},
"importAccountSeedPhrase": {
"message": "Mag-import ng account gamit ang Secret Recovery Phrase"
},
- "importAccountText": {
- "message": "o $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "Ilagay ang iyong Secret Recovery Phrase (kilala rin bilang Seed Phrase) na ibinigay sa iyo noong gumawa ka ng iyong wallet. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1745,9 +1738,6 @@
"message": "Account $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "Ang collectible ay hindi idinagdag dahil: $1"
- },
"newCollectibleAddedMessage": {
"message": "Ang collectible ay tagumpay na naidagdag!"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "I-restore"
},
- "restoreAccountWithSeed": {
- "message": "I-restore ang iyong Account gamit ang Secret Recovery Phrase"
- },
"restoreWalletPreferences": {
"message": "Nakita ang backup ng iyong data mula sa $1. Gusto mo bang i-restore ang mga kagustuhan mo sa wallet?",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "Ang unang account lang sa wallet na ito ang awtomatikong maglo-load. Pagkatapos makumpleto ang prosesong ito, upang magdagdag ng mga karagdagang account, i-click ang drop down na menu, pagkatapos ay piliin ang Gumawa ng Account."
},
- "secretPhraseWarning": {
- "message": "Kapag nagre-restore ka gamit ang isa pang Secret Recovery Phrase, permanenteng aalisin sa app na ito ang iyong kasalukuyang wallet, mga account, at asset. Ang gawaing ito ay hindi pwedeng baguhin."
- },
"secretRecoveryPhrase": {
"message": "Secret Recovery Phrase"
},
diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json
index 263ca97dc..9cd734cdc 100644
--- a/app/_locales/tr/messages.json
+++ b/app/_locales/tr/messages.json
@@ -1273,19 +1273,12 @@
"importAccountError": {
"message": "Hesap içe aktarılırken hata oluştu."
},
- "importAccountLinkText": {
- "message": "Gizli Kurtarma İfadesi kullanarak içe aktar"
- },
"importAccountMsg": {
"message": "İçe aktarılan hesaplar ilk olarak oluşturduğunuz MetaMask hesabı Gizli Kurtarma ifadenizle ilişkilendirilmez. İçe aktarılan hesaplar hakkında daha fazla bilgi edinin"
},
"importAccountSeedPhrase": {
"message": "Gizli Kurtarma İfadesi ile bir cüzdanı içe aktarın"
},
- "importAccountText": {
- "message": "veya $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "Cüzdanınızı oluşturduğunuzda size verilen Gizli Kurtarma İfadenizi (başka bir deyişle Tohum İfadesi) girin. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1745,9 +1738,6 @@
"message": "Hesap $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "Tahsil edilebilir tutar eklenmedi ve sebebi: $1"
- },
"newCollectibleAddedMessage": {
"message": "Tahsil edilebilir tutar başarılı bir şekilde eklendi!"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "Geri Yükle"
},
- "restoreAccountWithSeed": {
- "message": "Gizli Kurtarma İfadesi ile Hesabınızı geri yükleyin"
- },
"restoreWalletPreferences": {
"message": "Verilerinizin $1 tarihinden bir yedeği bulundu. Cüzdan tercihlerinizi geri yüklemek ister misiniz?",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "Sadece bu cüzdandaki ilk hesap otomatik olarak yüklenecektir. Bu işlem tamamlandıktan sonra ilave hesaplar eklemek için açılır menüye tıklayın ardından Hesap Oluştur seçeneğini seçin."
},
- "secretPhraseWarning": {
- "message": "Başka bir Gizli Kurtarma İfadesini kullanarak geri yükleme işlemi yaparsanız mevcut cüzdan, hesap ve varlıklarınız bu uygulamadan kalıcı olarak silinir. Bu işlem geri alınamaz."
- },
"secretRecoveryPhrase": {
"message": "Gizli Kurtarma İfadesi"
},
diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json
index 29d9ce0b3..403cafd28 100644
--- a/app/_locales/uk/messages.json
+++ b/app/_locales/uk/messages.json
@@ -765,9 +765,6 @@
"restore": {
"message": "Відновити"
},
- "restoreAccountWithSeed": {
- "message": "Відновіть ваш обліковий запис за допомогою seed-фрази"
- },
"revealSeedWords": {
"message": "Показати мнемонічні слова"
},
diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json
index cc8ee51f9..de29ab1d5 100644
--- a/app/_locales/vi/messages.json
+++ b/app/_locales/vi/messages.json
@@ -1273,19 +1273,12 @@
"importAccountError": {
"message": "Lỗi khi nhập tài khoản."
},
- "importAccountLinkText": {
- "message": "nhập bằng Cụm mật khẩu khôi phục bí mật"
- },
"importAccountMsg": {
"message": "Tài khoản đã nhập sẽ không được liên kết với Cụm mật khẩu khôi phục bí mật cho tài khoản MetaMask đã tạo ban đầu của bạn. Tìm hiểu thêm về các tài khoản đã nhập"
},
"importAccountSeedPhrase": {
"message": "Nhập một ví bằng Cụm mật khẩu khôi phục bí mật"
},
- "importAccountText": {
- "message": "hoặc $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "Nhập Cụm Mật Khẩu Khôi Phục Bí Mật (còn được gọi là Cụm Mật Khẩu Gốc) mà bạn được cấp khi tạo ví. $1",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1745,9 +1738,6 @@
"message": "Tài khoản $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "Bộ sưu tập đã không được thêm vì: $1"
- },
"newCollectibleAddedMessage": {
"message": "Bộ sưu tập đã được thêm thành công!"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "Khôi phục"
},
- "restoreAccountWithSeed": {
- "message": "Khôi phục tài khoản của bạn bằng cụm mật khẩu khôi phục bí mật"
- },
"restoreWalletPreferences": {
"message": "Đã tìm thấy bản sao lưu dữ liệu của bạn từ $1. Bạn có muốn khôi phục các tùy chọn ưu tiên trong ví của mình không?",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "Chỉ tự động tải tài khoản đầu tên trên ví. Sau khi hoàn tất quá trình này, để thêm tài khoản bổ sung, hãy nhấn vào trình đơn thả xuống và chọn Tạo tài khoản."
},
- "secretPhraseWarning": {
- "message": "Nếu bạn khôi phục bằng cách sử dụng một Cụm Mật Khẩu Khôi Phục Bí Mật khác, thì ví, tài khoản và tài sản hiện tại của bạn sẽ bị xóa khỏi ứng dụng này vĩnh viễn. Không thể hoàn tác hành động này."
- },
"secretRecoveryPhrase": {
"message": "Cụm Mật Khẩu Khôi Phục Bí Mật"
},
diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json
index 9035fbaa7..943a36afd 100644
--- a/app/_locales/zh_CN/messages.json
+++ b/app/_locales/zh_CN/messages.json
@@ -1273,19 +1273,12 @@
"importAccountError": {
"message": "导入帐户时出错。"
},
- "importAccountLinkText": {
- "message": "使用账户助记词导入"
- },
"importAccountMsg": {
"message": "导入的账户将不会与最初创建的 MetaMask 账户助记词相关联。了解更多有关导入账户的信息 。"
},
"importAccountSeedPhrase": {
"message": "使用账户助记词导入账户"
},
- "importAccountText": {
- "message": "或 $1",
- "description": "$1 represents the text from `importAccountLinkText` as a link"
- },
"importExistingWalletDescription": {
"message": "输入您创建$1钱包时提供的保密恢复短语(或Seed Phrase)。",
"description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link"
@@ -1745,9 +1738,6 @@
"message": "账户 $1",
"description": "Default name of next account to be created on create account screen"
},
- "newCollectibleAddFailed": {
- "message": "未添加收藏,因为:$1"
- },
"newCollectibleAddedMessage": {
"message": "收藏已成功添加!"
},
@@ -2229,9 +2219,6 @@
"restore": {
"message": "恢复"
},
- "restoreAccountWithSeed": {
- "message": "使用账户助记词恢复您的账户"
- },
"restoreWalletPreferences": {
"message": "已找到于 $1 的数据备份。您想恢复您的钱包设置吗?",
"description": "$1 is the date at which the data was backed up"
@@ -2299,9 +2286,6 @@
"secretPhrase": {
"message": "只有这个钱包上的第一个帐户将自动加载。 完成此流程后,点击下拉菜单,然后选择创建账户。"
},
- "secretPhraseWarning": {
- "message": "如果您使用另一个账户助记词来还原,您当前的钱包、帐户和资产将永久从这个应用中移除。 此操作不能撤消。"
- },
"secretRecoveryPhrase": {
"message": "账户助记词"
},
diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json
index 7cabd6945..b16184e25 100644
--- a/app/_locales/zh_TW/messages.json
+++ b/app/_locales/zh_TW/messages.json
@@ -747,9 +747,6 @@
"resetAccountDescription": {
"message": "重置帳戶將清除您的交易紀錄"
},
- "restoreAccountWithSeed": {
- "message": "透過助憶詞還原您的帳戶"
- },
"revealSeedWords": {
"message": "顯示助憶詞"
},
diff --git a/app/build-types/beta/images/logo/metamask-logo-horizontal-dark.svg b/app/build-types/beta/images/logo/metamask-logo-horizontal-dark.svg
deleted file mode 100644
index 43a44eb0e..000000000
--- a/app/build-types/beta/images/logo/metamask-logo-horizontal-dark.svg
+++ /dev/null
@@ -1,148 +0,0 @@
-
diff --git a/app/build-types/beta/images/logo/metamask-logo-horizontal.svg b/app/build-types/beta/images/logo/metamask-logo-horizontal.svg
deleted file mode 100644
index 3155a5149..000000000
--- a/app/build-types/beta/images/logo/metamask-logo-horizontal.svg
+++ /dev/null
@@ -1,148 +0,0 @@
-
diff --git a/app/build-types/flask/images/logo/metamask-logo-horizontal-dark.svg b/app/build-types/flask/images/logo/metamask-logo-horizontal-dark.svg
deleted file mode 100644
index 450ac8434..000000000
--- a/app/build-types/flask/images/logo/metamask-logo-horizontal-dark.svg
+++ /dev/null
@@ -1,116 +0,0 @@
-
diff --git a/app/build-types/flask/images/logo/metamask-logo-horizontal.svg b/app/build-types/flask/images/logo/metamask-logo-horizontal.svg
deleted file mode 100644
index c38ba8c45..000000000
--- a/app/build-types/flask/images/logo/metamask-logo-horizontal.svg
+++ /dev/null
@@ -1,116 +0,0 @@
-
diff --git a/app/images/arbitrum.svg b/app/images/arbitrum.svg
new file mode 100644
index 000000000..5e79c8ccd
--- /dev/null
+++ b/app/images/arbitrum.svg
@@ -0,0 +1,9 @@
+
\ No newline at end of file
diff --git a/app/images/caret-left-black.svg b/app/images/caret-left-black.svg
deleted file mode 100644
index f225424f0..000000000
--- a/app/images/caret-left-black.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/app/images/caret-left.svg b/app/images/caret-left.svg
deleted file mode 100644
index 775d76e39..000000000
--- a/app/images/caret-left.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/app/images/caret-right.svg b/app/images/caret-right.svg
deleted file mode 100644
index 1308f59ce..000000000
--- a/app/images/caret-right.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/app/images/icons/caret-down.svg b/app/images/icons/caret-down.svg
deleted file mode 100644
index 8ab7b0319..000000000
--- a/app/images/icons/caret-down.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/images/icons/collapse.svg b/app/images/icons/collapse.svg
deleted file mode 100644
index 74d6207c9..000000000
--- a/app/images/icons/collapse.svg
+++ /dev/null
@@ -1,26 +0,0 @@
-
diff --git a/app/images/logo/metamask-logo-horizontal.svg b/app/images/logo/metamask-logo-horizontal.svg
deleted file mode 100644
index bc60a0782..000000000
--- a/app/images/logo/metamask-logo-horizontal.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/images/logo/metamask-smart-transactions@4x.png b/app/images/logo/metamask-smart-transactions@4x.png
deleted file mode 100644
index 636576495..000000000
Binary files a/app/images/logo/metamask-smart-transactions@4x.png and /dev/null differ
diff --git a/app/images/logo/smart-transactions-header.png b/app/images/logo/smart-transactions-header.png
new file mode 100644
index 000000000..d0fa8ea94
Binary files /dev/null and b/app/images/logo/smart-transactions-header.png differ
diff --git a/app/images/optimism.svg b/app/images/optimism.svg
new file mode 100644
index 000000000..e8c6e64e4
--- /dev/null
+++ b/app/images/optimism.svg
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/app/images/times.svg b/app/images/times.svg
new file mode 100644
index 000000000..5aa9be3a5
--- /dev/null
+++ b/app/images/times.svg
@@ -0,0 +1,3 @@
+
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 0c941c7f9..4e6176436 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -16,6 +16,7 @@ import {
ENVIRONMENT_TYPE_POPUP,
ENVIRONMENT_TYPE_NOTIFICATION,
ENVIRONMENT_TYPE_FULLSCREEN,
+ PLATFORM_FIREFOX,
} from '../../shared/constants/app';
import { SECOND } from '../../shared/constants/time';
import {
@@ -38,6 +39,7 @@ import rawFirstTimeState from './first-time-state';
import getFirstPreferredLangCode from './lib/get-first-preferred-lang-code';
import getObjStructure from './lib/getObjStructure';
import setupEnsIpfsResolver from './lib/ens-ipfs/setup';
+import { getPlatform } from './lib/util';
/* eslint-enable import/first */
const { sentry } = global;
@@ -345,12 +347,22 @@ function setupController(initState, initLangCode) {
*/
function connectRemote(remotePort) {
const processName = remotePort.name;
- const isMetaMaskInternalProcess = metamaskInternalProcessHash[processName];
if (metamaskBlockedPorts.includes(remotePort.name)) {
return;
}
+ let isMetaMaskInternalProcess = false;
+ const sourcePlatform = getPlatform();
+
+ if (sourcePlatform === PLATFORM_FIREFOX) {
+ isMetaMaskInternalProcess = metamaskInternalProcessHash[processName];
+ } else {
+ isMetaMaskInternalProcess =
+ remotePort.sender.origin ===
+ `chrome-extension://${extension.runtime.id}`;
+ }
+
if (isMetaMaskInternalProcess) {
const portStream = new PortStream(remotePort);
// communication with popup
diff --git a/app/scripts/controllers/detect-tokens.js b/app/scripts/controllers/detect-tokens.js
index c2f740e7e..c98c1683c 100644
--- a/app/scripts/controllers/detect-tokens.js
+++ b/app/scripts/controllers/detect-tokens.js
@@ -3,8 +3,8 @@ import { warn } from 'loglevel';
import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi';
import { SINGLE_CALL_BALANCES_ADDRESS } from '../constants/contracts';
import { MINUTE } from '../../../shared/constants/time';
-import { isEqualCaseInsensitive } from '../../../ui/helpers/utils/util';
import { MAINNET_CHAIN_ID } from '../../../shared/constants/network';
+import { isEqualCaseInsensitive } from '../../../shared/modules/string-utils';
// By default, poll every 3 minutes
const DEFAULT_INTERVAL = MINUTE * 3;
diff --git a/app/scripts/controllers/onboarding.js b/app/scripts/controllers/onboarding.js
index 370ca5e8e..812ba7e44 100644
--- a/app/scripts/controllers/onboarding.js
+++ b/app/scripts/controllers/onboarding.js
@@ -69,7 +69,7 @@ export default class OnboardingController {
* @param {string} tabId - The id of the tab registering
*/
registerOnboarding = async (location, tabId) => {
- if (this.completedOnboarding) {
+ if (this.store.getState().completedOnboarding) {
log.debug('Ignoring registerOnboarding; user already onboarded');
return;
}
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index 4a503e7e6..73e3b7963 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -68,6 +68,7 @@ export default class PreferencesController {
ledgerTransportType: window.navigator.hid
? LEDGER_TRANSPORT_TYPES.WEBHID
: LEDGER_TRANSPORT_TYPES.U2F,
+ theme: 'default',
...opts.initState,
};
@@ -169,6 +170,15 @@ export default class PreferencesController {
this.store.updateState({ eip1559V2Enabled: val });
}
+ /**
+ * Setter for the `theme` property
+ *
+ * @param {string} val - 'default' or 'dark' value based on the mode selected by user.
+ */
+ setTheme(val) {
+ this.store.updateState({ theme: val });
+ }
+
/**
* Add new methodData to state, to avoid requesting this information again through Infura
*
diff --git a/app/scripts/controllers/preferences.test.js b/app/scripts/controllers/preferences.test.js
index d6c8c59bf..10e7ba215 100644
--- a/app/scripts/controllers/preferences.test.js
+++ b/app/scripts/controllers/preferences.test.js
@@ -351,4 +351,18 @@ describe('preferences controller', function () {
);
});
});
+
+ describe('setTheme', function () {
+ it('should default to value "default"', function () {
+ const state = preferencesController.store.getState();
+ assert.equal(state.theme, 'default');
+ });
+
+ it('should set the setTheme property in state', function () {
+ const state = preferencesController.store.getState();
+ assert.equal(state.theme, 'default');
+ preferencesController.setTheme('dark');
+ assert.equal(preferencesController.store.getState().theme, 'dark');
+ });
+ });
});
diff --git a/app/scripts/controllers/swaps.js b/app/scripts/controllers/swaps.js
index 8b16a86dc..6eb800793 100644
--- a/app/scripts/controllers/swaps.js
+++ b/app/scripts/controllers/swaps.js
@@ -28,7 +28,7 @@ import {
} from '../../../ui/pages/swaps/swaps.util';
import fetchWithCache from '../../../ui/helpers/utils/fetch-with-cache';
import { MINUTE, SECOND } from '../../../shared/constants/time';
-import { isEqualCaseInsensitive } from '../../../ui/helpers/utils/util';
+import { isEqualCaseInsensitive } from '../../../shared/modules/string-utils';
import { NETWORK_EVENTS } from './network';
// The MAX_GAS_LIMIT is a number that is higher than the maximum gas costs we have observed on any aggregator
diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js
index 04eae26f8..92c308f29 100644
--- a/app/scripts/controllers/transactions/index.js
+++ b/app/scripts/controllers/transactions/index.js
@@ -3,13 +3,12 @@ import { ObservableStore } from '@metamask/obs-store';
import { bufferToHex, keccak, toBuffer, isHexString } from 'ethereumjs-util';
import EthQuery from 'ethjs-query';
import { ethErrors } from 'eth-rpc-errors';
-import abi from 'human-standard-token-abi';
import Common from '@ethereumjs/common';
import { TransactionFactory } from '@ethereumjs/tx';
-import { ethers } from 'ethers';
import NonceTracker from 'nonce-tracker';
import log from 'loglevel';
import BigNumber from 'bignumber.js';
+import { merge, pickBy } from 'lodash';
import cleanErrorStack from '../../lib/cleanErrorStack';
import {
hexToBn,
@@ -46,16 +45,15 @@ import {
NETWORK_TYPE_RPC,
CHAIN_ID_TO_GAS_LIMIT_BUFFER_MAP,
} from '../../../../shared/constants/network';
-import { isEIP1559Transaction } from '../../../../shared/modules/transaction.utils';
-import { readAddressAsContract } from '../../../../shared/modules/contract-utils';
-import { isEqualCaseInsensitive } from '../../../../ui/helpers/utils/util';
+import {
+ determineTransactionType,
+ isEIP1559Transaction,
+} from '../../../../shared/modules/transaction.utils';
import TransactionStateManager from './tx-state-manager';
import TxGasUtil from './tx-gas-utils';
import PendingTransactionTracker from './pending-tx-tracker';
import * as txUtils from './lib/util';
-const hstInterface = new ethers.utils.Interface(abi);
-
const MAX_MEMSTORE_TX_LIST_SIZE = 100; // Number of transactions (by unique nonces) to keep in memory
const SWAP_TRANSACTION_TYPES = [
@@ -130,6 +128,8 @@ export default class TransactionController extends EventEmitter {
this.updateEventFragment = opts.updateEventFragment;
this.finalizeEventFragment = opts.finalizeEventFragment;
this.getEventFragmentById = opts.getEventFragmentById;
+ this.getDeviceModel = opts.getDeviceModel;
+ this.getAccountType = opts.getAccountType;
this.memStore = new ObservableStore({});
this.query = new EthQuery(this.provider);
@@ -347,6 +347,260 @@ export default class TransactionController extends EventEmitter {
});
}
+ // ====================================================================================================================================================
+
+ /**
+ * @param {number} txId
+ * @returns {TransactionMeta} the txMeta who matches the given id if none found
+ * for the network returns undefined
+ */
+ _getTransaction(txId) {
+ const { transactions } = this.store.getState();
+ return transactions[txId];
+ }
+
+ _checkIfTxStatusIsUnapproved(txId) {
+ return (
+ this.txStateManager.getTransaction(txId).status ===
+ TRANSACTION_STATUSES.UNAPPROVED
+ );
+ }
+
+ _updateTransaction(txId, proposedUpdate, note) {
+ const txMeta = this.txStateManager.getTransaction(txId);
+ const updated = merge(txMeta, proposedUpdate);
+ this.txStateManager.updateTransaction(updated, note);
+ }
+
+ /**
+ * updates the params that are editible in the send edit flow
+ *
+ * @param {string} txId - transaction id
+ * @param {object} editableParams - holds the editable parameters
+ * @param {object} editableParams.data
+ * @param {string} editableParams.from
+ * @param {string} editableParams.to
+ * @param {string} editableParams.value
+ * @returns {TransactionMeta} the txMeta of the updated transaction
+ */
+ updateEditableParams(txId, { data, from, to, value }) {
+ if (!this._checkIfTxStatusIsUnapproved(txId)) {
+ throw new Error(
+ 'Cannot call updateEditableParams on a transaction that is not in an unapproved state',
+ );
+ }
+
+ const editableParams = {
+ txParams: {
+ data,
+ from,
+ to,
+ value,
+ },
+ };
+
+ // only update what is defined
+ editableParams.txParams = pickBy(editableParams.txParams);
+ const note = `Update Editable Params for ${txId}`;
+ this._updateTransaction(txId, editableParams, note);
+ return this._getTransaction(txId);
+ }
+
+ /**
+ * updates the gas fees of the transaction with id if the transaction state is unapproved
+ *
+ * @param {string} txId - transaction id
+ * @param {object} txGasFees - holds the gas fees parameters
+ * @param {string} txGasFees.gasLimit
+ * @param {string} txGasFees.gasPrice
+ * @param {string} txGasFees.maxPriorityFeePerGas
+ * @param {string} txGasFees.maxFeePerGas
+ * @param {string} txGasFees.estimateUsed
+ * @param {string} txGasFees.estimateSuggested
+ * @param {string} txGasFees.defaultGasEstimates
+ * @param {string} txGasFees.gas
+ * @param {string} txGasFees.originalGasEstimate
+ * @returns {TransactionMeta} the txMeta of the updated transaction
+ */
+ updateTransactionGasFees(
+ txId,
+ {
+ gas,
+ gasLimit,
+ gasPrice,
+ maxPriorityFeePerGas,
+ maxFeePerGas,
+ estimateUsed,
+ estimateSuggested,
+ defaultGasEstimates,
+ originalGasEstimate,
+ },
+ ) {
+ if (!this._checkIfTxStatusIsUnapproved(txId)) {
+ throw new Error(
+ 'Cannot call updateTransactionGasFees on a transaction that is not in an unapproved state',
+ );
+ }
+
+ let txGasFees = {
+ txParams: {
+ gas,
+ gasLimit,
+ gasPrice,
+ maxPriorityFeePerGas,
+ maxFeePerGas,
+ },
+ estimateUsed,
+ estimateSuggested,
+ defaultGasEstimates,
+ originalGasEstimate,
+ };
+
+ // only update what is defined
+ txGasFees.txParams = pickBy(txGasFees.txParams);
+ txGasFees = pickBy(txGasFees);
+ const note = `Update Transaction Gas Fees for ${txId}`;
+ this._updateTransaction(txId, txGasFees, note);
+ return this._getTransaction(txId);
+ }
+
+ /**
+ * updates the estimate base fees of the transaction with id if the transaction state is unapproved
+ *
+ * @param {string} txId - transaction id
+ * @param {object} txEstimateBaseFees - holds the estimate base fees parameters
+ * @param {string} txEstimateBaseFees.estimatedBaseFee
+ * @param {string} txEstimateBaseFees.decEstimatedBaseFee
+ * @returns {TransactionMeta} the txMeta of the updated transaction
+ */
+ updateTransactionEstimatedBaseFee(
+ txId,
+ { estimatedBaseFee, decEstimatedBaseFee },
+ ) {
+ if (!this._checkIfTxStatusIsUnapproved(txId)) {
+ throw new Error(
+ 'Cannot call updateTransactionEstimatedBaseFee on a transaction that is not in an unapproved state',
+ );
+ }
+
+ let txEstimateBaseFees = { estimatedBaseFee, decEstimatedBaseFee };
+ // only update what is defined
+ txEstimateBaseFees = pickBy(txEstimateBaseFees);
+
+ const note = `Update Transaction Estimated Base Fees for ${txId}`;
+ this._updateTransaction(txId, txEstimateBaseFees, note);
+ return this._getTransaction(txId);
+ }
+
+ /**
+ * updates a swap approval transaction with provided metadata and source token symbol
+ * if the transaction state is unapproved.
+ *
+ * @param {string} txId
+ * @param {object} swapApprovalTransaction - holds the metadata and token symbol
+ * @param {string} swapApprovalTransaction.type
+ * @param {string} swapApprovalTransaction.sourceTokenSymbol
+ * @returns {TransactionMeta} the txMeta of the updated transaction
+ */
+ updateSwapApprovalTransaction(txId, { type, sourceTokenSymbol }) {
+ if (!this._checkIfTxStatusIsUnapproved(txId)) {
+ throw new Error(
+ 'Cannot call updateSwapApprovalTransaction on a transaction that is not in an unapproved state',
+ );
+ }
+
+ let swapApprovalTransaction = { type, sourceTokenSymbol };
+ // only update what is defined
+ swapApprovalTransaction = pickBy(swapApprovalTransaction);
+
+ const note = `Update Swap Approval Transaction for ${txId}`;
+ this._updateTransaction(txId, swapApprovalTransaction, note);
+ return this._getTransaction(txId);
+ }
+
+ /**
+ * updates a swap transaction with provided metadata and source token symbol
+ * if the transaction state is unapproved.
+ *
+ * @param {string} txId
+ * @param {object} swapTransaction - holds the metadata
+ * @param {string} swapTransaction.sourceTokenSymbol
+ * @param {string} swapTransaction.destinationTokenSymbol
+ * @param {string} swapTransaction.type
+ * @param {string} swapTransaction.destinationTokenDecimals
+ * @param {string} swapTransaction.destinationTokenAddress
+ * @param {string} swapTransaction.swapMetaData
+ * @param {string} swapTransaction.swapTokenValue
+ * @param {string} swapTransaction.estimatedBaseFee
+ * @param {string} swapTransaction.approvalTxId
+ * @returns {TransactionMeta} the txMeta of the updated transaction
+ */
+ updateSwapTransaction(
+ txId,
+ {
+ sourceTokenSymbol,
+ destinationTokenSymbol,
+ type,
+ destinationTokenDecimals,
+ destinationTokenAddress,
+ swapMetaData,
+ swapTokenValue,
+ estimatedBaseFee,
+ approvalTxId,
+ },
+ ) {
+ if (!this._checkIfTxStatusIsUnapproved(txId)) {
+ throw new Error(
+ 'Cannot call updateSwapTransaction on a transaction that is not in an unapproved state',
+ );
+ }
+ let swapTransaction = {
+ sourceTokenSymbol,
+ destinationTokenSymbol,
+ type,
+ destinationTokenDecimals,
+ destinationTokenAddress,
+ swapMetaData,
+ swapTokenValue,
+ estimatedBaseFee,
+ approvalTxId,
+ };
+
+ // only update what is defined
+ swapTransaction = pickBy(swapTransaction);
+
+ const note = `Update Swap Transaction for ${txId}`;
+ this._updateTransaction(txId, swapTransaction, note);
+ return this._getTransaction(txId);
+ }
+
+ /**
+ * updates a transaction's user settings only if the transaction state is unapproved
+ *
+ * @param {string} txId
+ * @param {object} userSettings - holds the metadata
+ * @param {string} userSettings.userEditedGasLimit
+ * @param {string} userSettings.userFeeLevel
+ * @returns {TransactionMeta} the txMeta of the updated transaction
+ */
+ updateTransactionUserSettings(txId, { userEditedGasLimit, userFeeLevel }) {
+ if (!this._checkIfTxStatusIsUnapproved(txId)) {
+ throw new Error(
+ 'Cannot call updateTransactionUserSettings on a transaction that is not in an unapproved state',
+ );
+ }
+
+ let userSettings = { userEditedGasLimit, userFeeLevel };
+ // only update what is defined
+ userSettings = pickBy(userSettings);
+
+ const note = `Update User Settings for ${txId}`;
+ this._updateTransaction(txId, userSettings, note);
+ return this._getTransaction(txId);
+ }
+
+ // ====================================================================================================================================================
+
/**
* Validates and generates a txMeta with defaults and puts it in txStateManager
* store.
@@ -376,7 +630,7 @@ export default class TransactionController extends EventEmitter {
* `generateTxMeta` adds the default txMeta properties to the passed object.
* These include the tx's `id`. As we use the id for determining order of
* txes in the tx-state-manager, it is necessary to call the asynchronous
- * method `this._determineTransactionType` after `generateTxMeta`.
+ * method `determineTransactionType` after `generateTxMeta`.
*/
let txMeta = this.txStateManager.generateTxMeta({
txParams: normalizedTxParams,
@@ -404,8 +658,9 @@ export default class TransactionController extends EventEmitter {
}
}
- const { type, getCodeResponse } = await this._determineTransactionType(
+ const { type, getCodeResponse } = await determineTransactionType(
txParams,
+ this.query,
);
txMeta.type = transactionType || type;
@@ -1461,67 +1716,6 @@ export default class TransactionController extends EventEmitter {
});
}
- /**
- * @typedef { 'transfer' | 'approve' | 'transferfrom' | 'contractInteraction'| 'simpleSend' } InferrableTransactionTypes
- */
-
- /**
- * @typedef {Object} InferTransactionTypeResult
- * @property {InferrableTransactionTypes} type - The type of transaction
- * @property {string} getCodeResponse - The contract code, in hex format if
- * it exists. '0x0' or '0x' are also indicators of non-existent contract
- * code
- */
-
- /**
- * Determines the type of the transaction by analyzing the txParams.
- * This method will return one of the types defined in shared/constants/transactions
- * It will never return TRANSACTION_TYPE_CANCEL or TRANSACTION_TYPE_RETRY as these
- * represent specific events that we control from the extension and are added manually
- * at transaction creation.
- *
- * @param {Object} txParams - Parameters for the transaction
- * @returns {InferTransactionTypeResult}
- */
- async _determineTransactionType(txParams) {
- const { data, to } = txParams;
- let name;
- try {
- name = data && hstInterface.parseTransaction({ data }).name;
- } catch (error) {
- log.debug('Failed to parse transaction data.', error, data);
- }
-
- const tokenMethodName = [
- TRANSACTION_TYPES.TOKEN_METHOD_APPROVE,
- TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER,
- TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM,
- ].find((methodName) => isEqualCaseInsensitive(methodName, name));
-
- let result;
- if (data && tokenMethodName) {
- result = tokenMethodName;
- } else if (data && !to) {
- result = TRANSACTION_TYPES.DEPLOY_CONTRACT;
- }
-
- let contractCode;
-
- if (!result) {
- const {
- contractCode: resultCode,
- isContractAddress,
- } = await readAddressAsContract(this.query, to);
-
- contractCode = resultCode;
- result = isContractAddress
- ? TRANSACTION_TYPES.CONTRACT_INTERACTION
- : TRANSACTION_TYPES.SIMPLE_SEND;
- }
-
- return { type: result, getCodeResponse: contractCode };
- }
-
/**
* Sets other txMeta statuses to dropped if the txMeta that has been confirmed has other transactions
* in the list have the same nonce
@@ -1735,6 +1929,8 @@ export default class TransactionController extends EventEmitter {
eip_1559_version: eip1559Version,
gas_edit_type: 'none',
gas_edit_attempted: 'none',
+ account_type: await this.getAccountType(this.getSelectedAddress()),
+ device_model: await this.getDeviceModel(this.getSelectedAddress()),
};
const sensitiveProperties = {
diff --git a/app/scripts/controllers/transactions/index.test.js b/app/scripts/controllers/transactions/index.test.js
index c20fd5459..c0c189868 100644
--- a/app/scripts/controllers/transactions/index.test.js
+++ b/app/scripts/controllers/transactions/index.test.js
@@ -82,6 +82,8 @@ describe('Transaction Controller', function () {
getEventFragmentById: () =>
fragmentExists === false ? undefined : { id: 0 },
getEIP1559GasFeeEstimates: () => undefined,
+ getAccountType: () => 'MetaMask',
+ getDeviceModel: () => 'N/A',
});
txController.nonceTracker.getNonceLock = () =>
Promise.resolve({ nextNonce: 0, releaseLock: noop });
@@ -1303,156 +1305,6 @@ describe('Transaction Controller', function () {
});
});
- describe('#_determineTransactionType', function () {
- it('should return a simple send type when to is truthy but data is falsy', async function () {
- const result = await txController._determineTransactionType({
- to: '0xabc',
- data: '',
- });
- assert.deepEqual(result, {
- type: TRANSACTION_TYPES.SIMPLE_SEND,
- getCodeResponse: null,
- });
- });
-
- it('should return a token transfer type when data is for the respective method call', async function () {
- const result = await txController._determineTransactionType({
- to: '0xabc',
- data:
- '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a',
- });
- assert.deepEqual(result, {
- type: TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER,
- getCodeResponse: undefined,
- });
- });
-
- it('should return a token approve type when data is for the respective method call', async function () {
- const result = await txController._determineTransactionType({
- to: '0xabc',
- data:
- '0x095ea7b30000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C9700000000000000000000000000000000000000000000000000000000000000005',
- });
- assert.deepEqual(result, {
- type: TRANSACTION_TYPES.TOKEN_METHOD_APPROVE,
- getCodeResponse: undefined,
- });
- });
-
- it('should return a contract deployment type when to is falsy and there is data', async function () {
- const result = await txController._determineTransactionType({
- to: '',
- data: '0xabd',
- });
- assert.deepEqual(result, {
- type: TRANSACTION_TYPES.DEPLOY_CONTRACT,
- getCodeResponse: undefined,
- });
- });
-
- it('should return a simple send type with a 0x getCodeResponse when there is data and but the to address is not a contract address', async function () {
- const result = await txController._determineTransactionType({
- to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9',
- data: '0xabd',
- });
- assert.deepEqual(result, {
- type: TRANSACTION_TYPES.SIMPLE_SEND,
- getCodeResponse: '0x',
- });
- });
-
- it('should return a simple send type with a null getCodeResponse when to is truthy and there is data and but getCode returns an error', async function () {
- const result = await txController._determineTransactionType({
- to: '0xabc',
- data: '0xabd',
- });
- assert.deepEqual(result, {
- type: TRANSACTION_TYPES.SIMPLE_SEND,
- getCodeResponse: null,
- });
- });
-
- it('should return a contract interaction type with the correct getCodeResponse when to is truthy and there is data and it is not a token transaction', async function () {
- const _providerResultStub = {
- // 1 gwei
- eth_gasPrice: '0x0de0b6b3a7640000',
- // by default, all accounts are external accounts (not contracts)
- eth_getCode: '0xa',
- };
- const _provider = createTestProviderTools({
- scaffold: _providerResultStub,
- }).provider;
- const _fromAccount = getTestAccounts()[0];
- const _blockTrackerStub = new EventEmitter();
- _blockTrackerStub.getCurrentBlock = noop;
- _blockTrackerStub.getLatestBlock = noop;
- const _txController = new TransactionController({
- provider: _provider,
- getGasPrice() {
- return '0xee6b2800';
- },
- networkStore: new ObservableStore(currentNetworkId),
- getCurrentChainId: () => currentChainId,
- txHistoryLimit: 10,
- blockTracker: _blockTrackerStub,
- signTransaction: (ethTx) =>
- new Promise((resolve) => {
- ethTx.sign(_fromAccount.key);
- resolve();
- }),
- getParticipateInMetrics: () => false,
- });
- const result = await _txController._determineTransactionType({
- to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9',
- data: 'abd',
- });
- assert.deepEqual(result, {
- type: TRANSACTION_TYPES.CONTRACT_INTERACTION,
- getCodeResponse: '0x0a',
- });
- });
-
- it('should return a contract interaction type with the correct getCodeResponse when to is a contract address and data is falsy', async function () {
- const _providerResultStub = {
- // 1 gwei
- eth_gasPrice: '0x0de0b6b3a7640000',
- // by default, all accounts are external accounts (not contracts)
- eth_getCode: '0xa',
- };
- const _provider = createTestProviderTools({
- scaffold: _providerResultStub,
- }).provider;
- const _fromAccount = getTestAccounts()[0];
- const _blockTrackerStub = new EventEmitter();
- _blockTrackerStub.getCurrentBlock = noop;
- _blockTrackerStub.getLatestBlock = noop;
- const _txController = new TransactionController({
- provider: _provider,
- getGasPrice() {
- return '0xee6b2800';
- },
- networkStore: new ObservableStore(currentNetworkId),
- getCurrentChainId: () => currentChainId,
- txHistoryLimit: 10,
- blockTracker: _blockTrackerStub,
- signTransaction: (ethTx) =>
- new Promise((resolve) => {
- ethTx.sign(_fromAccount.key);
- resolve();
- }),
- getParticipateInMetrics: () => false,
- });
- const result = await _txController._determineTransactionType({
- to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9',
- data: '',
- });
- assert.deepEqual(result, {
- type: TRANSACTION_TYPES.CONTRACT_INTERACTION,
- getCodeResponse: '0x0a',
- });
- });
- });
-
describe('#getPendingTransactions', function () {
it('should show only submitted and approved transactions as pending transaction', function () {
txController.txStateManager._addTransactionsToState([
@@ -1616,6 +1468,8 @@ describe('Transaction Controller', function () {
referrer: 'metamask',
source: 'user',
type: TRANSACTION_TYPES.SIMPLE_SEND,
+ account_type: 'MetaMask',
+ device_model: 'N/A',
},
sensitiveProperties: {
default_gas: '0.000031501',
@@ -1691,6 +1545,8 @@ describe('Transaction Controller', function () {
referrer: 'metamask',
source: 'user',
type: TRANSACTION_TYPES.SIMPLE_SEND,
+ account_type: 'MetaMask',
+ device_model: 'N/A',
},
sensitiveProperties: {
default_gas: '0.000031501',
@@ -1776,6 +1632,8 @@ describe('Transaction Controller', function () {
referrer: 'other',
source: 'dapp',
type: TRANSACTION_TYPES.SIMPLE_SEND,
+ account_type: 'MetaMask',
+ device_model: 'N/A',
},
sensitiveProperties: {
default_gas: '0.000031501',
@@ -1853,6 +1711,8 @@ describe('Transaction Controller', function () {
referrer: 'other',
source: 'dapp',
type: TRANSACTION_TYPES.SIMPLE_SEND,
+ account_type: 'MetaMask',
+ device_model: 'N/A',
},
sensitiveProperties: {
default_gas: '0.000031501',
@@ -1930,6 +1790,8 @@ describe('Transaction Controller', function () {
referrer: 'other',
source: 'dapp',
type: TRANSACTION_TYPES.SIMPLE_SEND,
+ account_type: 'MetaMask',
+ device_model: 'N/A',
},
sensitiveProperties: {
gas_price: '2',
@@ -1989,6 +1851,8 @@ describe('Transaction Controller', function () {
eip_1559_version: '0',
gas_edit_attempted: 'none',
gas_edit_type: 'none',
+ account_type: 'MetaMask',
+ device_model: 'N/A',
},
sensitiveProperties: {
baz: 3.0,
@@ -2058,6 +1922,8 @@ describe('Transaction Controller', function () {
referrer: 'other',
source: 'dapp',
type: TRANSACTION_TYPES.SIMPLE_SEND,
+ account_type: 'MetaMask',
+ device_model: 'N/A',
},
sensitiveProperties: {
baz: 3.0,
@@ -2159,4 +2025,202 @@ describe('Transaction Controller', function () {
assert.deepEqual(result, expectedParams);
});
});
+
+ describe('update transaction methods', function () {
+ let txStateManager;
+
+ beforeEach(function () {
+ txStateManager = txController.txStateManager;
+ txStateManager.addTransaction({
+ id: '1',
+ status: TRANSACTION_STATUSES.UNAPPROVED,
+ metamaskNetworkId: currentNetworkId,
+ txParams: {
+ gasLimit: '0x001',
+ gasPrice: '0x002',
+ // max fees can not be mixed with gasPrice
+ // maxPriorityFeePerGas: '0x003',
+ // maxFeePerGas: '0x004',
+ to: VALID_ADDRESS,
+ from: VALID_ADDRESS,
+ },
+ estimateUsed: '0x005',
+ estimatedBaseFee: '0x006',
+ decEstimatedBaseFee: '6',
+ type: 'swap',
+ sourceTokenSymbol: 'ETH',
+ destinationTokenSymbol: 'UNI',
+ destinationTokenDecimals: 16,
+ destinationTokenAddress: VALID_ADDRESS,
+ swapMetaData: {},
+ swapTokenValue: '0x007',
+ userEditedGasLimit: '0x008',
+ userFeeLevel: 'medium',
+ });
+ });
+
+ it('updates transaction gas fees', function () {
+ // test update gasFees
+ txController.updateTransactionGasFees('1', {
+ gasPrice: '0x0022',
+ gasLimit: '0x0011',
+ });
+ let result = txStateManager.getTransaction('1');
+ assert.equal(result.txParams.gasPrice, '0x0022');
+ // TODO: weird behavior here...only gasPrice gets returned.
+ // assert.equal(result.txParams.gasLimit, '0x0011');
+
+ // test update maxPriorityFeePerGas
+ txStateManager.addTransaction({
+ id: '2',
+ status: TRANSACTION_STATUSES.UNAPPROVED,
+ metamaskNetworkId: currentNetworkId,
+ txParams: {
+ maxPriorityFeePerGas: '0x003',
+ to: VALID_ADDRESS,
+ from: VALID_ADDRESS,
+ },
+ estimateUsed: '0x005',
+ });
+ txController.updateTransactionGasFees('2', {
+ maxPriorityFeePerGas: '0x0033',
+ });
+ result = txStateManager.getTransaction('2');
+ assert.equal(result.txParams.maxPriorityFeePerGas, '0x0033');
+
+ // test update maxFeePerGas
+ txStateManager.addTransaction({
+ id: '3',
+ status: TRANSACTION_STATUSES.UNAPPROVED,
+ metamaskNetworkId: currentNetworkId,
+ txParams: {
+ maxPriorityFeePerGas: '0x003',
+ maxFeePerGas: '0x004',
+ to: VALID_ADDRESS,
+ from: VALID_ADDRESS,
+ },
+ estimateUsed: '0x005',
+ });
+ txController.updateTransactionGasFees('3', { maxFeePerGas: '0x0044' });
+ result = txStateManager.getTransaction('3');
+ assert.equal(result.txParams.maxFeePerGas, '0x0044');
+
+ // test update estimate used
+ txController.updateTransactionGasFees('3', { estimateUsed: '0x0055' });
+ result = txStateManager.getTransaction('3');
+ assert.equal(result.estimateUsed, '0x0055');
+ });
+
+ it('updates estimated base fee', function () {
+ txController.updateTransactionEstimatedBaseFee('1', {
+ estimatedBaseFee: '0x0066',
+ decEstimatedBaseFee: '66',
+ });
+ const result = txStateManager.getTransaction('1');
+ assert.equal(result.estimatedBaseFee, '0x0066');
+ assert.equal(result.decEstimatedBaseFee, '66');
+ });
+
+ it('updates swap approval transaction', function () {
+ txController.updateSwapApprovalTransaction('1', {
+ type: 'swapApproval',
+ sourceTokenSymbol: 'XBN',
+ });
+
+ const result = txStateManager.getTransaction('1');
+ assert.equal(result.type, 'swapApproval');
+ assert.equal(result.sourceTokenSymbol, 'XBN');
+ });
+
+ it('updates swap transaction', function () {
+ txController.updateSwapTransaction('1', {
+ sourceTokenSymbol: 'BTCX',
+ destinationTokenSymbol: 'ETH',
+ });
+
+ const result = txStateManager.getTransaction('1');
+ assert.equal(result.sourceTokenSymbol, 'BTCX');
+ assert.equal(result.destinationTokenSymbol, 'ETH');
+ assert.equal(result.destinationTokenDecimals, 16);
+ assert.equal(result.destinationTokenAddress, VALID_ADDRESS);
+ assert.equal(result.swapTokenValue, '0x007');
+
+ txController.updateSwapTransaction('1', {
+ type: 'swapped',
+ destinationTokenDecimals: 8,
+ destinationTokenAddress: VALID_ADDRESS_TWO,
+ swapTokenValue: '0x0077',
+ });
+ assert.equal(result.sourceTokenSymbol, 'BTCX');
+ assert.equal(result.destinationTokenSymbol, 'ETH');
+ assert.equal(result.type, 'swapped');
+ assert.equal(result.destinationTokenDecimals, 8);
+ assert.equal(result.destinationTokenAddress, VALID_ADDRESS_TWO);
+ assert.equal(result.swapTokenValue, '0x0077');
+ });
+
+ it('updates transaction user settings', function () {
+ txController.updateTransactionUserSettings('1', {
+ userEditedGasLimit: '0x0088',
+ userFeeLevel: 'high',
+ });
+
+ const result = txStateManager.getTransaction('1');
+ assert.equal(result.userEditedGasLimit, '0x0088');
+ assert.equal(result.userFeeLevel, 'high');
+ });
+
+ it('throws error if status is not unapproved', function () {
+ txStateManager.addTransaction({
+ id: '4',
+ status: TRANSACTION_STATUSES.APPROVED,
+ metamaskNetworkId: currentNetworkId,
+ txParams: {
+ maxPriorityFeePerGas: '0x007',
+ maxFeePerGas: '0x008',
+ to: VALID_ADDRESS,
+ from: VALID_ADDRESS,
+ },
+ estimateUsed: '0x009',
+ });
+
+ try {
+ txController.updateTransactionGasFees('4', { maxFeePerGas: '0x0088' });
+ } catch (e) {
+ assert.equal(
+ e.message,
+ 'Cannot call updateTransactionGasFees on a transaction that is not in an unapproved state',
+ );
+ }
+ });
+
+ it('does not update unknown parameters in update method', function () {
+ txController.updateSwapTransaction('1', {
+ type: 'swapped',
+ destinationTokenDecimals: 8,
+ destinationTokenAddress: VALID_ADDRESS_TWO,
+ swapTokenValue: '0x011',
+ gasPrice: '0x12',
+ });
+
+ let result = txStateManager.getTransaction('1');
+
+ assert.equal(result.type, 'swapped');
+ assert.equal(result.destinationTokenDecimals, 8);
+ assert.equal(result.destinationTokenAddress, VALID_ADDRESS_TWO);
+ assert.equal(result.swapTokenValue, '0x011');
+ assert.equal(result.txParams.gasPrice, '0x002'); // not updated even though it's passed in to update
+
+ txController.updateTransactionGasFees('1', {
+ estimateUsed: '0x13',
+ gasPrice: '0x14',
+ destinationTokenAddress: VALID_ADDRESS,
+ });
+
+ result = txStateManager.getTransaction('1');
+ assert.equal(result.estimateUsed, '0x13');
+ assert.equal(result.txParams.gasPrice, '0x14');
+ assert.equal(result.destinationTokenAddress, VALID_ADDRESS_TWO); // not updated even though it's passed in to update
+ });
+ });
});
diff --git a/app/scripts/lib/seed-phrase-verifier.js b/app/scripts/lib/seed-phrase-verifier.js
index e1c18c1eb..225a57896 100644
--- a/app/scripts/lib/seed-phrase-verifier.js
+++ b/app/scripts/lib/seed-phrase-verifier.js
@@ -11,10 +11,10 @@ const seedPhraseVerifier = {
* - The keyring always creates the accounts in the same sequence.
*
* @param {Array} createdAccounts - The accounts to restore
- * @param {Buffer} seedPhrase - The seed words to verify, encoded as a Buffer
- * @returns {Promise}
+ * @param {string} seedWords - The seed words to verify
+ * @returns {Promise} Promises undefined
*/
- async verifyAccounts(createdAccounts, seedPhrase) {
+ async verifyAccounts(createdAccounts, seedWords) {
if (!createdAccounts || createdAccounts.length < 1) {
throw new Error('No created accounts defined.');
}
@@ -22,7 +22,7 @@ const seedPhraseVerifier = {
const keyringController = new KeyringController({});
const Keyring = keyringController.getKeyringClassForType('HD Key Tree');
const opts = {
- mnemonic: seedPhrase,
+ mnemonic: seedWords,
numberOfAccounts: createdAccounts.length,
};
diff --git a/app/scripts/lib/segment.js b/app/scripts/lib/segment.js
index 3b7db70ce..bb52c42d8 100644
--- a/app/scripts/lib/segment.js
+++ b/app/scripts/lib/segment.js
@@ -1,8 +1,8 @@
import Analytics from 'analytics-node';
import { SECOND } from '../../../shared/constants/time';
-const isDevOrTestEnvironment = Boolean(
- process.env.METAMASK_DEBUG || process.env.IN_TEST,
+const isDevEnvironment = Boolean(
+ process.env.METAMASK_DEBUG && !process.env.IN_TEST,
);
const SEGMENT_WRITE_KEY = process.env.SEGMENT_WRITE_KEY ?? null;
const SEGMENT_HOST = process.env.SEGMENT_HOST ?? null;
@@ -82,7 +82,7 @@ export const createSegmentMock = (flushAt = SEGMENT_FLUSH_AT) => {
};
export const segment =
- !SEGMENT_WRITE_KEY || (isDevOrTestEnvironment && !SEGMENT_HOST)
+ !SEGMENT_WRITE_KEY || (isDevEnvironment && !SEGMENT_HOST)
? createSegmentMock(SEGMENT_FLUSH_AT, SEGMENT_FLUSH_INTERVAL)
: new Analytics(SEGMENT_WRITE_KEY, {
host: SEGMENT_HOST,
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index ccfee5ae5..8bb569897 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -9,7 +9,11 @@ import createFilterMiddleware from 'eth-json-rpc-filters';
import createSubscriptionManager from 'eth-json-rpc-filters/subscriptionManager';
import { providerAsMiddleware } from 'eth-json-rpc-middleware';
import KeyringController from 'eth-keyring-controller';
-import { errorCodes as rpcErrorCodes, ethErrors } from 'eth-rpc-errors';
+import {
+ errorCodes as rpcErrorCodes,
+ EthereumRpcError,
+ ethErrors,
+} from 'eth-rpc-errors';
import { Mutex } from 'await-semaphore';
import { stripHexPrefix } from 'ethereumjs-util';
import log from 'loglevel';
@@ -79,7 +83,7 @@ import {
import { hexToDecimal } from '../../ui/helpers/utils/conversions.util';
import { getTokenValueParam } from '../../ui/helpers/utils/token-util';
import { getTransactionData } from '../../ui/helpers/utils/transactions.util';
-import { isEqualCaseInsensitive } from '../../ui/helpers/utils/util';
+import { isEqualCaseInsensitive } from '../../shared/modules/string-utils';
import ComposableObservableStore from './lib/ComposableObservableStore';
import AccountTracker from './lib/account-tracker';
import createLoggerMiddleware from './lib/createLoggerMiddleware';
@@ -711,6 +715,8 @@ export default class MetamaskController extends EventEmitter {
getExternalPendingTransactions: this.getExternalPendingTransactions.bind(
this,
),
+ getAccountType: this.getAccountType.bind(this),
+ getDeviceModel: this.getDeviceModel.bind(this),
});
this.txController.on('newUnapprovedTx', () => opts.showUserConfirmation());
@@ -1280,7 +1286,6 @@ export default class MetamaskController extends EventEmitter {
appStateController,
collectiblesController,
collectibleDetectionController,
- assetsContractController,
currencyRateController,
detectTokensController,
ensController,
@@ -1433,11 +1438,10 @@ export default class MetamaskController extends EventEmitter {
setEIP1559V2Enabled: preferencesController.setEIP1559V2Enabled.bind(
preferencesController,
),
+ setTheme: preferencesController.setTheme.bind(preferencesController),
// AssetsContractController
- getTokenStandardAndDetails: assetsContractController.getTokenStandardAndDetails.bind(
- assetsContractController,
- ),
+ getTokenStandardAndDetails: this.getTokenStandardAndDetails.bind(this),
// CollectiblesController
addCollectible: collectiblesController.addCollectible.bind(
@@ -1534,6 +1538,20 @@ export default class MetamaskController extends EventEmitter {
),
getTransactions: txController.getTransactions.bind(txController),
+ updateEditableParams: txController.updateEditableParams.bind(
+ txController,
+ ),
+ updateTransactionGasFees: txController.updateTransactionGasFees.bind(
+ txController,
+ ),
+
+ updateSwapApprovalTransaction: txController.updateSwapApprovalTransaction.bind(
+ txController,
+ ),
+ updateSwapTransaction: txController.updateSwapTransaction.bind(
+ txController,
+ ),
+
// messageManager
signMessage: this.signMessage.bind(this),
cancelMessage: this.cancelMessage.bind(this),
@@ -1718,7 +1736,12 @@ export default class MetamaskController extends EventEmitter {
resolvePendingApproval: approvalController.accept.bind(
approvalController,
),
- rejectPendingApproval: approvalController.reject.bind(approvalController),
+ rejectPendingApproval: async (id, error) => {
+ approvalController.reject(
+ id,
+ new EthereumRpcError(error.code, error.message, error.data),
+ );
+ },
// Notifications
updateViewedNotifications: notificationController.updateViewed.bind(
@@ -1760,6 +1783,19 @@ export default class MetamaskController extends EventEmitter {
};
}
+ async getTokenStandardAndDetails(address, userAddress, tokenId) {
+ const details = await this.assetsContractController.getTokenStandardAndDetails(
+ address,
+ userAddress,
+ tokenId,
+ );
+ return {
+ ...details,
+ decimals: details?.decimals?.toString(10),
+ balance: details?.balance?.toString(10),
+ };
+ }
+
//=============================================================================
// VAULT / KEYRING RELATED METHODS
//=============================================================================
@@ -1803,16 +1839,13 @@ export default class MetamaskController extends EventEmitter {
* Create a new Vault and restore an existent keyring.
*
* @param {string} password
- * @param {number[]} encodedSeedPhrase - The seed phrase, encoded as an array
- * of UTF-8 bytes.
+ * @param {string} seed
*/
- async createNewVaultAndRestore(password, encodedSeedPhrase) {
+ async createNewVaultAndRestore(password, seed) {
const releaseLock = await this.createVaultMutex.acquire();
try {
let accounts, lastBalance;
- const seedPhraseAsBuffer = Buffer.from(encodedSeedPhrase);
-
const { keyringController } = this;
// clear known identities
@@ -1833,7 +1866,7 @@ export default class MetamaskController extends EventEmitter {
// create new vault
const vault = await keyringController.createNewVaultAndRestore(
password,
- seedPhraseAsBuffer,
+ seed,
);
const ethQuery = new EthQuery(this.provider);
@@ -2200,6 +2233,54 @@ export default class MetamaskController extends EventEmitter {
return true;
}
+ /**
+ * Retrieves the keyring for the selected address and using the .type returns
+ * a subtype for the account. Either 'hardware', 'imported' or 'MetaMask'.
+ *
+ * @param {string} address - Address to retrieve keyring for
+ * @returns {'hardware' | 'imported' | 'MetaMask'}
+ */
+ async getAccountType(address) {
+ const keyring = await this.keyringController.getKeyringForAccount(address);
+ switch (keyring.type) {
+ case KEYRING_TYPES.TREZOR:
+ case KEYRING_TYPES.LATTICE:
+ case KEYRING_TYPES.QR:
+ case KEYRING_TYPES.LEDGER:
+ return 'hardware';
+ case KEYRING_TYPES.IMPORTED:
+ return 'imported';
+ default:
+ return 'MetaMask';
+ }
+ }
+
+ /**
+ * Retrieves the keyring for the selected address and using the .type
+ * determines if a more specific name for the device is available. Returns
+ * 'N/A' for non hardware wallets.
+ *
+ * @param {string} address - Address to retrieve keyring for
+ * @returns {'ledger' | 'lattice' | 'N/A' | string}
+ */
+ async getDeviceModel(address) {
+ const keyring = await this.keyringController.getKeyringForAccount(address);
+ switch (keyring.type) {
+ case KEYRING_TYPES.TREZOR:
+ return keyring.getModel();
+ case KEYRING_TYPES.QR:
+ return keyring.getName();
+ case KEYRING_TYPES.LEDGER:
+ // TODO: get model after ledger keyring exposes method
+ return DEVICE_NAMES.LEDGER;
+ case KEYRING_TYPES.LATTICE:
+ // TODO: get model after lattice keyring exposes method
+ return DEVICE_NAMES.LATTICE;
+ default:
+ return 'N/A';
+ }
+ }
+
/**
* get hardware account label
*
@@ -2293,8 +2374,7 @@ export default class MetamaskController extends EventEmitter {
*
* Called when the first account is created and on unlocking the vault.
*
- * @returns {Promise} The seed phrase to be confirmed by the user,
- * encoded as an array of UTF-8 bytes.
+ * @returns {Promise} Seed phrase to be confirmed by the user.
*/
async verifySeedPhrase() {
const primaryKeyring = this.keyringController.getKeyringsByType(
@@ -2305,7 +2385,7 @@ export default class MetamaskController extends EventEmitter {
}
const serialized = await primaryKeyring.serialize();
- const seedPhraseAsBuffer = Buffer.from(serialized.mnemonic);
+ const seedWords = serialized.mnemonic;
const accounts = await primaryKeyring.getAccounts();
if (accounts.length < 1) {
@@ -2313,8 +2393,8 @@ export default class MetamaskController extends EventEmitter {
}
try {
- await seedPhraseVerifier.verifyAccounts(accounts, seedPhraseAsBuffer);
- return Array.from(seedPhraseAsBuffer.values());
+ await seedPhraseVerifier.verifyAccounts(accounts, seedWords);
+ return seedWords;
} catch (err) {
log.error(err.message);
throw err;
diff --git a/development/build/scripts.js b/development/build/scripts.js
index 035c38969..063fc5a7e 100644
--- a/development/build/scripts.js
+++ b/development/build/scripts.js
@@ -34,6 +34,7 @@ const metamaskrc = require('rc')('metamask', {
INFURA_PROD_PROJECT_ID: process.env.INFURA_PROD_PROJECT_ID,
ONBOARDING_V2: process.env.ONBOARDING_V2,
COLLECTIBLES_V1: process.env.COLLECTIBLES_V1,
+ DARK_MODE_V1: process.env.DARK_MODE_V1,
SEGMENT_HOST: process.env.SEGMENT_HOST,
SEGMENT_WRITE_KEY: process.env.SEGMENT_WRITE_KEY,
SEGMENT_BETA_WRITE_KEY: process.env.SEGMENT_BETA_WRITE_KEY,
@@ -810,6 +811,7 @@ function getEnvironmentVariables({ buildType, devMode, testing, version }) {
SWAPS_USE_DEV_APIS: process.env.SWAPS_USE_DEV_APIS === '1',
ONBOARDING_V2: metamaskrc.ONBOARDING_V2 === '1',
COLLECTIBLES_V1: metamaskrc.COLLECTIBLES_V1 === '1',
+ DARK_MODE_V1: metamaskrc.DARK_MODE_V1 === '1',
};
}
diff --git a/development/build/transforms/utils.js b/development/build/transforms/utils.js
index d7ab9654f..fb7f49c32 100644
--- a/development/build/transforms/utils.js
+++ b/development/build/transforms/utils.js
@@ -1,11 +1,17 @@
const { ESLint } = require('eslint');
const eslintrc = require('../../../.eslintrc.js');
-// We don't want linting to fail for purely stylistic reasons.
-eslintrc.rules['prettier/prettier'] = 'off';
-// Sometimes we use `let` instead of `const` to assign variables depending on
-// the build type.
-eslintrc.rules['prefer-const'] = 'off';
+eslintrc.overrides.forEach((override) => {
+ const rules = override.rules ?? {};
+
+ // We don't want linting to fail for purely stylistic reasons.
+ rules['prettier/prettier'] = 'off';
+ // Sometimes we use `let` instead of `const` to assign variables depending on
+ // the build type.
+ rules['prefer-const'] = 'off';
+
+ override.rules = rules;
+});
// Remove all test-related overrides. We will never lint test files here.
eslintrc.overrides = eslintrc.overrides.filter((override) => {
diff --git a/development/mock-e2e.js b/development/mock-e2e.js
deleted file mode 100644
index 1e466d36e..000000000
--- a/development/mock-e2e.js
+++ /dev/null
@@ -1,32 +0,0 @@
-function setupMocking(server) {
- server.forAnyRequest().thenPassThrough();
-
- server
- .forOptions('https://gas-api.metaswap.codefi.network/networks/1/gasPrices')
- .thenCallback(() => {
- return {
- headers: {
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Methods': 'GET,HEAD,PUT,PATCH,POST,DELETE',
- 'Access-Control-Allow-Headers': 'content-type,x-client-id',
- },
- statusCode: 200,
- };
- });
-
- server
- .forGet('https://gas-api.metaswap.codefi.network/networks/1/gasPrices')
- .thenCallback(() => {
- return {
- headers: { 'Access-Control-Allow-Origin': '*' },
- statusCode: 200,
- json: {
- SafeGasPrice: '1',
- ProposeGasPrice: '2',
- FastGasPrice: '3',
- },
- };
- });
-}
-
-module.exports = { setupMocking };
diff --git a/docs/add-to-chrome.md b/docs/add-to-chrome.md
index 82c1afed3..9e4d8c4a4 100644
--- a/docs/add-to-chrome.md
+++ b/docs/add-to-chrome.md
@@ -2,13 +2,16 @@

+* Create a local build of MetaMask using your preferred method.
+ * You can find build instructions in the [readme](https://github.com/MetaMask/metamask-extension#readme).
* Open `Settings` > `Extensions`.
+ * Or go straight to [chrome://extensions](chrome://extensions).
* Check "Developer mode".
-* Alternatively, use the URL `chrome://extensions/` in your address bar
* At the top, click `Load Unpacked Extension`.
-* Navigate to your `metamask-plugin/dist/chrome` folder.
+* Navigate to your `metamask-extension/dist/chrome` folder.
* Click `Select`.
* Change to your locale via `chrome://settings/languages`
-* Restart the browser and test the plugin in your locale
+* Restart the browser and test the extension in your locale
-You now have the plugin, and can click 'inspect views: background plugin' to view its dev console.
+Your dev build is now added to Chrome, and you can click `Inspect views
+background.html` in its card on the extension settings page to view its dev console.
diff --git a/docs/add-to-firefox.md b/docs/add-to-firefox.md
index 20810f9a6..424af6317 100644
--- a/docs/add-to-firefox.md
+++ b/docs/add-to-firefox.md
@@ -1,14 +1,11 @@
# Add Custom Build to Firefox
-Go to the url `about:debugging#addons`.
-
-Click the button `Load Temporary Add-On`.
-
-Select the file `dist/firefox/manifest.json`.
-
-You can optionally enable debugging, and click `Debug`, for a console window that logs all of Metamask's processes to a single console.
+* Create a local build of MetaMask using your preferred method.
+ * You can find build instructions in the [readme](https://github.com/MetaMask/metamask-extension#readme).
+* Go to the url `about:debugging#addons`.
+* Click the button `Load Temporary Add-On`.
+* Select the file `metamask-extension/dist/firefox/manifest.json`.
+* You can optionally enable debugging, and click `Debug`, for a console window that logs all of Metamask's processes to a single console.
If you have problems debugging, try connecting to the IRC channel `#webextensions` on `irc.mozilla.org`.
-
For longer questions, use the StackOverflow tag `firefox-addons`.
-
diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json
index ba9056f3e..2b616f2e8 100644
--- a/lavamoat/browserify/beta/policy.json
+++ b/lavamoat/browserify/beta/policy.json
@@ -1178,9 +1178,6 @@
}
},
"bip39": {
- "globals": {
- "console.log": true
- },
"packages": {
"buffer": true,
"create-hash": true,
@@ -1895,7 +1892,6 @@
"eth-hd-keyring": {
"packages": {
"bip39": true,
- "buffer": true,
"eth-sig-util": true,
"eth-simple-keyring": true,
"ethereumjs-wallet": true
@@ -1954,7 +1950,6 @@
"packages": {
"bip39": true,
"browser-passworder": true,
- "buffer": true,
"eth-hd-keyring": true,
"eth-sig-util": true,
"eth-simple-keyring": true,
@@ -1970,17 +1965,19 @@
"browser": true,
"clearInterval": true,
"open": true,
+ "rlp.encode": true,
"setInterval": true
},
"packages": {
"@ethereumjs/common": true,
"@ethereumjs/tx": true,
- "bignumber.js": true,
+ "bn.js": true,
"buffer": true,
"crypto-browserify": true,
"ethereumjs-util": true,
"events": true,
- "gridplus-sdk": true
+ "gridplus-sdk": true,
+ "secp256k1": true
}
},
"eth-method-registry": {
@@ -2349,6 +2346,8 @@
"setTimeout": true
},
"packages": {
+ "@ethereumjs/common": true,
+ "@ethereumjs/tx": true,
"aes-js": true,
"bech32": true,
"bignumber.js": true,
@@ -2361,6 +2360,7 @@
"eth-eip712-util-browser": true,
"hash.js": true,
"js-sha3": true,
+ "rlp": true,
"rlp-browser": true,
"secp256k1": true,
"superagent": true
@@ -4628,6 +4628,9 @@
}
},
"rlp": {
+ "globals": {
+ "TextEncoder": true
+ },
"packages": {
"bn.js": true,
"buffer": true
diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json
index 3757925a1..92099f02c 100644
--- a/lavamoat/browserify/flask/policy.json
+++ b/lavamoat/browserify/flask/policy.json
@@ -1196,9 +1196,6 @@
}
},
"bip39": {
- "globals": {
- "console.log": true
- },
"packages": {
"buffer": true,
"create-hash": true,
@@ -1913,7 +1910,6 @@
"eth-hd-keyring": {
"packages": {
"bip39": true,
- "buffer": true,
"eth-sig-util": true,
"eth-simple-keyring": true,
"ethereumjs-wallet": true
@@ -1972,7 +1968,6 @@
"packages": {
"bip39": true,
"browser-passworder": true,
- "buffer": true,
"eth-hd-keyring": true,
"eth-sig-util": true,
"eth-simple-keyring": true,
@@ -1988,17 +1983,19 @@
"browser": true,
"clearInterval": true,
"open": true,
+ "rlp.encode": true,
"setInterval": true
},
"packages": {
"@ethereumjs/common": true,
"@ethereumjs/tx": true,
- "bignumber.js": true,
+ "bn.js": true,
"buffer": true,
"crypto-browserify": true,
"ethereumjs-util": true,
"events": true,
- "gridplus-sdk": true
+ "gridplus-sdk": true,
+ "secp256k1": true
}
},
"eth-method-registry": {
@@ -2367,6 +2364,8 @@
"setTimeout": true
},
"packages": {
+ "@ethereumjs/common": true,
+ "@ethereumjs/tx": true,
"aes-js": true,
"bech32": true,
"bignumber.js": true,
@@ -2379,6 +2378,7 @@
"eth-eip712-util-browser": true,
"hash.js": true,
"js-sha3": true,
+ "rlp": true,
"rlp-browser": true,
"secp256k1": true,
"superagent": true
@@ -4646,6 +4646,9 @@
}
},
"rlp": {
+ "globals": {
+ "TextEncoder": true
+ },
"packages": {
"bn.js": true,
"buffer": true
diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json
index ba9056f3e..2b616f2e8 100644
--- a/lavamoat/browserify/main/policy.json
+++ b/lavamoat/browserify/main/policy.json
@@ -1178,9 +1178,6 @@
}
},
"bip39": {
- "globals": {
- "console.log": true
- },
"packages": {
"buffer": true,
"create-hash": true,
@@ -1895,7 +1892,6 @@
"eth-hd-keyring": {
"packages": {
"bip39": true,
- "buffer": true,
"eth-sig-util": true,
"eth-simple-keyring": true,
"ethereumjs-wallet": true
@@ -1954,7 +1950,6 @@
"packages": {
"bip39": true,
"browser-passworder": true,
- "buffer": true,
"eth-hd-keyring": true,
"eth-sig-util": true,
"eth-simple-keyring": true,
@@ -1970,17 +1965,19 @@
"browser": true,
"clearInterval": true,
"open": true,
+ "rlp.encode": true,
"setInterval": true
},
"packages": {
"@ethereumjs/common": true,
"@ethereumjs/tx": true,
- "bignumber.js": true,
+ "bn.js": true,
"buffer": true,
"crypto-browserify": true,
"ethereumjs-util": true,
"events": true,
- "gridplus-sdk": true
+ "gridplus-sdk": true,
+ "secp256k1": true
}
},
"eth-method-registry": {
@@ -2349,6 +2346,8 @@
"setTimeout": true
},
"packages": {
+ "@ethereumjs/common": true,
+ "@ethereumjs/tx": true,
"aes-js": true,
"bech32": true,
"bignumber.js": true,
@@ -2361,6 +2360,7 @@
"eth-eip712-util-browser": true,
"hash.js": true,
"js-sha3": true,
+ "rlp": true,
"rlp-browser": true,
"secp256k1": true,
"superagent": true
@@ -4628,6 +4628,9 @@
}
},
"rlp": {
+ "globals": {
+ "TextEncoder": true
+ },
"packages": {
"bn.js": true,
"buffer": true
diff --git a/lavamoat/build-system/policy-override.json b/lavamoat/build-system/policy-override.json
index 34a2f3527..282e26ff0 100644
--- a/lavamoat/build-system/policy-override.json
+++ b/lavamoat/build-system/policy-override.json
@@ -14,6 +14,7 @@
},
"@eslint/eslintrc": {
"packages": {
+ "": true,
"@babel/eslint-parser": true,
"@babel/eslint-plugin": true,
"@metamask/eslint-config": true,
diff --git a/package.json b/package.json
index e91927dcf..a10948d82 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "metamask-crx",
- "version": "10.11.4",
+ "version": "10.12.0",
"private": true,
"repository": {
"type": "git",
@@ -14,12 +14,11 @@
"dist": "yarn build prod",
"build": "yarn lavamoat:build",
"build:dev": "node development/build/index.js",
- "start:test": "yarn build testDev",
+ "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",
- "build:test": "yarn build test",
+ "build:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' yarn build test",
"build:test:flask": "yarn build test --build-type flask",
- "build:test:metrics": "SEGMENT_HOST='http://localhost:9090' SEGMENT_WRITE_KEY='FAKE' yarn build test",
"test": "yarn lint && yarn test:unit && yarn test:unit:jest",
"dapp": "node development/static-server.js node_modules/@metamask/test-dapp/dist --port 8080",
"dapp-chain": "GANACHE_ARGS='-b 2' concurrently -k -n ganache,dapp -p '[{time}][{name}]' 'yarn ganache:start' 'sleep 5 && yarn dapp'",
@@ -112,6 +111,7 @@
"@keystonehq/metamask-airgapped-keyring": "0.2.1",
"@material-ui/core": "^4.11.0",
"@metamask/contract-metadata": "^1.31.0",
+ "@metamask/design-tokens": "^1.3.0",
"@metamask/controllers": "^27.0.0",
"@metamask/eth-ledger-bridge-keyring": "^0.10.0",
"@metamask/eth-token-tracker": "^4.0.0",
@@ -153,7 +153,7 @@
"eth-json-rpc-infura": "^5.1.0",
"eth-json-rpc-middleware": "^8.0.0",
"eth-keyring-controller": "^6.2.0",
- "eth-lattice-keyring": "^0.5.0",
+ "eth-lattice-keyring": "^0.6.1",
"eth-method-registry": "^2.0.0",
"eth-query": "^2.1.2",
"eth-rpc-errors": "^4.0.2",
@@ -223,7 +223,8 @@
"uuid": "^8.3.2",
"valid-url": "^1.0.9",
"web3": "^0.20.7",
- "web3-stream-provider": "^4.0.0"
+ "web3-stream-provider": "^4.0.0",
+ "zxcvbn": "^4.4.2"
},
"devDependencies": {
"@babel/code-frame": "^7.12.13",
@@ -351,6 +352,7 @@
"source-map": "^0.7.2",
"source-map-explorer": "^2.4.2",
"squirrelly": "^8.0.8",
+ "storybook-dark-mode": "^1.0.9",
"string.prototype.matchall": "^4.0.2",
"style-loader": "^0.21.0",
"stylelint": "^13.6.1",
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