Skip to content

Commit

Permalink
js(nostr-sdk): add JsClient::reconcile
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Jan 17, 2024
1 parent e954830 commit 7bc21ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bindings/nostr-sdk-js/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,16 @@ impl JsClient {
.map(|id| id.into())
}

/// Negentropy reconciliation
///
/// <https://github.com/hoytech/negentropy>
pub fn reconcile(&self, filter: Arc<Filter>) -> Result<()> {
Ok(self.inner.reconcile(
filter.as_ref().deref().clone(),
NegentropyOptions::default(),
)?)
}

/// Handle notifications
///
/// **This method spawn a thread**, so ensure to keep up the app after calling this (if needed).
Expand Down
2 changes: 2 additions & 0 deletions crates/nostr-sdk/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,8 @@ impl Client {
}

/// Negentropy reconciliation
///
/// <https://github.com/hoytech/negentropy>
pub async fn reconcile(&self, filter: Filter, opts: NegentropyOptions) -> Result<(), Error> {
Ok(self.pool.reconcile(filter, opts).await?)
}
Expand Down

0 comments on commit 7bc21ee

Please sign in to comment.