NostrRegistry class abstract
This is responsible for registering and retrieving relays WebSockets that are connected to the app.
- Annotations
-
- @protected
Constructors
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
-
eoseCommandCallBacks
→ Map<
String, void Function(NostrRequestEoseCommand eose)?> -
final
-
eventsRegistry
→ Map<
NostrEventKey, ReceivedNostrEvent> -
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(
ReceivedNostrEvent event) → NostrEventKey -
getEoseCommandCallBack(
String subscriptionId) → void Function(NostrRequestEoseCommand eose)? -
getOkCommandCallBack(
String associatedEventIdWithOkCommand) → void Function(NostrEventOkCommand ok)? -
getRelayWebSocket(
{required String relayUrl}) → WebSocket? -
Returns the WebSocket registered with the given
relayUrl
. -
isEventRegistered(
ReceivedNostrEvent event) → bool -
isRelayRegistered(
String relayUrl) → bool -
Wether a WebSocket is registered with the given
relayUrl
. -
registerEoseCommandCallBack(
String subscriptionId, void onEose(NostrRequestEoseCommand eose)?) → void -
registerEvent(
ReceivedNostrEvent event) → ReceivedNostrEvent -
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 givenrelayUrl
, it will be replaced. -
unregisterRelay(
String relay) → bool