diff --git a/Huobi.SDK.Core.Test/LinearSwap/RestAccountTest.cs b/Huobi.SDK.Core.Test/LinearSwap/RestAccountTest.cs index 2351848..148e4b8 100644 --- a/Huobi.SDK.Core.Test/LinearSwap/RestAccountTest.cs +++ b/Huobi.SDK.Core.Test/LinearSwap/RestAccountTest.cs @@ -773,7 +773,7 @@ public void CrossGetLeverPositionLimitTest(string contractCode, int? leverRate, string contractType, string pair, string businessType, string tradePartition) { - var result = client.CrossGetLeverPositionLimitAsync(contractCode, leverRate, contractType, pair, businessType, tradePartition).Result; + var result = client.CrossGetLeverPositionLimitAsync(contractCode, leverRate).Result; string strret = JsonConvert.SerializeObject(result, Formatting.Indented); Console.WriteLine(strret); Assert.Equal("ok", result.status); diff --git a/Huobi.SDK.Core.Test/Spot/RestAccountTest.cs b/Huobi.SDK.Core.Test/Spot/RestAccountTest.cs deleted file mode 100644 index 8db1cc9..0000000 --- a/Huobi.SDK.Core.Test/Spot/RestAccountTest.cs +++ /dev/null @@ -1,151 +0,0 @@ -using Xunit; -using Microsoft.Extensions.Configuration; -using Huobi.SDK.Core.Spot.RESTful; -using System; -using Newtonsoft.Json; -using Huobi.SDK.Core.Spot.RESTful.Response.Account; -using Huobi.SDK.Core.Spot.RESTful.Request.Account; - -namespace Huobi.SDK.Core.Test.Spot -{ - public class RestAccountTest - { - static IConfigurationRoot config = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build(); - static AccountClient client = new AccountClient(config["AccessKey"], config["SecretKey"]); - - [Fact] - public void GetAccountInfoTest() - { - GetAccountInfoResponse result = client.GetAccountInfoAsync().Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData("38788389")] - public void GetAccountBalanceTest(string accountId) - { - GetAccountBalanceResponse result=client.GetAccountBalanceAsync(accountId).Result; - - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData(null, null)] - public void GetAccountValuationTest(string accountType, string valuationCurrency) - { - GetAccountValuationResponse result=client.GetAccountValuationAsync(accountType, valuationCurrency).Result; - - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal(true, result.success); - } - - [Theory] - [InlineData("spot", "BTC", null)] - public void GetAccountAssetValuationTest(string accountType, string valuationCurrency, long? subUid) - { - GetAccountAssetValuationResponse result = client.GetAccountAssetValuationAsync(accountType, valuationCurrency, subUid).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal(200, result.code); - } - - [Fact] - public void TransferAccountAsyncTest() - { - TransferAccountRequest trans = new TransferAccountRequest() - { - fromUser = 0, - fromAccountType = "spot", - fromAccount = 0, - toUser = 1, - toAccountType = "spot", - toAccount = 1, - currency = "SHIB", - amount = "1" - }; - var result = client.TransferAccountAsync(trans).Result; - - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData("38788389")] - 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); - } - - [Theory] - [InlineData("38788389")] - public void GetAccountLedgerAsyncTest(string account_id) - { - GetRequest request = new GetRequest(); - request.AddParam("accountId", account_id); - var result = client.GetAccountLedgerAsync(request).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal(200, result.code); - } - - [Theory] - [InlineData("usdt", 1)] - public void TransferFromSpotToFutureTest(string currency, decimal amount) - { - var result = client.TransferFromSpotToFutureAsync(currency, amount).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData("usdt", 1)] - public void TransferFromFutureToSpotTest(string currency, decimal amount) - { - var result = client.TransferFromFutureToSpotAsync(currency, amount).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData(null)] - public void GetPointBalanceTest(string subUid) - { - var result = client.GetPointBalanceAsync(subUid).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal(200, result.code); - } - - [Theory] - [InlineData("38788389", "38788389", 0, "1")] - public void TransferPointTest(string fromUid, string toUid, long groupId, string amount) - { - TransferPointRequest request = new TransferPointRequest() - { - fromUid = fromUid, - toUid = toUid, - groupId = groupId, - amount = amount - }; - var result = client.TransferPointAsync(request).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal(200, result.code); - } - - } -} \ No newline at end of file diff --git a/Huobi.SDK.Core.Test/Spot/RestCommonTest.cs b/Huobi.SDK.Core.Test/Spot/RestCommonTest.cs deleted file mode 100644 index b105325..0000000 --- a/Huobi.SDK.Core.Test/Spot/RestCommonTest.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Xunit; -using Microsoft.Extensions.Configuration; -using Huobi.SDK.Core.Spot.RESTful; -using System; -using Newtonsoft.Json; -using Huobi.SDK.Core.Spot.RESTful.Response.Common; - -namespace Huobi.SDK.Core.Test.Spot -{ - public class RestCommonTest - { - static IConfigurationRoot config = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build(); - static CommonClient client = new CommonClient(); - - [Fact] - public void GetSystemStatusTest() - { - string result = client.GetSystemStatus().Result; - Console.WriteLine(result); - } - - [Fact] - public void GetMarketStatusTest() - { - GetMarketStatusResponse result = client.GetMarketStatusAsync().Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal(200, result.code); - } - - [Fact] - public void GetSymbolsTest() - { - GetSymbolsResponse result = client.GetSymbolsAsync().Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Fact] - public void GetCurrencysTest() - { - GetCurrencysResponse result = client.GetCurrencysAsync().Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData("usdt", null)] - public void GetCurrencyTest(string currency, bool authorizedUser) - { - GetCurrencyResponse result=client.GetCurrencyAsync(currency, authorizedUser).Result; - - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal(200, result.code); - } - - [Fact] - public void GetTimestampTest() - { - GetTimestampResponse result = client.GetTimestampAsync().Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - } -} \ No newline at end of file diff --git a/Huobi.SDK.Core.Test/Spot/RestMarketTest.cs b/Huobi.SDK.Core.Test/Spot/RestMarketTest.cs deleted file mode 100644 index 9622758..0000000 --- a/Huobi.SDK.Core.Test/Spot/RestMarketTest.cs +++ /dev/null @@ -1,94 +0,0 @@ -using Xunit; -using Microsoft.Extensions.Configuration; -using Huobi.SDK.Core.Spot.RESTful; -using System; -using Newtonsoft.Json; -using Huobi.SDK.Core.Spot.RESTful.Response.Market; - -namespace Huobi.SDK.Core.Test.Spot -{ - public class RestMarketTest - { - static IConfigurationRoot config = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build(); - static MarketClient client = new MarketClient(); - - [Theory] - [InlineData("btcusdt", "1min")] - public void GetSystemStatusTest(string symbol, string period) - { - GetRequest request = new GetRequest(); - request.AddParam("symbol", symbol); - request.AddParam("period", period); - - GetKlineResponse result = client.GetKlineAsync(request).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData("btcusdt")] - public void GetMergedTest(string symbol) - { - GetMergedResponse result = client.GetMergedAsync(symbol).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Fact] - public void GetTicksTest() - { - GetTickersResponse result = client.GetTicksAsync().Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData("btcusdt", "5", "step0")] - public void GetDepthTest(string symbol, string depth, string type) - { - GetRequest request = new GetRequest(); - request.AddParam("symbol", symbol); - request.AddParam("depth", depth); - request.AddParam("type", type); - - GetDepthResponse result = client.GetDepthAsync(request).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData("btcusdt")] - public void GetTradeTest(string symbol) - { - GetTradeResponse result = client.GetTradeAsync(symbol).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData("btcusdt", 10)] - public void GetHisTradeTest(string symbol, int size) - { - GetHisTradesResponse result = client.GetHisTradesAsync(symbol, size).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData("btcusdt")] - public void GetDetailTest(string symbol) - { - GetDetailResponse result = client.GetDetailAsync(symbol).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - } -} \ No newline at end of file diff --git a/Huobi.SDK.Core.Test/Spot/RestWalletTest.cs b/Huobi.SDK.Core.Test/Spot/RestWalletTest.cs deleted file mode 100644 index 52542bb..0000000 --- a/Huobi.SDK.Core.Test/Spot/RestWalletTest.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Xunit; -using Microsoft.Extensions.Configuration; -using Huobi.SDK.Core.Spot.RESTful; -using System; -using Newtonsoft.Json; -using Huobi.SDK.Core.Spot.RESTful.Response.Wallet; -using Huobi.SDK.Core.Spot.RESTful.Request.Wallet; - -namespace Huobi.SDK.Core.Test.Spot -{ - public class RestWalletTest - { - static IConfigurationRoot config = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build(); - static WalletClient client = new WalletClient(config["AccessKey"], config["SecretKey"]); - - [Theory] - [InlineData("usdt")] - public void GetDepositAddressTest(string currency) - { - GetRequest request = new GetRequest(); - request.AddParam("currency", currency); - - GetDepositAddressResponse result=client.GetDepositAddressAsync(request).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal(200, result.code); - } - - [Theory] - [InlineData("usdt")] - public void GetWithdrawQuotaTest(string currency) - { - GetRequest request = new GetRequest(); - request.AddParam("currency", currency); - - GetWithdrawQuotaResponse result=client.GetWithdrawQuotaAsync(request).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal(200, result.code); - } - - [Theory] - [InlineData("usdt")] - public void GetWithdrawAddressTest(string currency) - { - GetRequest request = new GetRequest(); - request.AddParam("currency", currency); - - GetDepositAddressResponse result=client.GetWithdrawAddressAsync(request).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal(200, result.code); - } - - [Theory] - [InlineData("xxx", "1", "btc", "0.01")] - public void WithdrawCurrencyTest(string address, string amount, string currency, string fee) - { - WithdrawRequest request = new WithdrawRequest() - { - address = address, - amount = amount, - currency = currency, - fee = fee - }; - - WithdrawCurrencyResponse result=client.WithdrawCurrencyAsync(request).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData(123)] - public void CancelWithdrawCurrencyTest(long withdrawId) - { - CancelWithdrawCurrencyResponse result=client.CancelWithdrawCurrencyAsync(withdrawId).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - [Theory] - [InlineData("deposit")] - public void GetDepositWithdrawHistoryTest(string type) - { - GetRequest request = new GetRequest(); - request.AddParam("type", type); - - GetDepositWithdrawHistoryResponse result=client.GetDepositWithdrawHistoryAsync(request).Result; - string strret = JsonConvert.SerializeObject(result, Formatting.Indented); - Console.WriteLine(strret); - Assert.Equal("ok", result.status); - } - - } -} \ No newline at end of file diff --git a/Huobi.SDK.Core.Test/Spot/WsAccountOrderTest.cs b/Huobi.SDK.Core.Test/Spot/WsAccountOrderTest.cs deleted file mode 100644 index a1bb2ef..0000000 --- a/Huobi.SDK.Core.Test/Spot/WsAccountOrderTest.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Xunit; -using Microsoft.Extensions.Configuration; -using System; -using Newtonsoft.Json; -using Huobi.SDK.Core.Spot.WS; -using Huobi.SDK.Core.Spot.WS.Response.AccountOrder; - -namespace Huobi.SDK.Core.Test.Spot -{ - public class WsAccountOrderTest - { - static IConfigurationRoot config = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build(); - static WSAccountOrderClient client = new WSAccountOrderClient(config["AccessKey"], config["SecretKey"]); - - [Theory] - [InlineData("shibusdt")] - public void WSSubOrdersTest(string symbol) - { - client.SubOrders(symbol, delegate (SubOrdersResponse data) - { - Console.WriteLine(JsonConvert.SerializeObject(data)); - }); - System.Threading.Thread.Sleep(1000 * 600); - } - - [Theory] - [InlineData("shibusdt", 1)] - public void WSSubTradeClearingTest(string symbol, int mode) - { - client.SubTradeClearing(symbol, mode, delegate (SubTradeClearingResponse data) - { - Console.WriteLine(JsonConvert.SerializeObject(data)); - }); - System.Threading.Thread.Sleep(1000 * 600); - } - - [Theory] - [InlineData("1")] - public void WSSubMatchOrdersTest(string mode) - { - client.SubMatchOrders(mode, delegate (SubAccountResponse data) - { - Console.WriteLine(JsonConvert.SerializeObject(data)); - }); - System.Threading.Thread.Sleep(1000 * 600); - } - } -} \ No newline at end of file diff --git a/Huobi.SDK.Core.Test/Spot/WsMarketTest.cs b/Huobi.SDK.Core.Test/Spot/WsMarketTest.cs deleted file mode 100644 index bf028e1..0000000 --- a/Huobi.SDK.Core.Test/Spot/WsMarketTest.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Xunit; -using Microsoft.Extensions.Configuration; -using System; -using Newtonsoft.Json; -using Huobi.SDK.Core.Spot.WS; -using Huobi.SDK.Core.Spot.WS.Response.Market; - -namespace Huobi.SDK.Core.Test.Spot -{ - public class WsMarketTest - { - static IConfigurationRoot config = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build(); - static WSMarketClient client = new WSMarketClient(); - - [Theory] - [InlineData("btcusdt", "1min")] - public void WSSubKLineTest(string symbol, string period) - { - client.SubKLine(symbol, period, delegate (SubKLineResponse data) - { - Console.WriteLine(JsonConvert.SerializeObject(data)); - }); - System.Threading.Thread.Sleep(1000 * 60); - } - - [Theory] - [InlineData("btcusdt")] - public void WSSubTickerTest(string symbol) - { - client.SubTicker(symbol, delegate (SubTickerResponse data) - { - Console.WriteLine(JsonConvert.SerializeObject(data)); - }); - System.Threading.Thread.Sleep(1000 * 60); - } - - [Theory] - [InlineData("btcusdt", "step0")] - public void WSSubDepthTest(string symbol, string type) - { - client.SubDepth(symbol, type, delegate (SubDepthResponse data) - { - Console.WriteLine(JsonConvert.SerializeObject(data)); - }); - System.Threading.Thread.Sleep(1000 * 60); - } - - [Theory] - [InlineData("btcusdt", 5, false)] - public void WSSubMBPTest(string symbol, int levels, bool beRefresh) - { - client.SubMBP(symbol, levels, beRefresh, delegate (SubMBPResponse data) - { - Console.WriteLine(JsonConvert.SerializeObject(data)); - }); - System.Threading.Thread.Sleep(1000 * 60); - } - - [Theory] - [InlineData("btcusdt")] - public void WSSubBBOTest(string symbol) - { - client.SubBBO(symbol, delegate (SubBBOResponse data) - { - Console.WriteLine(JsonConvert.SerializeObject(data)); - }); - System.Threading.Thread.Sleep(1000 * 60); - } - - [Theory] - [InlineData("btcusdt")] - public void WSSubTradeDetailTest(string symbol) - { - client.SubTradeDetail(symbol, delegate (SubTradeDetailResponse data) - { - Console.WriteLine(JsonConvert.SerializeObject(data)); - }); - System.Threading.Thread.Sleep(1000 * 60); - } - - [Theory] - [InlineData("btcusdt")] - public void WSSubDetailTest(string symbol) - { - client.SubDetail(symbol, delegate (SubDetailResponse data) - { - Console.WriteLine(JsonConvert.SerializeObject(data)); - }); - System.Threading.Thread.Sleep(1000 * 60); - } - } -} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/AccountClient.cs b/Huobi.SDK.Core/CoinSwap/RESTful/AccountClient.cs index 73a34d4..b9a4d90 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/AccountClient.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/AccountClient.cs @@ -155,8 +155,10 @@ public async Task SetSubAuthAsync(string subUid, int subAuth /// get all sub account assets /// /// such as BTC-USDT + /// direct + /// fromId /// - public async Task GetAllSubAssetsAsync(string contractCode = null) + public async Task GetAllSubAssetsAsync(string contractCode = null, string direct = null, long? fromId = null) { // ulr string url = _urlBuilder.Build(POST_METHOD, "/swap-api/v1/swap_sub_account_list"); @@ -167,6 +169,14 @@ public async Task GetAllSubAssetsAsync(string contractC { content = $",\"contract_code\": \"{contractCode}\""; } + if (direct != null) + { + content = $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content = $",\"fromId\": {fromId}"; + } if (content != null) { content = $"{{ {content.Substring(1)} }}"; @@ -419,16 +429,16 @@ public async Task GetFeeAsync(string contractCode) /// /// /// - public async Task GetTransferLimitAsync(string marginAccount = null) + public async Task GetTransferLimitAsync(string contractCode = null) { // ulr string url = _urlBuilder.Build(POST_METHOD, "/swap-api/v1/swap_transfer_limit"); // content string content = null; - if (marginAccount != null) + if (contractCode != null) { - content += $",\"margin_account\": \"{marginAccount}\""; + content += $",\"contract_code\": \"{contractCode}\""; } if (content != null) { @@ -467,14 +477,19 @@ public async Task GetPositionLimitAsync(string contrac /// /// /// + /// /// - public async Task AccountTransferAsync(long subUid, string contractCode, double amount, string type) + public async Task AccountTransferAsync(long subUid, string contractCode, double amount, string type, long? clientOrderId = null) { // ulr string url = _urlBuilder.Build(POST_METHOD, "/swap-api/v1/swap_master_sub_transfer"); // content string content = $",\"sub_uid\":{subUid}, \"contract_code\":\"{contractCode}\", \"amount\":{amount}, \"type\":\"{type}\""; + if (clientOrderId != null) + { + content += $",\"client_order_id\": {clientOrderId}"; + } if (content != null) { content = $"{{ {content.Substring(1)} }}"; @@ -494,6 +509,144 @@ public async Task GetApiTradingStatusAsync() // content is null return await HttpRequest.GetAsync(url); } + + /// + /// 查询用户财务记录(新) + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapFinancialRecordAsync(string contract, string type = null, + long? startTime = null, long? endTime = null, string direct = null, long? fromId = null) + { + // ulr + string url = _urlBuilder.Build(POST_METHOD, "/swap-api/v3/swap_financial_record"); + + // content + string content = null; + content += $",\"contract\": \"{contract}\""; + if (type != null) + { + content += $",\"type\": \"{type}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 组合查询用户财务记录(新) + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapFinancialRecordExactAsync(string contract, string type = null, + long? startTime = null, long? endTime = null, string direct = null, long? fromId = null) + { + // ulr + string url = _urlBuilder.Build(POST_METHOD, "/swap-api/v3/swap_financial_record_exact"); + + // content + string content = null; + content += $",\"contract\": \"{contract}\""; + if (type != null) + { + content += $",\"type\": \"{type}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 查询子账户交易权限 + /// + /// + /// + /// + /// + /// + /// + public async Task SwapSubAuthListAsync(string subUid = null, long? startTime = null, + long? endTime = null, string direct = null, long? fromId = null) + { + // location + string location = "/swap-api/v1/swap_sub_auth_list"; + + // option + string option = null; + if (subUid != null) + { + option += $"sub_uid={subUid}"; + } + if (startTime != null) + { + option += $"start_time={startTime}"; + } + if (endTime != null) + { + option += $"end_time={endTime}"; + } + if (direct != null) + { + option += $"direct={direct}"; + } + if (fromId != null) + { + option += $"from_id={fromId}"; + } + if (option != null) + { + location += $"?{option}"; + } + + string url = _urlBuilder.Build(GET_METHOD, location); + return await HttpRequest.GetAsync(url); + } } } diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/CommonClient.cs b/Huobi.SDK.Core/CoinSwap/RESTful/CommonClient.cs new file mode 100644 index 0000000..0b6d672 --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/CommonClient.cs @@ -0,0 +1,133 @@ +using System.Threading.Tasks; +using Huobi.SDK.Core.CoinSwap.RESTful.Response.Common; +using Huobi.SDK.Core.RequestBuilder; + +namespace Huobi.SDK.Core.CoinSwap.RESTful +{ + /// + /// Responsible to get market information + /// + public class CommonClient + { + private PublicUrlBuilder _urlBuilder; + + /// + /// Constructor + /// + /// the host that the client connects to + public CommonClient(string host = Host.FUTURES) + { + _urlBuilder = new PublicUrlBuilder(host); + } + + /// + /// 获取强平订单(新) + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapLiquidationOrdersAsync(string contract, + int tradeType, long? startTime = null, long? endTime = null, + string direct = null, long? fromId = null) + { + // location + string location = "/swap-api/v3/swap_liquidation_orders"; + + // option + string option = null; + option += $"&contract={contract}"; + option += $"&trade_type={tradeType}"; + if (startTime != null) + { + option += $"&start_time={startTime}"; + } + if (endTime != null) + { + option += $"&end_time={endTime}"; + } + if (direct != null) + { + option += $"&direct={direct}"; + } + if (fromId != null) + { + option += $"&from_id={fromId}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 合约要素 + /// + /// + /// + public async Task SwapQueryElementsAsync(string contractCode = null) + { + // location + string location = "/swap-api/v1/swap_query_elements"; + + // option + string option = null; + if (contractCode != null) + { + option += $"&contract_code={contractCode}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 获取当前系统时间戳 + /// + /// + public async Task TimestampAsync() + { + // location + string location = "/api/v1/timestamp"; + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 查询系统是否可用 + /// + /// + public async Task HeartbeatAsync() + { + // location + string location = "/heartbeat/"; + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 获取当前系统状态 + /// + /// + public async Task SummaryAsync() + { + // location + string location = "/api/v2/summary.json"; + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + } +} diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/MarketClient.cs b/Huobi.SDK.Core/CoinSwap/RESTful/MarketClient.cs index 4adb615..37d00ea 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/MarketClient.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/MarketClient.cs @@ -689,6 +689,26 @@ public async Task GetEstimatedSettlementPri string url = _urlBuilder.Build(location); return await HttpRequest.GetAsync(url); } + + public async Task BatchMergedAsync(string contractCode = null) + { + // location + string location = $"/v2/swap-ex/market/detail/batch_merged"; + + // option + string option = null; + if (contractCode != null) + { + option += $"?contract_code={contractCode}"; + } + if (option != null) + { + location += $"{option}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } } } diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/OrderClient.cs b/Huobi.SDK.Core/CoinSwap/RESTful/OrderClient.cs index 0169637..676930c 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/OrderClient.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/OrderClient.cs @@ -420,5 +420,195 @@ public async Task GetHisMatchExactAsync(string contrac return await HttpRequest.PostAsync(url, content); } + /// + /// 获取合约历史委托(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapHisOrdersAsync(string contract, int tradeType, int type, string status, + long? startTime = null, long? endTime = null, + string direct = null, long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/swap-api/v3/swap_hisorders"); + + // content + string content = $",\"contract\": \"{contract}\",\"trade_type\": {tradeType},\"type\": {type},\"status\": \"{status}\""; + if (contract != null) + { + content += $",\"contract\": \"{contract}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 组合查询合约历史委托(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapHisOrdersExactAsync(string contract, int tradeType, int type, string status, + long? startTime = null, long? endTime = null, + string direct = null, long? fromId = null, string priceType = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/swap-api/v3/swap_hisorders_exact"); + + // content + string content = $",\"contract\": \"{contract}\",\"trade_type\": {tradeType},\"type\": {type},\"status\": \"{status}\""; + if (contract != null) + { + content += $",\"contract\": \"{contract}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (priceType != null) + { + content += $",\"price_type\": \"{priceType}\""; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 获取历史成交记录(新) + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapMatchResultsAsync(string contract, int tradeType, + long? startTime = null, long? endTime = null, + string direct = null, long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/swap-api/v3/swap_matchresults"); + + // content + string content = $",\"contract\": \"{contract}\""; + content += $",\"trade_type\": {tradeType}"; + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 组合查询历史成交记录接口(新) + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapMatchResultsExactAsync(string contract, int tradeType, + long? startTime = null, long? endTime = null, + string direct = null, long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/swap-api/v3/swap_matchresults_exact"); + + // content + string content = $",\"contract\": \"{contract}\",\"trade_type\": {tradeType}"; + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + } } diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/AccountTansferResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/AccountTansferResponse.cs index 854eca9..b3b402c 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/AccountTansferResponse.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/AccountTansferResponse.cs @@ -26,6 +26,9 @@ public class Data { [JsonProperty("order_id")] public string orderId { get; set; } + + [JsonProperty("client_order_id", NullValueHandling = NullValueHandling.Ignore)] + public long clientOrderId { get; set; } } } } diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetAccountPositionResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetAccountPositionResponse.cs index 76dddd0..668a846 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetAccountPositionResponse.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetAccountPositionResponse.cs @@ -56,6 +56,12 @@ public class Data [JsonProperty("risk_rate", NullValueHandling = NullValueHandling.Ignore)] public double riskRate { get; set; } + + [JsonProperty("new_risk_rate", NullValueHandling = NullValueHandling.Ignore)] + public double newRiskRate { get; set; } + + [JsonProperty("trade_partition", NullValueHandling = NullValueHandling.Ignore)] + public string tradePartition { get; set; } [JsonProperty("liquidation_price", NullValueHandling = NullValueHandling.Ignore)] public double liquidationPrice { get; set; } @@ -106,6 +112,9 @@ public class Positions [JsonProperty("last_price")] public double lastPrice { get; set; } + + [JsonProperty("adl_risk_percent", NullValueHandling = NullValueHandling.Ignore)] + public double adlRiskPercent { get; set; } } [JsonProperty("contract_detail", NullValueHandling = NullValueHandling.Ignore)] diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetAllSubAssetsResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetAllSubAssetsResponse.cs index 5273974..207308d 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetAllSubAssetsResponse.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetAllSubAssetsResponse.cs @@ -46,6 +46,9 @@ public class CoinAssets [JsonProperty("risk_rate", NullValueHandling = NullValueHandling.Ignore)] public double riskRate { get; set; } + + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long queryId { get; set; } } } } diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetPositionInfoResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetPositionInfoResponse.cs index 09aad0e..d226463 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetPositionInfoResponse.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetPositionInfoResponse.cs @@ -60,6 +60,18 @@ public class Data [JsonProperty("last_price")] public double lastPrice { get; set; } + + [JsonProperty("adl_risk_percent", NullValueHandling = NullValueHandling.Ignore)] + public double adlRiskPercent { get; set; } + + [JsonProperty("liq_px", NullValueHandling = NullValueHandling.Ignore)] + public string liqPx { get; set; } + + [JsonProperty("new_risk_rate", NullValueHandling = NullValueHandling.Ignore)] + public double newRiskRate { get; set; } + + [JsonProperty("trade_partition", NullValueHandling = NullValueHandling.Ignore)] + public string tradePartition { get; set; } } } } \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetValidLeverRateResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetValidLeverRateResponse.cs index 54a96ce..c6394ce 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetValidLeverRateResponse.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/GetValidLeverRateResponse.cs @@ -26,7 +26,7 @@ public class Data [JsonProperty("available_level_rate")] public string availableLeverRate { get; set; } - [JsonProperty("margin_mode")] + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] public string marginMode { get; set; } } } diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/SwapFinancialRecordResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/SwapFinancialRecordResponse.cs new file mode 100644 index 0000000..c5a15fa --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/SwapFinancialRecordResponse.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.RESTful.Response.Account +{ + public class SwapFinancialRecordResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapFinancialRecord + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] + public int Type { get; set; } + + [JsonProperty("amount", NullValueHandling = NullValueHandling.Ignore)] + public decimal Amount { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/SwapSubAuthListResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/SwapSubAuthListResponse.cs new file mode 100644 index 0000000..bdce81a --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Account/SwapSubAuthListResponse.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.RESTful.Response.Account +{ + public class SwapSubAuthListResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public SwapSubAuthList Data { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + public class SwapSubAuthList + { + + [JsonProperty("errors", NullValueHandling = NullValueHandling.Ignore)] + public List Errors { get; set; } + + [JsonProperty("successes", NullValueHandling = NullValueHandling.Ignore)] + public List Successes { get; set; } + } + + public class ErrorObject + { + [JsonProperty("sub_uid", NullValueHandling = NullValueHandling.Ignore)] + public string SubUid { get; set; } + + [JsonProperty("err_code", NullValueHandling = NullValueHandling.Ignore)] + public string ErrCode { get; set; } + + [JsonProperty("err_msg", NullValueHandling = NullValueHandling.Ignore)] + public string ErrMsg { get; set; } + } + + public class SuccessObject + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public object QueryId { get; set; } + + [JsonProperty("sub_uid", NullValueHandling = NullValueHandling.Ignore)] + public string SubUid { get; set; } + + [JsonProperty("sub_auth", NullValueHandling = NullValueHandling.Ignore)] + public string SubAuth { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/HeartbeatResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/HeartbeatResponse.cs new file mode 100644 index 0000000..b6f9220 --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/HeartbeatResponse.cs @@ -0,0 +1,34 @@ +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.RESTful.Response.Common +{ + public class HeartbeatResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public HeartbeatObject Data { get; set; } + + public class HeartbeatObject + { + [JsonProperty("heartbeat", NullValueHandling = NullValueHandling.Ignore)] + public int Heartbeat { get; set; } + + [JsonProperty("swap_heartbeat", NullValueHandling = NullValueHandling.Ignore)] + public int SwapHeartbeat { get; set; } + + [JsonProperty("estimated_recovery_time", NullValueHandling = NullValueHandling.Ignore)] + public long EstimatedRecoveryTime { get; set; } + + [JsonProperty("swap_estimated_recovery_time", NullValueHandling = NullValueHandling.Ignore)] + public long SwapEstimatedRecoveryTime { get; set; } + + [JsonProperty("linear_swap_heartbeat", NullValueHandling = NullValueHandling.Ignore)] + public long LinearSwapHeartbeat { get; set; } + + [JsonProperty("linear_swap_estimated_recovery_time", NullValueHandling = NullValueHandling.Ignore)] + public long LinearSwapEstimatedRecoveryTime { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/SummaryResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/SummaryResponse.cs new file mode 100644 index 0000000..03045b2 --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/SummaryResponse.cs @@ -0,0 +1,231 @@ +using System.Collections.Generic; +using System.ComponentModel; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.RESTful.Response.Common +{ + public class SummaryResponse + { + [JsonProperty("page", NullValueHandling = NullValueHandling.Ignore)] + public Page page { get; set; } + + [JsonProperty("components", NullValueHandling = NullValueHandling.Ignore)] + public List Components { get; set; } + + [JsonProperty("incidents", NullValueHandling = NullValueHandling.Ignore)] + public List Incidents { get; set; } + + [JsonProperty("scheduled_maintenances", NullValueHandling = NullValueHandling.Ignore)] + public List ScheduledMaintenances { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public Status status { get; set; } + + public class Page + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + + [JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)] + public string Url { get; set; } + + [JsonProperty("time_zone", NullValueHandling = NullValueHandling.Ignore)] + public string TimeZone { get; set; } + + [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] + public string UpdatedAt { get; set; } + } + + public class Component + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] + public string CreatedAt { get; set; } + + [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] + public string UpdatedAt { get; set; } + + [JsonProperty("position", NullValueHandling = NullValueHandling.Ignore)] + public int? Position { get; set; } + + [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] + public object Description { get; set; } + + [JsonProperty("showcase", NullValueHandling = NullValueHandling.Ignore)] + public bool? Showcase { get; set; } + + [JsonProperty("group_id", NullValueHandling = NullValueHandling.Ignore)] + public object GroupId { get; set; } + + [JsonProperty("page_id", NullValueHandling = NullValueHandling.Ignore)] + public string PageId { get; set; } + + [JsonProperty("group", NullValueHandling = NullValueHandling.Ignore)] + public bool? Group { get; set; } + + [JsonProperty("only_show_if_degraded", NullValueHandling = NullValueHandling.Ignore)] + public bool? OnlyShowIfDegraded { get; set; } + } + + public class Incident + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] + public string CreatedAt { get; set; } + + [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] + public string UpdatedAt { get; set; } + + [JsonProperty("monitoring_at", NullValueHandling = NullValueHandling.Ignore)] + public object MonitoringAt { get; set; } + + [JsonProperty("resolved_at", NullValueHandling = NullValueHandling.Ignore)] + public object ResolvedAt { get; set; } + + [JsonProperty("impact", NullValueHandling = NullValueHandling.Ignore)] + public string Impact { get; set; } + + [JsonProperty("shortlink", NullValueHandling = NullValueHandling.Ignore)] + public string Shortlink { get; set; } + + [JsonProperty("started_at", NullValueHandling = NullValueHandling.Ignore)] + public string StartedAt { get; set; } + + [JsonProperty("page_id", NullValueHandling = NullValueHandling.Ignore)] + public string PageId { get; set; } + + [JsonProperty("incident_updates", NullValueHandling = NullValueHandling.Ignore)] + public List IncidentUpdates { get; set; } + + [JsonProperty("components", NullValueHandling = NullValueHandling.Ignore)] + public List Components { get; set; } + } + + public class IncidentUpdate + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("body", NullValueHandling = NullValueHandling.Ignore)] + public string Body { get; set; } + + [JsonProperty("incident_id", NullValueHandling = NullValueHandling.Ignore)] + public string IncidentId { get; set; } + + [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] + public string CreatedAt { get; set; } + + [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] + public string UpdatedAt { get; set; } + + [JsonProperty("display_at", NullValueHandling = NullValueHandling.Ignore)] + public string DisplayAt { get; set; } + + [JsonProperty("affected_components", NullValueHandling = NullValueHandling.Ignore)] + public AffectedComponent[] AffectedComponents { get; set; } + + [JsonProperty("deliver_notifications", NullValueHandling = NullValueHandling.Ignore)] + public bool? DeliverNotifications { get; set; } + + [JsonProperty("custom_tweet", NullValueHandling = NullValueHandling.Ignore)] + public object CustomTweet { get; set; } + + [JsonProperty("tweet_id", NullValueHandling = NullValueHandling.Ignore)] + public object TweetId { get; set; } + } + + public class AffectedComponent + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public string Code { get; set; } + + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + + [JsonProperty("old_status", NullValueHandling = NullValueHandling.Ignore)] + public string OldStatus { get; set; } + + [JsonProperty("new_status", NullValueHandling = NullValueHandling.Ignore)] + public string NewStatus { get; set; } + } + + public class ScheduledMaintenance + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] + public string CreatedAt { get; set; } + + [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] + public string UpdatedAt { get; set; } + + [JsonProperty("monitoring_at", NullValueHandling = NullValueHandling.Ignore)] + public object MonitoringAt { get; set; } + + [JsonProperty("resolved_at", NullValueHandling = NullValueHandling.Ignore)] + public object ResolvedAt { get; set; } + + [JsonProperty("impact", NullValueHandling = NullValueHandling.Ignore)] + public string Impact { get; set; } + + [JsonProperty("shortlink", NullValueHandling = NullValueHandling.Ignore)] + public string Shortlink { get; set; } + + [JsonProperty("started_at", NullValueHandling = NullValueHandling.Ignore)] + public string StartedAt { get; set; } + + [JsonProperty("page_id", NullValueHandling = NullValueHandling.Ignore)] + public string PageId { get; set; } + + [JsonProperty("incident_updates", NullValueHandling = NullValueHandling.Ignore)] + public List IncidentUpdates { get; set; } + + [JsonProperty("components", NullValueHandling = NullValueHandling.Ignore)] + public List Components { get; set; } + + [JsonProperty("scheduled_for", NullValueHandling = NullValueHandling.Ignore)] + public string ScheduledFor { get; set; } + + [JsonProperty("scheduled_until", NullValueHandling = NullValueHandling.Ignore)] + public string ScheduledUntil { get; set; } + } + + public class Status + { + [JsonProperty("indicator", NullValueHandling = NullValueHandling.Ignore)] + public string Indicator { get; set; } + + [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] + public string Description { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/SwapLiquidationOrdersResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/SwapLiquidationOrdersResponse.cs new file mode 100644 index 0000000..380d18d --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/SwapLiquidationOrdersResponse.cs @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.RESTful.Response.Common +{ + public class SwapLiquidationOrdersResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapLiquidationOrders + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal Volume { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public decimal Price { get; set; } + + [JsonProperty("amount", NullValueHandling = NullValueHandling.Ignore)] + public decimal Amount { get; set; } + + [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] + public long CreatedAt { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/SwapQueryElementsResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/SwapQueryElementsResponse.cs new file mode 100644 index 0000000..89eaf51 --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/SwapQueryElementsResponse.cs @@ -0,0 +1,104 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.RESTful.Response.Common +{ + public class SwapQueryElementsResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + public class SwapQueryElements + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("instrument_index_code", NullValueHandling = NullValueHandling.Ignore)] + public string InstrumentIndexCode { get; set; } + + [JsonProperty("real_time_settlement", NullValueHandling = NullValueHandling.Ignore)] + public int RealTimeSettlement { get; set; } + + [JsonProperty("transfer_profit_ratio", NullValueHandling = NullValueHandling.Ignore)] + public dynamic TransferProfitRatio { get; set; } + + [JsonProperty("min_level", NullValueHandling = NullValueHandling.Ignore)] + public int MinLevel { get; set; } + + [JsonProperty("max_level", NullValueHandling = NullValueHandling.Ignore)] + public int MaxLevel { get; set; } + + [JsonProperty("open_order_limit", NullValueHandling = NullValueHandling.Ignore)] + public int OpenOrderLimit { get; set; } + + [JsonProperty("offset_order_limit", NullValueHandling = NullValueHandling.Ignore)] + public int OffsetOrderLimit { get; set; } + + [JsonProperty("long_position_limit", NullValueHandling = NullValueHandling.Ignore)] + public int LongPositionLimit { get; set; } + + [JsonProperty("short_position_limit", NullValueHandling =NullValueHandling.Ignore)] + public int ShortPositionLimit { get; set; } + + [JsonProperty("price_tick", NullValueHandling = NullValueHandling.Ignore)] + public string PriceTick { get; set; } + + [JsonProperty("instrument_value", NullValueHandling = NullValueHandling.Ignore)] + public string InstrumentValue { get; set; } + + [JsonProperty("settle_period", NullValueHandling = NullValueHandling.Ignore)] + public int SettlePeriod { get; set; } + + [JsonProperty("funding_rate_cap", NullValueHandling = NullValueHandling.Ignore)] + public int FundingRateCap { get; set; } + + [JsonProperty("funding_rate_floor", NullValueHandling = NullValueHandling.Ignore)] + public int FundingRateFloor { get; set; } + + [JsonProperty("hig_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public int HigNormalLimit { get; set; } + + [JsonProperty("min_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public int MinNormalLimit { get; set; } + + [JsonProperty("hig_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public int HigOpenLimit { get; set; } + + [JsonProperty("min_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public int MinOpenLimit { get; set; } + + [JsonProperty("hig_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public int HigTradeLimit { get; set; } + + [JsonProperty("min_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public int MinTradeLimit { get; set; } + + [JsonProperty("contract_infos", NullValueHandling = NullValueHandling.Ignore)] + public List ContractInfos { get; set; } + } + + public class ContractInfoObject + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public List InstrumentType { get; set; } + + [JsonProperty("settlement_date", NullValueHandling = NullValueHandling.Ignore)] + public string SettlementDate { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public string CreateDate { get; set; } + + [JsonProperty("contract_status", NullValueHandling = NullValueHandling.Ignore)] + public int ContractStatus { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/TimestampResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/TimestampResponse.cs new file mode 100644 index 0000000..b87897a --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Common/TimestampResponse.cs @@ -0,0 +1,13 @@ +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.RESTful.Response.Common +{ + public class TimestampResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/BatchMergedResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/BatchMergedResponse.cs new file mode 100644 index 0000000..848c382 --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/BatchMergedResponse.cs @@ -0,0 +1,59 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.RESTful.Response.Market +{ + public class BatchMergedResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("ticks", NullValueHandling = NullValueHandling.Ignore)] + public List Ticks { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + public class TickObject + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public long Id { get; set; } + + [JsonProperty("amount", NullValueHandling = NullValueHandling.Ignore)] + public string Amount { get; set; } + + [JsonProperty("ask", NullValueHandling = NullValueHandling.Ignore)] + public float[] Ask { get; set; } + + [JsonProperty("bid", NullValueHandling = NullValueHandling.Ignore)] + public float[] Bid { get; set; } + + [JsonProperty("open", NullValueHandling = NullValueHandling.Ignore)] + public string Open { get; set; } + + [JsonProperty("close", NullValueHandling = NullValueHandling.Ignore)] + public string Close { get; set; } + + [JsonProperty("count", NullValueHandling = NullValueHandling.Ignore)] + public decimal Count { get; set; } + + [JsonProperty("high", NullValueHandling = NullValueHandling.Ignore)] + public string High { get; set; } + + [JsonProperty("low", NullValueHandling = NullValueHandling.Ignore)] + public string Low { get; set; } + + [JsonProperty("vol", NullValueHandling = NullValueHandling.Ignore)] + public string Vol { get; set; } + + [JsonProperty("number_of", NullValueHandling = NullValueHandling.Ignore)] + public string NumberOf { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetAdjustFactorfundResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetAdjustFactorfundResponse.cs index 91e4fbd..8412c02 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetAdjustFactorfundResponse.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetAdjustFactorfundResponse.cs @@ -26,7 +26,7 @@ public class Data [JsonProperty("contract_code")] public string contractCode { get; set; } - [JsonProperty("margin_mode")] + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] public string marginMode { get; set; } public List list { get; set; } diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetBatchMergedResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetBatchMergedResponse.cs index 894ffed..fd4a018 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetBatchMergedResponse.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetBatchMergedResponse.cs @@ -46,6 +46,9 @@ public class Tick [JsonProperty("trade_turnover")] public string tradeTurnover { get; set; } + + [JsonProperty("number_of")] + public string numberOf { get; set; } public long ts { get; set; } } diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetStrKLineResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetStrKLineResponse.cs index e2f8092..429c422 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetStrKLineResponse.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Market/GetStrKLineResponse.cs @@ -44,6 +44,9 @@ public class Data public string high { get; set; } public string amount { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling = NullValueHandling.Ignore)] + public string tradeTurnover { get; set; } } } } diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/GetOrderDetailResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/GetOrderDetailResponse.cs index d251e36..9f178a2 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/GetOrderDetailResponse.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/GetOrderDetailResponse.cs @@ -110,6 +110,9 @@ public class Data [JsonProperty("real_profit")] public double realProfit { get; set; } + + [JsonProperty("canceled_source", NullValueHandling = NullValueHandling.Ignore)] + public string canceledSource { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public List trades { get; set; } diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/GetOrderInfoResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/GetOrderInfoResponse.cs index 0408961..bbfe1cb 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/GetOrderInfoResponse.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/GetOrderInfoResponse.cs @@ -92,6 +92,9 @@ public class Data [JsonProperty("real_profit")] public double realProfit { get; set; } + + [JsonProperty("canceled_source", NullValueHandling = NullValueHandling.Ignore)] + public string canceledSource { get; set; } } } } diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwapHisOrdersExactResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwapHisOrdersExactResponse.cs new file mode 100644 index 0000000..db11c4e --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwapHisOrdersExactResponse.cs @@ -0,0 +1,101 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.RESTful.Response.Order +{ + public class SwapHisOrdersExactResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapHisOrdersExact + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int LeverRate { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal Volume { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public decimal Price { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("order_price_type", NullValueHandling = NullValueHandling.Ignore)] + public string OrderPriceType { get; set; } + + [JsonProperty("margin_frozen", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginFrozen { get; set; } + + [JsonProperty("profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal Profit { get; set; } + + [JsonProperty("trade_volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("fee", NullValueHandling = NullValueHandling.Ignore)] + public decimal Fee { get; set; } + + [JsonProperty("trade_avg_price", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeAvgPrice { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public int Status { get; set; } + + [JsonProperty("order_type", NullValueHandling = NullValueHandling.Ignore)] + public int OrderType { get; set; } + + [JsonProperty("fee_asset", NullValueHandling = NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("liquidation_type", NullValueHandling = NullValueHandling.Ignore)] + public string LiquidationType { get; set; } + + [JsonProperty("is_tpsl", NullValueHandling = NullValueHandling.Ignore)] + public int IsTpsl { get; set; } + + [JsonProperty("real_profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("canceled_source", NullValueHandling = NullValueHandling.Ignore)] + public string CanceledSource { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwapHisOrdersResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwapHisOrdersResponse.cs new file mode 100644 index 0000000..89e6063 --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwapHisOrdersResponse.cs @@ -0,0 +1,104 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.RESTful.Response.Order +{ + public class SwapHisOrdersResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapHisOrders + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int LeverRate { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal Volume { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public decimal Price { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("update_time", NullValueHandling = NullValueHandling.Ignore)] + public long UpdateTime { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("order_price_type", NullValueHandling = NullValueHandling.Ignore)] + public string OrderPriceType { get; set; } + + [JsonProperty("margin_frozen", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginFrozen { get; set; } + + [JsonProperty("profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal Profit { get; set; } + + [JsonProperty("trade_volume", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("fee", NullValueHandling =NullValueHandling.Ignore)] + public decimal Fee { get; set; } + + [JsonProperty("trade_avg_price", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeAvgPrice { get; set; } + + [JsonProperty("status", NullValueHandling =NullValueHandling.Ignore)] + public int Status { get; set; } + + [JsonProperty("order_type", NullValueHandling =NullValueHandling.Ignore)] + public int OrderType { get; set; } + + [JsonProperty("fee_asset", NullValueHandling =NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("liquidation_type", NullValueHandling =NullValueHandling.Ignore)] + public string LiquidationType { get; set; } + + [JsonProperty("is_tpsl", NullValueHandling =NullValueHandling.Ignore)] + public int IsTpsl { get; set; } + + [JsonProperty("real_profit", NullValueHandling =NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("canceled_source", NullValueHandling =NullValueHandling.Ignore)] + public string CanceledSource { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwapMatchResultsResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwapMatchResultsResponse.cs new file mode 100644 index 0000000..43b0499 --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwapMatchResultsResponse.cs @@ -0,0 +1,83 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.RESTful.Response.Order +{ + public class SwapMatchResultsResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapMatchResults + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("match_id", NullValueHandling = NullValueHandling.Ignore)] + public long MatchId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("trade_volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_price", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradePrice { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("offset_profitloss", NullValueHandling = NullValueHandling.Ignore)] + public decimal OffsetProfitloss { get; set; } + + [JsonProperty("trade_fee", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeFee { get; set; } + + [JsonProperty("role", NullValueHandling = NullValueHandling.Ignore)] + public string Role { get; set; } + + [JsonProperty("real_profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("fee_asset", NullValueHandling = NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwitchLeverRateResponse.cs b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwitchLeverRateResponse.cs index c5c8750..034b72e 100644 --- a/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwitchLeverRateResponse.cs +++ b/Huobi.SDK.Core/CoinSwap/RESTful/Response/Order/SwitchLeverRateResponse.cs @@ -29,7 +29,7 @@ public class Data [JsonProperty("lever_rate")] public int leverRate { get; set; } - [JsonProperty("margin_mode")] + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] public string marginMode { get; set; } } } diff --git a/Huobi.SDK.Core/CoinSwap/WS/Response/Notify/SubContractElementsResponse.cs b/Huobi.SDK.Core/CoinSwap/WS/Response/Notify/SubContractElementsResponse.cs new file mode 100644 index 0000000..f58ee7f --- /dev/null +++ b/Huobi.SDK.Core/CoinSwap/WS/Response/Notify/SubContractElementsResponse.cs @@ -0,0 +1,110 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.CoinSwap.WS.Response.Notify +{ + public class SubContractElementsResponse + { + [JsonProperty("op", NullValueHandling = NullValueHandling.Ignore)] + public string Op { get; set; } + + [JsonProperty("event", NullValueHandling = NullValueHandling.Ignore)] + public string Event { get; set; } + + [JsonProperty("topic", NullValueHandling = NullValueHandling.Ignore)] + public string Topic { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public SubContractElements Data { get; set; } + + public class SubContractElements + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("instrument_index_code", NullValueHandling = NullValueHandling.Ignore)] + public string InstrumentIndexCode { get; set; } + + [JsonProperty("real_time_settlement", NullValueHandling = NullValueHandling.Ignore)] + public int RealTimeSettlement { get; set; } + + [JsonProperty("transfer_profit_ratio", NullValueHandling = NullValueHandling.Ignore)] + public int TransferProfitRatio { get; set; } + + [JsonProperty("settle_period", NullValueHandling = NullValueHandling.Ignore)] + public int SettlePeriod { get; set; } + + [JsonProperty("min_level", NullValueHandling = NullValueHandling.Ignore)] + public string MinLevel { get; set; } + + [JsonProperty("max_level", NullValueHandling = NullValueHandling.Ignore)] + public string MaxLevel { get; set; } + + [JsonProperty("price_tick", NullValueHandling = NullValueHandling.Ignore)] + public string PriceTick { get; set; } + + [JsonProperty("open_order_limit", NullValueHandling = NullValueHandling.Ignore)] + public string OpenOrderLimit { get; set; } + + [JsonProperty("offset_order_limit", NullValueHandling = NullValueHandling.Ignore)] + public string OffsetOrderLimit { get; set; } + + [JsonProperty("long_position_limit", NullValueHandling = NullValueHandling.Ignore)] + public string LongPositionLimit { get; set; } + + [JsonProperty("short_position_limit", NullValueHandling = NullValueHandling.Ignore)] + public string ShortPositionLimit { get; set; } + + [JsonProperty("funding_rate_cap", NullValueHandling = NullValueHandling.Ignore)] + public string FundingRateCap { get; set; } + + [JsonProperty("funding_rate_floor", NullValueHandling = NullValueHandling.Ignore)] + public string FundingRateFloor { get; set; } + + [JsonProperty("hig_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public string HigNormalLimit { get; set; } + + [JsonProperty("min_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public string MinNormalLimit { get; set; } + + [JsonProperty("hig_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public string HigOpenLimit { get; set; } + + [JsonProperty("min_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public string MinOpenLimit { get; set; } + + [JsonProperty("hig_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public string HigTradeLimit { get; set; } + + [JsonProperty("min_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public string MinTradeLimit { get; set; } + + [JsonProperty("instrument_value", NullValueHandling = NullValueHandling.Ignore)] + public string InstrumentValue { get; set; } + + [JsonProperty("contract_infos", NullValueHandling = NullValueHandling.Ignore)] + public List ContractInfos { get; set; } + } + + public class ContractInfo + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("delivery_time", NullValueHandling = NullValueHandling.Ignore)] + public string DeliveryTime { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public string CreateDate { get; set; } + + [JsonProperty("contract_status", NullValueHandling = NullValueHandling.Ignore)] + public int ContractStatus { get; set; } + + [JsonProperty("settlement_date", NullValueHandling = NullValueHandling.Ignore)] + public string SettlementDate { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/CoinSwap/WS/WSNotifyClient.cs b/Huobi.SDK.Core/CoinSwap/WS/WSNotifyClient.cs index afcaa42..f51de9e 100644 --- a/Huobi.SDK.Core/CoinSwap/WS/WSNotifyClient.cs +++ b/Huobi.SDK.Core/CoinSwap/WS/WSNotifyClient.cs @@ -391,5 +391,54 @@ public void UnsubTriggerOrder(string contractCode, string cid = WebSocketOp.DEFA } #endregion + #region contract elements + public delegate void _OnSubContractElementsResponse(SubContractElementsResponse data); + + /// + /// sub contract elements + /// + /// + /// + /// + /// + /// + public void SubContractElements(string contractCode, _OnSubContractElementsResponse callbackFun, string cid = WebSocketOp.DEFAULT_ID, + string businessType = null, string tradePartition = null) + { + string ch = $"public.{contractCode}.contract_elements"; + WSOpData opData = new WSOpData { op = "sub", cid = cid, topic = ch, businessType = businessType, tradePartition = tradePartition }; + string sub_str = JsonConvert.SerializeObject(opData); + + WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubContractElementsResponse), true, this.host, + this.accessKey, this.secretKey); + wsop.Connect(); + if (!allWsop.ContainsKey(ch)) + { + allWsop.Add(ch, wsop); + } + } + + /// + /// unsub contract elements + /// + /// + /// + /// + /// + public void UnsubContractElements(string contractCode, string cid = WebSocketOp.DEFAULT_ID, + string businessType = null, string tradePartition = null) + { + string ch = $"public.{contractCode}.contract_elements"; + WSOpData opData = new WSOpData { op = "unsub", cid = cid, topic = ch, businessType = businessType, tradePartition = tradePartition }; + string unsub_str = JsonConvert.SerializeObject(opData); + + if(!allWsop.ContainsKey(ch)) + { + return; + } + allWsop[ch].SendMsg(unsub_str); + allWsop.Remove(ch); + } + #endregion } } \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/AccountClient.cs b/Huobi.SDK.Core/Futures/RESTful/AccountClient.cs index aacc067..78288be 100644 --- a/Huobi.SDK.Core/Futures/RESTful/AccountClient.cs +++ b/Huobi.SDK.Core/Futures/RESTful/AccountClient.cs @@ -136,8 +136,10 @@ public async Task SetSubAuthAsync(string subUid, int subAuth /// get all sub account assets /// /// such as BTC-USDT + /// direct + /// fromId /// - public async Task GetAllSubAssetsAsync(string symbol = null) + public async Task GetAllSubAssetsAsync(string symbol = null, string direct = null, string fromId = null) { // ulr string url = _urlBuilder.Build(POST_METHOD, "/api/v1/contract_sub_account_list"); @@ -148,6 +150,14 @@ public async Task GetAllSubAssetsAsync(string symbol = { content = $",\"symbol\": \"{symbol}\""; } + if (direct != null) + { + content = $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content = $",\"fromId\": \"{fromId}\""; + } if (content != null) { content = $"{{ {content.Substring(1)} }}"; @@ -443,14 +453,17 @@ public async Task GetAccountPositionAsync(string sym return await HttpRequest.PostAsync(url, content); } - public async Task AccountTransferAsync(string symbol, double amount, long subUid, string type) + public async Task AccountTransferAsync(string symbol, double amount, long subUid, string type, long? clientCrderId = null) { // ulr string url = _urlBuilder.Build(POST_METHOD, "/api/v1/contract_master_sub_transfer"); // content string content = $"{{ \"symbol\":\"{symbol}\", \"amount\":{amount}, \"sub_uid\":{subUid}, \"type\":\"{type}\" }}"; - + if (clientCrderId != null) + { + content += $",\"client_order_id\": {clientCrderId}"; + } return await HttpRequest.PostAsync(url, content); } @@ -481,6 +494,163 @@ public async Task GetValidLeverRateAsync(string symbo string content = $"{{ \"symbol\": \"{symbol}\" }}"; return await HttpRequest.PostAsync(url, content); } + + /// + /// 查询单个子账户持仓信息 + /// + /// + /// + /// + public async Task ContractSubPositionInfoAsync(long subUid, string symbol = null) + { + // ulr + string url = _urlBuilder.Build(POST_METHOD, "/api/v1/contract_sub_position_info"); + + // content + string content = null; + content += $",\"sub_uid\": {subUid}"; + if (symbol != null) + { + content += $",\"symbol\": \"{symbol}\""; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 查询用户财务记录(新) + /// + /// + /// + /// + /// + /// + /// + /// + public async Task ContractFinancialRecordAsync(string symbol, string type, + long? startTime = null, long? endTime = null, string direct = null, long? fromId = null) + { + // ulr + string url = _urlBuilder.Build(POST_METHOD, "/api/v3/contract_financial_record"); + + // content + string content = null; + content += $",\"symbol\": \"{symbol}\""; + content += $",\"type\": \"{type}\""; + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 组合查询用户财务记录(新) + /// + /// + /// + /// + /// + /// + /// + /// + public async Task ContractFinancialRecordExactAsync(string symbol, string type, + long? startTime = null, long? endTime = null, string direct = null, long? fromId = null) + { + // ulr + string url = _urlBuilder.Build(POST_METHOD, "/api/v3/contract_financial_record_exact"); + + // content + string content = null; + content += $",\"symbol\": \"{symbol}\""; + content += $",\"type\": \"{type}\""; + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 查询子账户交易权限 + /// + /// + /// + /// + /// + /// + /// + public async Task ContractSubAuthListAsync(string subUid = null, long? startTime = null, + long? endTime = null, string direct = null, long? fromId = null) + { + // location + string location = "/api/v1/contract_sub_auth_list"; + + // option + string option = null; + if (subUid != null) + { + option += $"sub_uid={subUid}"; + } + if (startTime != null) + { + option += $"start_time={startTime}"; + } + if (endTime != null) + { + option += $"end_time={endTime}"; + } + if (direct != null) + { + option += $"direct={direct}"; + } + if (fromId != null) + { + option += $"from_id={fromId}"; + } + if (option != null) + { + location += $"?{option}"; + } + + string url = _urlBuilder.Build(GET_METHOD, location); + return await HttpRequest.GetAsync(url); + } } } diff --git a/Huobi.SDK.Core/Futures/RESTful/CommonClient.cs b/Huobi.SDK.Core/Futures/RESTful/CommonClient.cs new file mode 100644 index 0000000..73e124d --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/CommonClient.cs @@ -0,0 +1,165 @@ + +using System.Threading.Tasks; +using Huobi.SDK.Core.Futures.RESTful.Response.Common; +using Huobi.SDK.Core.RequestBuilder; + +namespace Huobi.SDK.Core.Futures.RESTful +{ + /// + /// Responsible to get market information + /// + public class CommonClient + { + private PublicUrlBuilder _urlBuilder; + + /// + /// Constructor + /// + /// the host that the client connects to + public CommonClient(string host = Host.FUTURES) + { + _urlBuilder = new PublicUrlBuilder(host); + } + + /// + /// 获取平台阶梯保证金 + /// + /// + /// + public async Task ContractLadderMarginAsync(string symbol = null) + { + // location + string location = "api/v1/contract_ladder_margin"; + + // option + string option = null; + if (symbol != null) + { + option += $"&symbol={symbol}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 获取强平订单(新) + /// + /// + /// + /// + /// + /// + /// + /// + public async Task ContractLiquidationOrdersAsync(string symbol, int tradeType, + long? startTime = null, long? endTime = null, string direct = null, long? fromId = null) + { + // location + string location = "/api/v3/contract_liquidation_orders"; + + // option + string option = null; + if (symbol != null) + { + option += $"&symbol={symbol}"; + } + if (symbol != null) + { + option += $"&trade_type={symbol}"; + } + if (symbol != null) + { + option += $"&start_time={symbol}"; + } + if (symbol != null) + { + option += $"&end_time={symbol}"; + } + if (direct != null) + { + option += $"&direct={direct}"; + } + if (symbol != null) + { + option += $"&from_id={symbol}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 合约要素 + /// + /// + /// + public async Task ContractQueryElementsAsync(string contractCode = null) + { + // location + string location = "/api/v1/contract_query_elements"; + + // option + string option = null; + if (contractCode != null) + { + option += $"&contract_code={contractCode}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 获取当前系统时间戳 + /// + /// + public async Task TimestampAsync() + { + // location + string location = "/api/v1/timestamp"; + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 查询系统是否可用 + /// + /// + public async Task HeartbeatAsync() + { + // location + string location = "/heartbeat/"; + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 获取当前系统状态 + /// + /// + public async Task SummaryAsync() + { + // location + string location = "/api/v2/summary.json"; + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + } +} diff --git a/Huobi.SDK.Core/Futures/RESTful/MarketClient.cs b/Huobi.SDK.Core/Futures/RESTful/MarketClient.cs index 7e8d237..c26b169 100644 --- a/Huobi.SDK.Core/Futures/RESTful/MarketClient.cs +++ b/Huobi.SDK.Core/Futures/RESTful/MarketClient.cs @@ -169,12 +169,16 @@ public async Task GetDeliveryPriceAsync(string symbol) /// /// /// + /// /// - public async Task GetDepthAsync(string symbol, string type) + public async Task GetDepthAsync(string symbol, string type, int? depth = null) { // location string location = $"/market/depth?symbol={symbol}&type={type}"; - + if (depth != null) + { + location += $"&depth={depth}"; + } string url = _urlBuilder.Build(location); return await HttpRequest.GetAsync(url); } @@ -625,6 +629,26 @@ public async Task GetBboAsync(string symbol = null) string url = _urlBuilder.Build(location); return await HttpRequest.GetAsync(url); } + + public async Task BatchMergedAsync(string symbol = null) + { + // location + string location = "/v2/market/detail/batch_merged"; + + // option + string option = null; + if (symbol != null) + { + option += $"symbol={symbol}"; + } + if (option != null) + { + location += $"?{option}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } } } diff --git a/Huobi.SDK.Core/Futures/RESTful/OrderClient.cs b/Huobi.SDK.Core/Futures/RESTful/OrderClient.cs index 8913b63..5182aad 100644 --- a/Huobi.SDK.Core/Futures/RESTful/OrderClient.cs +++ b/Huobi.SDK.Core/Futures/RESTful/OrderClient.cs @@ -479,5 +479,231 @@ public async Task LightningCloseAsync(string symbol, dou return await HttpRequest.PostAsync(url, content); } + /// + /// 自动撤单 + /// + /// + /// + /// + public async Task ContractCancelAfterAsync(int onOff, int? timeOut = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/api/v1/contract-cancel-after"); + + // content + string content = $",\"on_off\": {onOff}"; + if (timeOut != null) + { + content += $",\"time_out\": {timeOut}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 获取合约历史委托(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task ContractHisOrdersAsync(string symbol, int tradeType, int type, string status, + string contract = null, string orderType = null, string sortBy = null, long? startTime = null, long? endTime = null, + string direct = null, long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/api/v3/contract_hisorders"); + + // content + string content = $",\"symbol\": \"{symbol}\",\"trade_type\": {tradeType},\"type\": {type},\"status\": \"{status}\""; + if (contract != null) + { + content += $",\"contract\": \"{contract}\""; + } + if (orderType != null) + { + content += $",\"order_type\": \"{orderType}\""; + } + if (sortBy != null) + { + content += $",\"sort_by\": \"{sortBy}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 组合查询合约历史委托(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task ContractHisOrdersExactAsync(string symbol, int tradeType, int type, string status, + string contract = null, string orderType = null, long? startTime = null, long? endTime = null, + string direct = null, long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/api/v3/contract_hisorders_exact"); + + // content + string content = $",\"symbol\": \"{symbol}\",\"trade_type\": {tradeType},\"type\": {type},\"status\": \"{status}\""; + if (contract != null) + { + content += $",\"contract\": \"{contract}\""; + } + if (orderType != null) + { + content += $",\"order_type\": \"{orderType}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 获取历史成交记录(新) + /// + /// + /// + /// + /// + /// + /// + /// + public async Task ContractMatchResultsAsync(string symbol, int tradeType, + long? startTime = null, long? endTime = null, + string direct = null, long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/api/v3/contract_matchresults"); + + // content + string content = $",\"symbol\": \"{symbol}\",\"trade_type\": {tradeType}"; + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 组合查询历史成交记录接口(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task ContractMatchResultsExactAsync(string symbol, string contract, int tradeType, + long? startTime = null, long? endTime = null, + string direct = null, long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/api/v3/contract_matchresults_exact"); + + // content + string content = $",\"symbol\": \"{symbol}\",\"contract\": \"{contract}\",\"trade_type\": {tradeType}"; + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } } } diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Account/AccountTansferResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Account/AccountTansferResponse.cs index 347fb8d..bf1c95b 100644 --- a/Huobi.SDK.Core/Futures/RESTful/Response/Account/AccountTansferResponse.cs +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Account/AccountTansferResponse.cs @@ -26,6 +26,9 @@ public class Data { [JsonProperty("order_id")] public string orderId { get; set; } + + [JsonProperty("client_order_id", NullValueHandling = NullValueHandling.Ignore)] + public long clientOrderId { get; set; } } } } diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractFinancialRecordExactResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractFinancialRecordExactResponse.cs new file mode 100644 index 0000000..730ce58 --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractFinancialRecordExactResponse.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Account +{ + public class ContractFinancialRecordExactResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class ContractFinancialRecordExact + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public long Id { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] + public int Type { get; set; } + + [JsonProperty("amount", NullValueHandling = NullValueHandling.Ignore)] + public decimal Amount { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractFinancialRecordResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractFinancialRecordResponse.cs new file mode 100644 index 0000000..f3f019c --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractFinancialRecordResponse.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Account +{ + public class ContractFinancialRecordResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class ContractFinancialRecord + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public long Id { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] + public int Type { get; set; } + + [JsonProperty("amount", NullValueHandling = NullValueHandling.Ignore)] + public decimal Amount { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractSubAuthListResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractSubAuthListResponse.cs new file mode 100644 index 0000000..b2490ce --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractSubAuthListResponse.cs @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Account +{ + public class ContractSubAuthListResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public ContractSubAuthList Data { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + public class ContractSubAuthList + { + [JsonProperty("errors", NullValueHandling = NullValueHandling.Ignore)] + public List Errors { get; set; } + + [JsonProperty("successes", NullValueHandling = NullValueHandling.Ignore)] + public List Successes { get; set; } + } + + public class ErrorsObject + { + [JsonProperty("sub_uid", NullValueHandling = NullValueHandling.Ignore)] + public string SubUid { get; set; } + + [JsonProperty("err_code", NullValueHandling = NullValueHandling.Ignore)] + public string ErrCode { get; set; } + + [JsonProperty("err_msg", NullValueHandling = NullValueHandling.Ignore)] + public string ErrMsg { get; set; } + } + + public class SuccessesObject + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public string QueryId { get; set; } + + [JsonProperty("sub_uid", NullValueHandling = NullValueHandling.Ignore)] + public string SubUid { get; set; } + + [JsonProperty("sub_auth", NullValueHandling = NullValueHandling.Ignore)] + public string SubAuth { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractSubPositionInfoResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractSubPositionInfoResponse.cs new file mode 100644 index 0000000..ed2f21d --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Account/ContractSubPositionInfoResponse.cs @@ -0,0 +1,77 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Account +{ + public class ContractSubPositionInfoResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class ContractSubPositionInfo + { + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("contract_type", NullValueHandling = NullValueHandling.Ignore)] + public string ContractType { get; set; } + + [JsonProperty("volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal Volume { get; set; } + + [JsonProperty("available", NullValueHandling = NullValueHandling.Ignore)] + public decimal Available { get; set; } + + [JsonProperty("frozen", NullValueHandling = NullValueHandling.Ignore)] + public decimal Frozen { get; set; } + + [JsonProperty("cost_open", NullValueHandling = NullValueHandling.Ignore)] + public decimal CostOpen { get; set; } + + [JsonProperty("cost_hold", NullValueHandling = NullValueHandling.Ignore)] + public decimal CostHold { get; set; } + + [JsonProperty("profit_unreal", NullValueHandling = NullValueHandling.Ignore)] + public decimal ProfitUnreal { get; set; } + + [JsonProperty("profit_rate", NullValueHandling = NullValueHandling.Ignore)] + public decimal ProfitRate { get; set; } + + [JsonProperty("profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal Profit { get; set; } + + [JsonProperty("position_margin", NullValueHandling = NullValueHandling.Ignore)] + public decimal PositionMargin { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int LeverRate { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("last_price", NullValueHandling = NullValueHandling.Ignore)] + public decimal LastPrice { get; set; } + + [JsonProperty("adl_risk_percent", NullValueHandling = NullValueHandling.Ignore)] + public decimal AdlRiskPercent { get; set; } + + [JsonProperty("liq_px", NullValueHandling = NullValueHandling.Ignore)] + public string liqPx { get; set; } + + [JsonProperty("new_risk_rate", NullValueHandling = NullValueHandling.Ignore)] + public decimal NewRiskRate { get; set; } + + [JsonProperty("trade_partition", NullValueHandling = NullValueHandling.Ignore)] + public string TradePartition { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetAccountPositionResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetAccountPositionResponse.cs index db6673d..8d41a26 100644 --- a/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetAccountPositionResponse.cs +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetAccountPositionResponse.cs @@ -103,6 +103,9 @@ public class Positions [JsonProperty("last_price")] public double lastPrice { get; set; } + + [JsonProperty("adl_risk_percent", NullValueHandling = NullValueHandling.Ignore)] + public double adlRiskPercent { get; set; } } } } diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetAllSubAssetsResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetAllSubAssetsResponse.cs index c80af46..a6e195a 100644 --- a/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetAllSubAssetsResponse.cs +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetAllSubAssetsResponse.cs @@ -43,6 +43,9 @@ public class CoinAssets [JsonProperty("risk_rate", NullValueHandling = NullValueHandling.Ignore)] public double riskRate { get; set; } + + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long queryId { get; set; } } } } diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetPositionInfoResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetPositionInfoResponse.cs index 35c922c..6b24dbd 100644 --- a/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetPositionInfoResponse.cs +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Account/GetPositionInfoResponse.cs @@ -63,6 +63,18 @@ public class Data [JsonProperty("last_price")] public double lastPrice { get; set; } + + [JsonProperty("adl_risk_percent", NullValueHandling = NullValueHandling.Ignore)] + public double adlRiskPercent { get; set; } + + [JsonProperty("liq_px", NullValueHandling = NullValueHandling.Ignore)] + public string liqPx { get; set; } + + [JsonProperty("new_risk_rate", NullValueHandling = NullValueHandling.Ignore)] + public double newRiskRate { get; set; } + + [JsonProperty("trade_partition", NullValueHandling = NullValueHandling.Ignore)] + public string tradePartition { get; set; } } } } \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Common/ContractLadderMarginResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Common/ContractLadderMarginResponse.cs new file mode 100644 index 0000000..3815b10 --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Common/ContractLadderMarginResponse.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Common +{ + public class ContractLadderMarginResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class ContractLadderMargin + { + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("list", NullValueHandling = NullValueHandling.Ignore)] + public List List { get; set; } + } + + public class ListObject + { + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int LeverRate { get; set; } + + [JsonProperty("ladders", NullValueHandling = NullValueHandling.Ignore)] + public List Ladders { get; set; } + } + + public class LadderObject + { + [JsonProperty("min_margin_balance", NullValueHandling = NullValueHandling.Ignore)] + public decimal MinMarginBalance { get; set; } + + [JsonProperty("max_margin_balance", NullValueHandling = NullValueHandling.Ignore)] + public decimal MaxMarginBalance { get; set; } + + [JsonProperty("min_margin_available", NullValueHandling = NullValueHandling.Ignore)] + public decimal MinMarginAvailable { get; set; } + + [JsonProperty("max_margin_available", NullValueHandling = NullValueHandling.Ignore)] + public decimal MaxMarginAvailable { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Common/ContractLiquidationOrdersResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Common/ContractLiquidationOrdersResponse.cs new file mode 100644 index 0000000..22731cd --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Common/ContractLiquidationOrdersResponse.cs @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Common +{ + public class ContractLiquidationOrdersResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class ContractLiquidationOrders + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal Volume { get; set; } + + [JsonProperty("amount", NullValueHandling = NullValueHandling.Ignore)] + public decimal Amount { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public decimal Price { get; set; } + + [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] + public long CreatedAt { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Common/ContractQueryElementsResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Common/ContractQueryElementsResponse.cs new file mode 100644 index 0000000..83513b5 --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Common/ContractQueryElementsResponse.cs @@ -0,0 +1,164 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Common +{ + public class ContractQueryElementsResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + public class ContractQueryElements + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("instrument_index_code", NullValueHandling = NullValueHandling.Ignore)] + public string InstrumentIndexCode { get; set; } + + [JsonProperty("real_time_settlement", NullValueHandling = NullValueHandling.Ignore)] + public int RealTimeSettlement { get; set; } + + [JsonProperty("contract_infos", NullValueHandling = NullValueHandling.Ignore)] + public List ContractInfos { get; set; } + + [JsonProperty("transfer_profit_ratio", NullValueHandling = NullValueHandling.Ignore)] + public object TransferProfitRatio { get; set; } + + [JsonProperty("min_level", NullValueHandling = NullValueHandling.Ignore)] + public int MinLevel { get; set; } + + [JsonProperty("max_level", NullValueHandling = NullValueHandling.Ignore)] + public int MaxLevel { get; set; } + + [JsonProperty("open_order_limit", NullValueHandling = NullValueHandling.Ignore)] + public int OpenOrderLimit { get; set; } + + [JsonProperty("offset_order_limit", NullValueHandling = NullValueHandling.Ignore)] + public int OffsetOrderLimit { get; set; } + + [JsonProperty("long_position_limit", NullValueHandling = NullValueHandling.Ignore)] + public int LongPositionLimit { get; set; } + + [JsonProperty("short_position_limit", NullValueHandling = NullValueHandling.Ignore)] + public int ShortPositionLimit { get; set; } + + [JsonProperty("week_hig_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public int WeekHigNormalLimit { get; set; } + + [JsonProperty("week_min_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public int WeekMinNormalLimit { get; set; } + + [JsonProperty("week_hig_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public int WeekHigOpenLimit { get; set; } + + [JsonProperty("week_min_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public int WeekMinOpenLimit { get; set; } + + [JsonProperty("week_hig_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public int WeekHigTradeLimit { get; set; } + + [JsonProperty("week_min_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public int WeekMinTradeLimit { get; set; } + + [JsonProperty("biweek_hig_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public int BiweekHigNormalLimit { get; set; } + + [JsonProperty("biweek_min_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public int BiweekMinNormalLimit { get; set; } + + [JsonProperty("biweek_hig_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public int BiweekHigOpenLimit { get; set; } + + [JsonProperty("biweek_min_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public int BiweekMinOpenLimit { get; set; } + + [JsonProperty("biweek_hig_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public int BiweekHigTradeLimit { get; set; } + + [JsonProperty("biweek_min_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public int BiweekMinTradeLimit { get; set; } + + [JsonProperty("quarter_hig_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public int QuarterHigNormalLimit { get; set; } + + [JsonProperty("quarter_min_normal_limit", NullValueHandling =NullValueHandling.Ignore)] + public int QuarterMinNormalLimit { get; set; } + + [JsonProperty("quarter_hig_open_limit", NullValueHandling =NullValueHandling.Ignore)] + public int QuarterHigOpenLimit { get; set; } + + [JsonProperty("quarter_min_open_limit", NullValueHandling =NullValueHandling.Ignore)] + public int QuarterMinOpenLimit { get; set; } + + [JsonProperty("quarter_hig_trade_limit", NullValueHandling =NullValueHandling.Ignore)] + public int QuarterHigTradeLimit { get; set; } + + [JsonProperty("quarter_min_trade_limit", NullValueHandling =NullValueHandling.Ignore)] + public int QuarterMinTradeLimit { get; set; } + + [JsonProperty("biquarter_hig_normal_limit", NullValueHandling =NullValueHandling.Ignore)] + public int BiquarterHigNormalLimit { get; set; } + + [JsonProperty("biquarter_min_normal_limit", NullValueHandling =NullValueHandling.Ignore)] + public int BiquarterMinNormalLimit { get; set; } + + [JsonProperty("biquarter_hig_open_limit", NullValueHandling =NullValueHandling.Ignore)] + public int BiquarterHigOpenLimit { get; set; } + + [JsonProperty("biquarter_min_open_limit",NullValueHandling =NullValueHandling.Ignore)] + public int BiquarterMinOpenLimit { get; set; } + + [JsonProperty("biquarter_hig_trade_limit", NullValueHandling =NullValueHandling.Ignore)] + public int BiquarterHigTradeLimit { get; set; } + + [JsonProperty("biquarter_min_trade_limit", NullValueHandling =NullValueHandling.Ignore)] + public int BiquarterMinTradeLimit { get; set; } + + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public int[] InstrumentType { get; set; } + + [JsonProperty("order_limits", NullValueHandling = NullValueHandling.Ignore)] + public List OrderLimits { get; set; } + } + + public class ContractInfoObject + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public int InstrumentType { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public string CreateDate { get; set; } + + [JsonProperty("contract_status", NullValueHandling = NullValueHandling.Ignore)] + public int ContractStatus { get; set; } + + [JsonProperty("delivery_time", NullValueHandling = NullValueHandling.Ignore)] + public string DeliveryTime { get; set; } + + [JsonProperty("delivery_date", NullValueHandling =NullValueHandling.Ignore)] + public string DeliveryDate { get; set; } + } + + public class OrderLimitObject + { + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public int InstrumentType { get; set; } + + [JsonProperty("open", NullValueHandling = NullValueHandling.Ignore)] + public string Open { get; set; } + + [JsonProperty("close", NullValueHandling =NullValueHandling.Ignore)] + public string Close { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Common/HeartbeatResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Common/HeartbeatResponse.cs new file mode 100644 index 0000000..84b188b --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Common/HeartbeatResponse.cs @@ -0,0 +1,34 @@ +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Common +{ + public class HeartbeatResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public HeartbeatObject Data { get; set; } + + public class HeartbeatObject + { + [JsonProperty("heartbeat", NullValueHandling = NullValueHandling.Ignore)] + public int Heartbeat { get; set; } + + [JsonProperty("swap_heartbeat", NullValueHandling = NullValueHandling.Ignore)] + public int SwapHeartbeat { get; set; } + + [JsonProperty("estimated_recovery_time", NullValueHandling = NullValueHandling.Ignore)] + public long EstimatedRecoveryTime { get; set; } + + [JsonProperty("swap_estimated_recovery_time", NullValueHandling = NullValueHandling.Ignore)] + public long SwapEstimatedRecoveryTime { get; set; } + + [JsonProperty("linear_swap_heartbeat", NullValueHandling = NullValueHandling.Ignore)] + public long LinearSwapHeartbeat { get; set; } + + [JsonProperty("linear_swap_estimated_recovery_time", NullValueHandling = NullValueHandling.Ignore)] + public long LinearSwapEstimatedRecoveryTime { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Common/SummaryResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Common/SummaryResponse.cs new file mode 100644 index 0000000..f6af78b --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Common/SummaryResponse.cs @@ -0,0 +1,231 @@ +using System.Collections.Generic; +using System.ComponentModel; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Common +{ + public class SummaryResponse + { + [JsonProperty("page", NullValueHandling = NullValueHandling.Ignore)] + public Page page { get; set; } + + [JsonProperty("components", NullValueHandling = NullValueHandling.Ignore)] + public List Components { get; set; } + + [JsonProperty("incidents", NullValueHandling = NullValueHandling.Ignore)] + public List Incidents { get; set; } + + [JsonProperty("scheduled_maintenances", NullValueHandling = NullValueHandling.Ignore)] + public List ScheduledMaintenances { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public Status status { get; set; } + + public class Page + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + + [JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)] + public string Url { get; set; } + + [JsonProperty("time_zone", NullValueHandling = NullValueHandling.Ignore)] + public string TimeZone { get; set; } + + [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] + public string UpdatedAt { get; set; } + } + + public class Component + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] + public string CreatedAt { get; set; } + + [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] + public string UpdatedAt { get; set; } + + [JsonProperty("position", NullValueHandling = NullValueHandling.Ignore)] + public int? Position { get; set; } + + [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] + public object Description { get; set; } + + [JsonProperty("showcase", NullValueHandling = NullValueHandling.Ignore)] + public bool? Showcase { get; set; } + + [JsonProperty("group_id", NullValueHandling = NullValueHandling.Ignore)] + public object GroupId { get; set; } + + [JsonProperty("page_id", NullValueHandling = NullValueHandling.Ignore)] + public string PageId { get; set; } + + [JsonProperty("group", NullValueHandling = NullValueHandling.Ignore)] + public bool? Group { get; set; } + + [JsonProperty("only_show_if_degraded", NullValueHandling = NullValueHandling.Ignore)] + public bool? OnlyShowIfDegraded { get; set; } + } + + public class Incident + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] + public string CreatedAt { get; set; } + + [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] + public string UpdatedAt { get; set; } + + [JsonProperty("monitoring_at", NullValueHandling = NullValueHandling.Ignore)] + public object MonitoringAt { get; set; } + + [JsonProperty("resolved_at", NullValueHandling = NullValueHandling.Ignore)] + public object ResolvedAt { get; set; } + + [JsonProperty("impact", NullValueHandling = NullValueHandling.Ignore)] + public string Impact { get; set; } + + [JsonProperty("shortlink", NullValueHandling = NullValueHandling.Ignore)] + public string Shortlink { get; set; } + + [JsonProperty("started_at", NullValueHandling = NullValueHandling.Ignore)] + public string StartedAt { get; set; } + + [JsonProperty("page_id", NullValueHandling = NullValueHandling.Ignore)] + public string PageId { get; set; } + + [JsonProperty("incident_updates", NullValueHandling = NullValueHandling.Ignore)] + public List IncidentUpdates { get; set; } + + [JsonProperty("components", NullValueHandling = NullValueHandling.Ignore)] + public List Components { get; set; } + } + + public class IncidentUpdate + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("body", NullValueHandling = NullValueHandling.Ignore)] + public string Body { get; set; } + + [JsonProperty("incident_id", NullValueHandling = NullValueHandling.Ignore)] + public string IncidentId { get; set; } + + [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] + public string CreatedAt { get; set; } + + [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] + public string UpdatedAt { get; set; } + + [JsonProperty("display_at", NullValueHandling = NullValueHandling.Ignore)] + public string DisplayAt { get; set; } + + [JsonProperty("affected_components", NullValueHandling = NullValueHandling.Ignore)] + public AffectedComponent[] AffectedComponents { get; set; } + + [JsonProperty("deliver_notifications", NullValueHandling = NullValueHandling.Ignore)] + public bool? DeliverNotifications { get; set; } + + [JsonProperty("custom_tweet", NullValueHandling = NullValueHandling.Ignore)] + public object CustomTweet { get; set; } + + [JsonProperty("tweet_id", NullValueHandling = NullValueHandling.Ignore)] + public object TweetId { get; set; } + } + + public class AffectedComponent + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public string Code { get; set; } + + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + + [JsonProperty("old_status", NullValueHandling = NullValueHandling.Ignore)] + public string OldStatus { get; set; } + + [JsonProperty("new_status", NullValueHandling = NullValueHandling.Ignore)] + public string NewStatus { get; set; } + } + + public class ScheduledMaintenance + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] + public string Name { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] + public string CreatedAt { get; set; } + + [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] + public string UpdatedAt { get; set; } + + [JsonProperty("monitoring_at", NullValueHandling = NullValueHandling.Ignore)] + public object MonitoringAt { get; set; } + + [JsonProperty("resolved_at", NullValueHandling = NullValueHandling.Ignore)] + public object ResolvedAt { get; set; } + + [JsonProperty("impact", NullValueHandling = NullValueHandling.Ignore)] + public string Impact { get; set; } + + [JsonProperty("shortlink", NullValueHandling = NullValueHandling.Ignore)] + public string Shortlink { get; set; } + + [JsonProperty("started_at", NullValueHandling = NullValueHandling.Ignore)] + public string StartedAt { get; set; } + + [JsonProperty("page_id", NullValueHandling = NullValueHandling.Ignore)] + public string PageId { get; set; } + + [JsonProperty("incident_updates", NullValueHandling = NullValueHandling.Ignore)] + public List IncidentUpdates { get; set; } + + [JsonProperty("components", NullValueHandling = NullValueHandling.Ignore)] + public List Components { get; set; } + + [JsonProperty("scheduled_for", NullValueHandling = NullValueHandling.Ignore)] + public string ScheduledFor { get; set; } + + [JsonProperty("scheduled_until", NullValueHandling = NullValueHandling.Ignore)] + public string ScheduledUntil { get; set; } + } + + public class Status + { + [JsonProperty("indicator", NullValueHandling = NullValueHandling.Ignore)] + public string Indicator { get; set; } + + [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)] + public string Description { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Common/TimestampResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Common/TimestampResponse.cs new file mode 100644 index 0000000..c55b4f5 --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Common/TimestampResponse.cs @@ -0,0 +1,13 @@ +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Common +{ + public class TimestampResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Market/BatchMergedResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Market/BatchMergedResponse.cs new file mode 100644 index 0000000..441d961 --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Market/BatchMergedResponse.cs @@ -0,0 +1,59 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Market +{ + public class BatchMergedResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("ticks", NullValueHandling = NullValueHandling.Ignore)] + public List Ticks { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + public class TickObject + { + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public long Id { get; set; } + + [JsonProperty("amount", NullValueHandling = NullValueHandling.Ignore)] + public string Amount { get; set; } + + [JsonProperty("ask", NullValueHandling = NullValueHandling.Ignore)] + public float[] Ask { get; set; } + + [JsonProperty("bid", NullValueHandling = NullValueHandling.Ignore)] + public float[] Bid { get; set; } + + [JsonProperty("open", NullValueHandling = NullValueHandling.Ignore)] + public string Open { get; set; } + + [JsonProperty("close", NullValueHandling = NullValueHandling.Ignore)] + public string Close { get; set; } + + [JsonProperty("count", NullValueHandling = NullValueHandling.Ignore)] + public decimal Count { get; set; } + + [JsonProperty("high", NullValueHandling = NullValueHandling.Ignore)] + public string High { get; set; } + + [JsonProperty("low", NullValueHandling = NullValueHandling.Ignore)] + public string Low { get; set; } + + [JsonProperty("vol", NullValueHandling = NullValueHandling.Ignore)] + public string Vol { get; set; } + + [JsonProperty("number_of", NullValueHandling = NullValueHandling.Ignore)] + public string NumberOf { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetBatchMergedResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetBatchMergedResponse.cs index be0154a..f3b04e1 100644 --- a/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetBatchMergedResponse.cs +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetBatchMergedResponse.cs @@ -43,6 +43,9 @@ public class Tick public string low { get; set; } public string vol { get; set; } + + [JsonProperty("number_of-msg", NullValueHandling = NullValueHandling.Ignore)] + public string numberOf { get; set; } public long ts { get; set; } } diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetRiskInfoResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetRiskInfoResponse.cs index 4474974..c4d6116 100644 --- a/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetRiskInfoResponse.cs +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetRiskInfoResponse.cs @@ -27,8 +27,8 @@ public class Data [JsonProperty("insurance_fund")] public double insuranceFund { get; set; } - [JsonProperty("contract_code")] - public string contractCode { get; set; } + [JsonProperty("symbol")] + public string symbol { get; set; } } } diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetStrKLineResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetStrKLineResponse.cs index 91755a1..89cadca 100644 --- a/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetStrKLineResponse.cs +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Market/GetStrKLineResponse.cs @@ -26,6 +26,7 @@ public class GetStrKLineResponse public List data { get; set; } public long ts { get; set; } + public class Data { diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Order/ContractCancelAfterResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Order/ContractCancelAfterResponse.cs new file mode 100644 index 0000000..cac3540 --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Order/ContractCancelAfterResponse.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Order +{ + public class ContractCancelAfterResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public ContractCancelAfter Data { get; set; } + + public class ContractCancelAfter + { + [JsonProperty("current_time", NullValueHandling = NullValueHandling.Ignore)] + public long CurrentTime { get; set; } + + [JsonProperty("trigger_time", NullValueHandling = NullValueHandling.Ignore)] + public long TriggerTime { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Order/ContractHisOrdersResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Order/ContractHisOrdersResponse.cs new file mode 100644 index 0000000..bb62412 --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Order/ContractHisOrdersResponse.cs @@ -0,0 +1,107 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Order +{ + public class ContractHisOrdersResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class ContractHisOrders + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("contract_type", NullValueHandling = NullValueHandling.Ignore)] + public string ContractType { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int LeverRate { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal Volume { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public decimal Price { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("update_time", NullValueHandling = NullValueHandling.Ignore)] + public long UpdateTime { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("order_price_type", NullValueHandling = NullValueHandling.Ignore)] + public string OrderPriceType { get; set; } + + [JsonProperty("margin_frozen", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginFrozen { get; set; } + + [JsonProperty("profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal Profit { get; set; } + + [JsonProperty("trade_volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("fee", NullValueHandling = NullValueHandling.Ignore)] + public decimal Fee { get; set; } + + [JsonProperty("trade_avg_price", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeAvgPrice { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public int Status { get; set; } + + [JsonProperty("order_type", NullValueHandling = NullValueHandling.Ignore)] + public int OrderType { get; set; } + + [JsonProperty("fee_asset", NullValueHandling = NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("liquidation_type", NullValueHandling = NullValueHandling.Ignore)] + public string LiquidationType { get; set; } + + [JsonProperty("is_tpsl", NullValueHandling = NullValueHandling.Ignore)] + public int IsTpsl { get; set; } + + [JsonProperty("real_profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("canceled_source", NullValueHandling = NullValueHandling.Ignore)] + public string CanceledSource { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Order/ContractMatchResultsResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Order/ContractMatchResultsResponse.cs new file mode 100644 index 0000000..e28b49f --- /dev/null +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Order/ContractMatchResultsResponse.cs @@ -0,0 +1,83 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.RESTful.Response.Order +{ + public class ContractMatchResultsResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class ContractMatchResults + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("match_id", NullValueHandling = NullValueHandling.Ignore)] + public long MatchId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_type", NullValueHandling = NullValueHandling.Ignore)] + public string ContractType { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("trade_volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_price", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradePrice { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("offset_profitloss", NullValueHandling = NullValueHandling.Ignore)] + public decimal OffsetProfitloss { get; set; } + + [JsonProperty("trade_fee", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeFee { get; set; } + + [JsonProperty("role", NullValueHandling = NullValueHandling.Ignore)] + public string Role { get; set; } + + [JsonProperty("real_profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("fee_asset", NullValueHandling = NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Order/GetOrderDetailResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Order/GetOrderDetailResponse.cs index 1d2b4da..4533ca1 100644 --- a/Huobi.SDK.Core/Futures/RESTful/Response/Order/GetOrderDetailResponse.cs +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Order/GetOrderDetailResponse.cs @@ -58,6 +58,9 @@ public class Data public double marginFrozen { get; set; } public double profit { get; set; } + + [JsonProperty("canceled_source", NullValueHandling = NullValueHandling.Ignore)] + public string canceledSource { get; set; } [JsonProperty("instrument_price")] public double instrumentPrice { get; set; } diff --git a/Huobi.SDK.Core/Futures/RESTful/Response/Order/GetOrderInfoResponse.cs b/Huobi.SDK.Core/Futures/RESTful/Response/Order/GetOrderInfoResponse.cs index c7b115e..beb31c0 100644 --- a/Huobi.SDK.Core/Futures/RESTful/Response/Order/GetOrderInfoResponse.cs +++ b/Huobi.SDK.Core/Futures/RESTful/Response/Order/GetOrderInfoResponse.cs @@ -95,6 +95,9 @@ public class Data [JsonProperty("real_profit")] public double realProfit { get; set; } + + [JsonProperty("canceled_source", NullValueHandling = NullValueHandling.Ignore)] + public string canceledSource { get; set; } } } } diff --git a/Huobi.SDK.Core/Futures/WS/Response/Notify/SubContractElementsResponse.cs b/Huobi.SDK.Core/Futures/WS/Response/Notify/SubContractElementsResponse.cs new file mode 100644 index 0000000..4ac623d --- /dev/null +++ b/Huobi.SDK.Core/Futures/WS/Response/Notify/SubContractElementsResponse.cs @@ -0,0 +1,170 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.Futures.WS.Response.Notify +{ + public class SubContractElementsResponse + { + [JsonProperty("op", NullValueHandling = NullValueHandling.Ignore)] + public string Op { get; set; } + + [JsonProperty("event", NullValueHandling = NullValueHandling.Ignore)] + public string Event { get; set; } + + [JsonProperty("topic", NullValueHandling = NullValueHandling.Ignore)] + public string Topic { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public SubContractElements Data { get; set; } + + public class SubContractElements + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("instrument_index_code", NullValueHandling = NullValueHandling.Ignore)] + public string InstrumentIndexCode { get; set; } + + [JsonProperty("price_tick", NullValueHandling = NullValueHandling.Ignore)] + public string PriceTick { get; set; } + + [JsonProperty("instrument_value", NullValueHandling = NullValueHandling.Ignore)] + public string InstrumentValue { get; set; } + + [JsonProperty("real_time_settlement", NullValueHandling = NullValueHandling.Ignore)] + public int RealTimeSettlement { get; set; } + + [JsonProperty("transfer_profit_ratio", NullValueHandling = NullValueHandling.Ignore)] + public decimal TransferProfitRatio { get; set; } + + [JsonProperty("min_level", NullValueHandling = NullValueHandling.Ignore)] + public string MinLevel { get; set; } + + [JsonProperty("max_level", NullValueHandling = NullValueHandling.Ignore)] + public string MaxLevel { get; set; } + + [JsonProperty("open_order_limit", NullValueHandling = NullValueHandling.Ignore)] + public string OpenOrderLimit { get; set; } + + [JsonProperty("offset_order_limit", NullValueHandling = NullValueHandling.Ignore)] + public string OffsetOrderLimit { get; set; } + + [JsonProperty("long_position_limit", NullValueHandling = NullValueHandling.Ignore)] + public string LongPositionLimit { get; set; } + + [JsonProperty("short_position_limit", NullValueHandling = NullValueHandling.Ignore)] + public string ShortPositionLimit { get; set; } + + [JsonProperty("week_hig_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public double WeekHigNormalLimit { get; set; } + + [JsonProperty("week_min_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public double WeekMinNormalLimit { get; set; } + + [JsonProperty("week_hig_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public double WeekHigOpenLimit { get; set; } + + [JsonProperty("week_min_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public double WeekMinOpenLimit { get; set; } + + [JsonProperty("week_hig_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public double WeekHigTradeLimit { get; set; } + + [JsonProperty("week_min_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public double WeekMinTradeLimit { get; set; } + + [JsonProperty("biweek_hig_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public double BiweekHigNormalLimit { get; set; } + + [JsonProperty("biweek_min_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public double BiweekMinNormalLimit { get; set; } + + [JsonProperty("biweek_hig_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public double BiweekHigOpenLimit { get; set; } + + [JsonProperty("biweek_min_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public double BiweekMinOpenLimit { get; set; } + + [JsonProperty("biweek_hig_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public double BiweekHigTradeLimit { get; set; } + + [JsonProperty("quarter_hig_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public double QuarterHigNormalLimit { get; set; } + + [JsonProperty("quarter_min_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public double QuarterMinNormalLimit { get; set; } + + [JsonProperty("quarter_hig_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public double QuarterHigOpenLimit { get; set; } + + [JsonProperty("quarter_min_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public double QuarterMinOpenLimit { get; set; } + + [JsonProperty("quarter_hig_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public double QuarterHigTradeLimit { get; set; } + + [JsonProperty("quarter_min_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public double QuarterMinTradeLimit { get; set; } + + [JsonProperty("biquarter_hig_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public double BiquarterHigNormalLimit { get; set; } + + [JsonProperty("biquarter_min_normal_limit", NullValueHandling = NullValueHandling.Ignore)] + public double BiquarterMinNormalLimit { get; set; } + + [JsonProperty("biquarter_hig_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public double BiquarterHigOpenLimit { get; set; } + + [JsonProperty("biquarter_min_open_limit", NullValueHandling = NullValueHandling.Ignore)] + public double BiquarterMinOpenLimit { get; set; } + + [JsonProperty("biquarter_hig_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public double BiquarterHigTradeLimit { get; set; } + + [JsonProperty("biquarter_min_trade_limit", NullValueHandling = NullValueHandling.Ignore)] + public double BiquarterMinTradeLimit { get; set; } + + [JsonProperty("contract_infos", NullValueHandling = NullValueHandling.Ignore)] + public List ContractInfos { get; set; } + + [JsonProperty("order_limits", NullValueHandling = NullValueHandling.Ignore)] + public List OrderLimits { get; set; } + } + + public class ContractInfoEntity + { + [JsonProperty("delivery_time", NullValueHandling = NullValueHandling.Ignore)] + public string DeliveryTime { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public string CreateDate { get; set; } + + [JsonProperty("contract_status", NullValueHandling = NullValueHandling.Ignore)] + public int ContractStatus { get; set; } + + [JsonProperty("delivery_date", NullValueHandling = NullValueHandling.Ignore)] + public string DeliveryDate { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public List InstrumentType { get; set; } + + + } + public class OrderLimitEntity + { + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public int InstrumentType { get; set; } + [JsonProperty("open", NullValueHandling = NullValueHandling.Ignore)] + public string Open { get; set; } + [JsonProperty("close", NullValueHandling = NullValueHandling.Ignore)] + public string Close { get; set; } + } + + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/Futures/WS/WSNotifyClient.cs b/Huobi.SDK.Core/Futures/WS/WSNotifyClient.cs index 3287d62..5e088da 100644 --- a/Huobi.SDK.Core/Futures/WS/WSNotifyClient.cs +++ b/Huobi.SDK.Core/Futures/WS/WSNotifyClient.cs @@ -390,6 +390,56 @@ public void UnsubTriggerOrder(string contractCode, string cid = WebSocketOp.DEFA allWsop.Remove(ch); } #endregion + + #region contract elements + public delegate void _OnSubContractElementsResponse(SubContractElementsResponse data); + + /// + /// sub contract elements + /// + /// + /// + /// + /// + /// + public void SubContractElements(string contractCode, _OnSubContractElementsResponse callbackFun, string cid = WebSocketOp.DEFAULT_ID, + string businessType = null, string tradePartition = null) + { + string ch = $"public.{contractCode}.contract_elements"; + WSOpData opData = new WSOpData { op = "sub", cid = cid, topic = ch, businessType = businessType, tradePartition = tradePartition }; + string sub_str = JsonConvert.SerializeObject(opData); + + WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubContractElementsResponse), true, this.host, + this.accessKey, this.secretKey); + wsop.Connect(); + if (!allWsop.ContainsKey(ch)) + { + allWsop.Add(ch, wsop); + } + } + + /// + /// unsub contract elements + /// + /// + /// + /// + /// + public void UnsubContractElements(string contractCode, string cid = WebSocketOp.DEFAULT_ID, + string businessType = null, string tradePartition = null) + { + string ch = $"public.{contractCode}.contract_elements"; + WSOpData opData = new WSOpData { op = "unsub", cid = cid, topic = ch, businessType = businessType, tradePartition = tradePartition }; + string unsub_str = JsonConvert.SerializeObject(opData); + + if(!allWsop.ContainsKey(ch)) + { + return; + } + allWsop[ch].SendMsg(unsub_str); + allWsop.Remove(ch); + } + #endregion } } \ No newline at end of file diff --git a/Huobi.SDK.Core/Host.cs b/Huobi.SDK.Core/Host.cs index 4a83328..53aecdf 100644 --- a/Huobi.SDK.Core/Host.cs +++ b/Huobi.SDK.Core/Host.cs @@ -4,7 +4,7 @@ public class Host { public const string SPOT = "api.huobi.com"; - public const string FUTURES = "api.btcgateway.com"; + public const string FUTURES = "api.hbdm.com"; public const string HTTP_PRO = "https"; diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/AccountClient.cs b/Huobi.SDK.Core/LinearSwap/RESTful/AccountClient.cs index 46263fa..10114bc 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/AccountClient.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/AccountClient.cs @@ -233,11 +233,12 @@ public async Task CrossGetPositionInfoAsync(string cont /// get all sub account assets /// /// such as BTC-USDT - /// + /// + /// /// /// public async Task IsolatedGetAllSubAssetsAsync(string contractCode = null, - string tradePartition = null) + string direct = null, long? fromId = null) { // ulr string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v1/swap_sub_account_list"); @@ -248,9 +249,13 @@ public async Task IsolatedGetAllSubAssetsAsync(string c { content += $",\"contract_code\": \"{contractCode}\""; } - if (tradePartition != null) + if (direct != null) { - content += $",\"trade_partition\": \"{tradePartition}\""; + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"fromId\": {fromId}"; } if (content != null) { @@ -266,7 +271,7 @@ public async Task IsolatedGetAllSubAssetsAsync(string c /// /// public async Task CrossGetAllSubAssetsAsync(string marginAccount = null, - string tradePartition = null) + string direct = null, long? fromId = null) { // ulr string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v1/swap_cross_sub_account_list"); @@ -277,9 +282,13 @@ public async Task CrossGetAllSubAssetsAsync(string marg { content += $",\"margin_account\": \"{marginAccount}\""; } - if (tradePartition != null) + if (direct != null) { - content += $",\"trade_partition\": \"{tradePartition}\""; + content += $",\"trade_partition\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"fromId\": {fromId}"; } if (content != null) { @@ -418,11 +427,7 @@ public async Task IsolatedGetLeverPositionLimitAs /// /// public async Task CrossGetLeverPositionLimitAsync(string contractCode=null, - int? leverRate = null, - string contractType = null, - string pair = null, - string businessType = null, - string tradePartition = null) + int? leverRate = null) { // ulr string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v1/swap_cross_lever_position_limit"); @@ -437,22 +442,6 @@ public async Task CrossGetLeverPositionLimitAsync { content += $",\"lever_rate\": {leverRate}"; } - if (contractType != null) - { - content += $",\"contract_type\": \"{contractType}\""; - } - if (pair != null) - { - content += $",\"pair\": \"{pair}\""; - } - if (businessType != null) - { - content += $",\"business_type\": \"{businessType}\""; - } - if (tradePartition != null) - { - content += $",\"trade_partition\": \"{tradePartition}\""; - } if (content != null) { content = $"{{ {content.Substring(1)} }}"; @@ -1060,6 +1049,160 @@ public async Task GetApiTradingStatusAsync() // content is null return await HttpRequest.GetAsync(url); } + + /// + /// 【通用】查询用户财务记录(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapFinancialRecordAsync(string contract = null, string marAcct = null, + string type = null, long? startTime = null, long? endTime = null, string direct = null, long? fromId = null) + { + // ulr + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/swap_financial_record"); + + // content + string content = null; + if (contract != null) + { + content += $",\"contract\": \"{contract}\""; + } + if (marAcct != null) + { + content += $",\"mar_acct\": \"{marAcct}\""; + } + if (type != null) + { + content += $",\"type\": \"{type}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 【通用】组合查询用户财务记录 (新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapFinancialRecordExactAsync(string contract = null, string marAcct = null, + string type = null, long? startTime = null, long? endTime = null, string direct = null, long? fromId = null) + { + // ulr + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/swap_financial_record_exact"); + + // content + string content = null; + if (contract != null) + { + content += $",\"contract\": \"{contract}\""; + } + if (marAcct != null) + { + content += $",\"mar_acct\": \"{marAcct}\""; + } + if (type != null) + { + content += $",\"type\": \"{type}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 【通用】查询子账户交易权限 + /// + /// + /// + /// + /// + /// + /// + public async Task SwapSubAuthListAsync(string subUid = null, long? startTime = null, + long? endTime = null, string direct = null, long? fromId = null) + { + // location + string location = $"/linear-swap-api/v1/swap_sub_auth_list"; + + // option + string option = null; + if (subUid != null) + { + option += $"&sub_uid={subUid}"; + } + if (startTime != null) + { + option += $"&start_time={startTime}"; + } + if (endTime != null) + { + option += $"&end_time={endTime}"; + } + if (direct != null) + { + option += $"&direct={direct}"; + } + if (fromId != null) + { + option += $"&from_id={fromId}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(GET_METHOD, location); + return await HttpRequest.GetAsync(url); + } } } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/CommonClient.cs b/Huobi.SDK.Core/LinearSwap/RESTful/CommonClient.cs new file mode 100644 index 0000000..a99210b --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/CommonClient.cs @@ -0,0 +1,185 @@ +using System.Threading.Tasks; +using Huobi.SDK.Core.LinearSwap.RESTful.Response.Common; +using Huobi.SDK.Core.RequestBuilder; + +namespace Huobi.SDK.Core.LinearSwap.RESTful +{ + /// + /// Responsible to get market information + /// + public class CommonClient + { + private PublicUrlBuilder _urlBuilder; + + /// + /// Constructor + /// + /// the host that the client connects to + public CommonClient(string host = Host.FUTURES) + { + _urlBuilder = new PublicUrlBuilder(host); + } + + /// + /// 【通用】获取强平订单(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task GetSwapLiquidationOrdersAsync(string contract = null, + string pair = null, int? tradeType = null, long? startTime = null, long? endTime = null, + string direct = null, long? fromId = null) + { + // location + string location = "/linear-swap-api/v3/swap_liquidation_orders"; + + // option + string option = null; + if (contract != null) + { + option += $"&contract={contract}"; + } + if (pair != null) + { + option += $"&pair={pair}"; + } + if (tradeType != null) + { + option += $"&trade_type={tradeType}"; + } + if (startTime != null) + { + option += $"&start_time={startTime}"; + } + if (endTime != null) + { + option += $"&end_time={endTime}"; + } + if (direct != null) + { + option += $"&direct={direct}"; + } + if (fromId != null) + { + option += $"&from_id={fromId}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 【全仓】获取平台阶梯保证金 + /// + /// + /// + /// + /// + /// + public async Task GetSwapCrossLadderMarginAsync(string contractCode = null, + string pair = null, string contractType = null, string businessType = null) + { + // location + string location = "/linear-swap-api/v1/swap_cross_ladder_margin"; + + // option + string option = null; + if (contractCode != null) + { + option += $"&contract_code={contractCode}"; + } + if (pair != null) + { + option += $"&pair={pair}"; + } + if (contractType != null) + { + option += $"&contract_type={contractType}"; + } + if (businessType != null) + { + option += $"&business_type={businessType}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 【通用】合约要素 + /// + /// + /// + public async Task GetSwapQueryElementsAsync(string contractCode = null) + { + // location + string location = "/linear-swap-api/v1/swap_query_elements"; + + // option + string option = null; + if (contractCode != null) + { + option += $"&contract_code={contractCode}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 【通用】获取当前系统时间戳 + /// + /// + /// + public async Task GetTimestampAsync(string contractCode = null) + { + // location + string location = "/api/v1/timestamp"; + + // option + string option = null; + if (contractCode != null) + { + option += $"&contract_code={contractCode}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 【通用】停服维护 + /// + /// + /// + public async Task GetHeartbeatAsync() + { + // location + string location = "/heartbeat/"; + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } + } +} diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/MarketClient.cs b/Huobi.SDK.Core/LinearSwap/RESTful/MarketClient.cs index 0ad8711..aefd7c3 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/MarketClient.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/MarketClient.cs @@ -28,10 +28,11 @@ public MarketClient(string host = Host.FUTURES) /// /// /// + /// /// public async Task GetContractInfoAsync(string contractCode = null, string businessType = null, string contractType = null, string pair = null, - string tradePartition = null) + string tradePartition = null, string supportMarginMode = null) { // location string location = "/linear-swap-api/v1/swap_contract_info"; @@ -58,6 +59,10 @@ public async Task GetContractInfoAsync(string contractC { option += $"&trade_partition={tradePartition}"; } + if (supportMarginMode != null) + { + option += $"&support_margin_mode={supportMarginMode}"; + } if (option != null) { location += $"?{option.Substring(1)}"; @@ -1052,5 +1057,38 @@ public async Task GetEstimatedSettlementPri return await HttpRequest.GetAsync(url); } + + /// + /// 【通用】批量获取聚合行情(V2) + /// + /// + /// + /// + /// + /// + /// + public async Task GetDetailBatchMergedAsync(string contractCode = null, string businessType = null) + { + // location + string location = $"/v2/linear-swap-ex/market/detail/batch_merged"; + + // option + string option = null; + if (contractCode != null) + { + option += $"&contract_code={contractCode}"; + } + if (businessType != null) + { + option += $"&business_type={businessType}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(location); + return await HttpRequest.GetAsync(url); + } } } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/OrderClient.cs b/Huobi.SDK.Core/LinearSwap/RESTful/OrderClient.cs index 3992a8f..0884c13 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/OrderClient.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/OrderClient.cs @@ -986,5 +986,494 @@ public async Task CrossLightningCloseAsync(double volume return await HttpRequest.PostAsync(url, content); } + /// + /// 【通用】自动撤单 + /// + /// + /// + /// + public async Task LinearCancelAfterAsync(int onOff, int? timeOut = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v1/linear-cancel-after"); + + // content + string content = $",\"on_off\": {onOff}"; + if (timeOut != null) + { + content += $",\"time_out\": {timeOut}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 【逐仓】获取合约历史委托(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapHisOrdersAsync(int tradeType, int type, string status, + string contract = null, long? startTime = null, long? endTime = null, string direct = null, long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/swap_hisorders"); + + // content + string content = $",\"trade_type\": {tradeType},\"type\": {type},\"status\": \"{status}\""; + if (contract != null) + { + content += $",\"contract\": \"{contract}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 【全仓】获取合约历史委托(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapCrossHisOrdersAsync(int tradeType, int type, string status, + string contract = null, string pair = null, long? startTime = null, long? endTime = null, string direct = null, long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/swap_cross_hisorders"); + + // content + string content = $",\"trade_type\": {tradeType},\"type\": {type},\"status\": \"{status}\""; + if (contract != null) + { + content += $",\"contract\": \"{contract}\""; + } + if (pair != null) + { + content += $",\"pair\": \"{pair}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 【逐仓】组合查询合约历史委托(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapHisOrdersExactAsync(int tradeType, int type, string status, + string contract = null, string pair = null, long? startTime = null, long? endTime = null, string direct = null, + long? fromId = null, string priceType = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/swap_hisorders_exact"); + + // content + string content = $",\"trade_type\": {tradeType},\"type\": {type},\"status\": \"{status}\""; + if (contract != null) + { + content += $",\"contract\": \"{contract}\""; + } + if (pair != null) + { + content += $",\"pair\": \"{pair}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (priceType != null) + { + content += $",\"price_type\": \"{priceType}\""; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 【全仓】组合查询合约历史委托(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapCrossHisOrdersExactAsync(int tradeType, int type, string status, + string contract = null, string pair = null, long? startTime = null, long? endTime = null, string direct = null, + long? fromId = null, string priceType = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/swap_cross_hisorders_exact"); + + // content + string content = $",\"trade_type\": {tradeType},\"type\": {type},\"status\": \"{status}\""; + if (contract != null) + { + content += $",\"contract\": \"{contract}\""; + } + if (pair != null) + { + content += $",\"pair\": \"{pair}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (priceType != null) + { + content += $",\"price_type\": \"{priceType}\""; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 【逐仓】获取历史成交记录(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapMatchResultsAsync(int tradeType, + string contract = null, string pair = null, long? startTime = null, long? endTime = null, string direct = null, + long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/swap_matchresults"); + + // content + string content = $",\"trade_type\": {tradeType}"; + if (contract != null) + { + content += $",\"contract\": \"{contract}\""; + } + if (pair != null) + { + content += $",\"pair\": \"{pair}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 【全仓】获取历史成交记录(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapCrossMatchResultsAsync(int tradeType, + string contract, string pair = null, long? startTime = null, long? endTime = null, string direct = null, + long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/swap_cross_matchresults"); + + // content + string content = $",\"trade_type\": {tradeType}, \"contract\": \"{contract}\""; + if (pair != null) + { + content += $",\"pair\": \"{pair}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 【逐仓】组合查询用户历史成交记录(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapMatchResultsExactAsync(int tradeType, + string contract, string pair = null, long? startTime = null, long? endTime = null, string direct = null, + long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/swap_matchresults_exact"); + + // content + string content = $",\"trade_type\": {tradeType}, \"contract\": \"{contract}\""; + if (pair != null) + { + content += $",\"pair\": \"{pair}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 【全仓】组合查询用户历史成交记录(新) + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async Task SwapCrossMatchResultsExactAsync(int tradeType, + string contract, string pair = null, long? startTime = null, long? endTime = null, string direct = null, + long? fromId = null) + { + // url + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/swap_cross_matchresults_exact"); + + // content + string content = $",\"trade_type\": {tradeType}, \"contract\": \"{contract}\""; + if (pair != null) + { + content += $",\"pair\": \"{pair}\""; + } + if (startTime != null) + { + content += $",\"start_time\": {startTime}"; + } + if (endTime != null) + { + content += $",\"end_time\": {endTime}"; + } + if (direct != null) + { + content += $",\"direct\": \"{direct}\""; + } + if (fromId != null) + { + content += $",\"from_id\": {fromId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 【逐仓】查询持仓模式 + /// + /// + /// + public async Task SwapPositionSideAsync(string marginAccount) + { + // location + string location = $"/linear-swap-api/v1/swap_position_side"; + + // option + string option = null; + if (marginAccount != null) + { + option += $"&margin_account={marginAccount}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(GET_METHOD, location); + return await HttpRequest.GetAsync(url); + } + + /// + /// 【全仓】查询持仓模式 + /// + /// + /// + public async Task SwapCrossPositionSideAsync(string marginAccount) + { + // location + string location = $"/linear-swap-api/v1/swap_cross_position_side"; + + // option + string option = null; + if (marginAccount != null) + { + option += $"&margin_account={marginAccount}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(GET_METHOD, location); + return await HttpRequest.GetAsync(url); + } } } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/AccountTansferResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/AccountTansferResponse.cs index 38e3a34..c39d04a 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/AccountTansferResponse.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/AccountTansferResponse.cs @@ -26,6 +26,9 @@ public class Data { [JsonProperty("order_id")] public string orderId { get; set; } + + [JsonProperty("client_order_id", NullValueHandling = NullValueHandling.Ignore)] + public long clientOrderId { get; set; } } } } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/CrossGetAccountInfoResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/CrossGetAccountInfoResponse.cs index 9260b46..813c702 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/CrossGetAccountInfoResponse.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/CrossGetAccountInfoResponse.cs @@ -59,6 +59,15 @@ public class Data [JsonProperty("risk_rate", NullValueHandling = NullValueHandling.Ignore)] public double riskRate { get; set; } + + [JsonProperty("money_in", NullValueHandling = NullValueHandling.Ignore)] + public string moneyIn { get; set; } + + [JsonProperty("money_out", NullValueHandling = NullValueHandling.Ignore)] + public string moneyOut { get; set; } + + [JsonProperty("new_risk_rate", NullValueHandling = NullValueHandling.Ignore)] + public string newRiskRate { get; set; } public class ContractDetail { @@ -93,6 +102,9 @@ public class ContractDetail [JsonProperty("pair")] public string pair { get; set; } + + [JsonProperty("cross_max_available", NullValueHandling = NullValueHandling.Ignore)] + public string crossMaxAvailable { get; set; } [JsonProperty("business_type")] public string businessType { get; set; } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAccountPositionResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAccountPositionResponse.cs index 0713888..73b7618 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAccountPositionResponse.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAccountPositionResponse.cs @@ -59,6 +59,9 @@ public class Data [JsonProperty("risk_rate", NullValueHandling = NullValueHandling.Ignore)] public double riskRate { get; set; } + + [JsonProperty("new_risk_rate", NullValueHandling = NullValueHandling.Ignore)] + public double newRiskRate { get; set; } [JsonProperty("liquidation_price", NullValueHandling = NullValueHandling.Ignore)] public double liquidationPrice { get; set; } @@ -81,6 +84,9 @@ public class Data [JsonProperty("trade_partition")] public string tradePartition { get; set; } + [JsonProperty("adl_risk_percent", NullValueHandling = NullValueHandling.Ignore)] + public double adlRiskPercent { get; set; } + public class Positions { public string symbol { get; set; } @@ -133,6 +139,12 @@ public class Positions [JsonProperty("position_mode")] public string positionMode { get; set; } + + [JsonProperty("new_risk_rate")] + public string newRiskRate { get; set; } + + [JsonProperty("adl_risk_percent", NullValueHandling = NullValueHandling.Ignore)] + public string adlRiskPercent { get; set; } } [JsonProperty("contract_detail", NullValueHandling = NullValueHandling.Ignore)] diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAccountPositionResponseSingle.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAccountPositionResponseSingle.cs index 8491a6c..c0d2833 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAccountPositionResponseSingle.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAccountPositionResponseSingle.cs @@ -59,6 +59,15 @@ public class Data [JsonProperty("risk_rate", NullValueHandling = NullValueHandling.Ignore)] public double riskRate { get; set; } + + [JsonProperty("money_in", NullValueHandling = NullValueHandling.Ignore)] + public string moneyIn { get; set; } + + [JsonProperty("money_out", NullValueHandling = NullValueHandling.Ignore)] + public string moneyOut { get; set; } + + [JsonProperty("new_risk_rate", NullValueHandling = NullValueHandling.Ignore)] + public string newRiskRate { get; set; } [JsonProperty("liquidation_price", NullValueHandling = NullValueHandling.Ignore)] public double liquidationPrice { get; set; } @@ -171,6 +180,9 @@ public class ContractDetail [JsonProperty("contract_type", NullValueHandling = NullValueHandling.Ignore)] public string contractType { get; set; } + + [JsonProperty("cross_max_available", NullValueHandling = NullValueHandling.Ignore)] + public string crossMaxAvailable { get; set; } [JsonProperty("pair", NullValueHandling = NullValueHandling.Ignore)] public string pair { get; set; } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAllSubAssetsResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAllSubAssetsResponse.cs index ef6c430..1744fe9 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAllSubAssetsResponse.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetAllSubAssetsResponse.cs @@ -58,6 +58,9 @@ public class CoinAssets [JsonProperty("trade_partition")] public string tradePartition { get; set; } + + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long queryId { get; set; } } } } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetPositionInfoResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetPositionInfoResponse.cs index a7b1840..a2ebc48 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetPositionInfoResponse.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetPositionInfoResponse.cs @@ -76,6 +76,18 @@ public class Data [JsonProperty("pair", NullValueHandling = NullValueHandling.Ignore)] public string pair { get; set; } + [JsonProperty("withdraw_available", NullValueHandling = NullValueHandling.Ignore)] + public double withdrawAvailable { get; set; } + + [JsonProperty("risk_rate", NullValueHandling = NullValueHandling.Ignore)] + public double riskRate { get; set; } + + [JsonProperty("liquidation_price", NullValueHandling = NullValueHandling.Ignore)] + public double liquidationPrice { get; set; } + + [JsonProperty("adl_risk_percent", NullValueHandling = NullValueHandling.Ignore)] + public double adlRiskPercent { get; set; } + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] public string businessType { get; set; } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetPositionLimitResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetPositionLimitResponse.cs index 0a34a8d..ac65e06 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetPositionLimitResponse.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/GetPositionLimitResponse.cs @@ -45,6 +45,18 @@ public class Data [JsonProperty("trade_partition")] public string tradePartition { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int leverRate { get; set; } + + [JsonProperty("buy_limit_value", NullValueHandling = NullValueHandling.Ignore)] + public double buyLimitValue { get; set; } + + [JsonProperty("sell_limit_value", NullValueHandling = NullValueHandling.Ignore)] + public double sellLimitValue { get; set; } + + [JsonProperty("mark_price", NullValueHandling = NullValueHandling.Ignore)] + public double markPrice { get; set; } } } } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/IsolatedGetAccountInfoResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/IsolatedGetAccountInfoResponse.cs index 99d9f62..886bb06 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/IsolatedGetAccountInfoResponse.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/IsolatedGetAccountInfoResponse.cs @@ -61,6 +61,9 @@ public class Data [JsonProperty("risk_rate", NullValueHandling = NullValueHandling.Ignore)] public double riskRate { get; set; } + + [JsonProperty("new_risk_rate", NullValueHandling = NullValueHandling.Ignore)] + public double newRiskRate { get; set; } [JsonProperty("liquidation_price", NullValueHandling = NullValueHandling.Ignore)] public double liquidationPrice { get; set; } @@ -82,6 +85,8 @@ public class Data [JsonProperty("position_mode")] public string positionMode { get; set; } + + } } } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/SwapFinancialRecordResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/SwapFinancialRecordResponse.cs new file mode 100644 index 0000000..9de3bac --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/SwapFinancialRecordResponse.cs @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Account +{ + public class SwapFinancialRecordResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapFinancialRecord + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public long Id { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("asset", NullValueHandling = NullValueHandling.Ignore)] + public string Asset { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAccount { get; set; } + + [JsonProperty("face_margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string FaceMarginAccount { get; set; } + + [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] + public int Type { get; set; } + + [JsonProperty("amount", NullValueHandling = NullValueHandling.Ignore)] + public decimal Amount { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/SwapSubAuthListResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/SwapSubAuthListResponse.cs new file mode 100644 index 0000000..2c588c5 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Account/SwapSubAuthListResponse.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Account +{ + public class SwapSubAuthListResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public SwapSubAuthList Data { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + } + + public class SwapSubAuthList + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public string Query_id { get; set; } + + [JsonProperty("errors", NullValueHandling = NullValueHandling.Ignore)] + public List Errors { get; set; } + + [JsonProperty("successes", NullValueHandling = NullValueHandling.Ignore)] + public List Successes { get; set; } + } + + public class ErrorsObject + { + [JsonProperty("sub_uid", NullValueHandling = NullValueHandling.Ignore)] + public string Sub_uid { get; set; } + + [JsonProperty("err_code", NullValueHandling = NullValueHandling.Ignore)] + public string Err_code { get; set; } + + [JsonProperty("err_msg", NullValueHandling = NullValueHandling.Ignore)] + public string err_msg { get; set; } + } + + public class SuccessesObject + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public string Query_id { get; set; } + + [JsonProperty("sub_uid", NullValueHandling = NullValueHandling.Ignore)] + public string Sub_uid { get; set; } + + [JsonProperty("sub_auth", NullValueHandling = NullValueHandling.Ignore)] + public string Sub_auth { get; set; } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetHeartbeatResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetHeartbeatResponse.cs new file mode 100644 index 0000000..bfccde0 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetHeartbeatResponse.cs @@ -0,0 +1,7 @@ +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Common +{ + public class GetHeartbeatResponse + { + public string status { get; set; } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetSwapCrossLadderMarginResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetSwapCrossLadderMarginResponse.cs new file mode 100644 index 0000000..e417b8a --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetSwapCrossLadderMarginResponse.cs @@ -0,0 +1,69 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Common +{ + public class GetSwapCrossLadderMarginResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + public class SwapCrossLadderMargin + { + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAccount { get; set; } + + [JsonProperty("contract_type", NullValueHandling = NullValueHandling.Ignore)] + public string ContractType { get; set; } + + [JsonProperty("pair", NullValueHandling = NullValueHandling.Ignore)] + public string Pair { get; set; } + + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public string BusinessType { get; set; } + + [JsonProperty("list", NullValueHandling = NullValueHandling.Ignore)] + public List List { get; set; } + } + + public class ListObject + { + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int LeverRate { get; set; } + + [JsonProperty("ladders", NullValueHandling = NullValueHandling.Ignore)] + public List Ladders { get; set; } + } + + public class LaddersObject + { + [JsonProperty("min_margin_balance", NullValueHandling = NullValueHandling.Ignore)] + public decimal MinMarginBalance { get; set; } + + [JsonProperty("max_margin_balance", NullValueHandling = NullValueHandling.Ignore)] + public decimal MaxMarginBalance { get; set; } + + [JsonProperty("min_margin_available", NullValueHandling = NullValueHandling.Ignore)] + public decimal MinMarginAvailable { get; set; } + + [JsonProperty("max_margin_available", NullValueHandling = NullValueHandling.Ignore)] + public decimal MaxMarginAvailable { get; set; } + } + + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetSwapLiquidationOrdersResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetSwapLiquidationOrdersResponse.cs new file mode 100644 index 0000000..804e67c --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetSwapLiquidationOrdersResponse.cs @@ -0,0 +1,60 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Common +{ + public class GetSwapLiquidationOrdersResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapLiquidationOrders + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] + public long CreatedAt { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal Volume { get; set; } + + [JsonProperty("amount", NullValueHandling = NullValueHandling.Ignore)] + public decimal Amount { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public decimal Price { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("pair", NullValueHandling = NullValueHandling.Ignore)] + public string Pair { get; set; } + + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public string BusinessType { get; set; } + } + + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetSwapQueryElementsResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetSwapQueryElementsResponse.cs new file mode 100644 index 0000000..30c0d1c --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetSwapQueryElementsResponse.cs @@ -0,0 +1,188 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Common +{ + public class GetSwapQueryElementsResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + public class SwapQueryElements + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("mode_type", NullValueHandling = NullValueHandling.Ignore)] + public int ModeType { get; set; } + + [JsonProperty("swap_delivery_type", NullValueHandling = NullValueHandling.Ignore)] + public int SwapDeliveryType { get; set; } + + [JsonProperty("instrument_index_code", NullValueHandling = NullValueHandling.Ignore)] + public string InstrumentIndexCode { get; set; } + + [JsonProperty("real_time_settlement", NullValueHandling = NullValueHandling.Ignore)] + public int RealTimeSettlement { get; set; } + + [JsonProperty("transfer_profit_ratio", NullValueHandling = NullValueHandling.Ignore)] + public object TransferProfitRatio { get; set; } + + [JsonProperty("cross_transfer_profit_ratio", NullValueHandling = NullValueHandling.Ignore)] + public object CrossTransferProfitRatio { get; set; } + + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public List InstrumentType { get; set; } + + [JsonProperty("trade_partition", NullValueHandling = NullValueHandling.Ignore)] + public string TradePartition { get; set; } + + [JsonProperty("min_level", NullValueHandling = NullValueHandling.Ignore)] + public int MinLevel { get; set; } + + [JsonProperty("max_level", NullValueHandling = NullValueHandling.Ignore)] + public int MaxLevel { get; set; } + + [JsonProperty("settle_period", NullValueHandling = NullValueHandling.Ignore)] + public int SettlePeriod { get; set; } + + [JsonProperty("funding_rate_cap", NullValueHandling = NullValueHandling.Ignore)] + public int FundingRateCap { get; set; } + + [JsonProperty("funding_rate_floor", NullValueHandling = NullValueHandling.Ignore)] + public int FundingRateFloor { get; set; } + + [JsonProperty("long_position_limit", NullValueHandling = NullValueHandling.Ignore)] + public object LongPositionLimit { get; set; } + + [JsonProperty("offset_order_limit", NullValueHandling = NullValueHandling.Ignore)] + public object OffsetOrderLimit { get; set; } + + [JsonProperty("open_order_limit", NullValueHandling = NullValueHandling.Ignore)] + public object OpenOrderLimit { get; set; } + + [JsonProperty("short_position_limit", NullValueHandling = NullValueHandling.Ignore)] + public object ShortPositionLimit { get; set; } + + [JsonProperty("contract_infos", NullValueHandling = NullValueHandling.Ignore)] + public List ContractInfos { get; set; } + + [JsonProperty("price_ticks", NullValueHandling = NullValueHandling.Ignore)] + public List PriceTicks { get; set; } + + [JsonProperty("instrument_values", NullValueHandling = NullValueHandling.Ignore)] + public List InstrumentValues { get; set; } + + [JsonProperty("order_limits", NullValueHandling = NullValueHandling.Ignore)] + public List OrderLimits { get; set; } + + [JsonProperty("normal_limits", NullValueHandling = NullValueHandling.Ignore)] + public List NormalLimits { get; set; } + + [JsonProperty("open_limits", NullValueHandling = NullValueHandling.Ignore)] + public List OpenLimits { get; set; } + + [JsonProperty("trade_limits", NullValueHandling = NullValueHandling.Ignore)] + public List TradeLimits { get; set; } + } + + public class ContractInfoObject + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public List InstrumentType { get; set; } + + [JsonProperty("settlement_date", NullValueHandling = NullValueHandling.Ignore)] + public string SettlementDate { get; set; } + + [JsonProperty("delivery_time", NullValueHandling =NullValueHandling.Ignore)] + public string DeliveryTime { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public string CreateDate { get; set; } + + [JsonProperty("contract_status", NullValueHandling = NullValueHandling.Ignore)] + public int ContractStatus { get; set; } + + [JsonProperty("delivery_date", NullValueHandling = NullValueHandling.Ignore)] + public string DeliveryDate { get; set; } + } + + public class PriceTickObject + { + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public int BusinessType { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public string Price { get; set; } + } + + public class InstrumentValueObject + { + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public int BusinessType { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public string Price { get; set; } + } + + public class OrderLimitObject + { + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public int InstrumentType { get; set; } + + [JsonProperty("open", NullValueHandling = NullValueHandling.Ignore)] + public string Open { get; set; } + + [JsonProperty("close", NullValueHandling = NullValueHandling.Ignore)] + public string Close { get; set; } + + [JsonProperty("open_after_closing", NullValueHandling = NullValueHandling.Ignore)] + public string OpenAfterClosing { get; set; } + } + + public class NormalLimitObject + { + [JsonProperty("instrument_type", NullValueHandling =NullValueHandling.Ignore)] + public int InstrumentType { get; set; } + + [JsonProperty("open", NullValueHandling = NullValueHandling.Ignore)] + public string Open { get; set; } + + [JsonProperty("close", NullValueHandling =NullValueHandling.Ignore)] + public string Close { get; set; } + } + + public class OpenLimitObject + { + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public int InstrumentType { get; set; } + + [JsonProperty("open", NullValueHandling =NullValueHandling.Ignore)] + public string Open { get; set; } + + [JsonProperty("close", NullValueHandling =NullValueHandling.Ignore)] + public string Close { get; set; } + } + + public class TradeLimitObject + { + [JsonProperty("instrument_type", NullValueHandling =NullValueHandling.Ignore)] + public int InstrumentType { get; set; } + + [JsonProperty("open", NullValueHandling =NullValueHandling.Ignore)] + public string Open { get; set; } + + [JsonProperty("close", NullValueHandling =NullValueHandling.Ignore)] + public string Close { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetTimestampResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetTimestampResponse.cs new file mode 100644 index 0000000..9f03796 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Common/GetTimestampResponse.cs @@ -0,0 +1,9 @@ +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Common +{ + public class GetTimestampResponse + { + public string status { get; set; } + + public long ts { get; set; } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Market/GetDetailBatchMergedResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Market/GetDetailBatchMergedResponse.cs new file mode 100644 index 0000000..6550edd --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Market/GetDetailBatchMergedResponse.cs @@ -0,0 +1,62 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Market +{ + public class GetDetailBatchMergedResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("ticks", NullValueHandling = NullValueHandling.Ignore)] + public List Ticks { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + public class DetailBatchMerged + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public string BusinessType { get; set; } + + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public long Id { get; set; } + + [JsonProperty("amount", NullValueHandling = NullValueHandling.Ignore)] + public string Amount { get; set; } + + [JsonProperty("ask", NullValueHandling = NullValueHandling.Ignore)] + public float[] Ask { get; set; } + + [JsonProperty("bid", NullValueHandling = NullValueHandling.Ignore)] + public float[] Bid { get; set; } + + [JsonProperty("open", NullValueHandling = NullValueHandling.Ignore)] + public string Open { get; set; } + + [JsonProperty("close", NullValueHandling = NullValueHandling.Ignore)] + public string Close { get; set; } + + [JsonProperty("count", NullValueHandling = NullValueHandling.Ignore)] + public decimal Count { get; set; } + + [JsonProperty("high", NullValueHandling = NullValueHandling.Ignore)] + public string High { get; set; } + + [JsonProperty("low", NullValueHandling = NullValueHandling.Ignore)] + public string Low { get; set; } + + [JsonProperty("vol", NullValueHandling = NullValueHandling.Ignore)] + public string Vol { get; set; } + + [JsonProperty("number_of", NullValueHandling = NullValueHandling.Ignore)] + public string NumberOf { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/GetOrderDetailResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/GetOrderDetailResponse.cs index f9b77a4..50f96dd 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/GetOrderDetailResponse.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/GetOrderDetailResponse.cs @@ -167,6 +167,9 @@ public class Trade [JsonProperty("reduce_only")] public int reduceOnly { get; set; } + + [JsonProperty("canceled_source", NullValueHandling = NullValueHandling.Ignore)] + public string canceledSource { get; set; } } } } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/GetOrderInfoResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/GetOrderInfoResponse.cs index 9722266..b8efdfe 100644 --- a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/GetOrderInfoResponse.cs +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/GetOrderInfoResponse.cs @@ -116,6 +116,15 @@ public class Data [JsonProperty("reduce_only")] public int reduceOnly { get; set; } + + [JsonProperty("fee_amount", NullValueHandling = NullValueHandling.Ignore)] + public double feeAmount { get; set; } + + [JsonProperty("fee_quote_amount", NullValueHandling = NullValueHandling.Ignore)] + public double feeQuoteAmount { get; set; } + + [JsonProperty("canceled_source", NullValueHandling = NullValueHandling.Ignore)] + public string canceledSource { get; set; } } } } diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/LinearCancelAfterResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/LinearCancelAfterResponse.cs new file mode 100644 index 0000000..fa317cf --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/LinearCancelAfterResponse.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Order +{ + public class LinearCancelAfterResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public LinearCancelAfter Data { get; set; } + + public class LinearCancelAfter + { + [JsonProperty("current_time", NullValueHandling = NullValueHandling.Ignore)] + public long CurrentTime { get; set; } + + [JsonProperty("trigger_time", NullValueHandling = NullValueHandling.Ignore)] + public long TriggerTime { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossHisOrdersExactResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossHisOrdersExactResponse.cs new file mode 100644 index 0000000..df86901 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossHisOrdersExactResponse.cs @@ -0,0 +1,119 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Order +{ + public class SwapCrossHisOrdersExactResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapCrossHisOrdersExact + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAccount { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int LeverRate { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("volume", NullValueHandling =NullValueHandling.Ignore)] + public decimal Volume { get; set; } + + [JsonProperty("price", NullValueHandling =NullValueHandling.Ignore)] + public decimal Price { get; set; } + + [JsonProperty("create_date", NullValueHandling =NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("order_source", NullValueHandling =NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("order_price_type", NullValueHandling =NullValueHandling.Ignore)] + public string OrderPriceType { get; set; } + + [JsonProperty("margin_frozen", NullValueHandling =NullValueHandling.Ignore)] + public decimal MarginFrozen { get; set; } + + [JsonProperty("profit", NullValueHandling =NullValueHandling.Ignore)] + public decimal Profit { get; set; } + + [JsonProperty("real_profit", NullValueHandling =NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("trade_volume", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("fee", NullValueHandling =NullValueHandling.Ignore)] + public decimal Fee { get; set; } + + [JsonProperty("trade_avg_price", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeavgPrice { get; set; } + + [JsonProperty("status", NullValueHandling =NullValueHandling.Ignore)] + public int Status { get; set; } + + [JsonProperty("order_type", NullValueHandling =NullValueHandling.Ignore)] + public int OrderType { get; set; } + + [JsonProperty("fee_asset", NullValueHandling =NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("liquidation_type", NullValueHandling =NullValueHandling.Ignore)] + public string LiquidationType { get; set; } + + [JsonProperty("is_tpsl", NullValueHandling =NullValueHandling.Ignore)] + public int IsTpsl { get; set; } + + [JsonProperty("contract_type", NullValueHandling =NullValueHandling.Ignore)] + public string ContractType { get; set; } + + [JsonProperty("pair", NullValueHandling =NullValueHandling.Ignore)] + public string Pair { get; set; } + + [JsonProperty("business_type", NullValueHandling =NullValueHandling.Ignore)] + public string BusinessType { get; set; } + + [JsonProperty("reduce_only", NullValueHandling =NullValueHandling.Ignore)] + public int ReduceOnly { get; set; } + + [JsonProperty("canceled_source", NullValueHandling =NullValueHandling.Ignore)] + public string CanceledSource { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossHisOrdersResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossHisOrdersResponse.cs new file mode 100644 index 0000000..09a4d06 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossHisOrdersResponse.cs @@ -0,0 +1,125 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Order +{ + public class SwapCrossHisOrdersResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapCrossHisOrders + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAccount { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int LeverRate { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal Volume { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public decimal Price { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("update_time", NullValueHandling = NullValueHandling.Ignore)] + public long UpdateTime { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("order_price_type", NullValueHandling = NullValueHandling.Ignore)] + public string OrderPriceType { get; set; } + + [JsonProperty("margin_asset", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAsset { get; set; } + + [JsonProperty("margin_frozen", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginFrozen { get; set; } + + [JsonProperty("profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal Profit { get; set; } + + [JsonProperty("trade_volume", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("fee", NullValueHandling =NullValueHandling.Ignore)] + public decimal Fee { get; set; } + + [JsonProperty("trade_avg_price", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeavgPrice { get; set; } + + [JsonProperty("status", NullValueHandling =NullValueHandling.Ignore)] + public int Status { get; set; } + + [JsonProperty("order_type", NullValueHandling =NullValueHandling.Ignore)] + public int OrderType { get; set; } + + [JsonProperty("fee_asset", NullValueHandling =NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("liquidation_type", NullValueHandling =NullValueHandling.Ignore)] + public string LiquidationType { get; set; } + + [JsonProperty("is_tpsl", NullValueHandling = NullValueHandling.Ignore)] + public int IsTpsl { get; set; } + + [JsonProperty("real_profit", NullValueHandling =NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("contract_type", NullValueHandling =NullValueHandling.Ignore)] + public string ContractType { get; set; } + + [JsonProperty("pair", NullValueHandling = NullValueHandling.Ignore)] + public string Pair { get; set; } + + [JsonProperty("business_type", NullValueHandling =NullValueHandling.Ignore)] + public string BusinessType { get; set; } + + [JsonProperty("reduce_only", NullValueHandling =NullValueHandling.Ignore)] + public int ReduceOnly { get; set; } + + [JsonProperty("canceled_source", NullValueHandling =NullValueHandling.Ignore)] + public string CanceledSource { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossMatchResultsExactResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossMatchResultsExactResponse.cs new file mode 100644 index 0000000..cb1fcd5 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossMatchResultsExactResponse.cs @@ -0,0 +1,101 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Order +{ + public class SwapCrossMatchResultsExactResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapCrossMatchResultsExact + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("match_id", NullValueHandling = NullValueHandling.Ignore)] + public long MatchId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAccount { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("trade_volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_price", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradePrice { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("offset_profitloss", NullValueHandling = NullValueHandling.Ignore)] + public decimal OffsetProfitloss { get; set; } + + [JsonProperty("real_profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("trade_fee", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeFee { get; set; } + + [JsonProperty("role", NullValueHandling = NullValueHandling.Ignore)] + public string Role { get; set; } + + [JsonProperty("fee_asset", NullValueHandling = NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("ht_price", NullValueHandling = NullValueHandling.Ignore)] + public string HtPrice { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("contract_type", NullValueHandling = NullValueHandling.Ignore)] + public string ContractType { get; set; } + + [JsonProperty("pair", NullValueHandling = NullValueHandling.Ignore)] + public string Pair { get; set; } + + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public string BusinessType { get; set; } + + [JsonProperty("reduce_only", NullValueHandling = NullValueHandling.Ignore)] + public int ReduceOnly { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossMatchResultsResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossMatchResultsResponse.cs new file mode 100644 index 0000000..888eb68 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapCrossMatchResultsResponse.cs @@ -0,0 +1,99 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Order +{ + public class SwapCrossMatchResultsResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapCrossMatchResults + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("match_id", NullValueHandling = NullValueHandling.Ignore)] + public long MatchId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAccount { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("trade_volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_price", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradePrice { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("offset_profitloss", NullValueHandling = NullValueHandling.Ignore)] + public decimal OffsetProfitloss { get; set; } + + [JsonProperty("real_profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("trade_fee", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeFee { get; set; } + + [JsonProperty("role", NullValueHandling = NullValueHandling.Ignore)] + public string Role { get; set; } + + [JsonProperty("fee_asset", NullValueHandling = NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("contract_type", NullValueHandling = NullValueHandling.Ignore)] + public string ContractType { get; set; } + + [JsonProperty("pair", NullValueHandling = NullValueHandling.Ignore)] + public string Pair { get; set; } + + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public string BusinessType { get; set; } + + [JsonProperty("reduce_only", NullValueHandling = NullValueHandling.Ignore)] + public int ReduceOnly { get; set; } + } + + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapHisOrdersExactResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapHisOrdersExactResponse.cs new file mode 100644 index 0000000..8377058 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapHisOrdersExactResponse.cs @@ -0,0 +1,110 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Order +{ + public class SwapHisOrdersExactResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapHisOrdersExact + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAccount { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int LeverRate { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal Volume { get; set; } + + [JsonProperty("price", NullValueHandling =NullValueHandling.Ignore)] + public decimal Price { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("order_price_type", NullValueHandling = NullValueHandling.Ignore)] + public string OrderPriceType { get; set; } + + [JsonProperty("margin_frozen", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginFrozen { get; set; } + + [JsonProperty("profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal Profit { get; set; } + + [JsonProperty("real_profit", NullValueHandling =NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("trade_volume", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("fee",NullValueHandling =NullValueHandling.Ignore)] + public decimal Fee { get; set; } + + [JsonProperty("trade_avg_price",NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeavgPrice { get; set; } + + [JsonProperty("status", NullValueHandling =NullValueHandling.Ignore)] + public int Status { get; set; } + + [JsonProperty("order_type", NullValueHandling =NullValueHandling.Ignore)] + public int OrderType { get; set; } + + [JsonProperty("fee_asset", NullValueHandling =NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("liquidation_type", NullValueHandling =NullValueHandling.Ignore)] + public string LiquidationType { get; set; } + + [JsonProperty("is_tpsl", NullValueHandling =NullValueHandling.Ignore)] + public int IsTpsl { get; set; } + + [JsonProperty("reduce_only", NullValueHandling =NullValueHandling.Ignore)] + public int ReduceOnly { get; set; } + + [JsonProperty("canceled_source", NullValueHandling =NullValueHandling.Ignore)] + public string CanceledSource { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapHisOrdersResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapHisOrdersResponse.cs new file mode 100644 index 0000000..c61dee0 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapHisOrdersResponse.cs @@ -0,0 +1,116 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Order +{ + public class SwapHisOrdersResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapHisOrders + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int LeverRate { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal Volume { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public decimal Price { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("update_time", NullValueHandling = NullValueHandling.Ignore)] + public long UpdateTime { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("order_price_type", NullValueHandling = NullValueHandling.Ignore)] + public string OrderPriceType { get; set; } + + [JsonProperty("margin_asset", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAsset { get; set; } + + [JsonProperty("margin_frozen", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginFrozen { get; set; } + + [JsonProperty("profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal Profit { get; set; } + + [JsonProperty("real_profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("trade_volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("fee", NullValueHandling = NullValueHandling.Ignore)] + public decimal Fee { get; set; } + + [JsonProperty("trade_avg_price", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeAvgPrice { get; set; } + + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public int Status { get; set; } + + [JsonProperty("order_type", NullValueHandling = NullValueHandling.Ignore)] + public int OrderType { get; set; } + + [JsonProperty("fee_asset", NullValueHandling = NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("liquidation_type", NullValueHandling = NullValueHandling.Ignore)] + public string LiquidationType { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAccount { get; set; } + + [JsonProperty("is_tpsl", NullValueHandling = NullValueHandling.Ignore)] + public int IsTpsl { get; set; } + + [JsonProperty("reduce_only", NullValueHandling = NullValueHandling.Ignore)] + public int ReduceOnly { get; set; } + + [JsonProperty("canceled_source", NullValueHandling = NullValueHandling.Ignore)] + public string CanceledSource { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapMatchResultsExactResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapMatchResultsExactResponse.cs new file mode 100644 index 0000000..87f9feb --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapMatchResultsExactResponse.cs @@ -0,0 +1,93 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Order +{ + public class SwapMatchResultsExactResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapMatchResultsExact + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("match_id", NullValueHandling = NullValueHandling.Ignore)] + public long MatchId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAccount { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("trade_volume", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_price", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradePrice { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("offset_profitloss", NullValueHandling = NullValueHandling.Ignore)] + public decimal OffsetProfitloss { get; set; } + + [JsonProperty("real_profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("trade_fee", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeFee { get; set; } + + [JsonProperty("role", NullValueHandling = NullValueHandling.Ignore)] + public string Role { get; set; } + + [JsonProperty("fee_asset", NullValueHandling =NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("ht_price", NullValueHandling = NullValueHandling.Ignore)] + public string HtPrice { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("reduce_only", NullValueHandling = NullValueHandling.Ignore)] + public int ReduceOnly { get; set; } + } + + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapMatchResultsResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapMatchResultsResponse.cs new file mode 100644 index 0000000..426b401 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapMatchResultsResponse.cs @@ -0,0 +1,98 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Order +{ + public class SwapMatchResultsResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class SwapMatchResults + { + [JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)] + public string Id { get; set; } + + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("match_id", NullValueHandling = NullValueHandling.Ignore)] + public long MatchId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public long OrderId { get; set; } + + [JsonProperty("order_id_str", NullValueHandling = NullValueHandling.Ignore)] + public string OrderIdStr { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAccount { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public string Direction { get; set; } + + [JsonProperty("offset", NullValueHandling = NullValueHandling.Ignore)] + public string Offset { get; set; } + + [JsonProperty("trade_volume", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeVolume { get; set; } + + [JsonProperty("trade_price", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradePrice { get; set; } + + [JsonProperty("trade_turnover", NullValueHandling =NullValueHandling.Ignore)] + public decimal TradeTurnover { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public long CreateDate { get; set; } + + [JsonProperty("offset_profitloss", NullValueHandling = NullValueHandling.Ignore)] + public decimal OffsetProfitloss { get; set; } + + [JsonProperty("real_profit", NullValueHandling = NullValueHandling.Ignore)] + public decimal RealProfit { get; set; } + + [JsonProperty("trade_fee", NullValueHandling = NullValueHandling.Ignore)] + public decimal TradeFee { get; set; } + + [JsonProperty("role", NullValueHandling = NullValueHandling.Ignore)] + public string Role { get; set; } + + [JsonProperty("fee_asset", NullValueHandling = NullValueHandling.Ignore)] + public string FeeAsset { get; set; } + + [JsonProperty("order_source", NullValueHandling = NullValueHandling.Ignore)] + public string OrderSource { get; set; } + + [JsonProperty("contract_type", NullValueHandling = NullValueHandling.Ignore)] + public string ContractType { get; set; } + + [JsonProperty("pair", NullValueHandling = NullValueHandling.Ignore)] + public string Pair { get; set; } + + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public string BusinessType { get; set; } + + [JsonProperty("reduce_only", NullValueHandling = NullValueHandling.Ignore)] + public int ReduceOnly { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapPositionSideResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapPositionSideResponse.cs new file mode 100644 index 0000000..f68d43c --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/Order/SwapPositionSideResponse.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.Order +{ + public class SwapPositionSideResponse + { + [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)] + public string Status { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + + public class SwapPositionSide + { + [JsonProperty("margin_account", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAccount { get; set; } + + [JsonProperty("position_mode", NullValueHandling = NullValueHandling.Ignore)] + public string PositionMode { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/FixPositionMarginChangeRecordResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/FixPositionMarginChangeRecordResponse.cs new file mode 100644 index 0000000..9d41cd0 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/FixPositionMarginChangeRecordResponse.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.UnifiedAccount +{ + public class FixPositionMarginChangeRecordResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class FixPositionMarginChangeRecord + { + [JsonProperty("query_id", NullValueHandling = NullValueHandling.Ignore)] + public long QueryId { get; set; } + + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public string OrderId { get; set; } + + [JsonProperty("amount", NullValueHandling = NullValueHandling.Ignore)] + public double Amount { get; set; } + + [JsonProperty("asset", NullValueHandling = NullValueHandling.Ignore)] + public string Asset { get; set; } + + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)] + public int Type { get; set; } + + [JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)] + public int Direction { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/FixPositionMarginChangeResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/FixPositionMarginChangeResponse.cs new file mode 100644 index 0000000..3bca757 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/FixPositionMarginChangeResponse.cs @@ -0,0 +1,29 @@ +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.UnifiedAccount +{ + public class FixPositionMarginChangeResponse + { + + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public FixPositionMarginChange Data { get; set; } + + public class FixPositionMarginChange + { + [JsonProperty("order_id", NullValueHandling = NullValueHandling.Ignore)] + public string OrderId { get; set; } + + [JsonProperty("client_order_id", NullValueHandling = NullValueHandling.Ignore)] + public long ClientOrderId { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/GetSwapUnifiedAccountTypeResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/GetSwapUnifiedAccountTypeResponse.cs new file mode 100644 index 0000000..57be7b7 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/GetSwapUnifiedAccountTypeResponse.cs @@ -0,0 +1,21 @@ +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.UnifiedAccount +{ + public class GetSwapUnifiedAccountTypeResponse + { + public int code { get; set; } + + public string msg { get; set; } + + public long ts { get; set; } + + public SwapUnifiedAccountType data { get; set; } + + public class SwapUnifiedAccountType + { + [JsonProperty("account_type", NullValueHandling = NullValueHandling.Ignore)] + public int accountType { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/LinearSwapFeeSwitchResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/LinearSwapFeeSwitchResponse.cs new file mode 100644 index 0000000..a22704a --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/LinearSwapFeeSwitchResponse.cs @@ -0,0 +1,19 @@ +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.UnifiedAccount +{ + public class LinearSwapFeeSwitchResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public object Data { get; set; } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/LinearSwapOverviewAccountInfoResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/LinearSwapOverviewAccountInfoResponse.cs new file mode 100644 index 0000000..7a60d8e --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/LinearSwapOverviewAccountInfoResponse.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.UnifiedAccount +{ + public class LinearSwapOverviewAccountInfoResponse + { + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class LinearSwapOverviewAccountInfo + { + [JsonProperty("margin_asset", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAsset { get; set; } + + [JsonProperty("margin_balance", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginBalance { get; set; } + + [JsonProperty("margin_available", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginAvailable { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/UnifiedAccountInfoResponse.cs b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/UnifiedAccountInfoResponse.cs new file mode 100644 index 0000000..72f9d65 --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/Response/UnifiedAccount/UnifiedAccountInfoResponse.cs @@ -0,0 +1,132 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.RESTful.Response.UnifiedAccount +{ + public class UnifiedAccountInfoResponse + { + + [JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)] + public int Code { get; set; } + + [JsonProperty("msg", NullValueHandling = NullValueHandling.Ignore)] + public string Msg { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)] + public List Data { get; set; } + + public class UnifiedAccountInfo + { + [JsonProperty("margin_balance", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginBalance { get; set; } + + [JsonProperty("margin_static", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginStatic { get; set; } + + [JsonProperty("cross_profit_unreal", NullValueHandling = NullValueHandling.Ignore)] + public decimal CrossProfitUnreal { get; set; } + + [JsonProperty("cross_margin_static", NullValueHandling = NullValueHandling.Ignore)] + public decimal CrossMarginStatic { get; set; } + + [JsonProperty("margin_asset", NullValueHandling = NullValueHandling.Ignore)] + public string MarginAsset { get; set; } + + [JsonProperty("margin_frozen", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginFrozen { get; set; } + + [JsonProperty("withdraw_available", NullValueHandling = NullValueHandling.Ignore)] + public decimal WithdrawAvailable { get; set; } + + [JsonProperty("cross_risk_rate", NullValueHandling = NullValueHandling.Ignore)] + public decimal CrossRiskRate { get; set; } + + [JsonProperty("cross_swap", NullValueHandling = NullValueHandling.Ignore)] + public List CrossSwap { get; set; } + + [JsonProperty("cross_futures", NullValueHandling = NullValueHandling.Ignore)] + public List CrossFutures { get; set; } + + [JsonProperty("isolated_swap", NullValueHandling = NullValueHandling.Ignore)] + public List IsolatedSwap { get; set; } + } + + public class CrossSwapObject + { + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_available", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginAvailable { get; set; } + + [JsonProperty("cross_max_available", NullValueHandling = NullValueHandling.Ignore)] + public int CrossMaxAvailable { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public decimal LeverRate { get; set; } + + [JsonProperty("contract_type", NullValueHandling = NullValueHandling.Ignore)] + public string ContractType { get; set; } + + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public string BusinessType { get; set; } + } + + public class CrossFuturesObject + { + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_available", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginAvailable { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public decimal LeverRate { get; set; } + + [JsonProperty("contract_type", NullValueHandling = NullValueHandling.Ignore)] + public string ContractType { get; set; } + + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public string BusinessType { get; set; } + } + + public class IsolatedSwapObject + { + [JsonProperty("symbol", NullValueHandling = NullValueHandling.Ignore)] + public string Symbol { get; set; } + + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("margin_mode", NullValueHandling = NullValueHandling.Ignore)] + public string MarginMode { get; set; } + + [JsonProperty("margin_available", NullValueHandling = NullValueHandling.Ignore)] + public decimal MarginAvailable { get; set; } + + [JsonProperty("withdraw_available", NullValueHandling = NullValueHandling.Ignore)] + public decimal WithdrawAvailable { get; set; } + + [JsonProperty("lever_rate", NullValueHandling = NullValueHandling.Ignore)] + public int LeverRate { get; set; } + + [JsonProperty("position_mode", NullValueHandling = NullValueHandling.Ignore)] + public string PositionMode { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/RESTful/UnifiedAccountClient.cs b/Huobi.SDK.Core/LinearSwap/RESTful/UnifiedAccountClient.cs new file mode 100644 index 0000000..f8e48fc --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/RESTful/UnifiedAccountClient.cs @@ -0,0 +1,231 @@ +using System.Threading.Tasks; +using Huobi.SDK.Core.RequestBuilder; +using Huobi.SDK.Core.LinearSwap.RESTful.Response.UnifiedAccount; + +namespace Huobi.SDK.Core.LinearSwap.RESTful +{ + /// + /// Responsible to operate account + /// + public class UnifiedAccountClient + { + private const string GET_METHOD = "GET"; + private const string POST_METHOD = "POST"; + + private readonly PrivateUrlBuilder _urlBuilder; + + /// + /// Constructor + /// + /// Access Key + /// Secret Key + /// the host that the client connects to + public UnifiedAccountClient(string accessKey, string secretKey, string host = Host.FUTURES) + { + _urlBuilder = new PrivateUrlBuilder(accessKey, secretKey, host); + } + + /// + /// U本位合约账户类型查询接口 + /// + /// + public async Task GetSwapUnifiedAccountTypeAsync() + { + // ulr + string url = _urlBuilder.Build(GET_METHOD, "/linear-swap-api/v3/swap_unified_account_type"); + + // content is null + return await HttpRequest.GetAsync(url); + } + + /// + /// 账户类型更改 + /// + /// + /// + public async Task SwapSwitchAccountTypeAsync(int? accountType = null) + { + // ulr + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/swap_switch_account_type"); + + // content + string content = null; + if (accountType != null) + { + content += $",\"accountType\": {accountType}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 查询统一账户资产 + /// + /// + /// + public async Task UnifiedAccountInfoAsync(string contractCode = null) + { + // ulr + string location = _urlBuilder.Build(GET_METHOD, "/linear-swap-api/v3/unified_account_info"); + + // option + string option = null; + if (contractCode != null) + { + option += $"&contract_code={contractCode}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(GET_METHOD,location); + + // content is null + return await HttpRequest.GetAsync(url); + } + + /// + /// 可抵扣资产查询 + /// + /// + /// + public async Task LinearSwapOverviewAccountInfoAsync(string tradePartition = null) + { + // ulr + string location = _urlBuilder.Build(GET_METHOD, "/linear-swap-api/v3/linear_swap_overview_account_info"); + + // option + string option = null; + if (tradePartition != null) + { + option += $"&trade_partition={tradePartition}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(GET_METHOD,location); + + // content is null + return await HttpRequest.GetAsync(url); + } + + /// + /// 设置U本位合约手续费抵扣方式 + /// + /// + /// + /// + public async Task LinearSwapFeeSwitchAsync(int feeOption, string deductionCurrency) + { + // ulr + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/linear_swap_fee_switch"); + + // content + string content = null; + content += $",\"fee_option\": {feeOption}"; + if (deductionCurrency != null) + { + content += $",\"deduction_currency\": \"{deductionCurrency}\""; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 调整逐仓持仓保证金 + /// + /// + /// + /// + /// + /// + /// + /// + public async Task FixPositionMarginChangeAsync(double amount, string asset, + string contractCode, int type, int direction, long? clientOrderId= null) + { + // ulr + string url = _urlBuilder.Build(POST_METHOD, "/linear-swap-api/v3/fix_position_margin_change"); + + // content + string content = null; + content += $",\"amount\": {amount}"; + content += $",\"asset\": \"{asset}\""; + content += $",\"contract_code\": \"{contractCode}\""; + content += $",\"type\": {type}"; + content += $",\"direction\": {direction}"; + if (clientOrderId != null) + { + content += $",\"clientOrderId\": {clientOrderId}"; + } + if (content != null) + { + content = $"{{ {content.Substring(1)} }}"; + } + return await HttpRequest.PostAsync(url, content); + } + + /// + /// 查询调整逐仓持仓保证金记录 + /// + /// + /// + /// + /// + /// + /// + /// + public async Task FixPositionMarginChangeRecordAsync(string asset, + string contractCode, long? startTime = null, long? endTime = null, string direct = null, + long? fromId = null) + { + // ulr + string location = _urlBuilder.Build(GET_METHOD, "/linear-swap-api/v3/fix_position_margin_change_record"); + + // option + string option = null; + if (asset != null) + { + option += $"&asset={asset}"; + } + if (contractCode != null) + { + option += $"&contract_code={contractCode}"; + } + if (startTime != null) + { + option += $"&start_time={startTime}"; + } + if (endTime != null) + { + option += $"&end_time={endTime}"; + } + if (direct != null) + { + option += $"&direct={direct}"; + } + if (fromId != null) + { + option += $"&from_id={fromId}"; + } + if (option != null) + { + location += $"?{option.Substring(1)}"; + } + + string url = _urlBuilder.Build(GET_METHOD,location); + return await HttpRequest.GetAsync(url); + } + } +} + + diff --git a/Huobi.SDK.Core/LinearSwap/WS/Response/Notify/SubContractElementsResponse.cs b/Huobi.SDK.Core/LinearSwap/WS/Response/Notify/SubContractElementsResponse.cs new file mode 100644 index 0000000..85d861d --- /dev/null +++ b/Huobi.SDK.Core/LinearSwap/WS/Response/Notify/SubContractElementsResponse.cs @@ -0,0 +1,171 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Huobi.SDK.Core.LinearSwap.WS.Response.Notify +{ + public class SubContractElementsResponse + { + [JsonProperty("op", NullValueHandling = NullValueHandling.Ignore)] + public string Op { get; set; } + + [JsonProperty("event", NullValueHandling = NullValueHandling.Ignore)] + public string Event { get; set; } + + [JsonProperty("topic", NullValueHandling = NullValueHandling.Ignore)] + public string Topic { get; set; } + + [JsonProperty("ts", NullValueHandling = NullValueHandling.Ignore)] + public long Ts { get; set; } + + public class SubContractElements + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("mode_type", NullValueHandling = NullValueHandling.Ignore)] + public int ModeType { get; set; } + + [JsonProperty("swap_delivery_type", NullValueHandling = NullValueHandling.Ignore)] + public int SwapDeliveryType { get; set; } + + [JsonProperty("instrument_index_code", NullValueHandling = NullValueHandling.Ignore)] + public string InstrumentIndexCode { get; set; } + + [JsonProperty("real_time_settlement", NullValueHandling = NullValueHandling.Ignore)] + public int RealTimeSettlement { get; set; } + + [JsonProperty("transfer_profit_ratio", NullValueHandling = NullValueHandling.Ignore)] + public decimal TransferProfitRatio { get; set; } + + [JsonProperty("cross_transfer_profit_ratio", NullValueHandling = NullValueHandling.Ignore)] + public decimal CrossTransferProfitRatio { get; set; } + + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public List InstrumentType { get; set; } + + [JsonProperty("trade_partition", NullValueHandling = NullValueHandling.Ignore)] + public string TradePartition { get; set; } + + [JsonProperty("min_level", NullValueHandling = NullValueHandling.Ignore)] + public string MinLevel { get; set; } + + [JsonProperty("max_level", NullValueHandling = NullValueHandling.Ignore)] + public string MaxLevel { get; set; } + + [JsonProperty("settle_period", NullValueHandling = NullValueHandling.Ignore)] + public int SettlePeriod { get; set; } + + [JsonProperty("funding_rate_cap", NullValueHandling = NullValueHandling.Ignore)] + public double FundingRateCap { get; set; } + + [JsonProperty("funding_rate_floor", NullValueHandling = NullValueHandling.Ignore)] + public double FundingRateFloor { get; set; } + + [JsonProperty("contract_infos", NullValueHandling = NullValueHandling.Ignore)] + public List ContractInfos { get; set; } + + [JsonProperty("price_ticks", NullValueHandling = NullValueHandling.Ignore)] + public List PriceTicks { get; set; } + + [JsonProperty("instrument_values", NullValueHandling = NullValueHandling.Ignore)] + public List InstrumentValues { get; set; } + + [JsonProperty("order_limits", NullValueHandling = NullValueHandling.Ignore)] + public List OrderLimits { get; set; } + + [JsonProperty("normal_limits", NullValueHandling = NullValueHandling.Ignore)] + public List NormalLimits { get; set; } + + [JsonProperty("open_limits", NullValueHandling = NullValueHandling.Ignore)] + public List OpenLimits { get; set; } + + [JsonProperty("trade_limits", NullValueHandling = NullValueHandling.Ignore)] + public List TradeLimits { get; set; } + + [JsonProperty("price_tick", NullValueHandling = NullValueHandling.Ignore)] + public string PriceTick { get; set; } + + [JsonProperty("instrument_value", NullValueHandling = NullValueHandling.Ignore)] + public string InstrumentValue { get; set; } + + [JsonProperty("offset_order_limit", NullValueHandling = NullValueHandling.Ignore)] + public string OffsetOrderLimit { get; set; } + + [JsonProperty("long_position_limit", NullValueHandling = NullValueHandling.Ignore)] + public string LongPositionLimit { get; set; } + + [JsonProperty("short_position_limit", NullValueHandling = NullValueHandling.Ignore)] + public string ShortPositionLimit { get; set; } + } + + public class NormalLimit + { + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public int InstrumentType { get; set; } + + [JsonProperty("open", NullValueHandling = NullValueHandling.Ignore)] + public string Open { get; set; } + + [JsonProperty("close", NullValueHandling = NullValueHandling.Ignore)] + public string Close { get; set; } + } + + public class PriceTick + { + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public int BusinessType { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public string Price { get; set; } + } + + + public class ContractInfo + { + [JsonProperty("contract_code", NullValueHandling = NullValueHandling.Ignore)] + public string ContractCode { get; set; } + + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public int InstrumentType { get; set; } + + [JsonProperty("settlement_date", NullValueHandling = NullValueHandling.Ignore)] + public string SettlementDate { get; set; } + + [JsonProperty("delivery_time", NullValueHandling = NullValueHandling.Ignore)] + public string DeliveryTime { get; set; } + + [JsonProperty("create_date", NullValueHandling = NullValueHandling.Ignore)] + public string CreateDate { get; set; } + + [JsonProperty("contract_status", NullValueHandling = NullValueHandling.Ignore)] + public int ContractStatus { get; set; } + + [JsonProperty("delivery_date", NullValueHandling = NullValueHandling.Ignore)] + public string DeliveryDate { get; set; } + } + + public class InstrumentValue + { + [JsonProperty("business_type", NullValueHandling = NullValueHandling.Ignore)] + public int BusinessType { get; set; } + + [JsonProperty("price", NullValueHandling = NullValueHandling.Ignore)] + public string Price { get; set; } + } + + public class OrderLimit + { + [JsonProperty("instrument_type", NullValueHandling = NullValueHandling.Ignore)] + public int InstrumentType { get; set; } + + [JsonProperty("open", NullValueHandling = NullValueHandling.Ignore)] + public string Open { get; set; } + + [JsonProperty("close", NullValueHandling = NullValueHandling.Ignore)] + public string Close { get; set; } + + [JsonProperty("open_after_closing", NullValueHandling = NullValueHandling.Ignore)] + public string OpenAfterClosing { get; set; } + } + } +} \ No newline at end of file diff --git a/Huobi.SDK.Core/LinearSwap/WS/WSNotifyClient.cs b/Huobi.SDK.Core/LinearSwap/WS/WSNotifyClient.cs index 852328f..36b5be5 100644 --- a/Huobi.SDK.Core/LinearSwap/WS/WSNotifyClient.cs +++ b/Huobi.SDK.Core/LinearSwap/WS/WSNotifyClient.cs @@ -606,5 +606,54 @@ public void CrossUnsubTriggerOrder(string contractCode, string cid = WebSocketOp } #endregion + #region contract elements + public delegate void _OnSubContractElementsResponse(SubContractElementsResponse data); + + /// + /// sub contract elements + /// + /// + /// + /// + /// + /// + public void SubContractElements(string contractCode, _OnSubContractElementsResponse callbackFun, string cid = WebSocketOp.DEFAULT_ID, + string businessType = null, string tradePartition = null) + { + string ch = $"public.{contractCode}.contract_elements"; + WSOpData opData = new WSOpData { op = "sub", cid = cid, topic = ch, businessType = businessType, tradePartition = tradePartition }; + string sub_str = JsonConvert.SerializeObject(opData); + + WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubContractElementsResponse), true, this.host, + this.accessKey, this.secretKey); + wsop.Connect(); + if (!allWsop.ContainsKey(ch)) + { + allWsop.Add(ch, wsop); + } + } + + /// + /// unsub contract elements + /// + /// + /// + /// + /// + public void UnsubContractElements(string contractCode, string cid = WebSocketOp.DEFAULT_ID, + string businessType = null, string tradePartition = null) + { + string ch = $"public.{contractCode}.contract_elements"; + WSOpData opData = new WSOpData { op = "unsub", cid = cid, topic = ch, businessType = businessType, tradePartition = tradePartition }; + string unsub_str = JsonConvert.SerializeObject(opData); + + if(!allWsop.ContainsKey(ch)) + { + return; + } + allWsop[ch].SendMsg(unsub_str); + allWsop.Remove(ch); + } + #endregion } } \ No newline at end of file diff --git a/Huobi.SDK.Core/Spot/RESTful/AccountClient.cs b/Huobi.SDK.Core/Spot/RESTful/AccountClient.cs deleted file mode 100644 index 6c04baf..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/AccountClient.cs +++ /dev/null @@ -1,201 +0,0 @@ -using System.Threading.Tasks; -using Huobi.SDK.Core.RequestBuilder; -using Huobi.SDK.Core.Spot.RESTful.Response.Account; -using Huobi.SDK.Core.Spot.RESTful.Request.Account; - -namespace Huobi.SDK.Core.Spot.RESTful -{ - /// - /// Responsible to operate account - /// - public class AccountClient - { - private const string GET_METHOD = "GET"; - private const string POST_METHOD = "POST"; - - private readonly PrivateUrlBuilder _urlBuilder; - - /// - /// Constructor - /// - /// Access Key - /// Secret Key - /// the host that the client connects to - public AccountClient(string accessKey, string secretKey, string host = Host.SPOT) - { - _urlBuilder = new PrivateUrlBuilder(accessKey, secretKey, host); - } - - /// - /// Returns a list of accounts owned by this API user - /// - /// GetAccountInfoResponse - public async Task GetAccountInfoAsync() - { - string url = _urlBuilder.Build(GET_METHOD, "/v1/account/accounts"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns the balance of an account specified by account id - /// - /// account id - /// GetAccountBalanceResponse - public async Task GetAccountBalanceAsync(string accountId) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v1/account/accounts/{accountId}/balance"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// - /// - /// - /// - /// - public async Task GetAccountValuationAsync(string accountType = null, string valuationCurrency = null) - { - GetRequest getq = new GetRequest(); - getq.AddParam("accountType", accountType); - getq.AddParam("valuationCurrency", valuationCurrency); - - string url = _urlBuilder.Build(GET_METHOD, "/v2/account/valuation", getq); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns the balance of an account specified by account id - /// - /// The type of this account - /// The valuation according to the certain fiat currency - /// Sub User's UID. - /// GetAccountAssetValuationResponse - public async Task GetAccountAssetValuationAsync(string accountType, string valuationCurrency = "BTC", long? subUid = null) - { - var request = new GetRequest() - .AddParam("accountType", accountType); - - if (!string.IsNullOrEmpty(valuationCurrency)) - { - request.AddParam("valuationCurrency", valuationCurrency); - } - if (subUid != null) - { - request.AddParam("subUid", subUid.ToString()); - } - - string url = _urlBuilder.Build(GET_METHOD, "/v2/account/asset-valuation", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Parent user and sub user transfer asset between accounts. - /// - /// TransferAccountRequest - /// TransferAccountResponse - public async Task TransferAccountAsync(TransferAccountRequest request) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/account/transfer"); - - return await HttpRequest.PostAsync(url, request.ToJson()); - } - - /// - /// Returns the amount changes of specified user's account - /// - /// - /// GetAccountHistoryResponse - public async Task GetAccountHistoryAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v1/account/history", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns the amount changes of specified user's account - /// - /// - /// GetAccountHistoryResponse - public async Task GetAccountLedgerAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v2/account/ledger", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Transfer fund from spot account to futrue contract account. - /// - /// Currency name - /// Amount of fund to transfer - /// TransferResponse - public async Task TransferFromSpotToFutureAsync(string currency, decimal amount) - { - return await TransferSpotAndFutureAsync(currency, amount, "pro-to-futures"); - } - - /// - /// Transfer fund from future contract account spot account. - /// - /// Currency name - /// Amount of fund to transfer - /// TransferResponse - public async Task TransferFromFutureToSpotAsync(string currency, decimal amount) - { - return await TransferSpotAndFutureAsync(currency, amount, "futures-to-pro"); - } - - /// - /// transfer fund between spot account and future contract account - /// - /// Currency name - /// Amount of fund to transfer - /// Type of the transfer, possible values: [futures-to-pro, pro-to-futures] - /// TransferResponse - private async Task TransferSpotAndFutureAsync(string currency, decimal amount, string type) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/futures/transfer"); - - string content = $"{{ \"currency\": \"{currency}\", \"amount\":\"{amount}\", \"type\":\"{type}\" }}"; - - return await HttpRequest.PostAsync(url, content); - } - - /// - /// Returns the point balance of specified user - /// - /// - /// GetPointBalanceResponse - public async Task GetPointBalanceAsync(string subUid = null) - { - GetRequest request = null; - - if (!string.IsNullOrEmpty(subUid)) - { - request = new GetRequest(); - request.AddParam("subUid", subUid); - } - - string url = _urlBuilder.Build(GET_METHOD, $"/v2/point/account", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// transfer point between parent user and sub user - /// - /// - /// TransferResponse - public async Task TransferPointAsync(TransferPointRequest request) - { - string url = _urlBuilder.Build(POST_METHOD, "/v2/point/transfer"); - - return await HttpRequest.PostAsync(url, request.ToJson()); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/AlgoOrderClient.cs b/Huobi.SDK.Core/Spot/RESTful/AlgoOrderClient.cs deleted file mode 100644 index 05203f9..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/AlgoOrderClient.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System.Threading.Tasks; -using Huobi.SDK.Core.RequestBuilder; -using Huobi.SDK.Core.Spot.RESTful.Response.AlgoOrder; -using Huobi.SDK.Core.Spot.RESTful.Request.AlgoOrder; - -namespace Huobi.SDK.Core.Spot.RESTful -{ - /// - /// Responsible to operate on order - /// - public class AlgoOrderClient - { - private const string GET_METHOD = "GET"; - private const string POST_METHOD = "POST"; - - private readonly PrivateUrlBuilder _urlBuilder; - - /// - /// Constructor - /// - /// Access Key - /// Secret Key - /// the host that the client connects to - public AlgoOrderClient(string accessKey, string secretKey, string host = Host.SPOT) - { - _urlBuilder = new PrivateUrlBuilder(accessKey, secretKey, host); - } - - /// - /// Place a new algo order - /// - /// - /// PlaceOrderResponse - public async Task PlaceOrderAsync(PlaceOrderRequest request) - { - string url = _urlBuilder.Build(POST_METHOD, "/v2/algo-orders"); - - return await HttpRequest.PostAsync(url, request.ToJson()); - } - - /// - /// Cancel an algo order by client order Ids - /// - /// - /// CancelOrdersResponse - public async Task CancelOrdersAsync(CancelOrdersRequest request) - { - string url = _urlBuilder.Build(POST_METHOD, $"/v2/algo-orders/cancellation"); - - return await HttpRequest.PostAsync(url, request.ToJson()); - } - - /// - /// Returns all open orders which have not been filled completely. - /// - /// - /// GetOpenOrdersResponse - public async Task GetOpenOrdersAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, "/v2/algo-orders/opening", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns algo orders that have been inactive - /// - /// - /// GetHistoryOrdersResponse - public async Task GetHistoryOrdersAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v2/algo-orders/history", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns a specific algo order - /// - /// - /// GetSpecificOrderResponse - public async Task GetSpecificOrderAsync(string clientOrderId) - { - var request = new GetRequest() - .AddParam("clientOrderId", clientOrderId); - - string url = _urlBuilder.Build(GET_METHOD, $"/v2/algo-orders/specific", request); - - return await HttpRequest.GetAsync(url); - } - - - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/CommonClient.cs b/Huobi.SDK.Core/Spot/RESTful/CommonClient.cs deleted file mode 100644 index 9933e4e..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/CommonClient.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System.Threading.Tasks; -using Huobi.SDK.Core.RequestBuilder; -using Huobi.SDK.Core.Spot.RESTful.Response.Common; - -namespace Huobi.SDK.Core.Spot.RESTful -{ - /// - /// Responsible to get common information - /// - public class CommonClient - { - - private PublicUrlBuilder _urlBuilder; - - /// - /// Constructor - /// - /// the host that the client connects to - public CommonClient(string host = Host.SPOT) - { - _urlBuilder = new PublicUrlBuilder(host); - } - - /// - /// Get system status, Incidents and planned maintenance. - /// - /// - public async Task GetSystemStatus() - { - string url = "https://status.huobigroup.com/api/v2/summary.json"; - - return await HttpRequest.GetStringAsync(url); - } - - /// - /// Returns current market status - /// - /// GetMarketStatusResponse - public async Task GetMarketStatusAsync() - { - string url = _urlBuilder.Build("/v2/market-status"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Get all Huobi's supported trading symbol. - /// - /// GetSymbolsResponse - public async Task GetSymbolsAsync() - { - string url = _urlBuilder.Build("/v1/common/symbols"); - - return await HttpRequest.GetAsync(url); - } - - - /// - /// Get all Huobi's supported trading currencies - /// - /// GetCurrencysResponse - public async Task GetCurrencysAsync() - { - string url = _urlBuilder.Build("/v1/common/currencys"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Get currency information - /// - /// currency name - /// GetCurrencyResponse - public async Task GetCurrencyAsync(string currency, bool authorizedUser) - { - string url = _urlBuilder.Build($"/v2/reference/currencies?currency={currency}&authorizedUser={authorizedUser}"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// The current system time in milliseconds adjusted to Singapore time zone. - /// - /// GetTimestampResponse - public async Task GetTimestampAsync() - { - string url = _urlBuilder.Build("/v1/common/timestamp"); - - return await HttpRequest.GetAsync(url); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/MarginClient.cs b/Huobi.SDK.Core/Spot/RESTful/MarginClient.cs deleted file mode 100644 index ed91d03..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/MarginClient.cs +++ /dev/null @@ -1,276 +0,0 @@ -using System.Threading.Tasks; -using Huobi.SDK.Core.RequestBuilder; -using Huobi.SDK.Core.Spot.RESTful.Response.Margin; -using Huobi.SDK.Core.Spot.RESTful.Request.Margin; - -namespace Huobi.SDK.Core.Spot.RESTful -{ - /// - /// Responsible to operate margin - /// - public class MarginClient - { - private const string GET_METHOD = "GET"; - private const string POST_METHOD = "POST"; - - private readonly PrivateUrlBuilder _urlBuilder; - - /// - /// Constructor - /// - /// Access Key - /// Secret Key - /// the host that the client connects to - public MarginClient(string accessKey, string secretKey, string host = Host.SPOT) - { - _urlBuilder = new PrivateUrlBuilder(accessKey, secretKey, host); - } - - /// - /// Transfer specific asset from spot trading account to cross margin account - /// - /// The currency to transfer - /// The amount of currency to transfer - /// TransferResponse - public async Task CrossTransferIn(string currency, string amount) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/cross-margin/transfer-in"); - - string body = $"{{ \"currency\":\"{currency}\", \"amount\":\"{amount}\" }}"; - - return await HttpRequest.PostAsync(url, body); - } - - /// - /// Transfer specific asset from cross margin account to spot trading account - /// - /// The currency to transfer - /// The amount of currency to transfer - /// TransferResponse - public async Task CrossTransferOut(string currency, string amount) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/cross-margin/transfer-out"); - - string body = $"{{ \"currency\":\"{currency}\", \"amount\":\"{amount}\" }}"; - - return await HttpRequest.PostAsync(url, body); - } - - /// - /// Returns loan interest rates and quota applied on the user - /// - /// CrossGetLoanInfoResponse - public async Task CrossGetLoanInfo() - { - string url = _urlBuilder.Build(GET_METHOD, "/v1/cross-margin/loan-info"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Place an order to apply a margin loan. - /// - /// The currency to borrow - /// The amount of currency to borrow (precision: 3 decimal places) - /// TransferResponse - public async Task CrossApplyLoan(string currency, string amount) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/cross-margin/orders"); - - string body = $"{{ \"currency\":\"{currency}\", \"amount\":\"{amount}\" }}"; - - return await HttpRequest.PostAsync(url, body); - } - - /// - /// Repays margin loan with you asset in your margin account. - /// - /// The previously returned order id when loan order was created - /// The amount of currency to repay - /// TransferResponse - public async Task CrossRepay(string orderId, string amount) - { - string url = _urlBuilder.Build(POST_METHOD, $"/v1/cross-margin/orders/{orderId}/repay"); - - string body = $"{{ \"amount\":\"{amount}\" }}"; - - return await HttpRequest.PostAsync(url, body); - } - - /// - /// Returns margin orders based on a specific searching criteria. - /// - /// GetCrossLoanOrdersResponse - public async Task CrossGetLoanOrders(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, "/v1/cross-margin/loan-orders", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns the balance of the margin loan account. - /// - /// GetCrossMarginAccountResponse - public async Task CrossGetMarginAccount(string subUserId) - { - GetRequest request = new GetRequest() - .AddParam("sub-uid", subUserId); - string url = _urlBuilder.Build(GET_METHOD, "/v1/cross-margin/accounts/balance", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// General repays margin loan. - /// - /// PostRepaymentResponse - /// TransferResponse - public async Task PostRepayment(GeneralRepayRequest request) - { - string url = _urlBuilder.Build(POST_METHOD, $"/v2/account/repayment"); - - return await HttpRequest.PostAsync(url, request.ToJson()); - } - - /// - /// Returns the repayment records - /// - /// GetCrossMarginAccountResponse - public async Task GetRepayment(GetRepaymentRequest request) - { - GetRequest getRequest = new GetRequest() - .AddParam("repayId", request.repayId) - .AddParam("accountId", request.accountId) - .AddParam("currency", request.currency) - .AddParam("startTime", request.startTime.ToString()) - .AddParam("endTime", request.endTime.ToString()) - .AddParam("sort", request.sort) - .AddParam("limit", request.limit.ToString()) - .AddParam("fromId", request.fromId.ToString()); - - string url = _urlBuilder.Build(GET_METHOD, "/v2/account/repayment", getRequest); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Transfer specific asset from spot trading account to isolated margin account - /// - /// Trading symbol - /// The currency to transfer - /// The amount of currency to transfer - /// TransferResponse - public async Task IsolatedTransferInAsync(string symbol, string currency, string amount) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/dw/transfer-in/margin"); - - string body = $"{{ \"symbol\":\"{symbol}\", \"currency\":\"{currency}\", \"amount\":\"{amount}\" }}"; - - return await HttpRequest.PostAsync(url, body); - } - - /// - /// Transfer specific asset from isolated margin account to spot trading account - /// - /// Trading symbol - /// The currency to transfer - /// The amount of currency to transfer - /// TransferResponse - public async Task IsolatedTransferOutAsync(string symbol, string currency, string amount) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/dw/transfer-out/margin"); - - string body = $"{{ \"symbol\":\"{symbol}\", \"currency\":\"{currency}\", \"amount\":\"{amount}\" }}"; - - return await HttpRequest.PostAsync(url, body); - } - - /// - /// Returns loan interest rates and quota applied on the user - /// - /// Trading symbol (multiple selections acceptable, separated by comma) - /// GetLoanInfoResponse - public async Task IsolatedGetLoanInfoAsync(string symbols) - { - var request = new GetRequest(); - - if (!string.IsNullOrEmpty(symbols)) - { - request.AddParam("symbols", symbols); - } - - string url = _urlBuilder.Build(GET_METHOD, "/v1/margin/loan-info", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Place an order to apply a margin loan. - /// - /// The trading symbol to borrow margin - /// The currency to borrow - /// The amount of currency to borrow (precision: 3 decimal places) - /// TransferResponse - public async Task IsolatedApplyLoanAsync(string symbol, string currency, string amount) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/margin/orders"); - - string body = $"{{ \"symbol\":\"{symbol}\", \"currency\":\"{currency}\", \"amount\":\"{amount}\" }}"; - - return await HttpRequest.PostAsync(url, body); - } - - /// - /// Repays margin loan with you asset in your margin account. - /// - /// The previously returned order id when loan order was created - /// The amount of currency to repay - /// TransferResponse - public async Task IsolatedRepayAsync(string orderId, string amount) - { - string url = _urlBuilder.Build(POST_METHOD, $"/v1/margin/orders/{orderId}/repay"); - - string body = $"{{ \"amount\":\"{amount}\" }}"; - - return await HttpRequest.PostAsync(url, body); - } - - /// - /// Returns margin orders based on a specific searching criteria. - /// - /// - /// GetLoanOrdersResponse - public async Task IsolatedGetLoanOrdersAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, "/v1/margin/loan-orders", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns the balance of the margin loan account. - /// - /// Trading symbol - /// Sub user ID (mandatory field while parent user querying sub user’s margin account details) - /// GetMarginAccountResponse - public async Task IsolatedGetMarginAccountAsync(string symbol, string subUid) - { - var request = new GetRequest(); - - if (!string.IsNullOrEmpty(symbol)) - { - request.AddParam("symbol", symbol); - } - - if (subUid != null) - { - request.AddParam("sub-uid", subUid); - } - - string url = _urlBuilder.Build(GET_METHOD, "/v1/margin/accounts/balance", request); - - return await HttpRequest.GetAsync(url); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/MarketClient.cs b/Huobi.SDK.Core/Spot/RESTful/MarketClient.cs deleted file mode 100644 index 3aef7be..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/MarketClient.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System.Threading.Tasks; -using Huobi.SDK.Core.RequestBuilder; -using Huobi.SDK.Core.Spot.RESTful.Response.Market; - -namespace Huobi.SDK.Core.Spot.RESTful -{ - /// - /// Responsible to get market information - /// - public class MarketClient - { - private PublicUrlBuilder _urlBuilder; - - /// - /// Constructor - /// - /// the host that the client connects to - public MarketClient(string host = Host.SPOT) - { - _urlBuilder = new PublicUrlBuilder(host); - } - - /// - /// Retrieves all klines in a specific range. - /// - /// - /// - public async Task GetKlineAsync(GetRequest request) - { - string url = _urlBuilder.Build("/market/history/kline", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Retrieves the latest ticker with some important 24h aggregated market data. - /// - /// Trading symbol - /// GetMergedResponse - public async Task GetMergedAsync(string symbol) - { - string url = _urlBuilder.Build($"/market/detail/merged?symbol={symbol}"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Retrieve the latest tickers for all supported pairs. - /// - /// GetTickersResponse - public async Task GetTicksAsync() - { - string url = _urlBuilder.Build("/market/tickers"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Retrieves the current order book of a specific pair - /// - /// - /// GetDepthResponse - public async Task GetDepthAsync(GetRequest request) - { - string url = _urlBuilder.Build("/market/depth", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Retrieves the latest trade with its price, volume, and direction. - /// - /// Trading symbol - /// GetTradeResponse - public async Task GetTradeAsync(string symbol) - { - string url = _urlBuilder.Build($"/market/trade?symbol={symbol}"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Retrieves the most recent trades with their price, volume, and direction. - /// - /// Trading symbol - /// The number of data returns - /// GetLastTradesResponse - public async Task GetHisTradesAsync(string symbol, int size) - { - string url = _urlBuilder.Build($"/market/history/trade?symbol={symbol}&size={size}"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Retrieves the summary of trading in the market for the last 24 hours. - /// - /// Trading symbol - /// GetDetailResponse - public async Task GetDetailAsync(string symbol) - { - string url = _urlBuilder.Build($"/market/detail?symbol={symbol}"); - - return await HttpRequest.GetAsync(url); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/OrderClient.cs b/Huobi.SDK.Core/Spot/RESTful/OrderClient.cs deleted file mode 100644 index bd60278..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/OrderClient.cs +++ /dev/null @@ -1,216 +0,0 @@ -using System.Threading.Tasks; -using Huobi.SDK.Core.RequestBuilder; -using Newtonsoft.Json; -using System; -using Huobi.SDK.Core.Spot.RESTful.Response.Order; -using Huobi.SDK.Core.Spot.RESTful.Request.Order; - -namespace Huobi.SDK.Core.Spot.RESTful -{ - /// - /// Responsible to operate on order - /// - public class OrderClient - { - private const string GET_METHOD = "GET"; - private const string POST_METHOD = "POST"; - - private readonly PrivateUrlBuilder _urlBuilder; - - /// - /// Constructor - /// - /// Access Key - /// Secret Key - /// the host that the client connects to - public OrderClient(string accessKey, string secretKey, string host = Host.SPOT) - { - _urlBuilder = new PrivateUrlBuilder(accessKey, secretKey, host); - } - - /// - /// Place a new order and send to the exchange to be matched. - /// - /// - /// PlaceOrderResponse - public async Task PlaceOrderAsync(PlaceOrderRequest request) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/order/orders/place"); - - return await HttpRequest.PostAsync(url, request.ToJson()); - } - - /// - /// Place multipler orders (at most 10 orders) - /// - /// - /// PlaceOrdersResponse - public async Task PlaceOrdersAsync(PlaceOrderRequest[] requests) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/order/batch-orders"); - - return await HttpRequest.PostAsync(url, JsonConvert.SerializeObject(requests)); - } - - /// - /// Cancel an order by order id - /// - /// - /// CancelOrderByIdResponse - public async Task CancelOrderByIdAsync(string orderId) - { - string url = _urlBuilder.Build(POST_METHOD, $"/v1/order/orders/{orderId}/submitcancel"); - - return await HttpRequest.PostAsync(url); - } - - /// - /// Cancel an order by client order id - /// - /// Client order id - /// CancelOrderByClientResponse - public async Task CancelOrderByClientOrderIdAsync(string clientOrderId) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/order/orders/submitCancelClientOrder"); - - string body = $"{{ \"client-order-id\":\"{clientOrderId}\" }}"; - - return await HttpRequest.PostAsync(url, body); - } - - /// - /// Returns all open orders which have not been filled completely. - /// - /// - /// GetOpenOrdersResponse - public async Task GetOpenOrdersAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, "/v1/order/openOrders", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Submit cancellation for multiple orders at once with given criteria. - /// - /// - /// CancelOrdersByCriteriaResponse - public async Task CancelOrdersByCriteriaAsync(CancelOrdersByCriteriaRequest request) - { - string url = _urlBuilder.Build(POST_METHOD, $"/v1/order/orders/batchCancelOpenOrders"); - - return await HttpRequest.PostAsync(url, request.ToJson()); - } - - /// - /// Submit cancellation for multiple orders at once with given ids - /// - /// - /// CancelOrdersByIdsResponse - public async Task CancelOrdersByIdsAsync(CancelOrdersByIdsRequest request) - { - string url = _urlBuilder.Build(POST_METHOD, $"/v1/order/orders/batchcancel"); - - return await HttpRequest.PostAsync(url, request.ToJson()); - } - - /// - /// Returns the detail of one order by order id - /// - /// Order id - /// GetOrderByIdResponse - public async Task GetOrderByIdAsync(string orderId) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v1/order/orders/{orderId}"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns the detail of one order by client order id - /// - /// - /// GetOrderByIdResponse - public async Task GetOrderByClientAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v1/order/orders/getClientOrder", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns the match result of an order. - /// - /// - /// GetMatchResultsResponse - public async Task GetMatchResultsByIdAsync(string orderId) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v1/order/orders/{orderId}/matchresults"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns orders based on a specific searching criteria. - /// - /// - /// GetHistoryOrdersResponse - public async Task GetHistoryOrdersAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v1/order/orders", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns orders based on a specific searching criteria. - /// Note: queriable range should be within past 1 day for cancelled order (state = "canceled") - /// - /// - /// GetHistoryOrdersResponse - public async Task GetLast48hOrdersAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v1/order/history", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns the match results of past and open orders based on specific search criteria. - /// - /// - /// GetMatchResultsResponse - public async Task GetMatchResultsAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v1/order/matchresults", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// To be obsoleted - /// Returns the current transaction fee rate applied to the user. - /// - /// - /// GetFeeResponse - [Obsolete] - public async Task GetFeeAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v1/fee/fee-rate/get", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns the current transaction fee rate applied to the user. - /// - /// - /// GetTransactFeeRateResponse - public async Task GetTransactFeeRateAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v2/reference/transact-fee-rate", request); - - return await HttpRequest.GetAsync(url); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/Account/TransferAccountRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/Account/TransferAccountRequest.cs deleted file mode 100644 index 8e22776..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/Account/TransferAccountRequest.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.Account -{ - public class TransferAccountRequest - { - [JsonProperty("from-user")] - public long fromUser; - - [JsonProperty("from-account-type")] - public string fromAccountType; - - [JsonProperty("from-account")] - public long fromAccount; - - [JsonProperty("to-user")] - public long toUser; - - [JsonProperty("to-account-type")] - public string toAccountType; - - [JsonProperty("to-account")] - public long toAccount; - - public string currency; - - public string amount; - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/Account/TransferPointRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/Account/TransferPointRequest.cs deleted file mode 100644 index 1c28b84..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/Account/TransferPointRequest.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.Account -{ - public class TransferPointRequest - { - public string fromUid; - - public string toUid; - - public long groupId; - - public string amount; - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/AlgoOrder/CancelOrdersRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/AlgoOrder/CancelOrdersRequest.cs deleted file mode 100644 index 663f466..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/AlgoOrder/CancelOrdersRequest.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.AlgoOrder -{ - public class CancelOrdersRequest - { - public string[] clientOrderIds; - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/AlgoOrder/PlaceOrderRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/AlgoOrder/PlaceOrderRequest.cs deleted file mode 100644 index 4706479..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/AlgoOrder/PlaceOrderRequest.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.AlgoOrder -{ - public class PlaceOrderRequest - { - public int accountId; - - public string symbol; - - public string orderPrice; - - public string orderSide; - - public string orderSize; - - public string orderValue; - - public string timeInForce; - - public string orderType; - - public string clientOrderId; - - public string stopPrice; - - public string trailingRate; - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/Margin/GeneralRepayRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/Margin/GeneralRepayRequest.cs deleted file mode 100644 index 3814b76..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/Margin/GeneralRepayRequest.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.Margin -{ - public class GeneralRepayRequest - { - public string accountId; - - public string currency; - - public string amount; - - public string transactId; - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/Margin/GetRepaymentRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/Margin/GetRepaymentRequest.cs deleted file mode 100644 index c0fd187..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/Margin/GetRepaymentRequest.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.Margin -{ - public class GetRepaymentRequest - { - public string repayId; - - public string accountId; - - public string currency; - - public long startTime; - - public long endTime; - - public string sort; - - public int limit; - - public long fromId; - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/Order/CancelOrdersByCriteriaRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/Order/CancelOrdersByCriteriaRequest.cs deleted file mode 100644 index 557ef62..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/Order/CancelOrdersByCriteriaRequest.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.Order -{ - public class CancelOrdersByCriteriaRequest - { - [JsonProperty(PropertyName = "account-id")] - public string AccountId; - - public string symbol; - - public string side; - - public int size; - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/Order/CancelOrdersByIdsRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/Order/CancelOrdersByIdsRequest.cs deleted file mode 100644 index f7ac1c5..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/Order/CancelOrdersByIdsRequest.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.Order -{ - public class CancelOrdersByIdsRequest - { - [JsonProperty(PropertyName = "order-ids")] - public string[] OrderIds; - - [JsonProperty(PropertyName = "client-order-ids")] - public string[] ClientOrderIds; - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/Order/PlaceOrderRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/Order/PlaceOrderRequest.cs deleted file mode 100644 index 9cd3fd2..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/Order/PlaceOrderRequest.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.Order -{ - public class PlaceOrderRequest - { - [JsonProperty(PropertyName="account-id")] - public string AccountId; - - public string symbol; - - public string type; - - public string amount; - - public string price; - - public string source; - - [JsonProperty(PropertyName="client-order-id")] - public string ClientOrderId; - - [JsonProperty(PropertyName = "stop-price")] - public string StopPrice; - - [JsonProperty(PropertyName = "operator")] - public string Operator; - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/Order/RequestOrdersRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/Order/RequestOrdersRequest.cs deleted file mode 100644 index 664a091..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/Order/RequestOrdersRequest.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.Order -{ - public class RequestOrdersRequest - { - public string op { get { return "req"; } } - - public string topic { get { return "orders.list"; } } - - public string cid; - - [JsonProperty(PropertyName = "account-id")] - public int AccountId; - - public string symbol; - - public string types; - - public string states; - - [JsonProperty(PropertyName = "start-date")] - public string StartDate; - - [JsonProperty(PropertyName = "end-date")] - public string EndDate; - - public string from; - - public string direct; - - public string size; - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/SubUser/CreateSubUserRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/SubUser/CreateSubUserRequest.cs deleted file mode 100644 index be09499..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/SubUser/CreateSubUserRequest.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.SubUser -{ - /// - /// Create SubUser request - /// - public class CreateSubUserRequest - { - public UserList[] userList; - - public class UserList - { - public string userName; - - public string note; - } - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Request/Wallet/WithdrawRequest.cs b/Huobi.SDK.Core/Spot/RESTful/Request/Wallet/WithdrawRequest.cs deleted file mode 100644 index cb25138..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Request/Wallet/WithdrawRequest.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Request.Wallet -{ - public class WithdrawRequest - { - public string address; - - public string amount; - - public string currency; - - public string fee; - - public string chain; - - public string addrTag; - - public string ToJson() - { - return JsonConvert.SerializeObject(this); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountAssetValuationResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountAssetValuationResponse.cs deleted file mode 100644 index 9bf4574..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountAssetValuationResponse.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Account -{ - public class GetAccountAssetValuationResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Data data; - - public class Data - { - /// - /// The valuation according to the certain fiat currency - /// - public string balance; - - /// - /// Return time; - /// - public long timestamp; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountBalanceResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountBalanceResponse.cs deleted file mode 100644 index 178ae35..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountBalanceResponse.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Account -{ - /// - /// GetAccountBalance response - /// - public class GetAccountBalanceResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public Data data; - - /// - /// Account info - /// - public class Data - { - /// - /// Unique account id - /// - public int id; - - /// - /// The type of this account - /// Possible values: [spot, margin, otc, point, super-margin] - /// - public string type; - - /// - /// Account state - /// Possible values: [working, lock] - /// - public string state; - - /// - /// The balance details of each currency - /// - public Balance[] list; - - public class Balance - { - /// - /// The currency of this balance - /// - public string currency; - - /// - /// The balance type - /// Possible values: [trade, frozen] - /// - public string type; - - /// - /// The balance in the main currency unit - /// - public string balance; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountHistoryResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountHistoryResponse.cs deleted file mode 100644 index 4b61c32..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountHistoryResponse.cs +++ /dev/null @@ -1,94 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Account -{ - /// - /// GetAccountHistory response - /// - public class GetAccountHistoryResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public History[] data; - - /// - /// Account history - /// - public class History - { - /// - /// Account id - /// - [JsonProperty(PropertyName = "account-id")] - public long accountId; - - /// - /// Currency name - /// - public string currency; - - /// - /// Amount change (positive value if income, negative value if outcome) - /// - [JsonProperty(PropertyName = "transact-amt")] - public string transactAmt; - - /// - /// Amount change types - /// Possible values: [trade,etf, transact-fee, deduction, transfer, credit, liquidation, - /// interest, deposit-withdraw, withdraw-fee, exchange, other-types] - /// - [JsonProperty(PropertyName = "transact-type")] - public string transactType; - - /// - /// Available balance - /// - [JsonProperty(PropertyName = "avail-balance")] - public string availableBalance; - - /// - /// Account balance - /// - [JsonProperty(PropertyName = "acct-balance")] - public string accountBalance; - - /// - /// Transaction time (database time) - /// - [JsonProperty(PropertyName = "transact-time")] - public long transactTime; - - /// - /// Unique record ID in the database - /// - [JsonProperty(PropertyName = "record-id")] - public string recordId; - } - - /// - /// First record ID in next page (only valid if exceeded page size) - /// - [JsonProperty("next-id")] - public long nextId; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountInfoResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountInfoResponse.cs deleted file mode 100644 index 91eb054..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountInfoResponse.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Account -{ - /// - /// GetAccountInfo response - /// - public class GetAccountInfoResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Response body - /// - public Data[] data; - - /// - /// Account info - /// - public class Data - { - /// - /// Unique account id - /// - public int id; - - /// - /// The type of this account - /// Possible values: [spot, margin, otc, point, super-margin] - /// - public string type; - - /// - /// The type of sub account (applicable only for isolated margin accout) - /// - public string subtype; - - /// - /// Account state - /// Possible values: [working, lock] - /// - public string state; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountLedgerResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountLedgerResponse.cs deleted file mode 100644 index 6bf0705..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountLedgerResponse.cs +++ /dev/null @@ -1,84 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Account -{ - /// - /// GetAccountHistory response - /// - public class GetAccountLedgerResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public Ledger[] data; - - /// - /// First record ID in next page (only valid if exceeded page size) - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public long nextId; - - /// - /// Ledger - /// - public class Ledger - { - /// - /// Account Id - /// - public long accountId; - - /// - /// Cryptocurrency - /// - public string currency; - - /// - /// Transaction amount (income positive, expenditure negative) - /// - public string transactAmt; - - /// - /// Transaction type - /// Possible values: [transfer] - /// - public string transactType; - - /// - /// Transfer type - /// - public string transferType; - - /// - /// Transaction ID - /// - public long transactId; - - /// - /// Transaction time - /// - public long transactTime; - - /// - /// Transferer’s account ID - /// - public long transferer; - - /// - /// Transferee’s account ID - /// - public long transferee; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountValuationResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountValuationResponse.cs deleted file mode 100644 index c3de838..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetAccountValuationResponse.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Account -{ - /// - /// GetAccountBalance response - /// - public class GetAccountValuationResponse - { - public int code; - - public bool success; - - public Data data; - - public class Data - { - public Updated updated; - - public class Updated - { - public bool success; - - public long time; - - } - - public string todayProfitRate; - - public string totalBalance; - - public string todayProfit; - - public PAB[] profitAccountBalanceList; - - public class PAB - { - public string distributionType; - - public float balance; - - public bool success; - - public string accountBalance; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetPointBalanceResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetPointBalanceResponse.cs deleted file mode 100644 index aea13c2..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Account/GetPointBalanceResponse.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Account -{ - public class GetPointBalanceResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Data data; - - public class Data - { - /// - /// Account ID - /// - public string accountId; - - /// - /// Account status (working, lock, fl-sys, fl-mgt, fl-end, fl-negative) - /// - public string accountStatus; - - /// - /// Account balance - /// - public string acctBalance; - - public GroupId[] groupIds; - - public class GroupId - { - /// - /// Group ID - /// - public long groupId; - - /// - /// Expiration date (unix time in millisecond) - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public long expiryDate; - - /// - /// Remaining amount - /// - public string remainAmt; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Account/TransferAccountResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Account/TransferAccountResponse.cs deleted file mode 100644 index 23bd403..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Account/TransferAccountResponse.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Account -{ - public class TransferAccountResponse - { - public string status; - - [JsonProperty("err-code")] - public string errCode; - - [JsonProperty("err-msg")] - public string errMessage; - - public TransferResponse data; - - public class TransferResponse - { - [JsonProperty("transact-id")] - public int transactId; - - [JsonProperty("transact-time")] - public long transactTime; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Account/TransferPointResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Account/TransferPointResponse.cs deleted file mode 100644 index 10a9390..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Account/TransferPointResponse.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Account -{ - public class TransferPointResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - public Data data; - - public class Data - { - /// - /// Transaction ID - /// - public string transactId; - - /// - /// Transaction time (unix time in millisecond) - /// - public long transactTime; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Account/TransferResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Account/TransferResponse.cs deleted file mode 100644 index d883cbc..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Account/TransferResponse.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Account -{ - /// - /// Transfer response - /// - public class TransferResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Transfer id - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public long data; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/CancelOrdersResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/CancelOrdersResponse.cs deleted file mode 100644 index cf61f83..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/CancelOrdersResponse.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.AlgoOrder -{ - public class CancelOrdersResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Data data; - - public class Data - { - public string[] accepted; - - public string[] rejected; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/GetHistoryOrdersResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/GetHistoryOrdersResponse.cs deleted file mode 100644 index d56a098..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/GetHistoryOrdersResponse.cs +++ /dev/null @@ -1,63 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.AlgoOrder -{ - public class GetHistoryOrdersResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Data[] data; - - public class Data - { - public int accountId; - - public string source; - - public string clientOrderId; - - public string orderId; - - public string symbol; - - public string orderPrice; - - public string orderSize; - - public string orderValue; - - public string orderSide; - - public string timeInForce; - - public string orderType; - - public string stopPrice; - - public string trailingRate; - - public long orderOrigTime; - - public long lastActTime; - - public long orderCreateTime; - - public string orderStatus; - - public int errCode; - - public string errMessage; - } - - public long nextId; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/GetOpenOrdersResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/GetOpenOrdersResponse.cs deleted file mode 100644 index 64fb2b3..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/GetOpenOrdersResponse.cs +++ /dev/null @@ -1,55 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.AlgoOrder -{ - public class GetOpenOrdersResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Data[] data; - - public class Data - { - public int accountId; - - public string source; - - public string clientOrderId; - - public string symbol; - - public string orderPrice; - - public string orderSize; - - public string orderValue; - - public string orderSide; - - public string timeInForce; - - public string orderType; - - public string stopPrice; - - public string trailingRate; - - public long orderOrigTime; - - public long lastActTime; - - public string orderStatus; - } - - public long nextId; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/GetSpecificOrderResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/GetSpecificOrderResponse.cs deleted file mode 100644 index 008fec9..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/GetSpecificOrderResponse.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.AlgoOrder -{ - public class GetSpecificOrderResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Data data; - - public class Data - { - public int accountId; - - public string source; - - public string clientOrderId; - - public string orderId; - - public string symbol; - - public string orderPrice; - - public string orderSize; - - public string orderValue; - - public string orderSide; - - public string timeInForce; - - public string orderType; - - public string stopPrice; - - public string trailingRate; - - public long orderOrigTime; - - public long lastActTime; - - public long orderCreateTime; - - public string orderStatus; - - public int errCode; - - public string errMessage; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/PlaceOrderResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/PlaceOrderResponse.cs deleted file mode 100644 index 0856209..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/AlgoOrder/PlaceOrderResponse.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.AlgoOrder -{ - public class PlaceOrderResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Data data; - - public class Data - { - public string clientOrderId; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetCurrencyResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetCurrencyResponse.cs deleted file mode 100644 index 09b1d7c..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetCurrencyResponse.cs +++ /dev/null @@ -1,154 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Common -{ - /// - /// GetCurrency response - /// - public class GetCurrencyResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Currency[] data; - - /// - /// Currency detail - /// - public class Currency - { - /// - /// Currency name - /// - public string currency; - - /// - /// Chain list - /// - public Chain[] chains; - - /// - /// Instrument status - /// - public string instStatus; - - /// - /// Chain info - /// - public class Chain - { - /// - /// Chain name - /// - public string chain; - - /// - /// Base chain name - /// - public string baseChain; - - /// - /// Base chain protocol - /// - public string baseChainProtocol; - - /// - /// Is dynamic fee type or not (only applicable to withdrawFeeType = fixed) - /// - public bool isDynamic; - - /// - /// Number of confirmations required for deposit success (trading and withdrawal allowed once reached) - /// - public int numOfConfirmations; - - /// - /// Number of confirmations required for quick success (trading allowed but withdrawal disallowed once reached) - /// - public int numOfFastConfirmations; - - /// - /// Minimal deposit amount in each request - /// - public string minDepositAmt; - - /// - /// Deposit status - /// Possible values [allowed, prohibited] - /// - public string depositStatus; - - /// - /// Minimal withdraw amount in each request - /// - public string minWithdrawAmt; - - /// - /// Maximum withdraw amount in each request - /// - public string maxWithdrawAmt; - - /// - /// Maximum withdraw amount in a day - /// - public string withdrawQuotaPerDay; - - /// - /// Maximum withdraw amount in a year - /// - public string withdrawQuotaPerYear; - - /// - /// Maximum withdraw amount in total - /// - public string withdrawQuotaTotal; - - /// - /// Withdraw amount precision - /// - public int withdrawPrecision; - - /// - /// Type of withdraw fee (only one type can be applied to each currency) - /// Possible values: [fixed, circulated, ratio] - /// - public string withdrawFeeType; - - /// - /// Withdraw fee in each request (only applicable to withdrawFeeType = fixed) - /// - public string transactFeeWithdraw; - - /// - /// Minimal withdraw fee in each request (only applicable to withdrawFeeType = circulated) - /// - public string minTransactFeeWithdraw; - - /// - /// Maximum withdraw fee in each request (only applicable to withdrawFeeType = circulated or ratio) - /// - public string maxTransactFeeWithdraw; - - /// - /// Withdraw fee in each request (only applicable to withdrawFeeType = ratio) - /// - public string transactFeeRateWithdraw; - - /// - /// Withdraw status - /// Possible values: [allowed, prohibited] - /// - public string withdrawStatus; - } - - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetCurrencysResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetCurrencysResponse.cs deleted file mode 100644 index dd45102..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetCurrencysResponse.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Common -{ - /// - /// GetCurrencys response - /// - public class GetCurrencysResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Response body - /// - public string[] data; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetMarketStatusResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetMarketStatusResponse.cs deleted file mode 100644 index 65bc45d..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetMarketStatusResponse.cs +++ /dev/null @@ -1,51 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Common -{ - public class GetMarketStatusResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Status data; - - public class Status - { - /// - /// Market status (1=normal, 2=halted, 3=cancel-only) - /// - public int marketStatus; - - /// - /// Halt start time (unix time in millisecond) , only valid for marketStatus=halted or cancel-only - /// - public long haltStartTime; - - /// - /// Estimated halt end time (unix time in millisecond) , only valid for marketStatus=halted or cancel-only; - /// if this field is not returned during marketStatus=halted or cancel-only, - /// it implicates the halt end time cannot be estimated at this time. - /// - public long haltEndTime; - - /// - /// Halt reason (2=emergency-maintenance, 3=scheduled-maintenance) , only valid for marketStatus=halted or cancel-only - /// - public int haltReason; - - /// - /// Affected symbols, separated by comma. If affect all symbols just respond with value ‘all’. - /// Only valid for marketStatus=halted or cancel-only - /// - public string affectedSmbols; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetSymbolsResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetSymbolsResponse.cs deleted file mode 100644 index e6f2781..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetSymbolsResponse.cs +++ /dev/null @@ -1,167 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Common -{ - /// - /// GetSymbols response - /// - public class GetSymbolsResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Response body - /// - public Symbol[] data; - - /// - /// Trading symbol - /// - public class Symbol - { - /// - /// Base currency in a trading symbol - /// - [JsonProperty(PropertyName = "base-currency")] - public string baseCurrency; - - /// - /// Quote currency in a trading symbol - /// - [JsonProperty(PropertyName = "quote-currency")] - public string quoteCurrency; - - /// - /// Quote currency precision when quote price(decimal places) - /// - [JsonProperty(PropertyName = "price-precision")] - public int pricePrecision; - - /// - /// Base currency precision when quote amount(decimal places) - /// - [JsonProperty(PropertyName = "amount-precision")] - public int amountPrecision; - - /// - /// Trading section - /// Possible values: [main,innovation] - /// - [JsonProperty(PropertyName = "symbol-partition")] - public string symbolPartition; - - /// - /// Trading symbol - /// - [JsonProperty(PropertyName = "symbol")] - public string symbol; - - /// - /// The status of the symbol;Allowable values: [online,offline,suspend]. - /// "online" - Listed, available for trading, - /// "offline" - de-listed, not available for trading, - /// "suspend"-suspended for trading - /// - [JsonProperty(PropertyName = "state")] - public string state; - - /// - /// Precision of value in quote currency (value = price * amount) - /// - [JsonProperty(PropertyName = "value-precision")] - public int valuePrecision; - - /// - /// Minimum order amount of limit order in base currency - /// - [JsonProperty("limit-order-min-order-amt")] - public double limitOrderMinOrderAmt; - - /// - /// Max order amount of limit order in base currency - /// - [JsonProperty("limit-order-max-order-amt")] - public double limitOrderMaxOrderAmt; - - /// - /// Minimum order amount of sell-market order in base currency - /// - [JsonProperty("sell-market-min-order-amt")] - public double sellMarketMinOrderAmt; - - /// - /// Max order amount of sell-market order in base currency - /// - [JsonProperty("sell-market-max-order-amt")] - public double sellMarketMaxOrderAmt; - - /// - /// Max order value of buy-market order in quote currency - /// - [JsonProperty("buy-market-max-order-value")] - public double buyMarketMaxOrderValue; - - /// - /// Minimum order value of limit order and buy-market order in quote currency - /// - [JsonProperty(PropertyName = "min-order-value")] - public double minOrderValue; - - /// - /// Max order value of limit order and buy-market order in USDT - /// - [JsonProperty(PropertyName = "max-order-value")] - public double maxOrderValue; - - /// - /// The applicable leverage ratio - /// - [JsonProperty(PropertyName = "leverage-ratio")] - public double leverageRatio; - - /// - /// Underlying ETP code (only valid for ETP symbols) - /// - public string underlying; - - /// - /// Position charge rate (only valid for ETP symbols) - /// - [JsonProperty("mgmt-fee-rate")] - public double mgmtFeeRate; - - /// - /// Position charging time (in GMT+8, in format HH:MM:SS, only valid for ETP symbols) - /// - [JsonProperty("charge-time")] - public string chargeTime; - - /// - /// Regular position rebalance time (in GMT+8, in format HH:MM:SS, only valid for ETP symbols) - /// - [JsonProperty("rebal-time")] - public string rebalTime; - - /// - /// The threshold which triggers adhoc position rebalance (evaluated by actual leverage ratio, only valid for ETP symbols) - /// - [JsonProperty("rebal-threshold")] - public double rebalThreshold; - - /// - /// Initial NAV (only valid for ETP symbols) - /// - [JsonProperty("init-nav")] - public double initNav; - - /// - /// API trading enabled or not (possible value: enabled, disabled) - /// - [JsonProperty("api-trading")] - public string apiTrading; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetTimestampResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetTimestampResponse.cs deleted file mode 100644 index cd48096..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Common/GetTimestampResponse.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -namespace Huobi.SDK.Core.Spot.RESTful.Response.Common -{ - public class GetTimestampResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Response body - /// - public string data; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/CrossGetLoanInfoResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Margn/CrossGetLoanInfoResponse.cs deleted file mode 100644 index 557076d..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/CrossGetLoanInfoResponse.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Margin -{ - /// - /// GetCrossLoanInfo response - /// - public class CrossGetLoanInfoResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public LoanInfo[] data; - - /// - /// Loan info - /// - public class LoanInfo - { - /// - /// Currency name - /// - public string currency; - - /// - /// Interest rate - /// - [JsonProperty("interest-rate")] - public string interestRate; - - /// - /// Minimal loanable amount - /// - [JsonProperty("min-loan-amt")] - public string minLoadAmt; - - /// - /// Maximum loanable amount - /// - [JsonProperty("max-loan-amt")] - public string maxLoanAmt; - - /// - /// Remaining loanable amount - /// - [JsonProperty("loanable-amt")] - public string loanableAmt; - - /// - /// Actual interest trate post deduction - /// - [JsonProperty("actual-rate")] - public string ActualRate; - } - - } -} - diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/CrossGetLoanOrdersResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Margn/CrossGetLoanOrdersResponse.cs deleted file mode 100644 index 4ffcd84..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/CrossGetLoanOrdersResponse.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Margin -{ - /// - /// GetCrossLoanOrders response - /// - public class CrossGetLoanOrdersResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public LoanOrder[] data; - - /// - /// Loan info - /// - public class LoanOrder - { - /// - /// Order id - /// - public long id; - - /// - /// Account id - /// - [JsonProperty("account-id")] - public long accountId; - - /// - /// User id - /// - [JsonProperty("user-id")] - public long userId; - - /// - /// The currency in the loan - /// - public string currency; - - /// - /// Point deduction amount - /// - [JsonProperty("filled-points")] - public string FilledPoints; - - /// - /// HT deduction amount - /// - [JsonProperty("filled-ht")] - public string FilledHt; - - /// - /// The timestamp in milliseconds when the order was created - /// - [JsonProperty("created-at")] - public long createdAt; - - /// - /// The timestamp in milliseconds when the last accure happened - /// - [JsonProperty("accrued-at")] - public long accruedAt; - - /// - /// The amount of the origin loan - /// - [JsonProperty("loan-amount")] - public string loanAmount; - - /// - /// The amount of the loan left - /// - [JsonProperty("loan-balance")] - public string loanBalance; - - /// - /// The loan interest rate - /// - [JsonProperty("interest-rate")] - public string interestRate; - - /// - /// The accumulated loan interest - /// - [JsonProperty("interest-amount")] - public string interestAmount; - - /// - /// The amount of loan interest left - /// - [JsonProperty("interest-balance")] - public string interestBalance; - - /// - /// Loan state - /// Possible values: [created, accrual, cleared, invalid] - /// - [JsonProperty("state")] - public string state; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/CrossGetMarginAccountResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Margn/CrossGetMarginAccountResponse.cs deleted file mode 100644 index b304f89..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/CrossGetMarginAccountResponse.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections.Generic; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Margin -{ - /// - /// GetCrossMarginAccount response - /// - public class CrossGetMarginAccountResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonConverter(typeof(SingleOrArrayConverter))] - public List data; - - /// - /// Loan info - /// - public class Account - { - /// - /// Account id - /// - public int id; - - /// - /// Account type: cross-margin - /// - public string type; - - /// - /// Loan state - /// Possible values: [created, accrual, cleared, invalid] - /// - public string state; - - /// - /// Sum of all account balance - /// - [JsonProperty("acct-balance-sum")] - public string AcctBalanceSum; - - /// - /// Sum of all debt balance - /// - [JsonProperty("debt-balance-sum")] - public string DebtBalanceSum; - - /// - /// The list of margin accounts and their details - /// - public AccountDetail[] list; - - /// - /// Currency detail - /// - public class AccountDetail - { - /// - /// The currency of this balance - /// - public string currency; - - /// - /// The balance type - /// - public string type; - - /// - /// The balance in the main currency unit - /// - public string balance; - } - - } - } - - class SingleOrArrayConverter : JsonConverter - { - public override bool CanConvert(Type objectType) - { - return (objectType == typeof(List)); - } - - public override object ReadJson(JsonReader reader, Type objecType, object existingValue, - JsonSerializer serializer) - { - JToken token = JToken.Load(reader); - if (token.Type == JTokenType.Array) - { - return token.ToObject>(); - } - return new List { token.ToObject() }; - } - - public override bool CanWrite - { - get { return false; } - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - throw new NotImplementedException(); - } - } - -} \ No newline at end of file diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/GetRepaymentResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Margn/GetRepaymentResponse.cs deleted file mode 100644 index 683ccbc..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/GetRepaymentResponse.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Margin -{ - public class GetRepaymentResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Data[] data; - - public class Data - { - public string repayId; - - public long repayTime; - - public string accountId; - - public string currency; - - public string repaidAmount; - - public TransactId transactIds; - - public class TransactId - { - public long transactId; - - public string repaidPrincipal; - - public string repaidInterest; - - public string paidHT; - - public string paidPoint; - } - } - - public long nextId; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/IsolatedGetLoanInfoResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Margn/IsolatedGetLoanInfoResponse.cs deleted file mode 100644 index db40d1a..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/IsolatedGetLoanInfoResponse.cs +++ /dev/null @@ -1,90 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Margin -{ - /// - /// GetIsolatedLoanInfo response - /// - public class IsolatedGetLoanInfoResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public LoanInfo[] data; - - /// - /// Loan info - /// - public class LoanInfo - { - /// - /// Trading symbol - /// - public string symbol; - - /// - /// Currency list - /// - public Currency[] currencies; - - /// - /// Currency detail - /// - public class Currency - { - /// - /// Currency name - /// - public string currency; - - /// - /// Interest rate - /// - [JsonProperty("interest-rate")] - public string interestRate; - - /// - /// Minimal loanable amount - /// - [JsonProperty("min-loan-amt")] - public string minLoadAmt; - - /// - /// Maximum loanable amount - /// - [JsonProperty("max-loan-amt")] - public string maxLoanAmt; - - /// - /// Remaining loanable amount - /// - [JsonProperty("loanable-amt")] - public string loanableAmt; - - /// - /// Actual interest rate - /// - [JsonProperty("actual-rate")] - public string ActualRate; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/IsolatedGetLoanOrdersResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Margn/IsolatedGetLoanOrdersResponse.cs deleted file mode 100644 index 888a403..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/IsolatedGetLoanOrdersResponse.cs +++ /dev/null @@ -1,115 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Margin -{ - /// - /// GetIsolatedLoanOrders response - /// - public class IsolatedGetLoanOrdersResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public LoanOrder[] data; - - /// - /// Loan info - /// - public class LoanOrder - { - /// - /// Order id - /// - public long id; - - /// - /// Account id - /// - [JsonProperty("account-id")] - public long accountId; - - /// - /// User id - /// - [JsonProperty("user-id")] - public long userId; - - /// - /// The margin loan pair to trade - /// - public string symbol; - - /// - /// The currency in the loan - /// - public string currency; - - /// - /// The timestamp in milliseconds when the order was created - /// - [JsonProperty("created-at")] - public long createdAt; - - /// - /// The timestamp in milliseconds when the last accure happened - /// - [JsonProperty("accrued-at")] - public long accruedAt; - - /// - /// The amount of the origin loan - /// - [JsonProperty("loan-amount")] - public string loanAmount; - - /// - /// The amount of the loan left - /// - [JsonProperty("loan-balance")] - public string loanBalance; - - /// - /// The loan interest rate - /// - [JsonProperty("interest-rate")] - public string interestRate; - - /// - /// The accumulated loan interest - /// - [JsonProperty("interest-amount")] - public string interestAmount; - - /// - /// The amount of loan interest left - /// - [JsonProperty("interest-balance")] - public string interestBalance; - - /// - /// Loan state - /// Possible values: [created, accrual, cleared, invalid] - /// - [JsonProperty("state")] - public string state; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/IsolatedGetMarginAccountResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Margn/IsolatedGetMarginAccountResponse.cs deleted file mode 100644 index 9fdc878..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/IsolatedGetMarginAccountResponse.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Margin -{ - /// - /// GetIsolatedMarginAccount response - /// - public class IsolatedGetMarginAccountResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public Account[] data; - - /// - /// Loan info - /// - public class Account - { - /// - /// Account id - /// - public int id; - - /// - /// Account type: cross-margin - /// - public string type; - - /// - /// The margin loan pair - /// - public string symbol; - - /// - /// Loan state - /// Possible values: [created, accrual, cleared, invalid] - /// - public string state; - - /// - /// The risk rate - /// - [JsonProperty("risk-rate")] - public string riskRate; - - /// - /// The price which triggers closeout - /// - [JsonProperty("fl-price")] - public string flPrice; - - /// - /// The list of margin accounts and their details - /// - public AccountDetail[] list; - - /// - /// Currency detail - /// - public class AccountDetail - { - /// - /// The currency of this balance - /// - public string currency; - - /// - /// The balance type - /// - public string type; - - /// - /// The balance in the main currency unit - /// - public string balance; - } - - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/PostRepaymentResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Margn/PostRepaymentResponse.cs deleted file mode 100644 index b058796..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/PostRepaymentResponse.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Margin -{ - public class PostRepaymentResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Data[] data; - - public class Data - { - public string repayId; - - public long repayTime; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/TransferResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Margn/TransferResponse.cs deleted file mode 100644 index a4f77e5..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Margn/TransferResponse.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Margin -{ - /// - /// Transfer response - /// - public class TransferResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Transfer id - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public long data; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetDepthResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetDepthResponse.cs deleted file mode 100644 index 562a034..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetDepthResponse.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Market -{ - /// - /// GetDepth response - /// - public class GetDepthResponse - { - /// - /// Response status - /// - public string status; - - /// - /// The data stream - /// - public string ch; - - /// - /// The timestamp (millisecond) when API respond - /// - public long ts; - - /// - /// The response body - /// - public tickData tick; - - /// - /// The tick data - /// - public class tickData - { - /// - /// The UNIX timestamp in milliseconds adjusted to Singapore time - /// - public long ts; - - /// - /// The internal data - /// - public float version; - - /// - /// The current all ask in format [price, quote volume] - /// - public float[][] asks; - - /// - /// The current all bit in format [price, quote volume] - /// - public float[][] bids; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetDetailResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetDetailResponse.cs deleted file mode 100644 index fed6c52..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetDetailResponse.cs +++ /dev/null @@ -1,76 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Market -{ - /// - /// GetLast24hCandlestick response - /// - public class GetDetailResponse - { - /// - /// Response status - /// - public string status; - - /// - /// The data stream - /// - public string ch; - - /// - /// The timestamp (millisecond) when API respond - /// - public long ts; - - /// - /// Response body - /// - public Candlestick tick; - - /// - /// Candlestick detail - /// - public class Candlestick - { - /// - /// Unix timestamp in seconds - /// - public long id; - - /// - /// The aggregated trading volume in USDT of last 24h - /// - public float amount; - - /// - /// The number of completed trades of last 24h - /// - public int count; - - /// - /// The opening price of last 24h - /// - public float open; - - /// - /// The closing price of last 24h - /// - public float close; - - /// - /// The low price of last 24h - /// - public float low; - - /// - /// The high price of last 24h - /// - public float high; - - /// - /// The trading volume in base currency of last 24h - /// - public float vol; - - public long version; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetHisTradesResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetHisTradesResponse.cs deleted file mode 100644 index be8c55d..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetHisTradesResponse.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Market -{ - /// - /// GetDepth response - /// - public class GetHisTradesResponse - { - /// - /// Response status - /// - public string status; - - /// - /// The data stream - /// - public string ch; - - /// - /// The timestamp (millisecond) when API respond - /// - public long ts; - - /// - /// The response body - /// - public Tick[] data; - - /// - /// The tick data - /// - public class Tick - { - public long id; - - /// - /// The UNIX timestamp in milliseconds adjusted to Singapore time - /// - public long ts; - - /// - /// The trade data - /// - public Trade[] data; - - /// - /// The trade data - /// - public class Trade - { - /// - /// The unique trade id (NEW) - /// - [JsonProperty(PropertyName = "trade-id")] - public long tradeId; - - /// - /// The trading volume in base currency - /// - public float amount; - - /// - /// The trading price in quote currency - /// - public float price; - - /// - /// The UNIX timestamp in milliseconds adjusted to Singapore time - /// - public long ts; - - /// - /// The direction of the taker trade. - /// Possible values: [buy, sell] - /// - public string direction; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetKlineResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetKlineResponse.cs deleted file mode 100644 index 5e78b44..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetKlineResponse.cs +++ /dev/null @@ -1,74 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Market -{ - /// - /// GetCandlestick response - /// - public class GetKlineResponse - { - /// - /// Response status - /// - public string status; - - /// - /// The data stream - /// - public string ch; - - /// - /// The timestamp (millisecond) when API respond - /// - public long ts; - - /// - /// Response body - /// - public Candlestick[] data; - - /// - /// Candlestick detail - /// - public class Candlestick - { - /// - /// Unix timestamp in seconds - /// - public int id; - - /// - /// The aggregated trading volume in USDT - /// - public float amount; - - /// - /// The number of completed trades - /// - public int count; - - /// - /// The opening price - /// - public float open; - - /// - /// The closing price - /// - public float close; - - /// - /// The low price - /// - public float low; - - /// - /// The high price - /// - public float high; - - /// - /// The trading volume in base currency - /// - public float vol; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetMergedResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetMergedResponse.cs deleted file mode 100644 index ad572d7..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetMergedResponse.cs +++ /dev/null @@ -1,89 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Market -{ - /// - /// GetCandlestick response - /// - public class GetMergedResponse - { - /// - /// Response status - /// - public string status; - - /// - /// The data stream - /// - public string ch; - - /// - /// The timestamp (millisecond) when API respond - /// - public long ts; - - /// - /// The response body - /// - public Tick tick; - - /// - /// The tick data - /// - public class Tick - { - /// - /// Unix timestamp in seconds - /// - public long id; - - /// - /// The aggregated trading volume in USDT - /// - public float amount; - - /// - /// The number of completed trades - /// - public int count; - - /// - /// The opening price - /// - public float open; - - /// - /// The closing price - /// - public float close; - - /// - /// The low price - /// - public float low; - - /// - /// The high price - /// - public float high; - - /// - /// The trading volume in base currency - /// - public float vol; - - /// - /// The internal data - /// - public long version; - - /// - /// The current best ask in format [price, quote volume] - /// - public float[] ask; - - /// - /// The current best bit in format [price, quote volume] - /// - public float[] bid; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetTickersResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetTickersResponse.cs deleted file mode 100644 index b4ed2a0..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetTickersResponse.cs +++ /dev/null @@ -1,77 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Market -{ - /// - /// GetLast24hCandlestick response - /// - public class GetTickersResponse - { - /// - /// Response status - /// - public string status; - - /// - /// The timestamp (millisecond) when API respond - /// - public long ts; - - /// - /// Response body - /// - public Candlestick[] data; - - /// - /// Candlestick detail - /// - public class Candlestick - { - /// - /// The trading symbol - /// - public string symbol; - - /// - /// The aggregated trading volume in USDT of last 24h - /// - public float amount; - - /// - /// The number of completed trades of last 24h - /// - public int count; - - /// - /// The opening price of last 24h - /// - public float open; - - /// - /// The closing price of last 24h - /// - public float close; - - /// - /// The low price of last 24h - /// - public float low; - - /// - /// The high price of last 24h - /// - public float high; - - /// - /// The trading volume in base currency of last 24h - /// - public float vol; - - public float bid; - - public float bidSize; - - public float ask; - - public float askSize; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetTradeResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetTradeResponse.cs deleted file mode 100644 index b1b2f41..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Market/GetTradeResponse.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Market -{ - /// - /// GetDepth response - /// - public class GetTradeResponse - { - /// - /// Response status - /// - public string status; - - /// - /// The data stream - /// - public string ch; - - /// - /// The timestamp (millisecond) when API respond - /// - public long ts; - - /// - /// The response body - /// - public Tick tick; - - /// - /// The tick data - /// - public class Tick - { - public long id; - - /// - /// The UNIX timestamp in milliseconds adjusted to Singapore time - /// - public long ts; - - /// - /// The trade data - /// - public Trade[] data; - - /// - /// The trade data - /// - public class Trade - { - /// - /// The unique trade id (NEW) - /// - [JsonProperty(PropertyName = "trade-id")] - public long tradeId; - - /// - /// The trading volume in base currency - /// - public float amount; - - /// - /// The trading price in quote currency - /// - public float price; - - /// - /// The UNIX timestamp in milliseconds adjusted to Singapore time - /// - public long ts; - - /// - /// The direction of the taker trade. - /// Possible values: [buy, sell] - /// - public string direction; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrderByClientResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrderByClientResponse.cs deleted file mode 100644 index 3299305..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrderByClientResponse.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// CancelOrderByClientResponse response - /// - public class CancelOrderByClientResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Cancellation status code - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public int data; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrderByIdResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrderByIdResponse.cs deleted file mode 100644 index 60a9abd..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrderByIdResponse.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// CancelOrderById response - /// - public class CancelOrderByIdResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Order id - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public string data; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrdersByCriteriaResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrdersByCriteriaResponse.cs deleted file mode 100644 index 56d1f8d..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrdersByCriteriaResponse.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// CancelOrdersByCriteria response - /// - public class CancelOrdersByCriteriaResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public Body data; - - /// - /// Response body - /// - public class Body - { - /// - /// The number of cancel request sent successfully - /// - [JsonProperty("success-count")] - public int successCount; - - /// - /// The number of cancel request failed - /// - [JsonProperty("failed-count")] - public int failedCount; - - /// - /// The next order id that can be cancelled - /// - [JsonProperty("next-id")] - public int nextId; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrdersByIdsResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrdersByIdsResponse.cs deleted file mode 100644 index 1cf776c..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/CancelOrdersByIdsResponse.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// CancelOrdersByIds response - /// - public class CancelOrdersByIdsResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public Body data; - - /// - /// Response body - /// - public class Body - { - /// - /// Cancelled order list - /// - public string[] success; - - /// - /// Failed order list - /// - public FailedOrder[] failed; - - public class FailedOrder - { - /// - /// Order id - /// - [JsonProperty("order-id", NullValueHandling = NullValueHandling.Ignore)] - public string orderId; - - /// - /// Client order id - /// - [JsonProperty("client-order-id", NullValueHandling = NullValueHandling.Ignore)] - public string clientOrderId; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetFeeResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetFeeResponse.cs deleted file mode 100644 index c431802..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetFeeResponse.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// GetFee response - /// - [Obsolete] - public class GetFeeResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public Fee[] data; - - /// - /// Match result of an order - /// - public class Fee - { - /// - /// Trading symbol - /// - public string symbol; - - /// - /// Maker fee rate - /// - [JsonProperty("maker-fee")] - public string makerFee; - - /// - /// Taker fee rate - /// - [JsonProperty("taker-fee")] - public string takerFee; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetHistoryOrdersResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetHistoryOrdersResponse.cs deleted file mode 100644 index 227c4aa..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetHistoryOrdersResponse.cs +++ /dev/null @@ -1,157 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// GetHistoryOrders and GetLast48hOrders response - /// - public class GetHistoryOrdersResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public HistoryOrder[] data; - - /// - /// History order - /// - public class HistoryOrder - { - /// - /// Order id - /// - public long id; - - /// - /// Client order id (if specified) - /// - [JsonProperty("client-order-id")] - public string ClientOrderId; - - /// - /// The account id - /// - [JsonProperty("account-id")] - public int accountId; - - /// - /// User id - /// - [JsonProperty("user-id")] - public int userId; - - /// - /// The amount of base currency in this order - /// - public string amount; - - /// - /// Trading symbol - /// - public string symbol; - - /// - /// The limit price of limit order - /// - public string price; - - /// - /// The timestamp in milliseconds when the order was created - /// - [JsonProperty("created-at")] - public long createdAt; - - /// - /// The timestamp in milliseconds when the order was canceled, or 0 if not canceled - /// - [JsonProperty("canceled-at")] - public long canceledAt; - - /// - /// The timestamp in milliseconds when the order was finished, or 0 if not finished - /// - [JsonProperty("finished-at")] - public long finishedAt; - - /// - /// The order type - /// Possible values: [buy-market, sell-market, buy-limit, sell-limit, - /// buy-ioc, sell-ioc, buy-limit-maker, sell-limit-maker, - /// buy-stop-limit, sell-stop-limit, buy-limit-fok, sell-limit-fok, - /// buy-stop-limit-fok, sell-stop-limit-fok] - /// - public string type; - - /// - /// The amount which has been filled - /// - [JsonProperty("filled-amount")] - public string filledAmount; - - /// - /// The filled total in quote currency - /// - [JsonProperty("filled-cash-amount")] - public string filledCashAmount; - - /// - /// Transaction fee paid so far - /// - [JsonProperty("filled-fees")] - public string filledFees; - - /// - /// The source where the order was triggered - /// Possible values: [sys, web, api, app] - /// - public string source; - - /// - /// The orders state - /// Possible values: [submitted, partial-filled, cancelling, created] - /// - public string state; - - /// - /// Internal data - /// - public string exchange; - - /// - /// Internal data - /// - public string batch; - - /// - /// Trigger price of stop limit order - /// - [JsonProperty("stop-price")] - public string stopPrice; - - /// - /// Operation charactor of stop price - /// Possible values: [gte, lte] - /// - /// - public string @operator; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetLastTradeResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetLastTradeResponse.cs deleted file mode 100644 index 4c5a21d..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetLastTradeResponse.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// GetDepth response - /// - public class GetLastTradeResponse - { - /// - /// Response status - /// - public string status; - - /// - /// The data stream - /// - public string ch; - - /// - /// The timestamp (millisecond) when API respond - /// - public long ts; - - /// - /// The response body - /// - public Tick tick; - - /// - /// The tick data - /// - public class Tick - { - public long id; - - /// - /// The UNIX timestamp in milliseconds adjusted to Singapore time - /// - public long ts; - - /// - /// The trade data - /// - public Trade[] data; - - /// - /// The trade data - /// - public class Trade - { - /// - /// The unique trade id (NEW) - /// - [JsonProperty(PropertyName = "trade-id")] - public long tradeId; - - /// - /// The trading volume in base currency - /// - public float amount; - - /// - /// The trading price in quote currency - /// - public float price; - - /// - /// The UNIX timestamp in milliseconds adjusted to Singapore time - /// - public long ts; - - /// - /// The direction of the taker trade. - /// Possible values: [buy, sell] - /// - public string direction; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetLastTradesResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetLastTradesResponse.cs deleted file mode 100644 index c883578..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetLastTradesResponse.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// GetDepth response - /// - public class GetLastTradesResponse - { - /// - /// Response status - /// - public string status; - - /// - /// The data stream - /// - public string ch; - - /// - /// The timestamp (millisecond) when API respond - /// - public long ts; - - /// - /// The response body - /// - public Tick[] data; - - /// - /// The tick data - /// - public class Tick - { - public long id; - - /// - /// The UNIX timestamp in milliseconds adjusted to Singapore time - /// - public long ts; - - /// - /// The trade data - /// - public Trade[] data; - - /// - /// The trade data - /// - public class Trade - { - /// - /// The unique trade id (NEW) - /// - [JsonProperty(PropertyName = "trade-id")] - public long tradeId; - - /// - /// The trading volume in base currency - /// - public float amount; - - /// - /// The trading price in quote currency - /// - public float price; - - /// - /// The UNIX timestamp in milliseconds adjusted to Singapore time - /// - public long ts; - - /// - /// The direction of the taker trade. - /// Possible values: [buy, sell] - /// - public string direction; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetMatchResultsResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetMatchResultsResponse.cs deleted file mode 100644 index 763a920..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetMatchResultsResponse.cs +++ /dev/null @@ -1,137 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// GetMatchResults response - /// - public class GetMatchResultsResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public MatchResult[] data; - - /// - /// Match result of an order - /// - public class MatchResult - { - /// - /// Internal id - /// - public long id; - - /// - /// Order id of this order - /// - [JsonProperty("order-id")] - public long orderId; - - /// - /// Match id of this match - /// - [JsonProperty("match-id")] - public long matchId; - - /// - /// Unique trade id (NEW) - /// - [JsonProperty("trade-id")] - public long tradeId; - - /// - /// Trading symbol - /// - public string symbol; - - /// - /// The limit price of limit order - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public string price; - - /// - /// The timestamp in milliseconds when the match and fill is done - /// - [JsonProperty("created-at")] - public long createdAt; - - /// - /// The order type - /// Possible values: [buy-market, sell-market, buy-limit, sell-limit, - /// buy-ioc, sell-ioc, buy-limit-maker, sell-limit-maker, - /// buy-stop-limit, sell-stop-limit, buy-limit-fok, sell-limit-fok, - /// buy-stop-limit-fok, sell-stop-limit-fok] - /// - public string type; - - /// - /// The amount which has been filled - /// - [JsonProperty("filled-amount")] - public string filledAmount; - - /// - /// Transaction fee paid so far - /// - [JsonProperty("filled-fees")] - public string filledFees; - - /// - /// Currency of transaction fee or transaction fee rebate - /// - [JsonProperty("fee-currency")] - public string feeCurrency; - - /// - /// The source where the order was triggered - /// Possible values: [sys, web, api, app] - /// - public string source; - - /// - /// The role in the transaction - /// Possible values: [taker, maker] - /// - public string role; - - /// - /// Deduction amount (unit: in ht or hbpoint) - /// - [JsonProperty("filled-points")] - public string filledPoints; - - /// - /// Deduction type. if blank, the transaction fee is based on original currency; if showing value as "ht", the transaction fee is deducted by HT; if showing value as "hbpoint", the transaction fee is deducted by HB point. - /// - [JsonProperty("fee-deduct-currency")] - public string feeDeductCurrency; - - - /// - /// Fee deduction status,In deduction:ongoing,Deduction completed:done - /// - [JsonProperty("fee-deduct-state")] - public string feeDeductState; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetOpenOrdersResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetOpenOrdersResponse.cs deleted file mode 100644 index b2ef22f..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetOpenOrdersResponse.cs +++ /dev/null @@ -1,129 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// GetOpenOrders response - /// - public class GetOpenOrdersResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public OpenOrder[] data; - - /// - /// Order - /// - public class OpenOrder - { - /// - /// Order id - /// - public long id; - - /// - /// Client order id (if specified) - /// - [JsonProperty("client-order-id")] - public string ClientOrderId; - - /// - /// The account id - /// - [JsonProperty("account-id")] - public int accountId; - - /// - /// The order size - /// - public string amount; - - /// - /// Trading symbol - /// - public string symbol; - - /// - /// The limit price of limit order - /// - public string price; - - /// - /// The timestamp in milliseconds when the order was created - /// - [JsonProperty("created-at")] - public long createdAt; - - /// - /// The order type - /// Possible values: [buy-market, sell-market, buy-limit, sell-limit, - /// buy-ioc, sell-ioc, buy-limit-maker, sell-limit-maker, - /// buy-stop-limit, sell-stop-limit, buy-limit-fok, sell-limit-fok, - /// buy-stop-limit-fok, sell-stop-limit-fok] - /// - public string type; - - /// - /// The amount which has been filled - /// - [JsonProperty("filled-amount")] - public string filledAmount; - - /// - /// The filled total in quote currency - /// - [JsonProperty("filled-cash-amount")] - public string filledCashAmount; - - /// - /// Transaction fee paid so far - /// - [JsonProperty("filled-fees")] - public string filledFees; - - /// - /// The source where the order was triggered - /// Possible values: [sys, web, api, app] - /// - public string source; - - /// - /// The orders state - /// Possible values: [submitted, partial-filled, cancelling, created] - /// - public string state; - - /// - /// Trigger price of stop limit order - /// - [JsonProperty("stop-price")] - public string stopPrice; - - /// - /// Operation charactor of stop price - /// Possible values: [gte, lte] - /// - /// - public string @operator; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetOrderResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetOrderResponse.cs deleted file mode 100644 index d9fc8f6..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetOrderResponse.cs +++ /dev/null @@ -1,116 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// The response for GetOrderById and GetOrderByClient - /// - public class GetOrderResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public Order data; - - /// - /// Order - /// - public class Order - { - /// - /// The account id - /// - [JsonProperty("account-id")] - public int accountId; - - /// - /// The order size - /// - public string amount; - - /// - /// Order id - /// - public long id; - - /// - /// Client order id (if specified) - /// - [JsonProperty("client-order-id")] - public string ClientOrderId; - - /// - /// Trading symbol - /// - public string symbol; - - /// - /// The limit price of limit order - /// - public string price; - - /// - /// The timestamp in milliseconds when the order was created - /// - [JsonProperty("created-at")] - public long createdAt; - - /// - /// The order type - /// Possible values: [buy-market, sell-market, buy-limit, sell-limit, - /// buy-ioc, sell-ioc, buy-limit-maker, sell-limit-maker, - /// buy-stop-limit, sell-stop-limit, buy-limit-fok, sell-limit-fok, - /// buy-stop-limit-fok, sell-stop-limit-fok] - /// - public string type; - - /// - /// The amount which has been filled - /// - [JsonProperty("field-amount")] - public string filledAmount; - - /// - /// The filled total in quote currency - /// - [JsonProperty("field-cash-amount")] - public string filledCashAmount; - - /// - /// Transaction fee paid so far - /// - [JsonProperty("field-fees")] - public string filledFees; - - /// - /// The source where the order was triggered - /// Possible values: [sys, web, api, app] - /// - public string source; - - /// - /// The orders state - /// Possible values: [submitted, partial-filled, cancelling, created] - /// - public string state; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetTransactFeeRate.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetTransactFeeRate.cs deleted file mode 100644 index 2eb5ccc..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/GetTransactFeeRate.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - public class GetTransactFeeRateResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Fee[] data; - - public class Fee - { - /// - /// Trading symbol - /// - public string symbol; - - /// - /// Basic fee rate - passive side - /// - public string makerFeeRate; - - /// - /// Basic fee rate - aggressive side - /// - public string takerFeeRate; - - /// - /// Deducted fee rate – passive side. - /// If deduction is inapplicable or disabled, return basic fee rate - /// - public string actualMakerRate; - - /// - /// Deducted fee rate – aggressive side. - /// If deduction is inapplicable or disabled, return basic fee rate. - /// - public string actualTakerRate; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/PlaceOrderResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/PlaceOrderResponse.cs deleted file mode 100644 index e401332..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/PlaceOrderResponse.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// PlaceOrder response - /// - public class PlaceOrderResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Order id - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public string data; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Order/PlaceOrdersResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Order/PlaceOrdersResponse.cs deleted file mode 100644 index ad96a3c..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Order/PlaceOrdersResponse.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Order -{ - /// - /// PlaceMultipleOrders response - /// - public class PlaceOrdersResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public PlaceOrderResult[] data; - - /// - /// place order result - /// - public class PlaceOrderResult - { - /// - /// The order id - /// - [JsonProperty("order-id")] - public long orderId; - - /// - /// The client order id (if any) - /// - [JsonProperty("client-order-id", NullValueHandling = NullValueHandling.Ignore)] - public string clientOrderId; - - /// - /// Error code for rejected order - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message for rejected order - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Stablecoin/ExchangeStableCoinResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Stablecoin/ExchangeStableCoinResponse.cs deleted file mode 100644 index abc8355..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Stablecoin/ExchangeStableCoinResponse.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.StableCoin -{ - /// - /// ExchangeStableCoin response - /// - public class ExchangeStableCoinResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public Data data; - - public class Data - { - [JsonProperty("transact-id")] - public long transactId; - - public string currency; - - public string amount; - - public string type; - - [JsonProperty("exchange-amount")] - public string exchangeAmount; - - [JsonProperty("exchange-fee")] - public string exchangeFee; - - public long time; - } - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Stablecoin/GetStableCoinResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Stablecoin/GetStableCoinResponse.cs deleted file mode 100644 index 9a9c798..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Stablecoin/GetStableCoinResponse.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.StableCoin -{ - public class GetStableCoinResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Response body - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public Data data; - - public class Data - { - /// - /// Stable coin name (PAX/USDC/TUSD) - /// - public string currency; - - /// - /// Amount of stable coin to exchange - /// - public string amount; - - /// - /// Type of the exchange (buy/sell) - /// - public string type; - - /// - /// Amount of HUSD to exchange in or out - /// - public string exchangeAmount; - - /// - /// Exchange fee (in HUSD) - /// - public string exchangeFee; - - /// - /// Stable currency quoteID - /// - public string quoteId; - - /// - /// Term of validity - /// - public string expiration; - } - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/CreateSubUserResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/CreateSubUserResponse.cs deleted file mode 100644 index cbfd99d..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/CreateSubUserResponse.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.SubUser -{ - /// - /// Create SubUser Response - /// - public class CreateSubUserResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Creation[] data; - - public class Creation - { - public string userName; - - public string note; - - public long uid; - - public string errCode; - - public string errMessage; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetDepositAddressResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetDepositAddressResponse.cs deleted file mode 100644 index 893b725..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetDepositAddressResponse.cs +++ /dev/null @@ -1,49 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.SubUser -{ - /// - /// GetDepositAddress response - /// - public class GetDepositAddressResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Address[] data; - - /// - /// Deposit address - /// - public class Address - { - /// - /// Crypto currency - /// - public string currency; - - /// - /// Deposit address - /// - public string address; - - /// - /// Deposit address tag - /// - public string addressTag; - - /// - /// Blockchain name - /// - public string chain; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetSubUserAccountBalanceResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetSubUserAccountBalanceResponse.cs deleted file mode 100644 index dc7e36d..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetSubUserAccountBalanceResponse.cs +++ /dev/null @@ -1,65 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.SubUser -{ - /// - /// GetSubUserAccountBalance response - /// - public class GetSubUserAccountBalanceResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Response body - /// - public Account[] data; - - /// - /// Sub account info - /// - public class Account - { - /// - /// Unique account id - /// - public int id; - - /// - /// The type of this account - /// Possible values: [spot, margin, otc, point, super-margin] - /// - public string type; - - /// - /// Account state - /// Possible values: [working, lock] - /// - public string state; - - /// - /// The balance details of each currency - /// - public Balance[] list; - - public class Balance - { - /// - /// The currency of this balance - /// - public string currency; - - /// - /// The balance type - /// Possible values: [trade, frozen] - /// - public string type; - - /// - /// The balance in the main currency unit - /// - public string balance; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetSubUserAccountBalancesResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetSubUserAccountBalancesResponse.cs deleted file mode 100644 index 098182f..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetSubUserAccountBalancesResponse.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.SubUser -{ - /// - /// GetSubUserAccountBalance response - /// - public class GetSubUserAccountBalancesResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Response body - /// - public Balance[] data; - - /// - /// Account balance - /// - public class Balance - { - /// - /// The currency of this balance - /// - public string currency; - - /// - /// The account type - /// Possible values: [spot, margin, point, super-margin] - /// - public string type; - - /// - /// The total balance in the main currency unit including all balance and frozen banlance - /// - public string balance; - - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetSubUserDepositHistoryResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetSubUserDepositHistoryResponse.cs deleted file mode 100644 index 7bf98a4..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetSubUserDepositHistoryResponse.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -namespace Huobi.SDK.Core.Spot.RESTful.Response.SubUser -{ - public class GetSubUserDepositHistoryResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public DepositHistory[] data; - - /// - /// First record in next page (only valid if exceeded page size) - /// - public long nextId; - - public class DepositHistory - { - /// - /// Deposit id - /// - public long id; - - /// - /// Cryptocurrency - /// - public string currency; - - /// - /// The on-chain transaction hash - /// - public string txHash; - - /// - /// Block chain name - /// - public string chain; - - /// - /// The number of crypto asset transferred - /// - public decimal amount; - - /// - /// The deposit source address - /// - public string address; - - /// - /// The deposit source address tag - /// - public string addressTag; - - /// - /// The state of this transfer - /// Possible values: unknown, confirming, confirmed, safe, orphan - /// - public string state; - - /// - /// The timestamp in milliseconds for the transfer creation - /// - public long createTime; - - /// - /// The timestamp in milliseconds for the transfer's latest update - /// - public long updateTime; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetUIDResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetUIDResponse.cs deleted file mode 100644 index 894d0a3..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/GetUIDResponse.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.SubUser -{ - /// - /// Create SubUser Response - /// - public class GetUIDResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public long? data; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/LockUnLockSubUserResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/LockUnLockSubUserResponse.cs deleted file mode 100644 index 1bbe24f..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/LockUnLockSubUserResponse.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.SubUser -{ - /// - /// LockSubUser and UnLockSubUser Response - /// - public class LockUnLockSubUserResponse - { - /// - /// Status code - /// - public int code; - - public State data; - - public class State - { - /// - /// sub user id - /// - public int subUid; - - /// - /// sub user state - /// - public string userState; - } - } -} \ No newline at end of file diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/TransferResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/TransferResponse.cs deleted file mode 100644 index daf0cf1..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/SubUser/TransferResponse.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.SubUser -{ - /// - /// Transfer response - /// - public class TransferResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Transfer id - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public long data; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/CancelWithdrawCurrencyResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/CancelWithdrawCurrencyResponse.cs deleted file mode 100644 index 11bc5c7..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/CancelWithdrawCurrencyResponse.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Wallet -{ - /// - /// WithdrawCurrency response - /// - public class WithdrawCurrencyResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Transfer id - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public long data; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/GetDepositAddressResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/GetDepositAddressResponse.cs deleted file mode 100644 index 7c0b36a..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/GetDepositAddressResponse.cs +++ /dev/null @@ -1,49 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Wallet -{ - /// - /// GetDepositAddress response - /// - public class GetDepositAddressResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Address[] data; - - /// - /// Deposit address - /// - public class Address - { - /// - /// Crypto currency - /// - public string currency; - - /// - /// Deposit address - /// - public string address; - - /// - /// Deposit address tag - /// - public string addressTag; - - /// - /// Blockchain name - /// - public string chain; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/GetDepositWithdrawHistoryResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/GetDepositWithdrawHistoryResponse.cs deleted file mode 100644 index 81562b3..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/GetDepositWithdrawHistoryResponse.cs +++ /dev/null @@ -1,105 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Wallet -{ - /// - /// GetDepositWithdrawHistory response - /// - public class GetDepositWithdrawHistoryResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Response body - /// - public History[] data; - - /// - /// Deposit and withdraw history - /// - public class History - { - /// - /// Transfer id - /// - public int id; - - /// - /// Transfer type - /// Possible values: [deposit, withdraw] - /// - public string type; - - /// - /// The crypto currency - /// - public string currency; - - /// - /// The on-chain transaction hash - /// - [JsonProperty("tx-hash")] - public string txHash; - - /// - /// Blockchain name - /// - public string chain; - - /// - /// The number of crypto asset transfered in its minimum unit - /// - public double amount; - - /// - /// The deposit or withdraw source address - /// - public string address; - - /// - /// The user defined address tag - /// - [JsonProperty("address-tag")] - public string addressTag; - - /// - /// Withdraw fee - /// - public float fee; - - /// - /// The state of this transfer - /// Possible values: [verifying, failed, submitted, reexamine, canceled, pass, reject, - /// pre-transfer, wallet-transfer, wallet-reject, confirmed, confirm-error, repealed] - /// - public string state; - - /// - /// Error code for withdrawal failure, only returned when the type is "withdraw" and - /// the state is "reject", "wallet-reject" and "failed". - /// - [JsonProperty("error-code")] - public string errorCode; - - /// - /// Error description of withdrawal failure, only returned when the type is "withdraw" and - /// the state is "reject", "wallet-reject" and "failed". - /// - [JsonProperty("error-msg")] - public string errorMessage; - - /// - /// The timestamp in milliseconds for the transfer creation - /// - public long createdAt; - - /// - /// The timestamp in milliseconds for the transfer latest update - /// - public long updatedAt; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/GetWithdrawQuotaResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/GetWithdrawQuotaResponse.cs deleted file mode 100644 index ee29189..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/GetWithdrawQuotaResponse.cs +++ /dev/null @@ -1,77 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Wallet -{ - public class GetWithdrawQuotaResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Response body - /// - public Data data; - - /// - /// Quota - /// - public class Data - { - /// - /// Crypto currency - /// - public string currency; - - /// - /// Chains - /// - public Chain[] chains; - - /// - /// Chain info - /// - public class Chain - { - /// - /// Blockchain name - /// - public string chain; - - /// - /// Maximum withdraw amount in each request - /// - public string maxWithdrawAmt; - - /// - /// Remaining withdraw quota in the day - /// - public string remainWithdrawQuotaPerDay; - - /// - /// Maximum withdraw amount in a day - /// - public string withdrawQuotaPerDay; - - /// - /// Maximum withdraw amount in a year - /// - public string withdrawQuotaPerYear; - - /// - /// Remaining withdraw quota in the year - /// - public string remainWithdrawQuotaPerYear; - - /// - /// Maximum withdraw amount in total - /// - public string withdrawQuotaTotal; - - /// - /// Remaining withdraw quota in total - /// - public string remainWithdrawQuotaTotal; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/WithdrawAddressResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/WithdrawAddressResponse.cs deleted file mode 100644 index 70332aa..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/WithdrawAddressResponse.cs +++ /dev/null @@ -1,51 +0,0 @@ -namespace Huobi.SDK.Core.Spot.RESTful.Response.Wallet -{ - public class GetWithdrawAddressResponse - { - /// - /// Status code - /// - public int code; - - /// - /// Error message (if any) - /// - public string message; - - /// - /// Response body - /// - public Address[] data; - - /// - /// Deposit address - /// - public class Address - { - /// - /// Crypto currency - /// - public string currency; - - /// - /// Blockchain name - /// - public string chain; - - /// - /// Deposit address - /// - public string address; - - /// - /// Deposit address tag - /// - public string addressTag; - - /// - /// The address note - /// - public string note; - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/WithdrawCurrencyResponse.cs b/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/WithdrawCurrencyResponse.cs deleted file mode 100644 index 4ba7e8d..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/Response/Wallet/WithdrawCurrencyResponse.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.RESTful.Response.Wallet -{ - /// - /// CancelWithdrawCurrency response - /// - public class CancelWithdrawCurrencyResponse - { - /// - /// Response status - /// - public string status; - - /// - /// Transfer id - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public int data; - - /// - /// Error code - /// - [JsonProperty("err-code", NullValueHandling = NullValueHandling.Ignore)] - public string errorCode; - - /// - /// Error message - /// - [JsonProperty("err-msg", NullValueHandling = NullValueHandling.Ignore)] - public string errorMessage; - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/StableCoinClient.cs b/Huobi.SDK.Core/Spot/RESTful/StableCoinClient.cs deleted file mode 100644 index c7021a3..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/StableCoinClient.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Threading.Tasks; -using Huobi.SDK.Core.RequestBuilder; -using Huobi.SDK.Core.Spot.RESTful.Response.StableCoin; - -namespace Huobi.SDK.Core.Spot.RESTful -{ - /// - /// Responsible to operate stable coin - /// - public class StableCointClient - { - private const string GET_METHOD = "GET"; - private const string POST_METHOD = "POST"; - - private readonly PrivateUrlBuilder _urlBuilder; - - /// - /// Constructor - /// - /// Access Key - /// Secret Key - /// the host that the client connects to - public StableCointClient(string accessKey, string secretKey, string host = Host.SPOT) - { - _urlBuilder = new PrivateUrlBuilder(accessKey, secretKey, host); - } - - /// - /// Get stable coin quote - /// - /// Stable coin name (USDT/PAX/USDC/TUSD) - /// Amount of stable coin to exchange (the value must be an intger) - /// Type of the exchange (buy/sell) - /// GetStableCoinResponse - public async Task GetStableCoinAsync(string currency, string amount, string type) - { - var request = new GetRequest() - .AddParam("currency", currency) - .AddParam("amount", amount) - .AddParam("type", type); - string url = _urlBuilder.Build(GET_METHOD, "/v1/stable-coin/quote", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Exchange stable coin - /// - /// Stable currency quoteID - /// ExchangeStableCoinResponse - public async Task ExchangeStableCoinAsync(string quoteId) - { - string url = _urlBuilder.Build(POST_METHOD, $"/v1/stable-coin/exchange"); - - string body = $"{{ \"quote-id\":\"{quoteId}\" }}"; - - return await HttpRequest.PostAsync(url, body); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/SubUserClient.cs b/Huobi.SDK.Core/Spot/RESTful/SubUserClient.cs deleted file mode 100644 index ef63630..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/SubUserClient.cs +++ /dev/null @@ -1,205 +0,0 @@ -using System.Threading.Tasks; -using Huobi.SDK.Core.RequestBuilder; -using Huobi.SDK.Core.Spot.RESTful.Response.SubUser; -using Huobi.SDK.Core.Spot.RESTful.Request.SubUser; - -namespace Huobi.SDK.Core.Spot.RESTful -{ - /// - /// Responsible to operate sub user - /// - public class SubUserClient - { - private const string GET_METHOD = "GET"; - private const string POST_METHOD = "POST"; - - private readonly PrivateUrlBuilder _urlBuilder; - - /// - /// Constructor - /// - /// Access Key - /// Secret Key - /// the host that the client connects to - public SubUserClient(string accessKey, string secretKey, string host = Host.SPOT) - { - _urlBuilder = new PrivateUrlBuilder(accessKey, secretKey, host); - } - - - /// - /// The user get the UID - /// - /// - public async Task GetUIDAsync() - { - string url = _urlBuilder.Build(GET_METHOD, "/v2/user/uid"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// The parent user creates sub users - /// - /// - /// - public async Task CreateSubUserAsync(CreateSubUserRequest request) - { - string url = _urlBuilder.Build(POST_METHOD, "/v2/sub-user/creation"); - - return await HttpRequest.PostAsync(url, request.ToJson()); - } - - /// - /// Lock a specific user - /// - /// sub user id - /// LockUnLockSubUserResponse - public async Task LockSubUserAsync(string subUserId) - { - return await LockUnlockSubUserAsync(subUserId, "lock"); - } - - /// - /// Unlock a specific user - /// - /// sub user id - /// LockUnLockSubUserResponse - public async Task UnlockSubUserAsync(string subUserId) - { - return await LockUnlockSubUserAsync(subUserId, "unlock"); - } - - /// - /// Lock or unlock a specific user - /// - /// sub user id - /// lock or unlock action - /// LockUnLockSubUserResponse - private async Task LockUnlockSubUserAsync(string subUserId, string action) - { - string url = _urlBuilder.Build(POST_METHOD, "/v2/sub-user/management"); - - string content = $"{{ \"subUid\": \"{subUserId}\", \"action\":\"{action}\" }}"; - - return await HttpRequest.PostAsync(url, content); - } - - /// - /// Transfer currency from sub to parent account - /// - /// The target sub account uid to transfer from - /// The crypto currency to transfer - /// The amount of asset to transfer - /// - public async Task TransferCurrencyFromSubToMasterAsync(string subUserId, string currency, decimal amount) - { - return await TransferMasterAndSubAsync(subUserId, currency, amount, "master-transfer-in"); - } - - /// - /// Transfer currency from parent to sub account - /// - /// The target sub account uid to transfer to - /// The crypto currency to transfer - /// The amount of asset to transfer - /// - public async Task TransferCurrencyFromMasterToSubAsync(string subUserId, string currency, decimal amount) - { - return await TransferMasterAndSubAsync(subUserId, currency, amount, "master-transfer-out"); - } - - /// - /// Transfer point from parent to sub account. - /// - /// The target sub account uid to transfer to or from - /// The crypto currency to transfer - /// The amount of asset to transfer - /// - public async Task TransferPointFromSubToMasterAsync(string subUserId, string currency, decimal amount) - { - return await TransferMasterAndSubAsync(subUserId, currency, amount, "master-point-transfer-in"); - } - - /// - /// transfer point from sub to parent account. - /// - /// The target sub account uid to transfer to or from - /// The crypto currency to transfer - /// The amount of asset to transfer - /// - public async Task TransferPointFromMasterToSubAsync(string subUserId, string currency, decimal amount) - { - return await TransferMasterAndSubAsync(subUserId, currency, amount, "master-point-transfer-out"); - } - - /// - /// Transfer asset between parent and sub account. - /// - /// The target sub account uid to transfer to or from - /// The crypto currency to transfer - /// The amount of asset to transfer - /// The type of transfer. Possible values: [master-transfer-in, master-transfer-out, master-point-transfer-in, master-point-transfer-out] - /// - private async Task TransferMasterAndSubAsync(string subUserId, string currency, decimal amount, string type) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/subuser/transfer"); - - string content = $"{{ \"sub-uid\": {subUserId}, \"currency\":\"{currency}\", \"amount\":{amount}, \"type\":\"{type}\" }}"; - - return await HttpRequest.PostAsync(url, content); - } - - /// - /// Parent user get sub user deposit address of corresponding chain, for a specific crypto currency (except IOTA) - /// - /// Sub user id - /// Crytpo currency - /// GetDepositAddressResponse - public async Task GetSubUserDepositAddressAsync(string subUserId, string currency) - { - GetRequest request = new GetRequest() - .AddParam("subUid", subUserId) - .AddParam("currency", currency); - - string url = _urlBuilder.Build(GET_METHOD, "/v2/sub-user/deposit-address", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Parent user get sub user deposit history - /// - /// - /// GetDepositWithdrawHistoryResponse - public async Task GetSubUserDepositHistoryAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, "/v2/sub-user/query-deposit", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns the aggregated balance from all the sub-users. - /// - /// GetSubUserAccountBalance response - public async Task GetSubUserAccountBalancesAsync() - { - string url = _urlBuilder.Build(GET_METHOD, "/v1/subuser/aggregate-balance"); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Returns the balance of a sub-account specified by sub-uid. - /// - /// Sub user id - /// GetAccountBalanceResponse - public async Task GetSubUserAccountBalanceAsync(string subUserId) - { - string url = _urlBuilder.Build(GET_METHOD, $"/v1/account/accounts/{subUserId}"); - - return await HttpRequest.GetAsync(url); - } - } -} diff --git a/Huobi.SDK.Core/Spot/RESTful/WalletClient.cs b/Huobi.SDK.Core/Spot/RESTful/WalletClient.cs deleted file mode 100644 index 62c733a..0000000 --- a/Huobi.SDK.Core/Spot/RESTful/WalletClient.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System.Threading.Tasks; -using Huobi.SDK.Core.RequestBuilder; -using Huobi.SDK.Core.Spot.RESTful.Response.Wallet; -using Huobi.SDK.Core.Spot.RESTful.Request.Wallet; - -namespace Huobi.SDK.Core.Spot.RESTful -{ - /// - /// Responsible to operate wallet - /// - public class WalletClient - { - private const string GET_METHOD = "GET"; - private const string POST_METHOD = "POST"; - - private readonly PrivateUrlBuilder _urlBuilder; - - /// - /// Constructor - /// - /// Access Key - /// Secret Key - /// the host that the client connects to - public WalletClient(string accessKey, string secretKey, string host = Host.SPOT) - { - _urlBuilder = new PrivateUrlBuilder(accessKey, secretKey, host); - } - - /// - /// Get deposit address of corresponding chain, for a specific crypto currency (except IOTA) - /// - /// - /// GetDepositAddressResponse - public async Task GetDepositAddressAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, "/v2/account/deposit/address", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Query withdraw quota for currencies - /// - /// - /// GetWithdrawQuotaResponse - public async Task GetWithdrawQuotaAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, "/v2/account/withdraw/quota", request); - - return await HttpRequest.GetAsync(url); - } - - /// - /// Get withdraw address - /// - /// - /// GetDepositAddressResponse - public async Task GetWithdrawAddressAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, "/v2/account/withdraw/address", request); - - return await HttpRequest.GetAsync(url); - } - - - /// - /// Withdraw from spot trading account to an external address. - /// - /// - /// WithdrawCurrencyResponse - public async Task WithdrawCurrencyAsync(WithdrawRequest request) - { - string url = _urlBuilder.Build(POST_METHOD, "/v1/dw/withdraw/api/create"); - - return await HttpRequest.PostAsync(url, request.ToJson()); - } - - /// - /// Cancels a previously created withdraw request by its transfer id. - /// - /// The transfer id returned when create withdraw request - /// CancelWithdrawCurrencyResponse - public async Task CancelWithdrawCurrencyAsync(long withdrawId) - { - string url = _urlBuilder.Build(POST_METHOD, $"/v1/dw/withdraw-virtual/{withdrawId}/cancel"); - - return await HttpRequest.PostAsync(url); - } - - /// - /// Returns all existed withdraws and deposits and return their latest status. - /// - /// - /// GetDepositWithdrawHistoryResponse - public async Task GetDepositWithdrawHistoryAsync(GetRequest request) - { - string url = _urlBuilder.Build(GET_METHOD, "/v1/query/deposit-withdraw", request); - - return await HttpRequest.GetAsync(url); - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/Response/AccountOrder/SubAccountResponse.cs b/Huobi.SDK.Core/Spot/WS/Response/AccountOrder/SubAccountResponse.cs deleted file mode 100644 index 21ed0f0..0000000 --- a/Huobi.SDK.Core/Spot/WS/Response/AccountOrder/SubAccountResponse.cs +++ /dev/null @@ -1,68 +0,0 @@ -namespace Huobi.SDK.Core.Spot.WS.Response.AccountOrder -{ - /// - /// SubAccount Response - /// - public class SubAccountResponse - { - /// - /// action - /// - public string action; - - /// - /// ch - /// - public string ch; - - - /// - /// Response body from sub - /// - public Data data; - - public class Data - { - /// - /// The crypto currency of this balance - /// - public string currency; - - /// - /// The account id of this individual balance - /// - public int accountId; - - /// - /// The account balance (only exists when account balance changed) - /// - public string balance; - - /// - /// The available balance (only exists when available balance changed) - /// - public string available; - - /// - /// Change type - /// Possible values: [order-place,order-match,order-refund,order-cancel,order-fee-refund, - /// margin-transfer,margin-loan,margin-interest,margin-repay,deposit, withdraw, other] - /// - public string changeType; - - /// - /// Account type - /// Possible values: [trade, frozen, loan, interest] - /// - public string accountType; - - /// - /// Change timestamp in millisecond - /// If it is null, then this message is account overview not update - /// - public long? changeTime; - - public long seqNum; - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/Response/AccountOrder/SubOrdersResponse.cs b/Huobi.SDK.Core/Spot/WS/Response/AccountOrder/SubOrdersResponse.cs deleted file mode 100644 index 8414ca9..0000000 --- a/Huobi.SDK.Core/Spot/WS/Response/AccountOrder/SubOrdersResponse.cs +++ /dev/null @@ -1,98 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.WS.Response.AccountOrder -{ - /// - /// SubOrders Response - /// - public class SubOrdersResponse - { - public string action; - - public string ch; - - public Data data; - - public class Data - { - /// - /// Event type - /// - public string eventType; - - /// - /// Trading symbol - /// - public string symbol; - - /// - /// Client order id - /// - public string clientOrderId; - - /// - /// Order status - /// Possible values for creation eventType: submitted - /// - public string orderStatus; - - #region for order trigger failed/order cancel - /// - /// Order side, buy or sell - /// - public string orderSide; - - /// - /// Error code for triggering failure - /// - public int errCode; - - /// - /// Error message for triggering failure - /// - public string errMessage; - - /// - /// Last activity time, available for cancellation eventType - /// - public long lastActTime; - #endregion - - #region for place order - public long accountId; - - public long orderId; - - public string orderSource; - - public string orderPrice; - - public string orderSize; - - public string orderValue; - - public string type; - - public long orderCreateTime; - - #endregion - - #region for order traded - public string tradePrice; - - public string tradeVolume; - - public long tradeId; - - public long tradeTime; - - public bool aggressor; - - public string remainAmt; - - public string execAmt; - - #endregion - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/Response/AccountOrder/SubTradeClearingResponse.cs b/Huobi.SDK.Core/Spot/WS/Response/AccountOrder/SubTradeClearingResponse.cs deleted file mode 100644 index 8b39433..0000000 --- a/Huobi.SDK.Core/Spot/WS/Response/AccountOrder/SubTradeClearingResponse.cs +++ /dev/null @@ -1,148 +0,0 @@ -namespace Huobi.SDK.Core.Spot.WS.Response.AccountOrder -{ - /// - /// SubTradeClearing Response - /// - public class SubTradeClearingResponse - { - public string ch; - - /// - /// Response bod - /// - public Data data; - - public class Data - { - /// - /// Event type - /// - public string eventType; - - /// - /// Trading symbol - /// - public string symbol; - - /// - /// Order id - /// - public long orderId; - - /// - /// Trade price - /// - public string tradePrice; - - /// - /// Trade volume - /// - public string tradeVolume; - - /// - /// Order side - /// Possible values: [buy, sell] - /// - public string orderSide; - - /// - /// Order type - /// Possible values: [buy-market, sell-market,buy-limit,sell-limit, buy-ioc,sell-ioc, - /// buy-limit-maker,sell-limit-maker,buy-stop-limit,sell-stop-limit, buy-limit-fok, sell-limit-fok, - /// buy-stop-limit-fok, sell-stop-limit-fok] - /// - public string orderType; - - /// - /// Aggressor or not - /// - public bool aggressor; - - /// - /// Trade id - /// - public long tradeId; - - /// - /// Trade timestamp in millisecond - /// - public long tradeTime; - - /// - /// Transaction fee - /// - public string trasactFee; - - /// - /// Currency of transaction fee or transaction fee rebate - /// - public string feeCurrency; - - /// - /// Transaction fee deduction - /// - public string feeDeduct; - - /// - /// Transaction fee deduction type - /// Possible values: [ht,point] - /// - public string feeDeductType; - - /// - /// Account ID - /// - public long accountId; - - /// - /// Order source - /// - public string source; - - /// - /// Order price (invalid for market order) - /// - public string orderPrice; - - /// - /// Order size (invalid for market buy order) - /// - public string orderSize; - - /// - /// Order value (only valid for market buy order) - /// - public string orderValue; - - /// - /// Client order ID - /// - public string clientOrderId; - - /// - /// Stop price (only valid for stop limit order) - /// - public string stopPrice; - - /// - /// Operation character (only valid for stop limit order) - /// - public string @operator; - - /// - /// Order creation time - /// - public long orderCreateTime; - - /// - /// Order status, valid value: filled, partial-filled - /// - public string orderStatus; - - /// - /// Remaining order amount (if market buy order, it implicates remaining order value) - /// - public string remainAmt; - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/Response/Market/SubBBOResponse.cs b/Huobi.SDK.Core/Spot/WS/Response/Market/SubBBOResponse.cs deleted file mode 100644 index 602c6c7..0000000 --- a/Huobi.SDK.Core/Spot/WS/Response/Market/SubBBOResponse.cs +++ /dev/null @@ -1,56 +0,0 @@ -namespace Huobi.SDK.Core.Spot.WS.Response.Market -{ - /// - /// SubscribeBestBidOffer response - /// - public class SubBBOResponse - { - /// - /// Data stream - /// - public string ch; - - /// - /// Respond timestamp in millisecond - /// - public long ts; - - /// - /// Response body from sub - /// - public Tick tick; - - public class Tick - { - /// - /// Quote timestamp in millionsecond - /// - public long quoteTime; - - /// - /// Trading symbol - /// - public string symbol; - - /// - /// Best bid - /// - public float bid; - - /// - /// Best bid size - /// - public float bidSize; - - /// - /// Best ask - /// - public float ask; - - /// - /// Best ask size - /// - public float askSize; - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/Response/Market/SubDepthResponse.cs b/Huobi.SDK.Core/Spot/WS/Response/Market/SubDepthResponse.cs deleted file mode 100644 index 7040a6f..0000000 --- a/Huobi.SDK.Core/Spot/WS/Response/Market/SubDepthResponse.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace Huobi.SDK.Core.Spot.WS.Response.Market -{ - /// - /// SubscribeDepth response - /// - public class SubDepthResponse - { - /// - /// Data stream - /// - public string ch; - - /// - /// Respond timestamp in millisecond - /// - public long ts; - - /// - /// Response body from sub - /// - public Tick tick; - - public class Tick - { - /// - /// Timestamp in millionsecond - /// - public long ts; - - /// - /// Internal data - /// - public long version; - - /// - /// The current all bids in format [price, quote volume] - /// - public float[][] bids; - - /// - /// The current all asks in format [price, quote volume] - /// - public float[][] asks; - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/Response/Market/SubDetailResponse.cs b/Huobi.SDK.Core/Spot/WS/Response/Market/SubDetailResponse.cs deleted file mode 100644 index 66a25e5..0000000 --- a/Huobi.SDK.Core/Spot/WS/Response/Market/SubDetailResponse.cs +++ /dev/null @@ -1,71 +0,0 @@ -namespace Huobi.SDK.Core.Spot.WS.Response.Market -{ - /// - /// SubDetail Response - /// - public class SubDetailResponse - { - /// - /// Data stream - /// - public string ch; - - /// - /// Respond timestamp in millisecond - /// - public long ts; - - /// - /// Response body from sub - /// - public Tick tick; - - public class Tick - { - /// - /// UNIX epoch timestamp in second as response id - /// - public long id; - - /// - /// Low price during the interval - /// - public float low; - - /// - /// High price during the interval - /// - public float high; - - /// - /// Opening price during the interval - /// - public float open; - - /// - /// Closing price during the interval - /// - public float close; - - /// - /// Aggregated trading value during the interval (in quote currency) - /// - public float vol; - - /// - /// Aggregated trading volume during the interval (in base currency) - /// - public float amount; - - /// - /// version - /// - public long version; - - /// - /// Number of trades during the interval - /// - public int count; - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/Response/Market/SubETPResponse.cs b/Huobi.SDK.Core/Spot/WS/Response/Market/SubETPResponse.cs deleted file mode 100644 index 27885eb..0000000 --- a/Huobi.SDK.Core/Spot/WS/Response/Market/SubETPResponse.cs +++ /dev/null @@ -1,47 +0,0 @@ -namespace Huobi.SDK.Core.Spot.WS.Response.Market -{ - /// - /// SubETP Response - /// - public class SubETPResponse - { - /// - /// Data stream - /// - public string ch; - - /// - /// Respond timestamp in millisecond - /// - public long ts; - - /// - /// Response body from sub - /// - public Tick tick; - - public class Tick - { - public float actualLeverage; - - public float nav; - - public float outstanding; - - public string symbol; - - public long navTime; - - public Basket[] basket; - - public class Basket - { - public float amount; - - public string currency; - - } - - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/Response/Market/SubKLineResponse.cs b/Huobi.SDK.Core/Spot/WS/Response/Market/SubKLineResponse.cs deleted file mode 100644 index 7c8b3e6..0000000 --- a/Huobi.SDK.Core/Spot/WS/Response/Market/SubKLineResponse.cs +++ /dev/null @@ -1,69 +0,0 @@ -namespace Huobi.SDK.Core.Spot.WS.Response.Market -{ - /// - /// SubKLine response - /// - public class SubKLineResponse - { - /// - /// Data stream - /// - public string ch; - - /// - /// Respond timestamp in millisecond - /// - public long ts; - - /// - /// tick - /// - public Tick tick; - - /// - /// Tick - /// - public class Tick - { - /// - /// UNIX epoch timestamp in second as response id - /// - public long id; - - /// - /// Aggregated trading volume during the interval (in base currency) - /// - public float amount; - - /// - /// Number of trades during the interval - /// - public int count; - - /// - /// Opening price during the interval - /// - public float open; - - /// - /// Closing price during the interval - /// - public float close; - - /// - /// Low price during the interval - /// - public float low; - - /// - /// High price during the interval - /// - public float high; - - /// - /// Aggregated trading value during the interval (in quote currency) - /// - public float vol; - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/Response/Market/SubMBPResponse.cs b/Huobi.SDK.Core/Spot/WS/Response/Market/SubMBPResponse.cs deleted file mode 100644 index 20c240b..0000000 --- a/Huobi.SDK.Core/Spot/WS/Response/Market/SubMBPResponse.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.WS.Response.Market -{ - /// - /// SubscribeDepth response - /// - public class SubMBPResponse - { - /// - /// Data stream - /// - public string ch; - - /// - /// Respond timestamp in millisecond - /// - public long ts; - - /// - /// Response body from sub - /// - public Tick tick; - - public class Tick - { - /// - /// seqNum - /// - public long seqNum; - - /// - /// prevSeqNum - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] - public long prevSeqNum; - - /// - /// The current all bids in format [price, quote volume] - /// - public float[][] bids; - - /// - /// The current all asks in format [price, quote volume] - /// - public float[][] asks; - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/Response/Market/SubTickerResponse.cs b/Huobi.SDK.Core/Spot/WS/Response/Market/SubTickerResponse.cs deleted file mode 100644 index 76489c4..0000000 --- a/Huobi.SDK.Core/Spot/WS/Response/Market/SubTickerResponse.cs +++ /dev/null @@ -1,94 +0,0 @@ -namespace Huobi.SDK.Core.Spot.WS.Response.Market -{ - /// - /// SubTickerResponse response - /// - public class SubTickerResponse - { - /// - /// Data stream - /// - public string ch; - - /// - /// Respond timestamp in millisecond - /// - public long ts; - - /// - /// tick - /// - public Tick tick; - - /// - /// Candlestick - /// - public class Tick - { - /// - /// Opening price during the interval - /// - public float open; - - /// - /// High price during the interval - /// - public float high; - - /// - /// Low price during the interval - /// - public float low; - - /// - /// Closing price during the interval - /// - public float close; - - /// - /// Aggregated trading volume during the interval (in base currency) - /// - public float amount; - - /// - /// Aggregated trading value during the interval (in quote currency) - /// - public float vol; - - /// - /// Number of trades during the interval - /// - public int count; - - /// - /// bid - /// - public float bid; - - /// - /// bidSize - /// - public float bidSize; - - /// - /// ask - /// - public float ask; - - /// - /// askSize - /// - public float askSize; - - /// - /// lastPrice - /// - public float lastPrice; - - /// - /// lastSize - /// - public float lastSize; - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/Response/Market/SubTradeDetailResponse.cs b/Huobi.SDK.Core/Spot/WS/Response/Market/SubTradeDetailResponse.cs deleted file mode 100644 index 4aa6b70..0000000 --- a/Huobi.SDK.Core/Spot/WS/Response/Market/SubTradeDetailResponse.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Numerics; - -namespace Huobi.SDK.Core.Spot.WS.Response.Market -{ - /// - /// SubTradeDetail Response - /// - public class SubTradeDetailResponse - { - /// - /// Data stream - /// - public string ch; - - /// - /// Respond timestamp in millisecond - /// - public long ts; - - /// - /// Response body from sub - /// - public Tick tick; - - public class Tick - { - public long id; - - public long ts; - - public Data[] data; - - public class Data - { - public BigInteger id; - - public long ts; - - /// - /// Unique trade id (NEW) - /// - public long tradeid; - - /// - /// Last trade volume - /// - public float amount; - - /// - /// Last trade price - /// - public float price; - - /// - /// Aggressive order side (taker's order side) of the trade - /// Possible values: [buy, sell] - /// - public string direction; - } - } - } -} diff --git a/Huobi.SDK.Core/Spot/WS/WSAccountOrderClient.cs b/Huobi.SDK.Core/Spot/WS/WSAccountOrderClient.cs deleted file mode 100644 index 187e52d..0000000 --- a/Huobi.SDK.Core/Spot/WS/WSAccountOrderClient.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.Collections.Generic; -using Huobi.SDK.Core.Spot.WS.Response.AccountOrder; -using Huobi.SDK.Core.WSBase; -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.WS -{ - public class WSAccountOrderClient - { - private string host = null; - private string path = null; - private string accessKey = null; - private string secretKey = null; - - public WSAccountOrderClient(string accessKey, string secretKey, string host = Host.SPOT) - { - this.host = host; - this.path = "/ws/v2"; - this.accessKey = accessKey; - this.secretKey = secretKey; - } - - #region orders - public delegate void _OnSubOrdersResponse(SubOrdersResponse data); - - /// - /// sub orders - /// - /// - /// - public void SubOrders(string symbol, _OnSubOrdersResponse callbackFun) - { - string ch = $"orders#{symbol}"; - WSActionData actionData = new WSActionData { action = "sub", ch = ch }; - string sub_str = JsonConvert.SerializeObject(actionData); - - WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubOrdersResponse), true, this.host, - this.accessKey, this.secretKey, true); - wsop.Connect(); - } - #endregion - - #region trade clearing - public delegate void _OnSubTradeClearingResponse(SubTradeClearingResponse data); - - /// - /// sub trade clearing - /// - /// - /// - /// - public void SubTradeClearing(string symbol, int mode, _OnSubTradeClearingResponse callbackFun) - { - string ch = $"trade.clearing#{symbol}#{mode}"; - WSActionData actionData = new WSActionData { action = "sub", ch = ch }; - string sub_str = JsonConvert.SerializeObject(actionData); - - WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubTradeClearingResponse), true, this.host, - this.accessKey, this.secretKey, true); - wsop.Connect(); - } - #endregion - - #region accounts update - public delegate void _OnSubAccountResponse(SubAccountResponse data); - - /// - /// sub match orders - /// - /// - /// - public void SubMatchOrders(string mode, _OnSubAccountResponse callbackFun) - { - string ch = $"accounts.update#{mode}"; - WSActionData actionData = new WSActionData { action = "sub", ch = ch }; - string sub_str = JsonConvert.SerializeObject(actionData); - - WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubAccountResponse), true, this.host, - this.accessKey, this.secretKey, true); - wsop.Connect(); - } - #endregion - } -} \ No newline at end of file diff --git a/Huobi.SDK.Core/Spot/WS/WSMarketClient.cs b/Huobi.SDK.Core/Spot/WS/WSMarketClient.cs deleted file mode 100644 index 46286e5..0000000 --- a/Huobi.SDK.Core/Spot/WS/WSMarketClient.cs +++ /dev/null @@ -1,183 +0,0 @@ -using Huobi.SDK.Core.Spot.WS.Response.Market; -using Huobi.SDK.Core.WSBase; -using Newtonsoft.Json; - -namespace Huobi.SDK.Core.Spot.WS -{ - public class WSMarketClient - { - private string host = null; - private string path = null; - private string mbp = null; - - public WSMarketClient(string host = Host.SPOT) - { - this.host = host; - this.path = "/ws"; - this.mbp = "/feed"; - } - - #region kline - public delegate void _OnSubKLineResponse(SubKLineResponse data); - - /// - /// sub kline - /// - /// - /// - /// - public void SubKLine(string symbol, string period, _OnSubKLineResponse callbackFun) - { - string ch = $"market.{symbol}.kline.{period}"; - WSSubData subData = new WSSubData() { sub = ch }; - string sub_str = JsonConvert.SerializeObject(subData); - - WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubKLineResponse), true, this.host); - wsop.Connect(); - } - #endregion - - #region ticker - public delegate void _OnSubTickerResponse(SubTickerResponse data); - - /// - /// sub kline - /// - /// - /// - public void SubTicker(string symbol, _OnSubTickerResponse callbackFun) - { - string ch = $"market.{symbol}.ticker"; - WSSubData subData = new WSSubData() { sub = ch }; - string sub_str = JsonConvert.SerializeObject(subData); - - WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubTickerResponse), true, this.host); - wsop.Connect(); - } - #endregion - - #region depth - public delegate void _OnSubDepthResponse(SubDepthResponse data); - - /// - /// sub depth - /// - /// - /// - /// - public void SubDepth(string symbol, string type, _OnSubDepthResponse callbackFun) - { - string ch = $"market.{symbol}.depth.{type}"; - WSSubData subData = new WSSubData() { sub = ch }; - string sub_str = JsonConvert.SerializeObject(subData); - - WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubDepthResponse), true, this.host); - wsop.Connect(); - } - #endregion - - #region mbp - public delegate void _OnSubMBPResponse(SubMBPResponse data); - - /// - /// sub depth - /// - /// - /// - /// - /// - public void SubMBP(string symbol, int levels, bool beRefresh, _OnSubMBPResponse callbackFun) - { - string path = this.mbp; - string ch = $"market.{symbol}.mbp.{levels}"; - if (beRefresh) - { - path = this.path; - ch = $"market.{symbol}.mbp.refresh.{levels}"; - } - WSSubData subData = new WSSubData() { sub = ch }; - string sub_str = JsonConvert.SerializeObject(subData); - - WebSocketOp wsop = new WebSocketOp(path, sub_str, callbackFun, typeof(SubMBPResponse), true, this.host); - wsop.Connect(); - } - #endregion - - #region bbo - public delegate void _OnSubBBOResponse(SubBBOResponse data); - - /// - /// sub detail - /// - /// - /// - public void SubBBO(string symbol, _OnSubBBOResponse callbackFun) - { - string ch = $"market.{symbol}.bbo"; - WSSubData subData = new WSSubData() { sub = ch }; - string sub_str = JsonConvert.SerializeObject(subData); - - WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubBBOResponse), true, this.host); - wsop.Connect(); - } - #endregion - - #region trade detail - public delegate void _OnSubTradeDetailResponse(SubTradeDetailResponse data); - - /// - /// sub trade detail - /// - /// - /// - public void SubTradeDetail(string symbol, _OnSubTradeDetailResponse callbackFun) - { - string ch = $"market.{symbol}.trade.detail"; - WSSubData subData = new WSSubData() { sub = ch}; - string sub_str = JsonConvert.SerializeObject(subData); - - WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubTradeDetailResponse), true, this.host); - wsop.Connect(); - } - #endregion - - #region detail - public delegate void _OnSubDetailResponse(SubDetailResponse data); - - /// - /// sub detail - /// - /// - /// - public void SubDetail(string symbol, _OnSubDetailResponse callbackFun) - { - string ch = $"market.{symbol}.detail"; - WSSubData subData = new WSSubData() { sub = ch }; - string sub_str = JsonConvert.SerializeObject(subData); - - WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubDetailResponse), true, this.host); - wsop.Connect(); - } - #endregion - - #region etp - public delegate void _OnSubETPResponse(SubETPResponse data); - - /// - /// sub trade detail - /// - /// - /// - public void SubDetail(string symbol, _OnSubETPResponse callbackFun) - { - string ch = $"market.{symbol}.etp"; - WSSubData subData = new WSSubData() { sub = ch}; - string sub_str = JsonConvert.SerializeObject(subData); - - WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubETPResponse), true, this.host); - wsop.Connect(); - } - #endregion - - } -} \ No newline at end of file diff --git a/README.md b/README.md index 783811a..d1c093f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,8 @@ -# Huobi C# SDK +# Huobi C# SDK For Contracts v3 -This is Huobi C# SDK, This is a lightweight .NET library. -You can import it to your project or nuget in: https://www.nuget.org/packages/Huobi_SDK_Core/ +This is Huobi C# SDK v3, this is a lightweight .NET library, you can import to your project and use this SDK to query all market data, trading and manage your account. The SDK supports RESTful API invoking, and subscribing the market, account and order update from the WebSocket connection.It supports Coin-M Futures, Coin-M Swaps and USDT-M. -The SDK API supports both RESTful and websocket to get/sub the market, account and order infomation. - -It supports Spot trading, Coin-M Futures, Coin-M Swaps and USDT-M. +If you already use SDK v1 or v2, it is strongly suggested migrate to v3 as we refactor the implementation to make it simpler and easy to maintain. The SDK v3 is completely consistent with the API documentation of the new HTX open platform. Compared to SDK versions v1 and v2, due to changes in parameters of many interfaces, in order to match the latest interface parameter situation, v3 version has made adjustments to parameters of more than 80 interfaces to ensure that requests can be correctly initiated and accurate response data can be obtained. Meanwhile, the v3 version has added over 130 new interfaces available for use, greatly expanding the number of available interfaces. We will stop the maintenance of v2 in the near future. ## Table of Contents @@ -17,14 +14,14 @@ It supports Spot trading, Coin-M Futures, Coin-M Swaps and USDT-M. - [Folder structure](#Folder-Structure) - [Client](#Client) - [Response](#Response) - + - [Request examples](#Request-examples) - [Market data](#Market-data) - [Subscription examples](#Subscription-examples) - [Subscribe trade update](#Subscribe-trade-update) - + ## Quick Start @@ -81,7 +78,6 @@ string secret_key = config["SecretKey"]; This is the folder and namespace structure of SDK source code and the description - **Huobi.SDK.Core**: The SDK API project - - **Spot**: the Spot trading api src inclue RESTful and Websocket - **Futures**: the Coin-M Futures api src inclue RESTful and Websocket - **CoinSwap**: the Coin-M Swaps api src inclue RESTful and Websocket - **LinearSwap**: the USDT-M api src inclue RESTful and Websocket @@ -105,10 +101,13 @@ In this SDK, the client is the object to access the Huobi API.All the client are | | OrderClient | Private | about order | | | TransferClient | Private | transfer assets | | | TriggerOrderClient | Private | about trigger order | +| | CommonClient | Public | about common info | +| | UnifiedAccountClient | Private | about unified account info | | Websocket | WSIndexClinet | Public | index infor | | | WSMarketClinet | Public | market info | | | WSNotifyClinet | Public/Private | market info/ account info | -| | | | | +| | WSSystemClinet | Public | system info | + #### Public vs. Private @@ -164,7 +163,7 @@ client.SubKLine("BTC-USDT", "1min", delegate (SubKLineResponse data) #### Custom host -Each client constructor support an optional host parameter, by default it is "api.btcgateway.pro". If you need to use different host, you can specify the custom host. +Each client constructor support an optional host parameter, by default it is "api.hbdm.com". If you need to use different host, you can specify the custom host. ```csharp AccountClient client = new AccountClient("AccessKey", "SecretKey", "Host");