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

994 Commits

Author SHA1 Message Date
Filip Sekulic
365bf11fdd
New network info popup (#13319) 2022-08-23 10:04:07 -05:00
Maarten Zuidhoorn
a52c6a4908
[FLASK] snaps-skunkworks@0.19.0 (#15619)
* Bump snaps-skunkworks to 0.19.0

* Improve snap_getBip32Entropy UI

* Remove console.log

* Update LavaMoat policy

* Dedupe Yarn lock

* Update LavaMoat policy again

* Fix tests

* Update policies and e2e tests

* Update policy again

* Update iframe-execution-environment

* Dedupe yarn.lock

* Update snapshots

* Fix PR comments

* Add TODO

* Trigger CI
2022-08-18 17:07:34 +02:00
Jyoti Puri
d2fc5ecc3e
Make add new account idempotent operation (#15566) 2022-08-16 11:42:00 +05:30
Daniel
2eb0fe6978
Add more tracking for MetaMask (#15462) 2022-08-11 19:33:33 +02: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
Olusegun Akintayo
4f34e72085
3box Replacement (#15243)
* Backup user data

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Tests for prependZero (utils.js)

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix advancedtab test

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

backup controller tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Backup controller don't have a store.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Restore from file.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Advanced Tab tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fix

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

e2e tests for backup
unit tests for restore.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix comments on PR.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

restore style

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

We should move the exportAsFile to a utility file in the shared/ directory

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Move export as file to shared folder

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Refactor create download folder methods

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Move the backup/restore buttons closer to 3box

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Change descriptions
Add to search

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

refactor code to use if instead of &&

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Restore button should change cursor to pointer.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix restore not uploading same file twice.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Do not backup these items in preferences
    identities
    lostIdentities
    selectedAddress

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Only update what is needed.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Fixed test for search

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* remove txError as it currently does nothing.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Remove dispatch, not needed since we're not dispatching any actions.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Event should be title case.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Make backup/restore normal async functions
rename event as per product suggestion.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Use success Actionable message for success message and danger for error
message

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* change event name to match with backup

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* lint fixes
Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* fix e2e

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-08-09 19:36:32 +01:00
Daniel
d255fcdefb
Only check if a user has enough token balance before calling STX (#15218) 2022-08-09 12:56:52 -05:00
Mark Stacey
42c8703f3e
Add comments about legacy streams (#15492)
Two comments have been added to reference a longer explanation of what
the legacy provider streams are, why we still have them, and why we
want to remove them.
2022-08-05 16:52:07 -02:30
Hassan Malik
a7179a6b88
[FLASK] Add update snap UI (#15143)
* added snap-update folder

* addded update route, snap update component, updated permissions connect components

* added actions and selectors

* updated permissions selectors and updated permissions connect container to have update snap logic

* updated translations, added selector, updated request object

* updated translations, added update snap permission list component

* more fixes

* added CSS, redid some HTML

* lint fixes

* Add missing grantPermissions action

* updated button padding

* fixes

* removed prop type

* fix Update & Install wrapping

* made changes for forthcoming snap controller PR

* removed ununsed imports

* updated css

* re-added padding rule and removed unused translation messages

* addressed comments

* add subtext for new permissions

* lint fix

* removed unused translations

* some more changes

* fix e2e tests

* lint fix

* added in delay for e2e tests

* Revert "added in delay for e2e tests"

This reverts commit 095962a2c0c9de0b0b343d3134bb0787044dd8ce.

* fixed routing logic

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Guillaume Roux <guillaumeroux123@gmail.com>
2022-08-03 12:02:44 -04:00
Brad Decker
c72199a1a6
update prettier (#15360) 2022-07-31 13:26:40 -05:00
Dan J Miller
aea5c5824f
Clean up of code introduced with 43f7a44 (#15158) 2022-07-27 15:19:05 -05:00
Frederik Bolding
8a550ce003
[FLASK] Fix missing snap hook (#15354) 2022-07-27 16:49:57 +02:00
Brad Decker
652d631cda
remove exclusions for mismatched object jsdoc type casing (#15351) 2022-07-27 08:28:05 -05:00
Brad Decker
1db0ee87ec
Update Eslint and deps (#15293) 2022-07-26 13:10:51 -05:00
Alex Donesky
8536c86ed5
Improve tokenId parsing and clean up useAssetDetails hook (#15304) 2022-07-23 09:37:31 -05:00
Hassan Malik
e280204287
[FLASK] Add snap update metrics (#15206)
* added snap update metrics

* fixed update event
2022-07-22 10:08:43 -04:00
Frederik Bolding
1ec190bd8c
[FLASK] snaps-skunkworks@0.18.1 (#15230)
* snaps-skunkworks@0.17.0

* Handle breaking changes

* Fix import

* Fix blocklist implementation

* snaps-skunkworks@0.18.0

* Fix lint

* Update LavaMoat policy

* Update iframe-execution-environment

* snaps-skunkworks@0.18.1

* Bump iframe-execution-environment

* Update LavaMoat policy
2022-07-19 17:41:06 +02:00
Alex Donesky
d92936475a
Fix default currency symbol for wallet_addEthereumChain + improve warnings for data that doesn't match our validation expectations (#15201)
* set more appropriate default for ticker symbol when wallet_addEthereumChain is called

* throw error to dapp when site suggests network with same chainId but different ticker symbol from already added network, instead of showing error and disabled notification to user
2022-07-18 10:59:38 -05: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
Alex Donesky
4993d28a8f
Only send the rpc origin to segment when calling trackevent for newly added custom networks (#15227) 2022-07-15 12:08:44 -05:00
Filip Sekulic
7246058797
Added metrics for adding a new network (#15176)
* Added metrics for adding a new network

* Applied requested changes

* Added missed changes
2022-07-13 11:47:13 -02:30
Filip Sekulic
43f7a44c25
Adding popular custom network integration (#14557)
* Initial push

* Refactored the code

* Additional code

* Removed the unused message

* Added a tooltip

* Fixed tests

* Lint fix

* Added style to a tooltip

* Fix e2e test failure

* Lint fix and code revert

* Fix e2e test

* Fixed paddings

* Fixed paddings

* CSS fix

* Minified svg files

* Applied requested changes

* Fixed theme issue

* Code revert

* Added back overridden code

* Icon problem fixed

* Lint fix

* Replaced H3 with H4

* Added unit test

* Added breadcrumbs

* Added const props for networks

* Lint fix

* Lint fix

* Added toggle button for showing the custom network list and resolved few issues

* Fixed routes

* Refactored a piece of code

* Enabled searching for the newly created option

* Fixed unit test

* Updated theme
2022-06-30 13:49:07 -02:30
Dan J Miller
ac7245b50c
Destroy ledger keyring when removing last account in ledger keyring (#14993)
* Destroy ledger keyring when removing last account in ledger keyring

* Update unit tests
2022-06-21 16:33:54 -02:30
Frederik Bolding
82645ba516
[FLASK] snaps-skunkworks@0.16.0 (#14952)
* snaps-skunkworks@0.16.0

* Bump iframe-execution-environment

* Add getAppKey

* Regen LavaMoat policy

* Bump test-snaps
2022-06-20 10:13:12 +02:00
Erik Marks
b491367632
[FLASK] Rename workerController to snapExecutionService (#14981)
Renames the `MetaMaskController.workerController` property to `snapExecutionService`, which better matches the naming scheme used throughout the Snaps codebase. No functional changes.
2022-06-19 10:15:02 -07:00
Mark Stacey
43bd885be7
Merge pull request #14840 from MetaMask/master-sync
Sync `master` with `develop`
2022-06-03 14:34:06 -02:30
George Marshall
87bba78d1f
Updating all instances of Metamask to MetaMask in content, comments and tests (#14848) 2022-06-03 09:32:50 -07:00
Mark Stacey
e6d5af5f9a Merge remote-tracking branch 'origin/develop' into master-sync
* origin/develop: (131 commits)
  Update `protobufjs` and remove obsolete advisory exclusion (#14841)
  Include snap version in pill (#14803)
  Update PULL_REQUEST_TEMPLATE.md (#14790)
  fix: keystone transaction qrcode has no white spacing (#14798)
  Snap notifications integration (#14605)
  Upgrade @metamask/eth-ledger-bridge-keyring (#14799)
  snaps-skunkworks@0.15.0 (#14772)
  Fix proptype errors in network dropdown, tx list item details, and account details modal tests (#14747)
  Ensure transaction type is correctly updated on edit (#14721)
  Add fiat onboarding for AVAX and MATIC through Wyre (#14683)
  Bump @metamask/contract-metadata from 1.33.0 to 1.35.0 (#14791)
  Slight cleanup of constants/transactions, useTransactionDisplayData, and TransactionIcon (#14784)
  Migrate the "estimateGas" API call to "getFees" for STX (#14767)
  Ignore advisory GHSA-wm7h-9275-46v2 (#14789)
  Adding flag for MV3 (#14762)
  Add types to send state (#14740)
  Remove site origin on snap install (#14752)
  Update design tokens library from 1.5 to 1.6 WIP (#14732)
  Enables the "Safe Transaction From" copy for safeTransferFrom transactions (#14769)
  remove draft transaction (#14701)
  ...
2022-06-03 11:53:40 -02:30
Mark Stacey
cf5db650fe Merge remote-tracking branch 'origin/master' into Version-v10.14.7
* origin/master: (101 commits)
  Updating changelog
  Add token standard to custom token details (#14506)
  Revert "Dark Mode: What's New Announcement (#14346)"
  Ensure network name in confirm page container is defined (#14520)
  Updating lavamoat policies
  Fix the alerts toggles in settings (#14498)
  Disable swaps whenever the environment is not development or testing, so that behaviour follows production for QA purposes (#14499)
  [skip e2e] Updating changelog for v10.14.0 (#14487)
  Version v10.14.0
  Docs - segment metrics (#14435)
  Add snaps view search (#14419)
  Run main, flask and beta in sequence in generate-lavamoat-policies.sh (#14470)
  Modify import SRP page (#14425)
  Dark Mode: Implement Metrics (#14455)
  HoldToRevealButton component (#13785)
  e2e test import json file as import account strategy (#14449)
  MetaMetrics: Identify 'number_of_tokens' user trait (#14427)
  MetaMetrics: Identify 'nft_autodetection_enabled' &  'opensea_api_enabled' (#14367)
  Swaps: Sort "token_from" dropdown tokens by their fiat value first and "token_to" by top tokens (#14436)
  Update segment instantiation check. Only check if SEGMENT_WRITE_KEY exists (#14407)
  ...
2022-06-02 18:30:23 -02:30
Guillaume Roux
b599035a12
Snap notifications integration (#14605)
* begin controller implentation

* add NotificationController

* create selectors and actions

* update actions tu use forceUpdateMetamaskState

* Basic notification UI

* fix typo and remove console.log

* lint

* more css

* add notifications scroll

* add translations and fix some css

* Fix rebase and edit colors

* add flask tags

* add flask tag to routes component

* add missing flask tags

* add tests

* fix tests

* store notification expiration delay in constant

* address requested changes

* rename to unreadNotificationsCount

* add missing flask tag
2022-06-01 19:09:13 +02:00
Frederik Bolding
7ce4868401
snaps-skunkworks@0.15.0 (#14772)
* snaps-skunkworks@0.15.0

* Update patch

* Update tofu and LavaMoat policy
2022-06-01 11:26:12 +02:00
Daniel
6dbb2c4ded
Migrate the "estimateGas" API call to "getFees" for STX (#14767) 2022-05-26 19:56:28 +02:00
Frederik Bolding
66c049bb35
snaps-skunkworks@0.14.0 (#14700)
* snaps-skunkworks@0.13.0

* snaps-skunkworks@0.14.0

* Fix test

* Add long-running permission copy and icon

* Run linting

* Fix typo

* Bump E2E version
2022-05-18 13:49:26 +02:00
Mark Stacey
7199d9c567 Use externally hosted phishing warning page
An externally hosted phishing warning page is now used rather than the
built-in phishing warning page.The phishing page warning URL is set via
configuration file or environment variable. The default URL is either
the expected production URL or `http://localhost:9999/` for e2e testing
environments.

The new external phishing page includes a design change when it is
loaded within an iframe. In that case it now shows a condensed message,
and prompts the user to open the full warning page in a new tab to see
more details or bypass the warning. This is to prevent a clickjacking
attack from safelisting a site without user consent.

The new external phishing page also includes a simple caching service
worker to ensure it continues to work offline (or if our hosting goes
offline), as long as the user has successfully loaded the page at least
once. We also load the page temporarily during the extension startup
process to trigger the service worker installation.

The old phishing page and all related lines have been removed. The
property `web_accessible_resources` has also been removed from the
manifest. The only entry apart from the phishing page was `inpage.js`,
and we don't need that to be web accessible anymore because we inject
the script inline into each page rather than loading the file directly.

New e2e tests have been added to cover more phishing warning page
functionality, including the "safelist" action and the "iframe" case.
2022-05-16 14:40:50 -02:30
Hassan Malik
a3917763d4
Removed onExecutionEnvironmentError (#14698)
* used correct method to stop snap

* removed dead code, snap controller already subscribes to execution environment errors

* fixed linting error
2022-05-12 17:58:37 -04:00
Dan J Miller
8948018e5a
Ensure ledger keyring message event listener are removed on metamask lock (#14691)
* Ensure ledger keyring message event listener are removed on metamask lock

* Clean up
2022-05-12 13:36:14 -02:30
Niranjana Binoy
6c757ab5e0
Event tracking for Token Detection V2 (#14441) 2022-05-11 16:27:58 -04:00
Frederik Bolding
b258cbafe7
Remove confirmation for terminated snaps (#14566) 2022-05-11 16:15:26 +02:00
Frederik Bolding
2dac88cbf4
snaps-skunkworks@0.12.0 (#14670)
* snaps-skunkworks@0.12.0

* Bump iframe execution environment

* Remove policy override

* Rerun LavaMoat

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2022-05-10 23:08:42 -07:00
Frederik Bolding
9e401b14bf
Simplify removeSnap functionality after snaps-skunkworks update (#14646) 2022-05-09 18:19:34 +02:00
Alex Donesky
4550a10d32
fix incorrect casing of includeUsdRate option passed to CurrencyRateController (#14615) 2022-05-05 16:14:06 +02:00
Brad Decker
564ad2f81b
Track send flow history on txMeta (#14510) 2022-05-04 11:54:46 -05:00
Shane
7da6c66ea2
Added getAccounts suppressUnauthorized param (#14126)
* Added getAccounts suppressUnauthorized param

* Changed getAccounts supresss unauth param name

* Changed getAccounts param to object

* Fixed default empty obj for getAccounts getPermittedAccounts param

* Bump eth-json-rpc-middleware version to 8.0.2

* Fixed lavamoat policy

* Fixed lavamoat policies

* Fixed dedupe issues

* Fixed lavamoat allowscripts

* yarn deduplicate

* Fixed lavamoat policies

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
2022-04-29 06:05:14 -07:00
Frederik Bolding
1624af2364
snaps-skunkworks@0.11.1 (#14531)
* snaps-skunkworks@0.11.0

* Update LavaMoat policies

* Fix breaking changes

* Use SnapController:clearSnapState

* Fix fetch properly

* Bump iframe execution environment

* snaps-skunkworks@0.11.1

* Run allow-scripts auto
2022-04-28 18:17:28 +02:00
Hennadii Ivtushok
72d2977e72
Warn about multiple MetaMask instances running (#13836)
* Add text warning on startup page

* Try to detect extensions with browser API

* Setup messaging between different versions of extension

* Cleanup

* Cleanup

* Simplify check for multiple instances running

* Fix a doc string + use webextension-polyfill

* Fix test

* Mock webextension-polyfill

* Mock correctly

* Catch error and show warning in both extensions

* Mock as promise

* Address comments

* Rename build ids

* Run detection code only if Chrome

* Add Firefox warnings

* Cleanup imports

* Update connection ids

* Run detection code for Firefox

* Add test

* Add missing await

* Update tests

* Cleanup

* Cleanup

* Improve testing

* Improve tests

* Log errors from sendMessage

* Cleanup

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
2022-04-27 20:14:10 +02:00
Frederik Bolding
27ad7279cd
Rename NotificationController to AnnouncementController (#14389)
* Rename NotificationController to AnnouncementController

* Fix test

* Add test for missing NotificationController state

* Bump controllers

* Move test to correct file

* Rename config key

* Add migration 71 to list of migrations

* Fix selector after migration
2022-04-27 10:36:32 +02:00
Brad Decker
193c22588e
call controller methods directly in send duck (#14465) 2022-04-26 12:07:39 -05: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
Alex Donesky
fbeae57247
Add testnet name as prefix for native currency of preloaded testnets (#14454)
* add testnet name as prefix for native currency of preloaded testnets
2022-04-21 14:09:41 -05:00
kumavis
54ac00027b unblock ci: update vuln deps + fix npm registry for snaps firefox (#14437)
* dep-audit-fix for async@2.6.3

* deps - update async for vuln fix and remove patch

* deps/ci-yarn-audit - remove outdated ignored vulns

* deps/lock - deduplicate async@2

* deps/lock - deduplicate async@2 + remove indirectly used dep

* Use regular NPM registry for snaps on Firefox (#14439)

* Use regular NPM registry for snaps on FF

* Fix linting

* Update app/scripts/metamask-controller.js

Co-authored-by: Shane <jonas.shane@gmail.com>

Co-authored-by: kumavis <kumavis@users.noreply.github.com>
Co-authored-by: Shane <jonas.shane@gmail.com>

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Shane <jonas.shane@gmail.com>
2022-04-14 08:03:13 -07:00
kumavis
0f4417684b
unblock ci: update vuln deps + fix npm registry for snaps firefox (#14437)
* dep-audit-fix for async@2.6.3

* deps - update async for vuln fix and remove patch

* deps/ci-yarn-audit - remove outdated ignored vulns

* deps/lock - deduplicate async@2

* deps/lock - deduplicate async@2 + remove indirectly used dep

* Use regular NPM registry for snaps on Firefox (#14439)

* Use regular NPM registry for snaps on FF

* Fix linting

* Update app/scripts/metamask-controller.js

Co-authored-by: Shane <jonas.shane@gmail.com>

Co-authored-by: kumavis <kumavis@users.noreply.github.com>
Co-authored-by: Shane <jonas.shane@gmail.com>

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Shane <jonas.shane@gmail.com>
2022-04-13 17:28:03 -10:00
Niranjana Binoy
455d4a9825
Update DetectTokenController for token detection V2 (#14216) 2022-04-13 12:23:41 -04:00
ryanml
b8c9f370ef Merge remote-tracking branch 'origin/master' into Version-v10.13.0 2022-04-07 02:32:07 -07:00
Brad Decker
d6df3700f7
track rpc method usage (#14269) 2022-04-04 14:26:13 -05:00
Frederik Bolding
e77ff0bce8
Fix a few Snap state issues (#14339)
* Fix clearSnapState

* Simplify getSnapState
2022-04-04 16:32:49 +02:00
Frederik Bolding
cb963f3c29
snaps-skunkworks@0.10.7 (#14323)
* snaps-skunkworks@0.10.7

* Bump iframe-execution-environment
2022-04-01 18:14:48 +02:00
Mark Stacey
646bad8a58 Merge remote-tracking branch 'origin/develop' into master-sync
* origin/develop: (210 commits)
  Dark Mode: Remove unwanted background for price quote (#14278)
  Dark Mode: Fix colors in toggle button (#14280)
  Ensure proper color for swaps edit link (#14273)
  Dark Mode: Ensure actionable message button colors are the same color as previously (#14271)
  Add token standard to Token Added event. (#14253)
  Token Aggregators component for Tokens Detected page (#14157)
  Ensure Metafox follows cursor on Fetching quotes screen (#14261)
  TransactionsControllerTest: catch uncaught errors (#14196)
  GasModalPageContainer story: convert knobs and actions to controls / args (#13516)
  Show STX switch for wrapping / unwrapping (#14225)
  Change over ImportToken stories to use controls instead of knobs, update props in stories (#14246)
  Change over FeeCard stories to use controls instead of knobs, update props in stories (#13766)
  Update What's new screen with Token Detection information (#14124)
  Improvements for multi-layer fee UX (#13547)
  metaMetricsEvent -> trackEvent (#14249)
  E2e dapp interactions (#14149)
  failing contract interaction e2e (#14227)
  Removed metrics event (#14042)
  Add TypeScript to the build system (#13489)
  Build user traits object when metamask state changes (#14192)
  ...
2022-03-30 22:54:28 -02:30
Mark Stacey
98f187c301 Update SRP representation
An array of integers is now used to represent the SRP in three cases:

* In the import wallet flow, the UI uses it to pass the user-provided
  SRP to the background (which converts the array to a buffer).
* In the create wallet flow, the UI uses it to retrieve the generated
  SRP from the background.
* When persisting the wallet to state, the background uses it to
  serialize the SRP.

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
2022-03-30 21:01:26 -02:30
Brad Decker
b525c620f4
Build user traits object when metamask state changes (#14192) 2022-03-28 16:56:56 -05:00
Dan Miller
d5c693d9db Merge remote-tracking branch 'origin/master' into Version-v10.12.0-alt 2022-03-25 14:56:57 -02:30
Olusegun Akintayo
c54f9b3097
update gas fees (#13646)
* Draft methods to brak updateTransaction into smaller more targeted
methods.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* This is a combination of 76 commits.

normalize and validate tx params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Method to normalize tx and check if it's unapproved.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Move the methods to controllers/transactions/index.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Flesh out the methods to update transaction with custom notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

enforce that only the properties for the specific methid can be updated via the method.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Test update gas fees

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update swap approval transaction

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

use lodash to remove undefined properties
update swap transaction tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Updates transaction user settings.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add more parameters to updateSwapTransaction
    approvalTxId
    estimatedBaseFee

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add Update Transaction Metrics

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update transaction gas fees actions.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update EIP 1559 Params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint Fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Documentations.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics from this PR

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes: Removed unused variables

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add more params to updateTransactionGasFees.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update eip1559 method to editableParams.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix Mocha tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

add gasPrice to updateEditableParams

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove duplicated Params in notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

A few more tests to cover if
    transaction status is not unapproved
    transaction is passed more parameters than it requires.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update Transaction Gas Fees.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update gas fees in edit-gas-popover.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update gas settings and user settings.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix unit tests.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Draft methods to brak updateTransaction into smaller more targeted
methods.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

normalize and validate tx params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Method to normalize tx and check if it's unapproved.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Move the methods to controllers/transactions/index.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Flesh out the methods to update transaction with custom notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Test update gas fees

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update swap approval transaction

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

use lodash to remove undefined properties
update swap transaction tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Updates transaction user settings.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add Update Transaction Metrics

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update transaction gas fees actions.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update EIP 1559 Params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint Fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Documentations.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics from this PR

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes: Removed unused variables

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add more params to updateTransactionGasFees.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update eip1559 method to editableParams.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix Mocha tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

add gasPrice to updateEditableParams

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove duplicated Params in notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

A few more tests to cover if
    transaction status is not unapproved
    transaction is passed more parameters than it requires.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update Transaction Gas Fees.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update gas settings and user settings.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix unit tests.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove dup;icated method from rebase.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

unrelated change

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Force re-run workflow

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fix

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Do not hideLoading since we're not showing it.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

UpdateTransaction should be renamed to updateGasFees

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

updateGasFees in gas-modal-page-container.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

fix:
    update previous gas params update method
    add types to the jsdoc comments.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

updateTransactionGasFees should have been updatePreviousGasParams

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Previous gas fees can be updated for confirmed transactions.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

add updatePreviousGasParams to mocked functions.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* we need to await the first dispatch before we call the second

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* update values to make tests pass

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* More changes to make e2e pass

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Need to wait a bit after save for changes to take effect.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Remove merge comments.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Await one dispatch before calling another

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* We don't need goHome anymore.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Tests must use async...await syntax too since we have await in the
useTranasctionFunction

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Add delay after button click for values to update

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Wait a moment after clicking save for values to update

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Wait after clicking save...

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Merge update transaction gas fees and transaction user settings
Show loading indicator on edit gas popover
Fix tests.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Fix JSDoc

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* updatePreviousGasParams should also return updated transaction meta.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-03-25 21:11:04 +04:00
Frederik Bolding
5107f06afa snaps-skunkworks@0.10.6 (#14070)
* snaps-skunkworks@0.10.6

* iframe-execution-environment@0.4.2

Co-authored-by: Erik Marks <rekmarks@protonmail.com>
2022-03-22 19:55:51 -07:00
Erik Marks
680d30f095 snaps-skunkworks@0.10.2 (#13901) 2022-03-22 19:55:51 -07:00
Shane
059d5d0488 Fixed firefox Snaps + add initial end-to-end tests (#13671)
* Changed registryUrl for snaps only in firefox
Fixed getPlatform to only be imported into metamask-controller in flask
Removed snaps specific testrunner script and use run-all with a cli option

* Fixed flakey tests

* Removed unneeded await

* Added delay

* Fixed linting
2022-03-22 19:54:33 -07:00
Frederik Bolding
be17d8f3d9
snaps-skunkworks@0.10.6 (#14070)
* snaps-skunkworks@0.10.6

* iframe-execution-environment@0.4.2

Co-authored-by: Erik Marks <rekmarks@protonmail.com>
2022-03-21 13:55:08 -07:00
Alex Donesky
8df8f81df7
Deprecate extensionizer for webextension-polyfill (#13960)
* deprecate extensionizer for webextension-polyfill

* fix tests

* remove extensionizer

* fix browser windows api calls

* fix broken on firefox

* fix getAcceptLanguages call

* update more browser apis that are now promisified

* remove unnecessary console error ignoring in e2e tests
2022-03-18 14:07:05 -05: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
Frederik Bolding
8b9b9af13f
Add native browser notification support for Snaps (#13613)
* Initial native notification implementation

* Simplify implementation

* Implementation based on RateLimitController

* Update controllers package

* Add notification to permission list

* Wire up correctly

* Remove snap_notify from the exclusion list
2022-03-17 17:43:18 +01:00
Brad Decker
116d6b0eb8
add asset_type to transactions (#13858) 2022-03-16 17:15:03 -05:00
Erik Marks
a3355d9ca5 @metamask/controllers@26.0.0 (#13867)
* @metamask/controllers@26.0.0
2022-03-16 13:12:37 -02:30
Erik Marks
118480280c
snaps-skunkworks@0.10.2 (#13901) 2022-03-14 12:37:19 -07:00
Shane
1f55af3151
Fixed firefox Snaps + add initial end-to-end tests (#13671)
* Changed registryUrl for snaps only in firefox
Fixed getPlatform to only be imported into metamask-controller in flask
Removed snaps specific testrunner script and use run-all with a cli option

* Fixed flakey tests

* Removed unneeded await

* Added delay

* Fixed linting
2022-03-10 14:01:55 -08:00
Shane
adce5c558d
Fixed serialization of error parameter for rejectPendingApproval across JSON-RPC (#13847)
* Fixed serialization of error parameter for rejectPendingApproval across JSON-RPC

* Fixed linting

* Added serialize error to add-ethereum-chain
2022-03-10 09:55:25 -08:00
Olusegun Akintayo
e157d2b51f
Dev olu update swap approval transaction (#13641)
* Draft methods to brak updateTransaction into smaller more targeted
methods.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* This is a combination of 52 commits.

normalize and validate tx params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Method to normalize tx and check if it's unapproved.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Move the methods to controllers/transactions/index.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Flesh out the methods to update transaction with custom notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Test update gas fees

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

use lodash to remove undefined properties
update swap transaction tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Updates transaction user settings.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add Update Transaction Metrics

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update transaction gas fees actions.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update EIP 1559 Params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint Fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Documentations.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics from this PR

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes: Removed unused variables

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update swap approval transaction

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

1. updateSwapApprovalTransaction should have id as first parameter
2. updateSwapApprovalTransaction should not show loading indicator

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

update swap transaction.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics code.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add updateTransactionParams to actions.js updateXXX and return txData at
the end of updateXXX method

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix swapApprovalTransaction update to use same return method as swap
update
Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Draft methods to brak updateTransaction into smaller more targeted
methods.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

normalize and validate tx params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Method to normalize tx and check if it's unapproved.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Move the methods to controllers/transactions/index.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Flesh out the methods to update transaction with custom notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Test update gas fees

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update swap approval transaction

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

use lodash to remove undefined properties
update swap transaction tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add Update Transaction Metrics

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update transaction gas fees actions.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update EIP 1559 Params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint Fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Documentations.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics from this PR

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes: Removed unused variables

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update swap approval transaction

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

1. updateSwapApprovalTransaction should have id as first parameter
2. updateSwapApprovalTransaction should not show loading indicator

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

update swap transaction.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics code.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add updateTransactionParams to actions.js updateXXX and return txData at
the end of updateXXX method

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix swapApprovalTransaction update to use same return method as swap
update
Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove duplicate tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove comments.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Do not hideLoading, since we're not showing it.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

...approveTxMeta no longer needed here.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove estimated base fee from swap approval txs.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

remove txTradeMeta from params
make sure rebase didn't mess up any code - first pass

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-03-09 23:01:04 -03:30
Erik Marks
259e30abc2
@metamask/controllers@26.0.0 (#13867)
* @metamask/controllers@26.0.0
2022-03-09 15:37:40 -08:00
Alex Donesky
3747ace06b
Refactor token send/method confirmation flow (trimmed down) (#13788)
* make use of getTokenStandardAndDetails method exposed on assetsContractController to determine how to represent the contract being interacted with in token contract method calls
2022-03-09 08:38:12 -06:00
Niranjana Binoy
8c9efb2a1f Increase the txHistoryLimit in the transaction controller to 60 (#13743) 2022-03-09 09:19:11 -03:30
Mark Stacey
c3feabf4de Update SRP representation
An array of integers is now used to represent the SRP in three cases:

* In the import wallet flow, the UI uses it to pass the user-provided
  SRP to the background (which converts the array to a buffer).
* In the create wallet flow, the UI uses it to retrieve the generated
  SRP from the background.
* When persisting the wallet to state, the background uses it to
  serialize the SRP.

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
2022-03-08 17:15:11 -03:30
Olusegun Akintayo
442edc5a91
Update EIP1559 params. (#13652)
* Draft methods to brak updateTransaction into smaller more targeted
methods.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* normalize and validate tx params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Method to normalize tx and check if it's unapproved.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Move the methods to controllers/transactions/index.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Flesh out the methods to update transaction with custom notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Test update gas fees

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Update swap approval transaction

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* use lodash to remove undefined properties
update swap transaction tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Updates transaction user settings.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Add Update Transaction Metrics

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Update transaction gas fees actions.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Update EIP 1559 Params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint Fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Documentations.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Remove metrics from this PR

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint fixes: Removed unused variables

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Add more params to updateTransactionGasFees.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Update eip1559 method to editableParams.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Fix Mocha tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* add gasPrice to updateEditableParams

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Remove duplicated Params in notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* A few more tests to cover if
    transaction status is not unapproved
    transaction is passed more parameters than it requires.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Update EIP1559 params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Remove metrics

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Add updateTransactionParams to actions.js updateXXX and return txData at the end of updateXXX method

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* change method name to update editable params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Editable params should pass in the txParams and not the full tx object

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Fix jest tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Do not hideLoading since we're not showing it.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Proper JSDOCs comments.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Remove gas settings from updateEditableParams since we already have a
dedicated gas update method.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Fix duplicate codes from rebasing.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-03-07 23:14:48 +04:00
Brad Decker
9cea401022
extract determineTransactionType from tx controller (#13737) 2022-03-07 12:54:36 -06:00
Niranjana Binoy
4bb3ba4aef
Adding new settings dropdown for Dark mode in Experimental tab (#13097) 2022-03-07 12:53:19 -06:00
Daniel
d17d7f2d18 Set up STX controller state (#13843)
* persist stx controller state

* Pass STX controller state as the 3rd param

* Trigger Build

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2022-03-04 16:52:59 -03:30
Daniel
3327c5c797
Set up STX controller state (#13843)
* persist stx controller state

* Pass STX controller state as the 3rd param

* Trigger Build

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2022-03-04 16:50:18 -03:30
Niranjana Binoy
19098f7d69
Increase the txHistoryLimit in the transaction controller to 60 (#13743) 2022-02-24 11:51:33 -05:00
Brad Decker
6e34b70db3
add account_type and device_model to tx metrics (#13682) 2022-02-23 09:15:41 -06:00
Daniel
2585f45bde
Add support for Smart Transactions (#12676) 2022-02-18 17:48:38 +01:00
David Walsh
009c6e1455
Use hardware wallet constants when possible (#13634) 2022-02-16 14:54:30 -06:00
Erik Marks
35ac762e10
Add Snaps via Flask (#13462)
This PR adds `snaps` under Flask build flags to the extension. This branch is mostly equivalent to the current production version of Flask, excepting some bug fixes and tweaks.

Closes #11626
2022-02-14 16:02:51 -08:00
Niranjana Binoy
b42e1f75fa
Include transactions from all networks in state logs (#13599) 2022-02-14 13:29:24 -05:00
Dan J Miller
0a4432513d
captureKeyringTypesWithMissingIdentities() when 'Missing identity for address' in permissions/specifications (#13521)
* captureKeyringTypesWithMissingIdentities() when 'Missing identity for address' in permissions/specifications

* Fix unit tests
2022-02-07 15:30:37 -03:30
Shane
3772dfee11
Added subjectType to setupProviderConnection and setupUntrustedCommunication (#13437)
These changes were split off from the snaps branch [here](https://github.com/MetaMask/metamask-extension/pull/11837#discussion_r792942834).

The `subjectType` is necessary to handle connecting to snaps using these methods.
2022-01-28 13:42:32 -08:00
Alex Donesky
be65eb7339
More nft ux fixes (#13388)
* a batch of nft ux fixes
2022-01-27 11:26:33 -06:00
Alex Donesky
db0230f23a
NFT UX cleanup grab-bag (#13352)
* NFT UX cleanup
2022-01-20 11:49:49 -06:00
Brad Decker
c58cc631c7
implement event fragments for tx controller (#13331) 2022-01-20 10:26:39 -06:00
Alex Donesky
f7849a0b7c
Add error that redirects users to Import NFT page when they attempt to add an NFT on the Import Token page (#13271)
* Add error that redirects users to Import NFT page when they attempt to add an NFT on the Import Token page
2022-01-19 08:38:33 -06:00
Brad Decker
b820ef131b
Implement event fragments (#12251) 2022-01-12 13:31:54 -06:00
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
Mark Stacey
22f931e6b2
Prevent automatic rejection of confirmations (#13194)
* Prevent automatic rejection of confirmations

Confirmations are now only automatically rejected if a user explicitly
closes the notification window. If we close the window programmatically
because there are no notifications left to show, nothing gets rejected.

This partially avoids a race condition where a confirmation gets
rejected automatically without the user having seen the confirmation
first. This could happen if the confirmation was processed just as the
notification window was being closed.

It's still possible for a confirmation that the user has never seen to
get rejected as a result of the user closing the window. But at least
now it's no longer possible for a confirmation to get rejected in this
manner after the user resolves the last confirmation in the queue.

* Fix bug that prevented automatic closure detection

All windows were being detected as explicit window closures,
essentially just as they were previously, because this variable was
cleared too soon.

* Re-open popup when necessary

After the window is automatically closed, a confirmation may have been
queued up while the window was closing. If so, the popup is now re-
opened.
2022-01-05 13:39:19 -03:30