cmc

package
v0.0.0-...-c77c525 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CMC

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

func NewCMC

func NewCMC(cfg config.Config) *CMC

func (*CMC) GetCurrencies

func (cmc *CMC) GetCurrencies() (currencies []Currency, err error)

type CurrenciesResponse

type CurrenciesResponse struct {
	Status struct {
		ErrorCode    int    `json:"error_code"`
		ErrorMessage string `json:"error_message,omitempty"`
	} `json:"status"`
	Data []Currency `json:"data"`
}

type Currency

type Currency struct {
	CirculatingSupply decimal.Decimal `json:"circulating_supply"`
	CMCRank           int             `json:"cmc_rank"`
	TotalSupply       decimal.Decimal `json:"total_supply"`
	Symbol            string          `json:"symbol"`
	Quote             map[string]struct {
		MarketCap        decimal.Decimal `json:"market_cap"`
		PercentChange1h  decimal.Decimal `json:"percent_change_1h"`
		PercentChange7d  decimal.Decimal `json:"percent_change_7d"`
		PercentChange24h decimal.Decimal `json:"percent_change_24h"`
		Price            decimal.Decimal `json:"price"`
		Volume24h        decimal.Decimal `json:"volume_24h"`
	} `json:"quote"`
}

Jump to

Keyboard shortcuts

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