rn-ldk icon indicating copy to clipboard operation
rn-ldk copied to clipboard

Add bitcoinjs-lib dependency

Open coreyphillips opened this issue 2 years ago • 3 comments

This PR:

  • Adds bitcoinjs-lib as a dependency.
  • Replaces the fetch request to https://runkit.io/overtorment/output-script-to-address/branches/master/ in the script2address method with the bitcoinjs-lib implementation.

coreyphillips avatar May 01 '22 15:05 coreyphillips

this dependency was omitted on purpose so the necessary functions would be injected by outer code, see this.injectedScript2address in your case

Overtorment avatar May 01 '22 20:05 Overtorment

If you would prefer to stick to a bring-your-own-method approach, I would suggest removing the fetch request completely and simply require the injectedScript2address method upon instantiation.

The same can be said for the decodeInvoice method here. I would be happy to open a PR making the changes if you would prefer that approach.

coreyphillips avatar May 01 '22 20:05 coreyphillips

eventually, yes, but not now.

consider, theres an example app in this repo, and i dont really want to mess with it to wire the socket to it so it can get data from electrum, crypto for bitcoinjs, rn-nodeify, all that.

Overtorment avatar May 02 '22 10:05 Overtorment