PrivateStateProvider

Stores and retrieves dApp private state, encrypted on device.

Each contract has its own namespace. Private state is encrypted using Android KeyStore (hardware-backed on supported devices) with AES-GCM.

Inheritors

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun clearContract(contractAddress: String)

Remove all state entries for a contract.

Link copied to clipboard
abstract fun get(contractAddress: String, stateId: String): ByteArray?

Get private state bytes, or null if not stored.

Link copied to clipboard
abstract fun has(contractAddress: String, stateId: String): Boolean

Check if a state entry exists.

Link copied to clipboard
abstract fun isKeyStoreHealthy(): Boolean

Check if the encryption key is accessible.

Link copied to clipboard
abstract fun remove(contractAddress: String, stateId: String)

Remove a single state entry.

Link copied to clipboard
abstract fun set(contractAddress: String, stateId: String, data: ByteArray)

Store private state bytes. Max MAX_STATE_SIZE_BYTES per entry.