blocktrail-sdk-php icon indicating copy to clipboard operation
blocktrail-sdk-php copied to clipboard

Can't send bitcoin using pay api in node.js getting Invalid Address Error

Open ashokrayal opened this issue 7 years ago • 1 comments

I am using node. I am using exact mention code but I am not able to pay. I have tried with multiple addresses. I have attached the snapshot of code. Please help me. app.get("/pay/:address", function(req, res) { client.initWallet("ashokrayaltestnet", "12345678!@#$", function(err, wallet) { value = blocktrail.toSatoshi(1.1); wallet.pay({'1NcXPMRaanz43b1kokpPuYDdk6GGDvxT2T': value}, null, false, true, blocktrail.Wallet.FEE_STRATEGY_BASE_FEE, function(err, result) { if(err){ console.log(err); } res.send(JSON.stringify(result)); }); wallet.pay({'1NcXPMRaanz43b1kokpPuYDdk6GGDvxT2T': value}, null, false, true, blocktrail.Wallet.FEE_STRATEGY_LOW_PRIORITY, function(err, result) { if(err){ console.log(err); } res.send(JSON.stringify(result)); }); }); });

bitcoin pay error

ashokrayal avatar Oct 15 '17 07:10 ashokrayal

ashokrayaltestnet you mention testnet in your wallet identifier. If it's a testnet wallet, only testnet addresses will work, but you are passing in a mainnet address.

afk11 avatar Oct 15 '17 13:10 afk11