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

646 Commits

Author SHA1 Message Date
ivigamberdiev
869124c4c9
Fix network settings Kovan block explorer link (#10117) 2020-12-25 10:51:47 -08:00
David Walsh
d4d3d6a52a
Remove unnecessary swaps footer space when in dropdown mode (#10100) 2020-12-18 09:58:42 -06:00
David Walsh
88525ec392
Fetch swap quote refresh time from API (#10069) 2020-12-15 16:54:22 -03:30
David Walsh
1b19f5e7ad
Fix 9874 - Improve gas maximum estimation (#10043) 2020-12-15 11:16:51 -06:00
Brad Decker
3cabe7525f
fix metametrics option tracking (#10071) 2020-12-14 15:54:33 -06:00
David Walsh
9a1548368f
Use Boolean for filters (#10066) 2020-12-14 11:03:59 -06:00
David Walsh
b16737454e
Prevent metaMaskFee prop error in FeeCard (#10047) 2020-12-11 12:03:51 -06:00
Erik Marks
54e9c53b27
Add web3 shim usage notification (#10039)
* Add web3 shim usage alert background state and logic
* Cleanup alert background state, constants
* Implement web3 shim usage notification and settings
* nodeify alert controller background hooks
* Remove svg icon, again
* Tweak alert controller initialization
* Add support article URL
* Un-thunk alert UI "actions"
* Delete connect.svg file (unused)
2020-12-10 15:40:29 -08:00
David Walsh
07c5527b1e
Use consistent font size for modal top right Close links (#10000) 2020-12-10 12:02:57 -06:00
Mark Stacey
4350a1422e
Fix token validation in Send flow (#10045)
Additional validation was added in #9907 to ensure that the "Known
contract address" warning was shown when sending tokens to another
token address after switching assets on the Send screen. Unfortunately
this change had the unintended side-effect of preventing _all_ token
sends after switching assets, so long as the recipient was not an
internal address.

The problem is that the `validate` function expects to be passed the
address of the token send recipient in the case where a token is
selected. Instead the token address was being passed to the validate
function.

The `query` state is now used, which should always contain the
recipient address. This is the same state used in the only other place
the `validate` function is called.
2020-12-10 14:28:19 -03:30
Mark Stacey
6304ce15a2
Fix TokenList component name (#10030)
The TokenList component on the `add-token` page had the name `InfoBox`,
which doesn't seem applicable. It has been renamed to `TokenList`, to
match the module filename and the component name we use elsewhere.
2020-12-09 17:02:38 -03:30
Dan J Miller
da5e5cd8b6
Reapply view quote screen designs (#9905) 2020-12-08 10:47:53 -06:00
David Walsh
33b15b5c6f
Prevent props error in swaps gas modal (#10001) 2020-12-07 09:58:06 -06:00
David Walsh
56f80ae9a9
Fix 9988 - Don't allow more than 15% slippage (#9991) 2020-12-07 09:12:55 -06:00
David Walsh
42fd8b0ff0
Use strict equality in unit tests (#9966) 2020-12-03 09:46:22 -06:00
Dan J Miller
97d268c8ee
Remove use of ethgasstation; use metaswap /gasPrices api for gas price estimates (#9867)
* Remove use of ethgassthat; use metaswap /gasPrices api for gas price estimates

* Remove references to ethgasstation

* Pass base to BigNumber constructor in fetchExternalBasicGasEstimates

* Update ui/app/hooks/useTokenTracker.js

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

* Delete gas price chart

* Remove price chart css import

* Delete additional fee chart code

* Lint fix

* Delete more code no longer used after ethgasstation removal

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2020-12-02 19:55:19 -03:30
Brad Decker
0653a489b0
add new MetaMetricsController (#9857) 2020-12-02 15:41:30 -06:00
David Walsh
673371d013
Fix #9872 - Show price difference warning on swaps price quote (#9899) 2020-12-02 15:27:45 -06:00
Erik Marks
9d4b8a4903
@metamask/contract-metadata (#9968) 2020-12-01 14:55:01 -08:00
Mark Stacey
429847a686
Update to @storybook/*@6 (#9956)
Our Storybook dependencies have been updated to v6.1.9, from v5. This
was done to address a security vulnerability in a transitive dependency
of these packages (`highlight.js`).

The primary changes required by this Storybook update were the change
in import path for the `withKnobs` hook, the change in background
config format, and the webpack configuration. Storybook seems to work
correctly.

The migration was guided by the Storybook changelog[1] and the
Storybook v6 migration guide[2].

There is one Storybook error remaining; it fails to load the Euclid
font. This is a pre-existing error though, so we can fix it in a later
PR.

The `yarn.lock` file was deduplicated in this PR as well, as it was
required to fix various install warnings that were introduced with this
update.

[1]: https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md
[2]: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md
2020-11-30 16:40:46 -03:30
Brad Decker
3ebba0d411
validate addresses in qr codes (#9916) 2020-11-19 15:44:42 -06:00
Thomas Huang
35af9ea301
Override font-weight from Paragraph and set to 900 (#9918)
* Override font-weight from Paragraph and set to 900

* Fix checkmark font-weight on swaps gas button selector
2020-11-19 12:29:35 -08:00
Dan J Miller
2325514a67
Use correct method name for createTokenTrackerLink in token-asset (#9917) 2020-11-19 15:19:45 -03:30
Thomas Huang
44448465ed
Validate sendToken address when component updates (#9907)
* Validate sendToken address when component updates

On a reproduction of trying to get the error message it seems that if an token address is provided in the address form with ETH selected then changing to a token address, the error message won't show.

This will validate the sendtoken address on prop change to properly update the warning message.

* Update test to include second doesAmountErrorRequireUpdate call when state is updated and component is updated
2020-11-19 07:35:42 -08:00
Thomas Huang
75de9086de
Include error string from ledger errors (#9911)
* Include error string from ledger errors

* Type check error message

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-11-19 07:35:20 -08:00
Mark Stacey
bb3a0423d4
Ensure custom slippage is a number (#9915)
This fixes a PropType error when using non-custom slippage, and it
fixes a type inconsistency when custom slippage is used.

Previously, `slippage` was being converted explicitly to a `Number` as
it was passed into `BuildQuote`, but not as it was passed into
`AwaitingSwap`. Also the PropType was set as `string`, despite the fact
that it's a number in most cases, and is used for math.

The PropType has been changed to `number`, and the selective casting to
`Number` has been removed. Instead, the `maxSlippage` value is cast to
a `Number` as it's being selected, so that the type is always
consistent.
2020-11-19 11:56:55 -03:30
Dan J Miller
a9fcf0ea86
Use getTokenTrackerLink for asset view etherscan link in token-asset.js (#9913) 2020-11-19 00:59:42 -03:30
Dan J Miller
1e895c3110
Revert view quote design updates (#9904)
* Revert "Update fee card designs to show savings and MM fee (#9629)"

This reverts commit d9924ca771.

* Revert "Update main-quote-summary designs/styles (#9612)"

This reverts commit 5456d55c88.
2020-11-18 22:10:24 -03:30
Dan J Miller
179e795b1f
Update asset page etherscan link to the address-filtered token page on Etherscan (#9909) 2020-11-18 21:57:29 -03:30
Dan J Miller
e4de763116
Add token verification message to swaps build quote screen (#9891)
* Add token verification message to swaps build quote screen

* Adds description for locale

* Use <a> tag for etherscan link

* Remove unnecessary span

* Update ui/app/pages/swaps/build-quote/build-quote.js

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

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-11-17 17:26:02 -03:30
Brad Decker
daf783a0d8
Track a new schema event when adding a token (#9810)
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-11-17 11:39:21 -06:00
Thomas Huang
302b7dd731
Move add contact button in fullscreen/expanded view lower. (#9883)
* Move add contact button in fullscreen/expanded view.

Fixes #9868

Move the add contact button that is overlapping (x)/close setting icon lower, on the same line as Contacts in fullscreen/expanded view.
2020-11-16 12:07:48 -08:00
David Walsh
9b42ead095
Merge pull request #9880 from darkwing/hardware-error
Properly detect U2F errors in hardware wallet
2020-11-13 13:51:08 -06:00
David Walsh
ed19ce44bd
Merge pull request #9853 from darkwing/image-updates
Provide alternative text for images where appropriate
2020-11-13 13:44:55 -06:00
David Walsh
19a03d20c0 Properly detect U2F errors in hardware wallet 2020-11-13 12:34:03 -06:00
Mark Stacey
7830b85bf1
Fix malformed PropType declaraton (#9876)
`PropTypes.function` was used accidentally instead of `PropType.func`
2020-11-13 14:52:58 -03:30
Mark Stacey
beb6047384
Revert "Add custom hd path option (#9367)" (#9875)
This reverts commit f30d261e69.

The custom HD path option was found to be unsafe to use, because the
displayed list of accounts would differ depending on which application
was open on the Ledger device. Essentially Ledger was accepting invalid
inputs, and returning junk responses.

This was too dangerous to ship, as it could leave users with an account
that they can't reliably recover. If we don't know how the derivation
is happening, then allowing this import puts our users at risk of
losing funds.

We can re-introduce this functionality after adding validation to
ensure that we only allow inputs that are handled correctly by Ledger.
2020-11-13 14:25:47 -03:30
Dan J Miller
d9924ca771
Update fee card designs to show savings and MM fee (#9629)
* Update fee card designs to show savings and MM fee

css touch up

More semantic html and remove unnecessary container wrapper

Update message for case when there are no savings, in new swaps fee card designs

Improve display of tilde in savings designs

* Ensure terms of service is shown when insufficient eth warning is shown on view-quote screen

* Logic simplification in fee-card.js

* Better center info tooltip icons in fee-card

* Add comment about use of \!important in fee card css

* Use container class property on info tooltip in fee card

* Remove function call that was made redundant with 980b14089 but not removed during rebase
2020-11-13 13:42:50 -03:30
David Walsh
67303b7865
Fix BigNumber issues (#9860)
* Document where we need BigNumber-related changes

* Fix 1 unit test

* Debug progress

* Add required values for each upstream usage of getBigNumber

* Switch to base 10

* Address feedback
2020-11-13 14:08:18 +08:00
Erik Marks
8c6c944d14 Fix unit tests 2020-11-12 15:04:29 -08:00
Erik Marks
bb81ac7cd6 Fix setGasPrice dispatch function params 2020-11-12 14:57:29 -08:00
Dan J Miller
9849a9cf82
Fixes related to swaps custom gas limit (#9858)
* Fixes related to swaps custom gas limit

* Update ui/app/pages/swaps/view-quote/view-quote.js

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

* Move selectQuotePopover onSubmit dispatches to a single action creator

* Correct type of minimumGasLimit in view-quote.js

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2020-11-12 15:42:04 -03:30
David Walsh
9df5be903b
Use optional chaining for functions (#9799) 2020-11-12 11:13:21 -06:00
Mark Stacey
d5076e142a
Prevent user from getting stuck on opt in page (#9856)
Failed metric events on the opt-in page no longer leave the user stuck
on that page. If the metric events fail, they still bubble up as errors
to be caught by Sentry and logged to the console, but the user is still
brought to the next page.

Fixes #9800
2020-11-11 18:33:11 -03:30
Erik Marks
876ca136b3 Throw instead of log error 2020-11-11 12:39:26 -08:00
Erik Marks
a714da8069 Ensure submission state is reset on onSubmit error 2020-11-11 12:28:20 -08:00
David Walsh
a05230bba7 Provide alternative text for images where appropriate 2020-11-11 09:38:15 -06:00
Erik Marks
53bf9cb766 Disable save button while submitting 2020-11-10 23:39:49 -08:00
Erik Marks
4db9c8b36f Fix chainId display in network form on save 2020-11-10 22:41:19 -08:00
Mark Stacey
552ea136b7
Fix onboarding library integration (#9835)
The bug with our onboarding library integration was introduced in #8873
because of a change in when `completeOnboarding` was called. We hadn't
realized at the time that the onboarding integration relied upon the
onboarding completing event to know when the onboarding state should
be cleared. Because onboarding is now marked as completed earlier, the
state was cleared just as it was intended to be used.

The onboarding completed event has been moved back to where it was
before: after the user exits the "end of flow" page.

The original problem that #8873 was addressing was a routing issue,
where the user would be redirected back to the seed phrase confirmation
page despite already having confirmed their seed phrase. This was fixed
in a different way here, by updating the routing in the first time flow
switch to skip straight to the end of flow page if the seed phrase has
already been confirmed.

This does involve one user-facing change in behavior; if the user opens
any MetaMask UI before navigating away from the end-of-flow screen,
they will still be considered mid-onboarding so it'll redirect to the
end-of-flow screen. But we do mark onboarding as completed if the user
closes the tab/window while on the end of flow screen, which was
another goal of #8873.
2020-11-10 17:57:08 -03:30