mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +00:00
cleanup + shakespeare-like manual zap modal
This commit is contained in:
1 parent
0bc03017bb
commit
8183e3cc5a
3 files changed
+129
-89
No files matched your search
@@ -12,32 +12,6 @@ import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { useNostr } from '@nostrify/react';
|
||||
import type { NostrEvent } from '@nostrify/nostrify';
|
||||
|
||||
// NWC utility functions
|
||||
function parseNWCUri(uri: string): NWCConnection | null {
|
||||
try {
|
||||
const url = new URL(uri);
|
||||
if (url.protocol !== 'nostr+walletconnect:') {
|
||||
return null;
|
||||
}
|
||||
|
||||
const walletPubkey = url.pathname.replace('//', '');
|
||||
const secret = url.searchParams.get('secret');
|
||||
const relayParam = url.searchParams.getAll('relay');
|
||||
|
||||
if (!walletPubkey || !secret || relayParam.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
connectionString: uri,
|
||||
alias: 'Parsed NWC',
|
||||
isConnected: false,
|
||||
};
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function useZaps(
|
||||
target: Event | Event[],
|
||||
webln: WebLNProvider | null,
|
||||
@@ -327,6 +301,5 @@ export function useZaps(
|
||||
isZapping,
|
||||
invoice,
|
||||
setInvoice,
|
||||
parseNWCUri,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user