Upgrade nostr-tools, signEvent --> getSignature
This commit is contained in:
parent
4664609047
commit
a0f4a7d9b5
|
@ -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 { 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 { 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 { 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';
|
export { default as lmdb } from 'npm:lmdb';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { getEventHash, signEvent } from '@/deps.ts';
|
import { getEventHash, getSignature } from '@/deps.ts';
|
||||||
import { type Event } from '@/nostr/event.ts';
|
import { type Event } from '@/nostr/event.ts';
|
||||||
|
|
||||||
import { pool } from './client.ts';
|
import { pool } from './client.ts';
|
||||||
|
@ -7,7 +7,7 @@ import { publishRelays } from './config.ts';
|
||||||
/** Publish an event to the Nostr relay. */
|
/** Publish an event to the Nostr relay. */
|
||||||
function publish(event: Event, privatekey: string, relays = publishRelays): void {
|
function publish(event: Event, privatekey: string, relays = publishRelays): void {
|
||||||
event.id = getEventHash(event);
|
event.id = getEventHash(event);
|
||||||
event.sig = signEvent(event, privatekey);
|
event.sig = getSignature(event, privatekey);
|
||||||
console.log('Publishing event', event);
|
console.log('Publishing event', event);
|
||||||
try {
|
try {
|
||||||
pool.publish(event, relays);
|
pool.publish(event, relays);
|
||||||
|
|
Loading…
Reference in New Issue