/* 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 { AttachDetachUtxoLabelsRequest } from '../models'; // @ts-ignore import { AttachDetachUtxoLabelsResponse } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { ListUtxosResponse } from '../models'; // @ts-ignore import { UpsertUtxoSelectionConfigRequest } from '../models'; // @ts-ignore import { UtxoLabelsErrorResponse } from '../models'; // @ts-ignore import { UtxoSelectionConfigResponse } from '../models'; /** * UTXOManagementApi - axios parameter creator * @export */ export const UTXOManagementApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Returns the workspace-level configured selection strategy and the effective strategy after runtime resolution. `ADAPTIVE` is the recommended strategy. When no row is stored (source `DEFAULT`), `effective` is `ADAPTIVE` if adaptive selection is serving for this workspace, otherwise `ASC`. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary Get UTXO selection config * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUtxoSelectionConfig: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/utxo_management/selection_config`; // 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 = 'getUtxoSelectionConfig'; 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 list of unspent transaction outputs (UTXOs) for a UTXO-based asset in a vault account, with optional filters for labels, statuses, amounts, and more. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List unspent outputs (UTXOs) * @param {string} vaultAccountId The ID of the vault account * @param {string} assetId The ID of the asset * @param {string} [pageCursor] Cursor for the next page of results * @param {number} [pageSize] Number of results per page (max 250, default 50) * @param {GetUtxosSortEnum} [sort] Field to sort by * @param {GetUtxosOrderEnum} [order] Sort order * @param {Array} [includeAllLabels] Only return UTXOs that have ALL of these labels (AND logic). * @param {Array} [includeAnyLabels] Return UTXOs that have ANY of these labels (OR logic). * @param {Array} [excludeAnyLabels] Exclude UTXOs that have ANY of these labels. * @param {Array} [includeStatuses] Filter by UTXO statuses to include. * @param {string} [address] Filter by address * @param {string} [txHash] Filter by the on-chain hash of the transaction that created the UTXOs. Returns all UTXOs originating from that transaction. * @param {string} [txId] Filter by the Fireblocks transaction ID that created the UTXOs. * @param {string} [minAmount] Minimum amount filter * @param {string} [maxAmount] Maximum amount filter * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUtxos: async (vaultAccountId: string, assetId: string, pageCursor?: string, pageSize?: number, sort?: GetUtxosSortEnum, order?: GetUtxosOrderEnum, includeAllLabels?: Array, includeAnyLabels?: Array, excludeAnyLabels?: Array, includeStatuses?: Array, address?: string, txHash?: string, txId?: string, minAmount?: string, maxAmount?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getUtxos', 'vaultAccountId', vaultAccountId) assertParamExistsAndNotEmpty('getUtxos', 'assetId', assetId) const localVarPath = `/utxo_management/{vaultAccountId}/{assetId}/unspent_outputs` .replace(`{${"vaultAccountId"}}`, encodeURIComponent(String(vaultAccountId))) .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 = 'getUtxos'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (sort !== undefined) { localVarQueryParameter['sort'] = sort; } if (order !== undefined) { localVarQueryParameter['order'] = order; } if (includeAllLabels) { localVarQueryParameter['includeAllLabels'] = includeAllLabels; } if (includeAnyLabels) { localVarQueryParameter['includeAnyLabels'] = includeAnyLabels; } if (excludeAnyLabels) { localVarQueryParameter['excludeAnyLabels'] = excludeAnyLabels; } if (includeStatuses) { localVarQueryParameter['includeStatuses'] = includeStatuses; } if (address !== undefined) { localVarQueryParameter['address'] = address; } if (txHash !== undefined) { localVarQueryParameter['txHash'] = txHash; } if (txId !== undefined) { localVarQueryParameter['txId'] = txId; } if (minAmount !== undefined) { localVarQueryParameter['minAmount'] = minAmount; } if (maxAmount !== undefined) { localVarQueryParameter['maxAmount'] = maxAmount; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns the config stored at this vault-and-asset scope, if any, and the effective strategy after workspace fallback and runtime resolution. `ADAPTIVE` is the recommended strategy. When no row is stored at this scope and none is inherited from the workspace (source `DEFAULT`), `effective` is `ADAPTIVE` if adaptive selection is serving for this scope, otherwise `ASC`. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary Get vault and asset UTXO selection config * @param {string} vaultAccountId The ID of the vault account. * @param {string} assetId The ID of the asset * @param {*} [options] Override http request option. * @throws {RequiredError} */ getVaultAssetUtxoSelectionConfig: async (vaultAccountId: string, assetId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getVaultAssetUtxoSelectionConfig', 'vaultAccountId', vaultAccountId) assertParamExistsAndNotEmpty('getVaultAssetUtxoSelectionConfig', 'assetId', assetId) const localVarPath = `/utxo_management/{vaultAccountId}/{assetId}/selection_config` .replace(`{${"vaultAccountId"}}`, encodeURIComponent(String(vaultAccountId))) .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 = 'getVaultAssetUtxoSelectionConfig'; 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, }; }, /** * Attach or detach labels to/from UTXOs in a vault account. Labels can be used for organizing and filtering UTXOs. Labels are applied additively — `labelsToAttach` adds to the existing label set and `labelsToDetach` removes from it. Neither operation replaces the full set. The request is all-or-nothing: if any identifier cannot be labelled, no UTXO is labelled and the request fails with `400`. The response lists every failed identifier in `failures`, each with its own `reason` — use it, not the status, to decide what to do: - `NOT_FOUND` — not found in this vault and asset. - `NOT_LABELLABLE` — spent, or removed, and can no longer be labelled. A UTXO removed within the last hour is reported as `NOT_FOUND` with `utxoStatus: REMOVED`; if it does not reappear, it becomes `NOT_LABELLABLE` after about an hour. A `400` without `failures` means the request itself is malformed. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Attach or detach labels to/from UTXOs * @param {AttachDetachUtxoLabelsRequest} attachDetachUtxoLabelsRequest * @param {string} vaultAccountId The ID of the vault account * @param {string} assetId The ID of the asset * @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} */ updateUtxoLabels: async (attachDetachUtxoLabelsRequest: AttachDetachUtxoLabelsRequest, vaultAccountId: string, assetId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('updateUtxoLabels', 'attachDetachUtxoLabelsRequest', attachDetachUtxoLabelsRequest) assertParamExistsAndNotEmpty('updateUtxoLabels', 'vaultAccountId', vaultAccountId) assertParamExistsAndNotEmpty('updateUtxoLabels', 'assetId', assetId) const localVarPath = `/utxo_management/{vaultAccountId}/{assetId}/labels` .replace(`{${"vaultAccountId"}}`, encodeURIComponent(String(vaultAccountId))) .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: 'PATCH', ...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 = 'updateUtxoLabels'; 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(attachDetachUtxoLabelsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Creates or updates the workspace-level UTXO selection strategy. `ADAPTIVE` is recommended. Endpoint Permission: Admin, Non-Signing Admin. * @summary Upsert UTXO selection config * @param {UpsertUtxoSelectionConfigRequest} upsertUtxoSelectionConfigRequest * @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} */ upsertUtxoSelectionConfig: async (upsertUtxoSelectionConfigRequest: UpsertUtxoSelectionConfigRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('upsertUtxoSelectionConfig', 'upsertUtxoSelectionConfigRequest', upsertUtxoSelectionConfigRequest) const localVarPath = `/utxo_management/selection_config`; // 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: 'PUT', ...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 = 'upsertUtxoSelectionConfig'; 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(upsertUtxoSelectionConfigRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Creates or updates the UTXO selection strategy for this vault account and asset. `ADAPTIVE` is recommended. Endpoint Permission: Admin, Non-Signing Admin. * @summary Upsert vault and asset UTXO selection config * @param {UpsertUtxoSelectionConfigRequest} upsertUtxoSelectionConfigRequest * @param {string} vaultAccountId The ID of the vault account. * @param {string} assetId The ID of the asset * @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} */ upsertVaultAssetUtxoSelectionConfig: async (upsertUtxoSelectionConfigRequest: UpsertUtxoSelectionConfigRequest, vaultAccountId: string, assetId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('upsertVaultAssetUtxoSelectionConfig', 'upsertUtxoSelectionConfigRequest', upsertUtxoSelectionConfigRequest) assertParamExistsAndNotEmpty('upsertVaultAssetUtxoSelectionConfig', 'vaultAccountId', vaultAccountId) assertParamExistsAndNotEmpty('upsertVaultAssetUtxoSelectionConfig', 'assetId', assetId) const localVarPath = `/utxo_management/{vaultAccountId}/{assetId}/selection_config` .replace(`{${"vaultAccountId"}}`, encodeURIComponent(String(vaultAccountId))) .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: 'PUT', ...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 = 'upsertVaultAssetUtxoSelectionConfig'; 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(upsertUtxoSelectionConfigRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * UTXOManagementApi - functional programming interface * @export */ export const UTXOManagementApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = UTXOManagementApiAxiosParamCreator(configuration) return { /** * Returns the workspace-level configured selection strategy and the effective strategy after runtime resolution. `ADAPTIVE` is the recommended strategy. When no row is stored (source `DEFAULT`), `effective` is `ADAPTIVE` if adaptive selection is serving for this workspace, otherwise `ASC`. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary Get UTXO selection config * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getUtxoSelectionConfig(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getUtxoSelectionConfig(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['UTXOManagementApi.getUtxoSelectionConfig']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns a paginated list of unspent transaction outputs (UTXOs) for a UTXO-based asset in a vault account, with optional filters for labels, statuses, amounts, and more. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List unspent outputs (UTXOs) * @param {string} vaultAccountId The ID of the vault account * @param {string} assetId The ID of the asset * @param {string} [pageCursor] Cursor for the next page of results * @param {number} [pageSize] Number of results per page (max 250, default 50) * @param {GetUtxosSortEnum} [sort] Field to sort by * @param {GetUtxosOrderEnum} [order] Sort order * @param {Array} [includeAllLabels] Only return UTXOs that have ALL of these labels (AND logic). * @param {Array} [includeAnyLabels] Return UTXOs that have ANY of these labels (OR logic). * @param {Array} [excludeAnyLabels] Exclude UTXOs that have ANY of these labels. * @param {Array} [includeStatuses] Filter by UTXO statuses to include. * @param {string} [address] Filter by address * @param {string} [txHash] Filter by the on-chain hash of the transaction that created the UTXOs. Returns all UTXOs originating from that transaction. * @param {string} [txId] Filter by the Fireblocks transaction ID that created the UTXOs. * @param {string} [minAmount] Minimum amount filter * @param {string} [maxAmount] Maximum amount filter * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getUtxos(vaultAccountId: string, assetId: string, pageCursor?: string, pageSize?: number, sort?: GetUtxosSortEnum, order?: GetUtxosOrderEnum, includeAllLabels?: Array, includeAnyLabels?: Array, excludeAnyLabels?: Array, includeStatuses?: Array, address?: string, txHash?: string, txId?: string, minAmount?: string, maxAmount?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getUtxos(vaultAccountId, assetId, pageCursor, pageSize, sort, order, includeAllLabels, includeAnyLabels, excludeAnyLabels, includeStatuses, address, txHash, txId, minAmount, maxAmount, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['UTXOManagementApi.getUtxos']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns the config stored at this vault-and-asset scope, if any, and the effective strategy after workspace fallback and runtime resolution. `ADAPTIVE` is the recommended strategy. When no row is stored at this scope and none is inherited from the workspace (source `DEFAULT`), `effective` is `ADAPTIVE` if adaptive selection is serving for this scope, otherwise `ASC`. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary Get vault and asset UTXO selection config * @param {string} vaultAccountId The ID of the vault account. * @param {string} assetId The ID of the asset * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getVaultAssetUtxoSelectionConfig(vaultAccountId: string, assetId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getVaultAssetUtxoSelectionConfig(vaultAccountId, assetId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['UTXOManagementApi.getVaultAssetUtxoSelectionConfig']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Attach or detach labels to/from UTXOs in a vault account. Labels can be used for organizing and filtering UTXOs. Labels are applied additively — `labelsToAttach` adds to the existing label set and `labelsToDetach` removes from it. Neither operation replaces the full set. The request is all-or-nothing: if any identifier cannot be labelled, no UTXO is labelled and the request fails with `400`. The response lists every failed identifier in `failures`, each with its own `reason` — use it, not the status, to decide what to do: - `NOT_FOUND` — not found in this vault and asset. - `NOT_LABELLABLE` — spent, or removed, and can no longer be labelled. A UTXO removed within the last hour is reported as `NOT_FOUND` with `utxoStatus: REMOVED`; if it does not reappear, it becomes `NOT_LABELLABLE` after about an hour. A `400` without `failures` means the request itself is malformed. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Attach or detach labels to/from UTXOs * @param {AttachDetachUtxoLabelsRequest} attachDetachUtxoLabelsRequest * @param {string} vaultAccountId The ID of the vault account * @param {string} assetId The ID of the asset * @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 updateUtxoLabels(attachDetachUtxoLabelsRequest: AttachDetachUtxoLabelsRequest, vaultAccountId: string, assetId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateUtxoLabels(attachDetachUtxoLabelsRequest, vaultAccountId, assetId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['UTXOManagementApi.updateUtxoLabels']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Creates or updates the workspace-level UTXO selection strategy. `ADAPTIVE` is recommended. Endpoint Permission: Admin, Non-Signing Admin. * @summary Upsert UTXO selection config * @param {UpsertUtxoSelectionConfigRequest} upsertUtxoSelectionConfigRequest * @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 upsertUtxoSelectionConfig(upsertUtxoSelectionConfigRequest: UpsertUtxoSelectionConfigRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.upsertUtxoSelectionConfig(upsertUtxoSelectionConfigRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['UTXOManagementApi.upsertUtxoSelectionConfig']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Creates or updates the UTXO selection strategy for this vault account and asset. `ADAPTIVE` is recommended. Endpoint Permission: Admin, Non-Signing Admin. * @summary Upsert vault and asset UTXO selection config * @param {UpsertUtxoSelectionConfigRequest} upsertUtxoSelectionConfigRequest * @param {string} vaultAccountId The ID of the vault account. * @param {string} assetId The ID of the asset * @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 upsertVaultAssetUtxoSelectionConfig(upsertUtxoSelectionConfigRequest: UpsertUtxoSelectionConfigRequest, vaultAccountId: string, assetId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.upsertVaultAssetUtxoSelectionConfig(upsertUtxoSelectionConfigRequest, vaultAccountId, assetId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['UTXOManagementApi.upsertVaultAssetUtxoSelectionConfig']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * UTXOManagementApi - factory interface * @export */ export const UTXOManagementApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = UTXOManagementApiFp(configuration) return { /** * Returns the workspace-level configured selection strategy and the effective strategy after runtime resolution. `ADAPTIVE` is the recommended strategy. When no row is stored (source `DEFAULT`), `effective` is `ADAPTIVE` if adaptive selection is serving for this workspace, otherwise `ASC`. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary Get UTXO selection config * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUtxoSelectionConfig(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUtxoSelectionConfig(options).then((request) => request(axios, basePath)); }, /** * Returns a paginated list of unspent transaction outputs (UTXOs) for a UTXO-based asset in a vault account, with optional filters for labels, statuses, amounts, and more. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List unspent outputs (UTXOs) * @param {UTXOManagementApiGetUtxosRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getUtxos(requestParameters: UTXOManagementApiGetUtxosRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getUtxos(requestParameters.vaultAccountId, requestParameters.assetId, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.sort, requestParameters.order, requestParameters.includeAllLabels, requestParameters.includeAnyLabels, requestParameters.excludeAnyLabels, requestParameters.includeStatuses, requestParameters.address, requestParameters.txHash, requestParameters.txId, requestParameters.minAmount, requestParameters.maxAmount, options).then((request) => request(axios, basePath)); }, /** * Returns the config stored at this vault-and-asset scope, if any, and the effective strategy after workspace fallback and runtime resolution. `ADAPTIVE` is the recommended strategy. When no row is stored at this scope and none is inherited from the workspace (source `DEFAULT`), `effective` is `ADAPTIVE` if adaptive selection is serving for this scope, otherwise `ASC`. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary Get vault and asset UTXO selection config * @param {UTXOManagementApiGetVaultAssetUtxoSelectionConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getVaultAssetUtxoSelectionConfig(requestParameters: UTXOManagementApiGetVaultAssetUtxoSelectionConfigRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getVaultAssetUtxoSelectionConfig(requestParameters.vaultAccountId, requestParameters.assetId, options).then((request) => request(axios, basePath)); }, /** * Attach or detach labels to/from UTXOs in a vault account. Labels can be used for organizing and filtering UTXOs. Labels are applied additively — `labelsToAttach` adds to the existing label set and `labelsToDetach` removes from it. Neither operation replaces the full set. The request is all-or-nothing: if any identifier cannot be labelled, no UTXO is labelled and the request fails with `400`. The response lists every failed identifier in `failures`, each with its own `reason` — use it, not the status, to decide what to do: - `NOT_FOUND` — not found in this vault and asset. - `NOT_LABELLABLE` — spent, or removed, and can no longer be labelled. A UTXO removed within the last hour is reported as `NOT_FOUND` with `utxoStatus: REMOVED`; if it does not reappear, it becomes `NOT_LABELLABLE` after about an hour. A `400` without `failures` means the request itself is malformed. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Attach or detach labels to/from UTXOs * @param {UTXOManagementApiUpdateUtxoLabelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateUtxoLabels(requestParameters: UTXOManagementApiUpdateUtxoLabelsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateUtxoLabels(requestParameters.attachDetachUtxoLabelsRequest, requestParameters.vaultAccountId, requestParameters.assetId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Creates or updates the workspace-level UTXO selection strategy. `ADAPTIVE` is recommended. Endpoint Permission: Admin, Non-Signing Admin. * @summary Upsert UTXO selection config * @param {UTXOManagementApiUpsertUtxoSelectionConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ upsertUtxoSelectionConfig(requestParameters: UTXOManagementApiUpsertUtxoSelectionConfigRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.upsertUtxoSelectionConfig(requestParameters.upsertUtxoSelectionConfigRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Creates or updates the UTXO selection strategy for this vault account and asset. `ADAPTIVE` is recommended. Endpoint Permission: Admin, Non-Signing Admin. * @summary Upsert vault and asset UTXO selection config * @param {UTXOManagementApiUpsertVaultAssetUtxoSelectionConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ upsertVaultAssetUtxoSelectionConfig(requestParameters: UTXOManagementApiUpsertVaultAssetUtxoSelectionConfigRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.upsertVaultAssetUtxoSelectionConfig(requestParameters.upsertUtxoSelectionConfigRequest, requestParameters.vaultAccountId, requestParameters.assetId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getUtxos operation in UTXOManagementApi. * @export * @interface UTXOManagementApiGetUtxosRequest */ export interface UTXOManagementApiGetUtxosRequest { /** * The ID of the vault account * @type {string} * @memberof UTXOManagementApiGetUtxos */ readonly vaultAccountId: string /** * The ID of the asset * @type {string} * @memberof UTXOManagementApiGetUtxos */ readonly assetId: string /** * Cursor for the next page of results * @type {string} * @memberof UTXOManagementApiGetUtxos */ readonly pageCursor?: string /** * Number of results per page (max 250, default 50) * @type {number} * @memberof UTXOManagementApiGetUtxos */ readonly pageSize?: number /** * Field to sort by * @type {'AMOUNT' | 'CONFIRMATIONS'} * @memberof UTXOManagementApiGetUtxos */ readonly sort?: GetUtxosSortEnum /** * Sort order * @type {'ASC' | 'DESC'} * @memberof UTXOManagementApiGetUtxos */ readonly order?: GetUtxosOrderEnum /** * Only return UTXOs that have ALL of these labels (AND logic). * @type {Array} * @memberof UTXOManagementApiGetUtxos */ readonly includeAllLabels?: Array /** * Return UTXOs that have ANY of these labels (OR logic). * @type {Array} * @memberof UTXOManagementApiGetUtxos */ readonly includeAnyLabels?: Array /** * Exclude UTXOs that have ANY of these labels. * @type {Array} * @memberof UTXOManagementApiGetUtxos */ readonly excludeAnyLabels?: Array /** * Filter by UTXO statuses to include. * @type {Array} * @memberof UTXOManagementApiGetUtxos */ readonly includeStatuses?: Array /** * Filter by address * @type {string} * @memberof UTXOManagementApiGetUtxos */ readonly address?: string /** * Filter by the on-chain hash of the transaction that created the UTXOs. Returns all UTXOs originating from that transaction. * @type {string} * @memberof UTXOManagementApiGetUtxos */ readonly txHash?: string /** * Filter by the Fireblocks transaction ID that created the UTXOs. * @type {string} * @memberof UTXOManagementApiGetUtxos */ readonly txId?: string /** * Minimum amount filter * @type {string} * @memberof UTXOManagementApiGetUtxos */ readonly minAmount?: string /** * Maximum amount filter * @type {string} * @memberof UTXOManagementApiGetUtxos */ readonly maxAmount?: string } /** * Request parameters for getVaultAssetUtxoSelectionConfig operation in UTXOManagementApi. * @export * @interface UTXOManagementApiGetVaultAssetUtxoSelectionConfigRequest */ export interface UTXOManagementApiGetVaultAssetUtxoSelectionConfigRequest { /** * The ID of the vault account. * @type {string} * @memberof UTXOManagementApiGetVaultAssetUtxoSelectionConfig */ readonly vaultAccountId: string /** * The ID of the asset * @type {string} * @memberof UTXOManagementApiGetVaultAssetUtxoSelectionConfig */ readonly assetId: string } /** * Request parameters for updateUtxoLabels operation in UTXOManagementApi. * @export * @interface UTXOManagementApiUpdateUtxoLabelsRequest */ export interface UTXOManagementApiUpdateUtxoLabelsRequest { /** * * @type {AttachDetachUtxoLabelsRequest} * @memberof UTXOManagementApiUpdateUtxoLabels */ readonly attachDetachUtxoLabelsRequest: AttachDetachUtxoLabelsRequest /** * The ID of the vault account * @type {string} * @memberof UTXOManagementApiUpdateUtxoLabels */ readonly vaultAccountId: string /** * The ID of the asset * @type {string} * @memberof UTXOManagementApiUpdateUtxoLabels */ readonly assetId: 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 UTXOManagementApiUpdateUtxoLabels */ readonly idempotencyKey?: string } /** * Request parameters for upsertUtxoSelectionConfig operation in UTXOManagementApi. * @export * @interface UTXOManagementApiUpsertUtxoSelectionConfigRequest */ export interface UTXOManagementApiUpsertUtxoSelectionConfigRequest { /** * * @type {UpsertUtxoSelectionConfigRequest} * @memberof UTXOManagementApiUpsertUtxoSelectionConfig */ readonly upsertUtxoSelectionConfigRequest: UpsertUtxoSelectionConfigRequest /** * 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 UTXOManagementApiUpsertUtxoSelectionConfig */ readonly idempotencyKey?: string } /** * Request parameters for upsertVaultAssetUtxoSelectionConfig operation in UTXOManagementApi. * @export * @interface UTXOManagementApiUpsertVaultAssetUtxoSelectionConfigRequest */ export interface UTXOManagementApiUpsertVaultAssetUtxoSelectionConfigRequest { /** * * @type {UpsertUtxoSelectionConfigRequest} * @memberof UTXOManagementApiUpsertVaultAssetUtxoSelectionConfig */ readonly upsertUtxoSelectionConfigRequest: UpsertUtxoSelectionConfigRequest /** * The ID of the vault account. * @type {string} * @memberof UTXOManagementApiUpsertVaultAssetUtxoSelectionConfig */ readonly vaultAccountId: string /** * The ID of the asset * @type {string} * @memberof UTXOManagementApiUpsertVaultAssetUtxoSelectionConfig */ readonly assetId: 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 UTXOManagementApiUpsertVaultAssetUtxoSelectionConfig */ readonly idempotencyKey?: string } /** * UTXOManagementApi - object-oriented interface * @export * @class UTXOManagementApi * @extends {BaseAPI} */ export class UTXOManagementApi extends BaseAPI { /** * Returns the workspace-level configured selection strategy and the effective strategy after runtime resolution. `ADAPTIVE` is the recommended strategy. When no row is stored (source `DEFAULT`), `effective` is `ADAPTIVE` if adaptive selection is serving for this workspace, otherwise `ASC`. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary Get UTXO selection config * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UTXOManagementApi */ public getUtxoSelectionConfig() { return UTXOManagementApiFp(this.configuration).getUtxoSelectionConfig().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns a paginated list of unspent transaction outputs (UTXOs) for a UTXO-based asset in a vault account, with optional filters for labels, statuses, amounts, and more. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary List unspent outputs (UTXOs) * @param {UTXOManagementApiGetUtxosRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UTXOManagementApi */ public getUtxos(requestParameters: UTXOManagementApiGetUtxosRequest) { return UTXOManagementApiFp(this.configuration).getUtxos(requestParameters.vaultAccountId, requestParameters.assetId, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.sort, requestParameters.order, requestParameters.includeAllLabels, requestParameters.includeAnyLabels, requestParameters.excludeAnyLabels, requestParameters.includeStatuses, requestParameters.address, requestParameters.txHash, requestParameters.txId, requestParameters.minAmount, requestParameters.maxAmount).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns the config stored at this vault-and-asset scope, if any, and the effective strategy after workspace fallback and runtime resolution. `ADAPTIVE` is the recommended strategy. When no row is stored at this scope and none is inherited from the workspace (source `DEFAULT`), `effective` is `ADAPTIVE` if adaptive selection is serving for this scope, otherwise `ASC`. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer. * @summary Get vault and asset UTXO selection config * @param {UTXOManagementApiGetVaultAssetUtxoSelectionConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UTXOManagementApi */ public getVaultAssetUtxoSelectionConfig(requestParameters: UTXOManagementApiGetVaultAssetUtxoSelectionConfigRequest) { return UTXOManagementApiFp(this.configuration).getVaultAssetUtxoSelectionConfig(requestParameters.vaultAccountId, requestParameters.assetId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Attach or detach labels to/from UTXOs in a vault account. Labels can be used for organizing and filtering UTXOs. Labels are applied additively — `labelsToAttach` adds to the existing label set and `labelsToDetach` removes from it. Neither operation replaces the full set. The request is all-or-nothing: if any identifier cannot be labelled, no UTXO is labelled and the request fails with `400`. The response lists every failed identifier in `failures`, each with its own `reason` — use it, not the status, to decide what to do: - `NOT_FOUND` — not found in this vault and asset. - `NOT_LABELLABLE` — spent, or removed, and can no longer be labelled. A UTXO removed within the last hour is reported as `NOT_FOUND` with `utxoStatus: REMOVED`; if it does not reappear, it becomes `NOT_LABELLABLE` after about an hour. A `400` without `failures` means the request itself is malformed. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Attach or detach labels to/from UTXOs * @param {UTXOManagementApiUpdateUtxoLabelsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UTXOManagementApi */ public updateUtxoLabels(requestParameters: UTXOManagementApiUpdateUtxoLabelsRequest) { return UTXOManagementApiFp(this.configuration).updateUtxoLabels(requestParameters.attachDetachUtxoLabelsRequest, requestParameters.vaultAccountId, requestParameters.assetId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Creates or updates the workspace-level UTXO selection strategy. `ADAPTIVE` is recommended. Endpoint Permission: Admin, Non-Signing Admin. * @summary Upsert UTXO selection config * @param {UTXOManagementApiUpsertUtxoSelectionConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UTXOManagementApi */ public upsertUtxoSelectionConfig(requestParameters: UTXOManagementApiUpsertUtxoSelectionConfigRequest) { return UTXOManagementApiFp(this.configuration).upsertUtxoSelectionConfig(requestParameters.upsertUtxoSelectionConfigRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Creates or updates the UTXO selection strategy for this vault account and asset. `ADAPTIVE` is recommended. Endpoint Permission: Admin, Non-Signing Admin. * @summary Upsert vault and asset UTXO selection config * @param {UTXOManagementApiUpsertVaultAssetUtxoSelectionConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof UTXOManagementApi */ public upsertVaultAssetUtxoSelectionConfig(requestParameters: UTXOManagementApiUpsertVaultAssetUtxoSelectionConfigRequest) { return UTXOManagementApiFp(this.configuration).upsertVaultAssetUtxoSelectionConfig(requestParameters.upsertUtxoSelectionConfigRequest, requestParameters.vaultAccountId, requestParameters.assetId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } } /** * @export */ export const GetUtxosSortEnum = { Amount: 'AMOUNT', Confirmations: 'CONFIRMATIONS' } as const; export type GetUtxosSortEnum = typeof GetUtxosSortEnum[keyof typeof GetUtxosSortEnum]; /** * @export */ export const GetUtxosOrderEnum = { Asc: 'ASC', Desc: 'DESC' } as const; export type GetUtxosOrderEnum = typeof GetUtxosOrderEnum[keyof typeof GetUtxosOrderEnum];