spotclient

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggTradeCombinedResponse

type AggTradeCombinedResponse struct {
	StreamName string           `json:"stream"` // Stream Name
	Data       AggTradeResponse `json:"data"`   // data
}

AggTradeCombinedResponse json parser

type AggTradeResponse

type AggTradeResponse struct {
	EventType           string `json:"e"` // Event type
	EventTime           int64  `json:"E"` // Event time stamp
	Symbol              string `json:"s"` // Symbol
	AggregateTradeID    int64  `json:"a"` // Aggregate trade ID
	Price               string `json:"p"` // Price
	Quantity            string `json:"q"` // Quantity
	FirstTradeID        int64  `json:"f"` // First trade ID
	LastTradeID         int64  `json:"l"` // Last trade ID
	TradeTime           int64  `json:"T"` // Trade time
	IsBuyerMarketMarker bool   `json:"m"` // Is the buyer the market maker
	UppercaseM          bool   `json:"M"` // Ignore
}

AggTradeResponse json parser

type AllBookTickerCombinedResponse

type AllBookTickerCombinedResponse struct {
	StreamName string                `json:"stream"` // Stream Name
	Data       AllBookTickerResponse `json:"data"`   // data
}

AllBookTickerCombinedResponse json parser

type AllBookTickerResponse

type AllBookTickerResponse struct {
	OrderUpdateID int64  `json:"u"` // Order book updateId
	Symbol        string `json:"s"` // Symbol
	BestPrice     string `json:"b"` // Best bid price
	BestQTY       string `json:"B"` // Best bid qty
	BestAskPrice  string `json:"a"` // Best ask price
	BestAskQTY    string `json:"A"` // Best ask qty
}

AllBookTickerResponse json parser

type AllMarketMiniTickerCombinedResponse

type AllMarketMiniTickerCombinedResponse struct {
	StreamName string                      `json:"stream"` // Stream Name
	Data       AllMarketMiniTickerResponse `json:"data"`   // data
}

AllMarketMiniTickerCombinedResponse json parser

type AllMarketMiniTickerResponse

type AllMarketMiniTickerResponse []struct {
	EventType   string `json:"e"` // Event type
	EventTime   int64  `json:"E"` // Event time stamp
	Symbol      string `json:"s"` // Symbol
	ClosePrice  string `json:"c"` // Close price
	OpenPrice   string `json:"o"` // Open price
	HighPrice   string `json:"h"` // Highest price
	LowPrice    string `json:"l"` // Lowest price
	BaseVolume  string `json:"v"` // Total traded base asset volume
	QuoteVolume string `json:"q"` // Total traded quote asset volume
}

AllMarketMiniTickerResponse json parser

type AllMarketTickerCombinedResponse

type AllMarketTickerCombinedResponse struct {
	StreamName string                  `json:"stream"` // Stream Name
	Data       AllMarketTickerResponse `json:"data"`   // data
}

AllMarketTickerCombinedResponse json parser

type AllMarketTickerResponse

type AllMarketTickerResponse []struct {
	EventType          string `json:"e"` // Event type
	EventTime          int64  `json:"E"` // Event time stamp
	Symbol             string `json:"s"` // Symbol
	PriceChange        string `json:"p"` // Price change
	PriceChangePercent string `json:"P"` // Price change percent
	AverageWeighted    string `json:"w"` // Weighted average price
	FistTradeFPrice    string `json:"x"` // First trade(F)-1 price (first trade before the 24hr rolling window)
	LastPrice          string `json:"c"` // Last price
	LastQuantity       string `json:"Q"` // Last quantity
	BestBidPrice       string `json:"b"` // BestBidPrice
	BestBidQuantity    string `json:"B"` // BestBidQuantity
	BestAskPrice       string `json:"a"` // BestAskPrice
	BestAskQuantity    string `json:"A"` // BestAskQuantity
	OpenPrice          string `json:"o"` // Open price
	HighPrice          string `json:"h"` // Highest price
	LowPrice           string `json:"l"` // Lowest price
	BaseVolume         string `json:"v"` // Total traded base asset volume
	QuoteVolume        string `json:"q"` // Total traded quote asset volume
	OpenTime           int64  `json:"O"` // Statistics open time
	CloseTime          int64  `json:"C"` // Statistics close time
	FirstTradeID       int64  `json:"F"` // First trade id
	LastTradeID        int64  `json:"L"` // Last trade id
	TotalTrades        int64  `json:"n"` // Total number of trades
}

AllMarketTickerResponse json parser

type CandlestickCombinedResponse

type CandlestickCombinedResponse struct {
	StreamName string              `json:"stream"` // Stream Name
	Data       CandlestickResponse `json:"data"`   // data
}

CandlestickCombinedResponse json parser

type CandlestickResponse

type CandlestickResponse struct {
	EventType string `json:"e"` // Event type
	EventTime int64  `json:"E"` // Event time stamp
	Symbol    string `json:"s"` // Symbol
	KLine     struct {
		StartTime        int64  `json:"t"` // K line start time
		CloseTime        int64  `json:"T"` // K line close time
		Symbol           string `json:"s"` // Symbol
		Interval         string `json:"i"` // Interval
		FirstTradeID     int64  `json:"f"` // First Trade ID
		LastTradeID      int64  `json:"L"` // Last Trade ID
		OpenPrice        string `json:"o"` // Open Price
		ClosePrice       string `json:"c"` // Close Price
		HighPrice        string `json:"h"` // Highest price
		LowPrice         string `json:"l"` // Lowest price
		BaseVolume       string `json:"v"` // Base asset volume
		TradeNumbers     int64  `json:"n"` // Number of trades
		Closed           bool   `json:"x"` // Is this K line closed
		QuoteVolume      string `json:"q"` // Quote asset volume
		TakerBaseVolume  string `json:"V"` // Taker buy base asset volume
		TakerQuoteVolume string `json:"Q"` // Taker buy quote asset volume
		OtherParam       string `json:"B"` // Ignore
	} `json:"k"` // K line
}

CandlestickResponse json parser

type DiffBookDepthCombinedResponse

type DiffBookDepthCombinedResponse struct {
	StreamName string                `json:"stream"` // Stream Name
	Data       DiffBookDepthResponse `json:"data"`   // data
}

DiffBookDepthCombinedResponse json parser

type DiffBookDepthResponse

type DiffBookDepthResponse struct {
	EventType     string     `json:"e"` // Event type
	EventTime     int64      `json:"E"` // Event time stamp
	Symbol        string     `json:"s"` // Symbol
	FirstUpdateID int64      `json:"U"` // First update ID in event
	FinalUpdateID int64      `json:"u"` // Final update ID in event
	Bids          [][]string `json:"b"` // Bids to be updated, in addition, there will be two elements in the array, the first is Price Level to be, and the second is Quantity
	Asks          [][]string `json:"a"` // Asks to be updated, in addition, there will be two elements in the array, the first is Price Level to be, and the second is Quantity
}

DiffBookDepthResponse json parser

type PartialBookDepthCombinedResponse

type PartialBookDepthCombinedResponse struct {
	StreamName string                   `json:"stream"` // Stream Name
	Data       PartialBookDepthResponse `json:"data"`   // data
}

PartialBookDepthCombinedResponse json parser

type PartialBookDepthResponse

type PartialBookDepthResponse struct {
	LastUpdateID int64      `json:"lastUpdateId"`
	Bids         [][]string `json:"bids"` // Bids to be updated, in addition, there will be two elements in the array, the first is Price Level to be, and the second is Quantity
	Asks         [][]string `json:"asks"` // Asks to be updated, in addition, there will be two elements in the array, the first is Price Level to be, and the second is Quantity
}

PartialBookDepthResponse json parser

type SpotAggTradeWebsocketClient

type SpotAggTradeWebsocketClient struct {
	binance.WebsocketClient
}

SpotAggTradeWebsocketClient responsible to handle market price data from websocket

func NewSpotAggTradeWebsocketClient

func NewSpotAggTradeWebsocketClient(streams ...string) *SpotAggTradeWebsocketClient

NewSpotAggTradeWebsocketClient Factory function

func (*SpotAggTradeWebsocketClient) GetCombined

func (u *SpotAggTradeWebsocketClient) GetCombined(id uint)

GetCombined get combined

func (*SpotAggTradeWebsocketClient) GetSubscribe

func (u *SpotAggTradeWebsocketClient) GetSubscribe(id uint)

GetSubscribe get subscribed list

func (*SpotAggTradeWebsocketClient) SetCombined

func (u *SpotAggTradeWebsocketClient) SetCombined(b bool, id uint)

SetCombined set combined, it is true when stream's length is greater than one, and false if stream's length is equal to one

func (*SpotAggTradeWebsocketClient) SetHandler

func (u *SpotAggTradeWebsocketClient) SetHandler(connectHandler binance.ConnectedHandler, responseHandler binance.ResponseHandler)

SetHandler set callback handler

func (*SpotAggTradeWebsocketClient) Subscribe

func (u *SpotAggTradeWebsocketClient) Subscribe(id uint, params ...string)

Subscribe subscribe market price data

func (*SpotAggTradeWebsocketClient) Unsubscribe

func (u *SpotAggTradeWebsocketClient) Unsubscribe(id uint, params ...string)

Unsubscribe unsubscribe market price data

type SpotAllBookTickerWebsocketClient

type SpotAllBookTickerWebsocketClient struct {
	binance.WebsocketClient
}

SpotAllBookTickerWebsocketClient responsible to handle market price data from websocket

func NewSpotAllBookTickerWebsocketClient

func NewSpotAllBookTickerWebsocketClient(streams ...string) *SpotAllBookTickerWebsocketClient

NewSpotAllBookTickerWebsocketClient Factory function

func (*SpotAllBookTickerWebsocketClient) GetCombined

func (u *SpotAllBookTickerWebsocketClient) GetCombined(id uint)

GetCombined get combined

func (*SpotAllBookTickerWebsocketClient) GetSubscribe

func (u *SpotAllBookTickerWebsocketClient) GetSubscribe(id uint)

GetSubscribe get subscribed list

func (*SpotAllBookTickerWebsocketClient) SetCombined

func (u *SpotAllBookTickerWebsocketClient) SetCombined(b bool, id uint)

SetCombined set combined, it is true when stream's length is greater than one, and false if stream's length is equal to one

func (*SpotAllBookTickerWebsocketClient) SetHandler

func (u *SpotAllBookTickerWebsocketClient) SetHandler(connectHandler binance.ConnectedHandler, responseHandler binance.ResponseHandler)

SetHandler set callback handler

func (*SpotAllBookTickerWebsocketClient) Subscribe

func (u *SpotAllBookTickerWebsocketClient) Subscribe(id uint, params ...string)

Subscribe subscribe market price data

func (*SpotAllBookTickerWebsocketClient) Unsubscribe

func (u *SpotAllBookTickerWebsocketClient) Unsubscribe(id uint, params ...string)

Unsubscribe unsubscribe market price data

type SpotAllMarketMiniTickerWebsocketClient

type SpotAllMarketMiniTickerWebsocketClient struct {
	binance.WebsocketClient
}

SpotAllMarketMiniTickerWebsocketClient responsible to handle market price data from websocket

func NewSpotAllMarketMiniTickerWebsocketClient

func NewSpotAllMarketMiniTickerWebsocketClient(streams ...string) *SpotAllMarketMiniTickerWebsocketClient

NewSpotAllMarketMiniTickerWebsocketClient Factory function

func (*SpotAllMarketMiniTickerWebsocketClient) GetCombined

func (u *SpotAllMarketMiniTickerWebsocketClient) GetCombined(id uint)

GetCombined get combined

func (*SpotAllMarketMiniTickerWebsocketClient) GetSubscribe

func (u *SpotAllMarketMiniTickerWebsocketClient) GetSubscribe(id uint)

GetSubscribe get subscribed list

func (*SpotAllMarketMiniTickerWebsocketClient) SetCombined

func (u *SpotAllMarketMiniTickerWebsocketClient) SetCombined(b bool, id uint)

SetCombined set combined, it is true when stream's length is greater than one, and false if stream's length is equal to one

func (*SpotAllMarketMiniTickerWebsocketClient) SetHandler

func (u *SpotAllMarketMiniTickerWebsocketClient) SetHandler(connectHandler binance.ConnectedHandler, responseHandler binance.ResponseHandler)

SetHandler set callback handler

func (*SpotAllMarketMiniTickerWebsocketClient) Subscribe

func (u *SpotAllMarketMiniTickerWebsocketClient) Subscribe(id uint, params ...string)

Subscribe subscribe market price data

func (*SpotAllMarketMiniTickerWebsocketClient) Unsubscribe

func (u *SpotAllMarketMiniTickerWebsocketClient) Unsubscribe(id uint, params ...string)

Unsubscribe unsubscribe market price data

type SpotAllMarketTickerWebsocketClient

type SpotAllMarketTickerWebsocketClient struct {
	binance.WebsocketClient
}

SpotAllMarketTickerWebsocketClient responsible to handle market price data from websocket

func NewSpotAllMarketTickerWebsocketClient

func NewSpotAllMarketTickerWebsocketClient(streams ...string) *SpotAllMarketTickerWebsocketClient

NewSpotAllMarketTickerWebsocketClient Factory function

func (*SpotAllMarketTickerWebsocketClient) GetCombined

func (u *SpotAllMarketTickerWebsocketClient) GetCombined(id uint)

GetCombined get combined

func (*SpotAllMarketTickerWebsocketClient) GetSubscribe

func (u *SpotAllMarketTickerWebsocketClient) GetSubscribe(id uint)

GetSubscribe get subscribed list

func (*SpotAllMarketTickerWebsocketClient) SetCombined

func (u *SpotAllMarketTickerWebsocketClient) SetCombined(b bool, id uint)

SetCombined set combined, it is true when stream's length is greater than one, and false if stream's length is equal to one

func (*SpotAllMarketTickerWebsocketClient) SetHandler

func (u *SpotAllMarketTickerWebsocketClient) SetHandler(connectHandler binance.ConnectedHandler, responseHandler binance.ResponseHandler)

SetHandler set callback handler

func (*SpotAllMarketTickerWebsocketClient) Subscribe

func (u *SpotAllMarketTickerWebsocketClient) Subscribe(id uint, params ...string)

Subscribe subscribe market price data

func (*SpotAllMarketTickerWebsocketClient) Unsubscribe

func (u *SpotAllMarketTickerWebsocketClient) Unsubscribe(id uint, params ...string)

Unsubscribe unsubscribe market price data

type SpotCandlestickWebsocketClient

type SpotCandlestickWebsocketClient struct {
	binance.WebsocketClient
}

SpotCandlestickWebsocketClient responsible to handle market price data from websocket

func NewSpotCandlestickWebsocketClient

func NewSpotCandlestickWebsocketClient(streams ...string) *SpotCandlestickWebsocketClient

NewSpotCandlestickWebsocketClient Factory function

func (*SpotCandlestickWebsocketClient) GetCombined

func (u *SpotCandlestickWebsocketClient) GetCombined(id uint)

GetCombined get combined

func (*SpotCandlestickWebsocketClient) GetSubscribe

func (u *SpotCandlestickWebsocketClient) GetSubscribe(id uint)

GetSubscribe get subscribed list

func (*SpotCandlestickWebsocketClient) SetCombined

func (u *SpotCandlestickWebsocketClient) SetCombined(b bool, id uint)

SetCombined set combined, it is true when stream's length is greater than one, and false if stream's length is equal to one

func (*SpotCandlestickWebsocketClient) SetHandler

func (u *SpotCandlestickWebsocketClient) SetHandler(connectHandler binance.ConnectedHandler, responseHandler binance.ResponseHandler)

SetHandler set callback handler

func (*SpotCandlestickWebsocketClient) Subscribe

func (u *SpotCandlestickWebsocketClient) Subscribe(id uint, params ...string)

Subscribe subscribe market price data

func (*SpotCandlestickWebsocketClient) Unsubscribe

func (u *SpotCandlestickWebsocketClient) Unsubscribe(id uint, params ...string)

Unsubscribe unsubscribe market price data

type SpotDiffDepthDepthWebsocketClient

type SpotDiffDepthDepthWebsocketClient struct {
	binance.WebsocketClient
}

SpotDiffDepthDepthWebsocketClient responsible to handle market price data from websocket

func NewSpotDiffDepthDepthWebsocketClient

func NewSpotDiffDepthDepthWebsocketClient(streams ...string) *SpotDiffDepthDepthWebsocketClient

NewSpotDiffDepthDepthWebsocketClient Factory function

func (*SpotDiffDepthDepthWebsocketClient) GetCombined

func (u *SpotDiffDepthDepthWebsocketClient) GetCombined(id uint)

GetCombined get combined

func (*SpotDiffDepthDepthWebsocketClient) GetSubscribe

func (u *SpotDiffDepthDepthWebsocketClient) GetSubscribe(id uint)

GetSubscribe get subscribed list

func (*SpotDiffDepthDepthWebsocketClient) SetCombined

func (u *SpotDiffDepthDepthWebsocketClient) SetCombined(b bool, id uint)

SetCombined set combined, it is true when stream's length is greater than one, and false if stream's length is equal to one

func (*SpotDiffDepthDepthWebsocketClient) SetHandler

func (u *SpotDiffDepthDepthWebsocketClient) SetHandler(connectHandler binance.ConnectedHandler, responseHandler binance.ResponseHandler)

SetHandler set callback handler

func (*SpotDiffDepthDepthWebsocketClient) Subscribe

func (u *SpotDiffDepthDepthWebsocketClient) Subscribe(id uint, params ...string)

Subscribe subscribe market price data

func (*SpotDiffDepthDepthWebsocketClient) Unsubscribe

func (u *SpotDiffDepthDepthWebsocketClient) Unsubscribe(id uint, params ...string)

Unsubscribe unsubscribe market price data

type SpotPartialBookDepthWebsocketClient

type SpotPartialBookDepthWebsocketClient struct {
	binance.WebsocketClient
}

SpotPartialBookDepthWebsocketClient responsible to handle market price data from websocket

func NewSpotPartialBookDepthWebsocketClient

func NewSpotPartialBookDepthWebsocketClient(streams ...string) *SpotPartialBookDepthWebsocketClient

NewSpotPartialBookDepthWebsocketClient Factory function

func (*SpotPartialBookDepthWebsocketClient) GetCombined

func (u *SpotPartialBookDepthWebsocketClient) GetCombined(id uint)

GetCombined get combined

func (*SpotPartialBookDepthWebsocketClient) GetSubscribe

func (u *SpotPartialBookDepthWebsocketClient) GetSubscribe(id uint)

GetSubscribe get subscribed list

func (*SpotPartialBookDepthWebsocketClient) SetCombined

func (u *SpotPartialBookDepthWebsocketClient) SetCombined(b bool, id uint)

SetCombined set combined, it is true when stream's length is greater than one, and false if stream's length is equal to one

func (*SpotPartialBookDepthWebsocketClient) SetHandler

func (u *SpotPartialBookDepthWebsocketClient) SetHandler(connectHandler binance.ConnectedHandler, responseHandler binance.ResponseHandler)

SetHandler set callback handler

func (*SpotPartialBookDepthWebsocketClient) Subscribe

func (u *SpotPartialBookDepthWebsocketClient) Subscribe(id uint, params ...string)

Subscribe subscribe market price data

func (*SpotPartialBookDepthWebsocketClient) Unsubscribe

func (u *SpotPartialBookDepthWebsocketClient) Unsubscribe(id uint, params ...string)

Unsubscribe unsubscribe market price data

type SpotSymbolBookTickerWebsocketClient

type SpotSymbolBookTickerWebsocketClient struct {
	binance.WebsocketClient
}

SpotSymbolBookTickerWebsocketClient responsible to handle market price data from websocket

func NewSpotSymbolBookTickerWebsocketClient

func NewSpotSymbolBookTickerWebsocketClient(streams ...string) *SpotSymbolBookTickerWebsocketClient

NewSpotSymbolBookTickerWebsocketClient Factory function

func (*SpotSymbolBookTickerWebsocketClient) GetCombined

func (u *SpotSymbolBookTickerWebsocketClient) GetCombined(id uint)

GetCombined get combined

func (*SpotSymbolBookTickerWebsocketClient) GetSubscribe

func (u *SpotSymbolBookTickerWebsocketClient) GetSubscribe(id uint)

GetSubscribe get subscribed list

func (*SpotSymbolBookTickerWebsocketClient) SetCombined

func (u *SpotSymbolBookTickerWebsocketClient) SetCombined(b bool, id uint)

SetCombined set combined, it is true when stream's length is greater than one, and false if stream's length is equal to one

func (*SpotSymbolBookTickerWebsocketClient) SetHandler

func (u *SpotSymbolBookTickerWebsocketClient) SetHandler(connectHandler binance.ConnectedHandler, responseHandler binance.ResponseHandler)

SetHandler set callback handler

func (*SpotSymbolBookTickerWebsocketClient) Subscribe

func (u *SpotSymbolBookTickerWebsocketClient) Subscribe(id uint, params ...string)

Subscribe subscribe market price data

func (*SpotSymbolBookTickerWebsocketClient) Unsubscribe

func (u *SpotSymbolBookTickerWebsocketClient) Unsubscribe(id uint, params ...string)

Unsubscribe unsubscribe market price data

type SpotSymbolMiniTickerWebsocketClient

type SpotSymbolMiniTickerWebsocketClient struct {
	binance.WebsocketClient
}

SpotSymbolMiniTickerWebsocketClient responsible to handle market price data from websocket

func NewSpotSymbolMiniTickerWebsocketClient

func NewSpotSymbolMiniTickerWebsocketClient(streams ...string) *SpotSymbolMiniTickerWebsocketClient

NewSpotSymbolMiniTickerWebsocketClient Factory function

func (*SpotSymbolMiniTickerWebsocketClient) GetCombined

func (u *SpotSymbolMiniTickerWebsocketClient) GetCombined(id uint)

GetCombined get combined

func (*SpotSymbolMiniTickerWebsocketClient) GetSubscribe

func (u *SpotSymbolMiniTickerWebsocketClient) GetSubscribe(id uint)

GetSubscribe get subscribed list

func (*SpotSymbolMiniTickerWebsocketClient) SetCombined

func (u *SpotSymbolMiniTickerWebsocketClient) SetCombined(b bool, id uint)

SetCombined set combined, it is true when stream's length is greater than one, and false if stream's length is equal to one

func (*SpotSymbolMiniTickerWebsocketClient) SetHandler

func (u *SpotSymbolMiniTickerWebsocketClient) SetHandler(connectHandler binance.ConnectedHandler, responseHandler binance.ResponseHandler)

SetHandler set callback handler

func (*SpotSymbolMiniTickerWebsocketClient) Subscribe

func (u *SpotSymbolMiniTickerWebsocketClient) Subscribe(id uint, params ...string)

Subscribe subscribe market price data

func (*SpotSymbolMiniTickerWebsocketClient) Unsubscribe

func (u *SpotSymbolMiniTickerWebsocketClient) Unsubscribe(id uint, params ...string)

Unsubscribe unsubscribe market price data

type SpotSymbolTickerWebsocketClient

type SpotSymbolTickerWebsocketClient struct {
	binance.WebsocketClient
}

SpotSymbolTickerWebsocketClient responsible to handle market price data from websocket

func NewSpotSymbolTickerWebsocketClient

func NewSpotSymbolTickerWebsocketClient(streams ...string) *SpotSymbolTickerWebsocketClient

NewSpotSymbolTickerWebsocketClient Factory function

func (*SpotSymbolTickerWebsocketClient) GetCombined

func (u *SpotSymbolTickerWebsocketClient) GetCombined(id uint)

GetCombined get combined

func (*SpotSymbolTickerWebsocketClient) GetSubscribe

func (u *SpotSymbolTickerWebsocketClient) GetSubscribe(id uint)

GetSubscribe get subscribed list

func (*SpotSymbolTickerWebsocketClient) SetCombined

func (u *SpotSymbolTickerWebsocketClient) SetCombined(b bool, id uint)

SetCombined set combined, it is true when stream's length is greater than one, and false if stream's length is equal to one

func (*SpotSymbolTickerWebsocketClient) SetHandler

func (u *SpotSymbolTickerWebsocketClient) SetHandler(connectHandler binance.ConnectedHandler, responseHandler binance.ResponseHandler)

SetHandler set callback handler

func (*SpotSymbolTickerWebsocketClient) Subscribe

func (u *SpotSymbolTickerWebsocketClient) Subscribe(id uint, params ...string)

Subscribe subscribe market price data

func (*SpotSymbolTickerWebsocketClient) Unsubscribe

func (u *SpotSymbolTickerWebsocketClient) Unsubscribe(id uint, params ...string)

Unsubscribe unsubscribe market price data

type SpotTradeWebsocketClient

type SpotTradeWebsocketClient struct {
	binance.WebsocketClient
}

SpotTradeWebsocketClient responsible to handle market price data from websocket

func NewSpotTradeWebsocketClient

func NewSpotTradeWebsocketClient(streams ...string) *SpotTradeWebsocketClient

NewSpotTradeWebsocketClient Factory function

func (*SpotTradeWebsocketClient) GetCombined

func (u *SpotTradeWebsocketClient) GetCombined(id uint)

GetCombined get combined

func (*SpotTradeWebsocketClient) GetSubscribe

func (u *SpotTradeWebsocketClient) GetSubscribe(id uint)

GetSubscribe get subscribed list

func (*SpotTradeWebsocketClient) SetCombined

func (u *SpotTradeWebsocketClient) SetCombined(b bool, id uint)

SetCombined set combined, it is true when stream's length is greater than one, and false if stream's length is equal to one

func (*SpotTradeWebsocketClient) SetHandler

func (u *SpotTradeWebsocketClient) SetHandler(connectHandler binance.ConnectedHandler, responseHandler binance.ResponseHandler)

SetHandler set callback handler

func (*SpotTradeWebsocketClient) Subscribe

func (u *SpotTradeWebsocketClient) Subscribe(id uint, params ...string)

Subscribe subscribe market price data

func (*SpotTradeWebsocketClient) Unsubscribe

func (u *SpotTradeWebsocketClient) Unsubscribe(id uint, params ...string)

Unsubscribe unsubscribe market price data

type SymbolBookTickerCombinedResponse

type SymbolBookTickerCombinedResponse struct {
	StreamName string                   `json:"stream"` // Stream Name
	Data       SymbolBookTickerResponse `json:"data"`   // data
}

SymbolBookTickerCombinedResponse json parser

type SymbolBookTickerResponse

type SymbolBookTickerResponse struct {
	OrderUpdateID int64  `json:"u"` // Order book updateId
	Symbol        string `json:"s"` // Symbol
	BestPrice     string `json:"b"` // Best bid price
	BestQTY       string `json:"B"` // Best bid qty
	BestAskPrice  string `json:"a"` // Best ask price
	BestAskQTY    string `json:"A"` // Best ask qty
}

SymbolBookTickerResponse json parser

type SymbolMiniTickerCombinedResponse

type SymbolMiniTickerCombinedResponse struct {
	StreamName string                   `json:"stream"` // Stream Name
	Data       SymbolMiniTickerResponse `json:"data"`   // data
}

SymbolMiniTickerCombinedResponse json parser

type SymbolMiniTickerResponse

type SymbolMiniTickerResponse struct {
	EventType   string `json:"e"` // Event type
	EventTime   int64  `json:"E"` // Event time stamp
	Symbol      string `json:"s"` // Symbol
	ClosePrice  string `json:"c"` // Close price
	OpenPrice   string `json:"o"` // Open price
	HighPrice   string `json:"h"` // Highest price
	LowPrice    string `json:"l"` // Lowest price
	BaseVolume  string `json:"v"` // Total traded base asset volume
	QuoteVolume string `json:"q"` // Total traded quote asset volume
}

SymbolMiniTickerResponse json parser

type SymbolTickerCombinedResponse

type SymbolTickerCombinedResponse struct {
	StreamName string               `json:"stream"` // Stream Name
	Data       SymbolTickerResponse `json:"data"`   // data
}

SymbolTickerCombinedResponse json parser

type SymbolTickerResponse

type SymbolTickerResponse struct {
	EventType          string `json:"e"` // Event type
	EventTime          int64  `json:"E"` // Event time stamp
	Symbol             string `json:"s"` // Symbol
	PriceChange        string `json:"p"` // Price change
	PriceChangePercent string `json:"P"` // Price change percent
	AverageWeighted    string `json:"w"` // Weighted average price
	FistTradeFPrice    string `json:"x"` // First trade(F)-1 price (first trade before the 24hr rolling window)
	LastPrice          string `json:"c"` // Last price
	LastQuantity       string `json:"Q"` // Last quantity
	BestBidPrice       string `json:"b"` // BestBidPrice
	BestBidQuantity    string `json:"B"` // BestBidQuantity
	BestAskPrice       string `json:"a"` // BestAskPrice
	BestAskQuantity    string `json:"A"` // BestAskQuantity
	OpenPrice          string `json:"o"` // Open price
	HighPrice          string `json:"h"` // Highest price
	LowPrice           string `json:"l"` // Lowest price
	BaseVolume         string `json:"v"` // Total traded base asset volume
	QuoteVolume        string `json:"q"` // Total traded quote asset volume
	OpenTime           int64  `json:"O"` // Statistics open time
	CloseTime          int64  `json:"C"` // Statistics close time
	FirstTradeID       int64  `json:"F"` // First trade id
	LastTradeID        int64  `json:"L"` // Last trade id
	TotalTrades        int64  `json:"n"` // Total number of trades
}

SymbolTickerResponse json parser

type TradeCombinedResponse

type TradeCombinedResponse struct {
	StreamName string        `json:"stream"` // Stream Name
	Data       TradeResponse `json:"data"`   // data
}

TradeCombinedResponse json parser

type TradeResponse

type TradeResponse struct {
	EventType           string `json:"e"` // Event type
	EventTime           int64  `json:"E"` // Event time stamp
	Symbol              string `json:"s"` // Symbol
	TradeID             int    `json:"t"` // Trade ID
	Price               string `json:"p"` // Price
	Quantity            string `json:"q"` // Quantity
	BuyerOrderID        int    `json:"b"` // BuyerOrderID
	SellerOrderID       int    `json:"a"` // SellerOrderID
	TradeTime           int    `json:"T"` // Trade time
	IsBuyerMarketMarker bool   `json:"m"` // Is the buyer the market maker
	UppercaseM          bool   `json:"M"` // Ignore
}

TradeResponse json parser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL