public async Task TestCurrencies() { var driver = new HuobiPro(); var result = await driver.CurrenciesAsync() as List <Currency>; Assert.IsNotNull(result); Assert.AreEqual(255, result.Count); }
public async Task TestPairSettings() { var driver = new HuobiPro(); var result = await driver.PairSettingsAsync() as List <PairSettings>; Assert.IsNotNull(result); Assert.AreNotEqual(0, result.Count); }
public async Task TestTrades() { var driver = new HuobiPro(); var result = await driver.TradesAsync(new Pair { Currency1 = new Currency { BrifName = "btc" }, Currency2 = new Currency { BrifName = "usdt" } }) as List <Trade>; Assert.IsNotNull(result); Assert.AreNotEqual(0, result.Count); }
static async Task Main(string[] args) { var driver = new HuobiPro(); var currencies = await driver.CurrenciesAsync() as List <Currency>; if (currencies != null) { foreach (Currency currency in currencies) { Console.WriteLine($"Currency - {currency.BrifName}\t{currency.FullName}\t{currency.Id}"); } } var pairSettings = await driver.PairSettingsAsync() as List <PairSettings>; if (pairSettings != null) { foreach (PairSettings pairSetting in pairSettings) { Console.WriteLine($"PairSettings - {pairSetting.Pair.Name}\t{pairSetting.MinAmount}\t{pairSetting.MaxAmount}"); } } var pair = new Pair { Currency1 = new Currency { BrifName = "btc" }, Currency2 = new Currency { BrifName = "usdt" } }; var trades = await driver.TradesAsync(pair) as List <Trade>; if (trades != null) { foreach (Trade trade in trades) { Console.WriteLine($"Trade - {trade.Pair.Name}\t{trade.TradeTypes}\t{trade.Price}"); } } }