From 39796c293ab5411d1c83355e7fea70b1556d3654 Mon Sep 17 00:00:00 2001 From: lemonknowsall Date: Mon, 6 Oct 2025 20:14:10 -0700 Subject: [PATCH] nip57 event type mismatch error (toString) --- src/hooks/useZaps.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/hooks/useZaps.ts b/src/hooks/useZaps.ts index 56216a9..a4fde0a 100644 --- a/src/hooks/useZaps.ts +++ b/src/hooks/useZaps.ts @@ -211,13 +211,6 @@ export function useZaps( return; } - // Create zap request - use appropriate event format based on kind - // For addressable events (30000-39999), pass the object to get 'a' tag - // For all other events, pass the ID string to get 'e' tag - const event = (actualTarget!.kind >= 30000 && actualTarget!.kind < 40000) - ? actualTarget! - : actualTarget!.id; - const zapAmount = amount * 1000; // convert to millisats // Validate zapAmount is a valid number @@ -225,13 +218,15 @@ export function useZaps( throw new Error('Invalid zap amount'); } + // Create zap request - always pass the full event object + // The nip57.makeZapRequest function will handle proper tag generation + // ('e' tag for regular events, 'a' tag for addressable events) const zapRequest = nip57.makeZapRequest({ - profile: actualTarget.pubkey, - event: event as Event, + event: actualTarget, amount: zapAmount, relays: [config.relayUrl], comment - } as Parameters[0]); + }); // Sign the zap request (but don't publish to relays - only send to LNURL endpoint) if (!user.signer) {