src/btc/utils.js
function buildIncompleteRedeem(network, txid, address, value) {
  const bitcoinNetwork = bitcoin.networks[network];

  // NB: storemen address validation requires that vout is 0
  const vout = 0;

  const txb = new bitcoin.TransactionBuilder(bitcoinNetwork);

  txb.setVersion(1);
  txb.addInput(hex.stripPrefix(txid), vout);
  txb.addOutput(address, parseInt(value));

  return txb.buildIncomplete();
}
function buildIncompleteRedeem(network, txid, address, value) {
  const bitcoinNetwork = bitcoin.networks[network];

  // NB: storemen address validation requires that vout is 0
  const vout = 0;

  const txb = new bitcoin.TransactionBuilder(bitcoinNetwork);

  txb.setVersion(1);
  txb.addInput(hex.stripPrefix(txid), vout);
  txb.addOutput(address, parseInt(value));

  return txb.buildIncomplete();
}
function buildIncompleteRedeem ( network , txid , address , value ) { const bitcoinNetwork = bitcoin . networks [ network ] ; // NB: storemen address validation requires that vout is 0 const vout = 0 ; const txb = new bitcoin . TransactionBuilder ( bitcoinNetwork ) ; txb . setVersion ( 1 ) ; txb . addInput ( hex . stripPrefix ( txid ) , vout ) ; txb . addOutput ( address , parseInt ( value ) ) ; return txb . buildIncomplete ( ) ; }
Build incomplete redeem transaction
@param {string} network - Network name (mainnet, testnet)
@param {string} txid - The txid for the UTXO being spent
@param {string} address - The address to receive funds
@param {string|number} value - The amount of funds to be sent (in Satoshis)
@returns {Object} Incomplete redeem transaction
Build incomplete redeem transaction