CoinSelection.largestFirst constructor
CoinSelection.largestFirst({})
A simple selection algorithm that selects inputs from the candidates
starting from the largest value until the required amount has been
reached. The order of the selected inputs are randomised.
Implementation
factory CoinSelection.largestFirst({
int version = Transaction.currentVersion,
required Iterable<InputCandidate> candidates,
required Iterable<Output> recipients,
required Program changeProgram,
required BigInt feePerKb,
required BigInt minFee,
required BigInt minChange,
int locktime = 0,
}) => CoinSelection.inOrderUntilEnough(
version: version,
candidates: candidates.toList().sorted(
(a, b) => b.value.compareTo(a.value),
),
recipients: recipients,
changeProgram: changeProgram,
feePerKb: feePerKb,
minFee: minFee,
minChange: minChange,
randomise: true,
locktime: locktime,
);