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

181 Commits

Author SHA1 Message Date
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
Dan J Miller
84036aacb6
Allow advanced inline gas editing when there is an estimates unavailable error (#11859) 2021-08-17 16:55:26 -02:30
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
Alex Donesky
a073e0bb7e
Add low/medium/high gas recommendations to the speedup/cancel gas popovers (#11818) 2021-08-13 11:36:45 -05:00
ryanml
e57a2da647
Adjusting Max Fee label in EditGasDisplay per designs (#11796) 2021-08-10 15:36:35 -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
Alex Donesky
1216dc95c0
Hide gasTiming on edit-gas-popover when form is in error (#11792)
* Hide gasTiming on edit-gas-popover when form is in error

* Show unknown processing error if maxFeePerGas is too low for network conditions

* remove unnecessary change

* remove unnecessary function wrapper
2021-08-06 16:37:18 -05:00
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
David Walsh
1b1d039310
EIP-1559 - Ensure form always displays when there are errors (#11787) 2021-08-05 20:25:23 -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
f9378b3aa2
Add fee level education button to swaps edit gas popover (#11785) 2021-08-05 17:10:04 -05:00
Alex Donesky
4245dac8d9
tiny lost code change from 9.8.4 RC (#11764) 2021-08-04 17:10:29 -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
David Walsh
aa3d1f2341
EIP-1559 - Prevent uncaught exception when passing fees to getGasFeeTimeEstimate (#11759) 2021-08-04 16:17:20 -05:00
David Walsh
f0daa28fac
EIP-1559 - Temporarily remove the loading heartbeat from the transaction detail (#11762) 2021-08-04 16:16:18 -05:00
David Walsh
a3c7bae345
EIP-1559 - Remove unncessary props from AdvancedFormControls (#11757) 2021-08-04 16:00:46 -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
7902e62d8f
Fixing errors in EditGasDisplay (#11748) 2021-08-04 10:54:07 -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
24d563fc2c
EIP-1559 - Show minium native currency in banner when on testnets (#11743) 2021-08-03 12:51:02 -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
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
aa08171c72
EIP-1559 - Return null from GasTiming if on non-1559 network (#11733) 2021-08-02 21:08:12 -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
David Walsh
d34bf92fd0
Fix 11705 - Reset gas limit when radio button clicked (#11710)
* Fix 11705 - Reset gas limit when radio button clicked

* Trigger manual change when gasLimit is changed

* Coordinate gas limit with radio buttons

* Revert "Coordinate gas limit with radio buttons"

This reverts commit 910327a408e32ae989c5565a107db24ac24f2a98.

* Cleanup default gas limit

* setEstimateToUse only update gasLimit on error, add default minimum gasLimit

* add minimum gasLimit fallback

Co-authored-by: Alex <adonesky@gmail.com>
2021-08-02 17:58:30 -02:30
Alex Donesky
c43f6cab63
remove estimate detail in advanced gas controls (#11728) 2021-08-02 14:32:43 -05:00
David Walsh
38ff2c937f
Fix #11703 - Provide wiring for approval modal (#11711) 2021-08-02 09:07:15 -05:00
David Walsh
81f274303e
EIP-1559 - Only show advanced form toggle when radio buttons are present (#11713) 2021-08-01 08:09:53 -05:00
David Walsh
219b0f9bd6
Fix 11709 - Always show fiat on mainnet (#11714) 2021-08-01 08:09:24 -05:00
Dan J Miller
9c0e34b264
EIP-1559 - Ensure gas limit is of minimum value (#11702) 2021-07-31 08:02:14 -05:00
David Walsh
39823b3800
EIP-1559 - Implement speedup and cancel buttons (#11701) 2021-07-31 08:01: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
f1140087b7
Adds insufficient gas error to edit-gas-display (#11524) 2021-07-30 20:16:31 -02:30
Dan J Miller
a1f8a65519
Ensure correct conversion of data before calling getGasFeeTimeEstimate (#11697) 2021-07-30 19:41:55 -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
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
cbfde8a080
EIP-1559 - Fix duplicated networkSupports1559 variables (#11679) 2021-07-30 05:11:27 -05:00
Alex Donesky
583c115663
remove estimation appearance from edit-gas-popover on non-1559 networks (#11673) 2021-07-29 18:29:36 -05:00
David Walsh
990a278177
EIP-1559 - Only show radio group and gas timing when network supports 1559 (#11659) 2021-07-29 13:13:14 -05:00
David Walsh
15cbe4e9a0
EIP-1559 - Allow decimals for maxFeePerGas and maxPriorityFeePerGas (#11664) 2021-07-29 10:59:14 -05:00
David Walsh
0849738003
EIP-1559 - Don't hide advanced form when radio button is chosen (#11643) 2021-07-29 10:14:48 -05: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
ryanml
52bac60a22
Fixing confirmation layout when dapp has suggested a price (EIP-1559) (#11634) 2021-07-28 11:29:55 -05:00
Dan J Miller
9a81b826c5
Only show dapp suggested gas fee warning if user has not edited the fee (#11621) 2021-07-27 20:01:53 -02:30
David Walsh
604524f94d
EIP-1559 - Restore custom values in Edit Gas Popover (#11589)
* EIP-1559 - Restore custom values in Edit Gas Popover

* Provide method to tell which radio button the user may have selected

* Use lodash's findKey

* Add case for legacy gas

* Use gas instead of gasLimit

* Remove unnecessary deletion and todo
2021-07-27 17:12:56 +02:00
Dan J Miller
f4d294714a
Ensure origin shows in gas popover dapp suggested gas fee warning (#11618) 2021-07-26 21:13:05 -02:30
David Walsh
fab9cfde03
EIP-1559 - Provide data wiring for Gas Timing component (#11462) 2021-07-26 10:35:51 -05:00
David Walsh
a2be02dfeb
EIP-1559 - Show gas estimate updating animation in transaction detail (#11566) 2021-07-26 10:24:44 -05:00
David Walsh
6986e76adc
EIP-1559 - Show advanced form controls by default when user has selected custom values or there are gas warnings/errors (#11590) 2021-07-26 09:17:23 -05:00
David Walsh
cd4521fb12
EIP-1559 - Allow wrapping for dapp suggested origin (#11602) 2021-07-24 15:40:51 -05:00
David Walsh
4e87069af3
EIP-1559 - Prevent Max Fee and Max Amount from wrapping on confirmation screen (#11591) 2021-07-23 08:39:10 -05:00
ryanml
8cb1557f1c
Adding method to capture one-time Sentry exceptions (#11553) 2021-07-22 16:13:40 -07:00
ryanml
a96af9e5fc
No longer deconstructing account menu ref if it isn't rendered (#11585) 2021-07-22 11:42:44 -07:00
David Walsh
c1d96676b5
EIP-1559 - Implement new verbiage for transaction detail subtext (#11569) 2021-07-22 11:33:34 -05:00
David Walsh
286fd397f8
EIP-1559 - Maintain changed form values and unselect radio buttons when user customizes form value (#11577) 2021-07-22 11:32:59 -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
ryanml
e60e371105
Improve handling for block explorer url host extraction (#11543) 2021-07-16 11:52:41 -07:00
David Walsh
493448c96e
EIP-1559 - Don't show submit button when in education mode, don't duplicate title (#11541) 2021-07-16 11:19:09 -05: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
Brad Decker
4aab4887d5
add MODIFY_IN_PLACE as mode prop on edit-gas-popover (#11527)
This is necessary for the submit method to call the right background process
2021-07-15 12:31:51 -05:00
David Walsh
8e5ebfb05a
EIP-1559 - Disable gas form submission if estimates are loading state (#11525) 2021-07-15 12:24:03 -05: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
c1064e0c50
EIP-1559 - Only show education link if on 1559-compatible network (#11535) 2021-07-15 12:22:55 -05:00
David Walsh
a294f02b1d
EIP-1559 - Elevate gas properties to the Popover, disable submission if errors (#11510) 2021-07-14 11:45:37 -05: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
97d9cdff80
Provide EIP 1559 fields in transaction history (#11464) 2021-07-13 08:42:36 -05:00
Brad Decker
9416d1ca71
provide skeleton for submitting gas form (#11496) 2021-07-12 14:35:54 -05:00
David Walsh
1da7beed13
Provide Estimate Data to EditGasDisplay (#11433) 2021-07-12 11:16:03 -05:00
Brad Decker
36ab817858
add edit button support to transaction-detail-item (#11481) 2021-07-09 13:08:15 -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
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
ryanml
68ad9c619f
Adding copy icon to home screen account address (#11460)
* Adding copy icon to home screen account address

Fixes MetaMask/metamask-extension#10145

* Using margin-inline-start
2021-07-06 11:17:13 -07:00
Brad Decker
da9fb4636b
move conversion utils to shared folder (#11451) 2021-07-06 12:48:49 -05:00
David Walsh
6fa3cce7ab
Create Gas Timing component for EIP-1559 (#11405) 2021-07-02 14:12:13 -05:00
David Walsh
afe06adb7a
Add icon to actionable message component (#11409) 2021-07-02 14:07:56 -05:00
David Walsh
e097a02607
Provide tooltip for 1559 Gas Price field (#11436) 2021-07-02 14:07:34 -05:00
David Walsh
310531eeb6
EIP 1559 - Provide a GWEI label for advanced gas control fields (#11419) 2021-07-01 09:37:00 -05:00
David Walsh
64644ad380
Implement Dapp Acknowledgement screen for editing gas (#11424) 2021-07-01 09:36:48 -05:00
ryanml
43b7eab46a
Fixing invalid minimumGasLimit prop (AdvancedGasInputs) (#11412) 2021-06-30 23:41:39 -07:00
Dan J Miller
18464793f5
Fix gas-modal-page-container.container check for custom gas price safety (#11426)
* Fix gas-modal-page-container.container check for custom gas price safety

* Ensure gas price has been fetch before checking for price safety on testnets
2021-06-30 15:56:34 -02:30
Alex Donesky
ad6715511e
make network-display component only clickable when passed a function for onClick (#11379) 2021-06-30 13:21:48 -05:00
David Walsh
36d3770b42
EIP-1559 - Implement TransactionDetail for confirmations (#11404) 2021-06-30 11:58:18 -05:00
David Walsh
d68f8f27c6
Implements the new EIP1559 UI components (#11384) 2021-06-28 09:45:08 -05:00
Daniel
ba3f51d6ed
Add support for fiat on-ramp via Transak (#11376) 2021-06-25 08:10:24 -05:00
Dan J Miller
87166afb6b
Use eth_gasPrice result for setting too low warning on custom networks (#11370)
* Use eth_gasPrice result for setting too low warning on custom networks

* Assume CustomPriceSafeForCustomNetwork when there is no custom price set (it will default to recommended)
2021-06-24 14:29:47 -02:30
David Walsh
6fa36cdf51
Provide New UI Components for EIP-1559 Designs (#11357) 2021-06-23 18:39:44 -05:00