1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-21 17:37:01 +01:00
Commit Graph

5445 Commits

Author SHA1 Message Date
Albert Olivé
60f149178c
[MMI] Set approved status in tx controller in MMI logic (#20507)
* fix(custodial-signing): set approved status in tx controller in MMI logic

* Fixed the issue that was not showing custody-confirm-link

---------

Co-authored-by: Shane Terence Odlum <shane.odlum@consensys.net>
2023-08-18 14:38:51 +02:00
Mark Stacey
65c13d3490
Fix Sentry breadcrumbs collection during initialization (#20521)
* Fix Sentry MetaMetrics detection

The refactor of the Sentry state in #20491 accidentally broke our opt-
in detection. The opt-in detection has been updated to look for both
types of application state (during and after initialization).

* Continue suppressing breadcrumbs during onboarding

* Fix how onboarding status is retrieved

The check for whether the user had completed onboarding assumed that
the application state was post-initialization UI state. It has been
updated to handle background state and pre-initialization state as
well.

* Remove unnecessary optional chain operators

* Add missing optional chain operator

* Fix JSDoc description parameter type
2023-08-18 05:47:23 -02:30
Mark Stacey
4cf886f710
Initialize composable observable store after update (#20468)
* Initialize composable observable store after update

The composable observable store now updates state immediately when the
structure is updated. Previously each store would only be updated after
the first state change. This ensures that the composable observable
store state is always complete.

* SUpport falsy controller state

We now use the nullish coalescing operator when checkint store.state, so that we don't accidentally ignore falsy state.

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>

* Add test for falsy controller state

* Update state snapshots

A change on `develop` required another state update.

---------

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
2023-08-17 12:22:37 -02:30
Frederik Bolding
2529b360be
Track usage of snap exports (#20503)
* Track usage of snap exports

* Fix fencing

* Small change to event name

* Use MetaMetricsEventName
2023-08-17 16:13:40 +02:00
Albert Olivé
5e617ce808
[MMI] Fix signed messages from non custodial accounts (#20506)
* Alter behaviour in MMI controller to use the original code path for signed messages that are from non custodial accounts

* Improved readability

* Removed unused import

---------

Co-authored-by: Shane Terence Odlum <shane.odlum@consensys.net>
2023-08-17 14:58:26 +02:00
Albert Olivé
486ade85f3
[MMI] Fixed connect mmi button several issues (#20455)
* fixed connect mmi button several issues

* Fixed snapshot

* Improved multiple things

* running yarn dedupe

* Update LavaMoat policies

* For some reason, this.mmiConfigurationController.store.mmiConfiguration?.portfolio sometimes is undefined, added [] if null.
Moved the || {} outside the find method

* minor improvements

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-08-17 14:50:40 +02:00
Mark Stacey
20e16d41be
Improve Sentry state pre-initialization (#20491)
* Improve Sentry state pre-initialization

Previously the masked state snapshot sent to Sentry would be blank for
errors that occured during initialization. Instead we'll now include
some basic information in all cases, and a masked copy of the persisted
state if it happens after the first time the persisted state is read.

* Add test

* Fix crash when persisted state not yet fetched

* Add descriptions for initial state hooks

* Update comments to reflect recent changes

* Re-order imports to follow conventions

* Move initial state hooks back to module-level

The initial state hooks are now setup at the top-level of their module.
This ensures that they're setup prior to later imports. Calling a
function to setup these hooks in the entrypoint module wouldn't
accomplish this even if it was run "before" the imports because ES6
imports always get hoisted to the top of the file.

The `localStore` instance wasn't available statically, so a new state
hook was introduced for retrieving the most recent retrieved persisted
state.

* Fix error e2e tests
2023-08-17 09:29:05 -02:30
Mark Stacey
f033a59b17
Remove invalid tokensChainsCache state (#20495)
Migration #77 would set the `TokenListController.tokensChainsCache`
state to `undefined` if it wasn't already set to anything when that
migration was run. This is probably harmless except that it results
in Sentry errors during migrations, and it results in that property
having a value (at least temporarily) that doesn't match its type.

Migration #77 has been updated to prevent this property from being
set to `undefined` going forward. A new migration has been added to
delete this value for any users already affected by this problem. The
new migration was named "92.1" so that it could run after 92 but before
93, to make backporting this to v10.34.x easier (v10.34.x is currently
on migration 92). "92.1" is still a valid number so this should work
just as well as a whole number.
2023-08-17 09:04:30 -02:30
OGPoyraz
6b72316eb6
Fix infinite rerender on network change while active signature request (#20473) 2023-08-17 09:36:30 +02:00
Michele Esposito
3aa5b7d362
Use importAccountWithStrategy from core KeyringController (#19815)
* refactor: use new importaccount from keyring controller

* Update LavaMoat policies

* Update LavaMoat policies

* Update LavaMoat policies

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-08-17 09:11:51 +02:00
Mark Stacey
b2a56cadc4
Add additional validation for persisted state metadata (#20462)
Additional validation has been added for persisted state metadata.
Beforehand we just checked that the state itself wasn't falsy. Now we
ensure that the metadata is an object with a valid version as well.
2023-08-16 19:45:31 -02:30
Mark Stacey
3ab5c1bf88
Rename BackupController to Backup (#20465)
The backup module has been renamed so that it isn't confused with a
controller. The "backup controller" has never managed any state or
extended the controller base class. It is a module for backing up data,
but it's not a controller.

The backup controller's current inclusion in the `store` and `memstore`
`ComposableObservableStore`s was getting in the way of some other
enhancements to that class (which will come in a later PR).
2023-08-16 16:59:17 -02:30
Dan J Miller
b874a301f5
Capture exception with sentry when invariant conditions are met in migrations (#20427)
* capture exception for sentry when invariant conditions are met in migration 82

* Code cleanup

* Capture exceptions in invariant conditions for migrations 83,84,85,86,89,91,93,94

* Update app/scripts/migrations/082.test.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Code cleanup

* Fix SentryObject type declaration

* Stop throwing error if preferences controller is undefined

* Refactor 084 and 086 to remove double negative

* Capture exceptions for invariant states in in migrations 87,88,90 and 92

* lint fix

* log warning in migration 82 when preferences controller is undefined

---------

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2023-08-16 16:56:20 -02:30
Unik0rnMaggie
5cbfa82018
Fix Typo in en.json (#20429)
* Fix Typo in en.json

There is a typo in "smart contact"

* updated snapshot

---------

Co-authored-by: Howard Braham <howrad@gmail.com>
2023-08-16 15:36:33 -02:30
Mark Stacey
63a0ae765f
Use unflattened state for Sentry (#20428)
The unflattened background state is now attached to any Sentry errors
from the background process. This provides a clearer picture of the
state of the wallet, and unblocks further improvements to Sentry state
which will come in later PRs.
2023-08-16 15:21:18 -02:30
Mark Stacey
4e93b86116
Split Sentry mask into UI and background masks (#20426)
The state mask used to anonymize the Sentry state snapshots has been
split into UI and background masks. This was done to simplify later
refactors. There should be no functional changes.
2023-08-16 14:40:44 -02:30
Dan J Miller
9bbabd4868
Capture app and migration version (#20458)
* Add AppMetadataController so current and previous application and migration version can be captured in sentry

* Add currentAppVersion, previousAppVersion, previousMigrationVersion, currentMigrationVersion to SENTRY_OBJECT

* Update app/scripts/controllers/app-metadata.ts

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Update app/scripts/controllers/app-metadata.ts

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Update app/scripts/controllers/app-metadata.ts

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Fix types

* Add tests for app-metadata.test.ts

* Lint fixes

* Modify loadStateFromPersistence to return the whole versionData object, so that the migration version can be passed to the metamask-controller on instantiation

* Remove reference to implementation details in test descriptions in app/scripts/controllers/app-metadata.test.ts

* Reset all mocks afterEach in AppMetadataController

* Refactor AppMetadataController to be passed version instead of calling platform.version directly (for ease of unit testing the MetaMask Controller)

* Make maybeUpdateAppVersion and maybeUpdateMigrationVersion private, and remove unit tests of those specific functions

---------

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2023-08-16 12:22:38 -02:30
Mark Stacey
a6ef7bb244
Add additional Sentry E2E tests (#20425)
* Reorganize Sentry error e2e tests

The tests have been reorganized into different describe blocks. Each
describe block is for either before or after initialization, and either
with or without opting into metrics.

This was done to simplify later test additions. The conditions for each
test are now in the describe block, letting us test additional things
in each of these conditions. The conditions were flattened to a single
level to avoid excessive indentation.

* Add error e2e test for background and UI errors

The Sentry e2e tests before initialization only tested background
errors, and the after initialization tests only tested UI errors. Now
both types of errors are tested in both scenarios.

* Add error e2e tests for Sentry error state

E2E tests have been added to test the state object sent along with each
Sentry error.

At the moment this object is empty in some circumstances, but this will
change in later PRs.

* Rename throw test error function

* Only setup debug/test state hooks in dev/test builds

The state hooks used for debugging and testing are now only included in
dev or test builds. The function name was updated and given a JSDoc
description to explain this more clearly as well.

* Add state snapshot assertions

State snapshot assertions have been added to the e2e error tests. These
snapshots will be very useful in reviewing a few PRs that will follow
this one.

We might decide to remove these snapshots after this set of Sentry
refactors, as they might be more work to maintain than they're worth.
But they will be useful at least in the short-term.

The login step has been removed from a few tests because it introduced
indeterminacy (the login process continued asynchronously after the
login, and sometimes was not finished when the error was triggered).

* Ensure login page has rendered during setup

This fixes an intermittent failure on Firefox

* Format snapshots with prettier before writing them

* Use defined set of date fields rather than infering from name

* Remove waits for error screen

The error screen only appears after a long timeout, and it doesn't
affect the next test steps at all.
2023-08-16 11:52:25 -02:30
Michele Esposito
42d05ef9cd
Use addNewAccount from core KeyringController (#19814)
* refactor: use addNewAccount from core KeyringController

* refactor: replace missed interaction

* refactor: select account only when is new

* refactor: use getAccounts to check if account is new
2023-08-16 11:19:41 +02:00
Dan J Miller
d368f517e2
Log before and after each migration run (#20424)
* Log before and after each migration run

* Use loglevel
2023-08-15 19:19:48 -02:30
Frederik Bolding
e0a6435f62
Bump SES to fix audit failure (#20434)
* Bump SES to fix audit failure

* Freeze Symbol
2023-08-14 16:30:34 -02:30
Ariella Vu
136ede5d4c
Add Blockaid / PPOM Failed Request Security Alert (#20362)
* WIP blockaid: add request failed UI
- proposed to update reason value. planning to update upon update

* alphabetize

* BlockaidBannerAlert: update tkeys based on reason

* SecurityProviderBannerAlert: fix footer alignment

* BlockaidBannerAlert: rm footer w failed resultType

---------

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
Co-authored-by: Jyoti Puri <jyotipuri@gmail.com>
2023-08-14 18:38:03 +02:00
Jyoti Puri
2550eaa9ac
PPOM dependency updates (#20342) 2023-08-14 21:48:40 +05:30
David Walsh
ee4bf2d264
Fix #19829: UX: Multichain: Move "Import Tokens" to Modal (#19553)
* Move Import Tokens to Modal

* Better dimensions for long token name

* Add padding above tabs
2023-08-14 11:08:59 -05:00
Michele Esposito
d6eecf8584
Use createNewVaultAndRestore from core KeyringController (#19816)
* refactor: use createNewVaultAndRestore from core kc

* test: use createNewVaultAndRestore from core

* refactor: apply @mcmire suggestion

* fix: mnemonic conversion
2023-08-14 17:23:28 +02:00
David Walsh
91f6545c09
UX: Remove the 'Source' and 'Link' URLs from NFT detail (#20248) 2023-08-04 13:28:34 -05:00
Victor Thomas
2ff289e271
Add Opt-out Settings toggle for 4byte contract method names resolution (#20098)
* Adding 4byte toggle to settings UI and preferences

* Adding 4byte toggle to advanced settings tab

* adding use4ByteResolution privacy logic to getContractMethodData & getMethodDataAsync, removing unused useMethodData hook, adding clearKnownMethodData

* add 4byte setting to onboarding advanced option

* more test changes

* adding e2e for 4byte setting toggle

* test and copy changes, snap updates

* removing 4byte from advanced section

* adding settings constant and fixing refs

* removing clearKnownMethodData, adding flag to selector, test fixes

* e2e refactor, selectors refactor

* adding tests

* Fix jest tests, remove unwanted forceUpdateMetamaskState

* Fix jest tests

* lint:fix

* settingsRefs fixes

---------

Co-authored-by: David Walsh <davidwalsh83@gmail.com>
2023-08-04 13:28:37 -04:00
David Walsh
fee1606fad
Fix #20305 - Show the network name in Delete Network modal (#20309)
* Fix #20305 - Show the network name in Delete Network modal

* Update app/_locales/en/messages.json

Co-authored-by: George Marshall <george.marshall@consensys.net>

* Add unit test

---------

Co-authored-by: George Marshall <george.marshall@consensys.net>
2023-08-04 09:48:12 -05:00
Danica Shen
a85a4cf97e
feat(878): add new incomingTxn component and change styles of settings (#20374)
* feat(878): add new incomingTxn component and change styles of settings

* feat(878): relocate openSea tab from rebase regression

* feat(878): make UI and test modifications

* feat(878): transfer to ts

* feat(878): rename network-toggle.tsx
2023-08-04 12:33:47 +01:00
Nidhi Kumari
6c1b71b584
Updated copy changes for display NFT Media (#20380)
* updated copy changes

* updated snapshots

* lint fix

* updated test
2023-08-03 23:49:30 +05:30
Alex Donesky
6594f7074e
adapt to use networksMetadata state instead of single networkStatus and networksDetails state (#20219) 2023-08-03 12:31:35 -05:00
Mark Stacey
a7a086537b
Force an update of the phishing warning configuration (#20381)
The "last fetched" state for the `PhishingController` has been deleted
to force an immediate full update of the phishing configuration state.
We're doing this because the state was cleared in v10.34.2 because the
format of that state had changed.

This has been implemented in migration 92. The previous migration 92
has been renamed to 93 because it won't be included until a future
release. We need the migrations to remain sequential, and this will
save us from having to resolve a complex conflict when releasing this.
2023-08-03 13:12:21 -02:30
Mark Stacey
0eb8e33e45
Fix import that was resulting in a depcheck error (#20383)
An import was introduced in #20125 that was broken. It was importing
from `app/` instead of using a relative import. This was causing the
CI "depcheck" job to fail. The import has been updated to use a
relative path.
2023-08-03 12:26:05 -02:30
OGPoyraz
e351a6bbe2
fix: minimise public api of tx controller (#20361) 2023-08-03 13:42:44 +02:00
Jyoti Puri
8c46f85764
Confirmation page alerts (#20125) 2023-08-03 16:24:54 +05:30
Alex Donesky
bf9311555d
bump @metamask/network-controller from v10.3.1 to v11.0.0 (#20367)
* bump @metamask/network-controller from v10.3.0 to v11.0.0

* add lavamoat policy files

* fix

* tweak
2023-08-02 16:22:35 -05:00
infiniteflower
1099a3763b
Feat/swaps link buy gas (#20241)
* Add link to buy more ETH if insufficient gas

* Fix lint error

* Use native currency per network

* Use localized msg for buy more gas

* Add the word "more"

* Fix smart tx not showing msg

* Pull out not enough balance into own component

* Add story for not enough balance

* Fix btn text not being aligned with rest of text

* Move inline style to class, remove empty classname

* Update ui/pages/swaps/prepare-swap-page/not-enough-balance.stories.tsx

Co-authored-by: George Marshall <georgewrmarshall@gmail.com>

* Update ui/pages/swaps/prepare-swap-page/index.scss

Co-authored-by: Nidhi Kumari <nidhi.kumari@consensys.net>

* Remove line

* Move BannerAlert back into review-quote and use BannerAlert props

* Remove unused CSS

---------

Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
Co-authored-by: Nidhi Kumari <nidhi.kumari@consensys.net>
2023-08-02 14:58:12 -04:00
Nidhi Kumari
f91d4fb858
Updated copy change for the IPFS toggle (#20358)
* updated ipfs toggle copy

* removed unused entries
2023-08-02 10:27:32 -07:00
Olusegun Akintayo
ef5d171f54
Whats new blockaid popup (#20071)
* deprecate opensea security alerts check

Signedoff-by: Olusegun Akintayo <akintayo.segun@gmail.com>

set metrics to []

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

fix jest tests

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

Remove sec provider spec

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

lint fix

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

What's new for blockaid...with placeholder texts

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

i18n

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

lint fixes

Rebase to develop
Add image to whatsnew blockaid.

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

Fixed i18n

Fixed snapshot for ui/pages/settings/experimental-tab/experimental-tab.test.js

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

Fix i18n messages

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

lint fixes

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

Add unit tests

Lint fixes

use new image that works for both dark and light mode

22 is taken

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

* comment out blockaid

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

* rever change in builds.yml

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

* reverted changes in test/e2e/tests/security-provider.spec.js

* fix unit test

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>

---------

Signed-off-by: Olusegun Akintayo <akintayo.segun@gmail.com>
2023-08-02 16:14:02 +01:00
Guillaume Roux
36c0dfb1f2
Check for blocked snaps on extension startup (#20336)
* allow `SnapController` to call `SnapsRegistry:update`

* call `SnapController:updateBlockedSnaps` on extension startup

* only check if at least one snap is installed
2023-08-02 15:16:43 +02:00
Ariella Vu
446c7bb3fe
Security Alert Settings: update copy to match figma (#20300)
* securityAlert: fix settings copy

* securityAlert: fix settings copy - update snapshop
2023-08-02 11:29:18 +02:00
Dan J Miller
b825ee8e37
Fix migration 88 to handle the case where chainId keys can be undefined (#20345)
* Fix migration 88 to handle the case where chainId keys can be undefined

* Add migration 91 to delete network configurations that have no chainId

* Lint fix

* Update migration number

* Update migration 91 description

* Update version numbers in 091.test.js

* Fix 088.test.ts typescript problem

* Fix 088.test.ts typescript problem

* Update app/scripts/migrations/091.ts

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Change app/scripts/migrations/091.test.js to typescript

* clone oldstorage for test result comparisons in 091.test.js

* Lint fix

* Add missing test case

---------

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2023-08-01 20:24:02 -02:30
Nidhi Kumari
4c37448c97
Added IPFS toggle (#20172)
* added ipfs toggle

* added placeholder valur

* fixed snapshot

* updated tests

* updated spec file

* hide input if toggle is disabled

* updated e2e tests for nft image

* fixed view-ercc-1155 spec

* updated e2e tests for nfts

* added ipfs toggle modal

* updated UI for ipfs

* updated tests

* updated classname

* added placeholder image

* lint fix

* removed prop ipfsEnabled and used with selector

* fixed ui for ipfs toggle

* updated test

* updated  test to handle cases

* nit fix

* ensure default image height match nft image
2023-08-01 23:51:51 +05:30
David Walsh
e27a9e4344
UX: Update Batch Account Setting Description (#20269) 2023-08-01 13:17:58 -05:00
Jyoti Puri
4e52fe2494
Adding metrics events for blockaid (#20091) 2023-08-01 16:59:41 +05:30
witmicko
d11ef07ae1
solves 1114 (#20307)
* fixes 207
2023-08-01 07:04:23 +01:00
Mark Stacey
990dc33fc6
Remove fallback phishing warning configuration (#20327)
* Remove fallback phishing warning configuration

The package `@metamask/phishing-controller` has been updated from v4
v6. The only breaking changes are a minimum Node.js version bump, and
the removal of the fallback phishing configuration.

The fallback phishing configuration was resulting in MetaMask being
incorrectly flagged as malware, and the stale config was causing
problems for sites that had been blocked in the past but have since
been unblocked. This should substantially reduce the bundle size as
well.

* Update LavaMoat policies

* Update test state to include example blocked site

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-07-31 22:26:40 -02:30
Dan J Miller
3b0d37c3bf
Fix migration 77 (#20276)
* Handle the case where tokensChainsCache data is undefined in migration 77

* Delete parts of state that should have been removed in migrations 82,84,86 and 88

* Create 077-supplements.md

* Update 077-supplements.md

* Update 077-supplements/*.js code comments

* Fix types and jsdoc

* Type/lint fix

* Cleanup

* Add 'should set data to an empty object if it is null' test case to 077.test.js

* Update app/scripts/migrations/077.test.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Modify deletion criteria so that all decimal chain id proprties are deleted in migration 88 supplement

* Readme.md

* Update app/scripts/migrations/077.test.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Update app/scripts/migrations/077.test.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Update app/scripts/migrations/077.test.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Lint fix

* Only delete decimal chain id keyed-entries in migration 88 supplement if there are hexadecimal keyed entries as well

* Remove redundant test

* Add 'does not delete' cases for nftcontroller related tests in 077.test.js

---------

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2023-07-31 19:43:51 -02:30
Mark Stacey
507c2cb475
Capture Sentry errors prior to initialization (#20265)
* Capture Sentry errors prior to initialization

Sentry errors captured before/during the wallet initialization are
currently not captured because we don't have the controller state yet
to determine whether the user has consented.

The Sentry setup has been updated to check the persisted state for
whether the user has consented, as a fallback in case the controller
state hasn't been initialized yet. This ensures that we capture errors
during initialization if the user has opted in.

* Always await async check for whether the user has opted in

* Remove unused import

* Update JSDoc return type

* Remove unused driver method

* Fix metametrics controller unit tests

* Fix e2e tests

* Fix e2e test on Firefox

* Start session upon install rather than toggle
2023-07-31 18:49:32 -02:30
cryptodev-2s
5df6a71cea
Use getKeyringsByType from core KeyringController (#20210) 2023-07-31 16:45:20 +01:00
Nicholas Ellul
b76875ac69
Update @metamask/phishing-controller to v4.0.0 (#18840)
* Update phishing controller to v4.0.0

* Move phishing e2e test utilities into its own helper.js

* Update phishing detection e2e test

* Update MetaMask Controller test mocks

* Update mv3 phishing tests

* Fix test for 500 error on warning page

* Allow for directories in test folder

* Update migration number

* Linting fixes

* Remove fail on console error

* Separate mocks from helpers

* Have migration delete PhishingController state entirely

* Remove phishing detection directory

* Only delete the listState in migration

* Bump migration version
2023-07-31 10:18:48 -02:30
Vinicius Stevam
252c7c1d6d
Remove unnecessary log from accept approval (#20233) 2023-07-31 11:06:18 +01:00
David Walsh
0129ea913f
Fix #20162 - Add Whats New for Global Menu (#20244) 2023-07-28 20:48:22 -02:30
cryptodev-2s
b576c5245c
Use getKeyringForAccount from core KeyringController (#20202) 2023-07-28 20:09:14 +01:00
Pedro Figueiredo
537f1c7aee
feat: implement swap event metric e2e test (#20129)
* implement swap event metric e2e test

* fix lint error

* clean up initial balance helpers

* fix eslint warnings

* Fix `token_to_amount` format to address firefox bug and refactor tests
2023-07-28 19:57:06 +01:00
Sylva Elendu
1a218714a6
Update transaction status to not be considered anonymous (#20049)
* update transaction status to not be considered anonymous

* fix failing e2e

* revert status changes in txn spec file

* Fix e2e by adding status

---------

Co-authored-by: Olusegun Akintayo <akintayo.segun@gmail.com>
2023-07-28 15:08:59 -03:00
David Walsh
57ca5d9a67
Implement Network Menu Search (#19985)
* WIP: Implement Network Menu Search

* Maintain order, add tests

* Remove unwanted locale

* Fix duplicate import, better focus and item autofocus
2023-07-28 11:25:48 -05:00
David Walsh
99c709ff8f
Allow user to turn off ENS DNS resolution (#20102)
* Allow user to turn off IPFS gateway resolution

* Add end to end test for toggle on and off

* Fix jest tests and snapshots

* Change variable name

* Implement provided content

* Use MetaMask eth instead

* Allow searching for ENS setting

* Fix jest

---------

Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2023-07-28 11:21:43 -05:00
Maarten Zuidhoorn
01a3a5d2c1
[FLASK] Bump Snaps packages (#20230)
* Bump Snaps packages

* Add endowment:lifecycle-hooks permission

* Run yarn lint:fix

* Fix unit test

* Update LavaMoat policies

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-07-28 11:52:32 +02:00
Vinicius Stevam
553da10bea
Remove unused methods in the transaction controller (#20194) 2023-07-28 10:01:06 +01:00
David Walsh
cd68bf9d09
UX: Remove portfolio from global menu (#20221)
* UX: Remove portfolio from global menu

* Remove unused locale string

* Code-fence the metaMetricsId
2023-07-27 09:35:27 -07:00
legobeat
9441c0fb7d
Remove redundant polyfill @formatjs/intl-relativetimeformat (#20204) 2023-07-27 00:22:44 +09:00
Brad Decker
e28db07a1b
Set sentry autoTrackSessions default (#20132)
* Set sentry autoTrackSessions default

* endSession....

* fixup

* updated comment

* prevent breaking devmode

* remove changes to beforeSend

* remove additional usage of sinon
2023-07-26 07:13:28 -05:00
Alejandro Banzas
058f3a3792
Add Gnosis Chain to the popular custom network list (#19324) 2023-07-26 20:05:44 +09:00
Albert Olivé
9797d9a634
[MMI] Fix element UI in MMI (#20176)
* Added support for dark mode in metafox logo and removed unused compliance images

* Fixed text elements with wrong alignment and color

* Changed needHelp in mmi

* Updated code

* Improved code

* Updated copies

* Changed logic to fix code fences issues

* Renamed component
2023-07-26 11:51:11 +02:00
Jyoti Puri
98279b6592
Updating extension for ppom-validator updates (#20000) 2023-07-26 05:28:33 +05:30
Dan J Miller
4927ee735a
Migration 89: ensure providerConfig in state has an id property (#20181)
* Migration 89: ensure providerConfig in state has an id property

* Exit transformState function early if providerConfig already has an id

* Update migrations/index.js

* Code cleanup
2023-07-25 21:17:57 -02:30
Maarten Zuidhoorn
6914baa54e
Remove Snaps execution environment override (#20173) 2023-07-25 11:57:59 +02:00
Matthew Walsh
fdc3558988
Use single controller method to add transactions (#20007) 2023-07-25 09:50:55 +01:00
Dan J Miller
0ea765ebf6
Ensure chainId comparison in switchEthereumChain handler is case insensitive (#20149) 2023-07-24 16:34:51 -02:30
Michele Esposito
11b2c425d4
Use @metamask/keyring-controller (#19659)
* refactor: use patched @metamask/keyring-controller

* refactor: run prettier

* Update LavaMoat policies

* refactor: change patch to use EthKeyringController type

* chore: change policies

* Update LavaMoat policies

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-07-24 20:44:43 +02:00
Danica Shen
74a645e957
feat(874): add tooltip to connect hardwallet and style refactor (#20121) 2023-07-24 19:00:34 +01:00
Frederik Bolding
b584b82dbd
Filter out snaps source code and state from UI state (#20136) 2023-07-24 15:13:34 +02:00
António Regadas
13faeeac2b
Use the networkController instead of preferencesController (#20127)
* listen for the networkController instead of preferencesController

* type of networkConfigurations is an object

* typo fix

* prettier
2023-07-24 11:00:57 +02:00
Ariella Vu
737173ed5a
New BlockaidBannerAlert component (#20051) 2023-07-24 12:24:17 +05:30
Dan J Miller
e1722d773a
Fix sentry sourcemaps (#20122)
* Update sentry/cli to 2.19.4

* Ensure sentry files are loaded and referenced with a valid url

* Temp to eliminate errors in sentry (should be split into other PRs)
2023-07-21 16:33:25 -02:30
António Regadas
8ee733c0d5
[MMI] Handle personal sign and sign typed operations (#20087)
* adds listeners for signatureControll and adds the handleSigningEvents method

* clean up

* updates signature request containers files

* adds necessary methods

* wip

* signing flow with core methods

* yarn lint

* updates logic to fit latest signatureCOntroller

* updates mmi extension package

* updates signature-controller and message-manager packages

* checkout develop lock file and run yarn

* checkout develop lock file and package.json to test circleci

* test fix

* adds signature-controller new version

* updates mmi extension package

* tx-list update and runs lavamoat auto

* lint fix

* runs lavamoat auto

* resets lavamoat/build-system/policy.jsono to develop

* Update LavaMoat policies

* adds back the dispatch

* lint

* clean up

* clean up

* applies patch for signature controller

* clean patch file

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-07-21 16:52:47 +01:00
jiexi
4c881f70fe
Update "NFT Added" events (#19796)
* Update NFT events

* remove uneeded toString()

* source_connection_method to source for TokenAdded events

* redelete add-nft

---------

Co-authored-by: Alex Donesky <adonesky@gmail.com>
2023-07-21 10:17:56 -05:00
Ariella Vu
59102e37b8
New SecurityProviderBannerAlert component (#19825) 2023-07-21 11:04:51 +02:00
Jyoti Puri
6ce80fe997
Adding experimental flag for blockaid (#19819) 2023-07-20 21:17:01 +05:30
Albert Olivé
26225aabe0
[MMI] Removed compliance feature from the codebase (#20088) 2023-07-20 10:11:14 +02:00
Nicholas Ellul
9469435dd0
Enforce user preferences in incoming transactions controller (#19982)
* Enforce user preferences in incoming transactions controller

* Combine various conditions to determine tx lookup

* Update tests to not use private methods
2023-07-18 16:21:30 -04:00
vthomas13
4dcde1e216
Multichain Activity Screen (#19557)
* layout wip

* Icon changes, add badgewrapped icons to smart tx

* grouping by date wip

* typo fix

* group txs by date, button styling

* removing queue/history division, adding datestamp for pending tx, minor styling changes

* adding tests, updating snap

* font size fix

* e2e fixes

* Remove unnecessary tabIndex and keypress handler

* Fix typo for fontWeight

* Fix nesting warning by removing unnecessary Text

* Fix tests

* Fix import and exports

* Remove unused verbiage

* Update E2E selectors

* More E2E

* More E2Es

* More test fixes

* awaiting find instead of click

* adding regularDelayMs to flaky test

* removing delay

* increasing delay outside of wait

* adding back first-child to selector

* test fixes

* using datatestid for primary currency

* sorting date txgroups

* wip alignment for big numbers

* alignment issues fix

* lintfix

* adding tabindex, cursor pointer, updating snap

* unit test fix

* storybook additions

* snaphot update

* update snap

---------

Co-authored-by: David Walsh <davidwalsh83@gmail.com>
2023-07-17 13:48:15 -04:00
Albert Olivé
0309858917
[MMI] Fixed remove custodian token (#20021) 2023-07-17 12:11:38 +02:00
Garrett Bear
775ca0dc31
Feat/15438/create ds checkbox component (#19808)
* add ds checkbox

---------

Co-authored-by: Garrett Bear <gwhisten@gmail.com>

---------

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2023-07-14 11:50:47 -07:00
Daniel
1295474dc3
Show a balance for the Token To, update position of the MM fee, removes a link (#20030) 2023-07-14 20:48:46 +02:00
Nidhi Kumari
7bdd76a4ad
updated hardware wallet text (#20026) 2023-07-14 21:12:01 +05:30
Albert Olivé
91c84996b7
[MMI] Added missing locales (#20024)
* added missing locales

* Added missing locale
2023-07-14 15:02:00 +02:00
Albert Olivé
47fe542273
[MMI] Review interactive replacement token flow (#19974)
* Sending showCustodyConfirmLink as a prop and fixing other issues

* Upgraded MMI extension monrepo and trying to fix the issue

* prevents deeplink from closing

* Fixed styles of Custody view and changed the place of it

* Fixed CI issues

* fixing eslint issues

* Update LavaMoat policies

* fixing tests

* Fixed test

* updated snapshots

* Improving IRT flow

* Fixing everything

* Finish fixing all issues

* Fixed institutional entity done page styles

* Fixing boxes

* Fixed issue with checkbox

* Fixed tests and styles

* Removed duplicated lodash

* updated snapshot

* Fixing tests

* Removed unused test

* Fixed snapshot

* Fixed snapshot

---------

Co-authored-by: Antonio Regadas <antonio.regadas@consensys.net>
Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-07-13 18:27:49 +02:00
Albert Olivé
b5ece42ca1
[MMI] Fix Connect MMI and Deep link Flows (#19881)
* Sending showCustodyConfirmLink as a prop and fixing other issues

* Upgraded MMI extension monrepo and trying to fix the issue

* prevents deeplink from closing

* Fixed styles of Custody view and changed the place of it

* Fixed CI issues

* fixing eslint issues

* Update LavaMoat policies

* fixing tests

* Fixed test

* updated snapshots

* reorder, otherwise it won't make sense

* adds necessary methods

* removes duplicated key value

* updated snapshot

---------

Co-authored-by: Antonio Regadas <antonio.regadas@consensys.net>
Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: António Regadas <apregadas@gmail.com>
2023-07-13 10:42:08 +02:00
Jyoti Puri
73a203f106
Integrating ppom-validator with extension (#19511) 2023-07-12 19:50:55 +05:30
Vinicius Stevam
5736e670f7
Approval flow adding success and error pages (#19778) 2023-07-12 09:29:54 +01:00
Niranjana Binoy
129f6f3f64
Token allowance flow update (#19666) 2023-07-11 10:57:59 -04:00
Mark Stacey
e7144411c7
Fix test build network controller state (#19922)
The default network controller state is currently invalid on test
builds. The initial state is set to localhost (Ganache) on test builds,
but that network configuration is missing.

The initial state for test builds has been updated to include the
network configuration for localhost. Additionally, the initial state
was updated to only be applied if persisted state is missing. This is
to ensure the initial network configuration state doesn't override test
fixtures in e2e tests.
2023-07-10 16:56:29 -02:30
Mark Stacey
431712aaf9
Use legacy gas API for BSC (#19763)
The legacy gas API is still useful for BSC, which is a network our APIs
support that is not EIP-1559 compatible. The legacy gas API will now be
used for BSC prior to using RPC methods as a fallback.

This brings extension closer in alignment with mobile, which also uses
the legacy gas API for BSC.

The E2E network mock function has been updated to use a variable for
the initial test network. This made it easier to write the e2e test for
the BSC case.
2023-07-10 14:09:39 -02:30
Frederik Bolding
f829f0069d
[FLASK] Allow Snaps to use eth_accounts as a revokable permission (#19306)
* Add support for snap authorship component at the top of PermissionConnect

* Add PermissionCellOptions

* Add details popover

* Add action for revoking dynamic permissions

* Improve UI and revoke logic

* Better eth_accounts screen support

* Fix tests

* Fix lint

* More linting fixes

* Fix missing fence

* Add another fence

* Unnest permission page to fix weird CSS issues

* Hide footer on permissions connect when using a snap
2023-07-06 22:54:27 +02:00
António Regadas
2c22e85947
[MMI] personal sign and sign typed logic (#19892)
* adds missing logic

* lint fixes
2023-07-06 16:10:03 +01:00
Monte Lai
daf373251b
fix: fetch for snap registry (#19866) 2023-07-05 20:54:46 +08:00
António Regadas
95d1b3bb3b
[MMI] Adds missing return for MMI (#19869)
* adds missing return for mmi

* clean up
2023-07-05 11:29:17 +01:00
Albert Olivé
9e5eada190
Added code fences to updateExtensionUninstallUrl (#19845) 2023-06-30 16:27:16 +02:00