Documentation ¶
Index ¶
- Constants
- Variables
- type BookDepthTopicParam
- type IndexPrice
- type Kline
- type KlineTopicParam
- type Listener
- type MarkPrice
- type OpenInterest
- type OptionsMarketStreamCfg
- type OptionsMarketStreamClient
- func (o *OptionsMarketStreamClient) AddListener(event string, listener Listener) *emission.Emitter
- func (o *OptionsMarketStreamClient) Close() error
- func (o *OptionsMarketStreamClient) Get24HourTickerByUnderlyingAndexpirationTopic(underlying, expiration string) (string, error)
- func (o *OptionsMarketStreamClient) Get24HourTickerTopic(symbol string) (string, error)
- func (o *OptionsMarketStreamClient) GetBookDepthTopic(params *BookDepthTopicParam) (string, error)
- func (o *OptionsMarketStreamClient) GetBookDiffDepthTopic(symbol string) (string, error)
- func (o *OptionsMarketStreamClient) GetIndexPriceTopic(underlyingIndex string) (string, error)
- func (o *OptionsMarketStreamClient) GetKlineTopic(params *KlineTopicParam) (string, error)
- func (o *OptionsMarketStreamClient) GetListeners(event string, argument any) *emission.Emitter
- func (o *OptionsMarketStreamClient) GetMarkPriceTopic(underlying string) (string, error)
- func (o *OptionsMarketStreamClient) GetOpenInterestTopic(underlying, expiration string) (string, error)
- func (o *OptionsMarketStreamClient) GetTradeTopic(symbol string) (string, error)
- func (o *OptionsMarketStreamClient) IsConnected() bool
- func (o *OptionsMarketStreamClient) Open() error
- func (o *OptionsMarketStreamClient) RemoveListener(event string, listener Listener) *emission.Emitter
- func (o *OptionsMarketStreamClient) Subscribe(topics []string) error
- func (o *OptionsMarketStreamClient) UnSubscribe(topics []string) error
- type OrderbookDepth
- type Ticker
- type Trade
Constants ¶
View Source
const ( SUBSCRIBE = "SUBSCRIBE" UNSUBSCRIBE = "UNSUBSCRIBE" )
View Source
const (
MaxTryTimes = 5
)
Variables ¶
View Source
var ( OptionsMarketStreamBaseURL = "wss://nbstream.binance.com/eoptions" CombinedStreamRouter = "/stream" )
Functions ¶
This section is empty.
Types ¶
type BookDepthTopicParam ¶
type IndexPrice ¶
type Kline ¶
type Kline struct { EventType string `json:"e"` EventTime int64 `json:"E"` Symbol string `json:"s"` Kline struct { StartTime int64 `json:"t"` CloseTime int64 `json:"T"` Symbol string `json:"s"` Interval string `json:"i"` FirstTradeID int64 `json:"F"` LastTradeID int64 `json:"L"` OpenPrice string `json:"o"` ClosePrice string `json:"c"` HighPrice string `json:"h"` LowPrice string `json:"l"` BaseAssetVolume string `json:"v"` TradesNum int64 `json:"n"` IsClosed bool `json:"x"` QuoteAssetTradeAmount string `json:"q"` TakerTradeVolume string `json:"V"` TakerTradeAmount string `json:"Q"` } `json:"k"` }
type KlineTopicParam ¶
type KlineTopicParam struct { Symbol string `validate:"required"` Interval eoutils.KlineInterval `validate:"required,oneof=1m 3m 5m 15m 30m 1h 2h 4h 6h 12h 1d 3d 1w"` }
type OpenInterest ¶
type OptionsMarketStreamCfg ¶
type OptionsMarketStreamClient ¶
type OptionsMarketStreamClient struct {
// contains filtered or unexported fields
}
func NewMarketStreamClient ¶
func NewMarketStreamClient(cfg *OptionsMarketStreamCfg) (*OptionsMarketStreamClient, error)
func (*OptionsMarketStreamClient) AddListener ¶
func (o *OptionsMarketStreamClient) AddListener(event string, listener Listener) *emission.Emitter
func (*OptionsMarketStreamClient) Close ¶
func (o *OptionsMarketStreamClient) Close() error
func (*OptionsMarketStreamClient) Get24HourTickerByUnderlyingAndexpirationTopic ¶
func (o *OptionsMarketStreamClient) Get24HourTickerByUnderlyingAndexpirationTopic(underlying, expiration string) (string, error)
Get24HourTickerByUnderlyingAndexpirationTopic 24hr ticker info by underlying asset and expiration date. E.g.ETH@ticker@220930
func (*OptionsMarketStreamClient) Get24HourTickerTopic ¶
func (o *OptionsMarketStreamClient) Get24HourTickerTopic(symbol string) (string, error)
func (*OptionsMarketStreamClient) GetBookDepthTopic ¶
func (o *OptionsMarketStreamClient) GetBookDepthTopic(params *BookDepthTopicParam) (string, error)
func (*OptionsMarketStreamClient) GetBookDiffDepthTopic ¶
func (o *OptionsMarketStreamClient) GetBookDiffDepthTopic(symbol string) (string, error)
func (*OptionsMarketStreamClient) GetIndexPriceTopic ¶
func (o *OptionsMarketStreamClient) GetIndexPriceTopic(underlyingIndex string) (string, error)
GetIndexPriceTopic e.g ETHUSDT Underlying index stream.
func (*OptionsMarketStreamClient) GetKlineTopic ¶
func (o *OptionsMarketStreamClient) GetKlineTopic(params *KlineTopicParam) (string, error)
func (*OptionsMarketStreamClient) GetListeners ¶
func (o *OptionsMarketStreamClient) GetListeners(event string, argument any) *emission.Emitter
func (*OptionsMarketStreamClient) GetMarkPriceTopic ¶
func (o *OptionsMarketStreamClient) GetMarkPriceTopic(underlying string) (string, error)
GetMarkPriceTopic The mark price for all option symbols on specific underlying asset. E.g.ETH@markPrice
func (*OptionsMarketStreamClient) GetOpenInterestTopic ¶
func (o *OptionsMarketStreamClient) GetOpenInterestTopic(underlying, expiration string) (string, error)
GetOpenInterestTopic Option open interest for specific underlying asset on specific expiration date. E.g.ETH@openInterest@221125
func (*OptionsMarketStreamClient) GetTradeTopic ¶
func (o *OptionsMarketStreamClient) GetTradeTopic(symbol string) (string, error)
GetTradeTopic The Trade Streams push raw trade information for specific symbol or underlying asset. E.g.ETH@trade
func (*OptionsMarketStreamClient) IsConnected ¶
func (o *OptionsMarketStreamClient) IsConnected() bool
IsConnected returns the WebSocket connection state
func (*OptionsMarketStreamClient) Open ¶
func (o *OptionsMarketStreamClient) Open() error
func (*OptionsMarketStreamClient) RemoveListener ¶
func (o *OptionsMarketStreamClient) RemoveListener(event string, listener Listener) *emission.Emitter
func (*OptionsMarketStreamClient) Subscribe ¶
func (o *OptionsMarketStreamClient) Subscribe(topics []string) error
func (*OptionsMarketStreamClient) UnSubscribe ¶
func (o *OptionsMarketStreamClient) UnSubscribe(topics []string) error
type OrderbookDepth ¶
type Ticker ¶
type Ticker struct { EventType string `json:"e"` EventTime int64 `json:"E"` Symbol string `json:"s"` OpeningPrice string `json:"o"` HighPrice string `json:"h"` LowPrice string `json:"l"` LatestPrice string `json:"c"` TradingVolume string `json:"V"` TradingAmount string `json:"A"` PriceChangePercent string `json:"P"` PriceChange string `json:"p"` LastTradeVolume string `json:"Q"` FirstTradeID string `json:"F"` LastTradeID string `json:"L"` NumberOfTrades int64 `json:"n"` BestBuyPrice string `json:"bo"` BestSellPrice string `json:"ao"` BestBuyQuantity string `json:"bq"` BestSellQuantity string `json:"aq"` BuyImplied string `json:"b"` SellImplied string `json:"a"` Delta string `json:"d"` Theta string `json:"t"` Gamma string `json:"g"` Vega string `json:"v"` ImpliedVolatility string `json:"vo"` MarkPrice string `json:"mp"` BuyMaximumPrice string `json:"hl"` SellMinimumPrice string `json:"ll"` EstimatedStrikePrice string `json:"eep"` }
type Trade ¶
type Trade struct { EventType string `json:"e"` EventTime int64 `json:"E"` Symbol string `json:"s"` TradeID string `json:"t"` Price string `json:"p"` Quantity string `json:"q"` BuyOrderID string `json:"b"` SellOrderID string `json:"a"` TradeCompletedTime int64 `json:"T"` Direction string `json:"S"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.