Integrated chronik's broadcastTx post method into the sendXec()'s tx broadcasting logic. The transaction builder portion is still using bch-js for now until I review Sam Rock's XEC fork of bch-js that natively supports ecash addresses.
Lessons learnt include:
- it's not necessary to spin up a https dev instance of cashtab to access chronik post methods, as the network errors encountered to date were just a server side COR policy config, which have now been resolved.
- no need to convert bitcoincash addresses back into ecash to interact with chronik's broadcastTx method, although we will eventually refactor the useBCH hook to use a fork of bch-js that can take in ecash addresses directly via TransactionBuilder.
TODO: as per telegram, further discussion needed on mocking chronik calls for the following unit tests in useBCH.test.js:
- sends XEC correctly
- sends XEC correctly with an encrypted OP_RETURN message
- sends one to many XEC correctly
- receives errors from the network and parses it