|
|
|
@ -77,6 +77,7 @@ func (s *Service) getPaginatedCoinData(convert string, offset int) ([]apitypes.C
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ret = append(ret, apitypes.Coin{
|
|
|
|
|
// TODO: Fix ID
|
|
|
|
|
ID: util.FormatID(v.Name),
|
|
|
|
|
Name: util.FormatName(v.Name),
|
|
|
|
|
Symbol: util.FormatSymbol(v.Symbol),
|
|
|
|
@ -90,6 +91,7 @@ func (s *Service) getPaginatedCoinData(convert string, offset int) ([]apitypes.C
|
|
|
|
|
PercentChange7D: util.FormatPercentChange(quote.PercentChange7D),
|
|
|
|
|
Volume24H: util.FormatVolume(v.Quote[convert].Volume24H),
|
|
|
|
|
LastUpdated: util.FormatLastUpdated(v.LastUpdated),
|
|
|
|
|
Slug: util.FormatSlug(v.Slug),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
return ret, nil
|
|
|
|
@ -297,7 +299,6 @@ func (s *Service) GetGlobalMarketData(convert string) (apitypes.GlobalMarketData
|
|
|
|
|
market, err := s.client.GlobalMetrics.LatestQuotes(&cmc.QuoteOptions{
|
|
|
|
|
Convert: convert,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
return ret, err
|
|
|
|
|
}
|
|
|
|
@ -332,9 +333,8 @@ func (s *Service) Price(name string, convert string) (float64, error) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CoinLink returns the URL link for the coin
|
|
|
|
|
func (s *Service) CoinLink(name string) string {
|
|
|
|
|
slug := util.NameToSlug(name)
|
|
|
|
|
return fmt.Sprintf("https://coinmarketcap.com/currencies/%s", slug)
|
|
|
|
|
func (s *Service) CoinLink(slug string) string {
|
|
|
|
|
return fmt.Sprintf("https://coinmarketcap.com/currencies/%s/", slug)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SupportedCurrencies returns a list of supported currencies
|
|
|
|
|