UNPKG

@metamask/snaps-sdk

Version:

A library containing the core functionality for building MetaMask Snaps

1 lines 1 kB
{"version":3,"file":"set-state.cjs","sourceRoot":"","sources":["../../../src/types/methods/set-state.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\n/**\n * The request parameters for the `snap_setState` method.\n *\n * @property key - The key of the state to update. If not provided, the entire\n * state is updated. This may contain Lodash-style path syntax, e.g.,\n * `a.b.c`, with the exception of array syntax.\n * @property value - The value to set the state to.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the client is unlocked, while unencrypted state can be used\n * whether the client is locked or unlocked.\n */\nexport type SetStateParams = {\n key?: string;\n value: Json;\n encrypted?: boolean;\n};\n\n/**\n * The result returned by the `snap_setState` method.\n */\nexport type SetStateResult = null;\n"]}