confirmPaymentReceived method

Future<TradeInfo?> confirmPaymentReceived(
  1. String tradeId
)

Confirms that the payment has been received for a specific trade.

Sends a ConfirmPaymentReceivedRequest to mark the payment as received. If the client is not connected, a DaemonNotConnectedException is thrown.

Example:

await tradesService.confirmPaymentReceived('tradeId');

Returns:

  • A Future containing the updated TradeInfo after confirming payment.

Implementation

Future<TradeInfo?> confirmPaymentReceived(String tradeId) async {
  if (!havenoChannel.isConnected) {
    throw DaemonNotConnectedException();
  }
  try {
    await havenoChannel.tradesClient!.confirmPaymentReceived(
        ConfirmPaymentReceivedRequest(tradeId: tradeId));
    return await getTrade(tradeId);
  } on GrpcError catch (e) {
    handleGrpcError(e);
  }
  return null;
}