Make getFilter return a pure event object instead of the class from nostr-relaypool

This commit is contained in:
Alex Gleason 2023-05-03 21:54:22 -05:00
parent 6775f68606
commit 192ee7f76d
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 9 additions and 1 deletions

View File

@ -33,7 +33,15 @@ function getFilter<K extends number>(filter: Filter<K>, opts: GetFilterOpts = {}
poolRelays, poolRelays,
(event: SignedEvent | null) => { (event: SignedEvent | null) => {
if (event && matchFilter(filter, event)) { if (event && matchFilter(filter, event)) {
results.push(event); results.push({
id: event.id,
kind: event.kind,
pubkey: event.pubkey,
content: event.content,
tags: event.tags,
created_at: event.created_at,
sig: event.sig,
});
} }
if (filter.limit && results.length >= filter.limit) { if (filter.limit && results.length >= filter.limit) {
unsub(); unsub();