Skip to main content
  • Snap
  • Restricted

snap_manageState

Description

Allow the Snap to persist up to 64 MB of data to disk and retrieve it at will. By default, the data is automatically encrypted using a Snap-specific key and automatically decrypted when retrieved. You can set encrypted to false to use unencrypted storage (available when the client is locked).

Parameters

operation

"clear" | "get" | "update"required

The operation to perform on the state.

encrypted

boolean | null

Whether to use the separate encrypted state, or the unencrypted state. Defaults to the encrypted state.

Returns

Record<string, Json> | null

If the operation is get, the result is the state. Otherwise, the result is null.

Example

{
"initialPermissions": {
"snap_manageState": {}
}
}