pull/321/merge
guangwu 1 month ago committed by GitHub
commit 2106cf6682
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -12,7 +12,6 @@ import (
apitypes "github.com/cointop-sh/cointop/pkg/api/types" apitypes "github.com/cointop-sh/cointop/pkg/api/types"
"github.com/cointop-sh/cointop/pkg/api/util" "github.com/cointop-sh/cointop/pkg/api/util"
gecko "github.com/cointop-sh/cointop/pkg/api/vendors/coingecko/v3" gecko "github.com/cointop-sh/cointop/pkg/api/vendors/coingecko/v3"
"github.com/cointop-sh/cointop/pkg/api/vendors/coingecko/v3/types"
geckoTypes "github.com/cointop-sh/cointop/pkg/api/vendors/coingecko/v3/types" geckoTypes "github.com/cointop-sh/cointop/pkg/api/vendors/coingecko/v3/types"
) )
@ -36,7 +35,7 @@ type Service struct {
maxResultsPerPage uint maxResultsPerPage uint
maxPages uint maxPages uint
cacheMap sync.Map cacheMap sync.Map
cachedRates *types.ExchangeRatesItem cachedRates *geckoTypes.ExchangeRatesItem
} }
// NewCoinGecko new service // NewCoinGecko new service
@ -151,7 +150,7 @@ func (s *Service) GetCoinGraphData(convert, symbol, name string, start, end int6
} }
// GetExchangeRates returns the exchange rates from the backend, or a cached copy if requested and available // GetExchangeRates returns the exchange rates from the backend, or a cached copy if requested and available
func (s *Service) GetExchangeRates(cached bool) (*types.ExchangeRatesItem, error) { func (s *Service) GetExchangeRates(cached bool) (*geckoTypes.ExchangeRatesItem, error) {
if s.cachedRates == nil || !cached { if s.cachedRates == nil || !cached {
rates, err := s.client.ExchangeRates() rates, err := s.client.ExchangeRates()
if err != nil { if err != nil {

Loading…
Cancel
Save