On this page

Consolidate Utxos

API-v2consolidate_utxos

Merges multiple unspent transaction outputs for an address.

After a wallet has cultivated a long history, or received many small mining payouts, it may become slower to respond. Consolidating unspent transaction outputs should be routinely performed when mining to wallet in order to avoid this.

Parameter* = requiredTypeDescription
coin*
string
The coin to consolidate utxos for.
merge_conditions*
object
The conditions to merge utxos.

Parameter* = requiredTypeDescription
result*
string
The outcome of the request.

fetch_utxos

POST
fetch_utxos
{
  "method": "consolidate_utxos",
  "mmrpc": "2.0",
  "params": {
    "coin": "MARTY",
    "merge_conditions": {
      "max_merge_at_once": 2,
      "merge_at": 2
    }
  },
  "userpass": "RPC_UserP@SSW0RD"
}

Parameter* = requiredTypeDescription
InvalidRequest
string
Optional. The request is malformed or missing required parameters.
MergeError
string
Optional. The requested merge failed. See error_data for more details.
NoSuchCoin
string
Optional. The selected coin was not found or is not activated yet.

{
    "mmrpc": "2.0",
    "error": "NoSuchCoin",
    "error_path": "consolidate_utxos.lp_coins",
    "error_trace": "consolidate_utxos:72] lp_coins:5278]",
    "error_type": "NoSuchCoin",
    "id": null 
}

{
    "mmrpc": "2.0",
    "error": "Failed to merge UTXOs: utxo_arc_builder:173] Not enough unspent UTXOs to merge for coin=MARTY, found=1, required=20",
    "error_path": "consolidate_utxos",
    "error_trace": "consolidate_utxos:89]",
    "error_type": "MergeError",
    "error_data": "Failed to merge UTXOs: utxo_arc_builder:173] Not enough unspent UTXOs to merge for coin=MARTY, found=1, required=20",
    "id": null
}

{
    "mmrpc": "2.0",
    "error": "Error parsing request: missing field `merge_at`",
    "error_path": "dispatcher",
    "error_trace": "dispatcher:143]",
    "error_type": "InvalidRequest",
    "error_data": "missing field `merge_at`",
    "id": null
}

{
  "mmrpc": "2.0",
  "error": "Error parsing request: missing field `max_merge_at_once`",
  "error_path": "dispatcher",
  "error_trace": "dispatcher:143]",
  "error_type": "InvalidRequest",
  "error_data": "missing field `max_merge_at_once`",
  "id": null
}