/* tslint:disable */ /* eslint-disable */ /** * Fireblocks API * Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) * * The version of the OpenAPI document: 1.6.2 * Contact: developers@fireblocks.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; import { convertToFireblocksResponse } from "../response/fireblocksResponse"; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; import { assertParamExistsAndNotEmpty } from '../utils/validation_utils'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { CreateInternalWalletAssetRequest } from '../models'; // @ts-ignore import { CreateWalletRequest } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { GetInternalWalletsResponse } from '../models'; // @ts-ignore import { PaginatedAssetsResponse } from '../models'; // @ts-ignore import { SetCustomerRefIdRequest } from '../models'; // @ts-ignore import { UnmanagedWallet } from '../models'; // @ts-ignore import { WalletAsset } from '../models'; /** * InternalWalletsApi - axios parameter creator * @export */ export const InternalWalletsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Creates a new internal wallet with the requested name. Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) * @summary Create an internal wallet * @param {CreateWalletRequest} [createWalletRequest] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createInternalWallet: async (createWalletRequest?: CreateWalletRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/internal_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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'createInternalWallet'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createWalletRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Adds an asset to an existing internal wallet. * @summary Add an asset to an internal wallet * @param {string} walletId The ID of the wallet * @param {string} assetId The ID of the asset to add * @param {CreateInternalWalletAssetRequest} [createInternalWalletAssetRequest] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createInternalWalletAsset: async (walletId: string, assetId: string, createInternalWalletAssetRequest?: CreateInternalWalletAssetRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('createInternalWalletAsset', 'walletId', walletId) assertParamExistsAndNotEmpty('createInternalWalletAsset', 'assetId', assetId) const localVarPath = `/internal_wallets/{walletId}/{assetId}` .replace(`{${"walletId"}}`, encodeURIComponent(String(walletId))) .replace(`{${"assetId"}}`, encodeURIComponent(String(assetId))); // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'createInternalWalletAsset'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createInternalWalletAssetRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Deletes an internal wallet by ID. * @summary Delete an internal wallet * @param {string} walletId The ID of the wallet to delete * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteInternalWallet: async (walletId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('deleteInternalWallet', 'walletId', walletId) const localVarPath = `/internal_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: 'DELETE', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'deleteInternalWallet'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Deletes a whitelisted address (for an asset) from an internal wallet. * @summary Delete a whitelisted address * @param {string} walletId The ID of the wallet * @param {string} assetId The ID of the asset to delete * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteInternalWalletAsset: async (walletId: string, assetId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('deleteInternalWalletAsset', 'walletId', walletId) assertParamExistsAndNotEmpty('deleteInternalWalletAsset', 'assetId', assetId) const localVarPath = `/internal_wallets/{walletId}/{assetId}` .replace(`{${"walletId"}}`, encodeURIComponent(String(walletId))) .replace(`{${"assetId"}}`, encodeURIComponent(String(assetId))); // 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: 'DELETE', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'deleteInternalWalletAsset'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns information for an internal wallet. * @summary Get assets for internal wallet * @param {string} walletId The ID of the wallet to return * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInternalWallet: async (walletId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getInternalWallet', 'walletId', walletId) const localVarPath = `/internal_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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getInternalWallet'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns information for an asset in an internal wallet. * @summary Get an asset from an internal wallet * @param {string} walletId The ID of the wallet * @param {string} assetId The ID of the asset to return * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInternalWalletAsset: async (walletId: string, assetId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getInternalWalletAsset', 'walletId', walletId) assertParamExistsAndNotEmpty('getInternalWalletAsset', 'assetId', assetId) const localVarPath = `/internal_wallets/{walletId}/{assetId}` .replace(`{${"walletId"}}`, encodeURIComponent(String(walletId))) .replace(`{${"assetId"}}`, encodeURIComponent(String(assetId))); // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getInternalWalletAsset'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns a paginated response of assets in an internal wallet. * @summary List assets in an internal wallet (Paginated) * @param {string} walletId The ID of the internal wallet to return assets for * @param {number} [pageSize] * @param {string} [pageCursor] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInternalWalletAssetsPaginated: async (walletId: string, pageSize?: number, pageCursor?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getInternalWalletAssetsPaginated', 'walletId', walletId) const localVarPath = `/internal_wallets/{walletId}/assets` .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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getInternalWalletAssetsPaginated'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Gets a list of internal wallets. * @summary List internal wallets * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInternalWallets: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/internal_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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getInternalWallets'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Sets an AML/KYT customer reference ID for the specific internal wallet. * @summary Set an AML/KYT customer reference ID for internal wallet * @param {SetCustomerRefIdRequest} setCustomerRefIdRequest * @param {string} walletId The wallet ID * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ setCustomerRefIdForInternalWallet: async (setCustomerRefIdRequest: SetCustomerRefIdRequest, walletId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('setCustomerRefIdForInternalWallet', 'setCustomerRefIdRequest', setCustomerRefIdRequest) assertParamExistsAndNotEmpty('setCustomerRefIdForInternalWallet', 'walletId', walletId) const localVarPath = `/internal_wallets/{walletId}/set_customer_ref_id` .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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'setCustomerRefIdForInternalWallet'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(setCustomerRefIdRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * InternalWalletsApi - functional programming interface * @export */ export const InternalWalletsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = InternalWalletsApiAxiosParamCreator(configuration) return { /** * Creates a new internal wallet with the requested name. Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) * @summary Create an internal wallet * @param {CreateWalletRequest} [createWalletRequest] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createInternalWallet(createWalletRequest?: CreateWalletRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createInternalWallet(createWalletRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['InternalWalletsApi.createInternalWallet']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Adds an asset to an existing internal wallet. * @summary Add an asset to an internal wallet * @param {string} walletId The ID of the wallet * @param {string} assetId The ID of the asset to add * @param {CreateInternalWalletAssetRequest} [createInternalWalletAssetRequest] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createInternalWalletAsset(walletId: string, assetId: string, createInternalWalletAssetRequest?: CreateInternalWalletAssetRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createInternalWalletAsset(walletId, assetId, createInternalWalletAssetRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['InternalWalletsApi.createInternalWalletAsset']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Deletes an internal wallet by ID. * @summary Delete an internal wallet * @param {string} walletId The ID of the wallet to delete * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteInternalWallet(walletId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInternalWallet(walletId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['InternalWalletsApi.deleteInternalWallet']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Deletes a whitelisted address (for an asset) from an internal wallet. * @summary Delete a whitelisted address * @param {string} walletId The ID of the wallet * @param {string} assetId The ID of the asset to delete * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteInternalWalletAsset(walletId: string, assetId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInternalWalletAsset(walletId, assetId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['InternalWalletsApi.deleteInternalWalletAsset']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns information for an internal wallet. * @summary Get assets for internal wallet * @param {string} walletId The ID of the wallet to return * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getInternalWallet(walletId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInternalWallet(walletId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['InternalWalletsApi.getInternalWallet']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns information for an asset in an internal wallet. * @summary Get an asset from an internal wallet * @param {string} walletId The ID of the wallet * @param {string} assetId The ID of the asset to return * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getInternalWalletAsset(walletId: string, assetId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInternalWalletAsset(walletId, assetId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['InternalWalletsApi.getInternalWalletAsset']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns a paginated response of assets in an internal wallet. * @summary List assets in an internal wallet (Paginated) * @param {string} walletId The ID of the internal wallet to return assets for * @param {number} [pageSize] * @param {string} [pageCursor] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getInternalWalletAssetsPaginated(walletId: string, pageSize?: number, pageCursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInternalWalletAssetsPaginated(walletId, pageSize, pageCursor, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['InternalWalletsApi.getInternalWalletAssetsPaginated']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Gets a list of internal wallets. * @summary List internal wallets * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getInternalWallets(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInternalWallets(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['InternalWalletsApi.getInternalWallets']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Sets an AML/KYT customer reference ID for the specific internal wallet. * @summary Set an AML/KYT customer reference ID for internal wallet * @param {SetCustomerRefIdRequest} setCustomerRefIdRequest * @param {string} walletId The wallet ID * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async setCustomerRefIdForInternalWallet(setCustomerRefIdRequest: SetCustomerRefIdRequest, walletId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.setCustomerRefIdForInternalWallet(setCustomerRefIdRequest, walletId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['InternalWalletsApi.setCustomerRefIdForInternalWallet']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * InternalWalletsApi - factory interface * @export */ export const InternalWalletsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = InternalWalletsApiFp(configuration) return { /** * Creates a new internal wallet with the requested name. Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) * @summary Create an internal wallet * @param {InternalWalletsApiCreateInternalWalletRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createInternalWallet(requestParameters: InternalWalletsApiCreateInternalWalletRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createInternalWallet(requestParameters.createWalletRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Adds an asset to an existing internal wallet. * @summary Add an asset to an internal wallet * @param {InternalWalletsApiCreateInternalWalletAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createInternalWalletAsset(requestParameters: InternalWalletsApiCreateInternalWalletAssetRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createInternalWalletAsset(requestParameters.walletId, requestParameters.assetId, requestParameters.createInternalWalletAssetRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Deletes an internal wallet by ID. * @summary Delete an internal wallet * @param {InternalWalletsApiDeleteInternalWalletRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteInternalWallet(requestParameters: InternalWalletsApiDeleteInternalWalletRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteInternalWallet(requestParameters.walletId, options).then((request) => request(axios, basePath)); }, /** * Deletes a whitelisted address (for an asset) from an internal wallet. * @summary Delete a whitelisted address * @param {InternalWalletsApiDeleteInternalWalletAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteInternalWalletAsset(requestParameters: InternalWalletsApiDeleteInternalWalletAssetRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteInternalWalletAsset(requestParameters.walletId, requestParameters.assetId, options).then((request) => request(axios, basePath)); }, /** * Returns information for an internal wallet. * @summary Get assets for internal wallet * @param {InternalWalletsApiGetInternalWalletRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInternalWallet(requestParameters: InternalWalletsApiGetInternalWalletRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getInternalWallet(requestParameters.walletId, options).then((request) => request(axios, basePath)); }, /** * Returns information for an asset in an internal wallet. * @summary Get an asset from an internal wallet * @param {InternalWalletsApiGetInternalWalletAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInternalWalletAsset(requestParameters: InternalWalletsApiGetInternalWalletAssetRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getInternalWalletAsset(requestParameters.walletId, requestParameters.assetId, options).then((request) => request(axios, basePath)); }, /** * Returns a paginated response of assets in an internal wallet. * @summary List assets in an internal wallet (Paginated) * @param {InternalWalletsApiGetInternalWalletAssetsPaginatedRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInternalWalletAssetsPaginated(requestParameters: InternalWalletsApiGetInternalWalletAssetsPaginatedRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getInternalWalletAssetsPaginated(requestParameters.walletId, requestParameters.pageSize, requestParameters.pageCursor, options).then((request) => request(axios, basePath)); }, /** * Gets a list of internal wallets. * @summary List internal wallets * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInternalWallets(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getInternalWallets(options).then((request) => request(axios, basePath)); }, /** * Sets an AML/KYT customer reference ID for the specific internal wallet. * @summary Set an AML/KYT customer reference ID for internal wallet * @param {InternalWalletsApiSetCustomerRefIdForInternalWalletRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ setCustomerRefIdForInternalWallet(requestParameters: InternalWalletsApiSetCustomerRefIdForInternalWalletRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.setCustomerRefIdForInternalWallet(requestParameters.setCustomerRefIdRequest, requestParameters.walletId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for createInternalWallet operation in InternalWalletsApi. * @export * @interface InternalWalletsApiCreateInternalWalletRequest */ export interface InternalWalletsApiCreateInternalWalletRequest { /** * * @type {CreateWalletRequest} * @memberof InternalWalletsApiCreateInternalWallet */ readonly createWalletRequest?: CreateWalletRequest /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof InternalWalletsApiCreateInternalWallet */ readonly idempotencyKey?: string } /** * Request parameters for createInternalWalletAsset operation in InternalWalletsApi. * @export * @interface InternalWalletsApiCreateInternalWalletAssetRequest */ export interface InternalWalletsApiCreateInternalWalletAssetRequest { /** * The ID of the wallet * @type {string} * @memberof InternalWalletsApiCreateInternalWalletAsset */ readonly walletId: string /** * The ID of the asset to add * @type {string} * @memberof InternalWalletsApiCreateInternalWalletAsset */ readonly assetId: string /** * * @type {CreateInternalWalletAssetRequest} * @memberof InternalWalletsApiCreateInternalWalletAsset */ readonly createInternalWalletAssetRequest?: CreateInternalWalletAssetRequest /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof InternalWalletsApiCreateInternalWalletAsset */ readonly idempotencyKey?: string } /** * Request parameters for deleteInternalWallet operation in InternalWalletsApi. * @export * @interface InternalWalletsApiDeleteInternalWalletRequest */ export interface InternalWalletsApiDeleteInternalWalletRequest { /** * The ID of the wallet to delete * @type {string} * @memberof InternalWalletsApiDeleteInternalWallet */ readonly walletId: string } /** * Request parameters for deleteInternalWalletAsset operation in InternalWalletsApi. * @export * @interface InternalWalletsApiDeleteInternalWalletAssetRequest */ export interface InternalWalletsApiDeleteInternalWalletAssetRequest { /** * The ID of the wallet * @type {string} * @memberof InternalWalletsApiDeleteInternalWalletAsset */ readonly walletId: string /** * The ID of the asset to delete * @type {string} * @memberof InternalWalletsApiDeleteInternalWalletAsset */ readonly assetId: string } /** * Request parameters for getInternalWallet operation in InternalWalletsApi. * @export * @interface InternalWalletsApiGetInternalWalletRequest */ export interface InternalWalletsApiGetInternalWalletRequest { /** * The ID of the wallet to return * @type {string} * @memberof InternalWalletsApiGetInternalWallet */ readonly walletId: string } /** * Request parameters for getInternalWalletAsset operation in InternalWalletsApi. * @export * @interface InternalWalletsApiGetInternalWalletAssetRequest */ export interface InternalWalletsApiGetInternalWalletAssetRequest { /** * The ID of the wallet * @type {string} * @memberof InternalWalletsApiGetInternalWalletAsset */ readonly walletId: string /** * The ID of the asset to return * @type {string} * @memberof InternalWalletsApiGetInternalWalletAsset */ readonly assetId: string } /** * Request parameters for getInternalWalletAssetsPaginated operation in InternalWalletsApi. * @export * @interface InternalWalletsApiGetInternalWalletAssetsPaginatedRequest */ export interface InternalWalletsApiGetInternalWalletAssetsPaginatedRequest { /** * The ID of the internal wallet to return assets for * @type {string} * @memberof InternalWalletsApiGetInternalWalletAssetsPaginated */ readonly walletId: string /** * * @type {number} * @memberof InternalWalletsApiGetInternalWalletAssetsPaginated */ readonly pageSize?: number /** * * @type {string} * @memberof InternalWalletsApiGetInternalWalletAssetsPaginated */ readonly pageCursor?: string } /** * Request parameters for setCustomerRefIdForInternalWallet operation in InternalWalletsApi. * @export * @interface InternalWalletsApiSetCustomerRefIdForInternalWalletRequest */ export interface InternalWalletsApiSetCustomerRefIdForInternalWalletRequest { /** * * @type {SetCustomerRefIdRequest} * @memberof InternalWalletsApiSetCustomerRefIdForInternalWallet */ readonly setCustomerRefIdRequest: SetCustomerRefIdRequest /** * The wallet ID * @type {string} * @memberof InternalWalletsApiSetCustomerRefIdForInternalWallet */ readonly walletId: string /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof InternalWalletsApiSetCustomerRefIdForInternalWallet */ readonly idempotencyKey?: string } /** * InternalWalletsApi - object-oriented interface * @export * @class InternalWalletsApi * @extends {BaseAPI} */ export class InternalWalletsApi extends BaseAPI { /** * Creates a new internal wallet with the requested name. Learn more about Whitelisted Internal Addresses [here](https://developers.fireblocks.com/docs/whitelist-addresses#internal-wallets) * @summary Create an internal wallet * @param {InternalWalletsApiCreateInternalWalletRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InternalWalletsApi */ public createInternalWallet(requestParameters: InternalWalletsApiCreateInternalWalletRequest = {}) { return InternalWalletsApiFp(this.configuration).createInternalWallet(requestParameters.createWalletRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Adds an asset to an existing internal wallet. * @summary Add an asset to an internal wallet * @param {InternalWalletsApiCreateInternalWalletAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InternalWalletsApi */ public createInternalWalletAsset(requestParameters: InternalWalletsApiCreateInternalWalletAssetRequest) { return InternalWalletsApiFp(this.configuration).createInternalWalletAsset(requestParameters.walletId, requestParameters.assetId, requestParameters.createInternalWalletAssetRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Deletes an internal wallet by ID. * @summary Delete an internal wallet * @param {InternalWalletsApiDeleteInternalWalletRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InternalWalletsApi */ public deleteInternalWallet(requestParameters: InternalWalletsApiDeleteInternalWalletRequest) { return InternalWalletsApiFp(this.configuration).deleteInternalWallet(requestParameters.walletId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Deletes a whitelisted address (for an asset) from an internal wallet. * @summary Delete a whitelisted address * @param {InternalWalletsApiDeleteInternalWalletAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InternalWalletsApi */ public deleteInternalWalletAsset(requestParameters: InternalWalletsApiDeleteInternalWalletAssetRequest) { return InternalWalletsApiFp(this.configuration).deleteInternalWalletAsset(requestParameters.walletId, requestParameters.assetId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns information for an internal wallet. * @summary Get assets for internal wallet * @param {InternalWalletsApiGetInternalWalletRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InternalWalletsApi */ public getInternalWallet(requestParameters: InternalWalletsApiGetInternalWalletRequest) { return InternalWalletsApiFp(this.configuration).getInternalWallet(requestParameters.walletId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns information for an asset in an internal wallet. * @summary Get an asset from an internal wallet * @param {InternalWalletsApiGetInternalWalletAssetRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InternalWalletsApi */ public getInternalWalletAsset(requestParameters: InternalWalletsApiGetInternalWalletAssetRequest) { return InternalWalletsApiFp(this.configuration).getInternalWalletAsset(requestParameters.walletId, requestParameters.assetId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns a paginated response of assets in an internal wallet. * @summary List assets in an internal wallet (Paginated) * @param {InternalWalletsApiGetInternalWalletAssetsPaginatedRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InternalWalletsApi */ public getInternalWalletAssetsPaginated(requestParameters: InternalWalletsApiGetInternalWalletAssetsPaginatedRequest) { return InternalWalletsApiFp(this.configuration).getInternalWalletAssetsPaginated(requestParameters.walletId, requestParameters.pageSize, requestParameters.pageCursor).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Gets a list of internal wallets. * @summary List internal wallets * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InternalWalletsApi */ public getInternalWallets() { return InternalWalletsApiFp(this.configuration).getInternalWallets().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Sets an AML/KYT customer reference ID for the specific internal wallet. * @summary Set an AML/KYT customer reference ID for internal wallet * @param {InternalWalletsApiSetCustomerRefIdForInternalWalletRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof InternalWalletsApi */ public setCustomerRefIdForInternalWallet(requestParameters: InternalWalletsApiSetCustomerRefIdForInternalWalletRequest) { return InternalWalletsApiFp(this.configuration).setCustomerRefIdForInternalWallet(requestParameters.setCustomerRefIdRequest, requestParameters.walletId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }