resolveDispute method

Future<void> resolveDispute(
  1. String tradeId,
  2. DisputeResult_Winner? winner,
  3. DisputeResult_Reason? reason,
  4. String? summaryNotes,
  5. Int64? customPayoutAmount,
)

Implementation

Future<void> resolveDispute(String tradeId, DisputeResult_Winner? winner, DisputeResult_Reason? reason, String? summaryNotes, Int64? customPayoutAmount) async {
  if (!havenoChannel.isConnected) {
    throw DaemonNotConnectedException();
  }

  Dispute? dispute = await getDispute(tradeId);
  if (!dispute!.isOpener) {
    throw Exception("You can't close a dispute you didn't open!");
  }

  try {
    await havenoChannel.disputesClient?.resolveDispute(ResolveDisputeRequest(
      tradeId: tradeId,
      winner: winner,
      reason: reason,
      summaryNotes: summaryNotes,
      customPayoutAmount: customPayoutAmount,
    ));

    getDisputes();
  } on GrpcError catch (e) {
    handleGrpcError(e);
  }
}