getSpendableOutputs function

List<ElectrumOutput> getSpendableOutputs({
  1. required List<UTXOTransaction> txList,
})

Returns a map of UTXOs which belong to us and are unspent and their corresponding transactions

Implementation

List<ElectrumOutput> getSpendableOutputs(
        {required List<UTXOTransaction> txList}) =>
    [
      for (final tx in txList)
        for (final ElectrumOutput output in tx.outputs)
          if (output.spent == false && output.belongsToUs == true) output
    ];