Merge pull request #10513 from MetaMask/Version-v9.1.0

feature/default_network_editable
Brad Decker 4 years ago committed by GitHub
commit 2e88bd243d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 53
      .circleci/config.yml
  2. 17
      .circleci/scripts/create-lavamoat-viz.sh
  3. 5
      .circleci/scripts/deps-install.sh
  4. 0
      .circleci/scripts/firefox-install.sh
  5. 0
      .circleci/scripts/release-bump-changelog-version.sh
  6. 0
      .circleci/scripts/release-bump-manifest-version.sh
  7. 0
      .circleci/scripts/release-create-gh-release.sh
  8. 0
      .circleci/scripts/release-create-master-pr.sh
  9. 0
      .circleci/scripts/release-create-release-pr.sh
  10. 0
      .circleci/scripts/test-run-e2e.sh
  11. 15
      .circleci/scripts/validate-allow-scripts.sh
  12. 15
      .circleci/scripts/validate-lavamoat-policy.sh
  13. 0
      .circleci/scripts/yarn-audit.sh
  14. 1
      .eslintrc.js
  15. 1
      .prettierignore
  16. 37
      .storybook/i18n-party-addon/register.js
  17. 1
      .storybook/main.js
  18. 52
      .storybook/preview.js
  19. 218
      .storybook/test-data.js
  20. 36
      CHANGELOG.md
  21. 43
      README.md
  22. 6
      app/_locales/am/messages.json
  23. 6
      app/_locales/ar/messages.json
  24. 6
      app/_locales/bg/messages.json
  25. 6
      app/_locales/bn/messages.json
  26. 6
      app/_locales/ca/messages.json
  27. 3
      app/_locales/cs/messages.json
  28. 6
      app/_locales/da/messages.json
  29. 6
      app/_locales/de/messages.json
  30. 6
      app/_locales/el/messages.json
  31. 105
      app/_locales/en/messages.json
  32. 1311
      app/_locales/es/messages.json
  33. 1135
      app/_locales/es_419/messages.json
  34. 6
      app/_locales/et/messages.json
  35. 6
      app/_locales/fa/messages.json
  36. 6
      app/_locales/fi/messages.json
  37. 6
      app/_locales/fil/messages.json
  38. 6
      app/_locales/fr/messages.json
  39. 6
      app/_locales/he/messages.json
  40. 9
      app/_locales/hi/messages.json
  41. 3
      app/_locales/hn/messages.json
  42. 6
      app/_locales/hr/messages.json
  43. 6
      app/_locales/ht/messages.json
  44. 6
      app/_locales/hu/messages.json
  45. 9
      app/_locales/id/messages.json
  46. 1
      app/_locales/index.json
  47. 6
      app/_locales/it/messages.json
  48. 1831
      app/_locales/ja/messages.json
  49. 6
      app/_locales/kn/messages.json
  50. 9
      app/_locales/ko/messages.json
  51. 6
      app/_locales/lt/messages.json
  52. 6
      app/_locales/lv/messages.json
  53. 6
      app/_locales/ms/messages.json
  54. 7
      app/_locales/nl/messages.json
  55. 6
      app/_locales/no/messages.json
  56. 6
      app/_locales/pl/messages.json
  57. 3
      app/_locales/pt/messages.json
  58. 6
      app/_locales/pt_BR/messages.json
  59. 6
      app/_locales/ro/messages.json
  60. 1382
      app/_locales/ru/messages.json
  61. 6
      app/_locales/sk/messages.json
  62. 6
      app/_locales/sl/messages.json
  63. 6
      app/_locales/sr/messages.json
  64. 6
      app/_locales/sv/messages.json
  65. 6
      app/_locales/sw/messages.json
  66. 3
      app/_locales/ta/messages.json
  67. 3
      app/_locales/th/messages.json
  68. 2090
      app/_locales/tl/messages.json
  69. 3
      app/_locales/tr/messages.json
  70. 6
      app/_locales/uk/messages.json
  71. 1965
      app/_locales/vi/messages.json
  72. 1262
      app/_locales/zh_CN/messages.json
  73. 6
      app/_locales/zh_TW/messages.json
  74. 2
      app/manifest/_base.json
  75. 55
      app/scripts/background.js
  76. 5
      app/scripts/controllers/app-state.js
  77. 10
      app/scripts/controllers/ens/index.js
  78. 4
      app/scripts/controllers/incoming-transactions.js
  79. 4
      app/scripts/controllers/metametrics.js
  80. 2
      app/scripts/controllers/network/index.js
  81. 14
      app/scripts/controllers/network/network.js
  82. 7
      app/scripts/controllers/permissions/index.js
  83. 36
      app/scripts/controllers/preferences.js
  84. 3
      app/scripts/controllers/swaps.js
  85. 28
      app/scripts/controllers/token-rates.js
  86. 6
      app/scripts/controllers/transactions/index.js
  87. 17
      app/scripts/controllers/transactions/tx-state-manager.js
  88. 11
      app/scripts/lib/decrypt-message-manager.js
  89. 11
      app/scripts/lib/encryption-public-key-manager.js
  90. 4
      app/scripts/lib/ens-ipfs/setup.js
  91. 11
      app/scripts/lib/message-manager.js
  92. 11
      app/scripts/lib/personal-message-manager.js
  93. 272
      app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js
  94. 8
      app/scripts/lib/rpc-method-middleware/handlers/index.js
  95. 11
      app/scripts/lib/typed-message-manager.js
  96. 118
      app/scripts/metamask-controller.js
  97. 125
      app/scripts/migrations/052.js
  98. 1
      app/scripts/migrations/index.js
  99. 4
      app/scripts/platforms/extension.js
  100. 11
      development/build/index.js
  101. Some files were not shown because too many files have changed in this diff Show More

@ -26,6 +26,13 @@ workflows:
- /^Version-v(\d+)[.](\d+)[.](\d+)/ - /^Version-v(\d+)[.](\d+)[.](\d+)/
- prep-deps - prep-deps
- test-deps - test-deps
- validate-lavamoat-config:
filters:
branches:
only:
- /^Version-v(\d+)[.](\d+)[.](\d+)|master/
requires:
- prep-deps
- prep-build: - prep-build:
requires: requires:
- prep-deps - prep-deps
@ -72,6 +79,7 @@ workflows:
- prep-build - prep-build
- all-tests-pass: - all-tests-pass:
requires: requires:
- validate-lavamoat-config
- test-lint - test-lint
- test-lint-shellcheck - test-lint-shellcheck
- test-lint-lockfile - test-lint-lockfile
@ -118,9 +126,9 @@ jobs:
- run: - run:
name: Create GitHub Pull Request for version name: Create GitHub Pull Request for version
command: | command: |
.circleci/scripts/release-bump-changelog-version .circleci/scripts/release-bump-changelog-version.sh
.circleci/scripts/release-bump-manifest-version .circleci/scripts/release-bump-manifest-version.sh
.circleci/scripts/release-create-release-pr .circleci/scripts/release-create-release-pr.sh
prep-deps: prep-deps:
executor: node-browsers executor: node-browsers
@ -143,6 +151,21 @@ jobs:
- node_modules - node_modules
- build-artifacts - build-artifacts
validate-lavamoat-config:
executor: node-browsers
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Validate allow-scripts config
command: |
.circleci/scripts/validate-allow-scripts.sh
- run:
name: Validate LavaMoat policy
command: |
.circleci/scripts/validate-lavamoat-policy.sh
prep-build: prep-build:
executor: node-browsers-medium-plus executor: node-browsers-medium-plus
steps: steps:
@ -257,7 +280,7 @@ jobs:
at: . at: .
- run: - run:
name: yarn audit name: yarn audit
command: .circleci/scripts/yarn-audit command: .circleci/scripts/yarn-audit.sh
test-e2e-chrome: test-e2e-chrome:
executor: node-browsers executor: node-browsers
@ -277,7 +300,7 @@ jobs:
- run: - run:
name: test:e2e:chrome name: test:e2e:chrome
command: | command: |
if .circleci/scripts/test-run-e2e if .circleci/scripts/test-run-e2e.sh
then then
yarn test:e2e:chrome yarn test:e2e:chrome
fi fi
@ -304,7 +327,7 @@ jobs:
- run: - run:
name: test:e2e:chrome:metrics name: test:e2e:chrome:metrics
command: | command: |
if .circleci/scripts/test-run-e2e if .circleci/scripts/test-run-e2e.sh
then then
yarn test:e2e:chrome:metrics yarn test:e2e:chrome:metrics
fi fi
@ -319,7 +342,7 @@ jobs:
- checkout - checkout
- run: - run:
name: Install Firefox name: Install Firefox
command: ./.circleci/scripts/firefox-install command: ./.circleci/scripts/firefox-install.sh
- attach_workspace: - attach_workspace:
at: . at: .
- run: - run:
@ -331,7 +354,7 @@ jobs:
- run: - run:
name: test:e2e:firefox name: test:e2e:firefox
command: | command: |
if .circleci/scripts/test-run-e2e if .circleci/scripts/test-run-e2e.sh
then then
yarn test:e2e:firefox yarn test:e2e:firefox
fi fi
@ -346,7 +369,7 @@ jobs:
- checkout - checkout
- run: - run:
name: Install Firefox name: Install Firefox
command: ./.circleci/scripts/firefox-install command: ./.circleci/scripts/firefox-install.sh
- attach_workspace: - attach_workspace:
at: . at: .
- run: - run:
@ -358,7 +381,7 @@ jobs:
- run: - run:
name: test:e2e:firefox:metrics name: test:e2e:firefox:metrics
command: | command: |
if .circleci/scripts/test-run-e2e if .circleci/scripts/test-run-e2e.sh
then then
yarn test:e2e:firefox:metrics yarn test:e2e:firefox:metrics
fi fi
@ -414,6 +437,12 @@ jobs:
- store_artifacts: - store_artifacts:
path: test-artifacts path: test-artifacts
destination: test-artifacts destination: test-artifacts
# important: generate lavamoat viz AFTER uploading builds as artifacts
# Temporarily disabled until we can update to a version of `sesify` with
# this fix included: https://github.com/LavaMoat/LavaMoat/pull/121
- run:
name: build:lavamoat-viz
command: ./.circleci/scripts/create-lavamoat-viz.sh
- store_artifacts: - store_artifacts:
path: build-artifacts path: build-artifacts
destination: build-artifacts destination: build-artifacts
@ -436,10 +465,10 @@ jobs:
- run: - run:
name: Create GitHub release name: Create GitHub release
command: | command: |
.circleci/scripts/release-create-gh-release .circleci/scripts/release-create-gh-release.sh
- run: - run:
name: Create GitHub Pull Request to sync master with develop name: Create GitHub Pull Request to sync master with develop
command: .circleci/scripts/release-create-master-pr command: .circleci/scripts/release-create-master-pr.sh
job-publish-storybook: job-publish-storybook:
executor: node-browsers executor: node-browsers

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -x
set -e
set -u
set -o pipefail
BUILD_DEST="./build-artifacts/build-viz/"
# prepare artifacts dir
mkdir -p "${BUILD_DEST}"
# generate lavamoat debug config
yarn lavamoat:debug
# generate viz
npx lavamoat-viz --dest "${BUILD_DEST}"

@ -5,7 +5,7 @@ set -x
# Exit immediately if a command exits with a non-zero status. # Exit immediately if a command exits with a non-zero status.
set -e set -e
yarn --frozen-lockfile --har yarn setup-ci
# Move HAR file into directory with consistent name so that we can cache it # Move HAR file into directory with consistent name so that we can cache it
mkdir -p build-artifacts/yarn-install-har mkdir -p build-artifacts/yarn-install-har
@ -14,6 +14,3 @@ if [[ -f "${har_files[0]}" ]]
then then
mv ./*.har build-artifacts/yarn-install-har/ mv ./*.har build-artifacts/yarn-install-har/
fi fi
# use @lavamoat/allow-scripts instead of manually running install scripts so directory change does not persist
yarn allow-scripts

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
yarn allow-scripts auto
if git diff --exit-code --quiet
then
echo "allow-scripts configuration is up-to-date"
else
echo "allow-scripts configuration requires updates"
exit 1
fi

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
yarn lavamoat:auto
if git diff --exit-code --quiet
then
echo "LavaMoat policy is up-to-date"
else
echo "LavaMoat policy requires updates"
exit 1
fi

@ -31,6 +31,7 @@ module.exports = {
'test/e2e/send-eth-with-private-key-test/**', 'test/e2e/send-eth-with-private-key-test/**',
'nyc_output/**', 'nyc_output/**',
'.vscode/**', '.vscode/**',
'lavamoat/*/policy.json',
], ],
extends: [ extends: [

@ -1,4 +1,5 @@
node_modules/** node_modules/**
lavamoat/*/policy.json
dist/** dist/**
builds/** builds/**
test-*/** test-*/**

@ -0,0 +1,37 @@
// import { useGlobals } from '@storybook/api';
const { useGlobals } = require('@storybook/api')
const React = require("react")
const { addons, types } = require("@storybook/addons")
const { Icons, IconButton } = require('@storybook/components')
const localeList = require('../../app/_locales/index.json')
const { useEffect } = React
addons.register("i18n-party", () => {
addons.add("i18n-party", {
title: "rotates through every i18n locale",
//👇 Sets the type of UI element in Storybook
type: types.TOOL,
match: () => true,
render: (...args) => {
// https://github.com/storybookjs/storybook/blob/6490a0d646dbaa293b76bbde477daca615efe789/addons/toolbars/src/components/MenuToolbar.tsx#L2
const [globals, updateGlobals] = useGlobals()
useEffect(() => {
if (!globals.localeParty) return
const interval = setInterval((...args) => {
const currentIndex = localeList.findIndex(({ code }) => code === globals.locale)
const nextIndex = (currentIndex + 1) % localeList.length
const nextLocale = localeList[nextIndex].code
updateGlobals({ locale: nextLocale })
}, 2000)
return () => clearInterval(interval)
})
return (
<IconButton onClick={() => updateGlobals({ localeParty: !globals.localeParty })}>
<Icons icon={globals.localeParty ? 'star' : 'starhollow'}/>
</IconButton>
)
},
})
})

@ -9,6 +9,7 @@ module.exports = {
'@storybook/addon-actions', '@storybook/addon-actions',
'@storybook/addon-backgrounds', '@storybook/addon-backgrounds',
'@storybook/addon-toolbars', '@storybook/addon-toolbars',
'./i18n-party-addon/register.js',
], ],
webpackFinal: async (config) => { webpackFinal: async (config) => {
config.module.strictExportPresence = true config.module.strictExportPresence = true

@ -1,22 +1,24 @@
import React from 'react' import React, { useEffect } from 'react';
import { addDecorator, addParameters } from '@storybook/react' import { addDecorator, addParameters } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs' import { useGlobals } from '@storybook/api';
import { Provider } from 'react-redux' import { withKnobs } from '@storybook/addon-knobs';
import configureStore from '../ui/app/store/store' import { Provider } from 'react-redux';
import '../ui/app/css/index.scss' import configureStore from '../ui/app/store/store';
import localeList from '../app/_locales/index.json' import '../ui/app/css/index.scss';
import * as allLocales from './locales' import localeList from '../app/_locales/index.json';
import { I18nProvider, LegacyI18nProvider } from './i18n' import * as allLocales from './locales';
import { I18nProvider, LegacyI18nProvider } from './i18n';
import testData from './test-data.js'
addParameters({ addParameters({
backgrounds: { backgrounds: {
default: 'light', default: 'light',
values: [ values: [
{ name: 'light', value: '#FFFFFF'}, { name: 'light', value: '#FFFFFF' },
{ name: 'dark', value: '#333333' }, { name: 'dark', value: '#333333' },
], ],
} },
}) });
export const globalTypes = { export const globalTypes = {
locale: { locale: {
@ -26,8 +28,8 @@ export const globalTypes = {
toolbar: { toolbar: {
icon: 'globe', icon: 'globe',
items: localeList.map(({ code, name }) => { items: localeList.map(({ code, name }) => {
return { value: code, right: code, title: name } return { value: code, right: code, title: name };
}) }),
}, },
}, },
}; };
@ -37,15 +39,13 @@ const styles = {
display: 'flex', display: 'flex',
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
} };
const store = configureStore({ const store = configureStore(testData)
metamask: { metamask: { } },
})
const metamaskDecorator = (story, context) => { const metamaskDecorator = (story, context) => {
const currentLocale = context.globals.locale const currentLocale = context.globals.locale;
const current = allLocales[currentLocale] const current = allLocales[currentLocale];
return ( return (
<Provider store={store}> <Provider store={store}>
<I18nProvider <I18nProvider
@ -54,14 +54,12 @@ const metamaskDecorator = (story, context) => {
en={allLocales.en} en={allLocales.en}
> >
<LegacyI18nProvider> <LegacyI18nProvider>
<div style={styles}> <div style={styles}>{story()}</div>
{ story() }
</div>
</LegacyI18nProvider> </LegacyI18nProvider>
</I18nProvider> </I18nProvider>
</Provider> </Provider>
) );
} };
addDecorator(withKnobs) addDecorator(withKnobs);
addDecorator(metamaskDecorator) addDecorator(metamaskDecorator);

@ -0,0 +1,218 @@
import { TRANSACTION_STATUSES } from '../shared/constants/transaction';
const state = {
metamask: {
isInitialized: true,
isUnlocked: true,
featureFlags: { sendHexData: true },
rpcUrl: 'https://rawtestrpc.metamask.io/',
identities: {
'0xfdea65c8e26263f6d9a1b5de9555d2931a33b825': {
address: '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825',
name: 'Send Account 1',
},
'0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb': {
address: '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb',
name: 'Send Account 2',
},
'0x2f8d4a878cfa04a6e60d46362f5644deab66572d': {
address: '0x2f8d4a878cfa04a6e60d46362f5644deab66572d',
name: 'Send Account 3',
},
'0xd85a4b6a394794842887b8284293d69163007bbb': {
address: '0xd85a4b6a394794842887b8284293d69163007bbb',
name: 'Send Account 4',
},
},
cachedBalances: {},
currentBlockGasLimit: '0x4c1878',
currentCurrency: 'USD',
conversionRate: 1200.88200327,
conversionDate: 1489013762,
nativeCurrency: 'ETH',
frequentRpcList: [],
network: '3',
provider: {
type: 'ropsten',
chainId: '0x3',
},
accounts: {
'0xfdea65c8e26263f6d9a1b5de9555d2931a33b825': {
code: '0x',
balance: '0x47c9d71831c76efe',
nonce: '0x1b',
address: '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825',
},
'0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb': {
code: '0x',
balance: '0x37452b1315889f80',
nonce: '0xa',
address: '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb',
},
'0x2f8d4a878cfa04a6e60d46362f5644deab66572d': {
code: '0x',
balance: '0x30c9d71831c76efe',
nonce: '0x1c',
address: '0x2f8d4a878cfa04a6e60d46362f5644deab66572d',
},
'0xd85a4b6a394794842887b8284293d69163007bbb': {
code: '0x',
balance: '0x0',
nonce: '0x0',
address: '0xd85a4b6a394794842887b8284293d69163007bbb',
},
},
addressBook: {
'0x3': {
'0x06195827297c7a80a443b6894d3bdb8824b43896': {
address: '0x06195827297c7a80a443b6894d3bdb8824b43896',
name: 'Address Book Account 1',
chainId: '0x3',
},
},
},
tokens: [
{
address: '0x1a195821297c7a80a433b6894d3bdb8824b43896',
decimals: 18,
symbol: 'ABC',
},
{
address: '0x8d6b81208414189a58339873ab429b6c47ab92d3',
decimals: 4,
symbol: 'DEF',
},
{
address: '0xa42084c8d1d9a2198631988579bb36b48433a72b',
decimals: 18,
symbol: 'GHI',
},
],
transactions: {},
currentNetworkTxList: [
{
id: 'mockTokenTx1',
txParams: {
to: '0x8d6b81208414189a58339873ab429b6c47ab92d3',
from: '0xd85a4b6a394794842887b8284293d69163007bbb',
},
time: 1700000000000,
},
{
id: 'mockTokenTx2',
txParams: {
to: '0xafaketokenaddress',
from: '0xd85a4b6a394794842887b8284293d69163007bbb',
},
time: 1600000000000,
},
{
id: 'mockTokenTx3',
txParams: {
to: '0x8d6b81208414189a58339873ab429b6c47ab92d3',
from: '0xd85a4b6a394794842887b8284293d69163007bbb',
},
time: 1500000000000,
},
{
id: 'mockEthTx1',
txParams: {
to: '0xd85a4b6a394794842887b8284293d69163007bbb',
from: '0xd85a4b6a394794842887b8284293d69163007bbb',
},
time: 1400000000000,
},
],
unapprovedMsgs: {
'0xabc': { id: 'unapprovedMessage1', time: 1650000000000 },
'0xdef': { id: 'unapprovedMessage2', time: 1550000000000 },
'0xghi': { id: 'unapprovedMessage3', time: 1450000000000 },
},
unapprovedMsgCount: 0,
unapprovedPersonalMsgs: {},
unapprovedPersonalMsgCount: 0,
unapprovedDecryptMsgs: {},
unapprovedDecryptMsgCount: 0,
unapprovedEncryptionPublicKeyMsgs: {},
unapprovedEncryptionPublicKeyMsgCount: 0,
keyringTypes: ['Simple Key Pair', 'HD Key Tree'],
keyrings: [
{
type: 'HD Key Tree',
accounts: [
'fdea65c8e26263f6d9a1b5de9555d2931a33b825',
'c5b8dbac4c1d3f152cdeb400e2313f309c410acb',
'2f8d4a878cfa04a6e60d46362f5644deab66572d',
],
},
{
type: 'Simple Key Pair',
accounts: ['0xd85a4b6a394794842887b8284293d69163007bbb'],
},
],
selectedAddress: '0xd85a4b6a394794842887b8284293d69163007bbb',
send: {
gasLimit: '0xFFFF',
gasPrice: '0xaa',
gasTotal: '0xb451dc41b578',
tokenBalance: 3434,
from: '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb',
to: '0x987fedabc',
amount: '0x080',
memo: '',
errors: {
someError: null,
},
maxModeOn: false,
editingTransactionId: 97531,
},
unapprovedTxs: {
4768706228115573: {
id: 4768706228115573,
time: 1487363153561,
status: TRANSACTION_STATUSES.UNAPPROVED,
gasMultiplier: 1,
metamaskNetworkId: '3',
txParams: {
from: '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb',
to: '0x18a3462427bcc9133bb46e88bcbe39cd7ef0e761',
value: '0xde0b6b3a7640000',
metamaskId: 4768706228115573,
metamaskNetworkId: '3',
gas: '0x5209',
},
txFee: '17e0186e60800',
txValue: 'de0b6b3a7640000',
maxCost: 'de234b52e4a0800',
gasPrice: '4a817c800',
},
},
currentLocale: 'en',
},
appState: {
menuOpen: false,
currentView: {
name: 'accountDetail',
detailView: null,
context: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc',
},
accountDetail: {
subview: 'transactions',
},
modal: {
modalState: {},
previousModalState: {},
},
isLoading: false,
warning: null,
scrollToBottom: false,
forgottenPassword: null,
},
send: {
fromDropdownOpen: false,
toDropdownOpen: false,
errors: { someError: null },
},
};
export default state;

@ -2,6 +2,41 @@
## Current Develop Branch ## Current Develop Branch
## 9.1.0 Mon Mar 01 2021
- [#10265](https://github.com/MetaMask/metamask-extension/pull/10265): Update Japanese translations.
- [#9388](https://github.com/MetaMask/metamask-extension/pull/9388): Update Chinese(Simplified) translations.
- [#10270](https://github.com/MetaMask/metamask-extension/pull/10270): Update Vietnamese translations.
- [#10258](https://github.com/MetaMask/metamask-extension/pull/10258): Update Spanish and Spanish(Latin American and Carribean) translations.
- [#10268](https://github.com/MetaMask/metamask-extension/pull/10268): Update Russian translations.
- [#10269](https://github.com/MetaMask/metamask-extension/pull/10269): Update Tagalog localized messages.
- [#10448](https://github.com/MetaMask/metamask-extension/pull/10448): Fix 'imported' translation use case for Dutch.
- [#10391](https://github.com/MetaMask/metamask-extension/pull/10391): Use translated transaction category for confirmations.
- [#10357](https://github.com/MetaMask/metamask-extension/pull/10357): Cancel unapproved confirmations on network change
- [#10413](https://github.com/MetaMask/metamask-extension/pull/10413): Use native currency in asset row.
- [#10421](https://github.com/MetaMask/metamask-extension/pull/10421): Fix color indicator size on connected site indicator.
- [#10423](https://github.com/MetaMask/metamask-extension/pull/10423): Fix multiple notification window prompts.
- [#10424](https://github.com/MetaMask/metamask-extension/pull/10424): Fix icons on token options menu.
- [#10414](https://github.com/MetaMask/metamask-extension/pull/10414): Fix token fiat conversion rates when switching from certain custom networks.
- [#10453](https://github.com/MetaMask/metamask-extension/pull/10453): Disable BUY button from home screen when not on Ethereum Mainnet.
- [#10465](https://github.com/MetaMask/metamask-extension/pull/10465): Fixes gas selection check mark on the notification view.
- [#10467](https://github.com/MetaMask/metamask-extension/pull/10467): Fix confirm page header with from/to addresses in fullscreen for tx confirmations.
- [#10455](https://github.com/MetaMask/metamask-extension/pull/10455): Hide links to etherscan when no block explorer is specified for a custom network for notifications.
- [#10456](https://github.com/MetaMask/metamask-extension/pull/10456): Fix swap insufficient balance error message.
- [#10350](https://github.com/MetaMask/metamask-extension/pull/10350): Fix encypt/decrypt tx queueing.
- [#10473](https://github.com/MetaMask/metamask-extension/pull/10473): Improve autofocus in the add network form.
- [#10444](https://github.com/MetaMask/metamask-extension/pull/10444): Use eth_gasprice for tx gas price estimation on non-Mainnet networks.
- [#10477](https://github.com/MetaMask/metamask-extension/pull/10477): Fix accountsChanged event not triggering when manually connecting.
- [#10471](https://github.com/MetaMask/metamask-extension/pull/10471): Fix navigation from jumping vertically when clicking into token.
- [#9724](https://github.com/MetaMask/metamask-extension/pull/9724): Add custom network RPC method.
- [#10496](https://github.com/MetaMask/metamask-extension/pull/10496): Eliminate artificial delay in swaps loading screen after request loading is complete.
- [#10501](https://github.com/MetaMask/metamask-extension/pull/10501): Ensure that swap approve tx and swap tx always have the same gas price.
- [#10485](https://github.com/MetaMask/metamask-extension/pull/10485): Fixes signTypedData message overflow.
- [#10525](https://github.com/MetaMask/metamask-extension/pull/10525): Update swaps failure message to include a support link.
- [#10521](https://github.com/MetaMask/metamask-extension/pull/10521): Accommodate for 0 sources verifying swap token
- [#10530](https://github.com/MetaMask/metamask-extension/pull/10530): Show warnings on Add Recipient page of Send flow
- [#9187](https://github.com/MetaMask/metamask-extension/pull/9187): Warn users when an ENS name contains 'confusable' characters
- [#10507](https://github.com/MetaMask/metamask-extension/pull/10507): Fixes ENS IPFS resolution on custom networks with the chainID of 1.
## 9.0.5 Mon Feb 08 2021 ## 9.0.5 Mon Feb 08 2021
- [#10278](https://github.com/MetaMask/metamask-extension/pull/10278): Allow editing transaction amount after clicking max - [#10278](https://github.com/MetaMask/metamask-extension/pull/10278): Allow editing transaction amount after clicking max
- [#10214](https://github.com/MetaMask/metamask-extension/pull/10214): Standardize size, shape and color of network color indicators - [#10214](https://github.com/MetaMask/metamask-extension/pull/10214): Standardize size, shape and color of network color indicators
@ -19,6 +54,7 @@
## 9.0.4 Fri Jan 22 2021 ## 9.0.4 Fri Jan 22 2021
- [#10285](https://github.com/MetaMask/metamask-extension/pull/10285): Update @metamask/contract-metadata from v1.21.0 to 1.22.0 - [#10285](https://github.com/MetaMask/metamask-extension/pull/10285): Update @metamask/contract-metadata from v1.21.0 to 1.22.0
- [#10264](https://github.com/MetaMask/metamask-extension/pull/10264): Update `hi` localized messages
- [#10174](https://github.com/MetaMask/metamask-extension/pull/10174): Move fox to bottom of 'About' page - [#10174](https://github.com/MetaMask/metamask-extension/pull/10174): Move fox to bottom of 'About' page
- [#10198](https://github.com/MetaMask/metamask-extension/pull/10198): Fix hardware account selection - [#10198](https://github.com/MetaMask/metamask-extension/pull/10198): Fix hardware account selection
- [#10101](https://github.com/MetaMask/metamask-extension/pull/10101): Add a timeout to all network requests - [#10101](https://github.com/MetaMask/metamask-extension/pull/10101): Add a timeout to all network requests

@ -9,7 +9,7 @@ For [general questions](https://metamask.zendesk.com/hc/en-us/community/topics/3
MetaMask supports Firefox, Google Chrome, and Chromium-based browsers. We recommend using the latest available browser version. MetaMask supports Firefox, Google Chrome, and Chromium-based browsers. We recommend using the latest available browser version.
For up to the minute news, follow our [Twitter](https://twitter.com/metamask_io) or [Medium](https://medium.com/metamask) pages. For up to the minute news, follow our [Twitter](https://twitter.com/metamask) or [Medium](https://medium.com/metamask) pages.
To learn how to develop MetaMask-compatible applications, visit our [Developer Docs](https://metamask.github.io/metamask-docs/). To learn how to develop MetaMask-compatible applications, visit our [Developer Docs](https://metamask.github.io/metamask-docs/).
@ -25,24 +25,49 @@ To learn how to contribute to the MetaMask project itself, visit our [Internal D
- Replace the `INFURA_PROJECT_ID` value with your own personal [Infura Project ID](https://infura.io/docs). - Replace the `INFURA_PROJECT_ID` value with your own personal [Infura Project ID](https://infura.io/docs).
- If debugging MetaMetrics, you'll need to add a value for `SEGMENT_WRITE_KEY` [Segment write key](https://segment.com/docs/connections/find-writekey/). - If debugging MetaMetrics, you'll need to add a value for `SEGMENT_WRITE_KEY` [Segment write key](https://segment.com/docs/connections/find-writekey/).
- Build the project to the `./dist/` folder with `yarn dist`. - Build the project to the `./dist/` folder with `yarn dist`.
- Optionally, to start a development build (e.g. with logging and file watching) run `yarn start` instead.
- To start the [React DevTools](https://github.com/facebook/react-devtools) and [Redux DevTools Extension](http://extension.remotedev.io) Uncompressed builds can be found in `/dist`, compressed builds can be found in `/builds` once they're built.
## Contributing
### Development builds
To start a development build (e.g. with logging and file watching) run `yarn start`.
To start the [React DevTools](https://github.com/facebook/react-devtools) and [Redux DevTools Extension](http://extension.remotedev.io)
alongside the app, use `yarn start:dev`. alongside the app, use `yarn start:dev`.
- React DevTools will open in a separate window; no browser extension is required - React DevTools will open in a separate window; no browser extension is required
- Redux DevTools will need to be installed as a browser extension. Open the Redux Remote Devtools to access Redux state logs. This can be done by either right clicking within the web browser to bring up the context menu, expanding the Redux DevTools panel and clicking Open Remote DevTools OR clicking the Redux DevTools extension icon and clicking Open Remote DevTools. - Redux DevTools will need to be installed as a browser extension. Open the Redux Remote Devtools to access Redux state logs. This can be done by either right clicking within the web browser to bring up the context menu, expanding the Redux DevTools panel and clicking Open Remote DevTools OR clicking the Redux DevTools extension icon and clicking Open Remote DevTools.
- You will also need to check the "Use custom (local) server" checkbox in the Remote DevTools Settings, using the default server configuration (host `localhost`, port `8000`, secure connection checkbox unchecked) - You will also need to check the "Use custom (local) server" checkbox in the Remote DevTools Settings, using the default server configuration (host `localhost`, port `8000`, secure connection checkbox unchecked)
Uncompressed builds can be found in `/dist`, compressed builds can be found in `/builds` once they're built. ### Running Unit Tests and Linting
## Contributing Run unit tests and the linter with `yarn test`.
To run just unit tests, run `yarn test:unit`. To run unit tests continuously with a file watcher, run `yarn watch`.
You can run the linter by itself with `yarn lint`, and you can automatically fix some lint problems with `yarn lint:fix`. You can also run these two commands just on your local changes to save time with `yarn lint:changed` and `yarn lint:changed:fix` respectively.
### Running E2E Tests
Our e2e test suite can be run on either Firefox or Chrome. In either case, start by creating a test build by running `yarn build:test`.
Firefox e2e tests can be run with `yarn test:e2e:firefox`.
### Running Tests Chrome e2e tests can be run with `yarn test:e2e:chrome`, but they will only work if you have Chrome v79 installed. Update the `chromedriver` package to a version matching your local Chrome installation to run e2e tests on newer Chrome versions.
Run tests with `yarn test`. ### Changing dependencies
You can also test with a continuously watching process, via `yarn watch`. Whenever you change dependencies (adding, removing, or updating, either in `package.json` or `yarn.lock`), there are various files that must be kept up-to-date.
You can run the linter by itself with `yarn lint`. * `yarn.lock`:
* Run `yarn setup` again after your changes to ensure `yarn.lock` has been properly updated.
* The `allow-scripts` configuration in `package.json`
* Run `yarn allow-scripts auto` to update the `allow-scripts` configuration automatically. This config determines whether the package's install/postinstall scripts are allowed to run. Review each new package to determine whether the install script needs to run or not, testing if necessary.
* Unfortunately, `yarn allow-scripts auto` will behave inconsistently on different platforms. macOS and Windows users may see extraneous changes relating to optional dependencies.
* The LavaMoat auto-generated policy in `lavamoat/node/policy.json`
* Run `yarn lavamoat:auto` to re-generate this policy file. Review the changes to determine whether the access granted to each package seems appropriate.
* Unfortunately, `yarn lavamoat:auto` will behave inconsistently on different platforms. macOS and Windows users may see extraneous changes relating to optional dependencies.
## Architecture ## Architecture

@ -928,18 +928,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "መለያውን በ MetaMask ለማየት ይምረጡ" "message": "መለያውን በ MetaMask ለማየት ይምረጡ"
}, },
"selectCurrency": {
"message": "የገንዘብ ዓይነት ይምረጡ"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "እባክዎ እያንዳንዱን ሐረግ በመምረጥ ትክክለኛነቱን ያረጋግጡ።" "message": "እባክዎ እያንዳንዱን ሐረግ በመምረጥ ትክክለኛነቱን ያረጋግጡ።"
}, },
"selectHdPath": { "selectHdPath": {
"message": "የ HD ዱካ ይምረጡ" "message": "የ HD ዱካ ይምረጡ"
}, },
"selectLocale": {
"message": "አካባቢ ይምረጡ"
},
"selectPathHelp": { "selectPathHelp": {
"message": "ነባር የሌጄር መለያዎችን ከታች ካላዩ፣ ዱካዎችን ወደ \"Legacy (MEW / MyCrypto)\" ለመቀየር ይሞክሩ" "message": "ነባር የሌጄር መለያዎችን ከታች ካላዩ፣ ዱካዎችን ወደ \"Legacy (MEW / MyCrypto)\" ለመቀየር ይሞክሩ"
}, },

@ -924,18 +924,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "حدد الحساب لعرضه في MetaMask" "message": "حدد الحساب لعرضه في MetaMask"
}, },
"selectCurrency": {
"message": "تحديد العملة"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": ُرجى تحديد كل عبارة للتأكد من صحتها." "message": ُرجى تحديد كل عبارة للتأكد من صحتها."
}, },
"selectHdPath": { "selectHdPath": {
"message": "حدد مسار HD " "message": "حدد مسار HD "
}, },
"selectLocale": {
"message": "تحديد الموقع المحلي"
},
"selectPathHelp": { "selectPathHelp": {
"message": "إذا لم تشاهد حسابات Ledger الحالية الخاصة بك أدناه، فحاول تبديل المسارات \"Legacy (MEW / MyCrypto)\"" "message": "إذا لم تشاهد حسابات Ledger الحالية الخاصة بك أدناه، فحاول تبديل المسارات \"Legacy (MEW / MyCrypto)\""
}, },

@ -927,18 +927,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Изберете акаунта за преглед в MetaMask" "message": "Изберете акаунта за преглед в MetaMask"
}, },
"selectCurrency": {
"message": "Изберете валута"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Моля, изберете всяка фраза, за да се уверите, че е правилна." "message": "Моля, изберете всяка фраза, за да се уверите, че е правилна."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Изберете HD Path" "message": "Изберете HD Path"
}, },
"selectLocale": {
"message": "Изберете местоположение"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Ако не виждате съществуващите си акаунти в Ledger по-долу, опитайте да превключите пътеки към „Legacy (MEW / MyCrypto)“" "message": "Ако не виждате съществуващите си акаунти в Ledger по-долу, опитайте да превключите пътеки към „Legacy (MEW / MyCrypto)“"
}, },

@ -931,18 +931,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "MetaMask এ দখতউনটটিিচন করন" "message": "MetaMask এ দখতউনটটিিচন করন"
}, },
"selectCurrency": {
"message": "কিিচন করন"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "ফজগি সঠিক তিিত করত অনরহ কররতিিজ নিচন করন।" "message": "ফজগি সঠিক তিিত করত অনরহ কররতিিজ নিচন করন।"
}, },
"selectHdPath": { "selectHdPath": {
"message": "HD পথ নিচন করন" "message": "HD পথ নিচন করন"
}, },
"selectLocale": {
"message": "সয় নিচন করন"
},
"selectPathHelp": { "selectPathHelp": {
"message": "আপনিি আপনর বিযমন লর বস নখল, \"Legacy (MEW / MyCrypto)\" পথগিইচ করর চ করন " "message": "আপনিি আপনর বিযমন লর বস নখল, \"Legacy (MEW / MyCrypto)\" পথগিইচ করর চ করন "
}, },

@ -909,18 +909,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Selecciona el compte que vols veure a MetaMask" "message": "Selecciona el compte que vols veure a MetaMask"
}, },
"selectCurrency": {
"message": "Selecciona divisa"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Si us plau selecciona cada frase per a assegurar-te que és correcta." "message": "Si us plau selecciona cada frase per a assegurar-te que és correcta."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Selecciona Ruta HD" "message": "Selecciona Ruta HD"
}, },
"selectLocale": {
"message": "Selecciona Configuració Regional"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Si no veus els teus comptes Ledger a sota, prova canviant la ruta a \"Legacy (MEW / MyCrypto)\"" "message": "Si no veus els teus comptes Ledger a sota, prova canviant la ruta a \"Legacy (MEW / MyCrypto)\""
}, },

@ -350,9 +350,6 @@
"seedPhraseReq": { "seedPhraseReq": {
"message": "klíčové fráze mají 12 slov" "message": "klíčové fráze mají 12 slov"
}, },
"selectCurrency": {
"message": "Vybrat měnu"
},
"selectType": { "selectType": {
"message": "Vybrat typ" "message": "Vybrat typ"
}, },

@ -912,18 +912,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Vælg kontoen der skal vises i MetaMask" "message": "Vælg kontoen der skal vises i MetaMask"
}, },
"selectCurrency": {
"message": "Vælg valuta"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Vælg venligst hver sætning, for at sikre at de er korrekte." "message": "Vælg venligst hver sætning, for at sikre at de er korrekte."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Vælg HD-Sti" "message": "Vælg HD-Sti"
}, },
"selectLocale": {
"message": "Vælg Lokalitet"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Hvis du ikke ser dine eksisterende Ledger-konti nedenfor, kan du prøve at skifte til \"Legacy (MEW / MyCrypto)\"" "message": "Hvis du ikke ser dine eksisterende Ledger-konti nedenfor, kan du prøve at skifte til \"Legacy (MEW / MyCrypto)\""
}, },

@ -900,18 +900,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Wählen Sie das Konto aus, das in MetaMask angezeigt werden soll." "message": "Wählen Sie das Konto aus, das in MetaMask angezeigt werden soll."
}, },
"selectCurrency": {
"message": "Währung auswählen"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Bitte wählen Sie jede Phrase aus, um sicherzustellen, dass sie korrekt ist." "message": "Bitte wählen Sie jede Phrase aus, um sicherzustellen, dass sie korrekt ist."
}, },
"selectHdPath": { "selectHdPath": {
"message": "HD-Pfad auswählen" "message": "HD-Pfad auswählen"
}, },
"selectLocale": {
"message": "Gebietsschema auswählen"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Wenn Sie Ihre bestehenden Ledger-Konten nachfolgend nicht sehen, versuchen Sie, die Pfade zu \"Legacy (MEW / MyCrypto)\" zu ändern" "message": "Wenn Sie Ihre bestehenden Ledger-Konten nachfolgend nicht sehen, versuchen Sie, die Pfade zu \"Legacy (MEW / MyCrypto)\" zu ändern"
}, },

@ -928,18 +928,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Επιλέξτε τον λογαριασμό για προβολή στο MetaMask" "message": "Επιλέξτε τον λογαριασμό για προβολή στο MetaMask"
}, },
"selectCurrency": {
"message": "Επιλέξτε Νόμισμα"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Παρακαλούμε επιλέξτε κάθε φράση, για να βεβαιωθείτε ότι είναι σωστή." "message": "Παρακαλούμε επιλέξτε κάθε φράση, για να βεβαιωθείτε ότι είναι σωστή."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Επιλέξτε Διαδρομή HD" "message": "Επιλέξτε Διαδρομή HD"
}, },
"selectLocale": {
"message": "Επιλέξτε Τοπικές Ρυθμίσεις"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Εάν δεν βλέπετε τους υπάρχοντες λογαριασμούς σας Καθολικού παρακάτω, προσπαθήστε να αλλάξετε τις διαδρομές σε \"Legacy (MEW / MyCrypto)\"" "message": "Εάν δεν βλέπετε τους υπάρχοντες λογαριασμούς σας Καθολικού παρακάτω, προσπαθήστε να αλλάξετε τις διαδρομές σε \"Legacy (MEW / MyCrypto)\""
}, },

@ -52,6 +52,23 @@
"addAlias": { "addAlias": {
"message": "Add alias" "message": "Add alias"
}, },
"addEthereumChainConfirmationDescription": {
"message": "This will allow this network to be used within MetaMask."
},
"addEthereumChainConfirmationRisks": {
"message": "MetaMask does not verify custom networks."
},
"addEthereumChainConfirmationRisksLearnMore": {
"message": "Learn about $1.",
"description": "$1 is a link with text that is provided by the 'addEthereumChainConfirmationRisksLearnMoreLink' key"
},
"addEthereumChainConfirmationRisksLearnMoreLink": {
"message": "scams and network security risks",
"description": "Link text for the 'addEthereumChainConfirmationRisksLearnMore' translation key"
},
"addEthereumChainConfirmationTitle": {
"message": "Allow this site to add a network?"
},
"addNetwork": { "addNetwork": {
"message": "Add Network" "message": "Add Network"
}, },
@ -150,6 +167,9 @@
"approve": { "approve": {
"message": "Approve spend limit" "message": "Approve spend limit"
}, },
"approveButtonText": {
"message": "Approve"
},
"approveSpendLimit": { "approveSpendLimit": {
"message": "Approve $1 spend limit", "message": "Approve $1 spend limit",
"description": "The token symbol that is being approved" "description": "The token symbol that is being approved"
@ -212,7 +232,10 @@
"message": "Basic" "message": "Basic"
}, },
"blockExplorerUrl": { "blockExplorerUrl": {
"message": "Block Explorer" "message": "Block Explorer URL"
},
"blockExplorerUrlDefinition": {
"message": "The URL used as the block explorer for this network."
}, },
"blockExplorerView": { "blockExplorerView": {
"message": "View account at $1", "message": "View account at $1",
@ -254,6 +277,9 @@
"chainId": { "chainId": {
"message": "Chain ID" "message": "Chain ID"
}, },
"chainIdDefinition": {
"message": "The chain ID used to sign transactions for this network."
},
"chromeRequiredForHardwareWallets": { "chromeRequiredForHardwareWallets": {
"message": "You need to use MetaMask on Google Chrome in order to connect to your Hardware Wallet." "message": "You need to use MetaMask on Google Chrome in order to connect to your Hardware Wallet."
}, },
@ -275,6 +301,15 @@
"confirmed": { "confirmed": {
"message": "Confirmed" "message": "Confirmed"
}, },
"confusableUnicode": {
"message": "'$1' is similar to '$2'."
},
"confusableZeroWidthUnicode": {
"message": "Zero-width character found."
},
"confusingEnsDomain": {
"message": "We have detected a confusable character in the ENS name. Check the ENS name to avoid a potential scam."
},
"congratulations": { "congratulations": {
"message": "Congratulations" "message": "Congratulations"
}, },
@ -409,6 +444,12 @@
"currencyConversion": { "currencyConversion": {
"message": "Currency Conversion" "message": "Currency Conversion"
}, },
"currencySymbol": {
"message": "Currency Symbol"
},
"currencySymbolDefinition": {
"message": "The ticker symbol displayed for this network’s currency."
},
"currentAccountNotConnected": { "currentAccountNotConnected": {
"message": "Your current account is not connected" "message": "Your current account is not connected"
}, },
@ -1005,6 +1046,14 @@
"metametricsOptInDescription": { "metametricsOptInDescription": {
"message": "MetaMask would like to gather usage data to better understand how our users interact with the extension. This data will be used to continually improve the usability and user experience of our product and the Ethereum ecosystem." "message": "MetaMask would like to gather usage data to better understand how our users interact with the extension. This data will be used to continually improve the usability and user experience of our product and the Ethereum ecosystem."
}, },
"mismatchedChain": {
"message": "This network details for this Chain ID do not match our records. We recommend that you $1 before proceeding.",
"description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key"
},
"mismatchedChainLinkText": {
"message": "verify the network details",
"description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key."
},
"mobileSyncText": { "mobileSyncText": {
"message": "Please enter your password to confirm it's you!" "message": "Please enter your password to confirm it's you!"
}, },
@ -1030,15 +1079,27 @@
"negativeETH": { "negativeETH": {
"message": "Can not send negative amounts of ETH." "message": "Can not send negative amounts of ETH."
}, },
"networkDetails": {
"message": "Network Details"
},
"networkName": { "networkName": {
"message": "Network Name" "message": "Network Name"
}, },
"networkNameDefinition": {
"message": "The name associated with this network."
},
"networkSettingsChainIdDescription": { "networkSettingsChainIdDescription": {
"message": "The chain ID is used for signing transactions. It must match the chain ID returned by the network. You can enter a decimal or '0x'-prefixed hexadecimal number, but we will display the number in decimal." "message": "The chain ID is used for signing transactions. It must match the chain ID returned by the network. You can enter a decimal or '0x'-prefixed hexadecimal number, but we will display the number in decimal."
}, },
"networkSettingsDescription": { "networkSettingsDescription": {
"message": "Add and edit custom RPC networks" "message": "Add and edit custom RPC networks"
}, },
"networkURL": {
"message": "Network URL"
},
"networkURLDefinition": {
"message": "The URL used to access this network."
},
"networks": { "networks": {
"message": "Networks" "message": "Networks"
}, },
@ -1418,18 +1479,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Select the account to view in MetaMask" "message": "Select the account to view in MetaMask"
}, },
"selectCurrency": {
"message": "Select Currency"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Please select each phrase in order to make sure it is correct." "message": "Please select each phrase in order to make sure it is correct."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Select HD Path" "message": "Select HD Path"
}, },
"selectLocale": {
"message": "Select Locale"
},
"selectPathHelp": { "selectPathHelp": {
"message": "If you don't see your existing Ledger accounts below, try switching paths to \"Legacy (MEW / MyCrypto)\"" "message": "If you don't see your existing Ledger accounts below, try switching paths to \"Legacy (MEW / MyCrypto)\""
}, },
@ -1657,8 +1712,9 @@
"swapEstimatedNetworkFeesInfo": { "swapEstimatedNetworkFeesInfo": {
"message": "This is an estimate of the network fee that will be used to complete your swap. The actual amount may change according to network conditions." "message": "This is an estimate of the network fee that will be used to complete your swap. The actual amount may change according to network conditions."
}, },
"swapFailedErrorDescription": { "swapFailedErrorDescriptionWithSupportLink": {
"message": "Your funds are safe and still available in your wallet." "message": "Transaction failures happen and we are here to help. If this issue persists, you can reach our customer support at $1 for further assistance.",
"description": "This message is shown to a user if their swap fails. The $1 will be replaced by support.metamask.io"
}, },
"swapFailedErrorTitle": { "swapFailedErrorTitle": {
"message": "Swap failed" "message": "Swap failed"
@ -1841,6 +1897,10 @@
"message": "Your $1 has been added to your account.", "message": "Your $1 has been added to your account.",
"description": "This message is shown after a swap is successful and communicates the exact amount of tokens the user has received for a swap. The $1 is a decimal number of tokens followed by the token symbol." "description": "This message is shown after a swap is successful and communicates the exact amount of tokens the user has received for a swap. The $1 is a decimal number of tokens followed by the token symbol."
}, },
"swapTokenBalanceUnavailable": {
"message": "We were unable to retrieve your $1 balance",
"description": "This message communicates to the user that their balance of a given token is currently unavailable. $1 will be replaced by a token symbol"
},
"swapTokenToToken": { "swapTokenToToken": {
"message": "Swap $1 to $2", "message": "Swap $1 to $2",
"description": "Used in the transaction display list to describe a swap. $1 and $2 are the symbols of tokens in involved in a swap." "description": "Used in the transaction display list to describe a swap. $1 and $2 are the symbols of tokens in involved in a swap."
@ -1849,6 +1909,9 @@
"message": "Always confirm the token address on $1.", "message": "Always confirm the token address on $1.",
"description": "Points the user to Etherscan as a place they can verify information about a token. $1 is replaced with the translation for \"Etherscan\" followed by an info icon that shows more info on hover." "description": "Points the user to Etherscan as a place they can verify information about a token. $1 is replaced with the translation for \"Etherscan\" followed by an info icon that shows more info on hover."
}, },
"swapTokenVerificationNoSource": {
"message": "This token has not been verified."
},
"swapTokenVerificationOnlyOneSource": { "swapTokenVerificationOnlyOneSource": {
"message": "Only verified on 1 source." "message": "Only verified on 1 source."
}, },
@ -1894,12 +1957,24 @@
"swapsViewInActivity": { "swapsViewInActivity": {
"message": "View in activity" "message": "View in activity"
}, },
"switchEthereumChainConfirmationDescription": {
"message": "This will switch the selected network within MetaMask to a previously added network:"
},
"switchEthereumChainConfirmationTitle": {
"message": "Allow this site to switch the network?"
},
"switchNetwork": {
"message": "Switch network"
},
"switchNetworks": { "switchNetworks": {
"message": "Switch Networks" "message": "Switch Networks"
}, },
"switchToThisAccount": { "switchToThisAccount": {
"message": "Switch to this account" "message": "Switch to this account"
}, },
"switchingNetworksCancelsPendingConfirmations": {
"message": "Switching networks will cancel all pending confirmations"
},
"symbol": { "symbol": {
"message": "Symbol" "message": "Symbol"
}, },
@ -2075,6 +2150,14 @@
"unlockMessage": { "unlockMessage": {
"message": "The decentralized web awaits" "message": "The decentralized web awaits"
}, },
"unrecognizedChain": {
"message": "This custom network is not recognized. We recommend that you $1 before proceeding",
"description": "$1 is a clickable link with text defined by the 'unrecognizedChanLinkText' key. The link will open to instructions for users to validate custom network details."
},
"unrecognizedChainLinkText": {
"message": "verify the network details",
"description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key."
},
"updatedWithDate": { "updatedWithDate": {
"message": "Updated $1" "message": "Updated $1"
}, },
@ -2147,6 +2230,10 @@
"message": "$1 of $2", "message": "$1 of $2",
"description": "$1 and $2 are intended to be two numbers, where $2 is a total, and $1 is a count towards that total" "description": "$1 and $2 are intended to be two numbers, where $2 is a total, and $1 is a count towards that total"
}, },
"xOfYPending": {
"message": "$1 of $2 pending",
"description": "$1 and $2 are intended to be two numbers, where $2 is a total number of pending confirmations, and $1 is a count towards that total"
},
"yesLetsTry": { "yesLetsTry": {
"message": "Yes, let's try" "message": "Yes, let's try"
}, },

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -921,18 +921,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Valige konto, mida MetaMaskis vaadata" "message": "Valige konto, mida MetaMaskis vaadata"
}, },
"selectCurrency": {
"message": "Valitud valuuta"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Valige iga fraas, veendumaks, et see on õige." "message": "Valige iga fraas, veendumaks, et see on õige."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Valige HD-teekond" "message": "Valige HD-teekond"
}, },
"selectLocale": {
"message": "Valige Lokaat"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Kui te ei näe allpool oma olemasolevaid pearaamatu kontosid, vahetage tee kohta \"Legacy (MEW/MyCrypto)\"" "message": "Kui te ei näe allpool oma olemasolevaid pearaamatu kontosid, vahetage tee kohta \"Legacy (MEW/MyCrypto)\""
}, },

@ -931,18 +931,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "برای مشاهده MetaMask حساب را انتخاب نمایید" "message": "برای مشاهده MetaMask حساب را انتخاب نمایید"
}, },
"selectCurrency": {
"message": "واحد پول را انتخاب کنید"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "لطفًا جهت اطمینان از درستی، هر عبارت را انتخاب کنید." "message": "لطفًا جهت اطمینان از درستی، هر عبارت را انتخاب کنید."
}, },
"selectHdPath": { "selectHdPath": {
"message": "انتخاب مسیر HD" "message": "انتخاب مسیر HD"
}, },
"selectLocale": {
"message": "محل را انتخاب کنید"
},
"selectPathHelp": { "selectPathHelp": {
"message": "در صورتیکه شما حساب های موجود دفتر حساب را در ذیل نمیبینید، مسیر ها به \"Legacy (MEW / MyCrypto)\"  تغییر دهید" "message": "در صورتیکه شما حساب های موجود دفتر حساب را در ذیل نمیبینید، مسیر ها به \"Legacy (MEW / MyCrypto)\"  تغییر دهید"
}, },

@ -928,18 +928,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Valitse MetaMaskissa näytettävä tili" "message": "Valitse MetaMaskissa näytettävä tili"
}, },
"selectCurrency": {
"message": "Valitse valuutta"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Ole hyvä ja valitse jokainen teksti järjestyksessä varmistaaksesi, että se on oikein." "message": "Ole hyvä ja valitse jokainen teksti järjestyksessä varmistaaksesi, että se on oikein."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Valitse HD-polku" "message": "Valitse HD-polku"
}, },
"selectLocale": {
"message": "Valitse kielialue"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Jos et näe nykyisiä Ledger-tilejäsi tämän alla, koeta vaihtaa poluksi ”Vanha (MEW / MyCrypto)”" "message": "Jos et näe nykyisiä Ledger-tilejäsi tämän alla, koeta vaihtaa poluksi ”Vanha (MEW / MyCrypto)”"
}, },

@ -843,18 +843,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Piliin ang account na titingnan sa MetaMask" "message": "Piliin ang account na titingnan sa MetaMask"
}, },
"selectCurrency": {
"message": "Pumili ng Currency"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Pakipili ang bawat parirala para tiyaking tama ito." "message": "Pakipili ang bawat parirala para tiyaking tama ito."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Piliin ang HD Path" "message": "Piliin ang HD Path"
}, },
"selectLocale": {
"message": "Pumili ng Locale"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Kung hindi mo makita ang kasalukuyan mong mga Ledger account sa ibaba, subukang ilipat ang mga path sa \"Legacy (MEW / MyCrypto)\"" "message": "Kung hindi mo makita ang kasalukuyan mong mga Ledger account sa ibaba, subukang ilipat ang mga path sa \"Legacy (MEW / MyCrypto)\""
}, },

@ -913,18 +913,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Selectionner le compte à afficher dans MetaMask" "message": "Selectionner le compte à afficher dans MetaMask"
}, },
"selectCurrency": {
"message": "Selectionner Devise"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Veuillez sélectionner chaque phrase afin de vous assurer qu'elle est correcte." "message": "Veuillez sélectionner chaque phrase afin de vous assurer qu'elle est correcte."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Selectioner le \"Path HD\"" "message": "Selectioner le \"Path HD\""
}, },
"selectLocale": {
"message": "Selectionner la localisation"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Si vos comptes Ledger n'apparaissent pas ci-dessous, essayez de selectionner le path \"Legacy (MEW / MyCrypto)\"" "message": "Si vos comptes Ledger n'apparaissent pas ci-dessous, essayez de selectionner le path \"Legacy (MEW / MyCrypto)\""
}, },

@ -925,18 +925,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "בחר את החשבון לצפייה ב- MetaMask" "message": "בחר את החשבון לצפייה ב- MetaMask"
}, },
"selectCurrency": {
"message": "בחר מטבע"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "נא לבחור כל צירוף מילים כדי להבטיח שהוא נכון." "message": "נא לבחור כל צירוף מילים כדי להבטיח שהוא נכון."
}, },
"selectHdPath": { "selectHdPath": {
"message": "בחר/י נתיב HD" "message": "בחר/י נתיב HD"
}, },
"selectLocale": {
"message": "בחר/י מיקום"
},
"selectPathHelp": { "selectPathHelp": {
"message": "אם אינך רואה את חשבונות ה-Ledger הקיימים שלך בהמשך, נסה/י להחליף נתיב ל-Legacy (MEW / MyCrypto)" "message": "אם אינך רואה את חשבונות ה-Ledger הקיימים שלך בהמשך, נסה/י להחליף נתיב ל-Legacy (MEW / MyCrypto)"
}, },

@ -1403,18 +1403,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "MetaMask मखनिए ख चयन कर" "message": "MetaMask मखनिए ख चयन कर"
}, },
"selectCurrency": {
"message": "म चयन कर"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "कपयरतक वश क चयन कर, ति यह सिित ह सकि यह सह।" "message": "कपयरतक वश क चयन कर, ति यह सिित ह सकि यह सह।"
}, },
"selectHdPath": { "selectHdPath": {
"message": "HD पथ क चयन कर" "message": "HD पथ क चयन कर"
}, },
"selectLocale": {
"message": "लल क चयन कर"
},
"selectPathHelp": { "selectPathHelp": {
"message": "यदि आपक अपनजर ख नहिई द, त पथ क \"Legacy (MEW / MyCrypto)\" पर सिच करनरयस कर" "message": "यदि आपक अपनजर ख नहिई द, त पथ क \"Legacy (MEW / MyCrypto)\" पर सिच करनरयस कर"
}, },
@ -1639,9 +1633,6 @@
"swapEstimatedNetworkFeesInfo": { "swapEstimatedNetworkFeesInfo": {
"message": "यह नटवरक शक क एक अनन ह, जि आपकप क करनिए उपयग किएग। नटवरक किि अनर वतविक रि बदल सकत।" "message": "यह नटवरक शक क एक अनन ह, जि आपकप क करनिए उपयग किएग। नटवरक किि अनर वतविक रि बदल सकत।"
}, },
"swapFailedErrorDescription": {
"message": "आपक धन सरकित ह और अभ आपकट म उपलबध ह।"
},
"swapFailedErrorTitle": { "swapFailedErrorTitle": {
"message": "सप विफल रह" "message": "सप विफल रह"
}, },

@ -330,9 +330,6 @@
"seedPhraseReq": { "seedPhraseReq": {
"message": "बज वश 12 शबद ल" "message": "बज वश 12 शबद ल"
}, },
"selectCurrency": {
"message": "म"
},
"selectType": { "selectType": {
"message": "परकर च" "message": "परकर च"
}, },

@ -924,18 +924,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Odaberi račun za prikaz u usluzi MetaMask" "message": "Odaberi račun za prikaz u usluzi MetaMask"
}, },
"selectCurrency": {
"message": "Odaberite valutu"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Odaberite svaku rečenicu kako biste provjerili je li točna." "message": "Odaberite svaku rečenicu kako biste provjerili je li točna."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Odaberi put HD-a" "message": "Odaberi put HD-a"
}, },
"selectLocale": {
"message": "Odaberi lokalnu postavku"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Ako ne vidite u nastavku postojeće račune Ledger, pokušajte promijeniti puteve na „Nasljeđe (MEW / MyCrypto)”" "message": "Ako ne vidite u nastavku postojeće račune Ledger, pokušajte promijeniti puteve na „Nasljeđe (MEW / MyCrypto)”"
}, },

@ -573,15 +573,9 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Chwazi kont pou wè nan MetaMask" "message": "Chwazi kont pou wè nan MetaMask"
}, },
"selectCurrency": {
"message": "Chwazi Lajan"
},
"selectHdPath": { "selectHdPath": {
"message": "Chwazi chemen HD" "message": "Chwazi chemen HD"
}, },
"selectLocale": {
"message": "Chwazi Lokasyon"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Si ou pa wè kont Ledger ou te genyen an anba a, eseye chanje chemen an \"Eritaj (MEW / MyCrypto)\"" "message": "Si ou pa wè kont Ledger ou te genyen an anba a, eseye chanje chemen an \"Eritaj (MEW / MyCrypto)\""
}, },

@ -924,18 +924,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Válássza ki a MetaMask-ban megtekinteni kívánt fiókot" "message": "Válássza ki a MetaMask-ban megtekinteni kívánt fiókot"
}, },
"selectCurrency": {
"message": "Válasszon valutát"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Kérjük, válassza ki az egyes mondatokat, hogy meggyőződjön azok helyességéről. " "message": "Kérjük, válassza ki az egyes mondatokat, hogy meggyőződjön azok helyességéről. "
}, },
"selectHdPath": { "selectHdPath": {
"message": "Válassz HD elérési útvonalat" "message": "Válassz HD elérési útvonalat"
}, },
"selectLocale": {
"message": "Válaszd ki a területi beállítást"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Ha nem láthatók alább Ledger számláid, próbáld kicserélni az elérési útvonalat: „Legacy (MEW / MyCypto)”" "message": "Ha nem láthatók alább Ledger számláid, próbáld kicserélni az elérési útvonalat: „Legacy (MEW / MyCypto)”"
}, },

@ -1403,18 +1403,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Pilih akun untuk dilihat di MetaMask" "message": "Pilih akun untuk dilihat di MetaMask"
}, },
"selectCurrency": {
"message": "Pilih Mata Uang"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Pilih masing-masing frasa untuk memastikan kebenarannya." "message": "Pilih masing-masing frasa untuk memastikan kebenarannya."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Pilih Jalur HD" "message": "Pilih Jalur HD"
}, },
"selectLocale": {
"message": "Pilih Lokal"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Jika Anda tidak melihat akun Ledger Anda yang ada di bawah, coba untuk beralih jalur ke \"Warisan (MEW / MyCrypto)\"" "message": "Jika Anda tidak melihat akun Ledger Anda yang ada di bawah, coba untuk beralih jalur ke \"Warisan (MEW / MyCrypto)\""
}, },
@ -1639,9 +1633,6 @@
"swapEstimatedNetworkFeesInfo": { "swapEstimatedNetworkFeesInfo": {
"message": "Ini adalah perkiraan biaya jaringan yang akan digunakan untuk menyelesaikan penukaran Anda. Jumlah aktual dapat berubah sesuai dengan kondisi jaringan." "message": "Ini adalah perkiraan biaya jaringan yang akan digunakan untuk menyelesaikan penukaran Anda. Jumlah aktual dapat berubah sesuai dengan kondisi jaringan."
}, },
"swapFailedErrorDescription": {
"message": "Dana Anda aman dan masih tersedia di dompet Anda."
},
"swapFailedErrorTitle": { "swapFailedErrorTitle": {
"message": "Penukaran gagal" "message": "Penukaran gagal"
}, },

@ -50,6 +50,7 @@
{ "code": "ta", "name": "தமி" }, { "code": "ta", "name": "தமி" },
{ "code": "te", "name": "త" }, { "code": "te", "name": "త" },
{ "code": "th", "name": "ไทย" }, { "code": "th", "name": "ไทย" },
{ "code": "tl", "name": "Wikang Tagalog" },
{ "code": "tr", "name": "Türkçe" }, { "code": "tr", "name": "Türkçe" },
{ "code": "uk", "name": "Українська мова" }, { "code": "uk", "name": "Українська мова" },
{ "code": "vi", "name": "Tiếng Việt" }, { "code": "vi", "name": "Tiếng Việt" },

@ -1294,18 +1294,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Selezione l'account da visualizzare in MetaMask" "message": "Selezione l'account da visualizzare in MetaMask"
}, },
"selectCurrency": {
"message": "Seleziona Moneta"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Per favore seleziona ogni frase in ordine per assicurarti che sia corretta." "message": "Per favore seleziona ogni frase in ordine per assicurarti che sia corretta."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Seleziona Percorso HD" "message": "Seleziona Percorso HD"
}, },
"selectLocale": {
"message": "Selezione Lingua"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Se non vedi il tuo account Ledger esistente di seguito, prova a cambiare il percorso in \"Legacy (MEW / MyCrypto)\"" "message": "Se non vedi il tuo account Ledger esistente di seguito, prova a cambiare il percorso in \"Legacy (MEW / MyCrypto)\""
}, },

File diff suppressed because it is too large Load Diff

@ -931,18 +931,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "MetaMask ನಲಿಿಸಲಯನ ಆಯಿ" "message": "MetaMask ನಲಿಿಸಲಯನ ಆಯಿ"
}, },
"selectCurrency": {
"message": "ಕರಿಯನ ಆಯಿ"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "ಅದ ಸರಿಿದನ ಖಚಿತಪಡಿಿಳಲ ದಯವಿರತಿ ಅನ ಆಯಿ." "message": "ಅದ ಸರಿಿದನ ಖಚಿತಪಡಿಿಳಲ ದಯವಿರತಿ ಅನ ಆಯಿ."
}, },
"selectHdPath": { "selectHdPath": {
"message": "HD ಪ ಆಯಿ" "message": "HD ಪ ಆಯಿ"
}, },
"selectLocale": {
"message": "ಪರದಶವನ ಆಯಿ"
},
"selectPathHelp": { "selectPathHelp": {
"message": "ನಿಮ ಅಸಿವದಲಿವ ಲಜರಗಳನಳಗಡದಿದರ, ಪಗಳನ \"ಲಗಸಿ (MEW / MyCrypto)\" ಗ ಬದಲಿಸಲರಯತಿಿ" "message": "ನಿಮ ಅಸಿವದಲಿವ ಲಜರಗಳನಳಗಡದಿದರ, ಪಗಳನ \"ಲಗಸಿ (MEW / MyCrypto)\" ಗ ಬದಲಿಸಲರಯತಿಿ"
}, },

@ -1403,18 +1403,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "MetaMask에서 확인할 계정 선택" "message": "MetaMask에서 확인할 계정 선택"
}, },
"selectCurrency": {
"message": "통화 선택"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "각 구문을 선택하여 구문이 올바른지 확인하세요." "message": "각 구문을 선택하여 구문이 올바른지 확인하세요."
}, },
"selectHdPath": { "selectHdPath": {
"message": "HD 경로 선택" "message": "HD 경로 선택"
}, },
"selectLocale": {
"message": "로캘 선택"
},
"selectPathHelp": { "selectPathHelp": {
"message": "아래에 기존 Ledger 계정이 표시되지 않는다면 경로를 \"Legacy(MEW / MyCrypto)\"로 변경해 보세요." "message": "아래에 기존 Ledger 계정이 표시되지 않는다면 경로를 \"Legacy(MEW / MyCrypto)\"로 변경해 보세요."
}, },
@ -1639,9 +1633,6 @@
"swapEstimatedNetworkFeesInfo": { "swapEstimatedNetworkFeesInfo": {
"message": "스왑을 완료하는 데 사용할 네트워크 요금 예상치입니다. 실제 금액은 네트워크 조건에 따라 달라질 수 있습니다." "message": "스왑을 완료하는 데 사용할 네트워크 요금 예상치입니다. 실제 금액은 네트워크 조건에 따라 달라질 수 있습니다."
}, },
"swapFailedErrorDescription": {
"message": "자금은 안전하며 지갑에서 계속 사용할 수 있습니다."
},
"swapFailedErrorTitle": { "swapFailedErrorTitle": {
"message": "스왑 실패" "message": "스왑 실패"
}, },

@ -931,18 +931,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Pasirinkite paskyrą peržiūrėti „MetaMask“" "message": "Pasirinkite paskyrą peržiūrėti „MetaMask“"
}, },
"selectCurrency": {
"message": "Pasirinkite valiutą"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Pasirinkite kiekvieną frazę, kad patikrintumėte, ar ji tinkama" "message": "Pasirinkite kiekvieną frazę, kad patikrintumėte, ar ji tinkama"
}, },
"selectHdPath": { "selectHdPath": {
"message": "Pasirinkite HD kelią" "message": "Pasirinkite HD kelią"
}, },
"selectLocale": {
"message": "Pasirinkite lokalę"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Jeigu toliau nematote savo esamų operacijų sąskaitų, mėginkite pakeisti kelius į „Legacy (MEW / MyCrypto)“" "message": "Jeigu toliau nematote savo esamų operacijų sąskaitų, mėginkite pakeisti kelius į „Legacy (MEW / MyCrypto)“"
}, },

@ -927,18 +927,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Atlasiet kontu, ko skatīt MetaMask" "message": "Atlasiet kontu, ko skatīt MetaMask"
}, },
"selectCurrency": {
"message": "Atlasiet valūtu"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Lūdzu, atlasiet katru frāzi, lai pārliecinātos par tās pareizību." "message": "Lūdzu, atlasiet katru frāzi, lai pārliecinātos par tās pareizību."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Atlasīt HD ceļu" "message": "Atlasīt HD ceļu"
}, },
"selectLocale": {
"message": "Izvēlieties lokalizāciju"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Ja zemāk neredzat savus esošos žurnāla kontus, mēģiniet pārslēgt ceļus uz \"Legacy (MEW / MyCrypto)\"" "message": "Ja zemāk neredzat savus esošos žurnāla kontus, mēģiniet pārslēgt ceļus uz \"Legacy (MEW / MyCrypto)\""
}, },

@ -908,18 +908,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Pilih akaun untuk dilihat dalam MetaMask" "message": "Pilih akaun untuk dilihat dalam MetaMask"
}, },
"selectCurrency": {
"message": "Pilih Mata Wang"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Sila pilih setiap ungkapan untuk memastikan ia betul." "message": "Sila pilih setiap ungkapan untuk memastikan ia betul."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Pilih Laluan HD" "message": "Pilih Laluan HD"
}, },
"selectLocale": {
"message": "Pilih Penempatan"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Jika anda tidak melihat akaun Ledger sedia ada anda di bawah, cuba tukar laluan kepada \"Legacy (MEW / MyCrypto)\"" "message": "Jika anda tidak melihat akaun Ledger sedia ada anda di bawah, cuba tukar laluan kepada \"Legacy (MEW / MyCrypto)\""
}, },

@ -56,7 +56,7 @@
"message": "Contractimplementatie" "message": "Contractimplementatie"
}, },
"copiedExclamation": { "copiedExclamation": {
"message": "Gekopieerde!" "message": "Gekopieerd!"
}, },
"copyPrivateKey": { "copyPrivateKey": {
"message": "Dit is uw privésleutel (klik om te kopiëren)" "message": "Dit is uw privésleutel (klik om te kopiëren)"
@ -163,7 +163,7 @@
"message": " Geïmporteerde accounts worden niet gekoppeld aan de seedphrase van uw oorspronkelijk gemaakte MetaMask-account. Meer informatie over geïmporteerde accounts" "message": " Geïmporteerde accounts worden niet gekoppeld aan de seedphrase van uw oorspronkelijk gemaakte MetaMask-account. Meer informatie over geïmporteerde accounts"
}, },
"imported": { "imported": {
"message": "geïmporteerde", "message": "geïmporteerd",
"description": "status showing that an account has been fully loaded into the keyring" "description": "status showing that an account has been fully loaded into the keyring"
}, },
"infoHelp": { "infoHelp": {
@ -317,9 +317,6 @@
"seedPhraseReq": { "seedPhraseReq": {
"message": "Back-up woorden zijn 12 woorden lang" "message": "Back-up woorden zijn 12 woorden lang"
}, },
"selectCurrency": {
"message": "selecteer valuta"
},
"selectType": { "selectType": {
"message": "Selecteer type" "message": "Selecteer type"
}, },

@ -915,18 +915,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Velg konto for å vise i MetaMask" "message": "Velg konto for å vise i MetaMask"
}, },
"selectCurrency": {
"message": "Velg valuta"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Velg hver frase for å kontrollere at den er riktig." "message": "Velg hver frase for å kontrollere at den er riktig."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Velg HD-bane" "message": "Velg HD-bane"
}, },
"selectLocale": {
"message": "Velg plassering"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Hvis du ikke ser de eksisterende Ledger-kontoene nedenfor, kan du prøve å bytte baner til «Legacy (MEW/MyCrypto)»" "message": "Hvis du ikke ser de eksisterende Ledger-kontoene nedenfor, kan du prøve å bytte baner til «Legacy (MEW/MyCrypto)»"
}, },

@ -925,18 +925,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Wybierz konto do przeglądania w MetaMask" "message": "Wybierz konto do przeglądania w MetaMask"
}, },
"selectCurrency": {
"message": "Wybierz walutę"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Wybierz każdą frazę, aby upewnić się, że jest poprawna." "message": "Wybierz każdą frazę, aby upewnić się, że jest poprawna."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Wybierz ścieżkę HD" "message": "Wybierz ścieżkę HD"
}, },
"selectLocale": {
"message": "Wybierz lokalizację"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Jeśli nie widzisz poniżej swoich kont Ledger, spróbuj przełączyć się na \"Legacy (MEW / MyCrypto)\"" "message": "Jeśli nie widzisz poniżej swoich kont Ledger, spróbuj przełączyć się na \"Legacy (MEW / MyCrypto)\""
}, },

@ -327,9 +327,6 @@
"seedPhraseReq": { "seedPhraseReq": {
"message": "seed phrases are 12 words long" "message": "seed phrases are 12 words long"
}, },
"selectCurrency": {
"message": "Selecionar Moeda"
},
"selectType": { "selectType": {
"message": "Selecionar Tipo" "message": "Selecionar Tipo"
}, },

@ -919,18 +919,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Selecione a conta para ver no MetaMask" "message": "Selecione a conta para ver no MetaMask"
}, },
"selectCurrency": {
"message": "Selecione a Moeda"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Selecione cada frase para se certificar de que esteja correta." "message": "Selecione cada frase para se certificar de que esteja correta."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Selecione o caminho no HD" "message": "Selecione o caminho no HD"
}, },
"selectLocale": {
"message": "Selecionar Local"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Se não conseguir ver as contas da Ledger existentes abaixo, experimente alternar os caminhos para \"Legacy (MEW / MyCrypto)\"" "message": "Se não conseguir ver as contas da Ledger existentes abaixo, experimente alternar os caminhos para \"Legacy (MEW / MyCrypto)\""
}, },

@ -918,18 +918,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Selectați contul de vizualizat în MetaMask" "message": "Selectați contul de vizualizat în MetaMask"
}, },
"selectCurrency": {
"message": "Selectați moneda"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Vă rugăm să selectați fiecare expresie pentru a vă asigura că este corectă." "message": "Vă rugăm să selectați fiecare expresie pentru a vă asigura că este corectă."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Selectare cale HD" "message": "Selectare cale HD"
}, },
"selectLocale": {
"message": "Alegeți setările regionale"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Dacă nu vedeți mai jos conturile dvs. Ledger existente, încercați să comutați calea la „Legacy (MEW / MyCrypto)”" "message": "Dacă nu vedeți mai jos conturile dvs. Ledger existente, încercați să comutați calea la „Legacy (MEW / MyCrypto)”"
}, },

File diff suppressed because it is too large Load Diff

@ -894,18 +894,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Vyberte účet, ktorý chcete zobraziť v MetaMask" "message": "Vyberte účet, ktorý chcete zobraziť v MetaMask"
}, },
"selectCurrency": {
"message": "Vybrat měnu"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Vyberte každú frázu, aby ste sa uistili, že je správna." "message": "Vyberte každú frázu, aby ste sa uistili, že je správna."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Vyberte cestu HD" "message": "Vyberte cestu HD"
}, },
"selectLocale": {
"message": "Vybrať miestne nastavenia"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Ak nevidíte svoje existujúce účty v Hlavnej knihe dole, skúste prepnúť cesty na „Odkaz (MEW/MyCrypto)“" "message": "Ak nevidíte svoje existujúce účty v Hlavnej knihe dole, skúste prepnúť cesty na „Odkaz (MEW/MyCrypto)“"
}, },

@ -913,18 +913,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Izberi račun za prikaz v MetaMask" "message": "Izberi račun za prikaz v MetaMask"
}, },
"selectCurrency": {
"message": "Izberi valuto"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Izberite vsako geslo ter se prepričajte, da je pravilno." "message": "Izberite vsako geslo ter se prepričajte, da je pravilno."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Izberi HD Path" "message": "Izberi HD Path"
}, },
"selectLocale": {
"message": "Izberi jezik"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Če obstoječih Ledger ne vidite, poskusite izbrati \"Legacy (MEW / MyCrypto)\"" "message": "Če obstoječih Ledger ne vidite, poskusite izbrati \"Legacy (MEW / MyCrypto)\""
}, },

@ -922,18 +922,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Izaberite nalog za prikaz u MetaMask-u" "message": "Izaberite nalog za prikaz u MetaMask-u"
}, },
"selectCurrency": {
"message": "Izaberite valutu"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Molimo vas izaberite svaki izraz kako biste proverili da je tačan." "message": "Molimo vas izaberite svaki izraz kako biste proverili da je tačan."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Izaberite HD Path" "message": "Izaberite HD Path"
}, },
"selectLocale": {
"message": "Izaberite lokalni standard"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Ako ne vidite svoje postojeće Ledger naloge dole, pokušajte prebaciti putanje na „Legacy (MEW / MyCrypto)”" "message": "Ako ne vidite svoje postojeće Ledger naloge dole, pokušajte prebaciti putanje na „Legacy (MEW / MyCrypto)”"
}, },

@ -915,18 +915,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Välj konto att visa i MetaMask" "message": "Välj konto att visa i MetaMask"
}, },
"selectCurrency": {
"message": "Välj valuta"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Välj varje fras för att säkerställa att den är korrekt." "message": "Välj varje fras för att säkerställa att den är korrekt."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Välj HD-sökväg" "message": "Välj HD-sökväg"
}, },
"selectLocale": {
"message": "Välj plats"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Om du inte ser dina befintliga Ledger-konton nedan, prova att byta sökväg till \"Legacy (MEW / MyCrypto)\"" "message": "Om du inte ser dina befintliga Ledger-konton nedan, prova att byta sökväg till \"Legacy (MEW / MyCrypto)\""
}, },

@ -909,18 +909,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Chagua akaunti kuangalia kwenye MetaMask" "message": "Chagua akaunti kuangalia kwenye MetaMask"
}, },
"selectCurrency": {
"message": "Chagua Sarafu"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Tafadhali chagua kila kirai ili kuhakikisha kuwa hii ni sahihi." "message": "Tafadhali chagua kila kirai ili kuhakikisha kuwa hii ni sahihi."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Chagua Njia ya HD" "message": "Chagua Njia ya HD"
}, },
"selectLocale": {
"message": "Chagua Lugha"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Ikiwa huoni akaunti zako za Leja za sasa hapa chini, charibu kubadilisha njia kwenda \"Legacy (MEW / MyCrypto)\"  " "message": "Ikiwa huoni akaunti zako za Leja za sasa hapa chini, charibu kubadilisha njia kwenda \"Legacy (MEW / MyCrypto)\"  "
}, },

@ -432,9 +432,6 @@
"seedPhraseReq": { "seedPhraseReq": {
"message": "விியஙகள 12 வகளடவ" "message": "விியஙகள 12 வகளடவ"
}, },
"selectCurrency": {
"message": "நணயத"
},
"selectType": { "selectType": {
"message": "வக" "message": "வக"
}, },

@ -429,9 +429,6 @@
"selectAnAccount": { "selectAnAccount": {
"message": "เลอกบญช" "message": "เลอกบญช"
}, },
"selectCurrency": {
"message": "เลอกสกลเงน"
},
"selectHdPath": { "selectHdPath": {
"message": "เลอกเสนทาง HD" "message": "เลอกเสนทาง HD"
}, },

File diff suppressed because it is too large Load Diff

@ -372,9 +372,6 @@
"seedPhraseReq": { "seedPhraseReq": {
"message": "Kaynak ifadeleri 12 kelimedir." "message": "Kaynak ifadeleri 12 kelimedir."
}, },
"selectCurrency": {
"message": "Döviz Seç"
},
"selectType": { "selectType": {
"message": "Tip Seç" "message": "Tip Seç"
}, },

@ -931,18 +931,12 @@
"selectAnAccountHelp": { "selectAnAccountHelp": {
"message": "Оберіть обліковий запис для перегляду в MetaMask" "message": "Оберіть обліковий запис для перегляду в MetaMask"
}, },
"selectCurrency": {
"message": "Виберіть валюту"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "Виберіть кожну фразу, щоб переконатися, що вона правильна." "message": "Виберіть кожну фразу, щоб переконатися, що вона правильна."
}, },
"selectHdPath": { "selectHdPath": {
"message": "Виберіть шлях до HD-гаманця" "message": "Виберіть шлях до HD-гаманця"
}, },
"selectLocale": {
"message": "Оберіть локаль"
},
"selectPathHelp": { "selectPathHelp": {
"message": "Якщо ви не бачите ваш обліковий запис Ledger, який існує, спробуйте переключити шляхи на \"Legacy (MEW / MyCrypto)\"" "message": "Якщо ви не бачите ваш обліковий запис Ledger, який існує, спробуйте переключити шляхи на \"Legacy (MEW / MyCrypto)\""
}, },

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -922,15 +922,9 @@
"selectAnAccount": { "selectAnAccount": {
"message": "選擇帳戶" "message": "選擇帳戶"
}, },
"selectCurrency": {
"message": "選擇幣別"
},
"selectEachPhrase": { "selectEachPhrase": {
"message": "請依照正確順序點選助憶詞" "message": "請依照正確順序點選助憶詞"
}, },
"selectLocale": {
"message": "選擇地區"
},
"selectPathHelp": { "selectPathHelp": {
"message": "若看不到您已經擁有的 Ledger 帳戶,請嘗試切換路徑為 \"Legacy (MEW / MyCrypto)\"" "message": "若看不到您已經擁有的 Ledger 帳戶,請嘗試切換路徑為 \"Legacy (MEW / MyCrypto)\""
}, },

@ -78,6 +78,6 @@
"notifications" "notifications"
], ],
"short_name": "__MSG_appName__", "short_name": "__MSG_appName__",
"version": "9.0.5", "version": "9.1.0",
"web_accessible_resources": ["inpage.js", "phishing.html"] "web_accessible_resources": ["inpage.js", "phishing.html"]
} }

@ -32,7 +32,9 @@ import LocalStore from './lib/local-store';
import ReadOnlyNetworkStore from './lib/network-store'; import ReadOnlyNetworkStore from './lib/network-store';
import createStreamSink from './lib/createStreamSink'; import createStreamSink from './lib/createStreamSink';
import NotificationManager from './lib/notification-manager'; import NotificationManager from './lib/notification-manager';
import MetamaskController from './metamask-controller'; import MetamaskController, {
METAMASK_CONTROLLER_EVENTS,
} from './metamask-controller';
import rawFirstTimeState from './first-time-state'; import rawFirstTimeState from './first-time-state';
import getFirstPreferredLangCode from './lib/get-first-preferred-lang-code'; import getFirstPreferredLangCode from './lib/get-first-preferred-lang-code';
import getObjStructure from './lib/getObjStructure'; import getObjStructure from './lib/getObjStructure';
@ -51,6 +53,7 @@ global.METAMASK_NOTIFIER = notificationManager;
let popupIsOpen = false; let popupIsOpen = false;
let notificationIsOpen = false; let notificationIsOpen = false;
let uiIsTriggering = false;
const openMetamaskTabsIDs = {}; const openMetamaskTabsIDs = {};
const requestAccountTabIds = {}; const requestAccountTabIds = {};
@ -240,7 +243,9 @@ function setupController(initState, initLangCode) {
}); });
setupEnsIpfsResolver({ setupEnsIpfsResolver({
getCurrentNetwork: controller.getCurrentNetwork, getCurrentChainId: controller.networkController.getCurrentChainId.bind(
controller.networkController,
),
getIpfsGateway: controller.preferencesController.getIpfsGateway.bind( getIpfsGateway: controller.preferencesController.getIpfsGateway.bind(
controller.preferencesController, controller.preferencesController,
), ),
@ -396,14 +401,35 @@ function setupController(initState, initLangCode) {
// //
updateBadge(); updateBadge();
controller.txController.on('update:badge', updateBadge); controller.txController.on(
controller.messageManager.on('updateBadge', updateBadge); METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE,
controller.personalMessageManager.on('updateBadge', updateBadge); updateBadge,
controller.decryptMessageManager.on('updateBadge', updateBadge); );
controller.encryptionPublicKeyManager.on('updateBadge', updateBadge); controller.messageManager.on(
controller.typedMessageManager.on('updateBadge', updateBadge); METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE,
updateBadge,
);
controller.personalMessageManager.on(
METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE,
updateBadge,
);
controller.decryptMessageManager.on(
METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE,
updateBadge,
);
controller.encryptionPublicKeyManager.on(
METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE,
updateBadge,
);
controller.typedMessageManager.on(
METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE,
updateBadge,
);
controller.approvalController.subscribe(updateBadge); controller.approvalController.subscribe(updateBadge);
controller.appStateController.on('updateBadge', updateBadge); controller.appStateController.on(
METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE,
updateBadge,
);
/** /**
* Updates the Web Extension's "badge" number, on the little fox in the toolbar. * Updates the Web Extension's "badge" number, on the little fox in the toolbar.
@ -459,8 +485,17 @@ async function triggerUi() {
tabs.length > 0 && tabs.length > 0 &&
tabs[0].extData && tabs[0].extData &&
tabs[0].extData.indexOf('vivaldi_tab') > -1; tabs[0].extData.indexOf('vivaldi_tab') > -1;
if ((isVivaldi || !popupIsOpen) && !currentlyActiveMetamaskTab) { if (
!uiIsTriggering &&
(isVivaldi || !popupIsOpen) &&
!currentlyActiveMetamaskTab
) {
uiIsTriggering = true;
try {
await notificationManager.showPopup(); await notificationManager.showPopup();
} finally {
uiIsTriggering = false;
}
} }
} }

@ -1,5 +1,6 @@
import EventEmitter from 'events'; import EventEmitter from 'events';
import { ObservableStore } from '@metamask/obs-store'; import { ObservableStore } from '@metamask/obs-store';
import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller';
export default class AppStateController extends EventEmitter { export default class AppStateController extends EventEmitter {
/** /**
@ -74,7 +75,7 @@ export default class AppStateController extends EventEmitter {
*/ */
waitForUnlock(resolve, shouldShowUnlockRequest) { waitForUnlock(resolve, shouldShowUnlockRequest) {
this.waitingForUnlock.push({ resolve }); this.waitingForUnlock.push({ resolve });
this.emit('updateBadge'); this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE);
if (shouldShowUnlockRequest) { if (shouldShowUnlockRequest) {
this._showUnlockRequest(); this._showUnlockRequest();
} }
@ -88,7 +89,7 @@ export default class AppStateController extends EventEmitter {
while (this.waitingForUnlock.length > 0) { while (this.waitingForUnlock.length > 0) {
this.waitingForUnlock.shift().resolve(); this.waitingForUnlock.shift().resolve();
} }
this.emit('updateBadge'); this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE);
} }
} }

@ -2,20 +2,22 @@ import punycode from 'punycode/punycode';
import ethUtil from 'ethereumjs-util'; import ethUtil from 'ethereumjs-util';
import { ObservableStore } from '@metamask/obs-store'; import { ObservableStore } from '@metamask/obs-store';
import log from 'loglevel'; import log from 'loglevel';
import { CHAIN_ID_TO_NETWORK_ID_MAP } from '../../../../shared/constants/network';
import Ens from './ens'; import Ens from './ens';
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
const ZERO_X_ERROR_ADDRESS = '0x'; const ZERO_X_ERROR_ADDRESS = '0x';
export default class EnsController { export default class EnsController {
constructor({ ens, provider, networkStore } = {}) { constructor({ ens, provider, onNetworkDidChange, getCurrentChainId } = {}) {
const initState = { const initState = {
ensResolutionsByAddress: {}, ensResolutionsByAddress: {},
}; };
this._ens = ens; this._ens = ens;
if (!this._ens) { if (!this._ens) {
const network = networkStore.getState(); const chainId = getCurrentChainId();
const network = CHAIN_ID_TO_NETWORK_ID_MAP[chainId];
if (Ens.getNetworkEnsSupport(network)) { if (Ens.getNetworkEnsSupport(network)) {
this._ens = new Ens({ this._ens = new Ens({
network, network,
@ -25,8 +27,10 @@ export default class EnsController {
} }
this.store = new ObservableStore(initState); this.store = new ObservableStore(initState);
networkStore.subscribe((network) => { onNetworkDidChange(() => {
this.store.putState(initState); this.store.putState(initState);
const chainId = getCurrentChainId();
const network = CHAIN_ID_TO_NETWORK_ID_MAP[chainId];
if (Ens.getNetworkEnsSupport(network)) { if (Ens.getNetworkEnsSupport(network)) {
this._ens = new Ens({ this._ens = new Ens({
network, network,

@ -23,6 +23,7 @@ import {
ROPSTEN, ROPSTEN,
ROPSTEN_CHAIN_ID, ROPSTEN_CHAIN_ID,
} from '../../../shared/constants/network'; } from '../../../shared/constants/network';
import { NETWORK_EVENTS } from './network';
const fetchWithTimeout = getFetchWithTimeout(30000); const fetchWithTimeout = getFetchWithTimeout(30000);
@ -111,7 +112,7 @@ export default class IncomingTransactionsController {
}), }),
); );
this.networkController.on('networkDidChange', async () => { this.networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, async () => {
const address = this.preferencesController.getSelectedAddress(); const address = this.preferencesController.getSelectedAddress();
await this._update({ await this._update({
address, address,
@ -282,6 +283,7 @@ export default class IncomingTransactionsController {
return { return {
blockNumber: txMeta.blockNumber, blockNumber: txMeta.blockNumber,
id: createId(), id: createId(),
chainId,
metamaskNetworkId: CHAIN_ID_TO_NETWORK_ID_MAP[chainId], metamaskNetworkId: CHAIN_ID_TO_NETWORK_ID_MAP[chainId],
status, status,
time, time,

@ -200,9 +200,9 @@ export default class MetaMetricsController {
value, value,
currency, currency,
category, category,
network: this.network, network: properties?.network ?? this.network,
locale: this.locale, locale: this.locale,
chain_id: this.chainId, chain_id: properties?.chain_id ?? this.chainId,
environment_type: environmentType, environment_type: environmentType,
}, },
context: this._buildContext(referrer, page), context: this._buildContext(referrer, page),

@ -1 +1 @@
export { default } from './network'; export { default, NETWORK_EVENTS } from './network';

@ -21,7 +21,7 @@ import {
import { import {
isPrefixedFormattedHexString, isPrefixedFormattedHexString,
isSafeChainId, isSafeChainId,
} from '../../../../shared/modules/utils'; } from '../../../../shared/modules/network.utils';
import createMetamaskMiddleware from './createMetamaskMiddleware'; import createMetamaskMiddleware from './createMetamaskMiddleware';
import createInfuraClient from './createInfuraClient'; import createInfuraClient from './createInfuraClient';
import createJsonRpcClient from './createJsonRpcClient'; import createJsonRpcClient from './createJsonRpcClient';
@ -47,6 +47,13 @@ const defaultProviderConfig = {
...defaultProviderConfigOpts, ...defaultProviderConfigOpts,
}; };
export const NETWORK_EVENTS = {
// Fired after the actively selected network is changed
NETWORK_DID_CHANGE: 'networkDidChange',
// Fired when the actively selected network *will* change
NETWORK_WILL_CHANGE: 'networkWillChange',
};
export default class NetworkController extends EventEmitter { export default class NetworkController extends EventEmitter {
constructor(opts = {}) { constructor(opts = {}) {
super(); super();
@ -73,7 +80,7 @@ export default class NetworkController extends EventEmitter {
this._providerProxy = null; this._providerProxy = null;
this._blockTrackerProxy = null; this._blockTrackerProxy = null;
this.on('networkDidChange', this.lookupNetwork); this.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, this.lookupNetwork);
} }
/** /**
@ -229,9 +236,10 @@ export default class NetworkController extends EventEmitter {
// //
_switchNetwork(opts) { _switchNetwork(opts) {
this.emit(NETWORK_EVENTS.NETWORK_WILL_CHANGE);
this.setNetworkState('loading'); this.setNetworkState('loading');
this._configureProvider(opts); this._configureProvider(opts);
this.emit('networkDidChange', opts.type); this.emit(NETWORK_EVENTS.NETWORK_DID_CHANGE, opts.type);
} }
_configureProvider({ type, rpcUrl, chainId }) { _configureProvider({ type, rpcUrl, chainId }) {

@ -126,7 +126,12 @@ export class PermissionsController {
*/ */
async requestAccountsPermissionWithId(origin) { async requestAccountsPermissionWithId(origin) {
const id = nanoid(); const id = nanoid();
this._requestPermissions({ origin }, { eth_accounts: {} }, id); this._requestPermissions({ origin }, { eth_accounts: {} }, id).then(
async () => {
const permittedAccounts = await this.getAccounts(origin);
this.notifyAccountsChanged(origin, permittedAccounts);
},
);
return id; return id;
} }

@ -7,7 +7,8 @@ import ethers from 'ethers';
import log from 'loglevel'; import log from 'loglevel';
import { LISTED_CONTRACT_ADDRESSES } from '../../../shared/constants/tokens'; import { LISTED_CONTRACT_ADDRESSES } from '../../../shared/constants/tokens';
import { NETWORK_TYPE_TO_ID_MAP } from '../../../shared/constants/network'; import { NETWORK_TYPE_TO_ID_MAP } from '../../../shared/constants/network';
import { isPrefixedFormattedHexString } from '../../../shared/modules/utils'; import { isPrefixedFormattedHexString } from '../../../shared/modules/network.utils';
import { NETWORK_EVENTS } from './network';
export default class PreferencesController { export default class PreferencesController {
/** /**
@ -72,7 +73,7 @@ export default class PreferencesController {
this.store.setMaxListeners(12); this.store.setMaxListeners(12);
this.openPopup = opts.openPopup; this.openPopup = opts.openPopup;
this.migrateAddressBookState = opts.migrateAddressBookState; this.migrateAddressBookState = opts.migrateAddressBookState;
this._subscribeProviderType(); this._subscribeToNetworkDidChange();
global.setPreference = (key, value) => { global.setPreference = (key, value) => {
return this.setFeatureFlag(key, value); return this.setFeatureFlag(key, value);
@ -667,12 +668,11 @@ export default class PreferencesController {
// //
/** /**
* Subscription to network provider type. * Handle updating token list to reflect current network by listening for the
* * NETWORK_DID_CHANGE event.
*
*/ */
_subscribeProviderType() { _subscribeToNetworkDidChange() {
this.network.providerStore.subscribe(() => { this.network.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, () => {
const { tokens, hiddenTokens } = this._getTokenRelatedStates(); const { tokens, hiddenTokens } = this._getTokenRelatedStates();
this._updateAccountTokens(tokens, this.getAssetImages(), hiddenTokens); this._updateAccountTokens(tokens, this.getAssetImages(), hiddenTokens);
}); });
@ -689,12 +689,12 @@ export default class PreferencesController {
_updateAccountTokens(tokens, assetImages, hiddenTokens) { _updateAccountTokens(tokens, assetImages, hiddenTokens) {
const { const {
accountTokens, accountTokens,
providerType, chainId,
selectedAddress, selectedAddress,
accountHiddenTokens, accountHiddenTokens,
} = this._getTokenRelatedStates(); } = this._getTokenRelatedStates();
accountTokens[selectedAddress][providerType] = tokens; accountTokens[selectedAddress][chainId] = tokens;
accountHiddenTokens[selectedAddress][providerType] = hiddenTokens; accountHiddenTokens[selectedAddress][chainId] = hiddenTokens;
this.store.updateState({ this.store.updateState({
accountTokens, accountTokens,
tokens, tokens,
@ -730,27 +730,27 @@ export default class PreferencesController {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
selectedAddress = this.store.getState().selectedAddress; selectedAddress = this.store.getState().selectedAddress;
} }
const providerType = this.network.providerStore.getState().type; const chainId = this.network.getCurrentChainId();
if (!(selectedAddress in accountTokens)) { if (!(selectedAddress in accountTokens)) {
accountTokens[selectedAddress] = {}; accountTokens[selectedAddress] = {};
} }
if (!(selectedAddress in accountHiddenTokens)) { if (!(selectedAddress in accountHiddenTokens)) {
accountHiddenTokens[selectedAddress] = {}; accountHiddenTokens[selectedAddress] = {};
} }
if (!(providerType in accountTokens[selectedAddress])) { if (!(chainId in accountTokens[selectedAddress])) {
accountTokens[selectedAddress][providerType] = []; accountTokens[selectedAddress][chainId] = [];
} }
if (!(providerType in accountHiddenTokens[selectedAddress])) { if (!(chainId in accountHiddenTokens[selectedAddress])) {
accountHiddenTokens[selectedAddress][providerType] = []; accountHiddenTokens[selectedAddress][chainId] = [];
} }
const tokens = accountTokens[selectedAddress][providerType]; const tokens = accountTokens[selectedAddress][chainId];
const hiddenTokens = accountHiddenTokens[selectedAddress][providerType]; const hiddenTokens = accountHiddenTokens[selectedAddress][chainId];
return { return {
tokens, tokens,
accountTokens, accountTokens,
hiddenTokens, hiddenTokens,
accountHiddenTokens, accountHiddenTokens,
providerType, chainId,
selectedAddress, selectedAddress,
}; };
} }

@ -19,6 +19,7 @@ import {
fetchSwapsFeatureLiveness as defaultFetchSwapsFeatureLiveness, fetchSwapsFeatureLiveness as defaultFetchSwapsFeatureLiveness,
fetchSwapsQuoteRefreshTime as defaultFetchSwapsQuoteRefreshTime, fetchSwapsQuoteRefreshTime as defaultFetchSwapsQuoteRefreshTime,
} from '../../../ui/app/pages/swaps/swaps.util'; } from '../../../ui/app/pages/swaps/swaps.util';
import { NETWORK_EVENTS } from './network';
const METASWAP_ADDRESS = '0x881d40237659c251811cec9c364ef91dc08d300c'; const METASWAP_ADDRESS = '0x881d40237659c251811cec9c364ef91dc08d300c';
@ -103,7 +104,7 @@ export default class SwapsController {
this.ethersProvider = new ethers.providers.Web3Provider(provider); this.ethersProvider = new ethers.providers.Web3Provider(provider);
this._currentNetwork = networkController.store.getState().network; this._currentNetwork = networkController.store.getState().network;
networkController.on('networkDidChange', (network) => { networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, (network) => {
if (network !== 'loading' && network !== this._currentNetwork) { if (network !== 'loading' && network !== this._currentNetwork) {
this._currentNetwork = network; this._currentNetwork = network;
this.ethersProvider = new ethers.providers.Web3Provider(provider); this.ethersProvider = new ethers.providers.Web3Provider(provider);

@ -19,10 +19,13 @@ export default class TokenRatesController {
* *
* @param {Object} [config] - Options to configure controller * @param {Object} [config] - Options to configure controller
*/ */
constructor({ currency, preferences } = {}) { constructor({ preferences, getNativeCurrency } = {}) {
this.store = new ObservableStore(); this.store = new ObservableStore();
this.currency = currency; this.getNativeCurrency = getNativeCurrency;
this.preferences = preferences; this.tokens = preferences.getState().tokens;
preferences.subscribe(({ tokens = [] }) => {
this.tokens = tokens;
});
} }
/** /**
@ -30,9 +33,7 @@ export default class TokenRatesController {
*/ */
async updateExchangeRates() { async updateExchangeRates() {
const contractExchangeRates = {}; const contractExchangeRates = {};
const nativeCurrency = this.currency const nativeCurrency = this.getNativeCurrency().toLowerCase();
? this.currency.state.nativeCurrency.toLowerCase()
: 'eth';
const pairs = this._tokens.map((token) => token.address).join(','); const pairs = this._tokens.map((token) => token.address).join(',');
const query = `contract_addresses=${pairs}&vs_currencies=${nativeCurrency}`; const query = `contract_addresses=${pairs}&vs_currencies=${nativeCurrency}`;
if (this._tokens.length > 0) { if (this._tokens.length > 0) {
@ -60,21 +61,6 @@ export default class TokenRatesController {
} }
/* eslint-disable accessor-pairs */ /* eslint-disable accessor-pairs */
/**
* @type {Object}
*/
set preferences(preferences) {
this._preferences && this._preferences.unsubscribe();
if (!preferences) {
return;
}
this._preferences = preferences;
this.tokens = preferences.getState().tokens;
preferences.subscribe(({ tokens = [] }) => {
this.tokens = tokens;
});
}
/** /**
* @type {Array} * @type {Array}
*/ */

@ -23,6 +23,7 @@ import {
TRANSACTION_STATUSES, TRANSACTION_STATUSES,
TRANSACTION_TYPES, TRANSACTION_TYPES,
} from '../../../../shared/constants/transaction'; } from '../../../../shared/constants/transaction';
import { METAMASK_CONTROLLER_EVENTS } from '../../metamask-controller';
import TransactionStateManager from './tx-state-manager'; import TransactionStateManager from './tx-state-manager';
import TxGasUtil from './tx-gas-utils'; import TxGasUtil from './tx-gas-utils';
import PendingTransactionTracker from './pending-tx-tracker'; import PendingTransactionTracker from './pending-tx-tracker';
@ -83,6 +84,7 @@ export default class TransactionController extends EventEmitter {
initState: opts.initState, initState: opts.initState,
txHistoryLimit: opts.txHistoryLimit, txHistoryLimit: opts.txHistoryLimit,
getNetwork: this.getNetwork.bind(this), getNetwork: this.getNetwork.bind(this),
getCurrentChainId: opts.getCurrentChainId,
}); });
this._onBootCleanUp(); this._onBootCleanUp();
@ -113,7 +115,9 @@ export default class TransactionController extends EventEmitter {
), ),
}); });
this.txStateManager.store.subscribe(() => this.emit('update:badge')); this.txStateManager.store.subscribe(() =>
this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE),
);
this._setupListeners(); this._setupListeners();
// memstore is computed from a few different stores // memstore is computed from a few different stores
this._updateMemstore(); this._updateMemstore();

@ -3,6 +3,8 @@ import { ObservableStore } from '@metamask/obs-store';
import log from 'loglevel'; import log from 'loglevel';
import createId from '../../lib/random-id'; import createId from '../../lib/random-id';
import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction'; import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction';
import { METAMASK_CONTROLLER_EVENTS } from '../../metamask-controller';
import { transactionMatchesNetwork } from '../../../../shared/modules/transaction.utils';
import { import {
generateHistoryEntry, generateHistoryEntry,
replayHistory, replayHistory,
@ -27,12 +29,13 @@ import { getFinalStates, normalizeTxParams } from './lib/util';
* @class * @class
*/ */
export default class TransactionStateManager extends EventEmitter { export default class TransactionStateManager extends EventEmitter {
constructor({ initState, txHistoryLimit, getNetwork }) { constructor({ initState, txHistoryLimit, getNetwork, getCurrentChainId }) {
super(); super();
this.store = new ObservableStore({ transactions: [], ...initState }); this.store = new ObservableStore({ transactions: [], ...initState });
this.txHistoryLimit = txHistoryLimit; this.txHistoryLimit = txHistoryLimit;
this.getNetwork = getNetwork; this.getNetwork = getNetwork;
this.getCurrentChainId = getCurrentChainId;
} }
/** /**
@ -41,6 +44,7 @@ export default class TransactionStateManager extends EventEmitter {
*/ */
generateTxMeta(opts) { generateTxMeta(opts) {
const netId = this.getNetwork(); const netId = this.getNetwork();
const chainId = this.getCurrentChainId();
if (netId === 'loading') { if (netId === 'loading') {
throw new Error('MetaMask is having trouble connecting to the network'); throw new Error('MetaMask is having trouble connecting to the network');
} }
@ -49,6 +53,7 @@ export default class TransactionStateManager extends EventEmitter {
time: new Date().getTime(), time: new Date().getTime(),
status: TRANSACTION_STATUSES.UNAPPROVED, status: TRANSACTION_STATUSES.UNAPPROVED,
metamaskNetworkId: netId, metamaskNetworkId: netId,
chainId,
loadingDefaults: true, loadingDefaults: true,
...opts, ...opts,
}; };
@ -64,13 +69,14 @@ export default class TransactionStateManager extends EventEmitter {
*/ */
getTxList(limit) { getTxList(limit) {
const network = this.getNetwork(); const network = this.getNetwork();
const chainId = this.getCurrentChainId();
const fullTxList = this.getFullTxList(); const fullTxList = this.getFullTxList();
const nonces = new Set(); const nonces = new Set();
const txs = []; const txs = [];
for (let i = fullTxList.length - 1; i > -1; i--) { for (let i = fullTxList.length - 1; i > -1; i--) {
const txMeta = fullTxList[i]; const txMeta = fullTxList[i];
if (txMeta.metamaskNetworkId !== network) { if (transactionMatchesNetwork(txMeta, chainId, network) === false) {
continue; continue;
} }
@ -451,13 +457,14 @@ export default class TransactionStateManager extends EventEmitter {
// network only tx // network only tx
const txs = this.getFullTxList(); const txs = this.getFullTxList();
const network = this.getNetwork(); const network = this.getNetwork();
const chainId = this.getCurrentChainId();
// Filter out the ones from the current account and network // Filter out the ones from the current account and network
const otherAccountTxs = txs.filter( const otherAccountTxs = txs.filter(
(txMeta) => (txMeta) =>
!( !(
txMeta.txParams.from === address && txMeta.txParams.from === address &&
txMeta.metamaskNetworkId === network transactionMatchesNetwork(txMeta, chainId, network)
), ),
); );
@ -474,7 +481,7 @@ export default class TransactionStateManager extends EventEmitter {
* @param {TransactionStatuses[keyof TransactionStatuses]} status - the status to set on the txMeta * @param {TransactionStatuses[keyof TransactionStatuses]} status - the status to set on the txMeta
* @emits tx:status-update - passes txId and status * @emits tx:status-update - passes txId and status
* @emits ${txMeta.id}:finished - if it is a finished state. Passes the txMeta * @emits ${txMeta.id}:finished - if it is a finished state. Passes the txMeta
* @emits update:badge * @emits 'updateBadge'
*/ */
_setTxStatus(txId, status) { _setTxStatus(txId, status) {
const txMeta = this.getTx(txId); const txMeta = this.getTx(txId);
@ -497,7 +504,7 @@ export default class TransactionStateManager extends EventEmitter {
) { ) {
this.emit(`${txMeta.id}:finished`, txMeta); this.emit(`${txMeta.id}:finished`, txMeta);
} }
this.emit('update:badge'); this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE);
} catch (error) { } catch (error) {
log.error(error); log.error(error);
} }

@ -4,6 +4,7 @@ import ethUtil from 'ethereumjs-util';
import { ethErrors } from 'eth-rpc-errors'; import { ethErrors } from 'eth-rpc-errors';
import log from 'loglevel'; import log from 'loglevel';
import { MESSAGE_TYPE } from '../../../shared/constants/app'; import { MESSAGE_TYPE } from '../../../shared/constants/app';
import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller';
import { addHexPrefix } from './util'; import { addHexPrefix } from './util';
import createId from './random-id'; import createId from './random-id';
@ -253,6 +254,14 @@ export default class DecryptMessageManager extends EventEmitter {
this._setMsgStatus(msgId, 'errored'); this._setMsgStatus(msgId, 'errored');
} }
/**
* Clears all unapproved messages from memory.
*/
clearUnapproved() {
this.messages = this.messages.filter((msg) => msg.status !== 'unapproved');
this._saveMsgList();
}
/** /**
* Updates the status of a DecryptMessage in this.messages via a call to this._updateMsg * Updates the status of a DecryptMessage in this.messages via a call to this._updateMsg
* *
@ -316,7 +325,7 @@ export default class DecryptMessageManager extends EventEmitter {
unapprovedDecryptMsgs, unapprovedDecryptMsgs,
unapprovedDecryptMsgCount, unapprovedDecryptMsgCount,
}); });
this.emit('updateBadge'); this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE);
} }
/** /**

@ -3,6 +3,7 @@ import { ObservableStore } from '@metamask/obs-store';
import { ethErrors } from 'eth-rpc-errors'; import { ethErrors } from 'eth-rpc-errors';
import log from 'loglevel'; import log from 'loglevel';
import { MESSAGE_TYPE } from '../../../shared/constants/app'; import { MESSAGE_TYPE } from '../../../shared/constants/app';
import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller';
import createId from './random-id'; import createId from './random-id';
/** /**
@ -242,6 +243,14 @@ export default class EncryptionPublicKeyManager extends EventEmitter {
this._setMsgStatus(msgId, 'errored'); this._setMsgStatus(msgId, 'errored');
} }
/**
* Clears all unapproved messages from memory.
*/
clearUnapproved() {
this.messages = this.messages.filter((msg) => msg.status !== 'unapproved');
this._saveMsgList();
}
/** /**
* Updates the status of a EncryptionPublicKey in this.messages via a call to this._updateMsg * Updates the status of a EncryptionPublicKey in this.messages via a call to this._updateMsg
* *
@ -303,6 +312,6 @@ export default class EncryptionPublicKeyManager extends EventEmitter {
unapprovedEncryptionPublicKeyMsgs, unapprovedEncryptionPublicKeyMsgs,
unapprovedEncryptionPublicKeyMsgCount, unapprovedEncryptionPublicKeyMsgCount,
}); });
this.emit('updateBadge'); this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE);
} }
} }

@ -8,7 +8,7 @@ const supportedTopLevelDomains = ['eth'];
export default function setupEnsIpfsResolver({ export default function setupEnsIpfsResolver({
provider, provider,
getCurrentNetwork, getCurrentChainId,
getIpfsGateway, getIpfsGateway,
}) { }) {
// install listener // install listener
@ -30,7 +30,7 @@ export default function setupEnsIpfsResolver({
const { tabId, url } = details; const { tabId, url } = details;
// ignore requests that are not associated with tabs // ignore requests that are not associated with tabs
// only attempt ENS resolution on mainnet // only attempt ENS resolution on mainnet
if (tabId === -1 || getCurrentNetwork() !== '1') { if (tabId === -1 || getCurrentChainId() !== '0x1') {
return; return;
} }
// parse ens name // parse ens name

@ -3,6 +3,7 @@ import { ObservableStore } from '@metamask/obs-store';
import ethUtil from 'ethereumjs-util'; import ethUtil from 'ethereumjs-util';
import { ethErrors } from 'eth-rpc-errors'; import { ethErrors } from 'eth-rpc-errors';
import { MESSAGE_TYPE } from '../../../shared/constants/app'; import { MESSAGE_TYPE } from '../../../shared/constants/app';
import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller';
import createId from './random-id'; import createId from './random-id';
/** /**
@ -220,6 +221,14 @@ export default class MessageManager extends EventEmitter {
this._setMsgStatus(msgId, 'rejected'); this._setMsgStatus(msgId, 'rejected');
} }
/**
* Clears all unapproved messages from memory.
*/
clearUnapproved() {
this.messages = this.messages.filter((msg) => msg.status !== 'unapproved');
this._saveMsgList();
}
/** /**
* Updates the status of a Message in this.messages via a call to this._updateMsg * Updates the status of a Message in this.messages via a call to this._updateMsg
* *
@ -272,7 +281,7 @@ export default class MessageManager extends EventEmitter {
const unapprovedMsgs = this.getUnapprovedMsgs(); const unapprovedMsgs = this.getUnapprovedMsgs();
const unapprovedMsgCount = Object.keys(unapprovedMsgs).length; const unapprovedMsgCount = Object.keys(unapprovedMsgs).length;
this.memStore.updateState({ unapprovedMsgs, unapprovedMsgCount }); this.memStore.updateState({ unapprovedMsgs, unapprovedMsgCount });
this.emit('updateBadge'); this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE);
} }
} }

@ -4,6 +4,7 @@ import ethUtil from 'ethereumjs-util';
import { ethErrors } from 'eth-rpc-errors'; import { ethErrors } from 'eth-rpc-errors';
import log from 'loglevel'; import log from 'loglevel';
import { MESSAGE_TYPE } from '../../../shared/constants/app'; import { MESSAGE_TYPE } from '../../../shared/constants/app';
import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller';
import { addHexPrefix } from './util'; import { addHexPrefix } from './util';
import createId from './random-id'; import createId from './random-id';
@ -241,6 +242,14 @@ export default class PersonalMessageManager extends EventEmitter {
this._setMsgStatus(msgId, 'rejected'); this._setMsgStatus(msgId, 'rejected');
} }
/**
* Clears all unapproved messages from memory.
*/
clearUnapproved() {
this.messages = this.messages.filter((msg) => msg.status !== 'unapproved');
this._saveMsgList();
}
/** /**
* Updates the status of a PersonalMessage in this.messages via a call to this._updateMsg * Updates the status of a PersonalMessage in this.messages via a call to this._updateMsg
* *
@ -301,7 +310,7 @@ export default class PersonalMessageManager extends EventEmitter {
unapprovedPersonalMsgs, unapprovedPersonalMsgs,
unapprovedPersonalMsgCount, unapprovedPersonalMsgCount,
}); });
this.emit('updateBadge'); this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE);
} }
/** /**

@ -0,0 +1,272 @@
import { ethErrors } from 'eth-rpc-errors';
import validUrl from 'valid-url';
import { omit } from 'lodash';
import { MESSAGE_TYPE } from '../../../../../shared/constants/app';
import {
isPrefixedFormattedHexString,
isSafeChainId,
} from '../../../../../shared/modules/network.utils';
import { jsonRpcRequest } from '../../../../../shared/modules/rpc.utils';
import { CHAIN_ID_TO_NETWORK_ID_MAP } from '../../../../../shared/constants/network';
const addEthereumChain = {
methodNames: [MESSAGE_TYPE.ADD_ETHEREUM_CHAIN],
implementation: addEthereumChainHandler,
};
export default addEthereumChain;
async function addEthereumChainHandler(
req,
res,
_next,
end,
{
addCustomRpc,
getCurrentChainId,
findCustomRpcBy,
updateRpcTarget,
requestUserApproval,
sendMetrics,
},
) {
if (!req.params?.[0] || typeof req.params[0] !== 'object') {
return end(
ethErrors.rpc.invalidParams({
message: `Expected single, object parameter. Received:\n${JSON.stringify(
req.params,
)}`,
}),
);
}
const { origin } = req;
const {
chainId,
chainName = null,
blockExplorerUrls = null,
nativeCurrency = null,
rpcUrls,
} = req.params[0];
const otherKeys = Object.keys(
omit(req.params[0], [
'chainId',
'chainName',
'blockExplorerUrls',
'iconUrls',
'rpcUrls',
'nativeCurrency',
]),
);
if (otherKeys.length > 0) {
return end(
ethErrors.rpc.invalidParams({
message: `Received unexpected keys on object parameter. Unsupported keys:\n${otherKeys}`,
}),
);
}
const firstValidRPCUrl = Array.isArray(rpcUrls)
? rpcUrls.find((rpcUrl) => validUrl.isHttpsUri(rpcUrl))
: null;
const firstValidBlockExplorerUrl =
blockExplorerUrls !== null && Array.isArray(blockExplorerUrls)
? blockExplorerUrls.find((blockExplorerUrl) =>
validUrl.isHttpsUri(blockExplorerUrl),
)
: null;
if (!firstValidRPCUrl) {
return end(
ethErrors.rpc.invalidParams({
message: `Expected an array with at least one valid string HTTPS url 'rpcUrls', Received:\n${rpcUrls}`,
}),
);
}
if (blockExplorerUrls !== null && !firstValidBlockExplorerUrl) {
return end(
ethErrors.rpc.invalidParams({
message: `Expected null or array with at least one valid string HTTPS URL 'blockExplorerUrl'. Received: ${blockExplorerUrls}`,
}),
);
}
const _chainId = typeof chainId === 'string' && chainId.toLowerCase();
if (!isPrefixedFormattedHexString(_chainId)) {
return end(
ethErrors.rpc.invalidParams({
message: `Expected 0x-prefixed, unpadded, non-zero hexadecimal string 'chainId'. Received:\n${chainId}`,
}),
);
}
if (!isSafeChainId(parseInt(_chainId, 16))) {
return end(
ethErrors.rpc.invalidParams({
message: `Invalid chain ID "${_chainId}": numerical value greater than max safe value. Received:\n${chainId}`,
}),
);
}
if (CHAIN_ID_TO_NETWORK_ID_MAP[_chainId]) {
return end(
ethErrors.rpc.invalidParams({
message: `May not specify default MetaMask chain.`,
}),
);
}
const existingNetwork = findCustomRpcBy({ chainId: _chainId });
if (existingNetwork !== null) {
const currentChainId = getCurrentChainId();
if (currentChainId === _chainId) {
res.result = null;
return end();
}
try {
await updateRpcTarget(
await requestUserApproval({
origin,
type: MESSAGE_TYPE.SWITCH_ETHEREUM_CHAIN,
requestData: {
rpcUrl: existingNetwork.rpcUrl,
chainId: existingNetwork.chainId,
nickname: existingNetwork.nickname,
ticker: existingNetwork.ticker,
},
}),
);
res.result = null;
} catch (error) {
return end(error);
}
return end();
}
let endpointChainId;
try {
endpointChainId = await jsonRpcRequest(firstValidRPCUrl, 'eth_chainId');
} catch (err) {
return end(
ethErrors.rpc.internal({
message: `Request for method 'eth_chainId on ${firstValidRPCUrl} failed`,
data: { networkErr: err },
}),
);
}
if (_chainId !== endpointChainId) {
return end(
ethErrors.rpc.invalidParams({
message: `Chain ID returned by RPC URL ${firstValidRPCUrl} does not match ${_chainId}`,
data: { chainId: endpointChainId },
}),
);
}
if (typeof chainName !== 'string' || !chainName) {
return end(
ethErrors.rpc.invalidParams({
message: `Expected non-empty string 'chainName'. Received:\n${chainName}`,
}),
);
}
const _chainName =
chainName.length > 100 ? chainName.substring(0, 100) : chainName;
if (nativeCurrency !== null) {
if (typeof nativeCurrency !== 'object' || Array.isArray(nativeCurrency)) {
return end(
ethErrors.rpc.invalidParams({
message: `Expected null or object 'nativeCurrency'. Received:\n${nativeCurrency}`,
}),
);
}
if (nativeCurrency.decimals !== 18) {
return end(
ethErrors.rpc.invalidParams({
message: `Expected the number 18 for 'nativeCurrency.decimals' when 'nativeCurrency' is provided. Received: ${nativeCurrency.decimals}`,
}),
);
}
if (!nativeCurrency.symbol || typeof nativeCurrency.symbol !== 'string') {
return end(
ethErrors.rpc.invalidParams({
message: `Expected a string 'nativeCurrency.symbol'. Received: ${nativeCurrency.symbol}`,
}),
);
}
}
const ticker = nativeCurrency?.symbol || 'ETH';
if (typeof ticker !== 'string' || ticker.length < 2 || ticker.length > 6) {
return end(
ethErrors.rpc.invalidParams({
message: `Expected 2-6 character string 'nativeCurrency.symbol'. Received:\n${ticker}`,
}),
);
}
try {
await addCustomRpc(
await requestUserApproval({
origin,
type: MESSAGE_TYPE.ADD_ETHEREUM_CHAIN,
requestData: {
chainId: _chainId,
blockExplorerUrl: firstValidBlockExplorerUrl,
chainName: _chainName,
rpcUrl: firstValidRPCUrl,
ticker,
},
}),
);
sendMetrics({
event: 'Custom Network Added',
category: 'Network',
referrer: {
url: origin,
},
sensitiveProperties: {
chain_id: _chainId,
rpc_url: firstValidRPCUrl,
network_name: _chainName,
// Including network to override the default network
// property included in all events. For RPC type networks
// the MetaMetrics controller uses the rpcUrl for the network
// property.
network: firstValidRPCUrl,
symbol: ticker,
block_explorer_url: firstValidBlockExplorerUrl,
source: 'dapp',
},
});
await updateRpcTarget(
await requestUserApproval({
origin,
type: MESSAGE_TYPE.SWITCH_ETHEREUM_CHAIN,
requestData: {
rpcUrl: firstValidRPCUrl,
chainId: _chainId,
nickname: _chainName,
ticker,
},
}),
);
res.result = null;
} catch (error) {
return end(error);
}
return end();
}

@ -1,6 +1,12 @@
import addEthereumChain from './add-ethereum-chain';
import getProviderState from './get-provider-state'; import getProviderState from './get-provider-state';
import logWeb3ShimUsage from './log-web3-shim-usage'; import logWeb3ShimUsage from './log-web3-shim-usage';
import watchAsset from './watch-asset'; import watchAsset from './watch-asset';
const handlers = [getProviderState, logWeb3ShimUsage, watchAsset]; const handlers = [
addEthereumChain,
getProviderState,
logWeb3ShimUsage,
watchAsset,
];
export default handlers; export default handlers;

@ -7,6 +7,7 @@ import { isValidAddress } from 'ethereumjs-util';
import log from 'loglevel'; import log from 'loglevel';
import jsonschema from 'jsonschema'; import jsonschema from 'jsonschema';
import { MESSAGE_TYPE } from '../../../shared/constants/app'; import { MESSAGE_TYPE } from '../../../shared/constants/app';
import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller';
import createId from './random-id'; import createId from './random-id';
/** /**
@ -313,6 +314,14 @@ export default class TypedMessageManager extends EventEmitter {
this._setMsgStatus(msgId, 'errored'); this._setMsgStatus(msgId, 'errored');
} }
/**
* Clears all unapproved messages from memory.
*/
clearUnapproved() {
this.messages = this.messages.filter((msg) => msg.status !== 'unapproved');
this._saveMsgList();
}
// //
// PRIVATE METHODS // PRIVATE METHODS
// //
@ -377,6 +386,6 @@ export default class TypedMessageManager extends EventEmitter {
unapprovedTypedMessages, unapprovedTypedMessages,
unapprovedTypedMessagesCount, unapprovedTypedMessagesCount,
}); });
this.emit('updateBadge'); this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE);
} }
} }

@ -35,7 +35,7 @@ import createTabIdMiddleware from './lib/createTabIdMiddleware';
import createOnboardingMiddleware from './lib/createOnboardingMiddleware'; import createOnboardingMiddleware from './lib/createOnboardingMiddleware';
import { setupMultiplex } from './lib/stream-utils'; import { setupMultiplex } from './lib/stream-utils';
import EnsController from './controllers/ens'; import EnsController from './controllers/ens';
import NetworkController from './controllers/network'; import NetworkController, { NETWORK_EVENTS } from './controllers/network';
import PreferencesController from './controllers/preferences'; import PreferencesController from './controllers/preferences';
import AppStateController from './controllers/app-state'; import AppStateController from './controllers/app-state';
import CachedBalancesController from './controllers/cached-balances'; import CachedBalancesController from './controllers/cached-balances';
@ -61,6 +61,12 @@ import seedPhraseVerifier from './lib/seed-phrase-verifier';
import MetaMetricsController from './controllers/metametrics'; import MetaMetricsController from './controllers/metametrics';
import { segment, segmentLegacy } from './lib/segment'; import { segment, segmentLegacy } from './lib/segment';
export const METAMASK_CONTROLLER_EVENTS = {
// Fired after state changes that impact the extension badge (unapproved msg count)
// The process of updating the badge happens in app/scripts/background.js.
UPDATE_BADGE: 'updateBadge',
};
export default class MetamaskController extends EventEmitter { export default class MetamaskController extends EventEmitter {
/** /**
* @constructor * @constructor
@ -127,7 +133,7 @@ export default class MetamaskController extends EventEmitter {
preferencesStore: this.preferencesController.store, preferencesStore: this.preferencesController.store,
onNetworkDidChange: this.networkController.on.bind( onNetworkDidChange: this.networkController.on.bind(
this.networkController, this.networkController,
'networkDidChange', NETWORK_EVENTS.NETWORK_DID_CHANGE,
), ),
getNetworkIdentifier: this.networkController.getNetworkIdentifier.bind( getNetworkIdentifier: this.networkController.getNetworkIdentifier.bind(
this.networkController, this.networkController,
@ -163,13 +169,22 @@ export default class MetamaskController extends EventEmitter {
// token exchange rate tracker // token exchange rate tracker
this.tokenRatesController = new TokenRatesController({ this.tokenRatesController = new TokenRatesController({
currency: this.currencyRateController,
preferences: this.preferencesController.store, preferences: this.preferencesController.store,
getNativeCurrency: () => {
const { ticker } = this.networkController.getProviderConfig();
return ticker ?? 'ETH';
},
}); });
this.ensController = new EnsController({ this.ensController = new EnsController({
provider: this.provider, provider: this.provider,
networkStore: this.networkController.networkStore, getCurrentChainId: this.networkController.getCurrentChainId.bind(
this.networkController,
),
onNetworkDidChange: this.networkController.on.bind(
this.networkController,
NETWORK_EVENTS.NETWORK_DID_CHANGE,
),
}); });
this.incomingTransactionsController = new IncomingTransactionsController({ this.incomingTransactionsController = new IncomingTransactionsController({
@ -214,11 +229,6 @@ export default class MetamaskController extends EventEmitter {
preferencesController: this.preferencesController, preferencesController: this.preferencesController,
}); });
// ensure accountTracker updates balances after network change
this.networkController.on('networkDidChange', () => {
this.accountTracker._updateAccounts();
});
const additionalKeyrings = [TrezorKeyring, LedgerBridgeKeyring]; const additionalKeyrings = [TrezorKeyring, LedgerBridgeKeyring];
this.keyringController = new KeyringController({ this.keyringController = new KeyringController({
keyringTypes: additionalKeyrings, keyringTypes: additionalKeyrings,
@ -245,7 +255,6 @@ export default class MetamaskController extends EventEmitter {
notifyDomain: this.notifyConnections.bind(this), notifyDomain: this.notifyConnections.bind(this),
notifyAllDomains: this.notifyAllConnections.bind(this), notifyAllDomains: this.notifyAllConnections.bind(this),
preferences: this.preferencesController.store, preferences: this.preferencesController.store,
showPermissionRequest: opts.showUserConfirmation,
}, },
initState.PermissionsController, initState.PermissionsController,
initState.PermissionsMetadata, initState.PermissionsMetadata,
@ -290,7 +299,6 @@ export default class MetamaskController extends EventEmitter {
), ),
preferencesStore: this.preferencesController.store, preferencesStore: this.preferencesController.store,
txHistoryLimit: 40, txHistoryLimit: 40,
getNetwork: this.networkController.getNetworkState.bind(this),
signTransaction: this.keyringController.signTransaction.bind( signTransaction: this.keyringController.signTransaction.bind(
this.keyringController, this.keyringController,
), ),
@ -323,7 +331,7 @@ export default class MetamaskController extends EventEmitter {
} }
}); });
this.networkController.on('networkDidChange', () => { this.networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, () => {
this.setCurrentCurrency( this.setCurrentCurrency(
this.currencyRateController.state.currentCurrency, this.currencyRateController.state.currentCurrency,
(error) => { (error) => {
@ -333,7 +341,8 @@ export default class MetamaskController extends EventEmitter {
}, },
); );
}); });
const { ticker } = this.networkController.getProviderConfig();
this.currencyRateController.configure({ nativeCurrency: ticker ?? 'ETH' });
this.networkController.lookupNetwork(); this.networkController.lookupNetwork();
this.messageManager = new MessageManager(); this.messageManager = new MessageManager();
this.personalMessageManager = new PersonalMessageManager(); this.personalMessageManager = new PersonalMessageManager();
@ -357,6 +366,21 @@ export default class MetamaskController extends EventEmitter {
tokenRatesStore: this.tokenRatesController.store, tokenRatesStore: this.tokenRatesController.store,
}); });
// ensure accountTracker updates balances after network change
this.networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, () => {
this.accountTracker._updateAccounts();
});
// clear unapproved transactions and messages when the network will change
this.networkController.on(NETWORK_EVENTS.NETWORK_WILL_CHANGE, () => {
this.txController.txStateManager.clearUnapprovedTxs();
this.encryptionPublicKeyManager.clearUnapproved();
this.personalMessageManager.clearUnapproved();
this.typedMessageManager.clearUnapproved();
this.decryptMessageManager.clearUnapproved();
this.messageManager.clearUnapproved();
});
// ensure isClientOpenAndUnlocked is updated when memState updates // ensure isClientOpenAndUnlocked is updated when memState updates
this.on('update', (memState) => this._onStateUpdate(memState)); this.on('update', (memState) => this._onStateUpdate(memState));
@ -559,6 +583,7 @@ export default class MetamaskController extends EventEmitter {
getApi() { getApi() {
const { const {
alertController, alertController,
approvalController,
keyringController, keyringController,
metaMetricsController, metaMetricsController,
networkController, networkController,
@ -883,6 +908,16 @@ export default class MetamaskController extends EventEmitter {
metaMetricsController.trackPage, metaMetricsController.trackPage,
metaMetricsController, metaMetricsController,
), ),
// approval controller
resolvePendingApproval: nodeify(
approvalController.resolve,
approvalController,
),
rejectPendingApproval: nodeify(
approvalController.reject,
approvalController,
),
}; };
} }
@ -2078,6 +2113,38 @@ export default class MetamaskController extends EventEmitter {
setWeb3ShimUsageRecorded: this.alertController.setWeb3ShimUsageRecorded.bind( setWeb3ShimUsageRecorded: this.alertController.setWeb3ShimUsageRecorded.bind(
this.alertController, this.alertController,
), ),
findCustomRpcBy: this.findCustomRpcBy.bind(this),
getCurrentChainId: this.networkController.getCurrentChainId.bind(
this.networkController,
),
requestUserApproval: this.approvalController.addAndShowApprovalRequest.bind(
this.approvalController,
),
updateRpcTarget: ({ rpcUrl, chainId, ticker, nickname }) => {
this.networkController.setRpcTarget(
rpcUrl,
chainId,
ticker,
nickname,
);
},
addCustomRpc: async ({
chainId,
blockExplorerUrl,
ticker,
chainName,
rpcUrl,
} = {}) => {
await this.preferencesController.addToFrequentRpcList(
rpcUrl,
chainId,
ticker,
chainName,
{
blockExplorerUrl,
},
);
},
}), }),
); );
// filter and subscription polyfills // filter and subscription polyfills
@ -2431,8 +2498,10 @@ export default class MetamaskController extends EventEmitter {
* @param {string} rpcUrl - A URL for a valid Ethereum RPC API. * @param {string} rpcUrl - A URL for a valid Ethereum RPC API.
* @param {string} chainId - The chainId of the selected network. * @param {string} chainId - The chainId of the selected network.
* @param {string} ticker - The ticker symbol of the selected network. * @param {string} ticker - The ticker symbol of the selected network.
* @param {string} nickname - Optional nickname of the selected network. * @param {string} [nickname] - Nickname of the selected network.
* @returns {Promise<String>} The RPC Target URL confirmed. * @param {Object} [rpcPrefs] - RPC preferences.
* @param {string} [rpcPrefs.blockExplorerUrl] - URL of block explorer for the chain.
* @returns {Promise<String>} - The RPC Target URL confirmed.
*/ */
async updateAndSetCustomRpc( async updateAndSetCustomRpc(
rpcUrl, rpcUrl,
@ -2513,6 +2582,25 @@ export default class MetamaskController extends EventEmitter {
await this.preferencesController.removeFromFrequentRpcList(rpcUrl); await this.preferencesController.removeFromFrequentRpcList(rpcUrl);
} }
/**
* Returns the first RPC info object that matches at least one field of the
* provided search criteria. Returns null if no match is found
*
* @param {Object} rpcInfo - The RPC endpoint properties and values to check.
* @returns {Object} rpcInfo found in the frequentRpcList
*/
findCustomRpcBy(rpcInfo) {
const frequentRpcListDetail = this.preferencesController.getFrequentRpcListDetail();
for (const existingRpcInfo of frequentRpcListDetail) {
for (const key of Object.keys(rpcInfo)) {
if (existingRpcInfo[key] === rpcInfo[key]) {
return existingRpcInfo;
}
}
}
return null;
}
async initializeThreeBox() { async initializeThreeBox() {
await this.threeBoxController.init(); await this.threeBoxController.init();
} }

@ -0,0 +1,125 @@
import { cloneDeep } from 'lodash';
import {
GOERLI,
GOERLI_CHAIN_ID,
KOVAN,
KOVAN_CHAIN_ID,
MAINNET,
MAINNET_CHAIN_ID,
NETWORK_TYPE_RPC,
RINKEBY,
RINKEBY_CHAIN_ID,
ROPSTEN,
ROPSTEN_CHAIN_ID,
} from '../../../shared/constants/network';
const version = 52;
/**
* Migrate tokens in Preferences to be keyed by chainId instead of
* providerType. To prevent breaking user's MetaMask and selected
* tokens, this migration copies the RPC entry into *every* custom RPC
* chainId.
*/
export default {
version,
async migrate(originalVersionedData) {
const versionedData = cloneDeep(originalVersionedData);
versionedData.meta.version = version;
const state = versionedData.data;
versionedData.data = transformState(state);
return versionedData;
},
};
function transformState(state = {}) {
if (state.PreferencesController) {
const {
accountTokens,
accountHiddenTokens,
frequentRpcListDetail,
} = state.PreferencesController;
const newAccountTokens = {};
const newAccountHiddenTokens = {};
if (accountTokens && Object.keys(accountTokens).length > 0) {
for (const address of Object.keys(accountTokens)) {
newAccountTokens[address] = {};
if (accountTokens[address][NETWORK_TYPE_RPC]) {
frequentRpcListDetail.forEach((detail) => {
newAccountTokens[address][detail.chainId] =
accountTokens[address][NETWORK_TYPE_RPC];
});
}
for (const providerType of Object.keys(accountTokens[address])) {
switch (providerType) {
case MAINNET:
newAccountTokens[address][MAINNET_CHAIN_ID] =
accountTokens[address][MAINNET];
break;
case ROPSTEN:
newAccountTokens[address][ROPSTEN_CHAIN_ID] =
accountTokens[address][ROPSTEN];
break;
case RINKEBY:
newAccountTokens[address][RINKEBY_CHAIN_ID] =
accountTokens[address][RINKEBY];
break;
case GOERLI:
newAccountTokens[address][GOERLI_CHAIN_ID] =
accountTokens[address][GOERLI];
break;
case KOVAN:
newAccountTokens[address][KOVAN_CHAIN_ID] =
accountTokens[address][KOVAN];
break;
default:
break;
}
}
}
state.PreferencesController.accountTokens = newAccountTokens;
}
if (accountHiddenTokens && Object.keys(accountHiddenTokens).length > 0) {
for (const address of Object.keys(accountHiddenTokens)) {
newAccountHiddenTokens[address] = {};
if (accountHiddenTokens[address][NETWORK_TYPE_RPC]) {
frequentRpcListDetail.forEach((detail) => {
newAccountHiddenTokens[address][detail.chainId] =
accountHiddenTokens[address][NETWORK_TYPE_RPC];
});
}
for (const providerType of Object.keys(accountHiddenTokens[address])) {
switch (providerType) {
case MAINNET:
newAccountHiddenTokens[address][MAINNET_CHAIN_ID] =
accountHiddenTokens[address][MAINNET];
break;
case ROPSTEN:
newAccountHiddenTokens[address][ROPSTEN_CHAIN_ID] =
accountHiddenTokens[address][ROPSTEN];
break;
case RINKEBY:
newAccountHiddenTokens[address][RINKEBY_CHAIN_ID] =
accountHiddenTokens[address][RINKEBY];
break;
case GOERLI:
newAccountHiddenTokens[address][GOERLI_CHAIN_ID] =
accountHiddenTokens[address][GOERLI];
break;
case KOVAN:
newAccountHiddenTokens[address][KOVAN_CHAIN_ID] =
accountHiddenTokens[address][KOVAN];
break;
default:
break;
}
}
}
state.PreferencesController.accountHiddenTokens = newAccountHiddenTokens;
}
}
return state;
}

@ -56,6 +56,7 @@ const migrations = [
require('./049').default, require('./049').default,
require('./050').default, require('./050').default,
require('./051').default, require('./051').default,
require('./052').default,
]; ];
export default migrations; export default migrations;

@ -196,7 +196,9 @@ export default class ExtensionPlatform {
const nonce = parseInt(txMeta.txParams.nonce, 16); const nonce = parseInt(txMeta.txParams.nonce, 16);
const title = 'Confirmed transaction'; const title = 'Confirmed transaction';
const message = `Transaction ${nonce} confirmed! View on Etherscan`; const message = `Transaction ${nonce} confirmed! ${
url.length ? 'View on Etherscan' : ''
}`;
this._showNotification(title, message, url); this._showNotification(title, message, url);
} }

@ -16,6 +16,17 @@ const createStyleTasks = require('./styles');
const createStaticAssetTasks = require('./static'); const createStaticAssetTasks = require('./static');
const createEtcTasks = require('./etc'); const createEtcTasks = require('./etc');
// packages required dynamically via browserify configuration in dependencies
require('loose-envify');
require('@babel/plugin-proposal-object-rest-spread');
require('@babel/plugin-transform-runtime');
require('@babel/plugin-proposal-class-properties');
require('@babel/plugin-proposal-optional-chaining');
require('@babel/plugin-proposal-nullish-coalescing-operator');
require('@babel/preset-env');
require('@babel/preset-react');
require('@babel/core');
const browserPlatforms = ['firefox', 'chrome', 'brave', 'opera']; const browserPlatforms = ['firefox', 'chrome', 'brave', 'opera'];
defineAllTasks(); defineAllTasks();

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save