getXmrNodeSettings method

Future<XmrNodeSettings?> getXmrNodeSettings()

Fetches the XMR node settings from the server.

This method sends a GetXmrNodeSettingsRequest to retrieve the current local Monero node settings configured on the Haveno server.

Example:

final nodeSettings = await xmrNodeProvider.getXmrNodeSettings();
if (nodeSettings != null) {
  print('Blockchain Path: ${nodeSettings.blockchainPath}');
}

Returns:

  • A Future containing the XmrNodeSettings.
  • null if an error occurs or no settings are available.

Throws:

Implementation

Future<XmrNodeSettings?> getXmrNodeSettings() async {
  if (!havenoChannel.isConnected) {
    throw DaemonNotConnectedException();
  }
  try {
    final getXmrNodeSettingsReply = await havenoChannel.xmrNodeClient!
        .getXmrNodeSettings(GetXmrNodeSettingsRequest());
    return getXmrNodeSettingsReply.settings;
  } on GrpcError catch (e) {
    handleGrpcError(e);
  }
  return null;
}