I'm new on Stackoverflow as a member. So I'm sorry if I don't know yet how to put the code in the design you do :s
I tried all night to find a way to make the deposit Bitcoin Key out of the client.initWallet('***', '***', function(err, wallet)
function.
The console.log(address)
you see downstairs is working fine. But juste after the }
, I cannont access the data. I really don't know what to do. If someone has any idea why I can't keep the value on "address
" ...
Thanks for your time :D
const key = '*key*';
const secret = '*secretkey*';
blocktrail = require('blocktrail-sdk');
client = blocktrail.BlocktrailSDK({
apiKey: key,
apiSecret: secret,
network: 'BTC',
testnet: false
});
client.initWallet('*user*', '*password*',
function(err, wallet) {
wallet.getNewAddress(function (err, address) {
**console.log(address);**
});
});