MetaMask / mm-docs-v2

MetaMask developer documentation v2
https://docs.metamask.io
Apache License 2.0
14 stars 5 forks source link

Improve guidelines for using wallet_getPermissions to get all accounts shared by the user #117

Open vandan opened 1 year ago

vandan commented 1 year ago

One point of confusion we have today is that the eth_requestAccounts method includes at most one account in the array that's returned (we plan to change this limitation). In the meantime, if the user granted permissions for more than one account, developers can get the full list by using the wallet_getPermissions method. While there is a Note with a hint in this section of the docs, developers may have trouble figuring out how to get all accounts from this method.

See more detail about how using this method can be confusing for developers in this slack thread. This question has come in a few conversations with developers.

At the same time, we have to be explicit about our guarantees around the wallet_getPermissions API. Specifically, we should not guarantee anything about the value of individual caveats in the caveat array, or the value of the parentCapability field, which are going to be subject to change in the future.