cancelOffer method

Future<void> cancelOffer(
  1. String offerId
)

Cancels an existing offer on the Haveno network.

Parameters:

  • offerId: The ID of the offer to cancel.

Throws a DaemonNotConnectedException if the client is not connected to the daemon. Catches GrpcError exceptions and handles them using handleGrpcError.

Implementation

Future<void> cancelOffer(String offerId) async {
  if (!havenoChannel.isConnected) {
    throw DaemonNotConnectedException();
  }
  try {
    havenoChannel.offersClient!.cancelOffer(CancelOfferRequest(id: offerId));
  } on GrpcError catch (e) {
    handleGrpcError(e);
  }
}