@@ -12,6 +12,7 @@ import 'protocol/event.dart';
12
12
import 'protocol/event/builder.dart' ;
13
13
import 'protocol/signer.dart' ;
14
14
import 'protocol/types/filter.dart' ;
15
+ import 'relay/options.dart' ;
15
16
16
17
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from`
17
18
@@ -136,6 +137,61 @@ abstract class Client implements RustOpaqueInterface {
136
137
/// Rise error if it not set.
137
138
Future <NostrSigner > signer ();
138
139
140
+ /// Subscribe to filters
141
+ ///
142
+ /// This method creates a new subscription. None of the previous subscriptions will be edited/closed when you call this!
143
+ /// So remember to unsubscribe when you no longer need it.
144
+ ///
145
+ /// If `gossip` is enabled (see [`Options::gossip`] ) the events will be requested also to
146
+ /// NIP65 relays (automatically discovered) of public keys included in filters (if any).
147
+ ///
148
+ /// # Auto-closing subscription
149
+ ///
150
+ /// It's possible to automatically close a subscription by configuring the [SubscribeAutoCloseOptions] .
151
+ ///
152
+ /// Note: auto-closing subscriptions aren't saved in subscriptions map!
153
+ Future <String > subscribe (
154
+ {required List <Filter > filters, SubscribeAutoCloseOptions ? opts});
155
+
156
+ /// Subscribe to filters to specific relays
157
+ ///
158
+ /// This method creates a new subscription. None of the previous subscriptions will be edited/closed when you call this!
159
+ /// So remember to unsubscribe when you no longer need it.
160
+ ///
161
+ /// ### Auto-closing subscription
162
+ ///
163
+ /// It's possible to automatically close a subscription by configuring the [SubscribeAutoCloseOptions] .
164
+ Future <String > subscribeTo (
165
+ {required List <String > urls,
166
+ required List <Filter > filters,
167
+ SubscribeAutoCloseOptions ? opts});
168
+
169
+ /// Subscribe to filters with custom [SubscriptionId]
170
+ ///
171
+ /// If `gossip` is enabled (see [`Options::gossip`] ) the events will be requested also to
172
+ /// NIP65 relays (automatically discovered) of public keys included in filters (if any).
173
+ ///
174
+ /// # Auto-closing subscription
175
+ ///
176
+ /// It's possible to automatically close a subscription by configuring the [SubscribeAutoCloseOptions] .
177
+ ///
178
+ /// Note: auto-closing subscriptions aren't saved in subscriptions map!
179
+ Future <void > subscribeWithId (
180
+ {required String id,
181
+ required List <Filter > filters,
182
+ SubscribeAutoCloseOptions ? opts});
183
+
184
+ /// Subscribe to filters with custom [SubscriptionId] to specific relays
185
+ ///
186
+ /// ### Auto-closing subscription
187
+ ///
188
+ /// It's possible to automatically close a subscription by configuring the [SubscribeAutoCloseOptions] .
189
+ Future <void > subscribeWithIdTo (
190
+ {required List <String > urls,
191
+ required String id,
192
+ required List <Filter > filters,
193
+ SubscribeAutoCloseOptions ? opts});
194
+
139
195
/// Unset nostr signer
140
196
Future <void > unsetSigner ();
141
197
}
0 commit comments