public void GetAccountHistory_Test() { var balances = _service.GetBalances().Result; var accountId = balances.Where(b => b.Type.Equals("trade")).Select(b => b.Id).FirstOrDefault(); var startDate = DateTime.UtcNow.AddDays(-5); var endDate = DateTime.UtcNow; var history = _service.GetAccountHistory(accountId, startDate, endDate).Result; Assert.NotNull(history); }
/// <summary> /// Get account history /// </summary> /// <param name="accountId">id of account</param> /// <param name="startAt">Start time</param> /// <param name="endAt">End time</param> /// <param name="page">Page number</param> /// <param name="pageSize">Page size</param> /// <returns>Paged response of account history</returns> public static async Task <PagedResponse <List <AccountAction> > > GetAccountHistory(this IKuCoinDotNet service, string accountId, DateTime startAt, DateTime endAt, int page = 0, int pageSize = 0) { if (startAt >= endAt) { throw new Exception("Start date cannot be >= End date."); } var _dtHelper = new DateTimeHelper(); var startNonce = _dtHelper.LocalToUnixTime(startAt); var endNonce = _dtHelper.LocalToUnixTime(endAt); return(await service.GetAccountHistory(accountId, startNonce, endNonce, page, pageSize)); }