How to setup transaction fee using BitcoinJS?
For example, i have unspent TX on 0.2 BTC lets call it myTx
, and i want send to Bob 0.1 BTC, but if i do something like this:
var tx = new bitcoin.TransactionBuilder();
tx.addInput(myTx, 0)
var keyPair = bitcoin.ECPair.fromWIF(privateKeyWIF)
tx.sign(0, keyPair)
tx.addOutput("1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK", 10000000)
tx.sign(0, keyPair)
It send 0.1 BTC to Bob and take 0.1 as fee, so how to set fee manually when you sending not all BTC from input?