Versions in this module Expand all Collapse all v1 v1.0.25 Dec 12, 2022 v1.0.24 Dec 12, 2022 v1.0.23 Oct 16, 2022 v1.0.22 Oct 10, 2022 v1.0.21 Oct 10, 2022 v1.0.20 Oct 9, 2022 v1.0.19 Oct 6, 2022 v1.0.18 Oct 6, 2022 v1.0.17 Oct 4, 2022 v1.0.16 Oct 4, 2022 v1.0.15 Oct 3, 2022 v1.0.14 Oct 3, 2022 v1.0.13 Oct 1, 2022 v1.0.12 Sep 26, 2022 v1.0.11 Sep 26, 2022 v1.0.10 Sep 26, 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