Skip to content

Commit 60cb27f

Browse files
committed
Release v0.32.0
Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 042c6a8 commit 60cb27f

File tree

17 files changed

+81
-65
lines changed

17 files changed

+81
-65
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@
55
<!-- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), -->
66
<!-- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -->
77

8-
## [Unreleased]
8+
## [v0.32.0]
99

1010
### Summary
1111

12+
Added `async`/`future` support to Python, Kotlin and Swift, added automatic authentication to relays (NIP-42, can be deactivated in client options),
13+
improvements to relay limits, many bug fixes (relays not auto reconnect, wrong query order for SQLite,
14+
tokio panic when using SQLite database in bindings) and more!
15+
16+
Note for kotlin devs: from this release the packages will be published at `org.rust-nostr` instead of `io.github.rust-nostr`.
17+
1218
### Changed
1319

1420
* Bump `atomic-destructor` to `v0.2` ([Yuki Kishimoto])
@@ -246,6 +252,7 @@ added `nostrdb` storage backend, added NIP32 and completed NIP51 support and mor
246252
[RydalWater]: https://github.com/RydalWater
247253

248254
<!-- Tags -->
249-
[Unreleased]: https://github.com/rust-nostr/nostr/compare/v0.31.0...HEAD
255+
[Unreleased]: https://github.com/rust-nostr/nostr/compare/v0.32.0...HEAD
256+
[v0.32.0]: https://github.com/rust-nostr/nostr/compare/v0.31.0...v0.32.0
250257
[v0.31.0]: https://github.com/rust-nostr/nostr/compare/v0.30.0...v0.31.0
251258
[v0.30.0]: https://github.com/rust-nostr/nostr/compare/v0.29.0...v0.30.0

book/snippets/nostr-sdk/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ edition = "2021"
88
members = ["."]
99

1010
[dependencies]
11-
nostr-sdk = "0.31"
11+
nostr-sdk = "0.32"
1212
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }

book/snippets/nostr/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"main": "index.js",
66
"license": "MIT",
77
"dependencies": {
8-
"@rust-nostr/nostr": "0.14.0"
8+
"@rust-nostr/nostr": "0.32.0"
99
}
1010
}

book/snippets/nostr/kotlin/gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ agp = "8.1.4"
33
kotlin = "1.9.22"
44

55
[libraries]
6-
nostr = { module = "io.github.rust-nostr:nostr", version = "0.12.0" }
6+
nostr = { module = "org.rust-nostr:nostr", version = "0.32.1" }
77

88
[plugins]
99
androidLibrary = { id = "com.android.library", version.ref = "agp" }

book/snippets/nostr/python/main.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python
22

3+
import asyncio
4+
35
from src.keys import generate, restore, vanity
46
from src.event.json import event_json
57
from src.event.builder import event_builder
@@ -13,20 +15,20 @@
1315
from src.nip65 import nip65
1416

1517

16-
def main():
18+
async def main():
1719
generate()
1820
restore()
1921
vanity()
2022
event_json()
2123
event_builder()
2224
nip01()
23-
nip05()
25+
await nip05()
2426
nip06()
2527
nip19()
2628
nip21()
2729
nip44()
2830
nip59()
2931
nip65()
3032

31-
32-
main()
33+
if __name__ == '__main__':
34+
asyncio.run(main())
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
nostr-protocol==0.12.0
1+
nostr-protocol==0.32.1
22
mnemonic==0.21
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from nostr_protocol import Keys, Metadata, EventBuilder, PublicKey, verify_nip05, get_nip05_profile
22

33

4-
def nip05():
4+
async def nip05():
55
# ANCHOR: set-metadata
66
# Create metadata object with name and NIP05
77
metadata = Metadata() \
@@ -16,24 +16,17 @@ def nip05():
1616
nip_05 = "[email protected]"
1717
public_key = PublicKey.parse("npub1drvpzev3syqt0kjrls50050uzf25gehpz9vgdw08hvex7e0vgfeq0eseet")
1818
proxy = None
19-
try:
20-
verify_nip05(public_key, nip_05, proxy)
19+
if await verify_nip05(public_key, nip_05, proxy):
2120
print(f" '{nip_05}' verified, for {public_key.to_bech32()}")
22-
except Exception as e:
23-
print(f" Unable to verify NIP-05, for {public_key.to_bech32()}: {e}")
21+
else:
22+
print(f" Unable to verify NIP-05, for {public_key.to_bech32()}")
2423
# ANCHOR_END: verify-nip05
2524

26-
# TODO: replace above code with the following one (due to changes to NIP-05 verify func)
27-
# if verify_nip05(public_key, nip_05, proxy):
28-
# print(f" '{nip_05}' verified, for {public_key.to_bech32()}")
29-
# else:
30-
# print(f" Unable to verify NIP-05, for {public_key.to_bech32()}")
31-
3225
print()
3326

3427
# ANCHOR: nip05-profile
3528
print("Profile NIP-05:")
36-
nip_05 = "[email protected]"
37-
profile = get_nip05_profile(nip_05)
29+
nip_05 = "[email protected]"
30+
profile = await get_nip05_profile(nip_05)
3831
print(f" {nip_05} Profile: {profile.to_bech32()}")
3932
# ANCHOR_END: nip05-profile

book/snippets/nostr/python/src/nip06.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def nip06():
4545

4646
# Use Seed Phrase and account to multiple Nostr keys
4747
for account in range(0,6):
48-
nsec = Keys.from_mnemonic_with_account(words,passphrase,account).secret_key().to_bech32()
48+
nsec = Keys.from_mnemonic(words, passphrase, account).secret_key().to_bech32()
4949
print(f" Account #{account} bech32: {nsec}")
5050
# ANCHOR_END: keys-from-seed-accounts
5151

@@ -61,6 +61,6 @@ def nip06():
6161

6262
# Use Seed Phrase and account to multiple Nostr keys
6363
for account in range(0,6):
64-
nsec = Keys.from_mnemonic_with_account(words,passphrase,account).secret_key().to_bech32()
64+
nsec = Keys.from_mnemonic(words, passphrase, account).secret_key().to_bech32()
6565
print(f" Account #{account} bech32: {nsec}")
6666
# ANCHOR_END: keys-from-seed-accounts-pass

book/snippets/nostr/python/src/nip19.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def nip19():
3535
print()
3636
# ANCHOR: nip19-nevent-encode
3737
# Create NIP-19 event including author and relays data
38-
nevent = Nip19Event(event.id(),keys.public_key(),relays)
38+
nevent = Nip19Event(event.id(), keys.public_key(), kind=None, relays=relays)
3939
print(f" Event (encoded): {nevent.to_bech32()}")
4040
# ANCHOR_END: nip19-nevent-encode
4141

book/snippets/nostr/python/src/nip21.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def nip21():
5555

5656
# ANCHOR: nevent
5757
relays = ["wss://relay.damus.io"]
58-
nevent = Nip19Event(event.id(), keys.public_key(), relays)
58+
nevent = Nip19Event(event.id(), keys.public_key(), kind=None, relays=relays)
5959

6060
# URI nevent
6161
nevent_uri = nevent.to_nostr_uri()

0 commit comments

Comments
 (0)