coingecko

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EthereumCoinID = "ethereum"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinGecko added in v0.2.7

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

CoinGecko wraps the client to retrieve information from their API.

func NewCoingecko added in v0.2.7

func NewCoingecko(logger zerolog.Logger, endpointConfig *Config) *CoinGecko

NewCoingecko grabs the symbol, given a contract address.

func (*CoinGecko) GetTokenSymbol added in v0.2.7

func (cp *CoinGecko) GetTokenSymbol(erc20Contract ethcmn.Address) (string, error)

GetTokenSymbol returns the token symbol checked by CoinGecko API.

type CoinInfo added in v0.2.7

type CoinInfo struct {
	Symbol string `json:"symbol"`
	Error  string `json:"error"`
}

CoinInfo wraps the coin information received from a contract address.

Ref : https://api.coingecko.com/api/v3/coins/ethereum/contract/${CONTRACT_ADDR}

type Config

type Config struct {
	BaseURL string
}

Config wraps the config variable to get CoinGecko information.

Jump to

Keyboard shortcuts

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