UNPKG

accounts

Version:

Tempo Accounts SDK

27 lines 1.23 kB
import { webCryptoP256 } from './keystores/webCryptoP256.js'; /** * Signals that the key behind a persisted handle is permanently gone * (e.g. hardware key deleted, app keychain wiped). Thrown from * {@link Keystore.toAccount}, it evicts the access-key record so callers fall * back to authorizing a fresh key. Keystores composing multiple backends * should treat it as an ownership claim: do not route the handle to another * backend. */ export class KeyUnavailableError extends Error { constructor(message, options) { super(message ?? 'Keystore key material is permanently unavailable.', options); this.name = 'Keystore.KeyUnavailableError'; } } /** Returns whether an error signals permanently unavailable key material. */ export function isKeyUnavailableError(error) { if (error instanceof KeyUnavailableError) return true; return error instanceof Error && error.name === 'Keystore.KeyUnavailableError'; } export { p256 } from './keystores/p256.js'; export { secp256k1 } from './keystores/secp256k1.js'; export { webCryptoP256 }; /** Built-in default keystores used when none are configured. */ export const defaults = { p256: webCryptoP256() }; //# sourceMappingURL=Keystore.js.map