@metamask/social-controllers 2.5.0 → 2.6.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 CHANGED
@@ -7,11 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [2.5.0]
10
+ ## [2.6.0]
11
+
12
+ ### Added
11
13
 
12
- ### Uncategorized
14
+ - Add optional `marketCap` to the `Trade` type (and `TradeStruct`) — historical token market cap at trade time from the social API ([#9605](https://github.com/MetaMask/core/pull/9605))
13
15
 
14
- - chore: MIT license text update ([#9472](https://github.com/MetaMask/core/pull/9472))
16
+ ## [2.5.0]
15
17
 
16
18
  ### Added
17
19
 
@@ -21,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
21
23
  ### Changed
22
24
 
23
25
  - Bump `@metamask/profile-sync-controller` from `^28.2.0` to `^28.3.0` ([#9463](https://github.com/MetaMask/core/pull/9463))
26
+ - Update `LICENSE` text ([#9472](https://github.com/MetaMask/core/pull/9472))
24
27
 
25
28
  ## [2.4.0]
26
29
 
@@ -83,10 +86,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
83
86
 
84
87
  ## [1.0.0]
85
88
 
86
- ### Uncategorized
87
-
88
- - chore: Format changelogs with Oxfmt ([#8442](https://github.com/MetaMask/core/pull/8442))
89
-
90
89
  ### Changed
91
90
 
92
91
  - **BREAKING:** `SocialServiceMessenger` now requires `AuthenticationController:getBearerToken` as an allowed action — all consumers must provide this action via messenger delegation
@@ -125,7 +124,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
125
124
  - `unfollowTrader` — unfollows traders and removes addresses from state
126
125
  - `updateFollowing` — fetches following list and replaces addresses in state
127
126
 
128
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/social-controllers@2.5.0...HEAD
127
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/social-controllers@2.6.0...HEAD
128
+ [2.6.0]: https://github.com/MetaMask/core/compare/@metamask/social-controllers@2.5.0...@metamask/social-controllers@2.6.0
129
129
  [2.5.0]: https://github.com/MetaMask/core/compare/@metamask/social-controllers@2.4.0...@metamask/social-controllers@2.5.0
130
130
  [2.4.0]: https://github.com/MetaMask/core/compare/@metamask/social-controllers@2.3.1...@metamask/social-controllers@2.4.0
131
131
  [2.3.1]: https://github.com/MetaMask/core/compare/@metamask/social-controllers@2.3.0...@metamask/social-controllers@2.3.1
@@ -14,6 +14,8 @@ exports.TradeStruct = (0, superstruct_1.type)({
14
14
  perpLeverage: (0, superstruct_1.optional)((0, superstruct_1.nullable)((0, superstruct_1.number)())),
15
15
  tokenAmount: (0, superstruct_1.number)(),
16
16
  usdCost: (0, superstruct_1.number)(),
17
+ /** Token market cap in USD at trade time. `null` when Clicker has no mark. */
18
+ marketCap: (0, superstruct_1.optional)((0, superstruct_1.nullable)((0, superstruct_1.number)())),
17
19
  timestamp: (0, superstruct_1.number)(),
18
20
  transactionHash: (0, superstruct_1.string)(),
19
21
  });
@@ -1 +1 @@
1
- {"version":3,"file":"social-types.cjs","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":";;;AACA,uDAO+B;AA8BlB,QAAA,WAAW,GAAG,IAAA,kBAAU,EAAC;IACpC,SAAS,EAAE,IAAA,mBAAK,EAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,IAAA,mBAAK,EAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC5B,8EAA8E;IAC9E,cAAc,EAAE,IAAA,sBAAQ,EACtB,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CACrD;IACD,uDAAuD;IACvD,gBAAgB,EAAE,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,8EAA8E;IAC9E,YAAY,EAAE,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,IAAA,oBAAM,GAAE;IACrB,OAAO,EAAE,IAAA,oBAAM,GAAE;IACjB,SAAS,EAAE,IAAA,oBAAM,GAAE;IACnB,eAAe,EAAE,IAAA,oBAAM,GAAE;CAC1B,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n enums,\n nullable,\n number,\n optional,\n string,\n type as structType,\n} from '@metamask/superstruct';\n\n// ---------------------------------------------------------------------------\n// Shared sub-types\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal profile summary used across follow/follower responses.\n */\nexport type ProfileSummary = {\n /** Clicker profile ID (UUID). */\n profileId: string;\n /** Primary wallet address. */\n address: string;\n /** Display name or truncated address. */\n name: string;\n /** Profile avatar URL. */\n imageUrl?: string | null;\n};\n\n/**\n * Social media handles attached to a trader profile.\n */\nexport type SocialHandles = {\n twitter?: string | null;\n farcaster?: string | null;\n ens?: string | null;\n lens?: string | null;\n};\n\nexport const TradeStruct = structType({\n direction: enums(['buy', 'sell']),\n intent: enums(['enter', 'exit']),\n category: optional(string()),\n /** High-level trade classification. `null` when Clicker does not classify. */\n classification: optional(\n nullable(enums(['spot', 'perp', 'send', 'receive'])),\n ),\n /** Perp side for this fill. `null` for spot trades. */\n perpPositionType: optional(nullable(enums(['long', 'short']))),\n /** Leverage multiplier for perp trades (e.g. `5` for 5x). `null` for spot. */\n perpLeverage: optional(nullable(number())),\n tokenAmount: number(),\n usdCost: number(),\n timestamp: number(),\n transactionHash: string(),\n});\n\nexport type Trade = Infer<typeof TradeStruct>;\n\n// ---------------------------------------------------------------------------\n// Leaderboard\n// ---------------------------------------------------------------------------\n\n/**\n * A single entry in the leaderboard response.\n */\nexport type LeaderboardEntry = {\n rank: number;\n addresses: string[];\n profileId: string;\n name: string;\n imageUrl?: string | null;\n pnl30d: number;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n pnlPerChain: Record<string, number>;\n followerCount: number;\n socialHandles: SocialHandles;\n};\n\n/**\n * Response from `GET /v1/leaderboard`.\n */\nexport type LeaderboardResponse = {\n traders: LeaderboardEntry[];\n};\n\n// ---------------------------------------------------------------------------\n// Trader profile\n// ---------------------------------------------------------------------------\n\nexport type TraderProfile = {\n profileId: string;\n address: string;\n allAddresses: string[];\n name: string;\n imageUrl?: string | null;\n};\n\nexport type TraderStats = {\n pnl30d?: number | null;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n /** Median holding time in minutes. */\n medianHoldMinutes?: number | null;\n};\n\nexport type PerChainBreakdown = {\n perChainPnl: Record<string, number>;\n /** ROI can be null for chains with no trading activity (zero cost-basis). */\n perChainRoi: Record<string, number | null>;\n perChainVolume: Record<string, number>;\n /**\n * 7-day per-chain PnL in USD. Optional: older social-api versions only\n * return the 30-day breakdown (`perChainPnl`). The unsuffixed fields above\n * remain the 30-day window for backward compatibility.\n */\n perChainPnl7d?: Record<string, number>;\n /** 7-day per-chain ROI. Null for chains with no trading activity. */\n perChainRoi7d?: Record<string, number | null>;\n /** 7-day per-chain volume in USD. */\n perChainVolume7d?: Record<string, number>;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/profile`.\n */\nexport type TraderProfileResponse = {\n profile: TraderProfile;\n stats: TraderStats;\n perChainBreakdown: PerChainBreakdown;\n socialHandles: SocialHandles;\n followerCount: number;\n followingCount: number;\n};\n\n// ---------------------------------------------------------------------------\n// Positions\n// ---------------------------------------------------------------------------\n\nexport type Position = {\n positionId: string;\n tokenSymbol: string;\n tokenName: string;\n tokenAddress: string;\n chain: string;\n positionAmount: number;\n boughtUsd: number;\n soldUsd: number;\n realizedPnl: number;\n costBasis: number;\n trades: Trade[];\n lastTradeAt: number;\n /** Daylight-hosted token image URL. */\n tokenImageUrl?: string | null;\n /** Current USD value of the remaining position (open positions only). */\n currentValueUSD?: number | null;\n /** Unrealized + realized PnL in USD. */\n pnlValueUsd?: number | null;\n /** PnL as a percentage of cost basis. */\n pnlPercent?: number | null;\n /** Perp side of the position. `null`/absent for spot positions. */\n perpPositionType?: 'long' | 'short' | null;\n /** Leverage multiplier for perp positions. `null`/absent for spot. */\n perpLeverage?: number | null;\n /**\n * Leveraged/notional position size as reported by Clicker. NOT necessarily\n * `positionAmount` × `perpLeverage` — the ratio varies for positions built\n * across fills at different leverage, so use this field directly rather than\n * deriving it, and treat `perpLeverage` as the authoritative leverage. This is\n * notional exposure, not capital at risk (the margin/capital at risk is\n * `costBasis`). Hyperliquid/perp positions only; absent for spot.\n */\n positionAmountWithLeverage?: number | null;\n};\n\nexport type Pagination = {\n hasMore: boolean;\n nextPage?: number;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/positions/open`\n * and `GET /v1/traders/:addressOrId/positions/closed`.\n */\nexport type PositionsResponse = {\n positions: Position[];\n pagination: Pagination;\n /** ISO 8601 timestamp indicating when the response was computed server-side. */\n computedAt?: string | null;\n};\n\n// ---------------------------------------------------------------------------\n// Feed\n// ---------------------------------------------------------------------------\n\n/**\n * A single trader-activity feed item: a {@link Position} the trade belongs to,\n * plus the {@link ProfileSummary} of the trader who made it (`actor`) and the\n * item's creation `timestamp` (Unix seconds).\n */\nexport type FeedItem = Position & {\n /** The trader who made this trade. */\n actor: ProfileSummary;\n /** Unix timestamp (seconds) when the feed item was created. */\n timestamp: number;\n};\n\n/**\n * Cursor pagination for the feed. Pass `olderCursor` back as `olderThan` to\n * load older items (infinite scroll), and `newerCursor` as `newerThan` to\n * fetch newer items. `null` when there are no items in that direction.\n */\nexport type FeedPagination = {\n olderCursor: string | null;\n newerCursor: string | null;\n};\n\n/**\n * Response from `GET /v1/feed`.\n */\nexport type FeedResponse = {\n items: FeedItem[];\n pagination: FeedPagination;\n};\n\n// ---------------------------------------------------------------------------\n// Followers\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/traders/:addressOrId/followers`.\n */\nexport type FollowersResponse = {\n followers: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Following\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/users/me/following`.\n */\nexport type FollowingResponse = {\n following: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Follow / Unfollow\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `PUT /v1/users/me/follows`.\n */\nexport type FollowResponse = {\n followed: ProfileSummary[];\n};\n\n/**\n * Response from `DELETE /v1/users/me/follows`.\n */\nexport type UnfollowResponse = {\n unfollowed: ProfileSummary[];\n};\n\n// ---------------------------------------------------------------------------\n// Fetch options\n// ---------------------------------------------------------------------------\n\nexport type FetchLeaderboardOptions = {\n sort?: 'pnl' | 'winRate' | 'roi';\n chains?: string[];\n limit?: number;\n};\n\nexport type FetchTraderProfileOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionsOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n chain?: string;\n sort?: 'value' | 'latest';\n limit?: number;\n page?: number;\n};\n\nexport type FetchFollowersOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchFeedOptions = {\n /**\n * Which feed to fetch: `following` (personalized to the current user,\n * identified server-side from the JWT) or `leaderboard` (generic, shared by\n * all users). Defaults to `following` server-side when omitted.\n */\n scope?: 'following' | 'leaderboard';\n /**\n * Filter by one or more chains, given as CAIP-2 chain ids (e.g.\n * `eip155:8453`). Omit for the server defaults.\n */\n chains?: string[];\n /** Number of results to return. */\n limit?: number;\n /** Cursor for older items (infinite scroll). Use `pagination.olderCursor`. */\n olderThan?: string;\n /** Cursor for newer items (pull to refresh). Use `pagination.newerCursor`. */\n newerThan?: string;\n};\n\nexport type FetchPositionByIdOptions = {\n /** Unique position ID (UUID). */\n positionId: string;\n};\n\nexport type FollowOptions = {\n /** Array of wallet addresses or profile IDs to follow. */\n targets: string[];\n};\n\nexport type UnfollowOptions = {\n /** Array of wallet addresses or profile IDs to unfollow. */\n targets: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Controller state\n// ---------------------------------------------------------------------------\n\n/**\n * State managed by the SocialController.\n *\n * The controller acts as a simple store — no TTL or eviction logic.\n * The UI decides when to re-fetch; the social-api's own cache layer\n * handles upstream rate-limiting.\n */\nexport type SocialControllerState = {\n /** Cached ranked trader list from the last `updateLeaderboard` call. */\n leaderboardEntries: LeaderboardEntry[];\n /** Wallet addresses the current user follows. */\n followingAddresses: string[];\n /** Clicker profile IDs the current user follows — used by mobile UI. */\n followingProfileIds: string[];\n};\n"]}
1
+ {"version":3,"file":"social-types.cjs","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":";;;AACA,uDAO+B;AA8BlB,QAAA,WAAW,GAAG,IAAA,kBAAU,EAAC;IACpC,SAAS,EAAE,IAAA,mBAAK,EAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,IAAA,mBAAK,EAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC5B,8EAA8E;IAC9E,cAAc,EAAE,IAAA,sBAAQ,EACtB,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CACrD;IACD,uDAAuD;IACvD,gBAAgB,EAAE,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,8EAA8E;IAC9E,YAAY,EAAE,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,IAAA,oBAAM,GAAE;IACrB,OAAO,EAAE,IAAA,oBAAM,GAAE;IACjB,8EAA8E;IAC9E,SAAS,EAAE,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,CAAC;IACvC,SAAS,EAAE,IAAA,oBAAM,GAAE;IACnB,eAAe,EAAE,IAAA,oBAAM,GAAE;CAC1B,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n enums,\n nullable,\n number,\n optional,\n string,\n type as structType,\n} from '@metamask/superstruct';\n\n// ---------------------------------------------------------------------------\n// Shared sub-types\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal profile summary used across follow/follower responses.\n */\nexport type ProfileSummary = {\n /** Clicker profile ID (UUID). */\n profileId: string;\n /** Primary wallet address. */\n address: string;\n /** Display name or truncated address. */\n name: string;\n /** Profile avatar URL. */\n imageUrl?: string | null;\n};\n\n/**\n * Social media handles attached to a trader profile.\n */\nexport type SocialHandles = {\n twitter?: string | null;\n farcaster?: string | null;\n ens?: string | null;\n lens?: string | null;\n};\n\nexport const TradeStruct = structType({\n direction: enums(['buy', 'sell']),\n intent: enums(['enter', 'exit']),\n category: optional(string()),\n /** High-level trade classification. `null` when Clicker does not classify. */\n classification: optional(\n nullable(enums(['spot', 'perp', 'send', 'receive'])),\n ),\n /** Perp side for this fill. `null` for spot trades. */\n perpPositionType: optional(nullable(enums(['long', 'short']))),\n /** Leverage multiplier for perp trades (e.g. `5` for 5x). `null` for spot. */\n perpLeverage: optional(nullable(number())),\n tokenAmount: number(),\n usdCost: number(),\n /** Token market cap in USD at trade time. `null` when Clicker has no mark. */\n marketCap: optional(nullable(number())),\n timestamp: number(),\n transactionHash: string(),\n});\n\nexport type Trade = Infer<typeof TradeStruct>;\n\n// ---------------------------------------------------------------------------\n// Leaderboard\n// ---------------------------------------------------------------------------\n\n/**\n * A single entry in the leaderboard response.\n */\nexport type LeaderboardEntry = {\n rank: number;\n addresses: string[];\n profileId: string;\n name: string;\n imageUrl?: string | null;\n pnl30d: number;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n pnlPerChain: Record<string, number>;\n followerCount: number;\n socialHandles: SocialHandles;\n};\n\n/**\n * Response from `GET /v1/leaderboard`.\n */\nexport type LeaderboardResponse = {\n traders: LeaderboardEntry[];\n};\n\n// ---------------------------------------------------------------------------\n// Trader profile\n// ---------------------------------------------------------------------------\n\nexport type TraderProfile = {\n profileId: string;\n address: string;\n allAddresses: string[];\n name: string;\n imageUrl?: string | null;\n};\n\nexport type TraderStats = {\n pnl30d?: number | null;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n /** Median holding time in minutes. */\n medianHoldMinutes?: number | null;\n};\n\nexport type PerChainBreakdown = {\n perChainPnl: Record<string, number>;\n /** ROI can be null for chains with no trading activity (zero cost-basis). */\n perChainRoi: Record<string, number | null>;\n perChainVolume: Record<string, number>;\n /**\n * 7-day per-chain PnL in USD. Optional: older social-api versions only\n * return the 30-day breakdown (`perChainPnl`). The unsuffixed fields above\n * remain the 30-day window for backward compatibility.\n */\n perChainPnl7d?: Record<string, number>;\n /** 7-day per-chain ROI. Null for chains with no trading activity. */\n perChainRoi7d?: Record<string, number | null>;\n /** 7-day per-chain volume in USD. */\n perChainVolume7d?: Record<string, number>;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/profile`.\n */\nexport type TraderProfileResponse = {\n profile: TraderProfile;\n stats: TraderStats;\n perChainBreakdown: PerChainBreakdown;\n socialHandles: SocialHandles;\n followerCount: number;\n followingCount: number;\n};\n\n// ---------------------------------------------------------------------------\n// Positions\n// ---------------------------------------------------------------------------\n\nexport type Position = {\n positionId: string;\n tokenSymbol: string;\n tokenName: string;\n tokenAddress: string;\n chain: string;\n positionAmount: number;\n boughtUsd: number;\n soldUsd: number;\n realizedPnl: number;\n costBasis: number;\n trades: Trade[];\n lastTradeAt: number;\n /** Daylight-hosted token image URL. */\n tokenImageUrl?: string | null;\n /** Current USD value of the remaining position (open positions only). */\n currentValueUSD?: number | null;\n /** Unrealized + realized PnL in USD. */\n pnlValueUsd?: number | null;\n /** PnL as a percentage of cost basis. */\n pnlPercent?: number | null;\n /** Perp side of the position. `null`/absent for spot positions. */\n perpPositionType?: 'long' | 'short' | null;\n /** Leverage multiplier for perp positions. `null`/absent for spot. */\n perpLeverage?: number | null;\n /**\n * Leveraged/notional position size as reported by Clicker. NOT necessarily\n * `positionAmount` × `perpLeverage` — the ratio varies for positions built\n * across fills at different leverage, so use this field directly rather than\n * deriving it, and treat `perpLeverage` as the authoritative leverage. This is\n * notional exposure, not capital at risk (the margin/capital at risk is\n * `costBasis`). Hyperliquid/perp positions only; absent for spot.\n */\n positionAmountWithLeverage?: number | null;\n};\n\nexport type Pagination = {\n hasMore: boolean;\n nextPage?: number;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/positions/open`\n * and `GET /v1/traders/:addressOrId/positions/closed`.\n */\nexport type PositionsResponse = {\n positions: Position[];\n pagination: Pagination;\n /** ISO 8601 timestamp indicating when the response was computed server-side. */\n computedAt?: string | null;\n};\n\n// ---------------------------------------------------------------------------\n// Feed\n// ---------------------------------------------------------------------------\n\n/**\n * A single trader-activity feed item: a {@link Position} the trade belongs to,\n * plus the {@link ProfileSummary} of the trader who made it (`actor`) and the\n * item's creation `timestamp` (Unix seconds).\n */\nexport type FeedItem = Position & {\n /** The trader who made this trade. */\n actor: ProfileSummary;\n /** Unix timestamp (seconds) when the feed item was created. */\n timestamp: number;\n};\n\n/**\n * Cursor pagination for the feed. Pass `olderCursor` back as `olderThan` to\n * load older items (infinite scroll), and `newerCursor` as `newerThan` to\n * fetch newer items. `null` when there are no items in that direction.\n */\nexport type FeedPagination = {\n olderCursor: string | null;\n newerCursor: string | null;\n};\n\n/**\n * Response from `GET /v1/feed`.\n */\nexport type FeedResponse = {\n items: FeedItem[];\n pagination: FeedPagination;\n};\n\n// ---------------------------------------------------------------------------\n// Followers\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/traders/:addressOrId/followers`.\n */\nexport type FollowersResponse = {\n followers: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Following\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/users/me/following`.\n */\nexport type FollowingResponse = {\n following: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Follow / Unfollow\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `PUT /v1/users/me/follows`.\n */\nexport type FollowResponse = {\n followed: ProfileSummary[];\n};\n\n/**\n * Response from `DELETE /v1/users/me/follows`.\n */\nexport type UnfollowResponse = {\n unfollowed: ProfileSummary[];\n};\n\n// ---------------------------------------------------------------------------\n// Fetch options\n// ---------------------------------------------------------------------------\n\nexport type FetchLeaderboardOptions = {\n sort?: 'pnl' | 'winRate' | 'roi';\n chains?: string[];\n limit?: number;\n};\n\nexport type FetchTraderProfileOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionsOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n chain?: string;\n sort?: 'value' | 'latest';\n limit?: number;\n page?: number;\n};\n\nexport type FetchFollowersOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchFeedOptions = {\n /**\n * Which feed to fetch: `following` (personalized to the current user,\n * identified server-side from the JWT) or `leaderboard` (generic, shared by\n * all users). Defaults to `following` server-side when omitted.\n */\n scope?: 'following' | 'leaderboard';\n /**\n * Filter by one or more chains, given as CAIP-2 chain ids (e.g.\n * `eip155:8453`). Omit for the server defaults.\n */\n chains?: string[];\n /** Number of results to return. */\n limit?: number;\n /** Cursor for older items (infinite scroll). Use `pagination.olderCursor`. */\n olderThan?: string;\n /** Cursor for newer items (pull to refresh). Use `pagination.newerCursor`. */\n newerThan?: string;\n};\n\nexport type FetchPositionByIdOptions = {\n /** Unique position ID (UUID). */\n positionId: string;\n};\n\nexport type FollowOptions = {\n /** Array of wallet addresses or profile IDs to follow. */\n targets: string[];\n};\n\nexport type UnfollowOptions = {\n /** Array of wallet addresses or profile IDs to unfollow. */\n targets: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Controller state\n// ---------------------------------------------------------------------------\n\n/**\n * State managed by the SocialController.\n *\n * The controller acts as a simple store — no TTL or eviction logic.\n * The UI decides when to re-fetch; the social-api's own cache layer\n * handles upstream rate-limiting.\n */\nexport type SocialControllerState = {\n /** Cached ranked trader list from the last `updateLeaderboard` call. */\n leaderboardEntries: LeaderboardEntry[];\n /** Wallet addresses the current user follows. */\n followingAddresses: string[];\n /** Clicker profile IDs the current user follows — used by mobile UI. */\n followingProfileIds: string[];\n};\n"]}
@@ -32,6 +32,7 @@ export declare const TradeStruct: import("@metamask/superstruct").Struct<{
32
32
  classification?: "spot" | "perp" | "send" | "receive" | null | undefined;
33
33
  perpPositionType?: "long" | "short" | null | undefined;
34
34
  perpLeverage?: number | null | undefined;
35
+ marketCap?: number | null | undefined;
35
36
  }, {
36
37
  direction: import("@metamask/superstruct").Struct<"buy" | "sell", {
37
38
  buy: "buy";
@@ -58,6 +59,8 @@ export declare const TradeStruct: import("@metamask/superstruct").Struct<{
58
59
  perpLeverage: import("@metamask/superstruct").Struct<number | null | undefined, null>;
59
60
  tokenAmount: import("@metamask/superstruct").Struct<number, null>;
60
61
  usdCost: import("@metamask/superstruct").Struct<number, null>;
62
+ /** Token market cap in USD at trade time. `null` when Clicker has no mark. */
63
+ marketCap: import("@metamask/superstruct").Struct<number | null | undefined, null>;
61
64
  timestamp: import("@metamask/superstruct").Struct<number, null>;
62
65
  transactionHash: import("@metamask/superstruct").Struct<string, null>;
63
66
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"social-types.d.cts","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAcnD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;IAItB,8EAA8E;;;;;;;IAI9E,uDAAuD;;;;;IAEvD,8EAA8E;;;;;;EAM9E,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAM9C;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,I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,iDAAiD;IACjD,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,wEAAwE;IACxE,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B,CAAC"}
@@ -32,6 +32,7 @@ export declare const TradeStruct: import("@metamask/superstruct").Struct<{
32
32
  classification?: "spot" | "perp" | "send" | "receive" | null | undefined;
33
33
  perpPositionType?: "long" | "short" | null | undefined;
34
34
  perpLeverage?: number | null | undefined;
35
+ marketCap?: number | null | undefined;
35
36
  }, {
36
37
  direction: import("@metamask/superstruct").Struct<"buy" | "sell", {
37
38
  buy: "buy";
@@ -58,6 +59,8 @@ export declare const TradeStruct: import("@metamask/superstruct").Struct<{
58
59
  perpLeverage: import("@metamask/superstruct").Struct<number | null | undefined, null>;
59
60
  tokenAmount: import("@metamask/superstruct").Struct<number, null>;
60
61
  usdCost: import("@metamask/superstruct").Struct<number, null>;
62
+ /** Token market cap in USD at trade time. `null` when Clicker has no mark. */
63
+ marketCap: import("@metamask/superstruct").Struct<number | null | undefined, null>;
61
64
  timestamp: import("@metamask/superstruct").Struct<number, null>;
62
65
  transactionHash: import("@metamask/superstruct").Struct<string, null>;
63
66
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"social-types.d.mts","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAcnD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG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AAwB,GAAG;IACrC,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,0DAA0D;IAC1D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,4DAA4D;IAC5D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAMF;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,wEAAwE;IACxE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC;IACvC,iDAAiD;IACjD,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,wEAAwE;IACxE,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B,CAAC"}
@@ -11,6 +11,8 @@ export const TradeStruct = structType({
11
11
  perpLeverage: optional(nullable(number())),
12
12
  tokenAmount: number(),
13
13
  usdCost: number(),
14
+ /** Token market cap in USD at trade time. `null` when Clicker has no mark. */
15
+ marketCap: optional(nullable(number())),
14
16
  timestamp: number(),
15
17
  transactionHash: string(),
16
18
  });
@@ -1 +1 @@
1
- {"version":3,"file":"social-types.mjs","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAI,IAAI,UAAU,EACnB,8BAA8B;AA8B/B,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;IACpC,SAAS,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC5B,8EAA8E;IAC9E,cAAc,EAAE,QAAQ,CACtB,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CACrD;IACD,uDAAuD;IACvD,gBAAgB,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,8EAA8E;IAC9E,YAAY,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,MAAM,EAAE;IACrB,OAAO,EAAE,MAAM,EAAE;IACjB,SAAS,EAAE,MAAM,EAAE;IACnB,eAAe,EAAE,MAAM,EAAE;CAC1B,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n enums,\n nullable,\n number,\n optional,\n string,\n type as structType,\n} from '@metamask/superstruct';\n\n// ---------------------------------------------------------------------------\n// Shared sub-types\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal profile summary used across follow/follower responses.\n */\nexport type ProfileSummary = {\n /** Clicker profile ID (UUID). */\n profileId: string;\n /** Primary wallet address. */\n address: string;\n /** Display name or truncated address. */\n name: string;\n /** Profile avatar URL. */\n imageUrl?: string | null;\n};\n\n/**\n * Social media handles attached to a trader profile.\n */\nexport type SocialHandles = {\n twitter?: string | null;\n farcaster?: string | null;\n ens?: string | null;\n lens?: string | null;\n};\n\nexport const TradeStruct = structType({\n direction: enums(['buy', 'sell']),\n intent: enums(['enter', 'exit']),\n category: optional(string()),\n /** High-level trade classification. `null` when Clicker does not classify. */\n classification: optional(\n nullable(enums(['spot', 'perp', 'send', 'receive'])),\n ),\n /** Perp side for this fill. `null` for spot trades. */\n perpPositionType: optional(nullable(enums(['long', 'short']))),\n /** Leverage multiplier for perp trades (e.g. `5` for 5x). `null` for spot. */\n perpLeverage: optional(nullable(number())),\n tokenAmount: number(),\n usdCost: number(),\n timestamp: number(),\n transactionHash: string(),\n});\n\nexport type Trade = Infer<typeof TradeStruct>;\n\n// ---------------------------------------------------------------------------\n// Leaderboard\n// ---------------------------------------------------------------------------\n\n/**\n * A single entry in the leaderboard response.\n */\nexport type LeaderboardEntry = {\n rank: number;\n addresses: string[];\n profileId: string;\n name: string;\n imageUrl?: string | null;\n pnl30d: number;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n pnlPerChain: Record<string, number>;\n followerCount: number;\n socialHandles: SocialHandles;\n};\n\n/**\n * Response from `GET /v1/leaderboard`.\n */\nexport type LeaderboardResponse = {\n traders: LeaderboardEntry[];\n};\n\n// ---------------------------------------------------------------------------\n// Trader profile\n// ---------------------------------------------------------------------------\n\nexport type TraderProfile = {\n profileId: string;\n address: string;\n allAddresses: string[];\n name: string;\n imageUrl?: string | null;\n};\n\nexport type TraderStats = {\n pnl30d?: number | null;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n /** Median holding time in minutes. */\n medianHoldMinutes?: number | null;\n};\n\nexport type PerChainBreakdown = {\n perChainPnl: Record<string, number>;\n /** ROI can be null for chains with no trading activity (zero cost-basis). */\n perChainRoi: Record<string, number | null>;\n perChainVolume: Record<string, number>;\n /**\n * 7-day per-chain PnL in USD. Optional: older social-api versions only\n * return the 30-day breakdown (`perChainPnl`). The unsuffixed fields above\n * remain the 30-day window for backward compatibility.\n */\n perChainPnl7d?: Record<string, number>;\n /** 7-day per-chain ROI. Null for chains with no trading activity. */\n perChainRoi7d?: Record<string, number | null>;\n /** 7-day per-chain volume in USD. */\n perChainVolume7d?: Record<string, number>;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/profile`.\n */\nexport type TraderProfileResponse = {\n profile: TraderProfile;\n stats: TraderStats;\n perChainBreakdown: PerChainBreakdown;\n socialHandles: SocialHandles;\n followerCount: number;\n followingCount: number;\n};\n\n// ---------------------------------------------------------------------------\n// Positions\n// ---------------------------------------------------------------------------\n\nexport type Position = {\n positionId: string;\n tokenSymbol: string;\n tokenName: string;\n tokenAddress: string;\n chain: string;\n positionAmount: number;\n boughtUsd: number;\n soldUsd: number;\n realizedPnl: number;\n costBasis: number;\n trades: Trade[];\n lastTradeAt: number;\n /** Daylight-hosted token image URL. */\n tokenImageUrl?: string | null;\n /** Current USD value of the remaining position (open positions only). */\n currentValueUSD?: number | null;\n /** Unrealized + realized PnL in USD. */\n pnlValueUsd?: number | null;\n /** PnL as a percentage of cost basis. */\n pnlPercent?: number | null;\n /** Perp side of the position. `null`/absent for spot positions. */\n perpPositionType?: 'long' | 'short' | null;\n /** Leverage multiplier for perp positions. `null`/absent for spot. */\n perpLeverage?: number | null;\n /**\n * Leveraged/notional position size as reported by Clicker. NOT necessarily\n * `positionAmount` × `perpLeverage` — the ratio varies for positions built\n * across fills at different leverage, so use this field directly rather than\n * deriving it, and treat `perpLeverage` as the authoritative leverage. This is\n * notional exposure, not capital at risk (the margin/capital at risk is\n * `costBasis`). Hyperliquid/perp positions only; absent for spot.\n */\n positionAmountWithLeverage?: number | null;\n};\n\nexport type Pagination = {\n hasMore: boolean;\n nextPage?: number;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/positions/open`\n * and `GET /v1/traders/:addressOrId/positions/closed`.\n */\nexport type PositionsResponse = {\n positions: Position[];\n pagination: Pagination;\n /** ISO 8601 timestamp indicating when the response was computed server-side. */\n computedAt?: string | null;\n};\n\n// ---------------------------------------------------------------------------\n// Feed\n// ---------------------------------------------------------------------------\n\n/**\n * A single trader-activity feed item: a {@link Position} the trade belongs to,\n * plus the {@link ProfileSummary} of the trader who made it (`actor`) and the\n * item's creation `timestamp` (Unix seconds).\n */\nexport type FeedItem = Position & {\n /** The trader who made this trade. */\n actor: ProfileSummary;\n /** Unix timestamp (seconds) when the feed item was created. */\n timestamp: number;\n};\n\n/**\n * Cursor pagination for the feed. Pass `olderCursor` back as `olderThan` to\n * load older items (infinite scroll), and `newerCursor` as `newerThan` to\n * fetch newer items. `null` when there are no items in that direction.\n */\nexport type FeedPagination = {\n olderCursor: string | null;\n newerCursor: string | null;\n};\n\n/**\n * Response from `GET /v1/feed`.\n */\nexport type FeedResponse = {\n items: FeedItem[];\n pagination: FeedPagination;\n};\n\n// ---------------------------------------------------------------------------\n// Followers\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/traders/:addressOrId/followers`.\n */\nexport type FollowersResponse = {\n followers: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Following\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/users/me/following`.\n */\nexport type FollowingResponse = {\n following: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Follow / Unfollow\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `PUT /v1/users/me/follows`.\n */\nexport type FollowResponse = {\n followed: ProfileSummary[];\n};\n\n/**\n * Response from `DELETE /v1/users/me/follows`.\n */\nexport type UnfollowResponse = {\n unfollowed: ProfileSummary[];\n};\n\n// ---------------------------------------------------------------------------\n// Fetch options\n// ---------------------------------------------------------------------------\n\nexport type FetchLeaderboardOptions = {\n sort?: 'pnl' | 'winRate' | 'roi';\n chains?: string[];\n limit?: number;\n};\n\nexport type FetchTraderProfileOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionsOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n chain?: string;\n sort?: 'value' | 'latest';\n limit?: number;\n page?: number;\n};\n\nexport type FetchFollowersOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchFeedOptions = {\n /**\n * Which feed to fetch: `following` (personalized to the current user,\n * identified server-side from the JWT) or `leaderboard` (generic, shared by\n * all users). Defaults to `following` server-side when omitted.\n */\n scope?: 'following' | 'leaderboard';\n /**\n * Filter by one or more chains, given as CAIP-2 chain ids (e.g.\n * `eip155:8453`). Omit for the server defaults.\n */\n chains?: string[];\n /** Number of results to return. */\n limit?: number;\n /** Cursor for older items (infinite scroll). Use `pagination.olderCursor`. */\n olderThan?: string;\n /** Cursor for newer items (pull to refresh). Use `pagination.newerCursor`. */\n newerThan?: string;\n};\n\nexport type FetchPositionByIdOptions = {\n /** Unique position ID (UUID). */\n positionId: string;\n};\n\nexport type FollowOptions = {\n /** Array of wallet addresses or profile IDs to follow. */\n targets: string[];\n};\n\nexport type UnfollowOptions = {\n /** Array of wallet addresses or profile IDs to unfollow. */\n targets: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Controller state\n// ---------------------------------------------------------------------------\n\n/**\n * State managed by the SocialController.\n *\n * The controller acts as a simple store — no TTL or eviction logic.\n * The UI decides when to re-fetch; the social-api's own cache layer\n * handles upstream rate-limiting.\n */\nexport type SocialControllerState = {\n /** Cached ranked trader list from the last `updateLeaderboard` call. */\n leaderboardEntries: LeaderboardEntry[];\n /** Wallet addresses the current user follows. */\n followingAddresses: string[];\n /** Clicker profile IDs the current user follows — used by mobile UI. */\n followingProfileIds: string[];\n};\n"]}
1
+ {"version":3,"file":"social-types.mjs","sourceRoot":"","sources":["../src/social-types.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAI,IAAI,UAAU,EACnB,8BAA8B;AA8B/B,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;IACpC,SAAS,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC5B,8EAA8E;IAC9E,cAAc,EAAE,QAAQ,CACtB,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CACrD;IACD,uDAAuD;IACvD,gBAAgB,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,8EAA8E;IAC9E,YAAY,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,MAAM,EAAE;IACrB,OAAO,EAAE,MAAM,EAAE;IACjB,8EAA8E;IAC9E,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,SAAS,EAAE,MAAM,EAAE;IACnB,eAAe,EAAE,MAAM,EAAE;CAC1B,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n enums,\n nullable,\n number,\n optional,\n string,\n type as structType,\n} from '@metamask/superstruct';\n\n// ---------------------------------------------------------------------------\n// Shared sub-types\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal profile summary used across follow/follower responses.\n */\nexport type ProfileSummary = {\n /** Clicker profile ID (UUID). */\n profileId: string;\n /** Primary wallet address. */\n address: string;\n /** Display name or truncated address. */\n name: string;\n /** Profile avatar URL. */\n imageUrl?: string | null;\n};\n\n/**\n * Social media handles attached to a trader profile.\n */\nexport type SocialHandles = {\n twitter?: string | null;\n farcaster?: string | null;\n ens?: string | null;\n lens?: string | null;\n};\n\nexport const TradeStruct = structType({\n direction: enums(['buy', 'sell']),\n intent: enums(['enter', 'exit']),\n category: optional(string()),\n /** High-level trade classification. `null` when Clicker does not classify. */\n classification: optional(\n nullable(enums(['spot', 'perp', 'send', 'receive'])),\n ),\n /** Perp side for this fill. `null` for spot trades. */\n perpPositionType: optional(nullable(enums(['long', 'short']))),\n /** Leverage multiplier for perp trades (e.g. `5` for 5x). `null` for spot. */\n perpLeverage: optional(nullable(number())),\n tokenAmount: number(),\n usdCost: number(),\n /** Token market cap in USD at trade time. `null` when Clicker has no mark. */\n marketCap: optional(nullable(number())),\n timestamp: number(),\n transactionHash: string(),\n});\n\nexport type Trade = Infer<typeof TradeStruct>;\n\n// ---------------------------------------------------------------------------\n// Leaderboard\n// ---------------------------------------------------------------------------\n\n/**\n * A single entry in the leaderboard response.\n */\nexport type LeaderboardEntry = {\n rank: number;\n addresses: string[];\n profileId: string;\n name: string;\n imageUrl?: string | null;\n pnl30d: number;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n pnlPerChain: Record<string, number>;\n followerCount: number;\n socialHandles: SocialHandles;\n};\n\n/**\n * Response from `GET /v1/leaderboard`.\n */\nexport type LeaderboardResponse = {\n traders: LeaderboardEntry[];\n};\n\n// ---------------------------------------------------------------------------\n// Trader profile\n// ---------------------------------------------------------------------------\n\nexport type TraderProfile = {\n profileId: string;\n address: string;\n allAddresses: string[];\n name: string;\n imageUrl?: string | null;\n};\n\nexport type TraderStats = {\n pnl30d?: number | null;\n winRate30d?: number | null;\n /** Renamed from roi30d. */\n roiPercent30d?: number | null;\n /** Renamed from tradeCount. */\n tradeCount30d?: number | null;\n pnl7d?: number | null;\n winRate7d?: number | null;\n roiPercent7d?: number | null;\n tradeCount7d?: number | null;\n /** Median holding time in minutes. */\n medianHoldMinutes?: number | null;\n};\n\nexport type PerChainBreakdown = {\n perChainPnl: Record<string, number>;\n /** ROI can be null for chains with no trading activity (zero cost-basis). */\n perChainRoi: Record<string, number | null>;\n perChainVolume: Record<string, number>;\n /**\n * 7-day per-chain PnL in USD. Optional: older social-api versions only\n * return the 30-day breakdown (`perChainPnl`). The unsuffixed fields above\n * remain the 30-day window for backward compatibility.\n */\n perChainPnl7d?: Record<string, number>;\n /** 7-day per-chain ROI. Null for chains with no trading activity. */\n perChainRoi7d?: Record<string, number | null>;\n /** 7-day per-chain volume in USD. */\n perChainVolume7d?: Record<string, number>;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/profile`.\n */\nexport type TraderProfileResponse = {\n profile: TraderProfile;\n stats: TraderStats;\n perChainBreakdown: PerChainBreakdown;\n socialHandles: SocialHandles;\n followerCount: number;\n followingCount: number;\n};\n\n// ---------------------------------------------------------------------------\n// Positions\n// ---------------------------------------------------------------------------\n\nexport type Position = {\n positionId: string;\n tokenSymbol: string;\n tokenName: string;\n tokenAddress: string;\n chain: string;\n positionAmount: number;\n boughtUsd: number;\n soldUsd: number;\n realizedPnl: number;\n costBasis: number;\n trades: Trade[];\n lastTradeAt: number;\n /** Daylight-hosted token image URL. */\n tokenImageUrl?: string | null;\n /** Current USD value of the remaining position (open positions only). */\n currentValueUSD?: number | null;\n /** Unrealized + realized PnL in USD. */\n pnlValueUsd?: number | null;\n /** PnL as a percentage of cost basis. */\n pnlPercent?: number | null;\n /** Perp side of the position. `null`/absent for spot positions. */\n perpPositionType?: 'long' | 'short' | null;\n /** Leverage multiplier for perp positions. `null`/absent for spot. */\n perpLeverage?: number | null;\n /**\n * Leveraged/notional position size as reported by Clicker. NOT necessarily\n * `positionAmount` × `perpLeverage` — the ratio varies for positions built\n * across fills at different leverage, so use this field directly rather than\n * deriving it, and treat `perpLeverage` as the authoritative leverage. This is\n * notional exposure, not capital at risk (the margin/capital at risk is\n * `costBasis`). Hyperliquid/perp positions only; absent for spot.\n */\n positionAmountWithLeverage?: number | null;\n};\n\nexport type Pagination = {\n hasMore: boolean;\n nextPage?: number;\n};\n\n/**\n * Response from `GET /v1/traders/:addressOrId/positions/open`\n * and `GET /v1/traders/:addressOrId/positions/closed`.\n */\nexport type PositionsResponse = {\n positions: Position[];\n pagination: Pagination;\n /** ISO 8601 timestamp indicating when the response was computed server-side. */\n computedAt?: string | null;\n};\n\n// ---------------------------------------------------------------------------\n// Feed\n// ---------------------------------------------------------------------------\n\n/**\n * A single trader-activity feed item: a {@link Position} the trade belongs to,\n * plus the {@link ProfileSummary} of the trader who made it (`actor`) and the\n * item's creation `timestamp` (Unix seconds).\n */\nexport type FeedItem = Position & {\n /** The trader who made this trade. */\n actor: ProfileSummary;\n /** Unix timestamp (seconds) when the feed item was created. */\n timestamp: number;\n};\n\n/**\n * Cursor pagination for the feed. Pass `olderCursor` back as `olderThan` to\n * load older items (infinite scroll), and `newerCursor` as `newerThan` to\n * fetch newer items. `null` when there are no items in that direction.\n */\nexport type FeedPagination = {\n olderCursor: string | null;\n newerCursor: string | null;\n};\n\n/**\n * Response from `GET /v1/feed`.\n */\nexport type FeedResponse = {\n items: FeedItem[];\n pagination: FeedPagination;\n};\n\n// ---------------------------------------------------------------------------\n// Followers\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/traders/:addressOrId/followers`.\n */\nexport type FollowersResponse = {\n followers: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Following\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `GET /v1/users/me/following`.\n */\nexport type FollowingResponse = {\n following: ProfileSummary[];\n count: number;\n};\n\n// ---------------------------------------------------------------------------\n// Follow / Unfollow\n// ---------------------------------------------------------------------------\n\n/**\n * Response from `PUT /v1/users/me/follows`.\n */\nexport type FollowResponse = {\n followed: ProfileSummary[];\n};\n\n/**\n * Response from `DELETE /v1/users/me/follows`.\n */\nexport type UnfollowResponse = {\n unfollowed: ProfileSummary[];\n};\n\n// ---------------------------------------------------------------------------\n// Fetch options\n// ---------------------------------------------------------------------------\n\nexport type FetchLeaderboardOptions = {\n sort?: 'pnl' | 'winRate' | 'roi';\n chains?: string[];\n limit?: number;\n};\n\nexport type FetchTraderProfileOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchPositionsOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n chain?: string;\n sort?: 'value' | 'latest';\n limit?: number;\n page?: number;\n};\n\nexport type FetchFollowersOptions = {\n /** Wallet address or Clicker profile ID. */\n addressOrId: string;\n};\n\nexport type FetchFeedOptions = {\n /**\n * Which feed to fetch: `following` (personalized to the current user,\n * identified server-side from the JWT) or `leaderboard` (generic, shared by\n * all users). Defaults to `following` server-side when omitted.\n */\n scope?: 'following' | 'leaderboard';\n /**\n * Filter by one or more chains, given as CAIP-2 chain ids (e.g.\n * `eip155:8453`). Omit for the server defaults.\n */\n chains?: string[];\n /** Number of results to return. */\n limit?: number;\n /** Cursor for older items (infinite scroll). Use `pagination.olderCursor`. */\n olderThan?: string;\n /** Cursor for newer items (pull to refresh). Use `pagination.newerCursor`. */\n newerThan?: string;\n};\n\nexport type FetchPositionByIdOptions = {\n /** Unique position ID (UUID). */\n positionId: string;\n};\n\nexport type FollowOptions = {\n /** Array of wallet addresses or profile IDs to follow. */\n targets: string[];\n};\n\nexport type UnfollowOptions = {\n /** Array of wallet addresses or profile IDs to unfollow. */\n targets: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Controller state\n// ---------------------------------------------------------------------------\n\n/**\n * State managed by the SocialController.\n *\n * The controller acts as a simple store — no TTL or eviction logic.\n * The UI decides when to re-fetch; the social-api's own cache layer\n * handles upstream rate-limiting.\n */\nexport type SocialControllerState = {\n /** Cached ranked trader list from the last `updateLeaderboard` call. */\n leaderboardEntries: LeaderboardEntry[];\n /** Wallet addresses the current user follows. */\n followingAddresses: string[];\n /** Clicker profile IDs the current user follows — used by mobile UI. */\n followingProfileIds: string[];\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/social-controllers",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "A collection of social related controllers",
5
5
  "keywords": [
6
6
  "Ethereum",
@@ -44,6 +44,8 @@
44
44
  "build:docs": "typedoc",
45
45
  "changelog:update": "../../scripts/update-changelog.sh @metamask/social-controllers",
46
46
  "changelog:validate": "../../scripts/validate-changelog.sh @metamask/social-controllers",
47
+ "lint:tsconfigs": "tsx ../../scripts/lint-tsconfigs/lint-tsconfigs.mts",
48
+ "lint:tsconfigs:fix": "tsx ../../scripts/lint-tsconfigs/lint-tsconfigs.mts --fix",
47
49
  "messenger-action-types:check": "tsx ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --check",
48
50
  "messenger-action-types:generate": "tsx ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --generate",
49
51
  "since-latest-release": "../../scripts/since-latest-release.sh",
@@ -63,10 +65,10 @@
63
65
  "devDependencies": {
64
66
  "@metamask/auto-changelog": "^6.1.0",
65
67
  "@ts-bridge/cli": "^0.6.4",
66
- "@types/jest": "^29.5.14",
68
+ "@types/jest": "^30.0.0",
67
69
  "deepmerge": "^4.2.2",
68
- "jest": "^29.7.0",
69
- "ts-jest": "^29.2.5",
70
+ "jest": "^30.4.2",
71
+ "ts-jest": "^29.4.11",
70
72
  "tsx": "^4.20.5",
71
73
  "typedoc": "^0.25.13",
72
74
  "typedoc-plugin-missing-exports": "^2.0.0",