2020-10-03 10:35:28 +00:00
|
|
|
// Code generated by "callbackgen -type Stream -interface"; DO NOT EDIT.
|
|
|
|
|
|
|
|
package binance
|
|
|
|
|
2020-11-07 04:38:57 +00:00
|
|
|
import ()
|
2020-10-03 10:35:28 +00:00
|
|
|
|
2020-10-03 12:09:22 +00:00
|
|
|
func (s *Stream) OnDepthEvent(cb func(e *DepthEvent)) {
|
|
|
|
s.depthEventCallbacks = append(s.depthEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitDepthEvent(e *DepthEvent) {
|
|
|
|
for _, cb := range s.depthEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-03 10:35:28 +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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) OnKLineClosedEvent(cb func(e *KLineEvent)) {
|
|
|
|
s.kLineClosedEventCallbacks = append(s.kLineClosedEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitKLineClosedEvent(e *KLineEvent) {
|
|
|
|
for _, cb := range s.kLineClosedEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-15 17:24:36 +00:00
|
|
|
func (s *Stream) OnMarkPriceUpdateEvent(cb func(e *MarkPriceUpdateEvent)) {
|
2021-11-16 06:26:27 +00:00
|
|
|
s.markPriceUpdateEventCallbacks = append(s.markPriceUpdateEventCallbacks, cb)
|
2021-11-15 17:24:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitMarkPriceUpdateEvent(e *MarkPriceUpdateEvent) {
|
2021-11-16 06:26:27 +00:00
|
|
|
for _, cb := range s.markPriceUpdateEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-18 08:17:04 +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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-17 08:01:46 +00:00
|
|
|
func (s *Stream) OnAggTradeEvent(cb func(e *AggTradeEvent)) {
|
|
|
|
s.aggTradeEventCallbacks = append(s.aggTradeEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitAggTradeEvent(e *AggTradeEvent) {
|
|
|
|
for _, cb := range s.aggTradeEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-16 06:26:27 +00:00
|
|
|
func (s *Stream) OnContinuousKLineEvent(cb func(e *ContinuousKLineEvent)) {
|
|
|
|
s.continuousKLineEventCallbacks = append(s.continuousKLineEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitContinuousKLineEvent(e *ContinuousKLineEvent) {
|
|
|
|
for _, cb := range s.continuousKLineEventCallbacks {
|
2021-11-15 17:24:36 +00:00
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-12 07:40:03 +00:00
|
|
|
func (s *Stream) OnContinuousKLineClosedEvent(cb func(e *ContinuousKLineEvent)) {
|
|
|
|
s.continuousKLineClosedEventCallbacks = append(s.continuousKLineClosedEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitContinuousKLineClosedEvent(e *ContinuousKLineEvent) {
|
|
|
|
for _, cb := range s.continuousKLineClosedEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-03 10:35:28 +00:00
|
|
|
func (s *Stream) OnBalanceUpdateEvent(cb func(event *BalanceUpdateEvent)) {
|
|
|
|
s.balanceUpdateEventCallbacks = append(s.balanceUpdateEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitBalanceUpdateEvent(event *BalanceUpdateEvent) {
|
|
|
|
for _, cb := range s.balanceUpdateEventCallbacks {
|
|
|
|
cb(event)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) OnOutboundAccountInfoEvent(cb func(event *OutboundAccountInfoEvent)) {
|
|
|
|
s.outboundAccountInfoEventCallbacks = append(s.outboundAccountInfoEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitOutboundAccountInfoEvent(event *OutboundAccountInfoEvent) {
|
|
|
|
for _, cb := range s.outboundAccountInfoEventCallbacks {
|
|
|
|
cb(event)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-21 09:48:30 +00:00
|
|
|
func (s *Stream) OnOutboundAccountPositionEvent(cb func(event *OutboundAccountPositionEvent)) {
|
|
|
|
s.outboundAccountPositionEventCallbacks = append(s.outboundAccountPositionEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitOutboundAccountPositionEvent(event *OutboundAccountPositionEvent) {
|
|
|
|
for _, cb := range s.outboundAccountPositionEventCallbacks {
|
|
|
|
cb(event)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-03 10:35:28 +00:00
|
|
|
func (s *Stream) OnExecutionReportEvent(cb func(event *ExecutionReportEvent)) {
|
|
|
|
s.executionReportEventCallbacks = append(s.executionReportEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitExecutionReportEvent(event *ExecutionReportEvent) {
|
|
|
|
for _, cb := range s.executionReportEventCallbacks {
|
|
|
|
cb(event)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-22 13:01:11 +00:00
|
|
|
func (s *Stream) OnBookTickerEvent(cb func(event *BookTickerEvent)) {
|
|
|
|
s.bookTickerEventCallbacks = append(s.bookTickerEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitBookTickerEvent(event *BookTickerEvent) {
|
|
|
|
for _, cb := range s.bookTickerEventCallbacks {
|
|
|
|
cb(event)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-12 07:40:03 +00:00
|
|
|
func (s *Stream) OnOrderTradeUpdateEvent(cb func(e *OrderTradeUpdateEvent)) {
|
|
|
|
s.orderTradeUpdateEventCallbacks = append(s.orderTradeUpdateEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitOrderTradeUpdateEvent(e *OrderTradeUpdateEvent) {
|
|
|
|
for _, cb := range s.orderTradeUpdateEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-30 14:32:03 +00:00
|
|
|
func (s *Stream) OnAccountUpdateEvent(cb func(e *AccountUpdateEvent)) {
|
|
|
|
s.accountUpdateEventCallbacks = append(s.accountUpdateEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitAccountUpdateEvent(e *AccountUpdateEvent) {
|
|
|
|
for _, cb := range s.accountUpdateEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) OnAccountConfigUpdateEvent(cb func(e *AccountConfigUpdateEvent)) {
|
|
|
|
s.accountConfigUpdateEventCallbacks = append(s.accountConfigUpdateEventCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitAccountConfigUpdateEvent(e *AccountConfigUpdateEvent) {
|
|
|
|
for _, cb := range s.accountConfigUpdateEventCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-11 06:10:30 +00:00
|
|
|
func (s *Stream) OnListenKeyExpired(cb func(e *ListenKeyExpired)) {
|
|
|
|
s.listenKeyExpiredCallbacks = append(s.listenKeyExpiredCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Stream) EmitListenKeyExpired(e *ListenKeyExpired) {
|
|
|
|
for _, cb := range s.listenKeyExpiredCallbacks {
|
|
|
|
cb(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-03 10:35:28 +00:00
|
|
|
type StreamEventHub interface {
|
2020-10-03 12:09:22 +00:00
|
|
|
OnDepthEvent(cb func(e *DepthEvent))
|
|
|
|
|
2020-10-03 10:35:28 +00:00
|
|
|
OnKLineEvent(cb func(e *KLineEvent))
|
|
|
|
|
|
|
|
OnKLineClosedEvent(cb func(e *KLineEvent))
|
|
|
|
|
2021-11-15 17:24:36 +00:00
|
|
|
OnMarkPriceUpdateEvent(cb func(e *MarkPriceUpdateEvent))
|
|
|
|
|
2022-03-18 08:17:04 +00:00
|
|
|
OnMarketTradeEvent(cb func(e *MarketTradeEvent))
|
|
|
|
|
2022-10-17 08:01:46 +00:00
|
|
|
OnAggTradeEvent(cb func(e *AggTradeEvent))
|
|
|
|
|
2021-11-16 06:26:27 +00:00
|
|
|
OnContinuousKLineEvent(cb func(e *ContinuousKLineEvent))
|
|
|
|
|
2021-12-12 07:40:03 +00:00
|
|
|
OnContinuousKLineClosedEvent(cb func(e *ContinuousKLineEvent))
|
|
|
|
|
2020-10-03 10:35:28 +00:00
|
|
|
OnBalanceUpdateEvent(cb func(event *BalanceUpdateEvent))
|
|
|
|
|
|
|
|
OnOutboundAccountInfoEvent(cb func(event *OutboundAccountInfoEvent))
|
|
|
|
|
2020-12-21 09:48:30 +00:00
|
|
|
OnOutboundAccountPositionEvent(cb func(event *OutboundAccountPositionEvent))
|
|
|
|
|
2020-10-03 10:35:28 +00:00
|
|
|
OnExecutionReportEvent(cb func(event *ExecutionReportEvent))
|
2021-12-12 07:40:03 +00:00
|
|
|
|
2021-12-22 13:01:11 +00:00
|
|
|
OnBookTickerEvent(cb func(event *BookTickerEvent))
|
|
|
|
|
2021-12-12 07:40:03 +00:00
|
|
|
OnOrderTradeUpdateEvent(cb func(e *OrderTradeUpdateEvent))
|
2021-12-30 14:32:03 +00:00
|
|
|
|
|
|
|
OnAccountUpdateEvent(cb func(e *AccountUpdateEvent))
|
|
|
|
|
|
|
|
OnAccountConfigUpdateEvent(cb func(e *AccountConfigUpdateEvent))
|
2022-09-11 06:10:30 +00:00
|
|
|
|
|
|
|
OnListenKeyExpired(cb func(e *ListenKeyExpired))
|
2020-10-03 10:35:28 +00:00
|
|
|
}
|