[Cashtab] [pub key fetch from chronik p1] Get recipient public key from chronik instead of bch-api
Summary:
T2730
This diff extracts the public key of the intended recipient of an encrypted cashtab message by using chronik instead of bch-api.
For review, this will be implemented as a stacked diff. In part 1, Cashtab is still getting the public key using bch-api and also with chronik, then comparing them.
In part 2 I will remove the bch-api call and the debug logging.
Unfortunately jest is not able to mock some of the more complex chronik calls, which required an optional param to be added to the sendXec function.
Test Plan:
Review unit test changes and npm test
npm start
Send a private msg to an address with outgoing txs. Confirm it succeeds. Confirm the pub key determined by chronik matches that determined by bch-api in the dev console.
Send a private msg to an address with no outgoing txs. Confirm the error msg '[chronik] Cannot send an encrypted message to a wallet with no outgoing transactions' appears.
Reviewers: #bitcoin_abc, emack
Reviewed By: #bitcoin_abc, emack
Differential Revision: https://reviews.bitcoinabc.org/D12180