Skip to content

Commit f9dc44f

Browse files
committed
Expose EventBuilder::private_msg
1 parent 6753e1a commit f9dc44f

File tree

5 files changed

+346
-196
lines changed

5 files changed

+346
-196
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
* Expose `EventBuilder::seal` ([Yuki Kishimoto])
3838
* Expose `EventBuilder::gift_wrap_from_seal` ([Yuki Kishimoto])
3939
* Expose `EventBuilder::gift_wrap` ([Yuki Kishimoto])
40+
* Expose `EventBuilder::private_msg` ([Yuki Kishimoto])
4041

4142
### Fixed
4243

lib/src/rust/api/protocol/event/builder.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,20 @@ abstract class EventBuilder implements RustOpaqueInterface {
5555
/// Only values `> 0` are accepted!
5656
EventBuilder pow({required int difficulty});
5757

58+
/// Private Direct message
59+
///
60+
/// <https://github.com/nostr-protocol/nips/blob/master/17.md>
61+
static Future<Event> privateMsg(
62+
{required NostrSigner signer,
63+
required PublicKey receiver,
64+
required String message,
65+
required List<Tag> rumorExtraTags}) =>
66+
NostrSdk.instance.api.crateApiProtocolEventBuilderEventBuilderPrivateMsg(
67+
signer: signer,
68+
receiver: receiver,
69+
message: message,
70+
rumorExtraTags: rumorExtraTags);
71+
5872
/// Seal
5973
///
6074
/// <https://github.com/nostr-protocol/nips/blob/master/59.md>

0 commit comments

Comments
 (0)