Skip to content

Commit

Permalink
binance: refine the IsBookTicker checker written by tonyq
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Feb 6, 2024
1 parent fce6030 commit 87364d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/exchange/binance/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,11 @@ func parseWebSocketEvent(message []byte) (interface{}, error) {
}

// IsBookTicker document ref :https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-book-ticker-streams
// use key recognition because there's no identify in the content.
// use key recognition because there's no identification in the content.
func IsBookTicker(val *fastjson.Value) bool {
return !val.Exists("e") && val.Exists("u") &&
val.Exists("s") && val.Exists("b") &&
val.Exists("B") && val.Exists("a") && val.Exists("A")
return val.Exists("u") && val.Exists("s") &&
val.Exists("b") && val.Exists("B") &&
val.Exists("a") && val.Exists("A")
}

func IsPartialDepth(val *fastjson.Value) bool {
Expand Down

0 comments on commit 87364d0

Please sign in to comment.