@neynar/nodejs-sdk
Version:
SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)
331 lines (330 loc) • 16.7 kB
TypeScript
/**
* Neynar API
* The Neynar API allows you to interact with the Farcaster protocol among other things. See the [Neynar docs](https://docs.neynar.com/reference) for more details.
*
* The version of the OpenAPI document: 3.34.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 { ConversationSummary } from '../models';
import type { FetchUserInteractions200Response } from '../models';
import type { FramePayTransactionReqBody } from '../models';
import type { TransactionFrameResponse } from '../models';
/**
* AgentsApi - axios parameter creator
* @export
*/
export declare const AgentsApiAxiosParamCreator: (configuration?: Configuration) => {
/**
* Creates a new transaction pay mini app that can be used to collect payments through a mini app
* @summary Create transaction pay mini app
* @param {FramePayTransactionReqBody} framePayTransactionReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<TransactionFrameResponse>} A promise that resolves to a `TransactionFrameResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-transaction-pay-frame)
*
*/
createTransactionPayFrame: (framePayTransactionReqBody: FramePayTransactionReqBody, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Returns a list of interactions between two users
* @summary User interactions
* @param {string} fids Comma separated list of two FIDs
* @param {Array<FetchUserInteractionsTypeEnum>} [type] Comma seperated list of Interaction type to fetch
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchUserInteractions200Response>} A promise that resolves to a `FetchUserInteractions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-interactions)
*
*/
fetchUserInteractions: (fids: string, type?: Array<FetchUserInteractionsTypeEnum>, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Generates a summary of all casts related to a conversation surrounding a cast by passing in a cast hash or Farcaster URL. Summary is generated by an LLM and is intended to be passed as a context to AI agents.
* @summary Cast conversation summary
* @param {string} identifier Cast identifier (It\'s either a URL or a hash))
* @param {number} [limit] Number of casts to consider in a summary up to a point of target cast (Default: 20, Maximum: 50)
* @param {string} [prompt] Additional prompt used to generate a summary
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<ConversationSummary>} A promise that resolves to a `ConversationSummary` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation-summary)
*
*/
lookupCastConversationSummary: (identifier: string, limit?: number, prompt?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
};
/**
* AgentsApi - functional programming interface
* @export
*/
export declare const AgentsApiFp: (configuration?: Configuration) => {
/**
* Creates a new transaction pay mini app that can be used to collect payments through a mini app
* @summary Create transaction pay mini app
* @param {FramePayTransactionReqBody} framePayTransactionReqBody
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<TransactionFrameResponse>} A promise that resolves to a `TransactionFrameResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-transaction-pay-frame)
*
*/
createTransactionPayFrame(framePayTransactionReqBody: FramePayTransactionReqBody, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TransactionFrameResponse>>;
/**
* Returns a list of interactions between two users
* @summary User interactions
* @param {string} fids Comma separated list of two FIDs
* @param {Array<FetchUserInteractionsTypeEnum>} [type] Comma seperated list of Interaction type to fetch
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchUserInteractions200Response>} A promise that resolves to a `FetchUserInteractions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-interactions)
*
*/
fetchUserInteractions(fids: string, type?: Array<FetchUserInteractionsTypeEnum>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FetchUserInteractions200Response>>;
/**
* Generates a summary of all casts related to a conversation surrounding a cast by passing in a cast hash or Farcaster URL. Summary is generated by an LLM and is intended to be passed as a context to AI agents.
* @summary Cast conversation summary
* @param {string} identifier Cast identifier (It\'s either a URL or a hash))
* @param {number} [limit] Number of casts to consider in a summary up to a point of target cast (Default: 20, Maximum: 50)
* @param {string} [prompt] Additional prompt used to generate a summary
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<ConversationSummary>} A promise that resolves to a `ConversationSummary` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation-summary)
*
*/
lookupCastConversationSummary(identifier: string, limit?: number, prompt?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ConversationSummary>>;
};
/**
* AgentsApi - factory interface
* @export
*/
export declare const AgentsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
/**
* Creates a new transaction pay mini app that can be used to collect payments through a mini app
* @summary Create transaction pay mini app
* @param {AgentsApiCreateTransactionPayFrameRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<TransactionFrameResponse>} A promise that resolves to a `TransactionFrameResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-transaction-pay-frame)
*
*/
createTransactionPayFrame(requestParameters: AgentsApiCreateTransactionPayFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise<TransactionFrameResponse>;
/**
* Returns a list of interactions between two users
* @summary User interactions
* @param {AgentsApiFetchUserInteractionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<FetchUserInteractions200Response>} A promise that resolves to a `FetchUserInteractions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-interactions)
*
*/
fetchUserInteractions(requestParameters: AgentsApiFetchUserInteractionsRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchUserInteractions200Response>;
/**
* Generates a summary of all casts related to a conversation surrounding a cast by passing in a cast hash or Farcaster URL. Summary is generated by an LLM and is intended to be passed as a context to AI agents.
* @summary Cast conversation summary
* @param {AgentsApiLookupCastConversationSummaryRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<ConversationSummary>} A promise that resolves to a `ConversationSummary` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation-summary)
*
*/
lookupCastConversationSummary(requestParameters: AgentsApiLookupCastConversationSummaryRequest, options?: RawAxiosRequestConfig): AxiosPromise<ConversationSummary>;
};
/**
* AgentsApi - interface
* @export
* @interface AgentsApi
*/
export interface AgentsApiInterface {
/**
* Creates a new transaction pay mini app that can be used to collect payments through a mini app
* @summary Create transaction pay mini app
* @param {AgentsApiCreateTransactionPayFrameRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AgentsApiInterface
* @returns {Promise<TransactionFrameResponse>} A promise that resolves to a `TransactionFrameResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-transaction-pay-frame)
*
*/
createTransactionPayFrame(requestParameters: AgentsApiCreateTransactionPayFrameRequest, options?: RawAxiosRequestConfig): AxiosPromise<TransactionFrameResponse>;
/**
* Returns a list of interactions between two users
* @summary User interactions
* @param {AgentsApiFetchUserInteractionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AgentsApiInterface
* @returns {Promise<FetchUserInteractions200Response>} A promise that resolves to a `FetchUserInteractions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-interactions)
*
*/
fetchUserInteractions(requestParameters: AgentsApiFetchUserInteractionsRequest, options?: RawAxiosRequestConfig): AxiosPromise<FetchUserInteractions200Response>;
/**
* Generates a summary of all casts related to a conversation surrounding a cast by passing in a cast hash or Farcaster URL. Summary is generated by an LLM and is intended to be passed as a context to AI agents.
* @summary Cast conversation summary
* @param {AgentsApiLookupCastConversationSummaryRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AgentsApiInterface
* @returns {Promise<ConversationSummary>} A promise that resolves to a `ConversationSummary` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation-summary)
*
*/
lookupCastConversationSummary(requestParameters: AgentsApiLookupCastConversationSummaryRequest, options?: RawAxiosRequestConfig): AxiosPromise<ConversationSummary>;
}
/**
* Request parameters for createTransactionPayFrame operation in AgentsApi.
* @export
* @interface AgentsApiCreateTransactionPayFrameRequest
*/
export interface AgentsApiCreateTransactionPayFrameRequest {
/**
*
*
*
*
* @type {FramePayTransactionReqBody}
* @memberof AgentsApiCreateTransactionPayFrame
*/
readonly framePayTransactionReqBody: FramePayTransactionReqBody;
}
/**
* Request parameters for fetchUserInteractions operation in AgentsApi.
* @export
* @interface AgentsApiFetchUserInteractionsRequest
*/
export interface AgentsApiFetchUserInteractionsRequest {
/**
* Comma separated list of two FIDs
* @acceptAs integer
* @commaSeparated
*
* @type {string}
* @memberof AgentsApiFetchUserInteractions
*/
readonly fids: string;
/**
* Comma seperated list of Interaction type to fetch
*
*
*
* @type {Array<'follows' | 'recasts' | 'likes' | 'mentions' | 'replies' | 'quotes'>}
* @memberof AgentsApiFetchUserInteractions
*/
readonly type?: Array<FetchUserInteractionsTypeEnum>;
}
/**
* Request parameters for lookupCastConversationSummary operation in AgentsApi.
* @export
* @interface AgentsApiLookupCastConversationSummaryRequest
*/
export interface AgentsApiLookupCastConversationSummaryRequest {
/**
* Cast identifier (It\'s either a URL or a hash))
*
*
*
* @type {string}
* @memberof AgentsApiLookupCastConversationSummary
*/
readonly identifier: string;
/**
* Number of casts to consider in a summary up to a point of target cast (Default: 20, Maximum: 50)
*
*
*
* @type {number}
* @memberof AgentsApiLookupCastConversationSummary
*/
readonly limit?: number;
/**
* Additional prompt used to generate a summary
*
*
*
* @type {string}
* @memberof AgentsApiLookupCastConversationSummary
*/
readonly prompt?: string;
}
/**
* AgentsApi - object-oriented interface
* @export
* @class AgentsApi
* @extends {BaseAPI}
*/
export declare class AgentsApi extends BaseAPI implements AgentsApiInterface {
/**
* Creates a new transaction pay mini app that can be used to collect payments through a mini app
* @summary Create transaction pay mini app
* @param {AgentsApiCreateTransactionPayFrameRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AgentsApi
* @returns {Promise<TransactionFrameResponse>} A promise that resolves to a `TransactionFrameResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-transaction-pay-frame)
*
*/
createTransactionPayFrame(requestParameters: AgentsApiCreateTransactionPayFrameRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<TransactionFrameResponse, any>>;
/**
* Returns a list of interactions between two users
* @summary User interactions
* @param {AgentsApiFetchUserInteractionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AgentsApi
* @returns {Promise<FetchUserInteractions200Response>} A promise that resolves to a `FetchUserInteractions200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-interactions)
*
*/
fetchUserInteractions(requestParameters: AgentsApiFetchUserInteractionsRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<FetchUserInteractions200Response, any>>;
/**
* Generates a summary of all casts related to a conversation surrounding a cast by passing in a cast hash or Farcaster URL. Summary is generated by an LLM and is intended to be passed as a context to AI agents.
* @summary Cast conversation summary
* @param {AgentsApiLookupCastConversationSummaryRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AgentsApi
* @returns {Promise<ConversationSummary>} A promise that resolves to a `ConversationSummary` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-cast-conversation-summary)
*
*/
lookupCastConversationSummary(requestParameters: AgentsApiLookupCastConversationSummaryRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ConversationSummary, any>>;
}
/**
* @export
*/
export declare const FetchUserInteractionsTypeEnum: {
readonly Follows: "follows";
readonly Recasts: "recasts";
readonly Likes: "likes";
readonly Mentions: "mentions";
readonly Replies: "replies";
readonly Quotes: "quotes";
};
export type FetchUserInteractionsTypeEnum = typeof FetchUserInteractionsTypeEnum[keyof typeof FetchUserInteractionsTypeEnum];