@metamask-previews/social-controllers 3.8.0-preview-5d0e7527f → 3.8.0-preview-c9f31ce

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.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
+ - Add optional `createdAt` to `TraderProfile`. `fetchTraderProfile` accepts an ISO-8601 timestamp, or `null`, on `GET /traders/:addressOrId/profile` and still accepts responses that omit it ([#10877](https://github.com/MetaMask/core/pull/10877))
12
13
  - Add the shared `all` feed scope to `FetchFeedOptions` and export `FeedScope`. Preserve optional `eventId`, `revision`, and `occurredAt` projection metadata on `FeedItem` ([#10865](https://github.com/MetaMask/core/pull/10865))
13
14
 
14
15
  ### Changed
@@ -20,6 +20,9 @@ export type SocialServiceFetchLeaderboardAction = {
20
20
  *
21
21
  * Calls `GET ${baseUrl}/traders/${addressOrId}/profile`.
22
22
  *
23
+ * `profile.createdAt` is optional. When present it is an ISO-8601 timestamp
24
+ * for when the social-api profile row was inserted.
25
+ *
23
26
  * @param options - Options bag.
24
27
  * @param options.addressOrId - Wallet address or Clicker profile ID.
25
28
  * @returns The trader profile response.
@@ -1 +1 @@
1
- {"version":3,"file":"SocialService-method-action-types.d.ts","sourceRoot":"","sources":["../src/SocialService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,kCAAkC,CAAC;IACzC,OAAO,EAAE,aAAa,CAAC,oBAAoB,CA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GAClC,iCAAiC,GACjC,iCAAiC,GACjC,wCAAwC,GACxC,oCAAoC,GACpC,wCAAwC,GACxC,iCAAiC,GACjC,mCAAmC,GACnC,mCAAmC,GACnC,yBAAyB,GACzB,2BAA2B,GAC3B,sCAAsC,GACtC,qCAAqC,GACrC,sDAAsD,GACtD,wBAAwB,GACxB,uCAAuC,GACvC,sCAAsC,CAAC"}
1
+ {"version":3,"file":"SocialService-method-action-types.d.ts","sourceRoot":"","sources":["../src/SocialService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,kCAAkC,CAAC;IACzC,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CAC9C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,kCAAkC,CAAC;IACzC,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CAC9C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,IAAI,EAAE,oCAAoC,CAAC;IAC3C,OAAO,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;CAChD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,IAAI,EAAE,oC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AAE,aAAa,CAAC,qCAAqC,CAAC,CAAC;CAC/D,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,IAAI,EAAE,oCAAoC,CAAC;IAC3C,OAAO,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;CAChD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,sCAAsC,GAAG;IACnD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAClC,mCAAmC,GACnC,qCAAqC,GACrC,qCAAqC,GACrC,uCAAuC,GACvC,iCAAiC,GACjC,uCAAuC,GACvC,oCAAoC,GACpC,4BAA4B,GAC5B,kCAAkC,GAClC,iCAAiC,GACjC,iCAAiC,GACjC,wCAAwC,GACxC,oCAAoC,GACpC,wCAAwC,GACxC,iCAAiC,GACjC,mCAAmC,GACnC,mCAAmC,GACnC,yBAAyB,GACzB,2BAA2B,GAC3B,sCAAsC,GACtC,qCAAqC,GACrC,sDAAsD,GACtD,wBAAwB,GACxB,uCAAuC,GACvC,sCAAsC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SocialService-method-action-types.js","sourceRoot":"","sources":["../src/SocialService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SocialService } from './SocialService.js';\n\n/**\n * Fetches the leaderboard of top traders.\n *\n * Calls `GET ${baseUrl}/leaderboard`.\n *\n * @param options - Optional query parameters for sorting, chain filtering, and limit.\n * @returns The leaderboard response with ranked traders.\n */\nexport type SocialServiceFetchLeaderboardAction = {\n type: `SocialService:fetchLeaderboard`;\n handler: SocialService['fetchLeaderboard'];\n};\n\n/**\n * Fetches a trader's profile by address or profile ID.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/profile`.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @returns The trader profile response.\n */\nexport type SocialServiceFetchTraderProfileAction = {\n type: `SocialService:fetchTraderProfile`;\n handler: SocialService['fetchTraderProfile'];\n};\n\n/**\n * Fetches a trader's open positions.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/positions/open`.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.chain - Filter by chain.\n * @param options.sort - Sort by 'value' or 'latest'.\n * @param options.limit - Number of results per page.\n * @param options.page - Page number (1-based).\n * @returns The positions response.\n */\nexport type SocialServiceFetchOpenPositionsAction = {\n type: `SocialService:fetchOpenPositions`;\n handler: SocialService['fetchOpenPositions'];\n};\n\n/**\n * Fetches a trader's closed positions.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/positions/closed`.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.chain - Filter by chain.\n * @param options.sort - Sort by 'value' or 'latest'.\n * @param options.limit - Number of results per page.\n * @param options.page - Page number (1-based).\n * @returns The positions response.\n */\nexport type SocialServiceFetchClosedPositionsAction = {\n type: `SocialService:fetchClosedPositions`;\n handler: SocialService['fetchClosedPositions'];\n};\n\n/**\n * Fetches a trader's MetaMask followers.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/followers`. Pass\n * `mutuals: true` to append `?mutuals=true` (profiles that follow both this\n * trader and the authenticated user; `count` is the mutual total). Requires a\n * bearer token; the trader is identified by `addressOrId`, not the JWT\n * subject (see {@link fetchMyFollowers} for the current user's inbound list).\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.mutuals - When true, request mutual followers only.\n * @returns The followers response.\n */\nexport type SocialServiceFetchFollowersAction = {\n type: `SocialService:fetchFollowers`;\n handler: SocialService['fetchFollowers'];\n};\n\n/**\n * Fetches the list of traders a profile follows.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/following`. Requires a bearer\n * token; the trader is identified by `addressOrId`, not the JWT subject (see\n * {@link fetchFollowing} for the current user's outbound list).\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @returns The following response.\n */\nexport type SocialServiceFetchTraderFollowingAction = {\n type: `SocialService:fetchTraderFollowing`;\n handler: SocialService['fetchTraderFollowing'];\n};\n\n/**\n * Fetches a single position by its unique ID.\n *\n * Calls `GET ${baseUrl}/traders/position/${positionId}`.\n *\n * @param options - Options bag.\n * @param options.positionId - Unique position ID (UUID).\n * @returns The position.\n */\nexport type SocialServiceFetchPositionByIdAction = {\n type: `SocialService:fetchPositionById`;\n handler: SocialService['fetchPositionById'];\n};\n\n/**\n * Fetches a page of the trader-activity feed.\n *\n * Calls `GET ${baseUrl}/feed`. For the `following` scope the current user is\n * identified server-side from the JWT sub claim carried in the Authorization\n * header; the `leaderboard` scope is generic and shared by all users.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.scope - `following` (default) or `leaderboard`.\n * @param options.chains - Filter by one or more chains.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\nexport type SocialServiceFetchFeedAction = {\n type: `SocialService:fetchFeed`;\n handler: SocialService['fetchFeed'];\n};\n\n/**\n * Fetches a page of one trader's activity as feed items.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/feed`. Unlike {@link fetchFeed},\n * this is scoped to a single profile (open and closed positions in the feed)\n * and does not accept `scope` or `chains`. Set `commentedOnly` to only return\n * positions that carry an author comment.\n *\n * The route is public, but the Authorization header is still sent so the\n * social-api can hydrate `authorComment.engagement.userReaction` for the\n * signed-in viewer.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.commentedOnly - When true, only positions with a comment.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\nexport type SocialServiceFetchTraderFeedAction = {\n type: `SocialService:fetchTraderFeed`;\n handler: SocialService['fetchTraderFeed'];\n};\n\n/**\n * Fetches a page of positions in one token, most recently traded first.\n *\n * Calls `GET ${baseUrl}/tokens/${chain}/${contractAddress}/feed`. Unlike\n * {@link fetchFeed}, this is scoped to a single token and does not accept\n * `scope` or `chains`. Omit `status` to include both open and recently\n * closed positions.\n *\n * The route is public, but the Authorization header is still sent so the\n * social-api can hydrate `authorComment.engagement.userReaction` for the\n * signed-in viewer.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.chain - Chain name where the token is deployed (`TokenFeedChain`).\n * @param options.contractAddress - Token contract address.\n * @param options.status - `open`, `closed`, or omit for both.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\nexport type SocialServiceFetchTokenFeedAction = {\n type: `SocialService:fetchTokenFeed`;\n handler: SocialService['fetchTokenFeed'];\n};\n\n/**\n * Adds or replaces the current user's reaction on a swap comment (Call).\n *\n * Calls `PUT ${baseUrl}/swap-comment/${commentId}/reaction`. One emotion per\n * user per comment: a later PUT replaces the previous emotion.\n *\n * @param options - Options bag.\n * @param options.commentId - `authorComment.uid` from a feed item.\n * @param options.emotion - Emoji or short code to store.\n * @returns Refreshed per-emotion counts and the caller's `userReaction`.\n */\nexport type SocialServiceReactToCommentAction = {\n type: `SocialService:reactToComment`;\n handler: SocialService['reactToComment'];\n};\n\n/**\n * Removes the current user's reaction on a swap comment (Call).\n *\n * Calls `DELETE ${baseUrl}/swap-comment/${commentId}/reaction`. Idempotent\n * when the caller has never reacted.\n *\n * @param options - Options bag.\n * @param options.commentId - `authorComment.uid` from a feed item.\n * @returns Refreshed per-emotion counts and a null `userReaction`.\n */\nexport type SocialServiceRemoveCommentReactionAction = {\n type: `SocialService:removeCommentReaction`;\n handler: SocialService['removeCommentReaction'];\n};\n\n/**\n * Creates an author Call (user post) on one of the current user's swaps.\n *\n * Calls `POST ${baseUrl}/swap-comments`. Identify the swap with\n * `positionUid` (the `positionId` of a feed item or position) or, for a\n * trade too recent to be indexed, `tradeInFlight`. Provide exactly one of\n * those two fields.\n *\n * @param options - Options bag.\n * @param options.commentText - Message body of the post. May include a\n * `https://static.klipy.com/...gif` file URL; social-api rejects other links.\n * @param options.source - Free-form origin label stored on the comment.\n * @param options.positionUid - Position UUID (`positionId` / feed item id).\n * @param options.tradeInFlight - Hash, chain, and token of a swap in flight.\n * @returns The created swap comment.\n */\nexport type SocialServiceCreateSwapCommentAction = {\n type: `SocialService:createSwapComment`;\n handler: SocialService['createSwapComment'];\n};\n\n/**\n * Records that the current user is copying a trade from a social post, so\n * the copy can be detected and attributed to the post's author.\n *\n * Calls `POST ${baseUrl}/copy-trade-intents`. Send swaps before submission\n * with the Bridge quote id, and perps right after submission with the\n * returned order id. The endpoint is idempotent per profile, origin, and\n * execution id: it answers 201 for a new intent and 200 with the existing\n * one on a retry.\n *\n * @param options - Options bag.\n * @param options.origin - Comment the trade was copied from.\n * @param options.copierAccount - CAIP-10 account placing the trade.\n * @param options.execution - Swap quote id or perps order id.\n * @returns The created or existing copy-trade intent.\n */\nexport type SocialServiceCreateCopyTradeIntentAction = {\n type: `SocialService:createCopyTradeIntent`;\n handler: SocialService['createCopyTradeIntent'];\n};\n\n/**\n * Fetches the list of traders the current user is following.\n *\n * Calls `GET ${baseUrl}/users/me/following`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * Prefer {@link fetchMyFollowing} in new code (pairs with\n * {@link fetchMyFollowers}). This method is unchanged and remains the\n * `/users/me/following` read.\n *\n * @returns The following response.\n */\nexport type SocialServiceFetchFollowingAction = {\n type: `SocialService:fetchFollowing`;\n handler: SocialService['fetchFollowing'];\n};\n\n/**\n * Fetches the list of traders the current user is following.\n *\n * Alias of {@link fetchFollowing}. Calls `GET ${baseUrl}/users/me/following`.\n * Preferred name in new code so `/users/me` reads are both `fetchMy*`.\n *\n * @returns The following response.\n */\nexport type SocialServiceFetchMyFollowingAction = {\n type: `SocialService:fetchMyFollowing`;\n handler: SocialService['fetchMyFollowing'];\n};\n\n/**\n * Fetches the list of traders following the current user.\n *\n * Calls `GET ${baseUrl}/users/me/followers`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @returns The followers response.\n */\nexport type SocialServiceFetchMyFollowersAction = {\n type: `SocialService:fetchMyFollowers`;\n handler: SocialService['fetchMyFollowers'];\n};\n\n/**\n * Follows one or more traders on behalf of the current user.\n *\n * Calls `PUT ${baseUrl}/users/me/follows`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.targets - Array of wallet addresses or profile IDs to follow.\n * @returns The follow response with confirmed follows.\n */\nexport type SocialServiceFollowAction = {\n type: `SocialService:follow`;\n handler: SocialService['follow'];\n};\n\n/**\n * Unfollows one or more traders on behalf of the current user.\n *\n * Calls `DELETE ${baseUrl}/users/me/follows?targets=...`. Targets are sent\n * as query params because Fastify does not parse request bodies on DELETE\n * requests per RFC 9110. The caller is identified server-side from the JWT\n * sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.targets - Array of wallet addresses or profile IDs to unfollow.\n * @returns The unfollow response with confirmed unfollows.\n */\nexport type SocialServiceUnfollowAction = {\n type: `SocialService:unfollow`;\n handler: SocialService['unfollow'];\n};\n\n/**\n * Opts the current user out of the PnL leaderboard.\n */\nexport type SocialServiceOptOutOfLeaderboardAction = {\n type: `SocialService:optOutOfLeaderboard`;\n handler: SocialService['optOutOfLeaderboard'];\n};\n\n/**\n * Opts the current user back into the PnL leaderboard.\n */\nexport type SocialServiceOptInToLeaderboardAction = {\n type: `SocialService:optInToLeaderboard`;\n handler: SocialService['optInToLeaderboard'];\n};\n\n/**\n * Asks the social-api to refresh its cached copy of the current user's\n * notification preferences.\n *\n * Calls `POST ${baseUrl}/notifications/preferences/cache-refresh`. The caller\n * is identified server-side from the JWT sub claim carried in the\n * Authorization header, so it can only ever refresh its own entry.\n *\n * The client calls this immediately after writing a preference change to\n * Authenticated User Storage (AUS), which is the source of truth. The social\n * api re-reads from AUS and repopulates its cache so the change is honoured\n * near-instantly rather than after the cache TTL lapses. It is a pure\n * optimisation on top of that bounded TTL: the write has already succeeded by\n * the time this runs, so callers should treat it as best-effort and must not\n * roll back the AUS write if it fails.\n */\nexport type SocialServiceRefreshNotificationPreferencesCacheAction = {\n type: `SocialService:refreshNotificationPreferencesCache`;\n handler: SocialService['refreshNotificationPreferencesCache'];\n};\n\n/**\n * Blocks a trader, swap comment, or reply for the current user.\n *\n * Calls `PUT ${baseUrl}/moderation/block`. Provide exactly one of\n * `profileId`, `commentId`, or `replyId`. Blocking the same target again\n * replaces `reason` when one is given. The caller is identified server-side\n * from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag. Exactly one target, plus an optional reason.\n * @param options.profileId - Profile id (UUID) of the trader to block.\n * @param options.commentId - Swap comment to block.\n * @param options.replyId - Comment reply to block.\n * @param options.reason - Free-form reason stored on the block.\n */\nexport type SocialServiceBlockAction = {\n type: `SocialService:block`;\n handler: SocialService['block'];\n};\n\n/**\n * Fetches traders the current user has blocked.\n *\n * Calls `GET ${baseUrl}/moderation/blocks/profiles`. Results are most\n * recently blocked first, 250 per page. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.cursor - Cursor from the previous page. Omit for the first page.\n * @returns The blocked profiles page.\n */\nexport type SocialServiceFetchBlockedProfilesAction = {\n type: `SocialService:fetchBlockedProfiles`;\n handler: SocialService['fetchBlockedProfiles'];\n};\n\n/**\n * Fetches comments and replies the current user has blocked.\n *\n * Calls `GET ${baseUrl}/moderation/blocks/content`. Results are most\n * recently blocked first, 250 per page. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.cursor - Cursor from the previous page. Omit for the first page.\n * @returns The blocked content page.\n */\nexport type SocialServiceFetchBlockedContentAction = {\n type: `SocialService:fetchBlockedContent`;\n handler: SocialService['fetchBlockedContent'];\n};\n\n/**\n * Union of all SocialService action types.\n */\nexport type SocialServiceMethodActions =\n | SocialServiceFetchLeaderboardAction\n | SocialServiceFetchTraderProfileAction\n | SocialServiceFetchOpenPositionsAction\n | SocialServiceFetchClosedPositionsAction\n | SocialServiceFetchFollowersAction\n | SocialServiceFetchTraderFollowingAction\n | SocialServiceFetchPositionByIdAction\n | SocialServiceFetchFeedAction\n | SocialServiceFetchTraderFeedAction\n | SocialServiceFetchTokenFeedAction\n | SocialServiceReactToCommentAction\n | SocialServiceRemoveCommentReactionAction\n | SocialServiceCreateSwapCommentAction\n | SocialServiceCreateCopyTradeIntentAction\n | SocialServiceFetchFollowingAction\n | SocialServiceFetchMyFollowingAction\n | SocialServiceFetchMyFollowersAction\n | SocialServiceFollowAction\n | SocialServiceUnfollowAction\n | SocialServiceOptOutOfLeaderboardAction\n | SocialServiceOptInToLeaderboardAction\n | SocialServiceRefreshNotificationPreferencesCacheAction\n | SocialServiceBlockAction\n | SocialServiceFetchBlockedProfilesAction\n | SocialServiceFetchBlockedContentAction;\n"]}
1
+ {"version":3,"file":"SocialService-method-action-types.js","sourceRoot":"","sources":["../src/SocialService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SocialService } from './SocialService.js';\n\n/**\n * Fetches the leaderboard of top traders.\n *\n * Calls `GET ${baseUrl}/leaderboard`.\n *\n * @param options - Optional query parameters for sorting, chain filtering, and limit.\n * @returns The leaderboard response with ranked traders.\n */\nexport type SocialServiceFetchLeaderboardAction = {\n type: `SocialService:fetchLeaderboard`;\n handler: SocialService['fetchLeaderboard'];\n};\n\n/**\n * Fetches a trader's profile by address or profile ID.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/profile`.\n *\n * `profile.createdAt` is optional. When present it is an ISO-8601 timestamp\n * for when the social-api profile row was inserted.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @returns The trader profile response.\n */\nexport type SocialServiceFetchTraderProfileAction = {\n type: `SocialService:fetchTraderProfile`;\n handler: SocialService['fetchTraderProfile'];\n};\n\n/**\n * Fetches a trader's open positions.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/positions/open`.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.chain - Filter by chain.\n * @param options.sort - Sort by 'value' or 'latest'.\n * @param options.limit - Number of results per page.\n * @param options.page - Page number (1-based).\n * @returns The positions response.\n */\nexport type SocialServiceFetchOpenPositionsAction = {\n type: `SocialService:fetchOpenPositions`;\n handler: SocialService['fetchOpenPositions'];\n};\n\n/**\n * Fetches a trader's closed positions.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/positions/closed`.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.chain - Filter by chain.\n * @param options.sort - Sort by 'value' or 'latest'.\n * @param options.limit - Number of results per page.\n * @param options.page - Page number (1-based).\n * @returns The positions response.\n */\nexport type SocialServiceFetchClosedPositionsAction = {\n type: `SocialService:fetchClosedPositions`;\n handler: SocialService['fetchClosedPositions'];\n};\n\n/**\n * Fetches a trader's MetaMask followers.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/followers`. Pass\n * `mutuals: true` to append `?mutuals=true` (profiles that follow both this\n * trader and the authenticated user; `count` is the mutual total). Requires a\n * bearer token; the trader is identified by `addressOrId`, not the JWT\n * subject (see {@link fetchMyFollowers} for the current user's inbound list).\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.mutuals - When true, request mutual followers only.\n * @returns The followers response.\n */\nexport type SocialServiceFetchFollowersAction = {\n type: `SocialService:fetchFollowers`;\n handler: SocialService['fetchFollowers'];\n};\n\n/**\n * Fetches the list of traders a profile follows.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/following`. Requires a bearer\n * token; the trader is identified by `addressOrId`, not the JWT subject (see\n * {@link fetchFollowing} for the current user's outbound list).\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @returns The following response.\n */\nexport type SocialServiceFetchTraderFollowingAction = {\n type: `SocialService:fetchTraderFollowing`;\n handler: SocialService['fetchTraderFollowing'];\n};\n\n/**\n * Fetches a single position by its unique ID.\n *\n * Calls `GET ${baseUrl}/traders/position/${positionId}`.\n *\n * @param options - Options bag.\n * @param options.positionId - Unique position ID (UUID).\n * @returns The position.\n */\nexport type SocialServiceFetchPositionByIdAction = {\n type: `SocialService:fetchPositionById`;\n handler: SocialService['fetchPositionById'];\n};\n\n/**\n * Fetches a page of the trader-activity feed.\n *\n * Calls `GET ${baseUrl}/feed`. For the `following` scope the current user is\n * identified server-side from the JWT sub claim carried in the Authorization\n * header; the `leaderboard` scope is generic and shared by all users.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.scope - `following` (default) or `leaderboard`.\n * @param options.chains - Filter by one or more chains.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\nexport type SocialServiceFetchFeedAction = {\n type: `SocialService:fetchFeed`;\n handler: SocialService['fetchFeed'];\n};\n\n/**\n * Fetches a page of one trader's activity as feed items.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/feed`. Unlike {@link fetchFeed},\n * this is scoped to a single profile (open and closed positions in the feed)\n * and does not accept `scope` or `chains`. Set `commentedOnly` to only return\n * positions that carry an author comment.\n *\n * The route is public, but the Authorization header is still sent so the\n * social-api can hydrate `authorComment.engagement.userReaction` for the\n * signed-in viewer.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.commentedOnly - When true, only positions with a comment.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\nexport type SocialServiceFetchTraderFeedAction = {\n type: `SocialService:fetchTraderFeed`;\n handler: SocialService['fetchTraderFeed'];\n};\n\n/**\n * Fetches a page of positions in one token, most recently traded first.\n *\n * Calls `GET ${baseUrl}/tokens/${chain}/${contractAddress}/feed`. Unlike\n * {@link fetchFeed}, this is scoped to a single token and does not accept\n * `scope` or `chains`. Omit `status` to include both open and recently\n * closed positions.\n *\n * The route is public, but the Authorization header is still sent so the\n * social-api can hydrate `authorComment.engagement.userReaction` for the\n * signed-in viewer.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.chain - Chain name where the token is deployed (`TokenFeedChain`).\n * @param options.contractAddress - Token contract address.\n * @param options.status - `open`, `closed`, or omit for both.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\nexport type SocialServiceFetchTokenFeedAction = {\n type: `SocialService:fetchTokenFeed`;\n handler: SocialService['fetchTokenFeed'];\n};\n\n/**\n * Adds or replaces the current user's reaction on a swap comment (Call).\n *\n * Calls `PUT ${baseUrl}/swap-comment/${commentId}/reaction`. One emotion per\n * user per comment: a later PUT replaces the previous emotion.\n *\n * @param options - Options bag.\n * @param options.commentId - `authorComment.uid` from a feed item.\n * @param options.emotion - Emoji or short code to store.\n * @returns Refreshed per-emotion counts and the caller's `userReaction`.\n */\nexport type SocialServiceReactToCommentAction = {\n type: `SocialService:reactToComment`;\n handler: SocialService['reactToComment'];\n};\n\n/**\n * Removes the current user's reaction on a swap comment (Call).\n *\n * Calls `DELETE ${baseUrl}/swap-comment/${commentId}/reaction`. Idempotent\n * when the caller has never reacted.\n *\n * @param options - Options bag.\n * @param options.commentId - `authorComment.uid` from a feed item.\n * @returns Refreshed per-emotion counts and a null `userReaction`.\n */\nexport type SocialServiceRemoveCommentReactionAction = {\n type: `SocialService:removeCommentReaction`;\n handler: SocialService['removeCommentReaction'];\n};\n\n/**\n * Creates an author Call (user post) on one of the current user's swaps.\n *\n * Calls `POST ${baseUrl}/swap-comments`. Identify the swap with\n * `positionUid` (the `positionId` of a feed item or position) or, for a\n * trade too recent to be indexed, `tradeInFlight`. Provide exactly one of\n * those two fields.\n *\n * @param options - Options bag.\n * @param options.commentText - Message body of the post. May include a\n * `https://static.klipy.com/...gif` file URL; social-api rejects other links.\n * @param options.source - Free-form origin label stored on the comment.\n * @param options.positionUid - Position UUID (`positionId` / feed item id).\n * @param options.tradeInFlight - Hash, chain, and token of a swap in flight.\n * @returns The created swap comment.\n */\nexport type SocialServiceCreateSwapCommentAction = {\n type: `SocialService:createSwapComment`;\n handler: SocialService['createSwapComment'];\n};\n\n/**\n * Records that the current user is copying a trade from a social post, so\n * the copy can be detected and attributed to the post's author.\n *\n * Calls `POST ${baseUrl}/copy-trade-intents`. Send swaps before submission\n * with the Bridge quote id, and perps right after submission with the\n * returned order id. The endpoint is idempotent per profile, origin, and\n * execution id: it answers 201 for a new intent and 200 with the existing\n * one on a retry.\n *\n * @param options - Options bag.\n * @param options.origin - Comment the trade was copied from.\n * @param options.copierAccount - CAIP-10 account placing the trade.\n * @param options.execution - Swap quote id or perps order id.\n * @returns The created or existing copy-trade intent.\n */\nexport type SocialServiceCreateCopyTradeIntentAction = {\n type: `SocialService:createCopyTradeIntent`;\n handler: SocialService['createCopyTradeIntent'];\n};\n\n/**\n * Fetches the list of traders the current user is following.\n *\n * Calls `GET ${baseUrl}/users/me/following`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * Prefer {@link fetchMyFollowing} in new code (pairs with\n * {@link fetchMyFollowers}). This method is unchanged and remains the\n * `/users/me/following` read.\n *\n * @returns The following response.\n */\nexport type SocialServiceFetchFollowingAction = {\n type: `SocialService:fetchFollowing`;\n handler: SocialService['fetchFollowing'];\n};\n\n/**\n * Fetches the list of traders the current user is following.\n *\n * Alias of {@link fetchFollowing}. Calls `GET ${baseUrl}/users/me/following`.\n * Preferred name in new code so `/users/me` reads are both `fetchMy*`.\n *\n * @returns The following response.\n */\nexport type SocialServiceFetchMyFollowingAction = {\n type: `SocialService:fetchMyFollowing`;\n handler: SocialService['fetchMyFollowing'];\n};\n\n/**\n * Fetches the list of traders following the current user.\n *\n * Calls `GET ${baseUrl}/users/me/followers`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @returns The followers response.\n */\nexport type SocialServiceFetchMyFollowersAction = {\n type: `SocialService:fetchMyFollowers`;\n handler: SocialService['fetchMyFollowers'];\n};\n\n/**\n * Follows one or more traders on behalf of the current user.\n *\n * Calls `PUT ${baseUrl}/users/me/follows`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.targets - Array of wallet addresses or profile IDs to follow.\n * @returns The follow response with confirmed follows.\n */\nexport type SocialServiceFollowAction = {\n type: `SocialService:follow`;\n handler: SocialService['follow'];\n};\n\n/**\n * Unfollows one or more traders on behalf of the current user.\n *\n * Calls `DELETE ${baseUrl}/users/me/follows?targets=...`. Targets are sent\n * as query params because Fastify does not parse request bodies on DELETE\n * requests per RFC 9110. The caller is identified server-side from the JWT\n * sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.targets - Array of wallet addresses or profile IDs to unfollow.\n * @returns The unfollow response with confirmed unfollows.\n */\nexport type SocialServiceUnfollowAction = {\n type: `SocialService:unfollow`;\n handler: SocialService['unfollow'];\n};\n\n/**\n * Opts the current user out of the PnL leaderboard.\n */\nexport type SocialServiceOptOutOfLeaderboardAction = {\n type: `SocialService:optOutOfLeaderboard`;\n handler: SocialService['optOutOfLeaderboard'];\n};\n\n/**\n * Opts the current user back into the PnL leaderboard.\n */\nexport type SocialServiceOptInToLeaderboardAction = {\n type: `SocialService:optInToLeaderboard`;\n handler: SocialService['optInToLeaderboard'];\n};\n\n/**\n * Asks the social-api to refresh its cached copy of the current user's\n * notification preferences.\n *\n * Calls `POST ${baseUrl}/notifications/preferences/cache-refresh`. The caller\n * is identified server-side from the JWT sub claim carried in the\n * Authorization header, so it can only ever refresh its own entry.\n *\n * The client calls this immediately after writing a preference change to\n * Authenticated User Storage (AUS), which is the source of truth. The social\n * api re-reads from AUS and repopulates its cache so the change is honoured\n * near-instantly rather than after the cache TTL lapses. It is a pure\n * optimisation on top of that bounded TTL: the write has already succeeded by\n * the time this runs, so callers should treat it as best-effort and must not\n * roll back the AUS write if it fails.\n */\nexport type SocialServiceRefreshNotificationPreferencesCacheAction = {\n type: `SocialService:refreshNotificationPreferencesCache`;\n handler: SocialService['refreshNotificationPreferencesCache'];\n};\n\n/**\n * Blocks a trader, swap comment, or reply for the current user.\n *\n * Calls `PUT ${baseUrl}/moderation/block`. Provide exactly one of\n * `profileId`, `commentId`, or `replyId`. Blocking the same target again\n * replaces `reason` when one is given. The caller is identified server-side\n * from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag. Exactly one target, plus an optional reason.\n * @param options.profileId - Profile id (UUID) of the trader to block.\n * @param options.commentId - Swap comment to block.\n * @param options.replyId - Comment reply to block.\n * @param options.reason - Free-form reason stored on the block.\n */\nexport type SocialServiceBlockAction = {\n type: `SocialService:block`;\n handler: SocialService['block'];\n};\n\n/**\n * Fetches traders the current user has blocked.\n *\n * Calls `GET ${baseUrl}/moderation/blocks/profiles`. Results are most\n * recently blocked first, 250 per page. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.cursor - Cursor from the previous page. Omit for the first page.\n * @returns The blocked profiles page.\n */\nexport type SocialServiceFetchBlockedProfilesAction = {\n type: `SocialService:fetchBlockedProfiles`;\n handler: SocialService['fetchBlockedProfiles'];\n};\n\n/**\n * Fetches comments and replies the current user has blocked.\n *\n * Calls `GET ${baseUrl}/moderation/blocks/content`. Results are most\n * recently blocked first, 250 per page. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.cursor - Cursor from the previous page. Omit for the first page.\n * @returns The blocked content page.\n */\nexport type SocialServiceFetchBlockedContentAction = {\n type: `SocialService:fetchBlockedContent`;\n handler: SocialService['fetchBlockedContent'];\n};\n\n/**\n * Union of all SocialService action types.\n */\nexport type SocialServiceMethodActions =\n | SocialServiceFetchLeaderboardAction\n | SocialServiceFetchTraderProfileAction\n | SocialServiceFetchOpenPositionsAction\n | SocialServiceFetchClosedPositionsAction\n | SocialServiceFetchFollowersAction\n | SocialServiceFetchTraderFollowingAction\n | SocialServiceFetchPositionByIdAction\n | SocialServiceFetchFeedAction\n | SocialServiceFetchTraderFeedAction\n | SocialServiceFetchTokenFeedAction\n | SocialServiceReactToCommentAction\n | SocialServiceRemoveCommentReactionAction\n | SocialServiceCreateSwapCommentAction\n | SocialServiceCreateCopyTradeIntentAction\n | SocialServiceFetchFollowingAction\n | SocialServiceFetchMyFollowingAction\n | SocialServiceFetchMyFollowersAction\n | SocialServiceFollowAction\n | SocialServiceUnfollowAction\n | SocialServiceOptOutOfLeaderboardAction\n | SocialServiceOptInToLeaderboardAction\n | SocialServiceRefreshNotificationPreferencesCacheAction\n | SocialServiceBlockAction\n | SocialServiceFetchBlockedProfilesAction\n | SocialServiceFetchBlockedContentAction;\n"]}
@@ -35,6 +35,9 @@ export declare class SocialService extends BaseDataService<typeof serviceName, S
35
35
  *
36
36
  * Calls `GET ${baseUrl}/traders/${addressOrId}/profile`.
37
37
  *
38
+ * `profile.createdAt` is optional. When present it is an ISO-8601 timestamp
39
+ * for when the social-api profile row was inserted.
40
+ *
38
41
  * @param options - Options bag.
39
42
  * @param options.addressOrId - Wallet address or Clicker profile ID.
40
43
  * @returns The trader profile response.
@@ -1 +1 @@
1
- {"version":3,"file":"SocialService.d.ts","sourceRoot":"","sources":["../src/SocialService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,oCAAoC,EACpC,kCAAkC,EACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAiBlF,OAAO,EAAE,WAAW,EAA6B,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EAExB,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,2BAA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uB,CAAC,CA6BlC;IAED;;;;;;;;;;OAUG;IACG,mBAAmB,CACvB,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,sBAAsB,CAAC,CA6BjC;CAqEF"}
@@ -82,6 +82,7 @@ const TraderProfileStruct = structType({
82
82
  allAddresses: array(string()),
83
83
  name: string(),
84
84
  imageUrl: optional(nullable(string())),
85
+ createdAt: optional(nullable(string())),
85
86
  });
86
87
  const TraderStatsStruct = structType({
87
88
  pnl30d: optional(nullable(number())),
@@ -390,6 +391,9 @@ export class SocialService extends BaseDataService {
390
391
  *
391
392
  * Calls `GET ${baseUrl}/traders/${addressOrId}/profile`.
392
393
  *
394
+ * `profile.createdAt` is optional. When present it is an ISO-8601 timestamp
395
+ * for when the social-api profile row was inserted.
396
+ *
393
397
  * @param options - Options bag.
394
398
  * @param options.addressOrId - Wallet address or Clicker profile ID.
395
399
  * @returns The trader profile response.
@@ -1 +1 @@
1
- {"version":3,"file":"SocialService.js","sourceRoot":"","sources":["../src/SocialService.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,KAAK,EACL,EAAE,EACF,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,IAAI,IAAI,UAAU,EAClB,KAAK,GACN,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAmC/E,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrE,8EAA8E;AAC9E,iCAAiC;AACjC,8EAA8E;AAE9E,MAAM,mBAAmB,GAAG,UAAU,CAAC;IACrC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAA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AAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBACxC,CAAC;gBACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;oBACxB,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;gBAClD,CAAC;gBACD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBACvB,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;gBAChD,CAAC;gBAED,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;gBACjD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE;oBAC3C,OAAO,EAAE,WAAW;iBACrB,CAAC,CAAC;gBACH,EAAa,CAAC,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;gBACrD,MAAM,aAAa,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAY,CAAC;gBACzD,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,uBAAuB,CAAC,EAAE,CAAC;oBAChD,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;gBAClC,CAAC;gBACD,OAAO,aAAa,CAAC;YACvB,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF","sourcesContent":["import type {\n DataServiceCacheUpdatedEvent,\n DataServiceGranularCacheUpdatedEvent,\n DataServiceInvalidateQueriesAction,\n} from '@metamask/base-data-service';\nimport { BaseDataService } from '@metamask/base-data-service';\nimport type { CreateServicePolicyOptions } from '@metamask/controller-utils';\nimport { HttpError } from '@metamask/controller-utils';\nimport type { Messenger } from '@metamask/messenger';\nimport type { AuthenticationController } from '@metamask/profile-sync-controller';\nimport {\n array,\n assign,\n boolean,\n enums,\n is,\n literal,\n nullable,\n number,\n optional,\n record,\n string,\n type as structType,\n union,\n} from '@metamask/superstruct';\n\nimport { serviceName, SocialServiceErrorMessage } from './social-constants.js';\nimport type {\n BlockedContentResponse,\n BlockedProfilesResponse,\n BlockOptions,\n CommentEngagement,\n CopyTradeIntentResponse,\n CreateCopyTradeIntentOptions,\n CreateSwapCommentOptions,\n FeedItem,\n FeedResponse,\n FetchBlockedListOptions,\n FetchFeedOptions,\n FetchFollowersOptions,\n FetchTraderFollowingOptions,\n FetchLeaderboardOptions,\n FetchPositionByIdOptions,\n FetchPositionsOptions,\n FetchTokenFeedOptions,\n FetchTraderFeedOptions,\n FetchTraderProfileOptions,\n FollowersResponse,\n FollowingResponse,\n FollowOptions,\n FollowResponse,\n LeaderboardResponse,\n Position,\n PositionsResponse,\n ReactToCommentOptions,\n RemoveCommentReactionOptions,\n SwapCommentResponse,\n TraderProfileResponse,\n UnfollowOptions,\n UnfollowResponse,\n} from './social-types.js';\nimport { TRADER_RANKING_TAGS, TradeStruct } from './social-types.js';\nimport type { SocialServiceMethodActions } from './SocialService-method-action-types.js';\n\n// ---------------------------------------------------------------------------\n// Superstruct validation schemas\n// ---------------------------------------------------------------------------\n\nconst SocialHandlesStruct = structType({\n twitter: optional(nullable(string())),\n farcaster: optional(nullable(string())),\n ens: optional(nullable(string())),\n lens: optional(nullable(string())),\n});\n\nconst ProfileSummaryStruct = structType({\n profileId: string(),\n address: string(),\n name: string(),\n imageUrl: optional(nullable(string())),\n});\n\nconst FeedActorStruct = assign(\n ProfileSummaryStruct,\n structType({\n winRate30d: optional(nullable(number())),\n pnl30d: optional(nullable(number())),\n tradeCount30d: optional(nullable(number())),\n followerCount: optional(nullable(number())),\n }),\n);\n\nconst PositionStruct = structType({\n positionId: string(),\n tokenSymbol: string(),\n tokenName: string(),\n tokenAddress: string(),\n chain: string(),\n positionAmount: number(),\n isOpen: optional(boolean()),\n // Incomplete Clicker metrics serialize these as `null` (`undefined + n`\n // becomes `NaN`, then JSON `null`). Rejecting the field used to fail the\n // entire feed page, so they are nullable here.\n boughtUsd: nullable(number()),\n soldUsd: nullable(number()),\n realizedPnl: nullable(number()),\n costBasis: nullable(number()),\n trades: array(TradeStruct),\n lastTradeAt: number(),\n tokenImageUrl: optional(nullable(string())),\n currentValueUSD: optional(nullable(number())),\n pnlValueUsd: optional(nullable(number())),\n pnlPercent: optional(nullable(number())),\n copyCount: optional(number()),\n perpPositionType: optional(nullable(enums(['long', 'short']))),\n perpLeverage: optional(nullable(number())),\n positionAmountWithLeverage: optional(nullable(number())),\n});\n\nconst PaginationStruct = structType({\n hasMore: boolean(),\n nextPage: optional(number()),\n});\n\nconst LeaderboardEntryStruct = structType({\n rank: number(),\n addresses: array(string()),\n profileId: string(),\n name: string(),\n imageUrl: optional(nullable(string())),\n pnl30d: number(),\n winRate30d: optional(nullable(number())),\n roiPercent30d: optional(nullable(number())),\n tradeCount30d: optional(nullable(number())),\n pnl7d: optional(nullable(number())),\n winRate7d: optional(nullable(number())),\n roiPercent7d: optional(nullable(number())),\n tradeCount7d: optional(nullable(number())),\n pnlPerChain: record(string(), number()),\n followerCount: number(),\n socialHandles: SocialHandlesStruct,\n});\n\nconst LeaderboardResponseStruct = structType({\n traders: array(LeaderboardEntryStruct),\n});\n\nconst TraderProfileStruct = structType({\n profileId: string(),\n address: string(),\n allAddresses: array(string()),\n name: string(),\n imageUrl: optional(nullable(string())),\n});\n\nconst TraderStatsStruct = structType({\n pnl30d: optional(nullable(number())),\n winRate30d: optional(nullable(number())),\n roiPercent30d: optional(nullable(number())),\n tradeCount30d: optional(nullable(number())),\n volumeUsd30d: optional(nullable(number())),\n pnl7d: optional(nullable(number())),\n winRate7d: optional(nullable(number())),\n roiPercent7d: optional(nullable(number())),\n tradeCount7d: optional(nullable(number())),\n medianHoldMinutes: optional(nullable(number())),\n});\n\nconst PerChainBreakdownStruct = structType({\n perChainPnl: record(string(), number()),\n perChainRoi: record(string(), nullable(number())),\n perChainVolume: record(string(), number()),\n perChainPnl7d: optional(record(string(), number())),\n perChainRoi7d: optional(record(string(), nullable(number()))),\n perChainVolume7d: optional(record(string(), number())),\n});\n\nconst CopytradedAllTimeStruct = structType({\n count: number(),\n volumeUSD: number(),\n distinctActors: number(),\n});\n\nconst TraderProfileResponseStruct = structType({\n profile: TraderProfileStruct,\n stats: TraderStatsStruct,\n perChainBreakdown: PerChainBreakdownStruct,\n socialHandles: SocialHandlesStruct,\n followerCount: number(),\n followingCount: number(),\n copytradedAllTime: CopytradedAllTimeStruct,\n rankingTag: optional(nullable(enums(TRADER_RANKING_TAGS))),\n});\n\nconst PositionsResponseStruct = structType({\n positions: array(PositionStruct),\n pagination: PaginationStruct,\n computedAt: optional(nullable(string())),\n});\n\n// A feed item is a position plus the trader who made the trade (`actor`) and\n// the item's creation timestamp. Reuses PositionStruct so the trade/position\n// fields stay in lockstep with the positions endpoints.\nconst CommentReactionProfileStruct = structType({\n id: string(),\n name: string(),\n});\n\nconst CommentReactionStruct = structType({\n emotion: string(),\n count: number(),\n profiles: array(CommentReactionProfileStruct),\n});\n\nconst CommentEngagementStruct = structType({\n reactions: array(CommentReactionStruct),\n userReaction: nullable(string()),\n replyCount: optional(number()),\n});\n\nconst AuthorCommentStruct = structType({\n uid: string(),\n text: string(),\n timestamp: number(),\n engagement: CommentEngagementStruct,\n});\n\nconst SwapCommentAuthorStruct = structType({\n id: string(),\n name: string(),\n images: optional(\n structType({\n raw: nullable(string()),\n xs: nullable(string()),\n sm: nullable(string()),\n }),\n ),\n addresses: optional(array(string())),\n externalId: optional(string()),\n});\n\nconst SwapCommentResponseStruct = structType({\n uid: string(),\n transactionHash: string(),\n chain: string(),\n tokenAddress: string(),\n commentText: string(),\n author: SwapCommentAuthorStruct,\n timestamp: number(),\n isAppUserComment: boolean(),\n metrics: CommentEngagementStruct,\n});\n\nconst CopyTradeAccountStruct = structType({\n profileId: string(),\n caip10: string(),\n});\n\nconst CopyTradeIntentResponseStruct = structType({\n id: string(),\n origin: structType({\n kind: literal('comment'),\n id: string(),\n }),\n copierAccount: CopyTradeAccountStruct,\n sourceAccount: nullable(CopyTradeAccountStruct),\n execution: union([\n structType({ product: literal('swaps'), quoteId: string() }),\n structType({ product: literal('perps'), oid: string() }),\n ]),\n payoutEligibility: structType({\n status: enums(['payable', 'non_payable']),\n reason: string(),\n }),\n createdAt: string(),\n});\n\nconst FeedItemStruct = assign(\n PositionStruct,\n structType({\n actor: FeedActorStruct,\n timestamp: number(),\n authorComment: optional(nullable(AuthorCommentStruct)),\n commentCount: optional(number()),\n replyCount: optional(number()),\n copyCount: optional(number()),\n firstTradeAt: optional(nullable(number())),\n holdTimeMs: optional(nullable(number())),\n entryPriceUsd: optional(nullable(number())),\n eventId: optional(string()),\n revision: optional(number()),\n occurredAt: optional(string()),\n }),\n);\n\nconst FeedPaginationStruct = structType({\n olderCursor: nullable(string()),\n newerCursor: nullable(string()),\n});\n\nconst FeedResponseStruct = structType({\n items: array(FeedItemStruct),\n pagination: FeedPaginationStruct,\n});\n\n/**\n * One malformed feed item must not blank the page. When the envelope is\n * well-shaped, keep items that match {@link FeedItemStruct} and drop the rest.\n * Still throw when `items` or `pagination` themselves are unusable.\n *\n * @param feedData - Parsed JSON body from a feed endpoint.\n * @param invalidMessage - Error message to throw when the envelope is unusable.\n * @returns The validated feed response, possibly with invalid items dropped.\n */\nconst parseFeedResponse = (\n feedData: unknown,\n invalidMessage: string,\n): FeedResponse => {\n if (is(feedData, FeedResponseStruct)) {\n return feedData;\n }\n\n if (\n typeof feedData !== 'object' ||\n feedData === null ||\n !('items' in feedData) ||\n !('pagination' in feedData)\n ) {\n throw new Error(invalidMessage);\n }\n\n const { items, pagination } = feedData;\n\n if (!Array.isArray(items) || !is(pagination, FeedPaginationStruct)) {\n throw new Error(invalidMessage);\n }\n\n return {\n items: items.filter((item): item is FeedItem => is(item, FeedItemStruct)),\n pagination,\n };\n};\n\nconst FollowersResponseStruct = structType({\n followers: array(ProfileSummaryStruct),\n count: number(),\n});\n\nconst FollowingResponseStruct = structType({\n following: array(ProfileSummaryStruct),\n count: number(),\n});\n\nconst FollowResponseStruct = structType({\n followed: array(ProfileSummaryStruct),\n});\n\nconst UnfollowResponseStruct = structType({\n unfollowed: array(ProfileSummaryStruct),\n});\n\nconst BlockedProfileStruct = structType({\n blockedAt: number(),\n reason: nullable(string()),\n profile: ProfileSummaryStruct,\n});\n\nconst BlockedProfilesResponseStruct = structType({\n items: array(BlockedProfileStruct),\n cursor: nullable(string()),\n});\n\nconst BlockedContentStruct = structType({\n blockedAt: number(),\n reason: nullable(string()),\n type: enums(['comment', 'reply']),\n id: string(),\n text: string(),\n createdAt: number(),\n author: nullable(ProfileSummaryStruct),\n});\n\nconst BlockedContentResponseStruct = structType({\n items: array(BlockedContentStruct),\n cursor: nullable(string()),\n});\n\n// ---------------------------------------------------------------------------\n// Messenger types\n// ---------------------------------------------------------------------------\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'fetchLeaderboard',\n 'fetchTraderProfile',\n 'fetchOpenPositions',\n 'fetchClosedPositions',\n 'fetchFollowers',\n 'fetchTraderFollowing',\n 'fetchFollowing',\n 'fetchMyFollowing',\n 'fetchMyFollowers',\n 'fetchPositionById',\n 'fetchFeed',\n 'fetchTraderFeed',\n 'fetchTokenFeed',\n 'reactToComment',\n 'removeCommentReaction',\n 'createSwapComment',\n 'createCopyTradeIntent',\n 'follow',\n 'unfollow',\n 'optOutOfLeaderboard',\n 'optInToLeaderboard',\n 'refreshNotificationPreferencesCache',\n 'block',\n 'fetchBlockedProfiles',\n 'fetchBlockedContent',\n] as const;\n\nexport type SocialServiceActions =\n | SocialServiceMethodActions\n | DataServiceInvalidateQueriesAction<typeof serviceName>;\n\nexport type SocialServiceEvents =\n | DataServiceCacheUpdatedEvent<typeof serviceName>\n | DataServiceGranularCacheUpdatedEvent<typeof serviceName>;\n\ntype AllowedActions =\n AuthenticationController.AuthenticationControllerGetBearerTokenAction;\n\ntype AllowedEvents = never;\n\nexport type SocialServiceMessenger = Messenger<\n typeof serviceName,\n SocialServiceActions | AllowedActions,\n SocialServiceEvents | AllowedEvents\n>;\n\n// ---------------------------------------------------------------------------\n// Service\n// ---------------------------------------------------------------------------\n\n/**\n * Data service wrapping social-api endpoints.\n */\nexport class SocialService extends BaseDataService<\n typeof serviceName,\n SocialServiceMessenger\n> {\n readonly #baseUrl: string;\n\n get #v1Url(): string {\n return `${this.#baseUrl}/api/v1`;\n }\n\n get #v2Url(): string {\n return `${this.#baseUrl}/api/v2`;\n }\n\n constructor({\n messenger,\n baseUrl,\n policyOptions,\n }: {\n messenger: SocialServiceMessenger;\n baseUrl: string;\n policyOptions?: CreateServicePolicyOptions;\n }) {\n super({ name: serviceName, messenger, policyOptions });\n this.#baseUrl = baseUrl;\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Throws an HttpError if the response is not ok.\n *\n * @param response - The fetch response to check.\n * @param message - The error message prefix from SocialServiceErrorMessage.\n */\n static #throwIfNotOk(response: Response, message: string): void {\n if (!response.ok) {\n throw new HttpError(response.status, `${message}: ${response.status}`);\n }\n }\n\n /**\n * Returns an Authorization header with a JWT bearer token obtained from the\n * AuthenticationController.\n *\n * @returns A headers object containing the Authorization header.\n */\n async #getAuthHeaders(): Promise<Record<string, string>> {\n const token = await this.messenger.call(\n 'AuthenticationController:getBearerToken',\n );\n return { Authorization: `Bearer ${token}` };\n }\n\n /**\n * Fetches the leaderboard of top traders.\n *\n * Calls `GET ${baseUrl}/leaderboard`.\n *\n * @param options - Optional query parameters for sorting, chain filtering, and limit.\n * @returns The leaderboard response with ranked traders.\n */\n async fetchLeaderboard(\n options?: FetchLeaderboardOptions,\n ): Promise<LeaderboardResponse> {\n const leaderboardResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchLeaderboard`, options ?? null],\n queryFn: async () => {\n const { sort, chains, limit } = options ?? {};\n const url = new URL(`${this.#v1Url}/leaderboard`);\n if (sort) {\n url.searchParams.append('sort', sort);\n }\n if (chains) {\n for (const chain of chains) {\n url.searchParams.append('chains', chain);\n }\n }\n if (limit !== undefined) {\n url.searchParams.append('limit', String(limit));\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_LEADERBOARD_FAILED,\n );\n const leaderboardData = (await response.json()) as unknown;\n if (!is(leaderboardData, LeaderboardResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_LEADERBOARD_INVALID_RESPONSE,\n );\n }\n return leaderboardData;\n },\n });\n\n return leaderboardResponse;\n }\n\n /**\n * Fetches a trader's profile by address or profile ID.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/profile`.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @returns The trader profile response.\n */\n async fetchTraderProfile(\n options: FetchTraderProfileOptions,\n ): Promise<TraderProfileResponse> {\n const { addressOrId } = options;\n\n const traderProfileResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchTraderProfile`, addressOrId],\n queryFn: async () => {\n const url = `${this.#v1Url}/traders/${encodeURIComponent(addressOrId)}/profile`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_TRADER_PROFILE_FAILED,\n );\n const traderProfileData = (await response.json()) as unknown;\n if (!is(traderProfileData, TraderProfileResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_TRADER_PROFILE_INVALID_RESPONSE,\n );\n }\n return traderProfileData;\n },\n });\n\n return traderProfileResponse;\n }\n\n /**\n * Fetches a trader's open positions.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/positions/open`.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.chain - Filter by chain.\n * @param options.sort - Sort by 'value' or 'latest'.\n * @param options.limit - Number of results per page.\n * @param options.page - Page number (1-based).\n * @returns The positions response.\n */\n async fetchOpenPositions(\n options: FetchPositionsOptions,\n ): Promise<PositionsResponse> {\n return this.#fetchPositions('open', options);\n }\n\n /**\n * Fetches a trader's closed positions.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/positions/closed`.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.chain - Filter by chain.\n * @param options.sort - Sort by 'value' or 'latest'.\n * @param options.limit - Number of results per page.\n * @param options.page - Page number (1-based).\n * @returns The positions response.\n */\n async fetchClosedPositions(\n options: FetchPositionsOptions,\n ): Promise<PositionsResponse> {\n return this.#fetchPositions('closed', options);\n }\n\n /**\n * Fetches a trader's MetaMask followers.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/followers`. Pass\n * `mutuals: true` to append `?mutuals=true` (profiles that follow both this\n * trader and the authenticated user; `count` is the mutual total). Requires a\n * bearer token; the trader is identified by `addressOrId`, not the JWT\n * subject (see {@link fetchMyFollowers} for the current user's inbound list).\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.mutuals - When true, request mutual followers only.\n * @returns The followers response.\n */\n async fetchFollowers(\n options: FetchFollowersOptions,\n ): Promise<FollowersResponse> {\n const { addressOrId, mutuals } = options;\n const mutualsOnly = mutuals === true;\n\n const followersResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchFollowers`, addressOrId, mutualsOnly],\n staleTime: 0,\n queryFn: async () => {\n const url = new URL(\n `${this.#v1Url}/traders/${encodeURIComponent(addressOrId)}/followers`,\n );\n if (mutualsOnly) {\n url.searchParams.append('mutuals', 'true');\n }\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_FOLLOWERS_FAILED,\n );\n const followersData = (await response.json()) as unknown;\n if (!is(followersData, FollowersResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_FOLLOWERS_INVALID_RESPONSE,\n );\n }\n return followersData;\n },\n });\n\n return followersResponse;\n }\n\n /**\n * Fetches the list of traders a profile follows.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/following`. Requires a bearer\n * token; the trader is identified by `addressOrId`, not the JWT subject (see\n * {@link fetchFollowing} for the current user's outbound list).\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @returns The following response.\n */\n async fetchTraderFollowing(\n options: FetchTraderFollowingOptions,\n ): Promise<FollowingResponse> {\n const { addressOrId } = options;\n\n const followingResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchTraderFollowing`, addressOrId],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/traders/${encodeURIComponent(addressOrId)}/following`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_TRADER_FOLLOWING_FAILED,\n );\n const followingData = (await response.json()) as unknown;\n if (!is(followingData, FollowingResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_TRADER_FOLLOWING_INVALID_RESPONSE,\n );\n }\n return followingData;\n },\n });\n\n return followingResponse;\n }\n\n /**\n * Fetches a single position by its unique ID.\n *\n * Calls `GET ${baseUrl}/traders/position/${positionId}`.\n *\n * @param options - Options bag.\n * @param options.positionId - Unique position ID (UUID).\n * @returns The position.\n */\n async fetchPositionById(\n options: FetchPositionByIdOptions,\n ): Promise<Position> {\n const { positionId } = options;\n\n const positionResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchPositionById`, positionId],\n queryFn: async () => {\n const url = `${this.#v1Url}/traders/position/${encodeURIComponent(positionId)}`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_POSITION_BY_ID_FAILED,\n );\n const positionData = (await response.json()) as unknown;\n if (!is(positionData, PositionStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_POSITION_BY_ID_INVALID_RESPONSE,\n );\n }\n return positionData;\n },\n });\n\n return positionResponse;\n }\n\n /**\n * Fetches a page of the trader-activity feed.\n *\n * Calls `GET ${baseUrl}/feed`. For the `following` scope the current user is\n * identified server-side from the JWT sub claim carried in the Authorization\n * header; the `leaderboard` scope is generic and shared by all users.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.scope - `following` (default) or `leaderboard`.\n * @param options.chains - Filter by one or more chains.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\n async fetchFeed(options?: FetchFeedOptions): Promise<FeedResponse> {\n const feedResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchFeed`, options ?? null],\n staleTime: 0,\n queryFn: async () => {\n const { scope, chains, limit, olderThan, newerThan } = options ?? {};\n const url = new URL(`${this.#v1Url}/feed`);\n if (scope) {\n url.searchParams.append('scope', scope);\n }\n if (chains) {\n for (const chain of chains) {\n url.searchParams.append('chains', chain);\n }\n }\n if (limit !== undefined) {\n url.searchParams.append('limit', String(limit));\n }\n if (olderThan) {\n url.searchParams.append('olderThan', olderThan);\n }\n if (newerThan) {\n url.searchParams.append('newerThan', newerThan);\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_FEED_FAILED,\n );\n const feedData = (await response.json()) as unknown;\n return parseFeedResponse(\n feedData,\n SocialServiceErrorMessage.FETCH_FEED_INVALID_RESPONSE,\n );\n },\n });\n\n return feedResponse;\n }\n\n /**\n * Fetches a page of one trader's activity as feed items.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/feed`. Unlike {@link fetchFeed},\n * this is scoped to a single profile (open and closed positions in the feed)\n * and does not accept `scope` or `chains`. Set `commentedOnly` to only return\n * positions that carry an author comment.\n *\n * The route is public, but the Authorization header is still sent so the\n * social-api can hydrate `authorComment.engagement.userReaction` for the\n * signed-in viewer.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.commentedOnly - When true, only positions with a comment.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\n async fetchTraderFeed(\n options: FetchTraderFeedOptions,\n ): Promise<FeedResponse> {\n const traderFeedResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchTraderFeed`, options],\n staleTime: 0,\n queryFn: async () => {\n const { addressOrId, commentedOnly, limit, olderThan, newerThan } =\n options;\n const url = new URL(\n `${this.#v1Url}/traders/${encodeURIComponent(addressOrId)}/feed`,\n );\n if (commentedOnly === true) {\n url.searchParams.append('commentedOnly', 'true');\n }\n if (limit !== undefined) {\n url.searchParams.append('limit', String(limit));\n }\n if (olderThan) {\n url.searchParams.append('olderThan', olderThan);\n }\n if (newerThan) {\n url.searchParams.append('newerThan', newerThan);\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_TRADER_FEED_FAILED,\n );\n const feedData = (await response.json()) as unknown;\n return parseFeedResponse(\n feedData,\n SocialServiceErrorMessage.FETCH_TRADER_FEED_INVALID_RESPONSE,\n );\n },\n });\n\n return traderFeedResponse;\n }\n\n /**\n * Fetches a page of positions in one token, most recently traded first.\n *\n * Calls `GET ${baseUrl}/tokens/${chain}/${contractAddress}/feed`. Unlike\n * {@link fetchFeed}, this is scoped to a single token and does not accept\n * `scope` or `chains`. Omit `status` to include both open and recently\n * closed positions.\n *\n * The route is public, but the Authorization header is still sent so the\n * social-api can hydrate `authorComment.engagement.userReaction` for the\n * signed-in viewer.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.chain - Chain name where the token is deployed (`TokenFeedChain`).\n * @param options.contractAddress - Token contract address.\n * @param options.status - `open`, `closed`, or omit for both.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\n async fetchTokenFeed(options: FetchTokenFeedOptions): Promise<FeedResponse> {\n const tokenFeedResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchTokenFeed`, options],\n staleTime: 0,\n queryFn: async () => {\n const { chain, contractAddress, status, limit, olderThan, newerThan } =\n options;\n const url = new URL(\n `${this.#v1Url}/tokens/${encodeURIComponent(chain)}/${encodeURIComponent(contractAddress)}/feed`,\n );\n if (status) {\n url.searchParams.append('status', status);\n }\n if (limit !== undefined) {\n url.searchParams.append('limit', String(limit));\n }\n if (olderThan) {\n url.searchParams.append('olderThan', olderThan);\n }\n if (newerThan) {\n url.searchParams.append('newerThan', newerThan);\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_TOKEN_FEED_FAILED,\n );\n const feedData = (await response.json()) as unknown;\n return parseFeedResponse(\n feedData,\n SocialServiceErrorMessage.FETCH_TOKEN_FEED_INVALID_RESPONSE,\n );\n },\n });\n\n return tokenFeedResponse;\n }\n\n /**\n * Adds or replaces the current user's reaction on a swap comment (Call).\n *\n * Calls `PUT ${baseUrl}/swap-comment/${commentId}/reaction`. One emotion per\n * user per comment: a later PUT replaces the previous emotion.\n *\n * @param options - Options bag.\n * @param options.commentId - `authorComment.uid` from a feed item.\n * @param options.emotion - Emoji or short code to store.\n * @returns Refreshed per-emotion counts and the caller's `userReaction`.\n */\n async reactToComment(\n options: ReactToCommentOptions,\n ): Promise<CommentEngagement> {\n const { commentId, emotion } = options;\n\n return await this.fetchQuery({\n queryKey: [`${this.name}:reactToComment`, commentId, emotion],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/swap-comment/${encodeURIComponent(commentId)}/reaction`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'PUT',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify({ emotion }),\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.REACT_TO_COMMENT_FAILED,\n );\n const metrics = (await response.json()) as unknown;\n if (!is(metrics, CommentEngagementStruct)) {\n throw new Error(\n SocialServiceErrorMessage.REACT_TO_COMMENT_INVALID_RESPONSE,\n );\n }\n return metrics;\n },\n });\n }\n\n /**\n * Removes the current user's reaction on a swap comment (Call).\n *\n * Calls `DELETE ${baseUrl}/swap-comment/${commentId}/reaction`. Idempotent\n * when the caller has never reacted.\n *\n * @param options - Options bag.\n * @param options.commentId - `authorComment.uid` from a feed item.\n * @returns Refreshed per-emotion counts and a null `userReaction`.\n */\n async removeCommentReaction(\n options: RemoveCommentReactionOptions,\n ): Promise<CommentEngagement> {\n const { commentId } = options;\n\n return await this.fetchQuery({\n queryKey: [`${this.name}:removeCommentReaction`, commentId],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/swap-comment/${encodeURIComponent(commentId)}/reaction`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'DELETE',\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.REMOVE_COMMENT_REACTION_FAILED,\n );\n const metrics = (await response.json()) as unknown;\n if (!is(metrics, CommentEngagementStruct)) {\n throw new Error(\n SocialServiceErrorMessage.REMOVE_COMMENT_REACTION_INVALID_RESPONSE,\n );\n }\n return metrics;\n },\n });\n }\n\n /**\n * Creates an author Call (user post) on one of the current user's swaps.\n *\n * Calls `POST ${baseUrl}/swap-comments`. Identify the swap with\n * `positionUid` (the `positionId` of a feed item or position) or, for a\n * trade too recent to be indexed, `tradeInFlight`. Provide exactly one of\n * those two fields.\n *\n * @param options - Options bag.\n * @param options.commentText - Message body of the post. May include a\n * `https://static.klipy.com/...gif` file URL; social-api rejects other links.\n * @param options.source - Free-form origin label stored on the comment.\n * @param options.positionUid - Position UUID (`positionId` / feed item id).\n * @param options.tradeInFlight - Hash, chain, and token of a swap in flight.\n * @returns The created swap comment.\n */\n async createSwapComment(\n options: CreateSwapCommentOptions,\n ): Promise<SwapCommentResponse> {\n const { commentText, source, positionUid, tradeInFlight } = options;\n\n return await this.fetchQuery({\n queryKey: [\n `${this.name}:createSwapComment`,\n {\n commentText,\n source: source ?? null,\n positionUid: positionUid ?? null,\n tradeInFlight: tradeInFlight ?? null,\n },\n ],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/swap-comments`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'POST',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify({\n commentText,\n ...(source === undefined ? {} : { source }),\n ...(positionUid === undefined ? {} : { positionUid }),\n ...(tradeInFlight === undefined ? {} : { tradeInFlight }),\n }),\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.CREATE_SWAP_COMMENT_FAILED,\n );\n const comment = (await response.json()) as unknown;\n if (!is(comment, SwapCommentResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.CREATE_SWAP_COMMENT_INVALID_RESPONSE,\n );\n }\n return comment;\n },\n });\n }\n\n /**\n * Records that the current user is copying a trade from a social post, so\n * the copy can be detected and attributed to the post's author.\n *\n * Calls `POST ${baseUrl}/copy-trade-intents`. Send swaps before submission\n * with the Bridge quote id, and perps right after submission with the\n * returned order id. The endpoint is idempotent per profile, origin, and\n * execution id: it answers 201 for a new intent and 200 with the existing\n * one on a retry.\n *\n * @param options - Options bag.\n * @param options.origin - Comment the trade was copied from.\n * @param options.copierAccount - CAIP-10 account placing the trade.\n * @param options.execution - Swap quote id or perps order id.\n * @returns The created or existing copy-trade intent.\n */\n async createCopyTradeIntent(\n options: CreateCopyTradeIntentOptions,\n ): Promise<CopyTradeIntentResponse> {\n const { origin, copierAccount, execution } = options;\n\n return await this.fetchQuery({\n queryKey: [\n `${this.name}:createCopyTradeIntent`,\n { origin, copierAccount, execution },\n ],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/copy-trade-intents`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'POST',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify({ origin, copierAccount, execution }),\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.CREATE_COPY_TRADE_INTENT_FAILED,\n );\n const intent = (await response.json()) as unknown;\n if (!is(intent, CopyTradeIntentResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.CREATE_COPY_TRADE_INTENT_INVALID_RESPONSE,\n );\n }\n return intent;\n },\n });\n }\n\n /**\n * Fetches the list of traders the current user is following.\n *\n * Calls `GET ${baseUrl}/users/me/following`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * Prefer {@link fetchMyFollowing} in new code (pairs with\n * {@link fetchMyFollowers}). This method is unchanged and remains the\n * `/users/me/following` read.\n *\n * @returns The following response.\n */\n async fetchFollowing(): Promise<FollowingResponse> {\n const followingResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchFollowing`],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/users/me/following`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_FOLLOWING_FAILED,\n );\n const followingData = (await response.json()) as unknown;\n if (!is(followingData, FollowingResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_FOLLOWING_INVALID_RESPONSE,\n );\n }\n return followingData;\n },\n });\n\n return followingResponse;\n }\n\n /**\n * Fetches the list of traders the current user is following.\n *\n * Alias of {@link fetchFollowing}. Calls `GET ${baseUrl}/users/me/following`.\n * Preferred name in new code so `/users/me` reads are both `fetchMy*`.\n *\n * @returns The following response.\n */\n async fetchMyFollowing(): Promise<FollowingResponse> {\n return this.fetchFollowing();\n }\n\n /**\n * Fetches the list of traders following the current user.\n *\n * Calls `GET ${baseUrl}/users/me/followers`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @returns The followers response.\n */\n async fetchMyFollowers(): Promise<FollowersResponse> {\n const followersResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchMyFollowers`],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/users/me/followers`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_MY_FOLLOWERS_FAILED,\n );\n const followersData = (await response.json()) as unknown;\n if (!is(followersData, FollowersResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_MY_FOLLOWERS_INVALID_RESPONSE,\n );\n }\n return followersData;\n },\n });\n\n return followersResponse;\n }\n\n /**\n * Follows one or more traders on behalf of the current user.\n *\n * Calls `PUT ${baseUrl}/users/me/follows`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.targets - Array of wallet addresses or profile IDs to follow.\n * @returns The follow response with confirmed follows.\n */\n async follow(options: FollowOptions): Promise<FollowResponse> {\n const { targets } = options;\n\n const followResponse = await this.fetchQuery({\n queryKey: [`${this.name}:follow`, targets],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/users/me/follows`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'PUT',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify({ targets }),\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FOLLOW_FAILED,\n );\n const followData = (await response.json()) as unknown;\n if (!is(followData, FollowResponseStruct)) {\n throw new Error(SocialServiceErrorMessage.FOLLOW_INVALID_RESPONSE);\n }\n return followData;\n },\n });\n\n return followResponse;\n }\n\n /**\n * Unfollows one or more traders on behalf of the current user.\n *\n * Calls `DELETE ${baseUrl}/users/me/follows?targets=...`. Targets are sent\n * as query params because Fastify does not parse request bodies on DELETE\n * requests per RFC 9110. The caller is identified server-side from the JWT\n * sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.targets - Array of wallet addresses or profile IDs to unfollow.\n * @returns The unfollow response with confirmed unfollows.\n */\n async unfollow(options: UnfollowOptions): Promise<UnfollowResponse> {\n const { targets } = options;\n\n const unfollowResponse = await this.fetchQuery({\n queryKey: [`${this.name}:unfollow`, targets],\n staleTime: 0,\n queryFn: async () => {\n const url = new URL(`${this.#v1Url}/users/me/follows`);\n for (const target of targets) {\n url.searchParams.append('targets', target);\n }\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n method: 'DELETE',\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.UNFOLLOW_FAILED,\n );\n const unfollowData = (await response.json()) as unknown;\n if (!is(unfollowData, UnfollowResponseStruct)) {\n throw new Error(SocialServiceErrorMessage.UNFOLLOW_INVALID_RESPONSE);\n }\n return unfollowData;\n },\n });\n\n return unfollowResponse;\n }\n\n /**\n * Opts the current user out of the PnL leaderboard.\n */\n async optOutOfLeaderboard(): Promise<void> {\n await this.fetchQuery({\n queryKey: [`${this.name}:optOutOfLeaderboard`],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/leaderboard/opt-out`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'POST',\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.LEADERBOARD_OPT_OUT_FAILED,\n );\n return null;\n },\n });\n }\n\n /**\n * Opts the current user back into the PnL leaderboard.\n */\n async optInToLeaderboard(): Promise<void> {\n await this.fetchQuery({\n queryKey: [`${this.name}:optInToLeaderboard`],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/leaderboard/opt-in`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'POST',\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.LEADERBOARD_OPT_IN_FAILED,\n );\n return null;\n },\n });\n }\n\n /**\n * Asks the social-api to refresh its cached copy of the current user's\n * notification preferences.\n *\n * Calls `POST ${baseUrl}/notifications/preferences/cache-refresh`. The caller\n * is identified server-side from the JWT sub claim carried in the\n * Authorization header, so it can only ever refresh its own entry.\n *\n * The client calls this immediately after writing a preference change to\n * Authenticated User Storage (AUS), which is the source of truth. The social\n * api re-reads from AUS and repopulates its cache so the change is honoured\n * near-instantly rather than after the cache TTL lapses. It is a pure\n * optimisation on top of that bounded TTL: the write has already succeeded by\n * the time this runs, so callers should treat it as best-effort and must not\n * roll back the AUS write if it fails.\n */\n async refreshNotificationPreferencesCache(): Promise<void> {\n await this.fetchQuery({\n queryKey: [`${this.name}:refreshNotificationPreferencesCache`],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/notifications/preferences/cache-refresh`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'POST',\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.NOTIFICATION_PREFERENCES_CACHE_REFRESH_FAILED,\n );\n return null;\n },\n });\n }\n\n /**\n * Blocks a trader, swap comment, or reply for the current user.\n *\n * Calls `PUT ${baseUrl}/moderation/block`. Provide exactly one of\n * `profileId`, `commentId`, or `replyId`. Blocking the same target again\n * replaces `reason` when one is given. The caller is identified server-side\n * from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag. Exactly one target, plus an optional reason.\n * @param options.profileId - Profile id (UUID) of the trader to block.\n * @param options.commentId - Swap comment to block.\n * @param options.replyId - Comment reply to block.\n * @param options.reason - Free-form reason stored on the block.\n */\n async block(options: BlockOptions): Promise<void> {\n await this.fetchQuery({\n queryKey: [`${this.name}:block`, options],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/moderation/block`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'PUT',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify(options),\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.BLOCK_FAILED,\n );\n return null;\n },\n });\n }\n\n /**\n * Fetches traders the current user has blocked.\n *\n * Calls `GET ${baseUrl}/moderation/blocks/profiles`. Results are most\n * recently blocked first, 250 per page. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.cursor - Cursor from the previous page. Omit for the first page.\n * @returns The blocked profiles page.\n */\n async fetchBlockedProfiles(\n options?: FetchBlockedListOptions,\n ): Promise<BlockedProfilesResponse> {\n const cursor = options?.cursor;\n\n return await this.fetchQuery({\n queryKey: [`${this.name}:fetchBlockedProfiles`, cursor ?? null],\n staleTime: 0,\n queryFn: async () => {\n const url = new URL(`${this.#v1Url}/moderation/blocks/profiles`);\n if (cursor) {\n url.searchParams.append('cursor', cursor);\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_BLOCKED_PROFILES_FAILED,\n );\n const blockedProfiles = (await response.json()) as unknown;\n if (!is(blockedProfiles, BlockedProfilesResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_BLOCKED_PROFILES_INVALID_RESPONSE,\n );\n }\n return blockedProfiles;\n },\n });\n }\n\n /**\n * Fetches comments and replies the current user has blocked.\n *\n * Calls `GET ${baseUrl}/moderation/blocks/content`. Results are most\n * recently blocked first, 250 per page. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.cursor - Cursor from the previous page. Omit for the first page.\n * @returns The blocked content page.\n */\n async fetchBlockedContent(\n options?: FetchBlockedListOptions,\n ): Promise<BlockedContentResponse> {\n const cursor = options?.cursor;\n\n return await this.fetchQuery({\n queryKey: [`${this.name}:fetchBlockedContent`, cursor ?? null],\n staleTime: 0,\n queryFn: async () => {\n const url = new URL(`${this.#v1Url}/moderation/blocks/content`);\n if (cursor) {\n url.searchParams.append('cursor', cursor);\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_BLOCKED_CONTENT_FAILED,\n );\n const blockedContent = (await response.json()) as unknown;\n if (!is(blockedContent, BlockedContentResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_BLOCKED_CONTENT_INVALID_RESPONSE,\n );\n }\n return blockedContent;\n },\n });\n }\n\n /**\n * Shared helper for fetching open/closed positions.\n *\n * @param status - \"open\" or \"closed\".\n * @param options - Options bag including addressOrId and query parameters.\n * @returns The positions response.\n */\n async #fetchPositions(\n status: 'open' | 'closed',\n options: FetchPositionsOptions,\n ): Promise<PositionsResponse> {\n const { addressOrId, chain, sort, limit, page } = options;\n\n const failedMessage =\n status === 'open'\n ? SocialServiceErrorMessage.FETCH_OPEN_POSITIONS_FAILED\n : SocialServiceErrorMessage.FETCH_CLOSED_POSITIONS_FAILED;\n const invalidMessage =\n status === 'open'\n ? SocialServiceErrorMessage.FETCH_OPEN_POSITIONS_INVALID_RESPONSE\n : SocialServiceErrorMessage.FETCH_CLOSED_POSITIONS_INVALID_RESPONSE;\n\n const positionsResponse = await this.fetchQuery({\n queryKey: [\n `${this.name}:fetch${status === 'open' ? 'Open' : 'Closed'}Positions`,\n addressOrId,\n chain ?? null,\n // sort is not used for open positions (v2 endpoint dropped it),\n // so exclude it from the key to avoid redundant cache entries\n status === 'closed' ? (sort ?? null) : null,\n limit ?? null,\n page ?? null,\n ],\n queryFn: async () => {\n const baseUrl = status === 'open' ? this.#v2Url : this.#v1Url;\n const url = new URL(\n `${baseUrl}/traders/${encodeURIComponent(addressOrId)}/positions/${status}`,\n );\n if (chain) {\n url.searchParams.append('chain', chain);\n }\n // sort is not supported on the v2 open-positions endpoint\n if (sort && status === 'closed') {\n url.searchParams.append('sort', sort);\n }\n if (limit !== undefined) {\n url.searchParams.append('limit', String(limit));\n }\n if (page !== undefined) {\n url.searchParams.append('page', String(page));\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(response, failedMessage);\n const positionsData = (await response.json()) as unknown;\n if (!is(positionsData, PositionsResponseStruct)) {\n throw new Error(invalidMessage);\n }\n return positionsData;\n },\n });\n\n return positionsResponse;\n }\n}\n"]}
1
+ {"version":3,"file":"SocialService.js","sourceRoot":"","sources":["../src/SocialService.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,KAAK,EACL,EAAE,EACF,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,IAAI,IAAI,UAAU,EAClB,KAAK,GACN,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAmC/E,OAAO,EAAE,mBAAmB,EAAE,W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} from '@metamask/base-data-service';\nimport { BaseDataService } from '@metamask/base-data-service';\nimport type { CreateServicePolicyOptions } from '@metamask/controller-utils';\nimport { HttpError } from '@metamask/controller-utils';\nimport type { Messenger } from '@metamask/messenger';\nimport type { AuthenticationController } from '@metamask/profile-sync-controller';\nimport {\n array,\n assign,\n boolean,\n enums,\n is,\n literal,\n nullable,\n number,\n optional,\n record,\n string,\n type as structType,\n union,\n} from '@metamask/superstruct';\n\nimport { serviceName, SocialServiceErrorMessage } from './social-constants.js';\nimport type {\n BlockedContentResponse,\n BlockedProfilesResponse,\n BlockOptions,\n CommentEngagement,\n CopyTradeIntentResponse,\n CreateCopyTradeIntentOptions,\n CreateSwapCommentOptions,\n FeedItem,\n FeedResponse,\n FetchBlockedListOptions,\n FetchFeedOptions,\n FetchFollowersOptions,\n FetchTraderFollowingOptions,\n FetchLeaderboardOptions,\n FetchPositionByIdOptions,\n FetchPositionsOptions,\n FetchTokenFeedOptions,\n FetchTraderFeedOptions,\n FetchTraderProfileOptions,\n FollowersResponse,\n FollowingResponse,\n FollowOptions,\n FollowResponse,\n LeaderboardResponse,\n Position,\n PositionsResponse,\n ReactToCommentOptions,\n RemoveCommentReactionOptions,\n SwapCommentResponse,\n TraderProfileResponse,\n UnfollowOptions,\n UnfollowResponse,\n} from './social-types.js';\nimport { TRADER_RANKING_TAGS, TradeStruct } from './social-types.js';\nimport type { SocialServiceMethodActions } from './SocialService-method-action-types.js';\n\n// ---------------------------------------------------------------------------\n// Superstruct validation schemas\n// ---------------------------------------------------------------------------\n\nconst SocialHandlesStruct = structType({\n twitter: optional(nullable(string())),\n farcaster: optional(nullable(string())),\n ens: optional(nullable(string())),\n lens: optional(nullable(string())),\n});\n\nconst ProfileSummaryStruct = structType({\n profileId: string(),\n address: string(),\n name: string(),\n imageUrl: optional(nullable(string())),\n});\n\nconst FeedActorStruct = assign(\n ProfileSummaryStruct,\n structType({\n winRate30d: optional(nullable(number())),\n pnl30d: optional(nullable(number())),\n tradeCount30d: optional(nullable(number())),\n followerCount: optional(nullable(number())),\n }),\n);\n\nconst PositionStruct = structType({\n positionId: string(),\n tokenSymbol: string(),\n tokenName: string(),\n tokenAddress: string(),\n chain: string(),\n positionAmount: number(),\n isOpen: optional(boolean()),\n // Incomplete Clicker metrics serialize these as `null` (`undefined + n`\n // becomes `NaN`, then JSON `null`). Rejecting the field used to fail the\n // entire feed page, so they are nullable here.\n boughtUsd: nullable(number()),\n soldUsd: nullable(number()),\n realizedPnl: nullable(number()),\n costBasis: nullable(number()),\n trades: array(TradeStruct),\n lastTradeAt: number(),\n tokenImageUrl: optional(nullable(string())),\n currentValueUSD: optional(nullable(number())),\n pnlValueUsd: optional(nullable(number())),\n pnlPercent: optional(nullable(number())),\n copyCount: optional(number()),\n perpPositionType: optional(nullable(enums(['long', 'short']))),\n perpLeverage: optional(nullable(number())),\n positionAmountWithLeverage: optional(nullable(number())),\n});\n\nconst PaginationStruct = structType({\n hasMore: boolean(),\n nextPage: optional(number()),\n});\n\nconst LeaderboardEntryStruct = structType({\n rank: number(),\n addresses: array(string()),\n profileId: string(),\n name: string(),\n imageUrl: optional(nullable(string())),\n pnl30d: number(),\n winRate30d: optional(nullable(number())),\n roiPercent30d: optional(nullable(number())),\n tradeCount30d: optional(nullable(number())),\n pnl7d: optional(nullable(number())),\n winRate7d: optional(nullable(number())),\n roiPercent7d: optional(nullable(number())),\n tradeCount7d: optional(nullable(number())),\n pnlPerChain: record(string(), number()),\n followerCount: number(),\n socialHandles: SocialHandlesStruct,\n});\n\nconst LeaderboardResponseStruct = structType({\n traders: array(LeaderboardEntryStruct),\n});\n\nconst TraderProfileStruct = structType({\n profileId: string(),\n address: string(),\n allAddresses: array(string()),\n name: string(),\n imageUrl: optional(nullable(string())),\n createdAt: optional(nullable(string())),\n});\n\nconst TraderStatsStruct = structType({\n pnl30d: optional(nullable(number())),\n winRate30d: optional(nullable(number())),\n roiPercent30d: optional(nullable(number())),\n tradeCount30d: optional(nullable(number())),\n volumeUsd30d: optional(nullable(number())),\n pnl7d: optional(nullable(number())),\n winRate7d: optional(nullable(number())),\n roiPercent7d: optional(nullable(number())),\n tradeCount7d: optional(nullable(number())),\n medianHoldMinutes: optional(nullable(number())),\n});\n\nconst PerChainBreakdownStruct = structType({\n perChainPnl: record(string(), number()),\n perChainRoi: record(string(), nullable(number())),\n perChainVolume: record(string(), number()),\n perChainPnl7d: optional(record(string(), number())),\n perChainRoi7d: optional(record(string(), nullable(number()))),\n perChainVolume7d: optional(record(string(), number())),\n});\n\nconst CopytradedAllTimeStruct = structType({\n count: number(),\n volumeUSD: number(),\n distinctActors: number(),\n});\n\nconst TraderProfileResponseStruct = structType({\n profile: TraderProfileStruct,\n stats: TraderStatsStruct,\n perChainBreakdown: PerChainBreakdownStruct,\n socialHandles: SocialHandlesStruct,\n followerCount: number(),\n followingCount: number(),\n copytradedAllTime: CopytradedAllTimeStruct,\n rankingTag: optional(nullable(enums(TRADER_RANKING_TAGS))),\n});\n\nconst PositionsResponseStruct = structType({\n positions: array(PositionStruct),\n pagination: PaginationStruct,\n computedAt: optional(nullable(string())),\n});\n\n// A feed item is a position plus the trader who made the trade (`actor`) and\n// the item's creation timestamp. Reuses PositionStruct so the trade/position\n// fields stay in lockstep with the positions endpoints.\nconst CommentReactionProfileStruct = structType({\n id: string(),\n name: string(),\n});\n\nconst CommentReactionStruct = structType({\n emotion: string(),\n count: number(),\n profiles: array(CommentReactionProfileStruct),\n});\n\nconst CommentEngagementStruct = structType({\n reactions: array(CommentReactionStruct),\n userReaction: nullable(string()),\n replyCount: optional(number()),\n});\n\nconst AuthorCommentStruct = structType({\n uid: string(),\n text: string(),\n timestamp: number(),\n engagement: CommentEngagementStruct,\n});\n\nconst SwapCommentAuthorStruct = structType({\n id: string(),\n name: string(),\n images: optional(\n structType({\n raw: nullable(string()),\n xs: nullable(string()),\n sm: nullable(string()),\n }),\n ),\n addresses: optional(array(string())),\n externalId: optional(string()),\n});\n\nconst SwapCommentResponseStruct = structType({\n uid: string(),\n transactionHash: string(),\n chain: string(),\n tokenAddress: string(),\n commentText: string(),\n author: SwapCommentAuthorStruct,\n timestamp: number(),\n isAppUserComment: boolean(),\n metrics: CommentEngagementStruct,\n});\n\nconst CopyTradeAccountStruct = structType({\n profileId: string(),\n caip10: string(),\n});\n\nconst CopyTradeIntentResponseStruct = structType({\n id: string(),\n origin: structType({\n kind: literal('comment'),\n id: string(),\n }),\n copierAccount: CopyTradeAccountStruct,\n sourceAccount: nullable(CopyTradeAccountStruct),\n execution: union([\n structType({ product: literal('swaps'), quoteId: string() }),\n structType({ product: literal('perps'), oid: string() }),\n ]),\n payoutEligibility: structType({\n status: enums(['payable', 'non_payable']),\n reason: string(),\n }),\n createdAt: string(),\n});\n\nconst FeedItemStruct = assign(\n PositionStruct,\n structType({\n actor: FeedActorStruct,\n timestamp: number(),\n authorComment: optional(nullable(AuthorCommentStruct)),\n commentCount: optional(number()),\n replyCount: optional(number()),\n copyCount: optional(number()),\n firstTradeAt: optional(nullable(number())),\n holdTimeMs: optional(nullable(number())),\n entryPriceUsd: optional(nullable(number())),\n eventId: optional(string()),\n revision: optional(number()),\n occurredAt: optional(string()),\n }),\n);\n\nconst FeedPaginationStruct = structType({\n olderCursor: nullable(string()),\n newerCursor: nullable(string()),\n});\n\nconst FeedResponseStruct = structType({\n items: array(FeedItemStruct),\n pagination: FeedPaginationStruct,\n});\n\n/**\n * One malformed feed item must not blank the page. When the envelope is\n * well-shaped, keep items that match {@link FeedItemStruct} and drop the rest.\n * Still throw when `items` or `pagination` themselves are unusable.\n *\n * @param feedData - Parsed JSON body from a feed endpoint.\n * @param invalidMessage - Error message to throw when the envelope is unusable.\n * @returns The validated feed response, possibly with invalid items dropped.\n */\nconst parseFeedResponse = (\n feedData: unknown,\n invalidMessage: string,\n): FeedResponse => {\n if (is(feedData, FeedResponseStruct)) {\n return feedData;\n }\n\n if (\n typeof feedData !== 'object' ||\n feedData === null ||\n !('items' in feedData) ||\n !('pagination' in feedData)\n ) {\n throw new Error(invalidMessage);\n }\n\n const { items, pagination } = feedData;\n\n if (!Array.isArray(items) || !is(pagination, FeedPaginationStruct)) {\n throw new Error(invalidMessage);\n }\n\n return {\n items: items.filter((item): item is FeedItem => is(item, FeedItemStruct)),\n pagination,\n };\n};\n\nconst FollowersResponseStruct = structType({\n followers: array(ProfileSummaryStruct),\n count: number(),\n});\n\nconst FollowingResponseStruct = structType({\n following: array(ProfileSummaryStruct),\n count: number(),\n});\n\nconst FollowResponseStruct = structType({\n followed: array(ProfileSummaryStruct),\n});\n\nconst UnfollowResponseStruct = structType({\n unfollowed: array(ProfileSummaryStruct),\n});\n\nconst BlockedProfileStruct = structType({\n blockedAt: number(),\n reason: nullable(string()),\n profile: ProfileSummaryStruct,\n});\n\nconst BlockedProfilesResponseStruct = structType({\n items: array(BlockedProfileStruct),\n cursor: nullable(string()),\n});\n\nconst BlockedContentStruct = structType({\n blockedAt: number(),\n reason: nullable(string()),\n type: enums(['comment', 'reply']),\n id: string(),\n text: string(),\n createdAt: number(),\n author: nullable(ProfileSummaryStruct),\n});\n\nconst BlockedContentResponseStruct = structType({\n items: array(BlockedContentStruct),\n cursor: nullable(string()),\n});\n\n// ---------------------------------------------------------------------------\n// Messenger types\n// ---------------------------------------------------------------------------\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'fetchLeaderboard',\n 'fetchTraderProfile',\n 'fetchOpenPositions',\n 'fetchClosedPositions',\n 'fetchFollowers',\n 'fetchTraderFollowing',\n 'fetchFollowing',\n 'fetchMyFollowing',\n 'fetchMyFollowers',\n 'fetchPositionById',\n 'fetchFeed',\n 'fetchTraderFeed',\n 'fetchTokenFeed',\n 'reactToComment',\n 'removeCommentReaction',\n 'createSwapComment',\n 'createCopyTradeIntent',\n 'follow',\n 'unfollow',\n 'optOutOfLeaderboard',\n 'optInToLeaderboard',\n 'refreshNotificationPreferencesCache',\n 'block',\n 'fetchBlockedProfiles',\n 'fetchBlockedContent',\n] as const;\n\nexport type SocialServiceActions =\n | SocialServiceMethodActions\n | DataServiceInvalidateQueriesAction<typeof serviceName>;\n\nexport type SocialServiceEvents =\n | DataServiceCacheUpdatedEvent<typeof serviceName>\n | DataServiceGranularCacheUpdatedEvent<typeof serviceName>;\n\ntype AllowedActions =\n AuthenticationController.AuthenticationControllerGetBearerTokenAction;\n\ntype AllowedEvents = never;\n\nexport type SocialServiceMessenger = Messenger<\n typeof serviceName,\n SocialServiceActions | AllowedActions,\n SocialServiceEvents | AllowedEvents\n>;\n\n// ---------------------------------------------------------------------------\n// Service\n// ---------------------------------------------------------------------------\n\n/**\n * Data service wrapping social-api endpoints.\n */\nexport class SocialService extends BaseDataService<\n typeof serviceName,\n SocialServiceMessenger\n> {\n readonly #baseUrl: string;\n\n get #v1Url(): string {\n return `${this.#baseUrl}/api/v1`;\n }\n\n get #v2Url(): string {\n return `${this.#baseUrl}/api/v2`;\n }\n\n constructor({\n messenger,\n baseUrl,\n policyOptions,\n }: {\n messenger: SocialServiceMessenger;\n baseUrl: string;\n policyOptions?: CreateServicePolicyOptions;\n }) {\n super({ name: serviceName, messenger, policyOptions });\n this.#baseUrl = baseUrl;\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Throws an HttpError if the response is not ok.\n *\n * @param response - The fetch response to check.\n * @param message - The error message prefix from SocialServiceErrorMessage.\n */\n static #throwIfNotOk(response: Response, message: string): void {\n if (!response.ok) {\n throw new HttpError(response.status, `${message}: ${response.status}`);\n }\n }\n\n /**\n * Returns an Authorization header with a JWT bearer token obtained from the\n * AuthenticationController.\n *\n * @returns A headers object containing the Authorization header.\n */\n async #getAuthHeaders(): Promise<Record<string, string>> {\n const token = await this.messenger.call(\n 'AuthenticationController:getBearerToken',\n );\n return { Authorization: `Bearer ${token}` };\n }\n\n /**\n * Fetches the leaderboard of top traders.\n *\n * Calls `GET ${baseUrl}/leaderboard`.\n *\n * @param options - Optional query parameters for sorting, chain filtering, and limit.\n * @returns The leaderboard response with ranked traders.\n */\n async fetchLeaderboard(\n options?: FetchLeaderboardOptions,\n ): Promise<LeaderboardResponse> {\n const leaderboardResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchLeaderboard`, options ?? null],\n queryFn: async () => {\n const { sort, chains, limit } = options ?? {};\n const url = new URL(`${this.#v1Url}/leaderboard`);\n if (sort) {\n url.searchParams.append('sort', sort);\n }\n if (chains) {\n for (const chain of chains) {\n url.searchParams.append('chains', chain);\n }\n }\n if (limit !== undefined) {\n url.searchParams.append('limit', String(limit));\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_LEADERBOARD_FAILED,\n );\n const leaderboardData = (await response.json()) as unknown;\n if (!is(leaderboardData, LeaderboardResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_LEADERBOARD_INVALID_RESPONSE,\n );\n }\n return leaderboardData;\n },\n });\n\n return leaderboardResponse;\n }\n\n /**\n * Fetches a trader's profile by address or profile ID.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/profile`.\n *\n * `profile.createdAt` is optional. When present it is an ISO-8601 timestamp\n * for when the social-api profile row was inserted.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @returns The trader profile response.\n */\n async fetchTraderProfile(\n options: FetchTraderProfileOptions,\n ): Promise<TraderProfileResponse> {\n const { addressOrId } = options;\n\n const traderProfileResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchTraderProfile`, addressOrId],\n queryFn: async () => {\n const url = `${this.#v1Url}/traders/${encodeURIComponent(addressOrId)}/profile`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_TRADER_PROFILE_FAILED,\n );\n const traderProfileData = (await response.json()) as unknown;\n if (!is(traderProfileData, TraderProfileResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_TRADER_PROFILE_INVALID_RESPONSE,\n );\n }\n return traderProfileData;\n },\n });\n\n return traderProfileResponse;\n }\n\n /**\n * Fetches a trader's open positions.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/positions/open`.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.chain - Filter by chain.\n * @param options.sort - Sort by 'value' or 'latest'.\n * @param options.limit - Number of results per page.\n * @param options.page - Page number (1-based).\n * @returns The positions response.\n */\n async fetchOpenPositions(\n options: FetchPositionsOptions,\n ): Promise<PositionsResponse> {\n return this.#fetchPositions('open', options);\n }\n\n /**\n * Fetches a trader's closed positions.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/positions/closed`.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.chain - Filter by chain.\n * @param options.sort - Sort by 'value' or 'latest'.\n * @param options.limit - Number of results per page.\n * @param options.page - Page number (1-based).\n * @returns The positions response.\n */\n async fetchClosedPositions(\n options: FetchPositionsOptions,\n ): Promise<PositionsResponse> {\n return this.#fetchPositions('closed', options);\n }\n\n /**\n * Fetches a trader's MetaMask followers.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/followers`. Pass\n * `mutuals: true` to append `?mutuals=true` (profiles that follow both this\n * trader and the authenticated user; `count` is the mutual total). Requires a\n * bearer token; the trader is identified by `addressOrId`, not the JWT\n * subject (see {@link fetchMyFollowers} for the current user's inbound list).\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.mutuals - When true, request mutual followers only.\n * @returns The followers response.\n */\n async fetchFollowers(\n options: FetchFollowersOptions,\n ): Promise<FollowersResponse> {\n const { addressOrId, mutuals } = options;\n const mutualsOnly = mutuals === true;\n\n const followersResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchFollowers`, addressOrId, mutualsOnly],\n staleTime: 0,\n queryFn: async () => {\n const url = new URL(\n `${this.#v1Url}/traders/${encodeURIComponent(addressOrId)}/followers`,\n );\n if (mutualsOnly) {\n url.searchParams.append('mutuals', 'true');\n }\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_FOLLOWERS_FAILED,\n );\n const followersData = (await response.json()) as unknown;\n if (!is(followersData, FollowersResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_FOLLOWERS_INVALID_RESPONSE,\n );\n }\n return followersData;\n },\n });\n\n return followersResponse;\n }\n\n /**\n * Fetches the list of traders a profile follows.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/following`. Requires a bearer\n * token; the trader is identified by `addressOrId`, not the JWT subject (see\n * {@link fetchFollowing} for the current user's outbound list).\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @returns The following response.\n */\n async fetchTraderFollowing(\n options: FetchTraderFollowingOptions,\n ): Promise<FollowingResponse> {\n const { addressOrId } = options;\n\n const followingResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchTraderFollowing`, addressOrId],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/traders/${encodeURIComponent(addressOrId)}/following`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_TRADER_FOLLOWING_FAILED,\n );\n const followingData = (await response.json()) as unknown;\n if (!is(followingData, FollowingResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_TRADER_FOLLOWING_INVALID_RESPONSE,\n );\n }\n return followingData;\n },\n });\n\n return followingResponse;\n }\n\n /**\n * Fetches a single position by its unique ID.\n *\n * Calls `GET ${baseUrl}/traders/position/${positionId}`.\n *\n * @param options - Options bag.\n * @param options.positionId - Unique position ID (UUID).\n * @returns The position.\n */\n async fetchPositionById(\n options: FetchPositionByIdOptions,\n ): Promise<Position> {\n const { positionId } = options;\n\n const positionResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchPositionById`, positionId],\n queryFn: async () => {\n const url = `${this.#v1Url}/traders/position/${encodeURIComponent(positionId)}`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_POSITION_BY_ID_FAILED,\n );\n const positionData = (await response.json()) as unknown;\n if (!is(positionData, PositionStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_POSITION_BY_ID_INVALID_RESPONSE,\n );\n }\n return positionData;\n },\n });\n\n return positionResponse;\n }\n\n /**\n * Fetches a page of the trader-activity feed.\n *\n * Calls `GET ${baseUrl}/feed`. For the `following` scope the current user is\n * identified server-side from the JWT sub claim carried in the Authorization\n * header; the `leaderboard` scope is generic and shared by all users.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.scope - `following` (default) or `leaderboard`.\n * @param options.chains - Filter by one or more chains.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\n async fetchFeed(options?: FetchFeedOptions): Promise<FeedResponse> {\n const feedResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchFeed`, options ?? null],\n staleTime: 0,\n queryFn: async () => {\n const { scope, chains, limit, olderThan, newerThan } = options ?? {};\n const url = new URL(`${this.#v1Url}/feed`);\n if (scope) {\n url.searchParams.append('scope', scope);\n }\n if (chains) {\n for (const chain of chains) {\n url.searchParams.append('chains', chain);\n }\n }\n if (limit !== undefined) {\n url.searchParams.append('limit', String(limit));\n }\n if (olderThan) {\n url.searchParams.append('olderThan', olderThan);\n }\n if (newerThan) {\n url.searchParams.append('newerThan', newerThan);\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_FEED_FAILED,\n );\n const feedData = (await response.json()) as unknown;\n return parseFeedResponse(\n feedData,\n SocialServiceErrorMessage.FETCH_FEED_INVALID_RESPONSE,\n );\n },\n });\n\n return feedResponse;\n }\n\n /**\n * Fetches a page of one trader's activity as feed items.\n *\n * Calls `GET ${baseUrl}/traders/${addressOrId}/feed`. Unlike {@link fetchFeed},\n * this is scoped to a single profile (open and closed positions in the feed)\n * and does not accept `scope` or `chains`. Set `commentedOnly` to only return\n * positions that carry an author comment.\n *\n * The route is public, but the Authorization header is still sent so the\n * social-api can hydrate `authorComment.engagement.userReaction` for the\n * signed-in viewer.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @param options.commentedOnly - When true, only positions with a comment.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\n async fetchTraderFeed(\n options: FetchTraderFeedOptions,\n ): Promise<FeedResponse> {\n const traderFeedResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchTraderFeed`, options],\n staleTime: 0,\n queryFn: async () => {\n const { addressOrId, commentedOnly, limit, olderThan, newerThan } =\n options;\n const url = new URL(\n `${this.#v1Url}/traders/${encodeURIComponent(addressOrId)}/feed`,\n );\n if (commentedOnly === true) {\n url.searchParams.append('commentedOnly', 'true');\n }\n if (limit !== undefined) {\n url.searchParams.append('limit', String(limit));\n }\n if (olderThan) {\n url.searchParams.append('olderThan', olderThan);\n }\n if (newerThan) {\n url.searchParams.append('newerThan', newerThan);\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_TRADER_FEED_FAILED,\n );\n const feedData = (await response.json()) as unknown;\n return parseFeedResponse(\n feedData,\n SocialServiceErrorMessage.FETCH_TRADER_FEED_INVALID_RESPONSE,\n );\n },\n });\n\n return traderFeedResponse;\n }\n\n /**\n * Fetches a page of positions in one token, most recently traded first.\n *\n * Calls `GET ${baseUrl}/tokens/${chain}/${contractAddress}/feed`. Unlike\n * {@link fetchFeed}, this is scoped to a single token and does not accept\n * `scope` or `chains`. Omit `status` to include both open and recently\n * closed positions.\n *\n * The route is public, but the Authorization header is still sent so the\n * social-api can hydrate `authorComment.engagement.userReaction` for the\n * signed-in viewer.\n *\n * Cursor pagination supports infinite scroll: pass `pagination.olderCursor`\n * from a prior response back as `olderThan` to load older items, and\n * `pagination.newerCursor` as `newerThan` to fetch newer items.\n *\n * @param options - Options bag.\n * @param options.chain - Chain name where the token is deployed (`TokenFeedChain`).\n * @param options.contractAddress - Token contract address.\n * @param options.status - `open`, `closed`, or omit for both.\n * @param options.limit - Number of results per page.\n * @param options.olderThan - Cursor for older items (scroll down).\n * @param options.newerThan - Cursor for newer items (refresh).\n * @returns The feed response with items and pagination cursors.\n */\n async fetchTokenFeed(options: FetchTokenFeedOptions): Promise<FeedResponse> {\n const tokenFeedResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchTokenFeed`, options],\n staleTime: 0,\n queryFn: async () => {\n const { chain, contractAddress, status, limit, olderThan, newerThan } =\n options;\n const url = new URL(\n `${this.#v1Url}/tokens/${encodeURIComponent(chain)}/${encodeURIComponent(contractAddress)}/feed`,\n );\n if (status) {\n url.searchParams.append('status', status);\n }\n if (limit !== undefined) {\n url.searchParams.append('limit', String(limit));\n }\n if (olderThan) {\n url.searchParams.append('olderThan', olderThan);\n }\n if (newerThan) {\n url.searchParams.append('newerThan', newerThan);\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_TOKEN_FEED_FAILED,\n );\n const feedData = (await response.json()) as unknown;\n return parseFeedResponse(\n feedData,\n SocialServiceErrorMessage.FETCH_TOKEN_FEED_INVALID_RESPONSE,\n );\n },\n });\n\n return tokenFeedResponse;\n }\n\n /**\n * Adds or replaces the current user's reaction on a swap comment (Call).\n *\n * Calls `PUT ${baseUrl}/swap-comment/${commentId}/reaction`. One emotion per\n * user per comment: a later PUT replaces the previous emotion.\n *\n * @param options - Options bag.\n * @param options.commentId - `authorComment.uid` from a feed item.\n * @param options.emotion - Emoji or short code to store.\n * @returns Refreshed per-emotion counts and the caller's `userReaction`.\n */\n async reactToComment(\n options: ReactToCommentOptions,\n ): Promise<CommentEngagement> {\n const { commentId, emotion } = options;\n\n return await this.fetchQuery({\n queryKey: [`${this.name}:reactToComment`, commentId, emotion],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/swap-comment/${encodeURIComponent(commentId)}/reaction`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'PUT',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify({ emotion }),\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.REACT_TO_COMMENT_FAILED,\n );\n const metrics = (await response.json()) as unknown;\n if (!is(metrics, CommentEngagementStruct)) {\n throw new Error(\n SocialServiceErrorMessage.REACT_TO_COMMENT_INVALID_RESPONSE,\n );\n }\n return metrics;\n },\n });\n }\n\n /**\n * Removes the current user's reaction on a swap comment (Call).\n *\n * Calls `DELETE ${baseUrl}/swap-comment/${commentId}/reaction`. Idempotent\n * when the caller has never reacted.\n *\n * @param options - Options bag.\n * @param options.commentId - `authorComment.uid` from a feed item.\n * @returns Refreshed per-emotion counts and a null `userReaction`.\n */\n async removeCommentReaction(\n options: RemoveCommentReactionOptions,\n ): Promise<CommentEngagement> {\n const { commentId } = options;\n\n return await this.fetchQuery({\n queryKey: [`${this.name}:removeCommentReaction`, commentId],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/swap-comment/${encodeURIComponent(commentId)}/reaction`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'DELETE',\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.REMOVE_COMMENT_REACTION_FAILED,\n );\n const metrics = (await response.json()) as unknown;\n if (!is(metrics, CommentEngagementStruct)) {\n throw new Error(\n SocialServiceErrorMessage.REMOVE_COMMENT_REACTION_INVALID_RESPONSE,\n );\n }\n return metrics;\n },\n });\n }\n\n /**\n * Creates an author Call (user post) on one of the current user's swaps.\n *\n * Calls `POST ${baseUrl}/swap-comments`. Identify the swap with\n * `positionUid` (the `positionId` of a feed item or position) or, for a\n * trade too recent to be indexed, `tradeInFlight`. Provide exactly one of\n * those two fields.\n *\n * @param options - Options bag.\n * @param options.commentText - Message body of the post. May include a\n * `https://static.klipy.com/...gif` file URL; social-api rejects other links.\n * @param options.source - Free-form origin label stored on the comment.\n * @param options.positionUid - Position UUID (`positionId` / feed item id).\n * @param options.tradeInFlight - Hash, chain, and token of a swap in flight.\n * @returns The created swap comment.\n */\n async createSwapComment(\n options: CreateSwapCommentOptions,\n ): Promise<SwapCommentResponse> {\n const { commentText, source, positionUid, tradeInFlight } = options;\n\n return await this.fetchQuery({\n queryKey: [\n `${this.name}:createSwapComment`,\n {\n commentText,\n source: source ?? null,\n positionUid: positionUid ?? null,\n tradeInFlight: tradeInFlight ?? null,\n },\n ],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/swap-comments`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'POST',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify({\n commentText,\n ...(source === undefined ? {} : { source }),\n ...(positionUid === undefined ? {} : { positionUid }),\n ...(tradeInFlight === undefined ? {} : { tradeInFlight }),\n }),\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.CREATE_SWAP_COMMENT_FAILED,\n );\n const comment = (await response.json()) as unknown;\n if (!is(comment, SwapCommentResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.CREATE_SWAP_COMMENT_INVALID_RESPONSE,\n );\n }\n return comment;\n },\n });\n }\n\n /**\n * Records that the current user is copying a trade from a social post, so\n * the copy can be detected and attributed to the post's author.\n *\n * Calls `POST ${baseUrl}/copy-trade-intents`. Send swaps before submission\n * with the Bridge quote id, and perps right after submission with the\n * returned order id. The endpoint is idempotent per profile, origin, and\n * execution id: it answers 201 for a new intent and 200 with the existing\n * one on a retry.\n *\n * @param options - Options bag.\n * @param options.origin - Comment the trade was copied from.\n * @param options.copierAccount - CAIP-10 account placing the trade.\n * @param options.execution - Swap quote id or perps order id.\n * @returns The created or existing copy-trade intent.\n */\n async createCopyTradeIntent(\n options: CreateCopyTradeIntentOptions,\n ): Promise<CopyTradeIntentResponse> {\n const { origin, copierAccount, execution } = options;\n\n return await this.fetchQuery({\n queryKey: [\n `${this.name}:createCopyTradeIntent`,\n { origin, copierAccount, execution },\n ],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/copy-trade-intents`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'POST',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify({ origin, copierAccount, execution }),\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.CREATE_COPY_TRADE_INTENT_FAILED,\n );\n const intent = (await response.json()) as unknown;\n if (!is(intent, CopyTradeIntentResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.CREATE_COPY_TRADE_INTENT_INVALID_RESPONSE,\n );\n }\n return intent;\n },\n });\n }\n\n /**\n * Fetches the list of traders the current user is following.\n *\n * Calls `GET ${baseUrl}/users/me/following`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * Prefer {@link fetchMyFollowing} in new code (pairs with\n * {@link fetchMyFollowers}). This method is unchanged and remains the\n * `/users/me/following` read.\n *\n * @returns The following response.\n */\n async fetchFollowing(): Promise<FollowingResponse> {\n const followingResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchFollowing`],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/users/me/following`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_FOLLOWING_FAILED,\n );\n const followingData = (await response.json()) as unknown;\n if (!is(followingData, FollowingResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_FOLLOWING_INVALID_RESPONSE,\n );\n }\n return followingData;\n },\n });\n\n return followingResponse;\n }\n\n /**\n * Fetches the list of traders the current user is following.\n *\n * Alias of {@link fetchFollowing}. Calls `GET ${baseUrl}/users/me/following`.\n * Preferred name in new code so `/users/me` reads are both `fetchMy*`.\n *\n * @returns The following response.\n */\n async fetchMyFollowing(): Promise<FollowingResponse> {\n return this.fetchFollowing();\n }\n\n /**\n * Fetches the list of traders following the current user.\n *\n * Calls `GET ${baseUrl}/users/me/followers`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @returns The followers response.\n */\n async fetchMyFollowers(): Promise<FollowersResponse> {\n const followersResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchMyFollowers`],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/users/me/followers`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_MY_FOLLOWERS_FAILED,\n );\n const followersData = (await response.json()) as unknown;\n if (!is(followersData, FollowersResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_MY_FOLLOWERS_INVALID_RESPONSE,\n );\n }\n return followersData;\n },\n });\n\n return followersResponse;\n }\n\n /**\n * Follows one or more traders on behalf of the current user.\n *\n * Calls `PUT ${baseUrl}/users/me/follows`. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.targets - Array of wallet addresses or profile IDs to follow.\n * @returns The follow response with confirmed follows.\n */\n async follow(options: FollowOptions): Promise<FollowResponse> {\n const { targets } = options;\n\n const followResponse = await this.fetchQuery({\n queryKey: [`${this.name}:follow`, targets],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/users/me/follows`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'PUT',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify({ targets }),\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FOLLOW_FAILED,\n );\n const followData = (await response.json()) as unknown;\n if (!is(followData, FollowResponseStruct)) {\n throw new Error(SocialServiceErrorMessage.FOLLOW_INVALID_RESPONSE);\n }\n return followData;\n },\n });\n\n return followResponse;\n }\n\n /**\n * Unfollows one or more traders on behalf of the current user.\n *\n * Calls `DELETE ${baseUrl}/users/me/follows?targets=...`. Targets are sent\n * as query params because Fastify does not parse request bodies on DELETE\n * requests per RFC 9110. The caller is identified server-side from the JWT\n * sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.targets - Array of wallet addresses or profile IDs to unfollow.\n * @returns The unfollow response with confirmed unfollows.\n */\n async unfollow(options: UnfollowOptions): Promise<UnfollowResponse> {\n const { targets } = options;\n\n const unfollowResponse = await this.fetchQuery({\n queryKey: [`${this.name}:unfollow`, targets],\n staleTime: 0,\n queryFn: async () => {\n const url = new URL(`${this.#v1Url}/users/me/follows`);\n for (const target of targets) {\n url.searchParams.append('targets', target);\n }\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n method: 'DELETE',\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.UNFOLLOW_FAILED,\n );\n const unfollowData = (await response.json()) as unknown;\n if (!is(unfollowData, UnfollowResponseStruct)) {\n throw new Error(SocialServiceErrorMessage.UNFOLLOW_INVALID_RESPONSE);\n }\n return unfollowData;\n },\n });\n\n return unfollowResponse;\n }\n\n /**\n * Opts the current user out of the PnL leaderboard.\n */\n async optOutOfLeaderboard(): Promise<void> {\n await this.fetchQuery({\n queryKey: [`${this.name}:optOutOfLeaderboard`],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/leaderboard/opt-out`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'POST',\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.LEADERBOARD_OPT_OUT_FAILED,\n );\n return null;\n },\n });\n }\n\n /**\n * Opts the current user back into the PnL leaderboard.\n */\n async optInToLeaderboard(): Promise<void> {\n await this.fetchQuery({\n queryKey: [`${this.name}:optInToLeaderboard`],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/leaderboard/opt-in`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'POST',\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.LEADERBOARD_OPT_IN_FAILED,\n );\n return null;\n },\n });\n }\n\n /**\n * Asks the social-api to refresh its cached copy of the current user's\n * notification preferences.\n *\n * Calls `POST ${baseUrl}/notifications/preferences/cache-refresh`. The caller\n * is identified server-side from the JWT sub claim carried in the\n * Authorization header, so it can only ever refresh its own entry.\n *\n * The client calls this immediately after writing a preference change to\n * Authenticated User Storage (AUS), which is the source of truth. The social\n * api re-reads from AUS and repopulates its cache so the change is honoured\n * near-instantly rather than after the cache TTL lapses. It is a pure\n * optimisation on top of that bounded TTL: the write has already succeeded by\n * the time this runs, so callers should treat it as best-effort and must not\n * roll back the AUS write if it fails.\n */\n async refreshNotificationPreferencesCache(): Promise<void> {\n await this.fetchQuery({\n queryKey: [`${this.name}:refreshNotificationPreferencesCache`],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/notifications/preferences/cache-refresh`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'POST',\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.NOTIFICATION_PREFERENCES_CACHE_REFRESH_FAILED,\n );\n return null;\n },\n });\n }\n\n /**\n * Blocks a trader, swap comment, or reply for the current user.\n *\n * Calls `PUT ${baseUrl}/moderation/block`. Provide exactly one of\n * `profileId`, `commentId`, or `replyId`. Blocking the same target again\n * replaces `reason` when one is given. The caller is identified server-side\n * from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag. Exactly one target, plus an optional reason.\n * @param options.profileId - Profile id (UUID) of the trader to block.\n * @param options.commentId - Swap comment to block.\n * @param options.replyId - Comment reply to block.\n * @param options.reason - Free-form reason stored on the block.\n */\n async block(options: BlockOptions): Promise<void> {\n await this.fetchQuery({\n queryKey: [`${this.name}:block`, options],\n staleTime: 0,\n queryFn: async () => {\n const url = `${this.#v1Url}/moderation/block`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, {\n method: 'PUT',\n headers: { ...authHeaders, 'Content-Type': 'application/json' },\n body: JSON.stringify(options),\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.BLOCK_FAILED,\n );\n return null;\n },\n });\n }\n\n /**\n * Fetches traders the current user has blocked.\n *\n * Calls `GET ${baseUrl}/moderation/blocks/profiles`. Results are most\n * recently blocked first, 250 per page. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.cursor - Cursor from the previous page. Omit for the first page.\n * @returns The blocked profiles page.\n */\n async fetchBlockedProfiles(\n options?: FetchBlockedListOptions,\n ): Promise<BlockedProfilesResponse> {\n const cursor = options?.cursor;\n\n return await this.fetchQuery({\n queryKey: [`${this.name}:fetchBlockedProfiles`, cursor ?? null],\n staleTime: 0,\n queryFn: async () => {\n const url = new URL(`${this.#v1Url}/moderation/blocks/profiles`);\n if (cursor) {\n url.searchParams.append('cursor', cursor);\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_BLOCKED_PROFILES_FAILED,\n );\n const blockedProfiles = (await response.json()) as unknown;\n if (!is(blockedProfiles, BlockedProfilesResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_BLOCKED_PROFILES_INVALID_RESPONSE,\n );\n }\n return blockedProfiles;\n },\n });\n }\n\n /**\n * Fetches comments and replies the current user has blocked.\n *\n * Calls `GET ${baseUrl}/moderation/blocks/content`. Results are most\n * recently blocked first, 250 per page. The caller is identified\n * server-side from the JWT sub claim carried in the Authorization header.\n *\n * @param options - Options bag.\n * @param options.cursor - Cursor from the previous page. Omit for the first page.\n * @returns The blocked content page.\n */\n async fetchBlockedContent(\n options?: FetchBlockedListOptions,\n ): Promise<BlockedContentResponse> {\n const cursor = options?.cursor;\n\n return await this.fetchQuery({\n queryKey: [`${this.name}:fetchBlockedContent`, cursor ?? null],\n staleTime: 0,\n queryFn: async () => {\n const url = new URL(`${this.#v1Url}/moderation/blocks/content`);\n if (cursor) {\n url.searchParams.append('cursor', cursor);\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_BLOCKED_CONTENT_FAILED,\n );\n const blockedContent = (await response.json()) as unknown;\n if (!is(blockedContent, BlockedContentResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_BLOCKED_CONTENT_INVALID_RESPONSE,\n );\n }\n return blockedContent;\n },\n });\n }\n\n /**\n * Shared helper for fetching open/closed positions.\n *\n * @param status - \"open\" or \"closed\".\n * @param options - Options bag including addressOrId and query parameters.\n * @returns The positions response.\n */\n async #fetchPositions(\n status: 'open' | 'closed',\n options: FetchPositionsOptions,\n ): Promise<PositionsResponse> {\n const { addressOrId, chain, sort, limit, page } = options;\n\n const failedMessage =\n status === 'open'\n ? SocialServiceErrorMessage.FETCH_OPEN_POSITIONS_FAILED\n : SocialServiceErrorMessage.FETCH_CLOSED_POSITIONS_FAILED;\n const invalidMessage =\n status === 'open'\n ? SocialServiceErrorMessage.FETCH_OPEN_POSITIONS_INVALID_RESPONSE\n : SocialServiceErrorMessage.FETCH_CLOSED_POSITIONS_INVALID_RESPONSE;\n\n const positionsResponse = await this.fetchQuery({\n queryKey: [\n `${this.name}:fetch${status === 'open' ? 'Open' : 'Closed'}Positions`,\n addressOrId,\n chain ?? null,\n // sort is not used for open positions (v2 endpoint dropped it),\n // so exclude it from the key to avoid redundant cache entries\n status === 'closed' ? (sort ?? null) : null,\n limit ?? null,\n page ?? null,\n ],\n queryFn: async () => {\n const baseUrl = status === 'open' ? this.#v2Url : this.#v1Url;\n const url = new URL(\n `${baseUrl}/traders/${encodeURIComponent(addressOrId)}/positions/${status}`,\n );\n if (chain) {\n url.searchParams.append('chain', chain);\n }\n // sort is not supported on the v2 open-positions endpoint\n if (sort && status === 'closed') {\n url.searchParams.append('sort', sort);\n }\n if (limit !== undefined) {\n url.searchParams.append('limit', String(limit));\n }\n if (page !== undefined) {\n url.searchParams.append('page', String(page));\n }\n\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url.toString(), {\n headers: authHeaders,\n });\n SocialService.#throwIfNotOk(response, failedMessage);\n const positionsData = (await response.json()) as unknown;\n if (!is(positionsData, PositionsResponseStruct)) {\n throw new Error(invalidMessage);\n }\n return positionsData;\n },\n });\n\n return positionsResponse;\n }\n}\n"]}
@@ -142,6 +142,12 @@ export type TraderProfile = {
142
142
  allAddresses: string[];
143
143
  name: string;
144
144
  imageUrl?: string | null;
145
+ /**
146
+ * When the social-api profile row was created, as an ISO-8601 timestamp.
147
+ * Omitted on older social-api builds. This is the row insert time, which can
148
+ * predate the trader claiming a username and avatar.
149
+ */
150
+ createdAt?: string | null;
145
151
  };
146
152
  export type TraderStats = {
147
153
  pnl30d?: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"social-types.d.ts","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;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;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG;IAC9C,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,sCAAsC;IACtC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,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;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpE,eAAO,MAAM,WAAW;;;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AC,CAAC;IAChC;;;OAGG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IACjE,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,8EAA8E;IAC9E,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,SAAS,EAAE,MAAM,EAAE;IACnB,eAAe,EAAE,MAAM,EAAE;CAC1B,CAAC,CAAC;AAuCH,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,qEAAqE;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAU,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 * Trader attached to a feed item. Extends {@link ProfileSummary} with the\n * profile stats the feed hydrator already loaded and used to drop.\n *\n * Every field is optional: a social-api that predates them omits the keys,\n * and `null` means the window has no data (distinct from \"not sent\").\n */\nexport type FeedActorSummary = ProfileSummary & {\n /** 30-day win rate as a 0–1 ratio. */\n winRate30d?: number | null;\n /** 30-day realized PnL in USD. */\n pnl30d?: number | null;\n /** 30-day sell count behind `winRate30d`. */\n tradeCount30d?: number | null;\n /** Profiles following this trader. */\n followerCount?: number | 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\n/**\n * Where a fill sits in its position's lifecycle.\n *\n * Deliberately asset-agnostic so the classification is computed once, upstream:\n * clients render `opened / added / reduced / closed` for perps and\n * `bought / bought more / sold some / sold all` for spot from the same value.\n *\n * Distinct from `intent`, which only says whether the fill grew or shrank the\n * position — `intent: 'exit'` covers both a partial trim and a full close.\n */\nexport type TradeAction = 'opened' | 'added' | 'reduced' | 'closed';\n\nexport const TradeStruct = structType({\n direction: enums(['buy', 'sell']),\n intent: enums(['enter', 'exit']),\n /**\n * Lifecycle stage of this fill. Absent on responses from a social-api that\n * predates the field, so treat it as a hint and keep a client-side fallback.\n */\n action: optional(enums(['opened', 'added', 'reduced', 'closed'])),\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 /** Token market cap in USD at trade time. `null` when Clicker has no mark. */\n marketCap: optional(nullable(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\n/** Values for `TraderProfileResponse.rankingTag` from social-api. */\nexport const TRADER_RANKING_TAGS = ['shrimp', 'dolphin', 'whale'] as const;\n\nexport type TraderRankingTag = (typeof TRADER_RANKING_TAGS)[number];\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 /** 30-day trading volume in USD. */\n volumeUsd30d?: 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 CopytradedAllTime = {\n count: number;\n volumeUSD: number;\n distinctActors: number;\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 * Linked copy-swap stats for this trader. Social-api always sends zeros\n * when there are none.\n */\n copytradedAllTime: CopytradedAllTime;\n /**\n * Backend-derived tier from the Auth primary account 30d PnL. Omitted on older\n * social-api builds; `null` when unclaimed or activity is insufficient.\n */\n rankingTag?: TraderRankingTag | null;\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 /**\n * Whether the position still carries exposure. Clicker's own verdict, which\n * beats a `positionAmount === 0` check: it survives precision dust and\n * distinguishes \"no position\" from \"a position of size ~0\". Absent on\n * responses from a social-api that predates the field.\n */\n isOpen?: boolean;\n /**\n * Total USD spent buying into the position. `null` when Clicker stats are\n * incomplete (the social-api used to JSON-serialize `NaN` as `null`).\n */\n boughtUsd: number | null;\n /** Total USD received from sells. `null` when stats are incomplete. */\n soldUsd: number | null;\n /** Realized profit or loss in USD. `null` when stats are incomplete. */\n realizedPnl: number | null;\n /**\n * USD cost basis of the remaining holdings. `null` when stats are incomplete.\n */\n costBasis: number | null;\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 /** Number of detected copy trades for this position. */\n copyCount?: number;\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// Feed\n// ---------------------------------------------------------------------------\n\n/**\n * One emotion's aggregated count on a Call (swap comment), plus an optional\n * facepile sample. `profiles` is always present on the wire and is often empty.\n */\nexport type CommentReaction = {\n emotion: string;\n count: number;\n profiles: CommentReactionProfile[];\n};\n\nexport type CommentReactionProfile = {\n id: string;\n name: string;\n};\n\n/**\n * Engagement on a Call. Counts live on `reactions`; do not read deprecated\n * `likeCount` / `isLikedByUser` even if the social-api still emits them as 0/false.\n */\nexport type CommentEngagement = {\n reactions: CommentReaction[];\n /** Viewer's own emotion, when the hydrator was given their profile. */\n userReaction: string | null;\n /** Reply count on the comment. Present on feed `authorComment`, not on write responses. */\n replyCount?: number;\n};\n\n/**\n * Position thesis for the feed big card. `null` when that intent phase has no Call.\n */\nexport type AuthorComment = {\n uid: string;\n text: string;\n /** Unix timestamp (seconds) when the comment was created. */\n timestamp: number;\n engagement: CommentEngagement;\n};\n\n/**\n * A single trader-activity feed item: a {@link Position} the trade belongs to,\n * plus the {@link FeedActorSummary} of the trader who made it (`actor`) and the\n * item's creation `timestamp` (Unix seconds).\n */\nexport type FeedItem = Position & {\n /** The trader who made this trade. */\n actor: FeedActorSummary;\n /** Unix timestamp (seconds) when the feed item was created. */\n timestamp: number;\n /**\n * Latest author Call in the current intent phase. Absent on older social-api\n * builds; `null` when that phase has no comment.\n */\n authorComment?: AuthorComment | null;\n /** Author comments on this position. Absent on older social-api builds. */\n commentCount?: number;\n /** Replies across those comments. Absent on older social-api builds. */\n replyCount?: number;\n /** Detected copies of this position. Absent on older social-api builds. */\n copyCount?: number;\n /**\n * Unix seconds of the position's first fill. Count from this to render a\n * live hold on a position that is still open, where {@link holdTimeMs} is\n * `null`. `null` when unknown. Absent on older social-api builds.\n */\n firstTradeAt?: number | null;\n /**\n * Final hold in milliseconds, first fill to last. Only set once the\n * position is closed; `null` while it is still running, because that span\n * grows every second — use {@link firstTradeAt} for those. Absent on older\n * social-api builds.\n */\n holdTimeMs?: number | null;\n /**\n * Average entry price in USD from remaining cost basis / remaining holding.\n * `null` when the position is flat. Absent on older social-api builds.\n */\n entryPriceUsd?: number | null;\n /** Stable event ID for the shared feed-all projection. */\n eventId?: string;\n /** Projection revision for the shared feed-all item. */\n revision?: number;\n /** ISO timestamp for the shared feed-all projection event. */\n occurredAt?: string;\n};\n\nexport type ReactToCommentOptions = {\n commentId: string;\n /** Emoji or short code (1–64 chars), e.g. `👍`. */\n emotion: string;\n};\n\nexport type RemoveCommentReactionOptions = {\n commentId: string;\n};\n\n/**\n * Identifies a swap that may not be indexed yet. Prefer {@link CreateSwapCommentOptions.positionUid}\n * when the client already has a feed or positions `positionId`.\n */\nexport type TradeInFlight = {\n transactionHash: string;\n chain: string;\n tokenAddress: string;\n};\n\n/**\n * Options for `POST /v1/swap-comments`. Provide exactly one of `positionUid`\n * or `tradeInFlight`; the social-api rejects a body that names both or neither.\n */\nexport type CreateSwapCommentOptions = {\n /**\n * Message body of the post. May include a `https://static.klipy.com/...gif`\n * file URL (the social-api allowlists that host); other links are rejected.\n */\n commentText: string;\n /** Free-form origin label stored on the comment. */\n source?: string;\n /**\n * Position UUID (`positionId` / feed `itemId`). The comment attaches to that\n * position's most recent trade, which must be the caller's own.\n */\n positionUid?: string;\n /** Swap made seconds ago that may not have a position yet. */\n tradeInFlight?: TradeInFlight;\n};\n\n/**\n * Author profile on a swap-comment write response. Matches social-api\n * `ProfileResponseV1`; extra fields from newer builds are allowed.\n */\nexport type SwapCommentAuthor = {\n id: string;\n name: string;\n images?: {\n raw: string | null;\n xs: string | null;\n sm: string | null;\n };\n addresses?: string[];\n externalId?: string;\n};\n\n/**\n * Response from `POST /v1/swap-comments`.\n */\nexport type SwapCommentResponse = {\n uid: string;\n transactionHash: string;\n chain: string;\n tokenAddress: string;\n commentText: string;\n author: SwapCommentAuthor;\n timestamp: number;\n isAppUserComment: boolean;\n metrics: CommentEngagement;\n};\n\n// ---------------------------------------------------------------------------\n// Copy-trade intents\n// ---------------------------------------------------------------------------\n\n/**\n * Social resource a copy trade was started from. Only comments are supported.\n */\nexport type CopyTradeOrigin = {\n kind: 'comment';\n /** Comment UUID. */\n id: string;\n};\n\n/**\n * Trade being copied. Swaps are identified by their Bridge quote id, perps by\n * the Hyperliquid order id returned on submission.\n */\nexport type CopyTradeExecution =\n | { product: 'swaps'; quoteId: string }\n | { product: 'perps'; oid: string };\n\n/**\n * Options for `POST /v1/copy-trade-intents`.\n */\nexport type CreateCopyTradeIntentOptions = {\n origin: CopyTradeOrigin;\n copierAccount: {\n /**\n * CAIP-10 id of the account placing the trade. The social-api verifies it\n * belongs to the authenticated profile.\n */\n caip10: string;\n };\n execution: CopyTradeExecution;\n};\n\n/**\n * Account on a copy-trade intent response.\n */\nexport type CopyTradeAccount = {\n profileId: string;\n caip10: string;\n};\n\n/**\n * Payout eligibility snapshotted when the intent is created. `reason` is one\n * of `comment_source`, `source_account_unavailable`, or `unknown_reason`;\n * newer social-api builds may add more.\n */\nexport type CopyTradePayoutEligibility = {\n status: 'payable' | 'non_payable';\n reason: string;\n};\n\n/**\n * Response from `POST /v1/copy-trade-intents`. The endpoint is idempotent, so\n * a retry returns the existing intent.\n */\nexport type CopyTradeIntentResponse = {\n id: string;\n origin: CopyTradeOrigin;\n copierAccount: CopyTradeAccount;\n sourceAccount: CopyTradeAccount | null;\n execution: CopyTradeExecution;\n payoutEligibility: CopyTradePayoutEligibility;\n /** ISO 8601 timestamp. */\n createdAt: string;\n};\n\n/**\n * Cursor pagination for the feed. Pass `olderCursor` back as `olderThan` to\n * load older items (infinite scroll), and `newerCursor` as `newerThan` to\n * fetch newer items. `null` when there are no items in that direction.\n */\nexport type FeedPagination = {\n olderCursor: string | null;\n newerCursor: string | null;\n};\n\n/**\n * Response from `GET /v1/feed`.\n */\nexport type FeedResponse = {\n items: FeedItem[];\n pagination: FeedPagination;\n};\n\n// ---------------------------------------------------------------------------\n// Followers\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/users/me/followers` and bearer-authenticated\n * `GET /v1/traders/:addressOrId/followers` (optionally `?mutuals=true`).\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` and bearer-authenticated\n * `GET /v1/traders/:addressOrId/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 * When true, requests `GET .../followers?mutuals=true` so `followers` are\n * profiles that follow both this trader and the authenticated user; `count` is\n * the mutual total. Omit or false returns the trader's full follower list.\n */\n mutuals?: boolean;\n};\n\nexport type FetchTraderFollowingOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchTraderFeedOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n /**\n * When true, return only positions that carry an author comment.\n * Omitted from the request when false or unset (API default is false).\n */\n commentedOnly?: boolean;\n /** Number of results to return. */\n limit?: number;\n /** Cursor for older items (infinite scroll). Use `pagination.olderCursor`. */\n olderThan?: string;\n /** Cursor for newer items (pull to refresh). Use `pagination.newerCursor`. */\n newerThan?: string;\n};\n\n/**\n * Position status filter for a token feed.\n * Omit to return both open and recently closed positions.\n */\nexport type TokenFeedStatus = 'open' | 'closed';\n\n/**\n * Chain name accepted by `GET /v1/tokens/:chain/:contractAddress/feed`.\n */\nexport type TokenFeedChain =\n | 'base'\n | 'bsc'\n | 'ethereum'\n | 'hyperliquid'\n | 'robinhood'\n | 'solana';\n\n/**\n * Options for `GET /v1/tokens/:chain/:contractAddress/feed`.\n */\nexport type FetchTokenFeedOptions = {\n /** Chain name where the token is deployed. */\n chain: TokenFeedChain;\n /** Token contract address. */\n contractAddress: string;\n /**\n * Only open or only closed positions. Omit for both. Closed positions are\n * limited to the API's recent lookback.\n */\n status?: TokenFeedStatus;\n /** Number of results to return (1–100). Server default is 25. */\n limit?: number;\n /** Cursor for older items (infinite scroll). Use `pagination.olderCursor`. */\n olderThan?: string;\n /** Cursor for newer items (pull to refresh). Use `pagination.newerCursor`. */\n newerThan?: string;\n};\n\nexport type FetchFeedOptions = {\n /**\n * Which feed to fetch: `following` (personalized to the current user,\n * identified server-side from the JWT), `leaderboard` (generic, shared by\n * all users), or `all` (the shared feed-all projection). Defaults to\n * `following` server-side when omitted.\n */\n scope?: FeedScope;\n /**\n * Filter by one or more chains, given as CAIP-2 chain ids (e.g.\n * `eip155:8453`). Omit for the server defaults.\n */\n chains?: string[];\n /** Number of results to return. */\n limit?: number;\n /** Cursor for older items (infinite scroll). Use `pagination.olderCursor`. */\n olderThan?: string;\n /** Cursor for newer items (pull to refresh). Use `pagination.newerCursor`. */\n newerThan?: string;\n};\n\nexport type FeedScope = 'following' | 'leaderboard' | 'all';\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// Moderation blocks\n// ---------------------------------------------------------------------------\n\n/**\n * Options for `PUT /v1/moderation/block`. Provide exactly one target. Blocking\n * the same target again replaces `reason` when one is given.\n */\nexport type BlockOptions =\n | {\n /** Profile id (UUID) of the trader to block. */\n profileId: string;\n /** Free-form reason stored on the block. Max 1000 characters. */\n reason?: string;\n }\n | {\n /** Swap comment (post) to block. */\n commentId: string;\n /** Free-form reason stored on the block. Max 1000 characters. */\n reason?: string;\n }\n | {\n /** Comment reply to block. */\n replyId: string;\n /** Free-form reason stored on the block. Max 1000 characters. */\n reason?: string;\n };\n\n/**\n * Options for the cursor-paginated moderation list endpoints. Omit `cursor`\n * for the first page.\n */\nexport type FetchBlockedListOptions = {\n /** The `cursor` from the previous page. */\n cursor?: string;\n};\n\n/**\n * A trader the current user has blocked.\n */\nexport type BlockedProfile = {\n /** When the block was placed, in Unix epoch seconds. */\n blockedAt: number;\n /** Reason given when the block was placed, if any. */\n reason: string | null;\n /** The blocked trader. */\n profile: ProfileSummary;\n};\n\n/**\n * Response from `GET /v1/moderation/blocks/profiles`.\n */\nexport type BlockedProfilesResponse = {\n /** Blocked traders, most recently blocked first. */\n items: BlockedProfile[];\n /** Pass as `cursor` for the next page. `null` on the last page. */\n cursor: string | null;\n};\n\n/**\n * Whether a blocked content row is a swap comment or a reply.\n */\nexport type BlockedContentType = 'comment' | 'reply';\n\n/**\n * A comment or reply the current user has blocked.\n */\nexport type BlockedContent = {\n /** When the block was placed, in Unix epoch seconds. */\n blockedAt: number;\n /** Reason given when the block was placed, if any. */\n reason: string | null;\n /** Whether `id` refers to a swap comment or a reply. */\n type: BlockedContentType;\n /** Comment or reply id (UUID). */\n id: string;\n /** Text of the blocked comment or reply. */\n text: string;\n /** When the content was posted, in Unix epoch seconds. */\n createdAt: number;\n /** Author of the content. `null` when the profile cannot be resolved. */\n author: ProfileSummary | null;\n};\n\n/**\n * Response from `GET /v1/moderation/blocks/content`.\n */\nexport type BlockedContentResponse = {\n /** Blocked comments and replies, most recently blocked first. */\n items: BlockedContent[];\n /** Pass as `cursor` for the next page. `null` on the last page. */\n cursor: string | null;\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.js","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAI,IAAI,UAAU,GACnB,MAAM,uBAAuB,CAAC;AA4D/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;;;OAGG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IACjE,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,8EAA8E;IAC9E,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,SAAS,EAAE,MAAM,EAAE;IACnB,eAAe,EAAE,MAAM,EAAE;CAC1B,CAAC,CAAC;AAuCH,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,qEAAqE;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAU,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 * Trader attached to a feed item. Extends {@link ProfileSummary} with the\n * profile stats the feed hydrator already loaded and used to drop.\n *\n * Every field is optional: a social-api that predates them omits the keys,\n * and `null` means the window has no data (distinct from \"not sent\").\n */\nexport type FeedActorSummary = ProfileSummary & {\n /** 30-day win rate as a 0–1 ratio. */\n winRate30d?: number | null;\n /** 30-day realized PnL in USD. */\n pnl30d?: number | null;\n /** 30-day sell count behind `winRate30d`. */\n tradeCount30d?: number | null;\n /** Profiles following this trader. */\n followerCount?: number | 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\n/**\n * Where a fill sits in its position's lifecycle.\n *\n * Deliberately asset-agnostic so the classification is computed once, upstream:\n * clients render `opened / added / reduced / closed` for perps and\n * `bought / bought more / sold some / sold all` for spot from the same value.\n *\n * Distinct from `intent`, which only says whether the fill grew or shrank the\n * position — `intent: 'exit'` covers both a partial trim and a full close.\n */\nexport type TradeAction = 'opened' | 'added' | 'reduced' | 'closed';\n\nexport const TradeStruct = structType({\n direction: enums(['buy', 'sell']),\n intent: enums(['enter', 'exit']),\n /**\n * Lifecycle stage of this fill. Absent on responses from a social-api that\n * predates the field, so treat it as a hint and keep a client-side fallback.\n */\n action: optional(enums(['opened', 'added', 'reduced', 'closed'])),\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 /** Token market cap in USD at trade time. `null` when Clicker has no mark. */\n marketCap: optional(nullable(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\n/** Values for `TraderProfileResponse.rankingTag` from social-api. */\nexport const TRADER_RANKING_TAGS = ['shrimp', 'dolphin', 'whale'] as const;\n\nexport type TraderRankingTag = (typeof TRADER_RANKING_TAGS)[number];\n\nexport type TraderProfile = {\n profileId: string;\n address: string;\n allAddresses: string[];\n name: string;\n imageUrl?: string | null;\n /**\n * When the social-api profile row was created, as an ISO-8601 timestamp.\n * Omitted on older social-api builds. This is the row insert time, which can\n * predate the trader claiming a username and avatar.\n */\n createdAt?: 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 /** 30-day trading volume in USD. */\n volumeUsd30d?: 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 CopytradedAllTime = {\n count: number;\n volumeUSD: number;\n distinctActors: number;\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 * Linked copy-swap stats for this trader. Social-api always sends zeros\n * when there are none.\n */\n copytradedAllTime: CopytradedAllTime;\n /**\n * Backend-derived tier from the Auth primary account 30d PnL. Omitted on older\n * social-api builds; `null` when unclaimed or activity is insufficient.\n */\n rankingTag?: TraderRankingTag | null;\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 /**\n * Whether the position still carries exposure. Clicker's own verdict, which\n * beats a `positionAmount === 0` check: it survives precision dust and\n * distinguishes \"no position\" from \"a position of size ~0\". Absent on\n * responses from a social-api that predates the field.\n */\n isOpen?: boolean;\n /**\n * Total USD spent buying into the position. `null` when Clicker stats are\n * incomplete (the social-api used to JSON-serialize `NaN` as `null`).\n */\n boughtUsd: number | null;\n /** Total USD received from sells. `null` when stats are incomplete. */\n soldUsd: number | null;\n /** Realized profit or loss in USD. `null` when stats are incomplete. */\n realizedPnl: number | null;\n /**\n * USD cost basis of the remaining holdings. `null` when stats are incomplete.\n */\n costBasis: number | null;\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 /** Number of detected copy trades for this position. */\n copyCount?: number;\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// Feed\n// ---------------------------------------------------------------------------\n\n/**\n * One emotion's aggregated count on a Call (swap comment), plus an optional\n * facepile sample. `profiles` is always present on the wire and is often empty.\n */\nexport type CommentReaction = {\n emotion: string;\n count: number;\n profiles: CommentReactionProfile[];\n};\n\nexport type CommentReactionProfile = {\n id: string;\n name: string;\n};\n\n/**\n * Engagement on a Call. Counts live on `reactions`; do not read deprecated\n * `likeCount` / `isLikedByUser` even if the social-api still emits them as 0/false.\n */\nexport type CommentEngagement = {\n reactions: CommentReaction[];\n /** Viewer's own emotion, when the hydrator was given their profile. */\n userReaction: string | null;\n /** Reply count on the comment. Present on feed `authorComment`, not on write responses. */\n replyCount?: number;\n};\n\n/**\n * Position thesis for the feed big card. `null` when that intent phase has no Call.\n */\nexport type AuthorComment = {\n uid: string;\n text: string;\n /** Unix timestamp (seconds) when the comment was created. */\n timestamp: number;\n engagement: CommentEngagement;\n};\n\n/**\n * A single trader-activity feed item: a {@link Position} the trade belongs to,\n * plus the {@link FeedActorSummary} of the trader who made it (`actor`) and the\n * item's creation `timestamp` (Unix seconds).\n */\nexport type FeedItem = Position & {\n /** The trader who made this trade. */\n actor: FeedActorSummary;\n /** Unix timestamp (seconds) when the feed item was created. */\n timestamp: number;\n /**\n * Latest author Call in the current intent phase. Absent on older social-api\n * builds; `null` when that phase has no comment.\n */\n authorComment?: AuthorComment | null;\n /** Author comments on this position. Absent on older social-api builds. */\n commentCount?: number;\n /** Replies across those comments. Absent on older social-api builds. */\n replyCount?: number;\n /** Detected copies of this position. Absent on older social-api builds. */\n copyCount?: number;\n /**\n * Unix seconds of the position's first fill. Count from this to render a\n * live hold on a position that is still open, where {@link holdTimeMs} is\n * `null`. `null` when unknown. Absent on older social-api builds.\n */\n firstTradeAt?: number | null;\n /**\n * Final hold in milliseconds, first fill to last. Only set once the\n * position is closed; `null` while it is still running, because that span\n * grows every second — use {@link firstTradeAt} for those. Absent on older\n * social-api builds.\n */\n holdTimeMs?: number | null;\n /**\n * Average entry price in USD from remaining cost basis / remaining holding.\n * `null` when the position is flat. Absent on older social-api builds.\n */\n entryPriceUsd?: number | null;\n /** Stable event ID for the shared feed-all projection. */\n eventId?: string;\n /** Projection revision for the shared feed-all item. */\n revision?: number;\n /** ISO timestamp for the shared feed-all projection event. */\n occurredAt?: string;\n};\n\nexport type ReactToCommentOptions = {\n commentId: string;\n /** Emoji or short code (1–64 chars), e.g. `👍`. */\n emotion: string;\n};\n\nexport type RemoveCommentReactionOptions = {\n commentId: string;\n};\n\n/**\n * Identifies a swap that may not be indexed yet. Prefer {@link CreateSwapCommentOptions.positionUid}\n * when the client already has a feed or positions `positionId`.\n */\nexport type TradeInFlight = {\n transactionHash: string;\n chain: string;\n tokenAddress: string;\n};\n\n/**\n * Options for `POST /v1/swap-comments`. Provide exactly one of `positionUid`\n * or `tradeInFlight`; the social-api rejects a body that names both or neither.\n */\nexport type CreateSwapCommentOptions = {\n /**\n * Message body of the post. May include a `https://static.klipy.com/...gif`\n * file URL (the social-api allowlists that host); other links are rejected.\n */\n commentText: string;\n /** Free-form origin label stored on the comment. */\n source?: string;\n /**\n * Position UUID (`positionId` / feed `itemId`). The comment attaches to that\n * position's most recent trade, which must be the caller's own.\n */\n positionUid?: string;\n /** Swap made seconds ago that may not have a position yet. */\n tradeInFlight?: TradeInFlight;\n};\n\n/**\n * Author profile on a swap-comment write response. Matches social-api\n * `ProfileResponseV1`; extra fields from newer builds are allowed.\n */\nexport type SwapCommentAuthor = {\n id: string;\n name: string;\n images?: {\n raw: string | null;\n xs: string | null;\n sm: string | null;\n };\n addresses?: string[];\n externalId?: string;\n};\n\n/**\n * Response from `POST /v1/swap-comments`.\n */\nexport type SwapCommentResponse = {\n uid: string;\n transactionHash: string;\n chain: string;\n tokenAddress: string;\n commentText: string;\n author: SwapCommentAuthor;\n timestamp: number;\n isAppUserComment: boolean;\n metrics: CommentEngagement;\n};\n\n// ---------------------------------------------------------------------------\n// Copy-trade intents\n// ---------------------------------------------------------------------------\n\n/**\n * Social resource a copy trade was started from. Only comments are supported.\n */\nexport type CopyTradeOrigin = {\n kind: 'comment';\n /** Comment UUID. */\n id: string;\n};\n\n/**\n * Trade being copied. Swaps are identified by their Bridge quote id, perps by\n * the Hyperliquid order id returned on submission.\n */\nexport type CopyTradeExecution =\n | { product: 'swaps'; quoteId: string }\n | { product: 'perps'; oid: string };\n\n/**\n * Options for `POST /v1/copy-trade-intents`.\n */\nexport type CreateCopyTradeIntentOptions = {\n origin: CopyTradeOrigin;\n copierAccount: {\n /**\n * CAIP-10 id of the account placing the trade. The social-api verifies it\n * belongs to the authenticated profile.\n */\n caip10: string;\n };\n execution: CopyTradeExecution;\n};\n\n/**\n * Account on a copy-trade intent response.\n */\nexport type CopyTradeAccount = {\n profileId: string;\n caip10: string;\n};\n\n/**\n * Payout eligibility snapshotted when the intent is created. `reason` is one\n * of `comment_source`, `source_account_unavailable`, or `unknown_reason`;\n * newer social-api builds may add more.\n */\nexport type CopyTradePayoutEligibility = {\n status: 'payable' | 'non_payable';\n reason: string;\n};\n\n/**\n * Response from `POST /v1/copy-trade-intents`. The endpoint is idempotent, so\n * a retry returns the existing intent.\n */\nexport type CopyTradeIntentResponse = {\n id: string;\n origin: CopyTradeOrigin;\n copierAccount: CopyTradeAccount;\n sourceAccount: CopyTradeAccount | null;\n execution: CopyTradeExecution;\n payoutEligibility: CopyTradePayoutEligibility;\n /** ISO 8601 timestamp. */\n createdAt: string;\n};\n\n/**\n * Cursor pagination for the feed. Pass `olderCursor` back as `olderThan` to\n * load older items (infinite scroll), and `newerCursor` as `newerThan` to\n * fetch newer items. `null` when there are no items in that direction.\n */\nexport type FeedPagination = {\n olderCursor: string | null;\n newerCursor: string | null;\n};\n\n/**\n * Response from `GET /v1/feed`.\n */\nexport type FeedResponse = {\n items: FeedItem[];\n pagination: FeedPagination;\n};\n\n// ---------------------------------------------------------------------------\n// Followers\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/users/me/followers` and bearer-authenticated\n * `GET /v1/traders/:addressOrId/followers` (optionally `?mutuals=true`).\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` and bearer-authenticated\n * `GET /v1/traders/:addressOrId/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 * When true, requests `GET .../followers?mutuals=true` so `followers` are\n * profiles that follow both this trader and the authenticated user; `count` is\n * the mutual total. Omit or false returns the trader's full follower list.\n */\n mutuals?: boolean;\n};\n\nexport type FetchTraderFollowingOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchTraderFeedOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n /**\n * When true, return only positions that carry an author comment.\n * Omitted from the request when false or unset (API default is false).\n */\n commentedOnly?: boolean;\n /** Number of results to return. */\n limit?: number;\n /** Cursor for older items (infinite scroll). Use `pagination.olderCursor`. */\n olderThan?: string;\n /** Cursor for newer items (pull to refresh). Use `pagination.newerCursor`. */\n newerThan?: string;\n};\n\n/**\n * Position status filter for a token feed.\n * Omit to return both open and recently closed positions.\n */\nexport type TokenFeedStatus = 'open' | 'closed';\n\n/**\n * Chain name accepted by `GET /v1/tokens/:chain/:contractAddress/feed`.\n */\nexport type TokenFeedChain =\n | 'base'\n | 'bsc'\n | 'ethereum'\n | 'hyperliquid'\n | 'robinhood'\n | 'solana';\n\n/**\n * Options for `GET /v1/tokens/:chain/:contractAddress/feed`.\n */\nexport type FetchTokenFeedOptions = {\n /** Chain name where the token is deployed. */\n chain: TokenFeedChain;\n /** Token contract address. */\n contractAddress: string;\n /**\n * Only open or only closed positions. Omit for both. Closed positions are\n * limited to the API's recent lookback.\n */\n status?: TokenFeedStatus;\n /** Number of results to return (1–100). Server default is 25. */\n limit?: number;\n /** Cursor for older items (infinite scroll). Use `pagination.olderCursor`. */\n olderThan?: string;\n /** Cursor for newer items (pull to refresh). Use `pagination.newerCursor`. */\n newerThan?: string;\n};\n\nexport type FetchFeedOptions = {\n /**\n * Which feed to fetch: `following` (personalized to the current user,\n * identified server-side from the JWT), `leaderboard` (generic, shared by\n * all users), or `all` (the shared feed-all projection). Defaults to\n * `following` server-side when omitted.\n */\n scope?: FeedScope;\n /**\n * Filter by one or more chains, given as CAIP-2 chain ids (e.g.\n * `eip155:8453`). Omit for the server defaults.\n */\n chains?: string[];\n /** Number of results to return. */\n limit?: number;\n /** Cursor for older items (infinite scroll). Use `pagination.olderCursor`. */\n olderThan?: string;\n /** Cursor for newer items (pull to refresh). Use `pagination.newerCursor`. */\n newerThan?: string;\n};\n\nexport type FeedScope = 'following' | 'leaderboard' | 'all';\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// Moderation blocks\n// ---------------------------------------------------------------------------\n\n/**\n * Options for `PUT /v1/moderation/block`. Provide exactly one target. Blocking\n * the same target again replaces `reason` when one is given.\n */\nexport type BlockOptions =\n | {\n /** Profile id (UUID) of the trader to block. */\n profileId: string;\n /** Free-form reason stored on the block. Max 1000 characters. */\n reason?: string;\n }\n | {\n /** Swap comment (post) to block. */\n commentId: string;\n /** Free-form reason stored on the block. Max 1000 characters. */\n reason?: string;\n }\n | {\n /** Comment reply to block. */\n replyId: string;\n /** Free-form reason stored on the block. Max 1000 characters. */\n reason?: string;\n };\n\n/**\n * Options for the cursor-paginated moderation list endpoints. Omit `cursor`\n * for the first page.\n */\nexport type FetchBlockedListOptions = {\n /** The `cursor` from the previous page. */\n cursor?: string;\n};\n\n/**\n * A trader the current user has blocked.\n */\nexport type BlockedProfile = {\n /** When the block was placed, in Unix epoch seconds. */\n blockedAt: number;\n /** Reason given when the block was placed, if any. */\n reason: string | null;\n /** The blocked trader. */\n profile: ProfileSummary;\n};\n\n/**\n * Response from `GET /v1/moderation/blocks/profiles`.\n */\nexport type BlockedProfilesResponse = {\n /** Blocked traders, most recently blocked first. */\n items: BlockedProfile[];\n /** Pass as `cursor` for the next page. `null` on the last page. */\n cursor: string | null;\n};\n\n/**\n * Whether a blocked content row is a swap comment or a reply.\n */\nexport type BlockedContentType = 'comment' | 'reply';\n\n/**\n * A comment or reply the current user has blocked.\n */\nexport type BlockedContent = {\n /** When the block was placed, in Unix epoch seconds. */\n blockedAt: number;\n /** Reason given when the block was placed, if any. */\n reason: string | null;\n /** Whether `id` refers to a swap comment or a reply. */\n type: BlockedContentType;\n /** Comment or reply id (UUID). */\n id: string;\n /** Text of the blocked comment or reply. */\n text: string;\n /** When the content was posted, in Unix epoch seconds. */\n createdAt: number;\n /** Author of the content. `null` when the profile cannot be resolved. */\n author: ProfileSummary | null;\n};\n\n/**\n * Response from `GET /v1/moderation/blocks/content`.\n */\nexport type BlockedContentResponse = {\n /** Blocked comments and replies, most recently blocked first. */\n items: BlockedContent[];\n /** Pass as `cursor` for the next page. `null` on the last page. */\n cursor: string | null;\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-previews/social-controllers",
3
- "version": "3.8.0-preview-5d0e7527f",
3
+ "version": "3.8.0-preview-c9f31ce",
4
4
  "description": "A collection of social related controllers",
5
5
  "keywords": [
6
6
  "Ethereum",