Manage permissions
To call a restricted RPC method, your dapp must request permission from the user using
the wallet_requestPermissions
RPC method.
You can get the user's current permissions using wallet_getPermissions
,
and revoke permissions previously granted to your dapp using
wallet_revokePermissions
.
These methods are specified by EIP-2255 and
MIP-2.
wallet_requestPermissions
creates a confirmation asking the user to connect to an account and
allow the dapp to call the requested method.
The confirmation screen describes the functions and data the requested method can access.
For example, something like the following confirmation displays when you request permission to call
the restricted method eth_accounts
:
To access accounts, we recommend using eth_requestAccounts
,
which automatically asks for permission to use eth_accounts
by calling wallet_requestPermissions
internally.
See how to access a user's accounts for more information.
Granting permission for eth_accounts
also grants access to eth_sendTransaction
, personal_sign
, and eth_signTypedData_v4
.