As observed in recent attempts to develop a simple tx building demo for new devs looking to build on eCash, there are a number of chronik specific nuances that the app dev needs to handle in their app.
One such nuance is where chronik-client's `.script().utxos()` api returns a mixture of both XEC and SLP UTXOs, which meant the app developer would have to explicitly filter in their app.
This diff:
- Keeps the existing `.script().utxos()` function to maintain backwards compatibility
- Adds a new `.script().utxosByType(type)` function to only return XEC or SLP UTXOs based on supplied type. Wallets which don't support eTokens can use this to easily retrieve UTXOs to spend without worrying about accidentally burning SLP UTXOs.
- Adds a new `.script().utxosSeparated()` function to return all UTXOs however neatly separated into two separate XEC and SLP UTXO arrays. Cashtab and other eToken compatible wallets can use this to refresh its XEC and SLP utxo sets without additional parsing logic.
Note: The XEC/SLP UTXO separation logic is essentially a filter applied on the `utxos` map array based on whether the `slpToken` param exists or not. This `slpToken` param determines whether the utxo is a token utxo or not, however worth noting that this only applies to the Chronik indexer, hence why it's worth abstracting this indexer specific knowledge from app devs.