mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 08:23:35 +00:00
nip57 event type mismatch error (toString)
This commit is contained in:
1 parent
e14d4e887f
commit
39796c293a
1 file changed
+5
-10
+5
-10
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user