function toTxScript({ script, last }, { cell, i }) {
  const n = cell.length - 1

  cell.forEach(c => {
    if (c.ops)    { script.writeOpCode(c.op) }
    else if (c.b) { script.writeBuffer(Buffer.from(c.b, 'base64')) }
    else if (c.h) { script.writeBuffer(Buffer.from(c.h, 'hex')) }
  })

  if (i < last && cell[n].op !== OpCode.OP_RETURN) {
    script.writeBuffer(Buffer.from('|'))
  }

  return { script, last }
}
/**
 * Reducer function converts a BOB tape to a BSV Tx script.
 * @private
 */
Reducer function converts a BOB tape to a BSV Tx script.
@private
Reducer function converts a BOB tape to a BSV Tx script . @private
function toTxScript({ script, last }, { cell, i }) {
  const n = cell.length - 1
  cell.forEach(c => {
    if (c.ops)    { script.writeOpCode(c.op) }
    else if (c.b) { script.writeBuffer(Buffer.from(c.b, 'base64')) }
    else if (c.h) { script.writeBuffer(Buffer.from(c.h, 'hex')) }
  })
  if (i < last && cell[n].op !== OpCode.OP_RETURN) {
    script.writeBuffer(Buffer.from('|'))
  }
  return { script, last }
}
function toTxScript ( { script , last } , { cell , i } ) { const n = cell . length - 1 cell . forEach ( c => { if ( c . ops ) { script . writeOpCode ( c . op ) } else if ( c . b ) { script . writeBuffer ( Buffer . from ( c . b , 'base64' ) ) } else if ( c . h ) { script . writeBuffer ( Buffer . from ( c . h , 'hex' ) ) } } ) if ( i < last && cell [ n ] . op !== OpCode . OP_RETURN ) { script . writeBuffer ( Buffer . from ( '|' ) ) } return { script , last } }
Reducer function converts a BOB tape to a BSV Tx script.
Reducer function converts a BOB tape to a BSV Tx script .