diff --git a/package.json b/package.json index 1ba005da..aa602172 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neynar/nodejs-sdk", - "version": "1.7.0", + "version": "1.8.0", "description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)", "main": "./build/index.js", "types": "./build/index.d.ts", diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index 7e034543..b2921049 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -26,6 +26,11 @@ import { SignerStatusEnum, ChannelResponse, ChannelListResponse, + User as UserV2, + BulkCastsResponse, + FnameAvailabilityResponse, + FrameAction, + FrameActionResponse, } from "./v2/openapi-farcaster"; import { @@ -924,7 +929,7 @@ export class NeynarAPIClient { * details of several users simultaneously, identified by their FIDs, with the option to provide * information contextual to a specified viewer. * - * @param {Array} fids - An array of FIDs representing the users whose information is being retrieved. + * @param {Array} fids - An array of FIDs representing the users whose information is being retrieved. Up to 100 at a time. * @param {Object} [options] - Optional parameters to tailor the request. * @param {number} [options.viewerFid] - The FID of the user viewing this information, * used for providing contextual data specific to the viewer. @@ -947,6 +952,33 @@ export class NeynarAPIClient { return await this.clients.v2.fetchBulkUsers(fids, options); } + /** + * Fetches bulk user information based on multiple Ethereum addresses. This function is particularly + * useful for retrieving user details associated with both custody and verified Ethereum addresses. + * Note that a custody address can be linked to only one Farcaster user at a time, but a verified + * address can be associated with multiple users. The method enforces a limit of up to 350 addresses + * per request. + * + * @param {Array} addresses - An array of Ethereum addresses. + * @returns {Promise<{[key: string]: UserV2[]}>} A promise that resolves to an object where each key + * is an Ethereum address and the value is an array of `User` objects associated with that address. + * + * @throws {Error} If the number of provided addresses exceeds the allowed limit of 350. + * + * @example + * // Example: Fetch users associated with multiple Ethereum addresses + * client.fetchBulkUsersByEthereumAddress(['0xa6a8736f18f383f1cc2d938576933e5ea7df01a1','0x7cac817861e5c3384753403fb6c0c556c204b1ce']).then(response => { + * console.log('Users by Ethereum Addresses:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-bulk-by-address). + */ + public async fetchBulkUsersByEthereumAddress(addresses: string[]): Promise<{ + [key: string]: UserV2[]; + }> { + return await this.clients.v2.fetchBulkUsersByEthereumAddress(addresses); + } + /** * Searches for users based on a query. This method is used to find users by usernames or other * identifiable information. The search can be contextualized to the viewer specified by `viewerFid`. @@ -1238,6 +1270,58 @@ export class NeynarAPIClient { return await this.clients.v2.fetchUserFollowingFeed(fid, options); } + /** + * Retrieves the 10 most popular casts for a given user based on their FID. Popularity is determined + * by the number of replies, likes, and recasts each cast receives, and the results are sorted from + * the most popular cast first. + * + * @param {number} fid - The FID of the user whose popular casts are being fetched. + * + * @returns {Promise} A promise that resolves to a `BulkCastsResponse` object, + * containing the top 10 most popular casts for the specified user. + * + * @example + * // Example: Retrieve the 10 most popular casts for a user + * client.fetchPopularCastsByUser(3).then(response => { + * console.log('Popular Casts:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/feed-user-popular). + */ + public async fetchPopularCastsByUser( + fid: number + ): Promise { + return await this.clients.v2.fetchPopularCastsByUser(fid); + } + + /** + * Retrieves the most recent replies and recasts for a given user FID. This method is ideal for fetching + * the latest user interactions in the form of replies and recasts, sorted by the most recent first. + * + * @param {number} fid - The FID of the user whose recent replies and recasts are being fetched. + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - Number of results to retrieve (default 25, max 100). + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * + * @returns {Promise} A promise that resolves to a `FeedResponse` object, + * containing the recent replies and recasts for the specified user. + * + * @example + * // Example: Retrieve the recent replies and recasts for a user + * client.fetchRepliesAndRecastsForUser(3, { limit: 25 }).then(response => { + * console.log('Replies and Recasts:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/feed-user-replies-recasts). + */ + public async fetchRepliesAndRecastsForUser( + fid: number, + options?: { limit?: number; cursor?: string } + ): Promise { + return await this.clients.v2.fetchRepliesAndRecastsForUser(fid, options); + } + // ------------ Reaction ------------ /** @@ -1590,6 +1674,34 @@ export class NeynarAPIClient { ); } + /** + * Retrieves a list of followers for a specific channel. This method is useful for understanding + * the audience and reach of a channel. + * + * @param {string} id - The Channel ID for which followers are being queried. + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - Number of followers to retrieve (default 25, max 1000). + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * + * @returns {Promise} A promise that resolves to a `BulkUsersResponse` object, + * containing a list of followers for the specified channel. + * + * @example + * // Example: Retrieve followers for a channel + * client.fetchFollowersForAChannel('founders', { limit: 50 }).then(response => { + * console.log('Channel Followers:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/channel-followers). + */ + public async fetchFollowersForAChannel( + id: string, + options?: { cursor?: string; limit?: number } + ): Promise { + return await this.clients.v2.fetchFollowersForAChannel(id, options); + } + // ------------ Follows ------------ /** @@ -1662,6 +1774,69 @@ export class NeynarAPIClient { return await this.clients.v2.lookupUserStorageUsage(fid); } + // ------------ Fname ------------ + + /** + * Checks if a given fname is available. + * + * @param {string} fname - The fname to check for availability. + * + * @returns {Promise} A promise that resolves to an `FnameAvailabilityResponse` object, + * indicating whether the specified fname is available or already in use. + * + * @example + * // Example: Check if a specific fname is available + * client.isFnameAvailable('farcaster').then(response => { + * console.log('Fname Availability:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fname-availability). + */ + public async isFnameAvailable( + fname: string + ): Promise { + return await this.clients.v2.isFnameAvailable(fname); + } + + // ------------ Frame ------------ + + /** + * Posts a frame action on a specific cast. + * Note that the `signer_uuid` must be approved before posting a frame action. + * + * @param {string} signerUuid - UUID of the signer who is performing the action. + * @param {string} castHash - The hash of the cast on which the action is being performed. + * @param {FrameAction} action - The specific frame action to be posted. + * + * @returns {Promise} A promise that resolves to a `FrameActionResponse` object, + * indicating the success or failure of the frame action post. + * + * @example + * // Example: Post a frame action on a cast + * const signerUuid = 'signerUuid'; + * const castHash = 'castHash'; + * const action = { + * button: { + * title: 'Button Title', // Optional + * index: 1 + * }, + * frames_url: 'frames Url', + * post_url: 'Post Url', + * }; // Example action + * client.postFrameAction(signerUuid, castHash, action).then(response => { + * console.log('Frame Action Response:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/post-frame-action). + */ + public async postFrameAction( + signerUuid: string, + castHash: string, + action: FrameAction + ): Promise { + return await this.clients.v2.postFrameAction(signerUuid, castHash, action); + } + // ------------ Recommendation ------------ /** diff --git a/src/neynar-api/v2/client.ts b/src/neynar-api/v2/client.ts index 4bf0ecc3..d637a0b1 100644 --- a/src/neynar-api/v2/client.ts +++ b/src/neynar-api/v2/client.ts @@ -36,6 +36,13 @@ import { ChannelApi, ChannelResponse, ChannelListResponse, + User, + BulkCastsResponse, + FnameApi, + FnameAvailabilityResponse, + FrameApi, + FrameActionReqBody, + FrameAction, } from "./openapi-farcaster"; import axios, { AxiosError, AxiosInstance } from "axios"; import { silentLogger, Logger } from "../common/logger"; @@ -60,6 +67,8 @@ export class NeynarV2APIClient { follows: FollowsApi; storage: StorageApi; nft: NFTApi; + fname: FnameApi; + frame: FrameApi; }; /** @@ -120,6 +129,8 @@ export class NeynarV2APIClient { follows: new FollowsApi(config, undefined, axiosInstance), storage: new StorageApi(config, undefined, axiosInstance), nft: new NFTApi(config, undefined, axiosInstance), + fname: new FnameApi(config, undefined, axiosInstance), + frame: new FrameApi(config, undefined, axiosInstance), }; } @@ -433,7 +444,7 @@ export class NeynarV2APIClient { * details of several users simultaneously, identified by their FIDs, with the option to provide * information contextual to a specified viewer. * - * @param {Array} fids - An array of FIDs representing the users whose information is being retrieved. + * @param {Array} fids - An array of FIDs representing the users whose information is being retrieved. Up to 100 at a time. * @param {Object} [options] - Optional parameters to tailor the request. * @param {number} [options.viewerFid] - The FID of the user viewing this information, * used for providing contextual data specific to the viewer. @@ -453,6 +464,8 @@ export class NeynarV2APIClient { fids: number[], options: { viewerFid?: number } ): Promise { + if (fids.length > 100) + throw new Error("Maximum number of fids allowed is 100"); const _fids = fids.join(","); const response = await this.apis.user.userBulk( this.apiKey, @@ -462,6 +475,40 @@ export class NeynarV2APIClient { return response.data; } + /** + * Fetches bulk user information based on multiple Ethereum addresses. This function is particularly + * useful for retrieving user details associated with both custody and verified Ethereum addresses. + * Note that a custody address can be linked to only one Farcaster user at a time, but a verified + * address can be associated with multiple users. The method enforces a limit of up to 350 addresses + * per request. + * + * @param {Array} addresses - An array of Ethereum addresses. + * @returns {Promise<{[key: string]: User[]}>} A promise that resolves to an object where each key + * is an Ethereum address and the value is an array of `User` objects associated with that address. + * + * @throws {Error} If the number of provided addresses exceeds the allowed limit of 350. + * + * @example + * // Example: Fetch users associated with multiple Ethereum addresses + * client.fetchBulkUsersByEthereumAddress(['0xa6a8736f18f383f1cc2d938576933e5ea7df01a1','0x7cac817861e5c3384753403fb6c0c556c204b1ce']).then(response => { + * console.log('Users by Ethereum Addresses:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/user-bulk-by-address). + */ + public async fetchBulkUsersByEthereumAddress(addresses: string[]): Promise<{ + [key: string]: User[]; + }> { + if (addresses.length > 350) + throw new Error("Maximum number of addresses allowed is 350"); + const _addresses = addresses.join(","); + const response = await this.apis.user.userBulkByAddress( + this.apiKey, + _addresses + ); + return response.data; + } + /** * Searches for users based on a query. This method is used to find users by usernames or other * identifiable information. The search can be contextualized to the viewer specified by `viewerFid`. @@ -820,6 +867,68 @@ export class NeynarV2APIClient { return response.data; } + /** + * Retrieves the 10 most popular casts for a given user based on their FID. Popularity is determined + * by the number of replies, likes, and recasts each cast receives, and the results are sorted from + * the most popular cast first. + * + * @param {number} fid - The FID of the user whose popular casts are being fetched. + * + * @returns {Promise} A promise that resolves to a `BulkCastsResponse` object, + * containing the top 10 most popular casts for the specified user. + * + * @example + * // Example: Retrieve the 10 most popular casts for a user + * client.fetchPopularCastsByUser(3).then(response => { + * console.log('Popular Casts:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/feed-user-popular). + */ + public async fetchPopularCastsByUser( + fid: number + ): Promise { + const response = await this.apis.feed.feedUserPopular(this.apiKey, fid); + return response.data; + } + + /** + * Retrieves the most recent replies and recasts for a given user FID. This method is ideal for fetching + * the latest user interactions in the form of replies and recasts, sorted by the most recent first. + * + * @param {number} fid - The FID of the user whose recent replies and recasts are being fetched. + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - Number of results to retrieve (default 25, max 100). + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * + * @returns {Promise} A promise that resolves to a `FeedResponse` object, + * containing the recent replies and recasts for the specified user. + * + * @example + * // Example: Retrieve the recent replies and recasts for a user + * client.fetchRepliesAndRecastsForUser(3, { limit: 25 }).then(response => { + * console.log('Replies and Recasts:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/feed-user-replies-recasts). + */ + public async fetchRepliesAndRecastsForUser( + fid: number, + options?: { + limit?: number; + cursor?: string; + } + ): Promise { + const response = await this.apis.feed.feedUserRepliesRecasts( + this.apiKey, + fid, + options?.limit, + options?.cursor + ); + return response.data; + } + // ------------ Reaction ------------ /** @@ -1221,6 +1330,43 @@ export class NeynarV2APIClient { return response.data; } + /** + * Retrieves a list of followers for a specific channel. This method is useful for understanding + * the audience and reach of a channel. + * + * @param {string} id - The Channel ID for which followers are being queried. + * @param {Object} [options] - Optional parameters for customizing the response. + * @param {number} [options.limit] - Number of followers to retrieve (default 25, max 1000). + * @param {string} [options.cursor] - Pagination cursor for the next set of results, + * omit this parameter for the initial request. + * + * @returns {Promise} A promise that resolves to a `BulkUsersResponse` object, + * containing a list of followers for the specified channel. + * + * @example + * // Example: Retrieve followers for a channel + * client.fetchFollowersForAChannel('founders', { limit: 50 }).then(response => { + * console.log('Channel Followers:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/channel-followers). + */ + public async fetchFollowersForAChannel( + id: string, + options?: { + limit?: number; + cursor?: string; + } + ): Promise { + const response = await this.apis.channel.channelFollowers( + this.apiKey, + id, + options?.cursor, + options?.limit + ); + return response.data; + } + // ------------ Follows ------------ /** @@ -1302,6 +1448,80 @@ export class NeynarV2APIClient { const response = await this.apis.storage.storageUsage(this.apiKey, fid); return response.data; } + + // ------------ Fname ------------ + + /** + * Checks if a given fname is available. + * + * @param {string} fname - The fname to check for availability. + * + * @returns {Promise} A promise that resolves to an `FnameAvailabilityResponse` object, + * indicating whether the specified fname is available or already in use. + * + * @example + * // Example: Check if a specific fname is available + * client.isFnameAvailable('farcaster').then(response => { + * console.log('Fname Availability:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fname-availability). + */ + public async isFnameAvailable( + fname: string + ): Promise { + const response = await this.apis.fname.fnameAvailability( + this.apiKey, + fname + ); + return response.data; + } + + // ------------ Frame ------------ + + /** + * Posts a frame action on a specific cast. + * Note that the `signer_uuid` must be approved before posting a frame action. + * + * @param {string} signerUuid - UUID of the signer who is performing the action. + * @param {string} castHash - The hash of the cast on which the action is being performed. + * @param {FrameAction} action - The specific frame action to be posted. + * + * @returns {Promise} A promise that resolves to a `FrameActionResponse` object, + * indicating the success or failure of the frame action post. + * + * @example + * // Example: Post a frame action on a cast + * const signerUuid = 'signerUuid'; + * const castHash = 'castHash'; + * const action = { + * button: { + * title: 'Button Title', // Optional + * index: 1 + * }, + * frames_url: 'frames Url', + * post_url: 'Post Url', + * }; // Example action + * client.postFrameAction(signerUuid, castHash, action).then(response => { + * console.log('Frame Action Response:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/post-frame-action). + */ + public async postFrameAction( + signerUuid: string, + castHash: string, + action: FrameAction + ) { + const body: FrameActionReqBody = { + signer_uuid: signerUuid, + cast_hash: castHash, + action, + }; + const response = await this.apis.frame.postFrameAction(this.apiKey, body); + return response.data; + } + // ------------ Recommendation ------------ /** diff --git a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES index 5872c6ff..095349bd 100644 --- a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES +++ b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES @@ -5,7 +5,9 @@ api.ts apis/cast-api.ts apis/channel-api.ts apis/feed-api.ts +apis/fname-api.ts apis/follows-api.ts +apis/frame-api.ts apis/notifications-api.ts apis/reaction-api.ts apis/signer-api.ts @@ -18,6 +20,7 @@ git_push.sh index.ts models/active-status.ts models/add-verification-req-body.ts +models/bulk-casts-response.ts models/bulk-follow-response.ts models/bulk-users-response.ts models/cast-id.ts @@ -45,9 +48,15 @@ models/error-res.ts models/feed-response.ts models/feed-type.ts models/filter-type.ts +models/fname-availability-response.ts models/follow-req-body.ts models/follow-response.ts models/follow.ts +models/frame-action-button.ts +models/frame-action-req-body.ts +models/frame-action-response.ts +models/frame-action.ts +models/frame.ts models/get-casts-req-body.ts models/hydrated-follower.ts models/index.ts diff --git a/src/neynar-api/v2/openapi-farcaster/api.ts b/src/neynar-api/v2/openapi-farcaster/api.ts index 58650b6f..bbe48498 100644 --- a/src/neynar-api/v2/openapi-farcaster/api.ts +++ b/src/neynar-api/v2/openapi-farcaster/api.ts @@ -17,7 +17,9 @@ export * from './apis/cast-api'; export * from './apis/channel-api'; export * from './apis/feed-api'; +export * from './apis/fname-api'; export * from './apis/follows-api'; +export * from './apis/frame-api'; export * from './apis/notifications-api'; export * from './apis/reaction-api'; export * from './apis/signer-api'; diff --git a/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts index 3b6f97c5..d4435546 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/channel-api.ts @@ -70,6 +70,60 @@ export const ChannelApiAxiosParamCreator = function (configuration?: Configurati + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. + * @summary Retrieve followers for a given channel + * @param {string} apiKey API key required for authentication. + * @param {string} id Channel ID for the channel being queried + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of followers to retrieve (default 25, max 1000) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + channelFollowers: async (apiKey: string, id: string, cursor?: string, limit?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('channelFollowers', 'apiKey', apiKey) + // verify required parameter 'id' is not null or undefined + assertParamExists('channelFollowers', 'id', id) + const localVarPath = `/farcaster/channel/followers`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (id !== undefined) { + localVarQueryParameter['id'] = id; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -300,6 +354,20 @@ export const ChannelApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.channelDetails(apiKey, id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. + * @summary Retrieve followers for a given channel + * @param {string} apiKey API key required for authentication. + * @param {string} id Channel ID for the channel being queried + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of followers to retrieve (default 25, max 1000) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async channelFollowers(apiKey: string, id: string, cursor?: string, limit?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.channelFollowers(apiKey, id, cursor, limit, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * Returns a list of users who are active in a given channel, ordered by ascending FIDs * @summary Retrieve users who are active in a channel @@ -374,6 +442,19 @@ export const ChannelApiFactory = function (configuration?: Configuration, basePa channelDetails(apiKey: string, id: string, options?: any): AxiosPromise { return localVarFp.channelDetails(apiKey, id, options).then((request) => request(axios, basePath)); }, + /** + * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. + * @summary Retrieve followers for a given channel + * @param {string} apiKey API key required for authentication. + * @param {string} id Channel ID for the channel being queried + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of followers to retrieve (default 25, max 1000) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + channelFollowers(apiKey: string, id: string, cursor?: string, limit?: number, options?: any): AxiosPromise { + return localVarFp.channelFollowers(apiKey, id, cursor, limit, options).then((request) => request(axios, basePath)); + }, /** * Returns a list of users who are active in a given channel, ordered by ascending FIDs * @summary Retrieve users who are active in a channel @@ -446,6 +527,21 @@ export class ChannelApi extends BaseAPI { return ChannelApiFp(this.configuration).channelDetails(apiKey, id, options).then((request) => request(this.axios, this.basePath)); } + /** + * Returns a list of followers for a specific channel. Max limit is 1000. Use cursor for pagination. + * @summary Retrieve followers for a given channel + * @param {string} apiKey API key required for authentication. + * @param {string} id Channel ID for the channel being queried + * @param {string} [cursor] Pagination cursor. + * @param {number} [limit] Number of followers to retrieve (default 25, max 1000) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ChannelApi + */ + public channelFollowers(apiKey: string, id: string, cursor?: string, limit?: number, options?: AxiosRequestConfig) { + return ChannelApiFp(this.configuration).channelFollowers(apiKey, id, cursor, limit, options).then((request) => request(this.axios, this.basePath)); + } + /** * Returns a list of users who are active in a given channel, ordered by ascending FIDs * @summary Retrieve users who are active in a channel diff --git a/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts index 491ed6a9..71c482b0 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/feed-api.ts @@ -22,6 +22,8 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore +import { BulkCastsResponse } from '../models'; +// @ts-ignore import { ErrorRes } from '../models'; // @ts-ignore import { FeedResponse } from '../models'; @@ -248,6 +250,98 @@ export const FeedApiAxiosParamCreator = function (configuration?: Configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Retrieve 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first + * @summary Retrieve 10 most popular casts for a user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of user whose feed you want to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + feedUserPopular: async (apiKey: string, fid: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('feedUserPopular', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('feedUserPopular', 'fid', fid) + const localVarPath = `/farcaster/feed/user/{fid}/popular` + .replace(`{${"fid"}}`, encodeURIComponent(String(fid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Retrieve recent replies and recasts for a given user FID; sorted by most recent first + * @summary Retrieve recent replies and recasts for a user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of user whose replies and recasts you want to fetch + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + feedUserRepliesRecasts: async (apiKey: string, fid: number, limit?: number, cursor?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('feedUserRepliesRecasts', 'apiKey', apiKey) + // verify required parameter 'fid' is not null or undefined + assertParamExists('feedUserRepliesRecasts', 'fid', fid) + const localVarPath = `/farcaster/feed/user/{fid}/replies_and_recasts` + .replace(`{${"fid"}}`, encodeURIComponent(String(fid))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -321,6 +415,32 @@ export const FeedApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.feedFollowing(apiKey, fid, withRecasts, withReplies, limit, cursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Retrieve 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first + * @summary Retrieve 10 most popular casts for a user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of user whose feed you want to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async feedUserPopular(apiKey: string, fid: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.feedUserPopular(apiKey, fid, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Retrieve recent replies and recasts for a given user FID; sorted by most recent first + * @summary Retrieve recent replies and recasts for a user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of user whose replies and recasts you want to fetch + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async feedUserRepliesRecasts(apiKey: string, fid: number, limit?: number, cursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.feedUserRepliesRecasts(apiKey, fid, limit, cursor, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, } }; @@ -382,6 +502,30 @@ export const FeedApiFactory = function (configuration?: Configuration, basePath? feedFollowing(apiKey: string, fid: number, withRecasts?: boolean, withReplies?: boolean, limit?: number, cursor?: string, options?: any): AxiosPromise { return localVarFp.feedFollowing(apiKey, fid, withRecasts, withReplies, limit, cursor, options).then((request) => request(axios, basePath)); }, + /** + * Retrieve 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first + * @summary Retrieve 10 most popular casts for a user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of user whose feed you want to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + feedUserPopular(apiKey: string, fid: number, options?: any): AxiosPromise { + return localVarFp.feedUserPopular(apiKey, fid, options).then((request) => request(axios, basePath)); + }, + /** + * Retrieve recent replies and recasts for a given user FID; sorted by most recent first + * @summary Retrieve recent replies and recasts for a user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of user whose replies and recasts you want to fetch + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + feedUserRepliesRecasts(apiKey: string, fid: number, limit?: number, cursor?: string, options?: any): AxiosPromise { + return localVarFp.feedUserRepliesRecasts(apiKey, fid, limit, cursor, options).then((request) => request(axios, basePath)); + }, }; }; @@ -448,4 +592,32 @@ export class FeedApi extends BaseAPI { public feedFollowing(apiKey: string, fid: number, withRecasts?: boolean, withReplies?: boolean, limit?: number, cursor?: string, options?: AxiosRequestConfig) { return FeedApiFp(this.configuration).feedFollowing(apiKey, fid, withRecasts, withReplies, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } + + /** + * Retrieve 10 most popular casts for a given user FID; popularity based on replies, likes and recasts; sorted by most popular first + * @summary Retrieve 10 most popular casts for a user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of user whose feed you want to create + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApi + */ + public feedUserPopular(apiKey: string, fid: number, options?: AxiosRequestConfig) { + return FeedApiFp(this.configuration).feedUserPopular(apiKey, fid, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Retrieve recent replies and recasts for a given user FID; sorted by most recent first + * @summary Retrieve recent replies and recasts for a user + * @param {string} apiKey API key required for authentication. + * @param {number} fid fid of user whose replies and recasts you want to fetch + * @param {number} [limit] Number of results to retrieve (default 25, max 100) + * @param {string} [cursor] Pagination cursor. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FeedApi + */ + public feedUserRepliesRecasts(apiKey: string, fid: number, limit?: number, cursor?: string, options?: AxiosRequestConfig) { + return FeedApiFp(this.configuration).feedUserRepliesRecasts(apiKey, fid, limit, cursor, options).then((request) => request(this.axios, this.basePath)); + } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/fname-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/fname-api.ts new file mode 100644 index 00000000..c5b79881 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/fname-api.ts @@ -0,0 +1,143 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { FnameAvailabilityResponse } from '../models'; +/** + * FnameApi - axios parameter creator + * @export + */ +export const FnameApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Check if a given fname is available + * @summary Check if a given fname is available + * @param {string} apiKey API key required for authentication. + * @param {string} fname + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fnameAvailability: async (apiKey: string, fname: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('fnameAvailability', 'apiKey', apiKey) + // verify required parameter 'fname' is not null or undefined + assertParamExists('fnameAvailability', 'fname', fname) + const localVarPath = `/farcaster/fname/availability`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (fname !== undefined) { + localVarQueryParameter['fname'] = fname; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * FnameApi - functional programming interface + * @export + */ +export const FnameApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = FnameApiAxiosParamCreator(configuration) + return { + /** + * Check if a given fname is available + * @summary Check if a given fname is available + * @param {string} apiKey API key required for authentication. + * @param {string} fname + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async fnameAvailability(apiKey: string, fname: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fnameAvailability(apiKey, fname, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * FnameApi - factory interface + * @export + */ +export const FnameApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = FnameApiFp(configuration) + return { + /** + * Check if a given fname is available + * @summary Check if a given fname is available + * @param {string} apiKey API key required for authentication. + * @param {string} fname + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fnameAvailability(apiKey: string, fname: string, options?: any): AxiosPromise { + return localVarFp.fnameAvailability(apiKey, fname, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * FnameApi - object-oriented interface + * @export + * @class FnameApi + * @extends {BaseAPI} + */ +export class FnameApi extends BaseAPI { + /** + * Check if a given fname is available + * @summary Check if a given fname is available + * @param {string} apiKey API key required for authentication. + * @param {string} fname + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FnameApi + */ + public fnameAvailability(apiKey: string, fname: string, options?: AxiosRequestConfig) { + return FnameApiFp(this.configuration).fnameAvailability(apiKey, fname, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/v2/openapi-farcaster/apis/frame-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/frame-api.ts new file mode 100644 index 00000000..c0cd959e --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/frame-api.ts @@ -0,0 +1,144 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { FrameActionReqBody } from '../models'; +// @ts-ignore +import { FrameActionResponse } from '../models'; +/** + * FrameApi - axios parameter creator + * @export + */ +export const FrameApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Post a frame action \\ (In order to post a frame action `signer_uuid` must be approved) + * @summary Posts a frame action + * @param {string} apiKey API key required for authentication. + * @param {FrameActionReqBody} frameActionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postFrameAction: async (apiKey: string, frameActionReqBody: FrameActionReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('postFrameAction', 'apiKey', apiKey) + // verify required parameter 'frameActionReqBody' is not null or undefined + assertParamExists('postFrameAction', 'frameActionReqBody', frameActionReqBody) + const localVarPath = `/farcaster/frame/action`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(frameActionReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * FrameApi - functional programming interface + * @export + */ +export const FrameApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = FrameApiAxiosParamCreator(configuration) + return { + /** + * Post a frame action \\ (In order to post a frame action `signer_uuid` must be approved) + * @summary Posts a frame action + * @param {string} apiKey API key required for authentication. + * @param {FrameActionReqBody} frameActionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postFrameAction(apiKey: string, frameActionReqBody: FrameActionReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postFrameAction(apiKey, frameActionReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * FrameApi - factory interface + * @export + */ +export const FrameApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = FrameApiFp(configuration) + return { + /** + * Post a frame action \\ (In order to post a frame action `signer_uuid` must be approved) + * @summary Posts a frame action + * @param {string} apiKey API key required for authentication. + * @param {FrameActionReqBody} frameActionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postFrameAction(apiKey: string, frameActionReqBody: FrameActionReqBody, options?: any): AxiosPromise { + return localVarFp.postFrameAction(apiKey, frameActionReqBody, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * FrameApi - object-oriented interface + * @export + * @class FrameApi + * @extends {BaseAPI} + */ +export class FrameApi extends BaseAPI { + /** + * Post a frame action \\ (In order to post a frame action `signer_uuid` must be approved) + * @summary Posts a frame action + * @param {string} apiKey API key required for authentication. + * @param {FrameActionReqBody} frameActionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FrameApi + */ + public postFrameAction(apiKey: string, frameActionReqBody: FrameActionReqBody, options?: AxiosRequestConfig) { + return FrameApiFp(this.configuration).postFrameAction(apiKey, frameActionReqBody, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts index 4c6d5980..e82f3b8a 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/user-api.ts @@ -38,6 +38,8 @@ import { RemoveVerificationReqBody } from '../models'; // @ts-ignore import { UpdateUserReqBody } from '../models'; // @ts-ignore +import { User } from '../models'; +// @ts-ignore import { UserResponse } from '../models'; // @ts-ignore import { UserSearchResponse } from '../models'; @@ -310,7 +312,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) * Fetches information about multiple users based on FIDs * @summary Fetches information about multiple users based on FIDs * @param {string} apiKey API key required for authentication. - * @param {string} fids + * @param {string} fids Comma separated list of FIDs, up to 100 at a time * @param {number} [viewerFid] * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -346,6 +348,50 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetches all users based on multiple Ethereum addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. + * @summary Fetches all users based on multiple Ethereum addresses + * @param {string} apiKey API key required for authentication. + * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userBulkByAddress: async (apiKey: string, addresses: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('userBulkByAddress', 'apiKey', apiKey) + // verify required parameter 'addresses' is not null or undefined + assertParamExists('userBulkByAddress', 'addresses', addresses) + const localVarPath = `/farcaster/user/bulk-by-address`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (addresses !== undefined) { + localVarQueryParameter['addresses'] = addresses; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -492,7 +538,7 @@ export const UserApiFp = function(configuration?: Configuration) { * Fetches information about multiple users based on FIDs * @summary Fetches information about multiple users based on FIDs * @param {string} apiKey API key required for authentication. - * @param {string} fids + * @param {string} fids Comma separated list of FIDs, up to 100 at a time * @param {number} [viewerFid] * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -501,6 +547,18 @@ export const UserApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.userBulk(apiKey, fids, viewerFid, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Fetches all users based on multiple Ethereum addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. + * @summary Fetches all users based on multiple Ethereum addresses + * @param {string} apiKey API key required for authentication. + * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async userBulkByAddress(apiKey: string, addresses: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: Array; }>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.userBulkByAddress(apiKey, addresses, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * Search for Usernames * @summary Search for Usernames @@ -594,7 +652,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * Fetches information about multiple users based on FIDs * @summary Fetches information about multiple users based on FIDs * @param {string} apiKey API key required for authentication. - * @param {string} fids + * @param {string} fids Comma separated list of FIDs, up to 100 at a time * @param {number} [viewerFid] * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -602,6 +660,17 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? userBulk(apiKey: string, fids: string, viewerFid?: number, options?: any): AxiosPromise { return localVarFp.userBulk(apiKey, fids, viewerFid, options).then((request) => request(axios, basePath)); }, + /** + * Fetches all users based on multiple Ethereum addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. + * @summary Fetches all users based on multiple Ethereum addresses + * @param {string} apiKey API key required for authentication. + * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + userBulkByAddress(apiKey: string, addresses: string, options?: any): AxiosPromise<{ [key: string]: Array; }> { + return localVarFp.userBulkByAddress(apiKey, addresses, options).then((request) => request(axios, basePath)); + }, /** * Search for Usernames * @summary Search for Usernames @@ -706,7 +775,7 @@ export class UserApi extends BaseAPI { * Fetches information about multiple users based on FIDs * @summary Fetches information about multiple users based on FIDs * @param {string} apiKey API key required for authentication. - * @param {string} fids + * @param {string} fids Comma separated list of FIDs, up to 100 at a time * @param {number} [viewerFid] * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -716,6 +785,19 @@ export class UserApi extends BaseAPI { return UserApiFp(this.configuration).userBulk(apiKey, fids, viewerFid, options).then((request) => request(this.axios, this.basePath)); } + /** + * Fetches all users based on multiple Ethereum addresses. Each farcaster user has a custody Ethereum address and optionally verified Ethereum addresses. This endpoint returns all users that have any of the given addresses as their custody or verified Ethereum addresses. A custody address can be associated with only 1 farcaster user at a time but a verified address can be associated with multiple users. + * @summary Fetches all users based on multiple Ethereum addresses + * @param {string} apiKey API key required for authentication. + * @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public userBulkByAddress(apiKey: string, addresses: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).userBulkByAddress(apiKey, addresses, options).then((request) => request(this.axios, this.basePath)); + } + /** * Search for Usernames * @summary Search for Usernames diff --git a/src/neynar-api/v2/openapi-farcaster/models/bulk-casts-response.ts b/src/neynar-api/v2/openapi-farcaster/models/bulk-casts-response.ts new file mode 100644 index 00000000..e1d83c6c --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/bulk-casts-response.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { CastWithInteractions } from './cast-with-interactions'; + +/** + * + * @export + * @interface BulkCastsResponse + */ +export interface BulkCastsResponse { + /** + * + * @type {Array} + * @memberof BulkCastsResponse + */ + 'casts': Array; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/fname-availability-response.ts b/src/neynar-api/v2/openapi-farcaster/models/fname-availability-response.ts new file mode 100644 index 00000000..3c824e67 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/fname-availability-response.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface FnameAvailabilityResponse + */ +export interface FnameAvailabilityResponse { + /** + * + * @type {boolean} + * @memberof FnameAvailabilityResponse + */ + 'available': boolean; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-action-button.ts b/src/neynar-api/v2/openapi-farcaster/models/frame-action-button.ts new file mode 100644 index 00000000..68fac9f5 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/frame-action-button.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface FrameActionButton + */ +export interface FrameActionButton { + /** + * Title of the button + * @type {string} + * @memberof FrameActionButton + */ + 'title'?: string; + /** + * Index of the button + * @type {number} + * @memberof FrameActionButton + */ + 'index': number; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-action-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/frame-action-req-body.ts new file mode 100644 index 00000000..393cb407 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/frame-action-req-body.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { FrameAction } from './frame-action'; + +/** + * + * @export + * @interface FrameActionReqBody + */ +export interface FrameActionReqBody { + /** + * UUID of the signer + * @type {string} + * @memberof FrameActionReqBody + */ + 'signer_uuid': string; + /** + * Cast Hash + * @type {string} + * @memberof FrameActionReqBody + */ + 'cast_hash': string; + /** + * + * @type {FrameAction} + * @memberof FrameActionReqBody + */ + 'action': FrameAction; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-action-response.ts b/src/neynar-api/v2/openapi-farcaster/models/frame-action-response.ts new file mode 100644 index 00000000..3d0cd5d7 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/frame-action-response.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { Frame } from './frame'; + +/** + * + * @export + * @interface FrameActionResponse + */ +export interface FrameActionResponse { + /** + * + * @type {Frame} + * @memberof FrameActionResponse + */ + 'next_frame': Frame; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-action.ts b/src/neynar-api/v2/openapi-farcaster/models/frame-action.ts new file mode 100644 index 00000000..c9c6c16d --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/frame-action.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { FrameActionButton } from './frame-action-button'; + +/** + * + * @export + * @interface FrameAction + */ +export interface FrameAction { + /** + * + * @type {FrameActionButton} + * @memberof FrameAction + */ + 'button': FrameActionButton; + /** + * URL of the frames + * @type {string} + * @memberof FrameAction + */ + 'frames_url': string; + /** + * URL of the post to get the next frame + * @type {string} + * @memberof FrameAction + */ + 'post_url': string; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame.ts b/src/neynar-api/v2/openapi-farcaster/models/frame.ts new file mode 100644 index 00000000..9f678440 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/frame.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { FrameActionButton } from './frame-action-button'; + +/** + * + * @export + * @interface Frame + */ +export interface Frame { + /** + * Version of the frame + * @type {string} + * @memberof Frame + */ + 'version': string; + /** + * URL of the image + * @type {string} + * @memberof Frame + */ + 'image': string; + /** + * + * @type {Array} + * @memberof Frame + */ + 'buttons'?: Array; + /** + * Post URL to take an action on this frame + * @type {string} + * @memberof Frame + */ + 'post_url'?: string; + /** + * URL of the frames + * @type {string} + * @memberof Frame + */ + 'frames_url': string; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/index.ts b/src/neynar-api/v2/openapi-farcaster/models/index.ts index 59df7b73..cadd1ff4 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/index.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/index.ts @@ -1,5 +1,6 @@ export * from './active-status'; export * from './add-verification-req-body'; +export * from './bulk-casts-response'; export * from './bulk-follow-response'; export * from './bulk-users-response'; export * from './cast'; @@ -27,9 +28,15 @@ export * from './error-res'; export * from './feed-response'; export * from './feed-type'; export * from './filter-type'; +export * from './fname-availability-response'; export * from './follow'; export * from './follow-req-body'; export * from './follow-response'; +export * from './frame'; +export * from './frame-action'; +export * from './frame-action-button'; +export * from './frame-action-req-body'; +export * from './frame-action-response'; export * from './get-casts-req-body'; export * from './hydrated-follower'; export * from './individual-hash-obj'; diff --git a/src/oas b/src/oas index 5d87da67..87cdb9af 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 5d87da67ae13b819ea948b0bf0184122162e7811 +Subproject commit 87cdb9afb519d6bfe48fc42a7a2f8d55a7f87c15