Nostr class

This class is responsible for handling the connection to all relays.

Implementers

Constructors

Nostr({NostrDebugOptions? debugOptions, NostrServices? services, NostrClientOptions clientOptions = const NostrClientOptions()})
This class is responsible for handling the connection to all relays.
factory
Nostr.enterprise({NostrDebugOptions? debugOptions, NostrServices? services, NostrClientOptions clientOptions = const NostrClientOptions(connectionTimeout: Duration(seconds: 10), requestTimeout: Duration(seconds: 15))})
Enterprise-oriented default preset.
factory

Properties

activeSubscriptions Map<String, SubscriptionMetadata>
Active managed subscriptions.
no setter
bech32 NostrBech32
Bech32 encoding surface.
no setter
client NostrClient
Enterprise facade with typed result and resilience APIs.
no setter
connectedRelays List<String>
High-level relay list known by the active client.
no setter
hashCode int
The hash code for this object.
no setterinherited
isConnected bool
Whether the high-level client currently has active relay connections.
no setter
keys NostrKeys
Key management surface.
no setter
relays NostrRelays
Advanced low-level relay surface.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
services NostrServices
latefinal
subscriptions SubscriptionManager
Subscription tracking surface.
no setter
subscriptionStatistics SubscriptionStatistics
Aggregate managed subscription metrics.
no setter
utils NostrUtils
Utility helpers surface.
no setter

Methods

closeAllSubscriptions() → void
Close all client-tracked subscriptions.
connect(List<String> relays) Future<NostrResult<void>>
Connect with the enterprise client facade.
connectDefaults() Future<NostrResult<void>>
Connect using package defaults.
count(NostrCountEvent countEvent, {List<String>? relays}) Future<NostrResult<NostrCountResponse>>
Execute a count request through the enterprise client facade.
disableLogs() → void
This method will disable the logs of the library.
disconnect() Future<NostrResult<void>>
Disconnect and cleanup tracked subscriptions.
enableLogs() → void
This method will enable the logs of the library.
filterBuilder() NostrFilterBuilder
Create a filter builder for fluent API.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publish(NostrEvent event, {List<String>? relays}) Future<NostrResult<NostrEventOkCommand>>
Publish an event through the enterprise client facade.
subscribe(NostrFilter filter, {List<String>? relays}) NostrResult<NostrEventsStream>
Convenience method to start an event subscription. Shortcut for a typed request subscription with one filter.
subscribeFilters(List<NostrFilter> filters, {List<String>? relays}) NostrResult<NostrEventsStream>
Convenience method to start multiple event subscriptions. Shortcut for starting a subscription with multiple filters.
subscribeRequest(NostrRequest request, {List<String>? relays}) NostrResult<NostrEventsStream>
Start a typed request subscription through the enterprise client facade.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

defaultRelays List<String>
Default relay URLs.
no setter
instance Nostr
This class is responsible for handling the connection to all relays.
no setter