Versions in this module Expand all Collapse all v1 v1.0.10 Mar 14, 2022 v1.0.9 Mar 14, 2022 Changes in this version + const HostReal + const HostTestnet + const MaxTryTimes + const WSDisconnected + const WSExecution + const WSInstrument + const WSInsurance + const WSKLine + const WSOrder + const WSOrderBook25L1 + const WSPosition + const WSTrade + type ByBitWS struct + Ended bool + func New(config *Configuration) *ByBitWS + func (b *ByBitWS) Auth() error + func (b *ByBitWS) CloseAndReconnect() + func (b *ByBitWS) Emit(event interface{}, arguments ...interface{}) *emission.Emitter + func (b *ByBitWS) IsConnected() bool + func (b *ByBitWS) Off(event interface{}, listener interface{}) *emission.Emitter + func (b *ByBitWS) On(event interface{}, listener interface{}) *emission.Emitter + func (b *ByBitWS) Send(msg string) (err error) + func (b *ByBitWS) SendCmd(cmd Cmd) error + func (b *ByBitWS) Start() error + func (b *ByBitWS) Subscribe(arg string) + type Cmd struct + Args []interface{} + Op string + type Configuration struct + Addr string + ApiKey string + AutoReconnect bool + DebugMode bool + Proxy string + SecretKey string + type Execution struct + ExecFee float64 + ExecID string + ExecQty float64 + ExecType string + IsMaker bool + LeavesQty float64 + OrderID string + OrderLinkID string + OrderQty float64 + Price float64 + Side string + Symbol string + TradeTime time.Time + type Instrument struct + IndexPrice float64 + MarkPrice float64 + Symbol string + type Insurance struct + Currency string + Timestamp time.Time + WalletBalance int64 + type Item struct + Amount float64 + Price float64 + type KLine struct + Close float64 + High float64 + ID int64 + Interval string + Low float64 + Open float64 + OpenTime int64 + Symbol string + Turnover float64 + Volume float64 + type Order struct + CancelType string + CreateType string + CumExecFee sjson.Number + CumExecQty float64 + CumExecValue sjson.Number + LastExecPrice sjson.Number + LeavesQty float64 + OrderID string + OrderLinkID string + OrderStatus string + OrderType string + Price sjson.Number + Qty float64 + Side string + StopLoss sjson.Number + Symbol string + TakeProfit sjson.Number + TimeInForce string + Timestamp time.Time + TrailingStop sjson.Number + type OrderBook struct + Asks []Item + Bids []Item + Timestamp time.Time + type OrderBookL2 struct + ID int64 + Price float64 + Side string + Size int64 + Symbol string + func (o *OrderBookL2) Key() string + type OrderBookL2Delta struct + Delete []*OrderBookL2 + Insert []*OrderBookL2 + Update []*OrderBookL2 + type OrderBookLocal struct + func NewOrderBookLocal() *OrderBookLocal + func (o *OrderBookLocal) GetOrderBook() (ob OrderBook) + func (o *OrderBookLocal) LoadSnapshot(newOrderbook []*OrderBookL2) error + func (o *OrderBookLocal) Update(delta *OrderBookL2Delta) + type Position struct + AutoAddMargin int + AvailableBalance float64 + BustPrice float64 + CumRealisedPnl float64 + EntryPrice float64 + Leverage float64 + LiqPrice float64 + OccClosingFee float64 + OccFundingFee float64 + OrderMargin float64 + PositionMargin float64 + PositionSeq int64 + PositionStatus string + PositionValue float64 + RealisedPnl float64 + RiskID int + Side string + Size float64 + StopLoss float64 + Symbol string + TakeProfit float64 + TrailingActive float64 + TrailingStop float64 + UserID int64 + WalletBalance float64 + type Trade struct + CrossSeq int + Price float64 + Side string + Size int + Symbol string + TickDirection string + Timestamp time.Time + TradeID string