c079c4320e
* UX: Multichain: Account Menu List * Move to using stylesheet * Add hover state * Implement George's suggestions * Add connected site avatar * Add hardware tag * Create story for selected hardware item * Progress on the AccountListItemMenu * Add story for AccountListItemMenu * Better position the account menu * Fix AvatarFavicon missing name prop * Update menu options label to be account specific * Update text of 'View on Explorer' * Add AccountListMenu component * Move all items to multichain directory * Fix paths * Fix linting, use AvatarIcon * Add title and close button to account menu * Center the popover title * Add search functionality * Implementation WIP * Add MULTICHAIN feature flag * Add MULTICHAIN feature flag, add actions for menu items * Properly dispatch events * Fix search box padding * Fix sizing of menu item text * Fix isRequired * Fix alignment of the popover * Update label for hardware wallet items, add text for no search results * Update keyring retreival to remove account and add label * Fix storybook * Fix double link click issue, prevent wrapping of values * Use labelProps for tag variant * Restructure item menu story * Empower storybooks for all new components * Allow only 3 decimals for currencies * Avoid inline styles * Prefix classes with multichain, fix account-list-menu storybook * Close the accounts menu when account details is clicked * Restore tag.js * Create global file for multichain css * Add index file for multichain js * Update file paths * Ensure the block domain is present in menu * Add AccountListItem test * Add AccountListItemMenu tests * Show account connect to current dapp * Improve tests * Make avatar smaller * Add tooltip for account menu * Align icon better * Update snapshot * Rename files to DS standard * Add index files for export * Export all multichain components * Update snapshot * Remove embedded style in popover * Add comments for props, cleanup storybook * Improve test coverage * Improve test code quality * Remove border form avatar * Switch to using the ButtonLink iconName prop * Only show tooltip if character limit is reached * Restore prior search settings * Add test for tooltip |
||
---|---|---|
.. | ||
build | ||
charts | ||
fitness-functions | ||
highlights | ||
lib | ||
states | ||
ts-migration-dashboard | ||
announcer.js | ||
chromereload.js | ||
create-static-server.js | ||
empty.js | ||
generate-beta-commit.js | ||
generate-icon-names.js | ||
generate-lavamoat-policies.js | ||
generate-migration.sh | ||
get-changed-file-names.sh | ||
gource-viz.sh | ||
jest.config.js | ||
metamaskbot-build-announce.js | ||
missing-locale-strings.js | ||
mock-segment.js | ||
README.md | ||
run-ganache.sh | ||
sentry-publish.js | ||
sentry-upload-artifacts.sh | ||
shellcheck.sh | ||
show-deps-install-scripts.js | ||
source-map-explorer.sh | ||
sourcemap-validator.js | ||
static-server.js | ||
stream-flat-map.js | ||
verify-locale-strings.js |
Development
Several files which are needed for developing on MetaMask.
Usually each file or directory contains information about its scope / usage.
Segment
Debugging with the Mock Segment API
To start the Mock Segment API:
- Add/replace the
SEGMENT_HOST
andSEGMENT_WRITE_KEY
variables in.metamaskrc
SEGMENT_HOST='http://localhost:9090' SEGMENT_WRITE_KEY='FAKE'
- Build the project to the
./dist/
folder withyarn dist
- Run the Mock Segment API from the command line
node development/mock-segment.js
Events triggered whilst using the extension will be logged to the console of the Mock Segment API.
More information on the API and its usage can be found here.
Debugging in Segment
To debug in a production Segment environment:
- Create a free account on Segment
- Create a New Workspace
- Add a Source (Node.js)
- Copy the
Write Key
from the API Keys section under Settings - Add/replace the
SEGMENT_HOST
andSEGMENT_WRITE_KEY
variables in.metamaskrc
SEGMENT_HOST='https://api.segment.io' SEGMENT_WRITE_KEY='COPIED_WRITE_KEY'
- Build the project to the
./dist/
folder withyarn dist
Events triggered whilst using the extension will be displayed in Segment's Debugger.
Debugging Segment requests in MetaMask
To opt in to MetaMetrics;
- Unlock the extension
- Open the Account menu
- Click the
Settings
menu item - Click the
Security & Privacy
menu item - Toggle the
Participate in MetaMetrics
menu option to theON
position
You can inspect the requests in the Network
tab of your browser's Developer Tools (background.html)
by filtering for POST
requests to /v1/batch
. The full url will be http://localhost:9090/v1/batch
or https://api.segment.io/v1/batch
respectively.
Sentry
Debugging in Sentry
To debug in a production Sentry environment:
- If you have not already got a Sentry account, you can create a free account on Sentry
- Create a New Sentry Organization
- If you already have an existing Sentry account and workspace, open the sidebar drop down menu, then click
Switch organization
followed byCreate a new organization
- If you already have an existing Sentry account and workspace, open the sidebar drop down menu, then click
- Create a New Project
- Copy the
Public Key
andProject ID
from the Client Keys section under your projects Settings- Select
Settings
in the sidebar menu, then selectProjects
in the secondary menu. Click your project then selectClient Keys (DSN)
from the secondary menu. Click theConfigure
button on theClient Keys
page and copy yourProject Id
andPublic Key
- Select
- Add/replace the
SENTRY_DSN
andSENTRY_DSN_DEV
variables in.metamaskrc
SENTRY_DSN_DEV=https://{SENTRY_PUBLIC_KEY}@sentry.io/{SENTRY_PROJECT_ID} SENTRY_DSN=https://{SENTRY_PUBLIC_KEY}@sentry.io/{SENTRY_PROJECT_ID}
- Build the project to the
./dist/
folder withyarn dist
Errors reported whilst using the extension will be displayed in Sentry's Issues
page.
Source Maps
Debugging production builds using Source Maps
To unbundle the extensions compiled and minified JavaScript using Source Maps:
- Open Chrome DevTools to inspect the
background.html
orhome.html
view - Click on the
Sources
tab in Chrome DevTools - In the Sources tab, click on the
Page
panel - Expand the file directory in the Page panel until you see the source files you're after
- Select a source file in the Page panel
chrome-extension://{EXTENSION_ID}/common-0.js
- Double click the source file to open it in the Workspace
- Right click in the body of the source file and select
Add source map...
- Enter the path to the corresponding source map file, and Click
Add
file:///{LOCAL_FILE_SYSTEM}/metamask-extension/dist/sourcemaps/common-0.js.map
- Repeat the steps above as necessary adding all the relevant source map files
- Your source maps should now be added to the DevTools Console, and you should be able to see your original source files when you debug your code