buyairt / project

0 stars 0 forks source link

binance #9

Open buyairt opened 2 years ago

buyairt commented 2 years ago

using System;

namespace WSS { public class Bitmex2 { class BuissnesServiceImpl : WebSocketService2 { public void onReceive(string msg) { Console.WriteLine(msg); } } string[] masLmaxSymbols = new string[] { "ETH/USDT", "LTC/USDT", "YFI/USDT", "XRP/USDT", "ADA/USDT", "XLM/USDT", "BCH/USDT", "DOT/USDT", "LINK/USDT", "BQX/USDT", "BNB/USDT", "IOST/USDT", "EOS/USDT", "SUSHI/USDT", "WBTC/USDT", "THETA/USDT", "IDEX/USDT", "BAND/USDT", "SXP/USDT", "XBAR/USDT", "XMR/USDT", "NANO/USDT", "VATO/USDT", "BTC/USDT" }; public void Start() { //https://docs.binance.org/api-reference/dex-api/ws-streams.html

        string text = "";
        for (int i = 0; i < masLmaxSymbols.Length; i++)
        {
            string symby = masLmaxSymbols[i].ToLower().Replace("/","") + "@miniTicker";
            text = "/" + symby + text;
        }

        string url = "wss://stream.binance.com:9443/ws" + text;/// ltcbtc@depth@100ms/ethbtc@depth@100ms";// wss://stream.binance.com:9443/ws/";// bnbusdt@depth@100ms";

        WebSocketService2 wss = new BuissnesServiceImpl();
        BitfinexBisn wb = new BitfinexBisn(url, wss);
        wb.start();

    }
}

}