Indexed DBStorage Adapter
Storage adapter backed by the browser's IndexedDB API.
Recommended for production web applications. Provides structured storage with indexing support, larger storage limits than localStorage, and an async API that does not block the main thread.
Features:
Upsert semantics for credential saves (uses IndexedDB
put)Efficient contract ID lookups via an IndexedDB index
Transactional data integrity for all operations
Automatic database schema migration via version management
Binary data support without serialization overhead
Schema:
Object store
credentials: keyPathcredentialId, index oncontractIdObject store
sessions: keyPathkey
Example:
val storage = IndexedDBStorageAdapter()
storage.save(credential)
val all = storage.getAll()
val byContract = storage.getByContract("CABC...")
storage.close()Parameters
Database name. Defaults to stellar_smart_account.
Functions
Clears the current session.
Deletes the entire IndexedDB database.
Retrieves a credential by its ID.
Retrieves all stored credentials.
Retrieves all credentials associated with a contract address.
Retrieves the current session.
Saves a credential to storage using upsert semantics.
Saves a session to storage.
Updates a credential with partial changes.