getProofs method

  1. @override
Future<List<CashuProof>> getProofs({
  1. String? mintUrl,
  2. String? keysetId,
  3. CashuProofState state = CashuProofState.unspend,
})
override

Implementation

@override
Future<List<CashuProof>> getProofs({
  String? mintUrl,
  String? keysetId,
  CashuProofState state = CashuProofState.unspend,
}) async {
  if (cashuProofs.containsKey(mintUrl)) {
    return cashuProofs[mintUrl]!
        .where((proof) =>
            proof.state == state &&
            (keysetId == null || proof.keysetId == keysetId))
        .toList();
  } else {
    return cashuProofs.values
        .expand((proofs) => proofs)
        .where((proof) =>
            proof.state == state &&
            (keysetId == null || proof.keysetId == keysetId))
        .toList();
  }
}