Skip to content

Commit 46d9471

Browse files
committed
Remove unnecessary NDK initialization and external relay connections
- Remove NDK initialization since login uses window.nostr directly - Remove external relay URLs (relay.damus.io, relay.snort.social, etc.) - Profile API uses panel API instead of direct relay connections - Eliminates WebSocket connection errors to external relays - Simplifies app startup and reduces external dependencies - All Nostr operations now go through panel API or browser extension
1 parent 0cd82b6 commit 46d9471

2 files changed

Lines changed: 3 additions & 30 deletions

File tree

src/App.tsx

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect } from 'react';
1+
import React from 'react';
22
import { ConfigProvider } from 'antd';
33
import { HelmetProvider } from 'react-helmet-async';
44
import deDe from 'antd/lib/locale/de_DE';
@@ -13,32 +13,11 @@ import { usePWA } from './hooks/usePWA';
1313
import { useThemeWatcher } from './hooks/useThemeWatcher';
1414
import { useAppSelector } from './hooks/reduxHooks';
1515
import { themeObject } from './styles/themes/themeVariables';
16-
import NDK, { NDKNip07Signer, NDKRelayAuthPolicies } from '@nostr-dev-kit/ndk';
17-
import { useNDKInit } from '@nostr-dev-kit/ndk-hooks';
18-
import config from './config/config';
19-
20-
// Configure NDK with user's relay URLs from environment variables
21-
const ndk = new NDK({
22-
explicitRelayUrls: config.nostrRelayUrls,
23-
signer: new NDKNip07Signer(),
24-
});
25-
26-
// Set up NIP-42 authentication policy following the example
27-
ndk.relayAuthDefaultPolicy = NDKRelayAuthPolicies.signIn({ ndk });
28-
29-
ndk
30-
.connect()
31-
.then(() => console.log('NDK connected with relay URLs and NIP-42 auth policy:', config.nostrRelayUrls))
32-
.catch((error) => console.error('NDK connection error:', error));
16+
// NDK removed - login uses window.nostr directly, profile API uses panel API
3317

3418
const App: React.FC = () => {
3519
const { language } = useLanguage();
3620
const theme = useAppSelector((state) => state.theme.theme);
37-
const initializeNDK = useNDKInit();
38-
39-
useEffect(() => {
40-
initializeNDK(ndk);
41-
}, [initializeNDK]);
4221

4322
usePWA();
4423

src/config/config.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ const config = {
2020
// Wallet operations now routed through panel API - always enabled
2121
isWalletEnabled: true,
2222

23-
// Nostr relay configuration
24-
nostrRelayUrls: process.env.REACT_APP_NOSTR_RELAY_URLS?.split(',').map(url => url.trim()) || [
25-
'wss://relay.damus.io',
26-
'wss://relay.nostr.band',
27-
'wss://relay.snort.social',
28-
'wss://vault.iris.to'
29-
],
23+
// Nostr relay configuration removed - using panel API for all operations
3024

3125

3226
// Notification settings

0 commit comments

Comments
 (0)