Skip to content

chore: Update Web3Auth controllers to expose all methods through messenger#8219

Merged
Mrtenz merged 11 commits intomainfrom
mrtenz/web3auth-method-actions
Mar 20, 2026
Merged

chore: Update Web3Auth controllers to expose all methods through messenger#8219
Mrtenz merged 11 commits intomainfrom
mrtenz/web3auth-method-actions

Conversation

@Mrtenz
Copy link
Copy Markdown
Member

@Mrtenz Mrtenz commented Mar 17, 2026

Explanation

This updates the following controllers to expose all methods through the messenger in a standardised way:

  • SeedlessOnboardingController.
  • ShieldController.
  • SubscriptionController.
  • ClaimsController.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Expands the messenger API surface for two controllers (including seedless onboarding auth/token flows), so incorrect wiring or consumer usage could impact authentication flows even though underlying method logic is largely unchanged.

Overview
Exposes all public methods on ClaimsController and SeedlessOnboardingController as messenger actions. Both controllers now register method handlers via registerMethodActionHandlers, and new auto-generated *-method-action-types.ts files define strongly-typed action names/handlers.

For @metamask/claims-controller, these new action types are exported from src/index.ts, and unit tests are updated to call controller methods through the rootMessenger action names (e.g. ClaimsController:getClaims) instead of invoking methods directly.

Both packages add a generate-method-action-types script and the tsx dev dependency, and their changelogs document the newly available messenger actions.

Written by Cursor Bugbot for commit 0ceaf4d. This will update automatically on new commits. Configure here.

@Mrtenz Mrtenz marked this pull request as ready for review March 17, 2026 12:50
@Mrtenz Mrtenz requested review from a team as code owners March 17, 2026 12:50
@@ -126,8 +143,8 @@ export type SeedlessOnboardingControllerMessenger = Messenger<
* @param encryptor - The encryptor to use for encrypting and decrypting seedless onboarding vault.
*/
export type SeedlessOnboardingControllerOptions<
EncryptionKey,
SupportedKeyDerivationParams,
EncryptionKey = encryptionUtils.EncryptionKey,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it necessary to change this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extraction script assumes we can use Controller['method'], but without these defaults that would result in a TypeScript error because the type parameters are missing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right, I see. That makes sense.

Comment thread packages/subscription-controller/CHANGELOG.md Outdated
Comment thread packages/shield-controller/CHANGELOG.md Outdated
Comment thread packages/seedless-onboarding-controller/CHANGELOG.md Outdated
@Mrtenz Mrtenz force-pushed the mrtenz/web3auth-method-actions branch from 8755821 to c1e8245 Compare March 18, 2026 12:53
GuillaumeRx
GuillaumeRx previously approved these changes Mar 18, 2026
@Mrtenz Mrtenz force-pushed the mrtenz/web3auth-method-actions branch from 3fa2720 to f18b535 Compare March 19, 2026 10:47
GuillaumeRx
GuillaumeRx previously approved these changes Mar 19, 2026
@mcmire
Copy link
Copy Markdown
Contributor

mcmire commented Mar 19, 2026

Looks good, other than the conflicts.

@Mrtenz Mrtenz force-pushed the mrtenz/web3auth-method-actions branch from f18b535 to 0ceaf4d Compare March 20, 2026 09:27
SeedlessOnboardingControllerActions,
SeedlessOnboardingControllerEvents,
} from './SeedlessOnboardingController';
export type {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should export all the public methods.


const log = createModuleLogger(projectLogger, controllerName);

const MESSENGER_EXPOSED_METHODS = [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Are we exposing every public methods to messenger now?

@Mrtenz Mrtenz added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit b00250f Mar 20, 2026
326 checks passed
@Mrtenz Mrtenz deleted the mrtenz/web3auth-method-actions branch March 20, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants