嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
Huobi API 接口包含restApi 及websocket,
// REST client
using (var client = new HuobiClient())
{
// Public method
var marketDetails = client.GetMarketDetails24H("ethusdt");
if (marketDetails.Success) // Check the success flag for error handling
Console.WriteLine($"Got market stats, last price: {marketDetails.Data.Close}");
else
Console.WriteLine($"Failed to get stats, error: {marketDetails.Error}");
// Private method
client.SetApiCredentials("APIKEY", "APISECRET"); // Change to your credentials
var accounts = client.GetAccounts();
if (accounts.Success) // Check the success flag for error handling
Console.WriteLine($"Got account list, account id #1: {accounts.Data[0].Id}");
else
Console.WriteLine($"Failed to get account list, error: {accounts.Error}");
}
// Socket client
var socketClient = new HuobiSocketClient();
socketClient.SubscribeToMarketKlineUpdates("ethusdt", HuobiPeriod.FiveMinutes, data =>
{
Console.WriteLine("Received kline update. Last price: " data.Close);
});
Console.ReadLine();