confirmPaymentReceived method
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 updatedTradeInfo
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;
}