public AccountVm(NextClient client, Account account) { _client = client; Account = account; Ledgers = new ObservableCollection<Ledger>(); Trades = new ObservableCollection<Trade>(); Positions = new ObservableCollection<Position>(); Orders = new ObservableCollection<OrderStatus>(); }
/// <summary> /// https://api.test.nordnet.se/projects/api/wiki/REST_API_documentation#Exchange-trades /// </summary> /// <param name="account"></param> /// <returns></returns> public async Task<List<Trade>> AccountTrades(Account account) { var request = new RestRequest(string.Format("accounts/{0}/trades", account.Id), Method.GET); IRestResponse<List<Trade>> response = await Client.ExecuteTaskAsync<List<Trade>>(request); ResetTouchTimer(); return response.Data; }
/// <summary> /// https://api.test.nordnet.se/projects/api/wiki/REST_API_documentation#Get-account-summary /// </summary> /// <param name="account"></param> /// <returns></returns> public async Task<AccountSummary> AccountSummary(Account account) { var request = new RestRequest("accounts/" + account.Id, Method.GET); IRestResponse<AccountSummary> response = await Client.ExecuteTaskAsync<AccountSummary>(request); ResetTouchTimer(); return response.Data; }