coingecko

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertCoingeckoPrices

func ConvertCoingeckoPrices(prices []MarketTicker) []types.TokenPrice

func GetTokensPrices

func GetTokensPrices(ids []string) ([]types.TokenPrice, error)

GetTokensPrices queries the remote APIs to get the token prices of all the tokens having the given ids

Types

type MarketTicker

type MarketTicker struct {
	Symbol       string    `json:"symbol"`
	CurrentPrice float64   `json:"current_price"`
	MarketCap    float64   `json:"market_cap"`
	LastUpdated  time.Time `json:"last_updated"`
}

MarketTicker contains the current market data for a single token

type MarketTickers

type MarketTickers []MarketTicker

MarketTickers is an array of MarketTicker

type Token

type Token struct {
	ID     string `json:"id"`
	Symbol string `json:"symbol"`
	Name   string `json:"name"`
}

Token contains the information of a single token

type Tokens

type Tokens []Token

Tokens represents a list of Token objects

func GetCoinsList

func GetCoinsList() (coins Tokens, err error)

GetCoinsList allows to fetch from the remote APIs the list of all the supported tokens

Jump to

Keyboard shortcuts

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