adshao / go-binance

A Go SDK for Binance API
MIT License
1.48k stars 663 forks source link

Update the spot WsOrderUpdate struct #441

Closed XanderShum closed 1 year ago

XanderShum commented 1 year ago

USER DATA STREAM eventType executionReport has new fields V - selfTradePreventionMode D - trailing_time (Appears if the trailing stop order is active) W - workingTime (Appears if isWorking=true)

According to https://golang.org/pkg/encoding/json/#Unmarshal Unmarshal matches incoming object keys to the keys used by Marshal (either the struct field name or its tag), preferring an exact match but also accepting a case-insensitive match

If the "W" field is not added, there will be a bug "json: cannot unmarshal number into Go struct field WsOrderUpdate.w of type bool"