@neynar/nodejs-sdk
Version:
SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)
539 lines (538 loc) • 25.9 kB
TypeScript
/**
* Farcaster Hub API
* Perform basic queries of Farcaster state via the REST API of a Farcaster hub. See the [Neynar docs](https://docs.neynar.com/reference) for more details.
*
* The version of the OpenAPI document: 2.35.0
* Contact: team@neynar.com
*
* 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, RawAxiosRequestConfig } from 'axios';
import { type RequestArgs, BaseAPI } from '../base';
import type { FetchCastReactions200Response } from '../models';
import type { Reaction } from '../models';
import type { ReactionType } from '../models';
/**
* ReactionsApi - axios parameter creator
* @export
*/
export declare const ReactionsApiAxiosParamCreator: (configuration?: Configuration) => {
/**
* Retrieve all reactions (likes or recasts) on a specific cast in the Farcaster network. The cast is identified by its creator\'s FID and unique hash. This endpoint helps track engagement metrics and user interactions with specific content.
* @summary On cast
* @param {number} targetFid The FID of the cast\'s creator. Required to uniquely identify the cast that received the reactions. Must be used in conjunction with target_hash.
* @param {string} targetHash The unique hash identifier of the cast that received the reactions. This is a 40-character hexadecimal string prefixed with \'0x\' that uniquely identifies the cast within the creator\'s posts. Must be used with target_fid.
* @param {ReactionType} reactionType
* @param {number} [pageSize] Maximum number of messages to return in a single response
* @param {boolean} [reverse] Reverse the sort order, returning latest messages first
* @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions)
*
*/
fetchCastReactions: (targetFid: number, targetHash: string, reactionType: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Fetch all reactions of a specific type (like or recast) that target a given URL. This endpoint is useful for tracking engagement with content across the Farcaster network.
* @summary To a target URL
* @param {string} url Target URL starting with \'chain://\'.
* @param {ReactionType} [reactionType]
* @param {number} [pageSize] Maximum number of messages to return in a single response
* @param {boolean} [reverse] Reverse the sort order, returning latest messages first
* @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-reactions-by-target)
*
*/
fetchReactionsByTarget: (url: string, reactionType?: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Fetch reactions by a user.
* @summary By FID
* @param {number} fid The FID of the reaction\'s creator
* @param {ReactionType} reactionType
* @param {number} [pageSize] Maximum number of messages to return in a single response
* @param {boolean} [reverse] Reverse the sort order, returning latest messages first
* @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions)
*
*/
fetchUserReactions: (fid: number, reactionType: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Lookup a reaction by its FID or cast.
* @summary By FID or cast
* @param {number} fid The FID of the reaction\'s creator
* @param {number} targetFid The FID of the cast\'s creator
* @param {string} targetHash The cast\'s hash
* @param {ReactionType} reactionType
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<Reaction>} A promise that resolves to a `Reaction` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-reaction-by-id)
*
*/
lookupReactionById: (fid: number, targetFid: number, targetHash: string, reactionType: ReactionType, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
};
/**
* ReactionsApi - functional programming interface
* @export
*/
export declare const ReactionsApiFp: (configuration?: Configuration) => {
/**
* Retrieve all reactions (likes or recasts) on a specific cast in the Farcaster network. The cast is identified by its creator\'s FID and unique hash. This endpoint helps track engagement metrics and user interactions with specific content.
* @summary On cast
* @param {number} targetFid The FID of the cast\'s creator. Required to uniquely identify the cast that received the reactions. Must be used in conjunction with target_hash.
* @param {string} targetHash The unique hash identifier of the cast that received the reactions. This is a 40-character hexadecimal string prefixed with \'0x\' that uniquely identifies the cast within the creator\'s posts. Must be used with target_fid.
* @param {ReactionType} reactionType
* @param {number} [pageSize] Maximum number of messages to return in a single response
* @param {boolean} [reverse] Reverse the sort order, returning latest messages first
* @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions)
*
*/
fetchCastReactions(targetFid: number, targetHash: string, reactionType: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FetchCastReactions200Response>>;
/**
* Fetch all reactions of a specific type (like or recast) that target a given URL. This endpoint is useful for tracking engagement with content across the Farcaster network.
* @summary To a target URL
* @param {string} url Target URL starting with \'chain://\'.
* @param {ReactionType} [reactionType]
* @param {number} [pageSize] Maximum number of messages to return in a single response
* @param {boolean} [reverse] Reverse the sort order, returning latest messages first
* @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-reactions-by-target)
*
*/
fetchReactionsByTarget(url: string, reactionType?: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FetchCastReactions200Response>>;
/**
* Fetch reactions by a user.
* @summary By FID
* @param {number} fid The FID of the reaction\'s creator
* @param {ReactionType} reactionType
* @param {number} [pageSize] Maximum number of messages to return in a single response
* @param {boolean} [reverse] Reverse the sort order, returning latest messages first
* @param {string} [pageToken] The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions)
*
*/
fetchUserReactions(fid: number, reactionType: ReactionType, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FetchCastReactions200Response>>;
/**
* Lookup a reaction by its FID or cast.
* @summary By FID or cast
* @param {number} fid The FID of the reaction\'s creator
* @param {number} targetFid The FID of the cast\'s creator
* @param {string} targetHash The cast\'s hash
* @param {ReactionType} reactionType
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<Reaction>} A promise that resolves to a `Reaction` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-reaction-by-id)
*
*/
lookupReactionById(fid: number, targetFid: number, targetHash: string, reactionType: ReactionType, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Reaction>>;
};
/**
* ReactionsApi - factory interface
* @export
*/
export declare const ReactionsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
/**
* Retrieve all reactions (likes or recasts) on a specific cast in the Farcaster network. The cast is identified by its creator\'s FID and unique hash. This endpoint helps track engagement metrics and user interactions with specific content.
* @summary On cast
* @param {ReactionsApiFetchCastReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions)
*
*/
fetchCastReactions(requestParameters: ReactionsApiFetchCastReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchCastReactions200Response>;
/**
* Fetch all reactions of a specific type (like or recast) that target a given URL. This endpoint is useful for tracking engagement with content across the Farcaster network.
* @summary To a target URL
* @param {ReactionsApiFetchReactionsByTargetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-reactions-by-target)
*
*/
fetchReactionsByTarget(requestParameters: ReactionsApiFetchReactionsByTargetRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchCastReactions200Response>;
/**
* Fetch reactions by a user.
* @summary By FID
* @param {ReactionsApiFetchUserReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions)
*
*/
fetchUserReactions(requestParameters: ReactionsApiFetchUserReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchCastReactions200Response>;
/**
* Lookup a reaction by its FID or cast.
* @summary By FID or cast
* @param {ReactionsApiLookupReactionByIdRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<Reaction>} A promise that resolves to a `Reaction` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-reaction-by-id)
*
*/
lookupReactionById(requestParameters: ReactionsApiLookupReactionByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise<Reaction>;
};
/**
* ReactionsApi - interface
* @export
* @interface ReactionsApi
*/
export interface ReactionsApiInterface {
/**
* Retrieve all reactions (likes or recasts) on a specific cast in the Farcaster network. The cast is identified by its creator\'s FID and unique hash. This endpoint helps track engagement metrics and user interactions with specific content.
* @summary On cast
* @param {ReactionsApiFetchCastReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionsApiInterface
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions)
*
*/
fetchCastReactions(requestParameters: ReactionsApiFetchCastReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchCastReactions200Response>;
/**
* Fetch all reactions of a specific type (like or recast) that target a given URL. This endpoint is useful for tracking engagement with content across the Farcaster network.
* @summary To a target URL
* @param {ReactionsApiFetchReactionsByTargetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionsApiInterface
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-reactions-by-target)
*
*/
fetchReactionsByTarget(requestParameters: ReactionsApiFetchReactionsByTargetRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchCastReactions200Response>;
/**
* Fetch reactions by a user.
* @summary By FID
* @param {ReactionsApiFetchUserReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionsApiInterface
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions)
*
*/
fetchUserReactions(requestParameters: ReactionsApiFetchUserReactionsRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchCastReactions200Response>;
/**
* Lookup a reaction by its FID or cast.
* @summary By FID or cast
* @param {ReactionsApiLookupReactionByIdRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionsApiInterface
* @returns {Promise<Reaction>} A promise that resolves to a `Reaction` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-reaction-by-id)
*
*/
lookupReactionById(requestParameters: ReactionsApiLookupReactionByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise<Reaction>;
}
/**
* Request parameters for fetchCastReactions operation in ReactionsApi.
* @export
* @interface ReactionsApiFetchCastReactionsRequest
*/
export interface ReactionsApiFetchCastReactionsRequest {
/**
* The FID of the cast\'s creator. Required to uniquely identify the cast that received the reactions. Must be used in conjunction with target_hash.
*
*
*
* @type {number}
* @memberof ReactionsApiFetchCastReactions
*/
readonly targetFid: number;
/**
* The unique hash identifier of the cast that received the reactions. This is a 40-character hexadecimal string prefixed with \'0x\' that uniquely identifies the cast within the creator\'s posts. Must be used with target_fid.
*
*
*
* @type {string}
* @memberof ReactionsApiFetchCastReactions
*/
readonly targetHash: string;
/**
*
*
*
*
* @type {ReactionType}
* @memberof ReactionsApiFetchCastReactions
*/
readonly reactionType: ReactionType;
/**
* Maximum number of messages to return in a single response
*
*
*
* @type {number}
* @memberof ReactionsApiFetchCastReactions
*/
readonly pageSize?: number;
/**
* Reverse the sort order, returning latest messages first
*
*
*
* @type {boolean}
* @memberof ReactionsApiFetchCastReactions
*/
readonly reverse?: boolean;
/**
* The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page
*
*
*
* @type {string}
* @memberof ReactionsApiFetchCastReactions
*/
readonly pageToken?: string;
}
/**
* Request parameters for fetchReactionsByTarget operation in ReactionsApi.
* @export
* @interface ReactionsApiFetchReactionsByTargetRequest
*/
export interface ReactionsApiFetchReactionsByTargetRequest {
/**
* Target URL starting with \'chain://\'.
*
*
*
* @type {string}
* @memberof ReactionsApiFetchReactionsByTarget
*/
readonly url: string;
/**
*
*
*
*
* @type {ReactionType}
* @memberof ReactionsApiFetchReactionsByTarget
*/
readonly reactionType?: ReactionType;
/**
* Maximum number of messages to return in a single response
*
*
*
* @type {number}
* @memberof ReactionsApiFetchReactionsByTarget
*/
readonly pageSize?: number;
/**
* Reverse the sort order, returning latest messages first
*
*
*
* @type {boolean}
* @memberof ReactionsApiFetchReactionsByTarget
*/
readonly reverse?: boolean;
/**
* The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page
*
*
*
* @type {string}
* @memberof ReactionsApiFetchReactionsByTarget
*/
readonly pageToken?: string;
}
/**
* Request parameters for fetchUserReactions operation in ReactionsApi.
* @export
* @interface ReactionsApiFetchUserReactionsRequest
*/
export interface ReactionsApiFetchUserReactionsRequest {
/**
* The FID of the reaction\'s creator
*
*
*
* @type {number}
* @memberof ReactionsApiFetchUserReactions
*/
readonly fid: number;
/**
*
*
*
*
* @type {ReactionType}
* @memberof ReactionsApiFetchUserReactions
*/
readonly reactionType: ReactionType;
/**
* Maximum number of messages to return in a single response
*
*
*
* @type {number}
* @memberof ReactionsApiFetchUserReactions
*/
readonly pageSize?: number;
/**
* Reverse the sort order, returning latest messages first
*
*
*
* @type {boolean}
* @memberof ReactionsApiFetchUserReactions
*/
readonly reverse?: boolean;
/**
* The page token returned by the previous query, to fetch the next page. If this parameter is empty, fetch the first page
*
*
*
* @type {string}
* @memberof ReactionsApiFetchUserReactions
*/
readonly pageToken?: string;
}
/**
* Request parameters for lookupReactionById operation in ReactionsApi.
* @export
* @interface ReactionsApiLookupReactionByIdRequest
*/
export interface ReactionsApiLookupReactionByIdRequest {
/**
* The FID of the reaction\'s creator
*
*
*
* @type {number}
* @memberof ReactionsApiLookupReactionById
*/
readonly fid: number;
/**
* The FID of the cast\'s creator
*
*
*
* @type {number}
* @memberof ReactionsApiLookupReactionById
*/
readonly targetFid: number;
/**
* The cast\'s hash
*
*
*
* @type {string}
* @memberof ReactionsApiLookupReactionById
*/
readonly targetHash: string;
/**
*
*
*
*
* @type {ReactionType}
* @memberof ReactionsApiLookupReactionById
*/
readonly reactionType: ReactionType;
}
/**
* ReactionsApi - object-oriented interface
* @export
* @class ReactionsApi
* @extends {BaseAPI}
*/
export declare class ReactionsApi extends BaseAPI implements ReactionsApiInterface {
/**
* Retrieve all reactions (likes or recasts) on a specific cast in the Farcaster network. The cast is identified by its creator\'s FID and unique hash. This endpoint helps track engagement metrics and user interactions with specific content.
* @summary On cast
* @param {ReactionsApiFetchCastReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionsApi
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-cast-reactions)
*
*/
fetchCastReactions(requestParameters: ReactionsApiFetchCastReactionsRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<FetchCastReactions200Response, any>>;
/**
* Fetch all reactions of a specific type (like or recast) that target a given URL. This endpoint is useful for tracking engagement with content across the Farcaster network.
* @summary To a target URL
* @param {ReactionsApiFetchReactionsByTargetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionsApi
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-reactions-by-target)
*
*/
fetchReactionsByTarget(requestParameters: ReactionsApiFetchReactionsByTargetRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<FetchCastReactions200Response, any>>;
/**
* Fetch reactions by a user.
* @summary By FID
* @param {ReactionsApiFetchUserReactionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionsApi
* @returns {Promise<FetchCastReactions200Response>} A promise that resolves to a `FetchCastReactions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-reactions)
*
*/
fetchUserReactions(requestParameters: ReactionsApiFetchUserReactionsRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<FetchCastReactions200Response, any>>;
/**
* Lookup a reaction by its FID or cast.
* @summary By FID or cast
* @param {ReactionsApiLookupReactionByIdRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ReactionsApi
* @returns {Promise<Reaction>} A promise that resolves to a `Reaction` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-reaction-by-id)
*
*/
lookupReactionById(requestParameters: ReactionsApiLookupReactionByIdRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<Reaction, any>>;
}