Documentation ¶
Index ¶
- Constants
- Variables
- type BookDepthTopicParam
- type BookDiffDepthTopicParam
- type BookTicker
- type CoinMarginedMarketStreamCfg
- type CoinMarginedMarketStreamClient
- func (u *CoinMarginedMarketStreamClient) AddListener(event string, listener Listener) *emission.Emitter
- func (u *CoinMarginedMarketStreamClient) Close() error
- func (c *CoinMarginedMarketStreamClient) GetAggTradeTopic(symbol string) (string, error)
- func (c *CoinMarginedMarketStreamClient) GetAllBookTickersTopic() (string, error)
- func (c *CoinMarginedMarketStreamClient) GetAllLiquidationOrdersTopic() (string, error)
- func (c *CoinMarginedMarketStreamClient) GetAllMarketMiniTickersTopic() (string, error)
- func (c *CoinMarginedMarketStreamClient) GetAllMarketTickersTopic() (string, error)
- func (c *CoinMarginedMarketStreamClient) GetBookDepthTopic(params *BookDepthTopicParam) (string, error)
- func (c *CoinMarginedMarketStreamClient) GetBookDiffDepthTopic(params *BookDiffDepthTopicParam) (string, error)
- func (c *CoinMarginedMarketStreamClient) GetBookTickerTopic(symbol string) (string, error)
- func (c *CoinMarginedMarketStreamClient) GetIndexPriceTopic(param *IndexPriceTopicParam) (string, error)
- func (c *CoinMarginedMarketStreamClient) GetKlineTopic(params *KlineTopicParam) (string, error)
- func (c *CoinMarginedMarketStreamClient) GetLiquidationOrderTopic(symbol string) (string, error)
- func (u *CoinMarginedMarketStreamClient) GetListeners(event string, argument any) *emission.Emitter
- func (c *CoinMarginedMarketStreamClient) GetMarketPriceTopic(param *MarkPriceTopicParam) (string, error)
- func (c *CoinMarginedMarketStreamClient) GetMiniTickerTopic(symbol string) (string, error)
- func (c *CoinMarginedMarketStreamClient) GetPairMarketPriceTopic(param *PairMarkPriceTopicParam) (string, error)
- func (c *CoinMarginedMarketStreamClient) GetTickerTopic(symbol string) (string, error)
- func (u *CoinMarginedMarketStreamClient) IsConnected() bool
- func (u *CoinMarginedMarketStreamClient) Open() error
- func (u *CoinMarginedMarketStreamClient) RemoveListener(event string, listener Listener) *emission.Emitter
- func (u *CoinMarginedMarketStreamClient) Subscribe(topics []string) error
- func (u *CoinMarginedMarketStreamClient) UnSubscribe(topics []string) error
- type IndexPrice
- type IndexPriceTopicParam
- type KlineTopicParam
- type LiquidationOrder
- type Listener
- type MarkPrice
- type MarkPriceTopicParam
- type MiniTicker
- type OrderbookDepth
- type PairMarkPriceTopicParam
- type Ticker
Constants ¶
View Source
const ( SUBSCRIBE = "SUBSCRIBE" UNSUBSCRIBE = "UNSUBSCRIBE" )
View Source
const (
MaxTryTimes = 5
)
Variables ¶
View Source
var ( CoinMarginedMarketStreamBaseURL = "wss://dstream.binance.com" CombinedStreamRouter = "/stream" )
Functions ¶
This section is empty.
Types ¶
type BookDepthTopicParam ¶
type BookDiffDepthTopicParam ¶
type BookTicker ¶
type BookTicker struct { EventType string `json:"e"` UpdateID int64 `json:"u"` Symbol string `json:"s"` Pair string `json:"ps"` BestBidPrice string `json:"b"` BestBidQty string `json:"B"` BestAskPrice string `json:"a"` BestAskQty string `json:"A"` TransactionTime int64 `json:"T"` EventTime int64 `json:"E"` }
type CoinMarginedMarketStreamClient ¶
type CoinMarginedMarketStreamClient struct {
// contains filtered or unexported fields
}
func NewMarketStreamClient ¶
func NewMarketStreamClient(cfg *CoinMarginedMarketStreamCfg) (*CoinMarginedMarketStreamClient, error)
func (*CoinMarginedMarketStreamClient) AddListener ¶
func (u *CoinMarginedMarketStreamClient) AddListener(event string, listener Listener) *emission.Emitter
func (*CoinMarginedMarketStreamClient) Close ¶
func (u *CoinMarginedMarketStreamClient) Close() error
func (*CoinMarginedMarketStreamClient) GetAggTradeTopic ¶
func (c *CoinMarginedMarketStreamClient) GetAggTradeTopic(symbol string) (string, error)
func (*CoinMarginedMarketStreamClient) GetAllBookTickersTopic ¶
func (c *CoinMarginedMarketStreamClient) GetAllBookTickersTopic() (string, error)
func (*CoinMarginedMarketStreamClient) GetAllLiquidationOrdersTopic ¶
func (c *CoinMarginedMarketStreamClient) GetAllLiquidationOrdersTopic() (string, error)
func (*CoinMarginedMarketStreamClient) GetAllMarketMiniTickersTopic ¶
func (c *CoinMarginedMarketStreamClient) GetAllMarketMiniTickersTopic() (string, error)
func (*CoinMarginedMarketStreamClient) GetAllMarketTickersTopic ¶
func (c *CoinMarginedMarketStreamClient) GetAllMarketTickersTopic() (string, error)
func (*CoinMarginedMarketStreamClient) GetBookDepthTopic ¶
func (c *CoinMarginedMarketStreamClient) GetBookDepthTopic(params *BookDepthTopicParam) (string, error)
func (*CoinMarginedMarketStreamClient) GetBookDiffDepthTopic ¶
func (c *CoinMarginedMarketStreamClient) GetBookDiffDepthTopic(params *BookDiffDepthTopicParam) (string, error)
func (*CoinMarginedMarketStreamClient) GetBookTickerTopic ¶
func (c *CoinMarginedMarketStreamClient) GetBookTickerTopic(symbol string) (string, error)
func (*CoinMarginedMarketStreamClient) GetIndexPriceTopic ¶
func (c *CoinMarginedMarketStreamClient) GetIndexPriceTopic(param *IndexPriceTopicParam) (string, error)
func (*CoinMarginedMarketStreamClient) GetKlineTopic ¶
func (c *CoinMarginedMarketStreamClient) GetKlineTopic(params *KlineTopicParam) (string, error)
func (*CoinMarginedMarketStreamClient) GetLiquidationOrderTopic ¶
func (c *CoinMarginedMarketStreamClient) GetLiquidationOrderTopic(symbol string) (string, error)
func (*CoinMarginedMarketStreamClient) GetListeners ¶
func (u *CoinMarginedMarketStreamClient) GetListeners(event string, argument any) *emission.Emitter
func (*CoinMarginedMarketStreamClient) GetMarketPriceTopic ¶
func (c *CoinMarginedMarketStreamClient) GetMarketPriceTopic(param *MarkPriceTopicParam) (string, error)
func (*CoinMarginedMarketStreamClient) GetMiniTickerTopic ¶
func (c *CoinMarginedMarketStreamClient) GetMiniTickerTopic(symbol string) (string, error)
func (*CoinMarginedMarketStreamClient) GetPairMarketPriceTopic ¶
func (c *CoinMarginedMarketStreamClient) GetPairMarketPriceTopic(param *PairMarkPriceTopicParam) (string, error)
func (*CoinMarginedMarketStreamClient) GetTickerTopic ¶
func (c *CoinMarginedMarketStreamClient) GetTickerTopic(symbol string) (string, error)
func (*CoinMarginedMarketStreamClient) IsConnected ¶
func (u *CoinMarginedMarketStreamClient) IsConnected() bool
IsConnected returns the WebSocket connection state
func (*CoinMarginedMarketStreamClient) Open ¶
func (u *CoinMarginedMarketStreamClient) Open() error
func (*CoinMarginedMarketStreamClient) RemoveListener ¶
func (u *CoinMarginedMarketStreamClient) RemoveListener(event string, listener Listener) *emission.Emitter
func (*CoinMarginedMarketStreamClient) Subscribe ¶
func (u *CoinMarginedMarketStreamClient) Subscribe(topics []string) error
func (*CoinMarginedMarketStreamClient) UnSubscribe ¶
func (u *CoinMarginedMarketStreamClient) UnSubscribe(topics []string) error
type IndexPrice ¶
type IndexPriceTopicParam ¶
type KlineTopicParam ¶
type KlineTopicParam struct { Symbol string `validate:"required"` Interval cmutils.KlineInterval `validate:"required,oneof=1m 3m 5m 15m 30m 1h 2h 4h 6h 8h 12h 1d 3d 1w 1M"` }
type LiquidationOrder ¶
type LiquidationOrder struct { EventType string `json:"e"` EventTime int64 `json:"E"` Order struct { Symbol string `json:"s"` Pair string `json:"ps"` Side string `json:"S"` OrderType usdmutils.OrderType `json:"o"` TimeInForce usdmutils.TimeInForce `json:"f"` OriginalQuantity string `json:"q"` Price string `json:"p"` AveragePrice string `json:"ap"` OrderStatus cmutils.OrderStatus `json:"X"` LastFilledQuantity string `json:"l"` FilledAccumulatedQuantity string `json:"z"` TradeTime int64 `json:"T"` } `json:"o"` }
type MarkPriceTopicParam ¶
type MiniTicker ¶
type MiniTicker struct { EventType string `json:"e"` EventTime int64 `json:"E"` Symbol string `json:"s"` Pair string `json:"ps"` ClosePrice string `json:"c"` OpenPrice string `json:"o"` HighPrice string `json:"h"` LowPrice string `json:"l"` TotalTradedVolume string `json:"v"` TotalTradedBaseAssetVolume string `json:"q"` }
type OrderbookDepth ¶
type OrderbookDepth struct { EventType string `json:"e"` EventTime int64 `json:"E"` TransactionTime int64 `json:"T"` Symbol string `json:"s"` Pair string `json:"ps"` FirstUpdateID int64 `json:"U"` FinalUpdateID int64 `json:"u"` FinalUpdateIDLastStream int64 `json:"pu"` Bids [][]string `json:"b"` Asks [][]string `json:"a"` }
type PairMarkPriceTopicParam ¶
type Ticker ¶
type Ticker struct { EventType string `json:"e"` EventTime int64 `json:"E"` Symbol string `json:"s"` Pair string `json:"ps"` PriceChange string `json:"p"` PriceChangePercent string `json:"P"` WeightedAveragePrice string `json:"w"` LastPrice string `json:"c"` LastQuantity string `json:"Q"` OpenPrice string `json:"o"` HighPrice string `json:"h"` LowPrice string `json:"l"` TotalTradedVolume string `json:"v"` TotalTradedBaseAssetVolume string `json:"q"` StatisticsOpenTime int64 `json:"O"` StatisticsCloseTime int64 `json:"C"` FirstTradeID int64 `json:"F"` LastTradeID int64 `json:"L"` TradesNum int64 `json:"n"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.