Skip to content

Commit

Permalink
ffi: add EventBuilder::job_request
Browse files Browse the repository at this point in the history
  • Loading branch information
rustedmoon committed Dec 8, 2023
1 parent eac9c5d commit 2dfe8de
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bindings/nostr-ffi/src/event/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,19 @@ impl EventBuilder {
}))
}

/// Data Vending Machine - Job Request
///
/// <https://github.com/nostr-protocol/nips/blob/master/90.md>
#[uniffi::constructor]
pub fn job_request(kind: u64, tags: Vec<Arc<Tag>>) -> Result<Arc<Self>> {
Ok(Arc::new(Self {
inner: nostr::EventBuilder::job_request(
kind.into(),
tags.into_iter().map(|t| t.as_ref().deref().clone()),
)?,
}))
}

#[uniffi::constructor]
pub fn file_metadata(description: String, metadata: Arc<FileMetadata>) -> Arc<Self> {
Arc::new(Self {
Expand Down

0 comments on commit 2dfe8de

Please sign in to comment.