UNPKG

@lightninglabs/lnc-web

Version:

Lightning Node Connect npm module for web

44 lines 1.79 kB
import { PasskeyEncryptionService } from '../encryption/passkeyEncryptionService'; import { UnlockOptions } from '../types/lightningNodeConnect'; import { BaseCredentialRepository } from './credentialRepository'; /** * Passkey-based credential repository. * Uses localStorage directly for storage and PasskeyEncryptionService for encryption. */ export declare class PasskeyCredentialRepository extends BaseCredentialRepository { private encryption; constructor(namespace: string, encryption: PasskeyEncryptionService); /** * Unlock the underlying encryption service using an existing or newly * created passkey credential, persisting the credential ID if needed. */ unlock(options: UnlockOptions): Promise<void>; /** * Load and decrypt a credential value by key, or return undefined * if no value is stored or decryption fails. */ getCredential(key: string): Promise<string | undefined>; /** * Encrypt and persist a credential value under the given key. * Throws if the repository has not been unlocked. */ setCredential(key: string, value: string): Promise<void>; /** * Returns true when the underlying encryption service is unlocked. */ get isUnlocked(): boolean; /** * Check if this repository has stored authentication data (credential ID) */ get hasStoredAuthData(): boolean; /** * Return the stored passkey credential ID, if any. Consumer apps can use * this to reuse a passkey across namespaces (e.g. multi-node setups). */ get storedCredentialId(): string | undefined; /** * Lock the underlying encryption service and clear in-memory key material. */ lock(): void; } //# sourceMappingURL=passkeyCredentialRepository.d.ts.map