Skip to content

Commit

Permalink
Expose Client::send_event_builder
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Dec 23, 2024
1 parent 91a5bdf commit 6305585
Show file tree
Hide file tree
Showing 5 changed files with 291 additions and 164 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* Expose `NostrSigner` ([Yuki Kishimoto])
* Expose `UnsignedEvent` ([Yuki Kishimoto])
* Expose `EventBuilder` ([Yuki Kishimoto])
* Expose `Client::send_event_builder` ([Yuki Kishimoto])

### Fixed

Expand Down
8 changes: 8 additions & 0 deletions lib/src/rust/api/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../frb_generated.dart';
import 'client/builder.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
import 'protocol/event.dart';
import 'protocol/event/builder.dart';

// 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`

Expand Down Expand Up @@ -37,4 +38,11 @@ abstract class Client implements RustOpaqueInterface {
/// Send `Event` to all relays with `WRITE` flag.
/// If `gossip` option is enabled, the event will be sent also to NIP65 relays (automatically discovered).
Future<String> sendEvent({required Event event});

/// Send event
///
/// Take an [`EventBuilder`], sign it by using the [`NostrSigner`] and broadcast to relays (check [`Client::send_event`] from more details).
///
/// Return an error if the [`NostrSigner`] is not set.
Future<String> sendEventBuilder({required EventBuilder builder});
}
Loading

0 comments on commit 6305585

Please sign in to comment.