NostrRegistry class abstract

This is responsible for registering and retrieving relays WebSockets that are connected to the app.

Annotations
  • @protected

Constructors

NostrRegistry()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

eventsRegistry Map<NostrEventKey, NostrEvent>
This is the registry which will have all events.
final
okCommandCallBacks Map<String, void Function(NostrEventOkCommand ok)?>
final
relaysWebSocketsRegistry Map<String, WebSocket>
This is the registry which will have all relays WebSockets.
final

Static Methods

allRelaysEntries() List<MapEntry<String, WebSocket>>
Returns all WebSockets registered in the registry.
clearAllRegistries() → void
Clears all registries.
eventUniqueId(NostrEvent event) NostrEventKey
getOkCommandCallBack(String associatedEventIdWithOkCommand) → void Function(NostrEventOkCommand ok)?
getRelayWebSocket({required String relayUrl}) WebSocket?
Returns the WebSocket registered with the given relayUrl.
isEventRegistered(NostrEvent event) bool
isRelayRegistered(String relayUrl) bool
Wether a WebSocket is registered with the given relayUrl.
registerEvent(NostrEvent event) NostrEvent
registerOkCommandCallBack(String associatedEventId, void onOk(NostrEventOkCommand ok)?) → void
registerRelayWebSocket({required String relayUrl, required WebSocket webSocket}) WebSocket
Registers a WebSocket to the registry with the given relayUrl. If a WebSocket is already registered with the given relayUrl, it will be replaced.
unregisterRelay(String relay) bool