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

104 Commits

Author SHA1 Message Date
Dan J Miller
e7a0ca134b
Replace use of 'destinationAmountInEth' property with 'destinationAmountInETH' (#10500) 2021-02-23 13:22:04 -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
David Walsh
3d579dfcef
Remove react-select and SimpleDropdown, use Dropdown (#10468) 2021-02-19 13:03:44 -06:00
Dan J Miller
b056867c33
Correct use of useTokenTracker in viewQuote to ensure token data is not disrupted by faulty token in user account (#10456)
* Use the includeFailedTokens option with useTokenTracker in viewQuote

* Show appropriate error message if we do not have data on the balance of token on the view-quote screen

* Update app/_locales/en/messages.json

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

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-02-17 11:19:24 -03:30
David Walsh
531c35bc96
Ensure users reacknowledge price slippage risks when it changes (#10376) 2021-02-05 14:40:40 -06:00
Dan J Miller
27d6c6e0df
Make action elements in actionable message component accessible (#10386)
* Make action elements in actionable message component accessible by making them buttons

* Remove unnecessary cursor pointer
2021-02-05 14:57:48 -03:30
Dan J Miller
33ab480fbe
Swaps token sources/verification messaging update (#10346)
* Update standard swaps build quote screen token verification message

* Add actionable warning token verification message to swaps build quote screen

* Simplify swapTokenVerification translations

* Use original verifyThisTokenOn message instead of swapsConfirmTokenAddressOnEtherscan

* Restore verifyThisTokenOn message to hi locale

* Support type and the withRightButton option as parameters on the actionable message component

* Use 'continue' in place of swapPriceDifferenceAcknowledgementNoFiat message

* Use wrapperClassName property on infotooltip in actionable-message

* Remove unnecessary change

* Lint fix
2021-02-05 13:41:10 -03:30
Erik Marks
76a2a9bb8b
@metamask/eslint config@5.0.0 (#10358)
* @metamask/eslint-config@5.0.0
* Update eslintrc and prettierrc
* yarn lint:fix
2021-02-04 10:15:23 -08:00
Dan J Miller
e82ab94699
Change copy of submit button on swaps screen (#10373) 2021-02-04 14:42:43 -03:30
David Walsh
eeca0af5b9
Implement price impact acknowledgement button (#10347) 2021-02-04 09:58:46 -06:00
Erik Marks
7077ee68dc
Add NETWORK_TYPE_RPC constant (#10203)
* Refactor network display props
* Add NETWORK_TYPE_RPC constant
* Consolidate network constants
2021-01-20 08:49:05 -08:00
Erik Marks
90289ec22a
Further improve organization of constants (#10200) 2021-01-20 08:13:14 -08:00
Dan J Miller
36ef9a228a
Disable the swaps submit button after the first time it is clicked (#10162) 2021-01-19 13:42:02 -03:30
Dan J Miller
5b6e524c90
Remove default to 18 decimals in quotesToRenderableData method (#10212) 2021-01-19 13:35:58 -03:30
Dan J Miller
9a1e83cf4b
Disable swaps based on chainId, instead of network id (#10155) 2021-01-07 13:29:32 -03:30
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
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
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
David Walsh
673371d013
Fix #9872 - Show price difference warning on swaps price quote (#9899) 2020-12-02 15:27:45 -06: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
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
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
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
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
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
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
David Walsh
a05230bba7 Provide alternative text for images where appropriate 2020-11-11 09:38:15 -06:00
Dan J Miller
2540ca77b9
Add a minimumGasLimit to the gas customization modal in swaps (#9600)
* Add a minimumGasLimit to the gas customization modal in swaps

* Remove fallback object for modal props in swaps-gas-customization-modal.container.js
2020-11-10 16:50:39 -03:30
Mark Stacey
65fb18e1aa
Fix PropType warning about quoteDataRows[0].rawNetworkFees (#9842)
The property `quoteDataRows[0]rawNetworkFees` was described as a number
rather than a string. In practice it is a string in all cases. The
PropType and the tests have both been updated to expect it to be a
string.
2020-11-10 14:17:55 -03:30
Dan J Miller
bcd5f2a7c1
Fix gas_fees properties collected for swaps analytics events (#9727) 2020-11-10 14:09:45 -03:30
Brad Decker
980b140891
track sensitiveProperties in a duplicate event. (#9807) 2020-11-10 09:49:01 -06:00
David Walsh
783d3bacfb
Prevent React prop warning for maxSlippage (#9834) 2020-11-09 17:54:04 -06:00
Dan J Miller
909795571b
Fix tradeValue assignment and reference in view-quote.js (#9837) 2020-11-09 20:06:00 -03:30
Brad Decker
a49a4a066c
expand transaction constants coverage (#9790)
* expand transaction constants coverage

* touchups

* dont import inside of e2e

* Update app/scripts/controllers/transactions/tx-state-manager.js

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

* Update test/unit/app/controllers/transactions/tx-controller-test.js

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

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-11-07 01:38:12 -06:00
David Walsh
8a3dabb230 Use optional chaining for functions 2020-11-05 10:28:24 -06:00
Dan J Miller
a0d7c71011
Switch gas price estimation in swaps to metaswap-api /gasPrices (#9599)
Adds swaps-gas-customization-modal and utilize in swaps

Remove swaps specific code from gas-modal-page-container/

Remove slow estimate data from swaps-gas-customization-modal.container

Use average as lower safe price limit in swaps-gas-customization-modal

Lint fix

Fix up unit tests

Update ui/app/ducks/swaps/swaps.js

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

Remove stale properties from gas-modal-page-container.component.js

Replace use of isCustomPrice safe with isCustomSwapsGasPriceSafe, in swaps-gas-customization-modal

Remove use of averageIsSafe in isCustomPriceSafe function

Stop calling resetCustomGasState in swaps

Refactor 'setter' type actions and creators to 'event based', for swaps slice custom gas logic

Replace use of advanced-tab-content.component with advanceGasInputs in swaps gas customization component

Add validation for the gasPrices endpoint

swaps custom gas price should be considered safe if >= to average

Update renderDataSummary unit test

Lint fix

Remove customOnHideOpts for swapsGasCustomizationModal in modal.js

Better handling for swaps gas price loading and failure states

Improve semantics: isCustomSwapsGasPriceSafe renamed to isCustomSwapsGasPriceUnSafe

Mutate state directly in swaps gas slice reducer

Remove unused params

More reliable tracking of speed setting for Gas Fees Changed metrics event

Lint fix

Throw error when fetchSwapsGasPrices response is invalid

add disableSave and customTotalSupplement to swaps-gas-customization container return

Update ui/app/ducks/swaps/swaps.js

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

Improve error handling in fetchMetaSwapsGasPriceEstimates

Remove metricsEvent from swaps-gas-customization-modal context

Base check of gas speed type in swaps-gas-customization-modal on gasEstimateType

Improve naming of variable and functions use to set customPriceIsSafe prop of AdvancedGasInputs in swaps-gas-customization-modal

Simplify sinon spy/stub code in gas-price-button-group-component.test.js

Remove unnecessary getSwapsFallbackGasPrice call in swaps-gas-customization-modal

Remove use of getSwapsTradeTxParams and clean up related gas price logic in swaps

Improve validator of SWAP_GAS_PRICE_VALIDATOR

Ensure default tradeValue
2020-11-04 12:44:08 -03:30
Brad Decker
026a06b39d
add shared transaction constants (#9459)
Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2020-11-03 16:57:51 -06:00
Brad Decker
2ebf8756a4
[RFC] add prettier to eslint (#8595) 2020-11-02 17:41:28 -06:00
David Walsh
a74aa45bdd
Use 1px borders on inputs and buttons (#9766) 2020-10-30 13:31:42 -05:00
David Walsh
77dc0ab008
Make swap arrows accessible, make swaps advanced options accessible (#9750) 2020-10-30 09:35:47 -05:00
David Walsh
5b67cf1009
Prevent React warning for custom slippage (#9706) 2020-10-28 08:58:31 -05:00