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

4578 Commits

Author SHA1 Message Date
Daniel
c3b79bb358
Show custom tokens in Swaps, add a custom token in Swaps (#11200)
* Show custom tokens in Swaps

* Add messages for adding a custom token in Swaps

* Add the first version of importing custom tokens in swaps

* Fix lint rules

* Create a new component: ImportToken

* Remove a pointer cursor from regular heading

* Fix a CSS issue for tokens with long names

* Update a comment

* Don’t return a custom token if it doesn’t have symbol or decimals

* Only search by contract address if nothing was found

* Track “Token Imported” event

* Fix unit tests

* Import tracking for “Token Imported”, increase token icon font size

* Disable token import for Source Token

* Update logic and content for notifications, update tests

* Do not hide a dropdown placeholder on click, so a user can click on a link

* Update a key name

* Update styling for the “danger” type notification in Swaps

* Show either a warning or danger notification based on token verification occurences

* Remove testnets from SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP

* Use the “shouldSearchForImports” prop

* Create a new function for handling token import: “onOpenImportTokenModalClick”

* Filter token duplicities before iterating over tokens

* Use “address” instead of “symbol” for checking uniqueness

* Trigger Build

* Use a new API (/token) to get token data for importing in Swaps

* Temporarily decrese Jest threshold for functions
2021-06-03 13:38:37 -02:30
Shane T
c65ccf60e5
Fix proptype validation in TransactionIcon component (#11198) 2021-05-31 21:49:23 -02:30
ryanml
ee4df61e91
Fixing ever-present scrollbar issue on Swaps view (#11182)
* Fixing ever-present scrollbar issue on Swaps view

* Updating max-height
2021-05-27 10:27:18 -07:00
ryanml
629da90d72
Adding "What's New" notification for Ledger Support Update (#11188)
* Adding "What's New" notification for Ledger Support Update

* Using Typography component
2021-05-26 14:29:19 -07:00
ryanml
3242710f3d
Supporting existing default networks in switchEthereumChain (#11184) 2021-05-26 09:17:18 -07:00
ryanml
8e3bffc825
Fixing lint warning in confirm-approve.stories.js (#11185) 2021-05-26 09:17:08 -07:00
Etienne Dusseault
4c341d83ab
Add Approval Confirmation Screen component to Storybook (#10998)
* add metametrics wrapper

* add history dep

* provide test data and mock react router

* add first confirmaion screen

* figure out a way to mock match.params

* render token approval with data

* fix lockfile

* fix lint

* remove use effect

* lintfix

* add . for src paths

* litfix

* Add knobs to change redux store for confirm-approve component (Storybook) (#11135)

* add knob for domain

* knobify

* remove logs

* remove comment

* lintfix

* fix comments

* add background calls + metriccs event to storybook acctions

* lintfixxxx
2021-05-25 08:20:09 +08:00
David Walsh
3055db5c33
Disable Ledger Live toggle for Firefox users (#11169) 2021-05-24 16:11:17 -05:00
Brad Decker
9d943dc4c6
implement safer to buffer (#11159) 2021-05-21 15:07:06 -05:00
Daniel
1a9206018a
Improve UI + content for price difference notifications (#11145) 2021-05-21 12:02:23 -05:00
Daniel
df6cb42594
Swaps: Create a new swap (#11124) 2021-05-21 10:14:56 -05:00
Dan J Miller
395195ac3c
Capture exception instead of throw error in useTransactionDisplayData (#11153) 2021-05-21 09:31:45 -02:30
ryanml
6640973858
Fixing jest component test output errors (#11139)
* Adding missing required props to component tests

* Removing unused IntroPopup component

* Mocking useLayoutEffect as useEffect in confirm-page-container-header.component.test.js
2021-05-20 11:28:25 -07:00
Niranjana Binoy
2972e78444
Avoid showing "Gas price extremely low" warning in advanced tab for testnets (#11111) 2021-05-20 11:32:55 -04:00
Mark Stacey
5009ceae53
Migrate to new CurrencyRateController (#11005)
The CurrencyRateController has been migrated to the BaseControllerV2
API, which includes various API changes. These changes include:
* The constructor now expects to be passed a
`RestrictedControllerMessenger`.
* State changes are subscribed to via the `ControllerMessenger` now,
rather than via a `subscribe` function.
* The state and configration are passed in as one "options" object,
rather than as two separate parameters
* The polling needs to be started explicitly by calling `start`. It
can be stopped and started on-demand now as well.
* Changing the current currency or native currency will now throw an
error if we fail to update the conversion rate.

The `ComposableObservableStore` has been updated to accomodate these
new types of controllers. The constructor has been updated to use an
options bag pattern as well, to make the addition of the new required
`controllerMessenger` parameter a bit less unweildly.
2021-05-20 00:27:51 -02:30
Alex Donesky
f19207ca87
use etherscan-link customBlockExplorer methods with customNetwork usage tracking (#11017)
* use etherscan-link customBlockExplorer methods with customNetwork usage tracking

* consolidate blockexplorer events, add domain to metametrics event

* lint fix
2021-05-19 09:51:47 -05:00
ryanml
b7a1c8c302
Adding notification for updated seed phrase wording (#11131)
* Adding notification for updated seed phrase wording

* Updating e2e notification state

* Always displaying image for swaps notification
2021-05-18 15:00:34 -07:00
Daniel
f9a52edb98
Fix a condition for checking if a token should be added (#11127) 2021-05-18 13:16:17 -05:00
Niranjana Binoy
0e1181862f
Handling custom token decimal fetch failure due to network error (#10956) 2021-05-18 13:23:54 -04:00
Niranjana Binoy
9d78c8b873
Hide basic tab in advanced gas modal for speedup and cancel when on testnets (#11115) 2021-05-18 12:36:05 -04:00
Brad Decker
d9a2165f69
use safer toChecksum utility (#11117) 2021-05-17 16:19:39 -05:00
Brad Decker
9386e3cb03
create safer isValidAddress method (#11089) 2021-05-17 14:00:59 -05:00
Dan J Miller
2e11458d29
Improve type checking and handle incorrect category in transaction-icon component (#11101)
* Improve type checking and handle incorrect category in transaction-icon component

* Capture exception for sentry when transaction icon is passed an unrequired category

* Rename ui/components/app/transaction-icon/index.scss -> ui/components/app/transaction-icon/transaction-icon.scss
2021-05-17 12:01:00 -02:30
ryanml
30abcd0fe0
Fixing unlocalized strings (#11102)
* Fixing unlocalized strings

Fixes MetaMask/metamask-extension#11094

* Removing aggregrate bullet from modal

* Updating bullet point keys
2021-05-14 17:29:26 -07:00
Dan J Miller
4689546eb3
Throw error if transaction type is not recognized by useTransactionDisplay data (#11104) 2021-05-14 18:33:14 -02:30
ryanml
9236d3132a
Fixing account search results ordering (#11097)
Removing 'shouldSort: false' from fuse.js' options config

Fixes MetaMask/metamask-extension#10991
2021-05-14 11:38:56 -07:00
Daniel
7acb33c976
Show a notification about BSC Swaps if a user is on the BSC Mainnet (#11083)
* Add a notification for BSC Swaps

* Add a new logo for BSC sources, update an image for BSC notification

* Mark a BSC notification as seen when a user clicks on “Start swapping”

* Add conditional rendering of notifications

* Remove divider for the last notification

* Remove a divider for the last notification

* Remove !

* Trigger pipeline
2021-05-14 14:47:56 -02:30
Daniel
85eb62e8cf
Swaps: Add specific error content if Contract data are not enabled on Ledger (#11088) 2021-05-13 14:49:00 -05:00
Daniel
a174e3b99a
Swaps: Add more anonymized tracking for HW wallet and HW wallet type (#11087) 2021-05-13 14:26:08 -05:00
Thomas Huang
e920fe15c3
Add isHex check for addresses supplied to icons (#11071) 2021-05-12 15:25:37 -07:00
Daniel
a34f579484
Swaps: Add anonymized tracking for HW wallet and HW wallet type (#11063) 2021-05-12 10:17:17 -05:00
Dan J Miller
d62329fd0a
Use isValidAddress helper instead of ethereumJsUtil.isValidAddress, when appropriate (#11049) 2021-05-11 16:53:50 -02:30
Dan J Miller
1998af4d41
Use UrlIcon instead of Identicon on approve screen (#11048)
* Use UrlIcon instead of Identicon on approve screen

* Update ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js

Co-authored-by: Thomas Huang <tmashuang@users.noreply.github.com>

Co-authored-by: Thomas Huang <tmashuang@users.noreply.github.com>
2021-05-11 16:25:21 -02:30
David Walsh
77f0ff8e83
Group signature transactions (#11016) 2021-05-11 12:57:06 -05:00
Daniel
b4872b5fe2
Fix redirection to the build quotes page from the swaps failed page (#11025) 2021-05-10 14:48:37 -02:30
David Walsh
cc9c096e61
Prevent an undefined gas price from breaking the transaction list (#11015) 2021-05-07 16:38:36 -05:00
David Walsh
bf76d4e754
Prevent signature request component from canceling hardware wallet signing (#11013) 2021-05-07 15:54:20 -05:00
ryanml
f3cc048fea
Removing unused prop from TransactionActivityLog (#11014) 2021-05-07 13:21:03 -07:00
Mark Stacey
14dc6b58cc
Remove SET_CURRENT_FIAT action (#11003)
The `SET_CURRENT_FIAT` action has been removed. It has been replaced
by a call to `forceUpdateMetamaskState`. The only purpose of this
action was to eagerly update the current fiat currency settings before
the next state update. Forcing a state update instead is simpler and
safer.

The `setCurrentCurrency` function in the background has been updated to
no longer return the state, now that it's no longer needed.
2021-05-07 11:32:22 -02:30
Niranjana Binoy
580baff97e
adding condition to check for non-mainnet network and test env (#11007) 2021-05-07 09:08:24 -04:00
Niranjana Binoy
2b1e4fb013
replacing seed phrase with Secret Recovery Phrase (#10994) 2021-05-07 09:07:43 -04:00
Daniel
002763222b
Swaps: Improve hardware wallet UX (#10987) 2021-05-06 09:14:42 -05:00
ryanml
10e91e975a
Re-validating chain id when rpc url changes [custom network form] (#10982) 2021-05-06 12:03:51 +08:00
ryanml
687d0486b1
Allowing for scroll overflow when swaps content is too tall (#10988)
Fixes MetaMask/metamask-extension#10957
2021-05-05 15:46:16 -07:00
Daniel
d7754f39bd
Allow 0% slippage, show a warning for 0 < slippage <= 1, disable "Review Swap" button for negative slippage (#10936)
* Allow 0% slippage, show a warning for 0 < slippage <= 1, disable “Review Swap” button for negative slippage

* Update a translation key, use both new and old key until it’s translated everywhere

* Keep an old key for `en`: swapSlippageTooLow

* Fix an ESLint issue

* Only use swapSlippageNegative, remove swapSlippageTooLow
2021-05-05 14:47:38 -02:30
Alex Donesky
96fe563579
add setting to dismiss seed phrase backup reminder (#10967) 2021-05-05 08:58:29 -05:00
ryanml
9e8141eb0e
Fixing alignment issue with bottom notification (#10979) 2021-05-03 15:10:45 -07:00
Alex Donesky
ac7b05442a
send user to activity after transaction complete (#10946) 2021-05-03 12:51:09 -05:00
Dan J Miller
a082a2ca75
Whats new popup design fixes (#10964)
* Remove padding on QR code image

* Allow the qr code to be below the description in the whats new popup

* Fix size and position of QR code in whats new notification

* Add right caret to action links in whats new popup

* Clean up placeImageBelowDescription logic

* Fix display of whats-new-popup image

* Improve spacing and sizing of whats new popup in both full screen and popup view

* refactor
2021-05-03 15:09:26 -02:30
ryanml
d12349046f
Removing gray background from contact address input (#10971) 2021-05-03 09:50:50 -07:00
David Walsh
bc24d9e696
Ensure method of adding contact when contacts exist (#10963) 2021-04-30 20:15:19 -05:00
Daniel
d6d924b2b5
Add backwards compatibility for ETH <-> WETH contract address validation (#10962) 2021-04-30 13:48:56 -05:00
David Walsh
04ab1e72cc
Fix #10173 - Prevent lag in external monitors when using Mac + Chrome (#10952) 2021-04-30 10:28:07 -05:00
David Walsh
6265799634
Anchor the Need Help text to the bottom of the expanded page (#10955) 2021-04-29 12:43:33 -05:00
Brad Decker
09d81ac5f2
remove the ui/app and ui/lib folders (#10911) 2021-04-28 14:53:59 -05:00
Niranjana Binoy
f1fc51667a
Handling gas price fetch failure (#10767) 2021-04-28 14:02:01 -04:00
Dan J Miller
b73f543b23
Whats new popup (#10583)
* Add 'What's New' notification popup

* Move selectors from shared/notifications into ui/ directory

* Use keys for localized message in whats new notifications objects, to ensure notifications will be translated.

* Remove unused swaps intro popup locale messages

* Fix keys of whats new notification locales

* Remove notifications messages and descriptions from comment in shared/notifications

* Move notifcationActionFunctions to shared/notifications and make it stateless

* Get notification data from constants instead of state in whats-new-popup

* Code cleanup

* Fix build quote reference to swapsEthToken, broken during rebase

* Rename notificationFilters to notificationToExclude to clarify its purpose

* Documentation for getSortedNotificationsToShow

* Move notification action functions from shared/ to whats-new-popup.js

* Stop setting swapsWelcomeMessageHasBeenShown to state in app-state controller

* Update e2e tests for whats new popup changes

* Updating migration files

* Addressing feedback part 1

* Addressing feedback part 2

* Remove unnecessary div in whats-new-popup

* Change getNotificationsToExclude to getNotificationsToInclude for use in the getSortedNotificationsToShow selector

* Delete intro-popup directory and test files

* Lint fix

* Add notifiction state to address-entry fixture

* Use two separate functions for rendering first and subsequent notifications in the whats-new-popup

* Ensure that string literals are passed to t for whats new popup text

* Update import-ui fixtures to include notificaiton controller state

* Remove unnecessary, accidental change confirm-approve

* Remove swaps notification in favour of mobile swaps as first notifcation and TBD 3rd notification

* Update whats-new-popup to use intersection observer api to detect if notification has been seen

* Add notifications to send-edit and threebox e2e test fixtures

* Update ui/app/selectors/selectors.js

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

* Update ui/app/selectors/selectors.js

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

* Clean up locale code for whats-new-popup notifications

* Disconnect observers in whats-new-popup when their callback is first called

* Add test case for migration 58 for when the AppStateController does not exist

* Rename popover components containerRef to popoverWrapRef

* Fix messages.json

* Update notification messages and images

* Rename popoverWrapRef -> popoverRef in whats-new-popup and popover.component

* Only create one observer, and only after images have loaded, in whats-new-popup

* Set width and height on whats-new-popup image, instead of setting state on img load

* Update ui/app/components/app/whats-new-popup/whats-new-popup.js

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

* Code clean up in whats new popup re: notification rendering and action functions

* Code cleanup in render notification functions of whats-new-popup

* Update ui/app/components/app/whats-new-popup/whats-new-popup.js

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

* lint fix

* Update and localize  notification dates

* Clean up date code in shred/notifications/index.js

Co-authored-by: ryanml <ryanlanese@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-28 14:21:41 -02:30
Alex Donesky
b6d8291dfc
use token custom icons where possible (#10939) 2021-04-28 00:07:43 -05:00
Alex Donesky
13a0389c96
add hamburger menu to eth page (#10938)
* add hamburger menu to eth page

* change token-options to asset-options, use more direct selector for user address fetch
2021-04-27 17:48:46 -05:00
Daniel
37159a58e1
Increase Jest unit test coverage for the Swaps feature to ~43% (#10934) 2021-04-27 15:16:17 -05:00
Austin Akers
539a2b65f3
[Fix] 10365 My Accounts Removal (#10680)
* pushing my-accounts removal

* removed CONTACT_MY_ACCOUNTS_ROUTE

* removed CONTACT_MY_ACCOUNTS_VIEW_ROUTE

* removing CONTACT_MY_ACCOUNTS_EDIT_ROUTE

* removing CONTACT_MY_ACCOUNTS_EDIT_ROUTE

* removed showingMyAccounts dead code

* removed more dead code related to isMyAccountsPage

* removing more dead code

* fixed linting error(s)

* removing my-accounts component/folder

* added empty contact screen ui

* styled empty contact page ui

* fixed linting, removed add contacts button, and fixed errors

* localized text and centered No Contacts

* pushing localized verification and fixed e2e test

* added listRoute redirect

* added listroute and fixed linting error
2021-04-27 15:55:58 -02:30
David Walsh
bdae6887f7
Fix 10609 - Prevent overflow of confirmation page hostname (#10935) 2021-04-27 08:46:20 -05:00
Alex Donesky
5bde528cbd
add view account-details menu item to token-options menu (#10932)
* add view account-details menu item to token-options menu

* add onViewAccountDetails propType
2021-04-26 17:07:33 -05:00
David Walsh
15b596ad15
Implement Ledger Live bridge (#10293) 2021-04-26 13:05:48 -05:00
ryanml
f080c10cbc
Fixing ENS input entry in send flow (#10923)
* Fixing ENS input entry in send flow

Fixes MetaMask/metamask-extension#10691

* removed unnecessary apostrophe
2021-04-26 07:31:20 -07:00
Daniel
9fa6fc9d05
Add contract address validation for token swaps (#10912) 2021-04-23 09:53:10 -05:00
David Walsh
75f8f0fb35
Fix 10458 - Understand where to get support (#10895) 2021-04-22 17:31:13 -05:00
Daniel
fbbdaf04ed
Increase Jest unit test coverage for the Swaps feature to ~25% (#10900)
* Swaps: Show a network name dynamically in a tooltip

* Replace “Ethereum” with “$1”, change “Test” to “Testnet”

* Replace 이더리움 with $1

* Translate network names, use ‘Ethereum’ by default if a translation is not available yet

* Reorder messages to resolve ESLint issues

* Add a snapshot test for the FeeCard component, increase Jest threshold

* Enable snapshot testing into external .snap files in ESLint

* Add the “networkNameEthereum” key in ko/messages.json, remove default “Ethereum” value

* Throw an error if chain ID is not supported by the Swaps feature

* Use string literals when calling the `t` fn,

* Watch Jest tests silently (no React warnings in terminal, only errors)

* Add @testing-library/jest-dom, import it before running Jest tests

* Add snapshot testing of Swaps’ React components for happy paths, increase minimum threshold for Jest

* Add the test/jest folder for Jest setup and shared functions, use it in Swaps Jest tests

* Fix ESLint issues, update linting config

* Enable ESLint for .snap files (Jest snapshots), throw an error if a snapshot is bigger than 50 lines

* Don’t run lint:fix for .snap files

* Move `createProps` outside of `describe` blocks, move store creation inside tests

* Use translations instead of keys, update a rendering function to load translations

* Make sure all Jest snapshots are shorter than 50 lines (default limit)

* Add / update props for Swaps tests

* Fix React warnings when running tests for Swaps
2021-04-21 12:34:35 -07:00
Niranjana Binoy
18aa540f42
Adding option to set Custom Nonce to Confirm Approve Page (#10595) 2021-04-16 18:00:18 -04:00
Daniel
1b4bc46c7b
Swaps: Show a network name dynamically in a tooltip (#10882)
* Swaps: Show a network name dynamically in a tooltip

* Replace “Ethereum” with “$1”, change “Test” to “Testnet”

* Replace 이더리움 with $1

* Translate network names, use ‘Ethereum’ by default if a translation is not available yet

* Reorder messages to resolve ESLint issues

* Add a snapshot test for the FeeCard component, increase Jest threshold

* Enable snapshot testing into external .snap files in ESLint

* Add the “networkNameEthereum” key in ko/messages.json, remove default “Ethereum” value

* Throw an error if chain ID is not supported by the Swaps feature

* Use string literals when calling the `t` fn,
2021-04-16 19:22:32 -02:30
Brad Decker
d1f8171877
upgrade ethereumjs util (#10886) 2021-04-16 10:05:13 -05:00
Thomas Huang
b99c4fb5cf
Use jest to run ui/**/*.test.js (#10885) 2021-04-15 11:01:46 -07:00
ryanml
2f8908804a
Handling infura blockage (#10883)
* Handling infura blockage

* Adding blockage home notification

* Updating copy, adding temporary notification dismissal

* Addressing review feedback

* Using eth_blockNumber method to check Infura availability

* Handling network changes in availability check
2021-04-15 10:41:40 -07:00
Daniel
e7d7d24d83
Reduce calls of the /featureFlag API (#10859)
* Remove periodic calls to the /featureFlag API

* Always show the Swap button on the main page

* Check if the Swaps feature is enabled, show loading animation while waiting

* Reuse an existing useEffect call

* Use ‘isFeatureFlagLoaded’ in React’s state, resolve lint issues

* Add a watch mode for Jest testing

* Add unit tests for Swaps: fetchSwapsLiveness, add /ducks/swaps into Jest testing

* Remove Swaps Jest tests from Mocha’s ESLint rules

* Ignore Swaps Jest tests while running Mocha, update paths

* Increase test coverage to the current max

* Fix ESLint issues for Swaps

* Enable the Swaps feature by default and after state reset, remove loading screen before seeing Swaps

* Update Jest config, fix tests

* Update Jest coverage threshold to the current maximum

* Update ESLint rule in jest.config.js

* Disable the “Review Swap” button if the feature flag hasn’t loaded yet

* Update jest threshold
2021-04-14 04:46:27 -02:30
ryanml
9e918b6026
Adding recovery phrase video to onboarding process (#10717)
* Adding recovery phrase video to onboarding process

Adding english subtitles

* Support textAlign in Box, converting sidebar to Box
2021-04-13 15:29:44 -07:00
Daniel
a07780ab61
Change caching for Swaps APIs from 1 hour to 5 minutes (#10871)
* Change caching for the /tokens API from 1 hour to 5 minutes

* Use 5 minutes caching for /topAssets and /aggregatorMetadata APIs as well
2021-04-09 22:29:52 -02:30
Thomas Huang
253efc6f8c
Jest config (#10855)
* Setup jest config

* Adjust test for jest.

* Adjust lint config

* Omit swaps ui folder for unit testing

* Omit swaps from test:unit:lax

* Add jest.config.js to script files

* Restore mocks rather than clearing them.

* Update jest config and adjust lint to include subdirs

* Convert view-quote-price-difference test to jest

* Add jest ci and ci coverage scripts. Add jest unit test to general test command

* Add test coverage to ci

* Use --ignore flag

* Fixup

* Add @metamask/eslint-config-jest

* Update .eslintrc.js

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

* Adds jest-coverage/

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-04-09 10:20:32 -07:00
Erik Marks
e18deda0da
@metamask/eslint-config*@6.0.0 (#10858)
* @metamask/eslint-config*@6.0.0

* Minor eslintrc reorg
2021-04-08 14:34:55 -07:00
Daniel
a814f8ee75
Increase default slippage from 2% to 3%, show Advanced Options by default (#10842)
* Increase default slippage from 2% to 3%, show Advanced Options by default

* Disable opening / closing of Advanced Options on the Swap page

* Pre-select previously used slippage value when going back to the Swap page

* Fix lint issues

* Use a callback for setting up an initial customValue
2021-04-08 16:28:19 -02:30
Daniel
135f0bb4f0
Add validation for the fee property from the /trades API response (#10836) 2021-04-06 21:49:55 -02:30
David Walsh
b2f6aa9f65
Ensure correct primary currency image is displayed on home screen and token list (#10777) 2021-04-01 17:57:00 -05:00
Brad Decker
1e44c34e1e
upgrade eslint deps (#10789) 2021-04-01 13:44:42 -05:00
Muhammet Kara
ff8dd5f6d2
Remove useless negation (#10787)
!contentComponent always evaluates to true
2021-03-31 17:16:29 -02:30
Dan J Miller
f7a328a9d9
Ensure that priceSlippage fiat amounts are always shown in view-quote.js (#10762) 2021-03-30 12:55:29 -02:30
Dan J Miller
be0b8a11d8
Ensure that the approval fee in the swaps custom gas modal is in network specific currency (#10763) 2021-03-30 12:53:41 -02:30
Brad Decker
4080ed63a4
Refactor Tx State Manager (#10672)
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-03-30 09:54:05 -05:00
David Walsh
29cc31afe8
Fix 10517 - Prevent tokens without addresses from being added to token list (#10593) 2021-03-29 16:05:36 -05:00
Dan J Miller
76f4e93eb2
Ensure that the correct default currency symbols are used for fees on the view quote screen (#10753) 2021-03-29 17:00:06 -02:30
Michael Standen
8b3d96bc84
Add New Zealand Dollar to currency options (#10746) 2021-03-29 12:10:12 -05:00
Dan J Miller
d8fd4b8271
Use correct block explorer name and link in swaps when on custom network (#10743)
* Use correct block explorer name and link in swaps when on custom network.

* Fix up custom etherscan link code in build-quote.js

* Use blockExplorerUrl hostname instead of 'blockExplorerBaseUrl'

* Use correct etherscan-link method for token links in build-quote

* Create correct token link in build-quote for mainnet AND custom networks

* Block explorer url improvements in awaiting-swap.js and build-quote.js

* Use swapVerifyTokenExplanation message with substitutable block explorer for all applicable locales

* Ensure that block explorer links are not shown in awaiting-swap if no url is available
2021-03-29 10:24:27 -02:30
Dan J Miller
cc19d250e8
Ensure swaps gas prices are fetched from the correct chain specific endpoint (#10744)
* Ensure swaps gas prices are fetched from the correct chain specific endpoint

* Just rely on fetchWithCache to cache swaps gas prices, instead of directly using storage in getSwapsPriceEstimatesLastRetrieved

* Empty commit
2021-03-28 10:48:44 -02:30
David Walsh
d4842b089e
Fix 10562 - Hide the suggested token pane when not on Mainnet or test network (#10702) 2021-03-25 14:25:22 -05:00
David Walsh
c14919c60f
Fix 10706 - Prevent autocomplete from add token input (#10700) 2021-03-24 19:24:51 -05:00
Shane
0fdc8a42ce
fix: remove unused metamask.rpcUrl from redux state + fix tests to reflect that (#10714) 2021-03-24 15:54:24 -07:00
Brad Decker
a16841f6bb
rule out empty string for symbol (#10712) 2021-03-24 17:04:15 -05:00
ryanml
1cfa58287c
Removing hard references to 12 word seed phrases in copy (#10704)
Adding translation entry for "Wallet Seed"

Fixed label padding issue by adding missing CSS rule
2021-03-24 10:55:03 -07:00
Mark Stacey
5bed62b1b3
Add MetaMask to list of BIP44 HD path examples (#10703)
The "BIP44 Standard" HD path option in the Ledger connect flow listed
only Trezor as an example. It seemed appropriate to include MetaMask as
well, since we use the same path. This helps users who have imported
their MetaMask seed phrase onto a Ledger device to discover this
option.
2021-03-24 12:45:28 -02:30
Brad Decker
255586aea1
resolve issue with missing template error (#10692)
* resolve issue with missing template error

* also apply filtering to confirmation page

* rename variable
2021-03-23 16:12:32 -05:00
ryanml
fc8ffc134d
Adding default properties to NetworkForm (#10682)
Fixes MetaMask/metamask-extension#10681
2021-03-22 09:57:34 -07:00
gitpurva
fc999f948b
Change 'Send ETH' title to 'Send' (#10651) 2021-03-19 14:42:11 -02:30
ryanml
6cfdac529f
Don't render faucet row in deposit modal for custom chains (#10674)
Fixes MetaMask/metamask-extension#10038
2021-03-19 08:48:41 -07:00
Shane
b50fe3184a
fix: replace dnode background with JSON-RPC (#10627)
fixes #10090
2021-03-18 11:23:46 -07:00
Dan J Miller
480512d14f
Swaps support for local testnet (#10658)
* Swaps support for local testnet

* Create util method for comparison of token addresses/symbols to default swaps token

* Get chainId from txMeta in _trackSwapsMetrics of transaction controller

* Add comment to document purpose of getTransactionGroupRecipientAddressFilter

* Use isSwapsDefaultTokenSymbol in place of repeated defaultTokenSymbol comparisons in build-quote.js
2021-03-18 07:50:06 -02:30
Brad Decker
5a233e4634
colocate tests in flat structure (#10655) 2021-03-16 16:00:08 -05:00
David Walsh
da90674f59
Allow TextField to receive min and max attributes (#10656) 2021-03-16 11:24:56 -05:00
David Walsh
b8900140ec
Prevent network menu highlighting (#10643) 2021-03-15 17:34:15 -05:00
Dan J Miller
60514c12b0
Fix: ETH 'token' now only appears once in the swaps to and from dropdowns. (#10650) 2021-03-15 14:21:43 -02:30
David Walsh
3e6b2e7f0a
Ensure swaps detail height doesn't create jump in vertical height (#10644) 2021-03-15 11:30:01 -05:00
David Walsh
9ae82046f0
Position the 3dot menu in the same spot on asset screen and home screen (#10642) 2021-03-15 09:56:26 -05:00
Dan J Miller
153bbc6053
Move swaps constants to the shared constants directory (#10614) 2021-03-15 10:51:35 -02:30
Brad Decker
3d4dfc74a8
prefer chainId over networkId in most cases (#10594) 2021-03-12 16:23:26 -06:00
Shane
b21cc5660f
fix: speedup cancellation (#10579)
fixes #7305
2021-03-12 11:26:07 -08:00
David Walsh
90bfaf6ac2
Hide zero balance tokens at useTokenTracker layer (#10630) 2021-03-11 12:07:41 -06:00
ryanml
7aaf1c4eb3
Removing double click bug from delete custom network modal (#10628)
Fixes MetaMask/metamask-extension#10626
2021-03-10 16:43:34 -07:00
Brad Decker
2ed5bafa11
remove transactionCategory in favor of more types (#10615)
* remove transactionCategory in favor of more types

* remove reference to STANDARD in stubs
2021-03-10 14:16:44 -06:00
Dan J Miller
9339278d3c
Replace logic for eth swap token in fetchQuotesAndSetQuoteState with getSwapsEthToken call (#10624) 2021-03-10 16:13:18 -03:30
Mark Stacey
669ab187a1
add trezor HD path for ledger wallets (#10616)
Co-authored-by: Barry Gitarts <bgitarts@gmail.com>
2021-03-10 14:56:48 -03:30
Brad Decker
aa37e30c08
use etherscan-link for account-link (#10590) 2021-03-10 11:21:52 -06:00
Brad Decker
38fe75b7d9
prefer chainId when building block explorer urls (#10587) 2021-03-09 15:37:19 -06:00
David Walsh
92680cf56f
Add support for multiple Ledger & Trezor hardware accounts (#10505) 2021-03-09 14:39:16 -06:00
David Walsh
444d8dd51a
Fix #10081 - Use fetchWithCache to retrieve and store basic gas estimates (#10384) 2021-03-09 13:49:27 -06:00
David Walsh
aeffe176b3
Hide zero balance tokens with preference (#10486) 2021-03-09 13:35:55 -06:00
ryanml
083a795a30
Converting ListItem container from button to div (#10611)
Fixes MetaMask/metamask-extension#10610
2021-03-09 10:53:24 -07:00
Dan J Miller
21868e08e6
Move the METASWAP_API_HOST constant to the swaps constant file (#10612) 2021-03-09 12:36:44 -03:30
Dan J Miller
c86ceacfd9
Standard reference to ETH_SWAPS_TOKEN_ADDRESS via ETH_SWAPS_TOKEN_OBJECT.address (#10613) 2021-03-09 12:29:35 -03:30
Niranjana Binoy
85181aaff4
adding condition check to verify token data is loaded before rendering approve screen (#10606) 2021-03-08 16:50:37 -05:00
ryanml
d68466f0b8
Fixing activity title text truncation (#10601)
Fixes MetaMask/metamask-extension#9997
2021-03-08 11:12:52 -07:00
ryanml
45c076e232
Adding warnings for excessive custom gas input (#10582)
Fixes MetaMask/metamask-extension#9811
2021-03-05 10:32:09 -07:00
Brad Decker
3840a58e82
use metamask/etherscan-link (#10580) 2021-03-04 12:16:33 -06:00
Dan J Miller
b441dcec6a
Convert useSwapsEthToken hook to a selector (#10568)
* Convert useSwapsEthToken hook to a selector

* Code cleanup
2021-03-04 13:46:01 -03:30
ryanml
a8b1653566
Updating references to MetaMask support (#10563)
* Updating references to support email

Fixes MetaMask/metamask-extension#10188

* Removing UniqueImage component

* Removing unused UniqueImage locales
2021-03-03 10:15:24 -07:00
Dan J Miller
325215fb5f
Remove dead code related to the selectedFromToken variable in swaps/index.js (#10570) 2021-03-03 12:16:19 -03:30
ryanml
3c6cdef074
Adding a warning when sending a token to its own contract address (#10546)
Fixes MetaMask/metamask-extension#9437
2021-03-02 17:28:12 -07:00
Brad Decker
eef92d0d5a
handle undefined network (#10560) 2021-03-02 18:20:37 -06:00
Brad Decker
e42658b590
cache balances by chain id (#10545) 2021-03-02 16:53:07 -06:00
Shane
d44c4d3747
Fix/handle safe low undefined (#10561)
* fix: handle safeLow undefined

fixes #10558

* fix: add tests for isCustomGasPriceSafe selector
2021-03-02 14:19:56 -08:00
Mark Stacey
1ed75b45f7
Remove unused hasHexData prop (#10529)
This prop was never passed in, nor can I see any reason for it to exist
in the first place.
2021-03-02 12:13:53 -03:30
Dan J Miller
46ecf70741
Update swaps failure copy to help users get support (#10525) 2021-03-01 13:02:02 -03:30
Brad Decker
7532e7ce3f
fix links in add ethereum chain (#10536) 2021-03-01 09:36:39 -06:00
David Walsh
8013e85c20
Accommodate for 0 sources verifying swap token (#10521) 2021-03-01 09:20:38 -06:00
Brad Decker
616b71271a
add chainId to all new transaction metadata (#10528) 2021-03-01 09:15:42 -06:00
Mark Stacey
0f7e2dbf20
Show warnings on Add Recipient page of Send flow (#10530)
Warnings were not shown on the Add Recipient page of the send flow. Now
any send warnings will be shown. This can be tested using an ENS name
with a confusable character in it (the confusable character warning
will be shown).

A condition was also removed that prevented any warnings or errors from
rendering when the user had non-zero contacts or recent addresses. I
have no idea why you'd want to hide warnings or errors if the user had
no contacts or recent addresses. None of these errors even pertain to
contacts or recent addresses.
2021-03-01 09:47:22 -03:30
ty
b04120dd0f
Warn users when an ENS name contains 'confusable' characters (#9187)
* Add warning system for 'confusable' ENS names (#9129)

Uses unicode.org's TR39 confusables.txt to display a warning when
'confusable' unicode points are detected.

Currently only the `AddRecipient` component has been updated, but the new
`Confusable` component could be used elsewhere

The new `unicode-confusables` dependency adds close to 100KB to the
bundle size, and around 30KB when gzipped.

Adds 'tag' prop to the tooltop-v2 component

Use $Red-500 for confusable ens warning

Lint Tooltip component

Update copy for confusing ENS domain warning.

* Fix prop type

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-02-27 01:56:04 -03:30
Austin Akers
dedadee346
[Fixed] #7921 Message text overflow removed redundant title (#10485)
* fixed message text overflow

* reverted and removed mesage title inside message--root

* fixed margin problem in sign message

* removed dead css

* fixed large left padding on data signing
2021-02-26 09:29:03 -03:30
Brad Decker
1a2dc850a3
addEthereumChain bug fixes (#10520) 2021-02-25 16:25:51 -06:00
Brad Decker
15d78b8158
use chain id for enabling ENS IPFS resolution (#10507) 2021-02-25 05:40:57 -06:00
Mark Stacey
2b022cd759
Remove unused AppHeader props (#10506)
These two props were being passed into the AppHeader component by the
AppHeader container despite them being unused.
2021-02-23 15:41:40 -03:30
Dan J Miller
e7a0ca134b
Replace use of 'destinationAmountInEth' property with 'destinationAmountInETH' (#10500) 2021-02-23 13:22:04 -03:30
Dan J Miller
9c4af85664
Ensure that swap approve tx and swap tx always have the same gas price (#10501) 2021-02-23 13:21:43 -03:30
Dan J Miller
75a81c605a
Eliminate artificial delay in swaps loading screen after request loading is complete (#10496) 2021-02-23 13:21:19 -03:30