Skip to main content
  • Snap

snap_clearState

Description

Clear the entire state of the Snap.

Parameters

object

An object containing the parameters for the snap_clearState method.

encrypted

boolean

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.

Use the encrypted state for sensitive data (such as private keys or secrets), and the unencrypted state for non-sensitive data that needs to be accessed while the client is locked.

Returns

null

This method does not return any data, so the result is always null.

Example

await snap.request({
method: "snap_clearState",
params: {
encrypted: true, // Optional, defaults to true
},
});