/// Represents a Nostr relay connection. class NostrRelay { /// Relay URL (e.g., 'wss://relay.example.com'). final String url; /// Whether the relay is currently connected. bool isConnected; /// Whether the relay is enabled (should be used). bool isEnabled; /// Creates a [NostrRelay] instance. NostrRelay({ required this.url, this.isConnected = false, this.isEnabled = true, }); /// Creates a [NostrRelay] from a URL string. factory NostrRelay.fromUrl(String url) { return NostrRelay(url: url); } @override String toString() { return 'NostrRelay(url: $url, connected: $isConnected, enabled: $isEnabled)'; } @override bool operator ==(Object other) { if (identical(this, other)) return true; return other is NostrRelay && other.url == url; } @override int get hashCode => url.hashCode; }