goBinance

package module
v0.0.0-...-e58f7fc Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 3 Imported by: 0

README

goBinance

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToString

func ToString(msg interface{}) string

Types

type BookTickerStreamMessage

type BookTickerStreamMessage struct {
	UpdateID     int    `json:"u"` // order book updateId
	Symbol       string `json:"s"` // symbol
	BestBidPrice string `json:"b"` // best bid price
	BestBidQty   string `json:"B"` // best bid qty
	BestAskPrice string `json:"a"` // best ask price
	BestAskQty   string `json:"A"` // best ask qty
}

type KlineStreamMessage

type KlineStreamMessage struct {
	EventType string `json:"e"`
	EventTime int    `json:"E"`
	Symbol    string `json:"s"`
	K         struct {
		KlineStartTime           int    `json:"t"`
		KlineCloseTime           int    `json:"T"`
		Symbol                   string `json:"s"`
		Interval                 string `json:"i"`
		FirstTradeID             int    `json:"f"`
		LastTradeID              int    `json:"L"`
		OpenPrice                string `json:"o"`
		ClosePrice               string `json:"c"`
		HighPrice                string `json:"h"`
		LowPrice                 string `json:"l"`
		BaseAssetVolume          string `json:"v"`
		NumberOfTrades           int    `json:"n"`
		IsKlineClosed            bool   `json:"x"`
		QuoteAssetVolume         string `json:"q"`
		TakerBuyBaseAssetVolume  string `json:"V"`
		TakerBuyQuoteAssetVolume string `json:"Q"`
		Ignore                   string `json:"B"`
	}
}

type SubscribeMessage

type SubscribeMessage struct {
	Method string   `json:"method"`
	Params []string `json:"params"`
	ID     uint     `json:"id"`
}

type TickerStream

type TickerStream struct {
	EventType              string `json:"e"` // Event type
	EventTyme              int64  `json:"E"` // Event time
	Symbol                 string `json:"s"` // Symbol
	PriceChange            string `json:"p"` // Price change
	PriceChangePercentage  string `json:"P"` // Price change percent
	WeightedAveragePrice   string `json:"w"` // Weighted average price
	FirstTradePrice        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"` // Best bid price
	BestBidQuantity        string `json:"B"` // Best bid quantity
	BestAskPrice           string `json:"a"` // Best ask price
	BestAskQuantity        string `json:"A"` // Best ask quantity
	OpenPrice              string `json:"o"` // Open price
	HighPrice              string `json:"h"` // High price
	LowPrice               string `json:"l"` // Low price
	TotalBaseAssetVolumen  string `json:"v"` // Total traded base asset volume
	TotalQuoteAssetVolumen string `json:"q"` // Total traded quote asset volume
	StatsOpenTime          int    `json:"O"` // Statistics open time
	StatsClosetime         int    `json:"C"` // Statistics close time
	FirstTradeID           int    `json:"F"` // First trade ID
	LastTradeID            int    `json:"L"` // Last trade Id
	TotalNumberOfTrades    int    `json:"n"` // Total number of trades
}

type WebSocket

type WebSocket struct {
	Conn *websocket.Conn
}

func (*WebSocket) Close

func (ws *WebSocket) Close()

func (*WebSocket) Connect

func (ws *WebSocket) Connect(url string)

func (*WebSocket) Subscribe

func (ws *WebSocket) Subscribe(request SubscribeMessage)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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