lib/transaction.js
function createRawTx(history, recipients, blockHeight, blockHash) {
  var txObj = { locktime: 0, version: 1, ins: [], outs: [] };

  txObj.ins = history.map(function (h) {
    return {
      output: { hash: h.txid, vout: h.vout },
      script: '',
      prevScriptPubKey: h.scriptPubKey,
      sequence: 'ffffffff'
    };
  });
  txObj.outs = recipients.map(function (o) {
    return {
      script: addressToScript(o.address, blockHeight, blockHash),
      satoshis: o.satoshis
    };
  });

  return txObj;
}
function createRawTx(history, recipients, blockHeight, blockHash) {
  var txObj = { locktime: 0, version: 1, ins: [], outs: [] };

  txObj.ins = history.map(function (h) {
    return {
      output: { hash: h.txid, vout: h.vout },
      script: '',
      prevScriptPubKey: h.scriptPubKey,
      sequence: 'ffffffff'
    };
  });
  txObj.outs = recipients.map(function (o) {
    return {
      script: addressToScript(o.address, blockHeight, blockHash),
      satoshis: o.satoshis
    };
  });

  return txObj;
}
/*
Creates a raw transaction
@param {[HISTORY]} history type, array of transaction history
@param {[RECIPIENTS]} recipient type, array of address on where to send coins to
@param {Number} blockHeight (latest - 300)
@param {String} blockHash of blockHeight
@return {TXOBJ} Transction Object (see TXOBJ type for info about structure)