From 6ccc81ad3b8d9de10d14f2699db09a4c72660e6c Mon Sep 17 00:00:00 2001 From: Yuki Kishimoto Date: Tue, 31 Dec 2024 11:56:05 +0100 Subject: [PATCH] Release v0.38.0 Signed-off-by: Yuki Kishimoto --- CHANGELOG.md | 8 +++++--- book/snippets/flutter/pubspec.lock | 6 +++--- book/snippets/flutter/pubspec.yaml | 2 +- book/snippets/js/package.json | 2 +- book/snippets/js/src/hello.ts | 8 ++++---- book/snippets/js/src/nip44.ts | 2 +- book/snippets/kotlin/gradle/libs.versions.toml | 2 +- .../main/kotlin/rust/nostr/snippets/Hello.kt | 8 ++++---- .../src/main/kotlin/rust/nostr/snippets/Keys.kt | 6 +----- book/snippets/python/requirements.txt | 2 +- .../python/src/event/{eventid.py => id.py} | 3 --- book/snippets/python/src/event/kind.py | 17 ++--------------- book/snippets/python/src/hello.py | 8 ++++---- book/snippets/python/src/keys.py | 5 +---- book/snippets/python/src/nip21.py | 6 +++--- book/snippets/python/src/nip44.py | 2 +- book/snippets/rust/Cargo.toml | 5 +++-- book/snippets/rust/src/nip47.rs | 2 +- book/snippets/swift/NostrSnippets/Package.swift | 2 +- .../swift/NostrSnippets/Sources/Hello.swift | 8 ++++---- .../swift/NostrSnippets/Sources/Nip44.swift | 2 +- book/src/sdk/event/id.md | 12 ++++++------ book/src/sdk/event/kind.md | 10 +--------- book/src/sdk/install.md | 14 +++++++------- 24 files changed, 57 insertions(+), 85 deletions(-) rename book/snippets/python/src/event/{eventid.py => id.py} (89%) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb1570025..c819a70c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,8 @@ ### Summary -* Full NIP42 support (SDK) +Full NIP42 support for SDK and relay builder, negentropy support and read/write policy plugins for relay builder, +NIP35 support, better logs and docs, performance improvements, bugs fix and more! ### Breaking changes @@ -48,7 +49,7 @@ ### Changed -* Bump `async-utility` to 0.3, `async-wsocket` to 0.11 and `atomic-destructor` to 0.3 ([Yuki Kishimoto]) +* Bump `async-utility` to 0.3, `async-wsocket` to 0.12 and `atomic-destructor` to 0.3 ([Yuki Kishimoto]) * nostr: remove self-tagging when building events ([Yuki Kishimoto]) * nostr: don't set root tags when the root is null ([Yuki Kishimoto]) * nostr: update `RelayMessage::NegErr` variant ([Yuki Kishimoto]) @@ -940,7 +941,8 @@ added `nostrdb` storage backend, added NIP32 and completed NIP51 support and mor [Roland Bewick]: https://github.com/rolznz (nostr:npub1zk6u7mxlflguqteghn8q7xtu47hyerruv6379c36l8lxzzr4x90q0gl6ef) -[Unreleased]: https://github.com/rust-nostr/nostr/compare/v0.37.0...HEAD +[Unreleased]: https://github.com/rust-nostr/nostr/compare/v0.38.0...HEAD +[v0.38.0]: https://github.com/rust-nostr/nostr/compare/v0.37.0...v0.38.0 [v0.37.0]: https://github.com/rust-nostr/nostr/compare/v0.36.0...v0.37.0 [v0.36.0]: https://github.com/rust-nostr/nostr/compare/v0.35.0...v0.36.0 [v0.35.0]: https://github.com/rust-nostr/nostr/compare/v0.34.0...v0.35.0 diff --git a/book/snippets/flutter/pubspec.lock b/book/snippets/flutter/pubspec.lock index d8d88d957..c178f59f6 100644 --- a/book/snippets/flutter/pubspec.lock +++ b/book/snippets/flutter/pubspec.lock @@ -247,11 +247,11 @@ packages: dependency: "direct main" description: path: "." - ref: b6fe16d3aee91c4cda670c4236ad4b28f12433df - resolved-ref: b6fe16d3aee91c4cda670c4236ad4b28f12433df + ref: "v0.38.0" + resolved-ref: "65e9cd225bb16e15633350e573bcc438410fbcb3" url: "https://github.com/rust-nostr/nostr-sdk-flutter.git" source: git - version: "0.37.0" + version: "0.38.0" package_config: dependency: transitive description: diff --git a/book/snippets/flutter/pubspec.yaml b/book/snippets/flutter/pubspec.yaml index b1868c5fa..171959a85 100644 --- a/book/snippets/flutter/pubspec.yaml +++ b/book/snippets/flutter/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: nostr_sdk: git: url: https://github.com/rust-nostr/nostr-sdk-flutter.git - ref: b6fe16d3aee91c4cda670c4236ad4b28f12433df + ref: v0.38.0 dev_dependencies: lints: ^3.0.0 diff --git a/book/snippets/js/package.json b/book/snippets/js/package.json index ba02847ab..6bd3bf003 100644 --- a/book/snippets/js/package.json +++ b/book/snippets/js/package.json @@ -5,7 +5,7 @@ "type": "module", "license": "MIT", "dependencies": { - "@rust-nostr/nostr-sdk": "0.37.0", + "@rust-nostr/nostr-sdk": "0.38.0", "bip39": "^3.1.0" }, "devDependencies": { diff --git a/book/snippets/js/src/hello.ts b/book/snippets/js/src/hello.ts index 36f785d15..081b8bb3b 100644 --- a/book/snippets/js/src/hello.ts +++ b/book/snippets/js/src/hello.ts @@ -15,13 +15,13 @@ export async function hello() { // ANCHOR: publish let builder = EventBuilder.textNote("Hello, rust-nostr!"); - let res = await client.sendEventBuilder(builder); + let output = await client.sendEventBuilder(builder); // ANCHOR_END: publish // ANCHOR: output - console.log("Event ID:", res.id.toBech32()); - console.log("Sent to:", res.output.success); - console.log("Not sent to:", res.output.failed); + console.log("Event ID:", output.id.toBech32()); + console.log("Sent to:", output.success); + console.log("Not sent to:", output.failed); // ANCHOR_END: output } // ANCHOR_END: full diff --git a/book/snippets/js/src/nip44.ts b/book/snippets/js/src/nip44.ts index 988cd6f09..f7b2869a2 100644 --- a/book/snippets/js/src/nip44.ts +++ b/book/snippets/js/src/nip44.ts @@ -3,7 +3,7 @@ import {Keys, PublicKey, nip44Encrypt, nip44Decrypt, NIP44Version} from "@rust-n export function run() { let keys = Keys.generate(); - let public_key = PublicKey.fromHex("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"); + let public_key = PublicKey.parse("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"); let ciphertext = nip44Encrypt(keys.secretKey, public_key, "my message", NIP44Version.V2) console.log("Encrypted: " + ciphertext) diff --git a/book/snippets/kotlin/gradle/libs.versions.toml b/book/snippets/kotlin/gradle/libs.versions.toml index 4c912d0f6..67d30f168 100644 --- a/book/snippets/kotlin/gradle/libs.versions.toml +++ b/book/snippets/kotlin/gradle/libs.versions.toml @@ -3,7 +3,7 @@ agp = "8.1.4" kotlin = "1.9.22" [libraries] -nostr = { module = "org.rust-nostr:nostr-sdk", version = "0.37.0" } +nostr = { module = "org.rust-nostr:nostr-sdk", version = "0.38.0" } [plugins] androidLibrary = { id = "com.android.library", version.ref = "agp" } diff --git a/book/snippets/kotlin/shared/src/main/kotlin/rust/nostr/snippets/Hello.kt b/book/snippets/kotlin/shared/src/main/kotlin/rust/nostr/snippets/Hello.kt index c87fb2c5f..1cc5fad83 100644 --- a/book/snippets/kotlin/shared/src/main/kotlin/rust/nostr/snippets/Hello.kt +++ b/book/snippets/kotlin/shared/src/main/kotlin/rust/nostr/snippets/Hello.kt @@ -17,13 +17,13 @@ suspend fun hello() { // ANCHOR: publish val builder = EventBuilder.textNote("Hello, rust-nostr!") - val res = client.sendEventBuilder(builder) + val output = client.sendEventBuilder(builder) // ANCHOR_END: publish // ANCHOR: output - println("Event ID: ${res.id.toBech32()}") - println("Sent to: ${res.output.success}") - println("Not sent to: ${res.output.failed}") + println("Event ID: ${output.id.toBech32()}") + println("Sent to: ${output.success}") + println("Not sent to: ${output.failed}") // ANCHOR_END: output } // ANCHOR_END: full diff --git a/book/snippets/kotlin/shared/src/main/kotlin/rust/nostr/snippets/Keys.kt b/book/snippets/kotlin/shared/src/main/kotlin/rust/nostr/snippets/Keys.kt index 8ce7ab110..c7bf1580e 100644 --- a/book/snippets/kotlin/shared/src/main/kotlin/rust/nostr/snippets/Keys.kt +++ b/book/snippets/kotlin/shared/src/main/kotlin/rust/nostr/snippets/Keys.kt @@ -23,11 +23,7 @@ fun restore() { var keys = Keys.parse("nsec1j4c6269y9w0q2er2xjw8sv2ehyrtfxq3jwgdlxj6qfn8z4gjsq5qfvfk99") // Parse from hex - var secretKey = SecretKey.fromHex("6b911fd37cdf5c81d4c0adb1ab7fa822ed253ab0ad9aa18d77257c88b29b718e") - keys = Keys(secretKey = secretKey) - - // Parse from bech32 - secretKey = SecretKey.fromBech32("nsec1j4c6269y9w0q2er2xjw8sv2ehyrtfxq3jwgdlxj6qfn8z4gjsq5qfvfk99") + var secretKey = SecretKey.parse("6b911fd37cdf5c81d4c0adb1ab7fa822ed253ab0ad9aa18d77257c88b29b718e") keys = Keys(secretKey = secretKey) } // ANCHOR_END: restore diff --git a/book/snippets/python/requirements.txt b/book/snippets/python/requirements.txt index bf09d1410..0361c0df1 100644 --- a/book/snippets/python/requirements.txt +++ b/book/snippets/python/requirements.txt @@ -1,3 +1,3 @@ mnemonic==0.21 -nostr-sdk==0.37.0 +nostr-sdk==0.38.0 pyright==1.1.389 diff --git a/book/snippets/python/src/event/eventid.py b/book/snippets/python/src/event/id.py similarity index 89% rename from book/snippets/python/src/event/eventid.py rename to book/snippets/python/src/event/id.py index f4b64e8ec..d28593f40 100644 --- a/book/snippets/python/src/event/eventid.py +++ b/book/snippets/python/src/event/id.py @@ -20,7 +20,6 @@ def event_id(): event_id_hex = event_id.to_hex() print(f" - Hex: {event_id_hex}") print(f" - Parse: {EventId.parse(event_id_hex)}") - print(f" - From Hex: {EventId.from_hex(event_id_hex)}") # ANCHOR_END: format-parse-hex print() @@ -30,7 +29,6 @@ def event_id(): event_id_bech32 = event_id.to_bech32() print(f" - Bech32: {event_id_bech32}") print(f" - Parse: {EventId.parse(event_id_bech32)}") - print(f" - From Bech32: {EventId.from_bech32(event_id_bech32)}") # ANCHOR_END: format-parse-bech32 print() @@ -40,7 +38,6 @@ def event_id(): event_id_nostr_uri = event_id.to_nostr_uri() print(f" - Nostr URI: {event_id_nostr_uri}") print(f" - Parse: {EventId.parse(event_id_nostr_uri)}") - print(f" - From Nostr URI: {EventId.from_nostr_uri(event_id_nostr_uri)}") # ANCHOR_END: format-parse-nostr-uri print() diff --git a/book/snippets/python/src/event/kind.py b/book/snippets/python/src/event/kind.py index 17d52a2f0..9eb5d512b 100644 --- a/book/snippets/python/src/event/kind.py +++ b/book/snippets/python/src/event/kind.py @@ -41,19 +41,6 @@ def kind(): print() # ANCHOR: kind-representations - print(" Kinds Representing types of Events:") - kind = Kind.from_enum(cast(KindEnum, KindEnum.CUSTOM(1337))) - print(f" - Custom Event Kind: {kind.as_u16()} - {kind.as_enum()}") - kind = Kind.from_enum(cast(KindEnum, KindEnum.REPLACEABLE(10420))) - print(f" - Replacable Event Kind: {kind.as_u16()} - {kind.as_enum()}") - kind = Kind.from_enum(cast(KindEnum, KindEnum.PARAMETERIZED_REPLACEABLE(30420))) - print(f" - Parameterised Replaceable Event Kind: {kind.as_u16()} - {kind.as_enum()}") - kind = Kind.from_enum(cast(KindEnum, KindEnum.EPHEMERAL(21420))) - print(f" - Ephemeral Event Kind: {kind.as_u16()} - {kind.as_enum()}") - kind = Kind.from_enum(cast(KindEnum, KindEnum.REGULAR(420))) - print(f" - Regular Event Kind: {kind.as_u16()} - {kind.as_enum()}") - kind = Kind.from_enum(cast(KindEnum, KindEnum.JOB_REQUEST(123))) - print(f" - Job Request Event Kind: {kind.as_u16()} - {kind.as_enum()}") - kind = Kind.from_enum(cast(KindEnum, KindEnum.JOB_RESULT(321))) - print(f" - Job Result Event Kind: {kind.as_u16()} - {kind.as_enum()}") + kind = Kind(1337) + print(f"Custom Event Kind: {kind.as_u16()} - {kind.as_enum()}") # ANCHOR_END: kind-representations diff --git a/book/snippets/python/src/hello.py b/book/snippets/python/src/hello.py index feee17e8b..261a1ea87 100644 --- a/book/snippets/python/src/hello.py +++ b/book/snippets/python/src/hello.py @@ -15,13 +15,13 @@ async def hello(): # ANCHOR: publish builder = EventBuilder.text_note("Hello, rust-nostr!") - res = await client.send_event_builder(builder) + output = await client.send_event_builder(builder) # ANCHOR_END: publish # ANCHOR: output - print(f"Event ID: {res.id.to_bech32()}") - print(f"Sent to: {res.output.success}") - print(f"Not send to: {res.output.failed}") + print(f"Event ID: {output.id.to_bech32()}") + print(f"Sent to: {output.success}") + print(f"Not send to: {output.failed}") # ANCHOR_END: output # ANCHOR_END: full diff --git a/book/snippets/python/src/keys.py b/book/snippets/python/src/keys.py index e5ca36344..f6550b60e 100644 --- a/book/snippets/python/src/keys.py +++ b/book/snippets/python/src/keys.py @@ -19,10 +19,7 @@ def generate(): def restore(): keys = Keys.parse("nsec1j4c6269y9w0q2er2xjw8sv2ehyrtfxq3jwgdlxj6qfn8z4gjsq5qfvfk99") - secret_key = SecretKey.from_hex("6b911fd37cdf5c81d4c0adb1ab7fa822ed253ab0ad9aa18d77257c88b29b718e") - keys = Keys(secret_key) - - secret_key = SecretKey.from_bech32("nsec1j4c6269y9w0q2er2xjw8sv2ehyrtfxq3jwgdlxj6qfn8z4gjsq5qfvfk99") + secret_key = SecretKey.parse("6b911fd37cdf5c81d4c0adb1ab7fa822ed253ab0ad9aa18d77257c88b29b718e") keys = Keys(secret_key) # ANCHOR_END: restore diff --git a/book/snippets/python/src/nip21.py b/book/snippets/python/src/nip21.py index 22307e65a..11158cd9e 100644 --- a/book/snippets/python/src/nip21.py +++ b/book/snippets/python/src/nip21.py @@ -14,7 +14,7 @@ def nip21(): # bech32 npub pk_parse = Nip21.parse(pk_uri) if pk_parse.as_enum().is_pubkey(): - pk_bech32 = PublicKey.from_nostr_uri(pk_uri).to_bech32() + pk_bech32 = PublicKey.parse(pk_uri).to_bech32() print(f" Public key (bech32): {pk_bech32}") # ANCHOR_END: npub @@ -30,7 +30,7 @@ def nip21(): # bech32 note note_pasre = Nip21.parse(note_uri) if note_pasre.as_enum().is_note(): - event_bech32 = EventId.from_nostr_uri(note_uri).to_bech32() + event_bech32 = EventId.parse(note_uri).to_bech32() print(f" Event (bech32): {event_bech32}") # ANCHOR_END: note @@ -80,6 +80,6 @@ def nip21(): # bech32 naddr coord_parse = Nip21.parse(coord_uri) if coord_parse.as_enum().is_coord(): - coord_bech32 = Coordinate.from_nostr_uri(coord_uri).to_bech32() + coord_bech32 = Coordinate.parse(coord_uri).to_bech32() print(f" Coordinate (bech32): {coord_bech32}") # ANCHOR_END: naddr diff --git a/book/snippets/python/src/nip44.py b/book/snippets/python/src/nip44.py index b1e57b6b2..a74d177ee 100644 --- a/book/snippets/python/src/nip44.py +++ b/book/snippets/python/src/nip44.py @@ -4,7 +4,7 @@ def nip44(): print("\nEncrypting and Decrypting Messages (NIP-44):") keys = Keys.generate() - pk = PublicKey.from_hex("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798") + pk = PublicKey.parse("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798") ciphertext = nip44_encrypt(keys.secret_key(), pk, "my message", Nip44Version.V2) print(f" Encrypted: {ciphertext}") diff --git a/book/snippets/rust/Cargo.toml b/book/snippets/rust/Cargo.toml index 90b6cd755..1b7f8fa5f 100644 --- a/book/snippets/rust/Cargo.toml +++ b/book/snippets/rust/Cargo.toml @@ -8,6 +8,7 @@ edition = "2021" members = ["."] [dependencies] -nostr-sdk = { version = "0.37", features = ["all-nips"] } -nostr-relay-builder = "0.37" +nostr-sdk = { version = "0.38", features = ["all-nips"] } +nostr-relay-builder = "0.38" +nwc = "0.38" tokio = { version = "1", features = ["rt-multi-thread", "macros"] } diff --git a/book/snippets/rust/src/nip47.rs b/book/snippets/rust/src/nip47.rs index f07766300..a66b6e49b 100644 --- a/book/snippets/rust/src/nip47.rs +++ b/book/snippets/rust/src/nip47.rs @@ -1,5 +1,5 @@ // ANCHOR: full -use nostr_sdk::prelude::*; +use nwc::prelude::*; pub async fn run() -> Result<()> { // Parse NWC uri diff --git a/book/snippets/swift/NostrSnippets/Package.swift b/book/snippets/swift/NostrSnippets/Package.swift index e3c07018e..0fb3ad6a8 100644 --- a/book/snippets/swift/NostrSnippets/Package.swift +++ b/book/snippets/swift/NostrSnippets/Package.swift @@ -7,7 +7,7 @@ let package = Package( name: "NostrSnippets", platforms: [.macOS(.v12)], dependencies: [ - .package(url: "https://github.com/rust-nostr/nostr-sdk-swift", from: "0.37.0") + .package(url: "https://github.com/rust-nostr/nostr-sdk-swift", from: "0.38.0") ], targets: [ .executableTarget( diff --git a/book/snippets/swift/NostrSnippets/Sources/Hello.swift b/book/snippets/swift/NostrSnippets/Sources/Hello.swift index 50b58d014..a67d56a23 100644 --- a/book/snippets/swift/NostrSnippets/Sources/Hello.swift +++ b/book/snippets/swift/NostrSnippets/Sources/Hello.swift @@ -16,13 +16,13 @@ func hello() async throws { // ANCHOR: publish let builder = EventBuilder.textNote(content: "Hello, rust-nostr!") - let res = try await client.sendEventBuilder(builder: builder) + let output = try await client.sendEventBuilder(builder: builder) // ANCHOR_END: publish // ANCHOR: output - print("Event ID: \(try res.id.toBech32())") - print("Sent to: \(res.output.success)") - print("Not sent to: \(res.output.failed)") + print("Event ID: \(try output.id.toBech32())") + print("Sent to: \(output.success)") + print("Not sent to: \(output.failed)") // ANCHOR_END: output } // ANCHOR_END: full diff --git a/book/snippets/swift/NostrSnippets/Sources/Nip44.swift b/book/snippets/swift/NostrSnippets/Sources/Nip44.swift index ddf65d6d6..d1a3b5fc6 100644 --- a/book/snippets/swift/NostrSnippets/Sources/Nip44.swift +++ b/book/snippets/swift/NostrSnippets/Sources/Nip44.swift @@ -4,7 +4,7 @@ import NostrSDK func nip44() throws { let keys = Keys.generate() - let publicKey = try PublicKey.fromHex(hex: "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798") + let publicKey = try PublicKey.parse(publicKey: "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798") let ciphertext = try nip44Encrypt(secretKey: keys.secretKey(), publicKey: publicKey, content: "my message", version: Nip44Version.v2) print("Encrypted: \(ciphertext)"); diff --git a/book/src/sdk/event/id.md b/book/src/sdk/event/id.md index c16a0ccaf..b40611c29 100644 --- a/book/src/sdk/event/id.md +++ b/book/src/sdk/event/id.md @@ -22,7 +22,7 @@ The `EventId` class can be called in order to construct event ids, although this Upon instantiation the following content are passed to the class instance to generate the event ID: `public_key`, `created_at`, `kind`, `tags` and `content`. ```python,ignore -{{#include ../../../snippets/python/src/event/eventid.py:build-event-id}} +{{#include ../../../snippets/python/src/event/id.py:build-event-id}} ``` Once we have an event id object we are able to format and parse this using a few simple methods. @@ -34,19 +34,19 @@ In the event that we want to generalise and simplify this process, across hex/be For more information/examples on the formatting of Nostr objects please refer to [NIP-19](../nips/19.md) and [NIP-21](../nips/21.md). ```python,ignore -{{#include ../../../snippets/python/src/event/eventid.py:format-parse-hex}} +{{#include ../../../snippets/python/src/event/id.py:format-parse-hex}} ``` ```python,ignore -{{#include ../../../snippets/python/src/event/eventid.py:format-parse-bech32}} +{{#include ../../../snippets/python/src/event/id.py:format-parse-bech32}} ``` ```python,ignore -{{#include ../../../snippets/python/src/event/eventid.py:format-parse-nostr-uri}} +{{#include ../../../snippets/python/src/event/id.py:format-parse-nostr-uri}} ``` ```python,ignore -{{#include ../../../snippets/python/src/event/eventid.py:format-parse-bytes}} +{{#include ../../../snippets/python/src/event/id.py:format-parse-bytes}} ``` @@ -97,7 +97,7 @@ TODO In addition to directly creating/manipulating event ID objects we can also easily access these directly from events, by calling the `id()` method on and instance of the `Event` class, or, verify that the event id (and signature) for an event is valid, by using the `verify()` method. ```python,ignore -{{#include ../../../snippets/python/src/event/eventid.py:access-verify}} +{{#include ../../../snippets/python/src/event/id.py:access-verify}} ``` diff --git a/book/src/sdk/event/kind.md b/book/src/sdk/event/kind.md index 704344980..395b176ec 100644 --- a/book/src/sdk/event/kind.md +++ b/book/src/sdk/event/kind.md @@ -93,15 +93,7 @@ For example, the `text_note()` method can be used to quickly and efficiently cre ``` Occasionally you may want more generic usage of kinds, like if you wanted to create your own custom (or experimental) event type, -or if you want to leverage one of the commonly defined event types (i.e. replaceable, ephemeral, regular etc.). -To do this we can use the `Kind` class along with the `from_enum()` method much as we did in previous examples, -but we can leverage enums representing these types of events e.g. `CUSTOM()` or `REPLACEABLE()` and pass them the specific Kind integer for the new type of event we're creating. - -A good example of this may be events termed as "Parameterized Replaceable Lists". -In the [Nostr NIP-01 documentation](https://github.com/nostr-protocol/nips/blob/master/01.md) we see a recommended range for these lists as `30000 <= n < 40000`, -however at the time of writing, only kinds `30000`, `30002`, `30003`, `30004`, `30005`, `30015`, `30030` and `30063` are currently well defined. -Therefore, if we wanted to extend this to say create a new list event of our favourite memes, Kind `30420`, -then we could do this using the `PARAMETERIZED_REPLACEABLE(30420)` enum to define the type of event as in the example below. +or if you want to leverage one of the commonly defined event types (i.e. replaceable, ephemeral, regular, etc.). ```python,ignore {{#include ../../../snippets/python/src/event/kind.py:kind-representations}} diff --git a/book/src/sdk/install.md b/book/src/sdk/install.md index a5246dd12..3ea10d6f5 100644 --- a/book/src/sdk/install.md +++ b/book/src/sdk/install.md @@ -9,14 +9,14 @@ Add the `nostr-sdk` dependency in your `Cargo.toml` file: ```toml [dependencies] -nostr-sdk = "0.37" +nostr-sdk = "0.38" ``` Alternatively, you can add it directly from `git` source: ```toml [dependencies] -nostr-sdk = { git = "https://github.com/rust-nostr/nostr", tag = "v0.37.0" } +nostr-sdk = { git = "https://github.com/rust-nostr/nostr", tag = "v0.38.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.37.0 +nostr-sdk==0.38.0 ``` Import the library in your code: @@ -100,7 +100,7 @@ Alternatively, you can manually add the dependency in your `package.json` file: ```json { "dependencies": { - "@rust-nostr/nostr-sdk": "0.37.0" + "@rust-nostr/nostr-sdk": "0.38.0" } } ``` @@ -152,7 +152,7 @@ repositories { } dependencies { - implementation("org.rust-nostr:nostr-sdk:0.37.0") + implementation("org.rust-nostr:nostr-sdk:0.38.0") } ``` @@ -201,7 +201,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.37.0"), +.package(url: "https://github.com/rust-nostr/nostr-sdk-swift.git", from: "0.38.0"), ``` @@ -215,7 +215,7 @@ Add the following code to your package: nostr_sdk: git: url: https://github.com/rust-nostr/nostr-sdk-flutter.git - ref: b6fe16d3aee91c4cda670c4236ad4b28f12433df + ref: v0.38.0 ```