Broadcast class

Public-facing broadcast facade.
Delegates immediate sending to BroadcastSender and coordinates pending delivery enrollment for specific-relay broadcasts.
The retry path in PendingBroadcastDelivery calls BroadcastSender directly, so it never re-enters this facade's enrollment logic.

Constructors

Broadcast({required BroadcastSender broadcastSender, required Accounts accounts, required CacheManager cacheManager, required PendingBroadcastDelivery pendingDelivery})
creates a new Broadcast facade instance

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

broadcast({required Nip01Event nostrEvent, Iterable<String>? specificRelays, EventSigner? customSigner, double? considerDonePercent, Duration? timeout, bool? saveToCache}) NdkBroadcastResponse
low level nostr broadcast using inbox/outbox (gossip)
specificRelays disables inbox/outbox (gossip) and broadcasts to the relays specified. Useful for NostrWalletConnect
customSigner if you want to use a different signer than the one from currently logged in user in Accounts
considerDonePercent the percentage (0.0, 1.0) of relays that need to respond with "OK" for the broadcast to be considered done (overrides the default value)
timeout the timeout for the broadcast (overrides the default timeout)
saveToCache whether to save the event to cache (overrides the default value from config)
returns a NdkBroadcastResponse object containing the result => success per relay
broadcastDeletion({Nip01Event? event, List<Nip01Event>? events, Nip01Event? eventAndAllVersions, List<Nip01Event>? eventsAndAllVersions, String? eventId, List<String>? eventIds, Iterable<String>? customRelays, EventSigner? customSigner, String reason = "delete"}) NdkBroadcastResponse
Request a deletion of an event (NIP-09 compliant).
broadcastReaction({required String eventId, Iterable<String>? customRelays, String reaction = "+"}) NdkBroadcastResponse
loadDeliveries({bool pendingOnly = true, EventDeliveryStatus? status, int? limit}) Future<List<EventDeliverySnapshot>>
Lists persisted delivery items.
loadEventDelivery(String eventId) Future<EventDeliverySnapshot?>
Returns the joined persisted local-first delivery state for one event id.
loadPendingDeliveries({int? limit}) Future<List<EventDeliverySnapshot>>
Convenience alias for app UIs that want items still pending broadcast.
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