Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8b0df3f
feat: Types & constants (foundation)
Bigshmow Mar 30, 2026
09ace97
feat: Service implementation
Bigshmow Mar 30, 2026
3087b92
chore: tests
Bigshmow Mar 30, 2026
84accc8
feat: Package wiring (exports, deps, index test, changelog)
Bigshmow Mar 30, 2026
ffc445f
chore: add PR link to changelog entries
Bigshmow Mar 30, 2026
2498465
fix: prettier and import order lint fixes
Bigshmow Mar 30, 2026
dabe571
chore: update yarn.lock for social-controllers dependencies
Bigshmow Mar 30, 2026
2eb492f
fix: use record(string(), number()) instead of structType({}) for Rec…
Bigshmow Mar 30, 2026
eedd4d2
feat: Foundation (types, constants, tsconfig, package.json, yarn.lock…
Bigshmow Mar 31, 2026
720b21a
refactor: migrate SocialService to BaseDataService with messenger and…
Bigshmow Mar 31, 2026
5e3a2b5
chore: tests
Bigshmow Mar 31, 2026
fa958fa
exports
Bigshmow Mar 31, 2026
6be334e
chore: linter
Bigshmow Mar 31, 2026
e50bf03
fix: use null instead of undefined in queryKey values for Json compat…
Bigshmow Mar 31, 2026
3d8d081
fix: set staleTime 0 on follow/unfollow mutations to prevent cached r…
Bigshmow Mar 31, 2026
772d769
fix: move validation inside queryFn and use descriptive variable names
Bigshmow Mar 31, 2026
979c611
Feat/tsa 318 social controller (#8337)
Bigshmow Mar 31, 2026
b907c24
Merge branch 'main' into feat/TSA-317-social-service
zone-live Mar 31, 2026
0acc1b8
chore: run yarn install
zone-live Mar 31, 2026
26038d8
chore: lint fix
zone-live Mar 31, 2026
42b14db
chore: types fix
zone-live Apr 1, 2026
ac7a6cc
Merge branch 'main' into feat/TSA-317-social-service
zone-live Apr 1, 2026
9e398a4
Merge branch 'main' into feat/TSA-317-social-service
zone-live Apr 1, 2026
56d5b9a
chore: regenerate files
zone-live Apr 1, 2026
7479896
chore: update types
zone-live Apr 1, 2026
4775d61
chore: address stale times and cache
zone-live Apr 1, 2026
570c693
Merge branch 'main' into feat/TSA-317-social-service
zone-live Apr 1, 2026
1be0efb
chore: update api url
zone-live Apr 1, 2026
18f78e3
Merge branch 'feat/TSA-317-social-service' of github.com:MetaMask/cor…
zone-live Apr 1, 2026
f942df0
chore: update types
zone-live Apr 1, 2026
9ef1a0b
chore: prettier
zone-live Apr 1, 2026
9ef813a
Merge branch 'main' into feat/TSA-317-social-service
zone-live Apr 1, 2026
b8345e6
chore: bugbot point
zone-live Apr 1, 2026
b608fbb
chore: prettier
zone-live Apr 1, 2026
740d4ec
chore: test update
zone-live Apr 1, 2026
7cb11f5
chore: remove unused dependency
zone-live Apr 1, 2026
bfb4d9f
Merge branch 'main' into feat/TSA-317-social-service
zone-live Apr 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/social-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Initial release ([#8321](https://github.com/MetaMask/core/pull/8321))
- Initial release ([#8321](https://github.com/MetaMask/core/pull/8321), [#8335](https://github.com/MetaMask/core/pull/8335), [#8337](https://github.com/MetaMask/core/pull/8337))
- Add `SocialService` data service wrapping social-api endpoints with superstruct response validation
- Add methods `fetchLeaderboard`, `fetchTraderProfile`, `fetchOpenPositions`, `fetchClosedPositions`, `fetchFollowers`, `fetchFollowing`, `follow`, `unfollow`
- Add `SocialController` extending `BaseController` with messenger actions for state management
- `updateLeaderboard` — fetches leaderboard and persists entries to state
- `followTrader` — follows traders and updates following addresses in state
- `unfollowTrader` — unfollows traders and removes addresses from state
- `updateFollowing` — fetches following list and replaces addresses in state

[Unreleased]: https://github.com/MetaMask/core/
7 changes: 7 additions & 0 deletions packages/social-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@metamask/base-controller": "^9.0.1",
"@metamask/base-data-service": "^0.1.1",
"@metamask/controller-utils": "^11.20.0",
"@metamask/messenger": "^1.0.0",
"@metamask/superstruct": "^3.1.0"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* This file is auto generated.
* Do not edit manually.
*/

import type { SocialController } from './SocialController';

/**
* Fetches the leaderboard and persists the entries to state.
*
* @param options - Optional leaderboard query parameters.
* @returns The leaderboard response from the social-api.
*/
export type SocialControllerUpdateLeaderboardAction = {
type: `SocialController:updateLeaderboard`;
handler: SocialController['updateLeaderboard'];
};

/**
* Follows one or more traders and updates the following list in state.
*
* @param options - Options bag.
* @param options.addressOrUid - Wallet address or Clicker profile ID of the current user.
* @param options.targets - Addresses or profile IDs to follow.
* @returns The follow response with confirmed follows.
*/
export type SocialControllerFollowTraderAction = {
type: `SocialController:followTrader`;
handler: SocialController['followTrader'];
};

/**
* Unfollows one or more traders and updates the following list in state.
*
* @param options - Options bag.
* @param options.addressOrUid - Wallet address or Clicker profile ID of the current user.
* @param options.targets - Addresses or profile IDs to unfollow.
* @returns The unfollow response with confirmed unfollows.
*/
export type SocialControllerUnfollowTraderAction = {
type: `SocialController:unfollowTrader`;
handler: SocialController['unfollowTrader'];
};

/**
* Fetches the list of traders the current user follows and replaces
* the following addresses in state.
*
* @param options - Options bag.
* @param options.addressOrUid - Wallet address or Clicker profile ID of the current user.
* @returns The following response.
*/
export type SocialControllerUpdateFollowingAction = {
type: `SocialController:updateFollowing`;
handler: SocialController['updateFollowing'];
};

/**
* Union of all SocialController action types.
*/
export type SocialControllerMethodActions =
| SocialControllerUpdateLeaderboardAction
| SocialControllerFollowTraderAction
| SocialControllerUnfollowTraderAction
| SocialControllerUpdateFollowingAction;
Loading
Loading