mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 00:28:51 +00:00
nevent author is not mandatory.
This commit is contained in:
3
nip19.ts
3
nip19.ts
@@ -48,7 +48,8 @@ export function decode(nip19: string): {
|
|||||||
let tlv = parseTLV(data)
|
let tlv = parseTLV(data)
|
||||||
if (!tlv[0]?.[0]) throw new Error('missing TLV 0 for nevent')
|
if (!tlv[0]?.[0]) throw new Error('missing TLV 0 for nevent')
|
||||||
if (tlv[0][0].length !== 32) throw new Error('TLV 0 should be 32 bytes')
|
if (tlv[0][0].length !== 32) throw new Error('TLV 0 should be 32 bytes')
|
||||||
if (tlv[2]?.[0].length !== 32) throw new Error('TLV 2 should be 32 bytes')
|
if (tlv[2] && tlv[2][0].length !== 32)
|
||||||
|
throw new Error('TLV 2 should be 32 bytes')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: 'nevent',
|
type: 'nevent',
|
||||||
|
|||||||
Reference in New Issue
Block a user