Conversation
…ations and rename getXAccount
… types and connectX signature
… and update state
… satisfy Json return type
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 b673db4. Configure here.
| 'ProfileService:createProfile', | ||
| params, | ||
| ); | ||
| const mapped = this.#mapApiResponseToProfile(response); |
There was a problem hiding this comment.
Lint error: Argument of type 'unknown' is not assignable to parameter of type '{ profile_id: string; username: string; display_name: string; bio: string | null; linked_addresses: string[]; avatar_url: string | null; trading_privacy: "private" | "public"; connected_to_x: boolean; created_at: string; updated_at: string; }'.
| const mapped = this.#mapApiResponseToProfile(response); | ||
| this.update((state) => { | ||
| state.metamaskProfile = mapped; | ||
| if (response.x_profile) { |
There was a problem hiding this comment.
Lint error: 'response' is of type 'unknown'.
gantunesr
left a comment
There was a problem hiding this comment.
Looks good overall, just need to resolve lint failures

Explanation
@metamask/profile-controller, a new package for managing MetaMask user profile stateProfileServicecommunicates with the MetaMask Profile API (profile.api.cx.metamask.io), exposinggetProfile,createProfile,replaceProfile,updateProfile,deleteProfile,checkUsernameAvailability,getXAuthUrl,connectX, andgetXAccountvia the messenger, with superstruct validation on all inputs and responsesProfileControllermanages profile state derived from the API and exposes all operations via the messenger; also exportsuseGetProfileanduseCheckUsernameAvailabilityReact hooks for UI components via@metamask/react-data-queryReferences
N/A
Checklist
Note
Medium Risk
New authenticated profile and OAuth surface area with persisted user state; consumers must wire ProfileService, auth, and messenger correctly before enabling in production clients.
Overview
Introduces
@metamask/profile-controller, a new monorepo package for MetaMask user profiles (username, bio, avatar, linked addresses, trading privacy) and optional X (Twitter) linking via OAuth PKCE.ProfileServiceis aBaseDataServiceclient for the MetaMask Profile API: CRUD on profiles, username availability checks, and X auth/connect/account endpoints. Requests useAuthenticationController:getBearerTokenand superstruct validation on inputs and responses; reads/writes go through the messenger query/mutation cache where applicable.ProfileControllerholds persistedmetamaskProfile/ optionalxProfilestate, maps API snake_case to camelCase, and exposes create/replace/update/delete, username checks, and X flow helpers through messenger actions (delegating mutations toProfileService).Also ships
useGetProfileanduseCheckUsernameAvailabilityhooks wired to@metamask/react-data-query, plus tests, package scaffolding, and repo wiring (README dependency graph, CODEOWNERS /codeowners.ts/teams.json, root tsconfig references, oxlint suppression for jest config).Reviewed by Cursor Bugbot for commit e8e3851. Bugbot is set up for automated code reviews on this repo. Configure here.