RelayPoolApi class abstract
An abstract class representing the RelayPool API.
This API enables interaction with a pool of relays, and provides methods for connecting to relays, subscribing to filters, publishing events, and monitoring the status of the connected relays.
Constructors
-
RelayPoolApi({required List<
String> relaysList}) -
Creates a new RelayPool instance with the specified list of relay URLs.
factory
Properties
-
connectedRelays
→ Set<
String> -
Returns a set of URLs for relays that are currently connected.
no setter
-
failedRelays
→ Set<
String> -
Returns a set of URLs for relays that failed to connect.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void - Closes the connection to the relays in the pool.
-
connect(
) → Future< Stream< Message> > - Establishes a connection to the relays in the pool and returns a stream of messages received from the connected relays.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on(
dynamic callback(RelayEvent)) → void - Registers a callback function to be invoked when relay events occur.
-
publish(
Event event) → void - Publishes an event to the connected relays.
-
sub(
List< Filter> filters) → void - Subscribes to a set of filters to receive events that match the specified criteria from the connected relays.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited