UNPKG

@standard-crypto/farcaster-js-neynar

Version:

A tool for interacting with Farcaster via Neynar APIs.

249 lines 12.5 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Farcaster API V2 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 2.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.SignerApi = exports.SignerApiFactory = exports.SignerApiFp = exports.SignerApiAxiosParamCreator = 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"); /** * SignerApi - axios parameter creator * @export */ const SignerApiAxiosParamCreator = function (configuration) { return { /** * Creates a signer and returns the signer status. \\ **Note**: While testing please reuse the signer, it costs money to approve a signer. * @summary Creates a signer and returns the signer status * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSigner: async (options = {}) => { const localVarPath = `/farcaster/signer`; // 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: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_js_1.setApiKeyToObject)(localVarHeaderParameter, "api_key", configuration); (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, }; }, /** * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. * @summary Register Signed Key * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ registerSignedKey: async (registerSignerKeyReqBody, options = {}) => { // verify required parameter 'registerSignerKeyReqBody' is not null or undefined (0, common_js_1.assertParamExists)('registerSignedKey', 'registerSignerKeyReqBody', registerSignerKeyReqBody); const localVarPath = `/farcaster/signer/signed_key`; // 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: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_js_1.setApiKeyToObject)(localVarHeaderParameter, "api_key", configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_js_1.serializeDataIfNeeded)(registerSignerKeyReqBody, localVarRequestOptions, configuration); return { url: (0, common_js_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) * @summary Fetches the status of a signer * @param {string} signerUuid * @param {*} [options] Override http request option. * @throws {RequiredError} */ signer: async (signerUuid, options = {}) => { // verify required parameter 'signerUuid' is not null or undefined (0, common_js_1.assertParamExists)('signer', 'signerUuid', signerUuid); const localVarPath = `/farcaster/signer`; // 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 = {}; // authentication ApiKeyAuth required await (0, common_js_1.setApiKeyToObject)(localVarHeaderParameter, "api_key", configuration); if (signerUuid !== undefined) { localVarQueryParameter['signer_uuid'] = signerUuid; } (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.SignerApiAxiosParamCreator = SignerApiAxiosParamCreator; /** * SignerApi - functional programming interface * @export */ const SignerApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.SignerApiAxiosParamCreator)(configuration); return { /** * Creates a signer and returns the signer status. \\ **Note**: While testing please reuse the signer, it costs money to approve a signer. * @summary Creates a signer and returns the signer status * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createSigner(options) { const localVarAxiosArgs = await localVarAxiosParamCreator.createSigner(options); return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration); }, /** * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. * @summary Register Signed Key * @param {RegisterSignerKeyReqBody} registerSignerKeyReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ async registerSignedKey(registerSignerKeyReqBody, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.registerSignedKey(registerSignerKeyReqBody, options); return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration); }, /** * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) * @summary Fetches the status of a signer * @param {string} signerUuid * @param {*} [options] Override http request option. * @throws {RequiredError} */ async signer(signerUuid, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.signer(signerUuid, options); return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration); }, }; }; exports.SignerApiFp = SignerApiFp; /** * SignerApi - factory interface * @export */ const SignerApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.SignerApiFp)(configuration); return { /** * Creates a signer and returns the signer status. \\ **Note**: While testing please reuse the signer, it costs money to approve a signer. * @summary Creates a signer and returns the signer status * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSigner(options) { return localVarFp.createSigner(options).then((request) => request(axios, basePath)); }, /** * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. * @summary Register Signed Key * @param {SignerApiRegisterSignedKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ registerSignedKey(requestParameters, options) { return localVarFp.registerSignedKey(requestParameters.registerSignerKeyReqBody, options).then((request) => request(axios, basePath)); }, /** * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) * @summary Fetches the status of a signer * @param {SignerApiSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ signer(requestParameters, options) { return localVarFp.signer(requestParameters.signerUuid, options).then((request) => request(axios, basePath)); }, }; }; exports.SignerApiFactory = SignerApiFactory; /** * SignerApi - object-oriented interface * @export * @class SignerApi * @extends {BaseAPI} */ class SignerApi extends base_js_1.BaseAPI { /** * Creates a signer and returns the signer status. \\ **Note**: While testing please reuse the signer, it costs money to approve a signer. * @summary Creates a signer and returns the signer status * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi */ createSigner(options) { return (0, exports.SignerApiFp)(this.configuration).createSigner(options).then((request) => request(this.axios, this.basePath)); } /** * Registers an app fid, deadline and a signature. Returns the signer status with an approval url. * @summary Register Signed Key * @param {SignerApiRegisterSignedKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi */ registerSignedKey(requestParameters, options) { return (0, exports.SignerApiFp)(this.configuration).registerSignedKey(requestParameters.registerSignerKeyReqBody, options).then((request) => request(this.axios, this.basePath)); } /** * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) * @summary Fetches the status of a signer * @param {SignerApiSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi */ signer(requestParameters, options) { return (0, exports.SignerApiFp)(this.configuration).signer(requestParameters.signerUuid, options).then((request) => request(this.axios, this.basePath)); } } exports.SignerApi = SignerApi; //# sourceMappingURL=signer-api.js.map