-

@ Anthony Accioly
2025-03-12 18:17:50
Got it. fetchEvents is just a wrapper over subscribe with closeOnEose anyway (see https://github.com/nostr-dev-kit/ndk/blob/master/ndk/src/ndk/index.ts#L707-L712 ). Not the cleanest workaround, but if you don't want to go down to the subscribe level you can always wrap or copy and paste fetchEvents to your own "fetchEventsWithTimeout" function, e.g. you can use Promise.race between fetchEvents and a timeout promise that automatically rejects the promise after a certain amount of time.