Skip to content

Commit bf973c0

Browse files
committed
nostr-sdk: add id and filters method to ActiveSubscription
1 parent baef37e commit bf973c0

File tree

1 file changed

+12
-2
lines changed
  • crates/nostr-sdk/src/relay

1 file changed

+12
-2
lines changed

crates/nostr-sdk/src/relay/mod.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ impl RelayConnectionStats {
201201
#[derive(Debug, Clone)]
202202
pub struct ActiveSubscription {
203203
/// SubscriptionId to update or cancel subscription
204-
pub id: SubscriptionId,
204+
id: SubscriptionId,
205205
/// Subscriptions filters
206-
pub filters: Vec<Filter>,
206+
filters: Vec<Filter>,
207207
}
208208

209209
impl Default for ActiveSubscription {
@@ -220,6 +220,16 @@ impl ActiveSubscription {
220220
filters: Vec::new(),
221221
}
222222
}
223+
224+
/// Get [`SubscriptionId`]
225+
pub fn id(&self) -> SubscriptionId {
226+
self.id.clone()
227+
}
228+
229+
/// Get subscription filters
230+
pub fn filters(&self) -> Vec<Filter> {
231+
self.filters.clone()
232+
}
223233
}
224234

225235
/// Relay

0 commit comments

Comments
 (0)