Versions in this module Expand all Collapse all v0 v0.0.8 Oct 8, 2020 v0.0.7 Oct 8, 2020 v0.0.6 Oct 7, 2020 v0.0.5 Oct 7, 2020 Changes in this version + var WebsocketKeepalive = false + var WebsocketTimeout = time.Second * 60 + func WsAggTradeServe(symbol string, handler WsAggTradeHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error) + func WsAllMarketsStatServe(handler WsAllMarketsStatHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error) + func WsAllMiniMarketsStatServe(handler WsAllMiniMarketsStatServeHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error) + func WsCombinedPartialDepthServe(symbolLevels map[string]string, handler WsPartialDepthHandler, ...) (doneC, stopC chan struct{}, err error) + func WsDepthServe(symbol string, handler WsDepthHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error) + func WsFutureUserDataServe(listenKey string, handler WsHandler, errHandler ErrHandler, ...) (doneC, stopC chan struct{}, err error) + func WsKlineServe(symbol string, interval string, handler WsKlineHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error) + func WsMarketStatServe(symbol string, handler WsMarketStatHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error) + func WsPartialDepthServe(symbol string, levels string, handler WsPartialDepthHandler, ...) (doneC, stopC chan struct{}, err error) + func WsTradeServe(symbol string, handler WsTradeHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error) + func WsUserDataServe(listenKey string, handler WsHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error) + type Ask struct + Price string + Quantity string + type Bid struct + Price string + Quantity string + type Binance struct + func NewBinance(params *Parameters) *Binance + func (b *Binance) AmendOrder(symbol string, id string, price float64, size float64, opts ...OrderOption) (result *Order, err error) + func (b *Binance) CancelAllOrders(symbol string, opts ...OrderOption) (err error) + func (b *Binance) CancelOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error) + func (b *Binance) CloseLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error) + func (b *Binance) CloseShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error) + func (b *Binance) GetBalance(currency string) (result *Balance, err error) + func (b *Binance) GetContractID() (symbol string, err error) + func (b *Binance) GetName() (name string) + func (b *Binance) GetOpenOrders(symbol string, opts ...OrderOption) (result []*Order, err error) + func (b *Binance) GetOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error) + func (b *Binance) GetOrderBook(symbol string, depth int) (result *OrderBook, err error) + func (b *Binance) GetPositions(symbol string) (result []*Position, err error) + func (b *Binance) GetRecords(symbol string, period string, from int64, end int64, limit int) (records []*Record, err error) + func (b *Binance) GetTime() (tm int64, err error) + func (b *Binance) IntervalKlinePeriod(period string) string + func (b *Binance) OpenLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error) + func (b *Binance) OpenShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error) + func (b *Binance) PlaceOrder(symbol string, direction Direction, orderType OrderType, price float64, ...) (result *Order, err error) + func (b *Binance) SetContractType(currencyPair string, contractType string) (err error) + func (b *Binance) SetLeverRate(value float64) (err error) + func (b *Binance) SetProxy(proxyURL string) error + func (b *Binance) SubscribeLevel2Snapshots(market Market, callback func(ob *OrderBook)) error + func (b *Binance) SubscribeOrders(market Market, callback func(orders []*Order)) error + func (b *Binance) SubscribePositions(market Market, callback func(positions []*Position)) error + func (b *Binance) SubscribeTrades(market Market, callback func(trades []*Trade)) error + type BinanceOrder struct + Amount string + AvgPrice string + ClientOId string + Direction string + FilledAmount string + ID int64 + Price string + Status string + StopPx string + Symbol string + Type string + type BinancePosition struct + CostPrice string + Size string + Symbol string + type ErrHandler func(err error) + type EventOrder struct + Event string + Order BinanceOrder + UpdateTime int64 + type EventPosition struct + A struct{ ... } + Event string + UpdateTime int64 + type EventType struct + E int64 + Event string + T int64 + type WsAggTradeEvent struct + AggTradeID int64 + Event string + FirstBreakdownTradeID int64 + IsBuyerMaker bool + LastBreakdownTradeID int64 + Placeholder bool + Price string + Quantity string + Symbol string + Time int64 + TradeTime int64 + type WsAggTradeHandler func(event *WsAggTradeEvent) + type WsAllMarketsStatEvent []*WsMarketStatEvent + type WsAllMarketsStatHandler func(event WsAllMarketsStatEvent) + type WsAllMiniMarketsStatEvent []*WsMiniMarketsStatEvent + type WsAllMiniMarketsStatServeHandler func(event WsAllMiniMarketsStatEvent) + type WsConfig struct + Endpoint string + type WsDepthEvent struct + Asks []Ask + Bids []Bid + Event string + FirstUpdateID int64 + Symbol string + Time int64 + UpdateID int64 + type WsDepthHandler func(event *WsDepthEvent) + type WsHandler func(message []byte) + type WsKline struct + ActiveBuyQuoteVolume string + ActiveBuyVolume string + Close string + EndTime int64 + FirstTradeID int64 + High string + Interval string + IsFinal bool + LastTradeID int64 + Low string + Open string + QuoteVolume string + StartTime int64 + Symbol string + TradeNum int64 + Volume string + type WsKlineEvent struct + Event string + Kline WsKline + Symbol string + Time int64 + type WsKlineHandler func(event *WsKlineEvent) + type WsMarketStatEvent struct + AskPrice string + AskQty string + BaseVolume string + BidPrice string + BidQty string + CloseQty string + CloseTime int64 + Count int64 + Event string + FirstID int64 + HighPrice string + LastID int64 + LastPrice string + LowPrice string + OpenPrice string + OpenTime int64 + PrevClosePrice string + PriceChange string + PriceChangePercent string + QuoteVolume string + Symbol string + Time int64 + WeightedAvgPrice string + type WsMarketStatHandler func(event *WsMarketStatEvent) + type WsMiniMarketsStatEvent struct + BaseVolume string + Event string + HighPrice string + LastPrice string + LowPrice string + OpenPrice string + QuoteVolume string + Symbol string + Time int64 + type WsPartialDepthEvent struct + Asks []Ask + Bids []Bid + LastUpdateID int64 + Symbol string + type WsPartialDepthHandler func(event *WsPartialDepthEvent) + type WsTradeEvent struct + BuyerOrderID int64 + Event string + IsBuyerMaker bool + Placeholder bool + Price string + Quantity string + SellerOrderID int64 + Symbol string + Time int64 + TradeID int64 + TradeTime int64 + type WsTradeHandler func(event *WsTradeEvent)