crypto

package
v0.0.0-...-2b49957 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCMC

func NewCMC(key string, iconCache Cache) *coinmarketcap

Types

type Cache

type Cache interface {
	LoadImage(url string) (image.Image, error)
	SaveImage(url string, img image.Image)
}

type Crypto

type Crypto interface {
	FindSymbol(symbol string) (Symbol, bool)
	GetSymbols() []Symbol
	GetCurrencies() []string
	GetQuotes(currency string, symbol ...string) ([]Quote, error)
	GetOHLCV(currency string, symbol ...string) ([]Ohlcv, error)
}

type Ohlcv

type Ohlcv struct {
	Symbol

	LastUpdated string
	TimeOpen    string
	TimeClose   string
	Quote       map[string]OhlcvQuote
}

type OhlcvQuote

type OhlcvQuote struct {
	Open        float64
	High        float64
	Low         float64
	Close       float64
	Volume      float64
	Timestamp   time.Time
	LastUpdated time.Time
}

type Quote

type Quote struct {
	Symbol

	Price            float64
	Volume24H        float64
	Volume7D         float64
	Volume30D        float64
	Volume24Hbase    float64
	Volume24Hquote   float64
	PercentChange1H  float64
	PercentChange24H float64
	PercentChange7D  float64
	PercentChange30D float64
	MarketCap        float64
	LastUpdated      time.Time
}

type Symbol

type Symbol struct {
	Id      int
	Name    string
	Symbol  string
	IconURL string
	// contains filtered or unexported fields
}

func (*Symbol) Icon

func (s *Symbol) Icon() image.Image

Jump to

Keyboard shortcuts

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