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

658 Commits

Author SHA1 Message Date
Dan Finlay
25076da9cb
Remove unused dependency 2019-10-23 08:59:20 +09:00
Dan Finlay
3eee9a2458
Linted 2019-10-23 08:47:15 +09:00
Dan Finlay
d26a8e7f82 Allow non strigified typed data params 2019-10-22 14:53:25 -07:00
Dan Finlay
4b4bee77c7 Move signTypedData signing out to keyrings
This simplifies the logic of signing and improves security:
- Private keys are never moved to the base controller.
- Hardware wallets are abstracted in the same way as local keys.

This also paves the way for allowing even more modular accounts,
provided by plugins:
https://github.com/MetaMask/metamask-plugin-beta/pull/63

Fixes #7075.
2019-10-22 11:37:04 -07:00
Mark Stacey
9541d1e281
Don't wait for 3Box initialization during login (#7242)
The 3Box initialization is triggered by login, but it no longer blocks
the login from finishing. The 3Box initialization is designed to run in
the background, so there's no reason to block on it.
2019-10-02 16:12:20 -03:00
Dan J Miller
e6e8897434
Custom nonce fixes (#7240)
* Allow default nextNonce to be the custom nonce in cases where highest locally pending is higher than nextNonce

* Reset custom nonce in cases of transaction submission failures

* Make the recommended nonce in the custom nonce field the true 'nextNonce'

* Revert automatic setting of custom nonce to nextNonce

* Make the nextNonce the default placeholder value

* Fix getNextNonce

* Remove unused nonceFieldPlaceholder message

* Fix nits in getPendingNonce and getNextNonce

* Properly handle errors in getNextNonce

* Improve placeholder and value defaults in custom nonce field

* Remove custom error message from getNextNonce
2019-10-02 15:42:04 -02:30
Dan J Miller
daf4fe439c Ensure 3box validation uses the correct address (#7235) 2019-10-01 10:03:13 -03:00
Mark Stacey
8d97bdc5c9
Fix error handling when checking for 3Box backup (#7232)
The 3Box SDK throws an HTTP 404 error when attempting to get the config
for an account that doesn't yet exist in 3Box. The regex we were using
to differentiate this error from others was broken. This ended up
preventing the user from logging in if they had 3Box enabled but hadn't
yet synced.

The regex has been corrected to catch this case, while allowing other
errors to propogate upward. Other 3Box errors will now be caught and
reported rather than interrupting login completely.

At some point in the future, we should expose these errors to the user
in some way, and allow them to retry in case 3Box was just temporarily
offline.
2019-10-01 10:01:57 -03:00
ricky
5f254f7325 Add advanced setting to enable editing nonce on confirmation screens (#7089)
* Add UseNonce toggle

* Get the toggle actually working and dispatching

* Display nonce field on confirmation page

* Remove console.log

* Add placeholder

* Set customNonceValue

* Add nonce key/value to txParams

* remove customNonceValue from component state

* Use translation file and existing CSS class

* Use existing TextField component

* Remove console.log

* Fix lint nits

* Okay this sorta works?

* Move nonce toggle to advanced tab

* Set min to 0

* Wrap value in Number()

* Add customNonceMap

* Update custom nonce translation

* Update styles

* Reset CustomNonce

* Fix lint

* Get tests passing

* Add customNonceValue to defaults

* Fix test

* Fix comments

* Update tests

* Use camel case

* Ensure custom nonce can only be whole number

* Correct font size for custom nonce input

* UX improvements for custom nonce feature

* Fix advanced-tab-component tests for custom nonce changes

* Update title of nonce toggle in settings

* Remove unused locale message

* Cast custom nonce to string in confirm-transaction-base.component

* Handle string conversion and invalid values for custom nonces in handler

* Don't call getNonceLock in tx controller if there is a custom nonce

* Set nonce details for cases where nonce is customized

* Fix incorrectly use value for deciding whether to getnoncelock in approveTransaction

* Default nonceLock to empty object in approveTransaction

* Reapply use on nonceLock in cases where customNonceValue in approveTransaction.

* Show warning message if custom nonce is higher than MetaMask's next nonce

* Fix e2e test failure caused by custom nonce and 3box toggle conflict

* Update nonce warning message to include the suggested nonce

* Handle nextNonce comparison and update logic in lifecycle

* Default nonce field to suggested nonce

* Clear custom nonce on reject or confirm

* Fix bug where nonces are not shown in tx list on self sent transactions

* Ensure custom nonce is reset after tx is created in background

* Convert customNonceValue to number in approve tranasction controller

* Lint fix

* Call getNextNonce after updating custom nonce
2019-09-27 00:30:36 -04:00
Dan J Miller
970e90ea70
Add migration on 3box imports and remove feature flag (#7209)
* Delete unused code

* Run threebox imports through migrations

* Remove 3box feature flag

* Remove unnecessary use of 'type' in threebox._updatePlugin

* Fix threebox controller getLastUpdated

* Turn off threebox by default

* Rename restoredFromThreeBox to showRestorePrompt

* Remove accientally added method from threebox controller

* Restore from threebox on import from unlock screen

* Throw on non 404 errors from Box.getconfig in new3Box
2019-09-26 03:24:52 -04:00
Dan J Miller
1bd22b58c0
Add a/b test for full screen transaction confirmations (#7162)
* Adds ab test controller with a fullScreenVsPopup test

* Add migration for fullScreenVsPopup state

* Move abtest state under an 'abtests' object.

* MetaMask shows fullScreen group of a/b test unapproved txs in a full browser tab

* Ensure cancel metrics event in confirm-transaction-base.component.js is sent in all cases

* Switch to existing tab for unapproved tx if it exists when opening in full screen

* Send metrics event for entering a/b test from confirm screen

* Fix lint, unit and integration tests related to a/b test code

* Remove unnecessary tabs.query call in triggerUiInNewTab
2019-09-24 17:08:38 -04:00
Dan J Miller
7985f4f4f8
3box integration 2.0 (#6972)
* Adds threebox controller

* Adds threebox approval modal

* Fix unit tests and lint after addition of threebox

* Correct threebox behaviour after rejecting request for backup; fixes e2e tests.

* Update threebox controller for automatic syncing

* Ensure frontend locale updates when preferences are changed via direct update within controller

* Add toggle in settings for 3box syncing

* Update threebox controller for latest 3box version

* Delete unnecessary frontend changes for threebox integration

* Backing up address book contacts with threebox

* Update unit tests for 3box-integration additions

* Only enable threebox by default for new wallets

* Mock globals for correct unit tests

* 3box '1.10.2' -> '^1.10.2'

* Correct capilalization on 3Box

* Use log.debug instead of console.log in threebox controller

* Update yarn.lock

* Remove edge build

* Split 3box module into background deps js file

* extra bundle opts for bg-libs

* sync yarn.lock

* new3Box logic

* Show confirm threebox restore after import

* Remove bg-libs.js from manifest file for dev builds

* Switch 3Box controller to using the spaces api (instead of the profile api)

* Finalize switching to spaces api and only restoring from 3box after import

* Update metamask-controller-test.js for threebox controller changes

* Make threebox modal style consistent with others and update success button wording

* Use mock 3box when in test

* Correct 3box modal header

* Remove unnecessary property of threebox controller provider

* Remove unnecessary method calls after restoration from 3box in the threebox-restore-confirm modal.

* Replace setThreeBoxSyncingPermission calls in routes/index.js with turnThreeBoxSyncingOn

* Replace erroneous use of  with

* Replace erroneous use of threeboxSyncing with threeBoxSyncingAllowed in advancted-tab directory

* Lint fixes for 3box changes

* Log errors encountered when updating 3Box

* Remove unnecessary parameter from state update

* Add timeout to initial 3Box sync

The initial 3Box sync will now timeout after 1 minute. If the timeout
is triggered, 3Box is disabled and cannot be re-enabled unless the
initial sync does finally finish. If it never finishes, 3Box cannot
be enabled unless the extension is reinstalled.

The Advanced Settings page was updated to show this option as disabled
in that circumstance, with a new discription explaining why it's
disabled. The UI here could certainly be improved.

Additionally, "on" and "off" labels were added to the toggle to match
the other toggles on the Advanced Settings page.

* Use non-minified 3Box module

We had previously used the minified 3Box module to avoid a build error
encountered when `envify` was processing the `libp2p` module (which is
used by 3Box). The build would fail because `esprima` (used by `envify`)
is incompatible with the object spread/rest operator (which is used in
`libp2p`).

That issue has been solved by adding a global Babelify transformation
specifically for transpiling out the object rest/spread operator from
dependencies. It has been targetted to only affect `libp2p` to avoid
extending the build time too much. This workaround can be used until
a new version of `esprima` is released that includes this bug fix.

* Use app key addresses for threebox

* Replace use of modal for confirming 3box restoration with a home notification

* Adds e2e tests for restoring from threebox

* Update eth-keyring-controller to 5.1.0

* Correct parameters passed to getAppKeyAddress in threebox.js

* Add prefix to origin passed to getAppKeyAddress in threebox.js

* Remove unused locale message.

* Prevent CORS errors in firefox e2e tests

* Ensure extraneous scripts are excluded from the local test dev build

* Move threeBoxLastUpdate state from home.component to redux

* Threebox PR code cleanup

* Always use first address when initializing threebox

* Replace setRestoredFromThreeBox api with setRestoredFromThreeBoxToFalse and setRestoredFromThreeBoxToTrue

* Update development/metamaskbot-build-announce.js to include ui-libs and bg-libs in hard coded bundle list

* Update test/e2e/threebox.spec.js to use new helpers added with pull #7144

* Make setFeatureFlag available on the ui window during testing

* Hide threebox feature behind a feature flag that can only be activated via dev console

* Remove unnecessary migration of threebox feature flag

* Prevent this.init() call in threebox constructor if feature flag is not turned on

* Prevent threebox notification from showing if feature flag is falsy

* http://localhost/8889 -> http://localhost/* in gulp manifest:testing tasks
2019-09-16 14:41:01 -02:30
Mark Stacey
95b4d91116
Replace undefined selectedAddress with null (#7161)
* Replace `undefined` selectedAddress with `null`

The `runtime.Port.postMessage` API will drop keys with a value of
`undefined` on Chrome, but not on Firefox. This was a problem for the
`publicConfig` stream, which passed the key `selectedAddress` with the
value of `undefined` to communicate to dapps that the user had logged
out.

Instead a `null` is now passed for `selectedAddress` upon logout, which
is correctly sent by the `runtime.Port.postMessage` API on both Chrome
and Firefox.

closes #7101
closes #7109

* Update `metamask-inpage-provider` to v3.0.0

The v3.0.0 update includes a change to the `accountsChanged` event. The
event will now emit an empty array instead of an array with `undefined`
or `null`.

The previous behavior was to emit `[undefined]`. The previous commit
would have changed that to `[null]` anyway, so we figured if we're
going to make a public-facing change to the event anyway we should
change it to be correct. `[undefined]` was never intended, and it
technically violates EIP-1193, which states that the `accountsChanged`
event should emit an array of strings.
2019-09-13 11:32:55 -03:00
Dan J Miller
7af902e500
Make chainId available in the metamask-inpage-provider (#7110)
* Make chainId available in the metamask-inpage-provider

* Update metamask-inpage-provider to 2.1.0

* Add e2e tests for ethereum.on events

* Move chainId constants to lib/enums.js

* Don't use new chainId enums in createInfuraClient

* Fix app/scripts/lib/select-chain-id.js
2019-09-09 22:01:34 -02:30
Nick Doiron
d589d2dec0 Right-to-left CSS (using module for conversion) (#7072)
* Create RTL stylesheets using `gulp-rtl`

* Handle RTL stylesheet special cases

Certain blocks of Sass  were set to bypass "rtlcss" using ignore
comments. Certain icons had to be flipped 180 degrees.

* Switch stylesheets when locale changes

A second stylesheet has been added to each HTML page for use with
right-to-left locales. It is disabled by default. It is enabled on
startup if a RTL locale is set, and when switching to a RTL locale.
Similarly the LTR stylesheet is disabled when a RTL locale is used.

Unfortunately there is an unpleasant flash of unstyled content when
switching between a LTR and a RTL locale. There is also a slightly
longer page load time when using a RTL locale (<1s difference). We
couldn't think of an easy way to avoid these problems.

* Set `dir="auto"` as default on `TextFields`
2019-09-03 14:47:54 -03:00
Whymarrh Whitby
ecbde20949
Remove ComputedbalancesController (#7057) 2019-08-22 10:26:43 -02:30
Brendan Chou
cc71b4f52b Add support for eth_signTypedData_v4 (#6930) 2019-08-20 17:22:59 -02:30
Esteban Miño
6e081eb17c Filter non-ERC-20 assets during mobile sync (#7035) 2019-08-20 16:23:21 -02:30
Whymarrh Whitby
e47448362d
Bug fixes for incoming transactions (#7043)
* Fix styling of `.transaction-list`
* Filter `incomingTxListSelector` by network as well
* Start and stop block tracker polling in incoming tx controller
* Add fetch with abort in bg for `IncomingTxController`
2019-08-20 16:22:00 -02:30
Dan J Miller
821529622e Fetch & display received transactions (#6996) 2019-08-16 16:24:10 -02:30
Whymarrh Whitby
247659ca65
Connections settings tab (#7013)
* Nix notification for Share Address

* Add Connections settings tab in place of privacy mode toggle

* Split ProviderApprovalController into two stores

* Remove privacyMode feature flag altogether

* Add migration to remove privacyMode feature flag
2019-08-15 18:37:18 -02:30
Dan J Miller
043920c9ff
Address book fixes (#6978)
* Ensure address book send flow correctly matches address book addresses to ens addresses

* Use nodify on background.setAddressBook to receive correct result in actions.js

* Better error handling for actions.js addToAddressBook

* Eliminate unnecessary data normalization and move more data manipluation to ens-input and send-content containers
2019-08-13 20:43:05 -02:30
Whymarrh Whitby
22b20837d4
Remove reload from Share Address button (#6991)
* Update tooltip words for Share Address

* Don't forceReload anything on Share Address
2019-08-09 15:00:59 -02:30
Whymarrh Whitby
ceace71bf5
Remove unused lostAccounts state (#6979) 2019-08-08 17:03:10 -02:30
Dan J Miller
3eff478775
I5849 incremental account security (#6874)
* Implements ability to defer seed phrase backup to later

* Adds incremental-security.spec.js, including test dapp that sends signed tx with stand alone localhost provider

* Update metamask-responsive-ui for incremental account security changes

* Update backup-notification style and fix responsiveness of seed phrase screen

* Remove uneeded files from send-eth-with-private-key-test/

* Apply linguist flags in .gitattributes for send-eth-with-private-key-test/ethereumjs-tx.js

* Improve docs in controllers/onboarding.js

* Clean up metamask-extension/test/e2e/send-eth-with-private-key-test/index.html

* Remove unnecessary newlines in a couple first-time-flow/ files

* Fix import of backup-notification in home.component

* Fix git attrs file
2019-08-02 01:27:26 -02:30
Whymarrh Whitby
e9a63d5d5b
Default Privacy Mode to ON, allow force sharing address (#6904) 2019-08-01 10:54:33 -02:30
Whymarrh Whitby
4d88e1cf86 Enable indent linting via ESLint (#6936)
* Enable indent linting via ESLint

* yarn run lint:fix
2019-07-31 10:17:11 -10:00
Dan J Miller
e9c7df28ed
Address book send plus contact list (#6914)
* Style Send Header

* Move Send to-row to send view and restyle

* Add "Recents" group to select recipient view

* Rename SendToRow to AddRecipient

* Basic UI and Layout

* New ENSInput component

* wip - fuzzy search for input

* small refactor

* Add Dialog

* contact list initial

* initial error on invalid address

* clean up edit

* Click to open modal

* Create AddToAddressBookModal component

* Modal styling and layout

* modal i18n

* Add to Addressbook

* ens wip

* ens wip

* ENS Resolution

* Reset input

* Send to explicit address

* Happy Path Complete

* Add back error checking

* Reset send-to when emptying input

* Add back warning object

* Fix linter

* Fix unit test #1 - fix import paths

* Remove dead tests

* One more to go

* Fix all unit tests

* add unit test for reducers and actions

* test rendering AddRecipient

* Add tests for dialog boxes in AddRecipient

* Add test for validating

* Fix linter

* Fix e2e tests

* Token send e2e fix

* Style View Contact

* Style edit-contact

* Fix e2e

* Fix from-import-beta-ui e2e spec

* Make section header say "add recipient” by default

* Auto-focus add recipient input

* Update placeholder text

* Update input title font size

* Auto advance to next step if user paste a valid address

* Ellipsify address when recipient is selected

* Fix app header background color on desktop

* Give each form row a margin of 16px

* Use .container/.component naming pattern for ens-input

* Auto-focus on input when add to addressbook modal is opened; Save on Enter

* Fix and add unit test

* Fix selectors name in e2e tests

* Correct e2e test token amount for address-book-send changes

* Adds e2e test for editing a transaction

* Delete test/integration/lib/send-new-ui.js

* Add tests for amount max button and high value error on send screen to test/e2e/metamask-ui.spec.js

* lint and revert to address as object keys

* add chainId based on current network to address book entry

* fix test

* only display contacts for the current network

* Improve ENS message when not found on current network

* Add error to indicate when network does not support ENS

* bump gaba

* address book, resolve comments

* Move contact-list to its own component

* De-duplicate getaddressbook selector and refactor name selection logic in contact-list-tab/

* Use contact-list component in contact-list-tab.component (i.e. in settings)

* Improve/fix settings headers for popup and browser views

* Lint fixes related to address book updates

* Add 'My accounts' page to settings address book

* Update add new contact button in settings to match floating circular design

* Improve styles of view contact page

* Improve styles and labels of the add-contact.component

* Further lint fixes related to address book updates

* Update unit tests as per address book updates

* Ensure that contact list groups are sorted alphabetically

* Refactor settings component to use a container for connection to redux; allow display of addressbook name in settings header

* Decouple ens-input.component from send context

* Add ens resolution to add contact screen in settings

* Switching networks when an ens address is shown on send form removes the ens address.

* Resolve send screen search for ensAddress to matching address book entry if it exists

* Show resolved ens icon and address if exists (settings: add-contact.component)

* Make the displayed and copied address in view-contact.component the checksummed address

* Default alias state prop in AddToAddressBookModal to empty string

* Use keyCode to detect enter key in AddToAddressBookModal

* Ensure add-contact component properly updates after QR code detection

* Fix display of all recents after clicking 'Load More' in contact list

* Fix send screen contact searching after network switching

* Code cleanup related to address book changes

* Update unit tests for address book changes

* Update ENS name not found on network message

* Add ens registration error message

* Cancel on edit mode takes user back to view screen

* Adds support for memo to settings contact list view and edit screens

* Modify designs of edit and view contact in popup environment

* Update settings content list UX to show split columns in fullscreen and proper internal navigation

* Correct background address book API usages in UI
2019-07-31 17:26:44 -02:30
Mark Stacey
1112277cd6
Remove seedWords completely from metamask state (#6920)
`seedWords` used to be stored on the metamask state temporarily at
certain points. This hasn't been the case since #5994, but references
to this state remained. All of the logic remained for correctly updating
these `seedWords`, handling them during navigation, and scrubbing them
from the state.

However the state was never updated in practice. The `seedWords` are
still returned by `verifySeedPhrase`, and they're still stored in
component state in a few places. But they aren't ever set in the Redux
metadata state or the Preferences controller.

All references to this state have been removed, along with any logic
for interacting with this state. A few unused actions were removed as
well.
2019-07-26 10:35:21 -03:00
Dan Finlay
78cdee23c0
Abstract domain provider from its stream transport (#6670)
* Abstract domain provider from its stream transport

Creating new provider-consuming extensions, like [a new
platform](https://github.com/MetaMask/metamask-extension/blob/develop/docs/porting_to_new_environment.md)
can be frustrating for new contributors because our provider
construction has been tangled with our streaming interface.

Here I've broken up our streaming domain connection from the provider
construction, so developers can more easily construct local and
domain-restricted providers without dealing with streams.

* Abstract public API from stream interface

* clean up noop

* Document non-streaming interface

* getSiteMetadata must be async

* Clean up filters on stream end

* Document cleaning up filters

* Allow named filterMiddleware to be cleaned up

* Linted

* Require site metadata

* Destroy any destroyable middleware during cleanup

* Lint
2019-07-15 16:28:04 -07:00
Whymarrh Whitby
df17853502
Remove UiMigrationAnnouncement and associated state (#6794) 2019-07-04 12:21:21 -02:30
Paul Bouchon
47024fd9a5
feature: integrate gaba/CurrencyRateController (#6570) 2019-05-31 18:14:22 -04:00
Bruno Barbieri
1d2cf52b64 Fixes bugs in 6.5.1 (#6613)
* fix bg error

* fix ui exception
2019-05-15 10:53:09 +02:00
Paul Bouchon
e57ffbed59
feature: integrate gaba/ShapeShiftController (#6569) 2019-05-14 14:38:55 -04:00
Whymarrh Whitby
28c4001f52 Update auto-logout to recognize idle time in background (#6593)
* Fix wording of autoLogoutTimeLimitDescription

* AppStateController and update auto-logout functionality
2019-05-13 13:46:09 -02:30
Thomas Huang
08e8fb21dc
Merge pull request #6568 from MetaMask/feature/gaba-phishing-controller
feature: integrate gaba/PhishingController
2019-05-10 13:43:20 -07:00
Dan J Miller
13be683701
New settings custom rpc form (#6490)
* Add networks tab to settings, with header.

* Adds network list to settings network tab.

* Adds form to settings networks tab and connects it to network list.

* Network tab: form adding and editing working

* Settings network form properly handles input errors

* Add translations for settings network form

* Clean up styles of settings network tab.

* Add popup-view styles and behaviour to settings network tab.

* Fix save button on settings network form

* Adds 'Add Network' button and addMode to settings networks tab

* Lint fix for settings networks tab addition

* Fix navigation in settings networks tab.

* Editing an rpcurl in networks tab does not create new network, just changes rpc of old

* Fix layout of settings tabs other than network

* Networks dropdown 'Custom Rpc' item links to networks tab in settings.

* Update settings sidebar networks subheader.

* Make networks tab buttons width consistent with input widths in extension view.

* Fix settings screen subheader height in popup view

* Fix height of add networks button in popup view

* Add optional label to chainId and symbol form labels in networks setting tab

* Style fixes for networks tab headers

* Add ability to customize block explorer used by custom rpc

* Stylistic improvements+fixes to custom rpc form.

* Hide cancel button.

* Highlight and show network form of provider by default.

* Standardize network subheader name to 'Networks'

* Update e2e tests for new settings network form

* Update unit tests for new rpcPrefs prop

* Extract blockexplorer url construction into method.

* Fix broken styles on non-network tabs in popup mode

* Fix block explorer url links for cases when provider in state has not been updated.

* Fix vertical spacing of network form

* Don't allow click of save button on network form if nothing has changed

* Ensure add network button is shown in popup view

* Lint fix for networks tab

* Fix block explorer url preference setting.

* Fix e2e tests for custom blockexplorer in account details modal changes.

* Update integration test states to include frequentRpcList property

* Fix some capitalizations in en/messages.json

* Remove some console.logs added during custom rpc form work

* Fix external account link text and url for modal and dropdown.

* Documentation, url validation, proptype required additions and lint fixes on network tab and form.
2019-05-09 14:57:14 -02:30
bitpshr
77d3bc252d feature: integrate gaba/PhishingController 2019-05-08 17:56:52 -04:00
Whymarrh Whitby
094e4cf555 Check for unused function arguments (#6583)
* eslint: Check for unused function arguments

* eslint: Ignore unused '_' in argument list

Also allow any number of '_' e.g., '__' or '___' which is to be used sparingly

* Remove and rename unused arguments
2019-05-08 15:51:33 -04:00
kumavis
2845398c3d Refactor ProviderApprovalController to use rpc and publicConfigStore (#6410)
* Ensure home screen does not render if there are unapproved txs (#6501)

* Ensure that the confirm screen renders before the home screen if there are unapproved txs.

* Only render confirm screen before home screen on mount.

* inpage - revert _metamask api to isEnabled isApproved isUnlocked
2019-05-03 13:32:05 -04:00
Dan J Miller
4fea9d0cc2
Send metrics event from backend for on chain transaction failures (#6500)
* Send metrics event from backend for on chain transaction failures

* Passes state object to backEndMetaMetricsEvent, and adds getMetaMetricState selector
2019-04-29 03:48:40 -02:30
Sneh Koul
6a60562d66 Opens the original webpage from where installation of MetaMask was re… (#6272)
* Opens the original webpage from where installation of MetaMask was requested

* Asking for dynamic permissions

* code for forwarder/without extra permissions

* Lint fix for onboardingComplete message sending code.
2019-04-24 10:49:38 -07:00
kumavis
89693a2315 metamask-controller - use improved provider-as-middleware utility 2019-04-04 22:11:28 +08:00
Thomas Huang
a46ec83c9b Remove NoticeController (#6382) 2019-04-01 22:33:54 -02:30
kumavis
a64855ef49 notices - markAllNoticesRead - use async/await 2019-03-29 12:03:31 +08:00
Thomas Huang
c43374a553 Clear notices when setCompletedOnboarding is called 2019-03-20 20:26:48 -05:00
Paul Bouchon
daae155ce2 GABA: Integrate AddressBookController (#5847)
* gaba: integrate AddressBookController

* pin gaba version and update lockfile
2019-03-11 18:40:41 -10:00
Dan J Miller
c757366355
Metametrics (#6171)
* Add metametrics provider and util.

* Add backend api and state for participating in metametrics.

* Add frontend action for participating in metametrics.

* Add metametrics opt-in screen.

* Add metametrics events to first time flow.

* Add metametrics events for route changes

* Add metametrics events for send and confirm screens

* Add metametrics events to dropdowns, transactions, log in and out, settings, sig requests and main screen

* Ensures each log in is measured as a new visit by metametrics.

* Ensure metametrics is called with an empty string for dimensions params if specified

* Adds opt in metametrics modal after unlock for existing users

* Adds settings page toggle for opting in and out of MetaMetrics

* Switch metametrics dimensions to page level scope

* Lint, test and translation fixes for metametrics.

* Update design for metametrics opt-in screen

* Complete responsive styling of metametrics-opt-in modal

* Use new chart image on metrics opt in screens

* Incorporate the metametrics opt-in screen into the new onboarding flow

* Update e2e tests to accomodate metametrics changes

* Mock out metametrics network requests in integration tests

* Fix tx-list integration test to support metametrics provider.

* Send number of tokens and accounts data with every metametrics event.

* Update metametrics event descriptor schema and add new events.

* Fix import tos bug and send gas button bug due to metametrics changes.

* Various small fixes on the metametrics branch.

* Add origin custom variable type to metametrics.util

* Fix names of onboarding complete actions (metametrics).

* Fix names of Metrics Options actions (metametrics).

* Clean up code related to metametrics.

* Fix bad merge conflict resolution and improve promise handling in sendMetaMetrics event and confrim tx base

* Don't send a second metrics event if user has gone back during first time flow.

* Collect metametrics on going back from onboarding create/import.

* Add missing custom variable constants for metametrics

* Fix metametrics provider

* Make height of opt-in modal responsive.

* Adjust text content for opt-in modal.

* Update metametrics event names and clean up code in opt-in-modal

* Put phishing warning step next to last in onboarding flow

* Link terms of service on create and import screens of first time flow

* Add subtext to options on the onboarding select action screen.

* Fix styling of bullet points on end of onboarding screen.

* Combine phishing warning and congratulations screens.

* Fix placement of users if unlocking after an incomplete onboarding import flow.

* Fix capitalization in opt-in screen

* Fix last onboarding screen translations

* Add link to 'Learn More' on the last screen of onboarding

* Code clean up: metametrics branch

* Update e2e tests for phishing warning step removal

* e2e tests passing on metametrics branch

* Different tracking urls for metametrics on development and prod
2019-03-05 12:15:01 -03:30
Dan Finlay
f507f2a927 Feature Flag + Mobile Sync (#5955) 2019-02-25 15:40:13 -03:30
Jenny Pollack
c6e84ccf45 account tracker - update accounts from balanceChecker contract (#6181)
* account tracker - update accounts from balanceChecker contract

* fall back to getBalance if the contract query fails
2019-02-20 09:12:12 -10:00
Paul Bouchon
2f7d449427 EIP-1193: standard provider API (#6170)
* EIP-1193: Implement new provider API

* EIP-1193: Updated implementation

* Remove test file

* Fix tests

* Update ping check

* Update logic

* PR feedback
2019-02-19 16:42:08 -08:00
Whymarrh Whitby
ce543f059e
Merge pull request #6137 from whymarrh/es6-background
Sprinkle ES6 onto background files
2019-02-14 10:43:56 -03:30
Whymarrh Whitby
ae084cef6c Update MetaMaskController to use ES6 destructuring, const, let 2019-02-12 10:36:15 -03:30
frankiebee
7e64a578a4 recent-blocks - dont listen for block when on infura providers 2019-02-11 09:16:03 -10:00
Whymarrh Whitby
f3a7054f6b Add announcement for users migrated to the new UI 2019-02-05 08:49:55 -03:30
Frankie
df3169d1c7
I#5956 fix2 dont overwrite existing rpc settings (#6044)
* mm-controller - dont overwrite existing rpc settings

* ui-networkDropdown - dont pass old network as chainId

* add methods preferencesController.updateRpc and metamaskController.updateAndSetCustomRpc

* use updateAndSetCustomRpc in settings to allow rpcs to be updated

* use new rpc as nickname if no nick name has been supplied

* fix update rpc method
2019-01-29 08:13:51 -10:00
Alexander Tseung
fba17d77de Refactor first time flow, remove seed phrase from state (#5994)
* Refactor and fix styling for first time flow. Remove seed phrase from persisted metamask state

* Fix linting and tests

* Fix translations, initialization notice routing

* Fix drizzle tests

* Fix e2e tests

* Fix integration tests

* Fix styling

* Fix migration naming from 030 to 031

* Open extension in browser when user has not completed onboarding
2019-01-23 11:55:34 -03:30
Esteban Miño
e21dfd1862 Use Parity on-chain registry only when is needed (#6052)
* add and use knownMethodData to avoid infura requests

* dataMethod to methodData and check empty response
2019-01-22 10:22:56 -08:00
Alexander Tseung
d8ab9cc002
Group transactions by nonce (#5886) 2018-12-09 12:48:06 -08:00
Dan Miller
9b9a2cc2e0 Adds createSpeedUpTransaction to txController 2018-12-04 00:06:05 -03:30
Dan J Miller
4c24555545 Save recent network balances in local storage (#5843)
* Use selector for state.metamask.accounts in all cases.

* Default to cached balance when selecting metamask accounts

* Adds the cached-balances controller

* Documentation and small codes fixes for #5843

Co-Authored-By: danjm <danjm.com@gmail.com>
2018-11-30 14:51:24 -08:00
Bruno Barbieri
f2066432ba
Use Array.includes 2018-11-26 13:27:49 -05:00
brunobar79
fb94c1bae7 remove extra semicolon 2018-11-20 12:57:58 -05:00
brunobar79
3abf9ec7db consider hw wallets 2018-11-20 12:48:43 -05:00
Whymarrh Whitby
1988e1e96b ESLint fixes (#5775)
* eslint . --fix

* Upgrade all ESLint warnings to errors
2018-11-16 14:54:55 -10:00
Paul Bouchon
0549782595
Update Balanc3 API (#5744)
* Update balanc3 API used in TokenRatesController

* Remove demo URL and use nativeCurrency when fetching token rates
2018-11-13 14:57:43 -05:00
bitpshr
34d80f21e2 Clear cached approval after rejection 2018-11-06 14:13:27 -05:00
bitpshr
d4171ccea5 Disable approval caching 2018-11-05 15:07:09 -08:00
bitpshr
cc1bab6ebb Differentiate locked and enabled 2018-11-05 15:07:09 -08:00
bitpshr
d7618bd5c6 Code bath 2018-11-05 15:07:09 -08:00
bitpshr
ba40fcbcb4 Handle logout gracefully 2018-11-05 15:07:09 -08:00
bitpshr
84874a639d Add isUnlocked provider hook 2018-11-05 15:07:09 -08:00
bitpshr
226601a956 EIP-1102: add user privacy option 2018-11-05 15:07:09 -08:00
bitpshr
89b4aa5d62 EIP-1102: Add option to force-enable provider 2018-11-05 15:07:09 -08:00
bitpshr
c76c9ca2c8 EIP-1102: updated implementation 2018-11-05 15:07:09 -08:00
kumavis
1bb4a8428c
Merge pull request #5596 from MetaMask/validateSignTypedData
Validate signTypedData signer/address in eth-json-rpc-middleware
2018-10-29 20:11:04 -04:00
HackyMiner
54a8ade266 Add support for RPC endpoints with custom chain IDs (#5134) 2018-10-26 10:26:43 +02:00
Thomas
8c0e5e97e5 Add version to unapprovedMessage 2018-10-24 20:24:42 -07:00
Thomas
95b92a1ddc Remove commented out/unused methods 2018-10-24 20:13:40 -07:00
Thomas
1d65687ce4 Validate signTypedData in eth-json-rpc-middleware 2018-10-24 20:03:55 -07:00
Esteban Miño
7c4f98ffd6 specific add and remove methods for frequentRpcList (#5554) 2018-10-19 17:50:54 -02:30
kumavis
c289baa17a
Merge pull request #5127 from MetaMask/account-tracker-network-change
Bug Fix: Force AccountTracker to update balances on network change
2018-10-17 18:56:54 -04:00
Alexander Tseung
badebe017f
Adds toggle for primary currency (#5421)
* Add UnitInput component

* Add CurrencyInput component

* Add UserPreferencedCurrencyInput component

* Add UserPreferencedCurrencyDisplay component

* Add updatePreferences action

* Add styles for CurrencyInput, CurrencyDisplay, and UnitInput

* Update SettingsTab page with Primary Currency toggle

* Refactor currency displays and inputs to use UserPreferenced displays and inputs

* Add TokenInput component

* Add UserPreferencedTokenInput component

* Use TokenInput in the send screen

* Fix unit tests

* Fix e2e and integration tests

* Remove send/CurrencyDisplay component

* Replace diamond unicode character with Eth logo. Fix typos
2018-10-17 07:03:29 +08:00
Bruno Barbieri
17b9f4c0db
Merge pull request #5458 from MetaMask/provider-subs
Feature: Subscription support
2018-10-09 13:25:13 -04:00
kumavis
354f8c0d7d provider - enable subscription support (newHeads, logs) 2018-10-08 11:55:07 -04:00
Dan Finlay
a909af92aa
Merge branch 'develop' into update-balance-on-unlock 2018-10-05 10:46:48 -07:00
Dan Finlay
507397f6c3 Fix updating of pending transactions
Transaction statuses were not being properly updated when:

- MetaMask was unlocked
- The network was changed

This PR fixes both of those. Fixes #5174
2018-10-05 10:35:14 -07:00
Dan Finlay
bc6d32e51e Update all balances on password unlock 2018-10-05 10:32:28 -07:00
Dan Finlay
c49d854b55 Increase suggested gas percentile to 65 (#5359)
* Increase suggested gas percentile to 65

I keep submitting transactions then waiting a long time. Apparently 50th percentile isn't enough.

* Update test for getGasPrice
2018-10-04 18:38:05 -02:30
Whymarrh Whitby
58d856bd84 Add domain whitelist method to MetaMaskController 2018-10-02 10:43:46 -02:30
HackyMiner
13a1d46720 support editable customRPC (#5267)
* support editable customRPC #5246

* remove rpcList size restriction
2018-09-28 17:23:58 -02:30
kumavis
59ab595b5e
Merge branch 'develop' into account-tracker-network-change 2018-09-28 02:45:16 -04:00
bitpshr
c4caba1317 bugfix: update eth_signTypedData_v3 parameter order 2018-09-26 10:00:12 -04:00
Esteban Miño
4d82df6995
Fix MetaMask web3 version (#5352) 2018-09-25 16:14:37 -03:00
Dan Miller
19d72c9b0b Adds getPendingNonce method to provider initialization options in metamask-controller. 2018-09-21 15:29:42 -02:30
bitpshr
42fdcf6239 Update new method namespace from v2 to v3 2018-09-13 15:42:27 -04:00
bitpshr
36dd0354e7 Implement latest EIP-712 protocol 2018-09-13 15:40:57 -04:00
Whymarrh Whitby
d60991ec88 Delete ConfigManager, replacing its usages with PreferencesController 2018-09-11 09:39:16 -07:00
Frankie
1552fe1c3e
Merge pull request #5216 from MetaMask/tx-cancel
Add createCancelTransaction method
2018-09-10 13:29:29 -10:00
Alexander Tseung
43de189d06 Add createCancelTransaction method 2018-09-10 12:48:01 -07:00