[ecash-coinselect] Simplify to match functionality of coinselect library
Summary:
Remove chronik utxo mgmt from ecash-coinselect. Focus on functionality of original coinselect library to support transaction building for app developers. Implement accumulative utxo selection algorithm.
Summary of changes from coinselect
- Use eCash dust threshold
- Convert input utxos value key from string (given by chronik) to number (used by TransactionBuilder)
- Remove integer and infinity checks from coinselect (assume input utxos from chronik are not corrupted)
- Replace var declarations with let
- Ignore chronik slp utxos
- Throw errors if inputs and outputs cannot be determined (vs behavior of coinselect, which returns {fee} instead of {inputs, outputs, fee} when this happens
Test Plan: npm test
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien, emack
Differential Revision: https://reviews.bitcoinabc.org/D14526