diff --git a/app/api/nostr-opportunity-notification/route.ts b/app/api/nostr-opportunity-notification/route.ts index 5ca4fed..d779204 100644 --- a/app/api/nostr-opportunity-notification/route.ts +++ b/app/api/nostr-opportunity-notification/route.ts @@ -37,8 +37,8 @@ export async function POST(req: Request) { try { const secret = await getBackendSecret(); - const { finalizeEvent, getPublicKey } = await import("nostr-tools/pure"); - const { encrypt } = await import("nostr-tools/nip04"); + const { getPublicKey } = await import("nostr-tools/pure"); + const { wrapEvent } = await import("nostr-tools/nip17"); const senderPubkey = getPublicKey(secret); const handle = body.handle?.trim(); const message = [ @@ -48,19 +48,11 @@ export async function POST(req: Request) { ] .filter(Boolean) .join("\n\n"); - const content = encrypt(secret, recipientPubkey, message); - const event = finalizeEvent( - { - kind: 4, - created_at: Math.floor(Date.now() / 1000), - tags: [ - ["p", recipientPubkey], - ["t", "lacrypta-dev"], - ["t", "opportunities"], - ], - content, - }, + const event = wrapEvent( secret, + { publicKey: recipientPubkey }, + message, + "La Crypta Dev opportunities", ); return NextResponse.json({ event, senderPubkey }); diff --git a/components/sections/NewsletterCTA.tsx b/components/sections/NewsletterCTA.tsx index d1015b0..0ac1b8a 100644 --- a/components/sections/NewsletterCTA.tsx +++ b/components/sections/NewsletterCTA.tsx @@ -491,7 +491,7 @@ function ProfilePreview({
- Notificación NIP-04 + Notificación NIP-17
Firmada por La Crypta y publicada desde tu navegador.