From 03f9c70ae781b4f6cae562f6c78dbda52dfededb Mon Sep 17 00:00:00 2001 From: Alex Jupiter Date: Wed, 18 May 2022 14:34:00 +0100 Subject: [PATCH 01/10] Copy updates, referral and tutorial buttons --- app/_locales/en/messages.json | 21 ++-- .../connect-hardware/index.scss | 27 ++++ .../connect-hardware/select-hardware.js | 119 ++++++++++++------ 3 files changed, 121 insertions(+), 46 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index b63775632c56..b3d7222e3447 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -36,14 +36,17 @@ "message": "Scan QR Code" }, "QRHardwareWalletSteps1Description": { - "message": "Connect an airgapped hardware wallet that communicates through QR-codes. Officially supported airgapped hardware wallets include:" + "message": "You can choose from a list of official QR-code supporting partners below." }, "QRHardwareWalletSteps1Title": { - "message": "QR-based HW Wallet" + "message": "Connect your QR hardware wallet" }, "QRHardwareWalletSteps2Description": { "message": "Ngrave (Coming Soon)" }, + "QRHardwareWalletSteps3Description": { + "message": "CoolWallet (Coming Soon)" + }, "about": { "message": "About" }, @@ -1400,7 +1403,7 @@ "message": "GWEI" }, "happyToSeeYou": { - "message": "We’re happy to see you." + "message": "We’re happy to see you.." }, "hardware": { "message": "Hardware" @@ -3051,10 +3054,10 @@ "message": "Not connected" }, "step1LatticeWallet": { - "message": "Make sure your Lattice1 is ready to connect" + "message": "Connect your Lattice1" }, "step1LatticeWalletMsg": { - "message": "You can connect MetaMask to your Lattice1 device once it is set up and online. Unlock your device and have your Device ID ready. For more on using hardware wallets, $1", + "message": "You can connect MetaMask to your Lattice1 device once it is set up and online. Unlock your device and have your Device ID ready.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, "step1LedgerWallet": { @@ -3065,17 +3068,17 @@ "description": "$1 represents the `ledgerLiveApp` localization value" }, "step1TrezorWallet": { - "message": "Plug in Trezor wallet" + "message": "Connect your Trezor" }, "step1TrezorWalletMsg": { - "message": "Connect your wallet directly to your computer. For more on using your hardware wallet device, $1", + "message": "Plug your Trezor directly into your computer and unlock it. Make sure you use the correct passphrase.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, "step2LedgerWallet": { - "message": "Plug in Ledger wallet" + "message": "Connect your Ledger" }, "step2LedgerWalletMsg": { - "message": "Connect your wallet directly to your computer. Unlock your Ledger and open the Ethereum app. For more on using your hardware wallet device, $1.", + "message": "Plug your Ledger directly into your computer, then unlock it and open the Ethereum app.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, "storePhrase": { diff --git a/ui/pages/create-account/connect-hardware/index.scss b/ui/pages/create-account/connect-hardware/index.scss index 86517efe4a1c..4521e4a48be0 100644 --- a/ui/pages/create-account/connect-hardware/index.scss +++ b/ui/pages/create-account/connect-hardware/index.scss @@ -25,6 +25,13 @@ } } + &__QR-subtitle { + @include H5; + + margin-top: 10px; + color: var(--color-text-default); + } + &__btn-wrapper { flex: 1; flex-direction: row; @@ -41,6 +48,26 @@ opacity: 0.5; } + &__external-btn-first { + @include H7; + + padding: 5px 10px; + width: auto; + display: inline; + margin-top: 10px; + + margin-right: 20px; + } + + &__external-btn { + @include H7; + + padding: 5px 10px; + width: auto; + display: inline; + margin-top: 10px; + } + &__btn { background: var(--color-background-alternative); border: 1px solid var(--color-border-muted); diff --git a/ui/pages/create-account/connect-hardware/select-hardware.js b/ui/pages/create-account/connect-hardware/select-hardware.js index fc058ae45093..27243c4cb7d3 100644 --- a/ui/pages/create-account/connect-hardware/select-hardware.js +++ b/ui/pages/create-account/connect-hardware/select-hardware.js @@ -194,7 +194,7 @@ export default class SelectHardware extends Component { steps.push({ asset: 'plug-in-wallet', dimensions: { width: '225px', height: '75px' }, - title: this.context.t('step2LedgerWallet'), + title: this.context.t('step2LedgerWallet'), message: this.context.t('step2LedgerWalletMsg', [ (

{step.title}

+ +

{step.message}

{step.asset && ( (

{step.title}

+ +

{step.message}

{step.asset && ( (

{step.title}

+ +

{step.message}

{step.asset && ( -
- {this.context.t('keystone')} - - - {this.context.t('keystoneTutorial')} - +

Keystone

+ + ), }, { message: ( <> - - {this.context.t('airgapVault')} - - - {this.context.t('airgapVaultTutorial')} - +

AirGap Vault

+ + ), }, { message: this.context.t('QRHardwareWalletSteps2Description'), }, + { + message: this.context.t('QRHardwareWalletSteps3Description'), + }, { asset: 'qrcode-wallet-demo', dimensions: { width: '225px', height: '75px' }, From edf7269cb3b4165242e99a5ee19401ce345de041 Mon Sep 17 00:00:00 2001 From: Alex Jupiter Date: Wed, 18 May 2022 14:53:55 +0100 Subject: [PATCH 02/10] Update messages.json --- app/_locales/en/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index b3d7222e3447..612e590dce2c 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1403,7 +1403,7 @@ "message": "GWEI" }, "happyToSeeYou": { - "message": "We’re happy to see you.." + "message": "We’re happy to see you." }, "hardware": { "message": "Hardware" From 201df5f21b23a5db942f79345c3e1e97af44e9be Mon Sep 17 00:00:00 2001 From: Alex Jupiter Date: Mon, 25 Jul 2022 17:35:41 +0100 Subject: [PATCH 03/10] New QR hardware wallets --- .../connect-hardware/select-hardware.js | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/ui/pages/create-account/connect-hardware/select-hardware.js b/ui/pages/create-account/connect-hardware/select-hardware.js index 27243c4cb7d3..8eb52d3ce20b 100644 --- a/ui/pages/create-account/connect-hardware/select-hardware.js +++ b/ui/pages/create-account/connect-hardware/select-hardware.js @@ -11,6 +11,7 @@ import { DEVICE_NAMES, LEDGER_TRANSPORT_TYPES, } from '../../../../shared/constants/hardware-wallets'; +import { message } from '@truffle/codec/dist/lib/format/utils/exception'; export default class SelectHardware extends Component { static contextTypes = { @@ -406,10 +407,49 @@ export default class SelectHardware extends Component { ), }, { - message: this.context.t('QRHardwareWalletSteps2Description'), + message: ( + <> +

CoolWallet

+ + + + ), }, { - message: this.context.t('QRHardwareWalletSteps3Description'), + message: ( + <> +

D'Cent

+ + + + ), + }, + { + message: this.context.t('QRHardwareWalletSteps2Description'), }, { asset: 'qrcode-wallet-demo', From 00a15b0807b62564a4ecce8b57e3e1bb51d1dd90 Mon Sep 17 00:00:00 2001 From: Alex Jupiter Date: Mon, 25 Jul 2022 17:40:51 +0100 Subject: [PATCH 04/10] Update select-hardware.js --- ui/pages/create-account/connect-hardware/select-hardware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/pages/create-account/connect-hardware/select-hardware.js b/ui/pages/create-account/connect-hardware/select-hardware.js index 8eb52d3ce20b..6b7248a8b4ea 100644 --- a/ui/pages/create-account/connect-hardware/select-hardware.js +++ b/ui/pages/create-account/connect-hardware/select-hardware.js @@ -443,7 +443,7 @@ export default class SelectHardware extends Component { type="secondary" onClick={() => window.open("https://medium.com/dcentwallet/dcent-wallet-now-supports-qr-based-protocol-to-link-with-metamask-57555f02603f", "_blank") }> - + {t('addContact')} + Tutorial ), From d511ae1833ab305d6952c65673d939fcd1990554 Mon Sep 17 00:00:00 2001 From: Alex Jupiter Date: Wed, 27 Jul 2022 13:56:42 +0100 Subject: [PATCH 05/10] Internationalisation --- app/_locales/en/messages.json | 9 ++++++ .../connect-hardware/select-hardware.js | 28 +++++++++---------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 612e590dce2c..a34af875bb96 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -429,6 +429,9 @@ "message": "Transak supports credit & debit cards, Apple Pay, MobiKwik, and bank transfers (depending on location) in 100+ countries. $1 deposits directly into your MetaMask account.", "description": "$1 represents the crypto symbol to be purchased" }, + "buyNow": { + "message": "Buy Now" + }, "buyWithWyre": { "message": "Buy ETH with Wyre" }, @@ -870,6 +873,9 @@ "downloadGoogleChrome": { "message": "Download Google Chrome" }, + "downloadNow": { + "message": "Download Now" + }, "downloadSecretBackup": { "message": "Download this Secret Recovery Phrase and keep it stored safely on an external encrypted hard drive or storage medium." }, @@ -3783,6 +3789,9 @@ "tryAgain": { "message": "Try again" }, + "tutorial": { + "message": "Tutorial" + }, "turnOnTokenDetection": { "message": "Turn on enhanced token detection" }, diff --git a/ui/pages/create-account/connect-hardware/select-hardware.js b/ui/pages/create-account/connect-hardware/select-hardware.js index 6b7248a8b4ea..1e9f611fea84 100644 --- a/ui/pages/create-account/connect-hardware/select-hardware.js +++ b/ui/pages/create-account/connect-hardware/select-hardware.js @@ -220,7 +220,7 @@ export default class SelectHardware extends Component { onClick={() => window.open("https://shop.ledger.com/?r=17c4991a03fa", "_blank") } > - Buy Now + {this.context.t('buyNow')}

{step.message}

{step.asset && ( @@ -276,7 +276,7 @@ export default class SelectHardware extends Component { onClick={() => window.open("https://gridplus.io/?afmc=7p", "_blank") } > - Buy Now + {this.context.t('buyNow')}

{step.message}

{step.asset && ( @@ -332,7 +332,7 @@ export default class SelectHardware extends Component { onClick={() => window.open("https://shop.trezor.io/product/trezor-one-black?offer_id=35&aff_id=11009", "_blank") } > - Buy Now + {this.context.t('buyNow')}

{step.message}

{step.asset && ( @@ -373,14 +373,14 @@ export default class SelectHardware extends Component { type="secondary" onClick={() => window.open("https://shop.keyst.one/?rfsn=6088257.656b3e9&utm_source=refersion&utm_medium=affiliate&utm_campaign=6088257.656b3e9", "_blank") }> - Buy Now + {this.context.t('buyNow')} ), @@ -394,14 +394,14 @@ export default class SelectHardware extends Component { type="secondary" onClick={() => window.open("https://airgap.it/", "_blank") }> - Download Now + {this.context.t('downloadNow')} ), @@ -415,14 +415,14 @@ export default class SelectHardware extends Component { type="secondary" onClick={() => window.open("https://www.coolwallet.io/", "_blank") }> - Buy Now + {this.context.t('buyNow')} ), @@ -436,14 +436,14 @@ export default class SelectHardware extends Component { type="secondary" onClick={() => window.open("https://dcentwallet.com/", "_blank") }> - Buy Now + {this.context.t('buyNow')} ), From 72c9e1e0b218166eda250fb38d08a17c7e9f8bd9 Mon Sep 17 00:00:00 2001 From: Alex Jupiter Date: Wed, 27 Jul 2022 18:15:58 +0100 Subject: [PATCH 06/10] First metric --- .../connect-hardware/select-hardware.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/pages/create-account/connect-hardware/select-hardware.js b/ui/pages/create-account/connect-hardware/select-hardware.js index 1e9f611fea84..0ddd457c2faf 100644 --- a/ui/pages/create-account/connect-hardware/select-hardware.js +++ b/ui/pages/create-account/connect-hardware/select-hardware.js @@ -411,9 +411,15 @@ export default class SelectHardware extends Component { <>

CoolWallet

From 597a9088f9f4d44c58c12242a3ea2258e7562b59 Mon Sep 17 00:00:00 2001 From: Alex Jupiter Date: Wed, 27 Jul 2022 22:44:40 +0100 Subject: [PATCH 07/10] Revert "Merge branch 'hardware-wallets-referral-and-tutorial-links' of https://github.com/MetaMask/metamask-extension into hardware-wallets-referral-and-tutorial-links" This reverts commit 416abd75b15e0998cdfa073f436e475982d3679e, reversing changes made to d511ae1833ab305d6952c65673d939fcd1990554. --- .circleci/config.yml | 78 +- .circleci/scripts/bundle-stats-commit.sh | 70 - .circleci/scripts/chrome-install.sh | 4 +- .circleci/scripts/firefox-install.sh | 2 +- .depcheckrc.yml | 1 - .eslintrc.js | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 +- .iyarc | 3 +- .metamaskrc.dist | 3 - .nvmrc | 2 +- .storybook/1.INTRODUCTION.stories.mdx | 2 +- .storybook/3.COLORS.stories.mdx | 39 +- .storybook/4.BREAKPOINTS.stories.mdx | 125 - .storybook/initial-states/transactions.js | 1921 ------ .storybook/preview.js | 2 +- .storybook/test-data.js | 394 +- CHANGELOG.md | 192 +- README.md | 8 +- app/_locales/am/messages.json | 4 +- app/_locales/ar/messages.json | 2 +- app/_locales/bg/messages.json | 4 +- app/_locales/bn/messages.json | 4 +- app/_locales/ca/messages.json | 4 +- app/_locales/da/messages.json | 4 +- app/_locales/de/messages.json | 142 +- app/_locales/el/messages.json | 140 +- app/_locales/en/messages.json | 186 +- app/_locales/es/messages.json | 142 +- app/_locales/es_419/messages.json | 12 +- app/_locales/et/messages.json | 4 +- app/_locales/fa/messages.json | 4 +- app/_locales/fi/messages.json | 4 +- app/_locales/fil/messages.json | 4 +- app/_locales/fr/messages.json | 146 +- app/_locales/he/messages.json | 2 +- app/_locales/hi/messages.json | 138 +- app/_locales/hr/messages.json | 4 +- app/_locales/hu/messages.json | 2 +- app/_locales/id/messages.json | 138 +- app/_locales/it/messages.json | 4 +- app/_locales/ja/messages.json | 140 +- app/_locales/kn/messages.json | 4 +- app/_locales/ko/messages.json | 138 +- app/_locales/lt/messages.json | 4 +- app/_locales/lv/messages.json | 4 +- app/_locales/ms/messages.json | 4 +- app/_locales/no/messages.json | 4 +- app/_locales/ph/messages.json | 12 +- app/_locales/pl/messages.json | 4 +- app/_locales/pt/messages.json | 140 +- app/_locales/pt_BR/messages.json | 12 +- app/_locales/ro/messages.json | 4 +- app/_locales/ru/messages.json | 140 +- app/_locales/sk/messages.json | 4 +- app/_locales/sl/messages.json | 4 +- app/_locales/sr/messages.json | 4 +- app/_locales/sv/messages.json | 4 +- app/_locales/sw/messages.json | 4 +- app/_locales/tl/messages.json | 142 +- app/_locales/tr/messages.json | 140 +- app/_locales/uk/messages.json | 4 +- app/_locales/vi/messages.json | 140 +- app/_locales/zh/messages.json | 146 +- app/_locales/zh_CN/messages.json | 14 +- app/_locales/zh_TW/messages.json | 4 +- app/home.html | 5 +- app/images/fantom-opera.svg | 1 - app/images/harmony-one.svg | 1 - app/images/info-fox.svg | 1 - .../recovery-onboarding/subtitles/de.vtt | 68 +- .../recovery-onboarding/subtitles/el.vtt | 98 - .../recovery-onboarding/subtitles/es.vtt | 3 +- .../recovery-onboarding/subtitles/fr.vtt | 98 - .../recovery-onboarding/subtitles/hi.vtt | 69 +- .../recovery-onboarding/subtitles/id.vtt | 63 +- .../recovery-onboarding/subtitles/ja.vtt | 67 +- .../recovery-onboarding/subtitles/ko.vtt | 69 +- .../recovery-onboarding/subtitles/pt.vtt | 79 +- .../recovery-onboarding/subtitles/ru.vtt | 63 +- .../recovery-onboarding/subtitles/tl.vtt | 3 +- .../recovery-onboarding/subtitles/tr.vtt | 116 - .../recovery-onboarding/subtitles/vi.vtt | 84 +- .../recovery-onboarding/subtitles/zh.vtt | 98 - app/manifest/{v2 => }/_base.json | 4 +- app/manifest/{v2 => }/brave.json | 0 app/manifest/{v2 => }/chrome.json | 0 app/manifest/{v2 => }/firefox.json | 0 app/manifest/{v2 => }/opera.json | 0 app/manifest/v3/_base.json | 76 - app/manifest/v3/brave.json | 1 - app/manifest/v3/chrome.json | 7 - app/manifest/v3/firefox.json | 26 - app/manifest/v3/opera.json | 9 - app/phishing.html | 150 + app/popup.html | 5 +- app/scripts/app-init.js | 124 - app/scripts/background.js | 168 +- app/scripts/constants/contracts.js | 14 - app/scripts/constants/on-ramp.js | 1 - app/scripts/contentscript.js | 82 +- app/scripts/controllers/detect-tokens.js | 6 +- app/scripts/controllers/detect-tokens.test.js | 28 +- app/scripts/controllers/ens/ens.js | 17 +- app/scripts/controllers/ens/index.test.js | 2 +- .../controllers/incoming-transactions.js | 3 +- app/scripts/controllers/metametrics.js | 17 +- app/scripts/controllers/metametrics.test.js | 10 +- app/scripts/controllers/network/network.js | 8 +- .../permissions/flask/snap-permissions.js | 2 +- app/scripts/controllers/preferences.js | 12 - app/scripts/controllers/transactions/index.js | 131 +- .../controllers/transactions/index.test.js | 145 +- .../transactions/pending-tx-tracker.js | 3 +- .../transactions/tx-state-manager.js | 23 +- .../transactions/tx-state-manager.test.js | 109 +- app/scripts/init-globals.js | 18 - .../lib/ComposableObservableStore.test.js | 4 +- app/scripts/lib/account-tracker.js | 74 +- app/scripts/lib/buy-url.js | 49 +- .../lib/createRPCMethodTrackingMiddleware.js | 228 +- .../createRPCMethodTrackingMiddleware.test.js | 217 - app/scripts/lib/ens-ipfs/setup.js | 3 +- app/scripts/lib/metaRPCClientFactory.js | 29 +- app/scripts/lib/metaRPCClientFactory.test.js | 17 - app/scripts/lib/network-store.js | 3 +- .../handlers/add-ethereum-chain.js | 74 +- app/scripts/lib/setupSentry.js | 12 +- app/scripts/lib/util.js | 2 +- app/scripts/lib/util.test.js | 7 + app/scripts/metamask-controller.js | 457 +- app/scripts/metamask-controller.test.js | 55 - app/scripts/migrations/072.js | 30 - app/scripts/migrations/072.test.js | 427 -- app/scripts/migrations/index.js | 2 - app/scripts/phishing-detect.js | 40 + app/scripts/ui.js | 43 +- development/README.md | 21 - development/build/README.md | 36 +- development/build/constants.js | 48 - development/build/etc.js | 12 +- development/build/index.js | 157 +- development/build/manifest.js | 18 +- development/build/scripts.js | 228 +- development/build/static.js | 13 +- development/build/styles.js | 7 +- development/build/transforms/utils.test.js | 2 +- .../charts/flamegraph/chart/index.html | 170 - .../flamegraph/lib/d3-flamegraph-tooltip.js | 3117 --------- .../charts/flamegraph/lib/d3-flamegraph.css | 46 - .../charts/flamegraph/lib/d3-flamegraph.js | 5719 ----------------- development/charts/table/index.html | 67 - development/charts/table/jquery.min.js | 18 - development/metamaskbot-build-announce.js | 12 - development/sourcemap-validator.js | 1 + docs/trezor-emulator.md | 2 +- jest.config.js | 12 +- lavamoat/browserify/beta/policy.json | 500 +- lavamoat/browserify/flask/policy.json | 500 +- lavamoat/browserify/main/policy.json | 500 +- lavamoat/browserify/policy-override.json | 7 - lavamoat/build-system/policy-override.json | 30 - lavamoat/build-system/policy.json | 305 +- package.json | 42 +- patches/@lavamoat+lavapack+3.1.0.patch | 15 - patches/abort-controller+3.0.0.patch | 5 +- patches/bip39+2.5.0.patch | 99 + patches/eth-hd-keyring+3.6.0.patch | 43 + patches/eth-keyring-controller+6.2.1.patch | 37 + patches/yargs+17.4.1.patch | 11 - shared/constants/app.js | 5 - shared/constants/gas.js | 17 +- shared/constants/metametrics.js | 21 - shared/constants/network.js | 135 +- shared/constants/permissions.js | 1 - shared/constants/permissions.test.js | 2 +- shared/constants/phishing.js | 4 - shared/constants/swaps.js | 5 - shared/constants/tokens.js | 13 - shared/constants/transaction.js | 95 +- shared/modules/fetch-with-timeout.js | 3 +- shared/modules/fetch-with-timeout.test.js | 8 +- shared/modules/mv3.utils.js | 4 - shared/modules/object.utils.js | 22 - shared/modules/rpc.utils.js | 3 +- shared/modules/transaction.utils.js | 48 +- shared/modules/transaction.utils.test.js | 89 +- shared/notifications/index.js | 15 +- test/data/mock-state.json | 16 - test/e2e/benchmark.js | 35 +- test/e2e/fixtures/address-entry/state.json | 3 - test/e2e/fixtures/connected-state/state.json | 3 - test/e2e/fixtures/custom-rpc/state.json | 3 - test/e2e/fixtures/custom-token/state.json | 3 - test/e2e/fixtures/eip-1559-v2-dapp/state.json | 3 - test/e2e/fixtures/eip-1559-v2/state.json | 3 - test/e2e/fixtures/import-ui/state.json | 3 - test/e2e/fixtures/imported-account/state.json | 3 - test/e2e/fixtures/localization/state.json | 3 - test/e2e/fixtures/metrics-enabled/state.json | 3 - .../fixtures/navigate-transactions/state.json | 3 - test/e2e/fixtures/onboarding/state.json | 3 - test/e2e/fixtures/send-edit-v2/state.json | 3 - test/e2e/fixtures/send-edit/state.json | 3 - test/e2e/fixtures/special-settings/state.json | 149 - test/e2e/fixtures/threebox-enabled/state.json | 3 - test/e2e/helpers.js | 34 +- test/e2e/lavamoat-stats.js | 140 - test/e2e/metamask-ui.spec.js | 8 +- test/e2e/mock-e2e.js | 51 - .../index.html | 20 - test/e2e/mock-page-with-iframe/index.html | 11 - test/e2e/mv3-perf-stats/bundle-size.js | 119 - test/e2e/mv3-perf-stats/index.js | 2 - test/e2e/mv3-perf-stats/init-load-stats.js | 111 - test/e2e/mv3-stats.js | 111 - test/e2e/phishing-warning-page-server.js | 58 - test/e2e/run-e2e-test.js | 3 - .../ganache-contract-address-registry.js | 28 - test/e2e/seeder/ganache-seeder.js | 88 - test/e2e/seeder/smart-contracts.js | 43 - test/e2e/snaps/enums.js | 3 - test/e2e/snaps/test-snap-bip-44.spec.js | 28 +- test/e2e/snaps/test-snap-confirm.spec.js | 20 +- test/e2e/snaps/test-snap-error.spec.js | 16 +- test/e2e/snaps/test-snap-managestate.spec.js | 72 +- test/e2e/snaps/test-snap-notification.spec.js | 109 - test/e2e/tests/add-hide-token.spec.js | 8 +- test/e2e/tests/address-book.spec.js | 1 + test/e2e/tests/chain-interactions.spec.js | 56 +- test/e2e/tests/contract-interactions.spec.js | 2 +- test/e2e/tests/custom-rpc-history.spec.js | 12 +- .../tests/custom-token-add-approve.spec.js | 358 -- test/e2e/tests/dapp-interactions.spec.js | 8 +- test/e2e/tests/from-import-ui.spec.js | 5 +- test/e2e/tests/incremental-security.spec.js | 6 +- test/e2e/tests/metamask-responsive-ui.spec.js | 8 +- test/e2e/tests/navigate-transactions.spec.js | 4 + test/e2e/tests/phishing-detection.spec.js | 123 +- test/e2e/tests/provider-api.spec.js | 4 +- test/e2e/tests/send-eth.spec.js | 48 - test/e2e/tests/send-hex-address.spec.js | 329 - test/e2e/tests/send-to-contract.spec.js | 83 - test/e2e/tests/settings-search.spec.js | 9 + test/e2e/tests/state-logs.spec.js | 65 - test/e2e/tests/swap-eth.spec.js | 4 +- test/e2e/webdriver/chrome.js | 12 +- test/e2e/webdriver/driver.js | 26 +- test/e2e/webdriver/firefox.js | 19 +- test/e2e/webdriver/index.js | 6 +- test/helpers/file.js | 37 - test/jest/mock-store.js | 146 +- test/jest/mocks.js | 44 - .../account-menu/account-menu.component.js | 66 +- .../account-menu/account-menu.container.js | 10 +- ui/components/app/account-menu/index.scss | 44 +- ui/components/app/add-network/add-network.js | 385 +- .../app/add-network/add-network.test.js | 60 - ui/components/app/add-network/index.scss | 54 +- .../advanced-gas-controls.component.js | 6 +- .../app/advanced-gas-controls/index.scss | 2 +- .../advanced-gas-fee-defaults.js | 4 +- .../advanced-gas-fee-gas-limit.js | 11 +- .../advanced-gas-fee-input-subtext.js | 2 +- .../base-fee-input/base-fee-input.js | 2 +- .../priority-fee-input/priority-fee-input.js | 7 +- .../advanced-gas-fee-save.js | 5 +- ui/components/app/app-components.scss | 1 - .../app/app-header/app-header.component.js | 19 +- .../app/app-header/app-header.container.js | 10 - ui/components/app/app-header/index.scss | 21 - .../app/asset-list-item/asset-list-item.js | 4 +- ui/components/app/asset-list/asset-list.js | 10 +- .../cancel-speedup-popover.js | 17 +- .../collectible-default-image.js | 41 - .../collectible-default-image.stories.js | 42 - .../app/collectible-default-image/index.js | 1 - .../app/collectible-default-image/index.scss | 22 - .../collectible-details.js | 17 +- .../collectible-details.stories.js | 36 +- .../collectibles-detection-notice.js | 5 +- .../collectibles-items/collectibles-items.js | 77 +- .../app/collectibles-items/index.scss | 30 +- .../collectibles-tab/collectibles-tab.test.js | 6 +- .../confirm-detail-row.stories.js | 47 - .../confirm-detail-row/index.scss | 4 +- ...onfirm-page-container-summary.component.js | 9 +- .../enableEIP1559V2-notice.js | 4 +- .../connected-accounts-list.stories.js | 38 - .../connected-sites-list.component.js | 8 +- .../app/connected-sites-list/index.scss | 4 + .../app/currency-input/currency-input.js | 40 +- .../app/currency-input/currency-input.test.js | 21 +- .../detected-token-address.js | 3 +- .../detected-token-ignored-popover.js | 5 +- .../app/detected-token/detected-token.js | 20 +- .../app/detected-token/detected-token.test.js | 6 +- ui/components/app/dropdowns/dropdown.js | 2 +- .../app/dropdowns/network-dropdown.js | 13 +- .../app/dropdowns/network-dropdown.test.js | 5 +- .../edit-gas-display.component.js | 6 +- .../edit-gas-display.stories.js | 14 +- ui/components/app/edit-gas-display/index.scss | 4 +- .../edit-gas-fee-button.js | 23 +- .../app/edit-gas-fee-button/index.scss | 7 - .../edit-gas-fee-popover.js | 32 +- .../edit-gas-item/edit-gas-item.js | 3 +- .../edit-gas-item/index.scss | 2 +- .../edit-gas-tooltip/index.scss | 2 +- .../network-statistics/network-statistics.js | 3 +- .../status-slider/index.scss | 2 +- .../status-slider/status-slider.js | 5 +- .../network-statistics/tooltips.js | 2 +- .../flask/snaps-authorship-pill/index.scss | 23 +- .../snaps-authorship-pill.js | 50 +- .../snaps-authorship-pill.stories.js | 8 +- .../advanced-gas-inputs/index.scss | 4 +- .../gas-price-button-group.stories.js | 47 - .../gas-price-button-group/index.scss | 2 +- .../gas-slider/gas-slider.stories.js | 34 - .../gas-customization/gas-slider/index.scss | 1 + .../gas-details-item-title.js | 7 +- .../app/gas-details-item/gas-details-item.js | 9 +- ui/components/app/gas-details-item/index.scss | 2 +- ui/components/app/gas-timing/index.scss | 2 +- .../hold-to-reveal-button.js | 2 +- .../app/home-notification/index.scss | 2 +- .../metamask-template-renderer.js | 3 - .../safe-component-list.js | 5 - .../account-details-modal.test.js | 14 +- .../convert-token-to-nft-modal.js | 9 +- .../deposit-ether-modal.component.js | 35 +- .../deposit-ether-modal.container.js | 11 +- .../hide-token-confirmation-modal.js | 6 +- .../hide-token-confirmation.stories.js | 11 - .../hide-token-confirmation-modal/index.scss | 2 +- ui/components/app/modals/modal.js | 14 +- .../app/modals/new-account-modal/index.scss | 2 +- .../new-account-modal.stories.js | 11 - .../nickname-popovers.component.js | 2 +- .../modals/qr-scanner/qr-scanner.component.js | 2 +- .../app/network-display/network-display.js | 4 +- .../app/permissions-connect-header/index.scss | 2 +- .../permissions-connect-header.component.js | 62 +- .../index.scss | 2 +- .../qr-hardware-popover/enhanced-reader.js | 2 +- .../qr-hardware-sign-request/player.js | 7 +- .../recovery-phrase-reminder.js | 9 +- .../selected-account.component.js | 2 +- .../app/signature-request-original/README.mdx | 15 - .../app/signature-request-original/index.scss | 8 +- .../signature-request-original.component.js | 44 +- .../signature-request-original.container.js | 28 +- .../signature-request-original.stories.js | 132 - .../app/signature-request/index.scss | 10 +- .../signature-request-footer.component.js | 4 +- .../signature-request-message/index.scss | 2 +- .../signature-request-message.component.js | 2 +- .../signature-request.component.js | 6 +- .../signature-request.component.test.js | 4 +- .../signature-request.container.test.js | 1 - .../signature-request.stories.js | 32 +- ui/components/app/srp-input/srp-input.js | 15 +- ui/components/app/srp-input/srp-input.scss | 25 +- .../app/step-progress-bar/index.scss | 32 +- .../step-progress-bar/step-progress-bar.js | 10 +- ui/components/app/tab-bar/index.scss | 2 +- ui/components/app/token-cell/token-cell.js | 2 +- .../transaction-activity-log-icon.stories.js | 3 - .../transaction-decoding.component.js | 6 +- .../app/transaction-detail-item/index.scss | 2 +- .../transaction-detail-item.component.js | 4 +- .../app/transaction-icon/transaction-icon.js | 18 +- ...transaction-list-item-details.component.js | 5 +- ...action-list-item-details.component.test.js | 5 - ...transaction-list-item-details.container.js | 5 +- .../app/transaction-list-item/index.scss | 6 + .../smart-transaction-list-item.component.js | 9 +- .../transaction-list-item.component.js | 18 +- .../transaction-list-item.stories.js | 210 - .../app/transaction-status/index.scss | 2 +- ...erenced-currency-display.component.test.js | 2 +- .../app/wallet-overview/eth-overview.js | 44 +- ui/components/app/wallet-overview/index.scss | 2 +- .../app/wallet-overview/token-overview.js | 4 +- .../app/wallet-overview/wallet-overview.js | 5 +- .../app/whats-new-popup/whats-new-popup.js | 8 +- ui/components/ui/alert/README.mdx | 15 - ui/components/ui/alert/alert.stories.js | 32 - ui/components/ui/alert/index.js | 71 +- ui/components/ui/alert/index.test.js | 24 + ui/components/ui/box/README.mdx | 207 +- ui/components/ui/box/box.js | 358 +- ui/components/ui/box/box.scss | 253 +- ui/components/ui/box/box.stories.js | 139 +- ui/components/ui/box/box.test.js | 732 --- ui/components/ui/box/index.js | 7 +- ui/components/ui/breadcrumbs/README.mdx | 16 - .../ui/breadcrumbs/breadcrumbs.stories.js | 33 - ui/components/ui/button-group/index.scss | 2 +- ui/components/ui/button/buttons.scss | 28 +- ui/components/ui/callout/callout.scss | 2 +- ui/components/ui/callout/callout.stories.js | 6 +- ui/components/ui/chip/chip.js | 19 +- ui/components/ui/chip/chip.scss | 8 - .../ui/color-indicator/color-indicator.js | 2 +- ui/components/ui/confusable/README.mdx | 25 - .../ui/confusable/confusable.stories.js | 37 - .../ui/definition-list/definition-list.js | 2 - .../definition-list.stories.js | 100 +- ui/components/ui/dialog/README.mdx | 15 - ui/components/ui/dialog/dialog.stories.js | 30 - ui/components/ui/dropdown/dropdown.scss | 1 - .../error-message/error-message.component.js | 8 - .../ui/export-text-container/README.mdx | 15 - .../export-text.stories.js | 29 - .../ui/form-field/form-field.stories.js | 2 +- ui/components/ui/form-field/index.scss | 4 +- ui/components/ui/hex-to-decimal/README.mdx | 15 - .../hex-to-decimal/hex-to-decimal.stories.js | 32 - .../ui/i18n-value/i18n-value.component.js | 15 + ui/components/ui/i18n-value/index.js | 1 + .../icon-with-fallback.scss | 2 +- ui/components/ui/icon/icon.stories.js | 5 +- ui/components/ui/icon/search-icon.js | 42 - ui/components/ui/info-tooltip/index.scss | 54 +- ui/components/ui/info-tooltip/info-tooltip.js | 9 +- .../ui/info-tooltip/info-tooltip.stories.js | 1 + .../ui/jazzicon/jazzicon.component.js | 10 +- ui/components/ui/loading-screen/index.scss | 4 +- .../loading-screen.component.js | 2 +- ui/components/ui/logo/logo-coinbasepay.js | 58 - ui/components/ui/logo/logo-coinbasepay.scss | 3 - ui/components/ui/logo/logo-wyre.js | 48 +- ui/components/ui/logo/logo.stories.js | 2 - ui/components/ui/menu/menu.scss | 4 +- .../ui/metafox-logo/horizontal-logo.js | 2 +- .../nickname-popover.stories.js | 45 +- ui/components/ui/page-container/index.scss | 2 +- .../page-container.component.js | 4 +- .../page-container/page-container.stories.js | 66 - ui/components/ui/popover/index.scss | 4 +- ui/components/ui/search-icon/index.js | 1 + .../ui/search-icon/search-icon.component.js | 20 + .../ui/sender-to-recipient/index.scss | 4 +- ui/components/ui/site-icon/site-icon.test.js | 3 +- ui/components/ui/site-origin/index.scss | 8 +- ui/components/ui/site-origin/site-origin.js | 52 +- .../ui/site-origin/site-origin.stories.js | 8 - ui/components/ui/slider/slider.component.js | 6 +- ui/components/ui/spinner/spinner.stories.js | 26 - ui/components/ui/tabs/index.scss | 2 +- ui/components/ui/tabs/tabs.stories.js | 47 +- ui/components/ui/text-field/index.scss | 6 - ui/components/ui/textarea/textarea.js | 2 +- .../ui/token-input/token-input.component.js | 9 +- .../token-input/token-input.component.test.js | 90 - .../ui/token-input/token-input.container.js | 3 +- ui/components/ui/tooltip/index.scss | 62 +- ui/components/ui/tooltip/tooltip.js | 2 +- ui/components/ui/tooltip/tooltip.stories.js | 92 - ui/components/ui/typography/typography.js | 28 +- ui/components/ui/ui-components.scss | 1 - .../ui/update-nickname-popover/index.scss | 2 +- .../update-nickname-popover.js | 10 +- ui/components/ui/url-icon/index.scss | 2 +- ui/css/base-styles.scss | 1 + ui/css/design-system/attributes.scss | 4 +- ui/css/design-system/breakpoints.scss | 69 +- ui/css/errors.scss | 44 - ui/css/index.scss | 2 - ui/css/itcss/components/newui-sections.scss | 6 +- ui/css/itcss/components/send.scss | 32 +- ui/css/loading.scss | 13 - ui/css/utilities/colors.scss | 4 +- ui/ducks/app/app.js | 10 - ui/ducks/ens.js | 23 +- ui/ducks/send/helpers.js | 294 - ui/ducks/send/helpers.test.js | 163 - ui/ducks/send/send.js | 3062 ++++----- ui/ducks/send/send.test.js | 2060 +++--- ui/ducks/swaps/swaps.js | 71 +- ui/helpers/constants/common.js | 14 +- ui/helpers/constants/critical-error.js | 1 - ui/helpers/constants/design-system.js | 5 - ui/helpers/constants/notifications.js | 6 - ui/helpers/constants/routes.js | 10 - ui/helpers/constants/settings.js | 7 - ui/helpers/constants/transactions.js | 1 - ui/helpers/utils/error-utils.js | 55 - ui/helpers/utils/error-utils.test.js | 49 - ui/helpers/utils/i18n-helper.js | 3 +- ui/helpers/utils/icon-factory.js | 41 +- ui/helpers/utils/permission.js | 5 - ui/helpers/utils/settings-search.test.js | 2 +- ui/helpers/utils/token-util.js | 97 +- ui/helpers/utils/transactions.util.js | 32 +- ui/helpers/utils/transactions.util.test.js | 46 - ui/hooks/useAssetDetails.js | 80 +- ui/hooks/useAssetDetails.test.js | 193 - ui/hooks/useTransactionDisplayData.js | 92 +- ui/hooks/useTransactionDisplayData.test.js | 2 +- ui/index.js | 56 +- ui/index.test.js | 70 - ui/pages/add-collectible/add-collectible.js | 19 +- .../add-collectible/add-collectible.test.js | 79 - ui/pages/asset/asset.scss | 2 +- ui/pages/asset/components/asset-options.js | 31 +- .../confirm-add-suggested-token.js | 6 +- .../confirm-approve-content.component.js | 170 +- .../confirm-approve-content.component.test.js | 2 +- .../confirm-approve-content.stories.js | 2 +- .../confirm-approve-content/index.scss | 4 - ui/pages/confirm-approve/confirm-approve.js | 21 +- .../confirm-decrypt-message.scss | 2 +- .../confirm-deploy-contract.stories.js | 60 +- ...confirm-encryption-public-key.component.js | 5 +- .../confirm-encryption-public-key.scss | 3 +- .../confirm-import-token.js | 6 +- .../confirm-send-ether.container.js | 6 +- .../confirm-send-ether.stories.js | 64 +- .../confirm-send-token.component.js | 9 +- .../confirm-send-token.container.js | 17 +- .../confirm-send-token/confirm-send-token.js | 29 +- .../confirm-token-transaction-base.js | 9 +- .../confirm-transaction-base.component.js | 13 +- .../confirm-transaction-base.container.js | 10 +- .../transaction-alerts/transaction-alerts.js | 51 +- .../confirm-transaction-switch.component.js | 5 - .../confirm-token-transaction-switch.js | 25 - .../confirmation-network-switch/index.scss | 1 + ui/pages/confirmation/confirmation.js | 57 +- .../templates/add-ethereum-chain.js | 203 +- .../connect-hardware/index.scss | 2 +- ui/pages/create-account/index.scss | 2 +- .../metametrics-opt-in/index.scss | 4 + .../metametrics-opt-in.component.js | 29 +- .../metametrics-opt-in.container.js | 2 + .../confirm-seed-phrase/index.scss | 2 +- .../seed-phrase-intro.component.js | 5 - .../select-action/select-action.component.js | 9 +- .../welcome/welcome.component.js | 21 +- .../welcome/welcome.container.js | 7 +- .../first-time-flow/welcome/welcome.test.js | 8 +- ui/pages/home/home.component.js | 76 +- ui/pages/home/home.container.js | 16 +- ui/pages/home/index.scss | 18 +- .../import-token/import-token.component.js | 2 +- ui/pages/import-token/token-list/index.scss | 2 +- .../token-list/token-list.component.js | 11 +- .../token-search/token-search.component.js | 6 +- ui/pages/keychains/restore-vault.js | 8 +- ui/pages/notifications/index.js | 1 - ui/pages/notifications/index.scss | 114 - ui/pages/notifications/notification.test.js | 100 - ui/pages/notifications/notifications.js | 141 - .../create-password/create-password.js | 23 +- .../create-password/index.scss | 11 +- .../creation-successful.js | 11 +- .../creation-successful/index.scss | 8 +- .../onboarding-flow/import-srp/import-srp.js | 7 +- .../onboarding-flow/import-srp/index.scss | 31 +- ui/pages/onboarding-flow/index.scss | 18 +- .../onboarding-flow/metametrics/index.scss | 23 +- .../metametrics/metametrics.js | 14 +- .../onboarding-app-header/index.scss | 2 +- .../onboarding-flow/pin-extension/index.scss | 4 +- .../privacy-settings/index.scss | 13 - .../privacy-settings/setting.js | 2 +- .../confirm-recovery-phrase.js | 12 +- .../recovery-phrase/index.scss | 75 +- .../recovery-phrase/review-recovery-phrase.js | 7 +- .../secure-your-wallet/index.scss | 30 +- .../secure-your-wallet/secure-your-wallet.js | 16 +- ui/pages/onboarding-flow/welcome/index.scss | 8 +- ui/pages/onboarding-flow/welcome/welcome.js | 2 +- ui/pages/pages.scss | 1 - .../flask/snap-install/index.scss | 4 + .../flask/snap-install/snap-install.js | 9 +- ui/pages/permissions-connect/index.scss | 4 +- .../permissions-connect/redirect/index.scss | 1 + ui/pages/routes/routes.component.js | 11 - .../add-recipient/add-recipient.component.js | 14 +- .../add-recipient/ens-input.component.js | 5 +- .../amount-max-button.test.js | 21 +- .../send-asset-row.component.js | 8 +- .../send-content/send-content.component.js | 49 +- .../send-content.component.test.js | 28 +- .../send-content/send-content.container.js | 17 +- .../send/send-content/send-content.stories.js | 86 +- .../send/send-header/send-header.component.js | 10 +- .../send-header/send-header.component.test.js | 38 +- ui/pages/send/send.constants.js | 3 +- ui/pages/send/send.js | 42 +- ui/pages/send/send.scss | 11 +- ui/pages/send/send.test.js | 88 +- ui/pages/send/send.utils.js | 6 +- ui/pages/send/send.utils.test.js | 2 +- .../advanced-tab.component.test.js | 6 - ui/pages/settings/alerts-tab/alerts-tab.js | 2 +- ui/pages/settings/alerts-tab/alerts-tab.scss | 4 - ui/pages/settings/contact-list-tab/index.scss | 1 - .../experimental-tab.component.js | 46 +- .../experimental-tab.container.js | 5 - .../settings/flask/view-snap/view-snap.js | 6 +- ui/pages/settings/index.scss | 6 +- .../custom-content-search.js | 4 +- ui/pages/settings/networks-tab/index.scss | 244 +- .../networks-form/networks-form.js | 64 +- .../networks-list-item/networks-list-item.js | 12 +- .../networks-list/networks-list.js | 4 +- .../networks-tab-subheader.js | 21 +- .../networks-tab-subheader.test.js | 5 +- .../settings/networks-tab/networks-tab.js | 31 +- .../settings-search/settings-search.js | 2 +- .../settings-tab/settings-tab.component.js | 8 +- ui/pages/settings/settings.component.js | 14 +- ui/pages/settings/settings.container.js | 7 - ui/pages/swaps/awaiting-swap/awaiting-swap.js | 53 +- .../swaps/awaiting-swap/awaiting-swap.test.js | 3 +- ui/pages/swaps/awaiting-swap/index.scss | 19 + .../view-on-ether-scan-link.test.js.snap | 21 + .../view-on-ether-scan-link/index.js | 1 + .../view-on-ether-scan-link.js | 50 + .../view-on-ether-scan-link.test.js | 39 + .../__snapshots__/build-quote.test.js.snap | 8 +- ui/pages/swaps/build-quote/build-quote.js | 9 +- .../swaps/build-quote/build-quote.stories.js | 213 +- .../swaps/build-quote/build-quote.test.js | 2 +- ui/pages/swaps/build-quote/index.scss | 2 +- .../swaps/create-new-swap/create-new-swap.js | 47 - .../create-new-swap/create-new-swap.test.js | 27 - ui/pages/swaps/create-new-swap/index.js | 1 - ui/pages/swaps/create-new-swap/index.scss | 8 - .../dropdown-search-list.js | 35 +- .../swaps/dropdown-search-list/index.scss | 4 +- .../exchange-rate-display.test.js.snap | 2 +- .../exchange-rate-display.js | 2 +- .../__snapshots__/fee-card.test.js.snap | 2 + ui/pages/swaps/fee-card/fee-card.js | 93 +- ui/pages/swaps/fee-card/fee-card.test.js | 62 +- ui/pages/swaps/import-token/import-token.js | 4 +- ui/pages/swaps/index.js | 38 +- ui/pages/swaps/index.scss | 4 +- ui/pages/swaps/main-quote-summary/README.mdx | 14 - .../main-quote-summary/main-quote-summary.js | 34 +- .../main-quote-summary.stories.js | 57 +- .../searchable-item-list.test.js.snap | 14 +- .../item-list/item-list.component.js | 57 +- .../list-item-search.component.js | 6 +- .../searchable-item-list.js | 11 +- .../swaps/select-quote-popover/index.scss | 4 +- .../select-quote-popover.test.js | 1 - .../sort-list/sort-list.test.js | 1 - .../slippage-buttons.test.js.snap | 16 +- .../slippage-buttons/slippage-buttons.js | 26 +- .../slippage-buttons/slippage-buttons.test.js | 2 +- .../smart-transaction-status.js | 79 +- .../smart-transaction-status.test.js | 2 +- ui/pages/swaps/swaps.util.js | 17 +- ui/pages/swaps/swaps.util.test.js | 104 - .../view-on-block-explorer.test.js.snap | 13 - .../swaps/view-on-block-explorer/index.js | 1 - .../swaps/view-on-block-explorer/index.scss | 8 - .../view-on-block-explorer.js | 47 - .../view-on-block-explorer.test.js | 23 - .../view-quote/view-quote-price-difference.js | 6 +- ui/pages/swaps/view-quote/view-quote.js | 333 +- ui/pages/swaps/view-quote/view-quote.test.js | 3 +- ui/pages/token-details/token-details-page.js | 41 +- ui/pages/unlock-page/index.scss | 4 +- ui/selectors/confirm-transaction.js | 23 - ui/selectors/custom-gas.js | 5 +- ui/selectors/custom-gas.test.js | 49 +- ui/selectors/selectors.js | 95 +- ui/selectors/selectors.test.js | 23 - ui/store/actionConstants.js | 1 - ui/store/actions.js | 258 +- ui/store/actions.test.js | 76 +- yarn.lock | 2645 ++++---- 679 files changed, 10091 insertions(+), 34038 deletions(-) delete mode 100755 .circleci/scripts/bundle-stats-commit.sh delete mode 100644 .storybook/4.BREAKPOINTS.stories.mdx delete mode 100644 .storybook/initial-states/transactions.js delete mode 100644 app/images/fantom-opera.svg delete mode 100644 app/images/harmony-one.svg delete mode 100644 app/images/info-fox.svg delete mode 100644 app/images/videos/recovery-onboarding/subtitles/el.vtt delete mode 100644 app/images/videos/recovery-onboarding/subtitles/fr.vtt delete mode 100644 app/images/videos/recovery-onboarding/subtitles/tr.vtt delete mode 100644 app/images/videos/recovery-onboarding/subtitles/zh.vtt rename app/manifest/{v2 => }/_base.json (95%) rename app/manifest/{v2 => }/brave.json (100%) rename app/manifest/{v2 => }/chrome.json (100%) rename app/manifest/{v2 => }/firefox.json (100%) rename app/manifest/{v2 => }/opera.json (100%) delete mode 100644 app/manifest/v3/_base.json delete mode 100644 app/manifest/v3/brave.json delete mode 100644 app/manifest/v3/chrome.json delete mode 100644 app/manifest/v3/firefox.json delete mode 100644 app/manifest/v3/opera.json create mode 100644 app/phishing.html delete mode 100644 app/scripts/app-init.js delete mode 100644 app/scripts/init-globals.js delete mode 100644 app/scripts/lib/createRPCMethodTrackingMiddleware.test.js delete mode 100644 app/scripts/migrations/072.js delete mode 100644 app/scripts/migrations/072.test.js create mode 100644 app/scripts/phishing-detect.js delete mode 100644 development/build/constants.js delete mode 100644 development/charts/flamegraph/chart/index.html delete mode 100644 development/charts/flamegraph/lib/d3-flamegraph-tooltip.js delete mode 100644 development/charts/flamegraph/lib/d3-flamegraph.css delete mode 100644 development/charts/flamegraph/lib/d3-flamegraph.js delete mode 100644 development/charts/table/index.html delete mode 100644 development/charts/table/jquery.min.js delete mode 100644 patches/@lavamoat+lavapack+3.1.0.patch create mode 100644 patches/bip39+2.5.0.patch create mode 100644 patches/eth-hd-keyring+3.6.0.patch create mode 100644 patches/eth-keyring-controller+6.2.1.patch delete mode 100644 patches/yargs+17.4.1.patch delete mode 100644 shared/constants/phishing.js delete mode 100644 shared/modules/mv3.utils.js delete mode 100644 shared/modules/object.utils.js delete mode 100644 test/e2e/fixtures/special-settings/state.json delete mode 100644 test/e2e/lavamoat-stats.js delete mode 100644 test/e2e/mock-page-with-disallowed-iframe/index.html delete mode 100644 test/e2e/mock-page-with-iframe/index.html delete mode 100644 test/e2e/mv3-perf-stats/bundle-size.js delete mode 100644 test/e2e/mv3-perf-stats/index.js delete mode 100644 test/e2e/mv3-perf-stats/init-load-stats.js delete mode 100644 test/e2e/mv3-stats.js delete mode 100644 test/e2e/phishing-warning-page-server.js delete mode 100644 test/e2e/seeder/ganache-contract-address-registry.js delete mode 100644 test/e2e/seeder/ganache-seeder.js delete mode 100644 test/e2e/seeder/smart-contracts.js delete mode 100644 test/e2e/snaps/enums.js delete mode 100644 test/e2e/snaps/test-snap-notification.spec.js delete mode 100644 test/e2e/tests/custom-token-add-approve.spec.js delete mode 100644 test/e2e/tests/send-hex-address.spec.js delete mode 100644 test/e2e/tests/send-to-contract.spec.js delete mode 100644 test/e2e/tests/state-logs.spec.js delete mode 100644 test/helpers/file.js delete mode 100644 ui/components/app/add-network/add-network.test.js delete mode 100644 ui/components/app/collectible-default-image/collectible-default-image.js delete mode 100644 ui/components/app/collectible-default-image/collectible-default-image.stories.js delete mode 100644 ui/components/app/collectible-default-image/index.js delete mode 100644 ui/components/app/collectible-default-image/index.scss delete mode 100644 ui/components/app/confirm-page-container/confirm-detail-row/confirm-detail-row.stories.js delete mode 100644 ui/components/app/connected-accounts-list/connected-accounts-list.stories.js delete mode 100644 ui/components/app/gas-customization/gas-price-button-group/gas-price-button-group.stories.js delete mode 100644 ui/components/app/gas-customization/gas-slider/gas-slider.stories.js delete mode 100644 ui/components/app/modals/hide-token-confirmation-modal/hide-token-confirmation.stories.js delete mode 100644 ui/components/app/modals/new-account-modal/new-account-modal.stories.js delete mode 100644 ui/components/app/signature-request-original/README.mdx delete mode 100644 ui/components/app/signature-request-original/signature-request-original.stories.js delete mode 100644 ui/components/app/transaction-list-item/transaction-list-item.stories.js delete mode 100644 ui/components/ui/alert/README.mdx delete mode 100644 ui/components/ui/alert/alert.stories.js delete mode 100644 ui/components/ui/box/box.test.js delete mode 100644 ui/components/ui/breadcrumbs/README.mdx delete mode 100644 ui/components/ui/breadcrumbs/breadcrumbs.stories.js delete mode 100644 ui/components/ui/confusable/README.mdx delete mode 100644 ui/components/ui/confusable/confusable.stories.js delete mode 100644 ui/components/ui/dialog/README.mdx delete mode 100644 ui/components/ui/dialog/dialog.stories.js delete mode 100644 ui/components/ui/export-text-container/README.mdx delete mode 100644 ui/components/ui/export-text-container/export-text.stories.js delete mode 100644 ui/components/ui/hex-to-decimal/README.mdx delete mode 100644 ui/components/ui/hex-to-decimal/hex-to-decimal.stories.js create mode 100644 ui/components/ui/i18n-value/i18n-value.component.js create mode 100644 ui/components/ui/i18n-value/index.js delete mode 100644 ui/components/ui/icon/search-icon.js delete mode 100644 ui/components/ui/logo/logo-coinbasepay.js delete mode 100644 ui/components/ui/logo/logo-coinbasepay.scss delete mode 100644 ui/components/ui/page-container/page-container.stories.js create mode 100644 ui/components/ui/search-icon/index.js create mode 100644 ui/components/ui/search-icon/search-icon.component.js delete mode 100644 ui/components/ui/spinner/spinner.stories.js delete mode 100644 ui/components/ui/tooltip/tooltip.stories.js delete mode 100644 ui/css/errors.scss delete mode 100644 ui/css/loading.scss delete mode 100644 ui/ducks/send/helpers.js delete mode 100644 ui/ducks/send/helpers.test.js delete mode 100644 ui/helpers/constants/critical-error.js delete mode 100644 ui/helpers/constants/notifications.js delete mode 100644 ui/helpers/utils/error-utils.js delete mode 100644 ui/helpers/utils/error-utils.test.js delete mode 100644 ui/hooks/useAssetDetails.test.js delete mode 100644 ui/index.test.js delete mode 100644 ui/pages/add-collectible/add-collectible.test.js delete mode 100644 ui/pages/notifications/index.js delete mode 100644 ui/pages/notifications/index.scss delete mode 100644 ui/pages/notifications/notification.test.js delete mode 100644 ui/pages/notifications/notifications.js create mode 100644 ui/pages/swaps/awaiting-swap/view-on-ether-scan-link/__snapshots__/view-on-ether-scan-link.test.js.snap create mode 100644 ui/pages/swaps/awaiting-swap/view-on-ether-scan-link/index.js create mode 100644 ui/pages/swaps/awaiting-swap/view-on-ether-scan-link/view-on-ether-scan-link.js create mode 100644 ui/pages/swaps/awaiting-swap/view-on-ether-scan-link/view-on-ether-scan-link.test.js delete mode 100644 ui/pages/swaps/create-new-swap/create-new-swap.js delete mode 100644 ui/pages/swaps/create-new-swap/create-new-swap.test.js delete mode 100644 ui/pages/swaps/create-new-swap/index.js delete mode 100644 ui/pages/swaps/create-new-swap/index.scss delete mode 100644 ui/pages/swaps/main-quote-summary/README.mdx delete mode 100644 ui/pages/swaps/view-on-block-explorer/__snapshots__/view-on-block-explorer.test.js.snap delete mode 100644 ui/pages/swaps/view-on-block-explorer/index.js delete mode 100644 ui/pages/swaps/view-on-block-explorer/index.scss delete mode 100644 ui/pages/swaps/view-on-block-explorer/view-on-block-explorer.js delete mode 100644 ui/pages/swaps/view-on-block-explorer/view-on-block-explorer.test.js diff --git a/.circleci/config.yml b/.circleci/config.yml index 8bc591a91df9..749402c7fe6d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,10 +3,10 @@ version: 2.1 executors: node-browsers: docker: - - image: circleci/node:16-browsers + - image: circleci/node:14-browsers node-browsers-medium-plus: docker: - - image: circleci/node:16-browsers + - image: circleci/node:14-browsers resource_class: medium+ environment: NODE_OPTIONS: --max_old_space_size=2048 @@ -53,9 +53,6 @@ workflows: - prep-build-test: requires: - prep-deps - - prep-build-test-mv3: - requires: - - prep-deps - prep-build-test-flask: requires: - prep-deps @@ -136,9 +133,6 @@ workflows: - benchmark: requires: - prep-build-test - - stats-module-load-init: - requires: - - prep-build-test-mv3 - job-publish-prerelease: requires: - prep-deps @@ -146,9 +140,7 @@ workflows: - prep-build-beta - prep-build-flask - prep-build-storybook - - prep-build-test-mv3 - benchmark - - stats-module-load-init - all-tests-pass - job-publish-release: filters: @@ -208,8 +200,8 @@ jobs: - persist_to_workspace: root: . paths: - - node_modules - - build-artifacts + - node_modules + - build-artifacts validate-lavamoat-config: executor: node-browsers-medium-plus @@ -313,26 +305,6 @@ jobs: - dist-test-flask - builds-test-flask - prep-build-test-mv3: - executor: node-browsers-medium-plus - steps: - - checkout - - attach_workspace: - at: . - - run: - name: Build extension in mv3 for testing - command: yarn build:test:mv3 - - run: - name: Move test build to 'dist-test' to avoid conflict with production build - command: mv ./dist ./dist-test-mv3 - - run: - name: Move test zips to 'builds-test' to avoid conflict with production build - command: mv ./builds ./builds-test-mv3 - - persist_to_workspace: - root: . - paths: - - dist-test-mv3 - - builds-test-mv3 prep-build-test: executor: node-browsers-medium-plus @@ -447,6 +419,7 @@ jobs: name: Validate release candidate changelog command: yarn lint:changelog:rc + test-deps-audit: executor: node-browsers steps: @@ -601,43 +574,6 @@ jobs: paths: - test-artifacts - stats-module-load-init: - executor: node-browsers-medium-plus - steps: - - checkout - - run: - name: Re-Install Chrome - command: ./.circleci/scripts/chrome-install.sh - - attach_workspace: - at: . - - run: - name: Move test build to dist - command: mv ./dist-test-mv3 ./dist - - run: - name: Move test zips to builds - command: mv ./builds-test-mv3 ./builds - - run: - name: Run page load benchmark - command: | - mkdir -p test-artifacts/chrome/mv3 - cp -R development/charts/flamegraph test-artifacts/chrome/mv3/initialisation - cp -R development/charts/flamegraph/chart test-artifacts/chrome/mv3/initialisation/background - cp -R development/charts/flamegraph/chart test-artifacts/chrome/mv3/initialisation/ui - cp -R development/charts/table test-artifacts/chrome/mv3/load_time - - run: - name: Run page load benchmark - command: yarn mv3:stats:chrome --out test-artifacts/chrome/mv3 - - run: - name: Record bundle size at commit - command: ./.circleci/scripts/bundle-stats-commit.sh - - store_artifacts: - path: test-artifacts - destination: test-artifacts - - persist_to_workspace: - root: . - paths: - - test-artifacts - job-publish-prerelease: executor: node-browsers steps: @@ -712,7 +648,7 @@ jobs: steps: - add_ssh_keys: fingerprints: - - '3d:49:29:f4:b2:e8:ea:af:d1:32:eb:2a:fc:15:85:d8' + - "3d:49:29:f4:b2:e8:ea:af:d1:32:eb:2a:fc:15:85:d8" - checkout - attach_workspace: at: . @@ -734,7 +670,7 @@ jobs: - run: name: test:coverage:jest command: yarn test:coverage:jest - - run: + - run: name: Validate coverage thresholds command: | if ! git diff --exit-code jest.config.js development/jest.config.js; then diff --git a/.circleci/scripts/bundle-stats-commit.sh b/.circleci/scripts/bundle-stats-commit.sh deleted file mode 100755 index 7c0894430386..000000000000 --- a/.circleci/scripts/bundle-stats-commit.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u -set -o pipefail - -if [[ "${CI:-}" != 'true' ]] -then - printf '%s\n' 'CI environment variable must be set to true' - exit 1 -fi - -if [[ "${CIRCLECI:-}" != 'true' ]] -then - printf '%s\n' 'CIRCLECI environment variable must be set to true' - exit 1 -fi - -if [[ -z "${GITHUB_TOKEN:-}" ]] -then - printf '%s\n' 'GITHUB_TOKEN environment variable must be set' - exit 1 -elif [[ -z "${GITHUB_TOKEN_USER:-}" ]] -then - printf '%s\n' 'GITHUB_TOKEN_USER environment variable must be set' - exit 1 -fi - -printf '%s\n' 'Commit the manifest version and changelog if the manifest has changed' - -if [[ "${CIRCLE_BRANCH}" != "develop" ]] -then - printf 'This is not develop branch' - exit 0 -fi - -mkdir temp - -git config --global user.email "metamaskbot@users.noreply.github.com" - -git config --global user.name "MetaMask Bot" - -git clone git@github.com:MetaMask/extension_bundlesize_stats.git temp - -if [[ -f "temp/stats/bundle_size_stats-${CIRCLE_SHA1}.json" ]] -then - printf 'Bundle size of the commit is already recorded' - cd .. - rm -rf temp - exit 0 -fi - -cp -R test-artifacts/chrome/mv3/bundle_size.json temp/stats - -echo " bundle_size_stats-${CIRCLE_SHA1}.json" >> temp/stats/fileList.txt - -mv temp/stats/bundle_size.json "temp/stats/bundle_size_stats-${CIRCLE_SHA1}.json" - -cd temp - -git add . - -git commit --message "Bundle size at commit: ${CIRCLE_SHA1}" - -repo_slug="$CIRCLE_PROJECT_USERNAME/extension_bundlesize_stats" -git push "https://$GITHUB_TOKEN_USER:$GITHUB_TOKEN@github.com/$repo_slug" main - -cd .. - -rm -rf temp diff --git a/.circleci/scripts/chrome-install.sh b/.circleci/scripts/chrome-install.sh index dcd122fb8399..441e61124f92 100755 --- a/.circleci/scripts/chrome-install.sh +++ b/.circleci/scripts/chrome-install.sh @@ -5,12 +5,12 @@ set -u set -o pipefail # To get the latest version, see -CHROME_VERSION='103.0.5060.53-1' +CHROME_VERSION='101.0.4951.54-1' CHROME_BINARY="google-chrome-stable_${CHROME_VERSION}_amd64.deb" CHROME_BINARY_URL="https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/${CHROME_BINARY}" # To retrieve this checksum, run the `wget` and `shasum` commands below -CHROME_BINARY_SHA512SUM='36f4e79f46cb71c1431dccf1489f5f8e89d35204a717a4618c7f6f638123ddc2b37bd5cbd00498be8f84c7713149f2faa447cb6da3518be1cb9703e99d110e1a' +CHROME_BINARY_SHA512SUM='46ebc53c806f179a5f9ab570c1097c2d35fc437dd4f5bd3fb34e758dc4f306771ceb05f8df7d450584355abf35bae34c0e70903e4f0312e2d3caa34491c8f622' wget -O "${CHROME_BINARY}" -t 5 "${CHROME_BINARY_URL}" diff --git a/.circleci/scripts/firefox-install.sh b/.circleci/scripts/firefox-install.sh index f2f9f284d1d0..0c3512114796 100755 --- a/.circleci/scripts/firefox-install.sh +++ b/.circleci/scripts/firefox-install.sh @@ -4,7 +4,7 @@ set -e set -u set -o pipefail -FIREFOX_VERSION='102.0' +FIREFOX_VERSION='83.0' FIREFOX_BINARY="firefox-${FIREFOX_VERSION}.tar.bz2" FIREFOX_BINARY_URL="https://ftp.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/${FIREFOX_BINARY}" FIREFOX_PATH='/opt/firefox' diff --git a/.depcheckrc.yml b/.depcheckrc.yml index 2652ffb2b097..50c309973fe3 100644 --- a/.depcheckrc.yml +++ b/.depcheckrc.yml @@ -17,7 +17,6 @@ ignores: # used in testing + ci - '@metamask/auto-changelog' # invoked as `auto-changelog` - '@metamask/forwarder' - - '@metamask/phishing-warning' # statically hosted as part of some e2e tests - '@metamask/test-dapp' - '@metamask/design-tokens' # Only imported in index.css - '@tsconfig/node14' # required dynamically by TS, used in tsconfig.json diff --git a/.eslintrc.js b/.eslintrc.js index 16c28cf7dc2b..2001994f4915 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,7 +8,6 @@ module.exports = { 'app/vendor/**', 'builds/**/*', 'development/chromereload.js', - 'development/charts/**', 'dist/**/*', 'node_modules/**/*', ], diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6df4c6e65ac4..f15418ea6d08 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -49,11 +49,8 @@ How should reviewers and QA manually test your changes? For instance: ## Pre-Merge Checklist - [ ] PR template is filled out +- [ ] Manual testing complete & passed - [ ] **IF** this PR fixes a bug, a test that _would have_ caught the bug has been added - [ ] PR is linked to the appropriate GitHub issue +- [ ] **IF** QA attention is required, "QA Board" label has been applied - [ ] PR has been added to the appropriate release Milestone - -### + If there are functional changes: - -- [ ] Manual testing complete & passed -- [ ] "Extension QA Board" label has been applied diff --git a/.iyarc b/.iyarc index bbd5d06c106d..583324582de8 100644 --- a/.iyarc +++ b/.iyarc @@ -1,5 +1,4 @@ # improved-yarn-audit advisory exclusions GHSA-93q8-gq69-wqmw GHSA-257v-vj4p-3w2h -GHSA-wm7h-9275-46v2 -GHSA-pfrx-2q88-qq97 +GHSA-fwr7-v2mv-hh25 diff --git a/.metamaskrc.dist b/.metamaskrc.dist index d3bff3b467b9..29dbcb2f791f 100644 --- a/.metamaskrc.dist +++ b/.metamaskrc.dist @@ -6,6 +6,3 @@ ONBOARDING_V2= SWAPS_USE_DEV_APIS= COLLECTIBLES_V1= TOKEN_DETECTION_V2= - -; Set this to test changes to the phishing warning page. -PHISHING_WARNING_PAGE_URL= diff --git a/.nvmrc b/.nvmrc index 6f7f377bf514..958b5a36e1fa 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16 +v14 diff --git a/.storybook/1.INTRODUCTION.stories.mdx b/.storybook/1.INTRODUCTION.stories.mdx index 2633d11aedb3..23ba7e8f7fb7 100644 --- a/.storybook/1.INTRODUCTION.stories.mdx +++ b/.storybook/1.INTRODUCTION.stories.mdx @@ -8,7 +8,7 @@ Welcome to the MetaMask Browser Extension Storybook. ## Building locally and Contributing -This document is currently only specific to storybook best practices and component documentation guidelines. This may change in future but for now if you are looking to get a local build of MetaMask up and running or contribute to the extension codebase please read the MetaMask [README.md](https://github.com/MetaMask/metamask-extension) +This document is currently only specific to storybook best practices and component documentation guidelines. This may change in future but for now if you are looking to get a local build of Metamask up and running or contribute to the extension codebase please read the Metamask [README.md](https://github.com/MetaMask/metamask-extension) ## Documentation Guidelines diff --git a/.storybook/3.COLORS.stories.mdx b/.storybook/3.COLORS.stories.mdx index fce6ef662839..b694a721ad84 100644 --- a/.storybook/3.COLORS.stories.mdx +++ b/.storybook/3.COLORS.stories.mdx @@ -1,12 +1,20 @@ import { Meta } from '@storybook/addon-docs'; +import ActionaleMessage from '../ui/components/ui/actionable-message'; import designTokenDiagramImage from './images/design.token.graphic.svg'; - + # Color Color is used to express style and communicate meaning. + + +
+ ## Design tokens We are importing design tokens as CSS variables from [@metamask/design-tokens](https://github.com/MetaMask/design-tokens) repo to help consolidate colors and enable theming across all MetaMask products. @@ -59,7 +67,6 @@ var(--color-text-muted) /** Icons */ var(--color-icon-default) -var(--color-icon-alternative) var(--color-icon-muted) /** Borders */ @@ -68,20 +75,20 @@ var(--color-border-muted) /** Overlays */ var(--color-overlay-default) -var(--color-overlay-inverse) [DEPRECATED] +var(--color-overlay-inverse) /** User Actions */ var(--color-primary-default) var(--color-primary-alternative) var(--color-primary-muted) var(--color-primary-inverse) -var(--color-primary-disabled) [DEPRECATED] +var(--color-primary-disabled) -var(--color-secondary-default) [DEPRECATED] -var(--color-secondary-alternative) [DEPRECATED] -var(--color-secondary-muted) [DEPRECATED] -var(--color-secondary-inverse) [DEPRECATED] -var(--color-secondary-disabled) [DEPRECATED] +var(--color-secondary-default) +var(--color-secondary-alternative) +var(--color-secondary-muted) +var(--color-secondary-inverse) +var(--color-secondary-disabled) /** States */ /** Error */ @@ -89,28 +96,28 @@ var(--color-error-default) var(--color-error-alternative) var(--color-error-muted) var(--color-error-inverse) -var(--color-error-disabled) [DEPRECATED] +var(--color-error-disabled) /** Warning */ var(--color-warning-default) -var(--color-warning-alternative) [DEPRECATED] +var(--color-warning-alternative) var(--color-warning-muted) var(--color-warning-inverse) -var(--color-warning-disabled) [DEPRECATED] +var(--color-warning-disabled) /** Success */ var(--color-success-default) -var(--color-success-alternative) [DEPRECATED] +var(--color-success-alternative) var(--color-success-muted) var(--color-success-inverse) -var(--color-success-disabled) [DEPRECATED] +var(--color-success-disabled) /** Info */ var(--color-info-default) -var(--color-info-alternative) [DEPRECATED] +var(--color-info-alternative) var(--color-info-muted) var(--color-info-inverse) -var(--color-info-disabled) [DEPRECATED] +var(--color-info-disabled) ``` ### **Component colors** (tier 3) diff --git a/.storybook/4.BREAKPOINTS.stories.mdx b/.storybook/4.BREAKPOINTS.stories.mdx deleted file mode 100644 index 1ddd2c42087d..000000000000 --- a/.storybook/4.BREAKPOINTS.stories.mdx +++ /dev/null @@ -1,125 +0,0 @@ -import { Meta } from '@storybook/addon-docs'; - - - -# Breakpoints - -Breakpoints are used for responsive layout - -## Screen Sizes - -There are 4 screen sizes that make up the breakpoints for the MetaMask extension - -- base: `0px` -- sm: `576px` -- md: `768px` -- lg: `1280px` - -### SCSS - -There are Sass variables and mixins available for use for both min and max screens sizes - -### Variables - -```css -$screen-sm-max /* 575px */ -$screen-md-max /* 767px */ -$screen-lg-max /* 1279px */ - -$screen-sm-min /* 576px */ -$screen-md-min /* 768px */ -$screen-lg-min /* 1280px */ -``` - -### Mixins - -```css -/* Max screen size */ -@include screen-sm-max { - /* equivalent css @media screen and (max-width: 575px) */ -} -@include screen-md-max { - /* equivalent css @media screen and (max-width: 767px) */ -} -@include screen-lg-max { - /* equivalent css @media screen and (max-width: 1279px) */ -} - -/* Min screen size */ -@include screen-sm-min { - /* equivalent css @media screen and (min-width: 576px) */ -} -@include screen-md-min { - /* equivalent css @media screen and (min-width: 768px) */ -} -@include screen-lg-min { - /* equivalent css @media screen and (min-width: 1280px) */ -} -``` - -Migrating from the old sass variables to the new mixins looks like this - -```css -/* Max width */ -/* Instead of the media query and sass variable */ -@media screen and (max-width: $break-small) { - right: 16px; -} - -/* Use the sass mixin */ -@include screen-sm-max { - right: 16px; -} - -/* Min width */ -/* Instead of the media query and sass variable */ -@media screen and (min-width: $break-large) { - left: 16px; -} - -/* Use the sass mixin */ -@include screen-sm-min { - left: 16px; -} -``` - -## Takeaways - -- Try to avoid using static media queries in your code. -- Try to use the provided SCSS mixins - -### ❌ Don't do this - -Don't use static media queries in your code. - -```css -/** -* Don't do this -* Static media queries create inconsistency and could break the UI if we want to update them in future -**/ -.account-menu { - @media screen and (min-width: 769px) { - right: calc((100vw - 80vw) / 2); - } - - @media screen and (min-width: 1281px) { - right: calc((100vw - 65vw) / 2); - } -} -``` - -### ✅ Do this - -Do use the provided Sass mixins - -```css -.account-menu { - @include screen-md-min { - right: calc((100vw - 80vw) / 2); - } - - @include screen-lg-min { - right: calc((100vw - 65vw) / 2); - } -} -``` diff --git a/.storybook/initial-states/transactions.js b/.storybook/initial-states/transactions.js deleted file mode 100644 index 34b848712231..000000000000 --- a/.storybook/initial-states/transactions.js +++ /dev/null @@ -1,1921 +0,0 @@ -const MOCK_TX_TYPE = { - CANCEL: 'cancel', - CONTRACT_INTERACTION: 'contractInteraction', - DEPLOY_CONTRACT: 'contractDeployment', - ETH_DECRYPT: 'eth_decrypt', - ETH_GET_ENCRYPTION_PUBLIC_KEY: 'eth_getEncryptionPublicKey', - INCOMING: 'incoming', - PERSONAL_SIGN: 'personal_sign', - RETRY: 'retry', - SIGN: 'eth_sign', - SIGN_TYPED_DATA: 'eth_signTypedData', - SIMPLE_SEND: 'simpleSend', - SMART: 'smart', - SWAP: 'swap', - SWAP_APPROVAL: 'swapApproval', - TOKEN_METHOD_APPROVE: 'approve', - TOKEN_METHOD_SAFE_TRANSFER_FROM: 'safetransferfrom', - TOKEN_METHOD_TRANSFER: 'transfer', - TOKEN_METHOD_TRANSFER_FROM: 'transferfrom', -}; - -export const MOCK_TRANSACTION_BY_TYPE = { - [MOCK_TX_TYPE.CANCEL]: { - id: 643368596521636, - time: 1653527035634, - status: 'submitted', - metamaskNetworkId: '4', - originalGasEstimate: '5208', - userEditedGasLimit: false, - chainId: '0x4', - loadingDefaults: false, - dappSuggestedGasFees: null, - sendFlowHistory: [], - txParams: { - from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', - to: '0xefge7847fd3661a9b7c86aaf1daea08d9da5750e', - nonce: '0x51', - value: '0x0', - gas: '0x5208', - gasPrice: '0x59682f0e', - estimateSuggested: 'medium', - estimateUsed: 'custom', - }, - previousGasParams: { - gasPrice: '0x3b9aca00', - }, - type: 'cancel', - history: [ - { - id: 643368596521636, - time: 1653527035634, - status: 'approved', - metamaskNetworkId: '4', - originalGasEstimate: '5208', - userEditedGasLimit: false, - chainId: '0x4', - loadingDefaults: false, - dappSuggestedGasFees: null, - sendFlowHistory: [], - txParams: { - from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', - to: '0xefge7847fd3661a9b7c86aaf1daea08d9da5750e', - nonce: '0x51', - value: '0x0', - gas: '0x5208', - gasPrice: '0x59682f0e', - estimateSuggested: 'medium', - estimateUsed: 'custom', - }, - previousGasParams: { - gasPrice: '0x3b9aca00', - }, - type: 'cancel', - }, - [ - { - op: 'add', - path: '/nonceDetails', - value: { - params: { - highestLocallyConfirmed: 81, - highestSuggested: 81, - nextNetworkNonce: 81, - }, - local: { - name: 'local', - nonce: 83, - details: { - startPoint: 81, - highest: 83, - }, - }, - network: { - name: 'network', - nonce: 81, - details: { - blockNumber: '0xa3e3ac', - baseCount: 81, - }, - }, - }, - note: 'transactions#approveTransaction', - timestamp: 1653527035723, - }, - ], - [ - { - op: 'add', - path: '/r', - value: - '0xb66eff07d9061c42e47ccf5f6a52b6626ef4d5b10e50d8aa6b8f20ae645fe347', - note: 'transactions#signTransaction: add r, s, v values', - timestamp: 1653527035817, - }, - { - op: 'add', - path: '/s', - value: - '0x3a2da8d56beff82a2d59e807f7d578f0c3b4b99cd6d3735c72c133d06fe02a9d', - }, - { - op: 'add', - path: '/v', - value: '0x2b', - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'signed', - note: 'txStateManager: setting status to signed', - timestamp: 1653527035818, - }, - ], - [ - { - op: 'add', - path: '/rawTx', - value: - '0xf863518459682f0e82520894e56e7847fd3661a9b7c86aaf1daea08d9da5750e80802ba0b66eff07d9061c42e47ccf5f6a52b6626ef4d5b10e50d8aa6b8f20ae645fe347a03a2da8d56beff82a2d59e807f7d578f0c3b4b99cd6d3735c72c133d06fe02a9d', - note: 'transactions#publishTransaction', - timestamp: 1653527035819, - }, - ], - [ - { - op: 'add', - path: '/hash', - value: - '0xb7628b82716108edcfe84dfd6ed49b219bc019e3fc6e96cf95548c32a67c1cbc', - note: 'transactions#setTxHash', - timestamp: 1653527035923, - }, - ], - [ - { - op: 'add', - path: '/submittedTime', - value: 1653527035924, - note: 'txStateManager - add submitted time stamp', - timestamp: 1653527035924, - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'submitted', - note: 'txStateManager: setting status to submitted', - timestamp: 1653527035925, - }, - ], - ], - nonceDetails: { - params: { - highestLocallyConfirmed: 81, - highestSuggested: 81, - nextNetworkNonce: 81, - }, - local: { - name: 'local', - nonce: 83, - details: { - startPoint: 81, - highest: 83, - }, - }, - network: { - name: 'network', - nonce: 81, - details: { - blockNumber: '0xa3e3ac', - baseCount: 81, - }, - }, - }, - r: '0xb66eff07d9061c42e47ccf5f6a52b6626ef4d5b10e50d8aa6b8f20ae645fe347', - s: '0x3a2da8d56beff82a2d59e807f7d578f0c3b4b99cd6d3735c72c133d06fe02a9d', - v: '0x2b', - rawTx: - '0xf863518459682f0e82520894e56e7847fd3661a9b7c86aaf1daea08d9da5750e80802ba0b66eff07d9061c42e47ccf5f6a52b6626ef4d5b10e50d8aa6b8f20ae645fe347a03a2da8d56beff82a2d59e807f7d578f0c3b4b99cd6d3735c72c133d06fe02a9d', - hash: '0xb7628b82716108edcfe84dfd6ed49b219bc019e3fc6e96cf95548c32a67c1cbc', - submittedTime: 1653527035924, - }, - [MOCK_TX_TYPE.CONTRACT_INTERACTION]: { - chainId: '0x4', - dappSuggestedGasFees: { - gas: '0x118f4', - maxFeePerGas: '0x9502f91a', - maxPriorityFeePerGas: '0x9502F900', - }, - id: 7694052085150913, - loadingDefaults: true, - metamaskNetworkId: '4', - origin: 'https://remix.ethereum.org', - originalGasEstimate: '0x118f4', - sendFlowHistory: [], - status: 'unapproved', - time: 1653417884003, - txParams: { - data: - '0xa1448194000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e0000000000000000000000000000000000000000000000000000000000000004', - from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', - gas: '0x118f4', - maxFeePerGas: '0x9502f91a', - maxPriorityFeePerGas: '0x9502F900', - to: '0xefg6c980a3fcd3100503d8f80537eefcee516d67', - type: '0x2', - value: '0x0', - }, - type: 'contractInteraction', - userEditedGasLimit: false, - }, - [MOCK_TX_TYPE.DEPLOY_CONTRACT]: { - blockNumber: '6195527', - id: 4243712234858468, - metamaskNetworkId: '4', - status: 'confirmed', - time: 1585088013000, - txParams: { - from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', - gas: '0x5208', - gasPrice: '0x77359400', - nonce: '0x3', - value: '0x00', - data: - '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', - }, - hash: '0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a', - type: 'contractDeployment', - origin: 'https://metamask.github.io', - }, - [MOCK_TX_TYPE.ETH_DECRYPT]: { - id: 5177046356058652, - msgParams: { - from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', - data: - '0x7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a22415a7a535971376139725531396e3835753174494f5765367a486e32775a6166222c22657068656d5075626c69634b6579223a2251336d346650474a6b6a32396d44766f7133536a77616733686b3651366571744236397671795258517a673d222c2263697068657274657874223a223943556d614c327a69635a5838584c4d5a75646b58392f6531544770384d61513135776276774c6d442b4235772b4f706655694c586c586d55355536645339675638584c61445557446e656735546b3d227d', - origin: 'https://metamask.github.io', - }, - time: 1653450860396, - txParams: { - from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', - gas: '0x5208', - gasPrice: '0x77359400', - nonce: '0x3', - value: '0x00', - data: - '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', - }, - status: 'unapproved', - type: 'eth_decrypt', - }, - [MOCK_TX_TYPE.ETH_GET_ENCRYPTION_PUBLIC_KEY]: { - id: 5177046356058645, - msgParams: '0xe56e7847fd3661a9b7c86aaf1daea08d9da5750e', - time: 1653450802102, - status: 'unapproved', - txParams: { - from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', - gas: '0x5208', - gasPrice: '0x77359400', - nonce: '0x3', - value: '0x00', - data: - '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', - }, - type: 'eth_getEncryptionPublicKey', - origin: 'https://metamask.github.io', - }, - [MOCK_TX_TYPE.INCOMING]: { - blockNumber: '6477257', - id: 4243712234858505, - metamaskNetworkId: '4', - status: 'confirmed', - time: 1589314295000, - txParams: { - from: '0xabc98d14007bdee637298086988a0bbd31184523', - gas: '0x5208', - gasPrice: '0x3b9aca00', - nonce: '0x56540', - to: '0xefga64466f257793eaa52fcfff5066894b76a149', - value: '0x1043561a882930000', - }, - hash: '0x5ca26d1cdcabef1ac2ad5b2b38604c9ced65d143efc7525f848c46f28e0e4116', - type: 'incoming', - }, - [MOCK_TX_TYPE.PERSONAL_SIGN]: { - id: 5177046356058671, - msgParams: { - 0: 'E', - 1: 'x', - 2: 'a', - 3: 'm', - 4: 'p', - 5: 'l', - 6: 'e', - 7: ' ', - 8: 'p', - 9: 'a', - 10: 's', - 11: 's', - 12: 'w', - 13: 'o', - 14: 'r', - 15: 'd', - from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', - data: '0x4578616d706c652060706572736f6e616c5f7369676e60206d657373616765', - origin: 'https://metamask.github.io', - }, - txParams: { - from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', - gas: '0x5208', - gasPrice: '0x77359400', - nonce: '0x3', - value: '0x00', - data: - '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', - }, - time: 1653451036121, - status: 'unapproved', - type: 'personal_sign', - }, - [MOCK_TX_TYPE.RETRY]: { - id: 3938342322880462, - time: 1653459456297, - status: 'failed', - metamaskNetworkId: '4', - originalGasEstimate: '14609', - userEditedGasLimit: false, - chainId: '0x4', - loadingDefaults: false, - dappSuggestedGasFees: null, - sendFlowHistory: [], - txParams: { - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - nonce: '0x7', - value: '0x0', - data: - '0x6080604052348015600f57600080fd5b50608b8061001e6000396000f3fe6080604052610fff3411600e57fe5b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156053573d6000803e3d6000fd5b5000fea265627a7a72315820631b0dbb6b871cdbfdec2773af15ebfb8e52c794cf836fe27ec21f1aed17180f64736f6c634300050c0032', - gas: '0x14609', - maxFeePerGas: '0x3b9aca0d', - maxPriorityFeePerGas: '0x3b9aca00', - estimateSuggested: 'medium', - estimateUsed: 'low', - }, - previousGasParams: { - maxFeePerGas: '0x3b9aca0b', - maxPriorityFeePerGas: '0xbebc200', - }, - type: 'retry', - estimatedBaseFee: 'd', - history: [ - { - id: 3938342322880462, - time: 1653459456297, - status: 'approved', - metamaskNetworkId: '4', - originalGasEstimate: '14609', - userEditedGasLimit: false, - chainId: '0x4', - loadingDefaults: false, - dappSuggestedGasFees: null, - sendFlowHistory: [], - txParams: { - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - nonce: '0x7', - value: '0x0', - data: - '0x6080604052348015600f57600080fd5b50608b8061001e6000396000f3fe6080604052610fff3411600e57fe5b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156053573d6000803e3d6000fd5b5000fea265627a7a72315820631b0dbb6b871cdbfdec2773af15ebfb8e52c794cf836fe27ec21f1aed17180f64736f6c634300050c0032', - gas: '0x14609', - maxFeePerGas: '0x3b9aca0d', - maxPriorityFeePerGas: '0x3b9aca00', - estimateSuggested: 'medium', - estimateUsed: 'low', - }, - previousGasParams: { - maxFeePerGas: '0x3b9aca0b', - maxPriorityFeePerGas: '0xbebc200', - }, - type: 'retry', - estimatedBaseFee: 'd', - }, - [ - { - op: 'add', - path: '/nonceDetails', - value: { - params: { - highestLocallyConfirmed: 7, - highestSuggested: 7, - nextNetworkNonce: 7, - }, - local: { - name: 'local', - nonce: 10, - details: { - startPoint: 7, - highest: 10, - }, - }, - network: { - name: 'network', - nonce: 7, - details: { - blockNumber: '0xa3d235', - baseCount: 7, - }, - }, - }, - note: 'transactions#approveTransaction', - timestamp: 1653459456415, - }, - ], - [ - { - op: 'add', - path: '/r', - value: - '0xde2e3131fb55b1edd182de128453521c86eed588f92058b61b3ce56cdfb33a26', - note: 'transactions#signTransaction: add r, s, v values', - timestamp: 1653459456512, - }, - { - op: 'add', - path: '/s', - value: - '0x64ee1eef8d0fa1b35e122658554d16645366e8977253fc1c47d030f28736409b', - }, - { - op: 'add', - path: '/v', - value: '0x00', - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'signed', - note: 'txStateManager: setting status to signed', - timestamp: 1653459456512, - }, - ], - [ - { - op: 'add', - path: '/rawTx', - value: - '0x02f901010407843b9aca00843b9aca0d830146098080b8a96080604052348015600f57600080fd5b50608b8061001e6000396000f3fe6080604052610fff3411600e57fe5b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156053573d6000803e3d6000fd5b5000fea265627a7a72315820631b0dbb6b871cdbfdec2773af15ebfb8e52c794cf836fe27ec21f1aed17180f64736f6c634300050c0032c080a0de2e3131fb55b1edd182de128453521c86eed588f92058b61b3ce56cdfb33a26a064ee1eef8d0fa1b35e122658554d16645366e8977253fc1c47d030f28736409b', - note: 'transactions#publishTransaction', - timestamp: 1653459456514, - }, - ], - [ - { - op: 'add', - path: '/err', - value: { - message: - '[ethjs-query] while formatting outputs from RPC \'{"value":{"code":-32000,"message":"replacement transaction underpriced"}}\'', - stack: - 'Error: [ethjs-query] while formatting outputs from RPC \'{"value":{"code":-32000,"message":"replacement transaction underpriced"}}\'\n at chrome-extension://hbljfohiafgaaaabejngpgolnboohpaf/common-5.js:14346:29', - }, - note: 'transactions:tx-state-manager#fail - add error', - timestamp: 1653459456632, - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'failed', - note: 'txStateManager: setting status to failed', - timestamp: 1653459456633, - }, - ], - ], - nonceDetails: { - params: { - highestLocallyConfirmed: 7, - highestSuggested: 7, - nextNetworkNonce: 7, - }, - local: { - name: 'local', - nonce: 10, - details: { - startPoint: 7, - highest: 10, - }, - }, - network: { - name: 'network', - nonce: 7, - details: { - blockNumber: '0xa3d235', - baseCount: 7, - }, - }, - }, - r: '0xde2e3131fb55b1edd182de128453521c86eed588f92058b61b3ce56cdfb33a26', - s: '0x64ee1eef8d0fa1b35e122658554d16645366e8977253fc1c47d030f28736409b', - v: '0x00', - rawTx: - '0x02f901010407843b9aca00843b9aca0d830146098080b8a96080604052348015600f57600080fd5b50608b8061001e6000396000f3fe6080604052610fff3411600e57fe5b3373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156053573d6000803e3d6000fd5b5000fea265627a7a72315820631b0dbb6b871cdbfdec2773af15ebfb8e52c794cf836fe27ec21f1aed17180f64736f6c634300050c0032c080a0de2e3131fb55b1edd182de128453521c86eed588f92058b61b3ce56cdfb33a26a064ee1eef8d0fa1b35e122658554d16645366e8977253fc1c47d030f28736409b', - err: { - message: - '[ethjs-query] while formatting outputs from RPC \'{"value":{"code":-32000,"message":"replacement transaction underpriced"}}\'', - stack: - 'Error: [ethjs-query] while formatting outputs from RPC \'{"value":{"code":-32000,"message":"replacement transaction underpriced"}}\'\n at chrome-extension://hbljfohiafgaaaabejngpgolnboohpaf/common-5.js:14346:29', - }, - }, - [MOCK_TX_TYPE.SIGN]: { - id: 5177046356058675, - msgParams: { - from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', - data: - '0x879a053d4800c6354e76c7985a865d2922c82fb5b3f4577b2fe08b998954f2e0', - origin: 'https://metamask.github.io', - }, - txParams: { - from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', - gas: '0x5208', - gasPrice: '0x77359400', - nonce: '0x3', - value: '0x00', - data: - '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', - }, - time: 1653451051909, - status: 'unapproved', - type: 'eth_sign', - }, - [MOCK_TX_TYPE.SIGN_TYPED_DATA]: { - id: 5177046356058598, - msgParams: { - from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', - data: [ - { - type: 'string', - name: 'Message', - value: 'Hi, Alice!', - }, - { - type: 'uint32', - name: 'A number', - value: '1337', - }, - ], - version: 'V1', - origin: 'https://metamask.github.io', - }, - txParams: { - from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', - gas: '0x5208', - gasPrice: '0x77359400', - nonce: '0x3', - value: '0x00', - data: - '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', - }, - time: 1653450005954, - status: 'unapproved', - type: 'eth_signTypedData', - }, - [MOCK_TX_TYPE.SIMPLE_SEND]: { - id: 4243712234858512, - time: 1589314601567, - status: 'confirmed', - metamaskNetworkId: '4', - loadingDefaults: false, - txParams: { - from: '0xabca64466f257793eaa52fcfff5066894b76a149', - to: '0xefg5bc4e8f1f969934d773fa67da095d2e491a97', - nonce: '0xc', - value: '0xde0b6b3a7640000', - gas: '0x5208', - gasPrice: '0x2540be400', - }, - origin: 'metamask', - type: 'simpleSend', - }, - [MOCK_TX_TYPE.SMART]: { - blockNumber: '6195527', - id: 4243712234858468, - metamaskNetworkId: '4', - status: 'confirmed', - time: 1585088013000, - txParams: { - from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', - gas: '0x5208', - gasPrice: '0x77359400', - nonce: '0x3', - value: '0x00', - data: - '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', - }, - hash: '0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a', - transactionType: 'smart', - type: 'contractDeployment', - origin: 'https://metamask.github.io', - }, - [MOCK_TX_TYPE.SWAP]: { - blockNumber: '6195527', - id: 4243712234858467, - metamaskNetworkId: '4', - status: 'confirmed', - time: 1585088013000, - txParams: { - from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', - gas: '0x5208', - gasPrice: '0x77359400', - nonce: '0x3', - to: '0xefga64466f257793eaa52fcfff5066894b76a149', - value: '0xde0b6b3a7640000', - }, - hash: '0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a', - destinationTokenSymbol: 'ABC', - sourceTokenSymbol: 'ETH', - type: 'swap', - }, - [MOCK_TX_TYPE.SWAP_APPROVAL]: { - blockNumber: '6195527', - id: 4243712234858467, - metamaskNetworkId: '4', - status: 'confirmed', - time: 1585088013000, - txParams: { - from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', - gas: '0x5208', - gasPrice: '0x77359400', - nonce: '0x3', - to: '0xefga64466f257793eaa52fcfff5066894b76a149', - value: '0xde0b6b3a7640000', - }, - hash: '0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a', - destinationTokenSymbol: 'ABC', - type: 'swapApproval', - sourceTokenSymbol: 'XBN', - }, - [MOCK_TX_TYPE.TOKEN_METHOD_APPROVE]: { - id: 5177046356058729, - time: 1653457101080, - status: 'submitted', - metamaskNetworkId: '4', - originalGasEstimate: '0xb427', - userEditedGasLimit: false, - chainId: '0x4', - loadingDefaults: false, - dappSuggestedGasFees: { - gasPrice: '0x4a817c800', - gas: '0xb427', - }, - sendFlowHistory: [], - txParams: { - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', - nonce: '0x5', - value: '0x0', - data: - '0x095ea7b30000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000011170', - gas: '0xb427', - maxFeePerGas: '0x4a817c800', - maxPriorityFeePerGas: '0x4a817c800', - }, - origin: 'https://metamask.github.io', - type: 'approve', - history: [ - { - id: 5177046356058729, - time: 1653457101080, - status: 'unapproved', - metamaskNetworkId: '4', - originalGasEstimate: '0xb427', - userEditedGasLimit: false, - chainId: '0x4', - loadingDefaults: true, - dappSuggestedGasFees: { - gasPrice: '0x4a817c800', - gas: '0xb427', - }, - sendFlowHistory: [], - txParams: { - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', - value: '0x0', - data: - '0x095ea7b30000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000011170', - gas: '0xb427', - gasPrice: '0x4a817c800', - }, - origin: 'https://metamask.github.io', - type: 'approve', - }, - [ - { - op: 'remove', - path: '/txParams/gasPrice', - note: 'Added new unapproved transaction.', - timestamp: 1653457101715, - }, - { - op: 'add', - path: '/txParams/maxFeePerGas', - value: '0x4a817c800', - }, - { - op: 'add', - path: '/txParams/maxPriorityFeePerGas', - value: '0x4a817c800', - }, - { - op: 'replace', - path: '/loadingDefaults', - value: false, - }, - { - op: 'add', - path: '/userFeeLevel', - value: 'custom', - }, - { - op: 'add', - path: '/defaultGasEstimates', - value: { - estimateType: 'custom', - gas: '0xb427', - maxFeePerGas: '0x4a817c800', - maxPriorityFeePerGas: '0x4a817c800', - }, - }, - ], - [ - { - op: 'add', - path: '/estimatedBaseFee', - value: '14', - note: 'confTx: user approved transaction', - timestamp: 1653457117006, - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'approved', - note: 'txStateManager: setting status to approved', - timestamp: 1653457117008, - }, - ], - [ - { - op: 'add', - path: '/txParams/nonce', - value: '0x5', - note: 'transactions#approveTransaction', - timestamp: 1653457117294, - }, - { - op: 'add', - path: '/nonceDetails', - value: { - params: { - highestLocallyConfirmed: 5, - highestSuggested: 5, - nextNetworkNonce: 5, - }, - local: { - name: 'local', - nonce: 5, - details: { - startPoint: 5, - highest: 5, - }, - }, - network: { - name: 'network', - nonce: 5, - details: { - blockNumber: '0xa3d19b', - baseCount: 5, - }, - }, - }, - }, - ], - [ - { - op: 'add', - path: '/r', - value: - '0xfdd2cb46203b5e7bba99cc56a37da3e5e3f36163a5bd9c51cddfd8d7028f5dd0', - note: 'transactions#signTransaction: add r, s, v values', - timestamp: 1653457117407, - }, - { - op: 'add', - path: '/s', - value: - '0x54c35cfa10b3350a3fd3a0e7b4aeb0b603d528c07a8cfdf4a78505d9864edef4', - }, - { - op: 'add', - path: '/v', - value: '0x00', - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'signed', - note: 'txStateManager: setting status to signed', - timestamp: 1653457117408, - }, - ], - [ - { - op: 'add', - path: '/rawTx', - value: - '0x02f8b104058504a817c8008504a817c80082b427949ba60bbf4ba1de43f3b4983a539feebfbd5fd97680b844095ea7b30000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000011170c080a0fdd2cb46203b5e7bba99cc56a37da3e5e3f36163a5bd9c51cddfd8d7028f5dd0a054c35cfa10b3350a3fd3a0e7b4aeb0b603d528c07a8cfdf4a78505d9864edef4', - note: 'transactions#publishTransaction', - timestamp: 1653457117410, - }, - ], - [ - { - op: 'add', - path: '/hash', - value: - '0x75b35f5b9a95c8e4b1a242be5b163c7a1b18822191b0b1de6985a8b9d3abfe26', - note: 'transactions#setTxHash', - timestamp: 1653457118158, - }, - ], - [ - { - op: 'add', - path: '/submittedTime', - value: 1653457118159, - note: 'txStateManager - add submitted time stamp', - timestamp: 1653457118160, - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'submitted', - note: 'txStateManager: setting status to submitted', - timestamp: 1653457118161, - }, - ], - ], - userFeeLevel: 'custom', - defaultGasEstimates: { - estimateType: 'custom', - gas: '0xb427', - maxFeePerGas: '0x4a817c800', - maxPriorityFeePerGas: '0x4a817c800', - }, - estimatedBaseFee: '14', - nonceDetails: { - params: { - highestLocallyConfirmed: 5, - highestSuggested: 5, - nextNetworkNonce: 5, - }, - local: { - name: 'local', - nonce: 5, - details: { - startPoint: 5, - highest: 5, - }, - }, - network: { - name: 'network', - nonce: 5, - details: { - blockNumber: '0xa3d19b', - baseCount: 5, - }, - }, - }, - r: '0xfdd2cb46203b5e7bba99cc56a37da3e5e3f36163a5bd9c51cddfd8d7028f5dd0', - s: '0x54c35cfa10b3350a3fd3a0e7b4aeb0b603d528c07a8cfdf4a78505d9864edef4', - v: '0x00', - rawTx: - '0x02f8b104058504a817c8008504a817c80082b427949ba60bbf4ba1de43f3b4983a539feebfbd5fd97680b844095ea7b30000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000011170c080a0fdd2cb46203b5e7bba99cc56a37da3e5e3f36163a5bd9c51cddfd8d7028f5dd0a054c35cfa10b3350a3fd3a0e7b4aeb0b603d528c07a8cfdf4a78505d9864edef4', - hash: '0x75b35f5b9a95c8e4b1a242be5b163c7a1b18822191b0b1de6985a8b9d3abfe26', - submittedTime: 1653457118159, - }, - [MOCK_TX_TYPE.TOKEN_METHOD_SAFE_TRANSFER_FROM]: { - id: 1441203963845330, - time: 1652206763566, - status: 'confirmed', - metamaskNetworkId: '4', - originalGasEstimate: '0x118e0', - userEditedGasLimit: false, - chainId: '0x4', - loadingDefaults: false, - dappSuggestedGasFees: { - maxPriorityFeePerGas: '0x3B9ACA00', - maxFeePerGas: '0x7be830aec', - }, - sendFlowHistory: [], - txParams: { - from: '0xabc627172af48bd5b0765d3449a7def80d6576ff', - to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', - nonce: '0x57', - value: '0x0', - data: - '0x42842e0e000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98000000000000000000000000000000000000000000000000000000000009a7cc', - gas: '0x118e0', - maxFeePerGas: '0x7be830aec', - maxPriorityFeePerGas: '0x3B9ACA00', - }, - origin: 'https://rinkeby.etherscan.io', - type: 'safetransferfrom', - userFeeLevel: 'dappSuggested', - defaultGasEstimates: { - estimateType: 'dappSuggested', - gas: '0x118e0', - maxFeePerGas: '0x7be830aec', - maxPriorityFeePerGas: '0x3B9ACA00', - }, - estimatedBaseFee: '3ba182755', - nonceDetails: { - params: { - highestLocallyConfirmed: 87, - highestSuggested: 87, - nextNetworkNonce: 87, - }, - local: { - name: 'local', - nonce: 87, - details: { - startPoint: 87, - highest: 87, - }, - }, - network: { - name: 'network', - nonce: 87, - details: { - blockNumber: '0xa28e38', - baseCount: 87, - }, - }, - }, - r: '0xd13310569a8d5876e37788183034bfe4bc3b49c0663c5fd9b2bf13adf9b4791c', - s: '0x7a83d8840e7edcdf4fdedfd2bc1ce19775e54fd17f29ede5165591a1cf3febea', - v: '0x00', - rawTx: - '0x02f8d10457843b9aca008507be830aec830118e094f5de760f2e916647fd766b4ad9e85ff943ce3a2b80b86442842e0e000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98000000000000000000000000000000000000000000000000000000000009a7ccc080a0d13310569a8d5876e37788183034bfe4bc3b49c0663c5fd9b2bf13adf9b4791ca07a83d8840e7edcdf4fdedfd2bc1ce19775e54fd17f29ede5165591a1cf3febea', - hash: '0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3', - submittedTime: 1652206777046, - txReceipt: { - blockHash: - '0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1', - blockNumber: 'a28e39', - contractAddress: null, - cumulativeGasUsed: 'fd5dee', - effectiveGasPrice: '0x4028dcaf1', - from: '0xabc627172af48bd5b0765d3449a7def80d6576ff', - gasUsed: 'bb40', - logs: [ - { - address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', - blockHash: - '0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1', - blockNumber: 'a28e39', - data: '0x', - logIndex: '45', - removed: false, - topics: [ - '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925', - '0x000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff', - '0x0000000000000000000000000000000000000000000000000000000000000000', - '0x000000000000000000000000000000000000000000000000000000000009a7cc', - ], - transactionHash: - '0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3', - transactionIndex: '23', - }, - { - address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', - blockHash: - '0x75eb415f79d24f62821b979e3a5f0d4904b2381e973da5fadbddc046c701e3d1', - blockNumber: 'a28e39', - data: '0x', - logIndex: '46', - removed: false, - topics: [ - '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', - '0x000000000000000000000000806627172af48bd5b0765d3449a7def80d6576ff', - '0x000000000000000000000000e7d522230eff653bb0a9b4385f0be0815420dd98', - '0x000000000000000000000000000000000000000000000000000000000009a7cc', - ], - transactionHash: - '0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3', - transactionIndex: '23', - }, - ], - logsBloom: - '0x00000000000000001000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000008000200000000000000000000000000008000000000000000000008000000000000000000000000000020800000000000000000800000000000000000000000010000000000000000000000000000080000010000000000000000000000000000000000000020000000000000000000001000000000000000000000000000000000000000000000202000000000000000000000800000000000000000000000000000020000010000000000002008000000000000000000000000000000000000000000000', - status: '0x1', - to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', - transactionHash: - '0xe8717d7b075f8bb555cd4bb9846659a7dfba70dc017a84782a2d23d21f948ee3', - transactionIndex: '23', - type: '0x2', - }, - baseFeePerGas: '0x3c6f300f1', - blockTimestamp: '627aacc2', - }, - [MOCK_TX_TYPE.TOKEN_METHOD_TRANSFER]: { - id: 5177046356058725, - time: 1653457077370, - status: 'confirmed', - metamaskNetworkId: '4', - originalGasEstimate: '0xea60', - userEditedGasLimit: false, - chainId: '0x4', - loadingDefaults: false, - dappSuggestedGasFees: { - gasPrice: '0x4a817c800', - gas: '0xea60', - }, - sendFlowHistory: [], - txParams: { - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', - nonce: '0x4', - value: '0x0', - data: - '0xa9059cbb0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000003a98', - gas: '0xea60', - maxFeePerGas: '0x4a817c800', - maxPriorityFeePerGas: '0x4a817c800', - }, - origin: 'https://metamask.github.io', - type: 'transfer', - history: [ - { - id: 5177046356058725, - time: 1653457077370, - status: 'unapproved', - metamaskNetworkId: '4', - originalGasEstimate: '0xea60', - userEditedGasLimit: false, - chainId: '0x4', - loadingDefaults: true, - dappSuggestedGasFees: { - gasPrice: '0x4a817c800', - gas: '0xea60', - }, - sendFlowHistory: [], - txParams: { - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', - value: '0x0', - data: - '0xa9059cbb0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000003a98', - gas: '0xea60', - gasPrice: '0x4a817c800', - }, - origin: 'https://metamask.github.io', - type: 'transfer', - }, - [ - { - op: 'remove', - path: '/txParams/gasPrice', - note: 'Added new unapproved transaction.', - timestamp: 1653457077808, - }, - { - op: 'add', - path: '/txParams/maxFeePerGas', - value: '0x4a817c800', - }, - { - op: 'add', - path: '/txParams/maxPriorityFeePerGas', - value: '0x4a817c800', - }, - { - op: 'replace', - path: '/loadingDefaults', - value: false, - }, - { - op: 'add', - path: '/userFeeLevel', - value: 'custom', - }, - { - op: 'add', - path: '/defaultGasEstimates', - value: { - estimateType: 'custom', - gas: '0xea60', - maxFeePerGas: '0x4a817c800', - maxPriorityFeePerGas: '0x4a817c800', - }, - }, - ], - [ - { - op: 'add', - path: '/estimatedBaseFee', - value: '16', - note: 'confTx: user approved transaction', - timestamp: 1653457091914, - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'approved', - note: 'txStateManager: setting status to approved', - timestamp: 1653457091915, - }, - ], - [ - { - op: 'add', - path: '/txParams/nonce', - value: '0x4', - note: 'transactions#approveTransaction', - timestamp: 1653457091939, - }, - { - op: 'add', - path: '/nonceDetails', - value: { - params: { - highestLocallyConfirmed: 4, - highestSuggested: 4, - nextNetworkNonce: 4, - }, - local: { - name: 'local', - nonce: 4, - details: { - startPoint: 4, - highest: 4, - }, - }, - network: { - name: 'network', - nonce: 4, - details: { - blockNumber: '0xa3d198', - baseCount: 4, - }, - }, - }, - }, - ], - [ - { - op: 'add', - path: '/r', - value: - '0xb0f36e4392f9d302351789aef355a2e95b979bcdd99d19026c533152563d3bce', - note: 'transactions#signTransaction: add r, s, v values', - timestamp: 1653457092053, - }, - { - op: 'add', - path: '/s', - value: - '0x08e59de373e65c9c54e6a8052585461e81409d33178464f9b72f4cc36ac75d40', - }, - { - op: 'add', - path: '/v', - value: '0x01', - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'signed', - note: 'txStateManager: setting status to signed', - timestamp: 1653457092054, - }, - ], - [ - { - op: 'add', - path: '/rawTx', - value: - '0x02f8b104048504a817c8008504a817c80082ea60949ba60bbf4ba1de43f3b4983a539feebfbd5fd97680b844a9059cbb0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000003a98c001a0b0f36e4392f9d302351789aef355a2e95b979bcdd99d19026c533152563d3bcea008e59de373e65c9c54e6a8052585461e81409d33178464f9b72f4cc36ac75d40', - note: 'transactions#publishTransaction', - timestamp: 1653457092056, - }, - ], - [ - { - op: 'add', - path: '/hash', - value: - '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', - note: 'transactions#setTxHash', - timestamp: 1653457092526, - }, - ], - [ - { - op: 'add', - path: '/submittedTime', - value: 1653457092527, - note: 'txStateManager - add submitted time stamp', - timestamp: 1653457092527, - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'submitted', - note: 'txStateManager: setting status to submitted', - timestamp: 1653457092529, - }, - ], - [ - { - op: 'add', - path: '/firstRetryBlockNumber', - value: '0xa3d199', - note: 'transactions/pending-tx-tracker#event: tx:block-update', - timestamp: 1653457094748, - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'confirmed', - note: 'txStateManager: setting status to confirmed', - timestamp: 1653457115712, - }, - { - op: 'add', - path: '/txReceipt', - value: { - blockHash: - '0x243a362e5fda0d6ec8fce3d7f727679148c1df8ec6d7470ff65b38c8a96823b4', - blockNumber: 'a3d19a', - contractAddress: null, - cumulativeGasUsed: 'ca21', - effectiveGasPrice: '0x4a817c800', - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - gasUsed: 'ca21', - logs: [ - { - address: '0x9ba60bbf4ba1de43f3b4983a539feebfbd5fd976', - blockHash: - '0x243a362e5fda0d6ec8fce3d7f727679148c1df8ec6d7470ff65b38c8a96823b4', - blockNumber: 'a3d19a', - data: - '0x0000000000000000000000000000000000000000000000000000000000003a98', - logIndex: '0', - removed: false, - topics: [ - '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', - '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', - '0x0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c970', - ], - transactionHash: - '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', - transactionIndex: '0', - }, - ], - logsBloom: - '0x00000000000000000000000000000000000000000000001000000100000100000000000000000000000000000000000000000000000000000000000000000000000000000020000000000008000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000100000000000000000000000000000000000000000000000000000000000000000000000800000004000000000000001000000000000000', - status: '0x1', - to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', - transactionHash: - '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', - transactionIndex: '0', - type: '0x2', - }, - }, - { - op: 'add', - path: '/baseFeePerGas', - value: '0x14', - }, - { - op: 'add', - path: '/blockTimestamp', - value: '628dc0c8', - }, - ], - [ - { - op: 'replace', - path: '/blockTimestamp', - value: '628dc0c8', - note: 'transactions#confirmTransaction - add txReceipt', - timestamp: 1653457115870, - }, - { - op: 'replace', - path: '/txReceipt/transactionIndex', - value: '0', - }, - { - op: 'replace', - path: '/txReceipt/logs/0/transactionIndex', - value: '0', - }, - { - op: 'replace', - path: '/txReceipt/logs/0/logIndex', - value: '0', - }, - { - op: 'replace', - path: '/txReceipt/logs/0/blockNumber', - value: 'a3d19a', - }, - { - op: 'replace', - path: '/txReceipt/cumulativeGasUsed', - value: 'ca21', - }, - { - op: 'replace', - path: '/txReceipt/blockNumber', - value: 'a3d19a', - }, - ], - ], - userFeeLevel: 'custom', - defaultGasEstimates: { - estimateType: 'custom', - gas: '0xea60', - maxFeePerGas: '0x4a817c800', - maxPriorityFeePerGas: '0x4a817c800', - }, - estimatedBaseFee: '16', - nonceDetails: { - params: { - highestLocallyConfirmed: 4, - highestSuggested: 4, - nextNetworkNonce: 4, - }, - local: { - name: 'local', - nonce: 4, - details: { - startPoint: 4, - highest: 4, - }, - }, - network: { - name: 'network', - nonce: 4, - details: { - blockNumber: '0xa3d198', - baseCount: 4, - }, - }, - }, - r: '0xb0f36e4392f9d302351789aef355a2e95b979bcdd99d19026c533152563d3bce', - s: '0x08e59de373e65c9c54e6a8052585461e81409d33178464f9b72f4cc36ac75d40', - v: '0x01', - rawTx: - '0x02f8b104048504a817c8008504a817c80082ea60949ba60bbf4ba1de43f3b4983a539feebfbd5fd97680b844a9059cbb0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c9700000000000000000000000000000000000000000000000000000000000003a98c001a0b0f36e4392f9d302351789aef355a2e95b979bcdd99d19026c533152563d3bcea008e59de373e65c9c54e6a8052585461e81409d33178464f9b72f4cc36ac75d40', - hash: '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', - submittedTime: 1653457092527, - firstRetryBlockNumber: '0xa3d199', - txReceipt: { - blockHash: - '0x243a362e5fda0d6ec8fce3d7f727679148c1df8ec6d7470ff65b38c8a96823b4', - blockNumber: 'a3d19a', - contractAddress: null, - cumulativeGasUsed: 'ca21', - effectiveGasPrice: '0x4a817c800', - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - gasUsed: 'ca21', - logs: [ - { - address: '0x9ba60bbf4ba1de43f3b4983a539feebfbd5fd976', - blockHash: - '0x243a362e5fda0d6ec8fce3d7f727679148c1df8ec6d7470ff65b38c8a96823b4', - blockNumber: 'a3d19a', - data: - '0x0000000000000000000000000000000000000000000000000000000000003a98', - logIndex: '0', - removed: false, - topics: [ - '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', - '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', - '0x0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c970', - ], - transactionHash: - '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', - transactionIndex: '0', - }, - ], - logsBloom: - '0x00000000000000000000000000000000000000000000001000000100000100000000000000000000000000000000000000000000000000000000000000000000000000000020000000000008000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000100000000000000000000000000000000000000000000000000000000000000000000000800000004000000000000001000000000000000', - status: '0x1', - to: '0xefg60bbf4ba1de43f3b4983a539feebfbd5fd976', - transactionHash: - '0x3a8ed11c3d0ac26e4fe07812a29efdb642f15b8d83d2716ddf80d11b2542916f', - transactionIndex: '0', - type: '0x2', - }, - baseFeePerGas: '0x14', - blockTimestamp: '628dc0c8', - }, - [MOCK_TX_TYPE.TOKEN_METHOD_TRANSFER_FROM]: { - id: 5177046356058754, - time: 1653457323504, - status: 'confirmed', - metamaskNetworkId: '4', - originalGasEstimate: '0x10896', - userEditedGasLimit: false, - chainId: '0x4', - loadingDefaults: false, - dappSuggestedGasFees: null, - sendFlowHistory: [ - { - entry: 'sendFlow - user set asset type to COLLECTIBLE', - timestamp: 1653457317999, - }, - { - entry: 'sendFlow - user set asset symbol to undefined', - timestamp: 1653457318000, - }, - { - entry: - 'sendFlow - user set asset address to 0xf5de760f2e916647fd766B4AD9E85ff943cE3A2b', - timestamp: 1653457318000, - }, - { - entry: - 'sendFlow - user selected transfer to my accounts on recipient screen', - timestamp: 1653457319474, - }, - { - entry: - 'sendFlow - User clicked recipient from my accounts. address: 0xe56e7847fd3661a9b7c86aaf1daea08d9da5750e, nickname Account 1', - timestamp: 1653457320321, - }, - ], - txParams: { - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', - nonce: '0x6', - value: '0x0', - data: - '0x23b872dd000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e000000000000000000000000000000000000000000000000000000000009a7b8', - gas: '0x10896', - maxFeePerGas: '0x59682f12', - maxPriorityFeePerGas: '0x59682f00', - type: '0x2', - }, - origin: 'metamask', - type: 'transferfrom', - history: [ - { - id: 5177046356058754, - time: 1653457323504, - status: 'unapproved', - metamaskNetworkId: '4', - originalGasEstimate: '0x10896', - userEditedGasLimit: false, - chainId: '0x4', - loadingDefaults: true, - dappSuggestedGasFees: null, - sendFlowHistory: [ - { - entry: 'sendFlow - user set asset type to COLLECTIBLE', - timestamp: 1653457317999, - }, - { - entry: 'sendFlow - user set asset symbol to undefined', - timestamp: 1653457318000, - }, - { - entry: - 'sendFlow - user set asset address to 0xf5de760f2e916647fd766B4AD9E85ff943cE3A2b', - timestamp: 1653457318000, - }, - { - entry: - 'sendFlow - user selected transfer to my accounts on recipient screen', - timestamp: 1653457319474, - }, - { - entry: - 'sendFlow - User clicked recipient from my accounts. address: 0xe56e7847fd3661a9b7c86aaf1daea08d9da5750e, nickname Account 1', - timestamp: 1653457320321, - }, - ], - txParams: { - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', - value: '0x0', - data: - '0x23b872dd000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e000000000000000000000000000000000000000000000000000000000009a7b8', - gas: '0x10896', - maxFeePerGas: '0x59682f12', - maxPriorityFeePerGas: '0x59682f00', - type: '0x2', - }, - origin: 'metamask', - type: 'transferfrom', - }, - [ - { - op: 'replace', - path: '/loadingDefaults', - value: false, - note: 'Added new unapproved transaction.', - timestamp: 1653457323593, - }, - { - op: 'add', - path: '/userFeeLevel', - value: 'medium', - }, - { - op: 'add', - path: '/defaultGasEstimates', - value: { - estimateType: 'medium', - gas: '0x10896', - maxFeePerGas: '0x59682f12', - maxPriorityFeePerGas: '0x59682f00', - }, - }, - ], - [ - { - op: 'add', - path: '/estimatedBaseFee', - value: 'd', - note: 'confTx: user approved transaction', - timestamp: 1653457330346, - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'approved', - note: 'txStateManager: setting status to approved', - timestamp: 1653457330347, - }, - ], - [ - { - op: 'add', - path: '/txParams/nonce', - value: '0x6', - note: 'transactions#approveTransaction', - timestamp: 1653457330354, - }, - { - op: 'add', - path: '/nonceDetails', - value: { - params: { - highestLocallyConfirmed: 6, - highestSuggested: 6, - nextNetworkNonce: 6, - }, - local: { - name: 'local', - nonce: 6, - details: { - startPoint: 6, - highest: 6, - }, - }, - network: { - name: 'network', - nonce: 6, - details: { - blockNumber: '0xa3d1a8', - baseCount: 6, - }, - }, - }, - }, - ], - [ - { - op: 'add', - path: '/r', - value: - '0x58294750acbe46cb0dd15ef615a244be49af61f0d799cce68bbbd3d4e7c75cdc', - note: 'transactions#signTransaction: add r, s, v values', - timestamp: 1653457330496, - }, - { - op: 'add', - path: '/s', - value: - '0x3993c38f6e168065d9b20a0b4254697d47db114f57243f56c22f228c7a173f9c', - }, - { - op: 'add', - path: '/v', - value: '0x01', - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'signed', - note: 'txStateManager: setting status to signed', - timestamp: 1653457330497, - }, - ], - [ - { - op: 'add', - path: '/rawTx', - value: - '0x02f8d004068459682f008459682f128301089694f5de760f2e916647fd766b4ad9e85ff943ce3a2b80b86423b872dd000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e000000000000000000000000000000000000000000000000000000000009a7b8c001a058294750acbe46cb0dd15ef615a244be49af61f0d799cce68bbbd3d4e7c75cdca03993c38f6e168065d9b20a0b4254697d47db114f57243f56c22f228c7a173f9c', - note: 'transactions#publishTransaction', - timestamp: 1653457330498, - }, - ], - [ - { - op: 'add', - path: '/hash', - value: - '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', - note: 'transactions#setTxHash', - timestamp: 1653457330596, - }, - ], - [ - { - op: 'add', - path: '/submittedTime', - value: 1653457330597, - note: 'txStateManager - add submitted time stamp', - timestamp: 1653457330597, - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'submitted', - note: 'txStateManager: setting status to submitted', - timestamp: 1653457330598, - }, - ], - [ - { - op: 'replace', - path: '/status', - value: 'confirmed', - note: 'txStateManager: setting status to confirmed', - timestamp: 1653457338358, - }, - { - op: 'add', - path: '/txReceipt', - value: { - blockHash: - '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', - blockNumber: 'a3d1aa', - contractAddress: null, - cumulativeGasUsed: '3c0267', - effectiveGasPrice: '0x59682f0d', - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - gasUsed: '9da4', - logs: [ - { - address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', - blockHash: - '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', - blockNumber: 'a3d1aa', - data: '0x', - logIndex: '21', - removed: false, - topics: [ - '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925', - '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', - '0x0000000000000000000000000000000000000000000000000000000000000000', - '0x000000000000000000000000000000000000000000000000000000000009a7b8', - ], - transactionHash: - '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', - transactionIndex: '11', - }, - { - address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', - blockHash: - '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', - blockNumber: 'a3d1aa', - data: '0x', - logIndex: '22', - removed: false, - topics: [ - '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', - '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', - '0x000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e', - '0x000000000000000000000000000000000000000000000000000000000009a7b8', - ], - transactionHash: - '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', - transactionIndex: '11', - }, - ], - logsBloom: - '0x00000000000000000000000000000000000000008000000000000000000100000000000000000000000000000000000000000000000000000000008000200000000000000000000000000008000000000000000000008000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000010000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000002504000000100000000000020000000000000000000000000000020000010000000000000000000000400000000000000000000001000000000000000', - status: '0x1', - to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', - transactionHash: - '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', - transactionIndex: '11', - type: '0x2', - }, - }, - { - op: 'add', - path: '/baseFeePerGas', - value: '0xd', - }, - { - op: 'add', - path: '/blockTimestamp', - value: '628dc1b8', - }, - ], - [ - { - op: 'replace', - path: '/blockTimestamp', - value: '628dc1b8', - note: 'transactions#confirmTransaction - add txReceipt', - timestamp: 1653457338377, - }, - { - op: 'replace', - path: '/txReceipt/transactionIndex', - value: '11', - }, - { - op: 'replace', - path: '/txReceipt/logs/1/transactionIndex', - value: '11', - }, - { - op: 'replace', - path: '/txReceipt/logs/1/logIndex', - value: '22', - }, - { - op: 'replace', - path: '/txReceipt/logs/1/blockNumber', - value: 'a3d1aa', - }, - { - op: 'replace', - path: '/txReceipt/logs/0/transactionIndex', - value: '11', - }, - { - op: 'replace', - path: '/txReceipt/logs/0/logIndex', - value: '21', - }, - { - op: 'replace', - path: '/txReceipt/logs/0/blockNumber', - value: 'a3d1aa', - }, - { - op: 'replace', - path: '/txReceipt/cumulativeGasUsed', - value: '3c0267', - }, - { - op: 'replace', - path: '/txReceipt/blockNumber', - value: 'a3d1aa', - }, - ], - ], - userFeeLevel: 'medium', - defaultGasEstimates: { - estimateType: 'medium', - gas: '0x10896', - maxFeePerGas: '0x59682f12', - maxPriorityFeePerGas: '0x59682f00', - }, - estimatedBaseFee: 'd', - nonceDetails: { - params: { - highestLocallyConfirmed: 6, - highestSuggested: 6, - nextNetworkNonce: 6, - }, - local: { - name: 'local', - nonce: 6, - details: { - startPoint: 6, - highest: 6, - }, - }, - network: { - name: 'network', - nonce: 6, - details: { - blockNumber: '0xa3d1a8', - baseCount: 6, - }, - }, - }, - r: '0x58294750acbe46cb0dd15ef615a244be49af61f0d799cce68bbbd3d4e7c75cdc', - s: '0x3993c38f6e168065d9b20a0b4254697d47db114f57243f56c22f228c7a173f9c', - v: '0x01', - rawTx: - '0x02f8d004068459682f008459682f128301089694f5de760f2e916647fd766b4ad9e85ff943ce3a2b80b86423b872dd000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e000000000000000000000000000000000000000000000000000000000009a7b8c001a058294750acbe46cb0dd15ef615a244be49af61f0d799cce68bbbd3d4e7c75cdca03993c38f6e168065d9b20a0b4254697d47db114f57243f56c22f228c7a173f9c', - hash: '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', - submittedTime: 1653457330597, - txReceipt: { - blockHash: - '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', - blockNumber: 'a3d1aa', - contractAddress: null, - cumulativeGasUsed: '3c0267', - effectiveGasPrice: '0x59682f0d', - from: '0xabc539a7d5c43940af498008a7c8f3abb35c3725', - gasUsed: '9da4', - logs: [ - { - address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', - blockHash: - '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', - blockNumber: 'a3d1aa', - data: '0x', - logIndex: '21', - removed: false, - topics: [ - '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925', - '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', - '0x0000000000000000000000000000000000000000000000000000000000000000', - '0x000000000000000000000000000000000000000000000000000000000009a7b8', - ], - transactionHash: - '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', - transactionIndex: '11', - }, - { - address: '0xf5de760f2e916647fd766b4ad9e85ff943ce3a2b', - blockHash: - '0x9e97839be24b9dacd2b91a0504317bc9c6eaea6904472dce450e583c398cb60a', - blockNumber: 'a3d1aa', - data: '0x', - logIndex: '22', - removed: false, - topics: [ - '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', - '0x000000000000000000000000ac9539a7d5c43940af498008a7c8f3abb35c3725', - '0x000000000000000000000000e56e7847fd3661a9b7c86aaf1daea08d9da5750e', - '0x000000000000000000000000000000000000000000000000000000000009a7b8', - ], - transactionHash: - '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', - transactionIndex: '11', - }, - ], - logsBloom: - '0x00000000000000000000000000000000000000008000000000000000000100000000000000000000000000000000000000000000000000000000008000200000000000000000000000000008000000000000000000008000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000010000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000002504000000100000000000020000000000000000000000000000020000010000000000000000000000400000000000000000000001000000000000000', - status: '0x1', - to: '0xefge760f2e916647fd766b4ad9e85ff943ce3a2b', - transactionHash: - '0xc523e40d676563619138c310391000f91a93005028eedb72bf05133f2d6c8e4d', - transactionIndex: '11', - type: '0x2', - }, - baseFeePerGas: '0xd', - blockTimestamp: '628dc1b8', - }, -}; diff --git a/.storybook/preview.js b/.storybook/preview.js index 2e7bc26bc9da..517e7820ad40 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -30,7 +30,7 @@ addParameters({ storySort: { order: [ 'Getting Started', - 'Foundations', + 'Design Tokens', 'Components', ['UI', 'App'], 'Pages', diff --git a/.storybook/test-data.js b/.storybook/test-data.js index 44aca95a649d..44038239df48 100644 --- a/.storybook/test-data.js +++ b/.storybook/test-data.js @@ -1,4 +1,3 @@ -import { draftTransactionInitialState } from '../ui/ducks/send'; const state = { invalidCustomNetwork: { state: 'CLOSED', @@ -16,99 +15,99 @@ const state = { }, networkList: [ { - blockExplorerUrl: 'https://etherscan.io', - chainId: '0x1', + blockExplorerUrl: "https://etherscan.io", + chainId: "0x1", iconColor: 'var(--mainnet)', isATestNetwork: false, - labelKey: 'mainnet', - providerType: 'mainnet', - rpcUrl: 'https://mainnet.infura.io/v3/', - ticker: 'ETH', + labelKey: "mainnet", + providerType: "mainnet", + rpcUrl: "https://mainnet.infura.io/v3/", + ticker: "ETH", viewOnly: true, }, { - blockExplorerUrl: 'https://ropsten.etherscan.io', - chainId: '0x3', + blockExplorerUrl: "https://ropsten.etherscan.io", + chainId: "0x3", iconColor: 'var(--ropsten)', isATestNetwork: true, - labelKey: 'ropsten', - providerType: 'ropsten', - rpcUrl: 'https://ropsten.infura.io/v3/', - ticker: 'ETH', + labelKey: "ropsten", + providerType: "ropsten", + rpcUrl: "https://ropsten.infura.io/v3/", + ticker: "ETH", viewOnly: true, }, { - blockExplorerUrl: 'https://rinkeby.etherscan.io', - chainId: '0x4', + blockExplorerUrl: "https://rinkeby.etherscan.io", + chainId: "0x4", iconColor: 'var(--rinkeby)', isATestNetwork: true, - labelKey: 'rinkeby', - providerType: 'rinkeby', - rpcUrl: 'https://rinkeby.infura.io/v3/', - ticker: 'ETH', + labelKey: "rinkeby", + providerType: "rinkeby", + rpcUrl: "https://rinkeby.infura.io/v3/", + ticker: "ETH", viewOnly: true, }, { - blockExplorerUrl: 'https://goerli.etherscan.io', - chainId: '0x5', + blockExplorerUrl: "https://goerli.etherscan.io", + chainId: "0x5", iconColor: 'var(--goerli)', isATestNetwork: true, - labelKey: 'goerli', - providerType: 'goerli', - rpcUrl: 'https://goerli.infura.io/v3/', - ticker: 'ETH', + labelKey: "goerli", + providerType: "goerli", + rpcUrl: "https://goerli.infura.io/v3/", + ticker: "ETH", viewOnly: true, }, { - blockExplorerUrl: 'https://kovan.etherscan.io', - chainId: '0x2a', + blockExplorerUrl: "https://kovan.etherscan.io", + chainId: "0x2a", iconColor: 'var(--kovan)', isATestNetwork: true, - labelKey: 'kovan', - providerType: 'kovan', - rpcUrl: 'https://kovan.infura.io/v3/', - ticker: 'ETH', + labelKey: "kovan", + providerType: "kovan", + rpcUrl: "https://kovan.infura.io/v3/", + ticker: "ETH", viewOnly: true, }, { - blockExplorerUrl: '', - chainId: '0x539', + blockExplorerUrl: "", + chainId: "0x539", iconColor: 'var(--localhost)', isATestNetwork: true, - label: 'Localhost 8545', - providerType: 'rpc', - rpcUrl: 'http://localhost:8545', - ticker: 'ETH', + label: "Localhost 8545", + providerType: "rpc", + rpcUrl: "http://localhost:8545", + ticker: "ETH", }, { - blockExplorerUrl: 'https://bscscan.com', - chainId: '0x38', + blockExplorerUrl: "https://bscscan.com", + chainId: "0x38", iconColor: 'var(--localhost)', isATestNetwork: false, - label: 'Binance Smart Chain', - providerType: 'rpc', - rpcUrl: 'https://bsc-dataseed.binance.org/', - ticker: 'BNB', + label: "Binance Smart Chain", + providerType: "rpc", + rpcUrl: "https://bsc-dataseed.binance.org/", + ticker: "BNB", }, { - blockExplorerUrl: 'https://cchain.explorer.avax.network/', - chainId: '0xa86a', + blockExplorerUrl: "https://cchain.explorer.avax.network/", + chainId: "0xa86a", iconColor: 'var(--localhost)', isATestNetwork: false, - label: 'Avalanche', - providerType: 'rpc', - rpcUrl: 'https://api.avax.network/ext/bc/C/rpc', - ticker: 'AVAX', + label: "Avalanche", + providerType: "rpc", + rpcUrl: "https://api.avax.network/ext/bc/C/rpc", + ticker: "AVAX", }, { - blockExplorerUrl: 'https://polygonscan.com', - chainId: '0x89', + blockExplorerUrl: "https://polygonscan.com", + chainId: "0x89", iconColor: 'var(--localhost)', isATestNetwork: false, - label: 'Polygon', - providerType: 'rpc', - rpcUrl: 'https://polygon-rpc.com', - ticker: 'MATIC', + label: "Polygon", + providerType: "rpc", + rpcUrl: "https://polygon-rpc.com", + ticker: "MATIC", }, ], metamask: { @@ -133,7 +132,7 @@ const state = { '0x', ], occurrences: 12, - unlisted: false, + unlisted: false }, '0xc00e94cb662c3520282e6f5717214004a7f26888': { address: '0xc00e94cb662c3520282e6f5717214004a7f26888', @@ -154,18 +153,23 @@ const state = { '0x', ], occurrences: 12, - unlisted: false, + unlisted: false }, '0xfffffffff15abf397da76f1dcc1a1604f45126db': { address: '0xfffffffff15abf397da76f1dcc1a1604f45126db', symbol: 'FSW', decimals: 18, name: 'Falconswap', - iconUrl: - 'https://assets.coingecko.com/coins/images/12256/thumb/falconswap.png?1598534184', - aggregators: ['CoinGecko', '1inch', 'Paraswap', 'Zapper', 'Zerion'], + iconUrl: 'https://assets.coingecko.com/coins/images/12256/thumb/falconswap.png?1598534184', + aggregators: [ + 'CoinGecko', + '1inch', + 'Paraswap', + 'Zapper', + 'Zerion', + ], occurrences: 12, - unlisted: false, + unlisted: false }, '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f': { address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', @@ -188,70 +192,70 @@ const state = { '0x', ], occurrences: 12, - unlisted: false, + unlisted: false }, '0x6b175474e89094c44da98b954eedeac495271d0f': { address: '0x6b175474e89094c44da98b954eedeac495271d0f', symbol: 'META', decimals: 18, image: 'metamark.svg', - unlisted: false, + unlisted: false }, '0xB8c77482e45F1F44dE1745F52C74426C631bDD52': { address: '0xB8c77482e45F1F44dE1745F52C74426C631bDD52', symbol: '0X', decimals: 18, image: '0x.svg', - unlisted: false, + unlisted: false }, '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984': { address: '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984', symbol: 'AST', decimals: 18, image: 'ast.png', - unlisted: false, + unlisted: false }, '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2': { address: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2', symbol: 'BAT', decimals: 18, image: 'BAT_icon.svg', - unlisted: false, + unlisted: false }, '0xe83cccfabd4ed148903bf36d4283ee7c8b3494d1': { address: '0xe83cccfabd4ed148903bf36d4283ee7c8b3494d1', symbol: 'CVL', decimals: 18, image: 'CVL_token.svg', - unlisted: false, + unlisted: false }, '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e': { address: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e', symbol: 'GLA', decimals: 18, image: 'gladius.svg', - unlisted: false, + unlisted: false }, '0x467Bccd9d29f223BcE8043b84E8C8B282827790F': { address: '0x467Bccd9d29f223BcE8043b84E8C8B282827790F', symbol: 'GNO', decimals: 18, image: 'gnosis.svg', - unlisted: false, + unlisted: false }, '0xff20817765cb7f73d4bde2e66e067e58d11095c2': { address: '0xff20817765cb7f73d4bde2e66e067e58d11095c2', symbol: 'OMG', decimals: 18, image: 'omg.jpg', - unlisted: false, + unlisted: false }, '0x8e870d67f660d95d5be530380d0ec0bd388289e1': { address: '0x8e870d67f660d95d5be530380d0ec0bd388289e1', symbol: 'WED', decimals: 18, image: 'wed.png', - unlisted: false, + unlisted: false }, }, networkDetails: { @@ -277,84 +281,83 @@ const state = { swapsFeatureIsLive: false, swapsQuoteRefreshTime: 60000, }, - snapStates: {}, - snaps: { - 'local:http://localhost:8080/': { - enabled: true, - id: 'local:http://localhost:8080/', - initialPermissions: { - snap_confirm: {}, + "snapStates": {}, + "snaps": { + "local:http://localhost:8080/": { + "enabled": true, + "id": "local:http://localhost:8080/", + "initialPermissions": { + "snap_confirm": {} }, - manifest: { - description: 'An example MetaMask Snap.', - initialPermissions: { - snap_confirm: {}, + "manifest": { + "description": "An example MetaMask Snap.", + "initialPermissions": { + "snap_confirm": {} }, - manifestVersion: '0.1', - proposedName: 'MetaMask Example Snap', - repository: { - type: 'git', - url: 'https://github.com/MetaMask/snaps-skunkworks.git', + "manifestVersion": "0.1", + "proposedName": "MetaMask Example Snap", + "repository": { + "type": "git", + "url": "https://github.com/MetaMask/snaps-skunkworks.git" }, - source: { - location: { - npm: { - filePath: 'dist/bundle.js', - iconPath: 'images/icon.svg', - packageName: '@metamask/example-snap', - registry: 'https://registry.npmjs.org/', - }, + "source": { + "location": { + "npm": { + "filePath": "dist/bundle.js", + "iconPath": "images/icon.svg", + "packageName": "@metamask/example-snap", + "registry": "https://registry.npmjs.org/" + } }, - shasum: '3lEt0yUu080DwV78neROaAAIQWXukSkMnP4OBhOhBnE=', + "shasum": "3lEt0yUu080DwV78neROaAAIQWXukSkMnP4OBhOhBnE=" }, - version: '0.6.0', + "version": "0.6.0" }, - permissionName: 'wallet_snap_local:http://localhost:8080/', - sourceCode: '(...)', - status: 'stopped', - svgIcon: '...', - version: '0.6.0', - }, - 'Filecoin Snap': { - enabled: true, - id: 'npm:http://localhost:8080/', - initialPermissions: { - snap_confirm: {}, - eth_accounts: {}, - snap_manageState: {}, + "permissionName": "wallet_snap_local:http://localhost:8080/", + "sourceCode": "(...)", + "status": "stopped", + "svgIcon": "...", + "version": "0.6.0" + }, + "Filecoin Snap": { + "enabled": true, + "id": "npm:http://localhost:8080/", + "initialPermissions": { + "snap_confirm": {}, + "eth_accounts": {}, + "snap_manageState": {}, }, - manifest: { - description: - 'This swap provides developers everywhere access to an entirely new data storage paradigm, even letting your programs store data autonomously. Learn more.', - initialPermissions: { - snap_confirm: {}, - eth_accounts: {}, - snap_manageState: {}, + "manifest": { + "description": "This swap provides developers everywhere access to an entirely new data storage paradigm, even letting your programs store data autonomously. Learn more.", + "initialPermissions": { + "snap_confirm": {}, + "eth_accounts": {}, + "snap_manageState": {}, }, - manifestVersion: '0.1', - proposedName: 'Filecoin Snap', - repository: { - type: 'git', - url: 'https://github.com/MetaMask/snaps-skunkworks.git', + "manifestVersion": "0.1", + "proposedName": "Filecoin Snap", + "repository": { + "type": "git", + "url": "https://github.com/MetaMask/snaps-skunkworks.git" }, - source: { - location: { - npm: { - filePath: 'dist/bundle.js', - iconPath: 'images/icon.svg', - packageName: '@metamask/example-snap', - registry: 'https://registry.npmjs.org/', - }, + "source": { + "location": { + "npm": { + "filePath": "dist/bundle.js", + "iconPath": "images/icon.svg", + "packageName": "@metamask/example-snap", + "registry": "https://registry.npmjs.org/" + } }, - shasum: '3lEt0yUu080DwV78neROaAAIQWXukSkMnP4OBhOhBnE=', + "shasum": "3lEt0yUu080DwV78neROaAAIQWXukSkMnP4OBhOhBnE=" }, - version: '0.6.0', + "version": "0.6.0" }, - permissionName: 'wallet_snap_npm:http://localhost:8080/', - sourceCode: '(...)', - status: 'stopped', - svgIcon: '...', - version: '0.6.0', + "permissionName": "wallet_snap_npm:http://localhost:8080/", + "sourceCode": "(...)", + "status": "stopped", + "svgIcon": "...", + "version": "0.6.0" }, }, accountArray: [ @@ -483,46 +486,32 @@ const state = { ], detectedTokens: [ { - address: '0x514910771AF9Ca656af840dff83E8264EcF986CA', + address: "0x514910771AF9Ca656af840dff83E8264EcF986CA", decimals: 18, - symbol: 'LINK', - image: 'https://crypto.com/price/coin-data/icon/LINK/color_icon.png', - aggregators: ['coinGecko', 'oneInch', 'paraswap', 'zapper', 'zerion'], + symbol: "LINK", + image: "https://crypto.com/price/coin-data/icon/LINK/color_icon.png", + aggregators:[ + "coinGecko","oneInch","paraswap","zapper","zerion" + ] }, { - address: '0xc00e94Cb662C3520282E6f5717214004A7f26888', + address: "0xc00e94Cb662C3520282E6f5717214004A7f26888", decimals: 18, - symbol: 'COMP', - image: 'https://crypto.com/price/coin-data/icon/COMP/color_icon.png', - aggregators: [ - 'bancor', - 'cmc', - 'cryptocom', - 'coinGecko', - 'oneInch', - 'paraswap', - 'pmm', - 'zapper', - 'zerion', - 'zeroEx', - ], + symbol: "COMP", + image: "https://crypto.com/price/coin-data/icon/COMP/color_icon.png", + aggregators:[ + "bancor","cmc","cryptocom","coinGecko","oneInch","paraswap","pmm","zapper","zerion","zeroEx" + ] }, { - address: '0xfffffffFf15AbF397dA76f1dcc1A1604F45126DB', + address: "0xfffffffFf15AbF397dA76f1dcc1A1604F45126DB", decimals: 18, - symbol: 'FSW', - image: - 'https://assets.coingecko.com/coins/images/12256/thumb/falconswap.png?1598534184', - aggregators: [ - 'aave', - 'cmc', - 'coinGecko', - 'oneInch', - 'paraswap', - 'zapper', - 'zerion', - ], - }, + symbol: "FSW", + image: "https://assets.coingecko.com/coins/images/12256/thumb/falconswap.png?1598534184", + aggregators:[ + "aave", "cmc","coinGecko","oneInch","paraswap","zapper","zerion" + ] + } ], pendingTokens: {}, customNonceValue: '', @@ -570,18 +559,18 @@ const state = { swapsWelcomeMessageHasBeenShown: true, defaultHomeActiveTabName: 'Assets', provider: { - type: 'rinkeby', + type: 'ropsten', ticker: 'ETH', nickname: '', rpcUrl: '', - chainId: '0x4', + chainId: '0x3', }, previousProviderStore: { - type: 'rinkeby', + type: 'ropsten', ticker: 'ETH', nickname: '', rpcUrl: '', - chainId: '0x4', + chainId: '0x3', }, network: '3', accounts: { @@ -1315,7 +1304,7 @@ const state = { subjects: { 'https://app.uniswap.org': { permissions: { - eth_accounts: { + 'eth_accounts': { invoker: 'https://app.uniswap.org', parentCapability: 'eth_accounts', id: 'a7342e4b-beae-4525-a36c-c0635fd03359', @@ -1329,14 +1318,14 @@ const state = { }, }, }, - 'local:http://localhost:8080/': { + "local:http://localhost:8080/": { permissions: { - snap_confirm: { - invoker: 'local:http://localhost:8080/', + 'snap_confirm': { + invoker: "local:http://localhost:8080/", parentCapability: 'snap_confirm', id: 'a7342F4b-beae-4525-a36c-c0635fd03359', date: 1620710693178, - caveats: [], + caveats: [] }, }, }, @@ -1434,30 +1423,30 @@ const state = { pendingApprovals: {}, pendingApprovalCount: 0, subjectMetadata: { - 'http://localhost:8080': { + "http://localhost:8080": { extensionId: null, iconUrl: null, - name: 'Hello, Snaps!', - origin: 'http://localhost:8080', - subjectType: 'website', + name: "Hello, Snaps!", + origin: "http://localhost:8080", + subjectType: "website" }, - 'https://metamask.github.io': { + "https://metamask.github.io": { extensionId: null, iconUrl: null, - name: 'Snaps Iframe Execution Environment', - origin: 'https://metamask.github.io', - subjectType: 'website', + name: "Snaps Iframe Execution Environment", + origin: "https://metamask.github.io", + subjectType: "website" }, - 'local:http://localhost:8080/': { + "local:http://localhost:8080/": { extensionId: null, iconUrl: null, - name: 'MetaMask Example Snap', - origin: 'local:http://localhost:8080/', - subjectType: 'snap', - svgIcon: '...', - version: '0.6.0', - }, - }, + name: "MetaMask Example Snap", + origin: "local:http://localhost:8080/", + subjectType: "snap", + svgIcon: "...", + version: "0.6.0" + } + } }, appState: { shouldClose: false, @@ -1466,14 +1455,7 @@ const state = { open: false, modalState: { name: null, - props: { - token: { - address: '0xaD6D458402F60fD3Bd25163575031ACDce07538D', - symbol: 'DAI', - decimals: 18, - }, - history: {}, - }, + props: {}, }, previousModalState: { name: null, @@ -1525,12 +1507,6 @@ const state = { amount: { error: 'amount', }, - currentTransactionUUID: 'test-uuid', - draftTransactions: { - 'test-uuid': { - ...draftTransactionInitialState, - }, - }, }, confirmTransaction: { txData: { diff --git a/CHANGELOG.md b/CHANGELOG.md index 06e058fbfbe4..d271b47a3b86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,182 +6,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [10.18.0] -### Added -- Add setApprovalForAll confirmation view so granted permissions are displayed in a digested manner, instead of a simple contract interaction([#15010](https://github.com/MetaMask/metamask-extension/pull/15010)) -- Add warning when performing a Send directly to a token contract([#13588](https://github.com/MetaMask/metamask-extension/pull/13588)) - -### Changed -- Update Optimism ChainID from Kovan to Goerli ([#15119](https://github.com/MetaMask/metamask-extension/pull/15119)) - -### Fixed -- Fix one of the possible causes for "Sending to a random cached address", by removing the global transaction state from the Send flow ([#14777](https://github.com/MetaMask/metamask-extension/pull/14777)) -- Fix Chinese translation for the message of Importing repeated tokens ([#14994](https://github.com/MetaMask/metamask-extension/pull/14994)) -- Fix Japanese translation for the word Sign ([#15078](https://github.com/MetaMask/metamask-extension/pull/15078)) -- Fix partially the error "Seedphrase is invalid" by disabling Seedphrase Import button after switching the Seedphrase length ([#15139](https://github.com/MetaMask/metamask-extension/pull/15139)) -- Fix Edit Transaction flow by ensuring that changing a tx from a Transfer to a Send resets data and updates tx type ([#15248](https://github.com/MetaMask/metamask-extension/pull/15248)) -- Fix UI on Import Seedphrase page by disabling Import button, if any of the characters of the Seedphrase is in uppercase ([#15186](https://github.com/MetaMask/metamask-extension/pull/15186)) - -## [10.17.0] -### Added -- Add cost estimation for canceling a Smart Transaction on Awaiting Swap page ([#15011](https://github.com/MetaMask/metamask-extension/pull/15011)) -- Add missing subtitles for Secret Recovery Phrase video, including French, Greek, Turkish, Chinese - ([#14943](https://github.com/MetaMask/metamask-extension/pull/14943)) - -### Changed -- Consolidate all Error Messages in one style component ([#14945](https://github.com/MetaMask/metamask-extension/pull/14945)) -- Improve accessibility by allowing keyboard navigation on Accounts menu ([#14936](https://github.com/MetaMask/metamask-extension/pull/14936)) -- Allow using locally hosted RPCs and Block Explorer Urls when adding an Ethereum Chain programmatically ([#14272](https://github.com/MetaMask/metamask-extension/pull/14272)) -- **[FLASK] BREAKING:** Snaps [are now required](https://github.com/MetaMask/snaps-skunkworks/discussions/590) to export `onRpcRequest` to receive RPC requests ([#14952](https://github.com/MetaMask/metamask-extension/pull/14952)) - - All existing snaps will have to be updated to conform to this new standard. -- **[FLASK] BREAKING:** Snap state [is now encrypted](https://github.com/MetaMask/snaps-skunkworks/discussions/590) by default ([#14952](https://github.com/MetaMask/metamask-extension/pull/14952)) - - Breaks existing installed snaps that use `snap_manageState`. All such Snaps must be reinstalled. - -### Fixed -- Fix German translation for `statusConnected` ([#14997](https://github.com/MetaMask/metamask-extension/pull/14997)) -- Fix Account Search functionality returning inconsistent results ([#14914](https://github.com/MetaMask/metamask-extension/pull/14914)) -- Fix Notifications icon color on the Account menu ([#14941](https://github.com/MetaMask/metamask-extension/pull/14941)) -- Fix broken UI for Network Settings page on small browser sizes ([#14857](https://github.com/MetaMask/metamask-extension/pull/14857)) -- Fix scanner for animated QR codes on dark mode, by removing bottom black line from the QR ([#14900](https://github.com/MetaMask/metamask-extension/pull/14900)) -- Fix displaying wrong balance on the first seconds after switching network ([#14354](https://github.com/MetaMask/metamask-extension/pull/14354)) -- Fix Contact name display on Edit tx page ([#14613](https://github.com/MetaMask/metamask-extension/pull/14613)) -- Fix infinite loading when transferring non-standard ERC721 (without name and/or symbol) ([#14756](https://github.com/MetaMask/metamask-extension/pull/14756)) -- **[FLASK]:** Fix multiple bugs related to snap installation ([#14952](https://github.com/MetaMask/metamask-extension/pull/14952)) - -## [10.16.2] -### Changed -- This release restores the changes from v10.16.0, which was temporarily reverted in v10.16.1. - -## [10.16.1] -### Changed -- This release is a patch for v10.15.2, so all changes in v10.16.0 have been temporarily reverted. They will be restored in a future v16 release. ([#15063](https://github.com/MetaMask/metamask-extension/pull/15063)) - -### Fixed -- Fix bug that could cause an incorrect recipient address after pasting an address, without a 0x prefix, in the send flow while sending a token ([#15064](https://github.com/MetaMask/metamask-extension/pull/15064) - -## [10.16.0] -### Added -- Add friendly error handling screen, when UI fails to connect to background ([#14461](https://github.com/MetaMask/metamask-extension/pull/14461)) -- Add fiat onboarding for AVAX and MATIC through Wyre ([#14683](https://github.com/MetaMask/metamask-extension/pull/14683)) -- Add Coinbase Pay as fiat onramp option ([#14648](https://github.com/MetaMask/metamask-extension/pull/14648)) -- Add search information for Theme dropdown ([#14476](https://github.com/MetaMask/metamask-extension/pull/14476)) -- **[FLASK]** Add in-app notifications for snaps ([#14605](https://github.com/MetaMask/metamask-extension/pull/14605)) -- **[FLASK]** Add `long-running` snap permission ([#14700](https://github.com/MetaMask/metamask-extension/pull/14700)) - -### Changed -- Update caret icon color on Home Page for darkmode, from black to white ([#14835](https://github.com/MetaMask/metamask-extension/pull/14835)) -- Update the color of the ledger alert text to adhere to design system guidelines ([#14674](https://github.com/MetaMask/metamask-extension/pull/14674)) -- Standardize display of connected site's origin data on all confirmation screens ([#14720](https://github.com/MetaMask/metamask-extension/pull/14720)) -- Improved app loading performance - - Improve loading performance by patching the "secp256k1" package ([#14677](https://github.com/MetaMask/metamask-extension/pull/14677)) - - Patch gridplus-sdk module for improving performance ([#14582](https://github.com/MetaMask/metamask-extension/pull/14582)) -- Swaps: ensure that native currency swap amounts are properly displayed on all networks, avoiding a bug where swap received amounts could equal gas costs ([#14821](https://github.com/MetaMask/metamask-extension/pull/14821)) -- Swaps: reduce the default slippage from 3% to 2% ([#14863](https://github.com/MetaMask/metamask-extension/pull/14863)) -- Swaps: update STX status content page ([#14805](https://github.com/MetaMask/metamask-extension/pull/14805)) - - Make STX status timer behaviour dependent on API values - - Change "Swap complete in < X:XX" to "Swap will complete in < X:XX" - - Change "Privately submitting the Swap..." to "Privately submitting your Swap..." -- Swaps: disable STX if a regular tx is in progress ([#14554](https://github.com/MetaMask/metamask-extension/pull/14554)) -- Swaps: remove gas editing ([#14673](https://github.com/MetaMask/metamask-extension/pull/14673)) -- **[FLASK]** Improve snap install screen ([#14803](https://github.com/MetaMask/metamask-extension/pull/14803), ([#14752](https://github.com/MetaMask/metamask-extension/pull/14752))) -- **[FLASK] BREAKING** Bump `@metamask/key-tree` used by snaps to `4.0.0` ([#14700](https://github.com/MetaMask/metamask-extension/pull/14700)) -- **[FLASK]** Stopped showing confirmations for terminated snaps ([#14566](https://github.com/MetaMask/metamask-extension/pull/14566)) - -### Fixed -- Fix line-wrapping in Edit Nickname screen by decreasing the padding ([#14842](https://github.com/MetaMask/metamask-extension/pull/14842)) -- Fix 'Currency Symbol' detection in network settings when using Firefox ([#14810](https://github.com/MetaMask/metamask-extension/pull/14810)) -- Fix switching between ETH and USD in the amount field on the send screen ([#13827](https://github.com/MetaMask/metamask-extension/pull/13827)) -- Fix addition of 'add recipient' events to the send flow change logs so that 'contact' and 'recent' recipient are correctly distinguished ([#14771](https://github.com/MetaMask/metamask-extension/pull/14771)) -- Fix lock button sizing for text exceeding button boundaries ([#14335](https://github.com/MetaMask/metamask-extension/pull/14335)) -- Fix all "MetaMask" instances wrongly written as "Metamask" - - ([#14851](https://github.com/MetaMask/metamask-extension/pull/14851)) - - ([#14848](https://github.com/MetaMask/metamask-extension/pull/14848)) -- Fix design break on the Settings navbar for certain locales ([#14012](https://github.com/MetaMask/metamask-extension/pull/14012)) -- Fix missing white spacing for keystone transaction qrcode in darkmode ([#14798](https://github.com/MetaMask/metamask-extension/pull/14798)) -- Fix rare bug that could cause unexpected accounts to be generated from Ledger and connected to MetaMask ([#14799](https://github.com/MetaMask/metamask-extension/pull/14799)) -- Fix bug that could cause the incorrect token to be selected after editing the token via the send edit flow ([#14721](https://github.com/MetaMask/metamask-extension/pull/14721)) -- Fix chain ID field to use the same color pattern as the currency symbol field warning message ([#14627](https://github.com/MetaMask/metamask-extension/pull/14627)) -- Fix currency conversion rate on the Edit tx screen ([#14713](https://github.com/MetaMask/metamask-extension/pull/14713)) -- Fix sign button so it is enabled after scrolling all the way to the bottom on the sign type data confirmation screen ([#14745](https://github.com/MetaMask/metamask-extension/pull/14745)) -- Fix wrong tx type text for `Safe Transaction From` ([#14769](https://github.com/MetaMask/metamask-extension/pull/14769)) -- Fix "Site Suggested" tooltip in `EditGasFeeBtn` to only display the origin of dapp suggested gas fee if the origin is provided ([#14734](https://github.com/MetaMask/metamask-extension/pull/14734)) -- Fix incorrect line breaks on footer buttons from NetworksTab ([#14733](https://github.com/MetaMask/metamask-extension/pull/14733)) -- Fix incorrect currency symbol in the send flow history state logs ([#14726](https://github.com/MetaMask/metamask-extension/pull/14726)) -- Fix batch cancel/reject for signature requests ([#13786](https://github.com/MetaMask/metamask-extension/pull/13786)) -- Fix "Learn more" dialog broken link from Eth Sign ([#14667](https://github.com/MetaMask/metamask-extension/pull/14667)) -- Fix mixed text for Speed up/Cancel information ([#14551](https://github.com/MetaMask/metamask-extension/pull/14551)) -- Fix SRP paste duplication ([#14625](https://github.com/MetaMask/metamask-extension/pull/14625)) -- Fix onboarding functionality so that users of dapps using our onboarding library are redirected to the dapp after completing onboarding ([#14550](https://github.com/MetaMask/metamask-extension/pull/14550)) -- Fix error handling for signature methods so that proper errors are returned to dapps when there is a permissions error ([#14126](https://github.com/MetaMask/metamask-extension/pull/14126)) -- Fix `Speed Up` and `Cancel` button styles from `TransactionListItem` consolidating them with `TransactionListItemDetails` buttons ([#14659](https://github.com/MetaMask/metamask-extension/pull/14659)) -- Fix to prevent display of misleading or malicious contract method names ([#14937](https://github.com/MetaMask/metamask-extension/pull/14937)) -- Swaps: fix wrong colour for the high price impact notification ([#14697](https://github.com/MetaMask/metamask-extension/pull/14697)) -- Swaps: fix edge case when missing top assets ([#14688](https://github.com/MetaMask/metamask-extension/pull/14688)) -- **[FLASK]** Fix issues with the snap startup process and usage of `WebAssembly` ([#14772](https://github.com/MetaMask/metamask-extension/pull/14772)) -- **[FLASK]** Fix issues with snap id encoding ([#14693](https://github.com/MetaMask/metamask-extension/pull/14693)) -- **[FLASK]** Fix multiple smaller bugs with snaps ([#14670](https://github.com/MetaMask/metamask-extension/pull/14670)) - -## [10.15.1] -### Fixed -- Fix Ledger connection failures that can occur after remove all hardware wallet accounts and reconnecting ([#14993](https://github.com/MetaMask/metamask-extension/pull/14993)) -- Fix bug that could cause MetaMask to crash in some cases when interacting with tokens or NFTs ([#14962](https://github.com/MetaMask/metamask-extension/pull/14962)) - -## [10.15.0] -### Added -- Add warning when multiple instances of MetaMask are running ([#13836](https://github.com/MetaMask/metamask-extension/pull/13836)) -- Add "What's New" announcement text for Dark Mode ([#14346](https://github.com/MetaMask/metamask-extension/pull/14346)) -- Theme: Add OS option in theme selection dropdown ([#14379](https://github.com/MetaMask/metamask-extension/pull/14379)) - -### Changed -- Use testname as the base currency prefix for preloaded test networks ([#14454](https://github.com/MetaMask/metamask-extension/pull/14454)) -- Update UI of "Add Network" page ([#13866](https://github.com/MetaMask/metamask-extension/pull/13866)) -- Update UI of network switch permissions prompt ([#13450](https://github.com/MetaMask/metamask-extension/pull/13450)) -- Show token approval details on approval screens by default ([#14523](https://github.com/MetaMask/metamask-extension/pull/14523)) -- Ensure theme selection dropdown is discoverable via settings search([#14379](https://github.com/MetaMask/metamask-extension/pull/14379)) -- Stop using the 4bytes registry to name contract deployment transactions in the activity list, preventing false method names from being shown for deployments ([#14598](https://github.com/MetaMask/metamask-extension/pull/14598)) -- Save send flow user action history in transaction state logs ([#14510](https://github.com/MetaMask/metamask-extension/pull/14510)) -- Update GridPlus to use https://github.com/GridPlus/gridplus-sdk/compare/v1.1.6...v1.2.4 ([#14467](https://github.com/MetaMask/metamask-extension/pull/14467)) - - -### Fixed -- Fix `wallet_watchAsset method` ([#14545](https://github.com/MetaMask/metamask-extension/pull/14545)) -- Do not show failed off-chain transactions details when grouped with another valid transaction of same nonce ([#14497](https://github.com/MetaMask/metamask-extension/pull/14497)) -- Fix bug that could have caused some ledger transactions to fail after connecting Ledger then locking and unlocking ([#14563](https://github.com/MetaMask/metamask-extension/pull/14563)) -- Fix bug that could cause MetaMask to crash in some cases when attempting to send a transaction ([#14608](https://github.com/MetaMask/metamask-extension/pull/14608)) - -## [10.14.7] -### Changed -- Make JavaScript bundles more reproducible between environments. - - The bundles no longer include absolute paths to each module included. - -## [10.14.6] -### Changed -- Move phishing warning page to external site. - - The page shown when a site is blocked has been extracted from the extension and moved to an external site. This site is eagerly cached with a service worker upon extension startup, so it should continue to work even while offline. -- Make build .zip files reproducible (#14623) - - The ordering of files within each .zip file was non-deterministic before this change. We fixed this to comply with Firefox store policies. - -## [10.14.5] -### Fixed -- This release was deployed to fix a configuration issue. - -## [10.14.4] -### Fixed -- This release was deployed to fix a configuration issue. - -## [10.14.3] -### Fixed -- This release was deployed to fix a configuration issue. - -## [10.14.2] -### Fixed -- Make build deterministic (#14610) - - The ordering of modules within each bundle was non-deterministic before this change. We fixed this to comply with Firefox store policies. - -## [10.14.1] -### Changed -- This version was used to rollback from v10.14.0 to v10.13.0. - ## [10.14.0] ### Added - **[FLASK]** Add snap version to details page ([#14110](https://github.com/MetaMask/metamask-extension/pull/14110)) @@ -3084,21 +2908,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Uncategorized - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.18.0...HEAD -[10.18.0]: https://github.com/MetaMask/metamask-extension/compare/v10.17.0...v10.18.0 -[10.17.0]: https://github.com/MetaMask/metamask-extension/compare/v10.16.2...v10.17.0 -[10.16.2]: https://github.com/MetaMask/metamask-extension/compare/v10.16.1...v10.16.2 -[10.16.1]: https://github.com/MetaMask/metamask-extension/compare/v10.16.0...v10.16.1 -[10.16.0]: https://github.com/MetaMask/metamask-extension/compare/v10.15.1...v10.16.0 -[10.15.1]: https://github.com/MetaMask/metamask-extension/compare/v10.15.0...v10.15.1 -[10.15.0]: https://github.com/MetaMask/metamask-extension/compare/v10.14.7...v10.15.0 -[10.14.7]: https://github.com/MetaMask/metamask-extension/compare/v10.14.6...v10.14.7 -[10.14.6]: https://github.com/MetaMask/metamask-extension/compare/v10.14.5...v10.14.6 -[10.14.5]: https://github.com/MetaMask/metamask-extension/compare/v10.14.4...v10.14.5 -[10.14.4]: https://github.com/MetaMask/metamask-extension/compare/v10.14.3...v10.14.4 -[10.14.3]: https://github.com/MetaMask/metamask-extension/compare/v10.14.2...v10.14.3 -[10.14.2]: https://github.com/MetaMask/metamask-extension/compare/v10.14.1...v10.14.2 -[10.14.1]: https://github.com/MetaMask/metamask-extension/compare/v10.14.0...v10.14.1 +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.14.0...HEAD [10.14.0]: https://github.com/MetaMask/metamask-extension/compare/v10.13.0...v10.14.0 [10.13.0]: https://github.com/MetaMask/metamask-extension/compare/v10.12.4...v10.13.0 [10.12.4]: https://github.com/MetaMask/metamask-extension/compare/v10.12.3...v10.12.4 diff --git a/README.md b/README.md index 1174ddced850..1a4e7ca7011d 100644 --- a/README.md +++ b/README.md @@ -14,17 +14,14 @@ To learn how to contribute to the MetaMask project itself, visit our [Internal D ## Building locally -- Install [Node.js](https://nodejs.org) version 16 +- Install [Node.js](https://nodejs.org) version 14 - If you are using [nvm](https://github.com/creationix/nvm#installation) (recommended) running `nvm use` will automatically choose the right node version for you. - Install [Yarn](https://yarnpkg.com/en/docs/install) - Install dependencies: `yarn setup` (not the usual install command) - Copy the `.metamaskrc.dist` file to `.metamaskrc` - 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/), see [Developing on MetaMask - Segment](./development/README.md#segment). - - If debugging unhandled exceptions, you'll need to add a value for `SENTRY_DSN` [Sentry Dsn](https://docs.sentry.io/product/sentry-basics/dsn-explainer/), see [Developing on MetaMask - Sentry](./development/README.md#sentry). - - Optionally, replace the `PASSWORD` value with your development wallet password to avoid entering it each time you open the app. + - If debugging MetaMetrics, you'll need to add a value for `SEGMENT_WRITE_KEY` [Segment write key](https://segment.com/docs/connections/find-writekey/), see [Developing on MetaMask](./development/README.md). - Build the project to the `./dist/` folder with `yarn dist`. - - Optionally, you may run `yarn start` to run dev mode. Uncompressed builds can be found in `/dist`, compressed builds can be found in `/builds` once they're built. @@ -118,4 +115,3 @@ Whenever you change dependencies (adding, removing, or updating, either in `pack - [How to generate a visualization of this repository's development](./development/gource-viz.sh) [1]: http://www.nomnoml.com/#view/%5B%3Cactor%3Euser%5D%0A%0A%5Bmetamask-ui%7C%0A%20%20%20%5Btools%7C%0A%20%20%20%20%20react%0A%20%20%20%20%20redux%0A%20%20%20%20%20thunk%0A%20%20%20%20%20ethUtils%0A%20%20%20%20%20jazzicon%0A%20%20%20%5D%0A%20%20%20%5Bcomponents%7C%0A%20%20%20%20%20app%0A%20%20%20%20%20account-detail%0A%20%20%20%20%20accounts%0A%20%20%20%20%20locked-screen%0A%20%20%20%20%20restore-vault%0A%20%20%20%20%20identicon%0A%20%20%20%20%20config%0A%20%20%20%20%20info%0A%20%20%20%5D%0A%20%20%20%5Breducers%7C%0A%20%20%20%20%20app%0A%20%20%20%20%20metamask%0A%20%20%20%20%20identities%0A%20%20%20%5D%0A%20%20%20%5Bactions%7C%0A%20%20%20%20%20%5BbackgroundConnection%5D%0A%20%20%20%5D%0A%20%20%20%5Bcomponents%5D%3A-%3E%5Bactions%5D%0A%20%20%20%5Bactions%5D%3A-%3E%5Breducers%5D%0A%20%20%20%5Breducers%5D%3A-%3E%5Bcomponents%5D%0A%5D%0A%0A%5Bweb%20dapp%7C%0A%20%20%5Bui%20code%5D%0A%20%20%5Bweb3%5D%0A%20%20%5Bmetamask-inpage%5D%0A%20%20%0A%20%20%5B%3Cactor%3Eui%20developer%5D%0A%20%20%5Bui%20developer%5D-%3E%5Bui%20code%5D%0A%20%20%5Bui%20code%5D%3C-%3E%5Bweb3%5D%0A%20%20%5Bweb3%5D%3C-%3E%5Bmetamask-inpage%5D%0A%5D%0A%0A%5Bmetamask-background%7C%0A%20%20%5Bprovider-engine%5D%0A%20%20%5Bhooked%20wallet%20subprovider%5D%0A%20%20%5Bid%20store%5D%0A%20%20%0A%20%20%5Bprovider-engine%5D%3C-%3E%5Bhooked%20wallet%20subprovider%5D%0A%20%20%5Bhooked%20wallet%20subprovider%5D%3C-%3E%5Bid%20store%5D%0A%20%20%5Bconfig%20manager%7C%0A%20%20%20%20%5Brpc%20configuration%5D%0A%20%20%20%20%5Bencrypted%20keys%5D%0A%20%20%20%20%5Bwallet%20nicknames%5D%0A%20%20%5D%0A%20%20%0A%20%20%5Bprovider-engine%5D%3C-%5Bconfig%20manager%5D%0A%20%20%5Bid%20store%5D%3C-%3E%5Bconfig%20manager%5D%0A%5D%0A%0A%5Buser%5D%3C-%3E%5Bmetamask-ui%5D%0A%0A%5Buser%5D%3C%3A--%3A%3E%5Bweb%20dapp%5D%0A%0A%5Bmetamask-contentscript%7C%0A%20%20%5Bplugin%20restart%20detector%5D%0A%20%20%5Brpc%20passthrough%5D%0A%5D%0A%0A%5Brpc%20%7C%0A%20%20%5Bethereum%20blockchain%20%7C%0A%20%20%20%20%5Bcontracts%5D%0A%20%20%20%20%5Baccounts%5D%0A%20%20%5D%0A%5D%0A%0A%5Bweb%20dapp%5D%3C%3A--%3A%3E%5Bmetamask-contentscript%5D%0A%5Bmetamask-contentscript%5D%3C-%3E%5Bmetamask-background%5D%0A%5Bmetamask-background%5D%3C-%3E%5Bmetamask-ui%5D%0A%5Bmetamask-background%5D%3C-%3E%5Brpc%5D%0A - diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index 6a3d69bc2d0f..bfbbac952138 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -131,10 +131,10 @@ "message": "ማሰሺያዎት አልተደገፈም..." }, "buyWithWyre": { - "message": "$1 በ Wyre ይግዙ" + "message": "ETH በ Wyre ይግዙ" }, "buyWithWyreDescription": { - "message": "Wyre ክሬዲት ካርድ ተጠቅመው $1 በቀጥታ በ MetaMask መለያዎ ላይ እንዲያስቀምጡ ያስችልዎታል።" + "message": "Wyre ክሬዲት ካርድ ተጠቅመው ETH በቀጥታ በ MetaMask መለያዎ ላይ እንዲያስቀምጡ ያስችልዎታል።" }, "bytes": { "message": "ባይት" diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index 6d99fc54b78a..e87624ee26cb 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -148,7 +148,7 @@ "message": "قم بشراء عملة إيثير بواسطة Wyre" }, "buyWithWyreDescription": { - "message": "يتيح لك Wyre استخدام بطاقة ائتمان لإيداع 1$ مباشرة في حساب MetaMask الخاص بك." + "message": "يتيح لك Wyre استخدام بطاقة ائتمان لإيداع ETH مباشرة في حساب MetaMask الخاص بك." }, "bytes": { "message": "بايتات" diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index 49b76836583e..9d4534adbe72 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -137,10 +137,10 @@ "message": "Браузърът ви не се поддържа ..." }, "buyWithWyre": { - "message": "Купете $1 с Wyre" + "message": "Купете ETH с Wyre" }, "buyWithWyreDescription": { - "message": "Wyre ви позволява да използвате кредитна карта, за да депозирате $1 право във вашата MetaMask сметка." + "message": "Wyre ви позволява да използвате кредитна карта, за да депозирате ETH право във вашата MetaMask сметка." }, "bytes": { "message": "Байта" diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index 88fedac63b1f..7dd74c5ebeab 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -137,10 +137,10 @@ "message": "আপনার ব্রাউজার সমর্থিত নয়..." }, "buyWithWyre": { - "message": "Wyre দিয়ে $1 ক্রয় করুন" + "message": "Wyre দিয়ে ETH ক্রয় করুন" }, "buyWithWyreDescription": { - "message": "Wyre আপনার MetaMask অ্যাকাউন্টে সরাসরি $1 জমা করতে আপনাকে একটি ক্রেডিট কার্ড ব্যবহার করতে দেয়।" + "message": "Wyre আপনার MetaMask অ্যাকাউন্টে সরাসরি ETH জমা করতে আপনাকে একটি ক্রেডিট কার্ড ব্যবহার করতে দেয়।" }, "bytes": { "message": "বাইটস" diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index 3bdaf93ba630..34abb31dc6ae 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -137,10 +137,10 @@ "message": "El teu navegador no és suportat..." }, "buyWithWyre": { - "message": "Compra $1 amb Wyre" + "message": "Compra ETH amb Wyre" }, "buyWithWyreDescription": { - "message": "Wyre et permet utilitzar una targeta de crèdit per dipositar $1 directe al teu compte MetaMask." + "message": "Wyre et permet utilitzar una targeta de crèdit per dipositar ETH directe al teu compte MetaMask." }, "cancel": { "message": "Cancel·la" diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index 4b642ef37499..248404f43e82 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -137,10 +137,10 @@ "message": "Din browser er ikke understøttet..." }, "buyWithWyre": { - "message": "Køb $1 med Wyre" + "message": "Køb ETH med Wyre" }, "buyWithWyreDescription": { - "message": "Wyre lader dig bruge et kreditkort til at indbetale $1 på din MetaMask-konto." + "message": "Wyre lader dig bruge et kreditkort til at indbetale ETH på din MetaMask-konto." }, "bytes": { "message": "Byte" diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 7951a4640983..ed85a38cf280 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -62,13 +62,6 @@ "message": "$1 kann auf dieses Asset zugreifen und es ausgeben", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "Greifen Sie mit Ihrer geheimen Wiederherstellungsphrase auf Ihr Wallet zu" - }, - "accessYourWalletWithSRPDescription": { - "message": "MetaMask kann Ihr Passwort nicht wiederherstellen. Wir verwenden Ihre geheime Wiederherstellungsphrase, um Ihr Eigentum zu bestätigen, Ihr Wallet wiederherzustellen und ein neues Passwort festzulegen. Geben Sie zunächst die geheime Wiederherstellungsphrase ein, die Sie erhalten haben, als Sie Ihr Wallet erstellt haben. $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "Zugriff auf Ihre Kamera …" }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "Netzwerk hinzufügen" }, - "addNetworkTooltipWarning": { - "message": "Diese Netzwerkverbindung ist von Dritten abhängig. Diese Verbindung könnte unzuverlässiger sein oder Dritten erlauben, Ihre Aktivitäten zu verfolgen. $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "Vorgeschlagene Token hinzufügen" }, @@ -411,14 +400,6 @@ "message": "$1 kaufen", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "1 $ mit Coinbase Pay kaufen", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Sie können mit Ihrem Coinbase-Konto bequem Kryptowährungen kaufen oder überweisen.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "$1 mit MoonPay kaufen", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "$1 mit Wyre kaufen" + "message": "ETH mit Wyre kaufen" }, "buyWithWyreDescription": { - "message": "Wyre ermöglicht Ihnen die Verwendung einer Kreditkarte zum direkten Einzahlen von $1 auf Ihr MetaMask-Konto." + "message": "Wyre ermöglicht Ihnen die Verwendung einer Kreditkarte zum direkten Einzahlen von ETH auf Ihr MetaMask-Konto." }, "bytes": { "message": "Bytes" @@ -466,6 +447,9 @@ "message": "Für eine Transaktion im Wert von $1 muss die Gasgebühr um mindestens 10 % erhöht werden, damit sie vom Netz erkannt wird.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "Swap abbrechen" + }, "cancellationGasFee": { "message": "Stornierungs-Gasgebühr" }, @@ -622,9 +606,6 @@ "continue": { "message": "Weiter" }, - "continueToCoinbasePay": { - "message": "Weiter zu Coinbase Pay" - }, "continueToMoonPay": { "message": "Weiter zu MoonPay" }, @@ -650,7 +631,7 @@ "message": "Vertragsinteraktion" }, "convertTokenToNFTDescription": { - "message": "Wir haben festgestellt, dass dieses Asset eine NFT ist. MetaMask hat jetzt volle native Unterstützung für NFTs. Möchten Sie es aus Ihrer Tokenliste entfernen und als NFT hinzufügen?" + "message": "Wir haben festgestellt, dass dieses Asset eine NFT ist. Metamask hat jetzt volle native Unterstützung für NFTs. Möchten Sie es aus Ihrer Tokenliste entfernen und als NFT hinzufügen?" }, "convertTokenToNFTExistDescription": { "message": "Wir haben festgestellt, dass dieses Asset als NFT hinzugefügt wurde. Möchten Sie es aus Ihrer Token-Liste entfernen?" @@ -1244,10 +1225,6 @@ "message": "Alle Flask-APIs sind experimentell. Sie können ohne Vorankündigung geändert oder entfernt werden oder sie können auf unbestimmte Zeit in Flask bleiben, ohne jemals in die stabile MetaMask migriert zu werden. Die Verwendung erfolgt auf eigene Gefahr.", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Stellen Sie sicher, dass Sie Ihre normale MetaMask-Erweiterung deaktivieren, wenn Sie Flask verwenden.", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "Ich akzeptiere die Risiken", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "Ausblenden" }, - "hideFullTransactionDetails": { - "message": "Vollständige Transaktionsdetails ausblenden" - }, "hideSeedPhrase": { "message": "Seed-Phrase ausblenden" }, @@ -1471,12 +1445,6 @@ "history": { "message": "Verlauf" }, - "ignoreAll": { - "message": "Alle ignorieren" - }, - "ignoreTokenWarning": { - "message": "Wenn Sie Token ignorieren, werden Sie nicht in Ihrem Wallet angezeigt. Sie können sie jedoch weiterhin hinzufügen, indem Sie nach ihnen suchen." - }, "import": { "message": "Importieren", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "Wallet importieren" }, - "importWithCount": { - "message": "$1 importieren", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "Ihre bestehende Wallet mit einer Geheime Wiederherstellungsphrase importieren" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "Richtungspfeil" }, - "lightTheme": { - "message": "Leicht" - }, "likeToImportTokens": { "message": "Möchtest du diese Token hinzufügen?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "6M+ Benutzern beitreten um MetaMask zu verbessern" }, + "mismatchedChain": { + "message": "Die Netzwerkdetails für diese Ketten-ID stimmen nicht mit unseren Aufzeichnungen überein. Wir empfehlen Ihnen $1, bevor Sie fortfahren.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "die Netzwerkdetails überprüfen", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "Neu bei MetaMask?" }, - "newTokensImportedMessage": { - "message": "Sie haben $1 erfolgreich importiert.", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "Token importiert" - }, "newTotal": { "message": "Neue Summe" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "Nicht genügend Gas" }, - "notifications": { - "message": "Benachrichtigungen" - }, "notifications10ActionText": { "message": "Einstellungen ansehen", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 Wir machen Transaktionen leichter lesbar." }, - "notificationsEmptyText": { - "message": "Hier gibt es nichts zu sehen." - }, - "notificationsHeader": { - "message": "Benachrichtigungen" - }, - "notificationsInfos": { - "message": "$1 von $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "Alle als gelesen markieren" - }, "numberOfNewTokensDetected": { "message": "$1 neue Tokens in diesem Konto gefunden\n", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "Ursprung" }, - "osTheme": { - "message": "System" - }, - "padlock": { - "message": "Schloss" - }, "parameters": { "message": "Parameter" }, @@ -2435,10 +2371,6 @@ "message": "Siehe Adresse, Kontostand, Aktivität und Einleitung von Transaktionen", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "Für unbestimmte Zeit ausführen.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "Verwalten Sie Ihre „$1“-Konten und Vermögenswerte.", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "+ $1 mehr", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "Beliebte benutzerdefinierte Netzwerke" - }, "preferredLedgerConnectionType": { "message": "Bevorzugter Ledger-Verbindungstyp", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "Vergewissern Sie sich, dass Sie die richtige geheime Wiederherstellungsphrase verwenden, bevor Sie fortfahren. Sie können dies nicht mehr rückgängig machen." }, - "restartMetamask": { - "message": "MetaMask neu starten" - }, "restore": { "message": "Wiederherstellen" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "Betrag senden" }, - "sendBugReport": { - "message": "Übermitteln Sie uns einen Fehlerbericht." - }, "sendSpecifiedTokens": { "message": "$1 senden", "description": "Symbol of the specified token" @@ -3075,7 +2998,7 @@ "message": "Status" }, "statusConnected": { - "message": "Verbunden" + "message": "Verbinden" }, "statusNotConnected": { "message": "Nicht verbunden" @@ -3108,9 +3031,6 @@ "message": "Verbinden Sie Ihre Wallet direkt mit Ihrem Computer. Entsperren Sie Ihren Ledger und öffnen Sie die Ethereum-App. Für weitere Informationen zur Verwendung Ihres Hardware-Wallet-Geräts, $1.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "Erhalten Sie diese Meldung immer noch?" - }, "storePhrase": { "message": "Speichern Sie diesen Schlüssel in einem Passwortmanager wie 1Password." }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "Sie können Ihre Token immer noch tauschen, selbst während intelligente Transaktionen nicht verfügbar sind." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "Ihr Swap wird privat eingereicht ..." + "stxPendingFinalizing": { + "message": "Wird finalisiert ..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "Ihr Swap wird öffentlich eingereicht ..." + "stxPendingOptimizingGas": { + "message": "Gas wird optimiert ..." + }, + "stxPendingPrivatelySubmitting": { + "message": "Swap wird privat eingereicht ..." }, "stxSubDescription": { "message": "* Intelligente Transaktionen versuchen mehrmals, Ihre Transaktion privat zu übermitteln. Wenn alle Versuche fehlschlagen, wird die Transaktion öffentlich übertragen, um sicherzustellen, dass Ihr Swap erfolgreich durchgeführt wird." @@ -3179,10 +3102,6 @@ "message": "Ihr $1 ist jetzt verfügbar.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "Swap abgeschlossen in <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "Simulieren Sie Transaktionen vor der Übermittlung, um die Transaktionskosten zu senken und Ausfälle zu vermeiden." }, @@ -3261,6 +3180,10 @@ "message": "Keine Token verfügbar mit $1", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "Swap abgeschlossen in <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "Mit Ihrer Hardware-Wallet bestätigen" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "Slippage muss größer oder gleich Null sein" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "Liquiditätsquelle" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "Tokensymbol" }, - "tokensFoundTitle": { - "message": "$1 neue Token gefunden", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "Ich verstehe" }, @@ -3804,9 +3719,6 @@ "message": "Wir hatten Probleme mit der Verbindung zu Ihrem $1, versuchen Sie, $2 zu überprüfen und versuchen es erneut.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "Beim Starten von MetaMask ist ein Problem aufgetreten. Dies könnte ein vorübergehendes Problem sein. Versuchen Sie daher, die Erweiterung neu zu starten." - }, "troubleTokenBalances": { "message": "Wir haben Schwierigkeiten dein Tokenguthaben zu laden. Du kannst es hier anzeigen lassen", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "Passwort eingeben" }, - "typeYourSRP": { - "message": "Geben Sie Ihre geheime Wiederherstellungsphrase ein" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "Dieses benutzerdefinierte Netzwerk ist nicht erkannt. Wir empfehlen, dass Sie $1 bevor Sie fortfahren", "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": "die Netzwerkdetails überprüfen", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "Verwenden von Sammelbaren (ERC-721) Token wird derzeit nicht unterstützt", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "Wallet-Erstellung erfolgreich" }, - "warning": { - "message": "Warnung" - }, "weak": { "message": "Schwach" }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 649655d5e878..fec2fcdc217f 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -62,13 +62,6 @@ "message": "Το $1 ίσως αποκτήσει πρόσβαση και δαπανήσει αυτό το περιουσιακό στοιχείο", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "Αποκτήστε πρόσβαση στο πορτοφόλι σας με τη Μυστική σας Φράση Ανάκτησης" - }, - "accessYourWalletWithSRPDescription": { - "message": "Το MetaMask δεν μπορεί να ανακτήσει τον κωδικό σας. Θα χρησιμοποιήσουμε τη Μυστική σας Φράση Ανάκτησης για να επιβεβαιώσουμε την κυριότητά σας, να ανακτήσουμε το πορτοφόλι σας και να ορίσουμε ένα νέο κωδικό. Πρώτα, εισάγετε τη Μυστική Φράση σας Ανάκτησης που σας δόθηκε όταν δημιουργήσατε το πορτοφόλι σας. $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "Πρόσβαση στην κάμερά σας..." }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "Προσθήκη Δικτύου" }, - "addNetworkTooltipWarning": { - "message": "Αυτή η σύνδεση δικτύου βασίζεται σε τρίτους. H σύνδεση ενδέχεται να είναι λιγότερο αξιόπιστη ή να επιτρέπει σε τρίτους να παρακολουθούν τη δραστηριότητα. $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "Προσθέστε τα Προτεινόμενα Tokens" }, @@ -411,14 +400,6 @@ "message": "Αγορά $1", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Αγορά $1 με Coinbase Pay", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Μπορείτε να αγοράσετε ή να μεταφέρετε εύκολα κρυπτονομίσματα με τον λογαριασμό σας στο Coinbase.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "Αγορά $1 με MoonPay", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Αγοράστε $1 με το Wyre" + "message": "Αγοράστε ETH με το Wyre" }, "buyWithWyreDescription": { - "message": "Το Wyre σας επιτρέπει να χρησιμοποιήσετε μια πιστωτική κάρτα για να καταθέσετε $1 απευθείας στον λογαριασμό σας MetaTask." + "message": "Το Wyre σας επιτρέπει να χρησιμοποιήσετε μια πιστωτική κάρτα για να καταθέσετε ETH απευθείας στον λογαριασμό σας MetaTask." }, "bytes": { "message": "Bytes" @@ -466,6 +447,9 @@ "message": "Για να $1 τη συναλλαγή, τα τέλη συναλλαγής πρέπει να αυξηθούν κατά τουλάχιστον 10% ώστε να αναγνωριστούν από το δίκτυο.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "Ακύρωση ανταλλαγής" + }, "cancellationGasFee": { "message": "Ακύρωση Χρέωσης Αερίου" }, @@ -622,9 +606,6 @@ "continue": { "message": "Συνέχεια" }, - "continueToCoinbasePay": { - "message": "Συνέχεια στο Coinbase Pay" - }, "continueToMoonPay": { "message": "Συνέχεια στη MoonPay" }, @@ -650,7 +631,7 @@ "message": "Αλληλεπίδραση Σύμβασης" }, "convertTokenToNFTDescription": { - "message": "Εντοπίσαμε ότι αυτό το περιουσιακό στοιχείο είναι NFT. Το MetaMask υποστηρίζει πλέον εξ'ορισμού πλήρως τα NFT. Θέλετε να το αφαιρέσετε από τη λίστα των token σας και να το προσθέσετε ως NFT;" + "message": "Εντοπίσαμε ότι αυτό το περιουσιακό στοιχείο είναι NFT. Το Metamask υποστηρίζει πλέον εξ'ορισμού πλήρως τα NFT. Θέλετε να το αφαιρέσετε από τη λίστα των token σας και να το προσθέσετε ως NFT;" }, "convertTokenToNFTExistDescription": { "message": "Εντοπίσαμε ότι αυτό το περιουσιακό στοιχείο προστέθηκε ως NFT. Θέλετε να το αφαιρέσετε από τη λίστα των token σας;" @@ -1244,10 +1225,6 @@ "message": "Όλα τα API του Flask είναι πειραματικά. Μπορεί να αλλάξουν ή να αφαιρεθούν χωρίς προειδοποίηση ή μπορεί να παραμείνουν στο Flask επ' αόριστον, χωρίς ποτέ να μεταφερθούν στο σταθερό MetaMask. Χρησιμοποιήστε τα με δική σας ευθύνη.", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Βεβαιωθείτε ότι έχετε απενεργοποιήσει την κανονική σας επέκταση MetaMask όταν χρησιμοποιείτε το Flask.", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "Αποδέχομαι τον κίνδυνο", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "Απόκρυψη" }, - "hideFullTransactionDetails": { - "message": "Απόκρυψη αναλυτικών στοιχείων συναλλαγών" - }, "hideSeedPhrase": { "message": "Απόκρυψη φράσης ανάκτησης" }, @@ -1471,12 +1445,6 @@ "history": { "message": "Ιστορικό" }, - "ignoreAll": { - "message": "Αγνόηση όλων" - }, - "ignoreTokenWarning": { - "message": "Εάν κάνετε απόκρυψη των token, δεν θα εμφανίζονται στο πορτοφόλι σας. Ωστόσο, μπορείτε ακόμα να τα προσθέσετε εάν κάνετε αναζήτηση για αυτά." - }, "import": { "message": "Εισαγωγή", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "Εισαγωγή Πορτοφολιού" }, - "importWithCount": { - "message": "Εισαγωγή $1", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "Εισαγωγή υπάρχοντος πορτοφολιού με Μυστική Φράση Ανάκτησης" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "βέλος αλλαγής επιπέδου" }, - "lightTheme": { - "message": "Ανοιχτόχρωμο" - }, "likeToImportTokens": { "message": "Θέλετε να προσθέσετε αυτά τα token;" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "Συμμετάσχετε σε 6εκ+ χρήστες για να βελτιώσετε το MetaMask" }, + "mismatchedChain": { + "message": "Οι λεπτομέρειες δικτύου για αυτό το αναγνωριστικό αλυσίδας δεν ταιριάζουν με τις εγγραφές μας. Σας συνιστούμε να $1 πριν συνεχίσετε.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "επαληθεύστε τα στοιχεία δικτύου", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "Καινούριος στο MetaMask;" }, - "newTokensImportedMessage": { - "message": "Εισάγατε επιτυχώς το $1.", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "Τα token εισήχθησαν" - }, "newTotal": { "message": "Νέο Σύνολο" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "Δεν Υπάρχει Αρκετό Αέριο" }, - "notifications": { - "message": "Ειδοποιήσεις" - }, "notifications10ActionText": { "message": "Μετάβαση στις Ρυθμίσεις", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 Κάνουμε τις συναλλαγές ευκολότερες στο διάβασμα." }, - "notificationsEmptyText": { - "message": "Δεν υπάρχει κάτι να δείτε εδώ." - }, - "notificationsHeader": { - "message": "Ειδοποιήσεις" - }, - "notificationsInfos": { - "message": "$1 από $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "Επισήμανση όλων ως αναγνωσμένων" - }, "numberOfNewTokensDetected": { "message": "$1 νέα token βρέθηκαν σε αυτόν τον λογαριασμό", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "Προέλευση" }, - "osTheme": { - "message": "Σύστημα" - }, - "padlock": { - "message": "Padlock" - }, "parameters": { "message": "Παράμετροι" }, @@ -2435,10 +2371,6 @@ "message": "Βλέπε διεύθυνση, υπόλοιπο λογαριασμού, δραστηριότητα και έναρξη συναλλαγών", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "Εκτέλεση επ' αόριστον.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "Ελέγξτε τους λογαριασμούς και τα περιουσιακά σας στοιχεία σας στο \"$1\".", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "+ $1 ακόμη", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "Δημοφιλή προσαρμοσμένα δίκτυα" - }, "preferredLedgerConnectionType": { "message": "Προτιμώμενος Τύπος Σύνδεσης Ledger", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "Βεβαιωθείτε ότι χρησιμοποιείτε τη σωστή Μυστική Φράση Ανάκτησης πριν συνεχίσετε. Αυτή η ενέργεια είναι μη αναστρέψιμη." }, - "restartMetamask": { - "message": "Επανεκκίνηση MetaMask" - }, "restore": { "message": "Επαναφορά" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "Αποστολή Ποσού" }, - "sendBugReport": { - "message": "Στείλτε μας μια αναφορά σφάλματος." - }, "sendSpecifiedTokens": { "message": "Αποστολή $1", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "Συνδέστε το πορτοφόλι σας απευθείας στον υπολογιστή σας. Ξεκλειδώστε το Ledger και ανοίξτε την εφαρμογή Ethereum. Για περισσότερες πληροφορίες σχετικά με τη χρήση της συσκευής πορτοφολιού σας, $1.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "Λαμβάνετε ακόμα αυτό το μήνυμα;" - }, "storePhrase": { "message": "Αποθηκεύστε αυτήν τη φράση σε έναν διαχειριστή κωδικών πρόσβασης όπως το 1Password." }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "Μπορείτε να ανταλλάξετε ακόμα τα token σας, ακόμα και αν οι Έξυπνες Συναλλαγές δεν είναι διαθέσιμες." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "Ιδιωτική υποβολή της Ανταλλαγής σας..." + "stxPendingFinalizing": { + "message": "Ολοκλήρωση..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "Δημόσια υποβολή της Ανταλλαγής σας..." + "stxPendingOptimizingGas": { + "message": "Βελτιστοποίηση τελών συναλλαγής..." + }, + "stxPendingPrivatelySubmitting": { + "message": "Ιδιωτική υποβολή της Ανταλλαγής..." }, "stxSubDescription": { "message": "* Οι Έξυπνες Συναλλαγές θα προσπαθήσουν να υποβάλουν τη συναλλαγή σας ιδιωτικά, πολλές φορές. Εάν όλες οι προσπάθειες αποτύχουν, η συναλλαγή θα μεταδοθεί δημόσια για να διασφαλιστεί η επιτυχής πραγματοποίηση της ανταλλαγής σας." @@ -3179,10 +3102,6 @@ "message": "Τα $1 σας είναι πλέον διαθέσιμα.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "Η Ανταλλαγή θα ολοκληρωθεί σε <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "Προσομοίωση συναλλαγών πριν από την υποβολή για μείωση του κόστους συναλλαγής και των αποτυχιών." }, @@ -3261,6 +3180,10 @@ "message": "Δεν υπάρχουν διαθέσιμα tokens που να ταιριάζουν σε $1", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "Η ανταλλαγή θα ολοκληρωθεί σε <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "Επιβεβαιώστε με το υλικό πορτοφόλι σας" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "Η ολίσθηση πρέπει να είναι μεγαλύτερη ή ίση με το μηδέν" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "Πηγή ρευστότητας" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "Σύμβολο Token" }, - "tokensFoundTitle": { - "message": "Βρέθηκαν $1 νέα tokens", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "Καταλαβαίνω" }, @@ -3804,9 +3719,6 @@ "message": "Είχαμε πρόβλημα να συνδεθούμε με το $1 σας, δοκιμάστε να ξαναδείτε το $2 και προσπαθήστε ξανά.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "Το MetaMask αντιμετώπισε πρόβλημα κατά την εκκίνηση. Αυτό το σφάλμα μπορεί να είναι τυχαίο, γι' αυτό προσπαθήστε να επανεκκινήσετε την επέκταση." - }, "troubleTokenBalances": { "message": "Είχαμε πρόβλημα να φορτώσουμε τα υπόλοιπα του διακριτικού σας. Μπορείτε να τα δείτε ", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "Πληκτρολογήστε τον κωδικό πρόσβασής σας MetaMask" }, - "typeYourSRP": { - "message": "Πληκτρολογήστε τη Μυστική σας Φράση Ανάκτησης" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "Αυτό το προσαρμοσμένο δίκτυο δεν αναγνωρίζεται. Σας συνιστούμε να $1 πριν προχωρήσετε", "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": "επαληθεύστε τα στοιχεία δικτύου", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "Η αποστολή συλλεκτικών (ERC-721) δεν υποστηρίζεται προς το παρόν", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "Επιτυχής δημιουργία πορτοφολιού" }, - "warning": { - "message": "Προειδοποίηση" - }, "weak": { "message": "Αδύναμος" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index e425103f27d9..a34af875bb96 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -160,9 +160,6 @@ "addMemo": { "message": "Add memo" }, - "addMoreNetworks": { - "message": "add more networks manually" - }, "addNetwork": { "message": "Add Network" }, @@ -233,10 +230,6 @@ "alerts": { "message": "Alerts" }, - "allOfYour": { - "message": "All of your $1", - "description": "$1 is the symbol or name of the token that the user is approving spending" - }, "allowExternalExtensionTo": { "message": "Allow this external extension to:" }, @@ -273,10 +266,6 @@ "approve": { "message": "Approve spend limit" }, - "approveAllTokensTitle": { - "message": "Give permission to access all of your $1?", - "description": "$1 is the symbol of the token for which the user is granting approval" - }, "approveAndInstall": { "message": "Approve & Install" }, @@ -425,14 +414,6 @@ "message": "Buy $1", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Buy $1 with Coinbase Pay", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "You can easily buy or transfer crypto with your Coinbase account.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "Buy $1 with MoonPay", "description": "$1 represents the cypto symbol to be purchased" @@ -452,10 +433,10 @@ "message": "Buy Now" }, "buyWithWyre": { - "message": "Buy $1 with Wyre" + "message": "Buy ETH with Wyre" }, "buyWithWyreDescription": { - "message": "Easy onboarding for purchases up to $ 1000. Fast interactive high limit purchase verification. Supports Debit/Credit Card, Apple Pay, Bank Transfers. Available in 100+ countries. Tokens deposit into your MetaMask Account" + "message": "Wyre lets you use a debit card to deposit ETH right in to your MetaMask account." }, "bytes": { "message": "Bytes" @@ -483,12 +464,8 @@ "message": "To $1 a transaction the gas fee must be increased by at least 10% for it to be recognized by the network.", "description": "$1 is string 'cancel' or 'speed up'" }, - "cancelSwapForFee": { - "message": "Cancel swap for ~$1", - "description": "$1 could be e.g. $2.98, it is a cost for cancelling a Smart Transaction" - }, - "cancelSwapForFree": { - "message": "Cancel swap for free" + "cancelSwap": { + "message": "Cancel swap" }, "cancellationGasFee": { "message": "Cancellation Gas Fee" @@ -646,9 +623,6 @@ "continue": { "message": "Continue" }, - "continueToCoinbasePay": { - "message": "Continue to Coinbase Pay" - }, "continueToMoonPay": { "message": "Continue to MoonPay" }, @@ -674,7 +648,7 @@ "message": "Contract Interaction" }, "convertTokenToNFTDescription": { - "message": "We've detected that this asset is an NFT. MetaMask now has full native support for NFTs. Would you like to remove it from your token list and add it as an NFT?" + "message": "We've detected that this asset is an NFT. Metamask now has full native support for NFTs. Would you like to remove it from your token list and add it as an NFT?" }, "convertTokenToNFTExistDescription": { "message": "We’ve detected that this asset has been added as an NFT. Would you like to remove it from your token list?" @@ -1304,9 +1278,6 @@ "functionApprove": { "message": "Function: Approve" }, - "functionSetApprovalForAll": { - "message": "Function: SetApprovalForAll" - }, "functionType": { "message": "Function Type" }, @@ -1647,9 +1618,6 @@ "invalidSeedPhrase": { "message": "Invalid Secret Recovery Phrase" }, - "invalidSeedPhraseCaseSensitive": { - "message": "Invalid input! Secret Recovery Phrase is case sensitive." - }, "ipfsGateway": { "message": "IPFS Gateway" }, @@ -1921,23 +1889,14 @@ "metametricsTitle": { "message": "Join 6M+ users to improve MetaMask" }, + "mismatchedChain": { + "message": "The 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." }, - "mismatchedChainRecommendation": { - "message": "We recommend that you $1 before proceeding.", - "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key. The link will open to instructions for users to validate custom network details." - }, - "mismatchedNetworkName": { - "message": "According to our record the network name may not correctly match this chain ID." - }, - "mismatchedNetworkSymbol": { - "message": "The submitted currency symbol does not match what we expect for this chain ID." - }, - "mismatchedRpcUrl": { - "message": "According to our records the submitted RPC URL value does not match a known provider for this chain ID." - }, "missingNFT": { "message": "Don't see your NFT?" }, @@ -1989,9 +1948,6 @@ "network": { "message": "Network:" }, - "networkAddedSuccessfully": { - "message": "Network added successfully!" - }, "networkDetails": { "message": "Network Details" }, @@ -2108,9 +2064,6 @@ "message": "Nonce is higher than suggested nonce of $1", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftTokenIdPlaceholder": { "message": "Enter the Token ID" }, @@ -2177,9 +2130,6 @@ "notEnoughGas": { "message": "Not Enough Gas" }, - "notifications": { - "message": "Notifications" - }, "notifications10ActionText": { "message": "Visit in settings", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2211,16 +2161,6 @@ "notifications12Title": { "message": "Wen dark mode? Now dark mode! 🕶️🦊" }, - "notifications13ActionText": { - "message": "Show custom network list" - }, - "notifications13Description": { - "message": "You can now add the following popular custom networks easily: Arbitrum, Avalanche, Binance Smart Chain, Fantom, Harmony, Optimism, Palm and Polygon! To enable this feature, go to Settings -> Experimental and turn \"Show custom network list\" on!", - "description": "Description of a notification in the 'See What's New' popup. Describes popular network feature." - }, - "notifications13Title": { - "message": "Add Popular Networks" - }, "notifications1Description": { "message": "MetaMask Mobile users can now swap tokens inside their mobile wallet. Scan the QR code to get the mobile app and start swapping.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." @@ -2310,19 +2250,6 @@ "notifications9Title": { "message": "👓 We are making transactions easier to read." }, - "notificationsEmptyText": { - "message": "Nothing to see here." - }, - "notificationsHeader": { - "message": "Notifications" - }, - "notificationsInfos": { - "message": "$1 from $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "Mark all as read" - }, "numberOfNewTokensDetected": { "message": "$1 new tokens found in this account", "description": "$1 is the number of new tokens detected" @@ -2497,10 +2424,6 @@ "message": "See address, account balance, activity and suggest transactions to approve", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "Run indefinitely.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "Control your \"$1\" accounts and assets.", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2707,9 +2630,6 @@ "resetWalletWarning": { "message": "Make sure you’re using the correct Secret Recovery Phrase before proceeding. You will not be able to undo this." }, - "restartMetamask": { - "message": "Restart MetaMask" - }, "restore": { "message": "Restore" }, @@ -2738,14 +2658,6 @@ "revealTheSeedPhrase": { "message": "Reveal seed phrase" }, - "revokeAllTokensTitle": { - "message": "Revoke permission to access all of your $1?", - "description": "$1 is the symbol of the token for which the user is revoking approval" - }, - "revokeApproveForAllDescription": { - "message": "By revoking permission, the following $1 will no longer be able to access your $2", - "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" - }, "rinkeby": { "message": "Rinkeby Test Network" }, @@ -2902,9 +2814,6 @@ "sendAmount": { "message": "Send Amount" }, - "sendBugReport": { - "message": "Send us a bug report." - }, "sendSpecifiedTokens": { "message": "Send $1", "description": "Symbol of the specified token" @@ -2922,23 +2831,12 @@ "message": "Sending $1", "description": "$1 represents the native currency symbol for the current network (e.g. ETH or BNB)" }, - "sendingToTokenContractWarning": { - "message": "Warning: you are about to send to a token contract which could result in a loss of funds. $1", - "description": "$1 is a clickable link with text defined by the 'learnMoreUpperCase' key. The link will open to a support article regarding the known contract address warning" - }, "setAdvancedPrivacySettings": { "message": "Set advanced privacy settings" }, "setAdvancedPrivacySettingsDetails": { "message": "MetaMask uses these trusted third-party services to enhance product usability and safety." }, - "setApprovalForAll": { - "message": "Set Approval for All" - }, - "setApprovalForAllTitle": { - "message": "Approve $1 with no spend limit", - "description": "The token symbol that is being approved" - }, "settings": { "message": "Settings" }, @@ -2958,12 +2856,6 @@ "showAdvancedGasInlineDescription": { "message": "Select this to show gas price and limit controls directly on the send and confirm screens." }, - "showCustomNetworkList": { - "message": "Show Custom Network List" - }, - "showCustomNetworkListDescription": { - "message": "Select this to show a list of networks with prefilled details when adding a new network." - }, "showFiatConversionInTestnets": { "message": "Show Conversion on test networks" }, @@ -3073,9 +2965,6 @@ "snapsToggle": { "message": "A snap will only run if it is enabled" }, - "someNetworksMayPoseSecurity": { - "message": "Some networks may pose security and/or privacy risks. Understand the risks before adding & using a network." - }, "somethingWentWrong": { "message": "Oops! Something went wrong." }, @@ -3198,9 +3087,6 @@ "message": "Plug your Ledger directly into your computer, then unlock it and open the Ethereum app.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "Still getting this message?" - }, "storePhrase": { "message": "Store this phrase in a password manager like 1Password." }, @@ -3226,7 +3112,7 @@ "message": "Swap would have failed" }, "stxCancelledDescription": { - "message": "Your transaction would have failed and was cancelled to protect you from paying unnecessary gas fees." + "message": "Your transaction would have failed and was canceled to protect you from paying unnecessary gas fees." }, "stxCancelledSubDescription": { "message": "Try your swap again. We’ll be here to protect you against similar risks next time." @@ -3253,11 +3139,14 @@ "stxFallbackUnavailable": { "message": "You can still swap your tokens even while Smart Transactions are unavailable." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "Privately submitting your Swap..." + "stxPendingFinalizing": { + "message": "Finalizing..." + }, + "stxPendingOptimizingGas": { + "message": "Optimizing gas..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "Publicly submitting your Swap..." + "stxPendingPrivatelySubmitting": { + "message": "Privately submitting the Swap..." }, "stxSubDescription": { "message": "* Smart Transactions will attempt to submit your transaction privately, multiple times. If all attempts fail, the transaction will be broadcast publicly to ensure your Swap successfully goes through." @@ -3269,10 +3158,6 @@ "message": "Your $1 is now available.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "Swap will complete in <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "Simulate transactions before submitting to decrease transaction costs and reduce failures." }, @@ -3292,10 +3177,10 @@ "message": "A transaction has been successful but we’re unsure what it is. This may be due to submitting another transaction while this swap was processing." }, "stxUserCancelled": { - "message": "Swap cancelled" + "message": "Swap canceled" }, "stxUserCancelledDescription": { - "message": "Your transaction has been cancelled and you did not pay any unnecessary gas fees." + "message": "Your transaction has been canceled and you did not pay any unnecessary gas fees." }, "stxYouCanOptOut": { "message": "You can opt-out in advanced settings any time." @@ -3351,6 +3236,10 @@ "message": "No tokens available matching $1", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "Swap complete in <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "Confirm with your hardware wallet" }, @@ -3532,10 +3421,6 @@ "swapSlippageNegative": { "message": "Slippage must be greater or equal to zero" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "Liquidity source" }, @@ -3638,10 +3523,6 @@ "switchNetworks": { "message": "Switch Networks" }, - "switchToNetwork": { - "message": "Switch to $1", - "description": "$1 represents the custom network that has previously been added" - }, "switchToThisAccount": { "message": "Switch to this account" }, @@ -3898,9 +3779,6 @@ "message": "We had trouble connecting to your $1, try reviewing $2 and try again.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "MetaMask had trouble starting. This error could be intermittent, so try restarting the extension." - }, "troubleTokenBalances": { "message": "We had trouble loading your token balances. You can view them ", "description": "Followed by a link (here) to view token balances" @@ -3948,9 +3826,6 @@ "unknownCameraErrorTitle": { "message": "Ooops! Something went wrong...." }, - "unknownCollection": { - "message": "Unnamed collection" - }, "unknownNetwork": { "message": "Unknown Private Network" }, @@ -3967,9 +3842,13 @@ "message": "The decentralized web awaits" }, "unrecognizedChain": { - "message": "This custom network is not recognized", + "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." + }, "unsendableAsset": { "message": "Sending collectible (ERC-721) tokens is not currently supported", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -4062,7 +3941,7 @@ "description": "$1 is the action type. e.g (Account, Transaction, Swap)" }, "visitWebSite": { - "message": "Visit our website" + "message": "Visit our web site" }, "walletConnectionGuide": { "message": "our hardware wallet connection guide" @@ -4087,9 +3966,6 @@ "walletCreationSuccessTitle": { "message": "Wallet creation successful" }, - "wantToAddThisNetwork": { - "message": "Want to add this network?" - }, "warning": { "message": "Warning" }, @@ -4152,10 +4028,6 @@ "yesLetsTry": { "message": "Yes, let's try" }, - "youHaveAddedAll": { - "message": "You've added all the popular networks. You can discover more networks $1 Or you can $2", - "description": "$1 is a link with the text 'here' and $2 is a button with the text 'add more networks manually'" - }, "youNeedToAllowCameraAccess": { "message": "You need to allow camera access to use this feature." }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index ffe4d6aebee4..e31832da592f 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -62,13 +62,6 @@ "message": "$1 puede acceder y gastar este activo", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "Acceda a su billetera con la frase secreta de respaldo" - }, - "accessYourWalletWithSRPDescription": { - "message": "MetaMask no puede recuperar su contraseña. Usaremos su frase secreta de respaldo para validar su propiedad, restaurar su billetera y configurar una nueva contraseña. Primero, ingrese la frase secreta de respaldo que recibió cuando creó su billetera. $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "Accediendo a la cámara…" }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "Agregar red" }, - "addNetworkTooltipWarning": { - "message": "Esta conexión de red depende de terceros. Y puede ser menos confiable o permite que terceros rastreen la actividad. $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "Agregar tokens sugeridos" }, @@ -411,14 +400,6 @@ "message": "Comprar $1", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Comprar $1 con Coinbase Pay", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Puede comprar o transferir criptomonedas fácilmente por medio de su cuenta de Coinbase.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "Comprar $1 con MoonPay", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Comprar $1 con Wyre" + "message": "Comprar ETH con Wyre" }, "buyWithWyreDescription": { - "message": "Acceso fácil a transacciones de $ 1,000 o menos con verificación rápida y efectiva. Aceptamos tarjetas débito, crédito, Apple Pay y transferencias bancarias en más de 100 países. Tokens serán depósitados en su MetaMask." + "message": "Wyre le permite usar una tarjeta de débito para depositar ETH directamente en su cuenta de MetaMask." }, "bytes": { "message": "Bytes" @@ -466,6 +447,9 @@ "message": "Para $1 una transacción, la tarifa de gas debe aumentar al menos un 10% para que sea reconocida por la red.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "Cancelar swap" + }, "cancellationGasFee": { "message": "Cuota de gas por cancelación" }, @@ -622,9 +606,6 @@ "continue": { "message": "Continuar" }, - "continueToCoinbasePay": { - "message": "Continuar a Coinbase Pay" - }, "continueToMoonPay": { "message": "Continuar a MoonPay" }, @@ -650,7 +631,7 @@ "message": "Interacción con el contrato" }, "convertTokenToNFTDescription": { - "message": "Hemos detectado que este activo es un NFT. MetaMask ahora tiene soporte nativo completo para NFTs. ¿Quieres eliminarlo de tu lista de tokens y añadirlo como un NFT?" + "message": "Hemos detectado que este activo es un NFT. Metamask ahora tiene soporte nativo completo para NFTs. ¿Quieres eliminarlo de tu lista de tokens y añadirlo como un NFT?" }, "convertTokenToNFTExistDescription": { "message": "Hemos detectado que este recurso se ha agregado como NFT. ¿Quiere eliminarlo de su lista de tokens?" @@ -1244,10 +1225,6 @@ "message": "Todas las API de Flask son experimentales. Se pueden cambiar o eliminadar sin previo aviso o pueden permanecer en Flask indefinidamente sin ser migradas a MetaMask estable. Úselas bajo su propia responsabilidad.", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Asegúrese de deshabilitar su extensión recurrente de MetaMask cuando use Flask.", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "Acepto los riesgos", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "Ocultar" }, - "hideFullTransactionDetails": { - "message": "Esconder los detalles completos de la transacción" - }, "hideSeedPhrase": { "message": "Ocultar frase inicial" }, @@ -1471,12 +1445,6 @@ "history": { "message": "Historial" }, - "ignoreAll": { - "message": "Ignorar todo" - }, - "ignoreTokenWarning": { - "message": "Si oculta tokens, estos no se mostrarán en su billetera. Sin embargo, aún puede agregarlos buscándolos." - }, "import": { "message": "Importar", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "Importar cartera" }, - "importWithCount": { - "message": "Importar $1", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "Importar la cartera existente con una frase secreta de recuperación" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "flecha de nivel" }, - "lightTheme": { - "message": "Claro" - }, "likeToImportTokens": { "message": "¿Le gustaría agregar estos tokens?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "Únase a más de 6 millones de usuarios para mejorar MetaMask" }, + "mismatchedChain": { + "message": "Los detalles de la red de este identificador de cadena no coinciden con nuestros registros. Antes de continuar, le recomendamos que $1.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "verifique los detalles de la red", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "¿Es nuevo en MetaMask?" }, - "newTokensImportedMessage": { - "message": "Ha importado $1 exitosamente.", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "Token importado" - }, "newTotal": { "message": "Total nuevo" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "No hay gas suficiente" }, - "notifications": { - "message": "Notificaciones" - }, "notifications10ActionText": { "message": "Vaya a configuración", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2154,7 +2109,7 @@ "message": "Habilitar modo oscuro" }, "notifications12Description": { - "message": "¡El modo oscuro en Extension finalmente está aquí! Para encenderlo, vaya a Configuración -> Experimental y seleccione una de las opciones de visualización: Claro, Oscuro, Sistema." + "message": "Se habilitará el modo oscuro para los nuevos usuarios según las preferencias de su sistema. Para usuarios existentes, habilite el modo oscuro de forma manual en Configuración -> Experimental." }, "notifications12Title": { "message": "¿Cuándo estará disponible el modo oscuro? ¡Ahora! 🕶️🦊" @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 Estamos facilitando la lectura de las transacciones." }, - "notificationsEmptyText": { - "message": "Nada que ver aquí." - }, - "notificationsHeader": { - "message": "Notificaciones" - }, - "notificationsInfos": { - "message": "$1 de $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "Marcar todo como leído" - }, "numberOfNewTokensDetected": { "message": "Se encontraron tokens nuevos de $1 en esta cuenta", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "Origen" }, - "osTheme": { - "message": "Sistema" - }, - "padlock": { - "message": "Candado" - }, "parameters": { "message": "Parámetros" }, @@ -2435,10 +2371,6 @@ "message": "Ver las direcciones de las cuentas permitidas (requerido)", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "Ejecutar indefinidamente.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "Controle sus cuentas y activos \"$1\".", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "+ $1 más", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "Redes populares personalizadas" - }, "preferredLedgerConnectionType": { "message": "Tipo de conexión de Ledger preferida", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "Asegúrese de usar la frase de recuperación secreta correcta antes de continuar. No podrá deshacer esto." }, - "restartMetamask": { - "message": "Reiniciar MetaMask" - }, "restore": { "message": "Restaurar" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "Enviar monto" }, - "sendBugReport": { - "message": "Envíenos un informe de error." - }, "sendSpecifiedTokens": { "message": "Enviar $1", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "Conecte la cartera directamente al equipo. Desbloquee su Ledger y abra la aplicación de Ethereum. Para más información sobre el uso de su dispositivo de cartera de hardware, $1.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "¿Sigue recibiendo este mensaje?" - }, "storePhrase": { "message": "Guarde esta frase en un administrador de contraseñas como 1Password." }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "Todavía puede intercambiar sus tokens incluso cuando las transacciones inteligentes no están disponibles." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "Enviando su swap de forma privada..." + "stxPendingFinalizing": { + "message": "Finalizando…" + }, + "stxPendingOptimizingGas": { + "message": "Optimizando gas..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "Enviando su swap de forma pública..." + "stxPendingPrivatelySubmitting": { + "message": "Enviando el Swap de forma privada..." }, "stxSubDescription": { "message": "* Transacciones inteligentes intentará enviar su transacción de forma privada varias veces. Si todos los intentos fallan, la transacción se transmitirá públicamente para garantizar que su swap se realice con éxito." @@ -3179,10 +3102,6 @@ "message": "Su $1 ya está disponible.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "El swap finalizará en <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "Simule transacciones antes de enviarlas para disminuir los costos de transacción y reducir las fallas." }, @@ -3261,6 +3180,10 @@ "message": "No hay tokens disponibles que coincidan con $1", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "Swap finalizado en <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "Confirmar con la cartera de hardware" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "El desfase debe ser mayor o igual que cero" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "Fuente de liquidez" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "Símbolo del token" }, - "tokensFoundTitle": { - "message": "$1 nuevos tokens encontrados", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "Comprendo" }, @@ -3804,9 +3719,6 @@ "message": "Tuvimos problemas al conectar su $1. Pruebe revisar $2 e inténtelo de nuevo.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "MetaMask tuvo problemas para iniciar. Este error podría ser intermitente, así que intente reiniciar la extensión." - }, "troubleTokenBalances": { "message": "Tuvimos problemas al cargar los saldos de token. Puede verlos ", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "Escriba su contraseña de MetaMask" }, - "typeYourSRP": { - "message": "Escriba la frase secreta de respaldo" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "No se reconoce esta red personalizada. Antes de continuar, le recomendamos que $1", "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": "verifique los detalles de la red", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "El envío de tokens coleccionables (ERC-721) no se admite actualmente", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "Creación exitosa de la cartera" }, - "warning": { - "message": "Advertencia" - }, "weak": { "message": "Débil" }, diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index f92e60f3da65..25ff367a3649 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -363,10 +363,10 @@ "message": "Comprar" }, "buyWithWyre": { - "message": "Comprar $1 con Wyre" + "message": "Comprar ETH con Wyre" }, "buyWithWyreDescription": { - "message": "Wyre le permite usar una tarjeta de débito para depositar $1 directamente en su cuenta de MetaMask." + "message": "Wyre le permite usar una tarjeta de débito para depositar ETH directamente en su cuenta de MetaMask." }, "bytes": { "message": "Bytes" @@ -1643,6 +1643,10 @@ "metametricsTitle": { "message": "Únase a más de 6 millones de usuarios para mejorar MetaMask" }, + "mismatchedChain": { + "message": "Los detalles de la red de este ID de cadena no coinciden con nuestros registros. Antes de continuar, le recomendamos que $1.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "verifique los detalles de la red", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -3211,6 +3215,10 @@ "message": "No se reconoce esta red personalizada. Antes de continuar, le recomendamos que $1", "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": "verifique los detalles de la red", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "El envío de tokens coleccionables (ERC-721) no se admite actualmente", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index 1b1a3872061c..bb5be3a52a86 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -137,10 +137,10 @@ "message": "Teie lehitsejat ei toetata..." }, "buyWithWyre": { - "message": "Ostke $1 -d Wyre'iga" + "message": "Ostke ETH-d Wyre'iga" }, "buyWithWyreDescription": { - "message": "Wyre võimaldab kasutada krediitkaarti, et teha $1 sissemakse otse MetaMaski kontole." + "message": "Wyre võimaldab kasutada krediitkaarti, et teha ETH sissemakse otse MetaMaski kontole." }, "bytes": { "message": "Baidid" diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index ab74d3482c0d..2669d73217be 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -137,10 +137,10 @@ "message": "مرورگر شما پشتیبانی نمیشود" }, "buyWithWyre": { - "message": "$1 را توسط Wyre خریداری نمایید" + "message": "ETH را توسط Wyre خریداری نمایید" }, "buyWithWyreDescription": { - "message": "Wyre به شما اجازه میدهد تا یک کردیت کارت را جهت پرداخت 1$ مستقیمًا به حساب MetaMask تان استفاده نمایید." + "message": "Wyre به شما اجازه میدهد تا یک کردیت کارت را جهت پرداخت ETH مستقیمًا به حساب MetaMask تان استفاده نمایید." }, "bytes": { "message": "بایت ها" diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index 496475976a3b..08e7342378c1 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -137,10 +137,10 @@ "message": "Selaintasi ei tueta..." }, "buyWithWyre": { - "message": "Osta $1 :ta Wyrella" + "message": "Osta ETH:ta Wyrella" }, "buyWithWyreDescription": { - "message": "Wyre antaa sinun käyttää luottokorttia, jotta voit tallettaa $1 :ta suoraan MetaMask-tilillesi." + "message": "Wyre antaa sinun käyttää luottokorttia, jotta voit tallettaa ETH:ta suoraan MetaMask-tilillesi." }, "bytes": { "message": "Tavua" diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index 6ed19fecdfa0..54a59f2ad04a 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -122,10 +122,10 @@ "message": "Hindi sinusuportahan ang iyong Browser..." }, "buyWithWyre": { - "message": "Bumili ng $1 gamit ang Wyre" + "message": "Bumili ng ETH gamit ang Wyre" }, "buyWithWyreDescription": { - "message": "Binibigyang-daan ka ng Wyre na gumamit ng credit card para magdeposito ng $1 nang direkta sa iyong MetaMask account." + "message": "Binibigyang-daan ka ng Wyre na gumamit ng credit card para magdeposito ng ETH nang direkta sa iyong MetaMask account." }, "cancel": { "message": "Kanselahin" diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 9d2367dae7f7..ffed6ee1b854 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -62,13 +62,6 @@ "message": "$1 peut accéder à cet actif et le dépenser", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "Accédez à votre portefeuille en utilisant votre phrase secrète de récupération" - }, - "accessYourWalletWithSRPDescription": { - "message": "MetaMask ne peut pas récupérer votre mot de passe. Nous utiliserons votre phrase secrète de récupération pour vérifier votre identité, restaurer votre portefeuille et définir un nouveau mot de passe. Veuillez tout d’abord saisir la phrase secrète de récupération qui vous a été fournie lorsque vous avez créé votre portefeuille. $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "Accès à votre appareil photo..." }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "Ajouter un réseau" }, - "addNetworkTooltipWarning": { - "message": "Cette connexion réseau repose sur des tiers. Elle peut être moins fiable ou permettre à des tiers de suivre l’activité des utilisateurs. $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "Ajouter les jetons suggérés" }, @@ -411,14 +400,6 @@ "message": "Acheter $1", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Achetez des $1 avec Coinbase Pay", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Vous pouvez facilement acheter et transférer des cryptomonnaies en utilisant votre compte Coinbase.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "Acheter $1 avec MoonPay", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Acheter des $1 avec Wyre" + "message": "Acheter des ETH avec Wyre" }, "buyWithWyreDescription": { - "message": "Wyre vous permet d’utiliser une carte de crédit pour déposer des $1 directement sur votre compte MetaMask." + "message": "Wyre vous permet d’utiliser une carte de crédit pour déposer des ETH directement sur votre compte MetaMask." }, "bytes": { "message": "Octets" @@ -466,6 +447,9 @@ "message": "Pour $1 la transaction, les gas fees doivent être augmentés d’au moins 10 % pour être reconnus par le réseau.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "Annuler le swap" + }, "cancellationGasFee": { "message": "Frais d’annulation de carburant" }, @@ -622,9 +606,6 @@ "continue": { "message": "Continuer" }, - "continueToCoinbasePay": { - "message": "Accéder à Coinbase Pay" - }, "continueToMoonPay": { "message": "Continuer vers MoonPay" }, @@ -650,7 +631,7 @@ "message": "Interaction avec un contrat" }, "convertTokenToNFTDescription": { - "message": "Nous avons détecté que cet actif est un NFT. MetaMask prend désormais nativement en charge les NFT. Voulez-vous le retirer de votre liste de tokens et l’ajouter comme un NFT ?" + "message": "Nous avons détecté que cet actif est un NFT. Metamask prend désormais nativement en charge les NFT. Voulez-vous le retirer de votre liste de tokens et l’ajouter comme un NFT ?" }, "convertTokenToNFTExistDescription": { "message": "Nous avons détecté que cet actif a été ajouté en tant que NFT. Souhaitez-vous le retirer de votre liste de tokens ?" @@ -879,7 +860,7 @@ "message": "Téléchargez cette phrase de sauvegarde secrète et conservez-la en lieu sûr sur un disque dur ou un support de stockage externe chiffré." }, "downloadStateLogs": { - "message": "Télécharger les Logs d’état" + "message": "Télécharger les Logs d'état" }, "dropped": { "message": "Déconnecté" @@ -1244,10 +1225,6 @@ "message": "Toutes les API de Flask sont expérimentales. Elles peuvent être modifiées ou supprimées sans préavis. Elles peuvent aussi rester sur Flask indéfiniment sans jamais être migrées vers le MetaMask stable. Utilisez-les à vos risques et périls.", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Assurez-vous de désactiver l’extension MetaMask que vous utilisez habituellement lorsque vous utilisez Flask.", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "J’accepte les risques", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1303,7 +1280,7 @@ "message": "La limite de carburant est la quantité maximale d’unités d’essence que vous consentez à dépenser." }, "gasLimitRecommended": { - "message": "La limite recommandée de gas est de $1. Si la limite de gas est inférieure à cette valeur, l’opération peut échouer." + "message": "La limite recommandée de gas est de $1. Si la limite de gas est inférieure à cette valeur, l'opération peut échouer." }, "gasLimitTooLow": { "message": "La limite de carburant doit être d’au moins 21000" @@ -1399,7 +1376,7 @@ "message": "Réseau de test Goerli" }, "gotIt": { - "message": "J’ai compris !" + "message": "J'ai compris !" }, "grantedToWithColon": { "message": "Accordé à :" @@ -1439,9 +1416,6 @@ "hide": { "message": "Masquer" }, - "hideFullTransactionDetails": { - "message": "Masquer tous les détails de la transaction" - }, "hideSeedPhrase": { "message": "Masquer la phrase mnémonique" }, @@ -1471,12 +1445,6 @@ "history": { "message": "Historique" }, - "ignoreAll": { - "message": "Ignorer tout" - }, - "ignoreTokenWarning": { - "message": "Si vous masquez des jetons, ils n’apparaîtront pas dans votre portefeuille. Cependant, vous pouvez toujours les ajouter en les recherchant." - }, "import": { "message": "Importer", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "Importer le portefeuille" }, - "importWithCount": { - "message": "Importer $1", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "Importez votre portefeuille existant à l’aide d’une phrase secrète de récupération" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "flèche de niveau" }, - "lightTheme": { - "message": "Clair" - }, "likeToImportTokens": { "message": "Souhaitez-vous ajouter ces jetons ?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "Rejoignez plus de 6 M d’utilisateurs pour améliorer MetaMask" }, + "mismatchedChain": { + "message": "Les détails du réseau pour cet ID de chaîne ne correspondent pas à nos registres. Nous vous recommandons de $1 avant de poursuivre.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "vérifier les détails du réseau", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "Nouveau sur MetaMask ?" }, - "newTokensImportedMessage": { - "message": "Vous avez importé avec succès $1.", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "Jeton importé" - }, "newTotal": { "message": "Nouveau total" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "Pas assez de carburant" }, - "notifications": { - "message": "Notifications" - }, "notifications10ActionText": { "message": "Ouvrir les paramètres", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 Nous simplifions la lisibilité des transactions." }, - "notificationsEmptyText": { - "message": "Rien à voir ici." - }, - "notificationsHeader": { - "message": "Notifications" - }, - "notificationsInfos": { - "message": "Le $1 de $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "Marquer tout comme lu" - }, "numberOfNewTokensDetected": { "message": "$1 nouveaux jetons trouvés dans ce compte", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "Origine" }, - "osTheme": { - "message": "Système" - }, - "padlock": { - "message": "Cadenas" - }, "parameters": { "message": "Paramètres" }, @@ -2435,10 +2371,6 @@ "message": "Consultez l’adresse, le solde du compte et l’activité, et lancez des transactions", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "Fonctionner indéfiniment.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "Contrôlez vos comptes et actifs « $1 ».", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "+ $1 de plus", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "Réseaux personnalisés populaires" - }, "preferredLedgerConnectionType": { "message": "Type de connexion Ledger préféré", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "Vérifiez que vous avez saisi correctement la phrase de récupération secrète avant de continuer. Vous ne pourrez pas annuler cette action." }, - "restartMetamask": { - "message": "Redémarrer MetaMask" - }, "restore": { "message": "Restaurer" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "Envoyer le montant" }, - "sendBugReport": { - "message": "Envoyez-nous un rapport de bogue." - }, "sendSpecifiedTokens": { "message": "Envoyer $1", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "Connectez votre portefeuille directement à votre ordinateur. Déverrouillez votre Ledger et ouvrez l’application Ethereum. Pour en savoir plus sur l’utilisation de votre portefeuille matériel, $1.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "Vous recevez toujours ce message ?" - }, "storePhrase": { "message": "Stockez cette phrase dans un gestionnaire de mots de passe comme 1Password." }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "Vous pouvez toujours faire un swap de tokens, même si les transactions intelligentes ne sont pas disponibles." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "Soumission privée de votre Swap..." + "stxPendingFinalizing": { + "message": "Finalisation..." + }, + "stxPendingOptimizingGas": { + "message": "Optimisation des gas fees..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "Soumission publique de votre Swap..." + "stxPendingPrivatelySubmitting": { + "message": "Soumission privée du swap..." }, "stxSubDescription": { "message": "* Avec les transactions intelligentes, votre transaction sera soumise plusieurs fois en privé. Si toutes les tentatives échouent, la transaction sera diffusée publiquement pour s’assurer de la réussite de votre swap." @@ -3179,10 +3102,6 @@ "message": "Votre $1 est maintenant disponible.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "Le Swap sera effectué dans <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "Simulez les transactions avant de les soumettre pour réduire les coûts et les échecs de transaction." }, @@ -3261,6 +3180,10 @@ "message": "Aucun jeton disponible correspondant à $1", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "Swap terminé dans <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "Confirmez avec votre portefeuille matériel" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "Le glissement doit être supérieur ou égal à zéro" }, - "swapSlippagePercent": { - "message": "$1 %", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "Source de liquidité" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "Symbole du jeton" }, - "tokensFoundTitle": { - "message": "$1 nouveaux jetons trouvés", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "Je comprends" }, @@ -3804,9 +3719,6 @@ "message": "Nous avons eu des difficultés à nous connecter à votre $1. Essayez de vérifier votre $2 et réessayez.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "Impossible de démarrer MetaMask. Cette erreur peut être occasionnelle, essayez donc de redémarrer lextension." - }, "troubleTokenBalances": { "message": "Nous avons eu du mal à charger votre balance de jetons, vous pouvez la consulter ici :", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "Entrez votre mot de passe" }, - "typeYourSRP": { - "message": "Saisissez votre phrase secrète de récupération" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "Ce réseau personnalisé n’est pas reconnu. Nous vous recommandons de $1 avant de continuer", "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": "vérifier les détails du réseau", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "L’envoi de jetons collectibles (ERC-721) n’est pas pris en charge actuellement", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "Portefeuille créé avec succès" }, - "warning": { - "message": "Avertissement" - }, "weak": { "message": "Faible" }, diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index 9bfd09d99abe..1a9b8a265122 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -140,7 +140,7 @@ "message": "רכישת את'ר עם Wyre" }, "buyWithWyreDescription": { - "message": "Wyre מאפשרת לך להשתמש בכרטיס אשראי כדי להפקיד $1 ישירות בחשבון ה-MetaMask שלך." + "message": "Wyre מאפשרת לך להשתמש בכרטיס אשראי כדי להפקיד ETH ישירות בחשבון ה-MetaMask שלך." }, "bytes": { "message": "בייטים" diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 2d643f1aa13b..1b55a7c66bf8 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -62,13 +62,6 @@ "message": "$1 एक्सेस कर सकता है और इस एसेट को खर्च कर सकता है", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "अपने गुप्त रिकवरी वाक्यांश का इस्तेमाल कर अपने वॉलेट तक पहुंच प्राप्त करें" - }, - "accessYourWalletWithSRPDescription": { - "message": "मेटामास्क आपका पासवर्ड रिकवर नहीं कर सकता। हम आपके स्वामित्व को मान्य करने, आपके वॉलेट को रीस्टोर करने और एक नया पासवर्ड सेट करने के लिए आपके गुप्त रिकवरी वाक्यांश का उपयोग करेंगे। सबसे पहले, अपना वह गुप्त रिकवरी वाक्यांश दर्ज करें जिसे आपको अपना बटुआ बनाते समय दिया गया था। $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "आपके कैमरे तक पहुँच रहा है..." }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "नेटवर्क जोड़ें" }, - "addNetworkTooltipWarning": { - "message": "यह नेटवर्क कनेक्शन तृतीय पक्षों पर निर्भर करता है। यह कनेक्शन संभवतः कम विश्वसनीय है या तृतीय-पक्षों को एक्टिविटी को ट्रैक करने में सक्षम कर सकता है। $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "सुझाए गए टोकन जोड़ें" }, @@ -411,14 +400,6 @@ "message": "$1 खरीदें", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "कॉइनबेस पे से $1 खरीदें", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "अपने कॉइनबेस अकाउंट के साथ आप क्रिप्टो को आसानी से खरीद या ट्रांसफर कर सकते हैं।", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "MoonPay से $1 खरीदें", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Wyre के जरिए $1 खरीदें" + "message": "Wyre के जरिए ETH खरीदें" }, "buyWithWyreDescription": { - "message": "Wyre आपको अपने MetaMask खाते में $1 जमा करने के लिए डेबिट कार्ड का उपयोग करने की सुविधा देता है।" + "message": "Wyre आपको अपने MetaMask खाते में ETH जमा करने के लिए डेबिट कार्ड का उपयोग करने की सुविधा देता है।" }, "bytes": { "message": "बाइट" @@ -466,6 +447,9 @@ "message": "किसी लेनदेन को $1 करने के लिए गैस शुल्क में कम से कम 10% की वृद्धि की जानी चाहिए ताकि उसे नेटवर्क द्वारा मान्यता मिल सके।", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "स्वैप रद्द करें" + }, "cancellationGasFee": { "message": "रद्दीकरण गैस शुल्क" }, @@ -622,9 +606,6 @@ "continue": { "message": "जारी रखें" }, - "continueToCoinbasePay": { - "message": "कॉइनबेस-पे पर जारी रहें" - }, "continueToMoonPay": { "message": "MoonPay के लिए जारी रखें" }, @@ -1244,10 +1225,6 @@ "message": "सभी Flask के API प्रयोगात्मक हैं। उन्हें बिना किसी सूचना के बदला या हटाया जा सकता है, या वो स्थायी MetaMask में माइग्रेट किए बिना अनिश्चित काल तक Flask पर रह सकते हैं। अपने जोखिम पर उनका उपयोग करें।", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Flask का उपयोग करते समय अपने नियमित MetaMask एक्सटेंशन को निष्क्रिय करना अवश्य सुनिश्चित करें।", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "जोख़िमों को मैं स्वीकर करता हूं।", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "छिपाएं" }, - "hideFullTransactionDetails": { - "message": "लेन-देन की पूर्ण जानकारी छिपा कर रखें" - }, "hideSeedPhrase": { "message": "सीड फ्रेज़ छुपा दें" }, @@ -1471,12 +1445,6 @@ "history": { "message": "इतिहास" }, - "ignoreAll": { - "message": "सभी को अनदेखा करें" - }, - "ignoreTokenWarning": { - "message": "यदि आप टोकन छिपाते हैं, तो वे आपके वॉलेट में नहीं दिखाए जाएंगे। हालांकि, आप अभी भी उन्हें खोज कर जोड़ सकते हैं।" - }, "import": { "message": "आयात करें", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "वॉलेट आयात करें" }, - "importWithCount": { - "message": "$1 इम्पोर्ट करें", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "गुप्त रिकवरी फ्रेज का उपयोग करके अपने मौजूदा वॉलेट को आयात करें" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "लेवल ऐरो" }, - "lightTheme": { - "message": "हल्की" - }, "likeToImportTokens": { "message": "क्या आप इन टोकन को इंपोर्ट करना चाहते हैं?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "MetaMask को बेहतर बनाने के लिए 6M+ उपयोगकर्ताओं से जुड़ें" }, + "mismatchedChain": { + "message": "इस चेन ID के लिए नेटवर्क विवरण हमारे रिकॉर्ड से मेल नहीं खाता। हम अनुशंसा करते हैं कि आप आगे बढ़ने से पहले $1।", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "नेटवर्क विवरण सत्यापित करें", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "MetaMask पर नए हैं?" }, - "newTokensImportedMessage": { - "message": "आपने सफलतापूर्वक $1 इम्पोर्ट कर लिया है।", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "टोकन इम्पोर्ट हो गया" - }, "newTotal": { "message": "नया कुलयोग" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "पर्याप्त गैस नहीं" }, - "notifications": { - "message": "सूचनाएं" - }, "notifications10ActionText": { "message": "सेटिंग्स में जाएं", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 हम लेन-देन को पढ़ना आसान बना रहे हैं।" }, - "notificationsEmptyText": { - "message": "यहाँ देखने के लिए कुछ नहीं है।" - }, - "notificationsHeader": { - "message": "सूचनाएं" - }, - "notificationsInfos": { - "message": "$1 से $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "सभी को पढ़ा हुआ मार्क करें" - }, "numberOfNewTokensDetected": { "message": "इस खाते में $1 के नए टोकन पाए गए", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "उत्पत्ति" }, - "osTheme": { - "message": "सिस्टम" - }, - "padlock": { - "message": "पैडलॉक" - }, "parameters": { "message": "पैरामीटर" }, @@ -2435,10 +2371,6 @@ "message": "पता, खाते की शेषराशि, गतिविधि देखें और लेन-देन शुरू करें", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "अनिश्चित काल तक चलाएं।", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "आपके \"$1\" अकाउंट्स और एसेट्स नियंत्रित करें।", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "+ $1 अधिक", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "लोकप्रिय कस्टम नेटवर्क" - }, "preferredLedgerConnectionType": { "message": "वरीयता वाले लेजर कनेक्शन के प्रकार", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "आगे बढ़ने से पहले ये सुनिश्चित करें कि आप सही सीक्रेट रिकवरी फ़्रेज़ का इस्तेमाल कर रहे हैं। इसे आप अनडू नहीं कर पाएंगे।" }, - "restartMetamask": { - "message": "मेटामास्क को पुनरारंभ करें" - }, "restore": { "message": "पुनर्स्थापित करें" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "राशि भेजें" }, - "sendBugReport": { - "message": "हमें एक बग रिपोर्ट भेजें।" - }, "sendSpecifiedTokens": { "message": "$1 भेजें", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "अपने वॉलेट को सीधे अपने कंप्यूटर से कनेक्ट करें। अपने Ledger को अनलॉक करें और Ethereum ऐप खोलें। अपने हार्डवेयर वॉलेट डिवाइस के उपयोग के बारे में अधिक जानकारी के लिए, $1।", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "अभी भी यह संदेश मिल रहा है?" - }, "storePhrase": { "message": "इस फ्रेज को 1Password जैसे किसी पासवर्ड मैनेजर में संग्रहीत करें।" }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "स्मार्ट लेनदेन अनुपलब्ध होने पर भी आप अपने टोकनों को स्वैप कर सकते हैं।" }, - "stxPendingPrivatelySubmittingSwap": { - "message": "आपका स्वैप निजी रूप से भेजा जा रहा है..." + "stxPendingFinalizing": { + "message": "फ़ाइनलाइज़ कर रहा है..." + }, + "stxPendingOptimizingGas": { + "message": "गैस ऑप्टिमाइज़ कर रहा है..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "आपका स्वैप सार्वजनिक रूप से भेजा जा रहा है..." + "stxPendingPrivatelySubmitting": { + "message": "स्वैप को निजी तौर पर सबमिट कर रहा है..." }, "stxSubDescription": { "message": "* स्मार्ट लेनदेन आपके लेनदेन को निजी तौर पर, अनेक बार जमा करने का प्रयास करेंगे। यदि सभी प्रयास विफल हो जाते हैं, तो लेनदेन को सार्वजनिक रूप से प्रसारित किया जाएगा ताकि यह सुनिश्चित हो सके कि आपका स्वैप सफलतापूर्वक पूरा हो।" @@ -3179,10 +3102,6 @@ "message": "आपका $1 अब उपलब्ध है।", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "स्वैप < में पूरा होगा", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "लेनदेन की लागतें घटाने और विफलताओं को कम करने के लिए सबमिट करने से पहले लेनदेन को सिम्युलेट करें।" }, @@ -3261,6 +3180,10 @@ "message": "$1 के मिलान वाले कोई भी टोकन उपलब्ध नहीं हैं", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "स्वैप पूरा होगा <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "अपने हार्डवेयर वॉलेट से पुष्टि करें" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "स्लिपेज शून्य से अधिक या बराबर होना चाहिए" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "चलनिधि का स्रोत" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "टोकन का प्रतीक" }, - "tokensFoundTitle": { - "message": "$1 नए टोकन मिले", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "मैं समझता हूं" }, @@ -3804,9 +3719,6 @@ "message": "हमें आपके $1 से कनेक्ट करने में परेशानी हुई, $2 की समीक्षा करने का प्रयास करें और दोबारा कोशिश करें।", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "मेटामास्क को शुरू करने में दिक्कत हुई। यह त्रुटि रुक-रुक कर हो सकती है, इसलिए एक्सटेंशन को पुनरारंभ करने का प्रयास करें।" - }, "troubleTokenBalances": { "message": "हमें आपके टोकन की शेषराशि लोड करने में परेशानी हुई। आप उन्हें देख सकते हैं ", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "अपना MetaMask पासवर्ड टाइप करें" }, - "typeYourSRP": { - "message": "अपना गुप्त रिकवरी वाक्यांश लिखें" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "यह कस्टम नेटवर्क पहचाना नहीं गया है। हम अनुशंसा करते हैं कि आप आगे बढ़ने से पहले $1", "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": "नेटवर्क विवरण सत्यापित करें", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "वर्तमान में संग्रहणीय (ERC-721) टोकन भेजना समर्थित नहीं है", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "वॉलेट का निर्माण सफल हुआ" }, - "warning": { - "message": "चेतावनी" - }, "weak": { "message": "कमज़ोर" }, diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index 551b1f15aa21..49c2704063f4 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -137,10 +137,10 @@ "message": "Vaš se preglednik ne podržava..." }, "buyWithWyre": { - "message": "Kupi $1 Wyerom" + "message": "Kupi ETH Wyerom" }, "buyWithWyreDescription": { - "message": "Wyreom vam se omogućava korištenje kreditnom karticom za polaganje $1 -a izravno na vaš račun za MetaMask." + "message": "Wyreom vam se omogućava korištenje kreditnom karticom za polaganje ETH-a izravno na vaš račun za MetaMask." }, "bytes": { "message": "Bajtovi" diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index 590b77f86e22..10f60bba47c6 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -137,7 +137,7 @@ "message": "Az ön böngészője nem támogatott..." }, "buyWithWyre": { - "message": "Vásároljon $1 -t a Wyre-rel" + "message": "Vásároljon ETH-t a Wyre-rel" }, "buyWithWyreDescription": { "message": "A Wyre segítségével egyensen a MetaMaks fiókjában tehet letétbe ETH-t." diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 83c6ea82d6e2..f7109be0ddfb 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -62,13 +62,6 @@ "message": "$1 dapat mengakses dan membelanjakan aset ini", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "Akses dompet Anda dengan Frasa Pemulihan Rahasia" - }, - "accessYourWalletWithSRPDescription": { - "message": "MetaMask tidak dapat memulihkan kata sandi Anda. Kami akan menggunakan Frasa Pemulihan Rahasia untuk memvalidasi kepemilikan Anda, memulihkan dompet Anda, dan mengatur kata sandi baru. Pertama, masukkan Frasa Pemulihan Rahasia yang diberikan saat membuat dompet. $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "Mengakses kamera Anda..." }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "Tambahkan Jaringan" }, - "addNetworkTooltipWarning": { - "message": "Koneksi jaringan ini mengandalkan pihak ketiga. Koneksi ini mungkin kurang bisa diandalkan atau memungkinkan pihak ketiga melacak aktivitas. $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "Tambahkan Token yang Disarankan" }, @@ -411,14 +400,6 @@ "message": "Beli $1", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Beli $1 melalui Coinbase Pay", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Anda dapat dengan mudah membeli atau mentransfer kripto dengan akun Coinbase Anda.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "Beli $1 melalui MoonPay", "description": "$1 represents the cypto symbol to be purchased" @@ -435,7 +416,7 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Beli $1 dengan Wyre" + "message": "Beli ETH dengan Wyre" }, "buyWithWyreDescription": { "message": "Wyre memungkinkan Anda menggunakan kartu debit untuk menyetorkan ETH langsung di akun MetaMask Anda." @@ -466,6 +447,9 @@ "message": "Untuk $1 suatu transaksi, biaya gas harus dinaikkan minimal 10% agar dapat dikenali oleh jaringan.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "Batalkan pertukaran" + }, "cancellationGasFee": { "message": "Biaya Pembatalan Gas" }, @@ -622,9 +606,6 @@ "continue": { "message": "Lanjutkan" }, - "continueToCoinbasePay": { - "message": "Lanjutkan ke Coinbase Pay" - }, "continueToMoonPay": { "message": "Lanjutkan ke MoonPay" }, @@ -650,7 +631,7 @@ "message": "Interaksi Kontrak" }, "convertTokenToNFTDescription": { - "message": "Kami mendeteksi bahwa aset ini merupakan NFT. Kini MetaMask memiliki dukungan asli penuh untuk NFT. Anda ingin menghapusnya dari daftar token dan menambahkannya sebagai NFT?" + "message": "Kami mendeteksi bahwa aset ini merupakan NFT. Kini Metamask memiliki dukungan asli penuh untuk NFT. Anda ingin menghapusnya dari daftar token dan menambahkannya sebagai NFT?" }, "convertTokenToNFTExistDescription": { "message": "Kami mendeteksi bahwa aset ini telah ditambahkan sebagai NFT. Anda ingin menghapusnya dari daftar token?" @@ -1244,10 +1225,6 @@ "message": "Semua API Flask bersifat eksperimental. API dapat diubah atau dihapus tanpa pemberitahuan, atau tetap berada di Flask tanpa batas waktu dan tanpa pernah dimigrasikan ke MetaMask yang stabil. Gunakan API dengan risiko Anda sendiri.", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Pastikan untuk menonaktifkan ekstensi MetaMask reguler Anda saat menggunakan Flask.", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "Saya menerima risikonya", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "Sembunyikan" }, - "hideFullTransactionDetails": { - "message": "Sembunyikan detail transaksi lengkap" - }, "hideSeedPhrase": { "message": "Sembunyikan frasa seed" }, @@ -1471,12 +1445,6 @@ "history": { "message": "Riwayat" }, - "ignoreAll": { - "message": "Abaikan semua" - }, - "ignoreTokenWarning": { - "message": "Jika Anda menyembunyikan token, token tersebut tidak akan ditampilkan di dompet Anda. Namun, Anda masih dapat menambahkannya dengan mencarinya." - }, "import": { "message": "Impor", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "Impor dompet" }, - "importWithCount": { - "message": "Impor $1", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "Impor dompet Anda yang ada menggunakan Frasa Pemulihan Rahasia" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "panah tingkat" }, - "lightTheme": { - "message": "Terang" - }, "likeToImportTokens": { "message": "Apakah Anda ingin menambahkan token ini?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "Bergabunglah bersama 6 Jt+ pengguna untuk meningkatkan MetaMask" }, + "mismatchedChain": { + "message": "Detail jaringan untuk ID rantai ini tidak cocok dengan catatan kami. Kami menyarankan agar Anda $1 sebelum melanjutkan.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "memverifikasi detail jaringan", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "Baru menggunakan MetaMask?" }, - "newTokensImportedMessage": { - "message": "Anda berhasil mengimpor $1.", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "Token diimpor" - }, "newTotal": { "message": "Total Baru" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "Gas Tidak Cukup" }, - "notifications": { - "message": "Notifikasi" - }, "notifications10ActionText": { "message": "Lihat di pengaturan", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": ".👓 Kami membuat transaksi lebih mudah untuk dibaca." }, - "notificationsEmptyText": { - "message": "Tak ada yang bisa dilihat di sini." - }, - "notificationsHeader": { - "message": "Notifikasi" - }, - "notificationsInfos": { - "message": "$1 dari $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "Tandai semua telah dibaca" - }, "numberOfNewTokensDetected": { "message": "$1 token baru ditemukan di akun ini", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "Asal" }, - "osTheme": { - "message": "Sistem" - }, - "padlock": { - "message": "Gembok" - }, "parameters": { "message": "Parameter" }, @@ -2435,10 +2371,6 @@ "message": "Lihat alamat, saldo akun, aktivitas, dan mulai transaksi", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "Operasikan sepanjang waktu.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "Kontrol akun dan aset \"$1\" Anda.", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "+ $1 lagi", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "Jaringan khusus populer" - }, "preferredLedgerConnectionType": { "message": "Jenis Koneksi Ledger Pilihan", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "Pastikan Anda menggunakan Frasa Pemulihan Rahasia yang benar sebelum melanjutkan. Anda tidak dapat membatalkan tindakan ini." }, - "restartMetamask": { - "message": "Mulai ulang MetaMask" - }, "restore": { "message": "Pulihkan" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "Kirim Jumlah" }, - "sendBugReport": { - "message": "Kirimi kami laporan bug." - }, "sendSpecifiedTokens": { "message": "Kirim $1", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "Hubungkan dompet Anda langsung ke komputer. Buka Ledger dan buka aplikasi Ethereum. Untuk selengkapnya seputar penggunaan perangkat dompet perangkat keras Anda, $1.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "Masih menerima pesan ini?" - }, "storePhrase": { "message": "Simpan frasa ini dalam pengelola kata sandi seperti 1Password." }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "Anda masih bisa menukar token meskipun Transaksi Pintar tidak tersedia." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "Kirimkan Swap Anda secara pribadi..." + "stxPendingFinalizing": { + "message": "Menyelesaikan..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "Kirimkan Swap Anda secara publik..." + "stxPendingOptimizingGas": { + "message": "Mengoptimalkan gas..." + }, + "stxPendingPrivatelySubmitting": { + "message": "Mengirimkan Pertukaran secara pribadi..." }, "stxSubDescription": { "message": "* Transaksi Pintar akan mencoba mengirimkan transaksi Anda secara pribadi, beberapa kali. Jika semua upaya gagal, transaksi akan disiarkan secara publik untuk memastikan Pertukaran telah berhasil dilakukan." @@ -3179,10 +3102,6 @@ "message": "$1 kini telah tersedia.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "Swap akan selesai dalam <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "Simulasikan transaksi sebelum dikirim untuk mengurangi biaya transaksi dan mengurangi kegagalan." }, @@ -3261,6 +3180,10 @@ "message": "Tidak ada token yang cocok yang tersedia $1", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "Pertukaran selesai di <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "Konfirmasikan dengan dompet perangkat keras Anda" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "Slippage harus lebih besar atau sama dengan nol" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "Sumber likuiditas" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "Simbol Token" }, - "tokensFoundTitle": { - "message": "$1 token baru ditemukan", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "Saya paham" }, @@ -3804,9 +3719,6 @@ "message": "Kami mengalami masalah saat mencoba terhubung ke $1 Anda, tinjau kembali $2 dan coba lagi.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "MetaMask mengalami masalah saat memulai. Kesalahan ini dapat terjadi berselang, coba mulai ulang ekstensi." - }, "troubleTokenBalances": { "message": "Kami mengalami masalah saat memuat saldo token Anda. Anda dapat melihatnya ", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "Ketikkan kata sandi MetaMask Anda" }, - "typeYourSRP": { - "message": "Ketik Frasa Pemulihan Rahasia" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "Jaringan kustom ini tidak dikenali. Kami menyarankan agar Anda $1 sebelum melanjutkan", "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": "memverifikasi detail jaringan", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "Tidak mendukung pengiriman token koleksi (ERC-721) untuk saat ini", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "Dompet berhasil dibuat" }, - "warning": { - "message": "Peringatan" - }, "weak": { "message": "Lemah" }, diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index 9f6f93e56e23..faaa3079f5bf 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -189,10 +189,10 @@ "message": "Compra" }, "buyWithWyre": { - "message": "Compra $1 con Wyre" + "message": "Compra ETH con Wyre" }, "buyWithWyreDescription": { - "message": "Wyre ti consente di usare la carta di credito per depositare $1 direttamente nel tuo account MetaMask." + "message": "Wyre ti consente di usare la carta di credito per depositare ETH direttamente nel tuo account MetaMask." }, "canToggleInSettings": { "message": "Puoi riabilitare questa notifica in Impostazioni -> Avvisi." diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index bf140ebfd67e..302b7f7c4f7d 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -62,13 +62,6 @@ "message": "$1 はこのアセットにアクセスし、使用できます", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "秘密のリカバリーフレーズでウォレットにアクセス" - }, - "accessYourWalletWithSRPDescription": { - "message": "MetaMaskはユーザーのパスワードを復元できません。代わりに秘密のリカバリーフレーズを使用して所有者を確認し、ウォレットを復元して新しいパスワードを設定します。まずはじめに、ウォレットの作成時に提供された秘密のリカバリーフレーズを入力してください。$1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "カメラにアクセス中..." }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "ネットワークを追加" }, - "addNetworkTooltipWarning": { - "message": "このネットワーク接続はサードパーティに依存しているため、信頼性が低かったり、サードパーティによるアクティビティの追跡が可能になる可能性があります。$1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "推奨されたトークンを追加" }, @@ -411,14 +400,6 @@ "message": "$1 を購入", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Coinbase Pay で $1 を購入", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Coinbase アカウントで簡単に仮想通貨を購入または送金できます。", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "MoonPay で $1 を購入", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Wyreで $1 を購入" + "message": "WyreでETHを購入" }, "buyWithWyreDescription": { - "message": "Wyreを使用すると、デビット カードを使用して、$1 をMetaMaskアカウントに直接デポジットできます。" + "message": "Wyreを使用すると、デビット カードを使用して、ETHをMetaMaskアカウントに直接デポジットできます。" }, "bytes": { "message": "バイト" @@ -466,6 +447,9 @@ "message": "トランザクションを$1するには、ネットワークに認識されるようにガス代を 10% 以上増額する必要があります。", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "スワップをキャンセル" + }, "cancellationGasFee": { "message": "キャンセルのガス代" }, @@ -622,9 +606,6 @@ "continue": { "message": "続行" }, - "continueToCoinbasePay": { - "message": "Coinbase Pay に進む" - }, "continueToMoonPay": { "message": "MoonPay に進む" }, @@ -1244,10 +1225,6 @@ "message": "Flask API はすべて実験的なものです。これらは通知なしに変更または削除される可能性があり、安定した MetaMask に移行することなく永久に Flask に残る可能性もあります。自己責任でご使用ください。", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Flask の使用中は、通常の MetaMask 拡張機能を無効にしてください。", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "リスクを受け入れる", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "非表示" }, - "hideFullTransactionDetails": { - "message": "完全なトランザクション情報を非表示" - }, "hideSeedPhrase": { "message": "シードフレーズを非表示" }, @@ -1471,12 +1445,6 @@ "history": { "message": "履歴" }, - "ignoreAll": { - "message": "すべて無視" - }, - "ignoreTokenWarning": { - "message": "トークンを非表示にするとウォレットに表示されなくなりますが、検索して追加することはできます。" - }, "import": { "message": "インポート", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "ウォレットをインポート" }, - "importWithCount": { - "message": "$1 をインポート", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "シークレットリカバリーフレーズを使用して既存のウォレットをインポート" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "水平矢印" }, - "lightTheme": { - "message": "ライト" - }, "likeToImportTokens": { "message": "これらのトークンを追加しますか?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "6百万人以上のユーザーと共に、MetaMaskの改善にご協力ください" }, + "mismatchedChain": { + "message": "このチェーンIDのネットワーク詳細が、レコードと一致しません。続行する前に$1をお勧めします。", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "ネットワークの詳細の確認", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "MetaMaskを初めてご利用の場合" }, - "newTokensImportedMessage": { - "message": "$1 をインポートしました。", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "トークンがインポートされました" - }, "newTotal": { "message": "新しい総額" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "ガスが不足しています" }, - "notifications": { - "message": "通知" - }, "notifications10ActionText": { "message": "設定に移動", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 トランザクションが読みやすくなりました。" }, - "notificationsEmptyText": { - "message": "ここに表示する内容はありません。" - }, - "notificationsHeader": { - "message": "通知" - }, - "notificationsInfos": { - "message": "$2 から $1 ", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "すべて既読にする" - }, "numberOfNewTokensDetected": { "message": "$1 の新しいトークンがこのアカウントで見つかりました", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "起点" }, - "osTheme": { - "message": "システム" - }, - "padlock": { - "message": "南京錠" - }, "parameters": { "message": "パラメーター" }, @@ -2435,10 +2371,6 @@ "message": "アドレス、アカウント残高、アクティビティを表示してトランザクションを開始", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "無期限で実行。", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "「$1」アカウントとアセットをコントロールします。", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "他 + $1", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "人気のカスタムネットワーク" - }, "preferredLedgerConnectionType": { "message": "優先Ledger接続タイプ", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "続行する前に、正しい秘密のリカバリーフレーズを使用していることを確認してください。これは元に戻せません。" }, - "restartMetamask": { - "message": "MetaMask を再起動" - }, "restore": { "message": "復元" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "送金額" }, - "sendBugReport": { - "message": "バグレポートをお送りください。" - }, "sendSpecifiedTokens": { "message": "$1を送金", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "コンピューターにウォレットを直接接続します。Ledgerのロックを解除し、イーサリアムアプリを開きます。ハードウェアウォレットデバイスの使い方の詳細については、$1", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "まだこのメッセージが表示されますか?" - }, "storePhrase": { "message": "このフレーズを1Passwordのようなパスワードマネージャーに保存します。" }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "スマートトランザクションが利用できなくても、トークンのスワップは可能です。" }, - "stxPendingPrivatelySubmittingSwap": { - "message": "スワップを非公開で送信中..." + "stxPendingFinalizing": { + "message": "最終処理中..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "スワップを公開で送信中..." + "stxPendingOptimizingGas": { + "message": "ガス代を最適化中..." + }, + "stxPendingPrivatelySubmitting": { + "message": "スワップを非公開で送信中..." }, "stxSubDescription": { "message": "* スマートトランザクションは、非公開でトランザクションのの送信を数回試みます。すべての試みが失敗した場合、スワップが成功するようトランザクションが公開されます。" @@ -3179,10 +3102,6 @@ "message": "$1 が利用可能になりました。", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "スワップ完了まで残り <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "送信前にトランザクションのシミュレーションを行い、トランザクションのコストと失敗率を減らします。" }, @@ -3261,6 +3180,10 @@ "message": "$1と一致するトークンがありません", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "スワップ完了まで <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "ハードウェアウォレットで確定" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "スリッページは0以上でなければなりません。" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "流動性ソース" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "トークンシンボル" }, - "tokensFoundTitle": { - "message": "$1 種類の新しいトークンが見つかりました", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "理解しました" }, @@ -3804,9 +3719,6 @@ "message": "$1に接続できませんでした。$2を確認してから、もう一度実行してください。", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "MetaMask がうまく起動しませんでした。このエラーは断続的に発生する可能性があるため、拡張機能を再起動してみてください。" - }, "troubleTokenBalances": { "message": "トークンバランスのロードに問題があります。トークンバランスを表示できます", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "MetaMaskパスワードを入力してください" }, - "typeYourSRP": { - "message": "秘密のリカバリーフレーズを入力してください" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "このカスタムネットワークは認識されません。続行する前に$1をお勧めします", "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": "ネットワークの詳細の確認", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "コレクティブル (ERC-721) トークンの送信は現在サポートされていません", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "ウォレットが作成されました" }, - "warning": { - "message": "警告" - }, "weak": { "message": "弱" }, @@ -4053,7 +3963,7 @@ "message": "この機能を使用するには、カメラへのアクセスを許可する必要があります。" }, "youSign": { - "message": "署名しています" + "message": "著名しています" }, "yourPrivateSeedPhrase": { "message": "秘密のシークレットリカバリーフレーズ" diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index 762b250c7ff6..1edff554cc06 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -137,10 +137,10 @@ "message": "ನಿಮ್ಮ ಬ್ರೌಸರ್ ಬೆಂಬಲಿಸುತ್ತಿಲ್ಲ..." }, "buyWithWyre": { - "message": "Wyre ನೊಂದಿಗೆ $1 ಖರೀದಿಸಿ" + "message": "Wyre ನೊಂದಿಗೆ ETH ಖರೀದಿಸಿ" }, "buyWithWyreDescription": { - "message": "ನಿಮ್ಮ MetaMask ಖಾತೆಗೆ $1 ಅನ್ನು ಜಮಾ ಮಾಡಲು ಕ್ರೆಡಿಟ್ ಕಾರ್ಡ್ ಬಳಸಲು Wyre ನಿಮಗೆ ಅನುಮತಿಸುತ್ತದೆ." + "message": "ನಿಮ್ಮ MetaMask ಖಾತೆಗೆ ETH ಅನ್ನು ಜಮಾ ಮಾಡಲು ಕ್ರೆಡಿಟ್ ಕಾರ್ಡ್ ಬಳಸಲು Wyre ನಿಮಗೆ ಅನುಮತಿಸುತ್ತದೆ." }, "bytes": { "message": "ಬೈಟ್‌ಗಳು" diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 8a5ba0a7b0c1..6325712eeae6 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -62,13 +62,6 @@ "message": "$1(은)는 이 자산에 접근하여 사용할 수 있습니다", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "비밀 복구 구문으로 지갑에 액세스하세요" - }, - "accessYourWalletWithSRPDescription": { - "message": "MetaMask는 사용자의 비밀번호를 복구할 수 없습니다. 사용자의 비밀 복구 구문을 이용하여 사용자의 소유권을 확인한 후, 지갑을 복구하고 새 비밀번호를 설정해 드립니다. 먼저 지갑을 생성할 때 받은 비밀 복구 구문을 입력하세요. $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "카메라에 접근 중..." }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "네트워크 추가" }, - "addNetworkTooltipWarning": { - "message": "이 네트워크 연결은 타사 서비스를 이용합니다. 연결의 보안이 취약하거나 타사에 연결 내용이 노출될 수 있습니다. $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "추천 토큰 추가" }, @@ -411,14 +400,6 @@ "message": "$1 구매", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Coinbase Pay로 $1 구매", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Coinbase 계정으로 손쉽게 암호화폐를 구매하거나 전송할 수 있습니다.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "문페이(MoonPay)로 $1 구매", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Wyre로 $1 구매" + "message": "Wyre로 ETH 구매" }, "buyWithWyreDescription": { - "message": "Wyre를 사용하면 체크카드를 이용하여 $1 를 MetaMask 계정에 바로 예치할 수 있습니다." + "message": "Wyre를 사용하면 체크카드를 이용하여 ETH를 MetaMask 계정에 바로 예치할 수 있습니다." }, "bytes": { "message": "바이트" @@ -466,6 +447,9 @@ "message": "거래를 $1하려면 가스비를 최소 10%를 인상해야 네트워크에서 인식될 수 있습니다.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "스왑 취소" + }, "cancellationGasFee": { "message": "가스 수수료 취소" }, @@ -622,9 +606,6 @@ "continue": { "message": "계속" }, - "continueToCoinbasePay": { - "message": "Coinbase Pay로 계속하기" - }, "continueToMoonPay": { "message": "문페이로 계속하기" }, @@ -1244,10 +1225,6 @@ "message": "모든 플라스크의 API는 실험 단계입니다. 따라서 예고 없이 변경, 제거되거나 안정적인 MetaMask로 마이그레이션되지 않고 플라스크에 무기한 남아 있을 수 있습니다. 사용 시 위험은 자기 책임입니다.", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Flask를 사용할 때는 정규 MetaMask 익스텐션을 비활성화하세요.", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "본인은 위험을 감수합니다", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "숨기기" }, - "hideFullTransactionDetails": { - "message": "전체 거래 세부정보 숨기기" - }, "hideSeedPhrase": { "message": "시드 구문 숨기기" }, @@ -1471,12 +1445,6 @@ "history": { "message": "기록" }, - "ignoreAll": { - "message": "모두 무시" - }, - "ignoreTokenWarning": { - "message": "토큰을 숨기면 지갑에 표시되지 않습니다. 하지만 이를 검색하여 추가할 수 있습니다." - }, "import": { "message": "가져오기", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "지갑 가져오기" }, - "importWithCount": { - "message": "$1 불러오기", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "비밀 복구 구문을 사용하여 기존 지갑 가져오기" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "수평 화살표" }, - "lightTheme": { - "message": "라이트" - }, "likeToImportTokens": { "message": "이 토큰을 추가할까요?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "6백만 명 이상의 사용자와 함께 MetaMask 기능 향상에 동참하세요." }, + "mismatchedChain": { + "message": "이 체인 ID의 네트워크 세부 정보가 기록과 일치하지 않습니다. 진행하기 전에 $1을(를) 권장합니다.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "네트워크 세부 정보 검증", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "MetaMask가 처음이세요?" }, - "newTokensImportedMessage": { - "message": "$1 토큰을 성공적으로 불러왔습니다.", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "불러온 토큰" - }, "newTotal": { "message": "새 합계" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "가스 부족" }, - "notifications": { - "message": "알림" - }, "notifications10ActionText": { "message": "설정으로 이동하기", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 사용자가 거래를 이해하기 쉽게 도와드립니다." }, - "notificationsEmptyText": { - "message": "표시할 항목이 없습니다." - }, - "notificationsHeader": { - "message": "알림" - }, - "notificationsInfos": { - "message": "$1($2)", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "모두 읽음으로 표시" - }, "numberOfNewTokensDetected": { "message": "계정에서 $1개의 새로운 토큰이 발견됨", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "원본" }, - "osTheme": { - "message": "시스템" - }, - "padlock": { - "message": "패드락" - }, "parameters": { "message": "매개변수" }, @@ -2435,10 +2371,6 @@ "message": "허용되는 계정의 주소 보기(필수)", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "무기한 운용됩니다.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "'$1' 계정과 자산을 통제합니다.", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "+ 그 외 $1개", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "인기 사용자 정의 네트워크" - }, "preferredLedgerConnectionType": { "message": "선호하는 Ledger 연결 유형", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "계속하기 전에 비밀 복구 구문이 정확한지 확인하세요. 이 작업은 취소할 수 없습니다." }, - "restartMetamask": { - "message": "MetaMask 재시작" - }, "restore": { "message": "복구" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "송금" }, - "sendBugReport": { - "message": "버그 리포트 전송" - }, "sendSpecifiedTokens": { "message": "$1 보내기", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "지갑을 컴퓨터에 바로 연결합니다. Ledger를 잠금 해제하고 이더리움 앱을 엽니다. 하드웨어 지갑 장치를 사용하는 방법에 관한 자세한 내용은 $1 링크를 참조하세요.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "아직 이 메시지가 표시되시나요?" - }, "storePhrase": { "message": "이 구문을 1Password 같은 비밀번호 관리자에 저장하세요." }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "스마트 거래를 사용할 수 없을 때도 토큰 스왑은 가능합니다." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "스왑을 비공개로 제출하는 중..." + "stxPendingFinalizing": { + "message": "마무리 중..." + }, + "stxPendingOptimizingGas": { + "message": "가스비 최적화 중..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "스왑을 공개로 제출하는 중..." + "stxPendingPrivatelySubmitting": { + "message": "스왑을 비공개로 제출하는 중..." }, "stxSubDescription": { "message": "*스마트 거래는 비공개로 거래를 제출하기 위해 여러 번 시도할 것입니다. 모든 시도가 실패하면 성공적인 스왑을 위해 거래는 공개적으로 브로드캐스트될 것입니다." @@ -3179,10 +3102,6 @@ "message": "현재 $1(을)를 사용할 수 있습니다.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "스왑 완료까지 남은 시간:", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "제출하기 전에 거래를 시뮬레이션하면 거래 비용을 줄이고 실패율을 낮출 수 있습니다." }, @@ -3261,6 +3180,10 @@ "message": "$1와(과) 일치하는 토큰이 없습니다.", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "스왑 완료까지 남은 시간:", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "하드웨어 지갑으로 확인합니다." }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "슬리패지는 0보다 크거나 같아야 합니다." }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "유동성 소스" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "토큰 기호" }, - "tokensFoundTitle": { - "message": "$1개의 새 토큰을 찾았습니다", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "이해했습니다" }, @@ -3804,9 +3719,6 @@ "message": "$1 연결 도중 문제가 발생했습니다. $2을(를) 검토하고 다시 시도해 보세요.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "MetaMask 실행 중 오류가 발생했습니다. 일시적인 오류일 수 있으니 확장 프로그램을 재시작해 보세요." - }, "troubleTokenBalances": { "message": "토큰 잔액을 로드하는 도중 문제가 발생했습니다. 다음에서 잔액을 확인하세요. ", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "MetaMask 비밀번호를 입력하세요" }, - "typeYourSRP": { - "message": "비밀 복구 구문을 입력하세요" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "이 맞춤형 네트워크는 인식되지 않습니다. 진행하기 전에 $1을(를) 권장합니다.", "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": "네트워크 세부 정보 검증", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "수집 가능한(ERC-721) 토큰 전송은 현재 지원되지 않습니다.", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "지갑 생성 성공" }, - "warning": { - "message": "경고" - }, "weak": { "message": "약함" }, diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index 68dd08edc238..f2866345ce83 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -137,10 +137,10 @@ "message": "Jūsų naršyklė neatpažįstama..." }, "buyWithWyre": { - "message": "Pirkti $1 su „Wyre“" + "message": "Pirkti ETH su „Wyre“" }, "buyWithWyreDescription": { - "message": "„Wyre“ leidžia naudotis kreditine kortele norint įnešti $1 tiesiai į jūsų „MetaMask“ paskyrą." + "message": "„Wyre“ leidžia naudotis kreditine kortele norint įnešti ETH tiesiai į jūsų „MetaMask“ paskyrą." }, "bytes": { "message": "Baitai" diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index 30e65fd68b1e..13233a066c4b 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -137,10 +137,10 @@ "message": "Jūsu pārlūkprogramma netiek atbalstīta..." }, "buyWithWyre": { - "message": "Pirkt $1 ar Wyre" + "message": "Pirkt ETH ar Wyre" }, "buyWithWyreDescription": { - "message": "Wyre ļauj noguldīt $1 tieši jūsu MetaMask kontā, izmantojot kredītkarti." + "message": "Wyre ļauj noguldīt ETH tieši jūsu MetaMask kontā, izmantojot kredītkarti." }, "bytes": { "message": "Baiti" diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index 8923fb8bfcb9..bc42b1bc2c7b 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -137,10 +137,10 @@ "message": "Pelayar anda tidak disokong..." }, "buyWithWyre": { - "message": "Beli $1 dengan Wyre" + "message": "Beli ETH dengan Wyre" }, "buyWithWyreDescription": { - "message": "Wyre membolehkan anda menggunakan kad kredit untuk mendeposit $1 secara terus ke dalam akaun MetaMask anda." + "message": "Wyre membolehkan anda menggunakan kad kredit untuk mendeposit ETH secara terus ke dalam akaun MetaMask anda." }, "bytes": { "message": "Bait" diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 8d1cc1eab29e..ceb83e98285b 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -137,10 +137,10 @@ "message": "Nettleseren din støttes ikke ..." }, "buyWithWyre": { - "message": "Kjøp $1 med Wyre" + "message": "Kjøp ETH med Wyre" }, "buyWithWyreDescription": { - "message": "Wyre lar deg bruke et kredittkort for å sette inn $1 rett på MetaMask-kontoen din." + "message": "Wyre lar deg bruke et kredittkort for å sette inn ETH rett på MetaMask-kontoen din." }, "cancel": { "message": "Avbryt" diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index 9d64198d3b0e..9855e4452367 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -228,10 +228,10 @@ "message": "Bumili" }, "buyWithWyre": { - "message": "Bumili ng $1 gamit ang Wyre" + "message": "Bumili ng ETH gamit ang Wyre" }, "buyWithWyreDescription": { - "message": "Binibigyang-daan ka ng Wyre na gumamit ng debit card para mag-deposit ng $1 sa mismong MetaMask account mo." + "message": "Binibigyang-daan ka ng Wyre na gumamit ng debit card para mag-deposit ng ETH sa mismong MetaMask account mo." }, "bytes": { "message": "Bytes" @@ -1039,6 +1039,10 @@ "metametricsOptInDescription": { "message": "Gustong kunin ng MetaMask ang data ng paggamit para mas maunawaan kung paano ginagamit ng mga user namin ang extension. Gagamitin ang data na ito para patuloy na mapahusay ang kakayahang magamit at karanasan ng user sa paggamit ng produkto namin at Ethereum ecosystem." }, + "mismatchedChain": { + "message": "Ang mga detalye ng network para sa chain ID na ito ay hindi tumutugma sa aming mga record. Inirerekomenda naming $1 ka bago magpatuloy.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "i-verify ang mga detalye ng network", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2157,6 +2161,10 @@ "message": "Hindi kinikilala ang custom na network na ito. Inirerekomenda naming $1 ka bago magpatuloy", "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": "i-verify ang mga detalye ng network", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "updatedWithDate": { "message": "Na-update noong $1" }, diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index 0025ba5fa3ed..d8637876aa8e 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -137,10 +137,10 @@ "message": "Twoja przeglądarka nie jest obsługiwana..." }, "buyWithWyre": { - "message": "Kup $1 poprzez Wyre" + "message": "Kup ETH poprzez Wyre" }, "buyWithWyreDescription": { - "message": "Dzięki Wyre możesz użyć karty kredytowej, aby wpłacić $1 bezpośrednio na swoje konto MetaMask." + "message": "Dzięki Wyre możesz użyć karty kredytowej, aby wpłacić ETH bezpośrednio na swoje konto MetaMask." }, "bytes": { "message": "Bajty" diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index b8b40ee7a01f..8337211df462 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -62,13 +62,6 @@ "message": "$1 pode(m) acessar e usar esse ativo", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "Acesse sua carteira com sua Frase de Recuperação Secreta" - }, - "accessYourWalletWithSRPDescription": { - "message": "A MetaMask não consegue recuperar sua senha. Usaremos sua Frase de Recuperação Secreta para validar sua posse, restaurar sua carteira e definir uma nova senha. Primeiro, insira a Frase de Recuperação Secreta que você recebeu ao criar sua carteira. $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "Acessando sua câmera..." }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "Adicionar rede" }, - "addNetworkTooltipWarning": { - "message": "Esta conexão de rede depende de terceiros. Esta conexão pode ser menos confiável ou permitir que terceiros rastreiem atividades. $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "Adicionar tokens sugeridos" }, @@ -411,14 +400,6 @@ "message": "Comprar $1", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Comprar $1 com o Coinbase Pay", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Você pode comprar ou transferir criptomoedas facilmente com sua conta na Coinbase.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "Compre $1 com o MoonPay", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Comprar $1 com Wyre" + "message": "Comprar ETH com Wyre" }, "buyWithWyreDescription": { - "message": "Com o Wyre, você pode usar um cartão de débito para depositar $1 diretamente na sua conta da MetaMask." + "message": "Com o Wyre, você pode usar um cartão de débito para depositar ETH diretamente na sua conta da MetaMask." }, "bytes": { "message": "Bytes" @@ -466,6 +447,9 @@ "message": "Para $1 uma transação, a taxa de gás deve ser aumentada em pelo menos 10% para que seja reconhecida pela rede.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "Cancelar swap" + }, "cancellationGasFee": { "message": "Taxa de gás por cancelamento" }, @@ -622,9 +606,6 @@ "continue": { "message": "Continuar" }, - "continueToCoinbasePay": { - "message": "Prosseguir para o Coinbase Pay" - }, "continueToMoonPay": { "message": "Continuar para o MoonPay" }, @@ -650,7 +631,7 @@ "message": "Interação com contrato" }, "convertTokenToNFTDescription": { - "message": "Detectamos que esse ativo é um NFT. A MetaMask agora oferece suporte nativo a NFTs. Gostaria de removê-lo da sua lista de tokens e adicioná-lo como NFT?" + "message": "Detectamos que esse ativo é um NFT. A Metamask agora oferece suporte nativo a NFTs. Gostaria de removê-lo da sua lista de tokens e adicioná-lo como NFT?" }, "convertTokenToNFTExistDescription": { "message": "Detectamos que esse ativo foi adicionado como NFT. Deseja removê-lo da sua lista de tokens?" @@ -1244,10 +1225,6 @@ "message": "Todas as APIs do Flask são experimentais. Elas podem ser alteradas ou removidas sem aviso prévio, ou podem permanecer no Flask indefinidamente, sem jamais serem migradas para a MetaMask estável. Use-as com cautela.", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Certifique-se de desativar sua extensão MetaMask regular ao usar o Flask.", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "Eu aceito os riscos", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "Ocultar" }, - "hideFullTransactionDetails": { - "message": "Ocultar detalhes completos da transação" - }, "hideSeedPhrase": { "message": "Ocultar seed phrase (frase de recuperação)" }, @@ -1471,12 +1445,6 @@ "history": { "message": "Histórico" }, - "ignoreAll": { - "message": "Ignorar tudo" - }, - "ignoreTokenWarning": { - "message": "Se você ocultar tokens, eles não serão exibidos em sua carteira. No entanto, você ainda pode pesquisá-los para adicioná-los." - }, "import": { "message": "Importar", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "Importar carteira" }, - "importWithCount": { - "message": "Importar $1", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "Importe sua carteira existente usando uma Frase de Recuperação Secreta" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "seta de nível" }, - "lightTheme": { - "message": "Claro" - }, "likeToImportTokens": { "message": "Gostaria de adicionar estes tokens?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "Junte-se a mais de 6 milhões de usuários para melhorar a MetaMask" }, + "mismatchedChain": { + "message": "Os detalhes da rede para esse ID da cadeia não correspondem aos dos nossos registros. Recomendamos que você $1 antes de continuar.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "verifique os detalhes da rede", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "Novo na MetaMask?" }, - "newTokensImportedMessage": { - "message": "Você importou $1 com sucesso.", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "Token importado" - }, "newTotal": { "message": "Novo total" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "Não há gás suficiente" }, - "notifications": { - "message": "Notificações" - }, "notifications10ActionText": { "message": "Veja em configurações", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 Estamos facilitando a leitura das transações." }, - "notificationsEmptyText": { - "message": "Nada para ver aqui." - }, - "notificationsHeader": { - "message": "Notificações" - }, - "notificationsInfos": { - "message": "$1 de $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "Marcar todas como lidas" - }, "numberOfNewTokensDetected": { "message": "$1 novos tokens encontrados nesta conta", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "Origem" }, - "osTheme": { - "message": "Sistema" - }, - "padlock": { - "message": "Cadeado" - }, "parameters": { "message": "Parâmetros" }, @@ -2435,10 +2371,6 @@ "message": "Ver endereço, saldo da conta, atividade e iniciar transações", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "Executar indefinidamente.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "Controlar suas contas e ativos do \"$1\".", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "E mais $1", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "Redes personalizadas populares" - }, "preferredLedgerConnectionType": { "message": "Tipo de conexão preferencial com o Ledger", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "Certifique-se de usar a frase secreta de recuperação correta antes de prosseguir. Você não poderá desfazer isso." }, - "restartMetamask": { - "message": "Reiniciar a MetaMask" - }, "restore": { "message": "Restaurar" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "Enviar valor" }, - "sendBugReport": { - "message": "Envie-nos um relatório de erros." - }, "sendSpecifiedTokens": { "message": "Enviar $1", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "Conecte sua carteira diretamente ao seu computador. Desbloqueie seu Ledger e abra o aplicativo do Ethereum. Para obter mais informações sobre como usar seu dispositivo de carteira de hardware, $1.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "Ainda está recebendo essa mensagem?" - }, "storePhrase": { "message": "Guarde essa frase em um gerenciador de senhas, como o 1Password." }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "Você ainda pode fazer swap com seus tokens mesmo quando as Transações Inteligentes estiverem indisponíveis." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "Enviando seu swap de forma privada..." + "stxPendingFinalizing": { + "message": "Finalizando..." + }, + "stxPendingOptimizingGas": { + "message": "Otimizando as taxas de gás..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "Enviando seu swap de forma pública..." + "stxPendingPrivatelySubmitting": { + "message": "Enviando a Swap de forma privada..." }, "stxSubDescription": { "message": "* A função de Transações Inteligentes tentará enviar a sua transação várias vezes de forma privada. Se todas as tentativas falharem, a transação será transmitida publicamente para garantir que sua Swap seja realizada com sucesso." @@ -3179,10 +3102,6 @@ "message": "Seu $1 já está disponível.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "O swap será concluído em <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "Simule as transações antes de finalizar para diminuir os custos de transação e reduzir a possibilidade de falhas." }, @@ -3261,6 +3180,10 @@ "message": "Nenhum token disponível correspondente a $1", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "Swap concluído em <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "Confirme com sua carteira de hardware" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "O slippage deve ser maior ou igual a zero" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "Fonte de liquidez" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "Símbolo do Token" }, - "tokensFoundTitle": { - "message": "$1 novos tokens encontrados", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "Eu compreendo" }, @@ -3804,9 +3719,6 @@ "message": "Tivemos dificuldade para conectar-nos à sua $1. Revise $2 e tente novamente.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "A MetaMask teve problemas para iniciar. Esse erro pode ser intermitente, por isso tente reiniciar a extensão." - }, "troubleTokenBalances": { "message": "Tivemos um problema a carregar o balanço dos seus tokens. Pode vê-los em ", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "Digite a sua Palavra-passe" }, - "typeYourSRP": { - "message": "Digite sua Frase de Recuperação Secreta" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "Essa rede personalizada não foi reconhecida. Recomendamos que você $1 antes de continuar", "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": "verifique os detalhes da rede", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "O envio de tokens colecionáveis (ERC-721) não é suportado no momento", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "Carteira criada com sucesso" }, - "warning": { - "message": "Atenção" - }, "weak": { "message": "Fraca" }, diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index 35a8c9b30350..3062c1574fec 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -363,10 +363,10 @@ "message": "Comprar" }, "buyWithWyre": { - "message": "Comprar $1 com Wyre" + "message": "Comprar ETH com Wyre" }, "buyWithWyreDescription": { - "message": "Com o Wyre, você pode usar um cartão de débito para depositar $1 diretamente na sua conta da MetaMask." + "message": "Com o Wyre, você pode usar um cartão de débito para depositar ETH diretamente na sua conta da MetaMask." }, "bytes": { "message": "Bytes" @@ -1627,6 +1627,10 @@ "metametricsTitle": { "message": "Junte-se a mais de 6 milhões de usuários para melhorar a MetaMask" }, + "mismatchedChain": { + "message": "Os detalhes da rede para esse ID da cadeia não correspondem aos dos nossos registros. Recomendamos que você $1 antes de continuar.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "verifique os detalhes da rede", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -3195,6 +3199,10 @@ "message": "Essa rede personalizada não foi reconhecida. Recomendamos que você $1 antes de continuar", "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": "verifique os detalhes da rede", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "O envio de tokens colecionáveis (ERC-721) não é suportado no momento", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index 002236935c12..929bede12e3d 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -137,10 +137,10 @@ "message": "Browserul dvs. nu este compatibil..." }, "buyWithWyre": { - "message": "Cumpărați $1 cu Wyre" + "message": "Cumpărați ETH cu Wyre" }, "buyWithWyreDescription": { - "message": "Wyre vă permite să folosiți un card de credit pentru a depune $1 direct în contul dvs. MetaMask." + "message": "Wyre vă permite să folosiți un card de credit pentru a depune ETH direct în contul dvs. MetaMask." }, "bytes": { "message": "Octeți" diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 16fa10c056e9..c61d7d9a5d64 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -62,13 +62,6 @@ "message": "$1 может получить доступ к этому активу и потратить его", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "Получайте доступ к кошельку с помощью секретной фразы для восстановления" - }, - "accessYourWalletWithSRPDescription": { - "message": "MetaMask не может восстановить ваш пароль. Мы используем вашу cекретную фразу для восстановления, чтобы подтвердить ваше право собственности, восстановить ваш кошелек и установить новый пароль. Сначала введите секретную фразу для восстановления, которую вы получили при создании кошелька. $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "Доступ к камере..." }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "Добавить сеть" }, - "addNetworkTooltipWarning": { - "message": "Это сетевое подключение зависит от третьих сторон. Оно может быть менее надежным или позволять третьим лицам отслеживать активность. $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "Добавить рекомендованные токены" }, @@ -411,14 +400,6 @@ "message": "Купить $1", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Купите $1 с помощью Coinbase Pay", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Вы можете легко купить или перевести криптовалюту с помощью своего счета Coinbase.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "Купить $1 с помощью MoonPay", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Купить $1 с помощью Wyre" + "message": "Купить ETH с помощью Wyre" }, "buyWithWyreDescription": { - "message": "Wyre позволяет использовать дебетовую карту для внесения $1 прямо на ваш счет MetaMask." + "message": "Wyre позволяет использовать дебетовую карту для внесения ETH прямо на ваш счет MetaMask." }, "bytes": { "message": "Байты" @@ -466,6 +447,9 @@ "message": "Чтобы $1 транзакции плата за газ должна быть увеличена как минимум на 10%. Это позволит обеспечить прием транзакции сетью.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "Отменить обмен" + }, "cancellationGasFee": { "message": "Плата за газ при отмене" }, @@ -622,9 +606,6 @@ "continue": { "message": "Продолжить" }, - "continueToCoinbasePay": { - "message": "Перейти на Coinbase Pay" - }, "continueToMoonPay": { "message": "Перейти в MoonPay" }, @@ -650,7 +631,7 @@ "message": "Взаимодействие по контракту" }, "convertTokenToNFTDescription": { - "message": "Мы обнаружили, что этот актив является NFT. MetaMask теперь имеет полную встроенную поддержку NFT. Хотите удалить его из списка токенов и добавить в качестве NFT?" + "message": "Мы обнаружили, что этот актив является NFT. Metamask теперь имеет полную встроенную поддержку NFT. Хотите удалить его из списка токенов и добавить в качестве NFT?" }, "convertTokenToNFTExistDescription": { "message": "Мы обнаружили, что этот актив был добавлен как NFT. Хотите удалить его из списка токенов?" @@ -1244,10 +1225,6 @@ "message": "Все API Flask являются экспериментальными. Они могут быть изменены или удалены без предварительного уведомления или могут оставаться во Flask на неопределенный срок без переноса в стабильную версию MetaMask. Используйте их на свой страх и риск.", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Обязательно отключите свое обычное расширение MetaMask при использовании Flask.", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "Я принимаю риски", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "Скрыть" }, - "hideFullTransactionDetails": { - "message": "Скрыть полную информацию о транзакции" - }, "hideSeedPhrase": { "message": "Скрыть сид-фразу" }, @@ -1471,12 +1445,6 @@ "history": { "message": "История" }, - "ignoreAll": { - "message": "Игнорировать все" - }, - "ignoreTokenWarning": { - "message": "Если вы скроете токены, они не будут отображаться в вашем кошельке. Однако вы все равно можете добавить их, выполнив поиск по ним." - }, "import": { "message": "Импорт", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "Импорт кошелька" }, - "importWithCount": { - "message": "Импортировать $1", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "Импортируйте существующий кошелек, используя начальную секретную фразу восстановления" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "стрелка «уровень»" }, - "lightTheme": { - "message": "Светлая" - }, "likeToImportTokens": { "message": "Вы хотели бы импортировать эти токены?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "Присоединяйтесь к более чем 6 млн пользователей, чтобы улучшить MetaMask" }, + "mismatchedChain": { + "message": "Сведения о сети для этого ID цепочки не совпадают с указанными в записях. Мы рекомендуем $1 до того, как продолжить.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "проверить сведения о сети", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "Впервые в MetaMask?" }, - "newTokensImportedMessage": { - "message": "Вы успешно импортировали $1.", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "Токен импортирован" - }, "newTotal": { "message": "Новая общая сумма" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "Недостаточно газа" }, - "notifications": { - "message": "Уведомления" - }, "notifications10ActionText": { "message": "Смотреть в настройках", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 Мы упрощаем просмотр реквизитов транзакций." }, - "notificationsEmptyText": { - "message": "Здесь не на что смотреть." - }, - "notificationsHeader": { - "message": "Уведомления" - }, - "notificationsInfos": { - "message": "$1 из $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "Отметить все как прочитанные" - }, "numberOfNewTokensDetected": { "message": "$1 новых токена(-ов) найдены в этом аккаунте", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "Источник" }, - "osTheme": { - "message": "Системная" - }, - "padlock": { - "message": "Замок" - }, "parameters": { "message": "Параметры" }, @@ -2435,10 +2371,6 @@ "message": "См. адрес, баланс счета, активность и инициируйте транзакции", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "Выполнять бесконечно.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "Контролируйте свои счета и активы «$1».", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "+ еще $1", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "Популярные пользовательские сети" - }, "preferredLedgerConnectionType": { "message": "Предпочтительный тип подключения к леджеру", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "Прежде чем продолжить, убедитесь, что вы используете правильную секретную фразу восстановления. Вы не сможете отменить это." }, - "restartMetamask": { - "message": "Перезапустить MetaMask" - }, "restore": { "message": "Восстановить" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "Сумма для отправки" }, - "sendBugReport": { - "message": "Отправьте нам сообщение об ошибке." - }, "sendSpecifiedTokens": { "message": "Отправить $1", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "Подключите кошелек напрямую к компьютеру. Разблокируйте леджер и откройте приложение Ethereum. Для получения дополнительной информации об использовании аппаратного кошелька $1.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "Все еще получаете это сообщение?" - }, "storePhrase": { "message": "Сохраните эту фразу в диспетчере паролей, например, в 1Password." }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "Вы по-прежнему можете обменивать свои токены, даже если смарт-транзакции недоступны." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "Приватная отправка вашей операции обмена..." + "stxPendingFinalizing": { + "message": "Завершение..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "Публичная отправка вашей операции обмена..." + "stxPendingOptimizingGas": { + "message": "Оптимизация газа..." + }, + "stxPendingPrivatelySubmitting": { + "message": "Конфиденциальная отправка ооперации обмена..." }, "stxSubDescription": { "message": "* Смарт-транзакции попытаются несколько раз отправить вашу транзакцию в конфиденциальном порядке. Если все попытки не увенчаются успехом, транзакция будет показана публично, чтобы гарантировать успешное завершение вашего обмена." @@ -3179,10 +3102,6 @@ "message": "Ваши $1 уже доступны.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "Обмен завершится через <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "Моделируйте транзакции перед отправкой, чтобы снизить транзакционные издержки и сократить число отказов." }, @@ -3261,6 +3180,10 @@ "message": "Нет доступных токенов, соответствующих $1", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "Обмен завершится через <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "Подтвердите с помощью аппаратного кошелька" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "Проскальзывание должно быть больше нуля или равно нулю" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "Источник ликвидности" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "Символ токена" }, - "tokensFoundTitle": { - "message": "Найдены $1 новых токена(-ов)", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "Я понимаю" }, @@ -3804,9 +3719,6 @@ "message": "Не удалось подключиться к вашему $1, попробуйте проверить $2 и повторите попытку.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "У MetaMask возникли проблемы с запуском. Эта ошибка может быть непостоянной, поэтому попробуйте перезапустить расширение." - }, "troubleTokenBalances": { "message": "У нас возникли проблемы с загрузкой вашего баланса токенов. Вы можете просмотреть их ", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "Введите свой пароль MetaMask" }, - "typeYourSRP": { - "message": "Введите секретную фразу для восстановления" - }, "u2f": { "message": "U2F:", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "Эта пользовательская сеть не распознана. Мы рекомендуем $1, прежде чем продолжить", "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": "проверить сведения о сети", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "Отправка коллекционных активов (ERC-721) сейчас не поддерживается", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "Кошелек создан" }, - "warning": { - "message": "Предупреждение" - }, "weak": { "message": "Слабый" }, diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index 2bfd7e540dcc..b5f1a087f71e 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -131,10 +131,10 @@ "message": "Váš prehliadač nie je podporovaný..." }, "buyWithWyre": { - "message": "Kúpte $1 s Wyre" + "message": "Kúpte ETH s Wyre" }, "buyWithWyreDescription": { - "message": "Wyre vám umožňuje použiť kreditnú kartu na vloženie depozitu $1 priamo na váš účet MetaMask." + "message": "Wyre vám umožňuje použiť kreditnú kartu na vloženie depozitu ETH priamo na váš účet MetaMask." }, "bytes": { "message": "Bajty" diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index c49155135358..8a49c004a919 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -137,10 +137,10 @@ "message": "Vaš brskalnik ni podptrt ..." }, "buyWithWyre": { - "message": "Kupi $1 z Wyre" + "message": "Kupi ETH z Wyre" }, "buyWithWyreDescription": { - "message": "Wyre vam omogoča, da s kreditno kartico nakažete $1 neposredno na svoj račun MetaMask." + "message": "Wyre vam omogoča, da s kreditno kartico nakažete ETH neposredno na svoj račun MetaMask." }, "bytes": { "message": "Bajti" diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index 5ebbd176e554..9f29a6bf553a 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -137,10 +137,10 @@ "message": "Vaš pregledač nije podržan..." }, "buyWithWyre": { - "message": "Kupite $1 preko servisa Wyre" + "message": "Kupite ETH preko servisa Wyre" }, "buyWithWyreDescription": { - "message": "Wyre vam dozvoljava da koristite kreditnu karticu kako biste deponovali $1 pravo na vaš MetaMask nalog." + "message": "Wyre vam dozvoljava da koristite kreditnu karticu kako biste deponovali ETH pravo na vaš MetaMask nalog." }, "bytes": { "message": "Bajtovi" diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index c8d77d1677ed..2e1c5721e176 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -137,10 +137,10 @@ "message": "Din webbläsare stöds inte..." }, "buyWithWyre": { - "message": "Köp $1 med Wyre" + "message": "Köp ETH med Wyre" }, "buyWithWyreDescription": { - "message": "Wyre låter dig använda ett kreditkort för att sätta in $1 direkt på ditt MetaMask-konto." + "message": "Wyre låter dig använda ett kreditkort för att sätta in ETH direkt på ditt MetaMask-konto." }, "cancel": { "message": "Avbryt" diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index 9a060e45ec42..990fd2e43991 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -134,10 +134,10 @@ "message": "Kivinjari chaku hakiwezeshwi..." }, "buyWithWyre": { - "message": "Nunua $1 kwa kutumia Wyre" + "message": "Nunua ETH kwa kutumia Wyre" }, "buyWithWyreDescription": { - "message": "Wyre inakuwezesha kutumia kadi ya benki kuweka $1 moja kwa moja kwenye akaunti yako ya MetaMask." + "message": "Wyre inakuwezesha kutumia kadi ya benki kuweka ETH moja kwa moja kwenye akaunti yako ya MetaMask." }, "cancel": { "message": "Ghairi" diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index 5ed22eaba946..fb3fcb92a20d 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -62,13 +62,6 @@ "message": "$1 maaaring i-access at gamitin ang asset na ito", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "I-access ang iyong wallet gamit ang iyong Secret Recovery Phrase" - }, - "accessYourWalletWithSRPDescription": { - "message": "Hindi mabawi ng MetaMask ang iyong password. Gagamitin namin ang iyong Secret Recovery Phrase upang patunayan ang iyong pagmamay-ari, i-restore ang iyong wallet at mag-set up ng bagong password. Una, ilagay ang Secret Recovery Phrase na ibinigay sa iyo noong ginawa mo ang iyong wallet. $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "Ina-access ang iyong camera..." }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "Magdagdag ng Network" }, - "addNetworkTooltipWarning": { - "message": "Ang koneksyon sa network na ito ay umaasa sa mga third party. Ang koneksyon na ito ay maaaring hindi gaanong maaasahan o binibigyang-daan ang mga third-party na mag-track ng aktibidad. $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "Magdagdag ng Mga Iminumungkahing Token" }, @@ -411,14 +400,6 @@ "message": "Bumili ng $1", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Bumili ng $1 gamit ang Coinbase Pay", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Madali kang makakabili o makakapagtransfer ng crypto gamit ang iyong Coinbase account.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "Bumili ng $1 gamit ang MoonPay", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Bumili ng $1 gamit ang Wyre" + "message": "Bumili ng ETH gamit ang Wyre" }, "buyWithWyreDescription": { - "message": "Madaling onboarding para sa mga pagbili hanggang $ 1000. Mabilis na interactive na high limit na pag-verify ng pagbili. Sinusuportahan ang Debit/Credit Card, Apple Pay, Bank Transfers. Available sa 100+ na mga bansa. Deposito ng mga token sa iyong MetaMask Account" + "message": "Nagbibigay-daan sa iyo ang Wyre na gumamit ng debit card para mag-deposit ng ETH sa mismong MetaMask account mo." }, "bytes": { "message": "Bytes" @@ -466,6 +447,9 @@ "message": "Sa $1 na transaksyon ang singil sa gas ay dapat tumaas nang hindi bababa sa 10% para ito ay makilala ng network.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "Kanselahin ang pagpapalit" + }, "cancellationGasFee": { "message": "Bayarin sa Gasolina para sa Pagkansela" }, @@ -622,9 +606,6 @@ "continue": { "message": "Magpatuloy" }, - "continueToCoinbasePay": { - "message": "Magpatuloy sa Coinbase Pay" - }, "continueToMoonPay": { "message": "Magpatuloy sa MoonPay" }, @@ -650,7 +631,7 @@ "message": "Interaksyon ng Kontrata" }, "convertTokenToNFTDescription": { - "message": "Natukoy namin na ang asset na ito ay isang NFT. Ang MetaMask ay mayroon na ngayong ganap na native support para sa mga NFT. Gusto mo bang alisin ito sa iyong listahan ng token at idagdag ito bilang isang NFT?" + "message": "Natukoy namin na ang asset na ito ay isang NFT. Ang Metamask ay mayroon na ngayong ganap na native support para sa mga NFT. Gusto mo bang alisin ito sa iyong listahan ng token at idagdag ito bilang isang NFT?" }, "convertTokenToNFTExistDescription": { "message": "Napansin namin na naidagdag ang asset na ito bilang NFT. Gusto mo ba itong alisin mula sa listahan ng iyong token?" @@ -1244,10 +1225,6 @@ "message": "Ang lahat ng API ng Flask ay eksperimental. Maaaring baguhin o alisin ang mga ito nang walang abiso, o maaari silang manatili sa Flask nang walang katapusan nang hindi nalilipat sa matatag na MetaMask. Gamitin ang mga ito sa iyong sariling pananagutan.", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Siguraduhing i-disable ang iyong regular na MetaMask extension kapag ginagamit ang Flask.", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "Tinatanggap ko ang mga panganib", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "Itago" }, - "hideFullTransactionDetails": { - "message": "Itago ang buong detalye ng transaksyon" - }, "hideSeedPhrase": { "message": "Itago ang seed phrase" }, @@ -1471,12 +1445,6 @@ "history": { "message": "History" }, - "ignoreAll": { - "message": "Huwag pansinin ang lahat" - }, - "ignoreTokenWarning": { - "message": "Kung itatago mo ang mga token, hindi ipapakita ang mga ito sa iyong wallet. Gayunpaman, maaari mo pa ring idagdag ang mga ito sa pamamagitan ng paghahanap sa kanila." - }, "import": { "message": "Mag-import", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "I-import ang wallet" }, - "importWithCount": { - "message": "Mag-isport ng $1", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "I-import ang iyong kasalukuyang wallet gamit ang isang Secret Recovery Phrase" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "arrow ng level" }, - "lightTheme": { - "message": "Maliwanag" - }, "likeToImportTokens": { "message": "Gusto mo bang idagdag ang mga token na ito?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "Sumali sa 6M+ user upang mapabuti ang MetaMask" }, + "mismatchedChain": { + "message": "Ang mga detalye ng network para sa chain ID na ito ay hindi tumutugma sa aming mga talaan. Inirerekomenda namin na $1 ka bago magpatuloy.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "i-verify ang mga detalye ng network", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "Bago ka ba sa MetaMask?" }, - "newTokensImportedMessage": { - "message": "Matagumpay mong na-import ang $1.", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "Na-import ang token" - }, "newTotal": { "message": "Bagong Kabuuan" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "Hindi Sapat ang Gas" }, - "notifications": { - "message": "Mga Abiso" - }, "notifications10ActionText": { "message": "Bisitahin sa mga setting", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2154,7 +2109,7 @@ "message": "Paganahin ang dark mode" }, "notifications12Description": { - "message": "Nandito na sa wakas ang dark mode sa Extension! Upang i-on ito, pumunta sa Mga Setting -> Eksperimental at pumili ng isa sa mga opsyon sa pagpapakita: Light, Dark, System." + "message": "Pagaganahin ang Dark Mode para sa mga bagong user depende sa kanilang mga kagustuhan sa sistema. Para sa mga kasalukuyang user, manu-manong paganahin ang Dark Mode sa ilalim ng Mga Setting -> Eksperimental." }, "notifications12Title": { "message": "Wen dark mode? Ngayon dark mode! 🕶️🦊" @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 Pinadadali naming mabasa ang mga transaksyon." }, - "notificationsEmptyText": { - "message": "Walang makikita dito." - }, - "notificationsHeader": { - "message": "Mga Abiso" - }, - "notificationsInfos": { - "message": "$1 mula $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "Markahan ang lahat bilang nabasa na" - }, "numberOfNewTokensDetected": { "message": "$1 bagong token ang nakita sa account na ito", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "Pinagmulan" }, - "osTheme": { - "message": "Sistema" - }, - "padlock": { - "message": "Padlock" - }, "parameters": { "message": "Mga Parameter" }, @@ -2435,10 +2371,6 @@ "message": "Tingnan ang mga address, balanse ng account, aktibidad at simulan ang iyong mga transaksyon", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "Patakbuhin ng walang katapusan.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "Kontrolin ang iyong mga account at asset sa \"$1\".", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "+ $1 pa", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "Mga sikat na custom na network" - }, "preferredLedgerConnectionType": { "message": "Napiling Uri ng Ledger Connection", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "Tiyakin na ginagamit mo ang wastong Secret Recovery Phrase bago magpatuloy. Hindi mo na ito maaaring pawalang-bisa." }, - "restartMetamask": { - "message": "I-restart ang MetaMask" - }, "restore": { "message": "I-restore" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "Halaga ng Ipapadala" }, - "sendBugReport": { - "message": "Padalhan kami ng ulat ng bug." - }, "sendSpecifiedTokens": { "message": "Magpadala ng $1", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "Direktang ikonekta ang iyong wallet sa iyong computer. I-unlock ang iyong Ledger at buksan ang Ethereum app. Para sa higit pa sa paggamit ng iyong hardware wallet device, $1.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "Nakukuha pa rin ang mensaheng ito?" - }, "storePhrase": { "message": "I-store ang phrase na ito sa isang password manager gaya ng 1Password." }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "Maaari mo parin papalitan ang iyong mga token kahit na hindi available ang mga Smart Transaction." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "Pribadong isinusumite ang iyong Swap..." + "stxPendingFinalizing": { + "message": "Isinasapinal..." + }, + "stxPendingOptimizingGas": { + "message": "Pinapahusay ang gas..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "Pampublikong isinusumite ang iyong Swap..." + "stxPendingPrivatelySubmitting": { + "message": "Pribadong isinusumite ang Pagpapalit..." }, "stxSubDescription": { "message": "* Susubukan ng mga Smart Transaction na isumite nang pribado ang iyong transaksyon, maraming beses. Kapag nabigo ang lahat ng pagsubok, ipapakita sa publiko ang transaksyon upang matiyak na ang Pagpapalit ay naging matagupay." @@ -3179,10 +3102,6 @@ "message": "Ang iyong $1 ay available na ngayon.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "Matatapos ang Swap sa <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "Gayahin ang mga transaksyon bago isumite upang bumaba ang gastos sa transaksyon at mabawasan ang mga pagkabigo." }, @@ -3261,6 +3180,10 @@ "message": "Walang available na token na tumutugma sa $1", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "Kumpleto na ang pagpapalit sa <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "Kumpirmahin gamit ang iyong hardware wallet" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "Ang slippage ay dapat mas malaki o katumbas ng zero" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "Pinagkunan ng liquidity" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "Simbolo ng Token" }, - "tokensFoundTitle": { - "message": "$1 bagong token ang nakita", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "Nauunawaan ko" }, @@ -3804,9 +3719,6 @@ "message": "Nagkaproblema kami sa pagkonekta sa iyong $1, subukang suriin ang $2 at subukan ulit.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "Nagkaproblema ang MetaMask sa pagsisimula. Maaaring paulit-ulit ang error na ito, kaya subukang i-restart ang extension." - }, "troubleTokenBalances": { "message": "Nagkaproblema kami sa pag-load ng mga balanse ng iyong token. Puwede mong tingnan ang mga iyon ", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "Uri ng password ng iyong MetaMask" }, - "typeYourSRP": { - "message": "I-type ang iyong Secret Recovery Phrase" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "Hindi nakikilala ang custom network na ito. Nirerekomenda namin na ikaw ay $1 bago magpatuloy", "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": "i-verify ang mga detalye ng network", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "Ang pagpapadala ng collectible (ERC-721) token ay kasalukuyang hindi magagamit", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "Matagumpay ang paggawa ng wallet" }, - "warning": { - "message": "Babala" - }, "weak": { "message": "Madali" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 05719bd53a38..df04f15ba167 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -62,13 +62,6 @@ "message": "$1 bu varlığa erişebilir ve harcayabilir", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "Gizli Kurtarma İfadenizle cüzdanınıza erişin" - }, - "accessYourWalletWithSRPDescription": { - "message": "MetaMask parolanızı kurtaramaz. Sahipliğinizi doğrulamak, cüzdanınızı yenilemek ve yeni bir parola belirlemek için Gizli Kurtarma İfadenizi kullanırız. İlk olarak, cüzdanınızı oluştururken size verilmiş olan Gizli Kurtarma İfadenizi girin. $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "Kameranıza erişim sağlanıyor..." }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "Ağ ekle" }, - "addNetworkTooltipWarning": { - "message": "Bu ağ bağlantısı üçüncü taraflara dayalıdır. Bu bağlantı daha az güvenli olabilir veya üçüncü tarafların aktiviteleri takip etmesine olanak sağlayabilir. $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "Önerilen Tokenleri ekle" }, @@ -411,14 +400,6 @@ "message": "$1 satın al", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Coinbase Pay ile 1 USD al", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Coinbase hesabınla kolayca kripto para satın alabilir veya transfer edebilirsin.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "MoonPay ile $1 satın al", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Wyre ile $1 satın al" + "message": "Wyre ile ETH satın al" }, "buyWithWyreDescription": { - "message": "Wyre, doğrudan MetaMask hesabınıza $1 yatırma işlemleri için banka kartı kullanmanıza izin verir." + "message": "Wyre, doğrudan MetaMask hesabınıza ETH yatırma işlemleri için banka kartı kullanmanıza izin verir." }, "bytes": { "message": "Bayt" @@ -466,6 +447,9 @@ "message": "İşlemi $1 için, gaz ücretinin ağ tarafından tanınması amacıyla en az %10 oranında artırılması gerekir.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "Takası iptal et" + }, "cancellationGasFee": { "message": "İptal İşlemi Gaz Ücreti" }, @@ -622,9 +606,6 @@ "continue": { "message": "Devam et" }, - "continueToCoinbasePay": { - "message": "Coinbase Pay'e devam et" - }, "continueToMoonPay": { "message": "MoonPay'e devam et" }, @@ -650,7 +631,7 @@ "message": "Sözleşme Etkileşimi" }, "convertTokenToNFTDescription": { - "message": "Bu varlığın bir NFT olduğunu tespit ettik. MetaMask artık NFT'ler için tam yerel desteğe sahiptir. Bunu token listenden çıkarmak ve bir NFT olarak eklemek ister misin?" + "message": "Bu varlığın bir NFT olduğunu tespit ettik. Metamask artık NFT'ler için tam yerel desteğe sahiptir. Bunu token listenden çıkarmak ve bir NFT olarak eklemek ister misin?" }, "convertTokenToNFTExistDescription": { "message": "Bu varlığın bir NFT olarak eklendiğini tespit ettik. Token listenden çıkarmak ister misin?" @@ -1244,10 +1225,6 @@ "message": "Tüm Flask API'leri deneyseldir. Önceden haber verilmeksizin değiştirilebilir veya kaldırılabilirler ya da kararlı MetaMask'e taşınmadan süresiz olarak Flask'ta kalabilirler. Bunları kendi sorumluluğunda kullan.", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Flask kullanırken normal MetaMask uzantınızı devre dışı bıraktığınızdan emin olun.", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "Riskleri kabul ediyorum", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "Gizle" }, - "hideFullTransactionDetails": { - "message": "Tam işlem bilgilerini gizle" - }, "hideSeedPhrase": { "message": "Tohum ifadesini gizle" }, @@ -1471,12 +1445,6 @@ "history": { "message": "Geçmiş" }, - "ignoreAll": { - "message": "Tümünü yoksay" - }, - "ignoreTokenWarning": { - "message": "Gizlediğiniz tokenler cüzdanınızda gösterilmez. Ancak, yine de onları bulup ekleyebilirsiniz." - }, "import": { "message": "İçe Aktar", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "Cüzdanı içe aktar" }, - "importWithCount": { - "message": "$1 tokeni içe aktar", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "Gizli Kurtarma İfadesi kullanarak mevcut cüzdanınızı içe aktarın" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "seviye oku" }, - "lightTheme": { - "message": "Aydınlık" - }, "likeToImportTokens": { "message": "Bu tokenleri içe aktarmak ister misiniz?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "MetaMask'i geliştirmek için 6 milyondan fazla kullanıcıya katılın" }, + "mismatchedChain": { + "message": "Bu zincir kimliği için ağ ayrıntıları kayıtlarımızla uyumlu değil. Devam etmeden önce şunu yapmanızı öneriyoruz: $1.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "ağ bilgilerini doğrula", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "MetaMask'te yeni misiniz?" }, - "newTokensImportedMessage": { - "message": "$1 tokeni başarılı bir şekilde içe aktardın.", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "Token içe aktarıldı" - }, "newTotal": { "message": "Yeni Toplam" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "Yeterli Gaz Yok" }, - "notifications": { - "message": "Bildirimler" - }, "notifications10ActionText": { "message": "Ayarlarda ziyaret et", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 İşlemlerin okunmasını daha kolay hale getiriyoruz." }, - "notificationsEmptyText": { - "message": "Burada gösterilecek bir şey yok." - }, - "notificationsHeader": { - "message": "Bildirimler" - }, - "notificationsInfos": { - "message": "$1 tarihli bildirim: $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "Tümünü okundu olarak işaretle" - }, "numberOfNewTokensDetected": { "message": "Bu hesapta $1 yeni token bulundu", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "Köken" }, - "osTheme": { - "message": "Sistem" - }, - "padlock": { - "message": "Asma Kilit" - }, "parameters": { "message": "Parametreler" }, @@ -2435,10 +2371,6 @@ "message": "Adrese, hesap bakiyesine, aktiviteye bakın ve işlemleri başlatın", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "Süresiz çalıştır.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "\"$1\" hesaplarını ve varlıklarını kontrol et.", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "+ $1 tane daha", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "Popüler özel ağlar" - }, "preferredLedgerConnectionType": { "message": "Tercih Edilen Kayıt Defteri Bağlantı Türü", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "Devam etmeden önce doğru Gizli Kurtarma İfadesini kullandığından emin ol. Bunu geri alamazsın." }, - "restartMetamask": { - "message": "MetaMask'i yeniden başlat" - }, "restore": { "message": "Geri Yükle" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "Tutarı Gönder" }, - "sendBugReport": { - "message": "Bize bir hata raporu gönder." - }, "sendSpecifiedTokens": { "message": "$1 Gönder", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "Cüzdanınızı doğrudan bilgisayara bağlayın. Kayıt defterinizin kilidini açın ve Ethereum uygulamasını açın. Donanım cüzdanı cihazınızın kullanımı hakkında daha fazla bilgi için $1.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "Bu mesajı almaya devam mı ediyorsun?" - }, "storePhrase": { "message": "Bu ifadeyi 1Password gibi bir parola yöneticisinde saklayın." }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "Akıllı İşlemler kullanılamazken bile token'larını değiştirebilirsin." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "Swap işlemin özel olarak gönderiliyor..." + "stxPendingFinalizing": { + "message": "Sonuçlandırılıyor..." + }, + "stxPendingOptimizingGas": { + "message": "Gas optimize ediliyor..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "Swap işlemin herkese açık olarak gönderiliyor..." + "stxPendingPrivatelySubmitting": { + "message": "Takas özel olarak gönderiliyor..." }, "stxSubDescription": { "message": "* Akıllı İşlemler, işlemini birden çok kez özel olarak göndermeye çalışır. Tüm denemeler başarısız olursa Takas'ının başarılı bir şekilde gerçekleşmesini sağlamak için işlem herkese açık olarak yayınlanacaktır." @@ -3179,10 +3102,6 @@ "message": "$1 artık kullanılabilir.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "Swap işleminin tamamlanmasına kalan süre <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "İşlem maliyetlerini azaltmak ve arızaları azaltmak için göndermeden önce işlemleri simüle et." }, @@ -3261,6 +3180,10 @@ "message": "$1 ile eşleşen token yok", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "Değiştirme işlemi şu süre içinde tamamlandı <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "Donanım cüzdanınızla onaylayın" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "Fark en az sıfır olmalıdır" }, - "swapSlippagePercent": { - "message": "%$1", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "Likidite kaynağı" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "Token Sembolü" }, - "tokensFoundTitle": { - "message": "$1 yeni token bulundu", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "Anladım" }, @@ -3804,9 +3719,6 @@ "message": "$1 ile bağlantı kurmada sorun yaşıyoruz, $2 kısmını inceleyip tekrar deneyin.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "MetaMask başlatılırken bir sorun oldu. Bu hata sürekli bir hata olmayabilir; bu yüzden uzantıyı yeniden başlatmayı dene." - }, "troubleTokenBalances": { "message": "Token bakiyeleriniz yüklenirken sorun yaşadık. Burada görüntüleyebilirsiniz ", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "MetaMask parolanızı girin" }, - "typeYourSRP": { - "message": "Gizli Kurtarma İfadenizi girin" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "Bu özel ağ tanınmadı. Devam etmeden önce $1 öneririz", "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": "ağ bilgilerini doğrula", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "Toplanabilir (ERC-721) tokenlerin gönderilmesi şu anda desteklenmiyor", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "Cüzdan oluşturma başarılı" }, - "warning": { - "message": "Uyarı" - }, "weak": { "message": "Zayıf" }, diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index 2b47cd8d45ef..c2e046eb4016 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -137,10 +137,10 @@ "message": "Ваш браузер не підтримується..." }, "buyWithWyre": { - "message": "Купити $1 через Wyre" + "message": "Купити ETH через Wyre" }, "buyWithWyreDescription": { - "message": "Wyre дає змогу використовувати кредитну картку для внесення валюти $1 безпосередньо у свій гаманець MetaMask." + "message": "Wyre дає змогу використовувати кредитну картку для внесення валюти ETH безпосередньо у свій гаманець MetaMask." }, "bytes": { "message": "Байти" diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index a38862ed5fb6..02eaddd38a02 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -62,13 +62,6 @@ "message": "$1 có thể truy cập và chi tiêu tài sản này", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "Truy cập ví của bạn bằng Cụm từ khôi phục bí mật" - }, - "accessYourWalletWithSRPDescription": { - "message": "MetaMask không thể khôi phục mật khẩu của bạn. Chúng tôi sẽ sử dụng Cụm từ khôi phục bí mật của bạn để xác thực quyền sở hữu, khôi phục ví và thiết lập mật khẩu mới. Trước tiên, hãy nhập Cụm từ khôi phục bí mật mà bạn đã được cấp khi tạo ví. $1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "Đang truy cập máy ảnh..." }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "Thêm mạng" }, - "addNetworkTooltipWarning": { - "message": "Kết nối mạng này dựa vào các bên thứ ba. Kết nối này có thể kém tin cậy hơn hoặc cho phép các bên thứ ba theo dõi hoạt động. $1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "Thêm token được đề xuất" }, @@ -411,14 +400,6 @@ "message": "Mua $1", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "Mua $1 bằng Coinbase Pay", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "Bạn có thể dễ dàng mua hoặc chuyển khoản tiền điện tử bằng tài khoản Coinbase của mình.", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "Mua $1 bằng MoonPay", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "Mua $1 qua Wyre" + "message": "Mua ETH qua Wyre" }, "buyWithWyreDescription": { - "message": "Wyre cho phép bạn dùng thẻ ghi nợ để nạp $1 trực tiếp vào tài khoản MetaMask của mình." + "message": "Wyre cho phép bạn dùng thẻ ghi nợ để nạp ETH trực tiếp vào tài khoản MetaMask của mình." }, "bytes": { "message": "Byte" @@ -466,6 +447,9 @@ "message": "Để $1 một giao dịch, phí gas phải tăng tối thiểu 10% để mạng nhận ra giao dịch này.", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "Hủy hoán đổi" + }, "cancellationGasFee": { "message": "Phí gas hủy" }, @@ -622,9 +606,6 @@ "continue": { "message": "Tiếp tục" }, - "continueToCoinbasePay": { - "message": "Tiếp tục đến Coinbase Pay" - }, "continueToMoonPay": { "message": "Tiếp tục đến MoonPay" }, @@ -650,7 +631,7 @@ "message": "Tương tác với hợp đồng" }, "convertTokenToNFTDescription": { - "message": "Chúng tôi phát hiện tài sản này là một NFT. MetaMask hiện đã hỗ trợ gốc đầy đủ cho NFT. Bạn có muốn xóa tài sản khỏi danh sách token và thêm tài sản dưới dạng NFT không?" + "message": "Chúng tôi phát hiện tài sản này là một NFT. Metamask hiện đã hỗ trợ gốc đầy đủ cho NFT. Bạn có muốn xóa tài sản khỏi danh sách token và thêm tài sản dưới dạng NFT không?" }, "convertTokenToNFTExistDescription": { "message": "Chúng tôi phát hiện tài sản này đã được thêm dưới dạng NFT. Bạn có muốn xóa tài sản khỏi danh sách token không?" @@ -1244,10 +1225,6 @@ "message": "Tất cả các API của Flask đều là thử nghiệm. Chúng có thể bị thay đổi hoặc xóa mà không cần thông báo, hoặc chúng có thể ở trên Flask vô thời hạn mà không bao giờ được chuyển sang phiên bản MetaMask ổn định. Bạn phải tự chịu rủi ro khi sử dụng chúng.", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "Đảm bảo bạn đã tắt tiện ích mở rộng MetaMask thông thường khi sử dụng Flask.", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "Tôi chấp nhận những rủi ro này", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1416,6 @@ "hide": { "message": "Ẩn" }, - "hideFullTransactionDetails": { - "message": "Ẩn chi tiết giao dịch đầy đủ" - }, "hideSeedPhrase": { "message": "Ẩn cụm từ khôi phục bí mật" }, @@ -1471,12 +1445,6 @@ "history": { "message": "Lịch sử" }, - "ignoreAll": { - "message": "Bỏ qua tất cả" - }, - "ignoreTokenWarning": { - "message": "Nếu bạn ẩn token, chúng sẽ không hiển thị trong ví của bạn. Tuy nhiên, bạn vẫn có thể thêm chúng thông qua tìm kiếm." - }, "import": { "message": "Nhập", "description": "Button to import an account from a selected file" @@ -1526,10 +1494,6 @@ "importWallet": { "message": "Nhập ví" }, - "importWithCount": { - "message": "Nhập $1", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "Nhập ví hiện tại của bạn bằng Cụm mật khẩu khôi phục bí mật" }, @@ -1724,9 +1688,6 @@ "levelArrow": { "message": "mũi tên cấp độ" }, - "lightTheme": { - "message": "Sáng" - }, "likeToImportTokens": { "message": "Bạn có muốn nhập những token này không?" }, @@ -1888,6 +1849,10 @@ "metametricsTitle": { "message": "Tham gia cùng hơn 6 Triệu người dùng để cải thiện MetaMask" }, + "mismatchedChain": { + "message": "Thông tin về mạng cho mã chuỗi này không khớp với hồ sơ của chúng tôi. Bạn nên $1 trước khi tiếp tục.", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "xác minh thông tin về mạng", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2001,6 @@ "newToMetaMask": { "message": "Bạn mới sử dụng MetaMask?" }, - "newTokensImportedMessage": { - "message": "Bạn đã nhập thành công $1.", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "Đã nhập token" - }, "newTotal": { "message": "Tổng mới" }, @@ -2125,9 +2083,6 @@ "notEnoughGas": { "message": "Không đủ gas" }, - "notifications": { - "message": "Thông báo" - }, "notifications10ActionText": { "message": "Xem trong cài đặt", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2203,6 @@ "notifications9Title": { "message": "👓 Chúng tôi đang làm cho các giao dịch dễ đọc hơn." }, - "notificationsEmptyText": { - "message": "Không có gì ở đây." - }, - "notificationsHeader": { - "message": "Thông báo" - }, - "notificationsInfos": { - "message": "$1 từ $2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "Đánh dấu đã đọc tất cả" - }, "numberOfNewTokensDetected": { "message": "Tìm thấy $1 token mới trong tài khoản này", "description": "$1 is the number of new tokens detected" @@ -2359,12 +2301,6 @@ "origin": { "message": "Nguồn gốc" }, - "osTheme": { - "message": "Hệ thống" - }, - "padlock": { - "message": "Ổ khóa" - }, "parameters": { "message": "Tham số" }, @@ -2435,10 +2371,6 @@ "message": "Xem địa chỉ, số dư tài khoản, hoạt động và bắt đầu giao dịch", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "Chạy không giới hạn.", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "Kiểm soát các tài khoản và tài sản \"$1\" của bạn.", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2400,6 @@ "message": "+ $1 khác", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "Mạng tùy chỉnh phổ biến" - }, "preferredLedgerConnectionType": { "message": "Dạng Kết Nối Ledger Ưu Tiên", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2574,6 @@ "resetWalletWarning": { "message": "Đảm bảo bạn đang sử dụng đúng Cụm từ khôi phục bí mật trước khi tiếp tục vì bạn sẽ không thể hoàn tác." }, - "restartMetamask": { - "message": "Khởi động lại MetaMask" - }, "restore": { "message": "Khôi phục" }, @@ -2832,9 +2758,6 @@ "sendAmount": { "message": "Gửi khoản tiền" }, - "sendBugReport": { - "message": "Gửi báo cáo lỗi." - }, "sendSpecifiedTokens": { "message": "Gửi $1", "description": "Symbol of the specified token" @@ -3108,9 +3031,6 @@ "message": "Kết nối ví của bạn trực tiếp với máy tính. Mở khóa Ledger của bạn và mở ứng dụng Ethereum. Để biết thêm thông tin về cách sử dụng thiết bị ví cứng của bạn, $1.", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "Vẫn nhận được thông báo này?" - }, "storePhrase": { "message": "Lưu trữ cụm mật khẩu này trong trình quản lý mật khẩu chẳng hạn như 1Password." }, @@ -3163,11 +3083,14 @@ "stxFallbackUnavailable": { "message": "Bạn vẫn có thể hoán đổi token ngay cả khi Giao dịch thông minh không khả dụng." }, - "stxPendingPrivatelySubmittingSwap": { - "message": "Đang bí mật gửi yêu cầu Hoán đổi của bạn..." + "stxPendingFinalizing": { + "message": "Đang hoàn thành..." + }, + "stxPendingOptimizingGas": { + "message": "Đang tối ưu gas..." }, - "stxPendingPubliclySubmittingSwap": { - "message": "Đang công khai gửi yêu cầu Hoán đổi của bạn..." + "stxPendingPrivatelySubmitting": { + "message": "Đang gửi yêu cầu Hoán đổi riêng tư..." }, "stxSubDescription": { "message": "* Giao dịch thông minh sẽ cố gắng gửi giao dịch của bạn nhiều lần theo cách riêng tư. Nếu tất cả các lần thử đều không thành công, giao dịch sẽ được phát công khai để đảm bảo Hoán đổi của bạn được thực hiện thành công." @@ -3179,10 +3102,6 @@ "message": "$1 của bạn hiện đã có sẵn.", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "Hoán đổi sẽ hoàn tất sau <", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "Mô phỏng giao dịch trước khi gửi để giảm chi phí giao dịch và tỷ lệ thất bại." }, @@ -3261,6 +3180,10 @@ "message": "Không có token nào khớp với $1", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "Hoán đổi xong sau <", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "Xác nhận ví cứng của bạn" }, @@ -3442,10 +3365,6 @@ "swapSlippageNegative": { "message": "Mức trượt giá phải lớn hơn hoặc bằng 0" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "Nguồn thanh khoản" }, @@ -3679,10 +3598,6 @@ "tokenSymbol": { "message": "Ký hiệu token" }, - "tokensFoundTitle": { - "message": "Đã tìm thấy $1 token mới", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "Tôi đã hiểu" }, @@ -3804,9 +3719,6 @@ "message": "Chúng tôi đã gặp phải sự cố khi kết nối với $1 của bạn, hãy thử xem lại $2 và thử lại.", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "MetaMask đã gặp sự cố khi khởi động. Lỗi này có thể xảy ra không liên tục, vì vậy hãy thử khởi động lại tiện ích." - }, "troubleTokenBalances": { "message": "Chúng tôi đã gặp phải vấn đề khi tải số dư token của bạn. Bạn có thể xem số dư ", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3741,6 @@ "typePassword": { "message": "Nhập mật khẩu MetaMask của bạn" }, - "typeYourSRP": { - "message": "Nhập Cụm từ khôi phục bí mật của bạn" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3779,10 @@ "message": "Không nhận ra mạng tùy chỉnh này. Bạn nên $1 trước khi tiếp tục", "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": "xác minh thông tin về mạng", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "Hiện không hỗ trợ gửi token sưu tập (ERC-721)", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3900,6 @@ "walletCreationSuccessTitle": { "message": "Tạo ví thành công" }, - "warning": { - "message": "Cảnh báo" - }, "weak": { "message": "Yếu" }, diff --git a/app/_locales/zh/messages.json b/app/_locales/zh/messages.json index 66984cbd436f..5e6bfd118063 100644 --- a/app/_locales/zh/messages.json +++ b/app/_locales/zh/messages.json @@ -62,13 +62,6 @@ "message": "$1可以访问并使用此资产", "description": "$1 is the url of the site requesting ability to spend" }, - "accessYourWalletWithSRP": { - "message": "使用账户助记词访问钱包" - }, - "accessYourWalletWithSRPDescription": { - "message": "MetaMask无法恢复您的密码。我们将使用您的助记词来验证您的所有权、恢复您的钱包并设置新密码。首先,请输入创建钱包时获得的助记词。$1", - "description": "$1 is the words 'Learn More' from key 'learnMore', separated here so that it can be added as a link" - }, "accessingYourCamera": { "message": "正在访问您的相机……" }, @@ -160,10 +153,6 @@ "addNetwork": { "message": "添加网络" }, - "addNetworkTooltipWarning": { - "message": "此网络连接依赖于第三方。此连接可能不太可靠,或使第三方可进行活动跟踪。$1", - "description": "$1 is Learn more link" - }, "addSuggestedTokens": { "message": "添加推荐代币" }, @@ -411,14 +400,6 @@ "message": "购买$1", "description": "$1 is the ticker symbol of a an asset the user is being prompted to purchase" }, - "buyCryptoWithCoinbasePay": { - "message": "用Coinbase Pay购买$1", - "description": "$1 represents the crypto symbol to be purchased" - }, - "buyCryptoWithCoinbasePayDescription": { - "message": "您可以使用Coinbase账户轻松购买或转移加密货币。", - "description": "$1 represents the crypto symbol to be purchased" - }, "buyCryptoWithMoonPay": { "message": "用MoonPay购买$1", "description": "$1 represents the cypto symbol to be purchased" @@ -435,10 +416,10 @@ "description": "$1 represents the crypto symbol to be purchased" }, "buyWithWyre": { - "message": "使用 Wyre 购买 $1" + "message": "使用 Wyre 购买 ETH" }, "buyWithWyreDescription": { - "message": "您可以通过 Wyre 使用借记卡将 $1 存入您的 MetaMask 账户。" + "message": "您可以通过 Wyre 使用借记卡将 ETH 存入您的 MetaMask 账户。" }, "bytes": { "message": "字节" @@ -466,6 +447,9 @@ "message": "若要$1交易,燃料费用必须增加至少10%才能被网络认可。", "description": "$1 is string 'cancel' or 'speed up'" }, + "cancelSwap": { + "message": "取消交换" + }, "cancellationGasFee": { "message": "取消燃料费用" }, @@ -622,9 +606,6 @@ "continue": { "message": "继续" }, - "continueToCoinbasePay": { - "message": "继续使用Coinbase Pay" - }, "continueToMoonPay": { "message": "继续使用MoonPay" }, @@ -737,6 +718,9 @@ "customGasSubTitle": { "message": "提升费用可能会缩短处理时间,但不能保证。" }, + "customNetworks": { + "message": "自定义网络" + }, "customSpendLimit": { "message": "自定义消费限额" }, @@ -1244,10 +1228,6 @@ "message": "所有Flask API都是实验性的。它们可能会在未事先通知的情况下被更改或删除,它们也可能会无限期地留在Flask上而不会迁移到稳定的MetaMask。您需要自行承担使用它们的风险。", "description": "This message warns developers about unstable Flask APIs" }, - "flaskWelcomeWarning4": { - "message": "确保在使用Flask时禁用常规MetaMask扩展程序。", - "description": "This message calls to pay attention about multiple versions of MetaMask running on the same site (Flask + Prod)" - }, "flaskWelcomeWarningAcceptButton": { "message": "我接受风险", "description": "this text is shown on a button, which the user presses to confirm they understand the risks of using Flask" @@ -1439,9 +1419,6 @@ "hide": { "message": "隐藏" }, - "hideFullTransactionDetails": { - "message": "隐藏完整的交易细节" - }, "hideSeedPhrase": { "message": "隐藏助记词" }, @@ -1471,12 +1448,6 @@ "history": { "message": "历史记录" }, - "ignoreAll": { - "message": "忽略所有" - }, - "ignoreTokenWarning": { - "message": "如果您隐藏代币,它们将不会在您的钱包中显示。但您仍然可以通过搜索代币来添加它们。" - }, "import": { "message": "导入", "description": "Button to import an account from a selected file" @@ -1526,10 +1497,6 @@ "importWallet": { "message": "导入钱包" }, - "importWithCount": { - "message": "导入$1", - "description": "$1 will the number of detected tokens that are selected for importing, if all of them are selected then $1 will be all" - }, "importYourExisting": { "message": "使用账户助记词导入您的现有钱包" }, @@ -1646,7 +1613,7 @@ "message": "已知合约地址。" }, "knownTokenWarning": { - "message": "此操作将编辑已经在您的钱包中列出的代币,有可能被用来欺骗您。只有确定要更改这些代币的内容时,才通过此操作。了解更多关于 $1" + "message": "此操作将编辑已经在您的钱包中列出的代币,有肯能被用来欺骗您。只有确定要更改这些代币的内容时,才通过此操作。了解更多关于 $1" }, "kovan": { "message": "Kovan 测试网络" @@ -1724,9 +1691,6 @@ "levelArrow": { "message": "水平箭头" }, - "lightTheme": { - "message": "浅色" - }, "likeToImportTokens": { "message": "您想导入这些代币吗?" }, @@ -1888,6 +1852,10 @@ "metametricsTitle": { "message": "和600多万用户一起改进 MetaMask" }, + "mismatchedChain": { + "message": "此链 ID 的网络信息与我们的记录不符。我们建议您在继续操作之前 $1。", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "验证网络信息", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -2036,13 +2004,6 @@ "newToMetaMask": { "message": "MetaMask 的新用户?" }, - "newTokensImportedMessage": { - "message": "您已成功导入$1。", - "description": "$1 is the string of symbols of all the tokens imported" - }, - "newTokensImportedTitle": { - "message": "已导入代币" - }, "newTotal": { "message": "新总额" }, @@ -2125,9 +2086,6 @@ "notEnoughGas": { "message": "燃料不足" }, - "notifications": { - "message": "通知" - }, "notifications10ActionText": { "message": "在设置中访问", "description": "The 'call to action' on the button, or link, of the 'Visit in settings' notification. Upon clicking, users will be taken to settings page." @@ -2248,19 +2206,6 @@ "notifications9Title": { "message": "👓 我们正在使交易更容易阅读。" }, - "notificationsEmptyText": { - "message": "此处无内容。" - }, - "notificationsHeader": { - "message": "通知" - }, - "notificationsInfos": { - "message": "$1,来自$2", - "description": "$1 is the date at which the notification has been dispatched and $2 is the link to the snap that dispatched the notification." - }, - "notificationsMarkAllAsRead": { - "message": "将所有标记为已读" - }, "numberOfNewTokensDetected": { "message": "在此账户中发现 $1 新代币", "description": "$1 is the number of new tokens detected" @@ -2340,6 +2285,9 @@ "onlyConnectTrust": { "message": "只连接您信任的网站。" }, + "onlyInteractWith": { + "message": "仅与您信任的实体互动。" + }, "openFullScreenForLedgerWebHid": { "message": "全屏打开 MetaMask 以通过 WebHID 连接您的 ledger。", "description": "Shown to the user on the confirm screen when they are viewing MetaMask in a popup window but need to connect their ledger via webhid." @@ -2359,12 +2307,6 @@ "origin": { "message": "来源" }, - "osTheme": { - "message": "系统" - }, - "padlock": { - "message": "挂锁" - }, "parameters": { "message": "参数" }, @@ -2435,10 +2377,6 @@ "message": "查看您允许的账户的地址(必填)", "description": "The description for the `eth_accounts` permission" }, - "permission_longRunning": { - "message": "无限期运行。", - "description": "The description for the `endowment:long-running` permission" - }, "permission_manageBip44Keys": { "message": "控制您的“$1”账户和资产。", "description": "The description for the `snap_getBip44Entropy_*` permission. $1 is the name of a protocol, e.g. 'Filecoin'." @@ -2468,9 +2406,6 @@ "message": "另外 $1 项", "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, - "popularCustomNetworks": { - "message": "流行自定义网络" - }, "preferredLedgerConnectionType": { "message": "首选 Ledger 连接类型", "description": "A header for a dropdown in the advanced section of settings. Appears above the ledgerConnectionPreferenceDescription message" @@ -2645,9 +2580,6 @@ "resetWalletWarning": { "message": "在继续之前,请确保您所使用的助记词正确无误。您将无法撤消此操作。" }, - "restartMetamask": { - "message": "重新启动MetaMask" - }, "restore": { "message": "恢复" }, @@ -2832,9 +2764,6 @@ "sendAmount": { "message": "发送金额" }, - "sendBugReport": { - "message": "向我们发送错误报告。" - }, "sendSpecifiedTokens": { "message": "发送 $1", "description": "Symbol of the specified token" @@ -3108,9 +3037,6 @@ "message": "将您的钱包直接连接到电脑。解锁 Ledger 并打开 Ethereum 应用程序。若要了解有关使用您的硬件钱包设备的更多信息,$1。", "description": "$1 represents the `hardwareWalletSupportLinkConversion` localization key" }, - "stillGettingMessage": { - "message": "仍然收到此消息?" - }, "storePhrase": { "message": "通过如 1Password 等密码管理工具保存该账户助记词。" }, @@ -3163,11 +3089,14 @@ "stxFallbackUnavailable": { "message": "即使智能交易不可用,您仍然可以交换代币。" }, - "stxPendingPrivatelySubmittingSwap": { - "message": "正在秘密提交您的Swap..." + "stxPendingFinalizing": { + "message": "最终确定中..." + }, + "stxPendingOptimizingGas": { + "message": "正在优化燃料......" }, - "stxPendingPubliclySubmittingSwap": { - "message": "正在公开提交您的Swap..." + "stxPendingPrivatelySubmitting": { + "message": "正在隐秘提交交换......" }, "stxSubDescription": { "message": "*智能交易将尝试多次隐秘提交您的交易。如果所有尝试都失败,交易将会公开广播,以确保您的交换能成功进行。" @@ -3179,10 +3108,6 @@ "message": "您的$1现在可用。", "description": "$1 is a token symbol, e.g. ETH" }, - "stxSwapCompleteIn": { - "message": "Swap距离完成尚有<", - "description": "'<' means 'less than', e.g. Swap will complete in < 2:59" - }, "stxTooltip": { "message": "在提交前模拟交易,以降低交易成本并减少失败。" }, @@ -3261,6 +3186,10 @@ "message": "没有与 $1 匹配的代币", "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, + "swapCompleteIn": { + "message": "交换将在此时间內完成<", + "description": "'<' means 'less than', e.g. Swap complete in < 2:59" + }, "swapConfirmWithHwWallet": { "message": "使用您的硬件钱包确认" }, @@ -3442,10 +3371,6 @@ "swapSlippageNegative": { "message": "滑点必须大于或等于0" }, - "swapSlippagePercent": { - "message": "$1%", - "description": "$1 is the amount of % for slippage" - }, "swapSource": { "message": "流动性来源" }, @@ -3679,10 +3604,6 @@ "tokenSymbol": { "message": "代币符号" }, - "tokensFoundTitle": { - "message": "发现$1新代币", - "description": "$1 is the number of new tokens detected" - }, "tooltipApproveButton": { "message": "我理解" }, @@ -3804,9 +3725,6 @@ "message": "我们在连接您的 $1 时遇到问题,尝试检查 $2 并重试。", "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, - "troubleStarting": { - "message": "MetaMask无法启动。可能发生间歇性错误,因此请尝试重新启动扩展程序。" - }, "troubleTokenBalances": { "message": "我们在加载您的代币余额时遇到问题。您可以查看它们 ", "description": "Followed by a link (here) to view token balances" @@ -3829,9 +3747,6 @@ "typePassword": { "message": "输入您的 MetaMask 密码" }, - "typeYourSRP": { - "message": "输入助记词" - }, "u2f": { "message": "U2F", "description": "A name on an API for the browser to interact with devices that support the U2F protocol. On some browsers we use it to connect MetaMask to Ledger devices." @@ -3870,6 +3785,10 @@ "message": "这个自定义网络无法识别。我们建议您在继续操作之前 $1", "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": "验证网络信息", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "当前不支持发送可收藏的 (ERC-721) 代币", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" @@ -3987,9 +3906,6 @@ "walletCreationSuccessTitle": { "message": "钱包创建成功" }, - "warning": { - "message": "警告" - }, "weak": { "message": "弱" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 64633eb4ba1b..8e5ed751e5fe 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -363,10 +363,10 @@ "message": "购买" }, "buyWithWyre": { - "message": "使用 Wyre 购买 $1" + "message": "使用 Wyre 购买 ETH" }, "buyWithWyreDescription": { - "message": "您可以通过 Wyre 使用信用卡将 $1 存入您的 MetaMask 账户。" + "message": "您可以通过 Wyre 使用信用卡将 ETH 存入您的 MetaMask 账户。" }, "bytes": { "message": "字节" @@ -1377,7 +1377,7 @@ "message": "已知接收方地址。" }, "knownTokenWarning": { - "message": "此操作将编辑已经在您的钱包中列出的代币,有可能被用来欺骗您。只有确定要更改这些代币的内容时,才通过此操作。了解更多关于 $1" + "message": "此操作将编辑已经在您的钱包中列出的代币,有肯能被用来欺骗您。只有确定要更改这些代币的内容时,才通过此操作。了解更多关于 $1" }, "kovan": { "message": "Kovan 测试网络" @@ -1597,6 +1597,10 @@ "metametricsTitle": { "message": "加入 6M+ 用户来改进MetaMask" }, + "mismatchedChain": { + "message": "此链路的网络详细信息与我们的记录不匹配。我们建议您在继续操作之前$1。", + "description": "$1 is a clickable link with text defined by the 'mismatchedChainLinkText' key" + }, "mismatchedChainLinkText": { "message": "验证网络详细信息", "description": "Serves as link text for the 'mismatchedChain' key. This text will be embedded inside the translation for that key." @@ -3153,6 +3157,10 @@ "message": "这个自定义网络无法识别。我们建议您在继续操作之前$1", "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": "验证网络详细信息", + "description": "Serves as link text for the 'unrecognizedChain' key. This text will be embedded inside the translation for that key." + }, "unsendableAsset": { "message": "当前不支持发送可收藏的 (ERC-721) 代币", "description": "This is an error message we show the user if they attempt to send a collectible asset type, for which currently don't support sending" diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 4bed5f928ef6..94a79bdb3474 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -140,10 +140,10 @@ "message": "買" }, "buyWithWyre": { - "message": "用 Wyre 購買 $1" + "message": "用 Wyre 購買 ETH" }, "buyWithWyreDescription": { - "message": "Wyre 讓你使用信用卡在 MetaMask 帳號中直接存入 $1 。" + "message": "Wyre 讓你使用信用卡在 MetaMask 帳號中直接存入 ETH。" }, "bytes": { "message": "位元組" diff --git a/app/home.html b/app/home.html index 46bbb857e374..97334c73c762 100644 --- a/app/home.html +++ b/app/home.html @@ -8,10 +8,7 @@ -
- - -
+
diff --git a/app/images/fantom-opera.svg b/app/images/fantom-opera.svg deleted file mode 100644 index 02297ee3a331..000000000000 --- a/app/images/fantom-opera.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/images/harmony-one.svg b/app/images/harmony-one.svg deleted file mode 100644 index e8466d96d255..000000000000 --- a/app/images/harmony-one.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/images/info-fox.svg b/app/images/info-fox.svg deleted file mode 100644 index 57660c1fe6bc..000000000000 --- a/app/images/info-fox.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/images/videos/recovery-onboarding/subtitles/de.vtt b/app/images/videos/recovery-onboarding/subtitles/de.vtt index 4f32049535bb..9b5612285457 100644 --- a/app/images/videos/recovery-onboarding/subtitles/de.vtt +++ b/app/images/videos/recovery-onboarding/subtitles/de.vtt @@ -2,91 +2,109 @@ WEBVTT 1 00:00:00.780 --> 00:00:04.580 -MetaMask ist eine neue Möglichkeit zur Verbindung mit Webseiten und Applikationen. +MetaMask ist eine neue Möglichkeit, sich mit +Webseiten und Anwendungen zu verbinden. 2 -00:00:04.580 --> 00:00:08.860 -Auf traditionellen Webseiten ist eine zentrale Datenbank verantwortlich für die Kontrolle und +00:00:04.580 --> 00:00:08.860 +Auf traditionellen Webseiten ist eine +zentrale Datenbank für die Steuerung und 3 00:00:08.860 --> 00:00:10.179 -Wiederherstellung Ihrer Konten. +Wiederherstellung der Konten zuständig. 4 00:00:10.179 --> 00:00:15.050 -Auf MetaMask liegt diese Macht aber beim Inhaber des Generalschlüssels. +Bei MetaMask gehört all diese Macht dem +Besitzer eines „Hauptschlüssels“. 5 00:00:15.050 --> 00:00:18.460 -Wer den Generalschlüssel hat, kontrolliert die Konten. +Wer den Schlüssel besitzt, kontrolliert +das Wallet und damit die Konten. 6 00:00:18.460 --> 00:00:21.110 -Ihr geheime Wiederherstellungsphrase ist Ihr „Generalschlüssel“. +Der geheime Satz zur Wiederherstellung +Deines Wallets ist der „Hauptschlüssel“. 7 00:00:21.110 --> 00:00:26.070 -Dies ist eine Serie von 12 Worten, die generiert werden, wenn Sie MetaMask zum ersten Mal einrichten, und erlaubt Ihnen +Es ist eine Reihe von 12 Wörtern, welche generiert werden, +wenn MetaMask zum ersten Mal eingerichtet wird, diese erlauben dir 8 00:00:26.070 --> 00:00:30.120 -Ihr Wallet und Ihr Guthaben wiederherzustellen, falls Sie jemals den Zugriff verlieren sollten. +Deinen „Hauptschlüssel“ zu Deinem Wallet wieder herzustellen, +solltest Du jemals den Zugriff darauf verlieren. 9 00:00:30.120 --> 00:00:33.451 -Es ist wichtig, dass Sie Ihr Wallet sichern, indem Sie +Es ist wichtig, dass Du Dein Wallet sicherst, +indem Du Deinen geheimen 10 00:00:33.451 --> 00:00:37.510 -ihre geheime Wiederherstellungsphrase an einem sicheren und geheimen Ort aufbewahren. +Wiederherstellungssatz sicher +und geheim verwahrst. 11 00:00:37.510 --> 00:00:41.429 -Wenn jemand den Zugriff darauf erhält, hat diese Person den „Generalschlüssel“ zu Ihrem Wallet und kann +Wenn jemand Zugriff darauf erhält, hat er +den „Hauptschlüssel“ für Dein Wallet und kann 12 00:00:41.429 --> 00:00:45.190 -frei auf Ihr Guthaben zugreifen und es Ihnen wegnehmen. +frei auf Deine Konten zugreifen und alle Gelder stehlen. 13 00:00:45.190 --> 00:00:50.109 -Sie sollten Ihre geheime Wiederherstellungsphrase sicher aufbewahren, um Ihr MetaMask-Wallet zu schützen. +Um Dein MetaMask-Wallet zu sichern, musst Du Deinen +geheimen Wiederherstellungssatz sicher speichern. 14 00:00:50.109 --> 00:00:54.930 -Sie können sie aufschreiben, irgendwo verstecken, in einem Bankschließfach aufbewahren +Du kannst ihn aufschreiben, irgendwo verstecken, +in ein Schließfach legen 15 00:00:54.930 --> 00:00:57.729 -oder einen sicheren Passwortmanager verwenden. +oder in einen sicheren Passwort-Manager speichern. 16 00:00:57.729 --> 00:01:01.050 -Einige Benutzer gravieren Ihre Phrase sogar auf eine Metallplatte ein! +Einige Benutzer gravieren ihren +Satz sogar auf eine Metallplatte. 17 00:01:01.050 --> 00:01:04.440 -Niemand, nicht einmal das MetaMask-Team, kann Ihnen dabei helfen, +Niemand, nicht einmal das Team von MetaMask, +kann Dir dabei helfen 18 00:01:04.440 --> 00:01:07.820 -ihr Wallet wiederherzustellen, falls Sie Ihre geheime Wiederherstellungsphrase verloren haben. +Dein Wallet wiederherzustellen, wenn Du Deinen +geheimen Wiederherstellungssatz verlierst. 19 00:01:07.820 --> 00:01:12.072 -Falls Sie sich Ihre geheime Wiederherstellungsphrase nicht aufgeschrieben und diese an einem sicheren Ort aufbewahren, +Wenn Du Deinen geheimen Wiederherstellungssatz noch nicht +aufgeschrieben und an einem sicheren Ort aufbewahrt hast, 20 00:01:12.072 --> 00:01:15.492 -machen Sie es jetzt. Wir warten. +mach es jetzt. Wir warten solange. 21 00:01:15.500 --> 00:01:20.780 -Und denken Sie daran: Teilen Sie Ihre geheime Wiederherstellungsphrase niemals mit anderen, nicht einmal mit uns. +Und denk daran, teilen Deinen geheimen Wiederherstellungssatz +niemals: nicht einmal mit uns. 22 00:01:20.780 --> 00:01:24.910 -Sollte Sie jemand danach fragen, ist dies ein Betrugsversuch. +Wenn dich jemals jemand danach fragt, +versucht er dich zu betrügen. 23 00:01:24.910 --> 00:01:26.250 @@ -94,5 +112,5 @@ Das ist alles! 24 00:01:26.250 --> 00:01:31.020 -Jetzt wissen Sie, was eine geheime Wiederherstellungsphrase ist und wie Sie Ihr Wallet sicher halten und beschützen. - +Jetzt weist Du, was ein geheimer Wiederherstellungssatz ist +und wie Du dafür sorgst, das Dein Wallete sicher bleibt. diff --git a/app/images/videos/recovery-onboarding/subtitles/el.vtt b/app/images/videos/recovery-onboarding/subtitles/el.vtt deleted file mode 100644 index fc537aef807c..000000000000 --- a/app/images/videos/recovery-onboarding/subtitles/el.vtt +++ /dev/null @@ -1,98 +0,0 @@ -WEBVTT - -1 -00:00:00.780 --> 00:00:04.580 -Το MetaMask είναι ένας νέος τρόπος για να συνδέεστε σε ισότοπους και εφαρμογές. - -2 -00:00:04.580 --> 00:00:08.860 -Στους παραδοσιακούς ιστότοπους, μια κεντρική βάση δεδομένων ή τράπεζα είναι υπεύθυνη για τον έλεγχο και - -3 -00:00:08.860 --> 00:00:10.179 -την ανάκτηση των λογαριασμών σας. - -4 -00:00:10.179 --> 00:00:15.050 -Αλλά στο MetaMask, ο κάτοχος του κύριου κλειδιού έχει όλη τη δύναμη στα χέρια του. - -5 -00:00:15.050 --> 00:00:18.460 -Όποιος έχει το κλειδί, ελέγχει τους λογαριασμούς. - -6 -00:00:18.460 --> 00:00:21.110 -Η μυστική σας φράση ανάκτησης είναι το «κύριο κλειδί» σας. - -7 -00:00:21.110 --> 00:00:26.070 -Είναι μια σειρά από 12 λέξεις που παράγονται όταν ρυθμίσετε για πρώτη φορά το MetaMask, η οποία σας επιτρέπει - -8 -00:00:26.070 --> 00:00:30.120 -να ανακτήσετε το πορτοφόλι σας και τα χρήματά σας εάν κάποια στιγμή χάσετε την πρόσβαση. - -9 -00:00:30.120 --> 00:00:33.451 -Είναι σημαντικό να θωρακίσετε το πορτοφόλι σας με το να κρατήσετε τη - -10 -00:00:33.451 --> 00:00:37.510 -μυστική σας φράση ανάκτησης απόλυτα ασφαλή και μυστική. - -11 -00:00:37.510 --> 00:00:41.429 -Εάν κάποιος αποκτήσει πρόσβαση σε αυτήν, θα έχει το «κύριο κλειδί» για το πορτοφόλι σας και θα μπορεί - -12 -00:00:41.429 --> 00:00:45.190 -να έχει ελεύθερη πρόσβαση και να πάρει όλα σας τα χρήματα. - -13 -00:00:45.190 --> 00:00:50.109 -Για να θωρακίσετε το πορτοφόλι MetaMask θα πρέπει να αποθηκεύσετε με ασφάλεια την μυστική σας φράση ανάκτησης. - -14 -00:00:50.109 --> 00:00:54.930 -Μπορείτε να την γράψετε σε ένα χαρτί, να την κρύψετε κάπου, να την βάλετε σε μια ασφαλή θυρίδα - -15 -00:00:54.930 --> 00:00:57.729 -ή να χρησιμοποιήσετε έναν ασφαλή διαχειριστή κωδικών. - -16 -00:00:57.729 --> 00:01:01.050 -Μερικοί χρήστες έχουν χαράξει τη φράση τους ακόμα και σε μεταλλική πλάκα! - -17 -00:01:01.050 --> 00:01:04.440 -Κανένας, ούτε καν η ομάδα του MetaMask, δεν μπορεί να σας βοηθήσει να - -18 -00:01:04.440 --> 00:01:07.820 -ανακτήσετε το πορτοφόλι σας εάν χάσετε τη μυστική φράση ανάκτησης. - -19 -00:01:07.820 --> 00:01:12.072 -Αν δεν έχετε καταγράψει την μυστική σας φράση ανάκτησης και δεν την έχετε αποθηκεύσει κάπου με ασφάλεια, - -20 -00:01:12.072 --> 00:01:15.492 -κάντε το τώρα. Θα περιμένουμε. - -21 -00:01:15.500 --> 00:01:20.780 -Και να θυμάστε: μην μοιραστείτε ποτέ και με κανέναν τη μυστική σας φράση ανάκτησης. Ούτε καν με εμάς. - -22 -00:01:20.780 --> 00:01:24.910 -Εάν κάποιος σας την ζητήσει κάποια στιγμή, θα προσπαθεί να σας εξαπατήσει. - -23 -00:01:24.910 --> 00:01:26.250 -Αυτό ήταν! - -24 -00:01:26.250 --> 00:01:31.020 -Τώρα ξέρετε τι είναι η μυστική φράση ανάκτησης και πώς να κρατήσετε το πορτοφόλι σας σίγουρο και ασφαλές. - diff --git a/app/images/videos/recovery-onboarding/subtitles/es.vtt b/app/images/videos/recovery-onboarding/subtitles/es.vtt index aec4427ff72a..2f56d35be5b3 100644 --- a/app/images/videos/recovery-onboarding/subtitles/es.vtt +++ b/app/images/videos/recovery-onboarding/subtitles/es.vtt @@ -6,7 +6,7 @@ MetaMask es una nueva forma de conectarse a sitios y aplicaciones. 2 -00:00:04.580 --> 00:00:08.860 +00:00:04.580 --> 00:00:08.860 En los sitios web tradicionales, una base de datos o un banco central es responsable de controlar y @@ -113,4 +113,3 @@ será con intenciones de estafarlo. 00:01:26.250 --> 00:01:31.020 Ahora ya sabe qué es una frase secreta de recuperación y qué debe hacer para mantener protegida su cartera. - diff --git a/app/images/videos/recovery-onboarding/subtitles/fr.vtt b/app/images/videos/recovery-onboarding/subtitles/fr.vtt deleted file mode 100644 index a80e4d6e479a..000000000000 --- a/app/images/videos/recovery-onboarding/subtitles/fr.vtt +++ /dev/null @@ -1,98 +0,0 @@ -WEBVTT - -1 -00:00:00.780 --> 00:00:04.580 -MetaMask offre une nouvelle façon de se connecter aux sites et aux applications. - -2 -00:00:04.580 --> 00:00:08.860 -Sur les sites traditionnels, une base de données centrale ou une banque est chargée du contrôle et de - -3 -00:00:08.860 --> 00:00:10.179 -la récupération des comptes. - -4 -00:00:10.179 --> 00:00:15.050 -Mais sur MetaMask, tout le pouvoir appartient au détenteur de la clé maîtresse. - -5 -00:00:15.050 --> 00:00:18.460 -Celui qui détient la clé, contrôle les comptes. - -6 -00:00:18.460 --> 00:00:21.110 -Votre phrase de récupération secrète est votre « clé maîtresse ». - -7 -00:00:21.110 --> 00:00:26.070 -Il s’agit d’une série de 12 mots générés lors de la première installation de MetaMask qui vous permet - -8 -00:00:26.070 --> 00:00:30.120 -de récupérer votre portefeuille et vos fonds, si vous en perdez l’accès. - -9 -00:00:30.120 --> 00:00:33.451 -Pour éviter tout accès non autorisé à votre portefeuille, veuillez garder votre - -10 -00:00:33.451 --> 00:00:37.510 -phrase de récupération secrète dans un lieu sûr et sécurisé. - -11 -00:00:37.510 --> 00:00:41.429 -Car toute personne ayant accès à votre phrase de récupération secrète, et donc à la « clé maîtresse » de votre portefeuille, pourra - -12 -00:00:41.429 --> 00:00:45.190 -accéder librement à vos fonds et les dérober. - -13 -00:00:45.190 --> 00:00:50.109 -Pour éviter tout accès non autorisé à votre portefeuille MetaMask, veuillez garder votre phrase de récupération secrète dans un lieu sûr et sécurisé. - -14 -00:00:50.109 --> 00:00:54.930 -Vous pouvez l’écrire sur un bout de papier et la cacher dans un lieu sûr comme dans un coffre-fort - -15 -00:00:54.930 --> 00:00:57.729 -ou utiliser un gestionnaire de mots de passe sécurisé. - -16 -00:00:57.729 --> 00:01:01.050 -Certains utilisateurs préfèrent même graver leur phrase de récupération secrète sur une plaque de métal ! - -17 -00:01:01.050 --> 00:01:04.440 -Personne, pas même l’équipe de MetaMask, ne peut vous aider - -18 -00:01:04.440 --> 00:01:07.820 -à récupérer votre portefeuille si vous perdez votre phrase de récupération secrète. - -19 -00:01:07.820 --> 00:01:12.072 -Si vous n’avez pas encore écrit votre phrase de récupération secrète sur un bout de papier ou ne l’avez pas encore cachée dans un endroit sûr, - -20 -00:01:12.072 --> 00:01:15.492 -faites-le maintenant. Nous vous attendrons. - -21 -00:01:15.500 --> 00:01:20.780 -Et n’oubliez surtout pas que vous ne devriez jamais partager votre phrase de récupération secrète avec quiconque ; pas même avec nous. - -22 -00:01:20.780 --> 00:01:24.910 -Si quelqu’un vous la demande, c’est qu’il essaie de vous escroquer. - -23 -00:01:24.910 --> 00:01:26.250 -Voilà, c’est tout ! - -24 -00:01:26.250 --> 00:01:31.020 -Maintenant vous savez ce qu’est une phrase de récupération secrète et ce que vous devez faire pour protéger votre portefeuille. - diff --git a/app/images/videos/recovery-onboarding/subtitles/hi.vtt b/app/images/videos/recovery-onboarding/subtitles/hi.vtt index ec3d9ec37d11..f82c695660f9 100644 --- a/app/images/videos/recovery-onboarding/subtitles/hi.vtt +++ b/app/images/videos/recovery-onboarding/subtitles/hi.vtt @@ -2,93 +2,108 @@ WEBVTT 1 00:00:00.780 --> 00:00:04.580 -मेटामास्क साइटों और एप्लीकेशन से जुड़ने का एक नया तरीका है। +MetaMask साइटों और एप्लिकेशन से +जुड़ने का एक नया तरीका है। 2 -00:00:04.580 --> 00:00:08.860 -पारंपरिक वेबसाइटों पर, एक केंद्रीय डेटाबेस -या बैंक नियंत्रित करने के लिए जिम्मेदार है और +00:00:04.580 --> 00:00:08.860 +पारंपरिक वेबसाइटों पर, आपके खातों को नियंत्रित करने और +पुनर्प्राप्त करने के लिए एक केंद्रीय डेटाबेस या 3 00:00:08.860 --> 00:00:10.179 -अपने खाते पुनर्प्राप्त करना +बैंक ज़िम्मेदार होता है। 4 00:00:10.179 --> 00:00:15.050 -लेकिन मेटामास्क पर, समस्त शक्ति मास्टर कुंजी के धारक के पास होती है। +लेकिन MetaMask पर, सारी शक्ति +मास्टर कुंजी के धारक की होती है। 5 00:00:15.050 --> 00:00:18.460 -जिसके पास कुंजी होती है, वह खातों को नियंत्रित करता है। +जो भी कुंजी रखता है, वह खातों को नियंत्रित करता है। 6 00:00:18.460 --> 00:00:21.110 -आपका गुप्त पुनर्प्राप्ति वाक्यांश आपकी "मास्टर कुंजी" है। +आपका गुप्त रिकवरी फ्रेज़ +आपकी "मास्टर कुंजी" है। 7 00:00:21.110 --> 00:00:26.070 -यह उत्पन्न होने वाले 12 शब्दों की एक श्रृंखला है -जब आप पहली बार मेटामास्क सेट करते हैं, जो अनुमति देता है +यह 12 शब्दों की एक सीरीज़ होती है, जो +आपके द्वारा पहली बार MetaMask सेट करने पर जेनरेट होती है, जिससे 8 00:00:26.070 --> 00:00:30.120 -एक्सेस खोने की स्थिति में अपने वॉलेट और धन को रिकवर करने की सुविधा प्रदान करती है। +आप कभी भी एक्सेस खोने पर अपने वॉलेट और धन को +पुनर्प्राप्त कर सकते हैं। 9 00:00:30.120 --> 00:00:33.451 -यह महत्वपूर्ण है कि आप अपने वॉलेट को सुरक्षित रखे +यह महत्वपूर्ण है कि आप +अपने गुप्त रिकवरी फ्रेज़ को 10 00:00:33.451 --> 00:00:37.510 -गुप्त पुनर्प्राप्ति वाक्यांश बहुत सुरक्षित, और बहुत ही गुप्त। +बहुत सुरक्षित और बहुत गुप्त रखकर +अपने वॉलेट को सुरक्षित रखें। 11 00:00:37.510 --> 00:00:41.429 -यदि किसी को इसकी एक्सेस मिलती है, तो उनके पास आपके वॉलेट की "मास्टर कुंजी" होगी और वह कर सकता है +अगर किसी को भी इसकी सुविधा का एक्सेस मिल जाता है, तो +उनके पास आपके वॉलेट की "मास्टर कुंजी" होगी और 12 00:00:41.429 --> 00:00:45.190 -वह बहुत आसानी से आपके पूरे फण्ड को एक्सेस करके उसे चुरा सकता है। +वे आपके सारे धन को आसानी से एक्सेस कर सकते हैं। 13 00:00:45.190 --> 00:00:50.109 -अपने मेटामास्क वॉलेट को सुरक्षित रखने के लिए आपको अपने गुप्त पुनर्प्राप्ति वाक्यांश को सुरक्षित ढंग से सहेजना चाहिए। +अपने MetaMask वॉलेट को सुरक्षित करने के लिए आप अपने +गुप्त रिकवरी फ्रेज़ को सुरक्षित रूप से सहेजना चाहेंगे। 14 00:00:50.109 --> 00:00:54.930 -आप इसे लिख सकते हैं, इसे कहीं छुपा सकते हैं, इसे सुरक्षित जमा बॉक्स में रख सकते हैं +आप इसे लिख सकते हैं, इसे कहीं छुपा सकते हैं, +इसे सेफ़ डिपोज़िट बॉक्स में रख सकते हैं 15 00:00:54.930 --> 00:00:57.729 -या एक सुरक्षित पासवर्ड मैनेजर का उपयोग करें। +या सुरक्षित पासवर्ड मैनेजर का उपयोग कर सकते हैं। 16 00:00:57.729 --> 00:01:01.050 -कुछ उपयोगकर्ता अपने वाक्यांश को धातु की प्लेट पर भी उकेरते हैं! +कुछ उपयोगकर्ता अपने +फ्रेज़ को धातु की प्लेट पर भी उकेर कर रखते हैं! 17 00:01:01.050 --> 00:01:04.440 -कोई नहीं, यहां तक कि मेटामास्क की टीम भी आपकी मदद नहीं कर सकती +यदि आप अपना गुप्त रिकवरी फ्रेज़ खो देते हैं, तो +कोई भी, यहां तक कि MetaMask की टीम भी, 18 00:01:04.440 --> 00:01:07.820 -यदि आप अपना गुप्त पुनर्प्राप्ति वाक्यांश खो देते हैं तो अपना वॉलेट पुनर्प्राप्त करें। +आपके वॉलेट को पुनर्प्राप्त करने में आपकी +सहायता नहीं कर सकती है। 19 00:01:07.820 --> 00:01:12.072 -यदि आपने अपने गुप्त पुनर्प्राप्ति वाक्यांश को लिखकर किसी सुरक्षित स्थान पर स्टोर नहीं किया है +यदि आपने अपना गुप्त रिकवरी फ्रेज़ +लिखा नहीं है और इसे कहीं सुरक्षित संग्रहीत नहीं किया है, 20 00:01:12.072 --> 00:01:15.492 -अभी करें। हम प्रतीक्षा करेंगे। +तो अभी करें। हम इंतजार करेंगे। 21 00:01:15.500 --> 00:01:20.780 -और याद रखें, कभी भी अपने गुप्त पुनर्प्राप्ति वाक्यांश को किसी के भी साथ, यहां तक हमारे साथ भी, साझा नहीं करें। +और याद रखें, कभी भी अपना गुप्त रिकवरी फ्रेज़ +किसी के साथ साझा न करें: हमसे भी नहीं। 22 00:01:20.780 --> 00:01:24.910 -अगर कभी कोई आपसे इसके लिए पूछे, वे आपको धोखा देने की कोशिश कर रहे हैं। +यदि कोई आपसे कभी भी इसे मांगता है, तो +वे आपके साथ धोखाधड़ी करने की कोशिश कर सकते हैं। 23 00:01:24.910 --> 00:01:26.250 @@ -96,5 +111,5 @@ WEBVTT 24 00:01:26.250 --> 00:01:31.020 -अब आप जानते हैं कि गुप्त पुनर्प्राप्ति वाक्यांश क्या है और अपने वॉलेट को संरक्षित और सुरक्षित कैसे रखें। - +अब आपको पता चल गया है कि गुप्त रिकवरी फ्रेज़ क्या है +और अपने वॉलेट को कैसे सकुशल और सुरक्षित रखा जाए। diff --git a/app/images/videos/recovery-onboarding/subtitles/id.vtt b/app/images/videos/recovery-onboarding/subtitles/id.vtt index 12807086ebc8..94761496b213 100644 --- a/app/images/videos/recovery-onboarding/subtitles/id.vtt +++ b/app/images/videos/recovery-onboarding/subtitles/id.vtt @@ -2,11 +2,13 @@ WEBVTT 1 00:00:00.780 --> 00:00:04.580 -MetaMask adalah cara baru untuk terhubung ke situs dan aplikasi. +MetaMask adalah cara baru untuk terhubung +ke situs dan aplikasi. 2 -00:00:04.580 --> 00:00:08.860 -Di situs web biasa, basis data pusat atau bank bertanggung jawab untuk mengendalikan dan +00:00:04.580 --> 00:00:08.860 +Di situs web tradisional, database sentral +atau bank bertanggung jawab untuk mengontrol dan 3 00:00:08.860 --> 00:00:10.179 @@ -14,47 +16,56 @@ memulihkan akun Anda. 4 00:00:10.179 --> 00:00:15.050 -Namun, di MetaMask, seluruh kuasa milik pemegang kunci utama. +Tetapi di MetaMask, semua kuasa milik +pemegang kunci induk. 5 00:00:15.050 --> 00:00:18.460 -Siapa pun yang memegang kunci, ia mengendalikan akun. +Siapa pun yang memegang kunci tersebut, akan mengontrol akun. 6 00:00:18.460 --> 00:00:21.110 -Frasa pemulihan rahasia Anda adalah "kunci rahasia" Anda. +Frasa pemulihan rahasia +adalah "kunci induk" Anda. 7 00:00:21.110 --> 00:00:26.070 -Frasa pemulihan ini berupa 12 kata yang dihasilkan saat pertama kali Anda menyiapkan MetaMask, yang memungkinkan +Ini adalah rangkaian 12 kata yang dibuat +saat Anda menyiapkan MetaMask pertama kali, yang memungkinkan 8 00:00:26.070 --> 00:00:30.120 -Anda untuk memulihkan dompet dan dana Anda jika Anda kehilangan akses. +Anda memulihkan dompet dan dana jika Anda +kehilangan akses. 9 00:00:30.120 --> 00:00:33.451 -Anda perlu mengamankan dompet Anda dengan menjaga +Penting agar Anda mengamankan +dompet Anda dengan menjaga 10 00:00:33.451 --> 00:00:37.510 -frasa pemulihan rahasia dengan sangat aman, dan sangat rahasia. +frasa pemulihan rahasia +Anda dengan sangat aman dan sangat rahasia. 11 00:00:37.510 --> 00:00:41.429 -Jika seseorang mendapatkan akses ke frasa tersebut, ia akan memiliki "kunci utama" ke dompet Anda dan dapat +Jika seseorang mendapatkan aksesnya, mereka akan memiliki +"kunci induk" ke dompet Anda dan dapat 12 00:00:41.429 --> 00:00:45.190 -dengan bebas mengakses serta mengambil seluruh dana Anda. +mengakses secara bebas dan mengambil semua dana Anda. 13 00:00:45.190 --> 00:00:50.109 -Untuk mengamankan dompet MetaMask Anda, Anda perlu menyimpan frasa pemulihan rahasia dengan aman. +Untuk mengamankan dompet MetaMask, Anda pasti ingin +menyimpan frasa pemulihan rahasia Anda secara aman. 14 00:00:50.109 --> 00:00:54.930 -Anda dapat menuliskannya, menyembunyikannya, menaruhnya di brankas, +Anda dapat menuliskannya, menyembunyikannya di suatu tempat, +menempatkannya di kotak deposit yang aman 15 00:00:54.930 --> 00:00:57.729 @@ -62,19 +73,23 @@ atau menggunakan pengelola kata sandi yang aman. 16 00:00:57.729 --> 00:01:01.050 -Sebagian pengguna bahkan mengukir frasa yang mereka miliki di lempengan logam! +Beberapa pengguna bahkan mengukir frasa +mereka pada pelat logam! 17 00:01:01.050 --> 00:01:04.440 -Tidak seorang pun, bahkan tim di MetaMask sekalipun, dapat membantu Anda +Tidak ada seorang pun, bahkan tidak juga tim +di MetaMask, dapat membantu Anda 18 00:01:04.440 --> 00:01:07.820 -untuk memulihkan dompet jika Anda kehilangan frasa pemulihan rahasia Anda. +memulihkan dompet Anda jika Anda menghilangkan +frasa pemulihan rahasia Anda. 19 00:01:07.820 --> 00:01:12.072 -Jika Anda belum menuliskan frasa pemulihan rahasia dan menyimpannya di tempat yang aman, +Jika belum menuliskan frasa pemulihan rahasia Anda +dan menyimpannya di suatu tempat yang aman, 20 00:01:12.072 --> 00:01:15.492 @@ -82,17 +97,19 @@ lakukan sekarang. Kami akan menunggu. 21 00:01:15.500 --> 00:01:20.780 -Dan ingat, jangan pernah membagikan frasa pemulihan rahasia kepada siapa pun: bahkan kepada kami. +Dan ingat, jangan membagikan frasa pemulihan rahasia +Anda kepada siapa pun: bahkan tidak kepada kami. 22 00:01:20.780 --> 00:01:24.910 -Jika ada orang yang menanyakannya kepada Anda, mereka mencoba menipu Anda. +Jika ada yang menanyakannya, +mereka akan mencoba menipu Anda. 23 00:01:24.910 --> 00:01:26.250 -Itu saja! +Begitulah! 24 00:01:26.250 --> 00:01:31.020 -Sekarang, Anda mengetahui apa itu frasa pemulihan rahasia dan cara mempertahankan agar dompet Anda tetap aman dan terjaga. - +Sekarang, Anda tahu apa itu frasa pemulihan rahasia +dan cara menjaga dompet Anda tetap aman. diff --git a/app/images/videos/recovery-onboarding/subtitles/ja.vtt b/app/images/videos/recovery-onboarding/subtitles/ja.vtt index 91849500b416..e99b3b7a48d6 100644 --- a/app/images/videos/recovery-onboarding/subtitles/ja.vtt +++ b/app/images/videos/recovery-onboarding/subtitles/ja.vtt @@ -2,91 +2,108 @@ WEBVTT 1 00:00:00.780 --> 00:00:04.580 -MetaMask はサイトやアプリケーションに接続する新たな手段となります。 +MetaMask は +をサイトとアプリケーションにつなぐ新たな方法です。 2 -00:00:04.580 --> 00:00:08.860 -従来の Web サイトでは、中央データベースや銀行がアカウントの +00:00:04.580 --> 00:00:08.860 +従来のウェブサイト上では、中央データベース +または銀行がアカウントの制御と 3 00:00:08.860 --> 00:00:10.179 -管理と復元を行います。 +回復の責任を負います。 4 00:00:10.179 --> 00:00:15.050 -一方 MetaMask では、マスターキーの所有者がすべての権限を握っています。 +しかし、MetaMask 上では、全ての権限は +マスターキーの保持者に属します。 5 00:00:15.050 --> 00:00:18.460 -キーを持っている人がアカウントを管理できるのです。 +当該のキーの保持者が、アカウントを制御します。 6 00:00:18.460 --> 00:00:21.110 -秘密のリカバリーフレーズがその「マスターキー」となります。 +あなたのシークレット リカバリー フレーズ +があなたの「マスターキー」です。 7 00:00:21.110 --> 00:00:26.070 -これは MetaMask のセットアップ時に生成される 12 単語からなるフレーズで、 +これは一連の 12 の単語で +あなたが最初に MetaMask を設定した際に自動生成され、これにより 8 00:00:26.070 --> 00:00:30.120 -万が一アクセスできなくなった際にウォレットと資金を復元できます。 +あなたは万が一アクセス出来なくなった場合に +ウォレットと資金を復元できます。 9 00:00:30.120 --> 00:00:33.451 -ウォレットの安全を保つため、 +ウォレットの安全性を確保することは非常に重要 +であり、あなたの 10 00:00:33.451 --> 00:00:37.510 -秘密のリカバリーフレーズは厳重に保管し、絶対に秘密にしてください。 +シークレット リカバリー フレーズ +を非常に安全かつ秘密に保つことで実現します。 11 00:00:37.510 --> 00:00:41.429 -誰かの手に渡ると、ウォレットへの「マスターキー」として使用され、 +誰かがそれにアクセスすれば、彼らは +あなたのウォレットの「マスターキー」を得て、 12 00:00:41.429 --> 00:00:45.190 -すべての資金にアクセスし盗むことが可能になります。 +あなたの資金に自由にアクセスして全てを奪えます。 13 00:00:45.190 --> 00:00:50.109 -MetaMask ウォレットを安全に保つため、秘密のリカバリーフレーズは大切に保管してください。 +MetaMask ウォレットの安全性を確保するため +あなたは シークレット リカバリー フレーズを安全に保存したくなるでしょう。 14 00:00:50.109 --> 00:00:54.930 -書き留めて、どこかに隠したり、安全な金庫に保管したり、 +それを書き留めたり、どこかへ隠したり、 +セーフティボックスに入れたり 15 00:00:54.930 --> 00:00:57.729 -セキュアなパスワードマネージャーを使用することもできます。 +または安全確保のためのパスワードマネジャーを使用できます。 16 00:00:57.729 --> 00:01:01.050 -金属製のプレートにフレーズを彫るユーザーもいます! +自分たちの +フレーズをメタルプレートに彫るユーザーさえいます! 17 00:01:01.050 --> 00:01:04.440 -秘密のリカバリーフレーズをなくした場合、MetaMask チームを含め、 +何者も、 +MetaMask のチームのメンバーですら、あなたが 18 00:01:04.440 --> 00:01:07.820 -誰にもウォレットの復元を行うことはできません。 +シークレット リカバリー フレーズを無くしたら +あなたのウォレットを復元する手助けはできません。 19 00:01:07.820 --> 00:01:12.072 -秘密のリカバリーフレーズを書き留めて安全な場所に保管していない場合は、 +あなたがシークレット リカバリー +フレーズを書き留め安全な場所に保管していないのならば、 20 00:01:12.072 --> 00:01:15.492 -今すぐ行ってください。その間お待ちします。 +ぜひ今それを実行してください。お待ちしております。 21 00:01:15.500 --> 00:01:20.780 -繰り返しになりますが、秘密のリカバリーフレーズは MetaMask チームを含め、絶対に誰にも教えないでください。 +さらに、あなたのシークレット リカバリー +フレーズを誰とも決して共有しないことを忘れないでください。私たちでさえも。 22 00:01:20.780 --> 00:01:24.910 -誰かに尋ねられたら、それは詐欺だと思ってください。 +それを尋ねる者がいたら、 +彼らはあなたを騙そうとしているのです。 23 00:01:24.910 --> 00:01:26.250 @@ -94,5 +111,5 @@ MetaMask ウォレットを安全に保つため、秘密のリカバリーフ 24 00:01:26.250 --> 00:01:31.020 -これで秘密のリカバリーフレーズとウォレットの安全を保つ方法の説明は終わりです。 - +これでシークレット リカバリ フレーズ +が何であるか、あなたのウォレットと資金の安全を確保する方法が判りました。 diff --git a/app/images/videos/recovery-onboarding/subtitles/ko.vtt b/app/images/videos/recovery-onboarding/subtitles/ko.vtt index 60ff4e771e25..68c04d1ae46d 100644 --- a/app/images/videos/recovery-onboarding/subtitles/ko.vtt +++ b/app/images/videos/recovery-onboarding/subtitles/ko.vtt @@ -2,97 +2,114 @@ WEBVTT 1 00:00:00.780 --> 00:00:04.580 -MetaMask는 사이트와 애플리케이션을 연결하는 새로운 방법입니다. +MetaMask는 사이트와 애플리케이션에 +연결할 수 있는 새로운 방법입니다. 2 -00:00:04.580 --> 00:00:08.860 -기존의 웹사이트는 중앙 데이터베이스나 은행에 계정 복구의 +00:00:04.580 --> 00:00:08.860 +전통적인 웹사이트에서는 중앙 데이터베이스 +또는 은행에게 계정을 제어 및 3 00:00:08.860 --> 00:00:10.179 -책임이 있습니다. +복구할 책임이 있습니다. 4 00:00:10.179 --> 00:00:15.050 -MetaMask에서는 모든 권한이 마스터 키 소유자에게 있습니다. +하지만 MetaMask에서는 모든 권한이 +마스터 키의 소유자에게 있습니다. 5 00:00:15.050 --> 00:00:18.460 -마스터 키를 소유한 사람이 해당 계정의 소유자가 됩니다. +키를 보유하고 있는 사람은 계정을 제어합니다. 6 00:00:18.460 --> 00:00:21.110 -여러분이 가지고 계시는 비밀 복구 구문이 바로 '마스터 키'입니다. +계정 시드 구문은 +"마스터 키"입니다. 7 00:00:21.110 --> 00:00:26.070 -이는 처음 MetaMask 계정을 만들 때 생성된 12개의 단어로 이루어진 암호이며 +먼저 MetaMask를 설정하면, 일련의 +12단어가 생성되어, 8 00:00:26.070 --> 00:00:30.120 -이를 사용하면 유사시에 지갑과 자금을 회복할 수 있습니다. +접근 권한을 상실했을 때 지갑과 +자금을 복구할 수 있습니다. 9 00:00:30.120 --> 00:00:33.451 -따라서 지갑을 안전하게 지키려면 이러한 비밀 복구 구문을 +계정 시드 구문을 +안전하게 비밀을 10 00:00:33.451 --> 00:00:37.510 -매우 안전한 비밀장소에 보관하는 것이 중요합니다. +유지하여 지갑을 안전하게 +지키는 것이 중요합니다. 11 00:00:37.510 --> 00:00:41.429 -누구든지 비밀 복구 구문을 알게 되면 해당 지갑에 대한 '마스터 키'를 손에 넣게 되며 +계정 시드 구문에 액세스하는 사람에게는 +지갑에 대한 "마스터 키"가 있어 자유롭게 12 00:00:41.429 --> 00:00:45.190 -해당 계정의 자금을 모두 인출할 수 있게 됩니다. +액세스하여 모든 자금을 가져갈 수 있습니다. 13 00:00:45.190 --> 00:00:50.109 -MetaMask 지갑의 보안을 유지하려면 비밀 복구 구문을 안전하게 저장해야 합니다. +MetaMask 지갑을 안전하게 보호하려면, 계정 시드 +구문을 저장할 수 있습니다. 14 00:00:50.109 --> 00:00:54.930 -이를 적어 별도의 장소나 안전 금고에 보관할 수도 있고 +계정 시드 구문을 적어서 어딘가에 숨겨두거나 +대여 금고에 두거나 15 00:00:54.930 --> 00:00:57.729 -비밀번호 관리자를 이용하셔도 좋습니다. +보안 암호 관리자를 사용할 수 있습니다. 16 00:00:57.729 --> 00:01:01.050 -사용자에 따라 이를 금속판에 새겨 놓기도 합니다! +일부 사용자는 자신의 구문을 +금속판에 새겨두기도 합니다! 17 00:01:01.050 --> 00:01:04.440 -이러한 비밀 복구 구문을 분실하면 아무도, 심지어 MetaMask도 +계정 시드 구문을 잊으면, +MetaMask의 팀이라고 18 00:01:04.440 --> 00:01:07.820 -계정 복구를 도와드릴 수 없습니다. +해도 지갑을 +복구할 수 없습니다. 19 00:01:07.820 --> 00:01:12.072 -아직 비밀 복구 구문을 적어 안전한 곳에 보관하지 않으셨다면, +게정 시드 구문을 적어두지 +않으면, 안전한 장소에 20 00:01:12.072 --> 00:01:15.492 -지금 바로 하세요. 기다리겠습니다. +보관하십시오. 기다리겠습니다. 21 00:01:15.500 --> 00:01:20.780 -절대로 본인의 비밀 복구 구문을 다른 사람에게 알려주지 마세요. MetaMask에도 알리면 안 됩니다. +다른 사람과 계정 시드 구문을 +고유하면 안 됩니다. 당사하고도 공유하지 마십시오. 22 00:01:20.780 --> 00:01:24.910 -이를 묻는 사람이 있다면 피싱 범죄자임에 틀림없습니다. +계정 시드 구문을 요청하는 사람은 +사기를 치려고 하는 것입니다. 23 00:01:24.910 --> 00:01:26.250 -그렇습니다! +이제 다 됐습니다. 24 00:01:26.250 --> 00:01:31.020 -이제 비밀 복구 구문과 지갑을 안전하게 보관하는 방법에 대하여 확인하였습니다. - +이제 여러분은 계정 시드 구문이 무엇이고 +지갑을 안전하게 보관하는 방법을 알고 있습니다. diff --git a/app/images/videos/recovery-onboarding/subtitles/pt.vtt b/app/images/videos/recovery-onboarding/subtitles/pt.vtt index 6a05682e922c..bebef88e17b7 100644 --- a/app/images/videos/recovery-onboarding/subtitles/pt.vtt +++ b/app/images/videos/recovery-onboarding/subtitles/pt.vtt @@ -2,108 +2,108 @@ WEBVTT 1 00:00:00.780 --> 00:00:04.580 -A MetaMask é uma nova forma -de se conectar a sites e aplicativos. +O MetaMask é um novo jeito de se conectar +a sites e aplicativos. 2 -00:00:04.580 --> 00:00:08.860 -Em sites tradicionais, uma base de dados central -ou um banco é responsável por controlar e +00:00:04.580 --> 00:00:08.860 +Em websites tradicionais, um banco ou base de dados central +é responsável por controlar e 3 00:00:08.860 --> 00:00:10.179 -recuperar suas contas. +recuperar as suas contas. 4 00:00:10.179 --> 00:00:15.050 -Mas, na MetaMask, todo o poder pertence +Mas, no MetaMask, todo o poder pertence ao titular de uma chave-mestra. 5 00:00:15.050 --> 00:00:18.460 -Quem tiver a chave controla as contas. +Quem quer que detenha a chave controla as contas. 6 00:00:18.460 --> 00:00:21.110 -Sua frase de recuperação secreta -é sua "chave-mestra". +A sua frase de recuperação secreta +é a sua "chave-mestra". 7 00:00:21.110 --> 00:00:26.070 -Ela é uma série de 12 palavras geradas quando você -configura a MetaMask pela primeira vez, a qual permite +É uma série de 12 palavras que são geradas +quando você configura o MetaMask na primeira vez, o que permite que 8 00:00:26.070 --> 00:00:30.120 -recuperar sua carteira e fundos -caso você perca o acesso. +você recupere a sua carteira e recursos, caso você +venha a perder o acesso. 9 00:00:30.120 --> 00:00:33.451 -É importante que você proteja -sua carteira guardando sua +É importante que você mantenha protegida +a sua carteira ao manter a sua 10 00:00:33.451 --> 00:00:37.510 frase de recuperação secreta -de forma bem segura e sigilosa. +muito segura e muito secreta. 11 00:00:37.510 --> 00:00:41.429 -Se alguém tiver acesso a ela, terá em mãos -a "chave-mestra" da sua carteira e poderá +Caso alguém obtenha acesso a ela, essa pessoa terá +a "chave-mestra" para a sua carteira e poderá 12 00:00:41.429 --> 00:00:45.190 -acessar e retirar livremente todos os seus fundos. +acessá-la livremente e tome todos os seus recursos. 13 00:00:45.190 --> 00:00:50.109 -Para proteger sua carteira MetaMask, recomenda-se -salvar sua frase de recuperação secreta de modo seguro. +A fim de proteger a sua carteira MetaMask, você desejará +manter em segurança a sua frase de recuperação secreta. 14 00:00:50.109 --> 00:00:54.930 -Você pode anotá-la por escrito, escondê-la -em algum lugar, colocá-la em um cofre +Você pode escrevê-la, escondê-la em algum lugar, +colocá-la em um cofre 15 00:00:54.930 --> 00:00:57.729 -ou usar um gerenciador de senhas protegido. +ou usar um gerenciador de senhas seguras. 16 00:00:57.729 --> 00:01:01.050 -Alguns usuários até mesmo gravam -a frase em uma placa de metal! +Alguns usuários até mesmo gravam sua +frase em uma placa de metal! 17 00:01:01.050 --> 00:01:04.440 Ninguém, nem mesmo a equipe -da MetaMask, pode ajudar você +na MetaMask, pode lhe ajudar 18 00:01:04.440 --> 00:01:07.820 -a recuperar sua carteira caso perca -sua frase de recuperação secreta. +a recuperar a sua carteira, caso você perca +a sua frase de recuperação secreta. 19 00:01:07.820 --> 00:01:12.072 -Se não tiver anotado por escrito sua frase de recuperação -secreta e a armazenado em um lugar seguro, +Caso você não tenha escrito a sua frase de recuperação +secreta e a tenha armazenado em algum lugar seguro, 20 00:01:12.072 --> 00:01:15.492 -faça isso agora. A gente espera. +faça isso agora. Iremos aguardar. 21 00:01:15.500 --> 00:01:20.780 -E lembre-se: nunca compartilhe sua frase de recuperação -secreta com ninguém, nem mesmo conosco. +E lembre-se de jamais compartilhar a sua frase de recuperação +secreta com ninguém: nem mesmo conosco. 22 00:01:20.780 --> 00:01:24.910 -Se alguém a pedir a você, -é uma tentativa de fraude. +Caso alguém venha a lhe pedir a sua frase de recuperação secreta, +essa pessoa está tentando dar um golpe em você. 23 00:01:24.910 --> 00:01:26.250 @@ -111,6 +111,5 @@ Se alguém a pedir a você, 24 00:01:26.250 --> 00:01:31.020 -Agora você sabe o que é uma frase de recuperação -secreta e como manter sua carteira segura. - +Agora, você sabe o que é uma frase de recuperação secreta +e como manter a sua carteira protegida e segura. diff --git a/app/images/videos/recovery-onboarding/subtitles/ru.vtt b/app/images/videos/recovery-onboarding/subtitles/ru.vtt index 221c48547546..46c165a6aa6d 100644 --- a/app/images/videos/recovery-onboarding/subtitles/ru.vtt +++ b/app/images/videos/recovery-onboarding/subtitles/ru.vtt @@ -6,8 +6,9 @@ MetaMask — это новый способ подключения к сайтам и приложениям. 2 -00:00:04.580 --> 00:00:08.860 -На традиционных сайтах центральная база данных или банк отвечает за контроль и +00:00:04.580 --> 00:00:08.860 +На традиционных сайтах центральная база данных +или банк несет ответственность за контроль и 3 00:00:08.860 --> 00:00:10.179 @@ -15,72 +16,80 @@ MetaMask — это новый способ подключения 4 00:00:10.179 --> 00:00:15.050 -Но в MetaMask все полномочия в руках -обладателя главного ключа. +На MetaMask все полномочия находятся +в руках владельца мастер-ключа. 5 00:00:15.050 --> 00:00:18.460 -Тот, кто имеет этот ключ, контролирует счета. +Тот, в чьих руках находится ключ, контролирует счета. 6 00:00:18.460 --> 00:00:21.110 -Ваша секретная фраза восстановления — это ваш главный ключ. +Ваша секретная фраза восстановления +— это ваш «мастер-ключ». 7 00:00:21.110 --> 00:00:26.070 -Это последовательность из 12 слов, которые генерируются при первой настройке MetaMask и позволяет +Это набор из 12 слов, которые генерируются +при первой настройке MetaMask, он позволяет 8 00:00:26.070 --> 00:00:30.120 -вам восстановить свой кошелек и средства, если вы -когда-либо утратите доступ к ним. +вам восстанавливать ваш кошелек и средства, если вы +теряете к ним доступ. 9 00:00:30.120 --> 00:00:33.451 Важно, чтобы вы обезопасили -свой кошелек, сохранив +свой кошелек, храня вашу 10 00:00:33.451 --> 00:00:37.510 -секретную фразу для восстановления -в очень надежном месте и в полной тайне. +секретную фразу восстановления +в очень надежном и тайном месте. 11 00:00:37.510 --> 00:00:41.429 -Если кто-то узнает ее, у этого человека будет -главный ключ к вашему кошельку, и он сможет +Если кто-то получит доступ к ней, у этого человека окажется в руках +«мастер-ключ» от вашего кошелька, и он сможет 12 00:00:41.429 --> 00:00:45.190 -получить свободный доступ ко всем вашим средствам и забрать их. +распоряжаться им и завладеть всеми вашими средствами. 13 00:00:45.190 --> 00:00:50.109 -Чтобы защитить кошелек MetaMask, вам необходимо безопасно сохранить секретную фразу восстановления. +Чтобы обезопасить ваш кошелек MetaMask, +сохраните секретную фразу восстановления в безопасном месте. 14 00:00:50.109 --> 00:00:54.930 -Вы можете записать ее и спрятать куда-нибудь, положить в сейф +Вы можете записать ее, спрятать ее где-то, +положить ее в банковский сейф 15 00:00:54.930 --> 00:00:57.729 -или использовать безопасный менеджер паролей. +или воспользоваться безопасным диспетчером паролей. 16 00:00:57.729 --> 00:01:01.050 -Некоторые пользователи даже гравируют свою фразу на металлической пластине! +Некоторые пользователи даже гравируют свою +фразу на металлической пластине! 17 00:01:01.050 --> 00:01:04.440 -Никто, даже команда MetaMask, не сможет вам помочь +Никто, даже команда +MetaMask, не сможет помочь вам 18 00:01:04.440 --> 00:01:07.820 -восстановить кошелек, если вы потеряете секретную фразу для восстановления. +восстановить ваш кошелек, если вы потеряете +вашу секретную фразу восстановления. 19 00:01:07.820 --> 00:01:12.072 -Если вы не записали свою секретную фразу для восстановления и не сохранили ее в безопасном месте, +Если вы еще не записали секретную фразу +восстановления и не поместили ее в надежное место, 20 00:01:12.072 --> 00:01:15.492 @@ -88,11 +97,13 @@ MetaMask — это новый способ подключения 21 00:01:15.500 --> 00:01:20.780 -И помните: никогда никому не сообщайте свою секретную фразу для восстановления, даже нам. +И помните, никогда не сообщайте свою секретную фразу +восстановления никому: даже нам. 22 00:01:20.780 --> 00:01:24.910 -Если кто-то когда-нибудь попросит вас предоставить ее, этот человек пытается вас обмануть. +Если кто-нибудь когда-либо спросит у вас ее, +этот человек пытается вас обмануть. 23 00:01:24.910 --> 00:01:26.250 @@ -100,5 +111,5 @@ MetaMask — это новый способ подключения 24 00:01:26.250 --> 00:01:31.020 -Теперь вы знаете, что такое секретная фраза для восстановления и как сохранить свой кошелек в целости и сохранности. - +Теперь вы знаете, что такое секретная фраза восстановления +и как обезопасить ваш кошелек. diff --git a/app/images/videos/recovery-onboarding/subtitles/tl.vtt b/app/images/videos/recovery-onboarding/subtitles/tl.vtt index b4fdbb7cd1ef..cfb3ebca76d3 100644 --- a/app/images/videos/recovery-onboarding/subtitles/tl.vtt +++ b/app/images/videos/recovery-onboarding/subtitles/tl.vtt @@ -6,7 +6,7 @@ Ang MetaMask ay isang bagong paraan para kumonekta sa mga site at application. 2 -00:00:04.580 --> 00:00:08.860 +00:00:04.580 --> 00:00:08.860 Sa mga tradisyonal na website, ang isang central database o bangko ang magiging responsable sa pagkontrol at @@ -113,4 +113,3 @@ sinusubukan ka nilang i-scam. 00:01:26.250 --> 00:01:31.020 Ngayon ay alam mo na kung ano ang lihim na recovery phrase at kung paano mapapanatiling ligtas ang iyong wallet. - diff --git a/app/images/videos/recovery-onboarding/subtitles/tr.vtt b/app/images/videos/recovery-onboarding/subtitles/tr.vtt deleted file mode 100644 index 0e1fef01d754..000000000000 --- a/app/images/videos/recovery-onboarding/subtitles/tr.vtt +++ /dev/null @@ -1,116 +0,0 @@ -WEBVTT - -1 -00:00:00.780 --> 00:00:04.580 -MetaMask site ve uygulamalara -bağlanmanın yeni bir yoludur. - -2 -00:00:04.580 --> 00:00:08.860 -Geleneksel web sitelerinde, -merkezi bir veritabanı veya banka - -3 -00:00:08.860 --> 00:00:10.179 -hesaplarınızı korumaktan sorumludur. - -4 -00:00:10.179 --> 00:00:15.050 -Ama MetaMask'ta tüm güç -ana anahtar sahibine aittir. - -5 -00:00:15.050 --> 00:00:18.460 -Anahtar kimdeyse hesapları o kontrol eder. - -6 -00:00:18.460 --> 00:00:21.110 -Gizli kurtarma ifadeniz -sizin "ana anahtarınızdır". - -7 -00:00:21.110 --> 00:00:26.070 -MetaMask'ı ilk kurduğunuzda oluşturulan -12 sözcükten oluşan bir dizi olup - -8 -00:00:26.070 --> 00:00:30.120 -erişiminizi kaybettiğiniz takdirde -cüzdanınızı ve paralarınızı kurtarabilmenize olanak sağlar. - -9 -00:00:30.120 --> 00:00:33.451 -Gizli kurtarma ifadenizi -çok güvenli ve çok gizli tutarak - -10 -00:00:33.451 --> 00:00:37.510 -cüzdanınızı korumanız -önemlidir. - -11 -00:00:37.510 --> 00:00:41.429 -Gizli kurtarma ifadenize sahip olan kişi -cüzdanınızın "ana anahtarı"na sahip olacak ve - -12 -00:00:41.429 --> 00:00:45.190 -serbestçe erişim sağlayıp tüm paranızı alabilecektir. - -13 -00:00:45.190 --> 00:00:50.109 -MetaMask cüzdanınızı korumak için gizli kurtarma -ifadenizin güvenli bir şekilde saklamak isteyeceksiniz. - -14 -00:00:50.109 --> 00:00:54.930 -Yazıp bir yere saklayabilir, -güvenli bir kasaya koyabilirsiniz - -15 -00:00:54.930 --> 00:00:57.729 -veya güvenli bir şifre yöneticisi kullanabilirsiniz. - -16 -00:00:57.729 --> 00:01:01.050 -İfadelerini metal bir levhaya kazıyan -kullanıcılar bile görülmüştür! - -17 -00:01:01.050 --> 00:01:04.440 -Gizli kurtarma ifadenizi kaybettiğiniz takdirde -MetaMask ekibi dahil olmak üzere hiç kimse - -18 -00:01:04.440 --> 00:01:07.820 -cüzdanınızı kurtarmanıza -yardımcı olamaz. - -19 -00:01:07.820 --> 00:01:12.072 -Gizli kurtarma ifadenizi yazmadıysanız veya -güvenli bir yere saklamadıysanız - -20 -00:01:12.072 --> 00:01:15.492 -bunu şimdi yapın. Bekleyeceğiz. - -21 -00:01:15.500 --> 00:01:20.780 -Ayrıca gizli kurtarma ifadenizi asla -biz dahil hiç kimse ile paylaşmamanız gerektiğini unutmayın. - -22 -00:01:20.780 --> 00:01:24.910 -Birisi gizli kurtarma ifadenizi sizden istiyorsa -sizi dolandırmaya çalışıyordur. - -23 -00:01:24.910 --> 00:01:26.250 -Bu kadar! - -24 -00:01:26.250 --> 00:01:31.020 -Artık gizli kurtarma ifadesinin ne olduğunu ve -cüzdanınızı nasıl güvende tutacağınızı biliyorsunuz. - diff --git a/app/images/videos/recovery-onboarding/subtitles/vi.vtt b/app/images/videos/recovery-onboarding/subtitles/vi.vtt index 69875b90a592..a05e97d85562 100644 --- a/app/images/videos/recovery-onboarding/subtitles/vi.vtt +++ b/app/images/videos/recovery-onboarding/subtitles/vi.vtt @@ -2,114 +2,114 @@ WEBVTT 1 00:00:00.780 --> 00:00:04.580 -MetaMask là một cách mới để kết nối -đến các trang web và ứng dụng. +MetaMask là cách thức mới để kết nối +với các trang web và ứng dụng. 2 -00:00:04.580 --> 00:00:08.860 -Trên các trang web truyền thống, cơ sở dữ liệu trung tâm -hoặc ngân hàng sẽ chịu trách nhiệm kiểm soát và +00:00:04.580 --> 00:00:08.860 +Trên các trang web truyền thống, một cơ sở dữ liệu trung tâm +hay ngân hàng sẽ chịu trách nhiệm kiểm soát và 3 00:00:08.860 --> 00:00:10.179 -khôi phục tài khoản của bạn. +khôi phục các tài khoản của bạn. 4 00:00:10.179 --> 00:00:15.050 -Nhưng trên MetaMask, tất cả quyền lực thuộc về -người nắm giữ chìa khóa chính. +Tuy nhiên, trên MetaMask, toàn bộ quyền sẽ thuộc về +người nắm giữ khóa chính. 5 00:00:15.050 --> 00:00:18.460 -Ai nắm giữ chìa khóa, người đó kiểm soát tài khoản. +Người có khóa chính sẽ kiểm soát được tài khoản. 6 00:00:18.460 --> 00:00:21.110 -Cụm từ khôi phục bí mật -là "chìa khóa chính" của bạn. +Cụm mật khẩu khôi phục bí mật +là “khóa chính” của bạn. 7 00:00:21.110 --> 00:00:26.070 -Đó là một chuỗi 12 từ được tạo ra -khi bạn thiết lập MetaMask lần đầu tiên, cho phép +Đây là chuỗi gồm 12 từ được tạo +vào lần đầu tiên bạn thiết lập MetaMask, chuỗi này cho phép 8 00:00:26.070 --> 00:00:30.120 -bạn khôi phục ví và tiền của mình nếu bị mất quyền truy cập. +bạn khôi phục ví và tiền của mình nếu +bạn bị mất quyền truy cập. 9 00:00:30.120 --> 00:00:33.451 -Điều quan trọng là bạn phải bảo mật -cho ví của mình bằng cách cất giữ +Bạn cần phải bảo vệ an toàn cho +ví của mình bằng cách lưu giữ 10 00:00:33.451 --> 00:00:37.510 -cụm từ khôi phục bí mật ở một nơi -cực kỳ an toàn và bí mật. +cụm mật khẩu khôi phục bí mật +thật an toàn và bí mật. 11 00:00:37.510 --> 00:00:41.429 -Nếu bất kỳ ai có quyền truy cập, họ sẽ biết -"chìa khóa chính" để vào ví của bạn và có thể +Nếu ai đó có được cụm mật khẩu khôi phục bí mật của bạn thì người đó sẽ có +“khóa chính” cho ví của bạn và có thể 12 00:00:41.429 --> 00:00:45.190 -tự do truy cập và lấy hết tiền của bạn. +tự do truy cập và lấy toàn bộ tiền của bạn. 13 00:00:45.190 --> 00:00:50.109 -Để bảo mật cho ví MetaMask của mình, bạn sẽ cần -cất giữ cụm từ khôi phục bí mật ở một nơi an toàn. +Để bảo vệ an toàn cho ví MetaMask, bạn cần +lưu giữ cụm mật khẩu khôi phục bí mật một cách an toàn. 14 00:00:50.109 --> 00:00:54.930 -Hãy viết ra giấy, giấu ở đâu đó, -bỏ vào hộp ký gửi an toàn +Bạn có thể chép lại và giấu ở một nơi nào đó, +cất trong hộp ký gửi an toàn 15 00:00:54.930 --> 00:00:57.729 -hoặc sử dụng trình quản lý mật khẩu an toàn. +hoặc dùng một trình quản lý mật khẩu an toàn. 16 00:00:57.729 --> 00:01:01.050 Một số người dùng thậm chí còn khắc -cụm từ của họ lên một tấm kim loại! +cụm mật khẩu của họ lên một tấm kim loại! 17 00:01:01.050 --> 00:01:04.440 -Sẽ không có ai, kể cả nhóm -MetaMask, có thể giúp bạn +Không một ai, kể cả đội ngũ +tại MetaMask, có thể giúp bạn 18 00:01:04.440 --> 00:01:07.820 -khôi phục ví nếu bạn làm mất -cụm từ khôi phục bí mật. +khôi phục lại ví nếu bạn đánh mất +cụm mật khẩu khôi phục bí mật của mình. 19 00:01:07.820 --> 00:01:12.072 -Nếu bạn chưa viết cụm từ khôi phục bí mật -ra giấy và cất giữ ở một nơi nào đó an toàn, +Nếu chưa ghi lại cụm mật khẩu khôi phục bí mật +của mình và lưu giữ ở nơi an toàn, 20 00:01:12.072 --> 00:01:15.492 -thì bạn cần thực hiện ngay. Chúng tôi sẽ đợi. +thì bạn hãy thực hiện ngay bây giờ. Chúng tôi sẽ chờ bạn. 21 00:01:15.500 --> 00:01:20.780 -Và hãy nhớ, không bao giờ chia sẻ cụm từ khôi phục -bí mật của bạn với bất kỳ ai: ngay cả chúng tôi. +Và đừng bao giờ chia sẻ cụm mật khẩu khôi phục +bí mật với bất kỳ ai: kể cả chúng tôi. 22 00:01:20.780 --> 00:01:24.910 -Nếu bất kỳ ai hỏi bạn về cụm từ khôi phục -bí mật, thì họ đang cố lừa bạn đó. +Nếu ai đó hỏi bạn cụm mật khẩu khôi phục bí mật, +thì họ đang cố gắng lừa đảo bạn. 23 00:01:24.910 --> 00:01:26.250 -Đó là tất cả những gì bạn cần ghi nhớ! +Xin hãy ghi nhớ! 24 00:01:26.250 --> 00:01:31.020 -Bây giờ bạn đã biết cụm từ khôi phục bí mật là gì -và cách để đảm bảo an toàn và bảo mật cho ví của bạn. - +Bây giờ bạn đã biết cụm mật khẩu khôi phục bí mật +là gì và cách bảo vệ ví của bạn an toàn và bảo mật. diff --git a/app/images/videos/recovery-onboarding/subtitles/zh.vtt b/app/images/videos/recovery-onboarding/subtitles/zh.vtt deleted file mode 100644 index 8e1a572f276c..000000000000 --- a/app/images/videos/recovery-onboarding/subtitles/zh.vtt +++ /dev/null @@ -1,98 +0,0 @@ -WEBVTT - -1 -00:00:00.780 --> 00:00:04.580 -MetaMask是连接站点和应用程序的一种新方法。 - -2 -00:00:04.580 --> 00:00:08.860 -在传统网站上,中央数据库或银行负责控制和 - -3 -00:00:08.860 --> 00:00:10.179 -恢复您的账户。 - -4 -00:00:10.179 --> 00:00:15.050 -但在MetaMask,所有的权限都属于主密钥的持有者。 - -5 -00:00:15.050 --> 00:00:18.460 -谁拿着密钥,谁就控制着账户。 - -6 -00:00:18.460 --> 00:00:21.110 -您的私钥助记词是您的“主密钥”。 - -7 -00:00:21.110 --> 00:00:26.070 -这是在您第一次设置MetaMask时生成的12个单词的字串, - -8 -00:00:26.070 --> 00:00:30.120 -如果您一旦失去访问权限,可以使用该助记词恢复您的钱包和资金。 - -9 -00:00:30.120 --> 00:00:33.451 -重要的是,您应通过非常保险而私密的方式保护您的 - -10 -00:00:33.451 --> 00:00:37.510 -私钥助记词的安全,从而确保您的钱包安全。 - -11 -00:00:37.510 --> 00:00:41.429 -如果有人可以获取您的私钥助记词,他们将拥有您钱包的“主密钥”,可以 - -12 -00:00:41.429 --> 00:00:45.190 -自由访问并拿走您的所有资金。 - -13 -00:00:45.190 --> 00:00:50.109 -为了保护MetaMask钱包的安全,您需要安全地保存您的私钥助记词。 - -14 -00:00:50.109 --> 00:00:54.930 -您可以把它写下来,藏在某处,放在保险箱里, - -15 -00:00:54.930 --> 00:00:57.729 -或者使用安全的密码管理器保存。 - -16 -00:00:57.729 --> 00:01:01.050 -一些用户甚至将他们的助记词刻在金属板上! - -17 -00:01:01.050 --> 00:01:04.440 -如果您丢失了私钥助记词,没有人能帮助您找回钱包,即使是MetaMask - -18 -00:01:04.440 --> 00:01:07.820 -的团队也毫无办法。 - -19 -00:01:07.820 --> 00:01:12.072 -如果您尚未写下您的私钥助记词并将其存储在安全的地方, - -20 -00:01:12.072 --> 00:01:15.492 -请即刻着手做此事。我们会等待您的。 - -21 -00:01:15.500 --> 00:01:20.780 -记住,永远不要与任何人分享您的私钥助记词:即便是我们也不可以。 - -22 -00:01:20.780 --> 00:01:24.910 -如果有人向您索要私钥助记词,他们就是妄图欺诈您。 - -23 -00:01:24.910 --> 00:01:26.250 -就是这样! - -24 -00:01:26.250 --> 00:01:31.020 -现在,您了解了什么是私钥助记词,以及如何确保您的钱包安全。 - diff --git a/app/manifest/v2/_base.json b/app/manifest/_base.json similarity index 95% rename from app/manifest/v2/_base.json rename to app/manifest/_base.json index d10900224f27..c2b20b4dbeac 100644 --- a/app/manifest/v2/_base.json +++ b/app/manifest/_base.json @@ -66,12 +66,12 @@ "clipboardWrite", "http://localhost:8545/", "https://*.infura.io/", - "https://chainid.network/chains.json", "https://lattice.gridplus.io/*", "activeTab", "webRequest", "*://*.eth/", "notifications" ], - "short_name": "__MSG_appName__" + "short_name": "__MSG_appName__", + "web_accessible_resources": ["inpage.js", "phishing.html"] } diff --git a/app/manifest/v2/brave.json b/app/manifest/brave.json similarity index 100% rename from app/manifest/v2/brave.json rename to app/manifest/brave.json diff --git a/app/manifest/v2/chrome.json b/app/manifest/chrome.json similarity index 100% rename from app/manifest/v2/chrome.json rename to app/manifest/chrome.json diff --git a/app/manifest/v2/firefox.json b/app/manifest/firefox.json similarity index 100% rename from app/manifest/v2/firefox.json rename to app/manifest/firefox.json diff --git a/app/manifest/v2/opera.json b/app/manifest/opera.json similarity index 100% rename from app/manifest/v2/opera.json rename to app/manifest/opera.json diff --git a/app/manifest/v3/_base.json b/app/manifest/v3/_base.json deleted file mode 100644 index 38494de8fda9..000000000000 --- a/app/manifest/v3/_base.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "action": { - "default_icon": { - "16": "images/icon-16.png", - "19": "images/icon-19.png", - "32": "images/icon-32.png", - "38": "images/icon-38.png", - "64": "images/icon-64.png", - "128": "images/icon-128.png", - "512": "images/icon-512.png" - }, - "default_title": "MetaMask", - "default_popup": "popup.html" - }, - "author": "https://metamask.io", - "background": { - "service_worker": "app-init.js" - }, - "commands": { - "_execute_browser_action": { - "suggested_key": { - "windows": "Alt+Shift+M", - "mac": "Alt+Shift+M", - "chromeos": "Alt+Shift+M", - "linux": "Alt+Shift+M" - } - } - }, - "content_scripts": [ - { - "matches": ["file://*/*", "http://*/*", "https://*/*"], - "js": [ - "disable-console.js", - "globalthis.js", - "lockdown-install.js", - "lockdown-run.js", - "lockdown-more.js", - "contentscript.js" - ], - "run_at": "document_start", - "all_frames": true - }, - { - "matches": ["*://connect.trezor.io/*/popup.html"], - "js": ["vendor/trezor/content-script.js"] - } - ], - "default_locale": "en", - "description": "__MSG_appDescription__", - "icons": { - "16": "images/icon-16.png", - "19": "images/icon-19.png", - "32": "images/icon-32.png", - "38": "images/icon-38.png", - "48": "images/icon-48.png", - "64": "images/icon-64.png", - "128": "images/icon-128.png", - "512": "images/icon-512.png" - }, - "manifest_version": 3, - "name": "__MSG_appName__", - "permissions": [ - "storage", - "unlimitedStorage", - "clipboardWrite", - "http://localhost:8545/", - "https://*.infura.io/", - "https://chainid.network/chains.json", - "https://lattice.gridplus.io/*", - "activeTab", - "webRequest", - "*://*.eth/", - "notifications" - ], - "short_name": "__MSG_appName__" -} diff --git a/app/manifest/v3/brave.json b/app/manifest/v3/brave.json deleted file mode 100644 index 0967ef424bce..000000000000 --- a/app/manifest/v3/brave.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/app/manifest/v3/chrome.json b/app/manifest/v3/chrome.json deleted file mode 100644 index e4bb01cdd4b6..000000000000 --- a/app/manifest/v3/chrome.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "externally_connectable": { - "matches": ["https://metamask.io/*"], - "ids": ["*"] - }, - "minimum_chrome_version": "66" -} diff --git a/app/manifest/v3/firefox.json b/app/manifest/v3/firefox.json deleted file mode 100644 index 918311d54b77..000000000000 --- a/app/manifest/v3/firefox.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "applications": { - "gecko": { - "id": "webextension@metamask.io", - "strict_min_version": "68.0" - } - }, - "background": { - "page": "background.html", - "persistent": true - }, - "browser_action": { - "default_icon": { - "16": "images/icon-16.png", - "19": "images/icon-19.png", - "32": "images/icon-32.png", - "38": "images/icon-38.png", - "64": "images/icon-64.png", - "128": "images/icon-128.png", - "512": "images/icon-512.png" - }, - "default_title": "MetaMask", - "default_popup": "popup.html" - }, - "manifest_version": 2 -} diff --git a/app/manifest/v3/opera.json b/app/manifest/v3/opera.json deleted file mode 100644 index 6cfefd402510..000000000000 --- a/app/manifest/v3/opera.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "permissions": [ - "storage", - "tabs", - "clipboardWrite", - "clipboardRead", - "http://localhost:8545/" - ] -} diff --git a/app/phishing.html b/app/phishing.html new file mode 100644 index 000000000000..e854d79faa5d --- /dev/null +++ b/app/phishing.html @@ -0,0 +1,150 @@ + + + + MetaMask Phishing Detection + + + + + + + + + + +
+
+ MetaMask Logo +

+ + MetaMask Phishing Detection +

+
+
+

+ This domain is currently on the MetaMask domain warning list. This + means that based on information available to us, MetaMask believes + this domain could currently compromise your security and, as an added + safety feature, MetaMask has restricted access to the site. To + override this, please read the rest of this warning for instructions + on how to continue at your own risk. +

+

+ There are many reasons sites can appear on our warning list, and our + warning list compiles from other widely used industry lists. Such + reasons can include known fraud or security risks, such as domains + that test positive on the + Ethereum Phishing Detector. Domains on these warning lists may include outright malicious + websites and legitimate websites that have been compromised by a + malicious actor. +

+

+ To read more about this site + please search for the domain on CryptoScamDB. +

+

+ Note that this warning list is compiled on a voluntary basis. This + list may be inaccurate or incomplete. Just because a domain does not + appear on this list is not an implicit guarantee of that domain's + safety. As always, your transactions are your own responsibility. If + you wish to interact with any domain on our warning list, you can do + so by continuing at your own risk. +

+

+ If you think this domain is incorrectly flagged or if a blocked + legitimate website has resolved its security issues, + please file an issue. +

+
+
+ + diff --git a/app/popup.html b/app/popup.html index 831fe6122370..90117fc7996e 100644 --- a/app/popup.html +++ b/app/popup.html @@ -8,10 +8,7 @@ -
- - -
+
diff --git a/app/scripts/app-init.js b/app/scripts/app-init.js deleted file mode 100644 index c333e248a3de..000000000000 --- a/app/scripts/app-init.js +++ /dev/null @@ -1,124 +0,0 @@ -// This file is used only for manifest version 3 - -// Represents if importAllScripts has been run -// eslint-disable-next-line -let scriptsLoaded = false; - -// Variable testMode is set to true when preparing test build. -// This helps in changing service worker execution in test environment. -const testMode = false; - -const loadTimeLogs = []; - -// eslint-disable-next-line import/unambiguous -function tryImport(...fileNames) { - try { - const startTime = new Date().getTime(); - // eslint-disable-next-line - importScripts(...fileNames); - const endTime = new Date().getTime(); - loadTimeLogs.push({ - name: fileNames[0], - value: endTime - startTime, - children: [], - startTime, - endTime, - }); - - return true; - } catch (e) { - console.error(e); - } - - return false; -} - -function importAllScripts() { - // Bail if we've already imported scripts - if (scriptsLoaded) { - return; - } - - const files = []; - - // In testMode individual files are imported, this is to help capture load time stats - const loadFile = (fileName) => { - if (testMode) { - tryImport(fileName); - } else { - files.push(fileName); - } - }; - - const startImportScriptsTime = Date.now(); - // value of applyLavaMoat below is dynamically replaced at build time with actual value - const applyLavaMoat = true; - - loadFile('./globalthis.js'); - loadFile('./sentry-install.js'); - - if (applyLavaMoat) { - loadFile('./runtime-lavamoat.js'); - loadFile('./lockdown-more.js'); - loadFile('./policy-load.js'); - } else { - loadFile('./init-globals.js'); - loadFile('./lockdown-install.js'); - loadFile('./lockdown-run.js'); - loadFile('./lockdown-more.js'); - loadFile('./runtime-cjs.js'); - } - - // Mark scripts as loaded - scriptsLoaded = true; - - const fileList = [ - // The list of files is injected at build time by replacing comment below with comma separated strings of file names - // https://github.com/MetaMask/metamask-extension/blob/496d9d81c3367931031edc11402552690c771acf/development/build/scripts.js#L406 - /** FILE NAMES */ - ]; - - fileList.forEach((fileName) => loadFile(fileName)); - - // Import all required resources - tryImport(...files); - - const endImportScriptsTime = Date.now(); - - // for performance metrics/reference - console.log( - `SCRIPTS IMPORT COMPLETE in Seconds: ${ - (Date.now() - startImportScriptsTime) / 1000 - }`, - ); - - // In testMode load time logs are output to console - if (testMode) { - console.log( - `Time for each import: ${JSON.stringify( - { - name: 'Total', - children: loadTimeLogs, - startTime: startImportScriptsTime, - endTime: endImportScriptsTime, - value: endImportScriptsTime - startImportScriptsTime, - version: 1, - }, - undefined, - ' ', - )}`, - ); - } -} - -// eslint-disable-next-line no-undef -self.addEventListener('install', importAllScripts); - -/* - * Message event listener below loads script if they are no longer available. - * chrome below needs to be replaced by cross-browser object, - * but there is issue in importing webextension-polyfill into service worker. - * chrome does seems to work in at-least all chromium based browsers - */ -// eslint-disable-next-line no-undef -chrome.runtime.onMessage.addListener(importAllScripts); diff --git a/app/scripts/background.js b/app/scripts/background.js index 0246c5d738d4..ae85d781bb24 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -23,15 +23,11 @@ import { REJECT_NOTFICIATION_CLOSE, REJECT_NOTFICIATION_CLOSE_SIG, } from '../../shared/constants/metametrics'; -import { isManifestV3 } from '../../shared/modules/mv3.utils'; -import { maskObject } from '../../shared/modules/object.utils'; import migrations from './migrations'; import Migrator from './lib/migrator'; import ExtensionPlatform from './platforms/extension'; import LocalStore from './lib/local-store'; import ReadOnlyNetworkStore from './lib/network-store'; -import { SENTRY_STATE } from './lib/setupSentry'; - import createStreamSink from './lib/createStreamSink'; import NotificationManager, { NOTIFICATION_MANAGER_EVENTS, @@ -49,14 +45,6 @@ import { getPlatform } from './lib/util'; const { sentry } = global; const firstTimeState = { ...rawFirstTimeState }; -const metamaskInternalProcessHash = { - [ENVIRONMENT_TYPE_POPUP]: true, - [ENVIRONMENT_TYPE_NOTIFICATION]: true, - [ENVIRONMENT_TYPE_FULLSCREEN]: true, -}; - -const metamaskBlockedPorts = ['trezor-connect']; - log.setDefaultLevel(process.env.METAMASK_DEBUG ? 'debug' : 'info'); const platform = new ExtensionPlatform(); @@ -79,29 +67,8 @@ if (inTest || process.env.METAMASK_DEBUG) { global.metamaskGetState = localStore.get.bind(localStore); } -const phishingPageUrl = new URL(process.env.PHISHING_WARNING_PAGE_URL); - -const ONE_SECOND_IN_MILLISECONDS = 1_000; -// Timeout for initializing phishing warning page. -const PHISHING_WARNING_PAGE_TIMEOUT = ONE_SECOND_IN_MILLISECONDS; - -/** - * In case of MV3 we attach a "onConnect" event listener as soon as the application is initialised. - * Reason is that in case of MV3 a delay in doing this was resulting in missing first connect event after service worker is re-activated. - */ - -const initApp = async (remotePort) => { - browser.runtime.onConnect.removeListener(initApp); - await initialize(remotePort); - log.info('MetaMask initialization complete.'); -}; - -if (isManifestV3()) { - browser.runtime.onConnect.addListener(initApp); -} else { - // initialization flow - initialize().catch(log.error); -} +// initialization flow +initialize().catch(log.error); /** * @typedef {import('../../shared/constants/transaction').TransactionMeta} TransactionMeta @@ -161,83 +128,15 @@ if (isManifestV3()) { /** * Initializes the MetaMask controller, and sets up all platform configuration. * - * @param {string} remotePort - remote application port connecting to extension. * @returns {Promise} Setup complete. */ -async function initialize(remotePort) { +async function initialize() { const initState = await loadStateFromPersistence(); const initLangCode = await getFirstPreferredLangCode(); - await setupController(initState, initLangCode, remotePort); - await loadPhishingWarningPage(); + await setupController(initState, initLangCode); log.info('MetaMask initialization complete.'); } -/** - * An error thrown if the phishing warning page takes too long to load. - */ -class PhishingWarningPageTimeoutError extends Error { - constructor() { - super('Timeout failed'); - } -} - -/** - * Load the phishing warning page temporarily to ensure the service - * worker has been registered, so that the warning page works offline. - */ -async function loadPhishingWarningPage() { - let iframe; - try { - const extensionStartupPhishingPageUrl = new URL( - process.env.PHISHING_WARNING_PAGE_URL, - ); - // The `extensionStartup` hash signals to the phishing warning page that it should not bother - // setting up streams for user interaction. Otherwise this page load would cause a console - // error. - extensionStartupPhishingPageUrl.hash = '#extensionStartup'; - - iframe = window.document.createElement('iframe'); - iframe.setAttribute('src', extensionStartupPhishingPageUrl.href); - iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin'); - - // Create "deferred Promise" to allow passing resolve/reject to event handlers - let deferredResolve; - let deferredReject; - const loadComplete = new Promise((resolve, reject) => { - deferredResolve = resolve; - deferredReject = reject; - }); - - // The load event is emitted once loading has completed, even if the loading failed. - // If loading failed we can't do anything about it, so we don't need to check. - iframe.addEventListener('load', deferredResolve); - - // This step initiates the page loading. - window.document.body.appendChild(iframe); - - // This timeout ensures that this iframe gets cleaned up in a reasonable - // timeframe, and ensures that the "initialization complete" message - // doesn't get delayed too long. - setTimeout( - () => deferredReject(new PhishingWarningPageTimeoutError()), - PHISHING_WARNING_PAGE_TIMEOUT, - ); - await loadComplete; - } catch (error) { - if (error instanceof PhishingWarningPageTimeoutError) { - console.warn( - 'Phishing warning page timeout; page not guaraneteed to work offline.', - ); - } else { - console.error('Failed to initialize phishing warning page', error); - } - } finally { - if (iframe) { - iframe.remove(); - } - } -} - // // State and Persistence // @@ -306,10 +205,9 @@ async function loadStateFromPersistence() { * * @param {Object} initState - The initial state to start the controller with, matches the state that is emitted from the controller. * @param {string} initLangCode - The region code for the language preferred by the current user. - * @param {string} remoteSourcePort - remote application port connecting to extension. * @returns {Promise} After setup is complete. */ -function setupController(initState, initLangCode, remoteSourcePort) { +function setupController(initState, initLangCode) { // // MetaMask Controller // @@ -356,8 +254,6 @@ function setupController(initState, initLangCode, remoteSourcePort) { }, ); - setupSentryGetStateGlobal(controller.store); - /** * Assigns the given state to the versioned object (with metadata), and returns that. * @@ -398,13 +294,17 @@ function setupController(initState, initLangCode, remoteSourcePort) { // // connect to other contexts // - if (isManifestV3() && remoteSourcePort) { - connectRemote(remoteSourcePort); - } - browser.runtime.onConnect.addListener(connectRemote); browser.runtime.onConnectExternal.addListener(connectExternal); + const metamaskInternalProcessHash = { + [ENVIRONMENT_TYPE_POPUP]: true, + [ENVIRONMENT_TYPE_NOTIFICATION]: true, + [ENVIRONMENT_TYPE_FULLSCREEN]: true, + }; + + const metamaskBlockedPorts = ['trezor-connect']; + const isClientOpenStatus = () => { return ( popupIsOpen || @@ -462,23 +362,12 @@ function setupController(initState, initLangCode, remoteSourcePort) { remotePort.sender.origin === `chrome-extension://${browser.runtime.id}`; } - const senderUrl = remotePort.sender?.url - ? new URL(remotePort.sender.url) - : null; - if (isMetaMaskInternalProcess) { const portStream = new PortStream(remotePort); // communication with popup controller.isClientOpen = true; controller.setupTrustedCommunication(portStream, remotePort.sender); - if (isManifestV3()) { - // Message below if captured by UI code in app/scripts/ui.js which will trigger UI initialisation - // This ensures that UI is initialised only after background is ready - // It fixes the issue of blank screen coming when extension is loaded, the issue is very frequent in MV3 - remotePort.postMessage({ name: 'CONNECTION_READY' }); - } - if (processName === ENVIRONMENT_TYPE_POPUP) { popupIsOpen = true; endOfStream(portStream, () => { @@ -517,15 +406,6 @@ function setupController(initState, initLangCode, remoteSourcePort) { ); }); } - } else if ( - senderUrl && - senderUrl.origin === phishingPageUrl.origin && - senderUrl.pathname === phishingPageUrl.pathname - ) { - const portStream = new PortStream(remotePort); - controller.setupPhishingCommunication({ - connectionStream: portStream, - }); } else { if (remotePort.sender && remotePort.sender.tab && remotePort.sender.url) { const tabId = remotePort.sender.tab.id; @@ -600,14 +480,8 @@ function setupController(initState, initLangCode, remoteSourcePort) { if (count) { label = String(count); } - // browserAction has been replaced by action in MV3 - if (isManifestV3()) { - browser.action.setBadgeText({ text: label }); - browser.action.setBadgeBackgroundColor({ color: '#037DD6' }); - } else { - browser.browserAction.setBadgeText({ text: label }); - browser.browserAction.setBadgeBackgroundColor({ color: '#037DD6' }); - } + browser.browserAction.setBadgeText({ text: label }); + browser.browserAction.setBadgeBackgroundColor({ color: '#037DD6' }); } function getUnapprovedTransactionCount() { @@ -760,15 +634,3 @@ browser.runtime.onInstalled.addListener(({ reason }) => { platform.openExtensionInBrowser(); } }); - -function setupSentryGetStateGlobal(store) { - global.getSentryState = function () { - const fullState = store.getState(); - const debugState = maskObject(fullState, SENTRY_STATE); - return { - browser: window.navigator.userAgent, - store: debugState, - version: global.platform.getVersion(), - }; - }; -} diff --git a/app/scripts/constants/contracts.js b/app/scripts/constants/contracts.js index e822ccc7e5d7..90df403c2b07 100644 --- a/app/scripts/constants/contracts.js +++ b/app/scripts/constants/contracts.js @@ -6,17 +6,3 @@ export const SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN = '0xb8e671734ce5c8d7dfbbea5574fa4cf39f7a54a4'; export const SINGLE_CALL_BALANCES_ADDRESS_KOVAN = '0xb1d3fbb2f83aecd196f474c16ca5d9cffa0d0ffc'; -export const SINGLE_CALL_BALANCES_ADDRESS_GOERLI = - '0x9788C4E93f9002a7ad8e72633b11E8d1ecd51f9b'; -export const SINGLE_CALL_BALANCES_ADDRESS_BSC = - '0x2352c63A83f9Fd126af8676146721Fa00924d7e4'; -export const SINGLE_CALL_BALANCES_ADDRESS_OPTIMISM = - '0xB1c568e9C3E6bdaf755A60c7418C269eb11524FC'; -export const SINGLE_CALL_BALANCES_ADDRESS_POLYGON = - '0x2352c63A83f9Fd126af8676146721Fa00924d7e4'; -export const SINGLE_CALL_BALANCES_ADDRESS_AVALANCHE = - '0xD023D153a0DFa485130ECFdE2FAA7e612EF94818'; -export const SINGLE_CALL_BALANCES_ADDRESS_FANTOM = - '0x07f697424ABe762bB808c109860c04eA488ff92B'; -export const SINGLE_CALL_BALANCES_ADDRESS_ARBITRUM = - '0x151E24A486D7258dd7C33Fb67E4bB01919B7B32c'; diff --git a/app/scripts/constants/on-ramp.js b/app/scripts/constants/on-ramp.js index 0d621f46e8be..bfce16f700b6 100644 --- a/app/scripts/constants/on-ramp.js +++ b/app/scripts/constants/on-ramp.js @@ -1,3 +1,2 @@ export const TRANSAK_API_KEY = '25ac1309-a49b-4411-b20e-5e56c61a5b1c'; // It's a public key, which will be included in a URL for Transak. export const MOONPAY_API_KEY = 'pk_live_WbCpe6PxSIcGPCSd6lKCbJNRht7uy'; // Publishable key. -export const COINBASEPAY_API_KEY = 'ab4b8829-a59d-44d3-accc-de77e4f18df2'; // Publishable key. diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 663cfa760d38..037f3de14055 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -1,3 +1,4 @@ +import querystring from 'querystring'; import pump from 'pump'; import { WindowPostMessageStream } from '@metamask/post-message-stream'; import ObjectMultiplex from 'obj-multiplex'; @@ -5,8 +6,6 @@ import browser from 'webextension-polyfill'; import PortStream from 'extension-port-stream'; import { obj as createThoughStream } from 'through2'; -import { isManifestV3 } from '../../shared/modules/mv3.utils'; - // These require calls need to use require to be statically recognized by browserify const fs = require('fs'); const path = require('path'); @@ -18,13 +17,8 @@ const inpageContent = fs.readFileSync( const inpageSuffix = `//# sourceURL=${browser.runtime.getURL('inpage.js')}\n`; const inpageBundle = inpageContent + inpageSuffix; -// contexts const CONTENT_SCRIPT = 'metamask-contentscript'; const INPAGE = 'metamask-inpage'; -const PHISHING_WARNING_PAGE = 'metamask-phishing-warning-page'; - -// stream channels -const PHISHING_SAFELIST = 'metamask-phishing-safelist'; const PROVIDER = 'metamask-provider'; // TODO:LegacyProvider: Delete @@ -33,14 +27,7 @@ const LEGACY_INPAGE = 'inpage'; const LEGACY_PROVIDER = 'provider'; const LEGACY_PUBLIC_CONFIG = 'publicConfig'; -const phishingPageUrl = new URL(process.env.PHISHING_WARNING_PAGE_URL); - -if ( - window.location.origin === phishingPageUrl.origin && - window.location.pathname === phishingPageUrl.pathname -) { - setupPhishingStream(); -} else if (shouldInjectProvider()) { +if (shouldInjectProvider()) { injectScript(inpageBundle); setupStreams(); } @@ -55,12 +42,7 @@ function injectScript(content) { const container = document.head || document.documentElement; const scriptTag = document.createElement('script'); scriptTag.setAttribute('async', 'false'); - // Inline scripts do not work in MV3 due to more strict security policy - if (isManifestV3()) { - scriptTag.setAttribute('src', browser.runtime.getURL('inpage.js')); - } else { - scriptTag.textContent = content; - } + scriptTag.textContent = content; container.insertBefore(scriptTag, container.children[0]); container.removeChild(scriptTag); } catch (error) { @@ -68,47 +50,6 @@ function injectScript(content) { } } -async function setupPhishingStream() { - // the transport-specific streams for communication between inpage and background - const pageStream = new WindowPostMessageStream({ - name: CONTENT_SCRIPT, - target: PHISHING_WARNING_PAGE, - }); - const extensionPort = browser.runtime.connect({ name: CONTENT_SCRIPT }); - const extensionStream = new PortStream(extensionPort); - - // create and connect channel muxers - // so we can handle the channels individually - const pageMux = new ObjectMultiplex(); - pageMux.setMaxListeners(25); - const extensionMux = new ObjectMultiplex(); - extensionMux.setMaxListeners(25); - - pump(pageMux, pageStream, pageMux, (err) => - logStreamDisconnectWarning('MetaMask Inpage Multiplex', err), - ); - pump(extensionMux, extensionStream, extensionMux, (err) => { - logStreamDisconnectWarning('MetaMask Background Multiplex', err); - window.postMessage( - { - target: PHISHING_WARNING_PAGE, // the post-message-stream "target" - data: { - // this object gets passed to obj-multiplex - name: PHISHING_SAFELIST, // the obj-multiplex channel name - data: { - jsonrpc: '2.0', - method: 'METAMASK_STREAM_FAILURE', - }, - }, - }, - window.location.origin, - ); - }); - - // forward communication across inpage-background for these channels only - forwardTrafficBetweenMuxes(PHISHING_SAFELIST, pageMux, extensionMux); -} - /** * Sets up two-way communication streams between the * browser extension and local per-page browser context. @@ -357,15 +298,12 @@ function blockedDomainCheck() { /** * Redirects the current page to a phishing information page - * - * @param data */ -function redirectToPhishingWarning(data = {}) { - console.debug('MetaMask: Routing to Phishing Warning page.'); - const { hostname, href } = window.location; - const { newIssueUrl } = data; - const baseUrl = process.env.PHISHING_WARNING_PAGE_URL; - - const querystring = new URLSearchParams({ hostname, href, newIssueUrl }); - window.location.href = `${baseUrl}#${querystring}`; +function redirectToPhishingWarning() { + console.debug('MetaMask: Routing to Phishing Warning component.'); + const extensionURL = browser.runtime.getURL('phishing.html'); + window.location.href = `${extensionURL}#${querystring.stringify({ + hostname: window.location.hostname, + href: window.location.href, + })}`; } diff --git a/app/scripts/controllers/detect-tokens.js b/app/scripts/controllers/detect-tokens.js index b6261504d0ca..d9cfe9b14ee6 100644 --- a/app/scripts/controllers/detect-tokens.js +++ b/app/scripts/controllers/detect-tokens.js @@ -6,10 +6,8 @@ import { MINUTE } from '../../../shared/constants/time'; import { MAINNET_CHAIN_ID } from '../../../shared/constants/network'; import { isTokenDetectionEnabledForNetwork } from '../../../shared/modules/network.utils'; import { isEqualCaseInsensitive } from '../../../shared/modules/string-utils'; -import { - ASSET_TYPES, - TOKEN_STANDARDS, -} from '../../../shared/constants/transaction'; +import { TOKEN_STANDARDS } from '../../../ui/helpers/constants/common'; +import { ASSET_TYPES } from '../../../shared/constants/transaction'; import { EVENT, EVENT_NAMES } from '../../../shared/constants/metametrics'; // By default, poll every 3 minutes diff --git a/app/scripts/controllers/detect-tokens.test.js b/app/scripts/controllers/detect-tokens.test.js index 5161cf44bd56..4fd5605b0d51 100644 --- a/app/scripts/controllers/detect-tokens.test.js +++ b/app/scripts/controllers/detect-tokens.test.js @@ -8,19 +8,12 @@ import { TokenListController, TokensController, } from '@metamask/controllers'; -import { - MAINNET, - MAINNET_NETWORK_ID, - ROPSTEN, -} from '../../../shared/constants/network'; +import { MAINNET, ROPSTEN } from '../../../shared/constants/network'; import { toChecksumHexAddress } from '../../../shared/modules/hexstring-utils'; import DetectTokensController from './detect-tokens'; import NetworkController from './network'; import PreferencesController from './preferences'; -const tokenIconsApiBaseUrl = - 'https://static.metaswap.codefi.network/api/v1/tokenIcons'; - describe('DetectTokensController', function () { let tokenListController; const sandbox = sinon.createSandbox(); @@ -134,6 +127,7 @@ describe('DetectTokensController', function () { }); tokenListController = new TokenListController({ chainId: '1', + useStaticTokenList: false, onNetworkStateChange: sinon.spy(), onPreferencesStateChange: sinon.spy(), messenger: tokenListMessenger, @@ -185,6 +179,7 @@ describe('DetectTokensController', function () { }); tokenListController = new TokenListController({ chainId: '3', + useStaticTokenList: false, onNetworkStateChange: sinon.spy(), onPreferencesStateChange: sinon.spy(), messenger: tokenListMessengerRopsten, @@ -246,7 +241,7 @@ describe('DetectTokensController', function () { ), ); - await tokensController.ignoreTokens([tokenAddressToSkip]); + await tokensController.removeAndIgnoreToken(tokenAddressToSkip); await controller.detectNewTokens(); assert.deepEqual(tokensController.state.tokens, [ @@ -254,8 +249,7 @@ describe('DetectTokensController', function () { address: toChecksumHexAddress(existingTokenAddress), decimals: existingToken.decimals, symbol: existingToken.symbol, - aggregators: [], - image: `${tokenIconsApiBaseUrl}/${MAINNET_NETWORK_ID}/${existingTokenAddress}.png`, + image: undefined, isERC721: false, }, ]); @@ -309,16 +303,14 @@ describe('DetectTokensController', function () { decimals: existingToken.decimals, symbol: existingToken.symbol, isERC721: false, - aggregators: [], - image: `${tokenIconsApiBaseUrl}/${MAINNET_NETWORK_ID}/${existingTokenAddress}.png`, + image: undefined, }, { address: toChecksumHexAddress(tokenAddressToAdd), decimals: tokenToAdd.decimals, symbol: tokenToAdd.symbol, + image: undefined, isERC721: false, - aggregators: [], - image: `${tokenIconsApiBaseUrl}/${MAINNET_NETWORK_ID}/${tokenAddressToAdd}.png`, }, ]); }); @@ -371,17 +363,15 @@ describe('DetectTokensController', function () { address: toChecksumHexAddress(existingTokenAddress), decimals: existingToken.decimals, symbol: existingToken.symbol, - image: `${tokenIconsApiBaseUrl}/${MAINNET_NETWORK_ID}/${existingTokenAddress}.png`, + image: undefined, isERC721: false, - aggregators: [], }, { address: toChecksumHexAddress(tokenAddressToAdd), decimals: tokenToAdd.decimals, symbol: tokenToAdd.symbol, - image: `${tokenIconsApiBaseUrl}/${MAINNET_NETWORK_ID}/${tokenAddressToAdd}.png`, + image: undefined, isERC721: false, - aggregators: [], }, ]); }); diff --git a/app/scripts/controllers/ens/ens.js b/app/scripts/controllers/ens/ens.js index 2242a2b8cd00..0a629dd407b1 100644 --- a/app/scripts/controllers/ens/ens.js +++ b/app/scripts/controllers/ens/ens.js @@ -1,6 +1,5 @@ -import { ethers } from 'ethers'; +import EthJsEns from 'ethjs-ens'; import ensNetworkMap from 'ethereum-ens-network-map'; -import { NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP } from '../../../../shared/constants/network'; export default class Ens { static getNetworkEnsSupport(network) { @@ -8,21 +7,17 @@ export default class Ens { } constructor({ network, provider } = {}) { - const networkName = NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP[network]; - const ensAddress = ensNetworkMap[network]; - const ethProvider = new ethers.providers.Web3Provider(provider, { - chainId: parseInt(network, 10), - name: networkName, - ensAddress, + this._ethJsEns = new EthJsEns({ + network, + provider, }); - this._ethProvider = ethProvider; } lookup(ensName) { - return this._ethProvider.resolveName(ensName); + return this._ethJsEns.lookup(ensName); } reverse(address) { - return this._ethProvider.lookupAddress(address); + return this._ethJsEns.reverse(address); } } diff --git a/app/scripts/controllers/ens/index.test.js b/app/scripts/controllers/ens/index.test.js index d325e2885084..c94f73a5d9a6 100644 --- a/app/scripts/controllers/ens/index.test.js +++ b/app/scripts/controllers/ens/index.test.js @@ -20,7 +20,7 @@ describe('EnsController', function () { describe('#constructor', function () { it('should construct the controller given a provider and a network', async function () { const ens = new EnsController({ - provider: sinon.fake(), + provider: {}, getCurrentChainId, onNetworkDidChange, }); diff --git a/app/scripts/controllers/incoming-transactions.js b/app/scripts/controllers/incoming-transactions.js index 9577632c5e76..c56509314a0e 100644 --- a/app/scripts/controllers/incoming-transactions.js +++ b/app/scripts/controllers/incoming-transactions.js @@ -18,8 +18,9 @@ import { RINKEBY_CHAIN_ID, ROPSTEN_CHAIN_ID, } from '../../../shared/constants/network'; +import { SECOND } from '../../../shared/constants/time'; -const fetchWithTimeout = getFetchWithTimeout(); +const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); /** * @typedef {import('../../../shared/constants/transaction').TransactionMeta} TransactionMeta diff --git a/app/scripts/controllers/metametrics.js b/app/scripts/controllers/metametrics.js index 7e1b6c6ec224..8c1ecbca1bc8 100644 --- a/app/scripts/controllers/metametrics.js +++ b/app/scripts/controllers/metametrics.js @@ -558,15 +558,6 @@ export default class MetaMetricsController { [TRAITS.NETWORKS_ADDED]: metamaskState.frequentRpcListDetail.map( (rpc) => rpc.chainId, ), - [TRAITS.NETWORKS_WITHOUT_TICKER]: metamaskState.frequentRpcListDetail.reduce( - (networkList, currentNetwork) => { - if (!currentNetwork.ticker) { - networkList.push(currentNetwork.chainId); - } - return networkList; - }, - [], - ), [TRAITS.NFT_AUTODETECTION_ENABLED]: metamaskState.useCollectibleDetection, [TRAITS.NUMBER_OF_ACCOUNTS]: Object.values(metamaskState.identities) .length, @@ -630,9 +621,11 @@ export default class MetaMetricsController { * @returns {[]} */ _getAllNFTsFlattened = memoize((allCollectibles = {}) => { - return Object.values(allCollectibles).reduce((result, chainNFTs) => { - return result.concat(...Object.values(chainNFTs)); - }, []); + return Object.values(allCollectibles) + .reduce((result, chainNFTs) => { + return result.concat(Object.values(chainNFTs)); + }, []) + .flat(); }); /** diff --git a/app/scripts/controllers/metametrics.test.js b/app/scripts/controllers/metametrics.test.js index 804132295ab1..76982e445356 100644 --- a/app/scripts/controllers/metametrics.test.js +++ b/app/scripts/controllers/metametrics.test.js @@ -9,10 +9,8 @@ import { } from '../../../shared/constants/metametrics'; import waitUntilCalled from '../../../test/lib/wait-until-called'; import { - ETH_SYMBOL, MAINNET_CHAIN_ID, ROPSTEN_CHAIN_ID, - TEST_ETH_SYMBOL, } from '../../../shared/constants/network'; import MetaMetricsController from './metametrics'; import { NETWORK_EVENTS } from './network'; @@ -675,9 +673,8 @@ describe('MetaMetricsController', function () { }, allTokens: MOCK_ALL_TOKENS, frequentRpcListDetail: [ - { chainId: MAINNET_CHAIN_ID, ticker: ETH_SYMBOL }, - { chainId: ROPSTEN_CHAIN_ID, ticker: TEST_ETH_SYMBOL }, - { chainId: '0xaf' }, + { chainId: MAINNET_CHAIN_ID }, + { chainId: ROPSTEN_CHAIN_ID }, ], identities: [{}, {}], ledgerTransportType: 'web-hid', @@ -691,8 +688,7 @@ describe('MetaMetricsController', function () { assert.deepEqual(traits, { [TRAITS.ADDRESS_BOOK_ENTRIES]: 3, [TRAITS.LEDGER_CONNECTION_TYPE]: 'web-hid', - [TRAITS.NETWORKS_ADDED]: [MAINNET_CHAIN_ID, ROPSTEN_CHAIN_ID, '0xaf'], - [TRAITS.NETWORKS_WITHOUT_TICKER]: ['0xaf'], + [TRAITS.NETWORKS_ADDED]: [MAINNET_CHAIN_ID, ROPSTEN_CHAIN_ID], [TRAITS.NFT_AUTODETECTION_ENABLED]: false, [TRAITS.NUMBER_OF_ACCOUNTS]: 2, [TRAITS.NUMBER_OF_NFT_COLLECTIONS]: 3, diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 2969041aabb1..cb572773a387 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -20,6 +20,7 @@ import { INFURA_BLOCKED_KEY, TEST_NETWORK_TICKER_MAP, } from '../../../../shared/constants/network'; +import { SECOND } from '../../../../shared/constants/time'; import { isPrefixedFormattedHexString, isSafeChainId, @@ -30,7 +31,7 @@ import createInfuraClient from './createInfuraClient'; import createJsonRpcClient from './createJsonRpcClient'; const env = process.env.METAMASK_ENV; -const fetchWithTimeout = getFetchWithTimeout(); +const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); let defaultProviderConfigOpts; if (process.env.IN_TEST) { @@ -271,11 +272,6 @@ export default class NetworkController extends EventEmitter { return NETWORK_TYPE_TO_ID_MAP[type]?.chainId || configChainId; } - getCurrentRpcUrl() { - const { rpcUrl } = this.getProviderConfig(); - return rpcUrl; - } - setRpcTarget(rpcUrl, chainId, ticker = 'ETH', nickname = '', rpcPrefs) { assert.ok( isPrefixedFormattedHexString(chainId), diff --git a/app/scripts/controllers/permissions/flask/snap-permissions.js b/app/scripts/controllers/permissions/flask/snap-permissions.js index 07024c9ae19f..bde8c4c91623 100644 --- a/app/scripts/controllers/permissions/flask/snap-permissions.js +++ b/app/scripts/controllers/permissions/flask/snap-permissions.js @@ -1,4 +1,4 @@ -import { endowmentPermissionBuilders } from '@metamask/snap-controllers'; +import { endowmentPermissionBuilders } from '@metamask/controllers'; import { restrictedMethodPermissionBuilders, selectHooks, diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 9b9c16d1116f..706260b24340 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -69,7 +69,6 @@ export default class PreferencesController { ? LEDGER_TRANSPORT_TYPES.WEBHID : LEDGER_TRANSPORT_TYPES.U2F, theme: 'light', - customNetworkListEnabled: false, ...opts.initState, }; @@ -180,17 +179,6 @@ export default class PreferencesController { this.store.updateState({ theme: val }); } - /** - * Setter for the `customNetworkListEnabled` property - * - * @param customNetworkListEnabled - */ - setCustomNetworkListEnabled(customNetworkListEnabled) { - this.store.updateState({ - customNetworkListEnabled, - }); - } - /** * Add new methodData to state, to avoid requesting this information again through Infura * diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index af968ab82d73..4e06c295100c 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -41,7 +41,6 @@ import { PRIORITY_LEVELS, } from '../../../../shared/constants/gas'; import { decGWEIToHexWEI } from '../../../../shared/modules/conversion.utils'; -import { isSwapsDefaultTokenAddress } from '../../../../shared/modules/swaps.utils'; import { EVENT } from '../../../../shared/constants/metametrics'; import { HARDFORKS, @@ -61,7 +60,6 @@ import PendingTransactionTracker from './pending-tx-tracker'; import * as txUtils from './lib/util'; const MAX_MEMSTORE_TX_LIST_SIZE = 100; // Number of transactions (by unique nonces) to keep in memory -const UPDATE_POST_TX_BALANCE_TIMEOUT = 5000; const SWAP_TRANSACTION_TYPES = [ TRANSACTION_TYPES.SWAP, @@ -447,7 +445,7 @@ export default class TransactionController extends EventEmitter { * @param {string} editableParams.gasPrice * @returns {TransactionMeta} the txMeta of the updated transaction */ - async updateEditableParams(txId, { data, from, to, value, gas, gasPrice }) { + updateEditableParams(txId, { data, from, to, value, gas, gasPrice }) { this._throwErrorIfNotUnapprovedTx(txId, 'updateEditableParams'); const editableParams = { @@ -462,24 +460,8 @@ export default class TransactionController extends EventEmitter { }; // only update what is defined - editableParams.txParams = pickBy( - editableParams.txParams, - (prop) => prop !== undefined, - ); - - // update transaction type in case it has changes - const transactionBeforeEdit = this._getTransaction(txId); - const { type } = await determineTransactionType( - { - ...transactionBeforeEdit.txParams, - ...editableParams.txParams, - }, - this.query, - ); - editableParams.type = type; - + editableParams.txParams = pickBy(editableParams.txParams); const note = `Update Editable Params for ${txId}`; - this._updateTransaction(txId, editableParams, note); return this._getTransaction(txId); } @@ -1007,7 +989,7 @@ export default class TransactionController extends EventEmitter { * * @param {Object} txMeta - The txMeta object * @param {string} getCodeResponse - The transaction category code response, used for debugging purposes - * @returns {Promise} Object containing the default gas limit, or the simulation failure object + * @returns {Promise} Object containing the default gas limit, or the simulation failure object */ async _getDefaultGasLimit(txMeta, getCodeResponse) { const chainId = this._getCurrentChainId(); @@ -1470,39 +1452,6 @@ export default class TransactionController extends EventEmitter { this._trackTransactionMetricsEvent(txMeta, TRANSACTION_EVENTS.SUBMITTED); } - async updatePostTxBalance({ txMeta, txId, numberOfAttempts = 6 }) { - const postTxBalance = await this.query.getBalance(txMeta.txParams.from); - const latestTxMeta = this.txStateManager.getTransaction(txId); - const approvalTxMeta = latestTxMeta.approvalTxId - ? this.txStateManager.getTransaction(latestTxMeta.approvalTxId) - : null; - latestTxMeta.postTxBalance = postTxBalance.toString(16); - const isDefaultTokenAddress = isSwapsDefaultTokenAddress( - txMeta.destinationTokenAddress, - txMeta.chainId, - ); - if ( - isDefaultTokenAddress && - txMeta.preTxBalance === latestTxMeta.postTxBalance && - numberOfAttempts > 0 - ) { - setTimeout(() => { - // If postTxBalance is the same as preTxBalance, try it again. - this.updatePostTxBalance({ - txMeta, - txId, - numberOfAttempts: numberOfAttempts - 1, - }); - }, UPDATE_POST_TX_BALANCE_TIMEOUT); - } else { - this.txStateManager.updateTransaction( - latestTxMeta, - 'transactions#confirmTransaction - add postTxBalance', - ); - this._trackSwapsMetrics(latestTxMeta, approvalTxMeta); - } - } - /** * Sets the status of the transaction to confirmed and sets the status of nonce duplicates as * dropped if the txParams have data it will fetch the txReceipt @@ -1566,10 +1515,21 @@ export default class TransactionController extends EventEmitter { ); if (txMeta.type === TRANSACTION_TYPES.SWAP) { - await this.updatePostTxBalance({ - txMeta, - txId, - }); + const postTxBalance = await this.query.getBalance(txMeta.txParams.from); + const latestTxMeta = this.txStateManager.getTransaction(txId); + + const approvalTxMeta = latestTxMeta.approvalTxId + ? this.txStateManager.getTransaction(latestTxMeta.approvalTxId) + : null; + + latestTxMeta.postTxBalance = postTxBalance.toString(16); + + this.txStateManager.updateTransaction( + latestTxMeta, + 'transactions#confirmTransaction - add postTxBalance', + ); + + this._trackSwapsMetrics(latestTxMeta, approvalTxMeta); } } catch (err) { log.error(err); @@ -1627,10 +1587,21 @@ export default class TransactionController extends EventEmitter { ); if (txMeta.type === TRANSACTION_TYPES.SWAP) { - await this.updatePostTxBalance({ - txMeta, - txId, - }); + const postTxBalance = await this.query.getBalance(txMeta.txParams.from); + const latestTxMeta = this.txStateManager.getTransaction(txId); + + const approvalTxMeta = latestTxMeta.approvalTxId + ? this.txStateManager.getTransaction(latestTxMeta.approvalTxId) + : null; + + latestTxMeta.postTxBalance = postTxBalance.toString(16); + + this.txStateManager.updateTransaction( + latestTxMeta, + 'transactions#confirmTransaction - add postTxBalance', + ); + + this._trackSwapsMetrics(latestTxMeta, approvalTxMeta); } } catch (err) { log.error(err); @@ -1991,7 +1962,6 @@ export default class TransactionController extends EventEmitter { async _buildEventFragmentProperties(txMeta, extraParams) { const { - id, type, time, status, @@ -2008,7 +1978,6 @@ export default class TransactionController extends EventEmitter { defaultGasEstimates, metamaskNetworkId: network, } = txMeta; - const { transactions } = this.store.getState(); const source = referrer === ORIGIN_METAMASK ? 'user' : 'dapp'; const { assetType, tokenStandard } = await determineTransactionAssetType( @@ -2071,10 +2040,6 @@ export default class TransactionController extends EventEmitter { gasParams.estimate_used = estimateUsed; } - if (extraParams?.gas_used) { - gasParams.gas_used = extraParams.gas_used; - } - const gasParamsInGwei = this._getGasValuesInGWEI(gasParams); let eip1559Version = '0'; @@ -2083,36 +2048,12 @@ export default class TransactionController extends EventEmitter { eip1559Version = eip1559V2Enabled ? '2' : '1'; } - const contractInteractionTypes = [ - TRANSACTION_TYPES.CONTRACT_INTERACTION, - TRANSACTION_TYPES.TOKEN_METHOD_APPROVE, - TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM, - TRANSACTION_TYPES.TOKEN_METHOD_SET_APPROVAL_FOR_ALL, - TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER, - TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM, - TRANSACTION_TYPES.SMART, - TRANSACTION_TYPES.SWAP, - TRANSACTION_TYPES.SWAP_APPROVAL, - ].includes(type); - - let transactionType = TRANSACTION_TYPES.SIMPLE_SEND; - let transactionContractMethod; - if (type === TRANSACTION_TYPES.CANCEL) { - transactionType = TRANSACTION_TYPES.CANCEL; - } else if (type === TRANSACTION_TYPES.RETRY) { - transactionType = TRANSACTION_TYPES.RETRY; - } else if (type === TRANSACTION_TYPES.DEPLOY_CONTRACT) { - transactionType = TRANSACTION_TYPES.DEPLOY_CONTRACT; - } else if (contractInteractionTypes) { - transactionType = TRANSACTION_TYPES.CONTRACT_INTERACTION; - transactionContractMethod = transactions[id]?.contractMethodName; - } - const properties = { chain_id: chainId, referrer, source, network, + type, eip_1559_version: eip1559Version, gas_edit_type: 'none', gas_edit_attempted: 'none', @@ -2120,7 +2061,6 @@ export default class TransactionController extends EventEmitter { device_model: await this.getDeviceModel(this.getSelectedAddress()), asset_type: assetType, token_standard: tokenStandard, - transaction_type: transactionType, }; const sensitiveProperties = { @@ -2130,9 +2070,8 @@ export default class TransactionController extends EventEmitter { : TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, first_seen: time, gas_limit: gasLimit, - transaction_contract_method: transactionContractMethod, - ...extraParams, ...gasParamsInGwei, + ...extraParams, }; return { properties, sensitiveProperties }; diff --git a/app/scripts/controllers/transactions/index.test.js b/app/scripts/controllers/transactions/index.test.js index 52cface7aa2b..a324c56fe9f1 100644 --- a/app/scripts/controllers/transactions/index.test.js +++ b/app/scripts/controllers/transactions/index.test.js @@ -17,7 +17,6 @@ import { TRANSACTION_ENVELOPE_TYPES, TRANSACTION_EVENTS, ASSET_TYPES, - TOKEN_STANDARDS, } from '../../../../shared/constants/transaction'; import { SECOND } from '../../../../shared/constants/time'; @@ -27,6 +26,7 @@ import { } from '../../../../shared/constants/gas'; import { TRANSACTION_ENVELOPE_TYPE_NAMES } from '../../../../ui/helpers/constants/transactions'; import { METAMASK_CONTROLLER_EVENTS } from '../../metamask-controller'; +import { TOKEN_STANDARDS } from '../../../../ui/helpers/constants/common'; import { ORIGIN_METAMASK } from '../../../../shared/constants/app'; import TransactionController from '.'; @@ -1471,7 +1471,7 @@ describe('Transaction Controller', function () { network: '42', referrer: ORIGIN_METAMASK, source: EVENT.SOURCE.TRANSACTION.USER, - transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, + type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, @@ -1482,7 +1482,6 @@ describe('Transaction Controller', function () { default_gas_price: '2', gas_price: '2', gas_limit: '0x7b0d', - transaction_contract_method: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1551,7 +1550,7 @@ describe('Transaction Controller', function () { network: '42', referrer: ORIGIN_METAMASK, source: EVENT.SOURCE.TRANSACTION.USER, - transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, + type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, @@ -1562,7 +1561,6 @@ describe('Transaction Controller', function () { default_gas_price: '2', gas_price: '2', gas_limit: '0x7b0d', - transaction_contract_method: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1641,7 +1639,7 @@ describe('Transaction Controller', function () { network: '42', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, - transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, + type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, @@ -1652,7 +1650,6 @@ describe('Transaction Controller', function () { default_gas_price: '2', gas_price: '2', gas_limit: '0x7b0d', - transaction_contract_method: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1723,7 +1720,7 @@ describe('Transaction Controller', function () { network: '42', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, - transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, + type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, @@ -1734,7 +1731,6 @@ describe('Transaction Controller', function () { default_gas_price: '2', gas_price: '2', gas_limit: '0x7b0d', - transaction_contract_method: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1805,7 +1801,7 @@ describe('Transaction Controller', function () { network: '42', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, - transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, + type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, @@ -1814,7 +1810,6 @@ describe('Transaction Controller', function () { sensitiveProperties: { gas_price: '2', gas_limit: '0x7b0d', - transaction_contract_method: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1865,7 +1860,7 @@ describe('Transaction Controller', function () { network: '42', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, - transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, + type: TRANSACTION_TYPES.SIMPLE_SEND, chain_id: '0x2a', eip_1559_version: '0', gas_edit_attempted: 'none', @@ -1880,7 +1875,6 @@ describe('Transaction Controller', function () { foo: 'bar', gas_price: '2', gas_limit: '0x7b0d', - transaction_contract_method: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, status: 'unapproved', @@ -1943,7 +1937,7 @@ describe('Transaction Controller', function () { network: '42', referrer: 'other', source: EVENT.SOURCE.TRANSACTION.DAPP, - transaction_type: TRANSACTION_TYPES.SIMPLE_SEND, + type: TRANSACTION_TYPES.SIMPLE_SEND, account_type: 'MetaMask', asset_type: ASSET_TYPES.NATIVE, token_standard: TOKEN_STANDARDS.NONE, @@ -1955,7 +1949,6 @@ describe('Transaction Controller', function () { max_fee_per_gas: '2', max_priority_fee_per_gas: '2', gas_limit: '0x7b0d', - transaction_contract_method: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.FEE_MARKET, status: 'unapproved', @@ -2252,126 +2245,4 @@ describe('Transaction Controller', function () { assert.equal(result.destinationTokenAddress, VALID_ADDRESS_TWO); // not updated even though it's passed in to update }); }); - - describe('updateEditableParams', function () { - let txStateManager; - - beforeEach(function () { - txStateManager = txController.txStateManager; - txStateManager.addTransaction({ - id: '1', - status: TRANSACTION_STATUSES.UNAPPROVED, - metamaskNetworkId: currentNetworkId, - txParams: { - gas: '0x001', - gasPrice: '0x002', - // max fees can not be mixed with gasPrice - // maxPriorityFeePerGas: '0x003', - // maxFeePerGas: '0x004', - to: VALID_ADDRESS, - from: VALID_ADDRESS, - }, - estimateUsed: '0x005', - estimatedBaseFee: '0x006', - decEstimatedBaseFee: '6', - type: 'simpleSend', - userEditedGasLimit: '0x008', - userFeeLevel: 'medium', - }); - }); - - it('updates editible params when type changes from simple send to token transfer', async function () { - providerResultStub.eth_getCode = '0xab'; - // test update gasFees - await txController.updateEditableParams('1', { - data: - '0xa9059cbb000000000000000000000000e18035bf8712672935fdb4e5e431b1a0183d2dfc0000000000000000000000000000000000000000000000000de0b6b3a7640000', - }); - const result = txStateManager.getTransaction('1'); - assert.equal( - result.txParams.data, - '0xa9059cbb000000000000000000000000e18035bf8712672935fdb4e5e431b1a0183d2dfc0000000000000000000000000000000000000000000000000de0b6b3a7640000', - ); - assert.equal(result.type, TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER); - }); - - it('updates editible params when type changes from token transfer to simple send', async function () { - // test update gasFees - txStateManager.addTransaction({ - id: '2', - status: TRANSACTION_STATUSES.UNAPPROVED, - metamaskNetworkId: currentNetworkId, - txParams: { - gas: '0x001', - gasPrice: '0x002', - // max fees can not be mixed with gasPrice - // maxPriorityFeePerGas: '0x003', - // maxFeePerGas: '0x004', - to: VALID_ADDRESS, - from: VALID_ADDRESS, - data: - '0xa9059cbb000000000000000000000000e18035bf8712672935fdb4e5e431b1a0183d2dfc0000000000000000000000000000000000000000000000000de0b6b3a7640000', - }, - estimateUsed: '0x005', - estimatedBaseFee: '0x006', - decEstimatedBaseFee: '6', - type: TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER, - userEditedGasLimit: '0x008', - userFeeLevel: 'medium', - }); - await txController.updateEditableParams('2', { - data: '0x', - }); - const result = txStateManager.getTransaction('2'); - assert.equal(result.txParams.data, '0x'); - assert.equal(result.type, TRANSACTION_TYPES.SIMPLE_SEND); - }); - - it('updates editible params when type changes from simpleSend to contract interaction', async function () { - // test update gasFees - txStateManager.addTransaction({ - id: '3', - status: TRANSACTION_STATUSES.UNAPPROVED, - metamaskNetworkId: currentNetworkId, - txParams: { - gas: '0x001', - gasPrice: '0x002', - // max fees can not be mixed with gasPrice - // maxPriorityFeePerGas: '0x003', - // maxFeePerGas: '0x004', - to: VALID_ADDRESS, - from: VALID_ADDRESS, - }, - estimateUsed: '0x005', - estimatedBaseFee: '0x006', - decEstimatedBaseFee: '6', - type: TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER, - userEditedGasLimit: '0x008', - userFeeLevel: 'medium', - }); - providerResultStub.eth_getCode = '0x5'; - await txController.updateEditableParams('3', { - data: '0x123', - }); - const result = txStateManager.getTransaction('3'); - assert.equal(result.txParams.data, '0x123'); - assert.equal(result.type, TRANSACTION_TYPES.CONTRACT_INTERACTION); - }); - - it('updates editible params when type does not change', async function () { - // test update gasFees - await txController.updateEditableParams('1', { - data: '0x123', - gas: '0xabc', - from: VALID_ADDRESS_TWO, - }); - const result = txStateManager.getTransaction('1'); - assert.equal(result.txParams.data, '0x123'); - assert.equal(result.txParams.gas, '0xabc'); - assert.equal(result.txParams.from, VALID_ADDRESS_TWO); - assert.equal(result.txParams.to, VALID_ADDRESS); - assert.equal(result.txParams.gasPrice, '0x002'); - assert.equal(result.type, TRANSACTION_TYPES.SIMPLE_SEND); - }); - }); }); diff --git a/app/scripts/controllers/transactions/pending-tx-tracker.js b/app/scripts/controllers/transactions/pending-tx-tracker.js index 2bd5471893e9..02b4cbeb4fec 100644 --- a/app/scripts/controllers/transactions/pending-tx-tracker.js +++ b/app/scripts/controllers/transactions/pending-tx-tracker.js @@ -2,7 +2,6 @@ import EventEmitter from 'safe-event-emitter'; import log from 'loglevel'; import EthQuery from 'ethjs-query'; import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction'; -import { ERROR_SUBMITTING } from './tx-state-manager'; /** * Event emitter utility class for tracking the transactions as they @@ -107,7 +106,7 @@ export default class PendingTransactionTracker extends EventEmitter { // encountered real error - transition to error state txMeta.warning = { error: errorMessage, - message: ERROR_SUBMITTING, + message: 'There was an error when resubmitting this transaction.', }; this.emit('tx:warning', txMeta, err); } diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index c924c9b66641..33e23bbf847a 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -18,8 +18,6 @@ import { validateConfirmedExternalTransaction, } from './lib/util'; -export const ERROR_SUBMITTING = - 'There was an error when resubmitting this transaction.'; /** * TransactionStatuses reimported from the shared transaction constants file * @@ -306,23 +304,9 @@ export default class TransactionStateManager extends EventEmitter { updateTransaction(txMeta, note) { // normalize and validate txParams if present if (txMeta.txParams) { - try { - txMeta.txParams = normalizeAndValidateTxParams(txMeta.txParams, false); - } catch (error) { - if (txMeta.warning.message === ERROR_SUBMITTING) { - this.setTxStatusFailed(txMeta.id, error); - } else { - throw error; - } - - return; - } + txMeta.txParams = normalizeAndValidateTxParams(txMeta.txParams, false); } - this._updateTransactionHistory(txMeta, note); - } - - _updateTransactionHistory(txMeta, note) { // create txMeta snapshot for history const currentState = snapshotFromTxMeta(txMeta); // recover previous tx state obj @@ -567,11 +551,10 @@ export default class TransactionStateManager extends EventEmitter { rpc: error.value, stack: error.stack, }; - this._updateTransactionHistory( + this.updateTransaction( txMeta, 'transactions:tx-state-manager#fail - add error', ); - this._setTransactionStatus(txId, TRANSACTION_STATUSES.FAILED); } @@ -655,7 +638,7 @@ export default class TransactionStateManager extends EventEmitter { txMeta.status = status; try { - this._updateTransactionHistory( + this.updateTransaction( txMeta, `txStateManager: setting status to ${status}`, ); diff --git a/app/scripts/controllers/transactions/tx-state-manager.test.js b/app/scripts/controllers/transactions/tx-state-manager.test.js index 7fbe6ec1eae4..ba3dd6be221f 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.test.js +++ b/app/scripts/controllers/transactions/tx-state-manager.test.js @@ -12,7 +12,7 @@ import { } from '../../../../shared/constants/network'; import { GAS_LIMITS } from '../../../../shared/constants/gas'; import { ORIGIN_METAMASK } from '../../../../shared/constants/app'; -import TxStateManager, { ERROR_SUBMITTING } from './tx-state-manager'; +import TxStateManager from './tx-state-manager'; import { snapshotFromTxMeta } from './lib/tx-state-history-helpers'; const VALID_ADDRESS = '0x0000000000000000000000000000000000000000'; @@ -918,113 +918,6 @@ describe('TransactionStateManager', function () { const { history } = txStateManager.getTransaction('1'); assert.equal(history.length, 1, 'two history items (initial + diff)'); }); - - it('should set tx status to failed if updating after error submitting', function () { - const txMeta = { - id: '1', - status: TRANSACTION_STATUSES.UNAPPROVED, - metamaskNetworkId: currentNetworkId, - txParams: { - from: VALID_ADDRESS_TWO, - to: VALID_ADDRESS, - gasLimit: '0x5028', - maxFeePerGas: '0x2540be400', - maxPriorityFeePerGas: '0x3b9aca00', - }, - }; - - txStateManager.addTransaction(txMeta); - const { history } = txStateManager.getTransaction('1'); - assert.equal(history.length, 1); - - txMeta.txParams.type = '0x0'; - txMeta.warning = { - message: ERROR_SUBMITTING, - error: 'Testing tx status failed with arbitrary error', - }; - - // should result in additional 2 history entries - txStateManager.updateTransaction(txMeta); - - const result = txStateManager.getTransaction('1'); - - assert.equal(result.history.length, 3); - - // history[1] should contain 3 entries - assert.equal(result.history[1].length, 3); - assert.equal( - result.history[1][0].note, - 'transactions:tx-state-manager#fail - add error', - ); - assert.equal(result.history[1][0].op, 'add'); - assert.equal(result.history[1][0].path, '/txParams/type'); - assert.equal(result.history[1][0].value, '0x0'); - - assert.equal(result.history[1][1].op, 'add'); - assert.equal(result.history[1][1].path, '/warning'); - assert.equal(result.history[1][1].value.message, ERROR_SUBMITTING); - - assert.equal(result.history[1][2].op, 'add'); - assert.equal(result.history[1][2].path, '/err'); - assert.equal( - result.history[1][2].value.message, - 'Invalid transaction envelope type: specified type "0x0" but including maxFeePerGas and maxPriorityFeePerGas requires type: "0x2"', - ); - - assert.equal(result.history[2].length, 1); - assert.equal( - result.history[2][0].note, - 'txStateManager: setting status to failed', - ); - assert.equal(result.history[2][0].op, 'replace'); - assert.equal(result.history[2][0].path, '/status'); - assert.equal(result.history[2][0].value, 'failed'); - }); - - it('should set transaction status to failed', function () { - const txMeta = { - id: '1', - status: TRANSACTION_STATUSES.UNAPPROVED, - metamaskNetworkId: currentNetworkId, - txParams: { - from: VALID_ADDRESS_TWO, - to: VALID_ADDRESS, - gasPrice: '0x01', - }, - }; - - txStateManager.addTransaction(txMeta); - const { history } = txStateManager.getTransaction('1'); - assert.equal(history.length, 1); - - // should result in additional 2 history entries - txStateManager.setTxStatusFailed( - txMeta.id, - new Error('Testing tx status failed with arbitrary error'), - ); - - const result = txStateManager.getTransaction('1'); - assert.equal(result.history.length, 3); - - assert.equal( - result.history[1][0].note, - 'transactions:tx-state-manager#fail - add error', - ); - assert.equal(result.history[1][0].op, 'add'); - assert.equal(result.history[1][0].path, '/err'); - assert.equal( - result.history[1][0].value.message, - 'Testing tx status failed with arbitrary error', - ); - assert.equal(result.history[2].length, 1); - assert.equal( - result.history[2][0].note, - 'txStateManager: setting status to failed', - ); - assert.equal(result.history[2][0].op, 'replace'); - assert.equal(result.history[2][0].path, '/status'); - assert.equal(result.history[2][0].value, 'failed'); - }); }); describe('#getUnapprovedTxList', function () { diff --git a/app/scripts/init-globals.js b/app/scripts/init-globals.js deleted file mode 100644 index a26c95266bd3..000000000000 --- a/app/scripts/init-globals.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This script add properties in globalThis and initialises them with undefined. - * This is workaround needed to avoid error in dependencies expecting to be run in a browser - * these dependencies are not available to service worker in MV3. - */ - -// eslint-disable-next-line import/unambiguous -const keys = ['XMLHttpRequest']; - -keys.forEach((key) => { - if (!Reflect.has(globalThis, key)) { - globalThis[key] = undefined; - } -}); - -if (!Reflect.has(globalThis, 'window')) { - globalThis.window = globalThis; -} diff --git a/app/scripts/lib/ComposableObservableStore.test.js b/app/scripts/lib/ComposableObservableStore.test.js index 9d03eb98d078..0beeacdfbebf 100644 --- a/app/scripts/lib/ComposableObservableStore.test.js +++ b/app/scripts/lib/ComposableObservableStore.test.js @@ -165,7 +165,7 @@ describe('ComposableObservableStore', () => { Example: exampleController, }, }), - ).toThrow(`Cannot read properties of undefined (reading 'subscribe')`); + ).toThrow(`Cannot read property 'subscribe' of undefined`); }); it('should throw if the controller messenger is omitted and updateStructure called with a BaseControllerV2 controller', () => { @@ -175,7 +175,7 @@ describe('ComposableObservableStore', () => { }); const store = new ComposableObservableStore({}); expect(() => store.updateStructure({ Example: exampleController })).toThrow( - `Cannot read properties of undefined (reading 'subscribe')`, + `Cannot read property 'subscribe' of undefined`, ); }); diff --git a/app/scripts/lib/account-tracker.js b/app/scripts/lib/account-tracker.js index e1c1bf185acc..7abe349a35b2 100644 --- a/app/scripts/lib/account-tracker.js +++ b/app/scripts/lib/account-tracker.js @@ -19,13 +19,6 @@ import { RINKEBY_CHAIN_ID, ROPSTEN_CHAIN_ID, KOVAN_CHAIN_ID, - GOERLI_CHAIN_ID, - BSC_CHAIN_ID, - OPTIMISM_CHAIN_ID, - POLYGON_CHAIN_ID, - AVALANCHE_CHAIN_ID, - FANTOM_CHAIN_ID, - ARBITRUM_CHAIN_ID, } from '../../../shared/constants/network'; import { @@ -33,13 +26,6 @@ import { SINGLE_CALL_BALANCES_ADDRESS_RINKEBY, SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN, SINGLE_CALL_BALANCES_ADDRESS_KOVAN, - SINGLE_CALL_BALANCES_ADDRESS_GOERLI, - SINGLE_CALL_BALANCES_ADDRESS_BSC, - SINGLE_CALL_BALANCES_ADDRESS_OPTIMISM, - SINGLE_CALL_BALANCES_ADDRESS_POLYGON, - SINGLE_CALL_BALANCES_ADDRESS_AVALANCHE, - SINGLE_CALL_BALANCES_ADDRESS_FANTOM, - SINGLE_CALL_BALANCES_ADDRESS_ARBITRUM, } from '../constants/contracts'; import { bnToHex } from './util'; @@ -244,55 +230,6 @@ export default class AccountTracker { ); break; - case GOERLI_CHAIN_ID: - await this._updateAccountsViaBalanceChecker( - addresses, - SINGLE_CALL_BALANCES_ADDRESS_GOERLI, - ); - break; - - case BSC_CHAIN_ID: - await this._updateAccountsViaBalanceChecker( - addresses, - SINGLE_CALL_BALANCES_ADDRESS_BSC, - ); - break; - - case OPTIMISM_CHAIN_ID: - await this._updateAccountsViaBalanceChecker( - addresses, - SINGLE_CALL_BALANCES_ADDRESS_OPTIMISM, - ); - break; - - case POLYGON_CHAIN_ID: - await this._updateAccountsViaBalanceChecker( - addresses, - SINGLE_CALL_BALANCES_ADDRESS_POLYGON, - ); - break; - - case AVALANCHE_CHAIN_ID: - await this._updateAccountsViaBalanceChecker( - addresses, - SINGLE_CALL_BALANCES_ADDRESS_AVALANCHE, - ); - break; - - case FANTOM_CHAIN_ID: - await this._updateAccountsViaBalanceChecker( - addresses, - SINGLE_CALL_BALANCES_ADDRESS_FANTOM, - ); - break; - - case ARBITRUM_CHAIN_ID: - await this._updateAccountsViaBalanceChecker( - addresses, - SINGLE_CALL_BALANCES_ADDRESS_ARBITRUM, - ); - break; - default: await Promise.all(addresses.map(this._updateAccount.bind(this))); } @@ -306,17 +243,8 @@ export default class AccountTracker { * @returns {Promise} after the account balance is updated */ async _updateAccount(address) { - let balance = '0x0'; - // query balance - try { - balance = await this._query.getBalance(address); - } catch (error) { - if (error.data.request.method !== 'eth_getBalance') { - throw error; - } - } - + const balance = await this._query.getBalance(address); const result = { address, balance }; // update accounts state const { accounts } = this.store.getState(); diff --git a/app/scripts/lib/buy-url.js b/app/scripts/lib/buy-url.js index eb8e22cf4bf2..ba4a0d86f468 100644 --- a/app/scripts/lib/buy-url.js +++ b/app/scripts/lib/buy-url.js @@ -7,31 +7,24 @@ import { MAINNET_CHAIN_ID, RINKEBY_CHAIN_ID, ROPSTEN_CHAIN_ID, + MAINNET_NETWORK_ID, BUYABLE_CHAINS_MAP, } from '../../../shared/constants/network'; +import { SECOND } from '../../../shared/constants/time'; import getFetchWithTimeout from '../../../shared/modules/fetch-with-timeout'; -import { - TRANSAK_API_KEY, - MOONPAY_API_KEY, - COINBASEPAY_API_KEY, -} from '../constants/on-ramp'; +import { TRANSAK_API_KEY, MOONPAY_API_KEY } from '../constants/on-ramp'; -const fetchWithTimeout = getFetchWithTimeout(); +const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); /** * Create a Wyre purchase URL. * - * @param {string} walletAddress - Ethereum destination address - * @param {string} chainId - Current chain ID + * @param {string} address - Ethereum destination address * @returns String */ -const createWyrePurchaseUrl = async (walletAddress, chainId) => { - const { wyre = {} } = BUYABLE_CHAINS_MAP[chainId]; - const { srn, currencyCode } = wyre; - - const networkId = parseInt(chainId, 16); - const fiatOnRampUrlApi = `${SWAPS_API_V2_BASE_URL}/networks/${networkId}/fiatOnRampUrl?serviceName=wyre&destinationAddress=${walletAddress}`; - const wyrePurchaseUrlFallback = `https://pay.sendwyre.com/purchase?dest=${srn}:${walletAddress}&destCurrency=${currencyCode}&accountId=AC-7AG3W4XH4N2&paymentMethod=debit-card`; +const createWyrePurchaseUrl = async (address) => { + const fiatOnRampUrlApi = `${SWAPS_API_V2_BASE_URL}/networks/${MAINNET_NETWORK_ID}/fiatOnRampUrl?serviceName=wyre&destinationAddress=${address}`; + const wyrePurchaseUrlFallback = `https://pay.sendwyre.com/purchase?dest=ethereum:${address}&destCurrency=ETH&accountId=AC-7AG3W4XH4N2&paymentMethod=debit-card`; try { const response = await fetchWithTimeout(fiatOnRampUrlApi, { method: 'GET', @@ -115,28 +108,6 @@ const createMoonPayUrl = async (walletAddress, chainId) => { return ''; }; -/** - * Create a Coinbase Pay Checkout URL. - * - * @param {string} walletAddress - Ethereum destination address - * @param {string} chainId - Current chain ID - * @returns String - */ -const createCoinbasePayUrl = (walletAddress, chainId) => { - const { coinbasePayCurrencies } = BUYABLE_CHAINS_MAP[chainId]; - const queryParams = new URLSearchParams({ - appId: COINBASEPAY_API_KEY, - attribution: 'extension', - destinationWallets: JSON.stringify([ - { - address: walletAddress, - assets: coinbasePayCurrencies, - }, - ]), - }); - return `https://pay.coinbase.com/buy?${queryParams}`; -}; - /** * Gives the caller a url at which the user can acquire eth, depending on the network they are in * @@ -156,13 +127,11 @@ export default async function getBuyUrl({ chainId, address, service }) { switch (service) { case 'wyre': - return await createWyrePurchaseUrl(address, chainId); + return await createWyrePurchaseUrl(address); case 'transak': return createTransakUrl(address, chainId); case 'moonpay': return createMoonPayUrl(address, chainId); - case 'coinbase': - return createCoinbasePayUrl(address, chainId); case 'metamask-faucet': return 'https://faucet.metamask.io/'; case 'rinkeby-faucet': diff --git a/app/scripts/lib/createRPCMethodTrackingMiddleware.js b/app/scripts/lib/createRPCMethodTrackingMiddleware.js index 3362e29ad3aa..89141357f63a 100644 --- a/app/scripts/lib/createRPCMethodTrackingMiddleware.js +++ b/app/scripts/lib/createRPCMethodTrackingMiddleware.js @@ -1,91 +1,19 @@ -import { MESSAGE_TYPE, ORIGIN_METAMASK } from '../../../shared/constants/app'; import { EVENT, EVENT_NAMES } from '../../../shared/constants/metametrics'; import { SECOND } from '../../../shared/constants/time'; -/** - * These types determine how the method tracking middleware handles incoming - * requests based on the method name. There are three options right now but - * the types could be expanded to cover other options in the future. - */ -const RATE_LIMIT_TYPES = { - RATE_LIMITED: 'rate_limited', - BLOCKED: 'blocked', - NON_RATE_LIMITED: 'non_rate_limited', +const USER_PROMPTED_EVENT_NAME_MAP = { + eth_signTypedData_v4: EVENT_NAMES.SIGNATURE_REQUESTED, + eth_signTypedData_v3: EVENT_NAMES.SIGNATURE_REQUESTED, + eth_signTypedData: EVENT_NAMES.SIGNATURE_REQUESTED, + eth_personal_sign: EVENT_NAMES.SIGNATURE_REQUESTED, + eth_sign: EVENT_NAMES.SIGNATURE_REQUESTED, + eth_getEncryptionPublicKey: EVENT_NAMES.ENCRYPTION_PUBLIC_KEY_REQUESTED, + eth_decrypt: EVENT_NAMES.DECRYPTION_REQUESTED, + wallet_requestPermissions: EVENT_NAMES.PERMISSIONS_REQUESTED, + eth_requestAccounts: EVENT_NAMES.PERMISSIONS_REQUESTED, }; -/** - * This object maps a method name to a RATE_LIMIT_TYPE. If not in this map the - * default is 'RATE_LIMITED' - */ -const RATE_LIMIT_MAP = { - [MESSAGE_TYPE.ETH_SIGN]: RATE_LIMIT_TYPES.NON_RATE_LIMITED, - [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA]: RATE_LIMIT_TYPES.NON_RATE_LIMITED, - [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V3]: RATE_LIMIT_TYPES.NON_RATE_LIMITED, - [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V4]: RATE_LIMIT_TYPES.NON_RATE_LIMITED, - [MESSAGE_TYPE.PERSONAL_SIGN]: RATE_LIMIT_TYPES.NON_RATE_LIMITED, - [MESSAGE_TYPE.ETH_DECRYPT]: RATE_LIMIT_TYPES.NON_RATE_LIMITED, - [MESSAGE_TYPE.ETH_GET_ENCRYPTION_PUBLIC_KEY]: - RATE_LIMIT_TYPES.NON_RATE_LIMITED, - [MESSAGE_TYPE.ETH_REQUEST_ACCOUNTS]: RATE_LIMIT_TYPES.RATE_LIMITED, - [MESSAGE_TYPE.WALLET_REQUEST_PERMISSIONS]: RATE_LIMIT_TYPES.RATE_LIMITED, - [MESSAGE_TYPE.SEND_METADATA]: RATE_LIMIT_TYPES.BLOCKED, - [MESSAGE_TYPE.GET_PROVIDER_STATE]: RATE_LIMIT_TYPES.BLOCKED, -}; - -/** - * For events with user interaction (approve / reject | cancel) this map will - * return an object with APPROVED, REJECTED and REQUESTED keys that map to the - * appropriate event names. - */ -const EVENT_NAME_MAP = { - [MESSAGE_TYPE.ETH_SIGN]: { - APPROVED: EVENT_NAMES.SIGNATURE_APPROVED, - REJECTED: EVENT_NAMES.SIGNATURE_REJECTED, - REQUESTED: EVENT_NAMES.SIGNATURE_REQUESTED, - }, - [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA]: { - APPROVED: EVENT_NAMES.SIGNATURE_APPROVED, - REJECTED: EVENT_NAMES.SIGNATURE_REJECTED, - REQUESTED: EVENT_NAMES.SIGNATURE_REQUESTED, - }, - [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V3]: { - APPROVED: EVENT_NAMES.SIGNATURE_APPROVED, - REJECTED: EVENT_NAMES.SIGNATURE_REJECTED, - REQUESTED: EVENT_NAMES.SIGNATURE_REQUESTED, - }, - [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V4]: { - APPROVED: EVENT_NAMES.SIGNATURE_APPROVED, - REJECTED: EVENT_NAMES.SIGNATURE_REJECTED, - REQUESTED: EVENT_NAMES.SIGNATURE_REQUESTED, - }, - [MESSAGE_TYPE.PERSONAL_SIGN]: { - APPROVED: EVENT_NAMES.SIGNATURE_APPROVED, - REJECTED: EVENT_NAMES.SIGNATURE_REJECTED, - REQUESTED: EVENT_NAMES.SIGNATURE_REQUESTED, - }, - [MESSAGE_TYPE.ETH_DECRYPT]: { - APPROVED: EVENT_NAMES.DECRYPTION_APPROVED, - REJECTED: EVENT_NAMES.DECRYPTION_REJECTED, - REQUESTED: EVENT_NAMES.DECRYPTION_REQUESTED, - }, - [MESSAGE_TYPE.ETH_GET_ENCRYPTION_PUBLIC_KEY]: { - APPROVED: EVENT_NAMES.ENCRYPTION_PUBLIC_KEY_APPROVED, - REJECTED: EVENT_NAMES.ENCRYPTION_PUBLIC_KEY_REJECTED, - REQUESTED: EVENT_NAMES.ENCRYPTION_PUBLIC_KEY_REQUESTED, - }, - [MESSAGE_TYPE.ETH_REQUEST_ACCOUNTS]: { - APPROVED: EVENT_NAMES.PERMISSIONS_APPROVED, - REJECTED: EVENT_NAMES.PERMISSIONS_REJECTED, - REQUESTED: EVENT_NAMES.PERMISSIONS_REQUESTED, - }, - [MESSAGE_TYPE.WALLET_REQUEST_PERMISSIONS]: { - APPROVED: EVENT_NAMES.PERMISSIONS_APPROVED, - REJECTED: EVENT_NAMES.PERMISSIONS_REJECTED, - REQUESTED: EVENT_NAMES.PERMISSIONS_REQUESTED, - }, -}; - -const rateLimitTimeouts = {}; +const samplingTimeouts = {}; /** * Returns a middleware that tracks inpage_provider usage using sampling for @@ -93,113 +21,65 @@ const rateLimitTimeouts = {}; * signature requests * * @param {object} opts - options for the rpc method tracking middleware - * @param {Function} opts.trackEvent - trackEvent method from - * MetaMetricsController - * @param {Function} opts.getMetricsState - get the state of - * MetaMetricsController - * @param {number} [opts.rateLimitSeconds] - number of seconds to wait before - * allowing another set of events to be tracked. + * @param {Function} opts.trackEvent - trackEvent method from MetaMetricsController + * @param {Function} opts.getMetricsState - get the state of MetaMetricsController * @returns {Function} */ export default function createRPCMethodTrackingMiddleware({ trackEvent, getMetricsState, - rateLimitSeconds = 60, }) { return function rpcMethodTrackingMiddleware( /** @type {any} */ req, /** @type {any} */ res, /** @type {Function} */ next, ) { - const { origin, method } = req; - - // Determine what type of rate limit to apply based on method - const rateLimitType = - RATE_LIMIT_MAP[method] ?? RATE_LIMIT_TYPES.RATE_LIMITED; - - // If the rateLimitType is RATE_LIMITED check the rateLimitTimeouts - const rateLimited = - rateLimitType === RATE_LIMIT_TYPES.RATE_LIMITED && - typeof rateLimitTimeouts[method] !== 'undefined'; - - // Get the participateInMetaMetrics state to determine if we should track - // anything. This is extra redundancy because this value is checked in - // the metametrics controller's trackEvent method as well. - const userParticipatingInMetaMetrics = - getMetricsState().participateInMetaMetrics === true; - - // Get the event type, each of which has APPROVED, REJECTED and REQUESTED - // keys for the various events in the flow. - const eventType = EVENT_NAME_MAP[method]; - - // Boolean variable that reduces code duplication and increases legibility - const shouldTrackEvent = - // Don't track if the request came from our own UI or background - origin !== ORIGIN_METAMASK && - // Don't track if this is a blocked method - rateLimitType !== RATE_LIMIT_TYPES.BLOCKED && - // Don't track if the rate limit has been hit - rateLimited === false && - // Don't track if the user isn't participating in metametrics - userParticipatingInMetaMetrics === true; - - if (shouldTrackEvent) { - // We track an initial "requested" event as soon as the dapp calls the - // provider method. For the events not special cased this is the only - // event that will be fired and the event name will be - // 'Provider Method Called'. - const event = eventType - ? eventType.REQUESTED - : EVENT_NAMES.PROVIDER_METHOD_CALLED; - - const properties = {}; - - if (event === EVENT_NAMES.SIGNATURE_REQUESTED) { - properties.signature_type = method; - } else { - properties.method = method; - } - - trackEvent({ - event, - category: EVENT.CATEGORIES.INPAGE_PROVIDER, - referrer: { - url: origin, - }, - properties, - }); - - rateLimitTimeouts[method] = setTimeout(() => { - delete rateLimitTimeouts[method]; - }, SECOND * rateLimitSeconds); - } + const startTime = Date.now(); + const { origin } = req; next((callback) => { - if (shouldTrackEvent === false || typeof eventType === 'undefined') { + const endTime = Date.now(); + if (!getMetricsState().participateInMetaMetrics) { return callback(); } - - // An error code of 4001 means the user rejected the request, which we - // can use here to determine which event to track. - const event = - res.error?.code === 4001 ? eventType.REJECTED : eventType.APPROVED; - - const properties = {}; - - if (eventType.REQUESTED === EVENT_NAMES.SIGNATURE_REQUESTED) { - properties.signature_type = method; - } else { - properties.method = method; + if (USER_PROMPTED_EVENT_NAME_MAP[req.method]) { + const userRejected = res.error?.code === 4001; + trackEvent({ + event: USER_PROMPTED_EVENT_NAME_MAP[req.method], + category: EVENT.CATEGORIES.INPAGE_PROVIDER, + referrer: { + url: origin, + }, + properties: { + method: req.method, + status: userRejected ? 'rejected' : 'approved', + error_code: res.error?.code, + error_message: res.error?.message, + has_result: typeof res.result !== 'undefined', + duration: endTime - startTime, + }, + }); + } else if (typeof samplingTimeouts[req.method] === 'undefined') { + trackEvent({ + event: 'Provider Method Called', + category: EVENT.CATEGORIES.INPAGE_PROVIDER, + referrer: { + url: origin, + }, + properties: { + method: req.method, + error_code: res.error?.code, + error_message: res.error?.message, + has_result: typeof res.result !== 'undefined', + duration: endTime - startTime, + }, + }); + // Only record one call to this method every ten seconds to avoid + // overloading network requests. + samplingTimeouts[req.method] = setTimeout(() => { + delete samplingTimeouts[req.method]; + }, SECOND * 10); } - - trackEvent({ - event, - category: EVENT.CATEGORIES.INPAGE_PROVIDER, - referrer: { - url: origin, - }, - properties, - }); return callback(); }); }; diff --git a/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js b/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js deleted file mode 100644 index ffa953fa0f75..000000000000 --- a/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js +++ /dev/null @@ -1,217 +0,0 @@ -import { MESSAGE_TYPE } from '../../../shared/constants/app'; -import { EVENT_NAMES } from '../../../shared/constants/metametrics'; -import { SECOND } from '../../../shared/constants/time'; -import createRPCMethodTrackingMiddleware from './createRPCMethodTrackingMiddleware'; - -const trackEvent = jest.fn(); -const metricsState = { participateInMetaMetrics: null }; -const getMetricsState = () => metricsState; - -const handler = createRPCMethodTrackingMiddleware({ - trackEvent, - getMetricsState, - rateLimitSeconds: 1, -}); - -function getNext(timeout = 500) { - let deferred; - const promise = new Promise((resolve) => { - deferred = { - resolve, - }; - }); - const cb = () => deferred.resolve(); - let triggerNext; - setTimeout(() => { - deferred.resolve(); - }, timeout); - return { - executeMiddlewareStack: async () => { - if (triggerNext) { - triggerNext(() => cb()); - } - return await deferred.resolve(); - }, - promise, - next: (postReqHandler) => { - triggerNext = postReqHandler; - }, - }; -} - -const waitForSeconds = async (seconds) => - await new Promise((resolve) => setTimeout(resolve, SECOND * seconds)); - -describe('createRPCMethodTrackingMiddleware', () => { - afterEach(() => { - jest.resetAllMocks(); - metricsState.participateInMetaMetrics = null; - }); - - describe('before participateInMetaMetrics is set', () => { - it('should not track an event for a signature request', async () => { - const req = { - method: MESSAGE_TYPE.ETH_SIGN, - origin: 'some.dapp', - }; - - const res = { - error: null, - }; - const { executeMiddlewareStack, next } = getNext(); - handler(req, res, next); - await executeMiddlewareStack(); - expect(trackEvent).not.toHaveBeenCalled(); - }); - }); - - describe('participateInMetaMetrics is set to false', () => { - beforeEach(() => { - metricsState.participateInMetaMetrics = false; - }); - - it('should not track an event for a signature request', async () => { - const req = { - method: MESSAGE_TYPE.ETH_SIGN, - origin: 'some.dapp', - }; - - const res = { - error: null, - }; - const { executeMiddlewareStack, next } = getNext(); - handler(req, res, next); - await executeMiddlewareStack(); - expect(trackEvent).not.toHaveBeenCalled(); - }); - }); - - describe('participateInMetaMetrics is set to true', () => { - beforeEach(() => { - metricsState.participateInMetaMetrics = true; - }); - - it(`should immediately track a ${EVENT_NAMES.SIGNATURE_REQUESTED} event`, () => { - const req = { - method: MESSAGE_TYPE.ETH_SIGN, - origin: 'some.dapp', - }; - - const res = { - error: null, - }; - const { next } = getNext(); - handler(req, res, next); - expect(trackEvent).toHaveBeenCalledTimes(1); - expect(trackEvent.mock.calls[0][0]).toMatchObject({ - category: 'inpage_provider', - event: EVENT_NAMES.SIGNATURE_REQUESTED, - properties: { signature_type: MESSAGE_TYPE.ETH_SIGN }, - referrer: { url: 'some.dapp' }, - }); - }); - - it(`should track a ${EVENT_NAMES.SIGNATURE_APPROVED} event if the user approves`, async () => { - const req = { - method: MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V4, - origin: 'some.dapp', - }; - - const res = { - error: null, - }; - const { next, executeMiddlewareStack } = getNext(); - handler(req, res, next); - await executeMiddlewareStack(); - expect(trackEvent).toHaveBeenCalledTimes(2); - expect(trackEvent.mock.calls[1][0]).toMatchObject({ - category: 'inpage_provider', - event: EVENT_NAMES.SIGNATURE_APPROVED, - properties: { signature_type: MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V4 }, - referrer: { url: 'some.dapp' }, - }); - }); - - it(`should track a ${EVENT_NAMES.SIGNATURE_REJECTED} event if the user approves`, async () => { - const req = { - method: MESSAGE_TYPE.PERSONAL_SIGN, - origin: 'some.dapp', - }; - - const res = { - error: { code: 4001 }, - }; - const { next, executeMiddlewareStack } = getNext(); - handler(req, res, next); - await executeMiddlewareStack(); - expect(trackEvent).toHaveBeenCalledTimes(2); - expect(trackEvent.mock.calls[1][0]).toMatchObject({ - category: 'inpage_provider', - event: EVENT_NAMES.SIGNATURE_REJECTED, - properties: { signature_type: MESSAGE_TYPE.PERSONAL_SIGN }, - referrer: { url: 'some.dapp' }, - }); - }); - - it(`should track a ${EVENT_NAMES.PERMISSIONS_APPROVED} event if the user approves`, async () => { - const req = { - method: MESSAGE_TYPE.ETH_REQUEST_ACCOUNTS, - origin: 'some.dapp', - }; - - const res = {}; - const { next, executeMiddlewareStack } = getNext(); - handler(req, res, next); - await executeMiddlewareStack(); - expect(trackEvent).toHaveBeenCalledTimes(2); - expect(trackEvent.mock.calls[1][0]).toMatchObject({ - category: 'inpage_provider', - event: EVENT_NAMES.PERMISSIONS_APPROVED, - properties: { method: MESSAGE_TYPE.ETH_REQUEST_ACCOUNTS }, - referrer: { url: 'some.dapp' }, - }); - }); - - it(`should never track blocked methods such as ${MESSAGE_TYPE.GET_PROVIDER_STATE}`, () => { - const req = { - method: MESSAGE_TYPE.GET_PROVIDER_STATE, - origin: 'www.notadapp.com', - }; - - const res = { - error: null, - }; - const { next, executeMiddlewareStack } = getNext(); - handler(req, res, next); - expect(trackEvent).not.toHaveBeenCalled(); - executeMiddlewareStack(); - }); - - it(`should only track events when not rate limited`, async () => { - const req = { - method: 'eth_chainId', - origin: 'some.dapp', - }; - - const res = { - error: null, - }; - - let callCount = 0; - - while (callCount < 3) { - callCount += 1; - const { next, executeMiddlewareStack } = getNext(); - handler(req, res, next); - await executeMiddlewareStack(); - if (callCount !== 3) { - await waitForSeconds(0.6); - } - } - - expect(trackEvent).toHaveBeenCalledTimes(2); - expect(trackEvent.mock.calls[0][0].properties.method).toBe('eth_chainId'); - expect(trackEvent.mock.calls[1][0].properties.method).toBe('eth_chainId'); - }); - }); -}); diff --git a/app/scripts/lib/ens-ipfs/setup.js b/app/scripts/lib/ens-ipfs/setup.js index 942b888ccd85..2d19811c3fa8 100644 --- a/app/scripts/lib/ens-ipfs/setup.js +++ b/app/scripts/lib/ens-ipfs/setup.js @@ -2,10 +2,11 @@ import base32Encode from 'base32-encode'; import base64 from 'base64-js'; import browser from 'webextension-polyfill'; +import { SECOND } from '../../../../shared/constants/time'; import getFetchWithTimeout from '../../../../shared/modules/fetch-with-timeout'; import resolveEnsToIpfsContentId from './resolver'; -const fetchWithTimeout = getFetchWithTimeout(); +const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); const supportedTopLevelDomains = ['eth']; diff --git a/app/scripts/lib/metaRPCClientFactory.js b/app/scripts/lib/metaRPCClientFactory.js index 1dfe572d2c02..689774f914a7 100644 --- a/app/scripts/lib/metaRPCClientFactory.js +++ b/app/scripts/lib/metaRPCClientFactory.js @@ -1,7 +1,6 @@ import { EthereumRpcError } from 'eth-rpc-errors'; import SafeEventEmitter from 'safe-event-emitter'; import createRandomId from '../../../shared/modules/random-id'; -import { TEN_SECONDS_IN_MILLISECONDS } from '../../../ui/helpers/constants/critical-error'; class MetaRPCClient { constructor(connectionStream) { @@ -11,25 +10,6 @@ class MetaRPCClient { this.requests = new Map(); this.connectionStream.on('data', this.handleResponse.bind(this)); this.connectionStream.on('end', this.close.bind(this)); - this.responseHandled = {}; - } - - send(id, payload, cb) { - this.requests.set(id, cb); - this.connectionStream.write(payload); - this.responseHandled[id] = false; - if (payload.method === 'getState') { - setTimeout(() => { - if (!this.responseHandled[id] && cb) { - delete this.responseHandled[id]; - return cb(new Error('No response from RPC'), null); - } - - delete this.responseHandled[id]; - // needed for linter to pass - return true; - }, TEN_SECONDS_IN_MILLISECONDS); - } } onNotification(handler) { @@ -54,8 +34,6 @@ class MetaRPCClient { const isNotification = id === undefined && error === undefined; const cb = this.requests.get(id); - this.responseHandled[id] = true; - if (method && params && !isNotification) { // dont handle server-side to client-side requests return; @@ -101,13 +79,14 @@ const metaRPCClientFactory = (connectionStream) => { const cb = p[p.length - 1]; const params = p.slice(0, -1); const id = createRandomId(); - const payload = { + + object.requests.set(id, cb); + object.connectionStream.write({ jsonrpc: '2.0', method: property, params, id, - }; - object.send(id, payload, cb); + }); }; }, }); diff --git a/app/scripts/lib/metaRPCClientFactory.test.js b/app/scripts/lib/metaRPCClientFactory.test.js index d8fbf6fe3fbe..8304cf4e98d6 100644 --- a/app/scripts/lib/metaRPCClientFactory.test.js +++ b/app/scripts/lib/metaRPCClientFactory.test.js @@ -131,21 +131,4 @@ describe('metaRPCClientFactory', () => { }, }); }); - - it('should be able to handle no message within TIMEOUT secs', async () => { - jest.useFakeTimers(); - const streamTest = createThoughStream(); - const metaRPCClient = metaRPCClientFactory(streamTest); - - const errorPromise = new Promise((_resolve, reject) => - metaRPCClient.getState('bad', (error, _) => { - reject(error); - }), - ); - - jest.runOnlyPendingTimers(); - await expect(errorPromise).rejects.toThrow('No response from RPC'); - - jest.useRealTimers(); - }); }); diff --git a/app/scripts/lib/network-store.js b/app/scripts/lib/network-store.js index f4e5997bf279..ca5f4c843d22 100644 --- a/app/scripts/lib/network-store.js +++ b/app/scripts/lib/network-store.js @@ -1,7 +1,8 @@ import log from 'loglevel'; +import { SECOND } from '../../../shared/constants/time'; import getFetchWithTimeout from '../../../shared/modules/fetch-with-timeout'; -const fetchWithTimeout = getFetchWithTimeout(); +const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); const FIXTURE_SERVER_HOST = 'localhost'; const FIXTURE_SERVER_PORT = 12345; diff --git a/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js b/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js index d3130296601c..82ac2cf846a9 100644 --- a/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js +++ b/app/scripts/lib/rpc-method-middleware/handlers/add-ethereum-chain.js @@ -1,10 +1,7 @@ import { ethErrors, errorCodes } from 'eth-rpc-errors'; import validUrl from 'valid-url'; import { omit } from 'lodash'; -import { - MESSAGE_TYPE, - UNKNOWN_TICKER_SYMBOL, -} from '../../../../../shared/constants/app'; +import { MESSAGE_TYPE } from '../../../../../shared/constants/app'; import { EVENT } from '../../../../../shared/constants/metametrics'; import { isPrefixedFormattedHexString, @@ -19,7 +16,6 @@ const addEthereumChain = { hookNames: { addCustomRpc: true, getCurrentChainId: true, - getCurrentRpcUrl: true, findCustomRpcBy: true, updateRpcTarget: true, requestUserApproval: true, @@ -36,7 +32,6 @@ async function addEthereumChainHandler( { addCustomRpc, getCurrentChainId, - getCurrentRpcUrl, findCustomRpcBy, updateRpcTarget, requestUserApproval, @@ -82,27 +77,14 @@ async function addEthereumChainHandler( ); } - const isLocalhost = (strUrl) => { - try { - const url = new URL(strUrl); - return url.hostname === 'localhost' || url.hostname === '127.0.0.1'; - } catch (error) { - return false; - } - }; - const firstValidRPCUrl = Array.isArray(rpcUrls) - ? rpcUrls.find( - (rpcUrl) => isLocalhost(rpcUrl) || validUrl.isHttpsUri(rpcUrl), - ) + ? rpcUrls.find((rpcUrl) => validUrl.isHttpsUri(rpcUrl)) : null; const firstValidBlockExplorerUrl = blockExplorerUrls !== null && Array.isArray(blockExplorerUrls) - ? blockExplorerUrls.find( - (blockExplorerUrl) => - isLocalhost(blockExplorerUrl) || - validUrl.isHttpsUri(blockExplorerUrl), + ? blockExplorerUrls.find((blockExplorerUrl) => + validUrl.isHttpsUri(blockExplorerUrl), ) : null; @@ -150,21 +132,15 @@ async function addEthereumChainHandler( const existingNetwork = findCustomRpcBy({ chainId: _chainId }); - // if the request is to add a network that is already added and configured - // with the same RPC gateway we shouldn't try to add it again. - if (existingNetwork && existingNetwork.rpcUrl === firstValidRPCUrl) { + if (existingNetwork) { // If the network already exists, the request is considered successful res.result = null; const currentChainId = getCurrentChainId(); - const currentRpcUrl = getCurrentRpcUrl(); - - // If the current chainId and rpcUrl matches that of the incoming request - // We don't need to proceed further. - if (currentChainId === _chainId && currentRpcUrl === firstValidRPCUrl) { + if (currentChainId === _chainId) { return end(); } - // If this network is already added with but is not the currently selected network + // Ask the user to switch the network try { await updateRpcTarget( @@ -247,32 +223,15 @@ async function addEthereumChainHandler( ); } } + const ticker = nativeCurrency?.symbol || 'ETH'; - const ticker = nativeCurrency?.symbol || UNKNOWN_TICKER_SYMBOL; - - if ( - ticker !== UNKNOWN_TICKER_SYMBOL && - (typeof ticker !== 'string' || ticker.length < 2 || ticker.length > 6) - ) { + 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}`, }), ); } - // if the chainId is the same as an existing network but the ticker is different we want to block this action - // as it is potentially malicious and confusing - if ( - existingNetwork && - existingNetwork.chainId === _chainId && - existingNetwork.ticker !== ticker - ) { - return end( - ethErrors.rpc.invalidParams({ - message: `nativeCurrency.symbol does not match currency symbol for a network the user already has added with the same chainId. Received:\n${ticker}`, - }), - ); - } try { await addCustomRpc( @@ -289,34 +248,25 @@ async function addEthereumChainHandler( }), ); - let rpcUrlOrigin; - try { - rpcUrlOrigin = new URL(firstValidRPCUrl).origin; - } catch { - // ignore - } - sendMetrics({ event: 'Custom Network Added', category: EVENT.CATEGORIES.NETWORK, referrer: { url: origin, }, - properties: { + 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: rpcUrlOrigin, + network: firstValidRPCUrl, symbol: ticker, block_explorer_url: firstValidBlockExplorerUrl, source: EVENT.SOURCE.TRANSACTION.DAPP, }, - sensitiveProperties: { - rpc_url: rpcUrlOrigin, - }, }); // Once the network has been added, the requested is considered successful diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index 196389439e61..7332041bb5d0 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -103,17 +103,7 @@ export default function setupSentry({ release, getState }) { environment, integrations: [new Dedupe(), new ExtraErrorData()], release, - beforeSend: (report) => { - if (getState) { - const appState = getState(); - if (!appState?.store?.metamask?.participateInMetaMetrics) { - return null; - } - } else { - return null; - } - return rewriteReport(report); - }, + beforeSend: (report) => rewriteReport(report), }); function rewriteReport(report) { diff --git a/app/scripts/lib/util.js b/app/scripts/lib/util.js index b7fdf0521cee..9800666afd3b 100644 --- a/app/scripts/lib/util.js +++ b/app/scripts/lib/util.js @@ -27,7 +27,7 @@ const getEnvironmentTypeMemo = memoize((url) => { const parsedUrl = new URL(url); if (parsedUrl.pathname === '/popup.html') { return ENVIRONMENT_TYPE_POPUP; - } else if (['/home.html'].includes(parsedUrl.pathname)) { + } else if (['/home.html', '/phishing.html'].includes(parsedUrl.pathname)) { return ENVIRONMENT_TYPE_FULLSCREEN; } else if (parsedUrl.pathname === '/notification.html') { return ENVIRONMENT_TYPE_NOTIFICATION; diff --git a/app/scripts/lib/util.test.js b/app/scripts/lib/util.test.js index 0892a4e3dea6..62c33b5a537c 100644 --- a/app/scripts/lib/util.test.js +++ b/app/scripts/lib/util.test.js @@ -34,6 +34,13 @@ describe('app utils', () => { expect(environmentType).toStrictEqual(ENVIRONMENT_TYPE_FULLSCREEN); }); + it('should return fullscreen type for phishing.html', () => { + const environmentType = getEnvironmentType( + 'http://extension-id/phishing.html', + ); + expect(environmentType).toStrictEqual(ENVIRONMENT_TYPE_FULLSCREEN); + }); + it('should return background type', () => { const environmentType = getEnvironmentType( 'http://extension-id/_generated_background_page.html', diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index e7112e23965e..5f9139c13031 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -42,7 +42,6 @@ import { SubjectMetadataController, ///: BEGIN:ONLY_INCLUDE_IN(flask) RateLimitController, - NotificationController, ///: END:ONLY_INCLUDE_IN } from '@metamask/controllers'; import SmartTransactionsController from '@metamask/smart-transactions-controller'; @@ -51,15 +50,12 @@ import { SnapController, IframeExecutionService, } from '@metamask/snap-controllers'; -import { satisfies as satisfiesSemver } from 'semver'; ///: END:ONLY_INCLUDE_IN import { - ASSET_TYPES, TRANSACTION_STATUSES, TRANSACTION_TYPES, } from '../../shared/constants/transaction'; -import { PHISHING_NEW_ISSUE_URLS } from '../../shared/constants/phishing'; import { GAS_API_BASE_URL, GAS_DEV_API_BASE_URL, @@ -88,13 +84,10 @@ import { POLLING_TOKEN_ENVIRONMENT_TYPES, SUBJECT_TYPES, } from '../../shared/constants/app'; -import { EVENT, EVENT_NAMES } from '../../shared/constants/metametrics'; +import { EVENT } from '../../shared/constants/metametrics'; import { hexToDecimal } from '../../ui/helpers/utils/conversions.util'; -import { - getTokenIdParam, - getTokenValueParam, -} from '../../ui/helpers/utils/token-util'; +import { getTokenValueParam } from '../../ui/helpers/utils/token-util'; import { isEqualCaseInsensitive } from '../../shared/modules/string-utils'; import { parseStandardTokenTransactionData } from '../../shared/modules/transaction.utils'; import { @@ -161,9 +154,6 @@ export const METAMASK_CONTROLLER_EVENTS = { APPROVAL_STATE_CHANGE: 'ApprovalController:stateChange', }; -// stream channels -const PHISHING_SAFELIST = 'metamask-phishing-safelist'; - export default class MetamaskController extends EventEmitter { /** * @param {Object} opts @@ -251,28 +241,35 @@ export default class MetamaskController extends EventEmitter { config: { provider: this.provider }, state: initState.TokensController, }); - - this.assetsContractController = new AssetsContractController( - { - onPreferencesStateChange: (listener) => - this.preferencesController.store.subscribe(listener), - onNetworkStateChange: (cb) => - this.networkController.store.subscribe((networkState) => { - const modifiedNetworkState = { - ...networkState, - provider: { - ...networkState.provider, - chainId: hexToDecimal(networkState.provider.chainId), - }, - }; - return cb(modifiedNetworkState); - }), - }, - { - provider: this.provider, - }, - initState.AssetsContractController, - ); + process.env.TOKEN_DETECTION_V2 + ? (this.assetsContractController = new AssetsContractController({ + onPreferencesStateChange: (listener) => + this.preferencesController.store.subscribe(listener), + onNetworkStateChange: (cb) => + this.networkController.store.subscribe((networkState) => { + const modifiedNetworkState = { + ...networkState, + provider: { + ...networkState.provider, + chainId: hexToDecimal(networkState.provider.chainId), + }, + }; + return cb(modifiedNetworkState); + }), + config: { + provider: this.provider, + }, + state: initState.AssetsContractController, + })) + : (this.assetsContractController = new AssetsContractController( + { + onPreferencesStateChange: (listener) => + this.preferencesController.store.subscribe(listener), + }, + { + provider: this.provider, + }, + )); this.collectiblesController = new CollectiblesController( { @@ -300,21 +297,6 @@ export default class MetamaskController extends EventEmitter { getERC1155TokenURI: this.assetsContractController.getERC1155TokenURI.bind( this.assetsContractController, ), - onCollectibleAdded: ({ address, symbol, tokenId, standard, source }) => - this.metaMetricsController.trackEvent({ - event: EVENT_NAMES.NFT_ADDED, - category: EVENT.CATEGORIES.WALLET, - properties: { - token_contract_address: address, - token_symbol: symbol, - asset_type: ASSET_TYPES.COLLECTIBLE, - token_standard: standard, - source, - }, - sensitiveProperties: { - tokenId, - }, - }), }, {}, initState.CollectiblesController, @@ -431,23 +413,50 @@ export default class MetamaskController extends EventEmitter { const tokenListMessenger = this.controllerMessenger.getRestricted({ name: 'TokenListController', }); - - this.tokenListController = new TokenListController({ - chainId: hexToDecimal(this.networkController.getCurrentChainId()), - onNetworkStateChange: (cb) => - this.networkController.store.subscribe((networkState) => { - const modifiedNetworkState = { - ...networkState, - provider: { - ...networkState.provider, - chainId: hexToDecimal(networkState.provider.chainId), - }, - }; - return cb(modifiedNetworkState); - }), - messenger: tokenListMessenger, - state: initState.TokenListController, - }); + process.env.TOKEN_DETECTION_V2 + ? (this.tokenListController = new TokenListController({ + chainId: hexToDecimal(this.networkController.getCurrentChainId()), + onNetworkStateChange: (cb) => + this.networkController.store.subscribe((networkState) => { + const modifiedNetworkState = { + ...networkState, + provider: { + ...networkState.provider, + chainId: hexToDecimal(networkState.provider.chainId), + }, + }; + return cb(modifiedNetworkState); + }), + messenger: tokenListMessenger, + state: initState.TokenListController, + })) + : (this.tokenListController = new TokenListController({ + chainId: hexToDecimal(this.networkController.getCurrentChainId()), + useStaticTokenList: !this.preferencesController.store.getState() + .useTokenDetection, + onNetworkStateChange: (cb) => + this.networkController.store.subscribe((networkState) => { + const modifiedNetworkState = { + ...networkState, + provider: { + ...networkState.provider, + chainId: hexToDecimal(networkState.provider.chainId), + }, + }; + return cb(modifiedNetworkState); + }), + onPreferencesStateChange: (cb) => + this.preferencesController.store.subscribe((preferencesState) => { + const modifiedPreferencesState = { + ...preferencesState, + useStaticTokenList: !this.preferencesController.store.getState() + .useTokenDetection, + }; + return cb(modifiedPreferencesState); + }), + messenger: tokenListMessenger, + state: initState.TokenListController, + })); this.phishingController = new PhishingController(); @@ -627,9 +636,10 @@ export default class MetamaskController extends EventEmitter { }); ///: BEGIN:ONLY_INCLUDE_IN(flask) - this.snapExecutionService = new IframeExecutionService({ + this.workerController = new IframeExecutionService({ + onError: this.onExecutionEnvironmentError.bind(this), iframeUrl: new URL( - 'https://metamask.github.io/iframe-execution-environment/0.5.2', + 'https://metamask.github.io/iframe-execution-environment/0.4.5', ), messenger: this.controllerMessenger.getRestricted({ name: 'ExecutionService', @@ -641,8 +651,7 @@ export default class MetamaskController extends EventEmitter { name: 'SnapController', allowedEvents: [ 'ExecutionService:unhandledError', - 'ExecutionService:outboundRequest', - 'ExecutionService:outboundResponse', + 'ExecutionService:unresponsive', ], allowedActions: [ `${this.permissionController.name}:getEndowments`, @@ -652,62 +661,28 @@ export default class MetamaskController extends EventEmitter { `${this.permissionController.name}:requestPermissions`, `${this.permissionController.name}:revokeAllPermissions`, `${this.permissionController.name}:revokePermissionForAllSubjects`, - 'ExecutionService:executeSnap', - 'ExecutionService:getRpcRequestHandler', - 'ExecutionService:terminateSnap', - 'ExecutionService:terminateAllSnaps', ], }); - const SNAP_BLOCKLIST = [ - { - id: 'npm:@consensys/starknet-snap', - versionRange: '<0.1.11', - }, - ]; - this.snapController = new SnapController({ - environmentEndowmentPermissions: Object.values(EndowmentPermissions), + endowmentPermissionNames: Object.values(EndowmentPermissions), + terminateAllSnaps: this.workerController.terminateAllSnaps.bind( + this.workerController, + ), + terminateSnap: this.workerController.terminateSnap.bind( + this.workerController, + ), + executeSnap: this.workerController.executeSnap.bind( + this.workerController, + ), + getRpcMessageHandler: this.workerController.getRpcMessageHandler.bind( + this.workerController, + ), closeAllConnections: this.removeAllConnections.bind(this), - // Prefix subject with appKeyType to generate separate keys for separate uses - getAppKey: async (subject, appKeyType) => { - await this.appStateController.getUnlockPromise(true); - return this.getAppKeyForSubject(`${appKeyType}:${subject}`); - }, - checkBlockList: async (snapsToCheck) => { - return Object.entries(snapsToCheck).reduce( - (acc, [snapId, snapVersion]) => { - const blockInfo = SNAP_BLOCKLIST.find( - (blocked) => - blocked.id === snapId && - satisfiesSemver(snapVersion, blocked.versionRange, { - includePrerelease: true, - }), - ); - - const cur = blockInfo - ? { - blocked: true, - reason: blockInfo.reason, - infoUrl: blockInfo.infoUrl, - } - : { blocked: false }; - return { ...acc, [snapId]: cur }; - }, - {}, - ); - }, state: initState.SnapController, messenger: snapControllerMessenger, }); - this.notificationController = new NotificationController({ - messenger: this.controllerMessenger.getRestricted({ - name: 'NotificationController', - }), - state: initState.NotificationController, - }); - this.rateLimitController = new RateLimitController({ messenger: this.controllerMessenger.getRestricted({ name: 'RateLimitController', @@ -726,15 +701,6 @@ export default class MetamaskController extends EventEmitter { ); return null; }, - showInAppNotification: (origin, message) => { - this.controllerMessenger.call( - 'NotificationController:show', - origin, - message, - ); - - return null; - }, }, }); ///: END:ONLY_INCLUDE_IN @@ -869,12 +835,7 @@ export default class MetamaskController extends EventEmitter { } = txMeta.txParams; const { chainId } = txMeta; const transactionData = parseStandardTokenTransactionData(data); - // Sometimes the tokenId value is parsed as "_value" param. Not seeing this often any more, but still occasionally: - // i.e. call approve() on BAYC contract - https://etherscan.io/token/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d#writeContract, and tokenId shows up as _value, - // not sure why since it doesn't match the ERC721 ABI spec we use to parse these transactions - https://github.com/MetaMask/metamask-eth-abis/blob/d0474308a288f9252597b7c93a3a8deaad19e1b2/src/abis/abiERC721.ts#L62. - const transactionDataTokenId = - getTokenIdParam(transactionData) ?? - getTokenValueParam(transactionData); + const tokenAmountOrTokenId = getTokenValueParam(transactionData); const { allCollectibles } = this.collectiblesController.state; // check if its a known collectible @@ -883,7 +844,7 @@ export default class MetamaskController extends EventEmitter { ].find( ({ address, tokenId }) => isEqualCaseInsensitive(address, contractAddress) && - tokenId === transactionDataTokenId, + tokenId === tokenAmountOrTokenId, ); // if it is we check and update ownership status. @@ -1041,7 +1002,6 @@ export default class MetamaskController extends EventEmitter { CollectiblesController: this.collectiblesController, ///: BEGIN:ONLY_INCLUDE_IN(flask) SnapController: this.snapController, - NotificationController: this.notificationController, ///: END:ONLY_INCLUDE_IN }); @@ -1082,7 +1042,6 @@ export default class MetamaskController extends EventEmitter { CollectiblesController: this.collectiblesController, ///: BEGIN:ONLY_INCLUDE_IN(flask) SnapController: this.snapController, - NotificationController: this.notificationController, ///: END:ONLY_INCLUDE_IN }, controllerMessenger: this.controllerMessenger, @@ -1144,9 +1103,9 @@ export default class MetamaskController extends EventEmitter { this.controllerMessenger, 'SnapController:get', ), - handleSnapRpcRequest: this.controllerMessenger.call.bind( + getSnapRpcHandler: this.controllerMessenger.call.bind( this.controllerMessenger, - 'SnapController:handleRpcRequest', + 'SnapController:getRpcMessageHandler', ), getSnapState: this.controllerMessenger.call.bind( this.controllerMessenger, @@ -1158,7 +1117,7 @@ export default class MetamaskController extends EventEmitter { type: MESSAGE_TYPE.SNAP_CONFIRM, requestData: confirmationData, }), - showNativeNotification: (origin, args) => + showNotification: (origin, args) => this.controllerMessenger.call( 'RateLimitController:call', origin, @@ -1166,14 +1125,6 @@ export default class MetamaskController extends EventEmitter { origin, args.message, ), - showInAppNotification: (origin, args) => - this.controllerMessenger.call( - 'RateLimitController:call', - origin, - 'showInAppNotification', - origin, - args.message, - ), updateSnapState: this.controllerMessenger.call.bind( this.controllerMessenger, 'SnapController:updateSnapState', @@ -1181,25 +1132,6 @@ export default class MetamaskController extends EventEmitter { }), }; } - - /** - * Deletes the specified notifications from state. - * - * @param {string[]} ids - The notifications ids to delete. - */ - dismissNotifications(ids) { - this.notificationController.dismiss(ids); - } - - /** - * Updates the readDate attribute of the specified notifications. - * - * @param {string[]} ids - The notifications ids to mark as read. - */ - markNotificationsAsRead(ids) { - this.notificationController.markRead(ids); - } - ///: END:ONLY_INCLUDE_IN /** @@ -1270,7 +1202,7 @@ export default class MetamaskController extends EventEmitter { // Record Snap metadata whenever a Snap is added to state. this.controllerMessenger.subscribe( `${this.snapController.name}:snapAdded`, - (snap, svgIcon = null) => { + (snapId, snap, svgIcon = null) => { const { manifest: { proposedName }, version, @@ -1278,7 +1210,7 @@ export default class MetamaskController extends EventEmitter { this.subjectMetadataController.addSubjectMetadata({ subjectType: SUBJECT_TYPES.SNAP, name: proposedName, - origin: snap.id, + origin: snapId, version, svgIcon, }); @@ -1287,28 +1219,12 @@ export default class MetamaskController extends EventEmitter { this.controllerMessenger.subscribe( `${this.snapController.name}:snapInstalled`, - (truncatedSnap) => { + (snapId) => { this.metaMetricsController.trackEvent({ event: 'Snap Installed', category: EVENT.CATEGORIES.SNAPS, properties: { - snap_id: truncatedSnap.id, - version: truncatedSnap.version, - }, - }); - }, - ); - - this.controllerMessenger.subscribe( - `${this.snapController.name}:snapUpdated`, - (newSnap, oldVersion) => { - this.metaMetricsController.trackEvent({ - event: 'Snap Updated', - category: EVENT.CATEGORIES.SNAPS, - properties: { - snap_id: newSnap.id, - old_version: oldVersion, - new_version: newSnap.version, + snap_id: snapId, }, }); }, @@ -1316,12 +1232,12 @@ export default class MetamaskController extends EventEmitter { this.controllerMessenger.subscribe( `${this.snapController.name}:snapTerminated`, - (truncatedSnap) => { + (snapId) => { const approvals = Object.values( this.approvalController.state.pendingApprovals, ).filter( (approval) => - approval.origin === truncatedSnap.id && + approval.origin === snapId && approval.type === MESSAGE_TYPE.SNAP_CONFIRM, ); for (const approval of approvals) { @@ -1542,6 +1458,7 @@ export default class MetamaskController extends EventEmitter { ), markPasswordForgotten: this.markPasswordForgotten.bind(this), unMarkPasswordForgotten: this.unMarkPasswordForgotten.bind(this), + safelistPhishingDomain: this.safelistPhishingDomain.bind(this), getRequestAccountTabIds: this.getRequestAccountTabIds, getOpenMetamaskTabsIds: this.getOpenMetamaskTabsIds, markNotificationPopupAsAutomaticallyClosed: () => @@ -1603,8 +1520,7 @@ export default class MetamaskController extends EventEmitter { setCustomRpc: this.setCustomRpc.bind(this), updateAndSetCustomRpc: this.updateAndSetCustomRpc.bind(this), delCustomRpc: this.delCustomRpc.bind(this), - addCustomNetwork: this.addCustomNetwork.bind(this), - requestUserApproval: this.requestUserApproval.bind(this), + // PreferencesController setSelectedAddress: preferencesController.setSelectedAddress.bind( preferencesController, @@ -1617,6 +1533,7 @@ export default class MetamaskController extends EventEmitter { tokensController, ), updateTokenType: tokensController.updateTokenType.bind(tokensController), + removeToken: tokensController.removeAndIgnoreToken.bind(tokensController), setAccountLabel: preferencesController.setAccountLabel.bind( preferencesController, ), @@ -1640,9 +1557,7 @@ export default class MetamaskController extends EventEmitter { preferencesController, ), setTheme: preferencesController.setTheme.bind(preferencesController), - setCustomNetworkListEnabled: preferencesController.setCustomNetworkListEnabled.bind( - preferencesController, - ), + // AssetsContractController getTokenStandardAndDetails: this.getTokenStandardAndDetails.bind(this), @@ -1842,8 +1757,6 @@ export default class MetamaskController extends EventEmitter { disableSnap: this.snapController.disableSnap.bind(this.snapController), enableSnap: this.snapController.enableSnap.bind(this.snapController), removeSnap: this.snapController.removeSnap.bind(this.snapController), - dismissNotifications: this.dismissNotifications.bind(this), - markNotificationsAsRead: this.markNotificationsAsRead.bind(this), ///: END:ONLY_INCLUDE_IN // swaps @@ -1907,6 +1820,9 @@ export default class MetamaskController extends EventEmitter { fetchSmartTransactionFees: smartTransactionsController.getFees.bind( smartTransactionsController, ), + estimateSmartTransactionsGas: smartTransactionsController.estimateGas.bind( + smartTransactionsController, + ), submitSignedTransactions: smartTransactionsController.submitSignedTransactions.bind( smartTransactionsController, ), @@ -1990,14 +1906,20 @@ export default class MetamaskController extends EventEmitter { : null, /** Token Detection V2 */ - addDetectedTokens: tokensController.addDetectedTokens.bind( - tokensController, - ), - addImportedTokens: tokensController.addTokens.bind(tokensController), - ignoreTokens: tokensController.ignoreTokens.bind(tokensController), - getBalancesInSingleCall: assetsContractController.getBalancesInSingleCall.bind( - assetsContractController, - ), + addDetectedTokens: process.env.TOKEN_DETECTION_V2 + ? tokensController.addDetectedTokens.bind(tokensController) + : null, + importTokens: process.env.TOKEN_DETECTION_V2 + ? tokensController.importTokens.bind(tokensController) + : null, + ignoreTokens: process.env.TOKEN_DETECTION_V2 + ? tokensController.ignoreTokens.bind(tokensController) + : null, + getBalancesInSingleCall: process.env.TOKEN_DETECTION_V2 + ? assetsContractController.getBalancesInSingleCall.bind( + assetsContractController, + ) + : null, }; } @@ -2053,68 +1975,6 @@ export default class MetamaskController extends EventEmitter { } } - async requestUserApproval(customRpc, originIsMetaMask) { - try { - await this.approvalController.addAndShowApprovalRequest({ - origin: 'metamask', - type: 'wallet_addEthereumChain', - requestData: { - chainId: customRpc.chainId, - blockExplorerUrl: customRpc.rpcPrefs.blockExplorerUrl, - chainName: customRpc.nickname, - rpcUrl: customRpc.rpcUrl, - ticker: customRpc.ticker, - imageUrl: customRpc.rpcPrefs.imageUrl, - }, - }); - } catch (error) { - if ( - !(originIsMetaMask && error.message === 'User rejected the request.') - ) { - throw error; - } - } - } - - async addCustomNetwork(customRpc) { - const { chainId, chainName, rpcUrl, ticker, blockExplorerUrl } = customRpc; - - await this.preferencesController.addToFrequentRpcList( - rpcUrl, - chainId, - ticker, - chainName, - { - blockExplorerUrl, - }, - ); - - let rpcUrlOrigin; - try { - rpcUrlOrigin = new URL(rpcUrl).origin; - } catch { - // ignore - } - this.metaMetricsController.trackEvent({ - event: 'Custom Network Added', - category: EVENT.CATEGORIES.NETWORK, - referrer: { - url: rpcUrlOrigin, - }, - properties: { - chain_id: chainId, - network_name: chainName, - network: rpcUrlOrigin, - symbol: ticker, - block_explorer_url: blockExplorerUrl, - source: EVENT.SOURCE.NETWORK.POPULAR_NETWORK_LIST, - }, - sensitiveProperties: { - rpc_url: rpcUrlOrigin, - }, - }); - } - /** * Create a new Vault and restore an existent keyring. * @@ -2184,7 +2044,7 @@ export default class MetamaskController extends EventEmitter { // This must be set as soon as possible to communicate to the // keyring's iframe and have the setting initialized properly - // Optimistically called to not block MetaMask login due to + // Optimistically called to not block Metamask login due to // Ledger Keyring GitHub downtime const transportPreference = this.preferencesController.getLedgerTransportPreference(); this.setLedgerTransportPreference(transportPreference); @@ -2356,7 +2216,7 @@ export default class MetamaskController extends EventEmitter { // This must be set as soon as possible to communicate to the // keyring's iframe and have the setting initialized properly - // Optimistically called to not block MetaMask login due to + // Optimistically called to not block Metamask login due to // Ledger Keyring GitHub downtime const transportPreference = this.preferencesController.getLedgerTransportPreference(); @@ -2762,14 +2622,8 @@ export default class MetamaskController extends EventEmitter { // Remove account from the account tracker controller this.accountTracker.removeAccount([address]); - const keyring = await this.keyringController.getKeyringForAccount(address); // Remove account from the keyring await this.keyringController.removeAccount(address); - const updatedKeyringAccounts = keyring ? await keyring.getAccounts() : {}; - if (updatedKeyringAccounts?.length === 0) { - keyring.destroy?.(); - } - return address; } @@ -3366,13 +3220,9 @@ export default class MetamaskController extends EventEmitter { if (sender.url) { const { hostname } = new URL(sender.url); // Check if new connection is blocked if phishing detection is on - const phishingTestResponse = this.phishingController.test(hostname); - if (usePhishDetect && phishingTestResponse?.result) { - this.sendPhishingWarning( - connectionStream, - hostname, - phishingTestResponse, - ); + if (usePhishDetect && this.phishingController.test(hostname)) { + log.debug('MetaMask - sending phishing warning for', hostname); + this.sendPhishingWarning(connectionStream, hostname); return; } } @@ -3415,33 +3265,6 @@ export default class MetamaskController extends EventEmitter { ); } - /** - * Used to create a multiplexed stream for connecting to the phishing warning page. - * - * @param options - Options bag. - * @param {ReadableStream} options.connectionStream - The Duplex stream to connect to. - */ - setupPhishingCommunication({ connectionStream }) { - const { usePhishDetect } = this.preferencesController.store.getState(); - - if (!usePhishDetect) { - return; - } - - // setup multiplexing - const mux = setupMultiplex(connectionStream); - const phishingStream = mux.createStream(PHISHING_SAFELIST); - - // set up postStream transport - phishingStream.on( - 'data', - createMetaRPCHandler( - { safelistPhishingDomain: this.safelistPhishingDomain.bind(this) }, - phishingStream, - ), - ); - } - /** * Called when we detect a suspicious domain. Requests the browser redirects * to our anti-phishing page. @@ -3450,15 +3273,11 @@ export default class MetamaskController extends EventEmitter { * @param {*} connectionStream - The duplex stream to the per-page script, * for sending the reload attempt to. * @param {string} hostname - The hostname that triggered the suspicion. - * @param {object} phishingTestResponse - Result of calling `phishingController.test`, - * which is the result of calling eth-phishing-detects detector.check method https://github.com/MetaMask/eth-phishing-detect/blob/master/src/detector.js#L55-L112 */ - sendPhishingWarning(connectionStream, hostname, phishingTestResponse) { - const newIssueUrl = PHISHING_NEW_ISSUE_URLS[phishingTestResponse?.name]; - + sendPhishingWarning(connectionStream, hostname) { const mux = setupMultiplex(connectionStream); const phishingStream = mux.createStream('phishing'); - phishingStream.write({ hostname, newIssueUrl }); + phishingStream.write({ hostname }); } /** @@ -3558,6 +3377,17 @@ export default class MetamaskController extends EventEmitter { } ///: BEGIN:ONLY_INCLUDE_IN(flask) + /** + * For snaps running in workers. + * + * @param snapId + * @param error + */ + onExecutionEnvironmentError(snapId, error) { + this.snapController.stopPlugin(snapId); + this.snapController.addSnapError(error); + } + /** * For snaps running in workers. * @@ -3699,9 +3529,6 @@ export default class MetamaskController extends EventEmitter { getCurrentChainId: this.networkController.getCurrentChainId.bind( this.networkController, ), - getCurrentRpcUrl: this.networkController.getCurrentRpcUrl.bind( - this.networkController, - ), setProviderType: this.networkController.setProviderType.bind( this.networkController, ), diff --git a/app/scripts/metamask-controller.test.js b/app/scripts/metamask-controller.test.js index c0e1a08b92b1..6baf1b113de9 100644 --- a/app/scripts/metamask-controller.test.js +++ b/app/scripts/metamask-controller.test.js @@ -18,8 +18,6 @@ import { addHexPrefix } from './lib/util'; const Ganache = require('../../test/e2e/ganache'); -const NOTIFICATION_ID = 'NHL8f2eSSTn9TKBamRLiU'; - const firstTimeState = { config: {}, NetworkController: { @@ -34,17 +32,6 @@ const firstTimeState = { }, }, }, - NotificationController: { - notifications: { - [NOTIFICATION_ID]: { - id: NOTIFICATION_ID, - origin: 'local:http://localhost:8086/', - createdDate: 1652967897732, - readDate: null, - message: 'Hello, http://localhost:8086!', - }, - }, - }, }; const ganacheServer = new Ganache(); @@ -782,20 +769,12 @@ describe('MetaMaskController', function () { describe('#removeAccount', function () { let ret; const addressToRemove = '0x1'; - let mockKeyring; beforeEach(async function () { - mockKeyring = { - getAccounts: sinon.stub().returns(Promise.resolve([])), - destroy: sinon.stub(), - }; sinon.stub(metamaskController.preferencesController, 'removeAddress'); sinon.stub(metamaskController.accountTracker, 'removeAccount'); sinon.stub(metamaskController.keyringController, 'removeAccount'); sinon.stub(metamaskController, 'removeAllAccountPermissions'); - sinon - .stub(metamaskController.keyringController, 'getKeyringForAccount') - .returns(Promise.resolve(mockKeyring)); ret = await metamaskController.removeAccount(addressToRemove); }); @@ -805,9 +784,6 @@ describe('MetaMaskController', function () { metamaskController.accountTracker.removeAccount.restore(); metamaskController.preferencesController.removeAddress.restore(); metamaskController.removeAllAccountPermissions.restore(); - - mockKeyring.getAccounts.resetHistory(); - mockKeyring.destroy.resetHistory(); }); it('should call preferencesController.removeAddress', async function () { @@ -841,16 +817,6 @@ describe('MetaMaskController', function () { it('should return address', async function () { assert.equal(ret, '0x1'); }); - it('should call keyringController.getKeyringForAccount', async function () { - assert( - metamaskController.keyringController.getKeyringForAccount.calledWith( - addressToRemove, - ), - ); - }); - it('should call keyring.destroy', async function () { - assert(mockKeyring.destroy.calledOnce); - }); }); describe('#newUnsignedMessage', function () { @@ -1246,27 +1212,6 @@ describe('MetaMaskController', function () { assert.deepEqual(metamaskController.getState(), oldState); }); }); - - describe('markNotificationsAsRead', function () { - it('marks the notification as read', function () { - metamaskController.markNotificationsAsRead([NOTIFICATION_ID]); - const readNotification = metamaskController.getState().notifications[ - NOTIFICATION_ID - ]; - assert.notEqual(readNotification.readDate, null); - }); - }); - - describe('dismissNotifications', function () { - it('deletes the notification from state', function () { - metamaskController.dismissNotifications([NOTIFICATION_ID]); - const state = metamaskController.getState().notifications; - assert.ok( - !Object.values(state).includes(NOTIFICATION_ID), - 'Object should not include the deleted notification', - ); - }); - }); }); function deferredPromise() { diff --git a/app/scripts/migrations/072.js b/app/scripts/migrations/072.js deleted file mode 100644 index 4e5e8aebfb8c..000000000000 --- a/app/scripts/migrations/072.js +++ /dev/null @@ -1,30 +0,0 @@ -import { cloneDeep } from 'lodash'; - -const version = 72; - -/** - * Should empty the `knownMethodData` object in PreferencesController - */ -export default { - version, - async migrate(originalVersionedData) { - const versionedData = cloneDeep(originalVersionedData); - versionedData.meta.version = version; - const state = versionedData.data; - const newState = transformState(state); - versionedData.data = newState; - return versionedData; - }, -}; - -function transformState(state) { - const PreferencesController = state?.PreferencesController || {}; - - return { - ...state, - PreferencesController: { - ...PreferencesController, - knownMethodData: {}, - }, - }; -} diff --git a/app/scripts/migrations/072.test.js b/app/scripts/migrations/072.test.js deleted file mode 100644 index 70fedab84c82..000000000000 --- a/app/scripts/migrations/072.test.js +++ /dev/null @@ -1,427 +0,0 @@ -import migration72 from './072'; - -describe('migration #72', () => { - it('should update the version metadata', async () => { - const oldStorage = { - meta: { - version: 71, - }, - data: {}, - }; - - const newStorage = await migration72.migrate(oldStorage); - expect(newStorage.meta).toStrictEqual({ - version: 72, - }); - }); - - it('should empty knownMethodData object in PreferencesController', async () => { - const oldStorage = { - meta: { - version: 71, - }, - data: { - PreferencesController: { - knownMethodData: { - '0x095ea7b3': { - name: 'Approve', - params: [ - { - type: 'address', - }, - { - type: 'uint256', - }, - ], - }, - '0x1249c58b': { - name: 'Mint', - params: [], - }, - '0x1688f0b9': { - name: 'Create Proxy With Nonce', - params: [ - { - type: 'address', - }, - { - type: 'bytes', - }, - { - type: 'uint256', - }, - ], - }, - '0x18cbafe5': { - name: 'Swap Exact Tokens For E T H', - params: [ - { - type: 'uint256', - }, - { - type: 'uint256', - }, - { - type: 'address[]', - }, - { - type: 'address', - }, - { - type: 'uint256', - }, - ], - }, - '0x23b872dd': { - name: 'Transfer From', - params: [ - { - type: 'address', - }, - { - type: 'address', - }, - { - type: 'uint256', - }, - ], - }, - '0x2e1a7d4d': { - name: 'Withdraw', - params: [ - { - type: 'uint256', - }, - ], - }, - '0x2e7ba6ef': { - name: 'Claim', - params: [ - { - type: 'uint256', - }, - { - type: 'address', - }, - { - type: 'uint256', - }, - { - type: 'bytes32[]', - }, - ], - }, - '0x2eb2c2d6': { - name: 'Safe Batch Transfer From', - params: [ - { - type: 'address', - }, - { - type: 'address', - }, - { - type: 'uint256[]', - }, - { - type: 'uint256[]', - }, - { - type: 'bytes', - }, - ], - }, - '0x3671f8cf': {}, - '0x41441d3b': { - name: 'Enter Staking', - params: [ - { - type: 'uint256', - }, - ], - }, - '0x441a3e70': { - name: 'Withdraw', - params: [ - { - type: 'uint256', - }, - { - type: 'uint256', - }, - ], - }, - '0x6f652e1a': { - name: 'Create Order', - params: [ - { - type: 'address', - }, - { - type: 'uint256', - }, - { - type: 'uint256', - }, - { - type: 'uint256', - }, - ], - }, - '0x8dbdbe6d': { - name: 'Deposit', - params: [ - { - type: 'uint256', - }, - { - type: 'uint256', - }, - { - type: 'address', - }, - ], - }, - '0x8ed955b9': { - name: 'Harvest All', - params: [], - }, - '0xa22cb465': { - name: 'Set Approval For All', - params: [ - { - type: 'address', - }, - { - type: 'bool', - }, - ], - }, - '0xa9059cbb': { - name: 'Transfer', - params: [ - { - type: 'address', - }, - { - type: 'uint256', - }, - ], - }, - '0xab834bab': { - name: 'Atomic Match_', - params: [ - { - type: 'address[14]', - }, - { - type: 'uint256[18]', - }, - { - type: 'uint8[8]', - }, - { - type: 'bytes', - }, - { - type: 'bytes', - }, - { - type: 'bytes', - }, - { - type: 'bytes', - }, - { - type: 'bytes', - }, - { - type: 'bytes', - }, - { - type: 'uint8[2]', - }, - { - type: 'bytes32[5]', - }, - ], - }, - '0xd0e30db0': { - name: 'Deposit', - params: [], - }, - '0xddd81f82': { - name: 'Register Proxy', - params: [], - }, - '0xded9382a': { - name: 'Remove Liquidity E T H With Permit', - params: [ - { - type: 'address', - }, - { - type: 'uint256', - }, - { - type: 'uint256', - }, - { - type: 'uint256', - }, - { - type: 'address', - }, - { - type: 'uint256', - }, - { - type: 'bool', - }, - { - type: 'uint8', - }, - { - type: 'bytes32', - }, - { - type: 'bytes32', - }, - ], - }, - '0xe2bbb158': { - name: 'Deposit', - params: [ - { - type: 'uint256', - }, - { - type: 'uint256', - }, - ], - }, - '0xf305d719': { - name: 'Add Liquidity E T H', - params: [ - { - type: 'address', - }, - { - type: 'uint256', - }, - { - type: 'uint256', - }, - { - type: 'uint256', - }, - { - type: 'address', - }, - { - type: 'uint256', - }, - ], - }, - }, - }, - }, - }; - - const newStorage = await migration72.migrate(oldStorage); - expect(newStorage).toStrictEqual({ - meta: { - version: 72, - }, - data: { - PreferencesController: { - knownMethodData: {}, - }, - }, - }); - }); - - it('should preserve other PreferencesController state', async () => { - const oldStorage = { - meta: { - version: 71, - }, - data: { - PreferencesController: { - currentLocale: 'en', - dismissSeedBackUpReminder: false, - ipfsGateway: 'dweb.link', - knownMethodData: { - '0xd0e30db0': { - name: 'Deposit', - params: [], - }, - '0xddd81f82': { - name: 'Register Proxy', - params: [], - }, - }, - openSeaEnabled: false, - useTokenDetection: false, - }, - }, - }; - - const newStorage = await migration72.migrate(oldStorage); - expect(newStorage).toStrictEqual({ - meta: { - version: 72, - }, - data: { - PreferencesController: { - currentLocale: 'en', - dismissSeedBackUpReminder: false, - ipfsGateway: 'dweb.link', - knownMethodData: {}, - openSeaEnabled: false, - useTokenDetection: false, - }, - }, - }); - }); - - it('should not change state in controllers other than PreferencesController', async () => { - const oldStorage = { - meta: { - version: 71, - }, - data: { - PreferencesController: { - knownMethodData: { - '0xd0e30db0': { - name: 'Deposit', - params: [], - }, - '0xddd81f82': { - name: 'Register Proxy', - params: [], - }, - }, - }, - data: { - FooController: { a: 'b' }, - }, - }, - }; - - const newStorage = await migration72.migrate(oldStorage); - expect(newStorage).toStrictEqual({ - meta: { - version: 72, - }, - data: { - PreferencesController: { - knownMethodData: {}, - }, - data: { - FooController: { a: 'b' }, - }, - }, - }); - }); -}); diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index b2a52040dfca..321b9131951f 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -75,7 +75,6 @@ import m068 from './068'; import m069 from './069'; import m070 from './070'; import m071 from './071'; -import m072 from './072'; const migrations = [ m002, @@ -148,7 +147,6 @@ const migrations = [ m069, m070, m071, - m072, ]; export default migrations; diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js new file mode 100644 index 000000000000..68c30d50111e --- /dev/null +++ b/app/scripts/phishing-detect.js @@ -0,0 +1,40 @@ +import querystring from 'querystring'; +import PortStream from 'extension-port-stream'; +import browser from 'webextension-polyfill'; +import createRandomId from '../../shared/modules/random-id'; +import { setupMultiplex } from './lib/stream-utils'; +import { getEnvironmentType } from './lib/util'; +import ExtensionPlatform from './platforms/extension'; + +document.addEventListener('DOMContentLoaded', start); + +function start() { + const hash = window.location.hash.substring(1); + const suspect = querystring.parse(hash); + + const newIssueLink = document.getElementById('new-issue-link'); + const newIssueUrl = `https://github.com/MetaMask/eth-phishing-detect/issues/new`; + const newIssueParams = `?title=[Legitimate%20Site%20Blocked]%20${encodeURIComponent( + suspect.hostname, + )}&body=${encodeURIComponent(suspect.href)}`; + newIssueLink.href = `${newIssueUrl}${newIssueParams}`; + + global.platform = new ExtensionPlatform(); + + const extensionPort = browser.runtime.connect({ + name: getEnvironmentType(), + }); + const connectionStream = new PortStream(extensionPort); + const mx = setupMultiplex(connectionStream); + const backgroundConnection = mx.createStream('controller'); + const continueLink = document.getElementById('unsafe-continue'); + continueLink.addEventListener('click', () => { + backgroundConnection.write({ + jsonrpc: '2.0', + method: 'safelistPhishingDomain', + params: [suspect.hostname], + id: createRandomId(), + }); + window.location.href = suspect.href; + }); +} diff --git a/app/scripts/ui.js b/app/scripts/ui.js index 93f06143d246..1c4a3fc1c311 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -16,9 +16,6 @@ import { ENVIRONMENT_TYPE_FULLSCREEN, ENVIRONMENT_TYPE_POPUP, } from '../../shared/constants/app'; -import { isManifestV3 } from '../../shared/modules/mv3.utils'; -import { SUPPORT_LINK } from '../../ui/helpers/constants/common'; -import { getErrorHtml } from '../../ui/helpers/utils/error-utils'; import ExtensionPlatform from './platforms/extension'; import { setupMultiplex } from './lib/stream-utils'; import { getEnvironmentType } from './lib/util'; @@ -27,21 +24,6 @@ import metaRPCClientFactory from './lib/metaRPCClientFactory'; start().catch(log.error); async function start() { - async function displayCriticalError(container, err, metamaskState) { - const html = await getErrorHtml(SUPPORT_LINK, metamaskState); - - container.innerHTML = html; - - const button = document.getElementById('critical-error-button'); - - button.addEventListener('click', (_) => { - browser.runtime.reload(); - }); - - log.error(err.stack); - throw err; - } - // create platform global global.platform = new ExtensionPlatform(); @@ -50,31 +32,24 @@ async function start() { // setup stream to background const extensionPort = browser.runtime.connect({ name: windowType }); - const connectionStream = new PortStream(extensionPort); const activeTab = await queryCurrentActiveTab(windowType); + initializeUiWithTab(activeTab); - /** - * In case of MV3 the issue of blank screen was very frequent, it is caused by UI initialising before background is ready to send state. - * Code below ensures that UI is rendered only after background is ready. - */ - if (isManifestV3()) { - extensionPort.onMessage.addListener((message) => { - if (message?.name === 'CONNECTION_READY') { - initializeUiWithTab(activeTab); - } - }); - } else { - initializeUiWithTab(activeTab); + function displayCriticalError(container, err) { + container.innerHTML = + '
The MetaMask app failed to load: please open and close MetaMask again to restart.
'; + container.style.height = '80px'; + log.error(err.stack); + throw err; } function initializeUiWithTab(tab) { const container = document.getElementById('app-content'); initializeUi(tab, container, connectionStream, (err, store) => { if (err) { - // if there's an error, store will be = metamaskState - displayCriticalError(container, err, store); + displayCriticalError(container, err); return; } @@ -115,7 +90,7 @@ async function queryCurrentActiveTab(windowType) { function initializeUi(activeTab, container, connectionStream, cb) { connectToAccountManager(connectionStream, (err, backgroundConnection) => { if (err) { - cb(err, null); + cb(err); return; } diff --git a/development/README.md b/development/README.md index d0c89081311c..16df8fb89342 100644 --- a/development/README.md +++ b/development/README.md @@ -54,24 +54,3 @@ To opt in to MetaMetrics; You can inspect the requests in the `Network` tab of your browser's Developer Tools (background.html) by filtering for `POST` requests to `/v1/batch`. The full url will be `http://localhost:9090/v1/batch` or `https://api.segment.io/v1/batch` respectively. - -## Sentry - -### Debugging in Sentry - -To debug in a production Sentry environment: - -- If you have not already got a Sentry account, you can create a free account on [Sentry](https://sentry.io/) -- Create a New Sentry Organization - - If you already have an existing Sentry account and workspace, open the sidebar drop down menu, then click `Switch organization` followed by `Create a new organization` -- Create a New Project -- Copy the `Public Key` and `Project ID` from the Client Keys section under your projects Settings - - Select `Settings` in the sidebar menu, then select `Projects` in the secondary menu. Click your project then select `Client Keys (DSN)` from the secondary menu. Click the `Configure` button on the `Client Keys` page and copy your `Project Id` and `Public Key` -- Add/replace the `SENTRY_DSN` and `SENTRY_DSN_DEV` variables in `.metamaskrc` - ``` - SENTRY_DSN_DEV=https://{SENTRY_PUBLIC_KEY}@sentry.io/{SENTRY_PROJECT_ID} - SENTRY_DSN=https://{SENTRY_PUBLIC_KEY}@sentry.io/{SENTRY_PROJECT_ID} - ``` -- Build the project to the `./dist/` folder with `yarn dist` - -Errors reported whilst using the extension will be displayed in Sentry's `Issues` page. diff --git a/development/build/README.md b/development/build/README.md index 9d5df1e149fc..85823992b807 100644 --- a/development/build/README.md +++ b/development/build/README.md @@ -26,4 +26,38 @@ Source file bundling tasks are implemented in the [`./development/build/scripts. ## Usage -See `node ./development/build/index.js --help` +```text +Usage: yarn build [options] + +Commands: + yarn build prod Create an optimized build for production environments. + + yarn build dev Create an unoptimized, live-reloaded build for local + development. + + yarn build test Create an optimized build for running e2e tests. + + yarn build testDev Create an unoptimized, live-reloaded build for running + e2e tests. + +Options: + --build-type The "type" of build to create. One of: "beta", "flask", + "main" + [string] [default: "main"] + --lint-fence-files Whether files with code fences should be linted after + fences have been removed by the code fencing transform. + The build will fail if linting fails. + Defaults to `false` if the entry task is `dev` or + `testDev`, and `true` otherwise. + [boolean] [default: ] + --lockdown Whether to include SES lockdown files in the extension + bundle. Setting this to `false` is useful e.g. when + linking dependencies that are incompatible with lockdown. + [boolean] [default: true] + --policy-only Stops the build after generating the LavaMoat policy, + skipping any writes to disk. + [boolean] [deafult: false] + --skip-stats Whether to refrain from logging build progress. Mostly + used internally. + [boolean] [default: false] +``` diff --git a/development/build/constants.js b/development/build/constants.js deleted file mode 100644 index 15b87e984029..000000000000 --- a/development/build/constants.js +++ /dev/null @@ -1,48 +0,0 @@ -const TASKS = { - CLEAN: 'clean', - DEV: 'dev', - LINT_SCSS: 'lint-scss', - MANIFEST_DEV: 'manifest:dev', - MANIFEST_PROD: 'manifest:prod', - MANIFEST_TEST: 'manifest:test', - MANIFEST_TEST_DEV: 'manifest:testDev', - PROD: 'prod', - RELOAD: 'reload', - SCRIPTS_PROD: 'scripts:prod', - SCRIPTS_CORE_DEV_STANDARD_ENTRY_POINTS: - 'scripts:core:dev:standardEntryPoints', - SCRIPTS_CORE_DEV_CONTENTSCRIPT: 'scripts:core:dev:contentscript', - SCRIPTS_CORE_DEV_DISABLE_CONSOLE: 'scripts:core:dev:disable-console', - SCRIPTS_CORE_DEV_SENTRY: 'scripts:core:dev:sentry', - SCRIPTS_CORE_DEV_PHISHING_DETECT: 'scripts:core:dev:phishing-detect', - SCRIPTS_CORE_PROD_STANDARD_ENTRY_POINTS: - 'scripts:core:prod:standardEntryPoints', - SCRIPTS_CORE_PROD_CONTENTSCRIPT: 'scripts:core:prod:contentscript', - SCRIPTS_CORE_PROD_DISABLE_CONSOLE: 'scripts:core:prod:disable-console', - SCRIPTS_CORE_PROD_SENTRY: 'scripts:core:prod:sentry', - SCRIPTS_CORE_PROD_PHISHING_DETECT: 'scripts:core:prod:phishing-detect', - SCRIPTS_CORE_TEST_LIVE_STANDARD_ENTRY_POINTS: - 'scripts:core:test-live:standardEntryPoints', - SCRIPTS_CORE_TEST_LIVE_CONTENTSCRIPT: 'scripts:core:test-live:contentscript', - SCRIPTS_CORE_TEST_LIVE_DISABLE_CONSOLE: - 'scripts:core:test-live:disable-console', - SCRIPTS_CORE_TEST_LIVE_SENTRY: 'scripts:core:test-live:sentry', - SCRIPTS_CORE_TEST_LIVE_PHISHING_DETECT: - 'scripts:core:test-live:phishing-detect', - SCRIPTS_CORE_TEST_STANDARD_ENTRY_POINTS: - 'scripts:core:test:standardEntryPoints', - SCRIPTS_CORE_TEST_CONTENTSCRIPT: 'scripts:core:test:contentscript', - SCRIPTS_CORE_TEST_DISABLE_CONSOLE: 'scripts:core:test:disable-console', - SCRIPTS_CORE_TEST_SENTRY: 'scripts:core:test:sentry', - SCRIPTS_CORE_TEST_PHISHING_DETECT: 'scripts:core:test:phishing-detect', - STATIC_DEV: 'static:dev', - STATIC_PROD: 'static:prod', - STYLES: 'styles', - STYLES_DEV: 'styles:dev', - STYLES_PROD: 'styles:prod', - TEST: 'test', - TEST_DEV: 'testDev', - ZIP: 'zip', -}; - -module.exports = { TASKS }; diff --git a/development/build/etc.js b/development/build/etc.js index 3da86409f25b..e6d06c84d24c 100644 --- a/development/build/etc.js +++ b/development/build/etc.js @@ -7,13 +7,12 @@ const pify = require('pify'); const pump = pify(require('pump')); const { BuildType } = require('../lib/build-type'); -const { TASKS } = require('./constants'); const { createTask, composeParallel } = require('./task'); module.exports = createEtcTasks; function createEtcTasks({ browserPlatforms, buildType, livereload, version }) { - const clean = createTask(TASKS.CLEAN, async function clean() { + const clean = createTask('clean', async function clean() { await del(['./dist/*']); await Promise.all( browserPlatforms.map(async (platform) => { @@ -22,13 +21,13 @@ function createEtcTasks({ browserPlatforms, buildType, livereload, version }) { ); }); - const reload = createTask(TASKS.RELOAD, function devReload() { + const reload = createTask('reload', function devReload() { livereload.listen({ port: 35729 }); }); // zip tasks for distribution const zip = createTask( - TASKS.ZIP, + 'zip', composeParallel( ...browserPlatforms.map((platform) => createZipTask(platform, buildType, version), @@ -49,10 +48,7 @@ function createZipTask(platform, buildType, version) { gulp.src(`dist/${platform}/**`), // sort files and set `mtime` to epoch to ensure zip build is deterministic sort(), - // Modified time set to an arbitrary static date to ensure build the is reproducible. - // The date chosen is MetaMask's birthday. Originally we chose the Unix epoch, but this - // resulted in invalid dates on certain timezones/operating systems. - gulpZip(`${path}.zip`, { modifiedTime: new Date('2016-07-14T00:00:00') }), + gulpZip(`${path}.zip`, { modifiedTime: new Date(0) }), gulp.dest('builds'), ); }; diff --git a/development/build/index.js b/development/build/index.js index d9924f86bc47..fd6dd1b7662c 100755 --- a/development/build/index.js +++ b/development/build/index.js @@ -5,12 +5,10 @@ // const path = require('path'); const livereload = require('gulp-livereload'); -const yargs = require('yargs/yargs'); -const { hideBin } = require('yargs/helpers'); +const minimist = require('minimist'); const { sync: globby } = require('globby'); const { getVersion } = require('../lib/get-version'); const { BuildType } = require('../lib/build-type'); -const { TASKS } = require('./constants'); const { createTask, composeSeries, @@ -112,7 +110,7 @@ function defineAndRunBuildTasks() { // build for development (livereload) createTask( - TASKS.DEV, + 'dev', composeSeries( clean, styleTasks.dev, @@ -127,7 +125,7 @@ function defineAndRunBuildTasks() { // build for test development (livereload) createTask( - TASKS.TEST_DEV, + 'testDev', composeSeries( clean, styleTasks.dev, @@ -142,7 +140,7 @@ function defineAndRunBuildTasks() { // build for prod release createTask( - TASKS.PROD, + 'prod', composeSeries( clean, styleTasks.prod, @@ -152,11 +150,11 @@ function defineAndRunBuildTasks() { ); // build just production scripts, for LavaMoat policy generation purposes - createTask(TASKS.SCRIPTS_PROD, scriptTasks.prod); + createTask('scripts:prod', scriptTasks.prod); // build for CI testing createTask( - TASKS.TEST, + 'test', composeSeries( clean, styleTasks.prod, @@ -166,108 +164,89 @@ function defineAndRunBuildTasks() { ); // special build for minimal CI testing - createTask(TASKS.styles, styleTasks.prod); + createTask('styles', styleTasks.prod); // Finally, start the build process by running the entry task. runTask(entryTask, { skipStats }); } function parseArgv() { - const { argv } = yargs(hideBin(process.argv)) - .usage('$0 [options]', 'Build the MetaMask extension.', (_yargs) => - _yargs - .positional('task', { - description: `The task to run. There are a number of main tasks, each of which calls other tasks internally. The main tasks are: + const NamedArgs = { + ApplyLavaMoat: 'apply-lavamoat', + BuildType: 'build-type', + BuildVersion: 'build-version', + LintFenceFiles: 'lint-fence-files', + Lockdown: 'lockdown', + PolicyOnly: 'policy-only', + SkipStats: 'skip-stats', + }; -prod: Create an optimized build for a production environment. + const argv = minimist(process.argv.slice(2), { + boolean: [ + NamedArgs.ApplyLavaMoat, + NamedArgs.LintFenceFiles, + NamedArgs.Lockdown, + NamedArgs.PolicyOnly, + NamedArgs.SkipStats, + ], + string: [NamedArgs.BuildType, NamedArgs.BuildVersion], + default: { + [NamedArgs.ApplyLavaMoat]: true, + [NamedArgs.BuildType]: BuildType.main, + [NamedArgs.BuildVersion]: '0', + [NamedArgs.LintFenceFiles]: true, + [NamedArgs.Lockdown]: true, + [NamedArgs.PolicyOnly]: false, + [NamedArgs.SkipStats]: false, + }, + }); -dev: Create an unoptimized, live-reloading build for local development. + if (argv._.length !== 1) { + throw new Error( + `Metamask build: Expected a single positional argument, but received "${argv._.length}" arguments.`, + ); + } -test: Create an optimized build for running e2e tests. + const entryTask = argv._[0]; + if (!entryTask) { + throw new Error('MetaMask build: No entry task specified.'); + } -testDev: Create an unoptimized, live-reloading build for debugging e2e tests.`, - type: 'string', - }) - .option('apply-lavamoat', { - default: true, - description: - 'Whether to use LavaMoat. Setting this to `false` can be useful during development if you want to handle LavaMoat errors later.', - type: 'boolean', - }) - .option('build-type', { - default: BuildType.main, - description: 'The type of build to create.', - choices: Object.keys(BuildType), - }) - .option('build-version', { - default: 0, - description: - 'The build version. This is set only for non-main build types. The build version is used in the "prerelease" segment of the extension version, e.g. `[major].[minor].[patch]-[build-type].[build-version]`', - type: 'number', - }) - .option('lint-fence-files', { - description: - 'Whether files with code fences should be linted after fences have been removed. The build will fail if linting fails. This defaults to `false` if the entry task is `dev` or `testDev`. Otherwise this defaults to `true`.', - type: 'boolean', - }) - .option('lockdown', { - default: true, - description: - 'Whether to include SES lockdown files in the extension bundle. Setting this to `false` can be useful during development if you want to handle lockdown errors later.', - type: 'boolean', - }) - .option('policy-only', { - default: false, - description: - 'Stop the build after generating the LavaMoat policy, skipping any writes to disk other than the LavaMoat policy itself.', - type: 'boolean', - }) - .option('skip-stats', { - default: false, - description: - 'Whether to skip logging the time to completion for each task to the console. This is meant primarily for internal use, to prevent duplicate logging.', - hidden: true, - type: 'boolean', - }) - .check((args) => { - if (!Number.isInteger(args.buildVersion)) { - throw new Error( - `Expected integer for 'build-version', got '${args.buildVersion}'`, - ); - } else if (!Object.values(TASKS).includes(args.task)) { - throw new Error(`Invalid task: '${args.task}'`); - } - return true; - }), - ) - // TODO: Enable `.strict()` after this issue is resolved: https://github.com/LavaMoat/LavaMoat/issues/344 - .help('help'); + const buildType = argv[NamedArgs.BuildType]; + if (!(buildType in BuildType)) { + throw new Error(`MetaMask build: Invalid build type: "${buildType}"`); + } - const { - applyLavamoat: applyLavaMoat, - buildType, - buildVersion, - lintFenceFiles, - lockdown, - policyOnly, - skipStats, - task, - } = argv; + const rawBuildVersion = argv[NamedArgs.BuildVersion]; + const buildVersion = Number.parseInt(rawBuildVersion, 10); + if (rawBuildVersion.match(/^\d+$/u) === null || Number.isNaN(buildVersion)) { + throw new Error( + `MetaMask build: Invalid build version: "${rawBuildVersion}"`, + ); + } // Manually default this to `false` for dev builds only. - const shouldLintFenceFiles = lintFenceFiles ?? !/dev/iu.test(task); + const shouldLintFenceFiles = process.argv.includes( + `--${NamedArgs.LintFenceFiles}`, + ) + ? argv[NamedArgs.LintFenceFiles] + : !/dev/iu.test(entryTask); + + const policyOnly = argv[NamedArgs.PolicyOnly]; const version = getVersion(buildType, buildVersion); return { - applyLavaMoat, + // Should we apply LavaMoat to the build output? + applyLavaMoat: argv[NamedArgs.ApplyLavaMoat], buildType, - entryTask: task, + entryTask, + // Is this process running in lavamoat-node? isLavaMoat: process.argv[0].includes('lavamoat'), policyOnly, - shouldIncludeLockdown: lockdown, + shouldIncludeLockdown: argv[NamedArgs.Lockdown], shouldLintFenceFiles, - skipStats, + skipStats: argv[NamedArgs.SkipStats], version, }; } diff --git a/development/build/manifest.js b/development/build/manifest.js index fb6a4092b14b..498ab2785b6d 100644 --- a/development/build/manifest.js +++ b/development/build/manifest.js @@ -2,12 +2,9 @@ const { promises: fs } = require('fs'); const path = require('path'); const { mergeWith, cloneDeep } = require('lodash'); -const baseManifest = process.env.ENABLE_MV3 - ? require('../../app/manifest/v3/_base.json') - : require('../../app/manifest/v2/_base.json'); +const baseManifest = require('../../app/manifest/_base.json'); const { BuildType } = require('../lib/build-type'); -const { TASKS } = require('./constants'); const { createTask, composeSeries } = require('./task'); module.exports = createManifestTasks; @@ -27,7 +24,7 @@ function createManifestTasks({ '..', '..', 'app', - process.env.ENABLE_MV3 ? 'manifest/v3' : 'manifest/v2', + 'manifest', `${platform}.json`, ), ); @@ -69,22 +66,19 @@ function createManifestTasks({ }); // high level manifest tasks - const dev = createTask( - TASKS.MANIFEST_DEV, - composeSeries(prepPlatforms, envDev), - ); + const dev = createTask('manifest:dev', composeSeries(prepPlatforms, envDev)); const testDev = createTask( - TASKS.MANIFEST_TEST_DEV, + 'manifest:testDev', composeSeries(prepPlatforms, envTestDev), ); const test = createTask( - TASKS.MANIFEST_TEST, + 'manifest:test', composeSeries(prepPlatforms, envTest), ); - const prod = createTask(TASKS.MANIFEST_PROD, prepPlatforms); + const prod = createTask('manifest:prod', prepPlatforms); return { prod, dev, testDev, test }; diff --git a/development/build/scripts.js b/development/build/scripts.js index 85deff7d3f28..1447b3d79a61 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -34,7 +34,6 @@ const metamaskrc = require('rc')('metamask', { INFURA_PROD_PROJECT_ID: process.env.INFURA_PROD_PROJECT_ID, ONBOARDING_V2: process.env.ONBOARDING_V2, COLLECTIBLES_V1: process.env.COLLECTIBLES_V1, - PHISHING_WARNING_PAGE_URL: process.env.PHISHING_WARNING_PAGE_URL, TOKEN_DETECTION_V2: process.env.TOKEN_DETECTION_V2, SEGMENT_HOST: process.env.SEGMENT_HOST, SEGMENT_WRITE_KEY: process.env.SEGMENT_WRITE_KEY, @@ -134,48 +133,6 @@ function getSegmentWriteKey({ buildType, environment }) { throw new Error(`Invalid build type: '${buildType}'`); } -/** - * Get the URL for the phishing warning page, if it has been set. - * - * @param {object} options - The phishing warning page options. - * @param {boolean} options.testing - Whether this is a test build or not. - * @returns {string} The URL for the phishing warning page, or `undefined` if no URL is set. - */ -function getPhishingWarningPageUrl({ testing }) { - let phishingWarningPageUrl = metamaskrc.PHISHING_WARNING_PAGE_URL; - - if (!phishingWarningPageUrl) { - phishingWarningPageUrl = testing - ? 'http://localhost:9999/' - : 'https://metamask.github.io/phishing-warning/v1.1.0/'; - } - - // We add a hash/fragment to the URL dynamically, so we need to ensure it - // has a valid pathname to append a hash to. - const normalizedUrl = phishingWarningPageUrl.endsWith('/') - ? phishingWarningPageUrl - : `${phishingWarningPageUrl}/`; - - let phishingWarningPageUrlObject; - try { - // eslint-disable-next-line no-new - phishingWarningPageUrlObject = new URL(normalizedUrl); - } catch (error) { - throw new Error( - `Invalid phishing warning page URL: '${normalizedUrl}'`, - error, - ); - } - if (phishingWarningPageUrlObject.hash) { - // The URL fragment must be set dynamically - throw new Error( - `URL fragment not allowed in phishing warning page URL: '${normalizedUrl}'`, - ); - } - - return normalizedUrl; -} - const noopWriteStream = through.obj((_file, _fileEncoding, callback) => callback(), ); @@ -196,22 +153,22 @@ function createScriptTasks({ // internal tasks const core = { // dev tasks (live reload) - dev: createTasksForScriptBundles({ + dev: createTasksForBuildJsExtension({ taskPrefix: 'scripts:core:dev', devMode: true, }), - testDev: createTasksForScriptBundles({ + testDev: createTasksForBuildJsExtension({ taskPrefix: 'scripts:core:test-live', devMode: true, testing: true, }), // built for CI tests - test: createTasksForScriptBundles({ + test: createTasksForBuildJsExtension({ taskPrefix: 'scripts:core:test', testing: true, }), // production - prod: createTasksForScriptBundles({ taskPrefix: 'scripts:core:prod' }), + prod: createTasksForBuildJsExtension({ taskPrefix: 'scripts:core:prod' }), }; // high level tasks @@ -219,11 +176,7 @@ function createScriptTasks({ const { dev, test, testDev, prod } = core; return { dev, test, testDev, prod }; - function createTasksForScriptBundles({ - taskPrefix, - devMode = false, - testing = false, - }) { + function createTasksForBuildJsExtension({ taskPrefix, devMode, testing }) { const standardEntryPoints = ['background', 'ui', 'content-script']; const standardSubtask = createTask( `${taskPrefix}:standardEntryPoints`, @@ -250,19 +203,24 @@ function createScriptTasks({ // because inpage bundle result is included inside contentscript const contentscriptSubtask = createTask( `${taskPrefix}:contentscript`, - createContentscriptBundle({ devMode, testing }), + createTaskForBundleContentscript({ devMode, testing }), ); // this can run whenever const disableConsoleSubtask = createTask( `${taskPrefix}:disable-console`, - createDisableConsoleBundle({ devMode, testing }), + createTaskForBundleDisableConsole({ devMode, testing }), ); // this can run whenever const installSentrySubtask = createTask( `${taskPrefix}:sentry`, - createSentryBundle({ devMode, testing }), + createTaskForBundleSentry({ devMode, testing }), + ); + + const phishingDetectSubtask = createTask( + `${taskPrefix}:phishing-detect`, + createTaskForBundlePhishingDetect({ devMode, testing }), ); // task for initiating browser livereload @@ -287,6 +245,7 @@ function createScriptTasks({ contentscriptSubtask, disableConsoleSubtask, installSentrySubtask, + phishingDetectSubtask, ].map((subtask) => runInChildProcess(subtask, { applyLavaMoat, @@ -300,7 +259,7 @@ function createScriptTasks({ return composeParallel(initiateLiveReload, ...allSubtasks); } - function createDisableConsoleBundle({ devMode, testing }) { + function createTaskForBundleDisableConsole({ devMode, testing }) { const label = 'disable-console'; return createNormalBundle({ browserPlatforms, @@ -317,7 +276,7 @@ function createScriptTasks({ }); } - function createSentryBundle({ devMode, testing }) { + function createTaskForBundleSentry({ devMode, testing }) { const label = 'sentry-install'; return createNormalBundle({ browserPlatforms, @@ -334,8 +293,25 @@ function createScriptTasks({ }); } + function createTaskForBundlePhishingDetect({ devMode, testing }) { + const label = 'phishing-detect'; + return createNormalBundle({ + buildType, + browserPlatforms, + destFilepath: `${label}.js`, + devMode, + entryFilepath: `./app/scripts/${label}.js`, + ignoredFiles, + label, + testing, + policyOnly, + shouldLintFenceFiles, + version, + }); + } + // the "contentscript" bundle contains the "inpage" bundle - function createContentscriptBundle({ devMode, testing }) { + function createTaskForBundleContentscript({ devMode, testing }) { const inpage = 'inpage'; const contentscript = 'contentscript'; return composeSeries( @@ -369,102 +345,6 @@ function createScriptTasks({ } } -const postProcessServiceWorker = ( - mv3BrowserPlatforms, - fileList, - applyLavaMoat, - testing, -) => { - mv3BrowserPlatforms.forEach((browser) => { - const appInitFile = `./dist/${browser}/app-init.js`; - const fileContent = readFileSync('./app/scripts/app-init.js', 'utf8'); - let fileOutput = fileContent.replace('/** FILE NAMES */', fileList); - if (testing) { - fileOutput = fileOutput.replace('testMode = false', 'testMode = true'); - } else { - // Setting applyLavaMoat to true in testing mode - // This is to enable capturing initialisation time stats using e2e with lavamoat statsMode enabled - fileOutput = fileOutput.replace( - 'const applyLavaMoat = true;', - `const applyLavaMoat = ${applyLavaMoat};`, - ); - } - writeFileSync(appInitFile, fileOutput); - }); -}; - -// Function generates app-init.js for browsers chrome, brave and opera. -// It dynamically injects list of files generated in the build. -async function createManifestV3AppInitializationBundle({ - jsBundles, - browserPlatforms, - buildType, - devMode, - ignoredFiles, - testing, - policyOnly, - shouldLintFenceFiles, - applyLavaMoat, - version, -}) { - const label = 'app-init'; - // TODO: remove this filter for firefox once MV3 is supported in it - const mv3BrowserPlatforms = browserPlatforms.filter( - (platform) => platform !== 'firefox', - ); - const fileList = jsBundles.reduce( - (result, file) => `${result}'${file}',\n `, - '', - ); - - await createNormalBundle({ - browserPlatforms: mv3BrowserPlatforms, - buildType, - destFilepath: 'app-init.js', - devMode, - entryFilepath: './app/scripts/app-init.js', - ignoredFiles, - label, - testing, - policyOnly, - shouldLintFenceFiles, - version, - })(); - - postProcessServiceWorker( - mv3BrowserPlatforms, - fileList, - applyLavaMoat, - testing, - ); - - // If the application is running in development mode, we watch service worker file to - // in case the file is changes we need to process it again to replace "/** FILE NAMES */", "testMode" etc. - if (devMode && !testing) { - let prevChromeFileContent; - watch('./dist/chrome/app-init.js', () => { - const chromeFileContent = readFileSync( - './dist/chrome/app-init.js', - 'utf8', - ); - if (chromeFileContent !== prevChromeFileContent) { - prevChromeFileContent = chromeFileContent; - postProcessServiceWorker(mv3BrowserPlatforms, fileList, applyLavaMoat); - } - }); - } - - // Code below is used to set statsMode to true when testing in MV3 - // This is used to capture module initialisation stats using lavamoat. - if (testing) { - const content = readFileSync('./dist/chrome/runtime-lavamoat.js', 'utf8'); - const fileOutput = content.replace('statsMode = false', 'statsMode = true'); - writeFileSync('./dist/chrome/runtime-lavamoat.js', fileOutput); - } - - console.log(`Bundle end: service worker app-init.js`); -} - function createFactoredBuild({ applyLavaMoat, browserPlatforms, @@ -577,7 +457,7 @@ function createFactoredBuild({ }); // wait for bundle completion for postprocessing - events.on('bundleDone', async () => { + events.on('bundleDone', () => { // Skip HTML generation if nothing is to be written to disk if (policyOnly) { return; @@ -623,24 +503,6 @@ function createFactoredBuild({ browserPlatforms, applyLavaMoat, }); - if (process.env.ENABLE_MV3) { - const jsBundles = [ - ...commonSet.values(), - ...groupSet.values(), - ].map((label) => `./${label}.js`); - await createManifestV3AppInitializationBundle({ - jsBundles, - browserPlatforms, - buildType, - devMode, - ignoredFiles, - testing, - policyOnly, - shouldLintFenceFiles, - applyLavaMoat, - version, - }); - } break; } case 'content-script': { @@ -662,7 +524,7 @@ function createFactoredBuild({ } }); - await createBundle(buildConfiguration, { reloadOnChange }); + await bundleIt(buildConfiguration, { reloadOnChange }); }; } @@ -672,9 +534,11 @@ function createNormalBundle({ destFilepath, devMode, entryFilepath, + extraEntries = [], ignoredFiles, label, policyOnly, + modulesToExpose, shouldLintFenceFiles, testing, version, @@ -708,7 +572,14 @@ function createNormalBundle({ }); // set bundle entries - bundlerOpts.entries = [entryFilepath]; + bundlerOpts.entries = [...extraEntries]; + if (entryFilepath) { + bundlerOpts.entries.push(entryFilepath); + } + + if (modulesToExpose) { + bundlerOpts.require = bundlerOpts.require.concat(modulesToExpose); + } // instrument pipeline events.on('configurePipeline', ({ pipeline }) => { @@ -724,7 +595,7 @@ function createNormalBundle({ }); }); - await createBundle(buildConfiguration, { reloadOnChange }); + await bundleIt(buildConfiguration, { reloadOnChange }); }; } @@ -777,7 +648,7 @@ function setupBundlerDefaults( // Look for TypeScript files when walking the dependency tree extensions, // Use entryFilepath for moduleIds, easier to determine origin file - fullPaths: devMode || testing, + fullPaths: devMode, // For sourcemaps debug: true, }); @@ -879,7 +750,7 @@ function setupSourcemaps(buildConfiguration, { devMode }) { }); } -async function createBundle(buildConfiguration, { reloadOnChange }) { +async function bundleIt(buildConfiguration, { reloadOnChange }) { const { label, bundlerOpts, events } = buildConfiguration; const bundler = browserify(bundlerOpts); @@ -951,7 +822,6 @@ function getEnvironmentVariables({ buildType, devMode, testing, version }) { METAMASK_BUILD_TYPE: buildType, NODE_ENV: devMode ? ENVIRONMENT.DEVELOPMENT : ENVIRONMENT.PRODUCTION, IN_TEST: testing, - PHISHING_WARNING_PAGE_URL: getPhishingWarningPageUrl({ testing }), PUBNUB_SUB_KEY: process.env.PUBNUB_SUB_KEY || '', PUBNUB_PUB_KEY: process.env.PUBNUB_PUB_KEY || '', CONF: devMode ? metamaskrc : {}, diff --git a/development/build/static.js b/development/build/static.js index 7e3ccf02fadb..7efde5a72c7a 100644 --- a/development/build/static.js +++ b/development/build/static.js @@ -6,7 +6,6 @@ const glob = require('fast-glob'); const locales = require('../../app/_locales/index.json'); const { BuildType } = require('../lib/build-type'); -const { TASKS } = require('./constants'); const { createTask, composeSeries } = require('./task'); const EMPTY_JS_FILE = './development/empty.js'; @@ -42,7 +41,7 @@ module.exports = function createStaticAssetTasks({ } const prod = createTask( - TASKS.STATIC_PROD, + 'static:prod', composeSeries( ...copyTargetsProd.map((target) => { return async function copyStaticAssets() { @@ -52,7 +51,7 @@ module.exports = function createStaticAssetTasks({ ), ); const dev = createTask( - TASKS.STATIC_DEV, + 'static:dev', composeSeries( ...copyTargetsDev.map((target) => { return async function copyStaticAssets() { @@ -153,10 +152,6 @@ function getCopyTargets(shouldIncludeLockdown) { : EMPTY_JS_FILE, dest: `lockdown-install.js`, }, - { - src: './app/scripts/init-globals.js', - dest: 'init-globals.js', - }, { src: shouldIncludeLockdown ? `./app/scripts/lockdown-run.js` @@ -179,6 +174,10 @@ function getCopyTargets(shouldIncludeLockdown) { src: require.resolve('@lavamoat/lavapack/src/runtime.js'), dest: `runtime-lavamoat.js`, }, + { + src: `./app/phishing.html`, + dest: `phishing.html`, + }, ]; const languageTags = new Set(); diff --git a/development/build/styles.js b/development/build/styles.js index 926609dff8fd..ecda4b661882 100644 --- a/development/build/styles.js +++ b/development/build/styles.js @@ -7,7 +7,6 @@ const sourcemaps = require('gulp-sourcemaps'); const rtlcss = require('gulp-rtlcss'); const rename = require('gulp-rename'); const pump = pify(require('pump')); -const { TASKS } = require('./constants'); const { createTask } = require('./task'); let sass; @@ -17,7 +16,7 @@ module.exports = createStyleTasks; function createStyleTasks({ livereload }) { const prod = createTask( - TASKS.STYLES_PROD, + 'styles:prod', createScssBuildTask({ src: 'ui/css/index.scss', dest: 'ui/css/output', @@ -26,7 +25,7 @@ function createStyleTasks({ livereload }) { ); const dev = createTask( - TASKS.STYLES_DEV, + 'styles:dev', createScssBuildTask({ src: 'ui/css/index.scss', dest: 'ui/css/output', @@ -35,7 +34,7 @@ function createStyleTasks({ livereload }) { }), ); - const lint = createTask(TASKS.LINT_SCSS, function () { + const lint = createTask('lint-scss', function () { return gulp.src('ui/css/itcss/**/*.scss').pipe( gulpStylelint({ reporters: [{ formatter: 'string', console: true }], diff --git a/development/build/transforms/utils.test.js b/development/build/transforms/utils.test.js index 303b954d3568..ba273a15bdac 100644 --- a/development/build/transforms/utils.test.js +++ b/development/build/transforms/utils.test.js @@ -26,7 +26,7 @@ describe('transform utils', () => { // This error is an artifact of how we're mocking the ESLint singleton, // and won't actually occur in production. await expect(() => lintTransformedFile()).rejects.toThrow( - `Cannot read properties of undefined (reading '0')`, + `Cannot read property '0' of undefined`, ); expect(mockESLint).toBeDefined(); }); diff --git a/development/charts/flamegraph/chart/index.html b/development/charts/flamegraph/chart/index.html deleted file mode 100644 index 7afe9f9d0dcb..000000000000 --- a/development/charts/flamegraph/chart/index.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - Performance Measurements - - - - - -
-
- -

d3-flame-graph

-
-
-
-
-
- - - - - - - - - - - diff --git a/development/charts/flamegraph/lib/d3-flamegraph-tooltip.js b/development/charts/flamegraph/lib/d3-flamegraph-tooltip.js deleted file mode 100644 index cc042a0f281b..000000000000 --- a/development/charts/flamegraph/lib/d3-flamegraph-tooltip.js +++ /dev/null @@ -1,3117 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["flamegraph"] = factory(); - else - root["flamegraph"] = root["flamegraph"] || {}, root["flamegraph"]["tooltip"] = factory(); -})(self, function() { -return /******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ // The require scope -/******/ var __webpack_require__ = {}; -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, { - "defaultFlamegraphTooltip": () => (/* binding */ defaultFlamegraphTooltip) -}); - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selector.js -function none() {} - -/* harmony default export */ function selector(selector) { - return selector == null ? none : function() { - return this.querySelector(selector); - }; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/select.js - - - -/* harmony default export */ function selection_select(select) { - if (typeof select !== "function") select = selector(select); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - } - } - } - - return new Selection(subgroups, this._parents); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/array.js -// Given something array like (or null), returns something that is strictly an -// array. This is used to ensure that array-like objects passed to d3.selectAll -// or selection.selectAll are converted into proper arrays when creating a -// selection; we don’t ever want to create a selection backed by a live -// HTMLCollection or NodeList. However, note that selection.selectAll will use a -// static NodeList as a group, since it safely derived from querySelectorAll. -function array(x) { - return x == null ? [] : Array.isArray(x) ? x : Array.from(x); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selectorAll.js -function empty() { - return []; -} - -/* harmony default export */ function selectorAll(selector) { - return selector == null ? empty : function() { - return this.querySelectorAll(selector); - }; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectAll.js - - - - -function arrayAll(select) { - return function() { - return array(select.apply(this, arguments)); - }; -} - -/* harmony default export */ function selectAll(select) { - if (typeof select === "function") select = arrayAll(select); - else select = selectorAll(select); - - for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - subgroups.push(select.call(node, node.__data__, i, group)); - parents.push(node); - } - } - } - - return new Selection(subgroups, parents); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/matcher.js -/* harmony default export */ function matcher(selector) { - return function() { - return this.matches(selector); - }; -} - -function childMatcher(selector) { - return function(node) { - return node.matches(selector); - }; -} - - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectChild.js - - -var find = Array.prototype.find; - -function childFind(match) { - return function() { - return find.call(this.children, match); - }; -} - -function childFirst() { - return this.firstElementChild; -} - -/* harmony default export */ function selectChild(match) { - return this.select(match == null ? childFirst - : childFind(typeof match === "function" ? match : childMatcher(match))); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectChildren.js - - -var filter = Array.prototype.filter; - -function children() { - return Array.from(this.children); -} - -function childrenFilter(match) { - return function() { - return filter.call(this.children, match); - }; -} - -/* harmony default export */ function selectChildren(match) { - return this.selectAll(match == null ? children - : childrenFilter(typeof match === "function" ? match : childMatcher(match))); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/filter.js - - - -/* harmony default export */ function selection_filter(match) { - if (typeof match !== "function") match = matcher(match); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Selection(subgroups, this._parents); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/sparse.js -/* harmony default export */ function sparse(update) { - return new Array(update.length); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/enter.js - - - -/* harmony default export */ function enter() { - return new Selection(this._enter || this._groups.map(sparse), this._parents); -} - -function EnterNode(parent, datum) { - this.ownerDocument = parent.ownerDocument; - this.namespaceURI = parent.namespaceURI; - this._next = null; - this._parent = parent; - this.__data__ = datum; -} - -EnterNode.prototype = { - constructor: EnterNode, - appendChild: function(child) { return this._parent.insertBefore(child, this._next); }, - insertBefore: function(child, next) { return this._parent.insertBefore(child, next); }, - querySelector: function(selector) { return this._parent.querySelector(selector); }, - querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); } -}; - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/constant.js -/* harmony default export */ function src_constant(x) { - return function() { - return x; - }; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/data.js - - - - -function bindIndex(parent, group, enter, update, exit, data) { - var i = 0, - node, - groupLength = group.length, - dataLength = data.length; - - // Put any non-null nodes that fit into update. - // Put any null nodes into enter. - // Put any remaining data into enter. - for (; i < dataLength; ++i) { - if (node = group[i]) { - node.__data__ = data[i]; - update[i] = node; - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - - // Put any non-null nodes that don’t fit into exit. - for (; i < groupLength; ++i) { - if (node = group[i]) { - exit[i] = node; - } - } -} - -function bindKey(parent, group, enter, update, exit, data, key) { - var i, - node, - nodeByKeyValue = new Map, - groupLength = group.length, - dataLength = data.length, - keyValues = new Array(groupLength), - keyValue; - - // Compute the key for each node. - // If multiple nodes have the same key, the duplicates are added to exit. - for (i = 0; i < groupLength; ++i) { - if (node = group[i]) { - keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + ""; - if (nodeByKeyValue.has(keyValue)) { - exit[i] = node; - } else { - nodeByKeyValue.set(keyValue, node); - } - } - } - - // Compute the key for each datum. - // If there a node associated with this key, join and add it to update. - // If there is not (or the key is a duplicate), add it to enter. - for (i = 0; i < dataLength; ++i) { - keyValue = key.call(parent, data[i], i, data) + ""; - if (node = nodeByKeyValue.get(keyValue)) { - update[i] = node; - node.__data__ = data[i]; - nodeByKeyValue.delete(keyValue); - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - - // Add any remaining nodes that were not bound to data to exit. - for (i = 0; i < groupLength; ++i) { - if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) { - exit[i] = node; - } - } -} - -function datum(node) { - return node.__data__; -} - -/* harmony default export */ function data(value, key) { - if (!arguments.length) return Array.from(this, datum); - - var bind = key ? bindKey : bindIndex, - parents = this._parents, - groups = this._groups; - - if (typeof value !== "function") value = src_constant(value); - - for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { - var parent = parents[j], - group = groups[j], - groupLength = group.length, - data = arraylike(value.call(parent, parent && parent.__data__, j, parents)), - dataLength = data.length, - enterGroup = enter[j] = new Array(dataLength), - updateGroup = update[j] = new Array(dataLength), - exitGroup = exit[j] = new Array(groupLength); - - bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); - - // Now connect the enter nodes to their following update node, such that - // appendChild can insert the materialized enter node before this node, - // rather than at the end of the parent node. - for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { - if (previous = enterGroup[i0]) { - if (i0 >= i1) i1 = i0 + 1; - while (!(next = updateGroup[i1]) && ++i1 < dataLength); - previous._next = next || null; - } - } - } - - update = new Selection(update, parents); - update._enter = enter; - update._exit = exit; - return update; -} - -// Given some data, this returns an array-like view of it: an object that -// exposes a length property and allows numeric indexing. Note that unlike -// selectAll, this isn’t worried about “live” collections because the resulting -// array will only be used briefly while data is being bound. (It is possible to -// cause the data to change while iterating by using a key function, but please -// don’t; we’d rather avoid a gratuitous copy.) -function arraylike(data) { - return typeof data === "object" && "length" in data - ? data // Array, TypedArray, NodeList, array-like - : Array.from(data); // Map, Set, iterable, string, or anything else -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/exit.js - - - -/* harmony default export */ function exit() { - return new Selection(this._exit || this._groups.map(sparse), this._parents); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/join.js -/* harmony default export */ function join(onenter, onupdate, onexit) { - var enter = this.enter(), update = this, exit = this.exit(); - if (typeof onenter === "function") { - enter = onenter(enter); - if (enter) enter = enter.selection(); - } else { - enter = enter.append(onenter + ""); - } - if (onupdate != null) { - update = onupdate(update); - if (update) update = update.selection(); - } - if (onexit == null) exit.remove(); else onexit(exit); - return enter && update ? enter.merge(update).order() : update; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/merge.js - - -/* harmony default export */ function merge(context) { - var selection = context.selection ? context.selection() : context; - - for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Selection(merges, this._parents); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/order.js -/* harmony default export */ function order() { - - for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { - for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { - if (node = group[i]) { - if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next); - next = node; - } - } - } - - return this; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/sort.js - - -/* harmony default export */ function sort(compare) { - if (!compare) compare = ascending; - - function compareNode(a, b) { - return a && b ? compare(a.__data__, b.__data__) : !a - !b; - } - - for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group[i]) { - sortgroup[i] = node; - } - } - sortgroup.sort(compareNode); - } - - return new Selection(sortgroups, this._parents).order(); -} - -function ascending(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/call.js -/* harmony default export */ function call() { - var callback = arguments[0]; - arguments[0] = this; - callback.apply(null, arguments); - return this; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/nodes.js -/* harmony default export */ function nodes() { - return Array.from(this); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/node.js -/* harmony default export */ function node() { - - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { - var node = group[i]; - if (node) return node; - } - } - - return null; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/size.js -/* harmony default export */ function size() { - let size = 0; - for (const node of this) ++size; // eslint-disable-line no-unused-vars - return size; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/empty.js -/* harmony default export */ function selection_empty() { - return !this.node(); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/each.js -/* harmony default export */ function each(callback) { - - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { - if (node = group[i]) callback.call(node, node.__data__, i, group); - } - } - - return this; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/namespaces.js -var xhtml = "http://www.w3.org/1999/xhtml"; - -/* harmony default export */ const namespaces = ({ - svg: "http://www.w3.org/2000/svg", - xhtml: xhtml, - xlink: "http://www.w3.org/1999/xlink", - xml: "http://www.w3.org/XML/1998/namespace", - xmlns: "http://www.w3.org/2000/xmlns/" -}); - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/namespace.js - - -/* harmony default export */ function namespace(name) { - var prefix = name += "", i = prefix.indexOf(":"); - if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); - return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/attr.js - - -function attrRemove(name) { - return function() { - this.removeAttribute(name); - }; -} - -function attrRemoveNS(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; -} - -function attrConstant(name, value) { - return function() { - this.setAttribute(name, value); - }; -} - -function attrConstantNS(fullname, value) { - return function() { - this.setAttributeNS(fullname.space, fullname.local, value); - }; -} - -function attrFunction(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttribute(name); - else this.setAttribute(name, v); - }; -} - -function attrFunctionNS(fullname, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttributeNS(fullname.space, fullname.local); - else this.setAttributeNS(fullname.space, fullname.local, v); - }; -} - -/* harmony default export */ function attr(name, value) { - var fullname = namespace(name); - - if (arguments.length < 2) { - var node = this.node(); - return fullname.local - ? node.getAttributeNS(fullname.space, fullname.local) - : node.getAttribute(fullname); - } - - return this.each((value == null - ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function" - ? (fullname.local ? attrFunctionNS : attrFunction) - : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value)); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/window.js -/* harmony default export */ function src_window(node) { - return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node - || (node.document && node) // node is a Window - || node.defaultView; // node is a Document -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/style.js - - -function styleRemove(name) { - return function() { - this.style.removeProperty(name); - }; -} - -function styleConstant(name, value, priority) { - return function() { - this.style.setProperty(name, value, priority); - }; -} - -function styleFunction(name, value, priority) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.style.removeProperty(name); - else this.style.setProperty(name, v, priority); - }; -} - -/* harmony default export */ function style(name, value, priority) { - return arguments.length > 1 - ? this.each((value == null - ? styleRemove : typeof value === "function" - ? styleFunction - : styleConstant)(name, value, priority == null ? "" : priority)) - : styleValue(this.node(), name); -} - -function styleValue(node, name) { - return node.style.getPropertyValue(name) - || src_window(node).getComputedStyle(node, null).getPropertyValue(name); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/property.js -function propertyRemove(name) { - return function() { - delete this[name]; - }; -} - -function propertyConstant(name, value) { - return function() { - this[name] = value; - }; -} - -function propertyFunction(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) delete this[name]; - else this[name] = v; - }; -} - -/* harmony default export */ function property(name, value) { - return arguments.length > 1 - ? this.each((value == null - ? propertyRemove : typeof value === "function" - ? propertyFunction - : propertyConstant)(name, value)) - : this.node()[name]; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/classed.js -function classArray(string) { - return string.trim().split(/^|\s+/); -} - -function classList(node) { - return node.classList || new ClassList(node); -} - -function ClassList(node) { - this._node = node; - this._names = classArray(node.getAttribute("class") || ""); -} - -ClassList.prototype = { - add: function(name) { - var i = this._names.indexOf(name); - if (i < 0) { - this._names.push(name); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - remove: function(name) { - var i = this._names.indexOf(name); - if (i >= 0) { - this._names.splice(i, 1); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - contains: function(name) { - return this._names.indexOf(name) >= 0; - } -}; - -function classedAdd(node, names) { - var list = classList(node), i = -1, n = names.length; - while (++i < n) list.add(names[i]); -} - -function classedRemove(node, names) { - var list = classList(node), i = -1, n = names.length; - while (++i < n) list.remove(names[i]); -} - -function classedTrue(names) { - return function() { - classedAdd(this, names); - }; -} - -function classedFalse(names) { - return function() { - classedRemove(this, names); - }; -} - -function classedFunction(names, value) { - return function() { - (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); - }; -} - -/* harmony default export */ function classed(name, value) { - var names = classArray(name + ""); - - if (arguments.length < 2) { - var list = classList(this.node()), i = -1, n = names.length; - while (++i < n) if (!list.contains(names[i])) return false; - return true; - } - - return this.each((typeof value === "function" - ? classedFunction : value - ? classedTrue - : classedFalse)(names, value)); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/text.js -function textRemove() { - this.textContent = ""; -} - -function textConstant(value) { - return function() { - this.textContent = value; - }; -} - -function textFunction(value) { - return function() { - var v = value.apply(this, arguments); - this.textContent = v == null ? "" : v; - }; -} - -/* harmony default export */ function selection_text(value) { - return arguments.length - ? this.each(value == null - ? textRemove : (typeof value === "function" - ? textFunction - : textConstant)(value)) - : this.node().textContent; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/html.js -function htmlRemove() { - this.innerHTML = ""; -} - -function htmlConstant(value) { - return function() { - this.innerHTML = value; - }; -} - -function htmlFunction(value) { - return function() { - var v = value.apply(this, arguments); - this.innerHTML = v == null ? "" : v; - }; -} - -/* harmony default export */ function html(value) { - return arguments.length - ? this.each(value == null - ? htmlRemove : (typeof value === "function" - ? htmlFunction - : htmlConstant)(value)) - : this.node().innerHTML; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/raise.js -function raise() { - if (this.nextSibling) this.parentNode.appendChild(this); -} - -/* harmony default export */ function selection_raise() { - return this.each(raise); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/lower.js -function lower() { - if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); -} - -/* harmony default export */ function selection_lower() { - return this.each(lower); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/creator.js - - - -function creatorInherit(name) { - return function() { - var document = this.ownerDocument, - uri = this.namespaceURI; - return uri === xhtml && document.documentElement.namespaceURI === xhtml - ? document.createElement(name) - : document.createElementNS(uri, name); - }; -} - -function creatorFixed(fullname) { - return function() { - return this.ownerDocument.createElementNS(fullname.space, fullname.local); - }; -} - -/* harmony default export */ function creator(name) { - var fullname = namespace(name); - return (fullname.local - ? creatorFixed - : creatorInherit)(fullname); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/append.js - - -/* harmony default export */ function append(name) { - var create = typeof name === "function" ? name : creator(name); - return this.select(function() { - return this.appendChild(create.apply(this, arguments)); - }); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/insert.js - - - -function constantNull() { - return null; -} - -/* harmony default export */ function insert(name, before) { - var create = typeof name === "function" ? name : creator(name), - select = before == null ? constantNull : typeof before === "function" ? before : selector(before); - return this.select(function() { - return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); - }); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/remove.js -function remove() { - var parent = this.parentNode; - if (parent) parent.removeChild(this); -} - -/* harmony default export */ function selection_remove() { - return this.each(remove); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/clone.js -function selection_cloneShallow() { - var clone = this.cloneNode(false), parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; -} - -function selection_cloneDeep() { - var clone = this.cloneNode(true), parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; -} - -/* harmony default export */ function clone(deep) { - return this.select(deep ? selection_cloneDeep : selection_cloneShallow); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/datum.js -/* harmony default export */ function selection_datum(value) { - return arguments.length - ? this.property("__data__", value) - : this.node().__data__; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/on.js -function contextListener(listener) { - return function(event) { - listener.call(this, event, this.__data__); - }; -} - -function parseTypenames(typenames) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - return {type: t, name: name}; - }); -} - -function onRemove(typename) { - return function() { - var on = this.__on; - if (!on) return; - for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { - if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.options); - } else { - on[++i] = o; - } - } - if (++i) on.length = i; - else delete this.__on; - }; -} - -function onAdd(typename, value, options) { - return function() { - var on = this.__on, o, listener = contextListener(value); - if (on) for (var j = 0, m = on.length; j < m; ++j) { - if ((o = on[j]).type === typename.type && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.options); - this.addEventListener(o.type, o.listener = listener, o.options = options); - o.value = value; - return; - } - } - this.addEventListener(typename.type, listener, options); - o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options}; - if (!on) this.__on = [o]; - else on.push(o); - }; -} - -/* harmony default export */ function on(typename, value, options) { - var typenames = parseTypenames(typename + ""), i, n = typenames.length, t; - - if (arguments.length < 2) { - var on = this.node().__on; - if (on) for (var j = 0, m = on.length, o; j < m; ++j) { - for (i = 0, o = on[j]; i < n; ++i) { - if ((t = typenames[i]).type === o.type && t.name === o.name) { - return o.value; - } - } - } - return; - } - - on = value ? onAdd : onRemove; - for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options)); - return this; -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/dispatch.js - - -function dispatchEvent(node, type, params) { - var window = src_window(node), - event = window.CustomEvent; - - if (typeof event === "function") { - event = new event(type, params); - } else { - event = window.document.createEvent("Event"); - if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail; - else event.initEvent(type, false, false); - } - - node.dispatchEvent(event); -} - -function dispatchConstant(type, params) { - return function() { - return dispatchEvent(this, type, params); - }; -} - -function dispatchFunction(type, params) { - return function() { - return dispatchEvent(this, type, params.apply(this, arguments)); - }; -} - -/* harmony default export */ function dispatch(type, params) { - return this.each((typeof params === "function" - ? dispatchFunction - : dispatchConstant)(type, params)); -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/iterator.js -/* harmony default export */ function* iterator() { - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { - if (node = group[i]) yield node; - } - } -} - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/index.js - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var root = [null]; - -function Selection(groups, parents) { - this._groups = groups; - this._parents = parents; -} - -function selection() { - return new Selection([[document.documentElement]], root); -} - -function selection_selection() { - return this; -} - -Selection.prototype = selection.prototype = { - constructor: Selection, - select: selection_select, - selectAll: selectAll, - selectChild: selectChild, - selectChildren: selectChildren, - filter: selection_filter, - data: data, - enter: enter, - exit: exit, - join: join, - merge: merge, - selection: selection_selection, - order: order, - sort: sort, - call: call, - nodes: nodes, - node: node, - size: size, - empty: selection_empty, - each: each, - attr: attr, - style: style, - property: property, - classed: classed, - text: selection_text, - html: html, - raise: selection_raise, - lower: selection_lower, - append: append, - insert: insert, - remove: selection_remove, - clone: clone, - datum: selection_datum, - on: on, - dispatch: dispatch, - [Symbol.iterator]: iterator -}; - -/* harmony default export */ const src_selection = (selection); - -;// CONCATENATED MODULE: ../node_modules/d3-selection/src/select.js - - -/* harmony default export */ function src_select(selector) { - return typeof selector === "string" - ? new Selection([[document.querySelector(selector)]], [document.documentElement]) - : new Selection([[selector]], root); -} - -;// CONCATENATED MODULE: ../node_modules/d3-dispatch/src/dispatch.js -var noop = {value: () => {}}; - -function dispatch_dispatch() { - for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { - if (!(t = arguments[i] + "") || (t in _) || /[\s.]/.test(t)) throw new Error("illegal type: " + t); - _[t] = []; - } - return new Dispatch(_); -} - -function Dispatch(_) { - this._ = _; -} - -function dispatch_parseTypenames(typenames, types) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); - return {type: t, name: name}; - }); -} - -Dispatch.prototype = dispatch_dispatch.prototype = { - constructor: Dispatch, - on: function(typename, callback) { - var _ = this._, - T = dispatch_parseTypenames(typename + "", _), - t, - i = -1, - n = T.length; - - // If no callback was specified, return the callback of the given type and name. - if (arguments.length < 2) { - while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t; - return; - } - - // If a type was specified, set the callback for the given type and name. - // Otherwise, if a null callback was specified, remove callbacks of the given name. - if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); - while (++i < n) { - if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback); - else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null); - } - - return this; - }, - copy: function() { - var copy = {}, _ = this._; - for (var t in _) copy[t] = _[t].slice(); - return new Dispatch(copy); - }, - call: function(type, that) { - if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2]; - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); - }, - apply: function(type, that, args) { - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); - } -}; - -function get(type, name) { - for (var i = 0, n = type.length, c; i < n; ++i) { - if ((c = type[i]).name === name) { - return c.value; - } - } -} - -function set(type, name, callback) { - for (var i = 0, n = type.length; i < n; ++i) { - if (type[i].name === name) { - type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1)); - break; - } - } - if (callback != null) type.push({name: name, value: callback}); - return type; -} - -/* harmony default export */ const src_dispatch = (dispatch_dispatch); - -;// CONCATENATED MODULE: ../node_modules/d3-timer/src/timer.js -var timer_frame = 0, // is an animation frame pending? - timeout = 0, // is a timeout pending? - interval = 0, // are any timers active? - pokeDelay = 1000, // how frequently we check for clock skew - taskHead, - taskTail, - clockLast = 0, - clockNow = 0, - clockSkew = 0, - clock = typeof performance === "object" && performance.now ? performance : Date, - setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); }; - -function now() { - return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); -} - -function clearNow() { - clockNow = 0; -} - -function Timer() { - this._call = - this._time = - this._next = null; -} - -Timer.prototype = timer.prototype = { - constructor: Timer, - restart: function(callback, delay, time) { - if (typeof callback !== "function") throw new TypeError("callback is not a function"); - time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); - if (!this._next && taskTail !== this) { - if (taskTail) taskTail._next = this; - else taskHead = this; - taskTail = this; - } - this._call = callback; - this._time = time; - sleep(); - }, - stop: function() { - if (this._call) { - this._call = null; - this._time = Infinity; - sleep(); - } - } -}; - -function timer(callback, delay, time) { - var t = new Timer; - t.restart(callback, delay, time); - return t; -} - -function timerFlush() { - now(); // Get the current time, if not already set. - ++timer_frame; // Pretend we’ve set an alarm, if we haven’t already. - var t = taskHead, e; - while (t) { - if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e); - t = t._next; - } - --timer_frame; -} - -function wake() { - clockNow = (clockLast = clock.now()) + clockSkew; - timer_frame = timeout = 0; - try { - timerFlush(); - } finally { - timer_frame = 0; - nap(); - clockNow = 0; - } -} - -function poke() { - var now = clock.now(), delay = now - clockLast; - if (delay > pokeDelay) clockSkew -= delay, clockLast = now; -} - -function nap() { - var t0, t1 = taskHead, t2, time = Infinity; - while (t1) { - if (t1._call) { - if (time > t1._time) time = t1._time; - t0 = t1, t1 = t1._next; - } else { - t2 = t1._next, t1._next = null; - t1 = t0 ? t0._next = t2 : taskHead = t2; - } - } - taskTail = t0; - sleep(time); -} - -function sleep(time) { - if (timer_frame) return; // Soonest alarm already set, or will be. - if (timeout) timeout = clearTimeout(timeout); - var delay = time - clockNow; // Strictly less than if we recomputed clockNow. - if (delay > 24) { - if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew); - if (interval) interval = clearInterval(interval); - } else { - if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); - timer_frame = 1, setFrame(wake); - } -} - -;// CONCATENATED MODULE: ../node_modules/d3-timer/src/timeout.js - - -/* harmony default export */ function src_timeout(callback, delay, time) { - var t = new Timer; - delay = delay == null ? 0 : +delay; - t.restart(elapsed => { - t.stop(); - callback(elapsed + delay); - }, delay, time); - return t; -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/schedule.js - - - -var emptyOn = src_dispatch("start", "end", "cancel", "interrupt"); -var emptyTween = []; - -var CREATED = 0; -var SCHEDULED = 1; -var STARTING = 2; -var STARTED = 3; -var RUNNING = 4; -var ENDING = 5; -var ENDED = 6; - -/* harmony default export */ function schedule(node, name, id, index, group, timing) { - var schedules = node.__transition; - if (!schedules) node.__transition = {}; - else if (id in schedules) return; - create(node, id, { - name: name, - index: index, // For context during callback. - group: group, // For context during callback. - on: emptyOn, - tween: emptyTween, - time: timing.time, - delay: timing.delay, - duration: timing.duration, - ease: timing.ease, - timer: null, - state: CREATED - }); -} - -function init(node, id) { - var schedule = schedule_get(node, id); - if (schedule.state > CREATED) throw new Error("too late; already scheduled"); - return schedule; -} - -function schedule_set(node, id) { - var schedule = schedule_get(node, id); - if (schedule.state > STARTED) throw new Error("too late; already running"); - return schedule; -} - -function schedule_get(node, id) { - var schedule = node.__transition; - if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found"); - return schedule; -} - -function create(node, id, self) { - var schedules = node.__transition, - tween; - - // Initialize the self timer when the transition is created. - // Note the actual delay is not known until the first callback! - schedules[id] = self; - self.timer = timer(schedule, 0, self.time); - - function schedule(elapsed) { - self.state = SCHEDULED; - self.timer.restart(start, self.delay, self.time); - - // If the elapsed delay is less than our first sleep, start immediately. - if (self.delay <= elapsed) start(elapsed - self.delay); - } - - function start(elapsed) { - var i, j, n, o; - - // If the state is not SCHEDULED, then we previously errored on start. - if (self.state !== SCHEDULED) return stop(); - - for (i in schedules) { - o = schedules[i]; - if (o.name !== self.name) continue; - - // While this element already has a starting transition during this frame, - // defer starting an interrupting transition until that transition has a - // chance to tick (and possibly end); see d3/d3-transition#54! - if (o.state === STARTED) return src_timeout(start); - - // Interrupt the active transition, if any. - if (o.state === RUNNING) { - o.state = ENDED; - o.timer.stop(); - o.on.call("interrupt", node, node.__data__, o.index, o.group); - delete schedules[i]; - } - - // Cancel any pre-empted transitions. - else if (+i < id) { - o.state = ENDED; - o.timer.stop(); - o.on.call("cancel", node, node.__data__, o.index, o.group); - delete schedules[i]; - } - } - - // Defer the first tick to end of the current frame; see d3/d3#1576. - // Note the transition may be canceled after start and before the first tick! - // Note this must be scheduled before the start event; see d3/d3-transition#16! - // Assuming this is successful, subsequent callbacks go straight to tick. - src_timeout(function() { - if (self.state === STARTED) { - self.state = RUNNING; - self.timer.restart(tick, self.delay, self.time); - tick(elapsed); - } - }); - - // Dispatch the start event. - // Note this must be done before the tween are initialized. - self.state = STARTING; - self.on.call("start", node, node.__data__, self.index, self.group); - if (self.state !== STARTING) return; // interrupted - self.state = STARTED; - - // Initialize the tween, deleting null tween. - tween = new Array(n = self.tween.length); - for (i = 0, j = -1; i < n; ++i) { - if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) { - tween[++j] = o; - } - } - tween.length = j + 1; - } - - function tick(elapsed) { - var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), - i = -1, - n = tween.length; - - while (++i < n) { - tween[i].call(node, t); - } - - // Dispatch the end event. - if (self.state === ENDING) { - self.on.call("end", node, node.__data__, self.index, self.group); - stop(); - } - } - - function stop() { - self.state = ENDED; - self.timer.stop(); - delete schedules[id]; - for (var i in schedules) return; // eslint-disable-line no-unused-vars - delete node.__transition; - } -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/interrupt.js - - -/* harmony default export */ function interrupt(node, name) { - var schedules = node.__transition, - schedule, - active, - empty = true, - i; - - if (!schedules) return; - - name = name == null ? null : name + ""; - - for (i in schedules) { - if ((schedule = schedules[i]).name !== name) { empty = false; continue; } - active = schedule.state > STARTING && schedule.state < ENDING; - schedule.state = ENDED; - schedule.timer.stop(); - schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group); - delete schedules[i]; - } - - if (empty) delete node.__transition; -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/interrupt.js - - -/* harmony default export */ function selection_interrupt(name) { - return this.each(function() { - interrupt(this, name); - }); -} - -;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/number.js -/* harmony default export */ function number(a, b) { - return a = +a, b = +b, function(t) { - return a * (1 - t) + b * t; - }; -} - -;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/decompose.js -var degrees = 180 / Math.PI; - -var identity = { - translateX: 0, - translateY: 0, - rotate: 0, - skewX: 0, - scaleX: 1, - scaleY: 1 -}; - -/* harmony default export */ function decompose(a, b, c, d, e, f) { - var scaleX, scaleY, skewX; - if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; - if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; - if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; - if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; - return { - translateX: e, - translateY: f, - rotate: Math.atan2(b, a) * degrees, - skewX: Math.atan(skewX) * degrees, - scaleX: scaleX, - scaleY: scaleY - }; -} - -;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/parse.js - - -var svgNode; - -/* eslint-disable no-undef */ -function parseCss(value) { - const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + ""); - return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f); -} - -function parseSvg(value) { - if (value == null) return identity; - if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); - svgNode.setAttribute("transform", value); - if (!(value = svgNode.transform.baseVal.consolidate())) return identity; - value = value.matrix; - return decompose(value.a, value.b, value.c, value.d, value.e, value.f); -} - -;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/index.js - - - -function interpolateTransform(parse, pxComma, pxParen, degParen) { - - function pop(s) { - return s.length ? s.pop() + " " : ""; - } - - function translate(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push("translate(", null, pxComma, null, pxParen); - q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); - } else if (xb || yb) { - s.push("translate(" + xb + pxComma + yb + pxParen); - } - } - - function rotate(a, b, s, q) { - if (a !== b) { - if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path - q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)}); - } else if (b) { - s.push(pop(s) + "rotate(" + b + degParen); - } - } - - function skewX(a, b, s, q) { - if (a !== b) { - q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)}); - } else if (b) { - s.push(pop(s) + "skewX(" + b + degParen); - } - } - - function scale(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push(pop(s) + "scale(", null, ",", null, ")"); - q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); - } else if (xb !== 1 || yb !== 1) { - s.push(pop(s) + "scale(" + xb + "," + yb + ")"); - } - } - - return function(a, b) { - var s = [], // string constants and placeholders - q = []; // number interpolators - a = parse(a), b = parse(b); - translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); - rotate(a.rotate, b.rotate, s, q); - skewX(a.skewX, b.skewX, s, q); - scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); - a = b = null; // gc - return function(t) { - var i = -1, n = q.length, o; - while (++i < n) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }; - }; -} - -var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); -var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/tween.js - - -function tweenRemove(id, name) { - var tween0, tween1; - return function() { - var schedule = schedule_set(this, id), - tween = schedule.tween; - - // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - if (tween !== tween0) { - tween1 = tween0 = tween; - for (var i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1 = tween1.slice(); - tween1.splice(i, 1); - break; - } - } - } - - schedule.tween = tween1; - }; -} - -function tweenFunction(id, name, value) { - var tween0, tween1; - if (typeof value !== "function") throw new Error; - return function() { - var schedule = schedule_set(this, id), - tween = schedule.tween; - - // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - if (tween !== tween0) { - tween1 = (tween0 = tween).slice(); - for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1[i] = t; - break; - } - } - if (i === n) tween1.push(t); - } - - schedule.tween = tween1; - }; -} - -/* harmony default export */ function tween(name, value) { - var id = this._id; - - name += ""; - - if (arguments.length < 2) { - var tween = schedule_get(this.node(), id).tween; - for (var i = 0, n = tween.length, t; i < n; ++i) { - if ((t = tween[i]).name === name) { - return t.value; - } - } - return null; - } - - return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value)); -} - -function tweenValue(transition, name, value) { - var id = transition._id; - - transition.each(function() { - var schedule = schedule_set(this, id); - (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments); - }); - - return function(node) { - return schedule_get(node, id).value[name]; - }; -} - -;// CONCATENATED MODULE: ../node_modules/d3-color/src/define.js -/* harmony default export */ function src_define(constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; -} - -function extend(parent, definition) { - var prototype = Object.create(parent.prototype); - for (var key in definition) prototype[key] = definition[key]; - return prototype; -} - -;// CONCATENATED MODULE: ../node_modules/d3-color/src/color.js - - -function Color() {} - -var darker = 0.7; -var brighter = 1 / darker; - -var reI = "\\s*([+-]?\\d+)\\s*", - reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", - reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", - reHex = /^#([0-9a-f]{3,8})$/, - reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), - reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), - reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), - reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"), - reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"), - reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$"); - -var named = { - aliceblue: 0xf0f8ff, - antiquewhite: 0xfaebd7, - aqua: 0x00ffff, - aquamarine: 0x7fffd4, - azure: 0xf0ffff, - beige: 0xf5f5dc, - bisque: 0xffe4c4, - black: 0x000000, - blanchedalmond: 0xffebcd, - blue: 0x0000ff, - blueviolet: 0x8a2be2, - brown: 0xa52a2a, - burlywood: 0xdeb887, - cadetblue: 0x5f9ea0, - chartreuse: 0x7fff00, - chocolate: 0xd2691e, - coral: 0xff7f50, - cornflowerblue: 0x6495ed, - cornsilk: 0xfff8dc, - crimson: 0xdc143c, - cyan: 0x00ffff, - darkblue: 0x00008b, - darkcyan: 0x008b8b, - darkgoldenrod: 0xb8860b, - darkgray: 0xa9a9a9, - darkgreen: 0x006400, - darkgrey: 0xa9a9a9, - darkkhaki: 0xbdb76b, - darkmagenta: 0x8b008b, - darkolivegreen: 0x556b2f, - darkorange: 0xff8c00, - darkorchid: 0x9932cc, - darkred: 0x8b0000, - darksalmon: 0xe9967a, - darkseagreen: 0x8fbc8f, - darkslateblue: 0x483d8b, - darkslategray: 0x2f4f4f, - darkslategrey: 0x2f4f4f, - darkturquoise: 0x00ced1, - darkviolet: 0x9400d3, - deeppink: 0xff1493, - deepskyblue: 0x00bfff, - dimgray: 0x696969, - dimgrey: 0x696969, - dodgerblue: 0x1e90ff, - firebrick: 0xb22222, - floralwhite: 0xfffaf0, - forestgreen: 0x228b22, - fuchsia: 0xff00ff, - gainsboro: 0xdcdcdc, - ghostwhite: 0xf8f8ff, - gold: 0xffd700, - goldenrod: 0xdaa520, - gray: 0x808080, - green: 0x008000, - greenyellow: 0xadff2f, - grey: 0x808080, - honeydew: 0xf0fff0, - hotpink: 0xff69b4, - indianred: 0xcd5c5c, - indigo: 0x4b0082, - ivory: 0xfffff0, - khaki: 0xf0e68c, - lavender: 0xe6e6fa, - lavenderblush: 0xfff0f5, - lawngreen: 0x7cfc00, - lemonchiffon: 0xfffacd, - lightblue: 0xadd8e6, - lightcoral: 0xf08080, - lightcyan: 0xe0ffff, - lightgoldenrodyellow: 0xfafad2, - lightgray: 0xd3d3d3, - lightgreen: 0x90ee90, - lightgrey: 0xd3d3d3, - lightpink: 0xffb6c1, - lightsalmon: 0xffa07a, - lightseagreen: 0x20b2aa, - lightskyblue: 0x87cefa, - lightslategray: 0x778899, - lightslategrey: 0x778899, - lightsteelblue: 0xb0c4de, - lightyellow: 0xffffe0, - lime: 0x00ff00, - limegreen: 0x32cd32, - linen: 0xfaf0e6, - magenta: 0xff00ff, - maroon: 0x800000, - mediumaquamarine: 0x66cdaa, - mediumblue: 0x0000cd, - mediumorchid: 0xba55d3, - mediumpurple: 0x9370db, - mediumseagreen: 0x3cb371, - mediumslateblue: 0x7b68ee, - mediumspringgreen: 0x00fa9a, - mediumturquoise: 0x48d1cc, - mediumvioletred: 0xc71585, - midnightblue: 0x191970, - mintcream: 0xf5fffa, - mistyrose: 0xffe4e1, - moccasin: 0xffe4b5, - navajowhite: 0xffdead, - navy: 0x000080, - oldlace: 0xfdf5e6, - olive: 0x808000, - olivedrab: 0x6b8e23, - orange: 0xffa500, - orangered: 0xff4500, - orchid: 0xda70d6, - palegoldenrod: 0xeee8aa, - palegreen: 0x98fb98, - paleturquoise: 0xafeeee, - palevioletred: 0xdb7093, - papayawhip: 0xffefd5, - peachpuff: 0xffdab9, - peru: 0xcd853f, - pink: 0xffc0cb, - plum: 0xdda0dd, - powderblue: 0xb0e0e6, - purple: 0x800080, - rebeccapurple: 0x663399, - red: 0xff0000, - rosybrown: 0xbc8f8f, - royalblue: 0x4169e1, - saddlebrown: 0x8b4513, - salmon: 0xfa8072, - sandybrown: 0xf4a460, - seagreen: 0x2e8b57, - seashell: 0xfff5ee, - sienna: 0xa0522d, - silver: 0xc0c0c0, - skyblue: 0x87ceeb, - slateblue: 0x6a5acd, - slategray: 0x708090, - slategrey: 0x708090, - snow: 0xfffafa, - springgreen: 0x00ff7f, - steelblue: 0x4682b4, - tan: 0xd2b48c, - teal: 0x008080, - thistle: 0xd8bfd8, - tomato: 0xff6347, - turquoise: 0x40e0d0, - violet: 0xee82ee, - wheat: 0xf5deb3, - white: 0xffffff, - whitesmoke: 0xf5f5f5, - yellow: 0xffff00, - yellowgreen: 0x9acd32 -}; - -src_define(Color, color, { - copy: function(channels) { - return Object.assign(new this.constructor, this, channels); - }, - displayable: function() { - return this.rgb().displayable(); - }, - hex: color_formatHex, // Deprecated! Use color.formatHex. - formatHex: color_formatHex, - formatHsl: color_formatHsl, - formatRgb: color_formatRgb, - toString: color_formatRgb -}); - -function color_formatHex() { - return this.rgb().formatHex(); -} - -function color_formatHsl() { - return hslConvert(this).formatHsl(); -} - -function color_formatRgb() { - return this.rgb().formatRgb(); -} - -function color(format) { - var m, l; - format = (format + "").trim().toLowerCase(); - return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000 - : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00 - : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 - : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000 - : null) // invalid hex - : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) - : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) - : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) - : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) - : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) - : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) - : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins - : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) - : null; -} - -function rgbn(n) { - return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); -} - -function rgba(r, g, b, a) { - if (a <= 0) r = g = b = NaN; - return new Rgb(r, g, b, a); -} - -function rgbConvert(o) { - if (!(o instanceof Color)) o = color(o); - if (!o) return new Rgb; - o = o.rgb(); - return new Rgb(o.r, o.g, o.b, o.opacity); -} - -function color_rgb(r, g, b, opacity) { - return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); -} - -function Rgb(r, g, b, opacity) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity; -} - -src_define(Rgb, color_rgb, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - rgb: function() { - return this; - }, - displayable: function() { - return (-0.5 <= this.r && this.r < 255.5) - && (-0.5 <= this.g && this.g < 255.5) - && (-0.5 <= this.b && this.b < 255.5) - && (0 <= this.opacity && this.opacity <= 1); - }, - hex: rgb_formatHex, // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex, - formatRgb: rgb_formatRgb, - toString: rgb_formatRgb -})); - -function rgb_formatHex() { - return "#" + hex(this.r) + hex(this.g) + hex(this.b); -} - -function rgb_formatRgb() { - var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "rgb(" : "rgba(") - + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " - + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " - + Math.max(0, Math.min(255, Math.round(this.b) || 0)) - + (a === 1 ? ")" : ", " + a + ")"); -} - -function hex(value) { - value = Math.max(0, Math.min(255, Math.round(value) || 0)); - return (value < 16 ? "0" : "") + value.toString(16); -} - -function hsla(h, s, l, a) { - if (a <= 0) h = s = l = NaN; - else if (l <= 0 || l >= 1) h = s = NaN; - else if (s <= 0) h = NaN; - return new Hsl(h, s, l, a); -} - -function hslConvert(o) { - if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color)) o = color(o); - if (!o) return new Hsl; - if (o instanceof Hsl) return o; - o = o.rgb(); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - min = Math.min(r, g, b), - max = Math.max(r, g, b), - h = NaN, - s = max - min, - l = (max + min) / 2; - if (s) { - if (r === max) h = (g - b) / s + (g < b) * 6; - else if (g === max) h = (b - r) / s + 2; - else h = (r - g) / s + 4; - s /= l < 0.5 ? max + min : 2 - max - min; - h *= 60; - } else { - s = l > 0 && l < 1 ? 0 : h; - } - return new Hsl(h, s, l, o.opacity); -} - -function hsl(h, s, l, opacity) { - return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); -} - -function Hsl(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; -} - -src_define(Hsl, hsl, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function() { - var h = this.h % 360 + (this.h < 0) * 360, - s = isNaN(h) || isNaN(this.s) ? 0 : this.s, - l = this.l, - m2 = l + (l < 0.5 ? l : 1 - l) * s, - m1 = 2 * l - m2; - return new Rgb( - hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), - hsl2rgb(h, m1, m2), - hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), - this.opacity - ); - }, - displayable: function() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) - && (0 <= this.l && this.l <= 1) - && (0 <= this.opacity && this.opacity <= 1); - }, - formatHsl: function() { - var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "hsl(" : "hsla(") - + (this.h || 0) + ", " - + (this.s || 0) * 100 + "%, " - + (this.l || 0) * 100 + "%" - + (a === 1 ? ")" : ", " + a + ")"); - } -})); - -/* From FvD 13.37, CSS Color Module Level 3 */ -function hsl2rgb(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 - : h < 180 ? m2 - : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 - : m1) * 255; -} - -;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/basis.js -function basis(t1, v0, v1, v2, v3) { - var t2 = t1 * t1, t3 = t2 * t1; - return ((1 - 3 * t1 + 3 * t2 - t3) * v0 - + (4 - 6 * t2 + 3 * t3) * v1 - + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 - + t3 * v3) / 6; -} - -/* harmony default export */ function src_basis(values) { - var n = values.length - 1; - return function(t) { - var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), - v1 = values[i], - v2 = values[i + 1], - v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, - v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; - return basis((t - i / n) * n, v0, v1, v2, v3); - }; -} - -;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/basisClosed.js - - -/* harmony default export */ function basisClosed(values) { - var n = values.length; - return function(t) { - var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), - v0 = values[(i + n - 1) % n], - v1 = values[i % n], - v2 = values[(i + 1) % n], - v3 = values[(i + 2) % n]; - return basis((t - i / n) * n, v0, v1, v2, v3); - }; -} - -;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/constant.js -/* harmony default export */ const d3_interpolate_src_constant = (x => () => x); - -;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/color.js - - -function linear(a, d) { - return function(t) { - return a + t * d; - }; -} - -function exponential(a, b, y) { - return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) { - return Math.pow(a + t * b, y); - }; -} - -function hue(a, b) { - var d = b - a; - return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a); -} - -function gamma(y) { - return (y = +y) === 1 ? nogamma : function(a, b) { - return b - a ? exponential(a, b, y) : d3_interpolate_src_constant(isNaN(a) ? b : a); - }; -} - -function nogamma(a, b) { - var d = b - a; - return d ? linear(a, d) : d3_interpolate_src_constant(isNaN(a) ? b : a); -} - -;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/rgb.js - - - - - -/* harmony default export */ const rgb = ((function rgbGamma(y) { - var color = gamma(y); - - function rgb(start, end) { - var r = color((start = color_rgb(start)).r, (end = color_rgb(end)).r), - g = color(start.g, end.g), - b = color(start.b, end.b), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.r = r(t); - start.g = g(t); - start.b = b(t); - start.opacity = opacity(t); - return start + ""; - }; - } - - rgb.gamma = rgbGamma; - - return rgb; -})(1)); - -function rgbSpline(spline) { - return function(colors) { - var n = colors.length, - r = new Array(n), - g = new Array(n), - b = new Array(n), - i, color; - for (i = 0; i < n; ++i) { - color = color_rgb(colors[i]); - r[i] = color.r || 0; - g[i] = color.g || 0; - b[i] = color.b || 0; - } - r = spline(r); - g = spline(g); - b = spline(b); - color.opacity = 1; - return function(t) { - color.r = r(t); - color.g = g(t); - color.b = b(t); - return color + ""; - }; - }; -} - -var rgbBasis = rgbSpline(src_basis); -var rgbBasisClosed = rgbSpline(basisClosed); - -;// CONCATENATED MODULE: ../node_modules/d3-interpolate/src/string.js - - -var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, - reB = new RegExp(reA.source, "g"); - -function zero(b) { - return function() { - return b; - }; -} - -function one(b) { - return function(t) { - return b(t) + ""; - }; -} - -/* harmony default export */ function string(a, b) { - var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b - am, // current match in a - bm, // current match in b - bs, // string preceding current number in b, if any - i = -1, // index in s - s = [], // string constants and placeholders - q = []; // number interpolators - - // Coerce inputs to strings. - a = a + "", b = b + ""; - - // Interpolate pairs of numbers in a & b. - while ((am = reA.exec(a)) - && (bm = reB.exec(b))) { - if ((bs = bm.index) > bi) { // a string precedes the next number in b - bs = b.slice(bi, bs); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; - } - if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match - if (s[i]) s[i] += bm; // coalesce with previous string - else s[++i] = bm; - } else { // interpolate non-matching numbers - s[++i] = null; - q.push({i: i, x: number(am, bm)}); - } - bi = reB.lastIndex; - } - - // Add remains of b. - if (bi < b.length) { - bs = b.slice(bi); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; - } - - // Special optimization for only a single match. - // Otherwise, interpolate each of the numbers and rejoin the string. - return s.length < 2 ? (q[0] - ? one(q[0].x) - : zero(b)) - : (b = q.length, function(t) { - for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/interpolate.js - - - -/* harmony default export */ function interpolate(a, b) { - var c; - return (typeof b === "number" ? number - : b instanceof color ? rgb - : (c = color(b)) ? (b = c, rgb) - : string)(a, b); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/attr.js - - - - - -function attr_attrRemove(name) { - return function() { - this.removeAttribute(name); - }; -} - -function attr_attrRemoveNS(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; -} - -function attr_attrConstant(name, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = this.getAttribute(name); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; -} - -function attr_attrConstantNS(fullname, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = this.getAttributeNS(fullname.space, fullname.local); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; -} - -function attr_attrFunction(name, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0, value1 = value(this), string1; - if (value1 == null) return void this.removeAttribute(name); - string0 = this.getAttribute(name); - string1 = value1 + ""; - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} - -function attr_attrFunctionNS(fullname, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0, value1 = value(this), string1; - if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local); - string0 = this.getAttributeNS(fullname.space, fullname.local); - string1 = value1 + ""; - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} - -/* harmony default export */ function transition_attr(name, value) { - var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate; - return this.attrTween(name, typeof value === "function" - ? (fullname.local ? attr_attrFunctionNS : attr_attrFunction)(fullname, i, tweenValue(this, "attr." + name, value)) - : value == null ? (fullname.local ? attr_attrRemoveNS : attr_attrRemove)(fullname) - : (fullname.local ? attr_attrConstantNS : attr_attrConstant)(fullname, i, value)); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/attrTween.js - - -function attrInterpolate(name, i) { - return function(t) { - this.setAttribute(name, i.call(this, t)); - }; -} - -function attrInterpolateNS(fullname, i) { - return function(t) { - this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); - }; -} - -function attrTweenNS(fullname, value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i); - return t0; - } - tween._value = value; - return tween; -} - -function attrTween(name, value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i); - return t0; - } - tween._value = value; - return tween; -} - -/* harmony default export */ function transition_attrTween(name, value) { - var key = "attr." + name; - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - var fullname = namespace(name); - return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value)); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/delay.js - - -function delayFunction(id, value) { - return function() { - init(this, id).delay = +value.apply(this, arguments); - }; -} - -function delayConstant(id, value) { - return value = +value, function() { - init(this, id).delay = value; - }; -} - -/* harmony default export */ function delay(value) { - var id = this._id; - - return arguments.length - ? this.each((typeof value === "function" - ? delayFunction - : delayConstant)(id, value)) - : schedule_get(this.node(), id).delay; -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/duration.js - - -function durationFunction(id, value) { - return function() { - schedule_set(this, id).duration = +value.apply(this, arguments); - }; -} - -function durationConstant(id, value) { - return value = +value, function() { - schedule_set(this, id).duration = value; - }; -} - -/* harmony default export */ function duration(value) { - var id = this._id; - - return arguments.length - ? this.each((typeof value === "function" - ? durationFunction - : durationConstant)(id, value)) - : schedule_get(this.node(), id).duration; -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/ease.js - - -function easeConstant(id, value) { - if (typeof value !== "function") throw new Error; - return function() { - schedule_set(this, id).ease = value; - }; -} - -/* harmony default export */ function ease(value) { - var id = this._id; - - return arguments.length - ? this.each(easeConstant(id, value)) - : schedule_get(this.node(), id).ease; -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/easeVarying.js - - -function easeVarying(id, value) { - return function() { - var v = value.apply(this, arguments); - if (typeof v !== "function") throw new Error; - schedule_set(this, id).ease = v; - }; -} - -/* harmony default export */ function transition_easeVarying(value) { - if (typeof value !== "function") throw new Error; - return this.each(easeVarying(this._id, value)); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/filter.js - - - -/* harmony default export */ function transition_filter(match) { - if (typeof match !== "function") match = matcher(match); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Transition(subgroups, this._parents, this._name, this._id); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/merge.js - - -/* harmony default export */ function transition_merge(transition) { - if (transition._id !== this._id) throw new Error; - - for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Transition(merges, this._parents, this._name, this._id); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/on.js - - -function start(name) { - return (name + "").trim().split(/^|\s+/).every(function(t) { - var i = t.indexOf("."); - if (i >= 0) t = t.slice(0, i); - return !t || t === "start"; - }); -} - -function onFunction(id, name, listener) { - var on0, on1, sit = start(name) ? init : schedule_set; - return function() { - var schedule = sit(this, id), - on = schedule.on; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); - - schedule.on = on1; - }; -} - -/* harmony default export */ function transition_on(name, listener) { - var id = this._id; - - return arguments.length < 2 - ? schedule_get(this.node(), id).on.on(name) - : this.each(onFunction(id, name, listener)); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/remove.js -function removeFunction(id) { - return function() { - var parent = this.parentNode; - for (var i in this.__transition) if (+i !== id) return; - if (parent) parent.removeChild(this); - }; -} - -/* harmony default export */ function transition_remove() { - return this.on("end.remove", removeFunction(this._id)); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/select.js - - - - -/* harmony default export */ function transition_select(select) { - var name = this._name, - id = this._id; - - if (typeof select !== "function") select = selector(select); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - schedule(subgroup[i], name, id, i, subgroup, schedule_get(node, id)); - } - } - } - - return new Transition(subgroups, this._parents, name, id); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/selectAll.js - - - - -/* harmony default export */ function transition_selectAll(select) { - var name = this._name, - id = this._id; - - if (typeof select !== "function") select = selectorAll(select); - - for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - for (var children = select.call(node, node.__data__, i, group), child, inherit = schedule_get(node, id), k = 0, l = children.length; k < l; ++k) { - if (child = children[k]) { - schedule(child, name, id, k, children, inherit); - } - } - subgroups.push(children); - parents.push(node); - } - } - } - - return new Transition(subgroups, parents, name, id); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/selection.js - - -var selection_Selection = src_selection.prototype.constructor; - -/* harmony default export */ function transition_selection() { - return new selection_Selection(this._groups, this._parents); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/style.js - - - - - - -function styleNull(name, interpolate) { - var string00, - string10, - interpolate0; - return function() { - var string0 = styleValue(this, name), - string1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, string10 = string1); - }; -} - -function style_styleRemove(name) { - return function() { - this.style.removeProperty(name); - }; -} - -function style_styleConstant(name, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = styleValue(this, name); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; -} - -function style_styleFunction(name, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0 = styleValue(this, name), - value1 = value(this), - string1 = value1 + ""; - if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} - -function styleMaybeRemove(id, name) { - var on0, on1, listener0, key = "style." + name, event = "end." + key, remove; - return function() { - var schedule = schedule_set(this, id), - on = schedule.on, - listener = schedule.value[key] == null ? remove || (remove = style_styleRemove(name)) : undefined; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener); - - schedule.on = on1; - }; -} - -/* harmony default export */ function transition_style(name, value, priority) { - var i = (name += "") === "transform" ? interpolateTransformCss : interpolate; - return value == null ? this - .styleTween(name, styleNull(name, i)) - .on("end.style." + name, style_styleRemove(name)) - : typeof value === "function" ? this - .styleTween(name, style_styleFunction(name, i, tweenValue(this, "style." + name, value))) - .each(styleMaybeRemove(this._id, name)) - : this - .styleTween(name, style_styleConstant(name, i, value), priority) - .on("end.style." + name, null); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/styleTween.js -function styleInterpolate(name, i, priority) { - return function(t) { - this.style.setProperty(name, i.call(this, t), priority); - }; -} - -function styleTween(name, value, priority) { - var t, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); - return t; - } - tween._value = value; - return tween; -} - -/* harmony default export */ function transition_styleTween(name, value, priority) { - var key = "style." + (name += ""); - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - return this.tween(key, styleTween(name, value, priority == null ? "" : priority)); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/text.js - - -function text_textConstant(value) { - return function() { - this.textContent = value; - }; -} - -function text_textFunction(value) { - return function() { - var value1 = value(this); - this.textContent = value1 == null ? "" : value1; - }; -} - -/* harmony default export */ function transition_text(value) { - return this.tween("text", typeof value === "function" - ? text_textFunction(tweenValue(this, "text", value)) - : text_textConstant(value == null ? "" : value + "")); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/textTween.js -function textInterpolate(i) { - return function(t) { - this.textContent = i.call(this, t); - }; -} - -function textTween(value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && textInterpolate(i); - return t0; - } - tween._value = value; - return tween; -} - -/* harmony default export */ function transition_textTween(value) { - var key = "text"; - if (arguments.length < 1) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - return this.tween(key, textTween(value)); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/transition.js - - - -/* harmony default export */ function transition() { - var name = this._name, - id0 = this._id, - id1 = newId(); - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - var inherit = schedule_get(node, id0); - schedule(node, name, id1, i, group, { - time: inherit.time + inherit.delay + inherit.duration, - delay: 0, - duration: inherit.duration, - ease: inherit.ease - }); - } - } - } - - return new Transition(groups, this._parents, name, id1); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/end.js - - -/* harmony default export */ function end() { - var on0, on1, that = this, id = that._id, size = that.size(); - return new Promise(function(resolve, reject) { - var cancel = {value: reject}, - end = {value: function() { if (--size === 0) resolve(); }}; - - that.each(function() { - var schedule = schedule_set(this, id), - on = schedule.on; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0) { - on1 = (on0 = on).copy(); - on1._.cancel.push(cancel); - on1._.interrupt.push(cancel); - on1._.end.push(end); - } - - schedule.on = on1; - }); - - // The selection was empty, resolve end immediately - if (size === 0) resolve(); - }); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/index.js - - - - - - - - - - - - - - - - - - - - - - -var id = 0; - -function Transition(groups, parents, name, id) { - this._groups = groups; - this._parents = parents; - this._name = name; - this._id = id; -} - -function transition_transition(name) { - return src_selection().transition(name); -} - -function newId() { - return ++id; -} - -var selection_prototype = src_selection.prototype; - -Transition.prototype = transition_transition.prototype = { - constructor: Transition, - select: transition_select, - selectAll: transition_selectAll, - selectChild: selection_prototype.selectChild, - selectChildren: selection_prototype.selectChildren, - filter: transition_filter, - merge: transition_merge, - selection: transition_selection, - transition: transition, - call: selection_prototype.call, - nodes: selection_prototype.nodes, - node: selection_prototype.node, - size: selection_prototype.size, - empty: selection_prototype.empty, - each: selection_prototype.each, - on: transition_on, - attr: transition_attr, - attrTween: transition_attrTween, - style: transition_style, - styleTween: transition_styleTween, - text: transition_text, - textTween: transition_textTween, - remove: transition_remove, - tween: tween, - delay: delay, - duration: duration, - ease: ease, - easeVarying: transition_easeVarying, - end: end, - [Symbol.iterator]: selection_prototype[Symbol.iterator] -}; - -;// CONCATENATED MODULE: ../node_modules/d3-ease/src/cubic.js -function cubicIn(t) { - return t * t * t; -} - -function cubicOut(t) { - return --t * t * t + 1; -} - -function cubicInOut(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/transition.js - - - - - -var defaultTiming = { - time: null, // Set on use. - delay: 0, - duration: 250, - ease: cubicInOut -}; - -function inherit(node, id) { - var timing; - while (!(timing = node.__transition) || !(timing = timing[id])) { - if (!(node = node.parentNode)) { - throw new Error(`transition ${id} not found`); - } - } - return timing; -} - -/* harmony default export */ function selection_transition(name) { - var id, - timing; - - if (name instanceof Transition) { - id = name._id, name = name._name; - } else { - id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; - } - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - schedule(node, name, id, i, group, timing || inherit(node, id)); - } - } - } - - return new Transition(groups, this._parents, name, id); -} - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/index.js - - - - -src_selection.prototype.interrupt = selection_interrupt; -src_selection.prototype.transition = selection_transition; - -;// CONCATENATED MODULE: ../node_modules/d3-transition/src/index.js - - - - - -;// CONCATENATED MODULE: ./tooltip.js -/* global event */ - - - - - - -function defaultLabel (d) { - return d.data.name -} - -function defaultFlamegraphTooltip () { - var rootElement = src_select('body') - var tooltip = null - // Function to get HTML content from data. - var html = defaultLabel - // Function to get text content from data. - var text = defaultLabel - // Whether to use d3's .html() to set content, otherwise use .text(). - var contentIsHTML = false - - function tip () { - tooltip = rootElement - .append('div') - .style('display', 'none') - .style('position', 'absolute') - .style('opacity', 0) - .style('pointer-events', 'none') - .attr('class', 'd3-flame-graph-tip') - } - - tip.show = function (d) { - tooltip - .style('display', 'block') - .style('left', event.pageX + 5 + 'px') - .style('top', event.pageY + 5 + 'px') - .transition() - .duration(200) - .style('opacity', 1) - .style('pointer-events', 'all') - - if (contentIsHTML) { - tooltip.html(html(d)) - } else { - tooltip.text(text(d)) - } - - return tip - } - - tip.hide = function () { - tooltip - .style('display', 'none') - .transition() - .duration(200) - .style('opacity', 0) - .style('pointer-events', 'none') - - return tip - } - - /** - * Gets/sets a function converting the d3 data into the tooltip's textContent. - * - * Cannot be combined with tip.html(). - */ - tip.text = function (_) { - if (!arguments.length) return text - text = _ - contentIsHTML = false - return tip - } - - /** - * Gets/sets a function converting the d3 data into the tooltip's innerHTML. - * - * Cannot be combined with tip.text(). - * - * @deprecated prefer tip.text(). - */ - tip.html = function (_) { - if (!arguments.length) return html - html = _ - contentIsHTML = true - return tip - } - - tip.destroy = function () { - tooltip.remove() - } - - return tip -} - -/******/ return __webpack_exports__; -/******/ })() -; -}); \ No newline at end of file diff --git a/development/charts/flamegraph/lib/d3-flamegraph.css b/development/charts/flamegraph/lib/d3-flamegraph.css deleted file mode 100644 index fa6f345ff7a9..000000000000 --- a/development/charts/flamegraph/lib/d3-flamegraph.css +++ /dev/null @@ -1,46 +0,0 @@ -.d3-flame-graph rect { - stroke: #EEEEEE; - fill-opacity: .8; -} - -.d3-flame-graph rect:hover { - stroke: #474747; - stroke-width: 0.5; - cursor: pointer; -} - -.d3-flame-graph-label { - pointer-events: none; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - font-size: 12px; - font-family: Verdana; - margin-left: 4px; - margin-right: 4px; - line-height: 1.5; - padding: 0 0 0; - font-weight: 400; - color: black; - text-align: left; -} - -.d3-flame-graph .fade { - opacity: 0.6 !important; -} - -.d3-flame-graph .title { - font-size: 20px; - font-family: Verdana; -} - -.d3-flame-graph-tip { - background-color: black; - border: none; - border-radius: 3px; - padding: 5px 10px 5px 10px; - min-width: 250px; - text-align: left; - color: white; - z-index: 10; -} \ No newline at end of file diff --git a/development/charts/flamegraph/lib/d3-flamegraph.js b/development/charts/flamegraph/lib/d3-flamegraph.js deleted file mode 100644 index eabb2c44972c..000000000000 --- a/development/charts/flamegraph/lib/d3-flamegraph.js +++ /dev/null @@ -1,5719 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if (typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if (typeof define === 'function' && define.amd) define([], factory); - else if (typeof exports === 'object') exports['flamegraph'] = factory(); - else root['flamegraph'] = factory(); -})(self, function () { - return /******/ (() => { - // webpackBootstrap - /******/ 'use strict'; // The require scope - /******/ /******/ var __webpack_require__ = {}; /* webpack/runtime/define property getters */ - /******/ - /************************************************************************/ - /******/ /******/ (() => { - /******/ // define getter functions for harmony exports - /******/ __webpack_require__.d = (exports, definition) => { - /******/ for (var key in definition) { - /******/ if ( - __webpack_require__.o(definition, key) && - !__webpack_require__.o(exports, key) - ) { - /******/ Object.defineProperty(exports, key, { - enumerable: true, - get: definition[key], - }); - /******/ - } - /******/ - } - /******/ - }; - /******/ - })(); /* webpack/runtime/hasOwnProperty shorthand */ - /******/ - /******/ /******/ (() => { - /******/ __webpack_require__.o = (obj, prop) => - Object.prototype.hasOwnProperty.call(obj, prop); - /******/ - })(); - /******/ - /************************************************************************/ - var __webpack_exports__ = {}; - - // EXPORTS - __webpack_require__.d(__webpack_exports__, { - default: () => /* binding */ flamegraph, - }); // CONCATENATED MODULE: ../node_modules/d3-selection/src/selector.js - - function none() {} - - /* harmony default export */ function selector(selector) { - return selector == null - ? none - : function () { - return this.querySelector(selector); - }; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/select.js - - /* harmony default export */ function selection_select(select) { - if (typeof select !== 'function') select = selector(select); - - for ( - var groups = this._groups, - m = groups.length, - subgroups = new Array(m), - j = 0; - j < m; - ++j - ) { - for ( - var group = groups[j], - n = group.length, - subgroup = (subgroups[j] = new Array(n)), - node, - subnode, - i = 0; - i < n; - ++i - ) { - if ( - (node = group[i]) && - (subnode = select.call(node, node.__data__, i, group)) - ) { - if ('__data__' in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - } - } - } - - return new Selection(subgroups, this._parents); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/array.js - - // Given something array like (or null), returns something that is strictly an - // array. This is used to ensure that array-like objects passed to d3.selectAll - // or selection.selectAll are converted into proper arrays when creating a - // selection; we don’t ever want to create a selection backed by a live - // HTMLCollection or NodeList. However, note that selection.selectAll will use a - // static NodeList as a group, since it safely derived from querySelectorAll. - function array(x) { - return x == null ? [] : Array.isArray(x) ? x : Array.from(x); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selectorAll.js - - function empty() { - return []; - } - - /* harmony default export */ function selectorAll(selector) { - return selector == null - ? empty - : function () { - return this.querySelectorAll(selector); - }; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectAll.js - - function arrayAll(select) { - return function () { - return array(select.apply(this, arguments)); - }; - } - - /* harmony default export */ function selectAll(select) { - if (typeof select === 'function') select = arrayAll(select); - else select = selectorAll(select); - - for ( - var groups = this._groups, - m = groups.length, - subgroups = [], - parents = [], - j = 0; - j < m; - ++j - ) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if ((node = group[i])) { - subgroups.push(select.call(node, node.__data__, i, group)); - parents.push(node); - } - } - } - - return new Selection(subgroups, parents); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/matcher.js - - /* harmony default export */ function matcher(selector) { - return function () { - return this.matches(selector); - }; - } - - function childMatcher(selector) { - return function (node) { - return node.matches(selector); - }; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectChild.js - - var find = Array.prototype.find; - - function childFind(match) { - return function () { - return find.call(this.children, match); - }; - } - - function childFirst() { - return this.firstElementChild; - } - - /* harmony default export */ function selectChild(match) { - return this.select( - match == null - ? childFirst - : childFind( - typeof match === 'function' ? match : childMatcher(match), - ), - ); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/selectChildren.js - - var filter = Array.prototype.filter; - - function children() { - return Array.from(this.children); - } - - function childrenFilter(match) { - return function () { - return filter.call(this.children, match); - }; - } - - /* harmony default export */ function selectChildren(match) { - return this.selectAll( - match == null - ? children - : childrenFilter( - typeof match === 'function' ? match : childMatcher(match), - ), - ); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/filter.js - - /* harmony default export */ function selection_filter(match) { - if (typeof match !== 'function') match = matcher(match); - - for ( - var groups = this._groups, - m = groups.length, - subgroups = new Array(m), - j = 0; - j < m; - ++j - ) { - for ( - var group = groups[j], - n = group.length, - subgroup = (subgroups[j] = []), - node, - i = 0; - i < n; - ++i - ) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Selection(subgroups, this._parents); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/sparse.js - - /* harmony default export */ function sparse(update) { - return new Array(update.length); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/enter.js - - /* harmony default export */ function enter() { - return new Selection( - this._enter || this._groups.map(sparse), - this._parents, - ); - } - - function EnterNode(parent, datum) { - this.ownerDocument = parent.ownerDocument; - this.namespaceURI = parent.namespaceURI; - this._next = null; - this._parent = parent; - this.__data__ = datum; - } - - EnterNode.prototype = { - constructor: EnterNode, - appendChild: function (child) { - return this._parent.insertBefore(child, this._next); - }, - insertBefore: function (child, next) { - return this._parent.insertBefore(child, next); - }, - querySelector: function (selector) { - return this._parent.querySelector(selector); - }, - querySelectorAll: function (selector) { - return this._parent.querySelectorAll(selector); - }, - }; // CONCATENATED MODULE: ../node_modules/d3-selection/src/constant.js - - /* harmony default export */ function src_constant(x) { - return function () { - return x; - }; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/data.js - - function bindIndex(parent, group, enter, update, exit, data) { - var i = 0, - node, - groupLength = group.length, - dataLength = data.length; - - // Put any non-null nodes that fit into update. - // Put any null nodes into enter. - // Put any remaining data into enter. - for (; i < dataLength; ++i) { - if ((node = group[i])) { - node.__data__ = data[i]; - update[i] = node; - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - - // Put any non-null nodes that don’t fit into exit. - for (; i < groupLength; ++i) { - if ((node = group[i])) { - exit[i] = node; - } - } - } - - function bindKey(parent, group, enter, update, exit, data, key) { - var i, - node, - nodeByKeyValue = new Map(), - groupLength = group.length, - dataLength = data.length, - keyValues = new Array(groupLength), - keyValue; - - // Compute the key for each node. - // If multiple nodes have the same key, the duplicates are added to exit. - for (i = 0; i < groupLength; ++i) { - if ((node = group[i])) { - keyValues[i] = keyValue = - key.call(node, node.__data__, i, group) + ''; - if (nodeByKeyValue.has(keyValue)) { - exit[i] = node; - } else { - nodeByKeyValue.set(keyValue, node); - } - } - } - - // Compute the key for each datum. - // If there a node associated with this key, join and add it to update. - // If there is not (or the key is a duplicate), add it to enter. - for (i = 0; i < dataLength; ++i) { - keyValue = key.call(parent, data[i], i, data) + ''; - if ((node = nodeByKeyValue.get(keyValue))) { - update[i] = node; - node.__data__ = data[i]; - nodeByKeyValue.delete(keyValue); - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - - // Add any remaining nodes that were not bound to data to exit. - for (i = 0; i < groupLength; ++i) { - if ((node = group[i]) && nodeByKeyValue.get(keyValues[i]) === node) { - exit[i] = node; - } - } - } - - function datum(node) { - return node.__data__; - } - - /* harmony default export */ function data(value, key) { - if (!arguments.length) return Array.from(this, datum); - - var bind = key ? bindKey : bindIndex, - parents = this._parents, - groups = this._groups; - - if (typeof value !== 'function') value = src_constant(value); - - for ( - var m = groups.length, - update = new Array(m), - enter = new Array(m), - exit = new Array(m), - j = 0; - j < m; - ++j - ) { - var parent = parents[j], - group = groups[j], - groupLength = group.length, - data = arraylike( - value.call(parent, parent && parent.__data__, j, parents), - ), - dataLength = data.length, - enterGroup = (enter[j] = new Array(dataLength)), - updateGroup = (update[j] = new Array(dataLength)), - exitGroup = (exit[j] = new Array(groupLength)); - - bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); - - // Now connect the enter nodes to their following update node, such that - // appendChild can insert the materialized enter node before this node, - // rather than at the end of the parent node. - for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { - if ((previous = enterGroup[i0])) { - if (i0 >= i1) i1 = i0 + 1; - while (!(next = updateGroup[i1]) && ++i1 < dataLength); - previous._next = next || null; - } - } - } - - update = new Selection(update, parents); - update._enter = enter; - update._exit = exit; - return update; - } - - // Given some data, this returns an array-like view of it: an object that - // exposes a length property and allows numeric indexing. Note that unlike - // selectAll, this isn’t worried about “live” collections because the resulting - // array will only be used briefly while data is being bound. (It is possible to - // cause the data to change while iterating by using a key function, but please - // don’t; we’d rather avoid a gratuitous copy.) - function arraylike(data) { - return typeof data === 'object' && 'length' in data - ? data // Array, TypedArray, NodeList, array-like - : Array.from(data); // Map, Set, iterable, string, or anything else - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/exit.js - - /* harmony default export */ function exit() { - return new Selection( - this._exit || this._groups.map(sparse), - this._parents, - ); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/join.js - - /* harmony default export */ function join(onenter, onupdate, onexit) { - var enter = this.enter(), - update = this, - exit = this.exit(); - if (typeof onenter === 'function') { - enter = onenter(enter); - if (enter) enter = enter.selection(); - } else { - enter = enter.append(onenter + ''); - } - if (onupdate != null) { - update = onupdate(update); - if (update) update = update.selection(); - } - if (onexit == null) exit.remove(); - else onexit(exit); - return enter && update ? enter.merge(update).order() : update; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/merge.js - - /* harmony default export */ function merge(context) { - var selection = context.selection ? context.selection() : context; - - for ( - var groups0 = this._groups, - groups1 = selection._groups, - m0 = groups0.length, - m1 = groups1.length, - m = Math.min(m0, m1), - merges = new Array(m0), - j = 0; - j < m; - ++j - ) { - for ( - var group0 = groups0[j], - group1 = groups1[j], - n = group0.length, - merge = (merges[j] = new Array(n)), - node, - i = 0; - i < n; - ++i - ) { - if ((node = group0[i] || group1[i])) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Selection(merges, this._parents); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/order.js - - /* harmony default export */ function order() { - for (var groups = this._groups, j = -1, m = groups.length; ++j < m; ) { - for ( - var group = groups[j], i = group.length - 1, next = group[i], node; - --i >= 0; - - ) { - if ((node = group[i])) { - if (next && node.compareDocumentPosition(next) ^ 4) - next.parentNode.insertBefore(node, next); - next = node; - } - } - } - - return this; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/sort.js - - /* harmony default export */ function sort(compare) { - if (!compare) compare = ascending; - - function compareNode(a, b) { - return a && b ? compare(a.__data__, b.__data__) : !a - !b; - } - - for ( - var groups = this._groups, - m = groups.length, - sortgroups = new Array(m), - j = 0; - j < m; - ++j - ) { - for ( - var group = groups[j], - n = group.length, - sortgroup = (sortgroups[j] = new Array(n)), - node, - i = 0; - i < n; - ++i - ) { - if ((node = group[i])) { - sortgroup[i] = node; - } - } - sortgroup.sort(compareNode); - } - - return new Selection(sortgroups, this._parents).order(); - } - - function ascending(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/call.js - - /* harmony default export */ function call() { - var callback = arguments[0]; - arguments[0] = this; - callback.apply(null, arguments); - return this; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/nodes.js - - /* harmony default export */ function nodes() { - return Array.from(this); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/node.js - - /* harmony default export */ function node() { - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { - var node = group[i]; - if (node) return node; - } - } - - return null; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/size.js - - /* harmony default export */ function size() { - let size = 0; - for (const node of this) ++size; // eslint-disable-line no-unused-vars - return size; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/empty.js - - /* harmony default export */ function selection_empty() { - return !this.node(); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/each.js - - /* harmony default export */ function each(callback) { - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { - if ((node = group[i])) callback.call(node, node.__data__, i, group); - } - } - - return this; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/namespaces.js - - var xhtml = 'http://www.w3.org/1999/xhtml'; - - /* harmony default export */ const namespaces = { - svg: 'http://www.w3.org/2000/svg', - xhtml: xhtml, - xlink: 'http://www.w3.org/1999/xlink', - xml: 'http://www.w3.org/XML/1998/namespace', - xmlns: 'http://www.w3.org/2000/xmlns/', - }; // CONCATENATED MODULE: ../node_modules/d3-selection/src/namespace.js - - /* harmony default export */ function namespace(name) { - var prefix = (name += ''), - i = prefix.indexOf(':'); - if (i >= 0 && (prefix = name.slice(0, i)) !== 'xmlns') - name = name.slice(i + 1); - return namespaces.hasOwnProperty(prefix) - ? { space: namespaces[prefix], local: name } - : name; // eslint-disable-line no-prototype-builtins - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/attr.js - - function attrRemove(name) { - return function () { - this.removeAttribute(name); - }; - } - - function attrRemoveNS(fullname) { - return function () { - this.removeAttributeNS(fullname.space, fullname.local); - }; - } - - function attrConstant(name, value) { - return function () { - this.setAttribute(name, value); - }; - } - - function attrConstantNS(fullname, value) { - return function () { - this.setAttributeNS(fullname.space, fullname.local, value); - }; - } - - function attrFunction(name, value) { - return function () { - var v = value.apply(this, arguments); - if (v == null) this.removeAttribute(name); - else this.setAttribute(name, v); - }; - } - - function attrFunctionNS(fullname, value) { - return function () { - var v = value.apply(this, arguments); - if (v == null) this.removeAttributeNS(fullname.space, fullname.local); - else this.setAttributeNS(fullname.space, fullname.local, v); - }; - } - - /* harmony default export */ function attr(name, value) { - var fullname = namespace(name); - - if (arguments.length < 2) { - var node = this.node(); - return fullname.local - ? node.getAttributeNS(fullname.space, fullname.local) - : node.getAttribute(fullname); - } - - return this.each( - (value == null - ? fullname.local - ? attrRemoveNS - : attrRemove - : typeof value === 'function' - ? fullname.local - ? attrFunctionNS - : attrFunction - : fullname.local - ? attrConstantNS - : attrConstant)(fullname, value), - ); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/window.js - - /* harmony default export */ function src_window(node) { - return ( - (node.ownerDocument && node.ownerDocument.defaultView) || // node is a Node - (node.document && node) || // node is a Window - node.defaultView - ); // node is a Document - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/style.js - - function styleRemove(name) { - return function () { - this.style.removeProperty(name); - }; - } - - function styleConstant(name, value, priority) { - return function () { - this.style.setProperty(name, value, priority); - }; - } - - function styleFunction(name, value, priority) { - return function () { - var v = value.apply(this, arguments); - if (v == null) this.style.removeProperty(name); - else this.style.setProperty(name, v, priority); - }; - } - - /* harmony default export */ function style(name, value, priority) { - return arguments.length > 1 - ? this.each( - (value == null - ? styleRemove - : typeof value === 'function' - ? styleFunction - : styleConstant)(name, value, priority == null ? '' : priority), - ) - : styleValue(this.node(), name); - } - - function styleValue(node, name) { - return ( - node.style.getPropertyValue(name) || - src_window(node).getComputedStyle(node, null).getPropertyValue(name) - ); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/property.js - - function propertyRemove(name) { - return function () { - delete this[name]; - }; - } - - function propertyConstant(name, value) { - return function () { - this[name] = value; - }; - } - - function propertyFunction(name, value) { - return function () { - var v = value.apply(this, arguments); - if (v == null) delete this[name]; - else this[name] = v; - }; - } - - /* harmony default export */ function property(name, value) { - return arguments.length > 1 - ? this.each( - (value == null - ? propertyRemove - : typeof value === 'function' - ? propertyFunction - : propertyConstant)(name, value), - ) - : this.node()[name]; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/classed.js - - function classArray(string) { - return string.trim().split(/^|\s+/); - } - - function classList(node) { - return node.classList || new ClassList(node); - } - - function ClassList(node) { - this._node = node; - this._names = classArray(node.getAttribute('class') || ''); - } - - ClassList.prototype = { - add: function (name) { - var i = this._names.indexOf(name); - if (i < 0) { - this._names.push(name); - this._node.setAttribute('class', this._names.join(' ')); - } - }, - remove: function (name) { - var i = this._names.indexOf(name); - if (i >= 0) { - this._names.splice(i, 1); - this._node.setAttribute('class', this._names.join(' ')); - } - }, - contains: function (name) { - return this._names.indexOf(name) >= 0; - }, - }; - - function classedAdd(node, names) { - var list = classList(node), - i = -1, - n = names.length; - while (++i < n) list.add(names[i]); - } - - function classedRemove(node, names) { - var list = classList(node), - i = -1, - n = names.length; - while (++i < n) list.remove(names[i]); - } - - function classedTrue(names) { - return function () { - classedAdd(this, names); - }; - } - - function classedFalse(names) { - return function () { - classedRemove(this, names); - }; - } - - function classedFunction(names, value) { - return function () { - (value.apply(this, arguments) ? classedAdd : classedRemove)( - this, - names, - ); - }; - } - - /* harmony default export */ function classed(name, value) { - var names = classArray(name + ''); - - if (arguments.length < 2) { - var list = classList(this.node()), - i = -1, - n = names.length; - while (++i < n) if (!list.contains(names[i])) return false; - return true; - } - - return this.each( - (typeof value === 'function' - ? classedFunction - : value - ? classedTrue - : classedFalse)(names, value), - ); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/text.js - - function textRemove() { - this.textContent = ''; - } - - function textConstant(value) { - return function () { - this.textContent = value; - }; - } - - function textFunction(value) { - return function () { - var v = value.apply(this, arguments); - this.textContent = v == null ? '' : v; - }; - } - - /* harmony default export */ function selection_text(value) { - return arguments.length - ? this.each( - value == null - ? textRemove - : (typeof value === 'function' ? textFunction : textConstant)( - value, - ), - ) - : this.node().textContent; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/html.js - - function htmlRemove() { - this.innerHTML = ''; - } - - function htmlConstant(value) { - return function () { - this.innerHTML = value; - }; - } - - function htmlFunction(value) { - return function () { - var v = value.apply(this, arguments); - this.innerHTML = v == null ? '' : v; - }; - } - - /* harmony default export */ function html(value) { - return arguments.length - ? this.each( - value == null - ? htmlRemove - : (typeof value === 'function' ? htmlFunction : htmlConstant)( - value, - ), - ) - : this.node().innerHTML; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/raise.js - - function raise() { - if (this.nextSibling) this.parentNode.appendChild(this); - } - - /* harmony default export */ function selection_raise() { - return this.each(raise); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/lower.js - - function lower() { - if (this.previousSibling) - this.parentNode.insertBefore(this, this.parentNode.firstChild); - } - - /* harmony default export */ function selection_lower() { - return this.each(lower); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/creator.js - - function creatorInherit(name) { - return function () { - var document = this.ownerDocument, - uri = this.namespaceURI; - return uri === xhtml && document.documentElement.namespaceURI === xhtml - ? document.createElement(name) - : document.createElementNS(uri, name); - }; - } - - function creatorFixed(fullname) { - return function () { - return this.ownerDocument.createElementNS( - fullname.space, - fullname.local, - ); - }; - } - - /* harmony default export */ function creator(name) { - var fullname = namespace(name); - return (fullname.local ? creatorFixed : creatorInherit)(fullname); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/append.js - - /* harmony default export */ function append(name) { - var create = typeof name === 'function' ? name : creator(name); - return this.select(function () { - return this.appendChild(create.apply(this, arguments)); - }); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/insert.js - - function constantNull() { - return null; - } - - /* harmony default export */ function insert(name, before) { - var create = typeof name === 'function' ? name : creator(name), - select = - before == null - ? constantNull - : typeof before === 'function' - ? before - : selector(before); - return this.select(function () { - return this.insertBefore( - create.apply(this, arguments), - select.apply(this, arguments) || null, - ); - }); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/remove.js - - function remove() { - var parent = this.parentNode; - if (parent) parent.removeChild(this); - } - - /* harmony default export */ function selection_remove() { - return this.each(remove); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/clone.js - - function selection_cloneShallow() { - var clone = this.cloneNode(false), - parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; - } - - function selection_cloneDeep() { - var clone = this.cloneNode(true), - parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; - } - - /* harmony default export */ function clone(deep) { - return this.select(deep ? selection_cloneDeep : selection_cloneShallow); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/datum.js - - /* harmony default export */ function selection_datum(value) { - return arguments.length - ? this.property('__data__', value) - : this.node().__data__; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/on.js - - function contextListener(listener) { - return function (event) { - listener.call(this, event, this.__data__); - }; - } - - function parseTypenames(typenames) { - return typenames - .trim() - .split(/^|\s+/) - .map(function (t) { - var name = '', - i = t.indexOf('.'); - if (i >= 0) (name = t.slice(i + 1)), (t = t.slice(0, i)); - return { type: t, name: name }; - }); - } - - function onRemove(typename) { - return function () { - var on = this.__on; - if (!on) return; - for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { - if ( - ((o = on[j]), - (!typename.type || o.type === typename.type) && - o.name === typename.name) - ) { - this.removeEventListener(o.type, o.listener, o.options); - } else { - on[++i] = o; - } - } - if (++i) on.length = i; - else delete this.__on; - }; - } - - function onAdd(typename, value, options) { - return function () { - var on = this.__on, - o, - listener = contextListener(value); - if (on) - for (var j = 0, m = on.length; j < m; ++j) { - if ( - (o = on[j]).type === typename.type && - o.name === typename.name - ) { - this.removeEventListener(o.type, o.listener, o.options); - this.addEventListener( - o.type, - (o.listener = listener), - (o.options = options), - ); - o.value = value; - return; - } - } - this.addEventListener(typename.type, listener, options); - o = { - type: typename.type, - name: typename.name, - value: value, - listener: listener, - options: options, - }; - if (!on) this.__on = [o]; - else on.push(o); - }; - } - - /* harmony default export */ function on(typename, value, options) { - var typenames = parseTypenames(typename + ''), - i, - n = typenames.length, - t; - - if (arguments.length < 2) { - var on = this.node().__on; - if (on) - for (var j = 0, m = on.length, o; j < m; ++j) { - for (i = 0, o = on[j]; i < n; ++i) { - if ((t = typenames[i]).type === o.type && t.name === o.name) { - return o.value; - } - } - } - return; - } - - on = value ? onAdd : onRemove; - for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options)); - return this; - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/dispatch.js - - function dispatchEvent(node, type, params) { - var window = src_window(node), - event = window.CustomEvent; - - if (typeof event === 'function') { - event = new event(type, params); - } else { - event = window.document.createEvent('Event'); - if (params) - event.initEvent(type, params.bubbles, params.cancelable), - (event.detail = params.detail); - else event.initEvent(type, false, false); - } - - node.dispatchEvent(event); - } - - function dispatchConstant(type, params) { - return function () { - return dispatchEvent(this, type, params); - }; - } - - function dispatchFunction(type, params) { - return function () { - return dispatchEvent(this, type, params.apply(this, arguments)); - }; - } - - /* harmony default export */ function dispatch(type, params) { - return this.each( - (typeof params === 'function' ? dispatchFunction : dispatchConstant)( - type, - params, - ), - ); - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/iterator.js - - /* harmony default export */ function* iterator() { - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { - if ((node = group[i])) yield node; - } - } - } // CONCATENATED MODULE: ../node_modules/d3-selection/src/selection/index.js - - var root = [null]; - - function Selection(groups, parents) { - this._groups = groups; - this._parents = parents; - } - - function selection() { - return new Selection([[document.documentElement]], root); - } - - function selection_selection() { - return this; - } - - Selection.prototype = selection.prototype = { - constructor: Selection, - select: selection_select, - selectAll: selectAll, - selectChild: selectChild, - selectChildren: selectChildren, - filter: selection_filter, - data: data, - enter: enter, - exit: exit, - join: join, - merge: merge, - selection: selection_selection, - order: order, - sort: sort, - call: call, - nodes: nodes, - node: node, - size: size, - empty: selection_empty, - each: each, - attr: attr, - style: style, - property: property, - classed: classed, - text: selection_text, - html: html, - raise: selection_raise, - lower: selection_lower, - append: append, - insert: insert, - remove: selection_remove, - clone: clone, - datum: selection_datum, - on: on, - dispatch: dispatch, - [Symbol.iterator]: iterator, - }; - - /* harmony default export */ const src_selection = selection; // CONCATENATED MODULE: ../node_modules/d3-selection/src/select.js - - /* harmony default export */ function src_select(selector) { - return typeof selector === 'string' - ? new Selection( - [[document.querySelector(selector)]], - [document.documentElement], - ) - : new Selection([[selector]], root); - } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatDecimal.js - - /* harmony default export */ function formatDecimal(x) { - return Math.abs((x = Math.round(x))) >= 1e21 - ? x.toLocaleString('en').replace(/,/g, '') - : x.toString(10); - } - - // Computes the decimal coefficient and exponent of the specified number x with - // significant digits p, where x is positive and p is in [1, 21] or undefined. - // For example, formatDecimalParts(1.23) returns ["123", 0]. - function formatDecimalParts(x, p) { - if ( - (i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf( - 'e', - )) < 0 - ) - return null; // NaN, ±Infinity - var i, - coefficient = x.slice(0, i); - - // The string returned by toExponential either has the form \d\.\d+e[-+]\d+ - // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). - return [ - coefficient.length > 1 - ? coefficient[0] + coefficient.slice(2) - : coefficient, - +x.slice(i + 1), - ]; - } // CONCATENATED MODULE: ../node_modules/d3-format/src/exponent.js - - /* harmony default export */ function exponent(x) { - return (x = formatDecimalParts(Math.abs(x))), x ? x[1] : NaN; - } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatGroup.js - - /* harmony default export */ function formatGroup(grouping, thousands) { - return function (value, width) { - var i = value.length, - t = [], - j = 0, - g = grouping[0], - length = 0; - - while (i > 0 && g > 0) { - if (length + g + 1 > width) g = Math.max(1, width - length); - t.push(value.substring((i -= g), i + g)); - if ((length += g + 1) > width) break; - g = grouping[(j = (j + 1) % grouping.length)]; - } - - return t.reverse().join(thousands); - }; - } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatNumerals.js - - /* harmony default export */ function formatNumerals(numerals) { - return function (value) { - return value.replace(/[0-9]/g, function (i) { - return numerals[+i]; - }); - }; - } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatSpecifier.js - - // [[fill]align][sign][symbol][0][width][,][.precision][~][type] - var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; - - function formatSpecifier(specifier) { - if (!(match = re.exec(specifier))) - throw new Error('invalid format: ' + specifier); - var match; - return new FormatSpecifier({ - fill: match[1], - align: match[2], - sign: match[3], - symbol: match[4], - zero: match[5], - width: match[6], - comma: match[7], - precision: match[8] && match[8].slice(1), - trim: match[9], - type: match[10], - }); - } - - formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof - - function FormatSpecifier(specifier) { - this.fill = specifier.fill === undefined ? ' ' : specifier.fill + ''; - this.align = specifier.align === undefined ? '>' : specifier.align + ''; - this.sign = specifier.sign === undefined ? '-' : specifier.sign + ''; - this.symbol = specifier.symbol === undefined ? '' : specifier.symbol + ''; - this.zero = !!specifier.zero; - this.width = specifier.width === undefined ? undefined : +specifier.width; - this.comma = !!specifier.comma; - this.precision = - specifier.precision === undefined ? undefined : +specifier.precision; - this.trim = !!specifier.trim; - this.type = specifier.type === undefined ? '' : specifier.type + ''; - } - - FormatSpecifier.prototype.toString = function () { - return ( - this.fill + - this.align + - this.sign + - this.symbol + - (this.zero ? '0' : '') + - (this.width === undefined ? '' : Math.max(1, this.width | 0)) + - (this.comma ? ',' : '') + - (this.precision === undefined - ? '' - : '.' + Math.max(0, this.precision | 0)) + - (this.trim ? '~' : '') + - this.type - ); - }; // CONCATENATED MODULE: ../node_modules/d3-format/src/formatTrim.js - - // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. - /* harmony default export */ function formatTrim(s) { - out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) { - switch (s[i]) { - case '.': - i0 = i1 = i; - break; - case '0': - if (i0 === 0) i0 = i; - i1 = i; - break; - default: - if (!+s[i]) break out; - if (i0 > 0) i0 = 0; - break; - } - } - return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; - } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatPrefixAuto.js - - var prefixExponent; - - /* harmony default export */ function formatPrefixAuto(x, p) { - var d = formatDecimalParts(x, p); - if (!d) return x + ''; - var coefficient = d[0], - exponent = d[1], - i = - exponent - - (prefixExponent = - Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + - 1, - n = coefficient.length; - return i === n - ? coefficient - : i > n - ? coefficient + new Array(i - n + 1).join('0') - : i > 0 - ? coefficient.slice(0, i) + '.' + coefficient.slice(i) - : '0.' + - new Array(1 - i).join('0') + - formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y! - } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatRounded.js - - /* harmony default export */ function formatRounded(x, p) { - var d = formatDecimalParts(x, p); - if (!d) return x + ''; - var coefficient = d[0], - exponent = d[1]; - return exponent < 0 - ? '0.' + new Array(-exponent).join('0') + coefficient - : coefficient.length > exponent + 1 - ? coefficient.slice(0, exponent + 1) + - '.' + - coefficient.slice(exponent + 1) - : coefficient + new Array(exponent - coefficient.length + 2).join('0'); - } // CONCATENATED MODULE: ../node_modules/d3-format/src/formatTypes.js - - /* harmony default export */ const formatTypes = { - '%': (x, p) => (x * 100).toFixed(p), - b: (x) => Math.round(x).toString(2), - c: (x) => x + '', - d: formatDecimal, - e: (x, p) => x.toExponential(p), - f: (x, p) => x.toFixed(p), - g: (x, p) => x.toPrecision(p), - o: (x) => Math.round(x).toString(8), - p: (x, p) => formatRounded(x * 100, p), - r: formatRounded, - s: formatPrefixAuto, - X: (x) => Math.round(x).toString(16).toUpperCase(), - x: (x) => Math.round(x).toString(16), - }; // CONCATENATED MODULE: ../node_modules/d3-format/src/identity.js - - /* harmony default export */ function identity(x) { - return x; - } // CONCATENATED MODULE: ../node_modules/d3-format/src/locale.js - - var map = Array.prototype.map, - prefixes = [ - 'y', - 'z', - 'a', - 'f', - 'p', - 'n', - 'µ', - 'm', - '', - 'k', - 'M', - 'G', - 'T', - 'P', - 'E', - 'Z', - 'Y', - ]; - - /* harmony default export */ function locale(locale) { - var group = - locale.grouping === undefined || locale.thousands === undefined - ? identity - : formatGroup( - map.call(locale.grouping, Number), - locale.thousands + '', - ), - currencyPrefix = - locale.currency === undefined ? '' : locale.currency[0] + '', - currencySuffix = - locale.currency === undefined ? '' : locale.currency[1] + '', - decimal = locale.decimal === undefined ? '.' : locale.decimal + '', - numerals = - locale.numerals === undefined - ? identity - : formatNumerals(map.call(locale.numerals, String)), - percent = locale.percent === undefined ? '%' : locale.percent + '', - minus = locale.minus === undefined ? '−' : locale.minus + '', - nan = locale.nan === undefined ? 'NaN' : locale.nan + ''; - - function newFormat(specifier) { - specifier = formatSpecifier(specifier); - - var fill = specifier.fill, - align = specifier.align, - sign = specifier.sign, - symbol = specifier.symbol, - zero = specifier.zero, - width = specifier.width, - comma = specifier.comma, - precision = specifier.precision, - trim = specifier.trim, - type = specifier.type; - - // The "n" type is an alias for ",g". - if (type === 'n') (comma = true), (type = 'g'); - // The "" type, and any invalid type, is an alias for ".12~g". - else if (!formatTypes[type]) - precision === undefined && (precision = 12), - (trim = true), - (type = 'g'); - - // If zero fill is specified, padding goes after sign and before digits. - if (zero || (fill === '0' && align === '=')) - (zero = true), (fill = '0'), (align = '='); - - // Compute the prefix and suffix. - // For SI-prefix, the suffix is lazily computed. - var prefix = - symbol === '$' - ? currencyPrefix - : symbol === '#' && /[boxX]/.test(type) - ? '0' + type.toLowerCase() - : '', - suffix = - symbol === '$' ? currencySuffix : /[%p]/.test(type) ? percent : ''; - - // What format function should we use? - // Is this an integer type? - // Can this type generate exponential notation? - var formatType = formatTypes[type], - maybeSuffix = /[defgprs%]/.test(type); - - // Set the default precision if not specified, - // or clamp the specified precision to the supported range. - // For significant precision, it must be in [1, 21]. - // For fixed precision, it must be in [0, 20]. - precision = - precision === undefined - ? 6 - : /[gprs]/.test(type) - ? Math.max(1, Math.min(21, precision)) - : Math.max(0, Math.min(20, precision)); - - function format(value) { - var valuePrefix = prefix, - valueSuffix = suffix, - i, - n, - c; - - if (type === 'c') { - valueSuffix = formatType(value) + valueSuffix; - value = ''; - } else { - value = +value; - - // Determine the sign. -0 is not less than 0, but 1 / -0 is! - var valueNegative = value < 0 || 1 / value < 0; - - // Perform the initial formatting. - value = isNaN(value) ? nan : formatType(Math.abs(value), precision); - - // Trim insignificant zeros. - if (trim) value = formatTrim(value); - - // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign. - if (valueNegative && +value === 0 && sign !== '+') - valueNegative = false; - - // Compute the prefix and suffix. - valuePrefix = - (valueNegative - ? sign === '(' - ? sign - : minus - : sign === '-' || sign === '(' - ? '' - : sign) + valuePrefix; - valueSuffix = - (type === 's' ? prefixes[8 + prefixExponent / 3] : '') + - valueSuffix + - (valueNegative && sign === '(' ? ')' : ''); - - // Break the formatted value into the integer “value” part that can be - // grouped, and fractional or exponential “suffix” part that is not. - if (maybeSuffix) { - (i = -1), (n = value.length); - while (++i < n) { - if (((c = value.charCodeAt(i)), 48 > c || c > 57)) { - valueSuffix = - (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + - valueSuffix; - value = value.slice(0, i); - break; - } - } - } - } - - // If the fill character is not "0", grouping is applied before padding. - if (comma && !zero) value = group(value, Infinity); - - // Compute the padding. - var length = valuePrefix.length + value.length + valueSuffix.length, - padding = - length < width ? new Array(width - length + 1).join(fill) : ''; - - // If the fill character is "0", grouping is applied after padding. - if (comma && zero) - (value = group( - padding + value, - padding.length ? width - valueSuffix.length : Infinity, - )), - (padding = ''); - - // Reconstruct the final output based on the desired alignment. - switch (align) { - case '<': - value = valuePrefix + value + valueSuffix + padding; - break; - case '=': - value = valuePrefix + padding + value + valueSuffix; - break; - case '^': - value = - padding.slice(0, (length = padding.length >> 1)) + - valuePrefix + - value + - valueSuffix + - padding.slice(length); - break; - default: - value = padding + valuePrefix + value + valueSuffix; - break; - } - - return numerals(value); - } - - format.toString = function () { - return specifier + ''; - }; - - return format; - } - - function formatPrefix(specifier, value) { - var f = newFormat( - ((specifier = formatSpecifier(specifier)), - (specifier.type = 'f'), - specifier), - ), - e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, - k = Math.pow(10, -e), - prefix = prefixes[8 + e / 3]; - return function (value) { - return f(k * value) + prefix; - }; - } - - return { - format: newFormat, - formatPrefix: formatPrefix, - }; - } // CONCATENATED MODULE: ../node_modules/d3-format/src/defaultLocale.js - - var defaultLocale_locale; - var format; - var formatPrefix; - - defaultLocale({ - thousands: ',', - grouping: [3], - currency: ['$', ''], - }); - - function defaultLocale(definition) { - defaultLocale_locale = locale(definition); - format = defaultLocale_locale.format; - formatPrefix = defaultLocale_locale.formatPrefix; - return defaultLocale_locale; - } // CONCATENATED MODULE: ../node_modules/d3-array/src/ascending.js - - function ascending_ascending(a, b) { - return a == null || b == null - ? NaN - : a < b - ? -1 - : a > b - ? 1 - : a >= b - ? 0 - : NaN; - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/treemap/round.js - - /* harmony default export */ function treemap_round(node) { - node.x0 = Math.round(node.x0); - node.y0 = Math.round(node.y0); - node.x1 = Math.round(node.x1); - node.y1 = Math.round(node.y1); - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/treemap/dice.js - - /* harmony default export */ function dice(parent, x0, y0, x1, y1) { - var nodes = parent.children, - node, - i = -1, - n = nodes.length, - k = parent.value && (x1 - x0) / parent.value; - - while (++i < n) { - (node = nodes[i]), (node.y0 = y0), (node.y1 = y1); - (node.x0 = x0), (node.x1 = x0 += node.value * k); - } - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/partition.js - - /* harmony default export */ function partition() { - var dx = 1, - dy = 1, - padding = 0, - round = false; - - function partition(root) { - var n = root.height + 1; - root.x0 = root.y0 = padding; - root.x1 = dx; - root.y1 = dy / n; - root.eachBefore(positionNode(dy, n)); - if (round) root.eachBefore(treemap_round); - return root; - } - - function positionNode(dy, n) { - return function (node) { - if (node.children) { - dice( - node, - node.x0, - (dy * (node.depth + 1)) / n, - node.x1, - (dy * (node.depth + 2)) / n, - ); - } - var x0 = node.x0, - y0 = node.y0, - x1 = node.x1 - padding, - y1 = node.y1 - padding; - if (x1 < x0) x0 = x1 = (x0 + x1) / 2; - if (y1 < y0) y0 = y1 = (y0 + y1) / 2; - node.x0 = x0; - node.y0 = y0; - node.x1 = x1; - node.y1 = y1; - }; - } - - partition.round = function (x) { - return arguments.length ? ((round = !!x), partition) : round; - }; - - partition.size = function (x) { - return arguments.length - ? ((dx = +x[0]), (dy = +x[1]), partition) - : [dx, dy]; - }; - - partition.padding = function (x) { - return arguments.length ? ((padding = +x), partition) : padding; - }; - - return partition; - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/count.js - - function count(node) { - var sum = 0, - children = node.children, - i = children && children.length; - if (!i) sum = 1; - else while (--i >= 0) sum += children[i].value; - node.value = sum; - } - - /* harmony default export */ function hierarchy_count() { - return this.eachAfter(count); - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/each.js - - /* harmony default export */ function hierarchy_each(callback, that) { - let index = -1; - for (const node of this) { - callback.call(that, node, ++index, this); - } - return this; - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js - - /* harmony default export */ function eachBefore(callback, that) { - var node = this, - nodes = [node], - children, - i, - index = -1; - while ((node = nodes.pop())) { - callback.call(that, node, ++index, this); - if ((children = node.children)) { - for (i = children.length - 1; i >= 0; --i) { - nodes.push(children[i]); - } - } - } - return this; - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js - - /* harmony default export */ function eachAfter(callback, that) { - var node = this, - nodes = [node], - next = [], - children, - i, - n, - index = -1; - while ((node = nodes.pop())) { - next.push(node); - if ((children = node.children)) { - for (i = 0, n = children.length; i < n; ++i) { - nodes.push(children[i]); - } - } - } - while ((node = next.pop())) { - callback.call(that, node, ++index, this); - } - return this; - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/find.js - - /* harmony default export */ function hierarchy_find(callback, that) { - let index = -1; - for (const node of this) { - if (callback.call(that, node, ++index, this)) { - return node; - } - } - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/sum.js - - /* harmony default export */ function sum(value) { - return this.eachAfter(function (node) { - var sum = +value(node.data) || 0, - children = node.children, - i = children && children.length; - while (--i >= 0) sum += children[i].value; - node.value = sum; - }); - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/sort.js - - /* harmony default export */ function hierarchy_sort(compare) { - return this.eachBefore(function (node) { - if (node.children) { - node.children.sort(compare); - } - }); - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/path.js - - /* harmony default export */ function path(end) { - var start = this, - ancestor = leastCommonAncestor(start, end), - nodes = [start]; - while (start !== ancestor) { - start = start.parent; - nodes.push(start); - } - var k = nodes.length; - while (end !== ancestor) { - nodes.splice(k, 0, end); - end = end.parent; - } - return nodes; - } - - function leastCommonAncestor(a, b) { - if (a === b) return a; - var aNodes = a.ancestors(), - bNodes = b.ancestors(), - c = null; - a = aNodes.pop(); - b = bNodes.pop(); - while (a === b) { - c = a; - a = aNodes.pop(); - b = bNodes.pop(); - } - return c; - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/ancestors.js - - /* harmony default export */ function ancestors() { - var node = this, - nodes = [node]; - while ((node = node.parent)) { - nodes.push(node); - } - return nodes; - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/descendants.js - - /* harmony default export */ function descendants() { - return Array.from(this); - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/leaves.js - - /* harmony default export */ function leaves() { - var leaves = []; - this.eachBefore(function (node) { - if (!node.children) { - leaves.push(node); - } - }); - return leaves; - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/links.js - - /* harmony default export */ function links() { - var root = this, - links = []; - root.each(function (node) { - if (node !== root) { - // Don’t include the root’s parent, if any. - links.push({ source: node.parent, target: node }); - } - }); - return links; - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/iterator.js - - /* harmony default export */ function* hierarchy_iterator() { - var node = this, - current, - next = [node], - children, - i, - n; - do { - (current = next.reverse()), (next = []); - while ((node = current.pop())) { - yield node; - if ((children = node.children)) { - for (i = 0, n = children.length; i < n; ++i) { - next.push(children[i]); - } - } - } - } while (next.length); - } // CONCATENATED MODULE: ../node_modules/d3-hierarchy/src/hierarchy/index.js - - function hierarchy(data, children) { - if (data instanceof Map) { - data = [undefined, data]; - if (children === undefined) children = mapChildren; - } else if (children === undefined) { - children = objectChildren; - } - - var root = new Node(data), - node, - nodes = [root], - child, - childs, - i, - n; - - while ((node = nodes.pop())) { - if ( - (childs = children(node.data)) && - (n = (childs = Array.from(childs)).length) - ) { - node.children = childs; - for (i = n - 1; i >= 0; --i) { - nodes.push((child = childs[i] = new Node(childs[i]))); - child.parent = node; - child.depth = node.depth + 1; - } - } - } - - return root.eachBefore(computeHeight); - } - - function node_copy() { - return hierarchy(this).eachBefore(copyData); - } - - function objectChildren(d) { - return d.children; - } - - function mapChildren(d) { - return Array.isArray(d) ? d[1] : null; - } - - function copyData(node) { - if (node.data.value !== undefined) node.value = node.data.value; - node.data = node.data.data; - } - - function computeHeight(node) { - var height = 0; - do node.height = height; - while ((node = node.parent) && node.height < ++height); - } - - function Node(data) { - this.data = data; - this.depth = this.height = 0; - this.parent = null; - } - - Node.prototype = hierarchy.prototype = { - constructor: Node, - count: hierarchy_count, - each: hierarchy_each, - eachAfter: eachAfter, - eachBefore: eachBefore, - find: hierarchy_find, - sum: sum, - sort: hierarchy_sort, - path: path, - ancestors: ancestors, - descendants: descendants, - leaves: leaves, - links: links, - copy: node_copy, - [Symbol.iterator]: hierarchy_iterator, - }; // CONCATENATED MODULE: ../node_modules/d3-array/src/ticks.js - - var e10 = Math.sqrt(50), - e5 = Math.sqrt(10), - e2 = Math.sqrt(2); - - function ticks(start, stop, count) { - var reverse, - i = -1, - n, - ticks, - step; - - (stop = +stop), (start = +start), (count = +count); - if (start === stop && count > 0) return [start]; - if ((reverse = stop < start)) (n = start), (start = stop), (stop = n); - if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) - return []; - - if (step > 0) { - let r0 = Math.round(start / step), - r1 = Math.round(stop / step); - if (r0 * step < start) ++r0; - if (r1 * step > stop) --r1; - ticks = new Array((n = r1 - r0 + 1)); - while (++i < n) ticks[i] = (r0 + i) * step; - } else { - step = -step; - let r0 = Math.round(start * step), - r1 = Math.round(stop * step); - if (r0 / step < start) ++r0; - if (r1 / step > stop) --r1; - ticks = new Array((n = r1 - r0 + 1)); - while (++i < n) ticks[i] = (r0 + i) / step; - } - - if (reverse) ticks.reverse(); - - return ticks; - } - - function tickIncrement(start, stop, count) { - var step = (stop - start) / Math.max(0, count), - power = Math.floor(Math.log(step) / Math.LN10), - error = step / Math.pow(10, power); - return power >= 0 - ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * - Math.pow(10, power) - : -Math.pow(10, -power) / - (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1); - } - - function tickStep(start, stop, count) { - var step0 = Math.abs(stop - start) / Math.max(0, count), - step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), - error = step0 / step1; - if (error >= e10) step1 *= 10; - else if (error >= e5) step1 *= 5; - else if (error >= e2) step1 *= 2; - return stop < start ? -step1 : step1; - } // CONCATENATED MODULE: ../node_modules/d3-array/src/bisector.js - - function bisector(f) { - let delta = f; - let compare1 = f; - let compare2 = f; - - if (f.length !== 2) { - delta = (d, x) => f(d) - x; - compare1 = ascending_ascending; - compare2 = (d, x) => ascending_ascending(f(d), x); - } - - function left(a, x, lo = 0, hi = a.length) { - if (lo < hi) { - if (compare1(x, x) !== 0) return hi; - do { - const mid = (lo + hi) >>> 1; - if (compare2(a[mid], x) < 0) lo = mid + 1; - else hi = mid; - } while (lo < hi); - } - return lo; - } - - function right(a, x, lo = 0, hi = a.length) { - if (lo < hi) { - if (compare1(x, x) !== 0) return hi; - do { - const mid = (lo + hi) >>> 1; - if (compare2(a[mid], x) <= 0) lo = mid + 1; - else hi = mid; - } while (lo < hi); - } - return lo; - } - - function center(a, x, lo = 0, hi = a.length) { - const i = left(a, x, lo, hi - 1); - return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i; - } - - return { left, center, right }; - } // CONCATENATED MODULE: ../node_modules/d3-array/src/number.js - - function number(x) { - return x === null ? NaN : +x; - } - - function* numbers(values, valueof) { - if (valueof === undefined) { - for (let value of values) { - if (value != null && (value = +value) >= value) { - yield value; - } - } - } else { - let index = -1; - for (let value of values) { - if ( - (value = valueof(value, ++index, values)) != null && - (value = +value) >= value - ) { - yield value; - } - } - } - } // CONCATENATED MODULE: ../node_modules/d3-array/src/bisect.js - - const ascendingBisect = bisector(ascending_ascending); - const bisectRight = ascendingBisect.right; - const bisectLeft = ascendingBisect.left; - const bisectCenter = bisector(number).center; - /* harmony default export */ const bisect = bisectRight; // CONCATENATED MODULE: ../node_modules/d3-color/src/define.js - - /* harmony default export */ function src_define( - constructor, - factory, - prototype, - ) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; - } - - function extend(parent, definition) { - var prototype = Object.create(parent.prototype); - for (var key in definition) prototype[key] = definition[key]; - return prototype; - } // CONCATENATED MODULE: ../node_modules/d3-color/src/color.js - - function Color() {} - - var darker = 0.7; - var brighter = 1 / darker; - - var reI = '\\s*([+-]?\\d+)\\s*', - reN = '\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*', - reP = '\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*', - reHex = /^#([0-9a-f]{3,8})$/, - reRgbInteger = new RegExp('^rgb\\(' + [reI, reI, reI] + '\\)$'), - reRgbPercent = new RegExp('^rgb\\(' + [reP, reP, reP] + '\\)$'), - reRgbaInteger = new RegExp('^rgba\\(' + [reI, reI, reI, reN] + '\\)$'), - reRgbaPercent = new RegExp('^rgba\\(' + [reP, reP, reP, reN] + '\\)$'), - reHslPercent = new RegExp('^hsl\\(' + [reN, reP, reP] + '\\)$'), - reHslaPercent = new RegExp('^hsla\\(' + [reN, reP, reP, reN] + '\\)$'); - - var named = { - aliceblue: 0xf0f8ff, - antiquewhite: 0xfaebd7, - aqua: 0x00ffff, - aquamarine: 0x7fffd4, - azure: 0xf0ffff, - beige: 0xf5f5dc, - bisque: 0xffe4c4, - black: 0x000000, - blanchedalmond: 0xffebcd, - blue: 0x0000ff, - blueviolet: 0x8a2be2, - brown: 0xa52a2a, - burlywood: 0xdeb887, - cadetblue: 0x5f9ea0, - chartreuse: 0x7fff00, - chocolate: 0xd2691e, - coral: 0xff7f50, - cornflowerblue: 0x6495ed, - cornsilk: 0xfff8dc, - crimson: 0xdc143c, - cyan: 0x00ffff, - darkblue: 0x00008b, - darkcyan: 0x008b8b, - darkgoldenrod: 0xb8860b, - darkgray: 0xa9a9a9, - darkgreen: 0x006400, - darkgrey: 0xa9a9a9, - darkkhaki: 0xbdb76b, - darkmagenta: 0x8b008b, - darkolivegreen: 0x556b2f, - darkorange: 0xff8c00, - darkorchid: 0x9932cc, - darkred: 0x8b0000, - darksalmon: 0xe9967a, - darkseagreen: 0x8fbc8f, - darkslateblue: 0x483d8b, - darkslategray: 0x2f4f4f, - darkslategrey: 0x2f4f4f, - darkturquoise: 0x00ced1, - darkviolet: 0x9400d3, - deeppink: 0xff1493, - deepskyblue: 0x00bfff, - dimgray: 0x696969, - dimgrey: 0x696969, - dodgerblue: 0x1e90ff, - firebrick: 0xb22222, - floralwhite: 0xfffaf0, - forestgreen: 0x228b22, - fuchsia: 0xff00ff, - gainsboro: 0xdcdcdc, - ghostwhite: 0xf8f8ff, - gold: 0xffd700, - goldenrod: 0xdaa520, - gray: 0x808080, - green: 0x008000, - greenyellow: 0xadff2f, - grey: 0x808080, - honeydew: 0xf0fff0, - hotpink: 0xff69b4, - indianred: 0xcd5c5c, - indigo: 0x4b0082, - ivory: 0xfffff0, - khaki: 0xf0e68c, - lavender: 0xe6e6fa, - lavenderblush: 0xfff0f5, - lawngreen: 0x7cfc00, - lemonchiffon: 0xfffacd, - lightblue: 0xadd8e6, - lightcoral: 0xf08080, - lightcyan: 0xe0ffff, - lightgoldenrodyellow: 0xfafad2, - lightgray: 0xd3d3d3, - lightgreen: 0x90ee90, - lightgrey: 0xd3d3d3, - lightpink: 0xffb6c1, - lightsalmon: 0xffa07a, - lightseagreen: 0x20b2aa, - lightskyblue: 0x87cefa, - lightslategray: 0x778899, - lightslategrey: 0x778899, - lightsteelblue: 0xb0c4de, - lightyellow: 0xffffe0, - lime: 0x00ff00, - limegreen: 0x32cd32, - linen: 0xfaf0e6, - magenta: 0xff00ff, - maroon: 0x800000, - mediumaquamarine: 0x66cdaa, - mediumblue: 0x0000cd, - mediumorchid: 0xba55d3, - mediumpurple: 0x9370db, - mediumseagreen: 0x3cb371, - mediumslateblue: 0x7b68ee, - mediumspringgreen: 0x00fa9a, - mediumturquoise: 0x48d1cc, - mediumvioletred: 0xc71585, - midnightblue: 0x191970, - mintcream: 0xf5fffa, - mistyrose: 0xffe4e1, - moccasin: 0xffe4b5, - navajowhite: 0xffdead, - navy: 0x000080, - oldlace: 0xfdf5e6, - olive: 0x808000, - olivedrab: 0x6b8e23, - orange: 0xffa500, - orangered: 0xff4500, - orchid: 0xda70d6, - palegoldenrod: 0xeee8aa, - palegreen: 0x98fb98, - paleturquoise: 0xafeeee, - palevioletred: 0xdb7093, - papayawhip: 0xffefd5, - peachpuff: 0xffdab9, - peru: 0xcd853f, - pink: 0xffc0cb, - plum: 0xdda0dd, - powderblue: 0xb0e0e6, - purple: 0x800080, - rebeccapurple: 0x663399, - red: 0xff0000, - rosybrown: 0xbc8f8f, - royalblue: 0x4169e1, - saddlebrown: 0x8b4513, - salmon: 0xfa8072, - sandybrown: 0xf4a460, - seagreen: 0x2e8b57, - seashell: 0xfff5ee, - sienna: 0xa0522d, - silver: 0xc0c0c0, - skyblue: 0x87ceeb, - slateblue: 0x6a5acd, - slategray: 0x708090, - slategrey: 0x708090, - snow: 0xfffafa, - springgreen: 0x00ff7f, - steelblue: 0x4682b4, - tan: 0xd2b48c, - teal: 0x008080, - thistle: 0xd8bfd8, - tomato: 0xff6347, - turquoise: 0x40e0d0, - violet: 0xee82ee, - wheat: 0xf5deb3, - white: 0xffffff, - whitesmoke: 0xf5f5f5, - yellow: 0xffff00, - yellowgreen: 0x9acd32, - }; - - src_define(Color, color, { - copy: function (channels) { - return Object.assign(new this.constructor(), this, channels); - }, - displayable: function () { - return this.rgb().displayable(); - }, - hex: color_formatHex, // Deprecated! Use color.formatHex. - formatHex: color_formatHex, - formatHsl: color_formatHsl, - formatRgb: color_formatRgb, - toString: color_formatRgb, - }); - - function color_formatHex() { - return this.rgb().formatHex(); - } - - function color_formatHsl() { - return hslConvert(this).formatHsl(); - } - - function color_formatRgb() { - return this.rgb().formatRgb(); - } - - function color(format) { - var m, l; - format = (format + '').trim().toLowerCase(); - return (m = reHex.exec(format)) - ? ((l = m[1].length), - (m = parseInt(m[1], 16)), - l === 6 - ? rgbn(m) // #ff0000 - : l === 3 - ? new Rgb( - ((m >> 8) & 0xf) | ((m >> 4) & 0xf0), - ((m >> 4) & 0xf) | (m & 0xf0), - ((m & 0xf) << 4) | (m & 0xf), - 1, - ) // #f00 - : l === 8 - ? rgba( - (m >> 24) & 0xff, - (m >> 16) & 0xff, - (m >> 8) & 0xff, - (m & 0xff) / 0xff, - ) // #ff000000 - : l === 4 - ? rgba( - ((m >> 12) & 0xf) | ((m >> 8) & 0xf0), - ((m >> 8) & 0xf) | ((m >> 4) & 0xf0), - ((m >> 4) & 0xf) | (m & 0xf0), - (((m & 0xf) << 4) | (m & 0xf)) / 0xff, - ) // #f000 - : null) // invalid hex - : (m = reRgbInteger.exec(format)) - ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) - : (m = reRgbPercent.exec(format)) - ? new Rgb((m[1] * 255) / 100, (m[2] * 255) / 100, (m[3] * 255) / 100, 1) // rgb(100%, 0%, 0%) - : (m = reRgbaInteger.exec(format)) - ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) - : (m = reRgbaPercent.exec(format)) - ? rgba((m[1] * 255) / 100, (m[2] * 255) / 100, (m[3] * 255) / 100, m[4]) // rgb(100%, 0%, 0%, 1) - : (m = reHslPercent.exec(format)) - ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) - : (m = reHslaPercent.exec(format)) - ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) - : named.hasOwnProperty(format) - ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins - : format === 'transparent' - ? new Rgb(NaN, NaN, NaN, 0) - : null; - } - - function rgbn(n) { - return new Rgb((n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff, 1); - } - - function rgba(r, g, b, a) { - if (a <= 0) r = g = b = NaN; - return new Rgb(r, g, b, a); - } - - function rgbConvert(o) { - if (!(o instanceof Color)) o = color(o); - if (!o) return new Rgb(); - o = o.rgb(); - return new Rgb(o.r, o.g, o.b, o.opacity); - } - - function color_rgb(r, g, b, opacity) { - return arguments.length === 1 - ? rgbConvert(r) - : new Rgb(r, g, b, opacity == null ? 1 : opacity); - } - - function Rgb(r, g, b, opacity) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity; - } - - src_define( - Rgb, - color_rgb, - extend(Color, { - brighter: function (k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - darker: function (k) { - k = k == null ? darker : Math.pow(darker, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - rgb: function () { - return this; - }, - displayable: function () { - return ( - -0.5 <= this.r && - this.r < 255.5 && - -0.5 <= this.g && - this.g < 255.5 && - -0.5 <= this.b && - this.b < 255.5 && - 0 <= this.opacity && - this.opacity <= 1 - ); - }, - hex: rgb_formatHex, // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex, - formatRgb: rgb_formatRgb, - toString: rgb_formatRgb, - }), - ); - - function rgb_formatHex() { - return '#' + hex(this.r) + hex(this.g) + hex(this.b); - } - - function rgb_formatRgb() { - var a = this.opacity; - a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return ( - (a === 1 ? 'rgb(' : 'rgba(') + - Math.max(0, Math.min(255, Math.round(this.r) || 0)) + - ', ' + - Math.max(0, Math.min(255, Math.round(this.g) || 0)) + - ', ' + - Math.max(0, Math.min(255, Math.round(this.b) || 0)) + - (a === 1 ? ')' : ', ' + a + ')') - ); - } - - function hex(value) { - value = Math.max(0, Math.min(255, Math.round(value) || 0)); - return (value < 16 ? '0' : '') + value.toString(16); - } - - function hsla(h, s, l, a) { - if (a <= 0) h = s = l = NaN; - else if (l <= 0 || l >= 1) h = s = NaN; - else if (s <= 0) h = NaN; - return new Hsl(h, s, l, a); - } - - function hslConvert(o) { - if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color)) o = color(o); - if (!o) return new Hsl(); - if (o instanceof Hsl) return o; - o = o.rgb(); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - min = Math.min(r, g, b), - max = Math.max(r, g, b), - h = NaN, - s = max - min, - l = (max + min) / 2; - if (s) { - if (r === max) h = (g - b) / s + (g < b) * 6; - else if (g === max) h = (b - r) / s + 2; - else h = (r - g) / s + 4; - s /= l < 0.5 ? max + min : 2 - max - min; - h *= 60; - } else { - s = l > 0 && l < 1 ? 0 : h; - } - return new Hsl(h, s, l, o.opacity); - } - - function hsl(h, s, l, opacity) { - return arguments.length === 1 - ? hslConvert(h) - : new Hsl(h, s, l, opacity == null ? 1 : opacity); - } - - function Hsl(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; - } - - src_define( - Hsl, - hsl, - extend(Color, { - brighter: function (k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - darker: function (k) { - k = k == null ? darker : Math.pow(darker, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function () { - var h = (this.h % 360) + (this.h < 0) * 360, - s = isNaN(h) || isNaN(this.s) ? 0 : this.s, - l = this.l, - m2 = l + (l < 0.5 ? l : 1 - l) * s, - m1 = 2 * l - m2; - return new Rgb( - hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), - hsl2rgb(h, m1, m2), - hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), - this.opacity, - ); - }, - displayable: function () { - return ( - ((0 <= this.s && this.s <= 1) || isNaN(this.s)) && - 0 <= this.l && - this.l <= 1 && - 0 <= this.opacity && - this.opacity <= 1 - ); - }, - formatHsl: function () { - var a = this.opacity; - a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return ( - (a === 1 ? 'hsl(' : 'hsla(') + - (this.h || 0) + - ', ' + - (this.s || 0) * 100 + - '%, ' + - (this.l || 0) * 100 + - '%' + - (a === 1 ? ')' : ', ' + a + ')') - ); - }, - }), - ); - - /* From FvD 13.37, CSS Color Module Level 3 */ - function hsl2rgb(h, m1, m2) { - return ( - (h < 60 - ? m1 + ((m2 - m1) * h) / 60 - : h < 180 - ? m2 - : h < 240 - ? m1 + ((m2 - m1) * (240 - h)) / 60 - : m1) * 255 - ); - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/basis.js - - function basis(t1, v0, v1, v2, v3) { - var t2 = t1 * t1, - t3 = t2 * t1; - return ( - ((1 - 3 * t1 + 3 * t2 - t3) * v0 + - (4 - 6 * t2 + 3 * t3) * v1 + - (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + - t3 * v3) / - 6 - ); - } - - /* harmony default export */ function src_basis(values) { - var n = values.length - 1; - return function (t) { - var i = - t <= 0 ? (t = 0) : t >= 1 ? ((t = 1), n - 1) : Math.floor(t * n), - v1 = values[i], - v2 = values[i + 1], - v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, - v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; - return basis((t - i / n) * n, v0, v1, v2, v3); - }; - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/basisClosed.js - - /* harmony default export */ function basisClosed(values) { - var n = values.length; - return function (t) { - var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), - v0 = values[(i + n - 1) % n], - v1 = values[i % n], - v2 = values[(i + 1) % n], - v3 = values[(i + 2) % n]; - return basis((t - i / n) * n, v0, v1, v2, v3); - }; - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/constant.js - - /* harmony default export */ const d3_interpolate_src_constant = ( - x, - ) => () => x; // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/color.js - - function linear(a, d) { - return function (t) { - return a + t * d; - }; - } - - function exponential(a, b, y) { - return ( - (a = Math.pow(a, y)), - (b = Math.pow(b, y) - a), - (y = 1 / y), - function (t) { - return Math.pow(a + t * b, y); - } - ); - } - - function hue(a, b) { - var d = b - a; - return d - ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) - : constant(isNaN(a) ? b : a); - } - - function gamma(y) { - return (y = +y) === 1 - ? nogamma - : function (a, b) { - return b - a - ? exponential(a, b, y) - : d3_interpolate_src_constant(isNaN(a) ? b : a); - }; - } - - function nogamma(a, b) { - var d = b - a; - return d ? linear(a, d) : d3_interpolate_src_constant(isNaN(a) ? b : a); - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/rgb.js - - /* harmony default export */ const rgb = (function rgbGamma(y) { - var color = gamma(y); - - function rgb(start, end) { - var r = color((start = color_rgb(start)).r, (end = color_rgb(end)).r), - g = color(start.g, end.g), - b = color(start.b, end.b), - opacity = nogamma(start.opacity, end.opacity); - return function (t) { - start.r = r(t); - start.g = g(t); - start.b = b(t); - start.opacity = opacity(t); - return start + ''; - }; - } - - rgb.gamma = rgbGamma; - - return rgb; - })(1); - - function rgbSpline(spline) { - return function (colors) { - var n = colors.length, - r = new Array(n), - g = new Array(n), - b = new Array(n), - i, - color; - for (i = 0; i < n; ++i) { - color = color_rgb(colors[i]); - r[i] = color.r || 0; - g[i] = color.g || 0; - b[i] = color.b || 0; - } - r = spline(r); - g = spline(g); - b = spline(b); - color.opacity = 1; - return function (t) { - color.r = r(t); - color.g = g(t); - color.b = b(t); - return color + ''; - }; - }; - } - - var rgbBasis = rgbSpline(src_basis); - var rgbBasisClosed = rgbSpline(basisClosed); // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/array.js - - /* harmony default export */ function src_array(a, b) { - return (isNumberArray(b) ? numberArray : genericArray)(a, b); - } - - function genericArray(a, b) { - var nb = b ? b.length : 0, - na = a ? Math.min(nb, a.length) : 0, - x = new Array(na), - c = new Array(nb), - i; - - for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]); - for (; i < nb; ++i) c[i] = b[i]; - - return function (t) { - for (i = 0; i < na; ++i) c[i] = x[i](t); - return c; - }; - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/date.js - - /* harmony default export */ function date(a, b) { - var d = new Date(); - return ( - (a = +a), - (b = +b), - function (t) { - return d.setTime(a * (1 - t) + b * t), d; - } - ); - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/number.js - - /* harmony default export */ function src_number(a, b) { - return ( - (a = +a), - (b = +b), - function (t) { - return a * (1 - t) + b * t; - } - ); - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/object.js - - /* harmony default export */ function object(a, b) { - var i = {}, - c = {}, - k; - - if (a === null || typeof a !== 'object') a = {}; - if (b === null || typeof b !== 'object') b = {}; - - for (k in b) { - if (k in a) { - i[k] = value(a[k], b[k]); - } else { - c[k] = b[k]; - } - } - - return function (t) { - for (k in i) c[k] = i[k](t); - return c; - }; - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/string.js - - var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, - reB = new RegExp(reA.source, 'g'); - - function zero(b) { - return function () { - return b; - }; - } - - function one(b) { - return function (t) { - return b(t) + ''; - }; - } - - /* harmony default export */ function string(a, b) { - var bi = (reA.lastIndex = reB.lastIndex = 0), // scan index for next number in b - am, // current match in a - bm, // current match in b - bs, // string preceding current number in b, if any - i = -1, // index in s - s = [], // string constants and placeholders - q = []; // number interpolators - - // Coerce inputs to strings. - (a = a + ''), (b = b + ''); - - // Interpolate pairs of numbers in a & b. - while ((am = reA.exec(a)) && (bm = reB.exec(b))) { - if ((bs = bm.index) > bi) { - // a string precedes the next number in b - bs = b.slice(bi, bs); - if (s[i]) s[i] += bs; - // coalesce with previous string - else s[++i] = bs; - } - if ((am = am[0]) === (bm = bm[0])) { - // numbers in a & b match - if (s[i]) s[i] += bm; - // coalesce with previous string - else s[++i] = bm; - } else { - // interpolate non-matching numbers - s[++i] = null; - q.push({ i: i, x: src_number(am, bm) }); - } - bi = reB.lastIndex; - } - - // Add remains of b. - if (bi < b.length) { - bs = b.slice(bi); - if (s[i]) s[i] += bs; - // coalesce with previous string - else s[++i] = bs; - } - - // Special optimization for only a single match. - // Otherwise, interpolate each of the numbers and rejoin the string. - return s.length < 2 - ? q[0] - ? one(q[0].x) - : zero(b) - : ((b = q.length), - function (t) { - for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); - return s.join(''); - }); - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/numberArray.js - - /* harmony default export */ function src_numberArray(a, b) { - if (!b) b = []; - var n = a ? Math.min(b.length, a.length) : 0, - c = b.slice(), - i; - return function (t) { - for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t; - return c; - }; - } - - function numberArray_isNumberArray(x) { - return ArrayBuffer.isView(x) && !(x instanceof DataView); - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/value.js - - /* harmony default export */ function value(a, b) { - var t = typeof b, - c; - return b == null || t === 'boolean' - ? d3_interpolate_src_constant(b) - : (t === 'number' - ? src_number - : t === 'string' - ? (c = color(b)) - ? ((b = c), rgb) - : string - : b instanceof color - ? rgb - : b instanceof Date - ? date - : numberArray_isNumberArray(b) - ? src_numberArray - : Array.isArray(b) - ? genericArray - : (typeof b.valueOf !== 'function' && - typeof b.toString !== 'function') || - isNaN(b) - ? object - : src_number)(a, b); - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/round.js - - /* harmony default export */ function round(a, b) { - return ( - (a = +a), - (b = +b), - function (t) { - return Math.round(a * (1 - t) + b * t); - } - ); - } // CONCATENATED MODULE: ../node_modules/d3-scale/src/constant.js - - function constants(x) { - return function () { - return x; - }; - } // CONCATENATED MODULE: ../node_modules/d3-scale/src/number.js - - function number_number(x) { - return +x; - } // CONCATENATED MODULE: ../node_modules/d3-scale/src/continuous.js - - var unit = [0, 1]; - - function continuous_identity(x) { - return x; - } - - function normalize(a, b) { - return (b -= a = +a) - ? function (x) { - return (x - a) / b; - } - : constants(isNaN(b) ? NaN : 0.5); - } - - function clamper(a, b) { - var t; - if (a > b) (t = a), (a = b), (b = t); - return function (x) { - return Math.max(a, Math.min(b, x)); - }; - } - - // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1]. - // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b]. - function bimap(domain, range, interpolate) { - var d0 = domain[0], - d1 = domain[1], - r0 = range[0], - r1 = range[1]; - if (d1 < d0) (d0 = normalize(d1, d0)), (r0 = interpolate(r1, r0)); - else (d0 = normalize(d0, d1)), (r0 = interpolate(r0, r1)); - return function (x) { - return r0(d0(x)); - }; - } - - function polymap(domain, range, interpolate) { - var j = Math.min(domain.length, range.length) - 1, - d = new Array(j), - r = new Array(j), - i = -1; - - // Reverse descending domains. - if (domain[j] < domain[0]) { - domain = domain.slice().reverse(); - range = range.slice().reverse(); - } - - while (++i < j) { - d[i] = normalize(domain[i], domain[i + 1]); - r[i] = interpolate(range[i], range[i + 1]); - } - - return function (x) { - var i = bisect(domain, x, 1, j) - 1; - return r[i](d[i](x)); - }; - } - - function copy(source, target) { - return target - .domain(source.domain()) - .range(source.range()) - .interpolate(source.interpolate()) - .clamp(source.clamp()) - .unknown(source.unknown()); - } - - function transformer() { - var domain = unit, - range = unit, - interpolate = value, - transform, - untransform, - unknown, - clamp = continuous_identity, - piecewise, - output, - input; - - function rescale() { - var n = Math.min(domain.length, range.length); - if (clamp !== continuous_identity) - clamp = clamper(domain[0], domain[n - 1]); - piecewise = n > 2 ? polymap : bimap; - output = input = null; - return scale; - } - - function scale(x) { - return x == null || isNaN((x = +x)) - ? unknown - : ( - output || - (output = piecewise(domain.map(transform), range, interpolate)) - )(transform(clamp(x))); - } - - scale.invert = function (y) { - return clamp( - untransform( - ( - input || - (input = piecewise(range, domain.map(transform), src_number)) - )(y), - ), - ); - }; - - scale.domain = function (_) { - return arguments.length - ? ((domain = Array.from(_, number_number)), rescale()) - : domain.slice(); - }; - - scale.range = function (_) { - return arguments.length - ? ((range = Array.from(_)), rescale()) - : range.slice(); - }; - - scale.rangeRound = function (_) { - return (range = Array.from(_)), (interpolate = round), rescale(); - }; - - scale.clamp = function (_) { - return arguments.length - ? ((clamp = _ ? true : continuous_identity), rescale()) - : clamp !== continuous_identity; - }; - - scale.interpolate = function (_) { - return arguments.length ? ((interpolate = _), rescale()) : interpolate; - }; - - scale.unknown = function (_) { - return arguments.length ? ((unknown = _), scale) : unknown; - }; - - return function (t, u) { - (transform = t), (untransform = u); - return rescale(); - }; - } - - function continuous() { - return transformer()(continuous_identity, continuous_identity); - } // CONCATENATED MODULE: ../node_modules/d3-scale/src/init.js - - function initRange(domain, range) { - switch (arguments.length) { - case 0: - break; - case 1: - this.range(domain); - break; - default: - this.range(range).domain(domain); - break; - } - return this; - } - - function initInterpolator(domain, interpolator) { - switch (arguments.length) { - case 0: - break; - case 1: { - if (typeof domain === 'function') this.interpolator(domain); - else this.range(domain); - break; - } - default: { - this.domain(domain); - if (typeof interpolator === 'function') - this.interpolator(interpolator); - else this.range(interpolator); - break; - } - } - return this; - } // CONCATENATED MODULE: ../node_modules/d3-format/src/precisionPrefix.js - - /* harmony default export */ function precisionPrefix(step, value) { - return Math.max( - 0, - Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - - exponent(Math.abs(step)), - ); - } // CONCATENATED MODULE: ../node_modules/d3-format/src/precisionRound.js - - /* harmony default export */ function precisionRound(step, max) { - (step = Math.abs(step)), (max = Math.abs(max) - step); - return Math.max(0, exponent(max) - exponent(step)) + 1; - } // CONCATENATED MODULE: ../node_modules/d3-format/src/precisionFixed.js - - /* harmony default export */ function precisionFixed(step) { - return Math.max(0, -exponent(Math.abs(step))); - } // CONCATENATED MODULE: ../node_modules/d3-scale/src/tickFormat.js - - function tickFormat(start, stop, count, specifier) { - var step = tickStep(start, stop, count), - precision; - specifier = formatSpecifier(specifier == null ? ',f' : specifier); - switch (specifier.type) { - case 's': { - var value = Math.max(Math.abs(start), Math.abs(stop)); - if ( - specifier.precision == null && - !isNaN((precision = precisionPrefix(step, value))) - ) - specifier.precision = precision; - return formatPrefix(specifier, value); - } - case '': - case 'e': - case 'g': - case 'p': - case 'r': { - if ( - specifier.precision == null && - !isNaN( - (precision = precisionRound( - step, - Math.max(Math.abs(start), Math.abs(stop)), - )), - ) - ) - specifier.precision = precision - (specifier.type === 'e'); - break; - } - case 'f': - case '%': { - if ( - specifier.precision == null && - !isNaN((precision = precisionFixed(step))) - ) - specifier.precision = precision - (specifier.type === '%') * 2; - break; - } - } - return format(specifier); - } // CONCATENATED MODULE: ../node_modules/d3-scale/src/linear.js - - function linearish(scale) { - var domain = scale.domain; - - scale.ticks = function (count) { - var d = domain(); - return ticks(d[0], d[d.length - 1], count == null ? 10 : count); - }; - - scale.tickFormat = function (count, specifier) { - var d = domain(); - return tickFormat( - d[0], - d[d.length - 1], - count == null ? 10 : count, - specifier, - ); - }; - - scale.nice = function (count) { - if (count == null) count = 10; - - var d = domain(); - var i0 = 0; - var i1 = d.length - 1; - var start = d[i0]; - var stop = d[i1]; - var prestep; - var step; - var maxIter = 10; - - if (stop < start) { - (step = start), (start = stop), (stop = step); - (step = i0), (i0 = i1), (i1 = step); - } - - while (maxIter-- > 0) { - step = tickIncrement(start, stop, count); - if (step === prestep) { - d[i0] = start; - d[i1] = stop; - return domain(d); - } else if (step > 0) { - start = Math.floor(start / step) * step; - stop = Math.ceil(stop / step) * step; - } else if (step < 0) { - start = Math.ceil(start * step) / step; - stop = Math.floor(stop * step) / step; - } else { - break; - } - prestep = step; - } - - return scale; - }; - - return scale; - } - - function linear_linear() { - var scale = continuous(); - - scale.copy = function () { - return copy(scale, linear_linear()); - }; - - initRange.apply(scale, arguments); - - return linearish(scale); - } // CONCATENATED MODULE: ../node_modules/d3-ease/src/cubic.js - - function cubicIn(t) { - return t * t * t; - } - - function cubicOut(t) { - return --t * t * t + 1; - } - - function cubicInOut(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; - } // CONCATENATED MODULE: ../node_modules/d3-dispatch/src/dispatch.js - - var noop = { value: () => {} }; - - function dispatch_dispatch() { - for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { - if (!(t = arguments[i] + '') || t in _ || /[\s.]/.test(t)) - throw new Error('illegal type: ' + t); - _[t] = []; - } - return new Dispatch(_); - } - - function Dispatch(_) { - this._ = _; - } - - function dispatch_parseTypenames(typenames, types) { - return typenames - .trim() - .split(/^|\s+/) - .map(function (t) { - var name = '', - i = t.indexOf('.'); - if (i >= 0) (name = t.slice(i + 1)), (t = t.slice(0, i)); - if (t && !types.hasOwnProperty(t)) - throw new Error('unknown type: ' + t); - return { type: t, name: name }; - }); - } - - Dispatch.prototype = dispatch_dispatch.prototype = { - constructor: Dispatch, - on: function (typename, callback) { - var _ = this._, - T = dispatch_parseTypenames(typename + '', _), - t, - i = -1, - n = T.length; - - // If no callback was specified, return the callback of the given type and name. - if (arguments.length < 2) { - while (++i < n) - if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) - return t; - return; - } - - // If a type was specified, set the callback for the given type and name. - // Otherwise, if a null callback was specified, remove callbacks of the given name. - if (callback != null && typeof callback !== 'function') - throw new Error('invalid callback: ' + callback); - while (++i < n) { - if ((t = (typename = T[i]).type)) - _[t] = set(_[t], typename.name, callback); - else if (callback == null) - for (t in _) _[t] = set(_[t], typename.name, null); - } - - return this; - }, - copy: function () { - var copy = {}, - _ = this._; - for (var t in _) copy[t] = _[t].slice(); - return new Dispatch(copy); - }, - call: function (type, that) { - if ((n = arguments.length - 2) > 0) - for (var args = new Array(n), i = 0, n, t; i < n; ++i) - args[i] = arguments[i + 2]; - if (!this._.hasOwnProperty(type)) - throw new Error('unknown type: ' + type); - for (t = this._[type], i = 0, n = t.length; i < n; ++i) - t[i].value.apply(that, args); - }, - apply: function (type, that, args) { - if (!this._.hasOwnProperty(type)) - throw new Error('unknown type: ' + type); - for (var t = this._[type], i = 0, n = t.length; i < n; ++i) - t[i].value.apply(that, args); - }, - }; - - function get(type, name) { - for (var i = 0, n = type.length, c; i < n; ++i) { - if ((c = type[i]).name === name) { - return c.value; - } - } - } - - function set(type, name, callback) { - for (var i = 0, n = type.length; i < n; ++i) { - if (type[i].name === name) { - (type[i] = noop), (type = type.slice(0, i).concat(type.slice(i + 1))); - break; - } - } - if (callback != null) type.push({ name: name, value: callback }); - return type; - } - - /* harmony default export */ const src_dispatch = dispatch_dispatch; // CONCATENATED MODULE: ../node_modules/d3-timer/src/timer.js - - var timer_frame = 0, // is an animation frame pending? - timeout = 0, // is a timeout pending? - interval = 0, // are any timers active? - pokeDelay = 1000, // how frequently we check for clock skew - taskHead, - taskTail, - clockLast = 0, - clockNow = 0, - clockSkew = 0, - clock = - typeof performance === 'object' && performance.now ? performance : Date, - setFrame = - typeof window === 'object' && window.requestAnimationFrame - ? window.requestAnimationFrame.bind(window) - : function (f) { - setTimeout(f, 17); - }; - - function now() { - return ( - clockNow || (setFrame(clearNow), (clockNow = clock.now() + clockSkew)) - ); - } - - function clearNow() { - clockNow = 0; - } - - function Timer() { - this._call = this._time = this._next = null; - } - - Timer.prototype = timer.prototype = { - constructor: Timer, - restart: function (callback, delay, time) { - if (typeof callback !== 'function') - throw new TypeError('callback is not a function'); - time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); - if (!this._next && taskTail !== this) { - if (taskTail) taskTail._next = this; - else taskHead = this; - taskTail = this; - } - this._call = callback; - this._time = time; - sleep(); - }, - stop: function () { - if (this._call) { - this._call = null; - this._time = Infinity; - sleep(); - } - }, - }; - - function timer(callback, delay, time) { - var t = new Timer(); - t.restart(callback, delay, time); - return t; - } - - function timerFlush() { - now(); // Get the current time, if not already set. - ++timer_frame; // Pretend we’ve set an alarm, if we haven’t already. - var t = taskHead, - e; - while (t) { - if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e); - t = t._next; - } - --timer_frame; - } - - function wake() { - clockNow = (clockLast = clock.now()) + clockSkew; - timer_frame = timeout = 0; - try { - timerFlush(); - } finally { - timer_frame = 0; - nap(); - clockNow = 0; - } - } - - function poke() { - var now = clock.now(), - delay = now - clockLast; - if (delay > pokeDelay) (clockSkew -= delay), (clockLast = now); - } - - function nap() { - var t0, - t1 = taskHead, - t2, - time = Infinity; - while (t1) { - if (t1._call) { - if (time > t1._time) time = t1._time; - (t0 = t1), (t1 = t1._next); - } else { - (t2 = t1._next), (t1._next = null); - t1 = t0 ? (t0._next = t2) : (taskHead = t2); - } - } - taskTail = t0; - sleep(time); - } - - function sleep(time) { - if (timer_frame) return; // Soonest alarm already set, or will be. - if (timeout) timeout = clearTimeout(timeout); - var delay = time - clockNow; // Strictly less than if we recomputed clockNow. - if (delay > 24) { - if (time < Infinity) - timeout = setTimeout(wake, time - clock.now() - clockSkew); - if (interval) interval = clearInterval(interval); - } else { - if (!interval) - (clockLast = clock.now()), (interval = setInterval(poke, pokeDelay)); - (timer_frame = 1), setFrame(wake); - } - } // CONCATENATED MODULE: ../node_modules/d3-timer/src/timeout.js - - /* harmony default export */ function src_timeout(callback, delay, time) { - var t = new Timer(); - delay = delay == null ? 0 : +delay; - t.restart( - (elapsed) => { - t.stop(); - callback(elapsed + delay); - }, - delay, - time, - ); - return t; - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/schedule.js - - var emptyOn = src_dispatch('start', 'end', 'cancel', 'interrupt'); - var emptyTween = []; - - var CREATED = 0; - var SCHEDULED = 1; - var STARTING = 2; - var STARTED = 3; - var RUNNING = 4; - var ENDING = 5; - var ENDED = 6; - - /* harmony default export */ function schedule( - node, - name, - id, - index, - group, - timing, - ) { - var schedules = node.__transition; - if (!schedules) node.__transition = {}; - else if (id in schedules) return; - create(node, id, { - name: name, - index: index, // For context during callback. - group: group, // For context during callback. - on: emptyOn, - tween: emptyTween, - time: timing.time, - delay: timing.delay, - duration: timing.duration, - ease: timing.ease, - timer: null, - state: CREATED, - }); - } - - function init(node, id) { - var schedule = schedule_get(node, id); - if (schedule.state > CREATED) - throw new Error('too late; already scheduled'); - return schedule; - } - - function schedule_set(node, id) { - var schedule = schedule_get(node, id); - if (schedule.state > STARTED) - throw new Error('too late; already running'); - return schedule; - } - - function schedule_get(node, id) { - var schedule = node.__transition; - if (!schedule || !(schedule = schedule[id])) - throw new Error('transition not found'); - return schedule; - } - - function create(node, id, self) { - var schedules = node.__transition, - tween; - - // Initialize the self timer when the transition is created. - // Note the actual delay is not known until the first callback! - schedules[id] = self; - self.timer = timer(schedule, 0, self.time); - - function schedule(elapsed) { - self.state = SCHEDULED; - self.timer.restart(start, self.delay, self.time); - - // If the elapsed delay is less than our first sleep, start immediately. - if (self.delay <= elapsed) start(elapsed - self.delay); - } - - function start(elapsed) { - var i, j, n, o; - - // If the state is not SCHEDULED, then we previously errored on start. - if (self.state !== SCHEDULED) return stop(); - - for (i in schedules) { - o = schedules[i]; - if (o.name !== self.name) continue; - - // While this element already has a starting transition during this frame, - // defer starting an interrupting transition until that transition has a - // chance to tick (and possibly end); see d3/d3-transition#54! - if (o.state === STARTED) return src_timeout(start); - - // Interrupt the active transition, if any. - if (o.state === RUNNING) { - o.state = ENDED; - o.timer.stop(); - o.on.call('interrupt', node, node.__data__, o.index, o.group); - delete schedules[i]; - } - - // Cancel any pre-empted transitions. - else if (+i < id) { - o.state = ENDED; - o.timer.stop(); - o.on.call('cancel', node, node.__data__, o.index, o.group); - delete schedules[i]; - } - } - - // Defer the first tick to end of the current frame; see d3/d3#1576. - // Note the transition may be canceled after start and before the first tick! - // Note this must be scheduled before the start event; see d3/d3-transition#16! - // Assuming this is successful, subsequent callbacks go straight to tick. - src_timeout(function () { - if (self.state === STARTED) { - self.state = RUNNING; - self.timer.restart(tick, self.delay, self.time); - tick(elapsed); - } - }); - - // Dispatch the start event. - // Note this must be done before the tween are initialized. - self.state = STARTING; - self.on.call('start', node, node.__data__, self.index, self.group); - if (self.state !== STARTING) return; // interrupted - self.state = STARTED; - - // Initialize the tween, deleting null tween. - tween = new Array((n = self.tween.length)); - for (i = 0, j = -1; i < n; ++i) { - if ( - (o = self.tween[i].value.call( - node, - node.__data__, - self.index, - self.group, - )) - ) { - tween[++j] = o; - } - } - tween.length = j + 1; - } - - function tick(elapsed) { - var t = - elapsed < self.duration - ? self.ease.call(null, elapsed / self.duration) - : (self.timer.restart(stop), (self.state = ENDING), 1), - i = -1, - n = tween.length; - - while (++i < n) { - tween[i].call(node, t); - } - - // Dispatch the end event. - if (self.state === ENDING) { - self.on.call('end', node, node.__data__, self.index, self.group); - stop(); - } - } - - function stop() { - self.state = ENDED; - self.timer.stop(); - delete schedules[id]; - for (var i in schedules) return; // eslint-disable-line no-unused-vars - delete node.__transition; - } - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/interrupt.js - - /* harmony default export */ function interrupt(node, name) { - var schedules = node.__transition, - schedule, - active, - empty = true, - i; - - if (!schedules) return; - - name = name == null ? null : name + ''; - - for (i in schedules) { - if ((schedule = schedules[i]).name !== name) { - empty = false; - continue; - } - active = schedule.state > STARTING && schedule.state < ENDING; - schedule.state = ENDED; - schedule.timer.stop(); - schedule.on.call( - active ? 'interrupt' : 'cancel', - node, - node.__data__, - schedule.index, - schedule.group, - ); - delete schedules[i]; - } - - if (empty) delete node.__transition; - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/interrupt.js - - /* harmony default export */ function selection_interrupt(name) { - return this.each(function () { - interrupt(this, name); - }); - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/decompose.js - - var degrees = 180 / Math.PI; - - var decompose_identity = { - translateX: 0, - translateY: 0, - rotate: 0, - skewX: 0, - scaleX: 1, - scaleY: 1, - }; - - /* harmony default export */ function decompose(a, b, c, d, e, f) { - var scaleX, scaleY, skewX; - if ((scaleX = Math.sqrt(a * a + b * b))) (a /= scaleX), (b /= scaleX); - if ((skewX = a * c + b * d)) (c -= a * skewX), (d -= b * skewX); - if ((scaleY = Math.sqrt(c * c + d * d))) - (c /= scaleY), (d /= scaleY), (skewX /= scaleY); - if (a * d < b * c) - (a = -a), (b = -b), (skewX = -skewX), (scaleX = -scaleX); - return { - translateX: e, - translateY: f, - rotate: Math.atan2(b, a) * degrees, - skewX: Math.atan(skewX) * degrees, - scaleX: scaleX, - scaleY: scaleY, - }; - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/parse.js - - var svgNode; - - /* eslint-disable no-undef */ - function parseCss(value) { - const m = new (typeof DOMMatrix === 'function' - ? DOMMatrix - : WebKitCSSMatrix)(value + ''); - return m.isIdentity - ? decompose_identity - : decompose(m.a, m.b, m.c, m.d, m.e, m.f); - } - - function parseSvg(value) { - if (value == null) return decompose_identity; - if (!svgNode) - svgNode = document.createElementNS('http://www.w3.org/2000/svg', 'g'); - svgNode.setAttribute('transform', value); - if (!(value = svgNode.transform.baseVal.consolidate())) - return decompose_identity; - value = value.matrix; - return decompose(value.a, value.b, value.c, value.d, value.e, value.f); - } // CONCATENATED MODULE: ../node_modules/d3-interpolate/src/transform/index.js - - function interpolateTransform(parse, pxComma, pxParen, degParen) { - function pop(s) { - return s.length ? s.pop() + ' ' : ''; - } - - function translate(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push('translate(', null, pxComma, null, pxParen); - q.push( - { i: i - 4, x: src_number(xa, xb) }, - { i: i - 2, x: src_number(ya, yb) }, - ); - } else if (xb || yb) { - s.push('translate(' + xb + pxComma + yb + pxParen); - } - } - - function rotate(a, b, s, q) { - if (a !== b) { - if (a - b > 180) b += 360; - else if (b - a > 180) a += 360; // shortest path - q.push({ - i: s.push(pop(s) + 'rotate(', null, degParen) - 2, - x: src_number(a, b), - }); - } else if (b) { - s.push(pop(s) + 'rotate(' + b + degParen); - } - } - - function skewX(a, b, s, q) { - if (a !== b) { - q.push({ - i: s.push(pop(s) + 'skewX(', null, degParen) - 2, - x: src_number(a, b), - }); - } else if (b) { - s.push(pop(s) + 'skewX(' + b + degParen); - } - } - - function scale(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push(pop(s) + 'scale(', null, ',', null, ')'); - q.push( - { i: i - 4, x: src_number(xa, xb) }, - { i: i - 2, x: src_number(ya, yb) }, - ); - } else if (xb !== 1 || yb !== 1) { - s.push(pop(s) + 'scale(' + xb + ',' + yb + ')'); - } - } - - return function (a, b) { - var s = [], // string constants and placeholders - q = []; // number interpolators - (a = parse(a)), (b = parse(b)); - translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); - rotate(a.rotate, b.rotate, s, q); - skewX(a.skewX, b.skewX, s, q); - scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); - a = b = null; // gc - return function (t) { - var i = -1, - n = q.length, - o; - while (++i < n) s[(o = q[i]).i] = o.x(t); - return s.join(''); - }; - }; - } - - var interpolateTransformCss = interpolateTransform( - parseCss, - 'px, ', - 'px)', - 'deg)', - ); - var interpolateTransformSvg = interpolateTransform( - parseSvg, - ', ', - ')', - ')', - ); // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/tween.js - - function tweenRemove(id, name) { - var tween0, tween1; - return function () { - var schedule = schedule_set(this, id), - tween = schedule.tween; - - // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - if (tween !== tween0) { - tween1 = tween0 = tween; - for (var i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1 = tween1.slice(); - tween1.splice(i, 1); - break; - } - } - } - - schedule.tween = tween1; - }; - } - - function tweenFunction(id, name, value) { - var tween0, tween1; - if (typeof value !== 'function') throw new Error(); - return function () { - var schedule = schedule_set(this, id), - tween = schedule.tween; - - // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - if (tween !== tween0) { - tween1 = (tween0 = tween).slice(); - for ( - var t = { name: name, value: value }, i = 0, n = tween1.length; - i < n; - ++i - ) { - if (tween1[i].name === name) { - tween1[i] = t; - break; - } - } - if (i === n) tween1.push(t); - } - - schedule.tween = tween1; - }; - } - - /* harmony default export */ function tween(name, value) { - var id = this._id; - - name += ''; - - if (arguments.length < 2) { - var tween = schedule_get(this.node(), id).tween; - for (var i = 0, n = tween.length, t; i < n; ++i) { - if ((t = tween[i]).name === name) { - return t.value; - } - } - return null; - } - - return this.each( - (value == null ? tweenRemove : tweenFunction)(id, name, value), - ); - } - - function tweenValue(transition, name, value) { - var id = transition._id; - - transition.each(function () { - var schedule = schedule_set(this, id); - (schedule.value || (schedule.value = {}))[name] = value.apply( - this, - arguments, - ); - }); - - return function (node) { - return schedule_get(node, id).value[name]; - }; - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/interpolate.js - - /* harmony default export */ function interpolate(a, b) { - var c; - return (typeof b === 'number' - ? src_number - : b instanceof color - ? rgb - : (c = color(b)) - ? ((b = c), rgb) - : string)(a, b); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/attr.js - - function attr_attrRemove(name) { - return function () { - this.removeAttribute(name); - }; - } - - function attr_attrRemoveNS(fullname) { - return function () { - this.removeAttributeNS(fullname.space, fullname.local); - }; - } - - function attr_attrConstant(name, interpolate, value1) { - var string00, - string1 = value1 + '', - interpolate0; - return function () { - var string0 = this.getAttribute(name); - return string0 === string1 - ? null - : string0 === string00 - ? interpolate0 - : (interpolate0 = interpolate((string00 = string0), value1)); - }; - } - - function attr_attrConstantNS(fullname, interpolate, value1) { - var string00, - string1 = value1 + '', - interpolate0; - return function () { - var string0 = this.getAttributeNS(fullname.space, fullname.local); - return string0 === string1 - ? null - : string0 === string00 - ? interpolate0 - : (interpolate0 = interpolate((string00 = string0), value1)); - }; - } - - function attr_attrFunction(name, interpolate, value) { - var string00, string10, interpolate0; - return function () { - var string0, - value1 = value(this), - string1; - if (value1 == null) return void this.removeAttribute(name); - string0 = this.getAttribute(name); - string1 = value1 + ''; - return string0 === string1 - ? null - : string0 === string00 && string1 === string10 - ? interpolate0 - : ((string10 = string1), - (interpolate0 = interpolate((string00 = string0), value1))); - }; - } - - function attr_attrFunctionNS(fullname, interpolate, value) { - var string00, string10, interpolate0; - return function () { - var string0, - value1 = value(this), - string1; - if (value1 == null) - return void this.removeAttributeNS(fullname.space, fullname.local); - string0 = this.getAttributeNS(fullname.space, fullname.local); - string1 = value1 + ''; - return string0 === string1 - ? null - : string0 === string00 && string1 === string10 - ? interpolate0 - : ((string10 = string1), - (interpolate0 = interpolate((string00 = string0), value1))); - }; - } - - /* harmony default export */ function transition_attr(name, value) { - var fullname = namespace(name), - i = fullname === 'transform' ? interpolateTransformSvg : interpolate; - return this.attrTween( - name, - typeof value === 'function' - ? (fullname.local ? attr_attrFunctionNS : attr_attrFunction)( - fullname, - i, - tweenValue(this, 'attr.' + name, value), - ) - : value == null - ? (fullname.local ? attr_attrRemoveNS : attr_attrRemove)(fullname) - : (fullname.local ? attr_attrConstantNS : attr_attrConstant)( - fullname, - i, - value, - ), - ); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/attrTween.js - - function attrInterpolate(name, i) { - return function (t) { - this.setAttribute(name, i.call(this, t)); - }; - } - - function attrInterpolateNS(fullname, i) { - return function (t) { - this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); - }; - } - - function attrTweenNS(fullname, value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i); - return t0; - } - tween._value = value; - return tween; - } - - function attrTween(name, value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i); - return t0; - } - tween._value = value; - return tween; - } - - /* harmony default export */ function transition_attrTween(name, value) { - var key = 'attr.' + name; - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== 'function') throw new Error(); - var fullname = namespace(name); - return this.tween( - key, - (fullname.local ? attrTweenNS : attrTween)(fullname, value), - ); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/delay.js - - function delayFunction(id, value) { - return function () { - init(this, id).delay = +value.apply(this, arguments); - }; - } - - function delayConstant(id, value) { - return ( - (value = +value), - function () { - init(this, id).delay = value; - } - ); - } - - /* harmony default export */ function delay(value) { - var id = this._id; - - return arguments.length - ? this.each( - (typeof value === 'function' ? delayFunction : delayConstant)( - id, - value, - ), - ) - : schedule_get(this.node(), id).delay; - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/duration.js - - function durationFunction(id, value) { - return function () { - schedule_set(this, id).duration = +value.apply(this, arguments); - }; - } - - function durationConstant(id, value) { - return ( - (value = +value), - function () { - schedule_set(this, id).duration = value; - } - ); - } - - /* harmony default export */ function duration(value) { - var id = this._id; - - return arguments.length - ? this.each( - (typeof value === 'function' ? durationFunction : durationConstant)( - id, - value, - ), - ) - : schedule_get(this.node(), id).duration; - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/ease.js - - function easeConstant(id, value) { - if (typeof value !== 'function') throw new Error(); - return function () { - schedule_set(this, id).ease = value; - }; - } - - /* harmony default export */ function ease(value) { - var id = this._id; - - return arguments.length - ? this.each(easeConstant(id, value)) - : schedule_get(this.node(), id).ease; - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/easeVarying.js - - function easeVarying(id, value) { - return function () { - var v = value.apply(this, arguments); - if (typeof v !== 'function') throw new Error(); - schedule_set(this, id).ease = v; - }; - } - - /* harmony default export */ function transition_easeVarying(value) { - if (typeof value !== 'function') throw new Error(); - return this.each(easeVarying(this._id, value)); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/filter.js - - /* harmony default export */ function transition_filter(match) { - if (typeof match !== 'function') match = matcher(match); - - for ( - var groups = this._groups, - m = groups.length, - subgroups = new Array(m), - j = 0; - j < m; - ++j - ) { - for ( - var group = groups[j], - n = group.length, - subgroup = (subgroups[j] = []), - node, - i = 0; - i < n; - ++i - ) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Transition(subgroups, this._parents, this._name, this._id); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/merge.js - - /* harmony default export */ function transition_merge(transition) { - if (transition._id !== this._id) throw new Error(); - - for ( - var groups0 = this._groups, - groups1 = transition._groups, - m0 = groups0.length, - m1 = groups1.length, - m = Math.min(m0, m1), - merges = new Array(m0), - j = 0; - j < m; - ++j - ) { - for ( - var group0 = groups0[j], - group1 = groups1[j], - n = group0.length, - merge = (merges[j] = new Array(n)), - node, - i = 0; - i < n; - ++i - ) { - if ((node = group0[i] || group1[i])) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Transition(merges, this._parents, this._name, this._id); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/on.js - - function start(name) { - return (name + '') - .trim() - .split(/^|\s+/) - .every(function (t) { - var i = t.indexOf('.'); - if (i >= 0) t = t.slice(0, i); - return !t || t === 'start'; - }); - } - - function onFunction(id, name, listener) { - var on0, - on1, - sit = start(name) ? init : schedule_set; - return function () { - var schedule = sit(this, id), - on = schedule.on; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); - - schedule.on = on1; - }; - } - - /* harmony default export */ function transition_on(name, listener) { - var id = this._id; - - return arguments.length < 2 - ? schedule_get(this.node(), id).on.on(name) - : this.each(onFunction(id, name, listener)); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/remove.js - - function removeFunction(id) { - return function () { - var parent = this.parentNode; - for (var i in this.__transition) if (+i !== id) return; - if (parent) parent.removeChild(this); - }; - } - - /* harmony default export */ function transition_remove() { - return this.on('end.remove', removeFunction(this._id)); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/select.js - - /* harmony default export */ function transition_select(select) { - var name = this._name, - id = this._id; - - if (typeof select !== 'function') select = selector(select); - - for ( - var groups = this._groups, - m = groups.length, - subgroups = new Array(m), - j = 0; - j < m; - ++j - ) { - for ( - var group = groups[j], - n = group.length, - subgroup = (subgroups[j] = new Array(n)), - node, - subnode, - i = 0; - i < n; - ++i - ) { - if ( - (node = group[i]) && - (subnode = select.call(node, node.__data__, i, group)) - ) { - if ('__data__' in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - schedule( - subgroup[i], - name, - id, - i, - subgroup, - schedule_get(node, id), - ); - } - } - } - - return new Transition(subgroups, this._parents, name, id); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/selectAll.js - - /* harmony default export */ function transition_selectAll(select) { - var name = this._name, - id = this._id; - - if (typeof select !== 'function') select = selectorAll(select); - - for ( - var groups = this._groups, - m = groups.length, - subgroups = [], - parents = [], - j = 0; - j < m; - ++j - ) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if ((node = group[i])) { - for ( - var children = select.call(node, node.__data__, i, group), - child, - inherit = schedule_get(node, id), - k = 0, - l = children.length; - k < l; - ++k - ) { - if ((child = children[k])) { - schedule(child, name, id, k, children, inherit); - } - } - subgroups.push(children); - parents.push(node); - } - } - } - - return new Transition(subgroups, parents, name, id); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/selection.js - - var selection_Selection = src_selection.prototype.constructor; - - /* harmony default export */ function transition_selection() { - return new selection_Selection(this._groups, this._parents); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/style.js - - function styleNull(name, interpolate) { - var string00, string10, interpolate0; - return function () { - var string0 = styleValue(this, name), - string1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 - ? null - : string0 === string00 && string1 === string10 - ? interpolate0 - : (interpolate0 = interpolate( - (string00 = string0), - (string10 = string1), - )); - }; - } - - function style_styleRemove(name) { - return function () { - this.style.removeProperty(name); - }; - } - - function style_styleConstant(name, interpolate, value1) { - var string00, - string1 = value1 + '', - interpolate0; - return function () { - var string0 = styleValue(this, name); - return string0 === string1 - ? null - : string0 === string00 - ? interpolate0 - : (interpolate0 = interpolate((string00 = string0), value1)); - }; - } - - function style_styleFunction(name, interpolate, value) { - var string00, string10, interpolate0; - return function () { - var string0 = styleValue(this, name), - value1 = value(this), - string1 = value1 + ''; - if (value1 == null) - string1 = value1 = - (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 - ? null - : string0 === string00 && string1 === string10 - ? interpolate0 - : ((string10 = string1), - (interpolate0 = interpolate((string00 = string0), value1))); - }; - } - - function styleMaybeRemove(id, name) { - var on0, - on1, - listener0, - key = 'style.' + name, - event = 'end.' + key, - remove; - return function () { - var schedule = schedule_set(this, id), - on = schedule.on, - listener = - schedule.value[key] == null - ? remove || (remove = style_styleRemove(name)) - : undefined; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0 || listener0 !== listener) - (on1 = (on0 = on).copy()).on(event, (listener0 = listener)); - - schedule.on = on1; - }; - } - - /* harmony default export */ function transition_style( - name, - value, - priority, - ) { - var i = - (name += '') === 'transform' ? interpolateTransformCss : interpolate; - return value == null - ? this.styleTween(name, styleNull(name, i)).on( - 'end.style.' + name, - style_styleRemove(name), - ) - : typeof value === 'function' - ? this.styleTween( - name, - style_styleFunction( - name, - i, - tweenValue(this, 'style.' + name, value), - ), - ).each(styleMaybeRemove(this._id, name)) - : this.styleTween( - name, - style_styleConstant(name, i, value), - priority, - ).on('end.style.' + name, null); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/styleTween.js - - function styleInterpolate(name, i, priority) { - return function (t) { - this.style.setProperty(name, i.call(this, t), priority); - }; - } - - function styleTween(name, value, priority) { - var t, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); - return t; - } - tween._value = value; - return tween; - } - - /* harmony default export */ function transition_styleTween( - name, - value, - priority, - ) { - var key = 'style.' + (name += ''); - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== 'function') throw new Error(); - return this.tween( - key, - styleTween(name, value, priority == null ? '' : priority), - ); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/text.js - - function text_textConstant(value) { - return function () { - this.textContent = value; - }; - } - - function text_textFunction(value) { - return function () { - var value1 = value(this); - this.textContent = value1 == null ? '' : value1; - }; - } - - /* harmony default export */ function transition_text(value) { - return this.tween( - 'text', - typeof value === 'function' - ? text_textFunction(tweenValue(this, 'text', value)) - : text_textConstant(value == null ? '' : value + ''), - ); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/textTween.js - - function textInterpolate(i) { - return function (t) { - this.textContent = i.call(this, t); - }; - } - - function textTween(value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && textInterpolate(i); - return t0; - } - tween._value = value; - return tween; - } - - /* harmony default export */ function transition_textTween(value) { - var key = 'text'; - if (arguments.length < 1) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== 'function') throw new Error(); - return this.tween(key, textTween(value)); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/transition.js - - /* harmony default export */ function transition() { - var name = this._name, - id0 = this._id, - id1 = newId(); - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if ((node = group[i])) { - var inherit = schedule_get(node, id0); - schedule(node, name, id1, i, group, { - time: inherit.time + inherit.delay + inherit.duration, - delay: 0, - duration: inherit.duration, - ease: inherit.ease, - }); - } - } - } - - return new Transition(groups, this._parents, name, id1); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/end.js - - /* harmony default export */ function end() { - var on0, - on1, - that = this, - id = that._id, - size = that.size(); - return new Promise(function (resolve, reject) { - var cancel = { value: reject }, - end = { - value: function () { - if (--size === 0) resolve(); - }, - }; - - that.each(function () { - var schedule = schedule_set(this, id), - on = schedule.on; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0) { - on1 = (on0 = on).copy(); - on1._.cancel.push(cancel); - on1._.interrupt.push(cancel); - on1._.end.push(end); - } - - schedule.on = on1; - }); - - // The selection was empty, resolve end immediately - if (size === 0) resolve(); - }); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/transition/index.js - - var id = 0; - - function Transition(groups, parents, name, id) { - this._groups = groups; - this._parents = parents; - this._name = name; - this._id = id; - } - - function transition_transition(name) { - return src_selection().transition(name); - } - - function newId() { - return ++id; - } - - var selection_prototype = src_selection.prototype; - - Transition.prototype = transition_transition.prototype = { - constructor: Transition, - select: transition_select, - selectAll: transition_selectAll, - selectChild: selection_prototype.selectChild, - selectChildren: selection_prototype.selectChildren, - filter: transition_filter, - merge: transition_merge, - selection: transition_selection, - transition: transition, - call: selection_prototype.call, - nodes: selection_prototype.nodes, - node: selection_prototype.node, - size: selection_prototype.size, - empty: selection_prototype.empty, - each: selection_prototype.each, - on: transition_on, - attr: transition_attr, - attrTween: transition_attrTween, - style: transition_style, - styleTween: transition_styleTween, - text: transition_text, - textTween: transition_textTween, - remove: transition_remove, - tween: tween, - delay: delay, - duration: duration, - ease: ease, - easeVarying: transition_easeVarying, - end: end, - [Symbol.iterator]: selection_prototype[Symbol.iterator], - }; // CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/transition.js - - var defaultTiming = { - time: null, // Set on use. - delay: 0, - duration: 250, - ease: cubicInOut, - }; - - function inherit(node, id) { - var timing; - while (!(timing = node.__transition) || !(timing = timing[id])) { - if (!(node = node.parentNode)) { - throw new Error(`transition ${id} not found`); - } - } - return timing; - } - - /* harmony default export */ function selection_transition(name) { - var id, timing; - - if (name instanceof Transition) { - (id = name._id), (name = name._name); - } else { - (id = newId()), - ((timing = defaultTiming).time = now()), - (name = name == null ? null : name + ''); - } - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if ((node = group[i])) { - schedule(node, name, id, i, group, timing || inherit(node, id)); - } - } - } - - return new Transition(groups, this._parents, name, id); - } // CONCATENATED MODULE: ../node_modules/d3-transition/src/selection/index.js - - src_selection.prototype.interrupt = selection_interrupt; - src_selection.prototype.transition = selection_transition; // CONCATENATED MODULE: ../node_modules/d3-transition/src/index.js // CONCATENATED MODULE: ./colorUtils.js - - function generateHash(name) { - // Return a vector (0.0->1.0) that is a hash of the input string. - // The hash is computed to favor early characters over later ones, so - // that strings with similar starts have similar vectors. Only the first - // 6 characters are considered. - const MAX_CHAR = 6; - - let hash = 0; - let maxHash = 0; - let weight = 1; - const mod = 10; - - if (name) { - for (let i = 0; i < name.length; i++) { - if (i > MAX_CHAR) { - break; - } - hash += weight * (name.charCodeAt(i) % mod); - maxHash += weight * (mod - 1); - weight *= 0.7; - } - if (maxHash > 0) { - hash = hash / maxHash; - } - } - return hash; - } - - function generateColorVector(name) { - let vector = 0; - if (name) { - const nameArr = name.split('`'); - if (nameArr.length > 1) { - name = nameArr[nameArr.length - 1]; // drop module name if present - } - name = name.split('(')[0]; // drop extra info - vector = generateHash(name); - } - return vector; - } // CONCATENATED MODULE: ./colorScheme.js - - function calculateColor(hue, vector) { - let r; - let g; - let b; - - if (hue === 'red') { - r = 200 + Math.round(55 * vector); - g = 50 + Math.round(80 * vector); - b = g; - } else if (hue === 'orange') { - r = 190 + Math.round(65 * vector); - g = 90 + Math.round(65 * vector); - b = 0; - } else if (hue === 'yellow') { - r = 175 + Math.round(55 * vector); - g = r; - b = 50 + Math.round(20 * vector); - } else if (hue === 'green') { - r = 50 + Math.round(60 * vector); - g = 200 + Math.round(55 * vector); - b = r; - } else if (hue === 'pastelgreen') { - // rgb(163,195,72) - rgb(238,244,221) - r = 163 + Math.round(75 * vector); - g = 195 + Math.round(49 * vector); - b = 72 + Math.round(149 * vector); - } else if (hue === 'blue') { - // rgb(91,156,221) - rgb(217,232,247) - r = 91 + Math.round(126 * vector); - g = 156 + Math.round(76 * vector); - b = 221 + Math.round(26 * vector); - } else if (hue === 'aqua') { - r = 50 + Math.round(60 * vector); - g = 165 + Math.round(55 * vector); - b = g; - } else if (hue === 'cold') { - r = 0 + Math.round(55 * (1 - vector)); - g = 0 + Math.round(230 * (1 - vector)); - b = 200 + Math.round(55 * vector); - } else { - // original warm palette - r = 200 + Math.round(55 * vector); - g = 0 + Math.round(230 * (1 - vector)); - b = 0 + Math.round(55 * (1 - vector)); - } - - return 'rgb(' + r + ',' + g + ',' + b + ')'; - } // CONCATENATED MODULE: ./flamegraph.js - - /* harmony default export */ function flamegraph() { - let w = 960; // graph width - let h = null; // graph height - let c = 18; // cell height - let selection = null; // selection - let tooltip = null; // tooltip - let title = ''; // graph title - let transitionDuration = 750; - let transitionEase = cubicInOut; // tooltip offset - let sort = false; - let inverted = false; // invert the graph direction - let clickHandler = null; - let hoverHandler = null; - let minFrameSize = 0; - let detailsElement = null; - let searchDetails = null; - let selfValue = false; - let resetHeightOnZoom = false; - let scrollOnZoom = false; - let minHeight = null; - let computeDelta = false; - let colorHue = null; - - let getName = function (d) { - return d.data.n || d.data.name; - }; - - let getValue = function (d) { - if ('v' in d) { - return d.v; - } else { - return d.value; - } - }; - - let getChildren = function (d) { - return d.c || d.children; - }; - - let getLibtype = function (d) { - return d.data.l || d.data.libtype; - }; - - let getDelta = function (d) { - if ('d' in d.data) { - return d.data.d; - } else { - return d.data.delta; - } - }; - - let searchHandler = function (searchResults, searchSum, totalValue) { - searchDetails = () => { - if (detailsElement) { - detailsElement.textContent = - 'search: ' + - searchSum + - ' of ' + - totalValue + - ' total time ( ' + - format('.3f')(100 * (searchSum / totalValue), 3) + - '%)'; - } - }; - searchDetails(); - }; - const originalSearchHandler = searchHandler; - - let searchMatch = (d, term, ignoreCase = false) => { - if (!term) { - return false; - } - let label = getName(d); - if (ignoreCase) { - term = term.toLowerCase(); - label = label.toLowerCase(); - } - const re = new RegExp(term); - return typeof label !== 'undefined' && label && label.match(re); - }; - const originalSearchMatch = searchMatch; - - let detailsHandler = function (d) { - if (detailsElement) { - if (d) { - detailsElement.textContent = d; - } else { - if (typeof searchDetails === 'function') { - searchDetails(); - } else { - detailsElement.textContent = ''; - } - } - } - }; - const originalDetailsHandler = detailsHandler; - - let labelHandler = function (d) { - return ( - getName(d) + - ' (' + - format('.3f')(100 * (d.x1 - d.x0), 3) + - '%, ' + - getValue(d) + - ' ms)' - ); - }; - - let colorMapper = function (d) { - return d.highlight ? '#E600E6' : colorHash(getName(d), getLibtype(d)); - }; - const originalColorMapper = colorMapper; - - function colorHash(name, libtype) { - // Return a color for the given name and library type. The library type - // selects the hue, and the name is hashed to a color in that hue. - - // default when libtype is not in use - let hue = colorHue || 'warm'; - - if (!colorHue && !(typeof libtype === 'undefined' || libtype === '')) { - // Select hue. Order is important. - hue = 'red'; - if (typeof name !== 'undefined' && name && name.match(/::/)) { - hue = 'yellow'; - } - if (libtype === 'kernel') { - hue = 'orange'; - } else if (libtype === 'jit') { - hue = 'green'; - } else if (libtype === 'inlined') { - hue = 'aqua'; - } - } - - const vector = generateColorVector(name); - return calculateColor(hue, vector); - } - - function show(d) { - d.data.fade = false; - d.data.hide = false; - if (d.children) { - d.children.forEach(show); - } - } - - function hideSiblings(node) { - let child = node; - let parent = child.parent; - let children, i, sibling; - while (parent) { - children = parent.children; - i = children.length; - while (i--) { - sibling = children[i]; - if (sibling !== child) { - sibling.data.hide = true; - } - } - child = parent; - parent = child.parent; - } - } - - function fadeAncestors(d) { - if (d.parent) { - d.parent.data.fade = true; - fadeAncestors(d.parent); - } - } - - function zoom(d) { - if (tooltip) tooltip.hide(); - hideSiblings(d); - show(d); - fadeAncestors(d); - update(); - if (scrollOnZoom) { - const chartOffset = src_select(this).select('svg')._groups[0][0] - .parentNode.offsetTop; - const maxFrames = (window.innerHeight - chartOffset) / c; - const frameOffset = (d.height - maxFrames + 10) * c; - window.scrollTo({ - top: chartOffset + frameOffset, - left: 0, - behavior: 'smooth', - }); - } - if (typeof clickHandler === 'function') { - clickHandler(d); - } - } - - function searchTree(d, term) { - const results = []; - let sum = 0; - - function searchInner(d, foundParent) { - let found = false; - - if (searchMatch(d, term)) { - d.highlight = true; - found = true; - if (!foundParent) { - sum += getValue(d); - } - results.push(d); - } else { - d.highlight = false; - } - - if (getChildren(d)) { - getChildren(d).forEach(function (child) { - searchInner(child, foundParent || found); - }); - } - } - searchInner(d, false); - - return [results, sum]; - } - - function findTree(d, id) { - if (d.id === id) { - return d; - } else { - const children = getChildren(d); - if (children) { - for (let i = 0; i < children.length; i++) { - const found = findTree(children[i], id); - if (found) { - return found; - } - } - } - } - } - - function clear(d) { - d.highlight = false; - if (getChildren(d)) { - getChildren(d).forEach(function (child) { - clear(child); - }); - } - } - - function doSort(a, b) { - if (typeof sort === 'function') { - return sort(a, b); - } else if (sort) { - return ascending_ascending(getName(a), getName(b)); - } - } - - const p = partition(); - - function filterNodes(root) { - let nodeList = root.descendants(); - if (minFrameSize > 0) { - const kx = w / (root.x1 - root.x0); - nodeList = nodeList.filter(function (el) { - return (el.x1 - el.x0) * kx > minFrameSize; - }); - } - return nodeList; - } - - function update() { - selection.each(function (root) { - const x = linear_linear().range([0, w]); - const y = linear_linear().range([0, c]); - - reappraiseNode(root); - - if (sort) root.sort(doSort); - - p(root); - - const kx = w / (root.x1 - root.x0); - function width(d) { - return (d.x1 - d.x0) * kx; - } - - const descendants = filterNodes(root); - const svg = src_select(this).select('svg'); - svg.attr('width', w); - - let g = svg.selectAll('g').data(descendants, function (d) { - return d.id; - }); - - // if height is not set: set height on first update, after nodes were filtered by minFrameSize - if (!h || resetHeightOnZoom) { - const maxDepth = Math.max.apply( - null, - descendants.map(function (n) { - return n.depth; - }), - ); - - h = (maxDepth + 3) * c; - if (h < minHeight) h = minHeight; - - svg.attr('height', h); - } - - g.transition() - .duration(transitionDuration) - .ease(transitionEase) - .attr('transform', function (d) { - return ( - 'translate(' + - x(d.x0) + - ',' + - (inverted ? y(d.depth) : h - y(d.depth) - c) + - ')' - ); - }); - - g.select('rect') - .transition() - .duration(transitionDuration) - .ease(transitionEase) - .attr('width', width); - - const node = g - .enter() - .append('svg:g') - .attr('transform', function (d) { - return ( - 'translate(' + - x(d.x0) + - ',' + - (inverted ? y(d.depth) : h - y(d.depth) - c) + - ')' - ); - }); - - node - .append('svg:rect') - .transition() - .delay(transitionDuration / 2) - .attr('width', width); - - if (!tooltip) { - node.append('svg:title'); - } - - node.append('foreignObject').append('xhtml:div'); - - // Now we have to re-select to see the new elements (why?). - g = svg.selectAll('g').data(descendants, function (d) { - return d.id; - }); - - g.attr('width', width) - .attr('height', function (d) { - return c; - }) - .attr('name', function (d) { - return getName(d); - }) - .attr('class', function (d) { - return d.data.fade ? 'frame fade' : 'frame'; - }); - - g.select('rect') - .attr('height', function (d) { - return c; - }) - .attr('fill', function (d) { - return colorMapper(d); - }); - - if (!tooltip) { - g.select('title').text(labelHandler); - } - - g.select('foreignObject') - .attr('width', width) - .attr('height', function (d) { - return c; - }) - .select('div') - .attr('class', 'd3-flame-graph-label') - .style('display', function (d) { - return width(d) < 35 ? 'none' : 'block'; - }) - .transition() - .delay(transitionDuration) - .text(getName); - - g.on('click', (_, d) => { - zoom(d); - }); - - g.exit().remove(); - - g.on('mouseover', function (_, d) { - if (tooltip) tooltip.show(d, this); - detailsHandler(labelHandler(d)); - if (typeof hoverHandler === 'function') { - hoverHandler(d); - } - }).on('mouseout', function () { - if (tooltip) tooltip.hide(); - detailsHandler(null); - }); - }); - } - - function merge(data, samples) { - samples.forEach(function (sample) { - const node = data.find(function (element) { - return element.name === sample.name; - }); - - if (node) { - node.value += sample.value; - if (sample.children) { - if (!node.children) { - node.children = []; - } - merge(node.children, sample.children); - } - } else { - data.push(sample); - } - }); - } - - function forEachNode(node, f) { - f(node); - let children = node.children; - if (children) { - const stack = [children]; - let count, child, grandChildren; - while (stack.length) { - children = stack.pop(); - count = children.length; - while (count--) { - child = children[count]; - f(child); - grandChildren = child.children; - if (grandChildren) { - stack.push(grandChildren); - } - } - } - } - } - - function adoptNode(node) { - let id = 0; - forEachNode(node, function (n) { - n.id = id++; - }); - } - - function reappraiseNode(root) { - let node, - children, - grandChildren, - childrenValue, - i, - j, - child, - childValue; - const stack = []; - const included = []; - const excluded = []; - const compoundValue = !selfValue; - let item = root.data; - if (item.hide) { - root.value = 0; - children = root.children; - if (children) { - excluded.push(children); - } - } else { - root.value = item.fade ? 0 : getValue(item); - stack.push(root); - } - // First DFS pass: - // 1. Update node.value with node's self value - // 2. Populate excluded list with children under hidden nodes - // 3. Populate included list with children under visible nodes - while ((node = stack.pop())) { - children = node.children; - if (children && (i = children.length)) { - childrenValue = 0; - while (i--) { - child = children[i]; - item = child.data; - if (item.hide) { - child.value = 0; - grandChildren = child.children; - if (grandChildren) { - excluded.push(grandChildren); - } - continue; - } - if (item.fade) { - child.value = 0; - } else { - childValue = getValue(item); - child.value = childValue; - childrenValue += childValue; - } - stack.push(child); - } - // Here second part of `&&` is actually checking for `node.data.fade`. However, - // checking for node.value is faster and presents more oportunities for JS optimizer. - if (compoundValue && node.value) { - node.value -= childrenValue; - } - included.push(children); - } - } - // Postorder traversal to compute compound value of each visible node. - i = included.length; - while (i--) { - children = included[i]; - childrenValue = 0; - j = children.length; - while (j--) { - childrenValue += children[j].value; - } - children[0].parent.value += childrenValue; - } - // Continue DFS to set value of all hidden nodes to 0. - while (excluded.length) { - children = excluded.pop(); - j = children.length; - while (j--) { - child = children[j]; - child.value = 0; - grandChildren = child.children; - if (grandChildren) { - excluded.push(grandChildren); - } - } - } - } - - function processData() { - selection.datum((data) => { - if (data.constructor.name !== 'Node') { - // creating a root hierarchical structure - const root = hierarchy(data, getChildren); - - // augumenting nodes with ids - adoptNode(root); - - // calculate actual value - reappraiseNode(root); - - // store value for later use - root.originalValue = root.value; - - // computing deltas for differentials - if (computeDelta) { - root.eachAfter((node) => { - let sum = getDelta(node); - const children = node.children; - let i = children && children.length; - while (--i >= 0) sum += children[i].delta; - node.delta = sum; - }); - } - - // setting the bound data for the selection - return root; - } - }); - } - - function chart(s) { - if (!arguments.length) { - return chart; - } - - // saving the selection on `.call` - selection = s; - - // processing raw data to be used in the chart - processData(); - - // create chart svg - selection.each(function (data) { - if (src_select(this).select('svg').size() === 0) { - const svg = src_select(this) - .append('svg:svg') - .attr('width', w) - .attr('class', 'partition d3-flame-graph'); - - if (h) { - if (h < minHeight) h = minHeight; - svg.attr('height', h); - } - - svg - .append('svg:text') - .attr('class', 'title') - .attr('text-anchor', 'middle') - .attr('y', '25') - .attr('x', w / 2) - .attr('fill', '#808080') - .text(title); - - if (tooltip) svg.call(tooltip); - } - }); - - // first draw - update(); - } - - chart.height = function (_) { - if (!arguments.length) { - return h; - } - h = _; - return chart; - }; - - chart.minHeight = function (_) { - if (!arguments.length) { - return minHeight; - } - minHeight = _; - return chart; - }; - - chart.width = function (_) { - if (!arguments.length) { - return w; - } - w = _; - return chart; - }; - - chart.cellHeight = function (_) { - if (!arguments.length) { - return c; - } - c = _; - return chart; - }; - - chart.tooltip = function (_) { - if (!arguments.length) { - return tooltip; - } - if (typeof _ === 'function') { - tooltip = _; - } - return chart; - }; - - chart.title = function (_) { - if (!arguments.length) { - return title; - } - title = _; - return chart; - }; - - chart.transitionDuration = function (_) { - if (!arguments.length) { - return transitionDuration; - } - transitionDuration = _; - return chart; - }; - - chart.transitionEase = function (_) { - if (!arguments.length) { - return transitionEase; - } - transitionEase = _; - return chart; - }; - - chart.sort = function (_) { - if (!arguments.length) { - return sort; - } - sort = _; - return chart; - }; - - chart.inverted = function (_) { - if (!arguments.length) { - return inverted; - } - inverted = _; - return chart; - }; - - chart.computeDelta = function (_) { - if (!arguments.length) { - return computeDelta; - } - computeDelta = _; - return chart; - }; - - chart.setLabelHandler = function (_) { - if (!arguments.length) { - return labelHandler; - } - labelHandler = _; - return chart; - }; - // Kept for backwards compatibility. - chart.label = chart.setLabelHandler; - - chart.search = function (term) { - const searchResults = []; - let searchSum = 0; - let totalValue = 0; - selection.each(function (data) { - const res = searchTree(data, term); - searchResults.push(...res[0]); - searchSum += res[1]; - totalValue += data.originalValue; - }); - searchHandler(searchResults, searchSum, totalValue); - update(); - }; - - chart.findById = function (id) { - if (typeof id === 'undefined' || id === null) { - return null; - } - let found = null; - selection.each(function (data) { - if (found === null) { - found = findTree(data, id); - } - }); - return found; - }; - - chart.clear = function () { - detailsHandler(null); - selection.each(function (root) { - clear(root); - update(); - }); - }; - - chart.zoomTo = function (d) { - zoom(d); - }; - - chart.resetZoom = function () { - selection.each(function (root) { - zoom(root); // zoom to root - }); - }; - - chart.onClick = function (_) { - if (!arguments.length) { - return clickHandler; - } - clickHandler = _; - return chart; - }; - - chart.onHover = function (_) { - if (!arguments.length) { - return hoverHandler; - } - hoverHandler = _; - return chart; - }; - - chart.merge = function (data) { - if (!selection) { - return chart; - } - - // TODO: Fix merge with zoom - // Merging a zoomed chart doesn't work properly, so - // clearing zoom before merge. - // To apply zoom on merge, we would need to set hide - // and fade on new data according to current data. - // New ids are generated for the whole data structure, - // so previous ids might not be the same. For merge to - // work with zoom, previous ids should be maintained. - this.resetZoom(); - - // Clear search details - // Merge requires a new search, updating data and - // the details handler with search results. - // Since we don't store the search term, can't - // perform search again. - searchDetails = null; - detailsHandler(null); - - selection.datum((root) => { - merge([root.data], [data]); - return root.data; - }); - processData(); - update(); - return chart; - }; - - chart.update = function (data) { - if (!selection) { - return chart; - } - if (data) { - selection.datum(data); - processData(); - } - update(); - return chart; - }; - - chart.destroy = function () { - if (!selection) { - return chart; - } - if (tooltip) { - tooltip.hide(); - if (typeof tooltip.destroy === 'function') { - tooltip.destroy(); - } - } - selection.selectAll('svg').remove(); - return chart; - }; - - chart.setColorMapper = function (_) { - if (!arguments.length) { - colorMapper = originalColorMapper; - return chart; - } - colorMapper = (d) => { - const originalColor = originalColorMapper(d); - return _(d, originalColor); - }; - return chart; - }; - // Kept for backwards compatibility. - chart.color = chart.setColorMapper; - - chart.setColorHue = function (_) { - if (!arguments.length) { - colorHue = null; - return chart; - } - colorHue = _; - return chart; - }; - - chart.minFrameSize = function (_) { - if (!arguments.length) { - return minFrameSize; - } - minFrameSize = _; - return chart; - }; - - chart.setDetailsElement = function (_) { - if (!arguments.length) { - return detailsElement; - } - detailsElement = _; - return chart; - }; - // Kept for backwards compatibility. - chart.details = chart.setDetailsElement; - - chart.selfValue = function (_) { - if (!arguments.length) { - return selfValue; - } - selfValue = _; - return chart; - }; - - chart.resetHeightOnZoom = function (_) { - if (!arguments.length) { - return resetHeightOnZoom; - } - resetHeightOnZoom = _; - return chart; - }; - - chart.scrollOnZoom = function (_) { - if (!arguments.length) { - return scrollOnZoom; - } - scrollOnZoom = _; - return chart; - }; - - chart.getName = function (_) { - if (!arguments.length) { - return getName; - } - getName = _; - return chart; - }; - - chart.getValue = function (_) { - if (!arguments.length) { - return getValue; - } - getValue = _; - return chart; - }; - - chart.getChildren = function (_) { - if (!arguments.length) { - return getChildren; - } - getChildren = _; - return chart; - }; - - chart.getLibtype = function (_) { - if (!arguments.length) { - return getLibtype; - } - getLibtype = _; - return chart; - }; - - chart.getDelta = function (_) { - if (!arguments.length) { - return getDelta; - } - getDelta = _; - return chart; - }; - - chart.setSearchHandler = function (_) { - if (!arguments.length) { - searchHandler = originalSearchHandler; - return chart; - } - searchHandler = _; - return chart; - }; - - chart.setDetailsHandler = function (_) { - if (!arguments.length) { - detailsHandler = originalDetailsHandler; - return chart; - } - detailsHandler = _; - return chart; - }; - - chart.setSearchMatch = function (_) { - if (!arguments.length) { - searchMatch = originalSearchMatch; - return chart; - } - searchMatch = _; - return chart; - }; - - return chart; - } - - __webpack_exports__ = __webpack_exports__['default']; - /******/ return __webpack_exports__; - /******/ - })(); -}); diff --git a/development/charts/table/index.html b/development/charts/table/index.html deleted file mode 100644 index ec11ecfde5c3..000000000000 --- a/development/charts/table/index.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - -
-
- - - - - - - -
S.NoNameTotalTime
-
-
- - diff --git a/development/charts/table/jquery.min.js b/development/charts/table/jquery.min.js deleted file mode 100644 index 8cdc80eb85d8..000000000000 --- a/development/charts/table/jquery.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * jQuery JavaScript Library v1.6.2 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Jun 30 14:16:56 2011 -0400 - */ -(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. -shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j -)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/development/metamaskbot-build-announce.js b/development/metamaskbot-build-announce.js index cc762602b4e6..9310a92d83ec 100755 --- a/development/metamaskbot-build-announce.js +++ b/development/metamaskbot-build-announce.js @@ -94,14 +94,6 @@ async function start() { // links to bundle browser builds const depVizUrl = `${BUILD_LINK_BASE}/build-artifacts/build-viz/index.html`; const depVizLink = `Build System`; - const moduleInitStatsBackgroundUrl = `${BUILD_LINK_BASE}/test-artifacts/chrome/mv3/initialisation/background/index.html`; - const moduleInitStatsBackgroundLink = `Background Module Init Stats`; - const moduleInitStatsUIUrl = `${BUILD_LINK_BASE}/test-artifacts/chrome/mv3/initialisation/ui/index.html`; - const moduleInitStatsUILink = `UI Init Stats`; - const moduleLoadStatsUrl = `${BUILD_LINK_BASE}/test-artifacts/chrome/mv3/load_time/index.html`; - const moduleLoadStatsLink = `Module Load Stats`; - const bundleSizeStatsUrl = `${BUILD_LINK_BASE}/test-artifacts/chrome/mv3/bundle_size.json`; - const bundleSizeStatsLink = `Bundle Size Stats`; // link to artifacts const allArtifactsUrl = `https://circleci.com/gh/MetaMask/metamask-extension/${CIRCLE_BUILD_NUM}#artifacts/containers/0`; @@ -111,10 +103,6 @@ async function start() { `builds (beta): ${betaBuildLinks}`, `builds (flask): ${flaskBuildLinks}`, `build viz: ${depVizLink}`, - `mv3: ${moduleInitStatsBackgroundLink}`, - `mv3: ${moduleInitStatsUILink}`, - `mv3: ${moduleLoadStatsLink}`, - `mv3: ${bundleSizeStatsLink}`, `code coverage: ${coverageLink}`, `storybook: ${storybookLink}`, `all artifacts`, diff --git a/development/sourcemap-validator.js b/development/sourcemap-validator.js index 0531a03ced19..01861e229a83 100644 --- a/development/sourcemap-validator.js +++ b/development/sourcemap-validator.js @@ -24,6 +24,7 @@ async function start() { `common-0.js`, `background-0.js`, `ui-0.js`, + 'phishing-detect.js', // `contentscript.js`, skipped because the validator is erroneously sampling the inlined `inpage.js` script `inpage.js`, ]; diff --git a/docs/trezor-emulator.md b/docs/trezor-emulator.md index fd459b92b583..bd77bb808c29 100644 --- a/docs/trezor-emulator.md +++ b/docs/trezor-emulator.md @@ -1,6 +1,6 @@ # Using the TREZOR simulator -You can install the TREZOR emulator and use it with MetaMask. +You can install the TREZOR emulator and use it with Metamask. Here is how: ## 1 - Install the TREZOR Bridge diff --git a/jest.config.js b/jest.config.js index ad12bb85b657..d64ca0864cfb 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,7 +1,6 @@ module.exports = { collectCoverageFrom: [ '/app/scripts/controllers/permissions/**/*.js', - '/app/scripts/lib/createRPCMethodTrackingMiddleware.js', '/shared/**/*.js', '/ui/**/*.js', ], @@ -12,8 +11,8 @@ module.exports = { global: { branches: 44, functions: 42, - lines: 52, - statements: 52, + lines: 48, + statements: 48, }, './app/scripts/controllers/permissions/**/*.js': { branches: 100, @@ -21,12 +20,6 @@ module.exports = { lines: 100, statements: 100, }, - './app/scripts/lib/createRPCMethodTrackingMiddleware.js': { - branches: 95.65, - functions: 100, - lines: 100, - statements: 100, - }, }, // TODO: enable resetMocks // resetMocks: true, @@ -41,7 +34,6 @@ module.exports = { '/app/scripts/platforms/*.test.js', 'app/scripts/controllers/network/**/*.test.js', '/app/scripts/controllers/permissions/**/*.test.js', - '/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js', ], testTimeout: 2500, transform: { diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index e371f4fbad7c..6d45be3e37bb 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2202,7 +2202,7 @@ }, "@babel/runtime": { "packages": { - "@storybook/api>regenerator-runtime": true + "addons-linter>regenerator-runtime": true } }, "@download/blockies": { @@ -3168,6 +3168,43 @@ "watchify>xtend": true } }, + "@metamask/post-message-stream": { + "globals": { + "addEventListener": true, + "location.origin": true, + "onmessage": "write", + "postMessage": true, + "removeEventListener": true + }, + "packages": { + "@metamask/post-message-stream>readable-stream": true + } + }, + "@metamask/post-message-stream>readable-stream": { + "packages": { + "@metamask/post-message-stream>readable-stream>safe-buffer": true, + "@metamask/post-message-stream>readable-stream>string_decoder": true, + "@storybook/api>util-deprecate": true, + "browserify>browser-resolve": true, + "browserify>events": true, + "browserify>process": true, + "browserify>timers-browserify": true, + "pumpify>inherits": true, + "readable-stream>core-util-is": true, + "readable-stream>isarray": true, + "vinyl>cloneable-readable>process-nextick-args": true + } + }, + "@metamask/post-message-stream>readable-stream>safe-buffer": { + "packages": { + "browserify>buffer": true + } + }, + "@metamask/post-message-stream>readable-stream>string_decoder": { + "packages": { + "@metamask/post-message-stream>readable-stream>safe-buffer": true + } + }, "@metamask/providers>@metamask/object-multiplex": { "globals": { "console.warn": true @@ -3182,77 +3219,184 @@ "packages": { "@metamask/controllers": true, "@metamask/rpc-methods>@metamask/key-tree": true, - "@metamask/rpc-methods>@metamask/utils": true, "@metamask/snap-controllers": true, "eth-rpc-errors": true } }, "@metamask/rpc-methods>@metamask/key-tree": { "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": true, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, - "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": true, - "browserify>buffer": true + "@metamask/rpc-methods>@metamask/key-tree>bip39": true, + "@metamask/rpc-methods>@metamask/key-tree>secp256k1": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "browserify>insert-module-globals>is-buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true + } + }, + "@metamask/rpc-methods>@metamask/key-tree>bip39": { + "packages": { + "browserify>buffer": true, + "browserify>crypto-browserify>pbkdf2": true, + "ethereumjs-util>create-hash": true, + "ethereumjs-wallet>randombytes": true + } + }, + "@metamask/rpc-methods>@metamask/key-tree>secp256k1": { + "packages": { + "3box>ethers>elliptic": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": { + "@metamask/smart-transactions-controller": { "globals": { - "crypto": true + "URLSearchParams": true, + "clearInterval": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, + "setTimeout": true }, "packages": { - "browserify>browser-resolve": true + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/smart-transactions-controller>@metamask/controllers": true, + "@metamask/smart-transactions-controller>bignumber.js": true, + "@metamask/smart-transactions-controller>fast-json-patch": true, + "ethers": true, + "lodash": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": { + "@metamask/smart-transactions-controller>@metamask/controllers": { "globals": { - "TextEncoder": true, - "crypto": true, + "Headers": true, + "URL": true, + "clearInterval": true, + "clearTimeout": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, "setTimeout": true + }, + "packages": { + "@ethereumjs/common": true, + "@ethereumjs/tx": true, + "@metamask/contract-metadata": true, + "@metamask/controllers>abort-controller": true, + "@metamask/controllers>async-mutex": true, + "@metamask/controllers>eth-phishing-detect": true, + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/controllers>multiformats": true, + "@metamask/controllers>web3-provider-engine": true, + "@metamask/metamask-eth-abis": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, + "@storybook/api>fast-deep-equal": true, + "browserify>buffer": true, + "browserify>events": true, + "deep-freeze-strict": true, + "eth-ens-namehash": true, + "eth-json-rpc-infura": true, + "eth-keyring-controller": true, + "eth-query": true, + "eth-rpc-errors": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "ethers": true, + "ethjs>ethjs-unit": true, + "immer": true, + "json-rpc-engine": true, + "jsonschema": true, + "punycode": true, + "single-call-balance-checker-abi": true, + "uuid": true, + "web3": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": { "globals": { - "crypto": true + "clearInterval": true, + "setInterval": true }, "packages": { - "browserify>browser-resolve": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-provider-http": true, + "ethjs>ethjs-unit": true, + "ethjs>ethjs-util": true, + "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": { - "globals": { - "TextDecoder": true, - "TextEncoder": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "ethjs-query>babel-runtime": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-util": true, + "promise-to-callback": true } }, - "@metamask/rpc-methods>@metamask/utils": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { "packages": { - "@storybook/api>fast-deep-equal": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true } }, - "@metamask/smart-transactions-controller": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { "globals": { - "URLSearchParams": true, - "clearInterval": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true + "console": true }, "packages": { - "@metamask/controllers": true, - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/smart-transactions-controller>bignumber.js": true, - "@metamask/smart-transactions-controller>fast-json-patch": true, - "ethers": true, - "lodash": true + "ethjs-query>babel-runtime": true, + "ethjs-query>ethjs-format": true, + "ethjs-query>ethjs-rpc": true, + "promise-to-callback": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true } }, "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { @@ -3277,6 +3421,7 @@ "@metamask/snap-controllers": { "globals": { "URL": true, + "Worker": true, "clearTimeout": true, "console.error": true, "console.info": true, @@ -3290,12 +3435,10 @@ }, "packages": { "@metamask/controllers": true, + "@metamask/post-message-stream": true, "@metamask/providers>@metamask/object-multiplex": true, - "@metamask/rpc-methods>@metamask/utils": true, - "@metamask/snap-controllers>@metamask/browser-passworder": true, "@metamask/snap-controllers>@metamask/execution-environments": true, "@metamask/snap-controllers>@metamask/obs-store": true, - "@metamask/snap-controllers>@metamask/post-message-stream": true, "@metamask/snap-controllers>ajv": true, "@metamask/snap-controllers>concat-stream": true, "@metamask/snap-controllers>gunzip-maybe": true, @@ -3313,19 +3456,6 @@ "semver": true } }, - "@metamask/snap-controllers>@metamask/browser-passworder": { - "globals": { - "btoa": true, - "crypto.getRandomValues": true, - "crypto.subtle.decrypt": true, - "crypto.subtle.deriveKey": true, - "crypto.subtle.encrypt": true, - "crypto.subtle.importKey": true - }, - "packages": { - "browserify>buffer": true - } - }, "@metamask/snap-controllers>@metamask/obs-store": { "packages": { "@metamask/snap-controllers>@metamask/obs-store>through2": true, @@ -3335,71 +3465,12 @@ }, "@metamask/snap-controllers>@metamask/obs-store>through2": { "packages": { - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream": true, "browserify>process": true, "browserify>util": true, + "readable-stream": true, "watchify>xtend": true } }, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream": { - "packages": { - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>process-nextick-args": true, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>string_decoder": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true - } - }, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>process-nextick-args": { - "packages": { - "browserify>process": true - } - }, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>string_decoder": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true - } - }, - "@metamask/snap-controllers>@metamask/post-message-stream": { - "globals": { - "WorkerGlobalScope": true, - "addEventListener": true, - "location.origin": true, - "onmessage": "write", - "postMessage": true, - "removeEventListener": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/utils": true, - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream": true - } - }, - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream": { - "packages": { - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream>string_decoder": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true, - "vinyl>cloneable-readable>process-nextick-args": true - } - }, - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream>string_decoder": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true - } - }, "@metamask/snap-controllers>ajv": { "packages": { "@storybook/api>fast-deep-equal": true @@ -3506,38 +3577,8 @@ "setTimeout": true }, "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream": true, - "json-rpc-engine>@metamask/safe-event-emitter": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>process-nextick-args": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>string_decoder": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>process-nextick-args": { - "packages": { - "browserify>process": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": { - "packages": { - "browserify>buffer": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>string_decoder": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true + "json-rpc-engine>@metamask/safe-event-emitter": true, + "readable-stream": true } }, "@metamask/snap-controllers>nanoid": { @@ -3603,7 +3644,7 @@ "@ngraveio/bc-ur>bignumber.js": true, "@ngraveio/bc-ur>crc": true, "@ngraveio/bc-ur>jsbi": true, - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "browserify>assert": true, "browserify>buffer": true, "pubnub>cbor-sync": true @@ -3625,6 +3666,12 @@ "define": true } }, + "@ngraveio/bc-ur>sha.js": { + "packages": { + "ethereumjs-wallet>safe-buffer": true, + "pumpify>inherits": true + } + }, "@popperjs/core": { "globals": { "Element": true, @@ -3735,11 +3782,6 @@ "localforage": true } }, - "@storybook/api>regenerator-runtime": { - "globals": { - "regeneratorRuntime": "write" - } - }, "@storybook/api>util-deprecate": { "globals": { "console.trace": true, @@ -4059,10 +4101,9 @@ "setTimeout": true } }, - "addons-linter>sha.js": { - "packages": { - "ethereumjs-wallet>safe-buffer": true, - "pumpify>inherits": true + "addons-linter>regenerator-runtime": { + "globals": { + "regeneratorRuntime": "write" } }, "analytics-node": { @@ -4253,7 +4294,7 @@ }, "browserify>crypto-browserify>create-hmac": { "packages": { - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -4284,7 +4325,7 @@ "setTimeout": true }, "packages": { - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "browserify>process": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -4736,37 +4777,63 @@ "packages": { "browserify>buffer": true, "browserify>events": true, - "eth-keyring-controller>@metamask/bip39": true, - "eth-keyring-controller>@metamask/eth-hd-keyring": true, + "eth-keyring-controller>bip39": true, "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-hd-keyring": true, "eth-keyring-controller>eth-simple-keyring": true, "eth-keyring-controller>obs-store": true, - "eth-sig-util": true + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true } }, - "eth-keyring-controller>@metamask/bip39": { + "eth-keyring-controller>bip39": { + "globals": { + "console.log": true + }, "packages": { - "browserify>buffer": true, "browserify>crypto-browserify>pbkdf2": true, + "eth-keyring-controller>bip39>unorm": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "ethereumjs-wallet>randombytes": true, + "ethereumjs-wallet>safe-buffer": true + } + }, + "eth-keyring-controller>bip39>unorm": { + "globals": { + "define": true + } + }, + "eth-keyring-controller>browser-passworder": { + "globals": { + "btoa": true, + "crypto": true + }, + "packages": { + "eth-keyring-controller>browser-passworder>browserify-unibabel": true } }, - "eth-keyring-controller>@metamask/eth-hd-keyring": { + "eth-keyring-controller>browser-passworder>browserify-unibabel": { + "globals": { + "atob": true, + "btoa": true + } + }, + "eth-keyring-controller>eth-hd-keyring": { "packages": { "browserify>buffer": true, - "eth-keyring-controller>@metamask/bip39": true, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>bip39": true, + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, "eth-keyring-controller>eth-simple-keyring": true, - "eth-trezor-keyring>@metamask/eth-sig-util": true + "eth-sig-util": true } }, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": { + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { "packages": { "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": true, + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": true, "ethereumjs-util": true, "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-wallet>aes-js": true, @@ -4775,27 +4842,12 @@ "ethers>@ethersproject/json-wallets>scrypt-js": true } }, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": { + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { "globals": { "crypto": true, "msCrypto": true } }, - "eth-keyring-controller>browser-passworder": { - "globals": { - "btoa": true, - "crypto": true - }, - "packages": { - "eth-keyring-controller>browser-passworder>browserify-unibabel": true - } - }, - "eth-keyring-controller>browser-passworder>browserify-unibabel": { - "globals": { - "atob": true, - "btoa": true - } - }, "eth-keyring-controller>eth-simple-keyring": { "packages": { "browserify>buffer": true, @@ -5166,7 +5218,7 @@ }, "ethereumjs-util>create-hash": { "packages": { - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>md5.js": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -5763,6 +5815,73 @@ "browserify>process": true } }, + "ethjs-ens": { + "packages": { + "ethereum-ens-network-map": true, + "ethjs-ens>eth-ens-namehash": true, + "ethjs-ens>ethjs-contract": true, + "ethjs-ens>ethjs-query": true + } + }, + "ethjs-ens>eth-ens-namehash": { + "globals": { + "name": "write" + }, + "packages": { + "browserify>buffer": true, + "ethjs-ens>eth-ens-namehash>idna-uts46": true, + "ethjs-ens>eth-ens-namehash>js-sha3": true + } + }, + "ethjs-ens>eth-ens-namehash>idna-uts46": { + "globals": { + "define": true + }, + "packages": { + "browserify>punycode": true + } + }, + "ethjs-ens>eth-ens-namehash>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "ethjs-ens>ethjs-contract": { + "packages": { + "ethjs-contract>ethjs-abi": true, + "ethjs-ens>ethjs-contract>ethjs-filter": true, + "ethjs-ens>ethjs-contract>js-sha3": true, + "ethjs>ethjs-util": true + } + }, + "ethjs-ens>ethjs-contract>ethjs-filter": { + "globals": { + "clearInterval": true, + "setInterval": true + } + }, + "ethjs-ens>ethjs-contract>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "ethjs-ens>ethjs-query": { + "globals": { + "console": true + }, + "packages": { + "ethjs-ens>ethjs-query>ethjs-format": true, + "ethjs-ens>ethjs-query>ethjs-rpc": true + } + }, + "ethjs-ens>ethjs-query>ethjs-format": { + "packages": { + "ethjs-ens>ethjs-query>ethjs-format>ethjs-schema": true, + "ethjs>ethjs-util": true, + "ethjs>ethjs-util>strip-hex-prefix": true, + "ethjs>number-to-bn": true + } + }, "ethjs-query": { "globals": { "console": true @@ -5776,7 +5895,7 @@ "ethjs-query>babel-runtime": { "packages": { "@babel/runtime": true, - "@storybook/api>regenerator-runtime": true, + "addons-linter>regenerator-runtime": true, "ethjs-query>babel-runtime>core-js": true } }, @@ -6174,13 +6293,10 @@ "react-dnd-html5-backend": { "globals": { "Image": true, - "addEventListener": true, - "clearTimeout": true, "console.warn": true, "devicePixelRatio": true, "document": true, "navigator.userAgent": true, - "removeEventListener": true, "safari": true, "setTimeout": true } diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index e371f4fbad7c..6d45be3e37bb 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2202,7 +2202,7 @@ }, "@babel/runtime": { "packages": { - "@storybook/api>regenerator-runtime": true + "addons-linter>regenerator-runtime": true } }, "@download/blockies": { @@ -3168,6 +3168,43 @@ "watchify>xtend": true } }, + "@metamask/post-message-stream": { + "globals": { + "addEventListener": true, + "location.origin": true, + "onmessage": "write", + "postMessage": true, + "removeEventListener": true + }, + "packages": { + "@metamask/post-message-stream>readable-stream": true + } + }, + "@metamask/post-message-stream>readable-stream": { + "packages": { + "@metamask/post-message-stream>readable-stream>safe-buffer": true, + "@metamask/post-message-stream>readable-stream>string_decoder": true, + "@storybook/api>util-deprecate": true, + "browserify>browser-resolve": true, + "browserify>events": true, + "browserify>process": true, + "browserify>timers-browserify": true, + "pumpify>inherits": true, + "readable-stream>core-util-is": true, + "readable-stream>isarray": true, + "vinyl>cloneable-readable>process-nextick-args": true + } + }, + "@metamask/post-message-stream>readable-stream>safe-buffer": { + "packages": { + "browserify>buffer": true + } + }, + "@metamask/post-message-stream>readable-stream>string_decoder": { + "packages": { + "@metamask/post-message-stream>readable-stream>safe-buffer": true + } + }, "@metamask/providers>@metamask/object-multiplex": { "globals": { "console.warn": true @@ -3182,77 +3219,184 @@ "packages": { "@metamask/controllers": true, "@metamask/rpc-methods>@metamask/key-tree": true, - "@metamask/rpc-methods>@metamask/utils": true, "@metamask/snap-controllers": true, "eth-rpc-errors": true } }, "@metamask/rpc-methods>@metamask/key-tree": { "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": true, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, - "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": true, - "browserify>buffer": true + "@metamask/rpc-methods>@metamask/key-tree>bip39": true, + "@metamask/rpc-methods>@metamask/key-tree>secp256k1": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "browserify>insert-module-globals>is-buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true + } + }, + "@metamask/rpc-methods>@metamask/key-tree>bip39": { + "packages": { + "browserify>buffer": true, + "browserify>crypto-browserify>pbkdf2": true, + "ethereumjs-util>create-hash": true, + "ethereumjs-wallet>randombytes": true + } + }, + "@metamask/rpc-methods>@metamask/key-tree>secp256k1": { + "packages": { + "3box>ethers>elliptic": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": { + "@metamask/smart-transactions-controller": { "globals": { - "crypto": true + "URLSearchParams": true, + "clearInterval": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, + "setTimeout": true }, "packages": { - "browserify>browser-resolve": true + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/smart-transactions-controller>@metamask/controllers": true, + "@metamask/smart-transactions-controller>bignumber.js": true, + "@metamask/smart-transactions-controller>fast-json-patch": true, + "ethers": true, + "lodash": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": { + "@metamask/smart-transactions-controller>@metamask/controllers": { "globals": { - "TextEncoder": true, - "crypto": true, + "Headers": true, + "URL": true, + "clearInterval": true, + "clearTimeout": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, "setTimeout": true + }, + "packages": { + "@ethereumjs/common": true, + "@ethereumjs/tx": true, + "@metamask/contract-metadata": true, + "@metamask/controllers>abort-controller": true, + "@metamask/controllers>async-mutex": true, + "@metamask/controllers>eth-phishing-detect": true, + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/controllers>multiformats": true, + "@metamask/controllers>web3-provider-engine": true, + "@metamask/metamask-eth-abis": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, + "@storybook/api>fast-deep-equal": true, + "browserify>buffer": true, + "browserify>events": true, + "deep-freeze-strict": true, + "eth-ens-namehash": true, + "eth-json-rpc-infura": true, + "eth-keyring-controller": true, + "eth-query": true, + "eth-rpc-errors": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "ethers": true, + "ethjs>ethjs-unit": true, + "immer": true, + "json-rpc-engine": true, + "jsonschema": true, + "punycode": true, + "single-call-balance-checker-abi": true, + "uuid": true, + "web3": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": { "globals": { - "crypto": true + "clearInterval": true, + "setInterval": true }, "packages": { - "browserify>browser-resolve": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-provider-http": true, + "ethjs>ethjs-unit": true, + "ethjs>ethjs-util": true, + "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": { - "globals": { - "TextDecoder": true, - "TextEncoder": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "ethjs-query>babel-runtime": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-util": true, + "promise-to-callback": true } }, - "@metamask/rpc-methods>@metamask/utils": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { "packages": { - "@storybook/api>fast-deep-equal": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true } }, - "@metamask/smart-transactions-controller": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { "globals": { - "URLSearchParams": true, - "clearInterval": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true + "console": true }, "packages": { - "@metamask/controllers": true, - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/smart-transactions-controller>bignumber.js": true, - "@metamask/smart-transactions-controller>fast-json-patch": true, - "ethers": true, - "lodash": true + "ethjs-query>babel-runtime": true, + "ethjs-query>ethjs-format": true, + "ethjs-query>ethjs-rpc": true, + "promise-to-callback": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true } }, "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { @@ -3277,6 +3421,7 @@ "@metamask/snap-controllers": { "globals": { "URL": true, + "Worker": true, "clearTimeout": true, "console.error": true, "console.info": true, @@ -3290,12 +3435,10 @@ }, "packages": { "@metamask/controllers": true, + "@metamask/post-message-stream": true, "@metamask/providers>@metamask/object-multiplex": true, - "@metamask/rpc-methods>@metamask/utils": true, - "@metamask/snap-controllers>@metamask/browser-passworder": true, "@metamask/snap-controllers>@metamask/execution-environments": true, "@metamask/snap-controllers>@metamask/obs-store": true, - "@metamask/snap-controllers>@metamask/post-message-stream": true, "@metamask/snap-controllers>ajv": true, "@metamask/snap-controllers>concat-stream": true, "@metamask/snap-controllers>gunzip-maybe": true, @@ -3313,19 +3456,6 @@ "semver": true } }, - "@metamask/snap-controllers>@metamask/browser-passworder": { - "globals": { - "btoa": true, - "crypto.getRandomValues": true, - "crypto.subtle.decrypt": true, - "crypto.subtle.deriveKey": true, - "crypto.subtle.encrypt": true, - "crypto.subtle.importKey": true - }, - "packages": { - "browserify>buffer": true - } - }, "@metamask/snap-controllers>@metamask/obs-store": { "packages": { "@metamask/snap-controllers>@metamask/obs-store>through2": true, @@ -3335,71 +3465,12 @@ }, "@metamask/snap-controllers>@metamask/obs-store>through2": { "packages": { - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream": true, "browserify>process": true, "browserify>util": true, + "readable-stream": true, "watchify>xtend": true } }, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream": { - "packages": { - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>process-nextick-args": true, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>string_decoder": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true - } - }, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>process-nextick-args": { - "packages": { - "browserify>process": true - } - }, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>string_decoder": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true - } - }, - "@metamask/snap-controllers>@metamask/post-message-stream": { - "globals": { - "WorkerGlobalScope": true, - "addEventListener": true, - "location.origin": true, - "onmessage": "write", - "postMessage": true, - "removeEventListener": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/utils": true, - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream": true - } - }, - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream": { - "packages": { - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream>string_decoder": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true, - "vinyl>cloneable-readable>process-nextick-args": true - } - }, - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream>string_decoder": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true - } - }, "@metamask/snap-controllers>ajv": { "packages": { "@storybook/api>fast-deep-equal": true @@ -3506,38 +3577,8 @@ "setTimeout": true }, "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream": true, - "json-rpc-engine>@metamask/safe-event-emitter": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>process-nextick-args": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>string_decoder": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>process-nextick-args": { - "packages": { - "browserify>process": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": { - "packages": { - "browserify>buffer": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>string_decoder": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true + "json-rpc-engine>@metamask/safe-event-emitter": true, + "readable-stream": true } }, "@metamask/snap-controllers>nanoid": { @@ -3603,7 +3644,7 @@ "@ngraveio/bc-ur>bignumber.js": true, "@ngraveio/bc-ur>crc": true, "@ngraveio/bc-ur>jsbi": true, - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "browserify>assert": true, "browserify>buffer": true, "pubnub>cbor-sync": true @@ -3625,6 +3666,12 @@ "define": true } }, + "@ngraveio/bc-ur>sha.js": { + "packages": { + "ethereumjs-wallet>safe-buffer": true, + "pumpify>inherits": true + } + }, "@popperjs/core": { "globals": { "Element": true, @@ -3735,11 +3782,6 @@ "localforage": true } }, - "@storybook/api>regenerator-runtime": { - "globals": { - "regeneratorRuntime": "write" - } - }, "@storybook/api>util-deprecate": { "globals": { "console.trace": true, @@ -4059,10 +4101,9 @@ "setTimeout": true } }, - "addons-linter>sha.js": { - "packages": { - "ethereumjs-wallet>safe-buffer": true, - "pumpify>inherits": true + "addons-linter>regenerator-runtime": { + "globals": { + "regeneratorRuntime": "write" } }, "analytics-node": { @@ -4253,7 +4294,7 @@ }, "browserify>crypto-browserify>create-hmac": { "packages": { - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -4284,7 +4325,7 @@ "setTimeout": true }, "packages": { - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "browserify>process": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -4736,37 +4777,63 @@ "packages": { "browserify>buffer": true, "browserify>events": true, - "eth-keyring-controller>@metamask/bip39": true, - "eth-keyring-controller>@metamask/eth-hd-keyring": true, + "eth-keyring-controller>bip39": true, "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-hd-keyring": true, "eth-keyring-controller>eth-simple-keyring": true, "eth-keyring-controller>obs-store": true, - "eth-sig-util": true + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true } }, - "eth-keyring-controller>@metamask/bip39": { + "eth-keyring-controller>bip39": { + "globals": { + "console.log": true + }, "packages": { - "browserify>buffer": true, "browserify>crypto-browserify>pbkdf2": true, + "eth-keyring-controller>bip39>unorm": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "ethereumjs-wallet>randombytes": true, + "ethereumjs-wallet>safe-buffer": true + } + }, + "eth-keyring-controller>bip39>unorm": { + "globals": { + "define": true + } + }, + "eth-keyring-controller>browser-passworder": { + "globals": { + "btoa": true, + "crypto": true + }, + "packages": { + "eth-keyring-controller>browser-passworder>browserify-unibabel": true } }, - "eth-keyring-controller>@metamask/eth-hd-keyring": { + "eth-keyring-controller>browser-passworder>browserify-unibabel": { + "globals": { + "atob": true, + "btoa": true + } + }, + "eth-keyring-controller>eth-hd-keyring": { "packages": { "browserify>buffer": true, - "eth-keyring-controller>@metamask/bip39": true, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>bip39": true, + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, "eth-keyring-controller>eth-simple-keyring": true, - "eth-trezor-keyring>@metamask/eth-sig-util": true + "eth-sig-util": true } }, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": { + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { "packages": { "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": true, + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": true, "ethereumjs-util": true, "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-wallet>aes-js": true, @@ -4775,27 +4842,12 @@ "ethers>@ethersproject/json-wallets>scrypt-js": true } }, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": { + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { "globals": { "crypto": true, "msCrypto": true } }, - "eth-keyring-controller>browser-passworder": { - "globals": { - "btoa": true, - "crypto": true - }, - "packages": { - "eth-keyring-controller>browser-passworder>browserify-unibabel": true - } - }, - "eth-keyring-controller>browser-passworder>browserify-unibabel": { - "globals": { - "atob": true, - "btoa": true - } - }, "eth-keyring-controller>eth-simple-keyring": { "packages": { "browserify>buffer": true, @@ -5166,7 +5218,7 @@ }, "ethereumjs-util>create-hash": { "packages": { - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>md5.js": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -5763,6 +5815,73 @@ "browserify>process": true } }, + "ethjs-ens": { + "packages": { + "ethereum-ens-network-map": true, + "ethjs-ens>eth-ens-namehash": true, + "ethjs-ens>ethjs-contract": true, + "ethjs-ens>ethjs-query": true + } + }, + "ethjs-ens>eth-ens-namehash": { + "globals": { + "name": "write" + }, + "packages": { + "browserify>buffer": true, + "ethjs-ens>eth-ens-namehash>idna-uts46": true, + "ethjs-ens>eth-ens-namehash>js-sha3": true + } + }, + "ethjs-ens>eth-ens-namehash>idna-uts46": { + "globals": { + "define": true + }, + "packages": { + "browserify>punycode": true + } + }, + "ethjs-ens>eth-ens-namehash>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "ethjs-ens>ethjs-contract": { + "packages": { + "ethjs-contract>ethjs-abi": true, + "ethjs-ens>ethjs-contract>ethjs-filter": true, + "ethjs-ens>ethjs-contract>js-sha3": true, + "ethjs>ethjs-util": true + } + }, + "ethjs-ens>ethjs-contract>ethjs-filter": { + "globals": { + "clearInterval": true, + "setInterval": true + } + }, + "ethjs-ens>ethjs-contract>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "ethjs-ens>ethjs-query": { + "globals": { + "console": true + }, + "packages": { + "ethjs-ens>ethjs-query>ethjs-format": true, + "ethjs-ens>ethjs-query>ethjs-rpc": true + } + }, + "ethjs-ens>ethjs-query>ethjs-format": { + "packages": { + "ethjs-ens>ethjs-query>ethjs-format>ethjs-schema": true, + "ethjs>ethjs-util": true, + "ethjs>ethjs-util>strip-hex-prefix": true, + "ethjs>number-to-bn": true + } + }, "ethjs-query": { "globals": { "console": true @@ -5776,7 +5895,7 @@ "ethjs-query>babel-runtime": { "packages": { "@babel/runtime": true, - "@storybook/api>regenerator-runtime": true, + "addons-linter>regenerator-runtime": true, "ethjs-query>babel-runtime>core-js": true } }, @@ -6174,13 +6293,10 @@ "react-dnd-html5-backend": { "globals": { "Image": true, - "addEventListener": true, - "clearTimeout": true, "console.warn": true, "devicePixelRatio": true, "document": true, "navigator.userAgent": true, - "removeEventListener": true, "safari": true, "setTimeout": true } diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index e371f4fbad7c..6d45be3e37bb 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2202,7 +2202,7 @@ }, "@babel/runtime": { "packages": { - "@storybook/api>regenerator-runtime": true + "addons-linter>regenerator-runtime": true } }, "@download/blockies": { @@ -3168,6 +3168,43 @@ "watchify>xtend": true } }, + "@metamask/post-message-stream": { + "globals": { + "addEventListener": true, + "location.origin": true, + "onmessage": "write", + "postMessage": true, + "removeEventListener": true + }, + "packages": { + "@metamask/post-message-stream>readable-stream": true + } + }, + "@metamask/post-message-stream>readable-stream": { + "packages": { + "@metamask/post-message-stream>readable-stream>safe-buffer": true, + "@metamask/post-message-stream>readable-stream>string_decoder": true, + "@storybook/api>util-deprecate": true, + "browserify>browser-resolve": true, + "browserify>events": true, + "browserify>process": true, + "browserify>timers-browserify": true, + "pumpify>inherits": true, + "readable-stream>core-util-is": true, + "readable-stream>isarray": true, + "vinyl>cloneable-readable>process-nextick-args": true + } + }, + "@metamask/post-message-stream>readable-stream>safe-buffer": { + "packages": { + "browserify>buffer": true + } + }, + "@metamask/post-message-stream>readable-stream>string_decoder": { + "packages": { + "@metamask/post-message-stream>readable-stream>safe-buffer": true + } + }, "@metamask/providers>@metamask/object-multiplex": { "globals": { "console.warn": true @@ -3182,77 +3219,184 @@ "packages": { "@metamask/controllers": true, "@metamask/rpc-methods>@metamask/key-tree": true, - "@metamask/rpc-methods>@metamask/utils": true, "@metamask/snap-controllers": true, "eth-rpc-errors": true } }, "@metamask/rpc-methods>@metamask/key-tree": { "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": true, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, - "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": true, - "browserify>buffer": true + "@metamask/rpc-methods>@metamask/key-tree>bip39": true, + "@metamask/rpc-methods>@metamask/key-tree>secp256k1": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "browserify>insert-module-globals>is-buffer": true, + "ethereumjs-util>ethereum-cryptography>keccak": true + } + }, + "@metamask/rpc-methods>@metamask/key-tree>bip39": { + "packages": { + "browserify>buffer": true, + "browserify>crypto-browserify>pbkdf2": true, + "ethereumjs-util>create-hash": true, + "ethereumjs-wallet>randombytes": true + } + }, + "@metamask/rpc-methods>@metamask/key-tree>secp256k1": { + "packages": { + "3box>ethers>elliptic": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": { + "@metamask/smart-transactions-controller": { "globals": { - "crypto": true + "URLSearchParams": true, + "clearInterval": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, + "setTimeout": true }, "packages": { - "browserify>browser-resolve": true + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/smart-transactions-controller>@metamask/controllers": true, + "@metamask/smart-transactions-controller>bignumber.js": true, + "@metamask/smart-transactions-controller>fast-json-patch": true, + "ethers": true, + "lodash": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": { + "@metamask/smart-transactions-controller>@metamask/controllers": { "globals": { - "TextEncoder": true, - "crypto": true, + "Headers": true, + "URL": true, + "clearInterval": true, + "clearTimeout": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, "setTimeout": true + }, + "packages": { + "@ethereumjs/common": true, + "@ethereumjs/tx": true, + "@metamask/contract-metadata": true, + "@metamask/controllers>abort-controller": true, + "@metamask/controllers>async-mutex": true, + "@metamask/controllers>eth-phishing-detect": true, + "@metamask/controllers>isomorphic-fetch": true, + "@metamask/controllers>multiformats": true, + "@metamask/controllers>web3-provider-engine": true, + "@metamask/metamask-eth-abis": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, + "@storybook/api>fast-deep-equal": true, + "browserify>buffer": true, + "browserify>events": true, + "deep-freeze-strict": true, + "eth-ens-namehash": true, + "eth-json-rpc-infura": true, + "eth-keyring-controller": true, + "eth-query": true, + "eth-rpc-errors": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "ethers": true, + "ethjs>ethjs-unit": true, + "immer": true, + "json-rpc-engine": true, + "jsonschema": true, + "punycode": true, + "single-call-balance-checker-abi": true, + "uuid": true, + "web3": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": { "globals": { - "crypto": true + "clearInterval": true, + "setInterval": true }, "packages": { - "browserify>browser-resolve": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-provider-http": true, + "ethjs>ethjs-unit": true, + "ethjs>ethjs-util": true, + "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": { - "globals": { - "TextDecoder": true, - "TextEncoder": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "ethjs-query>babel-runtime": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-util": true, + "promise-to-callback": true } }, - "@metamask/rpc-methods>@metamask/utils": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { "packages": { - "@storybook/api>fast-deep-equal": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": true, + "browserify>buffer": true, + "ethjs>number-to-bn": true } }, - "@metamask/smart-transactions-controller": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { "globals": { - "URLSearchParams": true, - "clearInterval": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true + "console": true }, "packages": { - "@metamask/controllers": true, - "@metamask/controllers>isomorphic-fetch": true, - "@metamask/smart-transactions-controller>bignumber.js": true, - "@metamask/smart-transactions-controller>fast-json-patch": true, - "ethers": true, - "lodash": true + "ethjs-query>babel-runtime": true, + "ethjs-query>ethjs-format": true, + "ethjs-query>ethjs-rpc": true, + "promise-to-callback": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true } }, "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { @@ -3277,6 +3421,7 @@ "@metamask/snap-controllers": { "globals": { "URL": true, + "Worker": true, "clearTimeout": true, "console.error": true, "console.info": true, @@ -3290,12 +3435,10 @@ }, "packages": { "@metamask/controllers": true, + "@metamask/post-message-stream": true, "@metamask/providers>@metamask/object-multiplex": true, - "@metamask/rpc-methods>@metamask/utils": true, - "@metamask/snap-controllers>@metamask/browser-passworder": true, "@metamask/snap-controllers>@metamask/execution-environments": true, "@metamask/snap-controllers>@metamask/obs-store": true, - "@metamask/snap-controllers>@metamask/post-message-stream": true, "@metamask/snap-controllers>ajv": true, "@metamask/snap-controllers>concat-stream": true, "@metamask/snap-controllers>gunzip-maybe": true, @@ -3313,19 +3456,6 @@ "semver": true } }, - "@metamask/snap-controllers>@metamask/browser-passworder": { - "globals": { - "btoa": true, - "crypto.getRandomValues": true, - "crypto.subtle.decrypt": true, - "crypto.subtle.deriveKey": true, - "crypto.subtle.encrypt": true, - "crypto.subtle.importKey": true - }, - "packages": { - "browserify>buffer": true - } - }, "@metamask/snap-controllers>@metamask/obs-store": { "packages": { "@metamask/snap-controllers>@metamask/obs-store>through2": true, @@ -3335,71 +3465,12 @@ }, "@metamask/snap-controllers>@metamask/obs-store>through2": { "packages": { - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream": true, "browserify>process": true, "browserify>util": true, + "readable-stream": true, "watchify>xtend": true } }, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream": { - "packages": { - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>process-nextick-args": true, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>string_decoder": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true - } - }, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>process-nextick-args": { - "packages": { - "browserify>process": true - } - }, - "@metamask/snap-controllers>@metamask/obs-store>through2>readable-stream>string_decoder": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true - } - }, - "@metamask/snap-controllers>@metamask/post-message-stream": { - "globals": { - "WorkerGlobalScope": true, - "addEventListener": true, - "location.origin": true, - "onmessage": "write", - "postMessage": true, - "removeEventListener": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/utils": true, - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream": true - } - }, - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream": { - "packages": { - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream>string_decoder": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true, - "vinyl>cloneable-readable>process-nextick-args": true - } - }, - "@metamask/snap-controllers>@metamask/post-message-stream>readable-stream>string_decoder": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true - } - }, "@metamask/snap-controllers>ajv": { "packages": { "@storybook/api>fast-deep-equal": true @@ -3506,38 +3577,8 @@ "setTimeout": true }, "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream": true, - "json-rpc-engine>@metamask/safe-event-emitter": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>process-nextick-args": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>string_decoder": true, - "@storybook/api>util-deprecate": true, - "browserify>browser-resolve": true, - "browserify>events": true, - "browserify>process": true, - "browserify>timers-browserify": true, - "pumpify>inherits": true, - "readable-stream>core-util-is": true, - "readable-stream>isarray": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>process-nextick-args": { - "packages": { - "browserify>process": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": { - "packages": { - "browserify>buffer": true - } - }, - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>string_decoder": { - "packages": { - "@metamask/snap-controllers>json-rpc-middleware-stream>readable-stream>safe-buffer": true + "json-rpc-engine>@metamask/safe-event-emitter": true, + "readable-stream": true } }, "@metamask/snap-controllers>nanoid": { @@ -3603,7 +3644,7 @@ "@ngraveio/bc-ur>bignumber.js": true, "@ngraveio/bc-ur>crc": true, "@ngraveio/bc-ur>jsbi": true, - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "browserify>assert": true, "browserify>buffer": true, "pubnub>cbor-sync": true @@ -3625,6 +3666,12 @@ "define": true } }, + "@ngraveio/bc-ur>sha.js": { + "packages": { + "ethereumjs-wallet>safe-buffer": true, + "pumpify>inherits": true + } + }, "@popperjs/core": { "globals": { "Element": true, @@ -3735,11 +3782,6 @@ "localforage": true } }, - "@storybook/api>regenerator-runtime": { - "globals": { - "regeneratorRuntime": "write" - } - }, "@storybook/api>util-deprecate": { "globals": { "console.trace": true, @@ -4059,10 +4101,9 @@ "setTimeout": true } }, - "addons-linter>sha.js": { - "packages": { - "ethereumjs-wallet>safe-buffer": true, - "pumpify>inherits": true + "addons-linter>regenerator-runtime": { + "globals": { + "regeneratorRuntime": "write" } }, "analytics-node": { @@ -4253,7 +4294,7 @@ }, "browserify>crypto-browserify>create-hmac": { "packages": { - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -4284,7 +4325,7 @@ "setTimeout": true }, "packages": { - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "browserify>process": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -4736,37 +4777,63 @@ "packages": { "browserify>buffer": true, "browserify>events": true, - "eth-keyring-controller>@metamask/bip39": true, - "eth-keyring-controller>@metamask/eth-hd-keyring": true, + "eth-keyring-controller>bip39": true, "eth-keyring-controller>browser-passworder": true, + "eth-keyring-controller>eth-hd-keyring": true, "eth-keyring-controller>eth-simple-keyring": true, "eth-keyring-controller>obs-store": true, - "eth-sig-util": true + "eth-sig-util": true, + "ethereumjs-util": true, + "loglevel": true } }, - "eth-keyring-controller>@metamask/bip39": { + "eth-keyring-controller>bip39": { + "globals": { + "console.log": true + }, "packages": { - "browserify>buffer": true, "browserify>crypto-browserify>pbkdf2": true, + "eth-keyring-controller>bip39>unorm": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "ethereumjs-wallet>randombytes": true, + "ethereumjs-wallet>safe-buffer": true + } + }, + "eth-keyring-controller>bip39>unorm": { + "globals": { + "define": true + } + }, + "eth-keyring-controller>browser-passworder": { + "globals": { + "btoa": true, + "crypto": true + }, + "packages": { + "eth-keyring-controller>browser-passworder>browserify-unibabel": true } }, - "eth-keyring-controller>@metamask/eth-hd-keyring": { + "eth-keyring-controller>browser-passworder>browserify-unibabel": { + "globals": { + "atob": true, + "btoa": true + } + }, + "eth-keyring-controller>eth-hd-keyring": { "packages": { "browserify>buffer": true, - "eth-keyring-controller>@metamask/bip39": true, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": true, + "eth-keyring-controller>bip39": true, + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": true, "eth-keyring-controller>eth-simple-keyring": true, - "eth-trezor-keyring>@metamask/eth-sig-util": true + "eth-sig-util": true } }, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet": { + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet": { "packages": { "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": true, + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": true, "ethereumjs-util": true, "ethereumjs-util>ethereum-cryptography": true, "ethereumjs-wallet>aes-js": true, @@ -4775,27 +4842,12 @@ "ethers>@ethersproject/json-wallets>scrypt-js": true } }, - "eth-keyring-controller>@metamask/eth-hd-keyring>ethereumjs-wallet>uuid": { + "eth-keyring-controller>eth-hd-keyring>ethereumjs-wallet>uuid": { "globals": { "crypto": true, "msCrypto": true } }, - "eth-keyring-controller>browser-passworder": { - "globals": { - "btoa": true, - "crypto": true - }, - "packages": { - "eth-keyring-controller>browser-passworder>browserify-unibabel": true - } - }, - "eth-keyring-controller>browser-passworder>browserify-unibabel": { - "globals": { - "atob": true, - "btoa": true - } - }, "eth-keyring-controller>eth-simple-keyring": { "packages": { "browserify>buffer": true, @@ -5166,7 +5218,7 @@ }, "ethereumjs-util>create-hash": { "packages": { - "addons-linter>sha.js": true, + "@ngraveio/bc-ur>sha.js": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>md5.js": true, "ethereumjs-util>create-hash>ripemd160": true, @@ -5763,6 +5815,73 @@ "browserify>process": true } }, + "ethjs-ens": { + "packages": { + "ethereum-ens-network-map": true, + "ethjs-ens>eth-ens-namehash": true, + "ethjs-ens>ethjs-contract": true, + "ethjs-ens>ethjs-query": true + } + }, + "ethjs-ens>eth-ens-namehash": { + "globals": { + "name": "write" + }, + "packages": { + "browserify>buffer": true, + "ethjs-ens>eth-ens-namehash>idna-uts46": true, + "ethjs-ens>eth-ens-namehash>js-sha3": true + } + }, + "ethjs-ens>eth-ens-namehash>idna-uts46": { + "globals": { + "define": true + }, + "packages": { + "browserify>punycode": true + } + }, + "ethjs-ens>eth-ens-namehash>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "ethjs-ens>ethjs-contract": { + "packages": { + "ethjs-contract>ethjs-abi": true, + "ethjs-ens>ethjs-contract>ethjs-filter": true, + "ethjs-ens>ethjs-contract>js-sha3": true, + "ethjs>ethjs-util": true + } + }, + "ethjs-ens>ethjs-contract>ethjs-filter": { + "globals": { + "clearInterval": true, + "setInterval": true + } + }, + "ethjs-ens>ethjs-contract>js-sha3": { + "packages": { + "browserify>process": true + } + }, + "ethjs-ens>ethjs-query": { + "globals": { + "console": true + }, + "packages": { + "ethjs-ens>ethjs-query>ethjs-format": true, + "ethjs-ens>ethjs-query>ethjs-rpc": true + } + }, + "ethjs-ens>ethjs-query>ethjs-format": { + "packages": { + "ethjs-ens>ethjs-query>ethjs-format>ethjs-schema": true, + "ethjs>ethjs-util": true, + "ethjs>ethjs-util>strip-hex-prefix": true, + "ethjs>number-to-bn": true + } + }, "ethjs-query": { "globals": { "console": true @@ -5776,7 +5895,7 @@ "ethjs-query>babel-runtime": { "packages": { "@babel/runtime": true, - "@storybook/api>regenerator-runtime": true, + "addons-linter>regenerator-runtime": true, "ethjs-query>babel-runtime>core-js": true } }, @@ -6174,13 +6293,10 @@ "react-dnd-html5-backend": { "globals": { "Image": true, - "addEventListener": true, - "clearTimeout": true, "console.warn": true, "devicePixelRatio": true, "document": true, "navigator.userAgent": true, - "removeEventListener": true, "safari": true, "setTimeout": true } diff --git a/lavamoat/browserify/policy-override.json b/lavamoat/browserify/policy-override.json index 96504e814ac1..212074b38854 100644 --- a/lavamoat/browserify/policy-override.json +++ b/lavamoat/browserify/policy-override.json @@ -31,13 +31,6 @@ "clearTimeout": true } }, - "react-dnd-html5-backend": { - "globals": { - "clearTimeout": true, - "addEventListener": true, - "removeEventListener": true - } - }, "ethers>@ethersproject/random": { "globals": { "crypto.getRandomValues": true diff --git a/lavamoat/build-system/policy-override.json b/lavamoat/build-system/policy-override.json index 8bdcb6a60973..b0f3f75a7b89 100644 --- a/lavamoat/build-system/policy-override.json +++ b/lavamoat/build-system/policy-override.json @@ -101,36 +101,6 @@ "globals": { "globalThis": true } - }, - "yargs": { - "builtin": { - "assert": true, - "fs": true, - "path": true, - "util": true - }, - "globals": { - "console": true, - "Error": true, - "process": true - } - }, - "yargs>y18n": { - "builtin": { - "fs": true, - "path": true, - "util": true - } - }, - "yargs>yargs-parser": { - "builtin": { - "fs": true, - "path": true, - "util": true - }, - "globals": { - "process": true - } } } } diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index 8096a980da7e..f35cc95e6a81 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -534,9 +534,9 @@ "@babel/preset-env>@babel/helper-plugin-utils": true, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-optimise-call-expression": true, - "@babel/preset-env>@babel/plugin-transform-classes>globals": true, "depcheck>@babel/traverse>@babel/helper-function-name": true, - "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true + "depcheck>@babel/traverse>@babel/helper-split-export-declaration": true, + "depcheck>@babel/traverse>globals": true } }, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": { @@ -1134,6 +1134,21 @@ "typescript": true } }, + "addons-linter>probe-image-size>next-tick": { + "globals": { + "MutationObserver": true, + "WebKitMutationObserver": true, + "document": true, + "process": true, + "setImmediate": true, + "setTimeout": true + } + }, + "addons-linter>upath": { + "builtin": { + "path": true + } + }, "babelify": { "builtin": { "path.extname": true, @@ -1978,6 +1993,57 @@ "string.prototype.matchall>es-abstract": true } }, + "enzyme>cheerio>dom-serializer": { + "packages": { + "enzyme>cheerio>entities": true, + "enzyme>cheerio>htmlparser2>domelementtype": true + } + }, + "enzyme>cheerio>htmlparser2": { + "builtin": { + "buffer.Buffer": true, + "events.EventEmitter": true, + "string_decoder.StringDecoder": true + }, + "packages": { + "enzyme>cheerio>entities": true, + "enzyme>cheerio>htmlparser2>domelementtype": true, + "enzyme>cheerio>htmlparser2>domhandler": true, + "enzyme>cheerio>htmlparser2>domutils": true, + "enzyme>cheerio>htmlparser2>readable-stream": true, + "pumpify>inherits": true + } + }, + "enzyme>cheerio>htmlparser2>domhandler": { + "packages": { + "enzyme>cheerio>htmlparser2>domelementtype": true + } + }, + "enzyme>cheerio>htmlparser2>domutils": { + "packages": { + "enzyme>cheerio>dom-serializer": true, + "enzyme>cheerio>htmlparser2>domelementtype": true + } + }, + "enzyme>cheerio>htmlparser2>readable-stream": { + "builtin": { + "buffer.Buffer": true, + "events.EventEmitter": true, + "stream": true, + "util": true + }, + "globals": { + "process.env.READABLE_STREAM": true, + "process.nextTick": true, + "process.stderr": true, + "process.stdout": true + }, + "packages": { + "@storybook/api>util-deprecate": true, + "browserify>string_decoder": true, + "pumpify>inherits": true + } + }, "enzyme>has": { "packages": { "mocha>object.assign>function-bind": true @@ -2067,10 +2133,10 @@ "eslint>is-glob": true, "eslint>json-stable-stringify-without-jsonify": true, "eslint>levn": true, - "eslint>minimatch": true, "eslint>natural-compare": true, "eslint>regexpp": true, - "lodash": true + "lodash": true, + "mocha>minimatch": true } }, "eslint-config-prettier": { @@ -2147,7 +2213,7 @@ "eslint-plugin-import>read-pkg-up": true, "eslint-plugin-import>tsconfig-paths": true, "eslint-plugin-react>array-includes": true, - "eslint>minimatch": true, + "mocha>minimatch": true, "typescript": true } }, @@ -2364,7 +2430,7 @@ "packages": { "eslint-plugin-import>tsconfig-paths>json5": true, "eslint-plugin-import>tsconfig-paths>strip-bom": true, - "rc>minimist": true + "minimist": true } }, "eslint-plugin-import>tsconfig-paths>json5": { @@ -2461,8 +2527,8 @@ "eslint-plugin-node>eslint-plugin-es": true, "eslint-plugin-node>semver": true, "eslint>eslint-utils": true, - "eslint>minimatch": true, - "globby>ignore": true + "globby>ignore": true, + "mocha>minimatch": true } }, "eslint-plugin-node>eslint-plugin-es": { @@ -2509,8 +2575,8 @@ "eslint-plugin-react>doctrine": true, "eslint-plugin-react>jsx-ast-utils": true, "eslint-plugin-react>resolve": true, - "eslint>minimatch": true, "lavamoat>object.fromentries": true, + "mocha>minimatch": true, "prop-types": true, "string.prototype.matchall": true } @@ -2629,11 +2695,11 @@ "eslint-plugin-react-hooks": true, "eslint>@eslint/eslintrc>globals": true, "eslint>@eslint/eslintrc>ignore": true, + "eslint>@eslint/eslintrc>strip-json-comments": true, "eslint>ajv": true, "eslint>debug": true, "eslint>espree": true, - "eslint>minimatch": true, - "eslint>strip-json-comments": true, + "mocha>minimatch": true, "nyc>js-yaml": true } }, @@ -2691,24 +2757,24 @@ }, "packages": { "eslint>eslint-scope>esrecurse": true, - "eslint>eslint-scope>estraverse": true + "jsdom>escodegen>estraverse": true } }, "eslint>eslint-scope>esrecurse": { "packages": { - "eslint>esquery>estraverse": true + "eslint>eslint-scope>esrecurse>estraverse": true } }, "eslint>eslint-utils": { "packages": { - "eslint>eslint-utils>eslint-visitor-keys": true + "@babel/eslint-parser>eslint-visitor-keys": true } }, "eslint>espree": { "packages": { + "@babel/eslint-parser>eslint-visitor-keys": true, "eslint>espree>acorn": true, - "eslint>espree>acorn-jsx": true, - "eslint>espree>eslint-visitor-keys": true + "eslint>espree>acorn-jsx": true } }, "eslint>espree>acorn": { @@ -2753,7 +2819,21 @@ }, "packages": { "eslint>file-entry-cache>flat-cache>flatted": true, - "nyc>rimraf": true + "eslint>file-entry-cache>flat-cache>rimraf": true + } + }, + "eslint>file-entry-cache>flat-cache>rimraf": { + "builtin": { + "assert": true, + "fs": true, + "path.join": true + }, + "globals": { + "process.platform": true, + "setTimeout": true + }, + "packages": { + "nyc>glob": true } }, "eslint>glob-parent": { @@ -2812,17 +2892,6 @@ "eslint>levn>prelude-ls": true } }, - "eslint>minimatch": { - "builtin": { - "path": true - }, - "globals": { - "console": true - }, - "packages": { - "mocha>minimatch>brace-expansion": true - } - }, "eslint>strip-ansi": { "packages": { "eslint>strip-ansi>ansi-regex": true @@ -3535,7 +3604,7 @@ "packages": { "gulp-rtlcss>rtlcss>@choojs/findup": true, "gulp-rtlcss>rtlcss>postcss": true, - "gulp-rtlcss>rtlcss>strip-json-comments": true + "rc>strip-json-comments": true } }, "gulp-rtlcss>rtlcss>@choojs/findup": { @@ -3789,10 +3858,10 @@ "setTimeout": true }, "packages": { + "addons-linter>probe-image-size>next-tick": true, "gulp-sourcemaps>debug-fabulous>memoizee>event-emitter": true, "gulp-sourcemaps>debug-fabulous>memoizee>is-promise": true, "gulp-sourcemaps>debug-fabulous>memoizee>lru-queue": true, - "gulp-sourcemaps>debug-fabulous>memoizee>next-tick": true, "gulp-sourcemaps>debug-fabulous>memoizee>timers-ext": true, "resolve-url-loader>es6-iterator>d": true, "resolve-url-loader>es6-iterator>es5-ext": true @@ -3809,16 +3878,6 @@ "resolve-url-loader>es6-iterator>es5-ext": true } }, - "gulp-sourcemaps>debug-fabulous>memoizee>next-tick": { - "globals": { - "MutationObserver": true, - "WebKitMutationObserver": true, - "document": true, - "process": true, - "setImmediate": true, - "setTimeout": true - } - }, "gulp-sourcemaps>debug-fabulous>memoizee>timers-ext": { "packages": { "resolve-url-loader>es6-iterator>es5-ext": true @@ -4087,6 +4146,7 @@ "setTimeout": true }, "packages": { + "addons-linter>upath": true, "gulp-watch>chokidar>anymatch": true, "gulp-watch>chokidar>async-each": true, "gulp-watch>chokidar>braces": true, @@ -4094,7 +4154,6 @@ "gulp-watch>chokidar>is-glob": true, "gulp-watch>chokidar>normalize-path": true, "gulp-watch>chokidar>readdirp": true, - "gulp-watch>chokidar>upath": true, "gulp-watch>glob-parent": true, "gulp-watch>path-is-absolute": true, "pumpify>inherits": true @@ -4392,11 +4451,6 @@ "gulp-watch>chokidar>readdirp>micromatch>extglob>extend-shallow>is-extendable": true } }, - "gulp-watch>chokidar>upath": { - "builtin": { - "path": true - } - }, "gulp-watch>fancy-log": { "globals": { "console": true, @@ -4733,6 +4787,7 @@ "setTimeout": true }, "packages": { + "addons-linter>upath": true, "eslint>is-glob": true, "gulp-watch>chokidar>async-each": true, "gulp-watch>path-is-absolute": true, @@ -4742,7 +4797,6 @@ "gulp>glob-watcher>chokidar>is-binary-path": true, "gulp>glob-watcher>chokidar>normalize-path": true, "gulp>glob-watcher>chokidar>readdirp": true, - "gulp>glob-watcher>chokidar>upath": true, "pumpify>inherits": true } }, @@ -4825,11 +4879,6 @@ "readable-stream": true } }, - "gulp>glob-watcher>chokidar>upath": { - "builtin": { - "path": true - } - }, "gulp>glob-watcher>just-debounce": { "globals": { "clearTimeout": true, @@ -5587,6 +5636,17 @@ "fs.accessSync": true } }, + "mocha>minimatch": { + "builtin": { + "path": true + }, + "globals": { + "console.error": true + }, + "packages": { + "mocha>minimatch>brace-expansion": true + } + }, "mocha>minimatch>brace-expansion": { "packages": { "mocha>minimatch>brace-expansion>concat-map": true, @@ -5670,8 +5730,8 @@ "process.platform": true }, "packages": { - "eslint>minimatch": true, "gulp-watch>path-is-absolute": true, + "mocha>minimatch": true, "nyc>glob>fs.realpath": true, "nyc>glob>inflight": true, "pump>once": true, @@ -5726,20 +5786,6 @@ "path.resolve": true } }, - "nyc>rimraf": { - "builtin": { - "assert": true, - "fs": true, - "path.join": true - }, - "globals": { - "process.platform": true, - "setTimeout": true - }, - "packages": { - "nyc>glob": true - } - }, "nyc>signal-exit": { "builtin": { "assert.equal": true, @@ -5856,9 +5902,9 @@ "process.platform": true }, "packages": { + "minimist": true, "rc>deep-extend": true, "rc>ini": true, - "rc>minimist": true, "rc>strip-json-comments": true } }, @@ -6638,61 +6684,10 @@ "__dirname": true }, "packages": { - "stylelint>postcss-html>htmlparser2": true, + "enzyme>cheerio>htmlparser2": true, "stylelint>postcss-syntax": true } }, - "stylelint>postcss-html>htmlparser2": { - "builtin": { - "buffer.Buffer": true, - "events.EventEmitter": true, - "string_decoder.StringDecoder": true - }, - "packages": { - "pumpify>inherits": true, - "stylelint>postcss-html>htmlparser2>domelementtype": true, - "stylelint>postcss-html>htmlparser2>domhandler": true, - "stylelint>postcss-html>htmlparser2>domutils": true, - "stylelint>postcss-html>htmlparser2>entities": true, - "stylelint>postcss-html>htmlparser2>readable-stream": true - } - }, - "stylelint>postcss-html>htmlparser2>domhandler": { - "packages": { - "stylelint>postcss-html>htmlparser2>domelementtype": true - } - }, - "stylelint>postcss-html>htmlparser2>domutils": { - "packages": { - "stylelint>postcss-html>htmlparser2>domelementtype": true, - "stylelint>postcss-html>htmlparser2>domutils>dom-serializer": true - } - }, - "stylelint>postcss-html>htmlparser2>domutils>dom-serializer": { - "packages": { - "stylelint>postcss-html>htmlparser2>domelementtype": true, - "stylelint>postcss-html>htmlparser2>entities": true - } - }, - "stylelint>postcss-html>htmlparser2>readable-stream": { - "builtin": { - "buffer.Buffer": true, - "events.EventEmitter": true, - "stream": true, - "util": true - }, - "globals": { - "process.env.READABLE_STREAM": true, - "process.nextTick": true, - "process.stderr": true, - "process.stdout": true - }, - "packages": { - "@storybook/api>util-deprecate": true, - "browserify>string_decoder": true, - "pumpify>inherits": true - } - }, "stylelint>postcss-less": { "packages": { "stylelint>postcss": true @@ -7618,82 +7613,12 @@ "enzyme>rst-selector-parser>nearley>randexp>ret": true } }, - "yargs": { - "builtin": { - "assert": true, - "fs": true, - "path": true, - "util": true - }, - "globals": { - "Error": true, - "console": true, - "process": true - }, - "packages": { - "yargs>cliui": true, - "yargs>escalade": true, - "yargs>get-caller-file": true, - "yargs>require-directory": true, - "yargs>string-width": true, - "yargs>y18n": true, - "yargs>yargs-parser": true - } - }, - "yargs>cliui": { - "packages": { - "eslint>strip-ansi": true, - "yargs>cliui>wrap-ansi": true, - "yargs>string-width": true - } - }, - "yargs>cliui>wrap-ansi": { - "packages": { - "chalk>ansi-styles": true, - "eslint>strip-ansi": true, - "yargs>string-width": true - } - }, - "yargs>escalade": { - "builtin": { - "fs.readdirSync": true, - "fs.statSync": true, - "path.dirname": true, - "path.resolve": true - } - }, - "yargs>require-directory": { - "builtin": { - "fs.readdirSync": true, - "fs.statSync": true, - "path.dirname": true, - "path.join": true, - "path.resolve": true - } - }, "yargs>string-width": { "packages": { "eslint>strip-ansi": true, "yargs>string-width>emoji-regex": true, "yargs>string-width>is-fullwidth-code-point": true } - }, - "yargs>y18n": { - "builtin": { - "fs": true, - "path": true, - "util": true - } - }, - "yargs>yargs-parser": { - "builtin": { - "fs": true, - "path": true, - "util": true - }, - "globals": { - "process": true - } } } } \ No newline at end of file diff --git a/package.json b/package.json index 2bce1be6329b..123d50c377d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.18.0", + "version": "10.14.0", "private": true, "repository": { "type": "git", @@ -11,17 +11,14 @@ "setup:postinstall": "yarn patch-package && yarn allow-scripts", "start": "yarn build:dev dev --apply-lavamoat=false", "start:lavamoat": "yarn build:dev dev --apply-lavamoat=true", - "start:mv3": "ENABLE_MV3=true yarn build:dev dev --apply-lavamoat=false", "dist": "yarn build prod", "build": "yarn lavamoat:build", "build:dev": "node development/build/index.js", "start:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' yarn build testDev", "benchmark:chrome": "SELENIUM_BROWSER=chrome node test/e2e/benchmark.js", - "mv3:stats:chrome": "SELENIUM_BROWSER=chrome ENABLE_MV3=true node test/e2e/mv3-perf-stats/index.js", "benchmark:firefox": "SELENIUM_BROWSER=firefox node test/e2e/benchmark.js", "build:test": "SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='FAKE' yarn build test", "build:test:flask": "yarn build test --build-type flask", - "build:test:mv3": "ENABLE_MV3=true yarn build test", "test": "yarn lint && yarn test:unit && yarn test:unit:jest", "dapp": "node development/static-server.js node_modules/@metamask/test-dapp/dist --port 8080", "dapp-chain": "GANACHE_ARGS='-b 2' concurrently -k -n ganache,dapp -p '[{time}][{name}]' 'yarn ganache:start' 'sleep 5 && yarn dapp'", @@ -81,9 +78,9 @@ "**/cross-fetch": "^3.1.5", "**/configstore/dot-prop": "^5.1.1", "**/ethers/elliptic": "^6.5.4", - "**/knex/minimist": "^1.2.6", - "**/optimist/minimist": "^1.2.6", - "**/socketcluster/minimist": "^1.2.6", + "**/knex/minimist": "^1.2.5", + "**/optimist/minimist": "^1.2.5", + "**/socketcluster/minimist": "^1.2.5", "**/redux/symbol-observable": "^2.0.3", "**/redux-devtools-instrument/symbol-observable": "^2.0.3", "**/rxjs/symbol-observable": "^2.0.3", @@ -118,9 +115,9 @@ "@keystonehq/metamask-airgapped-keyring": "0.2.1", "@material-ui/core": "^4.11.0", "@metamask/contract-metadata": "^1.31.0", - "@metamask/controllers": "^30.0.2", - "@metamask/design-tokens": "^1.8.0", - "@metamask/eth-ledger-bridge-keyring": "^0.13.0", + "@metamask/controllers": "^28.0.0", + "@metamask/design-tokens": "^1.5.1", + "@metamask/eth-ledger-bridge-keyring": "^0.12.0", "@metamask/eth-token-tracker": "^4.0.0", "@metamask/etherscan-link": "^2.1.0", "@metamask/jazzicon": "^2.0.0", @@ -128,11 +125,11 @@ "@metamask/metamask-eth-abis": "^3.0.0", "@metamask/obs-store": "^5.0.0", "@metamask/post-message-stream": "^4.0.0", - "@metamask/providers": "^9.0.0", - "@metamask/rpc-methods": "^0.18.1", + "@metamask/providers": "^8.1.1", + "@metamask/rpc-methods": "^0.12.0", "@metamask/slip44": "^2.1.0", - "@metamask/smart-transactions-controller": "^2.1.0", - "@metamask/snap-controllers": "^0.18.1", + "@metamask/smart-transactions-controller": "^1.10.0", + "@metamask/snap-controllers": "^0.12.0", "@ngraveio/bc-ur": "^1.1.6", "@popperjs/core": "^2.4.0", "@reduxjs/toolkit": "^1.6.2", @@ -159,7 +156,7 @@ "eth-json-rpc-filters": "^4.2.1", "eth-json-rpc-infura": "^5.1.0", "eth-json-rpc-middleware": "^8.0.0", - "eth-keyring-controller": "^7.0.2", + "eth-keyring-controller": "^6.2.0", "eth-lattice-keyring": "^0.7.3", "eth-method-registry": "^2.0.0", "eth-query": "^2.1.2", @@ -170,9 +167,10 @@ "ethereumjs-abi": "^0.6.4", "ethereumjs-util": "^7.0.10", "ethereumjs-wallet": "^0.6.4", - "ethers": "^5.6.4", + "ethers": "^5.0.8", "ethjs": "^0.4.0", "ethjs-contract": "^0.2.3", + "ethjs-ens": "^2.0.0", "ethjs-query": "^0.3.4", "extension-port-stream": "^2.0.0", "fast-json-patch": "^2.2.1", @@ -252,8 +250,7 @@ "@metamask/eslint-config-nodejs": "^9.0.0", "@metamask/eslint-config-typescript": "^9.0.1", "@metamask/forwarder": "^1.1.0", - "@metamask/phishing-warning": "^1.2.1", - "@metamask/test-dapp": "^5.1.1", + "@metamask/test-dapp": "^5.0.0", "@sentry/cli": "^1.58.0", "@storybook/addon-a11y": "^6.3.12", "@storybook/addon-actions": "^6.3.12", @@ -276,14 +273,14 @@ "@types/react": "^16.9.53", "@typescript-eslint/eslint-plugin": "^4.20.0", "@typescript-eslint/parser": "^4.20.0", - "addons-linter": "^5.2.0", + "addons-linter": "1.14.0", "babelify": "^10.0.0", "bify-module-groups": "^2.0.0", "brfs": "^2.0.2", "browser-util-inspect": "^0.2.0", "browserify": "^16.5.1", "chalk": "^3.0.0", - "chromedriver": "^103.0.0", + "chromedriver": "^101.0.0", "concurrently": "^5.2.0", "copy-webpack-plugin": "^6.0.3", "cross-spawn": "^7.0.3", @@ -336,6 +333,7 @@ "lavamoat-viz": "^6.0.9", "lockfile-lint": "^4.0.0", "loose-envify": "^1.4.0", + "minimist": "^1.2.5", "mocha": "^7.2.0", "mockttp": "^2.6.0", "nock": "^9.0.14", @@ -356,7 +354,7 @@ "resolve-url-loader": "^3.1.2", "sass": "^1.32.4", "sass-loader": "^10.1.1", - "selenium-webdriver": "^4.3.1", + "selenium-webdriver": "^4.1.0", "semver": "^7.3.5", "serve-handler": "^6.1.2", "sinon": "^9.0.0", @@ -382,7 +380,7 @@ "yarn-deduplicate": "^3.1.0" }, "engines": { - "node": "^16.0.0", + "node": "^14.15.1", "yarn": "^1.16.0" }, "lavamoat": { diff --git a/patches/@lavamoat+lavapack+3.1.0.patch b/patches/@lavamoat+lavapack+3.1.0.patch deleted file mode 100644 index bdce11c01ddb..000000000000 --- a/patches/@lavamoat+lavapack+3.1.0.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/node_modules/@lavamoat/lavapack/src/pack.js b/node_modules/@lavamoat/lavapack/src/pack.js -index eb41a0a..3f891ea 100644 ---- a/node_modules/@lavamoat/lavapack/src/pack.js -+++ b/node_modules/@lavamoat/lavapack/src/pack.js -@@ -203,7 +203,9 @@ function createPacker({ - const jsonSerializeableData = { - // id, - package: packageName, -- file, -+ // Omit this absolute filename from bundle so that builds are reproducible between environments -+ // TODO: update lavapack with an option to omit this, and/or make this filepath relative to the current working directory -+ // file, - // deps, - // source: sourceMeta.code - } diff --git a/patches/abort-controller+3.0.0.patch b/patches/abort-controller+3.0.0.patch index c9a7f43aa470..2210446d2100 100644 --- a/patches/abort-controller+3.0.0.patch +++ b/patches/abort-controller+3.0.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/abort-controller/browser.js b/node_modules/abort-controller/browser.js -index b0c5ec3..b61071b 100644 +index b0c5ec3..c8c8018 100644 --- a/node_modules/abort-controller/browser.js +++ b/node_modules/abort-controller/browser.js @@ -2,12 +2,7 @@ @@ -13,7 +13,6 @@ index b0c5ec3..b61071b 100644 +const { AbortController } = globalThis; /*eslint-enable @mysticatea/prettier */ --module.exports = AbortController + module.exports = AbortController -module.exports.AbortSignal = AbortSignal -module.exports.default = AbortController -+module.exports = { AbortController } diff --git a/patches/bip39+2.5.0.patch b/patches/bip39+2.5.0.patch new file mode 100644 index 000000000000..2976f3bb2711 --- /dev/null +++ b/patches/bip39+2.5.0.patch @@ -0,0 +1,99 @@ +diff --git a/node_modules/bip39/index.js b/node_modules/bip39/index.js +index aa0f29f..bee8008 100644 +--- a/node_modules/bip39/index.js ++++ b/node_modules/bip39/index.js +@@ -48,7 +48,9 @@ function salt (password) { + } + + function mnemonicToSeed (mnemonic, password) { +- var mnemonicBuffer = Buffer.from(unorm.nfkd(mnemonic), 'utf8') ++ var mnemonicBuffer = typeof mnemonic === 'string' ++ ? Buffer.from(unorm.nfkd(mnemonic), 'utf8') ++ : mnemonic + var saltBuffer = Buffer.from(salt(unorm.nfkd(password)), 'utf8') + + return pbkdf2(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512') +@@ -61,12 +63,28 @@ function mnemonicToSeedHex (mnemonic, password) { + function mnemonicToEntropy (mnemonic, wordlist) { + wordlist = wordlist || DEFAULT_WORDLIST + +- var words = unorm.nfkd(mnemonic).split(' ') ++ var mnemonicAsBuffer = typeof mnemonic === 'string' ++ ? Buffer.from(unorm.nfkd(mnemonic), 'utf8') ++ : mnemonic ++ ++ var words = []; ++ var currentWord = []; ++ for (const byte of mnemonicAsBuffer.values()) { ++ // split at space or \u3000 (ideographic space, for Japanese wordlists) ++ if (byte === 0x20 || byte === 0x3000) { ++ words.push(Buffer.from(currentWord)); ++ currentWord = []; ++ } else { ++ currentWord.push(byte); ++ } ++ } ++ words.push(Buffer.from(currentWord)); ++ + if (words.length % 3 !== 0) throw new Error(INVALID_MNEMONIC) + + // convert word indices to 11 bit binary strings + var bits = words.map(function (word) { +- var index = wordlist.indexOf(word) ++ var index = wordlist.indexOf(word.toString('utf8')) + if (index === -1) throw new Error(INVALID_MNEMONIC) + + return lpad(index.toString(2), '0', 11) +@@ -104,12 +122,41 @@ function entropyToMnemonic (entropy, wordlist) { + + var bits = entropyBits + checksumBits + var chunks = bits.match(/(.{1,11})/g) +- var words = chunks.map(function (binary) { ++ var wordsAsBuffers = chunks.map(function (binary) { + var index = binaryToByte(binary) +- return wordlist[index] ++ return Buffer.from(wordlist[index], 'utf8') + }) + +- return wordlist === JAPANESE_WORDLIST ? words.join('\u3000') : words.join(' ') ++ var bufferSize = wordsAsBuffers.reduce(function (bufferSize, wordAsBuffer, i) { ++ var shouldAddSeparator = i < wordsAsBuffers.length - 1 ++ return ( ++ bufferSize + ++ wordAsBuffer.length + ++ (shouldAddSeparator ? 1 : 0) ++ ) ++ }, 0) ++ var separator = wordlist === JAPANESE_WORDLIST ? '\u3000' : ' ' ++ var result = wordsAsBuffers.reduce(function (result, wordAsBuffer, i) { ++ var shouldAddSeparator = i < wordsAsBuffers.length - 1 ++ result.workingBuffer.set(wordAsBuffer, result.offset) ++ if (shouldAddSeparator) { ++ result.workingBuffer.write( ++ separator, ++ result.offset + wordAsBuffer.length, ++ separator.length, ++ 'utf8' ++ ) ++ } ++ return { ++ workingBuffer: result.workingBuffer, ++ offset: ( ++ result.offset + ++ wordAsBuffer.length + ++ (shouldAddSeparator ? 1 : 0) ++ ) ++ } ++ }, { workingBuffer: Buffer.alloc(bufferSize), offset: 0 }) ++ return result.workingBuffer; + } + + function generateMnemonic (strength, rng, wordlist) { +@@ -124,6 +171,7 @@ function validateMnemonic (mnemonic, wordlist) { + try { + mnemonicToEntropy(mnemonic, wordlist) + } catch (e) { ++ console.log('could not validate mnemonic', e) + return false + } + diff --git a/patches/eth-hd-keyring+3.6.0.patch b/patches/eth-hd-keyring+3.6.0.patch new file mode 100644 index 000000000000..211cb89dd200 --- /dev/null +++ b/patches/eth-hd-keyring+3.6.0.patch @@ -0,0 +1,43 @@ +diff --git a/node_modules/eth-hd-keyring/index.js b/node_modules/eth-hd-keyring/index.js +index 19d1d7f..350d6b8 100644 +--- a/node_modules/eth-hd-keyring/index.js ++++ b/node_modules/eth-hd-keyring/index.js +@@ -17,8 +17,11 @@ class HdKeyring extends SimpleKeyring { + } + + serialize () { ++ const mnemonicAsBuffer = typeof this.mnemonic === 'string' ++ ? Buffer.from(this.mnemonic, 'utf8') ++ : this.mnemonic + return Promise.resolve({ +- mnemonic: this.mnemonic, ++ mnemonic: Array.from(mnemonicAsBuffer.values()), + numberOfAccounts: this.wallets.length, + hdPath: this.hdPath, + }) +@@ -69,9 +72,22 @@ class HdKeyring extends SimpleKeyring { + + /* PRIVATE METHODS */ + +- _initFromMnemonic (mnemonic) { +- this.mnemonic = mnemonic +- const seed = bip39.mnemonicToSeed(mnemonic) ++ /** ++ * Sets appropriate properties for the keyring based on the given ++ * BIP39-compliant mnemonic. ++ * ++ * @param {string|Array|Buffer} mnemonic - A seed phrase represented ++ * as a string, an array of UTF-8 bytes, or a Buffer. ++ */ ++ _initFromMnemonic(mnemonic) { ++ if (typeof mnemonic === 'string') { ++ this.mnemonic = Buffer.from(mnemonic, 'utf8') ++ } else if (Array.isArray(mnemonic)) { ++ this.mnemonic = Buffer.from(mnemonic) ++ } else { ++ this.mnemonic = mnemonic ++ } ++ const seed = bip39.mnemonicToSeed(this.mnemonic) + this.hdWallet = hdkey.fromMasterSeed(seed) + this.root = this.hdWallet.derivePath(this.hdPath) + } diff --git a/patches/eth-keyring-controller+6.2.1.patch b/patches/eth-keyring-controller+6.2.1.patch new file mode 100644 index 000000000000..aec0c716821d --- /dev/null +++ b/patches/eth-keyring-controller+6.2.1.patch @@ -0,0 +1,37 @@ +diff --git a/node_modules/eth-keyring-controller/index.js b/node_modules/eth-keyring-controller/index.js +index 250ab98..38615aa 100644 +--- a/node_modules/eth-keyring-controller/index.js ++++ b/node_modules/eth-keyring-controller/index.js +@@ -84,15 +84,20 @@ class KeyringController extends EventEmitter { + * + * @emits KeyringController#unlock + * @param {string} password - The password to encrypt the vault with +- * @param {string} seed - The BIP44-compliant seed phrase. ++ * @param {string|Array} seedPhrase - The BIP39-compliant seed phrase, ++ * either as a string or an array of UTF-8 bytes that represent the string. + * @returns {Promise} A Promise that resolves to the state. + */ +- createNewVaultAndRestore (password, seed) { ++ createNewVaultAndRestore(password, seedPhrase) { ++ const seedPhraseAsBuffer = typeof seedPhrase === 'string' ++ ? Buffer.from(seedPhrase, 'utf8') ++ : Buffer.from(seedPhrase) ++ + if (typeof password !== 'string') { + return Promise.reject(new Error('Password must be text.')) + } + +- if (!bip39.validateMnemonic(seed)) { ++ if (!bip39.validateMnemonic(seedPhraseAsBuffer)) { + return Promise.reject(new Error('Seed phrase is invalid.')) + } + +@@ -101,7 +106,7 @@ class KeyringController extends EventEmitter { + return this.persistAllKeyrings(password) + .then(() => { + return this.addNewKeyring('HD Key Tree', { +- mnemonic: seed, ++ mnemonic: seedPhraseAsBuffer, + numberOfAccounts: 1, + }) + }) diff --git a/patches/yargs+17.4.1.patch b/patches/yargs+17.4.1.patch deleted file mode 100644 index 2daf3489c78e..000000000000 --- a/patches/yargs+17.4.1.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/node_modules/yargs/build/index.cjs b/node_modules/yargs/build/index.cjs -index b36980a..8c50028 100644 ---- a/node_modules/yargs/build/index.cjs -+++ b/node_modules/yargs/build/index.cjs -@@ -1 +1,5 @@ --"use strict";var t=require("assert");class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace(this,e)}}let s,i=[];function n(t,o,a,h){s=h;let l={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return l;const r=/\.json|\..*rc$/.test(t.extends);let h=null;if(r)h=function(t,e){return s.path.resolve(t,e)}(o,t.extends);else try{h=require.resolve(t.extends)}catch(e){return t}!function(t){if(i.indexOf(t)>-1)throw new e(`Circular extended configurations: '${t}'.`)}(h),i.push(h),l=r?JSON.parse(s.readFileSync(h,"utf8")):require(t.extends),delete t.extends,l=n(l,s.path.dirname(h),a,s)}return i=[],a?r(l,t):Object.assign({},l,t)}function r(t,e){const s={};function i(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(s,t);for(const n of Object.keys(e))i(e[n])&&i(s[n])?s[n]=r(t[n],e[n]):s[n]=e[n];return s}function o(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${t}`);const n={cmd:i.replace(s,""),demanded:[],optional:[]};return e.forEach(((t,i)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&i===e.length-1&&(r=!0),/^\[/.test(t)?n.optional.push({cmd:t.replace(s,"").split("|"),variadic:r}):n.demanded.push({cmd:t.replace(s,"").split("|"),variadic:r})})),n}const a=["first","second","third","fourth","fifth","sixth"];function h(t,s,i){try{let n=0;const[r,a,h]="object"==typeof t?[{demanded:[],optional:[]},t,s]:[o(`cmd ${t}`),s,i],f=[].slice.call(a);for(;f.length&&void 0===f[f.length-1];)f.pop();const d=h||f.length;if(du)throw new e(`Too many arguments provided. Expected max ${u} but received ${d}.`);r.demanded.forEach((t=>{const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1})),r.optional.forEach((t=>{if(0===f.length)return;const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1}))}catch(t){console.warn(t.stack)}}function l(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function c(t,s,i){throw new e(`Invalid ${a[i]||"manyith"} argument. Expected ${s.join(" or ")} but received ${t}.`)}function f(t){return!!t&&!!t.then&&"function"==typeof t.then}function d(t,e,s,i){s.assert.notStrictEqual(t,e,i)}function u(t,e){e.assert.strictEqual(typeof t,"string")}function p(t){return Object.keys(t)}function g(t={},e=(()=>!0)){const s={};return p(t).forEach((i=>{e(i,t[i])&&(s[i]=t[i])})),s}function m(){return process.versions.electron&&!process.defaultApp?0:1}function y(){return process.argv[m()]}var b=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(m()+1)},getProcessArgvBin:y});function v(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)}function O(t,e,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(t,s):n?n.value=s:e.set(t,s),s}class w{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,s=!0,i=!1){if(h(" [boolean] [boolean] [boolean]",[t,e,s],arguments.length),Array.isArray(t)){for(let i=0;i{const i=[...s[e]||[],e];return!t.option||!i.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function C(t,e,s,i){return s.reduce(((t,s)=>{if(s.applyBeforeValidation!==i)return t;if(s.mutates){if(s.applied)return t;s.applied=!0}if(f(t))return t.then((t=>Promise.all([t,s(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const i=s(t,e);return f(i)?i.then((e=>Object.assign(t,e))):Object.assign(t,i)}}),t)}function j(t,e,s=(t=>{throw t})){try{const s="function"==typeof t?t():t;return f(s)?s.then((t=>e(t))):e(s)}catch(t){return s(t)}}const _=/(^\*)|(^\$0)/;class M{constructor(t,e,s,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=s,this.validation=e}addDirectory(t,e,s,i){"boolean"!=typeof(i=i||{}).recurse&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);const n="function"==typeof i.visit?i.visit:t=>t;i.visit=(t,e,s)=>{const i=n(t,e,s);if(i){if(this.requireCache.has(e))return i;this.requireCache.add(e),this.addHandler(i)}return i},this.shim.requireDirectory({require:e,filename:s},t,i)}addHandler(t,e,s,i,n,r){let a=[];const h=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(n);if(i=i||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...a]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(k(s))return void this.addHandler([t].concat(a),e,s.builder,s.handler,s.middlewares,s.deprecated)}if("string"==typeof t){const n=o(t);a=a.map((t=>o(t).cmd));let l=!1;const c=[n.cmd].concat(a).filter((t=>!_.test(t)||(l=!0,!1)));0===c.length&&l&&c.push("$0"),l&&(n.cmd=c[0],a=c.slice(1),t=t.replace(_,n.cmd)),a.forEach((t=>{this.aliasMap[t]=n.cmd})),!1!==e&&this.usage.command(t,e,l,a,r),this.handlers[n.cmd]={original:t,description:e,handler:i,builder:s||{},middlewares:h,deprecated:r,demanded:n.demanded,optional:n.optional},l&&(this.defaultCommand=this.handlers[n.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,s,i,n,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),h=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const c=this.applyBuilderUpdateUsageAndParse(l,o,e,s.aliases,h,i,n,r);return f(c)?c.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,n,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,c.innerArgv,a,n,c.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,s,i,n,r,o,a){const h=e.builder;let l=s;if(x(h)){const c=h(s.getInternalMethods().reset(i),a);if(f(c))return c.then((i=>{var a;return l=(a=i)&&"function"==typeof a.getInternalMethods?i:s,this.parseAndUpdateUsage(t,e,l,n,r,o)}))}else(function(t){return"object"==typeof t})(h)&&(l=s.getInternalMethods().reset(i),Object.keys(e.builder).forEach((t=>{l.option(t,h[t])})));return this.parseAndUpdateUsage(t,e,l,n,r,o)}parseAndUpdateUsage(t,e,s,i,n,r){t&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);const o=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,n,r);return f(o)?o.then((t=>({aliases:s.parsed.aliases,innerArgv:t}))):{aliases:s.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const s=_.test(e.original)?e.original.replace(_,"").trim():e.original,i=t.filter((t=>!_.test(t)));return i.push(s),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(t,e,s,i,n,r,o){let a={};if(n)return s;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,s,i,o));const h=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares);if(s=C(s,o,h,!0),!o.getInternalMethods().getHasOutput()){const e=o.getInternalMethods().runValidation(r,a,o.parsed.error,t);s=j(s,(t=>(e(t),t)))}if(e.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();const i=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(s,i,!1,!1),s=j(s=C(s,o,h,!1),(t=>{const s=e.handler(t);return f(s)?s.then((()=>t)):t})),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),f(s)&&!o.getInternalMethods().hasParseCallback()&&s.catch((t=>{try{o.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(i.commands.pop(),i.fullCommands.pop()),s}populatePositionals(t,e,s,i){e._=e._.slice(s.commands.length);const n=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(n.length,e._.length);n.length;){const t=n.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=s.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),i),o}populatePositional(t,e,s){const i=t.cmd[0];t.variadic?s[i]=e._.splice(0).map(String):e._.length&&(s[i]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},s=o(t);return s.demanded.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i,e.demand[s]=!0})),s.optional.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i})),e}postProcessPositionals(t,e,s,i){const n=Object.assign({},i.getOptions());n.default=Object.assign(s.default,n.default);for(const t of Object.keys(s.alias))n.alias[t]=(n.alias[t]||[]).concat(s.alias[t]);n.array=n.array.concat(s.array),n.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{n.configuration["unknown-options-as-args"]&&(n.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},n.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},n,{configuration:o}));if(a.error)i.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const s=Object.keys(e);Object.keys(e).forEach((t=>{s.push(...a.aliases[t])}));const n=i.getOptions().default;Object.keys(a.argv).forEach((i=>{s.includes(i)&&(e[i]||(e[i]=a.argv[i]),!Object.hasOwnProperty.call(n,i)&&Object.hasOwnProperty.call(t,i)&&Object.hasOwnProperty.call(a.argv,i)&&(Array.isArray(t[i])||Array.isArray(a.argv[i]))?t[i]=[].concat(t[i],a.argv[i]):t[i]=a.argv[i])}))}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=_.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(x(e))return e(t,!0);k(e)||Object.keys(e).forEach((s=>{t.option(s,e[s])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,s=0,i=Object.keys(require.cache);s{const s=e;s._handle&&s.isTTY&&"function"==typeof s._handle.setBlocking&&s._handle.setBlocking(t)}))}function A(t){return"boolean"==typeof t}function P(t,s){const i=s.y18n.__,n={},r=[];n.failFn=function(t){r.push(t)};let o=null,a=null,h=!0;n.showHelpOnFail=function(e=!0,s){const[i,r]="string"==typeof e?[!0,e]:[e,s];return t.getInternalMethods().isGlobalContext()&&(a=r),o=r,h=i,n};let l=!1;n.fail=function(s,i){const c=t.getInternalMethods().getLoggerInstance();if(!r.length){if(t.getExitProcess()&&E(!0),!l){l=!0,h&&(t.showHelp("error"),c.error()),(s||i)&&c.error(s||i);const e=o||a;e&&((s||i)&&c.error(""),c.error(e))}if(i=i||new e(s),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,i);throw i}for(let t=r.length-1;t>=0;--t){const e=r[t];if(A(e)){if(i)throw i;if(s)throw Error(s)}else e(s,i,n)}};let c=[],f=!1;n.usage=(t,e)=>null===t?(f=!0,c=[],n):(f=!1,c.push([t,e||""]),n),n.getUsage=()=>c,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>i("Positionals:");let d=[];n.example=(t,e)=>{d.push([t,e||""])};let u=[];n.command=function(t,e,s,i,n=!1){s&&(u=u.map((t=>(t[2]=!1,t)))),u.push([t,e||"",s,i,n])},n.getCommands=()=>u;let p={};n.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{n.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{n.describe(e,t[e])})):p[t]=e},n.getDescriptions=()=>p;let m=[];n.epilog=t=>{m.push(t)};let y,b=!1;function v(){return b||(y=function(){const t=80;return s.process.stdColumns?Math.min(t,s.process.stdColumns):t}(),b=!0),y}n.wrap=t=>{b=!0,y=t};const O="__yargsString__:";function w(t,e,i){let n=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{n=Math.max(s.stringWidth(i?`${i} ${I(t[0])}`:I(t[0]))+$(t[0]),n)})),e&&(n=Math.min(n,parseInt((.5*e).toString(),10))),n}let C;function j(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function _(t,e){let s=`[${i("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}n.deferY18nLookup=t=>O+t,n.help=function(){if(C)return C;!function(){const e=t.getDemandedOptions(),s=t.getOptions();(Object.keys(s.alias)||[]).forEach((i=>{s.alias[i].forEach((r=>{p[r]&&n.describe(i,p[r]),r in e&&t.demandOption(i,e[r]),s.boolean.includes(r)&&t.boolean(i),s.count.includes(r)&&t.count(i),s.string.includes(r)&&t.string(i),s.normalize.includes(r)&&t.normalize(i),s.array.includes(r)&&t.array(i),s.number.includes(r)&&t.number(i)}))}))}();const e=t.customScriptName?t.$0:s.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),h=t.getGroups(),l=t.getOptions();let g=[];g=g.concat(Object.keys(p)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(l.default)),g=g.filter(j),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const y=v(),b=s.cliui({width:y,wrap:!!y});if(!f)if(c.length)c.forEach((t=>{b.div({text:`${t[0].replace(/\$0/g,e)}`}),t[1]&&b.div({text:`${t[1]}`,padding:[1,0,0,0]})})),b.div();else if(u.length){let t=null;t=o._?`${e} <${i("command")}>\n`:`${e} [${i("command")}]\n`,b.div(`${t}`)}if(u.length>1||1===u.length&&!u[0][2]){b.div(i("Commands:"));const s=t.getInternalMethods().getContext(),n=s.commands.length?`${s.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(u=u.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=e?`${e} `:"";u.forEach((t=>{const s=`${r}${n}${t[0].replace(/^\$0 ?/,"")}`;b.span({text:s,padding:[0,2,0,2],width:w(u,y,`${e}${n}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${i("default")}]`),t[3]&&t[3].length&&o.push(`[${i("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${i("deprecated: %s",t[4])}]`):o.push(`[${i("deprecated")}]`)),o.length?b.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):b.div()})),b.div()}const M=(Object.keys(l.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&M.every((t=>-1===(l.alias[t]||[]).indexOf(e)))));const k=i("Options:");h[k]||(h[k]=[]),function(t,e,s,i){let n=[],r=null;Object.keys(s).forEach((t=>{n=n.concat(s[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==n.indexOf(t)))||s[i].push(t)}))}(g,l.alias,h,k);const x=t=>/^--/.test(I(t)),E=Object.keys(h).filter((t=>h[t].length>0)).map((t=>({groupName:t,normalizedKeys:h[t].filter(j).map((t=>{if(M.includes(t))return t;for(let e,s=0;void 0!==(e=M[s]);s++)if((l.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const s=e.reduce(((e,s)=>(e[s]=[s].concat(l.alias[s]||[]).map((e=>t===n.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?l.boolean.includes(s)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>x(t)===x(e)?0:x(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:s}}));if(E.filter((({groupName:t})=>t!==n.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>x(e[t])))))&&E.filter((({groupName:t})=>t!==n.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var s,i;x(e[t])&&(e[t]=(s=e[t],i="-x, ".length,S(s)?{text:s.text,indentation:s.indentation+i}:{text:s,indentation:i}))}))})),E.forEach((({groupName:t,normalizedKeys:e,switches:s})=>{b.div(t),e.forEach((t=>{const e=s[t];let o=p[t]||"",h=null;o.includes(O)&&(o=i(o.substring(O.length))),l.boolean.includes(t)&&(h=`[${i("boolean")}]`),l.count.includes(t)&&(h=`[${i("count")}]`),l.string.includes(t)&&(h=`[${i("string")}]`),l.normalize.includes(t)&&(h=`[${i("string")}]`),l.array.includes(t)&&(h=`[${i("array")}]`),l.number.includes(t)&&(h=`[${i("number")}]`);const c=[t in a?(f=a[t],"string"==typeof f?`[${i("deprecated: %s",f)}]`:`[${i("deprecated")}]`):null,h,t in r?`[${i("required")}]`:null,l.choices&&l.choices[t]?`[${i("choices:")} ${n.stringifiedValues(l.choices[t])}]`:null,_(l.default[t],l.defaultDescription[t])].filter(Boolean).join(" ");var f;b.span({text:I(e),padding:[0,2,0,2+$(e)],width:w(s,y)+4},o),c?b.div({text:c,padding:[0,0,0,2],align:"right"}):b.div()})),b.div()})),d.length&&(b.div(i("Examples:")),d.forEach((t=>{t[0]=t[0].replace(/\$0/g,e)})),d.forEach((t=>{""===t[1]?b.div({text:t[0],padding:[0,2,0,2]}):b.div({text:t[0],padding:[0,2,0,2],width:w(d,y)+4},{text:t[1]})})),b.div()),m.length>0){const t=m.map((t=>t.replace(/\$0/g,e))).join("\n");b.div(`${t}\n`)}return b.toString().replace(/\s*$/,"")},n.cacheHelpMessage=function(){C=this.help()},n.clearCachedHelpMessage=function(){C=void 0},n.hasCachedHelpMessage=function(){return!!C},n.showHelp=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(n.help())},n.functionDescription=t=>["(",t.name?s.Parser.decamelize(t.name,"-"):i("generated-value"),")"].join(""),n.stringifiedValues=function(t,e){let s="";const i=e||", ",n=[].concat(t);return t&&n.length?(n.forEach((t=>{s.length&&(s+=i),s+=JSON.stringify(t)})),s):s};let M=null;n.version=t=>{M=t},n.showVersion=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(M)},n.reset=function(t){return o=null,l=!1,c=[],f=!1,m=[],d=[],u=[],p=g(p,(e=>!t[e])),n};const k=[];return n.freeze=function(){k.push({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p})},n.unfreeze=function(t=!1){const e=k.pop();e&&(t?(p={...e.descriptions,...p},u=[...e.commands,...u],c=[...e.usages,...c],d=[...e.examples,...d],m=[...e.epilogs,...m]):({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p}=e))},n}function S(t){return"object"==typeof t}function $(t){return S(t)?t.indentation:0}function I(t){return S(t)?t.text:t}class N{constructor(t,e,s,i){var n,r,o;this.yargs=t,this.usage=e,this.command=s,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(n=this.shim.getEnv("SHELL"))||void 0===n?void 0:n.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,s,i){const n=this.command.getCommandHandlers();for(let e=0,s=t.length;e{const i=o(s[0]).cmd;if(-1===e.indexOf(i))if(this.zshShell){const e=s[1]||"";t.push(i.replace(/:/g,"\\:")+":"+e)}else t.push(i)}))}optionCompletions(t,e,s,i){if((i.match(/^-/)||""===i&&0===t.length)&&!this.previousArgHasChoices(e)){const n=this.yargs.getOptions(),r=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach((o=>{const a=!!n.configuration["boolean-negation"]&&n.boolean.includes(o);r.includes(o)||n.hiddenOptions.includes(o)||this.argsContainKey(e,s,o,a)||(this.completeOptionKey(o,t,i),a&&n.default[o]&&this.completeOptionKey(`no-${o}`,t,i))}))}}choicesFromOptionsCompletions(t,e,s,i){if(this.previousArgHasChoices(e)){const s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,s,i){if(""===i&&t.length>0&&this.previousArgHasChoices(e))return;const n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=n[s._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(i)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],s="";if(!e.startsWith("-")&&t.length>1&&(s=e,e=t[t.length-2]),!e.startsWith("-"))return;const i=e.replace(/^-+/,""),n=this.yargs.getOptions(),r=[i,...this.yargs.getAliases()[i]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(n.key,t)&&Array.isArray(n.choices[t])){o=n.choices[t];break}return o?o.filter((t=>!s||t.startsWith(s))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,s,i){if(-1!==t.indexOf(`--${s}`))return!0;if(i&&-1!==t.indexOf(`--no-${s}`))return!0;if(this.aliases)for(const t of this.aliases[s])if(void 0!==e[t])return!0;return!1}completeOptionKey(t,e,s){const i=this.usage.getDescriptions(),n=!/^--/.test(s)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";if(this.zshShell){const s=i[t]||"";e.push(n+`${t.replace(/:/g,"\\:")}:${s.replace("__yargsString__:","")}`)}else e.push(n+t)}customCompletion(t,e,s,i){if(d(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(s,e);return f(t)?t.then((t=>{this.shim.process.nextTick((()=>{i(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{i(t,void 0)}))})):i(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(s,e,((n=i)=>this.defaultCompletion(t,e,s,n)),(t=>{i(null,t)})):this.customCompletionFunction(s,e,(t=>{i(null,t)}))}getCompletion(t,e){const s=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),n=this.customCompletionFunction?i=>this.customCompletion(t,i,s,e):i=>this.defaultCompletion(t,i,s,e);return f(i)?i.then(n):n(i)}generateCompletionScript(t,e){let s=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,i),s=s.replace(/{{completion_command}}/g,e),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function D(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const s=[];let i,n;for(i=0;i<=e.length;i++)s[i]=[i];for(n=0;n<=t.length;n++)s[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?s[i][n]=s[i-1][n-1]:i>1&&n>1&&e.charAt(i-2)===t.charAt(n-1)&&e.charAt(i-1)===t.charAt(n-2)?s[i][n]=s[i-2][n-2]+1:s[i][n]=Math.min(s[i-1][n-1]+1,Math.min(s[i][n-1]+1,s[i-1][n]+1));return s[e.length][t.length]}const H=["$0","--","_"];var z,q,W,F,U,L,V,G,R,T,K,B,Y,J,Z,X,Q,tt,et,st,it,nt,rt,ot,at,ht,lt,ct,ft,dt,ut,pt,gt,mt;const yt=Symbol("copyDoubleDash"),bt=Symbol("copyDoubleDash"),vt=Symbol("deleteFromParserHintObject"),Ot=Symbol("emitWarning"),wt=Symbol("freeze"),Ct=Symbol("getDollarZero"),jt=Symbol("getParserConfiguration"),_t=Symbol("guessLocale"),Mt=Symbol("guessVersion"),kt=Symbol("parsePositionalNumbers"),xt=Symbol("pkgUp"),Et=Symbol("populateParserHintArray"),At=Symbol("populateParserHintSingleValueDictionary"),Pt=Symbol("populateParserHintArrayDictionary"),St=Symbol("populateParserHintDictionary"),$t=Symbol("sanitizeKey"),It=Symbol("setKey"),Nt=Symbol("unfreeze"),Dt=Symbol("validateAsync"),Ht=Symbol("getCommandInstance"),zt=Symbol("getContext"),qt=Symbol("getHasOutput"),Wt=Symbol("getLoggerInstance"),Ft=Symbol("getParseContext"),Ut=Symbol("getUsageInstance"),Lt=Symbol("getValidationInstance"),Vt=Symbol("hasParseCallback"),Gt=Symbol("isGlobalContext"),Rt=Symbol("postProcess"),Tt=Symbol("rebase"),Kt=Symbol("reset"),Bt=Symbol("runYargsParserAndExecuteCommands"),Yt=Symbol("runValidation"),Jt=Symbol("setHasOutput"),Zt=Symbol("kTrackManuallySetKeys");class Xt{constructor(t=[],e,s,i){this.customScriptName=!1,this.parsed=!1,z.set(this,void 0),q.set(this,void 0),W.set(this,{commands:[],fullCommands:[]}),F.set(this,null),U.set(this,null),L.set(this,"show-hidden"),V.set(this,null),G.set(this,!0),R.set(this,{}),T.set(this,!0),K.set(this,[]),B.set(this,void 0),Y.set(this,{}),J.set(this,!1),Z.set(this,null),X.set(this,!0),Q.set(this,void 0),tt.set(this,""),et.set(this,void 0),st.set(this,void 0),it.set(this,{}),nt.set(this,null),rt.set(this,null),ot.set(this,{}),at.set(this,{}),ht.set(this,void 0),lt.set(this,!1),ct.set(this,void 0),ft.set(this,!1),dt.set(this,!1),ut.set(this,!1),pt.set(this,void 0),gt.set(this,null),mt.set(this,void 0),O(this,ct,i,"f"),O(this,ht,t,"f"),O(this,q,e,"f"),O(this,st,s,"f"),O(this,B,new w(this),"f"),this.$0=this[Ct](),this[Kt](),O(this,z,v(this,z,"f"),"f"),O(this,pt,v(this,pt,"f"),"f"),O(this,mt,v(this,mt,"f"),"f"),O(this,et,v(this,et,"f"),"f"),v(this,et,"f").showHiddenOpt=v(this,L,"f"),O(this,Q,this[bt](),"f")}addHelpOpt(t,e){return h("[string|boolean] [string]",[t,e],arguments.length),v(this,Z,"f")&&(this[vt](v(this,Z,"f")),O(this,Z,null,"f")),!1===t&&void 0===e||(O(this,Z,"string"==typeof t?t:"help","f"),this.boolean(v(this,Z,"f")),this.describe(v(this,Z,"f"),e||v(this,pt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(h("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const s="string"==typeof t?t:v(this,L,"f");return this.boolean(s),this.describe(s,e||v(this,pt,"f").deferY18nLookup("Show hidden options")),v(this,et,"f").showHiddenOpt=s,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return h(" [string|array]",[t,e],arguments.length),this[Pt](this.alias.bind(this),"alias",t,e),this}array(t){return h("",[t],arguments.length),this[Et]("array",t),this[Zt](t),this}boolean(t){return h("",[t],arguments.length),this[Et]("boolean",t),this[Zt](t),this}check(t,e){return h(" [boolean]",[t,e],arguments.length),this.middleware(((e,s)=>j((()=>t(e,s.getOptions())),(s=>(s?("string"==typeof s||s instanceof Error)&&v(this,pt,"f").fail(s.toString(),s):v(this,pt,"f").fail(v(this,ct,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(v(this,pt,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return h(" [string|array]",[t,e],arguments.length),this[Pt](this.choices.bind(this),"choices",t,e),this}coerce(t,s){if(h(" [function]",[t,s],arguments.length),Array.isArray(t)){if(!s)throw new e("coerce callback must be provided");for(const e of t)this.coerce(e,s);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!s)throw new e("coerce callback must be provided");return v(this,et,"f").key[t]=!0,v(this,B,"f").addCoerceMiddleware(((i,n)=>{let r;return Object.hasOwnProperty.call(i,t)?j((()=>(r=n.getAliases(),s(i[t]))),(e=>{i[t]=e;const s=n.getInternalMethods().getParserConfiguration()["strip-aliased"];if(r[t]&&!0!==s)for(const s of r[t])i[s]=e;return i}),(t=>{throw new e(t.message)})):i}),t),this}conflicts(t,e){return h(" [string|array]",[t,e],arguments.length),v(this,mt,"f").conflicts(t,e),this}config(t="config",e,s){return h("[object|string] [string|function] [function]",[t,e,s],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(s=e,e=void 0),this.describe(t,e||v(this,pt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{v(this,et,"f").config[t]=s||!0})),this):(t=n(t,v(this,q,"f"),this[jt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(t),this)}completion(t,e,s){return h("[string] [string|boolean|function] [function]",[t,e,s],arguments.length),"function"==typeof e&&(s=e,e=void 0),O(this,U,t||v(this,U,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(v(this,U,"f"),e),s&&v(this,F,"f").registerFunction(s),this}command(t,e,s,i,n,r){return h(" [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,s,i,n,r],arguments.length),v(this,z,"f").addHandler(t,e,s,i,n,r),this}commands(t,e,s,i,n,r){return this.command(t,e,s,i,n,r)}commandDir(t,e){h(" [object]",[t,e],arguments.length);const s=v(this,st,"f")||v(this,ct,"f").require;return v(this,z,"f").addDirectory(t,s,v(this,ct,"f").getCallerFile(),e),this}count(t){return h("",[t],arguments.length),this[Et]("count",t),this[Zt](t),this}default(t,e,s){return h(" [*] [string]",[t,e,s],arguments.length),s&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]=s),"function"==typeof e&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]||(v(this,et,"f").defaultDescription[t]=v(this,pt,"f").functionDescription(e)),e=e.call()),this[At](this.default.bind(this),"default",t,e),this}defaults(t,e,s){return this.default(t,e,s)}demandCommand(t=1,e,s,i){return h("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,s,i],arguments.length),"number"!=typeof e&&(s=e,e=1/0),this.global("_",!1),v(this,et,"f").demandedCommands._={min:t,max:e,minMsg:s,maxMsg:i},this}demand(t,e,s){return Array.isArray(e)?(e.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})),e=1/0):"number"!=typeof e&&(s=e,e=1/0),"number"==typeof t?(d(s,!0,v(this,ct,"f")),this.demandCommand(t,e,s,s)):Array.isArray(t)?t.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})):"string"==typeof s?this.demandOption(t,s):!0!==s&&void 0!==s||this.demandOption(t),this}demandOption(t,e){return h(" [string]",[t,e],arguments.length),this[At](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return h(" [string|boolean]",[t,e],arguments.length),v(this,et,"f").deprecatedOptions[t]=e,this}describe(t,e){return h(" [string]",[t,e],arguments.length),this[It](t,!0),v(this,pt,"f").describe(t,e),this}detectLocale(t){return h("",[t],arguments.length),O(this,G,t,"f"),this}env(t){return h("[string|boolean]",[t],arguments.length),!1===t?delete v(this,et,"f").envPrefix:v(this,et,"f").envPrefix=t||"",this}epilogue(t){return h("",[t],arguments.length),v(this,pt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return h(" [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):v(this,pt,"f").example(t,e),this}exit(t,e){O(this,J,!0,"f"),O(this,V,e,"f"),v(this,T,"f")&&v(this,ct,"f").process.exit(t)}exitProcess(t=!0){return h("[boolean]",[t],arguments.length),O(this,T,t,"f"),this}fail(t){if(h("",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new e("Invalid first argument. Expected function or boolean 'false'");return v(this,pt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return h(" [function]",[t,e],arguments.length),e?v(this,F,"f").getCompletion(t,e):new Promise(((e,s)=>{v(this,F,"f").getCompletion(t,((t,i)=>{t?s(t):e(i)}))}))}getDemandedOptions(){return h([],0),v(this,et,"f").demandedOptions}getDemandedCommands(){return h([],0),v(this,et,"f").demandedCommands}getDeprecatedOptions(){return h([],0),v(this,et,"f").deprecatedOptions}getDetectLocale(){return v(this,G,"f")}getExitProcess(){return v(this,T,"f")}getGroups(){return Object.assign({},v(this,Y,"f"),v(this,at,"f"))}getHelp(){if(O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Bt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(t))return t.then((()=>v(this,pt,"f").help()))}const t=v(this,z,"f").runDefaultBuilderOn(this);if(f(t))return t.then((()=>v(this,pt,"f").help()))}return Promise.resolve(v(this,pt,"f").help())}getOptions(){return v(this,et,"f")}getStrict(){return v(this,ft,"f")}getStrictCommands(){return v(this,dt,"f")}getStrictOptions(){return v(this,ut,"f")}global(t,e){return h(" [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?v(this,et,"f").local=v(this,et,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{v(this,et,"f").local.includes(t)||v(this,et,"f").local.push(t)})),this}group(t,e){h(" ",[t,e],arguments.length);const s=v(this,at,"f")[e]||v(this,Y,"f")[e];v(this,at,"f")[e]&&delete v(this,at,"f")[e];const i={};return v(this,Y,"f")[e]=(s||[]).concat(t).filter((t=>!i[t]&&(i[t]=!0))),this}hide(t){return h("",[t],arguments.length),v(this,et,"f").hiddenOptions.push(t),this}implies(t,e){return h(" [number|string|array]",[t,e],arguments.length),v(this,mt,"f").implies(t,e),this}locale(t){return h("[string]",[t],arguments.length),t?(O(this,G,!1,"f"),v(this,ct,"f").y18n.setLocale(t),this):(this[_t](),v(this,ct,"f").y18n.getLocale())}middleware(t,e,s){return v(this,B,"f").addMiddleware(t,!!e,s)}nargs(t,e){return h(" [number]",[t,e],arguments.length),this[At](this.nargs.bind(this),"narg",t,e),this}normalize(t){return h("",[t],arguments.length),this[Et]("normalize",t),this}number(t){return h("",[t],arguments.length),this[Et]("number",t),this[Zt](t),this}option(t,e){if(h(" [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Zt](t),!v(this,gt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[Ot](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),v(this,et,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const s=e.deprecate||e.deprecated;s&&this.deprecateOption(t,s);const i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(v(this,et,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const n=e.describe||e.description||e.desc;this.describe(t,n),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,s){h("[string|array] [function|boolean|object] [function]",[t,e,s],arguments.length),this[wt](),void 0===t&&(t=v(this,ht,"f")),"object"==typeof e&&(O(this,rt,e,"f"),e=s),"function"==typeof e&&(O(this,nt,e,"f"),e=!1),e||O(this,ht,t,"f"),v(this,nt,"f")&&O(this,T,!1,"f");const i=this[Bt](t,!!e),n=this.parsed;return v(this,F,"f").setParsed(this.parsed),f(i)?i.then((t=>(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),t,v(this,tt,"f")),t))).catch((t=>{throw v(this,nt,"f")&&v(this,nt,"f")(t,this.parsed.argv,v(this,tt,"f")),t})).finally((()=>{this[Nt](),this.parsed=n})):(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),i,v(this,tt,"f")),this[Nt](),this.parsed=n,i)}parseAsync(t,e,s){const i=this.parse(t,e,s);return f(i)?i:Promise.resolve(i)}parseSync(t,s,i){const n=this.parse(t,s,i);if(f(n))throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return n}parserConfiguration(t){return h("",[t],arguments.length),O(this,it,t,"f"),this}pkgConf(t,e){h(" [string]",[t,e],arguments.length);let s=null;const i=this[xt](e||v(this,q,"f"));return i[t]&&"object"==typeof i[t]&&(s=n(i[t],e||v(this,q,"f"),this[jt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(s)),this}positional(t,e){h(" ",[t,e],arguments.length);const s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=g(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&s.includes(t)));const i=v(this,W,"f").fullCommands[v(this,W,"f").fullCommands.length-1],n=i?v(this,z,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return p(n).forEach((s=>{const i=n[s];Array.isArray(i)?-1!==i.indexOf(t)&&(e[s]=!0):i[t]&&!(s in e)&&(e[s]=i[t])})),this.group(t,v(this,pt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return h("[boolean]",[t],arguments.length),O(this,lt,t,"f"),this}required(t,e,s){return this.demand(t,e,s)}require(t,e,s){return this.demand(t,e,s)}requiresArg(t){return h(" [number]",[t],arguments.length),"string"==typeof t&&v(this,et,"f").narg[t]||this[At](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return h("[string] [string]",[t,e],arguments.length),t=t||this.$0,v(this,Q,"f").log(v(this,F,"f").generateCompletionScript(t,e||v(this,U,"f")||"completion")),this}showHelp(t){if(h("[string|function]",[t],arguments.length),O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Bt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}const e=v(this,z,"f").runDefaultBuilderOn(this);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}return v(this,pt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return h("[boolean|string] [string]",[t,e],arguments.length),v(this,pt,"f").showHelpOnFail(t,e),this}showVersion(t){return h("[string|function]",[t],arguments.length),v(this,pt,"f").showVersion(t),this}skipValidation(t){return h("",[t],arguments.length),this[Et]("skipValidation",t),this}strict(t){return h("[boolean]",[t],arguments.length),O(this,ft,!1!==t,"f"),this}strictCommands(t){return h("[boolean]",[t],arguments.length),O(this,dt,!1!==t,"f"),this}strictOptions(t){return h("[boolean]",[t],arguments.length),O(this,ut,!1!==t,"f"),this}string(t){return h("",[t],arguments.length),this[Et]("string",t),this[Zt](t),this}terminalWidth(){return h([],0),v(this,ct,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return h("",[t],arguments.length),O(this,G,!1,"f"),v(this,ct,"f").y18n.updateLocale(t),this}usage(t,s,i,n){if(h(" [string|boolean] [function|object] [function]",[t,s,i,n],arguments.length),void 0!==s){if(d(t,null,v(this,ct,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,s,i,n);throw new e(".usage() description must start with $0 if being used as alias for .command()")}return v(this,pt,"f").usage(t),this}version(t,e,s){const i="version";if(h("[boolean|string] [string] [string]",[t,e,s],arguments.length),v(this,gt,"f")&&(this[vt](v(this,gt,"f")),v(this,pt,"f").version(void 0),O(this,gt,null,"f")),0===arguments.length)s=this[Mt](),t=i;else if(1===arguments.length){if(!1===t)return this;s=t,t=i}else 2===arguments.length&&(s=e,e=void 0);return O(this,gt,"string"==typeof t?t:i,"f"),e=e||v(this,pt,"f").deferY18nLookup("Show version number"),v(this,pt,"f").version(s||void 0),this.boolean(v(this,gt,"f")),this.describe(v(this,gt,"f"),e),this}wrap(t){return h("",[t],arguments.length),v(this,pt,"f").wrap(t),this}[(z=new WeakMap,q=new WeakMap,W=new WeakMap,F=new WeakMap,U=new WeakMap,L=new WeakMap,V=new WeakMap,G=new WeakMap,R=new WeakMap,T=new WeakMap,K=new WeakMap,B=new WeakMap,Y=new WeakMap,J=new WeakMap,Z=new WeakMap,X=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap,it=new WeakMap,nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ht=new WeakMap,lt=new WeakMap,ct=new WeakMap,ft=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,mt=new WeakMap,yt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[bt](){return{log:(...t)=>{this[Vt]()||console.log(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")},error:(...t)=>{this[Vt]()||console.error(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")}}}[vt](t){p(v(this,et,"f")).forEach((e=>{if("configObjects"===e)return;const s=v(this,et,"f")[e];Array.isArray(s)?s.includes(t)&&s.splice(s.indexOf(t),1):"object"==typeof s&&delete s[t]})),delete v(this,pt,"f").getDescriptions()[t]}[Ot](t,e,s){v(this,R,"f")[s]||(v(this,ct,"f").process.emitWarning(t,e),v(this,R,"f")[s]=!0)}[wt](){v(this,K,"f").push({options:v(this,et,"f"),configObjects:v(this,et,"f").configObjects.slice(0),exitProcess:v(this,T,"f"),groups:v(this,Y,"f"),strict:v(this,ft,"f"),strictCommands:v(this,dt,"f"),strictOptions:v(this,ut,"f"),completionCommand:v(this,U,"f"),output:v(this,tt,"f"),exitError:v(this,V,"f"),hasOutput:v(this,J,"f"),parsed:this.parsed,parseFn:v(this,nt,"f"),parseContext:v(this,rt,"f")}),v(this,pt,"f").freeze(),v(this,mt,"f").freeze(),v(this,z,"f").freeze(),v(this,B,"f").freeze()}[Ct](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(v(this,ct,"f").process.argv()[0])?v(this,ct,"f").process.argv().slice(1,2):v(this,ct,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[Tt](v(this,q,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.lengthe.includes("package.json")?"package.json":void 0));d(i,void 0,v(this,ct,"f")),s=JSON.parse(v(this,ct,"f").readFileSync(i,"utf8"))}catch(t){}return v(this,ot,"f")[e]=s||{},v(this,ot,"f")[e]}[Et](t,e){(e=[].concat(e)).forEach((e=>{e=this[$t](e),v(this,et,"f")[t].push(e)}))}[At](t,e,s,i){this[St](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=s}))}[Pt](t,e,s,i){this[St](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=(v(this,et,"f")[t][e]||[]).concat(s)}))}[St](t,e,s,i,n){if(Array.isArray(s))s.forEach((e=>{t(e,i)}));else if((t=>"object"==typeof t)(s))for(const e of p(s))t(e,s[e]);else n(e,this[$t](s),i)}[$t](t){return"__proto__"===t?"___proto___":t}[It](t,e){return this[At](this[It].bind(this),"key",t,e),this}[Nt](){var t,e,s,i,n,r,o,a,h,l,c,f;const u=v(this,K,"f").pop();let p;d(u,void 0,v(this,ct,"f")),t=this,e=this,s=this,i=this,n=this,r=this,o=this,a=this,h=this,l=this,c=this,f=this,({options:{set value(e){O(t,et,e,"f")}}.value,configObjects:p,exitProcess:{set value(t){O(e,T,t,"f")}}.value,groups:{set value(t){O(s,Y,t,"f")}}.value,output:{set value(t){O(i,tt,t,"f")}}.value,exitError:{set value(t){O(n,V,t,"f")}}.value,hasOutput:{set value(t){O(r,J,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){O(o,ft,t,"f")}}.value,strictCommands:{set value(t){O(a,dt,t,"f")}}.value,strictOptions:{set value(t){O(h,ut,t,"f")}}.value,completionCommand:{set value(t){O(l,U,t,"f")}}.value,parseFn:{set value(t){O(c,nt,t,"f")}}.value,parseContext:{set value(t){O(f,rt,t,"f")}}.value}=u),v(this,et,"f").configObjects=p,v(this,pt,"f").unfreeze(),v(this,mt,"f").unfreeze(),v(this,z,"f").unfreeze(),v(this,B,"f").unfreeze()}[Dt](t,e){return j(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Ht].bind(this),getContext:this[zt].bind(this),getHasOutput:this[qt].bind(this),getLoggerInstance:this[Wt].bind(this),getParseContext:this[Ft].bind(this),getParserConfiguration:this[jt].bind(this),getUsageInstance:this[Ut].bind(this),getValidationInstance:this[Lt].bind(this),hasParseCallback:this[Vt].bind(this),isGlobalContext:this[Gt].bind(this),postProcess:this[Rt].bind(this),reset:this[Kt].bind(this),runValidation:this[Yt].bind(this),runYargsParserAndExecuteCommands:this[Bt].bind(this),setHasOutput:this[Jt].bind(this)}}[Ht](){return v(this,z,"f")}[zt](){return v(this,W,"f")}[qt](){return v(this,J,"f")}[Wt](){return v(this,Q,"f")}[Ft](){return v(this,rt,"f")||{}}[Ut](){return v(this,pt,"f")}[Lt](){return v(this,mt,"f")}[Vt](){return!!v(this,nt,"f")}[Gt](){return v(this,X,"f")}[Rt](t,e,s,i){if(s)return t;if(f(t))return t;e||(t=this[yt](t));return(this[jt]()["parse-positional-numbers"]||void 0===this[jt]()["parse-positional-numbers"])&&(t=this[kt](t)),i&&(t=C(t,this,v(this,B,"f").getMiddleware(),!1)),t}[Kt](t={}){O(this,et,v(this,et,"f")||{},"f");const e={};e.local=v(this,et,"f").local||[],e.configObjects=v(this,et,"f").configObjects||[];const s={};e.local.forEach((e=>{s[e]=!0,(t[e]||[]).forEach((t=>{s[t]=!0}))})),Object.assign(v(this,at,"f"),Object.keys(v(this,Y,"f")).reduce(((t,e)=>{const i=v(this,Y,"f")[e].filter((t=>!(t in s)));return i.length>0&&(t[e]=i),t}),{})),O(this,Y,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(v(this,et,"f")[t]||[]).filter((t=>!s[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=g(v(this,et,"f")[t],(t=>!s[t]))})),e.envPrefix=v(this,et,"f").envPrefix,O(this,et,e,"f"),O(this,pt,v(this,pt,"f")?v(this,pt,"f").reset(s):P(this,v(this,ct,"f")),"f"),O(this,mt,v(this,mt,"f")?v(this,mt,"f").reset(s):function(t,e,s){const i=s.y18n.__,n=s.y18n.__n,r={nonOptionCount:function(s){const i=t.getDemandedCommands(),r=s._.length+(s["--"]?s["--"].length:0)-t.getInternalMethods().getContext().commands.length;i._&&(ri._.max)&&(ri._.max&&(void 0!==i._.maxMsg?e.fail(i._.maxMsg?i._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.max.toString()):null):e.fail(n("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),i._.max.toString()))))},positionalCount:function(t,s){s{H.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,i)||f.push(e)})),h&&(d.commands.length>0||c.length>0||a)&&s._.slice(d.commands.length).forEach((t=>{c.includes(""+t)||f.push(""+t)})),h){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,i=d.commands.length+e;i{t=String(t),d.commands.includes(t)||f.includes(t)||f.push(t)}))}f.length&&e.fail(n("Unknown argument: %s","Unknown arguments: %s",f.length,f.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(s){const i=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||i.length>0)&&s._.slice(o.commands.length).forEach((t=>{i.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(n("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,s){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;const i=t.parsed.newAliases;return[e,...s[e]].some((t=>!Object.prototype.hasOwnProperty.call(i,t)||!i[e]))},limitedChoices:function(s){const n=t.getOptions(),r={};if(!Object.keys(n.choices).length)return;Object.keys(s).forEach((t=>{-1===H.indexOf(t)&&Object.prototype.hasOwnProperty.call(n.choices,t)&&[].concat(s[t]).forEach((e=>{-1===n.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=i("Invalid values:");o.forEach((t=>{a+=`\n ${i("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(n.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const s=Number(e);return"number"==typeof(e=isNaN(s)?e:s)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,i){h(" [array|number|string]",[e,i],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(i)?i.forEach((t=>r.implies(e,t))):(d(i,void 0,s),o[e].push(i)))},r.getImplied=function(){return o},r.implications=function(t){const s=[];if(Object.keys(o).forEach((e=>{const i=e;(o[e]||[]).forEach((e=>{let n=i;const r=e;n=a(t,n),e=a(t,e),n&&!e&&s.push(` ${i} -> ${r}`)}))})),s.length){let t=`${i("Implications failed:")}\n`;s.forEach((e=>{t+=e})),e.fail(t)}};let l={};r.conflicts=function(e,s){h(" [array|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),l[e]||(l[e]=[]),Array.isArray(s)?s.forEach((t=>r.conflicts(e,t))):l[e].push(s))},r.getConflicting=()=>l,r.conflicting=function(n){Object.keys(n).forEach((t=>{l[t]&&l[t].forEach((s=>{s&&void 0!==n[t]&&void 0!==n[s]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,s))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach((t=>{l[t].forEach((r=>{r&&void 0!==n[s.Parser.camelCase(t)]&&void 0!==n[s.Parser.camelCase(r)]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,s){s=s.sort(((t,e)=>e.length-t.length));let n=null,r=1/0;for(let e,i=0;void 0!==(e=s[i]);i++){const s=D(t,e);s<=3&&s!t[e])),l=g(l,(e=>!t[e])),r};const c=[];return r.freeze=function(){c.push({implied:o,conflicting:l})},r.unfreeze=function(){const t=c.pop();d(t,void 0,s),({implied:o,conflicting:l}=t)},r}(this,v(this,pt,"f"),v(this,ct,"f")),"f"),O(this,z,v(this,z,"f")?v(this,z,"f").reset():function(t,e,s,i){return new M(t,e,s,i)}(v(this,pt,"f"),v(this,mt,"f"),v(this,B,"f"),v(this,ct,"f")),"f"),v(this,F,"f")||O(this,F,function(t,e,s,i){return new N(t,e,s,i)}(this,v(this,pt,"f"),v(this,z,"f"),v(this,ct,"f")),"f"),v(this,B,"f").reset(),O(this,U,null,"f"),O(this,tt,"","f"),O(this,V,null,"f"),O(this,J,!1,"f"),this.parsed=!1,this}[Tt](t,e){return v(this,ct,"f").path.relative(t,e)}[Bt](t,s,i,n=0,r=!1){let o=!!i||r;t=t||v(this,ht,"f"),v(this,et,"f").__=v(this,ct,"f").y18n.__,v(this,et,"f").configuration=this[jt]();const a=!!v(this,et,"f").configuration["populate--"],h=Object.assign({},v(this,et,"f").configuration,{"populate--":!0}),l=v(this,ct,"f").Parser.detailed(t,Object.assign({},v(this,et,"f"),{configuration:{"parse-positional-numbers":!1,...h}})),c=Object.assign(l.argv,v(this,rt,"f"));let d;const u=l.aliases;let p=!1,g=!1;Object.keys(c).forEach((t=>{t===v(this,Z,"f")&&c[t]?p=!0:t===v(this,gt,"f")&&c[t]&&(g=!0)})),c.$0=this.$0,this.parsed=l,0===n&&v(this,pt,"f").clearCachedHelpMessage();try{if(this[_t](),s)return this[Rt](c,a,!!i,!1);if(v(this,Z,"f")){[v(this,Z,"f")].concat(u[v(this,Z,"f")]||[]).filter((t=>t.length>1)).includes(""+c._[c._.length-1])&&(c._.pop(),p=!0)}O(this,X,!1,"f");const h=v(this,z,"f").getCommands(),m=v(this,F,"f").completionKey in c,y=p||m||r;if(c._.length){if(h.length){let t;for(let e,s=n||0;void 0!==c._[s];s++){if(e=String(c._[s]),h.includes(e)&&e!==v(this,U,"f")){const t=v(this,z,"f").runCommand(e,this,l,s+1,r,p||g||r);return this[Rt](t,a,!!i,!1)}if(!t&&e!==v(this,U,"f")){t=e;break}}!v(this,z,"f").hasDefaultCommand()&&v(this,lt,"f")&&t&&!y&&v(this,mt,"f").recommendCommands(t,h)}v(this,U,"f")&&c._.includes(v(this,U,"f"))&&!m&&(v(this,T,"f")&&E(!0),this.showCompletionScript(),this.exit(0))}if(v(this,z,"f").hasDefaultCommand()&&!y){const t=v(this,z,"f").runCommand(null,this,l,0,r,p||g||r);return this[Rt](t,a,!!i,!1)}if(m){v(this,T,"f")&&E(!0);const s=(t=[].concat(t)).slice(t.indexOf(`--${v(this,F,"f").completionKey}`)+1);return v(this,F,"f").getCompletion(s,((t,s)=>{if(t)throw new e(t.message);(s||[]).forEach((t=>{v(this,Q,"f").log(t)})),this.exit(0)})),this[Rt](c,!a,!!i,!1)}if(v(this,J,"f")||(p?(v(this,T,"f")&&E(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(v(this,T,"f")&&E(!0),o=!0,v(this,pt,"f").showVersion("log"),this.exit(0))),!o&&v(this,et,"f").skipValidation.length>0&&(o=Object.keys(c).some((t=>v(this,et,"f").skipValidation.indexOf(t)>=0&&!0===c[t]))),!o){if(l.error)throw new e(l.error.message);if(!m){const t=this[Yt](u,{},l.error);i||(d=C(c,this,v(this,B,"f").getMiddleware(),!0)),d=this[Dt](t,null!=d?d:c),f(d)&&!i&&(d=d.then((()=>C(c,this,v(this,B,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof e))throw t;v(this,pt,"f").fail(t.message,t)}return this[Rt](null!=d?d:c,a,!!i,!0)}[Yt](t,s,i,n){const r={...this.getDemandedOptions()};return o=>{if(i)throw new e(i.message);v(this,mt,"f").nonOptionCount(o),v(this,mt,"f").requiredArguments(o,r);let a=!1;v(this,dt,"f")&&(a=v(this,mt,"f").unknownCommands(o)),v(this,ft,"f")&&!a?v(this,mt,"f").unknownArguments(o,t,s,!!n):v(this,ut,"f")&&v(this,mt,"f").unknownArguments(o,t,{},!1,!1),v(this,mt,"f").limitedChoices(o),v(this,mt,"f").implications(o),v(this,mt,"f").conflicting(o)}}[Jt](){O(this,J,!0,"f")}[Zt](t){if("string"==typeof t)v(this,et,"f").key[t]=!0;else for(const e of t)v(this,et,"f").key[e]=!0}}var Qt,te;const{readFileSync:ee}=require("fs"),{inspect:se}=require("util"),{resolve:ie}=require("path"),ne=require("y18n"),re=require("yargs-parser");var oe,ae={assert:{notStrictEqual:t.notStrictEqual,strictEqual:t.strictEqual},cliui:require("cliui"),findUp:require("escalade/sync"),getEnv:t=>process.env[t],getCallerFile:require("get-caller-file"),getProcessArgvBin:y,inspect:se,mainFilename:null!==(te=null===(Qt=null===require||void 0===require?void 0:require.main)||void 0===Qt?void 0:Qt.filename)&&void 0!==te?te:process.cwd(),Parser:re,path:require("path"),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:ee,require:require,requireDirectory:require("require-directory"),stringWidth:require("string-width"),y18n:ne({directory:ie(__dirname,"../locales"),updateFiles:!1})};const he=(null===(oe=null===process||void 0===process?void 0:process.env)||void 0===oe?void 0:oe.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1]){const i=new Xt(t,e,s,ce);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}),argsert:h,isPromise:f,objFilter:g,parseCommand:o,Parser:le,processArgv:b,YError:e};module.exports=fe; -+"use strict"; -+// "Error.captureStackTrace(this,e)" is removed from the constructor of a -+// custom Error class because that property doesn't exist when running -+// with LavaMoat/SES. -+var t=require("assert");class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace(this,e)}}let s,i=[];function n(t,o,a,h){s=h;let l={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return l;const r=/\.json|\..*rc$/.test(t.extends);let h=null;if(r)h=function(t,e){return s.path.resolve(t,e)}(o,t.extends);else try{h=require.resolve(t.extends)}catch(e){return t}!function(t){if(i.indexOf(t)>-1)throw new e(`Circular extended configurations: '${t}'.`)}(h),i.push(h),l=r?JSON.parse(s.readFileSync(h,"utf8")):require(t.extends),delete t.extends,l=n(l,s.path.dirname(h),a,s)}return i=[],a?r(l,t):Object.assign({},l,t)}function r(t,e){const s={};function i(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(s,t);for(const n of Object.keys(e))i(e[n])&&i(s[n])?s[n]=r(t[n],e[n]):s[n]=e[n];return s}function o(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${t}`);const n={cmd:i.replace(s,""),demanded:[],optional:[]};return e.forEach(((t,i)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&i===e.length-1&&(r=!0),/^\[/.test(t)?n.optional.push({cmd:t.replace(s,"").split("|"),variadic:r}):n.demanded.push({cmd:t.replace(s,"").split("|"),variadic:r})})),n}const a=["first","second","third","fourth","fifth","sixth"];function h(t,s,i){try{let n=0;const[r,a,h]="object"==typeof t?[{demanded:[],optional:[]},t,s]:[o(`cmd ${t}`),s,i],f=[].slice.call(a);for(;f.length&&void 0===f[f.length-1];)f.pop();const d=h||f.length;if(du)throw new e(`Too many arguments provided. Expected max ${u} but received ${d}.`);r.demanded.forEach((t=>{const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1})),r.optional.forEach((t=>{if(0===f.length)return;const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1}))}catch(t){console.warn(t.stack)}}function l(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function c(t,s,i){throw new e(`Invalid ${a[i]||"manyith"} argument. Expected ${s.join(" or ")} but received ${t}.`)}function f(t){return!!t&&!!t.then&&"function"==typeof t.then}function d(t,e,s,i){s.assert.notStrictEqual(t,e,i)}function u(t,e){e.assert.strictEqual(typeof t,"string")}function p(t){return Object.keys(t)}function g(t={},e=(()=>!0)){const s={};return p(t).forEach((i=>{e(i,t[i])&&(s[i]=t[i])})),s}function m(){return process.versions.electron&&!process.defaultApp?0:1}function y(){return process.argv[m()]}var b=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(m()+1)},getProcessArgvBin:y});function v(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)}function O(t,e,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(t,s):n?n.value=s:e.set(t,s),s}class w{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,s=!0,i=!1){if(h(" [boolean] [boolean] [boolean]",[t,e,s],arguments.length),Array.isArray(t)){for(let i=0;i{const i=[...s[e]||[],e];return!t.option||!i.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function C(t,e,s,i){return s.reduce(((t,s)=>{if(s.applyBeforeValidation!==i)return t;if(s.mutates){if(s.applied)return t;s.applied=!0}if(f(t))return t.then((t=>Promise.all([t,s(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const i=s(t,e);return f(i)?i.then((e=>Object.assign(t,e))):Object.assign(t,i)}}),t)}function j(t,e,s=(t=>{throw t})){try{const s="function"==typeof t?t():t;return f(s)?s.then((t=>e(t))):e(s)}catch(t){return s(t)}}const _=/(^\*)|(^\$0)/;class M{constructor(t,e,s,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=s,this.validation=e}addDirectory(t,e,s,i){"boolean"!=typeof(i=i||{}).recurse&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);const n="function"==typeof i.visit?i.visit:t=>t;i.visit=(t,e,s)=>{const i=n(t,e,s);if(i){if(this.requireCache.has(e))return i;this.requireCache.add(e),this.addHandler(i)}return i},this.shim.requireDirectory({require:e,filename:s},t,i)}addHandler(t,e,s,i,n,r){let a=[];const h=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(n);if(i=i||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...a]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(k(s))return void this.addHandler([t].concat(a),e,s.builder,s.handler,s.middlewares,s.deprecated)}if("string"==typeof t){const n=o(t);a=a.map((t=>o(t).cmd));let l=!1;const c=[n.cmd].concat(a).filter((t=>!_.test(t)||(l=!0,!1)));0===c.length&&l&&c.push("$0"),l&&(n.cmd=c[0],a=c.slice(1),t=t.replace(_,n.cmd)),a.forEach((t=>{this.aliasMap[t]=n.cmd})),!1!==e&&this.usage.command(t,e,l,a,r),this.handlers[n.cmd]={original:t,description:e,handler:i,builder:s||{},middlewares:h,deprecated:r,demanded:n.demanded,optional:n.optional},l&&(this.defaultCommand=this.handlers[n.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,s,i,n,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),h=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const c=this.applyBuilderUpdateUsageAndParse(l,o,e,s.aliases,h,i,n,r);return f(c)?c.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,n,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,c.innerArgv,a,n,c.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,s,i,n,r,o,a){const h=e.builder;let l=s;if(x(h)){const c=h(s.getInternalMethods().reset(i),a);if(f(c))return c.then((i=>{var a;return l=(a=i)&&"function"==typeof a.getInternalMethods?i:s,this.parseAndUpdateUsage(t,e,l,n,r,o)}))}else(function(t){return"object"==typeof t})(h)&&(l=s.getInternalMethods().reset(i),Object.keys(e.builder).forEach((t=>{l.option(t,h[t])})));return this.parseAndUpdateUsage(t,e,l,n,r,o)}parseAndUpdateUsage(t,e,s,i,n,r){t&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);const o=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,n,r);return f(o)?o.then((t=>({aliases:s.parsed.aliases,innerArgv:t}))):{aliases:s.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const s=_.test(e.original)?e.original.replace(_,"").trim():e.original,i=t.filter((t=>!_.test(t)));return i.push(s),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(t,e,s,i,n,r,o){let a={};if(n)return s;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,s,i,o));const h=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares);if(s=C(s,o,h,!0),!o.getInternalMethods().getHasOutput()){const e=o.getInternalMethods().runValidation(r,a,o.parsed.error,t);s=j(s,(t=>(e(t),t)))}if(e.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();const i=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(s,i,!1,!1),s=j(s=C(s,o,h,!1),(t=>{const s=e.handler(t);return f(s)?s.then((()=>t)):t})),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),f(s)&&!o.getInternalMethods().hasParseCallback()&&s.catch((t=>{try{o.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(i.commands.pop(),i.fullCommands.pop()),s}populatePositionals(t,e,s,i){e._=e._.slice(s.commands.length);const n=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(n.length,e._.length);n.length;){const t=n.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=s.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),i),o}populatePositional(t,e,s){const i=t.cmd[0];t.variadic?s[i]=e._.splice(0).map(String):e._.length&&(s[i]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},s=o(t);return s.demanded.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i,e.demand[s]=!0})),s.optional.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i})),e}postProcessPositionals(t,e,s,i){const n=Object.assign({},i.getOptions());n.default=Object.assign(s.default,n.default);for(const t of Object.keys(s.alias))n.alias[t]=(n.alias[t]||[]).concat(s.alias[t]);n.array=n.array.concat(s.array),n.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{n.configuration["unknown-options-as-args"]&&(n.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},n.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},n,{configuration:o}));if(a.error)i.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const s=Object.keys(e);Object.keys(e).forEach((t=>{s.push(...a.aliases[t])}));const n=i.getOptions().default;Object.keys(a.argv).forEach((i=>{s.includes(i)&&(e[i]||(e[i]=a.argv[i]),!Object.hasOwnProperty.call(n,i)&&Object.hasOwnProperty.call(t,i)&&Object.hasOwnProperty.call(a.argv,i)&&(Array.isArray(t[i])||Array.isArray(a.argv[i]))?t[i]=[].concat(t[i],a.argv[i]):t[i]=a.argv[i])}))}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=_.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(x(e))return e(t,!0);k(e)||Object.keys(e).forEach((s=>{t.option(s,e[s])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,s=0,i=Object.keys(require.cache);s{const s=e;s._handle&&s.isTTY&&"function"==typeof s._handle.setBlocking&&s._handle.setBlocking(t)}))}function A(t){return"boolean"==typeof t}function P(t,s){const i=s.y18n.__,n={},r=[];n.failFn=function(t){r.push(t)};let o=null,a=null,h=!0;n.showHelpOnFail=function(e=!0,s){const[i,r]="string"==typeof e?[!0,e]:[e,s];return t.getInternalMethods().isGlobalContext()&&(a=r),o=r,h=i,n};let l=!1;n.fail=function(s,i){const c=t.getInternalMethods().getLoggerInstance();if(!r.length){if(t.getExitProcess()&&E(!0),!l){l=!0,h&&(t.showHelp("error"),c.error()),(s||i)&&c.error(s||i);const e=o||a;e&&((s||i)&&c.error(""),c.error(e))}if(i=i||new e(s),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,i);throw i}for(let t=r.length-1;t>=0;--t){const e=r[t];if(A(e)){if(i)throw i;if(s)throw Error(s)}else e(s,i,n)}};let c=[],f=!1;n.usage=(t,e)=>null===t?(f=!0,c=[],n):(f=!1,c.push([t,e||""]),n),n.getUsage=()=>c,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>i("Positionals:");let d=[];n.example=(t,e)=>{d.push([t,e||""])};let u=[];n.command=function(t,e,s,i,n=!1){s&&(u=u.map((t=>(t[2]=!1,t)))),u.push([t,e||"",s,i,n])},n.getCommands=()=>u;let p={};n.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{n.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{n.describe(e,t[e])})):p[t]=e},n.getDescriptions=()=>p;let m=[];n.epilog=t=>{m.push(t)};let y,b=!1;function v(){return b||(y=function(){const t=80;return s.process.stdColumns?Math.min(t,s.process.stdColumns):t}(),b=!0),y}n.wrap=t=>{b=!0,y=t};const O="__yargsString__:";function w(t,e,i){let n=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{n=Math.max(s.stringWidth(i?`${i} ${I(t[0])}`:I(t[0]))+$(t[0]),n)})),e&&(n=Math.min(n,parseInt((.5*e).toString(),10))),n}let C;function j(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function _(t,e){let s=`[${i("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}n.deferY18nLookup=t=>O+t,n.help=function(){if(C)return C;!function(){const e=t.getDemandedOptions(),s=t.getOptions();(Object.keys(s.alias)||[]).forEach((i=>{s.alias[i].forEach((r=>{p[r]&&n.describe(i,p[r]),r in e&&t.demandOption(i,e[r]),s.boolean.includes(r)&&t.boolean(i),s.count.includes(r)&&t.count(i),s.string.includes(r)&&t.string(i),s.normalize.includes(r)&&t.normalize(i),s.array.includes(r)&&t.array(i),s.number.includes(r)&&t.number(i)}))}))}();const e=t.customScriptName?t.$0:s.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),h=t.getGroups(),l=t.getOptions();let g=[];g=g.concat(Object.keys(p)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(l.default)),g=g.filter(j),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const y=v(),b=s.cliui({width:y,wrap:!!y});if(!f)if(c.length)c.forEach((t=>{b.div({text:`${t[0].replace(/\$0/g,e)}`}),t[1]&&b.div({text:`${t[1]}`,padding:[1,0,0,0]})})),b.div();else if(u.length){let t=null;t=o._?`${e} <${i("command")}>\n`:`${e} [${i("command")}]\n`,b.div(`${t}`)}if(u.length>1||1===u.length&&!u[0][2]){b.div(i("Commands:"));const s=t.getInternalMethods().getContext(),n=s.commands.length?`${s.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(u=u.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=e?`${e} `:"";u.forEach((t=>{const s=`${r}${n}${t[0].replace(/^\$0 ?/,"")}`;b.span({text:s,padding:[0,2,0,2],width:w(u,y,`${e}${n}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${i("default")}]`),t[3]&&t[3].length&&o.push(`[${i("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${i("deprecated: %s",t[4])}]`):o.push(`[${i("deprecated")}]`)),o.length?b.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):b.div()})),b.div()}const M=(Object.keys(l.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&M.every((t=>-1===(l.alias[t]||[]).indexOf(e)))));const k=i("Options:");h[k]||(h[k]=[]),function(t,e,s,i){let n=[],r=null;Object.keys(s).forEach((t=>{n=n.concat(s[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==n.indexOf(t)))||s[i].push(t)}))}(g,l.alias,h,k);const x=t=>/^--/.test(I(t)),E=Object.keys(h).filter((t=>h[t].length>0)).map((t=>({groupName:t,normalizedKeys:h[t].filter(j).map((t=>{if(M.includes(t))return t;for(let e,s=0;void 0!==(e=M[s]);s++)if((l.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const s=e.reduce(((e,s)=>(e[s]=[s].concat(l.alias[s]||[]).map((e=>t===n.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?l.boolean.includes(s)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>x(t)===x(e)?0:x(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:s}}));if(E.filter((({groupName:t})=>t!==n.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>x(e[t])))))&&E.filter((({groupName:t})=>t!==n.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var s,i;x(e[t])&&(e[t]=(s=e[t],i="-x, ".length,S(s)?{text:s.text,indentation:s.indentation+i}:{text:s,indentation:i}))}))})),E.forEach((({groupName:t,normalizedKeys:e,switches:s})=>{b.div(t),e.forEach((t=>{const e=s[t];let o=p[t]||"",h=null;o.includes(O)&&(o=i(o.substring(O.length))),l.boolean.includes(t)&&(h=`[${i("boolean")}]`),l.count.includes(t)&&(h=`[${i("count")}]`),l.string.includes(t)&&(h=`[${i("string")}]`),l.normalize.includes(t)&&(h=`[${i("string")}]`),l.array.includes(t)&&(h=`[${i("array")}]`),l.number.includes(t)&&(h=`[${i("number")}]`);const c=[t in a?(f=a[t],"string"==typeof f?`[${i("deprecated: %s",f)}]`:`[${i("deprecated")}]`):null,h,t in r?`[${i("required")}]`:null,l.choices&&l.choices[t]?`[${i("choices:")} ${n.stringifiedValues(l.choices[t])}]`:null,_(l.default[t],l.defaultDescription[t])].filter(Boolean).join(" ");var f;b.span({text:I(e),padding:[0,2,0,2+$(e)],width:w(s,y)+4},o),c?b.div({text:c,padding:[0,0,0,2],align:"right"}):b.div()})),b.div()})),d.length&&(b.div(i("Examples:")),d.forEach((t=>{t[0]=t[0].replace(/\$0/g,e)})),d.forEach((t=>{""===t[1]?b.div({text:t[0],padding:[0,2,0,2]}):b.div({text:t[0],padding:[0,2,0,2],width:w(d,y)+4},{text:t[1]})})),b.div()),m.length>0){const t=m.map((t=>t.replace(/\$0/g,e))).join("\n");b.div(`${t}\n`)}return b.toString().replace(/\s*$/,"")},n.cacheHelpMessage=function(){C=this.help()},n.clearCachedHelpMessage=function(){C=void 0},n.hasCachedHelpMessage=function(){return!!C},n.showHelp=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(n.help())},n.functionDescription=t=>["(",t.name?s.Parser.decamelize(t.name,"-"):i("generated-value"),")"].join(""),n.stringifiedValues=function(t,e){let s="";const i=e||", ",n=[].concat(t);return t&&n.length?(n.forEach((t=>{s.length&&(s+=i),s+=JSON.stringify(t)})),s):s};let M=null;n.version=t=>{M=t},n.showVersion=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(M)},n.reset=function(t){return o=null,l=!1,c=[],f=!1,m=[],d=[],u=[],p=g(p,(e=>!t[e])),n};const k=[];return n.freeze=function(){k.push({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p})},n.unfreeze=function(t=!1){const e=k.pop();e&&(t?(p={...e.descriptions,...p},u=[...e.commands,...u],c=[...e.usages,...c],d=[...e.examples,...d],m=[...e.epilogs,...m]):({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p}=e))},n}function S(t){return"object"==typeof t}function $(t){return S(t)?t.indentation:0}function I(t){return S(t)?t.text:t}class N{constructor(t,e,s,i){var n,r,o;this.yargs=t,this.usage=e,this.command=s,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(n=this.shim.getEnv("SHELL"))||void 0===n?void 0:n.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,s,i){const n=this.command.getCommandHandlers();for(let e=0,s=t.length;e{const i=o(s[0]).cmd;if(-1===e.indexOf(i))if(this.zshShell){const e=s[1]||"";t.push(i.replace(/:/g,"\\:")+":"+e)}else t.push(i)}))}optionCompletions(t,e,s,i){if((i.match(/^-/)||""===i&&0===t.length)&&!this.previousArgHasChoices(e)){const n=this.yargs.getOptions(),r=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach((o=>{const a=!!n.configuration["boolean-negation"]&&n.boolean.includes(o);r.includes(o)||n.hiddenOptions.includes(o)||this.argsContainKey(e,s,o,a)||(this.completeOptionKey(o,t,i),a&&n.default[o]&&this.completeOptionKey(`no-${o}`,t,i))}))}}choicesFromOptionsCompletions(t,e,s,i){if(this.previousArgHasChoices(e)){const s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,s,i){if(""===i&&t.length>0&&this.previousArgHasChoices(e))return;const n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=n[s._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(i)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],s="";if(!e.startsWith("-")&&t.length>1&&(s=e,e=t[t.length-2]),!e.startsWith("-"))return;const i=e.replace(/^-+/,""),n=this.yargs.getOptions(),r=[i,...this.yargs.getAliases()[i]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(n.key,t)&&Array.isArray(n.choices[t])){o=n.choices[t];break}return o?o.filter((t=>!s||t.startsWith(s))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,s,i){if(-1!==t.indexOf(`--${s}`))return!0;if(i&&-1!==t.indexOf(`--no-${s}`))return!0;if(this.aliases)for(const t of this.aliases[s])if(void 0!==e[t])return!0;return!1}completeOptionKey(t,e,s){const i=this.usage.getDescriptions(),n=!/^--/.test(s)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";if(this.zshShell){const s=i[t]||"";e.push(n+`${t.replace(/:/g,"\\:")}:${s.replace("__yargsString__:","")}`)}else e.push(n+t)}customCompletion(t,e,s,i){if(d(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(s,e);return f(t)?t.then((t=>{this.shim.process.nextTick((()=>{i(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{i(t,void 0)}))})):i(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(s,e,((n=i)=>this.defaultCompletion(t,e,s,n)),(t=>{i(null,t)})):this.customCompletionFunction(s,e,(t=>{i(null,t)}))}getCompletion(t,e){const s=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),n=this.customCompletionFunction?i=>this.customCompletion(t,i,s,e):i=>this.defaultCompletion(t,i,s,e);return f(i)?i.then(n):n(i)}generateCompletionScript(t,e){let s=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,i),s=s.replace(/{{completion_command}}/g,e),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function D(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const s=[];let i,n;for(i=0;i<=e.length;i++)s[i]=[i];for(n=0;n<=t.length;n++)s[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?s[i][n]=s[i-1][n-1]:i>1&&n>1&&e.charAt(i-2)===t.charAt(n-1)&&e.charAt(i-1)===t.charAt(n-2)?s[i][n]=s[i-2][n-2]+1:s[i][n]=Math.min(s[i-1][n-1]+1,Math.min(s[i][n-1]+1,s[i-1][n]+1));return s[e.length][t.length]}const H=["$0","--","_"];var z,q,W,F,U,L,V,G,R,T,K,B,Y,J,Z,X,Q,tt,et,st,it,nt,rt,ot,at,ht,lt,ct,ft,dt,ut,pt,gt,mt;const yt=Symbol("copyDoubleDash"),bt=Symbol("copyDoubleDash"),vt=Symbol("deleteFromParserHintObject"),Ot=Symbol("emitWarning"),wt=Symbol("freeze"),Ct=Symbol("getDollarZero"),jt=Symbol("getParserConfiguration"),_t=Symbol("guessLocale"),Mt=Symbol("guessVersion"),kt=Symbol("parsePositionalNumbers"),xt=Symbol("pkgUp"),Et=Symbol("populateParserHintArray"),At=Symbol("populateParserHintSingleValueDictionary"),Pt=Symbol("populateParserHintArrayDictionary"),St=Symbol("populateParserHintDictionary"),$t=Symbol("sanitizeKey"),It=Symbol("setKey"),Nt=Symbol("unfreeze"),Dt=Symbol("validateAsync"),Ht=Symbol("getCommandInstance"),zt=Symbol("getContext"),qt=Symbol("getHasOutput"),Wt=Symbol("getLoggerInstance"),Ft=Symbol("getParseContext"),Ut=Symbol("getUsageInstance"),Lt=Symbol("getValidationInstance"),Vt=Symbol("hasParseCallback"),Gt=Symbol("isGlobalContext"),Rt=Symbol("postProcess"),Tt=Symbol("rebase"),Kt=Symbol("reset"),Bt=Symbol("runYargsParserAndExecuteCommands"),Yt=Symbol("runValidation"),Jt=Symbol("setHasOutput"),Zt=Symbol("kTrackManuallySetKeys");class Xt{constructor(t=[],e,s,i){this.customScriptName=!1,this.parsed=!1,z.set(this,void 0),q.set(this,void 0),W.set(this,{commands:[],fullCommands:[]}),F.set(this,null),U.set(this,null),L.set(this,"show-hidden"),V.set(this,null),G.set(this,!0),R.set(this,{}),T.set(this,!0),K.set(this,[]),B.set(this,void 0),Y.set(this,{}),J.set(this,!1),Z.set(this,null),X.set(this,!0),Q.set(this,void 0),tt.set(this,""),et.set(this,void 0),st.set(this,void 0),it.set(this,{}),nt.set(this,null),rt.set(this,null),ot.set(this,{}),at.set(this,{}),ht.set(this,void 0),lt.set(this,!1),ct.set(this,void 0),ft.set(this,!1),dt.set(this,!1),ut.set(this,!1),pt.set(this,void 0),gt.set(this,null),mt.set(this,void 0),O(this,ct,i,"f"),O(this,ht,t,"f"),O(this,q,e,"f"),O(this,st,s,"f"),O(this,B,new w(this),"f"),this.$0=this[Ct](),this[Kt](),O(this,z,v(this,z,"f"),"f"),O(this,pt,v(this,pt,"f"),"f"),O(this,mt,v(this,mt,"f"),"f"),O(this,et,v(this,et,"f"),"f"),v(this,et,"f").showHiddenOpt=v(this,L,"f"),O(this,Q,this[bt](),"f")}addHelpOpt(t,e){return h("[string|boolean] [string]",[t,e],arguments.length),v(this,Z,"f")&&(this[vt](v(this,Z,"f")),O(this,Z,null,"f")),!1===t&&void 0===e||(O(this,Z,"string"==typeof t?t:"help","f"),this.boolean(v(this,Z,"f")),this.describe(v(this,Z,"f"),e||v(this,pt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(h("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const s="string"==typeof t?t:v(this,L,"f");return this.boolean(s),this.describe(s,e||v(this,pt,"f").deferY18nLookup("Show hidden options")),v(this,et,"f").showHiddenOpt=s,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return h(" [string|array]",[t,e],arguments.length),this[Pt](this.alias.bind(this),"alias",t,e),this}array(t){return h("",[t],arguments.length),this[Et]("array",t),this[Zt](t),this}boolean(t){return h("",[t],arguments.length),this[Et]("boolean",t),this[Zt](t),this}check(t,e){return h(" [boolean]",[t,e],arguments.length),this.middleware(((e,s)=>j((()=>t(e,s.getOptions())),(s=>(s?("string"==typeof s||s instanceof Error)&&v(this,pt,"f").fail(s.toString(),s):v(this,pt,"f").fail(v(this,ct,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(v(this,pt,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return h(" [string|array]",[t,e],arguments.length),this[Pt](this.choices.bind(this),"choices",t,e),this}coerce(t,s){if(h(" [function]",[t,s],arguments.length),Array.isArray(t)){if(!s)throw new e("coerce callback must be provided");for(const e of t)this.coerce(e,s);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!s)throw new e("coerce callback must be provided");return v(this,et,"f").key[t]=!0,v(this,B,"f").addCoerceMiddleware(((i,n)=>{let r;return Object.hasOwnProperty.call(i,t)?j((()=>(r=n.getAliases(),s(i[t]))),(e=>{i[t]=e;const s=n.getInternalMethods().getParserConfiguration()["strip-aliased"];if(r[t]&&!0!==s)for(const s of r[t])i[s]=e;return i}),(t=>{throw new e(t.message)})):i}),t),this}conflicts(t,e){return h(" [string|array]",[t,e],arguments.length),v(this,mt,"f").conflicts(t,e),this}config(t="config",e,s){return h("[object|string] [string|function] [function]",[t,e,s],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(s=e,e=void 0),this.describe(t,e||v(this,pt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{v(this,et,"f").config[t]=s||!0})),this):(t=n(t,v(this,q,"f"),this[jt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(t),this)}completion(t,e,s){return h("[string] [string|boolean|function] [function]",[t,e,s],arguments.length),"function"==typeof e&&(s=e,e=void 0),O(this,U,t||v(this,U,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(v(this,U,"f"),e),s&&v(this,F,"f").registerFunction(s),this}command(t,e,s,i,n,r){return h(" [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,s,i,n,r],arguments.length),v(this,z,"f").addHandler(t,e,s,i,n,r),this}commands(t,e,s,i,n,r){return this.command(t,e,s,i,n,r)}commandDir(t,e){h(" [object]",[t,e],arguments.length);const s=v(this,st,"f")||v(this,ct,"f").require;return v(this,z,"f").addDirectory(t,s,v(this,ct,"f").getCallerFile(),e),this}count(t){return h("",[t],arguments.length),this[Et]("count",t),this[Zt](t),this}default(t,e,s){return h(" [*] [string]",[t,e,s],arguments.length),s&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]=s),"function"==typeof e&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]||(v(this,et,"f").defaultDescription[t]=v(this,pt,"f").functionDescription(e)),e=e.call()),this[At](this.default.bind(this),"default",t,e),this}defaults(t,e,s){return this.default(t,e,s)}demandCommand(t=1,e,s,i){return h("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,s,i],arguments.length),"number"!=typeof e&&(s=e,e=1/0),this.global("_",!1),v(this,et,"f").demandedCommands._={min:t,max:e,minMsg:s,maxMsg:i},this}demand(t,e,s){return Array.isArray(e)?(e.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})),e=1/0):"number"!=typeof e&&(s=e,e=1/0),"number"==typeof t?(d(s,!0,v(this,ct,"f")),this.demandCommand(t,e,s,s)):Array.isArray(t)?t.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})):"string"==typeof s?this.demandOption(t,s):!0!==s&&void 0!==s||this.demandOption(t),this}demandOption(t,e){return h(" [string]",[t,e],arguments.length),this[At](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return h(" [string|boolean]",[t,e],arguments.length),v(this,et,"f").deprecatedOptions[t]=e,this}describe(t,e){return h(" [string]",[t,e],arguments.length),this[It](t,!0),v(this,pt,"f").describe(t,e),this}detectLocale(t){return h("",[t],arguments.length),O(this,G,t,"f"),this}env(t){return h("[string|boolean]",[t],arguments.length),!1===t?delete v(this,et,"f").envPrefix:v(this,et,"f").envPrefix=t||"",this}epilogue(t){return h("",[t],arguments.length),v(this,pt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return h(" [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):v(this,pt,"f").example(t,e),this}exit(t,e){O(this,J,!0,"f"),O(this,V,e,"f"),v(this,T,"f")&&v(this,ct,"f").process.exit(t)}exitProcess(t=!0){return h("[boolean]",[t],arguments.length),O(this,T,t,"f"),this}fail(t){if(h("",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new e("Invalid first argument. Expected function or boolean 'false'");return v(this,pt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return h(" [function]",[t,e],arguments.length),e?v(this,F,"f").getCompletion(t,e):new Promise(((e,s)=>{v(this,F,"f").getCompletion(t,((t,i)=>{t?s(t):e(i)}))}))}getDemandedOptions(){return h([],0),v(this,et,"f").demandedOptions}getDemandedCommands(){return h([],0),v(this,et,"f").demandedCommands}getDeprecatedOptions(){return h([],0),v(this,et,"f").deprecatedOptions}getDetectLocale(){return v(this,G,"f")}getExitProcess(){return v(this,T,"f")}getGroups(){return Object.assign({},v(this,Y,"f"),v(this,at,"f"))}getHelp(){if(O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Bt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(t))return t.then((()=>v(this,pt,"f").help()))}const t=v(this,z,"f").runDefaultBuilderOn(this);if(f(t))return t.then((()=>v(this,pt,"f").help()))}return Promise.resolve(v(this,pt,"f").help())}getOptions(){return v(this,et,"f")}getStrict(){return v(this,ft,"f")}getStrictCommands(){return v(this,dt,"f")}getStrictOptions(){return v(this,ut,"f")}global(t,e){return h(" [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?v(this,et,"f").local=v(this,et,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{v(this,et,"f").local.includes(t)||v(this,et,"f").local.push(t)})),this}group(t,e){h(" ",[t,e],arguments.length);const s=v(this,at,"f")[e]||v(this,Y,"f")[e];v(this,at,"f")[e]&&delete v(this,at,"f")[e];const i={};return v(this,Y,"f")[e]=(s||[]).concat(t).filter((t=>!i[t]&&(i[t]=!0))),this}hide(t){return h("",[t],arguments.length),v(this,et,"f").hiddenOptions.push(t),this}implies(t,e){return h(" [number|string|array]",[t,e],arguments.length),v(this,mt,"f").implies(t,e),this}locale(t){return h("[string]",[t],arguments.length),t?(O(this,G,!1,"f"),v(this,ct,"f").y18n.setLocale(t),this):(this[_t](),v(this,ct,"f").y18n.getLocale())}middleware(t,e,s){return v(this,B,"f").addMiddleware(t,!!e,s)}nargs(t,e){return h(" [number]",[t,e],arguments.length),this[At](this.nargs.bind(this),"narg",t,e),this}normalize(t){return h("",[t],arguments.length),this[Et]("normalize",t),this}number(t){return h("",[t],arguments.length),this[Et]("number",t),this[Zt](t),this}option(t,e){if(h(" [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Zt](t),!v(this,gt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[Ot](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),v(this,et,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const s=e.deprecate||e.deprecated;s&&this.deprecateOption(t,s);const i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(v(this,et,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const n=e.describe||e.description||e.desc;this.describe(t,n),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,s){h("[string|array] [function|boolean|object] [function]",[t,e,s],arguments.length),this[wt](),void 0===t&&(t=v(this,ht,"f")),"object"==typeof e&&(O(this,rt,e,"f"),e=s),"function"==typeof e&&(O(this,nt,e,"f"),e=!1),e||O(this,ht,t,"f"),v(this,nt,"f")&&O(this,T,!1,"f");const i=this[Bt](t,!!e),n=this.parsed;return v(this,F,"f").setParsed(this.parsed),f(i)?i.then((t=>(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),t,v(this,tt,"f")),t))).catch((t=>{throw v(this,nt,"f")&&v(this,nt,"f")(t,this.parsed.argv,v(this,tt,"f")),t})).finally((()=>{this[Nt](),this.parsed=n})):(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),i,v(this,tt,"f")),this[Nt](),this.parsed=n,i)}parseAsync(t,e,s){const i=this.parse(t,e,s);return f(i)?i:Promise.resolve(i)}parseSync(t,s,i){const n=this.parse(t,s,i);if(f(n))throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return n}parserConfiguration(t){return h("",[t],arguments.length),O(this,it,t,"f"),this}pkgConf(t,e){h(" [string]",[t,e],arguments.length);let s=null;const i=this[xt](e||v(this,q,"f"));return i[t]&&"object"==typeof i[t]&&(s=n(i[t],e||v(this,q,"f"),this[jt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(s)),this}positional(t,e){h(" ",[t,e],arguments.length);const s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=g(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&s.includes(t)));const i=v(this,W,"f").fullCommands[v(this,W,"f").fullCommands.length-1],n=i?v(this,z,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return p(n).forEach((s=>{const i=n[s];Array.isArray(i)?-1!==i.indexOf(t)&&(e[s]=!0):i[t]&&!(s in e)&&(e[s]=i[t])})),this.group(t,v(this,pt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return h("[boolean]",[t],arguments.length),O(this,lt,t,"f"),this}required(t,e,s){return this.demand(t,e,s)}require(t,e,s){return this.demand(t,e,s)}requiresArg(t){return h(" [number]",[t],arguments.length),"string"==typeof t&&v(this,et,"f").narg[t]||this[At](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return h("[string] [string]",[t,e],arguments.length),t=t||this.$0,v(this,Q,"f").log(v(this,F,"f").generateCompletionScript(t,e||v(this,U,"f")||"completion")),this}showHelp(t){if(h("[string|function]",[t],arguments.length),O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Bt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}const e=v(this,z,"f").runDefaultBuilderOn(this);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}return v(this,pt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return h("[boolean|string] [string]",[t,e],arguments.length),v(this,pt,"f").showHelpOnFail(t,e),this}showVersion(t){return h("[string|function]",[t],arguments.length),v(this,pt,"f").showVersion(t),this}skipValidation(t){return h("",[t],arguments.length),this[Et]("skipValidation",t),this}strict(t){return h("[boolean]",[t],arguments.length),O(this,ft,!1!==t,"f"),this}strictCommands(t){return h("[boolean]",[t],arguments.length),O(this,dt,!1!==t,"f"),this}strictOptions(t){return h("[boolean]",[t],arguments.length),O(this,ut,!1!==t,"f"),this}string(t){return h("",[t],arguments.length),this[Et]("string",t),this[Zt](t),this}terminalWidth(){return h([],0),v(this,ct,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return h("",[t],arguments.length),O(this,G,!1,"f"),v(this,ct,"f").y18n.updateLocale(t),this}usage(t,s,i,n){if(h(" [string|boolean] [function|object] [function]",[t,s,i,n],arguments.length),void 0!==s){if(d(t,null,v(this,ct,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,s,i,n);throw new e(".usage() description must start with $0 if being used as alias for .command()")}return v(this,pt,"f").usage(t),this}version(t,e,s){const i="version";if(h("[boolean|string] [string] [string]",[t,e,s],arguments.length),v(this,gt,"f")&&(this[vt](v(this,gt,"f")),v(this,pt,"f").version(void 0),O(this,gt,null,"f")),0===arguments.length)s=this[Mt](),t=i;else if(1===arguments.length){if(!1===t)return this;s=t,t=i}else 2===arguments.length&&(s=e,e=void 0);return O(this,gt,"string"==typeof t?t:i,"f"),e=e||v(this,pt,"f").deferY18nLookup("Show version number"),v(this,pt,"f").version(s||void 0),this.boolean(v(this,gt,"f")),this.describe(v(this,gt,"f"),e),this}wrap(t){return h("",[t],arguments.length),v(this,pt,"f").wrap(t),this}[(z=new WeakMap,q=new WeakMap,W=new WeakMap,F=new WeakMap,U=new WeakMap,L=new WeakMap,V=new WeakMap,G=new WeakMap,R=new WeakMap,T=new WeakMap,K=new WeakMap,B=new WeakMap,Y=new WeakMap,J=new WeakMap,Z=new WeakMap,X=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap,it=new WeakMap,nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ht=new WeakMap,lt=new WeakMap,ct=new WeakMap,ft=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,mt=new WeakMap,yt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[bt](){return{log:(...t)=>{this[Vt]()||console.log(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")},error:(...t)=>{this[Vt]()||console.error(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")}}}[vt](t){p(v(this,et,"f")).forEach((e=>{if("configObjects"===e)return;const s=v(this,et,"f")[e];Array.isArray(s)?s.includes(t)&&s.splice(s.indexOf(t),1):"object"==typeof s&&delete s[t]})),delete v(this,pt,"f").getDescriptions()[t]}[Ot](t,e,s){v(this,R,"f")[s]||(v(this,ct,"f").process.emitWarning(t,e),v(this,R,"f")[s]=!0)}[wt](){v(this,K,"f").push({options:v(this,et,"f"),configObjects:v(this,et,"f").configObjects.slice(0),exitProcess:v(this,T,"f"),groups:v(this,Y,"f"),strict:v(this,ft,"f"),strictCommands:v(this,dt,"f"),strictOptions:v(this,ut,"f"),completionCommand:v(this,U,"f"),output:v(this,tt,"f"),exitError:v(this,V,"f"),hasOutput:v(this,J,"f"),parsed:this.parsed,parseFn:v(this,nt,"f"),parseContext:v(this,rt,"f")}),v(this,pt,"f").freeze(),v(this,mt,"f").freeze(),v(this,z,"f").freeze(),v(this,B,"f").freeze()}[Ct](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(v(this,ct,"f").process.argv()[0])?v(this,ct,"f").process.argv().slice(1,2):v(this,ct,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[Tt](v(this,q,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.lengthe.includes("package.json")?"package.json":void 0));d(i,void 0,v(this,ct,"f")),s=JSON.parse(v(this,ct,"f").readFileSync(i,"utf8"))}catch(t){}return v(this,ot,"f")[e]=s||{},v(this,ot,"f")[e]}[Et](t,e){(e=[].concat(e)).forEach((e=>{e=this[$t](e),v(this,et,"f")[t].push(e)}))}[At](t,e,s,i){this[St](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=s}))}[Pt](t,e,s,i){this[St](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=(v(this,et,"f")[t][e]||[]).concat(s)}))}[St](t,e,s,i,n){if(Array.isArray(s))s.forEach((e=>{t(e,i)}));else if((t=>"object"==typeof t)(s))for(const e of p(s))t(e,s[e]);else n(e,this[$t](s),i)}[$t](t){return"__proto__"===t?"___proto___":t}[It](t,e){return this[At](this[It].bind(this),"key",t,e),this}[Nt](){var t,e,s,i,n,r,o,a,h,l,c,f;const u=v(this,K,"f").pop();let p;d(u,void 0,v(this,ct,"f")),t=this,e=this,s=this,i=this,n=this,r=this,o=this,a=this,h=this,l=this,c=this,f=this,({options:{set value(e){O(t,et,e,"f")}}.value,configObjects:p,exitProcess:{set value(t){O(e,T,t,"f")}}.value,groups:{set value(t){O(s,Y,t,"f")}}.value,output:{set value(t){O(i,tt,t,"f")}}.value,exitError:{set value(t){O(n,V,t,"f")}}.value,hasOutput:{set value(t){O(r,J,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){O(o,ft,t,"f")}}.value,strictCommands:{set value(t){O(a,dt,t,"f")}}.value,strictOptions:{set value(t){O(h,ut,t,"f")}}.value,completionCommand:{set value(t){O(l,U,t,"f")}}.value,parseFn:{set value(t){O(c,nt,t,"f")}}.value,parseContext:{set value(t){O(f,rt,t,"f")}}.value}=u),v(this,et,"f").configObjects=p,v(this,pt,"f").unfreeze(),v(this,mt,"f").unfreeze(),v(this,z,"f").unfreeze(),v(this,B,"f").unfreeze()}[Dt](t,e){return j(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Ht].bind(this),getContext:this[zt].bind(this),getHasOutput:this[qt].bind(this),getLoggerInstance:this[Wt].bind(this),getParseContext:this[Ft].bind(this),getParserConfiguration:this[jt].bind(this),getUsageInstance:this[Ut].bind(this),getValidationInstance:this[Lt].bind(this),hasParseCallback:this[Vt].bind(this),isGlobalContext:this[Gt].bind(this),postProcess:this[Rt].bind(this),reset:this[Kt].bind(this),runValidation:this[Yt].bind(this),runYargsParserAndExecuteCommands:this[Bt].bind(this),setHasOutput:this[Jt].bind(this)}}[Ht](){return v(this,z,"f")}[zt](){return v(this,W,"f")}[qt](){return v(this,J,"f")}[Wt](){return v(this,Q,"f")}[Ft](){return v(this,rt,"f")||{}}[Ut](){return v(this,pt,"f")}[Lt](){return v(this,mt,"f")}[Vt](){return!!v(this,nt,"f")}[Gt](){return v(this,X,"f")}[Rt](t,e,s,i){if(s)return t;if(f(t))return t;e||(t=this[yt](t));return(this[jt]()["parse-positional-numbers"]||void 0===this[jt]()["parse-positional-numbers"])&&(t=this[kt](t)),i&&(t=C(t,this,v(this,B,"f").getMiddleware(),!1)),t}[Kt](t={}){O(this,et,v(this,et,"f")||{},"f");const e={};e.local=v(this,et,"f").local||[],e.configObjects=v(this,et,"f").configObjects||[];const s={};e.local.forEach((e=>{s[e]=!0,(t[e]||[]).forEach((t=>{s[t]=!0}))})),Object.assign(v(this,at,"f"),Object.keys(v(this,Y,"f")).reduce(((t,e)=>{const i=v(this,Y,"f")[e].filter((t=>!(t in s)));return i.length>0&&(t[e]=i),t}),{})),O(this,Y,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(v(this,et,"f")[t]||[]).filter((t=>!s[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=g(v(this,et,"f")[t],(t=>!s[t]))})),e.envPrefix=v(this,et,"f").envPrefix,O(this,et,e,"f"),O(this,pt,v(this,pt,"f")?v(this,pt,"f").reset(s):P(this,v(this,ct,"f")),"f"),O(this,mt,v(this,mt,"f")?v(this,mt,"f").reset(s):function(t,e,s){const i=s.y18n.__,n=s.y18n.__n,r={nonOptionCount:function(s){const i=t.getDemandedCommands(),r=s._.length+(s["--"]?s["--"].length:0)-t.getInternalMethods().getContext().commands.length;i._&&(ri._.max)&&(ri._.max&&(void 0!==i._.maxMsg?e.fail(i._.maxMsg?i._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.max.toString()):null):e.fail(n("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),i._.max.toString()))))},positionalCount:function(t,s){s{H.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,i)||f.push(e)})),h&&(d.commands.length>0||c.length>0||a)&&s._.slice(d.commands.length).forEach((t=>{c.includes(""+t)||f.push(""+t)})),h){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,i=d.commands.length+e;i{t=String(t),d.commands.includes(t)||f.includes(t)||f.push(t)}))}f.length&&e.fail(n("Unknown argument: %s","Unknown arguments: %s",f.length,f.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(s){const i=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||i.length>0)&&s._.slice(o.commands.length).forEach((t=>{i.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(n("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,s){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;const i=t.parsed.newAliases;return[e,...s[e]].some((t=>!Object.prototype.hasOwnProperty.call(i,t)||!i[e]))},limitedChoices:function(s){const n=t.getOptions(),r={};if(!Object.keys(n.choices).length)return;Object.keys(s).forEach((t=>{-1===H.indexOf(t)&&Object.prototype.hasOwnProperty.call(n.choices,t)&&[].concat(s[t]).forEach((e=>{-1===n.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=i("Invalid values:");o.forEach((t=>{a+=`\n ${i("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(n.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const s=Number(e);return"number"==typeof(e=isNaN(s)?e:s)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,i){h(" [array|number|string]",[e,i],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(i)?i.forEach((t=>r.implies(e,t))):(d(i,void 0,s),o[e].push(i)))},r.getImplied=function(){return o},r.implications=function(t){const s=[];if(Object.keys(o).forEach((e=>{const i=e;(o[e]||[]).forEach((e=>{let n=i;const r=e;n=a(t,n),e=a(t,e),n&&!e&&s.push(` ${i} -> ${r}`)}))})),s.length){let t=`${i("Implications failed:")}\n`;s.forEach((e=>{t+=e})),e.fail(t)}};let l={};r.conflicts=function(e,s){h(" [array|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),l[e]||(l[e]=[]),Array.isArray(s)?s.forEach((t=>r.conflicts(e,t))):l[e].push(s))},r.getConflicting=()=>l,r.conflicting=function(n){Object.keys(n).forEach((t=>{l[t]&&l[t].forEach((s=>{s&&void 0!==n[t]&&void 0!==n[s]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,s))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach((t=>{l[t].forEach((r=>{r&&void 0!==n[s.Parser.camelCase(t)]&&void 0!==n[s.Parser.camelCase(r)]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,s){s=s.sort(((t,e)=>e.length-t.length));let n=null,r=1/0;for(let e,i=0;void 0!==(e=s[i]);i++){const s=D(t,e);s<=3&&s!t[e])),l=g(l,(e=>!t[e])),r};const c=[];return r.freeze=function(){c.push({implied:o,conflicting:l})},r.unfreeze=function(){const t=c.pop();d(t,void 0,s),({implied:o,conflicting:l}=t)},r}(this,v(this,pt,"f"),v(this,ct,"f")),"f"),O(this,z,v(this,z,"f")?v(this,z,"f").reset():function(t,e,s,i){return new M(t,e,s,i)}(v(this,pt,"f"),v(this,mt,"f"),v(this,B,"f"),v(this,ct,"f")),"f"),v(this,F,"f")||O(this,F,function(t,e,s,i){return new N(t,e,s,i)}(this,v(this,pt,"f"),v(this,z,"f"),v(this,ct,"f")),"f"),v(this,B,"f").reset(),O(this,U,null,"f"),O(this,tt,"","f"),O(this,V,null,"f"),O(this,J,!1,"f"),this.parsed=!1,this}[Tt](t,e){return v(this,ct,"f").path.relative(t,e)}[Bt](t,s,i,n=0,r=!1){let o=!!i||r;t=t||v(this,ht,"f"),v(this,et,"f").__=v(this,ct,"f").y18n.__,v(this,et,"f").configuration=this[jt]();const a=!!v(this,et,"f").configuration["populate--"],h=Object.assign({},v(this,et,"f").configuration,{"populate--":!0}),l=v(this,ct,"f").Parser.detailed(t,Object.assign({},v(this,et,"f"),{configuration:{"parse-positional-numbers":!1,...h}})),c=Object.assign(l.argv,v(this,rt,"f"));let d;const u=l.aliases;let p=!1,g=!1;Object.keys(c).forEach((t=>{t===v(this,Z,"f")&&c[t]?p=!0:t===v(this,gt,"f")&&c[t]&&(g=!0)})),c.$0=this.$0,this.parsed=l,0===n&&v(this,pt,"f").clearCachedHelpMessage();try{if(this[_t](),s)return this[Rt](c,a,!!i,!1);if(v(this,Z,"f")){[v(this,Z,"f")].concat(u[v(this,Z,"f")]||[]).filter((t=>t.length>1)).includes(""+c._[c._.length-1])&&(c._.pop(),p=!0)}O(this,X,!1,"f");const h=v(this,z,"f").getCommands(),m=v(this,F,"f").completionKey in c,y=p||m||r;if(c._.length){if(h.length){let t;for(let e,s=n||0;void 0!==c._[s];s++){if(e=String(c._[s]),h.includes(e)&&e!==v(this,U,"f")){const t=v(this,z,"f").runCommand(e,this,l,s+1,r,p||g||r);return this[Rt](t,a,!!i,!1)}if(!t&&e!==v(this,U,"f")){t=e;break}}!v(this,z,"f").hasDefaultCommand()&&v(this,lt,"f")&&t&&!y&&v(this,mt,"f").recommendCommands(t,h)}v(this,U,"f")&&c._.includes(v(this,U,"f"))&&!m&&(v(this,T,"f")&&E(!0),this.showCompletionScript(),this.exit(0))}if(v(this,z,"f").hasDefaultCommand()&&!y){const t=v(this,z,"f").runCommand(null,this,l,0,r,p||g||r);return this[Rt](t,a,!!i,!1)}if(m){v(this,T,"f")&&E(!0);const s=(t=[].concat(t)).slice(t.indexOf(`--${v(this,F,"f").completionKey}`)+1);return v(this,F,"f").getCompletion(s,((t,s)=>{if(t)throw new e(t.message);(s||[]).forEach((t=>{v(this,Q,"f").log(t)})),this.exit(0)})),this[Rt](c,!a,!!i,!1)}if(v(this,J,"f")||(p?(v(this,T,"f")&&E(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(v(this,T,"f")&&E(!0),o=!0,v(this,pt,"f").showVersion("log"),this.exit(0))),!o&&v(this,et,"f").skipValidation.length>0&&(o=Object.keys(c).some((t=>v(this,et,"f").skipValidation.indexOf(t)>=0&&!0===c[t]))),!o){if(l.error)throw new e(l.error.message);if(!m){const t=this[Yt](u,{},l.error);i||(d=C(c,this,v(this,B,"f").getMiddleware(),!0)),d=this[Dt](t,null!=d?d:c),f(d)&&!i&&(d=d.then((()=>C(c,this,v(this,B,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof e))throw t;v(this,pt,"f").fail(t.message,t)}return this[Rt](null!=d?d:c,a,!!i,!0)}[Yt](t,s,i,n){const r={...this.getDemandedOptions()};return o=>{if(i)throw new e(i.message);v(this,mt,"f").nonOptionCount(o),v(this,mt,"f").requiredArguments(o,r);let a=!1;v(this,dt,"f")&&(a=v(this,mt,"f").unknownCommands(o)),v(this,ft,"f")&&!a?v(this,mt,"f").unknownArguments(o,t,s,!!n):v(this,ut,"f")&&v(this,mt,"f").unknownArguments(o,t,{},!1,!1),v(this,mt,"f").limitedChoices(o),v(this,mt,"f").implications(o),v(this,mt,"f").conflicting(o)}}[Jt](){O(this,J,!0,"f")}[Zt](t){if("string"==typeof t)v(this,et,"f").key[t]=!0;else for(const e of t)v(this,et,"f").key[e]=!0}}var Qt,te;const{readFileSync:ee}=require("fs"),{inspect:se}=require("util"),{resolve:ie}=require("path"),ne=require("y18n"),re=require("yargs-parser");var oe,ae={assert:{notStrictEqual:t.notStrictEqual,strictEqual:t.strictEqual},cliui:require("cliui"),findUp:require("escalade/sync"),getEnv:t=>process.env[t],getCallerFile:require("get-caller-file"),getProcessArgvBin:y,inspect:se,mainFilename:null!==(te=null===(Qt=null===require||void 0===require?void 0:require.main)||void 0===Qt?void 0:Qt.filename)&&void 0!==te?te:process.cwd(),Parser:re,path:require("path"),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:ee,require:require,requireDirectory:require("require-directory"),stringWidth:require("string-width"),y18n:ne({directory:ie(__dirname,"../locales"),updateFiles:!1})};const he=(null===(oe=null===process||void 0===process?void 0:process.env)||void 0===oe?void 0:oe.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1]){const i=new Xt(t,e,s,ce);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}),argsert:h,isPromise:f,objFilter:g,parseCommand:o,Parser:le,processArgv:b,YError:e};module.exports=fe; diff --git a/shared/constants/app.js b/shared/constants/app.js index bc27e0df168e..0d1aecc066e9 100644 --- a/shared/constants/app.js +++ b/shared/constants/app.js @@ -39,14 +39,11 @@ export const MESSAGE_TYPE = { ETH_REQUEST_ACCOUNTS: 'eth_requestAccounts', ETH_SIGN: 'eth_sign', ETH_SIGN_TYPED_DATA: 'eth_signTypedData', - ETH_SIGN_TYPED_DATA_V3: 'eth_signTypedData_v3', - ETH_SIGN_TYPED_DATA_V4: 'eth_signTypedData_v4', GET_PROVIDER_STATE: 'metamask_getProviderState', LOG_WEB3_SHIM_USAGE: 'metamask_logWeb3ShimUsage', PERSONAL_SIGN: 'personal_sign', SEND_METADATA: 'metamask_sendDomainMetadata', SWITCH_ETHEREUM_CHAIN: 'wallet_switchEthereumChain', - WALLET_REQUEST_PERMISSIONS: 'wallet_requestPermissions', WATCH_ASSET: 'wallet_watchAsset', WATCH_ASSET_LEGACY: 'metamask_watchAsset', ///: BEGIN:ONLY_INCLUDE_IN(flask) @@ -95,5 +92,3 @@ export const FIREFOX_BUILD_IDS = [ METAMASK_PROD_FIREFOX_ID, METAMASK_FLASK_FIREFOX_ID, ]; - -export const UNKNOWN_TICKER_SYMBOL = 'UNKNOWN'; diff --git a/shared/constants/gas.js b/shared/constants/gas.js index f6a2ec337123..ae674e4a24e4 100644 --- a/shared/constants/gas.js +++ b/shared/constants/gas.js @@ -1,9 +1,7 @@ import { addHexPrefix } from 'ethereumjs-util'; +import { MIN_GAS_LIMIT_HEX } from '../../ui/pages/send/send.constants'; const ONE_HUNDRED_THOUSAND = 100000; -const MIN_GAS_LIMIT_DEC = '21000'; - -export const MIN_GAS_LIMIT_HEX = parseInt(MIN_GAS_LIMIT_DEC, 10).toString(16); export const GAS_LIMITS = { // maximum gasLimit of a simple send @@ -12,22 +10,9 @@ export const GAS_LIMITS = { BASE_TOKEN_ESTIMATE: addHexPrefix(ONE_HUNDRED_THOUSAND.toString(16)), }; -/** - * @typedef {Object} GasEstimateTypes - * @property {'fee-market'} FEE_MARKET - A gas estimate for a fee market - * transaction generated by our gas estimation API. - * @property {'legacy'} LEGACY - A gas estimate for a legacy Transaction - * generated by our gas estimation API. - * @property {'eth_gasPrice'} ETH_GAS_PRICE - A gas estimate provided by the - * Ethereum node via eth_gasPrice. - * @property {'none'} NONE - No gas estimate available. - */ - /** * These are already declared in @metamask/controllers but importing them from * that module and re-exporting causes the UI bundle size to expand beyond 4MB - * - * @type {GasEstimateTypes} */ export const GAS_ESTIMATE_TYPES = { FEE_MARKET: 'fee-market', diff --git a/shared/constants/metametrics.js b/shared/constants/metametrics.js index 8d18c9dc09b6..d2c9e6663318 100644 --- a/shared/constants/metametrics.js +++ b/shared/constants/metametrics.js @@ -164,9 +164,6 @@ * trait * @property {'networks_added'} NETWORKS_ADDED - when user modifies networks * we identify the networks_added trait - * @property {'networks_without_ticker'} NETWORKS_WITHOUT_TICKER - when user - * modifies networks we identify the networks_without_ticker trait for - * networks without a ticker. * @property {'nft_autodetection_enabled'} NFT_AUTODETECTION_ENABLED - when Autodetect NFTs * feature is toggled we identify the nft_autodetection_enabled trait * @property {'number_of_accounts'} NUMBER_OF_ACCOUNTS - when identities @@ -194,7 +191,6 @@ export const TRAITS = { ADDRESS_BOOK_ENTRIES: 'address_book_entries', LEDGER_CONNECTION_TYPE: 'ledger_connection_type', NETWORKS_ADDED: 'networks_added', - NETWORKS_WITHOUT_TICKER: 'networks_without_ticker', NFT_AUTODETECTION_ENABLED: 'nft_autodetection_enabled', NUMBER_OF_ACCOUNTS: 'number_of_accounts', NUMBER_OF_NFT_COLLECTIONS: 'number_of_nft_collections', @@ -214,9 +210,6 @@ export const TRAITS = { * type of ledger connection set by user preference. * @property {Array} [networks_added] - An array consisting of chainIds * that indicate the networks a user has added to their MetaMask. - * @property {Array} [networks_without_ticker] - An array consisting of - * chainIds that indicate the networks added by the user that do not have a - * ticker. * @property {number} [nft_autodetection_enabled] - does the user have the * use collection/nft detection enabled? * @property {number} [number_of_accounts] - A number representing the number @@ -276,23 +269,13 @@ export const REJECT_NOTFICIATION_CLOSE_SIG = */ export const EVENT_NAMES = { - ENCRYPTION_PUBLIC_KEY_APPROVED: 'Encryption Public Key Approved', - ENCRYPTION_PUBLIC_KEY_REJECTED: 'Encryption Public Key Rejected', ENCRYPTION_PUBLIC_KEY_REQUESTED: 'Encryption Public Key Requested', - DECRYPTION_APPROVED: 'Decryption Approved', - DECRYPTION_REJECTED: 'Decryption Rejected', DECRYPTION_REQUESTED: 'Decryption Requested', - PERMISSIONS_APPROVED: 'Permissions Approved', - PERMISSIONS_REJECTED: 'Permissions Rejected', PERMISSIONS_REQUESTED: 'Permissions Requested', - PROVIDER_METHOD_CALLED: 'Provider Method Called', - SIGNATURE_APPROVED: 'Signature Approved', - SIGNATURE_REJECTED: 'Signature Rejected', SIGNATURE_REQUESTED: 'Signature Requested', TOKEN_ADDED: 'Token Added', TOKEN_DETECTED: 'Token Detected', TOKEN_HIDDEN: 'Token Hidden', - NFT_ADDED: 'NFT Added', TOKEN_IMPORT_CANCELED: 'Token Import Canceled', TOKEN_IMPORT_CLICKED: 'Token Import Clicked', }; @@ -315,10 +298,6 @@ export const EVENT = { WALLET: 'Wallet', }, SOURCE: { - NETWORK: { - POPULAR_NETWORK_LIST: 'popular_network_list', - CUSTOM_NETWORK_FORM: 'custom_network_form', - }, SWAPS: { MAIN_VIEW: 'Main View', TOKEN_VIEW: 'Token View', diff --git a/shared/constants/network.js b/shared/constants/network.js index 6891017d992b..8036f36d4dcf 100644 --- a/shared/constants/network.js +++ b/shared/constants/network.js @@ -7,7 +7,6 @@ export const MAINNET = 'mainnet'; export const GOERLI = 'goerli'; export const LOCALHOST = 'localhost'; export const NETWORK_TYPE_RPC = 'rpc'; -export const HOMESTEAD = 'homestead'; export const MAINNET_NETWORK_ID = '1'; export const ROPSTEN_NETWORK_ID = '3'; @@ -24,14 +23,11 @@ export const KOVAN_CHAIN_ID = '0x2a'; export const LOCALHOST_CHAIN_ID = '0x539'; export const BSC_CHAIN_ID = '0x38'; export const OPTIMISM_CHAIN_ID = '0xa'; -export const OPTIMISM_TESTNET_CHAIN_ID = '0x1a4'; +export const OPTIMISM_TESTNET_CHAIN_ID = '0x45'; export const POLYGON_CHAIN_ID = '0x89'; export const AVALANCHE_CHAIN_ID = '0xa86a'; export const FANTOM_CHAIN_ID = '0xfa'; export const CELO_CHAIN_ID = '0xa4ec'; -export const ARBITRUM_CHAIN_ID = '0xa4b1'; -export const HARMONY_CHAIN_ID = '0x63564c40'; -export const PALM_CHAIN_ID = '0x2a15c308d'; /** * The largest possible chain ID we can handle. @@ -47,16 +43,9 @@ export const GOERLI_DISPLAY_NAME = 'Goerli'; export const LOCALHOST_DISPLAY_NAME = 'Localhost 8545'; export const BSC_DISPLAY_NAME = 'Binance Smart Chain'; export const POLYGON_DISPLAY_NAME = 'Polygon'; -export const AVALANCHE_DISPLAY_NAME = 'Avalanche Network C-Chain'; -export const ARBITRUM_DISPLAY_NAME = 'Arbitrum One'; -export const BNB_DISPLAY_NAME = - 'BNB Smart Chain (previously Binance Smart Chain Mainnet)'; -export const OPTIMISM_DISPLAY_NAME = 'Optimism'; -export const FANTOM_DISPLAY_NAME = 'Fantom Opera'; -export const HARMONY_DISPLAY_NAME = 'Harmony Mainnet Shard 0'; -export const PALM_DISPLAY_NAME = 'Palm'; +export const AVALANCHE_DISPLAY_NAME = 'Avalanche'; -export const infuraProjectId = process.env.INFURA_PROJECT_ID; +const infuraProjectId = process.env.INFURA_PROJECT_ID; export const getRpcUrl = ({ network, excludeProjectId = false }) => `https://${network}.infura.io/v3/${excludeProjectId ? '' : infuraProjectId}`; @@ -75,20 +64,12 @@ export const MATIC_SYMBOL = 'MATIC'; export const AVALANCHE_SYMBOL = 'AVAX'; export const FANTOM_SYMBOL = 'FTM'; export const CELO_SYMBOL = 'CELO'; -export const ARBITRUM_SYMBOL = 'AETH'; -export const HARMONY_SYMBOL = 'ONE'; -export const PALM_SYMBOL = 'PALM'; export const ETH_TOKEN_IMAGE_URL = './images/eth_logo.svg'; export const TEST_ETH_TOKEN_IMAGE_URL = './images/black-eth-logo.svg'; export const BNB_TOKEN_IMAGE_URL = './images/bnb.png'; export const MATIC_TOKEN_IMAGE_URL = './images/matic-token.png'; export const AVAX_TOKEN_IMAGE_URL = './images/avax-token.png'; -export const AETH_TOKEN_IMAGE_URL = './images/arbitrum.svg'; -export const FTM_TOKEN_IMAGE_URL = './images/fantom-opera.svg'; -export const HARMONY_ONE_TOKEN_IMAGE_URL = './images/harmony-one.svg'; -export const OPTIMISM_TOKEN_IMAGE_URL = './images/optimism.svg'; -export const PALM_TOKEN_IMAGE_URL = './images/palm.svg'; export const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET, GOERLI]; @@ -185,19 +166,6 @@ export const CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP = { [AVALANCHE_CHAIN_ID]: AVAX_TOKEN_IMAGE_URL, [BSC_CHAIN_ID]: BNB_TOKEN_IMAGE_URL, [POLYGON_CHAIN_ID]: MATIC_TOKEN_IMAGE_URL, - [ARBITRUM_CHAIN_ID]: AETH_TOKEN_IMAGE_URL, - [BSC_CHAIN_ID]: BNB_TOKEN_IMAGE_URL, - [FANTOM_CHAIN_ID]: FTM_TOKEN_IMAGE_URL, - [HARMONY_CHAIN_ID]: HARMONY_ONE_TOKEN_IMAGE_URL, - [OPTIMISM_CHAIN_ID]: OPTIMISM_TOKEN_IMAGE_URL, - [PALM_CHAIN_ID]: PALM_TOKEN_IMAGE_URL, -}; - -export const NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP = { - [ROPSTEN_NETWORK_ID]: ROPSTEN, - [RINKEBY_NETWORK_ID]: RINKEBY, - [GOERLI_NETWORK_ID]: GOERLI, - [MAINNET_NETWORK_ID]: HOMESTEAD, }; export const CHAIN_ID_TO_NETWORK_ID_MAP = Object.values( @@ -268,11 +236,6 @@ export const BUYABLE_CHAINS_MAP = { defaultCurrencyCode: 'eth', showOnlyCurrencies: 'eth,usdt,usdc,dai', }, - wyre: { - srn: 'ethereum', - currencyCode: ETH_SYMBOL, - }, - coinbasePayCurrencies: [ETH_SYMBOL, 'USDC', 'DAI'], }, [ROPSTEN_CHAIN_ID]: { nativeCurrency: TEST_NETWORK_TICKER_MAP[ROPSTEN], @@ -307,10 +270,6 @@ export const BUYABLE_CHAINS_MAP = { defaultCurrencyCode: 'matic_polygon', showOnlyCurrencies: 'matic_polygon,usdc_polygon', }, - wyre: { - srn: 'matic', - currencyCode: MATIC_SYMBOL, - }, }, [AVALANCHE_CHAIN_ID]: { nativeCurrency: AVALANCHE_SYMBOL, @@ -320,11 +279,6 @@ export const BUYABLE_CHAINS_MAP = { defaultCurrencyCode: 'avax_cchain', showOnlyCurrencies: 'avax_cchain', }, - wyre: { - srn: 'avalanche', - currencyCode: AVALANCHE_SYMBOL, - }, - coinbasePayCurrencies: [AVALANCHE_SYMBOL], }, [FANTOM_CHAIN_ID]: { nativeCurrency: FANTOM_SYMBOL, @@ -341,86 +295,3 @@ export const BUYABLE_CHAINS_MAP = { }, }, }; - -export const FEATURED_RPCS = [ - { - chainId: ARBITRUM_CHAIN_ID, - nickname: ARBITRUM_DISPLAY_NAME, - rpcUrl: `https://arbitrum-mainnet.infura.io/v3/${infuraProjectId}`, - ticker: ARBITRUM_SYMBOL, - rpcPrefs: { - blockExplorerUrl: 'https://explorer.arbitrum.io', - imageUrl: AETH_TOKEN_IMAGE_URL, - }, - }, - { - chainId: AVALANCHE_CHAIN_ID, - nickname: AVALANCHE_DISPLAY_NAME, - rpcUrl: 'https://api.avax.network/ext/bc/C/rpc', - ticker: AVALANCHE_SYMBOL, - rpcPrefs: { - blockExplorerUrl: 'https://snowtrace.io/', - imageUrl: AVAX_TOKEN_IMAGE_URL, - }, - }, - { - chainId: BSC_CHAIN_ID, - nickname: BNB_DISPLAY_NAME, - rpcUrl: 'https://bsc-dataseed.binance.org/', - ticker: BNB_SYMBOL, - rpcPrefs: { - blockExplorerUrl: 'https://bscscan.com/', - imageUrl: BNB_TOKEN_IMAGE_URL, - }, - }, - { - chainId: FANTOM_CHAIN_ID, - nickname: FANTOM_DISPLAY_NAME, - rpcUrl: 'https://rpc.ftm.tools/', - ticker: FANTOM_SYMBOL, - rpcPrefs: { - blockExplorerUrl: 'https://ftmscan.com/', - imageUrl: FTM_TOKEN_IMAGE_URL, - }, - }, - { - chainId: HARMONY_CHAIN_ID, - nickname: HARMONY_DISPLAY_NAME, - rpcUrl: 'https://api.harmony.one/', - ticker: HARMONY_SYMBOL, - rpcPrefs: { - blockExplorerUrl: 'https://explorer.harmony.one/', - imageUrl: HARMONY_ONE_TOKEN_IMAGE_URL, - }, - }, - { - chainId: OPTIMISM_CHAIN_ID, - nickname: OPTIMISM_DISPLAY_NAME, - rpcUrl: `https://optimism-mainnet.infura.io/v3/${infuraProjectId}`, - ticker: ETH_SYMBOL, - rpcPrefs: { - blockExplorerUrl: 'https://optimistic.etherscan.io/', - imageUrl: OPTIMISM_TOKEN_IMAGE_URL, - }, - }, - { - chainId: PALM_CHAIN_ID, - nickname: PALM_DISPLAY_NAME, - rpcUrl: `https://palm-mainnet.infura.io/v3/${infuraProjectId}`, - ticker: PALM_SYMBOL, - rpcPrefs: { - blockExplorerUrl: 'https://explorer.palm.io/', - imageUrl: PALM_TOKEN_IMAGE_URL, - }, - }, - { - chainId: POLYGON_CHAIN_ID, - nickname: `${POLYGON_DISPLAY_NAME} ${capitalize(MAINNET)}`, - rpcUrl: `https://polygon-mainnet.infura.io/v3/${infuraProjectId}`, - ticker: MATIC_SYMBOL, - rpcPrefs: { - blockExplorerUrl: 'https://polygonscan.com/', - imageUrl: MATIC_TOKEN_IMAGE_URL, - }, - }, -]; diff --git a/shared/constants/permissions.js b/shared/constants/permissions.js index 77df6431f804..c1e4e69e7ebe 100644 --- a/shared/constants/permissions.js +++ b/shared/constants/permissions.js @@ -21,7 +21,6 @@ export const PermissionNamespaces = Object.freeze({ export const EndowmentPermissions = Object.freeze({ 'endowment:network-access': 'endowment:network-access', - 'endowment:long-running': 'endowment:long-running', }); // Methods / permissions in external packages that we are temporarily excluding. diff --git a/shared/constants/permissions.test.js b/shared/constants/permissions.test.js index 3637fed5818a..c6ace6243656 100644 --- a/shared/constants/permissions.test.js +++ b/shared/constants/permissions.test.js @@ -1,4 +1,4 @@ -import { endowmentPermissionBuilders } from '@metamask/snap-controllers'; +import { endowmentPermissionBuilders } from '@metamask/controllers'; import { restrictedMethodPermissionBuilders } from '@metamask/rpc-methods'; import { EndowmentPermissions, diff --git a/shared/constants/phishing.js b/shared/constants/phishing.js deleted file mode 100644 index 63dea370626b..000000000000 --- a/shared/constants/phishing.js +++ /dev/null @@ -1,4 +0,0 @@ -export const PHISHING_NEW_ISSUE_URLS = { - MetaMask: 'https://github.com/metamask/eth-phishing-detect/issues/new', - PhishFort: 'https://github.com/phishfort/phishfort-lists/issues/new', -}; diff --git a/shared/constants/swaps.js b/shared/constants/swaps.js index 8482709caf09..10db41a2e634 100644 --- a/shared/constants/swaps.js +++ b/shared/constants/swaps.js @@ -206,8 +206,3 @@ export const TOKEN_BUCKET_PRIORITY = { OWNED: 'owned', TOP: 'top', }; - -export const SLIPPAGE = { - DEFAULT: 2, - HIGH: 3, -}; diff --git a/shared/constants/tokens.js b/shared/constants/tokens.js index 2a878f3df1de..c4e52317a3ad 100644 --- a/shared/constants/tokens.js +++ b/shared/constants/tokens.js @@ -8,16 +8,3 @@ import contractMap from '@metamask/contract-metadata'; export const LISTED_CONTRACT_ADDRESSES = Object.keys( contractMap, ).map((address) => address.toLowerCase()); - -/** - * @typedef {Object} TokenDetails - * @property {string} address - The address of the selected 'TOKEN' or - * 'COLLECTIBLE' contract. - * @property {string} [symbol] - The symbol of the token. - * @property {number} [decimals] - The number of decimals of the selected - * 'ERC20' asset. - * @property {number} [tokenId] - The id of the selected 'COLLECTIBLE' asset. - * @property {TokenStandardStrings} [standard] - The standard of the selected - * asset. - * @property {boolean} [isERC721] - True when the asset is a ERC721 token. - */ diff --git a/shared/constants/transaction.js b/shared/constants/transaction.js index 845f769a0310..411e14248124 100644 --- a/shared/constants/transaction.js +++ b/shared/constants/transaction.js @@ -15,8 +15,6 @@ import { MESSAGE_TYPE } from './app'; * to ensure that the receiver is an address capable of handling with the token being sent. * @property {'approve'} TOKEN_METHOD_APPROVE - A token transaction requesting an * allowance of the token to spend on behalf of the user - * @property {'setapprovalforall'} TOKEN_METHOD_SET_APPROVAL_FOR_ALL - A token transaction requesting an - * allowance of all of a user's token to spend on behalf of the user * @property {'incoming'} INCOMING - An incoming (deposit) transaction * @property {'simpleSend'} SIMPLE_SEND - A transaction sending a network's native asset to a recipient * @property {'contractInteraction'} CONTRACT_INTERACTION - A transaction that is @@ -51,24 +49,23 @@ import { MESSAGE_TYPE } from './app'; */ export const TRANSACTION_TYPES = { CANCEL: 'cancel', - CONTRACT_INTERACTION: 'contractInteraction', - DEPLOY_CONTRACT: 'contractDeployment', - ETH_DECRYPT: MESSAGE_TYPE.ETH_DECRYPT, - ETH_GET_ENCRYPTION_PUBLIC_KEY: MESSAGE_TYPE.ETH_GET_ENCRYPTION_PUBLIC_KEY, - INCOMING: 'incoming', - PERSONAL_SIGN: MESSAGE_TYPE.PERSONAL_SIGN, RETRY: 'retry', - SIGN: MESSAGE_TYPE.ETH_SIGN, - SIGN_TYPED_DATA: MESSAGE_TYPE.ETH_SIGN_TYPED_DATA, + TOKEN_METHOD_TRANSFER: 'transfer', + TOKEN_METHOD_TRANSFER_FROM: 'transferfrom', + TOKEN_METHOD_SAFE_TRANSFER_FROM: 'safetransferfrom', + TOKEN_METHOD_APPROVE: 'approve', + INCOMING: 'incoming', SIMPLE_SEND: 'simpleSend', - SMART: 'smart', + CONTRACT_INTERACTION: 'contractInteraction', + DEPLOY_CONTRACT: 'contractDeployment', SWAP: 'swap', SWAP_APPROVAL: 'swapApproval', - TOKEN_METHOD_APPROVE: 'approve', - TOKEN_METHOD_SAFE_TRANSFER_FROM: 'safetransferfrom', - TOKEN_METHOD_TRANSFER: 'transfer', - TOKEN_METHOD_TRANSFER_FROM: 'transferfrom', - TOKEN_METHOD_SET_APPROVAL_FOR_ALL: 'setapprovalforall', + SMART: 'smart', + SIGN: MESSAGE_TYPE.ETH_SIGN, + SIGN_TYPED_DATA: MESSAGE_TYPE.ETH_SIGN_TYPED_DATA, + PERSONAL_SIGN: MESSAGE_TYPE.PERSONAL_SIGN, + ETH_DECRYPT: MESSAGE_TYPE.ETH_DECRYPT, + ETH_GET_ENCRYPTION_PUBLIC_KEY: MESSAGE_TYPE.ETH_GET_ENCRYPTION_PUBLIC_KEY, }; /** @@ -217,10 +214,10 @@ export const SMART_TRANSACTION_STATUSES = { * @type {TransactionGroupCategories} */ export const TRANSACTION_GROUP_CATEGORIES = { - APPROVAL: 'approval', - INTERACTION: 'interaction', - RECEIVE: 'receive', SEND: 'send', + RECEIVE: 'receive', + INTERACTION: 'interaction', + APPROVAL: 'approval', SIGNATURE_REQUEST: 'signature-request', SWAP: 'swap', }; @@ -252,8 +249,6 @@ export const TRANSACTION_GROUP_CATEGORIES = { * @property {number} id - An internally unique tx identifier. * @property {number} time - Time the transaction was first suggested, in unix * epoch time (ms). - * @property {string} contractMethodName - A string representing a name of - * transaction contract method. * @property {TransactionTypeString} type - The type of transaction this txMeta * represents. * @property {TransactionStatusString} status - The current status of the @@ -328,28 +323,13 @@ export const TRANSACTION_EVENTS = { SUBMITTED: 'Transaction Submitted', }; -/** - * @typedef {Object} AssetTypes - * @property {'NATIVE'} NATIVE - The native asset for the current network, such - * as ETH - * @property {'TOKEN'} TOKEN - An ERC20 token. - * @property {'COLLECTIBLE'} COLLECTIBLE - An ERC721 or ERC1155 token. - * @property {'UNKNOWN'} UNKNOWN - A transaction interacting with a contract - * that isn't a token method interaction will be marked as dealing with an - * unknown asset type. - */ - -/** - * This type will work anywhere you expect a string that can be one of the - * above asset types - * - * @typedef {AssetTypes[keyof AssetTypes]} AssetTypesString - */ - /** * The types of assets that a user can send - * - * @type {AssetTypes} + * 1. NATIVE - The native asset for the current network, such as ETH + * 2. TOKEN - An ERC20 token. + * 3. COLLECTIBLE - An ERC721 or ERC1155 token. + * 4. UNKNOWN - A transaction interacting with a contract that isn't a token + * method interaction will be marked as dealing with an unknown asset type. */ export const ASSET_TYPES = { NATIVE: 'NATIVE', @@ -357,36 +337,3 @@ export const ASSET_TYPES = { COLLECTIBLE: 'COLLECTIBLE', UNKNOWN: 'UNKNOWN', }; - -export const ERC20 = 'ERC20'; -export const ERC721 = 'ERC721'; -export const ERC1155 = 'ERC1155'; - -/** - * @typedef {Object} TokenStandards - * @property {'ERC20'} ERC20 - A token that conforms to the ERC20 standard. - * @property {'ERC721'} ERC721 - A token that conforms to the ERC721 standard. - * @property {'ERC1155'} ERC1155 - A token that conforms to the ERC1155 - * standard. - * @property {'NONE'} NONE - Not a token, but rather the base asset of the - * selected chain. - */ - -/** - * This type will work anywhere you expect a string that can be one of the - * above statuses - * - * @typedef {TokenStandards[keyof TokenStandards]} TokenStandardStrings - */ - -/** - * Describes the standard which a token conforms to. - * - * @type {TokenStandards} - */ -export const TOKEN_STANDARDS = { - ERC20, - ERC721, - ERC1155, - NONE: 'NONE', -}; diff --git a/shared/modules/fetch-with-timeout.js b/shared/modules/fetch-with-timeout.js index 791470d77cdc..b12e8cba56d0 100644 --- a/shared/modules/fetch-with-timeout.js +++ b/shared/modules/fetch-with-timeout.js @@ -1,7 +1,6 @@ import { memoize } from 'lodash'; -import { SECOND } from '../constants/time'; -const getFetchWithTimeout = memoize((timeout = SECOND * 30) => { +const getFetchWithTimeout = memoize((timeout) => { if (!Number.isInteger(timeout) || timeout < 1) { throw new Error('Must specify positive integer timeout.'); } diff --git a/shared/modules/fetch-with-timeout.test.js b/shared/modules/fetch-with-timeout.test.js index 2129db1c30fa..8d7ae57852b9 100644 --- a/shared/modules/fetch-with-timeout.test.js +++ b/shared/modules/fetch-with-timeout.test.js @@ -6,7 +6,7 @@ describe('getFetchWithTimeout', () => { it('fetches a url', async () => { nock('https://api.infura.io').get('/money').reply(200, '{"hodl": false}'); - const fetchWithTimeout = getFetchWithTimeout(); + const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); const response = await ( await fetchWithTimeout('https://api.infura.io/money') ).json(); @@ -46,9 +46,15 @@ describe('getFetchWithTimeout', () => { }); it('throws on invalid timeout', async () => { + await expect(() => getFetchWithTimeout()).toThrow( + 'Must specify positive integer timeout.', + ); await expect(() => getFetchWithTimeout(-1)).toThrow( 'Must specify positive integer timeout.', ); + await expect(() => getFetchWithTimeout({})).toThrow( + 'Must specify positive integer timeout.', + ); await expect(() => getFetchWithTimeout(true)).toThrow( 'Must specify positive integer timeout.', ); diff --git a/shared/modules/mv3.utils.js b/shared/modules/mv3.utils.js deleted file mode 100644 index a990075b680f..000000000000 --- a/shared/modules/mv3.utils.js +++ /dev/null @@ -1,4 +0,0 @@ -import browser from 'webextension-polyfill'; - -export const isManifestV3 = () => - browser.runtime.getManifest().manifest_version === 3; diff --git a/shared/modules/object.utils.js b/shared/modules/object.utils.js deleted file mode 100644 index ea2af06c40fd..000000000000 --- a/shared/modules/object.utils.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Return a "masked" copy of the given object. - * - * The returned object includes only the properties present in the mask. The - * mask is an object that mirrors the structure of the given object, except - * the only values are `true` or a sub-mask. `true` implies the property - * should be included, and a sub-mask implies the property should be further - * masked according to that sub-mask. - * - * @param {Object} object - The object to mask - * @param {Object} mask - The mask to apply to the object - */ -export function maskObject(object, mask) { - return Object.keys(object).reduce((state, key) => { - if (mask[key] === true) { - state[key] = object[key]; - } else if (mask[key]) { - state[key] = maskObject(object[key], mask[key]); - } - return state; - }, {}); -} diff --git a/shared/modules/rpc.utils.js b/shared/modules/rpc.utils.js index 341ef1d97bb0..ab0c006b6fda 100644 --- a/shared/modules/rpc.utils.js +++ b/shared/modules/rpc.utils.js @@ -1,6 +1,7 @@ +import { SECOND } from '../constants/time'; import getFetchWithTimeout from './fetch-with-timeout'; -const fetchWithTimeout = getFetchWithTimeout(); +const fetchWithTimeout = getFetchWithTimeout(SECOND * 30); /** * Makes a JSON RPC request to the given URL, with the given RPC method and params. diff --git a/shared/modules/transaction.utils.js b/shared/modules/transaction.utils.js index 78c46d34d385..08adb46e3618 100644 --- a/shared/modules/transaction.utils.js +++ b/shared/modules/transaction.utils.js @@ -2,16 +2,13 @@ import { isHexString } from 'ethereumjs-util'; import { ethers } from 'ethers'; import { abiERC721, abiERC20, abiERC1155 } from '@metamask/metamask-eth-abis'; import log from 'loglevel'; -import { - ASSET_TYPES, - TOKEN_STANDARDS, - TRANSACTION_TYPES, -} from '../constants/transaction'; +import { TOKEN_STANDARDS } from '../../ui/helpers/constants/common'; +import { ASSET_TYPES, TRANSACTION_TYPES } from '../constants/transaction'; import { readAddressAsContract } from './contract-utils'; import { isEqualCaseInsensitive } from './string-utils'; /** - * @typedef { 'transfer' | 'approve' | 'setapprovalforall' | 'transferfrom' | 'contractInteraction'| 'simpleSend' } InferrableTransactionTypes + * @typedef { 'transfer' | 'approve' | 'transferfrom' | 'contractInteraction'| 'simpleSend' } InferrableTransactionTypes */ /** @@ -151,35 +148,32 @@ export async function determineTransactionType(txParams, query) { log.debug('Failed to parse transaction data.', error, data); } + const tokenMethodName = [ + TRANSACTION_TYPES.TOKEN_METHOD_APPROVE, + TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER, + TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM, + TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM, + ].find((methodName) => isEqualCaseInsensitive(methodName, name)); + let result; + if (data && tokenMethodName) { + result = tokenMethodName; + } else if (data && !to) { + result = TRANSACTION_TYPES.DEPLOY_CONTRACT; + } + let contractCode; - if (data && !to) { - result = TRANSACTION_TYPES.DEPLOY_CONTRACT; - } else { + if (!result) { const { contractCode: resultCode, isContractAddress, } = await readAddressAsContract(query, to); contractCode = resultCode; - - if (isContractAddress) { - const tokenMethodName = [ - TRANSACTION_TYPES.TOKEN_METHOD_APPROVE, - TRANSACTION_TYPES.TOKEN_METHOD_SET_APPROVAL_FOR_ALL, - TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER, - TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM, - TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM, - ].find((methodName) => isEqualCaseInsensitive(methodName, name)); - - result = - data && tokenMethodName - ? tokenMethodName - : TRANSACTION_TYPES.CONTRACT_INTERACTION; - } else { - result = TRANSACTION_TYPES.SIMPLE_SEND; - } + result = isContractAddress + ? TRANSACTION_TYPES.CONTRACT_INTERACTION + : TRANSACTION_TYPES.SIMPLE_SEND; } return { type: result, getCodeResponse: contractCode }; @@ -187,7 +181,6 @@ export async function determineTransactionType(txParams, query) { const INFERRABLE_TRANSACTION_TYPES = [ TRANSACTION_TYPES.TOKEN_METHOD_APPROVE, - TRANSACTION_TYPES.TOKEN_METHOD_SET_APPROVAL_FOR_ALL, TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER, TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM, TRANSACTION_TYPES.CONTRACT_INTERACTION, @@ -227,7 +220,6 @@ export async function determineTransactionAssetType( // method to get the asset type. const isTokenMethod = [ TRANSACTION_TYPES.TOKEN_METHOD_APPROVE, - TRANSACTION_TYPES.TOKEN_METHOD_SET_APPROVAL_FOR_ALL, TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER, TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM, ].find((methodName) => methodName === inferrableType); diff --git a/shared/modules/transaction.utils.test.js b/shared/modules/transaction.utils.test.js index 6998022e44cc..fba8c7827562 100644 --- a/shared/modules/transaction.utils.test.js +++ b/shared/modules/transaction.utils.test.js @@ -111,23 +111,13 @@ describe('Transaction.utils', function () { const genericProvider = createTestProviderTools().provider; const query = new EthQuery(genericProvider); - it('should return a simple send type when to is truthy and is not a contract address', async function () { - const _providerResultStub = { - // 1 gwei - eth_gasPrice: '0x0de0b6b3a7640000', - // by default, all accounts are external accounts (not contracts) - eth_getCode: '0x', - }; - const _provider = createTestProviderTools({ - scaffold: _providerResultStub, - }).provider; - + it('should return a simple send type when to is truthy but data is falsy', async function () { const result = await determineTransactionType( { to: '0xabc', data: '', }, - new EthQuery(_provider), + query, ); expect(result).toMatchObject({ type: TRANSACTION_TYPES.SIMPLE_SEND, @@ -135,78 +125,33 @@ describe('Transaction.utils', function () { }); }); - it('should return a token transfer type when the recipient is a contract and data is for the respective method call', async function () { - const _providerResultStub = { - // 1 gwei - eth_gasPrice: '0x0de0b6b3a7640000', - // by default, all accounts are external accounts (not contracts) - eth_getCode: '0xab', - }; - const _provider = createTestProviderTools({ - scaffold: _providerResultStub, - }).provider; - + it('should return a token transfer type when data is for the respective method call', async function () { const result = await determineTransactionType( { - to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9', + to: '0xabc', data: '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a', }, - new EthQuery(_provider), + query, ); expect(result).toMatchObject({ type: TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER, - getCodeResponse: '0xab', - }); - }); - - it('should NOT return a token transfer type when the recipient is not a contract but the data matches the respective method call', async function () { - const _providerResultStub = { - // 1 gwei - eth_gasPrice: '0x0de0b6b3a7640000', - // by default, all accounts are external accounts (not contracts) - eth_getCode: '0x', - }; - const _provider = createTestProviderTools({ - scaffold: _providerResultStub, - }).provider; - - const result = await determineTransactionType( - { - to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9', - data: - '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a', - }, - new EthQuery(_provider), - ); - expect(result).toMatchObject({ - type: TRANSACTION_TYPES.SIMPLE_SEND, - getCodeResponse: '0x', + getCodeResponse: undefined, }); }); - it('should return a token approve type when when the recipient is a contract and data is for the respective method call', async function () { - const _providerResultStub = { - // 1 gwei - eth_gasPrice: '0x0de0b6b3a7640000', - // by default, all accounts are external accounts (not contracts) - eth_getCode: '0xab', - }; - const _provider = createTestProviderTools({ - scaffold: _providerResultStub, - }).provider; - + it('should return a token approve type when data is for the respective method call', async function () { const result = await determineTransactionType( { - to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9', + to: '0xabc', data: '0x095ea7b30000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C9700000000000000000000000000000000000000000000000000000000000000005', }, - new EthQuery(_provider), + query, ); expect(result).toMatchObject({ type: TRANSACTION_TYPES.TOKEN_METHOD_APPROVE, - getCodeResponse: '0xab', + getCodeResponse: undefined, }); }); @@ -239,22 +184,12 @@ describe('Transaction.utils', function () { }); it('should return a simple send type with a null getCodeResponse when to is truthy and there is data and but getCode returns an error', async function () { - const _providerResultStub = { - // 1 gwei - eth_gasPrice: '0x0de0b6b3a7640000', - // by default, all accounts are external accounts (not contracts) - eth_getCode: null, - }; - const _provider = createTestProviderTools({ - scaffold: _providerResultStub, - }).provider; - const result = await determineTransactionType( { - to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9', + to: '0xabc', data: '0xabd', }, - new EthQuery(_provider), + query, ); expect(result).toMatchObject({ type: TRANSACTION_TYPES.SIMPLE_SEND, diff --git a/shared/notifications/index.js b/shared/notifications/index.js index a721b2e009c3..65fc49fdeb9e 100644 --- a/shared/notifications/index.js +++ b/shared/notifications/index.js @@ -66,13 +66,9 @@ export const UI_NOTIFICATIONS = { width: '100%', }, }, - 13: { - id: 13, - date: '2022-07-12', - }, }; -export const getTranslatedUINotifications = (t, locale) => { +export const getTranslatedUINoficiations = (t, locale) => { const formattedLocale = locale.replace('_', '-'); return { 1: { @@ -186,14 +182,5 @@ export const getTranslatedUINotifications = (t, locale) => { new Date(UI_NOTIFICATIONS[12].date), ), }, - 13: { - ...UI_NOTIFICATIONS[13], - title: t('notifications13Title'), - description: t('notifications13Description'), - actionText: t('notifications13ActionText'), - date: new Intl.DateTimeFormat(formattedLocale).format( - new Date(UI_NOTIFICATIONS[13].date), - ), - }, }; }; diff --git a/test/data/mock-state.json b/test/data/mock-state.json index 231f050696f1..d856bb3b6a45 100644 --- a/test/data/mock-state.json +++ b/test/data/mock-state.json @@ -37,22 +37,6 @@ "1559": true } }, - "notifications": { - "test": { - "id": "test", - "origin": "local:http://localhost:8086/", - "createdDate": 1652967897732, - "readDate": null, - "message": "Hello, http://localhost:8086!" - }, - "test2": { - "id": "test2", - "origin": "local:http://localhost:8086/", - "createdDate": 1652967897732, - "readDate": 1652967897732, - "message": "Hello, http://localhost:8086!" - } - }, "cachedBalances": {}, "incomingTransactions": {}, "unapprovedTxs": { diff --git a/test/e2e/benchmark.js b/test/e2e/benchmark.js index df4c957568a7..fe2dc7926c81 100644 --- a/test/e2e/benchmark.js +++ b/test/e2e/benchmark.js @@ -1,16 +1,12 @@ #!/usr/bin/env node const path = require('path'); -const { promises: fs } = require('fs'); +const { promises: fs, constants: fsConstants } = require('fs'); const yargs = require('yargs/yargs'); const { hideBin } = require('yargs/helpers'); const ttest = require('ttest'); const { retry } = require('../../development/lib/retry'); const { exitWithError } = require('../../development/lib/exit-with-error'); -const { - isWritable, - getFirstParentDirectoryThatExists, -} = require('../helpers/file'); const { withFixtures, tinyDelayMs } = require('./helpers'); const { PAGES } = require('./webdriver/driver'); @@ -112,6 +108,35 @@ async function profilePageLoad(pages, numSamples, retries) { return results; } +async function isWritable(directory) { + try { + await fs.access(directory, fsConstants.W_OK); + return true; + } catch (error) { + if (error.code !== 'EACCES') { + throw error; + } + return false; + } +} + +async function getFirstParentDirectoryThatExists(directory) { + let nextDirectory = directory; + for (;;) { + try { + await fs.access(nextDirectory, fsConstants.F_OK); + return nextDirectory; + } catch (error) { + if (error.code !== 'ENOENT') { + throw error; + } else if (nextDirectory === path.dirname(nextDirectory)) { + throw new Error('Failed to find parent directory that exists'); + } + nextDirectory = path.dirname(nextDirectory); + } + } +} + async function main() { const { argv } = yargs(hideBin(process.argv)).usage( '$0 [options]', diff --git a/test/e2e/fixtures/address-entry/state.json b/test/e2e/fixtures/address-entry/state.json index 1ce7f2d95f46..96b17cdb1d08 100644 --- a/test/e2e/fixtures/address-entry/state.json +++ b/test/e2e/fixtures/address-entry/state.json @@ -69,9 +69,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/connected-state/state.json b/test/e2e/fixtures/connected-state/state.json index 11af1d9b2b4b..4d48df472e21 100644 --- a/test/e2e/fixtures/connected-state/state.json +++ b/test/e2e/fixtures/connected-state/state.json @@ -59,9 +59,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/custom-rpc/state.json b/test/e2e/fixtures/custom-rpc/state.json index 02cc6d5f8eb0..222eb01592c9 100644 --- a/test/e2e/fixtures/custom-rpc/state.json +++ b/test/e2e/fixtures/custom-rpc/state.json @@ -55,9 +55,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/custom-token/state.json b/test/e2e/fixtures/custom-token/state.json index baf7c2984d35..ae1fcd1b49d3 100644 --- a/test/e2e/fixtures/custom-token/state.json +++ b/test/e2e/fixtures/custom-token/state.json @@ -73,9 +73,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/eip-1559-v2-dapp/state.json b/test/e2e/fixtures/eip-1559-v2-dapp/state.json index dc889b1e58e6..8394842404e5 100644 --- a/test/e2e/fixtures/eip-1559-v2-dapp/state.json +++ b/test/e2e/fixtures/eip-1559-v2-dapp/state.json @@ -56,9 +56,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/eip-1559-v2/state.json b/test/e2e/fixtures/eip-1559-v2/state.json index 6ac0aa7ad373..0c79d8c61405 100644 --- a/test/e2e/fixtures/eip-1559-v2/state.json +++ b/test/e2e/fixtures/eip-1559-v2/state.json @@ -56,9 +56,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/import-ui/state.json b/test/e2e/fixtures/import-ui/state.json index c5f3da0043f5..20c6bf87c4bc 100644 --- a/test/e2e/fixtures/import-ui/state.json +++ b/test/e2e/fixtures/import-ui/state.json @@ -110,9 +110,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/imported-account/state.json b/test/e2e/fixtures/imported-account/state.json index 7a79d293bf8d..cb5c96950091 100644 --- a/test/e2e/fixtures/imported-account/state.json +++ b/test/e2e/fixtures/imported-account/state.json @@ -55,9 +55,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/localization/state.json b/test/e2e/fixtures/localization/state.json index 45d09cf57ba3..4b32460b55d7 100644 --- a/test/e2e/fixtures/localization/state.json +++ b/test/e2e/fixtures/localization/state.json @@ -55,9 +55,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/metrics-enabled/state.json b/test/e2e/fixtures/metrics-enabled/state.json index 58c7c51090b9..43b345204263 100644 --- a/test/e2e/fixtures/metrics-enabled/state.json +++ b/test/e2e/fixtures/metrics-enabled/state.json @@ -59,9 +59,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/navigate-transactions/state.json b/test/e2e/fixtures/navigate-transactions/state.json index e5774eed663f..1613c7f5897f 100644 --- a/test/e2e/fixtures/navigate-transactions/state.json +++ b/test/e2e/fixtures/navigate-transactions/state.json @@ -55,9 +55,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/onboarding/state.json b/test/e2e/fixtures/onboarding/state.json index 06582c44332c..6a4c94b96946 100644 --- a/test/e2e/fixtures/onboarding/state.json +++ b/test/e2e/fixtures/onboarding/state.json @@ -30,9 +30,6 @@ "notifications": { "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/send-edit-v2/state.json b/test/e2e/fixtures/send-edit-v2/state.json index 90a8dc1d9c9a..9de073c00046 100644 --- a/test/e2e/fixtures/send-edit-v2/state.json +++ b/test/e2e/fixtures/send-edit-v2/state.json @@ -56,9 +56,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/send-edit/state.json b/test/e2e/fixtures/send-edit/state.json index 19dc61b39d14..1272fbd04c7c 100644 --- a/test/e2e/fixtures/send-edit/state.json +++ b/test/e2e/fixtures/send-edit/state.json @@ -56,9 +56,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/fixtures/special-settings/state.json b/test/e2e/fixtures/special-settings/state.json deleted file mode 100644 index 8b66b91559d4..000000000000 --- a/test/e2e/fixtures/special-settings/state.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "data": { - "AppStateController": { - "mkrMigrationReminderTimestamp": null - }, - "CachedBalancesController": { - "cachedBalances": { - "4": {} - } - }, - "CurrencyController": { - "conversionDate": 1575697244.188, - "conversionRate": 149.61, - "currentCurrency": "usd", - "nativeCurrency": "ETH" - }, - "IncomingTransactionsController": { - "incomingTransactions": {}, - "incomingTxLastFetchedBlocksByNetwork": { - "goerli": null, - "kovan": null, - "mainnet": null, - "rinkeby": 5570536 - } - }, - "KeyringController": { - "vault": "{\"data\":\"s6TpYjlUNsn7ifhEFTkuDGBUM1GyOlPrim7JSjtfIxgTt8/6MiXgiR/CtFfR4dWW2xhq85/NGIBYEeWrZThGdKGarBzeIqBfLFhw9n509jprzJ0zc2Rf+9HVFGLw+xxC4xPxgCS0IIWeAJQ+XtGcHmn0UZXriXm8Ja4kdlow6SWinB7sr/WM3R0+frYs4WgllkwggDf2/Tv6VHygvLnhtzp6hIJFyTjh+l/KnyJTyZW1TkZhDaNDzX3SCOHT\",\"iv\":\"FbeHDAW5afeWNORfNJBR0Q==\",\"salt\":\"TxZ+WbCW6891C9LK/hbMAoUsSEW1E8pyGLVBU6x5KR8=\"}" - }, - "NetworkController": { - "network": "1337", - "provider": { - "nickname": "Localhost 8545", - "rpcUrl": "http://localhost:8545", - "chainId": "0x539", - "ticker": "ETH", - "type": "rpc" - } - }, - "NotificationController": { - "notifications": { - "1": { - "isShown": true - }, - "3": { - "isShown": true - }, - "5": { - "isShown": true - }, - "6": { - "isShown": true - }, - "8": { - "isShown": true - }, - "12": { - "isShown": true - }, - "13": { - "isShown": true - } - } - }, - "OnboardingController": { - "onboardingTabs": {}, - "seedPhraseBackedUp": false - }, - "PermissionsMetadata": { - "domainMetadata": { - "metamask.github.io": { - "icon": null, - "name": "M E T A M A S K M E S H T E S T" - } - }, - "permissionsHistory": {}, - "permissionsLog": [ - { - "id": 746677923, - "method": "eth_accounts", - "methodType": "restricted", - "origin": "metamask.github.io", - "request": { - "id": 746677923, - "jsonrpc": "2.0", - "method": "eth_accounts", - "origin": "metamask.github.io", - "params": [] - }, - "requestTime": 1575697241368, - "response": { - "id": 746677923, - "jsonrpc": "2.0", - "result": [] - }, - "responseTime": 1575697241370, - "success": true - } - ] - }, - "PreferencesController": { - "accountTokens": { - "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "rinkeby": [], - "ropsten": [] - } - }, - "assetImages": {}, - "completedOnboarding": true, - "dismissSeedBackUpReminder": true, - "currentLocale": "en", - "featureFlags": { - "showIncomingTransactions": true, - "transactionTime": false, - "sendHexData": true - }, - "firstTimeFlowType": "create", - "forgottenPassword": false, - "frequentRpcListDetail": [], - "identities": { - "0x5cfe73b6021e818b776b421b1c4db2474086a7e1": { - "address": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1", - "name": "Account 1" - } - }, - "knownMethodData": {}, - "lostIdentities": {}, - "metaMetricsId": null, - "participateInMetaMetrics": false, - "preferences": { - "useNativeCurrencyAsPrimaryCurrency": true - }, - "selectedAddress": "0x5cfe73b6021e818b776b421b1c4db2474086a7e1", - "suggestedTokens": {}, - "tokens": [], - "useBlockie": false, - "useNonceField": false, - "usePhishDetect": true, - "useTokenDetection": true - }, - "config": {}, - "firstTimeInfo": { - "date": 1575697234195, - "version": "7.7.0" - } - }, - "meta": { - "version": 40 - } -} diff --git a/test/e2e/fixtures/threebox-enabled/state.json b/test/e2e/fixtures/threebox-enabled/state.json index 549ddb635242..78b6f1226a37 100644 --- a/test/e2e/fixtures/threebox-enabled/state.json +++ b/test/e2e/fixtures/threebox-enabled/state.json @@ -66,9 +66,6 @@ }, "12": { "isShown": true - }, - "13": { - "isShown": true } } }, diff --git a/test/e2e/helpers.js b/test/e2e/helpers.js index 6e1230a05916..8e13c4c6cca6 100644 --- a/test/e2e/helpers.js +++ b/test/e2e/helpers.js @@ -6,10 +6,8 @@ const enLocaleMessages = require('../../app/_locales/en/messages.json'); const { setupMocking } = require('./mock-e2e'); const Ganache = require('./ganache'); const FixtureServer = require('./fixture-server'); -const PhishingWarningPageServer = require('./phishing-warning-page-server'); const { buildWebDriver } = require('./webdriver'); const { ensureXServerIsRunning } = require('./x-server'); -const GanacheSeeder = require('./seeder/ganache-seeder'); const tinyDelayMs = 200; const regularDelayMs = tinyDelayMs * 2; @@ -24,13 +22,11 @@ async function withFixtures(options, testSuite) { dapp, fixtures, ganacheOptions, - smartContract, driverOptions, dappOptions, title, failOnConsoleError = true, dappPath = undefined, - dappPaths, testSpecificMock = function () { // do nothing. }, @@ -42,20 +38,11 @@ async function withFixtures(options, testSuite) { let secondaryGanacheServer; let numberOfDapps = dapp ? 1 : 0; const dappServer = []; - const phishingPageServer = new PhishingWarningPageServer(); let webDriver; let failed = false; try { await ganacheServer.start(ganacheOptions); - let contractRegistry; - - if (smartContract) { - const ganacheSeeder = new GanacheSeeder(true); - await ganacheSeeder.deploySmartContract(smartContract); - contractRegistry = ganacheSeeder.getContractRegistry(); - } - if (ganacheOptions?.concurrent) { const { port, chainId } = ganacheOptions.concurrent; secondaryGanacheServer = new Ganache(); @@ -68,15 +55,14 @@ async function withFixtures(options, testSuite) { } await fixtureServer.start(); await fixtureServer.loadState(path.join(__dirname, 'fixtures', fixtures)); - await phishingPageServer.start(); if (dapp) { if (dappOptions?.numberOfDapps) { numberOfDapps = dappOptions.numberOfDapps; } for (let i = 0; i < numberOfDapps; i++) { let dappDirectory; - if (dappPath || (dappPaths && dappPaths[i])) { - dappDirectory = path.resolve(__dirname, dappPath || dappPaths[i]); + if (dappPath) { + dappDirectory = path.resolve(__dirname, dappPath); } else { dappDirectory = path.resolve( __dirname, @@ -110,7 +96,6 @@ async function withFixtures(options, testSuite) { await testSuite({ driver, mockServer, - contractRegistry, }); if (process.env.SELENIUM_BROWSER === 'chrome') { @@ -161,9 +146,6 @@ async function withFixtures(options, testSuite) { } } } - if (phishingPageServer.isRunning()) { - await phishingPageServer.quit(); - } await mockServer.stop(); } } @@ -248,12 +230,12 @@ const completeImportSRPOnboardingFlow = async ( tag: 'button', }); - // clicks the "No thanks" option on the metametrics opt-in screen - await driver.clickElement('.btn-secondary'); - // clicks the "Import Wallet" option await driver.clickElement({ text: 'Import wallet', tag: 'button' }); + // clicks the "No thanks" option on the metametrics opt-in screen + await driver.clickElement('.btn-secondary'); + // Import Secret Recovery Phrase await driver.pasteIntoField( '[data-testid="import-srp__srp-word-0"]', @@ -290,12 +272,12 @@ const completeImportSRPOnboardingFlowWordByWord = async ( tag: 'button', }); - // clicks the "No thanks" option on the metametrics opt-in screen - await driver.clickElement('.btn-secondary'); - // clicks the "Import Wallet" option await driver.clickElement({ text: 'Import wallet', tag: 'button' }); + // clicks the "No thanks" option on the metametrics opt-in screen + await driver.clickElement('.btn-secondary'); + const words = seedPhrase.split(' '); for (const word of words) { await driver.pasteIntoField( diff --git a/test/e2e/lavamoat-stats.js b/test/e2e/lavamoat-stats.js deleted file mode 100644 index 4abf00a686b7..000000000000 --- a/test/e2e/lavamoat-stats.js +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env node - -/* eslint-disable node/shebang */ -const path = require('path'); -const { promises: fs, constants: fsConstants } = require('fs'); -const yargs = require('yargs/yargs'); -const { hideBin } = require('yargs/helpers'); -const { exitWithError } = require('../../development/lib/exit-with-error'); -const { withFixtures, tinyDelayMs } = require('./helpers'); - -async function measurePage() { - let metrics; - try { - await withFixtures({ fixtures: 'imported-account' }, async ({ driver }) => { - await driver.delay(tinyDelayMs); - await driver.navigate(); - await driver.findElement('#password'); - await driver.delay(1000); - const logs = await driver.checkBrowserForLavamoatLogs(); - - let logString = ''; - let inObject = false; - - const parsedLogs = []; - - logs.forEach((log) => { - if (log.indexOf('"version": 1') >= 0) { - logString += log; - parsedLogs.push(`{${logString}}`); - logString = ''; - inObject = false; - } else if (inObject) { - logString += log; - } else if ( - log.search(/"name": ".*app\/scripts\/background.js",/u) >= 0 || - log.search(/"name": ".*app\/scripts\/ui.js",/u) >= 0 - ) { - logString += log; - inObject = true; - } - }); - - metrics = parsedLogs.map((pl) => JSON.parse(pl)); - }); - } catch (error) { - // do nothing - } - return metrics; -} - -async function profilePageLoad() { - const results = await measurePage(); - const metrics = {}; - - metrics['background.js'] = results[0]; - metrics['ui.js'] = results[1]; - - return metrics; -} - -async function isWritable(directory) { - try { - await fs.access(directory, fsConstants.W_OK); - return true; - } catch (error) { - if (error.code !== 'EACCES') { - throw error; - } - return false; - } -} - -async function getFirstParentDirectoryThatExists(directory) { - let nextDirectory = directory; - for (;;) { - try { - await fs.access(nextDirectory, fsConstants.F_OK); - return nextDirectory; - } catch (error) { - if (error.code !== 'ENOENT') { - throw error; - } else if (nextDirectory === path.dirname(nextDirectory)) { - throw new Error('Failed to find parent directory that exists'); - } - nextDirectory = path.dirname(nextDirectory); - } - } -} - -async function main() { - const { argv } = yargs(hideBin(process.argv)).usage( - '$0 [options]', - 'Run a page load benchmark', - (_yargs) => - _yargs.option('out', { - description: - 'Output filename. Output printed to STDOUT of this is omitted.', - type: 'string', - normalize: true, - }), - ); - - const { out } = argv; - - let outputDirectory; - let existingParentDirectory; - if (out) { - outputDirectory = path.dirname(out); - existingParentDirectory = await getFirstParentDirectoryThatExists( - outputDirectory, - ); - if (!(await isWritable(existingParentDirectory))) { - throw new Error('Specified output file directory is not writable'); - } - } - - const results = await profilePageLoad(); - - if (out) { - if (outputDirectory !== existingParentDirectory) { - await fs.mkdir(outputDirectory, { recursive: true }); - } - - await fs.writeFile( - path.join(out, 'background.json'), - JSON.stringify(results['background.js'], null, 2), - ); - - await fs.writeFile( - path.join(out, 'ui.json'), - JSON.stringify(results['ui.js'], null, 2), - ); - } else { - console.log(JSON.stringify(results, null, 2)); - } -} - -main().catch((error) => { - exitWithError(error); -}); diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index 9e85bff8420d..854b597a09af 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -99,13 +99,13 @@ describe('MetaMask', function () { await driver.delay(largeDelayMs); }); - it('clicks the "No thanks" option on the metametrics opt-in screen', async function () { - await driver.clickElement('.btn-secondary'); + it('clicks the "Create New Wallet" option', async function () { + await driver.clickElement({ text: 'Create a Wallet', tag: 'button' }); await driver.delay(largeDelayMs); }); - it('clicks the "Create New Wallet" option', async function () { - await driver.clickElement({ text: 'Create a Wallet', tag: 'button' }); + it('clicks the "No thanks" option on the metametrics opt-in screen', async function () { + await driver.clickElement('.btn-secondary'); await driver.delay(largeDelayMs); }); diff --git a/test/e2e/mock-e2e.js b/test/e2e/mock-e2e.js index b4e6f595f191..a6d5d6518eac 100644 --- a/test/e2e/mock-e2e.js +++ b/test/e2e/mock-e2e.js @@ -25,28 +25,6 @@ async function setupMocking(server, testSpecificMock) { }; }); - await server - .forGet('https://www.4byte.directory/api/v1/signatures/') - .thenCallback(() => { - return { - statusCode: 200, - json: { - count: 1, - next: null, - previous: null, - results: [ - { - id: 1, - created_at: null, - text_signature: 'deposit()', - hex_signature: null, - bytes_signature: null, - }, - ], - }, - }; - }); - await server .forGet('https://gas-api.metaswap.codefi.network/networks/1/gasPrices') .thenCallback(() => { @@ -176,35 +154,6 @@ async function setupMocking(server, testSpecificMock) { }; }); - await server - .forGet('https://token-api.metaswap.codefi.network/token/0x539') - .thenCallback(() => { - return { - statusCode: 200, - json: {}, - }; - }); - - await server - .forGet( - 'https://static.metaswap.codefi.network/api/v1/tokenIcons/1337/0x0d8775f648430679a709e98d2b0cb6250d2887ef.png', - ) - .thenCallback(() => { - return { - statusCode: 200, - }; - }); - - await server - .forGet( - 'https://static.metaswap.codefi.network/api/v1/tokenIcons/1337/0x2efa2cb29c2341d8e5ba7d3262c9e9d6f1bf3711.png', - ) - .thenCallback(() => { - return { - statusCode: 200, - }; - }); - testSpecificMock(server); } diff --git a/test/e2e/mock-page-with-disallowed-iframe/index.html b/test/e2e/mock-page-with-disallowed-iframe/index.html deleted file mode 100644 index ffadeeefa819..000000000000 --- a/test/e2e/mock-page-with-disallowed-iframe/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - Mock E2E Phishing Page - - - -
Hello
-