binance

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBinance

func NewBinance(config *qsx.Config) (qsx.IExchange, error)

Types

type Binance

type Binance struct {
	qsx.Exchange
}

func (*Binance) GetHistoricalCandles

func (b *Binance) GetHistoricalCandles(ctx context.Context, productID string, granularity string) ([]qsx.Candle, error)

func (*Binance) GetKlineData

func (b *Binance) GetKlineData(ctx context.Context, params KLineParameters) (KLineResponse, error)

func (*Binance) ListProducts

func (b *Binance) ListProducts(ctx context.Context) ([]qsx.Product, error)

func (*Binance) WatchFeed

func (b *Binance) WatchFeed(shutdown chan struct{}, wg *sync.WaitGroup, product string, feed interface{}) (*orderbook.Orderbook, error)

type KLineParameters

type KLineParameters struct {
	Symbol    string    `json:"symbol"`
	Interval  string    `json:"interval"`
	StartTime time.Time `json:"start_time"`
	EndTime   time.Time `json:"end_time"`
	Limit     int       `json:"limit"`
}

func (*KLineParameters) Params

func (h *KLineParameters) Params() []string

type KLineResponse

type KLineResponse []Kline

type Kline

type Kline struct {
	OpenTime                 time.Time `json:"openTime"`
	Open                     string    `json:"open"`
	High                     string    `json:"high"`
	Low                      string    `json:"low"`
	Close                    string    `json:"close"`
	Volume                   string    `json:"volume"`
	CloseTime                time.Time `json:"closeTime"`
	QuoteAssetVolume         string    `json:"quoteAssetVolume"`
	TradeNum                 int64     `json:"tradeNum"`
	TakerBuyBaseAssetVolume  string    `json:"takerBuyBaseAssetVolume"`
	TakerBuyQuoteAssetVolume string    `json:"takerBuyQuoteAssetVolume"`
}

Jump to

Keyboard shortcuts

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