markUtxosAsSpentByIntent

suspend fun markUtxosAsSpentByIntent(utxoIntentIds: List<Pair<String, Int>>, spentByLocalTx: Boolean = true): Int

Mark UTXOs as spent by their intent identifiers (intentHash + outputNo).

IMPORTANT: The blockchain identifies UTXOs by intentHash + outputNo, but our database uses transactionHash:outputIndex as the primary key. This method looks up UTXOs by intentHash and then marks them by their database ID.

spentByLocalTx flag:

  • true (default): Our transaction SUCCEEDED and spent this UTXO. Healing will NOT restore it (we trust our local state over indexer lag).

  • false: Something else spent it (e.g., error 115 = node says already spent). Healing CAN restore it if indexer shows it's actually available.

When to use each:

  • Node accepts our transaction → spentByLocalTx=true

  • Error 115 (UTXO already spent) → spentByLocalTx=false (we didn't spend it!)

Return

Number of UTXOs successfully marked as spent

Parameters

utxoIntentIds

List of (intentHash, outputNo) pairs identifying UTXOs

spentByLocalTx

Whether OUR transaction spent these UTXOs (default: true)