import { nip19 } from 'nostr-tools' // Helper function to convert bech32 to hex using nostr-tools export function bech32ToHex(bech32Key: string): string { if (bech32Key.startsWith('npub1') || bech32Key.startsWith('nsec1')) { const { type, data } = nip19.decode(bech32Key) return data as string } // Already hex format return bech32Key }