Skip to main content
  • Snap

snap_setState

Description

snap_setState sets the state of the Snap.

Parameters

key

string | null

The key of the state to update. If not provided, the entire state is updated. This may contain Lodash-style path syntax, e.g., a.b.c, with the exception of array syntax.

value

Json

The value to set the state to.

encrypted

boolean | null

Whether to use the separate encrypted state, or the unencrypted state. Defaults to the encrypted state. Encrypted state can only be used if the client is unlocked, while unencrypted state can be used whether the client is locked or unlocked.