A method which is selecting boxes to spend in order to collect needed amounts of ergo tokens and assets.
A method which is selecting boxes to spend in order to collect needed amounts of ergo tokens and assets.
- unspent boxes to choose from.
- ergo balance to be met
- assets balances to be met
Left(error) if select() is failing to pick appropriate boxes, otherwise Right(res), where res contains boxes to spend as well as monetary values and assets for boxes containing change (wrapped in a special BoxSelectionResult class).
Default implementation of the box selector. It simply picks boxes till sum of their monetary values meets target Ergo balance, then it checks which assets are not fulfilled and adds boxes till target asset values are met.