From b1d68ac307ed87d63e83820cbdf843fff0fd9f7f Mon Sep 17 00:00:00 2001 From: polwex Date: Thu, 11 Sep 2025 01:48:14 +0700 Subject: init --- desk/lib/nostril.hoon | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 desk/lib/nostril.hoon (limited to 'desk/lib/nostril.hoon') diff --git a/desk/lib/nostril.hoon b/desk/lib/nostril.hoon new file mode 100644 index 0000000..48d4eb7 --- /dev/null +++ b/desk/lib/nostril.hoon @@ -0,0 +1,28 @@ +/- post=trill-post, nsur=nostr +/+ trill=trill-post, nostr, sr=sortug +|% +:: +++ post-to-event |= [=keys:nsur eny=@ p=post:post] ^- event:nsur + =/ cl (latest-post-content:trill contents.p) + =/ string (crip (content-list-to-md:trill cl)) + =/ ts (to-unix-secs:jikan:sr id.p) + =/ raw=raw-event:nsur [pub.keys ts 1 ~ string] + =/ event-id (hash-event:nostr raw) + =/ signature (sign-event:nostr priv.keys event-id eny) + ~& hash-and-signed=[event-id signature] + =/ =event:nsur :* + event-id + pub.keys + created-at.raw + kind.raw + tags.raw + content.raw + signature + == + event +++ cards +|_ =bowl:gall + ++ shim-binding ^- card:agent:gall + [%pass /binding %arvo %e %connect [~ /nostr-shim] dap.bowl] + -- +-- -- cgit v1.2.3