diff --git a/src/components/Donation/index.tsx b/src/components/Donation/index.tsx index 1faebee..4ef12db 100644 --- a/src/components/Donation/index.tsx +++ b/src/components/Donation/index.tsx @@ -1,11 +1,11 @@ import { Button } from '@/components/ui/button' -import { CODY_PUBKEY } from '@/constants' +import { JUMBLE_PUBKEY } from '@/constants' import { cn } from '@/lib/utils' import { useState } from 'react' import { useTranslation } from 'react-i18next' import ZapDialog from '../ZapDialog' -import RecentSupporters from './RecentSupporters' import PlatinumSponsors from './PlatinumSponsors' +import RecentSupporters from './RecentSupporters' export default function Donation({ className }: { className?: string }) { const { t } = useTranslation() @@ -45,7 +45,7 @@ export default function Donation({ className }: { className?: string }) { diff --git a/src/constants.ts b/src/constants.ts index ad4e7b5..26ddedb 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -116,6 +116,7 @@ export const YOUTUBE_URL_REGEX = export const MONITOR = '9bbbb845e5b6c831c29789900769843ab43bb5047abe697870cb50b6fc9bf923' export const MONITOR_RELAYS = ['wss://relay.nostr.watch/'] +export const JUMBLE_PUBKEY = 'f4eb8e62add1340b9cadcd9861e669b2e907cea534e0f7f3ac974c11c758a51a' export const CODY_PUBKEY = '8125b911ed0e94dbe3008a0be48cfe5cd0c0b05923cfff917ae7e87da8400883' export const NIP_96_SERVICE = [ diff --git a/src/services/lightning.service.ts b/src/services/lightning.service.ts index 51fe8df..99becab 100644 --- a/src/services/lightning.service.ts +++ b/src/services/lightning.service.ts @@ -1,4 +1,4 @@ -import { BIG_RELAY_URLS, CODY_PUBKEY } from '@/constants' +import { BIG_RELAY_URLS, CODY_PUBKEY, JUMBLE_PUBKEY } from '@/constants' import { getZapInfoFromEvent } from '@/lib/event-metadata' import { TProfile } from '@/types' import { @@ -19,6 +19,8 @@ import client from './client.service' export type TRecentSupporter = { pubkey: string; amount: number; comment?: string } +const OFFICIAL_PUBKEYS = [JUMBLE_PUBKEY, CODY_PUBKEY] + class LightningService { static instance: LightningService private provider: WebLNProvider | null = null @@ -186,14 +188,14 @@ class LightningService { const events = await client.fetchEvents(relayList.read.slice(0, 4), { authors: ['79f00d3f5a19ec806189fcab03c1be4ff81d18ee4f653c88fac41fe03570f432'], // alby kinds: [kinds.Zap], - '#p': [CODY_PUBKEY], + '#p': OFFICIAL_PUBKEYS, since: dayjs().subtract(1, 'month').unix() }) events.sort((a, b) => b.created_at - a.created_at) const map = new Map() events.forEach((event) => { const info = getZapInfoFromEvent(event) - if (!info || info.eventId || !info.senderPubkey || info.senderPubkey === CODY_PUBKEY) return + if (!info || !info.senderPubkey || OFFICIAL_PUBKEYS.includes(info.senderPubkey)) return const { amount, comment, senderPubkey } = info const item = map.get(senderPubkey)