@neynar/nodejs-sdk
Version:
SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)
463 lines (462 loc) • 22.3 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.115.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 { SubscribedToResponse } from '../models';
import type { SubscribersResponse } from '../models';
import type { SubscriptionCheckResponse } from '../models';
import type { SubscriptionsResponse } from '../models';
/**
* SubscribersApi - axios parameter creator
* @export
*/
export declare const SubscribersApiAxiosParamCreator: (configuration?: Configuration) => {
/**
* Fetch what FIDs and contracts a FID is subscribed to.
* @summary Subscribed to
* @param {number} fid The unique identifier of a farcaster user or app (unsigned integer)
* @param {FetchSubscribedToForFidSubscriptionProviderEnum} subscriptionProvider The provider of the subscription.
* @param {number} [viewerFid]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscribedToResponse>} A promise that resolves to a `SubscribedToResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribed-to-for-fid)
*
*/
fetchSubscribedToForFid: (fid: number, subscriptionProvider: FetchSubscribedToForFidSubscriptionProviderEnum, viewerFid?: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Fetch subscribers for a given FID\'s contracts. Doesn\'t return addresses that don\'t have an FID.
* @summary Subscribers of a user
* @param {number} fid The unique identifier of a farcaster user or app (unsigned integer)
* @param {FetchSubscribersForFidSubscriptionProviderEnum} subscriptionProvider The provider of the subscription.
* @param {number} [viewerFid]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscribersResponse>} A promise that resolves to a `SubscribersResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribers-for-fid)
*
*/
fetchSubscribersForFid: (fid: number, subscriptionProvider: FetchSubscribersForFidSubscriptionProviderEnum, viewerFid?: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Check if a wallet address is subscribed to a given STP (Hypersub) contract.
* @summary Hypersub subscription check
* @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time
* @param {string} contractAddress Ethereum address of the STP contract
* @param {string} chainId Chain ID of the STP contract
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscriptionCheckResponse>} A promise that resolves to a `SubscriptionCheckResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscription-check)
*
*/
fetchSubscriptionCheck: (addresses: string, contractAddress: string, chainId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Fetch created subscriptions for a given FID\'s.
* @summary Subscriptions created by FID
* @param {number} fid The unique identifier of a farcaster user or app (unsigned integer)
* @param {FetchSubscriptionsForFidSubscriptionProviderEnum} subscriptionProvider The provider of the subscription.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscriptionsResponse>} A promise that resolves to a `SubscriptionsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscriptions-for-fid)
*
*/
fetchSubscriptionsForFid: (fid: number, subscriptionProvider: FetchSubscriptionsForFidSubscriptionProviderEnum, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
};
/**
* SubscribersApi - functional programming interface
* @export
*/
export declare const SubscribersApiFp: (configuration?: Configuration) => {
/**
* Fetch what FIDs and contracts a FID is subscribed to.
* @summary Subscribed to
* @param {number} fid The unique identifier of a farcaster user or app (unsigned integer)
* @param {FetchSubscribedToForFidSubscriptionProviderEnum} subscriptionProvider The provider of the subscription.
* @param {number} [viewerFid]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscribedToResponse>} A promise that resolves to a `SubscribedToResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribed-to-for-fid)
*
*/
fetchSubscribedToForFid(fid: number, subscriptionProvider: FetchSubscribedToForFidSubscriptionProviderEnum, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubscribedToResponse>>;
/**
* Fetch subscribers for a given FID\'s contracts. Doesn\'t return addresses that don\'t have an FID.
* @summary Subscribers of a user
* @param {number} fid The unique identifier of a farcaster user or app (unsigned integer)
* @param {FetchSubscribersForFidSubscriptionProviderEnum} subscriptionProvider The provider of the subscription.
* @param {number} [viewerFid]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscribersResponse>} A promise that resolves to a `SubscribersResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribers-for-fid)
*
*/
fetchSubscribersForFid(fid: number, subscriptionProvider: FetchSubscribersForFidSubscriptionProviderEnum, viewerFid?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubscribersResponse>>;
/**
* Check if a wallet address is subscribed to a given STP (Hypersub) contract.
* @summary Hypersub subscription check
* @param {string} addresses Comma separated list of Ethereum addresses, up to 350 at a time
* @param {string} contractAddress Ethereum address of the STP contract
* @param {string} chainId Chain ID of the STP contract
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscriptionCheckResponse>} A promise that resolves to a `SubscriptionCheckResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscription-check)
*
*/
fetchSubscriptionCheck(addresses: string, contractAddress: string, chainId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubscriptionCheckResponse>>;
/**
* Fetch created subscriptions for a given FID\'s.
* @summary Subscriptions created by FID
* @param {number} fid The unique identifier of a farcaster user or app (unsigned integer)
* @param {FetchSubscriptionsForFidSubscriptionProviderEnum} subscriptionProvider The provider of the subscription.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscriptionsResponse>} A promise that resolves to a `SubscriptionsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscriptions-for-fid)
*
*/
fetchSubscriptionsForFid(fid: number, subscriptionProvider: FetchSubscriptionsForFidSubscriptionProviderEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubscriptionsResponse>>;
};
/**
* SubscribersApi - factory interface
* @export
*/
export declare const SubscribersApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
/**
* Fetch what FIDs and contracts a FID is subscribed to.
* @summary Subscribed to
* @param {SubscribersApiFetchSubscribedToForFidRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscribedToResponse>} A promise that resolves to a `SubscribedToResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribed-to-for-fid)
*
*/
fetchSubscribedToForFid(requestParameters: SubscribersApiFetchSubscribedToForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise<SubscribedToResponse>;
/**
* Fetch subscribers for a given FID\'s contracts. Doesn\'t return addresses that don\'t have an FID.
* @summary Subscribers of a user
* @param {SubscribersApiFetchSubscribersForFidRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscribersResponse>} A promise that resolves to a `SubscribersResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribers-for-fid)
*
*/
fetchSubscribersForFid(requestParameters: SubscribersApiFetchSubscribersForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise<SubscribersResponse>;
/**
* Check if a wallet address is subscribed to a given STP (Hypersub) contract.
* @summary Hypersub subscription check
* @param {SubscribersApiFetchSubscriptionCheckRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscriptionCheckResponse>} A promise that resolves to a `SubscriptionCheckResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscription-check)
*
*/
fetchSubscriptionCheck(requestParameters: SubscribersApiFetchSubscriptionCheckRequest, options?: RawAxiosRequestConfig): AxiosPromise<SubscriptionCheckResponse>;
/**
* Fetch created subscriptions for a given FID\'s.
* @summary Subscriptions created by FID
* @param {SubscribersApiFetchSubscriptionsForFidRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<SubscriptionsResponse>} A promise that resolves to a `SubscriptionsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscriptions-for-fid)
*
*/
fetchSubscriptionsForFid(requestParameters: SubscribersApiFetchSubscriptionsForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise<SubscriptionsResponse>;
};
/**
* SubscribersApi - interface
* @export
* @interface SubscribersApi
*/
export interface SubscribersApiInterface {
/**
* Fetch what FIDs and contracts a FID is subscribed to.
* @summary Subscribed to
* @param {SubscribersApiFetchSubscribedToForFidRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscribersApiInterface
* @returns {Promise<SubscribedToResponse>} A promise that resolves to a `SubscribedToResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribed-to-for-fid)
*
*/
fetchSubscribedToForFid(requestParameters: SubscribersApiFetchSubscribedToForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise<SubscribedToResponse>;
/**
* Fetch subscribers for a given FID\'s contracts. Doesn\'t return addresses that don\'t have an FID.
* @summary Subscribers of a user
* @param {SubscribersApiFetchSubscribersForFidRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscribersApiInterface
* @returns {Promise<SubscribersResponse>} A promise that resolves to a `SubscribersResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribers-for-fid)
*
*/
fetchSubscribersForFid(requestParameters: SubscribersApiFetchSubscribersForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise<SubscribersResponse>;
/**
* Check if a wallet address is subscribed to a given STP (Hypersub) contract.
* @summary Hypersub subscription check
* @param {SubscribersApiFetchSubscriptionCheckRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscribersApiInterface
* @returns {Promise<SubscriptionCheckResponse>} A promise that resolves to a `SubscriptionCheckResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscription-check)
*
*/
fetchSubscriptionCheck(requestParameters: SubscribersApiFetchSubscriptionCheckRequest, options?: RawAxiosRequestConfig): AxiosPromise<SubscriptionCheckResponse>;
/**
* Fetch created subscriptions for a given FID\'s.
* @summary Subscriptions created by FID
* @param {SubscribersApiFetchSubscriptionsForFidRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscribersApiInterface
* @returns {Promise<SubscriptionsResponse>} A promise that resolves to a `SubscriptionsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscriptions-for-fid)
*
*/
fetchSubscriptionsForFid(requestParameters: SubscribersApiFetchSubscriptionsForFidRequest, options?: RawAxiosRequestConfig): AxiosPromise<SubscriptionsResponse>;
}
/**
* Request parameters for fetchSubscribedToForFid operation in SubscribersApi.
* @export
* @interface SubscribersApiFetchSubscribedToForFidRequest
*/
export interface SubscribersApiFetchSubscribedToForFidRequest {
/**
* The unique identifier of a farcaster user or app (unsigned integer)
*
*
*
* @type {number}
* @memberof SubscribersApiFetchSubscribedToForFid
*/
readonly fid: number;
/**
* The provider of the subscription.
*
*
*
* @type {'fabric_stp'}
* @memberof SubscribersApiFetchSubscribedToForFid
*/
readonly subscriptionProvider: FetchSubscribedToForFidSubscriptionProviderEnum;
/**
*
*
*
*
* @type {number}
* @memberof SubscribersApiFetchSubscribedToForFid
*/
readonly viewerFid?: number;
}
/**
* Request parameters for fetchSubscribersForFid operation in SubscribersApi.
* @export
* @interface SubscribersApiFetchSubscribersForFidRequest
*/
export interface SubscribersApiFetchSubscribersForFidRequest {
/**
* The unique identifier of a farcaster user or app (unsigned integer)
*
*
*
* @type {number}
* @memberof SubscribersApiFetchSubscribersForFid
*/
readonly fid: number;
/**
* The provider of the subscription.
*
*
*
* @type {'fabric_stp' | 'paragraph'}
* @memberof SubscribersApiFetchSubscribersForFid
*/
readonly subscriptionProvider: FetchSubscribersForFidSubscriptionProviderEnum;
/**
*
*
*
*
* @type {number}
* @memberof SubscribersApiFetchSubscribersForFid
*/
readonly viewerFid?: number;
}
/**
* Request parameters for fetchSubscriptionCheck operation in SubscribersApi.
* @export
* @interface SubscribersApiFetchSubscriptionCheckRequest
*/
export interface SubscribersApiFetchSubscriptionCheckRequest {
/**
* Comma separated list of Ethereum addresses, up to 350 at a time
*
* @commaSeparated
*
* @type {string}
* @memberof SubscribersApiFetchSubscriptionCheck
*/
readonly addresses: string;
/**
* Ethereum address of the STP contract
*
*
*
* @type {string}
* @memberof SubscribersApiFetchSubscriptionCheck
*/
readonly contractAddress: string;
/**
* Chain ID of the STP contract
*
*
*
* @type {string}
* @memberof SubscribersApiFetchSubscriptionCheck
*/
readonly chainId: string;
}
/**
* Request parameters for fetchSubscriptionsForFid operation in SubscribersApi.
* @export
* @interface SubscribersApiFetchSubscriptionsForFidRequest
*/
export interface SubscribersApiFetchSubscriptionsForFidRequest {
/**
* The unique identifier of a farcaster user or app (unsigned integer)
*
*
*
* @type {number}
* @memberof SubscribersApiFetchSubscriptionsForFid
*/
readonly fid: number;
/**
* The provider of the subscription.
*
*
*
* @type {'fabric_stp'}
* @memberof SubscribersApiFetchSubscriptionsForFid
*/
readonly subscriptionProvider: FetchSubscriptionsForFidSubscriptionProviderEnum;
}
/**
* SubscribersApi - object-oriented interface
* @export
* @class SubscribersApi
* @extends {BaseAPI}
*/
export declare class SubscribersApi extends BaseAPI implements SubscribersApiInterface {
/**
* Fetch what FIDs and contracts a FID is subscribed to.
* @summary Subscribed to
* @param {SubscribersApiFetchSubscribedToForFidRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscribersApi
* @returns {Promise<SubscribedToResponse>} A promise that resolves to a `SubscribedToResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribed-to-for-fid)
*
*/
fetchSubscribedToForFid(requestParameters: SubscribersApiFetchSubscribedToForFidRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<SubscribedToResponse, any, {}>>;
/**
* Fetch subscribers for a given FID\'s contracts. Doesn\'t return addresses that don\'t have an FID.
* @summary Subscribers of a user
* @param {SubscribersApiFetchSubscribersForFidRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscribersApi
* @returns {Promise<SubscribersResponse>} A promise that resolves to a `SubscribersResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscribers-for-fid)
*
*/
fetchSubscribersForFid(requestParameters: SubscribersApiFetchSubscribersForFidRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<SubscribersResponse, any, {}>>;
/**
* Check if a wallet address is subscribed to a given STP (Hypersub) contract.
* @summary Hypersub subscription check
* @param {SubscribersApiFetchSubscriptionCheckRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscribersApi
* @returns {Promise<SubscriptionCheckResponse>} A promise that resolves to a `SubscriptionCheckResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscription-check)
*
*/
fetchSubscriptionCheck(requestParameters: SubscribersApiFetchSubscriptionCheckRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<SubscriptionCheckResponse, any, {}>>;
/**
* Fetch created subscriptions for a given FID\'s.
* @summary Subscriptions created by FID
* @param {SubscribersApiFetchSubscriptionsForFidRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SubscribersApi
* @returns {Promise<SubscriptionsResponse>} A promise that resolves to a `SubscriptionsResponse` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-subscriptions-for-fid)
*
*/
fetchSubscriptionsForFid(requestParameters: SubscribersApiFetchSubscriptionsForFidRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<SubscriptionsResponse, any, {}>>;
}
/**
* @export
*/
export declare const FetchSubscribedToForFidSubscriptionProviderEnum: {
readonly FabricStp: "fabric_stp";
};
export type FetchSubscribedToForFidSubscriptionProviderEnum = typeof FetchSubscribedToForFidSubscriptionProviderEnum[keyof typeof FetchSubscribedToForFidSubscriptionProviderEnum];
/**
* @export
*/
export declare const FetchSubscribersForFidSubscriptionProviderEnum: {
readonly FabricStp: "fabric_stp";
readonly Paragraph: "paragraph";
};
export type FetchSubscribersForFidSubscriptionProviderEnum = typeof FetchSubscribersForFidSubscriptionProviderEnum[keyof typeof FetchSubscribersForFidSubscriptionProviderEnum];
/**
* @export
*/
export declare const FetchSubscriptionsForFidSubscriptionProviderEnum: {
readonly FabricStp: "fabric_stp";
};
export type FetchSubscriptionsForFidSubscriptionProviderEnum = typeof FetchSubscriptionsForFidSubscriptionProviderEnum[keyof typeof FetchSubscriptionsForFidSubscriptionProviderEnum];