- Add refresh scheduler and network refresh service boundaries for typed refresh results, ordered RPC collectors, applicators, and price parsing. - Add daemon lifecycle and wallet security workflow helpers while preserving App-owned command RPC, decrypt, cancellation, and UI handoff behavior. - Split balance, console, mining, amount formatting, and async task logic into focused modules with expanded Phase 4 test coverage. - Fix market price loading by triggering price refresh immediately, avoiding queue-pressure drops, tracking loading/error state, and adding translations. - Polish send, explorer, peers, settings, theme/schema, and related tab UI. - Replace checked-in generated language headers with build-generated resources. - Document the cleanup audit, UI static-state guidance, and architecture updates.
55 lines
1.7 KiB
C++
55 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <nlohmann/json.hpp>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace dragonx {
|
|
namespace ui {
|
|
|
|
struct ConsoleCompletionResult {
|
|
std::vector<std::string> matches;
|
|
std::string commonPrefix;
|
|
};
|
|
|
|
struct ConsoleRpcCall {
|
|
bool valid = false;
|
|
std::string method;
|
|
nlohmann::json params = nlohmann::json::array();
|
|
};
|
|
|
|
enum class ConsoleResultLineRole {
|
|
Result,
|
|
Error,
|
|
JsonKey,
|
|
JsonString,
|
|
JsonNumber,
|
|
JsonBrace
|
|
};
|
|
|
|
struct ConsoleResultLine {
|
|
std::string text;
|
|
ConsoleResultLineRole role = ConsoleResultLineRole::Result;
|
|
};
|
|
|
|
const std::vector<std::string>& ConsoleRpcCommandNames();
|
|
void AppendConsoleHistory(std::vector<std::string>& history,
|
|
const std::string& command,
|
|
std::size_t maxEntries = 100);
|
|
int NavigateConsoleHistoryIndex(int currentIndex,
|
|
std::size_t historySize,
|
|
bool up);
|
|
std::string ConsoleHistoryEntry(const std::vector<std::string>& history,
|
|
int historyIndex);
|
|
ConsoleCompletionResult CompleteConsoleCommand(const std::string& input);
|
|
std::vector<std::string> FormatConsoleCompletionLines(const std::vector<std::string>& matches,
|
|
std::size_t maxLineLength = 60);
|
|
std::vector<std::string> ParseConsoleCommandArgs(const std::string& command);
|
|
ConsoleRpcCall BuildConsoleRpcCall(const std::string& command);
|
|
std::vector<ConsoleResultLine> FormatConsoleRpcResultLines(const std::string& result,
|
|
bool isError);
|
|
|
|
} // namespace ui
|
|
} // namespace dragonx
|