Upgrade nostr-tools, signEvent --> getSignature

This commit is contained in:
Alex Gleason 2023-04-27 21:10:51 -05:00
parent 4664609047
commit a0f4a7d9b5
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 3 additions and 3 deletions

View File

@ -2,5 +2,5 @@ export { type Context, Hono, validator } from 'https://deno.land/x/hono@v3.0.2/m
export { cors } from 'https://deno.land/x/hono@v3.0.2/middleware.ts';
export { z } from 'https://deno.land/x/zod@v3.20.5/mod.ts';
export { Author, RelayPool } from 'https://dev.jspm.io/nostr-relaypool@0.5.3';
export { type Filter, getEventHash, getPublicKey, nip19, signEvent } from 'npm:nostr-tools@^1.7.4';
export { type Filter, getEventHash, getPublicKey, nip19, signEvent as getSignature } from 'npm:nostr-tools@^1.10.1';
export { default as lmdb } from 'npm:lmdb';

View File

@ -1,4 +1,4 @@
import { getEventHash, signEvent } from '@/deps.ts';
import { getEventHash, getSignature } from '@/deps.ts';
import { type Event } from '@/nostr/event.ts';
import { pool } from './client.ts';
@ -7,7 +7,7 @@ import { publishRelays } from './config.ts';
/** Publish an event to the Nostr relay. */
function publish(event: Event, privatekey: string, relays = publishRelays): void {
event.id = getEventHash(event);
event.sig = signEvent(event, privatekey);
event.sig = getSignature(event, privatekey);
console.log('Publishing event', event);
try {
pool.publish(event, relays);