feat: use @metamask/superstruct exactOptional support#580
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6f7f9ce. Configure here.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
Author
|
Using I did add a changelog entry for |
hmalik88
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Start using
@metamask/superstructobjectandexactOptionalinstead of our local implementation.Note
Medium Risk
Breaking public API on keyring-utils and wide import changes affect every runtime schema in the monorepo; validation semantics should match @metamask/superstruct 3.3.0 but downstream consumers must update imports.
Overview
Breaking:
@metamask/keyring-utilsno longer exportsobject,exactOptional, ortype. Callers across keyring-api, keyring-utils, snap packages, and related workspaces now import those helpers directly from@metamask/superstruct, with dependencies bumped to ^3.3.0.ESLint
no-restricted-importsblocks rawsuperstructand the removed symbols from@metamask/keyring-utils, steering new code to@metamask/superstruct. Local implementations and their unit tests were deleted;strictMaskandselectiveUnionremain in keyring-utils. Type-levelexactOptionalbehavior is covered by retained tsd tests, andKeyringAccountOptionsStructgains a case assertingentropy: nullfails validation.packages/keyring-api/src/eth/types.tsnow importsEthScopefrom./constantsinstead of the package barrel.Reviewed by Cursor Bugbot for commit bf8779e. Bugbot is set up for automated code reviews on this repo. Configure here.