Skip to content

Instantly share code, notes, and snippets.

@MasonBorda
Last active June 8, 2017 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MasonBorda/4f4e4cb095845414563f to your computer and use it in GitHub Desktop.
Save MasonBorda/4f4e4cb095845414563f to your computer and use it in GitHub Desktop.
Getting Started With the BitGo SDK
var BitGoJS = require('bitgo');
var bitgo = new BitGoJS.BitGo({env: 'test', accessToken: process.env.ACCESS_TOKEN});
if (process.argv.length < 2) {
console.log("usage:\n\t" + process.argv[0] + " " + process.argv[1] + " <address>");
process.exit(-1);
}
if (process.argv.length > 2) {
address = process.argv[2];
}
bitgo.wallets().get({type: 'bitcoin', id: address}, function(err, wallet) {
if (err) { console.log(err); process.exit(-1); }
console.log('Wallet balance is: ');
console.log(wallet.balance() + ' Satoshis');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment