rename StreamRequest to WebSocketCommand

This commit is contained in:
c9s 2021-12-30 16:49:07 +08:00
parent 35e0b1d146
commit 890fb5327a

View File

@ -10,7 +10,6 @@ import (
"time" "time"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/c9s/bbgo/pkg/depth" "github.com/c9s/bbgo/pkg/depth"
"github.com/c9s/bbgo/pkg/util" "github.com/c9s/bbgo/pkg/util"
@ -63,7 +62,7 @@ func init() {
} }
} }
type StreamRequest struct { type WebSocketCommand struct {
// request ID is required // request ID is required
ID int `json:"id"` ID int `json:"id"`
Method string `json:"method"` Method string `json:"method"`
@ -215,7 +214,7 @@ func NewStream(ex *Exchange, client *binance.Client, futuresClient *futures.Clie
} }
log.Infof("subscribing channels: %+v", params) log.Infof("subscribing channels: %+v", params)
err := stream.Conn.WriteJSON(StreamRequest{ err := stream.Conn.WriteJSON(WebSocketCommand{
Method: "SUBSCRIBE", Method: "SUBSCRIBE",
Params: params, Params: params,
ID: 1, ID: 1,