coingecko

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const BaseURL = "https://api.coingecko.com/api/v3"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client struct

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient create new client object

func NewLimitClient

func NewLimitClient(b int, every time.Duration, cli *http.Client) *Client

func (*Client) CoinContract

func (c *Client) CoinContract(networkID, contract string,
	localization, tickers, marketData, communityData, developerData, sparkline bool,
) (*types.CoinsID, error)

Contract Coin info from contract address

func (*Client) CoinsID

func (c *Client) CoinsID(id string, localization bool, tickers bool, marketData bool, communityData bool, developerData bool, sparkline bool) (*types.CoinsID, error)

CoinsID /coins/{id}

func (*Client) CoinsIDHistory

func (c *Client) CoinsIDHistory(id string, date string, localization bool) (*types.CoinsIDHistory, error)

CoinsIDHistory /coins/{id}/history?date={date}&localization=false

func (*Client) CoinsIDMarketChart

func (c *Client) CoinsIDMarketChart(id string, vs_currency string, days string) (*types.CoinsIDMarketChart, error)

CoinsIDMarketChart /coins/{id}/market_chart?vs_currency={usd, eur, jpy, etc.}&days={1,14,30,max}

func (*Client) CoinsIDTickers

func (c *Client) CoinsIDTickers(id string, page int) (*types.CoinsIDTickers, error)

CoinsIDTickers /coins/{id}/tickers

func (*Client) CoinsList

func (c *Client) CoinsList() (types.CoinList, error)

CoinsList /coins/list

func (*Client) CoinsMarket

func (c *Client) CoinsMarket(vsCurrency string, ids []string, order string, perPage int, page int, sparkline bool, priceChangePercentage []string) (types.CoinsMarket, error)

CoinsMarket /coins/market

func (*Client) EventsCountries

func (c *Client) EventsCountries() ([]*types.EventCountryItem, error)

EventsCountries https://api.coingecko.com/api/v3/events/countries

func (*Client) EventsTypes

func (c *Client) EventsTypes() (*types.EventsTypes, error)

EventsTypes https://api.coingecko.com/api/v3/events/types

func (*Client) ExchangeIDTickers

func (c *Client) ExchangeIDTickers(exchangeID string, coinIDs []string) (*types.ExchangeIDTickers, error)

Get exchange tickers (paginated)

func (*Client) ExchangeRates

func (c *Client) ExchangeRates() (*types.ExchangeRatesItem, error)

ExchangeRates https://api.coingecko.com/api/v3/exchange_rates

func (*Client) Exchanges

func (c *Client) Exchanges(perPage int, page int) (types.ExchangesDetail, error)

Exchanges list, paginated

func (*Client) ExchangesList

func (c *Client) ExchangesList() (types.ExchangesBase, error)

Exchanges list, no pagination required

func (*Client) Global

func (c *Client) Global() (*types.Global, error)

Global https://api.coingecko.com/api/v3/global

func (*Client) MakeReq

func (c *Client) MakeReq(url string) ([]byte, error)

MakeReq HTTP request helper

func (*Client) Ping

func (c *Client) Ping() (*types.Ping, error)

Ping /ping endpoint

func (*Client) SimplePrice

func (c *Client) SimplePrice(ids []string, vsCurrencies []string) (map[string]map[string]float64, error)

SimplePrice /simple/price Multiple ID and Currency (ids, vs_currencies)

func (*Client) SimpleSinglePrice

func (c *Client) SimpleSinglePrice(id string, vsCurrency string) (*types.SimpleSinglePrice, error)

SimpleSinglePrice /simple/price Single ID and Currency (ids, vs_currency)

func (*Client) SimpleSupportedVSCurrencies

func (c *Client) SimpleSupportedVSCurrencies() (*types.SimpleSupportedVSCurrencies, error)

SimpleSupportedVSCurrencies /simple/supported_vs_currencies

func (*Client) SimpleTokenPrices

func (c *Client) SimpleTokenPrices(platformID string, contracts, vsCurrencies []string) (map[string]map[string]float64, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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