getXmrConnectionSettings method

Future<List<UrlConnection>> getXmrConnectionSettings()

Fetches the list of XMR connections from the server.

This method sends a GetConnectionsRequest to retrieve all XMR connections from the Haveno gRPC server.

Example:

final connections = await xmrConnectionsClient.getXmrConnectionSettings();
for (final connection in connections) {
  print('Node URL: ${connection.url}');
}

Returns:

  • A Future containing a list of UrlConnection representing the node connections.
  • An empty list if an error occurs.

Implementation

Future<List<UrlConnection>> getXmrConnectionSettings() async {
  if (!havenoChannel.isConnected) {
    throw DaemonNotConnectedException();
  }
  try {
    final response = await havenoChannel.xmrConnectionsClient!
        .getConnections(GetConnectionsRequest());
    return response.connections;
  } on GrpcError catch (e) {
    handleGrpcError(e);
  }
  return [];
}