commit 15ae7f88cf9aa2d1e58dd622dbcccffb77fe51eb
parent 14711f4586c040e439d5c6a57e61e314f6b330b0
Author: William Casarin <jb55@jb55.com>
Date: Thu, 3 Jul 2025 16:11:51 -0700
note/builder: add tag_id
For pushing packed id tags
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/note.rs b/src/note.rs
@@ -461,6 +461,20 @@ impl<'a> NoteBuilder<'a> {
self
}
+ /// Push a packed 32-byte id. tag_str also does this for you,
+ /// but we expose a method here so that you don't have to
+ /// hex encode an id if you already have one
+ pub fn tag_id(mut self, id: &[u8; 32]) -> Self {
+ unsafe {
+ // Call the external C function with the appropriate arguments
+ bindings::ndb_builder_push_tag_id(
+ self.as_mut_ptr(),
+ id.as_ptr() as *mut ::std::os::raw::c_uchar,
+ );
+ }
+ self
+ }
+
pub fn options(mut self, options: NoteBuildOptions<'a>) -> NoteBuilder<'a> {
self.options = options;
self