mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
add LastUpdateId to the SliceOrderBook struct
This commit is contained in:
parent
b3ef66dff4
commit
f734c699bc
|
@ -1357,6 +1357,7 @@ func (e *Exchange) QueryDepth(ctx context.Context, symbol string) (snapshot type
|
||||||
func convertDepth(symbol string, response *binanceapi.Depth) (snapshot types.SliceOrderBook, finalUpdateID int64, err error) {
|
func convertDepth(symbol string, response *binanceapi.Depth) (snapshot types.SliceOrderBook, finalUpdateID int64, err error) {
|
||||||
snapshot.Symbol = symbol
|
snapshot.Symbol = symbol
|
||||||
snapshot.Time = time.Now()
|
snapshot.Time = time.Now()
|
||||||
|
snapshot.LastUpdateId = response.LastUpdateId
|
||||||
|
|
||||||
finalUpdateID = response.LastUpdateId
|
finalUpdateID = response.LastUpdateId
|
||||||
for _, entry := range response.Bids {
|
for _, entry := range response.Bids {
|
||||||
|
|
|
@ -21,6 +21,11 @@ type SliceOrderBook struct {
|
||||||
// Time represents the server time. If empty, it indicates that the server does not provide this information.
|
// Time represents the server time. If empty, it indicates that the server does not provide this information.
|
||||||
Time time.Time
|
Time time.Time
|
||||||
|
|
||||||
|
// LastUpdateId is the message id from the server
|
||||||
|
// this field is optional, not every exchange provides this information
|
||||||
|
// this is for binance right now.
|
||||||
|
LastUpdateId int64
|
||||||
|
|
||||||
lastUpdateTime time.Time
|
lastUpdateTime time.Time
|
||||||
|
|
||||||
loadCallbacks []func(book *SliceOrderBook)
|
loadCallbacks []func(book *SliceOrderBook)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user