Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ETH - the ethereum currency. ETH currency = "ethereum" // MYST - the mysterium coin. MYST currency = "mysterium" // MATIC - the matic coin. MATIC currency = "matic-network" // USD - the good old dollar. USD currency = "usd" // EUR - the official currency of the European Union EUR currency = "eur" )
View Source
const DefaultCoinRankingURI = "https://api.coinranking.com/v2/"
DefaultCoinRankingURI points to default CoinRanking api.
View Source
const DefaultGeckoURI = "https://api.coingecko.com/api/v3"
DefaultGeckoURI points to default coingecko api.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoinRanking ¶
type CoinRanking struct {
// contains filtered or unexported fields
}
CoinRanking represents a CoinRanking REST API client.
func NewCoinRanking ¶
func NewCoinRanking(baseURI string, coinRankingAccessToken *string) *CoinRanking
NewCoinRanking returns a new CoinRanking API client.
func (*CoinRanking) GetCoinPrice ¶
func (g *CoinRanking) GetCoinPrice(coins []string, vsCurrencies []string) (PriceResponse, error)
GetCoinPrice returns the coin price in the given currencies for given coins.
type Gecko ¶
type Gecko struct {
// contains filtered or unexported fields
}
Gecko represents a gecko REST API client.
func (*Gecko) GetCoinPrice ¶
func (g *Gecko) GetCoinPrice(coins []string, vsCurrencies []string) (PriceResponse, error)
GetCoinPrice returns the coin price in the given currencies for given coins.
type PriceResponse ¶
PriceResponse represents the gecko price response.
func (PriceResponse) GetPriceInUSD ¶
func (pr PriceResponse) GetPriceInUSD(c currency) (float64, bool)
GetPriceInUSD returns the price in USD.
Click to show internal directories.
Click to hide internal directories.