Skip to content

Instantly share code, notes, and snippets.

@MasonBorda
MasonBorda / sendBitcoin.js
Last active June 8, 2017 23:52
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 < 6) {
console.log("usage:\n\t" + process.argv[0] + " " + process.argv[1] + " <walletId> <walletPassphrase> <destinationAddress> <amountSatoshis>");
process.exit(-1);
}
var walletId = process.argv[2];
var walletPassphrase = process.argv[3];
@MasonBorda
MasonBorda / getAddressBalance.js
Last active June 8, 2017 23:52
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];
@MasonBorda
MasonBorda / createWallet.js
Last active June 8, 2017 23:51
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 < 3) {
console.log("usage:\n\t" + process.argv[0] + " " + process.argv[1] + " <label> <walletPassword>");
process.exit(-1);
}
var label = process.argv[2];
var walletPassword = process.argv[3];
@MasonBorda
MasonBorda / authentication.js
Last active June 8, 2017 23:52
Getting Started With the BitGo SDK
var BitGoJS = require('bitgo');
if (process.argv.length < 3) {
console.log("usage:\n\t" + process.argv[0] + " " + process.argv[1] + " <accessToken>");
process.exit(-1);
}
// For Testnet environment set env to test
// For Livenet environment set env to prod
var accessToken = process.argv[2];