MCPcopy Index your code
hub / github.com/cameri/nostream / signEvent

Function signEvent

src/utils/event.ts:157–161  ·  view source on GitHub ↗
(privkey: string | Buffer | undefined)

Source from the content-addressed store, hash-verified

155
156export const signEvent =
157 (privkey: string | Buffer | undefined) =>
158 async (event: UnsignedEvent): Promise<Event> => {
159 const sig = await secp256k1.schnorr.sign(event.id, privkey as any)
160 return { ...event, sig: Buffer.from(sig).toString('hex') }
161 }
162
163export const broadcastEvent = async (event: Event): Promise<Event> => {
164 return new Promise((resolve, reject) => {

Callers 4

createAuthEventFunction · 0.90
makeValidEventFunction · 0.90

Calls 1

toStringMethod · 0.80

Tested by 2

createAuthEventFunction · 0.72
makeValidEventFunction · 0.72