Skip to content

Commit 8ab40f0

Browse files
committed
Expose Client::automatic_authentication
1 parent c71bcee commit 8ab40f0

File tree

7 files changed

+288
-179
lines changed

7 files changed

+288
-179
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* Expose `UnsignedEvent` ([Yuki Kishimoto])
4343
* Expose `EventBuilder` ([Yuki Kishimoto])
4444
* Expose `Client::send_event_builder` ([Yuki Kishimoto])
45+
* Expose `Client::automatic_authentication` ([Yuki Kishimoto])
4546
* Add `SendEventOutput` ([Yuki Kishimoto])
4647

4748
### Fixed

lib/src/rust/api/client.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ abstract class Client implements RustOpaqueInterface {
2525
/// Connection is **NOT** automatically started with relay, remember to call `connect` method!
2626
Future<bool> addRelay({required String url});
2727

28+
/// Auto authenticate to relays (default: true)
29+
///
30+
/// <https://github.com/nostr-protocol/nips/blob/master/42.md>
31+
void automaticAuthentication({required bool enable});
32+
2833
/// New client builder
2934
static ClientBuilder builder() =>
3035
NostrSdk.instance.api.crateApiClientClientBuilder();

lib/src/rust/frb_generated.dart

Lines changed: 123 additions & 87 deletions
Large diffs are not rendered by default.

rust/Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ codegen = ["dep:flutter_rust_bridge_codegen"]
2020
anyhow = "1.0"
2121
flutter_rust_bridge = "=2.0.0"
2222
flutter_rust_bridge_codegen = { version = "=2.0.0", optional = true }
23-
nostr-sdk = { git = "https://github.com/rust-nostr/nostr", rev = "6dde132193324dede0882f6d3ead039ddee36097", default-features = false, features = ["all-nips", "tor"] }
23+
nostr-sdk = { git = "https://github.com/rust-nostr/nostr", rev = "e11d0aff3fbccbb1004f7abad3b914d429341736", default-features = false, features = ["all-nips", "tor"] }
2424

2525
[lints.rust]
2626
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(frb_expand)'] }

rust/src/api/client/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ impl _Client {
4040
_ClientBuilder::new()
4141
}
4242

43+
/// Auto authenticate to relays (default: true)
44+
///
45+
/// <https://github.com/nostr-protocol/nips/blob/master/42.md>
46+
#[frb(sync)]
47+
pub fn automatic_authentication(&self, enable: bool) {
48+
self.inner.automatic_authentication(enable);
49+
}
50+
4351
/// Add relay
4452
///
4553
/// Relays added with this method will have both `READ` and `WRITE` flags enabled.

0 commit comments

Comments
 (0)