How to use the bitgo.bitcoin function in bitgo

To help you get started, we’ve selected a few bitgo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BitGo / bitgod / src / bitgod.js View on Github external
// Copyright 2014 BitGo, Inc.  All Rights Reserved.
//

var ArgumentParser = require('argparse').ArgumentParser;
var assert = require('assert');
var bitgo = require('bitgo');
var bitcoin = bitgo.bitcoin;
var ini = require('ini');
var rpc = require('json-rpc2');
var Q = require('q');
var fs = require('fs');
var _ = require('lodash');
var winston = require('winston');
_.string = require('underscore.string');
var pjson = require('../package.json');
var BITGOD_VERSION = pjson.version;

Q.longStackSupport = true;

var BitGoD = function () {
  this.loggingEnabled = true;

  // Set up logger
github BitGo / bitgo-cli / src / recovery.js View on Github external
const request = require('superagent');
require('superagent-as-promised')(request);
const fs = require('fs');
const Promise = require('bluebird');
const co = Promise.coroutine;
const _ = require('lodash');
const bitcoin = require('bitgo').bitcoin;
const moment = require('moment');

/**
 * An instance of the recovery tool, which encapsulates the recovery functions
 * Instantiated with parameters:
 *   - bitgo: an instance of the bitgo SDK
 *   - sourceCoin: the coin that needs to be recovered
 *   - recoveryType: the type of address the faulty transaction was sent to
 */
const CrossChainRecoveryTool = function CrossChainRecoveryTool(opts) {
  Object.assign(this, opts);

  if (!this.bitgo) {
    throw new Error('Please instantiate the recovery tool with a bitgo instance.');
  }
github BitGo / bitgo-cli / src / bgcl.js View on Github external
#!/usr/bin/env node

const ArgumentParser = require('argparse').ArgumentParser;
const bitgo = require('bitgo');
const bitcoin = bitgo.bitcoin;

const bs58check = require('bs58check');
const crypto = require('crypto');
const Q = require('q');
const Promise = require('bluebird');
const co = Promise.coroutine;
const fs = require('fs');
const moment = require('moment');
const read = require('read');
const readline = require('readline');
const secrets = require('secrets.js-grempe');
const sjcl = require('sjcl');
const qr = require('qr-image');
const open = require('open');
const util = require('util');
const _ = require('lodash');