Last active
August 29, 2015 14:22
-
-
Save williamcotton/aeaf8b9b4f3dcd509a83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bitstore = require("bitstore"); | |
document.getElementById("generate-bitstore-client").addEventListener("click", function(event) { | |
var signMessage = function (message, cb) { | |
var key = wallet.getPrivateKey(0); | |
var network = bitcoin.networks.testnet; | |
cb(null, bitcoin.Message.sign(key, message, network).toString('base64')); | |
}; | |
var bitstoreClient = bitstore({ | |
network: 'testnet', | |
address: address, | |
signMessage: signMessage | |
}); | |
bitstoreClient.wallet.get(function (err, res) { | |
bitstoreDepositAddress = res.body.deposit_address; | |
bitstoreBalance = res.body.balance; | |
document.getElementById("bitstore-deposit-address").innerHTML = bitstoreDepositAddress; | |
document.getElementById("bitstore-balance").innerHTML = bitstoreBalance; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment