Replies: 3 comments 1 reply
-
This is the exact issue we're also running into while integrating snaps to our dapp |
Beta Was this translation helpful? Give feedback.
0 replies
-
We have the exact same problem as well |
Beta Was this translation helpful? Give feedback.
1 reply
-
This issue has been open for quite some time. Hope it's getting addressed |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
I'm a member of the Masca team, and I have a question regarding an issue we're currently tackling.
To paint a picture of our goals, we're using the account address as a salt parameter for the
snap_getEntropy
RPC method to obtain unique and deterministic entropy, which we then convert into a mnemonic usingEthers.js
. We then use this mnemonic in conjunction with theEthers.js
library to create accounts for various DIDs we use. Our approach to using mnemonic is to ensure the generation of a distinct account for every DID method and to facilitate key rotation (e.g.,m/44/1236/${methodIndexMapping[method]}/0/${keyRotationIndex}
).Our current dilemma involves the process of switching accounts in MetaMask. Presently, we use a custom RPC method,
setCurrentAddress
, which our dApp calls whenever anaccountsChanged
event occurs. While this approach is functional, it introduces redundant code into dApps using Masca. Hence, we considered migrating this logic into the snap using theeth_requestAccounts
method. However, this introduces an additional popup in the snap. Moreover, we found out that the popup only appears once. The first X accounts selected by the user when they connect for the first time are the only ones that work. This means if the user wants to switch to a different account, not included in the accounts he selected during the initial flow, the RPC method will return the wrong address. Returned address will be of the last used connected account.Example:
eth_accounts
method returns the address of Account 1Is there a straightforward method to obtain only the address of the currently selected account in Snap (similar to the eth_accounts usage in dApps), without going through the whole process of connecting to Snap? If not, is that something that might be added to Snaps API?
I would greatly appreciate your thoughts and suggestions on resolving this issue.
Best regards,
Andy
Beta Was this translation helpful? Give feedback.
All reactions