@metamask/social-controllers 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/dist/SocialController-method-action-types.cjs.map +1 -1
  3. package/dist/SocialController-method-action-types.d.cts +15 -1
  4. package/dist/SocialController-method-action-types.d.cts.map +1 -1
  5. package/dist/SocialController-method-action-types.d.mts +15 -1
  6. package/dist/SocialController-method-action-types.d.mts.map +1 -1
  7. package/dist/SocialController-method-action-types.mjs.map +1 -1
  8. package/dist/SocialController.cjs +14 -0
  9. package/dist/SocialController.cjs.map +1 -1
  10. package/dist/SocialController.d.cts +10 -2
  11. package/dist/SocialController.d.cts.map +1 -1
  12. package/dist/SocialController.d.mts +10 -2
  13. package/dist/SocialController.d.mts.map +1 -1
  14. package/dist/SocialController.mjs +14 -0
  15. package/dist/SocialController.mjs.map +1 -1
  16. package/dist/SocialService-method-action-types.cjs.map +1 -1
  17. package/dist/SocialService-method-action-types.d.cts +15 -1
  18. package/dist/SocialService-method-action-types.d.cts.map +1 -1
  19. package/dist/SocialService-method-action-types.d.mts +15 -1
  20. package/dist/SocialService-method-action-types.d.mts.map +1 -1
  21. package/dist/SocialService-method-action-types.mjs.map +1 -1
  22. package/dist/SocialService.cjs +43 -0
  23. package/dist/SocialService.cjs.map +1 -1
  24. package/dist/SocialService.d.cts +8 -0
  25. package/dist/SocialService.d.cts.map +1 -1
  26. package/dist/SocialService.d.mts +8 -0
  27. package/dist/SocialService.d.mts.map +1 -1
  28. package/dist/SocialService.mjs +43 -0
  29. package/dist/SocialService.mjs.map +1 -1
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +2 -2
  32. package/dist/index.d.cts.map +1 -1
  33. package/dist/index.d.mts +2 -2
  34. package/dist/index.d.mts.map +1 -1
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/social-constants.cjs +2 -0
  37. package/dist/social-constants.cjs.map +1 -1
  38. package/dist/social-constants.d.cts +2 -0
  39. package/dist/social-constants.d.cts.map +1 -1
  40. package/dist/social-constants.d.mts +2 -0
  41. package/dist/social-constants.d.mts.map +1 -1
  42. package/dist/social-constants.mjs +2 -0
  43. package/dist/social-constants.mjs.map +1 -1
  44. package/dist/social-types.cjs.map +1 -1
  45. package/dist/social-types.d.cts +10 -0
  46. package/dist/social-types.d.cts.map +1 -1
  47. package/dist/social-types.d.mts +10 -0
  48. package/dist/social-types.d.mts.map +1 -1
  49. package/dist/social-types.mjs.map +1 -1
  50. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"social-constants.d.cts","sourceRoot":"","sources":["../src/social-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;CA4B5B,CAAC"}
1
+ {"version":3,"file":"social-constants.d.cts","sourceRoot":"","sources":["../src/social-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;CA+B5B,CAAC"}
@@ -19,5 +19,7 @@ export declare const SocialServiceErrorMessage: {
19
19
  readonly UNFOLLOW_INVALID_RESPONSE: "SocialService: Unfollow returned invalid response";
20
20
  readonly FETCH_POSITION_BY_ID_FAILED: "SocialService: Position request failed";
21
21
  readonly FETCH_POSITION_BY_ID_INVALID_RESPONSE: "SocialService: Position returned invalid response";
22
+ readonly LEADERBOARD_OPT_OUT_FAILED: "SocialService: Leaderboard opt-out request failed";
23
+ readonly LEADERBOARD_OPT_IN_FAILED: "SocialService: Leaderboard opt-in request failed";
22
24
  };
23
25
  //# sourceMappingURL=social-constants.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"social-constants.d.mts","sourceRoot":"","sources":["../src/social-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;CA4B5B,CAAC"}
1
+ {"version":3,"file":"social-constants.d.mts","sourceRoot":"","sources":["../src/social-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;CA+B5B,CAAC"}
@@ -19,5 +19,7 @@ export const SocialServiceErrorMessage = {
19
19
  UNFOLLOW_INVALID_RESPONSE: 'SocialService: Unfollow returned invalid response',
20
20
  FETCH_POSITION_BY_ID_FAILED: 'SocialService: Position request failed',
21
21
  FETCH_POSITION_BY_ID_INVALID_RESPONSE: 'SocialService: Position returned invalid response',
22
+ LEADERBOARD_OPT_OUT_FAILED: 'SocialService: Leaderboard opt-out request failed',
23
+ LEADERBOARD_OPT_IN_FAILED: 'SocialService: Leaderboard opt-in request failed',
22
24
  };
23
25
  //# sourceMappingURL=social-constants.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"social-constants.mjs","sourceRoot":"","sources":["../src/social-constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;AAE3C,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,wBAAwB,EAAE,2CAA2C;IACrE,kCAAkC,EAChC,sDAAsD;IACxD,2BAA2B,EAAE,8CAA8C;IAC3E,qCAAqC,EACnC,yDAAyD;IAC3D,2BAA2B,EAAE,8CAA8C;IAC3E,qCAAqC,EACnC,yDAAyD;IAC3D,6BAA6B,EAC3B,gDAAgD;IAClD,uCAAuC,EACrC,2DAA2D;IAC7D,sBAAsB,EAAE,yCAAyC;IACjE,gCAAgC,EAC9B,oDAAoD;IACtD,sBAAsB,EAAE,yCAAyC;IACjE,gCAAgC,EAC9B,oDAAoD;IACtD,aAAa,EAAE,sCAAsC;IACrD,uBAAuB,EAAE,iDAAiD;IAC1E,eAAe,EAAE,wCAAwC;IACzD,yBAAyB,EACvB,mDAAmD;IACrD,2BAA2B,EAAE,wCAAwC;IACrE,qCAAqC,EACnC,mDAAmD;CAC7C,CAAC","sourcesContent":["export const serviceName = 'SocialService';\n\nexport const controllerName = 'SocialController';\n\nexport const SocialServiceErrorMessage = {\n FETCH_LEADERBOARD_FAILED: 'SocialService: Leaderboard request failed',\n FETCH_LEADERBOARD_INVALID_RESPONSE:\n 'SocialService: Leaderboard returned invalid response',\n FETCH_TRADER_PROFILE_FAILED: 'SocialService: Trader profile request failed',\n FETCH_TRADER_PROFILE_INVALID_RESPONSE:\n 'SocialService: Trader profile returned invalid response',\n FETCH_OPEN_POSITIONS_FAILED: 'SocialService: Open positions request failed',\n FETCH_OPEN_POSITIONS_INVALID_RESPONSE:\n 'SocialService: Open positions returned invalid response',\n FETCH_CLOSED_POSITIONS_FAILED:\n 'SocialService: Closed positions request failed',\n FETCH_CLOSED_POSITIONS_INVALID_RESPONSE:\n 'SocialService: Closed positions returned invalid response',\n FETCH_FOLLOWERS_FAILED: 'SocialService: Followers request failed',\n FETCH_FOLLOWERS_INVALID_RESPONSE:\n 'SocialService: Followers returned invalid response',\n FETCH_FOLLOWING_FAILED: 'SocialService: Following request failed',\n FETCH_FOLLOWING_INVALID_RESPONSE:\n 'SocialService: Following returned invalid response',\n FOLLOW_FAILED: 'SocialService: Follow request failed',\n FOLLOW_INVALID_RESPONSE: 'SocialService: Follow returned invalid response',\n UNFOLLOW_FAILED: 'SocialService: Unfollow request failed',\n UNFOLLOW_INVALID_RESPONSE:\n 'SocialService: Unfollow returned invalid response',\n FETCH_POSITION_BY_ID_FAILED: 'SocialService: Position request failed',\n FETCH_POSITION_BY_ID_INVALID_RESPONSE:\n 'SocialService: Position returned invalid response',\n} as const;\n"]}
1
+ {"version":3,"file":"social-constants.mjs","sourceRoot":"","sources":["../src/social-constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;AAE3C,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,wBAAwB,EAAE,2CAA2C;IACrE,kCAAkC,EAChC,sDAAsD;IACxD,2BAA2B,EAAE,8CAA8C;IAC3E,qCAAqC,EACnC,yDAAyD;IAC3D,2BAA2B,EAAE,8CAA8C;IAC3E,qCAAqC,EACnC,yDAAyD;IAC3D,6BAA6B,EAC3B,gDAAgD;IAClD,uCAAuC,EACrC,2DAA2D;IAC7D,sBAAsB,EAAE,yCAAyC;IACjE,gCAAgC,EAC9B,oDAAoD;IACtD,sBAAsB,EAAE,yCAAyC;IACjE,gCAAgC,EAC9B,oDAAoD;IACtD,aAAa,EAAE,sCAAsC;IACrD,uBAAuB,EAAE,iDAAiD;IAC1E,eAAe,EAAE,wCAAwC;IACzD,yBAAyB,EACvB,mDAAmD;IACrD,2BAA2B,EAAE,wCAAwC;IACrE,qCAAqC,EACnC,mDAAmD;IACrD,0BAA0B,EACxB,mDAAmD;IACrD,yBAAyB,EAAE,kDAAkD;CACrE,CAAC","sourcesContent":["export const serviceName = 'SocialService';\n\nexport const controllerName = 'SocialController';\n\nexport const SocialServiceErrorMessage = {\n FETCH_LEADERBOARD_FAILED: 'SocialService: Leaderboard request failed',\n FETCH_LEADERBOARD_INVALID_RESPONSE:\n 'SocialService: Leaderboard returned invalid response',\n FETCH_TRADER_PROFILE_FAILED: 'SocialService: Trader profile request failed',\n FETCH_TRADER_PROFILE_INVALID_RESPONSE:\n 'SocialService: Trader profile returned invalid response',\n FETCH_OPEN_POSITIONS_FAILED: 'SocialService: Open positions request failed',\n FETCH_OPEN_POSITIONS_INVALID_RESPONSE:\n 'SocialService: Open positions returned invalid response',\n FETCH_CLOSED_POSITIONS_FAILED:\n 'SocialService: Closed positions request failed',\n FETCH_CLOSED_POSITIONS_INVALID_RESPONSE:\n 'SocialService: Closed positions returned invalid response',\n FETCH_FOLLOWERS_FAILED: 'SocialService: Followers request failed',\n FETCH_FOLLOWERS_INVALID_RESPONSE:\n 'SocialService: Followers returned invalid response',\n FETCH_FOLLOWING_FAILED: 'SocialService: Following request failed',\n FETCH_FOLLOWING_INVALID_RESPONSE:\n 'SocialService: Following returned invalid response',\n FOLLOW_FAILED: 'SocialService: Follow request failed',\n FOLLOW_INVALID_RESPONSE: 'SocialService: Follow returned invalid response',\n UNFOLLOW_FAILED: 'SocialService: Unfollow request failed',\n UNFOLLOW_INVALID_RESPONSE:\n 'SocialService: Unfollow returned invalid response',\n FETCH_POSITION_BY_ID_FAILED: 'SocialService: Position request failed',\n FETCH_POSITION_BY_ID_INVALID_RESPONSE:\n 'SocialService: Position returned invalid response',\n LEADERBOARD_OPT_OUT_FAILED:\n 'SocialService: Leaderboard opt-out request failed',\n LEADERBOARD_OPT_IN_FAILED: 'SocialService: Leaderboard opt-in request failed',\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"social-types.cjs","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":";;;AACA,uDAO+B;AA8BlB,QAAA,WAAW,GAAG,IAAA,kBAAU,EAAC;IACpC,SAAS,EAAE,IAAA,mBAAK,EAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,IAAA,mBAAK,EAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC5B,8EAA8E;IAC9E,cAAc,EAAE,IAAA,sBAAQ,EACtB,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CACrD;IACD,uDAAuD;IACvD,gBAAgB,EAAE,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,8EAA8E;IAC9E,YAAY,EAAE,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,IAAA,oBAAM,GAAE;IACrB,OAAO,EAAE,IAAA,oBAAM,GAAE;IACjB,SAAS,EAAE,IAAA,oBAAM,GAAE;IACnB,eAAe,EAAE,IAAA,oBAAM,GAAE;CAC1B,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n enums,\n nullable,\n number,\n optional,\n string,\n type as structType,\n} from '@metamask/superstruct';\n\n// ---------------------------------------------------------------------------\n// Shared sub-types\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal profile summary used across follow/follower responses.\n */\nexport type ProfileSummary = {\n /** Clicker profile ID (UUID). */\n profileId: string;\n /** Primary wallet address. */\n address: string;\n /** Display name or truncated address. */\n name: string;\n /** Profile avatar URL. */\n imageUrl?: string | null;\n};\n\n/**\n * Social media handles attached to a trader profile.\n */\nexport type SocialHandles = {\n twitter?: string | null;\n farcaster?: string | null;\n ens?: string | null;\n lens?: string | null;\n};\n\nexport const TradeStruct = structType({\n direction: enums(['buy', 'sell']),\n intent: enums(['enter', 'exit']),\n category: optional(string()),\n /** High-level trade classification. `null` when Clicker does not classify. */\n classification: optional(\n nullable(enums(['spot', 'perp', 'send', 'receive'])),\n ),\n /** Perp side for this fill. `null` for spot trades. */\n perpPositionType: optional(nullable(enums(['long', 'short']))),\n /** Leverage multiplier for perp trades (e.g. `5` for 5x). `null` for spot. */\n perpLeverage: optional(nullable(number())),\n tokenAmount: number(),\n usdCost: number(),\n timestamp: number(),\n transactionHash: string(),\n});\n\nexport type Trade = Infer<typeof TradeStruct>;\n\n// ---------------------------------------------------------------------------\n// Leaderboard\n// ---------------------------------------------------------------------------\n\n/**\n * A single entry in the leaderboard response.\n */\nexport type LeaderboardEntry = {\n rank: number;\n addresses: string[];\n profileId: string;\n name: string;\n imageUrl?: string | null;\n pnl30d: number;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n pnlPerChain: Record<string, number>;\n followerCount: number;\n socialHandles: SocialHandles;\n};\n\n/**\n * Response from `GET /v1/leaderboard`.\n */\nexport type LeaderboardResponse = {\n traders: LeaderboardEntry[];\n};\n\n// ---------------------------------------------------------------------------\n// Trader profile\n// ---------------------------------------------------------------------------\n\nexport type TraderProfile = {\n profileId: string;\n address: string;\n allAddresses: string[];\n name: string;\n imageUrl?: string | null;\n};\n\nexport type TraderStats = {\n pnl30d?: number | null;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n /** Median holding time in minutes. */\n medianHoldMinutes?: number | null;\n};\n\nexport type PerChainBreakdown = {\n perChainPnl: Record<string, number>;\n /** ROI can be null for chains with no trading activity (zero cost-basis). */\n perChainRoi: Record<string, number | null>;\n perChainVolume: Record<string, number>;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/profile`.\n */\nexport type TraderProfileResponse = {\n profile: TraderProfile;\n stats: TraderStats;\n perChainBreakdown: PerChainBreakdown;\n socialHandles: SocialHandles;\n followerCount: number;\n followingCount: number;\n};\n\n// ---------------------------------------------------------------------------\n// Positions\n// ---------------------------------------------------------------------------\n\nexport type Position = {\n positionId: string;\n tokenSymbol: string;\n tokenName: string;\n tokenAddress: string;\n chain: string;\n positionAmount: number;\n boughtUsd: number;\n soldUsd: number;\n realizedPnl: number;\n costBasis: number;\n trades: Trade[];\n lastTradeAt: number;\n /** Daylight-hosted token image URL. */\n tokenImageUrl?: string | null;\n /** Current USD value of the remaining position (open positions only). */\n currentValueUSD?: number | null;\n /** Unrealized + realized PnL in USD. */\n pnlValueUsd?: number | null;\n /** PnL as a percentage of cost basis. */\n pnlPercent?: number | null;\n /** Perp side of the position. `null`/absent for spot positions. */\n perpPositionType?: 'long' | 'short' | null;\n /** Leverage multiplier for perp positions. `null`/absent for spot. */\n perpLeverage?: number | null;\n /**\n * Leveraged/notional position size as reported by Clicker. NOT necessarily\n * `positionAmount` × `perpLeverage` — the ratio varies for positions built\n * across fills at different leverage, so use this field directly rather than\n * deriving it, and treat `perpLeverage` as the authoritative leverage. This is\n * notional exposure, not capital at risk (the margin/capital at risk is\n * `costBasis`). Hyperliquid/perp positions only; absent for spot.\n */\n positionAmountWithLeverage?: number | null;\n};\n\nexport type Pagination = {\n hasMore: boolean;\n nextPage?: number;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/positions/open`\n * and `GET /v1/traders/:addressOrId/positions/closed`.\n */\nexport type PositionsResponse = {\n positions: Position[];\n pagination: Pagination;\n /** ISO 8601 timestamp indicating when the response was computed server-side. */\n computedAt?: string | null;\n};\n\n// ---------------------------------------------------------------------------\n// Followers\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/traders/:addressOrId/followers`.\n */\nexport type FollowersResponse = {\n followers: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Following\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/users/me/following`.\n */\nexport type FollowingResponse = {\n following: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Follow / Unfollow\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `PUT /v1/users/me/follows`.\n */\nexport type FollowResponse = {\n followed: ProfileSummary[];\n};\n\n/**\n * Response from `DELETE /v1/users/me/follows`.\n */\nexport type UnfollowResponse = {\n unfollowed: ProfileSummary[];\n};\n\n// ---------------------------------------------------------------------------\n// Fetch options\n// ---------------------------------------------------------------------------\n\nexport type FetchLeaderboardOptions = {\n sort?: 'pnl' | 'winRate' | 'roi';\n chains?: string[];\n limit?: number;\n};\n\nexport type FetchTraderProfileOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionsOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n chain?: string;\n sort?: 'value' | 'latest';\n limit?: number;\n page?: number;\n};\n\nexport type FetchFollowersOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionByIdOptions = {\n /** Unique position ID (UUID). */\n positionId: string;\n};\n\nexport type FollowOptions = {\n /** Array of wallet addresses or profile IDs to follow. */\n targets: string[];\n};\n\nexport type UnfollowOptions = {\n /** Array of wallet addresses or profile IDs to unfollow. */\n targets: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Controller state\n// ---------------------------------------------------------------------------\n\n/**\n * State managed by the SocialController.\n *\n * The controller acts as a simple store — no TTL or eviction logic.\n * The UI decides when to re-fetch; the social-api's own cache layer\n * handles upstream rate-limiting.\n */\nexport type SocialControllerState = {\n /** Cached ranked trader list from the last `updateLeaderboard` call. */\n leaderboardEntries: LeaderboardEntry[];\n /** Wallet addresses the current user follows. */\n followingAddresses: string[];\n /** Clicker profile IDs the current user follows — used by mobile UI. */\n followingProfileIds: string[];\n};\n"]}
1
+ {"version":3,"file":"social-types.cjs","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":";;;AACA,uDAO+B;AA8BlB,QAAA,WAAW,GAAG,IAAA,kBAAU,EAAC;IACpC,SAAS,EAAE,IAAA,mBAAK,EAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,IAAA,mBAAK,EAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC5B,8EAA8E;IAC9E,cAAc,EAAE,IAAA,sBAAQ,EACtB,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CACrD;IACD,uDAAuD;IACvD,gBAAgB,EAAE,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,8EAA8E;IAC9E,YAAY,EAAE,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,IAAA,oBAAM,GAAE;IACrB,OAAO,EAAE,IAAA,oBAAM,GAAE;IACjB,SAAS,EAAE,IAAA,oBAAM,GAAE;IACnB,eAAe,EAAE,IAAA,oBAAM,GAAE;CAC1B,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n enums,\n nullable,\n number,\n optional,\n string,\n type as structType,\n} from '@metamask/superstruct';\n\n// ---------------------------------------------------------------------------\n// Shared sub-types\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal profile summary used across follow/follower responses.\n */\nexport type ProfileSummary = {\n /** Clicker profile ID (UUID). */\n profileId: string;\n /** Primary wallet address. */\n address: string;\n /** Display name or truncated address. */\n name: string;\n /** Profile avatar URL. */\n imageUrl?: string | null;\n};\n\n/**\n * Social media handles attached to a trader profile.\n */\nexport type SocialHandles = {\n twitter?: string | null;\n farcaster?: string | null;\n ens?: string | null;\n lens?: string | null;\n};\n\nexport const TradeStruct = structType({\n direction: enums(['buy', 'sell']),\n intent: enums(['enter', 'exit']),\n category: optional(string()),\n /** High-level trade classification. `null` when Clicker does not classify. */\n classification: optional(\n nullable(enums(['spot', 'perp', 'send', 'receive'])),\n ),\n /** Perp side for this fill. `null` for spot trades. */\n perpPositionType: optional(nullable(enums(['long', 'short']))),\n /** Leverage multiplier for perp trades (e.g. `5` for 5x). `null` for spot. */\n perpLeverage: optional(nullable(number())),\n tokenAmount: number(),\n usdCost: number(),\n timestamp: number(),\n transactionHash: string(),\n});\n\nexport type Trade = Infer<typeof TradeStruct>;\n\n// ---------------------------------------------------------------------------\n// Leaderboard\n// ---------------------------------------------------------------------------\n\n/**\n * A single entry in the leaderboard response.\n */\nexport type LeaderboardEntry = {\n rank: number;\n addresses: string[];\n profileId: string;\n name: string;\n imageUrl?: string | null;\n pnl30d: number;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n pnlPerChain: Record<string, number>;\n followerCount: number;\n socialHandles: SocialHandles;\n};\n\n/**\n * Response from `GET /v1/leaderboard`.\n */\nexport type LeaderboardResponse = {\n traders: LeaderboardEntry[];\n};\n\n// ---------------------------------------------------------------------------\n// Trader profile\n// ---------------------------------------------------------------------------\n\nexport type TraderProfile = {\n profileId: string;\n address: string;\n allAddresses: string[];\n name: string;\n imageUrl?: string | null;\n};\n\nexport type TraderStats = {\n pnl30d?: number | null;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n /** Median holding time in minutes. */\n medianHoldMinutes?: number | null;\n};\n\nexport type PerChainBreakdown = {\n perChainPnl: Record<string, number>;\n /** ROI can be null for chains with no trading activity (zero cost-basis). */\n perChainRoi: Record<string, number | null>;\n perChainVolume: Record<string, number>;\n /**\n * 7-day per-chain PnL in USD. Optional: older social-api versions only\n * return the 30-day breakdown (`perChainPnl`). The unsuffixed fields above\n * remain the 30-day window for backward compatibility.\n */\n perChainPnl7d?: Record<string, number>;\n /** 7-day per-chain ROI. Null for chains with no trading activity. */\n perChainRoi7d?: Record<string, number | null>;\n /** 7-day per-chain volume in USD. */\n perChainVolume7d?: Record<string, number>;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/profile`.\n */\nexport type TraderProfileResponse = {\n profile: TraderProfile;\n stats: TraderStats;\n perChainBreakdown: PerChainBreakdown;\n socialHandles: SocialHandles;\n followerCount: number;\n followingCount: number;\n};\n\n// ---------------------------------------------------------------------------\n// Positions\n// ---------------------------------------------------------------------------\n\nexport type Position = {\n positionId: string;\n tokenSymbol: string;\n tokenName: string;\n tokenAddress: string;\n chain: string;\n positionAmount: number;\n boughtUsd: number;\n soldUsd: number;\n realizedPnl: number;\n costBasis: number;\n trades: Trade[];\n lastTradeAt: number;\n /** Daylight-hosted token image URL. */\n tokenImageUrl?: string | null;\n /** Current USD value of the remaining position (open positions only). */\n currentValueUSD?: number | null;\n /** Unrealized + realized PnL in USD. */\n pnlValueUsd?: number | null;\n /** PnL as a percentage of cost basis. */\n pnlPercent?: number | null;\n /** Perp side of the position. `null`/absent for spot positions. */\n perpPositionType?: 'long' | 'short' | null;\n /** Leverage multiplier for perp positions. `null`/absent for spot. */\n perpLeverage?: number | null;\n /**\n * Leveraged/notional position size as reported by Clicker. NOT necessarily\n * `positionAmount` × `perpLeverage` — the ratio varies for positions built\n * across fills at different leverage, so use this field directly rather than\n * deriving it, and treat `perpLeverage` as the authoritative leverage. This is\n * notional exposure, not capital at risk (the margin/capital at risk is\n * `costBasis`). Hyperliquid/perp positions only; absent for spot.\n */\n positionAmountWithLeverage?: number | null;\n};\n\nexport type Pagination = {\n hasMore: boolean;\n nextPage?: number;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/positions/open`\n * and `GET /v1/traders/:addressOrId/positions/closed`.\n */\nexport type PositionsResponse = {\n positions: Position[];\n pagination: Pagination;\n /** ISO 8601 timestamp indicating when the response was computed server-side. */\n computedAt?: string | null;\n};\n\n// ---------------------------------------------------------------------------\n// Followers\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/traders/:addressOrId/followers`.\n */\nexport type FollowersResponse = {\n followers: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Following\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/users/me/following`.\n */\nexport type FollowingResponse = {\n following: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Follow / Unfollow\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `PUT /v1/users/me/follows`.\n */\nexport type FollowResponse = {\n followed: ProfileSummary[];\n};\n\n/**\n * Response from `DELETE /v1/users/me/follows`.\n */\nexport type UnfollowResponse = {\n unfollowed: ProfileSummary[];\n};\n\n// ---------------------------------------------------------------------------\n// Fetch options\n// ---------------------------------------------------------------------------\n\nexport type FetchLeaderboardOptions = {\n sort?: 'pnl' | 'winRate' | 'roi';\n chains?: string[];\n limit?: number;\n};\n\nexport type FetchTraderProfileOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionsOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n chain?: string;\n sort?: 'value' | 'latest';\n limit?: number;\n page?: number;\n};\n\nexport type FetchFollowersOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionByIdOptions = {\n /** Unique position ID (UUID). */\n positionId: string;\n};\n\nexport type FollowOptions = {\n /** Array of wallet addresses or profile IDs to follow. */\n targets: string[];\n};\n\nexport type UnfollowOptions = {\n /** Array of wallet addresses or profile IDs to unfollow. */\n targets: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Controller state\n// ---------------------------------------------------------------------------\n\n/**\n * State managed by the SocialController.\n *\n * The controller acts as a simple store — no TTL or eviction logic.\n * The UI decides when to re-fetch; the social-api's own cache layer\n * handles upstream rate-limiting.\n */\nexport type SocialControllerState = {\n /** Cached ranked trader list from the last `updateLeaderboard` call. */\n leaderboardEntries: LeaderboardEntry[];\n /** Wallet addresses the current user follows. */\n followingAddresses: string[];\n /** Clicker profile IDs the current user follows — used by mobile UI. */\n followingProfileIds: string[];\n};\n"]}
@@ -117,6 +117,16 @@ export type PerChainBreakdown = {
117
117
  /** ROI can be null for chains with no trading activity (zero cost-basis). */
118
118
  perChainRoi: Record<string, number | null>;
119
119
  perChainVolume: Record<string, number>;
120
+ /**
121
+ * 7-day per-chain PnL in USD. Optional: older social-api versions only
122
+ * return the 30-day breakdown (`perChainPnl`). The unsuffixed fields above
123
+ * remain the 30-day window for backward compatibility.
124
+ */
125
+ perChainPnl7d?: Record<string, number>;
126
+ /** 7-day per-chain ROI. Null for chains with no trading activity. */
127
+ perChainRoi7d?: Record<string, number | null>;
128
+ /** 7-day per-chain volume in USD. */
129
+ perChainVolume7d?: Record<string, number>;
120
130
  };
121
131
  /**
122
132
  * Response from `GET /v1/traders/:addressOrId/profile`.
@@ -1 +1 @@
1
- {"version":3,"file":"social-types.d.cts","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAcnD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,M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,SAAS,GAAG,KAAK,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,0DAA0D;IAC1D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,4DAA4D;IAC5D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAMF;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,wEAAwE;IACxE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC;IACvC,iDAAiD;IACjD,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,wEAAwE;IACxE,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B,CAAC"}
@@ -117,6 +117,16 @@ export type PerChainBreakdown = {
117
117
  /** ROI can be null for chains with no trading activity (zero cost-basis). */
118
118
  perChainRoi: Record<string, number | null>;
119
119
  perChainVolume: Record<string, number>;
120
+ /**
121
+ * 7-day per-chain PnL in USD. Optional: older social-api versions only
122
+ * return the 30-day breakdown (`perChainPnl`). The unsuffixed fields above
123
+ * remain the 30-day window for backward compatibility.
124
+ */
125
+ perChainPnl7d?: Record<string, number>;
126
+ /** 7-day per-chain ROI. Null for chains with no trading activity. */
127
+ perChainRoi7d?: Record<string, number | null>;
128
+ /** 7-day per-chain volume in USD. */
129
+ perChainVolume7d?: Record<string, number>;
120
130
  };
121
131
  /**
122
132
  * Response from `GET /v1/traders/:addressOrId/profile`.
@@ -1 +1 @@
1
- {"version":3,"file":"social-types.d.mts","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAcnD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;IAItB,8EAA8E;;;;;;;IAI9E,uDAAuD;;;;;IAEvD,8EAA8E;;;;;;EAM9E,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAM9C;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAA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AC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CACrD;IACD,uDAAuD;IACvD,gBAAgB,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,8EAA8E;IAC9E,YAAY,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,MAAM,EAAE;IACrB,OAAO,EAAE,MAAM,EAAE;IACjB,SAAS,EAAE,MAAM,EAAE;IACnB,eAAe,EAAE,MAAM,EAAE;CAC1B,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n enums,\n nullable,\n number,\n optional,\n string,\n type as structType,\n} from '@metamask/superstruct';\n\n// ---------------------------------------------------------------------------\n// Shared sub-types\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal profile summary used across follow/follower responses.\n */\nexport type ProfileSummary = {\n /** Clicker profile ID (UUID). */\n profileId: string;\n /** Primary wallet address. */\n address: string;\n /** Display name or truncated address. */\n name: string;\n /** Profile avatar URL. */\n imageUrl?: string | null;\n};\n\n/**\n * Social media handles attached to a trader profile.\n */\nexport type SocialHandles = {\n twitter?: string | null;\n farcaster?: string | null;\n ens?: string | null;\n lens?: string | null;\n};\n\nexport const TradeStruct = structType({\n direction: enums(['buy', 'sell']),\n intent: enums(['enter', 'exit']),\n category: optional(string()),\n /** High-level trade classification. `null` when Clicker does not classify. */\n classification: optional(\n nullable(enums(['spot', 'perp', 'send', 'receive'])),\n ),\n /** Perp side for this fill. `null` for spot trades. */\n perpPositionType: optional(nullable(enums(['long', 'short']))),\n /** Leverage multiplier for perp trades (e.g. `5` for 5x). `null` for spot. */\n perpLeverage: optional(nullable(number())),\n tokenAmount: number(),\n usdCost: number(),\n timestamp: number(),\n transactionHash: string(),\n});\n\nexport type Trade = Infer<typeof TradeStruct>;\n\n// ---------------------------------------------------------------------------\n// Leaderboard\n// ---------------------------------------------------------------------------\n\n/**\n * A single entry in the leaderboard response.\n */\nexport type LeaderboardEntry = {\n rank: number;\n addresses: string[];\n profileId: string;\n name: string;\n imageUrl?: string | null;\n pnl30d: number;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n pnlPerChain: Record<string, number>;\n followerCount: number;\n socialHandles: SocialHandles;\n};\n\n/**\n * Response from `GET /v1/leaderboard`.\n */\nexport type LeaderboardResponse = {\n traders: LeaderboardEntry[];\n};\n\n// ---------------------------------------------------------------------------\n// Trader profile\n// ---------------------------------------------------------------------------\n\nexport type TraderProfile = {\n profileId: string;\n address: string;\n allAddresses: string[];\n name: string;\n imageUrl?: string | null;\n};\n\nexport type TraderStats = {\n pnl30d?: number | null;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n /** Median holding time in minutes. */\n medianHoldMinutes?: number | null;\n};\n\nexport type PerChainBreakdown = {\n perChainPnl: Record<string, number>;\n /** ROI can be null for chains with no trading activity (zero cost-basis). */\n perChainRoi: Record<string, number | null>;\n perChainVolume: Record<string, number>;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/profile`.\n */\nexport type TraderProfileResponse = {\n profile: TraderProfile;\n stats: TraderStats;\n perChainBreakdown: PerChainBreakdown;\n socialHandles: SocialHandles;\n followerCount: number;\n followingCount: number;\n};\n\n// ---------------------------------------------------------------------------\n// Positions\n// ---------------------------------------------------------------------------\n\nexport type Position = {\n positionId: string;\n tokenSymbol: string;\n tokenName: string;\n tokenAddress: string;\n chain: string;\n positionAmount: number;\n boughtUsd: number;\n soldUsd: number;\n realizedPnl: number;\n costBasis: number;\n trades: Trade[];\n lastTradeAt: number;\n /** Daylight-hosted token image URL. */\n tokenImageUrl?: string | null;\n /** Current USD value of the remaining position (open positions only). */\n currentValueUSD?: number | null;\n /** Unrealized + realized PnL in USD. */\n pnlValueUsd?: number | null;\n /** PnL as a percentage of cost basis. */\n pnlPercent?: number | null;\n /** Perp side of the position. `null`/absent for spot positions. */\n perpPositionType?: 'long' | 'short' | null;\n /** Leverage multiplier for perp positions. `null`/absent for spot. */\n perpLeverage?: number | null;\n /**\n * Leveraged/notional position size as reported by Clicker. NOT necessarily\n * `positionAmount` × `perpLeverage` — the ratio varies for positions built\n * across fills at different leverage, so use this field directly rather than\n * deriving it, and treat `perpLeverage` as the authoritative leverage. This is\n * notional exposure, not capital at risk (the margin/capital at risk is\n * `costBasis`). Hyperliquid/perp positions only; absent for spot.\n */\n positionAmountWithLeverage?: number | null;\n};\n\nexport type Pagination = {\n hasMore: boolean;\n nextPage?: number;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/positions/open`\n * and `GET /v1/traders/:addressOrId/positions/closed`.\n */\nexport type PositionsResponse = {\n positions: Position[];\n pagination: Pagination;\n /** ISO 8601 timestamp indicating when the response was computed server-side. */\n computedAt?: string | null;\n};\n\n// ---------------------------------------------------------------------------\n// Followers\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/traders/:addressOrId/followers`.\n */\nexport type FollowersResponse = {\n followers: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Following\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/users/me/following`.\n */\nexport type FollowingResponse = {\n following: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Follow / Unfollow\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `PUT /v1/users/me/follows`.\n */\nexport type FollowResponse = {\n followed: ProfileSummary[];\n};\n\n/**\n * Response from `DELETE /v1/users/me/follows`.\n */\nexport type UnfollowResponse = {\n unfollowed: ProfileSummary[];\n};\n\n// ---------------------------------------------------------------------------\n// Fetch options\n// ---------------------------------------------------------------------------\n\nexport type FetchLeaderboardOptions = {\n sort?: 'pnl' | 'winRate' | 'roi';\n chains?: string[];\n limit?: number;\n};\n\nexport type FetchTraderProfileOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionsOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n chain?: string;\n sort?: 'value' | 'latest';\n limit?: number;\n page?: number;\n};\n\nexport type FetchFollowersOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionByIdOptions = {\n /** Unique position ID (UUID). */\n positionId: string;\n};\n\nexport type FollowOptions = {\n /** Array of wallet addresses or profile IDs to follow. */\n targets: string[];\n};\n\nexport type UnfollowOptions = {\n /** Array of wallet addresses or profile IDs to unfollow. */\n targets: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Controller state\n// ---------------------------------------------------------------------------\n\n/**\n * State managed by the SocialController.\n *\n * The controller acts as a simple store — no TTL or eviction logic.\n * The UI decides when to re-fetch; the social-api's own cache layer\n * handles upstream rate-limiting.\n */\nexport type SocialControllerState = {\n /** Cached ranked trader list from the last `updateLeaderboard` call. */\n leaderboardEntries: LeaderboardEntry[];\n /** Wallet addresses the current user follows. */\n followingAddresses: string[];\n /** Clicker profile IDs the current user follows — used by mobile UI. */\n followingProfileIds: string[];\n};\n"]}
1
+ {"version":3,"file":"social-types.mjs","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAI,IAAI,UAAU,EACnB,8BAA8B;AA8B/B,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;IACpC,SAAS,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC5B,8EAA8E;IAC9E,cAAc,EAAE,QAAQ,CACtB,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CACrD;IACD,uDAAuD;IACvD,gBAAgB,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,8EAA8E;IAC9E,YAAY,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,MAAM,EAAE;IACrB,OAAO,EAAE,MAAM,EAAE;IACjB,SAAS,EAAE,MAAM,EAAE;IACnB,eAAe,EAAE,MAAM,EAAE;CAC1B,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n enums,\n nullable,\n number,\n optional,\n string,\n type as structType,\n} from '@metamask/superstruct';\n\n// ---------------------------------------------------------------------------\n// Shared sub-types\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal profile summary used across follow/follower responses.\n */\nexport type ProfileSummary = {\n /** Clicker profile ID (UUID). */\n profileId: string;\n /** Primary wallet address. */\n address: string;\n /** Display name or truncated address. */\n name: string;\n /** Profile avatar URL. */\n imageUrl?: string | null;\n};\n\n/**\n * Social media handles attached to a trader profile.\n */\nexport type SocialHandles = {\n twitter?: string | null;\n farcaster?: string | null;\n ens?: string | null;\n lens?: string | null;\n};\n\nexport const TradeStruct = structType({\n direction: enums(['buy', 'sell']),\n intent: enums(['enter', 'exit']),\n category: optional(string()),\n /** High-level trade classification. `null` when Clicker does not classify. */\n classification: optional(\n nullable(enums(['spot', 'perp', 'send', 'receive'])),\n ),\n /** Perp side for this fill. `null` for spot trades. */\n perpPositionType: optional(nullable(enums(['long', 'short']))),\n /** Leverage multiplier for perp trades (e.g. `5` for 5x). `null` for spot. */\n perpLeverage: optional(nullable(number())),\n tokenAmount: number(),\n usdCost: number(),\n timestamp: number(),\n transactionHash: string(),\n});\n\nexport type Trade = Infer<typeof TradeStruct>;\n\n// ---------------------------------------------------------------------------\n// Leaderboard\n// ---------------------------------------------------------------------------\n\n/**\n * A single entry in the leaderboard response.\n */\nexport type LeaderboardEntry = {\n rank: number;\n addresses: string[];\n profileId: string;\n name: string;\n imageUrl?: string | null;\n pnl30d: number;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n pnlPerChain: Record<string, number>;\n followerCount: number;\n socialHandles: SocialHandles;\n};\n\n/**\n * Response from `GET /v1/leaderboard`.\n */\nexport type LeaderboardResponse = {\n traders: LeaderboardEntry[];\n};\n\n// ---------------------------------------------------------------------------\n// Trader profile\n// ---------------------------------------------------------------------------\n\nexport type TraderProfile = {\n profileId: string;\n address: string;\n allAddresses: string[];\n name: string;\n imageUrl?: string | null;\n};\n\nexport type TraderStats = {\n pnl30d?: number | null;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n /** Median holding time in minutes. */\n medianHoldMinutes?: number | null;\n};\n\nexport type PerChainBreakdown = {\n perChainPnl: Record<string, number>;\n /** ROI can be null for chains with no trading activity (zero cost-basis). */\n perChainRoi: Record<string, number | null>;\n perChainVolume: Record<string, number>;\n /**\n * 7-day per-chain PnL in USD. Optional: older social-api versions only\n * return the 30-day breakdown (`perChainPnl`). The unsuffixed fields above\n * remain the 30-day window for backward compatibility.\n */\n perChainPnl7d?: Record<string, number>;\n /** 7-day per-chain ROI. Null for chains with no trading activity. */\n perChainRoi7d?: Record<string, number | null>;\n /** 7-day per-chain volume in USD. */\n perChainVolume7d?: Record<string, number>;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/profile`.\n */\nexport type TraderProfileResponse = {\n profile: TraderProfile;\n stats: TraderStats;\n perChainBreakdown: PerChainBreakdown;\n socialHandles: SocialHandles;\n followerCount: number;\n followingCount: number;\n};\n\n// ---------------------------------------------------------------------------\n// Positions\n// ---------------------------------------------------------------------------\n\nexport type Position = {\n positionId: string;\n tokenSymbol: string;\n tokenName: string;\n tokenAddress: string;\n chain: string;\n positionAmount: number;\n boughtUsd: number;\n soldUsd: number;\n realizedPnl: number;\n costBasis: number;\n trades: Trade[];\n lastTradeAt: number;\n /** Daylight-hosted token image URL. */\n tokenImageUrl?: string | null;\n /** Current USD value of the remaining position (open positions only). */\n currentValueUSD?: number | null;\n /** Unrealized + realized PnL in USD. */\n pnlValueUsd?: number | null;\n /** PnL as a percentage of cost basis. */\n pnlPercent?: number | null;\n /** Perp side of the position. `null`/absent for spot positions. */\n perpPositionType?: 'long' | 'short' | null;\n /** Leverage multiplier for perp positions. `null`/absent for spot. */\n perpLeverage?: number | null;\n /**\n * Leveraged/notional position size as reported by Clicker. NOT necessarily\n * `positionAmount` × `perpLeverage` — the ratio varies for positions built\n * across fills at different leverage, so use this field directly rather than\n * deriving it, and treat `perpLeverage` as the authoritative leverage. This is\n * notional exposure, not capital at risk (the margin/capital at risk is\n * `costBasis`). Hyperliquid/perp positions only; absent for spot.\n */\n positionAmountWithLeverage?: number | null;\n};\n\nexport type Pagination = {\n hasMore: boolean;\n nextPage?: number;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/positions/open`\n * and `GET /v1/traders/:addressOrId/positions/closed`.\n */\nexport type PositionsResponse = {\n positions: Position[];\n pagination: Pagination;\n /** ISO 8601 timestamp indicating when the response was computed server-side. */\n computedAt?: string | null;\n};\n\n// ---------------------------------------------------------------------------\n// Followers\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/traders/:addressOrId/followers`.\n */\nexport type FollowersResponse = {\n followers: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Following\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/users/me/following`.\n */\nexport type FollowingResponse = {\n following: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Follow / Unfollow\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `PUT /v1/users/me/follows`.\n */\nexport type FollowResponse = {\n followed: ProfileSummary[];\n};\n\n/**\n * Response from `DELETE /v1/users/me/follows`.\n */\nexport type UnfollowResponse = {\n unfollowed: ProfileSummary[];\n};\n\n// ---------------------------------------------------------------------------\n// Fetch options\n// ---------------------------------------------------------------------------\n\nexport type FetchLeaderboardOptions = {\n sort?: 'pnl' | 'winRate' | 'roi';\n chains?: string[];\n limit?: number;\n};\n\nexport type FetchTraderProfileOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionsOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n chain?: string;\n sort?: 'value' | 'latest';\n limit?: number;\n page?: number;\n};\n\nexport type FetchFollowersOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionByIdOptions = {\n /** Unique position ID (UUID). */\n positionId: string;\n};\n\nexport type FollowOptions = {\n /** Array of wallet addresses or profile IDs to follow. */\n targets: string[];\n};\n\nexport type UnfollowOptions = {\n /** Array of wallet addresses or profile IDs to unfollow. */\n targets: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Controller state\n// ---------------------------------------------------------------------------\n\n/**\n * State managed by the SocialController.\n *\n * The controller acts as a simple store — no TTL or eviction logic.\n * The UI decides when to re-fetch; the social-api's own cache layer\n * handles upstream rate-limiting.\n */\nexport type SocialControllerState = {\n /** Cached ranked trader list from the last `updateLeaderboard` call. */\n leaderboardEntries: LeaderboardEntry[];\n /** Wallet addresses the current user follows. */\n followingAddresses: string[];\n /** Clicker profile IDs the current user follows — used by mobile UI. */\n followingProfileIds: string[];\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/social-controllers",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "A collection of social related controllers",
5
5
  "keywords": [
6
6
  "Ethereum",
@@ -55,8 +55,8 @@
55
55
  "dependencies": {
56
56
  "@metamask/base-controller": "^9.1.0",
57
57
  "@metamask/base-data-service": "^0.1.3",
58
- "@metamask/controller-utils": "^12.2.0",
59
- "@metamask/messenger": "^1.2.0",
58
+ "@metamask/controller-utils": "^12.3.0",
59
+ "@metamask/messenger": "^2.0.0",
60
60
  "@metamask/profile-sync-controller": "^28.2.0",
61
61
  "@metamask/superstruct": "^3.1.0"
62
62
  },