When coding an application that looks to be metamask compatible how are multiple account handled by meta mask ? how can i make sure that metamask / my app are in sync account-wise ?
does metamask set the
According to Metamask's docs (https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md):
When a user selects an account in MetaMask, that account silently becomes the web3.eth.accounts in your JS context, the only member of the web3.eth.accounts array.
So, by default, anytime you check for web3.eth.accounts it will refer to the currently selected account in Metamask.
The user chooses
web3.eth.defaultAccount, the option is not available to your web application. Although, you can query