Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ashokrayal opened this issue Oct 15, 2017 · 1 comment

Comments

@ashokrayal
Copy link

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

@afk11
Copy link
Contributor

afk11 commented Oct 15, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants