binance: parse listenKeyExpired event

This commit is contained in:
c9s 2022-09-11 14:06:55 +08:00
parent 42a358fd34
commit 4890d19ebf
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -291,22 +291,22 @@ func parseWebSocketEvent(message []byte) (interface{}, error) {
case "outboundAccountPosition":
var event OutboundAccountPositionEvent
err := json.Unmarshal([]byte(message), &event)
err = json.Unmarshal([]byte(message), &event)
return &event, err
case "outboundAccountInfo":
var event OutboundAccountInfoEvent
err := json.Unmarshal([]byte(message), &event)
err = json.Unmarshal([]byte(message), &event)
return &event, err
case "balanceUpdate":
var event BalanceUpdateEvent
err := json.Unmarshal([]byte(message), &event)
err = json.Unmarshal([]byte(message), &event)
return &event, err
case "executionReport":
var event ExecutionReportEvent
err := json.Unmarshal([]byte(message), &event)
err = json.Unmarshal([]byte(message), &event)
return &event, err
case "depthUpdate":
@ -314,35 +314,40 @@ func parseWebSocketEvent(message []byte) (interface{}, error) {
case "markPriceUpdate":
var event MarkPriceUpdateEvent
err := json.Unmarshal([]byte(message), &event)
err = json.Unmarshal([]byte(message), &event)
return &event, err
case "listenKeyExpired":
var event ListenKeyExpired
err = json.Unmarshal([]byte(message), &event)
return &event, err
// Binance futures data --------------
case "continuousKline":
var event ContinuousKLineEvent
err := json.Unmarshal([]byte(message), &event)
err = json.Unmarshal([]byte(message), &event)
return &event, err
case "ORDER_TRADE_UPDATE":
var event OrderTradeUpdateEvent
err := json.Unmarshal([]byte(message), &event)
err = json.Unmarshal([]byte(message), &event)
return &event, err
// Event: Balance and Position Update
case "ACCOUNT_UPDATE":
var event AccountUpdateEvent
err := json.Unmarshal([]byte(message), &event)
err = json.Unmarshal([]byte(message), &event)
return &event, err
// Event: Order Update
case "ACCOUNT_CONFIG_UPDATE":
var event AccountConfigUpdateEvent
err := json.Unmarshal([]byte(message), &event)
err = json.Unmarshal([]byte(message), &event)
return &event, err
case "trade":
var event MarketTradeEvent
err := json.Unmarshal([]byte(message), &event)
err = json.Unmarshal([]byte(message), &event)
return &event, err
default:
@ -618,6 +623,10 @@ func (k *KLine) KLine() types.KLine {
}
}
type ListenKeyExpired struct {
EventBase
}
type MarkPriceUpdateEvent struct {
EventBase