@circle-fin/circle-sdk
Version:
Node.js SDK for Circle API
792 lines (751 loc) • 35.6 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import globalAxios, {
AxiosPromise,
AxiosInstance,
AxiosRequestConfig
} from "axios";
import { Configuration } from "../configuration";
// Some imports not used depending on template conditions
// @ts-ignore
import {
DUMMY_BASE_URL,
assertParamExists,
setBearerAuthToObject,
setSearchParams,
serializeDataIfNeeded,
toPathString,
createRequestFunction
} from "../common";
// @ts-ignore
import {
BASE_PATH,
COLLECTION_FORMATS,
RequestArgs,
BaseAPI,
RequiredError
} from "../base";
// @ts-ignore
import { BadRequest } from "../models";
// @ts-ignore
import { Conflict } from "../models";
// @ts-ignore
import { CreateWalletResponse } from "../models";
// @ts-ignore
import { GenerateAddressRequest } from "../models";
// @ts-ignore
import { GenerateAddressResponse } from "../models";
// @ts-ignore
import { GetWalletResponse } from "../models";
// @ts-ignore
import { ListAddressesResponse } from "../models";
// @ts-ignore
import { ListWalletsResponse } from "../models";
// @ts-ignore
import { NotFound } from "../models";
// @ts-ignore
import { WalletCreationRequest } from "../models";
/**
* WalletsApi - axios parameter creator
* @export
*/
export const WalletsApiAxiosParamCreator = function (
configuration?: Configuration
) {
return {
/**
* Creates an end user wallet.
* @summary Create a wallet
* @param {WalletCreationRequest} [walletCreationRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createWallet: async (
walletCreationRequest?: WalletCreationRequest,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
const localVarPath = `/v1/wallets`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "POST",
...baseOptions,
...options
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
localVarHeaderParameter["Content-Type"] = "application/json";
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
localVarRequestOptions.data = serializeDataIfNeeded(
walletCreationRequest,
localVarRequestOptions,
configuration
);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
},
/**
* Generates a new blockchain address for a wallet for a given currency/chain pair. Circle may reuse addresses on blockchains that support reuse. For example, if you\'re requesting two addresses for depositing USD and ETH, both on Ethereum, you may see the same Ethereum address returned. Depositing cryptocurrency to a generated address will credit the associated wallet with the value of the deposit.
* @summary Create a blockchain address
* @param {string} walletId Identifier for the wallet.
* @param {GenerateAddressRequest} [generateAddressRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
generateAddress: async (
walletId: string,
generateAddressRequest?: GenerateAddressRequest,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'walletId' is not null or undefined
assertParamExists("generateAddress", "walletId", walletId);
const localVarPath = `/v1/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, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "POST",
...baseOptions,
...options
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
localVarHeaderParameter["Content-Type"] = "application/json";
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
localVarRequestOptions.data = serializeDataIfNeeded(
generateAddressRequest,
localVarRequestOptions,
configuration
);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
},
/**
*
* @summary Get a wallet
* @param {string} walletId Identifier for the wallet.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getWallet: async (
walletId: string,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'walletId' is not null or undefined
assertParamExists("getWallet", "walletId", walletId);
const localVarPath = `/v1/wallets/{walletId}`.replace(
`{${"walletId"}}`,
encodeURIComponent(String(walletId))
);
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "GET",
...baseOptions,
...options
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
},
/**
* Retrieves a list of addresses associated with a wallet.
* @summary List all addresses
* @param {string} walletId Identifier for the wallet.
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listAddresses: async (
walletId: string,
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'walletId' is not null or undefined
assertParamExists("listAddresses", "walletId", walletId);
const localVarPath = `/v1/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, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "GET",
...baseOptions,
...options
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
if (from !== undefined) {
localVarQueryParameter["from"] =
(from as any) instanceof Date ? (from as any).toISOString() : from;
}
if (to !== undefined) {
localVarQueryParameter["to"] =
(to as any) instanceof Date ? (to as any).toISOString() : to;
}
if (pageBefore !== undefined) {
localVarQueryParameter["pageBefore"] = pageBefore;
}
if (pageAfter !== undefined) {
localVarQueryParameter["pageAfter"] = pageAfter;
}
if (pageSize !== undefined) {
localVarQueryParameter["pageSize"] = pageSize;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
},
/**
* Retrieves a list of a user\'s wallets.
* @summary List all wallets
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listWallets: async (
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
const localVarPath = `/v1/wallets`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: "GET",
...baseOptions,
...options
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
if (from !== undefined) {
localVarQueryParameter["from"] =
(from as any) instanceof Date ? (from as any).toISOString() : from;
}
if (to !== undefined) {
localVarQueryParameter["to"] =
(to as any) instanceof Date ? (to as any).toISOString() : to;
}
if (pageBefore !== undefined) {
localVarQueryParameter["pageBefore"] = pageBefore;
}
if (pageAfter !== undefined) {
localVarQueryParameter["pageAfter"] = pageAfter;
}
if (pageSize !== undefined) {
localVarQueryParameter["pageSize"] = pageSize;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
}
};
};
/**
* WalletsApi - functional programming interface
* @export
*/
export const WalletsApiFp = function (configuration?: Configuration) {
const localVarAxiosParamCreator = WalletsApiAxiosParamCreator(configuration);
return {
/**
* Creates an end user wallet.
* @summary Create a wallet
* @param {WalletCreationRequest} [walletCreationRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createWallet(
walletCreationRequest?: WalletCreationRequest,
options?: AxiosRequestConfig
): Promise<
(
axios?: AxiosInstance,
basePath?: string
) => AxiosPromise<CreateWalletResponse>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createWallet(
walletCreationRequest,
options
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
);
},
/**
* Generates a new blockchain address for a wallet for a given currency/chain pair. Circle may reuse addresses on blockchains that support reuse. For example, if you\'re requesting two addresses for depositing USD and ETH, both on Ethereum, you may see the same Ethereum address returned. Depositing cryptocurrency to a generated address will credit the associated wallet with the value of the deposit.
* @summary Create a blockchain address
* @param {string} walletId Identifier for the wallet.
* @param {GenerateAddressRequest} [generateAddressRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async generateAddress(
walletId: string,
generateAddressRequest?: GenerateAddressRequest,
options?: AxiosRequestConfig
): Promise<
(
axios?: AxiosInstance,
basePath?: string
) => AxiosPromise<GenerateAddressResponse>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.generateAddress(
walletId,
generateAddressRequest,
options
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
);
},
/**
*
* @summary Get a wallet
* @param {string} walletId Identifier for the wallet.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getWallet(
walletId: string,
options?: AxiosRequestConfig
): Promise<
(
axios?: AxiosInstance,
basePath?: string
) => AxiosPromise<GetWalletResponse>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getWallet(
walletId,
options
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
);
},
/**
* Retrieves a list of addresses associated with a wallet.
* @summary List all addresses
* @param {string} walletId Identifier for the wallet.
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listAddresses(
walletId: string,
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options?: AxiosRequestConfig
): Promise<
(
axios?: AxiosInstance,
basePath?: string
) => AxiosPromise<ListAddressesResponse>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listAddresses(
walletId,
from,
to,
pageBefore,
pageAfter,
pageSize,
options
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
);
},
/**
* Retrieves a list of a user\'s wallets.
* @summary List all wallets
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listWallets(
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options?: AxiosRequestConfig
): Promise<
(
axios?: AxiosInstance,
basePath?: string
) => AxiosPromise<ListWalletsResponse>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listWallets(
from,
to,
pageBefore,
pageAfter,
pageSize,
options
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
);
}
};
};
/**
* WalletsApi - factory interface
* @export
*/
export const WalletsApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance
) {
const localVarFp = WalletsApiFp(configuration);
return {
/**
* Creates an end user wallet.
* @summary Create a wallet
* @param {WalletCreationRequest} [walletCreationRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createWallet(
walletCreationRequest?: WalletCreationRequest,
options?: any
): AxiosPromise<CreateWalletResponse> {
return localVarFp
.createWallet(walletCreationRequest, options)
.then((request) => request(axios, basePath));
},
/**
* Generates a new blockchain address for a wallet for a given currency/chain pair. Circle may reuse addresses on blockchains that support reuse. For example, if you\'re requesting two addresses for depositing USD and ETH, both on Ethereum, you may see the same Ethereum address returned. Depositing cryptocurrency to a generated address will credit the associated wallet with the value of the deposit.
* @summary Create a blockchain address
* @param {string} walletId Identifier for the wallet.
* @param {GenerateAddressRequest} [generateAddressRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
generateAddress(
walletId: string,
generateAddressRequest?: GenerateAddressRequest,
options?: any
): AxiosPromise<GenerateAddressResponse> {
return localVarFp
.generateAddress(walletId, generateAddressRequest, options)
.then((request) => request(axios, basePath));
},
/**
*
* @summary Get a wallet
* @param {string} walletId Identifier for the wallet.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getWallet(
walletId: string,
options?: any
): AxiosPromise<GetWalletResponse> {
return localVarFp
.getWallet(walletId, options)
.then((request) => request(axios, basePath));
},
/**
* Retrieves a list of addresses associated with a wallet.
* @summary List all addresses
* @param {string} walletId Identifier for the wallet.
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listAddresses(
walletId: string,
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options?: any
): AxiosPromise<ListAddressesResponse> {
return localVarFp
.listAddresses(
walletId,
from,
to,
pageBefore,
pageAfter,
pageSize,
options
)
.then((request) => request(axios, basePath));
},
/**
* Retrieves a list of a user\'s wallets.
* @summary List all wallets
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listWallets(
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options?: any
): AxiosPromise<ListWalletsResponse> {
return localVarFp
.listWallets(from, to, pageBefore, pageAfter, pageSize, options)
.then((request) => request(axios, basePath));
}
};
};
/**
* WalletsApi - object-oriented interface
* @export
* @class WalletsApi
* @extends {BaseAPI}
*/
export class WalletsApi extends BaseAPI {
/**
* Creates an end user wallet.
* @summary Create a wallet
* @param {WalletCreationRequest} [walletCreationRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WalletsApi
*/
public createWallet(
walletCreationRequest?: WalletCreationRequest,
options?: AxiosRequestConfig
) {
return WalletsApiFp(this.configuration)
.createWallet(walletCreationRequest, options)
.then((request) => request(this.axios, this.basePath));
}
/**
* Generates a new blockchain address for a wallet for a given currency/chain pair. Circle may reuse addresses on blockchains that support reuse. For example, if you\'re requesting two addresses for depositing USD and ETH, both on Ethereum, you may see the same Ethereum address returned. Depositing cryptocurrency to a generated address will credit the associated wallet with the value of the deposit.
* @summary Create a blockchain address
* @param {string} walletId Identifier for the wallet.
* @param {GenerateAddressRequest} [generateAddressRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WalletsApi
*/
public generateAddress(
walletId: string,
generateAddressRequest?: GenerateAddressRequest,
options?: AxiosRequestConfig
) {
return WalletsApiFp(this.configuration)
.generateAddress(walletId, generateAddressRequest, options)
.then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Get a wallet
* @param {string} walletId Identifier for the wallet.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WalletsApi
*/
public getWallet(walletId: string, options?: AxiosRequestConfig) {
return WalletsApiFp(this.configuration)
.getWallet(walletId, options)
.then((request) => request(this.axios, this.basePath));
}
/**
* Retrieves a list of addresses associated with a wallet.
* @summary List all addresses
* @param {string} walletId Identifier for the wallet.
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WalletsApi
*/
public listAddresses(
walletId: string,
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options?: AxiosRequestConfig
) {
return WalletsApiFp(this.configuration)
.listAddresses(
walletId,
from,
to,
pageBefore,
pageAfter,
pageSize,
options
)
.then((request) => request(this.axios, this.basePath));
}
/**
* Retrieves a list of a user\'s wallets.
* @summary List all wallets
* @param {string} [from] Queries items created since the specified date-time (inclusive).
* @param {string} [to] Queries items created before the specified date-time (inclusive).
* @param {string} [pageBefore] A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next `n` items before the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageAfter.
* @param {string} [pageAfter] A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next `n` items after the id, with `n` being specified by `pageSize`. The items will be returned in the natural order of the collection. The resource will return the first page if neither `pageAfter` nor `pageBefore` are specified. SHOULD NOT be used in conjuction with pageBefore.
* @param {number} [pageSize] Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WalletsApi
*/
public listWallets(
from?: string,
to?: string,
pageBefore?: string,
pageAfter?: string,
pageSize?: number,
options?: AxiosRequestConfig
) {
return WalletsApiFp(this.configuration)
.listWallets(from, to, pageBefore, pageAfter, pageSize, options)
.then((request) => request(this.axios, this.basePath));
}
}