completeTrade method

Future<void> completeTrade(
  1. String? tradeId
)

Completes a trade by marking it as finished.

Sends a CompleteTradeRequest to mark a trade as completed. If the client is not connected, a DaemonNotConnectedException is thrown.

Example:

await tradesService.completeTrade('tradeId');

Implementation

Future<void> completeTrade(String? tradeId) async {
  if (!havenoChannel.isConnected) {
    throw DaemonNotConnectedException();
  }
  try {
    await havenoChannel.tradesClient!
        .completeTrade(CompleteTradeRequest(tradeId: tradeId));
  } on GrpcError catch (e) {
    handleGrpcError(e);
  }
}