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

513 Commits

Author SHA1 Message Date
Dan J Miller
0558689636
Compare convert ethBalance to decimal before comparing to fromTokenBalance in useEffect for eth token balance update (#9607) 2020-10-14 16:48:21 -02:30
Erik Marks
c39617e111
Make FeeCard component specific to swaps (#9603)
* Make FeeCard component specific to swaps

* Fix some prop types
2020-10-14 11:59:03 -07:00
Erik Marks
a0d7aa56aa Loosen isBestQuote PropType 2020-10-14 10:17:41 -07:00
Erik Marks
799df99bd0 Rename some props 2020-10-14 10:12:35 -07:00
Erik Marks
b31816d6f7 Make FeeCard component specific to swaps 2020-10-14 10:06:17 -07:00
David Walsh
d0152aad51
Use localizations for placeholders in Swap (#9587) 2020-10-14 14:15:44 -02:30
David Walsh
48dd3fe069
AutoFocus the from input on swaps screen (#9581) 2020-10-14 14:13:55 -02:30
David Walsh
bbd4ee5fdf
Autofocus the appropriate text fields in the Create/Import/Hardware screen (#9576) 2020-10-14 14:13:26 -02:30
Dan J Miller
2563180a88
Data consistency swaps token balance (#9588)
* Explicitly set balance and string on the swaps from token in token-overview

* Set swapsFromToken balance to a decimal instead of a hex on eth balance change in build-quote
2020-10-14 14:09:04 -02:30
Mark Stacey
e53f970458
Use localized strings for MetaMetrics opt-in page (#9593)
The MetaMetrics opt-in page during onboarding now uses localized
strings. This allows us to add translations.
2020-10-14 13:33:34 -02:30
Mark Stacey
7a1d93002d
Remove commitment to maintain a public metrics dashboard (#9592)
We were unable to deliver this public dashboard as we had originally
anticipated, and this is no longer a priority for the team. We may
revisit this idea in the future, but for now it has been removed from
our list of commitments.
2020-10-13 22:16:02 -02:30
Erik Marks
59212f7a2b
Remove dead gas estimation functions, rename function (#9579) 2020-10-13 14:13:54 -07:00
Dan J Miller
dfb722b6ed
Hex prefix newly fetched token balances in build-quote (#9586)
* Hex prefix newly fetched token balances in build-quote

* Set balance to dec WEI string instead of hex when adding token via swap from select
2020-10-13 17:38:24 -02:30
Mark Stacey
ded43cbcdf
Remove unused code (#9564)
A number of unused parameters and `propTypes` have been merged, along
with an unused function.
2020-10-13 11:18:22 -02:30
Erik Marks
e071b4482e
Use chainId values for the address book (#9565)
* Delete CachedBalancesController.cachedBalances

* Migrate provider to Rinkeby instead of deleting it

* Convert hex transaction metamaskNetworkId values to decimal

* Don't migrate provider state in e2e tests

* Don't kick custom RPC users to Rinkeby unnecessarily

* Use provider.chainId for address book chainId values

* Add address book migration

* Fix failing unit test

* fixup! Merge branch 'develop' into address-book-use-chainId

* Select address book entries for display by chainId

* Merge all address book entry keys

* fixup! Merge all address book entry keys
2020-10-12 16:35:55 -07:00
David Walsh
a3b434df46
Autofocus first input for Search Token and Custom Token (#9562) 2020-10-12 14:10:51 -07:00
Dan J Miller
f3bd717184
Account for approval gas costs in eth received (#9559)
* Account for approval gas costs in eth received

* Pass approval txMeta to getSwapsTokensReceivedFromTxMeta in swaps/index.js
2020-10-12 17:26:53 -02:30
Erik Marks
5b8c07817a
Remove localhost provider type (#9551)
* Delete localhost provider type

* Use ganache-cli default chain ID for tests

* Delete unused test firstTimeState variable

* Migrate default ganache-cli network to frequentRpcListDetail

* Add default test provider state

* Add test functionality to createJsonRpcClient

* Lint locales

* Update test middleware creation

* fixup! Update test middleware creation
2020-10-12 12:05:40 -07:00
Dan J Miller
0e37904692
Add useFastestButtons options to gas-customization modal and utilize it in swaps. (#9548) 2020-10-12 14:21:17 -02:30
Dan J Miller
a9d156e611
Fix and simplify account switching in Swaps (#9549)
* Ensure rendered swap from token balance updates when token balance changes

* Disable account switching on all swaps routes other than build quote
2020-10-12 14:21:01 -02:30
Dan J Miller
dc5edb5431
Fix calculation and display of eth received amounts in swaps (#9546)
* Update txMeta after postTxBalance has been retrieved

* Use gas used from txReceipt to calculate eth received

* Return null from getSwapsTokensReceivedFromTxMeta in tokenSymbol is ETH and txReceipt is missing

* Get latest txMeta before updating it with postTxBalance in case of a swaps tx in confirmTransaction

* Lint fix
2020-10-12 07:52:51 -02:30
Dan J Miller
436b01387c
Add useSwapsEthToken hook and utilize wherever we need the ETH 'token' for swaps (#9537)
* Add useSwapsEthToken hook and utilize wherever we need the ETH 'token' for swaps
* Remove rawEthTokens param from useTokensToSearch calls

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: Erik Marks <rekmarks@protonmail.com>
2020-10-09 12:17:56 -07:00
Mark Stacey
d8818a47c4
Add margins between quote list columns (#9528)
The quote list columns have been adjusted to add more space in between
the columns. Additionally, the third column cells are now better
aligned under the header. A few unnecessary `<div>`s and CSS classes
have been removed as well.
2020-10-09 16:12:13 -02:30
Dan J Miller
0ebc465221
Fix swap prop type errors (#9532)
* Fix swap prop type errors

* Fix prop type of sortColumn in sort-list
2020-10-09 13:08:01 -02:30
Dan J Miller
98f049f8cb
Only shows the swaps intro popup on mainnet (#9534)
* Only shows the swaps intro popup on mainnet

* Remove code that closes swaps popup from e2e tests

* correct casing on isMainnet prop in home component
2020-10-09 13:07:11 -02:30
Dan J Miller
89a0f75942
Corrects the copy in the amount receiving tooltip of the swaps sort-list (#9533) 2020-10-09 12:30:16 -02:30
Dan J Miller
549140f6f5
Remove max mode for eth feature from swaps (#9531)
* Remove max mode for eth feature from swaps

* Fix unit tests after removing maxMode from swaps
2020-10-09 12:26:23 -02:30
David Walsh
25e5ac24b2
Prevent swaps value input placeholder from jumping when focused (#9520) 2020-10-08 13:38:36 -02:30
Dan J Miller
a939853989
Ensure all of a token is swapped when clicking max in swaps (#9507) 2020-10-07 18:38:34 -07:00
Dan J Miller
7a28783924
Prevent user from submitting swap if they do not have enough for the max gas fee (#9500) 2020-10-07 09:55:38 -07:00
Mark Stacey
b98b0b6d01
Fix missing app header on Home screen (#9498)
The app header would sometimes mistakenly not get rendered while on the
Home screen. This could happen when a permission request was made while
the UI was open, to either the browser action popup or the fullscreen
UI.

This was caused by faulty logic in the top-level router component. It
would hide the app header if there was a pending permission request,
presumably because the author assumed that a redirect to the permission
flow would shortly follow. This redirect only happens on mount though,
not if the UI was already open when the permission request was
submitted.

The intent of this logic was to hide a brief flash of the app header
prior to rendering the permission flow. This brief flash has now been
restored, which is unfortunate, but is better than the missing app
header bug. We can revisit a solution to removing this flash in the
future, hopefully in a manner that avoids this bug and works for all
notification UI cases.
2020-10-07 14:15:39 -02:30
Mark Stacey
d1e8f5db86
Prevent redirecting to swaps in notification (#9497)
If a notification popup was opened while the user was partway through
the swaps flow, the notification would display the swaps flow instead
of whatever action triggered the popup (e.g. a connect request or a
confirmation). This is confusing and potentially dangerous, as the
user might mistakenly think the swap was triggered by a dapp.

The swap redirects are now prevented in the notification UI. The user
will still be redirected to an in-progress swap flow if they open the
browser action popup or the fullscreen UI, but not on the notification
popup that is triggered by dapp actions.
2020-10-07 13:49:47 -02:30
Erik Marks
bf1bb6ca7e
Check specified chain ID against endpoint return value (#9491)
Adds additional validation to chainId values in the network form, by comparing the specified value against the value returned by the endpoint.
2020-10-07 11:58:22 -02:30
Brad Decker
1ba4061f46
format quotes consistently on main-view and list-view (#9495) 2020-10-06 22:07:38 -02:30
Dan J Miller
534ac25a93
Ensure gas costs are accounted for when calculating the amount of eth received in a swap (#9494) 2020-10-06 21:38:09 -02:30
Erik Marks
39d5bb73a7
Remove setSpecialRpc functionality (#9490) 2020-10-06 14:06:41 -07:00
Dan J Miller
30d13422b5
Add MetaMask Swaps (#9482) 2020-10-06 15:58:38 -02:30
Erik Marks
088d4c34f1
Merge pull request from GHSA-c2xw-px2x-pr65
* Remove network config store
* Remove inline networks variable in network controller
* Re-key network controller 'rpcTarget' to 'rpcUrl'
* Require chainId in lookupNetwork, implement eth_chainId
* Require chain ID in network form
* Add alert, migrations, and tests
* Add chainId validation to addToFrequentRpcList
* Update public config state selector to match new network controller
state
* Use network enums in networks-tab.constants
* Ensure chainId in provider config is current
* Update tests
2020-10-06 15:27:02 -02:30
ricky
b00cd344d9
Use ethers to validate mnemonic during import (#9463) 2020-09-28 18:43:42 -02:30
Brad Decker
b3d3518bc0
Remove unnecessary functions (#9458)
Removes unnecessary functions with minor code changes to support extraction
2020-09-24 11:42:56 -05:00
Brad Decker
1123adcb1d
fix overflow issue on approval container (#9415) 2020-09-16 15:18:39 -05:00
Brad Decker
22ee3695f5
fix tooltip issue on firefox (#9409) 2020-09-15 13:19:46 -05:00
Brad Decker
8b24f624dd
add segment implementation of metametrics (#9382)
Co-authored-by: Whymarrh Whitby <whymarrh.whitby@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-09-14 12:04:05 -05:00
Mark Stacey
feab36710d
Remove unused connections route (#9394)
This route was used for the "Connections" page in Settings, which was
removed in #7004
2020-09-11 09:32:54 -03:00
Whymarrh Whitby
e2dedaacdb
Use Infura v3 API (#9368)
* Use eth-json-rpc-infura@5.0.0
* Use Infura v3 API
* Add example .metamaskrc file
2020-09-10 13:46:00 -02:30
Erik Marks
eef4ec981f
Ensure token amounts are in fixed notation (#9381)
* Ensure token amounts are in fixed notation
2020-09-09 22:24:11 -07:00
Erik Marks
b349a5c8b1
Convert ConfirmTokenTransactionBase to functional component (#9373)
* Convert ConfirmTokenTransactionBase to functional component

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-09-09 22:00:04 -07:00
Erik Marks
d532cdc459 Ensure tokenAmount is always a string 2020-09-08 14:00:28 -07:00
Erik Marks
23683c1630
Replace toNumber calls on BigNumbers with toString (#9369) 2020-09-08 08:49:51 -07:00
Patryk Łucka
3d4f1f45bd
Add messages to Ledger connection process (#9344) 2020-09-02 13:58:14 -02:30