filterInputs

fun filterInputs(minAmt: Long, minConfirms: Int = 0, filter: (Spendable) -> Long? = null): MutableList<Spendable>

Select inputs based on the provided filter. If a filter is NOT provided, only ungrouped, uncontracted UTXOs are provided, and minAmt is counted in Satoshis. NOTE: If a filter IS provided, you must filter out groups and contracts if you want to!

Parameters

minAmt

This function keep iterating providing filter with options until the total amount of "stuff" exceeds this value. You define what is counted by what value you return from filter.

minConfirms

(default 0) Minimum block confirmations.

filter

Pass a filter to select from the available UTXOs. This passed function should return the amount "filled" by this input in units of the minAmt parameter. Return 0 to not use this input. Typically what is returned is satoshis, but if you wanted N inputs (irrespective of the amount in them) you could pass N for minAmt, and return 1 in your function. Or you could filter by tokens and return the token amount rather than the satoshi amount...