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

226 Commits

Author SHA1 Message Date
Nicolas Ferro
f3465c9485
Deprecate snake case from feature flags (#15994) 2022-09-29 11:03:38 -05:00
ryanml
0bc1eeaf37
Deprecating the Rinkeby, Ropsten, and Kovan test networks (#15989)
* Deprecating Rinkeby, setting default debug network to Goerli

* Deprecating Ropsten and Kovan

* Conflict fix

* Remove unused localization, test fixes

* Add migration for moving used deprecated testnets to custom networks

* Fix migrator test

* Add more unit tests

* Migration updates provider type to rpc if deprecated network is selected

* Migration fully and correctly updates the provider if selected network is a deprecated testnet

* Continue to show deprecation warning on each of rinkeby, ropsten and kovan

* Add rpcUrl deprecation message to loading screen

* Removing mayBeFauceting prop

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2022-09-28 20:26:01 -07:00
Filip Sekulic
6e13524bcd
Remove related UI code from the app dir (#15384)
Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-09-16 14:05:21 -05:00
Brad Decker
c87980bbfe
migrate network constants to typescript (#15610) 2022-09-14 09:55:31 -05:00
Daniel
34e2faaf49
Replace Rinkeby with Goerli for dev testing (#15781) 2022-09-12 13:11:29 +02:00
Daniel
fe10c35464
Preserve search query for "Swap from" and "Swap to" form fields, update content (#15758) 2022-09-08 11:31:56 -05:00
Brad Decker
0d862d4032
upgrade jest (#15642) 2022-08-23 15:13:02 -05:00
Daniel
0cbff07b61
Remove unnecessary event props, update STX controller version (#15653)
* Remove unnecessary event prop
* Update STX controller version
* yarn yarn-deduplicate
2022-08-19 22:27:49 +02:00
Niranjana Binoy
d09bdbe3df
the token detction change affected swap performace, this is fixing it (#15607) 2022-08-17 11:38:06 -05:00
Daniel
b27672bd0e
Redirect a user to the Activity tab after they click on "View in Activity" (#15620) 2022-08-17 17:37:01 +02:00
George Marshall
0cb6fd1202
Updating Box to remove color prop default (Fixes develop) (#15613) 2022-08-17 06:02:26 -07:00
John Brennan
82368e7451
Rename some events (#15543)
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2022-08-16 11:39:23 -05:00
George Marshall
28440ba0d0
Adding initial and transparent to Box component (#15565)
* Adding inital and transparent to Box component. Removing deprecated secondary colors

* Fixing prop type

* Fixing story

* removing duplicate prop
2022-08-12 15:14:59 -07:00
Daniel
2eb0fe6978
Add more tracking for MetaMask (#15462) 2022-08-11 19:33:33 +02:00
George Marshall
092189cb5b
Adding polymorphic 'as' prop to Box component and updating Typography component to use the same (#15518)
* Adding polymorphic as prop to Box component

* Updating Typography component to use 'as' as the polymorphic prop instead of 'tag'

* Fixing linting
2022-08-10 12:42:42 -07:00
Niranjana Binoy
94f46fbb1e
Using Object.values for shuffle token list for swaps (#15530) 2022-08-10 15:10:41 -04:00
Niranjana Binoy
6e5c2f03bf
Token detection V2 Flag Removal and Re-introducing the use of legacy token list when token detection is OFF (#15138)
* addding the legacy tokenlist, tuning token detection OFF by default, adding new message while importing tokens

updating the controller version and calling detectNewToken on network change

fixing rebase error

Run yarn lavamoat:auto for updating policies

updating lavamoat

Deleted node modules and run again lavamoat auto

fixing rebase issues

updating lavamoat policies

updating lavamoat after rebasing

policies

updating custom token warning and blocking detectedtoken link when tpken detection is off for supported networks

to update the token in fetchTosync

updating the contract map object

Revert build-system lavamoat policy changes

Move token list selection logic from components to getTokenList selector

updating the tokenList

Update lavamoat

Fix error

updating lavamoat

lint fix

fix unit test fail

fix unit test fail

lint fix

fixing rebase locale error

rebase fix

Revert build-system policy changes

temp

addressing review comments

* rebase fix
2022-08-09 22:56:25 -02:30
Tommaso Maioli
d21a8a1cfb
docs: addition of controls and readme in SelectQuotePopover story (#15187)
* docs: addition of controls and readme in SelectQuotePopover story

* Content update

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2022-08-09 16:48:48 -05:00
Daniel
d255fcdefb
Only check if a user has enough token balance before calling STX (#15218) 2022-08-09 12:56:52 -05:00
George Marshall
0692f7bf25
Updating content to sentence case and updating tests (#15285) 2022-08-08 12:01:38 -07:00
George Marshall
cdc0fed828
Update media query instances (#15068) 2022-08-04 09:03:02 -05:00
Brad Decker
c72199a1a6
update prettier (#15360) 2022-07-31 13:26:40 -05:00
Daniel
f31bac9fbf
Performance improvements for Swaps (#15359) 2022-07-28 15:56:15 +02:00
Nidhi Kumari
7424e98416
Updated all instances of "Component API" to "Props" in storybook documentation (#15324)
* replaced Component API with Props

* replaced Component API with Props in DOCUMENTATION.stories.mdx

* removed base avatar component
2022-07-27 00:22:40 +05:30
Brad Decker
1db0ee87ec
Update Eslint and deps (#15293) 2022-07-26 13:10:51 -05:00
Nidhi Kumari
2e6f579ee5
Converted BuildQuote story to use controls and action argType (#15234)
* added build quote component

* fixed updated test-data to use Rinkeby instead of ropsten
2022-07-22 12:14:35 +05:30
George Marshall
5592687df1
Updating design tokens package and shadow values with new tokens (#15264)
* Updating design tokens v1.8 and shadows

* Adding missing stories

* Some fixes and updates to css and stories

* removing unneeded story

* Fixing story order
2022-07-21 15:43:31 -07:00
George Marshall
05a20bb721
Add responsive props to Box component (#15106)
* Adding responsive props to Box component

* Updating margin array prop instances

* Updating padding array prop instances

* Updates to docs, tests and margin, padding instances

* Optimizing class name object

* Simplifying single value logic

* replacing for loop with switch statement

* Memoizing generateClassNames function
2022-07-20 13:47:51 -07:00
Alex Donesky
09164dcabb
Bump controllers v30.0.2 (#14906)
* bump @metamask/controllers to v30.0.2 and adapt
2022-07-18 09:43:30 -05:00
Daniel
2744eaf760
Update the "results" state if "initialResultsState" array length is different (#15270) 2022-07-18 16:30:36 +02:00
Daniel
75ac87e487
Show a block explorer URL hostname, hide token import if block explorer URL is not available (#15198) 2022-07-13 18:42:50 +02:00
Daniel
8cbfa2ea9e
Show a tx link and the "create a new swap" link for STX (#14995) 2022-07-11 17:53:07 +02:00
Daniel
5fa88bebce
Show how much a cancellation of a smart transaction will cost (#15011) 2022-06-22 18:58:51 +02:00
George Marshall
051254dffd
Fixing tooltip theming by enforcing default theme (#14992)
* Fixing tooltip theming by enforcing background color

* Removing wide prop
2022-06-21 09:50:44 -07:00
daniba
085126d275
Move search icon and add to storybook (#14940)
* move search icon || update imports || add to story

* Optimized svg path, updated icon api and updating colors

* update other icons

* update snapshot

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2022-06-21 10:18:35 -05:00
Daniel
ebf967562b
Remove experimental gas editing for Swaps (#14942) 2022-06-15 21:08:13 +02:00
Jordon
f5c6d0054f
Convert knobs and actions to controls/args for MainQuoteSummary (#14758)
Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2022-06-15 10:43:26 -05:00
Daniel
b0557daa05
Handle an RPC provider delay in Swaps (#14821)
* Return an estimated amount for a completed swap if an RPC provider has a delay

* Create a recursive function for updating post tx balance

* Add a few tests for the "getSwapsTokensReceivedFromTxMeta" fn

* Trigger Build
2022-06-08 16:32:04 +02:00
Daniel
9705531671
Reduce the default slippage from 3% to 2% (#14863) 2022-06-07 18:28:59 +02:00
Daniel
bd5d47993d
Make content changes for the STX status page, remove old content (#14805) 2022-06-07 15:42:25 +02:00
Daniel
6dbb2c4ded
Migrate the "estimateGas" API call to "getFees" for STX (#14767) 2022-05-26 19:56:28 +02:00
George Marshall
8fcbebc546
Update design tokens library from 1.5 to 1.6 WIP (#14732)
* Updating account menu icon color

* Updating design-tokens and making appropriate updates to extension styles

* Adding more deprecated tags to colors

* Adding spinner and removing todo comment

* Remove comment

* Updates

* Updating snapshots

* More color and ui updates

* reverting transition change
2022-05-25 08:35:36 -07:00
Daniel
f6576801d4
Fix an edge case with missing top assets in Swaps (#14688)
* If there is no array of top assets in a response, use an empty array

* Set a default empty array for 2 functions, remove an unnecessary condition

* Redirect a user from Swaps to the homepage if they switch to a chain that is not supported in Swaps

* Fix errors in the UI Console when it's not a swaps chain
2022-05-24 18:30:46 +02:00
Thomas Huang
11831c6ae5
Add hideEstimatedGasFee prop to sort-list and select-quote-popover tests (#14725) 2022-05-19 10:43:31 -07:00
Daniel
d305dcba9d
Change styles for the high price impact notification in Swaps (#14697) 2022-05-12 19:57:05 +02:00
Daniel
9a153d2388
Remove gas editing in Swaps (#14673)
* Remove gas editing in Swaps

* Remove "extraApprovalGas"
2022-05-11 20:30:03 +02:00
Daniel
2bd7127433
Swaps / STX improvements (#14622) 2022-05-09 18:48:14 +02:00
Daniel
9daab6aa59
Disable STX if a regular tx is in progress (#14554)
* Disable STX if a regular tx is in progress

* disableStxIfRegularTxInProgress : early return

* Fix UTs

* Trigger Build
2022-05-03 17:55:41 +02:00
Ariella Vu
78f4684b2a
MetaMetrics: Add EVENT.CATEGORIES const (#14474)
* MetaMetrics: add EVENT.CATEGORIES const

* MetaMetrics: add EVENT.CATEGORIES.INPAGE_PROVIDER

* MetaMetrics: add EVENT.CATEGORIES.AUTH

* MetaMetrics: add EVENT.CATEGORIES.ACCOUNTS pt. 1

* MetaMetrics: add EVENT.CATEGORIES.ACCOUNTS pt. 2
confirm we want to use 'Accounts' instead of 'Account'

* MetaMetrics: add EVENT.CATEGORIES.MESSAGES

* MetaMetrics: add EVENT.CATEGORIES.RETENTION const

* MetaMetrics: add EVENT.CATEGORIES.SETTINGS

* MetaMask: add missing EVENT.CATEGORIES.SNAPS

* MetaMetrics: add EVENT.CATEGORIES.WALLET const

* MetaMetrics: add EVENT.CATEGORIES.ONBOARDING const

* MetaMetrics: add EVENT.CATEGORIES.ONBOARDING
& EVENT.CATEGORIES.TRANSACTIONS consts

* MetaMetrics: use EVENT.CATEGORIES

* ducks/swaps: revert slice name

* MetaMetrics: add missing EVENT.CATEGORIES.NETWORK
2022-04-22 13:09:10 -03:00
Daniel
eed6ae2b8c
Swaps: Sort "token_from" dropdown tokens by their fiat value first and "token_to" by top tokens (#14436) 2022-04-15 14:57:58 +02:00
George Marshall
9ce966ba1d
Storybook housekeeping 🧹 (#14331)
* Removing argTypes that are related to static props and don't have anything to do with the component. Also some general house keeping

* updates
2022-04-07 08:14:22 -07:00
Daniel
fc17fbe1ad
Swaps timer improvements, optional refresh rates and fix for a notification UI (#14300)
* Set up correct timer value for fetching new quotes

* Show red timer in Swaps if quotes fetching will happen in less than 10s (previously it was 30s)

* Fix a UI issue with the notification close button

* Make stx refresh rates optional, since not every network supports them
2022-04-04 15:14:50 +02:00
George Marshall
dfd3e233e8
color fix for hover on swaps quote (#14334) 2022-04-02 06:40:33 -07:00
filipsekulic
8cb1f4af2e
Renamed metametrics.new.js to metametrics.js (#14327) 2022-04-01 14:11:12 -05:00
Pieter Tolsma
cb1890d928
Convert knobs and actions to controls/args for CountdownTimer (#14222)
Co-authored-by: Pieter Tolsma <pietertolsma@Pieters-MacBook-Air.local>
2022-03-31 13:31:31 -05:00
George Marshall
4bb2582200
Swaps select quote highlight fix (#14270) 2022-03-31 08:58:09 -05:00
David Walsh
00025afe4c
Dark Mode: Remove unwanted background for price quote (#14278) 2022-03-30 15:42:18 -07:00
David Walsh
9d7f4d2005
Ensure proper color for swaps edit link (#14273) 2022-03-30 14:54:25 -07:00
ryanml
085c9753de
Ensure Metafox follows cursor on Fetching quotes screen (#14261) 2022-03-30 10:54:01 -07:00
BoxedFruits
950de390b3
GasModalPageContainer story: convert knobs and actions to controls / args (#13516) 2022-03-30 08:46:37 -05:00
Daniel
69d7c51c56
Show STX switch for wrapping / unwrapping (#14225) 2022-03-30 10:02:55 +02:00
Jurriaan Den Toonder
1521e63913
Change over FeeCard stories to use controls instead of knobs, update props in stories (#13766)
This PR changes over the deprecated knobs and actions in `fee-card.stories.js` to controls.
I attempted to create a `README.mdx`, but unfortunately the `<ArgsTable of={FeeCard} />` refused to render out any of the documentation comments I added to the `FeeCard.propTypes`, thus that has not been included (and no documentation has been added to the propTypes of FeeCard).

_Please note:_ currently nested arg types are not possible in StoryBook, but discussions are open: https://github.com/storybookjs/storybook/issues/11486. This means that the StoryBook shows `primaryFee`, `primaryMaxFee`, `secondaryFee` and `secondaryMaxFee`, but these are mapped to the 2 `primaryFee` and `secondaryFee` props of the component. This is visible if the developer clicks on the `Show code` button at the docs page in StoryBook.

Signed-off-by: Jurriaan Den Toonder <1493561+Fastjur@users.noreply.github.com>
2022-03-29 16:13:00 -06:00
Daniel
7cb22bd883
metaMetricsEvent -> trackEvent (#14249) 2022-03-29 19:19:40 +02:00
Guillaume Roux
a3ab204d11
Dark Mode: Fix some colors (#14228)
* fix some colors

* fix test and address requested changes

* address requested changes
2022-03-28 10:23:27 -07:00
Guillaume Roux
a7ac83f9d3
Dark Mode: Swap hex colors in ui/pages (#14214)
* swap hex colors in ui/pages

* update snapshots
2022-03-25 15:15:31 -07:00
Guillaume Roux
57818fabbe
Dark Mode: Remove ui colors (#14184) 2022-03-25 10:07:47 -05:00
George Marshall
729e89015f
Dark mode: search icon (#14201) 2022-03-25 15:22:56 +01:00
VSaric
5564176d72
Remove usages of useNewMetricEvent hook (#13955) 2022-03-25 08:21:29 -05:00
George Marshall
fd36eea443
Dark mode: Updating all left over static hex values in scss (#14167) 2022-03-24 19:08:08 +01:00
David Walsh
065d525d58
Dark Mode: Remove --ui-white (#14162) 2022-03-24 15:13:26 +01:00
Daniel
4c16b583c3
Improvements for Smart Transactions / Swaps (#14022)
- Don’t call /estimateGas if a user doesn’t have enough funds
- Hardcode block explorer URLs for Swaps
- Track the "stx_prev_user_opt_in" param
- Add fee estimates tracking for regular txs and STX
- Track estimated_gas and estimated_vs_used_gasRatio for STX
- Only track the "Error Smart Transactions" event once
- Don't overwrite "maxGasLimit" for STX on the View Quote page for better "balance needed" estimations
- Update description for Transak
- Fix styles for the input field on the Build Quote page
- Refactor variables for STX error types and add translation for each STX error type
- Do additional logging for the "current_stx_enabled" param
- Add a close icon for an STX notification, update STX content
2022-03-23 20:28:26 +01:00
George Marshall
386a760285
Dark mode: Updating arrows icon in build quote (#14155) 2022-03-23 12:07:29 -07:00
Guillaume Roux
8683282a6f
Dark Mode: Replace color occurences (#14112) 2022-03-23 16:43:53 +01:00
George Marshall
3d3670e807
Dark mode: Replacing svg image with font awesome icon for main-quote-summary (#14137) 2022-03-23 16:25:28 +01:00
David Walsh
063b9e3b25
Dark Mode: Fix Import Token Styles (#14099) 2022-03-22 11:21:32 -07:00
David Walsh
3f761ecd8c
Remove dead CSS code from Swaps (#14084) 2022-03-21 14:11:11 -07:00
David Walsh
a79d3eb928
Dark Mode: Select Quote Popover (#14054) 2022-03-21 08:33:22 -05:00
Daniel
95f830438a
Add a new fiat onboarding option via MoonPay (#13934) 2022-03-21 10:26:52 +01:00
David Walsh
79d00f72e1
Dark Mode: Update swaps link colors (#14033) 2022-03-18 13:07:07 -07:00
Alex Donesky
e3ea4f2cd0
Fix issue where we show contract address as recipient when calling safe transfer method on erc721 or erc1155 contracts (#13535)
* fix issue where we show contract address as recipient when calling safe transfer method on erc721 or erc1155 contracts

* updates function name getTransactionData -> parseStandardTokenTransactionData, and adds documentation
2022-03-17 13:35:40 -05:00
David Walsh
9373f51e97
Dark Mode: Swaps Colors (#13976) 2022-03-17 13:04:01 -05:00
Mark Stacey
c7fabbff87
Add data-test-id prop to TextField component (#13973)
The `data-test-id` prop has been added to `TextField`. This prop allows
selecting this component more easily from e2e and unit tests. This is
required for a subsequent PR that includes a text field that cannot be
selected for by placeholder or contents or label (any of which would
have been preferable).
2022-03-15 20:42:37 -02:30
Daniel
5aff1863ca
Improve slippage input validation in Swaps (#13914)
* Improve client-side validation for the slippage input

* Improve validation of the slippage input field

* Use Number instead of toNumber
2022-03-14 15:41:03 +01:00
George Marshall
fa4d884a87
Find and replace of all typography colors to design tokens (#13885) 2022-03-09 07:24:53 -08:00
Brad Decker
9cea401022
extract determineTransactionType from tx controller (#13737) 2022-03-07 12:54:36 -06:00
Olusegun Akintayo
6d54897cfb
Fixed these issues in v10.11.0 (#13806)
After landing on Swap, a disclaimer of Smart Transactions appear, and an error on devTools shows the following: “invalid prop ‘type’ of value ‘ul’” supplied to ‘Typography’
    After enabling Smart Transactions, an error on devTools shows the following: “invalid prop ‘smartTransactionsOptInSatus’ of type ‘boolean supplied to ‘SlippageButtons’

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-03-02 19:59:31 +04:00
Daniel
42fd5d19f4
Content and UI updates for the STX modal (#13798)
* Update content and UI for STX modal

* Update the main header image for STX

* Capitalize Smart Transactions in the button label
2022-03-01 19:18:20 +01:00
Guillaume Roux
23e6c073c4
Dark Theme setup and button theming (#13651)
* Add design-tokens and apply colors to button

* swap more colors

* tweak button and add dark theme switch to storybook

* tweak buttons

* fix typo

* remove comments

* add dep to ignored list

* fix linting issue

* fix linting issues

* Updating some styles and removing some deprecated buttons (#13742)

* Updating some styles and removing some deprecated buttons

* Warning button fixes

* Fixing warning text for darkmode

* bump design tokens and update storybook theme strategy

Co-authored-by: George Marshall <george.marshall@consensys.net>
2022-02-25 14:11:22 -08:00
Daniel
6dd141ebfd
Small fixes for Swaps (#13732)
* Fix: Insufficient number of substitutions for key "stxSuccessDescription"

* Only calculate "approvalGas" if the "approvalNeeded" param is truthy in a quote

* "Swap from" has to be set to enable "Review Swap", set a default token for "Swap from"

* Fix: Unable to find value of key "undefined" for locale

* Use array destructuring
2022-02-23 22:10:28 +01:00
fadnesscharlie
3d5da527f9
Added Controls and Action ArgType, took out @storybook/addon-knobs (#13660)
* added controls and took out unused code

* Fix Lint Issues
2022-02-21 08:13:11 -06:00
Daniel
2585f45bde
Add support for Smart Transactions (#12676) 2022-02-18 17:48:38 +01:00
Daniel
120603e6df
Enable Avalanche for Swaps (#13653) 2022-02-18 15:24:47 +01:00
Daniel
cbf8a737dc
Change "Quote X of Y" to "Fetching quote X of Y" (#13663)
* Change "Quote X of Y" to "Fetching quote X of Y"

* Update a test

* Trigger Build
2022-02-17 17:08:53 +01:00
Jyoti Puri
760ed3457d
Removing EIP_1559_V2 feature flag (#13481) 2022-02-03 05:58:28 +05:30
Jyoti Puri
cc1861a34e
Adding metrics events for EIP-1559 V2 flow (#13329) 2022-02-01 23:23:03 +05:30
thickforest
fd46f97e35
Fix className misspelling in awaiting-swap.js 2022-01-27 14:47:25 -06:00
Jyoti Puri
5b5b2cd7df
Fixing warnings in unit test cases (#13349) 2022-01-20 00:04:22 +05:30
Jyoti Puri
88faef7e19
Adding user setting option for EIP-1559 V2 (#13242) 2022-01-12 00:47:56 +05:30
Alex Donesky
4826c8c95e
Feat/collectibles send flow (#13048)
* Add collectibles send flow
2022-01-10 10:23:53 -06:00
Mark Stacey
3732c5f71e
Add JSDoc ESLint rules (#12112)
ESLint rules have been added to enforce our JSDoc conventions. These
rules were introduced by updating `@metamask/eslint-config` to v9.

Some of the rules have been disabled because the effort to fix all lint
errors was too high. It might be easiest to enable these rules one
directory at a time, or one rule at a time.

Most of the changes in this PR were a result of running
`yarn lint:fix`. There were a handful of manual changes that seemed
obvious and simple to make. Anything beyond that and the rule was left
disabled.
2022-01-07 12:27:33 -03:30