Documentation ¶
Index ¶
- Constants
- type DataPerTokenAndCurrency
- type DataPoint
- type Manager
- func (pm *Manager) FetchHistoricalDailyPrices(symbol string, currency string, limit int, allData bool, aggregate int) ([]thirdparty.HistoricalPrice, error)
- func (pm *Manager) FetchHistoricalHourlyPrices(symbol string, currency string, limit int, aggregate int) ([]thirdparty.HistoricalPrice, error)
- func (pm *Manager) FetchPrice(symbol string, currency string) (float64, error)
- func (pm *Manager) FetchPrices(symbols []string, currencies []string) (map[string]map[string]float64, error)
- func (pm *Manager) FetchTokenDetails(symbols []string) (map[string]thirdparty.TokenDetails, error)
- func (pm *Manager) FetchTokenMarketValues(symbols []string, currency string) (map[string]thirdparty.TokenMarketValues, error)
- func (pm *Manager) GetCachedPrices() DataPerTokenAndCurrency
- func (pm *Manager) GetOrFetchPrices(symbols []string, currencies []string, maxAgeInSeconds int64) (DataPerTokenAndCurrency, error)
Constants ¶
View Source
const (
EventMarketStatusChanged walletevent.EventType = "wallet-market-status-changed"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataPerTokenAndCurrency ¶
type Manager ¶
type Manager struct { IsConnected bool LastCheckedAt int64 IsConnectedLock sync.RWMutex // contains filtered or unexported fields }
func NewManager ¶
func NewManager(providers []thirdparty.MarketDataProvider, feed *event.Feed) *Manager
func (*Manager) FetchHistoricalDailyPrices ¶
func (pm *Manager) FetchHistoricalDailyPrices(symbol string, currency string, limit int, allData bool, aggregate int) ([]thirdparty.HistoricalPrice, error)
func (*Manager) FetchHistoricalHourlyPrices ¶
func (pm *Manager) FetchHistoricalHourlyPrices(symbol string, currency string, limit int, aggregate int) ([]thirdparty.HistoricalPrice, error)
func (*Manager) FetchPrice ¶
func (*Manager) FetchPrices ¶
func (*Manager) FetchTokenDetails ¶
func (pm *Manager) FetchTokenDetails(symbols []string) (map[string]thirdparty.TokenDetails, error)
func (*Manager) FetchTokenMarketValues ¶
func (pm *Manager) FetchTokenMarketValues(symbols []string, currency string) (map[string]thirdparty.TokenMarketValues, error)
func (*Manager) GetCachedPrices ¶
func (pm *Manager) GetCachedPrices() DataPerTokenAndCurrency
func (*Manager) GetOrFetchPrices ¶
func (pm *Manager) GetOrFetchPrices(symbols []string, currencies []string, maxAgeInSeconds int64) (DataPerTokenAndCurrency, error)
Return cached price if present in cache and age is less than maxAgeInSeconds. Fetch otherwise.
Click to show internal directories.
Click to hide internal directories.