mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-06 00:37:23 +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;
|
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
|
const zapAmount = amount * 1000; // convert to millisats
|
||||||
|
|
||||||
// Validate zapAmount is a valid number
|
// Validate zapAmount is a valid number
|
||||||
@@ -225,13 +218,15 @@ export function useZaps(
|
|||||||
throw new Error('Invalid zap amount');
|
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({
|
const zapRequest = nip57.makeZapRequest({
|
||||||
profile: actualTarget.pubkey,
|
event: actualTarget,
|
||||||
event: event as Event,
|
|
||||||
amount: zapAmount,
|
amount: zapAmount,
|
||||||
relays: [config.relayUrl],
|
relays: [config.relayUrl],
|
||||||
comment
|
comment
|
||||||
} as Parameters<typeof nip57.makeZapRequest>[0]);
|
});
|
||||||
|
|
||||||
// Sign the zap request (but don't publish to relays - only send to LNURL endpoint)
|
// Sign the zap request (but don't publish to relays - only send to LNURL endpoint)
|
||||||
if (!user.signer) {
|
if (!user.signer) {
|
||||||
|
|||||||
Reference in new issue
Block a user