You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
744 B

/// 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;
/// Creates a [NostrRelay] instance.
NostrRelay({
required this.url,
this.isConnected = false,
});
/// 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)';
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is NostrRelay && other.url == url;
}
@override
int get hashCode => url.hashCode;
}

Powered by TurnKey Linux.