nip57 event type mismatch error (toString)

This commit is contained in:
lemonknowsall committed 2025-10-06 20:14:10 -07:00
1 parent e14d4e887f
commit 39796c293a
1 file changed
+5 -10
+5 -10
View File
@@ -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<typeof nip57.makeZapRequest>[0]);
});
// Sign the zap request (but don't publish to relays - only send to LNURL endpoint)
if (!user.signer) {