Add docs for blossom, add nip 86 and 98 support

This commit is contained in:
Jon Staab
2025-06-10 13:18:03 -07:00
parent 90b2ab2974
commit 4cabf53c2f
13 changed files with 314 additions and 17 deletions
+20
View File
@@ -0,0 +1,20 @@
import {Base64} from "js-base64"
import {sha256, textEncoder} from "@welshman/lib"
import {makeEvent, SignedEvent} from "./Events.js"
import {HTTP_AUTH} from "./Kinds.js"
export const makeHttpAuth = async (url: string, method = "GET", body?: string) => {
const tags = [
["u", url],
["method", method],
]
if (body) {
tags.push(["payload", await sha256(textEncoder.encode(body))])
}
return makeEvent(HTTP_AUTH, {tags})
}
export const makeHttpAuthHeader = (event: SignedEvent) =>
`Nostr ${Base64.encode(JSON.stringify(event))}`