coingecko

package
v0.0.0-...-efbd42f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChainIDs

func GetChainIDs(p2pNetwork string) []string

GetChainIDs returns the coingecko chain ids for the given p2p network.

Types

type CoingeckoAPI

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

CoingeckoAPI is a client for the coingecko API

func NewCoingeckoAPI

func NewCoingeckoAPI(url string) *CoingeckoAPI

NewCoingeckoAPI creates a new coingecko client

func (*CoingeckoAPI) GetNotionalUSD

func (c *CoingeckoAPI) GetNotionalUSD(ids []string) (map[string]NotionalUSD, error)

GetNotionalUSD returns the notional USD value for the given ids ids is a list of coingecko chain identifier.

type NotionalUSD

type NotionalUSD struct {
	Price *decimal.Decimal `json:"usd"`
}

NotionalUSD is the response from the coingecko API.

Jump to

Keyboard shortcuts

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