2023-08-02 08:57:30 +00:00
|
|
|
// Code generated by "callbackgen -type Stream"; DO NOT EDIT.
|
|
|
|
|
|
|
|
package bybit
|
|
|
|
|
2023-08-09 04:39:19 +00:00
|
|
|
import (
|
|
|
|
"github.com/c9s/bbgo/pkg/exchange/bybit/bybitapi"
|
|
|
|
)
|
2023-08-02 08:57:30 +00:00
|
|
|
|
|
|
|
func (s *Stream) OnBookEvent(cb func(e BookEvent)) {
|
|
|
|
s.bookEventCallbacks = append(s.bookEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitBookEvent(e BookEvent) {
|
|
|
|
for _, cb := range s.bookEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
2023-08-07 10:48:16 +00:00
|
|
|
|
2023-09-10 12:30:03 +00:00
|
|
|
func (s *Stream) OnMarketTradeEvent(cb func(e []MarketTradeEvent)) {
|
|
|
|
s.marketTradeEventCallbacks = append(s.marketTradeEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitMarketTradeEvent(e []MarketTradeEvent) {
|
|
|
|
for _, cb := range s.marketTradeEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-09 04:39:19 +00:00
|
|
|
func (s *Stream) OnWalletEvent(cb func(e []bybitapi.WalletBalances)) {
|
2023-08-07 10:48:16 +00:00
|
|
|
s.walletEventCallbacks = append(s.walletEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
2023-08-09 04:39:19 +00:00
|
|
|
func (s *Stream) EmitWalletEvent(e []bybitapi.WalletBalances) {
|
2023-08-07 10:48:16 +00:00
|
|
|
for _, cb := range s.walletEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
2023-08-08 03:40:50 +00:00
|
|
|
|
2023-08-09 03:41:16 +00:00
|
|
|
func (s *Stream) OnKLineEvent(cb func(e KLineEvent)) {
|
|
|
|
s.kLineEventCallbacks = append(s.kLineEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitKLineEvent(e KLineEvent) {
|
|
|
|
for _, cb := range s.kLineEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-08 06:11:19 +00:00
|
|
|
func (s *Stream) OnOrderEvent(cb func(e []OrderEvent)) {
|
2023-08-08 03:40:50 +00:00
|
|
|
s.orderEventCallbacks = append(s.orderEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
2023-08-08 06:11:19 +00:00
|
|
|
func (s *Stream) EmitOrderEvent(e []OrderEvent) {
|
2023-08-08 03:40:50 +00:00
|
|
|
for _, cb := range s.orderEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
2023-08-10 07:13:09 +00:00
|
|
|
|
|
|
|
func (s *Stream) OnTradeEvent(cb func(e []TradeEvent)) {
|
|
|
|
s.tradeEventCallbacks = append(s.tradeEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitTradeEvent(e []TradeEvent) {
|
|
|
|
for _, cb := range s.tradeEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|