1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Merge branch 'develop' into master-sync

This commit is contained in:
Dan J Miller 2023-07-18 10:03:05 -02:30
commit c028603257
555 changed files with 9335 additions and 4893 deletions

View File

@ -353,18 +353,15 @@ jobs:
echo "Not a PR; skipping"
fi
- run:
name: Setup registry config for using package previews on draft PRs
name: Install dependencies
command: |
if [[ $IS_DRAFT == 'true' ]]
then
printf '%s\n\n%s' '@metamask:registry=https://npm.pkg.github.com' "//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGE_READ_TOKEN}" > .npmrc
# Use GitHub registry on draft PRs, allowing the use of preview builds
METAMASK_NPM_REGISTRY=https://npm.pkg.github.com yarn --immutable
else
echo "Not draft; skipping GitHub registry setup"
yarn --immutable
fi
- run:
name: Install deps
command: |
.circleci/scripts/deps-install.sh
- save_cache:
key: dependency-cache-v1-{{ checksum "yarn.lock" }}
paths:

View File

@ -1,9 +0,0 @@
#!/usr/bin/env bash
# Print commands and their arguments as they are executed.
set -x
# Exit immediately if a command exits with a non-zero status.
set -e
yarn install --frozen-lockfile

28
.github/workflows/stale-issues-pr.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '0 12 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@72afbce2b0dbd1d903bb142cebe2d15dc307ae57
with:
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days. Thank you for your contributions.'
stale-issue-label: 'stale'
only-issue-labels: 'type-bug'
exempt-issue-labels: 'type-security, type-pinned, feature-request, awaiting-metamask'
stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions.'
stale-pr-label: 'stale'
exempt-pr-labels: 'work-in-progress'
close-issue-message: 'This issue was closed because there has been no follow up activity in the last 7 days. If you feel this was closed in error, please reopen and provide evidence on the latest release of the extension. Thank you for your contributions.'
close-pr-message: 'This PR was closed because there has been no follow up activity in the last 7 days. Thank you for your contributions.'
days-before-issue-stale: 90
days-before-pr-stale: 60
days-before-issue-close: 45
days-before-pr-close: 14
operations-per-run: 1

View File

@ -48,6 +48,8 @@ jobs:
needs: is-fork-pull-request
# Early exit if this is a fork, since later steps are skipped for forks
if: ${{ needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
outputs:
COMMIT_SHA: ${{ steps.commit-sha.outputs.COMMIT_SHA }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
@ -63,6 +65,9 @@ jobs:
cache: 'yarn'
- name: Install Yarn dependencies
run: yarn --immutable
- name: Get commit SHA
id: commit-sha
run: echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
update-lavamoat-build-policy:
name: Update LavaMoat build policy
@ -90,7 +95,7 @@ jobs:
uses: actions/cache/save@v3
with:
path: lavamoat/build-system
key: cache-build-${{ github.run_id }}-${{ github.run_attempt }}
key: cache-build-${{ needs.prepare.outputs.COMMIT_SHA }}
update-lavamoat-webapp-policy:
strategy:
@ -125,12 +130,13 @@ jobs:
uses: actions/cache/save@v3
with:
path: lavamoat/browserify/${{ matrix.build-type }}
key: cache-${{ matrix.build-type }}-${{ github.run_id }}-${{ github.run_attempt }}
key: cache-${{ matrix.build-type }}-${{ needs.prepare.outputs.COMMIT_SHA }}
commit-updated-policies:
name: Commit the updated LavaMoat policies
runs-on: ubuntu-latest
needs:
- prepare
- is-fork-pull-request
- update-lavamoat-build-policy
- update-lavamoat-webapp-policy
@ -147,11 +153,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.LAVAMOAT_UPDATE_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
- name: Get commit SHA
id: commit-sha
run: echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Restore build policy
uses: actions/cache/restore@v3
with:
path: lavamoat/build-system
key: cache-build-${{ github.run_id }}-${{ github.run_attempt }}
key: cache-build-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
# One restore step per build type: [main, beta, flask, mmi, desktop]
# Ensure this is synchronized with the list above in the "update-lavamoat-webapp-policy" job
@ -160,31 +169,31 @@ jobs:
uses: actions/cache/restore@v3
with:
path: lavamoat/browserify/main
key: cache-main-${{ github.run_id }}-${{ github.run_attempt }}
key: cache-main-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Restore beta application policy
uses: actions/cache/restore@v3
with:
path: lavamoat/browserify/beta
key: cache-beta-${{ github.run_id }}-${{ github.run_attempt }}
key: cache-beta-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Restore flask application policy
uses: actions/cache/restore@v3
with:
path: lavamoat/browserify/flask
key: cache-flask-${{ github.run_id }}-${{ github.run_attempt }}
key: cache-flask-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Restore mmi application policy
uses: actions/cache/restore@v3
with:
path: lavamoat/browserify/mmi
key: cache-mmi-${{ github.run_id }}-${{ github.run_attempt }}
key: cache-mmi-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Restore desktop application policy
uses: actions/cache/restore@v3
with:
path: lavamoat/browserify/desktop
key: cache-desktop-${{ github.run_id }}-${{ github.run_attempt }}
key: cache-desktop-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Check whether there are policy changes
id: policy-changes
@ -214,3 +223,37 @@ jobs:
HAS_CHANGES: ${{ steps.policy-changes.outputs.HAS_CHANGES }}
GITHUB_TOKEN: ${{ secrets.LAVAMOAT_UPDATE_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
check-status:
name: Check whether the policy update succeeded
runs-on: ubuntu-latest
needs:
- commit-updated-policies
outputs:
PASSED: ${{ steps.set-output.outputs.PASSED }}
steps:
- name: Set PASSED output
id: set-output
run: echo "PASSED=true" >> "$GITHUB_OUTPUT"
failure-comment:
name: Comment about the policy update failure
if: ${{ always() && needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
runs-on: ubuntu-latest
needs:
- is-fork-pull-request
- check-status
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.LAVAMOAT_UPDATE_TOKEN }}
- name: Post comment if the update failed
run: |
passed="${{ needs.check-status.outputs.PASSED }}"
if [[ $passed != "true" ]]; then
gh pr comment "${PR_NUMBER}" --body "Policy update failed. You can [review the logs or retry the policy update here](${ACTION_RUN_URL})"
fi
env:
GITHUB_TOKEN: ${{ secrets.LAVAMOAT_UPDATE_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
ACTION_RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

4
.iyarc
View File

@ -9,3 +9,7 @@ GHSA-p8p7-x288-28g6
# Not easily patched
# Minimal risk to us because we're using lockdown which also prevents this case of prototype pollution
GHSA-h755-8qp9-cq85
# tough-cookie
# this will go away soon when we get rid of web3-provider-engine
GHSA-72xf-g2v4-qvf3

View File

@ -50,7 +50,13 @@ Theme colors are color agnostic, semantically neutral and theme compatible desig
```css
/** Backgrounds */
var(--color-background-default)
var(--color-background-default-hover)
var(--color-background-default-pressed)
var(--color-background-alternative)
var(--color-background-alternative-hover)
var(--color-background-alternative-pressed)
var(--color-background-hover)
var(--color-background-pressed)
/** Text */
var(--color-text-default)

View File

@ -0,0 +1,80 @@
diff --git a/lib/jsdom/browser/Window.js b/lib/jsdom/browser/Window.js
index 9b2d75f55050f865382e2f0e8a88f066e0bff2da..d4a635da8eae02eaf0543693356f1252f8b6bac0 100644
--- a/lib/jsdom/browser/Window.js
+++ b/lib/jsdom/browser/Window.js
@@ -24,7 +24,6 @@ const External = require("../living/generated/External");
const Navigator = require("../living/generated/Navigator");
const Performance = require("../living/generated/Performance");
const Screen = require("../living/generated/Screen");
-const Storage = require("../living/generated/Storage");
const Selection = require("../living/generated/Selection");
const reportException = require("../living/helpers/runtime-script-errors");
const { getCurrentEventHandlerValue } = require("../living/helpers/create-event-accessor.js");
@@ -285,40 +284,6 @@ function Window(options) {
this._pretendToBeVisual = options.pretendToBeVisual;
this._storageQuota = options.storageQuota;
- // Some properties (such as localStorage and sessionStorage) share data
- // between windows in the same origin. This object is intended
- // to contain such data.
- if (options.commonForOrigin && options.commonForOrigin[documentOrigin]) {
- this._commonForOrigin = options.commonForOrigin;
- } else {
- this._commonForOrigin = {
- [documentOrigin]: {
- localStorageArea: new Map(),
- sessionStorageArea: new Map(),
- windowsInSameOrigin: [this]
- }
- };
- }
-
- this._currentOriginData = this._commonForOrigin[documentOrigin];
-
- // ### WEB STORAGE
-
- this._localStorage = Storage.create(window, [], {
- associatedWindow: this,
- storageArea: this._currentOriginData.localStorageArea,
- type: "localStorage",
- url: this._document.documentURI,
- storageQuota: this._storageQuota
- });
- this._sessionStorage = Storage.create(window, [], {
- associatedWindow: this,
- storageArea: this._currentOriginData.sessionStorageArea,
- type: "sessionStorage",
- url: this._document.documentURI,
- storageQuota: this._storageQuota
- });
-
// ### SELECTION
// https://w3c.github.io/selection-api/#dfn-selection
@@ -416,26 +381,6 @@ function Window(options) {
configurable: true
});
},
- get localStorage() {
- if (idlUtils.implForWrapper(this._document)._origin === "null") {
- throw DOMException.create(window, [
- "localStorage is not available for opaque origins",
- "SecurityError"
- ]);
- }
-
- return this._localStorage;
- },
- get sessionStorage() {
- if (idlUtils.implForWrapper(this._document)._origin === "null") {
- throw DOMException.create(window, [
- "sessionStorage is not available for opaque origins",
- "SecurityError"
- ]);
- }
-
- return this._sessionStorage;
- },
get customElements() {
return customElementRegistry;
},

View File

@ -0,0 +1,18 @@
diff --git a/src/loadPolicy.js b/src/loadPolicy.js
index ef71923f9282d6a5e9f74e6ec6fa0516f28f508b..0118fda7e1b0fa461ec01ceff8d7112d072f3dfb 100644
--- a/src/loadPolicy.js
+++ b/src/loadPolicy.js
@@ -33,10 +33,9 @@ async function loadPolicyAndApplyOverrides({ debugMode, policyPath, policyOverri
}
const policyOverride = await readPolicyFile({ debugMode, policyPath: policyOverridePath })
lavamoatPolicy = mergePolicy(policy, policyOverride)
- // TODO: Only write if merge results in changes.
- // Would have to make a deep equal check on whole policy, which is a waste of time.
- // mergePolicy() should be able to do it in one pass.
- fs.writeFileSync(policyPath, jsonStringify(lavamoatPolicy, { space: 2 }))
+ // Skip policy write step to prevent intermittent build failures
+ // The extension validates the policy in a separate step, we don't need it
+ // to be written to disk here.
}
return lavamoatPolicy
}

View File

@ -1,8 +1,8 @@
diff --git a/dist/index.d.ts b/dist/index.d.ts
index 81253d38280bb25de1e36443d919f0e95b3e023c..d2333bf6796ff3ec94f5857d23ef34cc39c9729a 100644
index 66eb3236059f88f73355d4fddef9e06a0169b407..04f067d2bda8af760c0a95ca6b5d85bcdfb2421a 100644
--- a/dist/index.d.ts
+++ b/dist/index.d.ts
@@ -1,10 +1,10 @@
@@ -1,11 +1,12 @@
-import { type ParserOptions } from './parser/index.js';
+import { ParserOptions } from './parser/index.js';
import type { DefaultTreeAdapterMap } from './tree-adapters/default.js';
@ -12,12 +12,15 @@ index 81253d38280bb25de1e36443d919f0e95b3e023c..d2333bf6796ff3ec94f5857d23ef34cc
export type { TreeAdapter, TreeAdapterTypeMap } from './tree-adapters/interface.js';
-export { type ParserOptions, /** @internal */ Parser } from './parser/index.js';
-export { serialize, serializeOuter, type SerializerOptions } from './serializer/index.js';
-export { ERR as ErrorCodes, type ParserError } from './common/error-codes.js';
+export { ParserOptions, /** @internal */ Parser } from './parser/index.js';
+export { serialize, serializeOuter, SerializerOptions } from './serializer/index.js';
export type { ParserError } from './common/error-codes.js';
+export type { ParserError } from './common/error-codes.js';
+export { ERR as ErrorCodes } from './common/error-codes.js';
/** @internal */
export * as foreignContent from './common/foreign-content.js';
@@ -13,7 +13,7 @@ export * as html from './common/html.js';
/** @internal */
@@ -13,7 +14,7 @@ export * as html from './common/html.js';
/** @internal */
export * as Token from './common/token.js';
/** @internal */
@ -27,7 +30,7 @@ index 81253d38280bb25de1e36443d919f0e95b3e023c..d2333bf6796ff3ec94f5857d23ef34cc
* Parses an HTML string.
*
diff --git a/dist/parser/index.d.ts b/dist/parser/index.d.ts
index 50a9bd0c73649e4a78edd0d18b4ee44ae9cdf3b7..df1863e335e64269298dea42a7481b26b9e77581 100644
index 50a9bd0c73649e4a78edd0d18b4ee44ae9cdf3b7..85cc630db81d7a4ebd01691223d81187cdd8adcb 100644
--- a/dist/parser/index.d.ts
+++ b/dist/parser/index.d.ts
@@ -1,10 +1,10 @@
@ -46,18 +49,18 @@ index 50a9bd0c73649e4a78edd0d18b4ee44ae9cdf3b7..df1863e335e64269298dea42a7481b26
INITIAL = 0,
BEFORE_HTML = 1,
diff --git a/dist/serializer/index.d.ts b/dist/serializer/index.d.ts
index d944fae103a245cb84623fd733c91cc7e79f72f1..432464c9e05ecfd93c66526bcf4f0c81f09bf00d 100644
index bf759e63ba1be31a2ab14884fcfd6bd3e8ecd2d7..839e21e45dc13e678c9874c51524a8ed1a463591 100644
--- a/dist/serializer/index.d.ts
+++ b/dist/serializer/index.d.ts
@@ -1,5 +1,5 @@
import type { TreeAdapter, TreeAdapterTypeMap } from '../tree-adapters/interface';
import type { TreeAdapter, TreeAdapterTypeMap } from '../tree-adapters/interface.js';
-import { type DefaultTreeAdapterMap } from '../tree-adapters/default.js';
+import { DefaultTreeAdapterMap } from '../tree-adapters/default.js';
export interface SerializerOptions<T extends TreeAdapterTypeMap> {
/**
* Specifies input tree format.
diff --git a/dist/tokenizer/index.d.ts b/dist/tokenizer/index.d.ts
index de6e234cfb36bb3a4b928c47ab0d0fdf0b4311e1..89e2484b43f3487f3f157435a283ba932a879210 100644
index 5afab96d6499bb0bba706aee7d2f153647db8713..3680d732d8a3570b6a1d9336c0ebdf8fe4f392db 100644
--- a/dist/tokenizer/index.d.ts
+++ b/dist/tokenizer/index.d.ts
@@ -1,6 +1,6 @@
@ -69,8 +72,18 @@ index de6e234cfb36bb3a4b928c47ab0d0fdf0b4311e1..89e2484b43f3487f3f157435a283ba93
declare const enum State {
DATA = 0,
RCDATA = 1,
diff --git a/dist/tree-adapters/default.d.ts b/dist/tree-adapters/default.d.ts
index 547d714bdc5a664ba1414c16bdfc9247c71ab4de..d96a23d6ce3e80d78da21d958c059de194bb5146 100644
--- a/dist/tree-adapters/default.d.ts
+++ b/dist/tree-adapters/default.d.ts
@@ -1,4 +1,4 @@
-import { DOCUMENT_MODE, type NS } from '../common/html.js';
+import { DOCUMENT_MODE, NS } from '../common/html.js';
import type { Attribute, Location, ElementLocation } from '../common/token.js';
import type { TreeAdapter, TreeAdapterTypeMap } from './interface.js';
export interface Document {
diff --git a/dist/tokenizer/preprocessor.d.ts b/dist/tokenizer/preprocessor.d.ts
index e74a590783b4688fb6498b019c1a75cfd9ac23e7..d145dcce97b104830e5b3d7f57f3a63377bbf89c 100644
index e74a590783b4688fb6498b019c1a75cfd9ac23e7..7350e44b4ed952bcb8f167e30a94958e9fcf743a 100644
--- a/dist/tokenizer/preprocessor.d.ts
+++ b/dist/tokenizer/preprocessor.d.ts
@@ -1,4 +1,4 @@
@ -79,13 +92,3 @@ index e74a590783b4688fb6498b019c1a75cfd9ac23e7..d145dcce97b104830e5b3d7f57f3a633
export declare class Preprocessor {
private handler;
html: string;
diff --git a/dist/tree-adapters/default.d.ts b/dist/tree-adapters/default.d.ts
index cccdf8f86d2295b3059c42943d896e81691c8419..d70b8fa2562f4dc6415d7ebaaba6cb322f66e9cb 100644
--- a/dist/tree-adapters/default.d.ts
+++ b/dist/tree-adapters/default.d.ts
@@ -1,4 +1,4 @@
-import { DOCUMENT_MODE, type NS } from '../common/html.js';
+import { DOCUMENT_MODE, NS } from '../common/html.js';
import type { Attribute, Location, ElementLocation } from '../common/token.js';
import type { TreeAdapter, TreeAdapterTypeMap } from './interface.js';
export declare enum NodeType {

View File

@ -8,6 +8,15 @@ logFilters:
nodeLinker: node-modules
npmRegistries:
"https://npm.pkg.github.com":
npmAlwaysAuth: true
npmAuthToken: "${GITHUB_PACKAGE_READ_TOKEN-}"
npmScopes:
metamask:
npmRegistryServer: "${METAMASK_NPM_REGISTRY:-https://registry.yarnpkg.com}"
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs
spec: "https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js"

View File

@ -545,9 +545,6 @@
"privateNetwork": {
"message": "የግል አውታረ መረብ"
},
"queue": {
"message": "ወረፋ"
},
"readdToken": {
"message": "በመለያ አማራጮችዎ ምናሌ ውስጥ ወደ “ተለዋጭ ስም አክል” በመግባት ለወደፊቱ ይህን ተለዋጭ ስም መልሰው ማከል ይችላሉ።"
},

View File

@ -557,9 +557,6 @@
"privateNetwork": {
"message": "شبكة خاصة"
},
"queue": {
"message": "اللائحة"
},
"readdToken": {
"message": "يمكنك إضافة هذه العملة الرمزية مرة أخرى في المستقبل من خلال الانتقال إلى \"إضافة عملة رمزية\" في قائمة خيارات الحسابات الخاصة بك."
},

View File

@ -556,9 +556,6 @@
"privateNetwork": {
"message": "Частна мрежа"
},
"queue": {
"message": "Опашка"
},
"readdToken": {
"message": "Можете да добавите този жетон в бъдеще, като отидете на „Добавяне на жетон“ в менюто с опции на акаунти."
},

View File

@ -554,9 +554,6 @@
"privateNetwork": {
"message": "ব্যক্তিগত নেটওয়ার্ক"
},
"queue": {
"message": "অপেক্ষমাণ"
},
"readdToken": {
"message": "আপনি আপনার অ্যাকাউন্টস বিকল্পের মেনুতে \"টোকেনগুলি যোগ করুন\" এ গিয়ে ভবিষ্যতে আবার এই টোকেনটি যোগ করতে পারবেন। "
},

View File

@ -541,9 +541,6 @@
"privateNetwork": {
"message": "Xarxa privada"
},
"queue": {
"message": "Cua"
},
"readdToken": {
"message": "Pots tornar a afegir aquesta fitxa en el futur anant a \"Afegir fitxa\" al menu d'opcions dels teus comptes."
},

View File

@ -541,9 +541,6 @@
"privateNetwork": {
"message": "Privat netværk"
},
"queue": {
"message": "Kø"
},
"readdToken": {
"message": "Du kan tilføje denne token i fremtiden, ved at gå til \"Tilføj token\" under dine valgmenuen for dine konti."
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "Öffentliche Adresse"
},
"queue": {
"message": "Warteschlange"
},
"queued": {
"message": "In Warteschlange"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "Seed-Phrase anzeigen"
},
"reviewSpendingCap": {
"message": "Überprüfen SIe Ihre Ausgabegrenze"
},
"revokeAllTokensTitle": {
"message": "Erlaubnis zum Zugriff auf alle Ihre $1 sowie deren Übertragung entziehen?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "$1 ohne Ausgabenlimit genehmigen",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "Eine Ausgabegrenze für Ihr $1 einrichten",
"description": "$1 is a token symbol"
},
"settings": {
"message": "Einstellungen"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "Diese URL wird derzeit vom $1-Netzwerk verwendet."
},
"useDefault": {
"message": "Standardeinstellungen verwenden"
},
"useMultiAccountBalanceChecker": {
"message": "Kontoguthaben-Anfragen sammeln"
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "Δημόσια Διεύθυνση"
},
"queue": {
"message": "Ουρά"
},
"queued": {
"message": "Σε Αναμονή"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "Αποκάλυψη φράσης ανάκτησης"
},
"reviewSpendingCap": {
"message": "Επανεξετάστε το όριο δαπανών σας"
},
"revokeAllTokensTitle": {
"message": "Ανάκληση άδειας πρόσβασης σε όλα σας τα $1;",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3137,10 +3131,6 @@
"message": "Έγκριση $1 χωρίς όριο δαπανών",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "Ορίστε ένα ανώτατο όριο δαπανών για το $1",
"description": "$1 is a token symbol"
},
"settings": {
"message": "Ρυθμίσεις"
},
@ -4164,9 +4154,6 @@
"urlExistsErrorMsg": {
"message": "Αυτό το URL χρησιμοποιείται επί του παρόντος από το δίκτυο $1."
},
"useDefault": {
"message": "Χρήση προκαθορισμένου"
},
"useMultiAccountBalanceChecker": {
"message": "Μαζικά αιτήματα υπολοίπου λογαριασμού"
},

View File

@ -249,6 +249,9 @@
"addFromAListOfPopularNetworks": {
"message": "Add from a list of popular networks or add a network manually. Only interact with the entities you trust."
},
"addHardwareWallet": {
"message": "Add hardware wallet"
},
"addMemo": {
"message": "Add memo"
},
@ -366,6 +369,9 @@
"allowThisSiteTo": {
"message": "Allow this site to:"
},
"allowThisSnapTo": {
"message": "Allow this snap to:"
},
"allowWithdrawAndSpend": {
"message": "Allow $1 to withdraw and spend up to the following amount:",
"description": "The url of the site that requested permission to 'withdraw and spend'"
@ -525,6 +531,9 @@
"message": "This is a beta version. Please report bugs $1",
"description": "$1 represents the word 'here' in a hyperlink"
},
"betaMetamaskInstitutionalVersion": {
"message": "MetaMask Institutional Beta Version"
},
"betaMetamaskVersion": {
"message": "MetaMask Beta Version"
},
@ -979,6 +988,12 @@
"custodianAccount": {
"message": "Custodian account"
},
"custodianAccountAddedDesc": {
"message": "You can now use your custodian accounts in MetaMask Institutional."
},
"custodianAccountAddedTitle": {
"message": "Selected custodian accounts have been added."
},
"custodianReplaceRefreshTokenChangedFailed": {
"message": "Please go to $1 and click the 'Connect to MMI' button within their user interface to connect your accounts to MMI again."
},
@ -1052,6 +1067,9 @@
"customerSupport": {
"message": "customer support"
},
"dappRequestedSpendingCap": {
"message": "Site requested spending cap"
},
"dappSuggested": {
"message": "Site suggested"
},
@ -1743,9 +1761,6 @@
"hardware": {
"message": "Hardware"
},
"hardwareWallet": {
"message": "Hardware wallet"
},
"hardwareWalletConnected": {
"message": "Hardware wallet connected"
},
@ -2256,6 +2271,9 @@
"metaMaskConnectStatusParagraphTwo": {
"message": "The connection status button shows if the website youre visiting is connected to your currently selected account."
},
"metamaskInstitutionalVersion": {
"message": "MetaMask Institutional Version"
},
"metamaskSwapsOfflineDescription": {
"message": "MetaMask Swaps is undergoing maintenance. Please check back later."
},
@ -2300,6 +2318,9 @@
"mmiAuthenticate": {
"message": "The page at $1 would like to authorise the following projects compliance settings in MetaMask Institutional"
},
"mmiBuiltAroundTheWorld": {
"message": "MetaMask Institutional is designed and built around the world."
},
"more": {
"message": "more"
},
@ -3065,9 +3086,6 @@
"message": "You have (1) pending transaction.",
"description": "$1 is count of pending transactions"
},
"percentage": {
"message": "$1%"
},
"permissionRequest": {
"message": "Permission request"
},
@ -3323,9 +3341,6 @@
"publicAddress": {
"message": "Public address"
},
"queue": {
"message": "Queue"
},
"queued": {
"message": "Queued"
},
@ -3498,6 +3513,18 @@
"restoreUserDataDescription": {
"message": "You can restore user settings containing preferences and account addresses from a previously backed up JSON file."
},
"resultPageError": {
"message": "Error"
},
"resultPageErrorDefaultMessage": {
"message": "The operation failed."
},
"resultPageSuccess": {
"message": "Success"
},
"resultPageSuccessDefaultMessage": {
"message": "The operation completed successfully."
},
"retryTransaction": {
"message": "Retry transaction"
},
@ -3541,9 +3568,6 @@
"revealTheSeedPhrase": {
"message": "Reveal seed phrase"
},
"reviewSpendingCap": {
"message": "Review the spending cap for your"
},
"revokeAllTokensTitle": {
"message": "Revoke permission to access and transfer all of your $1?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3560,6 +3584,9 @@
"message": "This revokes the permission for a third party to access and transfer all of your NFTs from $1 without further notice.",
"description": "$1 is a link to contract on the block explorer when we're not able to retrieve a erc721 or erc1155 name"
},
"revokePermission": {
"message": "Revoke permission"
},
"revokeSpendingCap": {
"message": "Revoke spending cap for your $1",
"description": "$1 is a token symbol"
@ -3681,6 +3708,9 @@
"selectAccounts": {
"message": "Select the account(s) to use on this site"
},
"selectAccountsForSnap": {
"message": "Select the account(s) to use with this snap"
},
"selectAll": {
"message": "Select all"
},
@ -3757,10 +3787,6 @@
"message": "Approve $1 with no spend limit",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "Set a spending cap for your $1",
"description": "$1 is a token symbol"
},
"settingAddSnapAccount": {
"message": "Add snap account"
},
@ -3770,10 +3796,6 @@
"settingsSearchMatchingNotFound": {
"message": "No matching results found."
},
"shortVersion": {
"message": "v$1",
"description": "$1 is the version number to show"
},
"show": {
"message": "Show"
},
@ -4087,6 +4109,9 @@
"message": "Only enter a number that you're comfortable with $1 accessing now or in the future. You can always increase the token limit later.",
"description": "$1 is origin of the site requesting the token limit"
},
"spendingCapRequest": {
"message": "Spending cap request for your $1"
},
"srpInputNumberOfWords": {
"message": "I have a $1-word phrase",
"description": "This is the text for each option in the dropdown where a user selects how many words their secret recovery phrase has during import. The $1 is the number of words (either 12, 15, 18, 21, or 24)."
@ -4438,6 +4463,10 @@
"message": "Includes a $1% MetaMask fee.",
"description": "Provides information about the fee that metamask takes for swaps. $1 is a decimal number."
},
"swapIncludesMetaMaskFeeViewAllQuotes": {
"message": "Includes a $1% MetaMask fee $2",
"description": "Provides information about the fee that metamask takes for swaps. $1 is a decimal number and $2 is a link to view all quotes."
},
"swapLearnMore": {
"message": "Learn more about Swaps"
},
@ -5136,9 +5165,6 @@
"urlExistsErrorMsg": {
"message": "This URL is currently used by the $1 network."
},
"useDefault": {
"message": "Use default"
},
"useMultiAccountBalanceChecker": {
"message": "Batch account balance requests"
},
@ -5169,6 +5195,9 @@
"usePhishingDetectionDescription": {
"message": "Display a warning for phishing domains targeting Ethereum users"
},
"useSiteSuggestion": {
"message": "Use site suggestion"
},
"useTokenDetectionPrivacyDesc": {
"message": "Automatically displaying tokens sent to your account involves communication with third party servers to fetch tokens images. Those serves will have access to your IP address."
},
@ -5202,6 +5231,9 @@
"viewAllDetails": {
"message": "View all details"
},
"viewAllQuotes": {
"message": "view all quotes"
},
"viewContact": {
"message": "View contact"
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "Dirección pública"
},
"queue": {
"message": "Cola"
},
"queued": {
"message": "En cola"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "Revelar frase semilla"
},
"reviewSpendingCap": {
"message": "Revise su límite de gasto"
},
"revokeAllTokensTitle": {
"message": "¿Revocar el permiso para acceder y transferir todos sus $1?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "Aprobar $1 sin límite preestablecido",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "Establecer un límite de gasto para su $1",
"description": "$1 is a token symbol"
},
"settings": {
"message": "Configuración"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "En este momento, la red $1 está utilizando esta dirección URL."
},
"useDefault": {
"message": "Uso por defecto"
},
"useMultiAccountBalanceChecker": {
"message": "Solicitudes de saldo de cuenta por lotes"
},

View File

@ -1767,9 +1767,6 @@
"publicAddress": {
"message": "Dirección pública"
},
"queue": {
"message": "Cola"
},
"queued": {
"message": "En cola"
},

View File

@ -550,9 +550,6 @@
"privateNetwork": {
"message": "Privaatvõrk"
},
"queue": {
"message": "Järjekord"
},
"readdToken": {
"message": "Saate selle loa tulevikus tagasi lisada, kui lähete oma kontovalikute menüüs vahelehele „Lisa luba“."
},

View File

@ -560,9 +560,6 @@
"privateNetwork": {
"message": "شبکه شخصی"
},
"queue": {
"message": "صف"
},
"readdToken": {
"message": "شما میتوانید این رمزیاب را دوباره برای آینده با رفتن به گزینه \"Add token\" در مینوی تنظیمات حساب ها، اضافه نمایید."
},

View File

@ -557,9 +557,6 @@
"privateNetwork": {
"message": "Yksityinen verkko"
},
"queue": {
"message": "Jono"
},
"readdToken": {
"message": "Voit lisätä tämän tietueen myöhemmin takaisin siirtymällä tilisi vaihtoehtovalikon kohtaan ”Lisää tietue”."
},

View File

@ -484,9 +484,6 @@
"privateNetwork": {
"message": "Pribadong Network"
},
"queue": {
"message": "I-queue"
},
"readdToken": {
"message": "Puwede mong idagdag ulit ang token na ito sa hinaharap sa pamamagitan ng pagpunta sa “Magdagdag ng token” sa menu ng mga opsyon ng iyong mga accounts."
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "Adresse publique"
},
"queue": {
"message": "File dattente"
},
"queued": {
"message": "En attente"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "Révéler la phrase mnémonique"
},
"reviewSpendingCap": {
"message": "Modifiez votre plafond de dépenses"
},
"revokeAllTokensTitle": {
"message": "Révoquer lautorisation daccès et de transfert de tous vos $1 ?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "Approuver $1 sans limite de dépenses",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "Fixez un plafond de dépenses pour vos $1",
"description": "$1 is a token symbol"
},
"settings": {
"message": "Paramètres"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "Cette URL est actuellement utilisée par le réseau $1."
},
"useDefault": {
"message": "Utiliser par défaut"
},
"useMultiAccountBalanceChecker": {
"message": "Demandes dinformations concernant le solde de plusieurs comptes"
},

View File

@ -103,9 +103,6 @@
"password": {
"message": "પાસવર્ડ"
},
"queue": {
"message": "કતારમાં"
},
"reject": {
"message": "નકારો"
},

View File

@ -557,9 +557,6 @@
"privateNetwork": {
"message": "רשת פרטית"
},
"queue": {
"message": "תור"
},
"readdToken": {
"message": "באפשרותך להוסיף טוקן זה בחזרה בעתיד על ידי מעבר אל \"הוסף טוקן\" בתפריט אפשרויות החשבונות שלך."
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "सार्वजनिक पता"
},
"queue": {
"message": "कतार"
},
"queued": {
"message": "कतारबद्ध"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "सीड फ़्रेज़ दिखाएं"
},
"reviewSpendingCap": {
"message": "अपनी खर्च के सीमा की समीक्षा करें"
},
"revokeAllTokensTitle": {
"message": "आपके सभी $1 को एक्सेस और स्थानांतरित करने की अनुमति निरस्त करें?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "बिना किसी खर्च सीमा के $1 स्वीकृत करें",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "अपने $1 के लिए खर्च की सीमा को निर्धारित करें",
"description": "$1 is a token symbol"
},
"settings": {
"message": "सेटिंग"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "यह URL वर्तमान में $1 नेटवर्क द्वारा उपयोग किया जाता है।"
},
"useDefault": {
"message": "डिफॉल्ट का उपयोग करें"
},
"useMultiAccountBalanceChecker": {
"message": "खाता के शेष राशि के अनुरोधों को बैच करें"
},

View File

@ -553,9 +553,6 @@
"privateNetwork": {
"message": "Privatna mreža"
},
"queue": {
"message": "Red čekanja"
},
"readdToken": {
"message": "Ovaj token možete dodati kasnije odlaskom pod stavku „Dodaj token” u izborniku mogućnosti računa. "
},

View File

@ -553,9 +553,6 @@
"privateNetwork": {
"message": "Magánhálózat"
},
"queue": {
"message": "Nyomtatólista"
},
"readdToken": {
"message": "Ezt a tokent a jövőben is hozzáadhatja, ha a fiókbeállítások menü „Token hozzáadása” elemére lép."
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "Alamat publik"
},
"queue": {
"message": "Antrean"
},
"queued": {
"message": "Antrean"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "Ungkap frasa seed"
},
"reviewSpendingCap": {
"message": "Tinjau batas pengeluaran Anda"
},
"revokeAllTokensTitle": {
"message": "Cabut izin untuk mengakses dan mentransfer seluruh $1 Anda?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "Setujui $1 tanpa batas penggunaan",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "Tetapkan batas pengeluaran untuk $1",
"description": "$1 is a token symbol"
},
"settings": {
"message": "Pengaturan"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "URL ini saat ini digunakan oleh jaringan $1."
},
"useDefault": {
"message": "Gunakan default"
},
"useMultiAccountBalanceChecker": {
"message": "Kelompokkan permintaan saldo akun"
},

View File

@ -1301,9 +1301,6 @@
"provide": {
"message": "Fornisci"
},
"queue": {
"message": "Coda"
},
"queued": {
"message": "In coda"
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "パブリックアドレス"
},
"queue": {
"message": "キュー"
},
"queued": {
"message": "キュー待ち"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "シードフレーズを表示"
},
"reviewSpendingCap": {
"message": "使用上限を確認してください"
},
"revokeAllTokensTitle": {
"message": "すべての $1 へのアクセスおよび転送許可を取り消しますか?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "使用限度額なしで $1 を承認",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "$1 の使用上限を設定",
"description": "$1 is a token symbol"
},
"settings": {
"message": "設定"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "このURLは現在$1ネットワークで使用されています。"
},
"useDefault": {
"message": "既定値を使用"
},
"useMultiAccountBalanceChecker": {
"message": "アカウント残高の一括リクエスト"
},

View File

@ -560,9 +560,6 @@
"privateNetwork": {
"message": "ಖಾಸಗಿ ನೆಟ್‌ವರ್ಕ್"
},
"queue": {
"message": "ಸರತಿ"
},
"readdToken": {
"message": "ನಿಮ್ಮ ಖಾತೆಗಳ ಆಯ್ಕೆಗಳ ಮೆನುವಿನಲ್ಲಿ \"ಟೋಕನ್ ಸೇರಿಸು\" ಗೆ ಹೋಗುವ ಮೂಲಕ ನೀವು ಈ ಟೋಕನ್ ಅನ್ನು ಭವಿಷ್ಯದಲ್ಲಿ ಮರಳಿ ಸೇರಿಸಬಹುದು."
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "공개 주소"
},
"queue": {
"message": "대기열"
},
"queued": {
"message": "대기열에 지정됨"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "시드 구문 보기"
},
"reviewSpendingCap": {
"message": "지출 한도 검토"
},
"revokeAllTokensTitle": {
"message": "모든 $1에 액세스할 수 있는 권한을 철회할까요?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "$1 무제한 지출 승인",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "$1에 대한 지출 한도 설정",
"description": "$1 is a token symbol"
},
"settings": {
"message": "설정"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "이 URL은 현재 $1 네트워크에서 사용됩니다."
},
"useDefault": {
"message": "기본값 사용"
},
"useMultiAccountBalanceChecker": {
"message": "일괄 계정 잔액 요청"
},

View File

@ -560,9 +560,6 @@
"privateNetwork": {
"message": "Privatus tinklas"
},
"queue": {
"message": "Eilė"
},
"readdToken": {
"message": "Šį žetoną galite bet kada galite įtraukti ir vėl, tiesiog savo paskyros parinkčių meniu nueikite į „Įtraukti žetoną“."
},

View File

@ -556,9 +556,6 @@
"privateNetwork": {
"message": "Privātais tīkls"
},
"queue": {
"message": "Rinda"
},
"readdToken": {
"message": "Jūs varat šo marķieri iestatīt atpakaļ nākotnē, konta opciju izvēlnē atverot \"Pievienot marķieri\"."
},

View File

@ -103,9 +103,6 @@
"password": {
"message": "പാസ്‌വേഡ്"
},
"queue": {
"message": "ക്യൂവിൽ"
},
"reject": {
"message": "നിരസിക്കുക"
},

View File

@ -103,9 +103,6 @@
"password": {
"message": "पासवर्ड"
},
"queue": {
"message": "रांग"
},
"reject": {
"message": "नाकारा"
},

View File

@ -540,9 +540,6 @@
"privateNetwork": {
"message": "Rangkaian Persendirian"
},
"queue": {
"message": "Baris Gilir"
},
"readdToken": {
"message": "Anda boleh tambah token ini kembali pada masa depan dengan pergi ke \"Tambah token\" di dalam menu pilihan akaun anda."
},

View File

@ -544,9 +544,6 @@
"privateNetwork": {
"message": "Privat nettverk "
},
"queue": {
"message": "Kø"
},
"readdToken": {
"message": "Du kan legge til dette tokenet igjen i fremtiden ved å gå til \"Legg til token\" i menyen for kontoalternativer."
},

View File

@ -1105,9 +1105,6 @@
"publicAddress": {
"message": "Pampublikong Address"
},
"queue": {
"message": "Queue"
},
"queued": {
"message": "Naka-queue"
},

View File

@ -554,9 +554,6 @@
"privateNetwork": {
"message": "Sieć prywatna"
},
"queue": {
"message": "Kolejka"
},
"readdToken": {
"message": "Możesz później ponownie dodać ten token poprzez \"Dodaj token\" w opcjach menu swojego konta."
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "Endereço público"
},
"queue": {
"message": "Fila"
},
"queued": {
"message": "Na fila"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "Revelar a frase de recuperação"
},
"reviewSpendingCap": {
"message": "Revise seu limite de gastos"
},
"revokeAllTokensTitle": {
"message": "Revogar permissão de acesso e transferência de todos os seus $1?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "Aprovar $1 sem limite de gastos",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "Definir um limite de gastos para seu $1",
"description": "$1 is a token symbol"
},
"settings": {
"message": "Definições"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "O ID da cadeia está sendo usado pela rede $1."
},
"useDefault": {
"message": "Usar padrão"
},
"useMultiAccountBalanceChecker": {
"message": "Agrupar solicitações de saldo de contas"
},

View File

@ -1767,9 +1767,6 @@
"publicAddress": {
"message": "Endereço público"
},
"queue": {
"message": "Fila"
},
"queued": {
"message": "Na fila"
},

View File

@ -113,9 +113,6 @@
"privacyMsg": {
"message": "Política de Privacidade"
},
"queue": {
"message": "Fila"
},
"reject": {
"message": "Rejeitar"
},

View File

@ -547,9 +547,6 @@
"privateNetwork": {
"message": "Rețea privată"
},
"queue": {
"message": "Coadă"
},
"readdToken": {
"message": "Puteți adăuga din nou acest indicativ în viitor accesând „Adăugați indicativ” din meniul de opțiuni al contului dvs."
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "Открытый адрес"
},
"queue": {
"message": "Очередь"
},
"queued": {
"message": "В очереди"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "Показать сид-фразу"
},
"reviewSpendingCap": {
"message": "Проверьте свой лимит расходов"
},
"revokeAllTokensTitle": {
"message": "Отозвать разрешение на доступ ко всем вашим $1 и их перевод?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "Одобрить $1 без ограничений по расходам",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "Установить верхний лимит расходов для вашего $1",
"description": "$1 is a token symbol"
},
"settings": {
"message": "Настройки"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "Это URL-адрес в настоящее время используется сетью $1."
},
"useDefault": {
"message": "Использовать значения по умолчанию"
},
"useMultiAccountBalanceChecker": {
"message": "Пакетные запросы баланса счета"
},

View File

@ -532,9 +532,6 @@
"privateNetwork": {
"message": "Soukromá síť"
},
"queue": {
"message": "Poradie"
},
"readdToken": {
"message": "Tento token můžete v budoucnu přidat zpět s „Přidat token“ v nastavení účtu."
},

View File

@ -548,9 +548,6 @@
"privateNetwork": {
"message": "Zasebno omrežje"
},
"queue": {
"message": "Čakalna vrsta"
},
"readdToken": {
"message": "Ta žeton lahko dodate tudi kasneje z uporabo gumba “Dodaj žeton” v možnostih vašega računa."
},

View File

@ -551,9 +551,6 @@
"privateNetwork": {
"message": "Privatna mreža"
},
"queue": {
"message": "Ред"
},
"readdToken": {
"message": "U budućnosti možete vratiti ovaj token tako što ćete otvoriti „Dodaj token“ u meniju opcija vašeg naloga."
},

View File

@ -544,9 +544,6 @@
"privateNetwork": {
"message": "Privat nätverk"
},
"queue": {
"message": "Utskriftskö"
},
"readdToken": {
"message": "Du kan lägga till denna token i framtiden genom att välja \"Lägg till token\" i kontots alternativmeny."
},

View File

@ -538,9 +538,6 @@
"privateNetwork": {
"message": "Mtandao Binafsi"
},
"queue": {
"message": "Foleni"
},
"readdToken": {
"message": "Unaweza kuongeza tena kianzio hiki hapo baadaye kwa kwenda kwenye \"Ongeza kianzio\" kwenye machaguo yako ya menyu ya akaunti."
},

View File

@ -322,9 +322,6 @@
"privateNetwork": {
"message": "தனியார் நெட்வொர்க்"
},
"queue": {
"message": "வரிசை"
},
"readdToken": {
"message": "உங்கள் கணக்கு விருப்பங்கள் மெனுவில் \"டோக்கனைச் சேர்\" என்பதன் மூலம் நீங்கள் எதிர்காலத்தில் இந்த டோக்கனை மீண்டும் சேர்க்கலாம்."
},

View File

@ -103,9 +103,6 @@
"password": {
"message": "పాస్‌వర్డ్"
},
"queue": {
"message": "క్రమ వరుస"
},
"reject": {
"message": "తిరస్కరించు"
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "Pampublikong Address"
},
"queue": {
"message": "Pila"
},
"queued": {
"message": "Naka-queue"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "Ipakita ang seed phrase"
},
"reviewSpendingCap": {
"message": "I-review ang iyong limitasyon sa paggastos"
},
"revokeAllTokensTitle": {
"message": "Bawiin ang pahintulot na i-access at ilipat ang lahat ng iyong $1?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "Aprubahan ang $1 nang walang limitasyon sa paggastos",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "Magtakda ng limitasyon sa paggastos para sa iyong $1",
"description": "$1 is a token symbol"
},
"settings": {
"message": "Mga Setting"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "Nasa kasalukuyang listahan ng mga network na ang URL."
},
"useDefault": {
"message": "Gamitin ang default"
},
"useMultiAccountBalanceChecker": {
"message": "Mga kahilingan sa balanse ng batch account"
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "Genel adres"
},
"queue": {
"message": "Kuyruğa al"
},
"queued": {
"message": "Kuyruğa alındı"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "Tohum ifadesini ortaya çıkar"
},
"reviewSpendingCap": {
"message": "Harcama üst limitinize göz atın"
},
"revokeAllTokensTitle": {
"message": "Tüm $1 için izin erişim ve transfer izni geri çekilsin mi?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "$1 için harcama limiti olmadan onay ver",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "$1 için harcama üst limiti belirle",
"description": "$1 is a token symbol"
},
"settings": {
"message": "Ayarlar"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "Bu URL şu anda $1 ağı tarafından kullanılıyor."
},
"useDefault": {
"message": "Varsayılanı kullan"
},
"useMultiAccountBalanceChecker": {
"message": "Toplu hesap bakiyesi talepleri"
},

View File

@ -560,9 +560,6 @@
"privateNetwork": {
"message": "Приватна мережа"
},
"queue": {
"message": "Черга"
},
"readdToken": {
"message": "Ви можете знову додати цей токен у меню облікового запису у розділі “Додати токен”. "
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "Địa chỉ công khai"
},
"queue": {
"message": "Hàng đợi"
},
"queued": {
"message": "Đã đưa vào hàng đợi"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "Hiện cụm từ khôi phục bí mật"
},
"reviewSpendingCap": {
"message": "Xem lại hạn mức chi tiêu của bạn"
},
"revokeAllTokensTitle": {
"message": "Thu hồi quyền truy cập và chuyển tất cả $1 của bạn?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "Phê duyệt $1 không có giới hạn chi tiêu",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "Đặt hạn mức chi tiêu cho $1 của bạn",
"description": "$1 is a token symbol"
},
"settings": {
"message": "Cài đặt"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "Mạng $1 hiện đang sử dụng URL này."
},
"useDefault": {
"message": "Sử dụng mặc định"
},
"useMultiAccountBalanceChecker": {
"message": "Xử lý hàng loạt yêu cầu số dư tài khoản"
},

View File

@ -2753,9 +2753,6 @@
"publicAddress": {
"message": "公共地址"
},
"queue": {
"message": "队列"
},
"queued": {
"message": "队列中"
},
@ -2956,9 +2953,6 @@
"revealTheSeedPhrase": {
"message": "显示助记词"
},
"reviewSpendingCap": {
"message": "检查您的支出上限"
},
"revokeAllTokensTitle": {
"message": "撤销访问和转移您的所有 $1 的权限?",
"description": "$1 is the symbol of the token for which the user is revoking approval"
@ -3140,10 +3134,6 @@
"message": "批准$1且无消费限制",
"description": "The token symbol that is being approved"
},
"setSpendingCap": {
"message": "为 $1 设置支出上限",
"description": "$1 is a token symbol"
},
"settings": {
"message": "设置"
},
@ -4167,9 +4157,6 @@
"urlExistsErrorMsg": {
"message": "此 URL 目前已被 $1 网络使用。"
},
"useDefault": {
"message": "使用默认值"
},
"useMultiAccountBalanceChecker": {
"message": "账户余额分批请求"
},

View File

@ -1051,9 +1051,6 @@
"publicAddress": {
"message": "公開位址"
},
"queue": {
"message": "佇列"
},
"queued": {
"message": "已排入佇列"
},

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="m412 145c12 12 12 32 0 45l-185 183c-12 12-32 12-45 0l-81-80c-13-13-13-33 0-46 12-12 32-12 45 0l59 58 161-161c13-12 33-12 46 1z"/></svg>

After

Width:  |  Height:  |  Size: 207 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="m93 224l320 0c18 0 32 14 32 32 0 18-14 32-32 32l-320 0c-18 0-32-14-32-32 0-18 14-32 32-32z"/></svg>

After

Width:  |  Height:  |  Size: 171 B

View File

@ -1,5 +1,5 @@
{
"content_security_policy": "frame-ancestors 'none'; script-src 'self'; object-src 'self'",
"content_security_policy": "frame-ancestors 'none'; script-src 'self' 'wasm-unsafe-eval'; object-src 'self'",
"externally_connectable": {
"matches": ["https://metamask.io/*"],
"ids": ["*"]

View File

@ -442,25 +442,8 @@ export default class MMIController extends EventEmitter {
return keyring.getTransactionDeepLink(from, custodyTxId);
}
async getCustodianToken(custodianType) {
let currentCustodyType;
const address = this.preferencesController.getSelectedAddress();
if (!custodianType) {
const resultCustody = this.custodyController.getCustodyTypeByAddress(
toChecksumHexAddress(address),
);
currentCustodyType = resultCustody;
}
let keyring = await this.keyringController.getKeyringsByType(
currentCustodyType || `Custody - ${custodianType}`,
)[0];
if (!keyring) {
keyring = await this.keyringController.addNewKeyring(
currentCustodyType || `Custody - ${custodianType}`,
);
}
async getCustodianToken(address) {
const keyring = await this.keyringController.getKeyringForAccount(address);
const { authDetails } = keyring.getAccountDetails(address);
return keyring ? authDetails.jwt || authDetails.refreshToken : '';
}

View File

@ -1305,6 +1305,8 @@ export default class TransactionController extends EventEmitter {
txMeta.custodyId,
fromAddress,
);
return null;
}
///: END:ONLY_INCLUDE_IN

View File

@ -0,0 +1,93 @@
import 'fake-indexeddb/auto';
import { IndexedDBPPOMStorage } from './indexed-db-backend';
Object.defineProperty(globalThis, 'crypto', {
value: {
subtle: {
digest: () => new ArrayBuffer(12),
},
},
});
const enc = new TextEncoder();
const dec = new TextDecoder('utf-8');
describe('IndexedDBPPOMStorage', () => {
it('should be able to initialise correctly', () => {
const indexDBBackend = new IndexedDBPPOMStorage('PPOMDB', 1);
expect(indexDBBackend).toBeDefined();
});
it('should be able to write and read file data if checksum matches', async () => {
const indexDBBackend = new IndexedDBPPOMStorage('PPOMDB', 1);
await indexDBBackend.write(
{ name: 'fake_name', chainId: '5' },
enc.encode('fake_data'),
'000000000000000000000000',
);
const file = await indexDBBackend.read(
{ name: 'fake_name', chainId: '5' },
'000000000000000000000000',
);
expect(dec.decode(file)).toStrictEqual('fake_data');
});
it('should fail to write if checksum does not match', async () => {
const indexDBBackend = new IndexedDBPPOMStorage('PPOMDB', 1);
await expect(async () => {
await indexDBBackend.write(
{ name: 'fake_name', chainId: '5' },
enc.encode('fake_data'),
'XXX',
);
}).rejects.toThrow('Checksum mismatch');
});
it('should fail to read if checksum does not match', async () => {
const indexDBBackend = new IndexedDBPPOMStorage('PPOMDB', 1);
await expect(async () => {
await indexDBBackend.write(
{ name: 'fake_name', chainId: '5' },
enc.encode('fake_data'),
'000000000000000000000000',
);
await indexDBBackend.read({ name: 'fake_name', chainId: '5' }, 'XXX');
}).rejects.toThrow('Checksum mismatch');
});
it('should delete a file when delete method is called', async () => {
const indexDBBackend = new IndexedDBPPOMStorage('PPOMDB', 1);
await indexDBBackend.write(
{ name: 'fake_name', chainId: '5' },
enc.encode('fake_data'),
'000000000000000000000000',
);
await indexDBBackend.delete({ name: 'fake_name', chainId: '5' });
const result = await indexDBBackend.read(
{ name: 'fake_name', chainId: '5' },
'000000000000000000000000',
);
expect(result).toBeUndefined();
});
it('should list all keys when dir is called', async () => {
const keys = [
{ chainId: '5', name: 'fake_name_1' },
{ chainId: '1', name: 'fake_name_2' },
];
const indexDBBackend = new IndexedDBPPOMStorage('PPOMDB', 1);
await indexDBBackend.write(
keys[0],
enc.encode('fake_data_1'),
'000000000000000000000000',
);
await indexDBBackend.write(
keys[1],
enc.encode('fake_data_2'),
'000000000000000000000000',
);
const result = await indexDBBackend.dir();
expect(result).toStrictEqual(keys);
});
});

View File

@ -0,0 +1,127 @@
import { StorageBackend } from '@metamask/ppom-validator';
type StorageKey = {
name: string;
chainId: string;
};
const validateChecksum = async (
key: StorageKey,
data: ArrayBuffer,
checksum: string,
) => {
const hash = await crypto.subtle.digest('SHA-256', data);
const hashString = Array.from(new Uint8Array(hash))
.map((b) => b.toString(16).padStart(2, '0'))
.join('');
if (hashString !== checksum) {
throw new Error(`Checksum mismatch for key ${key}`);
}
};
export class IndexedDBPPOMStorage implements StorageBackend {
private storeName: string;
private dbVersion: number;
constructor(storeName: string, dbVersion: number) {
this.storeName = storeName;
this.dbVersion = dbVersion;
}
#getObjectStore(mode: IDBTransactionMode): Promise<IDBObjectStore> {
return new Promise((resolve, reject) => {
const request = indexedDB.open(this.storeName, this.dbVersion);
request.onerror = (event: Event) => {
reject(
new Error(
`Failed to open database ${this.storeName}: ${
(event.target as any)?.error
}`,
),
);
};
request.onupgradeneeded = (event) => {
const db = (event.target as IDBOpenDBRequest).result;
if (!db.objectStoreNames.contains(this.storeName)) {
db.createObjectStore(this.storeName, {
keyPath: ['name', 'chainId'],
});
}
};
request.onsuccess = (event) => {
const db = (event.target as IDBOpenDBRequest).result;
const transaction = db.transaction([this.storeName], mode);
const objectStore = transaction.objectStore(this.storeName);
resolve(objectStore);
};
});
}
private async objectStoreAction(
method: 'get' | 'delete' | 'put' | 'getAllKeys',
args?: any,
mode: IDBTransactionMode = 'readonly',
): Promise<any> {
return new Promise<Event>((resolve, reject) => {
this.#getObjectStore(mode)
.then((objectStore) => {
const request = objectStore[method](args);
request.onsuccess = async (event) => {
resolve(event);
};
request.onerror = (event) => {
reject(
new Error(
`Error in indexDB operation ${method}: ${
(event.target as any)?.error
}`,
),
);
};
})
.catch((error) => {
reject(error);
});
});
}
async read(key: StorageKey, checksum: string): Promise<ArrayBuffer> {
const event = await this.objectStoreAction('get', [key.name, key.chainId]);
const data = (event.target as any)?.result?.data;
await validateChecksum(key, data, checksum);
return data;
}
async write(
key: StorageKey,
data: ArrayBuffer,
checksum: string,
): Promise<void> {
await validateChecksum(key, data, checksum);
await this.objectStoreAction('put', { ...key, data }, 'readwrite');
}
async delete(key: StorageKey): Promise<void> {
await this.objectStoreAction(
'delete',
[key.name, key.chainId],
'readwrite',
);
}
async dir(): Promise<StorageKey[]> {
const event = await this.objectStoreAction('getAllKeys');
return (event.target as any)?.result.map(([name, chainId]: string[]) => ({
name,
chainId,
}));
}
}

View File

@ -76,6 +76,9 @@ import { CustodyController } from '@metamask-institutional/custody-controller';
import { TransactionUpdateController } from '@metamask-institutional/transaction-update';
///: END:ONLY_INCLUDE_IN
import { SignatureController } from '@metamask/signature-controller';
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
import { PPOMController, createPPOMMiddleware } from '@metamask/ppom-validator';
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(desktop)
// eslint-disable-next-line import/order
@ -210,6 +213,9 @@ import {
} from './controllers/permissions';
import createRPCMethodTrackingMiddleware from './lib/createRPCMethodTrackingMiddleware';
import { securityProviderCheck } from './lib/security-provider-helpers';
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
import { IndexedDBPPOMStorage } from './lib/indexed-db-backend';
///: END:ONLY_INCLUDE_IN
import { updateCurrentLocale } from './translate';
export const METAMASK_CONTROLLER_EVENTS = {
@ -315,31 +321,42 @@ export default class MetamaskController extends EventEmitter {
],
});
let initialProviderConfig;
if (process.env.IN_TEST) {
initialProviderConfig = {
type: NETWORK_TYPES.RPC,
rpcUrl: 'http://localhost:8545',
chainId: '0x539',
nickname: 'Localhost 8545',
ticker: 'ETH',
let initialNetworkControllerState = {};
if (initState.NetworkController) {
initialNetworkControllerState = initState.NetworkController;
} else if (process.env.IN_TEST) {
initialNetworkControllerState = {
providerConfig: {
chainId: CHAIN_IDS.LOCALHOST,
nickname: 'Localhost 8545',
rpcPrefs: {},
rpcUrl: 'http://localhost:8545',
ticker: 'ETH',
type: 'rpc',
},
networkConfigurations: {
networkConfigurationId: {
chainId: CHAIN_IDS.LOCALHOST,
nickname: 'Localhost 8545',
rpcPrefs: {},
rpcUrl: 'http://localhost:8545',
ticker: 'ETH',
networkConfigurationId: 'networkConfigurationId',
},
},
};
} else if (
process.env.METAMASK_DEBUG ||
process.env.METAMASK_ENVIRONMENT === 'test'
) {
initialProviderConfig = {
type: NETWORK_TYPES.GOERLI,
chainId: CHAIN_IDS.GOERLI,
ticker: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.GOERLI],
initialNetworkControllerState = {
providerConfig: {
type: NETWORK_TYPES.GOERLI,
chainId: CHAIN_IDS.GOERLI,
ticker: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.GOERLI],
},
};
}
const initialNetworkControllerState = initialProviderConfig
? {
providerConfig: initialProviderConfig,
...initState.NetworkController,
}
: initState.NetworkController;
this.networkController = new NetworkController({
messenger: networkControllerMessenger,
state: initialNetworkControllerState,
@ -568,8 +585,12 @@ export default class MetamaskController extends EventEmitter {
),
getCurrentAccountEIP1559Compatibility:
this.getCurrentAccountEIP1559Compatibility.bind(this),
legacyAPIEndpoint: `${gasApiBaseUrl}/networks/<chain_id>/gasPrices`,
EIP1559APIEndpoint: `${gasApiBaseUrl}/networks/<chain_id>/suggestedGasFees`,
getCurrentNetworkLegacyGasAPICompatibility: () => false,
getCurrentNetworkLegacyGasAPICompatibility: () => {
const { chainId } = this.networkController.state.providerConfig;
return chainId === CHAIN_IDS.BSC;
},
getChainId: () => this.networkController.state.providerConfig.chainId,
});
@ -615,6 +636,22 @@ export default class MetamaskController extends EventEmitter {
this.phishingController.setStalelistRefreshInterval(30 * SECOND);
}
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
this.ppomController = new PPOMController({
messenger: this.controllerMessenger.getRestricted({
name: 'PPOMController',
}),
storageBackend: new IndexedDBPPOMStorage('PPOMDB', 1),
provider: this.provider,
state: initState.PPOMController,
chainId: this.networkController.state.providerConfig.chainId,
onNetworkChange: networkControllerMessenger.subscribe.bind(
networkControllerMessenger,
'NetworkController:stateChange',
),
});
///: END:ONLY_INCLUDE_IN
const announcementMessenger = this.controllerMessenger.getRestricted({
name: 'AnnouncementController',
});
@ -1467,6 +1504,18 @@ export default class MetamaskController extends EventEmitter {
this.signatureController.newUnsignedPersonalMessage.bind(
this.signatureController,
),
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
setTypedMessageInProgress:
this.signatureController.setTypedMessageInProgress.bind(
this.signatureController,
),
setPersonalMessageInProgress:
this.signatureController.setPersonalMessageInProgress.bind(
this.signatureController,
),
///: END:ONLY_INCLUDE_IN
processEncryptionPublicKey:
this.encryptionPublicKeyController.newRequestEncryptionPublicKey.bind(
this.encryptionPublicKeyController,
@ -1502,6 +1551,9 @@ export default class MetamaskController extends EventEmitter {
SwapsController: this.swapsController.store,
EnsController: this.ensController.store,
ApprovalController: this.approvalController,
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
PPOMController: this.ppomController,
///: END:ONLY_INCLUDE_IN
};
this.store.updateStructure({
@ -1606,6 +1658,9 @@ export default class MetamaskController extends EventEmitter {
this.swapsController.resetState,
this.ensController.resetState,
this.approvalController.clear.bind(this.approvalController),
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
this.ppomController.clear.bind(this.ppomController),
///: END:ONLY_INCLUDE_IN
// WE SHOULD ADD TokenListController.resetState here too. But it's not implemented yet.
];
@ -2444,6 +2499,10 @@ export default class MetamaskController extends EventEmitter {
this.institutionalFeaturesController.removeAddTokenConnectRequest.bind(
this.institutionalFeaturesController,
),
showInteractiveReplacementTokenBanner:
appStateController.showInteractiveReplacementTokenBanner.bind(
appStateController,
),
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(snaps)
@ -2468,6 +2527,10 @@ export default class MetamaskController extends EventEmitter {
this.controllerMessenger,
'SnapController:handleRequest',
),
revokeDynamicSnapPermissions: this.controllerMessenger.call.bind(
this.controllerMessenger,
'SnapController:revokeDynamicPermissions',
),
dismissNotifications: this.dismissNotifications.bind(this),
markNotificationsAsRead: this.markNotificationsAsRead.bind(this),
///: END:ONLY_INCLUDE_IN
@ -3879,6 +3942,10 @@ export default class MetamaskController extends EventEmitter {
engine.push(createLoggerMiddleware({ origin }));
engine.push(this.permissionLogController.createMiddleware());
///: BEGIN:ONLY_INCLUDE_IN(blockaid)
engine.push(createPPOMMiddleware(this.ppomController));
///: END:ONLY_INCLUDE_IN
engine.push(
createRPCMethodTrackingMiddleware({
trackEvent: this.metaMetricsController.trackEvent.bind(
@ -3932,6 +3999,12 @@ export default class MetamaskController extends EventEmitter {
this.approvalController.setFlowLoadingText.bind(
this.approvalController,
),
showApprovalSuccess: this.approvalController.success.bind(
this.approvalController,
),
showApprovalError: this.approvalController.error.bind(
this.approvalController,
),
sendMetrics: this.metaMetricsController.trackEvent.bind(
this.metaMetricsController,
),

View File

@ -52,7 +52,7 @@ buildTypes:
- SEGMENT_FLASK_WRITE_KEY
- ALLOW_LOCAL_SNAPS: true
- REQUIRE_SNAPS_ALLOWLIST: false
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/0.35.2-flask.1/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/0.36.1-flask.1/index.html
- SUPPORT_LINK: https://metamask-flask.zendesk.com/hc
- SUPPORT_REQUEST_LINK: https://metamask-flask.zendesk.com/hc/en-us/requests/new
- INFURA_ENV_KEY_REF: INFURA_FLASK_PROJECT_ID
@ -71,7 +71,7 @@ buildTypes:
- SEGMENT_FLASK_WRITE_KEY
- ALLOW_LOCAL_SNAPS: true
- REQUIRE_SNAPS_ALLOWLIST: false
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/0.35.2-flask.1/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/0.36.1-flask.1/index.html
- SUPPORT_LINK: https://metamask-flask.zendesk.com/hc
- SUPPORT_REQUEST_LINK: https://metamask-flask.zendesk.com/hc/en-us/requests/new
- INFURA_ENV_KEY_REF: INFURA_FLASK_PROJECT_ID
@ -87,9 +87,9 @@ buildTypes:
- SEGMENT_MMI_WRITE_KEY
- INFURA_ENV_KEY_REF: INFURA_MMI_PROJECT_ID
- SEGMENT_WRITE_KEY_REF: SEGMENT_MMI_WRITE_KEY
- MMI_CONFIGURATION_SERVICE_URL: https://configuration.metamask-institutional.io/v1/configuration/default
- SUPPORT_LINK: https://mmi-support.zendesk.com/hc/en-us
- SUPPORT_REQUEST_LINK: https://mmi-support.zendesk.com/hc/en-us/requests/new
- MMI_CONFIGURATION_SERVICE_URL: https://configuration.metamask-institutional.io/v1/configuration/default
# For some reason, MMI uses this type of versioning
# Leaving it on for backwards compatibility
isPrerelease: true
@ -116,6 +116,7 @@ features:
- DISABLE_WEB_SOCKET_ENCRYPTION: false
- SKIP_OTP_PAIRING_FLOW: false
- WEB_SOCKET_PORT: null
blockaid:
###
# Build Type code extensions. Things like different support links, warning pages, banners

View File

@ -11,7 +11,12 @@ const VARIABLES_REQUIRED_IN_PRODUCTION = {
main: ['INFURA_PROD_PROJECT_ID', 'SEGMENT_PROD_WRITE_KEY', 'SENTRY_DSN'],
beta: ['INFURA_BETA_PROJECT_ID', 'SEGMENT_BETA_WRITE_KEY', 'SENTRY_DSN'],
flask: ['INFURA_FLASK_PROJECT_ID', 'SEGMENT_FLASK_WRITE_KEY', 'SENTRY_DSN'],
mmi: ['INFURA_MMI_PROJECT_ID', 'SEGMENT_MMI_WRITE_KEY', 'SENTRY_DSN'],
mmi: [
'INFURA_MMI_PROJECT_ID',
'MMI_CONFIGURATION_SERVICE_URL',
'SEGMENT_MMI_WRITE_KEY',
'SENTRY_DSN',
],
};
async function fromIniFile(filepath) {

View File

@ -22,19 +22,20 @@ module.exports = function createStaticAssetTasks({
const copyTargetsProds = {};
const copyTargetsDevs = {};
const buildConfig = loadBuildTypesConfig();
const activeFeatures = buildConfig.buildTypes[buildType].features ?? [];
browserPlatforms.forEach((browser) => {
const [copyTargetsProd, copyTargetsDev] = getCopyTargets(
shouldIncludeLockdown,
shouldIncludeSnow,
activeFeatures,
);
copyTargetsProds[browser] = copyTargetsProd;
copyTargetsDevs[browser] = copyTargetsDev;
});
const buildConfig = loadBuildTypesConfig();
const activeFeatures = buildConfig.buildTypes[buildType].features ?? [];
const additionalAssets = activeFeatures.flatMap(
(feature) =>
buildConfig.features[feature].assets?.filter(
@ -108,7 +109,11 @@ module.exports = function createStaticAssetTasks({
}
};
function getCopyTargets(shouldIncludeLockdown, shouldIncludeSnow) {
function getCopyTargets(
shouldIncludeLockdown,
shouldIncludeSnow,
activeFeatures,
) {
const allCopyTargets = [
{
src: `./app/_locales/`,
@ -198,6 +203,14 @@ function getCopyTargets(shouldIncludeLockdown, shouldIncludeSnow) {
},
];
if (activeFeatures.includes('blockaid')) {
allCopyTargets.push({
src: getPathInsideNodeModules('@metamask/ppom-validator', 'dist/'),
pattern: '*.wasm',
dest: '',
});
}
const languageTags = new Set();
for (const locale of locales) {
const { code } = locale;

View File

@ -11,13 +11,19 @@
* @param {string} args.rejectionMessage - The message for the rejected promise
* this function will return in the event of failure. (Default: "Retry limit
* reached")
* @param {string} args.retryUntilFailure - Retries until the function fails.
* @param {Function} functionToRetry - The function that is run and tested for
* failure.
* @returns {Promise<null | Error>} a promise that either resolves to null if
* the function is successful or is rejected with rejectionMessage otherwise.
*/
async function retry(
{ retries, delay = 0, rejectionMessage = 'Retry limit reached' },
{
retries,
delay = 0,
rejectionMessage = 'Retry limit reached',
retryUntilFailure = false,
},
functionToRetry,
) {
let attempts = 0;
@ -28,9 +34,14 @@ async function retry(
try {
await functionToRetry();
return;
if (!retryUntilFailure) {
return;
}
} catch (error) {
console.error(error);
if (retryUntilFailure) {
return;
}
} finally {
attempts += 1;
}

View File

@ -1162,9 +1162,6 @@
"ui/hooks/useUserPreferencedCurrency.test.js",
"ui/index.js",
"ui/index.test.js",
"ui/pages/add-nft/add-nft.js",
"ui/pages/add-nft/add-nft.test.js",
"ui/pages/add-nft/index.js",
"ui/pages/asset/asset.js",
"ui/pages/asset/components/asset-breadcrumb.js",
"ui/pages/asset/components/asset-navigation.js",

View File

@ -775,6 +775,9 @@
}
},
"@metamask/approval-controller": {
"globals": {
"console.info": true
},
"packages": {
"@metamask/approval-controller>nanoid": true,
"@metamask/base-controller": true,

View File

@ -775,6 +775,9 @@
}
},
"@metamask/approval-controller": {
"globals": {
"console.info": true
},
"packages": {
"@metamask/approval-controller>nanoid": true,
"@metamask/base-controller": true,
@ -1950,7 +1953,6 @@
"@metamask/rpc-methods-flask>@metamask/snaps-ui": true,
"@metamask/rpc-methods-flask>@metamask/snaps-utils": true,
"@metamask/rpc-methods-flask>@metamask/utils": true,
"@metamask/rpc-methods-flask>nanoid": true,
"eth-rpc-errors": true,
"superstruct": true
}
@ -2156,7 +2158,6 @@
"@metamask/snaps-controllers-flask>@metamask/snaps-utils": true,
"@metamask/snaps-controllers-flask>@metamask/snaps-utils>@metamask/snaps-ui": true,
"@metamask/snaps-controllers-flask>@metamask/utils": true,
"@metamask/snaps-controllers-flask>nanoid": true,
"eth-rpc-errors": true,
"superstruct": true
}
@ -4916,9 +4917,9 @@
},
"react-markdown>unified": {
"packages": {
"jsdom>request>extend": true,
"mocha>yargs-unparser>is-plain-obj": true,
"react-markdown>unified>bail": true,
"react-markdown>unified>extend": true,
"react-markdown>unified>is-buffer": true,
"react-markdown>unified>trough": true,
"react-markdown>vfile": true

View File

@ -775,6 +775,9 @@
}
},
"@metamask/approval-controller": {
"globals": {
"console.info": true
},
"packages": {
"@metamask/approval-controller>nanoid": true,
"@metamask/base-controller": true,
@ -1950,7 +1953,6 @@
"@metamask/rpc-methods-flask>@metamask/snaps-ui": true,
"@metamask/rpc-methods-flask>@metamask/snaps-utils": true,
"@metamask/rpc-methods-flask>@metamask/utils": true,
"@metamask/rpc-methods-flask>nanoid": true,
"eth-rpc-errors": true,
"superstruct": true
}
@ -2156,7 +2158,6 @@
"@metamask/snaps-controllers-flask>@metamask/snaps-utils": true,
"@metamask/snaps-controllers-flask>@metamask/snaps-utils>@metamask/snaps-ui": true,
"@metamask/snaps-controllers-flask>@metamask/utils": true,
"@metamask/snaps-controllers-flask>nanoid": true,
"eth-rpc-errors": true,
"superstruct": true
}
@ -4916,9 +4917,9 @@
},
"react-markdown>unified": {
"packages": {
"jsdom>request>extend": true,
"mocha>yargs-unparser>is-plain-obj": true,
"react-markdown>unified>bail": true,
"react-markdown>unified>extend": true,
"react-markdown>unified>is-buffer": true,
"react-markdown>unified>trough": true,
"react-markdown>vfile": true

View File

@ -775,6 +775,9 @@
}
},
"@metamask/approval-controller": {
"globals": {
"console.info": true
},
"packages": {
"@metamask/approval-controller>nanoid": true,
"@metamask/base-controller": true,

View File

@ -815,11 +815,18 @@
},
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask-institutional/custody-controller": true,
"@metamask-institutional/extension>@metamask-institutional/custody-controller": true,
"@metamask-institutional/sdk": true,
"@metamask-institutional/sdk>@metamask-institutional/types": true
}
},
"@metamask-institutional/extension>@metamask-institutional/custody-controller": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask-institutional/custody-keyring": true,
"@metamask/obs-store": true
}
},
"@metamask-institutional/institutional-features": {
"globals": {
"chrome.runtime.id": true,
@ -996,6 +1003,9 @@
}
},
"@metamask/approval-controller": {
"globals": {
"console.info": true
},
"packages": {
"@metamask/approval-controller>nanoid": true,
"@metamask/base-controller": true,

View File

@ -3112,12 +3112,12 @@
"packages": {
"eslint>eslint-visitor-keys": true,
"eslint>espree>acorn-jsx": true,
"terser>acorn": true
"jsdom>acorn": true
}
},
"eslint>espree>acorn-jsx": {
"packages": {
"terser>acorn": true
"jsdom>acorn": true
}
},
"eslint>esquery": {
@ -5838,7 +5838,7 @@
"gulp>vinyl-fs>glob-stream>pumpify": true,
"gulp>vinyl-fs>glob-stream>to-absolute-glob": true,
"gulp>vinyl-fs>glob-stream>unique-stream": true,
"jsdom>request>extend": true,
"react-markdown>unified>extend": true,
"readable-stream": true,
"vinyl>remove-trailing-separator": true
}
@ -6111,6 +6111,12 @@
"process": true
}
},
"jsdom>acorn": {
"globals": {
"console": true,
"define": true
}
},
"koa>is-generator-function>has-tostringtag": {
"packages": {
"string.prototype.matchall>has-symbols": true
@ -6283,7 +6289,6 @@
"events": true,
"fs.existsSync": true,
"fs.readFileSync": true,
"fs.writeFileSync": true,
"path.extname": true,
"path.join": true
},
@ -7489,9 +7494,9 @@
},
"react-markdown>unified": {
"packages": {
"jsdom>request>extend": true,
"mocha>yargs-unparser>is-plain-obj": true,
"react-markdown>unified>bail": true,
"react-markdown>unified>extend": true,
"react-markdown>unified>is-buffer": true,
"react-markdown>unified>trough": true,
"react-markdown>vfile": true
@ -8572,8 +8577,8 @@
},
"packages": {
"eslint>imurmurhash": true,
"jsdom>request>is-typedarray": true,
"nyc>signal-exit": true,
"stylelint>write-file-atomic>is-typedarray": true,
"stylelint>write-file-atomic>typedarray-to-buffer": true
}
},
@ -8582,7 +8587,7 @@
"Buffer.from": true
},
"packages": {
"jsdom>request>is-typedarray": true
"stylelint>write-file-atomic>is-typedarray": true
}
},
"superstruct": {
@ -8602,8 +8607,8 @@
"process": true
},
"packages": {
"terser>@jridgewell/source-map": true,
"terser>acorn": true
"jsdom>acorn": true,
"terser>@jridgewell/source-map": true
}
},
"terser>@jridgewell/source-map": {
@ -8649,12 +8654,6 @@
"define": true
}
},
"terser>acorn": {
"globals": {
"console": true,
"define": true
}
},
"terser>source-map-support": {
"builtin": {
"fs": true,

View File

@ -100,7 +100,7 @@
"resolutions": {
"@babel/core": "patch:@babel/core@npm%3A7.21.5#./.yarn/patches/@babel-core-npm-7.21.5-c72c337956.patch",
"@babel/runtime": "patch:@babel/runtime@npm%3A7.18.9#./.yarn/patches/@babel-runtime-npm-7.18.9-28ca6b5f61.patch",
"@metamask/approval-controller": "^3.3.0",
"@metamask/approval-controller": "^3.4.0",
"@types/react": "^16.9.53",
"analytics-node/axios": "^0.21.2",
"ganache-core/lodash": "^4.17.21",
@ -165,6 +165,7 @@
"regenerator-runtime@^0.13.4": "patch:regenerator-runtime@npm%3A0.13.7#./.yarn/patches/regenerator-runtime-npm-0.13.7-41bcbe64ea.patch",
"regenerator-runtime@^0.13.7": "patch:regenerator-runtime@npm%3A0.13.7#./.yarn/patches/regenerator-runtime-npm-0.13.7-41bcbe64ea.patch",
"regenerator-runtime@^0.11.0": "patch:regenerator-runtime@npm%3A0.13.7#./.yarn/patches/regenerator-runtime-npm-0.13.7-41bcbe64ea.patch",
"jsdom@^16.7.0": "patch:jsdom@npm%3A16.7.0#./.yarn/patches/jsdom-npm-16.7.0-216c5c4bf9.patch",
"trim": "^0.0.3",
"@eslint/eslintrc@^2.0.1": "patch:@eslint/eslintrc@npm%3A2.0.2#./.yarn/patches/@eslint-eslintrc-npm-2.0.2-d308674d86.patch",
"@formatjs/intl-utils@^3.3.1": "patch:@formatjs/intl-utils@npm%3A3.3.1#./.yarn/patches/@formatjs-intl-utils-npm-3.3.1-08510c16ad.patch",
@ -173,7 +174,7 @@
"@lavamoat/lavapack@^3.1.0": "patch:@lavamoat/lavapack@npm%3A3.1.0#./.yarn/patches/@lavamoat-lavapack-npm-3.1.0-34c65d233b.patch",
"fast-json-patch@^3.1.0": "patch:fast-json-patch@npm%3A3.1.1#./.yarn/patches/fast-json-patch-npm-3.1.1-7e8bb70a45.patch",
"@reduxjs/toolkit@^1.6.2": "patch:@reduxjs/toolkit@npm%3A1.6.2#./.yarn/patches/@reduxjs-toolkit-npm-1.6.2-67af09515f.patch",
"parse5@^7.0.0": "patch:parse5@npm%3A7.0.0#./.yarn/patches/parse5-npm-7.0.0-3158a72394.patch",
"parse5@^7.0.0": "patch:parse5@npm%3A7.1.2#./.yarn/patches/parse5-npm-7.1.2-aa9a92c270.patch",
"@types/madge@^5.0.0": "patch:@types/madge@npm%3A5.0.0#./.yarn/patches/@types-madge-npm-5.0.0-654566c2d2.patch",
"zxcvbn@^4.4.2": "patch:zxcvbn@npm%3A4.4.2#./.yarn/patches/zxcvbn-npm-4.4.2-6527983856.patch",
"web3@^0.20.7": "patch:web3@npm%3A0.20.7#./.yarn/patches/web3-npm-0.20.7-ee7ef00c57.patch",
@ -196,7 +197,8 @@
"request@^2.83.0": "patch:request@npm%3A2.88.2#./.yarn/patches/request-npm-2.88.2-f4a57c72c4.patch",
"request@^2.88.2": "patch:request@npm%3A2.88.2#./.yarn/patches/request-npm-2.88.2-f4a57c72c4.patch",
"request@^2.85.0": "patch:request@npm%3A2.88.2#./.yarn/patches/request-npm-2.88.2-f4a57c72c4.patch",
"@metamask/signature-controller@^4.0.1": "patch:@metamask/signature-controller@npm%3A4.0.1#./.yarn/patches/@metamask-signature-controller-npm-4.0.1-013e64c9fd.patch"
"@metamask/signature-controller@^4.0.1": "patch:@metamask/signature-controller@npm%3A4.0.1#./.yarn/patches/@metamask-signature-controller-npm-4.0.1-013e64c9fd.patch",
"lavamoat-core@^14.2.0": "patch:lavamoat-core@npm%3A14.2.0#./.yarn/patches/lavamoat-core-npm-14.2.0-c453f4f755.patch"
},
"dependencies": {
"@babel/runtime": "^7.18.9",
@ -217,7 +219,7 @@
"@material-ui/core": "^4.11.0",
"@metamask-institutional/custody-controller": "0.2.6",
"@metamask-institutional/custody-keyring": "^0.0.25",
"@metamask-institutional/extension": "^0.1.3",
"@metamask-institutional/extension": "^0.1.6",
"@metamask-institutional/institutional-features": "^1.1.8",
"@metamask-institutional/portfolio-dashboard": "^1.1.3",
"@metamask-institutional/rpc-allowlist": "^1.0.0",
@ -225,7 +227,7 @@
"@metamask-institutional/transaction-update": "^0.1.21",
"@metamask/address-book-controller": "^3.0.0",
"@metamask/announcement-controller": "^4.0.0",
"@metamask/approval-controller": "^3.3.0",
"@metamask/approval-controller": "^3.4.0",
"@metamask/assets-controllers": "^9.2.0",
"@metamask/base-controller": "^3.1.0",
"@metamask/browser-passworder": "^4.1.0",
@ -252,21 +254,22 @@
"@metamask/permission-controller": "^4.0.0",
"@metamask/phishing-controller": "^3.0.0",
"@metamask/post-message-stream": "^6.0.0",
"@metamask/ppom-validator": "^0.0.1",
"@metamask/providers": "^11.1.0",
"@metamask/rate-limit-controller": "^3.0.0",
"@metamask/rpc-methods": "^1.0.0-prerelease.1",
"@metamask/rpc-methods-flask": "npm:@metamask/rpc-methods@0.35.2-flask.1",
"@metamask/rpc-methods-flask": "npm:@metamask/rpc-methods@0.36.1-flask.1",
"@metamask/safe-event-emitter": "^2.0.0",
"@metamask/scure-bip39": "^2.0.3",
"@metamask/signature-controller": "^4.0.1",
"@metamask/slip44": "^3.0.0",
"@metamask/smart-transactions-controller": "^3.1.0",
"@metamask/snaps-controllers": "^1.0.0-prerelease.1",
"@metamask/snaps-controllers-flask": "npm:@metamask/snaps-controllers@0.35.2-flask.1",
"@metamask/snaps-controllers-flask": "npm:@metamask/snaps-controllers@0.36.1-flask.1",
"@metamask/snaps-ui": "^1.0.0-prerelease.1",
"@metamask/snaps-ui-flask": "npm:@metamask/snaps-ui@0.35.2-flask.1",
"@metamask/snaps-ui-flask": "npm:@metamask/snaps-ui@0.36.1-flask.1",
"@metamask/snaps-utils": "^1.0.0-prerelease.1",
"@metamask/snaps-utils-flask": "npm:@metamask/snaps-utils@0.35.2-flask.1",
"@metamask/snaps-utils-flask": "npm:@metamask/snaps-utils@0.36.1-flask.1",
"@metamask/subject-metadata-controller": "^2.0.0",
"@metamask/utils": "^5.0.0",
"@ngraveio/bc-ur": "^1.1.6",
@ -463,6 +466,7 @@
"eslint-plugin-react": "^7.23.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-storybook": "^0.6.12",
"fake-indexeddb": "^4.0.1",
"fancy-log": "^1.3.3",
"fast-glob": "^3.2.2",
"fs-extra": "^8.1.0",
@ -492,7 +496,7 @@
"jest-canvas-mock": "^2.3.1",
"jest-environment-jsdom": "^29.1.2",
"js-yaml": "^4.1.0",
"jsdom": "^11.2.0",
"jsdom": "^16.7.0",
"junit-report-merger": "^4.0.0",
"koa": "^2.7.0",
"lavamoat": "^7.1.0",

View File

@ -174,8 +174,7 @@ 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 BNB_DISPLAY_NAME = 'BNB Chain';
export const OPTIMISM_DISPLAY_NAME = 'Optimism';
export const FANTOM_DISPLAY_NAME = 'Fantom Opera';
export const HARMONY_DISPLAY_NAME = 'Harmony Mainnet Shard 0';

View File

@ -29,3 +29,5 @@ export const ExcludedSnapEndowments = Object.freeze({
'endowment:long-running is deprecated. For more information please see https://github.com/MetaMask/snaps-monorepo/issues/945.',
///: END:ONLY_INCLUDE_IN
});
export const DynamicSnapPermissions = Object.freeze(['eth_accounts']);

View File

@ -105,7 +105,9 @@ async function withFixtures(options, testSuite) {
});
}
}
const mockedEndpoint = await setupMocking(mockServer, testSpecificMock);
const mockedEndpoint = await setupMocking(mockServer, testSpecificMock, {
chainId: ganacheOptions?.chainId || 1337,
});
await mockServer.start(8000);
driver = (await buildWebDriver(driverOptions)).driver;
@ -690,12 +692,6 @@ function generateRandNumBetween(x, y) {
return randomNumber;
}
async function switchToWindow(driver, windowTitle) {
const windowHandles = await driver.getAllWindowHandles();
return await driver.switchToWindowWithTitle(windowTitle, windowHandles);
}
async function sleepSeconds(sec) {
return new Promise((resolve) => setTimeout(resolve, sec * 1000));
}
@ -712,7 +708,8 @@ async function terminateServiceWorker(driver) {
tag: 'button',
});
const serviceWorkerElements = await driver.findElements({
await driver.delay(tinyDelayMs);
const serviceWorkerElements = await driver.findClickableElements({
text: 'terminate',
tag: 'span',
});
@ -720,8 +717,7 @@ async function terminateServiceWorker(driver) {
// 1st one is app-init.js; while 2nd one is service-worker.js
await serviceWorkerElements[serviceWorkerElements.length - 1].click();
const serviceWorkerTab = await switchToWindow(
driver,
const serviceWorkerTab = await driver.switchToWindowWithTitle(
WINDOW_TITLES.ServiceWorkerSettings,
);
@ -808,7 +804,6 @@ module.exports = {
generateETHBalance,
roundToXDecimalPlaces,
generateRandNumBetween,
switchToWindow,
sleepSeconds,
terminateServiceWorker,
switchToNotificationWindow,

View File

@ -291,13 +291,12 @@ describe('MetaMask', function () {
it('transitions to the confirm screen', async function () {
// Continue to next screen
await driver.delay(largeDelayMs);
await driver.waitForElementNotPresent('.loading-overlay');
await driver.clickElement({ text: 'Next', tag: 'button' });
await driver.delay(largeDelayMs);
});
it('displays the token transfer data', async function () {
await driver.delay(largeDelayMs);
await driver.waitForElementNotPresent('.loading-overlay');
await driver.clickElement({ text: 'Hex', tag: 'button' });
await driver.delay(regularDelayMs);
@ -340,12 +339,12 @@ describe('MetaMask', function () {
it('finds the transaction in the transactions list', async function () {
await driver.waitForSelector({
css: '.transaction-list__completed-transactions .transaction-list-item__primary-currency',
css: '.transaction-list__completed-transactions [data-testid="transaction-list-item-primary-currency"]',
text: '-1 TST',
});
await driver.waitForSelector({
css: '.list-item__heading',
css: '[data-testid="activity-list-item-action"]',
text: 'Send TST',
});
});
@ -371,10 +370,12 @@ describe('MetaMask', function () {
await driver.findElements('.transaction-list__pending-transactions');
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
css: '[data-testid="transaction-list-item-primary-currency"]',
text: '-1.5 TST',
});
await driver.clickElement('.transaction-list-item__primary-currency');
await driver.clickElement(
'[data-testid="transaction-list-item-primary-currency"]',
);
await driver.delay(regularDelayMs);
const transactionAmounts = await driver.findElements(
@ -416,12 +417,12 @@ describe('MetaMask', function () {
it('finds the transaction in the transactions list', async function () {
await driver.waitForSelector({
css: '.transaction-list__completed-transactions .transaction-list-item__primary-currency',
css: '.transaction-list__completed-transactions [data-testid="transaction-list-item-primary-currency"]',
text: '-1.5 TST',
});
await driver.waitForSelector({
css: '.list-item__heading',
css: '[data-testid="activity-list-item-action"]',
text: 'Send TST',
});
});
@ -463,25 +464,25 @@ describe('MetaMask', function () {
});
await driver.switchToWindow(extension);
await driver.delay(regularDelayMs);
await driver.delay(veryLargeDelayMs);
await driver.wait(async () => {
const pendingTxes = await driver.findElements(
'.transaction-list__pending-transactions .transaction-list-item',
'.transaction-list__pending-transactions .activity-list-item',
);
return pendingTxes.length === 1;
}, 10000);
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
css: '[data-testid="transaction-list-item-primary-currency"]',
text: '-1.5 TST',
});
await driver.clickElement('.transaction-list-item');
await driver.clickElement('.activity-list-item');
await driver.delay(regularDelayMs);
});
it('submits the transaction', async function () {
await driver.delay(largeDelayMs * 2);
await driver.waitForElementNotPresent('.loading-overlay');
await driver.clickElement({ text: 'Confirm', tag: 'button' });
await driver.delay(largeDelayMs * 2);
});
@ -490,12 +491,12 @@ describe('MetaMask', function () {
await driver.waitForSelector({
// Select the heading of the first transaction list item in the
// completed transaction list with text matching Send TST
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
css: '.transaction-list__completed-transactions .activity-list-item [data-testid="activity-list-item-action"]',
text: 'Send TST',
});
await driver.waitForSelector({
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .transaction-list-item__primary-currency',
css: '.transaction-list__completed-transactions .activity-list-item [data-testid="transaction-list-item-primary-currency"]',
text: '-1.5 TST',
});
});

View File

@ -0,0 +1,326 @@
/* eslint-disable no-useless-escape */
const { strict: assert } = require('assert');
const {
defaultGanacheOptions,
withFixtures,
unlockWallet,
sendTransaction,
getEventPayloads,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
/**
* mocks the segment api multiple times for specific payloads that we expect to
* see when these tests are run. In this case we are looking for
* 'Transaction Submitted' and 'Transaction Finalized'. In addition on the
* first event of each series we require a field that should only appear in the
* anonymized events so that we can guarantee order of seenRequests and can
* properly make assertions. Do not use the constants from the metrics
* constants files, because if these change we want a strong indicator to our
* data team that the shape of data will change.
*
* @param {import('mockttp').Mockttp} mockServer
* @returns {Promise<import('mockttp/dist/pluggable-admin').MockttpClientResponse>[]}
*/
async function mockSegment(mockServer) {
return [
await mockServer
.forPost('https://api.segment.io/v1/batch')
.withJsonBodyIncluding({
batch: [
{
type: 'track',
event: 'Transaction Submitted',
properties: { status: 'submitted' },
},
],
})
.thenCallback(() => {
return {
statusCode: 200,
};
}),
await mockServer
.forPost('https://api.segment.io/v1/batch')
.withJsonBodyIncluding({
batch: [
{
type: 'track',
event: 'Transaction Submitted',
},
],
})
.thenCallback(() => {
return {
statusCode: 200,
};
}),
await mockServer
.forPost('https://api.segment.io/v1/batch')
.withJsonBodyIncluding({
batch: [
{
type: 'track',
event: 'Transaction Finalized',
properties: { status: 'confirmed' },
},
],
})
.thenCallback(() => {
return {
statusCode: 200,
};
}),
await mockServer
.forPost('https://api.segment.io/v1/batch')
.withJsonBodyIncluding({
batch: [
{
type: 'track',
event: 'Transaction Finalized',
},
],
})
.thenCallback(() => {
return {
statusCode: 200,
};
}),
];
}
const RECIPIENT = '0x0Cc5261AB8cE458dc977078A3623E2BaDD27afD3';
describe('Transaction Finalized Event', function () {
it('Successfully tracked when sending a transaction', async function () {
await withFixtures(
{
fixtures: new FixtureBuilder()
.withMetaMetricsController({
metaMetricsId: 'fake-metrics-id',
participateInMetaMetrics: true,
})
.build(),
ganacheOptions: defaultGanacheOptions,
title: this.test.title,
testSpecificMock: mockSegment,
},
async ({ driver, mockedEndpoint: mockedEndpoints }) => {
await driver.navigate();
await unlockWallet(driver);
await sendTransaction(driver, RECIPIENT, '2.0');
const events = await getEventPayloads(driver, mockedEndpoints);
// The order of these events is ensured by the mockSegment function
// which requires that the first, and third (0, 2 indexes) have the
// status property, which will only appear on the anonymous events.
const transactionSubmittedNoMMId = events[0];
const transactionSubmittedWithMMId = events[1];
const transactionFinalizedNoMMId = events[2];
const transactionFinalizedWithMMId = events[3];
// Assert doesn't have generic matchers so we delete these timestamp related properties.
// If we switch to a different assertion library we can use generic matchers in the future.
delete transactionSubmittedNoMMId.properties.first_seen;
delete transactionFinalizedNoMMId.properties.first_seen;
delete transactionFinalizedNoMMId.properties.completion_time;
// Assert that the event names begin with the appropriate prefixes. Even finalized events begin with transaction-submitted
// because they start as event fragments created when the transaction is submitted.
assert.ok(
transactionSubmittedNoMMId.messageId.startsWith(
'transaction-submitted',
),
`Transaction Submitted event with sensitive properties has messageId \"${transactionSubmittedNoMMId.messageId}\" does not have a messageId beginning with \"transaction-submitted\"`,
);
assert.ok(
transactionFinalizedNoMMId.messageId.startsWith(
'transaction-submitted',
),
`Transaction Finalized event with sensitive properties has messageId \"${transactionFinalizedNoMMId.messageId}\" that does not begin with \"transaction-submitted\"`,
);
assert.ok(
transactionSubmittedWithMMId.messageId.startsWith(
'transaction-submitted',
),
`Transaction Submitted event has messageId \"${transactionSubmittedWithMMId.messageId}\" that does not begin with \"transaction-submitted\"`,
);
assert.ok(
transactionFinalizedWithMMId.messageId.startsWith(
'transaction-submitted',
),
`Transaction Finalized event has messageID \"${transactionFinalizedWithMMId.messageId}\" that does not begin with \"transaction-submitted\"`,
);
// Assert that the events with sensitive properties should have messageIds ending in 0x000
// This is important because otherwise the events are seen as duplicates in segment
assert.ok(
transactionSubmittedNoMMId.messageId.endsWith('0x000'),
`Transaction Submitted event with sensitive properties has messageId \"${transactionSubmittedNoMMId.messageId}\" that does not end in \"0x000\" to differentiate it from the event that does not include sensitive data.`,
);
assert.ok(
transactionFinalizedNoMMId.messageId.endsWith('0x000'),
`Transaction Finalized event with sensitive properties has messageID \"${transactionFinalizedNoMMId.messageId}\" that does not end in \"0x000\" to differentiate it from the event that does not include sensitive data.`,
);
// Assert that transaction finalized events contain '-success-' in their messageId
assert.ok(
transactionFinalizedWithMMId.messageId.includes('-success-'),
`Transaction Finalized event has messageId \"${transactionFinalizedWithMMId.messageId}\" that does not contain "-success-"`,
);
assert.ok(
transactionFinalizedNoMMId.messageId.includes('-success-'),
`Transaction Finalized event with sensitive properties has messageID \"${transactionFinalizedNoMMId.messageId}\" that does not contain "-success-"`,
);
// Assert that the events with sensitive data do not contain a userId (the random anonymous id generated when a user opts into metametrics)
assert.ok(
typeof transactionSubmittedNoMMId.userId === 'undefined',
'Transaction Submitted event with sensitive properties has a userId supplied when it should only have the anonymousId',
);
assert.ok(
typeof transactionFinalizedNoMMId.userId === 'undefined',
'Transaction Finalized event with sensitive properties has a userId supplied when it should only have the anonymousId',
);
// Assert that the events with sensitive data have anonymousId set to 0x0000000000000000 which is our universal anonymous record
assert.ok(
transactionSubmittedNoMMId.anonymousId === '0x0000000000000000',
'Transaction Submitted event with sensitive properties has an anonymousId that does not match our universal anonymous id of 0x0000000000000000',
);
assert.ok(
transactionFinalizedNoMMId.anonymousId === '0x0000000000000000',
'Transaction Finalized event with sensitive properties has an anonymousId that does not match our universal anonymous id of 0x0000000000000000',
);
// Assert that our events without sensitive data have a userId but no anonymousId
assert.ok(
typeof transactionSubmittedWithMMId.userId === 'string' &&
typeof transactionSubmittedWithMMId.anonymousId === 'undefined',
'Transaction Submitted event without sensitive properties should only have a userId specified, and no anonymousId',
);
assert.ok(
typeof transactionFinalizedWithMMId.userId === 'string' &&
typeof transactionFinalizedWithMMId.anonymousId === 'undefined',
'Transaction Finalized event without sensitive properties should only have a userId specified, and no anonymousId',
);
// Assert on the properties
assert.deepStrictEqual(
transactionSubmittedNoMMId.properties,
{
status: 'submitted',
transaction_envelope_type: 'legacy',
gas_limit: '0x5208',
gas_price: '2',
default_gas: '0.000021',
default_gas_price: '2',
chain_id: '0x539',
referrer: 'metamask',
source: 'user',
network: '1337',
eip_1559_version: '0',
gas_edit_type: 'none',
gas_edit_attempted: 'none',
account_type: 'MetaMask',
device_model: 'N/A',
asset_type: 'NATIVE',
token_standard: 'NONE',
transaction_type: 'simpleSend',
transaction_speed_up: false,
ui_customizations: null,
category: 'Transactions',
locale: 'en',
environment_type: 'background',
},
'Transaction Submitted event with sensitive properties does not match the expected payload',
);
assert.deepStrictEqual(
transactionSubmittedWithMMId.properties,
{
chain_id: '0x539',
referrer: 'metamask',
source: 'user',
network: '1337',
eip_1559_version: '0',
gas_edit_type: 'none',
gas_edit_attempted: 'none',
account_type: 'MetaMask',
device_model: 'N/A',
asset_type: 'NATIVE',
token_standard: 'NONE',
transaction_type: 'simpleSend',
transaction_speed_up: false,
ui_customizations: null,
category: 'Transactions',
locale: 'en',
environment_type: 'background',
},
'Transaction Submitted event without sensitive properties does not match the expected payload',
);
assert.deepStrictEqual(
transactionFinalizedNoMMId.properties,
{
status: 'confirmed',
transaction_envelope_type: 'legacy',
gas_limit: '0x5208',
gas_price: '2',
default_gas: '0.000021',
default_gas_price: '2',
chain_id: '0x539',
referrer: 'metamask',
source: 'user',
network: '1337',
eip_1559_version: '0',
gas_edit_type: 'none',
gas_edit_attempted: 'none',
account_type: 'MetaMask',
device_model: 'N/A',
asset_type: 'NATIVE',
token_standard: 'NONE',
transaction_type: 'simpleSend',
transaction_speed_up: false,
ui_customizations: null,
gas_used: '5208',
category: 'Transactions',
locale: 'en',
environment_type: 'background',
},
'Transaction Finalized event with sensitive properties does not match the expected payload',
);
assert.deepStrictEqual(
transactionFinalizedWithMMId.properties,
{
chain_id: '0x539',
referrer: 'metamask',
source: 'user',
network: '1337',
eip_1559_version: '0',
gas_edit_type: 'none',
gas_edit_attempted: 'none',
account_type: 'MetaMask',
device_model: 'N/A',
asset_type: 'NATIVE',
token_standard: 'NONE',
transaction_type: 'simpleSend',
transaction_speed_up: false,
ui_customizations: null,
category: 'Transactions',
locale: 'en',
environment_type: 'background',
},
'Transaction Finalized event without sensitive properties does not match the expected payload',
);
},
);
});
});

View File

@ -20,7 +20,16 @@ const emptyStalelist = {
lastUpdated: 0,
};
async function setupMocking(server, testSpecificMock) {
/**
* Setup E2E network mocks.
*
* @param {object} server - The mock server used for network mocks.
* @param {Function} testSpecificMock - A function for setting up test-specific network mocks
* @param {object} options - Network mock options.
* @param {string} options.chainId - The chain ID used by the default configured network.
* @returns
*/
async function setupMocking(server, testSpecificMock, { chainId }) {
await server.forAnyRequest().thenPassThrough({
beforeRequest: (req) => {
const { host } = req.headers;
@ -99,7 +108,9 @@ async function setupMocking(server, testSpecificMock) {
});
await server
.forGet('https://gas-api.metaswap.codefi.network/networks/1337/gasPrices')
.forGet(
`https://gas-api.metaswap.codefi.network/networks/${chainId}/gasPrices`,
)
.thenCallback(() => {
return {
statusCode: 200,
@ -130,7 +141,7 @@ async function setupMocking(server, testSpecificMock) {
await server
.forGet(
'https://gas-api.metaswap.codefi.network/networks/1337/suggestedGasFees',
`https://gas-api.metaswap.codefi.network/networks/${chainId}/suggestedGasFees`,
)
.thenCallback(() => {
return {
@ -203,7 +214,7 @@ async function setupMocking(server, testSpecificMock) {
});
await server
.forGet('https://token-api.metaswap.codefi.network/tokens/1337')
.forGet(`https://token-api.metaswap.codefi.network/tokens/${chainId}`)
.thenCallback(() => {
return {
statusCode: 200,
@ -343,7 +354,7 @@ async function setupMocking(server, testSpecificMock) {
});
await server
.forGet('https://token-api.metaswap.codefi.network/token/1337')
.forGet(`https://token-api.metaswap.codefi.network/token/${chainId}`)
.thenCallback(() => {
return {
statusCode: 200,
@ -352,15 +363,15 @@ async function setupMocking(server, testSpecificMock) {
});
// It disables loading of token icons, e.g. this URL: https://static.metafi.codefi.network/api/v1/tokenIcons/1337/0x0000000000000000000000000000000000000000.png
await server
.forGet(
/^https:\/\/static\.metafi\.codefi\.network\/api\/v1\/tokenIcons\/1337\/.*\.png/u,
)
.thenCallback(() => {
return {
statusCode: 200,
};
});
const tokenIconRegex = new RegExp(
`^https:\\/\\/static\\.metafi\\.codefi\\.network\\/api\\/vi\\/tokenIcons\\/${chainId}\\/.*\\.png`,
'u',
);
await server.forGet(tokenIconRegex).thenCallback(() => {
return {
statusCode: 200,
};
});
await server
.forGet('https://min-api.cryptocompare.com/data/price')

View File

@ -9,10 +9,10 @@ const {
generateETHBalance,
roundToXDecimalPlaces,
generateRandNumBetween,
switchToWindow,
sleepSeconds,
terminateServiceWorker,
unlockWallet,
largeDelayMs,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
@ -114,7 +114,9 @@ describe('MV3 - Restart service worker multiple times', function () {
);
async function simpleSendETH(driver, value, recipient) {
await switchToWindow(driver, WINDOW_TITLES.ExtensionInFullScreenView);
await driver.switchToWindowWithTitle(
WINDOW_TITLES.ExtensionInFullScreenView,
);
await driver.clickElement('[data-testid="eth-overview-send"]');
await driver.fill('[data-testid="ens-input"]', recipient);
@ -130,7 +132,7 @@ describe('MV3 - Restart service worker multiple times', function () {
await driver.clickElement('[data-testid="page-container-footer-next"]');
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.findElement('.transaction-list-item');
await driver.findElement('.activity-list-item');
// reset view to assets tab
await driver.clickElement('[data-testid="home__asset-tab"]');
@ -138,7 +140,9 @@ describe('MV3 - Restart service worker multiple times', function () {
}
async function assertETHBalance(driver, expectedBalance) {
await switchToWindow(driver, WINDOW_TITLES.ExtensionInFullScreenView);
await driver.switchToWindowWithTitle(
WINDOW_TITLES.ExtensionInFullScreenView,
);
const isETHBalanceOverviewPresentAndVisible =
await driver.isElementPresentAndVisible({
@ -175,12 +179,11 @@ describe('MV3 - Restart service worker multiple times', function () {
await openDapp(driver);
// Click add Ethereum chain
await switchToWindow(driver, WINDOW_TITLES.TestDApp);
await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp);
await driver.clickElement('#addEthereumChain');
await driver.waitUntilXWindowHandles(2);
// Notification pop up opens
await switchToWindow(driver, WINDOW_TITLES.Notification);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Notification);
let notification = await driver.isElementPresent({
text: 'Allow this site to add a network?',
tag: 'h3',
@ -189,19 +192,18 @@ describe('MV3 - Restart service worker multiple times', function () {
// Cancel Notification
await driver.clickElement({ text: 'Cancel', tag: 'button' });
await driver.waitUntilXWindowHandles(2);
// Terminate Service Worker
await switchToWindow(driver, WINDOW_TITLES.TestDApp);
await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp);
await terminateServiceWorker(driver);
// Click add Ethereum chain #2
await switchToWindow(driver, WINDOW_TITLES.TestDApp);
await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp);
await driver.clickElement('#addEthereumChain');
await driver.waitUntilXWindowHandles(2);
// Notification pop up opens
await switchToWindow(driver, WINDOW_TITLES.Notification);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Notification);
notification = await driver.isElementPresent({
text: 'Allow this site to add a network?',
tag: 'h3',
@ -210,19 +212,17 @@ describe('MV3 - Restart service worker multiple times', function () {
// Cancel Notification
await driver.clickElement({ text: 'Cancel', tag: 'button' });
await driver.waitUntilXWindowHandles(2);
// Terminate Service Worker
await switchToWindow(driver, WINDOW_TITLES.TestDApp);
await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp);
await terminateServiceWorker(driver);
// Click add Ethereum chain #3
await switchToWindow(driver, WINDOW_TITLES.TestDApp);
await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp);
await driver.clickElement('#addEthereumChain');
await driver.waitUntilXWindowHandles(2);
// Notification pop up opens
await switchToWindow(driver, WINDOW_TITLES.Notification);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Notification);
notification = await driver.isElementPresent({
text: 'Allow this site to add a network?',
tag: 'h3',
@ -232,7 +232,6 @@ describe('MV3 - Restart service worker multiple times', function () {
// Accept Notification
await driver.clickElement({ text: 'Approve', tag: 'button' });
await driver.clickElement({ text: 'Switch network', tag: 'button' });
await driver.waitUntilXWindowHandles(2);
},
);
});
@ -257,21 +256,20 @@ describe('MV3 - Restart service worker multiple times', function () {
await openDapp(driver);
await clickSendButton(driver);
await driver.waitUntilXWindowHandles(2);
await switchToWindow(driver, WINDOW_TITLES.TestDApp);
await terminateServiceWorker(driver);
await driver.waitUntilXWindowHandles(2);
await driver.delay(largeDelayMs);
await clickSendButton(driver);
await driver.waitUntilXWindowHandles(2);
await switchToWindow(driver, WINDOW_TITLES.TestDApp);
await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp);
await terminateServiceWorker(driver);
await clickSendButton(driver);
await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp);
await terminateServiceWorker(driver);
await clickSendButton(driver);
await driver.waitUntilXWindowHandles(2);
await assertNumberOfTransactionsInPopUp(driver, 3);
@ -287,7 +285,7 @@ describe('MV3 - Restart service worker multiple times', function () {
async function clickSendButton(driver) {
// Click send button
await switchToWindow(driver, WINDOW_TITLES.TestDApp);
await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp);
await driver.waitForSelector({
css: '#sendButton',
@ -297,7 +295,7 @@ describe('MV3 - Restart service worker multiple times', function () {
}
async function confirmETHSendNotification(driver, amount) {
await switchToWindow(driver, WINDOW_TITLES.Notification);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Notification);
await driver.clickElement({
text: 'Edit',
@ -318,14 +316,16 @@ describe('MV3 - Restart service worker multiple times', function () {
}
async function assertNumberOfTransactionsInPopUp(driver, number) {
await switchToWindow(driver, WINDOW_TITLES.Notification);
const navEl = await driver.findElement(
'.confirm-page-container-navigation__navtext',
);
await driver.delay(largeDelayMs);
const notificationProgress = await navEl.getText();
await driver.switchToWindowWithTitle(WINDOW_TITLES.Notification);
assert.ok(notificationProgress, `1 of ${number}`);
const foundElement = await driver.findElements({
css: '.confirm-page-container-navigation__navtext',
text: `1 of ${number}`,
});
assert.ok(foundElement, true);
}
});
@ -365,7 +365,9 @@ describe('MV3 - Restart service worker multiple times', function () {
);
async function reloadExtension(driver, extensionId) {
await switchToWindow(driver, WINDOW_TITLES.ExtensionInFullScreenView);
await driver.switchToWindowWithTitle(
WINDOW_TITLES.ExtensionInFullScreenView,
);
await driver.openNewPage('chrome://extensions/');

View File

@ -66,7 +66,7 @@ describe('ERC1155 NFTs testdapp interaction', function () {
await driver.switchToWindow(extension);
await driver.clickElement('[data-testid="home__activity-tab"]');
const transactionItem = await driver.waitForSelector({
css: '.list-item__title',
css: '[data-testid="activity-list-item-action"]',
text: 'Deposit',
});
assert.equal(
@ -120,7 +120,7 @@ describe('ERC1155 NFTs testdapp interaction', function () {
await driver.switchToWindow(extension);
await driver.clickElement('[data-testid="home__activity-tab"]');
const transactionItem = await driver.waitForSelector({
css: '.list-item__title',
css: '[data-testid="activity-list-item-action"]',
text: 'Deposit',
});
assert.equal(

View File

@ -58,7 +58,7 @@ describe('ERC721 NFTs testdapp interaction', function () {
await driver.switchToWindow(extension);
await driver.clickElement('[data-testid="home__activity-tab"]');
const transactionItem = await driver.waitForSelector({
css: '.list-item__title',
css: '[data-testid="activity-list-item-action"]',
text: 'Deposit',
});
assert.equal(await transactionItem.isDisplayed(), true);
@ -169,7 +169,7 @@ describe('ERC721 NFTs testdapp interaction', function () {
await driver.switchToWindow(extension);
await driver.clickElement('[data-testid="home__activity-tab"]');
const transactionItem = await driver.waitForSelector({
css: '.list-item__title',
css: '[data-testid="activity-list-item-action"]',
text: 'Deposit',
});
assert.equal(await transactionItem.isDisplayed(), true);
@ -266,7 +266,7 @@ describe('ERC721 NFTs testdapp interaction', function () {
await driver.switchToWindow(extension);
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
'.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)',
);
// Verify transaction
@ -339,7 +339,7 @@ describe('ERC721 NFTs testdapp interaction', function () {
// Verify transaction
const completedTx = await driver.waitForSelector({
css: '.list-item__title',
css: '[data-testid="activity-list-item-action"]',
text: 'Approve TDN spending cap',
});
assert.equal(await completedTx.isDisplayed(), true);
@ -405,12 +405,12 @@ describe('ERC721 NFTs testdapp interaction', function () {
await driver.switchToWindow(extension);
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
'.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)',
);
// Verify transaction
const completedTx = await driver.waitForSelector({
css: '.list-item__title',
css: '[data-testid="activity-list-item-action"]',
text: 'Approve TDN with no spend limit',
});
assert.equal(await completedTx.isDisplayed(), true);
@ -484,7 +484,7 @@ describe('ERC721 NFTs testdapp interaction', function () {
// Verify transaction
const completedTx = await driver.waitForSelector({
css: '.list-item__title',
css: '[data-testid="activity-list-item-action"]',
text: 'Approve TDN with no spend limit',
});
assert.equal(await completedTx.isDisplayed(), true);

View File

@ -38,9 +38,11 @@ describe('Import ERC1155 NFT', function () {
await driver.clickElement({ text: 'Import NFT', tag: 'button' });
// Enter a valid NFT that belongs to user and check success message appears
await driver.fill('[data-testid="address"]', contractAddress);
await driver.fill('[data-testid="token-id"]', '1');
await driver.clickElement({ text: 'Add', tag: 'button' });
await driver.fill('#address', contractAddress);
await driver.fill('#token-id', '1');
await driver.clickElement(
'[data-testid="import-nfts-modal-import-button"]',
);
const newNftNotification = await driver.findVisibleElement({
text: 'NFT was successfully added!',
@ -86,14 +88,15 @@ describe('Import ERC1155 NFT', function () {
await driver.clickElement({ text: 'Import NFT', tag: 'button' });
// Enter an NFT that not belongs to user with a valid address and an invalid token id
await driver.fill('[data-testid="address"]', contractAddress);
await driver.fill('[data-testid="token-id"]', '4');
await driver.clickElement({ text: 'Add', tag: 'button' });
await driver.fill('#address', contractAddress);
await driver.fill('#token-id', '4');
await driver.clickElement(
'[data-testid="import-nfts-modal-import-button"]',
);
// Check error message appears
const invalidNftNotification = await driver.findElement({
text: 'NFT cant be added as the ownership details do not match. Make sure you have entered correct information.',
tag: 'h6',
tag: 'p',
});
assert.equal(await invalidNftNotification.isDisplayed(), true);
},

View File

@ -38,9 +38,11 @@ describe('Import NFT', function () {
await driver.clickElement({ text: 'Import NFT', tag: 'button' });
// Enter a valid NFT that belongs to user and check success message appears
await driver.fill('[data-testid="address"]', contractAddress);
await driver.fill('[data-testid="token-id"]', '1');
await driver.clickElement({ text: 'Add', tag: 'button' });
await driver.fill('#address', contractAddress);
await driver.fill('#token-id', '1');
await driver.clickElement(
'[data-testid="import-nfts-modal-import-button"]',
);
const newNftNotification = await driver.findElement({
text: 'NFT was successfully added!',
@ -85,14 +87,16 @@ describe('Import NFT', function () {
await driver.clickElement({ text: 'Import NFT', tag: 'button' });
// Enter an NFT that not belongs to user with a valid address and an invalid token id
await driver.fill('[data-testid="address"]', contractAddress);
await driver.fill('[data-testid="token-id"]', '2');
await driver.clickElement({ text: 'Add', tag: 'button' });
await driver.fill('#address', contractAddress);
await driver.fill('#token-id', '2');
await driver.clickElement(
'[data-testid="import-nfts-modal-import-button"]',
);
// Check error message appears
const invalidNftNotification = await driver.findElement({
text: 'NFT cant be added as the ownership details do not match. Make sure you have entered correct information.',
tag: 'h6',
tag: 'p',
});
assert.equal(await invalidNftNotification.isDisplayed(), true);
},

View File

@ -64,13 +64,13 @@ describe('Send NFT', function () {
// When transaction complete, check the send NFT is displayed in activity tab
await driver.wait(async () => {
const confirmedTxes = await driver.findElements(
'.transaction-list__completed-transactions .transaction-list-item',
'.transaction-list__completed-transactions .activity-list-item',
);
return confirmedTxes.length === 1;
}, 10000);
const sendNftItem = await driver.findElement({
css: 'h2',
css: '[data-testid="activity-list-item-action"]',
text: 'Send Test Dapp NFTs',
});
assert.equal(await sendNftItem.isDisplayed(), true);

View File

@ -31,6 +31,11 @@ async function main() {
'Set how many times the test should be retried upon failure.',
type: 'number',
})
.option('retry-until-failure', {
default: false,
description: 'Retries until the test fails',
type: 'boolean',
})
.option('leave-running', {
default: false,
description:
@ -46,7 +51,14 @@ async function main() {
.strict()
.help('help');
const { browser, debug, e2eTestPath, retries, leaveRunning } = argv;
const {
browser,
debug,
e2eTestPath,
retries,
retryUntilFailure,
leaveRunning,
} = argv;
if (!browser) {
exitWithError(
@ -97,7 +109,7 @@ async function main() {
const dir = 'test/test-results/e2e';
fs.mkdir(dir, { recursive: true });
await retry({ retries }, async () => {
await retry({ retries, retryUntilFailure }, async () => {
await runInShell(
'yarn',
[

View File

@ -122,10 +122,10 @@ const waitForTransactionToComplete = async (driver, options) => {
const checkActivityTransaction = async (driver, options) => {
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector('[data-testid="list-item-title"]');
await driver.waitForSelector('.activity-list-item');
const transactionList = await driver.findElements(
'[data-testid="list-item-title"]',
'[data-testid="activity-list-item-action"]',
);
const transactionText = await transactionList[options.index].getText();
assert.equal(
@ -135,7 +135,7 @@ const checkActivityTransaction = async (driver, options) => {
);
await driver.findElement({
css: '[data-testid="list-item-right-content"]',
css: '[data-testid="transaction-list-item-primary-currency"]',
text: `-${options.amount} ${options.swapFrom}`,
});
@ -143,8 +143,8 @@ const checkActivityTransaction = async (driver, options) => {
await driver.delay(regularDelayMs);
await driver.findElement({
css: '[data-testid="transaction-list-item-details-tx-status"]',
text: `Confirmed`,
css: '.transaction-status-label',
text: 'Confirmed',
});
await driver.findElement({
@ -173,9 +173,7 @@ const checkNotification = async (driver, options) => {
};
const changeExchangeRate = async (driver) => {
await driver.clickElement(
'[data-testid="exchange-rate-display-base-symbol"]',
);
await driver.clickElement('[data-testid="review-quote-view-all-quotes"]');
await driver.waitForSelector({ text: 'Quote details', tag: 'h2' });
const networkFees = await driver.findElements(

View File

@ -62,13 +62,13 @@ describe('Address Book', function () {
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.wait(async () => {
const confirmedTxes = await driver.findElements(
'.transaction-list__completed-transactions .transaction-list-item',
'.transaction-list__completed-transactions .activity-list-item',
);
return confirmedTxes.length === 1;
}, 10000);
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
css: '[data-testid="transaction-list-item-primary-currency"]',
text: '-2 ETH',
});
},

View File

@ -35,11 +35,11 @@ describe('Clear account activity', function () {
// Check send transaction and receive transaction history are all displayed
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.waitForSelector({
css: '.list-item__title',
css: '[data-testid="activity-list-item-action"]',
text: 'Send',
});
await driver.waitForSelector({
css: '.list-item__title',
css: '[data-testid="activity-list-item-action"]',
text: 'Receive',
});
@ -58,11 +58,11 @@ describe('Clear account activity', function () {
// Check send transaction history is cleared and receive transaction history is kept
const sendTransaction = await driver.isElementPresent({
css: '.list-item__title',
css: '[data-testid="activity-list-item-action"]',
text: 'Send',
});
const receiveTransaction = await driver.isElementPresent({
css: '.list-item__title',
css: '[data-testid="activity-list-item-action"]',
text: 'Receive',
});
assert.equal(sendTransaction, false);

View File

@ -3,6 +3,9 @@ const {
withFixtures,
openDapp,
locateAccountBalanceDOM,
unlockWallet,
largeDelayMs,
WINDOW_TITLES,
} = require('../helpers');
const { SMART_CONTRACTS } = require('../seeder/smart-contracts');
const FixtureBuilder = require('../fixture-builder');
@ -34,65 +37,64 @@ describe('Deploy contract and call contract methods', function () {
smartContract,
);
await driver.navigate();
await driver.fill('#password', 'correct horse battery staple');
await driver.press('#password', driver.Key.ENTER);
await unlockWallet(driver);
// deploy contract
await openDapp(driver, contractAddress);
// wait for deployed contract, calls and confirms a contract method where ETH is sent
await driver.findClickableElement('#deployButton');
await driver.delay(largeDelayMs);
await driver.clickElement('#depositButton');
await driver.waitUntilXWindowHandles(3);
let windowHandles = await driver.getAllWindowHandles();
const extension = windowHandles[0];
const dapp = await driver.switchToWindowWithTitle(
'E2E Test Dapp',
windowHandles,
);
await driver.switchToWindowWithTitle(
'MetaMask Notification',
windowHandles,
);
await driver.waitForSelector({
css: 'span',
text: 'Deposit initiated',
});
await driver.waitUntilXWindowHandles(3);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Notification);
await driver.waitForSelector({
css: '.confirm-page-container-summary__action__name',
text: 'Deposit',
});
await driver.clickElement({ text: 'Confirm', tag: 'button' });
await driver.waitUntilXWindowHandles(2);
await driver.switchToWindow(extension);
await driver.switchToWindowWithTitle(
WINDOW_TITLES.ExtensionInFullScreenView,
);
await driver.clickElement({ text: 'Activity', tag: 'button' });
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',
'.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)',
);
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
css: '[data-testid="transaction-list-item-primary-currency"]',
text: '-4 ETH',
});
// calls and confirms a contract method where ETH is received
await driver.switchToWindow(dapp);
await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp);
await driver.clickElement('#withdrawButton');
await driver.waitUntilXWindowHandles(3);
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
'MetaMask Notification',
windowHandles,
);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Notification);
await driver.clickElement({ text: 'Confirm', tag: 'button' });
await driver.waitUntilXWindowHandles(2);
await driver.switchToWindow(extension);
await driver.switchToWindowWithTitle(
WINDOW_TITLES.ExtensionInFullScreenView,
);
await driver.waitForSelector(
'.transaction-list__completed-transactions .transaction-list-item:nth-of-type(2)',
'.transaction-list__completed-transactions .activity-list-item:nth-of-type(2)',
);
await driver.waitForSelector({
css: '.transaction-list-item__primary-currency',
css: '[data-testid="transaction-list-item-primary-currency"]',
text: '-0 ETH',
});
// renders the correct ETH balance
await driver.switchToWindow(extension);
await driver.switchToWindowWithTitle(
WINDOW_TITLES.ExtensionInFullScreenView,
);
await locateAccountBalanceDOM(driver, ganacheServer);
},
);

View File

@ -129,10 +129,6 @@ describe('Create token, approve token and approve token without gas', function (
text: 'Got it',
tag: 'button',
});
await driver.clickElement({
text: 'Use default',
css: '.mm-button-link',
});
await driver.clickElement({
text: 'View details',
css: '.token-allowance-container__view-details',
@ -157,17 +153,17 @@ describe('Create token, approve token and approve token without gas', function (
await driver.clickElement({ text: 'Next', tag: 'button' });
await driver.findElement({
text: 'Review the spending cap for your',
tag: 'div',
text: 'Spending cap request for your ',
css: '.box--flex-direction-row',
});
const defaultSpendingCup = await driver.findElement({
const defaultSpendingCap = await driver.findElement({
text: '7 TST',
css: '.box--flex-direction-row > h6',
});
assert.equal(
await defaultSpendingCup.getText(),
await defaultSpendingCap.getText(),
'7 TST',
'Default value is not correctly set',
);
@ -182,15 +178,13 @@ describe('Create token, approve token and approve token without gas', function (
// check list of pending transactions in extension
await driver.wait(async () => {
const pendingTxes = await driver.findElements(
'.transaction-list-item',
);
const pendingTxes = await driver.findElements('.activity-list-item');
return pendingTxes.length === 1;
}, 10000);
const approveTokenTask = await driver.waitForSelector({
// Selects only the very first transaction list item immediately following the 'Pending' header
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
css: '.transaction-list__completed-transactions .activity-list-item [data-testid="activity-list-item-action"]',
text: 'Approve TST spending cap',
});
assert.equal(
@ -253,13 +247,13 @@ describe('Create token, approve token and approve token without gas', function (
tag: 'button',
});
let spendingCup = await driver.findElement({
let spendingCap = await driver.findElement({
text: '5 TST',
css: '.box--flex-direction-row > h6',
});
assert.equal(
await spendingCup.getText(),
await spendingCap.getText(),
'5 TST',
'Default value is not correctly set',
);
@ -309,12 +303,12 @@ describe('Create token, approve token and approve token without gas', function (
tag: 'button',
});
spendingCup = await driver.findElement({
spendingCap = await driver.findElement({
text: '9 TST',
css: '.box--flex-direction-row > h6',
});
assert.equal(
await spendingCup.getText(),
await spendingCap.getText(),
'9 TST',
'Default value is not correctly set',
);
@ -327,14 +321,12 @@ describe('Create token, approve token and approve token without gas', function (
await driver.clickElement({ tag: 'button', text: 'Activity' });
await driver.wait(async () => {
const pendingTxes = await driver.findElements(
'.transaction-list-item',
);
const pendingTxes = await driver.findElements('.activity-list-item');
return pendingTxes.length === 1;
}, 10000);
const approveTokenTask = await driver.waitForSelector({
// Select only the heading of the first entry in the transaction list.
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
css: '.transaction-list__completed-transactions .activity-list-item [data-testid="activity-list-item-action"]',
text: 'Approve TST spending cap',
});
assert.equal(
@ -378,7 +370,7 @@ describe('Create token, approve token and approve token without gas', function (
await driver.clickElement({ tag: 'button', text: 'Activity' });
const pendingTxes = await driver.findElements(
'.transaction-list__pending-transactions .transaction-list-item',
'.transaction-list__pending-transactions .activity-list-item',
);
pendingTxes[0].click();
@ -418,7 +410,7 @@ describe('Create token, approve token and approve token without gas', function (
const approveTokenTask = await driver.waitForSelector({
// Select only the heading of the first entry in the transaction list.
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
css: '.transaction-list__completed-transactions .activity-list-item [data-testid="activity-list-item-action"]',
text: 'Approve TST spending cap',
});
assert.equal(
@ -429,7 +421,7 @@ describe('Create token, approve token and approve token without gas', function (
);
});
it('approves token without gas, set default spending cap, submits the transaction and finds the transaction in the transactions list', async function () {
it('approves token without gas, set site suggested spending cap, submits the transaction and finds the transaction in the transactions list', async function () {
await withFixtures(
{
dapp: true,
@ -463,11 +455,18 @@ describe('Create token, approve token and approve token without gas', function (
await driver.switchToWindow(extension);
await driver.clickElement({ tag: 'button', text: 'Activity' });
const pendingTxes = await driver.findElements('.transaction-list-item');
const pendingTxes = await driver.findElements('.activity-list-item');
pendingTxes[0].click();
// set spending cap
// set custom spending cap
const spendingCap = await driver.findElement(
'[data-testid="custom-spending-cap-input"]',
);
await spendingCap.fill('5');
// set site suggested spending cap
await driver.clickElement({
text: 'Use default',
text: 'Use site suggestion',
css: '.mm-button-link',
});
await driver.clickElement({
@ -480,7 +479,7 @@ describe('Create token, approve token and approve token without gas', function (
// check transaction in Activity tab
const approveTokenTask = await driver.waitForSelector({
css: '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',
css: '.transaction-list__completed-transactions .activity-list-item [data-testid="activity-list-item-action"]',
text: 'Approve TST spending cap',
});
assert.equal(

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