Skip to content

Commit 6305585

Browse files
committed
Expose Client::send_event_builder
1 parent 91a5bdf commit 6305585

File tree

5 files changed

+291
-164
lines changed

5 files changed

+291
-164
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
* Expose `NostrSigner` ([Yuki Kishimoto])
4242
* Expose `UnsignedEvent` ([Yuki Kishimoto])
4343
* Expose `EventBuilder` ([Yuki Kishimoto])
44+
* Expose `Client::send_event_builder` ([Yuki Kishimoto])
4445

4546
### Fixed
4647

lib/src/rust/api/client.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import '../frb_generated.dart';
77
import 'client/builder.dart';
88
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
99
import 'protocol/event.dart';
10+
import 'protocol/event/builder.dart';
1011

1112
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `from`
1213

@@ -37,4 +38,11 @@ abstract class Client implements RustOpaqueInterface {
3738
/// Send `Event` to all relays with `WRITE` flag.
3839
/// If `gossip` option is enabled, the event will be sent also to NIP65 relays (automatically discovered).
3940
Future<String> sendEvent({required Event event});
41+
42+
/// Send event
43+
///
44+
/// Take an [`EventBuilder`], sign it by using the [`NostrSigner`] and broadcast to relays (check [`Client::send_event`] from more details).
45+
///
46+
/// Return an error if the [`NostrSigner`] is not set.
47+
Future<String> sendEventBuilder({required EventBuilder builder});
4048
}

0 commit comments

Comments
 (0)