/* 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 { Body19 } from '../models'; import { InlineResponse2008 } from '../models'; import { InlineResponse4035 } from '../models'; import { NoSuchWallet } from '../models'; import { NotAcceptable } from '../models'; import { UnsupportedMediaType } from '../models'; /** * ByronCoinSelectionsApi - axios parameter creator * @export */ export const ByronCoinSelectionsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** *

status: stable

Select coins to cover the given set of payments. Uses the Random-Improve coin selection algorithm. Note: Not supported for Byron random wallets. * @summary Random * @param {Body19} body * @param {string} walletId * @param {*} [options] Override http request option. * @throws {RequiredError} */ byronSelectCoins: async (body: Body19, walletId: 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 byronSelectCoins.'); } // 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 byronSelectCoins.'); } const localVarPath = `/byron-wallets/{walletId}/coin-selections/random` .replace(`{${"walletId"}}`, encodeURIComponent(String(walletId))); // 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, }; }, } }; /** * ByronCoinSelectionsApi - functional programming interface * @export */ export const ByronCoinSelectionsApiFp = function(configuration?: Configuration) { return { /** *

status: stable

Select coins to cover the given set of payments. Uses the Random-Improve coin selection algorithm. Note: Not supported for Byron random wallets. * @summary Random * @param {Body19} body * @param {string} walletId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async byronSelectCoins(body: Body19, walletId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await ByronCoinSelectionsApiAxiosParamCreator(configuration).byronSelectCoins(body, walletId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * ByronCoinSelectionsApi - factory interface * @export */ export const ByronCoinSelectionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** *

status: stable

Select coins to cover the given set of payments. Uses the Random-Improve coin selection algorithm. Note: Not supported for Byron random wallets. * @summary Random * @param {Body19} body * @param {string} walletId * @param {*} [options] Override http request option. * @throws {RequiredError} */ byronSelectCoins(body: Body19, walletId: string, options?: any): AxiosPromise { return ByronCoinSelectionsApiFp(configuration).byronSelectCoins(body, walletId, options).then((request) => request(axios, basePath)); }, }; }; /** * ByronCoinSelectionsApi - object-oriented interface * @export * @class ByronCoinSelectionsApi * @extends {BaseAPI} */ export class ByronCoinSelectionsApi extends BaseAPI { /** *

status: stable

Select coins to cover the given set of payments. Uses the Random-Improve coin selection algorithm. Note: Not supported for Byron random wallets. * @summary Random * @param {Body19} body * @param {string} walletId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ByronCoinSelectionsApi */ public byronSelectCoins(body: Body19, walletId: string, options?: any) { return ByronCoinSelectionsApiFp(this.configuration).byronSelectCoins(body, walletId, options).then((request) => request(this.axios, this.basePath)); } }