async function nwcTryRun (fun, { nwcUrl }, { signal }) {
  const nostr = new Nostr()
  try {
    const nwc = await getNwc(nostr, nwcUrl, { signal })
    return await fun(nwc)
  } catch (e) {
    if (e.error) throw new Error(e.error.message || e.error.code)
    throw e
  } finally {
    nostr.close()
  }
}
Run a nwc function and throw if it errors
(workaround to handle ambiguous NDK error handling)
@param {function} fun - the nwc function to run
@returns - the result of the nwc function