function fromTxoObject(src) {
  const {i, seq, e} = src
  const target = {i, seq, e}
  Object.keys(target).forEach(key => {
    target[key] === undefined ? delete target[key] : {}
  })

  const { tape } = [...Array(src.len).keys()]
    .reduce(({tape, t}, index) => {
      const cell = ['o', 'b', 'h', 's', 'f']
        .reduce((tgt, k) => {
          if (src[k+index]) tgt[k] = src[k+index];
          return tgt
        }, { ii: index })
      return fromTxoAttr(cell, {tape, t})
    }, { tape: [{i: 0}], t: 0 })

  return { ...target, tape }
}
/**
 * Creates a BOB formatted input or output from the given TXO src.
 * @private
 */
Creates a BOB formatted input or output from the given TXO src.
@private
Creates a BOB formatted input or output from the given TXO src . @private
function fromTxoObject(src) {
  const {i, seq, e} = src
  const target = {i, seq, e}
  Object.keys(target).forEach(key => {
    target[key] === undefined ? delete target[key] : {}
  })
  const { tape } = [...Array(src.len).keys()]
    .reduce(({tape, t}, index) => {
      const cell = ['o', 'b', 'h', 's', 'f']
        .reduce((tgt, k) => {
          if (src[k+index]) tgt[k] = src[k+index];
          return tgt
        }, { ii: index })
      return fromTxoAttr(cell, {tape, t})
    }, { tape: [{i: 0}], t: 0 })
  return { ...target, tape }
}
function fromTxoObject ( src ) { const { i , seq , e } = src const target = { i , seq , e } Object . keys ( target ) . forEach ( key => { target [ key ] === undefined ? delete target [ key ] : { } } ) const { tape } = [ ... Array ( src . len ) . keys ( ) ] . reduce ( ( { tape , t } , index ) => { const cell = [ 'o' , 'b' , 'h' , 's' , 'f' ] . reduce ( ( tgt , k ) => { if ( src [ k + index ] ) tgt [ k ] = src [ k + index ] ; return tgt } , { ii : index } ) return fromTxoAttr ( cell , { tape , t } ) } , { tape : [ { i : 0 } ] , t : 0 } ) return { ... target , tape } }
Creates a BOB formatted input or output from the given TXO src.
Creates a BOB formatted input or output from the given TXO src .