function* mapAccountsId(accounts) {
  const idByName = new Map();
  for (const [name, currency] of accounts.entries()) {
    let account = yield select(getAccountByName(name));
    if (!account) account = yield createNewAccount(name, [...currency]);

    idByName.set(name, account.id);
  }

  return idByName;
}
Map account name to account ID.
If no account found in local accounts, create new one.

@param {Map} accounts name => set of currencies map
@return {Map} account name => account id map