Skip to content

feat(seedless-onboarding-controller): generic encryptor result type aligned with KeyringController#8411

Draft
ieow wants to merge 3 commits intomainfrom
cw/seedless-generic-encryptor-type
Draft

feat(seedless-onboarding-controller): generic encryptor result type aligned with KeyringController#8411
ieow wants to merge 3 commits intomainfrom
cw/seedless-generic-encryptor-type

Conversation

@ieow
Copy link
Copy Markdown
Contributor

@ieow ieow commented Apr 9, 2026

Explanation

Summary
This change aligns SeedlessOnboardingController vault encryption typing with the full Encryptor type from @metamask/keyring-controller, including the encryption result type. Callers can now thread a third generic, EncryptionResult, so the controller’s encryptor matches KeyringController’s three-parameter Encryptor shape instead of a local two-parameter alias.

What changed
SeedlessOnboardingController and SeedlessOnboardingControllerOptions now take an optional third type parameter, EncryptionResult, bounded by EncryptionResultConstraint and defaulting to DefaultEncryptionResult.
The internal #vaultEncryptor and options encryptor field use Encryptor<EncryptionKey, SupportedKeyDerivationParams, EncryptionResult> from @metamask/keyring-controller.
VaultEncryptor was removed from types.ts; consumers should use Encryptor from @metamask/keyring-controller with explicit key, derivation params, and encryption result types.
Tests and MockVaultEncryptor were updated to use Encryptor and DefaultEncryptionResult instead of VaultEncryptor / raw EncryptionResult from browser-passworder where appropriate.
Breaking changes
VaultEncryptor is removed — replace with Encryptor from @metamask/keyring-controller and supply the third type argument when needed.
SeedlessOnboardingControllerOptions no longer defaults EncryptionKey and SupportedKeyDerivationParams — when referencing the options type, pass both (and optionally EncryptionResult) explicitly.
Details and migration notes are in packages/seedless-onboarding-controller/CHANGELOG.md under Unreleased.

References

MetaMask/metamask-mobile#27384

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
Medium risk due to breaking TypeScript API/typing changes (SeedlessOnboardingControllerOptions generics and removal of VaultEncryptor) that require downstream updates, though runtime behavior is unchanged.

Overview
Updates SeedlessOnboardingController and SeedlessOnboardingControllerOptions to support a third generic EncryptionResult, constrained by EncryptionResultConstraint and defaulting to DefaultEncryptionResult, so the vault encryptor matches @metamask/keyring-controller’s full Encryptor<EncryptionKey, SupportedKeyDerivationParams, EncryptionResult> typing.

Removes the local VaultEncryptor type alias and updates mocks/tests (MockVaultEncryptor, test helpers) to use Encryptor plus DefaultEncryptionResult, with changelog entries documenting the new generics and breaking type changes.

Reviewed by Cursor Bugbot for commit 6de2e9e. Bugbot is set up for automated code reviews on this repo. Configure here.

@ieow
Copy link
Copy Markdown
Contributor Author

ieow commented Apr 9, 2026

@metamaskbot publish-preview

@ieow ieow changed the title feat: generic encryptor type for seedless controller feat(seedless-onboarding-controller): generic encryptor result type aligned with KeyringController Apr 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.0.0-preview-26cb9fc
@metamask-previews/accounts-controller@37.2.0-preview-26cb9fc
@metamask-previews/address-book-controller@7.1.1-preview-26cb9fc
@metamask-previews/ai-controllers@0.6.3-preview-26cb9fc
@metamask-previews/analytics-controller@1.0.1-preview-26cb9fc
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-26cb9fc
@metamask-previews/announcement-controller@8.1.0-preview-26cb9fc
@metamask-previews/app-metadata-controller@2.0.1-preview-26cb9fc
@metamask-previews/approval-controller@9.0.1-preview-26cb9fc
@metamask-previews/assets-controller@5.0.0-preview-26cb9fc
@metamask-previews/assets-controllers@103.1.1-preview-26cb9fc
@metamask-previews/base-controller@9.0.1-preview-26cb9fc
@metamask-previews/base-data-service@0.1.1-preview-26cb9fc
@metamask-previews/bridge-controller@70.0.1-preview-26cb9fc
@metamask-previews/bridge-status-controller@70.0.5-preview-26cb9fc
@metamask-previews/build-utils@3.0.4-preview-26cb9fc
@metamask-previews/chain-agnostic-permission@1.5.0-preview-26cb9fc
@metamask-previews/claims-controller@0.5.0-preview-26cb9fc
@metamask-previews/client-controller@1.0.1-preview-26cb9fc
@metamask-previews/compliance-controller@2.0.0-preview-26cb9fc
@metamask-previews/composable-controller@12.0.1-preview-26cb9fc
@metamask-previews/config-registry-controller@0.2.0-preview-26cb9fc
@metamask-previews/connectivity-controller@0.2.0-preview-26cb9fc
@metamask-previews/controller-utils@11.20.0-preview-26cb9fc
@metamask-previews/core-backend@6.2.1-preview-26cb9fc
@metamask-previews/delegation-controller@2.1.0-preview-26cb9fc
@metamask-previews/earn-controller@11.2.1-preview-26cb9fc
@metamask-previews/eip-5792-middleware@3.0.3-preview-26cb9fc
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.0-preview-26cb9fc
@metamask-previews/eip1193-permission-middleware@1.0.3-preview-26cb9fc
@metamask-previews/ens-controller@19.1.1-preview-26cb9fc
@metamask-previews/eth-block-tracker@15.0.1-preview-26cb9fc
@metamask-previews/eth-json-rpc-middleware@23.1.1-preview-26cb9fc
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-26cb9fc
@metamask-previews/foundryup@1.0.1-preview-26cb9fc
@metamask-previews/gas-fee-controller@26.1.1-preview-26cb9fc
@metamask-previews/gator-permissions-controller@3.0.1-preview-26cb9fc
@metamask-previews/geolocation-controller@0.1.2-preview-26cb9fc
@metamask-previews/json-rpc-engine@10.2.4-preview-26cb9fc
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-26cb9fc
@metamask-previews/keyring-controller@25.2.0-preview-26cb9fc
@metamask-previews/logging-controller@8.0.1-preview-26cb9fc
@metamask-previews/message-manager@14.1.1-preview-26cb9fc
@metamask-previews/messenger@1.1.1-preview-26cb9fc
@metamask-previews/messenger-cli@0.1.0-preview-26cb9fc
@metamask-previews/money-account-controller@0.1.0-preview-26cb9fc
@metamask-previews/multichain-account-service@8.0.1-preview-26cb9fc
@metamask-previews/multichain-api-middleware@2.0.0-preview-26cb9fc
@metamask-previews/multichain-network-controller@3.0.6-preview-26cb9fc
@metamask-previews/multichain-transactions-controller@7.0.4-preview-26cb9fc
@metamask-previews/name-controller@9.1.1-preview-26cb9fc
@metamask-previews/network-controller@30.0.1-preview-26cb9fc
@metamask-previews/network-enablement-controller@5.0.2-preview-26cb9fc
@metamask-previews/notification-services-controller@23.0.1-preview-26cb9fc
@metamask-previews/permission-controller@12.3.0-preview-26cb9fc
@metamask-previews/permission-log-controller@5.1.0-preview-26cb9fc
@metamask-previews/perps-controller@2.0.0-preview-26cb9fc
@metamask-previews/phishing-controller@17.1.1-preview-26cb9fc
@metamask-previews/polling-controller@16.0.4-preview-26cb9fc
@metamask-previews/preferences-controller@23.1.0-preview-26cb9fc
@metamask-previews/profile-metrics-controller@3.1.3-preview-26cb9fc
@metamask-previews/profile-sync-controller@28.0.2-preview-26cb9fc
@metamask-previews/ramps-controller@13.1.0-preview-26cb9fc
@metamask-previews/rate-limit-controller@7.0.1-preview-26cb9fc
@metamask-previews/react-data-query@0.2.0-preview-26cb9fc
@metamask-previews/remote-feature-flag-controller@4.2.0-preview-26cb9fc
@metamask-previews/sample-controllers@4.0.4-preview-26cb9fc
@metamask-previews/seedless-onboarding-controller@9.1.0-preview-26cb9fc
@metamask-previews/selected-network-controller@26.1.0-preview-26cb9fc
@metamask-previews/shield-controller@5.1.1-preview-26cb9fc
@metamask-previews/signature-controller@39.1.2-preview-26cb9fc
@metamask-previews/social-controllers@0.1.0-preview-26cb9fc
@metamask-previews/storage-service@1.0.1-preview-26cb9fc
@metamask-previews/subscription-controller@6.1.2-preview-26cb9fc
@metamask-previews/transaction-controller@64.0.0-preview-26cb9fc
@metamask-previews/transaction-pay-controller@19.1.0-preview-26cb9fc
@metamask-previews/user-operation-controller@41.2.0-preview-26cb9fc

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.

1 participant