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

307 Commits

Author SHA1 Message Date
Dan J Miller
efaaf4fab2
Use tokenList to get token details, when available, in getTokenStanda… (#17891)
* Use tokenList to get token details, when available, in getTokenStandardAndDetails

Previously, every call to getTokenStandardAndDetails would fetch data via the provider.
This would result in at least 3 network requests whenever that method is called for an
ERC20 token, contributing to unneccesary loading and lagging in multiple places.
This commit takes advantage of stored data we already have available to avoid the unnecessary
loading.

* Lint fix

* Fix build-quote test

* bump coverage targets

* Pass provider to token-util, for use in ethers Contract module

* Check all possible sources of ERC20 token data before async call to assetsContractController

* Add and update tests

* Update app/scripts/metamask-controller.js

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* Update app/scripts/metamask-controller.js

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* Remove unnecessary this.ethQuery changes

* Use metamask-eth-abis instead of human-standard-token-abi in token-util.ts

* Add explanatory comments to getTokenStandardAndDetails

* lint fix

* Cleanup

* fix test

* Update app/scripts/metamask-controller.js

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* update error message

---------

Co-authored-by: Alex Donesky <adonesky@gmail.com>
2023-03-08 14:05:45 -03:30
Matthew Walsh
d0417da3d0
Move desktop code to flask build type (#17960) 2023-03-06 19:35:00 +00:00
micaelae
e77e20d8c4
Bridge tokens by redirecting to Portfolio from wallet overview page (#17952)
* Add Bridge button

* Add newline to the end of bridge svg

* Move Portfolio button

* Vertically center Portfolio button

* Use IconButton for Portfolio button

* Change portfolio button size

* Lowering coverage to get this in for release by a very small amount

* Add unit tests for Portfolio button

---------

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2023-03-06 11:34:06 -08:00
Vinicius Stevam
e07ec9dcf3
identify desktop is paired in the metrics event (#17892) 2023-03-02 14:55:27 -06:00
António Regadas
f9f215f20d
[MMI] Adds the MMI support link and the mmi_website link as well (#17853) 2023-03-02 10:19:20 -06:00
Albert Olivé
9ba0b50b9a
[MMI] Prevent multiple instances of MM at the same browser (#17856) 2023-03-02 10:17:45 -06:00
Alaa Hadad
5998ae21aa
Buy crypto by redirecting to onramp experience on pdapp instead of deposit popover (#17689)
* feat: disable deposit popover and replace it with global redirect to onramp on pdapp

* feat: remove legacy code for hardcoded onramp providers

* fix: remove unused visuals and components related to legacy code of deposit popover

* fix: remove unused messages

* feat: use a custom hook for all onramps related methods and variables

* fix: modify the custom hook implementation to include test networks

* fix: remove deprecated file buy-url

* fix: remove references for deleted deposit logos

* fix: network-controller failing unit test

* fix: snapshot loading-swaps-quotes-stories-metadata.test.js.snap

* fix: storybook tests

* fix: remove unused constatns related to buyable onramp chains

* fix: remove unused variables and fix eslint

* adding unit test for useRamps custom hook

* feat: add comment on the proper usage of useRamps within confirm-page-container component

* fix: add unit tests for buy button in token-overview page

* fix: add unit test for open the buy crypto URL for a buyable chain ID in token page

* feat: add unit test coverage for eth-overview page

* fix: update locales
2023-03-01 12:45:27 +04:00
Mark Stacey
2ccc1977bf
Update the PhishingController to v2 and update phishing warning page (#17835)
The PhishingController has been updated to v2. This release should
dramatically reduce network traffic and double the update speed of the
phishing list.

This was accomplished by combining both of our phishing configurations
into one list (the "stalelist"), then creating a separate list of the
changes just the past few days (the "hotlist"). Now users will download
a smaller list more frequently (every 30 minutes rather than every
hour), whereas the full list is only updated every 4 days.

The combined configuration means that we no longer know which list was
responsible for each block. The phishing warning page has been updated
to dynamically look this information up, to ensure users are still
directed to the correct place to dispute a block. This update to the
phishing warning page also includes the recent redesign.
2023-02-24 11:39:00 -03:30
João Tavares
bde74756d3
Add extension desktop UI (#17748)
* feat: add desktop enable button component

This component will be added
to the experimental page. Users
will then be able to initialize
a desktop connection

* feat: add desktop pairing page

* feat: add desktop deep-linking shared lib

* test: add initial entries to render helper

Allow specifying initialEntries for
MemoryRouter. This change will allow
testing pages that use the useParam
hook.

* feat: add desktop error page

Error page for any desktop pairing
related issue

* feat: add desktop routes to route component

* feat: add enable desktop button to experimental tab

* feat: add desktop icon when paired in dev mode

* feat: disable ledger live control when desktop enabled

* feat: register desktop error actions on ui init

* fix: add missing code fencing

* chore: remove enable desktop rpc middleware

Now that we are adding the UI
there's no need for this rpc middleware
(as it was used to test desktop background
code)

* fix: display experimental tab for desktop
2023-02-23 16:39:48 +00:00
Matthew Walsh
cc99a25228
Add desktop support (#17683)
Use DesktopManager in background script to redirect internal and external connections to the desktop app.
Include DesktopController in the MetaMask controller.
Support desktop keyrings in MetaMask controller via the overrides object.
Create middleware handler to connect to the desktop app while UI code is pending.
Add build system support for desktop specific configuration variables.
2023-02-20 17:13:12 +00:00
David Walsh
cf49761d71
Fix #17669 - Revise old metrics schema for Onboarding v2 (#17769) 2023-02-16 10:06:56 -06:00
Jyoti Puri
41e2c2beff
Change transaction type for send with approve transaction (#17777) 2023-02-16 20:22:59 +05:30
Brad Decker
52b3d58cc3
adds test and fix for conversion to use numeric (#17758) 2023-02-15 10:26:32 -06:00
Guillaume Roux
ccde54937f
Pass excludedPermissions to SnapController (#17321)
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
2023-02-15 11:09:47 +01:00
tgmichel
3a00b5ab54
Additional incoming transactions support (#14219) 2023-02-14 12:35:42 -06:00
Olusegun Akintayo
6b64572f8d
Fix for error during sending to multisig address (#17651) 2023-02-09 10:49:39 -06:00
Sam Gbafa
53205b6bff
Detect and track UI customizations on Personal Sign Requests (#16222)
* detect and track ui customizations on personal sign requests

* add feature flag check to metrics

* clean up comments

* get data only if it exists

* updated with PR feedback

* moved constants

* lint

* Apply suggestions from code review

Co-authored-by: Ariella Vu <20778143+digiwand@users.noreply.github.com>

---------

Co-authored-by: Ariella Vu <20778143+digiwand@users.noreply.github.com>
2023-02-08 22:16:17 +07:00
Maarten Zuidhoorn
1d5030af97
Add hardcoded list of human-readable snap derivation paths (#17627)
* Add hardcoded list of human-readable snap derivation paths

* Fix formatting

* Update policies
2023-02-06 21:49:56 +01:00
aleksandar-mihajlovic
d63014a360
Added metric Phishing Page Displayed for phishing warning page (#17462) 2023-02-06 11:06:38 -06:00
Maarten Zuidhoorn
8cda817f5c
Add hardcoded list of human-readable snap names (#17595)
* Add hardcoded list of human-readable snap names

* Make the text properly bold

* Small style fixes to approval screen

* Run yarn lint:fix

* Update snapshots
2023-02-06 11:05:57 +01:00
Brad Decker
c1f9c778c9
Add error module for safely handling errors (#17511)
Co-authored-by: Danica Shen <zhaodanica@gmail.com>
2023-02-02 13:30:57 -06:00
Brad Decker
aededb1c71
Convert confirm-tx.utils.js to typescript (#17349) 2023-02-02 12:35:05 -06:00
Brad Decker
d9275bb1c1
Fixing/extending type definitions for later usage (#17514) 2023-02-01 11:53:21 -06:00
Brad Decker
6e7f5c3e21
Move THEME_TYPE to new preferences.ts file (#17515) 2023-01-31 17:49:00 -06:00
Danica Shen
2958d68af8
feat(mme-17214): migrate L33 files to typescript (#17372) 2023-01-31 12:01:10 +00:00
Danica Shen
c23bd4925b
feature: convert level 32 files to typescript (#17390) 2023-01-27 18:28:03 +00:00
Danica Shen
787add7c70
feature: convert shared/modules/contract-utils.test.js to typescript (#17435) 2023-01-26 17:59:49 +00:00
Brad Decker
f29683cc0a
Complete level 36 migration of TypeScript by converting conversion.utils.js and deprecate old conversion util (#17262) 2023-01-24 12:49:26 -06:00
Danica Shen
f5426a84d9
feat(mme-17212): convert shared/constants/swaps.js -> Typescript (#17322) 2023-01-24 16:38:01 +00:00
Maarten Zuidhoorn
2900fe2c1a
Move subject type enum to @metamask/subject-metadata-controller (#16431)
* Move subject type enum to @metamask/controllers

* Fix imports
2023-01-24 16:03:01 +01:00
Brad Decker
3ff12d70e9
Replace usages of conversion util in rest of UI folder in favor of Numeric (#17334) 2023-01-24 08:44:49 -06:00
amerkadicE
dd09245ff6
Fix/use etherjs specific imports (#15461)
* replace ethers with submodules

Co-authored-by: Alex <adonesky@gmail.com>
2023-01-24 08:10:36 -06:00
Brad Decker
ead1446c98
Refactor usages of conversion util in the app folder and shared folder in favor of Numeric (#17331) 2023-01-23 11:41:01 -06:00
Vladimir Saric
f988dc1c5e
Enable the Token Allowance flow by default for all users (#16740) 2023-01-23 21:49:55 +05:30
Brad Decker
af83e120dc
Convert app//scripts/lib/util.js to typescript (#17330) 2023-01-23 10:18:22 -06:00
Brad Decker
a9ef2a049a
add numeric module (#17324) 2023-01-20 15:16:56 -06:00
Danica Shen
b310c6dcca
feat(mme-17212): convert shared/module/string-utils.js -> Typescript (#17320) 2023-01-20 17:40:48 +00:00
Brad Decker
92f6ea6f6b
Relocate conversion utils to shared/modules/conversion.utils.js (#17319) 2023-01-20 11:04:37 -06:00
ryanml
a19a5d60d3
Convert shared/constants/hardware-wallets.js -> Typescript (#17310) 2023-01-20 09:14:40 -06:00
ryanml
5c087d6313
Convert shared/constants/labels.js -> Typescript (#17309) 2023-01-20 08:02:09 -06:00
Brad Decker
5f6d2ba6b0
Convert Transaction constants to typescript (#17149) 2023-01-18 08:47:29 -06:00
Vladimir Saric
c82c967c46
Fixing error when user input some letter in token allowance flow (#17117)
* Fixing error when user input some letter in token allowance flow

* Rename the regex variable name and added a brief comment above its definition

Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
2023-01-18 10:53:10 +01:00
Niranjana Binoy
a0bb4a6c5a
Toggle option to enable/disable balance and Token rate checking for using third-party API (#16772) 2023-01-17 10:23:04 -05:00
Vladimir Saric
3c38ff3899
Validating or restricting the number of digits on token allowance flow (#17234)
* Validating or restricting the number of digits after the decimal point that the user can enter and styles for Max button and description with error message

* Use better solution for validation the number of digits on token allowance flow
2023-01-16 14:11:46 -03:30
David Walsh
72a1df247c
Onboarding v2: Implement requested metrics (#17090) 2023-01-13 10:11:27 -06:00
Brad Decker
dff3da9cbd
Convert hexstring-utils to typescript (#17150)
* allow importing of typescript in E2E test suite

* fixup

* one last chainId

* convert hexstring-utils file to typescript

* use ts-node for scripts
2023-01-12 10:07:30 -07:00
Adnan Sahovic
fbbc1df853
Display large and small numbers as decimals instead of scientific notation on token allowance confirmation screens (#16676)
Co-authored-by: VSaric <vladimir.saric@consensys.net>
Co-authored-by: Vladimir Saric <92527393+VSaric@users.noreply.github.com>
2023-01-05 08:58:16 -06:00
Olusegun Akintayo
13de51e748
Security and Privacy Settings Re-org (#16756) 2022-12-19 18:46:36 +01:00
Adnan Sahovic
34b1595f29
Add Celo to the popular custom network list (#16745) 2022-12-07 14:13:37 -06:00
Daniel
7f50febfcd
Ensure 0% slippage on Arbitrum for wrapping / unwrapping (#16778)
* Contract addresses to lowercase

* Use case insensitive checks in the shouldEnableDirectWrapping fn

* Remove duplicated functions, move unit tests into the right location
2022-12-06 10:44:09 -06:00