public async Task <ResultWrapper <Key[]> > vault_listKeys(string vaultId) { try { var keys = await _vaultService.ListKeys(Guid.Parse(vaultId)); return(ResultWrapper <Key[]> .Success(keys.ToArray())); } catch (Exception e) { return(ResultWrapper <Key[]> .Fail(e)); } }
public async Task <Address[]> GetAccounts() { IEnumerable <Key> keys = await _vaultService.ListKeys(_vaultId); _accounts = new ConcurrentDictionary <Address, Guid>( keys.Where(k => k.Id != null).Select(ToKeyValuePair)); if (_logger.IsTrace) { foreach (var key in keys) { _logger.Trace($"Retrieved key {key.Address} {key.Id} from vault {key.VaultId} (intended vault {_vaultId})"); } } return(_accounts.Keys.ToArray()); }