コード例 #1
0
        private static void GetLast48hOrders()
        {
            var tradeClient = new OrderClient(Config.AccessKey, Config.SecretKey);

            _logger.Start();
            var request = new GetRequest()
                          .AddParam("symbol", "btcusdt");
            var response = tradeClient.GetLast48hOrdersAsync(request).Result;

            _logger.StopAndLog();

            switch (response.status)
            {
            case "ok":
            {
                if (response.data != null)
                {
                    foreach (var o in response.data)
                    {
                        AppLogger.Info($"Order symbol: {o.symbol}, amount: {o.amount}, state: {o.state}");
                    }
                    AppLogger.Info($"There are total {response.data.Length} history orders");
                }
                break;
            }

            case "error":
            {
                AppLogger.Info($"Get history orders fail, error code: {response.errorCode}, error message: {response.errorMessage}");
                break;
            }
            }
        }