mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
binance: define more event types
This commit is contained in:
parent
5206ec98c8
commit
0cf028d192
|
@ -28,6 +28,8 @@ const (
|
|||
EventTypeDepthUpdate EventType = "depthUpdate"
|
||||
EventTypeListenKeyExpired EventType = "listenKeyExpired"
|
||||
EventTypeTrade EventType = "trade"
|
||||
EventTypeAggTrade EventType = "aggTrade"
|
||||
EventTypeForceOrder EventType = "forceOrder"
|
||||
|
||||
// Our side defines the following event types since binance doesn't
|
||||
// define the event name from the server messages.
|
||||
|
@ -391,12 +393,12 @@ func parseWebSocketEvent(message []byte) (interface{}, error) {
|
|||
err = json.Unmarshal(message, &event)
|
||||
return &event, err
|
||||
|
||||
case "aggTrade":
|
||||
case EventTypeAggTrade:
|
||||
var event AggTradeEvent
|
||||
err = json.Unmarshal(message, &event)
|
||||
return &event, err
|
||||
|
||||
case "forceOrder":
|
||||
case EventTypeForceOrder:
|
||||
var event ForceOrderEvent
|
||||
err = json.Unmarshal(message, &event)
|
||||
return &event, err
|
||||
|
|
Loading…
Reference in New Issue
Block a user