chore(js): publish 0.2.0

This commit is contained in:
nazeh
2024-11-03 21:03:46 +03:00
parent 6f2a8cea50
commit b2eaf312cc
3 changed files with 6 additions and 5 deletions

View File

@@ -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",

View File

@@ -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

View File

@@ -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(),