fix useWebSocketImplementation so it works with pool on nodejs esm.

This commit is contained in:
fiatjaf
2024-05-29 13:37:45 -03:00
parent 4f1dc9ef1c
commit 87a91c2daf
8 changed files with 60 additions and 23 deletions

View File

@@ -104,8 +104,11 @@ relay.close()
To use this on Node.js you first must install `ws` and call something like this:
```js
import { useWebSocketImplementation } from 'nostr-tools/relay'
useWebSocketImplementation(require('ws'))
import { useWebSocketImplementation } from 'nostr-tools/pool'
// or import { useWebSocketImplementation } from 'nostr-tools/relay' if you're using the Relay directly
import WebSocket from 'ws'
useWebSocketImplementation(WebSocket)
```
### Interacting with multiple relays
@@ -197,7 +200,7 @@ declare global {
### Generating NIP-06 keys
```js
import {
import {
privateKeyFromSeedWords,
accountFromSeedWords,
extendedKeysFromSeedWords,