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>
146 lines
4.7 KiB
C++
146 lines
4.7 KiB
C++
#pragma once
|
|
|
|
#include "lite_wallet_server_selection_adapter.h"
|
|
|
|
#include "../config/settings.h"
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace dragonx {
|
|
namespace wallet {
|
|
|
|
enum class LiteWalletLifecycleUiExecutionStatus {
|
|
ReadyForFutureLifecycleRequest,
|
|
WaitingForLiteBuild,
|
|
WaitingForBackendCapability,
|
|
WaitingForSettings,
|
|
WaitingForPersistedServerSelection,
|
|
WaitingForServerSelection,
|
|
WaitingForDisplayStatus,
|
|
WaitingForLifecycleUi,
|
|
WaitingForRequest,
|
|
WaitingForPrivateDataRedaction,
|
|
WaitingForSyncPlannerFeed,
|
|
RuntimeExecutionDisabled
|
|
};
|
|
|
|
enum class LiteWalletLifecycleUiExecutionIssue {
|
|
FullNodeBuild,
|
|
LiteBackendCapabilityMissing,
|
|
SettingsNotLoaded,
|
|
PersistedServerSelectionIntentMissing,
|
|
ServerSelectionMissing,
|
|
SelectedServerDisplayMissing,
|
|
LifecycleUiOwnerMissing,
|
|
LifecycleOperationUnconfirmed,
|
|
OpenWalletPathMissing,
|
|
RestoreSeedMissing,
|
|
PrivateDataRedactionMissing,
|
|
SyncPlannerFeedMissing,
|
|
ServerConnectivityCheckRequested,
|
|
WalletExistsCheckRequested,
|
|
WalletLifecycleExecutionRequested,
|
|
SyncRequested,
|
|
SyncStatusPollingRequested,
|
|
WorkerQueueRequested,
|
|
WalletStateMutationRequested,
|
|
WalletFilePersistenceRequested,
|
|
SendImportExportRequested,
|
|
SettingsWriteRequested
|
|
};
|
|
|
|
struct LiteWalletLifecycleUiRequestIntent {
|
|
bool requestProvided = false;
|
|
LiteWalletLifecycleOperation operation = LiteWalletLifecycleOperation::CreateNew;
|
|
LiteWalletCreateRequest createRequest;
|
|
LiteWalletOpenRequest openRequest;
|
|
LiteWalletRestoreRequest restoreRequest;
|
|
};
|
|
|
|
struct LiteWalletLifecycleUiExecutionInput {
|
|
WalletCapabilities capabilities;
|
|
LiteWalletLifecycleUiRequestIntent request;
|
|
bool settingsLoaded = true;
|
|
bool requirePersistedServerSelectionIntent = true;
|
|
LiteWalletLifecycleUiPrerequisites ui;
|
|
|
|
bool settingsWriteRequested = false;
|
|
bool serverConnectivityCheckRequested = false;
|
|
bool walletExistsCheckRequested = false;
|
|
bool walletLifecycleExecutionRequested = false;
|
|
bool syncStartRequested = false;
|
|
bool syncStatusPollingRequested = false;
|
|
bool workerQueueEnqueueRequested = false;
|
|
bool walletStateMutationRequested = false;
|
|
bool walletFilePersistenceRequested = false;
|
|
bool sendImportExportExecutionRequested = false;
|
|
};
|
|
|
|
struct LiteWalletLifecycleUiExecutionIssueInfo {
|
|
LiteWalletLifecycleUiExecutionIssue issue = LiteWalletLifecycleUiExecutionIssue::SettingsNotLoaded;
|
|
std::string message;
|
|
};
|
|
|
|
struct LiteWalletLifecycleUiExecutionResult {
|
|
bool ok = false;
|
|
bool dryRunOnly = true;
|
|
bool noNetwork = true;
|
|
bool noBridgeCalls = true;
|
|
bool noServerHealthChecked = true;
|
|
bool noWalletExistsChecked = true;
|
|
bool noWalletCreated = true;
|
|
bool noWalletOpened = true;
|
|
bool noWalletRestored = true;
|
|
bool noSyncStarted = true;
|
|
bool noSyncStatusPolled = true;
|
|
bool noWalletPersistence = true;
|
|
bool noSettingsPersistence = true;
|
|
bool noSendImportExportExecution = true;
|
|
bool settingsWritten = false;
|
|
bool workerQueueEnqueued = false;
|
|
bool stateMutationAllowed = false;
|
|
bool stateMutated = false;
|
|
bool walletStateWritten = false;
|
|
bool selectedServerSettingsLoaded = false;
|
|
bool selectedServerIntentAccepted = false;
|
|
bool lifecycleReadinessAccepted = false;
|
|
bool requestAccepted = false;
|
|
bool privateDataRedacted = false;
|
|
bool lifecycleReportCouldFeedSyncPlanners = false;
|
|
LiteWalletLifecycleUiExecutionStatus status = LiteWalletLifecycleUiExecutionStatus::WaitingForSettings;
|
|
std::string error;
|
|
std::string selectedServerUrlRedacted;
|
|
std::string requestSummaryRedacted;
|
|
std::string diagnosticSummary;
|
|
LiteConnectionSettings connectionSettings;
|
|
LiteServerSelectionResult selectedServer;
|
|
LiteWalletServerSelectionUiExecutionResult serverSelectionReport;
|
|
LiteWalletServerLifecycleReadinessInput lifecycleInput;
|
|
LiteWalletServerLifecycleReadinessResult lifecycleReadiness;
|
|
std::vector<LiteRedactedPrivateData> privateData;
|
|
std::vector<LiteWalletLifecycleUiExecutionIssueInfo> issues;
|
|
};
|
|
|
|
const char* liteWalletLifecycleUiExecutionStatusName(
|
|
LiteWalletLifecycleUiExecutionStatus status);
|
|
const char* liteWalletLifecycleUiExecutionIssueName(
|
|
LiteWalletLifecycleUiExecutionIssue issue);
|
|
|
|
LiteWalletLifecycleUiExecutionResult executeLiteWalletLifecycleUiRequest(
|
|
config::Settings& settings,
|
|
const LiteWalletLifecycleUiExecutionInput& input);
|
|
|
|
class LiteWalletLifecycleUiExecutionAdapter {
|
|
public:
|
|
explicit LiteWalletLifecycleUiExecutionAdapter(config::Settings& settings);
|
|
|
|
LiteWalletLifecycleUiExecutionResult execute(
|
|
const LiteWalletLifecycleUiExecutionInput& input) const;
|
|
|
|
private:
|
|
config::Settings& settings_;
|
|
};
|
|
|
|
} // namespace wallet
|
|
} // namespace dragonx
|