morpheums/Binance.API.Csharp.Client

How can i get the Depth

Elfarrar opened this issue · 2 comments

Hello, i wanna know how to use the ListenDepthEndpoint?

Hi, here is what I put together, hope this helps....

    public void TestDepthEndpoint()
    {
        var apiClient = new ApiClient(tbox_apikey.Text, tbox_apisecret.Text);
        var binanceClient = new BinanceClient(apiClient);

        Task.Run(() => binanceClient.ListenDepthEndpoint("ethbtc", DepthHandler));
        Thread.Sleep(50000);
    }
    private void DepthHandler(DepthMessage messageData)
    {
        var depthData = messageData;
        //    richTextBox1.AppendText(text: Environment.NewLine + "depth " + depthData);
        foreach(var item in depthData.Asks)
        {
            System.Diagnostics.Debug.WriteLine(item.Price);
        //    richTextBox1.AppendText(text: Environment.NewLine + item.Price);
        }
        System.Diagnostics.Debug.WriteLine(depthData.EventType);
    }

thank you