registerDisputeAgent method

Future<void> registerDisputeAgent(
  1. String disputeAgentType,
  2. String registrationKey
)

Registers a dispute agent on the Haveno server.

Takes disputeAgentType and registrationKey as parameters, which define the type of dispute agent being registered and the key required for registration.

Throws a DaemonNotConnectedException if the havenoChannel is not connected.

Throws specific exceptions depending on the gRPC error encountered.

Example:

await disputeAgentService.registerDisputeAgent('mediator', 'some_registration_key');

Implementation

Future<void> registerDisputeAgent(String disputeAgentType, String registrationKey) async {
  if (!havenoChannel.isConnected) {
    throw DaemonNotConnectedException();
  }
  try {
    await havenoChannel.disputeAgentsClient!.registerDisputeAgent(RegisterDisputeAgentRequest(
      disputeAgentType: disputeAgentType,
      registrationKey: registrationKey
    ));
  } on GrpcError catch (e) {
    handleGrpcError(e);
  }
}