feat: add create account flow

This commit is contained in:
2024-03-28 15:12:43 +07:00
parent d3fa59d2b1
commit cbbf5eaf50
18 changed files with 714 additions and 152 deletions

View File

@@ -45,6 +45,21 @@ export function formatCreatedAt(time: number, message = false) {
return formated;
}
export function displayNsec(key: string, len: number) {
if (key.length <= len) return key;
const separator = " ... ";
const sepLen = separator.length;
const charsToShow = len - sepLen;
const frontChars = Math.ceil(charsToShow / 2);
const backChars = Math.floor(charsToShow / 2);
return (
key.substr(0, frontChars) + separator + key.substr(key.length - backChars)
);
}
export function displayNpub(pubkey: string, len: number) {
const npub = pubkey.startsWith("npub1")
? pubkey