price

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRICE_TTL       = time.Minute * 60
	DEFAULT_TIMEOUT = time.Second * 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinmarketcapAPI

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

func NewCoinmarketcapAPI

func NewCoinmarketcapAPI(url string, apiKey string) *CoinmarketcapAPI

func (*CoinmarketcapAPI) TokenPrice

func (c *CoinmarketcapAPI) TokenPrice(symbol string) (float64, error)

type CoinmarketcapResponse

type CoinmarketcapResponse struct {
	Status struct {
		ErrorCode    int    `json:"error_code"`
		ErrorMessage string `json:"error_message"`
	} `json:"status"`
	Data map[string]struct {
		Quote struct {
			USD struct {
				Price float64 `json:"price"`
			} `json:"USD"`
		} `json:"quote"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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