mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +00:00
34 lines
981 B
Go
34 lines
981 B
Go
package max
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
var WebSocketURL = "wss://max-stream.maicoin.com/ws"
|
|
|
|
var ErrMessageTypeNotSupported = errors.New("message type currently not supported")
|
|
|
|
type SubscribeOptions struct {
|
|
Depth int `json:"depth,omitempty"`
|
|
Resolution string `json:"resolution,omitempty"`
|
|
}
|
|
|
|
// Subscription is used for presenting the subscription metadata.
|
|
// This is used for sending subscribe and unsubscribe requests
|
|
type Subscription struct {
|
|
Channel string `json:"channel"`
|
|
Market string `json:"market"`
|
|
Depth int `json:"depth,omitempty"`
|
|
Resolution string `json:"resolution,omitempty"`
|
|
}
|
|
|
|
type WebsocketCommand struct {
|
|
// Action is used for specify the action of the websocket session.
|
|
// Valid values are "subscribe", "unsubscribe" and "auth"
|
|
Action string `json:"action"`
|
|
Subscriptions []Subscription `json:"subscriptions,omitempty"`
|
|
}
|
|
|
|
var SubscribeAction = "subscribe"
|
|
var UnsubscribeAction = "unsubscribe"
|