summaryrefslogtreecommitdiff
path: root/desk/lib/nostril.hoon
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-09-11 01:48:14 +0700
committerpolwex <polwex@sortug.com>2025-09-11 01:48:14 +0700
commitb1d68ac307ed87d63e83820cbdf843fff0fd9f7f (patch)
treed6a684a70a80509e68ff667b842aa4e4c091906f /desk/lib/nostril.hoon
init
Diffstat (limited to 'desk/lib/nostril.hoon')
-rw-r--r--desk/lib/nostril.hoon28
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]
+ --
+--