(privkey: string | Buffer | undefined)
| 155 | |
| 156 | export 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 | |
| 163 | export const broadcastEvent = async (event: Event): Promise<Event> => { |
| 164 | return new Promise((resolve, reject) => { |