diff --git a/bindings/nostr-sdk-js/examples/webapp/package.json b/bindings/nostr-sdk-js/examples/webapp/package.json index 4767d8d37..97c188b3c 100644 --- a/bindings/nostr-sdk-js/examples/webapp/package.json +++ b/bindings/nostr-sdk-js/examples/webapp/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { - "@rust-nostr/nostr-sdk": "^0.10.0", + "@rust-nostr/nostr-sdk": "^0.11.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", diff --git a/book/snippets/nostr-sdk/rust/Cargo.toml b/book/snippets/nostr-sdk/rust/Cargo.toml index f9f3bbba8..15e813b7a 100644 --- a/book/snippets/nostr-sdk/rust/Cargo.toml +++ b/book/snippets/nostr-sdk/rust/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" members = ["."] [dependencies] -nostr-sdk = "0.27" +nostr-sdk = "0.28" tokio = { version = "1", features = ["rt-multi-thread", "macros"] } \ No newline at end of file diff --git a/book/snippets/nostr-sdk/rust/src/quickstart.rs b/book/snippets/nostr-sdk/rust/src/quickstart.rs index 04b257a4a..718e4af8b 100644 --- a/book/snippets/nostr-sdk/rust/src/quickstart.rs +++ b/book/snippets/nostr-sdk/rust/src/quickstart.rs @@ -13,7 +13,7 @@ pub async fn quickstart() -> Result<()> { client .add_relay_with_opts( "wss://relay.nostr.info", - RelayOptions::new().proxy(proxy).write(false), + RelayOptions::new().proxy(proxy).flags(RelayServiceFlags::default().remove(RelayServiceFlags::WRITE)), ) .await?; client diff --git a/book/snippets/nostr/js/package.json b/book/snippets/nostr/js/package.json index 8f77d546f..496b7387c 100644 --- a/book/snippets/nostr/js/package.json +++ b/book/snippets/nostr/js/package.json @@ -5,6 +5,6 @@ "main": "index.js", "license": "MIT", "dependencies": { - "@rust-nostr/nostr": "0.10.0" + "@rust-nostr/nostr": "0.11.0" } } \ No newline at end of file diff --git a/book/snippets/nostr/js/src/keys.js b/book/snippets/nostr/js/src/keys.js index 886b562f5..4d48e22c7 100644 --- a/book/snippets/nostr/js/src/keys.js +++ b/book/snippets/nostr/js/src/keys.js @@ -16,8 +16,8 @@ function keys() { let keys2 = new Keys(secretKey); console.log("Secret key (hex): ", keys2.secretKey.toHex()); - // Try to init Keys from hex or bech32 secret key - let keys3 = Keys.fromSkStr("nsec1ufnus6pju578ste3v90xd5m2decpuzpql2295m3sknqcjzyys9ls0qlc85"); + // Try to parse Keys from secret key hex or bech32 + let keys3 = Keys.parse("nsec1ufnus6pju578ste3v90xd5m2decpuzpql2295m3sknqcjzyys9ls0qlc85"); let publicKey = PublicKey.fromHex("7b911fd37cdf5c81d4c0adb1ab7fa822ed253ab0ad9aa18d77257c88b29b718e"); let keys4 = Keys.fromPublicKey(publicKey); diff --git a/book/snippets/nostr/python/requirements.txt b/book/snippets/nostr/python/requirements.txt index 192030b4b..906ae04a5 100644 --- a/book/snippets/nostr/python/requirements.txt +++ b/book/snippets/nostr/python/requirements.txt @@ -1 +1 @@ -nostr-protocol==0.8.0 \ No newline at end of file +nostr-protocol==0.9.0 \ No newline at end of file diff --git a/book/snippets/nostr/python/src/keys.py b/book/snippets/nostr/python/src/keys.py index 4c0427604..eeb13085c 100644 --- a/book/snippets/nostr/python/src/keys.py +++ b/book/snippets/nostr/python/src/keys.py @@ -12,3 +12,6 @@ def keys(): print(" Secret keys:") print(f" hex: {secret_key.to_hex()}") print(f" bech32: {secret_key.to_bech32()}") + + # Parse keys from hex or bech32 + keys = Keys.parse("nsec1j4c6269y9w0q2er2xjw8sv2ehyrtfxq3jwgdlxj6qfn8z4gjsq5qfvfk99") diff --git a/book/snippets/nostr/rust/Cargo.toml b/book/snippets/nostr/rust/Cargo.toml index b2a5f24fb..be0574ad6 100644 --- a/book/snippets/nostr/rust/Cargo.toml +++ b/book/snippets/nostr/rust/Cargo.toml @@ -8,4 +8,4 @@ edition = "2021" members = ["."] [dependencies] -nostr = "0.27" +nostr = "0.28" diff --git a/book/snippets/nostr/rust/src/keys.rs b/book/snippets/nostr/rust/src/keys.rs index e53f4b9af..b80eaacba 100644 --- a/book/snippets/nostr/rust/src/keys.rs +++ b/book/snippets/nostr/rust/src/keys.rs @@ -8,8 +8,11 @@ pub fn keys() -> Result<()> { println!("Public key (hex): {}", public_key); println!("Public key (bech32): {}", public_key.to_bech32()?); - println!("Secret key (hex): {}", keys.secret_key()?.display_secret()); + println!("Secret key (hex): {}", keys.secret_key()?.to_secret_hex()); println!("Secret key (bech32): {}", secret_key.to_bech32()?); + // Parse keys from hex or bech32 + let keys = Keys::parse("nsec1j4c6269y9w0q2er2xjw8sv2ehyrtfxq3jwgdlxj6qfn8z4gjsq5qfvfk99")?; + Ok(()) } diff --git a/book/src/nostr-sdk/02-installation.md b/book/src/nostr-sdk/02-installation.md index 77cf29433..9e770792d 100644 --- a/book/src/nostr-sdk/02-installation.md +++ b/book/src/nostr-sdk/02-installation.md @@ -9,14 +9,14 @@ Add the `nostr-sdk` dependency in your `Cargo.toml` file: ```toml [dependencies] -nostr-sdk = "0.27" +nostr-sdk = "0.28" ``` Alternatively, you can add it directly from `git` source: ```toml [dependencies] -nostr-sdk = { git = "https://github.com/rust-nostr/nostr", tag = "v0.27.0" } +nostr-sdk = { git = "https://github.com/rust-nostr/nostr", tag = "v0.28.0" } ``` ```admonish info @@ -43,7 +43,7 @@ pip install nostr-sdk Alternatively, you can manually add the dependency in your `requrements.txt`, `setup.py`, etc.: ``` -nostr-sdk==0.8.0 +nostr-sdk==0.9.0 ``` Import the library in your code: @@ -88,7 +88,7 @@ Alternatively, you can manually add the dependency in your `package.json` file: ```json { "dependencies": { - "@rust-nostr/nostr-sdk": "0.10.0" + "@rust-nostr/nostr-sdk": "0.11.0" } } ``` @@ -140,7 +140,7 @@ repositories { } dependencies { - implementation("io.github.rust-nostr:nostr-sdk:0.8.0") + implementation("io.github.rust-nostr:nostr-sdk:0.9.0") } ``` @@ -190,7 +190,7 @@ as a package dependency in Xcode. Add the following to the dependencies array in your `Package.swift`: ``` swift -.package(url: "https://github.com/rust-nostr/nostr-sdk-swift.git", from: "0.8.0"), +.package(url: "https://github.com/rust-nostr/nostr-sdk-swift.git", from: "0.9.0"), ``` diff --git a/book/src/nostr/02-installation.md b/book/src/nostr/02-installation.md index b0a017235..490a42eff 100644 --- a/book/src/nostr/02-installation.md +++ b/book/src/nostr/02-installation.md @@ -9,14 +9,14 @@ Add the `nostr` dependency in your `Cargo.toml` file: ```toml,ignore [dependencies] -nostr = "0.27" +nostr = "0.28" ``` Alternatively, you can add it directly from `git` source: ```toml,ignore [dependencies] -nostr = { git = "https://github.com/rust-nostr/nostr", tag = "v0.27.0" } +nostr = { git = "https://github.com/rust-nostr/nostr", tag = "v0.28.0" } ``` ```admonish info @@ -43,7 +43,7 @@ pip install nostr-protocol Alternatively, you can manually add the dependency in your `requrements.txt`, `setup.py`, etc.: ``` -nostr-protocol==0.8.0 +nostr-protocol==0.9.0 ``` Import the library in your code: @@ -87,7 +87,7 @@ Alternatively, you can manually add the dependency in your `package.json` file: ```json { "dependencies": { - "@rust-nostr/nostr": "0.10.0" + "@rust-nostr/nostr": "0.11.0" } } ``` @@ -139,7 +139,7 @@ repositories { } dependencies { - implementation("io.github.rust-nostr:nostr:0.8.0") + implementation("io.github.rust-nostr:nostr:0.9.0") } ``` @@ -188,7 +188,7 @@ as a package dependency in Xcode. Add the following to the dependencies array in your `Package.swift`: ``` swift -.package(url: "https://github.com/rust-nostr/nostr-swift.git", from: "0.8.0"), +.package(url: "https://github.com/rust-nostr/nostr-swift.git", from: "0.9.0"), ``` Import the library in your code: diff --git a/contrib/release.md b/contrib/release.md index 1eab7ed82..76f5368e0 100644 --- a/contrib/release.md +++ b/contrib/release.md @@ -21,7 +21,7 @@ * Publish `JS` bindings * Publish `Swift` bindings -* Bump versions in `book` +* Bump versions in `book` (**without commit**, commit in next step) * Update examples * Rust book tests: `make check-book`