Documentation
¶
Index ¶
- Constants
- type Asset
- type AssetDetail
- type Client
- func (c *Client) GetAssetBySymbol(ctx context.Context, symbol string, opts ...Option) (AssetDetail, error)
- func (c *Client) GetPairDetail(ctx context.Context, pair string, opts ...Option) (PairDetail, error)
- func (c *Client) GetPrice(ctx context.Context, exchange, pair string, opts ...Option) (float64, error)
- func (c *Client) ListAssets(ctx context.Context, opts ...Option) ([]Asset, error)
- func (c *Client) ListExchangeDetails(ctx context.Context, exchange string, opts ...Option) (ExchangeDetail, error)
- func (c *Client) ListExchangeMarkets(ctx context.Context, exchange string, opts ...Option) ([]Market, error)
- func (c *Client) ListExchanges(ctx context.Context, opts ...Option) ([]Exchange, error)
- func (c *Client) ListMarketDetails(ctx context.Context, exchange, pair string, opts ...Option) (MarketDetails, error)
- func (c *Client) ListMarkets(ctx context.Context, opts ...Option) ([]Market, error)
- func (c *Client) Remaining() uint64
- func (c *Client) RemainingPaid() uint64
- type Exchange
- type ExchangeDetail
- type Market
- type MarketDetails
- type Option
- type PairDetail
Constants ¶
const ( Bitfinex = "bitfinex" CoinbasePro = "coinbase-pro" Bitstamp = "bitstamp" Kraken = "kraken" CEXIO = "cexio" Gemini = "gemini" Quoine = "quoine" Liquid = "liquid" OKCoin = "okcoin" BitMEX = "bitmex" Huobi = "huobi" Luno = "luno" Poloniex = "poloniex" Bisq = "bisq" Bithumb = "bithumb" Bittrex = "bittrex" Binance = "binance" BitBay = "bitbay" Okex = "okex" Coinone = "coinone" HitBTC = "hitbtc" BitZ = "bitz" Gateio = "gateio" BinanceUS = "binance-us" KrakenFutures = "kraken-futures" DEXAggregated = "dex-aggregated" FTX = "ftx" Deribit = "deribit" )
List of supported exchanges.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct {
ID int `json:"id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
Fiat bool `json:"fiat"`
Route string `json:"route"`
}
Asset is something that is traded, like a crypto or fiat currency.
type AssetDetail ¶
type AssetDetail struct {
ID int `json:"id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
// Fiat is true when the asset is fiat currency (such as usd, and false when it is a cryptocurrency.
Fiat bool `json:"fiat"`
Markets struct {
Base []struct {
ID int `json:"id"`
Exchange string `json:"exchange"`
Pair string `json:"pair"`
Active bool `json:"active"`
Route string `json:"route"`
} `json:"base"`
Quote []struct {
ID int `json:"id"`
Exchange string `json:"exchange"`
Pair string `json:"pair"`
Active bool `json:"active"`
Route string `json:"route"`
} `json:"quote"`
} `json:"markets"`
}
AssetDetail holds information about an asset.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for cryptowatch API.
func (*Client) GetAssetBySymbol ¶
func (c *Client) GetAssetBySymbol(ctx context.Context, symbol string, opts ...Option) (AssetDetail, error)
GetAssetBySymbol returns an asset details.
func (*Client) GetPairDetail ¶
func (c *Client) GetPairDetail(ctx context.Context, pair string, opts ...Option) (PairDetail, error)
GetPairDetail returns the detail of a pair.
func (*Client) GetPrice ¶
func (c *Client) GetPrice(ctx context.Context, exchange, pair string, opts ...Option) (float64, error)
GetPrice returns the price of a pair in the given exchange.
func (*Client) ListAssets ¶
ListAssets returns all assets.
func (*Client) ListExchangeDetails ¶
func (c *Client) ListExchangeDetails(ctx context.Context, exchange string, opts ...Option) (ExchangeDetail, error)
ListExchangeDetails returns details of given exchange.
func (*Client) ListExchangeMarkets ¶
func (c *Client) ListExchangeMarkets(ctx context.Context, exchange string, opts ...Option) ([]Market, error)
ListExchangeMarkets returns markets associated with an exchange.
func (*Client) ListExchanges ¶
ListExchanges list all exchanges.
func (*Client) ListMarketDetails ¶
func (c *Client) ListMarketDetails(ctx context.Context, exchange, pair string, opts ...Option) (MarketDetails, error)
ListMarketDetails returns markets associated with an exchange.
func (*Client) ListMarkets ¶
ListMarkets returns markets associated with an exchange.
func (*Client) RemainingPaid ¶
RemainingPaid returns the remaining paid counter.
type Exchange ¶
type Exchange struct {
ID int `json:"id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
Route string `json:"route"`
Active bool `json:"active"`
}
Exchange is where all the action happens!
type ExchangeDetail ¶
type ExchangeDetail struct {
ID int `json:"id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
Active bool `json:"active"`
Routes struct {
Markets string `json:"markets"`
} `json:"routes"`
}
ExchangeDetail holds detailed information about an exhange.
type Market ¶
type Market struct {
ID int `json:"id"`
Exchange string `json:"exchange"`
Pair string `json:"pair"`
Active bool `json:"active"`
Route string `json:"route"`
}
Market is a pair listed on an exchange.
type MarketDetails ¶
type MarketDetails struct {
}
MarketDetails holds information about the market.
type PairDetail ¶
type PairDetail struct {
ID int `json:"id"`
Symbol string `json:"symbol"`
Base struct {
ID int `json:"id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
Fiat bool `json:"fiat"`
Route string `json:"route"`
} `json:"base"`
Quote struct {
ID int `json:"id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
Fiat bool `json:"fiat"`
Route string `json:"route"`
} `json:"quote"`
Route string `json:"route"`
Markets []Market `json:"markets"`
}
PairDetail holds details of a pair.