Connect to multiple Nostr relays. Sync NIP-65 relay list

This commit is contained in:
Alex Gleason committed 2025-11-04 22:27:15 -06:00
1 parent 31f303b192
commit d79ed7df68
20 files changed
+468 -254

No files matched your search

+4 -1
View File
@@ -41,7 +41,10 @@ describe('useAIProjectId', () => {
mockUseAppContext.mockReturnValue({
config: {
theme: 'dark',
relayUrl: 'wss://relay.damus.io',
relayMetadata: {
relays: [{ url: 'wss://relay.damus.io', read: true, write: true }],
updatedAt: 0,
},
projectTemplate: 'https://github.com/example/template',
esmUrl: 'https://esm.sh',
corsProxy: 'https://proxy.example.com/{href}',
+4 -1
View File
@@ -33,7 +33,10 @@ function createWrapper(corsProxy: string) {
return function Wrapper({ children }: { children: React.ReactNode }) {
const defaultConfig: AppConfig = {
theme: 'light',
relayUrl: 'wss://relay.test',
relayMetadata: {
relays: [{ url: 'wss://relay.test', read: true, write: true }],
updatedAt: 0,
},
projectTemplate: 'https://gitlab.com/soapbox-pub/mkstack.git',
esmUrl: 'https://esm.test',
corsProxy,
+5 -2
View File
@@ -194,10 +194,13 @@ export function useZaps(
const zapAmount = amount * 1000; // convert to millisats
const writeRelays = config.relayMetadata.relays
.filter(r => r.write)
.map(r => r.url);
const zapRequest = nip57.makeZapRequest({
event: actualTarget,
amount: zapAmount,
relays: [config.relayUrl],
relays: writeRelays.length > 0 ? writeRelays : ['wss://relay.nostr.band'],
comment
});
@@ -255,7 +258,7 @@ export function useZaps(
});
}
}
if (webln) { // Try WebLN next
try {
await webln.sendPayment(newInvoice);