Example #1
0
        private static void GetMatchResults()
        {
            var tradeClient = new OrderClient(Config.AccessKey, Config.SecretKey);

            _logger.Start();
            var request = new GetRequest()
                          .AddParam("symbol", "htusdt")
                          .AddParam("start-date", "2020-11-02");
            var response = tradeClient.GetMatchResultsAsync(request).Result;

            _logger.StopAndLog();

            switch (response.status)
            {
            case "ok":
            {
                if (response.data != null)
                {
                    foreach (var r in response.data)
                    {
                        AppLogger.Info($"Match result order id: {r.orderId}, symbol: {r.symbol}, price: {r.price}, amount: {r.filledAmount}, fee: {r.filledFees}, state: {r.feeDeductState}");
                    }
                    AppLogger.Info($"There are total {response.data.Length} match results");
                }
                break;
            }

            case "error":
            {
                AppLogger.Info($"Get mattch result fail, error code: {response.errorCode}, error message: {response.errorMessage}");
                break;
            }
            }
        }
        private static void GetMatchResults()
        {
            var tradeClient = new OrderClient(Config.AccessKey, Config.SecretKey);


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


            switch (response.status)
            {
            case "ok":
            {
                if (response.data != null)
                {
                    foreach (var r in response.data)
                    {
                        Console.WriteLine($"Match result symbol: {r.symbol}, amount: {r.filledAmount}, fee: {r.filledFees}");
                    }
                    Console.WriteLine($"There are total {response.data.Length} match results");
                }
                break;
            }

            case "error":
            {
                Console.WriteLine($"Get mattch result fail, error code: {response.errorCode}, error message: {response.errorMessage}");
                break;
            }
            }
        }