function fromScriptChunk(obj, chunk, index) {
  // Handle Buffer
  if (chunk.buf) {
    obj[`b${index}`] = chunk.buf.toString('base64')
    obj[`h${index}`] = chunk.buf.toString('hex')
    obj[`s${index}`] = chunk.buf.toString()
  }
  // Handle opcode
  else {
    obj[`o${index}`] = OpCode.str[chunk.opCodeNum]
  }

  return obj
}
/**
 * Reducer function converts a BSV Script chunk to TXO parameters.
 * @private
 */
Reducer function converts a BSV Script chunk to TXO parameters.
@private
Reducer function converts a BSV Script chunk to TXO parameters . @private
function fromScriptChunk(obj, chunk, index) {
  if (chunk.buf) {
    obj[`b${index}`] = chunk.buf.toString('base64')
    obj[`h${index}`] = chunk.buf.toString('hex')
    obj[`s${index}`] = chunk.buf.toString()
  }
  else {
    obj[`o${index}`] = OpCode.str[chunk.opCodeNum]
  }
  return obj
}
function fromScriptChunk ( obj , chunk , index ) { if ( chunk . buf ) { obj [ ` ${ index } ` ] = chunk . buf . toString ( 'base64' ) obj [ ` ${ index } ` ] = chunk . buf . toString ( 'hex' ) obj [ ` ${ index } ` ] = chunk . buf . toString ( ) } else { obj [ ` ${ index } ` ] = OpCode . str [ chunk . opCodeNum ] } return obj }
Reducer function converts a BSV Script chunk to TXO parameters.
Reducer function converts a BSV Script chunk to TXO parameters .
// Handle Buffer // Handle opcode