Пример #1
0
        public async Task <BookTicker> GetBookTickerAsync(TraidingPair traidingPair)
        {
            HttpRequestMessage message = HttpBuilder.MakeRequest(APIEndPoint + "/bookTicker", new[] {
                new KeyValuePair <string, string>("symbol", traidingPair.ToString())
            });

            return(await Client.SendRequestAsync <BookTicker>(message));
        }
Пример #2
0
        public async Task <Leverage> SetLeverageAsync(TraidingPair traidingPair, int value)
        {
            HttpRequestMessage message = HttpBuilder.MakeRequest(HttpMethod.Post, $"{APIEndPoint}/leverage", new[] {
                new KeyValuePair <string, string>("symbol", traidingPair.ToString()),
                new KeyValuePair <string, string>("leverage", value.ToString()),
            });

            return(await Client.SendRequestAsync <Leverage>(message));
        }
Пример #3
0
        public async Task <Order> CancelAsync(TraidingPair traidingPair, long orderId)
        {
            HttpRequestMessage message = HttpBuilder.MakeRequest(HttpMethod.Delete, $"{APIEndPoint}/order", new[] {
                new KeyValuePair <string, string>("symbol", traidingPair.ToString()),
                new KeyValuePair <string, string>("orderId", orderId.ToString()),
            });

            return(await Client.SendRequestAsync <Order>(message));
        }
Пример #4
0
        public async Task <bool> SetMarginTypeAsync(TraidingPair traidingPair, MarginType marginType)
        {
            HttpRequestMessage message = HttpBuilder.MakeRequest(HttpMethod.Post, $"{APIEndPoint}/marginType", new[] {
                new KeyValuePair <string, string>("symbol", traidingPair.ToString()),
                new KeyValuePair <string, string>("marginType", marginType.ToString()),
            });

            ResponseStatus response = await Client.SendRequestAsync <ResponseStatus>(message);

            return(response is { } && response.Code == 200 && response.Msg == "success");
Пример #5
0
        public async Task <bool> CancelAsync(TraidingPair traidingPair)
        {
            HttpRequestMessage message = HttpBuilder.MakeRequest(HttpMethod.Delete, $"{APIEndPoint}/allOpenOrders", new[] {
                new KeyValuePair <string, string>("symbol", traidingPair.ToString())
            });

            ResponseStatus response = await Client.SendRequestAsync <ResponseStatus>(message);

            return(response.Code == 200);
        }