nip19/nip49: remove nrelay and move bech32 string guard methods from core to nip19.

This commit is contained in:
fiatjaf
2024-09-09 14:20:12 -03:00
parent ee76d69b4b
commit 45b25c5bf5
6 changed files with 22 additions and 52 deletions

View File

@@ -5,7 +5,6 @@ import {
naddrEncode,
nprofileEncode,
npubEncode,
nrelayEncode,
nsecEncode,
neventEncode,
type AddressPointer,
@@ -152,12 +151,3 @@ test('decode naddr from go-nostr with different TLV ordering', () => {
expect(pointer.kind).toEqual(30023)
expect(pointer.identifier).toEqual('banana')
})
test('encode and decode nrelay', () => {
let url = 'wss://relay.nostr.example'
let nrelay = nrelayEncode(url)
expect(nrelay).toMatch(/nrelay1\w+/)
let { type, data } = decode(nrelay)
expect(type).toEqual('nrelay')
expect(data).toEqual(url)
})