diff options
author | polwex <polwex@sortug.com> | 2025-09-11 01:48:14 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-09-11 01:48:14 +0700 |
commit | b1d68ac307ed87d63e83820cbdf843fff0fd9f7f (patch) | |
tree | d6a684a70a80509e68ff667b842aa4e4c091906f /desk/lib/nostril.hoon |
init
Diffstat (limited to 'desk/lib/nostril.hoon')
-rw-r--r-- | desk/lib/nostril.hoon | 28 |
1 files changed, 28 insertions, 0 deletions
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] + -- +-- |