Upgrade nspec, parse nsec the easier way

This commit is contained in:
Alex Gleason
2024-02-18 18:00:37 -06:00
parent 15ae362a8e
commit f2bfa6e2f6
3 changed files with 6 additions and 10 deletions

View File

@ -34,11 +34,7 @@ export class NKeyStorage implements ReadonlyMap<string, NostrSigner> {
}
#dataSchema() {
return n.json().pipe(z.set(this.#nsecSchema()));
}
#nsecSchema() {
return n.bech32().refine((v): v is `nsec1${string}` => v.startsWith('nsec1'), { message: 'Invalid secret key' });
return n.json().pipe(z.set(n.bech32('nsec')));
}
#syncStorage() {