How metamask/core works
Main Components Structure
The system should be organized into these primary layers:
┌─ Core Infrastructure ─────────────────────┐
• Base Controller │
• JSON RPC Engine │
• Controller Utils │
• ┘
• ↑
┌─ Functional Controllers ─────────────────┐
• Network Controller │
• Account Controller │
• Transaction Controller │
• Assets Controllers │
• Permission Controller │
• ┘
• ↑
┌─ Service Controllers ──────────────────────┐
• ENS Controller │
• Gas Fee Controller │
• Notification Services Controller │
• Profile Sync Controller │
• ┘
Key Relationships to Highlight
a. Core Dependencies:
• BaseController as the foundation that most other controllers extend from
• JSON-RPC Engine as the communication backbone
• Controller Utils as shared utilities
b. Controller Interactions:
• Network Controller's central role in managing blockchain connectivity
• Permission Controller's governance of access rights
• Transaction Controller's dependencies on Gas Fee and Network controllers
Important Elements
• Version control integration (GitHub Actions workflow)
• Testing infrastructure connections
• Controller state management flows
• External service integrations
Documentation Integration
References to:
• Package documentation locations
• API endpoints
• Configuration requirements
• Testing frameworks