mirror of
https://github.com/aljazceru/pubky-core.git
synced 2025-12-31 12:54:35 +01:00
chore(js): publish 0.2.0
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user