coingecko

package
v0.0.0-...-20dc6fc Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinGecko

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

CoinGecko is the CoinGecko implementation of Provider. The precision of CoinGecko provider is up to day.

func New

func New() *CoinGecko

New creates a new CoinGecko instance.

func NewCoinGeckoFromContext

func NewCoinGeckoFromContext(c *cli.Context) *CoinGecko

NewCoinGeckoFromContext return coingecko provider

func (*CoinGecko) Name

func (cg *CoinGecko) Name() string

Name return name of CoinGecko provider name

func (*CoinGecko) Rate

func (cg *CoinGecko) Rate(token, currency string, timestamp time.Time) (float64, error)

Rate returns the rate of given token in real world currency at given timestamp.

func (*CoinGecko) USDRate

func (cg *CoinGecko) USDRate(timestamp time.Time) (float64, error)

USDRate returns the historical price of ETH.

Jump to

Keyboard shortcuts

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