RelayManagerProtocol extension

What a RelayProtocolHandler needs from a RelayManager, besides REQs and EVENTs. It comes from package:dostr_core/protocol.dart.

on

Methods

accountForAuth(AuthPolicy? auth) → NostrSigner?

Available on RelayManager, provided by the RelayManagerProtocol extension

Account auth authenticates as, null when it must stay unattributable.
addProtocolHandler(RelayProtocolHandler handler) → void

Available on RelayManager, provided by the RelayManagerProtocol extension

Hands handler the messages, CLOSED and NOTICE this manager does not handle itself, and keeps the connections it still needs open.
removeProtocolHandler(RelayProtocolHandler handler) → void

Available on RelayManager, provided by the RelayManagerProtocol extension

Stops handing messages to handler.
send(RelayConnectionKey key, List message) → void

Available on RelayManager, provided by the RelayManagerProtocol extension

Sends message, a JSON array such as ["NEG-CLOSE", subscriptionId], on the connection behind key once its socket is ready. The message is dropped and logged when there is no such connection, or when its socket goes away first.