1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
Commit Graph

16582 Commits

Author SHA1 Message Date
Jyoti Puri
c6aa4f38c5
Fix approve all warning modal (#18613)
* Fix approve all warning modal

* fix

* fix

* fix
2023-04-18 13:22:16 -02:30
Niranjana Binoy
9d3cdd1b79
Overriding gas estimate in the send page even if enough ETH is not available (#18554) 2023-04-18 11:10:32 -04:00
Dan J Miller
e6f73f5fe9
Pass correct params to fetchEstimatedL1Fee in the swaps controller (#18634) 2023-04-18 12:15:18 -02:30
Danica Shen
66767d981c
fix/18577: Add title back for approving ERC20 token (#18617)
* fix/18577: Add title back for approving ERC20 token

* Apply suggestions from code review

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

---------

Co-authored-by: Nidhi Kumari <nidhi.kumari@consensys.net>
2023-04-18 15:49:31 +02:00
Guillaume Roux
76d79d9cce
[FLASK] Redesign dropdown-tab (#18546) 2023-04-18 12:46:38 +02:00
Vinicius Stevam
ae0af1b283
Adopt security provider request from core (#18520) 2023-04-18 08:33:32 +01:00
Jyoti Puri
09d00e1e45
Refactor confirm-send-ether into functional component (#18527) 2023-04-18 05:59:06 +05:30
Jyoti Puri
00d2d43d45
Fix error in console on rejecting signature request (#18614) 2023-04-18 05:58:28 +05:30
Mark Stacey
e5835ac459
Make resetConnection async (#18601)
The network controller method `resetConnection` is now async. This has
no functional impact.

Relates to https://github.com/MetaMask/metamask-extension/issues/18587
2023-04-17 15:45:22 -02:30
Mark Stacey
b87c1b8526
Make setProviderType async (#18604)
The network controller method `setProviderType` is now async, and the
async operation `_setProviderConfig` called at the end of the method is
now awaited.

Because the only async operation was the last step, this should have no
impact upon the flow of execution. The only functional change is that
now any callers have the option of waiting until the network switch
operation has completed.

One such change was made, in the `switch-ethereum-chain` middleware. As
a result, an error thrown while the network is switching will now
be thrown in this middleware and returned to the dapp as an internal
error.

Relates to https://github.com/MetaMask/metamask-extension/issues/18587
2023-04-17 15:45:01 -02:30
Garrett Bear
81393e1b5d
update to enum DS Text component (#18584)
* update to enum DS Text component

* Update ui/components/component-library/text/README.mdx

Co-authored-by: Danica Shen <zhaodanica@gmail.com>

* Update ui/components/component-library/text/README.mdx

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

* Update ui/components/component-library/text/README.mdx

Co-authored-by: Danica Shen <zhaodanica@gmail.com>

* Update ui/components/component-library/text/README.mdx

Co-authored-by: Danica Shen <zhaodanica@gmail.com>

* Update ui/components/component-library/text/README.mdx

---------

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
Co-authored-by: Danica Shen <zhaodanica@gmail.com>
Co-authored-by: Nidhi Kumari <nidhi.kumari@consensys.net>
2023-04-17 10:17:28 -07:00
Mark Stacey
39dff02a04
Consolidate network stores (#18595)
* Consolidate network stores

The network controller used to have multiple different state stores,
which were composed together to form the main controller state store.
They have been consolidated into a single store. This required few
changes because most state access was already being done through the
composed store.

Fixes https://github.com/MetaMask/metamask-extension/issues/18303

* Add JSDoc comment
2023-04-17 13:24:13 -02:30
Mark Stacey
3588e6d28e
Make network controller internal fields private (#18607)
Internal network controller methods and fields are now private fields,
using the JavaScript `#` syntax rather than the `private` TypeScript
keyword or a leading underscore.

The one reference to a private field was in the preferences controller
unit tests. Fortunately it was being used to create a test fixture that
was unused. The unnecessary test fixtures have been removed from that
test suite.

Fixes https://github.com/MetaMask/metamask-extension/issues/18588
2023-04-17 12:45:33 -02:30
Albert Olivé
c3cb464229
[MMI] Added custody-labels and account-list components (#18197)
* Added custody-labels and account-list components

* Modified link

* Renamed custody labels and improved code

* Added snapshot

* Fixed snapshot

* Finished connect-custody account-list

* Fixing css prettier

* Fixed comments of the PR

* Fixed code

---------

Co-authored-by: António Regadas <apregadas@gmail.com>
2023-04-17 17:06:41 +02:00
Niranjana Binoy
fedd6d4970
New reusable gas-display component (#17976) 2023-04-17 10:34:26 -04:00
dswilson4
ca10a1cdb6
updated onClick of close button to call the same autohide fxn as the NFT import removal (#18504)
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-17 16:13:00 +02:00
Frederik Bolding
47f4f4008b
[FLASK] Remove unused snaps code (#18565)
* Remove unused code after snap_confirm was removed

* Remove more unused code

* Fix lint
2023-04-17 12:55:08 +02:00
OGPoyraz
867d637f06
fix: add metrics event to sign controller (#18318)
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-17 11:21:33 +02:00
António Regadas
b50b9be502
[MMI] moves mmi selectors to institutional folder (#18542)
* adds the initial selectors

* adds more selectors

* adds tests

* fix lint and prettier
2023-04-17 09:22:53 +01:00
Jyoti Puri
cc71fda686
Fix issue with requests with empty data being forwarded to opensea (#18598) 2023-04-17 09:54:25 +05:30
Mark Stacey
73efd2edeb
Make rollbackToPreviousProvider async (#18599)
The network controller method `rollbackToPreviousProvider` is now
async. It will resolve when the network switch has completed.

Relates to https://github.com/MetaMask/metamask-extension/issues/18587
2023-04-15 10:31:59 -02:30
Ariella Vu
1406885115
siwe: add ledger instructions (#18589) 2023-04-14 21:10:27 -03:00
Mark Stacey
e6d1b052f0
Make _setProviderConfig async (#18600)
The network controller internal method `_setProviderConfig` has been
made async, the async `_switchNetwork` operation is now `await`-ed.

Since the `_switchNetwork` call was the last operation, this has zero
functional impact.

Relates to https://github.com/MetaMask/metamask-extension/issues/18587
2023-04-14 19:10:32 -02:30
Mark Stacey
b9ff4e8798
Remove the network controller previousProviderStore (#18593)
* Remove the network controller `previousProviderStore`

The `previousProvider` network controller state has been replaced with
a private internal property. This was only used internally, it did not
need to be part of state.

This relates to https://github.com/MetaMask/metamask-extension/issues/18303

* Remove redundant tests
2023-04-14 16:24:57 -02:30
Matthew Walsh
fa32c5deb9
Disable rate limiting for signature approval requests (#18594) 2023-04-14 18:33:53 +01:00
Mark Stacey
d85d2318a3
Make _switchNetwork async (#18597)
The network controller internal method `_switchNetwork` has been made
async, and the `lookupNetwork` call is now awaited. Because this method
is only used internally, and because the `await`-ed async operation was
the last operation in this function, this change has no functional
impact whatsoever.

Relates to https://github.com/MetaMask/metamask-extension/issues/18587
2023-04-14 14:53:57 -02:30
vthomas13
40e4a3653f
Updating Terms of Use, Adding popover and onboarding flow check (#18221)
* WIP commit

* Moving copy out of messages.json, styling changes

* handling scroll button click and disable logic

* moving scrollButton up to popover component, adding logic for accepting terms of use in popover and onboarding flows

* adding terms of use to e2e wallet creation/import

* adjusting failing unit test

* fixing QR code e2e

* updating welcome test

* setting app state in fixtures

* Update app/scripts/controllers/app-state.js

removing console log

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

* Update ui/components/app/terms-of-use-popup/terms-of-use-popup.stories.js

adding args to ToU popup storybook

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

* Update ui/components/app/terms-of-use-popup/terms-of-use-popup.js

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

* updating DS components in terms of use

* popover styling changes

* adding metametrics tracking

* editing scrollbutton behavior

* adding unit test

* code fencing

---------

Co-authored-by: Nidhi Kumari <nidhi.kumari@consensys.net>
2023-04-14 12:51:13 -04:00
Elliot Winkler
26db0aee46
Convert NetworkController net client tests to TS (#18490)
In order to be able to better compare differences between the version of
NetworkController in this repo and the version in the `core` repo before
we replace this version with the `core` version, this commit converts
the NetworkController network client tests to TypeScript.

The added types here are copied from the `core` repo. We plan on
making more improvements on the `core` side at some point to polish the
tests and types and reduce some of the duplication, but for now we're
just trying to keep things as similar as possible.
2023-04-14 10:21:29 -06:00
António Regadas
8fdbd07c91
[MMI] Interactive replacement token modal (#18523)
* updates styles for confirm-add-institutional-feature

* initial component

* adds tests and storybook file

* clean up styles and adds MM design system

* prettier

* locale update

* lint

* snapshot update

---------

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-14 11:35:58 +01:00
David Drazic
3eefe874a8
[FLASK] Revert changes made to stable permission display (UI design) (#18470)
* Revert changes made to stable permission display (UI design)

* Add test for new component

* Update paddings for install flow

* Fix missing icons on snap installation flow

* Update storybook path

* Add targetSubjectMetadata param

---------

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
2023-04-14 12:04:23 +02:00
legobeat
17147b3817
test: increase timeout for failing tests (#18189) 2023-04-14 16:59:51 +09:00
Vinicius Stevam
a3af0b53e3
Trigger unlock popup in appStateController using ApprovalController (#18386) 2023-04-14 05:50:17 +01:00
legobeat
5d2c4c143a
devdeps: mocha@7.2.0->9.2.2 (#18195)
* devdeps: mocha@7.2.0->9.2.2

Maintenance upgrade

- Closes subdependency flat advisory
  - CVE-2020-36632 / GHSA-2j2x-2gpw-d8fm
- upgrade eslint-plugin-mocha to match
  - previously used `eslint-plugin-mocha` depended on mocha@^8.2.0

* devdeps: patch-bump ansi-regex

closes GHSA-93q8-gq69-wqmw

* update lavamoat policies
2023-04-14 10:49:22 +09:00
Garrett Bear
e09028b4e5
Update multichain Icon imports (#18536)
* Update multichain Icon imports

* replace ButtonIcon with updated version

* Buttons with Icon TODO added

* update header to use TS version Icon
2023-04-13 15:24:47 -07:00
Nidhi Kumari
8becb57d9e
updated copy Address (#18557)
Co-authored-by: Danica Shen <zhaodanica@gmail.com>
2023-04-13 23:07:33 +05:30
Jyoti Puri
a2bec15c68
Improvement on approval pages (#18545) 2023-04-13 22:54:33 +05:30
David Walsh
eb51460cae
UX: Multichain: App header (#18363)
* UX: Multichain: App header

* Export app header, provide required information, put feature flag in place

* Provide available data

* Implement account picker -- centered and opens account popover

* Remove backgrounds, use isUnlocked

* Fix placement of the global menu

* Show logo when unlocked

* Add selector for getting current network, provide props to AvatarNetwork and PickerNetwork

* Wire up the network menu to the header

* fixed ui for all the screens

* updated story for header

* fixed import and header settings

* updated lint error

* fixed tests

* updated header

* removed test

* updated snapshot test

* updated network menu

* updated changes

* removed comment from menu bar

* updated css

* updated test for network list menu

* updated stylesheet

* updated ButtonIcon import

---------

Co-authored-by: NidhiKJha <menidhikjha@gmail.com>
2023-04-13 22:24:03 +05:30
Niranjana Binoy
643a89f24d
Disabling network and account changes after the send flow is initiated (#18086) 2023-04-13 12:51:20 -04:00
legobeat
135d4eaaaa
deps/security: vm2@3.9.15->3.9.16 (#18555)
CVE-2023-29199  / GHSA-xj72-wvfv-8985
2023-04-13 12:09:41 -02:30
António Regadas
300bfd6e69
[MMI] 2642 compliance modal component (#18410)
* adds component, styles and storybook file

* wip

* prettier and adds test

* prettier

* lint

* review fix

* lint

* updates to IconSize, IconName
2023-04-13 11:14:44 +01:00
Bernardo Garces Chapero
6ed72d6934
Refactor eth_getEncryptionPublicKey handling (#18319)
* add EncryptionPublicKeyController

* update message-managers package
2023-04-13 09:24:59 +01:00
Elliot Winkler
6439551075
Convert NetworkController unit tests to TypeScript (#18476)
This helps us more easily compare the unit tests for NetworkController
in this repo and the NetworkController in the `core` repo.

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-12 13:53:34 -06:00
Garrett Bear
065c499753
update ButtonIcon to TS (#18448)
* update ButtonIcon to TS

lint updates

fix lint issues

add ref

fix as prop

test updates

* box and icon updates for support

* Update ui/components/component-library/text-field/README.mdx

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

* fix disabled

* update types for as

* update readme

* fix storybook

* george changes to button icon

* revert headerbase

* box prop back to HTMLElementTagNameMap

---------

Co-authored-by: George Marshall <george.marshall@consensys.net>
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-12 08:55:24 -07:00
Mark Stacey
4c62bc445e
Update controllers to include core v42 release (#18464)
All controllers from the core monorepo have been updated to be equal to
or greater than the versions included in the v42 core release.

This release included a breaking change to all controllers because the
package `isomorphic-fetch` was removed. That package was used to ensure
that a `fetch` polyfill was present, so that the controllers could be
used in a non-browser context. This breaking change does not affect the
extension because we already install a `fetch` polyfill in our unit test
environment, and in a real build the real `fetch` API is present.

The gas fee controller had an additional breaking change: the EIP 1559
API endpoint is now a required argument. This does not affect the
extension because this argument was already being set.
2023-04-12 11:02:14 -02:30
Vinicius Stevam
6ebef431a8
Remove METAMASK_NOTIFIER (#18437) 2023-04-12 13:25:28 +01:00
Mark Stacey
7f6bdf0178
Fix e2e test for NFT interactions (#18540)
The test `should transfer a single ERC721 NFT from one account to another`
has been failing intermittently. It seems to be failing due to a race
condition; the first render shows "Send Token" but later renders show
"Send TDC". The test only passes if it runs fast enough to read the
first render of the list item component.

The test has been updated to look for the text "Send TDC", which is
what the component shows from the second render onward.
2023-04-12 09:21:33 -02:30
Dan J Miller
b3c4790f43
Ensure that all networkConfiguration object in networkController state have an id (#18513)
* Ensure that all networkConfiguration object in networkController state have an id

* Lint fix

* Update app/scripts/migrations/084.ts

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

* Add unit tests for error cases

* Simplify code

* Remove unnecessary any typing

* Fix network controller type checking

* Lint fix

* Improve typing

---------

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2023-04-11 16:46:31 -02:30
Elliot Winkler
3577d3545f
Convert NetworkController to TS (#18358)
Converting this controller to TypeScript furthers the goal of getting
this whole codebase converted, of course, but it also helps in comparing
the differences between this version of the NetworkController and the
version in the `core` repo more easily, which will ultimately help us in
coalescing the two implementations.

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-11 10:07:24 -06:00
Mark Stacey
16bfa1f728
Update the gas fee controller from v1 to v3 (#18466)
The gas fee controller has been updated from v1 to v3. The breaking
changes for v2 and v3 related to the `@metamask/network-controller`
type that was referenced. They don't affect the extension's usage of
this package, so they are non-breaking for the extension.

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-11 13:11:26 -02:30
Matthew Walsh
bb0dff9443
Trigger transaction popup using ApprovalController (#18400) 2023-04-11 14:18:43 +01:00