Documentation ¶
Overview ¶
Package rest provides a client for using the Cryptowatch REST API.
Index ¶
- Constants
- type CWRESTClient
- func (c *CWRESTClient) GetExchangeDescr(exchangeSymbol string) (*ExchangeDescr, error)
- func (c *CWRESTClient) GetExchangeMarketsDescr(exchangeSymbol string) ([]MarketDescr, error)
- func (c *CWRESTClient) GetExchangesIndex() ([]ExchangeDescrBrief, error)
- func (c *CWRESTClient) GetMarketDescr(exchangeSymbol, pairSymbol string) (MarketDescr, error)
- func (c *CWRESTClient) GetMarketSummaries() (map[string]common.SummaryUpdate, error)
- func (c *CWRESTClient) GetMarketsIndex() ([]MarketDescr, error)
- func (c *CWRESTClient) GetOHLC(exchangeSymbol, pairSymbol string) (map[common.Period][]common.Interval, error)
- func (c *CWRESTClient) GetOrderBook(exchangeSymbol string, pairSymbol string) (common.OrderBookSnapshot, error)
- func (c *CWRESTClient) GetPairDescr(symbol string) (PairDescr, error)
- func (c *CWRESTClient) GetPairsIndex() ([]PairDescr, error)
- type CWRESTClientParams
- type ExchangeDescr
- type ExchangeDescrBrief
- type MarketDescr
- type PairDescr
- type PairSideDescr
Constants ¶
View Source
const (
DefaultRESTURL = "https://api.cryptowat.ch"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CWRESTClient ¶
type CWRESTClient struct {
// contains filtered or unexported fields
}
func NewCWRESTClient ¶
func NewCWRESTClient(params *CWRESTClientParams) *CWRESTClient
func (*CWRESTClient) GetExchangeDescr ¶
func (c *CWRESTClient) GetExchangeDescr(exchangeSymbol string) (*ExchangeDescr, error)
func (*CWRESTClient) GetExchangeMarketsDescr ¶
func (c *CWRESTClient) GetExchangeMarketsDescr(exchangeSymbol string) ([]MarketDescr, error)
func (*CWRESTClient) GetExchangesIndex ¶
func (c *CWRESTClient) GetExchangesIndex() ([]ExchangeDescrBrief, error)
func (*CWRESTClient) GetMarketDescr ¶
func (c *CWRESTClient) GetMarketDescr(exchangeSymbol, pairSymbol string) (MarketDescr, error)
func (*CWRESTClient) GetMarketSummaries ¶
func (c *CWRESTClient) GetMarketSummaries() (map[string]common.SummaryUpdate, error)
GetMarketSummaries returns a map from market symbol like "<exchange>:<pair>" to the corresponding summary.
func (*CWRESTClient) GetMarketsIndex ¶
func (c *CWRESTClient) GetMarketsIndex() ([]MarketDescr, error)
func (*CWRESTClient) GetOHLC ¶
func (c *CWRESTClient) GetOHLC( exchangeSymbol, pairSymbol string, ) (map[common.Period][]common.Interval, error)
GetOHLC returns a map from a period (represented as a number of seconds: 60, 180, etc) to a slice of OHLC candles for that period, in the time ascending order.
func (*CWRESTClient) GetOrderBook ¶
func (c *CWRESTClient) GetOrderBook( exchangeSymbol string, pairSymbol string, ) (common.OrderBookSnapshot, error)
func (*CWRESTClient) GetPairDescr ¶
func (c *CWRESTClient) GetPairDescr(symbol string) (PairDescr, error)
func (*CWRESTClient) GetPairsIndex ¶
func (c *CWRESTClient) GetPairsIndex() ([]PairDescr, error)
type CWRESTClientParams ¶
type CWRESTClientParams struct { // APIURL is the API URL to use. If empty, production will be used // (DefaultRESTURL) APIURL string }
type ExchangeDescr ¶
type ExchangeDescrBrief ¶
type MarketDescr ¶
type PairDescr ¶
type PairDescr struct { ID int `json:"id"` Symbol string `json:"symbol"` Route string `json:"route"` Base PairSideDescr `json:"base"` Quote PairSideDescr `json:"quote"` Markets []MarketDescr `json:"markets"` }
Click to show internal directories.
Click to hide internal directories.