Skip to content

Commit

Permalink
add correct paths
Browse files Browse the repository at this point in the history
  • Loading branch information
joan e committed Mar 19, 2024
1 parent a7deaf3 commit 8079e71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions wallet/concepts/wallet-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Make sure to handle errors for every call to
Dapps communicate with MetaMask through JSON-RPC methods.
These methods are divided into the following:

- **Unrestricted methods**: Allow dapps to perform basic actions without permission (for example retrieving a public address).
- **Restricted methods**: Require user consent for actions that impact assets or data (for example initiating a transaction).
- **Unrestricted methods** - Allow dapps to perform basic actions without permission (for example retrieving a public address).
- **Restricted methods** - Require user consent for actions that impact assets or data (for example initiating a transaction).

### Restricted methods

Expand All @@ -80,16 +80,20 @@ The following methods are restricted:
:::info note
To access accounts, we recommend using [`eth_requestAccounts`](/wallet/reference/eth_requestAccounts).
This method automatically obtains permissions for `eth_accounts` through an internal `wallet_requestPermissions` call.
See [how to access a user's accounts](access-accounts.md) for more information.
See [how to access a user's accounts](../how-to/connect/access-acounts.md) for more information.
:::

Granting permissions for `eth_accounts` or `eth_requestAccounts` also provides permissions for the following methods:
- [`eth_sendTransaction`](/wallet/reference/eth_sendTransaction)
- [`personal_sign`](/wallet/reference/personal_sign)
- [`eth_signTypedData_v4`](/wallet/reference/eth_signTypedData)
- [`eth_signTypedData_v4`](/wallet/reference/eth_signTypedData_v4)

- [`wallet_snap`](/wallet/reference/wallet_snap) - Gaining permission requires calling `wallet_requestSnap`.
- [`wallet_invokeSnap`](/wallet/reference/wallet_invokeSnap) - Gaining permission requires calling `wallet_requestSnap`.

:::info note
For more information on requesting permission to connect to `wallet_snap` and `wallet_invokeSnap`, see the example at the end of [About the Snaps APIs](../snaps/learn/about-snaps/apis/#custom-json-rpc-apis) page.
:::

### Unrestricted methods

Expand Down
4 changes: 2 additions & 2 deletions wallet/how-to/manage-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ the restricted method [`eth_accounts`](/wallet/reference/eth_accounts):
To access accounts, we recommend using [`eth_requestAccounts`](/wallet/reference/eth_requestAccounts),
which automatically asks for permission to use `eth_accounts` by calling `wallet_requestPermissions`
internally.
See [how to access a user's accounts](access-accounts.md) for more information.
Granting permission for `eth_accounts` also grants access to [`eth_sendTransaction`](/wallet/reference/eth_sendTransaction), [`personal_sign`](/wallet/reference/personal_sign), and [`eth_signTypedData_v4`](/wallet/reference/eth_signTypedData).
See [how to access a user's accounts](../how-to/connect/access-acounts) for more information.
Granting permission for `eth_accounts` also grants access to [`eth_sendTransaction`](/wallet/reference/eth_sendTransaction), [`personal_sign`](/wallet/reference/personal_sign), and [`eth_signTypedData_v4`](/wallet/reference/eth_signTypedData_v4).
:::

## Request permissions example
Expand Down

0 comments on commit 8079e71

Please sign in to comment.