User avatar
RushabhMadhu
Posts: 1
Joined: Fri Jun 29, 2018 9:41 am

Tranfer BTC using API or using node modules

Fri Jun 29, 2018 9:44 am

hello,
I have created bitcoin addresses dynamically using nodejs module. I have private key and address.
we want to tranfer BTC received in those dynamically generated address we have private key for it.
At present we are using below nodejs code to send BTC

var bitcoinTransaction = require('bitcoin-transaction');
var to = "12zyHTgqfm3XT5K9afmaPjhcwvbAYuBBHk";
var from ="1DnqKVAPB9JUxQxuc6xe9jycyvhWhu7NzS";
var privKeyWIF = "XXXX-Privatekey-XXXXXXX";

bitcoinTransaction.getBalance(from, { network: "mainnet" }).then((balanceInBTC) => {
var btcToSend=parseFloat(0.0001);
bitcoinTransaction.sendTransaction({
from: from,
to: to,
privKeyWIF: privKeyWIF,
btc: 0.00000547,
network: "mainnet",
fees: 3,
}).catch((error) => {
console.log(error);
}).then((result)=> {
console.log(result);
});
console.log(balanceInBTC);

}).catch((error) => { console.log(error); });


As we have done the transaction using this code it cost me fees as 206 satoshi per byte
Here is the tx : https://www.[Suspicious link removed]/en/btc/tx/2d4639266d3af9416b1f022193a3587df501a678a794744dbf8f4fddcecc3564

What i have to change to specify fixed fees for transaction. Is there any other API or node module that i can use for transfering BTC from one address to another using private key of address?

User avatar
apirone
Nickel Bitcoiner
Nickel Bitcoiner
Posts: 40
Joined: Thu Jan 25, 2018 2:23 pm

Donate BTC of your choice to 1DonateWffyhwAjskoEwXt83pHZxhLTr8H

Re: Tranfer BTC using API or using node modules

Wed Jul 04, 2018 3:18 pm

https://apirone.com - Bitcoin Segwit Processing Provider

Return to “Bitcoin Core”

Who is online

Users browsing this forum: No registered users and 9 guests