We want a powerful and user-friendly API that exposes commonly used steps in tx processing.
Here we initialize such an API with a method that supports non-token XEC txs.
- We can get the utxos required to build an arbitary tx without actually building the tx by calling wallet.tx(<instructions>).utxos()
- We can build a tx (and get info about it) without broadcasting it, by calling wallet.tx(<instructions>).build().fee() or wallet.tx(<instructions>).build().size(); or the actual TxBuilder with wallet.tx(<instructions>).build().tx
- We can build and broadcast a tx with one call with await wallet.tx(<instructions>).build().broadcast()
From here, - We should add a websocket so the user does not need to remember to call await wallet.sync() before sending every tx
- Add support for token methods
- Add support for chained txs, i.e. await wallet.tx(<instructions>).build().broadcast() should "just work" even if the instructions are asking to send more token outputs than a single tx can hold, or more XEC outputs than the tx broadcast limit of 100kb will tolerate.