Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CoinGecko ¶
type CoinGecko struct {
Cache *cache.Cache
}
CoinGecko is market data provider.
func NewCoinGecko ¶
func NewCoinGecko() *CoinGecko
func (CoinGecko) GetTezosMarketData ¶
func (c CoinGecko) GetTezosMarketData(curr string) (md models.MarketInfo, err error)
GetTezosMarketData gets the tezos prices and price change from CoinGecko API.
func (CoinGecko) GetTezosMarketDataByCurr ¶
func (c CoinGecko) GetTezosMarketDataByCurr(curr string) (md CurrMarketData, err error)
type CurrMarketData ¶
type CurrMarketData struct { Price float64 `json:"current_price"` Price24hChange float64 `json:"price_change_24h"` MarketCap float64 `json:"market_cap"` Volume float64 `json:"total_volume"` Supply float64 `json:"circulating_supply"` }
MarketData is a Price and Price Change with json deserialization for USD .
func (CurrMarketData) GetMarketCap ¶
func (md CurrMarketData) GetMarketCap() float64
func (CurrMarketData) GetPrice ¶
func (md CurrMarketData) GetPrice() float64
GetPrice returns the price in USD.
func (CurrMarketData) GetPriceChange ¶
func (md CurrMarketData) GetPriceChange() float64
GetPriceChange returns the price change during the last 24 hours in percents.
func (CurrMarketData) GetSupply ¶
func (md CurrMarketData) GetSupply() float64
func (CurrMarketData) GetVolume ¶
func (md CurrMarketData) GetVolume() float64
Click to show internal directories.
Click to hide internal directories.