Skip to content
docs

DeviceSecretStorage

Defined in: storage.ts:66

Device secret storage. Structurally a keyring SecretStorage (get / set / delete) plus what a wallet app needs around it.

capabilities(): Promise<NativeCapabilities>

Defined in: storage.ts:104

Promise<NativeCapabilities>


delete(id): Promise<void>

Defined in: storage.ts:77

string

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.

string

PromptText

Promise<string | null>


has(id): Promise<boolean>

Defined in: storage.ts:79

Is something stored under id — no prompt.

string

Promise<boolean>


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.

string

Promise<StoredSecretInfo | null>


list(): Promise<StoredSecretInfo[]>

Defined in: storage.ts:86

Every secret in this namespace — no prompt; protection as in info.

Promise<StoredSecretInfo[]>


migrateFrom(source, ids, options?): Promise<MigrationResult>

Defined in: storage.ts:103

Copy secrets from an older store, verify, then delete the old copies.

MigrationSource

Iterable<string>

MigrateOptions

Promise<MigrationResult>


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).

Iterable<string>

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.

string

string

SetSecretOptions

Promise<void>


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).

string

Protection

PromptText

Promise<void>