How to use the bitgo.bitcoin.TransactionBuilder 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 / bitgo-cli / src / recovery.js View on Github external
let network;

  if (this.test) {
    this.sourceCoin = this.bitgo.coin('t' + sourceCoin);
    this.recoveryCoin = this.bitgo.coin('t' + recoveryCoin);

    network = bitcoin.networks.testnet;
  } else {
    this.sourceCoin = this.bitgo.coin(sourceCoin);
    this.recoveryCoin = this.bitgo.coin(recoveryCoin);

    network = bitcoin.networks.bitcoin;
  }

  this.recoveryTx = new bitcoin.TransactionBuilder(network);

  if (sourceCoin === 'bch') {
    this.recoveryTx.enableBitcoinCash(true);
    this.recoveryTx.setVersion(2);
  }
};