# UTXOManagementApi

All URIs are relative to https://developers.fireblocks.com/reference/

Method | HTTP request | Description
------------- | ------------- | -------------
[**getUtxoSelectionConfig**](#getUtxoSelectionConfig) | **GET** /utxo_management/selection_config | Get UTXO selection config
[**getUtxos**](#getUtxos) | **GET** /utxo_management/{vaultAccountId}/{assetId}/unspent_outputs | List unspent outputs (UTXOs)
[**getVaultAssetUtxoSelectionConfig**](#getVaultAssetUtxoSelectionConfig) | **GET** /utxo_management/{vaultAccountId}/{assetId}/selection_config | Get vault and asset UTXO selection config
[**updateUtxoLabels**](#updateUtxoLabels) | **PATCH** /utxo_management/{vaultAccountId}/{assetId}/labels | Attach or detach labels to/from UTXOs
[**upsertUtxoSelectionConfig**](#upsertUtxoSelectionConfig) | **PUT** /utxo_management/selection_config | Upsert UTXO selection config
[**upsertVaultAssetUtxoSelectionConfig**](#upsertVaultAssetUtxoSelectionConfig) | **PUT** /utxo_management/{vaultAccountId}/{assetId}/selection_config | Upsert vault and asset UTXO selection config


# **getUtxoSelectionConfig**
> UtxoSelectionConfigResponse getUtxoSelectionConfig()

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.

### Example


```typescript
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, UtxoSelectionConfigResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body:any = {};

fireblocks.utxoManagement.getUtxoSelectionConfig(body).then((res: FireblocksResponse<UtxoSelectionConfigResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
```


### Parameters
This endpoint does not need any parameter.


### Return type

**[UtxoSelectionConfigResponse](../models/UtxoSelectionConfigResponse.md)**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Current UTXO selection config |  * X-Request-ID -  <br>  |
**0** | Error Response |  * X-Request-ID -  <br>  |

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **getUtxos**
> ListUtxosResponse getUtxos()

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.

### Example


```typescript
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, UTXOManagementApiGetUtxosRequest, ListUtxosResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body: UTXOManagementApiGetUtxosRequest = {
  // string | The ID of the vault account
  vaultAccountId: vaultAccountId_example,
  // string | The ID of the asset
  assetId: assetId_example,
  // string | Cursor for the next page of results (optional)
  pageCursor: MjAyNS0wNy0wOSAxMDo1MzoxMy40NTI=:NA==,
  // number | Number of results per page (max 250, default 50) (optional)
  pageSize: 50,
  // 'AMOUNT' | 'CONFIRMATIONS' | Field to sort by (optional)
  sort: AMOUNT,
  // 'ASC' | 'DESC' | Sort order (optional)
  order: ASC,
  // Array<string> | Only return UTXOs that have ALL of these labels (AND logic). (optional)
  includeAllLabels: ["cold-storage"],
  // Array<string> | Return UTXOs that have ANY of these labels (OR logic). (optional)
  includeAnyLabels: ["vip","high-value"],
  // Array<string> | Exclude UTXOs that have ANY of these labels. (optional)
  excludeAnyLabels: ["deprecated"],
  // Array<string> | Filter by UTXO statuses to include. (optional)
  includeStatuses: ["AVAILABLE","PENDING"],
  // string | Filter by address (optional)
  address: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa,
  // string | Filter by the on-chain hash of the transaction that created the UTXOs. Returns all UTXOs originating from that transaction. (optional)
  txHash: 0000000000000000000a1b2c3d4e5f60718293a4b5c6d7e8f900112233445566,
  // string | Filter by the Fireblocks transaction ID that created the UTXOs. (optional)
  txId: f47ac10b-58cc-4372-a567-0e02b2c3d479,
  // string | Minimum amount filter (optional)
  minAmount: 0.001,
  // string | Maximum amount filter (optional)
  maxAmount: 1.0,
};

fireblocks.utxoManagement.getUtxos(body).then((res: FireblocksResponse<ListUtxosResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
```


### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **vaultAccountId** | [**string**] | The ID of the vault account | defaults to undefined
 **assetId** | [**string**] | The ID of the asset | defaults to undefined
 **pageCursor** | [**string**] | Cursor for the next page of results | (optional) defaults to undefined
 **pageSize** | [**number**] | Number of results per page (max 250, default 50) | (optional) defaults to 50
 **sort** | [**&#39;AMOUNT&#39; | &#39;CONFIRMATIONS&#39;**]**Array<&#39;AMOUNT&#39; &#124; &#39;CONFIRMATIONS&#39;>** | Field to sort by | (optional) defaults to undefined
 **order** | [**&#39;ASC&#39; | &#39;DESC&#39;**]**Array<&#39;ASC&#39; &#124; &#39;DESC&#39;>** | Sort order | (optional) defaults to undefined
 **includeAllLabels** | **Array&lt;string&gt;** | Only return UTXOs that have ALL of these labels (AND logic). | (optional) defaults to undefined
 **includeAnyLabels** | **Array&lt;string&gt;** | Return UTXOs that have ANY of these labels (OR logic). | (optional) defaults to undefined
 **excludeAnyLabels** | **Array&lt;string&gt;** | Exclude UTXOs that have ANY of these labels. | (optional) defaults to undefined
 **includeStatuses** | **Array&lt;string&gt;** | Filter by UTXO statuses to include. | (optional) defaults to undefined
 **address** | [**string**] | Filter by address | (optional) defaults to undefined
 **txHash** | [**string**] | Filter by the on-chain hash of the transaction that created the UTXOs. Returns all UTXOs originating from that transaction. | (optional) defaults to undefined
 **txId** | [**string**] | Filter by the Fireblocks transaction ID that created the UTXOs. | (optional) defaults to undefined
 **minAmount** | [**string**] | Minimum amount filter | (optional) defaults to undefined
 **maxAmount** | [**string**] | Maximum amount filter | (optional) defaults to undefined


### Return type

**[ListUtxosResponse](../models/ListUtxosResponse.md)**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A paginated list of UTXOs |  * X-Request-ID -  <br>  |
**0** | Error Response |  * X-Request-ID -  <br>  |

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **getVaultAssetUtxoSelectionConfig**
> UtxoSelectionConfigResponse getVaultAssetUtxoSelectionConfig()

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.

### Example


```typescript
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, UTXOManagementApiGetVaultAssetUtxoSelectionConfigRequest, UtxoSelectionConfigResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body: UTXOManagementApiGetVaultAssetUtxoSelectionConfigRequest = {
  // string | The ID of the vault account.
  vaultAccountId: vaultAccountId_example,
  // string | The ID of the asset
  assetId: assetId_example,
};

fireblocks.utxoManagement.getVaultAssetUtxoSelectionConfig(body).then((res: FireblocksResponse<UtxoSelectionConfigResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
```


### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **vaultAccountId** | [**string**] | The ID of the vault account. | defaults to undefined
 **assetId** | [**string**] | The ID of the asset | defaults to undefined


### Return type

**[UtxoSelectionConfigResponse](../models/UtxoSelectionConfigResponse.md)**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Current UTXO selection config |  * X-Request-ID -  <br>  |
**0** | Error Response |  * X-Request-ID -  <br>  |

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **updateUtxoLabels**
> AttachDetachUtxoLabelsResponse updateUtxoLabels(attachDetachUtxoLabelsRequest, )

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.

### Example


```typescript
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, UTXOManagementApiUpdateUtxoLabelsRequest, AttachDetachUtxoLabelsResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body: UTXOManagementApiUpdateUtxoLabelsRequest = {
  // AttachDetachUtxoLabelsRequest
  attachDetachUtxoLabelsRequest: param_value,
  // string | The ID of the vault account
  vaultAccountId: vaultAccountId_example,
  // string | The ID of the asset
  assetId: assetId_example,
  // 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. (optional)
  idempotencyKey: idempotencyKey_example,
};

fireblocks.utxoManagement.updateUtxoLabels(body).then((res: FireblocksResponse<AttachDetachUtxoLabelsResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
```


### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **attachDetachUtxoLabelsRequest** | **[AttachDetachUtxoLabelsRequest](../models/AttachDetachUtxoLabelsRequest.md)**|  |
 **vaultAccountId** | [**string**] | The ID of the vault account | defaults to undefined
 **assetId** | [**string**] | The ID of the asset | defaults to undefined
 **idempotencyKey** | [**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. | (optional) defaults to undefined


### Return type

**[AttachDetachUtxoLabelsResponse](../models/AttachDetachUtxoLabelsResponse.md)**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | UTXOs with updated labels |  * X-Request-ID -  <br>  |
**400** | Some identifiers could not be labelled (listed in &#x60;failures&#x60;), or the request is malformed. No UTXO was labelled. |  * X-Request-ID -  <br>  |
**0** | Error Response |  * X-Request-ID -  <br>  |

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **upsertUtxoSelectionConfig**
> UtxoSelectionConfigResponse upsertUtxoSelectionConfig(upsertUtxoSelectionConfigRequest)

Creates or updates the workspace-level UTXO selection strategy. `ADAPTIVE` is recommended. Endpoint Permission: Admin, Non-Signing Admin.

### Example


```typescript
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, UTXOManagementApiUpsertUtxoSelectionConfigRequest, UtxoSelectionConfigResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body: UTXOManagementApiUpsertUtxoSelectionConfigRequest = {
  // UpsertUtxoSelectionConfigRequest
  upsertUtxoSelectionConfigRequest: param_value,
  // 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. (optional)
  idempotencyKey: idempotencyKey_example,
};

fireblocks.utxoManagement.upsertUtxoSelectionConfig(body).then((res: FireblocksResponse<UtxoSelectionConfigResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
```


### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **upsertUtxoSelectionConfigRequest** | **[UpsertUtxoSelectionConfigRequest](../models/UpsertUtxoSelectionConfigRequest.md)**|  |
 **idempotencyKey** | [**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. | (optional) defaults to undefined


### Return type

**[UtxoSelectionConfigResponse](../models/UtxoSelectionConfigResponse.md)**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Updated UTXO selection config |  * X-Request-ID -  <br>  |
**0** | Error Response |  * X-Request-ID -  <br>  |

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **upsertVaultAssetUtxoSelectionConfig**
> UtxoSelectionConfigResponse upsertVaultAssetUtxoSelectionConfig(upsertUtxoSelectionConfigRequest, )

Creates or updates the UTXO selection strategy for this vault account and asset. `ADAPTIVE` is recommended. Endpoint Permission: Admin, Non-Signing Admin.

### Example


```typescript
import { readFileSync } from 'fs';
import { Fireblocks, BasePath } from '@fireblocks/ts-sdk';
import type { FireblocksResponse, UTXOManagementApiUpsertVaultAssetUtxoSelectionConfigRequest, UtxoSelectionConfigResponse } from '@fireblocks/ts-sdk';

// Set the environment variables for authentication
process.env.FIREBLOCKS_BASE_PATH = BasePath.Sandbox; // or assign directly to "https://sandbox-api.fireblocks.io/v1"
process.env.FIREBLOCKS_API_KEY = "my-api-key";
process.env.FIREBLOCKS_SECRET_KEY = readFileSync("./fireblocks_secret.key", "utf8");

const fireblocks = new Fireblocks();

let body: UTXOManagementApiUpsertVaultAssetUtxoSelectionConfigRequest = {
  // UpsertUtxoSelectionConfigRequest
  upsertUtxoSelectionConfigRequest: param_value,
  // string | The ID of the vault account.
  vaultAccountId: vaultAccountId_example,
  // string | The ID of the asset
  assetId: assetId_example,
  // 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. (optional)
  idempotencyKey: idempotencyKey_example,
};

fireblocks.utxoManagement.upsertVaultAssetUtxoSelectionConfig(body).then((res: FireblocksResponse<UtxoSelectionConfigResponse>) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(res, null, 2));
}).catch((error:any) => console.error(error));
```


### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **upsertUtxoSelectionConfigRequest** | **[UpsertUtxoSelectionConfigRequest](../models/UpsertUtxoSelectionConfigRequest.md)**|  |
 **vaultAccountId** | [**string**] | The ID of the vault account. | defaults to undefined
 **assetId** | [**string**] | The ID of the asset | defaults to undefined
 **idempotencyKey** | [**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. | (optional) defaults to undefined


### Return type

**[UtxoSelectionConfigResponse](../models/UtxoSelectionConfigResponse.md)**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Updated UTXO selection config |  * X-Request-ID -  <br>  |
**0** | Error Response |  * X-Request-ID -  <br>  |

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)


