-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Description
my code run smooth without any error but the bitcoin does not transfer to toAddress . code
sendTestnetBTC (paperWallet, toAddress, amount, txID) {
const address = bitcoin.ECPair.fromWIF(paperWallet.privateKey, bitcoin.networks.testnet)
const txb = new bitcoin.TransactionBuilder(bitcoin.networks.testnet)
txb.addInput(txID , 0) // previous transactionId from the address at index 0
txb.addOutput(toAddress, amount)
txb.sign(0, address)
txb.build().toHex()
}