/* tslint:disable */ /* eslint-disable */ /** * Cardano Wallet Backend API *

* * OpenAPI spec version: 2021.3.4 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { BadRequest } from '../models'; import { Body } from '../models'; import { InlineResponse415 } from '../models'; import { NotAcceptable } from '../models'; /** * ExperimentalApi - axios parameter creator * @export */ export const ExperimentalApiAxiosParamCreator = function (configuration?: Configuration) { return { /** *

status: experimental

**⚠️ WARNING ⚠️** This endpoint is experimental and for internal use in the Catalyst project. This functionality will be refined in the forthcoming future and the interface is likely to change in **NON-BACKWARD COMPATIBLE WAYS**. Note: Only `Soft` indexes are supported by this endpoint. * @summary Sign Metadata * @param {Body} body * @param {string} walletId * @param {string} role * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} */ signMetadata: async (body: Body, walletId: string, role: string, index: string, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling signMetadata.'); } // verify required parameter 'walletId' is not null or undefined if (walletId === null || walletId === undefined) { throw new RequiredError('walletId','Required parameter walletId was null or undefined when calling signMetadata.'); } // verify required parameter 'role' is not null or undefined if (role === null || role === undefined) { throw new RequiredError('role','Required parameter role was null or undefined when calling signMetadata.'); } // verify required parameter 'index' is not null or undefined if (index === null || index === undefined) { throw new RequiredError('index','Required parameter index was null or undefined when calling signMetadata.'); } const localVarPath = `/wallets/{walletId}/signatures/{role}/{index}` .replace(`{${"walletId"}}`, encodeURIComponent(String(walletId))) .replace(`{${"role"}}`, encodeURIComponent(String(role))) .replace(`{${"index"}}`, encodeURIComponent(String(index))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, } }; /** * ExperimentalApi - functional programming interface * @export */ export const ExperimentalApiFp = function(configuration?: Configuration) { return { /** *

status: experimental

**⚠️ WARNING ⚠️** This endpoint is experimental and for internal use in the Catalyst project. This functionality will be refined in the forthcoming future and the interface is likely to change in **NON-BACKWARD COMPATIBLE WAYS**. Note: Only `Soft` indexes are supported by this endpoint. * @summary Sign Metadata * @param {Body} body * @param {string} walletId * @param {string} role * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} */ async signMetadata(body: Body, walletId: string, role: string, index: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await ExperimentalApiAxiosParamCreator(configuration).signMetadata(body, walletId, role, index, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * ExperimentalApi - factory interface * @export */ export const ExperimentalApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** *

status: experimental

**⚠️ WARNING ⚠️** This endpoint is experimental and for internal use in the Catalyst project. This functionality will be refined in the forthcoming future and the interface is likely to change in **NON-BACKWARD COMPATIBLE WAYS**. Note: Only `Soft` indexes are supported by this endpoint. * @summary Sign Metadata * @param {Body} body * @param {string} walletId * @param {string} role * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} */ signMetadata(body: Body, walletId: string, role: string, index: string, options?: any): AxiosPromise { return ExperimentalApiFp(configuration).signMetadata(body, walletId, role, index, options).then((request) => request(axios, basePath)); }, }; }; /** * ExperimentalApi - object-oriented interface * @export * @class ExperimentalApi * @extends {BaseAPI} */ export class ExperimentalApi extends BaseAPI { /** *

status: experimental

**⚠️ WARNING ⚠️** This endpoint is experimental and for internal use in the Catalyst project. This functionality will be refined in the forthcoming future and the interface is likely to change in **NON-BACKWARD COMPATIBLE WAYS**. Note: Only `Soft` indexes are supported by this endpoint. * @summary Sign Metadata * @param {Body} body * @param {string} walletId * @param {string} role * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ExperimentalApi */ public signMetadata(body: Body, walletId: string, role: string, index: string, options?: any) { return ExperimentalApiFp(this.configuration).signMetadata(body, walletId, role, index, options).then((request) => request(this.axios, this.basePath)); } }