* Fix account details editable label
* Fix font-weight of the password label
* Remove duplicate error
* Hide password warning on first screen after bad password, autofocus password field
* Fix jest failure
* Restore className
* Addressed some lint issues.
* Worked on the mentioned lint issue.
* Worked on the CRLF lint issues.
---------
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: George Marshall <george.marshall@consensys.net>
* Fixed UI updates for header
* updated padding
* replaced grey avatar border with white color and updated snapshots
---------
Co-authored-by: David Walsh <davidwalsh83@gmail.com>
* added eth sign first step
* added modal
* added validation for form
* updated width with block
* added state trigger for toggle
* updated Eth sign modal text changes
* added eth sign toggle tex
* removed unnecessary code
* fixed form validation text
* updated eth toggle text
* added test
* added analytics
* updated design changes
* lint fix
* updated error text
* updated changes
* 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
The `getProviderConfig` selector is now used anywhere the `provider`
state was previously referenced directly. This was done to simplify
renaming this state from `provider` to `providerConfig` in a later PR.
Note that there are many opportunities left to use more-specific
selectors (e.g. `getChainId()` over `getProviderConfig().chainId`), but
that was intentionally omitted from this PR to reduce the size. I
started going down this path and it quickly exploded in scope.
Relates to #18902
* Adding strong tag support for Text component
* Update build-quote.js
* Update awaiting-signatures.js
* Used <strong> tag in a better way.
* Remove <strong> tag from file: awaiting-signatures.js
Co-authored-by: Danica Shen <zhaodanica@gmail.com>
* Update awaiting-signatures.js
* Update ui/components/component-library/text/text.scss
Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
* Update ui/pages/swaps/build-quote/build-quote.js
Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
* Removing unintended UI and strong css from Text component
---------
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
Co-authored-by: Danica Shen <zhaodanica@gmail.com>
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
* 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>
* Part of #17670 Replace Typography with Text component.
* Worked on the mentioned lint issues.
* Upgrading to enum version.
Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
* Upgrading to enum version.
Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
---------
Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
Co-authored-by: George Marshall <george.marshall@consensys.net>
* Unit tests for Hide Token Confirmation modal
* Unit test for Export Private Key modal
* Unit test for Customize Nonce modal
* Bump coverage targets
---------
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
* switched to use banner alert and added story
* enabled dismiss functionality
* remove close button
* bump global branches coverage target
* replace Typography with Text and (link) Button with ButtonLink
* unit test for component rendering
* left-align button links to match text
* update copy to reflect figma mock ups
* update unit test snapshot
* bump coverage threshold
* update snapshot to reflect button component changes
* update snapshot to reflect box changes
* updated ethereum logo icon
* Updating eth logo (#18631)
* Updating eth logo
* Removing border from eth logo identicon
* Removing old eth logo
* updated snapshot and lint errors
* updated eth logo from svg to png
---------
Co-authored-by: George Marshall <george.marshall@consensys.net>
* 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>
* 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>
* 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>
* Add permission cell component
Add storybook and handling for revoked permission colors
* Fix things after conflict resolve after rebase
* Add code refactoring and minor UI changes
* Add permission cell component to snap-update flow
* Update storybook
* Add unit tests for permission cell
* Update component padding
* Fix spacing between permission cells
* Fix main icon color for approved permissions
* Update width value with constant
We want to convert NetworkController to TypeScript in order to be able
to compare differences in the controller between in this repo and the
core repo. To do this, however, we need to convert the dependencies of
the controller to TypeScript.
As a part of this effort, this commit converts
`shared/constants/metametrics` to TypeScript. Note that simple objects
have been largely replaced with enums. There are some cases where I even
split up some of these objects into multiple enums.
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
* added site connection menu component
* reverted change for unlock page
* updated snapshot
* updated state with useSelector
* updated state for connected
* updated icons
* updated test
* updated snapshot
* moved component to multichain folder
* updated color
* added multichain connection to menu bar
* updated default color
* updated css
* updated multichain site with connected site info
* updated ui for not connected state
* removed scripts
* updated lint errors
* updated lint errors
* updated stories
* updated story for not connected to current state
* updated story for not connected to current state
* updated badge to 16px
* updated badge position
* updated snapshot
* fixed lint errors
* updated not connected state icon
* updated constants for status and added new locale string
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.
* add fallbacks for confirmation title on nft transfers
* Add token name and id
* fix
* fix test
---------
Co-authored-by: David Walsh <davidwalsh83@gmail.com>
* 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
* Ensure that NonInfuraDefaultNetworks are only selected in the dropdown if they are the currently selected network
* Ensure Linea Goerli network appears in network settings tab if added manually
* feat: add the consensys zkEVM as a default network
* fix: change infuraNetworkStatus in navigate-txs file
* fix: remove account tracker for zkEVM + remove zkEVM from infura list
* fix: change consensys zkevm name to linea + change rpc url for linea network
* fix: rebase conflicts
* feat: add new colors for linea goerli network
* feat: add new function inside network dropdown to render non infura networks
* feat: add feature toggle for linea network
* fix: add new unit test
---------
Co-authored-by: Dan J Miller <danjm.com@gmail.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.
* Add tooltips to show info about a permission
* Make Tooltip component in scope regardless of build type
* Add descriptions
* Add translation variables and fix tooltip
* Use new icons
* Add missing description after rebase
* Fix build issues
* Fix icons
* Fix translation
* Add missing description
* Fix Ethereum icon
* Update coverage
* 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
* NFTs: Remove feature flag for release
* Update security tab jest test
* Fix broken test
* Update snapshot
* Update test
* Fix test
* Remove last usages of flag
* Update CI jobs
* Fix jest tests
* Use tokenList to get token details, when available, in getTokenStandardAndDetails
Previously, every call to getTokenStandardAndDetails would fetch data via the provider.
This would result in at least 3 network requests whenever that method is called for an
ERC20 token, contributing to unneccesary loading and lagging in multiple places.
This commit takes advantage of stored data we already have available to avoid the unnecessary
loading.
* Lint fix
* Fix build-quote test
* bump coverage targets
* Pass provider to token-util, for use in ethers Contract module
* Check all possible sources of ERC20 token data before async call to assetsContractController
* Add and update tests
* Update app/scripts/metamask-controller.js
Co-authored-by: Alex Donesky <adonesky@gmail.com>
* Update app/scripts/metamask-controller.js
Co-authored-by: Alex Donesky <adonesky@gmail.com>
* Remove unnecessary this.ethQuery changes
* Use metamask-eth-abis instead of human-standard-token-abi in token-util.ts
* Add explanatory comments to getTokenStandardAndDetails
* lint fix
* Cleanup
* fix test
* Update app/scripts/metamask-controller.js
Co-authored-by: Alex Donesky <adonesky@gmail.com>
* update error message
---------
Co-authored-by: Alex Donesky <adonesky@gmail.com>
* Add Bridge button
* Add newline to the end of bridge svg
* Move Portfolio button
* Vertically center Portfolio button
* Use IconButton for Portfolio button
* Change portfolio button size
* Lowering coverage to get this in for release by a very small amount
* Add unit tests for Portfolio button
---------
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
* Fix incorrect balance in signature request header
* Fix unit tests
* Fix tests and increase unit test coverage
* actually fix unit tests
---------
Co-authored-by: Dan Miller <danjm.com@gmail.com>
* feat: disable deposit popover and replace it with global redirect to onramp on pdapp
* feat: remove legacy code for hardcoded onramp providers
* fix: remove unused visuals and components related to legacy code of deposit popover
* fix: remove unused messages
* feat: use a custom hook for all onramps related methods and variables
* fix: modify the custom hook implementation to include test networks
* fix: remove deprecated file buy-url
* fix: remove references for deleted deposit logos
* fix: network-controller failing unit test
* fix: snapshot loading-swaps-quotes-stories-metadata.test.js.snap
* fix: storybook tests
* fix: remove unused constatns related to buyable onramp chains
* fix: remove unused variables and fix eslint
* adding unit test for useRamps custom hook
* feat: add comment on the proper usage of useRamps within confirm-page-container component
* fix: add unit tests for buy button in token-overview page
* fix: add unit test for open the buy crypto URL for a buyable chain ID in token page
* feat: add unit test coverage for eth-overview page
* fix: update locales
* 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
* refactor class to functional component
* update messages
* fix: use classnames
* feat: add hold to reveal modal
* feat: add new zendesk url for secret recovery phrase and noncustodial wallet
* update: clipboard to clear copied text after delay
* fix: remove save to csv
* feat: update styles for reveal seed page
* fix: update reveal seed snapshot
* add test to check for modal
* fix: lint
* fix: unused messages locale
* fix: use new banner component
* fix: use new button from design system
* fix: update snapshot
* fix: lint
* revert text
* fix: lint
* fix: remove --copy-only
* fix: marginBottom prop value
* fix: iconName and prop error
* --made the QR code slightly smaller so it's less likely to have a scrollbar
--updated the snapshots
* fix: error message not displaying
* SRP hold to reveal using more DS components (#17583)
* Updating to add DS components and remove CSS
* Fixing rendered html and removing some unneeded props
* fix: set block to true
---------
Co-authored-by: Monte <monte.lai@consensys.net>
* fix: add descriptions to messages
* Update ui/components/ui/export-text-container/export-text-container.component.js
fix: lint
Co-authored-by: HowardBraham <HowardBraham@users.noreply.github.com>
* fix: remove using displayWarning in requestRevealSeedWords
* fix: update test to remove displayError
* fix: update design system enums
* fix: messages descriptions
* fix: banner to banneralert
* fix: update preview
* add additional tests
* fix: use jest instead of sinon
* add test if long press isn't completed
* add test if password is wrong
---------
Co-authored-by: Howard Braham <howrad@gmail.com>
Co-authored-by: George Marshall <george.marshall@consensys.net>
* UX: Update block explorer icon
* Removing unneeded CSS and some HTML bloat
* Removing unneeded className
* Removing unneeded CSS and reducing HTML bloat for ContractTokenValues
---------
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
* Add ipfs gateway and collectible state to mock-state.json
* Add collectible-default-image test with snapshot and testids
* Add Collectible Details test, snapshot, and test-ids
* Add Collectible Options tests and test-ids
* Add Collectible Items test and test-ids.
* Add more tests to Add Collectible component
* Update Security Tab snapshot with ipfs gateway state value
* Add data-testid to Menu component for menu background
* Lint
* Bump coverage targets
* Remove commented import
---------
Co-authored-by: David Walsh <davidwalsh83@gmail.com>
* Add hardcoded list of human-readable snap names
* Make the text properly bold
* Small style fixes to approval screen
* Run yarn lint:fix
* Update snapshots
Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
Co-authored-by: Dan J Miller <danjm.com@gmail.com>
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
* Fixed navigation through multiple unapproved transactions for ERC20 tokens
* Fixed tx details activity-log currency
* Fixed e2e test failure
* Added navigation between multiple sign prompts and reject all sign prompts
* Resolving conflicts
* Creating SignatureRequestNavigation component and extracting the UI rendering part into a single component
* Fixing e2e tests and updating snapshot
* Using single component for navigation which shows both messages and transactions requests
* Fixing test-unit-jest-main
* Added more unit tests
* Fixing test-storybook
* Fixing test-storybook
---------
Co-authored-by: Filip Sekulic <filip.sekulic@consensys.net>
* Use network provider state, instead of CurrencyRateController state, select 'nativeCurrency'
* Fix unit tests
* Lint fix
* Only use the network provider ticket for the native currency when useCurrencyRateCheck is false
* Fix unit test
* Fix tests for real
* added storybook test runner
* added test runner in ci
* updated test for ci and fixed lint error
* updated lavamoat policy
* updated test command
* updated playwright
* changed command to storybook;ci
* updated command
* updated instance for test-storybook
* updated playwright
* added playwright step
* replaced concurrently with start-server-and-test
* updated the static storybook directory
* replaced first with last
* updated lock file
* replaced first with last
* updated test-storybook with maxworkers
* updated .depchechrc
* updated yml
* removed id from banner base
* replaced broken stories with .stories-to-do.js extesnsion
* updated token allowance story
* removed duplicacies from yarn
* fixed lavamoat
* removed filename comment
* updated links for docs
* fixed file extension for stories
* updated path for stories.json
* updated stories.json path
* yarn updated
* updated stories
* updated yarn
* updated wait on
* Fixing error when user input some letter in token allowance flow
* Rename the regex variable name and added a brief comment above its definition
Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
* Add transaction activity log component
* Remove duplicate tx activity log snapshot.
* Convert Advanced Tab to tlr.
* Lint fix
* Change ENS to DNS in mock state data.
* Add test ids for speedup, cancel, rety buttons.
* Convert TransactionListItemDetails component to RTL.
* Convert PageContainerHeader component to RTL.
* Convert TokenInput component to RTL.
* Convert UnitInput component to RTL.
* Convert withModalProps to RTL.
* Convert i18n-helper to RTL.
* Convert ConfirmSeedPhrase component to TLR.
* Convert AddRecipient component to RTL.
* Set process.env metamask build type to 'main' for test
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
* Validating or restricting the number of digits after the decimal point that the user can enter and styles for Max button and description with error message
* Use better solution for validation the number of digits on token allowance flow
* fix: Display primaryType in signTyped instead of 'Message' string
* fix: added #17077 to changelog
* fix: remove unused signatureRequest1 message to fix test-lint failure
* Update CHANGELOG.md
Co-authored-by: Dan J Miller <danjm.com@gmail.com>
* test: add assertion for the primaryType to signature-request component test
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: Dan J Miller <danjm.com@gmail.com>
* Align custom spending cap Max button in approve screen for multiple languages
* Modify some css styles and adding Box props
* Using ButtonLink component instead of <button/>
Co-authored-by: Brad Decker <bhdecker84@gmail.com>