Skip to main content

Request permissions

To access certain powerful JavaScript globals or API methods, a Snap must ask the user for permission. Snaps follow the EIP-2255 wallet permissions specification, and you must specify a Snap's required permissions (except for dynamic permissions) in the initialPermissions field of the manifest file.

RPC API permissions

You must request permission to use any restricted JSON-RPC API methods.

For example, to request to use snap_dialog, add the following to the manifest file:

"initialPermissions": {
"snap_dialog": {}
},

Endowments

Endowments are a type of permission. See the Snaps permissions reference for the full list of endowments you can specify in the manifest file.

For example, to request the endowment:network-access permission, add the following to the manifest file:

"initialPermissions": {
"endowment:network-access": {}
},

Dynamic permissions

Dynamic permissions are not requested in the manifest file. Instead, your Snap can acquire dynamic permissions during its lifecycle.

For example, your Snap can request permission to call the Ethereum provider's eth_accounts RPC method by calling the provider's eth_requestAccounts RPC method.

See the eth_accounts Dynamic Permission for more information.