mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge remote-tracking branch 'origin/develop' into master-sync
This commit is contained in:
commit
d52b46e889
@ -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'
|
||||
|
9
.eslintrc.babel.js
Normal file
9
.eslintrc.babel.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
parser: '@babel/eslint-parser',
|
||||
plugins: ['@babel'],
|
||||
rules: {
|
||||
'@babel/no-invalid-this': 'error',
|
||||
// Prettier handles this
|
||||
'@babel/semi': 'off',
|
||||
},
|
||||
};
|
67
.eslintrc.base.js
Normal file
67
.eslintrc.base.js
Normal file
@ -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',
|
||||
},
|
||||
};
|
380
.eslintrc.js
380
.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,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
23
.eslintrc.jsdoc.js
Normal file
23
.eslintrc.jsdoc.js
Normal file
@ -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',
|
||||
},
|
||||
},
|
||||
};
|
10
.eslintrc.node.js
Normal file
10
.eslintrc.node.js
Normal file
@ -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',
|
||||
},
|
||||
};
|
1
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
1
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@ -89,6 +89,7 @@ body:
|
||||
- Trezor
|
||||
- Keystone
|
||||
- GridPlus Lattice1
|
||||
- AirGap Vault
|
||||
- Other (please elaborate in the "Additional Context" section)
|
||||
- type: textarea
|
||||
id: additional
|
||||
|
@ -10,3 +10,4 @@ app/vendor/**
|
||||
.vscode/**
|
||||
test/e2e/send-eth-with-private-key-test/**
|
||||
*.scss
|
||||
development/chromereload.js
|
||||
|
201
.storybook/3.COLORS.stories.mdx
Normal file
201
.storybook/3.COLORS.stories.mdx
Normal file
@ -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';
|
||||
|
||||
<Meta title="Design Tokens / Color" />
|
||||
|
||||
# Color
|
||||
|
||||
Color is used to express style and communicate meaning.
|
||||
|
||||
<ActionaleMessage
|
||||
type="warning"
|
||||
message="We are in the process of consolidating all of our colors, making them accessible and enabling theming. Many of the colors used throughout the codebase are deprecated please follow the guide below to ensure you are using the correct colors when building MetaMask UI"
|
||||
/>
|
||||
|
||||
<br />
|
||||
|
||||
## 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.
|
||||
|
||||
<div
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
backgroundColor: 'var(--color-background-alternative)',
|
||||
padding: 32,
|
||||
}}
|
||||
>
|
||||
<img width="80%" src={designTokenDiagramImage} />
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
### **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);
|
||||
}
|
||||
```
|
||||
|
||||
<br />
|
||||
|
||||
## 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)
|
1
.storybook/images/design.token.graphic.svg
Normal file
1
.storybook/images/design.token.graphic.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 19 KiB |
@ -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 }),
|
||||
|
@ -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 (
|
||||
<Provider store={store}>
|
||||
<Router history={history}>
|
||||
|
3
app/_locales/am/messages.json
generated
3
app/_locales/am/messages.json
generated
@ -750,9 +750,6 @@
|
||||
"restore": {
|
||||
"message": "እነበረበት መልስ"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "መለያዎን በዘር ሐረግ ወደነበረበት ይመልሱ"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "የዘር ቃላትን ይግለጹ"
|
||||
},
|
||||
|
3
app/_locales/ar/messages.json
generated
3
app/_locales/ar/messages.json
generated
@ -766,9 +766,6 @@
|
||||
"restore": {
|
||||
"message": "استعادة"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "قم باستعادة حسابك بواسطة عبارة الأمان"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "كشف كلمات عبارات الأمان"
|
||||
},
|
||||
|
3
app/_locales/bg/messages.json
generated
3
app/_locales/bg/messages.json
generated
@ -761,9 +761,6 @@
|
||||
"restore": {
|
||||
"message": "Възстановяване"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Възстановете акаунта си с фраза зародиш"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Разкрий думите зародиш"
|
||||
},
|
||||
|
3
app/_locales/bn/messages.json
generated
3
app/_locales/bn/messages.json
generated
@ -765,9 +765,6 @@
|
||||
"restore": {
|
||||
"message": "পুনরুদ্ধার করুন"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "সীড ফ্রেজ দিয়ে আপনার অ্যাকাউন্ট রিস্টোর করুন"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "সীড শব্দগুলি প্রকাশ করুন"
|
||||
},
|
||||
|
3
app/_locales/ca/messages.json
generated
3
app/_locales/ca/messages.json
generated
@ -743,9 +743,6 @@
|
||||
"restore": {
|
||||
"message": "Restaura"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Restaura el teu compte amb Frase de Recuperació"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Revelar Paraules de Recuperació"
|
||||
},
|
||||
|
3
app/_locales/da/messages.json
generated
3
app/_locales/da/messages.json
generated
@ -746,9 +746,6 @@
|
||||
"restore": {
|
||||
"message": "Gendan"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Gendan din konto med Seed-sætning"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Vis Seedord"
|
||||
},
|
||||
|
16
app/_locales/de/messages.json
generated
16
app/_locales/de/messages.json
generated
@ -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"
|
||||
@ -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"
|
||||
},
|
||||
|
16
app/_locales/el/messages.json
generated
16
app/_locales/el/messages.json
generated
@ -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": "Μυστική Φράση Ανάκτησης"
|
||||
},
|
||||
|
120
app/_locales/en/messages.json
generated
120
app/_locales/en/messages.json
generated
@ -42,7 +42,7 @@
|
||||
"message": "QR-based HW Wallet"
|
||||
},
|
||||
"QRHardwareWalletSteps2Description": {
|
||||
"message": "AirGap Vault & Ngrave (Coming Soon)"
|
||||
"message": "Ngrave (Coming Soon)"
|
||||
},
|
||||
"about": {
|
||||
"message": "About"
|
||||
@ -98,6 +98,9 @@
|
||||
"addANetwork": {
|
||||
"message": "Add a network"
|
||||
},
|
||||
"addANetworkManually": {
|
||||
"message": "Add a network manually"
|
||||
},
|
||||
"addANickname": {
|
||||
"message": "Add a nickname"
|
||||
},
|
||||
@ -137,6 +140,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 +197,12 @@
|
||||
"aggregatorFeeCost": {
|
||||
"message": "Aggregator network fee"
|
||||
},
|
||||
"airgapVault": {
|
||||
"message": "AirGap Vault"
|
||||
},
|
||||
"airgapVaultTutorial": {
|
||||
"message": " (Tutorials)"
|
||||
},
|
||||
"alertDisableTooltip": {
|
||||
"message": "This can be changed in \"Settings > Alerts\""
|
||||
},
|
||||
@ -400,6 +412,13 @@
|
||||
"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"
|
||||
},
|
||||
"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 +486,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"
|
||||
@ -691,6 +713,9 @@
|
||||
"customGasSubTitle": {
|
||||
"message": "Increasing fee may decrease processing times, but it is not guaranteed."
|
||||
},
|
||||
"customNetworks": {
|
||||
"message": "Custom networks"
|
||||
},
|
||||
"customSpendLimit": {
|
||||
"message": "Custom Spend Limit"
|
||||
},
|
||||
@ -989,7 +1014,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 +1231,9 @@
|
||||
"forgetDevice": {
|
||||
"message": "Forget this device"
|
||||
},
|
||||
"forgotPassword": {
|
||||
"message": "Forgot password?"
|
||||
},
|
||||
"from": {
|
||||
"message": "From"
|
||||
},
|
||||
@ -1334,6 +1362,9 @@
|
||||
"goerli": {
|
||||
"message": "Goerli Test Network"
|
||||
},
|
||||
"gotIt": {
|
||||
"message": "Got it!"
|
||||
},
|
||||
"grantedToWithColon": {
|
||||
"message": "Granted to:"
|
||||
},
|
||||
@ -1408,19 +1439,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 +1502,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."
|
||||
},
|
||||
@ -1677,6 +1705,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 +1847,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 +1964,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!"
|
||||
},
|
||||
@ -2199,6 +2234,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 +2253,9 @@
|
||||
"or": {
|
||||
"message": "or"
|
||||
},
|
||||
"orDeposit": {
|
||||
"message": "or deposit from another account."
|
||||
},
|
||||
"origin": {
|
||||
"message": "Origin"
|
||||
},
|
||||
@ -2356,6 +2397,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."
|
||||
},
|
||||
@ -2455,12 +2502,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"
|
||||
@ -2516,6 +2572,9 @@
|
||||
"searchResults": {
|
||||
"message": "Search Results"
|
||||
},
|
||||
"searchSettings": {
|
||||
"message": "Search in settings"
|
||||
},
|
||||
"searchTokens": {
|
||||
"message": "Search Tokens"
|
||||
},
|
||||
@ -2528,9 +2587,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"
|
||||
},
|
||||
@ -2553,22 +2609,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!"
|
||||
@ -2668,6 +2724,9 @@
|
||||
"settings": {
|
||||
"message": "Settings"
|
||||
},
|
||||
"settingsSearchMatchingNotFound": {
|
||||
"message": "No matching results found"
|
||||
},
|
||||
"show": {
|
||||
"message": "Show"
|
||||
},
|
||||
@ -2890,19 +2949,19 @@
|
||||
"message": "Store this phrase in a password manager like 1Password."
|
||||
},
|
||||
"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"
|
||||
@ -2914,7 +2973,7 @@
|
||||
"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:"
|
||||
},
|
||||
"stxFailure": {
|
||||
"message": "Swap failed"
|
||||
@ -2936,7 +2995,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!"
|
||||
@ -3606,6 +3665,9 @@
|
||||
"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."
|
||||
},
|
||||
"updatedWithDate": {
|
||||
"message": "Updated $1"
|
||||
},
|
||||
|
10
app/_locales/es/messages.json
generated
10
app/_locales/es/messages.json
generated
@ -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"
|
||||
|
18
app/_locales/es_419/messages.json
generated
18
app/_locales/es_419/messages.json
generated
@ -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"
|
||||
|
3
app/_locales/et/messages.json
generated
3
app/_locales/et/messages.json
generated
@ -755,9 +755,6 @@
|
||||
"restore": {
|
||||
"message": "Taasta"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Taastage konto seemnefraasi abil"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Kuva seemnesõnu"
|
||||
},
|
||||
|
3
app/_locales/fa/messages.json
generated
3
app/_locales/fa/messages.json
generated
@ -765,9 +765,6 @@
|
||||
"restore": {
|
||||
"message": "بازیابی"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "حساب تان را با عبارت بازیاب، بازیابی کنید"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "کلمات بازیاب را آشکار کنید"
|
||||
},
|
||||
|
3
app/_locales/fi/messages.json
generated
3
app/_locales/fi/messages.json
generated
@ -762,9 +762,6 @@
|
||||
"restore": {
|
||||
"message": "Palauta"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Palauta tilisi käyttäen salaustekstiä (seed phrase)"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Paljasta salaussanat"
|
||||
},
|
||||
|
3
app/_locales/fil/messages.json
generated
3
app/_locales/fil/messages.json
generated
@ -689,9 +689,6 @@
|
||||
"restore": {
|
||||
"message": "Ipanumbalik"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "I-restore ang iyong Account gamit ang Seed Phrase"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Ipakita ang Seed Words"
|
||||
},
|
||||
|
16
app/_locales/fr/messages.json
generated
16
app/_locales/fr/messages.json
generated
@ -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"
|
||||
},
|
||||
|
3
app/_locales/he/messages.json
generated
3
app/_locales/he/messages.json
generated
@ -762,9 +762,6 @@
|
||||
"restore": {
|
||||
"message": "שחזר"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "שחזר את חשבונך באמצעות צירוף הגרעין"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "גלה מילות Seed"
|
||||
},
|
||||
|
16
app/_locales/hi/messages.json
generated
16
app/_locales/hi/messages.json
generated
@ -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": "सीक्रेट रिकवरी फ्रेज"
|
||||
},
|
||||
|
3
app/_locales/hr/messages.json
generated
3
app/_locales/hr/messages.json
generated
@ -758,9 +758,6 @@
|
||||
"restore": {
|
||||
"message": "Vrati"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Obnovite svoj račun početnom rečenicom"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Otkrij početne riječi"
|
||||
},
|
||||
|
3
app/_locales/ht/messages.json
generated
3
app/_locales/ht/messages.json
generated
@ -479,9 +479,6 @@
|
||||
"restore": {
|
||||
"message": "Retabli"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Retabli kont ou avèk yo Seed Fraz"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Revele Seed Mo Yo"
|
||||
},
|
||||
|
3
app/_locales/hu/messages.json
generated
3
app/_locales/hu/messages.json
generated
@ -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"
|
||||
},
|
||||
|
16
app/_locales/id/messages.json
generated
16
app/_locales/id/messages.json
generated
@ -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"
|
||||
},
|
||||
|
3
app/_locales/it/messages.json
generated
3
app/_locales/it/messages.json
generated
@ -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"
|
||||
|
16
app/_locales/ja/messages.json
generated
16
app/_locales/ja/messages.json
generated
@ -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": "シークレットリカバリーフレーズ"
|
||||
},
|
||||
|
3
app/_locales/kn/messages.json
generated
3
app/_locales/kn/messages.json
generated
@ -765,9 +765,6 @@
|
||||
"restore": {
|
||||
"message": "ಮರುಸ್ಥಾಪನೆ"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "ಸೀಡ್ ಫ್ರೇಸ್ನೊಂದಿಗೆ ನಿಮ್ಮ ಖಾತೆಯನ್ನು ಮರುಸ್ಥಾಪಿಸಿ"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "ಸೀಡ್ ವರ್ಡ್ಸ್ ಬಹಿರಂಗಪಡಿಸಿ"
|
||||
},
|
||||
|
16
app/_locales/ko/messages.json
generated
16
app/_locales/ko/messages.json
generated
@ -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": "비밀 복구 구문"
|
||||
},
|
||||
|
3
app/_locales/lt/messages.json
generated
3
app/_locales/lt/messages.json
generated
@ -765,9 +765,6 @@
|
||||
"restore": {
|
||||
"message": "Atkurti"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Atkurti paskyrą naudojant atkūrimo frazę"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Atskleisti atkūrimo žodžius"
|
||||
},
|
||||
|
3
app/_locales/lv/messages.json
generated
3
app/_locales/lv/messages.json
generated
@ -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"
|
||||
},
|
||||
|
3
app/_locales/ms/messages.json
generated
3
app/_locales/ms/messages.json
generated
@ -745,9 +745,6 @@
|
||||
"restore": {
|
||||
"message": "Pulihkan"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Pulihkan Akaun anda dengan Ungkapan Benih"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Dedahkan Ungkapan Benih"
|
||||
},
|
||||
|
3
app/_locales/no/messages.json
generated
3
app/_locales/no/messages.json
generated
@ -752,9 +752,6 @@
|
||||
"restore": {
|
||||
"message": "Gjenopprett"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Gjenopprett konto med frøfrase"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Vis frøord"
|
||||
},
|
||||
|
10
app/_locales/ph/messages.json
generated
10
app/_locales/ph/messages.json
generated
@ -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"
|
||||
|
3
app/_locales/pl/messages.json
generated
3
app/_locales/pl/messages.json
generated
@ -759,9 +759,6 @@
|
||||
"restore": {
|
||||
"message": "Przywróć"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Przywróć konto frazą seed"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Pokaż słowa seed"
|
||||
},
|
||||
|
16
app/_locales/pt_BR/messages.json
generated
16
app/_locales/pt_BR/messages.json
generated
@ -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"
|
||||
},
|
||||
|
3
app/_locales/ro/messages.json
generated
3
app/_locales/ro/messages.json
generated
@ -752,9 +752,6 @@
|
||||
"restore": {
|
||||
"message": "Restabilește"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Restaurați-vă contul folosind fraza inițială"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Arată cuvintele din seed"
|
||||
},
|
||||
|
16
app/_locales/ru/messages.json
generated
16
app/_locales/ru/messages.json
generated
@ -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": "Секретная фраза для восстановления"
|
||||
},
|
||||
|
3
app/_locales/sk/messages.json
generated
3
app/_locales/sk/messages.json
generated
@ -734,9 +734,6 @@
|
||||
"restore": {
|
||||
"message": "Obnoviť"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Obnoviť účet pomocou seed frázy"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Zobrazit slova klíčové fráze"
|
||||
},
|
||||
|
3
app/_locales/sl/messages.json
generated
3
app/_locales/sl/messages.json
generated
@ -753,9 +753,6 @@
|
||||
"restore": {
|
||||
"message": "Obnovi"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Obnovi račun z seed phrase"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Razkrij seed words"
|
||||
},
|
||||
|
3
app/_locales/sr/messages.json
generated
3
app/_locales/sr/messages.json
generated
@ -756,9 +756,6 @@
|
||||
"restore": {
|
||||
"message": "Поново отвори"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Povratite svoj nalog uz pomoć seed fraze"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Otkrivanje početnih reči"
|
||||
},
|
||||
|
3
app/_locales/sv/messages.json
generated
3
app/_locales/sv/messages.json
generated
@ -749,9 +749,6 @@
|
||||
"restore": {
|
||||
"message": "Återställ"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Återställ ditt konto med seedphrase"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Visa seed-ord"
|
||||
},
|
||||
|
3
app/_locales/sw/messages.json
generated
3
app/_locales/sw/messages.json
generated
@ -743,9 +743,6 @@
|
||||
"restore": {
|
||||
"message": "Rejesha"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Rejesha Akaunti yako kwa kutumia Kirai Kianzio."
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Onyesha Maneno ya Kianzio"
|
||||
},
|
||||
|
16
app/_locales/tl/messages.json
generated
16
app/_locales/tl/messages.json
generated
@ -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"
|
||||
},
|
||||
|
16
app/_locales/tr/messages.json
generated
16
app/_locales/tr/messages.json
generated
@ -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"
|
||||
},
|
||||
|
3
app/_locales/uk/messages.json
generated
3
app/_locales/uk/messages.json
generated
@ -765,9 +765,6 @@
|
||||
"restore": {
|
||||
"message": "Відновити"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "Відновіть ваш обліковий запис за допомогою seed-фрази"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "Показати мнемонічні слова"
|
||||
},
|
||||
|
16
app/_locales/vi/messages.json
generated
16
app/_locales/vi/messages.json
generated
@ -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"
|
||||
},
|
||||
|
16
app/_locales/zh_CN/messages.json
generated
16
app/_locales/zh_CN/messages.json
generated
@ -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": "账户助记词"
|
||||
},
|
||||
|
3
app/_locales/zh_TW/messages.json
generated
3
app/_locales/zh_TW/messages.json
generated
@ -747,9 +747,6 @@
|
||||
"resetAccountDescription": {
|
||||
"message": "重置帳戶將清除您的交易紀錄"
|
||||
},
|
||||
"restoreAccountWithSeed": {
|
||||
"message": "透過助憶詞還原您的帳戶"
|
||||
},
|
||||
"revealSeedWords": {
|
||||
"message": "顯示助憶詞"
|
||||
},
|
||||
|
9
app/images/arbitrum.svg
Normal file
9
app/images/arbitrum.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
Before Width: | Height: | Size: 119 KiB |
BIN
app/images/logo/smart-transactions-header.png
Normal file
BIN
app/images/logo/smart-transactions-header.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
5
app/images/optimism.svg
Normal file
5
app/images/optimism.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="250" cy="250" r="250" fill="#FF0420"/>
|
||||
<path d="M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z" fill="white"/>
|
||||
<path d="M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
3
app/images/times.svg
Normal file
3
app/images/times.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.42237 13.347C9.42237 13.5827 9.33819 13.7847 9.16983 13.9531C9.00147 14.1214 8.79944 14.2056 8.56374 14.2056L6.84648 14.2056C6.61078 14.2056 6.40875 14.1214 6.24039 13.9531C6.07203 13.7847 5.98785 13.5827 5.98785 13.347L5.98785 9.63466L2.27554 9.63466C2.03984 9.63466 1.83781 9.55048 1.66945 9.38212C1.50109 9.21377 1.41691 9.01174 1.41691 8.77603L1.41691 7.05877C1.41691 6.82307 1.50109 6.62104 1.66945 6.45268C1.83781 6.28432 2.03984 6.20014 2.27554 6.20014L5.98785 6.20014V2.48783C5.98785 2.25213 6.07203 2.0501 6.24039 1.88174C6.40875 1.71338 6.61078 1.6292 6.84648 1.6292H8.56374C8.79944 1.6292 9.00147 1.71338 9.16983 1.88174C9.33819 2.0501 9.42237 2.25213 9.42237 2.48783L9.42237 6.20014H13.1347C13.3704 6.20014 13.5724 6.28432 13.7408 6.45268C13.9091 6.62104 13.9933 6.82307 13.9933 7.05877V8.77603C13.9933 9.01173 13.9091 9.21377 13.7408 9.38212C13.5724 9.55048 13.3704 9.63466 13.1347 9.63466H9.42237L9.42237 13.347Z" fill="#6A737D"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
@ -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;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ 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,
|
||||
@ -130,6 +131,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 +350,268 @@ 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);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} txId - transaction id
|
||||
* @param {object} editableParams - holds the eip1559 fees parameters
|
||||
* @param editableParams.data
|
||||
* @param editableParams.from
|
||||
* @param editableParams.to
|
||||
* @param editableParams.value
|
||||
* @param editableParams.gas
|
||||
* @param editableParams.gasPrice
|
||||
*/
|
||||
updateEditableParams(txId, { data, from, to, value, gas, gasPrice }) {
|
||||
if (!this._checkIfTxStatusIsUnapproved(txId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const editableParams = {
|
||||
txParams: {
|
||||
data,
|
||||
from,
|
||||
to,
|
||||
value,
|
||||
gas,
|
||||
gasPrice,
|
||||
},
|
||||
};
|
||||
|
||||
// only update what is defined
|
||||
editableParams.txParams = pickBy(editableParams.txParams);
|
||||
const note = `Update Editable Params for ${txId}`;
|
||||
this._updateTransaction(txId, editableParams, note);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* {
|
||||
* gasLimit,
|
||||
* gasPrice,
|
||||
* maxPriorityFeePerGas,
|
||||
* maxFeePerGas,
|
||||
* estimateUsed,
|
||||
* estimateSuggested
|
||||
* }
|
||||
* @param txGasFees.gasLimit
|
||||
* @param txGasFees.gasPrice
|
||||
* @param txGasFees.maxPriorityFeePerGas
|
||||
* @param txGasFees.maxFeePerGas
|
||||
* @param txGasFees.estimateUsed
|
||||
* @param txGasFees.estimateSuggested
|
||||
* @param txGasFees.defaultGasEstimates
|
||||
* @param txGasFees.gas
|
||||
* @param txGasFees.originalGasEstimate
|
||||
*/
|
||||
updateTransactionGasFees(
|
||||
txId,
|
||||
{
|
||||
gas,
|
||||
gasLimit,
|
||||
gasPrice,
|
||||
maxPriorityFeePerGas,
|
||||
maxFeePerGas,
|
||||
estimateUsed,
|
||||
estimateSuggested,
|
||||
defaultGasEstimates,
|
||||
originalGasEstimate,
|
||||
},
|
||||
) {
|
||||
if (!this._checkIfTxStatusIsUnapproved(txId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* {
|
||||
* estimatedBaseFee,
|
||||
* decEstimatedBaseFee
|
||||
* }
|
||||
* @param txEstimateBaseFees.estimatedBaseFee
|
||||
* @param txEstimateBaseFees.decEstimatedBaseFee
|
||||
*/
|
||||
updateTransactionEstimatedBaseFee(
|
||||
txId,
|
||||
{ estimatedBaseFee, decEstimatedBaseFee },
|
||||
) {
|
||||
if (!this._checkIfTxStatusIsUnapproved(txId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* {
|
||||
* type,
|
||||
* sourceTokenSymbol
|
||||
* }
|
||||
* @param swapApprovalTransaction.type
|
||||
* @param swapApprovalTransaction.sourceTokenSymbol
|
||||
*/
|
||||
updateSwapApprovalTransaction(txId, { type, sourceTokenSymbol }) {
|
||||
if (!this._checkIfTxStatusIsUnapproved(txId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* {
|
||||
* sourceTokenSymbol,
|
||||
* destinationTokenSymbol,
|
||||
* type,
|
||||
* destinationTokenDecimals,
|
||||
* destinationTokenAddress,
|
||||
* swapMetaData,
|
||||
* swapTokenValue,
|
||||
* estimatedBaseFee,
|
||||
* approvalTxId
|
||||
*}
|
||||
* @param swapTransaction.sourceTokenSymbol
|
||||
* @param swapTransaction.destinationTokenSymbol
|
||||
* @param swapTransaction.type
|
||||
* @param swapTransaction.destinationTokenDecimals
|
||||
* @param swapTransaction.destinationTokenAddress
|
||||
* @param swapTransaction.swapMetaData
|
||||
* @param swapTransaction.swapTokenValue
|
||||
* @param swapTransaction.estimatedBaseFee
|
||||
* @param swapTransaction.approvalTxId
|
||||
*/
|
||||
updateSwapTransaction(
|
||||
txId,
|
||||
{
|
||||
sourceTokenSymbol,
|
||||
destinationTokenSymbol,
|
||||
type,
|
||||
destinationTokenDecimals,
|
||||
destinationTokenAddress,
|
||||
swapMetaData,
|
||||
swapTokenValue,
|
||||
estimatedBaseFee,
|
||||
approvalTxId,
|
||||
},
|
||||
) {
|
||||
if (!this._checkIfTxStatusIsUnapproved(txId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* updates a transaction's user settings only if the transaction state is unapproved
|
||||
*
|
||||
* @param {string} txId
|
||||
* @param {object} userSettings - holds the metadata
|
||||
* { userEditedGasLimit, userFeeLevel }
|
||||
* @param userSettings.userEditedGasLimit
|
||||
* @param userSettings.userFeeLevel
|
||||
*/
|
||||
updateTransactionUserSettings(txId, { userEditedGasLimit, userFeeLevel }) {
|
||||
if (!this._checkIfTxStatusIsUnapproved(txId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let userSettings = { userEditedGasLimit, userFeeLevel };
|
||||
// only update what is defined
|
||||
userSettings = pickBy(userSettings);
|
||||
|
||||
const note = `Update User Settings for ${txId}`;
|
||||
this._updateTransaction(txId, userSettings, note);
|
||||
}
|
||||
|
||||
// ====================================================================================================================================================
|
||||
|
||||
/**
|
||||
* Validates and generates a txMeta with defaults and puts it in txStateManager
|
||||
* store.
|
||||
@ -1735,6 +2000,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 = {
|
||||
|
@ -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 });
|
||||
@ -1616,6 +1618,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 +1695,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 +1782,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 +1861,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 +1940,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 +2001,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 +2072,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 +2175,203 @@ 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('does not update 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',
|
||||
});
|
||||
|
||||
txController.updateTransactionGasFees('4', { maxFeePerGas: '0x0088' });
|
||||
let result = txStateManager.getTransaction('4');
|
||||
assert.equal(result.txParams.maxFeePerGas, '0x008');
|
||||
|
||||
// test update estimate used
|
||||
txController.updateTransactionGasFees('4', { estimateUsed: '0x0099' });
|
||||
result = txStateManager.getTransaction('4');
|
||||
assert.equal(result.estimateUsed, '0x009');
|
||||
});
|
||||
|
||||
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');
|
||||
console.log(result);
|
||||
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
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -249,9 +249,9 @@ export default class TransactionStateManager extends EventEmitter {
|
||||
const txsToDelete = transactions
|
||||
.reverse()
|
||||
.filter((tx) => {
|
||||
const { nonce } = tx.txParams;
|
||||
const { nonce, from } = tx.txParams;
|
||||
const { chainId, metamaskNetworkId, status } = tx;
|
||||
const key = `${nonce}-${chainId ?? metamaskNetworkId}`;
|
||||
const key = `${nonce}-${chainId ?? metamaskNetworkId}-${from}`;
|
||||
if (nonceNetworkSet.has(key)) {
|
||||
return false;
|
||||
} else if (
|
||||
|
@ -671,7 +671,7 @@ export default class MetamaskController extends EventEmitter {
|
||||
this.networkController,
|
||||
),
|
||||
preferencesStore: this.preferencesController.store,
|
||||
txHistoryLimit: 40,
|
||||
txHistoryLimit: 60,
|
||||
signTransaction: this.keyringController.signTransaction.bind(
|
||||
this.keyringController,
|
||||
),
|
||||
@ -700,6 +700,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());
|
||||
|
||||
@ -2186,6 +2188,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
|
||||
*
|
||||
|
@ -1,6 +1,7 @@
|
||||
# The MetaMask Build System
|
||||
|
||||
> _tl;dr_ `yarn dist` for prod, `yarn start` for local development
|
||||
> _tl;dr_ `yarn dist` for prod, `yarn start` for local development.
|
||||
> Add `--build-type flask` to build Flask, our canary distribution with more experimental features.
|
||||
|
||||
This directory contains the MetaMask build system, which is used to build the MetaMask Extension such that it can be used in a supported browser.
|
||||
From the repository root, the build system entry file is located at [`./development/build/index.js`](https://github.com/MetaMask/metamask-extension/blob/develop/development/build/index.js).
|
||||
@ -40,7 +41,8 @@ Commands:
|
||||
e2e tests.
|
||||
|
||||
Options:
|
||||
--build-type The "type" of build to create. One of: "beta", "main"
|
||||
--build-type The "type" of build to create. One of: "beta", "flask",
|
||||
"main"
|
||||
[string] [default: "main"]
|
||||
--lint-fence-files Whether files with code fences should be linted after
|
||||
fences have been removed by the code fencing transform.
|
||||
|
@ -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) => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
function setupMocking(server) {
|
||||
function setupMocking(server, testSpecificMock) {
|
||||
server.forAnyRequest().thenPassThrough();
|
||||
|
||||
server
|
||||
@ -27,6 +27,8 @@ function setupMocking(server) {
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
testSpecificMock(server);
|
||||
}
|
||||
|
||||
module.exports = { setupMocking };
|
||||
|
@ -2,13 +2,16 @@
|
||||
|
||||
![Load dev build](./load-dev-build-chrome.gif)
|
||||
|
||||
* 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.
|
||||
|
@ -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`.
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
},
|
||||
"@eslint/eslintrc": {
|
||||
"packages": {
|
||||
"<root>": true,
|
||||
"@babel/eslint-parser": true,
|
||||
"@babel/eslint-plugin": true,
|
||||
"@metamask/eslint-config": true,
|
||||
|
@ -110,6 +110,7 @@
|
||||
"@material-ui/core": "^4.11.0",
|
||||
"@metamask/contract-metadata": "^1.31.0",
|
||||
"@metamask/controllers": "^25.0.0",
|
||||
"@metamask/design-tokens": "^1.3.0",
|
||||
"@metamask/eth-ledger-bridge-keyring": "^0.10.0",
|
||||
"@metamask/eth-token-tracker": "^4.0.0",
|
||||
"@metamask/etherscan-link": "^2.1.0",
|
||||
@ -261,6 +262,7 @@
|
||||
"@testing-library/jest-dom": "^5.11.10",
|
||||
"@testing-library/react": "^10.4.8",
|
||||
"@testing-library/react-hooks": "^3.2.1",
|
||||
"@testing-library/user-event": "^14.0.0-beta.12",
|
||||
"@types/react": "^16.9.53",
|
||||
"addons-linter": "1.14.0",
|
||||
"babelify": "^10.0.0",
|
||||
@ -347,6 +349,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",
|
||||
|
@ -8,6 +8,7 @@ export const KEYRING_TYPES = {
|
||||
TREZOR: 'Trezor Hardware',
|
||||
LATTICE: 'Lattice Hardware',
|
||||
QR: 'QR Hardware Wallet Device',
|
||||
IMPORTED: 'Simple Key Pair',
|
||||
};
|
||||
|
||||
export const DEVICE_NAMES = {
|
||||
|
@ -7,6 +7,7 @@ const {
|
||||
createSegmentServer,
|
||||
} = require('../../development/lib/create-segment-server');
|
||||
const { setupMocking } = require('../../development/mock-e2e');
|
||||
const enLocaleMessages = require('../../app/_locales/en/messages.json');
|
||||
const Ganache = require('./ganache');
|
||||
const FixtureServer = require('./fixture-server');
|
||||
const { buildWebDriver } = require('./webdriver');
|
||||
@ -29,6 +30,9 @@ async function withFixtures(options, testSuite) {
|
||||
title,
|
||||
failOnConsoleError = true,
|
||||
dappPath = undefined,
|
||||
testSpecificMock = function () {
|
||||
// do nothing.
|
||||
},
|
||||
} = options;
|
||||
const fixtureServer = new FixtureServer();
|
||||
const ganacheServer = new Ganache();
|
||||
@ -89,8 +93,8 @@ async function withFixtures(options, testSuite) {
|
||||
}
|
||||
const https = await mockttp.generateCACertificate();
|
||||
mockServer = mockttp.getLocal({ https });
|
||||
setupMocking(mockServer, testSpecificMock);
|
||||
await mockServer.start(8000);
|
||||
setupMocking(mockServer);
|
||||
if (
|
||||
process.env.SELENIUM_BROWSER === 'chrome' &&
|
||||
process.env.CI === 'true'
|
||||
@ -203,6 +207,72 @@ const connectDappWithExtensionPopup = async (driver) => {
|
||||
await driver.delay(regularDelayMs);
|
||||
};
|
||||
|
||||
const completeImportSRPOnboardingFlow = async (
|
||||
driver,
|
||||
seedPhrase,
|
||||
password,
|
||||
) => {
|
||||
if (process.env.ONBOARDING_V2 === '1') {
|
||||
// welcome
|
||||
await driver.clickElement('[data-testid="onboarding-import-wallet"]');
|
||||
|
||||
// metrics
|
||||
await driver.clickElement('[data-testid="metametrics-no-thanks"]');
|
||||
|
||||
// import with recovery phrase
|
||||
await driver.fill('[data-testid="import-srp-text"]', seedPhrase);
|
||||
await driver.clickElement('[data-testid="import-srp-confirm"]');
|
||||
|
||||
// create password
|
||||
await driver.fill('[data-testid="create-password-new"]', password);
|
||||
await driver.fill('[data-testid="create-password-confirm"]', password);
|
||||
await driver.clickElement('[data-testid="create-password-terms"]');
|
||||
await driver.clickElement('[data-testid="create-password-import"]');
|
||||
|
||||
// complete
|
||||
await driver.clickElement('[data-testid="onboarding-complete-done"]');
|
||||
|
||||
// pin extension
|
||||
await driver.clickElement('[data-testid="pin-extension-next"]');
|
||||
await driver.clickElement('[data-testid="pin-extension-done"]');
|
||||
} else {
|
||||
// clicks the continue button on the welcome screen
|
||||
await driver.findElement('.welcome-page__header');
|
||||
await driver.clickElement({
|
||||
text: enLocaleMessages.getStarted.message,
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// clicks the "Import Wallet" option
|
||||
await driver.clickElement({ text: 'Import wallet', tag: 'button' });
|
||||
|
||||
// clicks the "No thanks" option on the metametrics opt-in screen
|
||||
await driver.clickElement('.btn-secondary');
|
||||
|
||||
// Import Secret Recovery Phrase
|
||||
await driver.fill(
|
||||
'input[placeholder="Enter your Secret Recovery Phrase"]',
|
||||
seedPhrase,
|
||||
);
|
||||
|
||||
await driver.fill('#password', password);
|
||||
await driver.fill('#confirm-password', password);
|
||||
|
||||
await driver.clickElement(
|
||||
'[data-testid="create-new-vault__terms-checkbox"]',
|
||||
);
|
||||
|
||||
await driver.clickElement({ text: 'Import', tag: 'button' });
|
||||
|
||||
// clicks through the success screen
|
||||
await driver.findElement({ text: 'Congratulations', tag: 'div' });
|
||||
await driver.clickElement({
|
||||
text: enLocaleMessages.endOfFlowMessage10.message,
|
||||
tag: 'button',
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getWindowHandles,
|
||||
convertToHexValue,
|
||||
@ -211,4 +281,5 @@ module.exports = {
|
||||
largeDelayMs,
|
||||
withFixtures,
|
||||
connectDappWithExtensionPopup,
|
||||
completeImportSRPOnboardingFlow,
|
||||
};
|
||||
|
@ -191,12 +191,9 @@ describe('MetaMask', function () {
|
||||
|
||||
it('imports Secret Recovery Phrase', async function () {
|
||||
const restoreSeedLink = await driver.findClickableElement(
|
||||
'.unlock-page__link--import',
|
||||
);
|
||||
assert.equal(
|
||||
await restoreSeedLink.getText(),
|
||||
'import using Secret Recovery Phrase',
|
||||
'.unlock-page__link',
|
||||
);
|
||||
assert.equal(await restoreSeedLink.getText(), 'Forgot password?');
|
||||
await restoreSeedLink.click();
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
|
@ -1,16 +1,26 @@
|
||||
const { strict: assert } = require('assert');
|
||||
const { convertToHexValue, withFixtures } = require('../helpers');
|
||||
const {
|
||||
convertToHexValue,
|
||||
withFixtures,
|
||||
regularDelayMs,
|
||||
completeImportSRPOnboardingFlow,
|
||||
} = require('../helpers');
|
||||
const enLocaleMessages = require('../../../app/_locales/en/messages.json');
|
||||
|
||||
describe('Add account', function () {
|
||||
const testSeedPhrase =
|
||||
'forum vessel pink push lonely enact gentle tail admit parrot grunt dress';
|
||||
const testPassword = 'correct horse battery staple';
|
||||
const ganacheOptions = {
|
||||
accounts: [
|
||||
{
|
||||
secretKey:
|
||||
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',
|
||||
'0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9',
|
||||
balance: convertToHexValue(25000000000000000000),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
it('should display correct new account name after create', async function () {
|
||||
await withFixtures(
|
||||
{
|
||||
@ -36,4 +46,213 @@ describe('Add account', function () {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('should add the same account addresses when a secret recovery phrase is imported, the account is locked, and the same secret recovery phrase is imported again', async function () {
|
||||
await withFixtures(
|
||||
{
|
||||
fixtures: 'onboarding',
|
||||
ganacheOptions,
|
||||
title: this.test.title,
|
||||
failOnConsoleError: false,
|
||||
},
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
|
||||
await completeImportSRPOnboardingFlow(
|
||||
driver,
|
||||
testSeedPhrase,
|
||||
testPassword,
|
||||
);
|
||||
|
||||
await driver.clickElement('.account-menu__icon');
|
||||
await driver.clickElement({ text: 'Create Account', tag: 'div' });
|
||||
await driver.fill('.new-account-create-form input', '2nd account');
|
||||
await driver.clickElement({ text: 'Create', tag: 'button' });
|
||||
|
||||
await driver.clickElement(
|
||||
'[data-testid="account-options-menu-button"]',
|
||||
);
|
||||
await driver.clickElement(
|
||||
'[data-testid="account-options-menu__account-details"]',
|
||||
);
|
||||
|
||||
const detailsModal = await driver.findVisibleElement('span .modal');
|
||||
// get the public address for the "second account"
|
||||
const secondAccountAddress = await driver.findElement(
|
||||
'.qr-code__address',
|
||||
);
|
||||
const secondAccountPublicAddress = await secondAccountAddress.getText();
|
||||
|
||||
await driver.clickElement('.account-modal__close');
|
||||
await detailsModal.waitForElementState('hidden');
|
||||
|
||||
// generate a third accound
|
||||
await driver.clickElement('.account-menu__icon');
|
||||
await driver.clickElement({ text: 'Create Account', tag: 'div' });
|
||||
await driver.fill('.new-account-create-form input', '3rd account');
|
||||
await driver.clickElement({ text: 'Create', tag: 'button' });
|
||||
|
||||
await driver.clickElement(
|
||||
'[data-testid="account-options-menu-button"]',
|
||||
);
|
||||
await driver.clickElement(
|
||||
'[data-testid="account-options-menu__account-details"]',
|
||||
);
|
||||
|
||||
// get the public address for the "third account"
|
||||
const secondDetailsModal = await driver.findVisibleElement(
|
||||
'span .modal',
|
||||
);
|
||||
const thirdAccountAddress = await driver.findElement(
|
||||
'.qr-code__address',
|
||||
);
|
||||
const thirdAccountPublicAddress = await thirdAccountAddress.getText();
|
||||
|
||||
await driver.clickElement('.account-modal__close');
|
||||
await secondDetailsModal.waitForElementState('hidden');
|
||||
|
||||
// lock account
|
||||
await driver.clickElement('.account-menu__icon');
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
const lockButton = await driver.findClickableElement(
|
||||
'.account-menu__lock-button',
|
||||
);
|
||||
await lockButton.click();
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
// restore same seed phrase
|
||||
const restoreSeedLink = await driver.findClickableElement(
|
||||
'.unlock-page__link',
|
||||
);
|
||||
|
||||
await restoreSeedLink.click();
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
await driver.fill(
|
||||
'input[placeholder="Enter your Secret Recovery Phrase"]',
|
||||
testSeedPhrase,
|
||||
);
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
await driver.fill('#password', 'correct horse battery staple');
|
||||
await driver.fill('#confirm-password', 'correct horse battery staple');
|
||||
await driver.clickElement({
|
||||
text: enLocaleMessages.restore.message,
|
||||
tag: 'button',
|
||||
});
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
// recreate a "2nd account"
|
||||
await driver.clickElement('.account-menu__icon');
|
||||
await driver.clickElement({ text: 'Create Account', tag: 'div' });
|
||||
await driver.fill('.new-account-create-form input', '2nd account');
|
||||
await driver.clickElement({ text: 'Create', tag: 'button' });
|
||||
|
||||
await driver.clickElement(
|
||||
'[data-testid="account-options-menu-button"]',
|
||||
);
|
||||
await driver.clickElement(
|
||||
'[data-testid="account-options-menu__account-details"]',
|
||||
);
|
||||
const thirdDetailsModal = await driver.findVisibleElement(
|
||||
'span .modal',
|
||||
);
|
||||
// get the public address for the "second account"
|
||||
const recreatedSecondAccountAddress = await driver.findElement(
|
||||
'.qr-code__address',
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
await recreatedSecondAccountAddress.getText(),
|
||||
secondAccountPublicAddress,
|
||||
);
|
||||
|
||||
await driver.clickElement('.account-modal__close');
|
||||
await thirdDetailsModal.waitForElementState('hidden');
|
||||
|
||||
// re-generate a third accound
|
||||
await driver.clickElement('.account-menu__icon');
|
||||
await driver.clickElement({ text: 'Create Account', tag: 'div' });
|
||||
await driver.fill('.new-account-create-form input', '3rd account');
|
||||
await driver.clickElement({ text: 'Create', tag: 'button' });
|
||||
|
||||
await driver.clickElement(
|
||||
'[data-testid="account-options-menu-button"]',
|
||||
);
|
||||
await driver.clickElement(
|
||||
'[data-testid="account-options-menu__account-details"]',
|
||||
);
|
||||
|
||||
// get the public address for the "third account"
|
||||
const recreatedThirdAccountAddress = await driver.findElement(
|
||||
'.qr-code__address',
|
||||
);
|
||||
assert.strictEqual(
|
||||
await recreatedThirdAccountAddress.getText(),
|
||||
thirdAccountPublicAddress,
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('It should be possible to remove an account imported with a private key, but should not be possible to remove an account generated from the SRP imported in onboarding', async function () {
|
||||
const testPrivateKey =
|
||||
'14abe6f4aab7f9f626fe981c864d0adeb5685f289ac9270c27b8fd790b4235d6';
|
||||
|
||||
await withFixtures(
|
||||
{
|
||||
fixtures: 'imported-account',
|
||||
ganacheOptions,
|
||||
title: this.test.title,
|
||||
},
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
await driver.fill('#password', 'correct horse battery staple');
|
||||
await driver.press('#password', driver.Key.ENTER);
|
||||
|
||||
await driver.delay(regularDelayMs);
|
||||
|
||||
await driver.clickElement('.account-menu__icon');
|
||||
await driver.clickElement({ text: 'Create Account', tag: 'div' });
|
||||
await driver.fill('.new-account-create-form input', '2nd account');
|
||||
await driver.clickElement({ text: 'Create', tag: 'button' });
|
||||
|
||||
await driver.clickElement(
|
||||
'[data-testid="account-options-menu-button"]',
|
||||
);
|
||||
|
||||
const menuItems = await driver.findElements('.menu-item');
|
||||
assert.equal(menuItems.length, 3);
|
||||
|
||||
// click out of menu
|
||||
await driver.clickElement('.menu__background');
|
||||
|
||||
// import with private key
|
||||
await driver.clickElement('.account-menu__icon');
|
||||
await driver.clickElement({ text: 'Import Account', tag: 'div' });
|
||||
|
||||
// enter private key',
|
||||
await driver.fill('#private-key-box', testPrivateKey);
|
||||
await driver.clickElement({ text: 'Import', tag: 'button' });
|
||||
|
||||
// should show the correct account name
|
||||
const importedAccountName = await driver.findElement(
|
||||
'.selected-account__name',
|
||||
);
|
||||
assert.equal(await importedAccountName.getText(), 'Account 3');
|
||||
|
||||
await driver.clickElement(
|
||||
'[data-testid="account-options-menu-button"]',
|
||||
);
|
||||
|
||||
const menuItems2 = await driver.findElements('.menu-item');
|
||||
assert.equal(menuItems2.length, 4);
|
||||
|
||||
await driver.findElement(
|
||||
'[data-testid="account-options-menu__remove-account"]',
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -55,6 +55,7 @@ describe('Hide token', function () {
|
||||
});
|
||||
});
|
||||
|
||||
/* eslint-disable-next-line mocha/max-top-level-suites */
|
||||
describe('Add existing token using search', function () {
|
||||
const ganacheOptions = {
|
||||
accounts: [
|
||||
|
@ -36,10 +36,10 @@ describe('Stores custom RPC history', function () {
|
||||
await driver.findElement('.networks-tab__sub-header-text');
|
||||
|
||||
const customRpcInputs = await driver.findElements('input[type="text"]');
|
||||
const networkNameInput = customRpcInputs[0];
|
||||
const rpcUrlInput = customRpcInputs[1];
|
||||
const chainIdInput = customRpcInputs[2];
|
||||
const symbolInput = customRpcInputs[3];
|
||||
const networkNameInput = customRpcInputs[1];
|
||||
const rpcUrlInput = customRpcInputs[2];
|
||||
const chainIdInput = customRpcInputs[3];
|
||||
const symbolInput = customRpcInputs[4];
|
||||
|
||||
await networkNameInput.clear();
|
||||
await networkNameInput.sendKeys(networkName);
|
||||
@ -84,7 +84,7 @@ describe('Stores custom RPC history', function () {
|
||||
await driver.findElement('.networks-tab__sub-header-text');
|
||||
|
||||
const customRpcInputs = await driver.findElements('input[type="text"]');
|
||||
const rpcUrlInput = customRpcInputs[1];
|
||||
const rpcUrlInput = customRpcInputs[2];
|
||||
|
||||
await rpcUrlInput.clear();
|
||||
await rpcUrlInput.sendKeys(duplicateRpcUrl);
|
||||
@ -120,8 +120,8 @@ describe('Stores custom RPC history', function () {
|
||||
await driver.findElement('.networks-tab__sub-header-text');
|
||||
|
||||
const customRpcInputs = await driver.findElements('input[type="text"]');
|
||||
const rpcUrlInput = customRpcInputs[1];
|
||||
const chainIdInput = customRpcInputs[2];
|
||||
const rpcUrlInput = customRpcInputs[2];
|
||||
const chainIdInput = customRpcInputs[3];
|
||||
|
||||
await chainIdInput.clear();
|
||||
await chainIdInput.sendKeys(duplicateChainId);
|
||||
|
@ -4,8 +4,8 @@ const {
|
||||
withFixtures,
|
||||
regularDelayMs,
|
||||
largeDelayMs,
|
||||
completeImportSRPOnboardingFlow,
|
||||
} = require('../helpers');
|
||||
const enLocaleMessages = require('../../../app/_locales/en/messages.json');
|
||||
|
||||
describe('Metamask Import UI', function () {
|
||||
it('Importing wallet using Secret Recovery Phrase', async function () {
|
||||
@ -20,6 +20,7 @@ describe('Metamask Import UI', function () {
|
||||
};
|
||||
const testSeedPhrase =
|
||||
'forum vessel pink push lonely enact gentle tail admit parrot grunt dress';
|
||||
const testPassword = 'correct horse battery staple';
|
||||
const testAddress = '0x0Cc5261AB8cE458dc977078A3623E2BaDD27afD3';
|
||||
|
||||
await withFixtures(
|
||||
@ -32,74 +33,11 @@ describe('Metamask Import UI', function () {
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
|
||||
if (process.env.ONBOARDING_V2 === '1') {
|
||||
// welcome
|
||||
await driver.clickElement('[data-testid="onboarding-import-wallet"]');
|
||||
|
||||
// metrics
|
||||
await driver.clickElement('[data-testid="metametrics-no-thanks"]');
|
||||
|
||||
// import with recovery phrase
|
||||
await driver.fill('[data-testid="import-srp-text"]', testSeedPhrase);
|
||||
await driver.clickElement('[data-testid="import-srp-confirm"]');
|
||||
|
||||
// create password
|
||||
await driver.fill(
|
||||
'[data-testid="create-password-new"]',
|
||||
'correct horse battery staple',
|
||||
);
|
||||
await driver.fill(
|
||||
'[data-testid="create-password-confirm"]',
|
||||
'correct horse battery staple',
|
||||
);
|
||||
await driver.clickElement('[data-testid="create-password-terms"]');
|
||||
await driver.clickElement('[data-testid="create-password-import"]');
|
||||
|
||||
// complete
|
||||
await driver.clickElement('[data-testid="onboarding-complete-done"]');
|
||||
|
||||
// pin extension
|
||||
await driver.clickElement('[data-testid="pin-extension-next"]');
|
||||
await driver.clickElement('[data-testid="pin-extension-done"]');
|
||||
} else {
|
||||
// clicks the continue button on the welcome screen
|
||||
await driver.findElement('.welcome-page__header');
|
||||
await driver.clickElement({
|
||||
text: enLocaleMessages.getStarted.message,
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// clicks the "Import Wallet" option
|
||||
await driver.clickElement({ text: 'Import wallet', tag: 'button' });
|
||||
|
||||
// clicks the "No thanks" option on the metametrics opt-in screen
|
||||
await driver.clickElement('.btn-secondary');
|
||||
|
||||
// Import Secret Recovery Phrase
|
||||
await driver.fill(
|
||||
'input[placeholder="Enter your Secret Recovery Phrase"]',
|
||||
testSeedPhrase,
|
||||
);
|
||||
|
||||
await driver.fill('#password', 'correct horse battery staple');
|
||||
await driver.fill(
|
||||
'#confirm-password',
|
||||
'correct horse battery staple',
|
||||
);
|
||||
|
||||
await driver.clickElement(
|
||||
'[data-testid="create-new-vault__terms-checkbox"]',
|
||||
);
|
||||
|
||||
await driver.clickElement({ text: 'Import', tag: 'button' });
|
||||
|
||||
// clicks through the success screen
|
||||
await driver.findElement({ text: 'Congratulations', tag: 'div' });
|
||||
await driver.clickElement({
|
||||
text: enLocaleMessages.endOfFlowMessage10.message,
|
||||
tag: 'button',
|
||||
});
|
||||
}
|
||||
await completeImportSRPOnboardingFlow(
|
||||
driver,
|
||||
testSeedPhrase,
|
||||
testPassword,
|
||||
);
|
||||
|
||||
// Show account information
|
||||
await driver.clickElement(
|
||||
@ -293,6 +231,47 @@ describe('Metamask Import UI', function () {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('Import Account using private key of an already active account should result in an error', async function () {
|
||||
const testPrivateKey =
|
||||
'0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9';
|
||||
const ganacheOptions = {
|
||||
accounts: [
|
||||
{
|
||||
secretKey: testPrivateKey,
|
||||
balance: convertToHexValue(25000000000000000000),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
await withFixtures(
|
||||
{
|
||||
fixtures: 'import-ui',
|
||||
ganacheOptions,
|
||||
title: this.test.title,
|
||||
},
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
await driver.fill('#password', 'correct horse battery staple');
|
||||
await driver.press('#password', driver.Key.ENTER);
|
||||
|
||||
// choose Import Account from the account menu
|
||||
await driver.clickElement('.account-menu__icon');
|
||||
await driver.clickElement({ text: 'Import Account', tag: 'div' });
|
||||
|
||||
// enter private key',
|
||||
await driver.fill('#private-key-box', testPrivateKey);
|
||||
await driver.clickElement({ text: 'Import', tag: 'button' });
|
||||
|
||||
// error should occur
|
||||
await driver.waitForSelector({
|
||||
css: '.error',
|
||||
text: "The account you're are trying to import is a duplicate",
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('Connects to a Hardware wallet', async function () {
|
||||
const ganacheOptions = {
|
||||
accounts: [
|
||||
|
@ -164,12 +164,9 @@ describe('Metamask Responsive UI', function () {
|
||||
|
||||
// Import Secret Recovery Phrase
|
||||
const restoreSeedLink = await driver.findClickableElement(
|
||||
'.unlock-page__link--import',
|
||||
);
|
||||
assert.equal(
|
||||
await restoreSeedLink.getText(),
|
||||
'import using Secret Recovery Phrase',
|
||||
'.unlock-page__link',
|
||||
);
|
||||
assert.equal(await restoreSeedLink.getText(), 'Forgot password?');
|
||||
await restoreSeedLink.click();
|
||||
|
||||
await driver.fill(
|
||||
|
53
test/e2e/tests/phishing-detection.spec.js
Normal file
53
test/e2e/tests/phishing-detection.spec.js
Normal file
@ -0,0 +1,53 @@
|
||||
const { strict: assert } = require('assert');
|
||||
const { convertToHexValue, withFixtures } = require('../helpers');
|
||||
|
||||
describe('Phishing Detection', function () {
|
||||
function mockPhishingDetection(mockServer) {
|
||||
mockServer
|
||||
.forGet(
|
||||
'https://cdn.jsdelivr.net/gh/MetaMask/eth-phishing-detect@master/src/config.json',
|
||||
)
|
||||
.thenCallback(() => {
|
||||
return {
|
||||
headers: { 'Access-Control-Allow-Origin': '*' },
|
||||
statusCode: 200,
|
||||
json: {
|
||||
version: 2,
|
||||
tolerance: 2,
|
||||
fuzzylist: [],
|
||||
whitelist: [],
|
||||
blacklist: ['example.com'],
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
const ganacheOptions = {
|
||||
accounts: [
|
||||
{
|
||||
secretKey:
|
||||
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',
|
||||
balance: convertToHexValue(25000000000000000000),
|
||||
},
|
||||
],
|
||||
};
|
||||
it('should display the MetaMask Phishing Detection page', async function () {
|
||||
await withFixtures(
|
||||
{
|
||||
fixtures: 'imported-account',
|
||||
ganacheOptions,
|
||||
title: this.test.title,
|
||||
testSpecificMock: mockPhishingDetection,
|
||||
},
|
||||
async ({ driver }) => {
|
||||
await driver.navigate();
|
||||
await driver.fill('#password', 'correct horse battery staple');
|
||||
await driver.press('#password', driver.Key.ENTER);
|
||||
await driver.navigate();
|
||||
await driver.openNewPage('http://example.com');
|
||||
await driver.waitForSelector({ text: 'continuing at your own risk' });
|
||||
const header = await driver.findElement('h1');
|
||||
assert.equal(await header.getText(), 'MetaMask Phishing Detection');
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
@ -91,6 +91,7 @@ describe('Send ETH from inside MetaMask using default gas', function () {
|
||||
});
|
||||
});
|
||||
|
||||
/* eslint-disable-next-line mocha/max-top-level-suites */
|
||||
describe('Send ETH from inside MetaMask using advanced gas modal', function () {
|
||||
const ganacheOptions = {
|
||||
accounts: [
|
||||
|
@ -86,6 +86,7 @@ describe('Sign Typed Data V4 Signature Request', function () {
|
||||
});
|
||||
});
|
||||
|
||||
/* eslint-disable-next-line mocha/max-top-level-suites */
|
||||
describe('Sign Typed Data V3 Signature Request', function () {
|
||||
it('can initiate and confirm a Signature Request', async function () {
|
||||
const ganacheOptions = {
|
||||
|
@ -79,3 +79,11 @@ if (!window.crypto.getRandomValues) {
|
||||
// eslint-disable-next-line node/global-require
|
||||
window.crypto.getRandomValues = require('polyfill-crypto.getrandomvalues');
|
||||
}
|
||||
|
||||
// Used to test `clearClipboard` function
|
||||
if (!window.navigator.clipboard) {
|
||||
window.navigator.clipboard = {};
|
||||
}
|
||||
if (!window.navigator.clipboard.writeText) {
|
||||
window.navigator.clipboard.writeText = () => undefined;
|
||||
}
|
||||
|
@ -95,3 +95,17 @@ export function renderWithProvider(component, store) {
|
||||
|
||||
return render(component, { wrapper: Wrapper });
|
||||
}
|
||||
|
||||
export function renderWithLocalization(component) {
|
||||
const Wrapper = ({ children }) => (
|
||||
<I18nProvider currentLocale="en" current={en} en={en}>
|
||||
<LegacyI18nProvider>{children}</LegacyI18nProvider>
|
||||
</I18nProvider>
|
||||
);
|
||||
|
||||
Wrapper.propTypes = {
|
||||
children: PropTypes.node,
|
||||
};
|
||||
|
||||
return render(component, { wrapper: Wrapper });
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ export default class AccountMenu extends Component {
|
||||
marginLeft: '8px',
|
||||
}}
|
||||
>
|
||||
<SearchIcon />
|
||||
<SearchIcon color="currentColor" />
|
||||
</InputAdornment>
|
||||
);
|
||||
|
||||
|
@ -22,7 +22,7 @@ export default function KeyRingLabel({ keyring }) {
|
||||
case KEYRING_TYPES.QR:
|
||||
label = KEYRING_NAMES.QR;
|
||||
break;
|
||||
case 'Simple Key Pair':
|
||||
case KEYRING_TYPES.IMPORTED:
|
||||
label = t('imported');
|
||||
break;
|
||||
case KEYRING_TYPES.TREZOR:
|
||||
|
133
ui/components/app/add-network/add-network.js
Normal file
133
ui/components/app/add-network/add-network.js
Normal file
@ -0,0 +1,133 @@
|
||||
import React, { useContext } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { I18nContext } from '../../../contexts/i18n';
|
||||
import ActionableMessage from '../../ui/actionable-message';
|
||||
import Box from '../../ui/box';
|
||||
import Typography from '../../ui/typography';
|
||||
import {
|
||||
ALIGN_ITEMS,
|
||||
BLOCK_SIZES,
|
||||
COLORS,
|
||||
DISPLAY,
|
||||
FLEX_DIRECTION,
|
||||
TYPOGRAPHY,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import Button from '../../ui/button';
|
||||
|
||||
const AddNetwork = ({
|
||||
onBackClick,
|
||||
onAddNetworkClick,
|
||||
onAddNetworkManuallyClick,
|
||||
featuredRPCS,
|
||||
}) => {
|
||||
const t = useContext(I18nContext);
|
||||
|
||||
const nets = featuredRPCS
|
||||
.sort((a, b) => (a.ticker > b.ticker ? 1 : -1))
|
||||
.slice(0, 5);
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<Box
|
||||
height={BLOCK_SIZES.TWO_TWELFTHS}
|
||||
padding={[4, 0, 4, 0]}
|
||||
display={DISPLAY.FLEX}
|
||||
alignItems={ALIGN_ITEMS.CENTER}
|
||||
flexDirection={FLEX_DIRECTION.ROW}
|
||||
className="add-network__header"
|
||||
>
|
||||
<img
|
||||
src="./images/caret-left-black.svg"
|
||||
alt={t('back')}
|
||||
onClick={onBackClick}
|
||||
className="add-network__header__back-icon"
|
||||
/>
|
||||
<Typography variant={TYPOGRAPHY.H3} color={COLORS.BLACK}>
|
||||
{t('addNetwork')}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box
|
||||
height={BLOCK_SIZES.FOUR_FIFTHS}
|
||||
width={BLOCK_SIZES.TEN_TWELFTHS}
|
||||
margin={[0, 6, 0, 6]}
|
||||
>
|
||||
<Typography
|
||||
variant={TYPOGRAPHY.H6}
|
||||
color={COLORS.UI4}
|
||||
margin={[4, 0, 0, 0]}
|
||||
>
|
||||
{t('addFromAListOfPopularNetworks')}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant={TYPOGRAPHY.H7}
|
||||
color={COLORS.UI3}
|
||||
margin={[4, 0, 3, 0]}
|
||||
>
|
||||
{t('customNetworks')}
|
||||
</Typography>
|
||||
{nets.map((item, index) => (
|
||||
<Box
|
||||
key={index}
|
||||
display={DISPLAY.FLEX}
|
||||
alignItems={ALIGN_ITEMS.CENTER}
|
||||
marginBottom={6}
|
||||
>
|
||||
<img
|
||||
className="add-network__token-image"
|
||||
src={item?.rpcPrefs?.imageUrl}
|
||||
alt={t('logo', [item.ticker])}
|
||||
/>
|
||||
<Typography variant={TYPOGRAPHY.H7} color={COLORS.BLACK}>
|
||||
{item.ticker}
|
||||
</Typography>
|
||||
<img
|
||||
className="add-network__add-icon"
|
||||
src="./images/times.svg"
|
||||
alt={`${t('add')} ${item.ticker}`}
|
||||
onClick={onAddNetworkClick}
|
||||
/>
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
<Box
|
||||
height={BLOCK_SIZES.ONE_TWELFTH}
|
||||
padding={[4, 4, 4, 4]}
|
||||
className="add-network__footer"
|
||||
>
|
||||
<Button type="link" onClick={onAddNetworkManuallyClick}>
|
||||
<Typography variant={TYPOGRAPHY.H6} color={COLORS.PRIMARY1}>
|
||||
{t('addANetworkManually')}
|
||||
</Typography>
|
||||
</Button>
|
||||
<ActionableMessage
|
||||
type="warning"
|
||||
message={
|
||||
<>
|
||||
{t('onlyInteractWith')}
|
||||
<a
|
||||
href="https://metamask.zendesk.com/hc/en-us/articles/4417500466971"
|
||||
target="_blank"
|
||||
className="add-network__footer__link"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t('endOfFlowMessage9')}
|
||||
</a>
|
||||
</>
|
||||
}
|
||||
iconFillColor="#f8c000"
|
||||
useIcon
|
||||
withRightButton
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
AddNetwork.propTypes = {
|
||||
onBackClick: PropTypes.func,
|
||||
onAddNetworkClick: PropTypes.func,
|
||||
onAddNetworkManuallyClick: PropTypes.func,
|
||||
featuredRPCS: PropTypes.array,
|
||||
};
|
||||
|
||||
export default AddNetwork;
|
53
ui/components/app/add-network/add-network.stories.js
Normal file
53
ui/components/app/add-network/add-network.stories.js
Normal file
@ -0,0 +1,53 @@
|
||||
import React from 'react';
|
||||
import AddNetwork from '.';
|
||||
|
||||
export default {
|
||||
title: 'Components/APP/AddNetwork',
|
||||
id: __filename,
|
||||
};
|
||||
|
||||
export const DefaultStory = () => {
|
||||
const MATIC_TOKEN_IMAGE_URL = './images/matic-token.png';
|
||||
const ARBITRUM_IMAGE_URL = './images/arbitrum.svg';
|
||||
const OPTIMISM_IMAGE_URL = './images/optimism.svg';
|
||||
|
||||
const FEATURED_RPCS = [
|
||||
{
|
||||
chainId: '0x89',
|
||||
nickname: 'Polygon Mumbai',
|
||||
rpcUrl:
|
||||
'https://polygon-mainnet.infura.io/v3/2b6d4a83d89a438eb1b5d036788ab29c',
|
||||
ticker: 'MATIC',
|
||||
rpcPrefs: {
|
||||
blockExplorerUrl: 'https://mumbai.polygonscan.com/',
|
||||
imageUrl: MATIC_TOKEN_IMAGE_URL,
|
||||
},
|
||||
},
|
||||
{
|
||||
chainId: '0x99',
|
||||
nickname: 'Optimism Testnet ',
|
||||
rpcUrl:
|
||||
'https://optimism-kovan.infura.io/v3/2b6d4a83d89a438eb1b5d036788ab29c',
|
||||
ticker: 'KOR',
|
||||
rpcPrefs: {
|
||||
blockExplorerUrl: 'https://kovan-optimistic.etherscan.io/',
|
||||
imageUrl: OPTIMISM_IMAGE_URL,
|
||||
},
|
||||
},
|
||||
{
|
||||
chainId: '0x66eeb',
|
||||
nickname: 'Arbitrum Testnet',
|
||||
rpcUrl:
|
||||
'https://arbitrum-rinkeby.infura.io/v3/2b6d4a83d89a438eb1b5d036788ab29c',
|
||||
ticker: 'ARETH',
|
||||
rpcPrefs: {
|
||||
blockExplorerUrl: 'https://testnet.arbiscan.io/',
|
||||
imageUrl: ARBITRUM_IMAGE_URL,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
return <AddNetwork featuredRPCS={FEATURED_RPCS} />;
|
||||
};
|
||||
|
||||
DefaultStory.storyName = 'Default';
|
1
ui/components/app/add-network/index.js
Normal file
1
ui/components/app/add-network/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default } from './add-network';
|
42
ui/components/app/add-network/index.scss
Normal file
42
ui/components/app/add-network/index.scss
Normal file
@ -0,0 +1,42 @@
|
||||
.add-network {
|
||||
&__header {
|
||||
border-bottom: 1px solid var(--ui-grey);
|
||||
|
||||
&__back-icon {
|
||||
padding-left: 24px;
|
||||
padding-right: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
&__token-image {
|
||||
margin-right: 7px;
|
||||
height: 24px;
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
&__add-icon {
|
||||
height: 16px;
|
||||
width: 12px;
|
||||
color: var(--ui-4);
|
||||
margin-left: auto;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
&__footer {
|
||||
border-top: 1px solid var(--ui-2);
|
||||
|
||||
& .btn-link {
|
||||
display: initial;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&__link {
|
||||
color: var(--primary-1);
|
||||
}
|
||||
|
||||
& .actionable-message--warning .actionable-message__message,
|
||||
.actionable-message--warning .actionable-message__action {
|
||||
color: var(--ui-4);
|
||||
}
|
||||
}
|
||||
}
|
@ -60,24 +60,24 @@ describe('BaseFeeInput', () => {
|
||||
it('should renders advancedGasFee.baseFee value if current estimate used is not custom', () => {
|
||||
render({
|
||||
userFeeLevel: 'high',
|
||||
txParams: {
|
||||
maxFeePerGas: '0x2E90EDD000',
|
||||
},
|
||||
});
|
||||
expect(document.getElementsByTagName('input')[0]).toHaveValue(100);
|
||||
});
|
||||
|
||||
it('should not advancedGasFee.baseFee value for swaps', () => {
|
||||
it('should not use advancedGasFee.baseFee value for swaps', () => {
|
||||
render(
|
||||
{
|
||||
userFeeLevel: 'high',
|
||||
txParams: {
|
||||
maxFeePerGas: '0x2E90EDD000',
|
||||
},
|
||||
},
|
||||
{ editGasMode: EDIT_GAS_MODES.SWAPS },
|
||||
);
|
||||
expect(document.getElementsByTagName('input')[0]).toHaveValue(200);
|
||||
expect(document.getElementsByTagName('input')[0]).toHaveValue(
|
||||
parseInt(
|
||||
mockEstimates[GAS_ESTIMATE_TYPES.FEE_MARKET].gasFeeEstimates.high
|
||||
.suggestedMaxFeePerGas,
|
||||
10,
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
it('should renders baseFee values from transaction if current estimate used is custom', () => {
|
||||
@ -89,19 +89,11 @@ describe('BaseFeeInput', () => {
|
||||
expect(document.getElementsByTagName('input')[0]).toHaveValue(200);
|
||||
});
|
||||
it('should show current value of estimatedBaseFee in subtext', () => {
|
||||
render({
|
||||
txParams: {
|
||||
maxFeePerGas: '0x174876E800',
|
||||
},
|
||||
});
|
||||
render();
|
||||
expect(screen.queryByText('50 GWEI')).toBeInTheDocument();
|
||||
});
|
||||
it('should show 12hr range value in subtext', () => {
|
||||
render({
|
||||
txParams: {
|
||||
maxFeePerGas: '0x174876E800',
|
||||
},
|
||||
});
|
||||
render();
|
||||
expect(screen.queryByText('50 - 100 GWEI')).toBeInTheDocument();
|
||||
});
|
||||
it('should show error if base fee is less than suggested low value', () => {
|
||||
@ -120,7 +112,6 @@ describe('BaseFeeInput', () => {
|
||||
target: { value: 50 },
|
||||
});
|
||||
});
|
||||
|
||||
it('should show error if base if is more than suggested high value', () => {
|
||||
render({
|
||||
txParams: {
|
||||
|
@ -60,26 +60,24 @@ describe('PriorityfeeInput', () => {
|
||||
it('should renders advancedGasFee.priorityfee value if current estimate used is not custom', () => {
|
||||
render({
|
||||
userFeeLevel: 'high',
|
||||
txParams: {
|
||||
maxFeePerGas: '0x2E90EDD000',
|
||||
},
|
||||
});
|
||||
expect(document.getElementsByTagName('input')[0]).toHaveValue(100);
|
||||
});
|
||||
|
||||
it('should not advancedGasFee.baseFee value for swaps', () => {
|
||||
it('should not use advancedGasFee.priorityfee value for swaps', () => {
|
||||
render(
|
||||
{
|
||||
userFeeLevel: 'high',
|
||||
txParams: {
|
||||
maxFeePerGas: '0x2E90EDD000',
|
||||
},
|
||||
},
|
||||
{ editGasMode: EDIT_GAS_MODES.SWAPS },
|
||||
);
|
||||
expect(document.getElementsByTagName('input')[0]).toHaveValue(200);
|
||||
expect(document.getElementsByTagName('input')[0]).toHaveValue(
|
||||
parseInt(
|
||||
mockEstimates[GAS_ESTIMATE_TYPES.FEE_MARKET].gasFeeEstimates.high
|
||||
.suggestedMaxPriorityFeePerGas,
|
||||
10,
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
it('should renders priorityfee value from transaction if current estimate used is custom', () => {
|
||||
render({
|
||||
txParams: {
|
||||
@ -89,19 +87,11 @@ describe('PriorityfeeInput', () => {
|
||||
expect(document.getElementsByTagName('input')[0]).toHaveValue(2);
|
||||
});
|
||||
it('should show current priority fee range in subtext', () => {
|
||||
render({
|
||||
txParams: {
|
||||
maxFeePerGas: '0x174876E800',
|
||||
},
|
||||
});
|
||||
render();
|
||||
expect(screen.queryByText('1 - 20 GWEI')).toBeInTheDocument();
|
||||
});
|
||||
it('should show 12hr range value in subtext', () => {
|
||||
render({
|
||||
txParams: {
|
||||
maxFeePerGas: '0x174876E800',
|
||||
},
|
||||
});
|
||||
render();
|
||||
expect(screen.queryByText('2 - 125 GWEI')).toBeInTheDocument();
|
||||
});
|
||||
it('should show error if value entered is 0', () => {
|
||||
|
@ -1,6 +1,7 @@
|
||||
/** Please import your files in alphabetical order **/
|
||||
@import 'account-list-item/index';
|
||||
@import 'account-menu/index';
|
||||
@import 'add-network/index';
|
||||
@import 'app-loading-spinner/index';
|
||||
@import 'import-token-link/index';
|
||||
@import 'advanced-gas-controls/index';
|
||||
@ -54,6 +55,7 @@
|
||||
@import 'selected-account/index';
|
||||
@import 'signature-request/index';
|
||||
@import 'signature-request-original/index';
|
||||
@import 'srp-input/srp-input';
|
||||
@import 'tab-bar/index';
|
||||
@import 'token-cell/token-cell';
|
||||
@import 'token-list-display/token-list-display';
|
||||
|
@ -42,6 +42,7 @@ describe('Confirm Page Container Container Test', () => {
|
||||
identities: [],
|
||||
featureFlags: {},
|
||||
enableEIP1559V2NoticeDismissed: true,
|
||||
tokenList: {},
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -2,9 +2,16 @@ import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
import { Tabs, Tab } from '../../../ui/tabs';
|
||||
import ErrorMessage from '../../../ui/error-message';
|
||||
import Button from '../../../ui/button';
|
||||
import ActionableMessage from '../../../ui/actionable-message/actionable-message';
|
||||
import { PageContainerFooter } from '../../../ui/page-container';
|
||||
import ErrorMessage from '../../../ui/error-message';
|
||||
import { INSUFFICIENT_FUNDS_ERROR_KEY } from '../../../../helpers/constants/error-keys';
|
||||
import Typography from '../../../ui/typography';
|
||||
import { TYPOGRAPHY } from '../../../../helpers/constants/design-system';
|
||||
import { TRANSACTION_TYPES } from '../../../../../shared/constants/transaction';
|
||||
import { MAINNET_CHAIN_ID } from '../../../../../shared/constants/network';
|
||||
|
||||
import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.';
|
||||
|
||||
export default class ConfirmPageContainerContent extends Component {
|
||||
@ -21,7 +28,7 @@ export default class ConfirmPageContainerContent extends Component {
|
||||
errorMessage: PropTypes.string,
|
||||
hasSimulationError: PropTypes.bool,
|
||||
hideSubtitle: PropTypes.bool,
|
||||
identiconAddress: PropTypes.string,
|
||||
tokenAddress: PropTypes.string,
|
||||
nonce: PropTypes.string,
|
||||
subtitleComponent: PropTypes.node,
|
||||
title: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
@ -44,6 +51,12 @@ export default class ConfirmPageContainerContent extends Component {
|
||||
hideTitle: PropTypes.bool,
|
||||
supportsEIP1559V2: PropTypes.bool,
|
||||
hasTopBorder: PropTypes.bool,
|
||||
currentTransaction: PropTypes.string,
|
||||
nativeCurrency: PropTypes.string,
|
||||
networkName: PropTypes.string,
|
||||
showBuyModal: PropTypes.func,
|
||||
toAddress: PropTypes.string,
|
||||
transactionType: PropTypes.string,
|
||||
};
|
||||
|
||||
renderContent() {
|
||||
@ -93,7 +106,7 @@ export default class ConfirmPageContainerContent extends Component {
|
||||
titleComponent,
|
||||
subtitleComponent,
|
||||
hideSubtitle,
|
||||
identiconAddress,
|
||||
tokenAddress,
|
||||
nonce,
|
||||
detailsComponent,
|
||||
dataComponent,
|
||||
@ -113,6 +126,12 @@ export default class ConfirmPageContainerContent extends Component {
|
||||
hideUserAcknowledgedGasMissing,
|
||||
supportsEIP1559V2,
|
||||
hasTopBorder,
|
||||
currentTransaction,
|
||||
nativeCurrency,
|
||||
networkName,
|
||||
showBuyModal,
|
||||
toAddress,
|
||||
transactionType,
|
||||
} = this.props;
|
||||
|
||||
const primaryAction = hideUserAcknowledgedGasMissing
|
||||
@ -121,6 +140,14 @@ export default class ConfirmPageContainerContent extends Component {
|
||||
label: this.context.t('tryAnywayOption'),
|
||||
onClick: setUserAcknowledgedGasMissing,
|
||||
};
|
||||
const { t } = this.context;
|
||||
|
||||
const showInsuffienctFundsError =
|
||||
supportsEIP1559V2 &&
|
||||
!hasSimulationError &&
|
||||
(errorKey || errorMessage) &&
|
||||
errorKey === INSUFFICIENT_FUNDS_ERROR_KEY &&
|
||||
currentTransaction.type === TRANSACTION_TYPES.SIMPLE_SEND;
|
||||
|
||||
return (
|
||||
<div
|
||||
@ -137,7 +164,7 @@ export default class ConfirmPageContainerContent extends Component {
|
||||
<ActionableMessage
|
||||
type="danger"
|
||||
primaryAction={primaryAction}
|
||||
message={this.context.t('simulationErrorMessage')}
|
||||
message={t('simulationErrorMessage')}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@ -152,19 +179,63 @@ export default class ConfirmPageContainerContent extends Component {
|
||||
titleComponent={titleComponent}
|
||||
subtitleComponent={subtitleComponent}
|
||||
hideSubtitle={hideSubtitle}
|
||||
identiconAddress={identiconAddress}
|
||||
tokenAddress={tokenAddress}
|
||||
nonce={nonce}
|
||||
origin={origin}
|
||||
hideTitle={hideTitle}
|
||||
toAddress={toAddress}
|
||||
transactionType={transactionType}
|
||||
/>
|
||||
{this.renderContent()}
|
||||
{!supportsEIP1559V2 &&
|
||||
!hasSimulationError &&
|
||||
(errorKey || errorMessage) && (
|
||||
(errorKey || errorMessage) &&
|
||||
currentTransaction.type !== TRANSACTION_TYPES.SIMPLE_SEND && (
|
||||
<div className="confirm-page-container-content__error-container">
|
||||
<ErrorMessage errorMessage={errorMessage} errorKey={errorKey} />
|
||||
</div>
|
||||
)}
|
||||
{showInsuffienctFundsError && (
|
||||
<div className="confirm-page-container-content__error-container">
|
||||
{currentTransaction.chainId === MAINNET_CHAIN_ID ? (
|
||||
<ActionableMessage
|
||||
className="actionable-message--warning"
|
||||
message={
|
||||
<Typography variant={TYPOGRAPHY.H7} align="left">
|
||||
{t('insufficientCurrency', [nativeCurrency, networkName])}
|
||||
<Button
|
||||
key="link"
|
||||
type="secondary"
|
||||
className="confirm-page-container-content__link"
|
||||
onClick={showBuyModal}
|
||||
>
|
||||
{t('buyEth')}
|
||||
</Button>
|
||||
|
||||
{t('orDeposit')}
|
||||
</Typography>
|
||||
}
|
||||
useIcon
|
||||
iconFillColor="#d73a49"
|
||||
type="danger"
|
||||
/>
|
||||
) : (
|
||||
<ActionableMessage
|
||||
className="actionable-message--warning"
|
||||
message={
|
||||
<Typography variant={TYPOGRAPHY.H7} align="left">
|
||||
{t('insufficientCurrency', [nativeCurrency, networkName])}
|
||||
{t('buyOther', [nativeCurrency])}
|
||||
</Typography>
|
||||
}
|
||||
useIcon
|
||||
iconFillColor="#d73a49"
|
||||
type="danger"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<PageContainerFooter
|
||||
onCancel={onCancel}
|
||||
cancelText={cancelText}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import configureMockStore from 'redux-mock-store';
|
||||
import { TRANSACTION_TYPES } from '../../../../../shared/constants/transaction';
|
||||
import { renderWithProvider } from '../../../../../test/lib/render-helpers';
|
||||
import { TRANSACTION_ERROR_KEY } from '../../../../helpers/constants/error-keys';
|
||||
import ConfirmPageContainerContent from './confirm-page-container-content.component';
|
||||
@ -10,8 +11,18 @@ describe('Confirm Page Container Content', () => {
|
||||
metamask: {
|
||||
provider: {
|
||||
type: 'test',
|
||||
chainId: '0x3',
|
||||
},
|
||||
eip1559V2Enabled: false,
|
||||
addressBook: {
|
||||
'0x3': {
|
||||
'0x06195827297c7A80a443b6894d3BDB8824b43896': {
|
||||
address: '0x06195827297c7A80a443b6894d3BDB8824b43896',
|
||||
name: 'Address Book Account 1',
|
||||
chainId: '0x3',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -75,6 +86,9 @@ describe('Confirm Page Container Content', () => {
|
||||
props.hasSimulationError = false;
|
||||
props.disabled = true;
|
||||
props.errorKey = TRANSACTION_ERROR_KEY;
|
||||
props.currentTransaction = {
|
||||
type: 'transfer',
|
||||
};
|
||||
const { queryByText, getByText } = renderWithProvider(
|
||||
<ConfirmPageContainerContent {...props} />,
|
||||
store,
|
||||
@ -122,4 +136,30 @@ describe('Confirm Page Container Content', () => {
|
||||
fireEvent.click(cancelButton);
|
||||
expect(props.onCancel).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('render contract address name from addressBook in title for contract', async () => {
|
||||
props.hasSimulationError = false;
|
||||
props.disabled = false;
|
||||
props.toAddress = '0x06195827297c7A80a443b6894d3BDB8824b43896';
|
||||
props.transactionType = TRANSACTION_TYPES.CONTRACT_INTERACTION;
|
||||
const { queryByText } = renderWithProvider(
|
||||
<ConfirmPageContainerContent {...props} />,
|
||||
store,
|
||||
);
|
||||
|
||||
expect(queryByText('Address Book Account 1')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('render simple title without address name for simple send', async () => {
|
||||
props.hasSimulationError = false;
|
||||
props.disabled = false;
|
||||
props.toAddress = '0x06195827297c7A80a443b6894d3BDB8824b43896';
|
||||
props.transactionType = TRANSACTION_TYPES.SIMPLE_SEND;
|
||||
const { queryByText } = renderWithProvider(
|
||||
<ConfirmPageContainerContent {...props} />,
|
||||
store,
|
||||
);
|
||||
|
||||
expect(queryByText('Address Book Account 1')).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user