Metamask-extension: Add tokens on a per account basis

Created on 13 Mar 2018  路  5Comments  路  Source: MetaMask/metamask-extension

Currently, any token that has been added for any account will be displayed in the token list of all accounts.

Desired functionality is for users to be able to add tokens on a per account; users should only see token's in lists for accounts where they've explicitly added them. If a user removes a token, it should only be removed from the account that was selected when they removed it.

In the future, we might want to add the ability to both "Add token to this account." and "Add token to all accounts."

This was already more or less requested here: https://github.com/MetaMask/metamask-extension/issues/2513

Required steps to resolve this issue include:

  • [ ] Update the addToken method of app/scripts/controllers/preferences.js so that it stores tokens per address.
  • [ ] Update the removeToken method of app/scripts/controllers/preferences.js so that it stores token on a per address basic.
  • [ ] add a migration to accomodate current users whose tokens are NOT stored per address
  • [ ] update ui/app/add-token.js, ui/app/components/modals/hide-token-confirmation-modal.js and ui/app/actions.js to accomodate these new background changes.
L03-UI L04-backencore P2-sooner T08-featureRequest

Most helpful comment

Add tokens should also be per network. If I add a testnet token on Rinkeby, it does not make sense to track that address on mainnet. As a dev working with multiple testnet tokens, this is cluttering my UI a lot.

That said, address specific would help me since I can have a separate account for dev work.

All 5 comments

Add tokens should also be per network. If I add a testnet token on Rinkeby, it does not make sense to track that address on mainnet. As a dev working with multiple testnet tokens, this is cluttering my UI a lot.

That said, address specific would help me since I can have a separate account for dev work.

Bumping to sprint 5, since we may be adding per-network login soon, so this implementation will likely be impacted by that new architecture, so saving us some time by postponing it.

since https://github.com/MetaMask/metamask-extension/pull/4683 was merged, we could auto-detect per account & network. (Would resolve #4518 as well.)

@danjm with this PR this feature is working, all changes were made from preferencesController. I'm working in UI changes and the migration.

@cjeria any thoughts for this UI?

@estebanmino no UI changes necessary for this feature. @danjm am I missing something here?

Was this page helpful?
0 / 5 - 0 ratings