T3582
Stop using Buffer type and replace with ecash-lib's native Script
Background
Target outputs are currently created with script key as Buffer types, which utxo-lib used to build transactions.
ecash-lib uses its own Script class, which is much better.
- Build OP_RETURN scripts using ecash-lib instead of utxo-lib script compiler
- Build SLP1 OP_RETURN scripts with ecash-lib methods and not slp-mdm methods
While it would be nice to split out these cases, it is imo a better practice to keep one generalized tx building/signing/broadcasting function for Cashtab vs distinct functions for distinct use cases. This approach simplifies unit testing, makes it more clear what logic should move to ecash-lib, and helps in figuring out other tx types since it is clear what problem needs to be isolated (e.g. input selection, output script building).
Note
We still cannot (yet) deprecate slp-mdm or utxo-lib, as Cashtab uses BN from slp-mdm in other places (to be deprecated), and utxo-lib is still used to sign and verify msgs (to be replaced by ecash-lib).
This diff is necessary before we add new tx types to Cashtab, i.e. NFT trading with ecash-agora