Skip to content

feat: added authenticated user storage#8260

Open
dovydas55 wants to merge 29 commits intomainfrom
MCA-83
Open

feat: added authenticated user storage#8260
dovydas55 wants to merge 29 commits intomainfrom
MCA-83

Conversation

@dovydas55
Copy link
Copy Markdown
Contributor

@dovydas55 dovydas55 commented Mar 20, 2026

Note

Medium Risk
Adds a new client SDK that makes authenticated fetch calls using bearer tokens and performs runtime response validation; incorrect endpoint/config or validation could break consumers but changes are largely additive and isolated to a new package.

Overview
Introduces a new @metamask/authenticated-user-storage package that provides an AuthenticatedUserStorage TypeScript client for the Authenticated User Storage API, with namespaced accessors for delegations (list, create, revoke) and notification preferences (getNotifications, putNotifications) using optional X-Client-Type headers.

The SDK includes environment-based URL selection (Env), runtime response validation via @metamask/superstruct, standardized AuthenticatedUserStorageError wrapping, and a full Jest test suite with nock fixtures. Monorepo wiring is updated to build/typecheck the new package (tsconfig references), add ownership mappings (CODEOWNERS, teams.json), and include the workspace dependency in yarn.lock.

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

@dovydas55 dovydas55 requested a review from a team as a code owner March 20, 2026 10:50
@dovydas55 dovydas55 requested a review from a team as a code owner March 20, 2026 10:54
@dovydas55 dovydas55 marked this pull request as draft March 20, 2026 15:50
@dovydas55 dovydas55 marked this pull request as ready for review March 24, 2026 11:56
/** Keccak-256 hash uniquely identifying the delegation (0x-prefixed). */
delegationHash: string;
/** Chain ID in hex format (0x-prefixed). */
chainIdHex: string;
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.

q - do we only support EVM?

Wondering if we can change the format to use CAIP-19 to support non-evm? That way we could remove chainId and tokenAddress and just have 1 field for assetId.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@V00D00-child what do you think? i believe cash accounts team already implemted they v1. However we could look into using CAIP-10

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we only support EVM

Yes, the Delegation Framework is only supported on EVM, so I think we should leave out using CAIP-19 for these types

V00D00-child
V00D00-child previously approved these changes Mar 26, 2026
@dovydas55 dovydas55 requested a review from mathieuartu March 27, 2026 15:00
@dovydas55 dovydas55 dismissed stale reviews from Prithpal-Sooriya and V00D00-child via d319cb3 March 27, 2026 15:00
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

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