LtbLightning / bdk-rn

Bitcoin Development Kit - React Native Module
MIT License
50 stars 15 forks source link

Exception in native call from JS #59

Closed robertclarkson closed 1 year ago

robertclarkson commented 1 year ago

Trying to build a transaction. Unsure if im doing it correctly? I get the error

Exception in native call from JS

Any help much appreciated.

const txbuilder = await new TxBuilder().create();
await txbuilder.feeRate(2);
const addr = await new Address().create('muiFYa8MjFeorqCmboFqyNRc3aJReTdzC4');
await txbuilder.addRecipient(addr, 0.0001);
await txbuilder.finish(wallet);
robertclarkson commented 1 year ago

OK my bad. Turns out i need the script pubkey in here

await txbuilder.addRecipient(await addr.scriptPubKey(), 0.0001);