package binance import ( "fmt" "git.qtrade.icu/coin-quant/exchange" "git.qtrade.icu/coin-quant/exchange/binance/common" mfutures "git.qtrade.icu/coin-quant/exchange/binance/features" ) func init() { exchange.RegisterExchange("binance", NewBinance) } func NewBinance(cfg exchange.Config, cltName string) (e exchange.Exchange, err error) { var eCfg common.BinanceConfig err = cfg.UnmarshalKey(fmt.Sprintf("exchanges.%s", cltName), &eCfg) if err != nil { return } clientProxy := cfg.GetString("proxy") switch eCfg.Kind { case "futures": e, err = mfutures.NewBinanceTrader(eCfg, cltName, clientProxy) default: err = fmt.Errorf("binance unsupport kind %s", &eCfg.Kind) } return }