diff --git a/src/index.ts b/src/index.ts index 05fce535..886202be 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,8 +9,6 @@ import { initMainHandler } from './services/main/init.js'; import { LoadMainSettingsFromEnv } from './services/main/settings.js'; import { nip19 } from 'nostr-tools' //@ts-ignore -import { WebSocket } from 'ws' -Object.assign(global, { WebSocket: WebSocket }); const { nprofileEncode } = nip19 const start = async () => { diff --git a/src/services/nostr/handler.ts b/src/services/nostr/handler.ts index 2de233ef..b9823c73 100644 --- a/src/services/nostr/handler.ts +++ b/src/services/nostr/handler.ts @@ -1,4 +1,6 @@ //import { SimplePool, Sub, Event, UnsignedEvent, getEventHash, signEvent } from 'nostr-tools' +import * as ws from 'ws' +Object.assign(global, { WebSocket: ws }); import { SimplePool, Event, UnsignedEvent, getEventHash, finalizeEvent, Relay, nip44 } from 'nostr-tools' //import { encryptData, decryptData, getSharedSecret, decodePayload, encodePayload, EncryptedData, nip44 } from 'nostr-tools' import { ERROR, getLogger } from '../helpers/logger.js'