private static void GetRepayment() { var client = new CrossMarginClient(Config.AccessKey, Config.SecretKey); var request = new GetRepaymentRequest { accountId = Config.AccountId, currency = "htusdt" }; var result = client.GetRepayment(request).Result; if ((result.code == (int)ResponseCode.Success) && result.data != null) { AppLogger.Info($"Get repayment success, count: {result.data.Length}"); foreach (var r in result.data) { AppLogger.Info($"Repay id: {r.repayId}, time: {r.repayTime}, currency: {r.currency}, amount: {r.repaidAmount}"); } } else { AppLogger.Error($"Get repayment error, code: {result.code}, message: {result.message}"); } }
/// <summary> /// Returns the repayment records /// </summary> /// <returns>GetCrossMarginAccountResponse</returns> public async Task <GetRepaymentResponse> GetRepayment(GetRepaymentRequest request) { GetRequest getRequest = new GetRequest() .AddParam("repayId", request.repayId) .AddParam("accountId", request.accountId) .AddParam("currency", request.currency) .AddParam("startTime", request.startTime.ToString()) .AddParam("endTime", request.endTime.ToString()) .AddParam("sort", request.sort) .AddParam("limit", request.limit.ToString()) .AddParam("fromId", request.fromId.ToString()); string url = _urlBuilder.Build(GET_METHOD, "/v2/account/repayment", getRequest); return(await HttpRequest.GetAsync <GetRepaymentResponse>(url)); }