August 4, 2026

Bitcoin Transaction using API with Custom Fees

I want to transfer Bitcoin from one individual address to another using API. But I want to set Transaction fees as per my requirement. So How can I do it ?

Right now I am using blockchain-transaction – npm api for transfer bitcoin from one address to another. So please shade some lights on this.

var bitcoinTransaction = require('bitcoin-transaction');
//Send all my money from wallet1 to wallet2 on the bitcoin testnet
var from = "mm3gdVh8n6YtcNyaTKYkveB6yTME7aDWNJ";
var to = "mgPUfqJk4X6gE4P5Do5RfpkTFsYmsSjCya";
var privKeyWIF = "cNZi8iySqBToXMpcsQaHKD5uv7HExBQJBSi4dTg3ZPaEzeNAzvbj";    //Private key in WIF form (Can generate this from bitcoinlib-js)
bitcoinTransaction.getBalance(from, { network: "testnet" }).then((balanceInBTC) => {
    return bitcoinTransaction.sendTransaction({
from: from,
to: to,
privKeyWIF: privKeyWIF,
BTC: balanceInBTC,
network: "testnet"
});
});
Previous Article

Can Copay iOS wallet sync with the Copay oSX wallet?

Next Article

How to send bitcoins without the bitcoin client in PHP

You might be interested in …

The Dawn Of The Bitcoin Art Renaissance

The Dawn Of The Bitcoin Art Renaissance

This is an opinion editorial by Dawdu M. Amantanah, author of “The Bit On Digital Coins: A Quick Practical Guide To Understanding Cryptocurrency.” The Renaissance was a time of significant advancement in human understanding. Fearless […]

Bitcoin Core 0.18.0 Released

Bitcoin Core 0.18.0 Released Bitcoin Core version 0.18.0 is now available for download containing several bug fixes and minor improvements. For a complete list of changes, please see the release notes. If have any questions, […]