/* 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 { Body15 } from '../models';
import { Body16 } from '../models';
import { InlineResponse2005 } from '../models';
import { InlineResponse415 } from '../models';
import { NoSuchWallet } from '../models';
import { NotAcceptable } from '../models';
/**
* ByronAddressesApi - axios parameter creator
* @export
*/
export const ByronAddressesApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* status: stable
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Create Address
* @param {Body16} body
* @param {string} walletId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAddress: async (body: Body16, 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 createAddress.');
}
// 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 createAddress.');
}
const localVarPath = `/byron-wallets/{walletId}/addresses`
.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,
};
},
/**
* status: stable
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Import Address
* @param {string} walletId
* @param {string} addressId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
importAddress: async (walletId: string, addressId: 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 importAddress.');
}
// verify required parameter 'addressId' is not null or undefined
if (addressId === null || addressId === undefined) {
throw new RequiredError('addressId','Required parameter addressId was null or undefined when calling importAddress.');
}
const localVarPath = `/byron-wallets/{walletId}/addresses/{addressId}`
.replace(`{${"walletId"}}`, encodeURIComponent(String(walletId)))
.replace(`{${"addressId"}}`, encodeURIComponent(String(addressId)));
// 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: 'PUT', ...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
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Import Addresses
* @param {Body15} body
* @param {string} walletId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
importAddresses: async (body: Body15, 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 importAddresses.');
}
// 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 importAddresses.');
}
const localVarPath = `/byron-wallets/{walletId}/addresses`
.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: 'PUT', ...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,
};
},
/**
* status: stable
Return a list of known addresses, ordered from newest to oldest for sequential wallets. Arbitrarily ordered for random wallets.
* @summary List
* @param {string} walletId
* @param {string} [state] An optional filter on the address state.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listByronAddresses: async (walletId: string, state?: 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 listByronAddresses.');
}
const localVarPath = `/byron-wallets/{walletId}/addresses`
.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: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (state !== undefined) {
localVarQueryParameter['state'] = state;
}
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,
};
},
}
};
/**
* ByronAddressesApi - functional programming interface
* @export
*/
export const ByronAddressesApiFp = function(configuration?: Configuration) {
return {
/**
* status: stable
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Create Address
* @param {Body16} body
* @param {string} walletId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createAddress(body: Body16, walletId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
const localVarAxiosArgs = await ByronAddressesApiAxiosParamCreator(configuration).createAddress(body, walletId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* status: stable
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Import Address
* @param {string} walletId
* @param {string} addressId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async importAddress(walletId: string, addressId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
const localVarAxiosArgs = await ByronAddressesApiAxiosParamCreator(configuration).importAddress(walletId, addressId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* status: stable
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Import Addresses
* @param {Body15} body
* @param {string} walletId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async importAddresses(body: Body15, walletId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
const localVarAxiosArgs = await ByronAddressesApiAxiosParamCreator(configuration).importAddresses(body, walletId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* status: stable
Return a list of known addresses, ordered from newest to oldest for sequential wallets. Arbitrarily ordered for random wallets.
* @summary List
* @param {string} walletId
* @param {string} [state] An optional filter on the address state.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listByronAddresses(walletId: string, state?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
const localVarAxiosArgs = await ByronAddressesApiAxiosParamCreator(configuration).listByronAddresses(walletId, state, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* ByronAddressesApi - factory interface
* @export
*/
export const ByronAddressesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
* status: stable
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Create Address
* @param {Body16} body
* @param {string} walletId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAddress(body: Body16, walletId: string, options?: any): AxiosPromise {
return ByronAddressesApiFp(configuration).createAddress(body, walletId, options).then((request) => request(axios, basePath));
},
/**
* status: stable
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Import Address
* @param {string} walletId
* @param {string} addressId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
importAddress(walletId: string, addressId: string, options?: any): AxiosPromise {
return ByronAddressesApiFp(configuration).importAddress(walletId, addressId, options).then((request) => request(axios, basePath));
},
/**
* status: stable
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Import Addresses
* @param {Body15} body
* @param {string} walletId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
importAddresses(body: Body15, walletId: string, options?: any): AxiosPromise {
return ByronAddressesApiFp(configuration).importAddresses(body, walletId, options).then((request) => request(axios, basePath));
},
/**
* status: stable
Return a list of known addresses, ordered from newest to oldest for sequential wallets. Arbitrarily ordered for random wallets.
* @summary List
* @param {string} walletId
* @param {string} [state] An optional filter on the address state.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listByronAddresses(walletId: string, state?: string, options?: any): AxiosPromise> {
return ByronAddressesApiFp(configuration).listByronAddresses(walletId, state, options).then((request) => request(axios, basePath));
},
};
};
/**
* ByronAddressesApi - object-oriented interface
* @export
* @class ByronAddressesApi
* @extends {BaseAPI}
*/
export class ByronAddressesApi extends BaseAPI {
/**
* status: stable
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Create Address
* @param {Body16} body
* @param {string} walletId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ByronAddressesApi
*/
public createAddress(body: Body16, walletId: string, options?: any) {
return ByronAddressesApiFp(this.configuration).createAddress(body, walletId, options).then((request) => request(this.axios, this.basePath));
}
/**
* status: stable
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Import Address
* @param {string} walletId
* @param {string} addressId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ByronAddressesApi
*/
public importAddress(walletId: string, addressId: string, options?: any) {
return ByronAddressesApiFp(this.configuration).importAddress(walletId, addressId, options).then((request) => request(this.axios, this.basePath));
}
/**
* status: stable
⚠️ This endpoint is available for `random` wallets only. Any attempt to call this endpoint on another type of wallet will result in a `403 Forbidden` error from the server.
* @summary Import Addresses
* @param {Body15} body
* @param {string} walletId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ByronAddressesApi
*/
public importAddresses(body: Body15, walletId: string, options?: any) {
return ByronAddressesApiFp(this.configuration).importAddresses(body, walletId, options).then((request) => request(this.axios, this.basePath));
}
/**
* status: stable
Return a list of known addresses, ordered from newest to oldest for sequential wallets. Arbitrarily ordered for random wallets.
* @summary List
* @param {string} walletId
* @param {string} [state] An optional filter on the address state.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ByronAddressesApi
*/
public listByronAddresses(walletId: string, state?: string, options?: any) {
return ByronAddressesApiFp(this.configuration).listByronAddresses(walletId, state, options).then((request) => request(this.axios, this.basePath));
}
}