From b2eaf312ccb2dbf2de3f5cdb3d34cf130ff2d8fc Mon Sep 17 00:00:00 2001 From: nazeh Date: Sun, 3 Nov 2024 21:03:46 +0300 Subject: [PATCH] chore(js): publish 0.2.0 --- pubky/pkg/package.json | 2 +- pubky/src/native.rs | 8 ++++---- pubky/src/wasm.rs | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pubky/pkg/package.json b/pubky/pkg/package.json index 1c08264..c0a06de 100644 --- a/pubky/pkg/package.json +++ b/pubky/pkg/package.json @@ -2,7 +2,7 @@ "name": "@synonymdev/pubky", "type": "module", "description": "Pubky client", - "version": "0.1.16", + "version": "0.2.0", "license": "MIT", "repository": { "type": "git", diff --git a/pubky/src/native.rs b/pubky/src/native.rs index 83406f6..fb163f3 100644 --- a/pubky/src/native.rs +++ b/pubky/src/native.rs @@ -13,11 +13,11 @@ use internals::PkarrResolver; static DEFAULT_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"),); #[derive(Debug, Default)] -pub struct PubkyClientBuilder { +pub struct Settings { pkarr_settings: pkarr::Settings, } -impl PubkyClientBuilder { +impl Settings { /// Set Pkarr client [pkarr::Settings]. pub fn pkarr_settings(mut self, settings: pkarr::Settings) -> Self { self.pkarr_settings = settings; @@ -77,8 +77,8 @@ impl Default for PubkyClient { impl PubkyClient { /// Returns a builder to edit settings before creating [PubkyClient]. - pub fn builder() -> PubkyClientBuilder { - PubkyClientBuilder::default() + pub fn builder() -> Settings { + Settings::default() } /// Create a client connected to the local network diff --git a/pubky/src/wasm.rs b/pubky/src/wasm.rs index e983700..c574ce3 100644 --- a/pubky/src/wasm.rs +++ b/pubky/src/wasm.rs @@ -17,6 +17,7 @@ static TESTNET_RELAYS: [&str; 1] = ["http://localhost:15411/pkarr"]; #[wasm_bindgen] impl PubkyClient { #[wasm_bindgen(constructor)] + /// Create PubkyClient with default Settings including default relays pub fn new() -> Self { Self { http: reqwest::Client::builder().build().unwrap(),