GitRepublic Logo

gitrepublic

Repositories Search Register Docs API Docs
{#if userPubkey} {@const userNpub = (() => { try { // Check if it's already an npub if (userPubkey.startsWith('npub')) { return userPubkey; } // Try to decode first (might already be npub) try { const decoded = nip19.decode(userPubkey); if (decoded.type === 'npub') { return userPubkey; } } catch { // Not an npub, continue to encode } // Convert hex pubkey to npub return nip19.npubEncode(userPubkey); } catch { // If all fails, return as-is (will be handled by route) return userPubkey; } })()} {:else} {/if}