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

784 Commits

Author SHA1 Message Date
David Walsh
a5ee4097f5
Dark Mode: Fix Onboarding image text color (#13983) 2022-03-16 17:22:13 -05:00
David Walsh
e2a6bcfc6b
Dark Mode: ENS Input (#13984) 2022-03-16 17:21:55 -05:00
Brad Decker
116d6b0eb8
add asset_type to transactions (#13858) 2022-03-16 17:15:03 -05:00
David Walsh
13e9a2a479
Dark Mode: Update login screeen colors (#13992) 2022-03-16 14:03:10 -05:00
Guillaume Roux
ad28c81a39
General backgrounds and borders design token updates (#13764)
Co-authored-by: Guillaume Roux <guillaumeroux123@gmail.com>
Co-authored-by: George Marshall <george.marshall@consensys.net>
Co-authored-by: David Walsh <davidwalsh83@gmail.com>
2022-03-16 15:49:25 +01:00
Mark Stacey
c7fabbff87
Add data-test-id prop to TextField component (#13973)
The `data-test-id` prop has been added to `TextField`. This prop allows
selecting this component more easily from e2e and unit tests. This is
required for a subsequent PR that includes a text field that cannot be
selected for by placeholder or contents or label (any of which would
have been preferable).
2022-03-15 20:42:37 -02:30
David Walsh
cd28e64539
Dark Mode: Select Account Hardware Wallets (#13917) 2022-03-15 14:35:23 -05:00
David Walsh
cd11f90f8f
Add labels to provide better accessibility during onboarding v2 (#13890) 2022-03-14 20:27:02 -05:00
David Walsh
8143222f92
Dark Mode: Fix currently selected network color (#13918) 2022-03-14 20:26:51 -05:00
VSaric
060c6d651c
Remove usages of useMetricEvent hook (#13930) 2022-03-14 13:12:38 -05:00
Frederik Bolding
c81912f6c5
Show snap version on install (#13931)
* Add version to Snap install page

* Fix text sizing inconsistency

* Use a localized string for shorthand versions
2022-03-14 18:40:21 +01:00
Daniel
5aff1863ca
Improve slippage input validation in Swaps (#13914)
* Improve client-side validation for the slippage input

* Improve validation of the slippage input field

* Use Number instead of toNumber
2022-03-14 15:41:03 +01:00
George Marshall
8e0f71a008
Fixing dropdown caret for dark and light mode (#13911) 2022-03-11 11:09:15 -06:00
David Walsh
a6924b1224
Dark Mode: Import account text field (#13909) 2022-03-11 10:45:26 -06:00
Ariella Vu
fa15b32fab
ConfirmAddSuggestToken: replace mapDispatchToProps & mapStateToProps; Add Tests (#13526)
* ConfirmAddSuggestedToken: component.js -> .js

* replace mapStateToProps w/ useSelector
ConfirmAddSuggestedToken

* replace mapDispatchToProps w/ useDispatch
ConfirmAddSuggestedToken

* ConfirmAddSuggestedToken: useHistory

* ConfirmAddSuggestedToken: revert scss
reuse ConfirmImportToken styles for now

* ConfirmAddSuggestToken: add tests

* ConfirmAddSuggestedToken: rm unused controls

* ConfirmAddSuggestedToken: rm snapshot

* use `metamark.svg` instead of `metamask.svg`

* ConfirmAddSuggestedToken: update useSelectors

* Revert "ConfirmAddSuggestedToken: revert scss"

This reverts commit 07aed4576caaf247cb38ad481d79a339ba3d3947.

* ConfirmAddSuggestedToken:  === undefined
w/ strict mode

* ConfirmAddSuggestedToken: use useNewMetricEvent

* ConfirmAddSuggestedToken: run useEffect once

* ConfirmAddSuggestedToken: rm unused async

* ConfirmAddSuggestedToken: rm mock redux store

* ConfirmAddSuggestedToken: duplicate ConfirmImportToken styles

* ConfirmAddSuggestedToken: update metrics logic

* ConfirmAddSuggestedToken: metricEvent-> trackEvent

* ConfirmAddSuggestedToken:clean useEffect w/ new fn
- PR suggestion: https://github.com/MetaMask/metamask-extension/pull/13526#discussion_r818007393

* ConfirmAddSuggestedToken: rm unused .token-balance styles
2022-03-10 23:40:06 -03:00
Shane
1f55af3151
Fixed firefox Snaps + add initial end-to-end tests (#13671)
* Changed registryUrl for snaps only in firefox
Fixed getPlatform to only be imported into metamask-controller in flask
Removed snaps specific testrunner script and use run-all with a cli option

* Fixed flakey tests

* Removed unneeded await

* Added delay

* Fixed linting
2022-03-10 14:01:55 -08:00
George Marshall
a056baf944
Updating ActionableMessage to use theme colors (#13899) 2022-03-10 12:35:56 -08:00
Shane
adce5c558d
Fixed serialization of error parameter for rejectPendingApproval across JSON-RPC (#13847)
* Fixed serialization of error parameter for rejectPendingApproval across JSON-RPC

* Fixed linting

* Added serialize error to add-ethereum-chain
2022-03-10 09:55:25 -08:00
Ariella Vu
f09459cb84
ConfirmImportToken: rm unused .token-balance style (#13900) 2022-03-10 14:15:28 -03:00
Frederik Bolding
0d961a655e
Fix permission site origin overflow (#13868)
* Fix permission site origin overflow

* Standardize connect flow a bit

* Another standardization change

* Fix another chip width issue

* Standardize snap install

* Fix lint

* Fix overflow after rebase
2022-03-10 18:03:32 +01:00
filipsekulic
c439953d94
Fixed issues in onboarding flow (#13826) 2022-03-10 10:33:53 -06:00
Alex Donesky
c77f736378
fix small bug where max transaction fee isn't properly passed through confirmation screen flow (#13893) 2022-03-09 16:13:26 -06:00
Hennadii Ivtushok
c666849c31
Snap removal confirmation (#13619)
* Add Snap removal confirmation

* Add styling for Snap removal confirmation

* Update styling

* Update button margin

* Re-use styling code

* Address comments

* Update Popover props

* Lint

* Lint

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
Co-authored-by: Erik Marks <rekmarks@protonmail.com>
2022-03-09 22:20:48 +02:00
George Marshall
fa4d884a87
Find and replace of all typography colors to design tokens (#13885) 2022-03-09 07:24:53 -08:00
Alex Donesky
3747ace06b
Refactor token send/method confirmation flow (trimmed down) (#13788)
* make use of getTokenStandardAndDetails method exposed on assetsContractController to determine how to represent the contract being interacted with in token contract method calls
2022-03-09 08:38:12 -06:00
David Walsh
cf46dbf654
Ensure only accounts list scrolls in Permissions popup (#13859)
Co-authored-by: ceamkrier <ceamkrier@gmail.com>
2022-03-08 17:06:05 -06:00
George Marshall
55abc00c34
Updating all caret icons for dark mode 🥕 (#13861)
* Updating all caret icons

* lint fixes

* Fixing settings search list
2022-03-08 13:50:35 -08:00
filipsekulic
ac9f263e1a
Write down your SRP page fixes (#13729)
* Fixed few things in 'Write down srp page' flow

* Applied requested changes

* Modified messages

Co-authored-by: Alex Donesky <adonesky@gmail.com>
2022-03-08 09:38:07 -06:00
Brad Decker
9cea401022
extract determineTransactionType from tx controller (#13737) 2022-03-07 12:54:36 -06:00
Niranjana Binoy
4bb3ba4aef
Adding new settings dropdown for Dark mode in Experimental tab (#13097) 2022-03-07 12:53:19 -06:00
dragana8
658f0be63f
Update privacy page text (#13795) 2022-03-07 11:37:54 -06:00
Niranjana Binoy
f52fbd4684
Showing new message while converting token to NFT (#13838)
* adding new message while converting token to nft if the nft is already added via nft flow.

* updating the copy

Co-authored-by: Alex Donesky <adonesky@gmail.com>

Co-authored-by: Alex Donesky <adonesky@gmail.com>
2022-03-07 10:42:22 -06:00
VSaric
bea907e437
Create password page (#13792) 2022-03-07 09:35:03 -06:00
George Marshall
395806943f
Updating colors in various components js and css (#13831) 2022-03-04 08:47:32 -08:00
Alex Donesky
039c405314
create branching logic for different types of contract interactions for identifying the contract address (#13776) 2022-03-03 13:56:20 -06:00
ryanml
52981e1967
Restoring create password form layout (#13824) 2022-03-03 13:50:58 -03:30
ryanml
ce495d7a66
Revert "Allow sending up to 15 decimals on the send screen (#12707)" (#13823)
This reverts commit 8597cd1401.
2022-03-02 17:28:56 -07:00
ryanml
0a01c0e260
Persisting token address via URL (Token Details page) (#13807) 2022-03-02 09:01:53 -07:00
Olusegun Akintayo
6d54897cfb
Fixed these issues in v10.11.0 (#13806)
After landing on Swap, a disclaimer of Smart Transactions appear, and an error on devTools shows the following: “invalid prop ‘type’ of value ‘ul’” supplied to ‘Typography’
    After enabling Smart Transactions, an error on devTools shows the following: “invalid prop ‘smartTransactionsOptInSatus’ of type ‘boolean supplied to ‘SlippageButtons’

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-03-02 19:59:31 +04:00
Jyoti Puri
137b47370e
Confirm transaction page: show contract address details in title (#13683) 2022-03-02 20:56:53 +05:30
Ariella Vu
e4181ec581
ConfirmImportToken: update metrics logic (#13775) 2022-03-02 11:03:44 -03:00
Daniel
42fd5d19f4
Content and UI updates for the STX modal (#13798)
* Update content and UI for STX modal

* Update the main header image for STX

* Capitalize Smart Transactions in the button label
2022-03-01 19:18:20 +01:00
Niranjana Binoy
96ab979e7c
UI/UX update - Error message in Import NFT (#13772) 2022-02-25 20:17:42 -05:00
ryanml
fda5b54def
Handling undefined case for token balance (Token Details) (#13759) 2022-02-25 17:00:51 -07:00
Guillaume Roux
23e6c073c4
Dark Theme setup and button theming (#13651)
* Add design-tokens and apply colors to button

* swap more colors

* tweak button and add dark theme switch to storybook

* tweak buttons

* fix typo

* remove comments

* add dep to ignored list

* fix linting issue

* fix linting issues

* Updating some styles and removing some deprecated buttons (#13742)

* Updating some styles and removing some deprecated buttons

* Warning button fixes

* Fixing warning text for darkmode

* bump design tokens and update storybook theme strategy

Co-authored-by: George Marshall <george.marshall@consensys.net>
2022-02-25 14:11:22 -08:00
VSaric
bd54fafe7d
Import SRP page (#13568)
* Import SRP page

* Moved url link for SRP to the zendesk urls constant in the constants folder
2022-02-25 10:15:57 -06:00
amerkadicE
3ed08a09e4
[FIX #12760] Highlighting on search (#13730) 2022-02-24 13:06:30 -06:00
Daniel
6dd141ebfd
Small fixes for Swaps (#13732)
* Fix: Insufficient number of substitutions for key "stxSuccessDescription"

* Only calculate "approvalGas" if the "approvalNeeded" param is truthy in a quote

* "Swap from" has to be set to enable "Review Swap", set a default token for "Swap from"

* Fix: Unable to find value of key "undefined" for locale

* Use array destructuring
2022-02-23 22:10:28 +01:00
ryanml
d4f694c49f
Fix token details icon when 'Use Token Detection' is enabled (#13726) 2022-02-23 13:43:41 -07:00
Hassan Malik
219f8e6299
minor fixes per snaps pr comments (#13721) 2022-02-23 15:16:41 -05:00
ryanml
e600ecedbf
Fixing blockies on token detail page (#13728) 2022-02-23 11:57:16 -07:00
VSaric
a0602f1c0e
Success page (#13570) 2022-02-23 10:41:06 -06:00
VSaric
6b996a7979
Secure your wallet page (#13571)
* Secure you wallet page

* Remove seedPhraseIntroSidebarBulletThree from messages.json

* Change the second bullet from Figma design

* Requested review changes
2022-02-23 10:36:58 -06:00
Alex Donesky
7ddd8cfede
fix issue where token details page unnecessarily relies on send asset state (#13717) 2022-02-23 10:20:42 -06:00
dragana8
662c19d4da
Implement Network specific insufficient currency warning #12965 (#13182)
* added warning

fix

added warning for send screen

fix

changed condition

fix

fixed test

review updates

* review updates

* fix

* fixed failing test

* added check for transaction type

* fixed failing unit test

* added description for localization

* review updates

* review updates
2022-02-23 11:33:01 -03:30
igorms-cons
f5e86d0351
Feat/settings search (#13214)
* fix error with color variable - fix rebase

* clean list search & fuse threshold decreased

* update search-icon , fix tests

* nice to have highlighting text & cleaning

* unit test on settings & search input ui up on expanded view

* fix color variable in alert scss

* setting search input padding right up

* fix dom warning

* util/search test added & Dom element warning fix

* renaming files

* fix color text in settings search

* settings search highlight text refacto & fix ui

* fix settings-search test & renaming

* Fix styling on search field for edge cases, update components and e2e

E2E tests update for search feature

Update components from class to functional component

		#

Fix storybook for search box

Fix styling

Fix unit tests

fix: remove z-index

Fix unit tests

Co-authored-by: amerkadicE <amer.kadic@endava.com>
2022-02-22 17:28:21 -03:30
AndreasGassmann
355e5ab399
Add AirGap Vault detail links (#13650) 2022-02-22 13:00:51 -06:00
Niranjana Binoy
bf8f331297
Update "Forgot Password?" copy (#13493) 2022-02-22 10:45:19 -05:00
Jyoti Puri
60aa69a624
Confirm transaction page: use method name only for contract transactions (#13643) 2022-02-22 11:28:04 +05:30
fadnesscharlie
3d5da527f9
Added Controls and Action ArgType, took out @storybook/addon-knobs (#13660)
* added controls and took out unused code

* Fix Lint Issues
2022-02-21 08:13:11 -06:00
Daniel
2585f45bde
Add support for Smart Transactions (#12676) 2022-02-18 17:48:38 +01:00
Daniel
120603e6df
Enable Avalanche for Swaps (#13653) 2022-02-18 15:24:47 +01:00
Rob Dawson
e082334da8
Fixed Add Recipient Stories and migrated to use control args. (#13633) 2022-02-17 10:14:10 -06:00
Rob Dawson
93af95f968
Minimal fix to the TokenSearch story to ensure it compiles and works. (#13623) 2022-02-17 10:13:30 -06:00
Daniel
cbf8a737dc
Change "Quote X of Y" to "Fetching quote X of Y" (#13663)
* Change "Quote X of Y" to "Fetching quote X of Y"

* Update a test

* Trigger Build
2022-02-17 17:08:53 +01:00
Benjamin Bourgeois
207436d11c
convert SendGasRow stories with argtypes (#13554) 2022-02-16 15:18:30 -08:00
David Walsh
009c6e1455
Use hardware wallet constants when possible (#13634) 2022-02-16 14:54:30 -06:00
Ariella Vu
fadad601b8
ConfirmImportToken: Convert to Functional Component; Add storybook controls (#13594)
* ConfirmImportToken: convert to FC

* ConfirmImportToken: reorganize

* ConfirmImportToken: rm component from path

* replace mapStateToProps w/ useSelector
ConfirmImportToken

* replace mapDispatchToProps w/ useDispatch
ConfirmImportToken

* ConfirmAddSuggestedToken: useHistory

* ConfirmImportToken: add storybook controls

* ConfirmImportToken: rm 1st entry overwrite

* ConfirmImportToken: add tests

* ConfirmImportToken: use real Redux store in tests

* ConfirmImportToken: do not use mock-state.json
https://github.com/MetaMask/metamask-extension/pull/13594#discussion_r805022647

* ConfirmImportToken: tokenAddedEvent -> trackTokenAddedEvent

* Update ui/pages/confirm-import-token/confirm-import-token.js

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>

* ConfirmImportToken: update useSelector logic

* ConfirmImportToken: replace typeof check w/ === undefined

* ConfirmImportToken: rm unnecessary /rendering from path

* ConfirmImportToken: fix add token redirect

* ConfirmImportToken: use useNewMetricEvent

* ConfirmImportToken: rename vars using "addedToken"

* ConfirmImportToken: setAddedToken to obj copy

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
2022-02-16 18:03:54 +00:00
dragana8
5095071083
Make default icons the same on mobile and extension #13264 (#13408) 2022-02-16 11:03:17 -06:00
VSaric
2cd242252f
Created "Token details" page (#13216)
* Created new screen/page "Token details"

* Change color in scss

* Modify elements to the latest requirements and added unit tests

* Review requested changes

* Condensing files into one component

* Added unit tests for token details page

* Added redirection when switching networks, added image for a token and update unit tests

* Requested review changes

* Modify index.scss regarding of the requested review

* Delete data-testid's from Typography and token-details-page.js

* Requested review changes
2022-02-16 13:29:39 -03:30
Erik Marks
35ac762e10
Add Snaps via Flask (#13462)
This PR adds `snaps` under Flask build flags to the extension. This branch is mostly equivalent to the current production version of Flask, excepting some bug fixes and tweaks.

Closes #11626
2022-02-14 16:02:51 -08:00
Dan J Miller
8597cd1401
Allow sending up to 15 decimals on the send screen (#12707) 2022-02-10 17:35:41 -05:00
Alex Donesky
7223d4cd2c
fix opensea/autodetect setting dependency relation (#13575) 2022-02-10 14:02:06 -06:00
Alex Donesky
7148607906
remove infura project_id from networks form field (#13539)
* remove infura project_id from networks form field
2022-02-10 13:23:52 -06:00
dragana8
31eb5fc88a
[BUILD FIX #12920] Updated style for full screen mode in settings page (#13569) 2022-02-09 11:49:41 -06:00
Guillaume Roux
f82ce7ddd3
Fix network edition error (#13527)
* check if blockExplorer exists in rpcPrefs

* revert unnecessary change
2022-02-09 15:40:57 +01:00
dragana8
47e2e37712
Setting search feature - Setting component UI updates #12761 (#12920)
* updated settings page

removed unused messages

fixed width

moved icons into one folder

review comments update

removed unused strings

renamed components

removed class

added prop

updated e2e test

e2e

extracted icons

* locales fix

* update

* margin-inline
2022-02-08 13:00:20 -03:30
Alex Donesky
48cc9d5ad3
Add currency symbol validation in the add network form (#12431)
* validate ticker symbol in add/edit network form
2022-02-04 12:14:52 -06:00
Mark Stacey
429451de23
Extract "create vault" form to separate component (#13461)
The form used for creating a vault on the "Import" page of onboarding
and on the "Restore vault" page is nearly identical, yet the
implementation is totally separate. It has now been extracted to a
separate component, consolidating the two implementations.

There is a "terms of use" checkbox on the import page that isn't on the
restore vault page, so that part has been made optional. The "submit"
button text differs between the two uses as well, so that is
customizable.

There are slight styling differences between the old and new versions
of this form. The fonts and spacing are all using our new standard
design system guidelines, and we're using our standard checkbox now as
well. The spacing and font sizes were chosen somewhat arbitrarily by me
to resemble the old styles, so please feel free to suggest changes if
you think they can be improved upon.

There are some slight copy changes to the "Restore vault" page as well;
the placeholder text and the label for the "Secret Recovery Phrase"
field now matches the "Import" page copy.
2022-02-03 10:36:43 -03:30
Jyoti Puri
760ed3457d
Removing EIP_1559_V2 feature flag (#13481) 2022-02-03 05:58:28 +05:30
MG
3301fd8121
Feat/hide 0 balances (#13306)
* Added token list functional component

* Added list - img not showing up

* Changed render list

* Removed unused code

* Clean up

* Lint

* Linted

* Add newline

* Filter out isERC721

* Added token list

* Cleaned up style

* Fixed typography

* Fixed lint

* Fixed spacing measure

* Lint cleanup
2022-02-02 12:32:16 +01:00
Jyoti Puri
cc1861a34e
Adding metrics events for EIP-1559 V2 flow (#13329) 2022-02-01 23:23:03 +05:30
Ariella Vu
a5b114c4f9
Use ActionableMessage for ConfirmAddSuggestionToken warnings (#13402)
* ConfirmAddSuggestedToken: update duplicate logic

* ConfirmAddSuggestedToken: update duplicate fn names

* ConfirmAddSuggestedToken: add ActionableMessage
- fixes #13347

* base-styles.scss: deprecate .warning

* ConfirmAddSuggestedTokens: update @param desc

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* ConfirmAddSuggestedTokens: update @param desc

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* ConfirmAddSuggestedTokens: update @param desc

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* ConfirmAddSuggestedTokens: update @param desc

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* ConfirmAddSuggestedToken: clean JSDoc comments
- following GitHub suggestion commits

* ConfirmAddSuggestedToken: warning Learn More btn

* add zendesk-url constants
- use for ConfirmAddSuggestedToken & ImportToken pages

* storybook: add ConfirmAddSuggestedToken controls

* stories: add ConfirmAddSuggestedTokens states

* stories: rm unused args ConfirmAddSuggestedToken

* rn ZENDESK_URL -> ZENDESK_URLS

* AddSuggestedToken: check case-insensitive symbols

Co-authored-by: Alex Donesky <adonesky@gmail.com>
2022-02-01 15:30:15 +00:00
Hassan Malik
2825b74a55
added extension changes from snaps branch (#13433) 2022-01-28 12:39:32 -05:00
thickforest
fd46f97e35
Fix className misspelling in awaiting-swap.js 2022-01-27 14:47:25 -06:00
Alex Donesky
be65eb7339
More nft ux fixes (#13388)
* a batch of nft ux fixes
2022-01-27 11:26:33 -06:00
Jyoti Puri
a0e97f4681
EIP-1559 v2 - small fixes (#13392) 2022-01-26 23:48:43 +05:30
Ariella Vu
667350d15a
Convert ConfirmAddSuggestedToken to a functional component + cleanup (#13377)
* FC: ConfirmAddSuggestedToken
- change class to functional component

* clean: reorganize functions (no logic change)

* FC: ConfirmAddSuggestedToken pt. 2
- preserve trackEvent logic -> metricsEvent

* clean: rm _ prefix from fn name
- why? now, only 3 other functions remain prefixed w/ '_'

* clean: update useEffect hook

* clean: alphabetize props

* clean: functions in ConfirmAddSuggestedToken

* clean: use arrow fn for FC
2022-01-25 20:16:56 +00:00
Jyoti Puri
119e5497ff
UI fixes in EIP-1559 V2 screens (#13367) 2022-01-22 05:53:02 +05:30
filipsekulic
b2a9b72c04
Refactor currency input component and ensure currency toggle persists between settings (#12813) 2022-01-20 09:42:13 -06:00
Ariella Vu
683aa22b56
Update global link hover color from orange to blue (--Blue-400) (#13344)
* base-styles.scss: update a:hover to --Blue-400
- deprecates #df6b0e

* preserve a.warning:hover orange color w/ #ceafa22

* Revert "preserve a.warning:hover orange color w/ #ceafa22"

This reverts commit d0efb923808bbc43e7f955fd8ce3e95f6a124c1f.

* create-account: rm .warning style from help link
- supports #ceafa2
2022-01-19 11:59:52 -07:00
Alex Donesky
f087e501a1
Add modal with directions to re-add token as NFT (#13291)
* Add modal pop for NFTs previously added as tokens - with directions to re-add as NFTs
2022-01-19 12:42:41 -06:00
Jyoti Puri
5b92dc4cf0
Adding e2e test for edit gas fee modal (#13303) 2022-01-20 00:04:43 +05:30
Jyoti Puri
5b5b2cd7df
Fixing warnings in unit test cases (#13349) 2022-01-20 00:04:22 +05:30
Alex Donesky
f7849a0b7c
Add error that redirects users to Import NFT page when they attempt to add an NFT on the Import Token page (#13271)
* Add error that redirects users to Import NFT page when they attempt to add an NFT on the Import Token page
2022-01-19 08:38:33 -06:00
VSaric
cb815a91ad
SendHeader, ContactListTab and AdvancedTab story: converted knobs and actions to controls / args (#13230)
* SendHeader, ContactListTab and AdvancedTab story: converted knobs and actions to controls / args

* Added the other function type props to action controls

* Requested review changes
2022-01-17 10:58:12 -08:00
Elliot Winkler
8beaae3361
Fix UI issues at top of confirm page container (#13314)
This commit fixes a few issues with ConfirmPageContainerSummary (which
holds the contract being used or action being performed and the money
being sent):

* Remove fixed height so that the secondary currency doesn't get cut off
  or spill over
* Add missing padding
* Fix font size of primary and secondary currencies
* Add top border when there is a "address not in your address book"
  alert at the top

Co-authored-by: Ariella <ariellavu@gmail.com>
2022-01-14 20:12:20 -07:00
Niranjana Binoy
58ff673bcd
V10.9.0: Disconnect all accounts flow (#13309) 2022-01-13 18:05:35 -05:00
Alejandro Garcia Anglada
5d7094cafc
Improve first time flow css - select action (#12799)
* Improve first time flow css - select action

* Update ui/pages/first-time-flow/select-action/index.scss

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

* Update ui/pages/first-time-flow/select-action/index.scss

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

Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
2022-01-13 09:46:38 -08:00
dragana8
76bfc399b6
convert knobs and actions to controls / args (#13203)
* changed knobs

* review updates
2022-01-13 08:06:27 -03:30
Jyoti Puri
88faef7e19
Adding user setting option for EIP-1559 V2 (#13242) 2022-01-12 00:47:56 +05:30
Alex Donesky
4826c8c95e
Feat/collectibles send flow (#13048)
* Add collectibles send flow
2022-01-10 10:23:53 -06:00
Elliot Winkler
7b963cabd7
Alert users when the network is busy (#12268)
When a lot of transactions are occurring on the network, such as during
an NFT drop, it drives gas fees up. When this happens, we want to not
only inform the user about this, but also dissuade them from using a
higher gas fee (as we have proved in testing that high gas fees can
cause bidding wars and exacerbate the situation).

The method for determining whether the network is "busy" is already
handled by GasFeeController, which exposes a `networkCongestion`
property within the gas fee estimate data. If this number exceeds 0.66 —
meaning that the current base fee is above the 66th percentile among the
base fees over the last several days — then we determine that the
network is "busy".
2022-01-07 12:18:02 -07:00
Mark Stacey
3732c5f71e
Add JSDoc ESLint rules (#12112)
ESLint rules have been added to enforce our JSDoc conventions. These
rules were introduced by updating `@metamask/eslint-config` to v9.

Some of the rules have been disabled because the effort to fix all lint
errors was too high. It might be easiest to enable these rules one
directory at a time, or one rule at a time.

Most of the changes in this PR were a result of running
`yarn lint:fix`. There were a handful of manual changes that seemed
obvious and simple to make. Anything beyond that and the rule was left
disabled.
2022-01-07 12:27:33 -03:30
Elliot Winkler
af971cd5b6
Remove dupe Prettier config from ESLint config (#13234)
The ESLint config for the extension explicitly includes support for
Prettier. However, this is already being provided by our global ESLint
config (`@metamask/eslint-config`). Therefore there is no need to
include it here. In fact, this is causing weird issues where the `curly`
option is getting overridden somehow. After this change, these syntaxes
are invalid:

``` javascript
if (foo) return;
```

``` javascript
if (foo) return 'bar';
```
2022-01-06 15:56:51 -07:00
Jyoti Puri
0c531f8b01
EIP-1559 V2 UI fixes (#13222) 2022-01-07 04:10:31 +05:30
David Walsh
10dc686505
Dark Mode Part 1: Switch to Using CSS Variables (#13147) 2022-01-06 11:35:49 -06:00
Jyoti Puri
f5dcd12293
using 1559 V2 for cancel speed up flows (#13019) 2022-01-06 08:17:26 +05:30
Erik Marks
dbfdf3b0eb
Update Flask support links and home footer (#13226)
* Update support links for Flask

* Disable 'prefer-const' in code fence linting

* Add bespoke home footer for Flask and update logic

* fixup! Add bespoke home footer for Flask and update logic

* Fix code fence lint failure

* Fix support request link in account menu

* Fix unit test failure
2022-01-05 21:25:20 -03:30
Mark Stacey
94dc287bb1
Fix missing targetSubjectMetadata.name propType error (#13218)
There was a propType error shown on the snap install screen about the
`name` property of `targetSubjectMetadata` being missing despite it
being marked as required. This property should not have been required,
it does not always exist.
2022-01-05 19:02:44 -03:30
dragana8
fc185e3139
mainnet tokens autopopulate add token form fields when on custom networks #12087 (#12800)
Co-authored-by: Alex Donesky <alex.donesky@consensys.net>
2022-01-05 12:19:28 -06:00
Mark Stacey
22f931e6b2
Prevent automatic rejection of confirmations (#13194)
* Prevent automatic rejection of confirmations

Confirmations are now only automatically rejected if a user explicitly
closes the notification window. If we close the window programmatically
because there are no notifications left to show, nothing gets rejected.

This partially avoids a race condition where a confirmation gets
rejected automatically without the user having seen the confirmation
first. This could happen if the confirmation was processed just as the
notification window was being closed.

It's still possible for a confirmation that the user has never seen to
get rejected as a result of the user closing the window. But at least
now it's no longer possible for a confirmation to get rejected in this
manner after the user resolves the last confirmation in the queue.

* Fix bug that prevented automatic closure detection

All windows were being detected as explicit window closures,
essentially just as they were previously, because this variable was
cleared too soon.

* Re-open popup when necessary

After the window is automatically closed, a confirmation may have been
queued up while the window was closing. If so, the popup is now re-
opened.
2022-01-05 13:39:19 -03:30
Mark Stacey
75b9f71d45
Remove unnecessary mounted state from Home component (#13202)
The `mounted` state was used to derive state from props before the
first render of the Home component. Instead this state is now derived
in the constructor, which is also run before the first render. This
should behave exactly the same, except now we don't need the `mounted`
state or the `deriveStateFromProps` function anymore.

The call to `closeCurrentWindow` that was made in `componentDidUpdate`
has been moved to the constructor as well. There is no need to delay
that call, and this saves us from having to compare current with
previous state in that lifecycle function.
2022-01-04 19:19:06 -03:30
Mark Stacey
3563a246fe
Allow templates without alerts (#13150)
The confirmation page template system allows templates to have alerts,
but it throws an uncaught Promise rejection if a template has no
alerts. This is the unintended side-effect of input validation.

The `getTemplateAlerts` function was updated to always return an array.
The one callsite was updated to expect an empty array if there were no
alerts to render, rather than expecting `undefined`.
2022-01-03 11:32:15 -03:30
filipsekulic
62f41600f2
Fix account name duplicates (#12867)
* Fix account name duplicates

* Change button disabling logic

* Fix function error

* Requested changes

* Move functions from selectors file into components

* Applying requested changes
2021-12-16 07:11:55 -03:30
Hassan Malik
f946c030b5
Choose accounts refactor (#13039)
* added wrapper around account list to prevent storybook from collapsing the list

* updated translation files

* added snap-connect page

* refactored account list out of the choose account component

* fixed width

* removed unnecessary scss from choose-account component, fixed props in choose account story

* removed snaps-connect page, added comments to ChooseAccount

* updated choose account subtitle text, updated styling for title & subtitle, removed redundant account list story

* updated component name, updated paths

* fixed linter errors

* added comments

* removed unused message

* removed selectAccounts key from all locales

* updated class name for account list header, updated allAreSelected function to use length checks

* Revert "removed unused message"

This reverts commit 32771bc83c08f120825ef75f0741f3034e7dbecb.

* Revert "removed selectAccounts key from all locales"

This reverts commit ccfa4a860f9a75693d893d7c404384e719de297e.

* updated locale messages to use selectAccounts key

* removed stray import

* updated scss

* updated translation key

* removed chooseAccounts key from en locale

* removed optional chaining

* changes

* updated subjectMetadata

* updated subject types

* update useOriginMetadata function to include unknown subject type

* updated permission connect header props, removed host and added subjectType to targetSubjectMetadata

* added subjectType to targetSubjectMetadata

* removed console.log

* changed prop name to iconUrl
2021-12-14 18:54:46 -05:00
Alex Donesky
1b6e58c417
Feat/collectibles the return (#12970)
* Wire collectibles frontend UI with controller data
2021-12-13 17:41:10 -06:00
Erik Marks
c03b6dd19b
Subject metadata cleanup (#13090)
This PR fixes some subject metadata-related issues that were missed in #13026.
2021-12-13 12:10:20 -08:00
Jyoti Puri
19c3d021ea
Using EIP-1559 V2 for swaps (#12966) 2021-12-12 04:56:28 +05:30
ricky
2085352de8
Make restore vault a form so an user can submit via keyboard (#12989)
* Make this a form

Similar to "import-with-seed-phrase" I would like to be able to restore my vault by pressing `<enter>` on my keyboard.

* actually test enter

* preventDefault()
2021-12-10 14:32:13 -05:00
filipsekulic
bdc7e1df57
Fix order of account list (#12999) 2021-12-10 10:46:24 -06:00
Jyoti Puri
889e49a4a2
Changes in gas loading animation in EIP-1559 V2 (#13016) 2021-12-10 06:20:38 +05:30
Mark Stacey
ba54a3d83b
Update ESLint config to v8 (#12886)
The ESLint config has been updated to v8. The breaking changes are:

* The Prettier rule `quoteProps` has been changed from `consistent` to
`as-needed`, meaning that if one key requires quoting, only that key is
quoted rather than all keys.
* The ESLint rule `no-shadow` has been made more strict. It now
prevents globals from being shadowed as well.

Most of these changes were applied with `yarn lint:fix`. Only the
shadowing changes required manual fixing (shadowing variable names were
either replaced with destructuring or renamed).

The dependency `globalThis` was added to the list of dynamic
dependencies in the build system, where it should have been already.
This was causing `depcheck` to fail because the new lint rules required
removing the one place where `globalThis` had been erroneously imported
previously.

A rule requiring a newline between multiline blocks and expressions has
been disabled temporarily to make this PR smaller and to avoid
introducing conflicts with other PRs.
2021-12-09 15:36:24 -03:30
igorms-cons
e41ac173d1
display hex data on send screen fixed (#12709) 2021-12-09 06:56:49 -03:30
Etienne Dusseault
068e97314e
Fix dropdown-input-pair component to for new Storybook format (#12895)
* input pair

* proptype comments

* Update

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2021-12-07 09:44:25 -08:00
Matthew Epps
311ea021f3
Optimize rest of swaps flow (#12939) 2021-12-07 11:33:13 -06:00
Dan J Miller
7212dcf098
Tx insights fixes (#12988)
* Ensure that function representation on hex and data tabs are consistent

* Don't show redundant hex tab when deploying contract

* Show standard pointer cursor on error messages in tx-decoder component

* Don't show activity log for incoming transactions

* Update localization

* Fix error message
2021-12-07 11:42:34 -03:30
Daniel
c8b697687f
Swaps UI redesign for the View Quote page (#12950)
* Update EIP-1559 UI on the View Quote page (WIP)

* UI redesign for the View Quote page in Swaps, update tests,  refactoring

* Update styles for the View Quote page

* Improve scrolling and styling for the View Quote page

* Update snapshots

* Fix a scrolling issue

* Use Ethereum mainnet for swaps API calls if it's Rinkeby

* UI / content updates on the View Quote page

* Remove unused content in Swaps

* Fix an ESLint issue

* Update UTs with the latest content

* Renaming

* Remove 2 more unused content strings
2021-12-07 00:21:26 -03:30
Erik Marks
31cf7c10a4
Permission System 2.0 (#12243)
# Permission System 2.0

## Background

This PR migrates the extension permission system to [the new `PermissionController`](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions).
The original permission system, based on [`rpc-cap`](https://github.com/MetaMask/rpc-cap), introduced [`ZCAP-LD`](https://w3c-ccg.github.io/zcap-ld/)-like permissions to our JSON-RPC stack.
We used it to [implement](https://github.com/MetaMask/metamask-extension/pull/7004) what we called "LoginPerSite" in [version 7.7.0](https://github.com/MetaMask/metamask-extension/releases/tag/v7.7.0) of the extension, which enabled the user to choose which accounts, if any, should be exposed to each dapp.
While that was a worthwhile feature in and of itself, we wanted a permission _system_ in order to enable everything we are going to with Snaps.
Unfortunately, the original permission system was difficult to use, and necessitated the creation of the original `PermissionsController` (note the "s"), which was more or less a wrapper for `rpc-cap`.

With this PR, we shake off the yoke of the original permission system, in favor of the modular, self-contained, ergonomic, and more mature permission system 2.0.

Note that [the `PermissionController` readme](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions/README.md) explains how the new permission system works.

The `PermissionController` and `SubjectMetadataController` are currently shipped via `@metamask/snap-controllers`. This is a temporary state of affairs, and we'll move them to `@metamask/controllers` once they've landed in prod.

## Changes in Detail

First, the changes in this PR are not as big as they seem. Roughly half of the additions in this PR are fixtures in the test for the new migration (number 68), and a significant portion of the remaining ~2500 lines are due to find-and-replace changes in other test fixtures and UI files.

- The extension `PermissionsController` has been deleted, and completely replaced with the new `PermissionController` from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The original `PermissionsController` "domain metadata" functionality is now managed by the new `SubjectMetadataController`, also from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The permission activity and history log controller has been renamed `PermissionLogController` and has its own top-level state key, but is otherwise functionally equivalent to the existing implementation.
- Migration number 68 has been added to account for the new state changes.
- The tests in `app/scripts/controllers/permissions` have been migrated from `mocha` to `jest`.

Reviewers should focus their attention on the following files:

- `app/scripts/`
  - `metamask-controller.js`
    - This is where most of the integration work for the new `PermissionController` occurs.
      Some functions that were internal to the original controller were moved here.
  - `controllers/permissions/`
    - `selectors.js`
      - These selectors are for `ControllerMessenger` selector subscriptions. The actual subscriptions occur in `metamask-controller.js`. See the `ControllerMessenger` implementation for details.
    - `specifications.js`
      - The caveat and permission specifications are required by the new `PermissionController`, and are used to specify the `eth_accounts` permission and its JSON-RPC method implementation.
        See the `PermissionController` readme for details.
  - `migrations/068.js`
    - The new state should be cross-referenced with the controllers that manage it.
      The accompanying tests should also be thoroughly reviewed.

Some files may appear new but have just moved and/or been renamed:

- `app/scripts/lib/rpc-method-middleware/handlers/request-accounts.js`
  - This was previously implemented in `controllers/permissions/permissionsMethodMiddleware.js`.
- `test/mocks/permissions.js`
  - A truncated version of `test/mocks/permission-controller.js`.

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-12-06 19:16:49 -08:00
Etienne Dusseault
9fcfbe7609
Fix unlock-page component for new Storybook format (#12894)
* unlock-page

* Updating comments and removing broken args table

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2021-12-06 15:08:13 -08:00
ryanml
bab48c809a
Clear the clipboard after seed phrase is pasted (Restore vault) (#12987) 2021-12-06 12:17:56 -07:00
Jyoti Puri
2af45a656f
Adding validations for advance gas fee input fields (#12879) 2021-12-07 00:17:26 +05:30
Jyoti Puri
6fc9b6b7a2
Using EIP-1559 V2 for approve transaction flow (#12906) 2021-12-06 22:09:35 +05:30
Mark Stacey
b75ef5f0eb
Remove redundant EIP_1559_V2_ENABLED comparison (#12954)
A redundant comparison for the `EIP_1559_V2_ENABLED` variable has been
removed. This variable is a boolean, so it can be treated as a boolean
directly in most cases.

One such comparison has been preserved for the purpose of allowing unit
testing, because `process.env` entries are always strings in Node.js. A
comment was added to explain this.
2021-12-06 11:23:02 -03:30
Jyoti Puri
cd4ddffd9c
Adding gas limit section on advance gas fee modal (#12865) 2021-12-03 21:29:48 +05:30
Mark Stacey
91af73b211
Remove invalid disableRipple prop (#12948)
The `disableRipple` prop was resulting in a React error in development
builds because it was unrecognized by React. This prop dates back to
when we were using the `@material-ui` Button class. It no longer serves
any purpose, so it has been removed.
2021-12-03 11:22:14 -03:30
Mark Stacey
7226357422
Fix isMainnet propType error (#12951)
A propType error was showing up during e2e tests with a `testDev`
build. It was caused by `process.env.IN_TEST` being treated as a
boolean, when in fact it is either the string `'true'` or a boolean.

`IN_TEST` has been updated to always be a boolean. `loose-envify` has
no trouble injecting boolean values, so there's no reason to treat this
as a string.
2021-12-02 14:46:46 -03:30
Olaf Tomalka
90b656bd66
Added SiteOrigin and PermissionList components (#12832)
* Changed back button to the one in design

* PermissionConnect now uses Chip component

* Added SiteOrigin widget

* WIP

* Added new permission list

* Fix linting errors

* Removed unused messages

* Removed more unused messages

* Make SiteOrigin bigger

* Fix lint

* Code Review fixes

* Fix SiteOrigin overflowing

* Add stories

* Fix lint

* Added useMemo to constant

* Fix Chip's max-content overflowing SiteOrigin

* Fix code review issues

Co-authored-by: Olaf Tomalka <olaftomalka@Olafs-MacBook-Pro-2.local>
2021-12-02 18:22:18 +01:00
igorms-cons
6dbf6e3ab3
Latest update conversion date - issue #10741 (#12422)
* conversion date fix

* update in settings conversion date - no internet

* update conversionDate fetch - setting container

* no currency date message updated
2021-12-02 08:48:09 -03:30
Alex Donesky
9e2935dd55
Revert "Feat/collectibles display (#12873)" (#12934)
This reverts commit 81ea24f08a.
2021-12-01 17:46:26 -06:00
Alex Donesky
c29afd110b
put new collectibles related preferences behind feature flag (#12936) 2021-12-01 16:10:24 -06:00
George Marshall
854fc71ae7
Organizing storybook to echo app folder structure (#12796)
* Organizing storybook to echo app folder structure

* Updating new stories to follow new convention from develop
2021-12-01 11:27:57 -08:00
Alaa Hadad
e056c88ba7
Feature: Transaction Insights (#12881)
* integration for tx decoding confirmation and history view

* upgrading @truffle/decoder to latest release 5.1.0

* Update acorn and colors patches

* feat: remove redundant styling

* feat: basic integration for nickname components

* feat: wiring functionality of adding new nickname

* feat: wire functionality of showing nickname modal

* feat: link the nickname popover with add/update popover

* feat: moving forward with address nicknames integration

* feat: fixing a bug related to passing chainId in addressBook

* feat: populating memo prop in addressbook entry

* feat: add explorer link

* feat: bug fixing update nickname component

* feat: fix proptypes

* feat: adding tooltip for copying nickname address

* featL fix styling for tx-details page

* feat: optimize code for error handling

* feat: limiting transaction decoding to tx with data

* feat: remove tree UI component

* feat: adding request to check for tx decoding supported networks

* feat: showing data hex component

* feat: fix react warnings

* feat: remove extra margin in tx decoding

* Remove unused package @truffle/source-map-utils

* Ensure messages get translated

* feat: link tx-decoding addresses with nicknames

* Omit value for boolean attributes

* Fix props reading in CopyRawData

* fix: fixing issue with transaltion

* Fix lint errors in TransactionDecoding

- Remove unused import
- Reorder imports
- Address conflict between caught `error` and error state flag by
  renaming state flag to `hasError`
- Fix requestUrl identifier casing and use of template string
- Ensure `useEffect` gets passed the deps it needs
- Add scope braces around case statement where it's needed
- Omit literal `true` for boolean jsx attribute
- Refactor nested ternary as `if` statements

* fix: revert fetchWithCache modifications

* Fix linting for TransactionListItemDetails

- Remove unused import
- Fix import spacing
- Remove unused prop dereference
- Fix string interpolation for translated From/To

* Moving to popover pattern

* fix: sass color variable

* Omit value for boolean attribute

* Remove changes from modal.js

* fix: refactor nickname popovers

* Ensure const gets declared before it's used

* Fix linting for ConfirmTransactionBase

- Remove unused prop chainId
- Stop destructuring an unused field

* fix: refactor usage of nicknames popovers in send-content-container

* fix: remove extra prop updateAccountNicknameModal

* fix: refactor code for address.component

* fix: remove extra tooltip

* Ensure NicknamePopovers always returns component

* Fix linting for NicknamePopover component

- Fix useCallback deps
- Switch ternary to logical-or

* Fix linting for SenderToRecipient

... by fixing import order

* Remove unused addressCopied state

* Delete empty file

* fix: remove sender-to-recipient.container

* fix: refactor usage of nickname popovers in confirm-page-container

* fix: bug related to state variable

* Stylelint fix

* Lint fix

* Change "Total Amount" to "Total"

* Lint fix locales

* Update address-book.spec.js

* e2e test update

* Update e2e tests

* Fix issue where absence of function params in data hex tab would result in rendering a  string

* Fix border radius, and width and height in small notification windows, of the update-nickname-popover

* Remove fake await

* Clean up

* Clean up

Co-authored-by: Alaa Hadad <alaahd@Alaas-MacBook-M1-Pro-14-inch.local>
Co-authored-by: Dan Miller <danjm.com@gmail.com>
Co-authored-by: g. nicholas d'andrea <gnidan@trufflesuite.com>
2021-12-01 13:52:08 -03:30
Olaf Tomalka
70386726f6
Implement Flask onboarding UI (#12745)
* Added Flask Experimental Area warning to OnboardingV2

* Added first time flow Flask Experimental Area warning

* Made both onboarding flows use one Experimental Area component

* Fix comments in React divs

* Fix unreachable code

* Fix build lint problems

* Changes after code review

* Added guards around route constants imports

* Code Review changes

* Update ui/components/app/flask/experimental-area/index.scss

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

* Code review changes

* Fix lint

* Update ui/components/app/flask/experimental-area/index.scss

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

* Update ui/components/app/flask/experimental-area/index.scss

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

* Update ui/components/app/flask/experimental-area/index.scss

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

* Update ui/components/app/flask/experimental-area/index.scss

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

* Update ui/components/app/flask/experimental-area/index.scss

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

* fix lint

Co-authored-by: George Marshall <george.marshall@consensys.net>
2021-12-01 17:53:30 +01:00
Matthew Epps
7a92e22111
Swaps optimizations (#12842)
* Trigger Build

* Trigger Build

* Move swaps index variables to redux

* all optimizations so far

* Add better equality checks for selectors in swaps index and build quote

* Clean up PR, remove extra code and logs

* Clean up lavamoat file

* Fixes for optimizations

* Update tests and test snapshots

* Remove unnecessary tests

* Remove unnecessary console log

* Trigger Build

* Trigger Build

* Add delay to account for remote call made by trezor keyring

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2021-12-01 12:55:09 -03:30
Alex Donesky
81ea24f08a
Feat/collectibles display (#12873)
* Wiring up Collectibles lists/items

* wip

* more wip

* more more wip

* yet more wip

* wippp

* more wipppp

* closer

* wroking

* more wip

* cleanup

* cleanup

* add-collectible form validation

* update default ipfs-gateway

* update refresh button

* fix proptypes issue + add more padding to asset background

* css tweaking

* more cleanup

* more cleanup

* more cleanup

* add migration

* address feedback

* fix migration + cleanup

* bumping controllers version + adapting new collectiblesController shape

* fix yarn dedupe
2021-12-01 10:10:17 -06:00
Alex Donesky
3434b9f80a
add openSeaEnabled preference (#12909)
* add openSeaEnabled preference

* cleanup

* add description copy
2021-11-30 22:12:27 -06:00
Jyoti Puri
a020281c96
Implementing save button on advance gas fee modal (#12854) 2021-12-01 06:01:21 +05:30
Matthew Epps
8e6a0ff879
Send all swaps requests to api2, remove useNewSwapsApi boolean (#12792)
* Send all swaps requests to api2, remove useNewSwapsApi boolean

* Switch token bucket priority

* Fix tests

* Trigger Build

* Trigger Build
2021-11-30 19:56:28 +01:00
Dan J Miller
2856ea7606
Add support for eip-1559 on Trezor (#12627)
* Add support for eip-1559 on Trezor

* temp

* Lint fix

* Store trezor model type in background state instead attempting to get it in the frontend

* code simplification

* Temp update to eth-trezor-keyring version

* Tempory update to eth-trezor-keyring version

* Temp update to eth-trezor-keyring version

* Fix display of hdpath selector in connect hardware flow for trezor

* Updating the package version but we still need to run yarn setup and update the lockfile, once the package is updated

* Update yarn.lock

* Fix unit tests
2021-11-30 10:58:28 -03:30
Jyoti Puri
7ace0497c8
Removing un-necessary comma (#12883)
* Confirm transaction screen style fixes
2021-11-30 00:32:54 +05:30
Niranjana Binoy
3f8cbd5202
Removing the token detection announcement when the token detection is ON (#12776) 2021-11-29 13:28:35 -05:00
Niranjana Binoy
4b975adc85
EIP-1559 V2 : Advanced gas fee modal - Max base fee and Priority fee inputs (#12619) 2021-11-29 23:10:48 +05:30
Dan J Miller
c2ea04c775
Adds multilayer fee display to erc20 token approval screen (#12824)
* Adds multilayer fee display to erc20 token approval screen

* Change bold property name
2021-11-29 13:23:37 -03:30
Jyoti Puri
0e0e7ac830
Legacy transactions to use old transaction flow (#12782) 2021-11-29 21:38:24 +05:30
Alex Donesky
5aa191fd2e
Feat/add collectible manually (#12834)
* hook up add collectible manually flow

* address feedback
2021-11-26 14:03:35 -06:00
ryanml
279c8072ed
Adding collectibles items overview (#12506)
* Adding collectibles items overview

* addressing feedback

Co-authored-by: Alex <adonesky@gmail.com>
2021-11-26 12:59:46 -06:00
Alex Donesky
0bed51b936
add and hook up setting to toggle on/off collectible autodetection (#12839) 2021-11-26 12:54:57 -06:00
Dan J Miller
74b3a3a1c8
Remove _removeBeforeUnload calls in confirm-encryption-public-key.component.js and confirm-decrypt-message.component.js (#12825) 2021-11-25 14:42:40 -03:30
George Marshall
07f16d37be
Updating IconWithFallback to functional component, adding stories and docs (#12797) 2021-11-24 11:43:22 -08:00
Mingliang Liu
e7b82915fa
update scams and network security risks link (#12752) 2021-11-24 15:18:01 -03:30
Mark Stacey
7929a92c66
Clear the clipboard after the seed phrase is pasted (#12828)
* Clear the clipboard after the seed phrase is pasted

On the "Import" page of the import onboarding flow, we now clear the
clipboard after the secret recovery phrase is pasted. This ensures that
the SRP isn't accidentally pasted somewhere else by the user, which can
be an easy and disastrous mistake to make.

* Clear clipboard during new onboarding flow as well
2021-11-24 13:39:12 -03:30
Jyoti Puri
7609841902
Confirm transaction page - onchain failure handling (#12743) 2021-11-24 22:32:53 +05:30
Jyoti Puri
f65063ac6c
Eip1559 v2 12593 (#12719) 2021-11-23 23:48:44 +05:30
Niranjana Binoy
582882b3ed
Adding the AdvancedGasFeePopover template (#12780) 2021-11-23 23:16:33 +05:30
Aaron Chen
a931316a53
Introduce QR based signer into MetaMask (#12065)
* support qr based signer

* add CSP for fire fox

* get QR Hardware wallet name from device

* fix qrHardware state missing in runtime

* support qr based signer sign transaction

* refine Request Signature modal ui

* remove feature toggle

* refine ui

* fix notification is closing even there is a pending qr hardware transaction

* add chinese translation, refine ui, fix qr process was breaking in some case

* support import accounts by pubkeys

* refine qr-based wallet ui and fix bugs

* update @keystonehq/metamask-airgapped-keyring to fix that the signing hd path was inconsistent in some edge case

* fix: avoid unnecessay navigation, fix ci

* refactor qr-hardware-popover with @zxing/browser

* update lavamoat policy, remove firefox CSP

* refine qr reader ui, ignore unnecessary warning display

* code refactor, use async functions insteads promise

Co-authored-by: Soralit <soralitria@gmail.com>
2021-11-23 13:58:39 -03:30
Dan J Miller
d296c517db
Remove localhost from default network list (#12790)
* Remove localhost from default network list

* Update e2e fixtures
2021-11-22 19:02:03 -03:30
Olusegun Akintayo
143a5c4a53
Increase friction to bypass estimated revert (#12576)
* If a transaction would revert/fail,
    1. hide the gas estimate info.
    2. Disable the confirm button.
    3. All user to enable the confirm button anyways.
    4. Do not show the default Transaction error message

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

* Always return a value for hasSimulationError

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

* Use primary button of action message

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

* Remove hasSimulationError from getErrorKey

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

* Lint fixes.

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

* Move confirm anyways logic to base component.
Change message

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

* Disable edit if there's simulation error

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

* hide confirm anyways button once clicked.

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

* Move Actionable Primary Action to flex-end

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

* Fix unit tests

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

* Fix nested ternary lint issues

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

* add !confirmAnyways to conditions to show GasDetails.

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

* ConfirmAnyways should be read from state

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

* Rename tryAnywayOption

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

* Lint fixes

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

* Remove await tick

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

* Lint issue fix

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

* Lint fixes after rebase

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

* description should show that it's content being tested.

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

* If a transaction would revert/fail,
    1. hide the gas estimate info.
    2. Disable the confirm button.
    3. All user to enable the confirm button anyways.
    4. Do not show the default Transaction error message

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

* Always return a value for hasSimulationError

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

* Use primary button of action message

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

* Remove hasSimulationError from getErrorKey

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

* Lint fixes.

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

* Move confirm anyways logic to base component.
Change message

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

* Disable edit if there's simulation error

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

* hide confirm anyways button once clicked.

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

* Move Actionable Primary Action to flex-end

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

* Fix unit tests

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

* Fix nested ternary lint issues

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

* add !confirmAnyways to conditions to show GasDetails.

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

* ConfirmAnyways should be read from state

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

* Rename tryAnywayOption

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

* Lint fixes

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

* Remove await tick

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

* Lint issue fix

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

* Lint fixes after rebase

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

* description should show that it's content being tested.

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

* Move simulation fails message inline with gas details component (#12705)

* Move simulation fails message inline with gas details component

* Remove old unit tests

Co-authored-by: Dan Miller <danjm.com@gmail.com>

* lint fix

* use an XOR operation.

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

* The changes in this file are no longer needed because we hide the edit button now

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

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2021-11-22 16:13:30 +04:00
Jyoti Puri
2c6fb06114
Edit gas fee modal more changes (#12660) 2021-11-19 00:38:29 +05:30
Jyoti Puri
0daefe9ea0
Adding edit gas fee modal (#12624)
Edit transaction screen changes for EIP-1559 V2
2021-11-18 23:24:58 +05:30
Daniel
ecceb4d6da
Use v2 API for fiat onboarding URL creation, fix wrapping / unwrapping (#12729)
* Use a Swaps v2 API to get a fiat onboarding URL

* Fix an issue with wrapping / unwrapping if an address contained uppercase chars

* Rename a constant

* Use a constant in a test
2021-11-17 18:04:50 +01:00
ryanml
f7c6b3228b
Scroll to "show test networks" setting from network dropdown link (#12711)
* Scroll to "show test networks" setting from network dropdown link

* Focusing element
2021-11-15 17:00:23 -07:00
Olusegun Akintayo
0cf7455e18
addresses an issue found in 10.6.0 QA (#12710)
* addresses an issue found in 10.6.0 QA

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

* update test cases.

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

* Fixes unit test texts to pass

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-11-15 18:34:09 -03:30
Elliot Winkler
405b56c730
Replace history during onboarding (#12693) 2021-11-15 12:16:11 -07:00
ryanml
5712539a38
Implement 'Add NFT' screen (#12544)
* Implement 'Add NFT' screen

* Guarding added route with feature flag
2021-11-15 10:28:35 -07:00
Olaf Tomalka
a323a5fe59
Reject popup confirmations on close (#12643)
* Background clears confirmations on popup close

* [WIP] Remove clearing confirmations through UI

* Confirmations are now rejected instead of cleared

* Erased commented out code

* Fix linter errors

* Changes after code review

* Moved metrics events from onWindowUnload to background

* PR review fixes

* Added abillity to add reason to rejection of messages

* Fix prettier

* Added type metrics event to signature cancel

* Fix test

* The uncofirmed transactions are now cleared even if Metamask is locked
2021-11-15 17:13:51 +01:00
Dan J Miller
caee4f288d
Ensure approve button can be enabled when using ledger webhid (#12685) 2021-11-12 19:52:24 -03:30
Jyoti Puri
4779bd9fe5
Show warning in confirm transaction screen for low/high gas values. (#12545) 2021-11-12 08:52:54 +05:30
Dan J Miller
9bc07f5e6b
Fix copy issues related to layer 2 fee changes (#12667) 2021-11-11 20:45:43 -03:30
ryanml
4a04908048
Fixing MetaFox logo display on Approval Screen in full width (#12656) 2021-11-11 09:49:10 -07:00
Dan J Miller
9fa15dda6f
Support for Layer 2 networks with transaction fees on both layers (#12658)
* Support for Layer 2 networks with transaction fees on both layers

* Use  variable name in transaction-breakdown

* Add comment on code source to ui/helpers/utils/optimism/fetchEstimatedL1Fee.js

* Fix unit tests

* Ensure values passed to  are defined

* Fix activity log
2021-11-11 13:16:45 -03:30
David Walsh
3f9ec40107
Use gas estimate type constants (#12460) 2021-11-10 13:50:43 -06:00
ryanml
a41e3b1925
Approval screen: Center justify address display content (#12639)
* Approval screen: Center justify address display content

* Removing width prop
2021-11-10 10:57:41 -07:00
ryanml
9ab6293129
Fix untranslated header text in AccountImportSubview (#12640)
* Fix untranslated header text in AccountImportSubview

* use styling for link spacing
2021-11-10 10:29:22 -07:00
PeterYinusa
dc19e1d5f6
Onboarding v2 e2e test (#12628)
* add data-testid's

* import wallet test

* create wallet test

* fix lint issues
2021-11-10 17:27:10 +00:00
David Walsh
4b1c51aec5
Rename the function of the Ledger preference renaming (#12459) 2021-11-08 09:28:40 -06:00
Alex Miller
722c4e5b63
Support for GridPlus Lattice1 hardware wallet (#12053)
* GridPlus: Adds support for GridPlus Lattice1 hardware wallet

* Fixes issue with switching hardware HD path
The main `Select HD Path` piece of the account selection component was not
properly hooked up to the state manager (`onPathChange`) and the extra
`Popover` component was being used instead.
I'm not sure what the origin of this is, but I don't see why the Popover
is needed at all. I have remove it and hooked `onPathChange` directly into
the HD path selector dropdown.
This was an issue that nearly every Lattice user who had come from Ledger
has contacted us about.

* GridPlus: Addresses QA issues
* Adds Lattice tutorial + image
* Cleans up connectivity issues (see: https://github.com/GridPlus/eth-lattice-keyring/pull/16)

* GridPlus: Adds Firefox support
To connect to the Lattice you need to open a new tab/window and get
login data from it. We were not able to do this for Firefox because
we relied on the `window` API. This is now fixed.
See corresponding changes:
* `eth-lattice-keyring`: https://github.com/GridPlus/eth-lattice-keyring/pull/17
* Lattice connector: https://github.com/GridPlus/wallet-web/pull/152

* GridPlus: Adds missing error path for Firefox
See: 242a93f559
2021-11-08 11:18:41 -03:30
David Walsh
17b64e94fc
Use gas recommendation constants throughout app (#12461) 2021-11-05 19:59:23 -05:00
Jyoti Puri
4757eed2f6
Fix build (#12606) 2021-11-06 00:50:27 +05:30
Jyoti Puri
3dfc1cc5f6
Edit transaction screen changes for EIP-1559 V2 (#12493)
Edit transaction screen changes for EIP-1559 V2
2021-11-05 22:53:15 +05:30
Niranjana Binoy
524725b24b
Network tab refactor (#12502) 2021-11-04 17:48:21 -04:00
VSaric
f98b21e750
Heading on contact details view in popup should say "Details" instead of contact name (#12380)
* Change contact details view in popup to show "Details" instead of contact's name

* Changed contact details view in popup
2021-11-04 04:28:50 -02:30
igorms-cons
59054519ba
Show account name & full address in send view - issue #12346 (#12415)
* account name & address in send view UI update & fix

* update scss in send modal view

* send account address - refacto func
2021-11-04 04:28:32 -02:30
David Walsh
3e0d602d22
Fix fllWidth proptype error (#12555) 2021-11-03 15:28:29 -05:00
Hassan Malik
baa4eb2d82
Remove hexdata field from token send (#12565)
* added acccess to asset from state, updated SendHexDataRow display logic

* fixed invalid propType and updated tests

* updated logic and tests to only disable hex data field for TOKEN (ERC-20) types
2021-11-03 15:03:54 -04:00
VSaric
64e45c801d
Warn the user of insufficient funds when approving a token (#12496)
* Warn the user of insufficient funds (ETH for gas) when approving a token

* Fixing code lines while run yarn lint:fix

* Fixing test-e2e-chrome

* Fixing e2e tests

* Create shouldDisplayWarning variable
2021-11-03 12:43:31 -02:30
Olusegun Akintayo
95e3be4a85
UX improvements to the "Permission Request" section on the approve screen (#12553)
* UX improvements to the "Permission Request" section on the approve screen

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

* Fix locales.

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

* Check that hidden elements are hidden in test

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

* Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-11-03 02:15:05 +04:00
Dan J Miller
8ae90aec0e
Ensure exchange rate is stringified before passing to bignumber in confirm-token-transaction component (#12550) 2021-11-02 05:53:12 -02:30
Dan J Miller
1fa4b5c776
Don't show ledger live option in advanced settings if using firefox (#12494)
* Don't show ledger live option in advanced settings if using firefox

* Hide ledger transport selector in advanced settings on firefox
2021-11-02 04:54:24 -02:30
ryanml
b058cbed3b
Fixing COLORS.GRAY (#12538) 2021-10-30 11:04:09 -07:00
Etienne Dusseault
6f6576917c
Add settings-component to Storybook (#12086)
* settings

* add id filename

* remove platform version

* readd platform version
2021-10-29 20:40:32 -03:00
Olusegun Akintayo
7e7d0c13f4
Show error if user have insufficient gas. (#12531) 2021-10-29 19:45:50 +04:00
filipsekulic
6221365980
Update icons on the settings page (#12359) 2021-10-29 09:25:23 -02:30
David Walsh
a83d50a489
Provide instructions for users switching from Ledger Live to WebHID (#12519) 2021-10-28 18:38:58 -05:00
Mark Stacey
e067379f48
Remove the partially-applied dark mode styles used for beta (#12489)
The beta build currently has a couple of UI elements (the horizontal
logo and the app header) set to "dark mode", even though nothing else
in our UI supports dark mode yet. These styles have been removed. We
should make the entire UI support dark mode all at once at a later
date.

Also the horizontal logo used for beta was named incorrectly; the dark
and non-dark logos were swapped. They have been switched back so that
the logo that ends with `-dark` is for dark mode.
2021-10-28 17:29:20 -02:30
Olusegun Akintayo
b6673731e2
Implement Network Switcher designs (#12260)
* Show test networks toggle button in settings/advanced tab.

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

* Apply toggle testnet settings and show/hide testnets when on/off
Add localhost to testnet.

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

* Lint fixes.

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

* Show add network button

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

* Open full screen when add network is called.

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

* Show custonm rpc before testnet rpcs
lint fixes.

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

* Test cases for network dropdown.

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

* Test cases for toggle test networks in advanced tab component.

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

* Lint fixes.

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

* Fix Locales.

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

* E2E Tests: Custom RPC is now called Add Network

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

* Lint fix

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

* E2E: When Add Network button is clicked, wait for the full screen window to
be visible

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

* findVisibleElement should use a class. i.e start with a dot

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

* Hide Dropdown when Add Netwok is clicked.
Only show full screen if it's not already showing.
E2E tests passing.

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

* Lint fixes

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

* Fix tests for jest

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

* Testnets are not being shown by default anymore, tests should use
Mainnet instead.

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

* Import Button from ui
Change selector name to getShowTestnetworks
Fix button to show full width

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

* Fix e2e tests

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

* Remove localhost from INFURA provider types.

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

* Fix errors in Advanced Tab Component tests

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

* Lint fixes

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

* Fix unit tests for advanced tab component.

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

* Remove deleted elements from e2e tests

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

* Make sure all tests passed.

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

* Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-10-28 23:31:05 +04:00
Niranjana Binoy
e42fb0d640
Approve screen header and sub-header improvement (#12360) 2021-10-28 15:16:03 -04:00
Daniel
e8944e0a5d
Don't show "Unavailable on this network" if Swaps button is enabled (#12513)
* Don't show "Unavailable on this network" if Swaps button is enabled

* Hide a tooltip title if tooltip is disabled

* Update a snapshot
2021-10-28 19:36:04 +02:00
ryanml
05a80ebeba
Adding collectibles feature flag, default NFT tab (#12463)
* Adding COLLECTIBLES_V1 feature flag

* Adding NFT's tab to home screen, default CollectiblesList view

* Handling null children in Tabs component
2021-10-27 09:55:14 -07:00
Niranjana Binoy
532927368d
Network Form Design and switch to full screen enhancements (#12302) 2021-10-25 16:38:43 -04:00
Jyoti Puri
79b08fb803
Refactoring useGasFeeInputs hook (#12327)
Refactoring useGasFeeInputs hook
2021-10-22 22:44:28 +05:30
Dan J Miller
9d70c60c22
Connect Ledger via WebHID (#12411)
* Connect ledger via webhid if that option is available

* Explicitly setting preference for webhid

* Use ledgerTransportType enum instead of booleans for ledger live and webhid preferences

* Use single setLEdgerTransport preference methods and property

* Temp

* Lint fix

* Unit test fix

* Remove async keyword from setLedgerTransportPreference function definition in preferences controller

* Fix ledgelive setting toggle logic

* Migrate useLedgerLive preference property to ledgerTransportType

* Use shared constants for ledger transport type enums

* Use constant for ledger usb vendor id

* Use correct property to check if ledgerLive preference is set when deciding whether to ask for webhid connection

* Update eth-ledger-bridge-keyring to v0.9.0

* Only show ledger live transaction helper messages if using ledger live

* Only show ledger live part of tutorial if ledger live setting is on

* Fix ledger related prop type errors

* Explicitly use u2f enum instead of empty string as a transport type; default transport type to webhid if available; use constants for u2f and webhid

* Cleanup

* Wrap ledger webhid device request in try/catch

* Clean up

* Lint fix

* Ensure user can easily connect their ledger wallet when they need to.

* Fix locales

* Fix/improve locales changes

* Remove unused isFirefox property from confirm-transaction-base.container.js

* Disable transaction and message signing confirmation if ledger webhid requires connection

* Ensure translation keys for ledger connection options in settings dropdown can be properly detected by verify-locales

* Drop .component from ledger-instruction-field file name

* Move renderLedgerLiveStep to module scope

* Remove ledgerLive from function and message names in ledger-instruction-field

* Wrap ledger connection logic in ledger-instruction-field in try catch

* Clean up signature-request.component.js

* Check whether the signing address, and not the selected address, is a ledger account in singature-request.container

* Ensure ledger instructions and webhid connection button are shown on signature-request-original signatures

* Improve webhid selection handling in select-ledger-transport-type onChange handler

* Move metamask redux focused ledger selectors to metamask duck

* Lint fix

* Use async await in checkWebHidStatusRef.current

* Remove unnecessary use of ref in ledger-instruction-field.js

* Lint fix

* Remove unnecessary try/catch in ledger-instruction-field.js

* Check if from address, not selected address, is from a ledger account in confirm-approve

* Move findKeyringForAddress to metamask duck

* Fix typo in function name

* Ensure isEqualCaseInsensitive handles possible differences in address casing

* Fix Learn More link size in advanced settings tab

* Update app/scripts/migrations/066.js

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

* Update ui/pages/settings/advanced-tab/advanced-tab.component.test.js

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

* Add jsdoc comments for new selectors

* Use jest.spyOn for mocking navigator in ledger webhid migration tests

* Use LEDGER_TRANSPORT_TYPES values to set proptype of ledgerTransportType

* Use LEDGER_TRANSPORT_TYPES values to set proptype of ledgerTransportType

* Fix font size of link in ledger connection description in advanced settings

* Fix return type in setLedgerTransportPreference comment

* Clean up connectHardware code for webhid connection in actions.js

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

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

* Update ui/ducks/metamask/metamask.js

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

* Add migration test for when useLedgerLive is true in a browser that supports webhid

* Lint fix

* Fix inline-link size

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-10-21 16:47:03 -02:30
ryanml
1a1fa3aac5
Removing unused prop/code paths from EditContact (#12419) 2021-10-21 10:05:50 -07:00
David Walsh
3f687ff45f
Use ternary conditionals instead of && (#12406) 2021-10-21 11:11:31 -05:00
VSaric
5fea5fac8c
Adding copy to SRP import screen to warn users (#12400)
* Added copy to SRP import screen to warn users that there current wallet will be replaced

* Fixing test-lint error

* Remove padding and edit warning message
2021-10-21 06:20:17 -02:30
Alex Donesky
f733857388
Onboarding V2 Cleanups (#12417)
* remove the onboarding V2 feature flags used for dev, some remain until we're ready to make the switch

* update route

* add setCompletedOnboarding dispatch to submission on privacy-settings view

* update privacy-settings test
2021-10-20 13:55:59 -05:00
Alex Donesky
83d5eec2dc
centralize min gas const (#12387) 2021-10-19 14:31:56 -05:00
David Walsh
d90ac2d8e6
Fix 12192 - Implement new metametrics onboarding screen (#12282) 2021-10-19 12:01:42 -05:00
David Walsh
16d741348e
Fix #12190 - Implement new pin extension view for onboarding (#12290) 2021-10-18 17:33:42 -05:00
ryanml
308cca1897
Preventing swaps data re-fetch when navigating back to home screeen (#12370) 2021-10-18 10:31:34 -07:00
ryanml
54f57826c4
Fixing invalid prop type for ActionableMessage (ImportToken) (#12377) 2021-10-18 09:28:56 -07:00
David Walsh
84e0547ac0
Use consistent naming for welcome route of onboarding (#12366) 2021-10-18 10:12:57 -05:00
Alex Donesky
71f91568db
Migrate completedOnboarding and firstTimeFlowType state into onboardingController (#12356)
* migrate completedOnboarding state into onboardingController

* migrate firstTimeFlowType state from preferencesController to onboardingController
2021-10-15 13:52:52 -05:00
Etienne Dusseault
be0508d41e
Add send-hex-data-row to Storybook (#12085)
* send-hex-data

* id filename

* lint
2021-10-15 09:32:13 -02:30
Etienne Dusseault
1e5c0078dd
Add send-asset-row to Storybook (#12081)
* send-asset

* id filename
2021-10-15 09:30:36 -02:30
Alex Donesky
859b80955b
Small clean ups of onboarding flow v2 changes (#12349) 2021-10-14 12:46:43 -05:00
Alex Donesky
aa070edd3f
Fixing address truncation papercuts (#12330)
* fixing address truncation papercuts
2021-10-13 12:54:48 -05:00
Alex Donesky
398ea62029
Add Import Secret Recovery Phrase View (#12289)
* Add import secret recovery phrase to onboarding flow
2021-10-13 12:41:24 -05:00
David Walsh
77f8ec4d3a
Fix 12265 - Update onboarding welcome screen (#12275) 2021-10-13 09:22:51 -05:00
ryanml
31b681f301
Removing top cancel button when in send draft flow (#12304) 2021-10-11 09:52:23 -07:00
Alex Donesky
a8ec9ada2a
Onboarding V2 Creation Successful view (#12248)
* add creation-successful onboarding view
2021-10-11 09:43:25 -05:00
Dan J Miller
18ca9d14e0
Do case-insensitive comparisons of token addresses in view-quote and build-quote (#12315) 2021-10-08 18:57:45 -02:30
Alex Donesky
3d36fbd8ce
Onboarding V2 Privacy settings view (#12253)
* add Set Advanced Privacy Settings onboarding view
2021-10-08 14:50:36 -05:00
Alex Donesky
614228cba7
Onboarding V2 Secure Your Wallet view (#12208)
* secure-your-wallet onboarding view
2021-10-06 13:52:25 -05:00
Jyoti Puri
fc41321470
Support for type 0 transaction (#12252)
Support for type 0 transaction
2021-10-06 23:59:57 +05:30
Alex Donesky
3985a65e36
Onboarding V2 App Header (#12264)
* Add onboarding app header
2021-10-05 15:38:16 -05:00
Niranjana Binoy
68259ee3e2
UX Papercuts Epic: Create a consistent representation of the Buttons (#12096) 2021-10-05 15:20:42 -04:00
ryanml
f741712255
Fixing confirmation screen storybook views (#12271) 2021-10-04 06:46:18 -07:00
ryanml
c14f46eb92
Fixing confirm-add-suggested-token storybook entry (#12261) 2021-10-01 09:07:29 -07:00
Alex Donesky
9355fb21c7
Establish onboarding-flow wrapper/router base and feature flag env variable (#12247)
* establish onboarding-flow wrapper/router base and feature flag env variable

* small cleanup

* addressing feedback
2021-09-30 16:34:11 -05:00
Jyoti Puri
6187ab9b01
Fix gas control flicker on send screen when switching between EIP-1559 networks (#12230)
Fix gas control flicker on send screen when switching between EIP-1559 networks
2021-09-30 17:27:59 +05:30
Etienne Dusseault
bf89226ca1
Add send-header to Storybook (#12084) 2021-09-29 13:43:18 -05:00
Etienne Dusseault
c2bbbdd19c
Add account-list component to Storybook (#12228) 2021-09-29 13:42:49 -05:00
Etienne Dusseault
b5103bf317
Add select-hardware component to Storybook (#12227) 2021-09-29 13:42:38 -05:00
Matthew Epps
53f2c84209
Add client id to GasFeeController (#12221)
* chore: Add client id to GasFeeController

* chore: change EXTENSION_CLIENT_ID to SWAPS_CLIENT_ID in constants file
2021-09-29 10:41:19 -02:30
ryanml
f52dac290b
Using parsed seed phrase for restore vault input validation (#12229)
Fixes MetaMask/metamask-extension#12225
2021-09-28 12:21:19 -07:00
Akintayo A. Olusegun
08dff86be0
Add target object word to "View on Etherscan" links (#12100)
* Add target object word to "View on Etherscan" links
Fix for: #9476

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

* Fix Swap tests checking for View $1 at or View $1 on

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

* Linter Fixes

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

* Fix  ui/hooks/useTransactionDisplayData.test.js expected result should
be May 13, 2020

Update Jest snapshot for view on etherscan test

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

* Add description of the variables in messages.

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

* 1. localize all of the blockExplorerViewAction values
2. Apply this nit. https://github.com/MetaMask/metamask-extension/pull/12100#discussion_r708343532

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

* Lint fixes.

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

* Fix locale value not used on GUI error lint error.

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

* Reverted this commit, on circle ci, the date is May 12.

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

* Add description to link block explore actions to where it's used.

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

* Fix missing messages.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-09-24 21:14:07 +04:00
ryanml
30105a19d1
Fixing alignment of settings close button (#12202) 2021-09-24 09:28:54 -07:00
Etienne Dusseault
a86129d23f
fee-card (#12166) 2021-09-24 11:47:40 -03:00
ryanml
5c842107b9
Hardening property check for stopPropagation in ConfirmTxScreen (#12158) 2021-09-21 11:58:39 -07:00
ryanml
aba2c71948
Fixing ledger steps display (Confirm TX) (#12163)
* Fixing ledger steps display (Confirm TX)

* Hiding step two on Firefox
2021-09-20 13:19:35 -07:00
Niranjana Binoy
9929820b88
Adding a Token detection announcement in Search tab (#12152) 2021-09-20 15:42:58 -04:00
Matthew Epps
3ca6202282
Add client id header for Swaps Apis (#12137) 2021-09-20 14:06:41 -05:00
Etienne Dusseault
6b7444c257
Add add-recipient to Storybook (#12076) 2021-09-20 14:05:58 -05:00
Niranjana Binoy
e03d3dd5f0
Moving UseTokenDetection toggle to new Experimental tab (#12136) 2021-09-20 12:22:04 -04:00
Jyoti Puri
ade9e4ac4b
Changing cancel button labels in send screen when in editing stage (#12056)
* Changing cancel button labels in send screen when in editing stage

* Re-route user to home page when reject is clicked on edit transaction page
2021-09-17 10:07:50 +05:30
ryanml
792f9efa56
Adding "Enable smart contract data" step to Ledger Instructions (Confirmation Screen) (#12115) 2021-09-16 09:52:42 -07:00
Alex Donesky
2a9fbffb6c
Replace hardcoded sent ether label on confirm screen (#11802)
* Replace hardcoded sent ether label on confirm screen

* replace transaction type SENT_ETHER with network agnostic SENDING_NATIVE_ASSET

* remove sentEther translation base

* make backwards compatible with lingering transaction of legacy sentEther type

* update localalization files

* fixup legacy sentEther transaction type

* changing new transaction type away from localization string

* revert migration tests

* update fixtures and test data

* update name of new transaction type

* add migration

* remove legacy SENT_ETHER from transaction types enum object
2021-09-15 16:54:51 -05:00
kumavis
f472c2615a
CI - add metamaskbot comment "highlights" section for showing relevant storybook changes (#12095)
* ci/announce/highlight - add bot announcement section for "highlights" showing off important diffs + storybook highlights

* ci/announce/highlight - fix announcement message

* Update index.js

* xxx tmp xxx

* ci/announce/highlight - fix dirty file calculation

* ci/announce/highlight - try/catch wrap highlight generation for build stability

* ui - put fox emojis in the mascot component

* ci/announce/highlight - start storybook permalinks

* ci/announce/highlight - fix storybook permalink util

* ci/announce/highlight - fix storybook permalink util

* ci/announce/highlight - small styling fix

* storybook - use any easily predictable story id

* ci/announce/highlight - revert sample commit

* ci/announce/highlight - minimal documentation
2021-09-15 08:55:48 -10:00
ryanml
7895fcb7af
Merge pull request #11976 from MetaMask/break-point-overhaul
Using design system breakpoint values across ui/
2021-09-15 10:41:05 -07:00
Niranjana Binoy
49ddc48592
Adding search tab in import tokens for custom networks (#12110) 2021-09-15 12:09:23 -04:00
Daniel
28fc2d471f
Quotes prefetching in Swaps (#11915) 2021-09-15 15:13:18 +02:00
Etienne Dusseault
3e0d79d251
Add send-gas-row to Storybook (#12083) 2021-09-13 16:05:42 -05:00
Etienne Dusseault
aec31cc8b7
Add send-footer to Storybook (#12082) 2021-09-13 16:05:17 -05:00
Etienne Dusseault
d1d01f434d
Add contact-list-tab to Storybook (#12079) 2021-09-13 16:04:31 -05:00
Etienne Dusseault
ad182c8fa4
Add advanced-tab to Storybook (#12077) 2021-09-13 16:02:24 -05:00
ryanml
5c03be009a Fixing breakpoint fallthroughs 2021-09-11 11:13:36 -07:00
ryanml
069ebaf463 Using design system breakpoint values across ui/ 2021-09-11 11:00:46 -07:00
Niranjana Binoy
05aadb38f2
Adding fake token warning and replacing Add Token labels with Import Tokens (#11798) 2021-09-10 16:21:04 -04:00
Niranjana Binoy
18c35ad91e
Adding Token Detection Toggle to Security & Privacy (#11851) 2021-09-10 14:02:30 -04:00
Alex Donesky
490d3b8d40
Integrate TokensController (#11552)
* Integrate controllers/tokensController

* address rebase issues

* small cleanup

* addressing feedback

* more feedback
2021-09-10 12:37:19 -05:00
Niranjana Binoy
eb987a47b5
Integrating the TokenListController to Extension (#11398) 2021-09-09 16:56:27 -04:00
Brad Decker
ec1fd38076
remove unused sidebar component (#12048) 2021-09-09 10:14:07 -05:00
Jyoti Puri
e410cd3a82
Merge pull request #12039 from jpuri/dev_12035
Fix padding at bottom of custom network form in popup view
2021-09-09 10:35:05 +05:30
David Walsh
7b827ca5e7
Create MetaMask Beta build (#10985) 2021-09-08 15:08:23 -05:00
Daniel
6f0d6b1693
Add support for swaps via a direct contract for wrapping and unwrapping (#11845)
* Update contract address validations in swaps for different networks

* Add support for direct contract swaps for wrapping and unwrapping

* Add WETH_RINKEBY_CONTRACT_ADDRESS
2021-09-08 20:08:55 +02:00
Daniel
93cdd3c159
Use Swaps dev APIs based on an env variable (#11924) 2021-09-08 19:26:37 +02:00
ryanml
4cc4092e1f
Merge pull request #11964 from BboyAkers/aakers/7397
Disabled spell-check on ens input
2021-09-08 10:00:19 -07:00
jpuri
ec9b94ccfe
Fix padding at bottom of custom network form in popup view 2021-09-08 21:10:15 +05:30
Etienne Dusseault
09e79f273a
fix state problems with Storybook (#11984)
* fix state problems with Storybook

* lint

* lint

* Cleanup

Co-authored-by: ryanml <ryanlanese@gmail.com>
2021-09-07 13:51:41 -10:00
ryanml
17fe978c82
Adding usage instructions for Ledger Live users to confirmation screen (#12020)
* Adding usage instructions for Ledger Live users to confirmation screen

* Using design system components

* Hiding first step on Firefox
2021-09-07 14:46:15 -07:00
Alex Donesky
7a8f65d642
fix import account page layout (#11944)
* fix import account page layout

* cleanup
2021-09-03 10:56:43 -05:00
Alex Donesky
dcebf49032
fix contact settings layout issues (#11967) 2021-09-03 10:54:20 -05:00
Alex Donesky
3358ac2c1f
send user to account page upon adding a custom network (#11945) 2021-09-03 10:52:37 -05:00
Akintayo A. Olusegun
aba396870a
Update copy in dapp suggested gas fee tooltip to: "Edit to use MetaMask's recommended gas fee based on the latest block." #11952 (#11986)
* Change the [domain] suggested gas fee (i) to Estimated gas fee (i)
Change that line's color from orange to black
Under that line, add Site suggested in italics in gray.

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

* liinter fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-09-01 11:02:01 -07:00
Etienne Dusseault
48c5c07ded
send-content (#11962) 2021-08-30 13:05:02 -10:00
Etienne Dusseault
9f0f729c5b
token-placeholder (#11961) 2021-08-30 13:04:24 -10:00
Etienne Dusseault
8875e9a49c
token-search (#11960) 2021-08-30 13:04:05 -10:00
Etienne Dusseault
1a0276fc6e
gas-fee-display (#11959) 2021-08-30 13:03:47 -10:00
Etienne Dusseault
1c2d9e5c9c
add-token (#11957) 2021-08-30 13:02:55 -10:00
Etienne Dusseault
4426104fc7
unlock-page (#11955) 2021-08-30 13:02:23 -10:00
Etienne Dusseault
9f10fe8c97
swaps-gas-customization (#11938) 2021-08-30 13:01:59 -10:00
Etienne Dusseault
8d22dc4470
import token (#11657) 2021-08-30 13:00:47 -10:00
Etienne Dusseault
28708e3a2e
Add first time flow components to Storybook (#11655)
* end of first time flow

* metametrics first time flow

* select-action

* welcome
2021-08-30 12:59:56 -10:00
Etienne Dusseault
0a472a440a
create-password (#11646) 2021-08-30 12:59:20 -10:00
Etienne Dusseault
2de9628865
Add mobile-sync component to Storybook (#11645)
* mobile sync

* lintfix
2021-08-30 12:58:58 -10:00
Etienne Dusseault
57a5e4528b
Add permissions-connect component to Storybook (#11644)
* add metadata

* fix image path for storybook

* fix lint

* separate components
2021-08-30 12:58:21 -10:00
Etienne Dusseault
2ca7f066e3
Add new-account component to Storybook (#11638)
* add action

* lintfix
2021-08-30 12:57:39 -10:00
Etienne Dusseault
7d0d6013af
Add connected-accounts component to Storybook (#11637)
* name change

* add actions

* lintfix
2021-08-30 12:56:34 -10:00
Etienne Dusseault
7b4aac7755
Add connected-sites component to Storybook (#11415)
* connectd-sites

* fix image path for storybook

* lintfixd, namechange
2021-08-30 12:56:03 -10:00
Etienne Dusseault
2996163770
Add confirm-send-token component to Storybook (#11399)
* fix image path for storybook

* confirm-send-token-component

* lintfix
2021-08-30 12:55:08 -10:00
Etienne Dusseault
cd3447995b
confirm-transaction-base (#11396)
Co-authored-by: kumavis <kumavis@users.noreply.github.com>
2021-08-30 12:54:21 -10:00
Etienne Dusseault
a77368be34
Add confirm-send-ether component to Storybook (#11395)
* confirm-send-ether

* fix conflict

* lintfix

Co-authored-by: kumavis <kumavis@users.noreply.github.com>
2021-08-30 12:53:41 -10:00
Austin Akers
6875d15e5f disabled spell-check on ens input 2021-08-28 19:16:19 -07:00
ryanml
9c675ec033
Temporarily Disabling Mobile Sync (#11931) 2021-08-25 11:54:23 -07:00
ryanml
b021c35f7b
Fixing error handling for publish() (MobileSync) (#11909) 2021-08-25 09:16:12 -07:00
ryanml
dc3e74a66a
Localize import account warning messages (#11910) 2021-08-25 09:14:42 -07:00
ryanml
472cf17bda
Adding UI helpers for URL parsing (#11899) 2021-08-24 15:28:16 -07:00
Elliot Winkler
0d63aa0402
Update header on Send page to be more accurate (#11895)
Change "Add Recipient" to "Send to".
2021-08-20 09:44:41 -06:00
ryanml
a4360e7201
Adding subtitles for additional languages (SRP Video) (#11849)
Adding support for: Spanish, Hindi, Indonesian, Japanese, Korean, Portuguese, Russian, Tagalog, and Vietnamese
2021-08-18 09:09:11 -07:00
ryanml
d1d6f0531e
Fix content cutoff issue (Mobile Sync View (#11871) 2021-08-18 02:12:07 -07:00
Dan Finlay
932474127e
Increase saliency of mobile sync warning (#11862)
* Increase warning saliency of qr sync

* Remove duplciate locale entries

* Revise wording per Antonela feedback

* Avoid all caps

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2021-08-17 18:19:09 -07:00
Dan J Miller
29487ef277
Allow submission of transactions with dapp suggested gas fees, while estimates are loading (#11858)
* Allow submission of transactions with dapp suggested gas fees, while estimates are loading

* Allow editing of transactions with dapp suggested feeds, while estimates are still loading

* Ensure that advanced gas is always editible inline when gas is loading

* Ensure that insufficient balance error is shown when gas is loading if the user has customized the gas

* Only set gas price insufficient errors if the current network is non-eip-1559, or the txparams actually have a gas price

* Remove unnecessary param

* lint fix

* ensure insufficient balance warning is showing when loading

* Ensure that eip1559 network transactions do not combined eip1559 and non-eip1559 gas fee properties

* Lint fix
2021-08-17 17:38:13 -02:30
Etienne Dusseault
46c4cc1966
Add confirm-add-suggested-token & confirm-add-token components to Storybook (#11175)
* add suggessted token

* lintfix

* lintfix

* silence use effect warning

* download token icons and use paths to avoid web urls

* lintifx

* Add confirm-add-token component to Storyboard (#11195)

* create story for add token

* change code

* add confirm add token story

* lintfix

* Update confirm-add-token.component.js

* Update confirm-add-token.component.js

* different token list for confirm add token

* lintfix

* Update confirm-add-suggested-token.component.js

* remove bnb png

* remove redundant images and fix storybook image path
2021-08-17 00:33:46 -05:00
Etienne Dusseault
71a9fe2ed1
Add confirm-token-transaction-base component to Storybook (#11414)
* confirm-token-transaction-base

* Update ui/pages/confirm-token-transaction-base/confirm-token-transaction-base.stories.js

Co-authored-by: Brad Decker <git@braddecker.dev>

Co-authored-by: Brad Decker <git@braddecker.dev>
2021-08-17 00:33:32 -05:00
Etienne Dusseault
435b663f5f
awaiting signature (#11656) 2021-08-17 00:30:58 -05:00
Dan J Miller
ae247ea14a
Improve flashing behaviour for loading gas estimates (on confirm screen) (#11852)
* Improve flashing behaviour for loading gas estimates

* Fix typo

* renderHeartBeatIfInTest
2021-08-16 20:18:24 -02:30
Dan J Miller
b919884c6e
Allow editing custom gas while estimate is loading (#11853) 2021-08-16 20:15:55 -02:30
David Walsh
01fd2a609e
Gas Timing with Negative attitude should be bold with tooltip (#11772) 2021-08-14 17:46:55 -05:00
David Walsh
b5baa6c1d1
EIP-1559 - Update tooltip text for gas fees (#11805) 2021-08-13 19:13:21 -05:00
ryanml
1837397202
Fixing persisting error message from MobileSyncPage (#11835) 2021-08-13 12:59:06 -07:00
Daniel
410c4aec9a
Fix Insufficient number of substitutions for key "swapYourTokenBalance" (#11833)
* Fix Insufficient number of substitutions for key "swapYourTokenBalance"

* Use an empty string if there is no default symbol

* Add ? after SWAPS_CHAINID_DEFAULT_TOKEN_MAP[chainId]
2021-08-13 08:26:42 -07:00
ryanml
428b86fcf3
Hardening clipboardData handling in EnsInput (#11822) 2021-08-12 15:30:07 -07:00
ryanml
504e74fbed
Fixing EditGasDisplay console errors (#11797) 2021-08-10 13:45:09 -07:00
Dan J Miller
e6543a83ef
Ensure transaction activity log supports EIP-1559 (#11794)
* Ensure transaction activity log supports EIP-1559

* unit test fix

* Add estimated base fee to swaps txMeta

* fix lint and tests

* Improve activity log copy
2021-08-06 19:48:53 -02:30
Dan J Miller
bfde5a1d77
Fixes updates on the confirm screen. (#11788)
* Fixes updates on the confirm screen.

* Better handling of internal send transactions

* maxFee -> maxFeePerGas property name fix

* Remove redundant setEstimateToUse call in onManualChange

* Fix unit tests

* rebase error fix

* Fixes to speedup loading and transaction breakdown priority fee

* Fix lint and unit tests

* Ensure gas price based transaction that have been customized (e.g. speed up and retry) are properly initialized in useGasFeeInputs

* Clean up

* Link fix
2021-08-06 14:31:30 -05:00
Alex Donesky
751534e665
fix confirm transaction details to match spec (#11779) 2021-08-05 20:07:04 -05:00
David Walsh
a0bd496d56
Restore heartbeat to transaction confirmation, use isGasEstimatesLoading more broadly (#11781) 2021-08-05 18:59:58 -05:00
Alex Donesky
d359429f04
Stop GasFeeController polling when pop closes (#11746)
* Stop GasFeeController polling when pop closes

* Stop estimate gas polling on window unload

* lint + comments

* Improve client closed logic

* lint

* Add back _beforeUnload on unmount in gas-modal-page-container

* Add full check and call onClientClosed method for notifcation environment

* Add gas pollingToken tracking to appStateController and use to disconnect polling for each environment type

* remove unused method

* move controller manipulation logic from background.js to metamask-controller, disaggregate methods

* add beforeunload handling to reset gas polling tokens from root of send page

* cleanup, lint and address feedback

* clear appState gasPollingTokens when all instances of all env types are closed, fix pollingTokenType arg from onEnvironmentTypeClosed call in metamask-controller

* mock new methods to fix tests

* final bit of cleanup + comments

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2021-08-04 16:53:13 -05:00
Alex Donesky
4552a53724
remove unnecessary conversion call (#11742)
* remove unnecessary conversion call

* Pass args to GasTiming as decGwei

* lint
2021-08-04 10:54:40 -02:30
ryanml
7f0b2a81ce
Fall back to aggregator name when icon is unavailable (Swaps Load View) (#11718) 2021-08-03 12:09:39 -07:00
Alex Donesky
a4927a30ac
Add gasPrice to be used on non-1559 networks for transaction details on confirm screen (#11741) 2021-08-03 10:56:49 -05:00
David Walsh
cdbfe0f132
EIP-1559 - Ensure transaction detail font-size and icon colors are consistent with Figma design (#11735) 2021-08-02 21:08:20 -05:00
David Walsh
e2fbc7ce8e
Remove button group for non-EIP-1559 networks (#11712)
* Remove button group for non-EIP-1559 networks

* Fix tests...maybe

* Remove unnecessary props, as well as gas display

* Remove unused string

* test progress

* fix test

* fix test

* add customizes gas block to improve e2e pass rate

Co-authored-by: Alex <adonesky@gmail.com>
2021-08-02 18:53:13 -05:00
David Walsh
c8b3dfe4e9
EIP-1559 - Fall back to gasLimit and gasPrice for hardware wallets (#11716) 2021-08-02 17:52:18 -05:00
kumavis
7018b43898
improve password-manager metadata attributes (#11690) 2021-08-02 10:40:44 -07:00
David Walsh
38ff2c937f
Fix #11703 - Provide wiring for approval modal (#11711) 2021-08-02 09:07:15 -05:00
Alex Donesky
8a42258e10
Remove the SHOW_EIP_1559_UI environment variable, replace with network detection where appropriate (#11694)
Fixing up tests and add back old custom gas modal for non-eip1559 compliant networks

Remove unnecessary props from send-gas-row.component

fix breaking test

Fix primary and secondary title overrides

fix rebase issue

Fix rebase conflict

Co-authored-by: David Walsh <davidwalsh83@gmail.com>
2021-07-30 22:59:21 -02:30
Brad Decker
e0953d9f68
Update send and confirm state management, and tx controller gas defaults, for EIP1559 (#11549)
wip

Documentation improvements for send slice support of EIP1559

Remove console.log in send duck

Property lookup safety improvement in selectors/confirm-transaction

Add code accidentally removed in rebase

Update addTxGasDefaults and _getDefaultGasFees to work with new estimate types, and ensure we correctly handle gas price estimates when on EIP1559 networks (#11615)

* Fix typo

Remove console.log in send duck

* Update addTxGasDefaults and _getDefaultGasFees to work correctly with all new gas fee estimate types

* Don't show gas timing support when not on eip1559 compatible network

* Hide gas timing component on transaction screen when on a non-1559 network

* Improve comments, tests and edge case handling

* Ensure eip1559 fees are applied and updated correctly when eip1559 estimate api fails

* Lint fix

Co-authored-by: Brad Decker <git@braddecker.dev>

Remove console.log

Handle possible gasEstimateType undefined

Remove unnecessary nonce field position change in confirm-page-container-content__details
2021-07-30 22:15:18 -02:30
Daniel
fa703173a0
Fix Jest unit tests (#11687)
* Fix Jest unit tests

* Provider correct getGasFeeTimeEstimate call to Gas Timing

* Fix tests for correct getGasFeeTimeEstimate method name

* Rename instances to getGasFeeTimeEstimate

Co-authored-by: David Walsh <davidwalsh83@gmail.com>
Co-authored-by: Dan Miller <danjm.com@gmail.com>
2021-07-30 15:10:41 -02:30
Daniel
24f5cc009b
Pass "maxFeePerGas" to the <GasTiming> component from Swaps (#11684) 2021-07-30 15:19:30 +02:00
David Walsh
e283c03c4e
EIP-1559 - Improve gas timing logic to show more accurate verbiage (#11668) 2021-07-30 08:00:02 -05:00
Daniel
714170c7b8
EIP-1559 and Rinkeby Testnet support in Swaps (#11635) 2021-07-30 13:35:30 +02:00
David Walsh
6d1fb911dc
EIP-1559 - Fix education links (#11650) 2021-07-29 09:18:13 -05:00
ryanml
52bac60a22
Fixing confirmation layout when dapp has suggested a price (EIP-1559) (#11634) 2021-07-28 11:29:55 -05:00
ryanml
813eef6080
Trimming whitespace in ENSInput (#11631) 2021-07-27 07:53:13 -07:00
Daniel
709369dc14
Fix default tooltip color (#11633) 2021-07-27 15:20:01 +02:00
David Walsh
fab9cfde03
EIP-1559 - Provide data wiring for Gas Timing component (#11462) 2021-07-26 10:35:51 -05:00
Daniel
868d932165
Check for the "fromToken" existance before checking decimals (#11606) 2021-07-26 10:15:13 +02:00
David Walsh
5d92836c8c
EIP-1559 - Provide the nonce field in the new transaction display (#11598) 2021-07-25 09:56:24 -05:00
ryanml
68c852f7c9
Validating seed phrase in restoration flow (#11586) 2021-07-22 10:34:53 -07:00
Daniel
a17c4462b4
Add token decimals validation in Swaps (#11587)
* Add token decimals validation in Swaps
* Use camelCase
2021-07-22 19:29:31 +02:00
David Walsh
c1d96676b5
EIP-1559 - Implement new verbiage for transaction detail subtext (#11569) 2021-07-22 11:33:34 -05:00
David Walsh
859a82d428
EIP-1559 - Ony show orange confirmation heading when fee is Dapp suggested (#11570) 2021-07-21 07:54:32 -05:00
Daniel
594025a198
Add support for Polygon (#11545)
* Fix a check for EIP presense
* Add support for Polygon
* Update default Polygon URL
* Trigger Build
* Use a more user-friendly error message for disabled Swaps API calls
2021-07-20 19:17:15 +02:00
Etienne Dusseault
96b0730a89
add confirm-encryption-public-key component to Storybook (#11364)
* confirm-encryption-public-key

* lintfix

* lintfix
2021-07-20 09:29:38 -07:00
Brad Decker
dc25a24de3
rely upon gas fee controller for gas price estimates (#11511) 2021-07-16 11:06:32 -05:00
David Walsh
d8984d3cf3
EIP-1559 - Provide Updated UI for Dapp-Suggested Gas fees (#11523) 2021-07-16 10:00:03 -05:00
ryanml
b21b139653
Handling non-numeric input for chain id in network form (#11537) 2021-07-15 14:11:43 -07:00
David Walsh
91e744a705
EIP-1559 - Provide edit button for transaction screens to update gas (#11516) 2021-07-14 08:42:10 -05:00
ryanml
bbef49158d
Various UI fixes (#11512) 2021-07-13 19:06:12 -07:00
David Walsh
90180627cb
Using translation for edit text (#11514) 2021-07-13 14:22:33 -05:00
Brad Decker
9416d1ca71
provide skeleton for submitting gas form (#11496) 2021-07-12 14:35:54 -05:00
ryanml
f15a68b923
Fixing invalid prop type in ConfirmPageContainerHeader (#11500) 2021-07-12 10:13:09 -07:00
Daniel
d438439661
Swaps: Add conditional routing to new APIs based on a feature flag (#11470) 2021-07-09 10:24:00 -05:00
Alex Donesky
2cb807dc20
fix up ens/hex address validation error handling (#11477)
* fix up ens/hex address validation error handling

* fix lint/tests
2021-07-09 09:17:02 -05:00
Brad Decker
68dfc98f40
wire up gasFeeController (#11421) 2021-07-08 15:23:00 -05:00
Alex Donesky
0ca0f1784e
Add recovery-phrase views for new onboarding flow (#11434)
* add recovery-phrase views for new onboarding flow

* black => ui-black

* minor syntax improvement
2021-07-07 19:10:12 -05:00
Alex Donesky
b1e2005a73
Add form-field component and new account view (#11450)
* add generic form-field component

* swap in new form-field component for advanced-gas-controls-row

* add new create password view for redesigned onboarding flow

* make text additions translatable
2021-07-06 17:19:11 -05:00
Brad Decker
da9fb4636b
move conversion utils to shared folder (#11451) 2021-07-06 12:48:49 -05:00
David Walsh
afe06adb7a
Add icon to actionable message component (#11409) 2021-07-02 14:07:56 -05:00
Daniel
8ca0d24f82
Increase Jest unit test coverage for the Swaps feature to ~60% (#11343) 2021-07-02 08:48:34 -05:00
David Walsh
36d3770b42
EIP-1559 - Implement TransactionDetail for confirmations (#11404) 2021-06-30 11:58:18 -05:00
sooyoung
9e86a03afa
add scroll function to jump to the top of screen (#11386)
* add scroll function to jump to the top of screen

* moved the scroll function from transaction-list.js to asset.js
2021-06-29 15:08:31 -05:00
Brad Decker
844a021fcd
remove ui lookup of lastGasPrice field (#11411) 2021-06-29 11:02:00 -05:00
David Walsh
d68f8f27c6
Implements the new EIP1559 UI components (#11384) 2021-06-28 09:45:08 -05:00
ryanml
a69ed05141
Removing obsolete client-side transaction metrics events (#11329)
* Removing metametrics send count tracking

* Removing client side Transaction Completed and Canceled events
2021-06-24 15:37:44 -07:00
Alex Donesky
a6e16f458e
Adding edit navigation button flow back to send token flow (#11335) 2021-06-23 18:50:24 -05:00
Alex Donesky
a4a5580785
Update controllers with conversionRate change with minimal required changes in extension (#11361)
* updating controllers with conversionRate change with minimal required changes in extension

* swapping showFiat selector in places where possible

* adding invalid conversion protection

* lint fixes

* adjusting list-item styling logic
2021-06-23 18:28:49 -05:00
Brad Decker
c30cb7d33a
Refactor send page state management (#10965) 2021-06-23 16:35:25 -05:00
ryanml
a171ac7b34
Allowing custom rpc form submission when chainId is a duplicate (#11363) 2021-06-23 09:14:38 -07:00
Alex Donesky
e10ddbe3a3
add erc-721 token detection and flag to disable sending (#11210)
* add erc-721 token detection and flag to disable sending

* addressing feedback

* remove redundant provider instantiation

* fix issue caused by unprotected destructuring

* add tests and documentation

* move add isERC721 flag to useTokenTracker hook

* Update  and  unit tests

* use memoizedTokens in useTokenTracker

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2021-06-22 12:39:44 -05:00
ryanml
e144bbd356
Adding gasEstimateType to 'Changed Gas Button' metrics event (#11352)
Adding 'Changed Gas Button' metrics event
2021-06-21 12:02:51 -07:00
ryanml
64835b1457
Fixing untranslated text in ConfirmApproveContent (#11339) 2021-06-17 11:40:36 -07:00
sooyoung
3c2e83dff3
fix 'confirm popup' ui (#11331) 2021-06-17 09:26:58 -05:00
David Walsh
a08d927681
Make MAX button accessible (#11322) 2021-06-16 10:00:19 -05:00
Etienne Dusseault
d260b81cd5
Add confirm-deploy-contract component to Storybook (#11211)
* confirm deploy contract

* use downloaded image
2021-06-15 14:20:15 -07:00
ryanml
24adadbce0
Fixing untranslated alt tag in ContactListTab component (#11293) 2021-06-15 09:31:25 -07:00
Niranjana Binoy
df6c6a46d7
Minor spelling correction to buildContactList(#11286) 2021-06-14 22:59:30 -04:00
ryanml
f1ed0e74a5
Updating "designed and built" message 🌎 (#11285) 2021-06-14 09:37:21 -07:00
ryanml
22c2d261b9
Fixing unlocalized strings (#11281) 2021-06-12 15:25:24 -07:00
ryanml
2bfc3a093f
Using values from shared/constants/time to represent timing values (#11241) 2021-06-10 12:27:03 -07:00
Brad Decker
9e509d0c9d
Relocate send state into send duck from metamask duck (#11252) 2021-06-10 12:53:15 -05:00
ryanml
5afd1c9fa6
Using native network currency for encryption public key requests (#11257)
Fixes MetaMask/metamask-extension#11247
2021-06-10 10:49:14 -07:00
Dan J Miller
432d6508ba
Stringify gas estimate in backend, before it is serialized and sent to ui (#11266)
* Stringify gas estimate in backend, before it is serialized and sent to ui

* Fix send.utils.test.js
2021-06-09 22:18:05 -02:30
ryanml
a75092762f
Fix built-in networks switch-ethereum-chain, Including RPC url in switchEthereumChain requestData (#11268)
* Moving RPC Urls to network constants

* Including RPC url in switchEthereumChain requestData

* Setting project id to var

* Fix built-in networks switch-ethereum-chain

`switch-ethereum-chain` did not work correctly with built-in networks.
It was treating them as custom networks, rather than as built-in
networks. This affected how they were displayed in the network
dropdown, and resulted in slight differences to the network stack used
as well.

The problem was that `updateRpcTarget` was used, which was meant for
custom networks only. Now that `setProviderType` is used in the case of
a built-in network, the behaviour should match the network switcher
exactly.

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-06-09 15:18:38 -07:00
ryanml
1080319b33
Adding back button to reveal seed phrase view (#11246)
Reveal seed phrase button placement fixes

Localizing uses of the word "Back"
2021-06-08 10:02:34 -07:00
Brad Decker
b073b04789
move metamask state selectors out of send (#11249) 2021-06-08 11:03:59 -05:00
Brad Decker
df9bc52e9f
Add gas constants (#11248) 2021-06-08 10:25:48 -05:00
ryanml
9932c40651
Adding periodic reminder modal for backing up recovery phrase (#11021)
* Adding recurring recovery phrase reminder modal

* Refactoring per PR feedback
2021-06-04 23:33:58 -07:00