@armada/sdk / index / IndexedDBStorageAdapter
Class: IndexedDBStorageAdapter
Defined in: src/storage/indexeddb.ts:42
IndexedDB-backed KV. Values are stored as Uint8Array (structured-clone native). dbName scopes the database — pass a per-app name. open() takes an origin-scoped EXCLUSIVE Web Lock on dbName (held until close()): IndexedDB itself allows many connections to one DB, but the SDK's scan-state read-modify-write is not safe across instances, so a second live instance on the same DB fails loud with StorageConflictError instead of silently corrupting shared scan state.
Implements
Constructors
Constructor
new IndexedDBStorageAdapter(
dbName):IndexedDBStorageAdapter
Defined in: src/storage/indexeddb.ts:46
Parameters
dbName
string
Returns
IndexedDBStorageAdapter
Methods
open()
open(
namespace):Promise<{reset:boolean; }>
Defined in: src/storage/indexeddb.ts:101
Bind the store to namespace. Returns { reset: true } when a namespace mismatch (a redeploy under a preserved identity) triggered a chain-state reset, so the instance can surface it as telemetry.
Parameters
namespace
Returns
Promise<{ reset: boolean; }>
Implementation of
get()
get(
key):Promise<Uint8Array<ArrayBufferLike> |undefined>
Defined in: src/storage/indexeddb.ts:115
Parameters
key
string
Returns
Promise<Uint8Array<ArrayBufferLike> | undefined>
Implementation of
put()
put(
key,value):Promise<void>
Defined in: src/storage/indexeddb.ts:120
Parameters
key
string
value
Uint8Array
Returns
Promise<void>
Implementation of
del()
del(
key):Promise<void>
Defined in: src/storage/indexeddb.ts:126
Parameters
key
string
Returns
Promise<void>
Implementation of
list()
list(
prefix):AsyncIterable<{key:string;value:Uint8Array; }>
Defined in: src/storage/indexeddb.ts:132
Iterate entries whose key starts with prefix (ordered).
Parameters
prefix
string
Returns
AsyncIterable<{ key: string; value: Uint8Array; }>
Implementation of
resetChainState()
resetChainState():
Promise<void>
Defined in: src/storage/indexeddb.ts:144
Targeted reset of chain-derived namespaces, preserving identity records.
Returns
Promise<void>
Implementation of
StorageAdapter.resetChainState
close()
close():
Promise<void>
Defined in: src/storage/indexeddb.ts:153
Returns
Promise<void>