UNPKG

@neynar/nodejs-sdk

Version:

SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)

744 lines (743 loc) 46.3 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * 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. */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.FetchAuthorizationUrlResponseTypeEnum = 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_1 = require("../common"); // @ts-ignore const base_1 = require("../base"); /** * SignerApi - axios parameter creator * @export */ const SignerApiAxiosParamCreator = function (configuration) { return { /** * Creates a signer and returns the signer status. **Note**: While tesing please reuse the signer, it costs money to approve a signer. * @summary Create signer * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-signer) * */ createSigner: async (options = {}) => { const localVarPath = `/v2/farcaster/signer/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Fetch authorization url (Fetched authorized url useful for SIWN login operation) * @summary Fetch authorization url * @param {string} clientId * @param {FetchAuthorizationUrlResponseTypeEnum} responseType * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AuthorizationUrlResponse>} A promise that resolves to a `AuthorizationUrlResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-authorization-url) * */ fetchAuthorizationUrl: async (clientId, responseType, options = {}) => { // verify required parameter 'clientId' is not null or undefined (0, common_1.assertParamExists)('fetchAuthorizationUrl', 'clientId', clientId); // verify required parameter 'responseType' is not null or undefined (0, common_1.assertParamExists)('fetchAuthorizationUrl', 'responseType', responseType); const localVarPath = `/v2/farcaster/login/authorize/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (clientId !== undefined) { localVarQueryParameter['client_id'] = clientId; } if (responseType !== undefined) { localVarQueryParameter['response_type'] = responseType; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Fetches a list of signers for a custody address * @summary List signers * @param {string} message A Sign-In with Ethereum (SIWE) message that the user\&#39;s Ethereum wallet signs. This message includes details such as the domain, address, statement, URI, nonce, and other relevant information following the EIP-4361 standard. It should be structured and URL-encoded. * @param {string} signature The digital signature produced by signing the provided SIWE message with the user\&#39;s Ethereum private key. This signature is used to verify the authenticity of the message and the identity of the signer. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<SignerListResponse>} A promise that resolves to a `SignerListResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-signers) * */ fetchSigners: async (message, signature, options = {}) => { // verify required parameter 'message' is not null or undefined (0, common_1.assertParamExists)('fetchSigners', 'message', message); // verify required parameter 'signature' is not null or undefined (0, common_1.assertParamExists)('fetchSigners', 'signature', signature); const localVarPath = `/v2/farcaster/signer/list/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (message !== undefined) { localVarQueryParameter['message'] = message; } if (signature !== undefined) { localVarQueryParameter['signature'] = signature; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Fetches the status of a developer managed signer by public key * @summary Status by public key * @param {string} publicKey Ed25519 public key * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<DeveloperManagedSigner>} A promise that resolves to a `DeveloperManagedSigner` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-developer-managed-signer) * */ lookupDeveloperManagedSigner: async (publicKey, options = {}) => { // verify required parameter 'publicKey' is not null or undefined (0, common_1.assertParamExists)('lookupDeveloperManagedSigner', 'publicKey', publicKey); const localVarPath = `/v2/farcaster/signer/developer_managed/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (publicKey !== undefined) { localVarQueryParameter['public_key'] = publicKey; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_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 Status * @param {string} signerUuid UUID of the signer. &#x60;signer_uuid&#x60; is paired with API key, can\&#39;t use a &#x60;uuid&#x60; made with a different API key. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-signer) * */ lookupSigner: async (signerUuid, options = {}) => { // verify required parameter 'signerUuid' is not null or undefined (0, common_1.assertParamExists)('lookupSigner', 'signerUuid', signerUuid); const localVarPath = `/v2/farcaster/signer/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (signerUuid !== undefined) { localVarQueryParameter['signer_uuid'] = signerUuid; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Publish a message to farcaster. The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. * @summary Publish message * @param {object} body * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<object>} A promise that resolves to a `object` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-message-to-farcaster) * */ publishMessageToFarcaster: async (body, options = {}) => { // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('publishMessageToFarcaster', 'body', body); const localVarPath = `/v2/farcaster/message/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration); return { url: (0, common_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} * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key) * */ registerSignedKey: async (registerSignerKeyReqBody, options = {}) => { // verify required parameter 'registerSignerKeyReqBody' is not null or undefined (0, common_1.assertParamExists)('registerSignedKey', 'registerSignerKeyReqBody', registerSignerKeyReqBody); const localVarPath = `/v2/farcaster/signer/signed_key/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(registerSignerKeyReqBody, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Registers an signed key and returns the developer managed signer status with an approval url. * @summary Register Signed Key * @param {RegisterDeveloperManagedSignedKeyReqBody} registerDeveloperManagedSignedKeyReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<DeveloperManagedSigner>} A promise that resolves to a `DeveloperManagedSigner` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key-for-developer-managed-signer) * */ registerSignedKeyForDeveloperManagedSigner: async (registerDeveloperManagedSignedKeyReqBody, options = {}) => { // verify required parameter 'registerDeveloperManagedSignedKeyReqBody' is not null or undefined (0, common_1.assertParamExists)('registerSignedKeyForDeveloperManagedSigner', 'registerDeveloperManagedSignedKeyReqBody', registerDeveloperManagedSignedKeyReqBody); const localVarPath = `/v2/farcaster/signer/developer_managed/signed_key/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(registerDeveloperManagedSignedKeyReqBody, localVarRequestOptions, configuration); return { url: (0, common_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 tesing please reuse the signer, it costs money to approve a signer. * @summary Create signer * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-signer) * */ async createSigner(options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.createSigner(options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SignerApi.createSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetch authorization url (Fetched authorized url useful for SIWN login operation) * @summary Fetch authorization url * @param {string} clientId * @param {FetchAuthorizationUrlResponseTypeEnum} responseType * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AuthorizationUrlResponse>} A promise that resolves to a `AuthorizationUrlResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-authorization-url) * */ async fetchAuthorizationUrl(clientId, responseType, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.fetchAuthorizationUrl(clientId, responseType, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SignerApi.fetchAuthorizationUrl']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetches a list of signers for a custody address * @summary List signers * @param {string} message A Sign-In with Ethereum (SIWE) message that the user\&#39;s Ethereum wallet signs. This message includes details such as the domain, address, statement, URI, nonce, and other relevant information following the EIP-4361 standard. It should be structured and URL-encoded. * @param {string} signature The digital signature produced by signing the provided SIWE message with the user\&#39;s Ethereum private key. This signature is used to verify the authenticity of the message and the identity of the signer. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<SignerListResponse>} A promise that resolves to a `SignerListResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-signers) * */ async fetchSigners(message, signature, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.fetchSigners(message, signature, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SignerApi.fetchSigners']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetches the status of a developer managed signer by public key * @summary Status by public key * @param {string} publicKey Ed25519 public key * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<DeveloperManagedSigner>} A promise that resolves to a `DeveloperManagedSigner` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-developer-managed-signer) * */ async lookupDeveloperManagedSigner(publicKey, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.lookupDeveloperManagedSigner(publicKey, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SignerApi.lookupDeveloperManagedSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Gets information status of a signer by passing in a signer_uuid (Use post API to generate a signer) * @summary Status * @param {string} signerUuid UUID of the signer. &#x60;signer_uuid&#x60; is paired with API key, can\&#39;t use a &#x60;uuid&#x60; made with a different API key. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-signer) * */ async lookupSigner(signerUuid, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.lookupSigner(signerUuid, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SignerApi.lookupSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Publish a message to farcaster. The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. * @summary Publish message * @param {object} body * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<object>} A promise that resolves to a `object` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-message-to-farcaster) * */ async publishMessageToFarcaster(body, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.publishMessageToFarcaster(body, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SignerApi.publishMessageToFarcaster']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * 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} * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key) * */ async registerSignedKey(registerSignerKeyReqBody, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.registerSignedKey(registerSignerKeyReqBody, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SignerApi.registerSignedKey']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Registers an signed key and returns the developer managed signer status with an approval url. * @summary Register Signed Key * @param {RegisterDeveloperManagedSignedKeyReqBody} registerDeveloperManagedSignedKeyReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<DeveloperManagedSigner>} A promise that resolves to a `DeveloperManagedSigner` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key-for-developer-managed-signer) * */ async registerSignedKeyForDeveloperManagedSigner(registerDeveloperManagedSignedKeyReqBody, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.registerSignedKeyForDeveloperManagedSigner(registerDeveloperManagedSignedKeyReqBody, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SignerApi.registerSignedKeyForDeveloperManagedSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; 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 tesing please reuse the signer, it costs money to approve a signer. * @summary Create signer * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-signer) * */ createSigner(options) { return localVarFp.createSigner(options).then((request) => request(axios, basePath)); }, /** * Fetch authorization url (Fetched authorized url useful for SIWN login operation) * @summary Fetch authorization url * @param {SignerApiFetchAuthorizationUrlRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AuthorizationUrlResponse>} A promise that resolves to a `AuthorizationUrlResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-authorization-url) * */ fetchAuthorizationUrl(requestParameters, options) { return localVarFp.fetchAuthorizationUrl(requestParameters.clientId, requestParameters.responseType, options).then((request) => request(axios, basePath)); }, /** * Fetches a list of signers for a custody address * @summary List signers * @param {SignerApiFetchSignersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<SignerListResponse>} A promise that resolves to a `SignerListResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-signers) * */ fetchSigners(requestParameters, options) { return localVarFp.fetchSigners(requestParameters.message, requestParameters.signature, options).then((request) => request(axios, basePath)); }, /** * Fetches the status of a developer managed signer by public key * @summary Status by public key * @param {SignerApiLookupDeveloperManagedSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<DeveloperManagedSigner>} A promise that resolves to a `DeveloperManagedSigner` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-developer-managed-signer) * */ lookupDeveloperManagedSigner(requestParameters, options) { return localVarFp.lookupDeveloperManagedSigner(requestParameters.publicKey, 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 Status * @param {SignerApiLookupSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-signer) * */ lookupSigner(requestParameters, options) { return localVarFp.lookupSigner(requestParameters.signerUuid, options).then((request) => request(axios, basePath)); }, /** * Publish a message to farcaster. The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. * @summary Publish message * @param {SignerApiPublishMessageToFarcasterRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<object>} A promise that resolves to a `object` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-message-to-farcaster) * */ publishMessageToFarcaster(requestParameters, options) { return localVarFp.publishMessageToFarcaster(requestParameters.body, 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} * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key) * */ registerSignedKey(requestParameters, options) { return localVarFp.registerSignedKey(requestParameters.registerSignerKeyReqBody, options).then((request) => request(axios, basePath)); }, /** * Registers an signed key and returns the developer managed signer status with an approval url. * @summary Register Signed Key * @param {SignerApiRegisterSignedKeyForDeveloperManagedSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<DeveloperManagedSigner>} A promise that resolves to a `DeveloperManagedSigner` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key-for-developer-managed-signer) * */ registerSignedKeyForDeveloperManagedSigner(requestParameters, options) { return localVarFp.registerSignedKeyForDeveloperManagedSigner(requestParameters.registerDeveloperManagedSignedKeyReqBody, options).then((request) => request(axios, basePath)); }, }; }; exports.SignerApiFactory = SignerApiFactory; /** * SignerApi - object-oriented interface * @export * @class SignerApi * @extends {BaseAPI} */ class SignerApi extends base_1.BaseAPI { /** * Creates a signer and returns the signer status. **Note**: While tesing please reuse the signer, it costs money to approve a signer. * @summary Create signer * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-signer) * */ createSigner(options) { return (0, exports.SignerApiFp)(this.configuration).createSigner(options).then((request) => request(this.axios, this.basePath)); } /** * Fetch authorization url (Fetched authorized url useful for SIWN login operation) * @summary Fetch authorization url * @param {SignerApiFetchAuthorizationUrlRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi * @returns {Promise<AuthorizationUrlResponse>} A promise that resolves to a `AuthorizationUrlResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-authorization-url) * */ fetchAuthorizationUrl(requestParameters, options) { return (0, exports.SignerApiFp)(this.configuration).fetchAuthorizationUrl(requestParameters.clientId, requestParameters.responseType, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches a list of signers for a custody address * @summary List signers * @param {SignerApiFetchSignersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi * @returns {Promise<SignerListResponse>} A promise that resolves to a `SignerListResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-signers) * */ fetchSigners(requestParameters, options) { return (0, exports.SignerApiFp)(this.configuration).fetchSigners(requestParameters.message, requestParameters.signature, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches the status of a developer managed signer by public key * @summary Status by public key * @param {SignerApiLookupDeveloperManagedSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi * @returns {Promise<DeveloperManagedSigner>} A promise that resolves to a `DeveloperManagedSigner` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-developer-managed-signer) * */ lookupDeveloperManagedSigner(requestParameters, options) { return (0, exports.SignerApiFp)(this.configuration).lookupDeveloperManagedSigner(requestParameters.publicKey, 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 Status * @param {SignerApiLookupSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/lookup-signer) * */ lookupSigner(requestParameters, options) { return (0, exports.SignerApiFp)(this.configuration).lookupSigner(requestParameters.signerUuid, options).then((request) => request(this.axios, this.basePath)); } /** * Publish a message to farcaster. The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. * @summary Publish message * @param {SignerApiPublishMessageToFarcasterRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi * @returns {Promise<object>} A promise that resolves to a `object` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/publish-message-to-farcaster) * */ publishMessageToFarcaster(requestParameters, options) { return (0, exports.SignerApiFp)(this.configuration).publishMessageToFarcaster(requestParameters.body, 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 * @returns {Promise<Signer>} A promise that resolves to a `Signer` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key) * */ registerSignedKey(requestParameters, options) { return (0, exports.SignerApiFp)(this.configuration).registerSignedKey(requestParameters.registerSignerKeyReqBody, options).then((request) => request(this.axios, this.basePath)); } /** * Registers an signed key and returns the developer managed signer status with an approval url. * @summary Register Signed Key * @param {SignerApiRegisterSignedKeyForDeveloperManagedSignerRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignerApi * @returns {Promise<DeveloperManagedSigner>} A promise that resolves to a `DeveloperManagedSigner` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-signed-key-for-developer-managed-signer) * */ registerSignedKeyForDeveloperManagedSigner(requestParameters, options) { return (0, exports.SignerApiFp)(this.configuration).registerSignedKeyForDeveloperManagedSigner(requestParameters.registerDeveloperManagedSignedKeyReqBody, options).then((request) => request(this.axios, this.basePath)); } } exports.SignerApi = SignerApi; /** * @export */ exports.FetchAuthorizationUrlResponseTypeEnum = { Code: 'code' };