T3294
We explored creating our own ecash-coinselect library, but quickly ran into complications. Upon review, I think that library was trying to do too much. In particular, the handling of chronik utxos should be left more to the app developer.
This diff
- Refactors ecash-coinselect based on coinselect from BitcoinJS (some mods: throws errors, uses eCash dust threshhold), updating JS syntax
- Implements this library in Cashtab
- Commence refactor of Cashtab transaction functions by initializing new directory, unit tests, and function for sending XEC transactions, using ecash-coinselect
- Implement this new function on the Send.js screen of Cashtab to send simple eCash transactions with a fee of 1 sat/byte
It's useful to keep this in one diff as we can show that the upgrade to ecash-coinselect is practically useful (automated unit tests exist in both parts of the monorepo).
Using a single transaction.fixtures.js file to hold fixtures dramatically simplifies the current approach (importing mocks from dozens of files). Because Cashtab creates many types of transactions and the existing functions are unit tested and work, this implementation should be phased in. Legacy functions may be deprecated as they are obsoleted by improved and refactored functions.