feat: nip19/21 links

This commit is contained in:
2023-03-25 22:55:34 +00:00
parent 12f82372e5
commit 9b6e5090dc
21 changed files with 282 additions and 137 deletions

View File

@ -11,6 +11,7 @@ export enum NostrPrefix {
Profile = "nprofile",
Event = "nevent",
Relay = "nrelay",
Address = "naddr",
}
export enum TLVEntryType {
@ -43,7 +44,7 @@ export function encodeTLV(hex: string, prefix: NostrPrefix, relays?: string[]) {
})
.flat() ?? [];
return bech32.encode(prefix, bech32.toWords([...tl0, ...tl1]));
return bech32.encode(prefix, bech32.toWords([...tl0, ...tl1]), 1_000);
}
export function decodeTLV(str: string) {