DeviceSecretStorage
Defined in: storage.ts:66
Device secret storage. Structurally a keyring SecretStorage
(get / set / delete) plus what a wallet app needs around it.
Methods
Section titled “Methods”capabilities()
Section titled “capabilities()”capabilities():
Promise<NativeCapabilities>
Defined in: storage.ts:104
Returns
Section titled “Returns”Promise<NativeCapabilities>
delete()
Section titled “delete()”delete(
id):Promise<void>
Defined in: storage.ts:77
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
get(
id,options?):Promise<string|null>
Defined in: storage.ts:68
The secret, after the OS sheet. null when nothing is stored under id.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”prompt?
Section titled “prompt?”Returns
Section titled “Returns”Promise<string | null>
has(
id):Promise<boolean>
Defined in: storage.ts:79
Is something stored under id — no prompt.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<boolean>
info()
Section titled “info()”info(
id):Promise<StoredSecretInfo|null>
Defined in: storage.ts:84
Public facts about one secret — no prompt. protection is the weakest among the copies
stored: an older copy left behind by a failed removal counts until it is gone.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<StoredSecretInfo | null>
list()
Section titled “list()”list():
Promise<StoredSecretInfo[]>
Defined in: storage.ts:86
Every secret in this namespace — no prompt; protection as in info.
Returns
Section titled “Returns”Promise<StoredSecretInfo[]>
migrateFrom()
Section titled “migrateFrom()”migrateFrom(
source,ids,options?):Promise<MigrationResult>
Defined in: storage.ts:103
Copy secrets from an older store, verify, then delete the old copies.
Parameters
Section titled “Parameters”source
Section titled “source”Iterable<string>
options?
Section titled “options?”Returns
Section titled “Returns”Promise<MigrationResult>
prune()
Section titled “prune()”prune(
keep):Promise<string[]>
Defined in: storage.ts:101
Delete every secret whose id is not in keep and return those ids. Run it
on start-up against the app’s own account list: the iOS Keychain outlives
an uninstall, the app’s metadata does not. Older copies of the kept secrets
left by a failed removal are removed too (rejects with stale-copy when one stays).
Parameters
Section titled “Parameters”Iterable<string>
Returns
Section titled “Returns”Promise<string[]>
set(
id,secret,options?):Promise<void>
Defined in: storage.ts:76
Store or replace. The new version is written to a fresh slot first and the
old one removed only afterwards, so a failed write never loses the secret.
Never prompts on iOS; prompts once on Android (Keystore keys need the user for every use).
Rejects with stale-copy when the new version is stored but an older copy could not be
removed; the store retries that removal on its next operation.
Parameters
Section titled “Parameters”string
secret
Section titled “secret”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
setProtection()
Section titled “setProtection()”setProtection(
id,protection,options?):Promise<void>
Defined in: storage.ts:94
Switch one secret between biometricsOrPasscode and biometricsOnly.
Reads it (one sheet) and writes it again under the new access control.
Resolves only once no copy under the old protection is left: rejects with stale-copy
when the new copy is stored but the old one could not be removed. Calling it again
retries the removal (no sheet when the newest copy already has protection).
Parameters
Section titled “Parameters”string
protection
Section titled “protection”options?
Section titled “options?”prompt?
Section titled “prompt?”Returns
Section titled “Returns”Promise<void>