UNPKG

@neynar/nodejs-sdk

Version:

SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)

1,179 lines 161 kB
import { Logger } from "../common/logger"; import { AxiosError, AxiosInstance } from "axios"; import type { SetRequired } from "type-fest"; import { Configuration } from './configuration'; import type { AppHostEventType, AppHostGetEventResponse, AppHostPostEventBody, AppHostPostEventResponse, AppHostUserStateResponse, AuthorizationUrlResponse, AuthorizationUrlResponseType, BalanceResponse, BanListResponse, BanResponse, BlockListResponse, BulkCastsResponse, BulkFollowResponse, BulkUserAddressType, BulkUsersByAddressResponse, BulkUsersResponse, CastComposerActionsListResponse, CastComposerType, CastConversationSortType, CastEmbedCrawlResponse, CastParamType, CastResponse, CastsMetricsResponse, CastsResponse, CastsSearchResponse, ChannelListResponse, ChannelMemberInviteListResponse, ChannelMemberListResponse, ChannelMemberRole, ChannelResponse, ChannelResponseBulk, ChannelSearchResponse, ChannelType, Conversation, ConversationSummary, DeleteFrameResponse, DeployFungibleFactoryEnum, DeployFungibleMetadataNsfwEnum, DeployFungibleNetworkEnum, DeployFungibleResponse, DeveloperManagedSigner, EmbedType, ErrorRes, FarcasterActionReqBodyAction, FeedResponse, FeedTrendingProvider, FeedType, FetchBulkCastsSortTypeEnum, FetchCastMetricsIntervalEnum, FetchFrameCatalogCategoriesEnum, FetchFrameMetaTagsFromUrl200Response, FetchRelevantFrames200Response, FetchRepliesAndRecastsForUserFilterEnum, FetchTrendingChannelsTimeWindowEnum, FetchTrendingFeedTimeWindowEnum, FetchUserInteractions200Response, FilterType, FnameAvailabilityResponse, FollowSortType, FollowersResponse, ForYouProvider, Frame, FrameAction, FrameCatalogResponse, FrameNotificationTokens, FramePayTransactionRequestBody, FrameSignaturePacket, FrameType, FrameValidateAnalyticsResponse, FrameValidateListResponse, FungibleOwnerRelevantNetwork, GetNotificationCampaignStats200Response, LookupCastConversationFoldEnum, MiniAppTimeWindow, MuteListResponse, MuteResponse, Network, NeynarFrame, NeynarFramePage, NonceResponse, NotificationType, NotificationsResponse, OperationResponse, PostCastReqBodyEmbeds, PostCastResponse, ReactionType, ReactionsCastResponse, ReactionsResponse, ReactionsType, RegisterUserOnChainReqBodyPreRegistrationCallsInner, RegisterUserOnChainReqBodyRegistration, RegisterUserOnChainReqBodySignersInner, RegisterUserOnChainResponse, RegisterUserReqBodyMetadata, RegisterUserResponse, RelevantFollowersResponse, RelevantFungibleOwnersResponse, SearchCastsModeEnum, SearchSortType, SendFrameNotificationsReqBodyFilters, SendFrameNotificationsReqBodyNotification, SendFrameNotificationsResponse, SignedKeyRequestSponsor, Signer, SignerListResponse, StorageAllocationsResponse, StorageUsageResponse, SubscribedToResponse, SubscribersResponse, SubscriptionCheckResponse, SubscriptionProvider, SubscriptionProviders, SubscriptionsResponse, TransactionFrameResponse, TransactionSendFungiblesRequest, TransactionSendFungiblesResponse, TrendingChannelResponse, UpdateUserReqBodyLocation, UpdateUserReqBodyVerifiedAccounts, UserFIDResponse, UserPowerLiteResponse, UserResponse, UserSearchResponse, UsersActiveChannelsResponse, UsersResponse, ValidateFrameActionResponse, ValidateFrameAggregateWindow, ValidateFrameAnalyticsType, VerificationChainId, VerificationType, WebhookListResponse, WebhookPatchReqBodyActiveEnum, WebhookResponse, WebhookSubscriptionFilters } from '../api'; export interface NeynarAPIClientOptions { logger?: Logger; axiosInstance?: AxiosInstance; } export declare class NeynarAPIClient { private readonly logger; private config; private readonly apis; constructor(config: Configuration, options?: NeynarAPIClientOptions); static isApiErrorResponse(error: any): error is SetRequired<AxiosError<ErrorRes>, "response">; /** * Securely communicate and perform actions on behalf of users across different apps. It enables an app to send data or trigger actions in another app on behalf of a mutual user by signing messages using the user\'s Farcaster signer. * * @summary User actions across apps * * @param {object} params * @param {string} params.signerUuid - The signer_uuid of the user on behalf of whom the action is being performed. * @param {string} params.baseUrl - The base URL of the app on which the action is being performed. * @param {FarcasterActionReqBodyAction} params.action * * @returns {Promise<{ [key: string]: any; }>} A promise that resolves to a `{ [key: string]: any; }` object. * * @example * * // Fill in the appropriate values * const signerUuid = * const baseUrl = * const action = * * client.publishFarcasterAction({signerUuid, baseUrl, action}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/docs/farcaster-actions-spec) * */ publishFarcasterAction(params: { signerUuid: string; baseUrl: string; action: FarcasterActionReqBodyAction; }): Promise<{ [key: string]: any; }>; /** * Creates a new transaction pay mini app that can be used to collect payments through a mini app * * @summary Create transaction pay mini app * * @param {object} params * @param {FramePayTransactionRequestBody} params.framePayTransactionRequestBody * * @returns {Promise<TransactionFrameResponse>} A promise that resolves to a `TransactionFrameResponse` object. * * @example * * // Fill in the appropriate values * const framePayTransactionRequestBody = * * client.createTransactionPayFrame({ framePayTransactionRequestBody }).then(response => { * console.log('response:', response); * }); */ createTransactionPayFrame(params: { framePayTransactionRequestBody: FramePayTransactionRequestBody; }): Promise<TransactionFrameResponse>; /** * Returns a list of interactions between two users * * @summary User interactions * * @param {object} params * @param {number[]} params.fids - Comma separated list of two FIDs * @param {Array<NotificationType>} params.type [optional] - Comma seperated list of Interaction type to fetch * * @returns {Promise<FetchUserInteractions200Response>} A promise that resolves to a `FetchUserInteractions200Response` object. * * @example * * // Fill in the appropriate values * const fids = * const type = * * client.fetchUserInteractions({ fids, type }).then(response => { * console.log('response:', response); * }); */ fetchUserInteractions(params: { fids: number[]; type?: Array<NotificationType>; }): Promise<FetchUserInteractions200Response>; /** * Generates a summary of all casts related to a conversation surrounding a cast by passing in a cast hash or Farcaster URL. Summary is generated by an LLM and is intended to be passed as a context to AI agents. * * @summary Cast conversation summary * * @param {object} params * @param {string} params.identifier - Cast identifier (Its either a url or a hash) * @param {number} params.limit [optional] - Number of casts to consider in a summary up to a point of target cast (Default: 20, Maximum: 50) * @param {string} params.prompt [optional] - Additional prompt used to generate a summary * * @returns {Promise<ConversationSummary>} A promise that resolves to a `ConversationSummary` object. * * @example * * // Fill in the appropriate values * const identifier = * const limit = * const prompt = * * client.lookupCastConversationSummary({ identifier, limit, prompt }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation-summary) * */ lookupCastConversationSummary(params: { identifier: string; limit?: number; prompt?: string; }): Promise<ConversationSummary>; /** * Returns event object for app host events. Used if the app host intends to sign the event message instead of using Neynar-hosted signers. * * @summary Get app host event * * @param {object} params * @param {string} params.appDomain - The domain of the mini app * @param {number} params.fid - The FID of the user who initiated the event * @param {AppHostEventType} params.event - The type of event * * @returns {Promise<AppHostGetEventResponse>} A promise that resolves to a `AppHostGetEventResponse` object. * * @example * * // Fill in the appropriate values * const appDomain = * const fid = * const event = * * client.appHostGetEvent({ appDomain, fid, event }).then(response => { * console.log('response:', response); * }); */ appHostGetEvent(params: { appDomain: string; fid: number; event: AppHostEventType; }): Promise<AppHostGetEventResponse>; /** * Returns the current notification state for a specific user across all mini app domains in this app host. Shows which domains have notifications enabled. * * @summary Get the user\'s notification subscriptions * * @param {object} params * @param {number} params.fid - The FID of the user * * @returns {Promise<AppHostUserStateResponse>} A promise that resolves to a `AppHostUserStateResponse` object. * * @example * * // Fill in the appropriate values * const fid = * * client.appHostGetUserState({ fid }).then(response => { * console.log('response:', response); * }); */ appHostGetUserState(params: { fid: number; }): Promise<AppHostUserStateResponse>; /** * Post an app_host event to the domain\'s webhook. Events such as enabling or disabling notifications for a user. Provide either a signed message or the signer UUID of an authorized neynar-hosted signers. * * @summary Process app host event * * @param {object} params * @param {AppHostPostEventBody} params.appHostPostEventBody * * @returns {Promise<AppHostPostEventResponse>} A promise that resolves to a `AppHostPostEventResponse` object. * * @example * * // Fill in the appropriate values * const appHostPostEventBody = * * client.appHostPostEvent({ appHostPostEventBody }).then(response => { * console.log('response:', response); * }); */ appHostPostEvent(params: { appHostPostEventBody: AppHostPostEventBody; }): Promise<AppHostPostEventResponse>; /** * Deletes a list of FIDs from the app associated with your API key. * * @summary Unban FIDs from app * * @param {object} params * @param {Array<number>} params.fids * * @returns {Promise<BanResponse>} A promise that resolves to a `BanResponse` object. * * @example * * // Fill in the appropriate values * const fids = * * client.deleteBans({fids}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-bans) * */ deleteBans(params: { fids: Array<number>; }): Promise<BanResponse>; /** * Fetches all FIDs that your app has banned. * * @summary Banned FIDs of app * * @param {object} params * @param {number} params.limit [optional] - Number of results to fetch (Default: 20, Maximum: 100) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<BanListResponse>} A promise that resolves to a `BanListResponse` object. * * @example * * // Fill in the appropriate values * const limit = * * client.fetchBanList({ limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-ban-list) * */ fetchBanList(params: { limit?: number; cursor?: string; }): Promise<BanListResponse>; /** * Bans a list of FIDs from the app associated with your API key. Banned users, their casts and reactions will not appear in feeds. * * @summary Ban FIDs from app * * @param {object} params * @param {Array<number>} params.fids * * @returns {Promise<BanResponse>} A promise that resolves to a `BanResponse` object. * * @example * * // Fill in the appropriate values * const fids = * * client.publishBans({fids}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-bans) * */ publishBans(params: { fids: Array<number>; }): Promise<BanResponse>; /** * Deletes a block for a given FID. * * @summary Unblock FID * * @param {object} params * @param {string} params.signerUuid - UUID of the signer. `signer_uuid` is paired with API key, can't use a `uuid` made with a different API key. * @param {number} params.blockedFid - The unique identifier of a farcaster user or app (unsigned integer) * * @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object. * * @example * * // Fill in the appropriate values * const signerUuid = * const blockedFid = * * client.deleteBlock({signerUuid, blockedFid}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-block) * */ deleteBlock(params: { signerUuid: string; blockedFid: number; }): Promise<OperationResponse>; /** * Fetches all FIDs that a user has blocked or has been blocked by * * @summary Blocked / Blocked by FIDs * * @param {object} params * @param {number} params.blockerFid [optional] - Providing this will return the users that this user has blocked * @param {number} params.blockedFid [optional] - Providing this will return the users that have blocked this user * @param {number} params.limit [optional] - Number of results to fetch (Default: 20, Maximum: 100) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<BlockListResponse>} A promise that resolves to a `BlockListResponse` object. * * @example * * // Fill in the appropriate values * const blockerFid = * const blockedFid = * const limit = * * client.fetchBlockList({ blockerFid, blockedFid, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-block-list) * */ fetchBlockList(params: { blockerFid?: number; blockedFid?: number; limit?: number; cursor?: string; }): Promise<BlockListResponse>; /** * Adds a block for a given FID. * * @summary Block FID * * @param {object} params * @param {string} params.signerUuid - UUID of the signer. `signer_uuid` is paired with API key, can't use a `uuid` made with a different API key. * @param {number} params.blockedFid - The unique identifier of a farcaster user or app (unsigned integer) * * @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object. * * @example * * // Fill in the appropriate values * const signerUuid = * const blockedFid = * * client.publishBlock({signerUuid, blockedFid}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-block) * */ publishBlock(params: { signerUuid: string; blockedFid: number; }): Promise<OperationResponse>; /** * Delete an existing cast. \\ (In order to delete a cast `signer_uuid` must be approved) * * @summary Delete a cast * * @param {object} params * @param {string} params.signerUuid - UUID of the signer. `signer_uuid` is paired with API key, can't use a `uuid` made with a different API key. * @param {string} params.targetHash - Cast Hash * * @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object. * * @example * * // Fill in the appropriate values * const signerUuid = * const targetHash = * * client.deleteCast({signerUuid, targetHash}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-cast) * */ deleteCast(params: { signerUuid: string; targetHash: string; }): Promise<OperationResponse>; /** * Fetch multiple casts using their respective hashes. * * @summary Bulk fetch casts * * @param {object} params * @param {string[]} params.casts - Hashes of the cast to be retrived (Comma separated, no spaces) * @param {number} params.viewerFid [optional] - adds viewer_context to cast object to show whether viewer has liked or recasted the cast. * @param {FetchBulkCastsSortTypeEnum} params.sortType [optional] - Optional parameter to sort the casts based on different criteria * * @returns {Promise<CastsResponse>} A promise that resolves to a `CastsResponse` object. * * @example * * // Fill in the appropriate values * const casts = * const viewerFid = * const sortType = * * client.fetchBulkCasts({ casts, viewerFid, sortType }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-casts) * */ fetchBulkCasts(params: { casts: string[]; viewerFid?: number; sortType?: FetchBulkCastsSortTypeEnum; }): Promise<CastsResponse>; /** * Fetches all composer actions on Warpcast. You can filter by top or featured. * * @summary Fetch composer actions * * @param {object} params * @param {CastComposerType} params.list - Type of list to fetch. * @param {number} params.limit [optional] - Number of results to fetch (Default: 25, Maximum: 25) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<CastComposerActionsListResponse>} A promise that resolves to a `CastComposerActionsListResponse` object. * * @example * * // Fill in the appropriate values * const list = * const limit = * * client.fetchComposerActions({ list, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-composer-actions) * */ fetchComposerActions(params: { list: CastComposerType; limit?: number; cursor?: string; }): Promise<CastComposerActionsListResponse>; /** * Crawls the given URL and returns metadata useful when embedding the URL in a cast. * * @summary Embedded URL metadata * * @param {object} params * @param {string} params.url - URL to crawl metadata of * * @returns {Promise<CastEmbedCrawlResponse>} A promise that resolves to a `CastEmbedCrawlResponse` object. * * @example * * // Fill in the appropriate values * const url = * * client.fetchEmbeddedUrlMetadata({ url }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-embedded-url-metadata) * */ fetchEmbeddedUrlMetadata(params: { url: string; }): Promise<CastEmbedCrawlResponse>; /** * Gets information about an individual cast by passing in a Farcaster web URL or cast hash * * @summary By hash or URL * * @param {object} params * @param {string} params.identifier - Cast identifier (Its either a url or a hash) * @param {CastParamType} params.type * @param {number} params.viewerFid [optional] - adds viewer_context to cast object to show whether viewer has liked or recasted the cast. * * @returns {Promise<CastResponse>} A promise that resolves to a `CastResponse` object. * * @example * * // Fill in the appropriate values * const identifier = * const type = * const viewerFid = * * client.lookupCastByHashOrWarpcastUrl({ identifier, type, viewerFid }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-or-warpcast-url) * */ lookupCastByHashOrWarpcastUrl(params: { identifier: string; type: CastParamType; viewerFid?: number; }): Promise<CastResponse>; /** * Gets all casts related to a conversation surrounding a cast by passing in a cast hash or Farcaster URL. Includes all the ancestors of a cast up to the root parent in a chronological order. Includes all direct_replies to the cast up to the reply_depth specified in the query parameter. * * @summary Conversation for a cast * * @param {object} params * @param {string} params.identifier - Cast identifier (Its either a url or a hash) * @param {CastParamType} params.type * @param {number} params.replyDepth [optional] - The depth of replies in the conversation that will be returned (default 2) * @param {boolean} params.includeChronologicalParentCasts [optional] - Include all parent casts in chronological order * @param {number} params.viewerFid [optional] - Providing this will return a conversation that respects this user's mutes and blocks and includes `viewer_context`. * @param {CastConversationSortType} params.sortType [optional] - Sort type for the ordering of descendants. Default is `chron` * @param {LookupCastConversationFoldEnum} params.fold [optional] - Show conversation above or below the fold. Lower quality responses are hidden below the fold. Not passing in a value shows the full conversation without any folding. * @param {number} params.limit [optional] - Number of results to fetch (Default: 20, Maximum: 50) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<Conversation>} A promise that resolves to a `Conversation` object. * * @example * * // Fill in the appropriate values * const identifier = * const type = * const replyDepth = * const includeChronologicalParentCasts = * const viewerFid = * const sortType = * const fold = * const limit = * * client.lookupCastConversation({ identifier, type, replyDepth, includeChronologicalParentCasts, viewerFid, sortType, fold, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation) * */ lookupCastConversation(params: { identifier: string; type: CastParamType; replyDepth?: number; includeChronologicalParentCasts?: boolean; viewerFid?: number; sortType?: CastConversationSortType; fold?: LookupCastConversationFoldEnum; limit?: number; cursor?: string; }): Promise<Conversation>; /** * Posts a cast or cast reply. Works with mentions and embeds. (In order to post a cast `signer_uuid` must be approved) * * @summary Post a cast * * @param {object} params * @param {string} params.signerUuid - UUID of the signer. `signer_uuid` is paired with API key, can't use a `uuid` made with a different API key. * @param {string} params.text [optional] * @param {Array<PostCastReqBodyEmbeds>} params.embeds [optional] * @param {string} params.parent [optional] - parent_url of the channel the cast is in, or hash of the cast * @param {string} params.channelId [optional] - Channel ID of the channel where the cast is to be posted. e.g. neynar, farcaster, warpcast * @param {string} params.idem [optional] - An Idempotency key is a unique identifier for the request. **Note:** 1) This is used to prevent duplicate requests. Use the same idem key on retry attempts. 2) This should be a unique identifier for each request. 3) Recommended format is a 16-character string generated by the developer at the time of making this request. * @param {number} params.parentAuthorFid [optional] - The unique identifier of a farcaster user or app (unsigned integer) * * @returns {Promise<PostCastResponse>} A promise that resolves to a `PostCastResponse` object. * * @example * * // Fill in the appropriate values * const signerUuid = * const text = * const embeds = * const parent = * const channelId = * const idem = * const parentAuthorFid = * * client.publishCast({signerUuid, text, embeds, parent, channelId, idem, parentAuthorFid}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-cast) * */ publishCast(params: { signerUuid: string; text?: string; embeds?: Array<PostCastReqBodyEmbeds>; parent?: string; channelId?: string; idem?: string; parentAuthorFid?: number; }): Promise<PostCastResponse>; /** * Search for casts based on a query string, with optional AND filters * * @summary Search for casts * * @param {object} params * @param {string} params.q - Query string to search for casts. Supported operators: | Operator | Description | | --------- | -------------------------------------------------------------------------------------------------------- | | `+` | Acts as the AND operator. This is the default operator between terms and can usually be omitted. | | `|` | Acts as the OR operator. | | `*` | When used at the end of a term, signifies a prefix query. | | `"` | Wraps several terms into a phrase (for example, `"star wars"`). | | `(`, `)` | Wrap a clause for precedence (for example, `star + (wars | trek)`). | | `~n` | When used after a term (for example, `satr~3`), sets `fuzziness`. When used after a phrase, sets `slop`. | | `-` | Negates the term. | | `before:` | Search for casts before a specific date. (e.g. `before:2025-04-20`) | | `after:` | Search for casts after a specific date. (e.g. `after:2025-04-20`) | * @param {SearchCastsModeEnum} params.mode [optional] - Choices are: - `literal` - Searches for the words in the query string (default) - `semantic` - Searches for the meaning of the query string - `hybrid` - Combines both literal and semantic results * @param {SearchSortType} params.sortType [optional] - Choices are: - `desc_chron` - All casts sorted by time (default) - `algorithmic` - Casts sorted by engagement and time * @param {number} params.authorFid [optional] - Fid of the user whose casts you want to search * @param {number} params.viewerFid [optional] - Providing this will return search results that respects this user's mutes and blocks and includes `viewer_context`. * @param {string} params.parentUrl [optional] - Parent URL of the casts you want to search * @param {string} params.channelId [optional] - Channel ID of the casts you want to search * @param {boolean} params.priorityMode [optional] - When true, only returns search results from power badge users and users that the viewer follows (if viewer_fid is provided). * @param {number} params.limit [optional] - Number of results to fetch (Default: 25, Maximum: 100) * @param {string} params.cursor [optional] - Pagination cursor * * @returns {Promise<CastsSearchResponse>} A promise that resolves to a `CastsSearchResponse` object. * * @example * * // Fill in the appropriate values * const q = * const mode = * const sortType = * const authorFid = * const viewerFid = * const parentUrl = * const channelId = * const priorityMode = * const limit = * * client.searchCasts({ q, mode, sortType, authorFid, viewerFid, parentUrl, channelId, priorityMode, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-casts) * */ searchCasts(params: { q: string; mode?: SearchCastsModeEnum; sortType?: SearchSortType; authorFid?: number; viewerFid?: number; parentUrl?: string; channelId?: string; priorityMode?: boolean; limit?: number; cursor?: string; }): Promise<CastsSearchResponse>; /** * Returns a list of all channels with their details * * @summary Fetch all channels with their details * * @param {object} params * @param {number} params.limit [optional] - Number of results to fetch (Default: 20, Maximum: 200) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<ChannelListResponse>} A promise that resolves to a `ChannelListResponse` object. * * @example * * // Fill in the appropriate values * const limit = * * client.fetchAllChannels({ limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-all-channels) * */ fetchAllChannels(params: { limit?: number; cursor?: string; }): Promise<ChannelListResponse>; /** * Returns details of multiple channels * * @summary Bulk fetch * * @param {object} params * @param {string[]} params.ids - Comma separated list of channel IDs or parent_urls, up to 100 at a time * @param {ChannelType} params.type [optional] - Type of identifier being used to query the channels. Defaults to ID. * @param {number} params.viewerFid [optional] - FID of the user viewing the channels. * * @returns {Promise<ChannelResponseBulk>} A promise that resolves to a `ChannelResponseBulk` object. * * @example * * // Fill in the appropriate values * const ids = * const type = * const viewerFid = * * client.fetchBulkChannels({ ids, type, viewerFid }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-bulk-channels) * */ fetchBulkChannels(params: { ids: string[]; type?: ChannelType; viewerFid?: number; }): Promise<ChannelResponseBulk>; /** * Fetch a list of invites, either in a channel or for a user. If both are provided, open channel invite for that user is returned. * * @summary Open invites * * @param {object} params * @param {string} params.channelId [optional] - Channel ID for the channel being queried * @param {number} params.invitedFid [optional] - FID of the user being invited * @param {number} params.limit [optional] - Number of results to fetch (Default: 20, Maximum: 100) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<ChannelMemberInviteListResponse>} A promise that resolves to a `ChannelMemberInviteListResponse` object. * * @example * * // Fill in the appropriate values * const channelId = * const invitedFid = * const limit = * * client.fetchChannelInvites({ channelId, invitedFid, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-invites) * */ fetchChannelInvites(params: { channelId?: string; invitedFid?: number; limit?: number; cursor?: string; }): Promise<ChannelMemberInviteListResponse>; /** * Fetch a list of members in a channel * * @summary Fetch members * * @param {object} params * @param {string} params.channelId - Channel ID for the channel being queried * @param {number} params.fid [optional] - FID of the user being queried. Specify this to check if a user is a member of the channel without paginating through all members. * @param {number} params.limit [optional] - Number of results to fetch (Default: 20, Maximum: 100) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<ChannelMemberListResponse>} A promise that resolves to a `ChannelMemberListResponse` object. * * @example * * // Fill in the appropriate values * const channelId = * const fid = * const limit = * * client.fetchChannelMembers({ channelId, fid, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-channel-members) * */ fetchChannelMembers(params: { channelId: string; fid?: number; limit?: number; cursor?: string; }): Promise<ChannelMemberListResponse>; /** * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. * * @summary For channel * * @param {object} params * @param {string} params.id - Channel ID for the channel being queried * @param {number} params.viewerFid [optional] - Providing this will return a list of followers that respects this user's mutes and blocks and includes `viewer_context`. * @param {string} params.cursor [optional] - Pagination cursor. * @param {number} params.limit [optional] - Number of followers to fetch (Default: 25, Maximum: 1000) * * @returns {Promise<UsersResponse>} A promise that resolves to a `UsersResponse` object. * * @example * * // Fill in the appropriate values * const id = * const viewerFid = * const limit = * * client.fetchFollowersForAChannel({ id, viewerFid, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-followers-for-a-channel) * */ fetchFollowersForAChannel(params: { id: string; viewerFid?: number; cursor?: string; limit?: number; }): Promise<UsersResponse>; /** * Returns a list of relevant channel followers for a specific FID. This usually shows on a channel as \"X, Y, Z follow this channel\". * * @summary Relevant followers * * @param {object} params * @param {string} params.id - Channel ID being queried * @param {number} params.viewerFid - The FID of the user to customize this response for. Providing this will also return a list of followers that respects this user's mutes and blocks and includes `viewer_context`. * * @returns {Promise<RelevantFollowersResponse>} A promise that resolves to a `RelevantFollowersResponse` object. * * @example * * // Fill in the appropriate values * const id = * const viewerFid = * * client.fetchRelevantFollowersForAChannel({ id, viewerFid }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-followers-for-a-channel) * */ fetchRelevantFollowersForAChannel(params: { id: string; viewerFid: number; }): Promise<RelevantFollowersResponse>; /** * Returns a list of trending channels based on activity * * @summary Channels by activity * * @param {object} params * @param {FetchTrendingChannelsTimeWindowEnum} params.timeWindow [optional] * @param {number} params.limit [optional] - Number of results to fetch (Default: 10, Maximum: 25) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<TrendingChannelResponse>} A promise that resolves to a `TrendingChannelResponse` object. * * @example * * // Fill in the appropriate values * const timeWindow = * const limit = * * client.fetchTrendingChannels({ timeWindow, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-trending-channels) * */ fetchTrendingChannels(params: { timeWindow?: FetchTrendingChannelsTimeWindowEnum; limit?: number; cursor?: string; }): Promise<TrendingChannelResponse>; /** * Returns a list of all channels with their details that an FID is a member of. Data may have a delay of up to 1 hour. * * @summary Member of * * @param {object} params * @param {number} params.fid - The FID of the user. * @param {number} params.limit [optional] - Number of results to fetch (Default: 20, Maximum: 100) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<ChannelMemberListResponse>} A promise that resolves to a `ChannelMemberListResponse` object. * * @example * * // Fill in the appropriate values * const fid = * const limit = * * client.fetchUserChannelMemberships({ fid, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channel-memberships) * */ fetchUserChannelMemberships(params: { fid: number; limit?: number; cursor?: string; }): Promise<ChannelMemberListResponse>; /** * Returns a list of all channels with their details that a FID follows. * * @summary Following * * @param {object} params * @param {number} params.fid - The FID of the user. * @param {number} params.limit [optional] - Number of results to fetch (Default: 25, Maximum: 100) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<ChannelListResponse>} A promise that resolves to a `ChannelListResponse` object. * * @example * * // Fill in the appropriate values * const fid = * const limit = * * client.fetchUserChannels({ fid, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-channels) * */ fetchUserChannels(params: { fid: number; limit?: number; cursor?: string; }): Promise<ChannelListResponse>; /** * Fetches all channels that a user has casted in, in reverse chronological order. * * @summary Fetch channels that user is active in * * @param {object} params * @param {number} params.fid - The user's FID (identifier) * @param {number} params.limit [optional] - Number of results to fetch (Default: 20, Maximum: 100) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<UsersActiveChannelsResponse>} A promise that resolves to a `UsersActiveChannelsResponse` object. * * @example * * // Fill in the appropriate values * const fid = * const limit = * * client.fetchUsersActiveChannels({ fid, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-active-channels) * */ fetchUsersActiveChannels(params: { fid: number; limit?: number; cursor?: string; }): Promise<UsersActiveChannelsResponse>; /** * Follow a channel * * @summary Follow a channel * * @param {object} params * @param {string} params.signerUuid - UUID of the signer. `signer_uuid` is paired with API key, can't use a `uuid` made with a different API key. * @param {string} params.channelId - The unique identifier of a farcaster channel * * @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object. * * @example * * // Fill in the appropriate values * const signerUuid = * const channelId = * * client.followChannel({signerUuid, channelId}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/follow-channel) * */ followChannel(params: { signerUuid: string; channelId: string; }): Promise<OperationResponse>; /** * Invite a user to a channel * * @summary Invite * * @param {object} params * @param {string} params.signerUuid - UUID of the signer. `signer_uuid` is paired with API key, can't use a `uuid` made with a different API key. * @param {string} params.channelId - The unique identifier of a farcaster channel * @param {number} params.fid - The unique identifier of a farcaster user or app (unsigned integer) * @param {ChannelMemberRole} params.role * * @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object. * * @example * * // Fill in the appropriate values * const signerUuid = * const channelId = * const fid = * const role = * * client.inviteChannelMember({signerUuid, channelId, fid, role}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/invite-channel-member) * */ inviteChannelMember(params: { signerUuid: string; channelId: string; fid: number; role: ChannelMemberRole; }): Promise<OperationResponse>; /** * Returns details of a channel * * @summary By ID or parent_url * * @param {object} params * @param {string} params.id - Channel ID for the channel being queried * @param {ChannelType} params.type [optional] - Type of identifier being used to query the channel. Defaults to ID. * @param {number} params.viewerFid [optional] - FID of the user viewing the channel. * * @returns {Promise<ChannelResponse>} A promise that resolves to a `ChannelResponse` object. * * @example * * // Fill in the appropriate values * const id = * const type = * const viewerFid = * * client.lookupChannel({ id, type, viewerFid }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-channel) * */ lookupChannel(params: { id: string; type?: ChannelType; viewerFid?: number; }): Promise<ChannelResponse>; /** * Remove a user from a channel or a user\'s invite to a channel role * * @summary Remove user * * @param {object} params * @param {string} params.signerUuid - UUID of the signer. `signer_uuid` is paired with API key, can't use a `uuid` made with a different API key. * @param {string} params.channelId - The unique identifier of a farcaster channel * @param {number} params.fid - The unique identifier of a farcaster user or app (unsigned integer) * @param {ChannelMemberRole} params.role * * @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object. * * @example * * // Fill in the appropriate values * const signerUuid = * const channelId = * const fid = * const role = * * client.removeChannelMember({signerUuid, channelId, fid, role}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/remove-channel-member) * */ removeChannelMember(params: { signerUuid: string; channelId: string; fid: number; role: ChannelMemberRole; }): Promise<OperationResponse>; /** * Accept or reject a channel invite * * @summary Accept or reject an invite * * @param {object} params * @param {string} params.signerUuid - UUID of the signer. `signer_uuid` is paired with API key, can't use a `uuid` made with a different API key. * @param {string} params.channelId - The unique identifier of a farcaster channel * @param {ChannelMemberRole} params.role * @param {boolean} params.accept - Accept or reject the invite * * @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object. * * @example * * // Fill in the appropriate values * const signerUuid = * const channelId = * const role = * const accept = * * client.respondChannelInvite({signerUuid, channelId, role, accept}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/respond-channel-invite) * */ respondChannelInvite(params: { signerUuid: string; channelId: string; role: ChannelMemberRole; accept: boolean; }): Promise<OperationResponse>; /** * Returns a list of channels based on ID or name * * @summary Search by ID or name * * @param {object} params * @param {string} params.q - Channel ID or name for the channel being queried * @param {number} params.limit [optional] - Number of results to fetch (Default: 20, Maximum: 200) * @param {string} params.cursor [optional] - Pagination cursor. * * @returns {Promise<ChannelSearchResponse>} A promise that resolves to a `ChannelSearchResponse` object. * * @example * * // Fill in the appropriate values * const q = * const limit = * * client.searchChannels({ q, limit }).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/search-channels) * */ searchChannels(params: { q: string; limit?: number; cursor?: string; }): Promise<ChannelSearchResponse>; /** * Unfollow a channel * * @summary Unfollow a channel * * @param {object} params * @param {string} params.signerUuid - UUID of the signer. `signer_uuid` is paired with API key, can't use a `uuid` made with a different API key. * @param {string} params.channelId - The unique identifier of a farcaster channel * * @returns {Promise<OperationResponse>} A promise that resolves to a `OperationResponse` object. * * @example * * // Fill in the appropriate values * const signerUuid = * const channelId = * * client.unfollowChannel({signerUuid, channelId}).then(response => { * console.log('response:', response); * }); * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/unfollow-channel) * */ unfollowChannel(params: { signerUuid: string; channelId: string; }): Promise<OperationResponse>; /** * Fetch casts for a given user FID in reverse chronological order. Also allows filtering by parent_url and channel * * @summary Chronologic