diff options
| author | polwex <polwex@sortug.com> | 2025-11-18 09:43:16 +0700 |
|---|---|---|
| committer | polwex <polwex@sortug.com> | 2025-11-18 09:43:16 +0700 |
| commit | a465c73178dc621578d10312f263355f0f2d5309 (patch) | |
| tree | 08a0b655835d4c08d45e8e3e8f52601f7911044b /gui/src/logic | |
| parent | 7706acaafa89691dba33c216e6287a8405c4c302 (diff) | |
fixes to profile handling and rendering
Diffstat (limited to 'gui/src/logic')
| -rw-r--r-- | gui/src/logic/nostr.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gui/src/logic/nostr.ts b/gui/src/logic/nostr.ts index b85047f..7da9b91 100644 --- a/gui/src/logic/nostr.ts +++ b/gui/src/logic/nostr.ts @@ -12,6 +12,16 @@ export function generateNevent(event: Event) { return nev; } +export function generateNpub(pubkey: string) { + const npub = nip19.npubEncode(pubkey); + return npub; +} +export function generateNprofile(pubkey: string) { + const prof = { pubkey }; + const nprofile = nip19.nprofileEncode(prof); + return nprofile; +} + // let sk = generateSecretKey() // let nsec = nip19.nsecEncode(sk) // let { type, data } = nip19.decode(nsec) |
