private static void GetETFSwapHistory() { var etfClient = new ETFClient(Config.AccessKey, Config.SecretKey); _logger.Start(); var response = etfClient.GetETFSwapHistory(0, 1).Result; _logger.StopAndLog(); if (response != null) { string message = string.IsNullOrEmpty(response.message) ? "" : response.message; if (response.success) { if (response.data != null) { foreach (var h in response.data) { AppLogger.Info($"Currency: {h.currency}, amount {h.amount}"); } AppLogger.Info($"There are total {response.data.Length} ETF swap history"); } } else { AppLogger.Info($"Get Swap history fail: {message}"); } } }
private static void GetETFInfo() { var etfClient = new ETFClient(Config.AccessKey, Config.SecretKey); var response = etfClient.GetETFInfoAsync().Result; if (response != null && response.data != null) { Console.WriteLine($"ETF name: {response.data.etfName}, purchase min amount: {response.data.purchaseMinAmount}"); if (response.data.unitPrice != null) { foreach (var p in response.data.unitPrice) { Console.WriteLine($"Currency: {p.currency}, amount: {p.amount}"); } } } }
private static void SwapETFOut() { var etfClient = new ETFClient(Config.AccessKey, Config.SecretKey); var response = etfClient.SwapETFOutAsync(100).Result; if (response != null) { string message = string.IsNullOrEmpty(response.message) ? "" : response.message; if (response.success) { Console.WriteLine($"Swap out success: {message}"); } else { Console.WriteLine($"Swap out fail: {message}"); } } }
private static void SwapETFOut() { var etfClient = new ETFClient(Config.AccessKey, Config.SecretKey); _logger.Start(); var response = etfClient.SwapETFOutAsync(100).Result; _logger.StopAndLog(); if (response != null) { string message = string.IsNullOrEmpty(response.message) ? "" : response.message; if (response.success) { AppLogger.Info($"Swap out success: {message}"); } else { AppLogger.Info($"Swap out fail: {message}"); } } }