RelayJit class
url is a unique identifier for the relay therefore it gets cleaned (e.g. remove / at the end wss://myrelay.com/ => wss://myrelay.com) throws an exception if the url is invalid
Constructors
- RelayJit({required String url, required dynamic onMessage(Nip01Event, RequestState)})
Properties
-
activeSubscriptions
↔ Map<
String, RelayActiveSubscription> -
all active subscriptions on this relay, id is the subscription id
getter/setter pair
-
assignedPubkeys
↔ List<
RelayJitAssignedPubkey> -
used to lookup if this relay is suitable for a given request
getter/setter pair
- connecting ↔ bool
-
is it connecting
getter/setter pairinherited
- connectionSource ↔ ConnectionSource
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- info ↔ RelayInfo?
-
relay info
getter/setter pairinherited
- lastConnectTry ↔ int?
-
last connection try timestamp
getter/setter pairinherited
- lastSuccessfulConnect ↔ int?
-
last successful connection
getter/setter pairinherited
- onMessage ↔ dynamic Function(Nip01Event, RequestState)
-
getter/setter pair
- relayUsefulness → double
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stats ↔ RelayStats
-
relay stats
getter/setter pairinherited
- touched ↔ int
-
gets incremented on every touch => search if it has a pubkey assigned
getter/setter pair
- touchUseful ↔ int
-
gets incremented when there is a pubkey match
getter/setter pair
- url ↔ String
-
relay url
getter/setter pairinherited
Methods
-
addPubkeysToAssignedPubkeys(
List< String> pubkeys, ReadWriteMarker direction) → void -
closeSubscription(
String id) → Future< void> -
connect(
{required ConnectionSource connectionSource}) → Future< bool> - returns true if the connection was successful
-
disconnect(
) → Future -
failedToConnect(
) → void -
mark as failed to connect
inherited
-
hasActiveSubscription(
String id) → bool -
incStatsByNewEvent(
Nip01Event event, int bytes) → void -
increment stats by new event
inherited
-
isReady(
) → Future< bool> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
ClientMsg msg) → Future< void> -
succeededToConnect(
) → void -
mark as succeded to connect
inherited
-
supportsNip(
int nip) → bool -
does this relay support given nip
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
tryingToConnect(
) → void -
set trying to connect
inherited
-
wasLastConnectTryLongerThanSeconds(
int seconds) → bool -
was last connection try longer than given seconds
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited