I am trying to make a web app where if I push on a button, it will send some bitcoins from my bitcoin wallet (A) to another peer's bitcoin wallet (B). I've figured out how to make a raw bitcoin transaction like this:
var bitcoin = require('bitcoinjs-lib'); var keyPair = bitcoin.ECPair.fromWIF('****************************'); var tx = new bitcoin.TransactionBuilder(); tx.addInput('****************************', 0); tx.addOutput('****************************', 546); tx.sign(0, keyPair); console.log(tx.build().toHex()); generatedhash = tx.build().toHex();