lots of login dialog and nostr subsription relate updates
This commit is contained in:
parent
ed1b4cb22a
commit
d694f9b645
8 changed files with 323 additions and 189 deletions
|
|
@ -105,4 +105,19 @@ export function npubToHex(npub: string): string {
|
|||
|
||||
export function hexToNpub(hex: string): string {
|
||||
return window.NostrTools.nip19.npubEncode(hex)
|
||||
}
|
||||
|
||||
export function isValidPrivateKey(key: string): boolean {
|
||||
try {
|
||||
if (!/^[0-9a-fA-F]{64}$/.test(key)) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
export function formatPrivateKey(key: string): string {
|
||||
return key.trim().toLowerCase()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue