Commit 65c0a30
authored
feat: Expose all PerpsController methods through messenger (#28257)
## **Description**
Mirrors [MetaMask/core#8352](MetaMask/core#8352)
for the mobile PerpsController.
- Expand `MESSENGER_EXPOSED_METHODS` from 35 to 84 methods
(alphabetized)
- Auto-generate `PerpsController-method-action-types.ts` using
`messenger-generate-action-types` CLI
- Export `PerpsControllerGetStateAction` and all individual action types
- Add `generate-method-action-types` check/fix scripts to
`lint`/`lint:fix`
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes: N/A
## **Manual testing steps**
N/A — type-only changes, no user-facing behavior
## **Screenshots/Recordings**
### **Before**
N/A
### **After**
N/A
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Expands the messenger-exposed surface area of `PerpsController`, which
could affect callers and permissions if any method was not intended to
be remotely invokable. Also adds a new lint-time codegen check that may
introduce CI failures if generation drifts across environments.
>
> **Overview**
> **Exposes the full `PerpsController` API through the messenger** by
expanding and alphabetizing `MESSENGER_EXPOSED_METHODS`, and introduces
a named `PerpsControllerGetStateAction` type.
>
> **Switches Perps messenger action typing to generated output**:
`PerpsController-method-action-types.ts` is regenerated to include
JSDoc’d action types for all controller methods and `index.ts` now
re-exports these individual action types.
>
> **Build/CI enforcement changes**: bumps `@metamask/messenger` to
`^1.1.0` (for the codegen CLI) and wires
`messenger-generate-action-types` into `lint`/`lint:fix` via new
`generate-method-action-types` scripts to keep generated types in sync.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0fe513d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 3e78a6a commit 65c0a30
5 files changed
Lines changed: 1092 additions & 104 deletions
File tree
- app/controllers/perps
0 commit comments