coingecko

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseURL string
}

type PriceFeed

type PriceFeed struct {
	// contains filtered or unexported fields
}

func NewCoingeckoPriceFeed

func NewCoingeckoPriceFeed(logger zerolog.Logger, interval time.Duration, endpointConfig *Config) *PriceFeed

NewCoingeckoPriceFeed returns price puller for given symbol. The price will be pulled from endpoint and divided by scaleFactor. Symbol name (if reported by endpoint) must match.

func (*PriceFeed) QueryETHUSDPrice

func (cp *PriceFeed) QueryETHUSDPrice() (float64, error)

func (*PriceFeed) QueryUSDPrice

func (cp *PriceFeed) QueryUSDPrice(erc20Contract ethcmn.Address) (float64, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL