async syncAccountMapping() {
    let accounts = (await this.getAccountMapping()) || []
    //exclude any that were removed from the wallet
    accounts = accounts.filter(({ address }) => web3.eth.accounts.wallet[address])
    //include any that were added to the wallet
    this.getAddresses().filter(address => !accounts.find(account => account.address === address)).forEach(address => {
      accounts.push({ address })
    })
    //update listeners
    this.fireEvent(Events.AVAILABLE_ACCOUNTS, { accounts })
    await storeData(ACCOUNT_MAPPING, accounts)
    return accounts
  }
//reconcile, store, and emit account objects
reconcile, store, and emit account objects
reconcile store and emit account objects
async syncAccountMapping() {
    let accounts = (await this.getAccountMapping()) || []
    accounts = accounts.filter(({ address }) => web3.eth.accounts.wallet[address])
    this.getAddresses().filter(address => !accounts.find(account => account.address === address)).forEach(address => {
      accounts.push({ address })
    })
    this.fireEvent(Events.AVAILABLE_ACCOUNTS, { accounts })
    await storeData(ACCOUNT_MAPPING, accounts)
    return accounts
  }
async syncAccountMapping ( ) { let accounts = ( await this . getAccountMapping ( ) ) || [ ] accounts = accounts . filter ( ( { address } ) => web3 . eth . accounts . wallet [ address ] ) this . getAddresses ( ) . filter ( address => ! accounts . find ( account => account . address === address ) ) . forEach ( address => { accounts . push ( { address } ) } ) this . fireEvent ( Events . AVAILABLE_ACCOUNTS , { accounts } ) await storeData ( ACCOUNT_MAPPING , accounts ) return accounts }
reconcile, store, and emit account objects
reconcile store and emit account objects
//exclude any that were removed from the wallet //include any that were added to the wallet //update listeners