closeAccount method

Future<void> closeAccount()

Closes the currently active account from the daemon

Throws a DaemonNotConnectedException if the havenoChannel is not connected.

Throws specific exceptions depending on the gRPC error encountered.

Implementation

Future<void> closeAccount() async {
  if (!havenoChannel.isConnected) {
    throw DaemonNotConnectedException();
  }
  try {
    // Need to check what this is actually returning #TODO
    await havenoChannel.accountClient!.closeAccount(CloseAccountRequest());
  } on GrpcError catch (e) {
    // Will need to catch whatever exception is thrown for invalid password
    handleGrpcError(e);
  }
}