feat(lite): lite wallet foundation (inherited working-tree state)

Preserve the previously-uncommitted lite wallet implementation and related dev WIP
under version control:
- src/wallet/ lite services: client bridge, bridge runtime, connection, lifecycle,
  sync, gateway, result parsers, state mapper, artifact contract/resolver, refresh
  services, UI adapters, wallet_backend/capabilities. (Includes two small M1 fixes:
  lifecycle walletReady now parses the response; default chain name -> "main".)
- src/chat/ chat protocol; tests/fixtures/ (lite + hushchat); tools/hushchat_fixture_check.cpp;
  scripts/build-lite-backend-artifact.sh.
- Pre-existing modified app_network/security/wizard, network_refresh_service, sidebar,
  mining_tab, bootstrap dialog, and version headers captured as-is.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-04 21:15:28 -05:00
parent a78a13edf3
commit 863d015628
69 changed files with 39458 additions and 85 deletions

View File

@@ -62,19 +62,8 @@ namespace {
bool isPageEnabledForBuild(ui::NavPage page)
{
#if DRAGONX_LITE_BUILD
switch (page) {
case ui::NavPage::Console:
case ui::NavPage::Peers:
case ui::NavPage::Explorer:
return false;
default:
return true;
}
#else
(void)page;
return true;
#endif
return wallet::isUiSurfaceAvailable(
wallet::currentWalletCapabilities(), ui::NavPageSurface(page));
}
std::string unencryptedTransactionHistoryCacheKey(const std::string& walletIdentity)
@@ -204,7 +193,7 @@ void App::tryConnect()
connection_status_ = TR("sb_no_conf");
// Try to start embedded daemon if enabled
if (use_embedded_daemon_ && !isEmbeddedDaemonRunning()) {
if (isUsingEmbeddedDaemon() && !isEmbeddedDaemonRunning()) {
connection_status_ = TR("sb_starting_daemon");
if (startEmbeddedDaemon()) {
// Will retry connection after daemon starts
@@ -222,7 +211,7 @@ void App::tryConnect()
daemon_controller_ ? daemon_controller_->lastError().c_str() : "(no daemon object)",
daemon::EmbeddedDaemon::findDaemonBinary().c_str());
}
} else if (!use_embedded_daemon_) {
} else if (!isUsingEmbeddedDaemon()) {
VERBOSE_LOGF("[connect #%d] Embedded daemon disabled (using external). No config found at %s\n",
connect_attempt, confPath.c_str());
}
@@ -273,7 +262,7 @@ void App::tryConnect()
daemon_controller_->lastError().empty() ? "(none)" : daemon_controller_->lastError().c_str());
} else {
VERBOSE_LOGF("[connect #%d] No embedded daemon object (use_embedded=%s)\n",
attempt, use_embedded_daemon_ ? "yes" : "no");
attempt, isUsingEmbeddedDaemon() ? "yes" : "no");
}
worker_->post([this, config, daemonStarting, externalDetected, attempt]() -> rpc::RPCWorker::MainCb {
@@ -377,7 +366,7 @@ void App::tryConnect()
onDisconnected("Connection failed");
VERBOSE_LOGF("[connect #%d] RPC connection failed — no daemon starting, no external detected\n", attempt);
if (use_embedded_daemon_ && !isEmbeddedDaemonRunning()) {
if (isUsingEmbeddedDaemon() && !isEmbeddedDaemonRunning()) {
// Prevent infinite crash-restart loop
if (daemon_controller_ && daemon_controller_->crashCount() >= 3) {
{ char buf[128]; snprintf(buf, sizeof(buf), TR("sb_daemon_crashed"), daemon_controller_->crashCount());
@@ -397,7 +386,7 @@ void App::tryConnect()
daemon_controller_ ? daemon_controller_->lastError().c_str() : "(no daemon object)");
}
}
} else if (!use_embedded_daemon_) {
} else if (!isUsingEmbeddedDaemon()) {
VERBOSE_LOGF("[connect #%d] Embedded daemon disabled — external daemon at %s:%s not responding\n",
attempt, config.host.c_str(), config.port.c_str());
} else {
@@ -1392,11 +1381,11 @@ void App::refreshMarketData()
void App::startMining(int threads)
{
#if DRAGONX_LITE_BUILD
(void)threads;
ui::Notifications::instance().warning("Solo mining is unavailable in lite build");
return;
#endif
if (!supportsSoloMining()) {
(void)threads;
ui::Notifications::instance().warning("Solo mining is unavailable in lite build");
return;
}
if (!state_.connected || !rpc_ || !worker_) return;
if (mining_toggle_in_progress_.exchange(true)) return; // already in progress
@@ -1426,9 +1415,7 @@ void App::startMining(int threads)
void App::stopMining()
{
#if DRAGONX_LITE_BUILD
return;
#endif
if (!supportsSoloMining()) return;
if (!state_.connected || !rpc_ || !worker_) return;
if (mining_toggle_in_progress_.exchange(true)) return; // already in progress
@@ -1454,6 +1441,12 @@ void App::stopMining()
void App::startPoolMining(int threads)
{
if (!supportsPoolMining()) {
(void)threads;
ui::Notifications::instance().warning("Pool mining is unavailable in this build");
return;
}
if (!xmrig_manager_)
xmrig_manager_ = std::make_unique<daemon::XmrigManager>();