@standard-crypto/farcaster-js-neynar
Version:
A tool for interacting with Farcaster via Neynar APIs.
239 lines • 11.8 kB
JavaScript
/* 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.
*/
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common.js';
// @ts-ignore
import { BASE_PATH, BaseAPI } from '../base.js';
/**
* SignerApi - axios parameter creator
* @export
*/
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, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: 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
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, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(registerSignerKeyReqBody, localVarRequestOptions, configuration);
return {
url: 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
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, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration);
if (signerUuid !== undefined) {
localVarQueryParameter['signer_uuid'] = signerUuid;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* SignerApi - functional programming interface
* @export
*/
export const SignerApiFp = function (configuration) {
const localVarAxiosParamCreator = 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 createRequestFunction(localVarAxiosArgs, globalAxios, 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 createRequestFunction(localVarAxiosArgs, globalAxios, 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 createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* SignerApi - factory interface
* @export
*/
export const SignerApiFactory = function (configuration, basePath, axios) {
const localVarFp = 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));
},
};
};
/**
* SignerApi - object-oriented interface
* @export
* @class SignerApi
* @extends {BaseAPI}
*/
export class SignerApi extends 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 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 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 SignerApiFp(this.configuration).signer(requestParameters.signerUuid, options).then((request) => request(this.axios, this.basePath));
}
}
//# sourceMappingURL=signer-api.js.map