getUtxoAt
Gets a dust UTXO at a specific index.
Index Range: Valid indices are 0 until getUtxoCount() - 1.
UTXO Format: Returns hex-encoded serialized QualifiedDustOutput using Midnight's SCALE codec. This can be deserialized into a DustUtxo data class (to be implemented).
Usage:
val state = DustLocalState.create()!!
try {
for (i in 0 until state.getUtxoCount()) {
val utxoHex = state.getUtxoAt(i)
if (utxoHex != null) {
println("UTXO $i: $utxoHex")
}
}
} finally {
state.close()
}Content copied to clipboard
Error Handling: Returns null if:
State is closed
Index is out of bounds
Native function returns null
Return
Hex-encoded serialized UTXO, or null if index out of bounds
Parameters
index
Index of UTXO to retrieve (0-based)