Skip to content

Commit

Permalink
Expose EventBuilder::private_msg
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Jan 10, 2025
1 parent 6753e1a commit f9dc44f
Show file tree
Hide file tree
Showing 5 changed files with 346 additions and 196 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* Expose `EventBuilder::seal` ([Yuki Kishimoto])
* Expose `EventBuilder::gift_wrap_from_seal` ([Yuki Kishimoto])
* Expose `EventBuilder::gift_wrap` ([Yuki Kishimoto])
* Expose `EventBuilder::private_msg` ([Yuki Kishimoto])

### Fixed

Expand Down
14 changes: 14 additions & 0 deletions lib/src/rust/api/protocol/event/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ abstract class EventBuilder implements RustOpaqueInterface {
/// Only values `> 0` are accepted!
EventBuilder pow({required int difficulty});

/// Private Direct message
///
/// <https://github.com/nostr-protocol/nips/blob/master/17.md>
static Future<Event> privateMsg(
{required NostrSigner signer,
required PublicKey receiver,
required String message,
required List<Tag> rumorExtraTags}) =>
NostrSdk.instance.api.crateApiProtocolEventBuilderEventBuilderPrivateMsg(
signer: signer,
receiver: receiver,
message: message,
rumorExtraTags: rumorExtraTags);

/// Seal
///
/// <https://github.com/nostr-protocol/nips/blob/master/59.md>
Expand Down
Loading

0 comments on commit f9dc44f

Please sign in to comment.