Skip to content

Commit

Permalink
js(sdk): update Client::add_relay doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Mar 12, 2024
1 parent c6f0e23 commit 89253a9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bindings/nostr-sdk-js/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,19 @@ impl JsClient {

/// Add new relay
///
/// This method **NOT** automatically start connection with relay!
///
/// Return `false` if the relay already exists.
///
/// This method use perviously set or default `Options` to configure the `Relay` (ex. set proxy, set min POW, set relay limits, ...).
///
/// Connection is **NOT** automatically started with relay, remember to call `connect` method!
#[wasm_bindgen(js_name = addRelay)]
pub async fn add_relay(&self, url: String) -> Result<bool> {
self.inner.add_relay(url).await.map_err(into_err)
}

/// Add multiple relays
///
/// This method **NOT** automatically start connection with relays!
/// Connection is **NOT** automatically started with relays, remember to call `connect` method!
#[wasm_bindgen(js_name = addRelays)]
pub async fn add_relays(&self, urls: Vec<String>) -> Result<()> {
self.inner.add_relays(urls).await.map_err(into_err)
Expand Down

0 comments on commit 89253a9

Please sign in to comment.