lez-programs/apps/amm/src/ActiveNetwork.h
2026-07-17 19:38:35 -03:00

39 lines
937 B
C++

#pragma once
#include <QString>
#include <QStringList>
struct ActiveNetworkSnapshot {
QString id;
QString status;
QString fingerprint;
QString ammProgramId;
QStringList tokenIds;
};
class ActiveNetwork final {
public:
bool load();
const QString& status() const { return m_network.status; }
bool isConfigured() const;
bool isDevnet() const;
bool needsIdentityProbe() const;
int identityRetryDelayMs() const;
ActiveNetworkSnapshot snapshot() const { return m_network; }
void sequencerChanged(bool available);
void reachabilityChanged(bool reachable, bool wasReachable);
void beginIdentityProbe();
void finishIdentityProbe(const QString& identity);
static bool isValidIdentity(const QString& value);
private:
void clearIdentity(const QString& status);
ActiveNetworkSnapshot m_network;
QString m_expectedIdentity;
int m_failedIdentityProbes = 0;
};