move and typed relay related code to relays.ts
upgrade nostr-tools to latest greatest, major version with
breaking changes:
- relayPool is gone in favor of SimplePool, but this commit just
used relayInit directly as relays should become configurable at
some point
mining may take a long time if the mining difficulty is high.
calculating pow for text notes, upvotes and profile meta
data now has a timeout of 10s. if the timeout exceeds a user
facing error is shown with the option to try again.
the error is currently very basic, and only displays timeout -
something went wrong, cancel and try again button.
added pow to text notes, reactions and metadata events. pow is
mined async in a worker so that the main process does not freeze.
noxy profile images, link and image previews are now now only
invoked if an event has some valid work proof. noxy can decide
if there is enough work and whether or not to serve data for a
certain event.
target difficulty can be implemented in a later step, this change
only check if there is any valid nonce tag with commitment target
greater than 0.