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
Dan J Miller
bda4d0cbca
Add list of custom networks with special gas limit buffers (#11435) 2021-07-01 19:18:30 -02:30
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
a60301686c
Ensure that eth_estimateGas is called to estimate gas limit for simple sends on custom networks (#11418)
* Ensure that eth_estimateGas is called to estimate gas limit for simple sends on custom networks

* getIsNonStandardEthChain returns false when in test

* Add comment explaining gas limit buffer multipliers in estimateGasLimitForSend
2021-06-30 23:24:47 -02:30
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
Alex Donesky
433cf6339d
refix the instance of unsafe destructuring I had introduced and fixed and then reintroduced (#11428) 2021-06-30 13:20:13 -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
Alex Donesky
352102438f
add ChipWithInput component (#11392) 2021-06-28 16:09:48 -05:00
David Walsh
d68f8f27c6
Implements the new EIP1559 UI components (#11384) 2021-06-28 09:45:08 -05:00
Brad Decker
23a859826f
add method to detect EIP 1559 support (#11369) 2021-06-25 11:24:00 -05:00
Daniel
a1d7271ed7
Call Wyre’s API via our backend to generate Wyre’s Checkout URL (#11387)
* Call Wyre’s API via our backend to generate Wyre’s Checkout URL

* Add back paymentMethod=debit-card, use a fallback URL if no url is returned from BE

* Fix a lint issue

* Refactor how to return Wyre’s Checkout URL

* Add 2 constants into a test file, refactoring
2021-06-25 09:52:29 -05:00
Daniel
ba3f51d6ed
Add support for fiat on-ramp via Transak (#11376) 2021-06-25 08:10:24 -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
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
Alex Donesky
a6e16f458e
Adding edit navigation button flow back to send token flow (#11335) 2021-06-23 18:50:24 -05:00
David Walsh
6fa36cdf51
Provide New UI Components for EIP-1559 Designs (#11357) 2021-06-23 18:39:44 -05:00
David Walsh
85de65f470
Prevent propType errors in for TransactionIcon statuses (#11316) 2021-06-23 18:39:06 -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
f1f2a01c76
Using fixed positioning for home notifications (#11356) 2021-06-21 15:51:09 -07: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
Alex Donesky
27389fc71e
fix unsafe destructuring instance (#11351) 2021-06-21 09:28:35 -05: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
sooyoung
c152a17a85
Changed scss style to see token symbol (#11294)
* Changed scss style to see token symbol

* fix indentations
2021-06-15 11:00:47 -05:00
Alex Donesky
a8643af481
patch gas price issue - add fallback gas price (#11239) 2021-06-15 09:17:42 -05: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
Dan J Miller
003b6365c0
Use verifyPassword instead of submitPassword in exportAccounts in actions.js (#11265) 2021-06-09 13:42:25 -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
Alex Donesky
e76762548c
Warn users when they attempt to add a network that is already configured (#11179)
* warn users when they attempt to add a network that is already configured

* clean up validation logic

* fixing up e2e tests

* Update test/e2e/helpers.js

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

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-06-04 08:52:07 -05:00
Dan J Miller
6dae3bbe57
Improve detection of whether a whats new notification was 'seen' (#11225) 2021-06-03 13:58:04 -02:30
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