diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 6895618..94455bb 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -85,6 +85,7 @@ import { PostCastReqBodyEmbeds, NeynarFrameUpdateReqBody, NeynarFrameCreationReqBody, + FetchFrameMetaTagsFromUrl200Response, } from "./v2/openapi-farcaster"; import { @@ -3034,6 +3035,33 @@ export class NeynarAPIClient { return await this.clients.v2.fetchUserChannelMemberships(fid, options); } + /** + * Fetch a list of suggested users to follow. Used to help users discover new users to follow + * + * @param {number} fid - FID of the user whose following you want to fetch. + * @param {Object} [options] - Optional parameters for customizing the response + * @param {number} [options.limit] - Number of results to fetch (Default: 25, Maximum: 100) + * @param {number} [options.viewerFid] - Providing this will return a list of users that respects this user's mutes and blocks and includes `viewer_context`. + * + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * @example + * + * // Example: Fetch follow suggestions for a user + * client.fetchFollowSuggestions(3, {limit: 5}).then(response => { + * console.log('Follow Suggestions:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fetch-follow-suggestions) + * + */ + public async fetchFollowSuggestions( + fid: number, + options?: { limit?: number; viewerFid?: number } + ): Promise { + return await this.clients.v2.fetchFollowSuggestions(fid, options); + } + // ------------ Storage ------------ /** @@ -3244,6 +3272,29 @@ export class NeynarAPIClient { return await this.clients.v2.deleteNeynarFrame(uuid); } + /** + * Fetches the frame meta tags from the URL + * + * @param {string} url - The URL from which to fetch the frame meta tags + * + * @returns {Promise} A promise that resolves to a `FetchFrameMetaTagsFromUrl200Response` object + * + * @example + * // Example: Fetch frame meta tags from a URL + * const url = 'https://frames.neynar.com/f/862277df/ff7be6a4'; + * client.fetchFrameMetaTagsFromUrl(url).then(response => { + * console.log('Frame Meta Tags:', response); + * }); + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frame-meta-tags-from-url) + * + */ + public async fetchFrameMetaTagsFromUrl( + url: string + ): Promise { + return await this.clients.v2.fetchFrameMetaTagsFromUrl(url); + } + /** * Retrieves a list of frames created by the developer, identified through the provided API key. * This method is essential for developers to review their frames submitted to the platform. diff --git a/src/neynar-api/v2/client.ts b/src/neynar-api/v2/client.ts index cb29c62..24ab770 100644 --- a/src/neynar-api/v2/client.ts +++ b/src/neynar-api/v2/client.ts @@ -113,6 +113,7 @@ import { RespondChannelInviteReqBody, StpApi, SubscriptionStatus, + FetchFrameMetaTagsFromUrl200Response, } from "./openapi-farcaster"; import axios, { AxiosError, AxiosInstance } from "axios"; import { silentLogger, Logger } from "../common/logger"; @@ -3052,6 +3053,38 @@ export class NeynarV2APIClient { return response.data; } + /** + * Fetch a list of suggested users to follow. Used to help users discover new users to follow + * + * @param {number} fid - FID of the user whose following you want to fetch. + * @param {Object} [options] - Optional parameters for customizing the response + * @param {number} [options.limit] - Number of results to fetch (Default: 25, Maximum: 100) + * @param {number} [options.viewerFid] - Providing this will return a list of users that respects this user's mutes and blocks and includes `viewer_context`. + * + * @returns {Promise} A promise that resolves to a `UsersResponse` object + * + * @example + * + * // Example: Fetch follow suggestions for a user + * client.fetchFollowSuggestions(3, {limit: 5}).then(response => { + * console.log('Follow Suggestions:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fetch-follow-suggestions) + * + */ + public async fetchFollowSuggestions( + fid: number, + options?: { limit?: number; viewerFid?: number } + ): Promise { + const response = await this.apis.follows.fetchFollowSuggestions({ + fid, + limit: options?.limit, + viewer_fid: options?.viewerFid, + }); + return response.data; + } + // ------------ Storage ------------ /** @@ -3288,6 +3321,30 @@ export class NeynarV2APIClient { return response.data; } + /** + * Fetches the frame meta tags from the URL + * + * @param {string} url - The URL from which to fetch the frame meta tags + * + * @returns {Promise} A promise that resolves to a `FetchFrameMetaTagsFromUrl200Response` object + * + * @example + * // Example: Fetch frame meta tags from a URL + * const url = 'https://frames.neynar.com/f/862277df/ff7be6a4'; + * client.fetchFrameMetaTagsFromUrl(url).then(response => { + * console.log('Frame Meta Tags:', response); + * }); + * + * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-frame-meta-tags-from-url) + * + */ + public async fetchFrameMetaTagsFromUrl( + url: string + ): Promise { + const response = await this.apis.frame.fetchFrameMetaTagsFromUrl({ url }); + return response.data; + } + /** * Retrieves a list of frames created by the developer, identified through the provided API key. * This method is essential for developers to review their frames submitted to the platform.