diff --git a/nostrdb/src/nostrdb.c b/nostrdb/src/nostrdb.c index 29044e21..eff9609d 100644 --- a/nostrdb/src/nostrdb.c +++ b/nostrdb/src/nostrdb.c @@ -7739,6 +7739,16 @@ int ndb_builder_push_tag_str(struct ndb_builder *builder, return ndb_builder_finalize_tag(builder, pstr); } +/// Push an id element to the current tag. Needs to be 32 bytes +int ndb_builder_push_tag_id(struct ndb_builder *builder, + unsigned char *id) +{ + union ndb_packed_str pstr; + if (!ndb_builder_push_packed_id(builder, id, &pstr)) + return 0; + return ndb_builder_finalize_tag(builder, pstr); +} + // // CONFIG // diff --git a/nostrdb/src/nostrdb.h b/nostrdb/src/nostrdb.h index a25e8d43..c25c0fe6 100644 --- a/nostrdb/src/nostrdb.h +++ b/nostrdb/src/nostrdb.h @@ -551,6 +551,7 @@ void ndb_builder_set_id(struct ndb_builder *builder, unsigned char *id); void ndb_builder_set_kind(struct ndb_builder *builder, uint32_t kind); int ndb_builder_new_tag(struct ndb_builder *builder); int ndb_builder_push_tag_str(struct ndb_builder *builder, const char *str, int len); +int ndb_builder_push_tag_id(struct ndb_builder *builder, unsigned char *id); // FILTERS int ndb_filter_init(struct ndb_filter *);