UNPKG

@nekofar/warpcast

Version:

TypeScript client for interacting with Warpcast APIs

2,072 lines 151 kB
type ProfilePicture = { url?: string; verified?: boolean; }; type Bio = { text?: string; mentions?: Array<unknown>; channelMentions?: Array<unknown>; }; type Location = { placeId?: string; description?: string; }; type Profile = { bio?: Bio; location?: Location; }; type ViewerContext = { following?: boolean; followedBy?: boolean; enableNotifications?: boolean; canSendDirectCasts?: boolean; hasUploadedInboxKeys?: boolean; }; type User = { fid: number; username: string; displayName: string; pfp?: ProfilePicture; profile?: Profile; followerCount?: number; followingCount?: number; viewerContext?: ViewerContext; }; type OnboardingState = { id?: string; email?: string; user?: User; hasOnboarding?: boolean; hasConfirmedEmail?: boolean; handledConnectAddress?: boolean; canRegisterUsername?: boolean; needsRegistrationPayment?: boolean; hasFid?: boolean; hasFname?: boolean; hasDelegatedSigner?: boolean; hasSetupProfile?: boolean; hasCompletedRegistration?: boolean; hasStorage?: boolean; handledPushNotificationsNudge?: boolean; handledContactsNudge?: boolean; handledInterestsNudge?: boolean; hasValidPaidInvite?: boolean; hasWarpcastWalletAddress?: boolean; hasPhone?: boolean; needsPhone?: boolean; sponsoredRegisterEligible?: boolean; geoRestricted?: boolean; }; type OnboardingStateResponse = { result?: { state?: OnboardingState; }; }; type ErrorResponse = { errors?: Array<{ /** * Error message describing the issue */ message?: string; }>; }; type UserWithExtras = User & { connectedAccounts?: Array<unknown>; }; type UserExtras = { fid?: number; custodyAddress?: string; ethWallets?: Array<string>; solanaWallets?: Array<string>; walletLabels?: Array<{ address?: string; labels?: Array<string>; }>; v2?: boolean; publicSpamLabel?: string; }; type UserByFidResponse = { result?: { user?: UserWithExtras; collectionsOwned?: Array<unknown>; extras?: UserExtras; }; }; /** * Represents a single validation error */ type ValidationError = { /** * JSON Pointer to the part of the request that failed validation */ instancePath: string; /** * JSON Schema path that was violated */ schemaPath: string; /** * The JSON Schema keyword that failed */ keyword: string; /** * Additional parameters describing the validation error */ params?: { [key: string]: unknown; }; /** * Human-readable error description */ message: string; }; /** * Standard 400 Bad Request error response */ type BadRequestError = { /** * Array of validation errors */ errors: Array<ValidationError>; }; type DirectCastMessageReaction = { /** * Emoji used for the reaction */ reaction: string; /** * Number of users who reacted with this emoji */ count: number; /** * Emoji used for the reaction (legacy field) */ emoji?: string; /** * List of Farcaster IDs who reacted */ userFids?: Array<number>; }; type DirectCastMessageViewerContext = { /** * Whether this is the last read message */ isLastReadMessage?: boolean; /** * Whether the message is focused */ focused?: boolean; /** * User's reactions to this message */ reactions?: Array<string>; }; type DirectCastMessage = { /** * ID of the conversation this message belongs to */ conversationId: string; /** * Farcaster ID of the message sender */ senderFid: number; /** * Unique identifier for the message */ messageId: string; /** * Server timestamp when message was sent (Unix milliseconds) */ serverTimestamp: bigint; /** * Type of the message */ type: "text" | "image" | "reaction" | "link" | "group_membership_addition" | "pin_message" | "message_ttl_change"; /** * Content of the message */ message: string; /** * Whether the message contains mentions */ hasMention: boolean; /** * List of reactions to the message */ reactions: Array<DirectCastMessageReaction>; /** * Whether the message is pinned */ isPinned: boolean; /** * Whether the message is deleted */ isDeleted: boolean; senderContext: User; viewerContext?: DirectCastMessageViewerContext; inReplyTo?: DirectCastMessage; metadata?: DirectCastMessageMetadata; actionTargetUserContext?: User; /** * Whether the message was sent programmatically */ isProgrammatic?: boolean; /** * List of mentions in the message */ mentions?: Array<DirectCastMessageMention>; }; type DirectCastMessageMetadata = { /** * Cast metadata if message contains cast references */ casts?: Array<{ [key: string]: unknown; }>; /** * URL metadata if message contains links */ urls?: Array<{ [key: string]: unknown; }>; /** * Media metadata if message contains media */ medias?: Array<{ [key: string]: unknown; }>; }; type DirectCastMessageMention = { user: User; /** * Starting index of the mention in the message text */ textIndex: number; /** * Length of the mention text */ length: number; }; type DirectCastConversationViewerContext = { /** * Access level for the conversation */ access?: "read-write" | "read-only"; /** * Category of the conversation */ category?: string; /** * Whether the conversation is archived */ archived?: boolean; /** * Timestamp of last read (Unix milliseconds) */ lastReadAt?: bigint; /** * Whether the conversation is muted */ muted?: boolean; /** * Whether the conversation is manually marked as unread */ manuallyMarkedUnread?: boolean; /** * Whether the conversation is pinned */ pinned?: boolean; /** * Number of unread messages */ unreadCount?: number; /** * Number of unread mentions */ unreadMentionsCount?: number; /** * The other participant in a 1:1 conversation */ counterParty?: User; /** * Tag associated with the conversation */ tag?: string; }; type DirectCastConversation = { /** * Unique identifier for the conversation */ conversationId: string; /** * Name of the conversation (for group conversations) */ name?: string; /** * Description of the conversation */ description?: string; /** * URL of the conversation photo */ photoUrl?: string; /** * List of admin Farcaster IDs */ adminFids: Array<number>; /** * List of removed Farcaster IDs */ removedFids?: Array<number>; /** * List of conversation participants */ participants?: Array<User>; /** * Timestamp of last read time (Unix milliseconds) */ lastReadTime: bigint; /** * Timestamp of viewer's last read time (Unix milliseconds) */ selfLastReadTime?: bigint; /** * List of pinned messages in the conversation */ pinnedMessages?: Array<DirectCastMessage>; /** * Whether the conversation has pinned messages */ hasPinnedMessages?: boolean; /** * Whether this is a group conversation */ isGroup: boolean; /** * Whether the conversation is collection token gated */ isCollectionTokenGated?: boolean; /** * Number of active participants in the conversation */ activeParticipantsCount?: number; /** * Message time-to-live in days, or "Infinity" for no expiration */ messageTTLDays?: number | "Infinity"; /** * Timestamp when conversation was created (Unix milliseconds) */ createdAt: bigint; /** * Number of unread messages */ unreadCount?: number; /** * Whether the conversation is muted */ muted?: boolean; /** * Whether the conversation has mentions */ hasMention?: boolean; lastMessage?: DirectCastMessage; viewerContext: DirectCastConversationViewerContext; }; type DirectCastInboxResult = { /** * Whether user has archived conversations */ hasArchived: boolean; /** * Whether user has unread conversation requests */ hasUnreadRequests: boolean; /** * Total number of conversation requests */ requestsCount: number; conversations: Array<DirectCastConversation>; }; type PaginationCursor = { /** * Base64 encoded cursor for pagination */ cursor?: string; [key: string]: unknown | string | undefined; }; type DirectCastInboxResponse = { result: DirectCastInboxResult; next?: PaginationCursor; }; type CastAction = { id?: string; name?: string; octicon?: string; actionUrl?: string; action?: { actionType?: string; postUrl?: string; }; }; type UserAppContextResponse = { result?: { context?: { canAddLinks?: boolean; showConnectedApps?: boolean; signerRequestsEnabled?: boolean; prompts?: Array<unknown>; adminForChannelKeys?: Array<string>; modOfChannelKeys?: Array<string>; memberOfChannelKeys?: Array<string>; canEditAllChannels?: boolean; canUploadVideo?: boolean; statsigEnabled?: boolean; shouldPromptForPushNotifications?: boolean; shouldPromptForUserFollowsSyncContacts?: boolean; castActions?: Array<CastAction>; canAddCastAction?: boolean; enabledCastAction?: CastAction; notificationTabsV2?: Array<{ id?: string; name?: string; }>; enabledVideoAutoplay?: boolean; regularCastByteLimit?: number; longCastByteLimit?: number; newUserStatus?: { [key: string]: unknown; }; country?: string; higherClientEventSamplingRateEnabled?: boolean; }; }; }; type UserPreferencesResponse = { result?: { preferences?: { [key: string]: unknown; }; }; }; type Channel = { type?: string; key?: string; name?: string; imageUrl?: string; fastImageUrl?: string; feeds?: Array<{ name?: string; type?: string; }>; description?: string; followerCount?: number; memberCount?: number; showCastSourceLabels?: boolean; showCastTags?: boolean; sectionRank?: number; subscribable?: boolean; publicCasting?: boolean; inviteCode?: string; headerImageUrl?: string; headerAction?: { title?: string; target?: string; }; headerActionMetadata?: { [key: string]: unknown; }; viewerContext?: { following?: boolean; isMember?: boolean; hasUnseenItems?: boolean; favoritePosition?: number; activityRank?: number; canCast?: boolean; }; }; type HighlightedChannelsResponse = { result?: { channels?: Array<Channel>; viewerContext?: { defaultFeed?: string; }; }; }; type ImageEmbed = { type?: "image"; url?: string; sourceUrl?: string; media?: { version?: string; width?: number; height?: number; staticRaster?: string; mimeType?: string; }; alt?: string; }; type UrlEmbed = { type: "url"; openGraph: { url: string; sourceUrl?: string; title?: string; description?: string; domain?: string; image?: string; useLargeImage?: boolean; }; }; type VideoEmbed = { type?: "video"; }; type Recaster = { fid?: number; username?: string; displayName?: string; recastHash?: string; }; type Cast = { /** * Unique hash identifier for the cast */ hash: string; /** * Hash identifier for the thread this cast belongs to */ threadHash?: string; /** * Hash identifier of the parent cast (if this is a reply) */ parentHash?: string; parentSource?: { type?: "url"; url?: string; }; author: User; /** * The text content of the cast */ text: string; /** * Unix timestamp in milliseconds */ timestamp: bigint; mentions?: Array<User>; embeds?: { images?: Array<ImageEmbed>; urls?: Array<UrlEmbed>; videos?: Array<VideoEmbed>; unknowns?: Array<{ [key: string]: unknown; }>; processedCastText?: string; groupInvites?: Array<{ [key: string]: unknown; }>; }; replies: { count: number; }; reactions: { count: number; }; recasts: { count: number; recasters?: Array<Recaster>; }; watches: { count: number; }; recast?: boolean; tags?: Array<{ type?: string; id?: string; name?: string; imageUrl?: string; }>; quoteCount?: number; combinedRecastCount?: number; channel?: { key?: string; name?: string; imageUrl?: string; authorContext?: { role?: string; restricted?: boolean; banned?: boolean; }; authorRole?: string; }; viewerContext?: { reacted?: boolean; recast?: boolean; bookmarked?: boolean; }; }; type FeedItemsResponse = { result: { items: Array<{ id: string; timestamp: number; cast: Cast; otherParticipants?: Array<User>; }>; latestMainCastTimestamp?: number; feedTopSeenAtTimestamp?: number; replaceFeed: boolean; }; }; type GenericResponse = { result: { [key: string]: unknown; }; }; type UserResponse = GenericResponse & { result: { user?: UserWithExtras; collectionsOwned?: Array<{ [key: string]: unknown; }>; extras?: UserExtras; }; }; type PaginatedResponse = { result: { [key: string]: unknown; }; next?: PaginationCursor; }; type SuggestedUsersResponse = PaginatedResponse & { result?: { users?: Array<{ [key: string]: unknown; }>; }; }; type FavoriteFramesResponse = { result: { frames: Array<{ [key: string]: unknown; }>; }; }; type ChannelStreaksResponse = { result: { [key: string]: unknown; }; }; type UnseenCountsResponse = { result: { notificationsCount?: number; notificationTabs?: Array<{ tab: string; unseenCount: number; }>; inboxCount?: number; channelFeeds?: Array<{ channelKey: string; feedType: string; hasNewItems: boolean; }>; warpTransactionCount?: number; }; }; type UserThreadCastsResponse = { result: { casts: Array<{ [key: string]: unknown; }>; }; }; type ChannelFollowersYouKnowResponse = { result: { users: Array<{ [key: string]: unknown; }>; totalCount: number; }; }; type SuccessResponse = GenericResponse & { result?: { /** * Whether the operation was successful */ success: boolean; }; }; type NotificationsResponse = { result: { notifications?: Array<{ [key: string]: unknown; }>; }; }; type DirectCastConversationResponse = GenericResponse & { result?: { conversation: DirectCastConversation; }; }; type DirectCastConversationCategorizationRequest = { /** * ID of the conversation to categorize */ conversationId: string; /** * Category to assign to the conversation */ category: string; }; type DirectCastConversationMessagesResponse = PaginatedResponse & { result?: { messages: Array<DirectCastMessage>; }; }; type DirectCastConversationMessageTtlRequest = { /** * ID of the conversation to set message TTL for */ conversationId: string; /** * Time to live for messages in days */ ttl: number; }; type DirectCastConversationNotificationsRequest = { /** * ID of the conversation to update notification settings for */ conversationId: string; /** * Whether to mute notifications for this conversation */ muted: boolean; }; type DirectCastSendRequest = { /** * ID of the conversation to send the message to */ conversationId: string; /** * Array of Farcaster IDs of message recipients */ recipientFids: Array<number>; /** * Unique identifier for the message */ messageId: string; /** * Type of the message */ type: "text" | "image" | "reaction" | "link"; /** * Content of the message */ message: string; /** * ID of the message this is replying to (optional) */ inReplyToId?: string; }; type DirectCastManuallyMarkUnreadRequest = { /** * ID of the conversation to mark as unread */ conversationId: string; }; type DirectCastMessageReactionRequest = { /** * ID of the conversation containing the message */ conversationId: string; /** * ID of the message to react to */ messageId: string; /** * Emoji reaction to add or remove */ reaction: string; }; type DirectCastPinConversationRequest = { /** * ID of the conversation to pin */ conversationId: string; }; type DiscoverChannelsResponse = GenericResponse & { result?: { channels?: Array<{ [key: string]: unknown; }>; }; }; type InvitesAvailableResponse = GenericResponse & { result?: { /** * Total number of invites allocated to the user */ allocatedInvitesCount: number; /** * Number of invites currently available to send */ availableInvitesCount: number; }; }; type SponsoredInvitesResponse = GenericResponse & { result?: { invites?: Array<{ [key: string]: unknown; }>; }; [key: string]: unknown | { invites?: Array<{ [key: string]: unknown; }>; } | undefined; }; type RewardsLeaderboardResponse = { result: { leaderboard: { type: string; users: Array<{ user?: { [key: string]: unknown; }; score?: number; rank?: number; }>; }; }; }; type RewardsScoresResponse = { result: { scores: Array<{ type?: string; user?: { [key: string]: unknown; }; allTimeScore?: number; currentPeriodScore?: number; previousPeriodScore?: number; }>; }; }; type RewardsMetadataResponse = { result: { metadata?: { type?: string; lastUpdateTimestamp?: number; currentPeriodStartTimestamp?: number; currentPeriodEndTimestamp?: number; tiers?: Array<{ [key: string]: unknown; }>; proportionalPayout?: { numWinners?: number; totalRewardCents?: number; }; }; }; }; type BookmarkedCast = { [key: string]: unknown; }; type BookmarkedCastsResponse = { result: { bookmarks?: Array<BookmarkedCast>; }; }; type StarterPack = { /** * Unique identifier for the starter pack */ id: string; creator?: User; /** * Display name of the starter pack */ name?: string; /** * Description of the starter pack */ description?: string; /** * URL for OG image preview */ openGraphImageUrl?: string; /** * Number of items in the starter pack */ itemCount?: number; /** * Items contained in the starter pack */ items?: Array<{ [key: string]: unknown; }>; /** * Labels/tags for the starter pack */ labels?: Array<string>; [key: string]: unknown | string | User | number | Array<{ [key: string]: unknown; }> | Array<string> | undefined; }; type StarterPacksResponse = { result: { starterPacks: Array<StarterPack>; }; }; type StarterPackResponse = { result: { starterPack: StarterPack; }; }; type StarterPackUpdateRequest = { /** * Unique identifier for the starter pack to update */ id: string; /** * Display name of the starter pack */ name: string; /** * Description of the starter pack */ description: string; /** * List of FIDs included in the starter pack */ fids: Array<number>; /** * Labels/tags for the starter pack */ labels: Array<string>; }; type StarterPackUsersResponse = { result: { users: Array<User>; }; }; type ChannelResponse = { result: { channel?: Channel; }; }; type ChannelUsersResponse = { result: { users?: Array<User>; }; }; type UsersResponse = { result: { users: Array<User>; }; }; type UsersWithCountResponse = { result: { users: Array<User>; totalCount: number; }; }; type FrameApp = { [key: string]: unknown; }; type FrameAppsResponse = { result?: { frames?: Array<FrameApp>; }; }; /** * Context information for the viewer */ type MiniAppViewerContext = { [key: string]: unknown; }; type MiniApp = { /** * The domain of the mini app */ domain?: string; /** * The name of the mini app */ name?: string; /** * URL to the mini app's icon */ iconUrl?: string; /** * The home URL of the mini app */ homeUrl?: string; author?: User; /** * Whether the mini app supports notifications */ supportsNotifications?: boolean; /** * Unique identifier for the mini app */ id?: string; /** * Short identifier for the mini app */ shortId?: string; /** * URL to the mini app's main image */ imageUrl?: string; /** * Title for the action button */ buttonTitle?: string; /** * URL to the splash screen image */ splashImageUrl?: string; /** * Background color for the splash screen */ splashBackgroundColor?: string; /** * URL for sharing casts */ castShareUrl?: string; /** * Subtitle of the mini app */ subtitle?: string; /** * Description of the mini app */ description?: string; /** * Tagline of the mini app */ tagline?: string; /** * URL to the hero image */ heroImageUrl?: string; /** * Primary category of the mini app */ primaryCategory?: string; /** * Tags associated with the mini app */ tags?: Array<string>; /** * URLs to screenshot images */ screenshotUrls?: Array<string>; /** * Whether the mini app should be indexed */ noindex?: boolean; /** * Open Graph title */ ogTitle?: string; /** * Open Graph description */ ogDescription?: string; /** * Open Graph image URL */ ogImageUrl?: string; /** * Required capabilities for the mini app */ requiredCapabilities?: Array<string>; /** * Required blockchain chains */ requiredChains?: Array<string>; viewerContext?: MiniAppViewerContext; }; type RankedMiniApp = { /** * Current rank of the mini app */ rank?: number; miniApp?: MiniApp; /** * Change in rank over the last 72 hours */ rank72hChange?: number; }; type TopMiniAppsResponse = { result?: { miniApps?: Array<RankedMiniApp>; next?: PaginationCursor; }; }; type VerifiedAddress = { fid?: number; address?: string; timestamp?: number; version?: string; protocol?: string; isPrimary?: boolean; labels?: Array<string>; }; type MutedKeywordProperties = { channels?: boolean; frames?: boolean; notifications?: boolean; }; type MutedKeyword = { keyword: string; properties: MutedKeywordProperties; }; type MutedKeywordsResponse = { success: boolean; result: { keywords: Array<string>; mutedKeywords: Array<MutedKeyword>; }; }; type CastHashResponse = { result: { castHash?: string; }; }; type AttachEmbedsResponse = { result: { [key: string]: unknown; }; }; type CastRecastersResponse = { result: { users?: Array<User>; }; }; type CastQuote = { hash?: string; threadHash?: string; parentSource?: { type?: string; url?: string; }; author?: User; text?: string; timestamp?: number; }; type CastQuotesResponse = { result: { quotes?: Array<CastQuote>; }; }; type UserResponseUserResponse = { result: { user: User; }; }; type SearchChannelsResponse = { result?: { channels?: Array<Channel>; }; }; type DraftsResponse = { result?: { drafts?: Array<unknown>; }; }; type DraftCast = { text?: string; embeds?: Array<unknown>; }; type Draft = { draftId?: string; casts?: Array<DraftCast>; }; type DraftCreatedResponse = { result?: { draft?: Draft; }; }; type CastCreatedResponse = { result?: { cast?: Cast; }; }; type RawChannel = { id?: string; url?: string; name?: string; description?: string; descriptionMentions?: Array<number>; descriptionMentionsPositions?: Array<number>; imageUrl?: string; headerImageUrl?: string; leadFid?: number; moderatorFids?: Array<number>; createdAt?: number; followerCount?: number; memberCount?: number; pinnedCastHash?: string; publicCasting?: boolean; externalLink?: { title?: string; url?: string; }; }; type ChannelListResponse = { result?: { channels?: Array<RawChannel>; }; }; type RawChannelResponse = { result?: { channel?: RawChannel; }; }; type ChannelFollower = { fid?: number; followedAt?: number; }; type ChannelFollowersResponse = PaginatedResponse & { result?: { users?: Array<ChannelFollower>; }; }; type ChannelFollowStatus = { following?: boolean; followedAt?: number; }; type ChannelFollowStatusResponse = { result?: ChannelFollowStatus; }; type Action = { name?: string; icon?: string; description?: string; aboutUrl?: string; imageUrl?: string; actionUrl?: string; action?: { actionType?: "post" | "get" | "put" | "delete"; postUrl?: string; }; }; type Winner = { /** * The fid of the winner */ fid?: number; /** * The domain of the winner */ domain?: string; /** * The name of the frame (mini app) */ frameName?: string; /** * The score of the winner */ score?: number; /** * The rank of the winner */ rank?: number; /** * The reward amount in cents */ rewardCents?: number; /** * The wallet address of the winner (optional) */ walletAddress?: string; }; type Frame = { domain?: string; name?: string; iconUrl?: string; homeUrl?: string; splashImageUrl?: string; splashBackgroundColor?: string; buttonTitle?: string | null; imageUrl?: string | null; supportsNotifications?: boolean; viewerContext?: { [key: string]: unknown; }; author?: User; }; type AppsByAuthorResponse = { result?: { frames?: Array<Frame>; }; }; type ApiKey = { /** * Unique identifier for the API key */ id: string; /** * Timestamp when the API key was created (in milliseconds since epoch) */ createdAt: bigint; /** * Timestamp when the API key expires (in milliseconds since epoch) */ expiresAt: bigint; /** * Timestamp when the API key was revoked, if applicable (in milliseconds since epoch) */ revokedAt?: string | null; /** * Short identifier tag for the API key */ tag: string; /** * User-provided description of the API key's purpose */ description: string; }; /** * Generic 400 Bad Request error for simple error messages */ type GenericBadRequestError = { errors: Array<{ /** * Error message describing the issue */ message: string; }>; }; type DirectCastSendResponse = SuccessResponse; type DirectCastConversationCategorizationResponse = SuccessResponse; type DirectCastConversationNotificationsResponse = SuccessResponse; type DirectCastConversationMessageTtlResponse = SuccessResponse; type DirectCastMessageReactionResponse = SuccessResponse; /** * The user's FID (Farcaster ID) */ type FidParam = number; /** * Maximum number of items to return */ type LimitParam = number; /** * Base64 encoded cursor for pagination */ type CursorParam = string; type GetUserOnboardingStateData = { body?: never; path?: never; query?: never; url: "/v2/onboarding-state"; }; type GetUserOnboardingStateErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetUserOnboardingStateError = GetUserOnboardingStateErrors[keyof GetUserOnboardingStateErrors]; type GetUserOnboardingStateResponses = { /** * Successful retrieval of onboarding state */ 200: OnboardingStateResponse; }; type GetUserOnboardingStateResponse = GetUserOnboardingStateResponses[keyof GetUserOnboardingStateResponses]; type GetUserByFidData = { body?: never; path?: never; query: { /** * The user's FID (Farcaster ID) */ fid: number; }; url: "/v2/user-by-fid"; }; type GetUserByFidErrors = { /** * Bad request - validation errors or malformed request */ 400: BadRequestError; /** * Authentication is required or failed */ 401: ErrorResponse; /** * The specified resource was not found */ 404: ErrorResponse; }; type GetUserByFidError = GetUserByFidErrors[keyof GetUserByFidErrors]; type GetUserByFidResponses = { /** * Successful retrieval of user by fid */ 200: UserByFidResponse; }; type GetUserByFidResponse = GetUserByFidResponses[keyof GetUserByFidResponses]; type GetDirectCastInboxData = { body?: never; path?: never; query?: { /** * Maximum number of items to return */ limit?: number; /** * Category of conversations to retrieve */ category?: "default" | "requests" | "spam"; /** * Filter for conversations (e.g., unread, all) */ filter?: "unread" | "group" | "1-1"; /** * Base64 encoded cursor from previous response */ cursor?: string; }; url: "/v2/direct-cast-inbox"; }; type GetDirectCastInboxErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetDirectCastInboxError = GetDirectCastInboxErrors[keyof GetDirectCastInboxErrors]; type GetDirectCastInboxResponses = { /** * Successful retrieval of direct cast inbox */ 200: DirectCastInboxResponse; }; type GetDirectCastInboxResponse = GetDirectCastInboxResponses[keyof GetDirectCastInboxResponses]; type GetUserAppContextData = { body?: never; path?: never; query?: never; url: "/v2/user-app-context"; }; type GetUserAppContextErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetUserAppContextError = GetUserAppContextErrors[keyof GetUserAppContextErrors]; type GetUserAppContextResponses = { /** * Successful retrieval of user app context */ 200: UserAppContextResponse; }; type GetUserAppContextResponse = GetUserAppContextResponses[keyof GetUserAppContextResponses]; type GetUserPreferencesData = { body?: never; path?: never; query?: never; url: "/v2/user-preferences"; }; type GetUserPreferencesErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetUserPreferencesError = GetUserPreferencesErrors[keyof GetUserPreferencesErrors]; type GetUserPreferencesResponses = { /** * Successful retrieval of user preferences */ 200: UserPreferencesResponse; }; type GetUserPreferencesResponse = GetUserPreferencesResponses[keyof GetUserPreferencesResponses]; type GetHighlightedChannelsData = { body?: never; path?: never; query?: never; url: "/v2/highlighted-channels"; }; type GetHighlightedChannelsErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetHighlightedChannelsError = GetHighlightedChannelsErrors[keyof GetHighlightedChannelsErrors]; type GetHighlightedChannelsResponses = { /** * Successful retrieval of highlighted channels */ 200: HighlightedChannelsResponse; }; type GetHighlightedChannelsResponse = GetHighlightedChannelsResponses[keyof GetHighlightedChannelsResponses]; type GetFeedItemsData = { body: { /** * Identifier for the specific feed */ feedKey: string; /** * Type of feed to retrieve */ feedType: string; /** * Only return items older than this timestamp (ms) */ olderThan?: bigint; /** * Latest main cast timestamp used for pagination (ms) */ latestMainCastTimestamp?: bigint; /** * List of item ID prefixes to exclude from the response */ excludeItemIdPrefixes?: Array<string>; /** * View events for casts */ castViewEvents?: Array<{ /** * Event timestamp in ms */ ts: bigint; /** * Cast hash */ hash: string; /** * Context of the view event */ on: string; /** * Channel key */ channel: string; /** * Feed type where event occurred */ feed: string; }>; /** * Whether to update the feed state */ updateState?: boolean; }; path?: never; query?: never; url: "/v2/feed-items"; }; type GetFeedItemsErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetFeedItemsError = GetFeedItemsErrors[keyof GetFeedItemsErrors]; type GetFeedItemsResponses = { /** * Successful retrieval of feed items */ 200: FeedItemsResponse; }; type GetFeedItemsResponse = GetFeedItemsResponses[keyof GetFeedItemsResponses]; type GetUserData = { body?: never; path?: never; query: { /** * The user's FID (Farcaster ID) */ fid: number; }; url: "/v2/user"; }; type GetUserErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; /** * The specified resource was not found */ 404: ErrorResponse; }; type GetUserError = GetUserErrors[keyof GetUserErrors]; type GetUserResponses = { /** * Successful retrieval of user information */ 200: UserResponse; }; type GetUserResponse = GetUserResponses[keyof GetUserResponses]; type GetUserFollowingChannelsData = { body?: never; path?: never; query?: { /** * Whether results are intended for the composer interface */ forComposer?: boolean; /** * Maximum number of items to return */ limit?: number; }; url: "/v2/user-following-channels"; }; type GetUserFollowingChannelsErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetUserFollowingChannelsError = GetUserFollowingChannelsErrors[keyof GetUserFollowingChannelsErrors]; type GetUserFollowingChannelsResponses = { /** * Successful retrieval of followed channels */ 200: HighlightedChannelsResponse; }; type GetUserFollowingChannelsResponse = GetUserFollowingChannelsResponses[keyof GetUserFollowingChannelsResponses]; type GetSuggestedUsersData = { body?: never; path?: never; query?: { /** * Maximum number of items to return */ limit?: number; randomized?: boolean; }; url: "/v2/suggested-users"; }; type GetSuggestedUsersErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetSuggestedUsersError = GetSuggestedUsersErrors[keyof GetSuggestedUsersErrors]; type GetSuggestedUsersResponses = { /** * Successful retrieval of suggested users */ 200: SuggestedUsersResponse; }; type GetSuggestedUsersResponse = GetSuggestedUsersResponses[keyof GetSuggestedUsersResponses]; type GetUserFavoriteFramesData = { body?: never; path?: never; query?: { /** * Maximum number of items to return */ limit?: number; }; url: "/v1/favorite-frames"; }; type GetUserFavoriteFramesErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetUserFavoriteFramesError = GetUserFavoriteFramesErrors[keyof GetUserFavoriteFramesErrors]; type GetUserFavoriteFramesResponses = { /** * Successful retrieval of favorite frames */ 200: FavoriteFramesResponse; }; type GetUserFavoriteFramesResponse = GetUserFavoriteFramesResponses[keyof GetUserFavoriteFramesResponses]; type GetUserByUsernameData = { body?: never; path?: never; query: { /** * The username to look up */ username: string; }; url: "/v2/user-by-username"; }; type GetUserByUsernameErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; /** * The specified resource was not found */ 404: ErrorResponse; }; type GetUserByUsernameError = GetUserByUsernameErrors[keyof GetUserByUsernameErrors]; type GetUserByUsernameResponses = { /** * Successful retrieval of user by username */ 200: UserByFidResponse; }; type GetUserByUsernameResponse = GetUserByUsernameResponses[keyof GetUserByUsernameResponses]; type GetChannelStreaksForUserData = { body?: never; path?: never; query: { fid: number; }; url: "/v2/channel-streaks"; }; type GetChannelStreaksForUserErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetChannelStreaksForUserError = GetChannelStreaksForUserErrors[keyof GetChannelStreaksForUserErrors]; type GetChannelStreaksForUserResponses = { /** * Successful retrieval of channel streaks */ 200: ChannelStreaksResponse; }; type GetChannelStreaksForUserResponse = GetChannelStreaksForUserResponses[keyof GetChannelStreaksForUserResponses]; type GetUnseenCountsData = { body?: never; path?: never; query?: never; url: "/v2/unseen"; }; type GetUnseenCountsErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetUnseenCountsError = GetUnseenCountsErrors[keyof GetUnseenCountsErrors]; type GetUnseenCountsResponses = { /** * Successful retrieval of unseen feed and notification data */ 200: UnseenCountsResponse; }; type GetUnseenCountsResponse = GetUnseenCountsResponses[keyof GetUnseenCountsResponses]; type GetUserThreadCastsData = { body?: never; path?: never; query: { /** * Maximum number of items to return */ limit?: number; /** * The hash prefix of the cast */ castHashPrefix: string; /** * The username of the user */ username: string; }; url: "/v2/user-thread-casts"; }; type GetUserThreadCastsErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetUserThreadCastsError = GetUserThreadCastsErrors[keyof GetUserThreadCastsErrors]; type GetUserThreadCastsResponses = { /** * Successful retrieval of user thread casts */ 200: UserThreadCastsResponse; }; type GetUserThreadCastsResponse = GetUserThreadCastsResponses[keyof GetUserThreadCastsResponses]; type GetChannelFollowersYouKnowData = { body?: never; path?: never; query: { channelKey: string; limit?: number; }; url: "/v2/channel-followers-you-know"; }; type GetChannelFollowersYouKnowErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type GetChannelFollowersYouKnowError = GetChannelFollowersYouKnowErrors[keyof GetChannelFollowersYouKnowErrors]; type GetChannelFollowersYouKnowResponses = { /** * Successful retrieval of known channel followers */ 200: ChannelFollowersYouKnowResponse; }; type GetChannelFollowersYouKnowResponse = GetChannelFollowersYouKnowResponses[keyof GetChannelFollowersYouKnowResponses]; type MarkAllNotificationsReadData = { body: { [key: string]: never; }; path?: never; query?: never; url: "/v2/mark-all-notifications-read"; }; type MarkAllNotificationsReadErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; }; type MarkAllNotificationsReadError = MarkAllNotificationsReadErrors[keyof MarkAllNotificationsReadErrors]; type MarkAllNotificationsReadResponses = { /** * Successful mark-all-read operation */ 200: SuccessResponse; }; type MarkAllNotificationsReadResponse = MarkAllNotificationsReadResponses[keyof MarkAllNotificationsReadResponses]; type GetNotificationsData = { body?: never; path?: never; query: { /** * Notification tab type */ tab: "all" | "follows" | "reactions" | "mentions" | "replies"; /** * Number of notifications to return */ limit?: number; }; url: "/v1/notifications-for-tab"; }; type GetNotificationsErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; /** * Too many requests */ 429: unknown; }; type GetNotificationsError = GetNotificationsErrors[keyof GetNotificationsErrors]; type GetNotificationsResponses = { /** * A list of notifications */ 200: NotificationsResponse; }; type GetNotificationsResponse = GetNotificationsResponses[keyof GetNotificationsResponses]; type SetLastCheckedTimestampData = { /** * Empty object for now */ body: { [key: string]: unknown; }; path?: never; query?: never; url: "/v2/set-last-checked-timestamp"; }; type SetLastCheckedTimestampErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; /** * Too many requests */ 429: unknown; }; type SetLastCheckedTimestampError = SetLastCheckedTimestampErrors[keyof SetLastCheckedTimestampErrors]; type SetLastCheckedTimestampResponses = { /** * Success */ 200: SuccessResponse; }; type SetLastCheckedTimestampResponse = SetLastCheckedTimestampResponses[keyof SetLastCheckedTimestampResponses]; type GetDirectCastConversationData = { body?: never; path?: never; query: { /** * Conversation ID. Format depends on conversation type: * - 1:1 conversations: "fid1-fid2" (e.g., "123-456") * - Group conversations: Hash format (e.g., "a1b2c3d4e5f6...") * */ conversationId: string; }; url: "/v2/direct-cast-conversation"; }; type GetDirectCastConversationErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; /** * Too many requests */ 429: unknown; }; type GetDirectCastConversationError = GetDirectCastConversationErrors[keyof GetDirectCastConversationErrors]; type GetDirectCastConversationResponses = { /** * A direct cast conversation object */ 200: DirectCastConversationResponse; }; type GetDirectCastConversationResponse = GetDirectCastConversationResponses[keyof GetDirectCastConversationResponses]; type CategorizeDirectCastConversationData = { body: DirectCastConversationCategorizationRequest; path?: never; query?: never; url: "/v2/direct-cast-conversation-categorization"; }; type CategorizeDirectCastConversationErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; /** * Too many requests */ 429: unknown; }; type CategorizeDirectCastConversationError = CategorizeDirectCastConversationErrors[keyof CategorizeDirectCastConversationErrors]; type CategorizeDirectCastConversationResponses = { /** * Conversation categorized successfully */ 200: SuccessResponse; }; type CategorizeDirectCastConversationResponse = CategorizeDirectCastConversationResponses[keyof CategorizeDirectCastConversationResponses]; type GetDirectCastConversationMessagesData = { body?: never; path?: never; query: { /** * Conversation ID. Format depends on conversation type: * - 1:1 conversations: "fid1-fid2" (e.g., "123-456") * - Group conversations: Hash format (e.g., "c9e139dcbc9423cf") * */ conversationId: string; /** * Maximum number of messages to return */ limit?: number; }; url: "/v2/direct-cast-conversation-messages"; }; type GetDirectCastConversationMessagesErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; /** * Too many requests */ 429: unknown; }; type GetDirectCastConversationMessagesError = GetDirectCastConversationMessagesErrors[keyof GetDirectCastConversationMessagesErrors]; type GetDirectCastConversationMessagesResponses = { /** * A list of direct cast conversation messages with pagination */ 200: DirectCastConversationMessagesResponse; }; type GetDirectCastConversationMessagesResponse = GetDirectCastConversationMessagesResponses[keyof GetDirectCastConversationMessagesResponses]; type SetDirectCastConversationMessageTtlData = { body: DirectCastConversationMessageTtlRequest; path?: never; query?: never; url: "/v2/direct-cast-conversation-message-ttl"; }; type SetDirectCastConversationMessageTtlErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; /** * Too many requests */ 429: unknown; }; type SetDirectCastConversationMessageTtlError = SetDirectCastConversationMessageTtlErrors[keyof SetDirectCastConversationMessageTtlErrors]; type SetDirectCastConversationMessageTtlResponses = { /** * Message TTL set successfully */ 200: SuccessResponse; }; type SetDirectCastConversationMessageTtlResponse = SetDirectCastConversationMessageTtlResponses[keyof SetDirectCastConversationMessageTtlResponses]; type UpdateDirectCastConversationNotificationsData = { body: DirectCastConversationNotificationsRequest; path?: never; query?: never; url: "/v2/direct-cast-conversation-notifications"; }; type UpdateDirectCastConversationNotificationsErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; /** * Too many requests */ 429: unknown; }; type UpdateDirectCastConversationNotificationsError = UpdateDirectCastConversationNotificationsErrors[keyof UpdateDirectCastConversationNotificationsErrors]; type UpdateDirectCastConversationNotificationsResponses = { /** * Notification settings updated successfully */ 200: SuccessResponse; }; type UpdateDirectCastConversationNotificationsResponse = UpdateDirectCastConversationNotificationsResponses[keyof UpdateDirectCastConversationNotificationsResponses]; type GetDirectCastConversationRecentMessagesData = { body?: never; path?: never; query: { /** * Conversation ID. Format depends on conversation type: * - 1:1 conversations: "fid1-fid2" (e.g., "123-456") * - Group conversations: Hash format (e.g., "c9e139dcbc9423cf") * */ conversationId: string; }; url: "/v2/direct-cast-conversation-recent-messages"; }; type GetDirectCastConversationRecentMessagesErrors = { /** * Authentication is required or failed */ 401: ErrorResponse; /** * Too many requests */ 429: unknown; }; type GetDirectCastConversationRecentMessagesError = GetDirectCastConversationRecentMessagesErrors[keyof GetDirectCastConversationRecentMessagesErrors]; type GetDirectCastConversationRecentMessagesResponses = { /** * A list of recent direct cast conversation messages */ 200: DirectCastConversationMessagesResponse; }; type GetDirectCastConversationRecentMessagesResponse = GetDirectCastConversationRecentMessagesResponses[keyof GetDirectCastConversationRecent