@metamask/social-controllers 3.6.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -1
- package/dist/SocialRealtimeService.d.ts +1 -1
- package/dist/SocialRealtimeService.d.ts.map +1 -1
- package/dist/SocialRealtimeService.js +13 -6
- package/dist/SocialRealtimeService.js.map +1 -1
- package/dist/SocialService-method-action-types.d.ts +50 -2
- package/dist/SocialService-method-action-types.d.ts.map +1 -1
- package/dist/SocialService-method-action-types.js.map +1 -1
- package/dist/SocialService.d.ts +41 -2
- package/dist/SocialService.d.ts.map +1 -1
- package/dist/SocialService.js +137 -33
- package/dist/SocialService.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/social-constants.d.ts +4 -0
- package/dist/social-constants.d.ts.map +1 -1
- package/dist/social-constants.js +4 -0
- package/dist/social-constants.js.map +1 -1
- package/dist/social-types.d.ts +27 -6
- package/dist/social-types.d.ts.map +1 -1
- package/dist/social-types.js.map +1 -1
- package/package.json +4 -4
|
@@ -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,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,IAAI,IAAI,UAAU,GACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AA+B/E,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrE,8EAA8E;AAC9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BACxB,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,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAC5C,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 nullable,\n number,\n optional,\n record,\n string,\n type as structType,\n} from '@metamask/superstruct';\n\nimport { serviceName, SocialServiceErrorMessage } from './social-constants.js';\nimport type {\n BlockedContentResponse,\n BlockedProfilesResponse,\n BlockOptions,\n CommentEngagement,\n CreateSwapCommentOptions,\n FeedResponse,\n FetchBlockedListOptions,\n FetchFeedOptions,\n FetchFollowersOptions,\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 boughtUsd: number(),\n soldUsd: number(),\n realizedPnl: number(),\n costBasis: 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 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 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 firstTradeAt: optional(nullable(number())),\n holdTimeMs: optional(nullable(number())),\n entryPriceUsd: optional(nullable(number())),\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\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 'fetchFollowing',\n 'fetchPositionById',\n 'fetchFeed',\n 'fetchTraderFeed',\n 'fetchTokenFeed',\n 'reactToComment',\n 'removeCommentReaction',\n 'createSwapComment',\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();\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();\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`.\n *\n * @param options - Options bag.\n * @param options.addressOrId - Wallet address or Clicker profile ID.\n * @returns The followers response.\n */\n async fetchFollowers(\n options: FetchFollowersOptions,\n ): Promise<FollowersResponse> {\n const { addressOrId } = options;\n\n const followersResponse = await this.fetchQuery({\n queryKey: [`${this.name}:fetchFollowers`, addressOrId],\n queryFn: async () => {\n const url = `${this.#v1Url}/traders/${encodeURIComponent(addressOrId)}/followers`;\n const authHeaders = await this.#getAuthHeaders();\n const response = await fetch(url, { headers: authHeaders });\n SocialService.#throwIfNotOk(\n response,\n SocialServiceErrorMessage.FETCH_FOLLOWERS_FAILED,\n );\n const followersData = await response.json();\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 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();\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();\n if (!is(feedData, FeedResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_FEED_INVALID_RESPONSE,\n );\n }\n return feedData;\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();\n if (!is(feedData, FeedResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_TRADER_FEED_INVALID_RESPONSE,\n );\n }\n return feedData;\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 if (!is(feedData, FeedResponseStruct)) {\n throw new Error(\n SocialServiceErrorMessage.FETCH_TOKEN_FEED_INVALID_RESPONSE,\n );\n }\n return feedData;\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();\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();\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 * 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 * @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();\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 * 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();\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();\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();\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,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,IAAI,IAAI,UAAU,GACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAiC/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,CAAC;IACrC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACjC,IAAI,EAAE,QAAQ,CA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AM,KAAK,QAAQ,EAAE,CAAC;oBAChC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,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 nullable,\n number,\n optional,\n record,\n string,\n type as structType,\n} from '@metamask/superstruct';\n\nimport { serviceName, SocialServiceErrorMessage } from './social-constants.js';\nimport type {\n BlockedContentResponse,\n BlockedProfilesResponse,\n BlockOptions,\n CommentEngagement,\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 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 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 firstTradeAt: optional(nullable(number())),\n holdTimeMs: optional(nullable(number())),\n entryPriceUsd: optional(nullable(number())),\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 '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 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 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 * 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"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ export { SocialController, getDefaultSocialControllerState, } from './SocialCont
|
|
|
3
3
|
export type { SocialControllerFollowTraderAction, SocialControllerOptInToLeaderboardAction, SocialControllerOptOutOfLeaderboardAction, SocialControllerUnfollowTraderAction, SocialControllerUpdateFollowingAction, SocialControllerUpdateLeaderboardAction, } from './SocialController-method-action-types.js';
|
|
4
4
|
export type { SocialServiceActions, SocialServiceEvents, SocialServiceMessenger, } from './SocialService.js';
|
|
5
5
|
export { SocialService } from './SocialService.js';
|
|
6
|
-
export type { SocialServiceBlockAction, SocialServiceFetchBlockedContentAction, SocialServiceFetchBlockedProfilesAction, SocialServiceFetchClosedPositionsAction, SocialServiceFetchFeedAction, SocialServiceFetchFollowersAction, SocialServiceFetchTokenFeedAction, SocialServiceFetchFollowingAction, SocialServiceFetchLeaderboardAction, SocialServiceFetchOpenPositionsAction, SocialServiceFetchPositionByIdAction, SocialServiceFetchTraderFeedAction, SocialServiceFetchTraderProfileAction, SocialServiceFollowAction, SocialServiceOptInToLeaderboardAction, SocialServiceOptOutOfLeaderboardAction, SocialServiceReactToCommentAction, SocialServiceCreateSwapCommentAction, SocialServiceRefreshNotificationPreferencesCacheAction, SocialServiceRemoveCommentReactionAction, SocialServiceUnfollowAction, } from './SocialService-method-action-types.js';
|
|
6
|
+
export type { SocialServiceBlockAction, SocialServiceFetchBlockedContentAction, SocialServiceFetchBlockedProfilesAction, SocialServiceFetchClosedPositionsAction, SocialServiceFetchFeedAction, SocialServiceFetchFollowersAction, SocialServiceFetchTraderFollowingAction, SocialServiceFetchTokenFeedAction, SocialServiceFetchFollowingAction, SocialServiceFetchMyFollowingAction, SocialServiceFetchMyFollowersAction, SocialServiceFetchLeaderboardAction, SocialServiceFetchOpenPositionsAction, SocialServiceFetchPositionByIdAction, SocialServiceFetchTraderFeedAction, SocialServiceFetchTraderProfileAction, SocialServiceFollowAction, SocialServiceOptInToLeaderboardAction, SocialServiceOptOutOfLeaderboardAction, SocialServiceReactToCommentAction, SocialServiceCreateSwapCommentAction, SocialServiceRefreshNotificationPreferencesCacheAction, SocialServiceRemoveCommentReactionAction, SocialServiceUnfollowAction, } from './SocialService-method-action-types.js';
|
|
7
7
|
export { TRADER_RANKING_TAGS, TradeStruct } from './social-types.js';
|
|
8
8
|
export { SOCIAL_FEED_CHANNEL, SOCIAL_FEED_CHANNEL_TYPE, SocialRealtimeService, } from './SocialRealtimeService.js';
|
|
9
9
|
export type { SocialFeedEvent, SocialFeedEventListener, SocialFeedReconnectListener, SocialRealtimeServiceOptions, } from './SocialRealtimeService.js';
|
|
10
|
-
export type { AuthorComment, BlockedContent, BlockedContentResponse, BlockedContentType, BlockedProfile, BlockedProfilesResponse, BlockOptions, CommentEngagement, CommentReaction, CommentReactionProfile, CopytradedAllTime, CreateSwapCommentOptions, FetchBlockedListOptions, FeedActorSummary, FeedItem, FeedPagination, FeedResponse, FetchFeedOptions, FetchFollowersOptions, FetchTokenFeedOptions, FetchLeaderboardOptions, FetchPositionByIdOptions, FetchPositionsOptions, FetchTraderFeedOptions, FetchTraderProfileOptions, FollowersResponse, FollowingResponse, FollowOptions, FollowResponse, LeaderboardEntry, LeaderboardResponse, Pagination, PerChainBreakdown, Position, PositionsResponse, ProfileSummary, ReactToCommentOptions, RemoveCommentReactionOptions, SocialControllerState, SocialHandles, SwapCommentAuthor, SwapCommentResponse, TokenFeedChain, TokenFeedStatus, Trade, TradeAction, TradeInFlight, TraderProfile, TraderProfileResponse, TraderRankingTag, TraderStats, UnfollowOptions, UnfollowResponse, } from './social-types.js';
|
|
10
|
+
export type { AuthorComment, BlockedContent, BlockedContentResponse, BlockedContentType, BlockedProfile, BlockedProfilesResponse, BlockOptions, CommentEngagement, CommentReaction, CommentReactionProfile, CopytradedAllTime, CreateSwapCommentOptions, FetchBlockedListOptions, FeedActorSummary, FeedItem, FeedPagination, FeedResponse, FetchFeedOptions, FetchFollowersOptions, FetchTraderFollowingOptions, FetchTokenFeedOptions, FetchLeaderboardOptions, FetchPositionByIdOptions, FetchPositionsOptions, FetchTraderFeedOptions, FetchTraderProfileOptions, FollowersResponse, FollowingResponse, FollowOptions, FollowResponse, LeaderboardEntry, LeaderboardResponse, Pagination, PerChainBreakdown, Position, PositionsResponse, ProfileSummary, ReactToCommentOptions, RemoveCommentReactionOptions, SocialControllerState, SocialHandles, SwapCommentAuthor, SwapCommentResponse, TokenFeedChain, TokenFeedStatus, Trade, TradeAction, TradeInFlight, TraderProfile, TraderProfileResponse, TraderRankingTag, TraderStats, UnfollowOptions, UnfollowResponse, } from './social-types.js';
|
|
11
11
|
export { serviceName as socialServiceName, SocialServiceErrorMessage, } from './social-constants.js';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index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AuB,EACvB,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,4BAA4B,EAC5B,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,KAAK,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,WAAW,IAAI,iBAAiB,EAChC,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,EAC9B,yBAAyB,EACzB,uBAAuB,EACvB,gCAAgC,GACjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,kCAAkC,EAClC,wCAAwC,EACxC,yCAAyC,EACzC,oCAAoC,EACpC,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,2CAA2C,CAAC;AAEnD,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,YAAY,EACV,wBAAwB,EACxB,sCAAsC,EACtC,uCAAuC,EACvC,uCAAuC,EACv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AgB,EAChB,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,WAAW,IAAI,iBAAiB,EAChC,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAgB/B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAgB/B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AA6BnD,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAgEpC,OAAO,EACL,WAAW,IAAI,iBAAiB,EAChC,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC","sourcesContent":["export type {\n SocialControllerActions,\n SocialControllerEvents,\n SocialControllerGetStateAction,\n SocialControllerMessenger,\n SocialControllerOptions,\n SocialControllerStateChangeEvent,\n} from './SocialController.js';\nexport {\n SocialController,\n getDefaultSocialControllerState,\n} from './SocialController.js';\n\nexport type {\n SocialControllerFollowTraderAction,\n SocialControllerOptInToLeaderboardAction,\n SocialControllerOptOutOfLeaderboardAction,\n SocialControllerUnfollowTraderAction,\n SocialControllerUpdateFollowingAction,\n SocialControllerUpdateLeaderboardAction,\n} from './SocialController-method-action-types.js';\n\nexport type {\n SocialServiceActions,\n SocialServiceEvents,\n SocialServiceMessenger,\n} from './SocialService.js';\nexport { SocialService } from './SocialService.js';\n\nexport type {\n SocialServiceBlockAction,\n SocialServiceFetchBlockedContentAction,\n SocialServiceFetchBlockedProfilesAction,\n SocialServiceFetchClosedPositionsAction,\n SocialServiceFetchFeedAction,\n SocialServiceFetchFollowersAction,\n SocialServiceFetchTraderFollowingAction,\n SocialServiceFetchTokenFeedAction,\n SocialServiceFetchFollowingAction,\n SocialServiceFetchMyFollowingAction,\n SocialServiceFetchMyFollowersAction,\n SocialServiceFetchLeaderboardAction,\n SocialServiceFetchOpenPositionsAction,\n SocialServiceFetchPositionByIdAction,\n SocialServiceFetchTraderFeedAction,\n SocialServiceFetchTraderProfileAction,\n SocialServiceFollowAction,\n SocialServiceOptInToLeaderboardAction,\n SocialServiceOptOutOfLeaderboardAction,\n SocialServiceReactToCommentAction,\n SocialServiceCreateSwapCommentAction,\n SocialServiceRefreshNotificationPreferencesCacheAction,\n SocialServiceRemoveCommentReactionAction,\n SocialServiceUnfollowAction,\n} from './SocialService-method-action-types.js';\n\nexport { TRADER_RANKING_TAGS, TradeStruct } from './social-types.js';\nexport {\n SOCIAL_FEED_CHANNEL,\n SOCIAL_FEED_CHANNEL_TYPE,\n SocialRealtimeService,\n} from './SocialRealtimeService.js';\nexport type {\n SocialFeedEvent,\n SocialFeedEventListener,\n SocialFeedReconnectListener,\n SocialRealtimeServiceOptions,\n} from './SocialRealtimeService.js';\nexport type {\n AuthorComment,\n BlockedContent,\n BlockedContentResponse,\n BlockedContentType,\n BlockedProfile,\n BlockedProfilesResponse,\n BlockOptions,\n CommentEngagement,\n CommentReaction,\n CommentReactionProfile,\n CopytradedAllTime,\n CreateSwapCommentOptions,\n FetchBlockedListOptions,\n FeedActorSummary,\n FeedItem,\n FeedPagination,\n FeedResponse,\n FetchFeedOptions,\n FetchFollowersOptions,\n FetchTraderFollowingOptions,\n FetchTokenFeedOptions,\n FetchLeaderboardOptions,\n FetchPositionByIdOptions,\n FetchPositionsOptions,\n FetchTraderFeedOptions,\n FetchTraderProfileOptions,\n FollowersResponse,\n FollowingResponse,\n FollowOptions,\n FollowResponse,\n LeaderboardEntry,\n LeaderboardResponse,\n Pagination,\n PerChainBreakdown,\n Position,\n PositionsResponse,\n ProfileSummary,\n ReactToCommentOptions,\n RemoveCommentReactionOptions,\n SocialControllerState,\n SocialHandles,\n SwapCommentAuthor,\n SwapCommentResponse,\n TokenFeedChain,\n TokenFeedStatus,\n Trade,\n TradeAction,\n TradeInFlight,\n TraderProfile,\n TraderProfileResponse,\n TraderRankingTag,\n TraderStats,\n UnfollowOptions,\n UnfollowResponse,\n} from './social-types.js';\n\nexport {\n serviceName as socialServiceName,\n SocialServiceErrorMessage,\n} from './social-constants.js';\n"]}
|
|
@@ -13,6 +13,10 @@ export declare const SocialServiceErrorMessage: {
|
|
|
13
13
|
readonly FETCH_FOLLOWERS_INVALID_RESPONSE: 'SocialService: Followers returned invalid response';
|
|
14
14
|
readonly FETCH_FOLLOWING_FAILED: 'SocialService: Following request failed';
|
|
15
15
|
readonly FETCH_FOLLOWING_INVALID_RESPONSE: 'SocialService: Following returned invalid response';
|
|
16
|
+
readonly FETCH_TRADER_FOLLOWING_FAILED: 'SocialService: Trader following request failed';
|
|
17
|
+
readonly FETCH_TRADER_FOLLOWING_INVALID_RESPONSE: 'SocialService: Trader following returned invalid response';
|
|
18
|
+
readonly FETCH_MY_FOLLOWERS_FAILED: 'SocialService: My followers request failed';
|
|
19
|
+
readonly FETCH_MY_FOLLOWERS_INVALID_RESPONSE: 'SocialService: My followers returned invalid response';
|
|
16
20
|
readonly FOLLOW_FAILED: 'SocialService: Follow request failed';
|
|
17
21
|
readonly FOLLOW_INVALID_RESPONSE: 'SocialService: Follow returned invalid response';
|
|
18
22
|
readonly UNFOLLOW_FAILED: 'SocialService: Unfollow request failed';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-constants.d.ts","sourceRoot":"","sources":["../src/social-constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO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AY,EAAE,qCAAqC;aACnD,6BAA6B,EAC3B,gDAAgD;aAClD,uCAAuC,EACrC,2DAA2D;aAC7D,4BAA4B,EAAE,+CAA+C;aAC7E,sCAAsC,EACpC,0DAA0D;CACpD,CAAC"}
|
package/dist/social-constants.js
CHANGED
|
@@ -13,6 +13,10 @@ export const SocialServiceErrorMessage = {
|
|
|
13
13
|
FETCH_FOLLOWERS_INVALID_RESPONSE: 'SocialService: Followers returned invalid response',
|
|
14
14
|
FETCH_FOLLOWING_FAILED: 'SocialService: Following request failed',
|
|
15
15
|
FETCH_FOLLOWING_INVALID_RESPONSE: 'SocialService: Following returned invalid response',
|
|
16
|
+
FETCH_TRADER_FOLLOWING_FAILED: 'SocialService: Trader following request failed',
|
|
17
|
+
FETCH_TRADER_FOLLOWING_INVALID_RESPONSE: 'SocialService: Trader following returned invalid response',
|
|
18
|
+
FETCH_MY_FOLLOWERS_FAILED: 'SocialService: My followers request failed',
|
|
19
|
+
FETCH_MY_FOLLOWERS_INVALID_RESPONSE: 'SocialService: My followers returned invalid response',
|
|
16
20
|
FOLLOW_FAILED: 'SocialService: Follow request failed',
|
|
17
21
|
FOLLOW_INVALID_RESPONSE: 'SocialService: Follow returned invalid response',
|
|
18
22
|
UNFOLLOW_FAILED: 'SocialService: Unfollow request failed',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-constants.js","sourceRoot":"","sources":["../src/social-constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;AAE3C,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,wBAAwB,EAAE,2CAA2C;IACrE,kCAAkC,EAChC,sDAAsD;IACxD,2BAA2B,EAAE,8CAA8C;IAC3E,qCAAqC,EACnC,yDAAyD;IAC3D,2BAA2B,EAAE,8CAA8C;IAC3E,qCAAqC,EACnC,yDAAyD;IAC3D,6BAA6B,EAC3B,gDAAgD;IAClD,uCAAuC,EACrC,2DAA2D;IAC7D,sBAAsB,EAAE,yCAAyC;IACjE,gCAAgC,EAC9B,oDAAoD;IACtD,sBAAsB,EAAE,yCAAyC;IACjE,gCAAgC,EAC9B,oDAAoD;IACtD,aAAa,EAAE,sCAAsC;IACrD,uBAAuB,EAAE,iDAAiD;IAC1E,eAAe,EAAE,wCAAwC;IACzD,yBAAyB,EACvB,mDAAmD;IACrD,2BAA2B,EAAE,wCAAwC;IACrE,qCAAqC,EACnC,mDAAmD;IACrD,0BAA0B,EACxB,mDAAmD;IACrD,yBAAyB,EAAE,kDAAkD;IAC7E,iBAAiB,EAAE,oCAAoC;IACvD,2BAA2B,EAAE,+CAA+C;IAC5E,wBAAwB,EAAE,2CAA2C;IACrE,kCAAkC,EAChC,sDAAsD;IACxD,uBAAuB,EAAE,0CAA0C;IACnE,iCAAiC,EAC/B,qDAAqD;IACvD,uBAAuB,EAAE,gDAAgD;IACzE,iCAAiC,EAC/B,2DAA2D;IAC7D,8BAA8B,EAC5B,wDAAwD;IAC1D,wCAAwC,EACtC,mEAAmE;IACrE,0BAA0B,EAAE,4CAA4C;IACxE,oCAAoC,EAClC,uDAAuD;IACzD,6CAA6C,EAC3C,sEAAsE;IACxE,YAAY,EAAE,qCAAqC;IACnD,6BAA6B,EAC3B,gDAAgD;IAClD,uCAAuC,EACrC,2DAA2D;IAC7D,4BAA4B,EAAE,+CAA+C;IAC7E,sCAAsC,EACpC,0DAA0D;CACpD,CAAC","sourcesContent":["export const serviceName = 'SocialService';\n\nexport const controllerName = 'SocialController';\n\nexport const SocialServiceErrorMessage = {\n FETCH_LEADERBOARD_FAILED: 'SocialService: Leaderboard request failed',\n FETCH_LEADERBOARD_INVALID_RESPONSE:\n 'SocialService: Leaderboard returned invalid response',\n FETCH_TRADER_PROFILE_FAILED: 'SocialService: Trader profile request failed',\n FETCH_TRADER_PROFILE_INVALID_RESPONSE:\n 'SocialService: Trader profile returned invalid response',\n FETCH_OPEN_POSITIONS_FAILED: 'SocialService: Open positions request failed',\n FETCH_OPEN_POSITIONS_INVALID_RESPONSE:\n 'SocialService: Open positions returned invalid response',\n FETCH_CLOSED_POSITIONS_FAILED:\n 'SocialService: Closed positions request failed',\n FETCH_CLOSED_POSITIONS_INVALID_RESPONSE:\n 'SocialService: Closed positions returned invalid response',\n FETCH_FOLLOWERS_FAILED: 'SocialService: Followers request failed',\n FETCH_FOLLOWERS_INVALID_RESPONSE:\n 'SocialService: Followers returned invalid response',\n FETCH_FOLLOWING_FAILED: 'SocialService: Following request failed',\n FETCH_FOLLOWING_INVALID_RESPONSE:\n 'SocialService: Following returned invalid response',\n FOLLOW_FAILED: 'SocialService: Follow request failed',\n FOLLOW_INVALID_RESPONSE: 'SocialService: Follow returned invalid response',\n UNFOLLOW_FAILED: 'SocialService: Unfollow request failed',\n UNFOLLOW_INVALID_RESPONSE:\n 'SocialService: Unfollow returned invalid response',\n FETCH_POSITION_BY_ID_FAILED: 'SocialService: Position request failed',\n FETCH_POSITION_BY_ID_INVALID_RESPONSE:\n 'SocialService: Position returned invalid response',\n LEADERBOARD_OPT_OUT_FAILED:\n 'SocialService: Leaderboard opt-out request failed',\n LEADERBOARD_OPT_IN_FAILED: 'SocialService: Leaderboard opt-in request failed',\n FETCH_FEED_FAILED: 'SocialService: Feed request failed',\n FETCH_FEED_INVALID_RESPONSE: 'SocialService: Feed returned invalid response',\n FETCH_TRADER_FEED_FAILED: 'SocialService: Trader feed request failed',\n FETCH_TRADER_FEED_INVALID_RESPONSE:\n 'SocialService: Trader feed returned invalid response',\n FETCH_TOKEN_FEED_FAILED: 'SocialService: Token feed request failed',\n FETCH_TOKEN_FEED_INVALID_RESPONSE:\n 'SocialService: Token feed returned invalid response',\n REACT_TO_COMMENT_FAILED: 'SocialService: Comment reaction request failed',\n REACT_TO_COMMENT_INVALID_RESPONSE:\n 'SocialService: Comment reaction returned invalid response',\n REMOVE_COMMENT_REACTION_FAILED:\n 'SocialService: Comment reaction removal request failed',\n REMOVE_COMMENT_REACTION_INVALID_RESPONSE:\n 'SocialService: Comment reaction removal returned invalid response',\n CREATE_SWAP_COMMENT_FAILED: 'SocialService: Swap comment request failed',\n CREATE_SWAP_COMMENT_INVALID_RESPONSE:\n 'SocialService: Swap comment returned invalid response',\n NOTIFICATION_PREFERENCES_CACHE_REFRESH_FAILED:\n 'SocialService: Notification preferences cache refresh request failed',\n BLOCK_FAILED: 'SocialService: Block request failed',\n FETCH_BLOCKED_PROFILES_FAILED:\n 'SocialService: Blocked profiles request failed',\n FETCH_BLOCKED_PROFILES_INVALID_RESPONSE:\n 'SocialService: Blocked profiles returned invalid response',\n FETCH_BLOCKED_CONTENT_FAILED: 'SocialService: Blocked content request failed',\n FETCH_BLOCKED_CONTENT_INVALID_RESPONSE:\n 'SocialService: Blocked content returned invalid response',\n} as const;\n"]}
|
|
1
|
+
{"version":3,"file":"social-constants.js","sourceRoot":"","sources":["../src/social-constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;AAE3C,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,wBAAwB,EAAE,2CAA2C;IACrE,kCAAkC,EAChC,sDAAsD;IACxD,2BAA2B,EAAE,8CAA8C;IAC3E,qCAAqC,EACnC,yDAAyD;IAC3D,2BAA2B,EAAE,8CAA8C;IAC3E,qCAAqC,EACnC,yDAAyD;IAC3D,6BAA6B,EAC3B,gDAAgD;IAClD,uCAAuC,EACrC,2DAA2D;IAC7D,sBAAsB,EAAE,yCAAyC;IACjE,gCAAgC,EAC9B,oDAAoD;IACtD,sBAAsB,EAAE,yCAAyC;IACjE,gCAAgC,EAC9B,oDAAoD;IACtD,6BAA6B,EAC3B,gDAAgD;IAClD,uCAAuC,EACrC,2DAA2D;IAC7D,yBAAyB,EAAE,4CAA4C;IACvE,mCAAmC,EACjC,uDAAuD;IACzD,aAAa,EAAE,sCAAsC;IACrD,uBAAuB,EAAE,iDAAiD;IAC1E,eAAe,EAAE,wCAAwC;IACzD,yBAAyB,EACvB,mDAAmD;IACrD,2BAA2B,EAAE,wCAAwC;IACrE,qCAAqC,EACnC,mDAAmD;IACrD,0BAA0B,EACxB,mDAAmD;IACrD,yBAAyB,EAAE,kDAAkD;IAC7E,iBAAiB,EAAE,oCAAoC;IACvD,2BAA2B,EAAE,+CAA+C;IAC5E,wBAAwB,EAAE,2CAA2C;IACrE,kCAAkC,EAChC,sDAAsD;IACxD,uBAAuB,EAAE,0CAA0C;IACnE,iCAAiC,EAC/B,qDAAqD;IACvD,uBAAuB,EAAE,gDAAgD;IACzE,iCAAiC,EAC/B,2DAA2D;IAC7D,8BAA8B,EAC5B,wDAAwD;IAC1D,wCAAwC,EACtC,mEAAmE;IACrE,0BAA0B,EAAE,4CAA4C;IACxE,oCAAoC,EAClC,uDAAuD;IACzD,6CAA6C,EAC3C,sEAAsE;IACxE,YAAY,EAAE,qCAAqC;IACnD,6BAA6B,EAC3B,gDAAgD;IAClD,uCAAuC,EACrC,2DAA2D;IAC7D,4BAA4B,EAAE,+CAA+C;IAC7E,sCAAsC,EACpC,0DAA0D;CACpD,CAAC","sourcesContent":["export const serviceName = 'SocialService';\n\nexport const controllerName = 'SocialController';\n\nexport const SocialServiceErrorMessage = {\n FETCH_LEADERBOARD_FAILED: 'SocialService: Leaderboard request failed',\n FETCH_LEADERBOARD_INVALID_RESPONSE:\n 'SocialService: Leaderboard returned invalid response',\n FETCH_TRADER_PROFILE_FAILED: 'SocialService: Trader profile request failed',\n FETCH_TRADER_PROFILE_INVALID_RESPONSE:\n 'SocialService: Trader profile returned invalid response',\n FETCH_OPEN_POSITIONS_FAILED: 'SocialService: Open positions request failed',\n FETCH_OPEN_POSITIONS_INVALID_RESPONSE:\n 'SocialService: Open positions returned invalid response',\n FETCH_CLOSED_POSITIONS_FAILED:\n 'SocialService: Closed positions request failed',\n FETCH_CLOSED_POSITIONS_INVALID_RESPONSE:\n 'SocialService: Closed positions returned invalid response',\n FETCH_FOLLOWERS_FAILED: 'SocialService: Followers request failed',\n FETCH_FOLLOWERS_INVALID_RESPONSE:\n 'SocialService: Followers returned invalid response',\n FETCH_FOLLOWING_FAILED: 'SocialService: Following request failed',\n FETCH_FOLLOWING_INVALID_RESPONSE:\n 'SocialService: Following returned invalid response',\n FETCH_TRADER_FOLLOWING_FAILED:\n 'SocialService: Trader following request failed',\n FETCH_TRADER_FOLLOWING_INVALID_RESPONSE:\n 'SocialService: Trader following returned invalid response',\n FETCH_MY_FOLLOWERS_FAILED: 'SocialService: My followers request failed',\n FETCH_MY_FOLLOWERS_INVALID_RESPONSE:\n 'SocialService: My followers returned invalid response',\n FOLLOW_FAILED: 'SocialService: Follow request failed',\n FOLLOW_INVALID_RESPONSE: 'SocialService: Follow returned invalid response',\n UNFOLLOW_FAILED: 'SocialService: Unfollow request failed',\n UNFOLLOW_INVALID_RESPONSE:\n 'SocialService: Unfollow returned invalid response',\n FETCH_POSITION_BY_ID_FAILED: 'SocialService: Position request failed',\n FETCH_POSITION_BY_ID_INVALID_RESPONSE:\n 'SocialService: Position returned invalid response',\n LEADERBOARD_OPT_OUT_FAILED:\n 'SocialService: Leaderboard opt-out request failed',\n LEADERBOARD_OPT_IN_FAILED: 'SocialService: Leaderboard opt-in request failed',\n FETCH_FEED_FAILED: 'SocialService: Feed request failed',\n FETCH_FEED_INVALID_RESPONSE: 'SocialService: Feed returned invalid response',\n FETCH_TRADER_FEED_FAILED: 'SocialService: Trader feed request failed',\n FETCH_TRADER_FEED_INVALID_RESPONSE:\n 'SocialService: Trader feed returned invalid response',\n FETCH_TOKEN_FEED_FAILED: 'SocialService: Token feed request failed',\n FETCH_TOKEN_FEED_INVALID_RESPONSE:\n 'SocialService: Token feed returned invalid response',\n REACT_TO_COMMENT_FAILED: 'SocialService: Comment reaction request failed',\n REACT_TO_COMMENT_INVALID_RESPONSE:\n 'SocialService: Comment reaction returned invalid response',\n REMOVE_COMMENT_REACTION_FAILED:\n 'SocialService: Comment reaction removal request failed',\n REMOVE_COMMENT_REACTION_INVALID_RESPONSE:\n 'SocialService: Comment reaction removal returned invalid response',\n CREATE_SWAP_COMMENT_FAILED: 'SocialService: Swap comment request failed',\n CREATE_SWAP_COMMENT_INVALID_RESPONSE:\n 'SocialService: Swap comment returned invalid response',\n NOTIFICATION_PREFERENCES_CACHE_REFRESH_FAILED:\n 'SocialService: Notification preferences cache refresh request failed',\n BLOCK_FAILED: 'SocialService: Block request failed',\n FETCH_BLOCKED_PROFILES_FAILED:\n 'SocialService: Blocked profiles request failed',\n FETCH_BLOCKED_PROFILES_INVALID_RESPONSE:\n 'SocialService: Blocked profiles returned invalid response',\n FETCH_BLOCKED_CONTENT_FAILED: 'SocialService: Blocked content request failed',\n FETCH_BLOCKED_CONTENT_INVALID_RESPONSE:\n 'SocialService: Blocked content returned invalid response',\n} as const;\n"]}
|
package/dist/social-types.d.ts
CHANGED
|
@@ -215,10 +215,19 @@ export type Position = {
|
|
|
215
215
|
* responses from a social-api that predates the field.
|
|
216
216
|
*/
|
|
217
217
|
isOpen?: boolean;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
/**
|
|
219
|
+
* Total USD spent buying into the position. `null` when Clicker stats are
|
|
220
|
+
* incomplete (the social-api used to JSON-serialize `NaN` as `null`).
|
|
221
|
+
*/
|
|
222
|
+
boughtUsd: number | null;
|
|
223
|
+
/** Total USD received from sells. `null` when stats are incomplete. */
|
|
224
|
+
soldUsd: number | null;
|
|
225
|
+
/** Realized profit or loss in USD. `null` when stats are incomplete. */
|
|
226
|
+
realizedPnl: number | null;
|
|
227
|
+
/**
|
|
228
|
+
* USD cost basis of the remaining holdings. `null` when stats are incomplete.
|
|
229
|
+
*/
|
|
230
|
+
costBasis: number | null;
|
|
222
231
|
trades: Trade[];
|
|
223
232
|
lastTradeAt: number;
|
|
224
233
|
/** Daylight-hosted token image URL. */
|
|
@@ -412,14 +421,16 @@ export type FeedResponse = {
|
|
|
412
421
|
pagination: FeedPagination;
|
|
413
422
|
};
|
|
414
423
|
/**
|
|
415
|
-
* Response from `GET /v1/
|
|
424
|
+
* Response from `GET /v1/users/me/followers` and bearer-authenticated
|
|
425
|
+
* `GET /v1/traders/:addressOrId/followers` (optionally `?mutuals=true`).
|
|
416
426
|
*/
|
|
417
427
|
export type FollowersResponse = {
|
|
418
428
|
followers: ProfileSummary[];
|
|
419
429
|
count: number;
|
|
420
430
|
};
|
|
421
431
|
/**
|
|
422
|
-
* Response from `GET /v1/users/me/following
|
|
432
|
+
* Response from `GET /v1/users/me/following` and bearer-authenticated
|
|
433
|
+
* `GET /v1/traders/:addressOrId/following`.
|
|
423
434
|
*/
|
|
424
435
|
export type FollowingResponse = {
|
|
425
436
|
following: ProfileSummary[];
|
|
@@ -457,6 +468,16 @@ export type FetchPositionsOptions = {
|
|
|
457
468
|
export type FetchFollowersOptions = {
|
|
458
469
|
/** Wallet address or Clicker profile ID. */
|
|
459
470
|
addressOrId: string;
|
|
471
|
+
/**
|
|
472
|
+
* When true, requests `GET .../followers?mutuals=true` so `followers` are
|
|
473
|
+
* profiles that follow both this trader and the authenticated user; `count` is
|
|
474
|
+
* the mutual total. Omit or false returns the trader's full follower list.
|
|
475
|
+
*/
|
|
476
|
+
mutuals?: boolean;
|
|
477
|
+
};
|
|
478
|
+
export type FetchTraderFollowingOptions = {
|
|
479
|
+
/** Wallet address or Clicker profile ID. */
|
|
480
|
+
addressOrId: string;
|
|
460
481
|
};
|
|
461
482
|
export type FetchTraderFeedOptions = {
|
|
462
483
|
/** Wallet address or Clicker profile ID. */
|