Fix sent zaps: query kind 9735 receipts with #P tag instead of ephemeral kind 9734

This commit is contained in:
Jure
2026-03-13 11:17:45 +01:00
parent 7746e31051
commit 93963de28d
2 changed files with 6 additions and 10 deletions

View File

@@ -435,7 +435,8 @@ export async function fetchZapsReceived(pubkey: string, limit = 50): Promise<NDK
export async function fetchZapsSent(pubkey: string, limit = 50): Promise<NDKEvent[]> {
const instance = getNDK();
const filter: NDKFilter = { kinds: [NDKKind.ZapRequest], authors: [pubkey], limit };
// Zap receipts (kind 9735) with uppercase P tag = the sender's pubkey
const filter: NDKFilter = { kinds: [NDKKind.Zap], "#P": [pubkey], limit };
const events = await instance.fetchEvents(filter, {
cacheUsage: NDKSubscriptionCacheUsage.ONLY_RELAY,
});