/* 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 { ApiPostAccountKeyData } from '../models'; import { InlineResponse415 } from '../models'; import { NotAcceptable } from '../models'; /** * KeysApi - axios parameter creator * @export */ export const KeysApiAxiosParamCreator = function (configuration?: Configuration) { return { /** *

status: stable

Return a public key for a given role and derivation index. Note: Only `Soft` indexes are supported by this endpoint. * @summary Get Public Key * @param {string} walletId * @param {string} role * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWalletKey: async (walletId: string, role: string, index: string, options: any = {}): Promise => { // 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 getWalletKey.'); } // 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 getWalletKey.'); } // 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 getWalletKey.'); } const localVarPath = `/wallets/{walletId}/keys/{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: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** *

status: stable

Retrieve account public key from the wallet. Note: Only `Hard` indexes are supported by this endpoint. * @summary Create * @param {ApiPostAccountKeyData} body * @param {string} walletId * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} */ postAccountKey: async (body: ApiPostAccountKeyData, walletId: 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 postAccountKey.'); } // 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 postAccountKey.'); } // 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 postAccountKey.'); } const localVarPath = `/wallets/{walletId}/keys/{index}` .replace(`{${"walletId"}}`, encodeURIComponent(String(walletId))) .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, }; }, } }; /** * KeysApi - functional programming interface * @export */ export const KeysApiFp = function(configuration?: Configuration) { return { /** *

status: stable

Return a public key for a given role and derivation index. Note: Only `Soft` indexes are supported by this endpoint. * @summary Get Public Key * @param {string} walletId * @param {string} role * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWalletKey(walletId: string, role: string, index: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await KeysApiAxiosParamCreator(configuration).getWalletKey(walletId, role, index, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** *

status: stable

Retrieve account public key from the wallet. Note: Only `Hard` indexes are supported by this endpoint. * @summary Create * @param {ApiPostAccountKeyData} body * @param {string} walletId * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} */ async postAccountKey(body: ApiPostAccountKeyData, walletId: string, index: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await KeysApiAxiosParamCreator(configuration).postAccountKey(body, walletId, index, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * KeysApi - factory interface * @export */ export const KeysApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** *

status: stable

Return a public key for a given role and derivation index. Note: Only `Soft` indexes are supported by this endpoint. * @summary Get Public Key * @param {string} walletId * @param {string} role * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWalletKey(walletId: string, role: string, index: string, options?: any): AxiosPromise { return KeysApiFp(configuration).getWalletKey(walletId, role, index, options).then((request) => request(axios, basePath)); }, /** *

status: stable

Retrieve account public key from the wallet. Note: Only `Hard` indexes are supported by this endpoint. * @summary Create * @param {ApiPostAccountKeyData} body * @param {string} walletId * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} */ postAccountKey(body: ApiPostAccountKeyData, walletId: string, index: string, options?: any): AxiosPromise { return KeysApiFp(configuration).postAccountKey(body, walletId, index, options).then((request) => request(axios, basePath)); }, }; }; /** * KeysApi - object-oriented interface * @export * @class KeysApi * @extends {BaseAPI} */ export class KeysApi extends BaseAPI { /** *

status: stable

Return a public key for a given role and derivation index. Note: Only `Soft` indexes are supported by this endpoint. * @summary Get Public Key * @param {string} walletId * @param {string} role * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeysApi */ public getWalletKey(walletId: string, role: string, index: string, options?: any) { return KeysApiFp(this.configuration).getWalletKey(walletId, role, index, options).then((request) => request(this.axios, this.basePath)); } /** *

status: stable

Retrieve account public key from the wallet. Note: Only `Hard` indexes are supported by this endpoint. * @summary Create * @param {ApiPostAccountKeyData} body * @param {string} walletId * @param {string} index * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof KeysApi */ public postAccountKey(body: ApiPostAccountKeyData, walletId: string, index: string, options?: any) { return KeysApiFp(this.configuration).postAccountKey(body, walletId, index, options).then((request) => request(this.axios, this.basePath)); } }