coinbasepro

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 (
	COINBASEPRO = "COINBASEPRO"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient

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

func NewCoinbaseProAPIClient

func NewCoinbaseProAPIClient() *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) GetOHLCVMarketData

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

GetOHLCVMarketData get CandleStick data from [startTime, endTime]

func (*ApiClient) GetRawMarketData

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

func (*ApiClient) GetSupportedPairs

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

type CandleStickData

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

CandleStickData https://docs.pro.coinbase.com/?python#get-historic-rates

func (*CandleStickData) UnmarshalJSON

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

type Interval

type Interval string

type ProductsResponse

type ProductsResponse []struct {
	ID              string `json:"id"`
	Message         string `json:"message"` // ERROR MESSAGE
	DisplayName     string `json:"display_name"`
	BaseCurrency    string `json:"base_currency"`
	QuoteCurrency   string `json:"quote_currency"`
	BaseIncrement   string `json:"base_increment"`
	QuoteIncrement  string `json:"quote_increment"`
	BaseMinSize     string `json:"base_min_size"`
	BaseMaxSize     string `json:"base_max_size"`
	MinMarketFunds  string `json:"min_market_funds"`
	MaxMarketFunds  string `json:"max_market_funds"`
	Status          string `json:"status"`
	StatusMessage   string `json:"status_message"`
	CancelOnly      bool   `json:"cancel_only"`
	LimitOnly       bool   `json:"limit_only"`
	PostOnly        bool   `json:"post_only"`
	TradingDisabled bool   `json:"trading_disabled"`
}

ProductsResponse https://docs.pro.coinbase.com/?python#get-products

Jump to

Keyboard shortcuts

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