Initial commit: Nosterm client (terminal-style Nostr chat SPA)
ci / build (push) Successful in 1m3s
ci / image (push) Successful in 41s

This commit is contained in:
Robert Goodall
2026-07-24 13:47:53 -04:00
commit cd2b900639
147 changed files with 16504 additions and 0 deletions
@@ -0,0 +1,27 @@
import { getDb, type StoredIdentityRecord } from '../database';
const PRIMARY = 'primary';
/**
* storage for a remembered device identity. keeps ONLY the nip-49 ncryptsec
* (passphrase-encrypted secret key) — never a plaintext key. the mvp remembers
* a single identity under a fixed key.
*/
export const identityRepository = {
async get(): Promise<StoredIdentityRecord | undefined> {
return getDb().identities.get(PRIMARY);
},
async save(pubkey: string, ncryptsec: string): Promise<void> {
await getDb().identities.put({
key: PRIMARY,
pubkey,
ncryptsec,
savedAt: Date.now()
});
},
async clear(): Promise<void> {
await getDb().identities.delete(PRIMARY);
}
};