MetaMask / MetaMask/core

As a non-controller with empty state, `TokenDetectionController` should not inherit from `BaseController`

Open
#4,435 0 comments 0 reactions 0 assignees View on GitHub
Epic team-wallet-framework wf-non-controller-cleanup
Dominant language
TypeScript
Stars
413
Forks
308
Avg merge
1d 4h
Merged PRs (30d)
253

Description

## Requirements

- Should not inherit from `BaseControllerV1` or `BaseController`.
- Should not use the `Controller` suffix in its name.
- Types for `ControllerState`, `ControllerGetStateAction`, `ControllerStateChangeEvent` should not be defined or exported.
- Should accept `messenger` as a constructor option.
- `messenger` should be defined with allowlists that enable the class to make all communications with other controller classes that were previously supported.
- ~Should not accept any class method callbacks as constructor options. Messenger actions/events should be used to communicate instead.~
- ~In some cases, methods that implement API interactions should be extracted into a dedicated `service` class.~

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating TokenDetectionController and its BaseControllerV1/BaseController references, then inspect the existing controller communications and Messenger allowlists. Done means the class no longer uses the controller inheritance, naming, or state types described here and can communicate with the previously supported controller classes through its messenger.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.