var product_length = _.floor(tData.duration) + 1; var state = 0; var list = tData.timelineData;
let totalBalanceSatoshi = _.sumBy(unspentOutputs, (x) => { return x.amountSatoshi }) // value of all unspent outputs let workingBalanceSatoshi = totalBalanceSatoshi - feeTotalSat // deduct the fee, the remainder is to be divided amongst the outputs let perOutputAmountSatoshi = _.floor(workingBalanceSatoshi / newOutputCount) // amount for each output