filterInputs

open override fun filterInputs(minAmt: Long, minConfirms: Int, filter: (Spendable) -> Long?): MutableList<Spendable>

Find inputs in this wallet to use in a new transaction. This does NOT mark them as used, so cannot be called repeatedly until consumeInputs is called. Inputs are already filtered by members of this contract. If the provided filter is null, only ungrouped UTXOs are selected.

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

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...