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

4216 Commits

Author SHA1 Message Date
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
Dan J Miller
a4c0133bc5
1559 ledger (#11951)
* EIP-1559 - Provide support for Ledger

* Update ui/selectors/selectors.js

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

* Add shared constants for hw types

* bump eth-ledger-bridge-keyring to v0.7.0

Co-authored-by: David Walsh <davidwalsh83@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: Alex <adonesky@gmail.com>
2021-09-01 11:25:06 -05:00
Erik Marks
8a8ce3a0c0
@metamask/controllers@15.0.0 (#11975)
Adds the latest version of `@metamask/controllers`, and updates our usage of the `ApprovalController`, which has been migrated to `BaseControllerV2`. Of [the new `controllers` release](https://github.com/MetaMask/controllers/releases/tag/v15.0.0), only the `ApprovalController` migration should be breaking.

This is the first time we use events on the `ControllerMessenger` to update the badge, so I turned the messenger into a property on the main `MetaMaskController` in order to subscribe to events on it in `background.js`. I confirmed that the badge does indeed update during local QA.

As it turns out, [MetaMask/controllers#571](https://github.com/MetaMask/controllers/pull/571) was breaking for a single unit test case, which is now handled during setup and teardown for the related test suite (`metamask-controller.test.js`).
2021-08-31 12:27:13 -07:00
Erik Marks
1175b4bfa7
Make all named intrinsics non-modifiable (#11953)
This PR makes ~all named intrinsics in all of our JavaScript processes non-modifiable. A named intrinsic is any property specified by the ECMAScript specification that exists on `globalThis` when the JavaScript process starts. We say that a property is non-modifiable if it is non-configurable and non-writable. We make exceptions for properties that meet any of the following criteria:

1. Properties that are non-configurable by the time `lockdown-run.js` is executed are not modified, because they can't be.
2. Properties that have accessor properties (`get` or `set`) are made non-configurable, but their writability cannot be modified, and is therefore left unchanged. It's unclear how many of the named intrinsics this applies to, if any, but it's good defensive programming, regardless.
2021-08-30 14:30:48 -07:00
ryanml
6c97720319
Updating message about disabled Mobile Sync (#11935) 2021-08-25 15:21:28 -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
Alex Donesky
33849bfec6
Fix issue with chainId comparison in sign typed message param validation (#11900) 2021-08-24 11:23:29 -05: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
ac9660d573
Gas controls copy updates (EIP-1559) (#11889) 2021-08-19 07:01:53 -07:00
Dan Finlay
44ab05044c
Fix typo in mobile sync warning message (#11888) 2021-08-18 19:36:11 -07: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
87cc7e3961
Using "Secret Recovery Phrase" throughout the onboarding flow (#11850)
Fixes MetaMask/metamask-extension#11848
2021-08-18 06:20:06 -07:00
Dan J Miller
a42c15a3f7
Update copy on tooltip shown when gas suggests gas fees (#11873) 2021-08-18 08:57:02 -02:30
ryanml
d96973e55b
Improving handling for non-existent props in state migrations (#11829) 2021-08-17 19:18:53 -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
ryanml
5cbece90c0
Removing unnecessary console log from the preferences controller (#11828) 2021-08-17 01:56:18 -07:00
ryanml
e7dc42be0b
Do not attempt to track tx metrics events if txMeta is not available (#11823) 2021-08-16 17:28:56 -07:00
Christophe Chantraine
09bcafc976
Improve traduction "off" in french (#11844)
Co-authored-by: Chantraine Christophe <christophe.c@djmdigital.be>
2021-08-16 13:28:30 -07:00
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
e57a2da647
Adjusting Max Fee label in EditGasDisplay per designs (#11796) 2021-08-10 15:36:35 -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
Daniel
827e6a6efc
Fix fee level content (#11790) 2021-08-06 15:52:28 +02:00
Alex Donesky
751534e665
fix confirm transaction details to match spec (#11779) 2021-08-05 20:07:04 -05:00
Alex Donesky
804fefcd36
Separate out non blocking gas errors (#11783) 2021-08-05 17:53:48 -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
Dan J Miller
a950111a19
Show advanced options, and hide radio buttons, for advanced gas settings users (#11751)
* Show advanced options, and hide radio buttons, for users with advanced gas settings turned on

* Improve naming and copy

* lint fix

* Lint fix
2021-08-04 19:04:42 -02:30
Dan J Miller
b9fb495c7b
Allow max priority fee to be below 1, and only require it to be greater than 0 (#11749) 2021-08-04 10:53:52 -02:30
Dan J Miller
61b965a8a2
Allows users to set a max priority fee below suggested, just showing a warning in that case (#11750) 2021-08-04 10:53:19 -02:30
Dan J Miller
1acbb39dff
Rename effective gas price field to total gas fee (#11754) 2021-08-04 10:52:54 -02:30
Alex Donesky
615380b76d
Remove estimate detail above advanced gas controls in non-1559 network (#11744)
* Remove estimate detail above advanced gas controls in non-1559 network

* lint

* remove gasEstimate localization text
2021-08-03 14:34:24 -05:00
David Walsh
fba662ca2b
EIP-1559 - Provide better validation for gas price and gas limit (#11736) 2021-08-03 10:54:49 -05:00
David Walsh
9ccb91f47b
EIP-1559 - Fix education modal typo (#11740) 2021-08-03 10:52:45 -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
Dan J Miller
8481c4b6be
Show warning when network request for fee market estimates fails (#11724) 2021-08-02 19:19:07 -02:30
ryanml
1360b2bf6b
Rejecting EIP-1559 transactions on unsupported networks (#11722) 2021-08-02 08:38:01 -07:00
David Walsh
4ce6994a6c
Fix #11695 - Prevent maxFee and maxPriorityFee imbalance (#11700) 2021-08-02 09:07:29 -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
Dan J Miller
b2cb38ab2d
Ensure createPendingTxMiddleware returns gasPrice for EIP-1559 transactions (#11685) 2021-07-30 18:10:19 -02:30
kumavis
66eb4fb5a0
Update background.js (#11663) 2021-07-30 08:02:48 -05: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
Dan J Miller
aaa15cbe03
Add support for EIP1559 transactions to transaction breakdown (#11622)
* Add support for EIP1559 transactions to transaction breakdown

* Use userPreferencedCurrencyDisplay for effective gas price in transaction breakdown

* Hide eip1559 gas properties in transaction breakdown on non-1559 networks

* Add comment explaining gasPrice and effectiveGasPrice usage in transaction breakdown container.
2021-07-28 15:00:34 -02:30
Dan J Miller
7c86727c16
Make EIP1559 compatibility in tx controller also require account type support (#11616) 2021-07-27 20:43:48 -02:30
David Walsh
fab9cfde03
EIP-1559 - Provide data wiring for Gas Timing component (#11462) 2021-07-26 10:35:51 -05: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
eb622d96fc
EIP-1559 - Fix dapp suggested warning (#11568) 2021-07-21 07:49:17 -05:00
David Walsh
6d92759853
EIP-1559 - Implement form validation for EIP-1559 (#11540)
* Restructure advanced gas form errors

* Use shared constant for gas errors

* Add validation for fields too low

* Add warnings for high max fee and max priority fee

* Fix lint

* Fix priority fee high warning string
2021-07-20 14:34: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
ryanml
ceaf16417d
Updating formatTxMetaForRpcResult to match latest spec (#11536) 2021-07-16 11:53:01 -07:00
Brad Decker
dc25a24de3
rely upon gas fee controller for gas price estimates (#11511) 2021-07-16 11:06:32 -05:00
Peter-Jan Brone
3fada25dfc
Add Skylink support to ENS resolver (#11401)
* Add Skynet support to ENS to IPFS resolver

* Remove newline

* Fix lint

* Fix lint

* Remove mistakenly committed zip file

* Update
2021-07-16 10:22:04 -05:00
David Walsh
d8984d3cf3
EIP-1559 - Provide Updated UI for Dapp-Suggested Gas fees (#11523) 2021-07-16 10:00:03 -05:00
Niranjana Binoy
d33b841fb8
Adding TokenListController to Metamask-Controller (#11515) 2021-07-15 19:08:16 -04:00
David Walsh
b21ad53bdc
EIP-1559 - Provide updated gas price field tooltip text (#11531) 2021-07-15 15:47:51 -05:00
Dan J Miller
ee925d0186
Retrieve state after async action before updating state in _setSwapsQuoteRefreshTime (#11538) 2021-07-15 20:13:53 +02:00
kumavis
9f4820ee98
Build - refactor for bundle factoring and swappable runtime (#11080)
* wip

* build - breakout sentry-install bundle

* deps - move new build sys deps to published versions

* chore: lint fix

* clean - remove unused file

* clean - remove unsused package script

* lavamoat - update build system policy

* build - render html to all platforms

* development - improve sourcemap debugger output

* deps - update lavapack

* lint - fix

* deps - update lavapack for bugfix

* deps - update lavapack for bugfix

* deps - bump lavapack for line ending normalization

* sourcemap explorer - disable boundary validation

* ci - reset normal ci flow

* build - re-enable minification on prod

* build - remove noisy log about html dest

* build - update terser and remove gulp wrapper for sourcemap fix

* Revert "sourcemap explorer - disable boundary validation"

This reverts commit 94112209ed880a6ebf4ee2ded411e59db6908162.

* build - reenable react-devtools in dev mode

* wip

* build - breakout sentry-install bundle

* deps - move new build sys deps to published versions

* chore: lint fix

* clean - remove unused file

* clean - remove unsused package script

* lavamoat - update build system policy

* build - render html to all platforms

* development - improve sourcemap debugger output

* deps - update lavapack

* lint - fix

* deps - update lavapack for bugfix

* deps - update lavapack for bugfix

* deps - bump lavapack for line ending normalization

* sourcemap explorer - disable boundary validation

* ci - reset normal ci flow

* build - re-enable minification on prod

* build - remove noisy log about html dest

* build - update terser and remove gulp wrapper for sourcemap fix

* Revert "sourcemap explorer - disable boundary validation"

This reverts commit 94112209ed880a6ebf4ee2ded411e59db6908162.

* build - reenable react-devtools in dev mode

* Updating lockfile

* lint fix

* build/dev - patch watchifys incompatible binary stats output

* ui - add comment about conditional import

* build - improve comment

* Update development/stream-flat-map.js

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

* Outputting all bundle file links (metamaskbot)

Co-authored-by: ryanml <ryanlanese@gmail.com>
Co-authored-by: Brad Decker <git@braddecker.dev>
2021-07-15 10:59:34 -07:00
David Walsh
1665617378
Create different label for Gas Price with GWEI included (#11526) 2021-07-15 12:23:54 -05:00
David Walsh
c241d3150c
EIP-1559 - Provide tooltip text for all advanced gas controls (#11529) 2021-07-15 12:23:37 -05:00
David Walsh
1e1530e8e9
EIP-1559 - Update speed up tooltip text (#11530) 2021-07-15 12:23:28 -05:00
David Walsh
1f70023ce1
EIP-1559 - Update text for editing gas fee suggested by a dapp (#11532) 2021-07-15 12:23:15 -05:00
David Walsh
89e2da71cf
EIP-1559 - Update the title fo the Edit gas popover (#11533) 2021-07-15 12:23:05 -05:00
muji
aef1cd2450
Use ESM imports in migrations index. (#11443)
So that spack does not complain about mixing CommonJs and ESM.
2021-07-13 17:11:53 -05:00
David Walsh
97d9cdff80
Provide EIP 1559 fields in transaction history (#11464) 2021-07-13 08:42:36 -05:00
Brad Decker
2edd44e1c5
moving some properties to identifiable payload (#11506) 2021-07-12 15:30:35 -07:00
ryanml
07601f4a90
Setting tx param type before signing transactions (#11497)
Fixes MetaMask/metamask-extension#11491
2021-07-12 13:26:53 -07:00
Brad Decker
9416d1ca71
provide skeleton for submitting gas form (#11496) 2021-07-12 14:35:54 -05:00
ryanml
e88c069398
Converting gas params for tx metrics to decimal GWEI (#11482) 2021-07-12 10:54:39 -07:00
ryanml
bf4cdb0b5c
Using current time in place of block timestamp for completion time metric (#11483) 2021-07-12 10:14:54 -07:00
Alex Donesky
1117e7b1fe
use ERC721 interface id instead of ERC721 metadata interface ID for identifying ERC721 tokens (#11495) 2021-07-12 11:55:48 -05:00
David Walsh
1da7beed13
Provide Estimate Data to EditGasDisplay (#11433) 2021-07-12 11:16:03 -05:00
Daniel
d438439661
Swaps: Add conditional routing to new APIs based on a feature flag (#11470) 2021-07-09 10:24:00 -05:00
Brad Decker
68dfc98f40
wire up gasFeeController (#11421) 2021-07-08 15:23:00 -05:00
Brad Decker
64adfe7b11
update speedup and cancel to make room for EIP-1559 (#11407)
* prepare for EIP1559 gas fields in speedup/cancel

* Update ui/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
2021-07-08 13:48:23 -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
ryanml
2a74d24ae6
Removing unused files from app/images (#11465) 2021-07-07 10:07:50 -07: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
周宇盛 Yusheng Zhou
cbe1d09396
✏️ fix typo of middleware imported from eth-json-rpc-middleware (#11455) 2021-07-06 10:53:35 -07:00
Brad Decker
da9fb4636b
move conversion utils to shared folder (#11451) 2021-07-06 12:48:49 -05:00
Dan J Miller
7163c56f3e
Add some metrics events to the 3box controller (#11447) 2021-07-02 17:00:40 -02:30
David Walsh
e097a02607
Provide tooltip for 1559 Gas Price field (#11436) 2021-07-02 14:07:34 -05:00
Dan J Miller
932444c355
Ensure transaction controller correctly estimates gas for special custom networks (#11441) 2021-07-02 13:01:27 -02:30
David Walsh
64644ad380
Implement Dapp Acknowledgement screen for editing gas (#11424) 2021-07-01 09:36:48 -05:00
David Walsh
36d3770b42
EIP-1559 - Implement TransactionDetail for confirmations (#11404) 2021-06-30 11:58:18 -05:00
Brad Decker
27c140355e
Switch hardfork in getCommonConfiguration when EIP-1559 support is detected (#11385) 2021-06-30 09:39:00 -05:00
Brad Decker
8f371e4f87
add eip-1559 fields to event schema (#11408)
* add eip-1559 fields to event schema

* add gas_limit to all
2021-06-29 14:54:42 -07:00
Brad Decker
4ba565e719
track dapp suggested gas fees (#11410) 2021-06-29 15:08:16 -05:00
Brad Decker
55502f212d
update txParams normalization and validation. (#11406) 2021-06-29 14:25:56 -05:00
ryanml
3aae36754f
Updating address error (#11389) 2021-06-28 15:38:20 -07:00
Brad Decker
bc4a9b16d0
add account eip1559 detection support (#11380)
* add account eip1559 detection support

* add constants for keyring types
2021-06-28 12:29:08 -05:00
Brad Decker
b6f514e293
remove EIP-1559 fields from txParams before calling estimateGas (#11368) 2021-06-28 10:33:19 -05:00
Brad Decker
dd1330c707
Remove gasPrice defaults for eip-1559 txs (#11391) 2021-06-28 10:22:59 -05:00
David Walsh
d68f8f27c6
Implements the new EIP1559 UI components (#11384) 2021-06-28 09:45:08 -05:00