@@ -58,11 +58,35 @@ abstract class Client implements RustOpaqueInterface {
58
58
/// Connect to all added relays
59
59
Future <void > connect ();
60
60
61
+ /// Disconnect and force remove all relays
62
+ Future <void > forceRemoveAllRelays ();
63
+
64
+ /// Force remove and disconnect relay
65
+ ///
66
+ /// Note: this method will remove the relay, also if it's in use for the gossip model or other service!
67
+ Future <void > forceRemoveRelay ({required String url});
68
+
61
69
/// Check if signer is configured
62
70
Future <bool > hasSigner ();
63
71
64
72
factory Client () => NostrSdk .instance.api.crateApiClientClientNew ();
65
73
74
+ /// Disconnect and remove all relays
75
+ ///
76
+ /// Some relays used by some services could not be disconnected with this method
77
+ /// (like the ones used for gossip).
78
+ /// Use [`Client::force_remove_all_relays`] to remove every relay.
79
+ Future <void > removeAllRelays ();
80
+
81
+ /// Remove and disconnect relay
82
+ ///
83
+ /// If the relay has [`RelayServiceFlags::GOSSIP`] , it will not be removed from the pool and its
84
+ /// flags will be updated (remove [`RelayServiceFlags::READ`] ,
85
+ /// [`RelayServiceFlags::WRITE`] and [`RelayServiceFlags::DISCOVERY`] flags).
86
+ ///
87
+ /// To force remove the relay, use [`Client::force_remove_relay`] .
88
+ Future <void > removeRelay ({required String url});
89
+
66
90
/// Reset client
67
91
///
68
92
/// This method reset the client to simplify the switch to another account.
0 commit comments