-
-
Notifications
You must be signed in to change notification settings - Fork 143
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Describe the enhancement
In my app, I need to send a gift wrap signed by custom signer to user's nip17 relays. But there are no functions allow to do it yet.
I've made a custom function like this in my fork. But I'm not sure about it so I didn't created a PR.
/// Send the gift wrap event to relays
///
/// # Overview
///
/// Send the [`Gift Wrap`] to all relays with [`RelayServiceFlags::WRITE`] flag.
///
/// # Gossip
///
/// If `gossip` is enabled (see [`Options::gossip`]):
/// - the [`Gift Wrap`] will be sent also to NIP17 relays (automatically discovered);
#[inline]
#[cfg(feature = "nip59")]
pub async fn send_gift_wrap(&self, gift_wrap: &Event) -> Result<Output<EventId>, Error> {
// NOT gossip, send event to all relays
if !self.opts.gossip {
return Ok(self.pool.send_event(gift_wrap).await?);
}
// Send event using gossip
self.gossip_send_event(gift_wrap, true).await
}Use case
Useful for NIP-4E
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request