I have idea that it would be useful for some use cases to export coin selection (SelectCoinsBnB()) via JSON-RPC API. For example, I have written a bash script which constructs fake coinjoin transactions (transactions that looks like JoinMarket's coinjoins from blockchain analysis perspective, but all inputs and change outputs are actually from the same wallet) and I currently do very dumb coin selection there (basically, listunspent and then go through UTXO's in that order until I have necessary amount). Would be cool if I could use more clever coin selection algos already present in Bitcoin Core.
It could be something like this:
selectcoins amount [use_bnb]
Run coin selection and return array of unspent transaction outputs
Arguments:
1. amount (numeric or string, required) The amount in BTC
2. use_bnb (bool, optional, default=true) Use "branch and bound" coin selection algorithm
If this sounds ok, I will look at actually implementing it.
Also, somebody who is more into coin selection stuff could look at proposed syntax of RPC call, probably it would be useful to have some additional parameters, etc...