File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 51
51
* pool: add ` RelayPoolNotification::Authenticated ` variant ([ Yuki Kishimoto] )
52
52
* sdk: add ` Client::gift_wrap_to ` and ` Client::send_private_msg_to ` ([ reyamir] )
53
53
* sdk: add option to autoconnect relay on ` Client::add_relay ` method call ([ Yuki Kishimoto] )
54
+ * ffi(nostr): add ` EventBuilder::seal ` constructor ([ Yuki Kishimoto] )
54
55
* cli: add ` generate ` command ([ Yuki Kishimoto] )
55
56
* book: add some python examples ([ RydalWater] )
56
57
Original file line number Diff line number Diff line change @@ -584,7 +584,24 @@ impl EventBuilder {
584
584
}
585
585
}
586
586
587
- // TODO: add seal
587
+ /// Seal
588
+ ///
589
+ /// <https://github.com/nostr-protocol/nips/blob/master/59.md>
590
+ #[ inline]
591
+ #[ uniffi:: constructor]
592
+ pub fn seal (
593
+ sender_keys : & Keys ,
594
+ receiver_public_key : & PublicKey ,
595
+ rumor : & UnsignedEvent ,
596
+ ) -> Result < Self > {
597
+ Ok ( Self {
598
+ inner : nostr:: EventBuilder :: seal (
599
+ sender_keys. deref ( ) ,
600
+ receiver_public_key. deref ( ) ,
601
+ rumor. deref ( ) . clone ( ) ,
602
+ ) ?,
603
+ } )
604
+ }
588
605
589
606
/// Private Direct message rumor
590
607
///
Original file line number Diff line number Diff line change @@ -568,7 +568,25 @@ impl JsEventBuilder {
568
568
}
569
569
}
570
570
571
- // TODO: add seal
571
+ /// Seal
572
+ ///
573
+ /// <https://github.com/nostr-protocol/nips/blob/master/59.md>
574
+ #[ inline]
575
+ #[ wasm_bindgen]
576
+ pub fn seal (
577
+ sender_keys : & JsKeys ,
578
+ receiver_public_key : & JsPublicKey ,
579
+ rumor : & JsUnsignedEvent ,
580
+ ) -> Result < JsEventBuilder > {
581
+ Ok ( Self {
582
+ inner : nostr:: EventBuilder :: seal (
583
+ sender_keys. deref ( ) ,
584
+ receiver_public_key. deref ( ) ,
585
+ rumor. deref ( ) . clone ( ) ,
586
+ )
587
+ . map_err ( into_err) ?,
588
+ } )
589
+ }
572
590
573
591
/// Gift Wrap from seal
574
592
///
You can’t perform that action at this time.
0 commit comments