UNPKG

@neynar/nodejs-sdk

Version:

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

495 lines (494 loc) 24.9 kB
/** * 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 { CastAdd } from '../models'; import type { FetchCastsByParent200Response } from '../models'; import type { FetchUsersCasts200Response } from '../models'; /** * CastsApi - axios parameter creator * @export */ export declare const CastsApiAxiosParamCreator: (configuration?: Configuration) => { /** * Retrieve all reply casts (responses) to a specific parent cast in the Farcaster network. Parent casts can be identified using either a combination of FID and hash, or by their URL. This endpoint enables traversal of conversation threads and retrieval of all responses to a particular cast. * @summary By parent cast * @param {number} [fid] The Farcaster ID (FID) of the parent cast\&#39;s creator. This parameter must be used together with the \&#39;hash\&#39; parameter to uniquely identify a parent cast. Required only when using hash-based lookup instead of URL-based lookup. The FID is a unique identifier assigned to each Farcaster user. * @param {string} [hash] The unique hash identifier of the parent cast. Must be used together with the \&#39;fid\&#39; parameter when doing hash-based lookup. This is a 40-character hexadecimal string prefixed with \&#39;0x\&#39; that uniquely identifies the cast within the creator\&#39;s posts. Not required if using URL-based lookup. * @param {string} [url] Cast URL starting with \&#39;chain://\&#39; * @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<FetchCastsByParent200Response>} A promise that resolves to a `FetchCastsByParent200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-by-parent) * */ fetchCastsByParent: (fid?: number, hash?: string, url?: string, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * Fetch casts mentioning a user. * @summary Mentioning an FID * @param {number} fid The FID that is mentioned in a cast * @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<FetchUsersCasts200Response>} A promise that resolves to a `FetchUsersCasts200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-mentioning-user) * */ fetchCastsMentioningUser: (fid: number, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * Fetch user\'s casts. * @summary By FID * @param {number} fid The FID of the casts\&#39; creator * @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<FetchUsersCasts200Response>} A promise that resolves to a `FetchUsersCasts200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-casts) * */ fetchUsersCasts: (fid: number, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * Lookup a cast by its FID and hash. * @summary By FID and Hash * @param {number} fid The FID of the cast\&#39;s creator * @param {string} hash The unique hash identifier of the cast. This is a 40-character hexadecimal string prefixed with \&#39;0x\&#39; that uniquely identifies a specific cast in the Farcaster network. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<CastAdd>} A promise that resolves to a `CastAdd` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-and-fid) * */ lookupCastByHashAndFid: (fid: number, hash: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; }; /** * CastsApi - functional programming interface * @export */ export declare const CastsApiFp: (configuration?: Configuration) => { /** * Retrieve all reply casts (responses) to a specific parent cast in the Farcaster network. Parent casts can be identified using either a combination of FID and hash, or by their URL. This endpoint enables traversal of conversation threads and retrieval of all responses to a particular cast. * @summary By parent cast * @param {number} [fid] The Farcaster ID (FID) of the parent cast\&#39;s creator. This parameter must be used together with the \&#39;hash\&#39; parameter to uniquely identify a parent cast. Required only when using hash-based lookup instead of URL-based lookup. The FID is a unique identifier assigned to each Farcaster user. * @param {string} [hash] The unique hash identifier of the parent cast. Must be used together with the \&#39;fid\&#39; parameter when doing hash-based lookup. This is a 40-character hexadecimal string prefixed with \&#39;0x\&#39; that uniquely identifies the cast within the creator\&#39;s posts. Not required if using URL-based lookup. * @param {string} [url] Cast URL starting with \&#39;chain://\&#39; * @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<FetchCastsByParent200Response>} A promise that resolves to a `FetchCastsByParent200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-by-parent) * */ fetchCastsByParent(fid?: number, hash?: string, url?: string, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FetchCastsByParent200Response>>; /** * Fetch casts mentioning a user. * @summary Mentioning an FID * @param {number} fid The FID that is mentioned in a cast * @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<FetchUsersCasts200Response>} A promise that resolves to a `FetchUsersCasts200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-mentioning-user) * */ fetchCastsMentioningUser(fid: number, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FetchUsersCasts200Response>>; /** * Fetch user\'s casts. * @summary By FID * @param {number} fid The FID of the casts\&#39; creator * @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<FetchUsersCasts200Response>} A promise that resolves to a `FetchUsersCasts200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-casts) * */ fetchUsersCasts(fid: number, pageSize?: number, reverse?: boolean, pageToken?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FetchUsersCasts200Response>>; /** * Lookup a cast by its FID and hash. * @summary By FID and Hash * @param {number} fid The FID of the cast\&#39;s creator * @param {string} hash The unique hash identifier of the cast. This is a 40-character hexadecimal string prefixed with \&#39;0x\&#39; that uniquely identifies a specific cast in the Farcaster network. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<CastAdd>} A promise that resolves to a `CastAdd` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-and-fid) * */ lookupCastByHashAndFid(fid: number, hash: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CastAdd>>; }; /** * CastsApi - factory interface * @export */ export declare const CastsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Retrieve all reply casts (responses) to a specific parent cast in the Farcaster network. Parent casts can be identified using either a combination of FID and hash, or by their URL. This endpoint enables traversal of conversation threads and retrieval of all responses to a particular cast. * @summary By parent cast * @param {CastsApiFetchCastsByParentRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FetchCastsByParent200Response>} A promise that resolves to a `FetchCastsByParent200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-by-parent) * */ fetchCastsByParent(requestParameters?: CastsApiFetchCastsByParentRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchCastsByParent200Response>; /** * Fetch casts mentioning a user. * @summary Mentioning an FID * @param {CastsApiFetchCastsMentioningUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FetchUsersCasts200Response>} A promise that resolves to a `FetchUsersCasts200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-mentioning-user) * */ fetchCastsMentioningUser(requestParameters: CastsApiFetchCastsMentioningUserRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchUsersCasts200Response>; /** * Fetch user\'s casts. * @summary By FID * @param {CastsApiFetchUsersCastsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<FetchUsersCasts200Response>} A promise that resolves to a `FetchUsersCasts200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-casts) * */ fetchUsersCasts(requestParameters: CastsApiFetchUsersCastsRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchUsersCasts200Response>; /** * Lookup a cast by its FID and hash. * @summary By FID and Hash * @param {CastsApiLookupCastByHashAndFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<CastAdd>} A promise that resolves to a `CastAdd` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-and-fid) * */ lookupCastByHashAndFid(requestParameters: CastsApiLookupCastByHashAndFidRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastAdd>; }; /** * CastsApi - interface * @export * @interface CastsApi */ export interface CastsApiInterface { /** * Retrieve all reply casts (responses) to a specific parent cast in the Farcaster network. Parent casts can be identified using either a combination of FID and hash, or by their URL. This endpoint enables traversal of conversation threads and retrieval of all responses to a particular cast. * @summary By parent cast * @param {CastsApiFetchCastsByParentRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastsApiInterface * @returns {Promise<FetchCastsByParent200Response>} A promise that resolves to a `FetchCastsByParent200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-by-parent) * */ fetchCastsByParent(requestParameters?: CastsApiFetchCastsByParentRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchCastsByParent200Response>; /** * Fetch casts mentioning a user. * @summary Mentioning an FID * @param {CastsApiFetchCastsMentioningUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastsApiInterface * @returns {Promise<FetchUsersCasts200Response>} A promise that resolves to a `FetchUsersCasts200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-mentioning-user) * */ fetchCastsMentioningUser(requestParameters: CastsApiFetchCastsMentioningUserRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchUsersCasts200Response>; /** * Fetch user\'s casts. * @summary By FID * @param {CastsApiFetchUsersCastsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastsApiInterface * @returns {Promise<FetchUsersCasts200Response>} A promise that resolves to a `FetchUsersCasts200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-casts) * */ fetchUsersCasts(requestParameters: CastsApiFetchUsersCastsRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchUsersCasts200Response>; /** * Lookup a cast by its FID and hash. * @summary By FID and Hash * @param {CastsApiLookupCastByHashAndFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastsApiInterface * @returns {Promise<CastAdd>} A promise that resolves to a `CastAdd` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-and-fid) * */ lookupCastByHashAndFid(requestParameters: CastsApiLookupCastByHashAndFidRequest, options?: RawAxiosRequestConfig): AxiosPromise<CastAdd>; } /** * Request parameters for fetchCastsByParent operation in CastsApi. * @export * @interface CastsApiFetchCastsByParentRequest */ export interface CastsApiFetchCastsByParentRequest { /** * The Farcaster ID (FID) of the parent cast\&#39;s creator. This parameter must be used together with the \&#39;hash\&#39; parameter to uniquely identify a parent cast. Required only when using hash-based lookup instead of URL-based lookup. The FID is a unique identifier assigned to each Farcaster user. * * * * @type {number} * @memberof CastsApiFetchCastsByParent */ readonly fid?: number; /** * The unique hash identifier of the parent cast. Must be used together with the \&#39;fid\&#39; parameter when doing hash-based lookup. This is a 40-character hexadecimal string prefixed with \&#39;0x\&#39; that uniquely identifies the cast within the creator\&#39;s posts. Not required if using URL-based lookup. * * * * @type {string} * @memberof CastsApiFetchCastsByParent */ readonly hash?: string; /** * Cast URL starting with \&#39;chain://\&#39; * * * * @type {string} * @memberof CastsApiFetchCastsByParent */ readonly url?: string; /** * Maximum number of messages to return in a single response * * * * @type {number} * @memberof CastsApiFetchCastsByParent */ readonly pageSize?: number; /** * Reverse the sort order, returning latest messages first * * * * @type {boolean} * @memberof CastsApiFetchCastsByParent */ 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 CastsApiFetchCastsByParent */ readonly pageToken?: string; } /** * Request parameters for fetchCastsMentioningUser operation in CastsApi. * @export * @interface CastsApiFetchCastsMentioningUserRequest */ export interface CastsApiFetchCastsMentioningUserRequest { /** * The FID that is mentioned in a cast * * * * @type {number} * @memberof CastsApiFetchCastsMentioningUser */ readonly fid: number; /** * Maximum number of messages to return in a single response * * * * @type {number} * @memberof CastsApiFetchCastsMentioningUser */ readonly pageSize?: number; /** * Reverse the sort order, returning latest messages first * * * * @type {boolean} * @memberof CastsApiFetchCastsMentioningUser */ 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 CastsApiFetchCastsMentioningUser */ readonly pageToken?: string; } /** * Request parameters for fetchUsersCasts operation in CastsApi. * @export * @interface CastsApiFetchUsersCastsRequest */ export interface CastsApiFetchUsersCastsRequest { /** * The FID of the casts\&#39; creator * * * * @type {number} * @memberof CastsApiFetchUsersCasts */ readonly fid: number; /** * Maximum number of messages to return in a single response * * * * @type {number} * @memberof CastsApiFetchUsersCasts */ readonly pageSize?: number; /** * Reverse the sort order, returning latest messages first * * * * @type {boolean} * @memberof CastsApiFetchUsersCasts */ 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 CastsApiFetchUsersCasts */ readonly pageToken?: string; } /** * Request parameters for lookupCastByHashAndFid operation in CastsApi. * @export * @interface CastsApiLookupCastByHashAndFidRequest */ export interface CastsApiLookupCastByHashAndFidRequest { /** * The FID of the cast\&#39;s creator * * * * @type {number} * @memberof CastsApiLookupCastByHashAndFid */ readonly fid: number; /** * The unique hash identifier of the cast. This is a 40-character hexadecimal string prefixed with \&#39;0x\&#39; that uniquely identifies a specific cast in the Farcaster network. * * * * @type {string} * @memberof CastsApiLookupCastByHashAndFid */ readonly hash: string; } /** * CastsApi - object-oriented interface * @export * @class CastsApi * @extends {BaseAPI} */ export declare class CastsApi extends BaseAPI implements CastsApiInterface { /** * Retrieve all reply casts (responses) to a specific parent cast in the Farcaster network. Parent casts can be identified using either a combination of FID and hash, or by their URL. This endpoint enables traversal of conversation threads and retrieval of all responses to a particular cast. * @summary By parent cast * @param {CastsApiFetchCastsByParentRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastsApi * @returns {Promise<FetchCastsByParent200Response>} A promise that resolves to a `FetchCastsByParent200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-by-parent) * */ fetchCastsByParent(requestParameters?: CastsApiFetchCastsByParentRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<FetchCastsByParent200Response, any, {}>>; /** * Fetch casts mentioning a user. * @summary Mentioning an FID * @param {CastsApiFetchCastsMentioningUserRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastsApi * @returns {Promise<FetchUsersCasts200Response>} A promise that resolves to a `FetchUsersCasts200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-casts-mentioning-user) * */ fetchCastsMentioningUser(requestParameters: CastsApiFetchCastsMentioningUserRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<FetchUsersCasts200Response, any, {}>>; /** * Fetch user\'s casts. * @summary By FID * @param {CastsApiFetchUsersCastsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastsApi * @returns {Promise<FetchUsersCasts200Response>} A promise that resolves to a `FetchUsersCasts200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-users-casts) * */ fetchUsersCasts(requestParameters: CastsApiFetchUsersCastsRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<FetchUsersCasts200Response, any, {}>>; /** * Lookup a cast by its FID and hash. * @summary By FID and Hash * @param {CastsApiLookupCastByHashAndFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CastsApi * @returns {Promise<CastAdd>} A promise that resolves to a `CastAdd` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-by-hash-and-fid) * */ lookupCastByHashAndFid(requestParameters: CastsApiLookupCastByHashAndFidRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<CastAdd, any, {}>>; }