Make getFilter return a pure event object instead of the class from nostr-relaypool
This commit is contained in:
parent
6775f68606
commit
192ee7f76d
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue