UNPKG

@standard-crypto/farcaster-js-hub-rest

Version:

A tool for interacting with the REST API of any Farcaster hub.

265 lines 14.3 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Farcaster Hub REST API * Perform basic queries of Farcaster state via the REST API of a Farcaster hub. See the [Farcaster docs](https://www.thehubble.xyz/docs/httpapi/httpapi.html) for more details. Some client libraries: - [TypeScript](https://www.npmjs.com/package/@standard-crypto/farcaster-js-hub-rest) * * The version of the OpenAPI document: 1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.OnChainEventsApi = exports.OnChainEventsApiFactory = exports.OnChainEventsApiFp = exports.OnChainEventsApiAxiosParamCreator = void 0; const axios_1 = __importDefault(require("axios")); // Some imports not used depending on template conditions // @ts-ignore const common_js_1 = require("../common.js"); // @ts-ignore const base_js_1 = require("../base.js"); /** * OnChainEventsApi - axios parameter creator * @export */ const OnChainEventsApiAxiosParamCreator = function (configuration) { return { /** * * @summary Get an on chain ID Registry Event for a given Address * @param {string} address The ETH address being requested * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOnChainIdRegistrationByAddress: async (address, options = {}) => { // verify required parameter 'address' is not null or undefined (0, common_js_1.assertParamExists)('getOnChainIdRegistrationByAddress', 'address', address); const localVarPath = `/v1/onChainIdRegistryEventByAddress`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_js_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (address !== undefined) { localVarQueryParameter['address'] = address; } (0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_js_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get a list of on-chain events provided by an FID * @param {number} fid The FID being requested * @param {OnChainEventType} eventType The numeric of string value of the event type being requested. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listOnChainEventsByFid: async (fid, eventType, options = {}) => { // verify required parameter 'fid' is not null or undefined (0, common_js_1.assertParamExists)('listOnChainEventsByFid', 'fid', fid); // verify required parameter 'eventType' is not null or undefined (0, common_js_1.assertParamExists)('listOnChainEventsByFid', 'eventType', eventType); const localVarPath = `/v1/onChainEventsByFid`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_js_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (eventType !== undefined) { localVarQueryParameter['event_type'] = eventType; } (0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_js_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * **Note:** one of two different response schemas is returned based on whether the caller provides the `signer` parameter. If included, a single `OnChainEventSigner` message is returned (or a `not_found` error). If omitted, a non-paginated list of `OnChainEventSigner` messages is returned instead * @summary Get a list of signers provided by an FID * @param {number} fid The FID being requested * @param {string} [signer] The optional key of signer * @param {*} [options] Override http request option. * @throws {RequiredError} */ listOnChainSignersByFid: async (fid, signer, options = {}) => { // verify required parameter 'fid' is not null or undefined (0, common_js_1.assertParamExists)('listOnChainSignersByFid', 'fid', fid); const localVarPath = `/v1/onChainSignersByFid`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_js_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (signer !== undefined) { localVarQueryParameter['signer'] = signer; } (0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_js_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.OnChainEventsApiAxiosParamCreator = OnChainEventsApiAxiosParamCreator; /** * OnChainEventsApi - functional programming interface * @export */ const OnChainEventsApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.OnChainEventsApiAxiosParamCreator)(configuration); return { /** * * @summary Get an on chain ID Registry Event for a given Address * @param {string} address The ETH address being requested * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOnChainIdRegistrationByAddress(address, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getOnChainIdRegistrationByAddress(address, options); return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration); }, /** * * @summary Get a list of on-chain events provided by an FID * @param {number} fid The FID being requested * @param {OnChainEventType} eventType The numeric of string value of the event type being requested. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listOnChainEventsByFid(fid, eventType, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.listOnChainEventsByFid(fid, eventType, options); return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration); }, /** * **Note:** one of two different response schemas is returned based on whether the caller provides the `signer` parameter. If included, a single `OnChainEventSigner` message is returned (or a `not_found` error). If omitted, a non-paginated list of `OnChainEventSigner` messages is returned instead * @summary Get a list of signers provided by an FID * @param {number} fid The FID being requested * @param {string} [signer] The optional key of signer * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listOnChainSignersByFid(fid, signer, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.listOnChainSignersByFid(fid, signer, options); return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration); }, }; }; exports.OnChainEventsApiFp = OnChainEventsApiFp; /** * OnChainEventsApi - factory interface * @export */ const OnChainEventsApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.OnChainEventsApiFp)(configuration); return { /** * * @summary Get an on chain ID Registry Event for a given Address * @param {OnChainEventsApiGetOnChainIdRegistrationByAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOnChainIdRegistrationByAddress(requestParameters, options) { return localVarFp.getOnChainIdRegistrationByAddress(requestParameters.address, options).then((request) => request(axios, basePath)); }, /** * * @summary Get a list of on-chain events provided by an FID * @param {OnChainEventsApiListOnChainEventsByFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listOnChainEventsByFid(requestParameters, options) { return localVarFp.listOnChainEventsByFid(requestParameters.fid, requestParameters.eventType, options).then((request) => request(axios, basePath)); }, /** * **Note:** one of two different response schemas is returned based on whether the caller provides the `signer` parameter. If included, a single `OnChainEventSigner` message is returned (or a `not_found` error). If omitted, a non-paginated list of `OnChainEventSigner` messages is returned instead * @summary Get a list of signers provided by an FID * @param {OnChainEventsApiListOnChainSignersByFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listOnChainSignersByFid(requestParameters, options) { return localVarFp.listOnChainSignersByFid(requestParameters.fid, requestParameters.signer, options).then((request) => request(axios, basePath)); }, }; }; exports.OnChainEventsApiFactory = OnChainEventsApiFactory; /** * OnChainEventsApi - object-oriented interface * @export * @class OnChainEventsApi * @extends {BaseAPI} */ class OnChainEventsApi extends base_js_1.BaseAPI { /** * * @summary Get an on chain ID Registry Event for a given Address * @param {OnChainEventsApiGetOnChainIdRegistrationByAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OnChainEventsApi */ getOnChainIdRegistrationByAddress(requestParameters, options) { return (0, exports.OnChainEventsApiFp)(this.configuration).getOnChainIdRegistrationByAddress(requestParameters.address, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Get a list of on-chain events provided by an FID * @param {OnChainEventsApiListOnChainEventsByFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OnChainEventsApi */ listOnChainEventsByFid(requestParameters, options) { return (0, exports.OnChainEventsApiFp)(this.configuration).listOnChainEventsByFid(requestParameters.fid, requestParameters.eventType, options).then((request) => request(this.axios, this.basePath)); } /** * **Note:** one of two different response schemas is returned based on whether the caller provides the `signer` parameter. If included, a single `OnChainEventSigner` message is returned (or a `not_found` error). If omitted, a non-paginated list of `OnChainEventSigner` messages is returned instead * @summary Get a list of signers provided by an FID * @param {OnChainEventsApiListOnChainSignersByFidRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OnChainEventsApi */ listOnChainSignersByFid(requestParameters, options) { return (0, exports.OnChainEventsApiFp)(this.configuration).listOnChainSignersByFid(requestParameters.fid, requestParameters.signer, options).then((request) => request(this.axios, this.basePath)); } } exports.OnChainEventsApi = OnChainEventsApi; //# sourceMappingURL=on-chain-events-api.js.map