* feat: add new linea mainnet network
* fix: removed unused condition + lint code
* fix: update tests + fix network tab issue
* feat: add feature toggle for linea mainnet
* fix: add feature toggle for linea mainnet
* feat: add linea mainnet logo
* update @metamask/eth-json-rpc-infura package to support linea networks
* update linea mainnet block explorer url
* fix: refactor linea mainnet feature toggle
* fix: update linea mainnet chain id and rpc url
* fix: update settings-search unit test
* fix: update linea mainnet feature flag
* fix: remove useless async function keyword for linea mainnet feature flag
* update account list menu to use ds popover and fix accessibility issue
* close popover if user continues to tab to next items
* remove disable logic not doing anything
* add stylesheet
* add refs to track last menuitem
* cleaned up ref version for MenuItems
* fix test
* add click away option and fix test
* fix e2e test
* undo e2e test
* add account e2e
* fix click outside component
* remove additional line break
* remove commented out code
* add isOpen to story
* set width to 225px
* fix: refactor linea goerli testnet implementation
* fix: rename linea goerli network
* feat: add linea testnet logo
* update linea goerli block explorer url
* update @metamask/eth-json-rpc-infura package to version 8.1.0
* fix: refactor ticker map object in shared/constants/networks.ts files
* UX: Multichain: Move Add Account and Import Account into Account Menu Popover
* Create a new CreateAccount component for the Account Menu
* Add actions for import form
* Use separate actions for cancel vs. submit
* Fix jest tests
* Remove commented route navigation
* Accommodate for failing import
* Fix tests
* Remove routes for new account and import
* Remove old create account page
* Move import-account files to multichain directory
* Fix paths on the import files
* Remove deprecated component library variables
* Fix error property of add form
* Fix user-actions-benchmark
* Update `@metamask/gas-fee-controller` to v6
The `@metamask/address-book-controller` package has been updated to v3.
This version was part of the [core monorepo v53](MetaMask/core#1385)
release. The remaining packages released as part of v53 will be updated
in later PRs.
This release included a number of breaking changes, but most of them
do not affect the extension:
* Bump to Node 16
* The extension already uses Node.js v16
* The `getChainId` constructor parameter now expects a `Hex` return
type rather than a decimal string
* The extension was already passing in a `getChainId` parameter that
returned `Hex`
* The gas fee controller messenger now requires the
`NetworkController:stateChange` event instead of the
`NetworkController:providerConfigChange` event
* This does not apply if `onNetworkStateChange` and `getChainId` are
provided to the constructor, which is the case here.
* Update `@metamask/network-controller` dependency and peer dependency
* This dependency is only used for types, and none of the type
changes affect how the extension interacts with this controller.
The one change that did have an impact is that the constructor
parameter `onNetworkStateChange` now expects event handlers to be
passed the full network state.
Relates to #19271
* Ensure chainid always matches mainnet in test builds
This is a bit strange, but this is how the tests were setup previously.
* Fix accidental state mutation
* Remove hardcoded mainnet chain ID from test builds
Three e2e tests have been updated to fix a possible race condition
causing intermittent e2e test failures.
In each of the updated tests, the test checks the current network.
The check is performed as a two-step process: locate the current
network element, then check the text to ensure it's correct.
This fails when the test driver finds the element before it re-renders.
If the test runs too quickly, it compares the text before the switch
is shown on screen, and the test fails.
Instead the tests use the element locator to describe what they want.
This tells the test driver to keep looking until the conditions are
met, ensuring the test doesn't fail unless the network switch takes
longer than the default timeout (which should not happen).
This is a good example of why we should avoid using assertions on
elements in e2e tests. Express your assertions as locators instead to
make the test more resilient in the case where the test runs before the
next render.
* Add new snap header and footer to snap install
* Add new snap header and footer to snap result and snap update
* Fix loading state
* Fix lint
* Add required scrolling
* Adjust avatar component
* Apply new headers and footers to snaps confirmations
* Rename previous SnapAuthorship component to SnapAuthorshipExpanded
* Fix lint
* Fix font weight
* Fix fencing
* Fix a test
* Fix lint after rebase
* Fix E2E
* Fix locale lint
* Fix another E2E
* Fix test ID
* Address PR comments
* Better scroll button centering
* Address design comments
* Fix unit test
* Fix E2Es
* Update UI (for audit)
Revert yarn.lock change
Update e2e tests with new copy for a button
Make UI changes to custom Snap UI
Update UI on snap installation success page
Fix icon on installation success
Fix snap name font weight in installation page
Add UI changes for Snap installation failed page
Add new copy for snap installation screen
Update e2e tests OK button name
Update OK button names in e2e tests
Return previous functionality of update flow
Add error message handling for update screens
* Fix after rebase
* Fix messages.json update message
* Revert SCSS changes
* Refactor failed and success screen rendering
* Add Snaps privacy warning on snap install
Add snap install warning status to storage
Add storybook
Add test for snap-privacy-warning
Resolve button type issue
Fix popup display logic
Update fixture
Update popup information and read more handling
Replace deprecated button
Update unit test
* Update buttons and add cancel flow
* Refactoring (review 1)
* Add more unit tests
* feature(17901): fix address-book `Sends to an address book entry` e2e against MV3 build
* feature(17901): add balance guide for send-eth e2e as well
---------
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
* feature(17946): implement mv3 e2e for popup consistency after service worker restarts
* feature(17946): fix typo
---------
Co-authored-by: Dan J Miller <danjm.com@gmail.com>
* Rename `provider` to `providerConfig`
The network controller `provider` state has been renamed to
`providerConfig`. This better reflects what this state is, and makes
this controller more closely aligned with the core network controller.
All references to the provider configuration have been updated to
prefer `providerConfig` over `provider`, to make the distinction clear
between a provider and provider config.
Closes#18902
* Add migration
* Bump Circle CI docker image
* Stop removing FF since it doesn't exist
* Use Circle CI browser tools
* Fix config name
* Fix browser tools args
* Fix Chrome version
* Use script for chrome
* Try update
* Try FF without browser-tools2
* Fix FF binary path
* Force enable e2e debug
* Add some logs
* More logs
* Disable XSET check for now
* Delete x-server logic
* remove another usage of the x-server logic
* Test dapp update to v6.0.0 and tweak initial token amounts to adjust to the new contract
* Update gas estimates for new TST contract
---------
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
* feat: add yaml feature management
Add yaml feature file per build type.
Also add method to parse yaml and set
enabled features env to true. The build
process will then replace any process.env[feature]
that exists on the config by its value
* chore: add example for desktop
* Added initial draft of build features
* [TMP] Sync between computers
* Is able to succesfully build stable extension with snaps feature
* Removing var context from builds.yml
* Add asssets to builds.yml
* Minor bug fixes and removing debug logs
* [WIP] Test changes
* Removed TODOs
* Fix regession bug
Also
* remove debug logs
* merge Variables.set and Variables.setMany with an overload
* Fix build, lint and a bunch of issues
* Update LavaMoat policies
* Re-add desktop build type
* Fix some tests
* Fix desktop build
* Define some env variables used by MV3
* Fix lint
* Fix remove-fenced-code tests
* Fix README typo
* Move new code
* Fix missing asset copy
* Move Jest env setup
* Fix path for test after rebase
* Fix code fences
* Fix fencing and LavaMoat policies
* Fix MMI code-fencing after rebase
* Fix MMI code fencing after merge
* Fix more MMI code fencing
---------
Co-authored-by: cryptotavares <joao.tavares@consensys.net>
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
* Add updated version of the Snaps list UI
Add more changes to match the designs of snaps list
Add next design iteration for snaps list
Update icons, sizes and pointer behaviour
Add redesign for snap settings page
Refactor and improve designs
Fix unit tests and refactor code
Fix e2e test
Fix lint
Update margin values
Add CSS override for connected sites list and update margins
Update paddings as requested
Fix vertical alignment of links
Fix tooltip position on the enable button
Add usage of getSnapName function for displaying snap names
Fix e2e tests and update date format for snap install date
Improve unit test for snap-settings-card
Change installation info logic
Update mocked state for snap
Add tests for ViewSnap component, refactor and update mocked state
Add check for version info
Change Snaps icon in Settings
Refactor Snaps list to use selector
Add handling in case of missing version history
* Fix icon ref
* Remove console logs
* Remove onClick from selector
* Add code fencing for imports in selectors.js
* 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>
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.
* NFTs: Use Unknown Collection instead of first NFT name
* Use localization in hook
* Get localization for previously owned
* Fix tests
---------
Co-authored-by: Dan Miller <danjm.com@gmail.com>
* fix(18194): Redirect to extension expanded view when click back to safety button
* Bump phishing warning version
---------
Co-authored-by: Dan J Miller <danjm.com@gmail.com>
The `network` store of the network controller crams two types of data
into one place. It roughly tracks whether we have enough information to
make requests to the network and whether the network is capable of
receiving requests, but it also stores the ID of the network (as
obtained via `net_version`).
Generally we shouldn't be using the network ID for anything, as it has
been completely replaced by chain ID, which all custom RPC endpoints
have been required to support for over a year now. However, as the
network ID is used in various places within the extension codebase,
removing it entirely would be a non-trivial effort. So, minimally, this
commit splits `network` into two stores: `networkId` and
`networkStatus`. But it also expands the concept of network status.
Previously, the network was in one of two states: "loading" and
"not-loading". But now it can be in one of four states:
- `available`: The network is able to receive and respond to requests.
- `unavailable`: The network is not able to receive and respond to
requests for unknown reasons.
- `blocked`: The network is actively blocking requests based on the
user's geolocation. (This is specific to Infura.)
- `unknown`: We don't know whether the network can receive and respond
to requests, either because we haven't checked or we tried to check
and were unsuccessful.
This commit also changes how the network status is determined —
specifically, how many requests are used to determine that status, when
they occur, and whether they are awaited. Previously, the network
controller would make 2 to 3 requests during the course of running
`lookupNetwork`.
* First, if it was an Infura network, it would make a request for
`eth_blockNumber` to determine whether Infura was blocking requests or
not, then emit an appropriate event. This operation was not awaited.
* Then, regardless of the network, it would fetch the network ID via
`net_version`. This operation was awaited.
* Finally, regardless of the network, it would fetch the latest block
via `eth_getBlockByNumber`, then use the result to determine whether
the network supported EIP-1559. This operation was awaited.
Now:
* One fewer request is made, specifically `eth_blockNumber`, as we don't
need to make an extra request to determine whether Infura is blocking
requests; we can reuse `eth_getBlockByNumber`;
* All requests are awaited, which makes `lookupNetwork` run fully
in-band instead of partially out-of-band; and
* Both requests for `net_version` and `eth_getBlockByNumber` are
performed in parallel to make `lookupNetwork` run slightly faster.
* added the rest of the sev1 warnings to getSnapInstallWarnings
* added and updated translations
* Updated getSnapInstallWarnings to include warnings for all weight-1 permissions
* Updated snap install warning and css according to designs
* fix snaps tests
* fixed alignment/spacing
* updated e2e tests to click through the newly displayed public key access warning
* lint fix
* fixed update snap test
* refactored getSnapInstallWarnings, moved logic to PERMISSION_DESCRIPTIONS
* fix logic to account for objects & arrays
* update function description
* add missing properties to ethereum provider description
* moved id and message to baseDescription to fix error
* add optional chaining to fix undefined error
* more optional chaining
* more optional chaining
* Update UI related to MetaMask Snaps Platform trademark
* Remove redundant UI text according to new designs
* Fix lint errors
* Fix e2e test expectation
* Fix lint in test
* Fix e2e test expectation
* Fix some UI parts
* Update CSS for noSnaps message
* Add next design iteration
* Add minor fix
* Update locale message
* Fix learn more text size
* Refactor usage of design system components
---------
Co-authored-by: Erik Marks <rekmarks@protonmail.com>
The `HardwareKeyringTypes` constant has been renamed to `KeyringTypes`
and moved to a separate constants module, to reflect that it contains
more than just hardware wallet keyring types. This corrects a mistake
made recently during a TypeScript conversion.
* Added fallback copy for when we're not able to retrieve a erc721 or erc1155 name in the setApprovalForAll screen and added unit tests
* Fixing lint
* Review requested changes
* Modify small copy changes in messages.json
* Fixing nft e2e tests
* Fixing nft e2e tests final
* Added snapshots for tests and removed data-testid
* Modify translation messages and e2e tests
* add e2e test for onboarding flow
* Add method to test if we create a new wallet
* fix code
* editng code
* Add test if import wrong SRP
* fix test
* add test where we chack if user select diffrent type of SRP
* update test for checking if user select different SRP
* update code
* add test for if user enter wrong password in confirm password field
* add two test to verify if user is on correct page after import wallet
* update cod
* lint fix
* fix code to test pass
* fix code
* improve code
* change completeCreateNewWalletOnboardingFlow function parameters and update code
* delete unnecessary wait
---------
Co-authored-by: dzfjz <120640011+dzfjz@users.noreply.github.com>
Co-authored-by: dzfjz <dzenana.fejzic-ext@consensys.net>
* Revert "Moved subscribe and filter into network controller (#16693)"
This reverts commit 6f6984fa58. That
commit was an RPC middleware refactor intended to move the subscribe
and filter middleware into the network controller, to simplify the
process of sharing this middleware between clients.
This refactor resulted in `eth_subscribe` notifications being sent on
the wrong connections, causing the UI to break in some cases (the UI
`provider` connection does not support notifications). This happened
because the `setupProviderEngine` function runs per-connection,
whereas the engine setup inside the network controller is global. The
global network client cannot support notifications because it has no
way to route them; they'll need to stay in the per-connection provider
engine.
Closes#17467
* Add e2e test
An e2e test has been added that confirms subscriptions are only
broadcast to the site that registered them. This test fails on
`develop`.
* NFTs: Remove feature flag for release
* Update security tab jest test
* Fix broken test
* Update snapshot
* Update test
* Fix test
* remove nft build
* move tests to main e2e job
* remove nft scripts
* remove test for nft build
---------
Co-authored-by: David Walsh <davidwalsh83@gmail.com>
* adding base what's new for NFT autodetection
* lintfix
* Adding nfts svg image
* adding new notification to fixture builder for e2e
* lint:fix
* Adding new messaging, styling what's new
* styling descriptions, increasing fullscreen height
* applying firstNotification styling to NFT whats new announcement
* adding scrollDown button to whats new popup
* adding Opensea announcement, removing old announcement, moving scrollDown button up to popover component
* verify-locales:fix
* updating icon
* Removed a feature flag
* Add test for transaction security provider
* add rest of the test cases for transaction security provider
* change code
---------
Co-authored-by: Filip Sekulic <filip.sekulic@consensys.net>
* Added test for submitting second swap without waiting for first one to finish
* Added more test code
* Removed look around Review Swap button
* Added test verification for the transaction details
* Changed mocked API for token import
* Added assert error messages
* Fixed lint errors
* Removed empty lines and improved coding consistency
* Removed empty lines
* added long test
* Wait for a maximum of 65 seconds, not a hardcoded length
* Fix lint
---------
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
This release only includes one breaking change, which is the renaming
of the package to be under the `@metamask` scope. It includes
improvements to the types that will unblock migrating our network
clients to TypeScript.
The PhishingController has been updated to v2. This release should
dramatically reduce network traffic and double the update speed of the
phishing list.
This was accomplished by combining both of our phishing configurations
into one list (the "stalelist"), then creating a separate list of the
changes just the past few days (the "hotlist"). Now users will download
a smaller list more frequently (every 30 minutes rather than every
hour), whereas the full list is only updated every 4 days.
The combined configuration means that we no longer know which list was
responsible for each block. The phishing warning page has been updated
to dynamically look this information up, to ensure users are still
directed to the correct place to dispute a block. This update to the
phishing warning page also includes the recent redesign.
* feat: add desktop enable button component
This component will be added
to the experimental page. Users
will then be able to initialize
a desktop connection
* feat: add desktop pairing page
* feat: add desktop deep-linking shared lib
* test: add initial entries to render helper
Allow specifying initialEntries for
MemoryRouter. This change will allow
testing pages that use the useParam
hook.
* feat: add desktop error page
Error page for any desktop pairing
related issue
* feat: add desktop routes to route component
* feat: add enable desktop button to experimental tab
* feat: add desktop icon when paired in dev mode
* feat: disable ledger live control when desktop enabled
* feat: register desktop error actions on ui init
* fix: add missing code fencing
* chore: remove enable desktop rpc middleware
Now that we are adding the UI
there's no need for this rpc middleware
(as it was used to test desktop background
code)
* fix: display experimental tab for desktop
Use DesktopManager in background script to redirect internal and external connections to the desktop app.
Include DesktopController in the MetaMask controller.
Support desktop keyrings in MetaMask controller via the overrides object.
Create middleware handler to connect to the desktop app while UI code is pending.
Add build system support for desktop specific configuration variables.
* Ensure simulation failure warning is shown on all networks and accounts
* Add e2e test to cover failure warning behaviour on non-eip-1559 network
* Fix new e2e test