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

5374 Commits

Author SHA1 Message Date
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