From d7dcc75ebeb69af0319a4adbf5c7f382a9d28a74 Mon Sep 17 00:00:00 2001 From: Asai Toshiya Date: Tue, 22 Oct 2024 22:47:51 +0900 Subject: [PATCH] nip19: completely remove nrelay. --- nip19.test.ts | 20 -------------------- nip19.ts | 2 -- 2 files changed, 22 deletions(-) diff --git a/nip19.test.ts b/nip19.test.ts index 176b8b6..7654c68 100644 --- a/nip19.test.ts +++ b/nip19.test.ts @@ -172,26 +172,6 @@ describe('NostrTypeGuard', () => { expect(is).toBeFalse() }) - test('isNRelay', () => { - const is = NostrTypeGuard.isNRelay('nrelay1qqt8wumn8ghj7un9d3shjtnwdaehgu3wvfskueq4r295t') - - expect(is).toBeTrue() - }) - - test('isNRelay with invalid nrelay', () => { - const is = NostrTypeGuard.isNRelay('nrelay1qqt8wumn8ghj7un9d3shjtnwdaehgu3wvfskueã4r295t') - - expect(is).toBeFalse() - }) - - test('isNRelay with invalid nrelay', () => { - const is = NostrTypeGuard.isNRelay( - 'nevent1qqst8cujky046negxgwwm5ynqwn53t8aqjr6afd8g59nfqwxpdhylpcpzamhxue69uhhyetvv9ujuetcv9khqmr99e3k7mg8arnc9', - ) - - expect(is).toBeFalse() - }) - test('isNEvent', () => { const is = NostrTypeGuard.isNEvent( 'nevent1qqst8cujky046negxgwwm5ynqwn53t8aqjr6afd8g59nfqwxpdhylpcpzamhxue69uhhyetvv9ujuetcv9khqmr99e3k7mg8arnc9', diff --git a/nip19.ts b/nip19.ts index 94acfc2..cf04c5d 100644 --- a/nip19.ts +++ b/nip19.ts @@ -4,7 +4,6 @@ import { bech32 } from '@scure/base' import { utf8Decoder, utf8Encoder } from './utils.ts' export type NProfile = `nprofile1${string}` -export type NRelay = `nrelay1${string}` export type NEvent = `nevent1${string}` export type NAddr = `naddr1${string}` export type NSec = `nsec1${string}` @@ -14,7 +13,6 @@ export type Ncryptsec = `ncryptsec1${string}` export const NostrTypeGuard = { isNProfile: (value?: string | null): value is NProfile => /^nprofile1[a-z\d]+$/.test(value || ''), - isNRelay: (value?: string | null): value is NRelay => /^nrelay1[a-z\d]+$/.test(value || ''), isNEvent: (value?: string | null): value is NEvent => /^nevent1[a-z\d]+$/.test(value || ''), isNAddr: (value?: string | null): value is NAddr => /^naddr1[a-z\d]+$/.test(value || ''), isNSec: (value?: string | null): value is NSec => /^nsec1[a-z\d]{58}$/.test(value || ''),