#pragma once #include namespace dragonx { namespace ui { float ComputeConsoleInputHeight(float frameHeightWithSpacing, float itemSpacingY, float spacingSm, float spacingXs, float cursorOffset); float ComputeConsoleOutputHeight(float availableHeight, float inputHeight, float minHeight, float minHeightRatio); float ClampConsoleWrapWidth(float contentWidth, float paddingX); // The console's daemon-error line prints once per error: on entering the Error state, when the // reason changes while still in it, or when the daemon crashed again meanwhile (the console only polls // while its tab is shown, so it can miss the Running state between two identical crashes). It used to // print on every poll, i.e. every frame, while in Error. bool ShouldPrintDaemonErrorLine(bool wasError, bool isError, const std::string& error, const std::string& lastPrinted, bool newUnexpectedExit = false); // True if `cmd`'s first token names a console/RPC command that carries a SECRET on its command line // (passphrase, private/spending/viewing key, mnemonic). Output-secret commands (dumpprivkey, // z_exportkey, z_exportmnemonic) are NOT covered — their secret is in the result, a separate concern. bool ConsoleCommandCarriesSecret(const std::string& cmd); // A display/history-safe copy of `cmd`: the command name with its arguments replaced by "****" when // it carries a secret, else `cmd` unchanged. The real command is still executed unredacted. std::string RedactConsoleCommand(const std::string& cmd); } // namespace ui } // namespace dragonx