kucoin

package
v0.0.0-...-b093a28 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KUCOIN = "KUCOIN"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient

type ApiClient struct {
	*retryablehttp.Client
	*rate.Limiter
}

func NewKucoinAPIClient

func NewKucoinAPIClient() *ApiClient

func (*ApiClient) GetAllOHLCVMarketData

func (apiClient *ApiClient) GetAllOHLCVMarketData(
	symbol models.Symbol,
	interval time.Duration,
	startTime time.Time,
	endTime time.Time,
) ([]*models.OHLCVMarketData, error)

GetAllOHLCVMarketData get CandleStick data from [startTime, endTime) with pagination

func (*ApiClient) GetExchangeIdentifier

func (apiClient *ApiClient) GetExchangeIdentifier() string

func (*ApiClient) GetRawMarketData

func (apiClient *ApiClient) GetRawMarketData() ([]*models.RawMarketData, error)

func (*ApiClient) GetSupportedPairs

func (apiClient *ApiClient) GetSupportedPairs() ([]*models.Symbol, error)

func (*ApiClient) GetohlcvMarketData

func (apiClient *ApiClient) GetohlcvMarketData(
	symbol models.Symbol,
	interval time.Duration,
	startTime time.Time,
	endTime time.Time,
) ([]*models.OHLCVMarketData, error)

GetohlcvMarketData get CandleStick data from [startTime, endTime]

type CandleStickData

type CandleStickData struct {
	OpenTime   float64
	OpenPrice  float64
	HighPrice  float64
	LowPrice   float64
	ClosePrice float64
	Volume     float64
}

func (*CandleStickData) UnmarshalJSON

func (candleStickResponse *CandleStickData) UnmarshalJSON(
	data []byte,
) (err error)

type CandleStickResponse

type CandleStickResponse struct {
	Code string            `json:"code"`
	Msg  string            `json:"msg"`
	Data []CandleStickData `json:"data"`
}

CandleStickResponse https://docs.kucoin.com/#get-klines

type Interval

type Interval string

type Symbol

type Symbol struct {
	Symbol          string `json:"symbol"`
	Name            string `json:"name"`
	BaseCurrency    string `json:"baseCurrency"`
	QuoteCurrency   string `json:"quoteCurrency"`
	BaseMinSize     string `json:"baseMinSize"`
	QuoteMinSize    string `json:"quoteMinSize"`
	BaseMaxSize     string `json:"baseMaxSize"`
	QuoteMaxSize    string `json:"quoteMaxSize"`
	BaseIncrement   string `json:"baseIncrement"`
	QuoteIncrement  string `json:"quoteIncrement"`
	PriceIncrement  string `json:"priceIncrement"`
	FeeCurrency     string `json:"feeCurrency"`
	EnableTrading   bool   `json:"enableTrading"`
	IsMarginEnabled bool   `json:"isMarginEnabled"`
	PriceLimitRate  string `json:"priceLimitRate"`
}

type SymbolsResponse

type SymbolsResponse struct {
	Code string   `json:"code"`
	Data []Symbol `json:"data"`
}

SymbolsResponse https://docs.kucoin.com/#get-symbols-list

Jump to

Keyboard shortcuts

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