示例#1
0
        private static void GetAccountHistory()
        {
            var accountClient = new AccountClient(Config.AccessKey, Config.SecretKey);


            var request = new GetRequest()
                          .AddParam("account-id", Config.AccountId);
            var result = accountClient.GetAccountHistoryAsync(request).Result;


            if (result != null)
            {
                switch (result.status)
                {
                case "ok":
                {
                    foreach (var h in result.data)
                    {
                        Console.WriteLine($"currency: {h.currency}, amount: {h.transactAmt}, type: {h.transactType}, time: {h.transactTime}");
                    }
                    Console.WriteLine($"There are total {result.data.Length} transactions");
                    break;
                }

                case "error":
                {
                    Console.WriteLine($"Get fail, error code: {result.errorCode}, error message: {result.errorMessage}");
                    break;
                }
                }
            }
        }
示例#2
0
        private static void GetAccountHistory()
        {
            var accountClient = new AccountClient(Config.AccessKey, Config.SecretKey);

            _logger.Start();
            var request = new GetRequest()
                          .AddParam("account-id", Config.AccountId);
            var result = accountClient.GetAccountHistoryAsync(request).Result;

            _logger.StopAndLog();

            if (result != null)
            {
                switch (result.status)
                {
                case "ok":
                {
                    AppLogger.Info($"Get account history, count={result.data.Length}");
                    foreach (var h in result.data)
                    {
                        AppLogger.Info($"currency: {h.currency}, amount: {h.transactAmt}, type: {h.transactType}, time: {h.transactTime}");
                    }
                    break;
                }

                case "error":
                {
                    AppLogger.Info($"Get fail, error code: {result.errorCode}, error message: {result.errorMessage}");
                    break;
                }
                }
            }
        }
        public void GetAccountHistoryTest(string account_id)
        {
            GetRequest request = new GetRequest();

            request.AddParam("account-id", account_id);
            var result = client.GetAccountHistoryAsync(request).Result;

            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);
        }